@automate.ax/catalog 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +3 -0
- package/dist/catalog.d.ts +1106 -0
- package/dist/catalog.js +349 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/triggers/airtable.d.ts +62 -0
- package/dist/triggers/airtable.js +36 -0
- package/dist/triggers/asana.d.ts +65 -0
- package/dist/triggers/asana.js +39 -0
- package/dist/triggers/brevo.d.ts +111 -0
- package/dist/triggers/brevo.js +65 -0
- package/dist/triggers/core.d.ts +50 -0
- package/dist/triggers/core.js +74 -0
- package/dist/triggers/github.d.ts +228 -0
- package/dist/triggers/github.js +136 -0
- package/dist/triggers/google.d.ts +126 -0
- package/dist/triggers/google.js +143 -0
- package/dist/triggers/index.d.ts +2598 -0
- package/dist/triggers/index.js +97 -0
- package/dist/triggers/linear.d.ts +110 -0
- package/dist/triggers/linear.js +59 -0
- package/dist/triggers/microsoft.d.ts +40 -0
- package/dist/triggers/microsoft.js +60 -0
- package/dist/triggers/resend.d.ts +110 -0
- package/dist/triggers/resend.js +59 -0
- package/dist/triggers/slack.d.ts +41 -0
- package/dist/triggers/slack.js +53 -0
- package/dist/triggers/trello.d.ts +56 -0
- package/dist/triggers/trello.js +35 -0
- package/dist/triggers/vercel.d.ts +279 -0
- package/dist/triggers/vercel.js +163 -0
- package/dist/triggers/whatsapp.d.ts +65 -0
- package/dist/triggers/whatsapp.js +39 -0
- package/dist/types.d.ts +134 -0
- package/dist/types.js +59 -0
- package/package.json +70 -0
- package/src/catalog.ts +403 -0
- package/src/index.ts +68 -0
- package/src/triggers/airtable.ts +39 -0
- package/src/triggers/asana.ts +42 -0
- package/src/triggers/brevo.ts +68 -0
- package/src/triggers/core.ts +93 -0
- package/src/triggers/github.ts +142 -0
- package/src/triggers/google.ts +149 -0
- package/src/triggers/index.ts +128 -0
- package/src/triggers/linear.ts +62 -0
- package/src/triggers/microsoft.ts +65 -0
- package/src/triggers/resend.ts +62 -0
- package/src/triggers/slack.ts +58 -0
- package/src/triggers/trello.ts +38 -0
- package/src/triggers/vercel.ts +170 -0
- package/src/triggers/whatsapp.ts +42 -0
- package/src/types.ts +219 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { airtableTriggerDefinitions } from "./airtable"
|
|
2
|
+
import { asanaTriggerDefinitions } from "./asana"
|
|
3
|
+
import { brevoTriggerDefinitions } from "./brevo"
|
|
4
|
+
import { coreTriggerDefinitions } from "./core"
|
|
5
|
+
import { githubTriggerDefinitions } from "./github"
|
|
6
|
+
import { googleTriggerDefinitions } from "./google"
|
|
7
|
+
import { linearTriggerDefinitions } from "./linear"
|
|
8
|
+
import { microsoftTriggerDefinitions } from "./microsoft"
|
|
9
|
+
import { resendTriggerDefinitions } from "./resend"
|
|
10
|
+
import { slackTriggerDefinitions } from "./slack"
|
|
11
|
+
import { trelloTriggerDefinitions } from "./trello"
|
|
12
|
+
import { vercelTriggerDefinitions } from "./vercel"
|
|
13
|
+
import { whatsappTriggerDefinitions } from "./whatsapp"
|
|
14
|
+
import { getIntegrationService } from "../catalog"
|
|
15
|
+
import type {
|
|
16
|
+
TriggerDefinition,
|
|
17
|
+
TriggerPresentation,
|
|
18
|
+
TriggerPresentationContext,
|
|
19
|
+
} from "../types"
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
getHttpTriggerEndpoint,
|
|
23
|
+
getHttpTriggerEndpointKey,
|
|
24
|
+
type HttpTriggerEndpointOptions,
|
|
25
|
+
type HttpTriggerScope,
|
|
26
|
+
} from "./core"
|
|
27
|
+
|
|
28
|
+
/** Plain shared definitions for every public trigger type. */
|
|
29
|
+
export const triggerDefinitions = {
|
|
30
|
+
...airtableTriggerDefinitions,
|
|
31
|
+
...asanaTriggerDefinitions,
|
|
32
|
+
...brevoTriggerDefinitions,
|
|
33
|
+
...coreTriggerDefinitions,
|
|
34
|
+
...githubTriggerDefinitions,
|
|
35
|
+
...googleTriggerDefinitions,
|
|
36
|
+
...linearTriggerDefinitions,
|
|
37
|
+
...microsoftTriggerDefinitions,
|
|
38
|
+
...resendTriggerDefinitions,
|
|
39
|
+
...slackTriggerDefinitions,
|
|
40
|
+
...trelloTriggerDefinitions,
|
|
41
|
+
...vercelTriggerDefinitions,
|
|
42
|
+
...whatsappTriggerDefinitions,
|
|
43
|
+
} as const satisfies Record<string, TriggerDefinition>
|
|
44
|
+
|
|
45
|
+
/** Trigger definitions with inferred display names materialized. */
|
|
46
|
+
export const triggerCatalog = Object.values(triggerDefinitions).map(
|
|
47
|
+
(definition) => ({
|
|
48
|
+
...definition,
|
|
49
|
+
name:
|
|
50
|
+
("name" in definition ? definition.name : undefined) ??
|
|
51
|
+
inferTriggerName(definition),
|
|
52
|
+
}),
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
export type TriggerType = (typeof triggerCatalog)[number]["type"]
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Looks up one known trigger by its stable event type.
|
|
59
|
+
*
|
|
60
|
+
* @param type - Stable public event type.
|
|
61
|
+
*/
|
|
62
|
+
export function getTriggerDefinition(
|
|
63
|
+
type: string,
|
|
64
|
+
): (TriggerDefinition & { name: string }) | undefined {
|
|
65
|
+
return triggerCatalog.find((trigger) => trigger.type === type)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Resolves the display name for a stable event type.
|
|
70
|
+
*
|
|
71
|
+
* Known trigger types use their catalog name. Unknown types fall back to the
|
|
72
|
+
* same sentence-case convention used by catalog definitions.
|
|
73
|
+
*
|
|
74
|
+
* @param type - Stable event type to name.
|
|
75
|
+
*/
|
|
76
|
+
export function getTriggerName(type: string) {
|
|
77
|
+
return getTriggerDefinition(type)?.name ?? sentenceCase(type)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Describes one configured trigger using its shared client-safe definition.
|
|
82
|
+
*
|
|
83
|
+
* @param context - Trigger identity, configuration, and public application
|
|
84
|
+
* origin.
|
|
85
|
+
*/
|
|
86
|
+
export function getTriggerPresentation(
|
|
87
|
+
context: TriggerPresentationContext & { eventType: string },
|
|
88
|
+
): TriggerPresentation {
|
|
89
|
+
const definition = getTriggerDefinition(context.eventType)
|
|
90
|
+
|
|
91
|
+
return {
|
|
92
|
+
details: definition?.getDetails?.(context) ?? [],
|
|
93
|
+
name: definition?.name ?? getTriggerName(context.eventType),
|
|
94
|
+
type: context.eventType,
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Infers presentation copy from a trigger's stable event type.
|
|
100
|
+
*
|
|
101
|
+
* @param definition - Trigger definition to name.
|
|
102
|
+
*/
|
|
103
|
+
function inferTriggerName(definition: TriggerDefinition) {
|
|
104
|
+
const [namespace = definition.type] = definition.type.split(".")
|
|
105
|
+
const inferredName = sentenceCase(definition.type)
|
|
106
|
+
const service =
|
|
107
|
+
definition.account?.serviceId.toLowerCase() === namespace.toLowerCase()
|
|
108
|
+
? getIntegrationService(definition.account.serviceId)
|
|
109
|
+
: undefined
|
|
110
|
+
|
|
111
|
+
return service
|
|
112
|
+
? inferredName.replace(sentenceCase(namespace), service.name)
|
|
113
|
+
: inferredName
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Converts a stable identifier to a sentence-cased display name.
|
|
118
|
+
*
|
|
119
|
+
* @param value - Stable identifier to format.
|
|
120
|
+
*/
|
|
121
|
+
function sentenceCase(value: string) {
|
|
122
|
+
const words = value
|
|
123
|
+
.replaceAll(/([a-z\d])([A-Z])/g, "$1 $2")
|
|
124
|
+
.replaceAll(/[._-]+/g, " ")
|
|
125
|
+
.toLowerCase()
|
|
126
|
+
|
|
127
|
+
return words.charAt(0).toUpperCase() + words.slice(1)
|
|
128
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { linearService } from "../catalog"
|
|
2
|
+
import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
|
|
3
|
+
|
|
4
|
+
const LINEAR_ACCOUNT = {
|
|
5
|
+
connectionOptions: [
|
|
6
|
+
{
|
|
7
|
+
requiredScopes: ["read"],
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
serviceId: linearService.id,
|
|
11
|
+
} as const satisfies IntegrationAccountRequirement
|
|
12
|
+
|
|
13
|
+
export const linearTriggerDefinitions = {
|
|
14
|
+
linearCommentCreated: {
|
|
15
|
+
account: LINEAR_ACCOUNT,
|
|
16
|
+
type: "linear.comment.created",
|
|
17
|
+
},
|
|
18
|
+
linearCommentEvent: {
|
|
19
|
+
account: LINEAR_ACCOUNT,
|
|
20
|
+
type: "linear.comment.event",
|
|
21
|
+
},
|
|
22
|
+
linearCommentRemoved: {
|
|
23
|
+
account: LINEAR_ACCOUNT,
|
|
24
|
+
type: "linear.comment.removed",
|
|
25
|
+
},
|
|
26
|
+
linearCommentUpdated: {
|
|
27
|
+
account: LINEAR_ACCOUNT,
|
|
28
|
+
type: "linear.comment.updated",
|
|
29
|
+
},
|
|
30
|
+
linearIssueCreated: {
|
|
31
|
+
account: LINEAR_ACCOUNT,
|
|
32
|
+
type: "linear.issue.created",
|
|
33
|
+
},
|
|
34
|
+
linearIssueEvent: {
|
|
35
|
+
account: LINEAR_ACCOUNT,
|
|
36
|
+
type: "linear.issue.event",
|
|
37
|
+
},
|
|
38
|
+
linearIssueRemoved: {
|
|
39
|
+
account: LINEAR_ACCOUNT,
|
|
40
|
+
type: "linear.issue.removed",
|
|
41
|
+
},
|
|
42
|
+
linearIssueUpdated: {
|
|
43
|
+
account: LINEAR_ACCOUNT,
|
|
44
|
+
type: "linear.issue.updated",
|
|
45
|
+
},
|
|
46
|
+
linearProjectCreated: {
|
|
47
|
+
account: LINEAR_ACCOUNT,
|
|
48
|
+
type: "linear.project.created",
|
|
49
|
+
},
|
|
50
|
+
linearProjectEvent: {
|
|
51
|
+
account: LINEAR_ACCOUNT,
|
|
52
|
+
type: "linear.project.event",
|
|
53
|
+
},
|
|
54
|
+
linearProjectRemoved: {
|
|
55
|
+
account: LINEAR_ACCOUNT,
|
|
56
|
+
type: "linear.project.removed",
|
|
57
|
+
},
|
|
58
|
+
linearProjectUpdated: {
|
|
59
|
+
account: LINEAR_ACCOUNT,
|
|
60
|
+
type: "linear.project.updated",
|
|
61
|
+
},
|
|
62
|
+
} as const satisfies Record<string, TriggerDefinition>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { microsoftService } from "../catalog"
|
|
2
|
+
import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
|
|
3
|
+
|
|
4
|
+
const OUTLOOK_ACCOUNT = {
|
|
5
|
+
connectionOptions: [
|
|
6
|
+
{
|
|
7
|
+
requiredScopes: [
|
|
8
|
+
{
|
|
9
|
+
requirements: ["Mail.ReadWrite", "Mail.Read"],
|
|
10
|
+
type: "or",
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
serviceId: microsoftService.id,
|
|
16
|
+
} as const satisfies IntegrationAccountRequirement
|
|
17
|
+
|
|
18
|
+
const TEAMS_CHANNEL_MESSAGE_ACCOUNT = {
|
|
19
|
+
connectionOptions: [
|
|
20
|
+
{
|
|
21
|
+
requiredScopes: [
|
|
22
|
+
{
|
|
23
|
+
requirements: [
|
|
24
|
+
"ChannelMessage.Read.All",
|
|
25
|
+
"Team.ReadBasic.All",
|
|
26
|
+
"Channel.ReadBasic.All",
|
|
27
|
+
],
|
|
28
|
+
type: "and",
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
serviceId: microsoftService.id,
|
|
34
|
+
} as const satisfies IntegrationAccountRequirement
|
|
35
|
+
|
|
36
|
+
const TEAMS_CHAT_MESSAGE_ACCOUNT = {
|
|
37
|
+
connectionOptions: [
|
|
38
|
+
{
|
|
39
|
+
requiredScopes: [
|
|
40
|
+
{
|
|
41
|
+
requirements: ["Chat.ReadWrite", "Chat.Read"],
|
|
42
|
+
type: "or",
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
serviceId: microsoftService.id,
|
|
48
|
+
} as const satisfies IntegrationAccountRequirement
|
|
49
|
+
|
|
50
|
+
export const microsoftTriggerDefinitions = {
|
|
51
|
+
outlookEmailReceived: {
|
|
52
|
+
account: OUTLOOK_ACCOUNT,
|
|
53
|
+
type: "outlook.email.received",
|
|
54
|
+
},
|
|
55
|
+
teamsChannelMessagePosted: {
|
|
56
|
+
account: TEAMS_CHANNEL_MESSAGE_ACCOUNT,
|
|
57
|
+
name: "Microsoft Teams channel message posted",
|
|
58
|
+
type: "teams.channel.message.posted",
|
|
59
|
+
},
|
|
60
|
+
teamsChatMessagePosted: {
|
|
61
|
+
account: TEAMS_CHAT_MESSAGE_ACCOUNT,
|
|
62
|
+
name: "Microsoft Teams chat message posted",
|
|
63
|
+
type: "teams.chat.message.posted",
|
|
64
|
+
},
|
|
65
|
+
} as const satisfies Record<string, TriggerDefinition>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { resendService } from "../catalog"
|
|
2
|
+
import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
|
|
3
|
+
|
|
4
|
+
const RESEND_ACCOUNT = {
|
|
5
|
+
connectionOptions: [
|
|
6
|
+
{
|
|
7
|
+
requiredScopes: [],
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
serviceId: resendService.id,
|
|
11
|
+
} as const satisfies IntegrationAccountRequirement
|
|
12
|
+
|
|
13
|
+
export const resendTriggerDefinitions = {
|
|
14
|
+
resendEmailBounced: {
|
|
15
|
+
account: RESEND_ACCOUNT,
|
|
16
|
+
type: "resend.email.bounced",
|
|
17
|
+
},
|
|
18
|
+
resendEmailClicked: {
|
|
19
|
+
account: RESEND_ACCOUNT,
|
|
20
|
+
type: "resend.email.clicked",
|
|
21
|
+
},
|
|
22
|
+
resendEmailComplained: {
|
|
23
|
+
account: RESEND_ACCOUNT,
|
|
24
|
+
type: "resend.email.complained",
|
|
25
|
+
},
|
|
26
|
+
resendEmailDelivered: {
|
|
27
|
+
account: RESEND_ACCOUNT,
|
|
28
|
+
type: "resend.email.delivered",
|
|
29
|
+
},
|
|
30
|
+
resendEmailDeliveryDelayed: {
|
|
31
|
+
account: RESEND_ACCOUNT,
|
|
32
|
+
type: "resend.email.deliveryDelayed",
|
|
33
|
+
},
|
|
34
|
+
resendEmailEvent: {
|
|
35
|
+
account: RESEND_ACCOUNT,
|
|
36
|
+
type: "resend.email.event",
|
|
37
|
+
},
|
|
38
|
+
resendEmailFailed: {
|
|
39
|
+
account: RESEND_ACCOUNT,
|
|
40
|
+
type: "resend.email.failed",
|
|
41
|
+
},
|
|
42
|
+
resendEmailOpened: {
|
|
43
|
+
account: RESEND_ACCOUNT,
|
|
44
|
+
type: "resend.email.opened",
|
|
45
|
+
},
|
|
46
|
+
resendEmailReceived: {
|
|
47
|
+
account: RESEND_ACCOUNT,
|
|
48
|
+
type: "resend.email.received",
|
|
49
|
+
},
|
|
50
|
+
resendEmailScheduled: {
|
|
51
|
+
account: RESEND_ACCOUNT,
|
|
52
|
+
type: "resend.email.scheduled",
|
|
53
|
+
},
|
|
54
|
+
resendEmailSent: {
|
|
55
|
+
account: RESEND_ACCOUNT,
|
|
56
|
+
type: "resend.email.sent",
|
|
57
|
+
},
|
|
58
|
+
resendEmailSuppressed: {
|
|
59
|
+
account: RESEND_ACCOUNT,
|
|
60
|
+
type: "resend.email.suppressed",
|
|
61
|
+
},
|
|
62
|
+
} as const satisfies Record<string, TriggerDefinition>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { slackService } from "../catalog"
|
|
2
|
+
import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
|
|
3
|
+
|
|
4
|
+
const SLACK_APP_MENTION_ACCOUNT = {
|
|
5
|
+
connectionOptions: [
|
|
6
|
+
{
|
|
7
|
+
requiredScopes: ["app_mentions:read"],
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
serviceId: slackService.id,
|
|
11
|
+
} as const satisfies IntegrationAccountRequirement
|
|
12
|
+
|
|
13
|
+
const SLACK_MESSAGE_ACCOUNT = {
|
|
14
|
+
connectionOptions: [
|
|
15
|
+
{
|
|
16
|
+
requiredScopes: [
|
|
17
|
+
{
|
|
18
|
+
requirements: [
|
|
19
|
+
"channels:history",
|
|
20
|
+
"groups:history",
|
|
21
|
+
"im:history",
|
|
22
|
+
"mpim:history",
|
|
23
|
+
],
|
|
24
|
+
type: "and",
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
serviceId: slackService.id,
|
|
30
|
+
} as const satisfies IntegrationAccountRequirement
|
|
31
|
+
|
|
32
|
+
const SLACK_REACTION_ACCOUNT = {
|
|
33
|
+
connectionOptions: [
|
|
34
|
+
{
|
|
35
|
+
requiredScopes: ["reactions:read"],
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
serviceId: slackService.id,
|
|
39
|
+
} as const satisfies IntegrationAccountRequirement
|
|
40
|
+
|
|
41
|
+
export const slackTriggerDefinitions = {
|
|
42
|
+
slackAppMentioned: {
|
|
43
|
+
account: SLACK_APP_MENTION_ACCOUNT,
|
|
44
|
+
type: "slack.app.mentioned",
|
|
45
|
+
},
|
|
46
|
+
slackMessagePosted: {
|
|
47
|
+
account: SLACK_MESSAGE_ACCOUNT,
|
|
48
|
+
type: "slack.message.posted",
|
|
49
|
+
},
|
|
50
|
+
slackReactionAdded: {
|
|
51
|
+
account: SLACK_REACTION_ACCOUNT,
|
|
52
|
+
type: "slack.reaction.added",
|
|
53
|
+
},
|
|
54
|
+
slackReactionRemoved: {
|
|
55
|
+
account: SLACK_REACTION_ACCOUNT,
|
|
56
|
+
type: "slack.reaction.removed",
|
|
57
|
+
},
|
|
58
|
+
} as const satisfies Record<string, TriggerDefinition>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { trelloService } from "../catalog"
|
|
2
|
+
import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
|
|
3
|
+
|
|
4
|
+
const TRELLO_ACCOUNT = {
|
|
5
|
+
connectionOptions: [
|
|
6
|
+
{
|
|
7
|
+
requiredScopes: [],
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
serviceId: trelloService.id,
|
|
11
|
+
} as const satisfies IntegrationAccountRequirement
|
|
12
|
+
|
|
13
|
+
export const trelloTriggerDefinitions = {
|
|
14
|
+
trelloBoardEvent: {
|
|
15
|
+
account: TRELLO_ACCOUNT,
|
|
16
|
+
type: "trello.board.event",
|
|
17
|
+
},
|
|
18
|
+
trelloCardArchived: {
|
|
19
|
+
account: TRELLO_ACCOUNT,
|
|
20
|
+
type: "trello.card.archived",
|
|
21
|
+
},
|
|
22
|
+
trelloCardCommented: {
|
|
23
|
+
account: TRELLO_ACCOUNT,
|
|
24
|
+
type: "trello.card.commented",
|
|
25
|
+
},
|
|
26
|
+
trelloCardCreated: {
|
|
27
|
+
account: TRELLO_ACCOUNT,
|
|
28
|
+
type: "trello.card.created",
|
|
29
|
+
},
|
|
30
|
+
trelloCardMoved: {
|
|
31
|
+
account: TRELLO_ACCOUNT,
|
|
32
|
+
type: "trello.card.moved",
|
|
33
|
+
},
|
|
34
|
+
trelloCardUpdated: {
|
|
35
|
+
account: TRELLO_ACCOUNT,
|
|
36
|
+
type: "trello.card.updated",
|
|
37
|
+
},
|
|
38
|
+
} as const satisfies Record<string, TriggerDefinition>
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { vercelService } from "../catalog"
|
|
2
|
+
import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
|
|
3
|
+
|
|
4
|
+
const VERCEL_DEPLOYMENT_ACCOUNT = {
|
|
5
|
+
connectionOptions: [
|
|
6
|
+
{
|
|
7
|
+
connectionId: "oauth",
|
|
8
|
+
requiredScopes: ["deployment:read"],
|
|
9
|
+
},
|
|
10
|
+
],
|
|
11
|
+
serviceId: vercelService.id,
|
|
12
|
+
} as const satisfies IntegrationAccountRequirement
|
|
13
|
+
|
|
14
|
+
const VERCEL_INTEGRATION_CONFIGURATION_ACCOUNT = {
|
|
15
|
+
connectionOptions: [
|
|
16
|
+
{
|
|
17
|
+
connectionId: "oauth",
|
|
18
|
+
requiredScopes: [],
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
serviceId: vercelService.id,
|
|
22
|
+
} as const satisfies IntegrationAccountRequirement
|
|
23
|
+
|
|
24
|
+
const VERCEL_PROJECT_ACCOUNT = {
|
|
25
|
+
connectionOptions: [
|
|
26
|
+
{
|
|
27
|
+
connectionId: "oauth",
|
|
28
|
+
requiredScopes: ["project:read"],
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
serviceId: vercelService.id,
|
|
32
|
+
} as const satisfies IntegrationAccountRequirement
|
|
33
|
+
|
|
34
|
+
const VERCEL_PROJECT_DOMAIN_ACCOUNT = {
|
|
35
|
+
connectionOptions: [
|
|
36
|
+
{
|
|
37
|
+
connectionId: "oauth",
|
|
38
|
+
requiredScopes: ["domain:read"],
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
serviceId: vercelService.id,
|
|
42
|
+
} as const satisfies IntegrationAccountRequirement
|
|
43
|
+
|
|
44
|
+
const VERCEL_PROJECT_ENVIRONMENT_VARIABLE_ACCOUNT = {
|
|
45
|
+
connectionOptions: [
|
|
46
|
+
{
|
|
47
|
+
connectionId: "oauth",
|
|
48
|
+
requiredScopes: ["global-project-env-vars:read"],
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
serviceId: vercelService.id,
|
|
52
|
+
} as const satisfies IntegrationAccountRequirement
|
|
53
|
+
|
|
54
|
+
export const vercelTriggerDefinitions = {
|
|
55
|
+
vercelDeployment: {
|
|
56
|
+
account: VERCEL_DEPLOYMENT_ACCOUNT,
|
|
57
|
+
name: "Vercel deployment event",
|
|
58
|
+
type: "vercel.deployment",
|
|
59
|
+
},
|
|
60
|
+
vercelDeploymentCanceled: {
|
|
61
|
+
account: VERCEL_DEPLOYMENT_ACCOUNT,
|
|
62
|
+
type: "vercel.deployment.canceled",
|
|
63
|
+
},
|
|
64
|
+
vercelDeploymentCreated: {
|
|
65
|
+
account: VERCEL_DEPLOYMENT_ACCOUNT,
|
|
66
|
+
type: "vercel.deployment.created",
|
|
67
|
+
},
|
|
68
|
+
vercelDeploymentFailed: {
|
|
69
|
+
account: VERCEL_DEPLOYMENT_ACCOUNT,
|
|
70
|
+
type: "vercel.deployment.failed",
|
|
71
|
+
},
|
|
72
|
+
vercelDeploymentPromoted: {
|
|
73
|
+
account: VERCEL_DEPLOYMENT_ACCOUNT,
|
|
74
|
+
type: "vercel.deployment.promoted",
|
|
75
|
+
},
|
|
76
|
+
vercelDeploymentReady: {
|
|
77
|
+
account: VERCEL_DEPLOYMENT_ACCOUNT,
|
|
78
|
+
type: "vercel.deployment.ready",
|
|
79
|
+
},
|
|
80
|
+
vercelDeploymentSucceeded: {
|
|
81
|
+
account: VERCEL_DEPLOYMENT_ACCOUNT,
|
|
82
|
+
type: "vercel.deployment.succeeded",
|
|
83
|
+
},
|
|
84
|
+
vercelIntegrationConfiguration: {
|
|
85
|
+
account: VERCEL_INTEGRATION_CONFIGURATION_ACCOUNT,
|
|
86
|
+
name: "Vercel integration configuration event",
|
|
87
|
+
type: "vercel.integration-configuration",
|
|
88
|
+
},
|
|
89
|
+
vercelIntegrationConfigurationPermissionUpgraded: {
|
|
90
|
+
account: VERCEL_INTEGRATION_CONFIGURATION_ACCOUNT,
|
|
91
|
+
name: "Vercel integration permission upgraded",
|
|
92
|
+
type: "vercel.integration-configuration.permissionUpgraded",
|
|
93
|
+
},
|
|
94
|
+
vercelIntegrationConfigurationRemoved: {
|
|
95
|
+
account: VERCEL_INTEGRATION_CONFIGURATION_ACCOUNT,
|
|
96
|
+
type: "vercel.integration-configuration.removed",
|
|
97
|
+
},
|
|
98
|
+
vercelIntegrationConfigurationScopeChangeConfirmed: {
|
|
99
|
+
account: VERCEL_INTEGRATION_CONFIGURATION_ACCOUNT,
|
|
100
|
+
name: "Vercel integration scope change confirmed",
|
|
101
|
+
type: "vercel.integration-configuration.scopeChangeConfirmed",
|
|
102
|
+
},
|
|
103
|
+
vercelIntegrationConfigurationTransferred: {
|
|
104
|
+
account: VERCEL_INTEGRATION_CONFIGURATION_ACCOUNT,
|
|
105
|
+
type: "vercel.integration-configuration.transferred",
|
|
106
|
+
},
|
|
107
|
+
vercelProject: {
|
|
108
|
+
account: VERCEL_PROJECT_ACCOUNT,
|
|
109
|
+
name: "Vercel project event",
|
|
110
|
+
type: "vercel.project",
|
|
111
|
+
},
|
|
112
|
+
vercelProjectCreated: {
|
|
113
|
+
account: VERCEL_PROJECT_ACCOUNT,
|
|
114
|
+
type: "vercel.project.created",
|
|
115
|
+
},
|
|
116
|
+
vercelProjectDomain: {
|
|
117
|
+
account: VERCEL_PROJECT_DOMAIN_ACCOUNT,
|
|
118
|
+
name: "Vercel project domain event",
|
|
119
|
+
type: "vercel.project-domain",
|
|
120
|
+
},
|
|
121
|
+
vercelProjectDomainCreated: {
|
|
122
|
+
account: VERCEL_PROJECT_DOMAIN_ACCOUNT,
|
|
123
|
+
type: "vercel.project-domain.created",
|
|
124
|
+
},
|
|
125
|
+
vercelProjectDomainDeleted: {
|
|
126
|
+
account: VERCEL_PROJECT_DOMAIN_ACCOUNT,
|
|
127
|
+
type: "vercel.project-domain.deleted",
|
|
128
|
+
},
|
|
129
|
+
vercelProjectDomainMoved: {
|
|
130
|
+
account: VERCEL_PROJECT_DOMAIN_ACCOUNT,
|
|
131
|
+
type: "vercel.project-domain.moved",
|
|
132
|
+
},
|
|
133
|
+
vercelProjectDomainUnverified: {
|
|
134
|
+
account: VERCEL_PROJECT_DOMAIN_ACCOUNT,
|
|
135
|
+
type: "vercel.project-domain.unverified",
|
|
136
|
+
},
|
|
137
|
+
vercelProjectDomainUpdated: {
|
|
138
|
+
account: VERCEL_PROJECT_DOMAIN_ACCOUNT,
|
|
139
|
+
type: "vercel.project-domain.updated",
|
|
140
|
+
},
|
|
141
|
+
vercelProjectDomainVerified: {
|
|
142
|
+
account: VERCEL_PROJECT_DOMAIN_ACCOUNT,
|
|
143
|
+
type: "vercel.project-domain.verified",
|
|
144
|
+
},
|
|
145
|
+
vercelProjectEnvironmentVariable: {
|
|
146
|
+
account: VERCEL_PROJECT_ENVIRONMENT_VARIABLE_ACCOUNT,
|
|
147
|
+
name: "Vercel project environment variable event",
|
|
148
|
+
type: "vercel.project-environment-variable",
|
|
149
|
+
},
|
|
150
|
+
vercelProjectEnvironmentVariableCreated: {
|
|
151
|
+
account: VERCEL_PROJECT_ENVIRONMENT_VARIABLE_ACCOUNT,
|
|
152
|
+
type: "vercel.project-environment-variable.created",
|
|
153
|
+
},
|
|
154
|
+
vercelProjectEnvironmentVariableDeleted: {
|
|
155
|
+
account: VERCEL_PROJECT_ENVIRONMENT_VARIABLE_ACCOUNT,
|
|
156
|
+
type: "vercel.project-environment-variable.deleted",
|
|
157
|
+
},
|
|
158
|
+
vercelProjectEnvironmentVariableUpdated: {
|
|
159
|
+
account: VERCEL_PROJECT_ENVIRONMENT_VARIABLE_ACCOUNT,
|
|
160
|
+
type: "vercel.project-environment-variable.updated",
|
|
161
|
+
},
|
|
162
|
+
vercelProjectRemoved: {
|
|
163
|
+
account: VERCEL_PROJECT_ACCOUNT,
|
|
164
|
+
type: "vercel.project.removed",
|
|
165
|
+
},
|
|
166
|
+
vercelProjectRenamed: {
|
|
167
|
+
account: VERCEL_PROJECT_ACCOUNT,
|
|
168
|
+
type: "vercel.project.renamed",
|
|
169
|
+
},
|
|
170
|
+
} as const satisfies Record<string, TriggerDefinition>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { whatsappService } from "../catalog"
|
|
2
|
+
import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
|
|
3
|
+
|
|
4
|
+
const WHATSAPP_ACCOUNT = {
|
|
5
|
+
connectionOptions: [
|
|
6
|
+
{
|
|
7
|
+
requiredScopes: ["whatsapp_business_messaging"],
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
serviceId: whatsappService.id,
|
|
11
|
+
} as const satisfies IntegrationAccountRequirement
|
|
12
|
+
|
|
13
|
+
export const whatsappTriggerDefinitions = {
|
|
14
|
+
whatsappMessageDelivered: {
|
|
15
|
+
account: WHATSAPP_ACCOUNT,
|
|
16
|
+
type: "whatsapp.message.delivered",
|
|
17
|
+
},
|
|
18
|
+
whatsappMessageFailed: {
|
|
19
|
+
account: WHATSAPP_ACCOUNT,
|
|
20
|
+
type: "whatsapp.message.failed",
|
|
21
|
+
},
|
|
22
|
+
whatsappMessagePlayed: {
|
|
23
|
+
account: WHATSAPP_ACCOUNT,
|
|
24
|
+
type: "whatsapp.message.played",
|
|
25
|
+
},
|
|
26
|
+
whatsappMessageRead: {
|
|
27
|
+
account: WHATSAPP_ACCOUNT,
|
|
28
|
+
type: "whatsapp.message.read",
|
|
29
|
+
},
|
|
30
|
+
whatsappMessageReceived: {
|
|
31
|
+
account: WHATSAPP_ACCOUNT,
|
|
32
|
+
type: "whatsapp.message.received",
|
|
33
|
+
},
|
|
34
|
+
whatsappMessageSent: {
|
|
35
|
+
account: WHATSAPP_ACCOUNT,
|
|
36
|
+
type: "whatsapp.message.sent",
|
|
37
|
+
},
|
|
38
|
+
whatsappMessageStatusEvent: {
|
|
39
|
+
account: WHATSAPP_ACCOUNT,
|
|
40
|
+
type: "whatsapp.message.statusEvent",
|
|
41
|
+
},
|
|
42
|
+
} as const satisfies Record<string, TriggerDefinition>
|