inngest 1.9.6 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/components/InngestStepTools.d.ts +7 -7
- package/components/InngestStepTools.d.ts.map +1 -1
- package/components/InngestStepTools.js +36 -15
- package/components/InngestStepTools.js.map +1 -1
- package/helpers/errors.d.ts +8 -9
- package/helpers/errors.d.ts.map +1 -1
- package/helpers/errors.js +90 -12
- package/helpers/errors.js.map +1 -1
- package/landing.d.ts +1 -1
- package/landing.d.ts.map +1 -1
- package/landing.js +1 -1
- package/landing.js.map +1 -1
- package/package.json +1 -1
- package/types.d.ts +15 -0
- package/types.d.ts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# inngest
|
|
2
2
|
|
|
3
|
+
## 1.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 64fc745: Add optional `id` property to all step tooling, allowing users to override state recovery
|
|
8
|
+
|
|
9
|
+
## 1.9.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- cec3265: Harden error serialization to ensure uncaught exceptions don't slip through during function runs
|
|
14
|
+
|
|
3
15
|
## 1.9.6
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Jsonify } from "type-fest";
|
|
2
2
|
import { type ObjectPaths, type PartialK, type SendEventPayload, type SingleOrArray } from "../helpers/types";
|
|
3
|
-
import { StepOpCode, type EventPayload, type HashedOp } from "../types";
|
|
3
|
+
import { StepOpCode, type EventPayload, type HashedOp, type StepOpts } from "../types";
|
|
4
4
|
import { type Inngest } from "./Inngest";
|
|
5
5
|
export interface TickOp extends HashedOp {
|
|
6
6
|
fn?: (...args: unknown[]) => unknown;
|
|
@@ -43,8 +43,8 @@ export declare const createStepTools: <Events extends Record<string, EventPayloa
|
|
|
43
43
|
* Returns a promise that will resolve once the event has been sent.
|
|
44
44
|
*/
|
|
45
45
|
sendEvent: {
|
|
46
|
-
<Payload extends SendEventPayload<Events>>(payload: Payload): Promise<void>;
|
|
47
|
-
<Event_1 extends keyof Events & string>(name: Event_1, payload: SingleOrArray<PartialK<Omit<Events[Event_1], "name" | "v">, "ts"
|
|
46
|
+
<Payload extends SendEventPayload<Events>>(payload: Payload, opts?: StepOpts): Promise<void>;
|
|
47
|
+
<Event_1 extends keyof Events & string>(name: Event_1, payload: SingleOrArray<PartialK<Omit<Events[Event_1], "name" | "v">, "ts">>, opts?: StepOpts): Promise<void>;
|
|
48
48
|
};
|
|
49
49
|
/**
|
|
50
50
|
* Wait for a particular event to be received before continuing. When the
|
|
@@ -72,7 +72,7 @@ export declare const createStepTools: <Events extends Record<string, EventPayloa
|
|
|
72
72
|
* of the `run` tool, meaning you can return and reason about return data
|
|
73
73
|
* for next steps.
|
|
74
74
|
*/
|
|
75
|
-
run: <T extends () => unknown>(name: string, fn: T) => Promise<Jsonify<T extends () => Promise<infer U> ? Awaited<U extends void ? null : U> : ReturnType<T> extends void ? null : ReturnType<T>>>;
|
|
75
|
+
run: <T extends () => unknown>(name: string, fn: T, opts?: StepOpts) => Promise<Jsonify<T extends () => Promise<infer U> ? Awaited<U extends void ? null : U> : ReturnType<T> extends void ? null : ReturnType<T>>>;
|
|
76
76
|
/**
|
|
77
77
|
* Wait a specified amount of time before continuing.
|
|
78
78
|
*
|
|
@@ -83,14 +83,14 @@ export declare const createStepTools: <Events extends Record<string, EventPayloa
|
|
|
83
83
|
*
|
|
84
84
|
* To wait until a particular date, use `sleepUntil` instead.
|
|
85
85
|
*/
|
|
86
|
-
sleep: (time: number | string) => Promise<void>;
|
|
86
|
+
sleep: (time: number | string, opts?: StepOpts) => Promise<void>;
|
|
87
87
|
/**
|
|
88
88
|
* Wait until a particular date before continuing by passing a `Date`.
|
|
89
89
|
*
|
|
90
90
|
* To wait for a particular amount of time from now, always use `sleep`
|
|
91
91
|
* instead.
|
|
92
92
|
*/
|
|
93
|
-
sleepUntil: (time: Date | string) => Promise<void>;
|
|
93
|
+
sleepUntil: (time: Date | string, opts?: StepOpts) => Promise<void>;
|
|
94
94
|
}, {
|
|
95
95
|
/**
|
|
96
96
|
* The tree of all found ops in the entire invocation.
|
|
@@ -158,7 +158,7 @@ export declare const createStepTools: <Events extends Record<string, EventPayloa
|
|
|
158
158
|
* A set of optional parameters given to a `waitForEvent` call to control how
|
|
159
159
|
* the event is handled.
|
|
160
160
|
*/
|
|
161
|
-
interface WaitForEventOpts<TriggeringEvent extends EventPayload, IncomingEvent extends EventPayload> {
|
|
161
|
+
interface WaitForEventOpts<TriggeringEvent extends EventPayload, IncomingEvent extends EventPayload> extends StepOpts {
|
|
162
162
|
/**
|
|
163
163
|
* The step function will wait for the event for a maximum of this time, at
|
|
164
164
|
* which point the event will be returned as `null` instead of any event data.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InngestStepTools.d.ts","sourceRoot":"","sources":["../../src/components/InngestStepTools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAOzC,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAEnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,UAAU,EACV,KAAK,YAAY,EACjB,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"file":"InngestStepTools.d.ts","sourceRoot":"","sources":["../../src/components/InngestStepTools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAOzC,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAEnB,MAAM,kBA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;OAWG;uBACgB,OAAO;IAE1B;;;OAGG;mBACY,OAAO;EAoczB,CAAC;AAEF;;;GAGG;AACH,UAAU,gBAAgB,CACxB,eAAe,SAAS,YAAY,EACpC,aAAa,SAAS,YAAY,CAClC,SAAQ,QAAQ;IAChB;;;;;;;;;OASG;IACH,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAEhC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,GAAG,WAAW,CAAC,aAAa,CAAC,CAAC;IAElE;;;;;;;;;;;OAWG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,UAAU,CAAC;IACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACrC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAMF;;GAEG;AACH,eAAO,MAAM,UAAU;mBAPD,UAAU,KAAG,MAAM;CAOH,CAAC"}
|
|
@@ -36,16 +36,26 @@ const createStepTools = (client) => {
|
|
|
36
36
|
state.tickOps = state.allFoundOps;
|
|
37
37
|
/**
|
|
38
38
|
* Create a unique hash of an operation using only a subset of the operation's
|
|
39
|
-
* properties; will never use `data` and will guarantee the order of the
|
|
40
|
-
* so we don't rely on individual tools for that.
|
|
39
|
+
* properties; will never use `data` and will guarantee the order of the
|
|
40
|
+
* object so we don't rely on individual tools for that.
|
|
41
|
+
*
|
|
42
|
+
* If the operation already contains an ID, the current ID will be used
|
|
43
|
+
* instead, so that users can provide their own IDs.
|
|
41
44
|
*/
|
|
42
45
|
const hashOp = (
|
|
43
46
|
/**
|
|
44
|
-
* The op to generate a hash from. We only use a subset of the op's
|
|
45
|
-
* when creating the hash.
|
|
47
|
+
* The op to generate a hash from. We only use a subset of the op's
|
|
48
|
+
* properties when creating the hash.
|
|
46
49
|
*/
|
|
47
50
|
op) => {
|
|
48
51
|
var _a, _b, _c, _d;
|
|
52
|
+
/**
|
|
53
|
+
* If the op already has an ID, we don't need to generate one. This allows
|
|
54
|
+
* users to specify their own IDs.
|
|
55
|
+
*/
|
|
56
|
+
if (op.id) {
|
|
57
|
+
return op;
|
|
58
|
+
}
|
|
49
59
|
const obj = {
|
|
50
60
|
parent: (_b = (_a = state.currentOp) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : null,
|
|
51
61
|
op: op.op,
|
|
@@ -133,20 +143,24 @@ const createStepTools = (client) => {
|
|
|
133
143
|
*
|
|
134
144
|
* Returns a promise that will resolve once the event has been sent.
|
|
135
145
|
*/
|
|
136
|
-
sendEvent: createTool((nameOrPayload,
|
|
146
|
+
sendEvent: createTool((nameOrPayload, maybePayloadOrOpts, maybeOpts) => {
|
|
137
147
|
var _a;
|
|
138
148
|
let payloads;
|
|
139
|
-
|
|
149
|
+
let id;
|
|
150
|
+
const hasNamePrefix = typeof nameOrPayload === "string";
|
|
151
|
+
if (hasNamePrefix) {
|
|
152
|
+
id = maybeOpts === null || maybeOpts === void 0 ? void 0 : maybeOpts.id;
|
|
140
153
|
/**
|
|
141
154
|
* Add our payloads and ensure they all have a name.
|
|
142
155
|
*/
|
|
143
|
-
payloads = (Array.isArray(
|
|
144
|
-
?
|
|
145
|
-
:
|
|
146
|
-
? [
|
|
156
|
+
payloads = (Array.isArray(maybePayloadOrOpts)
|
|
157
|
+
? maybePayloadOrOpts
|
|
158
|
+
: maybePayloadOrOpts
|
|
159
|
+
? [maybePayloadOrOpts]
|
|
147
160
|
: []).map((payload) => (Object.assign(Object.assign({}, payload), { name: nameOrPayload })));
|
|
148
161
|
}
|
|
149
162
|
else {
|
|
163
|
+
id = maybePayloadOrOpts === null || maybePayloadOrOpts === void 0 ? void 0 : maybePayloadOrOpts.id;
|
|
150
164
|
/**
|
|
151
165
|
* Grab our payloads straight from the args.
|
|
152
166
|
*/
|
|
@@ -157,13 +171,14 @@ const createStepTools = (client) => {
|
|
|
157
171
|
: []);
|
|
158
172
|
}
|
|
159
173
|
return {
|
|
174
|
+
id,
|
|
160
175
|
op: types_1.StepOpCode.StepPlanned,
|
|
161
176
|
name: ((_a = payloads[0]) === null || _a === void 0 ? void 0 : _a.name) || "sendEvent",
|
|
162
177
|
};
|
|
163
178
|
}, {
|
|
164
179
|
nonStepExecuteInline: true,
|
|
165
|
-
fn: (nameOrPayload,
|
|
166
|
-
return client.send(nameOrPayload,
|
|
180
|
+
fn: (nameOrPayload, maybePayloadOrOpts) => {
|
|
181
|
+
return client.send(nameOrPayload, maybePayloadOrOpts);
|
|
167
182
|
},
|
|
168
183
|
}),
|
|
169
184
|
/**
|
|
@@ -188,7 +203,9 @@ const createStepTools = (client) => {
|
|
|
188
203
|
const matchOpts = {
|
|
189
204
|
timeout: (0, strings_1.timeStr)(typeof opts === "string" ? opts : opts.timeout),
|
|
190
205
|
};
|
|
206
|
+
let id;
|
|
191
207
|
if (typeof opts !== "string") {
|
|
208
|
+
id = opts === null || opts === void 0 ? void 0 : opts.id;
|
|
192
209
|
if (opts === null || opts === void 0 ? void 0 : opts.match) {
|
|
193
210
|
matchOpts.if = `event.${opts.match} == async.${opts.match}`;
|
|
194
211
|
}
|
|
@@ -197,6 +214,7 @@ const createStepTools = (client) => {
|
|
|
197
214
|
}
|
|
198
215
|
}
|
|
199
216
|
return {
|
|
217
|
+
id,
|
|
200
218
|
op: types_1.StepOpCode.WaitForEvent,
|
|
201
219
|
name: event,
|
|
202
220
|
opts: matchOpts,
|
|
@@ -214,8 +232,9 @@ const createStepTools = (client) => {
|
|
|
214
232
|
* of the `run` tool, meaning you can return and reason about return data
|
|
215
233
|
* for next steps.
|
|
216
234
|
*/
|
|
217
|
-
run: createTool((name) => {
|
|
235
|
+
run: createTool((name, _fn, opts) => {
|
|
218
236
|
return {
|
|
237
|
+
id: opts === null || opts === void 0 ? void 0 : opts.id,
|
|
219
238
|
op: types_1.StepOpCode.StepPlanned,
|
|
220
239
|
name,
|
|
221
240
|
};
|
|
@@ -230,12 +249,13 @@ const createStepTools = (client) => {
|
|
|
230
249
|
*
|
|
231
250
|
* To wait until a particular date, use `sleepUntil` instead.
|
|
232
251
|
*/
|
|
233
|
-
sleep: createTool((time) => {
|
|
252
|
+
sleep: createTool((time, opts) => {
|
|
234
253
|
/**
|
|
235
254
|
* The presence of this operation in the returned stack indicates that the
|
|
236
255
|
* sleep is over and we should continue execution.
|
|
237
256
|
*/
|
|
238
257
|
return {
|
|
258
|
+
id: opts === null || opts === void 0 ? void 0 : opts.id,
|
|
239
259
|
op: types_1.StepOpCode.Sleep,
|
|
240
260
|
name: (0, strings_1.timeStr)(time),
|
|
241
261
|
};
|
|
@@ -246,7 +266,7 @@ const createStepTools = (client) => {
|
|
|
246
266
|
* To wait for a particular amount of time from now, always use `sleep`
|
|
247
267
|
* instead.
|
|
248
268
|
*/
|
|
249
|
-
sleepUntil: createTool((time) => {
|
|
269
|
+
sleepUntil: createTool((time, opts) => {
|
|
250
270
|
const date = typeof time === "string" ? new Date(time) : time;
|
|
251
271
|
/**
|
|
252
272
|
* The presence of this operation in the returned stack indicates that the
|
|
@@ -254,6 +274,7 @@ const createStepTools = (client) => {
|
|
|
254
274
|
*/
|
|
255
275
|
try {
|
|
256
276
|
return {
|
|
277
|
+
id: opts === null || opts === void 0 ? void 0 : opts.id,
|
|
257
278
|
op: types_1.StepOpCode.Sleep,
|
|
258
279
|
name: date.toISOString(),
|
|
259
280
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InngestStepTools.js","sourceRoot":"","sources":["../../src/components/InngestStepTools.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAwC;AACxC,qCAA+B;AAE/B,8CAI2B;AAC3B,gDAA6C;AAQ7C,oCAKkB;AAElB,2DAAwD;AASxD;;;;;;;GAOG;AACI,MAAM,eAAe,GAAG,CAI7B,MAAuB,EACvB,EAAE;IACF,MAAM,KAAK,GAsEP;QACF,WAAW,EAAE,EAAE;QACf,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,EAAE;QAChB,SAAS,EAAE,SAAS;QACpB,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,GAAG,EAAE;YACV,KAAK,CAAC,YAAY,GAAG,EAAE,CAAC;YACxB,KAAK,CAAC,WAAW,mCAAQ,KAAK,CAAC,WAAW,GAAK,KAAK,CAAC,OAAO,CAAE,CAAC;QACjE,CAAC;QACD,iBAAiB,EAAE,KAAK;QACxB,aAAa,EAAE,KAAK;KACrB,CAAC;IAEF,+BAA+B;IAC/B,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,WAAW,CAAC;IAElC
|
|
1
|
+
{"version":3,"file":"InngestStepTools.js","sourceRoot":"","sources":["../../src/components/InngestStepTools.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAwC;AACxC,qCAA+B;AAE/B,8CAI2B;AAC3B,gDAA6C;AAQ7C,oCAKkB;AAElB,2DAAwD;AASxD;;;;;;;GAOG;AACI,MAAM,eAAe,GAAG,CAI7B,MAAuB,EACvB,EAAE;IACF,MAAM,KAAK,GAsEP;QACF,WAAW,EAAE,EAAE;QACf,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,EAAE;QAChB,SAAS,EAAE,SAAS;QACpB,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,GAAG,EAAE;YACV,KAAK,CAAC,YAAY,GAAG,EAAE,CAAC;YACxB,KAAK,CAAC,WAAW,mCAAQ,KAAK,CAAC,WAAW,GAAK,KAAK,CAAC,OAAO,CAAE,CAAC;QACjE,CAAC;QACD,iBAAiB,EAAE,KAAK;QACxB,aAAa,EAAE,KAAK;KACrB,CAAC;IAEF,+BAA+B;IAC/B,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,WAAW,CAAC;IAElC;;;;;;;OAOG;IACH,MAAM,MAAM,GAAG;IACb;;;O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C;QAEF;;;;;WAKG;QACH,UAAU,EAAE,UAAU,CAQpB,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;YACf,MAAM,IAAI,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YAE9D;;;eAGG;YACH,IAAI;gBACF,OAAO;oBACL,EAAE,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,EAAE;oBACZ,EAAE,EAAE,kBAAU,CAAC,KAAK;oBACpB,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE;iBACzB,CAAC;aACH;YAAC,OAAO,GAAG,EAAE;gBACZ;;;mBAGG;gBACH,mBAAmB;gBACnB,OAAO,CAAC,IAAI,CAAC,mDAAmD,EAAE,GAAG,CAAC,CAAC;gBAEvE,mBAAmB;gBACnB,MAAM,IAAI,KAAK,CACb,qDAAqD,IAAI,CAAC,QAAQ,EAAE,EAAE,CACvE,CAAC;aACH;QACH,CAAC,CAAC;KACH,CAAC;IAEF,OAAO,CAAC,KAAK,EAAE,KAAK,CAAiC,CAAC;AACxD,CAAC,CAAC;AA/gBW,QAAA,eAAe,mBA+gB1B;AAyEF,MAAM,QAAQ,GAAG,CAAC,EAAc,EAAU,EAAE;IAC1C,OAAO,IAAA,cAAI,GAAE,CAAC,MAAM,CAAC,IAAA,sBAAY,EAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF;;GAEG;AACU,QAAA,UAAU,GAAG,EAAE,QAAQ,EAAE,CAAC"}
|
package/helpers/errors.d.ts
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
+
import { type SerializedError as CjsSerializedError } from "serialize-error-cjs";
|
|
1
2
|
declare const SERIALIZED_KEY = "__serialized";
|
|
2
3
|
declare const SERIALIZED_VALUE = true;
|
|
3
|
-
export interface SerializedError {
|
|
4
|
+
export interface SerializedError extends Readonly<CjsSerializedError> {
|
|
4
5
|
readonly [SERIALIZED_KEY]: typeof SERIALIZED_VALUE;
|
|
5
|
-
readonly name: string;
|
|
6
|
-
readonly message: string;
|
|
7
|
-
readonly stack: string;
|
|
8
6
|
}
|
|
9
7
|
/**
|
|
10
|
-
* Serialise an error to a
|
|
8
|
+
* Serialise an error to a serialized JSON string.
|
|
11
9
|
*
|
|
12
10
|
* Errors do not serialise nicely to JSON, so we use this function to convert
|
|
13
|
-
* them to a
|
|
14
|
-
* we use the `serialize-error` package to do it for us.
|
|
11
|
+
* them to a serialized JSON string. Doing this is also non-trivial for some
|
|
12
|
+
* errors, so we use the `serialize-error` package to do it for us.
|
|
15
13
|
*
|
|
16
14
|
* See {@link https://www.npmjs.com/package/serialize-error}
|
|
17
15
|
*
|
|
@@ -23,9 +21,10 @@ export interface SerializedError {
|
|
|
23
21
|
*/
|
|
24
22
|
export declare const serializeError: (subject: unknown) => SerializedError;
|
|
25
23
|
/**
|
|
26
|
-
* Check if an object is a serialised error created by
|
|
24
|
+
* Check if an object or a string is a serialised error created by
|
|
25
|
+
* {@link serializeError}.
|
|
27
26
|
*/
|
|
28
|
-
export declare const isSerializedError: (value: unknown) =>
|
|
27
|
+
export declare const isSerializedError: (value: unknown) => SerializedError | undefined;
|
|
29
28
|
/**
|
|
30
29
|
* Deserialise an error created by {@link serializeError}.
|
|
31
30
|
*
|
package/helpers/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/helpers/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/helpers/errors.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,eAAe,IAAI,kBAAkB,EAC3C,MAAM,qBAAqB,CAAC;AAM7B,QAAA,MAAM,cAAc,iBAAiB,CAAC;AACtC,QAAA,MAAM,gBAAgB,OAAO,CAAC;AAkB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&& this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.fixEventKeyMissingSteps = exports.functionStoppedRunningErr = exports.prettyError = exports.ErrCode = exports.deserializeError = exports.isSerializedError = exports.serializeError = void 0;
|
|
7
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const json_stringify_safe_1 = __importDefault(require("json-stringify-safe"));
|
|
8
9
|
const serialize_error_cjs_1 = require("serialize-error-cjs");
|
|
10
|
+
const zod_1 = require("zod");
|
|
11
|
+
const NonRetriableError_1 = require("../components/NonRetriableError");
|
|
9
12
|
const SERIALIZED_KEY = "__serialized";
|
|
10
13
|
const SERIALIZED_VALUE = true;
|
|
11
14
|
/**
|
|
12
|
-
*
|
|
15
|
+
* Add first-class support for certain errors that we control, in addition to
|
|
16
|
+
* built-in errors such as `TypeError`.
|
|
17
|
+
*
|
|
18
|
+
* Adding these allows these non-standard errors to be correctly serialized,
|
|
19
|
+
* sent to Inngest, then deserialized back into the correct error type for users
|
|
20
|
+
* to react to correctly.
|
|
21
|
+
*
|
|
22
|
+
* Note that these errors only support `message?: string | undefined` as the
|
|
23
|
+
* input; more custom errors are not supported with this current strategy.
|
|
24
|
+
*/
|
|
25
|
+
serialize_error_cjs_1.errorConstructors.set("NonRetriableError", NonRetriableError_1.NonRetriableError);
|
|
26
|
+
/**
|
|
27
|
+
* Serialise an error to a serialized JSON string.
|
|
13
28
|
*
|
|
14
29
|
* Errors do not serialise nicely to JSON, so we use this function to convert
|
|
15
|
-
* them to a
|
|
16
|
-
* we use the `serialize-error` package to do it for us.
|
|
30
|
+
* them to a serialized JSON string. Doing this is also non-trivial for some
|
|
31
|
+
* errors, so we use the `serialize-error` package to do it for us.
|
|
17
32
|
*
|
|
18
33
|
* See {@link https://www.npmjs.com/package/serialize-error}
|
|
19
34
|
*
|
|
@@ -24,24 +39,87 @@ const SERIALIZED_VALUE = true;
|
|
|
24
39
|
* Will not reserialise existing serialised errors.
|
|
25
40
|
*/
|
|
26
41
|
const serializeError = (subject) => {
|
|
27
|
-
|
|
28
|
-
|
|
42
|
+
try {
|
|
43
|
+
// Try to understand if this is already done.
|
|
44
|
+
// Will handle stringified errors.
|
|
45
|
+
const existingSerializedError = (0, exports.isSerializedError)(subject);
|
|
46
|
+
if (existingSerializedError) {
|
|
47
|
+
return existingSerializedError;
|
|
48
|
+
}
|
|
49
|
+
if (typeof subject === "object" && subject !== null) {
|
|
50
|
+
// Is an object, so let's try and serialize it.
|
|
51
|
+
const serializedErr = (0, serialize_error_cjs_1.serializeError)(subject);
|
|
52
|
+
// Serialization can succeed but assign no name or message, so we'll
|
|
53
|
+
// map over the result here to ensure we have everything.
|
|
54
|
+
// We'll just stringify the entire subject for the message, as this at
|
|
55
|
+
// least provides some context for the user.
|
|
56
|
+
return {
|
|
57
|
+
name: serializedErr.name || "Error",
|
|
58
|
+
message: serializedErr.message ||
|
|
59
|
+
(0, json_stringify_safe_1.default)(subject) ||
|
|
60
|
+
"Unknown error; error serialization could not find a message.",
|
|
61
|
+
stack: serializedErr.stack || "",
|
|
62
|
+
[SERIALIZED_KEY]: SERIALIZED_VALUE,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
// If it's not an object, it's hard to parse this as an Error. In this case,
|
|
66
|
+
// we'll throw an error to start attempting backup strategies.
|
|
67
|
+
throw new Error("Error is not an object; strange throw value.");
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
try {
|
|
71
|
+
// If serialization fails, fall back to a regular Error and use the
|
|
72
|
+
// original object as the message for an Error. We don't know what this
|
|
73
|
+
// object looks like, so we can't do anything else with it.
|
|
74
|
+
return Object.assign(Object.assign({}, (0, exports.serializeError)(new Error(typeof subject === "string" ? subject : (0, json_stringify_safe_1.default)(subject)))), { [SERIALIZED_KEY]: SERIALIZED_VALUE });
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
// If this failed, then stringifying the object also failed, so we'll just
|
|
78
|
+
// return a completely generic error.
|
|
79
|
+
// Failing to stringify the object is very unlikely.
|
|
80
|
+
return {
|
|
81
|
+
name: "Could not serialize source error",
|
|
82
|
+
message: "Serializing the source error failed.",
|
|
83
|
+
stack: "",
|
|
84
|
+
[SERIALIZED_KEY]: SERIALIZED_VALUE,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
29
87
|
}
|
|
30
|
-
return Object.assign(Object.assign({}, (0, serialize_error_cjs_1.serializeError)(subject)), { [SERIALIZED_KEY]: SERIALIZED_VALUE });
|
|
31
88
|
};
|
|
32
89
|
exports.serializeError = serializeError;
|
|
33
90
|
/**
|
|
34
|
-
* Check if an object is a serialised error created by
|
|
91
|
+
* Check if an object or a string is a serialised error created by
|
|
92
|
+
* {@link serializeError}.
|
|
35
93
|
*/
|
|
36
94
|
const isSerializedError = (value) => {
|
|
37
95
|
try {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
SERIALIZED_VALUE)
|
|
96
|
+
if (typeof value === "string") {
|
|
97
|
+
const parsed = zod_1.z
|
|
98
|
+
.object({
|
|
99
|
+
[SERIALIZED_KEY]: zod_1.z.literal(SERIALIZED_VALUE),
|
|
100
|
+
name: zod_1.z.enum([...serialize_error_cjs_1.errorConstructors.keys()]),
|
|
101
|
+
message: zod_1.z.string(),
|
|
102
|
+
stack: zod_1.z.string(),
|
|
103
|
+
})
|
|
104
|
+
.passthrough()
|
|
105
|
+
.safeParse(JSON.parse(value));
|
|
106
|
+
if (parsed.success) {
|
|
107
|
+
return parsed.data;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (typeof value === "object" && value !== null) {
|
|
111
|
+
const objIsSerializedErr = Object.prototype.hasOwnProperty.call(value, SERIALIZED_KEY) &&
|
|
112
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
113
|
+
value[SERIALIZED_KEY] ===
|
|
114
|
+
SERIALIZED_VALUE;
|
|
115
|
+
if (objIsSerializedErr) {
|
|
116
|
+
return value;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
42
119
|
}
|
|
43
120
|
catch (_a) {
|
|
44
|
-
return
|
|
121
|
+
// no-op; we'll return undefined if parsing failed, as it isn't a serialized
|
|
122
|
+
// error
|
|
45
123
|
}
|
|
46
124
|
};
|
|
47
125
|
exports.isSerializedError = isSerializedError;
|
package/helpers/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/helpers/errors.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/helpers/errors.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,8EAA4C;AAC5C,6DAK6B;AAC7B,6BAAwB;AAExB,uEAAoE;AAGpE,MAAM,cAAc,GAAG,cAAc,CAAC;AACtC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAE9B;;;;;;;;;;GAUG;AACH,uCAAiB,CAAC,GAAG,CACnB,mBAAmB,EACnB,qCAAqC,CACtC,CAAC;AAMF;;;;;;;;;;;;;;GAcG;AACI,MAAM,cAAc,GAAG,CAAC,OAAgB,EAAmB,EAAE;IAClE,IAAI;QACF,6CAA6C;QAC7C,kCAAkC;QAClC,MAAM,uBAAuB,GAAG,IAAA,yBAAiB,EAAC,OAAO,CAAC,CAAC;QAE3D,IAAI,uBAAuB,EAAE;YAC3B,OAAO,uBAAuB,CAAC;SAChC;QAED,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,EAAE;YACnD,+CAA+C;YAC/C,MAAM,aAAa,GAAG,IAAA,oCAAiB,EAAC,OAAgB,CAAC,CAAC;YAE1D,oEAAoE;YACpE,yDAAyD;YACzD,sEAAsE;YACtE,4CAA4C;YAC5C,OAAO;gBACL,IAAI,EAAE,aAAa,CAAC,IAAI,IAAI,OAAO;gBACnC,OAAO,EACL,aAAa,CAAC,OAAO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