@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.
Files changed (50) hide show
  1. package/astro.d.mts +2 -2
  2. package/astro.d.ts +2 -2
  3. package/astro.js +28 -2
  4. package/astro.mjs +1 -1
  5. package/{chunk-C5HFGF7Q.mjs → chunk-QRCGBBFJ.mjs} +28 -2
  6. package/cloudflare.d.mts +2 -2
  7. package/cloudflare.d.ts +2 -2
  8. package/cloudflare.js +28 -2
  9. package/cloudflare.mjs +1 -1
  10. package/express.d.mts +2 -2
  11. package/express.d.ts +2 -2
  12. package/express.js +28 -2
  13. package/express.mjs +1 -1
  14. package/h3.d.mts +2 -2
  15. package/h3.d.ts +2 -2
  16. package/h3.js +32 -6
  17. package/h3.mjs +5 -5
  18. package/hono.d.mts +2 -2
  19. package/hono.d.ts +2 -2
  20. package/hono.js +28 -2
  21. package/hono.mjs +1 -1
  22. package/index.d.mts +3 -3
  23. package/index.d.ts +3 -3
  24. package/index.js +31 -3
  25. package/index.mjs +4 -2
  26. package/nextjs.d.mts +2 -2
  27. package/nextjs.d.ts +2 -2
  28. package/nextjs.js +28 -2
  29. package/nextjs.mjs +1 -1
  30. package/package.json +1 -1
  31. package/react-router.d.mts +38 -0
  32. package/react-router.d.ts +38 -0
  33. package/react-router.js +3861 -0
  34. package/react-router.mjs +45 -0
  35. package/{serve-many-qnfynN1x.d.ts → serve-many-BP-8Ytbc.d.ts} +1 -1
  36. package/{serve-many-DhB8-zPD.d.mts → serve-many-BsycEL_d.d.mts} +1 -1
  37. package/solidjs.d.mts +1 -1
  38. package/solidjs.d.ts +1 -1
  39. package/solidjs.js +28 -2
  40. package/solidjs.mjs +1 -1
  41. package/svelte.d.mts +2 -2
  42. package/svelte.d.ts +2 -2
  43. package/svelte.js +28 -2
  44. package/svelte.mjs +1 -1
  45. package/tanstack.d.mts +2 -2
  46. package/tanstack.d.ts +2 -2
  47. package/tanstack.js +28 -2
  48. package/tanstack.mjs +1 -1
  49. package/{types-pEje3VEB.d.ts → types-B90SJYZV.d.mts} +9 -2
  50. 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 };