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
52 changes: 29 additions & 23 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
# Global
* @botpress/engineering

# Scripts
/scripts @franklevasseur

# Client, SDK, CLI
/packages @botpress/engineering

# Bots
/packages/bots @franklevasseur
/packages/bots @botpress/engineering

# Plugins
/plugins @botpress/engineering
/plugins/hitl @pascal-botpress @franklevasseur @botpress/engineering
/plugins/file-synchronizer @pascal-botpress @botpress/engineering

# Integrations
/integrations @botpress/engineering

## Utils
/integrations/browser @allardy @botpress/engineering
/integrations/charts @allardy @botpress/engineering
Expand All @@ -28,37 +29,42 @@
/integrations/openai @AbrahamLopez10 @botpress/engineering

## Others
/integrations/airtable @pascal-botpress @botpress/engineering
/integrations/asana @SebastienPoitras @botpress/engineering
/integrations/bigcommerce-sync @matthewbotpress @botpress/engineering
/integrations/airtable @JustinBordage @botpress/engineering
/integrations/asana @JustinBordage @botpress/engineering
/integrations/bigcommerce-sync @Nathaniel-Girard @botpress/engineering
/integrations/chat @franklevasseur @botpress/engineering
/integrations/clickup @franklevasseur @botpress/engineering
/integrations/clickup @JustinBordage @botpress/engineering
/integrations/confluence @Nathaniel-Girard @botpress/engineering
/integrations/dropbox @pascal-botpress @botpress/engineering
/integrations/freshchat @SebastienPoitras @botpress/engineering
/integrations/github @pascal-botpress @botpress/engineering
/integrations/email @Nathaniel-Girard @botpress/engineering
/integrations/freshchat @davidvitora @botpress/engineering
/integrations/github @JustinBordage @pascal-botpress @botpress/engineering
/integrations/gmail @pascal-botpress @botpress/engineering
/integrations/googlecalendar @pascal-botpress @botpress/engineering
/integrations/googledrive @pascal-botpress @botpress/engineering
/integrations/gsheets @pascal-botpress @botpress/engineering
/integrations/instagram @SebastienPoitras @botpress/engineering
/integrations/intercom @SebastienPoitras @botpress/engineering
/integrations/line @SebastienPoitras @botpress/engineering
/integrations/intercom @Nathaniel-Girard @botpress/engineering
/integrations/line @Nathaniel-Girard @botpress/engineering
/integrations/linear @franklevasseur @botpress/engineering
/integrations/mailchimp @SebastienPoitras @botpress/engineering
/integrations/mailchimp @JustinBordage @botpress/engineering
/integrations/messenger @SebastienPoitras @botpress/engineering
/integrations/monday @JustinBordage @botpress/engineering
/integrations/notion @pascal-botpress @botpress/engineering
/integrations/resend @JustinBordage @botpress/engineering
/integrations/sendgrid @JustinBordage @botpress/engineering
/integrations/slack @pascal-botpress @botpress/engineering
/integrations/stripe @SebastienPoitras @botpress/engineering
/integrations/stripe @Nathaniel-Girard @botpress/engineering
/integrations/sunco @SebastienPoitras @botpress/engineering
/integrations/teams @franklevasseur @botpress/engineering
/integrations/telegram @franklevasseur @botpress/engineering
/integrations/todoist @SebastienPoitras @botpress/engineering
/integrations/trello @pascal-botpress @botpress/engineering
/integrations/teams @JustinBordage @davidvitora @botpress/engineering
/integrations/telegram @franklevasseur @JustinBordage @botpress/engineering
/integrations/todoist @JustinBordage @botpress/engineering
/integrations/trello @JustinBordage @botpress/engineering
/integrations/twilio @SebastienPoitras @botpress/engineering
/integrations/viber @SebastienPoitras @botpress/engineering
/integrations/vonage @SebastienPoitras @botpress/engineering
/integrations/viber @Nathaniel-Girard @botpress/engineering
/integrations/vonage @Nathaniel-Girard @botpress/engineering
/integrations/webhook @franklevasseur @botpress/engineering
/integrations/whatsapp @SebastienPoitras @botpress/engineering
/integrations/zapier @SebastienPoitras @botpress/engineering
/integrations/zendesk @franklevasseur @botpress/engineering
/integrations/zoho @matthewbotpress @botpress/engineering
/integrations/zapier @Nathaniel-Girard @botpress/engineering
/integrations/zendesk @pascal-botpress @franklevasseur @botpress/engineering
/integrations/zoho @Nathaniel-Girard @botpress/engineering
2 changes: 1 addition & 1 deletion bots/hit-looper/bot.definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import chat from './bp_modules/chat'
import hitl from './bp_modules/hitl'
import zendesk from './bp_modules/zendesk'

const zendeskHitl = zendesk.definition.interfaces['hitl']
const zendeskHitl = zendesk.definition.interfaces['hitl<hitlTicket>']

