inngest 2.7.1 → 3.0.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 +52 -0
- package/api/api.js +4 -4
- package/api/schema.d.ts +54 -6
- package/api/schema.d.ts.map +1 -1
- package/api/schema.js +17 -7
- package/api/schema.js.map +1 -1
- package/cloudflare.d.ts +6 -3
- package/cloudflare.d.ts.map +1 -1
- package/cloudflare.js +19 -41
- package/cloudflare.js.map +1 -1
- package/components/EventSchemas.d.ts +1 -12
- package/components/EventSchemas.d.ts.map +1 -1
- package/components/EventSchemas.js.map +1 -1
- package/components/Inngest.d.ts +44 -57
- package/components/Inngest.d.ts.map +1 -1
- package/components/Inngest.js +91 -59
- package/components/Inngest.js.map +1 -1
- package/components/InngestCommHandler.d.ts +156 -198
- package/components/InngestCommHandler.d.ts.map +1 -1
- package/components/InngestCommHandler.js +311 -305
- package/components/InngestCommHandler.js.map +1 -1
- package/components/InngestFunction.d.ts +9 -82
- package/components/InngestFunction.d.ts.map +1 -1
- package/components/InngestFunction.js +21 -413
- package/components/InngestFunction.js.map +1 -1
- package/components/InngestMiddleware.d.ts +37 -26
- package/components/InngestMiddleware.d.ts.map +1 -1
- package/components/InngestMiddleware.js +1 -3
- package/components/InngestMiddleware.js.map +1 -1
- package/components/InngestStepTools.d.ts +69 -37
- package/components/InngestStepTools.d.ts.map +1 -1
- package/components/InngestStepTools.js +34 -95
- package/components/InngestStepTools.js.map +1 -1
- package/components/NonRetriableError.d.ts.map +1 -1
- package/components/NonRetriableError.js +1 -0
- package/components/NonRetriableError.js.map +1 -1
- package/components/RetryAfterError.d.ts +38 -0
- package/components/RetryAfterError.d.ts.map +1 -0
- package/components/RetryAfterError.js +42 -0
- package/components/RetryAfterError.js.map +1 -0
- package/components/execution/InngestExecution.d.ts +72 -0
- package/components/execution/InngestExecution.d.ts.map +1 -0
- package/components/execution/InngestExecution.js +23 -0
- package/components/execution/InngestExecution.js.map +1 -0
- package/components/execution/v0.d.ts +114 -0
- package/components/execution/v0.d.ts.map +1 -0
- package/components/execution/v0.js +394 -0
- package/components/execution/v0.js.map +1 -0
- package/components/execution/v1.d.ts +88 -0
- package/components/execution/v1.d.ts.map +1 -0
- package/components/execution/v1.js +673 -0
- package/components/execution/v1.js.map +1 -0
- package/deno/fresh.d.ts +3 -3
- package/deno/fresh.d.ts.map +1 -1
- package/deno/fresh.js +17 -38
- package/deno/fresh.js.map +1 -1
- package/digitalocean.d.ts +5 -5
- package/digitalocean.d.ts.map +1 -1
- package/digitalocean.js +14 -46
- package/digitalocean.js.map +1 -1
- package/edge.d.ts +5 -5
- package/edge.d.ts.map +1 -1
- package/edge.js +16 -38
- package/edge.js.map +1 -1
- package/express.d.ts +7 -3
- package/express.d.ts.map +1 -1
- package/express.js +38 -45
- package/express.js.map +1 -1
- package/fastify.d.ts +8 -3
- package/fastify.d.ts.map +1 -1
- package/fastify.js +37 -47
- package/fastify.js.map +1 -1
- package/h3.d.ts +4 -3
- package/h3.d.ts.map +1 -1
- package/h3.js +18 -45
- package/h3.js.map +1 -1
- package/helpers/ServerTiming.d.ts.map +1 -1
- package/helpers/ServerTiming.js +2 -1
- package/helpers/ServerTiming.js.map +1 -1
- package/helpers/consts.d.ts +23 -9
- package/helpers/consts.d.ts.map +1 -1
- package/helpers/consts.js +31 -13
- package/helpers/consts.js.map +1 -1
- package/helpers/devserver.d.ts +0 -34
- package/helpers/devserver.d.ts.map +1 -1
- package/helpers/devserver.js.map +1 -1
- package/helpers/env.d.ts +14 -6
- package/helpers/env.d.ts.map +1 -1
- package/helpers/env.js +4 -4
- package/helpers/env.js.map +1 -1
- package/helpers/errors.d.ts +37 -2
- package/helpers/errors.d.ts.map +1 -1
- package/helpers/errors.js +66 -15
- package/helpers/errors.js.map +1 -1
- package/helpers/functions.d.ts +52 -5
- package/helpers/functions.d.ts.map +1 -1
- package/helpers/functions.js +121 -22
- package/helpers/functions.js.map +1 -1
- package/helpers/promises.d.ts +45 -0
- package/helpers/promises.d.ts.map +1 -1
- package/helpers/promises.js +69 -1
- package/helpers/promises.js.map +1 -1
- package/helpers/strings.d.ts +6 -1
- package/helpers/strings.d.ts.map +1 -1
- package/helpers/strings.js +7 -2
- package/helpers/strings.js.map +1 -1
- package/helpers/types.d.ts +5 -17
- package/helpers/types.d.ts.map +1 -1
- package/index.d.ts +4 -2
- package/index.d.ts.map +1 -1
- package/index.js +5 -1
- package/index.js.map +1 -1
- package/lambda.d.ts +10 -8
- package/lambda.d.ts.map +1 -1
- package/lambda.js +48 -72
- package/lambda.js.map +1 -1
- package/next.d.ts +11 -5
- package/next.d.ts.map +1 -1
- package/next.js +84 -103
- package/next.js.map +1 -1
- package/nuxt.d.ts +3 -3
- package/nuxt.d.ts.map +1 -1
- package/nuxt.js +5 -6
- package/nuxt.js.map +1 -1
- package/package.json +5 -4
- package/redwood.d.ts +4 -3
- package/redwood.d.ts.map +1 -1
- package/redwood.js +22 -48
- package/redwood.js.map +1 -1
- package/remix.d.ts +7 -5
- package/remix.d.ts.map +1 -1
- package/remix.js +15 -36
- package/remix.js.map +1 -1
- package/types.d.ts +150 -218
- package/types.d.ts.map +1 -1
- package/types.js +38 -45
- package/types.js.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/helpers/scalar.d.ts +0 -8
- package/helpers/scalar.d.ts.map +0 -1
- package/helpers/scalar.js +0 -19
- package/helpers/scalar.js.map +0 -1
package/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.err = exports.ok = exports.logLevels = exports.sendEventResponseSchema = exports.incomingOpSchema = exports.StepOpCode = exports.failureEventErrorSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.failureEventErrorSchema = zod_1.z.object({
|
|
6
6
|
name: zod_1.z.string(),
|
|
@@ -19,12 +19,48 @@ var StepOpCode;
|
|
|
19
19
|
StepOpCode["RunStep"] = "Step";
|
|
20
20
|
StepOpCode["StepPlanned"] = "StepPlanned";
|
|
21
21
|
StepOpCode["Sleep"] = "Sleep";
|
|
22
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Used to signify that the executor has requested that a step run, but we
|
|
24
|
+
* could not find that step.
|
|
25
|
+
*
|
|
26
|
+
* This is likely indicative that a step was renamed or removed from the
|
|
27
|
+
* function.
|
|
28
|
+
*/
|
|
29
|
+
StepOpCode["StepNotFound"] = "StepNotFound";
|
|
30
|
+
})(StepOpCode || (exports.StepOpCode = StepOpCode = {}));
|
|
23
31
|
exports.incomingOpSchema = zod_1.z.object({
|
|
24
32
|
id: zod_1.z.string().min(1),
|
|
25
33
|
data: zod_1.z.any().optional(),
|
|
26
34
|
error: zod_1.z.any().optional(),
|
|
27
35
|
});
|
|
36
|
+
exports.sendEventResponseSchema = zod_1.z.object({
|
|
37
|
+
/**
|
|
38
|
+
* Event IDs
|
|
39
|
+
*/
|
|
40
|
+
ids: zod_1.z.array(zod_1.z.string()),
|
|
41
|
+
/**
|
|
42
|
+
* HTTP Status Code. Will be undefined if no request was sent.
|
|
43
|
+
*/
|
|
44
|
+
status: zod_1.z.number(),
|
|
45
|
+
/**
|
|
46
|
+
* Error message. Will be undefined if no error occurred.
|
|
47
|
+
*/
|
|
48
|
+
error: zod_1.z.string().optional(),
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* A set of log levels that can be used to control the amount of logging output
|
|
52
|
+
* from various parts of the Inngest library.
|
|
53
|
+
*
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
56
|
+
exports.logLevels = [
|
|
57
|
+
"fatal",
|
|
58
|
+
"error",
|
|
59
|
+
"warn",
|
|
60
|
+
"info",
|
|
61
|
+
"debug",
|
|
62
|
+
"silent",
|
|
63
|
+
];
|
|
28
64
|
const ok = (data) => {
|
|
29
65
|
return { ok: true, value: data };
|
|
30
66
|
};
|
|
@@ -33,47 +69,4 @@ const err = (error) => {
|
|
|
33
69
|
return { ok: false, error };
|
|
34
70
|
};
|
|
35
71
|
exports.err = err;
|
|
36
|
-
/**
|
|
37
|
-
* Format of data send from the executor to the SDK
|
|
38
|
-
*/
|
|
39
|
-
exports.fnDataSchema = zod_1.z.object({
|
|
40
|
-
event: zod_1.z.object({}).passthrough(),
|
|
41
|
-
events: zod_1.z.array(zod_1.z.object({}).passthrough()).default([]),
|
|
42
|
-
/**
|
|
43
|
-
* When handling per-step errors, steps will need to be an object with
|
|
44
|
-
* either a `data` or an `error` key.
|
|
45
|
-
*
|
|
46
|
-
* For now, we support the current method of steps just being a map of
|
|
47
|
-
* step ID to step data.
|
|
48
|
-
*
|
|
49
|
-
* TODO When the executor does support per-step errors, we can uncomment
|
|
50
|
-
* the expected schema below.
|
|
51
|
-
*/
|
|
52
|
-
steps: zod_1.z
|
|
53
|
-
.record(zod_1.z.any().refine((v) => typeof v !== "undefined", {
|
|
54
|
-
message: "Values in steps must be defined",
|
|
55
|
-
}))
|
|
56
|
-
.optional()
|
|
57
|
-
.nullable(),
|
|
58
|
-
// steps: z.record(incomingOpSchema.passthrough()).optional().nullable(),
|
|
59
|
-
ctx: zod_1.z
|
|
60
|
-
.object({
|
|
61
|
-
run_id: zod_1.z.string(),
|
|
62
|
-
attempt: zod_1.z.number().default(0),
|
|
63
|
-
stack: zod_1.z
|
|
64
|
-
.object({
|
|
65
|
-
stack: zod_1.z
|
|
66
|
-
.array(zod_1.z.string())
|
|
67
|
-
.nullable()
|
|
68
|
-
.transform((v) => (Array.isArray(v) ? v : [])),
|
|
69
|
-
current: zod_1.z.number(),
|
|
70
|
-
})
|
|
71
|
-
.passthrough()
|
|
72
|
-
.optional()
|
|
73
|
-
.nullable(),
|
|
74
|
-
})
|
|
75
|
-
.optional()
|
|
76
|
-
.nullable(),
|
|
77
|
-
use_api: zod_1.z.boolean().default(false),
|
|
78
|
-
});
|
|
79
72
|
//# sourceMappingURL=types.js.map
|
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAoDX,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC;AAuCH;;;GAGG;AACH,IAAY,UAcX;AAdD,WAAY,UAAU;IACpB,2CAA6B,CAAA;IAC7B,8BAAgB,CAAA;IAChB,yCAA2B,CAAA;IAC3B,6BAAe,CAAA;IAEf;;;;;;OAMG;IACH,2CAA6B,CAAA;AAC/B,CAAC,EAdW,UAAU,0BAAV,UAAU,QAcrB;AAmDY,QAAA,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,IAAI,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACxB,KAAK,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CAC1B,CAAC,CAAC;AA4JU,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C;;OAEG;IACH,GAAG,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;IAExB;;OAEG;IACH,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAElB;;OAEG;IACH,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAwKH;;;;;GAKG;AACU,QAAA,SAAS,GAAG;IACvB,OAAO;IACP,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;IACP,QAAQ;CACA,CAAC;AA8hBJ,MAAM,EAAE,GAAG,CAAI,IAAO,EAAoB,EAAE;IACjD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACnC,CAAC,CAAC;AAFW,QAAA,EAAE,MAEb;AAEK,MAAM,GAAG,GAAG,CAAI,KAAS,EAAoB,EAAE;IACpD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAC9B,CAAC,CAAC;AAFW,QAAA,GAAG,OAEd"}
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "
|
|
1
|
+
export declare const version = "3.0.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/helpers/scalar.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns a boolean representing whether a string was `"true"` or `"false"`
|
|
3
|
-
* when lowercased and trimmed.
|
|
4
|
-
*
|
|
5
|
-
* If the string was neither, will return `null`.
|
|
6
|
-
*/
|
|
7
|
-
export declare const strBoolean: (str: string | undefined) => boolean | null;
|
|
8
|
-
//# sourceMappingURL=scalar.d.ts.map
|
package/helpers/scalar.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scalar.d.ts","sourceRoot":"","sources":["../../src/helpers/scalar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,UAAU,QAAS,MAAM,GAAG,SAAS,KAAG,OAAO,GAAG,IAO9D,CAAC"}
|
package/helpers/scalar.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.strBoolean = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Returns a boolean representing whether a string was `"true"` or `"false"`
|
|
6
|
-
* when lowercased and trimmed.
|
|
7
|
-
*
|
|
8
|
-
* If the string was neither, will return `null`.
|
|
9
|
-
*/
|
|
10
|
-
const strBoolean = (str) => {
|
|
11
|
-
const trimmed = str === null || str === void 0 ? void 0 : str.toLowerCase().trim();
|
|
12
|
-
if (trimmed === "true")
|
|
13
|
-
return true;
|
|
14
|
-
if (trimmed === "false")
|
|
15
|
-
return false;
|
|
16
|
-
return null;
|
|
17
|
-
};
|
|
18
|
-
exports.strBoolean = strBoolean;
|
|
19
|
-
//# sourceMappingURL=scalar.js.map
|
package/helpers/scalar.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scalar.js","sourceRoot":"","sources":["../../src/helpers/scalar.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACI,MAAM,UAAU,GAAG,CAAC,GAAuB,EAAkB,EAAE;IACpE,MAAM,OAAO,GAAG,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,WAAW,GAAG,IAAI,EAAE,CAAC;IAE1C,IAAI,OAAO,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IACpC,IAAI,OAAO,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IAEtC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAPW,QAAA,UAAU,cAOrB"}
|