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