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
2 changes: 1 addition & 1 deletion integrations/zendesk/integration.definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { actions, events, configuration, channels, states, user } from './src/de
export default new sdk.IntegrationDefinition({
name: 'zendesk',
title: 'Zendesk',
version: '2.8.1',
version: '2.8.2',
icon: 'icon.svg',
description:
'Optimize your support workflow. Trigger workflows from ticket updates as well as manage tickets, access conversations, and engage with customers.',
Expand Down
20 changes: 14 additions & 6 deletions integrations/zendesk/src/actions/hitl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,18 @@ export const startHitl: bp.IntegrationProps['actions']['startHitl'] = async (pro
downstreamBotpressUser.user.pictureUrl ??
'https://app.botpress.dev/favicon/bp.svg'

const { user } = await client.getUser({
id: input.userId,
})

const zendeskAuthorId = user.tags.id

if (!zendeskAuthorId) {
throw new sdk.RuntimeError(`User ${user.id} not linked in Zendesk`)
}

const zendeskClient = getZendeskClient(ctx.configuration)
const zendeskBotpressUser = await _retrieveAndUpdateZendeskBotpressUser(props, {
await _updateZendeskBotpressUser(props, {
zendeskClient,
chatbotName,
chatbotPhotoUrl,
Expand All @@ -24,7 +34,7 @@ export const startHitl: bp.IntegrationProps['actions']['startHitl'] = async (pro
input.title ?? 'Untitled Ticket',
await _buildTicketBody(props, { chatbotName }),
{
id: zendeskBotpressUser,
id: zendeskAuthorId,
},
{
priority: input.hitlSession?.priority,
Expand All @@ -48,7 +58,7 @@ export const startHitl: bp.IntegrationProps['actions']['startHitl'] = async (pro
}
}

const _retrieveAndUpdateZendeskBotpressUser = async (
const _updateZendeskBotpressUser = async (
{ client, ctx }: bp.ActionProps['startHitl'],
{
zendeskClient,
Expand All @@ -62,13 +72,11 @@ const _retrieveAndUpdateZendeskBotpressUser = async (
name: chatbotName,
})

const zendeskUser = await zendeskClient.createOrUpdateUser({
await zendeskClient.createOrUpdateUser({
external_id: ctx.botUserId,
name: chatbotName,
remote_photo_url: chatbotPhotoUrl,
})

return String(zendeskUser.id)
}

const _buildTicketBody = async (
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@botpress/cli",
"version": "4.17.2",
"version": "4.17.3",
"description": "Botpress CLI",
"scripts": {
"build": "pnpm run bundle && pnpm run template:gen",
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/src/command-implementations/add-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ export class AddCommand extends GlobalCommand<AddCommandDefinition> {
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:
targetPackage.pkg.version = `^${semver.major(targetPackage.pkg.version)}.0.0`
const major = semver.major(targetPackage.pkg.version)
targetPackage.pkg.version = `>=${major}.0.0 <${major + 1}.0.0`

this.logger.log(
`Dependency "${packageName}" will be installed with version "${targetPackage.pkg.version}". ` +
Expand Down
4 changes: 3 additions & 1 deletion plugins/file-synchronizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"devDependencies": {
"@botpress/cli": "workspace:*",
"@botpresshub/hitl": "workspace:*",
"@types/picomatch": "^3.0.2"
"@types/picomatch": "^3.0.2",
"@types/semver": "^7.3.11",
"semver": "^7.3.8"
},
"bpDependencies": {
"files-readonly": "../../interfaces/files-readonly"
Expand Down
8 changes: 6 additions & 2 deletions plugins/file-synchronizer/plugin.definition.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as sdk from '@botpress/sdk'
import semver from 'semver'
import filesReadonly from './bp_modules/files-readonly'

const FILE_FILTER_PROPS = sdk.z.object({
Expand Down Expand Up @@ -59,7 +60,7 @@ const FILE_FILTER_PROPS = sdk.z.object({

export default new sdk.PluginDefinition({
name: 'file-synchronizer',
version: '0.7.7',
version: '1.0.0',
title: 'File Synchronizer',
description: 'Synchronize files from external services to Botpress',
icon: 'icon.svg',
Expand Down Expand Up @@ -197,6 +198,9 @@ export default new sdk.PluginDefinition({
},
},
interfaces: {
'files-readonly': filesReadonly,
'files-readonly': {
...filesReadonly,
version: `>=${semver.major(filesReadonly.version)}.0.0 <${semver.major(filesReadonly.version) + 1}.0.0`,
},
},
})
4 changes: 3 additions & 1 deletion plugins/hitl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"devDependencies": {
"@botpress/cli": "workspace:*",
"@botpresshub/hitl": "workspace:*",
"@types/lodash": "^4.14.191"
"@types/lodash": "^4.14.191",
"@types/semver": "^7.3.11",
"semver": "^7.3.8"
},
"bpDependencies": {
"hitl": "../../interfaces/hitl"
Expand Down
5 changes: 3 additions & 2 deletions plugins/hitl/plugin.definition.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as sdk from '@botpress/sdk'
import semver from 'semver'
import hitl from './bp_modules/hitl'

export const DEFAULT_HITL_HANDOFF_MESSAGE =
Expand Down Expand Up @@ -85,7 +86,7 @@ const PLUGIN_CONFIG_SCHEMA = sdk.z.object({

export default new sdk.PluginDefinition({
name: 'hitl',
version: '0.13.2',
version: '1.0.0',
title: 'Human In The Loop',
description: 'Seamlessly transfer conversations to human agents',
icon: 'icon.svg',
Expand Down Expand Up @@ -208,7 +209,7 @@ export default new sdk.PluginDefinition({
},
},
interfaces: {
hitl,
hitl: { ...hitl, version: `>=${semver.major(hitl.version)}.0.0 <${semver.major(hitl.version) + 1}.0.0` },
},
events: {
humanAgentAssignedTimeout: {
Expand Down
4 changes: 3 additions & 1 deletion plugins/knowledge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"@botpress/cli": "workspace:*",
"@botpress/common": "workspace:*",
"@botpresshub/llm": "workspace:*",
"@bpinternal/genenv": "0.0.1"
"@bpinternal/genenv": "0.0.1",
"@types/semver": "^7.3.11",
"semver": "^7.3.8"
},
"bpDependencies": {
"llm": "../../interfaces/llm"
Expand Down
5 changes: 3 additions & 2 deletions plugins/knowledge/plugin.definition.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import * as sdk from '@botpress/sdk'
import semver from 'semver'
import llm from './bp_modules/llm'

export default new sdk.PluginDefinition({
name: 'knowledge',
version: '0.0.1',
version: '1.0.0',
configuration: { schema: sdk.z.object({}) },
interfaces: {
llm,
llm: { ...llm, version: `>=${semver.major(llm.version)}.0.0 <${semver.major(llm.version) + 1}.0.0` },
},
})
4 changes: 3 additions & 1 deletion plugins/personality/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"@botpress/cli": "workspace:*",
"@botpress/common": "workspace:*",
"@botpresshub/llm": "workspace:*",
"@bpinternal/genenv": "0.0.1"
"@bpinternal/genenv": "0.0.1",
"@types/semver": "^7.3.11",
"semver": "^7.3.8"
},
"bpDependencies": {
"llm": "../../interfaces/llm"
Expand Down
5 changes: 3 additions & 2 deletions plugins/personality/plugin.definition.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import * as sdk from '@botpress/sdk'
import semver from 'semver'
import llm from './bp_modules/llm'

export default new sdk.PluginDefinition({
name: 'personality',
version: '0.0.1',
version: '1.0.0',
configuration: {
schema: sdk.z.object({
model: sdk.z.string().describe('Model to use to handle bot personality'),
Expand All @@ -16,6 +17,6 @@ export default new sdk.PluginDefinition({
}),
},
interfaces: {
llm,
llm: { ...llm, version: `>=${semver.major(llm.version)}.0.0 <${semver.major(llm.version) + 1}.0.0` },
},
})
4 changes: 3 additions & 1 deletion plugins/synchronizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"@botpresshub/deletable": "workspace:*",
"@botpresshub/listable": "workspace:*",
"@botpresshub/updatable": "workspace:*",
"@types/lodash": "^4.14.191"
"@types/lodash": "^4.14.191",
"@types/semver": "^7.3.11",
"semver": "^7.3.8"
},
"bpDependencies": {
"listable": "../../interfaces/listable",
Expand Down
13 changes: 10 additions & 3 deletions plugins/synchronizer/plugin.definition.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import * as sdk from '@botpress/sdk'
import semver from 'semver'
import deletable from './bp_modules/deletable'
import listable from './bp_modules/listable'

const itemSchema = listable.definition.entities.item.schema

export default new sdk.PluginDefinition({
name: 'synchronizer',
version: '0.0.1',
version: '1.0.0',
configuration: {
schema: sdk.z.object({
tableName: sdk.z.string().title('Table Name').describe('The name of the table to store items'),
Expand Down Expand Up @@ -68,7 +69,13 @@ export default new sdk.PluginDefinition({
},
},
interfaces: {
listable,
deletable,
listable: {
...listable,
version: `>=${semver.major(listable.version)}.0.0 <${semver.major(listable.version) + 1}.0.0`,
},
deletable: {
...deletable,
version: `>=${semver.major(deletable.version)}.0.0 <${semver.major(deletable.version) + 1}.0.0`,
},
},
})
30 changes: 30 additions & 0 deletions pnpm-lock.yaml

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

Loading