@botpress/cli 4.25.1 → 4.25.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +11 -11
- package/dist/command-implementations/bundle-command.js +5 -4
- package/dist/command-implementations/bundle-command.js.map +2 -2
- package/dist/command-implementations/integration-commands.js +4 -2
- package/dist/command-implementations/integration-commands.js.map +2 -2
- package/dist/command-implementations/interface-commands.js +4 -2
- package/dist/command-implementations/interface-commands.js.map +2 -2
- package/dist/command-implementations/plugin-commands.js +4 -2
- package/dist/command-implementations/plugin-commands.js.map +2 -2
- package/package.json +2 -2
- package/templates/empty-bot/package.json +1 -1
- package/templates/empty-integration/package.json +1 -1
- package/templates/empty-plugin/package.json +1 -1
- package/templates/hello-world/package.json +1 -1
- package/templates/webhook-message/package.json +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
|
|
2
|
-
> @botpress/cli@4.25.
|
|
2
|
+
> @botpress/cli@4.25.3 build /home/runner/work/botpress/botpress/packages/cli
|
|
3
3
|
> pnpm run build:types && pnpm run bundle && pnpm run template:gen
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @botpress/cli@4.25.
|
|
6
|
+
> @botpress/cli@4.25.3 build:types /home/runner/work/botpress/botpress/packages/cli
|
|
7
7
|
> tsc -p ./tsconfig.build.json
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
> @botpress/cli@4.25.
|
|
10
|
+
> @botpress/cli@4.25.3 bundle /home/runner/work/botpress/botpress/packages/cli
|
|
11
11
|
> ts-node -T build.ts
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
> @botpress/cli@4.25.
|
|
14
|
+
> @botpress/cli@4.25.3 template:gen /home/runner/work/botpress/botpress/packages/cli
|
|
15
15
|
> pnpm -r --stream -F @bp-templates/* exec bp gen
|
|
16
16
|
|
|
17
|
-
🤖 Botpress CLI v4.25.
|
|
18
|
-
🤖 Botpress CLI v4.25.
|
|
19
|
-
🤖 Botpress CLI v4.25.
|
|
20
|
-
🤖 Botpress CLI v4.25.
|
|
21
|
-
○ Generating typings for
|
|
17
|
+
🤖 Botpress CLI v4.25.3
|
|
18
|
+
🤖 Botpress CLI v4.25.3
|
|
19
|
+
🤖 Botpress CLI v4.25.3
|
|
20
|
+
🤖 Botpress CLI v4.25.3
|
|
21
|
+
○ Generating typings for plugin empty-plugin...
|
|
22
22
|
✓ Typings available at .botpress
|
|
23
23
|
|
|
24
24
|
○ Generating typings for integration empty-integration...
|
|
25
25
|
✓ Typings available at .botpress
|
|
26
26
|
|
|
27
|
+
○ Generating typings for integration hello-world...
|
|
27
28
|
○ Generating typings for bot...
|
|
28
29
|
✓ Typings available at .botpress
|
|
29
30
|
|
|
30
|
-
○ Generating typings for plugin empty-plugin...
|
|
31
31
|
✓ Typings available at .botpress
|
|
32
32
|
|
|
33
|
-
🤖 Botpress CLI v4.25.
|
|
33
|
+
🤖 Botpress CLI v4.25.3
|
|
34
34
|
○ Generating typings for integration webhook-message...
|
|
35
35
|
✓ Typings available at .botpress
|
|
36
36
|
|
|
@@ -52,10 +52,11 @@ class BundleCommand extends import_project_command.ProjectCommand {
|
|
|
52
52
|
line.started("Bundling bot...");
|
|
53
53
|
await this._bundle(abs.outFileCJS, buildContext);
|
|
54
54
|
} else if (projectType === "plugin") {
|
|
55
|
-
line.started("Bundling plugin
|
|
56
|
-
await
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
line.started("Bundling plugin for node and browser platforms...");
|
|
56
|
+
await Promise.all([
|
|
57
|
+
this._bundle(abs.outFileCJS, buildContext),
|
|
58
|
+
this._bundle(abs.outFileESM, buildContext, { platform: "browser", format: "esm" })
|
|
59
|
+
]);
|
|
59
60
|
} else {
|
|
60
61
|
throw new errors.UnsupportedProjectType();
|
|
61
62
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/command-implementations/bundle-command.ts"],
|
|
4
|
-
"sourcesContent": ["import chalk from 'chalk'\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(buildContext?: utils.esbuild.BuildCodeContext): Promise<void> {\n const { projectType, resolveProjectDefinition } = this.readProjectDefinitionFromFS()\n\n const abs = this.projectPaths.abs\n const rel = this.projectPaths.rel('workDir')\n const line = this.logger.line()\n\n if (projectType === 'interface') {\n this.logger.success('Interface projects have no implementation to bundle.')\n } else if (projectType === 'integration') {\n const projectDef = await resolveProjectDefinition()\n const { name, __advanced } = projectDef.definition\n line.started(`Bundling integration ${chalk.bold(name)}...`)\n await this._bundle(abs.outFileCJS, buildContext, __advanced?.esbuild ?? {})\n } else if (projectType === 'bot') {\n line.started('Bundling bot...')\n await this._bundle(abs.outFileCJS, buildContext)\n } else if (projectType === 'plugin') {\n line.started('Bundling plugin
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAElB,aAAwB;AACxB,YAAuB;AACvB,6BAA+B;AAGxB,MAAM,sBAAsB,sCAAwC;AAAA,EACzE,MAAa,IAAI,cAA8D;AAC7E,UAAM,EAAE,aAAa,yBAAyB,IAAI,KAAK,4BAA4B;AAEnF,UAAM,MAAM,KAAK,aAAa;AAC9B,UAAM,MAAM,KAAK,aAAa,IAAI,SAAS;AAC3C,UAAM,OAAO,KAAK,OAAO,KAAK;AAE9B,QAAI,gBAAgB,aAAa;AAC/B,WAAK,OAAO,QAAQ,sDAAsD;AAAA,IAC5E,WAAW,gBAAgB,eAAe;AACxC,YAAM,aAAa,MAAM,yBAAyB;AAClD,YAAM,EAAE,MAAM,WAAW,IAAI,WAAW;AACxC,WAAK,QAAQ,wBAAwB,aAAAA,QAAM,KAAK,IAAI,CAAC,KAAK;AAC1D,YAAM,KAAK,QAAQ,IAAI,YAAY,cAAc,YAAY,WAAW,CAAC,CAAC;AAAA,IAC5E,WAAW,gBAAgB,OAAO;AAChC,WAAK,QAAQ,iBAAiB;AAC9B,YAAM,KAAK,QAAQ,IAAI,YAAY,YAAY;AAAA,IACjD,WAAW,gBAAgB,UAAU;AACnC,WAAK,QAAQ,
|
|
4
|
+
"sourcesContent": ["import chalk from 'chalk'\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(buildContext?: utils.esbuild.BuildCodeContext): Promise<void> {\n const { projectType, resolveProjectDefinition } = this.readProjectDefinitionFromFS()\n\n const abs = this.projectPaths.abs\n const rel = this.projectPaths.rel('workDir')\n const line = this.logger.line()\n\n if (projectType === 'interface') {\n this.logger.success('Interface projects have no implementation to bundle.')\n } else if (projectType === 'integration') {\n const projectDef = await resolveProjectDefinition()\n const { name, __advanced } = projectDef.definition\n line.started(`Bundling integration ${chalk.bold(name)}...`)\n await this._bundle(abs.outFileCJS, buildContext, __advanced?.esbuild ?? {})\n } else if (projectType === 'bot') {\n line.started('Bundling bot...')\n await this._bundle(abs.outFileCJS, buildContext)\n } else if (projectType === 'plugin') {\n line.started('Bundling plugin for node and browser platforms...')\n await Promise.all([\n this._bundle(abs.outFileCJS, buildContext),\n this._bundle(abs.outFileESM, buildContext, { platform: 'browser', format: 'esm' }),\n ])\n } else {\n throw new errors.UnsupportedProjectType()\n }\n\n line.success(`Bundle available at ${chalk.grey(rel.outDir)}`)\n }\n\n private async _bundle(\n outfile: string,\n buildContext?: utils.esbuild.BuildCodeContext,\n props: Partial<utils.esbuild.BuildOptions> = {}\n ) {\n const abs = this.projectPaths.abs\n const context = buildContext ?? new utils.esbuild.BuildCodeContext()\n await context.rebuild(\n {\n outfile,\n absWorkingDir: abs.workDir,\n code: this._code,\n },\n {\n ...this._buildOptions,\n ...props,\n }\n )\n }\n\n private get _code() {\n const rel = this.projectPaths.rel('workDir')\n const unixPath = utils.path.toUnix(rel.entryPoint)\n const importFrom = utils.path.rmExtension(unixPath)\n return `import x from './${importFrom}'; export default x; export const handler = x.handler;`\n }\n\n private get _buildOptions(): Partial<utils.esbuild.BuildOptions> {\n return {\n logLevel: this.argv.verbose ? 'info' : 'silent',\n sourcemap: this.argv.sourceMap,\n minify: this.argv.minify,\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAElB,aAAwB;AACxB,YAAuB;AACvB,6BAA+B;AAGxB,MAAM,sBAAsB,sCAAwC;AAAA,EACzE,MAAa,IAAI,cAA8D;AAC7E,UAAM,EAAE,aAAa,yBAAyB,IAAI,KAAK,4BAA4B;AAEnF,UAAM,MAAM,KAAK,aAAa;AAC9B,UAAM,MAAM,KAAK,aAAa,IAAI,SAAS;AAC3C,UAAM,OAAO,KAAK,OAAO,KAAK;AAE9B,QAAI,gBAAgB,aAAa;AAC/B,WAAK,OAAO,QAAQ,sDAAsD;AAAA,IAC5E,WAAW,gBAAgB,eAAe;AACxC,YAAM,aAAa,MAAM,yBAAyB;AAClD,YAAM,EAAE,MAAM,WAAW,IAAI,WAAW;AACxC,WAAK,QAAQ,wBAAwB,aAAAA,QAAM,KAAK,IAAI,CAAC,KAAK;AAC1D,YAAM,KAAK,QAAQ,IAAI,YAAY,cAAc,YAAY,WAAW,CAAC,CAAC;AAAA,IAC5E,WAAW,gBAAgB,OAAO;AAChC,WAAK,QAAQ,iBAAiB;AAC9B,YAAM,KAAK,QAAQ,IAAI,YAAY,YAAY;AAAA,IACjD,WAAW,gBAAgB,UAAU;AACnC,WAAK,QAAQ,mDAAmD;AAChE,YAAM,QAAQ,IAAI;AAAA,QAChB,KAAK,QAAQ,IAAI,YAAY,YAAY;AAAA,QACzC,KAAK,QAAQ,IAAI,YAAY,cAAc,EAAE,UAAU,WAAW,QAAQ,MAAM,CAAC;AAAA,MACnF,CAAC;AAAA,IACH,OAAO;AACL,YAAM,IAAI,OAAO,uBAAuB;AAAA,IAC1C;AAEA,SAAK,QAAQ,uBAAuB,aAAAA,QAAM,KAAK,IAAI,MAAM,CAAC,EAAE;AAAA,EAC9D;AAAA,EAEA,MAAc,QACZ,SACA,cACA,QAA6C,CAAC,GAC9C;AACA,UAAM,MAAM,KAAK,aAAa;AAC9B,UAAM,UAAU,gBAAgB,IAAI,MAAM,QAAQ,iBAAiB;AACnE,UAAM,QAAQ;AAAA,MACZ;AAAA,QACE;AAAA,QACA,eAAe,IAAI;AAAA,QACnB,MAAM,KAAK;AAAA,MACb;AAAA,MACA;AAAA,QACE,GAAG,KAAK;AAAA,QACR,GAAG;AAAA,MACL;AAAA,IACF;AAAA,EACF;AAAA,EAEA,IAAY,QAAQ;AAClB,UAAM,MAAM,KAAK,aAAa,IAAI,SAAS;AAC3C,UAAM,WAAW,MAAM,KAAK,OAAO,IAAI,UAAU;AACjD,UAAM,aAAa,MAAM,KAAK,YAAY,QAAQ;AAClD,WAAO,oBAAoB,UAAU;AAAA,EACvC;AAAA,EAEA,IAAY,gBAAqD;AAC/D,WAAO;AAAA,MACL,UAAU,KAAK,KAAK,UAAU,SAAS;AAAA,MACvC,WAAW,KAAK,KAAK;AAAA,MACrB,QAAQ,KAAK,KAAK;AAAA,IACpB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["chalk"]
|
|
7
7
|
}
|
|
@@ -69,8 +69,10 @@ class ListIntegrationsCommand extends import_global_command.GlobalCommand {
|
|
|
69
69
|
const dummyLister = async () => ({ integrations: [], meta: {} });
|
|
70
70
|
const publicLister = dev ? dummyLister : (req) => api.client.listPublicIntegrations({ nextToken: req.nextToken, name, version });
|
|
71
71
|
try {
|
|
72
|
-
const privateIntegrations = await
|
|
73
|
-
|
|
72
|
+
const [privateIntegrations, publicIntegrations] = await Promise.all([
|
|
73
|
+
api.listAllPages(privateLister, (r) => r.integrations),
|
|
74
|
+
api.listAllPages(publicLister, (r) => r.integrations)
|
|
75
|
+
]);
|
|
74
76
|
const integrations = import_lodash.default.uniqBy([...privateIntegrations, ...publicIntegrations], (i) => i.id);
|
|
75
77
|
this.logger.success("Integrations:");
|
|
76
78
|
this.logger.json(integrations);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/command-implementations/integration-commands.ts"],
|
|
4
|
-
"sourcesContent": ["import chalk from 'chalk'\nimport _ from 'lodash'\nimport { ApiClient, PublicOrPrivateIntegration } from 'src/api/client'\nimport type commandDefinitions from '../command-definitions'\nimport * as errors from '../errors'\nimport { NamePackageRef, parsePackageRef } from '../package-ref'\nimport { GlobalCommand } from './global-command'\n\nexport type GetIntegrationCommandDefinition = typeof commandDefinitions.integrations.subcommands.get\nexport class GetIntegrationCommand extends GlobalCommand<GetIntegrationCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n const parsedRef = parsePackageRef(this.argv.integrationRef)\n if (!parsedRef) {\n throw new errors.InvalidPackageReferenceError(this.argv.integrationRef)\n }\n if (parsedRef.type === 'path') {\n throw new errors.BotpressCLIError('Cannot get local integration')\n }\n\n try {\n const integration = await api.findPublicOrPrivateIntegration(parsedRef)\n if (integration) {\n this.logger.success(`Integration ${chalk.bold(this.argv.integrationRef)}:`)\n this.logger.json(integration)\n return\n }\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not get integration ${this.argv.integrationRef}`)\n }\n\n throw new errors.BotpressCLIError(`Integration ${this.argv.integrationRef} not found`)\n }\n}\n\nexport type ListIntegrationsCommandDefinition = typeof commandDefinitions.integrations.subcommands.list\nexport class ListIntegrationsCommand extends GlobalCommand<ListIntegrationsCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n\n const { dev, name, versionNumber: version } = this.argv\n\n const privateLister = (req: { nextToken?: string }) =>\n api.client.listIntegrations({ nextToken: req.nextToken, dev, name, version })\n\n const dummyLister: typeof privateLister = async () => ({ integrations: [], meta: {} })\n const publicLister = dev\n ? dummyLister\n : (req: { nextToken?: string }) => api.client.listPublicIntegrations({ nextToken: req.nextToken, name, version })\n\n try {\n const privateIntegrations = await api.listAllPages(privateLister, (r) => r.integrations)
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,oBAAc;AAGd,aAAwB;AACxB,yBAAgD;AAChD,4BAA8B;AAGvB,MAAM,8BAA8B,oCAA+C;AAAA,EACxF,MAAa,MAAqB;AAChC,UAAM,MAAM,MAAM,KAAK,2BAA2B,KAAK,IAAI;AAC3D,UAAM,gBAAY,oCAAgB,KAAK,KAAK,cAAc;AAC1D,QAAI,CAAC,WAAW;AACd,YAAM,IAAI,OAAO,6BAA6B,KAAK,KAAK,cAAc;AAAA,IACxE;AACA,QAAI,UAAU,SAAS,QAAQ;AAC7B,YAAM,IAAI,OAAO,iBAAiB,8BAA8B;AAAA,IAClE;AAEA,QAAI;AACF,YAAM,cAAc,MAAM,IAAI,+BAA+B,SAAS;AACtE,UAAI,aAAa;AACf,aAAK,OAAO,QAAQ,eAAe,aAAAA,QAAM,KAAK,KAAK,KAAK,cAAc,CAAC,GAAG;AAC1E,aAAK,OAAO,KAAK,WAAW;AAC5B;AAAA,MACF;AAAA,IACF,SAAS,QAAQ;AACf,YAAM,OAAO,iBAAiB,KAAK,QAAQ,6BAA6B,KAAK,KAAK,cAAc,EAAE;AAAA,IACpG;AAEA,UAAM,IAAI,OAAO,iBAAiB,eAAe,KAAK,KAAK,cAAc,YAAY;AAAA,EACvF;AACF;AAGO,MAAM,gCAAgC,oCAAiD;AAAA,EAC5F,MAAa,MAAqB;AAChC,UAAM,MAAM,MAAM,KAAK,2BAA2B,KAAK,IAAI;AAE3D,UAAM,EAAE,KAAK,MAAM,eAAe,QAAQ,IAAI,KAAK;AAEnD,UAAM,gBAAgB,CAAC,QACrB,IAAI,OAAO,iBAAiB,EAAE,WAAW,IAAI,WAAW,KAAK,MAAM,QAAQ,CAAC;AAE9E,UAAM,cAAoC,aAAa,EAAE,cAAc,CAAC,GAAG,MAAM,CAAC,EAAE;AACpF,UAAM,eAAe,MACjB,cACA,CAAC,QAAgC,IAAI,OAAO,uBAAuB,EAAE,WAAW,IAAI,WAAW,MAAM,QAAQ,CAAC;AAElH,QAAI;AACF,YAAM,
|
|
4
|
+
"sourcesContent": ["import chalk from 'chalk'\nimport _ from 'lodash'\nimport { ApiClient, PublicOrPrivateIntegration } from 'src/api/client'\nimport type commandDefinitions from '../command-definitions'\nimport * as errors from '../errors'\nimport { NamePackageRef, parsePackageRef } from '../package-ref'\nimport { GlobalCommand } from './global-command'\n\nexport type GetIntegrationCommandDefinition = typeof commandDefinitions.integrations.subcommands.get\nexport class GetIntegrationCommand extends GlobalCommand<GetIntegrationCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n const parsedRef = parsePackageRef(this.argv.integrationRef)\n if (!parsedRef) {\n throw new errors.InvalidPackageReferenceError(this.argv.integrationRef)\n }\n if (parsedRef.type === 'path') {\n throw new errors.BotpressCLIError('Cannot get local integration')\n }\n\n try {\n const integration = await api.findPublicOrPrivateIntegration(parsedRef)\n if (integration) {\n this.logger.success(`Integration ${chalk.bold(this.argv.integrationRef)}:`)\n this.logger.json(integration)\n return\n }\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not get integration ${this.argv.integrationRef}`)\n }\n\n throw new errors.BotpressCLIError(`Integration ${this.argv.integrationRef} not found`)\n }\n}\n\nexport type ListIntegrationsCommandDefinition = typeof commandDefinitions.integrations.subcommands.list\nexport class ListIntegrationsCommand extends GlobalCommand<ListIntegrationsCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n\n const { dev, name, versionNumber: version } = this.argv\n\n const privateLister = (req: { nextToken?: string }) =>\n api.client.listIntegrations({ nextToken: req.nextToken, dev, name, version })\n\n const dummyLister: typeof privateLister = async () => ({ integrations: [], meta: {} })\n const publicLister = dev\n ? dummyLister\n : (req: { nextToken?: string }) => api.client.listPublicIntegrations({ nextToken: req.nextToken, name, version })\n\n try {\n const [privateIntegrations, publicIntegrations] = await Promise.all([\n api.listAllPages(privateLister, (r) => r.integrations),\n api.listAllPages(publicLister, (r) => r.integrations),\n ])\n const integrations = _.uniqBy([...privateIntegrations, ...publicIntegrations], (i) => i.id)\n\n this.logger.success('Integrations:')\n this.logger.json(integrations)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not list integrations')\n }\n }\n}\n\nexport type DeleteIntegrationCommandDefinition = typeof commandDefinitions.integrations.subcommands.delete\nexport class DeleteIntegrationCommand extends GlobalCommand<DeleteIntegrationCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n const parsedRef = parsePackageRef(this.argv.integrationRef)\n if (!parsedRef) {\n throw new errors.InvalidPackageReferenceError(this.argv.integrationRef)\n }\n if (parsedRef.type === 'path') {\n throw new errors.BotpressCLIError('Cannot delete local integration')\n }\n\n let integrationId: string | undefined\n if (parsedRef.type === 'id') {\n integrationId = parsedRef.id\n } else {\n const integration = await this._findIntegration(api, parsedRef)\n integrationId = integration.id\n }\n\n try {\n await api.client.deleteIntegration({ id: integrationId })\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not delete integration ${this.argv.integrationRef}`)\n }\n\n this.logger.success(`Integration ${chalk.bold(this.argv.integrationRef)} deleted`)\n return\n }\n\n private _findIntegration = async (api: ApiClient, parsedRef: NamePackageRef) => {\n let integration: PublicOrPrivateIntegration | undefined\n\n try {\n integration = await api.findPrivateIntegration(parsedRef)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not get integration ${this.argv.integrationRef}`)\n }\n\n if (!integration) {\n const publicIntegration = await api.findPublicIntegration(parsedRef)\n if (publicIntegration) {\n throw new errors.BotpressCLIError(`Integration ${this.argv.integrationRef} does not belong to your workspace`)\n }\n\n throw new errors.BotpressCLIError(`Integration ${this.argv.integrationRef} not found`)\n }\n\n return integration\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,oBAAc;AAGd,aAAwB;AACxB,yBAAgD;AAChD,4BAA8B;AAGvB,MAAM,8BAA8B,oCAA+C;AAAA,EACxF,MAAa,MAAqB;AAChC,UAAM,MAAM,MAAM,KAAK,2BAA2B,KAAK,IAAI;AAC3D,UAAM,gBAAY,oCAAgB,KAAK,KAAK,cAAc;AAC1D,QAAI,CAAC,WAAW;AACd,YAAM,IAAI,OAAO,6BAA6B,KAAK,KAAK,cAAc;AAAA,IACxE;AACA,QAAI,UAAU,SAAS,QAAQ;AAC7B,YAAM,IAAI,OAAO,iBAAiB,8BAA8B;AAAA,IAClE;AAEA,QAAI;AACF,YAAM,cAAc,MAAM,IAAI,+BAA+B,SAAS;AACtE,UAAI,aAAa;AACf,aAAK,OAAO,QAAQ,eAAe,aAAAA,QAAM,KAAK,KAAK,KAAK,cAAc,CAAC,GAAG;AAC1E,aAAK,OAAO,KAAK,WAAW;AAC5B;AAAA,MACF;AAAA,IACF,SAAS,QAAQ;AACf,YAAM,OAAO,iBAAiB,KAAK,QAAQ,6BAA6B,KAAK,KAAK,cAAc,EAAE;AAAA,IACpG;AAEA,UAAM,IAAI,OAAO,iBAAiB,eAAe,KAAK,KAAK,cAAc,YAAY;AAAA,EACvF;AACF;AAGO,MAAM,gCAAgC,oCAAiD;AAAA,EAC5F,MAAa,MAAqB;AAChC,UAAM,MAAM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OAAO;AACL,YAAM,cAAc,MAAM,KAAK,iBAAiB,KAAK,SAAS;AAC9D,sBAAgB,YAAY;AAAA,IAC9B;AAEA,QAAI;AACF,YAAM,IAAI,OAAO,kBAAkB,EAAE,IAAI,cAAc,CAAC;AAAA,IAC1D,SAAS,QAAQ;AACf,YAAM,OAAO,iBAAiB,KAAK,QAAQ,gCAAgC,KAAK,KAAK,cAAc,EAAE;AAAA,IACvG;AAEA,SAAK,OAAO,QAAQ,eAAe,aAAAD,QAAM,KAAK,KAAK,KAAK,cAAc,CAAC,UAAU;AACjF;AAAA,EACF;AAAA,EAEQ,mBAAmB,OAAO,KAAgB,cAA8B;AAC9E,QAAI;AAEJ,QAAI;AACF,oBAAc,MAAM,IAAI,uBAAuB,SAAS;AAAA,IAC1D,SAAS,QAAQ;AACf,YAAM,OAAO,iBAAiB,KAAK,QAAQ,6BAA6B,KAAK,KAAK,cAAc,EAAE;AAAA,IACpG;AAEA,QAAI,CAAC,aAAa;AAChB,YAAM,oBAAoB,MAAM,IAAI,sBAAsB,SAAS;AACnE,UAAI,mBAAmB;AACrB,cAAM,IAAI,OAAO,iBAAiB,eAAe,KAAK,KAAK,cAAc,oCAAoC;AAAA,MAC/G;AAEA,YAAM,IAAI,OAAO,iBAAiB,eAAe,KAAK,KAAK,cAAc,YAAY;AAAA,IACvF;AAEA,WAAO;AAAA,EACT;AACF;",
|
|
6
6
|
"names": ["chalk", "_"]
|
|
7
7
|
}
|
|
@@ -67,8 +67,10 @@ class ListInterfacesCommand extends import_global_command.GlobalCommand {
|
|
|
67
67
|
const privateLister = (req) => api.client.listInterfaces({ nextToken: req.nextToken });
|
|
68
68
|
const publicLister = (req) => api.client.listPublicInterfaces({ nextToken: req.nextToken });
|
|
69
69
|
try {
|
|
70
|
-
const privateInterfaces = await
|
|
71
|
-
|
|
70
|
+
const [privateInterfaces, publicInterfaces] = await Promise.all([
|
|
71
|
+
api.listAllPages(privateLister, (r) => r.interfaces),
|
|
72
|
+
api.listAllPages(publicLister, (r) => r.interfaces)
|
|
73
|
+
]);
|
|
72
74
|
const interfaces = import_lodash.default.uniqBy([...privateInterfaces, ...publicInterfaces], (i) => i.id);
|
|
73
75
|
this.logger.success("Interfaces:");
|
|
74
76
|
this.logger.json(interfaces);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/command-implementations/interface-commands.ts"],
|
|
4
|
-
"sourcesContent": ["import type * as client from '@botpress/client'\nimport chalk from 'chalk'\nimport _ from 'lodash'\nimport type commandDefinitions from '../command-definitions'\nimport * as errors from '../errors'\nimport { parsePackageRef } from '../package-ref'\nimport { GlobalCommand } from './global-command'\n\nexport type GetInterfaceCommandDefinition = typeof commandDefinitions.interfaces.subcommands.get\nexport class GetInterfaceCommand extends GlobalCommand<GetInterfaceCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n const parsedRef = parsePackageRef(this.argv.interfaceRef)\n if (!parsedRef) {\n throw new errors.InvalidPackageReferenceError(this.argv.interfaceRef)\n }\n if (parsedRef.type === 'path') {\n throw new errors.BotpressCLIError('Cannot get local interface')\n }\n\n try {\n const intrface = await api.findPublicOrPrivateInterface(parsedRef)\n if (intrface) {\n this.logger.success(`Interface ${chalk.bold(this.argv.interfaceRef)}:`)\n this.logger.json(intrface)\n return\n }\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not get interface ${this.argv.interfaceRef}`)\n }\n\n throw new errors.BotpressCLIError(`Interface ${this.argv.interfaceRef} not found`)\n }\n}\n\nexport type ListInterfacesCommandDefinition = typeof commandDefinitions.interfaces.subcommands.list\nexport class ListInterfacesCommand extends GlobalCommand<ListInterfacesCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n\n const privateLister = (req: { nextToken?: string }) => api.client.listInterfaces({ nextToken: req.nextToken })\n const publicLister = (req: { nextToken?: string }) => api.client.listPublicIn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ACF,YAAM,
|
|
4
|
+
"sourcesContent": ["import type * as client from '@botpress/client'\nimport chalk from 'chalk'\nimport _ from 'lodash'\nimport type commandDefinitions from '../command-definitions'\nimport * as errors from '../errors'\nimport { parsePackageRef } from '../package-ref'\nimport { GlobalCommand } from './global-command'\n\nexport type GetInterfaceCommandDefinition = typeof commandDefinitions.interfaces.subcommands.get\nexport class GetInterfaceCommand extends GlobalCommand<GetInterfaceCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n const parsedRef = parsePackageRef(this.argv.interfaceRef)\n if (!parsedRef) {\n throw new errors.InvalidPackageReferenceError(this.argv.interfaceRef)\n }\n if (parsedRef.type === 'path') {\n throw new errors.BotpressCLIError('Cannot get local interface')\n }\n\n try {\n const intrface = await api.findPublicOrPrivateInterface(parsedRef)\n if (intrface) {\n this.logger.success(`Interface ${chalk.bold(this.argv.interfaceRef)}:`)\n this.logger.json(intrface)\n return\n }\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not get interface ${this.argv.interfaceRef}`)\n }\n\n throw new errors.BotpressCLIError(`Interface ${this.argv.interfaceRef} not found`)\n }\n}\n\nexport type ListInterfacesCommandDefinition = typeof commandDefinitions.interfaces.subcommands.list\nexport class ListInterfacesCommand extends GlobalCommand<ListInterfacesCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n\n const privateLister = (req: { nextToken?: string }) => api.client.listInterfaces({ nextToken: req.nextToken })\n const publicLister = (req: { nextToken?: string }) => api.client.listPublicInterfaces({ nextToken: req.nextToken })\n\n try {\n const [privateInterfaces, publicInterfaces] = await Promise.all([\n api.listAllPages(privateLister, (r) => r.interfaces),\n api.listAllPages(publicLister, (r) => r.interfaces),\n ])\n const interfaces = _.uniqBy([...privateInterfaces, ...publicInterfaces], (i) => i.id)\n\n this.logger.success('Interfaces:')\n this.logger.json(interfaces)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not list interfaces')\n }\n }\n}\n\nexport type DeleteInterfaceCommandDefinition = typeof commandDefinitions.interfaces.subcommands.delete\nexport class DeleteInterfaceCommand extends GlobalCommand<DeleteInterfaceCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n const parsedRef = parsePackageRef(this.argv.interfaceRef)\n if (!parsedRef) {\n throw new errors.InvalidPackageReferenceError(this.argv.interfaceRef)\n }\n if (parsedRef.type === 'path') {\n throw new errors.BotpressCLIError('Cannot delete local interface')\n }\n\n let intrface: client.Interface | undefined\n try {\n intrface = await api.findPublicOrPrivateInterface(parsedRef)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not get interface ${this.argv.interfaceRef}`)\n }\n\n if (!intrface) {\n throw new errors.BotpressCLIError(`Interface ${this.argv.interfaceRef} not found`)\n }\n\n try {\n await api.client.deleteInterface({ id: intrface.id })\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not delete interface ${this.argv.interfaceRef}`)\n }\n\n this.logger.success(`Interface ${chalk.bold(this.argv.interfaceRef)} deleted`)\n return\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,oBAAc;AAEd,aAAwB;AACxB,yBAAgC;AAChC,4BAA8B;AAGvB,MAAM,4BAA4B,oCAA6C;AAAA,EACpF,MAAa,MAAqB;AAChC,UAAM,MAAM,MAAM,KAAK,2BAA2B,KAAK,IAAI;AAC3D,UAAM,gBAAY,oCAAgB,KAAK,KAAK,YAAY;AACxD,QAAI,CAAC,WAAW;AACd,YAAM,IAAI,OAAO,6BAA6B,KAAK,KAAK,YAAY;AAAA,IACtE;AACA,QAAI,UAAU,SAAS,QAAQ;AAC7B,YAAM,IAAI,OAAO,iBAAiB,4BAA4B;AAAA,IAChE;AAEA,QAAI;AACF,YAAM,WAAW,MAA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AAK,YAAY;AACxD,QAAI,CAAC,WAAW;AACd,YAAM,IAAI,OAAO,6BAA6B,KAAK,KAAK,YAAY;AAAA,IACtE;AACA,QAAI,UAAU,SAAS,QAAQ;AAC7B,YAAM,IAAI,OAAO,iBAAiB,+BAA+B;AAAA,IACnE;AAEA,QAAI;AACJ,QAAI;AACF,iBAAW,MAAM,IAAI,6BAA6B,SAAS;AAAA,IAC7D,SAAS,QAAQ;AACf,YAAM,OAAO,iBAAiB,KAAK,QAAQ,2BAA2B,KAAK,KAAK,YAAY,EAAE;AAAA,IAChG;AAEA,QAAI,CAAC,UAAU;AACb,YAAM,IAAI,OAAO,iBAAiB,aAAa,KAAK,KAAK,YAAY,YAAY;AAAA,IACnF;AAEA,QAAI;AACF,YAAM,IAAI,OAAO,gBAAgB,EAAE,IAAI,SAAS,GAAG,CAAC;AAAA,IACtD,SAAS,QAAQ;AACf,YAAM,OAAO,iBAAiB,KAAK,QAAQ,8BAA8B,KAAK,KAAK,YAAY,EAAE;AAAA,IACnG;AAEA,SAAK,OAAO,QAAQ,aAAa,aAAAD,QAAM,KAAK,KAAK,KAAK,YAAY,CAAC,UAAU;AAC7E;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["chalk", "_"]
|
|
7
7
|
}
|
|
@@ -68,8 +68,10 @@ class ListPluginsCommand extends import_global_command.GlobalCommand {
|
|
|
68
68
|
const privateLister = (req) => api.client.listPlugins({ nextToken: req.nextToken, name, version });
|
|
69
69
|
const publicLister = (req) => api.client.listPublicPlugins({ nextToken: req.nextToken, name, version });
|
|
70
70
|
try {
|
|
71
|
-
const privatePlugins = await
|
|
72
|
-
|
|
71
|
+
const [privatePlugins, publicPlugins] = await Promise.all([
|
|
72
|
+
api.listAllPages(privateLister, (r) => r.plugins),
|
|
73
|
+
api.listAllPages(publicLister, (r) => r.plugins)
|
|
74
|
+
]);
|
|
73
75
|
const plugins = import_lodash.default.uniqBy([...privatePlugins, ...publicPlugins], (p) => p.id);
|
|
74
76
|
this.logger.success("Plugins:");
|
|
75
77
|
this.logger.json(plugins);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/command-implementations/plugin-commands.ts"],
|
|
4
|
-
"sourcesContent": ["import type * as client from '@botpress/client'\nimport chalk from 'chalk'\nimport _ from 'lodash'\nimport type commandDefinitions from '../command-definitions'\nimport * as errors from '../errors'\nimport { parsePackageRef } from '../package-ref'\nimport { GlobalCommand } from './global-command'\n\nexport type GetPluginCommandDefinition = typeof commandDefinitions.plugins.subcommands.get\nexport class GetPluginCommand extends GlobalCommand<GetPluginCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n const parsedRef = parsePackageRef(this.argv.pluginRef)\n if (!parsedRef) {\n throw new errors.InvalidPackageReferenceError(this.argv.pluginRef)\n }\n if (parsedRef.type === 'path') {\n throw new errors.BotpressCLIError('Cannot get local plugin')\n }\n\n try {\n const plugin = await api.findPublicOrPrivatePlugin(parsedRef)\n if (plugin) {\n this.logger.success(`Plugin ${chalk.bold(this.argv.pluginRef)}:`)\n this.logger.json(plugin)\n return\n }\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not get plugin ${this.argv.pluginRef}`)\n }\n\n throw new errors.BotpressCLIError(`Plugin ${this.argv.pluginRef} not found`)\n }\n}\n\nexport type ListPluginsCommandDefinition = typeof commandDefinitions.plugins.subcommands.list\nexport class ListPluginsCommand extends GlobalCommand<ListPluginsCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n\n const { name, versionNumber: version } = this.argv\n\n const privateLister = (req: { nextToken?: string }) =>\n api.client.listPlugins({ nextToken: req.nextToken, name, version })\n const publicLister = (req: { nextToken?: string }) =>\n api.client.listPublicPlugins({ nextToken: req.nextToken, name, version })\n\n try {\n const privatePlugins = await api.listAllPages(privateLister, (r) => r.plugins)
|
|
5
|
-
"mappings": ";;;;;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
+
"sourcesContent": ["import type * as client from '@botpress/client'\nimport chalk from 'chalk'\nimport _ from 'lodash'\nimport type commandDefinitions from '../command-definitions'\nimport * as errors from '../errors'\nimport { parsePackageRef } from '../package-ref'\nimport { GlobalCommand } from './global-command'\n\nexport type GetPluginCommandDefinition = typeof commandDefinitions.plugins.subcommands.get\nexport class GetPluginCommand extends GlobalCommand<GetPluginCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n const parsedRef = parsePackageRef(this.argv.pluginRef)\n if (!parsedRef) {\n throw new errors.InvalidPackageReferenceError(this.argv.pluginRef)\n }\n if (parsedRef.type === 'path') {\n throw new errors.BotpressCLIError('Cannot get local plugin')\n }\n\n try {\n const plugin = await api.findPublicOrPrivatePlugin(parsedRef)\n if (plugin) {\n this.logger.success(`Plugin ${chalk.bold(this.argv.pluginRef)}:`)\n this.logger.json(plugin)\n return\n }\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not get plugin ${this.argv.pluginRef}`)\n }\n\n throw new errors.BotpressCLIError(`Plugin ${this.argv.pluginRef} not found`)\n }\n}\n\nexport type ListPluginsCommandDefinition = typeof commandDefinitions.plugins.subcommands.list\nexport class ListPluginsCommand extends GlobalCommand<ListPluginsCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n\n const { name, versionNumber: version } = this.argv\n\n const privateLister = (req: { nextToken?: string }) =>\n api.client.listPlugins({ nextToken: req.nextToken, name, version })\n const publicLister = (req: { nextToken?: string }) =>\n api.client.listPublicPlugins({ nextToken: req.nextToken, name, version })\n\n try {\n const [privatePlugins, publicPlugins] = await Promise.all([\n api.listAllPages(privateLister, (r) => r.plugins),\n api.listAllPages(publicLister, (r) => r.plugins),\n ])\n const plugins = _.uniqBy([...privatePlugins, ...publicPlugins], (p) => p.id)\n\n this.logger.success('Plugins:')\n this.logger.json(plugins)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, 'Could not list plugins')\n }\n }\n}\n\nexport type DeletePluginCommandDefinition = typeof commandDefinitions.plugins.subcommands.delete\nexport class DeletePluginCommand extends GlobalCommand<DeletePluginCommandDefinition> {\n public async run(): Promise<void> {\n const api = await this.ensureLoginAndCreateClient(this.argv)\n const parsedRef = parsePackageRef(this.argv.pluginRef)\n if (!parsedRef) {\n throw new errors.InvalidPackageReferenceError(this.argv.pluginRef)\n }\n if (parsedRef.type === 'path') {\n throw new errors.BotpressCLIError('Cannot delete local plugin')\n }\n\n let plugin: client.Plugin | undefined\n try {\n plugin = await api.findPublicOrPrivatePlugin(parsedRef)\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not get plugin ${this.argv.pluginRef}`)\n }\n\n if (!plugin) {\n throw new errors.BotpressCLIError(`Plugin ${this.argv.pluginRef} not found`)\n }\n\n try {\n await api.client.deletePlugin({ id: plugin.id })\n } catch (thrown) {\n throw errors.BotpressCLIError.wrap(thrown, `Could not delete plugin ${this.argv.pluginRef}`)\n }\n\n this.logger.success(`Plugin ${chalk.bold(this.argv.pluginRef)} deleted`)\n return\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,oBAAc;AAEd,aAAwB;AACxB,yBAAgC;AAChC,4BAA8B;AAGvB,MAAM,yBAAyB,oCAA0C;AAAA,EAC9E,MAAa,MAAqB;AAChC,UAAM,MAAM,MAAM,KAAK,2BAA2B,KAAK,IAAI;AAC3D,UAAM,gBAAY,oCAAgB,KAAK,KAAK,SAAS;AACrD,QAAI,CAAC,WAAW;AACd,YAAM,IAAI,OAAO,6BAA6B,KAAK,KAAK,SAAS;AAAA,IACnE;AACA,QAAI,UAAU,SAAS,QAAQ;AAC7B,YAAM,IAAI,OAAO,iBAAiB,yBAAyB;AAAA,IAC7D;AAEA,QAAI;AACF,YAAM,SAAS,MAAM,IAAI,0BAA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,2BAA2B,KAAK,IAAI;AAC3D,UAAM,gBAAY,oCAAgB,KAAK,KAAK,SAAS;AACrD,QAAI,CAAC,WAAW;AACd,YAAM,IAAI,OAAO,6BAA6B,KAAK,KAAK,SAAS;AAAA,IACnE;AACA,QAAI,UAAU,SAAS,QAAQ;AAC7B,YAAM,IAAI,OAAO,iBAAiB,4BAA4B;AAAA,IAChE;AAEA,QAAI;AACJ,QAAI;AACF,eAAS,MAAM,IAAI,0BAA0B,SAAS;AAAA,IACxD,SAAS,QAAQ;AACf,YAAM,OAAO,iBAAiB,KAAK,QAAQ,wBAAwB,KAAK,KAAK,SAAS,EAAE;AAAA,IAC1F;AAEA,QAAI,CAAC,QAAQ;AACX,YAAM,IAAI,OAAO,iBAAiB,UAAU,KAAK,KAAK,SAAS,YAAY;AAAA,IAC7E;AAEA,QAAI;AACF,YAAM,IAAI,OAAO,aAAa,EAAE,IAAI,OAAO,GAAG,CAAC;AAAA,IACjD,SAAS,QAAQ;AACf,YAAM,OAAO,iBAAiB,KAAK,QAAQ,2BAA2B,KAAK,KAAK,SAAS,EAAE;AAAA,IAC7F;AAEA,SAAK,OAAO,QAAQ,UAAU,aAAAD,QAAM,KAAK,KAAK,KAAK,SAAS,CAAC,UAAU;AACvE;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["chalk", "_"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botpress/cli",
|
|
3
|
-
"version": "4.25.
|
|
3
|
+
"version": "4.25.3",
|
|
4
4
|
"description": "Botpress CLI",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "pnpm run build:types && pnpm run bundle && pnpm run template:gen",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@apidevtools/json-schema-ref-parser": "^11.7.0",
|
|
28
28
|
"@botpress/chat": "0.5.4",
|
|
29
29
|
"@botpress/client": "1.27.1",
|
|
30
|
-
"@botpress/sdk": "4.
|
|
30
|
+
"@botpress/sdk": "4.20.0",
|
|
31
31
|
"@bpinternal/const": "^0.1.0",
|
|
32
32
|
"@bpinternal/tunnel": "^0.1.1",
|
|
33
33
|
"@bpinternal/verel": "^0.2.0",
|