@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,69 +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 base_command_exports = {};
|
|
30
|
-
__export(base_command_exports, {
|
|
31
|
-
BaseCommand: () => BaseCommand
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(base_command_exports);
|
|
34
|
-
var errors = __toESM(require("../errors"));
|
|
35
|
-
class BaseCommand {
|
|
36
|
-
constructor(logger, argv) {
|
|
37
|
-
this.logger = logger;
|
|
38
|
-
this.argv = argv;
|
|
39
|
-
}
|
|
40
|
-
async handler() {
|
|
41
|
-
let exitCode = 0;
|
|
42
|
-
try {
|
|
43
|
-
if (this.bootstrap) {
|
|
44
|
-
await this.bootstrap();
|
|
45
|
-
}
|
|
46
|
-
await this.run();
|
|
47
|
-
} catch (thrown) {
|
|
48
|
-
const error = errors.BotpressCLIError.map(thrown);
|
|
49
|
-
if (error.debug) {
|
|
50
|
-
const msg = error.message + " (Run with verbose flag (-v) to see more details)";
|
|
51
|
-
this.logger.error(msg);
|
|
52
|
-
this.logger.debug(error.debug);
|
|
53
|
-
} else {
|
|
54
|
-
this.logger.error(error.message);
|
|
55
|
-
}
|
|
56
|
-
exitCode = 1;
|
|
57
|
-
} finally {
|
|
58
|
-
if (this.teardown) {
|
|
59
|
-
await this.teardown();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return { exitCode };
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
-
0 && (module.exports = {
|
|
67
|
-
BaseCommand
|
|
68
|
-
});
|
|
69
|
-
//# sourceMappingURL=base-command.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/command-implementations/base-command.ts"],
|
|
4
|
-
"sourcesContent": ["import * as errors from '../errors'\nimport type { Logger } from '../logger'\nimport type { CommandArgv, CommandDefinition } from '../typings'\n\nexport abstract class BaseCommand<C extends CommandDefinition> {\n public constructor(protected readonly logger: Logger, protected readonly argv: CommandArgv<C>) {}\n\n protected abstract run(): Promise<void>\n protected bootstrap?(): Promise<void>\n protected teardown?(): Promise<void>\n\n public async handler(): Promise<{ exitCode: number }> {\n let exitCode = 0\n try {\n if (this.bootstrap) {\n await this.bootstrap()\n }\n await this.run()\n } catch (thrown) {\n const error = errors.BotpressCLIError.map(thrown)\n\n if (error.debug) {\n const msg = error.message + ' (Run with verbose flag (-v) to see more details)'\n this.logger.error(msg)\n this.logger.debug(error.debug)\n } else {\n this.logger.error(error.message)\n }\n\n exitCode = 1\n } finally {\n if (this.teardown) {\n await this.teardown()\n }\n }\n\n return { exitCode }\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAwB;AAIjB,MAAe,YAAyC;AAAA,EACtD,YAA+B,QAAmC,MAAsB;AAAzD;AAAmC;AAAA,EAAuB;AAAA,EAMhG,MAAa,UAAyC;AACpD,QAAI,WAAW;AACf,QAAI;AACF,UAAI,KAAK,WAAW;AAClB,cAAM,KAAK,UAAU;AAAA,MACvB;AACA,YAAM,KAAK,IAAI;AAAA,IACjB,SAAS,QAAP;AACA,YAAM,QAAQ,OAAO,iBAAiB,IAAI,MAAM;AAEhD,UAAI,MAAM,OAAO;AACf,cAAM,MAAM,MAAM,UAAU;AAC5B,aAAK,OAAO,MAAM,GAAG;AACrB,aAAK,OAAO,MAAM,MAAM,KAAK;AAAA,MAC/B,OAAO;AACL,aAAK,OAAO,MAAM,MAAM,OAAO;AAAA,MACjC;AAEA,iBAAW;AAAA,IACb,UAAE;AACA,UAAI,KAAK,UAAU;AACjB,cAAM,KAAK,SAAS;AAAA,MACtB;AAAA,IACF;AAEA,WAAO,EAAE,SAAS;AAAA,EACpB;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,117 +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 bot_commands_exports = {};
|
|
30
|
-
__export(bot_commands_exports, {
|
|
31
|
-
CreateBotCommand: () => CreateBotCommand,
|
|
32
|
-
DeleteBotCommand: () => DeleteBotCommand,
|
|
33
|
-
GetBotCommand: () => GetBotCommand,
|
|
34
|
-
ListBotsCommand: () => ListBotsCommand
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(bot_commands_exports);
|
|
37
|
-
var import_chalk = __toESM(require("chalk"));
|
|
38
|
-
var errors = __toESM(require("../errors"));
|
|
39
|
-
var import_global_command = require("./global-command");
|
|
40
|
-
class GetBotCommand extends import_global_command.GlobalCommand {
|
|
41
|
-
async run() {
|
|
42
|
-
const { client } = await this.ensureLoginAndCreateClient(this.argv);
|
|
43
|
-
try {
|
|
44
|
-
const { bot } = await client.getBot({ id: this.argv.botRef });
|
|
45
|
-
this.logger.success(`Bot ${import_chalk.default.bold(this.argv.botRef)}:`);
|
|
46
|
-
this.logger.json(bot);
|
|
47
|
-
} catch (thrown) {
|
|
48
|
-
throw errors.BotpressCLIError.wrap(thrown, `Could not get bot ${this.argv.botRef}`);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
class ListBotsCommand extends import_global_command.GlobalCommand {
|
|
53
|
-
async run() {
|
|
54
|
-
const api = await this.ensureLoginAndCreateClient(this.argv);
|
|
55
|
-
try {
|
|
56
|
-
const { dev } = this.argv;
|
|
57
|
-
const bots = await api.listAllPages(
|
|
58
|
-
(x) => api.client.listBots({ ...x, dev }),
|
|
59
|
-
(r) => r.bots
|
|
60
|
-
);
|
|
61
|
-
this.logger.success("Bots:");
|
|
62
|
-
this.logger.json(bots);
|
|
63
|
-
} catch (thrown) {
|
|
64
|
-
throw errors.BotpressCLIError.wrap(thrown, "Could not list bots");
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
class DeleteBotCommand extends import_global_command.GlobalCommand {
|
|
69
|
-
async run() {
|
|
70
|
-
const { client } = await this.ensureLoginAndCreateClient(this.argv);
|
|
71
|
-
try {
|
|
72
|
-
await client.deleteBot({ id: this.argv.botRef });
|
|
73
|
-
this.logger.success(`Bot ${import_chalk.default.bold(this.argv.botRef)} deleted`);
|
|
74
|
-
} catch (thrown) {
|
|
75
|
-
throw errors.BotpressCLIError.wrap(thrown, `Could not delete bot ${this.argv.botRef}`);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
class CreateBotCommand extends import_global_command.GlobalCommand {
|
|
80
|
-
async run() {
|
|
81
|
-
const api = await this.ensureLoginAndCreateClient(this.argv);
|
|
82
|
-
try {
|
|
83
|
-
if (this.argv.ifNotExists) {
|
|
84
|
-
await this._getOrCreate(api, this.argv.name);
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
await this._create(api, this.argv.name);
|
|
88
|
-
} catch (thrown) {
|
|
89
|
-
throw errors.BotpressCLIError.wrap(thrown, "Could not create bot");
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
_getOrCreate = async (api, name) => {
|
|
93
|
-
if (!name) {
|
|
94
|
-
throw new errors.BotpressCLIError("option --if-not-exists requires that a name be provided");
|
|
95
|
-
}
|
|
96
|
-
const existingBot = await api.findBotByName(name);
|
|
97
|
-
if (existingBot) {
|
|
98
|
-
this.logger.success(`Bot ${import_chalk.default.bold(name)} already exists`);
|
|
99
|
-
this.logger.json(existingBot);
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
return this._create(api, name);
|
|
103
|
-
};
|
|
104
|
-
_create = async (api, name) => {
|
|
105
|
-
const { bot } = await api.client.createBot({ name });
|
|
106
|
-
this.logger.success(`Bot ${import_chalk.default.bold(bot.id)}:`);
|
|
107
|
-
this.logger.json(bot);
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
111
|
-
0 && (module.exports = {
|
|
112
|
-
CreateBotCommand,
|
|
113
|
-
DeleteBotCommand,
|
|
114
|
-
GetBotCommand,
|
|
115
|
-
ListBotsCommand
|
|
116
|
-
});
|
|
117
|
-
//# sourceMappingURL=bot-commands.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/command-implementations/bot-commands.ts"],
|
|
4
|
-
"sourcesContent": ["import chalk from 'chalk'\nimport { ApiClient } from 'src/api/client'\nimport type commandDefinitions from '../command-definitions'\nimport * as errors from '../errors'\nimport { GlobalCommand } from './global-command'\n\nexport type GetBotCommandDefinition = typeof commandDefinitions.bots.subcommands.get\nexport class GetBotCommand extends GlobalCommand<GetBotCommandDefinition> {\n public async run(): Promise<void> {\n const { client } = await this.ensureLoginAndCreateClient(this.argv)\n\n try {\n const { bot } = await client.getBot({ id: this.argv.botRef })\n this.logger.success(`Bot ${chalk.bold(this.argv.botRef)}:`)\n this.logger.json(bot)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not get bot ${this.argv.botRef}`)\n }\n }\n}\n\nexport type ListBotsCommandDefinition = typeof commandDefinitions.bots.subcommands.list\nexport class ListBotsCommand extends GlobalCommand<ListBotsCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n\n try {\n const { dev } = this.argv\n const bots = await api.listAllPages(\n (x) => api.client.listBots({ ...x, dev }),\n (r) => r.bots\n )\n this.logger.success('Bots:')\n this.logger.json(bots)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not list bots')\n }\n }\n}\n\nexport type DeleteBotCommandDefinition = typeof commandDefinitions.bots.subcommands.delete\nexport class DeleteBotCommand extends GlobalCommand<DeleteBotCommandDefinition> {\n public async run(): Promise<void> {\n const { client } = await this.ensureLoginAndCreateClient(this.argv)\n\n try {\n await client.deleteBot({ id: this.argv.botRef })\n this.logger.success(`Bot ${chalk.bold(this.argv.botRef)} deleted`)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not delete bot ${this.argv.botRef}`)\n }\n }\n}\n\nexport type CreateBotCommandDefinition = typeof commandDefinitions.bots.subcommands.create\nexport class CreateBotCommand extends GlobalCommand<CreateBotCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n\n try {\n if (this.argv.ifNotExists) {\n await this._getOrCreate(api, this.argv.name)\n return\n }\n await this._create(api, this.argv.name)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not create bot')\n }\n }\n\n private _getOrCreate = async (api: ApiClient, name: string | undefined) => {\n if (!name) {\n throw new errors.BotpressCLIError('option --if-not-exists requires that a name be provided')\n }\n const existingBot = await api.findBotByName(name)\n if (existingBot) {\n this.logger.success(`Bot ${chalk.bold(name)} already exists`)\n this.logger.json(existingBot)\n return\n }\n return this._create(api, name)\n }\n\n private _create = async (api: ApiClient, name: string | undefined) => {\n const { bot } = await api.client.createBot({ name })\n this.logger.success(`Bot ${chalk.bold(bot.id)}:`)\n this.logger.json(bot)\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAGlB,aAAwB;AACxB,4BAA8B;AAGvB,MAAM,sBAAsB,oCAAuC;AAAA,EACxE,MAAa,MAAqB;AAChC,UAAM,EAAE,OAAO,IAAI,MAAM,KAAK,2BAA2B,KAAK,IAAI;AAElE,QAAI;AACF,YAAM,EAAE,IAAI,IAAI,MAAM,OAAO,OAAO,EAAE,IAAI,KAAK,KAAK,OAAO,CAAC;AAC5D,WAAK,OAAO,QAAQ,OAAO,aAAAA,QAAM,KAAK,KAAK,KAAK,MAAM,IAAI;AAC1D,WAAK,OAAO,KAAK,GAAG;AAAA,IACtB,SAAS,QAAP;AACA,YAAM,OAAO,iBAAiB,KAAK,QAAQ,qBAAqB,KAAK,KAAK,QAAQ;AAAA,IACpF;AAAA,EACF;AACF;AAGO,MAAM,wBAAwB,oCAAyC;AAAA,EAC5E,MAAa,MAAqB;AAChC,UAAM,MAAM,MAAM,KAAK,2BAA2B,KAAK,IAAI;AAE3D,QAAI;AACF,YAAM,EAAE,IAAI,IAAI,KAAK;AACrB,YAAM,OAAO,MAAM,IAAI;AAAA,QACrB,CAAC,MAAM,IAAI,OAAO,SAAS,EAAE,GAAG,GAAG,IAAI,CAAC;AAAA,QACxC,CAAC,MAAM,EAAE;AAAA,MACX;AACA,WAAK,OAAO,QAAQ,OAAO;AAC3B,WAAK,OAAO,KAAK,IAAI;AAAA,IACvB,SAAS,QAAP;AACA,YAAM,OAAO,iBAAiB,KAAK,QAAQ,qBAAqB;AAAA,IAClE;AAAA,EACF;AACF;AAGO,MAAM,yBAAyB,oCAA0C;AAAA,EAC9E,MAAa,MAAqB;AAChC,UAAM,EAAE,OAAO,IAAI,MAAM,KAAK,2BAA2B,KAAK,IAAI;AAElE,QAAI;AACF,YAAM,OAAO,UAAU,EAAE,IAAI,KAAK,KAAK,OAAO,CAAC;AAC/C,WAAK,OAAO,QAAQ,OAAO,aAAAA,QAAM,KAAK,KAAK,KAAK,MAAM,WAAW;AAAA,IACnE,SAAS,QAAP;AACA,YAAM,OAAO,iBAAiB,KAAK,QAAQ,wBAAwB,KAAK,KAAK,QAAQ;AAAA,IACvF;AAAA,EACF;AACF;AAGO,MAAM,yBAAyB,oCAA0C;AAAA,EAC9E,MAAa,MAAqB;AAChC,UAAM,MAAM,MAAM,KAAK,2BAA2B,KAAK,IAAI;AAE3D,QAAI;AACF,UAAI,KAAK,KAAK,aAAa;AACzB,cAAM,KAAK,aAAa,KAAK,KAAK,KAAK,IAAI;AAC3C;AAAA,MACF;AACA,YAAM,KAAK,QAAQ,KAAK,KAAK,KAAK,IAAI;AAAA,IACxC,SAAS,QAAP;AACA,YAAM,OAAO,iBAAiB,KAAK,QAAQ,sBAAsB;AAAA,IACnE;AAAA,EACF;AAAA,EAEQ,eAAe,OAAO,KAAgB,SAA6B;AACzE,QAAI,CAAC,MAAM;AACT,YAAM,IAAI,OAAO,iBAAiB,yDAAyD;AAAA,IAC7F;AACA,UAAM,cAAc,MAAM,IAAI,cAAc,IAAI;AAChD,QAAI,aAAa;AACf,WAAK,OAAO,QAAQ,OAAO,aAAAA,QAAM,KAAK,IAAI,kBAAkB;AAC5D,WAAK,OAAO,KAAK,WAAW;AAC5B;AAAA,IACF;AACA,WAAO,KAAK,QAAQ,KAAK,IAAI;AAAA,EAC/B;AAAA,EAEQ,UAAU,OAAO,KAAgB,SAA6B;AACpE,UAAM,EAAE,IAAI,IAAI,MAAM,IAAI,OAAO,UAAU,EAAE,KAAK,CAAC;AACnD,SAAK,OAAO,QAAQ,OAAO,aAAAA,QAAM,KAAK,IAAI,EAAE,IAAI;AAChD,SAAK,OAAO,KAAK,GAAG;AAAA,EACtB;AACF;",
|
|
6
|
-
"names": ["chalk"]
|
|
7
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
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 build_command_exports = {};
|
|
20
|
-
__export(build_command_exports, {
|
|
21
|
-
BuildCommand: () => BuildCommand
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(build_command_exports);
|
|
24
|
-
var import_bundle_command = require("./bundle-command");
|
|
25
|
-
var import_gen_command = require("./gen-command");
|
|
26
|
-
var import_project_command = require("./project-command");
|
|
27
|
-
class BuildCommand extends import_project_command.ProjectCommand {
|
|
28
|
-
async run() {
|
|
29
|
-
const t0 = Date.now();
|
|
30
|
-
const { type: projectType, definition: integrationDef } = await this.readProjectDefinitionFromFS();
|
|
31
|
-
if (projectType === "interface") {
|
|
32
|
-
this.logger.success("Interface projects have nothing to build.");
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
if (integrationDef) {
|
|
36
|
-
await this._runGenerate();
|
|
37
|
-
}
|
|
38
|
-
await this._runBundle();
|
|
39
|
-
const dt = Date.now() - t0;
|
|
40
|
-
this.logger.log(`Build completed in ${dt}ms`);
|
|
41
|
-
}
|
|
42
|
-
_runGenerate() {
|
|
43
|
-
return new import_gen_command.GenerateCommand(this.api, this.prompt, this.logger, this.argv).run();
|
|
44
|
-
}
|
|
45
|
-
_runBundle() {
|
|
46
|
-
return new import_bundle_command.BundleCommand(this.api, this.prompt, this.logger, this.argv).run();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
-
0 && (module.exports = {
|
|
51
|
-
BuildCommand
|
|
52
|
-
});
|
|
53
|
-
//# sourceMappingURL=build-command.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/command-implementations/build-command.ts"],
|
|
4
|
-
"sourcesContent": ["import type commandDefinitions from '../command-definitions'\nimport { BundleCommand } from './bundle-command'\nimport { GenerateCommand } from './gen-command'\nimport { ProjectCommand } from './project-command'\n\nexport type BuildCommandDefinition = typeof commandDefinitions.build\nexport class BuildCommand extends ProjectCommand<BuildCommandDefinition> {\n public async run(): Promise<void> {\n const t0 = Date.now()\n const { type: projectType, definition: integrationDef } = await this.readProjectDefinitionFromFS()\n\n if (projectType === 'interface') {\n this.logger.success('Interface projects have nothing to build.')\n return\n }\n\n if (integrationDef) {\n await this._runGenerate()\n }\n\n await this._runBundle()\n const dt = Date.now() - t0\n this.logger.log(`Build completed in ${dt}ms`)\n }\n\n private _runGenerate() {\n return new GenerateCommand(this.api, this.prompt, this.logger, this.argv).run()\n }\n\n private _runBundle() {\n return new BundleCommand(this.api, this.prompt, this.logger, this.argv).run()\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,4BAA8B;AAC9B,yBAAgC;AAChC,6BAA+B;AAGxB,MAAM,qBAAqB,sCAAuC;AAAA,EACvE,MAAa,MAAqB;AAChC,UAAM,KAAK,KAAK,IAAI;AACpB,UAAM,EAAE,MAAM,aAAa,YAAY,eAAe,IAAI,MAAM,KAAK,4BAA4B;AAEjG,QAAI,gBAAgB,aAAa;AAC/B,WAAK,OAAO,QAAQ,2CAA2C;AAC/D;AAAA,IACF;AAEA,QAAI,gBAAgB;AAClB,YAAM,KAAK,aAAa;AAAA,IAC1B;AAEA,UAAM,KAAK,WAAW;AACtB,UAAM,KAAK,KAAK,IAAI,IAAI;AACxB,SAAK,OAAO,IAAI,sBAAsB,MAAM;AAAA,EAC9C;AAAA,EAEQ,eAAe;AACrB,WAAO,IAAI,mCAAgB,KAAK,KAAK,KAAK,QAAQ,KAAK,QAAQ,KAAK,IAAI,EAAE,IAAI;AAAA,EAChF;AAAA,EAEQ,aAAa;AACnB,WAAO,IAAI,oCAAc,KAAK,KAAK,KAAK,QAAQ,KAAK,QAAQ,KAAK,IAAI,EAAE,IAAI;AAAA,EAC9E;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,87 +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 bundle_command_exports = {};
|
|
30
|
-
__export(bundle_command_exports, {
|
|
31
|
-
BundleCommand: () => BundleCommand
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(bundle_command_exports);
|
|
34
|
-
var import_chalk = __toESM(require("chalk"));
|
|
35
|
-
var errors = __toESM(require("../errors"));
|
|
36
|
-
var utils = __toESM(require("../utils"));
|
|
37
|
-
var import_project_command = require("./project-command");
|
|
38
|
-
class BundleCommand extends import_project_command.ProjectCommand {
|
|
39
|
-
async run() {
|
|
40
|
-
const projectDef = await this.readProjectDefinitionFromFS();
|
|
41
|
-
if (projectDef.type === "interface") {
|
|
42
|
-
this.logger.success("Interface projects have no implementation to bundle.");
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
const line = this.logger.line();
|
|
46
|
-
if (projectDef.type === "integration") {
|
|
47
|
-
const { name } = projectDef.definition;
|
|
48
|
-
line.started(`Bundling integration ${import_chalk.default.bold(name)}...`);
|
|
49
|
-
return await this._bundle(line);
|
|
50
|
-
}
|
|
51
|
-
if (projectDef.type === "bot") {
|
|
52
|
-
line.started("Bundling bot...");
|
|
53
|
-
return await this._bundle(line);
|
|
54
|
-
}
|
|
55
|
-
if (projectDef.type === "plugin") {
|
|
56
|
-
line.started("Bundling plugin...");
|
|
57
|
-
return await this._bundle(line);
|
|
58
|
-
}
|
|
59
|
-
throw new errors.UnsupportedProjectType();
|
|
60
|
-
}
|
|
61
|
-
async _bundle(line, props = {}) {
|
|
62
|
-
const logLevel = this.argv.verbose ? "info" : "silent";
|
|
63
|
-
const abs = this.projectPaths.abs;
|
|
64
|
-
const rel = this.projectPaths.rel("workDir");
|
|
65
|
-
const unixPath = utils.path.toUnix(rel.entryPoint);
|
|
66
|
-
const importFrom = utils.path.rmExtension(unixPath);
|
|
67
|
-
const code = `import x from './${importFrom}'; export default x; export const handler = x.handler;`;
|
|
68
|
-
const outfile = abs.outFile;
|
|
69
|
-
line.debug(`Writing bundle to ${outfile}`);
|
|
70
|
-
await utils.esbuild.buildCode({
|
|
71
|
-
code,
|
|
72
|
-
cwd: abs.workDir,
|
|
73
|
-
outfile,
|
|
74
|
-
logLevel,
|
|
75
|
-
write: true,
|
|
76
|
-
sourcemap: this.argv.sourceMap,
|
|
77
|
-
minify: this.argv.minify,
|
|
78
|
-
...props
|
|
79
|
-
});
|
|
80
|
-
line.success(`Bundle available at ${import_chalk.default.grey(rel.outDir)}`);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
84
|
-
0 && (module.exports = {
|
|
85
|
-
BundleCommand
|
|
86
|
-
});
|
|
87
|
-
//# sourceMappingURL=bundle-command.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/command-implementations/bundle-command.ts"],
|
|
4
|
-
"sourcesContent": ["import chalk from 'chalk'\nimport { SingleLineLogger } from 'src/logger'\nimport type commandDefinitions from '../command-definitions'\nimport * as errors from '../errors'\nimport * as utils from '../utils'\nimport { ProjectCommand } from './project-command'\n\nexport type BundleCommandDefinition = typeof commandDefinitions.bundle\nexport class BundleCommand extends ProjectCommand<BundleCommandDefinition> {\n public async run(): Promise<void> {\n const projectDef = await this.readProjectDefinitionFromFS()\n\n if (projectDef.type === 'interface') {\n this.logger.success('Interface projects have no implementation to bundle.')\n return\n }\n\n const line = this.logger.line()\n\n if (projectDef.type === 'integration') {\n const { name } = projectDef.definition\n line.started(`Bundling integration ${chalk.bold(name)}...`)\n return await this._bundle(line)\n }\n\n if (projectDef.type === 'bot') {\n line.started('Bundling bot...')\n return await this._bundle(line)\n }\n\n if (projectDef.type === 'plugin') {\n line.started('Bundling plugin...')\n return await this._bundle(line)\n }\n\n throw new errors.UnsupportedProjectType()\n }\n\n private async _bundle(line: SingleLineLogger, props: Partial<utils.esbuild.BuildCodeProps> = {}) {\n const logLevel = this.argv.verbose ? 'info' : 'silent'\n const abs = this.projectPaths.abs\n const rel = this.projectPaths.rel('workDir')\n\n const unixPath = utils.path.toUnix(rel.entryPoint)\n const importFrom = utils.path.rmExtension(unixPath)\n const code = `import x from './${importFrom}'; export default x; export const handler = x.handler;`\n\n const outfile = abs.outFile // TODO: ensure dir exists\n line.debug(`Writing bundle to ${outfile}`)\n\n await utils.esbuild.buildCode({\n code,\n cwd: abs.workDir,\n outfile,\n logLevel,\n write: true,\n sourcemap: this.argv.sourceMap,\n minify: this.argv.minify,\n ...props,\n })\n\n line.success(`Bundle available at ${chalk.grey(rel.outDir)}`)\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAGlB,aAAwB;AACxB,YAAuB;AACvB,6BAA+B;AAGxB,MAAM,sBAAsB,sCAAwC;AAAA,EACzE,MAAa,MAAqB;AAChC,UAAM,aAAa,MAAM,KAAK,4BAA4B;AAE1D,QAAI,WAAW,SAAS,aAAa;AACnC,WAAK,OAAO,QAAQ,sDAAsD;AAC1E;AAAA,IACF;AAEA,UAAM,OAAO,KAAK,OAAO,KAAK;AAE9B,QAAI,WAAW,SAAS,eAAe;AACrC,YAAM,EAAE,KAAK,IAAI,WAAW;AAC5B,WAAK,QAAQ,wBAAwB,aAAAA,QAAM,KAAK,IAAI,MAAM;AAC1D,aAAO,MAAM,KAAK,QAAQ,IAAI;AAAA,IAChC;AAEA,QAAI,WAAW,SAAS,OAAO;AAC7B,WAAK,QAAQ,iBAAiB;AAC9B,aAAO,MAAM,KAAK,QAAQ,IAAI;AAAA,IAChC;AAEA,QAAI,WAAW,SAAS,UAAU;AAChC,WAAK,QAAQ,oBAAoB;AACjC,aAAO,MAAM,KAAK,QAAQ,IAAI;AAAA,IAChC;AAEA,UAAM,IAAI,OAAO,uBAAuB;AAAA,EAC1C;AAAA,EAEA,MAAc,QAAQ,MAAwB,QAA+C,CAAC,GAAG;AAC/F,UAAM,WAAW,KAAK,KAAK,UAAU,SAAS;AAC9C,UAAM,MAAM,KAAK,aAAa;AAC9B,UAAM,MAAM,KAAK,aAAa,IAAI,SAAS;AAE3C,UAAM,WAAW,MAAM,KAAK,OAAO,IAAI,UAAU;AACjD,UAAM,aAAa,MAAM,KAAK,YAAY,QAAQ;AAClD,UAAM,OAAO,oBAAoB;AAEjC,UAAM,UAAU,IAAI;AACpB,SAAK,MAAM,qBAAqB,SAAS;AAEzC,UAAM,MAAM,QAAQ,UAAU;AAAA,MAC5B;AAAA,MACA,KAAK,IAAI;AAAA,MACT;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP,WAAW,KAAK,KAAK;AAAA,MACrB,QAAQ,KAAK,KAAK;AAAA,MAClB,GAAG;AAAA,IACL,CAAC;AAED,SAAK,QAAQ,uBAAuB,aAAAA,QAAM,KAAK,IAAI,MAAM,GAAG;AAAA,EAC9D;AACF;",
|
|
6
|
-
"names": ["chalk"]
|
|
7
|
-
}
|