@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.
- package/dist/authoring.d.ts +1 -0
- package/dist/authoring.js +1 -0
- 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.js +4 -5
- package/dist/triggers/index.d.ts +20 -20
- 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.js +5 -6
- package/dist/triggers/whatsapp.js +1 -2
- package/package.json +118 -5
- package/src/authoring.ts +8 -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 +4 -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 +5 -6
- package/src/triggers/whatsapp.ts +1 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { integrationScope, type IntegrationAccountConnectionOption, type IntegrationAccountRequirement, type IntegrationScopeRequirement, type ScopeRequirementGroup, type TriggerDefinition, } from "./types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { integrationScope, } from "./types.js";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { airtableService } from "../catalog.js";
|
|
2
1
|
const AIRTABLE_ACCOUNT = {
|
|
3
2
|
connectionOptions: [
|
|
4
3
|
{
|
|
@@ -10,7 +9,7 @@ const AIRTABLE_ACCOUNT = {
|
|
|
10
9
|
],
|
|
11
10
|
},
|
|
12
11
|
],
|
|
13
|
-
serviceId:
|
|
12
|
+
serviceId: "airtable",
|
|
14
13
|
};
|
|
15
14
|
export const airtableTriggerDefinitions = {
|
|
16
15
|
airtableRecordCreated: {
|
package/dist/triggers/asana.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { asanaService } from "../catalog.js";
|
|
2
1
|
const ASANA_ACCOUNT = {
|
|
3
2
|
connectionOptions: [
|
|
4
3
|
{
|
|
5
4
|
requiredScopes: [],
|
|
6
5
|
},
|
|
7
6
|
],
|
|
8
|
-
serviceId:
|
|
7
|
+
serviceId: "asana",
|
|
9
8
|
};
|
|
10
9
|
export const asanaTriggerDefinitions = {
|
|
11
10
|
asanaCommentAdded: {
|
package/dist/triggers/brevo.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { brevoService } from "../catalog.js";
|
|
2
1
|
const BREVO_ACCOUNT = {
|
|
3
2
|
connectionOptions: [
|
|
4
3
|
{
|
|
5
4
|
requiredScopes: [],
|
|
6
5
|
},
|
|
7
6
|
],
|
|
8
|
-
serviceId:
|
|
7
|
+
serviceId: "brevo",
|
|
9
8
|
};
|
|
10
9
|
export const brevoTriggerDefinitions = {
|
|
11
10
|
brevoTransactionalBlocked: {
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import * as z from "zod/mini";
|
|
2
|
+
export declare const DASHBOARD_RUN_CONFIG_SCHEMA: z.ZodMiniObject<{
|
|
3
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
4
|
+
fields: z.ZodMiniPrefault<z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
5
|
+
defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
6
|
+
maxLength: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
|
|
7
|
+
minLength: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
|
|
8
|
+
placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
9
|
+
required: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
10
|
+
type: z.ZodMiniEnum<{
|
|
11
|
+
email: "email";
|
|
12
|
+
text: "text";
|
|
13
|
+
url: "url";
|
|
14
|
+
phone: "phone";
|
|
15
|
+
textarea: "textarea";
|
|
16
|
+
}>;
|
|
17
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
18
|
+
label: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
19
|
+
name: z.ZodMiniString<string>;
|
|
20
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
21
|
+
defaultValue: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
22
|
+
max: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
23
|
+
min: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
24
|
+
placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
25
|
+
required: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
26
|
+
step: z.ZodMiniPrefault<z.ZodMiniNumber<number>>;
|
|
27
|
+
type: z.ZodMiniLiteral<"number">;
|
|
28
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
29
|
+
label: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
30
|
+
name: z.ZodMiniString<string>;
|
|
31
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
32
|
+
defaultValue: z.ZodMiniOptional<z.iso.ZodMiniISODate>;
|
|
33
|
+
max: z.ZodMiniOptional<z.iso.ZodMiniISODate>;
|
|
34
|
+
min: z.ZodMiniOptional<z.iso.ZodMiniISODate>;
|
|
35
|
+
required: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
36
|
+
step: z.ZodMiniPrefault<z.ZodMiniNumberFormat>;
|
|
37
|
+
type: z.ZodMiniLiteral<"date">;
|
|
38
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
39
|
+
label: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
40
|
+
name: z.ZodMiniString<string>;
|
|
41
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
42
|
+
defaultValue: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
43
|
+
max: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
44
|
+
min: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
|
|
45
|
+
required: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
46
|
+
step: z.ZodMiniPrefault<z.ZodMiniNumber<number>>;
|
|
47
|
+
type: z.ZodMiniLiteral<"datetime">;
|
|
48
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
49
|
+
label: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
50
|
+
name: z.ZodMiniString<string>;
|
|
51
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
52
|
+
type: z.ZodMiniLiteral<"select">;
|
|
53
|
+
defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
54
|
+
options: z.ZodMiniArray<z.ZodMiniObject<{
|
|
55
|
+
label: z.ZodMiniString<string>;
|
|
56
|
+
value: z.ZodMiniString<string>;
|
|
57
|
+
}, z.core.$strip>>;
|
|
58
|
+
placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
59
|
+
required: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
60
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
61
|
+
label: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
62
|
+
name: z.ZodMiniString<string>;
|
|
63
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
64
|
+
type: z.ZodMiniLiteral<"radio">;
|
|
65
|
+
defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
66
|
+
options: z.ZodMiniArray<z.ZodMiniObject<{
|
|
67
|
+
label: z.ZodMiniString<string>;
|
|
68
|
+
value: z.ZodMiniString<string>;
|
|
69
|
+
}, z.core.$strip>>;
|
|
70
|
+
placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
71
|
+
required: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
72
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
73
|
+
label: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
74
|
+
name: z.ZodMiniString<string>;
|
|
75
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
76
|
+
defaultValue: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
77
|
+
options: z.ZodMiniArray<z.ZodMiniObject<{
|
|
78
|
+
label: z.ZodMiniString<string>;
|
|
79
|
+
value: z.ZodMiniString<string>;
|
|
80
|
+
}, z.core.$strip>>;
|
|
81
|
+
placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
82
|
+
required: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
83
|
+
type: z.ZodMiniLiteral<"multi-select">;
|
|
84
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
85
|
+
label: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
86
|
+
name: z.ZodMiniString<string>;
|
|
87
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
88
|
+
defaultValue: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
89
|
+
required: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
90
|
+
type: z.ZodMiniLiteral<"checkbox">;
|
|
91
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
92
|
+
label: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
93
|
+
name: z.ZodMiniString<string>;
|
|
94
|
+
}, z.core.$strip>], "type">, z.ZodMiniTransform<{
|
|
95
|
+
label: string;
|
|
96
|
+
required: boolean;
|
|
97
|
+
type: "email" | "text" | "url" | "phone" | "textarea";
|
|
98
|
+
name: string;
|
|
99
|
+
defaultValue?: string | undefined;
|
|
100
|
+
maxLength?: number | undefined;
|
|
101
|
+
minLength?: number | undefined;
|
|
102
|
+
placeholder?: string | undefined;
|
|
103
|
+
description?: string | undefined;
|
|
104
|
+
} | {
|
|
105
|
+
label: string;
|
|
106
|
+
required: boolean;
|
|
107
|
+
step: number;
|
|
108
|
+
type: "number";
|
|
109
|
+
name: string;
|
|
110
|
+
defaultValue?: number | undefined;
|
|
111
|
+
max?: number | undefined;
|
|
112
|
+
min?: number | undefined;
|
|
113
|
+
placeholder?: string | undefined;
|
|
114
|
+
description?: string | undefined;
|
|
115
|
+
} | {
|
|
116
|
+
label: string;
|
|
117
|
+
required: boolean;
|
|
118
|
+
step: number;
|
|
119
|
+
type: "date";
|
|
120
|
+
name: string;
|
|
121
|
+
defaultValue?: string | undefined;
|
|
122
|
+
max?: string | undefined;
|
|
123
|
+
min?: string | undefined;
|
|
124
|
+
description?: string | undefined;
|
|
125
|
+
} | {
|
|
126
|
+
label: string;
|
|
127
|
+
required: boolean;
|
|
128
|
+
step: number;
|
|
129
|
+
type: "datetime";
|
|
130
|
+
name: string;
|
|
131
|
+
defaultValue?: string | undefined;
|
|
132
|
+
max?: string | undefined;
|
|
133
|
+
min?: string | undefined;
|
|
134
|
+
description?: string | undefined;
|
|
135
|
+
} | {
|
|
136
|
+
label: string;
|
|
137
|
+
type: "select";
|
|
138
|
+
options: {
|
|
139
|
+
label: string;
|
|
140
|
+
value: string;
|
|
141
|
+
}[];
|
|
142
|
+
required: boolean;
|
|
143
|
+
name: string;
|
|
144
|
+
defaultValue?: string | undefined;
|
|
145
|
+
placeholder?: string | undefined;
|
|
146
|
+
description?: string | undefined;
|
|
147
|
+
} | {
|
|
148
|
+
label: string;
|
|
149
|
+
type: "radio";
|
|
150
|
+
options: {
|
|
151
|
+
label: string;
|
|
152
|
+
value: string;
|
|
153
|
+
}[];
|
|
154
|
+
required: boolean;
|
|
155
|
+
name: string;
|
|
156
|
+
defaultValue?: string | undefined;
|
|
157
|
+
placeholder?: string | undefined;
|
|
158
|
+
description?: string | undefined;
|
|
159
|
+
} | {
|
|
160
|
+
label: string;
|
|
161
|
+
options: {
|
|
162
|
+
label: string;
|
|
163
|
+
value: string;
|
|
164
|
+
}[];
|
|
165
|
+
required: boolean;
|
|
166
|
+
type: "multi-select";
|
|
167
|
+
name: string;
|
|
168
|
+
defaultValue?: string[] | undefined;
|
|
169
|
+
placeholder?: string | undefined;
|
|
170
|
+
description?: string | undefined;
|
|
171
|
+
} | {
|
|
172
|
+
label: string;
|
|
173
|
+
defaultValue: boolean;
|
|
174
|
+
required: boolean;
|
|
175
|
+
type: "checkbox";
|
|
176
|
+
name: string;
|
|
177
|
+
description?: string | undefined;
|
|
178
|
+
}, {
|
|
179
|
+
required: boolean;
|
|
180
|
+
type: "email" | "text" | "url" | "phone" | "textarea";
|
|
181
|
+
name: string;
|
|
182
|
+
defaultValue?: string | undefined;
|
|
183
|
+
maxLength?: number | undefined;
|
|
184
|
+
minLength?: number | undefined;
|
|
185
|
+
placeholder?: string | undefined;
|
|
186
|
+
description?: string | undefined;
|
|
187
|
+
label?: string | undefined;
|
|
188
|
+
} | {
|
|
189
|
+
required: boolean;
|
|
190
|
+
step: number;
|
|
191
|
+
type: "number";
|
|
192
|
+
name: string;
|
|
193
|
+
defaultValue?: number | undefined;
|
|
194
|
+
max?: number | undefined;
|
|
195
|
+
min?: number | undefined;
|
|
196
|
+
placeholder?: string | undefined;
|
|
197
|
+
description?: string | undefined;
|
|
198
|
+
label?: string | undefined;
|
|
199
|
+
} | {
|
|
200
|
+
required: boolean;
|
|
201
|
+
step: number;
|
|
202
|
+
type: "date";
|
|
203
|
+
name: string;
|
|
204
|
+
defaultValue?: string | undefined;
|
|
205
|
+
max?: string | undefined;
|
|
206
|
+
min?: string | undefined;
|
|
207
|
+
description?: string | undefined;
|
|
208
|
+
label?: string | undefined;
|
|
209
|
+
} | {
|
|
210
|
+
required: boolean;
|
|
211
|
+
step: number;
|
|
212
|
+
type: "datetime";
|
|
213
|
+
name: string;
|
|
214
|
+
defaultValue?: string | undefined;
|
|
215
|
+
max?: string | undefined;
|
|
216
|
+
min?: string | undefined;
|
|
217
|
+
description?: string | undefined;
|
|
218
|
+
label?: string | undefined;
|
|
219
|
+
} | {
|
|
220
|
+
type: "select";
|
|
221
|
+
options: {
|
|
222
|
+
label: string;
|
|
223
|
+
value: string;
|
|
224
|
+
}[];
|
|
225
|
+
required: boolean;
|
|
226
|
+
name: string;
|
|
227
|
+
defaultValue?: string | undefined;
|
|
228
|
+
placeholder?: string | undefined;
|
|
229
|
+
description?: string | undefined;
|
|
230
|
+
label?: string | undefined;
|
|
231
|
+
} | {
|
|
232
|
+
type: "radio";
|
|
233
|
+
options: {
|
|
234
|
+
label: string;
|
|
235
|
+
value: string;
|
|
236
|
+
}[];
|
|
237
|
+
required: boolean;
|
|
238
|
+
name: string;
|
|
239
|
+
defaultValue?: string | undefined;
|
|
240
|
+
placeholder?: string | undefined;
|
|
241
|
+
description?: string | undefined;
|
|
242
|
+
label?: string | undefined;
|
|
243
|
+
} | {
|
|
244
|
+
options: {
|
|
245
|
+
label: string;
|
|
246
|
+
value: string;
|
|
247
|
+
}[];
|
|
248
|
+
required: boolean;
|
|
249
|
+
type: "multi-select";
|
|
250
|
+
name: string;
|
|
251
|
+
defaultValue?: string[] | undefined;
|
|
252
|
+
placeholder?: string | undefined;
|
|
253
|
+
description?: string | undefined;
|
|
254
|
+
label?: string | undefined;
|
|
255
|
+
} | {
|
|
256
|
+
defaultValue: boolean;
|
|
257
|
+
required: boolean;
|
|
258
|
+
type: "checkbox";
|
|
259
|
+
name: string;
|
|
260
|
+
description?: string | undefined;
|
|
261
|
+
label?: string | undefined;
|
|
262
|
+
}>>>>;
|
|
263
|
+
submitLabel: z.ZodMiniPrefault<z.ZodMiniString<string>>;
|
|
264
|
+
title: z.ZodMiniString<string>;
|
|
265
|
+
}, z.core.$strip>;
|
|
266
|
+
export declare const dashboardRunTriggerDefinition: {
|
|
267
|
+
readonly getDetails: ({ config }: import("..").TriggerPresentationContext) => {
|
|
268
|
+
label: string;
|
|
269
|
+
value: string;
|
|
270
|
+
}[];
|
|
271
|
+
readonly icon: "automation";
|
|
272
|
+
readonly name: "Dashboard run";
|
|
273
|
+
readonly type: "dashboard.run";
|
|
274
|
+
};
|
|
275
|
+
interface DashboardRunFieldBase {
|
|
276
|
+
/** Supporting text shown below the field. */
|
|
277
|
+
description?: string;
|
|
278
|
+
/** Visible field label. Inferred from `name` when omitted. */
|
|
279
|
+
label?: string;
|
|
280
|
+
/** Property name used in submitted trigger data. */
|
|
281
|
+
name: string;
|
|
282
|
+
/** Whether the form must contain a value. Defaults to true. */
|
|
283
|
+
required?: boolean;
|
|
284
|
+
}
|
|
285
|
+
export type DashboardRunField = (DashboardRunFieldBase & {
|
|
286
|
+
defaultValue?: string;
|
|
287
|
+
maxLength?: number;
|
|
288
|
+
minLength?: number;
|
|
289
|
+
placeholder?: string;
|
|
290
|
+
type: "email" | "phone" | "text" | "textarea" | "url";
|
|
291
|
+
}) | (DashboardRunFieldBase & {
|
|
292
|
+
defaultValue?: number;
|
|
293
|
+
max?: number;
|
|
294
|
+
min?: number;
|
|
295
|
+
placeholder?: string;
|
|
296
|
+
/** Increment used by the number input. Defaults to 1. */
|
|
297
|
+
step?: number;
|
|
298
|
+
type: "number";
|
|
299
|
+
}) | (DashboardRunFieldBase & {
|
|
300
|
+
/** Initial local date in `YYYY-MM-DD` format. */
|
|
301
|
+
defaultValue?: string;
|
|
302
|
+
max?: string;
|
|
303
|
+
min?: string;
|
|
304
|
+
/** Allowed increment in days. Defaults to 1. */
|
|
305
|
+
step?: number;
|
|
306
|
+
type: "date";
|
|
307
|
+
}) | (DashboardRunFieldBase & {
|
|
308
|
+
/** Initial local date and time in `YYYY-MM-DDTHH:mm` format. */
|
|
309
|
+
defaultValue?: string;
|
|
310
|
+
max?: string;
|
|
311
|
+
min?: string;
|
|
312
|
+
/** Allowed increment in seconds. Defaults to 60. */
|
|
313
|
+
step?: number;
|
|
314
|
+
type: "datetime";
|
|
315
|
+
}) | (DashboardRunFieldBase & {
|
|
316
|
+
defaultValue?: string;
|
|
317
|
+
options: readonly {
|
|
318
|
+
label: string;
|
|
319
|
+
value: string;
|
|
320
|
+
}[];
|
|
321
|
+
placeholder?: string;
|
|
322
|
+
type: "select";
|
|
323
|
+
}) | (DashboardRunFieldBase & {
|
|
324
|
+
defaultValue?: string;
|
|
325
|
+
options: readonly {
|
|
326
|
+
label: string;
|
|
327
|
+
value: string;
|
|
328
|
+
}[];
|
|
329
|
+
type: "radio";
|
|
330
|
+
}) | (DashboardRunFieldBase & {
|
|
331
|
+
defaultValue?: readonly string[];
|
|
332
|
+
options: readonly {
|
|
333
|
+
label: string;
|
|
334
|
+
value: string;
|
|
335
|
+
}[];
|
|
336
|
+
placeholder?: string;
|
|
337
|
+
type: "multi-select";
|
|
338
|
+
}) | (DashboardRunFieldBase & {
|
|
339
|
+
/** Initial checked state. Defaults to false. */
|
|
340
|
+
defaultValue?: boolean;
|
|
341
|
+
/** Whether the checkbox must be checked. Defaults to false. */
|
|
342
|
+
required?: boolean;
|
|
343
|
+
type: "checkbox";
|
|
344
|
+
});
|
|
345
|
+
export interface DashboardRunConfig<TFields extends readonly DashboardRunField[] = readonly DashboardRunField[]> {
|
|
346
|
+
/** Supporting text shown below the form title. */
|
|
347
|
+
description?: string;
|
|
348
|
+
/** Ordered fields. Omit to run immediately. */
|
|
349
|
+
fields?: TFields;
|
|
350
|
+
/** Submit button text. Defaults to "Run". */
|
|
351
|
+
submitLabel?: string;
|
|
352
|
+
/** Form heading. */
|
|
353
|
+
title: string;
|
|
354
|
+
}
|
|
355
|
+
export interface DashboardRunEndpointOptions {
|
|
356
|
+
appOrigin: string;
|
|
357
|
+
automationId: string;
|
|
358
|
+
hookSlot: number;
|
|
359
|
+
scopePath?: readonly number[];
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Returns the organization-authenticated submission endpoint for one dashboard
|
|
363
|
+
* run.
|
|
364
|
+
*
|
|
365
|
+
* @param options - Public origin and trigger identity.
|
|
366
|
+
*/
|
|
367
|
+
export declare function getDashboardRunEndpoint(options: DashboardRunEndpointOptions): string;
|
|
368
|
+
/**
|
|
369
|
+
* Returns the durable endpoint identity for one dashboard run trigger.
|
|
370
|
+
*
|
|
371
|
+
* @param options - Trigger and owning automation identity.
|
|
372
|
+
*/
|
|
373
|
+
export declare function getDashboardRunEndpointKey(options: Omit<DashboardRunEndpointOptions, "appOrigin">): string;
|
|
374
|
+
export {};
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { sentenceCase } from "./name.js";
|
|
2
|
+
import * as z from "zod/mini";
|
|
3
|
+
const EMAIL_SCHEMA = z.email();
|
|
4
|
+
const URL_SCHEMA = z.url();
|
|
5
|
+
const FIELD_NAME_SCHEMA = z
|
|
6
|
+
.string()
|
|
7
|
+
.check(z.trim(), z.minLength(1), z.maxLength(100));
|
|
8
|
+
const FIELD_LABEL_SCHEMA = z
|
|
9
|
+
.string()
|
|
10
|
+
.check(z.trim(), z.minLength(1), z.maxLength(255));
|
|
11
|
+
const FIELD_DESCRIPTION_SCHEMA = z.string().check(z.maxLength(2_000));
|
|
12
|
+
const FIELD_LENGTH_SCHEMA = z.int().check(z.nonnegative());
|
|
13
|
+
const DASHBOARD_RUN_FIELD_BASE_SCHEMA = {
|
|
14
|
+
description: z.optional(FIELD_DESCRIPTION_SCHEMA),
|
|
15
|
+
label: z.optional(FIELD_LABEL_SCHEMA),
|
|
16
|
+
name: FIELD_NAME_SCHEMA,
|
|
17
|
+
};
|
|
18
|
+
const DASHBOARD_RUN_TEXT_FIELD_SCHEMA = z.object({
|
|
19
|
+
...DASHBOARD_RUN_FIELD_BASE_SCHEMA,
|
|
20
|
+
defaultValue: z.optional(z.string()),
|
|
21
|
+
maxLength: z.optional(FIELD_LENGTH_SCHEMA),
|
|
22
|
+
minLength: z.optional(FIELD_LENGTH_SCHEMA),
|
|
23
|
+
placeholder: z.optional(z.string()),
|
|
24
|
+
required: z.prefault(z.boolean(), true),
|
|
25
|
+
type: z.enum(["email", "phone", "text", "textarea", "url"]),
|
|
26
|
+
});
|
|
27
|
+
const DASHBOARD_RUN_NUMBER_FIELD_SCHEMA = z.object({
|
|
28
|
+
...DASHBOARD_RUN_FIELD_BASE_SCHEMA,
|
|
29
|
+
defaultValue: z.optional(z.number()),
|
|
30
|
+
max: z.optional(z.number()),
|
|
31
|
+
min: z.optional(z.number()),
|
|
32
|
+
placeholder: z.optional(z.string()),
|
|
33
|
+
required: z.prefault(z.boolean(), true),
|
|
34
|
+
step: z.prefault(z.number().check(z.positive()), 1),
|
|
35
|
+
type: z.literal("number"),
|
|
36
|
+
});
|
|
37
|
+
const DASHBOARD_RUN_DATE_FIELD_SCHEMA = z.object({
|
|
38
|
+
...DASHBOARD_RUN_FIELD_BASE_SCHEMA,
|
|
39
|
+
defaultValue: z.optional(z.iso.date()),
|
|
40
|
+
max: z.optional(z.iso.date()),
|
|
41
|
+
min: z.optional(z.iso.date()),
|
|
42
|
+
required: z.prefault(z.boolean(), true),
|
|
43
|
+
step: z.prefault(z.int().check(z.positive()), 1),
|
|
44
|
+
type: z.literal("date"),
|
|
45
|
+
});
|
|
46
|
+
const DASHBOARD_RUN_DATETIME_FIELD_SCHEMA = z.object({
|
|
47
|
+
...DASHBOARD_RUN_FIELD_BASE_SCHEMA,
|
|
48
|
+
defaultValue: z.optional(z.iso.datetime({ local: true })),
|
|
49
|
+
max: z.optional(z.iso.datetime({ local: true })),
|
|
50
|
+
min: z.optional(z.iso.datetime({ local: true })),
|
|
51
|
+
required: z.prefault(z.boolean(), true),
|
|
52
|
+
step: z.prefault(z.number().check(z.positive()), 60),
|
|
53
|
+
type: z.literal("datetime"),
|
|
54
|
+
});
|
|
55
|
+
const DASHBOARD_RUN_CHOICE_FIELD_SCHEMA = {
|
|
56
|
+
...DASHBOARD_RUN_FIELD_BASE_SCHEMA,
|
|
57
|
+
defaultValue: z.optional(FIELD_NAME_SCHEMA),
|
|
58
|
+
options: z
|
|
59
|
+
.array(z.object({
|
|
60
|
+
label: FIELD_LABEL_SCHEMA,
|
|
61
|
+
value: FIELD_NAME_SCHEMA,
|
|
62
|
+
}))
|
|
63
|
+
.check(z.minLength(1)),
|
|
64
|
+
placeholder: z.optional(z.string()),
|
|
65
|
+
required: z.prefault(z.boolean(), true),
|
|
66
|
+
};
|
|
67
|
+
const DASHBOARD_RUN_SELECT_FIELD_SCHEMA = z.object({
|
|
68
|
+
...DASHBOARD_RUN_CHOICE_FIELD_SCHEMA,
|
|
69
|
+
type: z.literal("select"),
|
|
70
|
+
});
|
|
71
|
+
const DASHBOARD_RUN_RADIO_FIELD_SCHEMA = z.object({
|
|
72
|
+
...DASHBOARD_RUN_CHOICE_FIELD_SCHEMA,
|
|
73
|
+
type: z.literal("radio"),
|
|
74
|
+
});
|
|
75
|
+
const DASHBOARD_RUN_MULTI_SELECT_FIELD_SCHEMA = z.object({
|
|
76
|
+
...DASHBOARD_RUN_FIELD_BASE_SCHEMA,
|
|
77
|
+
defaultValue: z.optional(z.array(FIELD_NAME_SCHEMA)),
|
|
78
|
+
options: z
|
|
79
|
+
.array(z.object({
|
|
80
|
+
label: FIELD_LABEL_SCHEMA,
|
|
81
|
+
value: FIELD_NAME_SCHEMA,
|
|
82
|
+
}))
|
|
83
|
+
.check(z.minLength(1)),
|
|
84
|
+
placeholder: z.optional(z.string()),
|
|
85
|
+
required: z.prefault(z.boolean(), true),
|
|
86
|
+
type: z.literal("multi-select"),
|
|
87
|
+
});
|
|
88
|
+
const DASHBOARD_RUN_CHECKBOX_FIELD_SCHEMA = z.object({
|
|
89
|
+
...DASHBOARD_RUN_FIELD_BASE_SCHEMA,
|
|
90
|
+
defaultValue: z.prefault(z.boolean(), false),
|
|
91
|
+
required: z.prefault(z.boolean(), false),
|
|
92
|
+
type: z.literal("checkbox"),
|
|
93
|
+
});
|
|
94
|
+
const DASHBOARD_RUN_FIELD_SCHEMA = z.pipe(z.discriminatedUnion("type", [
|
|
95
|
+
DASHBOARD_RUN_TEXT_FIELD_SCHEMA,
|
|
96
|
+
DASHBOARD_RUN_NUMBER_FIELD_SCHEMA,
|
|
97
|
+
DASHBOARD_RUN_DATE_FIELD_SCHEMA,
|
|
98
|
+
DASHBOARD_RUN_DATETIME_FIELD_SCHEMA,
|
|
99
|
+
DASHBOARD_RUN_SELECT_FIELD_SCHEMA,
|
|
100
|
+
DASHBOARD_RUN_RADIO_FIELD_SCHEMA,
|
|
101
|
+
DASHBOARD_RUN_MULTI_SELECT_FIELD_SCHEMA,
|
|
102
|
+
DASHBOARD_RUN_CHECKBOX_FIELD_SCHEMA,
|
|
103
|
+
]), z.transform((field) => ({
|
|
104
|
+
...field,
|
|
105
|
+
label: field.label ??
|
|
106
|
+
`${sentenceCase(field.name)}${field.type === "checkbox" ? "?" : ""}`,
|
|
107
|
+
})));
|
|
108
|
+
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."));
|
|
109
|
+
export const DASHBOARD_RUN_CONFIG_SCHEMA = z.object({
|
|
110
|
+
description: z.optional(FIELD_DESCRIPTION_SCHEMA),
|
|
111
|
+
fields: z.prefault(DASHBOARD_RUN_FIELDS_SCHEMA, []),
|
|
112
|
+
submitLabel: z.prefault(z.string().check(z.trim(), z.minLength(1), z.maxLength(100)), "Run"),
|
|
113
|
+
title: z.string().check(z.trim(), z.minLength(1), z.maxLength(255)),
|
|
114
|
+
});
|
|
115
|
+
export const dashboardRunTriggerDefinition = {
|
|
116
|
+
getDetails: ({ config }) => [
|
|
117
|
+
{
|
|
118
|
+
label: "Run form",
|
|
119
|
+
value: DASHBOARD_RUN_CONFIG_SCHEMA.parse(config).title,
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
icon: "automation",
|
|
123
|
+
name: "Dashboard run",
|
|
124
|
+
type: "dashboard.run",
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Returns the organization-authenticated submission endpoint for one dashboard
|
|
128
|
+
* run.
|
|
129
|
+
*
|
|
130
|
+
* @param options - Public origin and trigger identity.
|
|
131
|
+
*/
|
|
132
|
+
export function getDashboardRunEndpoint(options) {
|
|
133
|
+
return new URL(`/api/dashboard-runs/${getDashboardRunEndpointKey(options)}`, options.appOrigin).toString();
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Returns the durable endpoint identity for one dashboard run trigger.
|
|
137
|
+
*
|
|
138
|
+
* @param options - Trigger and owning automation identity.
|
|
139
|
+
*/
|
|
140
|
+
export function getDashboardRunEndpointKey(options) {
|
|
141
|
+
return `${options.automationId}:${[
|
|
142
|
+
...(options.scopePath ?? []),
|
|
143
|
+
options.hookSlot,
|
|
144
|
+
].join(".")}`;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Checks a configured default against the same constraints as submitted data.
|
|
148
|
+
*
|
|
149
|
+
* @param field - Field definition to validate.
|
|
150
|
+
*/
|
|
151
|
+
function isDashboardRunFieldDefaultValid(field) {
|
|
152
|
+
if (field.type === "checkbox" || field.defaultValue === undefined)
|
|
153
|
+
return true;
|
|
154
|
+
if (field.type === "multi-select") {
|
|
155
|
+
if (field.required !== false && field.defaultValue.length === 0)
|
|
156
|
+
return false;
|
|
157
|
+
return field.defaultValue.every((value) => field.options.some((option) => option.value === value));
|
|
158
|
+
}
|
|
159
|
+
if (field.type === "radio" || field.type === "select") {
|
|
160
|
+
return field.options.some((option) => option.value === field.defaultValue);
|
|
161
|
+
}
|
|
162
|
+
if (field.type === "number") {
|
|
163
|
+
return ((field.min === undefined || field.defaultValue >= field.min) &&
|
|
164
|
+
(field.max === undefined || field.defaultValue <= field.max) &&
|
|
165
|
+
!isDashboardRunStepMismatch(field.defaultValue, field.min ?? field.defaultValue, field.step ?? 1));
|
|
166
|
+
}
|
|
167
|
+
if (field.type === "date" || field.type === "datetime") {
|
|
168
|
+
const defaultValue = parseDashboardRunDateValue(field.type, field.defaultValue);
|
|
169
|
+
return ((field.min === undefined ||
|
|
170
|
+
defaultValue >= parseDashboardRunDateValue(field.type, field.min)) &&
|
|
171
|
+
(field.max === undefined ||
|
|
172
|
+
defaultValue <= parseDashboardRunDateValue(field.type, field.max)) &&
|
|
173
|
+
!isDashboardRunStepMismatch(defaultValue, parseDashboardRunDateValue(field.type, field.min ?? field.defaultValue), (field.step ?? (field.type === "date" ? 1 : 60)) *
|
|
174
|
+
(field.type === "date" ? 86_400_000 : 1_000)));
|
|
175
|
+
}
|
|
176
|
+
const defaultValue = field.defaultValue.trim();
|
|
177
|
+
return ((defaultValue.length > 0 || field.required === false) &&
|
|
178
|
+
(field.minLength === undefined || defaultValue.length >= field.minLength) &&
|
|
179
|
+
(field.maxLength === undefined || defaultValue.length <= field.maxLength) &&
|
|
180
|
+
(field.type !== "email" || EMAIL_SCHEMA.safeParse(defaultValue).success) &&
|
|
181
|
+
(field.type !== "url" || URL_SCHEMA.safeParse(defaultValue).success));
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Checks whether a value falls outside an allowed step interval.
|
|
185
|
+
*
|
|
186
|
+
* @param value - Configured default value.
|
|
187
|
+
* @param base - Value from which step intervals begin.
|
|
188
|
+
* @param step - Allowed interval size.
|
|
189
|
+
*/
|
|
190
|
+
function isDashboardRunStepMismatch(value, base, step) {
|
|
191
|
+
const intervals = (value - base) / step;
|
|
192
|
+
return Math.abs(intervals - Math.round(intervals)) > 1e-9;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Converts a validated local date or date-time string to a UTC number.
|
|
196
|
+
*
|
|
197
|
+
* @param type - Temporal field type.
|
|
198
|
+
* @param value - Local ISO value to convert.
|
|
199
|
+
*/
|
|
200
|
+
function parseDashboardRunDateValue(type, value) {
|
|
201
|
+
return Date.parse(type === "date" ? `${value}T00:00:00Z` : `${value}Z`);
|
|
202
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const httpRequestTriggerDefinition: {
|
|
2
|
+
readonly getPrimary: ({ appOrigin, automationId, config, hookSlot, projectId, scopePath, }: import("..").TriggerPresentationContext) => {
|
|
3
|
+
copyable: true;
|
|
4
|
+
value: string;
|
|
5
|
+
};
|
|
6
|
+
readonly icon: "webhook";
|
|
7
|
+
readonly name: "HTTP request";
|
|
8
|
+
readonly type: "http.request";
|
|
9
|
+
};
|
|
10
|
+
export type HttpTriggerScope = "trigger" | "automation" | "project";
|
|
11
|
+
export interface HttpTriggerEndpointOptions {
|
|
12
|
+
appOrigin: string;
|
|
13
|
+
automationId: string;
|
|
14
|
+
hookSlot: number;
|
|
15
|
+
projectId: string;
|
|
16
|
+
scope: HttpTriggerScope;
|
|
17
|
+
scopePath?: readonly number[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns the public URL for one deployed HTTP trigger.
|
|
21
|
+
*
|
|
22
|
+
* @param options - Public origin and trigger identity.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getHttpTriggerEndpoint(options: HttpTriggerEndpointOptions): string;
|
|
25
|
+
/**
|
|
26
|
+
* Returns the durable endpoint identity for one configured HTTP scope.
|
|
27
|
+
*
|
|
28
|
+
* @param options - Trigger and owning resource identity.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getHttpTriggerEndpointKey(options: Omit<HttpTriggerEndpointOptions, "appOrigin">): string;
|