Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.program = exports.getStdIn = exports.setStdIn = void 0; const commander_1 = require("commander"); require("../utils/checkConfig"); const clone_1 = require("../commands/clone"); const restore_1 = require("../commands/restore"); const diff_1 = require("../commands/diff"); const push_1 = require("../commands/push"); const pull_1 = require("../commands/pull"); const init_1 = require("../commands/init"); const train_1 = require("../commands/train"); const create_1 = require("../commands/create"); const exportcsv_1 = require("../commands/exportcsv"); const importcsv_1 = require("../commands/importcsv"); const execute_1 = require("../commands/execute"); const translate_1 = require("../commands/translate"); const localize_1 = require("../commands/localize"); const run_1 = require("../commands/run"); const knowledgeAIProgram_1 = require("./knowledgeAIProgram"); let stdin = ''; const setStdIn = (input) => { stdin += input; }; exports.setStdIn = setStdIn; const getStdIn = () => stdin; exports.getStdIn = getStdIn; exports.program = new commander_1.Command(); const packageJson = require('./../../package.json'); const appVersion = packageJson.version; exports.program.version(appVersion); exports.program .command('init') .description('Initializes a new Cognigy.AI CLI project') .action(async () => { await (0, init_1.init)(); }); exports.program .command('clone') .option('-t, --type <resourceType>', 'what type of resource to clone') .option('-c, --config <configFile>', 'force the use of a specific config file') .option('-y, --forceYes', 'skips warnings and overwrites all content') .description('Clones a virtual agent from Cognigy.AI into a local directory') .action(async (cmdObj) => { await (0, clone_1.clone)({ resourceType: cmdObj.type, forceYes: cmdObj.forceYes }); }); exports.program .command('restore') .option('-t, --type <resourceType>', 'what type of resource to restore') .option('-c, --config <configFile>', 'force the use of a specific config file') .option('-y, --forceYes', 'skips warnings and overwrites all content') .description('Restores a virtual agent from disk to Cognigy.AI') .action(async (cmdObj) => { await (0, restore_1.restore)({ resourceType: cmdObj.type, forceYes: cmdObj.forceYes }); }); exports.program .command('diff <resourceType> <resourceId>') .option('-m, --mode <mode>', 'full or node diff mode') .option('-c, --config <configFile>', 'force the use of a specific config file') .description('Compares a local <resourceType> resource with <resourceId> to its corresponding remote resource') .action(async (resourceType, resourceId, cmdObj) => { await (0, diff_1.diff)(resourceType, resourceId, cmdObj.mode); }); exports.program .command('push <resourceType> <resourceName>') .option('-c, --config <configFile>', 'force the use of a specific config file') .option('-y, --forceYes', 'skips warnings and overwrites all content') .option('-t, --timeout <ms>', 'timeout for training') .description('Pushes a resource from disk to Cognigy.AI') .action(async (resourceType, resourceName, cmdObj) => { await (0, push_1.push)({ resourceType, resourceName, options: cmdObj }); }); exports.program .command('pull <resourceType> [resourceName]') .option('-c, --config <configFile>', 'force the use of a specific config file') .option('-y, --forceYes', 'skips warnings and overwrites all content') .description('Pulls a resource from Cognigy.AI to disk') .action(async (resourceType, resourceName, cmdObj) => { await (0, pull_1.pull)({ resourceType, resourceName, forceYes: cmdObj.forceYes }); }); exports.program .command('train <resourceType> <resourceName>') .description('Trains the intent models of a Flow') .option('-t, --timeout <ms>', 'timeout for training') .action(async (resourceType, resourceName, cmdObj) => { await (0, train_1.train)({ resourceName, timeout: cmdObj.timeout }); }); exports.program .command('create <resourceType> <resourceName> [resourceDescription]') .description('Creates a Snapshot and downloads it or creates a Locale') .option('-c, --config <configFile>', 'force the use of a specific config file') .option('-t, --timeout <ms>', 'timeout for creating the snapshot') .option('-s, --skipDownload', 'skip downloading the snapshot') .option('--lf, --fallbackLocale <localeId>', 'fallback locale ID') .option('--lnlu, --nluLanguage <languageCode>', 'NLU to use') .action(async (resourceType, resourceName, resourceDescription = 'Cognigy.AI CLI', cmdObj) => { await (0, create_1.create)({ resourceType, resourceName, description: resourceDescription, timeout: cmdObj.timeout, skipDownload: cmdObj.skipDownload, fallbackLocale: cmdObj.fallbackLocale, nluLanguage: cmdObj.nluLanguage, }); }); exports.program .command('exportcsv <resourceType> [resourceName]') .option('-c, --config <configFile>', 'force the use of a specific config file') .option('-y, --forceYes', 'skips warnings and overwrites all content') .description('Exports the content of a Flow to CSV') .action(async (resourceType, resourceName, cmdObj) => { await (0, exportcsv_1.exportcsv)({ resourceType, resourceName }); }); exports.program .command('importcsv <resourceType> [resourceName]') .option('-c, --config <configFile>', 'force the use of a specific config file') .option('-y, --forceYes', 'skips warnings and overwrites all content') .description('Imports the content of a Flow from CSV') .action(async (resourceType, resourceName, cmdObj) => { await (0, importcsv_1.importcsv)({ resourceType, resourceName }); }); exports.program .command('localize <resourceType> [resourceName]') .option('-c, --config <configFile>', 'force the use of a specific config file') .option('-l, --localeName <localeName>', 'locale to process') .option('--sl, --sourceLocale <sourceLocaleName>', 'locale to copy from') .option('--li, --localizeIntents', 'adds localization to Flow Intents') .option('--ln, --localizeNodes', 'adds localization to Flow Nodes') .option('--co, --contentOnly', 'adds localization only to Flow Nodes of type Say, Question and Optional Question') .option('-r, --reverse', 'removes the localization from the selected Flow') .option('-y, --forceYes', 'skips warnings and overwrites all content') .description('Adds missing localizations to Flow Intents and Nodes') .action(async (resourceType, resourceName, cmdObj) => { await (0, localize_1.localize)({ resourceType, resourceName, options: cmdObj }); }); exports.program .command('translate <resourceType> <resourceName>') .description('Translate a resource') .option('-l, --localeName <localeName>', 'locale to process') .option('--fl, --fromLanguage <fromLanguageCode>', 'language to translate from') .option('--tl, --toLanguage <targetLanguageCode>', 'language to translate to') .option('--tr, --translator <translator>', 'the translation tool, google, microsoft or deepl') .option('--ti, --translateIntents', 'adds localization to Flow Intents') .option('--tn, --translateNodes', 'adds localization to Flow Nodes') .option('-k, --apiKey <apiKey>', 'the translator api key') .option('-y, --forceYes', 'skips warnings and overwrites all content') .action(async (resourceType, resourceName, cmdObj) => { await (0, translate_1.translate)({ resourceType, resourceName, options: cmdObj }); }); exports.program .command('execute [command]') .option('-c, --config <configFile>', 'force the use of a specific config file') .option('-d, --data <data>', 'the JSON data to pass to the command') .option('-l, --list', 'lists all available commands') .description('Executes a command of the Cognigy API client') .action(async (command, cmdObj) => { await (0, execute_1.execute)({ command, options: cmdObj, stdin }); }); exports.program .command('run <resourceType> [playbookFile]') .option('-c, --config <configFile>', 'force the use of a specific config file') .option('-l, --list', 'lists all available commands') .description('Schedules one or more playbooks to run') .action(async (resourceType, playbookFile, cmdObj) => { await (0, run_1.run)({ resourceType, playbookFile, options: cmdObj }); }); exports.program.addCommand((0, knowledgeAIProgram_1.makeKnowledgeAIProgram)()); |