"Fossies" - the Fresh Open Source Software Archive

Member "cli-1.1280.1/src/lib/apps/constants.ts" (20 Feb 2024, 2814 Bytes) of package /linux/misc/snyk-cli-1.1280.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 import chalk from 'chalk';
    2 
    3 export const SNYK_APP_NAME = 'snykAppName';
    4 export const SNYK_APP_REDIRECT_URIS = 'snykAppRedirectUris';
    5 export const SNYK_APP_SCOPES = 'snykAppScopes';
    6 export const SNYK_APP_CLIENT_ID = 'snykAppClientId';
    7 export const SNYK_APP_ORG_ID = 'snykAppOrgId';
    8 export const SNYK_APP_CONTEXT = 'context';
    9 export const SNYK_APP_DEBUG = 'snyk:apps';
   10 
   11 export enum EValidSubCommands {
   12   CREATE = 'create',
   13 }
   14 
   15 export enum EAppsURL {
   16   CREATE_APP,
   17 }
   18 
   19 export const validAppsSubCommands = Object.values<string>(EValidSubCommands);
   20 
   21 export const AppsErrorMessages = {
   22   orgRequired: `Option '--org' is required! For interactive mode, please use '--interactive' or '-i' flag. For more information please run the help command 'snyk apps --help' or 'snyk apps -h'.`,
   23   nameRequired: `Option '--name' is required! For interactive mode, please use '--interactive' or '-i' flag. For more information please run the help command 'snyk apps --help' or 'snyk apps -h'.`,
   24   redirectUrisRequired: `Option '--redirect-uris' is required! For interactive mode, please use '--interactive' or '-i' flag. For more information please run the help command 'snyk apps --help' or 'snyk apps -h'.`,
   25   scopesRequired: `Option '--scopes' is required! For interactive mode, please use '--interactive' or '-i' flag. For more information please run the help command 'snyk apps --help' or 'snyk apps -h'.`,
   26   invalidContext: `Option '--context' must be either 'tenant' or 'user'! For interactive mode, please use '--interactive' or '-i' flag. For more information please run the help command 'snyk apps --help' or 'snyk apps -h'.`,
   27   useExperimental: `\n${chalk.redBright(
   28     "All 'apps' commands are only accessible behind the '--experimental' flag.",
   29   )}\n
   30 The behaviour can change at any time, without prior notice.
   31 You are kindly advised to use all the commands with caution.
   32 
   33 ${chalk.bold('Usage')}
   34   ${chalk.italic('snyk apps <COMMAND> --experimental')}\n`,
   35 };
   36 
   37 export const CreateAppPromptData = {
   38   SNYK_APP_NAME: {
   39     name: SNYK_APP_NAME,
   40     message: `Name of the Snyk App (visible to users when they install the Snyk App)?`,
   41   },
   42   SNYK_APP_REDIRECT_URIS: {
   43     name: SNYK_APP_REDIRECT_URIS,
   44     message: `Your Snyk App's redirect URIs (comma seprated list. ${chalk.yellowBright(
   45       ' Ex: https://example1.com,https://example2.com',
   46     )})?: `,
   47   },
   48   SNYK_APP_SCOPES: {
   49     name: SNYK_APP_SCOPES,
   50     message: `Your Snyk App's permission scopes (comma separated list. ${chalk.yellowBright(
   51       ' Ex: org.read,org.report.read',
   52     )})?: `,
   53   },
   54   SNYK_APP_ORG_ID: {
   55     name: SNYK_APP_ORG_ID,
   56     message:
   57       'Please provide the org id under which you want to create your Snyk App: ',
   58   },
   59   SNYK_APP_CONTEXT: {
   60     name: SNYK_APP_CONTEXT,
   61     message: 'Which context will your app operate under: ',
   62   },
   63 };