@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
package/src/index.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export {
|
|
2
|
+
airtableService,
|
|
3
|
+
anthropicService,
|
|
4
|
+
apolloService,
|
|
5
|
+
asanaService,
|
|
6
|
+
brevoService,
|
|
7
|
+
cerebrasService,
|
|
8
|
+
cloudflareService,
|
|
9
|
+
cohereService,
|
|
10
|
+
deepinfraService,
|
|
11
|
+
deepseekService,
|
|
12
|
+
firecrawlService,
|
|
13
|
+
fireworksService,
|
|
14
|
+
getIntegrationService,
|
|
15
|
+
githubService,
|
|
16
|
+
googleGenaiService,
|
|
17
|
+
googleService,
|
|
18
|
+
groqService,
|
|
19
|
+
huggingfaceService,
|
|
20
|
+
integrationCatalog,
|
|
21
|
+
linearService,
|
|
22
|
+
microsoftService,
|
|
23
|
+
millionverifierService,
|
|
24
|
+
mistralService,
|
|
25
|
+
openaiService,
|
|
26
|
+
openrouterService,
|
|
27
|
+
perplexityService,
|
|
28
|
+
postgresService,
|
|
29
|
+
resendService,
|
|
30
|
+
scrapflyService,
|
|
31
|
+
slackService,
|
|
32
|
+
tidycalService,
|
|
33
|
+
togetheraiService,
|
|
34
|
+
trelloService,
|
|
35
|
+
vercelAiGatewayService,
|
|
36
|
+
vercelService,
|
|
37
|
+
whatsappService,
|
|
38
|
+
xaiService,
|
|
39
|
+
type IntegrationServiceId,
|
|
40
|
+
} from "./catalog"
|
|
41
|
+
export {
|
|
42
|
+
defineIntegrationCatalog,
|
|
43
|
+
defineIntegrationService,
|
|
44
|
+
scope,
|
|
45
|
+
type IntegrationAccountConnectionOption,
|
|
46
|
+
type IntegrationAccountRequirement,
|
|
47
|
+
type IntegrationConnectionDefinition,
|
|
48
|
+
type IntegrationFormField,
|
|
49
|
+
type IntegrationScopeRequirement,
|
|
50
|
+
type IntegrationServiceDefinition,
|
|
51
|
+
type ScopeRequirementGroup,
|
|
52
|
+
type TriggerDefinition,
|
|
53
|
+
type TriggerPresentation,
|
|
54
|
+
type TriggerPresentationContext,
|
|
55
|
+
type TriggerPresentationDetail,
|
|
56
|
+
} from "./types"
|
|
57
|
+
export {
|
|
58
|
+
getHttpTriggerEndpoint,
|
|
59
|
+
getHttpTriggerEndpointKey,
|
|
60
|
+
getTriggerDefinition,
|
|
61
|
+
getTriggerName,
|
|
62
|
+
getTriggerPresentation,
|
|
63
|
+
triggerCatalog,
|
|
64
|
+
triggerDefinitions,
|
|
65
|
+
type HttpTriggerEndpointOptions,
|
|
66
|
+
type HttpTriggerScope,
|
|
67
|
+
type TriggerType,
|
|
68
|
+
} from "./triggers"
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { airtableService } from "../catalog"
|
|
2
|
+
import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
|
|
3
|
+
|
|
4
|
+
const AIRTABLE_ACCOUNT = {
|
|
5
|
+
connectionOptions: [
|
|
6
|
+
{
|
|
7
|
+
requiredScopes: [
|
|
8
|
+
{
|
|
9
|
+
requirements: ["data.records:read", "webhook:manage"],
|
|
10
|
+
type: "and",
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
serviceId: airtableService.id,
|
|
16
|
+
} as const satisfies IntegrationAccountRequirement
|
|
17
|
+
|
|
18
|
+
export const airtableTriggerDefinitions = {
|
|
19
|
+
airtableRecordCreated: {
|
|
20
|
+
account: AIRTABLE_ACCOUNT,
|
|
21
|
+
type: "airtable.record.created",
|
|
22
|
+
},
|
|
23
|
+
airtableRecordDeleted: {
|
|
24
|
+
account: AIRTABLE_ACCOUNT,
|
|
25
|
+
type: "airtable.record.deleted",
|
|
26
|
+
},
|
|
27
|
+
airtableRecordMovedIntoView: {
|
|
28
|
+
account: AIRTABLE_ACCOUNT,
|
|
29
|
+
type: "airtable.record.movedIntoView",
|
|
30
|
+
},
|
|
31
|
+
airtableRecordMovedOutOfView: {
|
|
32
|
+
account: AIRTABLE_ACCOUNT,
|
|
33
|
+
type: "airtable.record.movedOutOfView",
|
|
34
|
+
},
|
|
35
|
+
airtableRecordUpdated: {
|
|
36
|
+
account: AIRTABLE_ACCOUNT,
|
|
37
|
+
type: "airtable.record.updated",
|
|
38
|
+
},
|
|
39
|
+
} as const satisfies Record<string, TriggerDefinition>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { asanaService } from "../catalog"
|
|
2
|
+
import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
|
|
3
|
+
|
|
4
|
+
const ASANA_ACCOUNT = {
|
|
5
|
+
connectionOptions: [
|
|
6
|
+
{
|
|
7
|
+
requiredScopes: [],
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
serviceId: asanaService.id,
|
|
11
|
+
} as const satisfies IntegrationAccountRequirement
|
|
12
|
+
|
|
13
|
+
export const asanaTriggerDefinitions = {
|
|
14
|
+
asanaCommentAdded: {
|
|
15
|
+
account: ASANA_ACCOUNT,
|
|
16
|
+
type: "asana.comment.added",
|
|
17
|
+
},
|
|
18
|
+
asanaEvent: {
|
|
19
|
+
account: ASANA_ACCOUNT,
|
|
20
|
+
type: "asana.event",
|
|
21
|
+
},
|
|
22
|
+
asanaTaskAdded: {
|
|
23
|
+
account: ASANA_ACCOUNT,
|
|
24
|
+
type: "asana.task.added",
|
|
25
|
+
},
|
|
26
|
+
asanaTaskChanged: {
|
|
27
|
+
account: ASANA_ACCOUNT,
|
|
28
|
+
type: "asana.task.changed",
|
|
29
|
+
},
|
|
30
|
+
asanaTaskCompleted: {
|
|
31
|
+
account: ASANA_ACCOUNT,
|
|
32
|
+
type: "asana.task.completed",
|
|
33
|
+
},
|
|
34
|
+
asanaTaskDeleted: {
|
|
35
|
+
account: ASANA_ACCOUNT,
|
|
36
|
+
type: "asana.task.deleted",
|
|
37
|
+
},
|
|
38
|
+
asanaTaskRemoved: {
|
|
39
|
+
account: ASANA_ACCOUNT,
|
|
40
|
+
type: "asana.task.removed",
|
|
41
|
+
},
|
|
42
|
+
} as const satisfies Record<string, TriggerDefinition>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { brevoService } from "../catalog"
|
|
2
|
+
import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
|
|
3
|
+
|
|
4
|
+
const BREVO_ACCOUNT = {
|
|
5
|
+
connectionOptions: [
|
|
6
|
+
{
|
|
7
|
+
requiredScopes: [],
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
serviceId: brevoService.id,
|
|
11
|
+
} as const satisfies IntegrationAccountRequirement
|
|
12
|
+
|
|
13
|
+
export const brevoTriggerDefinitions = {
|
|
14
|
+
brevoTransactionalBlocked: {
|
|
15
|
+
account: BREVO_ACCOUNT,
|
|
16
|
+
name: "Brevo email blocked",
|
|
17
|
+
type: "brevo.transactional.blocked",
|
|
18
|
+
},
|
|
19
|
+
brevoTransactionalClicked: {
|
|
20
|
+
account: BREVO_ACCOUNT,
|
|
21
|
+
name: "Brevo email clicked",
|
|
22
|
+
type: "brevo.transactional.clicked",
|
|
23
|
+
},
|
|
24
|
+
brevoTransactionalDeferred: {
|
|
25
|
+
account: BREVO_ACCOUNT,
|
|
26
|
+
name: "Brevo email deferred",
|
|
27
|
+
type: "brevo.transactional.deferred",
|
|
28
|
+
},
|
|
29
|
+
brevoTransactionalDelivered: {
|
|
30
|
+
account: BREVO_ACCOUNT,
|
|
31
|
+
name: "Brevo email delivered",
|
|
32
|
+
type: "brevo.transactional.delivered",
|
|
33
|
+
},
|
|
34
|
+
brevoTransactionalEvent: {
|
|
35
|
+
account: BREVO_ACCOUNT,
|
|
36
|
+
type: "brevo.transactional.event",
|
|
37
|
+
},
|
|
38
|
+
brevoTransactionalHardBounced: {
|
|
39
|
+
account: BREVO_ACCOUNT,
|
|
40
|
+
name: "Brevo email hard bounced",
|
|
41
|
+
type: "brevo.transactional.hardBounced",
|
|
42
|
+
},
|
|
43
|
+
brevoTransactionalMarkedAsSpam: {
|
|
44
|
+
account: BREVO_ACCOUNT,
|
|
45
|
+
name: "Brevo email marked as spam",
|
|
46
|
+
type: "brevo.transactional.markedAsSpam",
|
|
47
|
+
},
|
|
48
|
+
brevoTransactionalOpened: {
|
|
49
|
+
account: BREVO_ACCOUNT,
|
|
50
|
+
name: "Brevo email opened",
|
|
51
|
+
type: "brevo.transactional.opened",
|
|
52
|
+
},
|
|
53
|
+
brevoTransactionalSent: {
|
|
54
|
+
account: BREVO_ACCOUNT,
|
|
55
|
+
name: "Brevo email sent",
|
|
56
|
+
type: "brevo.transactional.sent",
|
|
57
|
+
},
|
|
58
|
+
brevoTransactionalSoftBounced: {
|
|
59
|
+
account: BREVO_ACCOUNT,
|
|
60
|
+
name: "Brevo email soft bounced",
|
|
61
|
+
type: "brevo.transactional.softBounced",
|
|
62
|
+
},
|
|
63
|
+
brevoTransactionalUnsubscribed: {
|
|
64
|
+
account: BREVO_ACCOUNT,
|
|
65
|
+
name: "Brevo email unsubscribed",
|
|
66
|
+
type: "brevo.transactional.unsubscribed",
|
|
67
|
+
},
|
|
68
|
+
} as const satisfies Record<string, TriggerDefinition>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { TriggerDefinition } from "../types"
|
|
2
|
+
import * as z from "zod/mini"
|
|
3
|
+
|
|
4
|
+
const CRON_PRESENTATION_CONFIG_SCHEMA = z.object({
|
|
5
|
+
schedule: z.string(),
|
|
6
|
+
timeZone: z.prefault(z.string(), "UTC"),
|
|
7
|
+
})
|
|
8
|
+
const HTTP_PRESENTATION_CONFIG_SCHEMA = z.object({
|
|
9
|
+
scope: z.prefault(z.enum(["trigger", "automation", "project"]), "trigger"),
|
|
10
|
+
})
|
|
11
|
+
const INVOCATION_PRESENTATION_CONFIG_SCHEMA = z.object({
|
|
12
|
+
entrypoint: z.string(),
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
export const coreTriggerDefinitions = {
|
|
16
|
+
automationInvoked: {
|
|
17
|
+
getDetails: ({ config }) => [
|
|
18
|
+
{
|
|
19
|
+
label: "Entrypoint",
|
|
20
|
+
value: INVOCATION_PRESENTATION_CONFIG_SCHEMA.parse(config).entrypoint,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
icon: "automation",
|
|
24
|
+
name: "Invocation",
|
|
25
|
+
type: "automation.invoked",
|
|
26
|
+
},
|
|
27
|
+
cronTick: {
|
|
28
|
+
getDetails: ({ config }) => {
|
|
29
|
+
const parsedConfig = CRON_PRESENTATION_CONFIG_SCHEMA.parse(config)
|
|
30
|
+
|
|
31
|
+
return [
|
|
32
|
+
{ label: "Schedule", value: parsedConfig.schedule },
|
|
33
|
+
{ label: "Time zone", value: parsedConfig.timeZone },
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
icon: "schedule",
|
|
37
|
+
name: "Cron schedule",
|
|
38
|
+
type: "cron.tick",
|
|
39
|
+
},
|
|
40
|
+
httpRequest: {
|
|
41
|
+
getDetails: ({ appOrigin, automationId, config, hookSlot, projectId }) => [
|
|
42
|
+
{
|
|
43
|
+
copyable: true,
|
|
44
|
+
label: "URL",
|
|
45
|
+
value: getHttpTriggerEndpoint({
|
|
46
|
+
appOrigin,
|
|
47
|
+
automationId,
|
|
48
|
+
hookSlot,
|
|
49
|
+
projectId,
|
|
50
|
+
scope: HTTP_PRESENTATION_CONFIG_SCHEMA.parse(config).scope,
|
|
51
|
+
}),
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
icon: "webhook",
|
|
55
|
+
name: "HTTP request",
|
|
56
|
+
type: "http.request",
|
|
57
|
+
},
|
|
58
|
+
} as const satisfies Record<string, TriggerDefinition>
|
|
59
|
+
|
|
60
|
+
export type HttpTriggerScope = "trigger" | "automation" | "project"
|
|
61
|
+
|
|
62
|
+
export interface HttpTriggerEndpointOptions {
|
|
63
|
+
appOrigin: string
|
|
64
|
+
automationId: string
|
|
65
|
+
hookSlot: number
|
|
66
|
+
projectId: string
|
|
67
|
+
scope: HttpTriggerScope
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Returns the public URL for one deployed HTTP trigger.
|
|
72
|
+
*
|
|
73
|
+
* @param options - Public origin and trigger identity.
|
|
74
|
+
*/
|
|
75
|
+
export function getHttpTriggerEndpoint(options: HttpTriggerEndpointOptions) {
|
|
76
|
+
return new URL(
|
|
77
|
+
`/x/${getHttpTriggerEndpointKey(options)}/`,
|
|
78
|
+
options.appOrigin,
|
|
79
|
+
).toString()
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Returns the durable endpoint identity for one configured HTTP scope.
|
|
84
|
+
*
|
|
85
|
+
* @param options - Trigger and owning resource identity.
|
|
86
|
+
*/
|
|
87
|
+
export function getHttpTriggerEndpointKey(
|
|
88
|
+
options: Omit<HttpTriggerEndpointOptions, "appOrigin">,
|
|
89
|
+
) {
|
|
90
|
+
if (options.scope === "project") return options.projectId
|
|
91
|
+
if (options.scope === "automation") return options.automationId
|
|
92
|
+
return `${options.automationId}:${options.hookSlot}`
|
|
93
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { githubService } from "../catalog"
|
|
2
|
+
import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
|
|
3
|
+
|
|
4
|
+
const GITHUB_ISSUES_ACCOUNT = {
|
|
5
|
+
connectionOptions: [
|
|
6
|
+
{
|
|
7
|
+
requiredScopes: ["issues:read"],
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
serviceId: githubService.id,
|
|
11
|
+
} as const satisfies IntegrationAccountRequirement
|
|
12
|
+
|
|
13
|
+
const GITHUB_PULL_REQUESTS_ACCOUNT = {
|
|
14
|
+
connectionOptions: [
|
|
15
|
+
{
|
|
16
|
+
requiredScopes: ["pull_requests:read"],
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
serviceId: githubService.id,
|
|
20
|
+
} as const satisfies IntegrationAccountRequirement
|
|
21
|
+
|
|
22
|
+
const GITHUB_CONTENTS_ACCOUNT = {
|
|
23
|
+
connectionOptions: [
|
|
24
|
+
{
|
|
25
|
+
requiredScopes: ["contents:read"],
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
serviceId: githubService.id,
|
|
29
|
+
} as const satisfies IntegrationAccountRequirement
|
|
30
|
+
|
|
31
|
+
const GITHUB_ACTIONS_ACCOUNT = {
|
|
32
|
+
connectionOptions: [
|
|
33
|
+
{
|
|
34
|
+
requiredScopes: ["actions:read"],
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
serviceId: githubService.id,
|
|
38
|
+
} as const satisfies IntegrationAccountRequirement
|
|
39
|
+
|
|
40
|
+
export const githubTriggerDefinitions = {
|
|
41
|
+
githubIssueClosed: {
|
|
42
|
+
account: GITHUB_ISSUES_ACCOUNT,
|
|
43
|
+
type: "github.issue.closed",
|
|
44
|
+
},
|
|
45
|
+
githubIssueEvent: {
|
|
46
|
+
account: GITHUB_ISSUES_ACCOUNT,
|
|
47
|
+
type: "github.issue.event",
|
|
48
|
+
},
|
|
49
|
+
githubIssueOpened: {
|
|
50
|
+
account: GITHUB_ISSUES_ACCOUNT,
|
|
51
|
+
type: "github.issue.opened",
|
|
52
|
+
},
|
|
53
|
+
githubIssueReopened: {
|
|
54
|
+
account: GITHUB_ISSUES_ACCOUNT,
|
|
55
|
+
type: "github.issue.reopened",
|
|
56
|
+
},
|
|
57
|
+
githubPullRequestClosed: {
|
|
58
|
+
account: GITHUB_PULL_REQUESTS_ACCOUNT,
|
|
59
|
+
type: "github.pull-request.closed",
|
|
60
|
+
},
|
|
61
|
+
githubPullRequestEvent: {
|
|
62
|
+
account: GITHUB_PULL_REQUESTS_ACCOUNT,
|
|
63
|
+
type: "github.pull-request.event",
|
|
64
|
+
},
|
|
65
|
+
githubPullRequestMerged: {
|
|
66
|
+
account: GITHUB_PULL_REQUESTS_ACCOUNT,
|
|
67
|
+
type: "github.pull-request.merged",
|
|
68
|
+
},
|
|
69
|
+
githubPullRequestOpened: {
|
|
70
|
+
account: GITHUB_PULL_REQUESTS_ACCOUNT,
|
|
71
|
+
type: "github.pull-request.opened",
|
|
72
|
+
},
|
|
73
|
+
githubPullRequestReadyForReview: {
|
|
74
|
+
account: GITHUB_PULL_REQUESTS_ACCOUNT,
|
|
75
|
+
type: "github.pull-request.ready-for-review",
|
|
76
|
+
},
|
|
77
|
+
githubPullRequestReviewApproved: {
|
|
78
|
+
account: GITHUB_PULL_REQUESTS_ACCOUNT,
|
|
79
|
+
type: "github.pull-request-review.approved",
|
|
80
|
+
},
|
|
81
|
+
githubPullRequestReviewChangesRequested: {
|
|
82
|
+
account: GITHUB_PULL_REQUESTS_ACCOUNT,
|
|
83
|
+
name: "GitHub pull request changes requested",
|
|
84
|
+
type: "github.pull-request-review.changes-requested",
|
|
85
|
+
},
|
|
86
|
+
githubPullRequestReviewDismissed: {
|
|
87
|
+
account: GITHUB_PULL_REQUESTS_ACCOUNT,
|
|
88
|
+
type: "github.pull-request-review.dismissed",
|
|
89
|
+
},
|
|
90
|
+
githubPullRequestReviewEvent: {
|
|
91
|
+
account: GITHUB_PULL_REQUESTS_ACCOUNT,
|
|
92
|
+
type: "github.pull-request-review.event",
|
|
93
|
+
},
|
|
94
|
+
githubPullRequestReviewSubmitted: {
|
|
95
|
+
account: GITHUB_PULL_REQUESTS_ACCOUNT,
|
|
96
|
+
type: "github.pull-request-review.submitted",
|
|
97
|
+
},
|
|
98
|
+
githubPullRequestSynchronized: {
|
|
99
|
+
account: GITHUB_PULL_REQUESTS_ACCOUNT,
|
|
100
|
+
type: "github.pull-request.synchronized",
|
|
101
|
+
},
|
|
102
|
+
githubPush: {
|
|
103
|
+
account: GITHUB_CONTENTS_ACCOUNT,
|
|
104
|
+
type: "github.push",
|
|
105
|
+
},
|
|
106
|
+
githubReleaseEvent: {
|
|
107
|
+
account: GITHUB_CONTENTS_ACCOUNT,
|
|
108
|
+
type: "github.release.event",
|
|
109
|
+
},
|
|
110
|
+
githubReleasePublished: {
|
|
111
|
+
account: GITHUB_CONTENTS_ACCOUNT,
|
|
112
|
+
type: "github.release.published",
|
|
113
|
+
},
|
|
114
|
+
githubWorkflowRunCancelled: {
|
|
115
|
+
account: GITHUB_ACTIONS_ACCOUNT,
|
|
116
|
+
type: "github.workflow-run.cancelled",
|
|
117
|
+
},
|
|
118
|
+
githubWorkflowRunCompleted: {
|
|
119
|
+
account: GITHUB_ACTIONS_ACCOUNT,
|
|
120
|
+
type: "github.workflow-run.completed",
|
|
121
|
+
},
|
|
122
|
+
githubWorkflowRunEvent: {
|
|
123
|
+
account: GITHUB_ACTIONS_ACCOUNT,
|
|
124
|
+
type: "github.workflow-run.event",
|
|
125
|
+
},
|
|
126
|
+
githubWorkflowRunFailed: {
|
|
127
|
+
account: GITHUB_ACTIONS_ACCOUNT,
|
|
128
|
+
type: "github.workflow-run.failed",
|
|
129
|
+
},
|
|
130
|
+
githubWorkflowRunRequested: {
|
|
131
|
+
account: GITHUB_ACTIONS_ACCOUNT,
|
|
132
|
+
type: "github.workflow-run.requested",
|
|
133
|
+
},
|
|
134
|
+
githubWorkflowRunStarted: {
|
|
135
|
+
account: GITHUB_ACTIONS_ACCOUNT,
|
|
136
|
+
type: "github.workflow-run.started",
|
|
137
|
+
},
|
|
138
|
+
githubWorkflowRunSucceeded: {
|
|
139
|
+
account: GITHUB_ACTIONS_ACCOUNT,
|
|
140
|
+
type: "github.workflow-run.succeeded",
|
|
141
|
+
},
|
|
142
|
+
} as const satisfies Record<string, TriggerDefinition>
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { googleService } from "../catalog"
|
|
2
|
+
import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
|
|
3
|
+
|
|
4
|
+
const GMAIL_ACCOUNT = {
|
|
5
|
+
connectionOptions: [
|
|
6
|
+
{
|
|
7
|
+
requiredScopes: [
|
|
8
|
+
{
|
|
9
|
+
requirements: [
|
|
10
|
+
"https://mail.google.com/",
|
|
11
|
+
"https://www.googleapis.com/auth/gmail.modify",
|
|
12
|
+
"https://www.googleapis.com/auth/gmail.readonly",
|
|
13
|
+
],
|
|
14
|
+
type: "or",
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
serviceId: googleService.id,
|
|
20
|
+
} as const satisfies IntegrationAccountRequirement
|
|
21
|
+
|
|
22
|
+
const GOOGLE_CALENDAR_ACCOUNT = {
|
|
23
|
+
connectionOptions: [
|
|
24
|
+
{
|
|
25
|
+
requiredScopes: [
|
|
26
|
+
{
|
|
27
|
+
requirements: [
|
|
28
|
+
"https://www.googleapis.com/auth/calendar",
|
|
29
|
+
"https://www.googleapis.com/auth/calendar.readonly",
|
|
30
|
+
"https://www.googleapis.com/auth/calendar.events",
|
|
31
|
+
"https://www.googleapis.com/auth/calendar.events.readonly",
|
|
32
|
+
"https://www.googleapis.com/auth/calendar.events.owned",
|
|
33
|
+
],
|
|
34
|
+
type: "or",
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
serviceId: googleService.id,
|
|
40
|
+
} as const satisfies IntegrationAccountRequirement
|
|
41
|
+
|
|
42
|
+
const GOOGLE_FORMS_ACCOUNT = {
|
|
43
|
+
connectionOptions: [
|
|
44
|
+
{
|
|
45
|
+
requiredScopes: [
|
|
46
|
+
{
|
|
47
|
+
requirements: [
|
|
48
|
+
"https://www.googleapis.com/auth/drive",
|
|
49
|
+
"https://www.googleapis.com/auth/drive.file",
|
|
50
|
+
"https://www.googleapis.com/auth/drive.readonly",
|
|
51
|
+
"https://www.googleapis.com/auth/forms.body",
|
|
52
|
+
"https://www.googleapis.com/auth/forms.body.readonly",
|
|
53
|
+
],
|
|
54
|
+
type: "or",
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
serviceId: googleService.id,
|
|
60
|
+
} as const satisfies IntegrationAccountRequirement
|
|
61
|
+
|
|
62
|
+
const GOOGLE_FORM_RESPONSES_ACCOUNT = {
|
|
63
|
+
connectionOptions: [
|
|
64
|
+
{
|
|
65
|
+
requiredScopes: [
|
|
66
|
+
{
|
|
67
|
+
requirements: [
|
|
68
|
+
"https://www.googleapis.com/auth/drive",
|
|
69
|
+
"https://www.googleapis.com/auth/drive.file",
|
|
70
|
+
"https://www.googleapis.com/auth/drive.readonly",
|
|
71
|
+
"https://www.googleapis.com/auth/forms.body",
|
|
72
|
+
"https://www.googleapis.com/auth/forms.body.readonly",
|
|
73
|
+
],
|
|
74
|
+
type: "or",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
requirements: [
|
|
78
|
+
{
|
|
79
|
+
requirements: [
|
|
80
|
+
"https://www.googleapis.com/auth/drive",
|
|
81
|
+
"https://www.googleapis.com/auth/drive.file",
|
|
82
|
+
"https://www.googleapis.com/auth/forms.responses.readonly",
|
|
83
|
+
],
|
|
84
|
+
type: "or",
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
requirements: [
|
|
88
|
+
"https://www.googleapis.com/auth/drive",
|
|
89
|
+
"https://www.googleapis.com/auth/drive.file",
|
|
90
|
+
"https://www.googleapis.com/auth/drive.readonly",
|
|
91
|
+
"https://www.googleapis.com/auth/forms.body",
|
|
92
|
+
"https://www.googleapis.com/auth/forms.body.readonly",
|
|
93
|
+
],
|
|
94
|
+
type: "or",
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
type: "and",
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
serviceId: googleService.id,
|
|
103
|
+
} as const satisfies IntegrationAccountRequirement
|
|
104
|
+
|
|
105
|
+
export const googleTriggerDefinitions = {
|
|
106
|
+
gmailLabelAdded: {
|
|
107
|
+
account: GMAIL_ACCOUNT,
|
|
108
|
+
type: "gmail.label.added",
|
|
109
|
+
},
|
|
110
|
+
gmailLabelRemoved: {
|
|
111
|
+
account: GMAIL_ACCOUNT,
|
|
112
|
+
type: "gmail.label.removed",
|
|
113
|
+
},
|
|
114
|
+
gmailMessageReceived: {
|
|
115
|
+
account: GMAIL_ACCOUNT,
|
|
116
|
+
name: "Gmail email received",
|
|
117
|
+
type: "gmail.message.received",
|
|
118
|
+
},
|
|
119
|
+
gmailMessageSent: {
|
|
120
|
+
account: GMAIL_ACCOUNT,
|
|
121
|
+
name: "Gmail email sent",
|
|
122
|
+
type: "gmail.message.sent",
|
|
123
|
+
},
|
|
124
|
+
googleCalendarEventCreated: {
|
|
125
|
+
account: GOOGLE_CALENDAR_ACCOUNT,
|
|
126
|
+
name: "Google Calendar event created",
|
|
127
|
+
type: "googleCalendar.event.created",
|
|
128
|
+
},
|
|
129
|
+
googleCalendarEventDeleted: {
|
|
130
|
+
account: GOOGLE_CALENDAR_ACCOUNT,
|
|
131
|
+
name: "Google Calendar event deleted",
|
|
132
|
+
type: "googleCalendar.event.deleted",
|
|
133
|
+
},
|
|
134
|
+
googleCalendarEventUpdated: {
|
|
135
|
+
account: GOOGLE_CALENDAR_ACCOUNT,
|
|
136
|
+
name: "Google Calendar event updated",
|
|
137
|
+
type: "googleCalendar.event.updated",
|
|
138
|
+
},
|
|
139
|
+
googleFormsFormChanged: {
|
|
140
|
+
account: GOOGLE_FORMS_ACCOUNT,
|
|
141
|
+
name: "Google Form changed",
|
|
142
|
+
type: "googleForms.form.changed",
|
|
143
|
+
},
|
|
144
|
+
googleFormsResponseSubmitted: {
|
|
145
|
+
account: GOOGLE_FORM_RESPONSES_ACCOUNT,
|
|
146
|
+
name: "Google Form response submitted",
|
|
147
|
+
type: "googleForms.response.submitted",
|
|
148
|
+
},
|
|
149
|
+
} as const satisfies Record<string, TriggerDefinition>
|