@automate.ax/catalog 0.75.0 → 0.76.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 (52) hide show
  1. package/dist/authoring.d.ts +1 -0
  2. package/dist/authoring.js +1 -0
  3. package/dist/triggers/airtable.js +1 -2
  4. package/dist/triggers/asana.js +1 -2
  5. package/dist/triggers/brevo.js +1 -2
  6. package/dist/triggers/core-dashboard.d.ts +374 -0
  7. package/dist/triggers/core-dashboard.js +202 -0
  8. package/dist/triggers/core-http.d.ts +30 -0
  9. package/dist/triggers/core-http.js +43 -0
  10. package/dist/triggers/core-invocation.d.ts +9 -0
  11. package/dist/triggers/core-invocation.js +15 -0
  12. package/dist/triggers/core-mailhook.d.ts +35 -0
  13. package/dist/triggers/core-mailhook.js +63 -0
  14. package/dist/triggers/core-schedule.d.ts +9 -0
  15. package/dist/triggers/core-schedule.js +17 -0
  16. package/dist/triggers/core.d.ts +15 -426
  17. package/dist/triggers/core.js +16 -346
  18. package/dist/triggers/github.js +4 -5
  19. package/dist/triggers/google.js +4 -5
  20. package/dist/triggers/index.d.ts +20 -20
  21. package/dist/triggers/index.js +2 -1
  22. package/dist/triggers/linear.js +1 -2
  23. package/dist/triggers/microsoft.js +3 -4
  24. package/dist/triggers/name.d.ts +13 -0
  25. package/dist/triggers/name.js +31 -0
  26. package/dist/triggers/resend.js +1 -2
  27. package/dist/triggers/slack.js +3 -4
  28. package/dist/triggers/trello.js +1 -2
  29. package/dist/triggers/vercel.js +5 -6
  30. package/dist/triggers/whatsapp.js +1 -2
  31. package/package.json +118 -5
  32. package/src/authoring.ts +8 -0
  33. package/src/triggers/airtable.ts +1 -2
  34. package/src/triggers/asana.ts +1 -2
  35. package/src/triggers/brevo.ts +1 -2
  36. package/src/triggers/core-dashboard.ts +361 -0
  37. package/src/triggers/core-http.ts +69 -0
  38. package/src/triggers/core-invocation.ts +18 -0
  39. package/src/triggers/core-mailhook.ts +83 -0
  40. package/src/triggers/core-schedule.ts +21 -0
  41. package/src/triggers/core.ts +38 -544
  42. package/src/triggers/github.ts +4 -5
  43. package/src/triggers/google.ts +4 -5
  44. package/src/triggers/index.ts +2 -1
  45. package/src/triggers/linear.ts +1 -2
  46. package/src/triggers/microsoft.ts +3 -4
  47. package/src/triggers/name.ts +37 -0
  48. package/src/triggers/resend.ts +1 -2
  49. package/src/triggers/slack.ts +3 -4
  50. package/src/triggers/trello.ts +1 -2
  51. package/src/triggers/vercel.ts +5 -6
  52. package/src/triggers/whatsapp.ts +1 -2
@@ -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,4 +1,3 @@
1
- import { vercelService } from "../catalog"
2
1
  import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
3
2
 
4
3
  const VERCEL_DEPLOYMENT_ACCOUNT = {
@@ -8,7 +7,7 @@ const VERCEL_DEPLOYMENT_ACCOUNT = {
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 = {
@@ -18,7 +17,7 @@ const VERCEL_INTEGRATION_CONFIGURATION_ACCOUNT = {
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 = {
@@ -28,7 +27,7 @@ const VERCEL_PROJECT_ACCOUNT = {
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 = {
@@ -38,7 +37,7 @@ const VERCEL_PROJECT_DOMAIN_ACCOUNT = {
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 = {
@@ -48,7 +47,7 @@ const VERCEL_PROJECT_ENVIRONMENT_VARIABLE_ACCOUNT = {
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 = {