@upstash/workflow 0.2.8 → 0.2.10-hono-generics

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/cloudflare.d.mts CHANGED
@@ -1,4 +1,5 @@
1
- import { R as RouteFunction, k as PublicServeOptions } from './types-B62AnIU3.mjs';
1
+ import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-CYhDXnf8.mjs';
2
+ import { s as serveManyBase } from './serve-many-BVDpPsF-.mjs';
2
3
  import '@upstash/qstash';
3
4
  import 'zod';
4
5
  import 'ai';
@@ -23,7 +24,7 @@ type PagesHandlerArgs = [{
23
24
  */
24
25
  type WorkersHandlerArgs = [Request, Record<string, string | undefined>];
25
26
  /**
26
- * Serve method to serve a Upstash Workflow in a Nextjs project
27
+ * Serve method to serve a Upstash Workflow in a Cloudflare project
27
28
  *
28
29
  * See for options https://upstash.com/docs/qstash/workflows/basics/serve
29
30
  *
@@ -31,8 +32,12 @@ type WorkersHandlerArgs = [Request, Record<string, string | undefined>];
31
32
  * @param options workflow options
32
33
  * @returns
33
34
  */
34
- declare const serve: <TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options?: PublicServeOptions<TInitialPayload>) => {
35
+ declare const serve: <TInitialPayload = unknown, TResult = unknown>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload>) => {
35
36
  fetch: (...args: PagesHandlerArgs | WorkersHandlerArgs) => Promise<Response>;
36
37
  };
38
+ declare const createWorkflow: <TInitialPayload, TResult>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload> | undefined) => InvokableWorkflow<TInitialPayload, TResult>;
39
+ declare const serveMany: (workflows: Parameters<typeof serveManyBase>[0]["workflows"], options?: Parameters<typeof serveManyBase>[0]["options"]) => {
40
+ fetch: (...params: PagesHandlerArgs | WorkersHandlerArgs) => Promise<any>;
41
+ };
37
42
 
38
- export { type PagesHandlerArgs, type WorkersHandlerArgs, type WorkflowBindings, serve };
43
+ export { type PagesHandlerArgs, type WorkersHandlerArgs, type WorkflowBindings, createWorkflow, serve, serveMany };
package/cloudflare.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { R as RouteFunction, k as PublicServeOptions } from './types-B62AnIU3.js';
1
+ import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-CYhDXnf8.js';
2
+ import { s as serveManyBase } from './serve-many-e4zufyXN.js';
2
3
  import '@upstash/qstash';
3
4
  import 'zod';
4
5
  import 'ai';
@@ -23,7 +24,7 @@ type PagesHandlerArgs = [{
23
24
  */
24
25
  type WorkersHandlerArgs = [Request, Record<string, string | undefined>];
25
26
  /**
26
- * Serve method to serve a Upstash Workflow in a Nextjs project
27
+ * Serve method to serve a Upstash Workflow in a Cloudflare project
27
28
  *
28
29
  * See for options https://upstash.com/docs/qstash/workflows/basics/serve
29
30
  *
@@ -31,8 +32,12 @@ type WorkersHandlerArgs = [Request, Record<string, string | undefined>];
31
32
  * @param options workflow options
32
33
  * @returns
33
34
  */
34
- declare const serve: <TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options?: PublicServeOptions<TInitialPayload>) => {
35
+ declare const serve: <TInitialPayload = unknown, TResult = unknown>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload>) => {
35
36
  fetch: (...args: PagesHandlerArgs | WorkersHandlerArgs) => Promise<Response>;
36
37
  };
38
+ declare const createWorkflow: <TInitialPayload, TResult>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload> | undefined) => InvokableWorkflow<TInitialPayload, TResult>;
39
+ declare const serveMany: (workflows: Parameters<typeof serveManyBase>[0]["workflows"], options?: Parameters<typeof serveManyBase>[0]["options"]) => {
40
+ fetch: (...params: PagesHandlerArgs | WorkersHandlerArgs) => Promise<any>;
41
+ };
37
42
 
38
- export { type PagesHandlerArgs, type WorkersHandlerArgs, type WorkflowBindings, serve };
43
+ export { type PagesHandlerArgs, type WorkersHandlerArgs, type WorkflowBindings, createWorkflow, serve, serveMany };