@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.
- package/dist/authoring.d.ts +1 -0
- package/dist/authoring.js +1 -0
- package/dist/catalog.d.ts +142 -74
- package/dist/catalog.js +74 -13
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/triggers/airtable.js +1 -2
- package/dist/triggers/asana.js +1 -2
- package/dist/triggers/brevo.js +1 -2
- package/dist/triggers/core-dashboard.d.ts +374 -0
- package/dist/triggers/core-dashboard.js +202 -0
- package/dist/triggers/core-http.d.ts +30 -0
- package/dist/triggers/core-http.js +43 -0
- package/dist/triggers/core-invocation.d.ts +9 -0
- package/dist/triggers/core-invocation.js +15 -0
- package/dist/triggers/core-mailhook.d.ts +35 -0
- package/dist/triggers/core-mailhook.js +63 -0
- package/dist/triggers/core-schedule.d.ts +9 -0
- package/dist/triggers/core-schedule.js +17 -0
- package/dist/triggers/core.d.ts +15 -426
- package/dist/triggers/core.js +16 -346
- package/dist/triggers/github.js +4 -5
- package/dist/triggers/google.d.ts +143 -0
- package/dist/triggers/google.js +92 -5
- package/dist/triggers/index.d.ts +347 -74
- package/dist/triggers/index.js +2 -1
- package/dist/triggers/linear.js +1 -2
- package/dist/triggers/microsoft.js +3 -4
- package/dist/triggers/name.d.ts +13 -0
- package/dist/triggers/name.js +31 -0
- package/dist/triggers/resend.js +1 -2
- package/dist/triggers/slack.js +3 -4
- package/dist/triggers/trello.js +1 -2
- package/dist/triggers/vercel.d.ts +27 -27
- package/dist/triggers/vercel.js +10 -11
- package/dist/triggers/whatsapp.js +1 -2
- package/dist/types.d.ts +1 -1
- package/dist/types.js +3 -3
- package/package.json +118 -5
- package/src/authoring.ts +8 -0
- package/src/catalog.ts +76 -13
- package/src/index.ts +2 -0
- package/src/triggers/airtable.ts +1 -2
- package/src/triggers/asana.ts +1 -2
- package/src/triggers/brevo.ts +1 -2
- package/src/triggers/core-dashboard.ts +361 -0
- package/src/triggers/core-http.ts +69 -0
- package/src/triggers/core-invocation.ts +18 -0
- package/src/triggers/core-mailhook.ts +83 -0
- package/src/triggers/core-schedule.ts +21 -0
- package/src/triggers/core.ts +38 -544
- package/src/triggers/github.ts +4 -5
- package/src/triggers/google.ts +93 -5
- package/src/triggers/index.ts +2 -1
- package/src/triggers/linear.ts +1 -2
- package/src/triggers/microsoft.ts +3 -4
- package/src/triggers/name.ts +37 -0
- package/src/triggers/resend.ts +1 -2
- package/src/triggers/slack.ts +3 -4
- package/src/triggers/trello.ts +1 -2
- package/src/triggers/vercel.ts +10 -11
- package/src/triggers/whatsapp.ts +1 -2
- package/src/types.ts +4 -4
package/dist/triggers/core.js
CHANGED
|
@@ -1,348 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
const MAILHOOK_PRESENTATION_CONFIG_SCHEMA = z.object({
|
|
13
|
-
scope: z.prefault(z.enum(["trigger", "automation", "project"]), "trigger"),
|
|
14
|
-
});
|
|
15
|
-
const INVOCATION_PRESENTATION_CONFIG_SCHEMA = z.object({
|
|
16
|
-
entrypoint: z.string(),
|
|
17
|
-
});
|
|
18
|
-
const FIELD_NAME_SCHEMA = z
|
|
19
|
-
.string()
|
|
20
|
-
.check(z.trim(), z.minLength(1), z.maxLength(100));
|
|
21
|
-
const FIELD_LABEL_SCHEMA = z
|
|
22
|
-
.string()
|
|
23
|
-
.check(z.trim(), z.minLength(1), z.maxLength(255));
|
|
24
|
-
const FIELD_DESCRIPTION_SCHEMA = z.string().check(z.maxLength(2_000));
|
|
25
|
-
const FIELD_LENGTH_SCHEMA = z.int().check(z.nonnegative());
|
|
26
|
-
const DASHBOARD_RUN_FIELD_BASE_SCHEMA = {
|
|
27
|
-
description: z.optional(FIELD_DESCRIPTION_SCHEMA),
|
|
28
|
-
label: z.optional(FIELD_LABEL_SCHEMA),
|
|
29
|
-
name: FIELD_NAME_SCHEMA,
|
|
30
|
-
};
|
|
31
|
-
const DASHBOARD_RUN_TEXT_FIELD_SCHEMA = z.object({
|
|
32
|
-
...DASHBOARD_RUN_FIELD_BASE_SCHEMA,
|
|
33
|
-
defaultValue: z.optional(z.string()),
|
|
34
|
-
maxLength: z.optional(FIELD_LENGTH_SCHEMA),
|
|
35
|
-
minLength: z.optional(FIELD_LENGTH_SCHEMA),
|
|
36
|
-
placeholder: z.optional(z.string()),
|
|
37
|
-
required: z.prefault(z.boolean(), true),
|
|
38
|
-
type: z.enum(["email", "phone", "text", "textarea", "url"]),
|
|
39
|
-
});
|
|
40
|
-
const DASHBOARD_RUN_NUMBER_FIELD_SCHEMA = z.object({
|
|
41
|
-
...DASHBOARD_RUN_FIELD_BASE_SCHEMA,
|
|
42
|
-
defaultValue: z.optional(z.number()),
|
|
43
|
-
max: z.optional(z.number()),
|
|
44
|
-
min: z.optional(z.number()),
|
|
45
|
-
placeholder: z.optional(z.string()),
|
|
46
|
-
required: z.prefault(z.boolean(), true),
|
|
47
|
-
step: z.prefault(z.number().check(z.positive()), 1),
|
|
48
|
-
type: z.literal("number"),
|
|
49
|
-
});
|
|
50
|
-
const DASHBOARD_RUN_DATE_FIELD_SCHEMA = z.object({
|
|
51
|
-
...DASHBOARD_RUN_FIELD_BASE_SCHEMA,
|
|
52
|
-
defaultValue: z.optional(z.iso.date()),
|
|
53
|
-
max: z.optional(z.iso.date()),
|
|
54
|
-
min: z.optional(z.iso.date()),
|
|
55
|
-
required: z.prefault(z.boolean(), true),
|
|
56
|
-
step: z.prefault(z.int().check(z.positive()), 1),
|
|
57
|
-
type: z.literal("date"),
|
|
58
|
-
});
|
|
59
|
-
const DASHBOARD_RUN_DATETIME_FIELD_SCHEMA = z.object({
|
|
60
|
-
...DASHBOARD_RUN_FIELD_BASE_SCHEMA,
|
|
61
|
-
defaultValue: z.optional(z.iso.datetime({ local: true })),
|
|
62
|
-
max: z.optional(z.iso.datetime({ local: true })),
|
|
63
|
-
min: z.optional(z.iso.datetime({ local: true })),
|
|
64
|
-
required: z.prefault(z.boolean(), true),
|
|
65
|
-
step: z.prefault(z.number().check(z.positive()), 60),
|
|
66
|
-
type: z.literal("datetime"),
|
|
67
|
-
});
|
|
68
|
-
const DASHBOARD_RUN_CHOICE_FIELD_SCHEMA = {
|
|
69
|
-
...DASHBOARD_RUN_FIELD_BASE_SCHEMA,
|
|
70
|
-
defaultValue: z.optional(FIELD_NAME_SCHEMA),
|
|
71
|
-
options: z
|
|
72
|
-
.array(z.object({
|
|
73
|
-
label: FIELD_LABEL_SCHEMA,
|
|
74
|
-
value: FIELD_NAME_SCHEMA,
|
|
75
|
-
}))
|
|
76
|
-
.check(z.minLength(1)),
|
|
77
|
-
placeholder: z.optional(z.string()),
|
|
78
|
-
required: z.prefault(z.boolean(), true),
|
|
79
|
-
};
|
|
80
|
-
const DASHBOARD_RUN_SELECT_FIELD_SCHEMA = z.object({
|
|
81
|
-
...DASHBOARD_RUN_CHOICE_FIELD_SCHEMA,
|
|
82
|
-
type: z.literal("select"),
|
|
83
|
-
});
|
|
84
|
-
const DASHBOARD_RUN_RADIO_FIELD_SCHEMA = z.object({
|
|
85
|
-
...DASHBOARD_RUN_CHOICE_FIELD_SCHEMA,
|
|
86
|
-
type: z.literal("radio"),
|
|
87
|
-
});
|
|
88
|
-
const DASHBOARD_RUN_MULTI_SELECT_FIELD_SCHEMA = z.object({
|
|
89
|
-
...DASHBOARD_RUN_FIELD_BASE_SCHEMA,
|
|
90
|
-
defaultValue: z.optional(z.array(FIELD_NAME_SCHEMA)),
|
|
91
|
-
options: z
|
|
92
|
-
.array(z.object({
|
|
93
|
-
label: FIELD_LABEL_SCHEMA,
|
|
94
|
-
value: FIELD_NAME_SCHEMA,
|
|
95
|
-
}))
|
|
96
|
-
.check(z.minLength(1)),
|
|
97
|
-
placeholder: z.optional(z.string()),
|
|
98
|
-
required: z.prefault(z.boolean(), true),
|
|
99
|
-
type: z.literal("multi-select"),
|
|
100
|
-
});
|
|
101
|
-
const DASHBOARD_RUN_CHECKBOX_FIELD_SCHEMA = z.object({
|
|
102
|
-
...DASHBOARD_RUN_FIELD_BASE_SCHEMA,
|
|
103
|
-
defaultValue: z.prefault(z.boolean(), false),
|
|
104
|
-
required: z.prefault(z.boolean(), false),
|
|
105
|
-
type: z.literal("checkbox"),
|
|
106
|
-
});
|
|
107
|
-
const DASHBOARD_RUN_FIELD_SCHEMA = z.pipe(z.discriminatedUnion("type", [
|
|
108
|
-
DASHBOARD_RUN_TEXT_FIELD_SCHEMA,
|
|
109
|
-
DASHBOARD_RUN_NUMBER_FIELD_SCHEMA,
|
|
110
|
-
DASHBOARD_RUN_DATE_FIELD_SCHEMA,
|
|
111
|
-
DASHBOARD_RUN_DATETIME_FIELD_SCHEMA,
|
|
112
|
-
DASHBOARD_RUN_SELECT_FIELD_SCHEMA,
|
|
113
|
-
DASHBOARD_RUN_RADIO_FIELD_SCHEMA,
|
|
114
|
-
DASHBOARD_RUN_MULTI_SELECT_FIELD_SCHEMA,
|
|
115
|
-
DASHBOARD_RUN_CHECKBOX_FIELD_SCHEMA,
|
|
116
|
-
]), z.transform((field) => ({
|
|
117
|
-
...field,
|
|
118
|
-
label: field.label ??
|
|
119
|
-
`${sentenceCase(field.name)}${field.type === "checkbox" ? "?" : ""}`,
|
|
120
|
-
})));
|
|
121
|
-
const DASHBOARD_RUN_FIELDS_SCHEMA = z.array(DASHBOARD_RUN_FIELD_SCHEMA).check(z.refine((fields) => new Set(fields.map((field) => field.name)).size === fields.length, "Dashboard run field names must be unique."), z.refine((fields) => fields.every(isDashboardRunFieldDefaultValid), "Dashboard run field defaults must satisfy their field constraints."));
|
|
122
|
-
export const DASHBOARD_RUN_CONFIG_SCHEMA = z.object({
|
|
123
|
-
description: z.optional(FIELD_DESCRIPTION_SCHEMA),
|
|
124
|
-
fields: z.prefault(DASHBOARD_RUN_FIELDS_SCHEMA, []),
|
|
125
|
-
submitLabel: z.prefault(z.string().check(z.trim(), z.minLength(1), z.maxLength(100)), "Run"),
|
|
126
|
-
title: z.string().check(z.trim(), z.minLength(1), z.maxLength(255)),
|
|
127
|
-
});
|
|
1
|
+
import { dashboardRunTriggerDefinition } from "./core-dashboard.js";
|
|
2
|
+
import { httpRequestTriggerDefinition } from "./core-http.js";
|
|
3
|
+
import { automationInvokedTriggerDefinition } from "./core-invocation.js";
|
|
4
|
+
import { mailhookEmailReceivedTriggerDefinition } from "./core-mailhook.js";
|
|
5
|
+
import { cronTickTriggerDefinition } from "./core-schedule.js";
|
|
6
|
+
export { DASHBOARD_RUN_CONFIG_SCHEMA, dashboardRunTriggerDefinition, getDashboardRunEndpoint, getDashboardRunEndpointKey, } from "./core-dashboard.js";
|
|
7
|
+
export { getHttpTriggerEndpoint, getHttpTriggerEndpointKey, httpRequestTriggerDefinition, } from "./core-http.js";
|
|
8
|
+
export { automationInvokedTriggerDefinition } from "./core-invocation.js";
|
|
9
|
+
export { getMailhookAddress, getMailhookAddressKey, mailhookEmailReceivedTriggerDefinition, PLATFORM_EMAIL_DOMAIN, } from "./core-mailhook.js";
|
|
10
|
+
export { cronTickTriggerDefinition } from "./core-schedule.js";
|
|
11
|
+
export { sentenceCase } from "./name.js";
|
|
128
12
|
export const coreTriggerDefinitions = {
|
|
129
|
-
automationInvoked:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
},
|
|
135
|
-
],
|
|
136
|
-
icon: "automation",
|
|
137
|
-
name: "Invocation",
|
|
138
|
-
type: "automation.invoked",
|
|
139
|
-
},
|
|
140
|
-
cronTick: {
|
|
141
|
-
getDetails: ({ config }) => {
|
|
142
|
-
const parsedConfig = CRON_PRESENTATION_CONFIG_SCHEMA.parse(config);
|
|
143
|
-
return [
|
|
144
|
-
{ label: "Schedule", value: parsedConfig.schedule },
|
|
145
|
-
{ label: "Time zone", value: parsedConfig.timeZone },
|
|
146
|
-
];
|
|
147
|
-
},
|
|
148
|
-
icon: "schedule",
|
|
149
|
-
name: "Cron schedule",
|
|
150
|
-
type: "cron.tick",
|
|
151
|
-
},
|
|
152
|
-
httpRequest: {
|
|
153
|
-
getPrimary: ({ appOrigin, automationId, config, hookSlot, projectId, scopePath, }) => ({
|
|
154
|
-
copyable: true,
|
|
155
|
-
value: getHttpTriggerEndpoint({
|
|
156
|
-
appOrigin,
|
|
157
|
-
automationId,
|
|
158
|
-
hookSlot,
|
|
159
|
-
projectId,
|
|
160
|
-
scope: HTTP_PRESENTATION_CONFIG_SCHEMA.parse(config).scope,
|
|
161
|
-
scopePath,
|
|
162
|
-
}),
|
|
163
|
-
}),
|
|
164
|
-
icon: "webhook",
|
|
165
|
-
name: "HTTP request",
|
|
166
|
-
type: "http.request",
|
|
167
|
-
},
|
|
168
|
-
mailhookEmailReceived: {
|
|
169
|
-
getPrimary: ({ automationId, config, hookSlot, projectId, scopePath }) => ({
|
|
170
|
-
copyable: true,
|
|
171
|
-
value: getMailhookAddress({
|
|
172
|
-
automationId,
|
|
173
|
-
hookSlot,
|
|
174
|
-
projectId,
|
|
175
|
-
scope: MAILHOOK_PRESENTATION_CONFIG_SCHEMA.parse(config).scope,
|
|
176
|
-
scopePath,
|
|
177
|
-
}),
|
|
178
|
-
}),
|
|
179
|
-
icon: "webhook",
|
|
180
|
-
name: "Mailhook",
|
|
181
|
-
type: "mailhook.email.received",
|
|
182
|
-
},
|
|
183
|
-
dashboardRun: {
|
|
184
|
-
getDetails: ({ config }) => [
|
|
185
|
-
{
|
|
186
|
-
label: "Run form",
|
|
187
|
-
value: DASHBOARD_RUN_CONFIG_SCHEMA.parse(config).title,
|
|
188
|
-
},
|
|
189
|
-
],
|
|
190
|
-
icon: "automation",
|
|
191
|
-
name: "Dashboard run",
|
|
192
|
-
type: "dashboard.run",
|
|
193
|
-
},
|
|
13
|
+
automationInvoked: automationInvokedTriggerDefinition,
|
|
14
|
+
cronTick: cronTickTriggerDefinition,
|
|
15
|
+
dashboardRun: dashboardRunTriggerDefinition,
|
|
16
|
+
httpRequest: httpRequestTriggerDefinition,
|
|
17
|
+
mailhookEmailReceived: mailhookEmailReceivedTriggerDefinition,
|
|
194
18
|
};
|
|
195
|
-
export const PLATFORM_EMAIL_DOMAIN = "automations.automate.ax";
|
|
196
|
-
/**
|
|
197
|
-
* Returns the public URL for one deployed HTTP trigger.
|
|
198
|
-
*
|
|
199
|
-
* @param options - Public origin and trigger identity.
|
|
200
|
-
*/
|
|
201
|
-
export function getHttpTriggerEndpoint(options) {
|
|
202
|
-
return new URL(`/x/${getHttpTriggerEndpointKey(options)}/`, options.appOrigin).toString();
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Returns the durable endpoint identity for one configured HTTP scope.
|
|
206
|
-
*
|
|
207
|
-
* @param options - Trigger and owning resource identity.
|
|
208
|
-
*/
|
|
209
|
-
export function getHttpTriggerEndpointKey(options) {
|
|
210
|
-
if (options.scope === "project")
|
|
211
|
-
return options.projectId;
|
|
212
|
-
if (options.scope === "automation")
|
|
213
|
-
return options.automationId;
|
|
214
|
-
return `${options.automationId}:${[
|
|
215
|
-
...(options.scopePath ?? []),
|
|
216
|
-
options.hookSlot,
|
|
217
|
-
].join(".")}`;
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Returns the unique inbound address for one deployed mailhook.
|
|
221
|
-
*
|
|
222
|
-
* Add `+suffix` before the `@` to carry a routing value into the event.
|
|
223
|
-
*
|
|
224
|
-
* @param options - Mailhook identity and sharing scope.
|
|
225
|
-
* @throws When the generated local part exceeds the email size limit.
|
|
226
|
-
*/
|
|
227
|
-
export function getMailhookAddress(options) {
|
|
228
|
-
const localPart = `${getMailhookAddressKey(options)}${options.plusPath ? `+${options.plusPath}` : ""}`;
|
|
229
|
-
if (new TextEncoder().encode(localPart).length > MAX_EMAIL_LOCAL_PART_BYTES) {
|
|
230
|
-
throw new RangeError("Mailhook address local part exceeds 64 bytes.");
|
|
231
|
-
}
|
|
232
|
-
return EMAIL_SCHEMA.parse(`${localPart}@${PLATFORM_EMAIL_DOMAIN}`);
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* Returns the local-part router key for one configured mailhook scope.
|
|
236
|
-
*
|
|
237
|
-
* @param options - Mailhook identity and sharing scope.
|
|
238
|
-
*/
|
|
239
|
-
export function getMailhookAddressKey(options) {
|
|
240
|
-
if (options.scope === "project")
|
|
241
|
-
return `p${typeIdSuffix(options.projectId)}`;
|
|
242
|
-
if (options.scope === "automation") {
|
|
243
|
-
return `a${typeIdSuffix(options.automationId)}`;
|
|
244
|
-
}
|
|
245
|
-
return `a${typeIdSuffix(options.automationId)}.${[
|
|
246
|
-
...(options.scopePath ?? []),
|
|
247
|
-
options.hookSlot,
|
|
248
|
-
]
|
|
249
|
-
.map((segment) => segment.toString(36))
|
|
250
|
-
.join(".")}`;
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Returns the organization-authenticated submission endpoint for one dashboard
|
|
254
|
-
* run.
|
|
255
|
-
*
|
|
256
|
-
* @param options - Public origin and trigger identity.
|
|
257
|
-
*/
|
|
258
|
-
export function getDashboardRunEndpoint(options) {
|
|
259
|
-
return new URL(`/api/dashboard-runs/${getDashboardRunEndpointKey(options)}`, options.appOrigin).toString();
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* Returns the durable endpoint identity for one dashboard run trigger.
|
|
263
|
-
*
|
|
264
|
-
* @param options - Trigger and owning automation identity.
|
|
265
|
-
*/
|
|
266
|
-
export function getDashboardRunEndpointKey(options) {
|
|
267
|
-
return `${options.automationId}:${[
|
|
268
|
-
...(options.scopePath ?? []),
|
|
269
|
-
options.hookSlot,
|
|
270
|
-
].join(".")}`;
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* Checks a configured default against the same constraints as submitted data.
|
|
274
|
-
*
|
|
275
|
-
* @param field - Field definition to validate.
|
|
276
|
-
*/
|
|
277
|
-
function isDashboardRunFieldDefaultValid(field) {
|
|
278
|
-
if (field.type === "checkbox" || field.defaultValue === undefined)
|
|
279
|
-
return true;
|
|
280
|
-
if (field.type === "multi-select") {
|
|
281
|
-
if (field.required !== false && field.defaultValue.length === 0)
|
|
282
|
-
return false;
|
|
283
|
-
return field.defaultValue.every((value) => field.options.some((option) => option.value === value));
|
|
284
|
-
}
|
|
285
|
-
if (field.type === "radio" || field.type === "select") {
|
|
286
|
-
return field.options.some((option) => option.value === field.defaultValue);
|
|
287
|
-
}
|
|
288
|
-
if (field.type === "number") {
|
|
289
|
-
return ((field.min === undefined || field.defaultValue >= field.min) &&
|
|
290
|
-
(field.max === undefined || field.defaultValue <= field.max) &&
|
|
291
|
-
!isDashboardRunStepMismatch(field.defaultValue, field.min ?? field.defaultValue, field.step ?? 1));
|
|
292
|
-
}
|
|
293
|
-
if (field.type === "date" || field.type === "datetime") {
|
|
294
|
-
const defaultValue = parseDashboardRunDateValue(field.type, field.defaultValue);
|
|
295
|
-
return ((field.min === undefined ||
|
|
296
|
-
defaultValue >= parseDashboardRunDateValue(field.type, field.min)) &&
|
|
297
|
-
(field.max === undefined ||
|
|
298
|
-
defaultValue <= parseDashboardRunDateValue(field.type, field.max)) &&
|
|
299
|
-
!isDashboardRunStepMismatch(defaultValue, parseDashboardRunDateValue(field.type, field.min ?? field.defaultValue), (field.step ?? (field.type === "date" ? 1 : 60)) *
|
|
300
|
-
(field.type === "date" ? 86_400_000 : 1_000)));
|
|
301
|
-
}
|
|
302
|
-
const defaultValue = field.defaultValue.trim();
|
|
303
|
-
return ((defaultValue.length > 0 || field.required === false) &&
|
|
304
|
-
(field.minLength === undefined || defaultValue.length >= field.minLength) &&
|
|
305
|
-
(field.maxLength === undefined || defaultValue.length <= field.maxLength) &&
|
|
306
|
-
(field.type !== "email" || EMAIL_SCHEMA.safeParse(defaultValue).success) &&
|
|
307
|
-
(field.type !== "url" || URL_SCHEMA.safeParse(defaultValue).success));
|
|
308
|
-
}
|
|
309
|
-
/**
|
|
310
|
-
* Checks whether a value falls outside an allowed step interval.
|
|
311
|
-
*
|
|
312
|
-
* @param value - Configured default value.
|
|
313
|
-
* @param base - Value from which step intervals begin.
|
|
314
|
-
* @param step - Allowed interval size.
|
|
315
|
-
*/
|
|
316
|
-
function isDashboardRunStepMismatch(value, base, step) {
|
|
317
|
-
const intervals = (value - base) / step;
|
|
318
|
-
return Math.abs(intervals - Math.round(intervals)) > 1e-9;
|
|
319
|
-
}
|
|
320
|
-
/**
|
|
321
|
-
* Converts a validated local date or date-time string to a UTC number.
|
|
322
|
-
*
|
|
323
|
-
* @param type - Temporal field type.
|
|
324
|
-
* @param value - Local ISO value to convert.
|
|
325
|
-
*/
|
|
326
|
-
function parseDashboardRunDateValue(type, value) {
|
|
327
|
-
return Date.parse(type === "date" ? `${value}T00:00:00Z` : `${value}Z`);
|
|
328
|
-
}
|
|
329
|
-
/**
|
|
330
|
-
* Converts a stable identifier to a sentence-cased display name.
|
|
331
|
-
*
|
|
332
|
-
* @param value - Stable identifier to format.
|
|
333
|
-
*/
|
|
334
|
-
export function sentenceCase(value) {
|
|
335
|
-
const words = value
|
|
336
|
-
.replaceAll(/([a-z\d])([A-Z])/g, "$1 $2")
|
|
337
|
-
.replaceAll(/[._-]+/g, " ")
|
|
338
|
-
.toLowerCase();
|
|
339
|
-
return words.charAt(0).toUpperCase() + words.slice(1);
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* Removes the redundant TypeID prefix from an address router.
|
|
343
|
-
*
|
|
344
|
-
* @param id - Project or automation TypeID.
|
|
345
|
-
*/
|
|
346
|
-
function typeIdSuffix(id) {
|
|
347
|
-
return id.includes("_") ? id.slice(id.indexOf("_") + 1) : id;
|
|
348
|
-
}
|
package/dist/triggers/github.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { githubService } from "../catalog.js";
|
|
2
1
|
const GITHUB_ISSUES_ACCOUNT = {
|
|
3
2
|
connectionOptions: [
|
|
4
3
|
{
|
|
5
4
|
requiredScopes: ["issues:read"],
|
|
6
5
|
},
|
|
7
6
|
],
|
|
8
|
-
serviceId:
|
|
7
|
+
serviceId: "github",
|
|
9
8
|
};
|
|
10
9
|
const GITHUB_PULL_REQUESTS_ACCOUNT = {
|
|
11
10
|
connectionOptions: [
|
|
@@ -13,7 +12,7 @@ const GITHUB_PULL_REQUESTS_ACCOUNT = {
|
|
|
13
12
|
requiredScopes: ["pull_requests:read"],
|
|
14
13
|
},
|
|
15
14
|
],
|
|
16
|
-
serviceId:
|
|
15
|
+
serviceId: "github",
|
|
17
16
|
};
|
|
18
17
|
const GITHUB_CONTENTS_ACCOUNT = {
|
|
19
18
|
connectionOptions: [
|
|
@@ -21,7 +20,7 @@ const GITHUB_CONTENTS_ACCOUNT = {
|
|
|
21
20
|
requiredScopes: ["contents:read"],
|
|
22
21
|
},
|
|
23
22
|
],
|
|
24
|
-
serviceId:
|
|
23
|
+
serviceId: "github",
|
|
25
24
|
};
|
|
26
25
|
const GITHUB_ACTIONS_ACCOUNT = {
|
|
27
26
|
connectionOptions: [
|
|
@@ -29,7 +28,7 @@ const GITHUB_ACTIONS_ACCOUNT = {
|
|
|
29
28
|
requiredScopes: ["actions:read"],
|
|
30
29
|
},
|
|
31
30
|
],
|
|
32
|
-
serviceId:
|
|
31
|
+
serviceId: "github",
|
|
33
32
|
};
|
|
34
33
|
export const githubTriggerDefinitions = {
|
|
35
34
|
githubIssueClosed: {
|
|
@@ -132,4 +132,147 @@ export declare const googleTriggerDefinitions: {
|
|
|
132
132
|
readonly name: "Google Form response submitted";
|
|
133
133
|
readonly type: "googleForms.response.submitted";
|
|
134
134
|
};
|
|
135
|
+
readonly googleMeetConferenceEnded: {
|
|
136
|
+
readonly account: {
|
|
137
|
+
readonly connectionOptions: readonly [{
|
|
138
|
+
readonly requiredScopes: readonly ["https://www.googleapis.com/auth/meetings.space.readonly"];
|
|
139
|
+
}];
|
|
140
|
+
readonly serviceId: "google";
|
|
141
|
+
};
|
|
142
|
+
readonly icon: "google-meet";
|
|
143
|
+
readonly name: "Google Meet conference ended";
|
|
144
|
+
readonly type: "googleMeet.conference.ended";
|
|
145
|
+
};
|
|
146
|
+
readonly googleMeetConferenceStarted: {
|
|
147
|
+
readonly account: {
|
|
148
|
+
readonly connectionOptions: readonly [{
|
|
149
|
+
readonly requiredScopes: readonly ["https://www.googleapis.com/auth/meetings.space.readonly"];
|
|
150
|
+
}];
|
|
151
|
+
readonly serviceId: "google";
|
|
152
|
+
};
|
|
153
|
+
readonly icon: "google-meet";
|
|
154
|
+
readonly name: "Google Meet conference started";
|
|
155
|
+
readonly type: "googleMeet.conference.started";
|
|
156
|
+
};
|
|
157
|
+
readonly googleMeetParticipantJoined: {
|
|
158
|
+
readonly account: {
|
|
159
|
+
readonly connectionOptions: readonly [{
|
|
160
|
+
readonly requiredScopes: readonly ["https://www.googleapis.com/auth/meetings.space.readonly"];
|
|
161
|
+
}];
|
|
162
|
+
readonly serviceId: "google";
|
|
163
|
+
};
|
|
164
|
+
readonly icon: "google-meet";
|
|
165
|
+
readonly name: "Google Meet participant joined";
|
|
166
|
+
readonly type: "googleMeet.participant.joined";
|
|
167
|
+
};
|
|
168
|
+
readonly googleMeetParticipantLeft: {
|
|
169
|
+
readonly account: {
|
|
170
|
+
readonly connectionOptions: readonly [{
|
|
171
|
+
readonly requiredScopes: readonly ["https://www.googleapis.com/auth/meetings.space.readonly"];
|
|
172
|
+
}];
|
|
173
|
+
readonly serviceId: "google";
|
|
174
|
+
};
|
|
175
|
+
readonly icon: "google-meet";
|
|
176
|
+
readonly name: "Google Meet participant left";
|
|
177
|
+
readonly type: "googleMeet.participant.left";
|
|
178
|
+
};
|
|
179
|
+
readonly googleMeetRecordingEnded: {
|
|
180
|
+
readonly account: {
|
|
181
|
+
readonly connectionOptions: readonly [{
|
|
182
|
+
readonly requiredScopes: readonly ["https://www.googleapis.com/auth/meetings.space.readonly"];
|
|
183
|
+
}];
|
|
184
|
+
readonly serviceId: "google";
|
|
185
|
+
};
|
|
186
|
+
readonly icon: "google-meet";
|
|
187
|
+
readonly name: "Google Meet recording ended";
|
|
188
|
+
readonly type: "googleMeet.recording.ended";
|
|
189
|
+
};
|
|
190
|
+
readonly googleMeetRecordingFileGenerated: {
|
|
191
|
+
readonly account: {
|
|
192
|
+
readonly connectionOptions: readonly [{
|
|
193
|
+
readonly requiredScopes: readonly ["https://www.googleapis.com/auth/meetings.space.readonly"];
|
|
194
|
+
}];
|
|
195
|
+
readonly serviceId: "google";
|
|
196
|
+
};
|
|
197
|
+
readonly icon: "google-meet";
|
|
198
|
+
readonly name: "Google Meet recording generated";
|
|
199
|
+
readonly type: "googleMeet.recording.fileGenerated";
|
|
200
|
+
};
|
|
201
|
+
readonly googleMeetRecordingStarted: {
|
|
202
|
+
readonly account: {
|
|
203
|
+
readonly connectionOptions: readonly [{
|
|
204
|
+
readonly requiredScopes: readonly ["https://www.googleapis.com/auth/meetings.space.readonly"];
|
|
205
|
+
}];
|
|
206
|
+
readonly serviceId: "google";
|
|
207
|
+
};
|
|
208
|
+
readonly icon: "google-meet";
|
|
209
|
+
readonly name: "Google Meet recording started";
|
|
210
|
+
readonly type: "googleMeet.recording.started";
|
|
211
|
+
};
|
|
212
|
+
readonly googleMeetSmartNoteEnded: {
|
|
213
|
+
readonly account: {
|
|
214
|
+
readonly connectionOptions: readonly [{
|
|
215
|
+
readonly requiredScopes: readonly ["https://www.googleapis.com/auth/meetings.space.readonly"];
|
|
216
|
+
}];
|
|
217
|
+
readonly serviceId: "google";
|
|
218
|
+
};
|
|
219
|
+
readonly icon: "google-meet";
|
|
220
|
+
readonly name: "Google Meet smart note ended";
|
|
221
|
+
readonly type: "googleMeet.smartNote.ended";
|
|
222
|
+
};
|
|
223
|
+
readonly googleMeetSmartNoteFileGenerated: {
|
|
224
|
+
readonly account: {
|
|
225
|
+
readonly connectionOptions: readonly [{
|
|
226
|
+
readonly requiredScopes: readonly ["https://www.googleapis.com/auth/meetings.space.readonly"];
|
|
227
|
+
}];
|
|
228
|
+
readonly serviceId: "google";
|
|
229
|
+
};
|
|
230
|
+
readonly icon: "google-meet";
|
|
231
|
+
readonly name: "Google Meet smart note generated";
|
|
232
|
+
readonly type: "googleMeet.smartNote.fileGenerated";
|
|
233
|
+
};
|
|
234
|
+
readonly googleMeetSmartNoteStarted: {
|
|
235
|
+
readonly account: {
|
|
236
|
+
readonly connectionOptions: readonly [{
|
|
237
|
+
readonly requiredScopes: readonly ["https://www.googleapis.com/auth/meetings.space.readonly"];
|
|
238
|
+
}];
|
|
239
|
+
readonly serviceId: "google";
|
|
240
|
+
};
|
|
241
|
+
readonly icon: "google-meet";
|
|
242
|
+
readonly name: "Google Meet smart note started";
|
|
243
|
+
readonly type: "googleMeet.smartNote.started";
|
|
244
|
+
};
|
|
245
|
+
readonly googleMeetTranscriptEnded: {
|
|
246
|
+
readonly account: {
|
|
247
|
+
readonly connectionOptions: readonly [{
|
|
248
|
+
readonly requiredScopes: readonly ["https://www.googleapis.com/auth/meetings.space.readonly"];
|
|
249
|
+
}];
|
|
250
|
+
readonly serviceId: "google";
|
|
251
|
+
};
|
|
252
|
+
readonly icon: "google-meet";
|
|
253
|
+
readonly name: "Google Meet transcript ended";
|
|
254
|
+
readonly type: "googleMeet.transcript.ended";
|
|
255
|
+
};
|
|
256
|
+
readonly googleMeetTranscriptFileGenerated: {
|
|
257
|
+
readonly account: {
|
|
258
|
+
readonly connectionOptions: readonly [{
|
|
259
|
+
readonly requiredScopes: readonly ["https://www.googleapis.com/auth/meetings.space.readonly"];
|
|
260
|
+
}];
|
|
261
|
+
readonly serviceId: "google";
|
|
262
|
+
};
|
|
263
|
+
readonly icon: "google-meet";
|
|
264
|
+
readonly name: "Google Meet transcript generated";
|
|
265
|
+
readonly type: "googleMeet.transcript.fileGenerated";
|
|
266
|
+
};
|
|
267
|
+
readonly googleMeetTranscriptStarted: {
|
|
268
|
+
readonly account: {
|
|
269
|
+
readonly connectionOptions: readonly [{
|
|
270
|
+
readonly requiredScopes: readonly ["https://www.googleapis.com/auth/meetings.space.readonly"];
|
|
271
|
+
}];
|
|
272
|
+
readonly serviceId: "google";
|
|
273
|
+
};
|
|
274
|
+
readonly icon: "google-meet";
|
|
275
|
+
readonly name: "Google Meet transcript started";
|
|
276
|
+
readonly type: "googleMeet.transcript.started";
|
|
277
|
+
};
|
|
135
278
|
};
|
package/dist/triggers/google.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { googleService } from "../catalog.js";
|
|
2
1
|
const GMAIL_ACCOUNT = {
|
|
3
2
|
connectionOptions: [
|
|
4
3
|
{
|
|
@@ -14,7 +13,7 @@ const GMAIL_ACCOUNT = {
|
|
|
14
13
|
],
|
|
15
14
|
},
|
|
16
15
|
],
|
|
17
|
-
serviceId:
|
|
16
|
+
serviceId: "google",
|
|
18
17
|
};
|
|
19
18
|
const GOOGLE_CALENDAR_ACCOUNT = {
|
|
20
19
|
connectionOptions: [
|
|
@@ -33,7 +32,7 @@ const GOOGLE_CALENDAR_ACCOUNT = {
|
|
|
33
32
|
],
|
|
34
33
|
},
|
|
35
34
|
],
|
|
36
|
-
serviceId:
|
|
35
|
+
serviceId: "google",
|
|
37
36
|
};
|
|
38
37
|
const GOOGLE_FORMS_ACCOUNT = {
|
|
39
38
|
connectionOptions: [
|
|
@@ -52,7 +51,7 @@ const GOOGLE_FORMS_ACCOUNT = {
|
|
|
52
51
|
],
|
|
53
52
|
},
|
|
54
53
|
],
|
|
55
|
-
serviceId:
|
|
54
|
+
serviceId: "google",
|
|
56
55
|
};
|
|
57
56
|
const GOOGLE_FORM_RESPONSES_ACCOUNT = {
|
|
58
57
|
connectionOptions: [
|
|
@@ -94,7 +93,17 @@ const GOOGLE_FORM_RESPONSES_ACCOUNT = {
|
|
|
94
93
|
],
|
|
95
94
|
},
|
|
96
95
|
],
|
|
97
|
-
serviceId:
|
|
96
|
+
serviceId: "google",
|
|
97
|
+
};
|
|
98
|
+
const GOOGLE_MEET_ACCOUNT = {
|
|
99
|
+
connectionOptions: [
|
|
100
|
+
{
|
|
101
|
+
requiredScopes: [
|
|
102
|
+
"https://www.googleapis.com/auth/meetings.space.readonly",
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
serviceId: "google",
|
|
98
107
|
};
|
|
99
108
|
export const googleTriggerDefinitions = {
|
|
100
109
|
gmailLabelAdded: {
|
|
@@ -149,4 +158,82 @@ export const googleTriggerDefinitions = {
|
|
|
149
158
|
name: "Google Form response submitted",
|
|
150
159
|
type: "googleForms.response.submitted",
|
|
151
160
|
},
|
|
161
|
+
googleMeetConferenceEnded: {
|
|
162
|
+
account: GOOGLE_MEET_ACCOUNT,
|
|
163
|
+
icon: "google-meet",
|
|
164
|
+
name: "Google Meet conference ended",
|
|
165
|
+
type: "googleMeet.conference.ended",
|
|
166
|
+
},
|
|
167
|
+
googleMeetConferenceStarted: {
|
|
168
|
+
account: GOOGLE_MEET_ACCOUNT,
|
|
169
|
+
icon: "google-meet",
|
|
170
|
+
name: "Google Meet conference started",
|
|
171
|
+
type: "googleMeet.conference.started",
|
|
172
|
+
},
|
|
173
|
+
googleMeetParticipantJoined: {
|
|
174
|
+
account: GOOGLE_MEET_ACCOUNT,
|
|
175
|
+
icon: "google-meet",
|
|
176
|
+
name: "Google Meet participant joined",
|
|
177
|
+
type: "googleMeet.participant.joined",
|
|
178
|
+
},
|
|
179
|
+
googleMeetParticipantLeft: {
|
|
180
|
+
account: GOOGLE_MEET_ACCOUNT,
|
|
181
|
+
icon: "google-meet",
|
|
182
|
+
name: "Google Meet participant left",
|
|
183
|
+
type: "googleMeet.participant.left",
|
|
184
|
+
},
|
|
185
|
+
googleMeetRecordingEnded: {
|
|
186
|
+
account: GOOGLE_MEET_ACCOUNT,
|
|
187
|
+
icon: "google-meet",
|
|
188
|
+
name: "Google Meet recording ended",
|
|
189
|
+
type: "googleMeet.recording.ended",
|
|
190
|
+
},
|
|
191
|
+
googleMeetRecordingFileGenerated: {
|
|
192
|
+
account: GOOGLE_MEET_ACCOUNT,
|
|
193
|
+
icon: "google-meet",
|
|
194
|
+
name: "Google Meet recording generated",
|
|
195
|
+
type: "googleMeet.recording.fileGenerated",
|
|
196
|
+
},
|
|
197
|
+
googleMeetRecordingStarted: {
|
|
198
|
+
account: GOOGLE_MEET_ACCOUNT,
|
|
199
|
+
icon: "google-meet",
|
|
200
|
+
name: "Google Meet recording started",
|
|
201
|
+
type: "googleMeet.recording.started",
|
|
202
|
+
},
|
|
203
|
+
googleMeetSmartNoteEnded: {
|
|
204
|
+
account: GOOGLE_MEET_ACCOUNT,
|
|
205
|
+
icon: "google-meet",
|
|
206
|
+
name: "Google Meet smart note ended",
|
|
207
|
+
type: "googleMeet.smartNote.ended",
|
|
208
|
+
},
|
|
209
|
+
googleMeetSmartNoteFileGenerated: {
|
|
210
|
+
account: GOOGLE_MEET_ACCOUNT,
|
|
211
|
+
icon: "google-meet",
|
|
212
|
+
name: "Google Meet smart note generated",
|
|
213
|
+
type: "googleMeet.smartNote.fileGenerated",
|
|
214
|
+
},
|
|
215
|
+
googleMeetSmartNoteStarted: {
|
|
216
|
+
account: GOOGLE_MEET_ACCOUNT,
|
|
217
|
+
icon: "google-meet",
|
|
218
|
+
name: "Google Meet smart note started",
|
|
219
|
+
type: "googleMeet.smartNote.started",
|
|
220
|
+
},
|
|
221
|
+
googleMeetTranscriptEnded: {
|
|
222
|
+
account: GOOGLE_MEET_ACCOUNT,
|
|
223
|
+
icon: "google-meet",
|
|
224
|
+
name: "Google Meet transcript ended",
|
|
225
|
+
type: "googleMeet.transcript.ended",
|
|
226
|
+
},
|
|
227
|
+
googleMeetTranscriptFileGenerated: {
|
|
228
|
+
account: GOOGLE_MEET_ACCOUNT,
|
|
229
|
+
icon: "google-meet",
|
|
230
|
+
name: "Google Meet transcript generated",
|
|
231
|
+
type: "googleMeet.transcript.fileGenerated",
|
|
232
|
+
},
|
|
233
|
+
googleMeetTranscriptStarted: {
|
|
234
|
+
account: GOOGLE_MEET_ACCOUNT,
|
|
235
|
+
icon: "google-meet",
|
|
236
|
+
name: "Google Meet transcript started",
|
|
237
|
+
type: "googleMeet.transcript.started",
|
|
238
|
+
},
|
|
152
239
|
};
|