@trigger.dev/core 0.0.0-statuses-20230921210707 → 0.0.0-yalt-20231214135505
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +16770 -0
- package/dist/index.d.ts +8800 -1357
- package/dist/index.js +1338 -924
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1841 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +15 -9
package/dist/index.js
CHANGED
|
@@ -1,330 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
var __accessCheck = (obj, member, msg) => {
|
|
21
|
-
if (!member.has(obj))
|
|
22
|
-
throw TypeError("Cannot " + msg);
|
|
23
|
-
};
|
|
24
|
-
var __privateGet = (obj, member, getter) => {
|
|
25
|
-
__accessCheck(obj, member, "read from private field");
|
|
26
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
27
|
-
};
|
|
28
|
-
var __privateAdd = (obj, member, value) => {
|
|
29
|
-
if (member.has(obj))
|
|
30
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
31
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
32
|
-
};
|
|
33
|
-
var __privateSet = (obj, member, value, setter) => {
|
|
34
|
-
__accessCheck(obj, member, "write to private field");
|
|
35
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
36
|
-
return value;
|
|
37
|
-
};
|
|
38
|
-
var __privateMethod = (obj, member, method) => {
|
|
39
|
-
__accessCheck(obj, member, "access private method");
|
|
40
|
-
return method;
|
|
41
|
-
};
|
|
1
|
+
'use strict';
|
|
42
2
|
|
|
43
|
-
|
|
44
|
-
var
|
|
45
|
-
__export(src_exports, {
|
|
46
|
-
ApiEventLogSchema: () => ApiEventLogSchema,
|
|
47
|
-
CachedTaskSchema: () => CachedTaskSchema,
|
|
48
|
-
CommonMissingConnectionNotificationPayloadSchema: () => CommonMissingConnectionNotificationPayloadSchema,
|
|
49
|
-
CommonMissingConnectionNotificationResolvedPayloadSchema: () => CommonMissingConnectionNotificationResolvedPayloadSchema,
|
|
50
|
-
CompleteTaskBodyInputSchema: () => CompleteTaskBodyInputSchema,
|
|
51
|
-
ConnectionAuthSchema: () => ConnectionAuthSchema,
|
|
52
|
-
CreateExternalConnectionBodySchema: () => CreateExternalConnectionBodySchema,
|
|
53
|
-
CreateRunResponseBodySchema: () => CreateRunResponseBodySchema,
|
|
54
|
-
CronMetadataSchema: () => CronMetadataSchema,
|
|
55
|
-
CronOptionsSchema: () => CronOptionsSchema,
|
|
56
|
-
DeliverEventResponseSchema: () => DeliverEventResponseSchema,
|
|
57
|
-
DeserializedJsonSchema: () => DeserializedJsonSchema,
|
|
58
|
-
DisplayPropertiesSchema: () => DisplayPropertiesSchema,
|
|
59
|
-
DisplayPropertySchema: () => DisplayPropertySchema,
|
|
60
|
-
DynamicTriggerEndpointMetadataSchema: () => DynamicTriggerEndpointMetadataSchema,
|
|
61
|
-
DynamicTriggerMetadataSchema: () => DynamicTriggerMetadataSchema,
|
|
62
|
-
ErrorWithStackSchema: () => ErrorWithStackSchema,
|
|
63
|
-
EventExampleSchema: () => EventExampleSchema,
|
|
64
|
-
EventFilterSchema: () => EventFilterSchema,
|
|
65
|
-
EventRuleSchema: () => EventRuleSchema,
|
|
66
|
-
EventSpecificationSchema: () => EventSpecificationSchema,
|
|
67
|
-
FailTaskBodyInputSchema: () => FailTaskBodyInputSchema,
|
|
68
|
-
FetchOperationSchema: () => FetchOperationSchema,
|
|
69
|
-
FetchRequestInitSchema: () => FetchRequestInitSchema,
|
|
70
|
-
FetchRetryBackoffStrategySchema: () => FetchRetryBackoffStrategySchema,
|
|
71
|
-
FetchRetryHeadersStrategySchema: () => FetchRetryHeadersStrategySchema,
|
|
72
|
-
FetchRetryOptionsSchema: () => FetchRetryOptionsSchema,
|
|
73
|
-
FetchRetryStrategySchema: () => FetchRetryStrategySchema,
|
|
74
|
-
GetEventSchema: () => GetEventSchema,
|
|
75
|
-
GetRunSchema: () => GetRunSchema,
|
|
76
|
-
GetRunStatusesSchema: () => GetRunStatusesSchema,
|
|
77
|
-
GetRunsSchema: () => GetRunsSchema,
|
|
78
|
-
HandleTriggerSourceSchema: () => HandleTriggerSourceSchema,
|
|
79
|
-
HttpSourceRequestHeadersSchema: () => HttpSourceRequestHeadersSchema,
|
|
80
|
-
HttpSourceRequestSchema: () => HttpSourceRequestSchema,
|
|
81
|
-
HttpSourceResponseSchema: () => HttpSourceResponseSchema,
|
|
82
|
-
IndexEndpointResponseSchema: () => IndexEndpointResponseSchema,
|
|
83
|
-
InitializeCronScheduleBodySchema: () => InitializeCronScheduleBodySchema,
|
|
84
|
-
InitializeTriggerBodySchema: () => InitializeTriggerBodySchema,
|
|
85
|
-
IntegrationConfigSchema: () => IntegrationConfigSchema,
|
|
86
|
-
IntegrationMetadataSchema: () => IntegrationMetadataSchema,
|
|
87
|
-
IntervalMetadataSchema: () => IntervalMetadataSchema,
|
|
88
|
-
IntervalOptionsSchema: () => IntervalOptionsSchema,
|
|
89
|
-
JobMetadataSchema: () => JobMetadataSchema,
|
|
90
|
-
JobRunStatusRecordSchema: () => JobRunStatusRecordSchema,
|
|
91
|
-
LogMessageSchema: () => LogMessageSchema,
|
|
92
|
-
Logger: () => Logger,
|
|
93
|
-
MISSING_CONNECTION_NOTIFICATION: () => MISSING_CONNECTION_NOTIFICATION,
|
|
94
|
-
MISSING_CONNECTION_RESOLVED_NOTIFICATION: () => MISSING_CONNECTION_RESOLVED_NOTIFICATION,
|
|
95
|
-
MissingConnectionNotificationPayloadSchema: () => MissingConnectionNotificationPayloadSchema,
|
|
96
|
-
MissingConnectionResolvedNotificationPayloadSchema: () => MissingConnectionResolvedNotificationPayloadSchema,
|
|
97
|
-
MissingDeveloperConnectionNotificationPayloadSchema: () => MissingDeveloperConnectionNotificationPayloadSchema,
|
|
98
|
-
MissingDeveloperConnectionResolvedNotificationPayloadSchema: () => MissingDeveloperConnectionResolvedNotificationPayloadSchema,
|
|
99
|
-
MissingExternalConnectionNotificationPayloadSchema: () => MissingExternalConnectionNotificationPayloadSchema,
|
|
100
|
-
MissingExternalConnectionResolvedNotificationPayloadSchema: () => MissingExternalConnectionResolvedNotificationPayloadSchema,
|
|
101
|
-
NormalizedRequestSchema: () => NormalizedRequestSchema,
|
|
102
|
-
NormalizedResponseSchema: () => NormalizedResponseSchema,
|
|
103
|
-
PongErrorResponseSchema: () => PongErrorResponseSchema,
|
|
104
|
-
PongResponseSchema: () => PongResponseSchema,
|
|
105
|
-
PongSuccessResponseSchema: () => PongSuccessResponseSchema,
|
|
106
|
-
PreprocessRunBodySchema: () => PreprocessRunBodySchema,
|
|
107
|
-
PreprocessRunResponseSchema: () => PreprocessRunResponseSchema,
|
|
108
|
-
QueueOptionsSchema: () => QueueOptionsSchema,
|
|
109
|
-
REGISTER_SOURCE_EVENT_V1: () => REGISTER_SOURCE_EVENT_V1,
|
|
110
|
-
REGISTER_SOURCE_EVENT_V2: () => REGISTER_SOURCE_EVENT_V2,
|
|
111
|
-
RawEventSchema: () => RawEventSchema,
|
|
112
|
-
RedactSchema: () => RedactSchema,
|
|
113
|
-
RedactStringSchema: () => RedactStringSchema,
|
|
114
|
-
RegisterDynamicSchedulePayloadSchema: () => RegisterDynamicSchedulePayloadSchema,
|
|
115
|
-
RegisterHTTPTriggerSourceBodySchema: () => RegisterHTTPTriggerSourceBodySchema,
|
|
116
|
-
RegisterIntervalScheduleBodySchema: () => RegisterIntervalScheduleBodySchema,
|
|
117
|
-
RegisterSMTPTriggerSourceBodySchema: () => RegisterSMTPTriggerSourceBodySchema,
|
|
118
|
-
RegisterSQSTriggerSourceBodySchema: () => RegisterSQSTriggerSourceBodySchema,
|
|
119
|
-
RegisterScheduleBodySchema: () => RegisterScheduleBodySchema,
|
|
120
|
-
RegisterScheduleResponseBodySchema: () => RegisterScheduleResponseBodySchema,
|
|
121
|
-
RegisterSourceChannelBodySchema: () => RegisterSourceChannelBodySchema,
|
|
122
|
-
RegisterSourceEventSchemaV1: () => RegisterSourceEventSchemaV1,
|
|
123
|
-
RegisterSourceEventSchemaV2: () => RegisterSourceEventSchemaV2,
|
|
124
|
-
RegisterTriggerBodySchemaV1: () => RegisterTriggerBodySchemaV1,
|
|
125
|
-
RegisterTriggerBodySchemaV2: () => RegisterTriggerBodySchemaV2,
|
|
126
|
-
RegisterTriggerSourceSchema: () => RegisterTriggerSourceSchema,
|
|
127
|
-
RetryOptionsSchema: () => RetryOptionsSchema,
|
|
128
|
-
RunJobBodySchema: () => RunJobBodySchema,
|
|
129
|
-
RunJobCanceledWithTaskSchema: () => RunJobCanceledWithTaskSchema,
|
|
130
|
-
RunJobErrorSchema: () => RunJobErrorSchema,
|
|
131
|
-
RunJobResponseSchema: () => RunJobResponseSchema,
|
|
132
|
-
RunJobResumeWithTaskSchema: () => RunJobResumeWithTaskSchema,
|
|
133
|
-
RunJobRetryWithTaskSchema: () => RunJobRetryWithTaskSchema,
|
|
134
|
-
RunJobSuccessSchema: () => RunJobSuccessSchema,
|
|
135
|
-
RunSourceContextSchema: () => RunSourceContextSchema,
|
|
136
|
-
RunStatusSchema: () => RunStatusSchema,
|
|
137
|
-
RunTaskBodyInputSchema: () => RunTaskBodyInputSchema,
|
|
138
|
-
RunTaskBodyOutputSchema: () => RunTaskBodyOutputSchema,
|
|
139
|
-
RunTaskOptionsSchema: () => RunTaskOptionsSchema,
|
|
140
|
-
RunTaskSchema: () => RunTaskSchema,
|
|
141
|
-
RuntimeEnvironmentTypeSchema: () => RuntimeEnvironmentTypeSchema,
|
|
142
|
-
SCHEDULED_EVENT: () => SCHEDULED_EVENT,
|
|
143
|
-
ScheduleMetadataSchema: () => ScheduleMetadataSchema,
|
|
144
|
-
ScheduledPayloadSchema: () => ScheduledPayloadSchema,
|
|
145
|
-
ScheduledTriggerMetadataSchema: () => ScheduledTriggerMetadataSchema,
|
|
146
|
-
SendEventBodySchema: () => SendEventBodySchema,
|
|
147
|
-
SendEventOptionsSchema: () => SendEventOptionsSchema,
|
|
148
|
-
SerializableJsonSchema: () => SerializableJsonSchema,
|
|
149
|
-
ServerTaskSchema: () => ServerTaskSchema,
|
|
150
|
-
SourceMetadataV2Schema: () => SourceMetadataV2Schema,
|
|
151
|
-
StaticTriggerMetadataSchema: () => StaticTriggerMetadataSchema,
|
|
152
|
-
StatusHistorySchema: () => StatusHistorySchema,
|
|
153
|
-
StatusUpdateSchema: () => StatusUpdateSchema,
|
|
154
|
-
StatusUpdateStateSchema: () => StatusUpdateStateSchema,
|
|
155
|
-
StyleSchema: () => StyleSchema,
|
|
156
|
-
TaskSchema: () => TaskSchema,
|
|
157
|
-
TaskStatusSchema: () => TaskStatusSchema,
|
|
158
|
-
TriggerMetadataSchema: () => TriggerMetadataSchema,
|
|
159
|
-
TriggerSourceSchema: () => TriggerSourceSchema,
|
|
160
|
-
UpdateTriggerSourceBodyV1Schema: () => UpdateTriggerSourceBodyV1Schema,
|
|
161
|
-
UpdateTriggerSourceBodyV2Schema: () => UpdateTriggerSourceBodyV2Schema,
|
|
162
|
-
ValidateErrorResponseSchema: () => ValidateErrorResponseSchema,
|
|
163
|
-
ValidateResponseSchema: () => ValidateResponseSchema,
|
|
164
|
-
ValidateSuccessResponseSchema: () => ValidateSuccessResponseSchema,
|
|
165
|
-
addMissingVersionField: () => addMissingVersionField,
|
|
166
|
-
calculateRetryAt: () => calculateRetryAt,
|
|
167
|
-
currentDate: () => currentDate,
|
|
168
|
-
currentTimestampMilliseconds: () => currentTimestampMilliseconds,
|
|
169
|
-
currentTimestampSeconds: () => currentTimestampSeconds,
|
|
170
|
-
deepMergeFilters: () => deepMergeFilters,
|
|
171
|
-
eventFilterMatches: () => eventFilterMatches,
|
|
172
|
-
replacements: () => replacements,
|
|
173
|
-
urlWithSearchParams: () => urlWithSearchParams
|
|
174
|
-
});
|
|
175
|
-
module.exports = __toCommonJS(src_exports);
|
|
176
|
-
|
|
177
|
-
// src/logger.ts
|
|
178
|
-
var logLevels = [
|
|
179
|
-
"log",
|
|
180
|
-
"error",
|
|
181
|
-
"warn",
|
|
182
|
-
"info",
|
|
183
|
-
"debug"
|
|
184
|
-
];
|
|
185
|
-
var _name, _level, _filteredKeys, _jsonReplacer, _structuredLog, structuredLog_fn;
|
|
186
|
-
var _Logger = class _Logger {
|
|
187
|
-
constructor(name, level = "info", filteredKeys = [], jsonReplacer) {
|
|
188
|
-
__privateAdd(this, _structuredLog);
|
|
189
|
-
__privateAdd(this, _name, void 0);
|
|
190
|
-
__privateAdd(this, _level, void 0);
|
|
191
|
-
__privateAdd(this, _filteredKeys, []);
|
|
192
|
-
__privateAdd(this, _jsonReplacer, void 0);
|
|
193
|
-
__privateSet(this, _name, name);
|
|
194
|
-
__privateSet(this, _level, logLevels.indexOf(process.env.TRIGGER_LOG_LEVEL ?? level));
|
|
195
|
-
__privateSet(this, _filteredKeys, filteredKeys);
|
|
196
|
-
__privateSet(this, _jsonReplacer, jsonReplacer);
|
|
197
|
-
}
|
|
198
|
-
// Return a new Logger instance with the same name and a new log level
|
|
199
|
-
// but filter out the keys from the log messages (at any level)
|
|
200
|
-
filter(...keys) {
|
|
201
|
-
return new _Logger(__privateGet(this, _name), logLevels[__privateGet(this, _level)], keys, __privateGet(this, _jsonReplacer));
|
|
202
|
-
}
|
|
203
|
-
static satisfiesLogLevel(logLevel, setLevel) {
|
|
204
|
-
return logLevels.indexOf(logLevel) <= logLevels.indexOf(setLevel);
|
|
205
|
-
}
|
|
206
|
-
log(message, ...args) {
|
|
207
|
-
if (__privateGet(this, _level) < 0)
|
|
208
|
-
return;
|
|
209
|
-
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.log, message, ...args);
|
|
210
|
-
}
|
|
211
|
-
error(message, ...args) {
|
|
212
|
-
if (__privateGet(this, _level) < 1)
|
|
213
|
-
return;
|
|
214
|
-
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.error, message, ...args);
|
|
215
|
-
}
|
|
216
|
-
warn(message, ...args) {
|
|
217
|
-
if (__privateGet(this, _level) < 2)
|
|
218
|
-
return;
|
|
219
|
-
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.warn, message, ...args);
|
|
220
|
-
}
|
|
221
|
-
info(message, ...args) {
|
|
222
|
-
if (__privateGet(this, _level) < 3)
|
|
223
|
-
return;
|
|
224
|
-
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.info, message, ...args);
|
|
225
|
-
}
|
|
226
|
-
debug(message, ...args) {
|
|
227
|
-
if (__privateGet(this, _level) < 4)
|
|
228
|
-
return;
|
|
229
|
-
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.debug, message, ...args);
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
_name = new WeakMap();
|
|
233
|
-
_level = new WeakMap();
|
|
234
|
-
_filteredKeys = new WeakMap();
|
|
235
|
-
_jsonReplacer = new WeakMap();
|
|
236
|
-
_structuredLog = new WeakSet();
|
|
237
|
-
structuredLog_fn = /* @__PURE__ */ __name(function(loggerFunction, message, ...args) {
|
|
238
|
-
const structuredLog = {
|
|
239
|
-
...structureArgs(safeJsonClone(args), __privateGet(this, _filteredKeys)),
|
|
240
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
241
|
-
name: __privateGet(this, _name),
|
|
242
|
-
message
|
|
243
|
-
};
|
|
244
|
-
loggerFunction(JSON.stringify(structuredLog, createReplacer(__privateGet(this, _jsonReplacer))));
|
|
245
|
-
}, "#structuredLog");
|
|
246
|
-
__name(_Logger, "Logger");
|
|
247
|
-
var Logger = _Logger;
|
|
248
|
-
function createReplacer(replacer) {
|
|
249
|
-
return (key, value) => {
|
|
250
|
-
if (typeof value === "bigint") {
|
|
251
|
-
return value.toString();
|
|
252
|
-
}
|
|
253
|
-
if (replacer) {
|
|
254
|
-
return replacer(key, value);
|
|
255
|
-
}
|
|
256
|
-
return value;
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
__name(createReplacer, "createReplacer");
|
|
260
|
-
function bigIntReplacer(_key, value) {
|
|
261
|
-
if (typeof value === "bigint") {
|
|
262
|
-
return value.toString();
|
|
263
|
-
}
|
|
264
|
-
return value;
|
|
265
|
-
}
|
|
266
|
-
__name(bigIntReplacer, "bigIntReplacer");
|
|
267
|
-
function safeJsonClone(obj) {
|
|
268
|
-
try {
|
|
269
|
-
return JSON.parse(JSON.stringify(obj, bigIntReplacer));
|
|
270
|
-
} catch (e) {
|
|
271
|
-
return obj;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
__name(safeJsonClone, "safeJsonClone");
|
|
275
|
-
function structureArgs(args, filteredKeys = []) {
|
|
276
|
-
if (args.length === 0) {
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
if (args.length === 1 && typeof args[0] === "object") {
|
|
280
|
-
return filterKeys(JSON.parse(JSON.stringify(args[0], bigIntReplacer)), filteredKeys);
|
|
281
|
-
}
|
|
282
|
-
return args;
|
|
283
|
-
}
|
|
284
|
-
__name(structureArgs, "structureArgs");
|
|
285
|
-
function filterKeys(obj, keys) {
|
|
286
|
-
if (typeof obj !== "object" || obj === null) {
|
|
287
|
-
return obj;
|
|
288
|
-
}
|
|
289
|
-
if (Array.isArray(obj)) {
|
|
290
|
-
return obj.map((item) => filterKeys(item, keys));
|
|
291
|
-
}
|
|
292
|
-
const filteredObj = {};
|
|
293
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
294
|
-
if (keys.includes(key)) {
|
|
295
|
-
if (value) {
|
|
296
|
-
filteredObj[key] = `[filtered ${prettyPrintBytes(value)}]`;
|
|
297
|
-
} else {
|
|
298
|
-
filteredObj[key] = value;
|
|
299
|
-
}
|
|
300
|
-
continue;
|
|
301
|
-
}
|
|
302
|
-
filteredObj[key] = filterKeys(value, keys);
|
|
303
|
-
}
|
|
304
|
-
return filteredObj;
|
|
305
|
-
}
|
|
306
|
-
__name(filterKeys, "filterKeys");
|
|
307
|
-
function prettyPrintBytes(value) {
|
|
308
|
-
if (process.env.NODE_ENV === "production") {
|
|
309
|
-
return "skipped size";
|
|
310
|
-
}
|
|
311
|
-
const sizeInBytes = Buffer.byteLength(JSON.stringify(value), "utf8");
|
|
312
|
-
if (sizeInBytes < 1024) {
|
|
313
|
-
return `${sizeInBytes} bytes`;
|
|
314
|
-
}
|
|
315
|
-
if (sizeInBytes < 1024 * 1024) {
|
|
316
|
-
return `${(sizeInBytes / 1024).toFixed(2)} KB`;
|
|
317
|
-
}
|
|
318
|
-
if (sizeInBytes < 1024 * 1024 * 1024) {
|
|
319
|
-
return `${(sizeInBytes / (1024 * 1024)).toFixed(2)} MB`;
|
|
320
|
-
}
|
|
321
|
-
return `${(sizeInBytes / (1024 * 1024 * 1024)).toFixed(2)} GB`;
|
|
322
|
-
}
|
|
323
|
-
__name(prettyPrintBytes, "prettyPrintBytes");
|
|
3
|
+
var ulidx = require('ulidx');
|
|
4
|
+
var zod = require('zod');
|
|
324
5
|
|
|
325
|
-
|
|
326
|
-
var
|
|
327
|
-
var import_zod11 = require("zod");
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
328
8
|
|
|
329
9
|
// src/schemas/addMissingVersionField.ts
|
|
330
10
|
function addMissingVersionField(val) {
|
|
@@ -337,210 +17,204 @@ function addMissingVersionField(val) {
|
|
|
337
17
|
return val;
|
|
338
18
|
}
|
|
339
19
|
__name(addMissingVersionField, "addMissingVersionField");
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
20
|
+
var ErrorWithStackSchema = zod.z.object({
|
|
21
|
+
message: zod.z.string(),
|
|
22
|
+
name: zod.z.string().optional(),
|
|
23
|
+
stack: zod.z.string().optional()
|
|
24
|
+
});
|
|
25
|
+
var SchemaErrorSchema = zod.z.object({
|
|
26
|
+
path: zod.z.array(zod.z.string()),
|
|
27
|
+
message: zod.z.string()
|
|
28
|
+
});
|
|
29
|
+
var stringPatternMatchers = [
|
|
30
|
+
zod.z.object({
|
|
31
|
+
$endsWith: zod.z.string()
|
|
32
|
+
}),
|
|
33
|
+
zod.z.object({
|
|
34
|
+
$startsWith: zod.z.string()
|
|
35
|
+
}),
|
|
36
|
+
zod.z.object({
|
|
37
|
+
$ignoreCaseEquals: zod.z.string()
|
|
38
|
+
})
|
|
39
|
+
];
|
|
40
|
+
var EventMatcherSchema = zod.z.union([
|
|
352
41
|
/** Match against a string */
|
|
353
|
-
|
|
42
|
+
zod.z.array(zod.z.string()),
|
|
354
43
|
/** Match against a number */
|
|
355
|
-
|
|
44
|
+
zod.z.array(zod.z.number()),
|
|
356
45
|
/** Match against a boolean */
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
import_zod2.z.object({
|
|
363
|
-
$startsWith: import_zod2.z.string()
|
|
364
|
-
}),
|
|
365
|
-
import_zod2.z.object({
|
|
366
|
-
$exists: import_zod2.z.boolean()
|
|
46
|
+
zod.z.array(zod.z.boolean()),
|
|
47
|
+
zod.z.array(zod.z.union([
|
|
48
|
+
...stringPatternMatchers,
|
|
49
|
+
zod.z.object({
|
|
50
|
+
$exists: zod.z.boolean()
|
|
367
51
|
}),
|
|
368
|
-
|
|
369
|
-
$isNull:
|
|
52
|
+
zod.z.object({
|
|
53
|
+
$isNull: zod.z.boolean()
|
|
370
54
|
}),
|
|
371
|
-
|
|
372
|
-
$anythingBut:
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
55
|
+
zod.z.object({
|
|
56
|
+
$anythingBut: zod.z.union([
|
|
57
|
+
zod.z.string(),
|
|
58
|
+
zod.z.number(),
|
|
59
|
+
zod.z.boolean()
|
|
376
60
|
])
|
|
377
61
|
}),
|
|
378
|
-
|
|
379
|
-
$anythingBut:
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
62
|
+
zod.z.object({
|
|
63
|
+
$anythingBut: zod.z.union([
|
|
64
|
+
zod.z.array(zod.z.string()),
|
|
65
|
+
zod.z.array(zod.z.number()),
|
|
66
|
+
zod.z.array(zod.z.boolean())
|
|
383
67
|
])
|
|
384
68
|
}),
|
|
385
|
-
|
|
386
|
-
$gt:
|
|
69
|
+
zod.z.object({
|
|
70
|
+
$gt: zod.z.number()
|
|
387
71
|
}),
|
|
388
|
-
|
|
389
|
-
$lt:
|
|
72
|
+
zod.z.object({
|
|
73
|
+
$lt: zod.z.number()
|
|
390
74
|
}),
|
|
391
|
-
|
|
392
|
-
$gte:
|
|
75
|
+
zod.z.object({
|
|
76
|
+
$gte: zod.z.number()
|
|
393
77
|
}),
|
|
394
|
-
|
|
395
|
-
$lte:
|
|
78
|
+
zod.z.object({
|
|
79
|
+
$lte: zod.z.number()
|
|
396
80
|
}),
|
|
397
|
-
|
|
398
|
-
$between:
|
|
399
|
-
|
|
400
|
-
|
|
81
|
+
zod.z.object({
|
|
82
|
+
$between: zod.z.tuple([
|
|
83
|
+
zod.z.number(),
|
|
84
|
+
zod.z.number()
|
|
401
85
|
])
|
|
402
86
|
}),
|
|
403
|
-
|
|
404
|
-
$includes:
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
87
|
+
zod.z.object({
|
|
88
|
+
$includes: zod.z.union([
|
|
89
|
+
zod.z.string(),
|
|
90
|
+
zod.z.number(),
|
|
91
|
+
zod.z.boolean()
|
|
408
92
|
])
|
|
409
|
-
}),
|
|
410
|
-
import_zod2.z.object({
|
|
411
|
-
$ignoreCaseEquals: import_zod2.z.string()
|
|
412
93
|
})
|
|
413
94
|
]))
|
|
414
95
|
]);
|
|
415
|
-
var EventFilterSchema =
|
|
96
|
+
var EventFilterSchema = zod.z.lazy(() => zod.z.record(zod.z.union([
|
|
416
97
|
EventMatcherSchema,
|
|
417
98
|
EventFilterSchema
|
|
418
99
|
])));
|
|
419
|
-
var EventRuleSchema =
|
|
420
|
-
event:
|
|
421
|
-
source:
|
|
100
|
+
var EventRuleSchema = zod.z.object({
|
|
101
|
+
event: zod.z.string().or(zod.z.array(zod.z.string())),
|
|
102
|
+
source: zod.z.string(),
|
|
422
103
|
payload: EventFilterSchema.optional(),
|
|
423
104
|
context: EventFilterSchema.optional()
|
|
424
105
|
});
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
type: import_zod3.z.enum([
|
|
430
|
-
"oauth2"
|
|
106
|
+
var ConnectionAuthSchema = zod.z.object({
|
|
107
|
+
type: zod.z.enum([
|
|
108
|
+
"oauth2",
|
|
109
|
+
"apiKey"
|
|
431
110
|
]),
|
|
432
|
-
accessToken:
|
|
433
|
-
scopes:
|
|
434
|
-
additionalFields:
|
|
111
|
+
accessToken: zod.z.string(),
|
|
112
|
+
scopes: zod.z.array(zod.z.string()).optional(),
|
|
113
|
+
additionalFields: zod.z.record(zod.z.string()).optional()
|
|
435
114
|
});
|
|
436
|
-
var IntegrationMetadataSchema =
|
|
437
|
-
id:
|
|
438
|
-
name:
|
|
439
|
-
instructions:
|
|
115
|
+
var IntegrationMetadataSchema = zod.z.object({
|
|
116
|
+
id: zod.z.string(),
|
|
117
|
+
name: zod.z.string(),
|
|
118
|
+
instructions: zod.z.string().optional()
|
|
440
119
|
});
|
|
441
|
-
var IntegrationConfigSchema =
|
|
442
|
-
id:
|
|
120
|
+
var IntegrationConfigSchema = zod.z.object({
|
|
121
|
+
id: zod.z.string(),
|
|
443
122
|
metadata: IntegrationMetadataSchema,
|
|
444
|
-
authSource:
|
|
123
|
+
authSource: zod.z.enum([
|
|
445
124
|
"HOSTED",
|
|
446
|
-
"LOCAL"
|
|
125
|
+
"LOCAL",
|
|
126
|
+
"RESOLVER"
|
|
447
127
|
])
|
|
448
128
|
});
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
import_zod4.z.number(),
|
|
455
|
-
import_zod4.z.boolean(),
|
|
456
|
-
import_zod4.z.null()
|
|
129
|
+
var LiteralSchema = zod.z.union([
|
|
130
|
+
zod.z.string(),
|
|
131
|
+
zod.z.number(),
|
|
132
|
+
zod.z.boolean(),
|
|
133
|
+
zod.z.null()
|
|
457
134
|
]);
|
|
458
|
-
var DeserializedJsonSchema =
|
|
135
|
+
var DeserializedJsonSchema = zod.z.lazy(() => zod.z.union([
|
|
459
136
|
LiteralSchema,
|
|
460
|
-
|
|
461
|
-
|
|
137
|
+
zod.z.array(DeserializedJsonSchema),
|
|
138
|
+
zod.z.record(DeserializedJsonSchema)
|
|
462
139
|
]));
|
|
463
|
-
var SerializableSchema =
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
140
|
+
var SerializableSchema = zod.z.union([
|
|
141
|
+
zod.z.string(),
|
|
142
|
+
zod.z.number(),
|
|
143
|
+
zod.z.boolean(),
|
|
144
|
+
zod.z.null(),
|
|
145
|
+
zod.z.date(),
|
|
146
|
+
zod.z.undefined(),
|
|
147
|
+
zod.z.symbol()
|
|
471
148
|
]);
|
|
472
|
-
var SerializableJsonSchema =
|
|
149
|
+
var SerializableJsonSchema = zod.z.lazy(() => zod.z.union([
|
|
473
150
|
SerializableSchema,
|
|
474
|
-
|
|
475
|
-
|
|
151
|
+
zod.z.array(SerializableJsonSchema),
|
|
152
|
+
zod.z.record(SerializableJsonSchema)
|
|
476
153
|
]));
|
|
477
|
-
|
|
478
|
-
// src/schemas/properties.ts
|
|
479
|
-
var import_zod5 = require("zod");
|
|
480
|
-
var DisplayPropertySchema = import_zod5.z.object({
|
|
154
|
+
var DisplayPropertySchema = zod.z.object({
|
|
481
155
|
/** The label for the property */
|
|
482
|
-
label:
|
|
156
|
+
label: zod.z.string(),
|
|
483
157
|
/** The value of the property */
|
|
484
|
-
text:
|
|
158
|
+
text: zod.z.string(),
|
|
485
159
|
/** The URL to link to when the property is clicked */
|
|
486
|
-
url:
|
|
160
|
+
url: zod.z.string().optional(),
|
|
161
|
+
/** The URL to a list of images to display next to the property */
|
|
162
|
+
imageUrl: zod.z.array(zod.z.string()).optional()
|
|
487
163
|
});
|
|
488
|
-
var DisplayPropertiesSchema =
|
|
489
|
-
var StyleSchema =
|
|
164
|
+
var DisplayPropertiesSchema = zod.z.array(DisplayPropertySchema);
|
|
165
|
+
var StyleSchema = zod.z.object({
|
|
490
166
|
/** The style, `normal` or `minimal` */
|
|
491
|
-
style:
|
|
167
|
+
style: zod.z.enum([
|
|
492
168
|
"normal",
|
|
493
169
|
"minimal"
|
|
494
170
|
]),
|
|
495
171
|
/** A variant of the style. */
|
|
496
|
-
variant:
|
|
172
|
+
variant: zod.z.string().optional()
|
|
497
173
|
});
|
|
498
|
-
|
|
499
|
-
// src/schemas/schedules.ts
|
|
500
|
-
var import_zod6 = require("zod");
|
|
501
174
|
var SCHEDULED_EVENT = "dev.trigger.scheduled";
|
|
502
|
-
var ScheduledPayloadSchema =
|
|
503
|
-
ts:
|
|
504
|
-
lastTimestamp:
|
|
175
|
+
var ScheduledPayloadSchema = zod.z.object({
|
|
176
|
+
ts: zod.z.coerce.date(),
|
|
177
|
+
lastTimestamp: zod.z.coerce.date().optional()
|
|
505
178
|
});
|
|
506
|
-
var IntervalOptionsSchema =
|
|
507
|
-
/** The number of seconds for the interval. Min = 60, Max =
|
|
508
|
-
seconds:
|
|
179
|
+
var IntervalOptionsSchema = zod.z.object({
|
|
180
|
+
/** The number of seconds for the interval. Min = 60, Max = 2_592_000 (30 days) */
|
|
181
|
+
seconds: zod.z.number().int().positive().min(60).max(2592e3)
|
|
509
182
|
});
|
|
510
|
-
var CronOptionsSchema =
|
|
183
|
+
var CronOptionsSchema = zod.z.object({
|
|
511
184
|
/** A CRON expression that defines the schedule. A useful tool when writing CRON
|
|
512
185
|
expressions is [crontab guru](https://crontab.guru). Note that the timezone
|
|
513
186
|
used is UTC. */
|
|
514
|
-
cron:
|
|
187
|
+
cron: zod.z.string()
|
|
515
188
|
});
|
|
516
|
-
var CronMetadataSchema =
|
|
517
|
-
type:
|
|
189
|
+
var CronMetadataSchema = zod.z.object({
|
|
190
|
+
type: zod.z.literal("cron"),
|
|
518
191
|
options: CronOptionsSchema,
|
|
519
|
-
|
|
192
|
+
/** An optional Account ID to associate with runs triggered by this interval */
|
|
193
|
+
accountId: zod.z.string().optional(),
|
|
194
|
+
metadata: zod.z.any()
|
|
520
195
|
});
|
|
521
|
-
var IntervalMetadataSchema =
|
|
196
|
+
var IntervalMetadataSchema = zod.z.object({
|
|
522
197
|
/** An interval reoccurs at the specified number of seconds */
|
|
523
|
-
type:
|
|
198
|
+
type: zod.z.literal("interval"),
|
|
524
199
|
/** An object containing options about the interval. */
|
|
525
200
|
options: IntervalOptionsSchema,
|
|
201
|
+
/** An optional Account ID to associate with runs triggered by this interval */
|
|
202
|
+
accountId: zod.z.string().optional(),
|
|
526
203
|
/** Any additional metadata about the schedule. */
|
|
527
|
-
metadata:
|
|
204
|
+
metadata: zod.z.any()
|
|
528
205
|
});
|
|
529
|
-
var ScheduleMetadataSchema =
|
|
206
|
+
var ScheduleMetadataSchema = zod.z.discriminatedUnion("type", [
|
|
530
207
|
IntervalMetadataSchema,
|
|
531
208
|
CronMetadataSchema
|
|
532
209
|
]);
|
|
533
|
-
var RegisterDynamicSchedulePayloadSchema =
|
|
534
|
-
id:
|
|
535
|
-
jobs:
|
|
536
|
-
id:
|
|
537
|
-
version:
|
|
210
|
+
var RegisterDynamicSchedulePayloadSchema = zod.z.object({
|
|
211
|
+
id: zod.z.string(),
|
|
212
|
+
jobs: zod.z.array(zod.z.object({
|
|
213
|
+
id: zod.z.string(),
|
|
214
|
+
version: zod.z.string()
|
|
538
215
|
}))
|
|
539
216
|
});
|
|
540
|
-
|
|
541
|
-
// src/schemas/tasks.ts
|
|
542
|
-
var import_zod7 = require("zod");
|
|
543
|
-
var TaskStatusSchema = import_zod7.z.enum([
|
|
217
|
+
var TaskStatusSchema = zod.z.enum([
|
|
544
218
|
"PENDING",
|
|
545
219
|
"WAITING",
|
|
546
220
|
"RUNNING",
|
|
@@ -548,638 +222,937 @@ var TaskStatusSchema = import_zod7.z.enum([
|
|
|
548
222
|
"ERRORED",
|
|
549
223
|
"CANCELED"
|
|
550
224
|
]);
|
|
551
|
-
var TaskSchema =
|
|
552
|
-
id:
|
|
553
|
-
name:
|
|
554
|
-
icon:
|
|
555
|
-
noop:
|
|
556
|
-
startedAt:
|
|
557
|
-
completedAt:
|
|
558
|
-
delayUntil:
|
|
225
|
+
var TaskSchema = zod.z.object({
|
|
226
|
+
id: zod.z.string(),
|
|
227
|
+
name: zod.z.string(),
|
|
228
|
+
icon: zod.z.string().optional().nullable(),
|
|
229
|
+
noop: zod.z.boolean(),
|
|
230
|
+
startedAt: zod.z.coerce.date().optional().nullable(),
|
|
231
|
+
completedAt: zod.z.coerce.date().optional().nullable(),
|
|
232
|
+
delayUntil: zod.z.coerce.date().optional().nullable(),
|
|
559
233
|
status: TaskStatusSchema,
|
|
560
|
-
description:
|
|
561
|
-
properties:
|
|
562
|
-
outputProperties:
|
|
234
|
+
description: zod.z.string().optional().nullable(),
|
|
235
|
+
properties: zod.z.array(DisplayPropertySchema).optional().nullable(),
|
|
236
|
+
outputProperties: zod.z.array(DisplayPropertySchema).optional().nullable(),
|
|
563
237
|
params: DeserializedJsonSchema.optional().nullable(),
|
|
564
238
|
output: DeserializedJsonSchema.optional().nullable(),
|
|
565
|
-
|
|
566
|
-
|
|
239
|
+
context: DeserializedJsonSchema.optional().nullable(),
|
|
240
|
+
error: zod.z.string().optional().nullable(),
|
|
241
|
+
parentId: zod.z.string().optional().nullable(),
|
|
567
242
|
style: StyleSchema.optional().nullable(),
|
|
568
|
-
operation:
|
|
243
|
+
operation: zod.z.string().optional().nullable(),
|
|
244
|
+
callbackUrl: zod.z.string().optional().nullable(),
|
|
245
|
+
childExecutionMode: zod.z.enum([
|
|
246
|
+
"SEQUENTIAL",
|
|
247
|
+
"PARALLEL"
|
|
248
|
+
]).optional().nullable()
|
|
569
249
|
});
|
|
570
250
|
var ServerTaskSchema = TaskSchema.extend({
|
|
571
|
-
idempotencyKey:
|
|
572
|
-
attempts:
|
|
251
|
+
idempotencyKey: zod.z.string(),
|
|
252
|
+
attempts: zod.z.number(),
|
|
253
|
+
forceYield: zod.z.boolean().optional().nullable()
|
|
573
254
|
});
|
|
574
|
-
var CachedTaskSchema =
|
|
575
|
-
id:
|
|
576
|
-
idempotencyKey:
|
|
255
|
+
var CachedTaskSchema = zod.z.object({
|
|
256
|
+
id: zod.z.string(),
|
|
257
|
+
idempotencyKey: zod.z.string(),
|
|
577
258
|
status: TaskStatusSchema,
|
|
578
|
-
noop:
|
|
259
|
+
noop: zod.z.boolean().default(false),
|
|
579
260
|
output: DeserializedJsonSchema.optional().nullable(),
|
|
580
|
-
parentId:
|
|
581
|
-
});
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
title: import_zod8.z.string(),
|
|
594
|
-
source: import_zod8.z.string(),
|
|
595
|
-
icon: import_zod8.z.string(),
|
|
261
|
+
parentId: zod.z.string().optional().nullable()
|
|
262
|
+
});
|
|
263
|
+
var EventExampleSchema = zod.z.object({
|
|
264
|
+
id: zod.z.string(),
|
|
265
|
+
icon: zod.z.string().optional(),
|
|
266
|
+
name: zod.z.string(),
|
|
267
|
+
payload: zod.z.any()
|
|
268
|
+
});
|
|
269
|
+
var EventSpecificationSchema = zod.z.object({
|
|
270
|
+
name: zod.z.string().or(zod.z.array(zod.z.string())),
|
|
271
|
+
title: zod.z.string(),
|
|
272
|
+
source: zod.z.string(),
|
|
273
|
+
icon: zod.z.string(),
|
|
596
274
|
filter: EventFilterSchema.optional(),
|
|
597
|
-
properties:
|
|
598
|
-
schema:
|
|
599
|
-
examples:
|
|
600
|
-
});
|
|
601
|
-
var DynamicTriggerMetadataSchema =
|
|
602
|
-
type:
|
|
603
|
-
id:
|
|
604
|
-
});
|
|
605
|
-
var
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
275
|
+
properties: zod.z.array(DisplayPropertySchema).optional(),
|
|
276
|
+
schema: zod.z.any().optional(),
|
|
277
|
+
examples: zod.z.array(EventExampleSchema).optional()
|
|
278
|
+
});
|
|
279
|
+
var DynamicTriggerMetadataSchema = zod.z.object({
|
|
280
|
+
type: zod.z.literal("dynamic"),
|
|
281
|
+
id: zod.z.string()
|
|
282
|
+
});
|
|
283
|
+
var TriggerHelpSchema = zod.z.object({
|
|
284
|
+
noRuns: zod.z.object({
|
|
285
|
+
text: zod.z.string(),
|
|
286
|
+
link: zod.z.string().optional()
|
|
287
|
+
}).optional()
|
|
288
|
+
});
|
|
289
|
+
var StaticTriggerMetadataSchema = zod.z.object({
|
|
290
|
+
type: zod.z.literal("static"),
|
|
291
|
+
title: zod.z.union([
|
|
292
|
+
zod.z.string(),
|
|
293
|
+
zod.z.array(zod.z.string())
|
|
610
294
|
]),
|
|
611
|
-
properties:
|
|
612
|
-
rule: EventRuleSchema
|
|
295
|
+
properties: zod.z.array(DisplayPropertySchema).optional(),
|
|
296
|
+
rule: EventRuleSchema,
|
|
297
|
+
link: zod.z.string().optional(),
|
|
298
|
+
help: TriggerHelpSchema.optional()
|
|
613
299
|
});
|
|
614
|
-
var
|
|
615
|
-
type:
|
|
300
|
+
var InvokeTriggerMetadataSchema = zod.z.object({
|
|
301
|
+
type: zod.z.literal("invoke")
|
|
302
|
+
});
|
|
303
|
+
var ScheduledTriggerMetadataSchema = zod.z.object({
|
|
304
|
+
type: zod.z.literal("scheduled"),
|
|
616
305
|
schedule: ScheduleMetadataSchema
|
|
617
306
|
});
|
|
618
|
-
var TriggerMetadataSchema =
|
|
307
|
+
var TriggerMetadataSchema = zod.z.discriminatedUnion("type", [
|
|
619
308
|
DynamicTriggerMetadataSchema,
|
|
620
309
|
StaticTriggerMetadataSchema,
|
|
621
|
-
ScheduledTriggerMetadataSchema
|
|
310
|
+
ScheduledTriggerMetadataSchema,
|
|
311
|
+
InvokeTriggerMetadataSchema
|
|
622
312
|
]);
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
// src/schemas/statuses.ts
|
|
628
|
-
var import_zod9 = require("zod");
|
|
629
|
-
var StatusUpdateStateSchema = import_zod9.z.union([
|
|
630
|
-
import_zod9.z.literal("loading"),
|
|
631
|
-
import_zod9.z.literal("success"),
|
|
632
|
-
import_zod9.z.literal("failure")
|
|
313
|
+
var StatusUpdateStateSchema = zod.z.union([
|
|
314
|
+
zod.z.literal("loading"),
|
|
315
|
+
zod.z.literal("success"),
|
|
316
|
+
zod.z.literal("failure")
|
|
633
317
|
]);
|
|
634
|
-
var StatusUpdateDataSchema =
|
|
635
|
-
var StatusUpdateSchema =
|
|
636
|
-
label:
|
|
318
|
+
var StatusUpdateDataSchema = zod.z.record(SerializableJsonSchema);
|
|
319
|
+
var StatusUpdateSchema = zod.z.object({
|
|
320
|
+
label: zod.z.string().optional(),
|
|
637
321
|
state: StatusUpdateStateSchema.optional(),
|
|
638
322
|
data: StatusUpdateDataSchema.optional()
|
|
639
323
|
});
|
|
640
324
|
var InitalStatusUpdateSchema = StatusUpdateSchema.required({
|
|
641
325
|
label: true
|
|
642
326
|
});
|
|
643
|
-
var StatusHistorySchema =
|
|
327
|
+
var StatusHistorySchema = zod.z.array(StatusUpdateSchema);
|
|
644
328
|
var JobRunStatusRecordSchema = InitalStatusUpdateSchema.extend({
|
|
645
|
-
key:
|
|
329
|
+
key: zod.z.string(),
|
|
646
330
|
history: StatusHistorySchema
|
|
647
331
|
});
|
|
648
332
|
|
|
649
333
|
// src/schemas/runs.ts
|
|
650
|
-
var RunStatusSchema =
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
334
|
+
var RunStatusSchema = zod.z.union([
|
|
335
|
+
zod.z.literal("PENDING"),
|
|
336
|
+
zod.z.literal("QUEUED"),
|
|
337
|
+
zod.z.literal("WAITING_ON_CONNECTIONS"),
|
|
338
|
+
zod.z.literal("PREPROCESSING"),
|
|
339
|
+
zod.z.literal("STARTED"),
|
|
340
|
+
zod.z.literal("SUCCESS"),
|
|
341
|
+
zod.z.literal("FAILURE"),
|
|
342
|
+
zod.z.literal("TIMED_OUT"),
|
|
343
|
+
zod.z.literal("ABORTED"),
|
|
344
|
+
zod.z.literal("CANCELED"),
|
|
345
|
+
zod.z.literal("UNRESOLVED_AUTH"),
|
|
346
|
+
zod.z.literal("INVALID_PAYLOAD"),
|
|
347
|
+
zod.z.literal("EXECUTING"),
|
|
348
|
+
zod.z.literal("WAITING_TO_CONTINUE"),
|
|
349
|
+
zod.z.literal("WAITING_TO_EXECUTE")
|
|
661
350
|
]);
|
|
662
|
-
var RunTaskSchema =
|
|
351
|
+
var RunTaskSchema = zod.z.object({
|
|
663
352
|
/** The Task id */
|
|
664
|
-
id:
|
|
353
|
+
id: zod.z.string(),
|
|
665
354
|
/** The key that you defined when creating the Task, the first param in any task. */
|
|
666
|
-
displayKey:
|
|
355
|
+
displayKey: zod.z.string().nullable(),
|
|
667
356
|
/** The Task status */
|
|
668
357
|
status: TaskStatusSchema,
|
|
669
358
|
/** The name of the Task */
|
|
670
|
-
name:
|
|
359
|
+
name: zod.z.string(),
|
|
671
360
|
/** The icon of the Task, a string.
|
|
672
361
|
* For integrations, this will be a lowercase name of the company.
|
|
673
362
|
* Can be used with the [@trigger.dev/companyicons](https://www.npmjs.com/package/@trigger.dev/companyicons) package to display an svg. */
|
|
674
|
-
icon:
|
|
363
|
+
icon: zod.z.string().nullable(),
|
|
675
364
|
/** When the task started */
|
|
676
|
-
startedAt:
|
|
365
|
+
startedAt: zod.z.coerce.date().nullable(),
|
|
677
366
|
/** When the task completed */
|
|
678
|
-
completedAt:
|
|
367
|
+
completedAt: zod.z.coerce.date().nullable()
|
|
679
368
|
});
|
|
680
369
|
var RunTaskWithSubtasksSchema = RunTaskSchema.extend({
|
|
681
|
-
subtasks:
|
|
370
|
+
subtasks: zod.z.lazy(() => RunTaskWithSubtasksSchema.array()).optional()
|
|
682
371
|
});
|
|
683
|
-
var GetRunOptionsSchema =
|
|
372
|
+
var GetRunOptionsSchema = zod.z.object({
|
|
684
373
|
/** Return subtasks, which appear in a `subtasks` array on a task. @default false */
|
|
685
|
-
subtasks:
|
|
374
|
+
subtasks: zod.z.boolean().optional(),
|
|
686
375
|
/** You can use this to get more tasks, if there are more than are returned in a single batch @default undefined */
|
|
687
|
-
cursor:
|
|
376
|
+
cursor: zod.z.string().optional(),
|
|
688
377
|
/** How many tasks you want to return in one go, max 50. @default 20 */
|
|
689
|
-
take:
|
|
378
|
+
take: zod.z.number().optional()
|
|
690
379
|
});
|
|
691
|
-
|
|
380
|
+
GetRunOptionsSchema.extend({
|
|
692
381
|
/** If `true`, it returns the `params` and `output` of all tasks. @default false */
|
|
693
|
-
taskdetails:
|
|
382
|
+
taskdetails: zod.z.boolean().optional()
|
|
694
383
|
});
|
|
695
|
-
var RunSchema =
|
|
384
|
+
var RunSchema = zod.z.object({
|
|
696
385
|
/** The Run id */
|
|
697
|
-
id:
|
|
386
|
+
id: zod.z.string(),
|
|
698
387
|
/** The Run status */
|
|
699
388
|
status: RunStatusSchema,
|
|
700
389
|
/** When the run started */
|
|
701
|
-
startedAt:
|
|
390
|
+
startedAt: zod.z.coerce.date().nullable(),
|
|
702
391
|
/** When the run was last updated */
|
|
703
|
-
updatedAt:
|
|
392
|
+
updatedAt: zod.z.coerce.date().nullable(),
|
|
704
393
|
/** When the run was completed */
|
|
705
|
-
completedAt:
|
|
394
|
+
completedAt: zod.z.coerce.date().nullable()
|
|
706
395
|
});
|
|
707
396
|
var GetRunSchema = RunSchema.extend({
|
|
708
397
|
/** The output of the run */
|
|
709
|
-
output:
|
|
398
|
+
output: zod.z.any().optional(),
|
|
710
399
|
/** The tasks from the run */
|
|
711
|
-
tasks:
|
|
400
|
+
tasks: zod.z.array(RunTaskWithSubtasksSchema),
|
|
712
401
|
/** Any status updates that were published from the run */
|
|
713
|
-
statuses:
|
|
402
|
+
statuses: zod.z.array(JobRunStatusRecordSchema).default([]),
|
|
714
403
|
/** If there are more tasks, you can use this to get them */
|
|
715
|
-
nextCursor:
|
|
404
|
+
nextCursor: zod.z.string().optional()
|
|
716
405
|
});
|
|
717
|
-
|
|
406
|
+
zod.z.object({
|
|
718
407
|
/** You can use this to get more tasks, if there are more than are returned in a single batch @default undefined */
|
|
719
|
-
cursor:
|
|
408
|
+
cursor: zod.z.string().optional(),
|
|
720
409
|
/** How many runs you want to return in one go, max 50. @default 20 */
|
|
721
|
-
take:
|
|
410
|
+
take: zod.z.number().optional()
|
|
722
411
|
});
|
|
723
|
-
var GetRunsSchema =
|
|
412
|
+
var GetRunsSchema = zod.z.object({
|
|
724
413
|
/** The runs from the query */
|
|
725
414
|
runs: RunSchema.array(),
|
|
726
415
|
/** If there are more runs, you can use this to get them */
|
|
727
|
-
nextCursor:
|
|
416
|
+
nextCursor: zod.z.string().optional()
|
|
417
|
+
});
|
|
418
|
+
var StringMatchSchema = zod.z.union([
|
|
419
|
+
/** Match against a string */
|
|
420
|
+
zod.z.array(zod.z.string()),
|
|
421
|
+
zod.z.array(zod.z.union(stringPatternMatchers))
|
|
422
|
+
]);
|
|
423
|
+
var HTTPMethodUnionSchema = zod.z.union([
|
|
424
|
+
zod.z.literal("GET"),
|
|
425
|
+
zod.z.literal("POST"),
|
|
426
|
+
zod.z.literal("PUT"),
|
|
427
|
+
zod.z.literal("PATCH"),
|
|
428
|
+
zod.z.literal("DELETE"),
|
|
429
|
+
zod.z.literal("HEAD"),
|
|
430
|
+
zod.z.literal("OPTIONS")
|
|
431
|
+
]);
|
|
432
|
+
var RequestFilterSchema = zod.z.object({
|
|
433
|
+
/** An array of HTTP methods to match.
|
|
434
|
+
* For example, `["GET", "POST"]` will match both `GET` and `POST` Requests. */
|
|
435
|
+
method: zod.z.array(HTTPMethodUnionSchema).optional(),
|
|
436
|
+
/** An object of header key/values to match.
|
|
437
|
+
* This uses the [EventFilter matching syntax](https://trigger.dev/docs/documentation/guides/event-filter).
|
|
438
|
+
|
|
439
|
+
@example
|
|
440
|
+
```ts
|
|
441
|
+
filter: {
|
|
442
|
+
header: {
|
|
443
|
+
"content-type": ["application/json"],
|
|
444
|
+
},
|
|
445
|
+
},
|
|
446
|
+
``` */
|
|
447
|
+
headers: zod.z.record(StringMatchSchema).optional(),
|
|
448
|
+
/** An object of query parameters to match.
|
|
449
|
+
* This uses the [EventFilter matching syntax](https://trigger.dev/docs/documentation/guides/event-filter).
|
|
450
|
+
|
|
451
|
+
@example
|
|
452
|
+
```ts
|
|
453
|
+
filter: {
|
|
454
|
+
query: {
|
|
455
|
+
"hub.mode": [{ $startsWith: "sub" }],
|
|
456
|
+
},
|
|
457
|
+
},
|
|
458
|
+
``` */
|
|
459
|
+
query: zod.z.record(StringMatchSchema).optional(),
|
|
460
|
+
/** An object of key/values to match.
|
|
461
|
+
* This uses the [EventFilter matching syntax](https://trigger.dev/docs/documentation/guides/event-filter).
|
|
462
|
+
*/
|
|
463
|
+
body: EventFilterSchema.optional()
|
|
464
|
+
});
|
|
465
|
+
var ResponseFilterSchema = RequestFilterSchema.omit({
|
|
466
|
+
method: true,
|
|
467
|
+
query: true
|
|
468
|
+
}).extend({
|
|
469
|
+
status: zod.z.array(zod.z.number()).optional()
|
|
728
470
|
});
|
|
729
471
|
|
|
730
472
|
// src/schemas/api.ts
|
|
731
|
-
var UpdateTriggerSourceBodyV1Schema =
|
|
732
|
-
registeredEvents:
|
|
733
|
-
secret:
|
|
473
|
+
var UpdateTriggerSourceBodyV1Schema = zod.z.object({
|
|
474
|
+
registeredEvents: zod.z.array(zod.z.string()),
|
|
475
|
+
secret: zod.z.string().optional(),
|
|
734
476
|
data: SerializableJsonSchema.optional()
|
|
735
477
|
});
|
|
736
|
-
var UpdateTriggerSourceBodyV2Schema =
|
|
737
|
-
secret:
|
|
478
|
+
var UpdateTriggerSourceBodyV2Schema = zod.z.object({
|
|
479
|
+
secret: zod.z.string().optional(),
|
|
738
480
|
data: SerializableJsonSchema.optional(),
|
|
739
|
-
options:
|
|
740
|
-
event:
|
|
741
|
-
}).and(
|
|
481
|
+
options: zod.z.object({
|
|
482
|
+
event: zod.z.array(zod.z.string())
|
|
483
|
+
}).and(zod.z.record(zod.z.string(), zod.z.array(zod.z.string())).optional())
|
|
742
484
|
});
|
|
743
|
-
var
|
|
744
|
-
|
|
745
|
-
|
|
485
|
+
var UpdateWebhookBodySchema = zod.z.discriminatedUnion("active", [
|
|
486
|
+
zod.z.object({
|
|
487
|
+
active: zod.z.literal(false)
|
|
488
|
+
}),
|
|
489
|
+
zod.z.object({
|
|
490
|
+
active: zod.z.literal(true),
|
|
491
|
+
config: zod.z.record(zod.z.string().array())
|
|
492
|
+
})
|
|
493
|
+
]);
|
|
494
|
+
var RegisterHTTPTriggerSourceBodySchema = zod.z.object({
|
|
495
|
+
type: zod.z.literal("HTTP"),
|
|
496
|
+
url: zod.z.string().url()
|
|
746
497
|
});
|
|
747
|
-
var RegisterSMTPTriggerSourceBodySchema =
|
|
748
|
-
type:
|
|
498
|
+
var RegisterSMTPTriggerSourceBodySchema = zod.z.object({
|
|
499
|
+
type: zod.z.literal("SMTP")
|
|
749
500
|
});
|
|
750
|
-
var RegisterSQSTriggerSourceBodySchema =
|
|
751
|
-
type:
|
|
501
|
+
var RegisterSQSTriggerSourceBodySchema = zod.z.object({
|
|
502
|
+
type: zod.z.literal("SQS")
|
|
752
503
|
});
|
|
753
|
-
var RegisterSourceChannelBodySchema =
|
|
504
|
+
var RegisterSourceChannelBodySchema = zod.z.discriminatedUnion("type", [
|
|
754
505
|
RegisterHTTPTriggerSourceBodySchema,
|
|
755
506
|
RegisterSMTPTriggerSourceBodySchema,
|
|
756
507
|
RegisterSQSTriggerSourceBodySchema
|
|
757
508
|
]);
|
|
509
|
+
var REGISTER_WEBHOOK = "dev.trigger.webhook.register";
|
|
510
|
+
var DELIVER_WEBHOOK_REQUEST = "dev.trigger.webhook.deliver";
|
|
511
|
+
var RegisterWebhookSourceSchema = zod.z.object({
|
|
512
|
+
key: zod.z.string(),
|
|
513
|
+
params: zod.z.any(),
|
|
514
|
+
config: zod.z.any(),
|
|
515
|
+
active: zod.z.boolean(),
|
|
516
|
+
secret: zod.z.string(),
|
|
517
|
+
url: zod.z.string(),
|
|
518
|
+
data: DeserializedJsonSchema.optional(),
|
|
519
|
+
clientId: zod.z.string().optional()
|
|
520
|
+
});
|
|
521
|
+
var RegisterWebhookPayloadSchema = zod.z.object({
|
|
522
|
+
active: zod.z.boolean(),
|
|
523
|
+
params: zod.z.any().optional(),
|
|
524
|
+
config: zod.z.object({
|
|
525
|
+
current: zod.z.record(zod.z.string().array()),
|
|
526
|
+
desired: zod.z.record(zod.z.string().array())
|
|
527
|
+
}),
|
|
528
|
+
// from HTTP Endpoint
|
|
529
|
+
url: zod.z.string(),
|
|
530
|
+
secret: zod.z.string()
|
|
531
|
+
});
|
|
758
532
|
var REGISTER_SOURCE_EVENT_V1 = "dev.trigger.source.register";
|
|
759
533
|
var REGISTER_SOURCE_EVENT_V2 = "dev.trigger.source.register.v2";
|
|
760
|
-
var RegisterTriggerSourceSchema =
|
|
761
|
-
key:
|
|
762
|
-
params:
|
|
763
|
-
active:
|
|
764
|
-
secret:
|
|
534
|
+
var RegisterTriggerSourceSchema = zod.z.object({
|
|
535
|
+
key: zod.z.string(),
|
|
536
|
+
params: zod.z.any(),
|
|
537
|
+
active: zod.z.boolean(),
|
|
538
|
+
secret: zod.z.string(),
|
|
765
539
|
data: DeserializedJsonSchema.optional(),
|
|
766
540
|
channel: RegisterSourceChannelBodySchema,
|
|
767
|
-
clientId:
|
|
541
|
+
clientId: zod.z.string().optional()
|
|
768
542
|
});
|
|
769
|
-
|
|
770
|
-
name:
|
|
771
|
-
value:
|
|
543
|
+
zod.z.object({
|
|
544
|
+
name: zod.z.string(),
|
|
545
|
+
value: zod.z.string()
|
|
772
546
|
});
|
|
773
|
-
var RegisterSourceEventSchemaV1 =
|
|
547
|
+
var RegisterSourceEventSchemaV1 = zod.z.object({
|
|
774
548
|
/** The id of the source */
|
|
775
|
-
id:
|
|
549
|
+
id: zod.z.string(),
|
|
776
550
|
source: RegisterTriggerSourceSchema,
|
|
777
|
-
events:
|
|
778
|
-
missingEvents:
|
|
779
|
-
orphanedEvents:
|
|
780
|
-
dynamicTriggerId:
|
|
551
|
+
events: zod.z.array(zod.z.string()),
|
|
552
|
+
missingEvents: zod.z.array(zod.z.string()),
|
|
553
|
+
orphanedEvents: zod.z.array(zod.z.string()),
|
|
554
|
+
dynamicTriggerId: zod.z.string().optional()
|
|
781
555
|
});
|
|
782
|
-
var RegisteredOptionsDiffSchema =
|
|
783
|
-
desired:
|
|
784
|
-
missing:
|
|
785
|
-
orphaned:
|
|
556
|
+
var RegisteredOptionsDiffSchema = zod.z.object({
|
|
557
|
+
desired: zod.z.array(zod.z.string()),
|
|
558
|
+
missing: zod.z.array(zod.z.string()),
|
|
559
|
+
orphaned: zod.z.array(zod.z.string())
|
|
786
560
|
});
|
|
787
|
-
var RegisterSourceEventOptionsSchema =
|
|
561
|
+
var RegisterSourceEventOptionsSchema = zod.z.object({
|
|
788
562
|
event: RegisteredOptionsDiffSchema
|
|
789
|
-
}).and(
|
|
790
|
-
var RegisterSourceEventSchemaV2 =
|
|
563
|
+
}).and(zod.z.record(zod.z.string(), RegisteredOptionsDiffSchema));
|
|
564
|
+
var RegisterSourceEventSchemaV2 = zod.z.object({
|
|
791
565
|
/** The id of the source */
|
|
792
|
-
id:
|
|
566
|
+
id: zod.z.string(),
|
|
793
567
|
source: RegisterTriggerSourceSchema,
|
|
794
568
|
options: RegisterSourceEventOptionsSchema,
|
|
795
|
-
dynamicTriggerId:
|
|
569
|
+
dynamicTriggerId: zod.z.string().optional()
|
|
796
570
|
});
|
|
797
|
-
var TriggerSourceSchema =
|
|
798
|
-
id:
|
|
799
|
-
key:
|
|
571
|
+
var TriggerSourceSchema = zod.z.object({
|
|
572
|
+
id: zod.z.string(),
|
|
573
|
+
key: zod.z.string()
|
|
800
574
|
});
|
|
801
575
|
var HttpSourceResponseMetadataSchema = DeserializedJsonSchema;
|
|
802
|
-
var HandleTriggerSourceSchema =
|
|
803
|
-
key:
|
|
804
|
-
secret:
|
|
805
|
-
data:
|
|
806
|
-
params:
|
|
576
|
+
var HandleTriggerSourceSchema = zod.z.object({
|
|
577
|
+
key: zod.z.string(),
|
|
578
|
+
secret: zod.z.string(),
|
|
579
|
+
data: zod.z.any(),
|
|
580
|
+
params: zod.z.any(),
|
|
807
581
|
auth: ConnectionAuthSchema.optional(),
|
|
808
582
|
metadata: HttpSourceResponseMetadataSchema.optional()
|
|
809
583
|
});
|
|
810
|
-
var
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
"x-ts-
|
|
818
|
-
"x-ts-
|
|
819
|
-
"x-ts-
|
|
820
|
-
"x-ts-data": import_zod11.z.string().transform((s) => JSON.parse(s)),
|
|
821
|
-
"x-ts-params": import_zod11.z.string().transform((s) => JSON.parse(s)),
|
|
822
|
-
"x-ts-http-url": import_zod11.z.string(),
|
|
823
|
-
"x-ts-http-method": import_zod11.z.string(),
|
|
824
|
-
"x-ts-http-headers": import_zod11.z.string().transform((s) => import_zod11.z.record(import_zod11.z.string()).parse(JSON.parse(s))),
|
|
825
|
-
"x-ts-auth": import_zod11.z.string().optional().transform((s) => {
|
|
584
|
+
var HttpSourceRequestHeadersSchema = zod.z.object({
|
|
585
|
+
"x-ts-key": zod.z.string(),
|
|
586
|
+
"x-ts-dynamic-id": zod.z.string().optional(),
|
|
587
|
+
"x-ts-secret": zod.z.string(),
|
|
588
|
+
"x-ts-data": zod.z.string().transform((s) => JSON.parse(s)),
|
|
589
|
+
"x-ts-params": zod.z.string().transform((s) => JSON.parse(s)),
|
|
590
|
+
"x-ts-http-url": zod.z.string(),
|
|
591
|
+
"x-ts-http-method": zod.z.string(),
|
|
592
|
+
"x-ts-http-headers": zod.z.string().transform((s) => zod.z.record(zod.z.string()).parse(JSON.parse(s))),
|
|
593
|
+
"x-ts-auth": zod.z.string().optional().transform((s) => {
|
|
826
594
|
if (s === void 0)
|
|
827
595
|
return;
|
|
828
596
|
const json = JSON.parse(s);
|
|
829
597
|
return ConnectionAuthSchema.parse(json);
|
|
830
598
|
}),
|
|
831
|
-
"x-ts-metadata":
|
|
599
|
+
"x-ts-metadata": zod.z.string().optional().transform((s) => {
|
|
832
600
|
if (s === void 0)
|
|
833
601
|
return;
|
|
834
602
|
const json = JSON.parse(s);
|
|
835
603
|
return DeserializedJsonSchema.parse(json);
|
|
836
604
|
})
|
|
837
605
|
});
|
|
838
|
-
var
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
606
|
+
var HttpEndpointRequestHeadersSchema = zod.z.object({
|
|
607
|
+
"x-ts-key": zod.z.string(),
|
|
608
|
+
"x-ts-http-url": zod.z.string(),
|
|
609
|
+
"x-ts-http-method": zod.z.string(),
|
|
610
|
+
"x-ts-http-headers": zod.z.string().transform((s) => zod.z.record(zod.z.string()).parse(JSON.parse(s)))
|
|
611
|
+
});
|
|
612
|
+
var WebhookSourceRequestHeadersSchema = zod.z.object({
|
|
613
|
+
"x-ts-key": zod.z.string(),
|
|
614
|
+
"x-ts-dynamic-id": zod.z.string().optional(),
|
|
615
|
+
"x-ts-secret": zod.z.string(),
|
|
616
|
+
"x-ts-params": zod.z.string().transform((s) => JSON.parse(s)),
|
|
617
|
+
"x-ts-http-url": zod.z.string(),
|
|
618
|
+
"x-ts-http-method": zod.z.string(),
|
|
619
|
+
"x-ts-http-headers": zod.z.string().transform((s) => zod.z.record(zod.z.string()).parse(JSON.parse(s)))
|
|
620
|
+
});
|
|
621
|
+
var PongSuccessResponseSchema = zod.z.object({
|
|
622
|
+
ok: zod.z.literal(true),
|
|
623
|
+
triggerVersion: zod.z.string().optional(),
|
|
624
|
+
triggerSdkVersion: zod.z.string().optional()
|
|
625
|
+
});
|
|
626
|
+
var PongErrorResponseSchema = zod.z.object({
|
|
627
|
+
ok: zod.z.literal(false),
|
|
628
|
+
error: zod.z.string(),
|
|
629
|
+
triggerVersion: zod.z.string().optional(),
|
|
630
|
+
triggerSdkVersion: zod.z.string().optional()
|
|
631
|
+
});
|
|
632
|
+
var PongResponseSchema = zod.z.discriminatedUnion("ok", [
|
|
846
633
|
PongSuccessResponseSchema,
|
|
847
634
|
PongErrorResponseSchema
|
|
848
635
|
]);
|
|
849
|
-
var ValidateSuccessResponseSchema =
|
|
850
|
-
ok:
|
|
851
|
-
endpointId:
|
|
636
|
+
var ValidateSuccessResponseSchema = zod.z.object({
|
|
637
|
+
ok: zod.z.literal(true),
|
|
638
|
+
endpointId: zod.z.string(),
|
|
639
|
+
triggerVersion: zod.z.string().optional()
|
|
852
640
|
});
|
|
853
|
-
var ValidateErrorResponseSchema =
|
|
854
|
-
ok:
|
|
855
|
-
error:
|
|
641
|
+
var ValidateErrorResponseSchema = zod.z.object({
|
|
642
|
+
ok: zod.z.literal(false),
|
|
643
|
+
error: zod.z.string(),
|
|
644
|
+
triggerVersion: zod.z.string().optional()
|
|
856
645
|
});
|
|
857
|
-
var ValidateResponseSchema =
|
|
646
|
+
var ValidateResponseSchema = zod.z.discriminatedUnion("ok", [
|
|
858
647
|
ValidateSuccessResponseSchema,
|
|
859
648
|
ValidateErrorResponseSchema
|
|
860
649
|
]);
|
|
861
|
-
var QueueOptionsSchema =
|
|
862
|
-
name:
|
|
863
|
-
maxConcurrent:
|
|
864
|
-
});
|
|
865
|
-
var
|
|
866
|
-
id:
|
|
867
|
-
|
|
868
|
-
|
|
650
|
+
var QueueOptionsSchema = zod.z.object({
|
|
651
|
+
name: zod.z.string(),
|
|
652
|
+
maxConcurrent: zod.z.number().optional()
|
|
653
|
+
});
|
|
654
|
+
var ConcurrencyLimitOptionsSchema = zod.z.object({
|
|
655
|
+
id: zod.z.string(),
|
|
656
|
+
limit: zod.z.number()
|
|
657
|
+
});
|
|
658
|
+
var JobMetadataSchema = zod.z.object({
|
|
659
|
+
id: zod.z.string(),
|
|
660
|
+
name: zod.z.string(),
|
|
661
|
+
version: zod.z.string(),
|
|
869
662
|
event: EventSpecificationSchema,
|
|
870
663
|
trigger: TriggerMetadataSchema,
|
|
871
|
-
integrations:
|
|
872
|
-
internal:
|
|
873
|
-
enabled:
|
|
874
|
-
startPosition:
|
|
664
|
+
integrations: zod.z.record(IntegrationConfigSchema),
|
|
665
|
+
internal: zod.z.boolean().default(false),
|
|
666
|
+
enabled: zod.z.boolean(),
|
|
667
|
+
startPosition: zod.z.enum([
|
|
875
668
|
"initial",
|
|
876
669
|
"latest"
|
|
877
670
|
]),
|
|
878
|
-
preprocessRuns:
|
|
671
|
+
preprocessRuns: zod.z.boolean(),
|
|
672
|
+
concurrencyLimit: ConcurrencyLimitOptionsSchema.or(zod.z.number().int().positive()).optional()
|
|
879
673
|
});
|
|
880
|
-
var SourceMetadataV1Schema =
|
|
881
|
-
version:
|
|
882
|
-
channel:
|
|
674
|
+
var SourceMetadataV1Schema = zod.z.object({
|
|
675
|
+
version: zod.z.literal("1"),
|
|
676
|
+
channel: zod.z.enum([
|
|
883
677
|
"HTTP",
|
|
884
678
|
"SQS",
|
|
885
679
|
"SMTP"
|
|
886
680
|
]),
|
|
887
681
|
integration: IntegrationConfigSchema,
|
|
888
|
-
key:
|
|
889
|
-
params:
|
|
890
|
-
events:
|
|
891
|
-
registerSourceJob:
|
|
892
|
-
id:
|
|
893
|
-
version:
|
|
682
|
+
key: zod.z.string(),
|
|
683
|
+
params: zod.z.any(),
|
|
684
|
+
events: zod.z.array(zod.z.string()),
|
|
685
|
+
registerSourceJob: zod.z.object({
|
|
686
|
+
id: zod.z.string(),
|
|
687
|
+
version: zod.z.string()
|
|
894
688
|
}).optional()
|
|
895
689
|
});
|
|
896
|
-
var SourceMetadataV2Schema =
|
|
897
|
-
version:
|
|
898
|
-
channel:
|
|
690
|
+
var SourceMetadataV2Schema = zod.z.object({
|
|
691
|
+
version: zod.z.literal("2"),
|
|
692
|
+
channel: zod.z.enum([
|
|
899
693
|
"HTTP",
|
|
900
694
|
"SQS",
|
|
901
695
|
"SMTP"
|
|
902
696
|
]),
|
|
903
697
|
integration: IntegrationConfigSchema,
|
|
904
|
-
key:
|
|
905
|
-
params:
|
|
906
|
-
options:
|
|
907
|
-
registerSourceJob:
|
|
908
|
-
id:
|
|
909
|
-
version:
|
|
698
|
+
key: zod.z.string(),
|
|
699
|
+
params: zod.z.any(),
|
|
700
|
+
options: zod.z.record(zod.z.array(zod.z.string())),
|
|
701
|
+
registerSourceJob: zod.z.object({
|
|
702
|
+
id: zod.z.string(),
|
|
703
|
+
version: zod.z.string()
|
|
910
704
|
}).optional()
|
|
911
705
|
});
|
|
912
|
-
var SourceMetadataSchema =
|
|
706
|
+
var SourceMetadataSchema = zod.z.preprocess(addMissingVersionField, zod.z.discriminatedUnion("version", [
|
|
913
707
|
SourceMetadataV1Schema,
|
|
914
708
|
SourceMetadataV2Schema
|
|
915
709
|
]));
|
|
916
|
-
var
|
|
917
|
-
|
|
918
|
-
|
|
710
|
+
var WebhookMetadataSchema = zod.z.object({
|
|
711
|
+
key: zod.z.string(),
|
|
712
|
+
params: zod.z.any(),
|
|
713
|
+
config: zod.z.record(zod.z.array(zod.z.string())),
|
|
714
|
+
integration: IntegrationConfigSchema,
|
|
715
|
+
httpEndpoint: zod.z.object({
|
|
716
|
+
id: zod.z.string()
|
|
717
|
+
})
|
|
718
|
+
});
|
|
719
|
+
var WebhookContextMetadataSchema = zod.z.object({
|
|
720
|
+
params: zod.z.any(),
|
|
721
|
+
config: zod.z.record(zod.z.string().array()),
|
|
722
|
+
secret: zod.z.string()
|
|
723
|
+
});
|
|
724
|
+
var DynamicTriggerEndpointMetadataSchema = zod.z.object({
|
|
725
|
+
id: zod.z.string(),
|
|
726
|
+
jobs: zod.z.array(JobMetadataSchema.pick({
|
|
919
727
|
id: true,
|
|
920
728
|
version: true
|
|
921
729
|
})),
|
|
922
|
-
registerSourceJob:
|
|
923
|
-
id:
|
|
924
|
-
version:
|
|
730
|
+
registerSourceJob: zod.z.object({
|
|
731
|
+
id: zod.z.string(),
|
|
732
|
+
version: zod.z.string()
|
|
925
733
|
}).optional()
|
|
926
734
|
});
|
|
927
|
-
var
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
735
|
+
var HttpEndpointMetadataSchema = zod.z.object({
|
|
736
|
+
id: zod.z.string(),
|
|
737
|
+
version: zod.z.string(),
|
|
738
|
+
enabled: zod.z.boolean(),
|
|
739
|
+
title: zod.z.string().optional(),
|
|
740
|
+
icon: zod.z.string().optional(),
|
|
741
|
+
properties: zod.z.array(DisplayPropertySchema).optional(),
|
|
742
|
+
event: EventSpecificationSchema,
|
|
743
|
+
immediateResponseFilter: RequestFilterSchema.optional(),
|
|
744
|
+
skipTriggeringRuns: zod.z.boolean().optional(),
|
|
745
|
+
source: zod.z.string()
|
|
746
|
+
});
|
|
747
|
+
var IndexEndpointResponseSchema = zod.z.object({
|
|
748
|
+
jobs: zod.z.array(JobMetadataSchema),
|
|
749
|
+
sources: zod.z.array(SourceMetadataSchema),
|
|
750
|
+
webhooks: zod.z.array(WebhookMetadataSchema).optional(),
|
|
751
|
+
dynamicTriggers: zod.z.array(DynamicTriggerEndpointMetadataSchema),
|
|
752
|
+
dynamicSchedules: zod.z.array(RegisterDynamicSchedulePayloadSchema),
|
|
753
|
+
httpEndpoints: zod.z.array(HttpEndpointMetadataSchema).optional()
|
|
754
|
+
});
|
|
755
|
+
var EndpointIndexErrorSchema = zod.z.object({
|
|
756
|
+
message: zod.z.string(),
|
|
757
|
+
raw: zod.z.any().optional()
|
|
758
|
+
});
|
|
759
|
+
var IndexEndpointStatsSchema = zod.z.object({
|
|
760
|
+
jobs: zod.z.number(),
|
|
761
|
+
sources: zod.z.number(),
|
|
762
|
+
webhooks: zod.z.number().optional(),
|
|
763
|
+
dynamicTriggers: zod.z.number(),
|
|
764
|
+
dynamicSchedules: zod.z.number(),
|
|
765
|
+
disabledJobs: zod.z.number().default(0),
|
|
766
|
+
httpEndpoints: zod.z.number().default(0)
|
|
767
|
+
});
|
|
768
|
+
function parseEndpointIndexStats(stats) {
|
|
769
|
+
if (stats === null || stats === void 0) {
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
return IndexEndpointStatsSchema.parse(stats);
|
|
773
|
+
}
|
|
774
|
+
__name(parseEndpointIndexStats, "parseEndpointIndexStats");
|
|
775
|
+
var GetEndpointIndexResponseSchema = zod.z.discriminatedUnion("status", [
|
|
776
|
+
zod.z.object({
|
|
777
|
+
status: zod.z.literal("PENDING"),
|
|
778
|
+
updatedAt: zod.z.coerce.date()
|
|
779
|
+
}),
|
|
780
|
+
zod.z.object({
|
|
781
|
+
status: zod.z.literal("STARTED"),
|
|
782
|
+
updatedAt: zod.z.coerce.date()
|
|
783
|
+
}),
|
|
784
|
+
zod.z.object({
|
|
785
|
+
status: zod.z.literal("SUCCESS"),
|
|
786
|
+
stats: IndexEndpointStatsSchema,
|
|
787
|
+
updatedAt: zod.z.coerce.date()
|
|
788
|
+
}),
|
|
789
|
+
zod.z.object({
|
|
790
|
+
status: zod.z.literal("FAILURE"),
|
|
791
|
+
error: EndpointIndexErrorSchema,
|
|
792
|
+
updatedAt: zod.z.coerce.date()
|
|
793
|
+
})
|
|
794
|
+
]);
|
|
795
|
+
var EndpointHeadersSchema = zod.z.object({
|
|
796
|
+
"trigger-version": zod.z.string().optional(),
|
|
797
|
+
"trigger-sdk-version": zod.z.string().optional()
|
|
798
|
+
});
|
|
799
|
+
var ExecuteJobRunMetadataSchema = zod.z.object({
|
|
800
|
+
successSubscription: zod.z.boolean().optional(),
|
|
801
|
+
failedSubscription: zod.z.boolean().optional()
|
|
932
802
|
});
|
|
933
|
-
var
|
|
803
|
+
var ExecuteJobHeadersSchema = EndpointHeadersSchema.extend({
|
|
804
|
+
"x-trigger-run-metadata": zod.z.preprocess((val) => typeof val === "string" && JSON.parse(val), ExecuteJobRunMetadataSchema).optional()
|
|
805
|
+
});
|
|
806
|
+
var RawEventSchema = zod.z.object({
|
|
934
807
|
/** The `name` property must exactly match any subscriptions you want to
|
|
935
808
|
trigger. */
|
|
936
|
-
name:
|
|
809
|
+
name: zod.z.string(),
|
|
937
810
|
/** The `payload` property will be sent to any matching Jobs and will appear
|
|
938
811
|
as the `payload` param of the `run()` function. You can leave this
|
|
939
812
|
parameter out if you just want to trigger a Job without any input data. */
|
|
940
|
-
payload:
|
|
813
|
+
payload: zod.z.any(),
|
|
941
814
|
/** The optional `context` property will be sent to any matching Jobs and will
|
|
942
815
|
be passed through as the `context.event.context` param of the `run()`
|
|
943
816
|
function. This is optional but can be useful if you want to pass through
|
|
944
817
|
some additional context to the Job. */
|
|
945
|
-
context:
|
|
818
|
+
context: zod.z.any().optional(),
|
|
946
819
|
/** The `id` property uniquely identify this particular event. If unset it
|
|
947
820
|
will be set automatically using `ulid`. */
|
|
948
|
-
id:
|
|
821
|
+
id: zod.z.string().default(() => ulidx.ulid()),
|
|
949
822
|
/** This is optional, it defaults to the current timestamp. Usually you would
|
|
950
823
|
only set this if you have a timestamp that you wish to pass through, e.g.
|
|
951
824
|
you receive a timestamp from a service and you want the same timestamp to
|
|
952
825
|
be used in your Job. */
|
|
953
|
-
timestamp:
|
|
826
|
+
timestamp: zod.z.coerce.date().optional(),
|
|
954
827
|
/** This is optional, it defaults to "trigger.dev". It can be useful to set
|
|
955
828
|
this as you can filter events using this in the `eventTrigger()`. */
|
|
956
|
-
source:
|
|
829
|
+
source: zod.z.string().optional(),
|
|
830
|
+
/** This is optional, it defaults to "JSON". If your event is actually a request,
|
|
831
|
+
with a url, headers, method and rawBody you can use "REQUEST" */
|
|
832
|
+
payloadType: zod.z.union([
|
|
833
|
+
zod.z.literal("JSON"),
|
|
834
|
+
zod.z.literal("REQUEST")
|
|
835
|
+
]).optional()
|
|
957
836
|
});
|
|
958
|
-
var ApiEventLogSchema =
|
|
837
|
+
var ApiEventLogSchema = zod.z.object({
|
|
959
838
|
/** The `id` of the event that was sent.
|
|
960
839
|
*/
|
|
961
|
-
id:
|
|
840
|
+
id: zod.z.string(),
|
|
962
841
|
/** The `name` of the event that was sent. */
|
|
963
|
-
name:
|
|
842
|
+
name: zod.z.string(),
|
|
964
843
|
/** The `payload` of the event that was sent */
|
|
965
844
|
payload: DeserializedJsonSchema,
|
|
966
845
|
/** The `context` of the event that was sent. Is `undefined` if no context was
|
|
967
846
|
set when sending the event. */
|
|
968
847
|
context: DeserializedJsonSchema.optional().nullable(),
|
|
969
848
|
/** The `timestamp` of the event that was sent */
|
|
970
|
-
timestamp:
|
|
849
|
+
timestamp: zod.z.coerce.date(),
|
|
971
850
|
/** The timestamp when the event will be delivered to any matching Jobs. Is
|
|
972
851
|
`undefined` if `deliverAt` or `deliverAfter` wasn't set when sending the
|
|
973
852
|
event. */
|
|
974
|
-
deliverAt:
|
|
853
|
+
deliverAt: zod.z.coerce.date().optional().nullable(),
|
|
975
854
|
/** The timestamp when the event was delivered. Is `undefined` if `deliverAt`
|
|
976
855
|
or `deliverAfter` were set when sending the event. */
|
|
977
|
-
deliveredAt:
|
|
856
|
+
deliveredAt: zod.z.coerce.date().optional().nullable(),
|
|
978
857
|
/** The timestamp when the event was cancelled. Is `undefined` if the event
|
|
979
858
|
* wasn't cancelled. */
|
|
980
|
-
cancelledAt:
|
|
859
|
+
cancelledAt: zod.z.coerce.date().optional().nullable()
|
|
981
860
|
});
|
|
982
|
-
var SendEventOptionsSchema =
|
|
861
|
+
var SendEventOptionsSchema = zod.z.object({
|
|
983
862
|
/** An optional Date when you want the event to trigger Jobs. The event will
|
|
984
863
|
be sent to the platform immediately but won't be acted upon until the
|
|
985
864
|
specified time. */
|
|
986
|
-
deliverAt:
|
|
865
|
+
deliverAt: zod.z.coerce.date().optional(),
|
|
987
866
|
/** An optional number of seconds you want to wait for the event to trigger
|
|
988
867
|
any relevant Jobs. The event will be sent to the platform immediately but
|
|
989
868
|
won't be delivered until after the elapsed number of seconds. */
|
|
990
|
-
deliverAfter:
|
|
869
|
+
deliverAfter: zod.z.number().int().optional(),
|
|
991
870
|
/** This optional param will be used by Trigger.dev Connect, which
|
|
992
871
|
is coming soon. */
|
|
993
|
-
accountId:
|
|
872
|
+
accountId: zod.z.string().optional()
|
|
994
873
|
});
|
|
995
|
-
var SendEventBodySchema =
|
|
874
|
+
var SendEventBodySchema = zod.z.object({
|
|
996
875
|
event: RawEventSchema,
|
|
997
876
|
options: SendEventOptionsSchema.optional()
|
|
998
877
|
});
|
|
999
|
-
var
|
|
1000
|
-
|
|
878
|
+
var SendBulkEventsBodySchema = zod.z.object({
|
|
879
|
+
events: RawEventSchema.array(),
|
|
880
|
+
options: SendEventOptionsSchema.optional()
|
|
881
|
+
});
|
|
882
|
+
var DeliverEventResponseSchema = zod.z.object({
|
|
883
|
+
deliveredAt: zod.z.string().datetime()
|
|
1001
884
|
});
|
|
1002
|
-
var RuntimeEnvironmentTypeSchema =
|
|
885
|
+
var RuntimeEnvironmentTypeSchema = zod.z.enum([
|
|
1003
886
|
"PRODUCTION",
|
|
1004
887
|
"STAGING",
|
|
1005
888
|
"DEVELOPMENT",
|
|
1006
889
|
"PREVIEW"
|
|
1007
890
|
]);
|
|
1008
|
-
var RunSourceContextSchema =
|
|
1009
|
-
id:
|
|
1010
|
-
metadata:
|
|
891
|
+
var RunSourceContextSchema = zod.z.object({
|
|
892
|
+
id: zod.z.string(),
|
|
893
|
+
metadata: zod.z.any()
|
|
1011
894
|
});
|
|
1012
|
-
var
|
|
895
|
+
var AutoYieldConfigSchema = zod.z.object({
|
|
896
|
+
startTaskThreshold: zod.z.number(),
|
|
897
|
+
beforeExecuteTaskThreshold: zod.z.number(),
|
|
898
|
+
beforeCompleteTaskThreshold: zod.z.number(),
|
|
899
|
+
afterCompleteTaskThreshold: zod.z.number()
|
|
900
|
+
});
|
|
901
|
+
var RunJobBodySchema = zod.z.object({
|
|
1013
902
|
event: ApiEventLogSchema,
|
|
1014
|
-
job:
|
|
1015
|
-
id:
|
|
1016
|
-
version:
|
|
903
|
+
job: zod.z.object({
|
|
904
|
+
id: zod.z.string(),
|
|
905
|
+
version: zod.z.string()
|
|
1017
906
|
}),
|
|
1018
|
-
run:
|
|
1019
|
-
id:
|
|
1020
|
-
isTest:
|
|
1021
|
-
isRetry:
|
|
1022
|
-
startedAt:
|
|
907
|
+
run: zod.z.object({
|
|
908
|
+
id: zod.z.string(),
|
|
909
|
+
isTest: zod.z.boolean(),
|
|
910
|
+
isRetry: zod.z.boolean().default(false),
|
|
911
|
+
startedAt: zod.z.coerce.date()
|
|
1023
912
|
}),
|
|
1024
|
-
environment:
|
|
1025
|
-
id:
|
|
1026
|
-
slug:
|
|
913
|
+
environment: zod.z.object({
|
|
914
|
+
id: zod.z.string(),
|
|
915
|
+
slug: zod.z.string(),
|
|
1027
916
|
type: RuntimeEnvironmentTypeSchema
|
|
1028
917
|
}),
|
|
1029
|
-
organization:
|
|
1030
|
-
id:
|
|
1031
|
-
title:
|
|
1032
|
-
slug:
|
|
918
|
+
organization: zod.z.object({
|
|
919
|
+
id: zod.z.string(),
|
|
920
|
+
title: zod.z.string(),
|
|
921
|
+
slug: zod.z.string()
|
|
1033
922
|
}),
|
|
1034
|
-
|
|
1035
|
-
id:
|
|
1036
|
-
|
|
923
|
+
project: zod.z.object({
|
|
924
|
+
id: zod.z.string(),
|
|
925
|
+
name: zod.z.string(),
|
|
926
|
+
slug: zod.z.string()
|
|
927
|
+
}).optional(),
|
|
928
|
+
account: zod.z.object({
|
|
929
|
+
id: zod.z.string(),
|
|
930
|
+
metadata: zod.z.any()
|
|
1037
931
|
}).optional(),
|
|
1038
932
|
source: RunSourceContextSchema.optional(),
|
|
1039
|
-
tasks:
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
933
|
+
tasks: zod.z.array(CachedTaskSchema).optional(),
|
|
934
|
+
cachedTaskCursor: zod.z.string().optional(),
|
|
935
|
+
noopTasksSet: zod.z.string().optional(),
|
|
936
|
+
connections: zod.z.record(ConnectionAuthSchema).optional(),
|
|
937
|
+
yieldedExecutions: zod.z.string().array().optional(),
|
|
938
|
+
runChunkExecutionLimit: zod.z.number().optional(),
|
|
939
|
+
autoYieldConfig: AutoYieldConfigSchema.optional()
|
|
940
|
+
});
|
|
941
|
+
var RunJobErrorSchema = zod.z.object({
|
|
942
|
+
status: zod.z.literal("ERROR"),
|
|
1044
943
|
error: ErrorWithStackSchema,
|
|
1045
944
|
task: TaskSchema.optional()
|
|
1046
945
|
});
|
|
1047
|
-
var
|
|
1048
|
-
status:
|
|
946
|
+
var RunJobYieldExecutionErrorSchema = zod.z.object({
|
|
947
|
+
status: zod.z.literal("YIELD_EXECUTION"),
|
|
948
|
+
key: zod.z.string()
|
|
949
|
+
});
|
|
950
|
+
var AutoYieldMetadataSchema = zod.z.object({
|
|
951
|
+
location: zod.z.string(),
|
|
952
|
+
timeRemaining: zod.z.number(),
|
|
953
|
+
timeElapsed: zod.z.number(),
|
|
954
|
+
limit: zod.z.number().optional()
|
|
955
|
+
});
|
|
956
|
+
var RunJobAutoYieldExecutionErrorSchema = AutoYieldMetadataSchema.extend({
|
|
957
|
+
status: zod.z.literal("AUTO_YIELD_EXECUTION")
|
|
958
|
+
});
|
|
959
|
+
var RunJobAutoYieldWithCompletedTaskExecutionErrorSchema = zod.z.object({
|
|
960
|
+
status: zod.z.literal("AUTO_YIELD_EXECUTION_WITH_COMPLETED_TASK"),
|
|
961
|
+
id: zod.z.string(),
|
|
962
|
+
properties: zod.z.array(DisplayPropertySchema).optional(),
|
|
963
|
+
output: zod.z.string().optional(),
|
|
964
|
+
data: AutoYieldMetadataSchema
|
|
965
|
+
});
|
|
966
|
+
var RunJobInvalidPayloadErrorSchema = zod.z.object({
|
|
967
|
+
status: zod.z.literal("INVALID_PAYLOAD"),
|
|
968
|
+
errors: zod.z.array(SchemaErrorSchema)
|
|
969
|
+
});
|
|
970
|
+
var RunJobUnresolvedAuthErrorSchema = zod.z.object({
|
|
971
|
+
status: zod.z.literal("UNRESOLVED_AUTH_ERROR"),
|
|
972
|
+
issues: zod.z.record(zod.z.object({
|
|
973
|
+
id: zod.z.string(),
|
|
974
|
+
error: zod.z.string()
|
|
975
|
+
}))
|
|
976
|
+
});
|
|
977
|
+
var RunJobResumeWithTaskSchema = zod.z.object({
|
|
978
|
+
status: zod.z.literal("RESUME_WITH_TASK"),
|
|
1049
979
|
task: TaskSchema
|
|
1050
980
|
});
|
|
1051
|
-
var RunJobRetryWithTaskSchema =
|
|
1052
|
-
status:
|
|
981
|
+
var RunJobRetryWithTaskSchema = zod.z.object({
|
|
982
|
+
status: zod.z.literal("RETRY_WITH_TASK"),
|
|
1053
983
|
task: TaskSchema,
|
|
1054
984
|
error: ErrorWithStackSchema,
|
|
1055
|
-
retryAt:
|
|
985
|
+
retryAt: zod.z.coerce.date()
|
|
1056
986
|
});
|
|
1057
|
-
var RunJobCanceledWithTaskSchema =
|
|
1058
|
-
status:
|
|
987
|
+
var RunJobCanceledWithTaskSchema = zod.z.object({
|
|
988
|
+
status: zod.z.literal("CANCELED"),
|
|
1059
989
|
task: TaskSchema
|
|
1060
990
|
});
|
|
1061
|
-
var RunJobSuccessSchema =
|
|
1062
|
-
status:
|
|
991
|
+
var RunJobSuccessSchema = zod.z.object({
|
|
992
|
+
status: zod.z.literal("SUCCESS"),
|
|
1063
993
|
output: DeserializedJsonSchema.optional()
|
|
1064
994
|
});
|
|
1065
|
-
var
|
|
995
|
+
var RunJobErrorResponseSchema = zod.z.union([
|
|
996
|
+
RunJobAutoYieldExecutionErrorSchema,
|
|
997
|
+
RunJobAutoYieldWithCompletedTaskExecutionErrorSchema,
|
|
998
|
+
RunJobYieldExecutionErrorSchema,
|
|
1066
999
|
RunJobErrorSchema,
|
|
1000
|
+
RunJobUnresolvedAuthErrorSchema,
|
|
1001
|
+
RunJobInvalidPayloadErrorSchema,
|
|
1067
1002
|
RunJobResumeWithTaskSchema,
|
|
1068
1003
|
RunJobRetryWithTaskSchema,
|
|
1004
|
+
RunJobCanceledWithTaskSchema
|
|
1005
|
+
]);
|
|
1006
|
+
var RunJobResumeWithParallelTaskSchema = zod.z.object({
|
|
1007
|
+
status: zod.z.literal("RESUME_WITH_PARALLEL_TASK"),
|
|
1008
|
+
task: TaskSchema,
|
|
1009
|
+
childErrors: zod.z.array(RunJobErrorResponseSchema)
|
|
1010
|
+
});
|
|
1011
|
+
var RunJobResponseSchema = zod.z.discriminatedUnion("status", [
|
|
1012
|
+
RunJobAutoYieldExecutionErrorSchema,
|
|
1013
|
+
RunJobAutoYieldWithCompletedTaskExecutionErrorSchema,
|
|
1014
|
+
RunJobYieldExecutionErrorSchema,
|
|
1015
|
+
RunJobErrorSchema,
|
|
1016
|
+
RunJobUnresolvedAuthErrorSchema,
|
|
1017
|
+
RunJobInvalidPayloadErrorSchema,
|
|
1018
|
+
RunJobResumeWithTaskSchema,
|
|
1019
|
+
RunJobResumeWithParallelTaskSchema,
|
|
1020
|
+
RunJobRetryWithTaskSchema,
|
|
1069
1021
|
RunJobCanceledWithTaskSchema,
|
|
1070
1022
|
RunJobSuccessSchema
|
|
1071
1023
|
]);
|
|
1072
|
-
var PreprocessRunBodySchema =
|
|
1024
|
+
var PreprocessRunBodySchema = zod.z.object({
|
|
1073
1025
|
event: ApiEventLogSchema,
|
|
1074
|
-
job:
|
|
1075
|
-
id:
|
|
1076
|
-
version:
|
|
1026
|
+
job: zod.z.object({
|
|
1027
|
+
id: zod.z.string(),
|
|
1028
|
+
version: zod.z.string()
|
|
1077
1029
|
}),
|
|
1078
|
-
run:
|
|
1079
|
-
id:
|
|
1080
|
-
isTest:
|
|
1030
|
+
run: zod.z.object({
|
|
1031
|
+
id: zod.z.string(),
|
|
1032
|
+
isTest: zod.z.boolean()
|
|
1081
1033
|
}),
|
|
1082
|
-
environment:
|
|
1083
|
-
id:
|
|
1084
|
-
slug:
|
|
1034
|
+
environment: zod.z.object({
|
|
1035
|
+
id: zod.z.string(),
|
|
1036
|
+
slug: zod.z.string(),
|
|
1085
1037
|
type: RuntimeEnvironmentTypeSchema
|
|
1086
1038
|
}),
|
|
1087
|
-
organization:
|
|
1088
|
-
id:
|
|
1089
|
-
title:
|
|
1090
|
-
slug:
|
|
1039
|
+
organization: zod.z.object({
|
|
1040
|
+
id: zod.z.string(),
|
|
1041
|
+
title: zod.z.string(),
|
|
1042
|
+
slug: zod.z.string()
|
|
1091
1043
|
}),
|
|
1092
|
-
account:
|
|
1093
|
-
id:
|
|
1094
|
-
metadata:
|
|
1044
|
+
account: zod.z.object({
|
|
1045
|
+
id: zod.z.string(),
|
|
1046
|
+
metadata: zod.z.any()
|
|
1095
1047
|
}).optional()
|
|
1096
1048
|
});
|
|
1097
|
-
var PreprocessRunResponseSchema =
|
|
1098
|
-
abort:
|
|
1099
|
-
properties:
|
|
1049
|
+
var PreprocessRunResponseSchema = zod.z.object({
|
|
1050
|
+
abort: zod.z.boolean(),
|
|
1051
|
+
properties: zod.z.array(DisplayPropertySchema).optional()
|
|
1100
1052
|
});
|
|
1101
|
-
var CreateRunResponseOkSchema =
|
|
1102
|
-
ok:
|
|
1103
|
-
data:
|
|
1104
|
-
id:
|
|
1053
|
+
var CreateRunResponseOkSchema = zod.z.object({
|
|
1054
|
+
ok: zod.z.literal(true),
|
|
1055
|
+
data: zod.z.object({
|
|
1056
|
+
id: zod.z.string()
|
|
1105
1057
|
})
|
|
1106
1058
|
});
|
|
1107
|
-
var CreateRunResponseErrorSchema =
|
|
1108
|
-
ok:
|
|
1109
|
-
error:
|
|
1059
|
+
var CreateRunResponseErrorSchema = zod.z.object({
|
|
1060
|
+
ok: zod.z.literal(false),
|
|
1061
|
+
error: zod.z.string()
|
|
1110
1062
|
});
|
|
1111
|
-
var CreateRunResponseBodySchema =
|
|
1063
|
+
var CreateRunResponseBodySchema = zod.z.discriminatedUnion("ok", [
|
|
1112
1064
|
CreateRunResponseOkSchema,
|
|
1113
1065
|
CreateRunResponseErrorSchema
|
|
1114
1066
|
]);
|
|
1115
|
-
var RedactStringSchema =
|
|
1116
|
-
__redactedString:
|
|
1117
|
-
strings:
|
|
1118
|
-
interpolations:
|
|
1067
|
+
var RedactStringSchema = zod.z.object({
|
|
1068
|
+
__redactedString: zod.z.literal(true),
|
|
1069
|
+
strings: zod.z.array(zod.z.string()),
|
|
1070
|
+
interpolations: zod.z.array(zod.z.string())
|
|
1119
1071
|
});
|
|
1120
|
-
var LogMessageSchema =
|
|
1121
|
-
level:
|
|
1072
|
+
var LogMessageSchema = zod.z.object({
|
|
1073
|
+
level: zod.z.enum([
|
|
1122
1074
|
"DEBUG",
|
|
1123
1075
|
"INFO",
|
|
1124
1076
|
"WARN",
|
|
1125
1077
|
"ERROR"
|
|
1126
1078
|
]),
|
|
1127
|
-
message:
|
|
1079
|
+
message: zod.z.string(),
|
|
1128
1080
|
data: SerializableJsonSchema.optional()
|
|
1129
1081
|
});
|
|
1130
|
-
var RedactSchema =
|
|
1131
|
-
paths:
|
|
1082
|
+
var RedactSchema = zod.z.object({
|
|
1083
|
+
paths: zod.z.array(zod.z.string())
|
|
1132
1084
|
});
|
|
1133
|
-
var RetryOptionsSchema =
|
|
1085
|
+
var RetryOptionsSchema = zod.z.object({
|
|
1134
1086
|
/** The maximum number of times to retry the request. */
|
|
1135
|
-
limit:
|
|
1087
|
+
limit: zod.z.number().optional(),
|
|
1136
1088
|
/** The exponential factor to use when calculating the next retry time. */
|
|
1137
|
-
factor:
|
|
1089
|
+
factor: zod.z.number().optional(),
|
|
1138
1090
|
/** The minimum amount of time to wait before retrying the request. */
|
|
1139
|
-
minTimeoutInMs:
|
|
1091
|
+
minTimeoutInMs: zod.z.number().optional(),
|
|
1140
1092
|
/** The maximum amount of time to wait before retrying the request. */
|
|
1141
|
-
maxTimeoutInMs:
|
|
1093
|
+
maxTimeoutInMs: zod.z.number().optional(),
|
|
1142
1094
|
/** Whether to randomize the retry time. */
|
|
1143
|
-
randomize:
|
|
1095
|
+
randomize: zod.z.boolean().optional()
|
|
1144
1096
|
});
|
|
1145
|
-
var RunTaskOptionsSchema =
|
|
1097
|
+
var RunTaskOptionsSchema = zod.z.object({
|
|
1146
1098
|
/** The name of the Task is required. This is displayed on the Task in the logs. */
|
|
1147
|
-
name:
|
|
1099
|
+
name: zod.z.string().optional(),
|
|
1148
1100
|
/** The Task will wait and only start at the specified Date */
|
|
1149
|
-
delayUntil:
|
|
1101
|
+
delayUntil: zod.z.coerce.date().optional(),
|
|
1150
1102
|
/** Retry options */
|
|
1151
1103
|
retry: RetryOptionsSchema.optional(),
|
|
1152
1104
|
/** The icon for the Task, it will appear in the logs.
|
|
1153
1105
|
* You can use the name of a company in lowercase, e.g. "github".
|
|
1154
|
-
* Or any icon name that [
|
|
1155
|
-
icon:
|
|
1106
|
+
* Or any icon name that [Tabler Icons](https://tabler-icons.io/) supports. */
|
|
1107
|
+
icon: zod.z.string().optional(),
|
|
1156
1108
|
/** The key for the Task that you want to appear in the logs */
|
|
1157
|
-
displayKey:
|
|
1109
|
+
displayKey: zod.z.string().optional(),
|
|
1158
1110
|
/** A description of the Task */
|
|
1159
|
-
description:
|
|
1111
|
+
description: zod.z.string().optional(),
|
|
1160
1112
|
/** Properties that are displayed in the logs */
|
|
1161
|
-
properties:
|
|
1113
|
+
properties: zod.z.array(DisplayPropertySchema).optional(),
|
|
1162
1114
|
/** The input params to the Task, will be displayed in the logs */
|
|
1163
|
-
params:
|
|
1115
|
+
params: zod.z.any(),
|
|
1164
1116
|
/** The style of the log entry. */
|
|
1165
1117
|
style: StyleSchema.optional(),
|
|
1118
|
+
/** Allows you to expose a `task.callbackUrl` to use in your tasks. Enabling this feature will cause the task to return the data sent to the callbackUrl instead of the usual async callback result. */
|
|
1119
|
+
callback: zod.z.object({
|
|
1120
|
+
/** Causes the task to wait for and return the data of the first request sent to `task.callbackUrl`. */
|
|
1121
|
+
enabled: zod.z.boolean(),
|
|
1122
|
+
/** Time to wait for the first request to `task.callbackUrl`. Default: One hour. */
|
|
1123
|
+
timeoutInSeconds: zod.z.number()
|
|
1124
|
+
}).partial().optional(),
|
|
1166
1125
|
/** Allows you to link the Integration connection in the logs. This is handled automatically in integrations. */
|
|
1167
|
-
connectionKey:
|
|
1168
|
-
/** 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. */
|
|
1169
|
-
operation:
|
|
1170
|
-
"fetch"
|
|
1126
|
+
connectionKey: zod.z.string().optional(),
|
|
1127
|
+
/** An operation you want to perform on the Trigger.dev platform, current only "fetch", "fetch-response", and "fetch-poll" is supported. If you wish to `fetch` use [`io.backgroundFetch()`](https://trigger.dev/docs/sdk/io/backgroundfetch) instead. */
|
|
1128
|
+
operation: zod.z.enum([
|
|
1129
|
+
"fetch",
|
|
1130
|
+
"fetch-response",
|
|
1131
|
+
"fetch-poll"
|
|
1171
1132
|
]).optional(),
|
|
1172
1133
|
/** 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). */
|
|
1173
|
-
noop:
|
|
1134
|
+
noop: zod.z.boolean().default(false),
|
|
1174
1135
|
redact: RedactSchema.optional(),
|
|
1175
|
-
|
|
1136
|
+
parallel: zod.z.boolean().optional()
|
|
1176
1137
|
});
|
|
1177
1138
|
var RunTaskBodyInputSchema = RunTaskOptionsSchema.extend({
|
|
1178
|
-
idempotencyKey:
|
|
1179
|
-
parentId:
|
|
1139
|
+
idempotencyKey: zod.z.string(),
|
|
1140
|
+
parentId: zod.z.string().optional()
|
|
1180
1141
|
});
|
|
1181
1142
|
var RunTaskBodyOutputSchema = RunTaskBodyInputSchema.extend({
|
|
1182
|
-
|
|
1143
|
+
properties: zod.z.array(DisplayPropertySchema.partial()).optional(),
|
|
1144
|
+
params: DeserializedJsonSchema.optional().nullable(),
|
|
1145
|
+
callback: zod.z.object({
|
|
1146
|
+
enabled: zod.z.boolean(),
|
|
1147
|
+
timeoutInSeconds: zod.z.number().default(3600)
|
|
1148
|
+
}).optional()
|
|
1149
|
+
});
|
|
1150
|
+
var RunTaskResponseWithCachedTasksBodySchema = zod.z.object({
|
|
1151
|
+
task: ServerTaskSchema,
|
|
1152
|
+
cachedTasks: zod.z.object({
|
|
1153
|
+
tasks: zod.z.array(CachedTaskSchema),
|
|
1154
|
+
cursor: zod.z.string().optional()
|
|
1155
|
+
}).optional()
|
|
1183
1156
|
});
|
|
1184
1157
|
var CompleteTaskBodyInputSchema = RunTaskBodyInputSchema.pick({
|
|
1185
1158
|
properties: true,
|
|
@@ -1188,198 +1161,287 @@ var CompleteTaskBodyInputSchema = RunTaskBodyInputSchema.pick({
|
|
|
1188
1161
|
}).extend({
|
|
1189
1162
|
output: SerializableJsonSchema.optional().transform((v) => v ? DeserializedJsonSchema.parse(JSON.parse(JSON.stringify(v))) : {})
|
|
1190
1163
|
});
|
|
1191
|
-
var
|
|
1164
|
+
var CompleteTaskBodyV2InputSchema = RunTaskBodyInputSchema.pick({
|
|
1165
|
+
properties: true,
|
|
1166
|
+
description: true,
|
|
1167
|
+
params: true
|
|
1168
|
+
}).extend({
|
|
1169
|
+
output: zod.z.string().optional()
|
|
1170
|
+
});
|
|
1171
|
+
var FailTaskBodyInputSchema = zod.z.object({
|
|
1192
1172
|
error: ErrorWithStackSchema
|
|
1193
1173
|
});
|
|
1194
|
-
var NormalizedRequestSchema =
|
|
1195
|
-
headers:
|
|
1196
|
-
method:
|
|
1197
|
-
query:
|
|
1198
|
-
url:
|
|
1199
|
-
body:
|
|
1174
|
+
var NormalizedRequestSchema = zod.z.object({
|
|
1175
|
+
headers: zod.z.record(zod.z.string()),
|
|
1176
|
+
method: zod.z.string(),
|
|
1177
|
+
query: zod.z.record(zod.z.string()),
|
|
1178
|
+
url: zod.z.string(),
|
|
1179
|
+
body: zod.z.any()
|
|
1200
1180
|
});
|
|
1201
|
-
var NormalizedResponseSchema =
|
|
1202
|
-
status:
|
|
1203
|
-
body:
|
|
1204
|
-
headers:
|
|
1181
|
+
var NormalizedResponseSchema = zod.z.object({
|
|
1182
|
+
status: zod.z.number(),
|
|
1183
|
+
body: zod.z.any(),
|
|
1184
|
+
headers: zod.z.record(zod.z.string()).optional()
|
|
1205
1185
|
});
|
|
1206
|
-
var HttpSourceResponseSchema =
|
|
1186
|
+
var HttpSourceResponseSchema = zod.z.object({
|
|
1207
1187
|
response: NormalizedResponseSchema,
|
|
1208
|
-
events:
|
|
1188
|
+
events: zod.z.array(RawEventSchema),
|
|
1209
1189
|
metadata: HttpSourceResponseMetadataSchema.optional()
|
|
1210
1190
|
});
|
|
1211
|
-
var
|
|
1191
|
+
var WebhookDeliveryResponseSchema = zod.z.object({
|
|
1192
|
+
response: NormalizedResponseSchema,
|
|
1193
|
+
verified: zod.z.boolean(),
|
|
1194
|
+
error: zod.z.string().optional()
|
|
1195
|
+
});
|
|
1196
|
+
var RegisterTriggerBodySchemaV1 = zod.z.object({
|
|
1212
1197
|
rule: EventRuleSchema,
|
|
1213
1198
|
source: SourceMetadataV1Schema
|
|
1214
1199
|
});
|
|
1215
|
-
var RegisterTriggerBodySchemaV2 =
|
|
1200
|
+
var RegisterTriggerBodySchemaV2 = zod.z.object({
|
|
1216
1201
|
rule: EventRuleSchema,
|
|
1217
|
-
source: SourceMetadataV2Schema
|
|
1202
|
+
source: SourceMetadataV2Schema,
|
|
1203
|
+
accountId: zod.z.string().optional()
|
|
1218
1204
|
});
|
|
1219
|
-
var InitializeTriggerBodySchema =
|
|
1220
|
-
id:
|
|
1221
|
-
params:
|
|
1222
|
-
accountId:
|
|
1223
|
-
metadata:
|
|
1205
|
+
var InitializeTriggerBodySchema = zod.z.object({
|
|
1206
|
+
id: zod.z.string(),
|
|
1207
|
+
params: zod.z.any(),
|
|
1208
|
+
accountId: zod.z.string().optional(),
|
|
1209
|
+
metadata: zod.z.any().optional()
|
|
1224
1210
|
});
|
|
1225
|
-
var RegisterCommonScheduleBodySchema =
|
|
1211
|
+
var RegisterCommonScheduleBodySchema = zod.z.object({
|
|
1226
1212
|
/** A unique id for the schedule. This is used to identify and unregister the schedule later. */
|
|
1227
|
-
id:
|
|
1213
|
+
id: zod.z.string(),
|
|
1228
1214
|
/** Any additional metadata about the schedule. */
|
|
1229
|
-
metadata:
|
|
1230
|
-
/**
|
|
1231
|
-
accountId:
|
|
1215
|
+
metadata: zod.z.any(),
|
|
1216
|
+
/** An optional Account ID to associate with runs triggered by this schedule */
|
|
1217
|
+
accountId: zod.z.string().optional()
|
|
1232
1218
|
});
|
|
1233
1219
|
var RegisterIntervalScheduleBodySchema = RegisterCommonScheduleBodySchema.merge(IntervalMetadataSchema);
|
|
1234
1220
|
var InitializeCronScheduleBodySchema = RegisterCommonScheduleBodySchema.merge(CronMetadataSchema);
|
|
1235
|
-
var RegisterScheduleBodySchema =
|
|
1221
|
+
var RegisterScheduleBodySchema = zod.z.discriminatedUnion("type", [
|
|
1236
1222
|
RegisterIntervalScheduleBodySchema,
|
|
1237
1223
|
InitializeCronScheduleBodySchema
|
|
1238
1224
|
]);
|
|
1239
|
-
var RegisterScheduleResponseBodySchema =
|
|
1240
|
-
id:
|
|
1225
|
+
var RegisterScheduleResponseBodySchema = zod.z.object({
|
|
1226
|
+
id: zod.z.string(),
|
|
1241
1227
|
schedule: ScheduleMetadataSchema,
|
|
1242
|
-
metadata:
|
|
1243
|
-
active:
|
|
1228
|
+
metadata: zod.z.any(),
|
|
1229
|
+
active: zod.z.boolean()
|
|
1244
1230
|
});
|
|
1245
|
-
var CreateExternalConnectionBodySchema =
|
|
1246
|
-
accessToken:
|
|
1247
|
-
type:
|
|
1231
|
+
var CreateExternalConnectionBodySchema = zod.z.object({
|
|
1232
|
+
accessToken: zod.z.string(),
|
|
1233
|
+
type: zod.z.enum([
|
|
1248
1234
|
"oauth2"
|
|
1249
1235
|
]),
|
|
1250
|
-
scopes:
|
|
1251
|
-
metadata:
|
|
1236
|
+
scopes: zod.z.array(zod.z.string()).optional(),
|
|
1237
|
+
metadata: zod.z.any()
|
|
1252
1238
|
});
|
|
1253
|
-
var GetRunStatusesSchema =
|
|
1254
|
-
run:
|
|
1255
|
-
id:
|
|
1239
|
+
var GetRunStatusesSchema = zod.z.object({
|
|
1240
|
+
run: zod.z.object({
|
|
1241
|
+
id: zod.z.string(),
|
|
1256
1242
|
status: RunStatusSchema,
|
|
1257
|
-
output:
|
|
1243
|
+
output: zod.z.any().optional()
|
|
1258
1244
|
}),
|
|
1259
|
-
statuses:
|
|
1245
|
+
statuses: zod.z.array(JobRunStatusRecordSchema)
|
|
1260
1246
|
});
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1247
|
+
var InvokeJobResponseSchema = zod.z.object({
|
|
1248
|
+
id: zod.z.string()
|
|
1249
|
+
});
|
|
1250
|
+
var InvokeJobRequestBodySchema = zod.z.object({
|
|
1251
|
+
payload: zod.z.any(),
|
|
1252
|
+
context: zod.z.any().optional(),
|
|
1253
|
+
options: zod.z.object({
|
|
1254
|
+
accountId: zod.z.string().optional(),
|
|
1255
|
+
callbackUrl: zod.z.string().optional()
|
|
1256
|
+
}).optional()
|
|
1257
|
+
});
|
|
1258
|
+
var InvokeOptionsSchema = zod.z.object({
|
|
1259
|
+
accountId: zod.z.string().optional(),
|
|
1260
|
+
idempotencyKey: zod.z.string().optional(),
|
|
1261
|
+
context: zod.z.any().optional(),
|
|
1262
|
+
callbackUrl: zod.z.string().optional()
|
|
1263
|
+
});
|
|
1264
|
+
var EphemeralEventDispatcherRequestBodySchema = zod.z.object({
|
|
1265
|
+
url: zod.z.string(),
|
|
1266
|
+
name: zod.z.string().or(zod.z.array(zod.z.string())),
|
|
1267
|
+
source: zod.z.string().optional(),
|
|
1268
|
+
filter: EventFilterSchema.optional(),
|
|
1269
|
+
contextFilter: EventFilterSchema.optional(),
|
|
1270
|
+
accountId: zod.z.string().optional(),
|
|
1271
|
+
timeoutInSeconds: zod.z.number().int().positive().min(10).max(60 * 60 * 24 * 365).default(3600)
|
|
1272
|
+
});
|
|
1273
|
+
var EphemeralEventDispatcherResponseBodySchema = zod.z.object({
|
|
1274
|
+
id: zod.z.string()
|
|
1275
|
+
});
|
|
1276
|
+
var KeyValueStoreResponseBodySchema = zod.z.discriminatedUnion("action", [
|
|
1277
|
+
zod.z.object({
|
|
1278
|
+
action: zod.z.literal("DELETE"),
|
|
1279
|
+
key: zod.z.string(),
|
|
1280
|
+
deleted: zod.z.boolean()
|
|
1281
|
+
}),
|
|
1282
|
+
zod.z.object({
|
|
1283
|
+
action: zod.z.literal("GET"),
|
|
1284
|
+
key: zod.z.string(),
|
|
1285
|
+
value: zod.z.string().optional()
|
|
1286
|
+
}),
|
|
1287
|
+
zod.z.object({
|
|
1288
|
+
action: zod.z.literal("HAS"),
|
|
1289
|
+
key: zod.z.string(),
|
|
1290
|
+
has: zod.z.boolean()
|
|
1291
|
+
}),
|
|
1292
|
+
zod.z.object({
|
|
1293
|
+
action: zod.z.literal("SET"),
|
|
1294
|
+
key: zod.z.string(),
|
|
1295
|
+
value: zod.z.string().optional()
|
|
1296
|
+
})
|
|
1297
|
+
]);
|
|
1264
1298
|
var MISSING_CONNECTION_NOTIFICATION = "dev.trigger.notifications.missingConnection";
|
|
1265
1299
|
var MISSING_CONNECTION_RESOLVED_NOTIFICATION = "dev.trigger.notifications.missingConnectionResolved";
|
|
1266
|
-
var CommonMissingConnectionNotificationPayloadSchema =
|
|
1267
|
-
id:
|
|
1268
|
-
client:
|
|
1269
|
-
id:
|
|
1270
|
-
title:
|
|
1271
|
-
scopes:
|
|
1272
|
-
createdAt:
|
|
1273
|
-
updatedAt:
|
|
1300
|
+
var CommonMissingConnectionNotificationPayloadSchema = zod.z.object({
|
|
1301
|
+
id: zod.z.string(),
|
|
1302
|
+
client: zod.z.object({
|
|
1303
|
+
id: zod.z.string(),
|
|
1304
|
+
title: zod.z.string(),
|
|
1305
|
+
scopes: zod.z.array(zod.z.string()),
|
|
1306
|
+
createdAt: zod.z.coerce.date(),
|
|
1307
|
+
updatedAt: zod.z.coerce.date()
|
|
1274
1308
|
}),
|
|
1275
|
-
authorizationUrl:
|
|
1309
|
+
authorizationUrl: zod.z.string()
|
|
1276
1310
|
});
|
|
1277
1311
|
var MissingDeveloperConnectionNotificationPayloadSchema = CommonMissingConnectionNotificationPayloadSchema.extend({
|
|
1278
|
-
type:
|
|
1312
|
+
type: zod.z.literal("DEVELOPER")
|
|
1279
1313
|
});
|
|
1280
1314
|
var MissingExternalConnectionNotificationPayloadSchema = CommonMissingConnectionNotificationPayloadSchema.extend({
|
|
1281
|
-
type:
|
|
1282
|
-
account:
|
|
1283
|
-
id:
|
|
1284
|
-
metadata:
|
|
1315
|
+
type: zod.z.literal("EXTERNAL"),
|
|
1316
|
+
account: zod.z.object({
|
|
1317
|
+
id: zod.z.string(),
|
|
1318
|
+
metadata: zod.z.any()
|
|
1285
1319
|
})
|
|
1286
1320
|
});
|
|
1287
|
-
var MissingConnectionNotificationPayloadSchema =
|
|
1321
|
+
var MissingConnectionNotificationPayloadSchema = zod.z.discriminatedUnion("type", [
|
|
1288
1322
|
MissingDeveloperConnectionNotificationPayloadSchema,
|
|
1289
1323
|
MissingExternalConnectionNotificationPayloadSchema
|
|
1290
1324
|
]);
|
|
1291
|
-
var CommonMissingConnectionNotificationResolvedPayloadSchema =
|
|
1292
|
-
id:
|
|
1293
|
-
client:
|
|
1294
|
-
id:
|
|
1295
|
-
title:
|
|
1296
|
-
scopes:
|
|
1297
|
-
createdAt:
|
|
1298
|
-
updatedAt:
|
|
1299
|
-
integrationIdentifier:
|
|
1300
|
-
integrationAuthMethod:
|
|
1325
|
+
var CommonMissingConnectionNotificationResolvedPayloadSchema = zod.z.object({
|
|
1326
|
+
id: zod.z.string(),
|
|
1327
|
+
client: zod.z.object({
|
|
1328
|
+
id: zod.z.string(),
|
|
1329
|
+
title: zod.z.string(),
|
|
1330
|
+
scopes: zod.z.array(zod.z.string()),
|
|
1331
|
+
createdAt: zod.z.coerce.date(),
|
|
1332
|
+
updatedAt: zod.z.coerce.date(),
|
|
1333
|
+
integrationIdentifier: zod.z.string(),
|
|
1334
|
+
integrationAuthMethod: zod.z.string()
|
|
1301
1335
|
}),
|
|
1302
|
-
expiresAt:
|
|
1336
|
+
expiresAt: zod.z.coerce.date()
|
|
1303
1337
|
});
|
|
1304
1338
|
var MissingDeveloperConnectionResolvedNotificationPayloadSchema = CommonMissingConnectionNotificationResolvedPayloadSchema.extend({
|
|
1305
|
-
type:
|
|
1339
|
+
type: zod.z.literal("DEVELOPER")
|
|
1306
1340
|
});
|
|
1307
1341
|
var MissingExternalConnectionResolvedNotificationPayloadSchema = CommonMissingConnectionNotificationResolvedPayloadSchema.extend({
|
|
1308
|
-
type:
|
|
1309
|
-
account:
|
|
1310
|
-
id:
|
|
1311
|
-
metadata:
|
|
1342
|
+
type: zod.z.literal("EXTERNAL"),
|
|
1343
|
+
account: zod.z.object({
|
|
1344
|
+
id: zod.z.string(),
|
|
1345
|
+
metadata: zod.z.any()
|
|
1312
1346
|
})
|
|
1313
1347
|
});
|
|
1314
|
-
var MissingConnectionResolvedNotificationPayloadSchema =
|
|
1348
|
+
var MissingConnectionResolvedNotificationPayloadSchema = zod.z.discriminatedUnion("type", [
|
|
1315
1349
|
MissingDeveloperConnectionResolvedNotificationPayloadSchema,
|
|
1316
1350
|
MissingExternalConnectionResolvedNotificationPayloadSchema
|
|
1317
1351
|
]);
|
|
1318
|
-
|
|
1319
|
-
// src/schemas/fetch.ts
|
|
1320
|
-
var import_zod13 = require("zod");
|
|
1321
|
-
var FetchRetryHeadersStrategySchema = import_zod13.z.object({
|
|
1352
|
+
var FetchRetryHeadersStrategySchema = zod.z.object({
|
|
1322
1353
|
/** The `headers` strategy retries the request using info from the response headers. */
|
|
1323
|
-
strategy:
|
|
1354
|
+
strategy: zod.z.literal("headers"),
|
|
1324
1355
|
/** The header to use to determine the maximum number of times to retry the request. */
|
|
1325
|
-
limitHeader:
|
|
1356
|
+
limitHeader: zod.z.string(),
|
|
1326
1357
|
/** The header to use to determine the number of remaining retries. */
|
|
1327
|
-
remainingHeader:
|
|
1358
|
+
remainingHeader: zod.z.string(),
|
|
1328
1359
|
/** The header to use to determine the time when the number of remaining retries will be reset. */
|
|
1329
|
-
resetHeader:
|
|
1360
|
+
resetHeader: zod.z.string(),
|
|
1361
|
+
/** The event filter to use to determine if the request should be retried. */
|
|
1362
|
+
bodyFilter: EventFilterSchema.optional(),
|
|
1363
|
+
/** The format of the `resetHeader` value. */
|
|
1364
|
+
resetFormat: zod.z.enum([
|
|
1365
|
+
"unix_timestamp",
|
|
1366
|
+
"unix_timestamp_in_ms",
|
|
1367
|
+
"iso_8601",
|
|
1368
|
+
"iso_8601_duration_openai_variant"
|
|
1369
|
+
]).default("unix_timestamp")
|
|
1330
1370
|
});
|
|
1331
1371
|
var FetchRetryBackoffStrategySchema = RetryOptionsSchema.extend({
|
|
1332
1372
|
/** The `backoff` strategy retries the request with an exponential backoff. */
|
|
1333
|
-
strategy:
|
|
1373
|
+
strategy: zod.z.literal("backoff"),
|
|
1374
|
+
/** The event filter to use to determine if the request should be retried. */
|
|
1375
|
+
bodyFilter: EventFilterSchema.optional()
|
|
1334
1376
|
});
|
|
1335
|
-
var FetchRetryStrategySchema =
|
|
1377
|
+
var FetchRetryStrategySchema = zod.z.discriminatedUnion("strategy", [
|
|
1336
1378
|
FetchRetryHeadersStrategySchema,
|
|
1337
1379
|
FetchRetryBackoffStrategySchema
|
|
1338
1380
|
]);
|
|
1339
|
-
var FetchRequestInitSchema =
|
|
1381
|
+
var FetchRequestInitSchema = zod.z.object({
|
|
1340
1382
|
/** The HTTP method to use for the request. */
|
|
1341
|
-
method:
|
|
1383
|
+
method: zod.z.string().optional(),
|
|
1342
1384
|
/** 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. */
|
|
1343
|
-
headers:
|
|
1344
|
-
|
|
1385
|
+
headers: zod.z.record(zod.z.union([
|
|
1386
|
+
zod.z.string(),
|
|
1345
1387
|
RedactStringSchema
|
|
1346
1388
|
])).optional(),
|
|
1347
1389
|
/** The body of the request. */
|
|
1348
|
-
body:
|
|
1349
|
-
|
|
1350
|
-
|
|
1390
|
+
body: zod.z.union([
|
|
1391
|
+
zod.z.string(),
|
|
1392
|
+
zod.z.instanceof(ArrayBuffer)
|
|
1351
1393
|
]).optional()
|
|
1352
1394
|
});
|
|
1353
|
-
var FetchRetryOptionsSchema =
|
|
1354
|
-
var
|
|
1355
|
-
|
|
1395
|
+
var FetchRetryOptionsSchema = zod.z.record(FetchRetryStrategySchema);
|
|
1396
|
+
var FetchTimeoutOptionsSchema = zod.z.object({
|
|
1397
|
+
durationInMs: zod.z.number(),
|
|
1398
|
+
retry: RetryOptionsSchema.optional()
|
|
1399
|
+
});
|
|
1400
|
+
var FetchOperationSchema = zod.z.object({
|
|
1401
|
+
url: zod.z.string(),
|
|
1402
|
+
requestInit: FetchRequestInitSchema.optional(),
|
|
1403
|
+
retry: zod.z.record(FetchRetryStrategySchema).optional(),
|
|
1404
|
+
timeout: FetchTimeoutOptionsSchema.optional()
|
|
1405
|
+
});
|
|
1406
|
+
var FetchPollOperationSchema = zod.z.object({
|
|
1407
|
+
url: zod.z.string(),
|
|
1408
|
+
interval: zod.z.number().int().positive().min(10).max(600).default(10),
|
|
1409
|
+
timeout: zod.z.number().int().positive().min(30).max(3600).default(600),
|
|
1410
|
+
responseFilter: ResponseFilterSchema,
|
|
1356
1411
|
requestInit: FetchRequestInitSchema.optional(),
|
|
1357
|
-
|
|
1412
|
+
requestTimeout: FetchTimeoutOptionsSchema.optional()
|
|
1358
1413
|
});
|
|
1359
|
-
|
|
1360
|
-
// src/schemas/events.ts
|
|
1361
|
-
var import_zod14 = require("zod");
|
|
1362
|
-
var GetEventSchema = import_zod14.z.object({
|
|
1414
|
+
var GetEventSchema = zod.z.object({
|
|
1363
1415
|
/** The event id */
|
|
1364
|
-
id:
|
|
1416
|
+
id: zod.z.string(),
|
|
1365
1417
|
/** The event name */
|
|
1366
|
-
name:
|
|
1418
|
+
name: zod.z.string(),
|
|
1367
1419
|
/** When the event was created */
|
|
1368
|
-
createdAt:
|
|
1420
|
+
createdAt: zod.z.coerce.date(),
|
|
1369
1421
|
/** When the event was last updated */
|
|
1370
|
-
updatedAt:
|
|
1422
|
+
updatedAt: zod.z.coerce.date(),
|
|
1371
1423
|
/** The runs that were triggered by the event */
|
|
1372
|
-
runs:
|
|
1424
|
+
runs: zod.z.array(zod.z.object({
|
|
1373
1425
|
/** The Run id */
|
|
1374
|
-
id:
|
|
1426
|
+
id: zod.z.string(),
|
|
1375
1427
|
/** The Run status */
|
|
1376
1428
|
status: RunStatusSchema,
|
|
1377
1429
|
/** When the run started */
|
|
1378
|
-
startedAt:
|
|
1430
|
+
startedAt: zod.z.coerce.date().optional().nullable(),
|
|
1379
1431
|
/** When the run completed */
|
|
1380
|
-
completedAt:
|
|
1432
|
+
completedAt: zod.z.coerce.date().optional().nullable()
|
|
1381
1433
|
}))
|
|
1382
1434
|
});
|
|
1435
|
+
var CancelRunsForEventSchema = zod.z.object({
|
|
1436
|
+
cancelledRunIds: zod.z.array(zod.z.string()),
|
|
1437
|
+
failedToCancelRunIds: zod.z.array(zod.z.string())
|
|
1438
|
+
});
|
|
1439
|
+
var RequestWithRawBodySchema = zod.z.object({
|
|
1440
|
+
url: zod.z.string(),
|
|
1441
|
+
method: zod.z.string(),
|
|
1442
|
+
headers: zod.z.record(zod.z.string()),
|
|
1443
|
+
rawBody: zod.z.string()
|
|
1444
|
+
});
|
|
1383
1445
|
|
|
1384
1446
|
// src/utils.ts
|
|
1385
1447
|
function deepMergeFilters(...filters) {
|
|
@@ -1400,6 +1462,10 @@ function deepMergeFilters(...filters) {
|
|
|
1400
1462
|
return result;
|
|
1401
1463
|
}
|
|
1402
1464
|
__name(deepMergeFilters, "deepMergeFilters");
|
|
1465
|
+
function assertExhaustive(x) {
|
|
1466
|
+
throw new Error("Unexpected object: " + x);
|
|
1467
|
+
}
|
|
1468
|
+
__name(assertExhaustive, "assertExhaustive");
|
|
1403
1469
|
|
|
1404
1470
|
// src/retry.ts
|
|
1405
1471
|
var DEFAULT_RETRY_OPTIONS = {
|
|
@@ -1424,6 +1490,73 @@ function calculateRetryAt(retryOptions, attempts) {
|
|
|
1424
1490
|
return new Date(Date.now() + timeoutInMs);
|
|
1425
1491
|
}
|
|
1426
1492
|
__name(calculateRetryAt, "calculateRetryAt");
|
|
1493
|
+
function calculateResetAt(resets, format, now = /* @__PURE__ */ new Date()) {
|
|
1494
|
+
if (!resets)
|
|
1495
|
+
return;
|
|
1496
|
+
switch (format) {
|
|
1497
|
+
case "iso_8601_duration_openai_variant": {
|
|
1498
|
+
return calculateISO8601DurationOpenAIVariantResetAt(resets, now);
|
|
1499
|
+
}
|
|
1500
|
+
case "iso_8601": {
|
|
1501
|
+
return calculateISO8601ResetAt(resets, now);
|
|
1502
|
+
}
|
|
1503
|
+
case "unix_timestamp": {
|
|
1504
|
+
return calculateUnixTimestampResetAt(resets, now);
|
|
1505
|
+
}
|
|
1506
|
+
case "unix_timestamp_in_ms": {
|
|
1507
|
+
return calculateUnixTimestampInMsResetAt(resets, now);
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
__name(calculateResetAt, "calculateResetAt");
|
|
1512
|
+
function calculateUnixTimestampResetAt(resets, now = /* @__PURE__ */ new Date()) {
|
|
1513
|
+
if (!resets)
|
|
1514
|
+
return void 0;
|
|
1515
|
+
const resetAt = parseInt(resets, 10);
|
|
1516
|
+
if (isNaN(resetAt))
|
|
1517
|
+
return void 0;
|
|
1518
|
+
return new Date(resetAt * 1e3);
|
|
1519
|
+
}
|
|
1520
|
+
__name(calculateUnixTimestampResetAt, "calculateUnixTimestampResetAt");
|
|
1521
|
+
function calculateUnixTimestampInMsResetAt(resets, now = /* @__PURE__ */ new Date()) {
|
|
1522
|
+
if (!resets)
|
|
1523
|
+
return void 0;
|
|
1524
|
+
const resetAt = parseInt(resets, 10);
|
|
1525
|
+
if (isNaN(resetAt))
|
|
1526
|
+
return void 0;
|
|
1527
|
+
return new Date(resetAt);
|
|
1528
|
+
}
|
|
1529
|
+
__name(calculateUnixTimestampInMsResetAt, "calculateUnixTimestampInMsResetAt");
|
|
1530
|
+
function calculateISO8601ResetAt(resets, now = /* @__PURE__ */ new Date()) {
|
|
1531
|
+
if (!resets)
|
|
1532
|
+
return void 0;
|
|
1533
|
+
const resetAt = new Date(resets);
|
|
1534
|
+
if (isNaN(resetAt.getTime()))
|
|
1535
|
+
return void 0;
|
|
1536
|
+
return resetAt;
|
|
1537
|
+
}
|
|
1538
|
+
__name(calculateISO8601ResetAt, "calculateISO8601ResetAt");
|
|
1539
|
+
function calculateISO8601DurationOpenAIVariantResetAt(resets, now = /* @__PURE__ */ new Date()) {
|
|
1540
|
+
if (!resets)
|
|
1541
|
+
return void 0;
|
|
1542
|
+
const pattern = /^(?:(\d+)d)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+(?:\.\d+)?)s)?(?:(\d+)ms)?$/;
|
|
1543
|
+
const match = resets.match(pattern);
|
|
1544
|
+
if (!match)
|
|
1545
|
+
return void 0;
|
|
1546
|
+
const days = parseInt(match[1], 10) || 0;
|
|
1547
|
+
const hours = parseInt(match[2], 10) || 0;
|
|
1548
|
+
const minutes = parseInt(match[3], 10) || 0;
|
|
1549
|
+
const seconds = parseFloat(match[4]) || 0;
|
|
1550
|
+
const milliseconds = parseInt(match[5], 10) || 0;
|
|
1551
|
+
const resetAt = new Date(now);
|
|
1552
|
+
resetAt.setDate(resetAt.getDate() + days);
|
|
1553
|
+
resetAt.setHours(resetAt.getHours() + hours);
|
|
1554
|
+
resetAt.setMinutes(resetAt.getMinutes() + minutes);
|
|
1555
|
+
resetAt.setSeconds(resetAt.getSeconds() + Math.floor(seconds));
|
|
1556
|
+
resetAt.setMilliseconds(resetAt.getMilliseconds() + (seconds - Math.floor(seconds)) * 1e3 + milliseconds);
|
|
1557
|
+
return resetAt;
|
|
1558
|
+
}
|
|
1559
|
+
__name(calculateISO8601DurationOpenAIVariantResetAt, "calculateISO8601DurationOpenAIVariantResetAt");
|
|
1427
1560
|
|
|
1428
1561
|
// src/replacements.ts
|
|
1429
1562
|
var currentDate = {
|
|
@@ -1465,6 +1598,13 @@ __name(urlWithSearchParams, "urlWithSearchParams");
|
|
|
1465
1598
|
|
|
1466
1599
|
// src/eventFilterMatches.ts
|
|
1467
1600
|
function eventFilterMatches(payload, filter) {
|
|
1601
|
+
if (payload === void 0 || payload === null) {
|
|
1602
|
+
if (Object.entries(filter).length === 0) {
|
|
1603
|
+
return true;
|
|
1604
|
+
} else {
|
|
1605
|
+
return false;
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1468
1608
|
for (const [patternKey, patternValue] of Object.entries(filter)) {
|
|
1469
1609
|
const payloadValue = payload[patternKey];
|
|
1470
1610
|
if (Array.isArray(patternValue)) {
|
|
@@ -1512,7 +1652,7 @@ __name(eventFilterMatches, "eventFilterMatches");
|
|
|
1512
1652
|
function contentFiltersMatches(actualValue, contentFilters) {
|
|
1513
1653
|
for (const contentFilter of contentFilters) {
|
|
1514
1654
|
if (typeof contentFilter === "object") {
|
|
1515
|
-
|
|
1655
|
+
Object.entries(contentFilter)[0];
|
|
1516
1656
|
if (!contentFilterMatches(actualValue, contentFilter)) {
|
|
1517
1657
|
return false;
|
|
1518
1658
|
}
|
|
@@ -1604,4 +1744,278 @@ function contentFilterMatches(actualValue, contentFilter) {
|
|
|
1604
1744
|
return true;
|
|
1605
1745
|
}
|
|
1606
1746
|
__name(contentFilterMatches, "contentFilterMatches");
|
|
1747
|
+
|
|
1748
|
+
// src/requestFilterMatches.ts
|
|
1749
|
+
async function requestFilterMatches(request, filter) {
|
|
1750
|
+
const clonedRequest = request.clone();
|
|
1751
|
+
if (!requestMethodMatches(clonedRequest.method, filter.method)) {
|
|
1752
|
+
return false;
|
|
1753
|
+
}
|
|
1754
|
+
const headersObj = Object.fromEntries(clonedRequest.headers.entries());
|
|
1755
|
+
if (filter.headers && !eventFilterMatches(headersObj, filter.headers)) {
|
|
1756
|
+
return false;
|
|
1757
|
+
}
|
|
1758
|
+
const searchParams = new URL(clonedRequest.url).searchParams;
|
|
1759
|
+
const searchParamsObject = {};
|
|
1760
|
+
for (const [key, value] of searchParams.entries()) {
|
|
1761
|
+
searchParamsObject[key] = value;
|
|
1762
|
+
}
|
|
1763
|
+
if (filter.query && !eventFilterMatches(searchParamsObject, filter.query)) {
|
|
1764
|
+
return false;
|
|
1765
|
+
}
|
|
1766
|
+
try {
|
|
1767
|
+
const json = await clonedRequest.json();
|
|
1768
|
+
if (filter.body && !eventFilterMatches(json, filter.body)) {
|
|
1769
|
+
return false;
|
|
1770
|
+
}
|
|
1771
|
+
} catch (e) {
|
|
1772
|
+
if (filter.body) {
|
|
1773
|
+
return false;
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
return true;
|
|
1777
|
+
}
|
|
1778
|
+
__name(requestFilterMatches, "requestFilterMatches");
|
|
1779
|
+
async function responseFilterMatches(response, filter) {
|
|
1780
|
+
if (filter.headers && !eventFilterMatches(response.headers, filter.headers)) {
|
|
1781
|
+
return {
|
|
1782
|
+
match: false
|
|
1783
|
+
};
|
|
1784
|
+
}
|
|
1785
|
+
try {
|
|
1786
|
+
const json = await response.json();
|
|
1787
|
+
if (filter.body && !eventFilterMatches(json, filter.body)) {
|
|
1788
|
+
return {
|
|
1789
|
+
match: false,
|
|
1790
|
+
body: json
|
|
1791
|
+
};
|
|
1792
|
+
} else {
|
|
1793
|
+
return {
|
|
1794
|
+
match: true,
|
|
1795
|
+
body: json
|
|
1796
|
+
};
|
|
1797
|
+
}
|
|
1798
|
+
} catch (e) {
|
|
1799
|
+
if (filter.body) {
|
|
1800
|
+
return {
|
|
1801
|
+
match: false,
|
|
1802
|
+
body: void 0
|
|
1803
|
+
};
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
return {
|
|
1807
|
+
match: true,
|
|
1808
|
+
body: void 0
|
|
1809
|
+
};
|
|
1810
|
+
}
|
|
1811
|
+
__name(responseFilterMatches, "responseFilterMatches");
|
|
1812
|
+
function requestMethodMatches(method, filter) {
|
|
1813
|
+
if (!filter) {
|
|
1814
|
+
return true;
|
|
1815
|
+
}
|
|
1816
|
+
return filter.includes(method);
|
|
1817
|
+
}
|
|
1818
|
+
__name(requestMethodMatches, "requestMethodMatches");
|
|
1819
|
+
|
|
1820
|
+
// src/index.ts
|
|
1821
|
+
var API_VERSIONS = {
|
|
1822
|
+
LAZY_LOADED_CACHED_TASKS: "2023-09-29",
|
|
1823
|
+
SERIALIZED_TASK_OUTPUT: "2023-11-01"
|
|
1824
|
+
};
|
|
1825
|
+
var PLATFORM_FEATURES = {
|
|
1826
|
+
yieldExecution: API_VERSIONS.LAZY_LOADED_CACHED_TASKS,
|
|
1827
|
+
lazyLoadedCachedTasks: API_VERSIONS.LAZY_LOADED_CACHED_TASKS
|
|
1828
|
+
};
|
|
1829
|
+
function supportsFeature(featureName, version) {
|
|
1830
|
+
if (version === "unversioned" || version === "unknown") {
|
|
1831
|
+
return false;
|
|
1832
|
+
}
|
|
1833
|
+
const supportedVersion = PLATFORM_FEATURES[featureName];
|
|
1834
|
+
if (!supportedVersion) {
|
|
1835
|
+
return false;
|
|
1836
|
+
}
|
|
1837
|
+
return version >= supportedVersion;
|
|
1838
|
+
}
|
|
1839
|
+
__name(supportsFeature, "supportsFeature");
|
|
1840
|
+
|
|
1841
|
+
exports.API_VERSIONS = API_VERSIONS;
|
|
1842
|
+
exports.ApiEventLogSchema = ApiEventLogSchema;
|
|
1843
|
+
exports.AutoYieldConfigSchema = AutoYieldConfigSchema;
|
|
1844
|
+
exports.AutoYieldMetadataSchema = AutoYieldMetadataSchema;
|
|
1845
|
+
exports.CachedTaskSchema = CachedTaskSchema;
|
|
1846
|
+
exports.CancelRunsForEventSchema = CancelRunsForEventSchema;
|
|
1847
|
+
exports.CommonMissingConnectionNotificationPayloadSchema = CommonMissingConnectionNotificationPayloadSchema;
|
|
1848
|
+
exports.CommonMissingConnectionNotificationResolvedPayloadSchema = CommonMissingConnectionNotificationResolvedPayloadSchema;
|
|
1849
|
+
exports.CompleteTaskBodyInputSchema = CompleteTaskBodyInputSchema;
|
|
1850
|
+
exports.CompleteTaskBodyV2InputSchema = CompleteTaskBodyV2InputSchema;
|
|
1851
|
+
exports.ConcurrencyLimitOptionsSchema = ConcurrencyLimitOptionsSchema;
|
|
1852
|
+
exports.ConnectionAuthSchema = ConnectionAuthSchema;
|
|
1853
|
+
exports.CreateExternalConnectionBodySchema = CreateExternalConnectionBodySchema;
|
|
1854
|
+
exports.CreateRunResponseBodySchema = CreateRunResponseBodySchema;
|
|
1855
|
+
exports.CronMetadataSchema = CronMetadataSchema;
|
|
1856
|
+
exports.CronOptionsSchema = CronOptionsSchema;
|
|
1857
|
+
exports.DELIVER_WEBHOOK_REQUEST = DELIVER_WEBHOOK_REQUEST;
|
|
1858
|
+
exports.DeliverEventResponseSchema = DeliverEventResponseSchema;
|
|
1859
|
+
exports.DeserializedJsonSchema = DeserializedJsonSchema;
|
|
1860
|
+
exports.DisplayPropertiesSchema = DisplayPropertiesSchema;
|
|
1861
|
+
exports.DisplayPropertySchema = DisplayPropertySchema;
|
|
1862
|
+
exports.DynamicTriggerEndpointMetadataSchema = DynamicTriggerEndpointMetadataSchema;
|
|
1863
|
+
exports.DynamicTriggerMetadataSchema = DynamicTriggerMetadataSchema;
|
|
1864
|
+
exports.EndpointHeadersSchema = EndpointHeadersSchema;
|
|
1865
|
+
exports.EndpointIndexErrorSchema = EndpointIndexErrorSchema;
|
|
1866
|
+
exports.EphemeralEventDispatcherRequestBodySchema = EphemeralEventDispatcherRequestBodySchema;
|
|
1867
|
+
exports.EphemeralEventDispatcherResponseBodySchema = EphemeralEventDispatcherResponseBodySchema;
|
|
1868
|
+
exports.ErrorWithStackSchema = ErrorWithStackSchema;
|
|
1869
|
+
exports.EventExampleSchema = EventExampleSchema;
|
|
1870
|
+
exports.EventFilterSchema = EventFilterSchema;
|
|
1871
|
+
exports.EventRuleSchema = EventRuleSchema;
|
|
1872
|
+
exports.EventSpecificationSchema = EventSpecificationSchema;
|
|
1873
|
+
exports.ExecuteJobHeadersSchema = ExecuteJobHeadersSchema;
|
|
1874
|
+
exports.ExecuteJobRunMetadataSchema = ExecuteJobRunMetadataSchema;
|
|
1875
|
+
exports.FailTaskBodyInputSchema = FailTaskBodyInputSchema;
|
|
1876
|
+
exports.FetchOperationSchema = FetchOperationSchema;
|
|
1877
|
+
exports.FetchPollOperationSchema = FetchPollOperationSchema;
|
|
1878
|
+
exports.FetchRequestInitSchema = FetchRequestInitSchema;
|
|
1879
|
+
exports.FetchRetryBackoffStrategySchema = FetchRetryBackoffStrategySchema;
|
|
1880
|
+
exports.FetchRetryHeadersStrategySchema = FetchRetryHeadersStrategySchema;
|
|
1881
|
+
exports.FetchRetryOptionsSchema = FetchRetryOptionsSchema;
|
|
1882
|
+
exports.FetchRetryStrategySchema = FetchRetryStrategySchema;
|
|
1883
|
+
exports.FetchTimeoutOptionsSchema = FetchTimeoutOptionsSchema;
|
|
1884
|
+
exports.GetEndpointIndexResponseSchema = GetEndpointIndexResponseSchema;
|
|
1885
|
+
exports.GetEventSchema = GetEventSchema;
|
|
1886
|
+
exports.GetRunSchema = GetRunSchema;
|
|
1887
|
+
exports.GetRunStatusesSchema = GetRunStatusesSchema;
|
|
1888
|
+
exports.GetRunsSchema = GetRunsSchema;
|
|
1889
|
+
exports.HTTPMethodUnionSchema = HTTPMethodUnionSchema;
|
|
1890
|
+
exports.HandleTriggerSourceSchema = HandleTriggerSourceSchema;
|
|
1891
|
+
exports.HttpEndpointRequestHeadersSchema = HttpEndpointRequestHeadersSchema;
|
|
1892
|
+
exports.HttpSourceRequestHeadersSchema = HttpSourceRequestHeadersSchema;
|
|
1893
|
+
exports.HttpSourceResponseSchema = HttpSourceResponseSchema;
|
|
1894
|
+
exports.IndexEndpointResponseSchema = IndexEndpointResponseSchema;
|
|
1895
|
+
exports.InitializeCronScheduleBodySchema = InitializeCronScheduleBodySchema;
|
|
1896
|
+
exports.InitializeTriggerBodySchema = InitializeTriggerBodySchema;
|
|
1897
|
+
exports.IntegrationConfigSchema = IntegrationConfigSchema;
|
|
1898
|
+
exports.IntegrationMetadataSchema = IntegrationMetadataSchema;
|
|
1899
|
+
exports.IntervalMetadataSchema = IntervalMetadataSchema;
|
|
1900
|
+
exports.IntervalOptionsSchema = IntervalOptionsSchema;
|
|
1901
|
+
exports.InvokeJobRequestBodySchema = InvokeJobRequestBodySchema;
|
|
1902
|
+
exports.InvokeJobResponseSchema = InvokeJobResponseSchema;
|
|
1903
|
+
exports.InvokeOptionsSchema = InvokeOptionsSchema;
|
|
1904
|
+
exports.InvokeTriggerMetadataSchema = InvokeTriggerMetadataSchema;
|
|
1905
|
+
exports.JobMetadataSchema = JobMetadataSchema;
|
|
1906
|
+
exports.JobRunStatusRecordSchema = JobRunStatusRecordSchema;
|
|
1907
|
+
exports.KeyValueStoreResponseBodySchema = KeyValueStoreResponseBodySchema;
|
|
1908
|
+
exports.LogMessageSchema = LogMessageSchema;
|
|
1909
|
+
exports.MISSING_CONNECTION_NOTIFICATION = MISSING_CONNECTION_NOTIFICATION;
|
|
1910
|
+
exports.MISSING_CONNECTION_RESOLVED_NOTIFICATION = MISSING_CONNECTION_RESOLVED_NOTIFICATION;
|
|
1911
|
+
exports.MissingConnectionNotificationPayloadSchema = MissingConnectionNotificationPayloadSchema;
|
|
1912
|
+
exports.MissingConnectionResolvedNotificationPayloadSchema = MissingConnectionResolvedNotificationPayloadSchema;
|
|
1913
|
+
exports.MissingDeveloperConnectionNotificationPayloadSchema = MissingDeveloperConnectionNotificationPayloadSchema;
|
|
1914
|
+
exports.MissingDeveloperConnectionResolvedNotificationPayloadSchema = MissingDeveloperConnectionResolvedNotificationPayloadSchema;
|
|
1915
|
+
exports.MissingExternalConnectionNotificationPayloadSchema = MissingExternalConnectionNotificationPayloadSchema;
|
|
1916
|
+
exports.MissingExternalConnectionResolvedNotificationPayloadSchema = MissingExternalConnectionResolvedNotificationPayloadSchema;
|
|
1917
|
+
exports.NormalizedRequestSchema = NormalizedRequestSchema;
|
|
1918
|
+
exports.NormalizedResponseSchema = NormalizedResponseSchema;
|
|
1919
|
+
exports.PLATFORM_FEATURES = PLATFORM_FEATURES;
|
|
1920
|
+
exports.PongErrorResponseSchema = PongErrorResponseSchema;
|
|
1921
|
+
exports.PongResponseSchema = PongResponseSchema;
|
|
1922
|
+
exports.PongSuccessResponseSchema = PongSuccessResponseSchema;
|
|
1923
|
+
exports.PreprocessRunBodySchema = PreprocessRunBodySchema;
|
|
1924
|
+
exports.PreprocessRunResponseSchema = PreprocessRunResponseSchema;
|
|
1925
|
+
exports.QueueOptionsSchema = QueueOptionsSchema;
|
|
1926
|
+
exports.REGISTER_SOURCE_EVENT_V1 = REGISTER_SOURCE_EVENT_V1;
|
|
1927
|
+
exports.REGISTER_SOURCE_EVENT_V2 = REGISTER_SOURCE_EVENT_V2;
|
|
1928
|
+
exports.REGISTER_WEBHOOK = REGISTER_WEBHOOK;
|
|
1929
|
+
exports.RawEventSchema = RawEventSchema;
|
|
1930
|
+
exports.RedactSchema = RedactSchema;
|
|
1931
|
+
exports.RedactStringSchema = RedactStringSchema;
|
|
1932
|
+
exports.RegisterDynamicSchedulePayloadSchema = RegisterDynamicSchedulePayloadSchema;
|
|
1933
|
+
exports.RegisterHTTPTriggerSourceBodySchema = RegisterHTTPTriggerSourceBodySchema;
|
|
1934
|
+
exports.RegisterIntervalScheduleBodySchema = RegisterIntervalScheduleBodySchema;
|
|
1935
|
+
exports.RegisterSMTPTriggerSourceBodySchema = RegisterSMTPTriggerSourceBodySchema;
|
|
1936
|
+
exports.RegisterSQSTriggerSourceBodySchema = RegisterSQSTriggerSourceBodySchema;
|
|
1937
|
+
exports.RegisterScheduleBodySchema = RegisterScheduleBodySchema;
|
|
1938
|
+
exports.RegisterScheduleResponseBodySchema = RegisterScheduleResponseBodySchema;
|
|
1939
|
+
exports.RegisterSourceChannelBodySchema = RegisterSourceChannelBodySchema;
|
|
1940
|
+
exports.RegisterSourceEventSchemaV1 = RegisterSourceEventSchemaV1;
|
|
1941
|
+
exports.RegisterSourceEventSchemaV2 = RegisterSourceEventSchemaV2;
|
|
1942
|
+
exports.RegisterTriggerBodySchemaV1 = RegisterTriggerBodySchemaV1;
|
|
1943
|
+
exports.RegisterTriggerBodySchemaV2 = RegisterTriggerBodySchemaV2;
|
|
1944
|
+
exports.RegisterTriggerSourceSchema = RegisterTriggerSourceSchema;
|
|
1945
|
+
exports.RegisterWebhookPayloadSchema = RegisterWebhookPayloadSchema;
|
|
1946
|
+
exports.RegisterWebhookSourceSchema = RegisterWebhookSourceSchema;
|
|
1947
|
+
exports.RequestFilterSchema = RequestFilterSchema;
|
|
1948
|
+
exports.RequestWithRawBodySchema = RequestWithRawBodySchema;
|
|
1949
|
+
exports.ResponseFilterSchema = ResponseFilterSchema;
|
|
1950
|
+
exports.RetryOptionsSchema = RetryOptionsSchema;
|
|
1951
|
+
exports.RunJobAutoYieldExecutionErrorSchema = RunJobAutoYieldExecutionErrorSchema;
|
|
1952
|
+
exports.RunJobAutoYieldWithCompletedTaskExecutionErrorSchema = RunJobAutoYieldWithCompletedTaskExecutionErrorSchema;
|
|
1953
|
+
exports.RunJobBodySchema = RunJobBodySchema;
|
|
1954
|
+
exports.RunJobCanceledWithTaskSchema = RunJobCanceledWithTaskSchema;
|
|
1955
|
+
exports.RunJobErrorResponseSchema = RunJobErrorResponseSchema;
|
|
1956
|
+
exports.RunJobErrorSchema = RunJobErrorSchema;
|
|
1957
|
+
exports.RunJobInvalidPayloadErrorSchema = RunJobInvalidPayloadErrorSchema;
|
|
1958
|
+
exports.RunJobResponseSchema = RunJobResponseSchema;
|
|
1959
|
+
exports.RunJobResumeWithParallelTaskSchema = RunJobResumeWithParallelTaskSchema;
|
|
1960
|
+
exports.RunJobResumeWithTaskSchema = RunJobResumeWithTaskSchema;
|
|
1961
|
+
exports.RunJobRetryWithTaskSchema = RunJobRetryWithTaskSchema;
|
|
1962
|
+
exports.RunJobSuccessSchema = RunJobSuccessSchema;
|
|
1963
|
+
exports.RunJobUnresolvedAuthErrorSchema = RunJobUnresolvedAuthErrorSchema;
|
|
1964
|
+
exports.RunJobYieldExecutionErrorSchema = RunJobYieldExecutionErrorSchema;
|
|
1965
|
+
exports.RunSourceContextSchema = RunSourceContextSchema;
|
|
1966
|
+
exports.RunStatusSchema = RunStatusSchema;
|
|
1967
|
+
exports.RunTaskBodyInputSchema = RunTaskBodyInputSchema;
|
|
1968
|
+
exports.RunTaskBodyOutputSchema = RunTaskBodyOutputSchema;
|
|
1969
|
+
exports.RunTaskOptionsSchema = RunTaskOptionsSchema;
|
|
1970
|
+
exports.RunTaskResponseWithCachedTasksBodySchema = RunTaskResponseWithCachedTasksBodySchema;
|
|
1971
|
+
exports.RunTaskSchema = RunTaskSchema;
|
|
1972
|
+
exports.RuntimeEnvironmentTypeSchema = RuntimeEnvironmentTypeSchema;
|
|
1973
|
+
exports.SCHEDULED_EVENT = SCHEDULED_EVENT;
|
|
1974
|
+
exports.ScheduleMetadataSchema = ScheduleMetadataSchema;
|
|
1975
|
+
exports.ScheduledPayloadSchema = ScheduledPayloadSchema;
|
|
1976
|
+
exports.ScheduledTriggerMetadataSchema = ScheduledTriggerMetadataSchema;
|
|
1977
|
+
exports.SchemaErrorSchema = SchemaErrorSchema;
|
|
1978
|
+
exports.SendBulkEventsBodySchema = SendBulkEventsBodySchema;
|
|
1979
|
+
exports.SendEventBodySchema = SendEventBodySchema;
|
|
1980
|
+
exports.SendEventOptionsSchema = SendEventOptionsSchema;
|
|
1981
|
+
exports.SerializableJsonSchema = SerializableJsonSchema;
|
|
1982
|
+
exports.ServerTaskSchema = ServerTaskSchema;
|
|
1983
|
+
exports.SourceMetadataV2Schema = SourceMetadataV2Schema;
|
|
1984
|
+
exports.StaticTriggerMetadataSchema = StaticTriggerMetadataSchema;
|
|
1985
|
+
exports.StatusHistorySchema = StatusHistorySchema;
|
|
1986
|
+
exports.StatusUpdateSchema = StatusUpdateSchema;
|
|
1987
|
+
exports.StatusUpdateStateSchema = StatusUpdateStateSchema;
|
|
1988
|
+
exports.StyleSchema = StyleSchema;
|
|
1989
|
+
exports.TaskSchema = TaskSchema;
|
|
1990
|
+
exports.TaskStatusSchema = TaskStatusSchema;
|
|
1991
|
+
exports.TriggerHelpSchema = TriggerHelpSchema;
|
|
1992
|
+
exports.TriggerMetadataSchema = TriggerMetadataSchema;
|
|
1993
|
+
exports.TriggerSourceSchema = TriggerSourceSchema;
|
|
1994
|
+
exports.UpdateTriggerSourceBodyV1Schema = UpdateTriggerSourceBodyV1Schema;
|
|
1995
|
+
exports.UpdateTriggerSourceBodyV2Schema = UpdateTriggerSourceBodyV2Schema;
|
|
1996
|
+
exports.UpdateWebhookBodySchema = UpdateWebhookBodySchema;
|
|
1997
|
+
exports.ValidateErrorResponseSchema = ValidateErrorResponseSchema;
|
|
1998
|
+
exports.ValidateResponseSchema = ValidateResponseSchema;
|
|
1999
|
+
exports.ValidateSuccessResponseSchema = ValidateSuccessResponseSchema;
|
|
2000
|
+
exports.WebhookContextMetadataSchema = WebhookContextMetadataSchema;
|
|
2001
|
+
exports.WebhookDeliveryResponseSchema = WebhookDeliveryResponseSchema;
|
|
2002
|
+
exports.WebhookMetadataSchema = WebhookMetadataSchema;
|
|
2003
|
+
exports.WebhookSourceRequestHeadersSchema = WebhookSourceRequestHeadersSchema;
|
|
2004
|
+
exports.addMissingVersionField = addMissingVersionField;
|
|
2005
|
+
exports.assertExhaustive = assertExhaustive;
|
|
2006
|
+
exports.calculateResetAt = calculateResetAt;
|
|
2007
|
+
exports.calculateRetryAt = calculateRetryAt;
|
|
2008
|
+
exports.currentDate = currentDate;
|
|
2009
|
+
exports.currentTimestampMilliseconds = currentTimestampMilliseconds;
|
|
2010
|
+
exports.currentTimestampSeconds = currentTimestampSeconds;
|
|
2011
|
+
exports.deepMergeFilters = deepMergeFilters;
|
|
2012
|
+
exports.eventFilterMatches = eventFilterMatches;
|
|
2013
|
+
exports.parseEndpointIndexStats = parseEndpointIndexStats;
|
|
2014
|
+
exports.replacements = replacements;
|
|
2015
|
+
exports.requestFilterMatches = requestFilterMatches;
|
|
2016
|
+
exports.responseFilterMatches = responseFilterMatches;
|
|
2017
|
+
exports.stringPatternMatchers = stringPatternMatchers;
|
|
2018
|
+
exports.supportsFeature = supportsFeature;
|
|
2019
|
+
exports.urlWithSearchParams = urlWithSearchParams;
|
|
2020
|
+
//# sourceMappingURL=out.js.map
|
|
1607
2021
|
//# sourceMappingURL=index.js.map
|