From 9c036ed6b507c647b6f9da4b9da07b673039fa49 Mon Sep 17 00:00:00 2001 From: Mathieu Faucher <99497774+Math-Fauch@users.noreply.github.com> Date: Fri, 19 Dec 2025 10:10:50 -0500 Subject: [PATCH 1/5] feat(integrations/zendesk): Add requester info in start HITL (#14715) --- integrations/zendesk/integration.definition.ts | 12 +++++++++++- integrations/zendesk/src/actions/hitl.ts | 4 ++++ integrations/zendesk/src/definitions/schemas.ts | 6 ++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/integrations/zendesk/integration.definition.ts b/integrations/zendesk/integration.definition.ts index da8de455bfd..d5e7eaef824 100644 --- a/integrations/zendesk/integration.definition.ts +++ b/integrations/zendesk/integration.definition.ts @@ -6,7 +6,7 @@ import { actions, events, configuration, channels, states, user } from './src/de export default new sdk.IntegrationDefinition({ name: 'zendesk', title: 'Zendesk', - version: '3.0.2', + version: '3.0.3', icon: 'icon.svg', description: 'Optimize your support workflow. Trigger workflows from ticket updates as well as manage tickets, access conversations, and engage with customers.', @@ -49,6 +49,16 @@ export default new sdk.IntegrationDefinition({ 'Photo URL of the chatbot that will be used in the Zendesk ticket. Must be a publicly-accessible PNG image. Defaults to Botpress logo.' ) .optional(), + requesterName: sdk.z + .string() + .title('Requester Name') + .describe('The name of the requester the bot was talking to. This will be set in zendesk.') + .optional(), + requesterEmail: sdk.z + .string() + .title('Requester Email') + .describe('The email of the requester the bot was talking to. This will be set in zendesk.') + .optional(), }), }, }, diff --git a/integrations/zendesk/src/actions/hitl.ts b/integrations/zendesk/src/actions/hitl.ts index ae6a67cf265..6d263c042f9 100644 --- a/integrations/zendesk/src/actions/hitl.ts +++ b/integrations/zendesk/src/actions/hitl.ts @@ -38,6 +38,10 @@ export const startHitl: bp.IntegrationProps['actions']['startHitl'] = async (pro }, { priority: input.hitlSession?.priority, + requester: { + name: input.hitlSession?.requesterName, + email: input.hitlSession?.requesterEmail, + }, } ) diff --git a/integrations/zendesk/src/definitions/schemas.ts b/integrations/zendesk/src/definitions/schemas.ts index c4684f1b741..aeab084951a 100644 --- a/integrations/zendesk/src/definitions/schemas.ts +++ b/integrations/zendesk/src/definitions/schemas.ts @@ -1,6 +1,11 @@ import { z } from '@botpress/sdk' import { omit } from 'lodash' +const requesterSchema = z.object({ + name: z.string().optional(), + email: z.string().optional(), +}) + export const ticketSchema = z.object({ id: z.number(), subject: z.string(), @@ -8,6 +13,7 @@ export const ticketSchema = z.object({ status: z.enum(['new', 'open', 'pending', 'hold', 'solved', 'closed']), priority: z.enum(['low', 'normal', 'high', 'urgent']).nullable(), requesterId: z.number(), + requester: requesterSchema.optional(), assigneeId: z.number().nullable(), createdAt: z.string(), updatedAt: z.string(), From 4c5824811c06b3ede0140708591e4a59d933a23d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Levasseur?= Date: Fri, 19 Dec 2025 10:21:46 -0500 Subject: [PATCH 2/5] chore(zai): reword a comment --- packages/zai/src/operations/extract.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/zai/src/operations/extract.ts b/packages/zai/src/operations/extract.ts index 8f1e237f6e0..7d8b11fef67 100644 --- a/packages/zai/src/operations/extract.ts +++ b/packages/zai/src/operations/extract.ts @@ -129,7 +129,7 @@ const extract = async >( try { schema = transforms.fromJSONSchema(transforms.toJSONSchema(_schema as any as z.ZodType)) } catch { - // The above transformers arent the legacy once. They are very strict and might fail on some schema types. + // The above transformers arent the legacy ones. They are very strict and might fail on some schema types. schema = _schema as any as z.ZodType } From c03caf16c499d026a932714b35c74f48c9eacd30 Mon Sep 17 00:00:00 2001 From: Mathieu Faucher <99497774+Math-Fauch@users.noreply.github.com> Date: Fri, 19 Dec 2025 11:25:54 -0500 Subject: [PATCH 3/5] fix(integrations/zendesk): use requester from createTicket (#14716) --- integrations/zendesk/integration.definition.ts | 4 +++- integrations/zendesk/src/actions/hitl.ts | 15 ++++++++------- integrations/zendesk/src/client.ts | 4 ++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/integrations/zendesk/integration.definition.ts b/integrations/zendesk/integration.definition.ts index d5e7eaef824..d5a0a1fa0cc 100644 --- a/integrations/zendesk/integration.definition.ts +++ b/integrations/zendesk/integration.definition.ts @@ -57,7 +57,9 @@ export default new sdk.IntegrationDefinition({ requesterEmail: sdk.z .string() .title('Requester Email') - .describe('The email of the requester the bot was talking to. This will be set in zendesk.') + .describe( + '⚠️This needs a requester name to work. The email of the requester the bot was talking to. This will be set in zendesk.' + ) .optional(), }), }, diff --git a/integrations/zendesk/src/actions/hitl.ts b/integrations/zendesk/src/actions/hitl.ts index 6d263c042f9..174019be357 100644 --- a/integrations/zendesk/src/actions/hitl.ts +++ b/integrations/zendesk/src/actions/hitl.ts @@ -30,18 +30,19 @@ export const startHitl: bp.IntegrationProps['actions']['startHitl'] = async (pro chatbotPhotoUrl, }) + const requester = input.hitlSession?.requesterName + ? { + name: input.hitlSession?.requesterName, + ...(input.hitlSession?.requesterEmail ? { email: input.hitlSession?.requesterEmail } : {}), + } + : { id: zendeskAuthorId } + const ticket = await zendeskClient.createTicket( input.title ?? 'Untitled Ticket', await _buildTicketBody(props, { chatbotName }), - { - id: zendeskAuthorId, - }, + requester, { priority: input.hitlSession?.priority, - requester: { - name: input.hitlSession?.requesterName, - email: input.hitlSession?.requesterEmail, - }, } ) diff --git a/integrations/zendesk/src/client.ts b/integrations/zendesk/src/client.ts index d23abb73502..46e83424e66 100644 --- a/integrations/zendesk/src/client.ts +++ b/integrations/zendesk/src/client.ts @@ -9,8 +9,8 @@ import * as bp from '.botpress' export type TicketRequester = | { - name: string - email: string + name?: string + email?: string } | { id: string From 2eb60c02a27efcb59adca0c8a0e05b8531bc5299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Levasseur?= Date: Fri, 19 Dec 2025 11:43:42 -0500 Subject: [PATCH 4/5] fix(cli): installing a package should preserve its version (#14712) --- packages/cli/package.json | 2 +- packages/cli/src/command-implementations/add-command.ts | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 0b53445e4c3..d5d01a9c355 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@botpress/cli", - "version": "5.1.1", + "version": "5.1.2", "description": "Botpress CLI", "scripts": { "build": "pnpm run build:types && pnpm run bundle && pnpm run template:gen", diff --git a/packages/cli/src/command-implementations/add-command.ts b/packages/cli/src/command-implementations/add-command.ts index f20cc10ce90..ee8bbb484d9 100644 --- a/packages/cli/src/command-implementations/add-command.ts +++ b/packages/cli/src/command-implementations/add-command.ts @@ -1,7 +1,6 @@ import * as sdk from '@botpress/sdk' import * as fslib from 'fs' import * as pathlib from 'path' -import semver from 'semver' import * as apiUtils from '../api' import * as codegen from '../code-generation' import type commandDefinitions from '../command-definitions' @@ -108,13 +107,7 @@ export class AddCommand extends GlobalCommand { await this._uninstall(installPath) } - if (ref.type === 'name' && ref.version === pkgRef.LATEST_TAG) { - // If the semver version expression is 'latest', we assume the project - // is compatible with all versions of the latest major: - const major = semver.major(targetPackage.pkg.version) - targetPackage.pkg.version = `>=${major}.0.0 <${major + 1}.0.0` - } else if (ref.type === 'name') { - // Preserve the semver version expression in the generated code: + if (ref.type === 'name') { targetPackage.pkg.version = ref.version } From 7089810964f6521a13bd12582c55858133483f01 Mon Sep 17 00:00:00 2001 From: JustinBordage <38659460+JustinBordage@users.noreply.github.com> Date: Fri, 19 Dec 2025 12:43:58 -0500 Subject: [PATCH 5/5] fix(integrations/trello): trelloBoardId config field blocking save on empty string (#14713) --- .../trello/definitions/configuration.ts | 25 ++++++++++++++++--- .../definitions/schemas/configuration.ts | 20 --------------- .../trello/definitions/schemas/entities.ts | 7 ++---- .../trello/definitions/schemas/index.ts | 1 - integrations/trello/integration.definition.ts | 2 +- 5 files changed, 25 insertions(+), 30 deletions(-) delete mode 100644 integrations/trello/definitions/schemas/configuration.ts diff --git a/integrations/trello/definitions/configuration.ts b/integrations/trello/definitions/configuration.ts index 961b9c36218..0e2f49dd358 100644 --- a/integrations/trello/definitions/configuration.ts +++ b/integrations/trello/definitions/configuration.ts @@ -1,6 +1,25 @@ -import { IntegrationDefinitionProps } from '@botpress/sdk' -import { TrelloConfigSchema } from './schemas' +import { IntegrationDefinitionProps, z } from '@botpress/sdk' +import { trelloIdRegex } from './schemas' + +const _optionalTrelloIdRegex = new RegExp(`^$|${trelloIdRegex.source}`) export const configuration = { - schema: TrelloConfigSchema, + schema: z.object({ + trelloApiKey: z + .string() + .title('Trello API Key') + .describe('Can be obtained by creating an application on Trello') + .secret(), + trelloApiToken: z + .string() + .title('Trello API Token') + .describe('Can be obtained by granting access to the application on Trello') + .secret(), + trelloBoardId: z + .string() + .regex(_optionalTrelloIdRegex) + .optional() + .title('Trello Board ID') + .describe('Unique identifier of the board to watch for events on Trello'), + }), } as const satisfies NonNullable diff --git a/integrations/trello/definitions/schemas/configuration.ts b/integrations/trello/definitions/schemas/configuration.ts deleted file mode 100644 index 8825b4d9599..00000000000 --- a/integrations/trello/definitions/schemas/configuration.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { z } from '@botpress/sdk' -import { BoardSchema } from './entities' - -export const TrelloConfigSchema = z.object({ - trelloApiKey: z - .string() - .title('Trello API Key') - .describe('Can be obtained by creating an application on Trello') - .secret(), - trelloApiToken: z - .string() - .title('Trello API Token') - .describe('Can be obtained by granting access to the application on Trello') - .secret(), - trelloBoardId: BoardSchema.shape.id - .describe('Unique identifier of the board to watch for events on Trello') - .optional(), -}) - -export type TrelloConfig = z.infer diff --git a/integrations/trello/definitions/schemas/entities.ts b/integrations/trello/definitions/schemas/entities.ts index a99b474cbdd..85247717281 100644 --- a/integrations/trello/definitions/schemas/entities.ts +++ b/integrations/trello/definitions/schemas/entities.ts @@ -1,11 +1,8 @@ import { z } from '@botpress/sdk' -export const trelloIdRegex = /[0-9a-fA-F]{24}/ +export const trelloIdRegex = /^[0-9a-fA-F]{24}$/ -export const TrelloIDSchema = z - .string() - .length(24) - .regex(new RegExp(`^${trelloIdRegex.source}$`)) +export const TrelloIDSchema = z.string().regex(trelloIdRegex) export type TrelloID = z.infer diff --git a/integrations/trello/definitions/schemas/index.ts b/integrations/trello/definitions/schemas/index.ts index f572223765d..8e3775e4cd3 100644 --- a/integrations/trello/definitions/schemas/index.ts +++ b/integrations/trello/definitions/schemas/index.ts @@ -1,6 +1,5 @@ export * from './actions/inputSchemas' export * from './actions/outputSchemas' -export * from './configuration' export * from './entities' export * from './states' export * from './webhookEvents' diff --git a/integrations/trello/integration.definition.ts b/integrations/trello/integration.definition.ts index 374b4b7181b..f89ba78c4e5 100644 --- a/integrations/trello/integration.definition.ts +++ b/integrations/trello/integration.definition.ts @@ -12,7 +12,7 @@ import { integrationName } from './package.json' export default new sdk.IntegrationDefinition({ name: integrationName, title: 'Trello', - version: '1.1.3', + version: '1.1.4', readme: 'hub.md', description: 'Update cards, add comments, create new cards, and read board members from your chatbot.', icon: 'icon.svg',