first
This commit is contained in:
44
safekiso-server/node_modules/snyk/dist/lib/apps/constants.d.ts
generated
vendored
Normal file
44
safekiso-server/node_modules/snyk/dist/lib/apps/constants.d.ts
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
export declare const SNYK_APP_NAME = "snykAppName";
|
||||
export declare const SNYK_APP_REDIRECT_URIS = "snykAppRedirectUris";
|
||||
export declare const SNYK_APP_SCOPES = "snykAppScopes";
|
||||
export declare const SNYK_APP_CLIENT_ID = "snykAppClientId";
|
||||
export declare const SNYK_APP_ORG_ID = "snykAppOrgId";
|
||||
export declare const SNYK_APP_CONTEXT = "context";
|
||||
export declare const SNYK_APP_DEBUG = "snyk:apps";
|
||||
export declare enum EValidSubCommands {
|
||||
CREATE = "create"
|
||||
}
|
||||
export declare enum EAppsURL {
|
||||
CREATE_APP = 0
|
||||
}
|
||||
export declare const validAppsSubCommands: string[];
|
||||
export declare const AppsErrorMessages: {
|
||||
orgRequired: string;
|
||||
nameRequired: string;
|
||||
redirectUrisRequired: string;
|
||||
scopesRequired: string;
|
||||
invalidContext: string;
|
||||
useExperimental: string;
|
||||
};
|
||||
export declare const CreateAppPromptData: {
|
||||
SNYK_APP_NAME: {
|
||||
name: string;
|
||||
message: string;
|
||||
};
|
||||
SNYK_APP_REDIRECT_URIS: {
|
||||
name: string;
|
||||
message: string;
|
||||
};
|
||||
SNYK_APP_SCOPES: {
|
||||
name: string;
|
||||
message: string;
|
||||
};
|
||||
SNYK_APP_ORG_ID: {
|
||||
name: string;
|
||||
message: string;
|
||||
};
|
||||
SNYK_APP_CONTEXT: {
|
||||
name: string;
|
||||
message: string;
|
||||
};
|
||||
};
|
||||
9
safekiso-server/node_modules/snyk/dist/lib/apps/create-app/index.d.ts
generated
vendored
Normal file
9
safekiso-server/node_modules/snyk/dist/lib/apps/create-app/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { ICreateAppRequest, ICreateAppOptions } from '..';
|
||||
/**
|
||||
* Validates and parsed the data required to create app.
|
||||
* Throws error if option is not provided or is invalid
|
||||
* @param {ICreateAppOptions} options required to create an app
|
||||
* @returns {ICreateAppRequest} data that is used to make the request
|
||||
*/
|
||||
export declare function createAppDataScriptable(options: ICreateAppOptions): ICreateAppRequest;
|
||||
export declare function createAppDataInteractive(): Promise<ICreateAppRequest>;
|
||||
6
safekiso-server/node_modules/snyk/dist/lib/apps/index.d.ts
generated
vendored
Normal file
6
safekiso-server/node_modules/snyk/dist/lib/apps/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
export * from './constants';
|
||||
export * from './prompts';
|
||||
export * from './types';
|
||||
export * from './rest-utils';
|
||||
export * from './utils';
|
||||
export * from './input-validator';
|
||||
33
safekiso-server/node_modules/snyk/dist/lib/apps/input-validator.d.ts
generated
vendored
Normal file
33
safekiso-server/node_modules/snyk/dist/lib/apps/input-validator.d.ts
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
*
|
||||
* @param {String} input of space separated URL/URI passed by
|
||||
* user for redirect URIs
|
||||
* @returns { String | Boolean } complying with enquirer return values, the function
|
||||
* separates the string on space and validates each to see
|
||||
* if a valid URL/URI. Return a string if invalid and
|
||||
* boolean true if valid
|
||||
*/
|
||||
export declare function validateAllURL(input: string): string | boolean;
|
||||
/**
|
||||
* Custom validation logic which takes in consideration
|
||||
* creation of Snyk Apps and thus allows localhost.com
|
||||
* as a valid URL.
|
||||
* @param {String} input of URI/URL value to validate using
|
||||
* regex
|
||||
* @returns {String | Boolean } string message is not valid
|
||||
* and boolean true if valid
|
||||
*/
|
||||
export declare function validURL(input: string): boolean | string;
|
||||
/**
|
||||
* Function validates if a valid UUID (version of UUID not tacken into account)
|
||||
* @param {String} input UUID to be validated
|
||||
* @returns {String | Boolean } string message is not valid
|
||||
* and boolean true if valid
|
||||
*/
|
||||
export declare function validateUUID(input: string): boolean | string;
|
||||
/**
|
||||
* @param {String} input
|
||||
* @returns {String | Boolean } string message is not valid
|
||||
* and boolean true if valid
|
||||
*/
|
||||
export declare function validInput(input: string): string | boolean;
|
||||
19
safekiso-server/node_modules/snyk/dist/lib/apps/prompts.d.ts
generated
vendored
Normal file
19
safekiso-server/node_modules/snyk/dist/lib/apps/prompts.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { validInput } from './input-validator';
|
||||
/**
|
||||
* Prompts for $snyk apps create command
|
||||
*/
|
||||
export declare const createAppPrompts: ({
|
||||
name: string;
|
||||
type: string;
|
||||
message: string;
|
||||
validate: typeof validInput;
|
||||
choices?: undefined;
|
||||
initial?: undefined;
|
||||
} | {
|
||||
name: string;
|
||||
type: string;
|
||||
message: string;
|
||||
choices: string[];
|
||||
initial: string;
|
||||
validate?: undefined;
|
||||
})[];
|
||||
8
safekiso-server/node_modules/snyk/dist/lib/apps/rest-utils.d.ts
generated
vendored
Normal file
8
safekiso-server/node_modules/snyk/dist/lib/apps/rest-utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Collection of utility function for the
|
||||
* $snyk apps commands
|
||||
*/
|
||||
import { EAppsURL, ICreateAppResponse, IGetAppsURLOpts } from '.';
|
||||
export declare function getAppsURL(selection: EAppsURL, opts?: IGetAppsURLOpts): string;
|
||||
export declare function handleRestError(error: any): void;
|
||||
export declare function handleCreateAppRes(res: ICreateAppResponse): string;
|
||||
56
safekiso-server/node_modules/snyk/dist/lib/apps/types.d.ts
generated
vendored
Normal file
56
safekiso-server/node_modules/snyk/dist/lib/apps/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
export type AppContext = 'tenant' | 'user';
|
||||
export interface IGetAppsURLOpts {
|
||||
orgId?: string;
|
||||
clientId?: string;
|
||||
}
|
||||
interface IJSONApi {
|
||||
version: string;
|
||||
}
|
||||
export interface ICreateAppResponse {
|
||||
jsonapi: IJSONApi;
|
||||
data: {
|
||||
type: string;
|
||||
id: string;
|
||||
attributes: {
|
||||
name: string;
|
||||
client_id: string;
|
||||
redirect_uris: string[];
|
||||
scopes: string[];
|
||||
is_public: boolean;
|
||||
client_secret: string;
|
||||
access_token_ttl_seconds: number;
|
||||
};
|
||||
links: {
|
||||
self: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
export interface IRestErrorResponse {
|
||||
jsonapi: IJSONApi;
|
||||
errors: [
|
||||
{
|
||||
status: string;
|
||||
detail: string;
|
||||
source?: any;
|
||||
meta?: any;
|
||||
}
|
||||
];
|
||||
}
|
||||
export interface IGenerateAppsOptions {
|
||||
interactive?: boolean;
|
||||
}
|
||||
export interface ICreateAppOptions extends IGenerateAppsOptions {
|
||||
org?: string;
|
||||
name?: string;
|
||||
redirectUris?: string;
|
||||
scopes?: string;
|
||||
context?: AppContext;
|
||||
}
|
||||
export interface ICreateAppRequest {
|
||||
orgId: string;
|
||||
snykAppName: string;
|
||||
snykAppRedirectUris: string[];
|
||||
snykAppScopes: string[];
|
||||
context?: AppContext;
|
||||
}
|
||||
export {};
|
||||
1
safekiso-server/node_modules/snyk/dist/lib/apps/utils.d.ts
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/lib/apps/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function readAppsHelpMarkdown(filename: string): string;
|
||||
Reference in New Issue
Block a user