diff --git a/integrations/messenger/icon.svg b/integrations/messenger/icon.svg index a5a4645c872..091c7581ae9 100644 --- a/integrations/messenger/icon.svg +++ b/integrations/messenger/icon.svg @@ -1 +1,34 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/cli/package.json b/packages/cli/package.json index 3d9e2acabc9..0639b0371ba 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@botpress/cli", - "version": "4.25.1", + "version": "4.25.2", "description": "Botpress CLI", "scripts": { "build": "pnpm run build:types && pnpm run bundle && pnpm run template:gen", @@ -27,7 +27,7 @@ "@apidevtools/json-schema-ref-parser": "^11.7.0", "@botpress/chat": "0.5.4", "@botpress/client": "1.27.1", - "@botpress/sdk": "4.19.0", + "@botpress/sdk": "4.20.0", "@bpinternal/const": "^0.1.0", "@bpinternal/tunnel": "^0.1.1", "@bpinternal/verel": "^0.2.0", diff --git a/packages/cli/src/command-implementations/integration-commands.ts b/packages/cli/src/command-implementations/integration-commands.ts index cefc756d945..6ac3f410f3f 100644 --- a/packages/cli/src/command-implementations/integration-commands.ts +++ b/packages/cli/src/command-implementations/integration-commands.ts @@ -49,8 +49,10 @@ export class ListIntegrationsCommand extends GlobalCommand api.client.listPublicIntegrations({ nextToken: req.nextToken, name, version }) try { - const privateIntegrations = await api.listAllPages(privateLister, (r) => r.integrations) - const publicIntegrations = await api.listAllPages(publicLister, (r) => r.integrations) + const [privateIntegrations, publicIntegrations] = await Promise.all([ + api.listAllPages(privateLister, (r) => r.integrations), + api.listAllPages(publicLister, (r) => r.integrations), + ]) const integrations = _.uniqBy([...privateIntegrations, ...publicIntegrations], (i) => i.id) this.logger.success('Integrations:') diff --git a/packages/cli/src/command-implementations/interface-commands.ts b/packages/cli/src/command-implementations/interface-commands.ts index bf11ab9ed1d..59fcc4b77dd 100644 --- a/packages/cli/src/command-implementations/interface-commands.ts +++ b/packages/cli/src/command-implementations/interface-commands.ts @@ -42,8 +42,10 @@ export class ListInterfacesCommand extends GlobalCommand api.client.listPublicInterfaces({ nextToken: req.nextToken }) try { - const privateInterfaces = await api.listAllPages(privateLister, (r) => r.interfaces) - const publicInterfaces = await api.listAllPages(publicLister, (r) => r.interfaces) + const [privateInterfaces, publicInterfaces] = await Promise.all([ + api.listAllPages(privateLister, (r) => r.interfaces), + api.listAllPages(publicLister, (r) => r.interfaces), + ]) const interfaces = _.uniqBy([...privateInterfaces, ...publicInterfaces], (i) => i.id) this.logger.success('Interfaces:') diff --git a/packages/cli/src/command-implementations/plugin-commands.ts b/packages/cli/src/command-implementations/plugin-commands.ts index ecc10d98559..b780447633f 100644 --- a/packages/cli/src/command-implementations/plugin-commands.ts +++ b/packages/cli/src/command-implementations/plugin-commands.ts @@ -46,8 +46,10 @@ export class ListPluginsCommand extends GlobalCommand r.plugins) - const publicPlugins = await api.listAllPages(publicLister, (r) => r.plugins) + const [privatePlugins, publicPlugins] = await Promise.all([ + api.listAllPages(privateLister, (r) => r.plugins), + api.listAllPages(publicLister, (r) => r.plugins), + ]) const plugins = _.uniqBy([...privatePlugins, ...publicPlugins], (p) => p.id) this.logger.success('Plugins:') diff --git a/packages/cli/templates/empty-bot/package.json b/packages/cli/templates/empty-bot/package.json index 278b22142d6..066503386df 100644 --- a/packages/cli/templates/empty-bot/package.json +++ b/packages/cli/templates/empty-bot/package.json @@ -6,7 +6,7 @@ "private": true, "dependencies": { "@botpress/client": "1.27.1", - "@botpress/sdk": "4.19.0" + "@botpress/sdk": "4.20.0" }, "devDependencies": { "@types/node": "^22.16.4", diff --git a/packages/cli/templates/empty-integration/package.json b/packages/cli/templates/empty-integration/package.json index c7fa2f964dd..b973094c300 100644 --- a/packages/cli/templates/empty-integration/package.json +++ b/packages/cli/templates/empty-integration/package.json @@ -7,7 +7,7 @@ "private": true, "dependencies": { "@botpress/client": "1.27.1", - "@botpress/sdk": "4.19.0" + "@botpress/sdk": "4.20.0" }, "devDependencies": { "@types/node": "^22.16.4", diff --git a/packages/cli/templates/empty-plugin/package.json b/packages/cli/templates/empty-plugin/package.json index f7aa761f4aa..525ce5d0620 100644 --- a/packages/cli/templates/empty-plugin/package.json +++ b/packages/cli/templates/empty-plugin/package.json @@ -6,7 +6,7 @@ }, "private": true, "dependencies": { - "@botpress/sdk": "4.19.0" + "@botpress/sdk": "4.20.0" }, "devDependencies": { "@types/node": "^22.16.4", diff --git a/packages/cli/templates/hello-world/package.json b/packages/cli/templates/hello-world/package.json index 6c95b6011d6..1cc6ad03772 100644 --- a/packages/cli/templates/hello-world/package.json +++ b/packages/cli/templates/hello-world/package.json @@ -7,7 +7,7 @@ "private": true, "dependencies": { "@botpress/client": "1.27.1", - "@botpress/sdk": "4.19.0" + "@botpress/sdk": "4.20.0" }, "devDependencies": { "@types/node": "^22.16.4", diff --git a/packages/cli/templates/webhook-message/package.json b/packages/cli/templates/webhook-message/package.json index 809e8941d24..f8c3b0b4d9b 100644 --- a/packages/cli/templates/webhook-message/package.json +++ b/packages/cli/templates/webhook-message/package.json @@ -7,7 +7,7 @@ "private": true, "dependencies": { "@botpress/client": "1.27.1", - "@botpress/sdk": "4.19.0", + "@botpress/sdk": "4.20.0", "axios": "^1.6.8" }, "devDependencies": { diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 08f4df6e2dd..ffe3f809cb2 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@botpress/sdk", - "version": "4.19.0", + "version": "4.20.0", "description": "Botpress SDK", "main": "./dist/index.cjs", "module": "./dist/index.mjs", diff --git a/packages/sdk/src/bot/client/index.ts b/packages/sdk/src/bot/client/index.ts index 84c7dc43c80..3c9db780f6b 100644 --- a/packages/sdk/src/bot/client/index.ts +++ b/packages/sdk/src/bot/client/index.ts @@ -79,6 +79,8 @@ export class BotSpecificClient implements types.Cli this._run('upsertTableRows', x)) as types.UpsertTableRows public createWorkflow: types.CreateWorkflow = ((x) => this._run('createWorkflow', x)) as types.CreateWorkflow + public getOrCreateWorkflow: types.GetOrCreateWorkflow = ((x) => + this._run('getOrCreateWorkflow', x)) as types.GetOrCreateWorkflow public getWorkflow: types.GetWorkflow = ((x) => this._run('getWorkflow', x)) as types.GetWorkflow public updateWorkflow: types.UpdateWorkflow = ((x) => this._run('updateWorkflow', x)) as types.UpdateWorkflow diff --git a/packages/sdk/src/bot/client/types.ts b/packages/sdk/src/bot/client/types.ts index b92e9460100..29e88417377 100644 --- a/packages/sdk/src/bot/client/types.ts +++ b/packages/sdk/src/bot/client/types.ts @@ -197,6 +197,28 @@ export type CreateWorkflow = > +export type GetOrCreateWorkflow = < + TWorkflowName extends utils.StringKeys, +>( + x: utils.Merge< + Arg, + { + name: utils.Cast + input: utils.Cast['input'] + tags?: utils.AtLeastOneProperty + } + > +) => Promise< + Readonly<{ + workflow: utils.Merge< + Awaited>['workflow'], + { + name: NoInfer + } + > + }> +> + // FIXME: there's no way to infer types for getWorkflow, since all we have is its id export type GetWorkflow<_TBot extends common.BaseBot> = client.Client['getWorkflow'] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a53d08449bb..9bf6c018bfa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -818,31 +818,6 @@ importers: specifier: ^6.4.4 version: 6.4.8 - integrations/facebook: - dependencies: - '@botpress/cli': - specifier: workspace:* - version: link:../../packages/cli - '@botpress/client': - specifier: workspace:* - version: link:../../packages/client - '@botpress/sdk': - specifier: workspace:* - version: link:../../packages/sdk - '@botpress/sdk-addons': - specifier: workspace:* - version: link:../../packages/sdk-addons - axios: - specifier: ^1.6.2 - version: 1.12.2 - devDependencies: - '@botpress/common': - specifier: workspace:* - version: link:../../packages/common - '@sentry/cli': - specifier: ^2.39.1 - version: 2.39.1 - integrations/feature-base: dependencies: '@botpress/client': @@ -2343,7 +2318,7 @@ importers: specifier: 1.27.1 version: link:../client '@botpress/sdk': - specifier: 4.19.0 + specifier: 4.20.0 version: link:../sdk '@bpinternal/const': specifier: ^0.1.0 @@ -2461,7 +2436,7 @@ importers: specifier: 1.27.1 version: link:../../../client '@botpress/sdk': - specifier: 4.19.0 + specifier: 4.20.0 version: link:../../../sdk devDependencies: '@types/node': @@ -2477,7 +2452,7 @@ importers: specifier: 1.27.1 version: link:../../../client '@botpress/sdk': - specifier: 4.19.0 + specifier: 4.20.0 version: link:../../../sdk devDependencies: '@types/node': @@ -2490,7 +2465,7 @@ importers: packages/cli/templates/empty-plugin: dependencies: '@botpress/sdk': - specifier: 4.19.0 + specifier: 4.20.0 version: link:../../../sdk devDependencies: '@types/node': @@ -2506,7 +2481,7 @@ importers: specifier: 1.27.1 version: link:../../../client '@botpress/sdk': - specifier: 4.19.0 + specifier: 4.20.0 version: link:../../../sdk devDependencies: '@types/node': @@ -2522,7 +2497,7 @@ importers: specifier: 1.27.1 version: link:../../../client '@botpress/sdk': - specifier: 4.19.0 + specifier: 4.20.0 version: link:../../../sdk axios: specifier: ^1.6.8