export default new sdk.BotDefinition({
configuration: {
Expand Down
4 changes: 4 additions & 0 deletions bots/hit-looper/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ bot.on.message('*', async (props) => {

const { conversation: upstreamConversation, user: upstreamUser } = props

const _randFrom = <TValueType extends unknown>(...values: TValueType[]): TValueType =>
values[Math.floor(Math.random() * values.length)]!

if (props.message.type === 'text' && props.message.payload.text.trim() === '/start_hitl') {
await props.client.updateUser({
id: upstreamUser.id,
Expand All @@ -55,6 +58,7 @@ bot.on.message('*', async (props) => {
input: {
title: `Hitl request ${Date.now()}`,
description: 'I have a problem',
hitlSession: { priority: _randFrom('low', 'high', 'urgent') },
conversationId: upstreamConversation.id,
userId: upstreamUser.id,
},
Expand Down
18 changes: 18 additions & 0 deletions integrations/email/hub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Email integration

## Description

This integration provides Internet Messaging Access Protocol (IMAP) and Simple Messaging Transport Protocol (SMTP) actions to read and send email messages.
The integration **does not** support HTML content yet.

## Getting started

### Configuration

The configuration contains three required fields. Here is an example of config

```yml
user: yourEmailAccount@gmail.com
password: yourAccountPassword
host: imap.gmail.com #for gmail
```
8 changes: 8 additions & 0 deletions integrations/email/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
126 changes: 126 additions & 0 deletions integrations/email/integration.definition.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
import { z, IntegrationDefinition, messages } from '@botpress/sdk'

const emailSchema = z.object({
id: z.string(),
subject: z.string(),
inReplyTo: z.string().optional(),
date: z.string().optional().describe('ISO datetime'),
sender: z.string(),
firstMessageId: z.string().optional(),
})

export default new IntegrationDefinition({
name: 'email',
version: '0.0.1',
readme: 'hub.md',
icon: 'icon.svg',
configuration: {
schema: z
.object({
user: z
.string()
.describe('The email account you want to use to receive and send messages. Example: example@gmail.com'),
password: z.string().describe('The password to the email account.'),
imapHost: z.string().describe('The imap server you want to connect to. Example: imap.gmail.com'),
smtpHost: z.string().describe('The smtp server you want to connect to. Example: smtp.gmail.com'),
})
.required(),
},
states: {
lastSyncTimestamp: {
type: 'integration',
schema: z.object({
lastSyncTimestamp: z.string().datetime(),
}),
},
syncLock: {
type: 'integration',
schema: z.object({ currentlySyncing: z.boolean().default(false) }),
},
},
actions: {
listEmails: {
title: 'List emails',
description: 'List all emails in the inbox',
input: {
schema: z.object({
nextToken: z.string().optional().describe('The page number in the inbox. Starts at 0').optional(),
}),
},
output: {
schema: z.object({
messages: z.array(emailSchema),
nextToken: z.string().optional(),
}),
},
},
getEmail: {
title: 'Get emails',
description: 'Get the email with specified id from the inbox',
input: {
schema: z.object({
id: z.string(),
}),
},
output: {
schema: emailSchema.extend({
body: z.string().optional(),
}),
},
},
syncEmails: {
title: 'Sync Emails',
description: 'Sends unseen emails as new messages. Call periodically to allow your bot to receive new emails.',
input: { schema: z.object({}) },
output: {
schema: z.object({}),
},
},
sendEmail: {
title: 'Send Email',
description: 'Send an email using SMTP',
input: {
schema: z.object({
to: z.string().describe('The email address of the recipient'),
subject: z.string().optional().describe('The subject of the outgoing email'),
text: z.string().optional().describe('The text contained in the body of the email'),
inReplyTo: z.string().optional().describe('The id of the email you want to reply to'),
replyTo: z
.string()
.optional()
.describe(
'The email address to which replies should be sent. This allows recipients to reply to a different address than the sender'
),
}),
},
output: {
schema: z.object({}),
},
},
},
channels: {
default: {
message: { tags: { id: { title: 'Email id', description: 'The email id ' } } },
messages: { text: messages.defaults.text },
conversation: {
tags: {
firstMessageId: {
title: 'First Message Id',
description: 'The id (from the IMAP server) of the first incoming message of the conversation',
},
subject: { title: 'Thread Subject', description: 'Subject for the conversation' },
to: { title: 'Recipient', description: 'Recipient email address for the conversation' },
latestEmail: {
title: 'Email id',
description: 'The id of the latest email received (to put in the In-Reply-To header)',
},
},
},
},
},
user: {
tags: {
email: { title: 'User email', description: 'Required' },
},
},
})
19 changes: 19 additions & 0 deletions integrations/email/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "@botpresshub/email",
"scripts": {
"check:type": "tsc --noEmit",
"build": "bp build",
"test": "vitest"
},
"private": true,
"dependencies": {
"@botpress/client": "workspace:*",
"@botpress/sdk": "workspace:*",
"imap": "^0.8.17",
"nodemailer": "^6.7.2"
},
"devDependencies": {
"@types/imap": "^0.8.42",
"@types/nodemailer": "^6.4.4"
}
}
Loading
Loading