@upstash/workflow 0.2.8-rc-invoke → 0.2.9

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/h3.mjs CHANGED
@@ -1,11 +1,8 @@
1
- import {
2
- createInvokeCallback,
3
- serveManyBase
4
- } from "./chunk-LCZMBGEM.mjs";
5
1
  import {
6
2
  SDK_TELEMETRY,
7
- serveBase
8
- } from "./chunk-IWAW7GIG.mjs";
3
+ serveBase,
4
+ serveManyBase
5
+ } from "./chunk-IPXJZU3K.mjs";
9
6
 
10
7
  // node_modules/defu/dist/defu.mjs
11
8
  function isPlainObject(value) {
@@ -360,21 +357,19 @@ var serve = (routeFunction, options) => {
360
357
  return { handler };
361
358
  };
362
359
  var createWorkflow = (...params) => {
363
- const { handler } = serve(...params);
360
+ const [routeFunction, options = {}] = params;
364
361
  return {
365
- callback: createInvokeCallback(telemetry),
366
- handler,
362
+ routeFunction,
363
+ options,
367
364
  workflowId: void 0
368
365
  };
369
366
  };
370
- var serveMany = (workflows) => {
367
+ var serveMany = (workflows, options) => {
371
368
  return serveManyBase({
372
369
  workflows,
373
- getWorkflowId(event) {
374
- const url = getUrl(event);
375
- const components = url.split("/");
376
- return components[components.length - 1];
377
- }
370
+ getUrl,
371
+ serveMethod: (...params) => serve(...params).handler,
372
+ options
378
373
  });
379
374
  };
380
375
  export {
package/hono.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Context } from 'hono';
2
- import { R as RouteFunction, j as PublicServeOptions, t as InvokableWorkflow } from './types-C7Y7WUQd.mjs';
2
+ import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-CYhDXnf8.mjs';
3
3
  import { Variables } from 'hono/types';
4
- import { s as serveManyBase } from './serve-many-BlBvXfBS.mjs';
4
+ import { s as serveManyBase } from './serve-many-BVDpPsF-.mjs';
5
5
  import '@upstash/qstash';
6
6
  import 'zod';
7
7
  import 'ai';
@@ -27,8 +27,8 @@ declare const serve: <TInitialPayload = unknown, TBindings extends WorkflowBindi
27
27
  Bindings: TBindings;
28
28
  Variables: TVariables;
29
29
  }>) => Promise<Response>);
30
- declare const createWorkflow: <TInitialPayload, TResult>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload> | undefined) => InvokableWorkflow<TInitialPayload, TResult, Parameters<ReturnType<typeof serve<TInitialPayload, WorkflowBindings, Variables, TResult>>>>;
31
- declare const serveMany: (workflows: Parameters<typeof serveManyBase>[0]["workflows"]) => (context: Context<{
30
+ declare const createWorkflow: <TInitialPayload, TResult>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload> | undefined) => InvokableWorkflow<TInitialPayload, TResult>;
31
+ declare const serveMany: (workflows: Parameters<typeof serveManyBase>[0]["workflows"], options?: Parameters<typeof serveManyBase>[0]["options"]) => (context: Context<{
32
32
  Bindings: WorkflowBindings;
33
33
  Variables: object;
34
34
  }, any, {}>) => Promise<any>;
package/hono.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Context } from 'hono';
2
- import { R as RouteFunction, j as PublicServeOptions, t as InvokableWorkflow } from './types-C7Y7WUQd.js';
2
+ import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-CYhDXnf8.js';
3
3
  import { Variables } from 'hono/types';
4
- import { s as serveManyBase } from './serve-many-Dw-UUnH6.js';
4
+ import { s as serveManyBase } from './serve-many-e4zufyXN.js';
5
5
  import '@upstash/qstash';
6
6
  import 'zod';
7
7
  import 'ai';
@@ -27,8 +27,8 @@ declare const serve: <TInitialPayload = unknown, TBindings extends WorkflowBindi
27
27
  Bindings: TBindings;
28
28
  Variables: TVariables;
29
29
  }>) => Promise<Response>);
30
- declare const createWorkflow: <TInitialPayload, TResult>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload> | undefined) => InvokableWorkflow<TInitialPayload, TResult, Parameters<ReturnType<typeof serve<TInitialPayload, WorkflowBindings, Variables, TResult>>>>;
31
- declare const serveMany: (workflows: Parameters<typeof serveManyBase>[0]["workflows"]) => (context: Context<{
30
+ declare const createWorkflow: <TInitialPayload, TResult>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload> | undefined) => InvokableWorkflow<TInitialPayload, TResult>;
31
+ declare const serveMany: (workflows: Parameters<typeof serveManyBase>[0]["workflows"], options?: Parameters<typeof serveManyBase>[0]["options"]) => (context: Context<{
32
32
  Bindings: WorkflowBindings;
33
33
  Variables: object;
34
34
  }, any, {}>) => Promise<any>;