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
43 changes: 38 additions & 5 deletions integrations/vonage/integration.definition.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/* bplint-disable */
import { z, IntegrationDefinition, messages } from '@botpress/sdk'
import { sentry as sentryHelpers } from '@botpress/sdk-addons'
import proactiveConversation from 'bp_modules/proactive-conversation'
import proactiveUser from 'bp_modules/proactive-user'

export default new IntegrationDefinition({
name: 'vonage',
version: '0.4.6',
version: '1.0.0',
title: 'Vonage',
description: 'Send and receive SMS messages.',
icon: 'icon.svg',
Expand All @@ -19,7 +21,7 @@ export default new IntegrationDefinition({
},
channels: {
channel: {
messages: { ...messages.defaults, markdown: messages.markdown },
messages: { ...messages.defaults },
message: {
tags: {
id: {},
Expand All @@ -31,18 +33,49 @@ export default new IntegrationDefinition({
channel: {},
channelId: {},
},
creation: { enabled: true, requiredTags: ['userId', 'channelId', 'channel'] },
},
},
},
actions: {},
events: {},
user: {
tags: {
userId: {},
channel: {},
},
creation: { enabled: true, requiredTags: ['userId', 'channel'] },
},
secrets: sentryHelpers.COMMON_SECRET_NAMES,
entities: {
conversation: {
schema: z.object({
userId: z.string(),
channelId: z.string(),
channel: z.string(),
}),
},
user: {
schema: z.object({ channel: z.string(), userId: z.string() }),
},
},
})
.extend(proactiveConversation, ({ entities }) => ({
entities: {
conversation: entities.conversation,
},
actions: {
getOrCreateConversation: {
name: 'startConversation',
title: 'Start proactive conversation',
description: 'Start a proactive conversation given a user',
},
},
}))
.extend(proactiveUser, ({ entities }) => ({
entities: { user: entities.user },
actions: {
getOrCreateUser: {
name: 'getOrCreateUser',
title: 'Get or create user',
description: 'Get or create a user in the Vonage channel',
},
},
}))
4 changes: 4 additions & 0 deletions integrations/vonage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@
"@botpress/cli": "workspace:*",
"@botpress/common": "workspace:*",
"@sentry/cli": "^2.39.1"
},
"bpDependencies": {
"proactive-user": "../../interfaces/proactive-user",
"proactive-conversation": "../../interfaces/proactive-conversation"
}
}
Loading
Loading