@botpress/cli 2.1.0 → 2.1.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 +22 -0
- package/dist/api/bot-body.js +89 -0
- package/dist/api/bot-body.js.map +7 -0
- package/dist/api/client.js +169 -0
- package/dist/api/client.js.map +7 -0
- package/dist/api/find-previous-version.js +66 -0
- package/dist/api/find-previous-version.js.map +7 -0
- package/dist/api/find-previous-version.test.js +76 -0
- package/dist/api/find-previous-version.test.js.map +7 -0
- package/dist/api/index.js +23 -0
- package/dist/api/index.js.map +7 -0
- package/dist/api/integration-body.js +146 -0
- package/dist/api/integration-body.js.map +7 -0
- package/dist/api/interface-body.js +95 -0
- package/dist/api/interface-body.js.map +7 -0
- package/dist/api/paging.js +42 -0
- package/dist/api/paging.js.map +7 -0
- package/dist/api/plugin-body.js +84 -0
- package/dist/api/plugin-body.js.map +7 -0
- package/dist/api/types.js +17 -0
- package/dist/api/types.js.map +7 -0
- package/dist/chat/index.js +211 -0
- package/dist/chat/index.js.map +7 -0
- package/dist/code-generation/bot-implementation/bot-implementation.js +116 -0
- package/dist/code-generation/bot-implementation/bot-implementation.js.map +7 -0
- package/dist/code-generation/bot-implementation/bot-plugins/index.js +80 -0
- package/dist/code-generation/bot-implementation/bot-plugins/index.js.map +7 -0
- package/dist/code-generation/bot-implementation/bot-plugins/plugin-module.js +129 -0
- package/dist/code-generation/bot-implementation/bot-plugins/plugin-module.js.map +7 -0
- package/dist/code-generation/bot-implementation/bot-typings/actions-module.js +88 -0
- package/dist/code-generation/bot-implementation/bot-typings/actions-module.js.map +7 -0
- package/dist/code-generation/bot-implementation/bot-typings/events-module.js +63 -0
- package/dist/code-generation/bot-implementation/bot-typings/events-module.js.map +7 -0
- package/dist/code-generation/bot-implementation/bot-typings/index.js +109 -0
- package/dist/code-generation/bot-implementation/bot-typings/index.js.map +7 -0
- package/dist/code-generation/bot-implementation/bot-typings/states-module.js +64 -0
- package/dist/code-generation/bot-implementation/bot-typings/states-module.js.map +7 -0
- package/dist/code-generation/bot-implementation/index.js +66 -0
- package/dist/code-generation/bot-implementation/index.js.map +7 -0
- package/dist/code-generation/consts.js +45 -0
- package/dist/code-generation/consts.js.map +7 -0
- package/dist/code-generation/generators.js +81 -0
- package/dist/code-generation/generators.js.map +7 -0
- package/dist/code-generation/index.js +49 -0
- package/dist/code-generation/index.js.map +7 -0
- package/dist/code-generation/integration-implementation/index.js +70 -0
- package/dist/code-generation/integration-implementation/index.js.map +7 -0
- package/dist/code-generation/integration-implementation/integration-implementation.js +114 -0
- package/dist/code-generation/integration-implementation/integration-implementation.js.map +7 -0
- package/dist/code-generation/integration-implementation/integration-secret.js +78 -0
- package/dist/code-generation/integration-implementation/integration-secret.js.map +7 -0
- package/dist/code-generation/integration-implementation/integration-typings/actions-module.js +88 -0
- package/dist/code-generation/integration-implementation/integration-typings/actions-module.js.map +7 -0
- package/dist/code-generation/integration-implementation/integration-typings/channels-module.js +107 -0
- package/dist/code-generation/integration-implementation/integration-typings/channels-module.js.map +7 -0
- package/dist/code-generation/integration-implementation/integration-typings/configuration-module.js +62 -0
- package/dist/code-generation/integration-implementation/integration-typings/configuration-module.js.map +7 -0
- package/dist/code-generation/integration-implementation/integration-typings/configurations-module.js +70 -0
- package/dist/code-generation/integration-implementation/integration-typings/configurations-module.js.map +7 -0
- package/dist/code-generation/integration-implementation/integration-typings/entities-module.js +63 -0
- package/dist/code-generation/integration-implementation/integration-typings/entities-module.js.map +7 -0
- package/dist/code-generation/integration-implementation/integration-typings/events-module.js +63 -0
- package/dist/code-generation/integration-implementation/integration-typings/events-module.js.map +7 -0
- package/dist/code-generation/integration-implementation/integration-typings/index.js +128 -0
- package/dist/code-generation/integration-implementation/integration-typings/index.js.map +7 -0
- package/dist/code-generation/integration-implementation/integration-typings/states-module.js +64 -0
- package/dist/code-generation/integration-implementation/integration-typings/states-module.js.map +7 -0
- package/dist/code-generation/integration-package/index.js +94 -0
- package/dist/code-generation/integration-package/index.js.map +7 -0
- package/dist/code-generation/integration-package/integration-package-definition/actions-module.js +88 -0
- package/dist/code-generation/integration-package/integration-package-definition/actions-module.js.map +7 -0
- package/dist/code-generation/integration-package/integration-package-definition/channels-module.js +107 -0
- package/dist/code-generation/integration-package/integration-package-definition/channels-module.js.map +7 -0
- package/dist/code-generation/integration-package/integration-package-definition/configuration-module.js +63 -0
- package/dist/code-generation/integration-package/integration-package-definition/configuration-module.js.map +7 -0
- package/dist/code-generation/integration-package/integration-package-definition/configurations-module.js +70 -0
- package/dist/code-generation/integration-package/integration-package-definition/configurations-module.js.map +7 -0
- package/dist/code-generation/integration-package/integration-package-definition/entities-module.js +63 -0
- package/dist/code-generation/integration-package/integration-package-definition/entities-module.js.map +7 -0
- package/dist/code-generation/integration-package/integration-package-definition/events-module.js +66 -0
- package/dist/code-generation/integration-package/integration-package-definition/events-module.js.map +7 -0
- package/dist/code-generation/integration-package/integration-package-definition/index.js +140 -0
- package/dist/code-generation/integration-package/integration-package-definition/index.js.map +7 -0
- package/dist/code-generation/integration-package/integration-package-definition/states-module.js +66 -0
- package/dist/code-generation/integration-package/integration-package-definition/states-module.js.map +7 -0
- package/dist/code-generation/integration-package/integration-package-definition/typings.js +17 -0
- package/dist/code-generation/integration-package/integration-package-definition/typings.js.map +7 -0
- package/dist/code-generation/interface-implementation/index.js +29 -0
- package/dist/code-generation/interface-implementation/index.js.map +7 -0
- package/dist/code-generation/interface-implementation/integration-typings/actions-module.js +88 -0
- package/dist/code-generation/interface-implementation/integration-typings/actions-module.js.map +7 -0
- package/dist/code-generation/interface-implementation/integration-typings/channels-module.js +107 -0
- package/dist/code-generation/interface-implementation/integration-typings/channels-module.js.map +7 -0
- package/dist/code-generation/interface-implementation/integration-typings/entities-module.js +63 -0
- package/dist/code-generation/interface-implementation/integration-typings/entities-module.js.map +7 -0
- package/dist/code-generation/interface-implementation/integration-typings/events-module.js +63 -0
- package/dist/code-generation/interface-implementation/integration-typings/events-module.js.map +7 -0
- package/dist/code-generation/interface-implementation/integration-typings/index.js +121 -0
- package/dist/code-generation/interface-implementation/integration-typings/index.js.map +7 -0
- package/dist/code-generation/interface-package/index.js +94 -0
- package/dist/code-generation/interface-package/index.js.map +7 -0
- package/dist/code-generation/interface-package/interface-package-definition/actions-module.js +88 -0
- package/dist/code-generation/interface-package/interface-package-definition/actions-module.js.map +7 -0
- package/dist/code-generation/interface-package/interface-package-definition/channels-module.js +98 -0
- package/dist/code-generation/interface-package/interface-package-definition/channels-module.js.map +7 -0
- package/dist/code-generation/interface-package/interface-package-definition/entities-module.js +63 -0
- package/dist/code-generation/interface-package/interface-package-definition/entities-module.js.map +7 -0
- package/dist/code-generation/interface-package/interface-package-definition/events-module.js +66 -0
- package/dist/code-generation/interface-package/interface-package-definition/events-module.js.map +7 -0
- package/dist/code-generation/interface-package/interface-package-definition/index.js +104 -0
- package/dist/code-generation/interface-package/interface-package-definition/index.js.map +7 -0
- package/dist/code-generation/interface-package/interface-package-definition/typings.js +17 -0
- package/dist/code-generation/interface-package/interface-package-definition/typings.js.map +7 -0
- package/dist/code-generation/module.js +183 -0
- package/dist/code-generation/module.js.map +7 -0
- package/dist/code-generation/plugin-implementation/index.js +60 -0
- package/dist/code-generation/plugin-implementation/index.js.map +7 -0
- package/dist/code-generation/plugin-implementation/plugin-implementation.js +90 -0
- package/dist/code-generation/plugin-implementation/plugin-implementation.js.map +7 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/actions-module.js +88 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/actions-module.js.map +7 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/configuration-module.js +61 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/configuration-module.js.map +7 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/events-module.js +63 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/events-module.js.map +7 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/index.js +150 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/index.js.map +7 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/states-module.js +64 -0
- package/dist/code-generation/plugin-implementation/plugin-typings/states-module.js.map +7 -0
- package/dist/code-generation/plugin-package/index.js +151 -0
- package/dist/code-generation/plugin-package/index.js.map +7 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/actions-module.js +88 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/actions-module.js.map +7 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/configuration-module.js +56 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/configuration-module.js.map +7 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/events-module.js +66 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/events-module.js.map +7 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/index.js +107 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/index.js.map +7 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/states-module.js +66 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/states-module.js.map +7 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/typings.js +17 -0
- package/dist/code-generation/plugin-package/plugin-package-definition/typings.js.map +7 -0
- package/dist/code-generation/strings.js +115 -0
- package/dist/code-generation/strings.js.map +7 -0
- package/dist/code-generation/typings.js +17 -0
- package/dist/code-generation/typings.js.map +7 -0
- package/dist/command-definitions.js +85 -0
- package/dist/command-definitions.js.map +7 -0
- package/dist/command-implementations/add-command.js +262 -0
- package/dist/command-implementations/add-command.js.map +7 -0
- package/dist/command-implementations/base-command.js +69 -0
- package/dist/command-implementations/base-command.js.map +7 -0
- package/dist/command-implementations/bot-commands.js +117 -0
- package/dist/command-implementations/bot-commands.js.map +7 -0
- package/dist/command-implementations/build-command.js +53 -0
- package/dist/command-implementations/build-command.js.map +7 -0
- package/dist/command-implementations/bundle-command.js +87 -0
- package/dist/command-implementations/bundle-command.js.map +7 -0
- package/dist/command-implementations/chat-command.js +152 -0
- package/dist/command-implementations/chat-command.js.map +7 -0
- package/dist/command-implementations/deploy-command.js +503 -0
- package/dist/command-implementations/deploy-command.js.map +7 -0
- package/dist/command-implementations/dev-command.js +345 -0
- package/dist/command-implementations/dev-command.js.map +7 -0
- package/dist/command-implementations/gen-command.js +110 -0
- package/dist/command-implementations/gen-command.js.map +7 -0
- package/dist/command-implementations/global-command.js +137 -0
- package/dist/command-implementations/global-command.js.map +7 -0
- package/dist/command-implementations/index.js +105 -0
- package/dist/command-implementations/index.js.map +7 -0
- package/dist/command-implementations/init-command.js +162 -0
- package/dist/command-implementations/init-command.js.map +7 -0
- package/dist/command-implementations/integration-commands.js +130 -0
- package/dist/command-implementations/integration-commands.js.map +7 -0
- package/dist/command-implementations/interface-commands.js +110 -0
- package/dist/command-implementations/interface-commands.js.map +7 -0
- package/dist/command-implementations/lint-command.js +151 -0
- package/dist/command-implementations/lint-command.js.map +7 -0
- package/dist/command-implementations/login-command.js +82 -0
- package/dist/command-implementations/login-command.js.map +7 -0
- package/dist/command-implementations/logout-command.js +35 -0
- package/dist/command-implementations/logout-command.js.map +7 -0
- package/dist/command-implementations/plugin-commands.js +111 -0
- package/dist/command-implementations/plugin-commands.js.map +7 -0
- package/dist/command-implementations/project-command.js +383 -0
- package/dist/command-implementations/project-command.js.map +7 -0
- package/dist/command-implementations/read-command.js +70 -0
- package/dist/command-implementations/read-command.js.map +7 -0
- package/dist/command-implementations/serve-command.js +68 -0
- package/dist/command-implementations/serve-command.js.map +7 -0
- package/dist/command-tree.js +60 -0
- package/dist/command-tree.js.map +7 -0
- package/dist/config.js +352 -0
- package/dist/config.js.map +7 -0
- package/dist/consts.js +127 -0
- package/dist/consts.js.map +7 -0
- package/dist/errors.js +202 -0
- package/dist/errors.js.map +7 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +7 -0
- package/dist/init.js +50 -0
- package/dist/init.js.map +7 -0
- package/dist/linter/base-linter.js +75 -0
- package/dist/linter/base-linter.js.map +7 -0
- package/dist/linter/base-linter.test.js +187 -0
- package/dist/linter/base-linter.test.js.map +7 -0
- package/dist/linter/bot-linter.js +35 -0
- package/dist/linter/bot-linter.js.map +7 -0
- package/dist/linter/integration-linter.js +35 -0
- package/dist/linter/integration-linter.js.map +7 -0
- package/dist/linter/interface-linter.js +35 -0
- package/dist/linter/interface-linter.js.map +7 -0
- package/dist/linter/ruleset-tests/bot.ruleset.test.js +358 -0
- package/dist/linter/ruleset-tests/bot.ruleset.test.js.map +7 -0
- package/dist/linter/ruleset-tests/common.js +37 -0
- package/dist/linter/ruleset-tests/common.js.map +7 -0
- package/dist/linter/ruleset-tests/integration.ruleset.test.js +887 -0
- package/dist/linter/ruleset-tests/integration.ruleset.test.js.map +7 -0
- package/dist/linter/ruleset-tests/interface.ruleset.test.js +383 -0
- package/dist/linter/ruleset-tests/interface.ruleset.test.js.map +7 -0
- package/dist/linter/rulesets/bot.ruleset.js +191 -0
- package/dist/linter/rulesets/bot.ruleset.js.map +7 -0
- package/dist/linter/rulesets/integration.ruleset.js +378 -0
- package/dist/linter/rulesets/integration.ruleset.js.map +7 -0
- package/dist/linter/rulesets/interface.ruleset.js +157 -0
- package/dist/linter/rulesets/interface.ruleset.js.map +7 -0
- package/dist/linter/spectral-functions.js +36 -0
- package/dist/linter/spectral-functions.js.map +7 -0
- package/dist/logger/base-logger.js +170 -0
- package/dist/logger/base-logger.js.map +7 -0
- package/dist/logger/index.js +86 -0
- package/dist/logger/index.js.map +7 -0
- package/dist/package-ref.js +107 -0
- package/dist/package-ref.js.map +7 -0
- package/dist/package-ref.test.js +109 -0
- package/dist/package-ref.test.js.map +7 -0
- package/dist/register-yargs.js +91 -0
- package/dist/register-yargs.js.map +7 -0
- package/dist/root.js +41 -0
- package/dist/root.js.map +7 -0
- package/dist/sdk/index.js +22 -0
- package/dist/sdk/index.js.map +7 -0
- package/dist/sdk/resolve-bot-interfaces.js +43 -0
- package/dist/sdk/resolve-bot-interfaces.js.map +7 -0
- package/dist/sdk/resolve-integration-interfaces.js +161 -0
- package/dist/sdk/resolve-integration-interfaces.js.map +7 -0
- package/dist/sdk/validate-bot.js +88 -0
- package/dist/sdk/validate-bot.js.map +7 -0
- package/dist/sdk/validate-integration.js +72 -0
- package/dist/sdk/validate-integration.js.map +7 -0
- package/dist/typings.js +17 -0
- package/dist/typings.js.map +7 -0
- package/dist/utils/cache-utils.js +104 -0
- package/dist/utils/cache-utils.js.map +7 -0
- package/dist/utils/case-utils.js +84 -0
- package/dist/utils/case-utils.js.map +7 -0
- package/dist/utils/case-utils.test.js +75 -0
- package/dist/utils/case-utils.test.js.map +7 -0
- package/dist/utils/esbuild-utils.js +92 -0
- package/dist/utils/esbuild-utils.js.map +7 -0
- package/dist/utils/event-emitter.js +63 -0
- package/dist/utils/event-emitter.js.map +7 -0
- package/dist/utils/file-watcher.js +73 -0
- package/dist/utils/file-watcher.js.map +7 -0
- package/dist/utils/guard-utils.js +32 -0
- package/dist/utils/guard-utils.js.map +7 -0
- package/dist/utils/id-utils.js +59 -0
- package/dist/utils/id-utils.js.map +7 -0
- package/dist/utils/index.js +99 -0
- package/dist/utils/index.js.map +7 -0
- package/dist/utils/object-utils.js +32 -0
- package/dist/utils/object-utils.js.map +7 -0
- package/dist/utils/path-utils.js +106 -0
- package/dist/utils/path-utils.js.map +7 -0
- package/dist/utils/path-utils.test.js +72 -0
- package/dist/utils/path-utils.test.js.map +7 -0
- package/dist/utils/pkgjson-utils.js +57 -0
- package/dist/utils/pkgjson-utils.js.map +7 -0
- package/dist/utils/promise-utils.js +36 -0
- package/dist/utils/promise-utils.js.map +7 -0
- package/dist/utils/promise-utils.test.js +14 -0
- package/dist/utils/promise-utils.test.js.map +7 -0
- package/dist/utils/prompt-utils.js +105 -0
- package/dist/utils/prompt-utils.js.map +7 -0
- package/dist/utils/record-utils.js +118 -0
- package/dist/utils/record-utils.js.map +7 -0
- package/dist/utils/record-utils.test.js +38 -0
- package/dist/utils/record-utils.test.js.map +7 -0
- package/dist/utils/require-utils.js +90 -0
- package/dist/utils/require-utils.js.map +7 -0
- package/dist/utils/require-utils.test.js +54 -0
- package/dist/utils/require-utils.test.js.map +7 -0
- package/dist/utils/schema-utils.js +64 -0
- package/dist/utils/schema-utils.js.map +7 -0
- package/dist/utils/schema-utils.test.js +50 -0
- package/dist/utils/schema-utils.test.js.map +7 -0
- package/dist/utils/semver-utils.js +45 -0
- package/dist/utils/semver-utils.js.map +7 -0
- package/dist/utils/string-utils.js +42 -0
- package/dist/utils/string-utils.js.map +7 -0
- package/dist/utils/template-utils.js +51 -0
- package/dist/utils/template-utils.js.map +7 -0
- package/dist/utils/tunnel-utils.js +129 -0
- package/dist/utils/tunnel-utils.js.map +7 -0
- package/dist/utils/type-utils.js +17 -0
- package/dist/utils/type-utils.js.map +7 -0
- package/dist/utils/url-utils.js +67 -0
- package/dist/utils/url-utils.js.map +7 -0
- package/dist/worker/child-entrypoint.js +58 -0
- package/dist/worker/child-entrypoint.js.map +7 -0
- package/dist/worker/child-wrapper.js +119 -0
- package/dist/worker/child-wrapper.js.map +7 -0
- package/dist/worker/config.js +44 -0
- package/dist/worker/config.js.map +7 -0
- package/dist/worker/index.js +32 -0
- package/dist/worker/index.js.map +7 -0
- package/dist/worker/is-child.js +55 -0
- package/dist/worker/is-child.js.map +7 -0
- package/dist/worker/worker-state.js +71 -0
- package/dist/worker/worker-state.js.map +7 -0
- package/dist/worker/worker.js +91 -0
- package/dist/worker/worker.js.map +7 -0
- package/package.json +3 -3
- package/templates/empty-bot/.botpress/implementation/index.ts +50 -0
- package/templates/empty-bot/.botpress/implementation/plugins/index.ts +11 -0
- package/templates/empty-bot/.botpress/implementation/typings/actions/index.ts +6 -0
- package/templates/empty-bot/.botpress/implementation/typings/events/index.ts +6 -0
- package/templates/empty-bot/.botpress/implementation/typings/index.ts +20 -0
- package/templates/empty-bot/.botpress/implementation/typings/integrations/index.ts +6 -0
- package/templates/empty-bot/.botpress/implementation/typings/states/index.ts +6 -0
- package/templates/empty-bot/.botpress/index.ts +5 -0
- package/templates/empty-bot/package.json +2 -2
- package/templates/empty-integration/.botpress/implementation/index.ts +57 -0
- package/templates/empty-integration/.botpress/implementation/typings/actions/index.ts +6 -0
- package/templates/empty-integration/.botpress/implementation/typings/channels/index.ts +6 -0
- package/templates/empty-integration/.botpress/implementation/typings/configuration/index.ts +2 -0
- package/templates/empty-integration/.botpress/implementation/typings/configurations/index.ts +6 -0
- package/templates/empty-integration/.botpress/implementation/typings/entities/index.ts +6 -0
- package/templates/empty-integration/.botpress/implementation/typings/events/index.ts +6 -0
- package/templates/empty-integration/.botpress/implementation/typings/index.ts +31 -0
- package/templates/empty-integration/.botpress/implementation/typings/states/index.ts +6 -0
- package/templates/empty-integration/.botpress/index.ts +2 -0
- package/templates/empty-integration/.botpress/secrets/index.ts +6 -0
- package/templates/empty-integration/package.json +2 -2
- package/templates/empty-plugin/.botpress/implementation/index.ts +35 -0
- package/templates/empty-plugin/.botpress/implementation/typings/actions/index.ts +6 -0
- package/templates/empty-plugin/.botpress/implementation/typings/configuration/index.ts +2 -0
- package/templates/empty-plugin/.botpress/implementation/typings/events/index.ts +6 -0
- package/templates/empty-plugin/.botpress/implementation/typings/index.ts +26 -0
- package/templates/empty-plugin/.botpress/implementation/typings/integrations/index.ts +6 -0
- package/templates/empty-plugin/.botpress/implementation/typings/interfaces/index.ts +6 -0
- package/templates/empty-plugin/.botpress/implementation/typings/states/index.ts +6 -0
- package/templates/empty-plugin/.botpress/index.ts +1 -0
- package/templates/empty-plugin/package.json +1 -1
- package/templates/hello-world/.botpress/implementation/index.ts +57 -0
- package/templates/hello-world/.botpress/implementation/typings/actions/helloWorld/index.ts +12 -0
- package/templates/hello-world/.botpress/implementation/typings/actions/helloWorld/input.ts +5 -0
- package/templates/hello-world/.botpress/implementation/typings/actions/helloWorld/output.ts +5 -0
- package/templates/hello-world/.botpress/implementation/typings/actions/index.ts +9 -0
- package/templates/hello-world/.botpress/implementation/typings/channels/index.ts +6 -0
- package/templates/hello-world/.botpress/implementation/typings/configuration/index.ts +2 -0
- package/templates/hello-world/.botpress/implementation/typings/configurations/index.ts +6 -0
- package/templates/hello-world/.botpress/implementation/typings/entities/index.ts +6 -0
- package/templates/hello-world/.botpress/implementation/typings/events/index.ts +6 -0
- package/templates/hello-world/.botpress/implementation/typings/index.ts +31 -0
- package/templates/hello-world/.botpress/implementation/typings/states/index.ts +6 -0
- package/templates/hello-world/.botpress/index.ts +2 -0
- package/templates/hello-world/.botpress/secrets/index.ts +6 -0
- package/templates/hello-world/package.json +2 -2
- package/templates/webhook-message/.botpress/implementation/index.ts +57 -0
- package/templates/webhook-message/.botpress/implementation/typings/actions/index.ts +6 -0
- package/templates/webhook-message/.botpress/implementation/typings/channels/index.ts +9 -0
- package/templates/webhook-message/.botpress/implementation/typings/channels/webhook/index.ts +12 -0
- package/templates/webhook-message/.botpress/implementation/typings/channels/webhook/messages/index.ts +9 -0
- package/templates/webhook-message/.botpress/implementation/typings/channels/webhook/messages/text.ts +5 -0
- package/templates/webhook-message/.botpress/implementation/typings/configuration/index.ts +8 -0
- package/templates/webhook-message/.botpress/implementation/typings/configurations/index.ts +6 -0
- package/templates/webhook-message/.botpress/implementation/typings/entities/index.ts +6 -0
- package/templates/webhook-message/.botpress/implementation/typings/events/index.ts +6 -0
- package/templates/webhook-message/.botpress/implementation/typings/index.ts +31 -0
- package/templates/webhook-message/.botpress/implementation/typings/states/index.ts +6 -0
- package/templates/webhook-message/.botpress/index.ts +2 -0
- package/templates/webhook-message/.botpress/secrets/index.ts +6 -0
- package/templates/webhook-message/package.json +2 -2
- package/e2e/api.ts +0 -25
- package/e2e/defaults.ts +0 -20
- package/e2e/index.ts +0 -118
- package/e2e/tests/create-deploy-bot.ts +0 -51
- package/e2e/tests/create-deploy-integration.ts +0 -62
- package/e2e/tests/dev-bot.ts +0 -59
- package/e2e/tests/install-interfaces.ts +0 -49
- package/e2e/tests/install-package.ts +0 -164
- package/e2e/tests/integration-secrets.ts +0 -102
- package/e2e/tests/manage-workspace-handle.ts +0 -105
- package/e2e/typings.ts +0 -17
- package/e2e/utils.ts +0 -99
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var worker_exports = {};
|
|
20
|
+
__export(worker_exports, {
|
|
21
|
+
Config: () => import_config.Config,
|
|
22
|
+
Worker: () => import_worker.Worker
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(worker_exports);
|
|
25
|
+
var import_config = require("./config");
|
|
26
|
+
var import_worker = require("./worker");
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
Config,
|
|
30
|
+
Worker
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var is_child_exports = {};
|
|
20
|
+
__export(is_child_exports, {
|
|
21
|
+
CHILD_ENV_KEY: () => CHILD_ENV_KEY,
|
|
22
|
+
CHILD_ENV_VALUE: () => CHILD_ENV_VALUE,
|
|
23
|
+
isChildProcess: () => isChildProcess,
|
|
24
|
+
processProps: () => processProps
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(is_child_exports);
|
|
27
|
+
const CHILD_ENV_KEY = "IS_CHILD";
|
|
28
|
+
const CHILD_ENV_VALUE = "true";
|
|
29
|
+
const getProcessProps = () => {
|
|
30
|
+
const type = process.env[CHILD_ENV_KEY] === CHILD_ENV_VALUE ? "child" : "main";
|
|
31
|
+
if (type === "main") {
|
|
32
|
+
return {
|
|
33
|
+
type,
|
|
34
|
+
pid: process.pid
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
if (!process.send) {
|
|
38
|
+
throw new Error(`Please do not use variable ${CHILD_ENV_KEY} manually`);
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
type,
|
|
42
|
+
sendMessage: process.send,
|
|
43
|
+
pid: process.pid
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
const processProps = getProcessProps();
|
|
47
|
+
const isChildProcess = processProps.type === "child";
|
|
48
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
+
0 && (module.exports = {
|
|
50
|
+
CHILD_ENV_KEY,
|
|
51
|
+
CHILD_ENV_VALUE,
|
|
52
|
+
isChildProcess,
|
|
53
|
+
processProps
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=is-child.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/worker/is-child.ts"],
|
|
4
|
+
"sourcesContent": ["export const CHILD_ENV_KEY = 'IS_CHILD'\nexport const CHILD_ENV_VALUE = 'true'\n\nexport type MainProcessProps = {\n type: 'main'\n pid: number\n}\nexport type ChildProcessProps = {\n type: 'child'\n sendMessage: (message: string) => void\n pid: number\n}\n\nexport type ProcessProps = MainProcessProps | ChildProcessProps\n\nconst getProcessProps = (): ProcessProps => {\n const type = process.env[CHILD_ENV_KEY] === CHILD_ENV_VALUE ? 'child' : 'main'\n if (type === 'main') {\n return {\n type,\n pid: process.pid,\n }\n }\n\n if (!process.send) {\n throw new Error(`Please do not use variable ${CHILD_ENV_KEY} manually`)\n }\n\n return {\n type,\n sendMessage: process.send,\n pid: process.pid,\n }\n}\n\nexport const processProps = getProcessProps()\nexport const isChildProcess = processProps.type === 'child'\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,gBAAgB;AACtB,MAAM,kBAAkB;AAc/B,MAAM,kBAAkB,MAAoB;AAC1C,QAAM,OAAO,QAAQ,IAAI,aAAa,MAAM,kBAAkB,UAAU;AACxE,MAAI,SAAS,QAAQ;AACnB,WAAO;AAAA,MACL;AAAA,MACA,KAAK,QAAQ;AAAA,IACf;AAAA,EACF;AAEA,MAAI,CAAC,QAAQ,MAAM;AACjB,UAAM,IAAI,MAAM,8BAA8B,wBAAwB;AAAA,EACxE;AAEA,SAAO;AAAA,IACL;AAAA,IACA,aAAa,QAAQ;AAAA,IACrB,KAAK,QAAQ;AAAA,EACf;AACF;AAEO,MAAM,eAAe,gBAAgB;AACrC,MAAM,iBAAiB,aAAa,SAAS;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var worker_state_exports = {};
|
|
20
|
+
__export(worker_state_exports, {
|
|
21
|
+
WorkerStateObserver: () => WorkerStateObserver
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(worker_state_exports);
|
|
24
|
+
class WorkerStateObserver {
|
|
25
|
+
_state;
|
|
26
|
+
_handlers = {
|
|
27
|
+
dead: [],
|
|
28
|
+
reloading: [],
|
|
29
|
+
live: [],
|
|
30
|
+
killing: [],
|
|
31
|
+
errored: []
|
|
32
|
+
};
|
|
33
|
+
constructor(initialState) {
|
|
34
|
+
this._state = initialState;
|
|
35
|
+
}
|
|
36
|
+
waitFor(status) {
|
|
37
|
+
return new Promise((resolve) => {
|
|
38
|
+
const cb = () => {
|
|
39
|
+
this.off(status, cb);
|
|
40
|
+
resolve();
|
|
41
|
+
};
|
|
42
|
+
this.on(status, cb);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
on(status, handler) {
|
|
46
|
+
this._handlers[status].push(handler);
|
|
47
|
+
if (this._state.status === status) {
|
|
48
|
+
handler(this._state);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
off(status, handler) {
|
|
52
|
+
const index = this._handlers[status].indexOf(handler);
|
|
53
|
+
this._handlers[status].splice(index, 1);
|
|
54
|
+
}
|
|
55
|
+
get() {
|
|
56
|
+
return this._state;
|
|
57
|
+
}
|
|
58
|
+
set(newState) {
|
|
59
|
+
this._state = newState;
|
|
60
|
+
const { status } = newState;
|
|
61
|
+
for (const handler of this._handlers[status]) {
|
|
62
|
+
const fn = handler;
|
|
63
|
+
fn(newState);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
68
|
+
0 && (module.exports = {
|
|
69
|
+
WorkerStateObserver
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=worker-state.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/worker/worker-state.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ChildProcessWrapper } from './child-wrapper'\n\nexport type WorkerStatus = WorkerState['status']\nexport type WorkerState =\n | { status: 'errored'; thrown: unknown } // only occurs if the event error is emitted https://nodejs.org/api/child_process.html#event-error\n | { status: 'dead'; murdered: boolean }\n | { status: 'killing' }\n | { status: 'reloading' }\n | {\n status: 'live'\n child: ChildProcessWrapper\n }\n\nexport type StateOf<S extends WorkerStatus> = Extract<WorkerState, { status: S }>\nexport type WorkerStateHandler<S extends WorkerStatus> = (state: StateOf<S>) => void\n\nexport class WorkerStateObserver {\n private _state: WorkerState\n private _handlers: {\n [K in WorkerStatus]: WorkerStateHandler<K>[]\n } = {\n dead: [],\n reloading: [],\n live: [],\n killing: [],\n errored: [],\n }\n\n public constructor(initialState: WorkerState) {\n this._state = initialState\n }\n\n public waitFor<S extends WorkerStatus>(status: S): Promise<void> {\n return new Promise<void>((resolve) => {\n const cb = () => {\n this.off(status, cb)\n resolve()\n }\n this.on(status, cb)\n })\n }\n\n public on<S extends WorkerStatus>(status: S, handler: WorkerStateHandler<S>) {\n this._handlers[status].push(handler)\n if (this._state.status === status) {\n handler(this._state as StateOf<S>)\n }\n }\n\n public off<S extends WorkerStatus>(status: S, handler: WorkerStateHandler<S>) {\n const index = this._handlers[status].indexOf(handler)\n this._handlers[status].splice(index, 1)\n }\n\n public get() {\n return this._state\n }\n\n public set(newState: WorkerState) {\n this._state = newState\n const { status } = newState\n for (const handler of this._handlers[status]) {\n const fn = handler as WorkerStateHandler<typeof status>\n fn(newState)\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBO,MAAM,oBAAoB;AAAA,EACvB;AAAA,EACA,YAEJ;AAAA,IACF,MAAM,CAAC;AAAA,IACP,WAAW,CAAC;AAAA,IACZ,MAAM,CAAC;AAAA,IACP,SAAS,CAAC;AAAA,IACV,SAAS,CAAC;AAAA,EACZ;AAAA,EAEO,YAAY,cAA2B;AAC5C,SAAK,SAAS;AAAA,EAChB;AAAA,EAEO,QAAgC,QAA0B;AAC/D,WAAO,IAAI,QAAc,CAAC,YAAY;AACpC,YAAM,KAAK,MAAM;AACf,aAAK,IAAI,QAAQ,EAAE;AACnB,gBAAQ;AAAA,MACV;AACA,WAAK,GAAG,QAAQ,EAAE;AAAA,IACpB,CAAC;AAAA,EACH;AAAA,EAEO,GAA2B,QAAW,SAAgC;AAC3E,SAAK,UAAU,MAAM,EAAE,KAAK,OAAO;AACnC,QAAI,KAAK,OAAO,WAAW,QAAQ;AACjC,cAAQ,KAAK,MAAoB;AAAA,IACnC;AAAA,EACF;AAAA,EAEO,IAA4B,QAAW,SAAgC;AAC5E,UAAM,QAAQ,KAAK,UAAU,MAAM,EAAE,QAAQ,OAAO;AACpD,SAAK,UAAU,MAAM,EAAE,OAAO,OAAO,CAAC;AAAA,EACxC;AAAA,EAEO,MAAM;AACX,WAAO,KAAK;AAAA,EACd;AAAA,EAEO,IAAI,UAAuB;AAChC,SAAK,SAAS;AACd,UAAM,EAAE,OAAO,IAAI;AACnB,eAAW,WAAW,KAAK,UAAU,MAAM,GAAG;AAC5C,YAAM,KAAK;AACX,SAAG,QAAQ;AAAA,IACb;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var worker_exports = {};
|
|
20
|
+
__export(worker_exports, {
|
|
21
|
+
Worker: () => Worker
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(worker_exports);
|
|
24
|
+
var import_child_wrapper = require("./child-wrapper");
|
|
25
|
+
var import_worker_state = require("./worker-state");
|
|
26
|
+
class Worker {
|
|
27
|
+
constructor(_config, _logger, _props = {}) {
|
|
28
|
+
this._config = _config;
|
|
29
|
+
this._logger = _logger;
|
|
30
|
+
this._props = _props;
|
|
31
|
+
}
|
|
32
|
+
static async spawn(config, logger, props) {
|
|
33
|
+
const instance = new Worker(config, logger, props);
|
|
34
|
+
await instance.reload();
|
|
35
|
+
return instance;
|
|
36
|
+
}
|
|
37
|
+
_state = new import_worker_state.WorkerStateObserver({ status: "dead", murdered: false });
|
|
38
|
+
/**
|
|
39
|
+
* Used to determine if the worker can be killed
|
|
40
|
+
*/
|
|
41
|
+
get running() {
|
|
42
|
+
return this._state.get().status === "live";
|
|
43
|
+
}
|
|
44
|
+
kill = () => {
|
|
45
|
+
const state = this._state.get();
|
|
46
|
+
if (state.status !== "live") {
|
|
47
|
+
throw new Error("Cannot kill a child process that is not alive");
|
|
48
|
+
}
|
|
49
|
+
this._state.set({ status: "killing" });
|
|
50
|
+
return state.child.kill();
|
|
51
|
+
};
|
|
52
|
+
reload = async () => {
|
|
53
|
+
if (this._state.get().status === "reloading") {
|
|
54
|
+
this._logger.debug("Already reloading");
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const previousState = this._state.get();
|
|
58
|
+
this._state.set({ status: "reloading" });
|
|
59
|
+
if (previousState.status === "live") {
|
|
60
|
+
await previousState.child.kill();
|
|
61
|
+
}
|
|
62
|
+
const child = await import_child_wrapper.ChildProcessWrapper.spawn(this._config, this._logger);
|
|
63
|
+
this._state.set({ status: "live", child });
|
|
64
|
+
void child.listen().catch((thrown) => {
|
|
65
|
+
this._state.set({ status: "errored", thrown });
|
|
66
|
+
}).then(() => {
|
|
67
|
+
const { status } = this._state.get();
|
|
68
|
+
if (status === "reloading") {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
this._state.set({ status: "dead", murdered: status === "killing" });
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
wait = () => new Promise((resolve, reject) => {
|
|
75
|
+
this._state.on("dead", (state) => {
|
|
76
|
+
if (state.murdered || !this._props.hangOnExit) {
|
|
77
|
+
resolve();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
this._logger.debug("Child process died of natural causes...");
|
|
81
|
+
});
|
|
82
|
+
this._state.on("errored", (state) => {
|
|
83
|
+
reject(state.thrown);
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
88
|
+
0 && (module.exports = {
|
|
89
|
+
Worker
|
|
90
|
+
});
|
|
91
|
+
//# sourceMappingURL=worker.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/worker/worker.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Logger } from '../logger'\nimport { ChildProcessWrapper } from './child-wrapper'\nimport type { Config } from './config'\nimport { WorkerStateObserver } from './worker-state'\n\nexport type WorkerProps = {\n hangOnExit?: boolean\n}\n\nexport class Worker {\n public static async spawn(config: Config, logger: Logger, props?: Partial<WorkerProps>): Promise<Worker> {\n const instance = new Worker(config, logger, props)\n await instance.reload()\n return instance\n }\n\n private _state = new WorkerStateObserver({ status: 'dead', murdered: false })\n\n private constructor(private _config: Config, private _logger: Logger, private _props: Partial<WorkerProps> = {}) {}\n\n /**\n * Used to determine if the worker can be killed\n */\n public get running() {\n return this._state.get().status === 'live'\n }\n\n public kill = () => {\n const state = this._state.get()\n if (state.status !== 'live') {\n throw new Error('Cannot kill a child process that is not alive')\n }\n\n this._state.set({ status: 'killing' })\n return state.child.kill()\n }\n\n public reload = async () => {\n if (this._state.get().status === 'reloading') {\n this._logger.debug('Already reloading')\n return\n }\n\n const previousState = this._state.get()\n this._state.set({ status: 'reloading' })\n\n if (previousState.status === 'live') {\n await previousState.child.kill()\n }\n\n const child = await ChildProcessWrapper.spawn(this._config, this._logger)\n this._state.set({ status: 'live', child })\n\n void child\n .listen()\n .catch((thrown) => {\n this._state.set({ status: 'errored', thrown })\n })\n .then(() => {\n const { status } = this._state.get()\n if (status === 'reloading') {\n return\n }\n this._state.set({ status: 'dead', murdered: status === 'killing' })\n })\n }\n\n public wait = () =>\n new Promise<void>((resolve, reject) => {\n this._state.on('dead', (state) => {\n if (state.murdered || !this._props.hangOnExit) {\n resolve()\n return\n }\n\n this._logger.debug('Child process died of natural causes...')\n })\n\n this._state.on('errored', (state) => {\n reject(state.thrown)\n })\n })\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,2BAAoC;AAEpC,0BAAoC;AAM7B,MAAM,OAAO;AAAA,EASV,YAAoB,SAAyB,SAAyB,SAA+B,CAAC,GAAG;AAArF;AAAyB;AAAyB;AAAA,EAAoC;AAAA,EARlH,aAAoB,MAAM,QAAgB,QAAgB,OAA+C;AACvG,UAAM,WAAW,IAAI,OAAO,QAAQ,QAAQ,KAAK;AACjD,UAAM,SAAS,OAAO;AACtB,WAAO;AAAA,EACT;AAAA,EAEQ,SAAS,IAAI,wCAAoB,EAAE,QAAQ,QAAQ,UAAU,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA,EAO5E,IAAW,UAAU;AACnB,WAAO,KAAK,OAAO,IAAI,EAAE,WAAW;AAAA,EACtC;AAAA,EAEO,OAAO,MAAM;AAClB,UAAM,QAAQ,KAAK,OAAO,IAAI;AAC9B,QAAI,MAAM,WAAW,QAAQ;AAC3B,YAAM,IAAI,MAAM,+CAA+C;AAAA,IACjE;AAEA,SAAK,OAAO,IAAI,EAAE,QAAQ,UAAU,CAAC;AACrC,WAAO,MAAM,MAAM,KAAK;AAAA,EAC1B;AAAA,EAEO,SAAS,YAAY;AAC1B,QAAI,KAAK,OAAO,IAAI,EAAE,WAAW,aAAa;AAC5C,WAAK,QAAQ,MAAM,mBAAmB;AACtC;AAAA,IACF;AAEA,UAAM,gBAAgB,KAAK,OAAO,IAAI;AACtC,SAAK,OAAO,IAAI,EAAE,QAAQ,YAAY,CAAC;AAEvC,QAAI,cAAc,WAAW,QAAQ;AACnC,YAAM,cAAc,MAAM,KAAK;AAAA,IACjC;AAEA,UAAM,QAAQ,MAAM,yCAAoB,MAAM,KAAK,SAAS,KAAK,OAAO;AACxE,SAAK,OAAO,IAAI,EAAE,QAAQ,QAAQ,MAAM,CAAC;AAEzC,SAAK,MACF,OAAO,EACP,MAAM,CAAC,WAAW;AACjB,WAAK,OAAO,IAAI,EAAE,QAAQ,WAAW,OAAO,CAAC;AAAA,IAC/C,CAAC,EACA,KAAK,MAAM;AACV,YAAM,EAAE,OAAO,IAAI,KAAK,OAAO,IAAI;AACnC,UAAI,WAAW,aAAa;AAC1B;AAAA,MACF;AACA,WAAK,OAAO,IAAI,EAAE,QAAQ,QAAQ,UAAU,WAAW,UAAU,CAAC;AAAA,IACpE,CAAC;AAAA,EACL;AAAA,EAEO,OAAO,MACZ,IAAI,QAAc,CAAC,SAAS,WAAW;AACrC,SAAK,OAAO,GAAG,QAAQ,CAAC,UAAU;AAChC,UAAI,MAAM,YAAY,CAAC,KAAK,OAAO,YAAY;AAC7C,gBAAQ;AACR;AAAA,MACF;AAEA,WAAK,QAAQ,MAAM,yCAAyC;AAAA,IAC9D,CAAC;AAED,SAAK,OAAO,GAAG,WAAW,CAAC,UAAU;AACnC,aAAO,MAAM,MAAM;AAAA,IACrB,CAAC;AAAA,EACH,CAAC;AACL;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botpress/cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "Botpress CLI",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "pnpm run bundle && pnpm run template:gen",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@apidevtools/json-schema-ref-parser": "^11.7.0",
|
|
24
24
|
"@botpress/chat": "0.4.4",
|
|
25
|
-
"@botpress/client": "0.
|
|
26
|
-
"@botpress/sdk": "2.0.
|
|
25
|
+
"@botpress/client": "0.38.0",
|
|
26
|
+
"@botpress/sdk": "2.0.4",
|
|
27
27
|
"@bpinternal/const": "^0.0.20",
|
|
28
28
|
"@bpinternal/tunnel": "^0.1.1",
|
|
29
29
|
"@bpinternal/yargs-extra": "^0.0.3",
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
// This file is generated. Do not edit it manually.
|
|
4
|
+
|
|
5
|
+
import * as sdk from "@botpress/sdk"
|
|
6
|
+
import * as typings from "./typings/index"
|
|
7
|
+
import * as plugins from "./plugins/index"
|
|
8
|
+
|
|
9
|
+
export * from "./typings/index"
|
|
10
|
+
export * from "./plugins/index"
|
|
11
|
+
|
|
12
|
+
type TPlugins = plugins.TPlugins
|
|
13
|
+
type TBot = sdk.DefaultBot<typings.TBot>
|
|
14
|
+
|
|
15
|
+
export type BotProps = {
|
|
16
|
+
actions: sdk.BotProps<TBot, TPlugins>["actions"]
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class Bot extends sdk.Bot<TBot, TPlugins> {
|
|
20
|
+
public constructor(props: BotProps) {
|
|
21
|
+
super({
|
|
22
|
+
actions: props.actions,
|
|
23
|
+
plugins: plugins.plugins
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// extra types
|
|
29
|
+
|
|
30
|
+
type AsyncFunction = (...args: any[]) => Promise<any>
|
|
31
|
+
export type EventHandlers = Required<{
|
|
32
|
+
[K in keyof Bot['eventHandlers']]: NonNullable<Bot['eventHandlers'][K]>[number]
|
|
33
|
+
}>
|
|
34
|
+
export type MessageHandlers = Required<{
|
|
35
|
+
[K in keyof Bot['messageHandlers']]: NonNullable<Bot['messageHandlers'][K]>[number]
|
|
36
|
+
}>
|
|
37
|
+
|
|
38
|
+
export type MessageHandlerProps = Parameters<MessageHandlers['*']>[0]
|
|
39
|
+
export type EventHandlerProps = Parameters<EventHandlers['*']>[0]
|
|
40
|
+
|
|
41
|
+
export type Client = (MessageHandlerProps | EventHandlerProps)['client']
|
|
42
|
+
export type ClientOperation = keyof {
|
|
43
|
+
[K in keyof Client as Client[K] extends AsyncFunction ? K : never]: null
|
|
44
|
+
}
|
|
45
|
+
export type ClientInputs = {
|
|
46
|
+
[K in ClientOperation]: Parameters<Client[K]>[0]
|
|
47
|
+
}
|
|
48
|
+
export type ClientOutputs = {
|
|
49
|
+
[K in ClientOperation]: Awaited<ReturnType<Client[K]>>
|
|
50
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
// This file is generated. Do not edit it manually.
|
|
4
|
+
|
|
5
|
+
import * as integrations from './integrations/index'
|
|
6
|
+
import * as events from './events'
|
|
7
|
+
import * as states from './states'
|
|
8
|
+
import * as actions from './actions'
|
|
9
|
+
|
|
10
|
+
export * as integrations from './integrations/index'
|
|
11
|
+
export * as events from './events/index'
|
|
12
|
+
export * as states from './states/index'
|
|
13
|
+
export * as actions from './actions'
|
|
14
|
+
|
|
15
|
+
export type TBot = {
|
|
16
|
+
integrations: integrations.Integrations
|
|
17
|
+
events: events.Events
|
|
18
|
+
states: states.States
|
|
19
|
+
actions: actions.Actions
|
|
20
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
// This file is generated. Do not edit it manually.
|
|
4
|
+
|
|
5
|
+
import * as sdk from "@botpress/sdk"
|
|
6
|
+
import * as typings from "./typings/index"
|
|
7
|
+
export * from "./typings/index"
|
|
8
|
+
|
|
9
|
+
type TIntegration = sdk.DefaultIntegration<typings.TIntegration>
|
|
10
|
+
|
|
11
|
+
export type IntegrationProps = sdk.IntegrationProps<TIntegration>
|
|
12
|
+
|
|
13
|
+
export class Integration extends sdk.Integration<TIntegration> {}
|
|
14
|
+
|
|
15
|
+
export type Client = sdk.IntegrationSpecificClient<TIntegration>
|
|
16
|
+
|
|
17
|
+
// extra types
|
|
18
|
+
|
|
19
|
+
type Cast<X, Y> = X extends Y ? X : Y
|
|
20
|
+
type ValueOf<T> = T[keyof T]
|
|
21
|
+
type AsyncFunction = (...args: any[]) => Promise<any>
|
|
22
|
+
|
|
23
|
+
export type HandlerProps = Parameters<IntegrationProps['handler']>[0]
|
|
24
|
+
|
|
25
|
+
export type ActionProps = {
|
|
26
|
+
[K in keyof IntegrationProps['actions']]: Parameters<IntegrationProps['actions'][K]>[0]
|
|
27
|
+
}
|
|
28
|
+
export type AnyActionProps = ValueOf<ActionProps>
|
|
29
|
+
|
|
30
|
+
export type MessageProps = {
|
|
31
|
+
[TChannel in keyof IntegrationProps['channels']]: {
|
|
32
|
+
[TMessage in keyof IntegrationProps['channels'][TChannel]['messages']]: Parameters<
|
|
33
|
+
IntegrationProps['channels'][TChannel]['messages'][TMessage]
|
|
34
|
+
>[0]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export type AnyMessageProps = ValueOf<ValueOf<MessageProps>>
|
|
38
|
+
|
|
39
|
+
export type Context = HandlerProps['ctx']
|
|
40
|
+
export type Logger = HandlerProps['logger']
|
|
41
|
+
|
|
42
|
+
export type AckFunctions = {
|
|
43
|
+
[TChannel in keyof MessageProps]: {
|
|
44
|
+
[TMessage in keyof MessageProps[TChannel]]: Cast<MessageProps[TChannel][TMessage], AnyMessageProps>['ack']
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export type AnyAckFunction = ValueOf<ValueOf<AckFunctions>>
|
|
48
|
+
|
|
49
|
+
export type ClientOperation = ValueOf<{
|
|
50
|
+
[K in keyof Client as Client[K] extends AsyncFunction ? K : never]: K
|
|
51
|
+
}>
|
|
52
|
+
export type ClientRequests = {
|
|
53
|
+
[K in ClientOperation]: Parameters<Client[K]>[0]
|
|
54
|
+
}
|
|
55
|
+
export type ClientResponses = {
|
|
56
|
+
[K in ClientOperation]: Awaited<ReturnType<Client[K]>>
|
|
57
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
// This file is generated. Do not edit it manually.
|
|
4
|
+
|
|
5
|
+
import * as configuration from "./configuration/index"
|
|
6
|
+
import * as configurations from "./configurations/index"
|
|
7
|
+
import * as actions from "./actions/index"
|
|
8
|
+
import * as channels from "./channels/index"
|
|
9
|
+
import * as events from "./events/index"
|
|
10
|
+
import * as states from "./states/index"
|
|
11
|
+
import * as entities from "./entities/index"
|
|
12
|
+
export * as configuration from "./configuration/index"
|
|
13
|
+
export * as configurations from "./configurations/index"
|
|
14
|
+
export * as actions from "./actions/index"
|
|
15
|
+
export * as channels from "./channels/index"
|
|
16
|
+
export * as events from "./events/index"
|
|
17
|
+
export * as states from "./states/index"
|
|
18
|
+
export * as entities from "./entities/index"
|
|
19
|
+
|
|
20
|
+
export type TIntegration = {
|
|
21
|
+
name: "empty-integration"
|
|
22
|
+
version: "0.0.1"
|
|
23
|
+
user: { "tags": {}, "creation": { "enabled": false, "requiredTags": [] } }
|
|
24
|
+
configuration: configuration.Configuration
|
|
25
|
+
configurations: configurations.Configurations
|
|
26
|
+
actions: actions.Actions
|
|
27
|
+
channels: channels.Channels
|
|
28
|
+
events: events.Events
|
|
29
|
+
states: states.States
|
|
30
|
+
entities: entities.Entities
|
|
31
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
// This file is generated. Do not edit it manually.
|
|
4
|
+
|
|
5
|
+
import * as sdk from "@botpress/sdk"
|
|
6
|
+
import * as typings from "./typings/index"
|
|
7
|
+
export * from "./typings/index"
|
|
8
|
+
|
|
9
|
+
type TPlugin = sdk.DefaultPlugin<typings.TPlugin>
|
|
10
|
+
|
|
11
|
+
export class Plugin extends sdk.Plugin<TPlugin> {}
|
|
12
|
+
|
|
13
|
+
// extra types
|
|
14
|
+
|
|
15
|
+
type AsyncFunction = (...args: any[]) => Promise<any>
|
|
16
|
+
export type EventHandlers = Required<{
|
|
17
|
+
[K in keyof Plugin['eventHandlers']]: NonNullable<Plugin['eventHandlers'][K]>[number]
|
|
18
|
+
}>
|
|
19
|
+
export type MessageHandlers = Required<{
|
|
20
|
+
[K in keyof Plugin['messageHandlers']]: NonNullable<Plugin['messageHandlers'][K]>[number]
|
|
21
|
+
}>
|
|
22
|
+
|
|
23
|
+
export type MessageHandlerProps = Parameters<MessageHandlers['*']>[0]
|
|
24
|
+
export type EventHandlerProps = Parameters<EventHandlers['*']>[0]
|
|
25
|
+
|
|
26
|
+
export type Client = (MessageHandlerProps | EventHandlerProps)['client']
|
|
27
|
+
export type ClientOperation = keyof {
|
|
28
|
+
[K in keyof Client as Client[K] extends AsyncFunction ? K : never]: null
|
|
29
|
+
}
|
|
30
|
+
export type ClientInputs = {
|
|
31
|
+
[K in ClientOperation]: Parameters<Client[K]>[0]
|
|
32
|
+
}
|
|
33
|
+
export type ClientOutputs = {
|
|
34
|
+
[K in ClientOperation]: Awaited<ReturnType<Client[K]>>
|
|
35
|
+
}
|