@upstash/workflow 1.1.0 → 1.1.1
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.d.mts +2 -2
- package/astro.d.ts +2 -2
- package/astro.js +28 -2
- package/astro.mjs +1 -1
- package/{chunk-C5HFGF7Q.mjs → chunk-QRCGBBFJ.mjs} +28 -2
- package/cloudflare.d.mts +2 -2
- package/cloudflare.d.ts +2 -2
- package/cloudflare.js +28 -2
- package/cloudflare.mjs +1 -1
- package/express.d.mts +2 -2
- package/express.d.ts +2 -2
- package/express.js +28 -2
- package/express.mjs +1 -1
- package/h3.d.mts +2 -2
- package/h3.d.ts +2 -2
- package/h3.js +32 -6
- package/h3.mjs +5 -5
- package/hono.d.mts +2 -2
- package/hono.d.ts +2 -2
- package/hono.js +28 -2
- package/hono.mjs +1 -1
- package/index.d.mts +3 -3
- package/index.d.ts +3 -3
- package/index.js +31 -3
- package/index.mjs +4 -2
- package/nextjs.d.mts +2 -2
- package/nextjs.d.ts +2 -2
- package/nextjs.js +28 -2
- package/nextjs.mjs +1 -1
- package/package.json +1 -1
- package/react-router.d.mts +38 -0
- package/react-router.d.ts +38 -0
- package/react-router.js +3861 -0
- package/react-router.mjs +45 -0
- package/{serve-many-qnfynN1x.d.ts → serve-many-BP-8Ytbc.d.ts} +1 -1
- package/{serve-many-DhB8-zPD.d.mts → serve-many-BsycEL_d.d.mts} +1 -1
- package/solidjs.d.mts +1 -1
- package/solidjs.d.ts +1 -1
- package/solidjs.js +28 -2
- package/solidjs.mjs +1 -1
- package/svelte.d.mts +2 -2
- package/svelte.d.ts +2 -2
- package/svelte.js +28 -2
- package/svelte.mjs +1 -1
- package/tanstack.d.mts +2 -2
- package/tanstack.d.ts +2 -2
- package/tanstack.js +28 -2
- package/tanstack.mjs +1 -1
- package/{types-pEje3VEB.d.ts → types-B90SJYZV.d.mts} +9 -2
- package/{types-pEje3VEB.d.mts → types-B90SJYZV.d.ts} +9 -2
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { c as RouteFunction, d as WorkflowServeOptions, I as InvokableWorkflow } from './types-B90SJYZV.mjs';
|
|
2
|
+
import { s as serveManyBase } from './serve-many-BsycEL_d.mjs';
|
|
3
|
+
import '@upstash/qstash';
|
|
4
|
+
import 'zod';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Serve method to serve an Upstash Workflow in a React Router v7 project
|
|
8
|
+
*
|
|
9
|
+
* Use this in your route's action function to handle workflow requests.
|
|
10
|
+
*
|
|
11
|
+
* See for options https://upstash.com/docs/qstash/workflows/basics/serve
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* import { serve } from "@upstash/workflow/react-router";
|
|
16
|
+
*
|
|
17
|
+
* export const action = serve<{ message: string }>(
|
|
18
|
+
* async (context) => {
|
|
19
|
+
* const input = context.requestPayload;
|
|
20
|
+
* await context.sleep("sleep", 10);
|
|
21
|
+
* console.log("Workflow completed:", input.message);
|
|
22
|
+
* }
|
|
23
|
+
* );
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @param routeFunction workflow function
|
|
27
|
+
* @param options workflow options
|
|
28
|
+
* @returns action function compatible with React Router v7
|
|
29
|
+
*/
|
|
30
|
+
declare const serve: <TInitialPayload = unknown, TResult = unknown>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: WorkflowServeOptions<TInitialPayload, TResult>) => ({ request }: {
|
|
31
|
+
request: Request;
|
|
32
|
+
}) => Promise<Response>;
|
|
33
|
+
declare const createWorkflow: <TInitialPayload, TResult>(...params: Parameters<typeof serve<TInitialPayload, TResult>>) => InvokableWorkflow<TInitialPayload, TResult>;
|
|
34
|
+
declare const serveMany: (workflows: Parameters<typeof serveManyBase>[0]["workflows"], options?: Parameters<typeof serveManyBase>[0]["options"]) => (params_0: {
|
|
35
|
+
request: Request;
|
|
36
|
+
}) => Promise<any>;
|
|
37
|
+
|
|
38
|
+
export { createWorkflow, serve, serveMany };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { c as RouteFunction, d as WorkflowServeOptions, I as InvokableWorkflow } from './types-B90SJYZV.js';
|
|
2
|
+
import { s as serveManyBase } from './serve-many-BP-8Ytbc.js';
|
|
3
|
+
import '@upstash/qstash';
|
|
4
|
+
import 'zod';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Serve method to serve an Upstash Workflow in a React Router v7 project
|
|
8
|
+
*
|
|
9
|
+
* Use this in your route's action function to handle workflow requests.
|
|
10
|
+
*
|
|
11
|
+
* See for options https://upstash.com/docs/qstash/workflows/basics/serve
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* import { serve } from "@upstash/workflow/react-router";
|
|
16
|
+
*
|
|
17
|
+
* export const action = serve<{ message: string }>(
|
|
18
|
+
* async (context) => {
|
|
19
|
+
* const input = context.requestPayload;
|
|
20
|
+
* await context.sleep("sleep", 10);
|
|
21
|
+
* console.log("Workflow completed:", input.message);
|
|
22
|
+
* }
|
|
23
|
+
* );
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @param routeFunction workflow function
|
|
27
|
+
* @param options workflow options
|
|
28
|
+
* @returns action function compatible with React Router v7
|
|
29
|
+
*/
|
|
30
|
+
declare const serve: <TInitialPayload = unknown, TResult = unknown>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: WorkflowServeOptions<TInitialPayload, TResult>) => ({ request }: {
|
|
31
|
+
request: Request;
|
|
32
|
+
}) => Promise<Response>;
|
|
33
|
+
declare const createWorkflow: <TInitialPayload, TResult>(...params: Parameters<typeof serve<TInitialPayload, TResult>>) => InvokableWorkflow<TInitialPayload, TResult>;
|
|
34
|
+
declare const serveMany: (workflows: Parameters<typeof serveManyBase>[0]["workflows"], options?: Parameters<typeof serveManyBase>[0]["options"]) => (params_0: {
|
|
35
|
+
request: Request;
|
|
36
|
+
}) => Promise<any>;
|
|
37
|
+
|
|
38
|
+
export { createWorkflow, serve, serveMany };
|