@botpress/cli 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +10 -10
- package/dist/api/bot-body.js +4 -0
- package/dist/api/bot-body.js.map +1 -1
- package/dist/api/client.js +4 -0
- package/dist/api/client.js.map +1 -1
- package/dist/api/find-previous-version.js +4 -0
- package/dist/api/find-previous-version.js.map +1 -1
- package/dist/api/find-previous-version.test.js +4 -0
- package/dist/api/find-previous-version.test.js.map +1 -1
- package/dist/api/integration-body.js +4 -0
- package/dist/api/integration-body.js.map +1 -1
- package/dist/api/interface-body.js +4 -0
- package/dist/api/interface-body.js.map +1 -1
- package/dist/api/paging.js.map +1 -1
- package/dist/api/plugin-body.js +5 -0
- package/dist/api/plugin-body.js.map +1 -1
- package/dist/code-generation/bot-implementation/bot-implementation.js +5 -0
- package/dist/code-generation/bot-implementation/bot-implementation.js.map +1 -1
- package/dist/code-generation/bot-implementation/bot-plugins/index.js +4 -0
- package/dist/code-generation/bot-implementation/bot-plugins/index.js.map +1 -1
- package/dist/code-generation/bot-implementation/bot-plugins/plugin-module.js +4 -0
- package/dist/code-generation/bot-implementation/bot-plugins/plugin-module.js.map +1 -1
- package/dist/code-generation/bot-implementation/bot-typings/actions-module.js +4 -0
- package/dist/code-generation/bot-implementation/bot-typings/actions-module.js.map +1 -1
- package/dist/code-generation/bot-implementation/bot-typings/events-module.js +4 -0
- package/dist/code-generation/bot-implementation/bot-typings/events-module.js.map +1 -1
- package/dist/code-generation/bot-implementation/bot-typings/index.js +4 -0
- package/dist/code-generation/bot-implementation/bot-typings/index.js.map +1 -1
- package/dist/code-generation/bot-implementation/bot-typings/states-module.js +4 -0
- package/dist/code-generation/bot-implementation/bot-typings/states-module.js.map +1 -1
- package/dist/code-generation/bot-implementation/index.js +5 -0
- package/dist/code-generation/bot-implementation/index.js.map +1 -1
- package/dist/code-generation/generators.js +5 -0
- package/dist/code-generation/generators.js.map +1 -1
- package/dist/code-generation/integration-implementation/index.js +4 -0
- package/dist/code-generation/integration-implementation/index.js.map +1 -1
- package/dist/code-generation/integration-implementation/integration-implementation.js +4 -0
- package/dist/code-generation/integration-implementation/integration-implementation.js.map +1 -1
- package/dist/code-generation/integration-implementation/integration-secret.js +4 -0
- package/dist/code-generation/integration-implementation/integration-secret.js.map +1 -1
- package/dist/code-generation/integration-implementation/integration-typings/actions-module.js +4 -0
- package/dist/code-generation/integration-implementation/integration-typings/actions-module.js.map +1 -1
- package/dist/code-generation/integration-implementation/integration-typings/channels-module.js +4 -0
- package/dist/code-generation/integration-implementation/integration-typings/channels-module.js.map +1 -1
- package/dist/code-generation/integration-implementation/integration-typings/configuration-module.js +4 -0
- package/dist/code-generation/integration-implementation/integration-typings/configuration-module.js.map +1 -1
- package/dist/code-generation/integration-implementation/integration-typings/configurations-module.js +4 -0
- package/dist/code-generation/integration-implementation/integration-typings/configurations-module.js.map +1 -1
- package/dist/code-generation/integration-implementation/integration-typings/entities-module.js +4 -0
- package/dist/code-generation/integration-implementation/integration-typings/entities-module.js.map +1 -1
- package/dist/code-generation/integration-implementation/integration-typings/events-module.js +4 -0
- package/dist/code-generation/integration-implementation/integration-typings/events-module.js.map +1 -1
- package/dist/code-generation/integration-implementation/integration-typings/states-module.js +4 -0
- package/dist/code-generation/integration-implementation/integration-typings/states-module.js.map +1 -1
- package/dist/code-generation/integration-package/index.js +4 -0
- package/dist/code-generation/integration-package/index.js.map +1 -1
- package/dist/code-generation/integration-package/integration-package-definition/actions-module.js +4 -0
- package/dist/code-generation/integration-package/integration-package-definition/actions-module.js.map +1 -1
- package/dist/code-generation/integration-package/integration-package-definition/channels-module.js +4 -0
- package/dist/code-generation/integration-package/integration-package-definition/channels-module.js.map +1 -1
- package/dist/code-generation/integration-package/integration-package-definition/configuration-module.js +5 -0
- package/dist/code-generation/integration-package/integration-package-definition/configuration-module.js.map +1 -1
- package/dist/code-generation/integration-package/integration-package-definition/configurations-module.js +4 -0
- package/dist/code-generation/integration-package/integration-package-definition/configurations-module.js.map +1 -1
- package/dist/code-generation/integration-package/integration-package-definition/entities-module.js +4 -0
- package/dist/code-generation/integration-package/integration-package-definition/entities-module.js.map +1 -1
- package/dist/code-generation/integration-package/integration-package-definition/events-module.js +4 -0
- package/dist/code-generation/integration-package/integration-package-definition/events-module.js.map +1 -1
- package/dist/code-generation/integration-package/integration-package-definition/index.js +4 -0
- package/dist/code-generation/integration-package/integration-package-definition/index.js.map +1 -1
- package/dist/code-generation/integration-package/integration-package-definition/states-module.js +4 -0
- package/dist/code-generation/integration-package/integration-package-definition/states-module.js.map +1 -1
- package/dist/code-generation/interface-implementation/integration-typings/actions-module.js +4 -0
- package/dist/code-generation/interface-implementation/integration-typings/actions-module.js.map +1 -1
- package/dist/code-generation/interface-implementation/integration-typings/channels-module.js +4 -0
- package/dist/code-generation/interface-implementation/integration-typings/channels-module.js.map +1 -1
- package/dist/code-generation/interface-implementation/integration-typings/entities-module.js +4 -0
- package/dist/code-generation/interface-implementation/integration-typings/entities-module.js.map +1 -1
- package/dist/code-generation/interface-implementation/integration-typings/events-module.js +4 -0
- package/dist/code-generation/interface-implementation/integration-typings/events-module.js.map +1 -1
- package/dist/code-generation/interface-implementation/integration-typings/index.js +4 -0
- package/dist/code-generation/interface-implementation/integration-typings/index.js.map +1 -1
- package/dist/code-generation/interface-package/index.js +4 -0
- package/dist/code-generation/interface-package/index.js.map +1 -1
- package/dist/code-generation/interface-package/interface-package-definition/actions-module.js +4 -0
- package/dist/code-generation/interface-package/interface-package-definition/actions-module.js.map +1 -1
- package/dist/code-generation/interface-package/interface-package-definition/channels-module.js +4 -0
- package/dist/code-generation/interface-package/interface-package-definition/channels-module.js.map +1 -1
- package/dist/code-generation/interface-package/interface-package-definition/entities-module.js +4 -0
- package/dist/code-generation/interface-package/interface-package-definition/entities-module.js.map +1 -1
- package/dist/code-generation/interface-package/interface-package-definition/events-module.js +4 -0
- package/dist/code-generation/interface-package/interface-package-definition/events-module.js.map +1 -1
- package/dist/code-generation/interface-package/interface-package-definition/index.js +4 -0
- package/dist/code-generation/interface-package/interface-package-definition/index.js.map +1 -1
- package/dist/code-generation/module.js +7 -0
- package/dist/code-generation/module.js.map +1 -1
- package/dist/code-generation/plugin-implementation/index.js +4 -0
- package/dist/code-generation/plugin-implementation/index.js.map +1 -1
- package/dist/code-generation/plugin-implementation/plugin-implementation.js +4 -0
- package/dist/code-generation/plugin-implementation/plugin-implementation.js.map +1 -1
- package/dist/code-generation/plugin-implementation/plugin-typings/actions-module.js +4 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/actions-module.js.map +1 -1
- package/dist/code-generation/plugin-implementation/plugin-typings/configuration-module.js +4 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/configuration-module.js.map +1 -1
- package/dist/code-generation/plugin-implementation/plugin-typings/events-module.js +4 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/events-module.js.map +1 -1
- package/dist/code-generation/plugin-implementation/plugin-typings/index.js +4 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/index.js.map +1 -1
- package/dist/code-generation/plugin-implementation/plugin-typings/states-module.js +4 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/states-module.js.map +1 -1
- package/dist/code-generation/plugin-package/index.js +5 -0
- package/dist/code-generation/plugin-package/index.js.map +1 -1
- package/dist/code-generation/plugin-package/plugin-package-definition/actions-module.js +4 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/actions-module.js.map +1 -1
- package/dist/code-generation/plugin-package/plugin-package-definition/configuration-module.js +4 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/configuration-module.js.map +1 -1
- package/dist/code-generation/plugin-package/plugin-package-definition/events-module.js +4 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/events-module.js.map +1 -1
- package/dist/code-generation/plugin-package/plugin-package-definition/index.js +4 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/index.js.map +1 -1
- package/dist/code-generation/plugin-package/plugin-package-definition/states-module.js +4 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/states-module.js.map +1 -1
- package/dist/code-generation/strings.js +4 -0
- package/dist/code-generation/strings.js.map +1 -1
- package/dist/command-definitions.js +4 -0
- package/dist/command-definitions.js.map +1 -1
- package/dist/command-implementations/add-command.js +67 -15
- package/dist/command-implementations/add-command.js.map +2 -2
- package/dist/command-implementations/base-command.js +4 -0
- package/dist/command-implementations/base-command.js.map +1 -1
- package/dist/command-implementations/bot-commands.js +4 -0
- package/dist/command-implementations/bot-commands.js.map +1 -1
- package/dist/command-implementations/bundle-command.js +4 -0
- package/dist/command-implementations/bundle-command.js.map +1 -1
- package/dist/command-implementations/deploy-command.js +4 -0
- package/dist/command-implementations/deploy-command.js.map +1 -1
- package/dist/command-implementations/dev-command.js +4 -0
- package/dist/command-implementations/dev-command.js.map +1 -1
- package/dist/command-implementations/gen-command.js +6 -1
- package/dist/command-implementations/gen-command.js.map +2 -2
- package/dist/command-implementations/global-command.js +4 -0
- package/dist/command-implementations/global-command.js.map +1 -1
- package/dist/command-implementations/index.js +4 -0
- package/dist/command-implementations/index.js.map +1 -1
- package/dist/command-implementations/init-command.js +4 -0
- package/dist/command-implementations/init-command.js.map +1 -1
- package/dist/command-implementations/integration-commands.js +4 -0
- package/dist/command-implementations/integration-commands.js.map +1 -1
- package/dist/command-implementations/interface-commands.js +4 -0
- package/dist/command-implementations/interface-commands.js.map +1 -1
- package/dist/command-implementations/lint-command.js +27 -0
- package/dist/command-implementations/lint-command.js.map +2 -2
- package/dist/command-implementations/login-command.js +4 -0
- package/dist/command-implementations/login-command.js.map +1 -1
- package/dist/command-implementations/plugin-commands.js +4 -0
- package/dist/command-implementations/plugin-commands.js.map +1 -1
- package/dist/command-implementations/project-command.js +4 -0
- package/dist/command-implementations/project-command.js.map +1 -1
- package/dist/command-implementations/read-command.js +4 -0
- package/dist/command-implementations/read-command.js.map +1 -1
- package/dist/command-implementations/serve-command.js +4 -0
- package/dist/command-implementations/serve-command.js.map +1 -1
- package/dist/command-tree.js.map +1 -1
- package/dist/config.js +7 -1
- package/dist/config.js.map +2 -2
- package/dist/consts.js +4 -0
- package/dist/consts.js.map +1 -1
- package/dist/errors.js +4 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/init.js +4 -0
- package/dist/init.js.map +1 -1
- package/dist/linter/base-linter.js.map +1 -1
- package/dist/linter/base-linter.test.js.map +1 -1
- package/dist/linter/ruleset-tests/bot.ruleset.test.js.map +1 -1
- package/dist/linter/ruleset-tests/common.js.map +1 -1
- package/dist/linter/ruleset-tests/integration.ruleset.test.js.map +1 -1
- package/dist/linter/ruleset-tests/interface.ruleset.test.js.map +1 -1
- package/dist/linter/rulesets/bot.ruleset.js.map +1 -1
- package/dist/linter/rulesets/integration.ruleset.js.map +1 -1
- package/dist/linter/rulesets/interface.ruleset.js.map +1 -1
- package/dist/logger/base-logger.js +4 -0
- package/dist/logger/base-logger.js.map +1 -1
- package/dist/logger/index.js +1 -0
- package/dist/logger/index.js.map +1 -1
- package/dist/package-ref.js +33 -0
- package/dist/package-ref.js.map +2 -2
- package/dist/package-ref.test.js +22 -0
- package/dist/package-ref.test.js.map +2 -2
- package/dist/register-yargs.js +4 -0
- package/dist/register-yargs.js.map +1 -1
- package/dist/root.js +4 -0
- package/dist/root.js.map +1 -1
- package/dist/sdk/resolve-integration-interfaces.js +5 -0
- package/dist/sdk/resolve-integration-interfaces.js.map +1 -1
- package/dist/sdk/validate-bot.js +4 -0
- package/dist/sdk/validate-bot.js.map +1 -1
- package/dist/sdk/validate-integration.js +4 -0
- package/dist/sdk/validate-integration.js.map +1 -1
- package/dist/utils/cache-utils.js +4 -0
- package/dist/utils/cache-utils.js.map +1 -1
- package/dist/utils/case-utils.js +4 -0
- package/dist/utils/case-utils.js.map +1 -1
- package/dist/utils/case-utils.test.js +4 -0
- package/dist/utils/case-utils.test.js.map +1 -1
- package/dist/utils/event-emitter.js.map +1 -1
- package/dist/utils/file-watcher.js +4 -0
- package/dist/utils/file-watcher.js.map +1 -1
- package/dist/utils/id-utils.js +4 -0
- package/dist/utils/id-utils.js.map +1 -1
- package/dist/utils/index.js +4 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/object-utils.js.map +1 -1
- package/dist/utils/path-utils.js +6 -2
- package/dist/utils/path-utils.js.map +1 -1
- package/dist/utils/path-utils.test.js +4 -0
- package/dist/utils/path-utils.test.js.map +1 -1
- package/dist/utils/pkgjson-utils.js +4 -0
- package/dist/utils/pkgjson-utils.js.map +2 -2
- package/dist/utils/promise-utils.js.map +1 -1
- package/dist/utils/prompt-utils.js +4 -0
- package/dist/utils/prompt-utils.js.map +1 -1
- package/dist/utils/record-utils.js +4 -0
- package/dist/utils/record-utils.js.map +1 -1
- package/dist/utils/record-utils.test.js +4 -0
- package/dist/utils/record-utils.test.js.map +1 -1
- package/dist/utils/require-utils.js +4 -0
- package/dist/utils/require-utils.js.map +1 -1
- package/dist/utils/require-utils.test.js +4 -0
- package/dist/utils/require-utils.test.js.map +1 -1
- package/dist/utils/schema-utils.js.map +1 -1
- package/dist/utils/semver-utils.js.map +1 -1
- package/dist/utils/template-utils.js +4 -0
- package/dist/utils/template-utils.js.map +1 -1
- package/dist/utils/tunnel-utils.js +3 -0
- package/dist/utils/tunnel-utils.js.map +1 -1
- package/dist/worker/child-entrypoint.js +4 -0
- package/dist/worker/child-entrypoint.js.map +1 -1
- package/dist/worker/child-wrapper.js +5 -0
- package/dist/worker/child-wrapper.js.map +1 -1
- package/dist/worker/is-child.js.map +1 -1
- package/dist/worker/worker-state.js.map +1 -1
- package/dist/worker/worker.js +3 -0
- package/dist/worker/worker.js.map +1 -1
- package/package.json +6 -8
- package/templates/empty-bot/package.json +4 -5
- package/templates/empty-integration/package.json +4 -5
- package/templates/empty-plugin/package.json +3 -4
- package/templates/hello-world/package.json +4 -5
- package/templates/webhook-message/package.json +4 -5
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/command-implementations/plugin-commands.ts"],
|
|
4
4
|
"sourcesContent": ["import type * as client from '@botpress/client'\nimport chalk from 'chalk'\nimport type commandDefinitions from '../command-definitions'\nimport * as errors from '../errors'\nimport { parsePackageRef } from '../package-ref'\nimport * as utils from '../utils'\nimport { GlobalCommand } from './global-command'\n\nexport type GetPluginCommandDefinition = typeof commandDefinitions.plugins.subcommands.get\nexport class GetPluginCommand extends GlobalCommand<GetPluginCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n const parsedRef = parsePackageRef(this.argv.pluginRef)\n if (!parsedRef) {\n throw new errors.InvalidPackageReferenceError(this.argv.pluginRef)\n }\n if (parsedRef.type === 'path') {\n throw new errors.BotpressCLIError('Cannot get local plugin')\n }\n\n try {\n const plugin = await api.findPublicPlugin(parsedRef)\n if (plugin) {\n this.logger.success(`Plugin ${chalk.bold(this.argv.pluginRef)}:`)\n this.logger.json(utils.object.omit(plugin, 'code'))\n return\n }\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not get plugin ${this.argv.pluginRef}`)\n }\n\n throw new errors.BotpressCLIError(`Plugin ${this.argv.pluginRef} not found`)\n }\n}\n\nexport type ListPluginsCommandDefinition = typeof commandDefinitions.plugins.subcommands.list\nexport class ListPluginsCommand extends GlobalCommand<ListPluginsCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n\n const lister = (req: { nextToken?: string }) => api.client.listPlugins({ nextToken: req.nextToken })\n\n try {\n const plugins = await api.listAllPages(lister, (r) => r.plugins)\n\n this.logger.success('Plugins:')\n this.logger.json(plugins)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not list plugins')\n }\n }\n}\n\nexport type DeletePluginCommandDefinition = typeof commandDefinitions.plugins.subcommands.delete\nexport class DeletePluginCommand extends GlobalCommand<DeletePluginCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n const parsedRef = parsePackageRef(this.argv.pluginRef)\n if (!parsedRef) {\n throw new errors.InvalidPackageReferenceError(this.argv.pluginRef)\n }\n if (parsedRef.type === 'path') {\n throw new errors.BotpressCLIError('Cannot delete local plugin')\n }\n\n let plugin: client.Plugin | undefined\n try {\n plugin = await api.findPublicPlugin(parsedRef)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not get plugin ${this.argv.pluginRef}`)\n }\n\n if (!plugin) {\n throw new errors.BotpressCLIError(`Plugin ${this.argv.pluginRef} not found`)\n }\n\n try {\n await api.client.deletePlugin({ id: plugin.id })\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not delete plugin ${this.argv.pluginRef}`)\n }\n\n this.logger.success(`Plugin ${chalk.bold(this.argv.pluginRef)} deleted`)\n return\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAElB,aAAwB;AACxB,yBAAgC;AAChC,YAAuB;AACvB,4BAA8B;AAGvB,MAAM,yBAAyB,oCAA0C;AAAA,EAC9E,MAAa,MAAqB;AAChC,UAAM,MAAM,MAAM,KAAK,2BA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AAC,WAAW;AACd,YAAM,IAAI,OAAO,6BAA6B,KAAK,KAAK,SAAS;AAAA,IACnE;AACA,QAAI,UAAU,SAAS,QAAQ;AAC7B,YAAM,IAAI,OAAO,iBAAiB,4BAA4B;AAAA,IAChE;AAEA,QAAI;AACJ,QAAI;AACF,eAAS,MAAM,IAAI,iBAAiB,SAAS;AAAA,IAC/C,SAAS,QAAP;AACA,YAAM,OAAO,iBAAiB,KAAK,QAAQ,wBAAwB,KAAK,KAAK,WAAW;AAAA,IAC1F;AAEA,QAAI,CAAC,QAAQ;AACX,YAAM,IAAI,OAAO,iBAAiB,UAAU,KAAK,KAAK,qBAAqB;AAAA,IAC7E;AAEA,QAAI;AACF,YAAM,IAAI,OAAO,aAAa,EAAE,IAAI,OAAO,GAAG,CAAC;AAAA,IACjD,SAAS,QAAP;AACA,YAAM,OAAO,iBAAiB,KAAK,QAAQ,2BAA2B,KAAK,KAAK,WAAW;AAAA,IAC7F;AAEA,SAAK,OAAO,QAAQ,UAAU,aAAAA,QAAM,KAAK,KAAK,KAAK,SAAS,WAAW;AACvE;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["chalk"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/command-implementations/project-command.ts"],
|
|
4
4
|
"sourcesContent": ["import type * as client from '@botpress/client'\nimport type * as sdk from '@botpress/sdk'\nimport type { YargsConfig } from '@bpinternal/yargs-extra'\nimport bluebird from 'bluebird'\nimport chalk from 'chalk'\nimport fs from 'fs'\nimport _ from 'lodash'\nimport semver from 'semver'\nimport { ApiClient } from '../api/client'\nimport * as codegen from '../code-generation'\nimport type * as config from '../config'\nimport * as consts from '../consts'\nimport * as errors from '../errors'\nimport { formatPackageRef, PackageRef } from '../package-ref'\nimport { validateIntegrationDefinition, resolveInterfaces, resolveBotInterfaces, validateBotDefinition } from '../sdk'\nimport type { CommandArgv, CommandDefinition } from '../typings'\nimport * as utils from '../utils'\nimport { GlobalCommand } from './global-command'\n\nexport type ProjectCommandDefinition = CommandDefinition<typeof config.schemas.project>\nexport type ProjectCache = { botId: string; devId: string }\n\ntype ConfigurableProjectPaths = { workDir: string }\ntype ConstantProjectPaths = typeof consts.fromWorkDir\ntype AllProjectPaths = ConfigurableProjectPaths & ConstantProjectPaths\n\ntype IntegrationInstance = NonNullable<sdk.BotDefinition['integrations']>[string]\ntype RemoteIntegrationInstance = utils.types.Merge<IntegrationInstance, { id: string }>\ntype LocalIntegrationInstance = utils.types.Merge<IntegrationInstance, { uri?: string }>\ntype BotIntegrationRequest = NonNullable<NonNullable<client.ClientInputs['updateBot']['integrations']>[string]>\n\ntype LintIgnoredConfig = { bpLintDisabled?: boolean }\n\nexport type ProjectType = ProjectDefinition['type']\nexport type ProjectDefinition = LintIgnoredConfig &\n (\n | { type: 'integration'; definition: sdk.IntegrationDefinition }\n | { type: 'interface'; definition: sdk.InterfaceDefinition }\n | { type: 'bot'; definition: sdk.BotDefinition }\n | { type: 'plugin'; definition: sdk.PluginDefinition }\n )\n\nclass ProjectPaths extends utils.path.PathStore<keyof AllProjectPaths> {\n public constructor(argv: CommandArgv<ProjectCommandDefinition>) {\n const absWorkDir = utils.path.absoluteFrom(utils.path.cwd(), argv.workDir)\n super({\n workDir: absWorkDir,\n ..._.mapValues(consts.fromWorkDir, (p) => utils.path.absoluteFrom(absWorkDir, p)),\n })\n }\n}\n\nexport abstract class ProjectCommand<C extends ProjectCommandDefinition> extends GlobalCommand<C> {\n protected override async bootstrap() {\n await super.bootstrap()\n await this._notifyUpdateSdk()\n }\n\n protected get projectPaths() {\n return new ProjectPaths(this.argv)\n }\n\n protected get projectCache() {\n return new utils.cache.FSKeyValueCache<ProjectCache>(this.projectPaths.abs.projectCacheFile)\n }\n\n protected async fetchBotIntegrationInstances(\n botDefinition: sdk.BotDefinition,\n api: ApiClient\n ): Promise<Record<string, BotIntegrationRequest>> {\n const integrationList = _(botDefinition.integrations).values().filter(utils.guards.is.defined).value()\n\n const { remoteInstances, localInstances } = this._splitApiAndLocalIntegrationInstances(integrationList)\n\n const fetchedInstances: RemoteIntegrationInstance[] = await bluebird.map(localInstances, async (instance) => {\n const ref: PackageRef = { type: 'name', name: instance.name, version: instance.version }\n const integration = await api.findIntegration(ref)\n if (!integration) {\n const formattedRef = formatPackageRef(ref)\n throw new errors.BotpressCLIError(`Integration \"${formattedRef}\" not found`)\n }\n return { ...instance, id: integration.id }\n })\n\n return _([...fetchedInstances, ...remoteInstances])\n .keyBy((i) => i.id)\n .mapValues(({ enabled, configurationType, configuration }) => ({\n enabled,\n configurationType: configurationType ?? null,\n configuration,\n }))\n .value()\n }\n\n private _splitApiAndLocalIntegrationInstances(instances: IntegrationInstance[]): {\n remoteInstances: RemoteIntegrationInstance[]\n localInstances: LocalIntegrationInstance[]\n } {\n const remoteInstances: RemoteIntegrationInstance[] = []\n const localInstances: LocalIntegrationInstance[] = []\n for (const instance of instances) {\n const { id } = instance\n if (id) {\n remoteInstances.push({ ...instance, id })\n } else {\n localInstances.push(instance)\n }\n }\n\n return { remoteInstances, localInstances }\n }\n\n protected async readProjectDefinitionFromFS(): Promise<ProjectDefinition> {\n const projectPaths = this.projectPaths\n try {\n const integrationDefinition = await this._readIntegrationDefinitionFromFS(projectPaths)\n if (integrationDefinition) {\n return { type: 'integration', ...integrationDefinition }\n }\n const interfaceDefinition = await this._readInterfaceDefinitionFromFS(projectPaths)\n if (interfaceDefinition) {\n return { type: 'interface', ...interfaceDefinition }\n }\n const botDefinition = await this._readBotDefinitionFromFS(projectPaths)\n if (botDefinition) {\n return { type: 'bot', ...botDefinition }\n }\n const pluginDefinition = await this._readPluginDefinitionFromFS(projectPaths)\n if (pluginDefinition) {\n return { type: 'plugin', ...pluginDefinition }\n }\n } catch (thrown: unknown) {\n throw errors.BotpressCLIError.wrap(thrown, 'Error while reading project definition')\n }\n\n throw new errors.ProjectDefinitionNotFoundError(this.projectPaths.abs.workDir)\n }\n\n private async _readIntegrationDefinitionFromFS(\n projectPaths: utils.path.PathStore<'workDir' | 'integrationDefinition'>\n ): Promise<({ definition: sdk.IntegrationDefinition } & LintIgnoredConfig) | undefined> {\n const abs = projectPaths.abs\n const rel = projectPaths.rel('workDir')\n\n if (!fs.existsSync(abs.integrationDefinition)) {\n return\n }\n\n const bpLintDisabled = await this._isBpLintDisabled(abs.integrationDefinition)\n\n const { outputFiles } = await utils.esbuild.buildEntrypoint({\n cwd: abs.workDir,\n outfile: '',\n entrypoint: rel.integrationDefinition,\n write: false,\n minify: false,\n })\n\n const artifact = outputFiles[0]\n if (!artifact) {\n throw new errors.BotpressCLIError('Could not read integration definition')\n }\n\n let { default: definition } = utils.require.requireJsCode<{ default: sdk.IntegrationDefinition }>(artifact.text)\n definition = resolveInterfaces(definition)\n validateIntegrationDefinition(definition)\n return { definition, bpLintDisabled }\n }\n\n private async _readInterfaceDefinitionFromFS(\n projectPaths: utils.path.PathStore<'workDir' | 'interfaceDefinition'>\n ): Promise<({ definition: sdk.InterfaceDefinition } & LintIgnoredConfig) | undefined> {\n const abs = projectPaths.abs\n const rel = projectPaths.rel('workDir')\n\n if (!fs.existsSync(abs.interfaceDefinition)) {\n return\n }\n\n const bpLintDisabled = await this._isBpLintDisabled(abs.interfaceDefinition)\n\n const { outputFiles } = await utils.esbuild.buildEntrypoint({\n cwd: abs.workDir,\n outfile: '',\n entrypoint: rel.interfaceDefinition,\n write: false,\n minify: false,\n })\n\n const artifact = outputFiles[0]\n if (!artifact) {\n throw new errors.BotpressCLIError('Could not read interface definition')\n }\n\n const { default: definition } = utils.require.requireJsCode<{ default: sdk.InterfaceDefinition }>(artifact.text)\n\n return { definition, bpLintDisabled }\n }\n\n private async _readBotDefinitionFromFS(\n projectPaths: utils.path.PathStore<'workDir' | 'botDefinition'>\n ): Promise<({ definition: sdk.BotDefinition } & LintIgnoredConfig) | undefined> {\n const abs = projectPaths.abs\n const rel = projectPaths.rel('workDir')\n\n if (!fs.existsSync(abs.botDefinition)) {\n return\n }\n\n const bpLintDisabled = await this._isBpLintDisabled(abs.botDefinition)\n\n const { outputFiles } = await utils.esbuild.buildEntrypoint({\n cwd: abs.workDir,\n outfile: '',\n entrypoint: rel.botDefinition,\n write: false,\n minify: false,\n })\n\n const artifact = outputFiles[0]\n if (!artifact) {\n throw new errors.BotpressCLIError('Could not read bot definition')\n }\n\n let { default: definition } = utils.require.requireJsCode<{ default: sdk.BotDefinition }>(artifact.text)\n definition = resolveBotInterfaces(definition)\n validateBotDefinition(definition)\n return { definition, bpLintDisabled }\n }\n\n private async _readPluginDefinitionFromFS(\n projectPaths: utils.path.PathStore<'workDir' | 'pluginDefinition'>\n ): Promise<({ definition: sdk.PluginDefinition } & LintIgnoredConfig) | undefined> {\n const abs = projectPaths.abs\n const rel = projectPaths.rel('workDir')\n\n if (!fs.existsSync(abs.pluginDefinition)) {\n return\n }\n\n const bpLintDisabled = await this._isBpLintDisabled(abs.pluginDefinition)\n\n const { outputFiles } = await utils.esbuild.buildEntrypoint({\n cwd: abs.workDir,\n outfile: '',\n entrypoint: rel.pluginDefinition,\n write: false,\n minify: false,\n })\n\n const artifact = outputFiles[0]\n if (!artifact) {\n throw new errors.BotpressCLIError('Could not read plugin definition')\n }\n\n const { default: definition } = utils.require.requireJsCode<{ default: sdk.PluginDefinition }>(artifact.text)\n // TODO: validate plugin definition\n return { definition, bpLintDisabled }\n }\n\n private async _isBpLintDisabled(definitionPath: string): Promise<boolean> {\n const tsContent = await fs.promises.readFile(definitionPath, 'utf-8')\n const regex = /\\/\\* bplint-disable \\*\\//\n return regex.test(tsContent)\n }\n\n protected displayWebhookUrls(bot: client.Bot) {\n if (!_.keys(bot.integrations).length) {\n this.logger.debug('No integrations in bot')\n return\n }\n\n this.logger.log('Integrations:')\n for (const integration of Object.values(bot.integrations).filter(utils.guards.is.defined)) {\n if (!integration.enabled) {\n this.logger.log(`${chalk.grey(integration.name)} ${chalk.italic('(disabled)')}: ${integration.webhookUrl}`, {\n prefix: { symbol: '\u25CB', indent: 2 },\n })\n } else {\n this.logger.log(`${chalk.bold(integration.name)} : ${integration.webhookUrl}`, {\n prefix: { symbol: '\u25CF', indent: 2 },\n })\n }\n }\n }\n\n protected async promptSecrets(\n integrationDef: sdk.IntegrationDefinition,\n argv: YargsConfig<typeof config.schemas.secrets>,\n opts: { formatEnv?: boolean; knownSecrets?: string[] } = {}\n ): Promise<Record<string, string | null>> {\n const formatEnv = opts.formatEnv ?? false\n const knownSecrets = opts.knownSecrets ?? []\n\n const { secrets: secretDefinitions } = integrationDef\n if (!secretDefinitions) {\n return {}\n }\n\n const secretArgv = this._parseArgvSecrets(argv.secrets)\n const invalidSecret = Object.keys(secretArgv).find((s) => !secretDefinitions[s])\n if (invalidSecret) {\n throw new errors.BotpressCLIError(`Secret ${invalidSecret} is not defined in integration definition`)\n }\n\n const values: Record<string, string | null> = {}\n for (const [secretName, { optional }] of Object.entries(secretDefinitions)) {\n const argvSecret = secretArgv[secretName]\n if (argvSecret) {\n this.logger.debug(`Using secret \"${secretName}\" from argv`)\n values[secretName] = argvSecret\n continue\n }\n\n const alreadyKnown = knownSecrets.includes(secretName)\n let mode: string\n if (alreadyKnown) {\n mode = 'already set'\n } else if (optional) {\n mode = 'optional'\n } else {\n mode = 'required'\n }\n\n const prompted = await this.prompt.text(`Enter value for secret \"${secretName}\" (${mode})`)\n if (prompted) {\n values[secretName] = prompted\n continue\n }\n\n if (alreadyKnown) {\n this.logger.log(`Secret \"${secretName}\" is unchanged`)\n } else if (optional) {\n this.logger.warn(`Secret \"${secretName}\" is unassigned`)\n } else {\n throw new errors.BotpressCLIError(`Secret \"${secretName}\" is required`)\n }\n }\n\n for (const secretName of knownSecrets) {\n const isDefined = secretName in secretDefinitions\n if (isDefined) {\n continue\n }\n const prompted = await this.prompt.confirm(`Secret \"${secretName}\" was removed. Do you wish to delete it?`)\n if (prompted) {\n this.logger.log(`Deleting secret \"${secretName}\"`, { prefix: { symbol: '\u00D7', fg: 'red' } })\n values[secretName] = null\n }\n }\n\n if (!formatEnv) {\n return values\n }\n\n const envVariables = _.mapKeys(values, (_v, k) => codegen.secretEnvVariableName(k))\n return envVariables\n }\n\n protected async readIntegrationConfigDefinition<C extends client.ClientInputs['createIntegration']['configuration']>(\n config: C\n ): Promise<C> {\n if (!config?.identifier) {\n return config\n }\n return {\n ...config,\n identifier: {\n ...config.identifier,\n linkTemplateScript: await this.readProjectFile(config.identifier.linkTemplateScript),\n },\n }\n }\n\n protected readProjectFile = async (filePath: string | undefined): Promise<string | undefined> => {\n if (!filePath) {\n return undefined\n }\n const absoluteFilePath = utils.path.absoluteFrom(this.projectPaths.abs.workDir, filePath)\n return fs.promises.readFile(absoluteFilePath, 'utf-8').catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not read file \"${absoluteFilePath}\"`)\n })\n }\n\n private _parseArgvSecrets(argvSecrets: string[]): Record<string, string> {\n const parsed: Record<string, string> = {}\n for (const secret of argvSecrets) {\n const [key, value] = utils.string.splitOnce(secret, '=')\n if (!value) {\n throw new errors.BotpressCLIError(\n `Secret \"${key}\" is missing a value. Expected format: \"SECRET_NAME=secretValue\"`\n )\n }\n parsed[key!] = value\n }\n\n return parsed\n }\n\n private _notifyUpdateSdk = async (): Promise<void> => {\n try {\n this.logger.debug('Checking if sdk is up to date')\n\n const { workDir } = this.projectPaths.abs\n const projectPkgJson = await utils.pkgJson.readPackageJson(workDir)\n if (!projectPkgJson) {\n this.logger.debug(`Could not find package.json at \"${workDir}\"`)\n return\n }\n\n const sdkPackageName = '@botpress/sdk'\n const actualSdkVersion = utils.pkgJson.findDependency(projectPkgJson, sdkPackageName)\n if (!actualSdkVersion) {\n this.logger.debug(`Could not find dependency \"${sdkPackageName}\" in project package.json`)\n return\n }\n\n if (actualSdkVersion.startsWith('workspace:')) {\n return\n }\n\n const actualCleanedSdkVersion = semver.valid(semver.coerce(actualSdkVersion))\n if (!actualCleanedSdkVersion) {\n this.logger.debug(`Invalid sdk version \"${actualSdkVersion}\" in project package.json`)\n return\n }\n\n const cliPkgJson = await this.readPkgJson()\n const expectedSdkVersion = utils.pkgJson.findDependency(cliPkgJson, sdkPackageName)\n if (!expectedSdkVersion) {\n this.logger.debug(`Could not find dependency \"${sdkPackageName}\" in cli package.json`)\n return\n }\n\n const expectedCleanedSdkVersion = semver.valid(semver.coerce(expectedSdkVersion))\n if (!expectedCleanedSdkVersion) {\n this.logger.debug(`Invalid sdk version \"${expectedSdkVersion}\" in cli package.json`)\n return\n }\n\n if (semver.eq(actualCleanedSdkVersion, expectedCleanedSdkVersion)) {\n return\n }\n\n const diff = semver.diff(actualCleanedSdkVersion, expectedCleanedSdkVersion)\n if (!diff) {\n this.logger.debug(`Could not compare versions \"${actualCleanedSdkVersion}\" and \"${expectedCleanedSdkVersion}\"`)\n return\n }\n\n const errorMsg = `Project SDK version is \"${actualCleanedSdkVersion}\", but expected \"${expectedCleanedSdkVersion}\"`\n if (utils.semver.releases.lt(diff, 'minor')) {\n this.logger.debug(`${errorMsg}. This may cause compatibility issues.`)\n return\n }\n\n this.logger.warn(chalk.bold(`${errorMsg}. This will cause compatibility issues.`))\n } catch (thrown) {\n const err = errors.BotpressCLIError.map(thrown)\n this.logger.debug(`Failed to check if sdk is up to date: ${err.message}`)\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
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O,KAAK,aAAAD,QAAM,KAAK,GAAG,iDAAiD,CAAC;AAAA,IACnF,SAAS,QAAP;AACA,YAAM,MAAM,OAAO,iBAAiB,IAAI,MAAM;AAC9C,WAAK,OAAO,MAAM,yCAAyC,IAAI,SAAS;AAAA,IAC1E;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["_", "bluebird", "fs", "chalk", "semver"]
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/command-implementations/read-command.ts"],
|
|
4
4
|
"sourcesContent": ["import { prepareCreateBotBody } from '../api/bot-body'\nimport { prepareCreateIntegrationBody } from '../api/integration-body'\nimport { prepareCreateInterfaceBody } from '../api/interface-body'\nimport { prepareCreatePluginBody } from '../api/plugin-body'\nimport type commandDefinitions from '../command-definitions'\nimport * as errors from '../errors'\nimport * as utils from '../utils'\nimport { ProjectCommand } from './project-command'\n\nexport type ReadCommandDefinition = typeof commandDefinitions.read\nexport class ReadCommand extends ProjectCommand<ReadCommandDefinition> {\n public async run(): Promise<void> {\n const projectDef = await this.readProjectDefinitionFromFS()\n if (projectDef.type === 'integration') {\n const parsed = await prepareCreateIntegrationBody(projectDef.definition)\n // TODO: maybe display interface implementation statements here\n this.logger.json(parsed)\n return\n }\n if (projectDef.type === 'interface') {\n const parsed = await prepareCreateInterfaceBody(projectDef.definition)\n this.logger.json(parsed)\n return\n }\n if (projectDef.type === 'bot') {\n const parsed = await prepareCreateBotBody(projectDef.definition)\n this.logger.json(parsed)\n return\n }\n if (projectDef.type === 'plugin') {\n const parsed = await prepareCreatePluginBody(projectDef.definition)\n this.logger.json(parsed)\n return\n }\n\n type _assertion = utils.types.AssertNever<typeof projectDef>\n throw new errors.BotpressCLIError('Unsupported project type')\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAqC;AACrC,8BAA6C;AAC7C,4BAA2C;AAC3C,yBAAwC;AAExC,aAAwB;AAExB,6BAA+B;AAGxB,MAAM,oBAAoB,sCAAsC;AAAA,EACrE,MAAa,MAAqB;AAChC,UAAM,aAAa,MAAM,KAAK,4BAA4B;AAC1D,QAAI,WAAW,SAAS,eAAe;AACrC,YAAM,SAAS,UAAM,sDAA6B,WAAW,UAAU;AAEvE,WAAK,OAAO,KAAK,MAAM;AACvB;AAAA,IACF;AACA,QAAI,WAAW,SAAS,aAAa;AACnC,YAAM,SAAS,UAAM,kDAA2B,WAAW,UAAU;AACrE,WAAK,OAAO,KAAK,MAAM;AACvB;AAAA,IACF;AACA,QAAI,WAAW,SAAS,OAAO;AAC7B,YAAM,SAAS,UAAM,sCAAqB,WAAW,UAAU;AAC/D,WAAK,OAAO,KAAK,MAAM;AACvB;AAAA,IACF;AACA,QAAI,WAAW,SAAS,UAAU;AAChC,YAAM,SAAS,UAAM,4CAAwB,WAAW,UAAU;AAClE,WAAK,OAAO,KAAK,MAAM;AACvB;AAAA,IACF;AAGA,UAAM,IAAI,OAAO,iBAAiB,0BAA0B;AAAA,EAC9D;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/command-implementations/serve-command.ts"],
|
|
4
4
|
"sourcesContent": ["import type { Bot as BotImpl, Integration as IntegrationImpl } from '@botpress/sdk'\nimport * as fs from 'fs'\nimport type commandDefinitions from '../command-definitions'\nimport * as errors from '../errors'\nimport * as utils from '../utils'\nimport { ProjectCommand } from './project-command'\n\ntype Serveable = BotImpl | IntegrationImpl\n\nexport type ServeCommandDefinition = typeof commandDefinitions.serve\nexport class ServeCommand extends ProjectCommand<ServeCommandDefinition> {\n public async run(): Promise<void> {\n const outfile = this.projectPaths.abs.outFile\n if (!fs.existsSync(outfile)) {\n throw new errors.NoBundleFoundError()\n }\n\n const projectDef = await this.readProjectDefinitionFromFS()\n if (projectDef.type === 'interface') {\n throw new errors.BotpressCLIError('An interface project has no implementation to serve.')\n }\n\n if (projectDef.type === 'integration') {\n // TODO: store secrets in local cache to avoid prompting every time\n const secretEnvVariables = await this.promptSecrets(projectDef.definition, this.argv, { formatEnv: true })\n const nonNullSecretEnvVariables = utils.records.filterValues(secretEnvVariables, utils.guards.is.notNull)\n for (const [key, value] of Object.entries(nonNullSecretEnvVariables)) {\n process.env[key] = value\n }\n }\n\n this.logger.log(`Serving ${projectDef.type}...`)\n\n const { default: serveable } = utils.require.requireJsFile<{ default: Serveable }>(outfile)\n const server = await serveable.start(this.argv.port)\n\n await new Promise<void>((resolve, reject) => {\n server.on('error', reject)\n server.on('close', resolve)\n })\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,SAAoB;AAEpB,aAAwB;AACxB,YAAuB;AACvB,6BAA+B;AAKxB,MAAM,qBAAqB,sCAAuC;AAAA,EACvE,MAAa,MAAqB;AAChC,UAAM,UAAU,KAAK,aAAa,IAAI;AACtC,QAAI,CAAC,GAAG,WAAW,OAAO,GAAG;AAC3B,YAAM,IAAI,OAAO,mBAAmB;AAAA,IACtC;AAEA,UAAM,aAAa,MAAM,KAAK,4BAA4B;AAC1D,QAAI,WAAW,SAAS,aAAa;AACnC,YAAM,IAAI,OAAO,iBAAiB,sDAAsD;AAAA,IAC1F;AAEA,QAAI,WAAW,SAAS,eAAe;AAErC,YAAM,qBAAqB,MAAM,KAAK,cAAc,WAAW,YAAY,KAAK,MAAM,EAAE,WAAW,KAAK,CAAC;AACzG,YAAM,4BAA4B,MAAM,QAAQ,aAAa,oBAAoB,MAAM,OAAO,GAAG,OAAO;AACxG,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,yBAAyB,GAAG;AACpE,gBAAQ,IAAI,GAAG,IAAI;AAAA,MACrB;AAAA,IACF;AAEA,SAAK,OAAO,IAAI,WAAW,WAAW,SAAS;AAE/C,UAAM,EAAE,SAAS,UAAU,IAAI,MAAM,QAAQ,cAAsC,OAAO;AAC1F,UAAM,SAAS,MAAM,UAAU,MAAM,KAAK,KAAK,IAAI;AAEnD,UAAM,IAAI,QAAc,CAAC,SAAS,WAAW;AAC3C,aAAO,GAAG,SAAS,MAAM;AACzB,aAAO,GAAG,SAAS,OAAO;AAAA,IAC5B,CAAC;AAAA,EACH;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/command-tree.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/command-tree.ts"],
|
|
4
4
|
"sourcesContent": ["import type * as typings from './typings'\n\nexport type DefinitionSubTree = {\n description: string\n subcommands: DefinitionTree\n}\n\nexport type DefinitionTree = {\n [key: string]: DefinitionTreeNode\n}\n\nexport type DefinitionTreeNode = typings.CommandDefinition | DefinitionSubTree\n\nexport type ImplementationSubTree<D extends DefinitionSubTree = DefinitionSubTree> = {\n subcommands: ImplementationTree<D['subcommands']>\n}\n\nexport type ImplementationTreeNode<N extends DefinitionTreeNode = DefinitionTreeNode> =\n N extends typings.CommandDefinition\n ? typings.CommandImplementation<N>\n : N extends DefinitionSubTree\n ? ImplementationSubTree<N>\n : never\n\nexport type ImplementationTree<D extends DefinitionTree = DefinitionTree> = {\n [K in keyof D]: ImplementationTreeNode<D[K]>\n}\n\nexport type CommandSubTree<D extends DefinitionSubTree = DefinitionSubTree> = {\n description: string\n subcommands: CommandTree<D['subcommands']>\n}\n\nexport type CommandTreeNode<N extends DefinitionTreeNode = DefinitionTreeNode> = N extends typings.CommandDefinition\n ? typings.CommandLeaf<N>\n : N extends DefinitionSubTree\n ? CommandSubTree<N>\n : never\n\nexport type CommandTree<D extends DefinitionTree = DefinitionTree> = {\n [K in keyof D]: CommandTreeNode<D[K]>\n}\n\nexport const guards = {\n definition: {\n isDef: (x: DefinitionTreeNode): x is typings.CommandDefinition => 'schema' in x,\n isSubTree: (x: DefinitionTreeNode): x is DefinitionSubTree => 'subcommands' in x,\n },\n implementation: {\n isImpl: (x: ImplementationTreeNode): x is typings.CommandImplementation => typeof x === 'function',\n isSubTree: (x: ImplementationTreeNode): x is ImplementationSubTree => typeof x === 'object',\n },\n command: {\n isLeaf: (x: CommandTreeNode): x is typings.CommandLeaf => 'handler' in x,\n isSubTree: (x: CommandTreeNode): x is CommandSubTree => 'subcommands' in x,\n },\n}\n\nexport const zipTree = <T extends DefinitionTree>(defTree: T, implTree: ImplementationTree<T>): CommandTree<T> => {\n const tree = {} as CommandTree<T>\n\n for (const key in defTree) {\n const def = defTree[key]!\n const impl = implTree[key]!\n\n if (guards.definition.isDef(def) && guards.implementation.isImpl(impl)) {\n tree[key] = { ...def, handler: impl } as CommandTreeNode<typeof def>\n continue\n }\n\n if (guards.definition.isSubTree(def) && guards.implementation.isSubTree(impl)) {\n tree[key] = { ...def, subcommands: zipTree(def.subcommands, impl.subcommands) } as CommandTreeNode<typeof def>\n continue\n }\n }\n\n return tree\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2CO,MAAM,SAAS;AAAA,EACpB,YAAY;AAAA,IACV,OAAO,CAAC,MAA0D,YAAY;AAAA,IAC9E,WAAW,CAAC,MAAkD,iBAAiB;AAAA,EACjF;AAAA,EACA,gBAAgB;AAAA,IACd,QAAQ,CAAC,MAAkE,OAAO,MAAM;AAAA,IACxF,WAAW,CAAC,MAA0D,OAAO,MAAM;AAAA,EACrF;AAAA,EACA,SAAS;AAAA,IACP,QAAQ,CAAC,MAAiD,aAAa;AAAA,IACvE,WAAW,CAAC,MAA4C,iBAAiB;AAAA,EAC3E;AACF;AAEO,MAAM,UAAU,CAA2B,SAAY,aAAoD;AAChH,QAAM,OAAO,CAAC;AAEd,aAAW,OAAO,SAAS;AACzB,UAAM,MAAM,QAAQ;
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2CO,MAAM,SAAS;AAAA,EACpB,YAAY;AAAA,IACV,OAAO,CAAC,MAA0D,YAAY;AAAA,IAC9E,WAAW,CAAC,MAAkD,iBAAiB;AAAA,EACjF;AAAA,EACA,gBAAgB;AAAA,IACd,QAAQ,CAAC,MAAkE,OAAO,MAAM;AAAA,IACxF,WAAW,CAAC,MAA0D,OAAO,MAAM;AAAA,EACrF;AAAA,EACA,SAAS;AAAA,IACP,QAAQ,CAAC,MAAiD,aAAa;AAAA,IACvE,WAAW,CAAC,MAA4C,iBAAiB;AAAA,EAC3E;AACF;AAEO,MAAM,UAAU,CAA2B,SAAY,aAAoD;AAChH,QAAM,OAAO,CAAC;AAEd,aAAW,OAAO,SAAS;AACzB,UAAM,MAAM,QAAQ,GAAG;AACvB,UAAM,OAAO,SAAS,GAAG;AAEzB,QAAI,OAAO,WAAW,MAAM,GAAG,KAAK,OAAO,eAAe,OAAO,IAAI,GAAG;AACtE,WAAK,GAAG,IAAI,EAAE,GAAG,KAAK,SAAS,KAAK;AACpC;AAAA,IACF;AAEA,QAAI,OAAO,WAAW,UAAU,GAAG,KAAK,OAAO,eAAe,UAAU,IAAI,GAAG;AAC7E,WAAK,GAAG,IAAI,EAAE,GAAG,KAAK,aAAa,QAAQ,IAAI,aAAa,KAAK,WAAW,EAAE;AAC9E;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/config.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -75,20 +79,22 @@ const packageType = {
|
|
|
75
79
|
const packageRef = {
|
|
76
80
|
type: "string",
|
|
77
81
|
description: "The package ID or name with optional version. The package can be either an integration or an interface. Ex: teams, teams@0.2.0, llm@5.1.0",
|
|
78
|
-
demandOption: true,
|
|
79
82
|
positional: true,
|
|
80
83
|
idx: 0
|
|
81
84
|
};
|
|
82
85
|
const integrationRef = {
|
|
83
86
|
...packageRef,
|
|
87
|
+
demandOption: true,
|
|
84
88
|
description: "The integration ID or name with optional version. Ex: teams or teams@0.2.0"
|
|
85
89
|
};
|
|
86
90
|
const interfaceRef = {
|
|
87
91
|
...packageRef,
|
|
92
|
+
demandOption: true,
|
|
88
93
|
description: "The interface ID or name and version. Ex: llm@5.1.0"
|
|
89
94
|
};
|
|
90
95
|
const pluginRef = {
|
|
91
96
|
...packageRef,
|
|
97
|
+
demandOption: true,
|
|
92
98
|
description: "The plugin ID or name and version. Ex: knowledge@0.0.1"
|
|
93
99
|
};
|
|
94
100
|
const sourceMap = { type: "boolean", description: "Generate sourcemaps", default: false };
|
package/dist/config.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/config.ts"],
|
|
4
|
-
"sourcesContent": ["import * as consts from './consts'\nimport type { CommandOption, CommandSchema } from './typings'\n\n// command options\n\nconst port = {\n type: 'number',\n description: 'The port to use',\n} satisfies CommandOption\n\nconst workDir = {\n type: 'string',\n description: 'The path to the project',\n default: consts.defaultWorkDir,\n} satisfies CommandOption\n\nconst noBuild = {\n type: 'boolean',\n description: 'Skip the build step',\n default: false,\n} satisfies CommandOption\n\nconst apiUrl = {\n type: 'string',\n description: 'The URL of the Botpress server',\n} satisfies CommandOption\n\nconst token = {\n type: 'string',\n description: 'You Personal Access Token ',\n} satisfies CommandOption\n\nconst workspaceId = {\n type: 'string',\n description: 'The Workspace Id to deploy to',\n} satisfies CommandOption\n\nconst secrets = {\n type: 'string',\n description: 'Values for the integration secrets',\n array: true,\n default: [],\n} satisfies CommandOption\n\nconst botRef = {\n type: 'string',\n description: 'The bot ID. Bot Name is not supported.',\n demandOption: true,\n positional: true,\n idx: 0,\n} satisfies CommandOption\n\nconst packageType = {\n type: 'string',\n description:\n 'Either an integration or an interface; helps disambiguate the package type in case both an integration and an interface have the same reference.',\n choices: ['integration', 'interface', 'plugin'] as const,\n} satisfies CommandOption\n\nconst packageRef = {\n type: 'string',\n description:\n 'The package ID or name with optional version. The package can be either an integration or an interface. Ex: teams, teams@0.2.0, llm@5.1.0',\n
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import * as consts from './consts'\nimport type { CommandOption, CommandSchema } from './typings'\n\n// command options\n\nconst port = {\n type: 'number',\n description: 'The port to use',\n} satisfies CommandOption\n\nconst workDir = {\n type: 'string',\n description: 'The path to the project',\n default: consts.defaultWorkDir,\n} satisfies CommandOption\n\nconst noBuild = {\n type: 'boolean',\n description: 'Skip the build step',\n default: false,\n} satisfies CommandOption\n\nconst apiUrl = {\n type: 'string',\n description: 'The URL of the Botpress server',\n} satisfies CommandOption\n\nconst token = {\n type: 'string',\n description: 'You Personal Access Token ',\n} satisfies CommandOption\n\nconst workspaceId = {\n type: 'string',\n description: 'The Workspace Id to deploy to',\n} satisfies CommandOption\n\nconst secrets = {\n type: 'string',\n description: 'Values for the integration secrets',\n array: true,\n default: [],\n} satisfies CommandOption\n\nconst botRef = {\n type: 'string',\n description: 'The bot ID. Bot Name is not supported.',\n demandOption: true,\n positional: true,\n idx: 0,\n} satisfies CommandOption\n\nconst packageType = {\n type: 'string',\n description:\n 'Either an integration or an interface; helps disambiguate the package type in case both an integration and an interface have the same reference.',\n choices: ['integration', 'interface', 'plugin'] as const,\n} satisfies CommandOption\n\nconst packageRef = {\n type: 'string',\n description:\n 'The package ID or name with optional version. The package can be either an integration or an interface. Ex: teams, teams@0.2.0, llm@5.1.0',\n positional: true,\n idx: 0,\n} satisfies CommandOption\n\nconst integrationRef = {\n ...packageRef,\n demandOption: true,\n description: 'The integration ID or name with optional version. Ex: teams or teams@0.2.0',\n} satisfies CommandOption\n\nconst interfaceRef = {\n ...packageRef,\n demandOption: true,\n description: 'The interface ID or name and version. Ex: llm@5.1.0',\n} satisfies CommandOption\n\nconst pluginRef = {\n ...packageRef,\n demandOption: true,\n description: 'The plugin ID or name and version. Ex: knowledge@0.0.1',\n} satisfies CommandOption\n\nconst sourceMap = { type: 'boolean', description: 'Generate sourcemaps', default: false } satisfies CommandOption\n\nconst minify = { type: 'boolean', description: 'Minify the bundled code', default: true } satisfies CommandOption\n\nconst dev = {\n type: 'boolean',\n description: 'List only dev bots / dev integrations',\n default: false,\n} satisfies CommandOption\n\nconst isPublic = {\n type: 'boolean',\n description: 'Weither or not to deploy the integration publicly',\n default: false,\n} satisfies CommandOption\n\n// base schemas\n\nconst globalSchema = {\n verbose: {\n type: 'boolean',\n description: 'Enable verbose logging',\n alias: 'v',\n default: false,\n },\n confirm: {\n type: 'boolean',\n description: 'Confirm all prompts',\n alias: 'y',\n default: false,\n },\n json: {\n type: 'boolean',\n description: 'Prevent logging anything else than raw json in stdout. Useful for piping output to other tools',\n default: false,\n },\n botpressHome: {\n type: 'string',\n description: 'The path to the Botpress home directory',\n default: consts.defaultBotpressHome,\n },\n} satisfies CommandSchema\n\nconst projectSchema = {\n ...globalSchema,\n workDir,\n} satisfies CommandSchema\n\nconst credentialsSchema = {\n apiUrl,\n workspaceId,\n token,\n} satisfies CommandSchema\n\nconst secretsSchema = {\n secrets,\n} satisfies CommandSchema\n\n// command schemas\n\nconst generateSchema = {\n ...projectSchema,\n} satisfies CommandSchema\n\nconst bundleSchema = {\n ...projectSchema,\n sourceMap,\n minify,\n} satisfies CommandSchema\n\nconst buildSchema = {\n ...projectSchema,\n sourceMap,\n minify,\n} satisfies CommandSchema\n\nconst readSchema = {\n ...projectSchema,\n} satisfies CommandSchema\n\nconst serveSchema = {\n ...projectSchema,\n ...secretsSchema,\n port,\n} satisfies CommandSchema\n\nconst deploySchema = {\n ...projectSchema,\n ...credentialsSchema,\n ...secretsSchema,\n botId: { type: 'string', description: 'The bot ID to deploy. Only used when deploying a bot' },\n noBuild,\n createNewBot: { type: 'boolean', description: 'Create a new bot when deploying. Only used when deploying a bot' },\n sourceMap,\n minify,\n public: isPublic,\n allowDeprecated: {\n type: 'boolean',\n description: 'Allow deprecated features in the project',\n default: false,\n },\n} satisfies CommandSchema\n\nconst devSchema = {\n ...projectSchema,\n ...credentialsSchema,\n ...secretsSchema,\n sourceMap,\n minify,\n port,\n tunnelUrl: {\n type: 'string',\n description: 'The tunnel HTTP URL to use',\n default: consts.defaultTunnelUrl,\n },\n} satisfies CommandSchema\n\nconst addSchema = {\n ...globalSchema,\n ...credentialsSchema,\n packageRef,\n packageType,\n installPath: {\n type: 'string',\n description: 'The path where to install the package',\n default: consts.defaultInstallPath,\n },\n} satisfies CommandSchema\n\nconst loginSchema = {\n ...globalSchema,\n token,\n workspaceId,\n apiUrl: { ...apiUrl, default: consts.defaultBotpressApiUrl },\n} satisfies CommandSchema\n\nconst logoutSchema = {\n ...globalSchema,\n} satisfies CommandSchema\n\nconst createBotSchema = {\n ...globalSchema,\n ...credentialsSchema,\n name: { type: 'string', description: 'The name of the bot to create' },\n ifNotExists: {\n type: 'boolean',\n description: 'Do not create if a bot with the same name already exists',\n default: false,\n },\n} satisfies CommandSchema\n\nconst getBotSchema = {\n ...globalSchema,\n ...credentialsSchema,\n botRef,\n} satisfies CommandSchema\n\nconst deleteBotSchema = {\n ...globalSchema,\n ...credentialsSchema,\n botRef,\n} satisfies CommandSchema\n\nconst listBotsSchema = {\n ...globalSchema,\n ...credentialsSchema,\n dev,\n} satisfies CommandSchema\n\nconst getIntegrationSchema = {\n ...globalSchema,\n ...credentialsSchema,\n integrationRef,\n} satisfies CommandSchema\n\nconst listIntegrationsSchema = {\n ...globalSchema,\n ...credentialsSchema,\n name: { type: 'string', description: 'The name filter when listing integrations' },\n versionNumber: { type: 'string', description: 'The version filter when listing integrations' },\n dev,\n} satisfies CommandSchema\n\nconst deleteIntegrationSchema = {\n ...globalSchema,\n ...credentialsSchema,\n integrationRef,\n} satisfies CommandSchema\n\nconst getInterfaceSchema = {\n ...globalSchema,\n ...credentialsSchema,\n interfaceRef,\n} satisfies CommandSchema\n\nconst listInterfacesSchema = {\n ...globalSchema,\n ...credentialsSchema,\n} satisfies CommandSchema\n\nconst deleteInterfaceSchema = {\n ...globalSchema,\n ...credentialsSchema,\n interfaceRef,\n} satisfies CommandSchema\n\nconst getPluginSchema = {\n ...globalSchema,\n ...credentialsSchema,\n pluginRef,\n} satisfies CommandSchema\n\nconst listPluginsSchema = {\n ...globalSchema,\n ...credentialsSchema,\n} satisfies CommandSchema\n\nconst deletePluginSchema = {\n ...globalSchema,\n ...credentialsSchema,\n pluginRef,\n} satisfies CommandSchema\n\nconst initSchema = {\n ...globalSchema,\n workDir,\n type: { type: 'string', choices: ['bot', 'integration', 'plugin'] as const },\n name: { type: 'string', description: 'The name of the project' },\n} satisfies CommandSchema\n\nconst lintSchema = {\n ...projectSchema,\n} satisfies CommandSchema\n\n// exports\n\nexport const schemas = {\n global: globalSchema,\n project: projectSchema,\n credentials: credentialsSchema,\n secrets: secretsSchema,\n\n login: loginSchema,\n logout: logoutSchema,\n createBot: createBotSchema,\n getBot: getBotSchema,\n deleteBot: deleteBotSchema,\n listBots: listBotsSchema,\n getIntegration: getIntegrationSchema,\n listIntegrations: listIntegrationsSchema,\n deleteIntegration: deleteIntegrationSchema,\n getInterface: getInterfaceSchema,\n listInterfaces: listInterfacesSchema,\n deleteInterface: deleteInterfaceSchema,\n getPlugin: getPluginSchema,\n listPlugins: listPluginsSchema,\n deletePlugin: deletePluginSchema,\n init: initSchema,\n generate: generateSchema,\n bundle: bundleSchema,\n build: buildSchema,\n read: readSchema,\n serve: serveSchema,\n deploy: deploySchema,\n add: addSchema,\n dev: devSchema,\n lint: lintSchema,\n} as const\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAwB;AAKxB,MAAM,OAAO;AAAA,EACX,MAAM;AAAA,EACN,aAAa;AACf;AAEA,MAAM,UAAU;AAAA,EACd,MAAM;AAAA,EACN,aAAa;AAAA,EACb,SAAS,OAAO;AAClB;AAE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F;AAEA,MAAM,kBAAkB;AAAA,EACtB,GAAG;AAAA,EACH,GAAG;AAAA,EACH;AACF;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,qBAAqB;AAAA,EACzB,GAAG;AAAA,EACH,GAAG;AAAA,EACH;AACF;AAEA,MAAM,aAAa;AAAA,EACjB,GAAG;AAAA,EACH;AAAA,EACA,MAAM,EAAE,MAAM,UAAU,SAAS,CAAC,OAAO,eAAe,QAAQ,EAAW;AAAA,EAC3E,MAAM,EAAE,MAAM,UAAU,aAAa,0BAA0B;AACjE;AAEA,MAAM,aAAa;AAAA,EACjB,GAAG;AACL;AAIO,MAAM,UAAU;AAAA,EACrB,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,aAAa;AAAA,EACb,SAAS;AAAA,EAET,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,aAAa;AAAA,EACb,cAAc;AAAA,EACd,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,KAAK;AAAA,EACL,MAAM;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/consts.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
package/dist/consts.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/consts.ts"],
|
|
4
4
|
"sourcesContent": ["import os from 'os'\nimport pathlib from 'path'\nimport { CLI_ROOT_DIR } from './root'\n\n// configurable\n\nexport const defaultBotpressHome = pathlib.join(os.homedir(), '.botpress')\nexport const defaultWorkDir = process.cwd()\nexport const defaultInstallPath = process.cwd()\nexport const defaultBotpressApiUrl = 'https://api.botpress.cloud'\nexport const defaultBotpressAppUrl = 'https://app.botpress.cloud'\nexport const defaultTunnelUrl = 'https://tunnel.botpress.cloud'\n\n// not configurable\n\nexport const cliRootDir = CLI_ROOT_DIR\nexport const emptyBotDirName = 'empty-bot'\nexport const emptyPluginDirName = 'empty-plugin'\nexport const emptyIntegrationDirName = 'empty-integration'\nexport const helloWorldIntegrationDirName = 'hello-world'\nexport const webhookMessageIntegrationDirName = 'webhook-message'\nexport const installDirName = 'bp_modules'\nexport const outDirName = '.botpress'\nexport const distDirName = 'dist'\n\nexport const fromCliRootDir = {\n emptyBotTemplate: pathlib.join('templates', emptyBotDirName),\n emptyPluginTemplate: pathlib.join('templates', emptyPluginDirName),\n emptyIntegrationTemplate: pathlib.join('templates', emptyIntegrationDirName),\n helloWorldIntegrationTemplate: pathlib.join('templates', helloWorldIntegrationDirName),\n webhookMessageIntegrationTemplate: pathlib.join('templates', webhookMessageIntegrationDirName),\n}\n\nexport const fromHomeDir = {\n globalCacheFile: 'global.cache.json',\n}\n\nexport const fromOutDir = {\n distDir: distDirName,\n outFile: pathlib.join(distDirName, 'index.js'),\n implementationDir: 'implementation',\n pluginsDir: 'plugins',\n secretsDir: 'secrets',\n projectCacheFile: 'project.cache.json',\n}\n\nexport const fromWorkDir = {\n integrationDefinition: 'integration.definition.ts',\n interfaceDefinition: 'interface.definition.ts',\n botDefinition: 'bot.definition.ts',\n pluginDefinition: 'plugin.definition.ts',\n entryPoint: pathlib.join('src', 'index.ts'),\n outDir: outDirName,\n distDir: pathlib.join(outDirName, fromOutDir.distDir),\n outFile: pathlib.join(outDirName, fromOutDir.outFile),\n implementationDir: pathlib.join(outDirName, fromOutDir.implementationDir),\n pluginsDir: pathlib.join(outDirName, fromOutDir.pluginsDir),\n secretsDir: pathlib.join(outDirName, fromOutDir.secretsDir),\n projectCacheFile: pathlib.join(outDirName, fromOutDir.projectCacheFile),\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAe;AACf,kBAAoB;AACpB,kBAA6B;AAItB,MAAM,sBAAsB,YAAAA,QAAQ,KAAK,UAAAC,QAAG,QAAQ,GAAG,WAAW;AAClE,MAAM,iBAAiB,QAAQ,IAAI;AACnC,MAAM,qBAAqB,QAAQ,IAAI;AACvC,MAAM,wBAAwB;AAC9B,MAAM,wBAAwB;AAC9B,MAAM,mBAAmB;AAIzB,MAAM,aAAa;AACnB,MAAM,kBAAkB;AACxB,MAAM,qBAAqB;AAC3B,MAAM,0BAA0B;AAChC,MAAM,+BAA+B;AACrC,MAAM,mCAAmC;AACzC,MAAM,iBAAiB;AACvB,MAAM,aAAa;AACnB,MAAM,cAAc;AAEpB,MAAM,iBAAiB;AAAA,EAC5B,kBAAkB,YAAAD,QAAQ,KAAK,aAAa,eAAe;AAAA,EAC3D,qBAAqB,YAAAA,QAAQ,KAAK,aAAa,kBAAkB;AAAA,EACjE,0BAA0B,YAAAA,QAAQ,KAAK,aAAa,uBAAuB;AAAA,EAC3E,+BAA+B,YAAAA,QAAQ,KAAK,aAAa,4BAA4B;AAAA,EACrF,mCAAmC,YAAAA,QAAQ,KAAK,aAAa,gCAAgC;AAC/F;AAEO,MAAM,cAAc;AAAA,EACzB,iBAAiB;AACnB;AAEO,MAAM,aAAa;AAAA,EACxB,SAAS;AAAA,EACT,SAAS,YAAAA,QAAQ,KAAK,aAAa,UAAU;AAAA,EAC7C,mBAAmB;AAAA,EACnB,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,kBAAkB;AACpB;AAEO,MAAM,cAAc;AAAA,EACzB,uBAAuB;AAAA,EACvB,qBAAqB;AAAA,EACrB,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,YAAY,YAAAA,QAAQ,KAAK,OAAO,UAAU;AAAA,EAC1C,QAAQ;AAAA,EACR,SAAS,YAAAA,QAAQ,KAAK,YAAY,WAAW,OAAO;AAAA,EACpD,SAAS,YAAAA,QAAQ,KAAK,YAAY,WAAW,OAAO;AAAA,EACpD,mBAAmB,YAAAA,QAAQ,KAAK,YAAY,WAAW,iBAAiB;AAAA,EACxE,YAAY,YAAAA,QAAQ,KAAK,YAAY,WAAW,UAAU;AAAA,EAC1D,YAAY,YAAAA,QAAQ,KAAK,YAAY,WAAW,UAAU;AAAA,EAC1D,kBAAkB,YAAAA,QAAQ,KAAK,YAAY,WAAW,gBAAgB;AACxE;",
|
|
6
6
|
"names": ["pathlib", "os"]
|
|
7
7
|
}
|
package/dist/errors.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
package/dist/errors.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/errors.ts"],
|
|
4
4
|
"sourcesContent": ["import { isApiError, ApiError, UnknownError } from '@botpress/client'\nimport axios, { AxiosError } from 'axios'\nimport { VError } from 'verror'\nimport * as consts from './consts'\n\ntype KnownApiError = Exclude<ApiError, UnknownError>\nconst isKnownApiError = (e: unknown): e is KnownApiError => isApiError(e) && !(e instanceof UnknownError)\n\nexport class BotpressCLIError extends VError {\n public static wrap(thrown: unknown, message: string): BotpressCLIError {\n const err = BotpressCLIError.map(thrown)\n return new BotpressCLIError(err, message ?? '')\n }\n\n public static map(thrown: unknown): BotpressCLIError {\n if (thrown instanceof BotpressCLIError) {\n return thrown\n }\n if (thrown instanceof UnknownError) {\n const inst = new HTTPError(500, 'An unknown error has occurred.')\n inst.debug = thrown.message\n return inst\n }\n if (isKnownApiError(thrown)) {\n return HTTPError.fromApi(thrown)\n }\n if (axios.isAxiosError(thrown)) {\n return HTTPError.fromAxios(thrown)\n }\n if (thrown instanceof Error) {\n const { message } = thrown\n return new BotpressCLIError(message)\n }\n return new BotpressCLIError(`${thrown}`)\n }\n\n private readonly _debug: string[]\n\n public constructor(error: BotpressCLIError, message: string)\n public constructor(message: string)\n public constructor(first: BotpressCLIError | string, second?: string) {\n if (typeof first === 'string') {\n super(first)\n this._debug = []\n return\n }\n super(first, second!)\n this._debug = [...first._debug]\n }\n\n public set debug(msg: string) {\n this._debug.push(msg)\n }\n\n public get debug(): string {\n const dbgMsgs = this._debug.filter((s) => s.length)\n if (!dbgMsgs.length) {\n return ''\n }\n return 'Error: \\n' + dbgMsgs.map((s) => ` ${s}`).join('\\n')\n }\n}\n\nexport class ExclusiveBotFeatureError extends BotpressCLIError {\n public constructor() {\n const message = 'This feature is only available for bots. This project is an integration or interface.'\n super(message)\n }\n}\n\nexport class ExclusiveIntegrationFeatureError extends BotpressCLIError {\n public constructor() {\n const message = 'This feature is only available for integration. This project is a bot or interface.'\n super(message)\n }\n}\n\nexport class HTTPError extends BotpressCLIError {\n public constructor(public readonly status: number | undefined, message: string) {\n super(message)\n }\n\n public static fromAxios(e: AxiosError<{ message?: string }>): HTTPError {\n const message = this._axiosMsg(e)\n return new HTTPError(e.response?.status, message)\n }\n\n public static fromApi(e: KnownApiError): HTTPError {\n const { message, code } = e\n return new HTTPError(code, message)\n }\n\n private static _axiosMsg(e: AxiosError<{ message?: string }>): string {\n let message = e.message\n if (e.response?.statusText) {\n message += `\\n ${e.response?.statusText}`\n }\n if (e.response?.status && e.request?.method && e.request?.path) {\n message += `\\n (${e.response?.status}) ${e.request.method} ${e.request.path}`\n }\n if (e.response?.data?.message) {\n message += `\\n ${e.response?.data?.message}`\n }\n return message\n }\n}\n\nexport class NoBundleFoundError extends BotpressCLIError {\n public constructor() {\n const message = 'No bundle found. Please run `bp bundle` first.'\n super(message)\n }\n}\n\nexport class NoBotsFoundError extends BotpressCLIError {\n public constructor() {\n const message = `No Bot found in your Workspace. Please create one first at ${consts.defaultBotpressAppUrl}.`\n super(message)\n }\n}\n\nexport class NoWorkspacesFoundError extends BotpressCLIError {\n public constructor() {\n const message = 'No Workspace found. Please create one first.'\n super(message)\n }\n}\n\nexport class NotLoggedInError extends BotpressCLIError {\n public constructor() {\n const message = 'Not logged in. Please run `bp login` first.'\n super(message)\n }\n}\n\nexport class ParamRequiredError extends BotpressCLIError {\n public constructor(param: string) {\n const message = `${param} is required.`\n super(message)\n }\n}\n\nexport class InvalidPackageReferenceError extends BotpressCLIError {\n public constructor(ref: string) {\n const message = `Invalid package reference \"${ref}\".`\n super(message)\n }\n}\n\nexport class UnsupportedProjectType extends BotpressCLIError {\n public constructor() {\n const message = 'Unsupported project type.'\n super(message)\n }\n}\n\nexport class ProjectDefinitionNotFoundError extends BotpressCLIError {\n public constructor(workdir: string) {\n const message = `No project definition found at \"${workdir}\".`\n super(message)\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAmD;AACnD,mBAAkC;AAClC,oBAAuB;AACvB,aAAwB;AAGxB,MAAM,kBAAkB,CAAC,UAAmC,0BAAW,CAAC,KAAK,EAAE,aAAa;AAErF,MAAM,yBAAyB,qBAAO;AAAA,EAC3C,OAAc,KAAK,QAAiB,SAAmC;AACrE,UAAM,MAAM,iBAAiB,IAAI,MAAM;AACvC,WAAO,IAAI,iBAAiB,KAAK,WAAW,EAAE;AAAA,EAChD;AAAA,EAEA,OAAc,IAAI,QAAmC;AACnD,QAAI,kBAAkB,kBAAkB;AACtC,aAAO;AAAA,IACT;AACA,QAAI,kBAAkB,4BAAc;AAClC,YAAM,OAAO,IAAI,UAAU,KAAK,gCAAgC;AAChE,WAAK,QAAQ,OAAO;AACpB,aAAO;AAAA,IACT;AACA,QAAI,gBAAgB,MAAM,GAAG;AAC3B,aAAO,UAAU,QAAQ,MAAM;AAAA,IACjC;AACA,QAAI,aAAAA,QAAM,aAAa,MAAM,GAAG;AAC9B,aAAO,UAAU,UAAU,MAAM;AAAA,IACnC;AACA,QAAI,kBAAkB,OAAO;AAC3B,YAAM,EAAE,QAAQ,IAAI;AACpB,aAAO,IAAI,iBAAiB,OAAO;AAAA,IACrC;AACA,WAAO,IAAI,iBAAiB,GAAG,QAAQ;AAAA,EACzC;AAAA,EAEiB;AAAA,EAIV,YAAY,OAAkC,QAAiB;AACpE,QAAI,OAAO,UAAU,UAAU;AAC7B,YAAM,KAAK;AACX,WAAK,SAAS,CAAC;AACf;AAA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QAAI,EAAE,UAAU,MAAM,SAAS;AAC7B,iBAAW;AAAA,IAAO,EAAE,UAAU,MAAM;AAAA,IACtC;AACA,WAAO;AAAA,EACT;AACF;AAEO,MAAM,2BAA2B,iBAAiB;AAAA,EAChD,cAAc;AACnB,UAAM,UAAU;AAChB,UAAM,OAAO;AAAA,EACf;AACF;AAEO,MAAM,yBAAyB,iBAAiB;AAAA,EAC9C,cAAc;AACnB,UAAM,UAAU,8DAA8D,OAAO;AACrF,UAAM,OAAO;AAAA,EACf;AACF;AAEO,MAAM,+BAA+B,iBAAiB;AAAA,EACpD,cAAc;AACnB,UAAM,UAAU;AAChB,UAAM,OAAO;AAAA,EACf;AACF;AAEO,MAAM,yBAAyB,iBAAiB;AAAA,EAC9C,cAAc;AACnB,UAAM,UAAU;AAChB,UAAM,OAAO;AAAA,EACf;AACF;AAEO,MAAM,2BAA2B,iBAAiB;AAAA,EAChD,YAAY,OAAe;AAChC,UAAM,UAAU,GAAG;AACnB,UAAM,OAAO;AAAA,EACf;AACF;AAEO,MAAM,qCAAqC,iBAAiB;AAAA,EAC1D,YAAY,KAAa;AAC9B,UAAM,UAAU,8BAA8B;AAC9C,UAAM,OAAO;AAAA,EACf;AACF;AAEO,MAAM,+BAA+B,iBAAiB;AAAA,EACpD,cAAc;AACnB,UAAM,UAAU;AAChB,UAAM,OAAO;AAAA,EACf;AACF;AAEO,MAAM,uCAAuC,iBAAiB;AAAA,EAC5D,YAAY,SAAiB;AAClC,UAAM,UAAU,mCAAmC;AACnD,UAAM,OAAO;AAAA,EACf;AACF;",
|
|
6
6
|
"names": ["axios"]
|
|
7
7
|
}
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
14
|
return to;
|
|
15
15
|
};
|
|
16
16
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
17
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
18
22
|
mod
|
|
19
23
|
));
|
package/dist/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["import 'dotenv/config'\nimport yargs from '@bpinternal/yargs-extra'\nimport commandDefinitions from './command-definitions'\nimport commandImplementations from './command-implementations'\nimport * as tree from './command-tree'\nimport * as errors from './errors'\nimport { Logger } from './logger'\nimport { registerYargs } from './register-yargs'\n\nconst logError = (thrown: unknown) => {\n const error = errors.BotpressCLIError.map(thrown)\n new Logger().error(error.message)\n}\n\nconst onError = (thrown: unknown) => {\n logError(thrown)\n process.exit(1)\n}\n\nconst yargsFail = (msg: string) => {\n logError(`${msg}\\n`)\n yargs.showHelp()\n process.exit(1)\n}\n\nprocess.on('uncaughtException', (thrown: unknown) => onError(thrown))\nprocess.on('unhandledRejection', (thrown: unknown) => onError(thrown))\n\nconst commands = tree.zipTree(commandDefinitions, commandImplementations)\n\nregisterYargs(yargs, commands)\n\nvoid yargs\n .version()\n .scriptName('bp')\n .demandCommand(1, \"You didn't provide any command. Use the --help flag to see the list of available commands.\")\n .recommendCommands()\n .strict()\n .help()\n .fail(yargsFail)\n .parse()\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,oBAAO;AACP,yBAAkB;AAClB,iCAA+B;AAC/B,qCAAmC;AACnC,WAAsB;AACtB,aAAwB;AACxB,oBAAuB;AACvB,4BAA8B;AAE9B,MAAM,WAAW,CAAC,WAAoB;AACpC,QAAM,QAAQ,OAAO,iBAAiB,IAAI,MAAM;AAChD,MAAI,qBAAO,EAAE,MAAM,MAAM,OAAO;AAClC;AAEA,MAAM,UAAU,CAAC,WAAoB;AACnC,WAAS,MAAM;AACf,UAAQ,KAAK,CAAC;AAChB;AAEA,MAAM,YAAY,CAAC,QAAgB;AACjC,WAAS,GAAG;AAAA,CAAO;AACnB,qBAAAA,QAAM,SAAS;AACf,UAAQ,KAAK,CAAC;AAChB;AAEA,QAAQ,GAAG,qBAAqB,CAAC,WAAoB,QAAQ,MAAM,CAAC;AACpE,QAAQ,GAAG,sBAAsB,CAAC,WAAoB,QAAQ,MAAM,CAAC;AAErE,MAAM,WAAW,KAAK,QAAQ,2BAAAC,SAAoB,+BAAAC,OAAsB;AAAA,IAExE,qCAAc,mBAAAF,SAAO,QAAQ;AAE7B,KAAK,mBAAAA,QACF,QAAQ,EACR,WAAW,IAAI,EACf,cAAc,GAAG,4FAA4F,EAC7G,kBAAkB,EAClB,OAAO,EACP,KAAK,EACL,KAAK,SAAS,EACd,MAAM;",
|
|
6
6
|
"names": ["yargs", "commandDefinitions", "commandImplementations"]
|
|
7
7
|
}
|
package/dist/init.js
CHANGED
|
@@ -14,6 +14,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
14
|
return to;
|
|
15
15
|
};
|
|
16
16
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
17
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
18
22
|
mod
|
|
19
23
|
));
|
package/dist/init.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/init.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * Important:\n *\n * This file must be kept at the root of the src directory (and dist directory when built)\n */\nimport Module from 'module'\nimport pathlib from 'path'\n\nconst DEFAULT_DIRNAME = '.botpress'\n\nconst getOutDir = () => {\n const { BP_OUTDIR } = process.env\n if (!BP_OUTDIR) {\n return pathlib.join(process.cwd(), DEFAULT_DIRNAME)\n }\n if (pathlib.isAbsolute(BP_OUTDIR)) {\n return BP_OUTDIR\n }\n return pathlib.join(process.cwd(), BP_OUTDIR)\n}\n\nconst outDirPath = getOutDir()\nconst outDirName = pathlib.basename(outDirPath)\nconst originalRequire = Module.prototype.require\n\nconst rewire = function (this: NodeRequire, mod: string) {\n const importParts = mod.split('/')\n\n if (importParts[0] === outDirName) {\n const newMod = importParts.slice(1).join('/')\n const fullpath = pathlib.join(outDirPath, newMod)\n return originalRequire.apply(this, [fullpath])\n }\n\n return originalRequire.apply(this, [mod])\n} as NodeRequire\n\nModule.prototype.require = rewire\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAKA,oBAAmB;AACnB,kBAAoB;AAEpB,MAAM,kBAAkB;AAExB,MAAM,YAAY,MAAM;AACtB,QAAM,EAAE,UAAU,IAAI,QAAQ;AAC9B,MAAI,CAAC,WAAW;AACd,WAAO,YAAAA,QAAQ,KAAK,QAAQ,IAAI,GAAG,eAAe;AAAA,EACpD;AACA,MAAI,YAAAA,QAAQ,WAAW,SAAS,GAAG;AACjC,WAAO;AAAA,EACT;AACA,SAAO,YAAAA,QAAQ,KAAK,QAAQ,IAAI,GAAG,SAAS;AAC9C;AAEA,MAAM,aAAa,UAAU;AAC7B,MAAM,aAAa,YAAAA,QAAQ,SAAS,UAAU;AAC9C,MAAM,kBAAkB,cAAAC,QAAO,UAAU;AAEzC,MAAM,SAAS,SAA6B,KAAa;AACvD,QAAM,cAAc,IAAI,MAAM,GAAG;AAEjC,MAAI,YAAY,CAAC,MAAM,YAAY;AACjC,UAAM,SAAS,YAAY,MAAM,CAAC,EAAE,KAAK,GAAG;AAC5C,UAAM,WAAW,YAAAD,QAAQ,KAAK,YAAY,MAAM;AAChD,WAAO,gBAAgB,MAAM,MAAM,CAAC,QAAQ,CAAC;AAAA,EAC/C;AAEA,SAAO,gBAAgB,MAAM,MAAM,CAAC,GAAG,CAAC;AAC1C;AAEA,cAAAC,QAAO,UAAU,UAAU;",
|
|
6
6
|
"names": ["pathlib", "Module"]
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/linter/base-linter.ts"],
|
|
4
4
|
"sourcesContent": ["import { Spectral, Document, type ISpectralDiagnostic, type RulesetDefinition } from '@stoplight/spectral-core'\nimport { Json as JsonParser, type JsonParserResult } from '@stoplight/spectral-parsers'\nimport { type Logger } from '../logger'\n\ntype ProblemSeverity = 0 | 1 | 2 | 3\n\nexport abstract class BaseLinter<TDefinition> {\n private readonly _spectral: Spectral\n private readonly _spectralDocument: Document<unknown, JsonParserResult<unknown>>\n private _results: ISpectralDiagnostic[] = []\n\n protected constructor(definition: TDefinition, ruleset: RulesetDefinition) {\n const json = JSON.stringify(definition)\n this._spectralDocument = new Document(json, JsonParser)\n this._spectral = new Spectral()\n this._spectral.setRuleset(ruleset)\n }\n\n public async lint(): Promise<void> {\n this._results = await this._spectral.run(this._spectralDocument)\n }\n\n public logResults(logger: Logger) {\n for (const result of this.getSortedResults()) {\n const message = `${result.path}: ${result.message}`\n\n this._logResultMessage(logger, message, result.severity)\n }\n }\n\n public getSortedResults() {\n return this._getResults().sort((a, b) => (a.path > b.path ? 1 : a.path < b.path ? -1 : 0))\n }\n\n public hasErrors() {\n return this._results.some((result) => result.severity === 0)\n }\n\n private _getResults() {\n return this._results.map((result) => ({\n message: result.message,\n path: this._simplifyPath(result.path),\n severity: result.severity as ProblemSeverity,\n }))\n }\n\n private _simplifyPath(path: (string | number)[]) {\n return path.join('.').replaceAll('.properties.', '.').replaceAll('.x-zui', '')\n }\n\n private _logResultMessage(logger: Logger, message: string, severity: ProblemSeverity) {\n const logLevelMapping = {\n 0: logger.error,\n 1: logger.warn,\n 2: logger.log,\n 3: logger.debug,\n } as const\n\n logLevelMapping[severity].call(logger, message)\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAqF;AACrF,8BAA0D;AAKnD,MAAe,WAAwB;AAAA,EAC3B;AAAA,EACA;AAAA,EACT,WAAkC,CAAC;AAAA,EAEjC,YAAY,YAAyB,SAA4B;AACzE,UAAM,OAAO,KAAK,UAAU,UAAU;AACtC,SAAK,oBAAoB,IAAI,8BAAS,MAAM,wBAAAA,IAAU;AACtD,SAAK,YAAY,IAAI,8BAAS;AAC9B,SAAK,UAAU,WAAW,OAAO;AAAA,EACnC;AAAA,EAEA,MAAa,OAAsB;AACjC,SAAK,WAAW,MAAM,KAAK,UAAU,IAAI,KAAK,iBAAiB;AAAA,EACjE;AAAA,EAEO,WAAW,QAAgB;AAChC,eAAW,UAAU,KAAK,iBAAiB,GAAG;AAC5C,YAAM,UAAU,GAAG,OAAO,SAAS,OAAO;AAE1C,WAAK,kBAAkB,QAAQ,SAAS,OAAO,QAAQ;AAAA,IACzD;AAAA,EACF;AAAA,EAEO,mBAAmB;AACxB,WAAO,KAAK,YAAY,EAAE,KAAK,CAAC,GAAG,MAAO,EAAE,OAAO,EAAE,OAAO,IAAI,EAAE,OAAO,EAAE,OAAO,KAAK,CAAE;AAAA,EAC3F;AAAA,EAEO,YAAY;AACjB,WAAO,KAAK,SAAS,KAAK,CAAC,WAAW,OAAO,aAAa,CAAC;AAAA,EAC7D;AAAA,EAEQ,cAAc;AACpB,WAAO,KAAK,SAAS,IAAI,CAAC,YAAY;AAAA,MACpC,SAAS,OAAO;AAAA,MAChB,MAAM,KAAK,cAAc,OAAO,IAAI;AAAA,MACpC,UAAU,OAAO;AAAA,IACnB,EAAE;AAAA,EACJ;AAAA,EAEQ,cAAc,M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AAA,MACpC,SAAS,OAAO;AAAA,MAChB,MAAM,KAAK,cAAc,OAAO,IAAI;AAAA,MACpC,UAAU,OAAO;AAAA,IACnB,EAAE;AAAA,EACJ;AAAA,EAEQ,cAAc,MAA2B;AAC/C,WAAO,KAAK,KAAK,GAAG,EAAE,WAAW,gBAAgB,GAAG,EAAE,WAAW,UAAU,EAAE;AAAA,EAC/E;AAAA,EAEQ,kBAAkB,QAAgB,SAAiB,UAA2B;AACpF,UAAM,kBAAkB;AAAA,MACtB,GAAG,OAAO;AAAA,MACV,GAAG,OAAO;AAAA,MACV,GAAG,OAAO;AAAA,MACV,GAAG,OAAO;AAAA,IACZ;AAEA,oBAAgB,QAAQ,EAAE,KAAK,QAAQ,OAAO;AAAA,EAChD;AACF;",
|
|
6
6
|
"names": ["JsonParser"]
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/linter/base-linter.test.ts"],
|
|
4
4
|
"sourcesContent": ["import { test, expect, describe, vi } from 'vitest'\nimport { prepareCreateIntegrationBody } from '../api/integration-body'\nimport { IntegrationLinter } from './integration-linter'\nimport { IntegrationDefinition, type IntegrationDefinitionProps, z } from '@botpress/sdk'\n\nconst EMPTY_STRING = ''\nconst TRUTHY_STRING = 'truthy'\nconst ACTION_NAME = 'actionName'\nconst EVENT_NAME = 'eventName'\nconst CONFIG_NAME = 'configName'\nconst PARAM_NAME = 'paramName'\nconst TAG_NAME = 'tagName'\nconst CHANNEL_NAME = 'channelName'\nconst STATE_NAME = 'stateName'\nconst MESSAGE_TYPE = 'text'\nconst SECRET_NAME = 'SECRET_NAME'\n\nconst VALID_INTEGRATION = {\n name: TRUTHY_STRING,\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n version: TRUTHY_STRING,\n readme: TRUTHY_STRING,\n icon: TRUTHY_STRING,\n actions: {\n [ACTION_NAME]: {\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n input: {\n schema: z\n .object({\n [PARAM_NAME]: z.string().title(TRUTHY_STRING).describe(TRUTHY_STRING),\n })\n .title(TRUTHY_STRING)\n .describe(TRUTHY_STRING),\n },\n output: {\n schema: z\n .object({\n [PARAM_NAME]: z.string().title(TRUTHY_STRING).describe(TRUTHY_STRING),\n })\n .title(TRUTHY_STRING)\n .describe(TRUTHY_STRING),\n },\n },\n },\n events: {\n [EVENT_NAME]: {\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n schema: z\n .object({\n [PARAM_NAME]: z.string().title(TRUTHY_STRING).describe(TRUTHY_STRING),\n })\n .title(TRUTHY_STRING)\n .describe(TRUTHY_STRING),\n },\n },\n configuration: {\n schema: z\n .object({\n [PARAM_NAME]: z.string().title(TRUTHY_STRING).describe(TRUTHY_STRING),\n })\n .title(TRUTHY_STRING)\n .describe(TRUTHY_STRING),\n },\n configurations: {\n [CONFIG_NAME]: {\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n schema: z\n .object({\n [PARAM_NAME]: z.string().title(TRUTHY_STRING).describe(TRUTHY_STRING),\n })\n .title(TRUTHY_STRING)\n .describe(TRUTHY_STRING),\n },\n },\n user: {\n tags: {\n [TAG_NAME]: {\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n },\n },\n },\n channels: {\n [CHANNEL_NAME]: {\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n messages: {\n [MESSAGE_TYPE]: {\n schema: z\n .object({\n [PARAM_NAME]: z.string().title(TRUTHY_STRING).describe(TRUTHY_STRING),\n })\n .title(TRUTHY_STRING)\n .describe(TRUTHY_STRING),\n },\n },\n message: {\n tags: {\n [TAG_NAME]: {\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n },\n },\n },\n conversation: {\n tags: {\n [TAG_NAME]: {\n title: TRUTHY_STRING,\n description: TRUTHY_STRING,\n },\n },\n },\n },\n },\n states: {\n [STATE_NAME]: {\n type: 'integration',\n schema: z\n .object({\n [PARAM_NAME]: z.string().title(TRUTHY_STRING).describe(TRUTHY_STRING),\n })\n .title(TRUTHY_STRING)\n .describe(TRUTHY_STRING),\n },\n },\n secrets: {\n [SECRET_NAME]: {\n description: TRUTHY_STRING,\n },\n },\n} as const satisfies IntegrationDefinitionProps\n\nconst mockLogger = {\n log: vi.fn((message) => void message),\n warn: vi.fn((message) => void message),\n error: vi.fn((message) => void message),\n debug: vi.fn((message) => void message),\n}\n\nconst lintDefinition = async (definition: IntegrationDefinitionProps) => {\n const integrationDefinition = new IntegrationDefinition(definition)\n const integrationBody = await prepareCreateIntegrationBody(integrationDefinition)\n const linter = new IntegrationLinter({ ...integrationBody, secrets: integrationDefinition.secrets })\n await linter.lint()\n return linter\n}\n\nconst lintDefinitionAndReturnResults = async (definition: IntegrationDefinitionProps) => {\n const linter = await lintDefinition(definition)\n return linter.getSortedResults()\n}\n\nconst lintDefinitionAndLogResults = async (definition: IntegrationDefinitionProps) => {\n const linter = await lintDefinition(definition)\n linter.logResults(mockLogger as any)\n}\n\ndescribe.concurrent('Integration Linter', () => {\n test('should lint a valid definition without giving errors', async () => {\n // arrange\n const definition = VALID_INTEGRATION\n\n // act\n const results = await lintDefinitionAndReturnResults(definition)\n\n expect(results).toEqual([])\n })\n\n test('should report an error when missing required fields', async () => {\n // arrange\n const definition = {\n ...VALID_INTEGRATION,\n title: EMPTY_STRING,\n } as const\n\n // act\n const results = await lintDefinitionAndReturnResults(definition)\n\n // assert\n expect(results[0]?.message).toContain('title')\n })\n\n test('should report an error when missing a title in an action input schema', async () => {\n // arrange\n const definition = {\n ...VALID_INTEGRATION,\n actions: {\n [ACTION_NAME]: {\n ...VALID_INTEGRATION.actions[ACTION_NAME],\n input: {\n schema: z.object({\n [PARAM_NAME]: z.string().describe(TRUTHY_STRING),\n }),\n },\n },\n },\n } as const\n\n // act\n const results = await lintDefinitionAndReturnResults(definition)\n\n // assert\n expect(results[0]?.message).toContain('title')\n })\n\n test('should log as an error when severity is 0', async () => {\n // arrange\n const definition = {\n ...VALID_INTEGRATION,\n title: EMPTY_STRING,\n } as const\n\n // act\n await lintDefinitionAndLogResults(definition)\n\n // assert\n expect(mockLogger.error).toHaveBeenCalled()\n })\n\n test('should log as a warning when severity is 1', async () => {\n // arrange\n const definition = {\n ...VALID_INTEGRATION,\n user: {\n tags: {\n [TAG_NAME]: {},\n },\n },\n } as const\n\n // act\n await lintDefinitionAndLogResults(definition)\n\n // assert\n expect(mockLogger.warn).toHaveBeenCalled()\n })\n})\n"],
|
|
5
|
-
"mappings": ";AAAA,oBAA2C;AAC3C,8BAA6C;AAC7C,gCAAkC;AAClC,iBAA0E;AAE1E,MAAM,eAAe;AACrB,MAAM,gBAAgB;AACtB,MAAM,cAAc;AACpB,MAAM,aAAa;AACnB,MAAM,cAAc;AACpB,MAAM,aAAa;AACnB,MAAM,WAAW;AACjB,MAAM,eAAe;AACrB,MAAM,aAAa;AACnB,MAAM,eAAe;AACrB,MAAM,cAAc;AAEpB,MAAM,oBAAoB;AAAA,EACxB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,aAAa;AAAA,EACb,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,SAAS;AAAA,IACP,CAAC,
|
|
5
|
+
"mappings": ";AAAA,oBAA2C;AAC3C,8BAA6C;AAC7C,gCAAkC;AAClC,iBAA0E;AAE1E,MAAM,eAAe;AACrB,MAAM,gBAAgB;AACtB,MAAM,cAAc;AACpB,MAAM,aAAa;AACnB,MAAM,cAAc;AACpB,MAAM,aAAa;AACnB,MAAM,WAAW;AACjB,MAAM,eAAe;AACrB,MAAM,aAAa;AACnB,MAAM,eAAe;AACrB,MAAM,cAAc;AAEpB,MAAM,oBAAoB;AAAA,EACxB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,aAAa;AAAA,EACb,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,SAAS;AAAA,IACP,CAAC,WAAW,GAAG;AAAA,MACb,OAAO;AAAA,MACP,aAAa;AAAA,MACb,OAAO;A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