@botpress/cli 2.0.2 → 2.0.4
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/e2e/tests/install-interfaces.ts +1 -0
- package/e2e/tests/install-package.ts +1 -0
- package/package.json +3 -3
- package/templates/empty-bot/package.json +2 -2
- package/templates/empty-integration/package.json +2 -2
- package/templates/empty-plugin/package.json +1 -1
- package/templates/hello-world/package.json +2 -2
- package/templates/webhook-message/package.json +2 -2
- package/.turbo/turbo-build.log +0 -22
- package/dist/api/bot-body.js +0 -89
- package/dist/api/bot-body.js.map +0 -7
- package/dist/api/client.js +0 -162
- package/dist/api/client.js.map +0 -7
- package/dist/api/find-previous-version.js +0 -66
- package/dist/api/find-previous-version.js.map +0 -7
- package/dist/api/find-previous-version.test.js +0 -76
- package/dist/api/find-previous-version.test.js.map +0 -7
- package/dist/api/index.js +0 -23
- package/dist/api/index.js.map +0 -7
- package/dist/api/integration-body.js +0 -146
- package/dist/api/integration-body.js.map +0 -7
- package/dist/api/interface-body.js +0 -95
- package/dist/api/interface-body.js.map +0 -7
- package/dist/api/paging.js +0 -42
- package/dist/api/paging.js.map +0 -7
- package/dist/api/plugin-body.js +0 -84
- package/dist/api/plugin-body.js.map +0 -7
- package/dist/api/types.js +0 -17
- package/dist/api/types.js.map +0 -7
- package/dist/code-generation/bot-implementation/bot-implementation.js +0 -116
- package/dist/code-generation/bot-implementation/bot-implementation.js.map +0 -7
- package/dist/code-generation/bot-implementation/bot-plugins/index.js +0 -80
- package/dist/code-generation/bot-implementation/bot-plugins/index.js.map +0 -7
- package/dist/code-generation/bot-implementation/bot-plugins/plugin-module.js +0 -129
- package/dist/code-generation/bot-implementation/bot-plugins/plugin-module.js.map +0 -7
- package/dist/code-generation/bot-implementation/bot-typings/actions-module.js +0 -88
- package/dist/code-generation/bot-implementation/bot-typings/actions-module.js.map +0 -7
- package/dist/code-generation/bot-implementation/bot-typings/events-module.js +0 -63
- package/dist/code-generation/bot-implementation/bot-typings/events-module.js.map +0 -7
- package/dist/code-generation/bot-implementation/bot-typings/index.js +0 -109
- package/dist/code-generation/bot-implementation/bot-typings/index.js.map +0 -7
- package/dist/code-generation/bot-implementation/bot-typings/states-module.js +0 -64
- package/dist/code-generation/bot-implementation/bot-typings/states-module.js.map +0 -7
- package/dist/code-generation/bot-implementation/index.js +0 -66
- package/dist/code-generation/bot-implementation/index.js.map +0 -7
- package/dist/code-generation/consts.js +0 -45
- package/dist/code-generation/consts.js.map +0 -7
- package/dist/code-generation/generators.js +0 -81
- package/dist/code-generation/generators.js.map +0 -7
- package/dist/code-generation/index.js +0 -49
- package/dist/code-generation/index.js.map +0 -7
- package/dist/code-generation/integration-implementation/index.js +0 -70
- package/dist/code-generation/integration-implementation/index.js.map +0 -7
- package/dist/code-generation/integration-implementation/integration-implementation.js +0 -114
- package/dist/code-generation/integration-implementation/integration-implementation.js.map +0 -7
- package/dist/code-generation/integration-implementation/integration-secret.js +0 -78
- package/dist/code-generation/integration-implementation/integration-secret.js.map +0 -7
- package/dist/code-generation/integration-implementation/integration-typings/actions-module.js +0 -88
- package/dist/code-generation/integration-implementation/integration-typings/actions-module.js.map +0 -7
- package/dist/code-generation/integration-implementation/integration-typings/channels-module.js +0 -107
- package/dist/code-generation/integration-implementation/integration-typings/channels-module.js.map +0 -7
- package/dist/code-generation/integration-implementation/integration-typings/configuration-module.js +0 -62
- package/dist/code-generation/integration-implementation/integration-typings/configuration-module.js.map +0 -7
- package/dist/code-generation/integration-implementation/integration-typings/configurations-module.js +0 -70
- package/dist/code-generation/integration-implementation/integration-typings/configurations-module.js.map +0 -7
- package/dist/code-generation/integration-implementation/integration-typings/entities-module.js +0 -63
- package/dist/code-generation/integration-implementation/integration-typings/entities-module.js.map +0 -7
- package/dist/code-generation/integration-implementation/integration-typings/events-module.js +0 -63
- package/dist/code-generation/integration-implementation/integration-typings/events-module.js.map +0 -7
- package/dist/code-generation/integration-implementation/integration-typings/index.js +0 -128
- package/dist/code-generation/integration-implementation/integration-typings/index.js.map +0 -7
- package/dist/code-generation/integration-implementation/integration-typings/states-module.js +0 -64
- package/dist/code-generation/integration-implementation/integration-typings/states-module.js.map +0 -7
- package/dist/code-generation/integration-package/index.js +0 -94
- package/dist/code-generation/integration-package/index.js.map +0 -7
- package/dist/code-generation/integration-package/integration-package-definition/actions-module.js +0 -88
- package/dist/code-generation/integration-package/integration-package-definition/actions-module.js.map +0 -7
- package/dist/code-generation/integration-package/integration-package-definition/channels-module.js +0 -107
- package/dist/code-generation/integration-package/integration-package-definition/channels-module.js.map +0 -7
- package/dist/code-generation/integration-package/integration-package-definition/configuration-module.js +0 -63
- package/dist/code-generation/integration-package/integration-package-definition/configuration-module.js.map +0 -7
- package/dist/code-generation/integration-package/integration-package-definition/configurations-module.js +0 -70
- package/dist/code-generation/integration-package/integration-package-definition/configurations-module.js.map +0 -7
- package/dist/code-generation/integration-package/integration-package-definition/entities-module.js +0 -63
- package/dist/code-generation/integration-package/integration-package-definition/entities-module.js.map +0 -7
- package/dist/code-generation/integration-package/integration-package-definition/events-module.js +0 -66
- package/dist/code-generation/integration-package/integration-package-definition/events-module.js.map +0 -7
- package/dist/code-generation/integration-package/integration-package-definition/index.js +0 -140
- package/dist/code-generation/integration-package/integration-package-definition/index.js.map +0 -7
- package/dist/code-generation/integration-package/integration-package-definition/states-module.js +0 -66
- package/dist/code-generation/integration-package/integration-package-definition/states-module.js.map +0 -7
- package/dist/code-generation/integration-package/integration-package-definition/typings.js +0 -17
- package/dist/code-generation/integration-package/integration-package-definition/typings.js.map +0 -7
- package/dist/code-generation/interface-implementation/index.js +0 -29
- package/dist/code-generation/interface-implementation/index.js.map +0 -7
- package/dist/code-generation/interface-implementation/integration-typings/actions-module.js +0 -88
- package/dist/code-generation/interface-implementation/integration-typings/actions-module.js.map +0 -7
- package/dist/code-generation/interface-implementation/integration-typings/channels-module.js +0 -107
- package/dist/code-generation/interface-implementation/integration-typings/channels-module.js.map +0 -7
- package/dist/code-generation/interface-implementation/integration-typings/entities-module.js +0 -63
- package/dist/code-generation/interface-implementation/integration-typings/entities-module.js.map +0 -7
- package/dist/code-generation/interface-implementation/integration-typings/events-module.js +0 -63
- package/dist/code-generation/interface-implementation/integration-typings/events-module.js.map +0 -7
- package/dist/code-generation/interface-implementation/integration-typings/index.js +0 -121
- package/dist/code-generation/interface-implementation/integration-typings/index.js.map +0 -7
- package/dist/code-generation/interface-package/index.js +0 -94
- package/dist/code-generation/interface-package/index.js.map +0 -7
- package/dist/code-generation/interface-package/interface-package-definition/actions-module.js +0 -88
- package/dist/code-generation/interface-package/interface-package-definition/actions-module.js.map +0 -7
- package/dist/code-generation/interface-package/interface-package-definition/channels-module.js +0 -98
- package/dist/code-generation/interface-package/interface-package-definition/channels-module.js.map +0 -7
- package/dist/code-generation/interface-package/interface-package-definition/entities-module.js +0 -63
- package/dist/code-generation/interface-package/interface-package-definition/entities-module.js.map +0 -7
- package/dist/code-generation/interface-package/interface-package-definition/events-module.js +0 -66
- package/dist/code-generation/interface-package/interface-package-definition/events-module.js.map +0 -7
- package/dist/code-generation/interface-package/interface-package-definition/index.js +0 -104
- package/dist/code-generation/interface-package/interface-package-definition/index.js.map +0 -7
- package/dist/code-generation/interface-package/interface-package-definition/typings.js +0 -17
- package/dist/code-generation/interface-package/interface-package-definition/typings.js.map +0 -7
- package/dist/code-generation/module.js +0 -183
- package/dist/code-generation/module.js.map +0 -7
- package/dist/code-generation/plugin-implementation/index.js +0 -60
- package/dist/code-generation/plugin-implementation/index.js.map +0 -7
- package/dist/code-generation/plugin-implementation/plugin-implementation.js +0 -90
- package/dist/code-generation/plugin-implementation/plugin-implementation.js.map +0 -7
- package/dist/code-generation/plugin-implementation/plugin-typings/actions-module.js +0 -88
- package/dist/code-generation/plugin-implementation/plugin-typings/actions-module.js.map +0 -7
- package/dist/code-generation/plugin-implementation/plugin-typings/configuration-module.js +0 -61
- package/dist/code-generation/plugin-implementation/plugin-typings/configuration-module.js.map +0 -7
- package/dist/code-generation/plugin-implementation/plugin-typings/events-module.js +0 -63
- package/dist/code-generation/plugin-implementation/plugin-typings/events-module.js.map +0 -7
- package/dist/code-generation/plugin-implementation/plugin-typings/index.js +0 -150
- package/dist/code-generation/plugin-implementation/plugin-typings/index.js.map +0 -7
- package/dist/code-generation/plugin-implementation/plugin-typings/states-module.js +0 -64
- package/dist/code-generation/plugin-implementation/plugin-typings/states-module.js.map +0 -7
- package/dist/code-generation/plugin-package/index.js +0 -151
- package/dist/code-generation/plugin-package/index.js.map +0 -7
- package/dist/code-generation/plugin-package/plugin-package-definition/actions-module.js +0 -88
- package/dist/code-generation/plugin-package/plugin-package-definition/actions-module.js.map +0 -7
- package/dist/code-generation/plugin-package/plugin-package-definition/configuration-module.js +0 -56
- package/dist/code-generation/plugin-package/plugin-package-definition/configuration-module.js.map +0 -7
- package/dist/code-generation/plugin-package/plugin-package-definition/events-module.js +0 -66
- package/dist/code-generation/plugin-package/plugin-package-definition/events-module.js.map +0 -7
- package/dist/code-generation/plugin-package/plugin-package-definition/index.js +0 -107
- package/dist/code-generation/plugin-package/plugin-package-definition/index.js.map +0 -7
- package/dist/code-generation/plugin-package/plugin-package-definition/states-module.js +0 -66
- package/dist/code-generation/plugin-package/plugin-package-definition/states-module.js.map +0 -7
- package/dist/code-generation/plugin-package/plugin-package-definition/typings.js +0 -17
- package/dist/code-generation/plugin-package/plugin-package-definition/typings.js.map +0 -7
- package/dist/code-generation/strings.js +0 -115
- package/dist/code-generation/strings.js.map +0 -7
- package/dist/code-generation/typings.js +0 -17
- package/dist/code-generation/typings.js.map +0 -7
- package/dist/command-definitions.js +0 -84
- package/dist/command-definitions.js.map +0 -7
- package/dist/command-implementations/add-command.js +0 -249
- package/dist/command-implementations/add-command.js.map +0 -7
- package/dist/command-implementations/base-command.js +0 -69
- package/dist/command-implementations/base-command.js.map +0 -7
- package/dist/command-implementations/bot-commands.js +0 -117
- package/dist/command-implementations/bot-commands.js.map +0 -7
- package/dist/command-implementations/build-command.js +0 -53
- package/dist/command-implementations/build-command.js.map +0 -7
- package/dist/command-implementations/bundle-command.js +0 -87
- package/dist/command-implementations/bundle-command.js.map +0 -7
- package/dist/command-implementations/deploy-command.js +0 -481
- package/dist/command-implementations/deploy-command.js.map +0 -7
- package/dist/command-implementations/dev-command.js +0 -345
- package/dist/command-implementations/dev-command.js.map +0 -7
- package/dist/command-implementations/gen-command.js +0 -110
- package/dist/command-implementations/gen-command.js.map +0 -7
- package/dist/command-implementations/global-command.js +0 -137
- package/dist/command-implementations/global-command.js.map +0 -7
- package/dist/command-implementations/index.js +0 -103
- package/dist/command-implementations/index.js.map +0 -7
- package/dist/command-implementations/init-command.js +0 -162
- package/dist/command-implementations/init-command.js.map +0 -7
- package/dist/command-implementations/integration-commands.js +0 -130
- package/dist/command-implementations/integration-commands.js.map +0 -7
- package/dist/command-implementations/interface-commands.js +0 -110
- package/dist/command-implementations/interface-commands.js.map +0 -7
- package/dist/command-implementations/lint-command.js +0 -151
- package/dist/command-implementations/lint-command.js.map +0 -7
- package/dist/command-implementations/login-command.js +0 -82
- package/dist/command-implementations/login-command.js.map +0 -7
- package/dist/command-implementations/logout-command.js +0 -35
- package/dist/command-implementations/logout-command.js.map +0 -7
- package/dist/command-implementations/plugin-commands.js +0 -111
- package/dist/command-implementations/plugin-commands.js.map +0 -7
- package/dist/command-implementations/project-command.js +0 -383
- package/dist/command-implementations/project-command.js.map +0 -7
- package/dist/command-implementations/read-command.js +0 -70
- package/dist/command-implementations/read-command.js.map +0 -7
- package/dist/command-implementations/serve-command.js +0 -68
- package/dist/command-implementations/serve-command.js.map +0 -7
- package/dist/command-tree.js +0 -60
- package/dist/command-tree.js.map +0 -7
- package/dist/config.js +0 -332
- package/dist/config.js.map +0 -7
- package/dist/consts.js +0 -124
- package/dist/consts.js.map +0 -7
- package/dist/errors.js +0 -202
- package/dist/errors.js.map +0 -7
- package/dist/index.js +0 -51
- package/dist/index.js.map +0 -7
- package/dist/init.js +0 -50
- package/dist/init.js.map +0 -7
- package/dist/linter/base-linter.js +0 -75
- package/dist/linter/base-linter.js.map +0 -7
- package/dist/linter/base-linter.test.js +0 -187
- package/dist/linter/base-linter.test.js.map +0 -7
- package/dist/linter/bot-linter.js +0 -35
- package/dist/linter/bot-linter.js.map +0 -7
- package/dist/linter/integration-linter.js +0 -35
- package/dist/linter/integration-linter.js.map +0 -7
- package/dist/linter/interface-linter.js +0 -35
- package/dist/linter/interface-linter.js.map +0 -7
- package/dist/linter/ruleset-tests/bot.ruleset.test.js +0 -358
- package/dist/linter/ruleset-tests/bot.ruleset.test.js.map +0 -7
- package/dist/linter/ruleset-tests/common.js +0 -37
- package/dist/linter/ruleset-tests/common.js.map +0 -7
- package/dist/linter/ruleset-tests/integration.ruleset.test.js +0 -887
- package/dist/linter/ruleset-tests/integration.ruleset.test.js.map +0 -7
- package/dist/linter/ruleset-tests/interface.ruleset.test.js +0 -383
- package/dist/linter/ruleset-tests/interface.ruleset.test.js.map +0 -7
- package/dist/linter/rulesets/bot.ruleset.js +0 -191
- package/dist/linter/rulesets/bot.ruleset.js.map +0 -7
- package/dist/linter/rulesets/integration.ruleset.js +0 -378
- package/dist/linter/rulesets/integration.ruleset.js.map +0 -7
- package/dist/linter/rulesets/interface.ruleset.js +0 -157
- package/dist/linter/rulesets/interface.ruleset.js.map +0 -7
- package/dist/linter/spectral-functions.js +0 -36
- package/dist/linter/spectral-functions.js.map +0 -7
- package/dist/logger/base-logger.js +0 -170
- package/dist/logger/base-logger.js.map +0 -7
- package/dist/logger/index.js +0 -86
- package/dist/logger/index.js.map +0 -7
- package/dist/package-ref.js +0 -107
- package/dist/package-ref.js.map +0 -7
- package/dist/package-ref.test.js +0 -109
- package/dist/package-ref.test.js.map +0 -7
- package/dist/register-yargs.js +0 -91
- package/dist/register-yargs.js.map +0 -7
- package/dist/root.js +0 -41
- package/dist/root.js.map +0 -7
- package/dist/sdk/index.js +0 -22
- package/dist/sdk/index.js.map +0 -7
- package/dist/sdk/resolve-bot-interfaces.js +0 -43
- package/dist/sdk/resolve-bot-interfaces.js.map +0 -7
- package/dist/sdk/resolve-integration-interfaces.js +0 -161
- package/dist/sdk/resolve-integration-interfaces.js.map +0 -7
- package/dist/sdk/validate-bot.js +0 -88
- package/dist/sdk/validate-bot.js.map +0 -7
- package/dist/sdk/validate-integration.js +0 -72
- package/dist/sdk/validate-integration.js.map +0 -7
- package/dist/typings.js +0 -17
- package/dist/typings.js.map +0 -7
- package/dist/utils/cache-utils.js +0 -104
- package/dist/utils/cache-utils.js.map +0 -7
- package/dist/utils/case-utils.js +0 -84
- package/dist/utils/case-utils.js.map +0 -7
- package/dist/utils/case-utils.test.js +0 -75
- package/dist/utils/case-utils.test.js.map +0 -7
- package/dist/utils/esbuild-utils.js +0 -92
- package/dist/utils/esbuild-utils.js.map +0 -7
- package/dist/utils/event-emitter.js +0 -63
- package/dist/utils/event-emitter.js.map +0 -7
- package/dist/utils/file-watcher.js +0 -73
- package/dist/utils/file-watcher.js.map +0 -7
- package/dist/utils/guard-utils.js +0 -32
- package/dist/utils/guard-utils.js.map +0 -7
- package/dist/utils/id-utils.js +0 -59
- package/dist/utils/id-utils.js.map +0 -7
- package/dist/utils/index.js +0 -99
- package/dist/utils/index.js.map +0 -7
- package/dist/utils/object-utils.js +0 -32
- package/dist/utils/object-utils.js.map +0 -7
- package/dist/utils/path-utils.js +0 -106
- package/dist/utils/path-utils.js.map +0 -7
- package/dist/utils/path-utils.test.js +0 -72
- package/dist/utils/path-utils.test.js.map +0 -7
- package/dist/utils/pkgjson-utils.js +0 -57
- package/dist/utils/pkgjson-utils.js.map +0 -7
- package/dist/utils/promise-utils.js +0 -33
- package/dist/utils/promise-utils.js.map +0 -7
- package/dist/utils/promise-utils.test.js +0 -14
- package/dist/utils/promise-utils.test.js.map +0 -7
- package/dist/utils/prompt-utils.js +0 -105
- package/dist/utils/prompt-utils.js.map +0 -7
- package/dist/utils/record-utils.js +0 -118
- package/dist/utils/record-utils.js.map +0 -7
- package/dist/utils/record-utils.test.js +0 -38
- package/dist/utils/record-utils.test.js.map +0 -7
- package/dist/utils/require-utils.js +0 -90
- package/dist/utils/require-utils.js.map +0 -7
- package/dist/utils/require-utils.test.js +0 -54
- package/dist/utils/require-utils.test.js.map +0 -7
- package/dist/utils/schema-utils.js +0 -64
- package/dist/utils/schema-utils.js.map +0 -7
- package/dist/utils/schema-utils.test.js +0 -50
- package/dist/utils/schema-utils.test.js.map +0 -7
- package/dist/utils/semver-utils.js +0 -45
- package/dist/utils/semver-utils.js.map +0 -7
- package/dist/utils/string-utils.js +0 -42
- package/dist/utils/string-utils.js.map +0 -7
- package/dist/utils/template-utils.js +0 -51
- package/dist/utils/template-utils.js.map +0 -7
- package/dist/utils/tunnel-utils.js +0 -129
- package/dist/utils/tunnel-utils.js.map +0 -7
- package/dist/utils/type-utils.js +0 -17
- package/dist/utils/type-utils.js.map +0 -7
- package/dist/utils/url-utils.js +0 -67
- package/dist/utils/url-utils.js.map +0 -7
- package/dist/worker/child-entrypoint.js +0 -58
- package/dist/worker/child-entrypoint.js.map +0 -7
- package/dist/worker/child-wrapper.js +0 -119
- package/dist/worker/child-wrapper.js.map +0 -7
- package/dist/worker/config.js +0 -44
- package/dist/worker/config.js.map +0 -7
- package/dist/worker/index.js +0 -32
- package/dist/worker/index.js.map +0 -7
- package/dist/worker/is-child.js +0 -55
- package/dist/worker/is-child.js.map +0 -7
- package/dist/worker/worker-state.js +0 -71
- package/dist/worker/worker-state.js.map +0 -7
- package/dist/worker/worker.js +0 -91
- package/dist/worker/worker.js.map +0 -7
- package/templates/empty-bot/.botpress/implementation/index.ts +0 -50
- package/templates/empty-bot/.botpress/implementation/plugins/index.ts +0 -11
- package/templates/empty-bot/.botpress/implementation/typings/actions/index.ts +0 -6
- package/templates/empty-bot/.botpress/implementation/typings/events/index.ts +0 -6
- package/templates/empty-bot/.botpress/implementation/typings/index.ts +0 -20
- package/templates/empty-bot/.botpress/implementation/typings/integrations/index.ts +0 -6
- package/templates/empty-bot/.botpress/implementation/typings/states/index.ts +0 -6
- package/templates/empty-bot/.botpress/index.ts +0 -5
- package/templates/empty-integration/.botpress/implementation/index.ts +0 -57
- package/templates/empty-integration/.botpress/implementation/typings/actions/index.ts +0 -6
- package/templates/empty-integration/.botpress/implementation/typings/channels/index.ts +0 -6
- package/templates/empty-integration/.botpress/implementation/typings/configuration/index.ts +0 -2
- package/templates/empty-integration/.botpress/implementation/typings/configurations/index.ts +0 -6
- package/templates/empty-integration/.botpress/implementation/typings/entities/index.ts +0 -6
- package/templates/empty-integration/.botpress/implementation/typings/events/index.ts +0 -6
- package/templates/empty-integration/.botpress/implementation/typings/index.ts +0 -31
- package/templates/empty-integration/.botpress/implementation/typings/states/index.ts +0 -6
- package/templates/empty-integration/.botpress/index.ts +0 -2
- package/templates/empty-integration/.botpress/secrets/index.ts +0 -6
- package/templates/empty-plugin/.botpress/implementation/index.ts +0 -35
- package/templates/empty-plugin/.botpress/implementation/typings/actions/index.ts +0 -6
- package/templates/empty-plugin/.botpress/implementation/typings/configuration/index.ts +0 -2
- package/templates/empty-plugin/.botpress/implementation/typings/events/index.ts +0 -6
- package/templates/empty-plugin/.botpress/implementation/typings/index.ts +0 -26
- package/templates/empty-plugin/.botpress/implementation/typings/integrations/index.ts +0 -6
- package/templates/empty-plugin/.botpress/implementation/typings/interfaces/index.ts +0 -6
- package/templates/empty-plugin/.botpress/implementation/typings/states/index.ts +0 -6
- package/templates/empty-plugin/.botpress/index.ts +0 -1
- package/templates/hello-world/.botpress/implementation/index.ts +0 -57
- package/templates/hello-world/.botpress/implementation/typings/actions/helloWorld/index.ts +0 -12
- package/templates/hello-world/.botpress/implementation/typings/actions/helloWorld/input.ts +0 -5
- package/templates/hello-world/.botpress/implementation/typings/actions/helloWorld/output.ts +0 -5
- package/templates/hello-world/.botpress/implementation/typings/actions/index.ts +0 -9
- package/templates/hello-world/.botpress/implementation/typings/channels/index.ts +0 -6
- package/templates/hello-world/.botpress/implementation/typings/configuration/index.ts +0 -2
- package/templates/hello-world/.botpress/implementation/typings/configurations/index.ts +0 -6
- package/templates/hello-world/.botpress/implementation/typings/entities/index.ts +0 -6
- package/templates/hello-world/.botpress/implementation/typings/events/index.ts +0 -6
- package/templates/hello-world/.botpress/implementation/typings/index.ts +0 -31
- package/templates/hello-world/.botpress/implementation/typings/states/index.ts +0 -6
- package/templates/hello-world/.botpress/index.ts +0 -2
- package/templates/hello-world/.botpress/secrets/index.ts +0 -6
- package/templates/webhook-message/.botpress/implementation/index.ts +0 -57
- package/templates/webhook-message/.botpress/implementation/typings/actions/index.ts +0 -6
- package/templates/webhook-message/.botpress/implementation/typings/channels/index.ts +0 -9
- package/templates/webhook-message/.botpress/implementation/typings/channels/webhook/index.ts +0 -12
- package/templates/webhook-message/.botpress/implementation/typings/channels/webhook/messages/index.ts +0 -9
- package/templates/webhook-message/.botpress/implementation/typings/channels/webhook/messages/text.ts +0 -5
- package/templates/webhook-message/.botpress/implementation/typings/configuration/index.ts +0 -8
- package/templates/webhook-message/.botpress/implementation/typings/configurations/index.ts +0 -6
- package/templates/webhook-message/.botpress/implementation/typings/entities/index.ts +0 -6
- package/templates/webhook-message/.botpress/implementation/typings/events/index.ts +0 -6
- package/templates/webhook-message/.botpress/implementation/typings/index.ts +0 -31
- package/templates/webhook-message/.botpress/implementation/typings/states/index.ts +0 -6
- package/templates/webhook-message/.botpress/index.ts +0 -2
- package/templates/webhook-message/.botpress/secrets/index.ts +0 -6
|
@@ -1,481 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
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.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var deploy_command_exports = {};
|
|
30
|
-
__export(deploy_command_exports, {
|
|
31
|
-
DeployCommand: () => DeployCommand
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(deploy_command_exports);
|
|
34
|
-
var sdk = __toESM(require("@botpress/sdk"));
|
|
35
|
-
var import_chalk = __toESM(require("chalk"));
|
|
36
|
-
var fs = __toESM(require("fs"));
|
|
37
|
-
var import_semver = __toESM(require("semver"));
|
|
38
|
-
var import_bot_body = require("../api/bot-body");
|
|
39
|
-
var import_integration_body = require("../api/integration-body");
|
|
40
|
-
var import_interface_body = require("../api/interface-body");
|
|
41
|
-
var import_plugin_body = require("../api/plugin-body");
|
|
42
|
-
var errors = __toESM(require("../errors"));
|
|
43
|
-
var import_sdk = require("../sdk");
|
|
44
|
-
var utils = __toESM(require("../utils"));
|
|
45
|
-
var import_build_command = require("./build-command");
|
|
46
|
-
var import_project_command = require("./project-command");
|
|
47
|
-
class DeployCommand extends import_project_command.ProjectCommand {
|
|
48
|
-
async run() {
|
|
49
|
-
const api = await this.ensureLoginAndCreateClient(this.argv);
|
|
50
|
-
if (!this.argv.noBuild) {
|
|
51
|
-
await this._runBuild();
|
|
52
|
-
}
|
|
53
|
-
const projectDef = await this.readProjectDefinitionFromFS();
|
|
54
|
-
if (projectDef.type === "integration") {
|
|
55
|
-
return this._deployIntegration(api, projectDef.definition);
|
|
56
|
-
}
|
|
57
|
-
if (projectDef.type === "interface") {
|
|
58
|
-
return this._deployInterface(api, projectDef.definition);
|
|
59
|
-
}
|
|
60
|
-
if (projectDef.type === "plugin") {
|
|
61
|
-
return this._deployPlugin(api, projectDef.definition);
|
|
62
|
-
}
|
|
63
|
-
if (projectDef.type === "bot") {
|
|
64
|
-
return this._deployBot(api, projectDef.definition, this.argv.botId, this.argv.createNewBot);
|
|
65
|
-
}
|
|
66
|
-
throw new errors.UnsupportedProjectType();
|
|
67
|
-
}
|
|
68
|
-
async _runBuild() {
|
|
69
|
-
return new import_build_command.BuildCommand(this.api, this.prompt, this.logger, this.argv).run();
|
|
70
|
-
}
|
|
71
|
-
async _deployIntegration(api, integrationDef) {
|
|
72
|
-
const outfile = this.projectPaths.abs.outFile;
|
|
73
|
-
const code = await fs.promises.readFile(outfile, "utf-8");
|
|
74
|
-
integrationDef = await this._manageWorkspaceHandle(api, integrationDef);
|
|
75
|
-
const { name, version, icon: iconRelativeFilePath, readme: readmeRelativeFilePath, identifier } = integrationDef;
|
|
76
|
-
if (iconRelativeFilePath && !iconRelativeFilePath.toLowerCase().endsWith(".svg")) {
|
|
77
|
-
throw new errors.BotpressCLIError("Icon must be an SVG file");
|
|
78
|
-
}
|
|
79
|
-
const iconFileContent = await this._readMediaFile("icon", iconRelativeFilePath);
|
|
80
|
-
const readmeFileContent = await this._readMediaFile("readme", readmeRelativeFilePath);
|
|
81
|
-
const identifierExtractScriptFileContent = await this.readProjectFile(identifier?.extractScript);
|
|
82
|
-
const fallbackHandlerScriptFileContent = await this.readProjectFile(identifier?.fallbackHandlerScript);
|
|
83
|
-
const integration = await api.findIntegration({ type: "name", name, version });
|
|
84
|
-
if (integration && integration.workspaceId !== api.workspaceId) {
|
|
85
|
-
throw new errors.BotpressCLIError(
|
|
86
|
-
`Public integration ${name} v${version} is already deployed in another workspace.`
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
if (integration && integration.public && !api.isBotpressWorkspace) {
|
|
90
|
-
throw new errors.BotpressCLIError(
|
|
91
|
-
`Integration ${name} v${version} is already deployed publicly and cannot be updated. Please bump the version.`
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
let message;
|
|
95
|
-
if (integration) {
|
|
96
|
-
this.logger.warn("Integration already exists. If you decide to deploy, it will override the existing one.");
|
|
97
|
-
message = `Are you sure you want to override integration ${name} v${version}?`;
|
|
98
|
-
} else {
|
|
99
|
-
message = `Are you sure you want to deploy integration ${name} v${version}?`;
|
|
100
|
-
}
|
|
101
|
-
const confirm = await this.prompt.confirm(message);
|
|
102
|
-
if (!confirm) {
|
|
103
|
-
this.logger.log("Aborted");
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
this.logger.debug("Preparing integration request body...");
|
|
107
|
-
let createBody = await (0, import_integration_body.prepareCreateIntegrationBody)(integrationDef);
|
|
108
|
-
createBody = {
|
|
109
|
-
...createBody,
|
|
110
|
-
interfaces: await this._formatInterfacesImplStatements(api, integrationDef),
|
|
111
|
-
code,
|
|
112
|
-
icon: iconFileContent,
|
|
113
|
-
readme: readmeFileContent,
|
|
114
|
-
configuration: await this.readIntegrationConfigDefinition(createBody.configuration),
|
|
115
|
-
configurations: await utils.promises.awaitRecord(
|
|
116
|
-
utils.records.mapValues(createBody.configurations ?? {}, this.readIntegrationConfigDefinition.bind(this))
|
|
117
|
-
),
|
|
118
|
-
identifier: {
|
|
119
|
-
extractScript: identifierExtractScriptFileContent,
|
|
120
|
-
fallbackHandlerScript: fallbackHandlerScriptFileContent
|
|
121
|
-
},
|
|
122
|
-
public: this.argv.public
|
|
123
|
-
};
|
|
124
|
-
const startedMessage = `Deploying integration ${import_chalk.default.bold(name)} v${version}...`;
|
|
125
|
-
const successMessage = "Integration deployed";
|
|
126
|
-
if (integration) {
|
|
127
|
-
const updateBody = (0, import_integration_body.prepareUpdateIntegrationBody)(
|
|
128
|
-
{
|
|
129
|
-
id: integration.id,
|
|
130
|
-
...createBody,
|
|
131
|
-
public: this.argv.public
|
|
132
|
-
},
|
|
133
|
-
integration
|
|
134
|
-
);
|
|
135
|
-
const { secrets: knownSecrets } = integration;
|
|
136
|
-
updateBody.secrets = await this.promptSecrets(integrationDef, this.argv, { knownSecrets });
|
|
137
|
-
this._detectDeprecatedFeatures(integrationDef, { allowDeprecated: true });
|
|
138
|
-
const line = this.logger.line();
|
|
139
|
-
line.started(startedMessage);
|
|
140
|
-
await api.client.updateIntegration(updateBody).catch((thrown) => {
|
|
141
|
-
throw errors.BotpressCLIError.wrap(thrown, `Could not update integration "${name}"`);
|
|
142
|
-
});
|
|
143
|
-
line.success(successMessage);
|
|
144
|
-
} else {
|
|
145
|
-
this.logger.debug(`looking for previous version of integration "${name}"`);
|
|
146
|
-
const previousVersion = await api.findPreviousIntegrationVersion({ type: "name", name, version });
|
|
147
|
-
if (previousVersion) {
|
|
148
|
-
this.logger.debug(`previous version found: ${previousVersion.version}`);
|
|
149
|
-
} else {
|
|
150
|
-
this.logger.debug("no previous version found");
|
|
151
|
-
}
|
|
152
|
-
const knownSecrets = previousVersion?.secrets;
|
|
153
|
-
const createSecrets = await this.promptSecrets(integrationDef, this.argv, { knownSecrets });
|
|
154
|
-
createBody.secrets = utils.records.filterValues(createSecrets, utils.guards.is.notNull);
|
|
155
|
-
this._detectDeprecatedFeatures(integrationDef, {
|
|
156
|
-
allowDeprecated: this._allowDeprecatedFeatures(integrationDef, previousVersion)
|
|
157
|
-
});
|
|
158
|
-
const line = this.logger.line();
|
|
159
|
-
line.started(startedMessage);
|
|
160
|
-
await api.client.createIntegration(createBody).catch((thrown) => {
|
|
161
|
-
throw errors.BotpressCLIError.wrap(thrown, `Could not create integration "${name}"`);
|
|
162
|
-
});
|
|
163
|
-
line.success(successMessage);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
async _deployInterface(api, interfaceDeclaration) {
|
|
167
|
-
if (!api.isBotpressWorkspace) {
|
|
168
|
-
throw new errors.BotpressCLIError("Your workspace is not allowed to deploy interfaces.");
|
|
169
|
-
}
|
|
170
|
-
const { name, version } = interfaceDeclaration;
|
|
171
|
-
const intrface = await api.findPublicInterface({ type: "name", name, version });
|
|
172
|
-
let message;
|
|
173
|
-
if (intrface) {
|
|
174
|
-
this.logger.warn("Interface already exists. If you decide to deploy, it will override the existing one.");
|
|
175
|
-
message = `Are you sure you want to override interface ${name} v${version}?`;
|
|
176
|
-
} else {
|
|
177
|
-
message = `Are you sure you want to deploy interface ${name} v${version}?`;
|
|
178
|
-
}
|
|
179
|
-
const confirm = await this.prompt.confirm(message);
|
|
180
|
-
if (!confirm) {
|
|
181
|
-
this.logger.log("Aborted");
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
const createBody = await (0, import_interface_body.prepareCreateInterfaceBody)(interfaceDeclaration);
|
|
185
|
-
const startedMessage = `Deploying interface ${import_chalk.default.bold(name)} v${version}...`;
|
|
186
|
-
const successMessage = "Interface deployed";
|
|
187
|
-
if (intrface) {
|
|
188
|
-
const updateBody = (0, import_interface_body.prepareUpdateInterfaceBody)(
|
|
189
|
-
{
|
|
190
|
-
id: intrface.id,
|
|
191
|
-
...createBody
|
|
192
|
-
},
|
|
193
|
-
intrface
|
|
194
|
-
);
|
|
195
|
-
const line = this.logger.line();
|
|
196
|
-
line.started(startedMessage);
|
|
197
|
-
await api.client.updateInterface(updateBody).catch((thrown) => {
|
|
198
|
-
throw errors.BotpressCLIError.wrap(thrown, `Could not update interface "${name}"`);
|
|
199
|
-
});
|
|
200
|
-
line.success(successMessage);
|
|
201
|
-
} else {
|
|
202
|
-
const line = this.logger.line();
|
|
203
|
-
line.started(startedMessage);
|
|
204
|
-
await api.client.createInterface(createBody).catch((thrown) => {
|
|
205
|
-
throw errors.BotpressCLIError.wrap(thrown, `Could not create interface "${name}"`);
|
|
206
|
-
});
|
|
207
|
-
line.success(successMessage);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
async _deployPlugin(api, pluginDef) {
|
|
211
|
-
const outfile = this.projectPaths.abs.outFile;
|
|
212
|
-
const code = await fs.promises.readFile(outfile, "utf-8");
|
|
213
|
-
const { name, version } = pluginDef;
|
|
214
|
-
const plugin = await api.findPublicPlugin({ type: "name", name, version });
|
|
215
|
-
let message;
|
|
216
|
-
if (plugin) {
|
|
217
|
-
this.logger.warn("Plugin already exists. If you decide to deploy, it will override the existing one.");
|
|
218
|
-
message = `Are you sure you want to override plugin ${name} v${version}?`;
|
|
219
|
-
} else {
|
|
220
|
-
message = `Are you sure you want to deploy plugin ${name} v${version}?`;
|
|
221
|
-
}
|
|
222
|
-
const confirm = await this.prompt.confirm(message);
|
|
223
|
-
if (!confirm) {
|
|
224
|
-
this.logger.log("Aborted");
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
this.logger.debug("Preparing plugin request body...");
|
|
228
|
-
const createBody = {
|
|
229
|
-
...await (0, import_plugin_body.prepareCreatePluginBody)(pluginDef),
|
|
230
|
-
code
|
|
231
|
-
};
|
|
232
|
-
const startedMessage = `Deploying plugin ${import_chalk.default.bold(name)} v${version}...`;
|
|
233
|
-
const successMessage = "Plugin deployed";
|
|
234
|
-
if (plugin) {
|
|
235
|
-
const updateBody = (0, import_plugin_body.prepareUpdatePluginBody)(
|
|
236
|
-
{
|
|
237
|
-
id: plugin.id,
|
|
238
|
-
...createBody
|
|
239
|
-
},
|
|
240
|
-
plugin
|
|
241
|
-
);
|
|
242
|
-
const line = this.logger.line();
|
|
243
|
-
line.started(startedMessage);
|
|
244
|
-
await api.client.updatePlugin(updateBody).catch((thrown) => {
|
|
245
|
-
throw errors.BotpressCLIError.wrap(thrown, `Could not update plugin "${name}"`);
|
|
246
|
-
});
|
|
247
|
-
line.success(successMessage);
|
|
248
|
-
} else {
|
|
249
|
-
const line = this.logger.line();
|
|
250
|
-
line.started(startedMessage);
|
|
251
|
-
await api.client.createPlugin(createBody).catch((thrown) => {
|
|
252
|
-
throw errors.BotpressCLIError.wrap(thrown, `Could not create plugin "${name}"`);
|
|
253
|
-
});
|
|
254
|
-
line.success(successMessage);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
_allowDeprecatedFeatures(integrationDef, previousVersion) {
|
|
258
|
-
if (this.argv.allowDeprecated) {
|
|
259
|
-
return true;
|
|
260
|
-
}
|
|
261
|
-
if (!previousVersion) {
|
|
262
|
-
return false;
|
|
263
|
-
}
|
|
264
|
-
const versionDiff = import_semver.default.diff(integrationDef.version, previousVersion.version);
|
|
265
|
-
if (!versionDiff) {
|
|
266
|
-
return false;
|
|
267
|
-
}
|
|
268
|
-
return utils.semver.releases.lt(versionDiff, "major");
|
|
269
|
-
}
|
|
270
|
-
_detectDeprecatedFeatures(integrationDef, opts = {}) {
|
|
271
|
-
const deprecatedFields = [];
|
|
272
|
-
const { user, channels } = integrationDef;
|
|
273
|
-
if (user?.creation?.enabled) {
|
|
274
|
-
deprecatedFields.push("user.creation");
|
|
275
|
-
}
|
|
276
|
-
for (const [channelName, channel] of Object.entries(channels ?? {})) {
|
|
277
|
-
if (channel?.conversation?.creation?.enabled) {
|
|
278
|
-
deprecatedFields.push(`channels.${channelName}.creation`);
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
if (!deprecatedFields.length) {
|
|
282
|
-
return;
|
|
283
|
-
}
|
|
284
|
-
const errorMessage = `The following fields of the integration's definition are deprecated: ${deprecatedFields.join(
|
|
285
|
-
", "
|
|
286
|
-
)}`;
|
|
287
|
-
if (opts.allowDeprecated) {
|
|
288
|
-
this.logger.warn(errorMessage);
|
|
289
|
-
} else {
|
|
290
|
-
throw new errors.BotpressCLIError(errorMessage);
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
_readMediaFile = async (filePurpose, filePath) => {
|
|
294
|
-
if (!filePath) {
|
|
295
|
-
return void 0;
|
|
296
|
-
}
|
|
297
|
-
const absoluteFilePath = utils.path.absoluteFrom(this.projectPaths.abs.workDir, filePath);
|
|
298
|
-
return fs.promises.readFile(absoluteFilePath, "base64").catch((thrown) => {
|
|
299
|
-
throw errors.BotpressCLIError.wrap(thrown, `Could not read ${filePurpose} file "${absoluteFilePath}"`);
|
|
300
|
-
});
|
|
301
|
-
};
|
|
302
|
-
async _deployBot(api, botDefinition, argvBotId, argvCreateNew) {
|
|
303
|
-
const outfile = this.projectPaths.abs.outFile;
|
|
304
|
-
const code = await fs.promises.readFile(outfile, "utf-8");
|
|
305
|
-
let bot;
|
|
306
|
-
if (argvBotId && argvCreateNew) {
|
|
307
|
-
throw new errors.BotpressCLIError("Cannot specify both --botId and --createNew");
|
|
308
|
-
} else if (argvCreateNew) {
|
|
309
|
-
const confirm = await this.prompt.confirm("Are you sure you want to create a new bot ?");
|
|
310
|
-
if (!confirm) {
|
|
311
|
-
this.logger.log("Aborted");
|
|
312
|
-
return;
|
|
313
|
-
}
|
|
314
|
-
bot = await this._createNewBot(api);
|
|
315
|
-
} else {
|
|
316
|
-
bot = await this._getExistingBot(api, argvBotId);
|
|
317
|
-
const confirm = await this.prompt.confirm(`Are you sure you want to deploy the bot "${bot.name}"?`);
|
|
318
|
-
if (!confirm) {
|
|
319
|
-
this.logger.log("Aborted");
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
const line = this.logger.line();
|
|
324
|
-
line.started(`Deploying bot ${import_chalk.default.bold(bot.name)}...`);
|
|
325
|
-
const integrationInstances = await this.fetchBotIntegrationInstances(botDefinition, api);
|
|
326
|
-
const createBotBody = await (0, import_bot_body.prepareCreateBotBody)(botDefinition);
|
|
327
|
-
const updateBotBody = (0, import_bot_body.prepareUpdateBotBody)(
|
|
328
|
-
{
|
|
329
|
-
...createBotBody,
|
|
330
|
-
id: bot.id,
|
|
331
|
-
code,
|
|
332
|
-
integrations: integrationInstances
|
|
333
|
-
},
|
|
334
|
-
bot
|
|
335
|
-
);
|
|
336
|
-
const { bot: updatedBot } = await api.client.updateBot(updateBotBody).catch((thrown) => {
|
|
337
|
-
throw errors.BotpressCLIError.wrap(thrown, `Could not update bot "${bot.name}"`);
|
|
338
|
-
});
|
|
339
|
-
line.success("Bot deployed");
|
|
340
|
-
this.displayWebhookUrls(updatedBot);
|
|
341
|
-
}
|
|
342
|
-
async _createNewBot(api) {
|
|
343
|
-
const line = this.logger.line();
|
|
344
|
-
const { bot: createdBot } = await api.client.createBot({}).catch((thrown) => {
|
|
345
|
-
throw errors.BotpressCLIError.wrap(thrown, "Could not create bot");
|
|
346
|
-
});
|
|
347
|
-
line.success(`Bot created with ID "${createdBot.id}" and name "${createdBot.name}"`);
|
|
348
|
-
await this.projectCache.set("botId", createdBot.id);
|
|
349
|
-
return createdBot;
|
|
350
|
-
}
|
|
351
|
-
async _getExistingBot(api, botId) {
|
|
352
|
-
const promptedBotId = await this.projectCache.sync("botId", botId, async (defaultId) => {
|
|
353
|
-
const userBots = await api.listAllPages(api.client.listBots, (r) => r.bots).catch((thrown) => {
|
|
354
|
-
throw errors.BotpressCLIError.wrap(thrown, "Could not fetch existing bots");
|
|
355
|
-
});
|
|
356
|
-
if (!userBots.length) {
|
|
357
|
-
throw new errors.NoBotsFoundError();
|
|
358
|
-
}
|
|
359
|
-
const initial = userBots.find((bot) => bot.id === defaultId);
|
|
360
|
-
const prompted = await this.prompt.select("Which bot do you want to deploy?", {
|
|
361
|
-
initial: initial && { title: initial.name, value: initial.id },
|
|
362
|
-
choices: userBots.map((bot) => ({ title: bot.name, value: bot.id }))
|
|
363
|
-
});
|
|
364
|
-
if (!prompted) {
|
|
365
|
-
throw new errors.ParamRequiredError("Bot Id");
|
|
366
|
-
}
|
|
367
|
-
return prompted;
|
|
368
|
-
});
|
|
369
|
-
const { bot: fetchedBot } = await api.client.getBot({ id: promptedBotId }).catch((thrown) => {
|
|
370
|
-
throw errors.BotpressCLIError.wrap(thrown, "Could not get bot info");
|
|
371
|
-
});
|
|
372
|
-
return fetchedBot;
|
|
373
|
-
}
|
|
374
|
-
async _manageWorkspaceHandle(api, integration) {
|
|
375
|
-
const { name: localName, workspaceHandle: localHandle } = this._parseIntegrationName(integration.name);
|
|
376
|
-
if (!localHandle && api.isBotpressWorkspace) {
|
|
377
|
-
this.logger.debug("Botpress workspace detected; workspace handle omitted");
|
|
378
|
-
return integration;
|
|
379
|
-
}
|
|
380
|
-
const { handle: remoteHandle, name: workspaceName } = await api.getWorkspace().catch((thrown) => {
|
|
381
|
-
throw errors.BotpressCLIError.wrap(thrown, "Could not fetch workspace");
|
|
382
|
-
});
|
|
383
|
-
if (localHandle && remoteHandle) {
|
|
384
|
-
if (localHandle !== remoteHandle) {
|
|
385
|
-
throw new errors.BotpressCLIError(
|
|
386
|
-
`Your current workspace handle is "${remoteHandle}" but the integration handle is "${localHandle}".`
|
|
387
|
-
);
|
|
388
|
-
}
|
|
389
|
-
return integration;
|
|
390
|
-
}
|
|
391
|
-
const workspaceHandleIsMandatoryMsg = "Cannot deploy integration without workspace handle";
|
|
392
|
-
if (!localHandle && remoteHandle) {
|
|
393
|
-
const confirmAddHandle = await this.prompt.confirm(
|
|
394
|
-
`Your current workspace handle is "${remoteHandle}". Do you want to use the name "${remoteHandle}/${localName}"?`
|
|
395
|
-
);
|
|
396
|
-
if (!confirmAddHandle) {
|
|
397
|
-
throw new errors.BotpressCLIError(workspaceHandleIsMandatoryMsg);
|
|
398
|
-
}
|
|
399
|
-
const newName2 = `${remoteHandle}/${localName}`;
|
|
400
|
-
return new sdk.IntegrationDefinition({ ...integration, name: newName2 });
|
|
401
|
-
}
|
|
402
|
-
if (localHandle && !remoteHandle) {
|
|
403
|
-
const { available } = await api.client.checkHandleAvailability({ handle: localHandle }).catch((thrown) => {
|
|
404
|
-
throw errors.BotpressCLIError.wrap(thrown, "Could not check handle availability");
|
|
405
|
-
});
|
|
406
|
-
if (!available) {
|
|
407
|
-
throw new errors.BotpressCLIError(`Handle "${localHandle}" is not yours and is not available`);
|
|
408
|
-
}
|
|
409
|
-
const confirmClaimHandle = await this.prompt.confirm(
|
|
410
|
-
`Handle "${localHandle}" is available. Do you want to claim it for your workspace ${workspaceName}?`
|
|
411
|
-
);
|
|
412
|
-
if (!confirmClaimHandle) {
|
|
413
|
-
throw new errors.BotpressCLIError(workspaceHandleIsMandatoryMsg);
|
|
414
|
-
}
|
|
415
|
-
await api.updateWorkspace({ handle: localHandle }).catch((thrown) => {
|
|
416
|
-
throw errors.BotpressCLIError.wrap(thrown, `Could not claim handle "${localHandle}"`);
|
|
417
|
-
});
|
|
418
|
-
this.logger.success(`Handle "${localHandle}" is now yours!`);
|
|
419
|
-
return integration;
|
|
420
|
-
}
|
|
421
|
-
this.logger.warn("It seems you don't have a workspace handle yet.");
|
|
422
|
-
let claimedHandle = void 0;
|
|
423
|
-
do {
|
|
424
|
-
const prompted = await this.prompt.text("Please enter a workspace handle");
|
|
425
|
-
if (!prompted) {
|
|
426
|
-
throw new errors.BotpressCLIError(workspaceHandleIsMandatoryMsg);
|
|
427
|
-
}
|
|
428
|
-
const { available, suggestions } = await api.client.checkHandleAvailability({ handle: prompted });
|
|
429
|
-
if (!available) {
|
|
430
|
-
this.logger.warn(`Handle "${prompted}" is not available. Suggestions: ${suggestions.join(", ")}`);
|
|
431
|
-
continue;
|
|
432
|
-
}
|
|
433
|
-
claimedHandle = prompted;
|
|
434
|
-
await api.updateWorkspace({ handle: claimedHandle }).catch((thrown) => {
|
|
435
|
-
throw errors.BotpressCLIError.wrap(thrown, `Could not claim handle "${claimedHandle}"`);
|
|
436
|
-
});
|
|
437
|
-
} while (!claimedHandle);
|
|
438
|
-
this.logger.success(`Handle "${claimedHandle}" is yours!`);
|
|
439
|
-
const newName = `${claimedHandle}/${localName}`;
|
|
440
|
-
return new sdk.IntegrationDefinition({ ...integration, name: newName });
|
|
441
|
-
}
|
|
442
|
-
_parseIntegrationName = (integrationName) => {
|
|
443
|
-
const parts = integrationName.split("/");
|
|
444
|
-
if (parts.length > 2) {
|
|
445
|
-
throw new errors.BotpressCLIError(
|
|
446
|
-
`Invalid integration name "${integrationName}": a single forward slash is allowed`
|
|
447
|
-
);
|
|
448
|
-
}
|
|
449
|
-
if (parts.length === 2) {
|
|
450
|
-
const [workspaceHandle, name2] = parts;
|
|
451
|
-
return { name: name2, workspaceHandle };
|
|
452
|
-
}
|
|
453
|
-
const [name] = parts;
|
|
454
|
-
return { name };
|
|
455
|
-
};
|
|
456
|
-
_formatInterfacesImplStatements = async (api, integration) => {
|
|
457
|
-
const interfacesStatements = (0, import_sdk.getImplementationStatements)(integration);
|
|
458
|
-
const interfaces = {};
|
|
459
|
-
for (const [key, i] of Object.entries(interfacesStatements)) {
|
|
460
|
-
const { name, version, entities, actions, events, channels } = i;
|
|
461
|
-
const id = await this._getInterfaceId(api, { id: i.id, name, version });
|
|
462
|
-
interfaces[key] = { id, entities, actions, events, channels };
|
|
463
|
-
}
|
|
464
|
-
return interfaces;
|
|
465
|
-
};
|
|
466
|
-
_getInterfaceId = async (api, ref) => {
|
|
467
|
-
if (ref.id) {
|
|
468
|
-
return ref.id;
|
|
469
|
-
}
|
|
470
|
-
const intrface = await api.findPublicInterface({ type: "name", name: ref.name, version: ref.version });
|
|
471
|
-
if (!intrface) {
|
|
472
|
-
throw new errors.BotpressCLIError(`Could not find interface "${ref.name}@${ref.version}"`);
|
|
473
|
-
}
|
|
474
|
-
return intrface.id;
|
|
475
|
-
};
|
|
476
|
-
}
|
|
477
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
478
|
-
0 && (module.exports = {
|
|
479
|
-
DeployCommand
|
|
480
|
-
});
|
|
481
|
-
//# sourceMappingURL=deploy-command.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/command-implementations/deploy-command.ts"],
|
|
4
|
-
"sourcesContent": ["import type * as client from '@botpress/client'\nimport * as sdk from '@botpress/sdk'\nimport chalk from 'chalk'\nimport * as fs from 'fs'\nimport semver from 'semver'\nimport { prepareCreateBotBody, prepareUpdateBotBody } from '../api/bot-body'\nimport type { ApiClient } from '../api/client'\nimport {\n CreateIntegrationBody,\n prepareUpdateIntegrationBody,\n prepareCreateIntegrationBody,\n} from '../api/integration-body'\nimport { CreateInterfaceBody, prepareCreateInterfaceBody, prepareUpdateInterfaceBody } from '../api/interface-body'\nimport { prepareCreatePluginBody, prepareUpdatePluginBody } from '../api/plugin-body'\nimport type commandDefinitions from '../command-definitions'\nimport * as errors from '../errors'\nimport { getImplementationStatements } from '../sdk'\nimport * as utils from '../utils'\nimport { BuildCommand } from './build-command'\nimport { ProjectCommand } from './project-command'\n\nexport type DeployCommandDefinition = typeof commandDefinitions.deploy\nexport class DeployCommand extends ProjectCommand<DeployCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n\n if (!this.argv.noBuild) {\n await this._runBuild() // This ensures the bundle is always synced with source code\n }\n\n const projectDef = await this.readProjectDefinitionFromFS()\n\n if (projectDef.type === 'integration') {\n return this._deployIntegration(api, projectDef.definition)\n }\n if (projectDef.type === 'interface') {\n return this._deployInterface(api, projectDef.definition)\n }\n if (projectDef.type === 'plugin') {\n return this._deployPlugin(api, projectDef.definition)\n }\n if (projectDef.type === 'bot') {\n return this._deployBot(api, projectDef.definition, this.argv.botId, this.argv.createNewBot)\n }\n throw new errors.UnsupportedProjectType()\n }\n\n private async _runBuild() {\n return new BuildCommand(this.api, this.prompt, this.logger, this.argv).run()\n }\n\n private async _deployIntegration(api: ApiClient, integrationDef: sdk.IntegrationDefinition) {\n const outfile = this.projectPaths.abs.outFile\n const code = await fs.promises.readFile(outfile, 'utf-8')\n\n integrationDef = await this._manageWorkspaceHandle(api, integrationDef)\n\n const { name, version, icon: iconRelativeFilePath, readme: readmeRelativeFilePath, identifier } = integrationDef\n\n if (iconRelativeFilePath && !iconRelativeFilePath.toLowerCase().endsWith('.svg')) {\n throw new errors.BotpressCLIError('Icon must be an SVG file')\n }\n\n const iconFileContent = await this._readMediaFile('icon', iconRelativeFilePath)\n const readmeFileContent = await this._readMediaFile('readme', readmeRelativeFilePath)\n const identifierExtractScriptFileContent = await this.readProjectFile(identifier?.extractScript)\n const fallbackHandlerScriptFileContent = await this.readProjectFile(identifier?.fallbackHandlerScript)\n\n const integration = await api.findIntegration({ type: 'name', name, version })\n if (integration && integration.workspaceId !== api.workspaceId) {\n throw new errors.BotpressCLIError(\n `Public integration ${name} v${version} is already deployed in another workspace.`\n )\n }\n\n if (integration && integration.public && !api.isBotpressWorkspace) {\n throw new errors.BotpressCLIError(\n `Integration ${name} v${version} is already deployed publicly and cannot be updated. Please bump the version.`\n )\n }\n\n let message: string\n if (integration) {\n this.logger.warn('Integration already exists. If you decide to deploy, it will override the existing one.')\n message = `Are you sure you want to override integration ${name} v${version}?`\n } else {\n message = `Are you sure you want to deploy integration ${name} v${version}?`\n }\n\n const confirm = await this.prompt.confirm(message)\n if (!confirm) {\n this.logger.log('Aborted')\n return\n }\n\n this.logger.debug('Preparing integration request body...')\n\n let createBody: CreateIntegrationBody = await prepareCreateIntegrationBody(integrationDef)\n createBody = {\n ...createBody,\n interfaces: await this._formatInterfacesImplStatements(api, integrationDef),\n code,\n icon: iconFileContent,\n readme: readmeFileContent,\n configuration: await this.readIntegrationConfigDefinition(createBody.configuration),\n configurations: await utils.promises.awaitRecord(\n utils.records.mapValues(createBody.configurations ?? {}, this.readIntegrationConfigDefinition.bind(this))\n ),\n identifier: {\n extractScript: identifierExtractScriptFileContent,\n fallbackHandlerScript: fallbackHandlerScriptFileContent,\n },\n public: this.argv.public,\n }\n\n const startedMessage = `Deploying integration ${chalk.bold(name)} v${version}...`\n const successMessage = 'Integration deployed'\n if (integration) {\n const updateBody = prepareUpdateIntegrationBody(\n {\n id: integration.id,\n ...createBody,\n public: this.argv.public,\n },\n integration\n )\n\n const { secrets: knownSecrets } = integration\n updateBody.secrets = await this.promptSecrets(integrationDef, this.argv, { knownSecrets })\n this._detectDeprecatedFeatures(integrationDef, { allowDeprecated: true })\n\n const line = this.logger.line()\n line.started(startedMessage)\n await api.client.updateIntegration(updateBody).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not update integration \"${name}\"`)\n })\n line.success(successMessage)\n } else {\n this.logger.debug(`looking for previous version of integration \"${name}\"`)\n const previousVersion = await api.findPreviousIntegrationVersion({ type: 'name', name, version })\n\n if (previousVersion) {\n this.logger.debug(`previous version found: ${previousVersion.version}`)\n } else {\n this.logger.debug('no previous version found')\n }\n\n const knownSecrets = previousVersion?.secrets\n\n const createSecrets = await this.promptSecrets(integrationDef, this.argv, { knownSecrets })\n createBody.secrets = utils.records.filterValues(createSecrets, utils.guards.is.notNull)\n\n this._detectDeprecatedFeatures(integrationDef, {\n allowDeprecated: this._allowDeprecatedFeatures(integrationDef, previousVersion),\n })\n\n const line = this.logger.line()\n line.started(startedMessage)\n await api.client.createIntegration(createBody).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not create integration \"${name}\"`)\n })\n line.success(successMessage)\n }\n }\n\n private async _deployInterface(api: ApiClient, interfaceDeclaration: sdk.InterfaceDefinition) {\n if (!api.isBotpressWorkspace) {\n throw new errors.BotpressCLIError('Your workspace is not allowed to deploy interfaces.')\n }\n\n const { name, version } = interfaceDeclaration\n const intrface = await api.findPublicInterface({ type: 'name', name, version })\n\n let message: string\n if (intrface) {\n this.logger.warn('Interface already exists. If you decide to deploy, it will override the existing one.')\n message = `Are you sure you want to override interface ${name} v${version}?`\n } else {\n message = `Are you sure you want to deploy interface ${name} v${version}?`\n }\n\n const confirm = await this.prompt.confirm(message)\n if (!confirm) {\n this.logger.log('Aborted')\n return\n }\n\n const createBody: CreateInterfaceBody = await prepareCreateInterfaceBody(interfaceDeclaration)\n\n const startedMessage = `Deploying interface ${chalk.bold(name)} v${version}...`\n const successMessage = 'Interface deployed'\n if (intrface) {\n const updateBody = prepareUpdateInterfaceBody(\n {\n id: intrface.id,\n ...createBody,\n },\n intrface\n )\n\n const line = this.logger.line()\n line.started(startedMessage)\n await api.client.updateInterface(updateBody).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not update interface \"${name}\"`)\n })\n line.success(successMessage)\n } else {\n const line = this.logger.line()\n line.started(startedMessage)\n await api.client.createInterface(createBody).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not create interface \"${name}\"`)\n })\n line.success(successMessage)\n }\n }\n\n private async _deployPlugin(api: ApiClient, pluginDef: sdk.PluginDefinition) {\n const outfile = this.projectPaths.abs.outFile\n const code = await fs.promises.readFile(outfile, 'utf-8')\n\n const { name, version } = pluginDef\n\n const plugin = await api.findPublicPlugin({ type: 'name', name, version })\n\n let message: string\n if (plugin) {\n this.logger.warn('Plugin already exists. If you decide to deploy, it will override the existing one.')\n message = `Are you sure you want to override plugin ${name} v${version}?`\n } else {\n message = `Are you sure you want to deploy plugin ${name} v${version}?`\n }\n\n const confirm = await this.prompt.confirm(message)\n if (!confirm) {\n this.logger.log('Aborted')\n return\n }\n\n this.logger.debug('Preparing plugin request body...')\n\n const createBody = {\n ...(await prepareCreatePluginBody(pluginDef)),\n code,\n }\n\n const startedMessage = `Deploying plugin ${chalk.bold(name)} v${version}...`\n const successMessage = 'Plugin deployed'\n if (plugin) {\n const updateBody = prepareUpdatePluginBody(\n {\n id: plugin.id,\n ...createBody,\n },\n plugin\n )\n\n const line = this.logger.line()\n line.started(startedMessage)\n await api.client.updatePlugin(updateBody).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not update plugin \"${name}\"`)\n })\n line.success(successMessage)\n } else {\n const line = this.logger.line()\n line.started(startedMessage)\n await api.client.createPlugin(createBody).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not create plugin \"${name}\"`)\n })\n line.success(successMessage)\n }\n }\n\n private _allowDeprecatedFeatures(\n integrationDef: sdk.IntegrationDefinition,\n previousVersion: client.Integration | undefined\n ): boolean {\n if (this.argv.allowDeprecated) {\n return true\n }\n\n if (!previousVersion) {\n return false\n }\n\n const versionDiff = semver.diff(integrationDef.version, previousVersion.version)\n if (!versionDiff) {\n return false\n }\n\n return utils.semver.releases.lt(versionDiff, 'major')\n }\n\n private _detectDeprecatedFeatures(\n integrationDef: sdk.IntegrationDefinition,\n opts: { allowDeprecated?: boolean } = {}\n ) {\n const deprecatedFields: string[] = []\n const { user, channels } = integrationDef\n if (user?.creation?.enabled) {\n deprecatedFields.push('user.creation')\n }\n\n for (const [channelName, channel] of Object.entries(channels ?? {})) {\n if (channel?.conversation?.creation?.enabled) {\n deprecatedFields.push(`channels.${channelName}.creation`)\n }\n }\n\n if (!deprecatedFields.length) {\n return\n }\n\n const errorMessage = `The following fields of the integration's definition are deprecated: ${deprecatedFields.join(\n ', '\n )}`\n\n if (opts.allowDeprecated) {\n this.logger.warn(errorMessage)\n } else {\n throw new errors.BotpressCLIError(errorMessage)\n }\n }\n\n private _readMediaFile = async (\n filePurpose: 'icon' | 'readme',\n filePath: string | undefined\n ): Promise<string | undefined> => {\n if (!filePath) {\n return undefined\n }\n\n const absoluteFilePath = utils.path.absoluteFrom(this.projectPaths.abs.workDir, filePath)\n return fs.promises.readFile(absoluteFilePath, 'base64').catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not read ${filePurpose} file \"${absoluteFilePath}\"`)\n })\n }\n\n private async _deployBot(\n api: ApiClient,\n botDefinition: sdk.BotDefinition,\n argvBotId: string | undefined,\n argvCreateNew: boolean | undefined\n ) {\n const outfile = this.projectPaths.abs.outFile\n const code = await fs.promises.readFile(outfile, 'utf-8')\n\n let bot: client.Bot\n if (argvBotId && argvCreateNew) {\n throw new errors.BotpressCLIError('Cannot specify both --botId and --createNew')\n } else if (argvCreateNew) {\n const confirm = await this.prompt.confirm('Are you sure you want to create a new bot ?')\n if (!confirm) {\n this.logger.log('Aborted')\n return\n }\n\n bot = await this._createNewBot(api)\n } else {\n bot = await this._getExistingBot(api, argvBotId)\n\n const confirm = await this.prompt.confirm(`Are you sure you want to deploy the bot \"${bot.name}\"?`)\n if (!confirm) {\n this.logger.log('Aborted')\n return\n }\n }\n\n const line = this.logger.line()\n line.started(`Deploying bot ${chalk.bold(bot.name)}...`)\n\n const integrationInstances = await this.fetchBotIntegrationInstances(botDefinition, api)\n const createBotBody = await prepareCreateBotBody(botDefinition)\n const updateBotBody = prepareUpdateBotBody(\n {\n ...createBotBody,\n id: bot.id,\n code,\n integrations: integrationInstances,\n },\n bot\n )\n\n const { bot: updatedBot } = await api.client.updateBot(updateBotBody).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not update bot \"${bot.name}\"`)\n })\n line.success('Bot deployed')\n this.displayWebhookUrls(updatedBot)\n }\n\n private async _createNewBot(api: ApiClient): Promise<client.Bot> {\n const line = this.logger.line()\n const { bot: createdBot } = await api.client.createBot({}).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not create bot')\n })\n line.success(`Bot created with ID \"${createdBot.id}\" and name \"${createdBot.name}\"`)\n await this.projectCache.set('botId', createdBot.id)\n return createdBot\n }\n\n private async _getExistingBot(api: ApiClient, botId: string | undefined): Promise<client.Bot> {\n const promptedBotId = await this.projectCache.sync('botId', botId, async (defaultId) => {\n const userBots = await api\n .listAllPages(api.client.listBots, (r) => r.bots)\n .catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not fetch existing bots')\n })\n\n if (!userBots.length) {\n throw new errors.NoBotsFoundError()\n }\n\n const initial = userBots.find((bot) => bot.id === defaultId)\n\n const prompted = await this.prompt.select('Which bot do you want to deploy?', {\n initial: initial && { title: initial.name, value: initial.id },\n choices: userBots.map((bot) => ({ title: bot.name, value: bot.id })),\n })\n\n if (!prompted) {\n throw new errors.ParamRequiredError('Bot Id')\n }\n\n return prompted\n })\n\n const { bot: fetchedBot } = await api.client.getBot({ id: promptedBotId }).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not get bot info')\n })\n\n return fetchedBot\n }\n\n private async _manageWorkspaceHandle(\n api: ApiClient,\n integration: sdk.IntegrationDefinition\n ): Promise<sdk.IntegrationDefinition> {\n const { name: localName, workspaceHandle: localHandle } = this._parseIntegrationName(integration.name)\n if (!localHandle && api.isBotpressWorkspace) {\n this.logger.debug('Botpress workspace detected; workspace handle omitted')\n return integration // botpress has the right to omit workspace handle\n }\n\n const { handle: remoteHandle, name: workspaceName } = await api.getWorkspace().catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not fetch workspace')\n })\n\n if (localHandle && remoteHandle) {\n if (localHandle !== remoteHandle) {\n throw new errors.BotpressCLIError(\n `Your current workspace handle is \"${remoteHandle}\" but the integration handle is \"${localHandle}\".`\n )\n }\n return integration\n }\n\n const workspaceHandleIsMandatoryMsg = 'Cannot deploy integration without workspace handle'\n\n if (!localHandle && remoteHandle) {\n const confirmAddHandle = await this.prompt.confirm(\n `Your current workspace handle is \"${remoteHandle}\". Do you want to use the name \"${remoteHandle}/${localName}\"?`\n )\n if (!confirmAddHandle) {\n throw new errors.BotpressCLIError(workspaceHandleIsMandatoryMsg)\n }\n const newName = `${remoteHandle}/${localName}`\n return new sdk.IntegrationDefinition({ ...integration, name: newName })\n }\n\n if (localHandle && !remoteHandle) {\n const { available } = await api.client.checkHandleAvailability({ handle: localHandle }).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not check handle availability')\n })\n\n if (!available) {\n throw new errors.BotpressCLIError(`Handle \"${localHandle}\" is not yours and is not available`)\n }\n\n const confirmClaimHandle = await this.prompt.confirm(\n `Handle \"${localHandle}\" is available. Do you want to claim it for your workspace ${workspaceName}?`\n )\n if (!confirmClaimHandle) {\n throw new errors.BotpressCLIError(workspaceHandleIsMandatoryMsg)\n }\n\n await api.updateWorkspace({ handle: localHandle }).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not claim handle \"${localHandle}\"`)\n })\n\n this.logger.success(`Handle \"${localHandle}\" is now yours!`)\n return integration\n }\n\n this.logger.warn(\"It seems you don't have a workspace handle yet.\")\n let claimedHandle: string | undefined = undefined\n do {\n const prompted = await this.prompt.text('Please enter a workspace handle')\n if (!prompted) {\n throw new errors.BotpressCLIError(workspaceHandleIsMandatoryMsg)\n }\n\n const { available, suggestions } = await api.client.checkHandleAvailability({ handle: prompted })\n if (!available) {\n this.logger.warn(`Handle \"${prompted}\" is not available. Suggestions: ${suggestions.join(', ')}`)\n continue\n }\n\n claimedHandle = prompted\n await api.updateWorkspace({ handle: claimedHandle }).catch((thrown) => {\n throw errors.BotpressCLIError.wrap(thrown, `Could not claim handle \"${claimedHandle}\"`)\n })\n } while (!claimedHandle)\n\n this.logger.success(`Handle \"${claimedHandle}\" is yours!`)\n const newName = `${claimedHandle}/${localName}`\n return new sdk.IntegrationDefinition({ ...integration, name: newName })\n }\n\n private _parseIntegrationName = (integrationName: string): { name: string; workspaceHandle?: string } => {\n const parts = integrationName.split('/')\n if (parts.length > 2) {\n throw new errors.BotpressCLIError(\n `Invalid integration name \"${integrationName}\": a single forward slash is allowed`\n )\n }\n if (parts.length === 2) {\n const [workspaceHandle, name] = parts as [string, string]\n return { name, workspaceHandle }\n }\n const [name] = parts as [string]\n return { name }\n }\n\n private _formatInterfacesImplStatements = async (\n api: ApiClient,\n integration: sdk.IntegrationDefinition\n ): Promise<CreateIntegrationBody['interfaces']> => {\n const interfacesStatements = getImplementationStatements(integration)\n const interfaces: NonNullable<CreateIntegrationBody['interfaces']> = {}\n for (const [key, i] of Object.entries(interfacesStatements)) {\n const { name, version, entities, actions, events, channels } = i\n const id = await this._getInterfaceId(api, { id: i.id, name, version })\n interfaces[key] = { id, entities, actions, events, channels }\n }\n\n return interfaces\n }\n\n private _getInterfaceId = async (\n api: ApiClient,\n ref: { id?: string; name: string; version: string }\n ): Promise<string> => {\n if (ref.id) {\n return ref.id\n }\n const intrface = await api.findPublicInterface({ type: 'name', name: ref.name, version: ref.version })\n if (!intrface) {\n throw new errors.BotpressCLIError(`Could not find interface \"${ref.name}@${ref.version}\"`)\n }\n return intrface.id\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,UAAqB;AACrB,mBAAkB;AAClB,SAAoB;AACpB,oBAAmB;AACnB,sBAA2D;AAE3D,8BAIO;AACP,4BAA4F;AAC5F,yBAAiE;AAEjE,aAAwB;AACxB,iBAA4C;AAC5C,YAAuB;AACvB,2BAA6B;AAC7B,6BAA+B;AAGxB,MAAM,sBAAsB,sCAAwC;AAAA,EACzE,MAAa,MAAqB;AAChC,UAAM,MAAM,MAAM,KAAK,2BAA2B,KAAK,IAAI;AAE3D,QAAI,CAAC,KAAK,KAAK,SAAS;AACtB,YAAM,KAAK,UAAU;AAAA,IACvB;AAEA,UAAM,aAAa,MAAM,KAAK,4BAA4B;AAE1D,QAAI,WAAW,SAAS,eAAe;AACrC,aAAO,KAAK,mBAAmB,KAAK,WAAW,UAAU;AAAA,IAC3D;AACA,QAAI,WAAW,SAAS,aAAa;AACnC,aAAO,KAAK,iBAAiB,KAAK,WAAW,UAAU;AAAA,IACzD;AACA,QAAI,WAAW,SAAS,UAAU;AAChC,aAAO,KAAK,cAAc,KAAK,WAAW,UAAU;AAAA,IACtD;AACA,QAAI,WAAW,SAAS,OAAO;AAC7B,aAAO,KAAK,WAAW,KAAK,WAAW,YAAY,KAAK,KAAK,OAAO,KAAK,KAAK,YAAY;AAAA,IAC5F;AACA,UAAM,IAAI,OAAO,uBAAuB;AAAA,EAC1C;AAAA,EAEA,MAAc,YAAY;AACxB,WAAO,IAAI,kCAAa,KAAK,KAAK,KAAK,QAAQ,KA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