@upstash/workflow 0.1.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/LICENSE +21 -0
- package/README.md +3 -0
- package/chunk-JDMP6KKR.mjs +2006 -0
- package/cloudflare.d.mts +33 -0
- package/cloudflare.d.ts +33 -0
- package/cloudflare.js +2017 -0
- package/cloudflare.mjs +37 -0
- package/h3.d.mts +10 -0
- package/h3.d.ts +10 -0
- package/h3.js +2328 -0
- package/h3.mjs +348 -0
- package/hono.d.mts +25 -0
- package/hono.d.ts +25 -0
- package/hono.js +2002 -0
- package/hono.mjs +22 -0
- package/index.d.mts +57 -0
- package/index.d.ts +57 -0
- package/index.js +2038 -0
- package/index.mjs +18 -0
- package/nextjs.d.mts +18 -0
- package/nextjs.d.ts +18 -0
- package/nextjs.js +2022 -0
- package/nextjs.mjs +41 -0
- package/package.json +99 -0
- package/solidjs.d.mts +16 -0
- package/solidjs.d.ts +16 -0
- package/solidjs.js +2001 -0
- package/solidjs.mjs +21 -0
- package/svelte.d.mts +18 -0
- package/svelte.d.ts +18 -0
- package/svelte.js +1995 -0
- package/svelte.mjs +15 -0
- package/types-CfN1Epuj.d.mts +616 -0
- package/types-CfN1Epuj.d.ts +616 -0
package/cloudflare.mjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
serve
|
|
3
|
+
} from "./chunk-JDMP6KKR.mjs";
|
|
4
|
+
|
|
5
|
+
// platforms/cloudflare.ts
|
|
6
|
+
var getArgs = (args) => {
|
|
7
|
+
if (!Array.isArray(args) || args.length === 0) {
|
|
8
|
+
throw new Error("No arguments passed to serve handler");
|
|
9
|
+
}
|
|
10
|
+
if (typeof args[0] === "object" && "request" in args[0] && "env" in args[0]) {
|
|
11
|
+
return {
|
|
12
|
+
request: args[0].request,
|
|
13
|
+
env: args[0].env
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
if (args.length > 1 && typeof args[1] === "object") {
|
|
17
|
+
return {
|
|
18
|
+
request: args[0],
|
|
19
|
+
env: args[1]
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
throw new Error("Could not derive handler arguments from input. Please check how serve is used.");
|
|
23
|
+
};
|
|
24
|
+
var serve2 = (routeFunction, options) => {
|
|
25
|
+
const handler = async (...args) => {
|
|
26
|
+
const { request, env } = getArgs(args);
|
|
27
|
+
const serveHandler = serve(routeFunction, {
|
|
28
|
+
env,
|
|
29
|
+
...options
|
|
30
|
+
});
|
|
31
|
+
return await serveHandler(request);
|
|
32
|
+
};
|
|
33
|
+
return handler;
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
serve2 as serve
|
|
37
|
+
};
|
package/h3.d.mts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as h3 from 'h3';
|
|
2
|
+
import { R as RouteFunction, W as WorkflowServeOptions } from './types-CfN1Epuj.mjs';
|
|
3
|
+
import '@upstash/qstash';
|
|
4
|
+
|
|
5
|
+
declare const serve: <TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options?: Omit<WorkflowServeOptions<Response, TInitialPayload>, "onStepFinish">) => h3.EventHandler<h3.EventHandlerRequest, Promise<Response | {
|
|
6
|
+
status: number;
|
|
7
|
+
body: string;
|
|
8
|
+
}>>;
|
|
9
|
+
|
|
10
|
+
export { serve };
|
package/h3.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as h3 from 'h3';
|
|
2
|
+
import { R as RouteFunction, W as WorkflowServeOptions } from './types-CfN1Epuj.js';
|
|
3
|
+
import '@upstash/qstash';
|
|
4
|
+
|
|
5
|
+
declare const serve: <TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options?: Omit<WorkflowServeOptions<Response, TInitialPayload>, "onStepFinish">) => h3.EventHandler<h3.EventHandlerRequest, Promise<Response | {
|
|
6
|
+
status: number;
|
|
7
|
+
body: string;
|
|
8
|
+
}>>;
|
|
9
|
+
|
|
10
|
+
export { serve };
|