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
1 change: 1 addition & 0 deletions .github/workflows/deploy-integrations-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
uses: ./.github/actions/deploy-integrations
with:
environment: 'production'
extra_filter: "-F '!docusign'"
force: ${{ github.event.inputs.force == 'true' }}
sentry_auth_token: ${{ secrets.SENTRY_AUTH_TOKEN }}
token_cloud_ops_account: ${{ secrets.PRODUCTION_TOKEN_CLOUD_OPS_ACCOUNT }}
Expand Down
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
/integrations/clickup @JustinBordage @botpress/engineering
/integrations/confluence @Nathaniel-Girard @botpress/engineering
/integrations/dropbox @pascal-botpress @botpress/engineering
/integrations/docusign @JustinBordage @botpress/engineering
/integrations/email @Nathaniel-Girard @botpress/engineering
/integrations/freshchat @davidvitora @botpress/engineering
/integrations/github @JustinBordage @pascal-botpress @botpress/engineering
Expand Down
2 changes: 1 addition & 1 deletion bots/hit-looper/bot.definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export default new sdk.BotDefinition({
})
.addPlugin(hitl, {
configuration: {
useHumanAgentInfo: false,
flowOnHitlStopped: false,
useHumanAgentInfo: false,
},
interfaces: {
hitl: {
Expand Down
42 changes: 42 additions & 0 deletions integrations/docusign/definitions/actions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { z } from '@botpress/sdk'

const _templateRecipientSchema = z.object({
name: z.string().title('Recipient Name').describe("The recipient's full name"),
email: z.string().title('Recipient Email').describe("The recipient's email address"),
role: z.string().title('Template Recipient Role').describe('The role keyword defined in the template'),
accessCode: z
.string()
.optional()
.title('Access Code')
.describe('An access code that is required to access the envelope'),
})
export type TemplateRecipient = z.infer<typeof _templateRecipientSchema>

export const sendEnvelopeInputSchema = z.object({
templateId: z.string().title('Template ID').describe('The id of the envelope template'),
recipients: z
.array(_templateRecipientSchema)
.min(1)
.title('Envelope Recipients')
.describe(
"The recipients of the envelope to send as defined in the template (Note: adding additional recipients with roles not defined in the template will cause them to default as 'signers')"
),
emailSubject: z
.string()
.optional()
.title('Email Subject')
.describe(
'Sets the subject field of the sent envelope email (Leaving this empty will fallback to the template default subject)'
),
conversationId: z
.string()
.placeholder('{{ event.conversationId }}')
.optional()
.title('Conversation ID')
.describe('The ID of the conversation'),
})
export type SendEnvelopeInput = z.infer<typeof sendEnvelopeInputSchema>

export const sendEnvelopeOutputSchema = z.object({
envelopeId: z.string().title('Envelope ID').describe('The id of the sent envelope'),
})
11 changes: 11 additions & 0 deletions integrations/docusign/definitions/events.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { z } from '@botpress/sdk'

export const envelopeEventSchema = z.object({
userId: z.string().title('User ID').describe("The Docusign user's ID"),
accountId: z
.string()
.title('API Account ID')
.describe('The docusign user\'s "API Account ID" (This is a GUID that is found in "Apps & Keys")'),
envelopeId: z.string().title('Envelope ID').describe('The id of the sent envelope'),
triggeredAt: z.string().datetime().title('Triggered At').describe('The datetime when the event was triggered'),
})
13 changes: 13 additions & 0 deletions integrations/docusign/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import rootConfig from '../../eslint.config.mjs'

export default [
...rootConfig,
{
languageOptions: {
parserOptions: {
project: ['./tsconfig.json'],
tsconfigRootDir: import.meta.dirname,
},
},
},
]
43 changes: 43 additions & 0 deletions integrations/docusign/hub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Integrate Docusign with AI

Unlock the full potential of Docusign by integrating it with AI technologies. With AI, you can automate document workflows, generate intelligent insights, enhance security measures, and improve user experience. From streamlining contract management with AI-powered analytics to using machine learning for data extraction, the possibilities are endless.

# What You Can Do with a Docusign AI Integration

By integrating Docusign with AI-driven tools, you can unlock new possibilities to enhance document processes, security, and user interaction. Here are some key features you can leverage:

## 1. Automate Document Workflows

With AI, routine document workflows such as signing, sending reminders, and tracking status can be automated within Docusign, saving time and reducing manual effort.

## 2. AI-Powered Analytics

Integrate Docusign with AI analytics tools to monitor document performance, gain insights from contract data, and optimize workflow efficiency for better decision-making.

## 3. Intelligent Data Extraction

Leverage machine learning to automatically extract key information from documents, reducing errors and speeding up data processing.

## 4. Enhanced Security Measures

By integrating AI-driven security features, you can enhance the protection of sensitive documents, detect fraudulent activities, and ensure compliance with industry standards.

# Benefits of Integrating Docusign with AI

By integrating AI into Docusign, your organization can:

- **Automate document handling:** Use AI to automate the preparation and distribution of documents, allowing your team to focus on more strategic tasks.
- **Generate insights:** Leverage AI to analyze document data and generate actionable insights for business strategy and planning.
- **Real-time language processing:** Instantly process and translate document content into multiple languages, facilitating global operations.
- **Fraud detection:** Utilize AI to identify unusual patterns and prevent fraudulent activities in document transactions.
- **Workflow optimization:** Integrate AI-powered workflow management to automatically assign, update, and track document tasks based on context and priority.

# What is Docusign?

Docusign is a leading electronic signature and agreement platform that allows businesses to prepare, sign, act on, and manage agreements in a secure digital environment. By integrating AI into Docusign, you can enhance its capabilities with advanced automation, security, and data-driven insights. Related Integrations:

- Salesforce AI Integration
- Gmail AI Integration
- Zapier AI Integration
- PDF Generator AI Integration
- HubSpot AI Integration
12 changes: 12 additions & 0 deletions integrations/docusign/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
123 changes: 123 additions & 0 deletions integrations/docusign/integration.definition.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
import { IntegrationDefinition, z } from '@botpress/sdk'
import { sendEnvelopeInputSchema, sendEnvelopeOutputSchema } from 'definitions/actions'
import { envelopeEventSchema } from 'definitions/events'

export default new IntegrationDefinition({
name: 'docusign',
title: 'Docusign',
version: '2.0.1',
readme: 'hub.md',
icon: 'icon.svg',
description:
'Automate document workflows, generate intelligent insights, enhance security measures, and improve user experience.',
configuration: {
identifier: {
linkTemplateScript: 'linkTemplate.vrl',
},
schema: z.object({
accountId: z
.string()
.optional()
.title('API Account ID (Optional)')
.describe(
'The docusign user\'s "API Account ID" (This is a GUID that is found in "Apps & Keys")\nThe default account will be selected if left empty'
)
.placeholder('e.g. a1b2c3d4-e5f6-g7h8-i9j0-d4c3b2a1'),
}),
},
actions: {
sendEnvelope: {
title: 'Send Envelope',
description: 'Sends an envelope (document) to a recipient to sign it',
input: {
schema: sendEnvelopeInputSchema,
},
output: {
schema: sendEnvelopeOutputSchema,
},
},
},
events: {
envelopeSent: {
title: 'Envelope Sent',
description: 'An event that triggers when an envelope is sent to the recipient(s) to be signed',
schema: envelopeEventSchema,
},
envelopeResent: {
title: 'Envelope Resent',
description: 'An event that triggers when an envelope is resent to the recipient(s) via the dashboard',
schema: envelopeEventSchema,
},
envelopeCompleted: {
title: 'Envelope Completed',
description: 'An event that triggers when an envelope has been completed/signed by all recipient(s)',
schema: envelopeEventSchema,
},
envelopeDeclined: {
title: 'Envelope Declined',
description: 'An event that triggers when a recipient has declined to sign an envelope',
schema: envelopeEventSchema,
},
envelopeVoided: {
title: 'Envelope Voided',
description: 'An event that triggers when an envelope has been voided by the sender',
schema: envelopeEventSchema,
},
},
secrets: {
OAUTH_BASE_URL: {
description: 'The base URL used for OAuth authentication',
},
OAUTH_CLIENT_ID: {
description: "The unique identifier that's used to initiate the OAuth flow",
},
OAUTH_CLIENT_SECRET: {
description: "A secret that's used to establish and refresh the OAuth authentication",
},
},
states: {
configuration: {
type: 'integration',
schema: z.object({
oauth: z
.object({
refreshToken: z.string().describe('The refresh token for the integration').title('Refresh Token'),
accessToken: z.string().describe('The access token for the integration').title('Access Token'),
tokenType: z
.string()
.describe('The authentication header type for the access token (e.g. "Bearer")')
.title('Token Type'),
expiresAt: z
.number()
.min(0)
.describe('The expiry time of the access token represented as a Unix timestamp (milliseconds)')
.title('Expires At'),
})
.describe('The parameters used for accessing the Docusign API and refreshing the access token')
.title('OAuth Parameters')
.nullable(),
}),
},
account: {
type: 'integration',
schema: z.object({
account: z
.object({
id: z.string().title('API Account ID').describe("The docusign user's api account id"),
baseUri: z.string().describe('The base URI for the Docusign API').title('Base URI'),
refreshAt: z
.number()
.min(0)
.title('Refresh At')
.describe(
'The unix timestamp (milliseconds) that the selected account will be refreshed (Only when not explicitly selected in the config)'
)
.nullable(),
})
.title('Account Info')
.describe("The docusign account's info")
.nullable(),
}),
},
},
})
13 changes: 13 additions & 0 deletions integrations/docusign/linkTemplate.vrl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
webhookId = to_string!(.webhookId)
webhookUrl = to_string!(.webhookUrl)
env = to_string!(.env)

baseDomain = "https://account-d.docusign.com/oauth/auth"
clientId = "785488f7-c2a8-4b9f-b9ca-6a94b3dd317c"

if env == "production" {
baseDomain = "https://account.docusign.com/oauth/auth"
clientId = "c32faf9a-a4c7-43dc-9b3a-3e1e902c40ec"
}

"{{baseDomain}}?client_id={{ clientId }}&response_type=code&scope=signature&state={{ webhookId }}&redirect_uri={{ webhookUrl }}/oauth"
18 changes: 18 additions & 0 deletions integrations/docusign/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "@botpresshub/docusign",
"scripts": {
"build": "bp add -y && bp build",
"check:type": "tsc --noEmit",
"check:bplint": "bp lint"
},
"private": true,
"dependencies": {
"@botpress/client": "workspace:*",
"@botpress/sdk": "workspace:*",
"axios": "^1.12.2",
"docusign-esign": "^8.4.0"
},
"devDependencies": {
"@types/docusign-esign": "^5.19.9"
}
}
6 changes: 6 additions & 0 deletions integrations/docusign/src/actions/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { sendEnvelope } from './send-envelope'
import * as bp from '.botpress'

export default {
sendEnvelope,
} satisfies bp.IntegrationProps['actions']
14 changes: 14 additions & 0 deletions integrations/docusign/src/actions/send-envelope.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { DocusignClient } from '../docusign-api'
import { sendEnvelopeInputToEnvelopeDefinition } from '../docusign-api/helpers'
import * as bp from '.botpress'

export const sendEnvelope: bp.IntegrationProps['actions']['sendEnvelope'] = async ({ input, ...props }) => {
const envelopeDef = sendEnvelopeInputToEnvelopeDefinition(input)

const apiClient = await DocusignClient.create(props)
const resp = await apiClient.sendEnvelope(envelopeDef)

return {
envelopeId: resp.envelopeId,
}
}
1 change: 1 addition & 0 deletions integrations/docusign/src/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const CONVERSATION_ID_FIELD_KEY = 'Botpress-Conversation-ID'
Loading
Loading