@upstash/workflow 0.2.20 → 0.2.21
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/astro.js +18 -6
- package/astro.mjs +2 -2
- package/{chunk-LZGX3WMF.mjs → chunk-NQDNC5P4.mjs} +17 -5
- package/cloudflare.js +17 -5
- package/cloudflare.mjs +1 -1
- package/express.js +17 -5
- package/express.mjs +1 -1
- package/h3.js +17 -5
- package/h3.mjs +1 -1
- package/hono.js +17 -5
- package/hono.mjs +1 -1
- package/index.d.mts +7 -0
- package/index.d.ts +7 -0
- package/index.js +19 -6
- package/index.mjs +3 -2
- package/nextjs.js +17 -5
- package/nextjs.mjs +1 -1
- package/package.json +1 -1
- package/solidjs.js +17 -5
- package/solidjs.mjs +1 -1
- package/svelte.js +17 -5
- package/svelte.mjs +1 -1
- package/tanstack.d.mts +36 -0
- package/tanstack.d.ts +36 -0
- package/tanstack.js +3737 -0
- package/tanstack.mjs +48 -0
package/tanstack.mjs
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SDK_TELEMETRY,
|
|
3
|
+
serveBase,
|
|
4
|
+
serveManyBase
|
|
5
|
+
} from "./chunk-NQDNC5P4.mjs";
|
|
6
|
+
|
|
7
|
+
// platforms/tanstack.ts
|
|
8
|
+
var telemetry = {
|
|
9
|
+
sdk: SDK_TELEMETRY,
|
|
10
|
+
framework: "tanstack",
|
|
11
|
+
runtime: `node@${process.version}`
|
|
12
|
+
};
|
|
13
|
+
function serve(routeFunction, options) {
|
|
14
|
+
const POST = (tanstackContext) => {
|
|
15
|
+
const { handler } = serveBase(
|
|
16
|
+
routeFunction,
|
|
17
|
+
telemetry,
|
|
18
|
+
options
|
|
19
|
+
);
|
|
20
|
+
return handler(tanstackContext.request);
|
|
21
|
+
};
|
|
22
|
+
return { POST };
|
|
23
|
+
}
|
|
24
|
+
var createWorkflow = (...params) => {
|
|
25
|
+
const [routeFunction, options = {}] = params;
|
|
26
|
+
return {
|
|
27
|
+
options,
|
|
28
|
+
workflowId: void 0,
|
|
29
|
+
routeFunction
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
var serveMany = (workflows, options) => {
|
|
33
|
+
return {
|
|
34
|
+
POST: serveManyBase({
|
|
35
|
+
workflows,
|
|
36
|
+
getUrl(context) {
|
|
37
|
+
return context.request.url;
|
|
38
|
+
},
|
|
39
|
+
serveMethod: (...params) => serve(...params).POST,
|
|
40
|
+
options
|
|
41
|
+
}).handler
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
createWorkflow,
|
|
46
|
+
serve,
|
|
47
|
+
serveMany
|
|
48
|
+
};
|