inngest 3.19.7 → 3.19.8
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 +8 -0
- package/README.md +1 -0
- package/astro.d.ts +24 -6
- package/astro.d.ts.map +1 -1
- package/astro.js +21 -2
- package/astro.js.map +1 -1
- package/bun.d.ts +48 -0
- package/bun.d.ts.map +1 -1
- package/bun.js +49 -0
- package/bun.js.map +1 -1
- package/cloudflare.d.ts +36 -1
- package/cloudflare.d.ts.map +1 -1
- package/cloudflare.js +36 -0
- package/cloudflare.js.map +1 -1
- package/deno/fresh.d.ts +34 -0
- package/deno/fresh.d.ts.map +1 -1
- package/deno/fresh.js +35 -0
- package/deno/fresh.js.map +1 -1
- package/digitalocean.d.ts +58 -2
- package/digitalocean.d.ts.map +1 -1
- package/digitalocean.js +57 -0
- package/digitalocean.js.map +1 -1
- package/edge.d.ts +23 -0
- package/edge.d.ts.map +1 -1
- package/edge.js +24 -0
- package/edge.js.map +1 -1
- package/express.d.ts +40 -0
- package/express.d.ts.map +1 -1
- package/express.js +41 -0
- package/express.js.map +1 -1
- package/fastify.d.ts +101 -0
- package/fastify.d.ts.map +1 -1
- package/fastify.js +101 -0
- package/fastify.js.map +1 -1
- package/h3.d.ts +56 -2
- package/h3.d.ts.map +1 -1
- package/h3.js +55 -0
- package/h3.js.map +1 -1
- package/hono.d.ts +23 -1
- package/hono.d.ts.map +1 -1
- package/hono.js +23 -0
- package/hono.js.map +1 -1
- package/index.d.ts +39 -0
- package/index.d.ts.map +1 -1
- package/index.js +39 -0
- package/index.js.map +1 -1
- package/koa.d.ts +24 -0
- package/koa.d.ts.map +1 -1
- package/koa.js +25 -0
- package/koa.js.map +1 -1
- package/lambda.d.ts +31 -2
- package/lambda.d.ts.map +1 -1
- package/lambda.js +30 -0
- package/lambda.js.map +1 -1
- package/next.d.ts +25 -0
- package/next.d.ts.map +1 -1
- package/next.js +26 -0
- package/next.js.map +1 -1
- package/nuxt.d.ts +12 -1
- package/nuxt.d.ts.map +1 -1
- package/nuxt.js +11 -0
- package/nuxt.js.map +1 -1
- package/package.json +1 -1
- package/redwood.d.ts +36 -0
- package/redwood.d.ts.map +1 -1
- package/redwood.js +37 -0
- package/redwood.js.map +1 -1
- package/remix.d.ts +21 -1
- package/remix.d.ts.map +1 -1
- package/remix.js +24 -3
- package/remix.js.map +1 -1
- package/sveltekit.d.ts +42 -5
- package/sveltekit.d.ts.map +1 -1
- package/sveltekit.js +42 -4
- package/sveltekit.js.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# inngest
|
|
2
2
|
|
|
3
|
+
## 3.19.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#584](https://github.com/inngest/inngest-js/pull/584) [`ab21a6e`](https://github.com/inngest/inngest-js/commit/ab21a6e1e5f527f97bd5972a41c2cd9339e75fc4) Thanks [@jpwilliams](https://github.com/jpwilliams)! - Add JSR badge to `README.md`
|
|
8
|
+
|
|
9
|
+
- [#587](https://github.com/inngest/inngest-js/pull/587) [`c51c3df`](https://github.com/inngest/inngest-js/commit/c51c3df373c2f6fbc3cf0276807bc7bb83db8f3f) Thanks [@jpwilliams](https://github.com/jpwilliams)! - Documented all entrypoints with `@module` comments
|
|
10
|
+
|
|
3
11
|
## 3.19.7
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
<a href="http://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TS-%3E%3D4.7-blue" /></a>
|
|
17
17
|
<a href="https://www.npmjs.com/package/inngest"><img src="https://img.shields.io/npm/v/inngest" /></a>
|
|
18
|
+
<a href="https://jsr.io/@inngest/sdk"><img src="https://jsr.io/badges/@inngest/sdk" /></a>
|
|
18
19
|
<br/>
|
|
19
20
|
<a href="https://www.inngest.com/discord"><img src="https://img.shields.io/discord/842170679536517141?label=discord" /></a>
|
|
20
21
|
<a href="https://twitter.com/inngest"><img src="https://img.shields.io/twitter/follow/inngest?style=social" /></a>
|
package/astro.d.ts
CHANGED
|
@@ -1,9 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An adapter for Astro to serve and register any declared functions with
|
|
3
|
+
* Inngest, making them available to be triggered by events.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* export const { GET, POST, PUT } = serve({
|
|
8
|
+
* client: inngest,
|
|
9
|
+
* functions: [fn1, fn2],
|
|
10
|
+
* });
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @module
|
|
14
|
+
*/
|
|
1
15
|
import { type ServeHandlerOptions } from "./components/InngestCommHandler";
|
|
2
16
|
import { type SupportedFrameworkName } from "./types";
|
|
17
|
+
/**
|
|
18
|
+
* The name of the framework, used to identify the framework in Inngest
|
|
19
|
+
* dashboards and during testing.
|
|
20
|
+
*/
|
|
3
21
|
export declare const frameworkName: SupportedFrameworkName;
|
|
4
22
|
/**
|
|
5
|
-
* In Astro, serve and register any declared functions with Inngest, making
|
|
6
|
-
*
|
|
23
|
+
* In Astro, serve and register any declared functions with Inngest, making them
|
|
24
|
+
* available to be triggered by events.
|
|
7
25
|
*
|
|
8
26
|
* @example
|
|
9
27
|
* ```ts
|
|
@@ -15,16 +33,16 @@ export declare const frameworkName: SupportedFrameworkName;
|
|
|
15
33
|
*
|
|
16
34
|
* @public
|
|
17
35
|
*/
|
|
18
|
-
export declare const serve: (options: ServeHandlerOptions) => ((
|
|
36
|
+
export declare const serve: (options: ServeHandlerOptions) => ((ctx: {
|
|
19
37
|
request: Request;
|
|
20
38
|
}) => Promise<Response>) & {
|
|
21
|
-
GET: (
|
|
39
|
+
GET: (ctx: {
|
|
22
40
|
request: Request;
|
|
23
41
|
}) => Promise<Response>;
|
|
24
|
-
POST: (
|
|
42
|
+
POST: (ctx: {
|
|
25
43
|
request: Request;
|
|
26
44
|
}) => Promise<Response>;
|
|
27
|
-
PUT: (
|
|
45
|
+
PUT: (ctx: {
|
|
28
46
|
request: Request;
|
|
29
47
|
}) => Promise<Response>;
|
|
30
48
|
};
|
package/astro.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astro.d.ts","sourceRoot":"","sources":["../src/astro.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,eAAO,MAAM,aAAa,EAAE,sBAAgC,CAAC;AAE7D;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"astro.d.ts","sourceRoot":"","sources":["../src/astro.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,sBAAgC,CAAC;AAE7D;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,KAAK,YACP,mBAAmB,YACpB;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,KAAK,QAAQ,QAAQ,CAAC;eACvC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,QAAQ,QAAQ,CAAC;gBACzC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,QAAQ,QAAQ,CAAC;eAC3C;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,QAAQ,QAAQ,CAAC;CA+BtD,CAAC"}
|
package/astro.js
CHANGED
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* An adapter for Astro to serve and register any declared functions with
|
|
4
|
+
* Inngest, making them available to be triggered by events.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* export const { GET, POST, PUT } = serve({
|
|
9
|
+
* client: inngest,
|
|
10
|
+
* functions: [fn1, fn2],
|
|
11
|
+
* });
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @module
|
|
15
|
+
*/
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
17
|
exports.serve = exports.frameworkName = void 0;
|
|
4
18
|
const InngestCommHandler_1 = require("./components/InngestCommHandler");
|
|
19
|
+
/**
|
|
20
|
+
* The name of the framework, used to identify the framework in Inngest
|
|
21
|
+
* dashboards and during testing.
|
|
22
|
+
*/
|
|
5
23
|
exports.frameworkName = "astro";
|
|
6
24
|
/**
|
|
7
|
-
* In Astro, serve and register any declared functions with Inngest, making
|
|
8
|
-
*
|
|
25
|
+
* In Astro, serve and register any declared functions with Inngest, making them
|
|
26
|
+
* available to be triggered by events.
|
|
9
27
|
*
|
|
10
28
|
* @example
|
|
11
29
|
* ```ts
|
|
@@ -17,6 +35,7 @@ exports.frameworkName = "astro";
|
|
|
17
35
|
*
|
|
18
36
|
* @public
|
|
19
37
|
*/
|
|
38
|
+
// Has explicit return type to avoid JSR-defined "slow types"
|
|
20
39
|
const serve = (options) => {
|
|
21
40
|
const commHandler = new InngestCommHandler_1.InngestCommHandler(Object.assign(Object.assign({ frameworkName: exports.frameworkName, fetch: fetch.bind(globalThis) }, options), { handler: ({ request: req }) => {
|
|
22
41
|
return {
|
package/astro.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astro.js","sourceRoot":"","sources":["../src/astro.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"astro.js","sourceRoot":"","sources":["../src/astro.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,wEAGyC;AAGzC;;;GAGG;AACU,QAAA,aAAa,GAA2B,O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HANGED
|
@@ -1,10 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An adapter for Bun to serve and register any declared functions with Inngest,
|
|
3
|
+
* making them available to be triggered by events.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { serve } from "inngest/bun";
|
|
8
|
+
* import { functions, inngest } from "./inngest";
|
|
9
|
+
*
|
|
10
|
+
* Bun.serve({
|
|
11
|
+
* port: 3000,
|
|
12
|
+
* fetch(request: Request) {
|
|
13
|
+
* const url = new URL(request.url);
|
|
14
|
+
*
|
|
15
|
+
* if (url.pathname === "/api/inngest") {
|
|
16
|
+
* return serve({ client: inngest, functions })(request);
|
|
17
|
+
* }
|
|
18
|
+
*
|
|
19
|
+
* return new Response("Not found", { status: 404 });
|
|
20
|
+
* },
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @module
|
|
25
|
+
*/
|
|
1
26
|
import { type ServeHandlerOptions } from "./components/InngestCommHandler";
|
|
2
27
|
import { type SupportedFrameworkName } from "./types";
|
|
28
|
+
/**
|
|
29
|
+
* The name of the framework, used to identify the framework in Inngest
|
|
30
|
+
* dashboards and during testing.
|
|
31
|
+
*/
|
|
3
32
|
export declare const frameworkName: SupportedFrameworkName;
|
|
4
33
|
/**
|
|
5
34
|
* Using `Bun.serve()`, serve and register any declared functions with Inngest,
|
|
6
35
|
* making them available to be triggered by events.
|
|
7
36
|
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* import { serve } from "inngest/bun";
|
|
40
|
+
* import { functions, inngest } from "./inngest";
|
|
41
|
+
*
|
|
42
|
+
* Bun.serve({
|
|
43
|
+
* port: 3000,
|
|
44
|
+
* fetch(request: Request) {
|
|
45
|
+
* const url = new URL(request.url);
|
|
46
|
+
*
|
|
47
|
+
* if (url.pathname === "/api/inngest") {
|
|
48
|
+
* return serve({ client: inngest, functions })(request);
|
|
49
|
+
* }
|
|
50
|
+
*
|
|
51
|
+
* return new Response("Not found", { status: 404 });
|
|
52
|
+
* },
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
8
56
|
* @public
|
|
9
57
|
*/
|
|
10
58
|
export declare const serve: (options: ServeHandlerOptions) => (req: Request) => Promise<Response>;
|
package/bun.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bun.d.ts","sourceRoot":"","sources":["../src/bun.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,sBAA8B,CAAC;AAE3D
|
|
1
|
+
{"version":3,"file":"bun.d.ts","sourceRoot":"","sources":["../src/bun.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,sBAA8B,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,eAAO,MAAM,KAAK,YACP,mBAAmB,WACpB,OAAO,KAAK,QAAQ,QAAQ,CAOrC,CAAC"}
|
package/bun.js
CHANGED
|
@@ -1,14 +1,63 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* An adapter for Bun to serve and register any declared functions with Inngest,
|
|
4
|
+
* making them available to be triggered by events.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { serve } from "inngest/bun";
|
|
9
|
+
* import { functions, inngest } from "./inngest";
|
|
10
|
+
*
|
|
11
|
+
* Bun.serve({
|
|
12
|
+
* port: 3000,
|
|
13
|
+
* fetch(request: Request) {
|
|
14
|
+
* const url = new URL(request.url);
|
|
15
|
+
*
|
|
16
|
+
* if (url.pathname === "/api/inngest") {
|
|
17
|
+
* return serve({ client: inngest, functions })(request);
|
|
18
|
+
* }
|
|
19
|
+
*
|
|
20
|
+
* return new Response("Not found", { status: 404 });
|
|
21
|
+
* },
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @module
|
|
26
|
+
*/
|
|
2
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
28
|
exports.serve = exports.frameworkName = void 0;
|
|
4
29
|
const edge_1 = require("./edge");
|
|
30
|
+
/**
|
|
31
|
+
* The name of the framework, used to identify the framework in Inngest
|
|
32
|
+
* dashboards and during testing.
|
|
33
|
+
*/
|
|
5
34
|
exports.frameworkName = "bun";
|
|
6
35
|
/**
|
|
7
36
|
* Using `Bun.serve()`, serve and register any declared functions with Inngest,
|
|
8
37
|
* making them available to be triggered by events.
|
|
9
38
|
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* import { serve } from "inngest/bun";
|
|
42
|
+
* import { functions, inngest } from "./inngest";
|
|
43
|
+
*
|
|
44
|
+
* Bun.serve({
|
|
45
|
+
* port: 3000,
|
|
46
|
+
* fetch(request: Request) {
|
|
47
|
+
* const url = new URL(request.url);
|
|
48
|
+
*
|
|
49
|
+
* if (url.pathname === "/api/inngest") {
|
|
50
|
+
* return serve({ client: inngest, functions })(request);
|
|
51
|
+
* }
|
|
52
|
+
*
|
|
53
|
+
* return new Response("Not found", { status: 404 });
|
|
54
|
+
* },
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
10
58
|
* @public
|
|
11
59
|
*/
|
|
60
|
+
// Has explicit return type to avoid JSR-defined "slow types"
|
|
12
61
|
const serve = (options) => {
|
|
13
62
|
const optsOverrides = Object.assign(Object.assign({}, options), { frameworkName: exports.frameworkName });
|
|
14
63
|
return (0, edge_1.serve)(optsOverrides);
|
package/bun.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bun.js","sourceRoot":"","sources":["../src/bun.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"bun.js","sourceRoot":"","sources":["../src/bun.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;;;AAMH,iCAA4C;AAG5C;;;GAGG;AACU,QAAA,aAAa,GAA2B,KAAK,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,6DAA6D;AACtD,MAAM,KAAK,GAAG,CACnB,OAA4B,EACW,EAAE;IACzC,MAAM,aAAa,mCACd,OAAO,KACV,aAAa,EAAb,qBAAa,GACd,CAAC;IAEF,OAAO,IAAA,YAAS,EAAC,aAAa,CAAC,CAAC;AAClC,CAAC,CAAC;AATW,QAAA,KAAK,SAShB"}
|
package/cloudflare.d.ts
CHANGED
|
@@ -1,13 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An adapter for Cloudflare Workers (and Workers on Pages) to serve and
|
|
3
|
+
* register any declared functions with Inngest, making them available to be
|
|
4
|
+
* triggered by events.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { serve } from "inngest/cloudflare";
|
|
9
|
+
* import { inngest } from "../../inngest/client";
|
|
10
|
+
* import fnA from "../../inngest/fnA"; // Your own function
|
|
11
|
+
*
|
|
12
|
+
* export const onRequest = serve({
|
|
13
|
+
* client: inngest,
|
|
14
|
+
* functions: [fnA],
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @module
|
|
19
|
+
*/
|
|
1
20
|
import { type ServeHandlerOptions } from "./components/InngestCommHandler";
|
|
2
21
|
import { type SupportedFrameworkName } from "./types";
|
|
22
|
+
/**
|
|
23
|
+
* The name of the framework, used to identify the framework in Inngest
|
|
24
|
+
* dashboards and during testing.
|
|
25
|
+
*/
|
|
3
26
|
export declare const frameworkName: SupportedFrameworkName;
|
|
4
27
|
/**
|
|
5
28
|
* In Cloudflare, serve and register any declared functions with Inngest, making
|
|
6
29
|
* them available to be triggered by events.
|
|
7
30
|
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* import { serve } from "inngest/cloudflare";
|
|
34
|
+
* import { inngest } from "../../inngest/client";
|
|
35
|
+
* import fnA from "../../inngest/fnA"; // Your own function
|
|
36
|
+
*
|
|
37
|
+
* export const onRequest = serve({
|
|
38
|
+
* client: inngest,
|
|
39
|
+
* functions: [fnA],
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
8
43
|
* @public
|
|
9
44
|
*/
|
|
10
|
-
export declare const serve: (options: ServeHandlerOptions) => (
|
|
45
|
+
export declare const serve: (options: ServeHandlerOptions) => (ctx: {
|
|
11
46
|
request: Request;
|
|
12
47
|
env: Record<string, string | undefined>;
|
|
13
48
|
}) => Promise<Response>;
|
package/cloudflare.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudflare.d.ts","sourceRoot":"","sources":["../src/cloudflare.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,eAAO,MAAM,aAAa,EAAE,sBAA2C,CAAC;AAExE
|
|
1
|
+
{"version":3,"file":"cloudflare.d.ts","sourceRoot":"","sources":["../src/cloudflare.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,sBAA2C,CAAC;AAExE;;;;;;;;;;;;;;;;;GAiBG;AAEH,eAAO,MAAM,KAAK,YACP,mBAAmB,WACpB;IACR,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,OAAO,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CACzC,KAAK,QAAQ,QAAQ,CAmCrB,CAAC"}
|
package/cloudflare.js
CHANGED
|
@@ -1,14 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* An adapter for Cloudflare Workers (and Workers on Pages) to serve and
|
|
4
|
+
* register any declared functions with Inngest, making them available to be
|
|
5
|
+
* triggered by events.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { serve } from "inngest/cloudflare";
|
|
10
|
+
* import { inngest } from "../../inngest/client";
|
|
11
|
+
* import fnA from "../../inngest/fnA"; // Your own function
|
|
12
|
+
*
|
|
13
|
+
* export const onRequest = serve({
|
|
14
|
+
* client: inngest,
|
|
15
|
+
* functions: [fnA],
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @module
|
|
20
|
+
*/
|
|
2
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
22
|
exports.serve = exports.frameworkName = void 0;
|
|
4
23
|
const InngestCommHandler_1 = require("./components/InngestCommHandler");
|
|
24
|
+
/**
|
|
25
|
+
* The name of the framework, used to identify the framework in Inngest
|
|
26
|
+
* dashboards and during testing.
|
|
27
|
+
*/
|
|
5
28
|
exports.frameworkName = "cloudflare-pages";
|
|
6
29
|
/**
|
|
7
30
|
* In Cloudflare, serve and register any declared functions with Inngest, making
|
|
8
31
|
* them available to be triggered by events.
|
|
9
32
|
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* import { serve } from "inngest/cloudflare";
|
|
36
|
+
* import { inngest } from "../../inngest/client";
|
|
37
|
+
* import fnA from "../../inngest/fnA"; // Your own function
|
|
38
|
+
*
|
|
39
|
+
* export const onRequest = serve({
|
|
40
|
+
* client: inngest,
|
|
41
|
+
* functions: [fnA],
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
10
45
|
* @public
|
|
11
46
|
*/
|
|
47
|
+
// Has explicit return type to avoid JSR-defined "slow types"
|
|
12
48
|
const serve = (options) => {
|
|
13
49
|
const handler = new InngestCommHandler_1.InngestCommHandler(Object.assign(Object.assign({ frameworkName: exports.frameworkName,
|
|
14
50
|
/**
|
package/cloudflare.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudflare.js","sourceRoot":"","sources":["../src/cloudflare.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"cloudflare.js","sourceRoot":"","sources":["../src/cloudflare.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAEH,wEAGyC;AAGzC;;;GAGG;AACU,QAAA,aAAa,GAA2B,kBAAkB,CAAC;AAExE;;;;;;;;;;;;;;;;;GAiBG;AACH,6DAA6D;AACtD,MAAM,KAAK,GAAG,CACnB,OAA4B,EAIL,EAAE;IACzB,MAAM,OAAO,GAAG,IAAI,uCAAkB,+BACpC,aAAa,EAAb,qBAAa;QAEb;;;;WAIG;QACH,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAC1B,OAAO,KACV,OAAO,EAAE,CAAC,EACR,OAAO,EAAE,GAAG,EACZ,GAAG,GAIJ,EAAE,EAAE;YACH,OAAO;gBACL,IAAI,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE;gBACtB,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;gBACtC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM;gBACxB,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG;gBACd,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;gBACvE,iBAAiB,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;oBAC/C,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE;wBACxB,MAAM;wBACN,OAAO;qBACR,CAAC,CAAC;gBACL,CAAC;aACF,CAAC;QACJ,CAAC,IACD,CAAC;IAEH,OAAO,OAAO,CAAC,aAAa,EAAE,CAAC;AACjC,CAAC,CAAC;AAxCW,QAAA,KAAK,SAwChB"}
|
package/deno/fresh.d.ts
CHANGED
|
@@ -1,10 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An adapter for Deno's Fresh to serve and register any declared functions with
|
|
3
|
+
* Inngest, making them available to be triggered by events.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { serve } from "https://esm.sh/inngest/deno/fresh";
|
|
8
|
+
* import { inngest } from "./src/inngest/client.ts";
|
|
9
|
+
* import fnA from "./src/inngest/fnA"; // Your own function
|
|
10
|
+
*
|
|
11
|
+
* export const handler = serve({
|
|
12
|
+
* client: inngest,
|
|
13
|
+
* functions: [fnA],
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @module
|
|
18
|
+
*/
|
|
1
19
|
import { type ServeHandlerOptions } from "../components/InngestCommHandler";
|
|
2
20
|
import { type SupportedFrameworkName } from "../types";
|
|
21
|
+
/**
|
|
22
|
+
* The name of the framework, used to identify the framework in Inngest
|
|
23
|
+
* dashboards and during testing.
|
|
24
|
+
*/
|
|
3
25
|
export declare const frameworkName: SupportedFrameworkName;
|
|
4
26
|
/**
|
|
5
27
|
* With Deno's Fresh framework, serve and register any declared functions with
|
|
6
28
|
* Inngest, making them available to be triggered by events.
|
|
7
29
|
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* import { serve } from "https://esm.sh/inngest/deno/fresh";
|
|
33
|
+
* import { inngest } from "./src/inngest/client.ts";
|
|
34
|
+
* import fnA from "./src/inngest/fnA"; // Your own function
|
|
35
|
+
*
|
|
36
|
+
* export const handler = serve({
|
|
37
|
+
* client: inngest,
|
|
38
|
+
* functions: [fnA],
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
8
42
|
* @public
|
|
9
43
|
*/
|
|
10
44
|
export declare const serve: (options: ServeHandlerOptions) => (req: Request) => Promise<Response>;
|
package/deno/fresh.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fresh.d.ts","sourceRoot":"","sources":["../../src/deno/fresh.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEvD,eAAO,MAAM,aAAa,EAAE,sBAAqC,CAAC;AAElE
|
|
1
|
+
{"version":3,"file":"fresh.d.ts","sourceRoot":"","sources":["../../src/deno/fresh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,sBAAqC,CAAC;AAElE;;;;;;;;;;;;;;;;;GAiBG;AAEH,eAAO,MAAM,KAAK,YACP,mBAAmB,WACpB,OAAO,KAAK,QAAQ,QAAQ,CAuBrC,CAAC"}
|
package/deno/fresh.js
CHANGED
|
@@ -1,14 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* An adapter for Deno's Fresh to serve and register any declared functions with
|
|
4
|
+
* Inngest, making them available to be triggered by events.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { serve } from "https://esm.sh/inngest/deno/fresh";
|
|
9
|
+
* import { inngest } from "./src/inngest/client.ts";
|
|
10
|
+
* import fnA from "./src/inngest/fnA"; // Your own function
|
|
11
|
+
*
|
|
12
|
+
* export const handler = serve({
|
|
13
|
+
* client: inngest,
|
|
14
|
+
* functions: [fnA],
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @module
|
|
19
|
+
*/
|
|
2
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
21
|
exports.serve = exports.frameworkName = void 0;
|
|
4
22
|
const InngestCommHandler_1 = require("../components/InngestCommHandler");
|
|
23
|
+
/**
|
|
24
|
+
* The name of the framework, used to identify the framework in Inngest
|
|
25
|
+
* dashboards and during testing.
|
|
26
|
+
*/
|
|
5
27
|
exports.frameworkName = "deno/fresh";
|
|
6
28
|
/**
|
|
7
29
|
* With Deno's Fresh framework, serve and register any declared functions with
|
|
8
30
|
* Inngest, making them available to be triggered by events.
|
|
9
31
|
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { serve } from "https://esm.sh/inngest/deno/fresh";
|
|
35
|
+
* import { inngest } from "./src/inngest/client.ts";
|
|
36
|
+
* import fnA from "./src/inngest/fnA"; // Your own function
|
|
37
|
+
*
|
|
38
|
+
* export const handler = serve({
|
|
39
|
+
* client: inngest,
|
|
40
|
+
* functions: [fnA],
|
|
41
|
+
* });
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
10
44
|
* @public
|
|
11
45
|
*/
|
|
46
|
+
// Has explicit return type to avoid JSR-defined "slow types"
|
|
12
47
|
const serve = (options) => {
|
|
13
48
|
const handler = new InngestCommHandler_1.InngestCommHandler(Object.assign(Object.assign({ frameworkName: exports.frameworkName }, options), { handler: (req, env) => {
|
|
14
49
|
return {
|
package/deno/fresh.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fresh.js","sourceRoot":"","sources":["../../src/deno/fresh.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"fresh.js","sourceRoot":"","sources":["../../src/deno/fresh.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAEH,yEAG0C;AAG1C;;;GAGG;AACU,QAAA,aAAa,GAA2B,YAAY,CAAC;AAElE;;;;;;;;;;;;;;;;;GAiBG;AACH,6DAA6D;AACtD,MAAM,KAAK,GAAG,CACnB,OAA4B,EACW,EAAE;IACzC,MAAM,OAAO,GAAG,IAAI,uCAAkB,+BACpC,aAAa,EAAb,qBAAa,IACV,OAAO,KACV,OAAO,EAAE,CAAC,GAAY,EAAE,GAA2B,EAAE,EAAE;YACrD,OAAO;gBACL,IAAI,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE;gBACtB,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;gBACtC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM;gBACxB,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG;gBACd,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;gBACvE,iBAAiB,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;oBAC/C,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;gBACjD,CAAC;aACF,CAAC;QACJ,CAAC,IACD,CAAC;IAEH,MAAM,EAAE,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAEnC,OAAO,SAAS,aAAa,CAAC,GAAY;QACxC,OAAO,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IACtC,CAAC,CAAC;AACJ,CAAC,CAAC;AAzBW,QAAA,KAAK,SAyBhB"}
|
package/digitalocean.d.ts
CHANGED
|
@@ -1,4 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* An adapter for DigitalOcean Functions to serve and register any declared
|
|
3
|
+
* functions with Inngest, making them available to be triggered by events.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { serve } from "inngest/digitalocean";
|
|
8
|
+
* import { inngest } from "./src/inngest/client";
|
|
9
|
+
* import fnA from "./src/inngest/fnA"; // Your own function
|
|
10
|
+
*
|
|
11
|
+
* const main = serve({
|
|
12
|
+
* client: inngest,
|
|
13
|
+
* functions: [fnA],
|
|
14
|
+
* // Your digitalocean hostname. This is required otherwise your functions won't work.
|
|
15
|
+
* serveHost: "https://faas-sfo3-your-url.doserverless.co",
|
|
16
|
+
* // And your DO path, also required.
|
|
17
|
+
* servePath: "/api/v1/web/fn-your-uuid/inngest",
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* // IMPORTANT: Makes the function available as a module in the project.
|
|
21
|
+
* // This is required for any functions that require external dependencies.
|
|
22
|
+
* module.exports.main = main;
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @module
|
|
26
|
+
*/
|
|
27
|
+
import { type ActionResponse, type ServeHandlerOptions } from "./components/InngestCommHandler";
|
|
2
28
|
import { type SupportedFrameworkName } from "./types";
|
|
3
29
|
type HTTP = {
|
|
4
30
|
headers: Record<string, string>;
|
|
@@ -9,7 +35,37 @@ type Main = {
|
|
|
9
35
|
http?: HTTP;
|
|
10
36
|
[data: string]: unknown;
|
|
11
37
|
} | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* The name of the framework, used to identify the framework in Inngest
|
|
40
|
+
* dashboards and during testing.
|
|
41
|
+
*/
|
|
12
42
|
export declare const frameworkName: SupportedFrameworkName;
|
|
13
|
-
|
|
43
|
+
/**
|
|
44
|
+
* In DigitalOcean Functions, serve and register any declared functions with
|
|
45
|
+
* Inngest, making them available to be triggered by events.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* import { serve } from "inngest/digitalocean";
|
|
50
|
+
* import { inngest } from "./src/inngest/client";
|
|
51
|
+
* import fnA from "./src/inngest/fnA"; // Your own function
|
|
52
|
+
*
|
|
53
|
+
* const main = serve({
|
|
54
|
+
* client: inngest,
|
|
55
|
+
* functions: [fnA],
|
|
56
|
+
* // Your digitalocean hostname. This is required otherwise your functions won't work.
|
|
57
|
+
* serveHost: "https://faas-sfo3-your-url.doserverless.co",
|
|
58
|
+
* // And your DO path, also required.
|
|
59
|
+
* servePath: "/api/v1/web/fn-your-uuid/inngest",
|
|
60
|
+
* });
|
|
61
|
+
*
|
|
62
|
+
* // IMPORTANT: Makes the function available as a module in the project.
|
|
63
|
+
* // This is required for any functions that require external dependencies.
|
|
64
|
+
* module.exports.main = main;
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
|
+
export declare const serve: (options: ServeHandlerOptions & Required<Pick<NonNullable<ServeHandlerOptions>, "serveHost">>) => (main?: Main) => Promise<ActionResponse<string>>;
|
|
14
70
|
export {};
|
|
15
71
|
//# sourceMappingURL=digitalocean.d.ts.map
|
package/digitalocean.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"digitalocean.d.ts","sourceRoot":"","sources":["../src/digitalocean.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM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
2
|
+
/**
|
|
3
|
+
* An adapter for DigitalOcean Functions to serve and register any declared
|
|
4
|
+
* functions with Inngest, making them available to be triggered by events.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { serve } from "inngest/digitalocean";
|
|
9
|
+
* import { inngest } from "./src/inngest/client";
|
|
10
|
+
* import fnA from "./src/inngest/fnA"; // Your own function
|
|
11
|
+
*
|
|
12
|
+
* const main = serve({
|
|
13
|
+
* client: inngest,
|
|
14
|
+
* functions: [fnA],
|
|
15
|
+
* // Your digitalocean hostname. This is required otherwise your functions won't work.
|
|
16
|
+
* serveHost: "https://faas-sfo3-your-url.doserverless.co",
|
|
17
|
+
* // And your DO path, also required.
|
|
18
|
+
* servePath: "/api/v1/web/fn-your-uuid/inngest",
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* // IMPORTANT: Makes the function available as a module in the project.
|
|
22
|
+
* // This is required for any functions that require external dependencies.
|
|
23
|
+
* module.exports.main = main;
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @module
|
|
27
|
+
*/
|
|
2
28
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
29
|
var t = {};
|
|
4
30
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -13,7 +39,38 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
40
|
exports.serve = exports.frameworkName = void 0;
|
|
15
41
|
const InngestCommHandler_1 = require("./components/InngestCommHandler");
|
|
42
|
+
/**
|
|
43
|
+
* The name of the framework, used to identify the framework in Inngest
|
|
44
|
+
* dashboards and during testing.
|
|
45
|
+
*/
|
|
16
46
|
exports.frameworkName = "digitalocean";
|
|
47
|
+
/**
|
|
48
|
+
* In DigitalOcean Functions, serve and register any declared functions with
|
|
49
|
+
* Inngest, making them available to be triggered by events.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* import { serve } from "inngest/digitalocean";
|
|
54
|
+
* import { inngest } from "./src/inngest/client";
|
|
55
|
+
* import fnA from "./src/inngest/fnA"; // Your own function
|
|
56
|
+
*
|
|
57
|
+
* const main = serve({
|
|
58
|
+
* client: inngest,
|
|
59
|
+
* functions: [fnA],
|
|
60
|
+
* // Your digitalocean hostname. This is required otherwise your functions won't work.
|
|
61
|
+
* serveHost: "https://faas-sfo3-your-url.doserverless.co",
|
|
62
|
+
* // And your DO path, also required.
|
|
63
|
+
* servePath: "/api/v1/web/fn-your-uuid/inngest",
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* // IMPORTANT: Makes the function available as a module in the project.
|
|
67
|
+
* // This is required for any functions that require external dependencies.
|
|
68
|
+
* module.exports.main = main;
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @public
|
|
72
|
+
*/
|
|
73
|
+
// Has explicit return type to avoid JSR-defined "slow types"
|
|
17
74
|
const serve = (options) => {
|
|
18
75
|
const handler = new InngestCommHandler_1.InngestCommHandler(Object.assign(Object.assign({ frameworkName: exports.frameworkName }, options), { handler: (main = {}) => {
|
|
19
76
|
const { http = { method: "GET", headers: {}, path: "" } } = main, data = __rest(main, ["http"]);
|
package/digitalocean.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"digitalocean.js","sourceRoot":"","sources":["../src/digitalocean.ts"],"names":[],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"digitalocean.js","sourceRoot":"","sources":["../src/digitalocean.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;;;;;;;;;;;;;;AAEH,wEAIyC;AAiBzC;;;GAGG;AACU,QAAA,aAAa,GAA2B,cAAc,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,6DAA6D;AACtD,MAAM,KAAK,GAAG,CACn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