@trigger.dev/core 0.0.0-dev-20231004120419 → 0.0.0-invoke-trigger-20231103104037
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4903 -203
- package/dist/index.js +169 -76
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -3,7 +3,6 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
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
6
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
@@ -18,10 +17,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
17
|
return to;
|
|
19
18
|
};
|
|
20
19
|
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
20
|
var __accessCheck = (obj, member, msg) => {
|
|
26
21
|
if (!member.has(obj))
|
|
27
22
|
throw TypeError("Cannot " + msg);
|
|
@@ -50,11 +45,14 @@ var src_exports = {};
|
|
|
50
45
|
__export(src_exports, {
|
|
51
46
|
API_VERSIONS: () => API_VERSIONS,
|
|
52
47
|
ApiEventLogSchema: () => ApiEventLogSchema,
|
|
53
|
-
|
|
48
|
+
AutoYieldConfigSchema: () => AutoYieldConfigSchema,
|
|
49
|
+
AutoYieldMetadataSchema: () => AutoYieldMetadataSchema,
|
|
54
50
|
CachedTaskSchema: () => CachedTaskSchema,
|
|
51
|
+
CancelRunsForEventSchema: () => CancelRunsForEventSchema,
|
|
55
52
|
CommonMissingConnectionNotificationPayloadSchema: () => CommonMissingConnectionNotificationPayloadSchema,
|
|
56
53
|
CommonMissingConnectionNotificationResolvedPayloadSchema: () => CommonMissingConnectionNotificationResolvedPayloadSchema,
|
|
57
54
|
CompleteTaskBodyInputSchema: () => CompleteTaskBodyInputSchema,
|
|
55
|
+
CompleteTaskBodyV2InputSchema: () => CompleteTaskBodyV2InputSchema,
|
|
58
56
|
ConnectionAuthSchema: () => ConnectionAuthSchema,
|
|
59
57
|
CreateExternalConnectionBodySchema: () => CreateExternalConnectionBodySchema,
|
|
60
58
|
CreateRunResponseBodySchema: () => CreateRunResponseBodySchema,
|
|
@@ -67,6 +65,7 @@ __export(src_exports, {
|
|
|
67
65
|
DynamicTriggerEndpointMetadataSchema: () => DynamicTriggerEndpointMetadataSchema,
|
|
68
66
|
DynamicTriggerMetadataSchema: () => DynamicTriggerMetadataSchema,
|
|
69
67
|
EndpointHeadersSchema: () => EndpointHeadersSchema,
|
|
68
|
+
EndpointIndexErrorSchema: () => EndpointIndexErrorSchema,
|
|
70
69
|
ErrorWithStackSchema: () => ErrorWithStackSchema,
|
|
71
70
|
EventExampleSchema: () => EventExampleSchema,
|
|
72
71
|
EventFilterSchema: () => EventFilterSchema,
|
|
@@ -79,6 +78,8 @@ __export(src_exports, {
|
|
|
79
78
|
FetchRetryHeadersStrategySchema: () => FetchRetryHeadersStrategySchema,
|
|
80
79
|
FetchRetryOptionsSchema: () => FetchRetryOptionsSchema,
|
|
81
80
|
FetchRetryStrategySchema: () => FetchRetryStrategySchema,
|
|
81
|
+
FetchTimeoutOptionsSchema: () => FetchTimeoutOptionsSchema,
|
|
82
|
+
GetEndpointIndexResponseSchema: () => GetEndpointIndexResponseSchema,
|
|
82
83
|
GetEventSchema: () => GetEventSchema,
|
|
83
84
|
GetRunSchema: () => GetRunSchema,
|
|
84
85
|
GetRunStatusesSchema: () => GetRunStatusesSchema,
|
|
@@ -94,6 +95,10 @@ __export(src_exports, {
|
|
|
94
95
|
IntegrationMetadataSchema: () => IntegrationMetadataSchema,
|
|
95
96
|
IntervalMetadataSchema: () => IntervalMetadataSchema,
|
|
96
97
|
IntervalOptionsSchema: () => IntervalOptionsSchema,
|
|
98
|
+
InvokeJobRequestBodySchema: () => InvokeJobRequestBodySchema,
|
|
99
|
+
InvokeJobResponseSchema: () => InvokeJobResponseSchema,
|
|
100
|
+
InvokeOptionsSchema: () => InvokeOptionsSchema,
|
|
101
|
+
InvokeTriggerMetadataSchema: () => InvokeTriggerMetadataSchema,
|
|
97
102
|
JobMetadataSchema: () => JobMetadataSchema,
|
|
98
103
|
JobRunStatusRecordSchema: () => JobRunStatusRecordSchema,
|
|
99
104
|
LogMessageSchema: () => LogMessageSchema,
|
|
@@ -134,11 +139,15 @@ __export(src_exports, {
|
|
|
134
139
|
RegisterTriggerBodySchemaV2: () => RegisterTriggerBodySchemaV2,
|
|
135
140
|
RegisterTriggerSourceSchema: () => RegisterTriggerSourceSchema,
|
|
136
141
|
RetryOptionsSchema: () => RetryOptionsSchema,
|
|
142
|
+
RunJobAutoYieldExecutionErrorSchema: () => RunJobAutoYieldExecutionErrorSchema,
|
|
143
|
+
RunJobAutoYieldWithCompletedTaskExecutionErrorSchema: () => RunJobAutoYieldWithCompletedTaskExecutionErrorSchema,
|
|
137
144
|
RunJobBodySchema: () => RunJobBodySchema,
|
|
138
145
|
RunJobCanceledWithTaskSchema: () => RunJobCanceledWithTaskSchema,
|
|
146
|
+
RunJobErrorResponseSchema: () => RunJobErrorResponseSchema,
|
|
139
147
|
RunJobErrorSchema: () => RunJobErrorSchema,
|
|
140
148
|
RunJobInvalidPayloadErrorSchema: () => RunJobInvalidPayloadErrorSchema,
|
|
141
149
|
RunJobResponseSchema: () => RunJobResponseSchema,
|
|
150
|
+
RunJobResumeWithParallelTaskSchema: () => RunJobResumeWithParallelTaskSchema,
|
|
142
151
|
RunJobResumeWithTaskSchema: () => RunJobResumeWithTaskSchema,
|
|
143
152
|
RunJobRetryWithTaskSchema: () => RunJobRetryWithTaskSchema,
|
|
144
153
|
RunJobSuccessSchema: () => RunJobSuccessSchema,
|
|
@@ -183,6 +192,7 @@ __export(src_exports, {
|
|
|
183
192
|
currentTimestampSeconds: () => currentTimestampSeconds,
|
|
184
193
|
deepMergeFilters: () => deepMergeFilters,
|
|
185
194
|
eventFilterMatches: () => eventFilterMatches,
|
|
195
|
+
parseEndpointIndexStats: () => parseEndpointIndexStats,
|
|
186
196
|
replacements: () => replacements,
|
|
187
197
|
supportsFeature: () => supportsFeature,
|
|
188
198
|
urlWithSearchParams: () => urlWithSearchParams
|
|
@@ -221,27 +231,27 @@ var _Logger = class _Logger {
|
|
|
221
231
|
log(message, ...args) {
|
|
222
232
|
if (__privateGet(this, _level) < 0)
|
|
223
233
|
return;
|
|
224
|
-
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.log, message, ...args);
|
|
234
|
+
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.log, message, "log", ...args);
|
|
225
235
|
}
|
|
226
236
|
error(message, ...args) {
|
|
227
237
|
if (__privateGet(this, _level) < 1)
|
|
228
238
|
return;
|
|
229
|
-
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.error, message, ...args);
|
|
239
|
+
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.error, message, "error", ...args);
|
|
230
240
|
}
|
|
231
241
|
warn(message, ...args) {
|
|
232
242
|
if (__privateGet(this, _level) < 2)
|
|
233
243
|
return;
|
|
234
|
-
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.warn, message, ...args);
|
|
244
|
+
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.warn, message, "warn", ...args);
|
|
235
245
|
}
|
|
236
246
|
info(message, ...args) {
|
|
237
247
|
if (__privateGet(this, _level) < 3)
|
|
238
248
|
return;
|
|
239
|
-
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.info, message, ...args);
|
|
249
|
+
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.info, message, "info", ...args);
|
|
240
250
|
}
|
|
241
251
|
debug(message, ...args) {
|
|
242
252
|
if (__privateGet(this, _level) < 4)
|
|
243
253
|
return;
|
|
244
|
-
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.debug, message, ...args);
|
|
254
|
+
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.debug, message, "debug", ...args);
|
|
245
255
|
}
|
|
246
256
|
};
|
|
247
257
|
_name = new WeakMap();
|
|
@@ -249,12 +259,13 @@ _level = new WeakMap();
|
|
|
249
259
|
_filteredKeys = new WeakMap();
|
|
250
260
|
_jsonReplacer = new WeakMap();
|
|
251
261
|
_structuredLog = new WeakSet();
|
|
252
|
-
structuredLog_fn = /* @__PURE__ */ __name(function(loggerFunction, message, ...args) {
|
|
262
|
+
structuredLog_fn = /* @__PURE__ */ __name(function(loggerFunction, message, level, ...args) {
|
|
253
263
|
const structuredLog = {
|
|
254
264
|
...structureArgs(safeJsonClone(args), __privateGet(this, _filteredKeys)),
|
|
255
265
|
timestamp: /* @__PURE__ */ new Date(),
|
|
256
266
|
name: __privateGet(this, _name),
|
|
257
|
-
message
|
|
267
|
+
message,
|
|
268
|
+
level
|
|
258
269
|
};
|
|
259
270
|
loggerFunction(JSON.stringify(structuredLog, createReplacer(__privateGet(this, _jsonReplacer))));
|
|
260
271
|
}, "#structuredLog");
|
|
@@ -591,11 +602,16 @@ var TaskSchema = import_zod7.z.object({
|
|
|
591
602
|
parentId: import_zod7.z.string().optional().nullable(),
|
|
592
603
|
style: StyleSchema.optional().nullable(),
|
|
593
604
|
operation: import_zod7.z.string().optional().nullable(),
|
|
594
|
-
callbackUrl: import_zod7.z.string().optional().nullable()
|
|
605
|
+
callbackUrl: import_zod7.z.string().optional().nullable(),
|
|
606
|
+
childExecutionMode: import_zod7.z.enum([
|
|
607
|
+
"SEQUENTIAL",
|
|
608
|
+
"PARALLEL"
|
|
609
|
+
]).optional().nullable()
|
|
595
610
|
});
|
|
596
611
|
var ServerTaskSchema = TaskSchema.extend({
|
|
597
612
|
idempotencyKey: import_zod7.z.string(),
|
|
598
|
-
attempts: import_zod7.z.number()
|
|
613
|
+
attempts: import_zod7.z.number(),
|
|
614
|
+
forceYield: import_zod7.z.boolean().optional().nullable()
|
|
599
615
|
});
|
|
600
616
|
var CachedTaskSchema = import_zod7.z.object({
|
|
601
617
|
id: import_zod7.z.string(),
|
|
@@ -637,6 +653,9 @@ var StaticTriggerMetadataSchema = import_zod8.z.object({
|
|
|
637
653
|
properties: import_zod8.z.array(DisplayPropertySchema).optional(),
|
|
638
654
|
rule: EventRuleSchema
|
|
639
655
|
});
|
|
656
|
+
var InvokeTriggerMetadataSchema = import_zod8.z.object({
|
|
657
|
+
type: import_zod8.z.literal("invoke")
|
|
658
|
+
});
|
|
640
659
|
var ScheduledTriggerMetadataSchema = import_zod8.z.object({
|
|
641
660
|
type: import_zod8.z.literal("scheduled"),
|
|
642
661
|
schedule: ScheduleMetadataSchema
|
|
@@ -644,7 +663,8 @@ var ScheduledTriggerMetadataSchema = import_zod8.z.object({
|
|
|
644
663
|
var TriggerMetadataSchema = import_zod8.z.discriminatedUnion("type", [
|
|
645
664
|
DynamicTriggerMetadataSchema,
|
|
646
665
|
StaticTriggerMetadataSchema,
|
|
647
|
-
ScheduledTriggerMetadataSchema
|
|
666
|
+
ScheduledTriggerMetadataSchema,
|
|
667
|
+
InvokeTriggerMetadataSchema
|
|
648
668
|
]);
|
|
649
669
|
|
|
650
670
|
// src/schemas/runs.ts
|
|
@@ -865,12 +885,14 @@ var HttpSourceRequestHeadersSchema = import_zod11.z.object({
|
|
|
865
885
|
});
|
|
866
886
|
var PongSuccessResponseSchema = import_zod11.z.object({
|
|
867
887
|
ok: import_zod11.z.literal(true),
|
|
868
|
-
triggerVersion: import_zod11.z.string().optional()
|
|
888
|
+
triggerVersion: import_zod11.z.string().optional(),
|
|
889
|
+
triggerSdkVersion: import_zod11.z.string().optional()
|
|
869
890
|
});
|
|
870
891
|
var PongErrorResponseSchema = import_zod11.z.object({
|
|
871
892
|
ok: import_zod11.z.literal(false),
|
|
872
893
|
error: import_zod11.z.string(),
|
|
873
|
-
triggerVersion: import_zod11.z.string().optional()
|
|
894
|
+
triggerVersion: import_zod11.z.string().optional(),
|
|
895
|
+
triggerSdkVersion: import_zod11.z.string().optional()
|
|
874
896
|
});
|
|
875
897
|
var PongResponseSchema = import_zod11.z.discriminatedUnion("ok", [
|
|
876
898
|
PongSuccessResponseSchema,
|
|
@@ -962,8 +984,47 @@ var IndexEndpointResponseSchema = import_zod11.z.object({
|
|
|
962
984
|
dynamicTriggers: import_zod11.z.array(DynamicTriggerEndpointMetadataSchema),
|
|
963
985
|
dynamicSchedules: import_zod11.z.array(RegisterDynamicSchedulePayloadSchema)
|
|
964
986
|
});
|
|
987
|
+
var EndpointIndexErrorSchema = import_zod11.z.object({
|
|
988
|
+
message: import_zod11.z.string(),
|
|
989
|
+
raw: import_zod11.z.any().optional()
|
|
990
|
+
});
|
|
991
|
+
var IndexEndpointStatsSchema = import_zod11.z.object({
|
|
992
|
+
jobs: import_zod11.z.number(),
|
|
993
|
+
sources: import_zod11.z.number(),
|
|
994
|
+
dynamicTriggers: import_zod11.z.number(),
|
|
995
|
+
dynamicSchedules: import_zod11.z.number(),
|
|
996
|
+
disabledJobs: import_zod11.z.number().default(0)
|
|
997
|
+
});
|
|
998
|
+
function parseEndpointIndexStats(stats) {
|
|
999
|
+
if (stats === null || stats === void 0) {
|
|
1000
|
+
return;
|
|
1001
|
+
}
|
|
1002
|
+
return IndexEndpointStatsSchema.parse(stats);
|
|
1003
|
+
}
|
|
1004
|
+
__name(parseEndpointIndexStats, "parseEndpointIndexStats");
|
|
1005
|
+
var GetEndpointIndexResponseSchema = import_zod11.z.discriminatedUnion("status", [
|
|
1006
|
+
import_zod11.z.object({
|
|
1007
|
+
status: import_zod11.z.literal("PENDING"),
|
|
1008
|
+
updatedAt: import_zod11.z.coerce.date()
|
|
1009
|
+
}),
|
|
1010
|
+
import_zod11.z.object({
|
|
1011
|
+
status: import_zod11.z.literal("STARTED"),
|
|
1012
|
+
updatedAt: import_zod11.z.coerce.date()
|
|
1013
|
+
}),
|
|
1014
|
+
import_zod11.z.object({
|
|
1015
|
+
status: import_zod11.z.literal("SUCCESS"),
|
|
1016
|
+
stats: IndexEndpointStatsSchema,
|
|
1017
|
+
updatedAt: import_zod11.z.coerce.date()
|
|
1018
|
+
}),
|
|
1019
|
+
import_zod11.z.object({
|
|
1020
|
+
status: import_zod11.z.literal("FAILURE"),
|
|
1021
|
+
error: EndpointIndexErrorSchema,
|
|
1022
|
+
updatedAt: import_zod11.z.coerce.date()
|
|
1023
|
+
})
|
|
1024
|
+
]);
|
|
965
1025
|
var EndpointHeadersSchema = import_zod11.z.object({
|
|
966
|
-
"trigger-version": import_zod11.z.string().optional()
|
|
1026
|
+
"trigger-version": import_zod11.z.string().optional(),
|
|
1027
|
+
"trigger-sdk-version": import_zod11.z.string().optional()
|
|
967
1028
|
});
|
|
968
1029
|
var RawEventSchema = import_zod11.z.object({
|
|
969
1030
|
/** The `name` property must exactly match any subscriptions you want to
|
|
@@ -1044,6 +1105,12 @@ var RunSourceContextSchema = import_zod11.z.object({
|
|
|
1044
1105
|
id: import_zod11.z.string(),
|
|
1045
1106
|
metadata: import_zod11.z.any()
|
|
1046
1107
|
});
|
|
1108
|
+
var AutoYieldConfigSchema = import_zod11.z.object({
|
|
1109
|
+
startTaskThreshold: import_zod11.z.number(),
|
|
1110
|
+
beforeExecuteTaskThreshold: import_zod11.z.number(),
|
|
1111
|
+
beforeCompleteTaskThreshold: import_zod11.z.number(),
|
|
1112
|
+
afterCompleteTaskThreshold: import_zod11.z.number()
|
|
1113
|
+
});
|
|
1047
1114
|
var RunJobBodySchema = import_zod11.z.object({
|
|
1048
1115
|
event: ApiEventLogSchema,
|
|
1049
1116
|
job: import_zod11.z.object({
|
|
@@ -1066,6 +1133,11 @@ var RunJobBodySchema = import_zod11.z.object({
|
|
|
1066
1133
|
title: import_zod11.z.string(),
|
|
1067
1134
|
slug: import_zod11.z.string()
|
|
1068
1135
|
}),
|
|
1136
|
+
project: import_zod11.z.object({
|
|
1137
|
+
id: import_zod11.z.string(),
|
|
1138
|
+
name: import_zod11.z.string(),
|
|
1139
|
+
slug: import_zod11.z.string()
|
|
1140
|
+
}).optional(),
|
|
1069
1141
|
account: import_zod11.z.object({
|
|
1070
1142
|
id: import_zod11.z.string(),
|
|
1071
1143
|
metadata: import_zod11.z.any()
|
|
@@ -1075,7 +1147,9 @@ var RunJobBodySchema = import_zod11.z.object({
|
|
|
1075
1147
|
cachedTaskCursor: import_zod11.z.string().optional(),
|
|
1076
1148
|
noopTasksSet: import_zod11.z.string().optional(),
|
|
1077
1149
|
connections: import_zod11.z.record(ConnectionAuthSchema).optional(),
|
|
1078
|
-
yieldedExecutions: import_zod11.z.string().array().optional()
|
|
1150
|
+
yieldedExecutions: import_zod11.z.string().array().optional(),
|
|
1151
|
+
runChunkExecutionLimit: import_zod11.z.number().optional(),
|
|
1152
|
+
autoYieldConfig: AutoYieldConfigSchema.optional()
|
|
1079
1153
|
});
|
|
1080
1154
|
var RunJobErrorSchema = import_zod11.z.object({
|
|
1081
1155
|
status: import_zod11.z.literal("ERROR"),
|
|
@@ -1086,6 +1160,22 @@ var RunJobYieldExecutionErrorSchema = import_zod11.z.object({
|
|
|
1086
1160
|
status: import_zod11.z.literal("YIELD_EXECUTION"),
|
|
1087
1161
|
key: import_zod11.z.string()
|
|
1088
1162
|
});
|
|
1163
|
+
var AutoYieldMetadataSchema = import_zod11.z.object({
|
|
1164
|
+
location: import_zod11.z.string(),
|
|
1165
|
+
timeRemaining: import_zod11.z.number(),
|
|
1166
|
+
timeElapsed: import_zod11.z.number(),
|
|
1167
|
+
limit: import_zod11.z.number().optional()
|
|
1168
|
+
});
|
|
1169
|
+
var RunJobAutoYieldExecutionErrorSchema = AutoYieldMetadataSchema.extend({
|
|
1170
|
+
status: import_zod11.z.literal("AUTO_YIELD_EXECUTION")
|
|
1171
|
+
});
|
|
1172
|
+
var RunJobAutoYieldWithCompletedTaskExecutionErrorSchema = import_zod11.z.object({
|
|
1173
|
+
status: import_zod11.z.literal("AUTO_YIELD_EXECUTION_WITH_COMPLETED_TASK"),
|
|
1174
|
+
id: import_zod11.z.string(),
|
|
1175
|
+
properties: import_zod11.z.array(DisplayPropertySchema).optional(),
|
|
1176
|
+
output: import_zod11.z.string().optional(),
|
|
1177
|
+
data: AutoYieldMetadataSchema
|
|
1178
|
+
});
|
|
1089
1179
|
var RunJobInvalidPayloadErrorSchema = import_zod11.z.object({
|
|
1090
1180
|
status: import_zod11.z.literal("INVALID_PAYLOAD"),
|
|
1091
1181
|
errors: import_zod11.z.array(SchemaErrorSchema)
|
|
@@ -1115,12 +1205,31 @@ var RunJobSuccessSchema = import_zod11.z.object({
|
|
|
1115
1205
|
status: import_zod11.z.literal("SUCCESS"),
|
|
1116
1206
|
output: DeserializedJsonSchema.optional()
|
|
1117
1207
|
});
|
|
1208
|
+
var RunJobErrorResponseSchema = import_zod11.z.union([
|
|
1209
|
+
RunJobAutoYieldExecutionErrorSchema,
|
|
1210
|
+
RunJobAutoYieldWithCompletedTaskExecutionErrorSchema,
|
|
1211
|
+
RunJobYieldExecutionErrorSchema,
|
|
1212
|
+
RunJobErrorSchema,
|
|
1213
|
+
RunJobUnresolvedAuthErrorSchema,
|
|
1214
|
+
RunJobInvalidPayloadErrorSchema,
|
|
1215
|
+
RunJobResumeWithTaskSchema,
|
|
1216
|
+
RunJobRetryWithTaskSchema,
|
|
1217
|
+
RunJobCanceledWithTaskSchema
|
|
1218
|
+
]);
|
|
1219
|
+
var RunJobResumeWithParallelTaskSchema = import_zod11.z.object({
|
|
1220
|
+
status: import_zod11.z.literal("RESUME_WITH_PARALLEL_TASK"),
|
|
1221
|
+
task: TaskSchema,
|
|
1222
|
+
childErrors: import_zod11.z.array(RunJobErrorResponseSchema)
|
|
1223
|
+
});
|
|
1118
1224
|
var RunJobResponseSchema = import_zod11.z.discriminatedUnion("status", [
|
|
1225
|
+
RunJobAutoYieldExecutionErrorSchema,
|
|
1226
|
+
RunJobAutoYieldWithCompletedTaskExecutionErrorSchema,
|
|
1119
1227
|
RunJobYieldExecutionErrorSchema,
|
|
1120
1228
|
RunJobErrorSchema,
|
|
1121
1229
|
RunJobUnresolvedAuthErrorSchema,
|
|
1122
1230
|
RunJobInvalidPayloadErrorSchema,
|
|
1123
1231
|
RunJobResumeWithTaskSchema,
|
|
1232
|
+
RunJobResumeWithParallelTaskSchema,
|
|
1124
1233
|
RunJobRetryWithTaskSchema,
|
|
1125
1234
|
RunJobCanceledWithTaskSchema,
|
|
1126
1235
|
RunJobSuccessSchema
|
|
@@ -1207,7 +1316,7 @@ var RunTaskOptionsSchema = import_zod11.z.object({
|
|
|
1207
1316
|
retry: RetryOptionsSchema.optional(),
|
|
1208
1317
|
/** The icon for the Task, it will appear in the logs.
|
|
1209
1318
|
* You can use the name of a company in lowercase, e.g. "github".
|
|
1210
|
-
* Or any icon name that [
|
|
1319
|
+
* Or any icon name that [Tabler Icons](https://tabler-icons.io/) supports. */
|
|
1211
1320
|
icon: import_zod11.z.string().optional(),
|
|
1212
1321
|
/** The key for the Task that you want to appear in the logs */
|
|
1213
1322
|
displayKey: import_zod11.z.string().optional(),
|
|
@@ -1235,13 +1344,15 @@ var RunTaskOptionsSchema = import_zod11.z.object({
|
|
|
1235
1344
|
/** 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
1345
|
noop: import_zod11.z.boolean().default(false),
|
|
1237
1346
|
redact: RedactSchema.optional(),
|
|
1238
|
-
trigger: TriggerMetadataSchema.optional()
|
|
1347
|
+
trigger: TriggerMetadataSchema.optional(),
|
|
1348
|
+
parallel: import_zod11.z.boolean().optional()
|
|
1239
1349
|
});
|
|
1240
1350
|
var RunTaskBodyInputSchema = RunTaskOptionsSchema.extend({
|
|
1241
1351
|
idempotencyKey: import_zod11.z.string(),
|
|
1242
1352
|
parentId: import_zod11.z.string().optional()
|
|
1243
1353
|
});
|
|
1244
1354
|
var RunTaskBodyOutputSchema = RunTaskBodyInputSchema.extend({
|
|
1355
|
+
properties: import_zod11.z.array(DisplayPropertySchema.partial()).optional(),
|
|
1245
1356
|
params: DeserializedJsonSchema.optional().nullable(),
|
|
1246
1357
|
callback: import_zod11.z.object({
|
|
1247
1358
|
enabled: import_zod11.z.boolean(),
|
|
@@ -1262,6 +1373,13 @@ var CompleteTaskBodyInputSchema = RunTaskBodyInputSchema.pick({
|
|
|
1262
1373
|
}).extend({
|
|
1263
1374
|
output: SerializableJsonSchema.optional().transform((v) => v ? DeserializedJsonSchema.parse(JSON.parse(JSON.stringify(v))) : {})
|
|
1264
1375
|
});
|
|
1376
|
+
var CompleteTaskBodyV2InputSchema = RunTaskBodyInputSchema.pick({
|
|
1377
|
+
properties: true,
|
|
1378
|
+
description: true,
|
|
1379
|
+
params: true
|
|
1380
|
+
}).extend({
|
|
1381
|
+
output: import_zod11.z.string().optional()
|
|
1382
|
+
});
|
|
1265
1383
|
var FailTaskBodyInputSchema = import_zod11.z.object({
|
|
1266
1384
|
error: ErrorWithStackSchema
|
|
1267
1385
|
});
|
|
@@ -1333,6 +1451,23 @@ var GetRunStatusesSchema = import_zod11.z.object({
|
|
|
1333
1451
|
}),
|
|
1334
1452
|
statuses: import_zod11.z.array(JobRunStatusRecordSchema)
|
|
1335
1453
|
});
|
|
1454
|
+
var InvokeJobResponseSchema = import_zod11.z.object({
|
|
1455
|
+
id: import_zod11.z.string()
|
|
1456
|
+
});
|
|
1457
|
+
var InvokeJobRequestBodySchema = import_zod11.z.object({
|
|
1458
|
+
payload: import_zod11.z.any(),
|
|
1459
|
+
context: import_zod11.z.any().optional(),
|
|
1460
|
+
options: import_zod11.z.object({
|
|
1461
|
+
accountId: import_zod11.z.string().optional(),
|
|
1462
|
+
callbackUrl: import_zod11.z.string().optional()
|
|
1463
|
+
}).optional()
|
|
1464
|
+
});
|
|
1465
|
+
var InvokeOptionsSchema = import_zod11.z.object({
|
|
1466
|
+
accountId: import_zod11.z.string().optional(),
|
|
1467
|
+
idempotencyKey: import_zod11.z.string().optional(),
|
|
1468
|
+
context: import_zod11.z.any().optional(),
|
|
1469
|
+
callbackUrl: import_zod11.z.string().optional()
|
|
1470
|
+
});
|
|
1336
1471
|
|
|
1337
1472
|
// src/schemas/notifications.ts
|
|
1338
1473
|
var import_zod12 = require("zod");
|
|
@@ -1426,10 +1561,15 @@ var FetchRequestInitSchema = import_zod13.z.object({
|
|
|
1426
1561
|
]).optional()
|
|
1427
1562
|
});
|
|
1428
1563
|
var FetchRetryOptionsSchema = import_zod13.z.record(FetchRetryStrategySchema);
|
|
1564
|
+
var FetchTimeoutOptionsSchema = import_zod13.z.object({
|
|
1565
|
+
durationInMs: import_zod13.z.number(),
|
|
1566
|
+
retry: RetryOptionsSchema.optional()
|
|
1567
|
+
});
|
|
1429
1568
|
var FetchOperationSchema = import_zod13.z.object({
|
|
1430
1569
|
url: import_zod13.z.string(),
|
|
1431
1570
|
requestInit: FetchRequestInitSchema.optional(),
|
|
1432
|
-
retry: import_zod13.z.record(FetchRetryStrategySchema).optional()
|
|
1571
|
+
retry: import_zod13.z.record(FetchRetryStrategySchema).optional(),
|
|
1572
|
+
timeout: FetchTimeoutOptionsSchema.optional()
|
|
1433
1573
|
});
|
|
1434
1574
|
|
|
1435
1575
|
// src/schemas/events.ts
|
|
@@ -1455,6 +1595,10 @@ var GetEventSchema = import_zod14.z.object({
|
|
|
1455
1595
|
completedAt: import_zod14.z.coerce.date().optional().nullable()
|
|
1456
1596
|
}))
|
|
1457
1597
|
});
|
|
1598
|
+
var CancelRunsForEventSchema = import_zod14.z.object({
|
|
1599
|
+
cancelledRunIds: import_zod14.z.array(import_zod14.z.string()),
|
|
1600
|
+
failedToCancelRunIds: import_zod14.z.array(import_zod14.z.string())
|
|
1601
|
+
});
|
|
1458
1602
|
|
|
1459
1603
|
// src/utils.ts
|
|
1460
1604
|
function deepMergeFilters(...filters) {
|
|
@@ -1680,61 +1824,10 @@ function contentFilterMatches(actualValue, contentFilter) {
|
|
|
1680
1824
|
}
|
|
1681
1825
|
__name(contentFilterMatches, "contentFilterMatches");
|
|
1682
1826
|
|
|
1683
|
-
// src/bloom.ts
|
|
1684
|
-
var import_node_buffer = require("buffer");
|
|
1685
|
-
var _BloomFilter = class _BloomFilter {
|
|
1686
|
-
constructor(size) {
|
|
1687
|
-
this.size = size;
|
|
1688
|
-
this.bitArray = new Uint8Array(Math.ceil(size / 8));
|
|
1689
|
-
}
|
|
1690
|
-
add(item) {
|
|
1691
|
-
const index = murmurHash3(item) % this.size;
|
|
1692
|
-
this.bitArray[Math.floor(index / 8)] |= 1 << index % 8;
|
|
1693
|
-
}
|
|
1694
|
-
test(item) {
|
|
1695
|
-
const index = murmurHash3(item) % this.size;
|
|
1696
|
-
return (this.bitArray[Math.floor(index / 8)] & 1 << index % 8) !== 0;
|
|
1697
|
-
}
|
|
1698
|
-
// Serialize to a Base64 string
|
|
1699
|
-
serialize() {
|
|
1700
|
-
return import_node_buffer.Buffer.from(this.bitArray).toString("base64");
|
|
1701
|
-
}
|
|
1702
|
-
// Deserialize from a Base64 string
|
|
1703
|
-
static deserialize(str, size) {
|
|
1704
|
-
const filter = new _BloomFilter(size);
|
|
1705
|
-
filter.bitArray = Uint8Array.from(import_node_buffer.Buffer.from(str, "base64"));
|
|
1706
|
-
return filter;
|
|
1707
|
-
}
|
|
1708
|
-
};
|
|
1709
|
-
__name(_BloomFilter, "BloomFilter");
|
|
1710
|
-
__publicField(_BloomFilter, "NOOP_TASK_SET_SIZE", 32768);
|
|
1711
|
-
var BloomFilter = _BloomFilter;
|
|
1712
|
-
function murmurHash3(str, seed = 0) {
|
|
1713
|
-
let h1 = 3735928559 ^ seed, h2 = 1103547991 ^ seed;
|
|
1714
|
-
for (let i = 0, ch; i < str.length; i++) {
|
|
1715
|
-
ch = str.charCodeAt(i);
|
|
1716
|
-
h1 = Math.imul(h1 ^ ch, 3432918353);
|
|
1717
|
-
h1 = h1 << 15 | h1 >>> 17;
|
|
1718
|
-
h1 = Math.imul(h1, 461845907);
|
|
1719
|
-
h2 = Math.imul(h2 ^ ch, 2246822507);
|
|
1720
|
-
h2 = h2 << 13 | h2 >>> 19;
|
|
1721
|
-
h2 = Math.imul(h2, 3266489909);
|
|
1722
|
-
}
|
|
1723
|
-
h1 ^= str.length;
|
|
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);
|
|
1732
|
-
}
|
|
1733
|
-
__name(murmurHash3, "murmurHash3");
|
|
1734
|
-
|
|
1735
1827
|
// src/index.ts
|
|
1736
1828
|
var API_VERSIONS = {
|
|
1737
|
-
LAZY_LOADED_CACHED_TASKS: "2023-09-29"
|
|
1829
|
+
LAZY_LOADED_CACHED_TASKS: "2023-09-29",
|
|
1830
|
+
SERIALIZED_TASK_OUTPUT: "2023-11-01"
|
|
1738
1831
|
};
|
|
1739
1832
|
var PLATFORM_FEATURES = {
|
|
1740
1833
|
yieldExecution: API_VERSIONS.LAZY_LOADED_CACHED_TASKS,
|