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/next.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.serve = exports.
|
|
3
|
+
exports.serve = exports.frameworkName = void 0;
|
|
4
4
|
const InngestCommHandler_1 = require("./components/InngestCommHandler");
|
|
5
|
-
|
|
6
|
-
exports.name = "nextjs";
|
|
5
|
+
exports.frameworkName = "nextjs";
|
|
7
6
|
const isNextEdgeRequest = (req) => {
|
|
8
7
|
var _a;
|
|
9
8
|
return typeof ((_a = req === null || req === void 0 ? void 0 : req.headers) === null || _a === void 0 ? void 0 : _a.get) === "function";
|
|
@@ -14,114 +13,96 @@ const isNextEdgeRequest = (req) => {
|
|
|
14
13
|
*
|
|
15
14
|
* @example Next.js <=12 can export the handler directly
|
|
16
15
|
* ```ts
|
|
17
|
-
* export default serve(inngest, [fn1, fn2]);
|
|
16
|
+
* export default serve({ client: inngest, functions: [fn1, fn2] });
|
|
18
17
|
* ```
|
|
19
18
|
*
|
|
20
19
|
* @example Next.js >=13 with the `app` dir must export individual methods
|
|
21
20
|
* ```ts
|
|
22
|
-
* export const { GET, POST, PUT } = serve(
|
|
21
|
+
* export const { GET, POST, PUT } = serve({
|
|
22
|
+
* client: inngest,
|
|
23
|
+
* functions: [fn1, fn2],
|
|
24
|
+
* });
|
|
23
25
|
* ```
|
|
24
26
|
*
|
|
25
27
|
* @public
|
|
26
28
|
*/
|
|
27
|
-
const serve = (
|
|
28
|
-
const handler = new InngestCommHandler_1.InngestCommHandler(exports.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
view: () => {
|
|
107
|
-
if (method === "GET") {
|
|
108
|
-
return {
|
|
109
|
-
isIntrospection: hasQueryParam(consts_1.queryKeys.Introspect),
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
}, ({ body, headers, status }, _method, req, res) => {
|
|
115
|
-
if (isNextEdgeRequest(req)) {
|
|
116
|
-
return new Response(body, { status, headers });
|
|
117
|
-
}
|
|
118
|
-
for (const [key, value] of Object.entries(headers)) {
|
|
119
|
-
res.setHeader(key, value);
|
|
120
|
-
}
|
|
121
|
-
res.status(status).send(body);
|
|
122
|
-
}, ({ body, headers, status }) => {
|
|
123
|
-
return new Response(body, { status, headers });
|
|
124
|
-
});
|
|
29
|
+
const serve = (options) => {
|
|
30
|
+
const handler = new InngestCommHandler_1.InngestCommHandler(Object.assign(Object.assign({ frameworkName: exports.frameworkName }, options), { handler: (reqMethod, req, res) => {
|
|
31
|
+
const isEdge = isNextEdgeRequest(req);
|
|
32
|
+
return {
|
|
33
|
+
body: () => {
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
35
|
+
return isEdge ? req.json() : req.body;
|
|
36
|
+
},
|
|
37
|
+
headers: (key) => {
|
|
38
|
+
if (isEdge) {
|
|
39
|
+
return req.headers.get(key);
|
|
40
|
+
}
|
|
41
|
+
const header = req.headers[key];
|
|
42
|
+
return Array.isArray(header) ? header[0] : header;
|
|
43
|
+
},
|
|
44
|
+
method: () => {
|
|
45
|
+
/**
|
|
46
|
+
* `req.method`, though types say otherwise, is not available in Next.js
|
|
47
|
+
* 13 {@link https://beta.nextjs.org/docs/routing/route-handlers Route Handlers}.
|
|
48
|
+
*
|
|
49
|
+
* Therefore, we must try to set the method ourselves where we know it.
|
|
50
|
+
*/
|
|
51
|
+
return reqMethod || req.method || "";
|
|
52
|
+
},
|
|
53
|
+
isProduction: () => {
|
|
54
|
+
/**
|
|
55
|
+
* Vercel Edge Functions do not allow dynamic access to environment
|
|
56
|
+
* variables, so we'll manage production checks directly here.
|
|
57
|
+
*
|
|
58
|
+
* We try/catch to avoid situations where Next.js is being used in
|
|
59
|
+
* environments where `process.env` is not accessible or polyfilled.
|
|
60
|
+
*/
|
|
61
|
+
try {
|
|
62
|
+
// eslint-disable-next-line @inngest/internal/process-warn
|
|
63
|
+
return process.env.NODE_ENV === "production";
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
// no-op
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
queryString: (key, url) => {
|
|
70
|
+
if (isEdge) {
|
|
71
|
+
return url.searchParams.get(key);
|
|
72
|
+
}
|
|
73
|
+
const qs = req.query[key];
|
|
74
|
+
return Array.isArray(qs) ? qs[0] : qs;
|
|
75
|
+
},
|
|
76
|
+
url: () => {
|
|
77
|
+
if (isEdge) {
|
|
78
|
+
return new URL(req.url);
|
|
79
|
+
}
|
|
80
|
+
let scheme = "https";
|
|
81
|
+
try {
|
|
82
|
+
// eslint-disable-next-line @inngest/internal/process-warn
|
|
83
|
+
if (process.env.NODE_ENV === "development") {
|
|
84
|
+
scheme = "http";
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
// no-op
|
|
89
|
+
}
|
|
90
|
+
return new URL(req.url, `${scheme}://${req.headers.host || ""}`);
|
|
91
|
+
},
|
|
92
|
+
transformResponse: ({ body, headers, status }) => {
|
|
93
|
+
if (isNextEdgeRequest(req)) {
|
|
94
|
+
return new Response(body, { status, headers });
|
|
95
|
+
}
|
|
96
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
97
|
+
res.setHeader(key, value);
|
|
98
|
+
}
|
|
99
|
+
res.status(status).send(body);
|
|
100
|
+
},
|
|
101
|
+
transformStreamingResponse: ({ body, headers, status }) => {
|
|
102
|
+
return new Response(body, { status, headers });
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
} }));
|
|
125
106
|
/**
|
|
126
107
|
* Next.js 13 uses
|
|
127
108
|
* {@link https://beta.nextjs.org/docs/routing/route-handlers Route Handlers}
|
package/next.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.js","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":";;;AAEA,wEAGyC;
|
|
1
|
+
{"version":3,"file":"next.js","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":";;;AAEA,wEAGyC;AAI5B,QAAA,aAAa,GAA2B,QAAQ,CAAC;AAE9D,MAAM,iBAAiB,GAAG,CACxB,GAAiC,EACb,EAAE;;IACtB,OAAO,OAAO,CAAA,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,0CAAE,GAAG,CAAA,KAAK,UAAU,CAAC;AACjD,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACI,MAAM,KAAK,GAAG,CAAC,OAA4B,EAAE,EAAE;IACpD,MAAM,OAAO,GAAG,IAAI,uCAAkB,+BACpC,aAAa,EAAb,qBAAa,IACV,OAAO,KACV,OAAO,EAAE,CACP,SAA6C,EAC7C,GAAwC,EACxC,GAAoB,EACpB,EAAE;YACF,MAAM,MAAM,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;YAEtC,OAAO;gBACL,IAAI,EAAE,GAAG,EAAE;oBACT,+DAA+D;oBAC/D,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CA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AE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;QACpC,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE;QACtC,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;KACrC,CAAC,CAAC;AACL,CAAC,CAAC;AA5HW,QAAA,KAAK,SA4HhB"}
|
package/nuxt.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ServeHandlerOptions } from "./components/InngestCommHandler";
|
|
2
2
|
import { type SupportedFrameworkName } from "./types";
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const frameworkName: SupportedFrameworkName;
|
|
4
4
|
/**
|
|
5
5
|
* In Nuxt 3, serve and register any declared functions with Inngest, making
|
|
6
6
|
* them available to be triggered by events.
|
|
7
7
|
*
|
|
8
8
|
* @public
|
|
9
9
|
*/
|
|
10
|
-
export declare const serve:
|
|
10
|
+
export declare const serve: (options: ServeHandlerOptions) => (event: import("h3").H3Event<import("h3").EventHandlerRequest>) => Promise<void>;
|
|
11
11
|
//# sourceMappingURL=nuxt.d.ts.map
|
package/nuxt.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nuxt.d.ts","sourceRoot":"","sources":["../src/nuxt.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"nuxt.d.ts","sourceRoot":"","sources":["../src/nuxt.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,eAAO,MAAM,aAAa,EAAE,sBAA+B,CAAC;AAE5D;;;;;GAKG;AACH,eAAO,MAAM,KAAK,YAAa,mBAAmB,qFAOjD,CAAC"}
|
package/nuxt.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.serve = exports.
|
|
3
|
+
exports.serve = exports.frameworkName = void 0;
|
|
4
4
|
const h3_1 = require("./h3");
|
|
5
|
-
exports.
|
|
5
|
+
exports.frameworkName = "nuxt";
|
|
6
6
|
/**
|
|
7
7
|
* In Nuxt 3, serve and register any declared functions with Inngest, making
|
|
8
8
|
* them available to be triggered by events.
|
|
9
9
|
*
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
|
-
const serve = (
|
|
13
|
-
const optsOverrides = Object.assign(Object.assign({},
|
|
14
|
-
|
|
15
|
-
return (0, h3_1.serve)(client, functions, optsOverrides);
|
|
12
|
+
const serve = (options) => {
|
|
13
|
+
const optsOverrides = Object.assign(Object.assign({}, options), { frameworkName: exports.frameworkName });
|
|
14
|
+
return (0, h3_1.serve)(optsOverrides);
|
|
16
15
|
};
|
|
17
16
|
exports.serve = serve;
|
|
18
17
|
//# sourceMappingURL=nuxt.js.map
|
package/nuxt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nuxt.js","sourceRoot":"","sources":["../src/nuxt.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"nuxt.js","sourceRoot":"","sources":["../src/nuxt.ts"],"names":[],"mappings":";;;AAIA,6BAAwC;AAG3B,QAAA,aAAa,GAA2B,MAAM,CAAC;AAE5D;;;;;GAKG;AACI,MAAM,KAAK,GAAG,CAAC,OAA4B,EAAE,EAAE;IACpD,MAAM,aAAa,mCACd,OAAO,KACV,aAAa,EAAb,qBAAa,GACd,CAAC;IAEF,OAAO,IAAA,UAAO,EAAC,aAAa,CAAC,CAAC;AAChC,CAAC,CAAC;AAPW,QAAA,KAAK,SAOhB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "inngest",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Official SDK for Inngest.com",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -119,14 +119,14 @@
|
|
|
119
119
|
"canonicalize": "^1.0.8",
|
|
120
120
|
"chalk": "^4.1.2",
|
|
121
121
|
"cross-fetch": "^4.0.0",
|
|
122
|
+
"debug": "^4.3.4",
|
|
122
123
|
"h3": "^1.8.1",
|
|
123
124
|
"hash.js": "^1.1.7",
|
|
124
125
|
"json-stringify-safe": "^5.0.1",
|
|
125
126
|
"ms": "^2.1.3",
|
|
126
|
-
"queue-microtask": "^1.2.3",
|
|
127
127
|
"serialize-error-cjs": "^0.1.3",
|
|
128
128
|
"type-fest": "^3.5.1",
|
|
129
|
-
"zod": "
|
|
129
|
+
"zod": "~3.21.4"
|
|
130
130
|
},
|
|
131
131
|
"devDependencies": {
|
|
132
132
|
"@actions/core": "^1.10.0",
|
|
@@ -136,6 +136,7 @@
|
|
|
136
136
|
"@microsoft/api-extractor": "^7.33.7",
|
|
137
137
|
"@total-typescript/shoehorn": "^0.1.1",
|
|
138
138
|
"@types/aws-lambda": "^8.10.108",
|
|
139
|
+
"@types/debug": "^4.1.8",
|
|
139
140
|
"@types/express": "^4.17.13",
|
|
140
141
|
"@types/inquirer": "^9.0.3",
|
|
141
142
|
"@types/jest": "^27.4.1",
|
|
@@ -167,7 +168,7 @@
|
|
|
167
168
|
"ts-jest": "^29.1.0",
|
|
168
169
|
"tsx": "^3.12.7",
|
|
169
170
|
"type-plus": "^5.1.0",
|
|
170
|
-
"typescript": "^5.
|
|
171
|
+
"typescript": "^5.2.2",
|
|
171
172
|
"ulid": "^2.3.0"
|
|
172
173
|
},
|
|
173
174
|
"volta": {
|
package/redwood.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type APIGatewayProxyEvent, type Context as LambdaContext } from "aws-lambda";
|
|
2
|
+
import { type ServeHandlerOptions } from "./components/InngestCommHandler";
|
|
2
3
|
import { type SupportedFrameworkName } from "./types";
|
|
3
4
|
export interface RedwoodResponse {
|
|
4
5
|
statusCode: number;
|
|
5
6
|
body?: string | null;
|
|
6
7
|
headers?: Record<string, string>;
|
|
7
8
|
}
|
|
8
|
-
export declare const
|
|
9
|
+
export declare const frameworkName: SupportedFrameworkName;
|
|
9
10
|
/**
|
|
10
11
|
* In Redwood.js, serve and register any declared functions with Inngest, making
|
|
11
12
|
* them available to be triggered by events.
|
|
12
13
|
*
|
|
13
14
|
* @public
|
|
14
15
|
*/
|
|
15
|
-
export declare const serve:
|
|
16
|
+
export declare const serve: (options: ServeHandlerOptions) => (event: APIGatewayProxyEvent, _context: LambdaContext) => Promise<RedwoodResponse>;
|
|
16
17
|
//# sourceMappingURL=redwood.d.ts.map
|
package/redwood.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redwood.d.ts","sourceRoot":"","sources":["../src/redwood.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"redwood.d.ts","sourceRoot":"","sources":["../src/redwood.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,OAAO,IAAI,aAAa,EAC9B,MAAM,YAAY,CAAC;AACpB,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,eAAO,MAAM,aAAa,EAAE,sBAAoC,CAAC;AAEjE;;;;;GAKG;AACH,eAAO,MAAM,KAAK,YAAa,mBAAmB,uFAyCjD,CAAC"}
|
package/redwood.js
CHANGED
|
@@ -1,65 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.serve = exports.
|
|
3
|
+
exports.serve = exports.frameworkName = void 0;
|
|
4
4
|
const InngestCommHandler_1 = require("./components/InngestCommHandler");
|
|
5
|
-
const consts_1 = require("./helpers/consts");
|
|
6
5
|
const env_1 = require("./helpers/env");
|
|
7
|
-
exports.
|
|
6
|
+
exports.frameworkName = "redwoodjs";
|
|
8
7
|
/**
|
|
9
8
|
* In Redwood.js, serve and register any declared functions with Inngest, making
|
|
10
9
|
* them available to be triggered by events.
|
|
11
10
|
*
|
|
12
11
|
* @public
|
|
13
12
|
*/
|
|
14
|
-
const serve = (
|
|
15
|
-
const handler = new InngestCommHandler_1.InngestCommHandler(exports.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
register: () => {
|
|
21
|
-
var _a;
|
|
22
|
-
if (event.httpMethod === "PUT") {
|
|
23
|
-
return {
|
|
24
|
-
deployId: (_a = event.queryStringParameters) === null || _a === void 0 ? void 0 : _a[consts_1.queryKeys.DeployId],
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
run: () => {
|
|
29
|
-
var _a, _b;
|
|
30
|
-
if (event.httpMethod === "POST") {
|
|
31
|
-
/**
|
|
32
|
-
* Some requests can be base64 encoded, requiring us to decode it
|
|
33
|
-
* first before parsing as JSON.
|
|
34
|
-
*/
|
|
35
|
-
const data = JSON.parse(event.body
|
|
13
|
+
const serve = (options) => {
|
|
14
|
+
const handler = new InngestCommHandler_1.InngestCommHandler(Object.assign(Object.assign({ frameworkName: exports.frameworkName }, options), { handler: (event, _context) => {
|
|
15
|
+
return {
|
|
16
|
+
body: () => {
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
18
|
+
return JSON.parse(event.body
|
|
36
19
|
? event.isBase64Encoded
|
|
37
20
|
? Buffer.from(event.body, "base64").toString()
|
|
38
21
|
: event.body
|
|
39
22
|
: "{}");
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
}, (actionRes) => {
|
|
57
|
-
return {
|
|
58
|
-
statusCode: actionRes.status,
|
|
59
|
-
body: actionRes.body,
|
|
60
|
-
headers: actionRes.headers,
|
|
61
|
-
};
|
|
62
|
-
});
|
|
23
|
+
},
|
|
24
|
+
headers: (key) => event.headers[key],
|
|
25
|
+
method: () => event.httpMethod,
|
|
26
|
+
url: () => {
|
|
27
|
+
const scheme = (0, env_1.processEnv)("NODE_ENV") === "development" ? "http" : "https";
|
|
28
|
+
const url = new URL(event.path, `${scheme}://${event.headers.host || ""}`);
|
|
29
|
+
return url;
|
|
30
|
+
},
|
|
31
|
+
queryString: (key) => { var _a; return (_a = event.queryStringParameters) === null || _a === void 0 ? void 0 : _a[key]; },
|
|
32
|
+
transformResponse: ({ body, status: statusCode, headers, }) => {
|
|
33
|
+
return { body, statusCode, headers };
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
} }));
|
|
63
37
|
return handler.createHandler();
|
|
64
38
|
};
|
|
65
39
|
exports.serve = serve;
|
package/redwood.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redwood.js","sourceRoot":"","sources":["../src/redwood.ts"],"names":[],"mappings":";;;AAIA,wEAGyC;AACzC,
|
|
1
|
+
{"version":3,"file":"redwood.js","sourceRoot":"","sources":["../src/redwood.ts"],"names":[],"mappings":";;;AAIA,wEAGyC;AACzC,uCAA2C;AAS9B,QAAA,aAAa,GAA2B,WAAW,CAAC;AAEjE;;;;;GAKG;AACI,MA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OAAO,EAAE,CAAC;gBACvC,CAAC;aACF,CAAC;QACJ,CAAC,IACD,CAAC;IAEH,OAAO,OAAO,CAAC,aAAa,EAAE,CAAC;AACjC,CAAC,CAAC;AAzCW,QAAA,KAAK,SAyChB"}
|
package/remix.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ServeHandlerOptions } from "./components/InngestCommHandler";
|
|
2
2
|
import { type SupportedFrameworkName } from "./types";
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const frameworkName: SupportedFrameworkName;
|
|
4
4
|
/**
|
|
5
5
|
* In Remix, serve and register any declared functions with Inngest, making them
|
|
6
6
|
* available to be triggered by events.
|
|
@@ -14,14 +14,16 @@ export declare const name: SupportedFrameworkName;
|
|
|
14
14
|
* @example
|
|
15
15
|
* ```ts
|
|
16
16
|
* import { serve } from "inngest/remix";
|
|
17
|
-
* import
|
|
17
|
+
* import functions from "~/inngest";
|
|
18
18
|
*
|
|
19
|
-
* const handler = serve(
|
|
19
|
+
* const handler = serve({ id: "my-remix-app", functions });
|
|
20
20
|
*
|
|
21
21
|
* export { handler as loader, handler as action };
|
|
22
22
|
* ```
|
|
23
23
|
*
|
|
24
24
|
* @public
|
|
25
25
|
*/
|
|
26
|
-
export declare const serve:
|
|
26
|
+
export declare const serve: (options: ServeHandlerOptions) => (args_0: {
|
|
27
|
+
request: Request;
|
|
28
|
+
}) => Promise<Response>;
|
|
27
29
|
//# sourceMappingURL=remix.d.ts.map
|
package/remix.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remix.d.ts","sourceRoot":"","sources":["../src/remix.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,
|
|
1
|
+
{"version":3,"file":"remix.d.ts","sourceRoot":"","sources":["../src/remix.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,eAAO,MAAM,aAAa,EAAE,sBAAgC,CAAC;AA4B7D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,KAAK,YAAa,mBAAmB;aAIP,OAAO;uBAajD,CAAC"}
|
package/remix.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.serve = exports.
|
|
3
|
+
exports.serve = exports.frameworkName = void 0;
|
|
4
4
|
const InngestCommHandler_1 = require("./components/InngestCommHandler");
|
|
5
|
-
|
|
6
|
-
exports.name = "remix";
|
|
5
|
+
exports.frameworkName = "remix";
|
|
7
6
|
const createNewResponse = ({ body, status, headers, }) => {
|
|
8
7
|
/**
|
|
9
8
|
* If `Response` isn't included in this environment, it's probably a Node
|
|
@@ -37,46 +36,26 @@ const createNewResponse = ({ body, status, headers, }) => {
|
|
|
37
36
|
* @example
|
|
38
37
|
* ```ts
|
|
39
38
|
* import { serve } from "inngest/remix";
|
|
40
|
-
* import
|
|
39
|
+
* import functions from "~/inngest";
|
|
41
40
|
*
|
|
42
|
-
* const handler = serve(
|
|
41
|
+
* const handler = serve({ id: "my-remix-app", functions });
|
|
43
42
|
*
|
|
44
43
|
* export { handler as loader, handler as action };
|
|
45
44
|
* ```
|
|
46
45
|
*
|
|
47
46
|
* @public
|
|
48
47
|
*/
|
|
49
|
-
const serve = (
|
|
50
|
-
const handler = new InngestCommHandler_1.InngestCommHandler(exports.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
run: async () => {
|
|
62
|
-
if (req.method === "POST") {
|
|
63
|
-
return {
|
|
64
|
-
data: (await req.json()),
|
|
65
|
-
fnId: url.searchParams.get(consts_1.queryKeys.FnId),
|
|
66
|
-
stepId: url.searchParams.get(consts_1.queryKeys.StepId),
|
|
67
|
-
signature: req.headers.get(consts_1.headerKeys.Signature) || undefined,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
view: () => {
|
|
72
|
-
if (req.method === "GET") {
|
|
73
|
-
return {
|
|
74
|
-
isIntrospection: url.searchParams.has(consts_1.queryKeys.Introspect),
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
}, createNewResponse, createNewResponse);
|
|
48
|
+
const serve = (options) => {
|
|
49
|
+
const handler = new InngestCommHandler_1.InngestCommHandler(Object.assign(Object.assign({ frameworkName: exports.frameworkName }, options), { handler: ({ request: req }) => {
|
|
50
|
+
return {
|
|
51
|
+
body: () => req.json(),
|
|
52
|
+
headers: (key) => req.headers.get(key),
|
|
53
|
+
method: () => req.method,
|
|
54
|
+
url: () => new URL(req.url, `https://${req.headers.get("host") || ""}`),
|
|
55
|
+
transformResponse: createNewResponse,
|
|
56
|
+
transformStreamingResponse: createNewResponse,
|
|
57
|
+
};
|
|
58
|
+
} }));
|
|
80
59
|
return handler.createHandler();
|
|
81
60
|
};
|
|
82
61
|
exports.serve = serve;
|
package/remix.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remix.js","sourceRoot":"","sources":["../src/remix.ts"],"names":[],"mappings":";;;AAAA,wEAIyC;
|
|
1
|
+
{"version":3,"file":"remix.js","sourceRoot":"","sources":["../src/remix.ts"],"names":[],"mappings":";;;AAAA,wEAIyC;AAG5B,QAAA,aAAa,GAA2B,OAAO,CAAC;AAE7D,MAAM,iBAAiB,GAAG,CAAC,EACzB,IAAI,EACJ,MAAM,EACN,OAAO,GACiC,EAAY,EAAE;IACtD;;;;OAIG;IACH,IAAI,GAAoB,CAAC;IAEzB,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;QACnC,mJAAmJ;QACnJ,GAAG,GAAG,OAAO,CAAC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