Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion integrations/messenger/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ export class ListIntegrationsCommand extends GlobalCommand<ListIntegrationsComma
: (req: { nextToken?: string }) => 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:')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ export class ListInterfacesCommand extends GlobalCommand<ListInterfacesCommandDe
const publicLister = (req: { nextToken?: string }) => 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:')
Expand Down
6 changes: 4 additions & 2 deletions packages/cli/src/command-implementations/plugin-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ export class ListPluginsCommand extends GlobalCommand<ListPluginsCommandDefiniti
api.client.listPublicPlugins({ nextToken: req.nextToken, name, version })

try {
const privatePlugins = await api.listAllPages(privateLister, (r) => 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:')
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/templates/empty-bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/templates/empty-integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/templates/empty-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"private": true,
"dependencies": {
"@botpress/sdk": "4.19.0"
"@botpress/sdk": "4.20.0"
},
"devDependencies": {
"@types/node": "^22.16.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/templates/hello-world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/templates/webhook-message/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 2 additions & 0 deletions packages/sdk/src/bot/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ export class BotSpecificClient<TBot extends common.BaseBot> implements types.Cli
this._run('upsertTableRows', x)) as types.UpsertTableRows<TBot>
public createWorkflow: types.CreateWorkflow<TBot> = ((x) =>
this._run('createWorkflow', x)) as types.CreateWorkflow<TBot>
public getOrCreateWorkflow: types.GetOrCreateWorkflow<TBot> = ((x) =>
this._run('getOrCreateWorkflow', x)) as types.GetOrCreateWorkflow<TBot>
public getWorkflow: types.GetWorkflow<TBot> = ((x) => this._run('getWorkflow', x)) as types.GetWorkflow<TBot>
public updateWorkflow: types.UpdateWorkflow<TBot> = ((x) =>
this._run('updateWorkflow', x)) as types.UpdateWorkflow<TBot>
Expand Down
22 changes: 22 additions & 0 deletions packages/sdk/src/bot/client/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,28 @@ export type CreateWorkflow<TBot extends common.BaseBot> = <TWorkflowName extends
}>
>

export type GetOrCreateWorkflow<TBot extends common.BaseBot> = <
TWorkflowName extends utils.StringKeys<TBot['workflows']>,
>(
x: utils.Merge<
Arg<client.Client['getOrCreateWorkflow']>,
{
name: utils.Cast<TWorkflowName, string>
input: utils.Cast<TBot['workflows'][TWorkflowName], common.IntegrationInstanceActionDefinition>['input']
tags?: utils.AtLeastOneProperty<TBot['workflows'][TWorkflowName]['tags']>
}
>
) => Promise<
Readonly<{
workflow: utils.Merge<
Awaited<Res<client.Client['getOrCreateWorkflow']>>['workflow'],
{
name: NoInfer<TWorkflowName>
}
>
}>
>

// 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']

Expand Down
37 changes: 6 additions & 31 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading