@automate.ax/catalog 0.75.0 → 0.77.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.
Files changed (63) hide show
  1. package/dist/authoring.d.ts +1 -0
  2. package/dist/authoring.js +1 -0
  3. package/dist/catalog.d.ts +142 -74
  4. package/dist/catalog.js +74 -13
  5. package/dist/index.d.ts +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/triggers/airtable.js +1 -2
  8. package/dist/triggers/asana.js +1 -2
  9. package/dist/triggers/brevo.js +1 -2
  10. package/dist/triggers/core-dashboard.d.ts +374 -0
  11. package/dist/triggers/core-dashboard.js +202 -0
  12. package/dist/triggers/core-http.d.ts +30 -0
  13. package/dist/triggers/core-http.js +43 -0
  14. package/dist/triggers/core-invocation.d.ts +9 -0
  15. package/dist/triggers/core-invocation.js +15 -0
  16. package/dist/triggers/core-mailhook.d.ts +35 -0
  17. package/dist/triggers/core-mailhook.js +63 -0
  18. package/dist/triggers/core-schedule.d.ts +9 -0
  19. package/dist/triggers/core-schedule.js +17 -0
  20. package/dist/triggers/core.d.ts +15 -426
  21. package/dist/triggers/core.js +16 -346
  22. package/dist/triggers/github.js +4 -5
  23. package/dist/triggers/google.d.ts +143 -0
  24. package/dist/triggers/google.js +92 -5
  25. package/dist/triggers/index.d.ts +347 -74
  26. package/dist/triggers/index.js +2 -1
  27. package/dist/triggers/linear.js +1 -2
  28. package/dist/triggers/microsoft.js +3 -4
  29. package/dist/triggers/name.d.ts +13 -0
  30. package/dist/triggers/name.js +31 -0
  31. package/dist/triggers/resend.js +1 -2
  32. package/dist/triggers/slack.js +3 -4
  33. package/dist/triggers/trello.js +1 -2
  34. package/dist/triggers/vercel.d.ts +27 -27
  35. package/dist/triggers/vercel.js +10 -11
  36. package/dist/triggers/whatsapp.js +1 -2
  37. package/dist/types.d.ts +1 -1
  38. package/dist/types.js +3 -3
  39. package/package.json +118 -5
  40. package/src/authoring.ts +8 -0
  41. package/src/catalog.ts +76 -13
  42. package/src/index.ts +2 -0
  43. package/src/triggers/airtable.ts +1 -2
  44. package/src/triggers/asana.ts +1 -2
  45. package/src/triggers/brevo.ts +1 -2
  46. package/src/triggers/core-dashboard.ts +361 -0
  47. package/src/triggers/core-http.ts +69 -0
  48. package/src/triggers/core-invocation.ts +18 -0
  49. package/src/triggers/core-mailhook.ts +83 -0
  50. package/src/triggers/core-schedule.ts +21 -0
  51. package/src/triggers/core.ts +38 -544
  52. package/src/triggers/github.ts +4 -5
  53. package/src/triggers/google.ts +93 -5
  54. package/src/triggers/index.ts +2 -1
  55. package/src/triggers/linear.ts +1 -2
  56. package/src/triggers/microsoft.ts +3 -4
  57. package/src/triggers/name.ts +37 -0
  58. package/src/triggers/resend.ts +1 -2
  59. package/src/triggers/slack.ts +3 -4
  60. package/src/triggers/trello.ts +1 -2
  61. package/src/triggers/vercel.ts +10 -11
  62. package/src/triggers/whatsapp.ts +1 -2
  63. package/src/types.ts +4 -4
@@ -1,4 +1,3 @@
1
- import { githubService } from "../catalog"
2
1
  import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
3
2
 
4
3
  const GITHUB_ISSUES_ACCOUNT = {
@@ -7,7 +6,7 @@ const GITHUB_ISSUES_ACCOUNT = {
7
6
  requiredScopes: ["issues:read"],
8
7
  },
9
8
  ],
10
- serviceId: githubService.id,
9
+ serviceId: "github",
11
10
  } as const satisfies IntegrationAccountRequirement
12
11
 
13
12
  const GITHUB_PULL_REQUESTS_ACCOUNT = {
@@ -16,7 +15,7 @@ const GITHUB_PULL_REQUESTS_ACCOUNT = {
16
15
  requiredScopes: ["pull_requests:read"],
17
16
  },
18
17
  ],
19
- serviceId: githubService.id,
18
+ serviceId: "github",
20
19
  } as const satisfies IntegrationAccountRequirement
21
20
 
22
21
  const GITHUB_CONTENTS_ACCOUNT = {
@@ -25,7 +24,7 @@ const GITHUB_CONTENTS_ACCOUNT = {
25
24
  requiredScopes: ["contents:read"],
26
25
  },
27
26
  ],
28
- serviceId: githubService.id,
27
+ serviceId: "github",
29
28
  } as const satisfies IntegrationAccountRequirement
30
29
 
31
30
  const GITHUB_ACTIONS_ACCOUNT = {
@@ -34,7 +33,7 @@ const GITHUB_ACTIONS_ACCOUNT = {
34
33
  requiredScopes: ["actions:read"],
35
34
  },
36
35
  ],
37
- serviceId: githubService.id,
36
+ serviceId: "github",
38
37
  } as const satisfies IntegrationAccountRequirement
39
38
 
40
39
  export const githubTriggerDefinitions = {
@@ -1,4 +1,3 @@
1
- import { googleService } from "../catalog"
2
1
  import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
3
2
 
4
3
  const GMAIL_ACCOUNT = {
@@ -16,7 +15,7 @@ const GMAIL_ACCOUNT = {
16
15
  ],
17
16
  },
18
17
  ],
19
- serviceId: googleService.id,
18
+ serviceId: "google",
20
19
  } as const satisfies IntegrationAccountRequirement
21
20
 
22
21
  const GOOGLE_CALENDAR_ACCOUNT = {
@@ -36,7 +35,7 @@ const GOOGLE_CALENDAR_ACCOUNT = {
36
35
  ],
37
36
  },
38
37
  ],
39
- serviceId: googleService.id,
38
+ serviceId: "google",
40
39
  } as const satisfies IntegrationAccountRequirement
41
40
 
42
41
  const GOOGLE_FORMS_ACCOUNT = {
@@ -56,7 +55,7 @@ const GOOGLE_FORMS_ACCOUNT = {
56
55
  ],
57
56
  },
58
57
  ],
59
- serviceId: googleService.id,
58
+ serviceId: "google",
60
59
  } as const satisfies IntegrationAccountRequirement
61
60
 
62
61
  const GOOGLE_FORM_RESPONSES_ACCOUNT = {
@@ -99,7 +98,18 @@ const GOOGLE_FORM_RESPONSES_ACCOUNT = {
99
98
  ],
100
99
  },
101
100
  ],
102
- serviceId: googleService.id,
101
+ serviceId: "google",
102
+ } as const satisfies IntegrationAccountRequirement
103
+
104
+ const GOOGLE_MEET_ACCOUNT = {
105
+ connectionOptions: [
106
+ {
107
+ requiredScopes: [
108
+ "https://www.googleapis.com/auth/meetings.space.readonly",
109
+ ],
110
+ },
111
+ ],
112
+ serviceId: "google",
103
113
  } as const satisfies IntegrationAccountRequirement
104
114
 
105
115
  export const googleTriggerDefinitions = {
@@ -155,4 +165,82 @@ export const googleTriggerDefinitions = {
155
165
  name: "Google Form response submitted",
156
166
  type: "googleForms.response.submitted",
157
167
  },
168
+ googleMeetConferenceEnded: {
169
+ account: GOOGLE_MEET_ACCOUNT,
170
+ icon: "google-meet",
171
+ name: "Google Meet conference ended",
172
+ type: "googleMeet.conference.ended",
173
+ },
174
+ googleMeetConferenceStarted: {
175
+ account: GOOGLE_MEET_ACCOUNT,
176
+ icon: "google-meet",
177
+ name: "Google Meet conference started",
178
+ type: "googleMeet.conference.started",
179
+ },
180
+ googleMeetParticipantJoined: {
181
+ account: GOOGLE_MEET_ACCOUNT,
182
+ icon: "google-meet",
183
+ name: "Google Meet participant joined",
184
+ type: "googleMeet.participant.joined",
185
+ },
186
+ googleMeetParticipantLeft: {
187
+ account: GOOGLE_MEET_ACCOUNT,
188
+ icon: "google-meet",
189
+ name: "Google Meet participant left",
190
+ type: "googleMeet.participant.left",
191
+ },
192
+ googleMeetRecordingEnded: {
193
+ account: GOOGLE_MEET_ACCOUNT,
194
+ icon: "google-meet",
195
+ name: "Google Meet recording ended",
196
+ type: "googleMeet.recording.ended",
197
+ },
198
+ googleMeetRecordingFileGenerated: {
199
+ account: GOOGLE_MEET_ACCOUNT,
200
+ icon: "google-meet",
201
+ name: "Google Meet recording generated",
202
+ type: "googleMeet.recording.fileGenerated",
203
+ },
204
+ googleMeetRecordingStarted: {
205
+ account: GOOGLE_MEET_ACCOUNT,
206
+ icon: "google-meet",
207
+ name: "Google Meet recording started",
208
+ type: "googleMeet.recording.started",
209
+ },
210
+ googleMeetSmartNoteEnded: {
211
+ account: GOOGLE_MEET_ACCOUNT,
212
+ icon: "google-meet",
213
+ name: "Google Meet smart note ended",
214
+ type: "googleMeet.smartNote.ended",
215
+ },
216
+ googleMeetSmartNoteFileGenerated: {
217
+ account: GOOGLE_MEET_ACCOUNT,
218
+ icon: "google-meet",
219
+ name: "Google Meet smart note generated",
220
+ type: "googleMeet.smartNote.fileGenerated",
221
+ },
222
+ googleMeetSmartNoteStarted: {
223
+ account: GOOGLE_MEET_ACCOUNT,
224
+ icon: "google-meet",
225
+ name: "Google Meet smart note started",
226
+ type: "googleMeet.smartNote.started",
227
+ },
228
+ googleMeetTranscriptEnded: {
229
+ account: GOOGLE_MEET_ACCOUNT,
230
+ icon: "google-meet",
231
+ name: "Google Meet transcript ended",
232
+ type: "googleMeet.transcript.ended",
233
+ },
234
+ googleMeetTranscriptFileGenerated: {
235
+ account: GOOGLE_MEET_ACCOUNT,
236
+ icon: "google-meet",
237
+ name: "Google Meet transcript generated",
238
+ type: "googleMeet.transcript.fileGenerated",
239
+ },
240
+ googleMeetTranscriptStarted: {
241
+ account: GOOGLE_MEET_ACCOUNT,
242
+ icon: "google-meet",
243
+ name: "Google Meet transcript started",
244
+ type: "googleMeet.transcript.started",
245
+ },
158
246
  } as const satisfies Record<string, TriggerDefinition>
@@ -1,7 +1,7 @@
1
1
  import { airtableTriggerDefinitions } from "./airtable"
2
2
  import { asanaTriggerDefinitions } from "./asana"
3
3
  import { brevoTriggerDefinitions } from "./brevo"
4
- import { coreTriggerDefinitions, sentenceCase } from "./core"
4
+ import { coreTriggerDefinitions } from "./core"
5
5
  import { githubTriggerDefinitions } from "./github"
6
6
  import { googleTriggerDefinitions } from "./google"
7
7
  import { linearTriggerDefinitions } from "./linear"
@@ -11,6 +11,7 @@ import { slackTriggerDefinitions } from "./slack"
11
11
  import { trelloTriggerDefinitions } from "./trello"
12
12
  import { vercelTriggerDefinitions } from "./vercel"
13
13
  import { whatsappTriggerDefinitions } from "./whatsapp"
14
+ import { sentenceCase } from "./name"
14
15
  import { getIntegrationService } from "../catalog"
15
16
  import type {
16
17
  TriggerDefinition,
@@ -1,4 +1,3 @@
1
- import { linearService } from "../catalog"
2
1
  import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
3
2
 
4
3
  const LINEAR_ACCOUNT = {
@@ -7,7 +6,7 @@ const LINEAR_ACCOUNT = {
7
6
  requiredScopes: ["read"],
8
7
  },
9
8
  ],
10
- serviceId: linearService.id,
9
+ serviceId: "linear",
11
10
  } as const satisfies IntegrationAccountRequirement
12
11
 
13
12
  export const linearTriggerDefinitions = {
@@ -1,4 +1,3 @@
1
- import { microsoftService } from "../catalog"
2
1
  import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
3
2
 
4
3
  const OUTLOOK_ACCOUNT = {
@@ -12,7 +11,7 @@ const OUTLOOK_ACCOUNT = {
12
11
  ],
13
12
  },
14
13
  ],
15
- serviceId: microsoftService.id,
14
+ serviceId: "microsoft",
16
15
  } as const satisfies IntegrationAccountRequirement
17
16
 
18
17
  const TEAMS_CHANNEL_MESSAGE_ACCOUNT = {
@@ -30,7 +29,7 @@ const TEAMS_CHANNEL_MESSAGE_ACCOUNT = {
30
29
  ],
31
30
  },
32
31
  ],
33
- serviceId: microsoftService.id,
32
+ serviceId: "microsoft",
34
33
  } as const satisfies IntegrationAccountRequirement
35
34
 
36
35
  const TEAMS_CHAT_MESSAGE_ACCOUNT = {
@@ -44,7 +43,7 @@ const TEAMS_CHAT_MESSAGE_ACCOUNT = {
44
43
  ],
45
44
  },
46
45
  ],
47
- serviceId: microsoftService.id,
46
+ serviceId: "microsoft",
48
47
  } as const satisfies IntegrationAccountRequirement
49
48
 
50
49
  export const microsoftTriggerDefinitions = {
@@ -0,0 +1,37 @@
1
+ import type { TriggerDefinition } from "../types"
2
+
3
+ const NAMESPACE_DISPLAY_NAMES: Partial<Record<string, string>> = {
4
+ github: "GitHub",
5
+ whatsapp: "WhatsApp",
6
+ }
7
+
8
+ /**
9
+ * Resolves a definition's display name without loading the global catalog.
10
+ *
11
+ * @param definition - Trigger definition to name.
12
+ */
13
+ export function getTriggerDefinitionName(definition: TriggerDefinition) {
14
+ if (definition.name) return definition.name
15
+
16
+ const [namespace = definition.type] = definition.type.split(".")
17
+ const inferredName = sentenceCase(definition.type)
18
+ const namespaceDisplayName = NAMESPACE_DISPLAY_NAMES[namespace]
19
+
20
+ return namespaceDisplayName
21
+ ? inferredName.replace(sentenceCase(namespace), namespaceDisplayName)
22
+ : inferredName
23
+ }
24
+
25
+ /**
26
+ * Converts a stable identifier to a sentence-cased display name.
27
+ *
28
+ * @param value - Stable identifier to format.
29
+ */
30
+ export function sentenceCase(value: string) {
31
+ const words = value
32
+ .replaceAll(/([a-z\d])([A-Z])/g, "$1 $2")
33
+ .replaceAll(/[._-]+/g, " ")
34
+ .toLowerCase()
35
+
36
+ return words.charAt(0).toUpperCase() + words.slice(1)
37
+ }
@@ -1,4 +1,3 @@
1
- import { resendService } from "../catalog"
2
1
  import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
3
2
 
4
3
  const RESEND_ACCOUNT = {
@@ -7,7 +6,7 @@ const RESEND_ACCOUNT = {
7
6
  requiredScopes: [],
8
7
  },
9
8
  ],
10
- serviceId: resendService.id,
9
+ serviceId: "resend",
11
10
  } as const satisfies IntegrationAccountRequirement
12
11
 
13
12
  export const resendTriggerDefinitions = {
@@ -1,4 +1,3 @@
1
- import { slackService } from "../catalog"
2
1
  import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
3
2
 
4
3
  const SLACK_APP_MENTION_ACCOUNT = {
@@ -7,7 +6,7 @@ const SLACK_APP_MENTION_ACCOUNT = {
7
6
  requiredScopes: ["app_mentions:read"],
8
7
  },
9
8
  ],
10
- serviceId: slackService.id,
9
+ serviceId: "slack",
11
10
  } as const satisfies IntegrationAccountRequirement
12
11
 
13
12
  const SLACK_MESSAGE_ACCOUNT = {
@@ -26,7 +25,7 @@ const SLACK_MESSAGE_ACCOUNT = {
26
25
  ],
27
26
  },
28
27
  ],
29
- serviceId: slackService.id,
28
+ serviceId: "slack",
30
29
  } as const satisfies IntegrationAccountRequirement
31
30
 
32
31
  const SLACK_REACTION_ACCOUNT = {
@@ -35,7 +34,7 @@ const SLACK_REACTION_ACCOUNT = {
35
34
  requiredScopes: ["reactions:read"],
36
35
  },
37
36
  ],
38
- serviceId: slackService.id,
37
+ serviceId: "slack",
39
38
  } as const satisfies IntegrationAccountRequirement
40
39
 
41
40
  export const slackTriggerDefinitions = {
@@ -1,4 +1,3 @@
1
- import { trelloService } from "../catalog"
2
1
  import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
3
2
 
4
3
  const TRELLO_ACCOUNT = {
@@ -7,7 +6,7 @@ const TRELLO_ACCOUNT = {
7
6
  requiredScopes: [],
8
7
  },
9
8
  ],
10
- serviceId: trelloService.id,
9
+ serviceId: "trello",
11
10
  } as const satisfies IntegrationAccountRequirement
12
11
 
13
12
  export const trelloTriggerDefinitions = {
@@ -1,54 +1,53 @@
1
- import { vercelService } from "../catalog"
2
1
  import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
3
2
 
4
3
  const VERCEL_DEPLOYMENT_ACCOUNT = {
5
4
  connectionOptions: [
6
5
  {
7
- connectionId: "oauth",
6
+ connectionMethodId: "oauth",
8
7
  requiredScopes: ["deployment:read"],
9
8
  },
10
9
  ],
11
- serviceId: vercelService.id,
10
+ serviceId: "vercel",
12
11
  } as const satisfies IntegrationAccountRequirement
13
12
 
14
13
  const VERCEL_INTEGRATION_CONFIGURATION_ACCOUNT = {
15
14
  connectionOptions: [
16
15
  {
17
- connectionId: "oauth",
16
+ connectionMethodId: "oauth",
18
17
  requiredScopes: [],
19
18
  },
20
19
  ],
21
- serviceId: vercelService.id,
20
+ serviceId: "vercel",
22
21
  } as const satisfies IntegrationAccountRequirement
23
22
 
24
23
  const VERCEL_PROJECT_ACCOUNT = {
25
24
  connectionOptions: [
26
25
  {
27
- connectionId: "oauth",
26
+ connectionMethodId: "oauth",
28
27
  requiredScopes: ["project:read"],
29
28
  },
30
29
  ],
31
- serviceId: vercelService.id,
30
+ serviceId: "vercel",
32
31
  } as const satisfies IntegrationAccountRequirement
33
32
 
34
33
  const VERCEL_PROJECT_DOMAIN_ACCOUNT = {
35
34
  connectionOptions: [
36
35
  {
37
- connectionId: "oauth",
36
+ connectionMethodId: "oauth",
38
37
  requiredScopes: ["domain:read"],
39
38
  },
40
39
  ],
41
- serviceId: vercelService.id,
40
+ serviceId: "vercel",
42
41
  } as const satisfies IntegrationAccountRequirement
43
42
 
44
43
  const VERCEL_PROJECT_ENVIRONMENT_VARIABLE_ACCOUNT = {
45
44
  connectionOptions: [
46
45
  {
47
- connectionId: "oauth",
46
+ connectionMethodId: "oauth",
48
47
  requiredScopes: ["global-project-env-vars:read"],
49
48
  },
50
49
  ],
51
- serviceId: vercelService.id,
50
+ serviceId: "vercel",
52
51
  } as const satisfies IntegrationAccountRequirement
53
52
 
54
53
  export const vercelTriggerDefinitions = {
@@ -1,4 +1,3 @@
1
- import { whatsappService } from "../catalog"
2
1
  import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
3
2
 
4
3
  const WHATSAPP_ACCOUNT = {
@@ -7,7 +6,7 @@ const WHATSAPP_ACCOUNT = {
7
6
  requiredScopes: ["whatsapp_business_messaging"],
8
7
  },
9
8
  ],
10
- serviceId: whatsappService.id,
9
+ serviceId: "whatsapp",
11
10
  } as const satisfies IntegrationAccountRequirement
12
11
 
13
12
  export const whatsappTriggerDefinitions = {
package/src/types.ts CHANGED
@@ -99,7 +99,7 @@ export const integrationScope = {
99
99
 
100
100
  /** One connection method accepted by an integration account requirement. */
101
101
  export interface IntegrationAccountConnectionOption {
102
- connectionId?: string
102
+ connectionMethodId?: string
103
103
  requiredScopes: readonly IntegrationScopeRequirement[]
104
104
  }
105
105
 
@@ -201,14 +201,14 @@ export function defineIntegrationService<
201
201
  `Integration service ${service.id} has no fields for form connection: ${emptyFormConnection.id}`,
202
202
  )
203
203
  }
204
- const duplicateConnectionId = service.connectionMethods.find(
204
+ const duplicateConnectionMethodId = service.connectionMethods.find(
205
205
  (connection, index) =>
206
206
  service.connectionMethods.findIndex(({ id }) => id === connection.id) !==
207
207
  index,
208
208
  )?.id
209
- if (duplicateConnectionId) {
209
+ if (duplicateConnectionMethodId) {
210
210
  throw new Error(
211
- `Integration service ${service.id} has duplicate connection ID: ${duplicateConnectionId}`,
211
+ `Integration service ${service.id} has duplicate connection method ID: ${duplicateConnectionMethodId}`,
212
212
  )
213
213
  }
214
214
  if (