@trigger.dev/sdk 2.0.0-next.2 → 2.0.0-next.20
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 +201 -25
- package/dist/index.d.ts +1269 -888
- package/dist/index.js +400 -138
- package/dist/index.js.map +1 -1
- package/package.json +20 -19
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,30 @@
|
|
|
1
1
|
import * as zod from 'zod';
|
|
2
|
-
import { z } from 'zod';
|
|
2
|
+
import { z, ZodObject } from 'zod';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Represents different log levels.
|
|
6
|
+
* - `"log"`: Only essential messages.
|
|
7
|
+
* - `"error"`: Errors and essential messages.
|
|
8
|
+
* - `"warn"`: Warnings, Errors and essential messages.
|
|
9
|
+
* - `"info"`: Info, Warnings, Errors and essential messages.
|
|
10
|
+
* - `"debug"`: Everything.
|
|
11
|
+
*/
|
|
4
12
|
type LogLevel = "log" | "error" | "warn" | "info" | "debug";
|
|
5
13
|
declare class Logger {
|
|
6
14
|
#private;
|
|
7
15
|
constructor(name: string, level?: LogLevel, filteredKeys?: string[], jsonReplacer?: (key: string, value: unknown) => unknown);
|
|
8
16
|
filter(...keys: string[]): Logger;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
17
|
+
static satisfiesLogLevel(logLevel: LogLevel, setLevel: LogLevel): boolean;
|
|
18
|
+
log(message: string, ...args: Array<Record<string, unknown> | undefined>): void;
|
|
19
|
+
error(message: string, ...args: Array<Record<string, unknown> | undefined>): void;
|
|
20
|
+
warn(message: string, ...args: Array<Record<string, unknown> | undefined>): void;
|
|
21
|
+
info(message: string, ...args: Array<Record<string, unknown> | undefined>): void;
|
|
13
22
|
debug(message: string, ...args: Array<Record<string, unknown> | undefined>): void;
|
|
14
23
|
}
|
|
15
24
|
|
|
16
25
|
declare const EventMatcherSchema: z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodNumber, "many">, z.ZodArray<z.ZodBoolean, "many">]>;
|
|
17
26
|
type EventMatcher = z.infer<typeof EventMatcherSchema>;
|
|
27
|
+
/** A filter for matching against data */
|
|
18
28
|
type EventFilter = {
|
|
19
29
|
[key: string]: EventMatcher | EventFilter;
|
|
20
30
|
};
|
|
@@ -30,7 +40,7 @@ type SerializableJson = Serializable | {
|
|
|
30
40
|
[key: string]: SerializableJson;
|
|
31
41
|
} | SerializableJson[];
|
|
32
42
|
|
|
33
|
-
declare const ServerTaskSchema: z.ZodObject<
|
|
43
|
+
declare const ServerTaskSchema: z.ZodObject<{
|
|
34
44
|
id: z.ZodString;
|
|
35
45
|
name: z.ZodString;
|
|
36
46
|
icon: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -38,22 +48,35 @@ declare const ServerTaskSchema: z.ZodObject<z.extendShape<{
|
|
|
38
48
|
startedAt: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
39
49
|
completedAt: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
40
50
|
delayUntil: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
41
|
-
status: z.ZodEnum<["PENDING", "WAITING", "RUNNING", "COMPLETED", "ERRORED"]>;
|
|
51
|
+
status: z.ZodEnum<["PENDING", "WAITING", "RUNNING", "COMPLETED", "ERRORED", "CANCELED"]>;
|
|
42
52
|
description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
53
|
+
params: z.ZodNullable<z.ZodOptional<z.ZodType<DeserializedJson, z.ZodTypeDef, DeserializedJson>>>;
|
|
43
54
|
properties: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
44
55
|
label: z.ZodString;
|
|
45
56
|
text: z.ZodString;
|
|
46
57
|
url: z.ZodOptional<z.ZodString>;
|
|
47
58
|
}, "strip", z.ZodTypeAny, {
|
|
48
|
-
url?: string | undefined;
|
|
49
59
|
label: string;
|
|
50
60
|
text: string;
|
|
61
|
+
url?: string | undefined;
|
|
51
62
|
}, {
|
|
63
|
+
label: string;
|
|
64
|
+
text: string;
|
|
65
|
+
url?: string | undefined;
|
|
66
|
+
}>, "many">>>;
|
|
67
|
+
outputProperties: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
68
|
+
label: z.ZodString;
|
|
69
|
+
text: z.ZodString;
|
|
70
|
+
url: z.ZodOptional<z.ZodString>;
|
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
|
72
|
+
label: string;
|
|
73
|
+
text: string;
|
|
52
74
|
url?: string | undefined;
|
|
75
|
+
}, {
|
|
53
76
|
label: string;
|
|
54
77
|
text: string;
|
|
78
|
+
url?: string | undefined;
|
|
55
79
|
}>, "many">>>;
|
|
56
|
-
params: z.ZodNullable<z.ZodOptional<z.ZodType<DeserializedJson, z.ZodTypeDef, DeserializedJson>>>;
|
|
57
80
|
output: z.ZodNullable<z.ZodOptional<z.ZodType<DeserializedJson, z.ZodTypeDef, DeserializedJson>>>;
|
|
58
81
|
error: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
59
82
|
parentId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -61,17 +84,22 @@ declare const ServerTaskSchema: z.ZodObject<z.extendShape<{
|
|
|
61
84
|
style: z.ZodEnum<["normal", "minimal"]>;
|
|
62
85
|
variant: z.ZodOptional<z.ZodString>;
|
|
63
86
|
}, "strip", z.ZodTypeAny, {
|
|
64
|
-
variant?: string | undefined;
|
|
65
87
|
style: "normal" | "minimal";
|
|
66
|
-
}, {
|
|
67
88
|
variant?: string | undefined;
|
|
89
|
+
}, {
|
|
68
90
|
style: "normal" | "minimal";
|
|
91
|
+
variant?: string | undefined;
|
|
69
92
|
}>>>;
|
|
70
93
|
operation: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
71
|
-
}, {
|
|
72
94
|
idempotencyKey: z.ZodString;
|
|
73
95
|
attempts: z.ZodNumber;
|
|
74
|
-
}
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
id: string;
|
|
98
|
+
name: string;
|
|
99
|
+
noop: boolean;
|
|
100
|
+
status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
|
|
101
|
+
idempotencyKey: string;
|
|
102
|
+
attempts: number;
|
|
75
103
|
icon?: string | null | undefined;
|
|
76
104
|
startedAt?: Date | null | undefined;
|
|
77
105
|
completedAt?: Date | null | undefined;
|
|
@@ -79,25 +107,30 @@ declare const ServerTaskSchema: z.ZodObject<z.extendShape<{
|
|
|
79
107
|
description?: string | null | undefined;
|
|
80
108
|
params?: DeserializedJson | undefined;
|
|
81
109
|
properties?: {
|
|
110
|
+
label: string;
|
|
111
|
+
text: string;
|
|
82
112
|
url?: string | undefined;
|
|
113
|
+
}[] | null | undefined;
|
|
114
|
+
outputProperties?: {
|
|
83
115
|
label: string;
|
|
84
116
|
text: string;
|
|
117
|
+
url?: string | undefined;
|
|
85
118
|
}[] | null | undefined;
|
|
86
119
|
output?: DeserializedJson | undefined;
|
|
87
120
|
error?: string | null | undefined;
|
|
88
121
|
parentId?: string | null | undefined;
|
|
89
122
|
style?: {
|
|
90
|
-
variant?: string | undefined;
|
|
91
123
|
style: "normal" | "minimal";
|
|
124
|
+
variant?: string | undefined;
|
|
92
125
|
} | null | undefined;
|
|
93
126
|
operation?: string | null | undefined;
|
|
127
|
+
}, {
|
|
94
128
|
id: string;
|
|
95
129
|
name: string;
|
|
96
130
|
noop: boolean;
|
|
97
|
-
status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED";
|
|
131
|
+
status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
|
|
98
132
|
idempotencyKey: string;
|
|
99
133
|
attempts: number;
|
|
100
|
-
}, {
|
|
101
134
|
icon?: string | null | undefined;
|
|
102
135
|
startedAt?: Date | null | undefined;
|
|
103
136
|
completedAt?: Date | null | undefined;
|
|
@@ -105,64 +138,68 @@ declare const ServerTaskSchema: z.ZodObject<z.extendShape<{
|
|
|
105
138
|
description?: string | null | undefined;
|
|
106
139
|
params?: DeserializedJson | undefined;
|
|
107
140
|
properties?: {
|
|
141
|
+
label: string;
|
|
142
|
+
text: string;
|
|
108
143
|
url?: string | undefined;
|
|
144
|
+
}[] | null | undefined;
|
|
145
|
+
outputProperties?: {
|
|
109
146
|
label: string;
|
|
110
147
|
text: string;
|
|
148
|
+
url?: string | undefined;
|
|
111
149
|
}[] | null | undefined;
|
|
112
150
|
output?: DeserializedJson | undefined;
|
|
113
151
|
error?: string | null | undefined;
|
|
114
152
|
parentId?: string | null | undefined;
|
|
115
153
|
style?: {
|
|
116
|
-
variant?: string | undefined;
|
|
117
154
|
style: "normal" | "minimal";
|
|
155
|
+
variant?: string | undefined;
|
|
118
156
|
} | null | undefined;
|
|
119
157
|
operation?: string | null | undefined;
|
|
120
|
-
id: string;
|
|
121
|
-
name: string;
|
|
122
|
-
noop: boolean;
|
|
123
|
-
status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED";
|
|
124
|
-
idempotencyKey: string;
|
|
125
|
-
attempts: number;
|
|
126
158
|
}>;
|
|
127
159
|
type ServerTask = z.infer<typeof ServerTaskSchema>;
|
|
128
160
|
declare const CachedTaskSchema: z.ZodObject<{
|
|
129
161
|
id: z.ZodString;
|
|
130
162
|
idempotencyKey: z.ZodString;
|
|
131
|
-
status: z.ZodEnum<["PENDING", "WAITING", "RUNNING", "COMPLETED", "ERRORED"]>;
|
|
163
|
+
status: z.ZodEnum<["PENDING", "WAITING", "RUNNING", "COMPLETED", "ERRORED", "CANCELED"]>;
|
|
132
164
|
noop: z.ZodDefault<z.ZodBoolean>;
|
|
133
165
|
output: z.ZodNullable<z.ZodOptional<z.ZodType<DeserializedJson, z.ZodTypeDef, DeserializedJson>>>;
|
|
134
166
|
parentId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
135
167
|
}, "strip", z.ZodTypeAny, {
|
|
136
|
-
output?: DeserializedJson | undefined;
|
|
137
|
-
parentId?: string | null | undefined;
|
|
138
168
|
id: string;
|
|
139
169
|
noop: boolean;
|
|
140
|
-
status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED";
|
|
170
|
+
status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
|
|
141
171
|
idempotencyKey: string;
|
|
142
|
-
}, {
|
|
143
|
-
noop?: boolean | undefined;
|
|
144
172
|
output?: DeserializedJson | undefined;
|
|
145
173
|
parentId?: string | null | undefined;
|
|
174
|
+
}, {
|
|
146
175
|
id: string;
|
|
147
|
-
status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED";
|
|
176
|
+
status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
|
|
148
177
|
idempotencyKey: string;
|
|
178
|
+
noop?: boolean | undefined;
|
|
179
|
+
output?: DeserializedJson | undefined;
|
|
180
|
+
parentId?: string | null | undefined;
|
|
149
181
|
}>;
|
|
150
182
|
|
|
183
|
+
type Prettify<T> = {
|
|
184
|
+
[K in keyof T]: T[K];
|
|
185
|
+
} & {};
|
|
186
|
+
|
|
151
187
|
declare const UpdateTriggerSourceBodySchema: z.ZodObject<{
|
|
152
188
|
registeredEvents: z.ZodArray<z.ZodString, "many">;
|
|
153
189
|
secret: z.ZodOptional<z.ZodString>;
|
|
154
190
|
data: z.ZodOptional<z.ZodType<SerializableJson, z.ZodTypeDef, SerializableJson>>;
|
|
155
191
|
}, "strip", z.ZodTypeAny, {
|
|
156
|
-
data?: SerializableJson;
|
|
157
|
-
secret?: string | undefined;
|
|
158
192
|
registeredEvents: string[];
|
|
159
|
-
}, {
|
|
160
|
-
data?: SerializableJson;
|
|
161
193
|
secret?: string | undefined;
|
|
194
|
+
data?: SerializableJson;
|
|
195
|
+
}, {
|
|
162
196
|
registeredEvents: string[];
|
|
197
|
+
secret?: string | undefined;
|
|
198
|
+
data?: SerializableJson;
|
|
163
199
|
}>;
|
|
164
200
|
type UpdateTriggerSourceBody = z.infer<typeof UpdateTriggerSourceBodySchema>;
|
|
165
201
|
declare const RegisterSourceEventSchema: z.ZodObject<{
|
|
202
|
+
/** The id of the source */
|
|
166
203
|
id: z.ZodString;
|
|
167
204
|
source: z.ZodObject<{
|
|
168
205
|
key: z.ZodString;
|
|
@@ -194,9 +231,6 @@ declare const RegisterSourceEventSchema: z.ZodObject<{
|
|
|
194
231
|
}>]>;
|
|
195
232
|
clientId: z.ZodOptional<z.ZodString>;
|
|
196
233
|
}, "strip", z.ZodTypeAny, {
|
|
197
|
-
params?: any;
|
|
198
|
-
data?: DeserializedJson | undefined;
|
|
199
|
-
clientId?: string | undefined;
|
|
200
234
|
key: string;
|
|
201
235
|
secret: string;
|
|
202
236
|
active: boolean;
|
|
@@ -208,10 +242,10 @@ declare const RegisterSourceEventSchema: z.ZodObject<{
|
|
|
208
242
|
} | {
|
|
209
243
|
type: "SQS";
|
|
210
244
|
};
|
|
211
|
-
}, {
|
|
212
245
|
params?: any;
|
|
213
246
|
data?: DeserializedJson | undefined;
|
|
214
247
|
clientId?: string | undefined;
|
|
248
|
+
}, {
|
|
215
249
|
key: string;
|
|
216
250
|
secret: string;
|
|
217
251
|
active: boolean;
|
|
@@ -223,18 +257,17 @@ declare const RegisterSourceEventSchema: z.ZodObject<{
|
|
|
223
257
|
} | {
|
|
224
258
|
type: "SQS";
|
|
225
259
|
};
|
|
260
|
+
params?: any;
|
|
261
|
+
data?: DeserializedJson | undefined;
|
|
262
|
+
clientId?: string | undefined;
|
|
226
263
|
}>;
|
|
227
264
|
events: z.ZodArray<z.ZodString, "many">;
|
|
228
265
|
missingEvents: z.ZodArray<z.ZodString, "many">;
|
|
229
266
|
orphanedEvents: z.ZodArray<z.ZodString, "many">;
|
|
230
267
|
dynamicTriggerId: z.ZodOptional<z.ZodString>;
|
|
231
268
|
}, "strip", z.ZodTypeAny, {
|
|
232
|
-
dynamicTriggerId?: string | undefined;
|
|
233
269
|
id: string;
|
|
234
270
|
source: {
|
|
235
|
-
params?: any;
|
|
236
|
-
data?: DeserializedJson | undefined;
|
|
237
|
-
clientId?: string | undefined;
|
|
238
271
|
key: string;
|
|
239
272
|
secret: string;
|
|
240
273
|
active: boolean;
|
|
@@ -246,17 +279,17 @@ declare const RegisterSourceEventSchema: z.ZodObject<{
|
|
|
246
279
|
} | {
|
|
247
280
|
type: "SQS";
|
|
248
281
|
};
|
|
282
|
+
params?: any;
|
|
283
|
+
data?: DeserializedJson | undefined;
|
|
284
|
+
clientId?: string | undefined;
|
|
249
285
|
};
|
|
250
286
|
events: string[];
|
|
251
287
|
missingEvents: string[];
|
|
252
288
|
orphanedEvents: string[];
|
|
253
|
-
}, {
|
|
254
289
|
dynamicTriggerId?: string | undefined;
|
|
290
|
+
}, {
|
|
255
291
|
id: string;
|
|
256
292
|
source: {
|
|
257
|
-
params?: any;
|
|
258
|
-
data?: DeserializedJson | undefined;
|
|
259
|
-
clientId?: string | undefined;
|
|
260
293
|
key: string;
|
|
261
294
|
secret: string;
|
|
262
295
|
active: boolean;
|
|
@@ -268,10 +301,14 @@ declare const RegisterSourceEventSchema: z.ZodObject<{
|
|
|
268
301
|
} | {
|
|
269
302
|
type: "SQS";
|
|
270
303
|
};
|
|
304
|
+
params?: any;
|
|
305
|
+
data?: DeserializedJson | undefined;
|
|
306
|
+
clientId?: string | undefined;
|
|
271
307
|
};
|
|
272
308
|
events: string[];
|
|
273
309
|
missingEvents: string[];
|
|
274
310
|
orphanedEvents: string[];
|
|
311
|
+
dynamicTriggerId?: string | undefined;
|
|
275
312
|
}>;
|
|
276
313
|
type RegisterSourceEvent = z.infer<typeof RegisterSourceEventSchema>;
|
|
277
314
|
declare const TriggerSourceSchema: z.ZodObject<{
|
|
@@ -290,15 +327,15 @@ declare const HandleTriggerSourceSchema: z.ZodObject<{
|
|
|
290
327
|
data: z.ZodAny;
|
|
291
328
|
params: z.ZodAny;
|
|
292
329
|
}, "strip", z.ZodTypeAny, {
|
|
293
|
-
params?: any;
|
|
294
|
-
data?: any;
|
|
295
330
|
key: string;
|
|
296
331
|
secret: string;
|
|
297
|
-
}, {
|
|
298
|
-
params?: any;
|
|
299
332
|
data?: any;
|
|
333
|
+
params?: any;
|
|
334
|
+
}, {
|
|
300
335
|
key: string;
|
|
301
336
|
secret: string;
|
|
337
|
+
data?: any;
|
|
338
|
+
params?: any;
|
|
302
339
|
}>;
|
|
303
340
|
type HandleTriggerSource = z.infer<typeof HandleTriggerSourceSchema>;
|
|
304
341
|
type TriggerSource = z.infer<typeof TriggerSourceSchema>;
|
|
@@ -306,11 +343,11 @@ declare const QueueOptionsSchema: z.ZodObject<{
|
|
|
306
343
|
name: z.ZodString;
|
|
307
344
|
maxConcurrent: z.ZodOptional<z.ZodNumber>;
|
|
308
345
|
}, "strip", z.ZodTypeAny, {
|
|
309
|
-
maxConcurrent?: number | undefined;
|
|
310
346
|
name: string;
|
|
311
|
-
}, {
|
|
312
347
|
maxConcurrent?: number | undefined;
|
|
348
|
+
}, {
|
|
313
349
|
name: string;
|
|
350
|
+
maxConcurrent?: number | undefined;
|
|
314
351
|
}>;
|
|
315
352
|
type QueueOptions = z.infer<typeof QueueOptionsSchema>;
|
|
316
353
|
declare const JobMetadataSchema: z.ZodObject<{
|
|
@@ -328,13 +365,13 @@ declare const JobMetadataSchema: z.ZodObject<{
|
|
|
328
365
|
text: z.ZodString;
|
|
329
366
|
url: z.ZodOptional<z.ZodString>;
|
|
330
367
|
}, "strip", z.ZodTypeAny, {
|
|
331
|
-
url?: string | undefined;
|
|
332
368
|
label: string;
|
|
333
369
|
text: string;
|
|
334
|
-
}, {
|
|
335
370
|
url?: string | undefined;
|
|
371
|
+
}, {
|
|
336
372
|
label: string;
|
|
337
373
|
text: string;
|
|
374
|
+
url?: string | undefined;
|
|
338
375
|
}>, "many">>;
|
|
339
376
|
schema: z.ZodOptional<z.ZodAny>;
|
|
340
377
|
examples: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -343,52 +380,52 @@ declare const JobMetadataSchema: z.ZodObject<{
|
|
|
343
380
|
name: z.ZodString;
|
|
344
381
|
payload: z.ZodAny;
|
|
345
382
|
}, "strip", z.ZodTypeAny, {
|
|
346
|
-
icon?: string | undefined;
|
|
347
|
-
payload?: any;
|
|
348
383
|
id: string;
|
|
349
384
|
name: string;
|
|
350
|
-
}, {
|
|
351
385
|
icon?: string | undefined;
|
|
352
386
|
payload?: any;
|
|
387
|
+
}, {
|
|
353
388
|
id: string;
|
|
354
389
|
name: string;
|
|
390
|
+
icon?: string | undefined;
|
|
391
|
+
payload?: any;
|
|
355
392
|
}>, "many">>;
|
|
356
393
|
}, "strip", z.ZodTypeAny, {
|
|
394
|
+
name: string;
|
|
395
|
+
icon: string;
|
|
396
|
+
source: string;
|
|
397
|
+
title: string;
|
|
357
398
|
filter?: EventFilter | undefined;
|
|
358
399
|
properties?: {
|
|
359
|
-
url?: string | undefined;
|
|
360
400
|
label: string;
|
|
361
401
|
text: string;
|
|
402
|
+
url?: string | undefined;
|
|
362
403
|
}[] | undefined;
|
|
363
404
|
schema?: any;
|
|
364
405
|
examples?: {
|
|
365
|
-
icon?: string | undefined;
|
|
366
|
-
payload?: any;
|
|
367
406
|
id: string;
|
|
368
407
|
name: string;
|
|
408
|
+
icon?: string | undefined;
|
|
409
|
+
payload?: any;
|
|
369
410
|
}[] | undefined;
|
|
411
|
+
}, {
|
|
370
412
|
name: string;
|
|
371
413
|
icon: string;
|
|
372
414
|
source: string;
|
|
373
415
|
title: string;
|
|
374
|
-
}, {
|
|
375
416
|
filter?: EventFilter | undefined;
|
|
376
417
|
properties?: {
|
|
377
|
-
url?: string | undefined;
|
|
378
418
|
label: string;
|
|
379
419
|
text: string;
|
|
420
|
+
url?: string | undefined;
|
|
380
421
|
}[] | undefined;
|
|
381
422
|
schema?: any;
|
|
382
423
|
examples?: {
|
|
383
|
-
icon?: string | undefined;
|
|
384
|
-
payload?: any;
|
|
385
424
|
id: string;
|
|
386
425
|
name: string;
|
|
426
|
+
icon?: string | undefined;
|
|
427
|
+
payload?: any;
|
|
387
428
|
}[] | undefined;
|
|
388
|
-
name: string;
|
|
389
|
-
icon: string;
|
|
390
|
-
source: string;
|
|
391
|
-
title: string;
|
|
392
429
|
}>;
|
|
393
430
|
trigger: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
394
431
|
type: z.ZodLiteral<"dynamic">;
|
|
@@ -407,13 +444,13 @@ declare const JobMetadataSchema: z.ZodObject<{
|
|
|
407
444
|
text: z.ZodString;
|
|
408
445
|
url: z.ZodOptional<z.ZodString>;
|
|
409
446
|
}, "strip", z.ZodTypeAny, {
|
|
410
|
-
url?: string | undefined;
|
|
411
447
|
label: string;
|
|
412
448
|
text: string;
|
|
413
|
-
}, {
|
|
414
449
|
url?: string | undefined;
|
|
450
|
+
}, {
|
|
415
451
|
label: string;
|
|
416
452
|
text: string;
|
|
453
|
+
url?: string | undefined;
|
|
417
454
|
}>, "many">>;
|
|
418
455
|
rule: z.ZodObject<{
|
|
419
456
|
event: z.ZodString;
|
|
@@ -421,44 +458,44 @@ declare const JobMetadataSchema: z.ZodObject<{
|
|
|
421
458
|
payload: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
|
|
422
459
|
context: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
|
|
423
460
|
}, "strip", z.ZodTypeAny, {
|
|
424
|
-
payload?: EventFilter | undefined;
|
|
425
|
-
context?: EventFilter | undefined;
|
|
426
461
|
event: string;
|
|
427
462
|
source: string;
|
|
428
|
-
}, {
|
|
429
463
|
payload?: EventFilter | undefined;
|
|
430
464
|
context?: EventFilter | undefined;
|
|
465
|
+
}, {
|
|
431
466
|
event: string;
|
|
432
467
|
source: string;
|
|
468
|
+
payload?: EventFilter | undefined;
|
|
469
|
+
context?: EventFilter | undefined;
|
|
433
470
|
}>;
|
|
434
471
|
}, "strip", z.ZodTypeAny, {
|
|
435
|
-
properties?: {
|
|
436
|
-
url?: string | undefined;
|
|
437
|
-
label: string;
|
|
438
|
-
text: string;
|
|
439
|
-
}[] | undefined;
|
|
440
472
|
type: "static";
|
|
441
473
|
title: string;
|
|
442
474
|
rule: {
|
|
443
|
-
payload?: EventFilter | undefined;
|
|
444
|
-
context?: EventFilter | undefined;
|
|
445
475
|
event: string;
|
|
446
476
|
source: string;
|
|
477
|
+
payload?: EventFilter | undefined;
|
|
478
|
+
context?: EventFilter | undefined;
|
|
447
479
|
};
|
|
448
|
-
}, {
|
|
449
480
|
properties?: {
|
|
450
|
-
url?: string | undefined;
|
|
451
481
|
label: string;
|
|
452
482
|
text: string;
|
|
483
|
+
url?: string | undefined;
|
|
453
484
|
}[] | undefined;
|
|
485
|
+
}, {
|
|
454
486
|
type: "static";
|
|
455
487
|
title: string;
|
|
456
488
|
rule: {
|
|
457
|
-
payload?: EventFilter | undefined;
|
|
458
|
-
context?: EventFilter | undefined;
|
|
459
489
|
event: string;
|
|
460
490
|
source: string;
|
|
491
|
+
payload?: EventFilter | undefined;
|
|
492
|
+
context?: EventFilter | undefined;
|
|
461
493
|
};
|
|
494
|
+
properties?: {
|
|
495
|
+
label: string;
|
|
496
|
+
text: string;
|
|
497
|
+
url?: string | undefined;
|
|
498
|
+
}[] | undefined;
|
|
462
499
|
}>, z.ZodObject<{
|
|
463
500
|
type: z.ZodLiteral<"scheduled">;
|
|
464
501
|
schedule: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
@@ -472,17 +509,17 @@ declare const JobMetadataSchema: z.ZodObject<{
|
|
|
472
509
|
}>;
|
|
473
510
|
metadata: z.ZodAny;
|
|
474
511
|
}, "strip", z.ZodTypeAny, {
|
|
475
|
-
metadata?: any;
|
|
476
512
|
options: {
|
|
477
513
|
seconds: number;
|
|
478
514
|
};
|
|
479
515
|
type: "interval";
|
|
480
|
-
}, {
|
|
481
516
|
metadata?: any;
|
|
517
|
+
}, {
|
|
482
518
|
options: {
|
|
483
519
|
seconds: number;
|
|
484
520
|
};
|
|
485
521
|
type: "interval";
|
|
522
|
+
metadata?: any;
|
|
486
523
|
}>, z.ZodObject<{
|
|
487
524
|
type: z.ZodLiteral<"cron">;
|
|
488
525
|
options: z.ZodObject<{
|
|
@@ -494,47 +531,47 @@ declare const JobMetadataSchema: z.ZodObject<{
|
|
|
494
531
|
}>;
|
|
495
532
|
metadata: z.ZodAny;
|
|
496
533
|
}, "strip", z.ZodTypeAny, {
|
|
497
|
-
metadata?: any;
|
|
498
534
|
options: {
|
|
499
535
|
cron: string;
|
|
500
536
|
};
|
|
501
537
|
type: "cron";
|
|
502
|
-
}, {
|
|
503
538
|
metadata?: any;
|
|
539
|
+
}, {
|
|
504
540
|
options: {
|
|
505
541
|
cron: string;
|
|
506
542
|
};
|
|
507
543
|
type: "cron";
|
|
544
|
+
metadata?: any;
|
|
508
545
|
}>]>;
|
|
509
546
|
}, "strip", z.ZodTypeAny, {
|
|
510
547
|
type: "scheduled";
|
|
511
548
|
schedule: {
|
|
512
|
-
metadata?: any;
|
|
513
549
|
options: {
|
|
514
550
|
cron: string;
|
|
515
551
|
};
|
|
516
552
|
type: "cron";
|
|
517
|
-
} | {
|
|
518
553
|
metadata?: any;
|
|
554
|
+
} | {
|
|
519
555
|
options: {
|
|
520
556
|
seconds: number;
|
|
521
557
|
};
|
|
522
558
|
type: "interval";
|
|
559
|
+
metadata?: any;
|
|
523
560
|
};
|
|
524
561
|
}, {
|
|
525
562
|
type: "scheduled";
|
|
526
563
|
schedule: {
|
|
527
|
-
metadata?: any;
|
|
528
564
|
options: {
|
|
529
565
|
cron: string;
|
|
530
566
|
};
|
|
531
567
|
type: "cron";
|
|
532
|
-
} | {
|
|
533
568
|
metadata?: any;
|
|
569
|
+
} | {
|
|
534
570
|
options: {
|
|
535
571
|
seconds: number;
|
|
536
572
|
};
|
|
537
573
|
type: "interval";
|
|
574
|
+
metadata?: any;
|
|
538
575
|
};
|
|
539
576
|
}>]>;
|
|
540
577
|
integrations: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -544,29 +581,29 @@ declare const JobMetadataSchema: z.ZodObject<{
|
|
|
544
581
|
name: z.ZodString;
|
|
545
582
|
instructions: z.ZodOptional<z.ZodString>;
|
|
546
583
|
}, "strip", z.ZodTypeAny, {
|
|
547
|
-
instructions?: string | undefined;
|
|
548
584
|
id: string;
|
|
549
585
|
name: string;
|
|
550
|
-
}, {
|
|
551
586
|
instructions?: string | undefined;
|
|
587
|
+
}, {
|
|
552
588
|
id: string;
|
|
553
589
|
name: string;
|
|
590
|
+
instructions?: string | undefined;
|
|
554
591
|
}>;
|
|
555
592
|
authSource: z.ZodEnum<["HOSTED", "LOCAL"]>;
|
|
556
593
|
}, "strip", z.ZodTypeAny, {
|
|
557
594
|
id: string;
|
|
558
595
|
metadata: {
|
|
559
|
-
instructions?: string | undefined;
|
|
560
596
|
id: string;
|
|
561
597
|
name: string;
|
|
598
|
+
instructions?: string | undefined;
|
|
562
599
|
};
|
|
563
600
|
authSource: "HOSTED" | "LOCAL";
|
|
564
601
|
}, {
|
|
565
602
|
id: string;
|
|
566
603
|
metadata: {
|
|
567
|
-
instructions?: string | undefined;
|
|
568
604
|
id: string;
|
|
569
605
|
name: string;
|
|
606
|
+
instructions?: string | undefined;
|
|
570
607
|
};
|
|
571
608
|
authSource: "HOSTED" | "LOCAL";
|
|
572
609
|
}>>;
|
|
@@ -575,81 +612,77 @@ declare const JobMetadataSchema: z.ZodObject<{
|
|
|
575
612
|
name: z.ZodString;
|
|
576
613
|
maxConcurrent: z.ZodOptional<z.ZodNumber>;
|
|
577
614
|
}, "strip", z.ZodTypeAny, {
|
|
578
|
-
maxConcurrent?: number | undefined;
|
|
579
615
|
name: string;
|
|
580
|
-
}, {
|
|
581
616
|
maxConcurrent?: number | undefined;
|
|
617
|
+
}, {
|
|
582
618
|
name: string;
|
|
619
|
+
maxConcurrent?: number | undefined;
|
|
583
620
|
}>, z.ZodString]>>;
|
|
584
621
|
startPosition: z.ZodEnum<["initial", "latest"]>;
|
|
585
622
|
enabled: z.ZodBoolean;
|
|
586
623
|
preprocessRuns: z.ZodBoolean;
|
|
587
624
|
}, "strip", z.ZodTypeAny, {
|
|
588
|
-
queue?: string | {
|
|
589
|
-
maxConcurrent?: number | undefined;
|
|
590
|
-
name: string;
|
|
591
|
-
} | undefined;
|
|
592
625
|
id: string;
|
|
593
626
|
name: string;
|
|
594
627
|
event: {
|
|
628
|
+
name: string;
|
|
629
|
+
icon: string;
|
|
630
|
+
source: string;
|
|
631
|
+
title: string;
|
|
595
632
|
filter?: EventFilter | undefined;
|
|
596
633
|
properties?: {
|
|
597
|
-
url?: string | undefined;
|
|
598
634
|
label: string;
|
|
599
635
|
text: string;
|
|
636
|
+
url?: string | undefined;
|
|
600
637
|
}[] | undefined;
|
|
601
638
|
schema?: any;
|
|
602
639
|
examples?: {
|
|
603
|
-
icon?: string | undefined;
|
|
604
|
-
payload?: any;
|
|
605
640
|
id: string;
|
|
606
641
|
name: string;
|
|
642
|
+
icon?: string | undefined;
|
|
643
|
+
payload?: any;
|
|
607
644
|
}[] | undefined;
|
|
608
|
-
name: string;
|
|
609
|
-
icon: string;
|
|
610
|
-
source: string;
|
|
611
|
-
title: string;
|
|
612
645
|
};
|
|
613
646
|
version: string;
|
|
614
647
|
trigger: {
|
|
615
648
|
id: string;
|
|
616
649
|
type: "dynamic";
|
|
617
650
|
} | {
|
|
618
|
-
properties?: {
|
|
619
|
-
url?: string | undefined;
|
|
620
|
-
label: string;
|
|
621
|
-
text: string;
|
|
622
|
-
}[] | undefined;
|
|
623
651
|
type: "static";
|
|
624
652
|
title: string;
|
|
625
653
|
rule: {
|
|
626
|
-
payload?: EventFilter | undefined;
|
|
627
|
-
context?: EventFilter | undefined;
|
|
628
654
|
event: string;
|
|
629
655
|
source: string;
|
|
656
|
+
payload?: EventFilter | undefined;
|
|
657
|
+
context?: EventFilter | undefined;
|
|
630
658
|
};
|
|
659
|
+
properties?: {
|
|
660
|
+
label: string;
|
|
661
|
+
text: string;
|
|
662
|
+
url?: string | undefined;
|
|
663
|
+
}[] | undefined;
|
|
631
664
|
} | {
|
|
632
665
|
type: "scheduled";
|
|
633
666
|
schedule: {
|
|
634
|
-
metadata?: any;
|
|
635
667
|
options: {
|
|
636
668
|
cron: string;
|
|
637
669
|
};
|
|
638
670
|
type: "cron";
|
|
639
|
-
} | {
|
|
640
671
|
metadata?: any;
|
|
672
|
+
} | {
|
|
641
673
|
options: {
|
|
642
674
|
seconds: number;
|
|
643
675
|
};
|
|
644
676
|
type: "interval";
|
|
677
|
+
metadata?: any;
|
|
645
678
|
};
|
|
646
679
|
};
|
|
647
680
|
integrations: Record<string, {
|
|
648
681
|
id: string;
|
|
649
682
|
metadata: {
|
|
650
|
-
instructions?: string | undefined;
|
|
651
683
|
id: string;
|
|
652
684
|
name: string;
|
|
685
|
+
instructions?: string | undefined;
|
|
653
686
|
};
|
|
654
687
|
authSource: "HOSTED" | "LOCAL";
|
|
655
688
|
}>;
|
|
@@ -657,114 +690,192 @@ declare const JobMetadataSchema: z.ZodObject<{
|
|
|
657
690
|
startPosition: "initial" | "latest";
|
|
658
691
|
enabled: boolean;
|
|
659
692
|
preprocessRuns: boolean;
|
|
660
|
-
}, {
|
|
661
|
-
internal?: boolean | undefined;
|
|
662
693
|
queue?: string | {
|
|
663
|
-
maxConcurrent?: number | undefined;
|
|
664
694
|
name: string;
|
|
695
|
+
maxConcurrent?: number | undefined;
|
|
665
696
|
} | undefined;
|
|
697
|
+
}, {
|
|
666
698
|
id: string;
|
|
667
699
|
name: string;
|
|
668
700
|
event: {
|
|
701
|
+
name: string;
|
|
702
|
+
icon: string;
|
|
703
|
+
source: string;
|
|
704
|
+
title: string;
|
|
669
705
|
filter?: EventFilter | undefined;
|
|
670
706
|
properties?: {
|
|
671
|
-
url?: string | undefined;
|
|
672
707
|
label: string;
|
|
673
708
|
text: string;
|
|
709
|
+
url?: string | undefined;
|
|
674
710
|
}[] | undefined;
|
|
675
711
|
schema?: any;
|
|
676
712
|
examples?: {
|
|
677
|
-
icon?: string | undefined;
|
|
678
|
-
payload?: any;
|
|
679
713
|
id: string;
|
|
680
714
|
name: string;
|
|
715
|
+
icon?: string | undefined;
|
|
716
|
+
payload?: any;
|
|
681
717
|
}[] | undefined;
|
|
682
|
-
name: string;
|
|
683
|
-
icon: string;
|
|
684
|
-
source: string;
|
|
685
|
-
title: string;
|
|
686
718
|
};
|
|
687
719
|
version: string;
|
|
688
720
|
trigger: {
|
|
689
721
|
id: string;
|
|
690
722
|
type: "dynamic";
|
|
691
723
|
} | {
|
|
692
|
-
properties?: {
|
|
693
|
-
url?: string | undefined;
|
|
694
|
-
label: string;
|
|
695
|
-
text: string;
|
|
696
|
-
}[] | undefined;
|
|
697
724
|
type: "static";
|
|
698
725
|
title: string;
|
|
699
726
|
rule: {
|
|
700
|
-
payload?: EventFilter | undefined;
|
|
701
|
-
context?: EventFilter | undefined;
|
|
702
727
|
event: string;
|
|
703
728
|
source: string;
|
|
704
|
-
|
|
729
|
+
payload?: EventFilter | undefined;
|
|
730
|
+
context?: EventFilter | undefined;
|
|
731
|
+
};
|
|
732
|
+
properties?: {
|
|
733
|
+
label: string;
|
|
734
|
+
text: string;
|
|
735
|
+
url?: string | undefined;
|
|
736
|
+
}[] | undefined;
|
|
705
737
|
} | {
|
|
706
738
|
type: "scheduled";
|
|
707
739
|
schedule: {
|
|
708
|
-
metadata?: any;
|
|
709
740
|
options: {
|
|
710
741
|
cron: string;
|
|
711
742
|
};
|
|
712
743
|
type: "cron";
|
|
713
|
-
} | {
|
|
714
744
|
metadata?: any;
|
|
745
|
+
} | {
|
|
715
746
|
options: {
|
|
716
747
|
seconds: number;
|
|
717
748
|
};
|
|
718
749
|
type: "interval";
|
|
750
|
+
metadata?: any;
|
|
719
751
|
};
|
|
720
752
|
};
|
|
721
753
|
integrations: Record<string, {
|
|
722
754
|
id: string;
|
|
723
755
|
metadata: {
|
|
724
|
-
instructions?: string | undefined;
|
|
725
756
|
id: string;
|
|
726
757
|
name: string;
|
|
758
|
+
instructions?: string | undefined;
|
|
727
759
|
};
|
|
728
760
|
authSource: "HOSTED" | "LOCAL";
|
|
729
761
|
}>;
|
|
730
762
|
startPosition: "initial" | "latest";
|
|
731
763
|
enabled: boolean;
|
|
732
764
|
preprocessRuns: boolean;
|
|
765
|
+
internal?: boolean | undefined;
|
|
766
|
+
queue?: string | {
|
|
767
|
+
name: string;
|
|
768
|
+
maxConcurrent?: number | undefined;
|
|
769
|
+
} | undefined;
|
|
733
770
|
}>;
|
|
734
771
|
type JobMetadata = z.infer<typeof JobMetadataSchema>;
|
|
735
772
|
declare const RawEventSchema: z.ZodObject<{
|
|
736
|
-
|
|
773
|
+
/** The `name` property must exactly match any subscriptions you want to
|
|
774
|
+
trigger. */
|
|
737
775
|
name: z.ZodString;
|
|
738
|
-
|
|
776
|
+
/** The `payload` property will be sent to any matching Jobs and will appear
|
|
777
|
+
as the `payload` param of the `run()` function. You can leave this
|
|
778
|
+
parameter out if you just want to trigger a Job without any input data. */
|
|
739
779
|
payload: z.ZodAny;
|
|
780
|
+
/** The optional `context` property will be sent to any matching Jobs and will
|
|
781
|
+
be passed through as the `context.event.context` param of the `run()`
|
|
782
|
+
function. This is optional but can be useful if you want to pass through
|
|
783
|
+
some additional context to the Job. */
|
|
740
784
|
context: z.ZodOptional<z.ZodAny>;
|
|
741
|
-
|
|
785
|
+
/** The `id` property uniquely identify this particular event. If unset it
|
|
786
|
+
will be set automatically using `ulid`. */
|
|
787
|
+
id: z.ZodDefault<z.ZodString>;
|
|
788
|
+
/** This is optional, it defaults to the current timestamp. Usually you would
|
|
789
|
+
only set this if you have a timestamp that you wish to pass through, e.g.
|
|
790
|
+
you receive a timestamp from a service and you want the same timestamp to
|
|
791
|
+
be used in your Job. */
|
|
792
|
+
timestamp: z.ZodOptional<z.ZodDate>;
|
|
793
|
+
/** This is optional, it defaults to "trigger.dev". It can be useful to set
|
|
794
|
+
this as you can filter events using this in the `eventTrigger()`. */
|
|
795
|
+
source: z.ZodOptional<z.ZodString>;
|
|
742
796
|
}, "strip", z.ZodTypeAny, {
|
|
797
|
+
id: string;
|
|
798
|
+
name: string;
|
|
799
|
+
payload?: any;
|
|
800
|
+
context?: any;
|
|
801
|
+
timestamp?: Date | undefined;
|
|
743
802
|
source?: string | undefined;
|
|
803
|
+
}, {
|
|
804
|
+
name: string;
|
|
744
805
|
payload?: any;
|
|
745
806
|
context?: any;
|
|
746
|
-
|
|
807
|
+
id?: string | undefined;
|
|
808
|
+
timestamp?: Date | undefined;
|
|
809
|
+
source?: string | undefined;
|
|
810
|
+
}>;
|
|
811
|
+
/** The event you wish to send to Trigger a Job */
|
|
812
|
+
type SendEvent = z.input<typeof RawEventSchema>;
|
|
813
|
+
/** The event that was sent */
|
|
814
|
+
declare const ApiEventLogSchema: z.ZodObject<{
|
|
815
|
+
/** The `id` of the event that was sent.
|
|
816
|
+
*/
|
|
817
|
+
id: z.ZodString;
|
|
818
|
+
/** The `name` of the event that was sent. */
|
|
819
|
+
name: z.ZodString;
|
|
820
|
+
/** The `payload` of the event that was sent */
|
|
821
|
+
payload: z.ZodType<DeserializedJson, z.ZodTypeDef, DeserializedJson>;
|
|
822
|
+
/** The `context` of the event that was sent. Is `undefined` if no context was
|
|
823
|
+
set when sending the event. */
|
|
824
|
+
context: z.ZodNullable<z.ZodOptional<z.ZodType<DeserializedJson, z.ZodTypeDef, DeserializedJson>>>;
|
|
825
|
+
/** The `timestamp` of the event that was sent */
|
|
826
|
+
timestamp: z.ZodDate;
|
|
827
|
+
/** The timestamp when the event will be delivered to any matching Jobs. Is
|
|
828
|
+
`undefined` if `deliverAt` or `deliverAfter` wasn't set when sending the
|
|
829
|
+
event. */
|
|
830
|
+
deliverAt: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
831
|
+
/** The timestamp when the event was delivered. Is `undefined` if `deliverAt`
|
|
832
|
+
or `deliverAfter` were set when sending the event. */
|
|
833
|
+
deliveredAt: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
834
|
+
}, "strip", z.ZodTypeAny, {
|
|
747
835
|
id: string;
|
|
748
836
|
name: string;
|
|
837
|
+
payload: ((string | number | boolean | {
|
|
838
|
+
[key: string]: DeserializedJson;
|
|
839
|
+
} | DeserializedJson[]) & (string | number | boolean | {
|
|
840
|
+
[key: string]: DeserializedJson;
|
|
841
|
+
} | DeserializedJson[] | undefined)) | null;
|
|
842
|
+
timestamp: Date;
|
|
843
|
+
context?: DeserializedJson | undefined;
|
|
844
|
+
deliverAt?: Date | null | undefined;
|
|
845
|
+
deliveredAt?: Date | null | undefined;
|
|
749
846
|
}, {
|
|
750
|
-
id
|
|
751
|
-
source?: string | undefined;
|
|
752
|
-
payload?: any;
|
|
753
|
-
context?: any;
|
|
754
|
-
timestamp?: string | undefined;
|
|
847
|
+
id: string;
|
|
755
848
|
name: string;
|
|
849
|
+
payload: ((string | number | boolean | {
|
|
850
|
+
[key: string]: DeserializedJson;
|
|
851
|
+
} | DeserializedJson[]) & (string | number | boolean | {
|
|
852
|
+
[key: string]: DeserializedJson;
|
|
853
|
+
} | DeserializedJson[] | undefined)) | null;
|
|
854
|
+
timestamp: Date;
|
|
855
|
+
context?: DeserializedJson | undefined;
|
|
856
|
+
deliverAt?: Date | null | undefined;
|
|
857
|
+
deliveredAt?: Date | null | undefined;
|
|
756
858
|
}>;
|
|
757
|
-
type
|
|
859
|
+
type ApiEventLog = z.infer<typeof ApiEventLogSchema>;
|
|
860
|
+
/** Options to control the delivery of the event */
|
|
758
861
|
declare const SendEventOptionsSchema: z.ZodObject<{
|
|
759
|
-
|
|
862
|
+
/** An optional Date when you want the event to trigger Jobs. The event will
|
|
863
|
+
be sent to the platform immediately but won't be acted upon until the
|
|
864
|
+
specified time. */
|
|
865
|
+
deliverAt: z.ZodOptional<z.ZodDate>;
|
|
866
|
+
/** An optional number of seconds you want to wait for the event to trigger
|
|
867
|
+
any relevant Jobs. The event will be sent to the platform immediately but
|
|
868
|
+
won't be delivered until after the elapsed number of seconds. */
|
|
760
869
|
deliverAfter: z.ZodOptional<z.ZodNumber>;
|
|
870
|
+
/** This optional param will be used by Trigger.dev Connect, which
|
|
871
|
+
is coming soon. */
|
|
761
872
|
accountId: z.ZodOptional<z.ZodString>;
|
|
762
873
|
}, "strip", z.ZodTypeAny, {
|
|
763
|
-
deliverAt?:
|
|
874
|
+
deliverAt?: Date | undefined;
|
|
764
875
|
deliverAfter?: number | undefined;
|
|
765
876
|
accountId?: string | undefined;
|
|
766
877
|
}, {
|
|
767
|
-
deliverAt?:
|
|
878
|
+
deliverAt?: Date | undefined;
|
|
768
879
|
deliverAfter?: number | undefined;
|
|
769
880
|
accountId?: string | undefined;
|
|
770
881
|
}>;
|
|
@@ -788,13 +899,13 @@ declare const CreateRunBodySchema: z.ZodObject<{
|
|
|
788
899
|
text: z.ZodString;
|
|
789
900
|
url: z.ZodOptional<z.ZodString>;
|
|
790
901
|
}, "strip", z.ZodTypeAny, {
|
|
791
|
-
url?: string | undefined;
|
|
792
902
|
label: string;
|
|
793
903
|
text: string;
|
|
794
|
-
}, {
|
|
795
904
|
url?: string | undefined;
|
|
905
|
+
}, {
|
|
796
906
|
label: string;
|
|
797
907
|
text: string;
|
|
908
|
+
url?: string | undefined;
|
|
798
909
|
}>, "many">>;
|
|
799
910
|
schema: z.ZodOptional<z.ZodAny>;
|
|
800
911
|
examples: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -803,52 +914,52 @@ declare const CreateRunBodySchema: z.ZodObject<{
|
|
|
803
914
|
name: z.ZodString;
|
|
804
915
|
payload: z.ZodAny;
|
|
805
916
|
}, "strip", z.ZodTypeAny, {
|
|
806
|
-
icon?: string | undefined;
|
|
807
|
-
payload?: any;
|
|
808
917
|
id: string;
|
|
809
918
|
name: string;
|
|
810
|
-
}, {
|
|
811
919
|
icon?: string | undefined;
|
|
812
920
|
payload?: any;
|
|
921
|
+
}, {
|
|
813
922
|
id: string;
|
|
814
923
|
name: string;
|
|
924
|
+
icon?: string | undefined;
|
|
925
|
+
payload?: any;
|
|
815
926
|
}>, "many">>;
|
|
816
927
|
}, "strip", z.ZodTypeAny, {
|
|
928
|
+
name: string;
|
|
929
|
+
icon: string;
|
|
930
|
+
source: string;
|
|
931
|
+
title: string;
|
|
817
932
|
filter?: EventFilter | undefined;
|
|
818
933
|
properties?: {
|
|
819
|
-
url?: string | undefined;
|
|
820
934
|
label: string;
|
|
821
935
|
text: string;
|
|
936
|
+
url?: string | undefined;
|
|
822
937
|
}[] | undefined;
|
|
823
938
|
schema?: any;
|
|
824
939
|
examples?: {
|
|
825
|
-
icon?: string | undefined;
|
|
826
|
-
payload?: any;
|
|
827
940
|
id: string;
|
|
828
941
|
name: string;
|
|
942
|
+
icon?: string | undefined;
|
|
943
|
+
payload?: any;
|
|
829
944
|
}[] | undefined;
|
|
945
|
+
}, {
|
|
830
946
|
name: string;
|
|
831
947
|
icon: string;
|
|
832
948
|
source: string;
|
|
833
949
|
title: string;
|
|
834
|
-
}, {
|
|
835
950
|
filter?: EventFilter | undefined;
|
|
836
951
|
properties?: {
|
|
837
|
-
url?: string | undefined;
|
|
838
952
|
label: string;
|
|
839
953
|
text: string;
|
|
954
|
+
url?: string | undefined;
|
|
840
955
|
}[] | undefined;
|
|
841
956
|
schema?: any;
|
|
842
957
|
examples?: {
|
|
843
|
-
icon?: string | undefined;
|
|
844
|
-
payload?: any;
|
|
845
958
|
id: string;
|
|
846
959
|
name: string;
|
|
960
|
+
icon?: string | undefined;
|
|
961
|
+
payload?: any;
|
|
847
962
|
}[] | undefined;
|
|
848
|
-
name: string;
|
|
849
|
-
icon: string;
|
|
850
|
-
source: string;
|
|
851
|
-
title: string;
|
|
852
963
|
}>;
|
|
853
964
|
trigger: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
854
965
|
type: z.ZodLiteral<"dynamic">;
|
|
@@ -867,13 +978,13 @@ declare const CreateRunBodySchema: z.ZodObject<{
|
|
|
867
978
|
text: z.ZodString;
|
|
868
979
|
url: z.ZodOptional<z.ZodString>;
|
|
869
980
|
}, "strip", z.ZodTypeAny, {
|
|
870
|
-
url?: string | undefined;
|
|
871
981
|
label: string;
|
|
872
982
|
text: string;
|
|
873
|
-
}, {
|
|
874
983
|
url?: string | undefined;
|
|
984
|
+
}, {
|
|
875
985
|
label: string;
|
|
876
986
|
text: string;
|
|
987
|
+
url?: string | undefined;
|
|
877
988
|
}>, "many">>;
|
|
878
989
|
rule: z.ZodObject<{
|
|
879
990
|
event: z.ZodString;
|
|
@@ -881,44 +992,44 @@ declare const CreateRunBodySchema: z.ZodObject<{
|
|
|
881
992
|
payload: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
|
|
882
993
|
context: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
|
|
883
994
|
}, "strip", z.ZodTypeAny, {
|
|
884
|
-
payload?: EventFilter | undefined;
|
|
885
|
-
context?: EventFilter | undefined;
|
|
886
995
|
event: string;
|
|
887
996
|
source: string;
|
|
888
|
-
}, {
|
|
889
997
|
payload?: EventFilter | undefined;
|
|
890
998
|
context?: EventFilter | undefined;
|
|
999
|
+
}, {
|
|
891
1000
|
event: string;
|
|
892
1001
|
source: string;
|
|
1002
|
+
payload?: EventFilter | undefined;
|
|
1003
|
+
context?: EventFilter | undefined;
|
|
893
1004
|
}>;
|
|
894
1005
|
}, "strip", z.ZodTypeAny, {
|
|
895
|
-
properties?: {
|
|
896
|
-
url?: string | undefined;
|
|
897
|
-
label: string;
|
|
898
|
-
text: string;
|
|
899
|
-
}[] | undefined;
|
|
900
1006
|
type: "static";
|
|
901
1007
|
title: string;
|
|
902
1008
|
rule: {
|
|
903
|
-
payload?: EventFilter | undefined;
|
|
904
|
-
context?: EventFilter | undefined;
|
|
905
1009
|
event: string;
|
|
906
1010
|
source: string;
|
|
1011
|
+
payload?: EventFilter | undefined;
|
|
1012
|
+
context?: EventFilter | undefined;
|
|
907
1013
|
};
|
|
908
|
-
}, {
|
|
909
1014
|
properties?: {
|
|
910
|
-
url?: string | undefined;
|
|
911
1015
|
label: string;
|
|
912
1016
|
text: string;
|
|
1017
|
+
url?: string | undefined;
|
|
913
1018
|
}[] | undefined;
|
|
1019
|
+
}, {
|
|
914
1020
|
type: "static";
|
|
915
1021
|
title: string;
|
|
916
1022
|
rule: {
|
|
917
|
-
payload?: EventFilter | undefined;
|
|
918
|
-
context?: EventFilter | undefined;
|
|
919
1023
|
event: string;
|
|
920
1024
|
source: string;
|
|
1025
|
+
payload?: EventFilter | undefined;
|
|
1026
|
+
context?: EventFilter | undefined;
|
|
921
1027
|
};
|
|
1028
|
+
properties?: {
|
|
1029
|
+
label: string;
|
|
1030
|
+
text: string;
|
|
1031
|
+
url?: string | undefined;
|
|
1032
|
+
}[] | undefined;
|
|
922
1033
|
}>, z.ZodObject<{
|
|
923
1034
|
type: z.ZodLiteral<"scheduled">;
|
|
924
1035
|
schedule: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
@@ -932,17 +1043,17 @@ declare const CreateRunBodySchema: z.ZodObject<{
|
|
|
932
1043
|
}>;
|
|
933
1044
|
metadata: z.ZodAny;
|
|
934
1045
|
}, "strip", z.ZodTypeAny, {
|
|
935
|
-
metadata?: any;
|
|
936
1046
|
options: {
|
|
937
1047
|
seconds: number;
|
|
938
1048
|
};
|
|
939
1049
|
type: "interval";
|
|
940
|
-
}, {
|
|
941
1050
|
metadata?: any;
|
|
1051
|
+
}, {
|
|
942
1052
|
options: {
|
|
943
1053
|
seconds: number;
|
|
944
1054
|
};
|
|
945
1055
|
type: "interval";
|
|
1056
|
+
metadata?: any;
|
|
946
1057
|
}>, z.ZodObject<{
|
|
947
1058
|
type: z.ZodLiteral<"cron">;
|
|
948
1059
|
options: z.ZodObject<{
|
|
@@ -954,47 +1065,47 @@ declare const CreateRunBodySchema: z.ZodObject<{
|
|
|
954
1065
|
}>;
|
|
955
1066
|
metadata: z.ZodAny;
|
|
956
1067
|
}, "strip", z.ZodTypeAny, {
|
|
957
|
-
metadata?: any;
|
|
958
1068
|
options: {
|
|
959
1069
|
cron: string;
|
|
960
1070
|
};
|
|
961
1071
|
type: "cron";
|
|
962
|
-
}, {
|
|
963
1072
|
metadata?: any;
|
|
1073
|
+
}, {
|
|
964
1074
|
options: {
|
|
965
1075
|
cron: string;
|
|
966
1076
|
};
|
|
967
1077
|
type: "cron";
|
|
1078
|
+
metadata?: any;
|
|
968
1079
|
}>]>;
|
|
969
1080
|
}, "strip", z.ZodTypeAny, {
|
|
970
1081
|
type: "scheduled";
|
|
971
1082
|
schedule: {
|
|
972
|
-
metadata?: any;
|
|
973
1083
|
options: {
|
|
974
1084
|
cron: string;
|
|
975
1085
|
};
|
|
976
1086
|
type: "cron";
|
|
977
|
-
} | {
|
|
978
1087
|
metadata?: any;
|
|
1088
|
+
} | {
|
|
979
1089
|
options: {
|
|
980
1090
|
seconds: number;
|
|
981
1091
|
};
|
|
982
1092
|
type: "interval";
|
|
1093
|
+
metadata?: any;
|
|
983
1094
|
};
|
|
984
1095
|
}, {
|
|
985
1096
|
type: "scheduled";
|
|
986
1097
|
schedule: {
|
|
987
|
-
metadata?: any;
|
|
988
1098
|
options: {
|
|
989
1099
|
cron: string;
|
|
990
1100
|
};
|
|
991
1101
|
type: "cron";
|
|
992
|
-
} | {
|
|
993
1102
|
metadata?: any;
|
|
1103
|
+
} | {
|
|
994
1104
|
options: {
|
|
995
1105
|
seconds: number;
|
|
996
1106
|
};
|
|
997
1107
|
type: "interval";
|
|
1108
|
+
metadata?: any;
|
|
998
1109
|
};
|
|
999
1110
|
}>]>;
|
|
1000
1111
|
integrations: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -1004,29 +1115,29 @@ declare const CreateRunBodySchema: z.ZodObject<{
|
|
|
1004
1115
|
name: z.ZodString;
|
|
1005
1116
|
instructions: z.ZodOptional<z.ZodString>;
|
|
1006
1117
|
}, "strip", z.ZodTypeAny, {
|
|
1007
|
-
instructions?: string | undefined;
|
|
1008
1118
|
id: string;
|
|
1009
1119
|
name: string;
|
|
1010
|
-
}, {
|
|
1011
1120
|
instructions?: string | undefined;
|
|
1121
|
+
}, {
|
|
1012
1122
|
id: string;
|
|
1013
1123
|
name: string;
|
|
1124
|
+
instructions?: string | undefined;
|
|
1014
1125
|
}>;
|
|
1015
1126
|
authSource: z.ZodEnum<["HOSTED", "LOCAL"]>;
|
|
1016
1127
|
}, "strip", z.ZodTypeAny, {
|
|
1017
1128
|
id: string;
|
|
1018
1129
|
metadata: {
|
|
1019
|
-
instructions?: string | undefined;
|
|
1020
1130
|
id: string;
|
|
1021
1131
|
name: string;
|
|
1132
|
+
instructions?: string | undefined;
|
|
1022
1133
|
};
|
|
1023
1134
|
authSource: "HOSTED" | "LOCAL";
|
|
1024
1135
|
}, {
|
|
1025
1136
|
id: string;
|
|
1026
1137
|
metadata: {
|
|
1027
|
-
instructions?: string | undefined;
|
|
1028
1138
|
id: string;
|
|
1029
1139
|
name: string;
|
|
1140
|
+
instructions?: string | undefined;
|
|
1030
1141
|
};
|
|
1031
1142
|
authSource: "HOSTED" | "LOCAL";
|
|
1032
1143
|
}>>;
|
|
@@ -1035,81 +1146,77 @@ declare const CreateRunBodySchema: z.ZodObject<{
|
|
|
1035
1146
|
name: z.ZodString;
|
|
1036
1147
|
maxConcurrent: z.ZodOptional<z.ZodNumber>;
|
|
1037
1148
|
}, "strip", z.ZodTypeAny, {
|
|
1038
|
-
maxConcurrent?: number | undefined;
|
|
1039
1149
|
name: string;
|
|
1040
|
-
}, {
|
|
1041
1150
|
maxConcurrent?: number | undefined;
|
|
1151
|
+
}, {
|
|
1042
1152
|
name: string;
|
|
1153
|
+
maxConcurrent?: number | undefined;
|
|
1043
1154
|
}>, z.ZodString]>>;
|
|
1044
1155
|
startPosition: z.ZodEnum<["initial", "latest"]>;
|
|
1045
1156
|
enabled: z.ZodBoolean;
|
|
1046
1157
|
preprocessRuns: z.ZodBoolean;
|
|
1047
1158
|
}, "strip", z.ZodTypeAny, {
|
|
1048
|
-
queue?: string | {
|
|
1049
|
-
maxConcurrent?: number | undefined;
|
|
1050
|
-
name: string;
|
|
1051
|
-
} | undefined;
|
|
1052
1159
|
id: string;
|
|
1053
1160
|
name: string;
|
|
1054
1161
|
event: {
|
|
1162
|
+
name: string;
|
|
1163
|
+
icon: string;
|
|
1164
|
+
source: string;
|
|
1165
|
+
title: string;
|
|
1055
1166
|
filter?: EventFilter | undefined;
|
|
1056
1167
|
properties?: {
|
|
1057
|
-
url?: string | undefined;
|
|
1058
1168
|
label: string;
|
|
1059
1169
|
text: string;
|
|
1170
|
+
url?: string | undefined;
|
|
1060
1171
|
}[] | undefined;
|
|
1061
1172
|
schema?: any;
|
|
1062
1173
|
examples?: {
|
|
1063
|
-
icon?: string | undefined;
|
|
1064
|
-
payload?: any;
|
|
1065
1174
|
id: string;
|
|
1066
1175
|
name: string;
|
|
1176
|
+
icon?: string | undefined;
|
|
1177
|
+
payload?: any;
|
|
1067
1178
|
}[] | undefined;
|
|
1068
|
-
name: string;
|
|
1069
|
-
icon: string;
|
|
1070
|
-
source: string;
|
|
1071
|
-
title: string;
|
|
1072
1179
|
};
|
|
1073
1180
|
version: string;
|
|
1074
1181
|
trigger: {
|
|
1075
1182
|
id: string;
|
|
1076
1183
|
type: "dynamic";
|
|
1077
1184
|
} | {
|
|
1078
|
-
properties?: {
|
|
1079
|
-
url?: string | undefined;
|
|
1080
|
-
label: string;
|
|
1081
|
-
text: string;
|
|
1082
|
-
}[] | undefined;
|
|
1083
1185
|
type: "static";
|
|
1084
1186
|
title: string;
|
|
1085
1187
|
rule: {
|
|
1086
|
-
payload?: EventFilter | undefined;
|
|
1087
|
-
context?: EventFilter | undefined;
|
|
1088
1188
|
event: string;
|
|
1089
1189
|
source: string;
|
|
1190
|
+
payload?: EventFilter | undefined;
|
|
1191
|
+
context?: EventFilter | undefined;
|
|
1090
1192
|
};
|
|
1193
|
+
properties?: {
|
|
1194
|
+
label: string;
|
|
1195
|
+
text: string;
|
|
1196
|
+
url?: string | undefined;
|
|
1197
|
+
}[] | undefined;
|
|
1091
1198
|
} | {
|
|
1092
1199
|
type: "scheduled";
|
|
1093
1200
|
schedule: {
|
|
1094
|
-
metadata?: any;
|
|
1095
1201
|
options: {
|
|
1096
1202
|
cron: string;
|
|
1097
1203
|
};
|
|
1098
1204
|
type: "cron";
|
|
1099
|
-
} | {
|
|
1100
1205
|
metadata?: any;
|
|
1206
|
+
} | {
|
|
1101
1207
|
options: {
|
|
1102
1208
|
seconds: number;
|
|
1103
1209
|
};
|
|
1104
1210
|
type: "interval";
|
|
1211
|
+
metadata?: any;
|
|
1105
1212
|
};
|
|
1106
1213
|
};
|
|
1107
1214
|
integrations: Record<string, {
|
|
1108
1215
|
id: string;
|
|
1109
1216
|
metadata: {
|
|
1110
|
-
instructions?: string | undefined;
|
|
1111
1217
|
id: string;
|
|
1112
1218
|
name: string;
|
|
1219
|
+
instructions?: string | undefined;
|
|
1113
1220
|
};
|
|
1114
1221
|
authSource: "HOSTED" | "LOCAL";
|
|
1115
1222
|
}>;
|
|
@@ -1117,199 +1224,218 @@ declare const CreateRunBodySchema: z.ZodObject<{
|
|
|
1117
1224
|
startPosition: "initial" | "latest";
|
|
1118
1225
|
enabled: boolean;
|
|
1119
1226
|
preprocessRuns: boolean;
|
|
1120
|
-
}, {
|
|
1121
|
-
internal?: boolean | undefined;
|
|
1122
1227
|
queue?: string | {
|
|
1123
|
-
maxConcurrent?: number | undefined;
|
|
1124
1228
|
name: string;
|
|
1229
|
+
maxConcurrent?: number | undefined;
|
|
1125
1230
|
} | undefined;
|
|
1231
|
+
}, {
|
|
1126
1232
|
id: string;
|
|
1127
1233
|
name: string;
|
|
1128
1234
|
event: {
|
|
1235
|
+
name: string;
|
|
1236
|
+
icon: string;
|
|
1237
|
+
source: string;
|
|
1238
|
+
title: string;
|
|
1129
1239
|
filter?: EventFilter | undefined;
|
|
1130
1240
|
properties?: {
|
|
1131
|
-
url?: string | undefined;
|
|
1132
1241
|
label: string;
|
|
1133
1242
|
text: string;
|
|
1243
|
+
url?: string | undefined;
|
|
1134
1244
|
}[] | undefined;
|
|
1135
1245
|
schema?: any;
|
|
1136
1246
|
examples?: {
|
|
1137
|
-
icon?: string | undefined;
|
|
1138
|
-
payload?: any;
|
|
1139
1247
|
id: string;
|
|
1140
1248
|
name: string;
|
|
1249
|
+
icon?: string | undefined;
|
|
1250
|
+
payload?: any;
|
|
1141
1251
|
}[] | undefined;
|
|
1142
|
-
name: string;
|
|
1143
|
-
icon: string;
|
|
1144
|
-
source: string;
|
|
1145
|
-
title: string;
|
|
1146
1252
|
};
|
|
1147
1253
|
version: string;
|
|
1148
1254
|
trigger: {
|
|
1149
1255
|
id: string;
|
|
1150
1256
|
type: "dynamic";
|
|
1151
1257
|
} | {
|
|
1152
|
-
properties?: {
|
|
1153
|
-
url?: string | undefined;
|
|
1154
|
-
label: string;
|
|
1155
|
-
text: string;
|
|
1156
|
-
}[] | undefined;
|
|
1157
1258
|
type: "static";
|
|
1158
1259
|
title: string;
|
|
1159
1260
|
rule: {
|
|
1160
|
-
payload?: EventFilter | undefined;
|
|
1161
|
-
context?: EventFilter | undefined;
|
|
1162
1261
|
event: string;
|
|
1163
1262
|
source: string;
|
|
1263
|
+
payload?: EventFilter | undefined;
|
|
1264
|
+
context?: EventFilter | undefined;
|
|
1164
1265
|
};
|
|
1266
|
+
properties?: {
|
|
1267
|
+
label: string;
|
|
1268
|
+
text: string;
|
|
1269
|
+
url?: string | undefined;
|
|
1270
|
+
}[] | undefined;
|
|
1165
1271
|
} | {
|
|
1166
1272
|
type: "scheduled";
|
|
1167
1273
|
schedule: {
|
|
1168
|
-
metadata?: any;
|
|
1169
1274
|
options: {
|
|
1170
1275
|
cron: string;
|
|
1171
1276
|
};
|
|
1172
1277
|
type: "cron";
|
|
1173
|
-
} | {
|
|
1174
1278
|
metadata?: any;
|
|
1279
|
+
} | {
|
|
1175
1280
|
options: {
|
|
1176
1281
|
seconds: number;
|
|
1177
1282
|
};
|
|
1178
1283
|
type: "interval";
|
|
1284
|
+
metadata?: any;
|
|
1179
1285
|
};
|
|
1180
1286
|
};
|
|
1181
1287
|
integrations: Record<string, {
|
|
1182
1288
|
id: string;
|
|
1183
1289
|
metadata: {
|
|
1184
|
-
instructions?: string | undefined;
|
|
1185
1290
|
id: string;
|
|
1186
1291
|
name: string;
|
|
1292
|
+
instructions?: string | undefined;
|
|
1187
1293
|
};
|
|
1188
1294
|
authSource: "HOSTED" | "LOCAL";
|
|
1189
1295
|
}>;
|
|
1190
1296
|
startPosition: "initial" | "latest";
|
|
1191
1297
|
enabled: boolean;
|
|
1192
1298
|
preprocessRuns: boolean;
|
|
1299
|
+
internal?: boolean | undefined;
|
|
1300
|
+
queue?: string | {
|
|
1301
|
+
name: string;
|
|
1302
|
+
maxConcurrent?: number | undefined;
|
|
1303
|
+
} | undefined;
|
|
1193
1304
|
}>;
|
|
1194
1305
|
event: z.ZodObject<{
|
|
1306
|
+
/** The `id` of the event that was sent.
|
|
1307
|
+
*/
|
|
1195
1308
|
id: z.ZodString;
|
|
1309
|
+
/** The `name` of the event that was sent. */
|
|
1196
1310
|
name: z.ZodString;
|
|
1311
|
+
/** The `payload` of the event that was sent */
|
|
1197
1312
|
payload: z.ZodType<DeserializedJson, z.ZodTypeDef, DeserializedJson>;
|
|
1313
|
+
/** The `context` of the event that was sent. Is `undefined` if no context was
|
|
1314
|
+
set when sending the event. */
|
|
1198
1315
|
context: z.ZodNullable<z.ZodOptional<z.ZodType<DeserializedJson, z.ZodTypeDef, DeserializedJson>>>;
|
|
1316
|
+
/** The `timestamp` of the event that was sent */
|
|
1199
1317
|
timestamp: z.ZodDate;
|
|
1318
|
+
/** The timestamp when the event will be delivered to any matching Jobs. Is
|
|
1319
|
+
`undefined` if `deliverAt` or `deliverAfter` wasn't set when sending the
|
|
1320
|
+
event. */
|
|
1200
1321
|
deliverAt: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
1322
|
+
/** The timestamp when the event was delivered. Is `undefined` if `deliverAt`
|
|
1323
|
+
or `deliverAfter` were set when sending the event. */
|
|
1201
1324
|
deliveredAt: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
1202
1325
|
}, "strip", z.ZodTypeAny, {
|
|
1203
|
-
context?: DeserializedJson | undefined;
|
|
1204
|
-
deliverAt?: Date | null | undefined;
|
|
1205
|
-
deliveredAt?: Date | null | undefined;
|
|
1206
1326
|
id: string;
|
|
1207
1327
|
name: string;
|
|
1208
|
-
payload:
|
|
1328
|
+
payload: ((string | number | boolean | {
|
|
1329
|
+
[key: string]: DeserializedJson;
|
|
1330
|
+
} | DeserializedJson[]) & (string | number | boolean | {
|
|
1331
|
+
[key: string]: DeserializedJson;
|
|
1332
|
+
} | DeserializedJson[] | undefined)) | null;
|
|
1209
1333
|
timestamp: Date;
|
|
1210
|
-
}, {
|
|
1211
1334
|
context?: DeserializedJson | undefined;
|
|
1212
1335
|
deliverAt?: Date | null | undefined;
|
|
1213
1336
|
deliveredAt?: Date | null | undefined;
|
|
1337
|
+
}, {
|
|
1214
1338
|
id: string;
|
|
1215
1339
|
name: string;
|
|
1216
|
-
payload:
|
|
1340
|
+
payload: ((string | number | boolean | {
|
|
1341
|
+
[key: string]: DeserializedJson;
|
|
1342
|
+
} | DeserializedJson[]) & (string | number | boolean | {
|
|
1343
|
+
[key: string]: DeserializedJson;
|
|
1344
|
+
} | DeserializedJson[] | undefined)) | null;
|
|
1217
1345
|
timestamp: Date;
|
|
1346
|
+
context?: DeserializedJson | undefined;
|
|
1347
|
+
deliverAt?: Date | null | undefined;
|
|
1348
|
+
deliveredAt?: Date | null | undefined;
|
|
1218
1349
|
}>;
|
|
1219
1350
|
properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1220
1351
|
label: z.ZodString;
|
|
1221
1352
|
text: z.ZodString;
|
|
1222
1353
|
url: z.ZodOptional<z.ZodString>;
|
|
1223
1354
|
}, "strip", z.ZodTypeAny, {
|
|
1224
|
-
url?: string | undefined;
|
|
1225
1355
|
label: string;
|
|
1226
1356
|
text: string;
|
|
1227
|
-
}, {
|
|
1228
1357
|
url?: string | undefined;
|
|
1358
|
+
}, {
|
|
1229
1359
|
label: string;
|
|
1230
1360
|
text: string;
|
|
1361
|
+
url?: string | undefined;
|
|
1231
1362
|
}>, "many">>;
|
|
1232
1363
|
}, "strip", z.ZodTypeAny, {
|
|
1233
|
-
properties?: {
|
|
1234
|
-
url?: string | undefined;
|
|
1235
|
-
label: string;
|
|
1236
|
-
text: string;
|
|
1237
|
-
}[] | undefined;
|
|
1238
1364
|
event: {
|
|
1239
|
-
context?: DeserializedJson | undefined;
|
|
1240
|
-
deliverAt?: Date | null | undefined;
|
|
1241
|
-
deliveredAt?: Date | null | undefined;
|
|
1242
1365
|
id: string;
|
|
1243
1366
|
name: string;
|
|
1244
|
-
payload:
|
|
1367
|
+
payload: ((string | number | boolean | {
|
|
1368
|
+
[key: string]: DeserializedJson;
|
|
1369
|
+
} | DeserializedJson[]) & (string | number | boolean | {
|
|
1370
|
+
[key: string]: DeserializedJson;
|
|
1371
|
+
} | DeserializedJson[] | undefined)) | null;
|
|
1245
1372
|
timestamp: Date;
|
|
1373
|
+
context?: DeserializedJson | undefined;
|
|
1374
|
+
deliverAt?: Date | null | undefined;
|
|
1375
|
+
deliveredAt?: Date | null | undefined;
|
|
1246
1376
|
};
|
|
1247
1377
|
job: {
|
|
1248
|
-
queue?: string | {
|
|
1249
|
-
maxConcurrent?: number | undefined;
|
|
1250
|
-
name: string;
|
|
1251
|
-
} | undefined;
|
|
1252
1378
|
id: string;
|
|
1253
1379
|
name: string;
|
|
1254
1380
|
event: {
|
|
1381
|
+
name: string;
|
|
1382
|
+
icon: string;
|
|
1383
|
+
source: string;
|
|
1384
|
+
title: string;
|
|
1255
1385
|
filter?: EventFilter | undefined;
|
|
1256
1386
|
properties?: {
|
|
1257
|
-
url?: string | undefined;
|
|
1258
1387
|
label: string;
|
|
1259
1388
|
text: string;
|
|
1389
|
+
url?: string | undefined;
|
|
1260
1390
|
}[] | undefined;
|
|
1261
1391
|
schema?: any;
|
|
1262
1392
|
examples?: {
|
|
1263
|
-
icon?: string | undefined;
|
|
1264
|
-
payload?: any;
|
|
1265
1393
|
id: string;
|
|
1266
1394
|
name: string;
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
source: string;
|
|
1271
|
-
title: string;
|
|
1395
|
+
icon?: string | undefined;
|
|
1396
|
+
payload?: any;
|
|
1397
|
+
}[] | undefined;
|
|
1272
1398
|
};
|
|
1273
1399
|
version: string;
|
|
1274
1400
|
trigger: {
|
|
1275
1401
|
id: string;
|
|
1276
1402
|
type: "dynamic";
|
|
1277
1403
|
} | {
|
|
1278
|
-
properties?: {
|
|
1279
|
-
url?: string | undefined;
|
|
1280
|
-
label: string;
|
|
1281
|
-
text: string;
|
|
1282
|
-
}[] | undefined;
|
|
1283
1404
|
type: "static";
|
|
1284
1405
|
title: string;
|
|
1285
1406
|
rule: {
|
|
1286
|
-
payload?: EventFilter | undefined;
|
|
1287
|
-
context?: EventFilter | undefined;
|
|
1288
1407
|
event: string;
|
|
1289
1408
|
source: string;
|
|
1409
|
+
payload?: EventFilter | undefined;
|
|
1410
|
+
context?: EventFilter | undefined;
|
|
1290
1411
|
};
|
|
1412
|
+
properties?: {
|
|
1413
|
+
label: string;
|
|
1414
|
+
text: string;
|
|
1415
|
+
url?: string | undefined;
|
|
1416
|
+
}[] | undefined;
|
|
1291
1417
|
} | {
|
|
1292
1418
|
type: "scheduled";
|
|
1293
1419
|
schedule: {
|
|
1294
|
-
metadata?: any;
|
|
1295
1420
|
options: {
|
|
1296
1421
|
cron: string;
|
|
1297
1422
|
};
|
|
1298
1423
|
type: "cron";
|
|
1299
|
-
} | {
|
|
1300
1424
|
metadata?: any;
|
|
1425
|
+
} | {
|
|
1301
1426
|
options: {
|
|
1302
1427
|
seconds: number;
|
|
1303
1428
|
};
|
|
1304
1429
|
type: "interval";
|
|
1430
|
+
metadata?: any;
|
|
1305
1431
|
};
|
|
1306
1432
|
};
|
|
1307
1433
|
integrations: Record<string, {
|
|
1308
1434
|
id: string;
|
|
1309
1435
|
metadata: {
|
|
1310
|
-
instructions?: string | undefined;
|
|
1311
1436
|
id: string;
|
|
1312
1437
|
name: string;
|
|
1438
|
+
instructions?: string | undefined;
|
|
1313
1439
|
};
|
|
1314
1440
|
authSource: "HOSTED" | "LOCAL";
|
|
1315
1441
|
}>;
|
|
@@ -1317,98 +1443,111 @@ declare const CreateRunBodySchema: z.ZodObject<{
|
|
|
1317
1443
|
startPosition: "initial" | "latest";
|
|
1318
1444
|
enabled: boolean;
|
|
1319
1445
|
preprocessRuns: boolean;
|
|
1446
|
+
queue?: string | {
|
|
1447
|
+
name: string;
|
|
1448
|
+
maxConcurrent?: number | undefined;
|
|
1449
|
+
} | undefined;
|
|
1320
1450
|
};
|
|
1321
1451
|
client: string;
|
|
1322
|
-
}, {
|
|
1323
1452
|
properties?: {
|
|
1324
|
-
url?: string | undefined;
|
|
1325
1453
|
label: string;
|
|
1326
1454
|
text: string;
|
|
1455
|
+
url?: string | undefined;
|
|
1327
1456
|
}[] | undefined;
|
|
1457
|
+
}, {
|
|
1328
1458
|
event: {
|
|
1329
|
-
context?: DeserializedJson | undefined;
|
|
1330
|
-
deliverAt?: Date | null | undefined;
|
|
1331
|
-
deliveredAt?: Date | null | undefined;
|
|
1332
1459
|
id: string;
|
|
1333
1460
|
name: string;
|
|
1334
|
-
payload:
|
|
1461
|
+
payload: ((string | number | boolean | {
|
|
1462
|
+
[key: string]: DeserializedJson;
|
|
1463
|
+
} | DeserializedJson[]) & (string | number | boolean | {
|
|
1464
|
+
[key: string]: DeserializedJson;
|
|
1465
|
+
} | DeserializedJson[] | undefined)) | null;
|
|
1335
1466
|
timestamp: Date;
|
|
1467
|
+
context?: DeserializedJson | undefined;
|
|
1468
|
+
deliverAt?: Date | null | undefined;
|
|
1469
|
+
deliveredAt?: Date | null | undefined;
|
|
1336
1470
|
};
|
|
1337
1471
|
job: {
|
|
1338
|
-
internal?: boolean | undefined;
|
|
1339
|
-
queue?: string | {
|
|
1340
|
-
maxConcurrent?: number | undefined;
|
|
1341
|
-
name: string;
|
|
1342
|
-
} | undefined;
|
|
1343
1472
|
id: string;
|
|
1344
1473
|
name: string;
|
|
1345
1474
|
event: {
|
|
1475
|
+
name: string;
|
|
1476
|
+
icon: string;
|
|
1477
|
+
source: string;
|
|
1478
|
+
title: string;
|
|
1346
1479
|
filter?: EventFilter | undefined;
|
|
1347
1480
|
properties?: {
|
|
1348
|
-
url?: string | undefined;
|
|
1349
1481
|
label: string;
|
|
1350
1482
|
text: string;
|
|
1483
|
+
url?: string | undefined;
|
|
1351
1484
|
}[] | undefined;
|
|
1352
1485
|
schema?: any;
|
|
1353
1486
|
examples?: {
|
|
1354
|
-
icon?: string | undefined;
|
|
1355
|
-
payload?: any;
|
|
1356
1487
|
id: string;
|
|
1357
1488
|
name: string;
|
|
1489
|
+
icon?: string | undefined;
|
|
1490
|
+
payload?: any;
|
|
1358
1491
|
}[] | undefined;
|
|
1359
|
-
name: string;
|
|
1360
|
-
icon: string;
|
|
1361
|
-
source: string;
|
|
1362
|
-
title: string;
|
|
1363
1492
|
};
|
|
1364
1493
|
version: string;
|
|
1365
1494
|
trigger: {
|
|
1366
1495
|
id: string;
|
|
1367
1496
|
type: "dynamic";
|
|
1368
1497
|
} | {
|
|
1369
|
-
properties?: {
|
|
1370
|
-
url?: string | undefined;
|
|
1371
|
-
label: string;
|
|
1372
|
-
text: string;
|
|
1373
|
-
}[] | undefined;
|
|
1374
1498
|
type: "static";
|
|
1375
1499
|
title: string;
|
|
1376
1500
|
rule: {
|
|
1377
|
-
payload?: EventFilter | undefined;
|
|
1378
|
-
context?: EventFilter | undefined;
|
|
1379
1501
|
event: string;
|
|
1380
1502
|
source: string;
|
|
1503
|
+
payload?: EventFilter | undefined;
|
|
1504
|
+
context?: EventFilter | undefined;
|
|
1381
1505
|
};
|
|
1506
|
+
properties?: {
|
|
1507
|
+
label: string;
|
|
1508
|
+
text: string;
|
|
1509
|
+
url?: string | undefined;
|
|
1510
|
+
}[] | undefined;
|
|
1382
1511
|
} | {
|
|
1383
1512
|
type: "scheduled";
|
|
1384
1513
|
schedule: {
|
|
1385
|
-
metadata?: any;
|
|
1386
1514
|
options: {
|
|
1387
1515
|
cron: string;
|
|
1388
1516
|
};
|
|
1389
1517
|
type: "cron";
|
|
1390
|
-
} | {
|
|
1391
1518
|
metadata?: any;
|
|
1519
|
+
} | {
|
|
1392
1520
|
options: {
|
|
1393
1521
|
seconds: number;
|
|
1394
1522
|
};
|
|
1395
1523
|
type: "interval";
|
|
1524
|
+
metadata?: any;
|
|
1396
1525
|
};
|
|
1397
1526
|
};
|
|
1398
1527
|
integrations: Record<string, {
|
|
1399
1528
|
id: string;
|
|
1400
1529
|
metadata: {
|
|
1401
|
-
instructions?: string | undefined;
|
|
1402
1530
|
id: string;
|
|
1403
1531
|
name: string;
|
|
1532
|
+
instructions?: string | undefined;
|
|
1404
1533
|
};
|
|
1405
1534
|
authSource: "HOSTED" | "LOCAL";
|
|
1406
1535
|
}>;
|
|
1407
1536
|
startPosition: "initial" | "latest";
|
|
1408
1537
|
enabled: boolean;
|
|
1409
1538
|
preprocessRuns: boolean;
|
|
1539
|
+
internal?: boolean | undefined;
|
|
1540
|
+
queue?: string | {
|
|
1541
|
+
name: string;
|
|
1542
|
+
maxConcurrent?: number | undefined;
|
|
1543
|
+
} | undefined;
|
|
1410
1544
|
};
|
|
1411
1545
|
client: string;
|
|
1546
|
+
properties?: {
|
|
1547
|
+
label: string;
|
|
1548
|
+
text: string;
|
|
1549
|
+
url?: string | undefined;
|
|
1550
|
+
}[] | undefined;
|
|
1412
1551
|
}>;
|
|
1413
1552
|
type CreateRunBody = z.infer<typeof CreateRunBodySchema>;
|
|
1414
1553
|
declare const RedactStringSchema: z.ZodObject<{
|
|
@@ -1427,27 +1566,83 @@ declare const RedactStringSchema: z.ZodObject<{
|
|
|
1427
1566
|
type RedactString = z.infer<typeof RedactStringSchema>;
|
|
1428
1567
|
type CachedTask = z.infer<typeof CachedTaskSchema>;
|
|
1429
1568
|
declare const RunTaskOptionsSchema: z.ZodObject<{
|
|
1569
|
+
/** The name of the Task is required. This is displayed on the Task in the logs. */
|
|
1430
1570
|
name: z.ZodString;
|
|
1571
|
+
/** The Task will wait and only start at the specified Date */
|
|
1572
|
+
delayUntil: z.ZodOptional<z.ZodDate>;
|
|
1573
|
+
/** Retry options */
|
|
1574
|
+
retry: z.ZodOptional<z.ZodObject<{
|
|
1575
|
+
/** The maximum number of times to retry the request. */
|
|
1576
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
1577
|
+
/** The exponential factor to use when calculating the next retry time. */
|
|
1578
|
+
factor: z.ZodOptional<z.ZodNumber>;
|
|
1579
|
+
/** The minimum amount of time to wait before retrying the request. */
|
|
1580
|
+
minTimeoutInMs: z.ZodOptional<z.ZodNumber>;
|
|
1581
|
+
/** The maximum amount of time to wait before retrying the request. */
|
|
1582
|
+
maxTimeoutInMs: z.ZodOptional<z.ZodNumber>;
|
|
1583
|
+
/** Whether to randomize the retry time. */
|
|
1584
|
+
randomize: z.ZodOptional<z.ZodBoolean>;
|
|
1585
|
+
}, "strip", z.ZodTypeAny, {
|
|
1586
|
+
limit?: number | undefined;
|
|
1587
|
+
factor?: number | undefined;
|
|
1588
|
+
minTimeoutInMs?: number | undefined;
|
|
1589
|
+
maxTimeoutInMs?: number | undefined;
|
|
1590
|
+
randomize?: boolean | undefined;
|
|
1591
|
+
}, {
|
|
1592
|
+
limit?: number | undefined;
|
|
1593
|
+
factor?: number | undefined;
|
|
1594
|
+
minTimeoutInMs?: number | undefined;
|
|
1595
|
+
maxTimeoutInMs?: number | undefined;
|
|
1596
|
+
randomize?: boolean | undefined;
|
|
1597
|
+
}>>;
|
|
1598
|
+
/** The icon for the Task, it will appear in the logs.
|
|
1599
|
+
* You can use the name of a company in lowercase, e.g. "github".
|
|
1600
|
+
* Or any icon name that [Font Awesome](https://fontawesome.com/icons) supports. */
|
|
1431
1601
|
icon: z.ZodOptional<z.ZodString>;
|
|
1602
|
+
/** The key for the Task that you want to appear in the logs */
|
|
1432
1603
|
displayKey: z.ZodOptional<z.ZodString>;
|
|
1433
|
-
|
|
1434
|
-
operation: z.ZodOptional<z.ZodEnum<["fetch"]>>;
|
|
1435
|
-
delayUntil: z.ZodOptional<z.ZodDate>;
|
|
1604
|
+
/** A description of the Task */
|
|
1436
1605
|
description: z.ZodOptional<z.ZodString>;
|
|
1606
|
+
/** Properties that are displayed in the logs */
|
|
1437
1607
|
properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1438
1608
|
label: z.ZodString;
|
|
1439
1609
|
text: z.ZodString;
|
|
1440
1610
|
url: z.ZodOptional<z.ZodString>;
|
|
1441
1611
|
}, "strip", z.ZodTypeAny, {
|
|
1442
|
-
url?: string | undefined;
|
|
1443
1612
|
label: string;
|
|
1444
1613
|
text: string;
|
|
1445
|
-
}, {
|
|
1446
1614
|
url?: string | undefined;
|
|
1615
|
+
}, {
|
|
1447
1616
|
label: string;
|
|
1448
1617
|
text: string;
|
|
1618
|
+
url?: string | undefined;
|
|
1449
1619
|
}>, "many">>;
|
|
1620
|
+
/** The input params to the Task, will be displayed in the logs */
|
|
1450
1621
|
params: z.ZodAny;
|
|
1622
|
+
/** The style of the log entry. */
|
|
1623
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
1624
|
+
style: z.ZodEnum<["normal", "minimal"]>;
|
|
1625
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1626
|
+
}, "strip", z.ZodTypeAny, {
|
|
1627
|
+
style: "normal" | "minimal";
|
|
1628
|
+
variant?: string | undefined;
|
|
1629
|
+
}, {
|
|
1630
|
+
style: "normal" | "minimal";
|
|
1631
|
+
variant?: string | undefined;
|
|
1632
|
+
}>>;
|
|
1633
|
+
/** Allows you to link the Integration connection in the logs. This is handled automatically in integrations. */
|
|
1634
|
+
connectionKey: z.ZodOptional<z.ZodString>;
|
|
1635
|
+
/** An operation you want to perform on the Trigger.dev platform, current only "fetch" is supported. If you wish to `fetch` use [`io.backgroundFetch()`](https://trigger.dev/docs/sdk/io/backgroundfetch) instead. */
|
|
1636
|
+
operation: z.ZodOptional<z.ZodEnum<["fetch"]>>;
|
|
1637
|
+
/** A No Operation means that the code won't be executed. This is used internally to implement features like [io.wait()](https://trigger.dev/docs/sdk/io/wait). */
|
|
1638
|
+
noop: z.ZodDefault<z.ZodBoolean>;
|
|
1639
|
+
redact: z.ZodOptional<z.ZodObject<{
|
|
1640
|
+
paths: z.ZodArray<z.ZodString, "many">;
|
|
1641
|
+
}, "strip", z.ZodTypeAny, {
|
|
1642
|
+
paths: string[];
|
|
1643
|
+
}, {
|
|
1644
|
+
paths: string[];
|
|
1645
|
+
}>>;
|
|
1451
1646
|
trigger: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
1452
1647
|
type: z.ZodLiteral<"dynamic">;
|
|
1453
1648
|
id: z.ZodString;
|
|
@@ -1465,13 +1660,13 @@ declare const RunTaskOptionsSchema: z.ZodObject<{
|
|
|
1465
1660
|
text: z.ZodString;
|
|
1466
1661
|
url: z.ZodOptional<z.ZodString>;
|
|
1467
1662
|
}, "strip", z.ZodTypeAny, {
|
|
1468
|
-
url?: string | undefined;
|
|
1469
1663
|
label: string;
|
|
1470
1664
|
text: string;
|
|
1471
|
-
}, {
|
|
1472
1665
|
url?: string | undefined;
|
|
1666
|
+
}, {
|
|
1473
1667
|
label: string;
|
|
1474
1668
|
text: string;
|
|
1669
|
+
url?: string | undefined;
|
|
1475
1670
|
}>, "many">>;
|
|
1476
1671
|
rule: z.ZodObject<{
|
|
1477
1672
|
event: z.ZodString;
|
|
@@ -1479,44 +1674,44 @@ declare const RunTaskOptionsSchema: z.ZodObject<{
|
|
|
1479
1674
|
payload: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
|
|
1480
1675
|
context: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
|
|
1481
1676
|
}, "strip", z.ZodTypeAny, {
|
|
1482
|
-
payload?: EventFilter | undefined;
|
|
1483
|
-
context?: EventFilter | undefined;
|
|
1484
1677
|
event: string;
|
|
1485
1678
|
source: string;
|
|
1486
|
-
}, {
|
|
1487
1679
|
payload?: EventFilter | undefined;
|
|
1488
1680
|
context?: EventFilter | undefined;
|
|
1681
|
+
}, {
|
|
1489
1682
|
event: string;
|
|
1490
1683
|
source: string;
|
|
1684
|
+
payload?: EventFilter | undefined;
|
|
1685
|
+
context?: EventFilter | undefined;
|
|
1491
1686
|
}>;
|
|
1492
1687
|
}, "strip", z.ZodTypeAny, {
|
|
1493
|
-
properties?: {
|
|
1494
|
-
url?: string | undefined;
|
|
1495
|
-
label: string;
|
|
1496
|
-
text: string;
|
|
1497
|
-
}[] | undefined;
|
|
1498
1688
|
type: "static";
|
|
1499
1689
|
title: string;
|
|
1500
1690
|
rule: {
|
|
1501
|
-
payload?: EventFilter | undefined;
|
|
1502
|
-
context?: EventFilter | undefined;
|
|
1503
1691
|
event: string;
|
|
1504
1692
|
source: string;
|
|
1693
|
+
payload?: EventFilter | undefined;
|
|
1694
|
+
context?: EventFilter | undefined;
|
|
1505
1695
|
};
|
|
1506
|
-
}, {
|
|
1507
1696
|
properties?: {
|
|
1508
|
-
url?: string | undefined;
|
|
1509
1697
|
label: string;
|
|
1510
1698
|
text: string;
|
|
1699
|
+
url?: string | undefined;
|
|
1511
1700
|
}[] | undefined;
|
|
1701
|
+
}, {
|
|
1512
1702
|
type: "static";
|
|
1513
1703
|
title: string;
|
|
1514
1704
|
rule: {
|
|
1515
|
-
payload?: EventFilter | undefined;
|
|
1516
|
-
context?: EventFilter | undefined;
|
|
1517
1705
|
event: string;
|
|
1518
1706
|
source: string;
|
|
1707
|
+
payload?: EventFilter | undefined;
|
|
1708
|
+
context?: EventFilter | undefined;
|
|
1519
1709
|
};
|
|
1710
|
+
properties?: {
|
|
1711
|
+
label: string;
|
|
1712
|
+
text: string;
|
|
1713
|
+
url?: string | undefined;
|
|
1714
|
+
}[] | undefined;
|
|
1520
1715
|
}>, z.ZodObject<{
|
|
1521
1716
|
type: z.ZodLiteral<"scheduled">;
|
|
1522
1717
|
schedule: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
@@ -1530,17 +1725,17 @@ declare const RunTaskOptionsSchema: z.ZodObject<{
|
|
|
1530
1725
|
}>;
|
|
1531
1726
|
metadata: z.ZodAny;
|
|
1532
1727
|
}, "strip", z.ZodTypeAny, {
|
|
1533
|
-
metadata?: any;
|
|
1534
1728
|
options: {
|
|
1535
1729
|
seconds: number;
|
|
1536
1730
|
};
|
|
1537
1731
|
type: "interval";
|
|
1538
|
-
}, {
|
|
1539
1732
|
metadata?: any;
|
|
1733
|
+
}, {
|
|
1540
1734
|
options: {
|
|
1541
1735
|
seconds: number;
|
|
1542
1736
|
};
|
|
1543
1737
|
type: "interval";
|
|
1738
|
+
metadata?: any;
|
|
1544
1739
|
}>, z.ZodObject<{
|
|
1545
1740
|
type: z.ZodLiteral<"cron">;
|
|
1546
1741
|
options: z.ZodObject<{
|
|
@@ -1552,139 +1747,114 @@ declare const RunTaskOptionsSchema: z.ZodObject<{
|
|
|
1552
1747
|
}>;
|
|
1553
1748
|
metadata: z.ZodAny;
|
|
1554
1749
|
}, "strip", z.ZodTypeAny, {
|
|
1555
|
-
metadata?: any;
|
|
1556
1750
|
options: {
|
|
1557
1751
|
cron: string;
|
|
1558
1752
|
};
|
|
1559
1753
|
type: "cron";
|
|
1560
|
-
}, {
|
|
1561
1754
|
metadata?: any;
|
|
1755
|
+
}, {
|
|
1562
1756
|
options: {
|
|
1563
1757
|
cron: string;
|
|
1564
1758
|
};
|
|
1565
1759
|
type: "cron";
|
|
1760
|
+
metadata?: any;
|
|
1566
1761
|
}>]>;
|
|
1567
1762
|
}, "strip", z.ZodTypeAny, {
|
|
1568
1763
|
type: "scheduled";
|
|
1569
1764
|
schedule: {
|
|
1570
|
-
metadata?: any;
|
|
1571
1765
|
options: {
|
|
1572
1766
|
cron: string;
|
|
1573
1767
|
};
|
|
1574
1768
|
type: "cron";
|
|
1575
|
-
} | {
|
|
1576
1769
|
metadata?: any;
|
|
1770
|
+
} | {
|
|
1577
1771
|
options: {
|
|
1578
1772
|
seconds: number;
|
|
1579
1773
|
};
|
|
1580
1774
|
type: "interval";
|
|
1775
|
+
metadata?: any;
|
|
1581
1776
|
};
|
|
1582
1777
|
}, {
|
|
1583
1778
|
type: "scheduled";
|
|
1584
1779
|
schedule: {
|
|
1585
|
-
metadata?: any;
|
|
1586
1780
|
options: {
|
|
1587
1781
|
cron: string;
|
|
1588
1782
|
};
|
|
1589
1783
|
type: "cron";
|
|
1590
|
-
} | {
|
|
1591
1784
|
metadata?: any;
|
|
1785
|
+
} | {
|
|
1592
1786
|
options: {
|
|
1593
1787
|
seconds: number;
|
|
1594
1788
|
};
|
|
1595
1789
|
type: "interval";
|
|
1790
|
+
metadata?: any;
|
|
1596
1791
|
};
|
|
1597
1792
|
}>]>>;
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
paths: string[];
|
|
1604
|
-
}>>;
|
|
1605
|
-
connectionKey: z.ZodOptional<z.ZodString>;
|
|
1606
|
-
style: z.ZodOptional<z.ZodObject<{
|
|
1607
|
-
style: z.ZodEnum<["normal", "minimal"]>;
|
|
1608
|
-
variant: z.ZodOptional<z.ZodString>;
|
|
1609
|
-
}, "strip", z.ZodTypeAny, {
|
|
1610
|
-
variant?: string | undefined;
|
|
1611
|
-
style: "normal" | "minimal";
|
|
1612
|
-
}, {
|
|
1613
|
-
variant?: string | undefined;
|
|
1614
|
-
style: "normal" | "minimal";
|
|
1615
|
-
}>>;
|
|
1616
|
-
retry: z.ZodOptional<z.ZodObject<{
|
|
1617
|
-
limit: z.ZodOptional<z.ZodNumber>;
|
|
1618
|
-
factor: z.ZodOptional<z.ZodNumber>;
|
|
1619
|
-
minTimeoutInMs: z.ZodOptional<z.ZodNumber>;
|
|
1620
|
-
maxTimeoutInMs: z.ZodOptional<z.ZodNumber>;
|
|
1621
|
-
randomize: z.ZodOptional<z.ZodBoolean>;
|
|
1622
|
-
}, "strip", z.ZodTypeAny, {
|
|
1623
|
-
limit?: number | undefined;
|
|
1624
|
-
factor?: number | undefined;
|
|
1625
|
-
minTimeoutInMs?: number | undefined;
|
|
1626
|
-
maxTimeoutInMs?: number | undefined;
|
|
1627
|
-
randomize?: boolean | undefined;
|
|
1628
|
-
}, {
|
|
1793
|
+
}, "strip", z.ZodTypeAny, {
|
|
1794
|
+
name: string;
|
|
1795
|
+
noop: boolean;
|
|
1796
|
+
delayUntil?: Date | undefined;
|
|
1797
|
+
retry?: {
|
|
1629
1798
|
limit?: number | undefined;
|
|
1630
1799
|
factor?: number | undefined;
|
|
1631
1800
|
minTimeoutInMs?: number | undefined;
|
|
1632
1801
|
maxTimeoutInMs?: number | undefined;
|
|
1633
1802
|
randomize?: boolean | undefined;
|
|
1634
|
-
}
|
|
1635
|
-
}, "strip", z.ZodTypeAny, {
|
|
1803
|
+
} | undefined;
|
|
1636
1804
|
icon?: string | undefined;
|
|
1637
|
-
|
|
1805
|
+
displayKey?: string | undefined;
|
|
1638
1806
|
description?: string | undefined;
|
|
1639
|
-
params?: any;
|
|
1640
1807
|
properties?: {
|
|
1641
|
-
url?: string | undefined;
|
|
1642
1808
|
label: string;
|
|
1643
1809
|
text: string;
|
|
1810
|
+
url?: string | undefined;
|
|
1644
1811
|
}[] | undefined;
|
|
1812
|
+
params?: any;
|
|
1645
1813
|
style?: {
|
|
1646
|
-
variant?: string | undefined;
|
|
1647
1814
|
style: "normal" | "minimal";
|
|
1815
|
+
variant?: string | undefined;
|
|
1648
1816
|
} | undefined;
|
|
1817
|
+
connectionKey?: string | undefined;
|
|
1649
1818
|
operation?: "fetch" | undefined;
|
|
1819
|
+
redact?: {
|
|
1820
|
+
paths: string[];
|
|
1821
|
+
} | undefined;
|
|
1650
1822
|
trigger?: {
|
|
1651
1823
|
id: string;
|
|
1652
1824
|
type: "dynamic";
|
|
1653
1825
|
} | {
|
|
1654
|
-
properties?: {
|
|
1655
|
-
url?: string | undefined;
|
|
1656
|
-
label: string;
|
|
1657
|
-
text: string;
|
|
1658
|
-
}[] | undefined;
|
|
1659
1826
|
type: "static";
|
|
1660
1827
|
title: string;
|
|
1661
1828
|
rule: {
|
|
1662
|
-
payload?: EventFilter | undefined;
|
|
1663
|
-
context?: EventFilter | undefined;
|
|
1664
1829
|
event: string;
|
|
1665
1830
|
source: string;
|
|
1831
|
+
payload?: EventFilter | undefined;
|
|
1832
|
+
context?: EventFilter | undefined;
|
|
1666
1833
|
};
|
|
1834
|
+
properties?: {
|
|
1835
|
+
label: string;
|
|
1836
|
+
text: string;
|
|
1837
|
+
url?: string | undefined;
|
|
1838
|
+
}[] | undefined;
|
|
1667
1839
|
} | {
|
|
1668
1840
|
type: "scheduled";
|
|
1669
1841
|
schedule: {
|
|
1670
|
-
metadata?: any;
|
|
1671
1842
|
options: {
|
|
1672
1843
|
cron: string;
|
|
1673
1844
|
};
|
|
1674
1845
|
type: "cron";
|
|
1675
|
-
} | {
|
|
1676
1846
|
metadata?: any;
|
|
1847
|
+
} | {
|
|
1677
1848
|
options: {
|
|
1678
1849
|
seconds: number;
|
|
1679
1850
|
};
|
|
1680
1851
|
type: "interval";
|
|
1852
|
+
metadata?: any;
|
|
1681
1853
|
};
|
|
1682
1854
|
} | undefined;
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
} | undefined;
|
|
1687
|
-
connectionKey?: string | undefined;
|
|
1855
|
+
}, {
|
|
1856
|
+
name: string;
|
|
1857
|
+
delayUntil?: Date | undefined;
|
|
1688
1858
|
retry?: {
|
|
1689
1859
|
limit?: number | undefined;
|
|
1690
1860
|
factor?: number | undefined;
|
|
@@ -1692,94 +1862,91 @@ declare const RunTaskOptionsSchema: z.ZodObject<{
|
|
|
1692
1862
|
maxTimeoutInMs?: number | undefined;
|
|
1693
1863
|
randomize?: boolean | undefined;
|
|
1694
1864
|
} | undefined;
|
|
1695
|
-
name: string;
|
|
1696
|
-
noop: boolean;
|
|
1697
|
-
}, {
|
|
1698
1865
|
icon?: string | undefined;
|
|
1699
|
-
|
|
1700
|
-
delayUntil?: Date | undefined;
|
|
1866
|
+
displayKey?: string | undefined;
|
|
1701
1867
|
description?: string | undefined;
|
|
1702
|
-
params?: any;
|
|
1703
1868
|
properties?: {
|
|
1704
|
-
url?: string | undefined;
|
|
1705
1869
|
label: string;
|
|
1706
1870
|
text: string;
|
|
1871
|
+
url?: string | undefined;
|
|
1707
1872
|
}[] | undefined;
|
|
1873
|
+
params?: any;
|
|
1708
1874
|
style?: {
|
|
1709
|
-
variant?: string | undefined;
|
|
1710
1875
|
style: "normal" | "minimal";
|
|
1876
|
+
variant?: string | undefined;
|
|
1711
1877
|
} | undefined;
|
|
1878
|
+
connectionKey?: string | undefined;
|
|
1712
1879
|
operation?: "fetch" | undefined;
|
|
1880
|
+
noop?: boolean | undefined;
|
|
1881
|
+
redact?: {
|
|
1882
|
+
paths: string[];
|
|
1883
|
+
} | undefined;
|
|
1713
1884
|
trigger?: {
|
|
1714
1885
|
id: string;
|
|
1715
1886
|
type: "dynamic";
|
|
1716
1887
|
} | {
|
|
1717
|
-
properties?: {
|
|
1718
|
-
url?: string | undefined;
|
|
1719
|
-
label: string;
|
|
1720
|
-
text: string;
|
|
1721
|
-
}[] | undefined;
|
|
1722
1888
|
type: "static";
|
|
1723
1889
|
title: string;
|
|
1724
1890
|
rule: {
|
|
1725
|
-
payload?: EventFilter | undefined;
|
|
1726
|
-
context?: EventFilter | undefined;
|
|
1727
1891
|
event: string;
|
|
1728
1892
|
source: string;
|
|
1893
|
+
payload?: EventFilter | undefined;
|
|
1894
|
+
context?: EventFilter | undefined;
|
|
1729
1895
|
};
|
|
1896
|
+
properties?: {
|
|
1897
|
+
label: string;
|
|
1898
|
+
text: string;
|
|
1899
|
+
url?: string | undefined;
|
|
1900
|
+
}[] | undefined;
|
|
1730
1901
|
} | {
|
|
1731
1902
|
type: "scheduled";
|
|
1732
1903
|
schedule: {
|
|
1733
|
-
metadata?: any;
|
|
1734
1904
|
options: {
|
|
1735
1905
|
cron: string;
|
|
1736
1906
|
};
|
|
1737
1907
|
type: "cron";
|
|
1738
|
-
} | {
|
|
1739
1908
|
metadata?: any;
|
|
1909
|
+
} | {
|
|
1740
1910
|
options: {
|
|
1741
1911
|
seconds: number;
|
|
1742
1912
|
};
|
|
1743
1913
|
type: "interval";
|
|
1914
|
+
metadata?: any;
|
|
1744
1915
|
};
|
|
1745
1916
|
} | undefined;
|
|
1746
|
-
displayKey?: string | undefined;
|
|
1747
|
-
redact?: {
|
|
1748
|
-
paths: string[];
|
|
1749
|
-
} | undefined;
|
|
1750
|
-
connectionKey?: string | undefined;
|
|
1751
|
-
retry?: {
|
|
1752
|
-
limit?: number | undefined;
|
|
1753
|
-
factor?: number | undefined;
|
|
1754
|
-
minTimeoutInMs?: number | undefined;
|
|
1755
|
-
maxTimeoutInMs?: number | undefined;
|
|
1756
|
-
randomize?: boolean | undefined;
|
|
1757
|
-
} | undefined;
|
|
1758
|
-
name: string;
|
|
1759
1917
|
}>;
|
|
1760
1918
|
type RunTaskOptions = z.input<typeof RunTaskOptionsSchema>;
|
|
1761
|
-
declare const RunTaskBodyInputSchema: z.ZodObject<
|
|
1919
|
+
declare const RunTaskBodyInputSchema: z.ZodObject<{
|
|
1762
1920
|
name: z.ZodString;
|
|
1763
1921
|
icon: z.ZodOptional<z.ZodString>;
|
|
1764
|
-
displayKey: z.ZodOptional<z.ZodString>;
|
|
1765
1922
|
noop: z.ZodDefault<z.ZodBoolean>;
|
|
1766
|
-
operation: z.ZodOptional<z.ZodEnum<["fetch"]>>;
|
|
1767
1923
|
delayUntil: z.ZodOptional<z.ZodDate>;
|
|
1768
1924
|
description: z.ZodOptional<z.ZodString>;
|
|
1925
|
+
params: z.ZodAny;
|
|
1769
1926
|
properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1770
1927
|
label: z.ZodString;
|
|
1771
1928
|
text: z.ZodString;
|
|
1772
1929
|
url: z.ZodOptional<z.ZodString>;
|
|
1773
1930
|
}, "strip", z.ZodTypeAny, {
|
|
1774
|
-
url?: string | undefined;
|
|
1775
1931
|
label: string;
|
|
1776
1932
|
text: string;
|
|
1777
|
-
}, {
|
|
1778
1933
|
url?: string | undefined;
|
|
1934
|
+
}, {
|
|
1779
1935
|
label: string;
|
|
1780
1936
|
text: string;
|
|
1937
|
+
url?: string | undefined;
|
|
1781
1938
|
}>, "many">>;
|
|
1782
|
-
|
|
1939
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
1940
|
+
style: z.ZodEnum<["normal", "minimal"]>;
|
|
1941
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
1942
|
+
}, "strip", z.ZodTypeAny, {
|
|
1943
|
+
style: "normal" | "minimal";
|
|
1944
|
+
variant?: string | undefined;
|
|
1945
|
+
}, {
|
|
1946
|
+
style: "normal" | "minimal";
|
|
1947
|
+
variant?: string | undefined;
|
|
1948
|
+
}>>;
|
|
1949
|
+
operation: z.ZodOptional<z.ZodEnum<["fetch"]>>;
|
|
1783
1950
|
trigger: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
1784
1951
|
type: z.ZodLiteral<"dynamic">;
|
|
1785
1952
|
id: z.ZodString;
|
|
@@ -1797,13 +1964,13 @@ declare const RunTaskBodyInputSchema: z.ZodObject<z.extendShape<{
|
|
|
1797
1964
|
text: z.ZodString;
|
|
1798
1965
|
url: z.ZodOptional<z.ZodString>;
|
|
1799
1966
|
}, "strip", z.ZodTypeAny, {
|
|
1800
|
-
url?: string | undefined;
|
|
1801
1967
|
label: string;
|
|
1802
1968
|
text: string;
|
|
1803
|
-
}, {
|
|
1804
1969
|
url?: string | undefined;
|
|
1970
|
+
}, {
|
|
1805
1971
|
label: string;
|
|
1806
1972
|
text: string;
|
|
1973
|
+
url?: string | undefined;
|
|
1807
1974
|
}>, "many">>;
|
|
1808
1975
|
rule: z.ZodObject<{
|
|
1809
1976
|
event: z.ZodString;
|
|
@@ -1811,44 +1978,44 @@ declare const RunTaskBodyInputSchema: z.ZodObject<z.extendShape<{
|
|
|
1811
1978
|
payload: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
|
|
1812
1979
|
context: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
|
|
1813
1980
|
}, "strip", z.ZodTypeAny, {
|
|
1814
|
-
payload?: EventFilter | undefined;
|
|
1815
|
-
context?: EventFilter | undefined;
|
|
1816
1981
|
event: string;
|
|
1817
1982
|
source: string;
|
|
1818
|
-
}, {
|
|
1819
1983
|
payload?: EventFilter | undefined;
|
|
1820
1984
|
context?: EventFilter | undefined;
|
|
1985
|
+
}, {
|
|
1821
1986
|
event: string;
|
|
1822
1987
|
source: string;
|
|
1988
|
+
payload?: EventFilter | undefined;
|
|
1989
|
+
context?: EventFilter | undefined;
|
|
1823
1990
|
}>;
|
|
1824
1991
|
}, "strip", z.ZodTypeAny, {
|
|
1825
|
-
properties?: {
|
|
1826
|
-
url?: string | undefined;
|
|
1827
|
-
label: string;
|
|
1828
|
-
text: string;
|
|
1829
|
-
}[] | undefined;
|
|
1830
1992
|
type: "static";
|
|
1831
1993
|
title: string;
|
|
1832
1994
|
rule: {
|
|
1833
|
-
payload?: EventFilter | undefined;
|
|
1834
|
-
context?: EventFilter | undefined;
|
|
1835
1995
|
event: string;
|
|
1836
1996
|
source: string;
|
|
1997
|
+
payload?: EventFilter | undefined;
|
|
1998
|
+
context?: EventFilter | undefined;
|
|
1837
1999
|
};
|
|
1838
|
-
}, {
|
|
1839
2000
|
properties?: {
|
|
1840
|
-
url?: string | undefined;
|
|
1841
2001
|
label: string;
|
|
1842
2002
|
text: string;
|
|
2003
|
+
url?: string | undefined;
|
|
1843
2004
|
}[] | undefined;
|
|
2005
|
+
}, {
|
|
1844
2006
|
type: "static";
|
|
1845
2007
|
title: string;
|
|
1846
2008
|
rule: {
|
|
1847
|
-
payload?: EventFilter | undefined;
|
|
1848
|
-
context?: EventFilter | undefined;
|
|
1849
2009
|
event: string;
|
|
1850
2010
|
source: string;
|
|
2011
|
+
payload?: EventFilter | undefined;
|
|
2012
|
+
context?: EventFilter | undefined;
|
|
1851
2013
|
};
|
|
2014
|
+
properties?: {
|
|
2015
|
+
label: string;
|
|
2016
|
+
text: string;
|
|
2017
|
+
url?: string | undefined;
|
|
2018
|
+
}[] | undefined;
|
|
1852
2019
|
}>, z.ZodObject<{
|
|
1853
2020
|
type: z.ZodLiteral<"scheduled">;
|
|
1854
2021
|
schedule: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
@@ -1862,17 +2029,17 @@ declare const RunTaskBodyInputSchema: z.ZodObject<z.extendShape<{
|
|
|
1862
2029
|
}>;
|
|
1863
2030
|
metadata: z.ZodAny;
|
|
1864
2031
|
}, "strip", z.ZodTypeAny, {
|
|
1865
|
-
metadata?: any;
|
|
1866
2032
|
options: {
|
|
1867
2033
|
seconds: number;
|
|
1868
2034
|
};
|
|
1869
2035
|
type: "interval";
|
|
1870
|
-
}, {
|
|
1871
2036
|
metadata?: any;
|
|
2037
|
+
}, {
|
|
1872
2038
|
options: {
|
|
1873
2039
|
seconds: number;
|
|
1874
2040
|
};
|
|
1875
2041
|
type: "interval";
|
|
2042
|
+
metadata?: any;
|
|
1876
2043
|
}>, z.ZodObject<{
|
|
1877
2044
|
type: z.ZodLiteral<"cron">;
|
|
1878
2045
|
options: z.ZodObject<{
|
|
@@ -1884,72 +2051,59 @@ declare const RunTaskBodyInputSchema: z.ZodObject<z.extendShape<{
|
|
|
1884
2051
|
}>;
|
|
1885
2052
|
metadata: z.ZodAny;
|
|
1886
2053
|
}, "strip", z.ZodTypeAny, {
|
|
1887
|
-
metadata?: any;
|
|
1888
2054
|
options: {
|
|
1889
2055
|
cron: string;
|
|
1890
2056
|
};
|
|
1891
2057
|
type: "cron";
|
|
1892
|
-
}, {
|
|
1893
2058
|
metadata?: any;
|
|
2059
|
+
}, {
|
|
1894
2060
|
options: {
|
|
1895
2061
|
cron: string;
|
|
1896
2062
|
};
|
|
1897
2063
|
type: "cron";
|
|
2064
|
+
metadata?: any;
|
|
1898
2065
|
}>]>;
|
|
1899
2066
|
}, "strip", z.ZodTypeAny, {
|
|
1900
2067
|
type: "scheduled";
|
|
1901
2068
|
schedule: {
|
|
1902
|
-
metadata?: any;
|
|
1903
2069
|
options: {
|
|
1904
2070
|
cron: string;
|
|
1905
2071
|
};
|
|
1906
2072
|
type: "cron";
|
|
1907
|
-
} | {
|
|
1908
2073
|
metadata?: any;
|
|
2074
|
+
} | {
|
|
1909
2075
|
options: {
|
|
1910
2076
|
seconds: number;
|
|
1911
2077
|
};
|
|
1912
2078
|
type: "interval";
|
|
2079
|
+
metadata?: any;
|
|
1913
2080
|
};
|
|
1914
2081
|
}, {
|
|
1915
2082
|
type: "scheduled";
|
|
1916
2083
|
schedule: {
|
|
1917
|
-
metadata?: any;
|
|
1918
2084
|
options: {
|
|
1919
2085
|
cron: string;
|
|
1920
2086
|
};
|
|
1921
2087
|
type: "cron";
|
|
1922
|
-
} | {
|
|
1923
2088
|
metadata?: any;
|
|
2089
|
+
} | {
|
|
1924
2090
|
options: {
|
|
1925
2091
|
seconds: number;
|
|
1926
2092
|
};
|
|
1927
2093
|
type: "interval";
|
|
2094
|
+
metadata?: any;
|
|
1928
2095
|
};
|
|
1929
2096
|
}>]>>;
|
|
1930
|
-
redact: z.ZodOptional<z.ZodObject<{
|
|
1931
|
-
paths: z.ZodArray<z.ZodString, "many">;
|
|
1932
|
-
}, "strip", z.ZodTypeAny, {
|
|
1933
|
-
paths: string[];
|
|
1934
|
-
}, {
|
|
1935
|
-
paths: string[];
|
|
1936
|
-
}>>;
|
|
1937
|
-
connectionKey: z.ZodOptional<z.ZodString>;
|
|
1938
|
-
style: z.ZodOptional<z.ZodObject<{
|
|
1939
|
-
style: z.ZodEnum<["normal", "minimal"]>;
|
|
1940
|
-
variant: z.ZodOptional<z.ZodString>;
|
|
1941
|
-
}, "strip", z.ZodTypeAny, {
|
|
1942
|
-
variant?: string | undefined;
|
|
1943
|
-
style: "normal" | "minimal";
|
|
1944
|
-
}, {
|
|
1945
|
-
variant?: string | undefined;
|
|
1946
|
-
style: "normal" | "minimal";
|
|
1947
|
-
}>>;
|
|
1948
2097
|
retry: z.ZodOptional<z.ZodObject<{
|
|
2098
|
+
/** The maximum number of times to retry the request. */
|
|
1949
2099
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
2100
|
+
/** The exponential factor to use when calculating the next retry time. */
|
|
1950
2101
|
factor: z.ZodOptional<z.ZodNumber>;
|
|
2102
|
+
/** The minimum amount of time to wait before retrying the request. */
|
|
1951
2103
|
minTimeoutInMs: z.ZodOptional<z.ZodNumber>;
|
|
2104
|
+
/** The maximum amount of time to wait before retrying the request. */
|
|
1952
2105
|
maxTimeoutInMs: z.ZodOptional<z.ZodNumber>;
|
|
2106
|
+
/** Whether to randomize the retry time. */
|
|
1953
2107
|
randomize: z.ZodOptional<z.ZodBoolean>;
|
|
1954
2108
|
}, "strip", z.ZodTypeAny, {
|
|
1955
2109
|
limit?: number | undefined;
|
|
@@ -1964,63 +2118,68 @@ declare const RunTaskBodyInputSchema: z.ZodObject<z.extendShape<{
|
|
|
1964
2118
|
maxTimeoutInMs?: number | undefined;
|
|
1965
2119
|
randomize?: boolean | undefined;
|
|
1966
2120
|
}>>;
|
|
1967
|
-
|
|
2121
|
+
displayKey: z.ZodOptional<z.ZodString>;
|
|
2122
|
+
connectionKey: z.ZodOptional<z.ZodString>;
|
|
2123
|
+
redact: z.ZodOptional<z.ZodObject<{
|
|
2124
|
+
paths: z.ZodArray<z.ZodString, "many">;
|
|
2125
|
+
}, "strip", z.ZodTypeAny, {
|
|
2126
|
+
paths: string[];
|
|
2127
|
+
}, {
|
|
2128
|
+
paths: string[];
|
|
2129
|
+
}>>;
|
|
1968
2130
|
idempotencyKey: z.ZodString;
|
|
1969
2131
|
parentId: z.ZodOptional<z.ZodString>;
|
|
1970
|
-
}
|
|
2132
|
+
}, "strip", z.ZodTypeAny, {
|
|
2133
|
+
name: string;
|
|
2134
|
+
noop: boolean;
|
|
2135
|
+
idempotencyKey: string;
|
|
1971
2136
|
icon?: string | undefined;
|
|
1972
2137
|
delayUntil?: Date | undefined;
|
|
1973
2138
|
description?: string | undefined;
|
|
1974
2139
|
params?: any;
|
|
1975
2140
|
properties?: {
|
|
1976
|
-
url?: string | undefined;
|
|
1977
2141
|
label: string;
|
|
1978
2142
|
text: string;
|
|
2143
|
+
url?: string | undefined;
|
|
1979
2144
|
}[] | undefined;
|
|
1980
|
-
parentId?: string | undefined;
|
|
1981
2145
|
style?: {
|
|
1982
|
-
variant?: string | undefined;
|
|
1983
2146
|
style: "normal" | "minimal";
|
|
2147
|
+
variant?: string | undefined;
|
|
1984
2148
|
} | undefined;
|
|
1985
2149
|
operation?: "fetch" | undefined;
|
|
1986
2150
|
trigger?: {
|
|
1987
2151
|
id: string;
|
|
1988
2152
|
type: "dynamic";
|
|
1989
2153
|
} | {
|
|
1990
|
-
properties?: {
|
|
1991
|
-
url?: string | undefined;
|
|
1992
|
-
label: string;
|
|
1993
|
-
text: string;
|
|
1994
|
-
}[] | undefined;
|
|
1995
2154
|
type: "static";
|
|
1996
2155
|
title: string;
|
|
1997
2156
|
rule: {
|
|
1998
|
-
payload?: EventFilter | undefined;
|
|
1999
|
-
context?: EventFilter | undefined;
|
|
2000
2157
|
event: string;
|
|
2001
2158
|
source: string;
|
|
2159
|
+
payload?: EventFilter | undefined;
|
|
2160
|
+
context?: EventFilter | undefined;
|
|
2002
2161
|
};
|
|
2162
|
+
properties?: {
|
|
2163
|
+
label: string;
|
|
2164
|
+
text: string;
|
|
2165
|
+
url?: string | undefined;
|
|
2166
|
+
}[] | undefined;
|
|
2003
2167
|
} | {
|
|
2004
2168
|
type: "scheduled";
|
|
2005
2169
|
schedule: {
|
|
2006
|
-
metadata?: any;
|
|
2007
2170
|
options: {
|
|
2008
2171
|
cron: string;
|
|
2009
2172
|
};
|
|
2010
2173
|
type: "cron";
|
|
2011
|
-
} | {
|
|
2012
2174
|
metadata?: any;
|
|
2175
|
+
} | {
|
|
2013
2176
|
options: {
|
|
2014
2177
|
seconds: number;
|
|
2015
2178
|
};
|
|
2016
2179
|
type: "interval";
|
|
2180
|
+
metadata?: any;
|
|
2017
2181
|
};
|
|
2018
2182
|
} | undefined;
|
|
2019
|
-
displayKey?: string | undefined;
|
|
2020
|
-
redact?: {
|
|
2021
|
-
paths: string[];
|
|
2022
|
-
} | undefined;
|
|
2023
|
-
connectionKey?: string | undefined;
|
|
2024
2183
|
retry?: {
|
|
2025
2184
|
limit?: number | undefined;
|
|
2026
2185
|
factor?: number | undefined;
|
|
@@ -2028,64 +2187,63 @@ declare const RunTaskBodyInputSchema: z.ZodObject<z.extendShape<{
|
|
|
2028
2187
|
maxTimeoutInMs?: number | undefined;
|
|
2029
2188
|
randomize?: boolean | undefined;
|
|
2030
2189
|
} | undefined;
|
|
2190
|
+
displayKey?: string | undefined;
|
|
2191
|
+
connectionKey?: string | undefined;
|
|
2192
|
+
redact?: {
|
|
2193
|
+
paths: string[];
|
|
2194
|
+
} | undefined;
|
|
2195
|
+
parentId?: string | undefined;
|
|
2196
|
+
}, {
|
|
2031
2197
|
name: string;
|
|
2032
|
-
noop: boolean;
|
|
2033
2198
|
idempotencyKey: string;
|
|
2034
|
-
}, {
|
|
2035
2199
|
icon?: string | undefined;
|
|
2036
2200
|
noop?: boolean | undefined;
|
|
2037
2201
|
delayUntil?: Date | undefined;
|
|
2038
2202
|
description?: string | undefined;
|
|
2039
2203
|
params?: any;
|
|
2040
2204
|
properties?: {
|
|
2041
|
-
url?: string | undefined;
|
|
2042
2205
|
label: string;
|
|
2043
2206
|
text: string;
|
|
2207
|
+
url?: string | undefined;
|
|
2044
2208
|
}[] | undefined;
|
|
2045
|
-
parentId?: string | undefined;
|
|
2046
2209
|
style?: {
|
|
2047
|
-
variant?: string | undefined;
|
|
2048
2210
|
style: "normal" | "minimal";
|
|
2211
|
+
variant?: string | undefined;
|
|
2049
2212
|
} | undefined;
|
|
2050
2213
|
operation?: "fetch" | undefined;
|
|
2051
2214
|
trigger?: {
|
|
2052
2215
|
id: string;
|
|
2053
2216
|
type: "dynamic";
|
|
2054
2217
|
} | {
|
|
2055
|
-
properties?: {
|
|
2056
|
-
url?: string | undefined;
|
|
2057
|
-
label: string;
|
|
2058
|
-
text: string;
|
|
2059
|
-
}[] | undefined;
|
|
2060
2218
|
type: "static";
|
|
2061
2219
|
title: string;
|
|
2062
2220
|
rule: {
|
|
2063
|
-
payload?: EventFilter | undefined;
|
|
2064
|
-
context?: EventFilter | undefined;
|
|
2065
2221
|
event: string;
|
|
2066
2222
|
source: string;
|
|
2223
|
+
payload?: EventFilter | undefined;
|
|
2224
|
+
context?: EventFilter | undefined;
|
|
2067
2225
|
};
|
|
2226
|
+
properties?: {
|
|
2227
|
+
label: string;
|
|
2228
|
+
text: string;
|
|
2229
|
+
url?: string | undefined;
|
|
2230
|
+
}[] | undefined;
|
|
2068
2231
|
} | {
|
|
2069
2232
|
type: "scheduled";
|
|
2070
2233
|
schedule: {
|
|
2071
|
-
metadata?: any;
|
|
2072
2234
|
options: {
|
|
2073
2235
|
cron: string;
|
|
2074
2236
|
};
|
|
2075
2237
|
type: "cron";
|
|
2076
|
-
} | {
|
|
2077
2238
|
metadata?: any;
|
|
2239
|
+
} | {
|
|
2078
2240
|
options: {
|
|
2079
2241
|
seconds: number;
|
|
2080
2242
|
};
|
|
2081
2243
|
type: "interval";
|
|
2244
|
+
metadata?: any;
|
|
2082
2245
|
};
|
|
2083
2246
|
} | undefined;
|
|
2084
|
-
displayKey?: string | undefined;
|
|
2085
|
-
redact?: {
|
|
2086
|
-
paths: string[];
|
|
2087
|
-
} | undefined;
|
|
2088
|
-
connectionKey?: string | undefined;
|
|
2089
2247
|
retry?: {
|
|
2090
2248
|
limit?: number | undefined;
|
|
2091
2249
|
factor?: number | undefined;
|
|
@@ -2093,270 +2251,82 @@ declare const RunTaskBodyInputSchema: z.ZodObject<z.extendShape<{
|
|
|
2093
2251
|
maxTimeoutInMs?: number | undefined;
|
|
2094
2252
|
randomize?: boolean | undefined;
|
|
2095
2253
|
} | undefined;
|
|
2096
|
-
|
|
2097
|
-
|
|
2254
|
+
displayKey?: string | undefined;
|
|
2255
|
+
connectionKey?: string | undefined;
|
|
2256
|
+
redact?: {
|
|
2257
|
+
paths: string[];
|
|
2258
|
+
} | undefined;
|
|
2259
|
+
parentId?: string | undefined;
|
|
2098
2260
|
}>;
|
|
2099
2261
|
type RunTaskBodyInput = z.infer<typeof RunTaskBodyInputSchema>;
|
|
2100
|
-
declare const CompleteTaskBodyInputSchema: z.ZodObject<
|
|
2101
|
-
name: z.ZodString;
|
|
2102
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
2103
|
-
displayKey: z.ZodOptional<z.ZodString>;
|
|
2104
|
-
noop: z.ZodDefault<z.ZodBoolean>;
|
|
2105
|
-
operation: z.ZodOptional<z.ZodEnum<["fetch"]>>;
|
|
2106
|
-
delayUntil: z.ZodOptional<z.ZodDate>;
|
|
2262
|
+
declare const CompleteTaskBodyInputSchema: z.ZodObject<{
|
|
2107
2263
|
description: z.ZodOptional<z.ZodString>;
|
|
2264
|
+
params: z.ZodAny;
|
|
2108
2265
|
properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2109
2266
|
label: z.ZodString;
|
|
2110
2267
|
text: z.ZodString;
|
|
2111
2268
|
url: z.ZodOptional<z.ZodString>;
|
|
2112
2269
|
}, "strip", z.ZodTypeAny, {
|
|
2113
|
-
url?: string | undefined;
|
|
2114
2270
|
label: string;
|
|
2115
2271
|
text: string;
|
|
2116
|
-
}, {
|
|
2117
2272
|
url?: string | undefined;
|
|
2273
|
+
}, {
|
|
2118
2274
|
label: string;
|
|
2119
2275
|
text: string;
|
|
2276
|
+
url?: string | undefined;
|
|
2120
2277
|
}>, "many">>;
|
|
2121
|
-
params: z.ZodAny;
|
|
2122
|
-
trigger: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
2123
|
-
type: z.ZodLiteral<"dynamic">;
|
|
2124
|
-
id: z.ZodString;
|
|
2125
|
-
}, "strip", z.ZodTypeAny, {
|
|
2126
|
-
id: string;
|
|
2127
|
-
type: "dynamic";
|
|
2128
|
-
}, {
|
|
2129
|
-
id: string;
|
|
2130
|
-
type: "dynamic";
|
|
2131
|
-
}>, z.ZodObject<{
|
|
2132
|
-
type: z.ZodLiteral<"static">;
|
|
2133
|
-
title: z.ZodString;
|
|
2134
|
-
properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2135
|
-
label: z.ZodString;
|
|
2136
|
-
text: z.ZodString;
|
|
2137
|
-
url: z.ZodOptional<z.ZodString>;
|
|
2138
|
-
}, "strip", z.ZodTypeAny, {
|
|
2139
|
-
url?: string | undefined;
|
|
2140
|
-
label: string;
|
|
2141
|
-
text: string;
|
|
2142
|
-
}, {
|
|
2143
|
-
url?: string | undefined;
|
|
2144
|
-
label: string;
|
|
2145
|
-
text: string;
|
|
2146
|
-
}>, "many">>;
|
|
2147
|
-
rule: z.ZodObject<{
|
|
2148
|
-
event: z.ZodString;
|
|
2149
|
-
source: z.ZodString;
|
|
2150
|
-
payload: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
|
|
2151
|
-
context: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
|
|
2152
|
-
}, "strip", z.ZodTypeAny, {
|
|
2153
|
-
payload?: EventFilter | undefined;
|
|
2154
|
-
context?: EventFilter | undefined;
|
|
2155
|
-
event: string;
|
|
2156
|
-
source: string;
|
|
2157
|
-
}, {
|
|
2158
|
-
payload?: EventFilter | undefined;
|
|
2159
|
-
context?: EventFilter | undefined;
|
|
2160
|
-
event: string;
|
|
2161
|
-
source: string;
|
|
2162
|
-
}>;
|
|
2163
|
-
}, "strip", z.ZodTypeAny, {
|
|
2164
|
-
properties?: {
|
|
2165
|
-
url?: string | undefined;
|
|
2166
|
-
label: string;
|
|
2167
|
-
text: string;
|
|
2168
|
-
}[] | undefined;
|
|
2169
|
-
type: "static";
|
|
2170
|
-
title: string;
|
|
2171
|
-
rule: {
|
|
2172
|
-
payload?: EventFilter | undefined;
|
|
2173
|
-
context?: EventFilter | undefined;
|
|
2174
|
-
event: string;
|
|
2175
|
-
source: string;
|
|
2176
|
-
};
|
|
2177
|
-
}, {
|
|
2178
|
-
properties?: {
|
|
2179
|
-
url?: string | undefined;
|
|
2180
|
-
label: string;
|
|
2181
|
-
text: string;
|
|
2182
|
-
}[] | undefined;
|
|
2183
|
-
type: "static";
|
|
2184
|
-
title: string;
|
|
2185
|
-
rule: {
|
|
2186
|
-
payload?: EventFilter | undefined;
|
|
2187
|
-
context?: EventFilter | undefined;
|
|
2188
|
-
event: string;
|
|
2189
|
-
source: string;
|
|
2190
|
-
};
|
|
2191
|
-
}>, z.ZodObject<{
|
|
2192
|
-
type: z.ZodLiteral<"scheduled">;
|
|
2193
|
-
schedule: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
2194
|
-
type: z.ZodLiteral<"interval">;
|
|
2195
|
-
options: z.ZodObject<{
|
|
2196
|
-
seconds: z.ZodNumber;
|
|
2197
|
-
}, "strip", z.ZodTypeAny, {
|
|
2198
|
-
seconds: number;
|
|
2199
|
-
}, {
|
|
2200
|
-
seconds: number;
|
|
2201
|
-
}>;
|
|
2202
|
-
metadata: z.ZodAny;
|
|
2203
|
-
}, "strip", z.ZodTypeAny, {
|
|
2204
|
-
metadata?: any;
|
|
2205
|
-
options: {
|
|
2206
|
-
seconds: number;
|
|
2207
|
-
};
|
|
2208
|
-
type: "interval";
|
|
2209
|
-
}, {
|
|
2210
|
-
metadata?: any;
|
|
2211
|
-
options: {
|
|
2212
|
-
seconds: number;
|
|
2213
|
-
};
|
|
2214
|
-
type: "interval";
|
|
2215
|
-
}>, z.ZodObject<{
|
|
2216
|
-
type: z.ZodLiteral<"cron">;
|
|
2217
|
-
options: z.ZodObject<{
|
|
2218
|
-
cron: z.ZodString;
|
|
2219
|
-
}, "strip", z.ZodTypeAny, {
|
|
2220
|
-
cron: string;
|
|
2221
|
-
}, {
|
|
2222
|
-
cron: string;
|
|
2223
|
-
}>;
|
|
2224
|
-
metadata: z.ZodAny;
|
|
2225
|
-
}, "strip", z.ZodTypeAny, {
|
|
2226
|
-
metadata?: any;
|
|
2227
|
-
options: {
|
|
2228
|
-
cron: string;
|
|
2229
|
-
};
|
|
2230
|
-
type: "cron";
|
|
2231
|
-
}, {
|
|
2232
|
-
metadata?: any;
|
|
2233
|
-
options: {
|
|
2234
|
-
cron: string;
|
|
2235
|
-
};
|
|
2236
|
-
type: "cron";
|
|
2237
|
-
}>]>;
|
|
2238
|
-
}, "strip", z.ZodTypeAny, {
|
|
2239
|
-
type: "scheduled";
|
|
2240
|
-
schedule: {
|
|
2241
|
-
metadata?: any;
|
|
2242
|
-
options: {
|
|
2243
|
-
cron: string;
|
|
2244
|
-
};
|
|
2245
|
-
type: "cron";
|
|
2246
|
-
} | {
|
|
2247
|
-
metadata?: any;
|
|
2248
|
-
options: {
|
|
2249
|
-
seconds: number;
|
|
2250
|
-
};
|
|
2251
|
-
type: "interval";
|
|
2252
|
-
};
|
|
2253
|
-
}, {
|
|
2254
|
-
type: "scheduled";
|
|
2255
|
-
schedule: {
|
|
2256
|
-
metadata?: any;
|
|
2257
|
-
options: {
|
|
2258
|
-
cron: string;
|
|
2259
|
-
};
|
|
2260
|
-
type: "cron";
|
|
2261
|
-
} | {
|
|
2262
|
-
metadata?: any;
|
|
2263
|
-
options: {
|
|
2264
|
-
seconds: number;
|
|
2265
|
-
};
|
|
2266
|
-
type: "interval";
|
|
2267
|
-
};
|
|
2268
|
-
}>]>>;
|
|
2269
|
-
redact: z.ZodOptional<z.ZodObject<{
|
|
2270
|
-
paths: z.ZodArray<z.ZodString, "many">;
|
|
2271
|
-
}, "strip", z.ZodTypeAny, {
|
|
2272
|
-
paths: string[];
|
|
2273
|
-
}, {
|
|
2274
|
-
paths: string[];
|
|
2275
|
-
}>>;
|
|
2276
|
-
connectionKey: z.ZodOptional<z.ZodString>;
|
|
2277
|
-
style: z.ZodOptional<z.ZodObject<{
|
|
2278
|
-
style: z.ZodEnum<["normal", "minimal"]>;
|
|
2279
|
-
variant: z.ZodOptional<z.ZodString>;
|
|
2280
|
-
}, "strip", z.ZodTypeAny, {
|
|
2281
|
-
variant?: string | undefined;
|
|
2282
|
-
style: "normal" | "minimal";
|
|
2283
|
-
}, {
|
|
2284
|
-
variant?: string | undefined;
|
|
2285
|
-
style: "normal" | "minimal";
|
|
2286
|
-
}>>;
|
|
2287
|
-
retry: z.ZodOptional<z.ZodObject<{
|
|
2288
|
-
limit: z.ZodOptional<z.ZodNumber>;
|
|
2289
|
-
factor: z.ZodOptional<z.ZodNumber>;
|
|
2290
|
-
minTimeoutInMs: z.ZodOptional<z.ZodNumber>;
|
|
2291
|
-
maxTimeoutInMs: z.ZodOptional<z.ZodNumber>;
|
|
2292
|
-
randomize: z.ZodOptional<z.ZodBoolean>;
|
|
2293
|
-
}, "strip", z.ZodTypeAny, {
|
|
2294
|
-
limit?: number | undefined;
|
|
2295
|
-
factor?: number | undefined;
|
|
2296
|
-
minTimeoutInMs?: number | undefined;
|
|
2297
|
-
maxTimeoutInMs?: number | undefined;
|
|
2298
|
-
randomize?: boolean | undefined;
|
|
2299
|
-
}, {
|
|
2300
|
-
limit?: number | undefined;
|
|
2301
|
-
factor?: number | undefined;
|
|
2302
|
-
minTimeoutInMs?: number | undefined;
|
|
2303
|
-
maxTimeoutInMs?: number | undefined;
|
|
2304
|
-
randomize?: boolean | undefined;
|
|
2305
|
-
}>>;
|
|
2306
|
-
}, {
|
|
2307
|
-
idempotencyKey: z.ZodString;
|
|
2308
|
-
parentId: z.ZodOptional<z.ZodString>;
|
|
2309
|
-
}>, "description" | "params" | "properties">, {
|
|
2310
2278
|
output: z.ZodEffects<z.ZodOptional<z.ZodType<SerializableJson, z.ZodTypeDef, SerializableJson>>, string | number | boolean | {
|
|
2311
2279
|
[key: string]: DeserializedJson;
|
|
2312
2280
|
} | DeserializedJson[] | null, SerializableJson>;
|
|
2313
|
-
}
|
|
2281
|
+
}, "strip", z.ZodTypeAny, {
|
|
2282
|
+
output: ((string | number | boolean | {
|
|
2283
|
+
[key: string]: DeserializedJson;
|
|
2284
|
+
} | DeserializedJson[]) & (string | number | boolean | {
|
|
2285
|
+
[key: string]: DeserializedJson;
|
|
2286
|
+
} | DeserializedJson[] | undefined)) | null;
|
|
2314
2287
|
description?: string | undefined;
|
|
2315
2288
|
params?: any;
|
|
2316
2289
|
properties?: {
|
|
2317
|
-
url?: string | undefined;
|
|
2318
2290
|
label: string;
|
|
2319
2291
|
text: string;
|
|
2292
|
+
url?: string | undefined;
|
|
2320
2293
|
}[] | undefined;
|
|
2321
|
-
output: string | number | boolean | {
|
|
2322
|
-
[key: string]: DeserializedJson;
|
|
2323
|
-
} | DeserializedJson[] | null;
|
|
2324
2294
|
}, {
|
|
2325
2295
|
description?: string | undefined;
|
|
2326
2296
|
params?: any;
|
|
2327
2297
|
properties?: {
|
|
2328
|
-
url?: string | undefined;
|
|
2329
2298
|
label: string;
|
|
2330
2299
|
text: string;
|
|
2300
|
+
url?: string | undefined;
|
|
2331
2301
|
}[] | undefined;
|
|
2332
2302
|
output?: SerializableJson;
|
|
2333
2303
|
}>;
|
|
2334
|
-
type CompleteTaskBodyInput = z.input<typeof CompleteTaskBodyInputSchema
|
|
2304
|
+
type CompleteTaskBodyInput = Prettify<z.input<typeof CompleteTaskBodyInputSchema>>;
|
|
2335
2305
|
declare const FailTaskBodyInputSchema: z.ZodObject<{
|
|
2336
2306
|
error: z.ZodObject<{
|
|
2337
2307
|
message: z.ZodString;
|
|
2338
2308
|
name: z.ZodOptional<z.ZodString>;
|
|
2339
2309
|
stack: z.ZodOptional<z.ZodString>;
|
|
2340
2310
|
}, "strip", z.ZodTypeAny, {
|
|
2311
|
+
message: string;
|
|
2341
2312
|
name?: string | undefined;
|
|
2342
2313
|
stack?: string | undefined;
|
|
2343
|
-
message: string;
|
|
2344
2314
|
}, {
|
|
2315
|
+
message: string;
|
|
2345
2316
|
name?: string | undefined;
|
|
2346
2317
|
stack?: string | undefined;
|
|
2347
|
-
message: string;
|
|
2348
2318
|
}>;
|
|
2349
2319
|
}, "strip", z.ZodTypeAny, {
|
|
2350
2320
|
error: {
|
|
2321
|
+
message: string;
|
|
2351
2322
|
name?: string | undefined;
|
|
2352
2323
|
stack?: string | undefined;
|
|
2353
|
-
message: string;
|
|
2354
2324
|
};
|
|
2355
2325
|
}, {
|
|
2356
2326
|
error: {
|
|
2327
|
+
message: string;
|
|
2357
2328
|
name?: string | undefined;
|
|
2358
2329
|
stack?: string | undefined;
|
|
2359
|
-
message: string;
|
|
2360
2330
|
};
|
|
2361
2331
|
}>;
|
|
2362
2332
|
type FailTaskBodyInput = z.infer<typeof FailTaskBodyInputSchema>;
|
|
@@ -2367,17 +2337,17 @@ declare const NormalizedRequestSchema: z.ZodObject<{
|
|
|
2367
2337
|
url: z.ZodString;
|
|
2368
2338
|
body: z.ZodAny;
|
|
2369
2339
|
}, "strip", z.ZodTypeAny, {
|
|
2370
|
-
body?: any;
|
|
2371
2340
|
url: string;
|
|
2372
2341
|
method: string;
|
|
2373
2342
|
headers: Record<string, string>;
|
|
2374
2343
|
query: Record<string, string>;
|
|
2375
|
-
}, {
|
|
2376
2344
|
body?: any;
|
|
2345
|
+
}, {
|
|
2377
2346
|
url: string;
|
|
2378
2347
|
method: string;
|
|
2379
2348
|
headers: Record<string, string>;
|
|
2380
2349
|
query: Record<string, string>;
|
|
2350
|
+
body?: any;
|
|
2381
2351
|
}>;
|
|
2382
2352
|
type NormalizedRequest = z.infer<typeof NormalizedRequestSchema>;
|
|
2383
2353
|
declare const NormalizedResponseSchema: z.ZodObject<{
|
|
@@ -2385,13 +2355,13 @@ declare const NormalizedResponseSchema: z.ZodObject<{
|
|
|
2385
2355
|
body: z.ZodAny;
|
|
2386
2356
|
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
2387
2357
|
}, "strip", z.ZodTypeAny, {
|
|
2388
|
-
headers?: Record<string, string> | undefined;
|
|
2389
|
-
body?: any;
|
|
2390
2358
|
status: number;
|
|
2391
|
-
}, {
|
|
2392
|
-
headers?: Record<string, string> | undefined;
|
|
2393
2359
|
body?: any;
|
|
2360
|
+
headers?: Record<string, string> | undefined;
|
|
2361
|
+
}, {
|
|
2394
2362
|
status: number;
|
|
2363
|
+
body?: any;
|
|
2364
|
+
headers?: Record<string, string> | undefined;
|
|
2395
2365
|
}>;
|
|
2396
2366
|
type NormalizedResponse = z.infer<typeof NormalizedResponseSchema>;
|
|
2397
2367
|
declare const RegisterTriggerBodySchema: z.ZodObject<{
|
|
@@ -2401,15 +2371,15 @@ declare const RegisterTriggerBodySchema: z.ZodObject<{
|
|
|
2401
2371
|
payload: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
|
|
2402
2372
|
context: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
|
|
2403
2373
|
}, "strip", z.ZodTypeAny, {
|
|
2404
|
-
payload?: EventFilter | undefined;
|
|
2405
|
-
context?: EventFilter | undefined;
|
|
2406
2374
|
event: string;
|
|
2407
2375
|
source: string;
|
|
2408
|
-
}, {
|
|
2409
2376
|
payload?: EventFilter | undefined;
|
|
2410
2377
|
context?: EventFilter | undefined;
|
|
2378
|
+
}, {
|
|
2411
2379
|
event: string;
|
|
2412
2380
|
source: string;
|
|
2381
|
+
payload?: EventFilter | undefined;
|
|
2382
|
+
context?: EventFilter | undefined;
|
|
2413
2383
|
}>;
|
|
2414
2384
|
source: z.ZodObject<{
|
|
2415
2385
|
channel: z.ZodEnum<["HTTP", "SQS", "SMTP"]>;
|
|
@@ -2420,107 +2390,133 @@ declare const RegisterTriggerBodySchema: z.ZodObject<{
|
|
|
2420
2390
|
name: z.ZodString;
|
|
2421
2391
|
instructions: z.ZodOptional<z.ZodString>;
|
|
2422
2392
|
}, "strip", z.ZodTypeAny, {
|
|
2423
|
-
instructions?: string | undefined;
|
|
2424
2393
|
id: string;
|
|
2425
2394
|
name: string;
|
|
2426
|
-
}, {
|
|
2427
2395
|
instructions?: string | undefined;
|
|
2396
|
+
}, {
|
|
2428
2397
|
id: string;
|
|
2429
2398
|
name: string;
|
|
2399
|
+
instructions?: string | undefined;
|
|
2430
2400
|
}>;
|
|
2431
2401
|
authSource: z.ZodEnum<["HOSTED", "LOCAL"]>;
|
|
2432
2402
|
}, "strip", z.ZodTypeAny, {
|
|
2433
2403
|
id: string;
|
|
2434
2404
|
metadata: {
|
|
2435
|
-
instructions?: string | undefined;
|
|
2436
2405
|
id: string;
|
|
2437
2406
|
name: string;
|
|
2407
|
+
instructions?: string | undefined;
|
|
2438
2408
|
};
|
|
2439
2409
|
authSource: "HOSTED" | "LOCAL";
|
|
2440
2410
|
}, {
|
|
2441
2411
|
id: string;
|
|
2442
2412
|
metadata: {
|
|
2443
|
-
instructions?: string | undefined;
|
|
2444
2413
|
id: string;
|
|
2445
2414
|
name: string;
|
|
2415
|
+
instructions?: string | undefined;
|
|
2446
2416
|
};
|
|
2447
2417
|
authSource: "HOSTED" | "LOCAL";
|
|
2448
2418
|
}>;
|
|
2449
2419
|
key: z.ZodString;
|
|
2450
2420
|
params: z.ZodAny;
|
|
2451
2421
|
events: z.ZodArray<z.ZodString, "many">;
|
|
2422
|
+
registerSourceJob: z.ZodOptional<z.ZodObject<{
|
|
2423
|
+
id: z.ZodString;
|
|
2424
|
+
version: z.ZodString;
|
|
2425
|
+
}, "strip", z.ZodTypeAny, {
|
|
2426
|
+
id: string;
|
|
2427
|
+
version: string;
|
|
2428
|
+
}, {
|
|
2429
|
+
id: string;
|
|
2430
|
+
version: string;
|
|
2431
|
+
}>>;
|
|
2452
2432
|
}, "strip", z.ZodTypeAny, {
|
|
2453
|
-
params?: any;
|
|
2454
2433
|
key: string;
|
|
2455
2434
|
channel: "HTTP" | "SMTP" | "SQS";
|
|
2456
2435
|
events: string[];
|
|
2457
2436
|
integration: {
|
|
2458
2437
|
id: string;
|
|
2459
2438
|
metadata: {
|
|
2460
|
-
instructions?: string | undefined;
|
|
2461
2439
|
id: string;
|
|
2462
2440
|
name: string;
|
|
2441
|
+
instructions?: string | undefined;
|
|
2463
2442
|
};
|
|
2464
2443
|
authSource: "HOSTED" | "LOCAL";
|
|
2465
2444
|
};
|
|
2466
|
-
}, {
|
|
2467
2445
|
params?: any;
|
|
2446
|
+
registerSourceJob?: {
|
|
2447
|
+
id: string;
|
|
2448
|
+
version: string;
|
|
2449
|
+
} | undefined;
|
|
2450
|
+
}, {
|
|
2468
2451
|
key: string;
|
|
2469
2452
|
channel: "HTTP" | "SMTP" | "SQS";
|
|
2470
2453
|
events: string[];
|
|
2471
2454
|
integration: {
|
|
2472
2455
|
id: string;
|
|
2473
2456
|
metadata: {
|
|
2474
|
-
instructions?: string | undefined;
|
|
2475
2457
|
id: string;
|
|
2476
2458
|
name: string;
|
|
2459
|
+
instructions?: string | undefined;
|
|
2477
2460
|
};
|
|
2478
2461
|
authSource: "HOSTED" | "LOCAL";
|
|
2479
2462
|
};
|
|
2463
|
+
params?: any;
|
|
2464
|
+
registerSourceJob?: {
|
|
2465
|
+
id: string;
|
|
2466
|
+
version: string;
|
|
2467
|
+
} | undefined;
|
|
2480
2468
|
}>;
|
|
2481
2469
|
}, "strip", z.ZodTypeAny, {
|
|
2482
2470
|
source: {
|
|
2483
|
-
params?: any;
|
|
2484
2471
|
key: string;
|
|
2485
2472
|
channel: "HTTP" | "SMTP" | "SQS";
|
|
2486
2473
|
events: string[];
|
|
2487
2474
|
integration: {
|
|
2488
2475
|
id: string;
|
|
2489
2476
|
metadata: {
|
|
2490
|
-
instructions?: string | undefined;
|
|
2491
2477
|
id: string;
|
|
2492
2478
|
name: string;
|
|
2479
|
+
instructions?: string | undefined;
|
|
2493
2480
|
};
|
|
2494
2481
|
authSource: "HOSTED" | "LOCAL";
|
|
2495
2482
|
};
|
|
2483
|
+
params?: any;
|
|
2484
|
+
registerSourceJob?: {
|
|
2485
|
+
id: string;
|
|
2486
|
+
version: string;
|
|
2487
|
+
} | undefined;
|
|
2496
2488
|
};
|
|
2497
2489
|
rule: {
|
|
2498
|
-
payload?: EventFilter | undefined;
|
|
2499
|
-
context?: EventFilter | undefined;
|
|
2500
2490
|
event: string;
|
|
2501
2491
|
source: string;
|
|
2492
|
+
payload?: EventFilter | undefined;
|
|
2493
|
+
context?: EventFilter | undefined;
|
|
2502
2494
|
};
|
|
2503
2495
|
}, {
|
|
2504
2496
|
source: {
|
|
2505
|
-
params?: any;
|
|
2506
2497
|
key: string;
|
|
2507
2498
|
channel: "HTTP" | "SMTP" | "SQS";
|
|
2508
2499
|
events: string[];
|
|
2509
2500
|
integration: {
|
|
2510
2501
|
id: string;
|
|
2511
2502
|
metadata: {
|
|
2512
|
-
instructions?: string | undefined;
|
|
2513
2503
|
id: string;
|
|
2514
2504
|
name: string;
|
|
2505
|
+
instructions?: string | undefined;
|
|
2515
2506
|
};
|
|
2516
2507
|
authSource: "HOSTED" | "LOCAL";
|
|
2517
2508
|
};
|
|
2509
|
+
params?: any;
|
|
2510
|
+
registerSourceJob?: {
|
|
2511
|
+
id: string;
|
|
2512
|
+
version: string;
|
|
2513
|
+
} | undefined;
|
|
2518
2514
|
};
|
|
2519
2515
|
rule: {
|
|
2520
|
-
payload?: EventFilter | undefined;
|
|
2521
|
-
context?: EventFilter | undefined;
|
|
2522
2516
|
event: string;
|
|
2523
2517
|
source: string;
|
|
2518
|
+
payload?: EventFilter | undefined;
|
|
2519
|
+
context?: EventFilter | undefined;
|
|
2524
2520
|
};
|
|
2525
2521
|
}>;
|
|
2526
2522
|
type RegisterTriggerBody = z.infer<typeof RegisterTriggerBodySchema>;
|
|
@@ -2542,13 +2538,13 @@ declare const TriggerMetadataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
|
|
|
2542
2538
|
text: z.ZodString;
|
|
2543
2539
|
url: z.ZodOptional<z.ZodString>;
|
|
2544
2540
|
}, "strip", z.ZodTypeAny, {
|
|
2545
|
-
url?: string | undefined;
|
|
2546
2541
|
label: string;
|
|
2547
2542
|
text: string;
|
|
2548
|
-
}, {
|
|
2549
2543
|
url?: string | undefined;
|
|
2544
|
+
}, {
|
|
2550
2545
|
label: string;
|
|
2551
2546
|
text: string;
|
|
2547
|
+
url?: string | undefined;
|
|
2552
2548
|
}>, "many">>;
|
|
2553
2549
|
rule: z.ZodObject<{
|
|
2554
2550
|
event: z.ZodString;
|
|
@@ -2556,44 +2552,44 @@ declare const TriggerMetadataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
|
|
|
2556
2552
|
payload: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
|
|
2557
2553
|
context: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
|
|
2558
2554
|
}, "strip", z.ZodTypeAny, {
|
|
2559
|
-
payload?: EventFilter | undefined;
|
|
2560
|
-
context?: EventFilter | undefined;
|
|
2561
2555
|
event: string;
|
|
2562
2556
|
source: string;
|
|
2563
|
-
}, {
|
|
2564
2557
|
payload?: EventFilter | undefined;
|
|
2565
2558
|
context?: EventFilter | undefined;
|
|
2559
|
+
}, {
|
|
2566
2560
|
event: string;
|
|
2567
2561
|
source: string;
|
|
2562
|
+
payload?: EventFilter | undefined;
|
|
2563
|
+
context?: EventFilter | undefined;
|
|
2568
2564
|
}>;
|
|
2569
2565
|
}, "strip", z.ZodTypeAny, {
|
|
2570
|
-
properties?: {
|
|
2571
|
-
url?: string | undefined;
|
|
2572
|
-
label: string;
|
|
2573
|
-
text: string;
|
|
2574
|
-
}[] | undefined;
|
|
2575
2566
|
type: "static";
|
|
2576
2567
|
title: string;
|
|
2577
2568
|
rule: {
|
|
2578
|
-
payload?: EventFilter | undefined;
|
|
2579
|
-
context?: EventFilter | undefined;
|
|
2580
2569
|
event: string;
|
|
2581
2570
|
source: string;
|
|
2571
|
+
payload?: EventFilter | undefined;
|
|
2572
|
+
context?: EventFilter | undefined;
|
|
2582
2573
|
};
|
|
2583
|
-
}, {
|
|
2584
2574
|
properties?: {
|
|
2585
|
-
url?: string | undefined;
|
|
2586
2575
|
label: string;
|
|
2587
2576
|
text: string;
|
|
2577
|
+
url?: string | undefined;
|
|
2588
2578
|
}[] | undefined;
|
|
2579
|
+
}, {
|
|
2589
2580
|
type: "static";
|
|
2590
2581
|
title: string;
|
|
2591
2582
|
rule: {
|
|
2592
|
-
payload?: EventFilter | undefined;
|
|
2593
|
-
context?: EventFilter | undefined;
|
|
2594
2583
|
event: string;
|
|
2595
2584
|
source: string;
|
|
2585
|
+
payload?: EventFilter | undefined;
|
|
2586
|
+
context?: EventFilter | undefined;
|
|
2596
2587
|
};
|
|
2588
|
+
properties?: {
|
|
2589
|
+
label: string;
|
|
2590
|
+
text: string;
|
|
2591
|
+
url?: string | undefined;
|
|
2592
|
+
}[] | undefined;
|
|
2597
2593
|
}>, z.ZodObject<{
|
|
2598
2594
|
type: z.ZodLiteral<"scheduled">;
|
|
2599
2595
|
schedule: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
@@ -2607,17 +2603,17 @@ declare const TriggerMetadataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
|
|
|
2607
2603
|
}>;
|
|
2608
2604
|
metadata: z.ZodAny;
|
|
2609
2605
|
}, "strip", z.ZodTypeAny, {
|
|
2610
|
-
metadata?: any;
|
|
2611
2606
|
options: {
|
|
2612
2607
|
seconds: number;
|
|
2613
2608
|
};
|
|
2614
2609
|
type: "interval";
|
|
2615
|
-
}, {
|
|
2616
2610
|
metadata?: any;
|
|
2611
|
+
}, {
|
|
2617
2612
|
options: {
|
|
2618
2613
|
seconds: number;
|
|
2619
2614
|
};
|
|
2620
2615
|
type: "interval";
|
|
2616
|
+
metadata?: any;
|
|
2621
2617
|
}>, z.ZodObject<{
|
|
2622
2618
|
type: z.ZodLiteral<"cron">;
|
|
2623
2619
|
options: z.ZodObject<{
|
|
@@ -2629,47 +2625,47 @@ declare const TriggerMetadataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
|
|
|
2629
2625
|
}>;
|
|
2630
2626
|
metadata: z.ZodAny;
|
|
2631
2627
|
}, "strip", z.ZodTypeAny, {
|
|
2632
|
-
metadata?: any;
|
|
2633
2628
|
options: {
|
|
2634
2629
|
cron: string;
|
|
2635
2630
|
};
|
|
2636
2631
|
type: "cron";
|
|
2637
|
-
}, {
|
|
2638
2632
|
metadata?: any;
|
|
2633
|
+
}, {
|
|
2639
2634
|
options: {
|
|
2640
2635
|
cron: string;
|
|
2641
2636
|
};
|
|
2642
2637
|
type: "cron";
|
|
2638
|
+
metadata?: any;
|
|
2643
2639
|
}>]>;
|
|
2644
2640
|
}, "strip", z.ZodTypeAny, {
|
|
2645
2641
|
type: "scheduled";
|
|
2646
2642
|
schedule: {
|
|
2647
|
-
metadata?: any;
|
|
2648
2643
|
options: {
|
|
2649
2644
|
cron: string;
|
|
2650
2645
|
};
|
|
2651
2646
|
type: "cron";
|
|
2652
|
-
} | {
|
|
2653
2647
|
metadata?: any;
|
|
2648
|
+
} | {
|
|
2654
2649
|
options: {
|
|
2655
2650
|
seconds: number;
|
|
2656
2651
|
};
|
|
2657
2652
|
type: "interval";
|
|
2653
|
+
metadata?: any;
|
|
2658
2654
|
};
|
|
2659
2655
|
}, {
|
|
2660
2656
|
type: "scheduled";
|
|
2661
2657
|
schedule: {
|
|
2662
|
-
metadata?: any;
|
|
2663
2658
|
options: {
|
|
2664
2659
|
cron: string;
|
|
2665
2660
|
};
|
|
2666
2661
|
type: "cron";
|
|
2667
|
-
} | {
|
|
2668
2662
|
metadata?: any;
|
|
2663
|
+
} | {
|
|
2669
2664
|
options: {
|
|
2670
2665
|
seconds: number;
|
|
2671
2666
|
};
|
|
2672
2667
|
type: "interval";
|
|
2668
|
+
metadata?: any;
|
|
2673
2669
|
};
|
|
2674
2670
|
}>]>;
|
|
2675
2671
|
type TriggerMetadata = z.infer<typeof TriggerMetadataSchema>;
|
|
@@ -2679,28 +2675,32 @@ declare const ErrorWithStackSchema: z.ZodObject<{
|
|
|
2679
2675
|
name: z.ZodOptional<z.ZodString>;
|
|
2680
2676
|
stack: z.ZodOptional<z.ZodString>;
|
|
2681
2677
|
}, "strip", z.ZodTypeAny, {
|
|
2678
|
+
message: string;
|
|
2682
2679
|
name?: string | undefined;
|
|
2683
2680
|
stack?: string | undefined;
|
|
2684
|
-
message: string;
|
|
2685
2681
|
}, {
|
|
2682
|
+
message: string;
|
|
2686
2683
|
name?: string | undefined;
|
|
2687
2684
|
stack?: string | undefined;
|
|
2688
|
-
message: string;
|
|
2689
2685
|
}>;
|
|
2690
2686
|
type ErrorWithStack = z.infer<typeof ErrorWithStackSchema>;
|
|
2691
2687
|
|
|
2688
|
+
/** A property that is displayed in the logs */
|
|
2692
2689
|
declare const DisplayPropertySchema: z.ZodObject<{
|
|
2690
|
+
/** The label for the property */
|
|
2693
2691
|
label: z.ZodString;
|
|
2692
|
+
/** The value of the property */
|
|
2694
2693
|
text: z.ZodString;
|
|
2694
|
+
/** The URL to link to when the property is clicked */
|
|
2695
2695
|
url: z.ZodOptional<z.ZodString>;
|
|
2696
2696
|
}, "strip", z.ZodTypeAny, {
|
|
2697
|
-
url?: string | undefined;
|
|
2698
2697
|
label: string;
|
|
2699
2698
|
text: string;
|
|
2700
|
-
}, {
|
|
2701
2699
|
url?: string | undefined;
|
|
2700
|
+
}, {
|
|
2702
2701
|
label: string;
|
|
2703
2702
|
text: string;
|
|
2703
|
+
url?: string | undefined;
|
|
2704
2704
|
}>;
|
|
2705
2705
|
type DisplayProperty = z.infer<typeof DisplayPropertySchema>;
|
|
2706
2706
|
|
|
@@ -2710,15 +2710,15 @@ declare const ConnectionAuthSchema: z.ZodObject<{
|
|
|
2710
2710
|
scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2711
2711
|
additionalFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
2712
2712
|
}, "strip", z.ZodTypeAny, {
|
|
2713
|
-
scopes?: string[] | undefined;
|
|
2714
|
-
additionalFields?: Record<string, string> | undefined;
|
|
2715
2713
|
type: "oauth2";
|
|
2716
2714
|
accessToken: string;
|
|
2717
|
-
}, {
|
|
2718
2715
|
scopes?: string[] | undefined;
|
|
2719
2716
|
additionalFields?: Record<string, string> | undefined;
|
|
2717
|
+
}, {
|
|
2720
2718
|
type: "oauth2";
|
|
2721
2719
|
accessToken: string;
|
|
2720
|
+
scopes?: string[] | undefined;
|
|
2721
|
+
additionalFields?: Record<string, string> | undefined;
|
|
2722
2722
|
}>;
|
|
2723
2723
|
type ConnectionAuth = z.infer<typeof ConnectionAuthSchema>;
|
|
2724
2724
|
declare const IntegrationMetadataSchema: z.ZodObject<{
|
|
@@ -2726,13 +2726,13 @@ declare const IntegrationMetadataSchema: z.ZodObject<{
|
|
|
2726
2726
|
name: z.ZodString;
|
|
2727
2727
|
instructions: z.ZodOptional<z.ZodString>;
|
|
2728
2728
|
}, "strip", z.ZodTypeAny, {
|
|
2729
|
-
instructions?: string | undefined;
|
|
2730
2729
|
id: string;
|
|
2731
2730
|
name: string;
|
|
2732
|
-
}, {
|
|
2733
2731
|
instructions?: string | undefined;
|
|
2732
|
+
}, {
|
|
2734
2733
|
id: string;
|
|
2735
2734
|
name: string;
|
|
2735
|
+
instructions?: string | undefined;
|
|
2736
2736
|
}>;
|
|
2737
2737
|
type IntegrationMetadata = z.infer<typeof IntegrationMetadataSchema>;
|
|
2738
2738
|
declare const IntegrationConfigSchema: z.ZodObject<{
|
|
@@ -2742,29 +2742,29 @@ declare const IntegrationConfigSchema: z.ZodObject<{
|
|
|
2742
2742
|
name: z.ZodString;
|
|
2743
2743
|
instructions: z.ZodOptional<z.ZodString>;
|
|
2744
2744
|
}, "strip", z.ZodTypeAny, {
|
|
2745
|
-
instructions?: string | undefined;
|
|
2746
2745
|
id: string;
|
|
2747
2746
|
name: string;
|
|
2748
|
-
}, {
|
|
2749
2747
|
instructions?: string | undefined;
|
|
2748
|
+
}, {
|
|
2750
2749
|
id: string;
|
|
2751
2750
|
name: string;
|
|
2751
|
+
instructions?: string | undefined;
|
|
2752
2752
|
}>;
|
|
2753
2753
|
authSource: z.ZodEnum<["HOSTED", "LOCAL"]>;
|
|
2754
2754
|
}, "strip", z.ZodTypeAny, {
|
|
2755
2755
|
id: string;
|
|
2756
2756
|
metadata: {
|
|
2757
|
-
instructions?: string | undefined;
|
|
2758
2757
|
id: string;
|
|
2759
2758
|
name: string;
|
|
2759
|
+
instructions?: string | undefined;
|
|
2760
2760
|
};
|
|
2761
2761
|
authSource: "HOSTED" | "LOCAL";
|
|
2762
2762
|
}, {
|
|
2763
2763
|
id: string;
|
|
2764
2764
|
metadata: {
|
|
2765
|
-
instructions?: string | undefined;
|
|
2766
2765
|
id: string;
|
|
2767
2766
|
name: string;
|
|
2767
|
+
instructions?: string | undefined;
|
|
2768
2768
|
};
|
|
2769
2769
|
authSource: "HOSTED" | "LOCAL";
|
|
2770
2770
|
}>;
|
|
@@ -2774,54 +2774,67 @@ declare const ScheduledPayloadSchema: z.ZodObject<{
|
|
|
2774
2774
|
ts: z.ZodDate;
|
|
2775
2775
|
lastTimestamp: z.ZodOptional<z.ZodDate>;
|
|
2776
2776
|
}, "strip", z.ZodTypeAny, {
|
|
2777
|
-
lastTimestamp?: Date | undefined;
|
|
2778
2777
|
ts: Date;
|
|
2779
|
-
}, {
|
|
2780
2778
|
lastTimestamp?: Date | undefined;
|
|
2779
|
+
}, {
|
|
2781
2780
|
ts: Date;
|
|
2781
|
+
lastTimestamp?: Date | undefined;
|
|
2782
2782
|
}>;
|
|
2783
2783
|
type ScheduledPayload = z.infer<typeof ScheduledPayloadSchema>;
|
|
2784
2784
|
declare const IntervalOptionsSchema: z.ZodObject<{
|
|
2785
|
+
/** The number of seconds for the interval. Min = 60, Max = 86400 (1 day) */
|
|
2785
2786
|
seconds: z.ZodNumber;
|
|
2786
2787
|
}, "strip", z.ZodTypeAny, {
|
|
2787
2788
|
seconds: number;
|
|
2788
2789
|
}, {
|
|
2789
2790
|
seconds: number;
|
|
2790
2791
|
}>;
|
|
2792
|
+
/** Interval options */
|
|
2791
2793
|
type IntervalOptions = z.infer<typeof IntervalOptionsSchema>;
|
|
2792
2794
|
declare const CronOptionsSchema: z.ZodObject<{
|
|
2795
|
+
/** A CRON expression that defines the schedule. A useful tool when writing CRON
|
|
2796
|
+
expressions is [crontab guru](https://crontab.guru). Note that the timezone
|
|
2797
|
+
used is UTC. */
|
|
2793
2798
|
cron: z.ZodString;
|
|
2794
2799
|
}, "strip", z.ZodTypeAny, {
|
|
2795
2800
|
cron: string;
|
|
2796
2801
|
}, {
|
|
2797
2802
|
cron: string;
|
|
2798
2803
|
}>;
|
|
2804
|
+
/** The options for a `cronTrigger()` */
|
|
2799
2805
|
type CronOptions = z.infer<typeof CronOptionsSchema>;
|
|
2800
2806
|
declare const ScheduleMetadataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
2807
|
+
/** An interval reoccurs at the specified number of seconds */
|
|
2801
2808
|
type: z.ZodLiteral<"interval">;
|
|
2809
|
+
/** An object containing options about the interval. */
|
|
2802
2810
|
options: z.ZodObject<{
|
|
2811
|
+
/** The number of seconds for the interval. Min = 60, Max = 86400 (1 day) */
|
|
2803
2812
|
seconds: z.ZodNumber;
|
|
2804
2813
|
}, "strip", z.ZodTypeAny, {
|
|
2805
2814
|
seconds: number;
|
|
2806
2815
|
}, {
|
|
2807
2816
|
seconds: number;
|
|
2808
2817
|
}>;
|
|
2818
|
+
/** Any additional metadata about the schedule. */
|
|
2809
2819
|
metadata: z.ZodAny;
|
|
2810
2820
|
}, "strip", z.ZodTypeAny, {
|
|
2811
|
-
metadata?: any;
|
|
2812
2821
|
options: {
|
|
2813
2822
|
seconds: number;
|
|
2814
2823
|
};
|
|
2815
2824
|
type: "interval";
|
|
2816
|
-
}, {
|
|
2817
2825
|
metadata?: any;
|
|
2826
|
+
}, {
|
|
2818
2827
|
options: {
|
|
2819
2828
|
seconds: number;
|
|
2820
2829
|
};
|
|
2821
2830
|
type: "interval";
|
|
2831
|
+
metadata?: any;
|
|
2822
2832
|
}>, z.ZodObject<{
|
|
2823
2833
|
type: z.ZodLiteral<"cron">;
|
|
2824
2834
|
options: z.ZodObject<{
|
|
2835
|
+
/** A CRON expression that defines the schedule. A useful tool when writing CRON
|
|
2836
|
+
expressions is [crontab guru](https://crontab.guru). Note that the timezone
|
|
2837
|
+
used is UTC. */
|
|
2825
2838
|
cron: z.ZodString;
|
|
2826
2839
|
}, "strip", z.ZodTypeAny, {
|
|
2827
2840
|
cron: string;
|
|
@@ -2830,21 +2843,21 @@ declare const ScheduleMetadataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
2830
2843
|
}>;
|
|
2831
2844
|
metadata: z.ZodAny;
|
|
2832
2845
|
}, "strip", z.ZodTypeAny, {
|
|
2833
|
-
metadata?: any;
|
|
2834
2846
|
options: {
|
|
2835
2847
|
cron: string;
|
|
2836
2848
|
};
|
|
2837
2849
|
type: "cron";
|
|
2838
|
-
}, {
|
|
2839
2850
|
metadata?: any;
|
|
2851
|
+
}, {
|
|
2840
2852
|
options: {
|
|
2841
2853
|
cron: string;
|
|
2842
2854
|
};
|
|
2843
2855
|
type: "cron";
|
|
2856
|
+
metadata?: any;
|
|
2844
2857
|
}>]>;
|
|
2845
2858
|
type ScheduleMetadata = z.infer<typeof ScheduleMetadataSchema>;
|
|
2846
2859
|
|
|
2847
|
-
declare const MissingConnectionNotificationPayloadSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
|
|
2860
|
+
declare const MissingConnectionNotificationPayloadSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
2848
2861
|
id: z.ZodString;
|
|
2849
2862
|
client: z.ZodObject<{
|
|
2850
2863
|
id: z.ZodString;
|
|
@@ -2866,9 +2879,8 @@ declare const MissingConnectionNotificationPayloadSchema: z.ZodDiscriminatedUnio
|
|
|
2866
2879
|
updatedAt: Date;
|
|
2867
2880
|
}>;
|
|
2868
2881
|
authorizationUrl: z.ZodString;
|
|
2869
|
-
}, {
|
|
2870
2882
|
type: z.ZodLiteral<"DEVELOPER">;
|
|
2871
|
-
}
|
|
2883
|
+
}, "strip", z.ZodTypeAny, {
|
|
2872
2884
|
id: string;
|
|
2873
2885
|
type: "DEVELOPER";
|
|
2874
2886
|
client: {
|
|
@@ -2890,7 +2902,7 @@ declare const MissingConnectionNotificationPayloadSchema: z.ZodDiscriminatedUnio
|
|
|
2890
2902
|
updatedAt: Date;
|
|
2891
2903
|
};
|
|
2892
2904
|
authorizationUrl: string;
|
|
2893
|
-
}>, z.ZodObject<
|
|
2905
|
+
}>, z.ZodObject<{
|
|
2894
2906
|
id: z.ZodString;
|
|
2895
2907
|
client: z.ZodObject<{
|
|
2896
2908
|
id: z.ZodString;
|
|
@@ -2912,24 +2924,23 @@ declare const MissingConnectionNotificationPayloadSchema: z.ZodDiscriminatedUnio
|
|
|
2912
2924
|
updatedAt: Date;
|
|
2913
2925
|
}>;
|
|
2914
2926
|
authorizationUrl: z.ZodString;
|
|
2915
|
-
}, {
|
|
2916
2927
|
type: z.ZodLiteral<"EXTERNAL">;
|
|
2917
2928
|
account: z.ZodObject<{
|
|
2918
2929
|
id: z.ZodString;
|
|
2919
2930
|
metadata: z.ZodAny;
|
|
2920
2931
|
}, "strip", z.ZodTypeAny, {
|
|
2921
|
-
metadata?: any;
|
|
2922
2932
|
id: string;
|
|
2923
|
-
}, {
|
|
2924
2933
|
metadata?: any;
|
|
2934
|
+
}, {
|
|
2925
2935
|
id: string;
|
|
2936
|
+
metadata?: any;
|
|
2926
2937
|
}>;
|
|
2927
|
-
}
|
|
2938
|
+
}, "strip", z.ZodTypeAny, {
|
|
2928
2939
|
id: string;
|
|
2929
2940
|
type: "EXTERNAL";
|
|
2930
2941
|
account: {
|
|
2931
|
-
metadata?: any;
|
|
2932
2942
|
id: string;
|
|
2943
|
+
metadata?: any;
|
|
2933
2944
|
};
|
|
2934
2945
|
client: {
|
|
2935
2946
|
id: string;
|
|
@@ -2943,8 +2954,8 @@ declare const MissingConnectionNotificationPayloadSchema: z.ZodDiscriminatedUnio
|
|
|
2943
2954
|
id: string;
|
|
2944
2955
|
type: "EXTERNAL";
|
|
2945
2956
|
account: {
|
|
2946
|
-
metadata?: any;
|
|
2947
2957
|
id: string;
|
|
2958
|
+
metadata?: any;
|
|
2948
2959
|
};
|
|
2949
2960
|
client: {
|
|
2950
2961
|
id: string;
|
|
@@ -2956,7 +2967,7 @@ declare const MissingConnectionNotificationPayloadSchema: z.ZodDiscriminatedUnio
|
|
|
2956
2967
|
authorizationUrl: string;
|
|
2957
2968
|
}>]>;
|
|
2958
2969
|
type MissingConnectionNotificationPayload = z.infer<typeof MissingConnectionNotificationPayloadSchema>;
|
|
2959
|
-
declare const MissingConnectionResolvedNotificationPayloadSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
|
|
2970
|
+
declare const MissingConnectionResolvedNotificationPayloadSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
2960
2971
|
id: z.ZodString;
|
|
2961
2972
|
client: z.ZodObject<{
|
|
2962
2973
|
id: z.ZodString;
|
|
@@ -2984,9 +2995,8 @@ declare const MissingConnectionResolvedNotificationPayloadSchema: z.ZodDiscrimin
|
|
|
2984
2995
|
integrationAuthMethod: string;
|
|
2985
2996
|
}>;
|
|
2986
2997
|
expiresAt: z.ZodDate;
|
|
2987
|
-
}, {
|
|
2988
2998
|
type: z.ZodLiteral<"DEVELOPER">;
|
|
2989
|
-
}
|
|
2999
|
+
}, "strip", z.ZodTypeAny, {
|
|
2990
3000
|
id: string;
|
|
2991
3001
|
type: "DEVELOPER";
|
|
2992
3002
|
client: {
|
|
@@ -3012,7 +3022,7 @@ declare const MissingConnectionResolvedNotificationPayloadSchema: z.ZodDiscrimin
|
|
|
3012
3022
|
integrationAuthMethod: string;
|
|
3013
3023
|
};
|
|
3014
3024
|
expiresAt: Date;
|
|
3015
|
-
}>, z.ZodObject<
|
|
3025
|
+
}>, z.ZodObject<{
|
|
3016
3026
|
id: z.ZodString;
|
|
3017
3027
|
client: z.ZodObject<{
|
|
3018
3028
|
id: z.ZodString;
|
|
@@ -3040,24 +3050,23 @@ declare const MissingConnectionResolvedNotificationPayloadSchema: z.ZodDiscrimin
|
|
|
3040
3050
|
integrationAuthMethod: string;
|
|
3041
3051
|
}>;
|
|
3042
3052
|
expiresAt: z.ZodDate;
|
|
3043
|
-
}, {
|
|
3044
3053
|
type: z.ZodLiteral<"EXTERNAL">;
|
|
3045
3054
|
account: z.ZodObject<{
|
|
3046
3055
|
id: z.ZodString;
|
|
3047
3056
|
metadata: z.ZodAny;
|
|
3048
3057
|
}, "strip", z.ZodTypeAny, {
|
|
3049
|
-
metadata?: any;
|
|
3050
3058
|
id: string;
|
|
3051
|
-
}, {
|
|
3052
3059
|
metadata?: any;
|
|
3060
|
+
}, {
|
|
3053
3061
|
id: string;
|
|
3062
|
+
metadata?: any;
|
|
3054
3063
|
}>;
|
|
3055
|
-
}
|
|
3064
|
+
}, "strip", z.ZodTypeAny, {
|
|
3056
3065
|
id: string;
|
|
3057
3066
|
type: "EXTERNAL";
|
|
3058
3067
|
account: {
|
|
3059
|
-
metadata?: any;
|
|
3060
3068
|
id: string;
|
|
3069
|
+
metadata?: any;
|
|
3061
3070
|
};
|
|
3062
3071
|
client: {
|
|
3063
3072
|
id: string;
|
|
@@ -3073,8 +3082,8 @@ declare const MissingConnectionResolvedNotificationPayloadSchema: z.ZodDiscrimin
|
|
|
3073
3082
|
id: string;
|
|
3074
3083
|
type: "EXTERNAL";
|
|
3075
3084
|
account: {
|
|
3076
|
-
metadata?: any;
|
|
3077
3085
|
id: string;
|
|
3086
|
+
metadata?: any;
|
|
3078
3087
|
};
|
|
3079
3088
|
client: {
|
|
3080
3089
|
id: string;
|
|
@@ -3089,8 +3098,11 @@ declare const MissingConnectionResolvedNotificationPayloadSchema: z.ZodDiscrimin
|
|
|
3089
3098
|
}>]>;
|
|
3090
3099
|
type MissingConnectionResolvedNotificationPayload = z.infer<typeof MissingConnectionResolvedNotificationPayloadSchema>;
|
|
3091
3100
|
|
|
3101
|
+
/** The options for a fetch request */
|
|
3092
3102
|
declare const FetchRequestInitSchema: z.ZodObject<{
|
|
3103
|
+
/** The HTTP method to use for the request. */
|
|
3093
3104
|
method: z.ZodOptional<z.ZodString>;
|
|
3105
|
+
/** Any headers to send with the request. Note that you can use [redactString](https://trigger.dev/docs/sdk/redactString) to prevent sensitive information from being stored (e.g. in the logs), like API keys and tokens. */
|
|
3094
3106
|
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
3095
3107
|
__redactedString: z.ZodLiteral<true>;
|
|
3096
3108
|
strings: z.ZodArray<z.ZodString, "many">;
|
|
@@ -3104,6 +3116,7 @@ declare const FetchRequestInitSchema: z.ZodObject<{
|
|
|
3104
3116
|
strings: string[];
|
|
3105
3117
|
interpolations: string[];
|
|
3106
3118
|
}>]>>>;
|
|
3119
|
+
/** The body of the request. */
|
|
3107
3120
|
body: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>]>>;
|
|
3108
3121
|
}, "strip", z.ZodTypeAny, {
|
|
3109
3122
|
method?: string | undefined;
|
|
@@ -3122,11 +3135,16 @@ declare const FetchRequestInitSchema: z.ZodObject<{
|
|
|
3122
3135
|
}> | undefined;
|
|
3123
3136
|
body?: string | ArrayBuffer | undefined;
|
|
3124
3137
|
}>;
|
|
3138
|
+
/** The options for a fetch request */
|
|
3125
3139
|
type FetchRequestInit = z.infer<typeof FetchRequestInitSchema>;
|
|
3126
3140
|
declare const FetchRetryOptionsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"strategy", [z.ZodObject<{
|
|
3141
|
+
/** The `headers` strategy retries the request using info from the response headers. */
|
|
3127
3142
|
strategy: z.ZodLiteral<"headers">;
|
|
3143
|
+
/** The header to use to determine the maximum number of times to retry the request. */
|
|
3128
3144
|
limitHeader: z.ZodString;
|
|
3145
|
+
/** The header to use to determine the number of remaining retries. */
|
|
3129
3146
|
remainingHeader: z.ZodString;
|
|
3147
|
+
/** The header to use to determine the time when the number of remaining retries will be reset. */
|
|
3130
3148
|
resetHeader: z.ZodString;
|
|
3131
3149
|
}, "strip", z.ZodTypeAny, {
|
|
3132
3150
|
strategy: "headers";
|
|
@@ -3138,31 +3156,66 @@ declare const FetchRetryOptionsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminat
|
|
|
3138
3156
|
limitHeader: string;
|
|
3139
3157
|
remainingHeader: string;
|
|
3140
3158
|
resetHeader: string;
|
|
3141
|
-
}>, z.ZodObject<
|
|
3159
|
+
}>, z.ZodObject<{
|
|
3142
3160
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
3143
3161
|
factor: z.ZodOptional<z.ZodNumber>;
|
|
3144
3162
|
minTimeoutInMs: z.ZodOptional<z.ZodNumber>;
|
|
3145
3163
|
maxTimeoutInMs: z.ZodOptional<z.ZodNumber>;
|
|
3146
3164
|
randomize: z.ZodOptional<z.ZodBoolean>;
|
|
3147
|
-
}, {
|
|
3148
3165
|
strategy: z.ZodLiteral<"backoff">;
|
|
3149
|
-
}
|
|
3166
|
+
}, "strip", z.ZodTypeAny, {
|
|
3167
|
+
strategy: "backoff";
|
|
3150
3168
|
limit?: number | undefined;
|
|
3151
3169
|
factor?: number | undefined;
|
|
3152
3170
|
minTimeoutInMs?: number | undefined;
|
|
3153
3171
|
maxTimeoutInMs?: number | undefined;
|
|
3154
3172
|
randomize?: boolean | undefined;
|
|
3155
|
-
strategy: "backoff";
|
|
3156
3173
|
}, {
|
|
3174
|
+
strategy: "backoff";
|
|
3157
3175
|
limit?: number | undefined;
|
|
3158
3176
|
factor?: number | undefined;
|
|
3159
3177
|
minTimeoutInMs?: number | undefined;
|
|
3160
3178
|
maxTimeoutInMs?: number | undefined;
|
|
3161
3179
|
randomize?: boolean | undefined;
|
|
3162
|
-
strategy: "backoff";
|
|
3163
3180
|
}>]>>;
|
|
3181
|
+
/** An object where the key is a status code pattern and the value is a retrying strategy. Supported patterns are:
|
|
3182
|
+
- Specific status codes: 429
|
|
3183
|
+
- Ranges: 500-599
|
|
3184
|
+
- Wildcards: 2xx, 3xx, 4xx, 5xx
|
|
3185
|
+
*/
|
|
3164
3186
|
type FetchRetryOptions = z.infer<typeof FetchRetryOptionsSchema>;
|
|
3165
3187
|
|
|
3188
|
+
declare const GetRunOptionsWithTaskDetailsSchema: ZodObject<{
|
|
3189
|
+
subtasks: z.ZodOptional<z.ZodBoolean>;
|
|
3190
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
3191
|
+
take: z.ZodOptional<z.ZodNumber>;
|
|
3192
|
+
taskdetails: z.ZodOptional<z.ZodBoolean>;
|
|
3193
|
+
}, "strip", z.ZodTypeAny, {
|
|
3194
|
+
subtasks?: boolean | undefined;
|
|
3195
|
+
cursor?: string | undefined;
|
|
3196
|
+
take?: number | undefined;
|
|
3197
|
+
taskdetails?: boolean | undefined;
|
|
3198
|
+
}, {
|
|
3199
|
+
subtasks?: boolean | undefined;
|
|
3200
|
+
cursor?: string | undefined;
|
|
3201
|
+
take?: number | undefined;
|
|
3202
|
+
taskdetails?: boolean | undefined;
|
|
3203
|
+
}>;
|
|
3204
|
+
type GetRunOptionsWithTaskDetails = z.infer<typeof GetRunOptionsWithTaskDetailsSchema>;
|
|
3205
|
+
declare const GetRunsOptionsSchema: ZodObject<{
|
|
3206
|
+
/** You can use this to get more tasks, if there are more than are returned in a single batch @default undefined */
|
|
3207
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
3208
|
+
/** How many runs you want to return in one go, max 50. @default 20 */
|
|
3209
|
+
take: z.ZodOptional<z.ZodNumber>;
|
|
3210
|
+
}, "strip", z.ZodTypeAny, {
|
|
3211
|
+
cursor?: string | undefined;
|
|
3212
|
+
take?: number | undefined;
|
|
3213
|
+
}, {
|
|
3214
|
+
cursor?: string | undefined;
|
|
3215
|
+
take?: number | undefined;
|
|
3216
|
+
}>;
|
|
3217
|
+
type GetRunsOptions = z.infer<typeof GetRunsOptionsSchema>;
|
|
3218
|
+
|
|
3166
3219
|
type ApiClientOptions = {
|
|
3167
3220
|
apiKey?: string;
|
|
3168
3221
|
apiUrl?: string;
|
|
@@ -3190,6 +3243,12 @@ declare class ApiClient {
|
|
|
3190
3243
|
ok: false;
|
|
3191
3244
|
}>;
|
|
3192
3245
|
runTask(runId: string, task: RunTaskBodyInput): Promise<{
|
|
3246
|
+
id: string;
|
|
3247
|
+
name: string;
|
|
3248
|
+
noop: boolean;
|
|
3249
|
+
status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
|
|
3250
|
+
idempotencyKey: string;
|
|
3251
|
+
attempts: number;
|
|
3193
3252
|
icon?: string | null | undefined;
|
|
3194
3253
|
startedAt?: Date | null | undefined;
|
|
3195
3254
|
completedAt?: Date | null | undefined;
|
|
@@ -3197,26 +3256,31 @@ declare class ApiClient {
|
|
|
3197
3256
|
description?: string | null | undefined;
|
|
3198
3257
|
params?: DeserializedJson | undefined;
|
|
3199
3258
|
properties?: {
|
|
3259
|
+
label: string;
|
|
3260
|
+
text: string;
|
|
3200
3261
|
url?: string | undefined;
|
|
3262
|
+
}[] | null | undefined;
|
|
3263
|
+
outputProperties?: {
|
|
3201
3264
|
label: string;
|
|
3202
3265
|
text: string;
|
|
3266
|
+
url?: string | undefined;
|
|
3203
3267
|
}[] | null | undefined;
|
|
3204
3268
|
output?: DeserializedJson | undefined;
|
|
3205
3269
|
error?: string | null | undefined;
|
|
3206
3270
|
parentId?: string | null | undefined;
|
|
3207
3271
|
style?: {
|
|
3208
|
-
variant?: string | undefined;
|
|
3209
3272
|
style: "normal" | "minimal";
|
|
3273
|
+
variant?: string | undefined;
|
|
3210
3274
|
} | null | undefined;
|
|
3211
3275
|
operation?: string | null | undefined;
|
|
3276
|
+
}>;
|
|
3277
|
+
completeTask(runId: string, id: string, task: CompleteTaskBodyInput): Promise<{
|
|
3212
3278
|
id: string;
|
|
3213
3279
|
name: string;
|
|
3214
3280
|
noop: boolean;
|
|
3215
|
-
status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED";
|
|
3281
|
+
status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
|
|
3216
3282
|
idempotencyKey: string;
|
|
3217
3283
|
attempts: number;
|
|
3218
|
-
}>;
|
|
3219
|
-
completeTask(runId: string, id: string, task: CompleteTaskBodyInput): Promise<{
|
|
3220
3284
|
icon?: string | null | undefined;
|
|
3221
3285
|
startedAt?: Date | null | undefined;
|
|
3222
3286
|
completedAt?: Date | null | undefined;
|
|
@@ -3224,26 +3288,31 @@ declare class ApiClient {
|
|
|
3224
3288
|
description?: string | null | undefined;
|
|
3225
3289
|
params?: DeserializedJson | undefined;
|
|
3226
3290
|
properties?: {
|
|
3291
|
+
label: string;
|
|
3292
|
+
text: string;
|
|
3227
3293
|
url?: string | undefined;
|
|
3294
|
+
}[] | null | undefined;
|
|
3295
|
+
outputProperties?: {
|
|
3228
3296
|
label: string;
|
|
3229
3297
|
text: string;
|
|
3298
|
+
url?: string | undefined;
|
|
3230
3299
|
}[] | null | undefined;
|
|
3231
3300
|
output?: DeserializedJson | undefined;
|
|
3232
3301
|
error?: string | null | undefined;
|
|
3233
3302
|
parentId?: string | null | undefined;
|
|
3234
3303
|
style?: {
|
|
3235
|
-
variant?: string | undefined;
|
|
3236
3304
|
style: "normal" | "minimal";
|
|
3305
|
+
variant?: string | undefined;
|
|
3237
3306
|
} | null | undefined;
|
|
3238
3307
|
operation?: string | null | undefined;
|
|
3308
|
+
}>;
|
|
3309
|
+
failTask(runId: string, id: string, body: FailTaskBodyInput): Promise<{
|
|
3239
3310
|
id: string;
|
|
3240
3311
|
name: string;
|
|
3241
3312
|
noop: boolean;
|
|
3242
|
-
status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED";
|
|
3313
|
+
status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
|
|
3243
3314
|
idempotencyKey: string;
|
|
3244
3315
|
attempts: number;
|
|
3245
|
-
}>;
|
|
3246
|
-
failTask(runId: string, id: string, body: FailTaskBodyInput): Promise<{
|
|
3247
3316
|
icon?: string | null | undefined;
|
|
3248
3317
|
startedAt?: Date | null | undefined;
|
|
3249
3318
|
completedAt?: Date | null | undefined;
|
|
@@ -3251,91 +3320,146 @@ declare class ApiClient {
|
|
|
3251
3320
|
description?: string | null | undefined;
|
|
3252
3321
|
params?: DeserializedJson | undefined;
|
|
3253
3322
|
properties?: {
|
|
3323
|
+
label: string;
|
|
3324
|
+
text: string;
|
|
3254
3325
|
url?: string | undefined;
|
|
3326
|
+
}[] | null | undefined;
|
|
3327
|
+
outputProperties?: {
|
|
3255
3328
|
label: string;
|
|
3256
3329
|
text: string;
|
|
3330
|
+
url?: string | undefined;
|
|
3257
3331
|
}[] | null | undefined;
|
|
3258
3332
|
output?: DeserializedJson | undefined;
|
|
3259
3333
|
error?: string | null | undefined;
|
|
3260
3334
|
parentId?: string | null | undefined;
|
|
3261
3335
|
style?: {
|
|
3262
|
-
variant?: string | undefined;
|
|
3263
3336
|
style: "normal" | "minimal";
|
|
3337
|
+
variant?: string | undefined;
|
|
3264
3338
|
} | null | undefined;
|
|
3265
3339
|
operation?: string | null | undefined;
|
|
3266
|
-
id: string;
|
|
3267
|
-
name: string;
|
|
3268
|
-
noop: boolean;
|
|
3269
|
-
status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED";
|
|
3270
|
-
idempotencyKey: string;
|
|
3271
|
-
attempts: number;
|
|
3272
3340
|
}>;
|
|
3273
3341
|
sendEvent(event: SendEvent, options?: SendEventOptions): Promise<{
|
|
3274
|
-
context?: DeserializedJson | undefined;
|
|
3275
|
-
deliverAt?: Date | null | undefined;
|
|
3276
|
-
deliveredAt?: Date | null | undefined;
|
|
3277
3342
|
id: string;
|
|
3278
3343
|
name: string;
|
|
3279
|
-
payload:
|
|
3344
|
+
payload: ((string | number | boolean | {
|
|
3345
|
+
[key: string]: DeserializedJson;
|
|
3346
|
+
} | DeserializedJson[]) & (string | number | boolean | {
|
|
3347
|
+
[key: string]: DeserializedJson;
|
|
3348
|
+
} | DeserializedJson[] | undefined)) | null;
|
|
3280
3349
|
timestamp: Date;
|
|
3350
|
+
context?: DeserializedJson | undefined;
|
|
3351
|
+
deliverAt?: Date | null | undefined;
|
|
3352
|
+
deliveredAt?: Date | null | undefined;
|
|
3281
3353
|
}>;
|
|
3282
3354
|
updateSource(client: string, key: string, source: UpdateTriggerSourceBody): Promise<TriggerSource>;
|
|
3283
3355
|
registerTrigger(client: string, id: string, key: string, payload: RegisterTriggerBody): Promise<RegisterSourceEvent>;
|
|
3284
3356
|
registerSchedule(client: string, id: string, key: string, payload: ScheduleMetadata): Promise<{
|
|
3285
|
-
metadata?: any;
|
|
3286
3357
|
id: string;
|
|
3287
3358
|
schedule: {
|
|
3288
|
-
metadata?: any;
|
|
3289
3359
|
options: {
|
|
3290
3360
|
cron: string;
|
|
3291
3361
|
};
|
|
3292
3362
|
type: "cron";
|
|
3293
|
-
} | {
|
|
3294
3363
|
metadata?: any;
|
|
3364
|
+
} | {
|
|
3295
3365
|
options: {
|
|
3296
3366
|
seconds: number;
|
|
3297
3367
|
};
|
|
3298
3368
|
type: "interval";
|
|
3369
|
+
metadata?: any;
|
|
3299
3370
|
};
|
|
3300
3371
|
active: boolean;
|
|
3372
|
+
metadata?: any;
|
|
3301
3373
|
}>;
|
|
3302
3374
|
unregisterSchedule(client: string, id: string, key: string): Promise<{
|
|
3303
3375
|
ok: boolean;
|
|
3304
3376
|
}>;
|
|
3305
3377
|
getAuth(client: string, id: string): Promise<{
|
|
3306
|
-
scopes?: string[] | undefined;
|
|
3307
|
-
additionalFields?: Record<string, string> | undefined;
|
|
3308
3378
|
type: "oauth2";
|
|
3309
3379
|
accessToken: string;
|
|
3380
|
+
scopes?: string[] | undefined;
|
|
3381
|
+
additionalFields?: Record<string, string> | undefined;
|
|
3310
3382
|
} | undefined>;
|
|
3383
|
+
getEvent(eventId: string): Promise<{
|
|
3384
|
+
id: string;
|
|
3385
|
+
name: string;
|
|
3386
|
+
createdAt: Date;
|
|
3387
|
+
updatedAt: Date;
|
|
3388
|
+
runs: {
|
|
3389
|
+
id: string;
|
|
3390
|
+
status: "PENDING" | "CANCELED" | "SUCCESS" | "QUEUED" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "FAILURE" | "TIMED_OUT" | "ABORTED";
|
|
3391
|
+
startedAt?: Date | null | undefined;
|
|
3392
|
+
completedAt?: Date | null | undefined;
|
|
3393
|
+
}[];
|
|
3394
|
+
}>;
|
|
3395
|
+
getRun(runId: string, options?: GetRunOptionsWithTaskDetails): Promise<{
|
|
3396
|
+
id: string;
|
|
3397
|
+
startedAt: Date | null;
|
|
3398
|
+
completedAt: Date | null;
|
|
3399
|
+
status: "PENDING" | "CANCELED" | "SUCCESS" | "QUEUED" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "FAILURE" | "TIMED_OUT" | "ABORTED";
|
|
3400
|
+
tasks: {
|
|
3401
|
+
id: string;
|
|
3402
|
+
name: string;
|
|
3403
|
+
icon: string | null;
|
|
3404
|
+
startedAt: Date | null;
|
|
3405
|
+
completedAt: Date | null;
|
|
3406
|
+
status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
|
|
3407
|
+
displayKey: string | null;
|
|
3408
|
+
}[];
|
|
3409
|
+
updatedAt: Date | null;
|
|
3410
|
+
output?: any;
|
|
3411
|
+
nextCursor?: string | undefined;
|
|
3412
|
+
}>;
|
|
3413
|
+
getRuns(jobSlug: string, options?: GetRunsOptions): Promise<{
|
|
3414
|
+
runs: {
|
|
3415
|
+
id: string;
|
|
3416
|
+
startedAt: Date | null;
|
|
3417
|
+
completedAt: Date | null;
|
|
3418
|
+
status: "PENDING" | "CANCELED" | "SUCCESS" | "QUEUED" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "FAILURE" | "TIMED_OUT" | "ABORTED";
|
|
3419
|
+
updatedAt: Date | null;
|
|
3420
|
+
}[];
|
|
3421
|
+
nextCursor?: string | undefined;
|
|
3422
|
+
}>;
|
|
3311
3423
|
}
|
|
3312
3424
|
|
|
3313
3425
|
interface TriggerContext {
|
|
3426
|
+
/** Job metadata */
|
|
3314
3427
|
job: {
|
|
3315
3428
|
id: string;
|
|
3316
3429
|
version: string;
|
|
3317
3430
|
};
|
|
3431
|
+
/** Environment metadata */
|
|
3318
3432
|
environment: {
|
|
3319
3433
|
slug: string;
|
|
3320
3434
|
id: string;
|
|
3321
3435
|
type: RuntimeEnvironmentType;
|
|
3322
3436
|
};
|
|
3437
|
+
/** Organization metadata */
|
|
3323
3438
|
organization: {
|
|
3324
3439
|
slug: string;
|
|
3325
3440
|
id: string;
|
|
3326
3441
|
title: string;
|
|
3327
3442
|
};
|
|
3443
|
+
/** Run metadata */
|
|
3328
3444
|
run: {
|
|
3329
3445
|
id: string;
|
|
3330
3446
|
isTest: boolean;
|
|
3331
3447
|
startedAt: Date;
|
|
3448
|
+
isRetry: boolean;
|
|
3332
3449
|
};
|
|
3450
|
+
/** Event metadata */
|
|
3333
3451
|
event: {
|
|
3334
3452
|
id: string;
|
|
3335
3453
|
name: string;
|
|
3336
3454
|
context: any;
|
|
3337
3455
|
timestamp: Date;
|
|
3338
3456
|
};
|
|
3457
|
+
/** Source metadata */
|
|
3458
|
+
source?: {
|
|
3459
|
+
id: string;
|
|
3460
|
+
metadata?: any;
|
|
3461
|
+
};
|
|
3462
|
+
/** Account metadata */
|
|
3339
3463
|
account?: {
|
|
3340
3464
|
id: string;
|
|
3341
3465
|
metadata?: any;
|
|
@@ -3472,7 +3596,7 @@ type ExternalSourceOptions<TChannel extends ChannelNames, TIntegration extends T
|
|
|
3472
3596
|
schema: z.Schema<TParams>;
|
|
3473
3597
|
integration: TIntegration;
|
|
3474
3598
|
register: RegisterFunction<TIntegration, TParams, TChannel>;
|
|
3475
|
-
filter
|
|
3599
|
+
filter?: FilterFunction<TParams>;
|
|
3476
3600
|
handler: HandlerFunction<TChannel, TParams>;
|
|
3477
3601
|
key: KeyFunction<TParams>;
|
|
3478
3602
|
properties?: (params: TParams) => DisplayProperty[];
|
|
@@ -3483,34 +3607,34 @@ declare class ExternalSource<TIntegration extends TriggerIntegration<Integration
|
|
|
3483
3607
|
constructor(channel: TChannel, options: ExternalSourceOptions<TChannel, TIntegration, TParams>);
|
|
3484
3608
|
handle(source: HandleTriggerSource, rawEvent: ExternalSourceChannelMap[TChannel]["event"], logger: Logger): Promise<void | {
|
|
3485
3609
|
events: {
|
|
3486
|
-
|
|
3487
|
-
source?: string | undefined;
|
|
3610
|
+
name: string;
|
|
3488
3611
|
payload?: any;
|
|
3489
3612
|
context?: any;
|
|
3490
|
-
|
|
3491
|
-
|
|
3613
|
+
id?: string | undefined;
|
|
3614
|
+
timestamp?: Date | undefined;
|
|
3615
|
+
source?: string | undefined;
|
|
3492
3616
|
}[];
|
|
3493
3617
|
response?: {
|
|
3494
|
-
headers?: Record<string, string> | undefined;
|
|
3495
|
-
body?: any;
|
|
3496
3618
|
status: number;
|
|
3619
|
+
body?: any;
|
|
3620
|
+
headers?: Record<string, string> | undefined;
|
|
3497
3621
|
} | undefined;
|
|
3498
3622
|
}>;
|
|
3499
3623
|
filter(params: TParams): EventFilter;
|
|
3500
3624
|
properties(params: TParams): DisplayProperty[];
|
|
3501
3625
|
register(params: TParams, registerEvent: RegisterSourceEvent, io: IO, ctx: TriggerContext): Promise<{
|
|
3502
|
-
data?: SerializableJson;
|
|
3503
|
-
secret?: string | undefined;
|
|
3504
3626
|
registeredEvents: string[];
|
|
3627
|
+
secret?: string | undefined;
|
|
3628
|
+
data?: SerializableJson;
|
|
3505
3629
|
} | undefined>;
|
|
3506
3630
|
key(params: TParams): string;
|
|
3507
3631
|
get integration(): TIntegration;
|
|
3508
3632
|
get integrationConfig(): {
|
|
3509
3633
|
id: string;
|
|
3510
3634
|
metadata: {
|
|
3511
|
-
instructions?: string | undefined;
|
|
3512
3635
|
id: string;
|
|
3513
3636
|
name: string;
|
|
3637
|
+
instructions?: string | undefined;
|
|
3514
3638
|
};
|
|
3515
3639
|
};
|
|
3516
3640
|
get id(): string;
|
|
@@ -3535,41 +3659,72 @@ declare function omit<T extends Record<string, unknown>, K extends keyof T>(obj:
|
|
|
3535
3659
|
ommited: T[K];
|
|
3536
3660
|
};
|
|
3537
3661
|
|
|
3662
|
+
/** Options for a DynamicTrigger */
|
|
3538
3663
|
type DynamicTriggerOptions<TEventSpec extends EventSpecification<any>, TExternalSource extends ExternalSource<any, any, any>> = {
|
|
3664
|
+
/** Used to uniquely identify a DynamicTrigger */
|
|
3539
3665
|
id: string;
|
|
3666
|
+
/** An event from an [Integration](https://trigger.dev/docs/integrations) package that you want to attach to the DynamicTrigger. The event types will come through to the payload in your Job's run. */
|
|
3540
3667
|
event: TEventSpec;
|
|
3668
|
+
/** An external source fron an [Integration](https://trigger.dev/docs/integrations) package
|
|
3669
|
+
* @example
|
|
3670
|
+
* ```ts
|
|
3671
|
+
* import { events } from "@trigger.dev/github";
|
|
3672
|
+
*
|
|
3673
|
+
* const dynamicOnIssueOpened = new DynamicTrigger(client, {
|
|
3674
|
+
id: "github-issue-opened",
|
|
3675
|
+
event: events.onIssueOpened,
|
|
3676
|
+
source: github.sources.repo,
|
|
3677
|
+
});
|
|
3678
|
+
* ```
|
|
3679
|
+
*/
|
|
3541
3680
|
source: TExternalSource;
|
|
3542
3681
|
};
|
|
3682
|
+
/** `DynamicTrigger` allows you to define a trigger that can be configured dynamically at runtime. */
|
|
3543
3683
|
declare class DynamicTrigger<TEventSpec extends EventSpecification<any>, TExternalSource extends ExternalSource<any, any, any>> implements Trigger<TEventSpec> {
|
|
3544
3684
|
#private;
|
|
3545
3685
|
source: TExternalSource;
|
|
3686
|
+
/** `DynamicTrigger` allows you to define a trigger that can be configured dynamically at runtime.
|
|
3687
|
+
* @param client The `TriggerClient` instance to use for registering the trigger.
|
|
3688
|
+
* @param options The options for the dynamic trigger.
|
|
3689
|
+
* */
|
|
3546
3690
|
constructor(client: TriggerClient, options: DynamicTriggerOptions<TEventSpec, TExternalSource>);
|
|
3547
3691
|
toJSON(): TriggerMetadata;
|
|
3548
3692
|
get id(): string;
|
|
3549
3693
|
get event(): TEventSpec;
|
|
3550
3694
|
registeredTriggerForParams(params: ExternalSourceParams<TExternalSource>): RegisterTriggerBody;
|
|
3695
|
+
/** Use this method to register a new configuration with the DynamicTrigger.
|
|
3696
|
+
* @param key The key for the configuration. This will be used to identify the configuration when it is triggered.
|
|
3697
|
+
* @param params The params for the configuration.
|
|
3698
|
+
*/
|
|
3551
3699
|
register(key: string, params: ExternalSourceParams<TExternalSource>): Promise<RegisterSourceEvent>;
|
|
3552
3700
|
attachToJob(triggerClient: TriggerClient, job: Job<Trigger<TEventSpec>, any>): void;
|
|
3553
3701
|
get preprocessRuns(): boolean;
|
|
3554
3702
|
}
|
|
3555
3703
|
|
|
3556
3704
|
type TriggerClientOptions = {
|
|
3705
|
+
/** The `id` property is used to uniquely identify the client.
|
|
3706
|
+
*/
|
|
3557
3707
|
id: string;
|
|
3558
|
-
|
|
3708
|
+
/** The `apiKey` property is the API Key for your Trigger.dev environment. We
|
|
3709
|
+
recommend using an environment variable to store your API Key. */
|
|
3559
3710
|
apiKey?: string;
|
|
3711
|
+
/** The `apiUrl` property is an optional property that specifies the API URL. You
|
|
3712
|
+
only need to specify this if you are not using Trigger.dev Cloud and are
|
|
3713
|
+
running your own Trigger.dev instance. */
|
|
3560
3714
|
apiUrl?: string;
|
|
3715
|
+
/** The `logLevel` property is an optional property that specifies the level of
|
|
3716
|
+
logging for the TriggerClient. The level is inherited by all Jobs that use this Client, unless they also specify a `logLevel`. */
|
|
3561
3717
|
logLevel?: LogLevel;
|
|
3718
|
+
/** Very verbose log messages, defaults to false. */
|
|
3719
|
+
verbose?: boolean;
|
|
3720
|
+
/** Default is unset and off. If set to true it will log to the server's console as well as the Trigger.dev platform */
|
|
3721
|
+
ioLogLocalEnabled?: boolean;
|
|
3562
3722
|
};
|
|
3563
|
-
|
|
3564
|
-
url: string;
|
|
3565
|
-
};
|
|
3723
|
+
/** A [TriggerClient](https://trigger.dev/docs/documentation/concepts/client-adaptors) is used to connect to a specific [Project](https://trigger.dev/docs/documentation/concepts/projects) by using an [API Key](https://trigger.dev/docs/documentation/concepts/environments-apikeys). */
|
|
3566
3724
|
declare class TriggerClient {
|
|
3567
3725
|
#private;
|
|
3568
|
-
private _url;
|
|
3569
3726
|
id: string;
|
|
3570
|
-
|
|
3571
|
-
constructor(options: TriggerClientOptions);
|
|
3572
|
-
get url(): string;
|
|
3727
|
+
constructor(options: Prettify<TriggerClientOptions>);
|
|
3573
3728
|
handleRequest(request: Request): Promise<NormalizedResponse>;
|
|
3574
3729
|
attach(job: Job<Trigger<any>, any>): void;
|
|
3575
3730
|
attachDynamicTrigger(trigger: DynamicTrigger<any, any>): void;
|
|
@@ -3582,12 +3737,8 @@ declare class TriggerClient {
|
|
|
3582
3737
|
}): void;
|
|
3583
3738
|
attachDynamicSchedule(key: string, job: Job<Trigger<any>, any>): void;
|
|
3584
3739
|
registerTrigger(id: string, key: string, options: RegisterTriggerBody): Promise<{
|
|
3585
|
-
dynamicTriggerId?: string | undefined;
|
|
3586
3740
|
id: string;
|
|
3587
3741
|
source: {
|
|
3588
|
-
params?: any;
|
|
3589
|
-
data?: DeserializedJson | undefined;
|
|
3590
|
-
clientId?: string | undefined;
|
|
3591
3742
|
key: string;
|
|
3592
3743
|
secret: string;
|
|
3593
3744
|
active: boolean;
|
|
@@ -3599,49 +3750,103 @@ declare class TriggerClient {
|
|
|
3599
3750
|
} | {
|
|
3600
3751
|
type: "SQS";
|
|
3601
3752
|
};
|
|
3753
|
+
params?: any;
|
|
3754
|
+
data?: DeserializedJson | undefined;
|
|
3755
|
+
clientId?: string | undefined;
|
|
3602
3756
|
};
|
|
3603
3757
|
events: string[];
|
|
3604
3758
|
missingEvents: string[];
|
|
3605
3759
|
orphanedEvents: string[];
|
|
3760
|
+
dynamicTriggerId?: string | undefined;
|
|
3606
3761
|
}>;
|
|
3607
3762
|
getAuth(id: string): Promise<{
|
|
3608
|
-
scopes?: string[] | undefined;
|
|
3609
|
-
additionalFields?: Record<string, string> | undefined;
|
|
3610
3763
|
type: "oauth2";
|
|
3611
3764
|
accessToken: string;
|
|
3765
|
+
scopes?: string[] | undefined;
|
|
3766
|
+
additionalFields?: Record<string, string> | undefined;
|
|
3612
3767
|
} | undefined>;
|
|
3768
|
+
/** You can call this function from anywhere in your code to send an event. The other way to send an event is by using [`io.sendEvent()`](https://trigger.dev/docs/sdk/io/sendevent) from inside a `run()` function.
|
|
3769
|
+
* @param event The event to send.
|
|
3770
|
+
* @param options Options for sending the event.
|
|
3771
|
+
* @returns A promise that resolves to the event details
|
|
3772
|
+
*/
|
|
3613
3773
|
sendEvent(event: SendEvent, options?: SendEventOptions): Promise<{
|
|
3614
|
-
context?: DeserializedJson | undefined;
|
|
3615
|
-
deliverAt?: Date | null | undefined;
|
|
3616
|
-
deliveredAt?: Date | null | undefined;
|
|
3617
3774
|
id: string;
|
|
3618
3775
|
name: string;
|
|
3619
|
-
payload:
|
|
3776
|
+
payload: ((string | number | boolean | {
|
|
3777
|
+
[key: string]: DeserializedJson;
|
|
3778
|
+
} | DeserializedJson[]) & (string | number | boolean | {
|
|
3779
|
+
[key: string]: DeserializedJson;
|
|
3780
|
+
} | DeserializedJson[] | undefined)) | null;
|
|
3620
3781
|
timestamp: Date;
|
|
3782
|
+
context?: DeserializedJson | undefined;
|
|
3783
|
+
deliverAt?: Date | null | undefined;
|
|
3784
|
+
deliveredAt?: Date | null | undefined;
|
|
3621
3785
|
}>;
|
|
3622
3786
|
registerSchedule(id: string, key: string, schedule: ScheduleMetadata): Promise<{
|
|
3623
|
-
metadata?: any;
|
|
3624
3787
|
id: string;
|
|
3625
3788
|
schedule: {
|
|
3626
|
-
metadata?: any;
|
|
3627
3789
|
options: {
|
|
3628
3790
|
cron: string;
|
|
3629
3791
|
};
|
|
3630
3792
|
type: "cron";
|
|
3631
|
-
} | {
|
|
3632
3793
|
metadata?: any;
|
|
3794
|
+
} | {
|
|
3633
3795
|
options: {
|
|
3634
3796
|
seconds: number;
|
|
3635
3797
|
};
|
|
3636
3798
|
type: "interval";
|
|
3799
|
+
metadata?: any;
|
|
3637
3800
|
};
|
|
3638
3801
|
active: boolean;
|
|
3802
|
+
metadata?: any;
|
|
3639
3803
|
}>;
|
|
3640
3804
|
unregisterSchedule(id: string, key: string): Promise<{
|
|
3641
3805
|
ok: boolean;
|
|
3642
3806
|
}>;
|
|
3643
|
-
|
|
3807
|
+
getEvent(eventId: string): Promise<{
|
|
3808
|
+
id: string;
|
|
3809
|
+
name: string;
|
|
3810
|
+
createdAt: Date;
|
|
3811
|
+
updatedAt: Date;
|
|
3812
|
+
runs: {
|
|
3813
|
+
id: string;
|
|
3814
|
+
status: "PENDING" | "CANCELED" | "SUCCESS" | "QUEUED" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "FAILURE" | "TIMED_OUT" | "ABORTED";
|
|
3815
|
+
startedAt?: Date | null | undefined;
|
|
3816
|
+
completedAt?: Date | null | undefined;
|
|
3817
|
+
}[];
|
|
3818
|
+
}>;
|
|
3819
|
+
getRun(runId: string, options?: GetRunOptionsWithTaskDetails): Promise<{
|
|
3820
|
+
id: string;
|
|
3821
|
+
startedAt: Date | null;
|
|
3822
|
+
completedAt: Date | null;
|
|
3823
|
+
status: "PENDING" | "CANCELED" | "SUCCESS" | "QUEUED" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "FAILURE" | "TIMED_OUT" | "ABORTED";
|
|
3824
|
+
tasks: {
|
|
3825
|
+
id: string;
|
|
3826
|
+
name: string;
|
|
3827
|
+
icon: string | null;
|
|
3828
|
+
startedAt: Date | null;
|
|
3829
|
+
completedAt: Date | null;
|
|
3830
|
+
status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
|
|
3831
|
+
displayKey: string | null;
|
|
3832
|
+
}[];
|
|
3833
|
+
updatedAt: Date | null;
|
|
3834
|
+
output?: any;
|
|
3835
|
+
nextCursor?: string | undefined;
|
|
3836
|
+
}>;
|
|
3837
|
+
getRuns(jobSlug: string, options?: GetRunsOptions): Promise<{
|
|
3838
|
+
runs: {
|
|
3839
|
+
id: string;
|
|
3840
|
+
startedAt: Date | null;
|
|
3841
|
+
completedAt: Date | null;
|
|
3842
|
+
status: "PENDING" | "CANCELED" | "SUCCESS" | "QUEUED" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "FAILURE" | "TIMED_OUT" | "ABORTED";
|
|
3843
|
+
updatedAt: Date | null;
|
|
3844
|
+
}[];
|
|
3845
|
+
nextCursor?: string | undefined;
|
|
3846
|
+
}>;
|
|
3847
|
+
authorized(apiKey?: string | null): "authorized" | "unauthorized" | "missing-client" | "missing-header";
|
|
3644
3848
|
apiKey(): string | undefined;
|
|
3849
|
+
defineJob<TTrigger extends Trigger<EventSpecification<any>>, TIntegrations extends Record<string, TriggerIntegration<IntegrationClient<any, any>>> = {}>(options: JobOptions<TTrigger, TIntegrations>): Job<TTrigger, TIntegrations>;
|
|
3645
3850
|
}
|
|
3646
3851
|
|
|
3647
3852
|
type ScheduledEventSpecification = EventSpecification<ScheduledPayload>;
|
|
@@ -3663,8 +3868,8 @@ declare class IntervalTrigger implements Trigger<ScheduledEventSpecification> {
|
|
|
3663
3868
|
};
|
|
3664
3869
|
}[];
|
|
3665
3870
|
parsePayload: (data: unknown, params?: Partial<zod.ParseParams> | undefined) => {
|
|
3666
|
-
lastTimestamp?: Date | undefined;
|
|
3667
3871
|
ts: Date;
|
|
3872
|
+
lastTimestamp?: Date | undefined;
|
|
3668
3873
|
};
|
|
3669
3874
|
properties: {
|
|
3670
3875
|
label: string;
|
|
@@ -3675,6 +3880,9 @@ declare class IntervalTrigger implements Trigger<ScheduledEventSpecification> {
|
|
|
3675
3880
|
get preprocessRuns(): boolean;
|
|
3676
3881
|
toJSON(): TriggerMetadata;
|
|
3677
3882
|
}
|
|
3883
|
+
/** `intervalTrigger()` is set as a [Job's trigger](/sdk/job) to trigger a Job at a recurring interval.
|
|
3884
|
+
* @param options An object containing options about the interval.
|
|
3885
|
+
*/
|
|
3678
3886
|
declare function intervalTrigger(options: IntervalOptions): IntervalTrigger;
|
|
3679
3887
|
declare class CronTrigger implements Trigger<ScheduledEventSpecification> {
|
|
3680
3888
|
private options;
|
|
@@ -3694,8 +3902,8 @@ declare class CronTrigger implements Trigger<ScheduledEventSpecification> {
|
|
|
3694
3902
|
};
|
|
3695
3903
|
}[];
|
|
3696
3904
|
parsePayload: (data: unknown, params?: Partial<zod.ParseParams> | undefined) => {
|
|
3697
|
-
lastTimestamp?: Date | undefined;
|
|
3698
3905
|
ts: Date;
|
|
3906
|
+
lastTimestamp?: Date | undefined;
|
|
3699
3907
|
};
|
|
3700
3908
|
properties: {
|
|
3701
3909
|
label: string;
|
|
@@ -3706,13 +3914,24 @@ declare class CronTrigger implements Trigger<ScheduledEventSpecification> {
|
|
|
3706
3914
|
get preprocessRuns(): boolean;
|
|
3707
3915
|
toJSON(): TriggerMetadata;
|
|
3708
3916
|
}
|
|
3917
|
+
/** `cronTrigger()` is set as a [Job's trigger](https://trigger.dev/docs/sdk/job) to trigger a Job on a recurring schedule using a CRON expression.
|
|
3918
|
+
* @param options An object containing options about the CRON schedule.
|
|
3919
|
+
*/
|
|
3709
3920
|
declare function cronTrigger(options: CronOptions): CronTrigger;
|
|
3921
|
+
/** DynamicSchedule options
|
|
3922
|
+
* @param id Used to uniquely identify a DynamicSchedule
|
|
3923
|
+
*/
|
|
3710
3924
|
type DynamicIntervalOptions = {
|
|
3711
3925
|
id: string;
|
|
3712
3926
|
};
|
|
3927
|
+
/** DynamicSchedule` allows you to define a scheduled trigger that can be configured dynamically at runtime. */
|
|
3713
3928
|
declare class DynamicSchedule implements Trigger<ScheduledEventSpecification> {
|
|
3714
3929
|
private client;
|
|
3715
3930
|
private options;
|
|
3931
|
+
/**
|
|
3932
|
+
* @param client The `TriggerClient` instance to use for registering the trigger.
|
|
3933
|
+
* @param options The options for the schedule.
|
|
3934
|
+
*/
|
|
3716
3935
|
constructor(client: TriggerClient, options: DynamicIntervalOptions);
|
|
3717
3936
|
get id(): string;
|
|
3718
3937
|
get event(): {
|
|
@@ -3730,27 +3949,27 @@ declare class DynamicSchedule implements Trigger<ScheduledEventSpecification> {
|
|
|
3730
3949
|
};
|
|
3731
3950
|
}[];
|
|
3732
3951
|
parsePayload: (data: unknown, params?: Partial<zod.ParseParams> | undefined) => {
|
|
3733
|
-
lastTimestamp?: Date | undefined;
|
|
3734
3952
|
ts: Date;
|
|
3953
|
+
lastTimestamp?: Date | undefined;
|
|
3735
3954
|
};
|
|
3736
3955
|
};
|
|
3737
3956
|
register(key: string, metadata: ScheduleMetadata): Promise<{
|
|
3738
|
-
metadata?: any;
|
|
3739
3957
|
id: string;
|
|
3740
3958
|
schedule: {
|
|
3741
|
-
metadata?: any;
|
|
3742
3959
|
options: {
|
|
3743
3960
|
cron: string;
|
|
3744
3961
|
};
|
|
3745
3962
|
type: "cron";
|
|
3746
|
-
} | {
|
|
3747
3963
|
metadata?: any;
|
|
3964
|
+
} | {
|
|
3748
3965
|
options: {
|
|
3749
3966
|
seconds: number;
|
|
3750
3967
|
};
|
|
3751
3968
|
type: "interval";
|
|
3969
|
+
metadata?: any;
|
|
3752
3970
|
};
|
|
3753
3971
|
active: boolean;
|
|
3972
|
+
metadata?: any;
|
|
3754
3973
|
}>;
|
|
3755
3974
|
unregister(key: string): Promise<{
|
|
3756
3975
|
ok: boolean;
|
|
@@ -3768,6 +3987,8 @@ type IOOptions = {
|
|
|
3768
3987
|
context: TriggerContext;
|
|
3769
3988
|
logger?: Logger;
|
|
3770
3989
|
logLevel?: LogLevel;
|
|
3990
|
+
jobLogger?: Logger;
|
|
3991
|
+
jobLogLevel: LogLevel;
|
|
3771
3992
|
cachedTasks?: Array<CachedTask>;
|
|
3772
3993
|
};
|
|
3773
3994
|
declare class IO {
|
|
@@ -3776,21 +3997,48 @@ declare class IO {
|
|
|
3776
3997
|
private _apiClient;
|
|
3777
3998
|
private _triggerClient;
|
|
3778
3999
|
private _logger;
|
|
4000
|
+
private _jobLogger?;
|
|
4001
|
+
private _jobLogLevel;
|
|
3779
4002
|
private _cachedTasks;
|
|
3780
4003
|
private _taskStorage;
|
|
3781
4004
|
private _context;
|
|
3782
4005
|
constructor(options: IOOptions);
|
|
4006
|
+
/** Used to send log messages to the [Run log](https://trigger.dev/docs/documentation/guides/viewing-runs). */
|
|
3783
4007
|
get logger(): IOLogger;
|
|
4008
|
+
/** `io.wait()` waits for the specified amount of time before continuing the Job. Delays work even if you're on a serverless platform with timeouts, or if your server goes down. They utilize [resumability](https://trigger.dev/docs/documentation/concepts/resumability) to ensure that the Run can be resumed after the delay.
|
|
4009
|
+
* @param key Should be a stable and unique key inside the `run()`. See [resumability](https://trigger.dev/docs/documentation/concepts/resumability) for more information.
|
|
4010
|
+
* @param seconds The number of seconds to wait. This can be very long, serverless timeouts are not an issue.
|
|
4011
|
+
*/
|
|
3784
4012
|
wait(key: string | any[], seconds: number): Promise<void>;
|
|
4013
|
+
/** `io.backgroundFetch()` fetches data from a URL that can take longer that the serverless timeout. The actual `fetch` request is performed on the Trigger.dev platform, and the response is sent back to you.
|
|
4014
|
+
* @param key Should be a stable and unique key inside the `run()`. See [resumability](https://trigger.dev/docs/documentation/concepts/resumability) for more information.
|
|
4015
|
+
* @param url The URL to fetch from.
|
|
4016
|
+
* @param requestInit The options for the request
|
|
4017
|
+
* @param retry The options for retrying the request if it fails
|
|
4018
|
+
* An object where the key is a status code pattern and the value is a retrying strategy.
|
|
4019
|
+
* Supported patterns are:
|
|
4020
|
+
* - Specific status codes: 429
|
|
4021
|
+
* - Ranges: 500-599
|
|
4022
|
+
* - Wildcards: 2xx, 3xx, 4xx, 5xx
|
|
4023
|
+
*/
|
|
3785
4024
|
backgroundFetch<TResponseData>(key: string | any[], url: string, requestInit?: FetchRequestInit, retry?: FetchRetryOptions): Promise<TResponseData>;
|
|
4025
|
+
/** `io.sendEvent()` allows you to send an event from inside a Job run. The sent even will trigger any Jobs that are listening for that event (based on the name).
|
|
4026
|
+
* @param key Should be a stable and unique key inside the `run()`. See [resumability](https://trigger.dev/docs/documentation/concepts/resumability) for more information.
|
|
4027
|
+
* @param event The event to send. The event name must match the name of the event that your Jobs are listening for.
|
|
4028
|
+
* @param options Options for sending the event.
|
|
4029
|
+
*/
|
|
3786
4030
|
sendEvent(key: string | any[], event: SendEvent, options?: SendEventOptions): Promise<{
|
|
3787
|
-
context?: DeserializedJson | undefined;
|
|
3788
|
-
deliverAt?: Date | null | undefined;
|
|
3789
|
-
deliveredAt?: Date | null | undefined;
|
|
3790
4031
|
id: string;
|
|
3791
4032
|
name: string;
|
|
3792
|
-
payload:
|
|
4033
|
+
payload: ((string | number | boolean | {
|
|
4034
|
+
[key: string]: DeserializedJson;
|
|
4035
|
+
} | DeserializedJson[]) & (string | number | boolean | {
|
|
4036
|
+
[key: string]: DeserializedJson;
|
|
4037
|
+
} | DeserializedJson[] | undefined)) | null;
|
|
3793
4038
|
timestamp: Date;
|
|
4039
|
+
context?: DeserializedJson | undefined;
|
|
4040
|
+
deliverAt?: Date | null | undefined;
|
|
4041
|
+
deliveredAt?: Date | null | undefined;
|
|
3794
4042
|
}>;
|
|
3795
4043
|
updateSource(key: string | any[], options: {
|
|
3796
4044
|
key: string;
|
|
@@ -3798,70 +4046,120 @@ declare class IO {
|
|
|
3798
4046
|
id: string;
|
|
3799
4047
|
key: string;
|
|
3800
4048
|
}>;
|
|
4049
|
+
/** `io.registerInterval()` allows you to register a [DynamicSchedule](https://trigger.dev/docs/sdk/dynamicschedule) that will trigger any jobs it's attached to on a regular interval.
|
|
4050
|
+
* @param key Should be a stable and unique key inside the `run()`. See [resumability](https://trigger.dev/docs/documentation/concepts/resumability) for more information.
|
|
4051
|
+
* @param dynamicSchedule The [DynamicSchedule](https://trigger.dev/docs/sdk/dynamicschedule) to register a new schedule on.
|
|
4052
|
+
* @param id A unique id for the interval. This is used to identify and unregister the interval later.
|
|
4053
|
+
* @param options The options for the interval.
|
|
4054
|
+
* @returns A promise that has information about the interval.
|
|
4055
|
+
*/
|
|
3801
4056
|
registerInterval(key: string | any[], dynamicSchedule: DynamicSchedule, id: string, options: IntervalOptions): Promise<{
|
|
3802
|
-
metadata?: any;
|
|
3803
4057
|
id: string;
|
|
3804
4058
|
schedule: {
|
|
3805
|
-
metadata?: any;
|
|
3806
4059
|
options: {
|
|
3807
4060
|
cron: string;
|
|
3808
4061
|
};
|
|
3809
4062
|
type: "cron";
|
|
3810
|
-
} | {
|
|
3811
4063
|
metadata?: any;
|
|
4064
|
+
} | {
|
|
3812
4065
|
options: {
|
|
3813
4066
|
seconds: number;
|
|
3814
4067
|
};
|
|
3815
4068
|
type: "interval";
|
|
4069
|
+
metadata?: any;
|
|
3816
4070
|
};
|
|
3817
4071
|
active: boolean;
|
|
4072
|
+
metadata?: any;
|
|
3818
4073
|
}>;
|
|
4074
|
+
/** `io.unregisterInterval()` allows you to unregister a [DynamicSchedule](https://trigger.dev/docs/sdk/dynamicschedule) that was previously registered with `io.registerInterval()`.
|
|
4075
|
+
* @param key Should be a stable and unique key inside the `run()`. See [resumability](https://trigger.dev/docs/documentation/concepts/resumability) for more information.
|
|
4076
|
+
* @param dynamicSchedule The [DynamicSchedule](https://trigger.dev/docs/sdk/dynamicschedule) to unregister a schedule on.
|
|
4077
|
+
* @param id A unique id for the interval. This is used to identify and unregister the interval later.
|
|
4078
|
+
*/
|
|
3819
4079
|
unregisterInterval(key: string | any[], dynamicSchedule: DynamicSchedule, id: string): Promise<{
|
|
3820
4080
|
ok: boolean;
|
|
3821
4081
|
}>;
|
|
4082
|
+
/** `io.registerCron()` allows you to register a [DynamicSchedule](https://trigger.dev/docs/sdk/dynamicschedule) that will trigger any jobs it's attached to on a regular CRON schedule.
|
|
4083
|
+
* @param key Should be a stable and unique key inside the `run()`. See [resumability](https://trigger.dev/docs/documentation/concepts/resumability) for more information.
|
|
4084
|
+
* @param dynamicSchedule The [DynamicSchedule](https://trigger.dev/docs/sdk/dynamicschedule) to register a new schedule on.
|
|
4085
|
+
* @param id A unique id for the schedule. This is used to identify and unregister the schedule later.
|
|
4086
|
+
* @param options The options for the CRON schedule.
|
|
4087
|
+
*/
|
|
3822
4088
|
registerCron(key: string | any[], dynamicSchedule: DynamicSchedule, id: string, options: CronOptions): Promise<{
|
|
3823
|
-
metadata?: any;
|
|
3824
4089
|
id: string;
|
|
3825
4090
|
schedule: {
|
|
3826
|
-
metadata?: any;
|
|
3827
4091
|
options: {
|
|
3828
4092
|
cron: string;
|
|
3829
4093
|
};
|
|
3830
4094
|
type: "cron";
|
|
3831
|
-
} | {
|
|
3832
4095
|
metadata?: any;
|
|
4096
|
+
} | {
|
|
3833
4097
|
options: {
|
|
3834
4098
|
seconds: number;
|
|
3835
4099
|
};
|
|
3836
4100
|
type: "interval";
|
|
4101
|
+
metadata?: any;
|
|
3837
4102
|
};
|
|
3838
4103
|
active: boolean;
|
|
4104
|
+
metadata?: any;
|
|
3839
4105
|
}>;
|
|
4106
|
+
/** `io.unregisterCron()` allows you to unregister a [DynamicSchedule](https://trigger.dev/docs/sdk/dynamicschedule) that was previously registered with `io.registerCron()`.
|
|
4107
|
+
* @param key Should be a stable and unique key inside the `run()`. See [resumability](https://trigger.dev/docs/documentation/concepts/resumability) for more information.
|
|
4108
|
+
* @param dynamicSchedule The [DynamicSchedule](https://trigger.dev/docs/sdk/dynamicschedule) to unregister a schedule on.
|
|
4109
|
+
* @param id A unique id for the interval. This is used to identify and unregister the interval later.
|
|
4110
|
+
*/
|
|
3840
4111
|
unregisterCron(key: string | any[], dynamicSchedule: DynamicSchedule, id: string): Promise<{
|
|
3841
4112
|
ok: boolean;
|
|
3842
4113
|
}>;
|
|
4114
|
+
/** `io.registerTrigger()` allows you to register a [DynamicTrigger](https://trigger.dev/docs/sdk/dynamictrigger) with the specified trigger params.
|
|
4115
|
+
* @param key Should be a stable and unique key inside the `run()`. See [resumability](https://trigger.dev/docs/documentation/concepts/resumability) for more information.
|
|
4116
|
+
* @param trigger The [DynamicTrigger](https://trigger.dev/docs/sdk/dynamictrigger) to register.
|
|
4117
|
+
* @param id A unique id for the trigger. This is used to identify and unregister the trigger later.
|
|
4118
|
+
* @param params The params for the trigger.
|
|
4119
|
+
*/
|
|
3843
4120
|
registerTrigger<TTrigger extends DynamicTrigger<EventSpecification<any>, ExternalSource<any, any, any>>>(key: string | any[], trigger: TTrigger, id: string, params: ExternalSourceParams<TTrigger["source"]>): Promise<{
|
|
3844
4121
|
id: string;
|
|
3845
4122
|
key: string;
|
|
3846
4123
|
} | undefined>;
|
|
3847
4124
|
getAuth(key: string | any[], clientId?: string): Promise<ConnectionAuth | undefined>;
|
|
4125
|
+
/** `io.runTask()` allows you to run a [Task](https://trigger.dev/docs/documentation/concepts/tasks) from inside a Job run. A Task is a resumable unit of a Run that can be retried, resumed and is logged. [Integrations](https://trigger.dev/docs/integrations) use Tasks internally to perform their actions.
|
|
4126
|
+
*
|
|
4127
|
+
* @param key Should be a stable and unique key inside the `run()`. See [resumability](https://trigger.dev/docs/documentation/concepts/resumability) for more information.
|
|
4128
|
+
* @param options The options of how you'd like to run and log the Task. Name is required.
|
|
4129
|
+
* @param callback The callback that will be called when the Task is run. The callback receives the Task and the IO as parameters.
|
|
4130
|
+
= * @param onError The callback that will be called when the Task fails. The callback receives the error, the Task and the IO as parameters. If you wish to retry then return an object with a `retryAt` property.
|
|
4131
|
+
* @returns A Promise that resolves with the returned value of the callback.
|
|
4132
|
+
*/
|
|
3848
4133
|
runTask<TResult extends SerializableJson | void = void>(key: string | any[], options: RunTaskOptions, callback: (task: IOTask, io: IO) => Promise<TResult>, onError?: (error: unknown, task: IOTask, io: IO) => {
|
|
3849
4134
|
retryAt: Date;
|
|
3850
4135
|
error?: Error;
|
|
3851
4136
|
jitter?: number;
|
|
3852
|
-
} | undefined | void): Promise<TResult>;
|
|
4137
|
+
} | Error | undefined | void): Promise<TResult>;
|
|
4138
|
+
/** `io.try()` allows you to run Tasks and catch any errors that are thrown, it's similar to a normal `try/catch` block but works with [io.runTask()](/sdk/io/runtask).
|
|
4139
|
+
* A regular `try/catch` block on its own won't work as expected with Tasks. Internally `runTask()` throws some special errors to control flow execution. This is necessary to deal with resumability, serverless timeouts, and retrying Tasks.
|
|
4140
|
+
* @param tryCallback The code you wish to run
|
|
4141
|
+
* @param catchCallback Thhis will be called if the Task fails. The callback receives the error
|
|
4142
|
+
* @returns A Promise that resolves with the returned value or the error
|
|
4143
|
+
*/
|
|
3853
4144
|
try<TResult, TCatchResult>(tryCallback: () => Promise<TResult>, catchCallback: (error: unknown) => Promise<TCatchResult>): Promise<TResult | TCatchResult>;
|
|
3854
4145
|
}
|
|
3855
|
-
type CallbackFunction = (level: "DEBUG" | "INFO" | "WARN" | "ERROR", message: string, properties?: Record<string, any>) => Promise<void>;
|
|
4146
|
+
type CallbackFunction = (level: "DEBUG" | "INFO" | "WARN" | "ERROR" | "LOG", message: string, properties?: Record<string, any>) => Promise<void>;
|
|
3856
4147
|
declare class IOLogger implements TaskLogger {
|
|
3857
4148
|
private callback;
|
|
3858
4149
|
constructor(callback: CallbackFunction);
|
|
4150
|
+
/** Log: essential messages */
|
|
4151
|
+
log(message: string, properties?: Record<string, any>): Promise<void>;
|
|
4152
|
+
/** For debugging: the least important log level */
|
|
3859
4153
|
debug(message: string, properties?: Record<string, any>): Promise<void>;
|
|
4154
|
+
/** Info: the second least important log level */
|
|
3860
4155
|
info(message: string, properties?: Record<string, any>): Promise<void>;
|
|
4156
|
+
/** Warnings: the third most important log level */
|
|
3861
4157
|
warn(message: string, properties?: Record<string, any>): Promise<void>;
|
|
4158
|
+
/** Error: The second most important log level */
|
|
3862
4159
|
error(message: string, properties?: Record<string, any>): Promise<void>;
|
|
3863
4160
|
}
|
|
3864
4161
|
|
|
4162
|
+
type IntegrationRunTaskFunction<TClient> = <TResult>(key: string | any[], callback: (client: TClient, task: IOTask, io: IO) => Promise<TResult>, options?: RunTaskOptions) => Promise<TResult>;
|
|
3865
4163
|
type ClientFactory<TClient> = (auth: ConnectionAuth) => TClient;
|
|
3866
4164
|
interface TriggerIntegration<TIntegrationClient extends IntegrationClient<any, any> = IntegrationClient<any, any>> {
|
|
3867
4165
|
client: TIntegrationClient;
|
|
@@ -3884,7 +4182,7 @@ type AuthenticatedTask<TClient, TParams, TResult, TAuth = ConnectionAuth> = {
|
|
|
3884
4182
|
onError?: (error: unknown, task: ServerTask) => {
|
|
3885
4183
|
retryAt: Date;
|
|
3886
4184
|
error?: Error;
|
|
3887
|
-
} | undefined | void;
|
|
4185
|
+
} | Error | undefined | void;
|
|
3888
4186
|
};
|
|
3889
4187
|
declare function authenticatedTask<TClient, TParams, TResult>(options: {
|
|
3890
4188
|
run: (params: TParams, client: TClient, task: ServerTask, io: IO) => Promise<TResult>;
|
|
@@ -3899,11 +4197,13 @@ type ExtractIntegrationClientClient<TIntegrationClient extends IntegrationClient
|
|
|
3899
4197
|
client: infer TClient;
|
|
3900
4198
|
} ? {
|
|
3901
4199
|
client: TClient;
|
|
4200
|
+
runTask: IntegrationRunTaskFunction<TClient>;
|
|
3902
4201
|
} : TIntegrationClient extends {
|
|
3903
4202
|
usesLocalAuth: false;
|
|
3904
4203
|
clientFactory: ClientFactory<infer TClient>;
|
|
3905
4204
|
} ? {
|
|
3906
4205
|
client: TClient;
|
|
4206
|
+
runTask: IntegrationRunTaskFunction<TClient>;
|
|
3907
4207
|
} : never;
|
|
3908
4208
|
type ExtractIntegrationClient<TIntegrationClient extends IntegrationClient<any, any>> = ExtractIntegrationClientClient<TIntegrationClient> & ExtractTasks<TIntegrationClient["tasks"]>;
|
|
3909
4209
|
type ExtractIntegrations<TIntegrations extends Record<string, TriggerIntegration<IntegrationClient<any, any>>>> = {
|
|
@@ -3912,28 +4212,69 @@ type ExtractIntegrations<TIntegrations extends Record<string, TriggerIntegration
|
|
|
3912
4212
|
type IOWithIntegrations<TIntegrations extends Record<string, TriggerIntegration<IntegrationClient<any, any>>>> = IO & ExtractIntegrations<TIntegrations>;
|
|
3913
4213
|
|
|
3914
4214
|
type JobOptions<TTrigger extends Trigger<EventSpecification<any>>, TIntegrations extends Record<string, TriggerIntegration<IntegrationClient<any, any>>> = {}> = {
|
|
4215
|
+
/** The `id` property is used to uniquely identify the Job. Only change this if you want to create a new Job. */
|
|
3915
4216
|
id: string;
|
|
4217
|
+
/** The `name` of the Job that you want to appear in the dashboard and logs. You can change this without creating a new Job. */
|
|
3916
4218
|
name: string;
|
|
4219
|
+
/** The `version` property is used to version your Job. A new version will be created if you change this property. We recommend using [semantic versioning](https://www.baeldung.com/cs/semantic-versioning), e.g. `1.0.3`. */
|
|
3917
4220
|
version: string;
|
|
4221
|
+
/** The `trigger` property is used to define when the Job should run. There are currently the following Trigger types:
|
|
4222
|
+
- [cronTrigger](https://trigger.dev/docs/sdk/crontrigger)
|
|
4223
|
+
- [intervalTrigger](https://trigger.dev/docs/sdk/intervaltrigger)
|
|
4224
|
+
- [eventTrigger](https://trigger.dev/docs/sdk/eventtrigger)
|
|
4225
|
+
- [DynamicTrigger](https://trigger.dev/docs/sdk/dynamictrigger)
|
|
4226
|
+
- [DynamicSchedule](https://trigger.dev/docs/sdk/dynamicschedule)
|
|
4227
|
+
- integration Triggers, like webhooks. See the [integrations](https://trigger.dev/docs/integrations) page for more information. */
|
|
3918
4228
|
trigger: TTrigger;
|
|
4229
|
+
/** The `logLevel` property is an optional property that specifies the level of
|
|
4230
|
+
logging for the Job. The level is inherited from the client if you omit this property. */
|
|
3919
4231
|
logLevel?: LogLevel;
|
|
4232
|
+
/** Imports the specified integrations into the Job. The integrations will be available on the `io` object in the `run()` function with the same name as the key. For example:
|
|
4233
|
+
```ts
|
|
4234
|
+
client.defineJob({
|
|
4235
|
+
//... other options
|
|
4236
|
+
integrations: {
|
|
4237
|
+
slack,
|
|
4238
|
+
gh: github,
|
|
4239
|
+
},
|
|
4240
|
+
run: async (payload, io, ctx) => {
|
|
4241
|
+
//slack is available on io.slack
|
|
4242
|
+
io.slack.postMessage(...);
|
|
4243
|
+
//github is available on io.gh
|
|
4244
|
+
io.gh.addIssueLabels(...);
|
|
4245
|
+
}
|
|
4246
|
+
});
|
|
4247
|
+
``` */
|
|
3920
4248
|
integrations?: TIntegrations;
|
|
4249
|
+
/** The `queue` property is used to specify a custom queue. If you use an Object and specify the `maxConcurrent` option, you can control how many simulataneous runs can happen. */
|
|
3921
4250
|
queue?: QueueOptions | string;
|
|
3922
4251
|
startPosition?: "initial" | "latest";
|
|
4252
|
+
/** The `enabled` property is used to enable or disable the Job. If you disable a Job, it will not run. */
|
|
3923
4253
|
enabled?: boolean;
|
|
3924
|
-
|
|
4254
|
+
/** This function gets called automatically when a Run is Triggered.
|
|
4255
|
+
* This is where you put the code you want to run for a Job. You can use normal code in here and you can also use Tasks. You can return a value from this function and it will be sent back to the Trigger API.
|
|
4256
|
+
* @param payload The payload of the event
|
|
4257
|
+
* @param io An object that contains the integrations that you specified in the `integrations` property and other useful functions like delays and running Tasks.
|
|
4258
|
+
* @param context An object that contains information about the Organization, Job, Run and more.
|
|
4259
|
+
*/
|
|
4260
|
+
run: (payload: TriggerEventType<TTrigger>, io: IOWithIntegrations<TIntegrations>, context: TriggerContext) => Promise<any>;
|
|
3925
4261
|
};
|
|
4262
|
+
/** A [Job](https://trigger.dev/docs/documentation/concepts/jobs) is used to define the [Trigger](https://trigger.dev/docs/documentation/concepts/triggers), metadata, and what happens when it runs. */
|
|
3926
4263
|
declare class Job<TTrigger extends Trigger<EventSpecification<any>>, TIntegrations extends Record<string, TriggerIntegration<IntegrationClient<any, any>>> = {}> {
|
|
3927
4264
|
#private;
|
|
3928
4265
|
readonly options: JobOptions<TTrigger, TIntegrations>;
|
|
3929
4266
|
client: TriggerClient;
|
|
3930
|
-
constructor(
|
|
4267
|
+
constructor(
|
|
4268
|
+
/** An instance of [TriggerClient](/sdk/triggerclient) that is used to send events
|
|
4269
|
+
to the Trigger API. */
|
|
4270
|
+
client: TriggerClient, options: JobOptions<TTrigger, TIntegrations>);
|
|
3931
4271
|
get id(): string;
|
|
3932
4272
|
get enabled(): boolean;
|
|
3933
4273
|
get name(): string;
|
|
3934
4274
|
get trigger(): TTrigger;
|
|
3935
4275
|
get version(): string;
|
|
3936
4276
|
get integrations(): Record<string, IntegrationConfig>;
|
|
4277
|
+
get logLevel(): LogLevel | undefined;
|
|
3937
4278
|
toJSON(): JobMetadata;
|
|
3938
4279
|
}
|
|
3939
4280
|
|
|
@@ -3951,12 +4292,40 @@ declare class EventTrigger<TEventSpecification extends EventSpecification<any>>
|
|
|
3951
4292
|
attachToJob(triggerClient: TriggerClient, job: Job<Trigger<TEventSpecification>, any>): void;
|
|
3952
4293
|
get preprocessRuns(): boolean;
|
|
3953
4294
|
}
|
|
4295
|
+
/** Configuration options for an EventTrigger */
|
|
3954
4296
|
type TriggerOptions<TEvent> = {
|
|
4297
|
+
/** The name of the event you are subscribing to. Must be an exact match (case sensitive). */
|
|
3955
4298
|
name: string;
|
|
4299
|
+
/** A [Zod](https://trigger.dev/docs/documentation/guides/zod) schema that defines the shape of the event payload.
|
|
4300
|
+
* The default is `z.any()` which is `any`.
|
|
4301
|
+
* */
|
|
3956
4302
|
schema?: z.Schema<TEvent>;
|
|
4303
|
+
/** You can use this to filter events based on the source. */
|
|
3957
4304
|
source?: string;
|
|
4305
|
+
/** Used to filter which events trigger the Job
|
|
4306
|
+
* @example
|
|
4307
|
+
* filter:
|
|
4308
|
+
* ```ts
|
|
4309
|
+
* {
|
|
4310
|
+
* name: ["John", "Jane"],
|
|
4311
|
+
* age: [18, 21]
|
|
4312
|
+
* }
|
|
4313
|
+
* ```
|
|
4314
|
+
*
|
|
4315
|
+
* This filter would match against an event with the following data:
|
|
4316
|
+
* ```json
|
|
4317
|
+
* {
|
|
4318
|
+
* "name": "Jane",
|
|
4319
|
+
* "age": 18,
|
|
4320
|
+
* "location": "San Francisco"
|
|
4321
|
+
* }
|
|
4322
|
+
* ```
|
|
4323
|
+
*/
|
|
3958
4324
|
filter?: EventFilter;
|
|
3959
4325
|
};
|
|
4326
|
+
/** `eventTrigger()` is set as a [Job's trigger](https://trigger.dev/docs/sdk/job) to subscribe to an event a Job from [a sent event](https://trigger.dev/docs/sdk/triggerclient/instancemethods/sendevent)
|
|
4327
|
+
* @param options options for the EventTrigger
|
|
4328
|
+
*/
|
|
3960
4329
|
declare function eventTrigger<TEvent extends any = any>(options: TriggerOptions<TEvent>): Trigger<EventSpecification<TEvent>>;
|
|
3961
4330
|
|
|
3962
4331
|
declare function missingConnectionNotification(integrations: Array<TriggerIntegration>): MissingConnectionNotification;
|
|
@@ -3988,8 +4357,8 @@ declare class MissingConnectionNotification implements Trigger<MissingConnection
|
|
|
3988
4357
|
id: string;
|
|
3989
4358
|
type: "EXTERNAL";
|
|
3990
4359
|
account: {
|
|
3991
|
-
metadata?: any;
|
|
3992
4360
|
id: string;
|
|
4361
|
+
metadata?: any;
|
|
3993
4362
|
};
|
|
3994
4363
|
client: {
|
|
3995
4364
|
id: string;
|
|
@@ -4035,8 +4404,8 @@ declare class MissingConnectionResolvedNotification implements Trigger<MissingCo
|
|
|
4035
4404
|
id: string;
|
|
4036
4405
|
type: "EXTERNAL";
|
|
4037
4406
|
account: {
|
|
4038
|
-
metadata?: any;
|
|
4039
4407
|
id: string;
|
|
4408
|
+
metadata?: any;
|
|
4040
4409
|
};
|
|
4041
4410
|
client: {
|
|
4042
4411
|
id: string;
|
|
@@ -4069,9 +4438,21 @@ declare class RetryWithTaskError {
|
|
|
4069
4438
|
retryAt: Date;
|
|
4070
4439
|
constructor(cause: ErrorWithStack, task: ServerTask, retryAt: Date);
|
|
4071
4440
|
}
|
|
4072
|
-
declare
|
|
4441
|
+
declare class CanceledWithTaskError {
|
|
4442
|
+
task: ServerTask;
|
|
4443
|
+
constructor(task: ServerTask);
|
|
4444
|
+
}
|
|
4445
|
+
/** Use this function if you're using a `try/catch` block to catch errors.
|
|
4446
|
+
* It checks if a thrown error is a special internal error that you should ignore.
|
|
4447
|
+
* If this returns `true` then you must rethrow the error: `throw err;`
|
|
4448
|
+
* @param err The error to check
|
|
4449
|
+
* @returns `true` if the error is a Trigger Error, `false` otherwise.
|
|
4450
|
+
*/
|
|
4451
|
+
declare function isTriggerError(err: unknown): err is ResumeWithTaskError | RetryWithTaskError | CanceledWithTaskError;
|
|
4073
4452
|
|
|
4074
4453
|
type Task = ServerTask;
|
|
4454
|
+
|
|
4455
|
+
type SentEvent = ApiEventLog;
|
|
4075
4456
|
declare function redactString(strings: TemplateStringsArray, ...interpolations: string[]): RedactString;
|
|
4076
4457
|
|
|
4077
|
-
export { AuthenticatedTask, ClientFactory, CronTrigger, DynamicIntervalOptions, DynamicSchedule, DynamicTrigger, DynamicTriggerOptions, EventFilter, EventSpecification, EventSpecificationExample, EventTrigger, EventTypeFromSpecification, ExternalSource, ExternalSourceParams, ExternalSourceTrigger, ExternalSourceTriggerOptions, HandlerEvent, HttpSourceEvent, IO, IOLogger, IOOptions, IOTask, IOWithIntegrations, IntegrationClient, IntervalTrigger, Job, JobOptions,
|
|
4458
|
+
export { AuthenticatedTask, ClientFactory, CronTrigger, DynamicIntervalOptions, DynamicSchedule, DynamicTrigger, DynamicTriggerOptions, EventFilter, EventSpecification, EventSpecificationExample, EventTrigger, EventTypeFromSpecification, ExternalSource, ExternalSourceParams, ExternalSourceTrigger, ExternalSourceTriggerOptions, HandlerEvent, HttpSourceEvent, IO, IOLogger, IOOptions, IOTask, IOWithIntegrations, IntegrationClient, IntervalTrigger, Job, JobOptions, Logger, MissingConnectionNotification, MissingConnectionResolvedNotification, NormalizedRequest, PreprocessResults, RedactString, SentEvent, Task, TaskLogger, Trigger, TriggerClient, TriggerClientOptions, TriggerContext, TriggerEventType, TriggerIntegration, TriggerPreprocessContext, authenticatedTask, cronTrigger, eventTrigger, intervalTrigger, isTriggerError, missingConnectionNotification, missingConnectionResolvedNotification, omit, redactString };
|