@lunora/workflow 1.0.0-alpha.72 → 1.0.0-alpha.73
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/README.md +1 -1
- package/dist/do/index.d.mts +1 -1
- package/dist/do/index.d.ts +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/{createWorkflowContext-CiNtEzpn.mjs → createWorkflowContext-DBUnSy0_.mjs} +1 -1
- package/dist/packem_shared/createWorkflows-BwR_J9mp.mjs +1 -0
- package/dist/packem_shared/{types.d-5O82Xdxt.d.mts → types.d-DUrUHeVi.d.mts} +32 -4
- package/dist/packem_shared/{types.d-5O82Xdxt.d.ts → types.d-DUrUHeVi.d.ts} +32 -4
- package/package.json +1 -1
- package/dist/packem_shared/createWorkflows-BTny3jXV.mjs +0 -1
package/README.md
CHANGED
|
@@ -192,7 +192,7 @@ export const checkout = mutation.input({ orderId: v.string() }).mutation(async (
|
|
|
192
192
|
});
|
|
193
193
|
```
|
|
194
194
|
|
|
195
|
-
A handle exposes `create({ id?, params?, retention? })`, `createBatch(
|
|
195
|
+
A handle exposes `create({ id?, params?, retention? })`, `createBatch({ instances })` or `createBatch({ count, params?, retention? })` (returns `{ created, errors }`, one error per instance it did not create), `deleteBatch([...ids])` (up to 100), `get(id)`, and `sendEvent(instanceId, event, payload)` — the typed delivery of a declared event (see above). `create`/`get` return the native Cloudflare instance, which exposes its own lifecycle: `status()`, `pause()`, `resume()`, `restart()`, `terminate()`, `delete()`, `subscribe({ cursor?, filter? })` (streams the instance's event history, then new events), and the untyped `sendEvent({ type, payload })`.
|
|
196
196
|
|
|
197
197
|
`defineWorkflow` also takes deploy settings, which codegen writes into the workflow's `wrangler.jsonc` entry: `schedules` (cron expressions that each start an instance), `limits: { steps }`, and `defaultRetention: { successRetention, errorRetention }`. Scheduled workflows are refused on the Node and celld targets.
|
|
198
198
|
|
package/dist/do/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WorkflowEntrypoint, WorkflowEvent, WorkflowStep } from 'cloudflare:workers';
|
|
2
|
-
import { W as WorkflowDefinition } from "../packem_shared/types.d-
|
|
2
|
+
import { W as WorkflowDefinition } from "../packem_shared/types.d-DUrUHeVi.mjs";
|
|
3
3
|
import '@lunora/values';
|
|
4
4
|
/**
|
|
5
5
|
* Base class for the generated `WorkflowEntrypoint` classes. Applies a
|
package/dist/do/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WorkflowEntrypoint, WorkflowEvent, WorkflowStep } from 'cloudflare:workers';
|
|
2
|
-
import { W as WorkflowDefinition } from "../packem_shared/types.d-
|
|
2
|
+
import { W as WorkflowDefinition } from "../packem_shared/types.d-DUrUHeVi.js";
|
|
3
3
|
import '@lunora/values';
|
|
4
4
|
/**
|
|
5
5
|
* Base class for the generated `WorkflowEntrypoint` classes. Applies a
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as Workflows, L as LunoraWorkflowsOptions, b as WorkflowEventDefinition, S as StepArgsValidator, c as StepConfig, d as StepDefinition, e as WorkflowConfig, W as WorkflowDefinition, f as WorkflowBranch, g as WorkflowInstanceStatus, h as WorkflowEventLike, i as WorkflowStepLike, j as WorkflowRunContext, k as WorkflowLogger, l as WorkflowRunFunction, m as WorkflowRunStepFunction, n as WorkflowWaitForEventFunction } from "./packem_shared/types.d-
|
|
2
|
-
export type { A as ArgsOf, B as BranchCompensationParams, F as FunctionKind, o as FunctionReference, I as InferStepArgs, R as RunFunctionOptions, p as RunStepOptions, q as StepHandler, r as StepRollbackContext, s as StepRollbackHandler, t as StepRunContext, u as WaitForEventOptions, v as WorkflowBatchDeleteResult, w as WorkflowBindingLike, x as WorkflowBranchOutputs, y as
|
|
1
|
+
import { a as Workflows, L as LunoraWorkflowsOptions, b as WorkflowEventDefinition, S as StepArgsValidator, c as StepConfig, d as StepDefinition, e as WorkflowConfig, W as WorkflowDefinition, f as WorkflowBranch, g as WorkflowInstanceStatus, h as WorkflowEventLike, i as WorkflowStepLike, j as WorkflowRunContext, k as WorkflowLogger, l as WorkflowRunFunction, m as WorkflowRunStepFunction, n as WorkflowWaitForEventFunction } from "./packem_shared/types.d-DUrUHeVi.mjs";
|
|
2
|
+
export type { A as ArgsOf, B as BranchCompensationParams, F as FunctionKind, o as FunctionReference, I as InferStepArgs, R as RunFunctionOptions, p as RunStepOptions, q as StepHandler, r as StepRollbackContext, s as StepRollbackHandler, t as StepRunContext, u as WaitForEventOptions, v as WorkflowBatchDeleteResult, w as WorkflowBindingLike, x as WorkflowBranchOutputs, y as WorkflowCreateBatchError, z as WorkflowCreateBatchOptions, C as WorkflowCreateBatchResult, D as WorkflowCreateOptions, E as WorkflowDelayFunctionLike, G as WorkflowHandle, H as WorkflowHandler, J as WorkflowInstanceEventLike, K as WorkflowInstanceLike, M as WorkflowInstanceSubscribeOptionsLike, N as WorkflowInstanceSubscriptionLike, O as WorkflowParallelFunction, P as WorkflowRetention, Q as WorkflowRollbackContextLike, T as WorkflowRollbackHandlerLike, U as WorkflowSpawnFunction, V as WorkflowSpawnOptions, X as WorkflowStatusResult, Y as WorkflowStepConfigLike, Z as WorkflowStepContextLike, _ as WorkflowStepRollbackOptionsLike } from "./packem_shared/types.d-DUrUHeVi.mjs";
|
|
3
3
|
import { Validator } from '@lunora/values';
|
|
4
4
|
import { LunoraError } from '@lunora/errors';
|
|
5
5
|
/** Wiring info for one declared workflow, emitted by codegen into the generated shard. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as Workflows, L as LunoraWorkflowsOptions, b as WorkflowEventDefinition, S as StepArgsValidator, c as StepConfig, d as StepDefinition, e as WorkflowConfig, W as WorkflowDefinition, f as WorkflowBranch, g as WorkflowInstanceStatus, h as WorkflowEventLike, i as WorkflowStepLike, j as WorkflowRunContext, k as WorkflowLogger, l as WorkflowRunFunction, m as WorkflowRunStepFunction, n as WorkflowWaitForEventFunction } from "./packem_shared/types.d-
|
|
2
|
-
export type { A as ArgsOf, B as BranchCompensationParams, F as FunctionKind, o as FunctionReference, I as InferStepArgs, R as RunFunctionOptions, p as RunStepOptions, q as StepHandler, r as StepRollbackContext, s as StepRollbackHandler, t as StepRunContext, u as WaitForEventOptions, v as WorkflowBatchDeleteResult, w as WorkflowBindingLike, x as WorkflowBranchOutputs, y as
|
|
1
|
+
import { a as Workflows, L as LunoraWorkflowsOptions, b as WorkflowEventDefinition, S as StepArgsValidator, c as StepConfig, d as StepDefinition, e as WorkflowConfig, W as WorkflowDefinition, f as WorkflowBranch, g as WorkflowInstanceStatus, h as WorkflowEventLike, i as WorkflowStepLike, j as WorkflowRunContext, k as WorkflowLogger, l as WorkflowRunFunction, m as WorkflowRunStepFunction, n as WorkflowWaitForEventFunction } from "./packem_shared/types.d-DUrUHeVi.js";
|
|
2
|
+
export type { A as ArgsOf, B as BranchCompensationParams, F as FunctionKind, o as FunctionReference, I as InferStepArgs, R as RunFunctionOptions, p as RunStepOptions, q as StepHandler, r as StepRollbackContext, s as StepRollbackHandler, t as StepRunContext, u as WaitForEventOptions, v as WorkflowBatchDeleteResult, w as WorkflowBindingLike, x as WorkflowBranchOutputs, y as WorkflowCreateBatchError, z as WorkflowCreateBatchOptions, C as WorkflowCreateBatchResult, D as WorkflowCreateOptions, E as WorkflowDelayFunctionLike, G as WorkflowHandle, H as WorkflowHandler, J as WorkflowInstanceEventLike, K as WorkflowInstanceLike, M as WorkflowInstanceSubscribeOptionsLike, N as WorkflowInstanceSubscriptionLike, O as WorkflowParallelFunction, P as WorkflowRetention, Q as WorkflowRollbackContextLike, T as WorkflowRollbackHandlerLike, U as WorkflowSpawnFunction, V as WorkflowSpawnOptions, X as WorkflowStatusResult, Y as WorkflowStepConfigLike, Z as WorkflowStepContextLike, _ as WorkflowStepRollbackOptionsLike } from "./packem_shared/types.d-DUrUHeVi.js";
|
|
3
3
|
import { Validator } from '@lunora/values';
|
|
4
4
|
import { LunoraError } from '@lunora/errors';
|
|
5
5
|
/** Wiring info for one declared workflow, emitted by codegen into the generated shard. */
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createWorkflowContext as e}from"./packem_shared/createWorkflowContext-
|
|
1
|
+
import{createWorkflowContext as e}from"./packem_shared/createWorkflowContext-DBUnSy0_.mjs";import{default as f}from"./packem_shared/createWorkflows-BwR_J9mp.mjs";import{defineWorkflowEvent as n,isWorkflowEventDefinition as i}from"./packem_shared/defineWorkflowEvent-suERPEEV.mjs";import{defineStep as p,isStepDefinition as s}from"./packem_shared/defineStep-D1-9eOnA.mjs";import{defineWorkflow as x,isWorkflowDefinition as w,workflowClassName as c,workflowDefaultName as k}from"./packem_shared/defineWorkflow-DynRL6LP.mjs";import{NonRetryableError as W,convertNonRetryableError as R,isNonRetryableError as N,toNativeNonRetryableError as v}from"./packem_shared/NonRetryableError-BPu01mU8.mjs";import{MAX_BRANCHES as d,branch as u}from"./packem_shared/MAX_BRANCHES-Bcw3dss9.mjs";import{WorkflowsRestError as D,createWorkflowsRestClient as S}from"./packem_shared/WorkflowsRestError-CxLJskBZ.mjs";import{createWorkflowRunContext as A}from"./packem_shared/createWorkflowRunContext-C007IGZ9.mjs";import{c as h,v as B}from"./packem_shared/run-step-DJ3bnM1Q.mjs";import{createWaitForEvent as H}from"./packem_shared/createWaitForEvent-D5Ohn2Pz.mjs";import{isDuplicateInstanceError as M}from"./packem_shared/isDuplicateInstanceError-CecnqNAa.mjs";export{d as MAX_BRANCHES,W as NonRetryableError,D as WorkflowsRestError,u as branch,R as convertNonRetryableError,h as createRunStep,H as createWaitForEvent,e as createWorkflowContext,A as createWorkflowRunContext,f as createWorkflows,S as createWorkflowsRestClient,p as defineStep,x as defineWorkflow,n as defineWorkflowEvent,M as isDuplicateInstanceError,N as isNonRetryableError,s as isStepDefinition,w as isWorkflowDefinition,i as isWorkflowEventDefinition,v as toNativeNonRetryableError,B as validateStepArgs,c as workflowClassName,k as workflowDefaultName};
|
package/dist/packem_shared/{createWorkflowContext-CiNtEzpn.mjs → createWorkflowContext-DBUnSy0_.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./workflow-binding-Dm9hBzx_.mjs";import a from"./createWorkflows-
|
|
1
|
+
import{r as s}from"./workflow-binding-Dm9hBzx_.mjs";import a from"./createWorkflows-BwR_J9mp.mjs";const l=(t,c,n)=>{const o={};for(const e of c){const r=s(t,n,e.className,["create","createBatch","get"]);r!==void 0&&(o[e.exportName]=r)}return a({bindings:o})};export{l as createWorkflowContext};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{LunoraError as o}from"@lunora/errors";import{h as w,B as l}from"./branch-marker-CCpWfS5k.mjs";import{eventDefinitionProblem as f}from"./defineWorkflowEvent-suERPEEV.mjs";const c=r=>{if(w(r?.params))throw new o("BAD_REQUEST",`@lunora/workflow: params ${l}`)},i=r=>({create:async e=>(c(e),r.create(e)),createBatch:async e=>{const a="instances"in e?e.instances:[{params:e.params}];for(const t of a)c(t);return r.createBatch(e)},deleteBatch:async e=>r.deleteBatch(e),get:async e=>r.get(e),sendEvent:async(e,a,t)=>{const n=f(a);if(n!==void 0)throw new o("BAD_REQUEST",`@lunora/workflow: sendEvent ${n}`);await(await r.get(e)).sendEvent({payload:a.payload.parse(t),type:a.type})}}),E=r=>{const e=r.bindings??{};return{get:a=>{const t=e[a];if(t===void 0){const n=Object.keys(e),s=n.length===0?"no workflows are declared":`known workflows: ${n.join(", ")}`;throw new o("INTERNAL",`@lunora/workflow: no workflow named "${a}" (${s})`)}return i(t)}}};export{E as default};
|
|
@@ -61,6 +61,31 @@ interface WorkflowCreateOptions<Params = Record<string, unknown>> {
|
|
|
61
61
|
/** Instance retention policy (defaults to the workflow's `defaultRetention`, else the plan default). */
|
|
62
62
|
retention?: WorkflowRetention;
|
|
63
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Options for `Workflow.createBatch`, in the object form Cloudflare's binding takes:
|
|
66
|
+
* explicit `instances`, or `count` instances that share one `params` and `retention`.
|
|
67
|
+
* The array form is deprecated upstream and is not accepted here: it left out any
|
|
68
|
+
* instance it failed to create, and reported nothing for it.
|
|
69
|
+
*/
|
|
70
|
+
type WorkflowCreateBatchOptions<Params = Record<string, unknown>> = {
|
|
71
|
+
instances: ReadonlyArray<WorkflowCreateOptions<Params>>;
|
|
72
|
+
} | {
|
|
73
|
+
count: number;
|
|
74
|
+
params?: Params;
|
|
75
|
+
retention?: WorkflowRetention;
|
|
76
|
+
};
|
|
77
|
+
/** One instance a batch did not create. `index` is its position in the input (`count` form: its position among the `count`). */
|
|
78
|
+
interface WorkflowCreateBatchError {
|
|
79
|
+
code: number;
|
|
80
|
+
id?: string;
|
|
81
|
+
index: number;
|
|
82
|
+
message: string;
|
|
83
|
+
}
|
|
84
|
+
/** Result of `Workflow.createBatch`: the instances that were created, and an error for each one that was not. */
|
|
85
|
+
interface WorkflowCreateBatchResult {
|
|
86
|
+
created: WorkflowInstanceLike[];
|
|
87
|
+
errors: WorkflowCreateBatchError[];
|
|
88
|
+
}
|
|
64
89
|
/** Result of `Workflow.deleteBatch`. Mirrors Cloudflare's `WorkflowBatchDeleteResult`: one entry per input position. */
|
|
65
90
|
interface WorkflowBatchDeleteResult {
|
|
66
91
|
deleted: {
|
|
@@ -132,7 +157,7 @@ interface WorkflowInstanceLike {
|
|
|
132
157
|
*/
|
|
133
158
|
interface WorkflowBindingLike<Params = Record<string, unknown>> {
|
|
134
159
|
create: (options?: WorkflowCreateOptions<Params>) => Promise<WorkflowInstanceLike>;
|
|
135
|
-
createBatch: (
|
|
160
|
+
createBatch: (options: WorkflowCreateBatchOptions<Params>) => Promise<WorkflowCreateBatchResult>;
|
|
136
161
|
deleteBatch: (instanceIds: ReadonlyArray<string>) => Promise<WorkflowBatchDeleteResult>;
|
|
137
162
|
get: (id: string) => Promise<WorkflowInstanceLike>;
|
|
138
163
|
}
|
|
@@ -620,8 +645,11 @@ interface WorkflowDefinition<Params = Record<string, unknown>, Output = unknown>
|
|
|
620
645
|
interface WorkflowHandle<Params = Record<string, unknown>> {
|
|
621
646
|
/** Start a new instance (optionally with an id + params). */
|
|
622
647
|
create: (options?: WorkflowCreateOptions<Params>) => Promise<WorkflowInstanceLike>;
|
|
623
|
-
/**
|
|
624
|
-
|
|
648
|
+
/**
|
|
649
|
+
* Start many instances in one batched RPC. Returns what was created and a
|
|
650
|
+
* per-instance error for each one that was not, so a failed instance is never silently dropped.
|
|
651
|
+
*/
|
|
652
|
+
createBatch: (options: WorkflowCreateBatchOptions<Params>) => Promise<WorkflowCreateBatchResult>;
|
|
625
653
|
/** Delete up to 100 instances and their stored state; ids that do not exist come back as per-instance errors. */
|
|
626
654
|
deleteBatch: (instanceIds: ReadonlyArray<string>) => Promise<WorkflowBatchDeleteResult>;
|
|
627
655
|
/** Get a handle to an existing instance by id. */
|
|
@@ -655,4 +683,4 @@ interface LunoraWorkflowsOptions {
|
|
|
655
683
|
*/
|
|
656
684
|
bindings: Record<string, WorkflowBindingLike>;
|
|
657
685
|
}
|
|
658
|
-
export { ArgsOf as A, BranchCompensationParams as B,
|
|
686
|
+
export { ArgsOf as A, BranchCompensationParams as B, WorkflowCreateBatchResult as C, WorkflowCreateOptions as D, WorkflowDelayFunctionLike as E, FunctionKind as F, WorkflowHandle as G, WorkflowHandler as H, InferStepArgs as I, WorkflowInstanceEventLike as J, WorkflowInstanceLike as K, LunoraWorkflowsOptions as L, WorkflowInstanceSubscribeOptionsLike as M, WorkflowInstanceSubscriptionLike as N, WorkflowParallelFunction as O, WorkflowRetention as P, WorkflowRollbackContextLike as Q, RunFunctionOptions as R, StepArgsValidator as S, WorkflowRollbackHandlerLike as T, WorkflowSpawnFunction as U, WorkflowSpawnOptions as V, WorkflowDefinition as W, WorkflowStatusResult as X, WorkflowStepConfigLike as Y, WorkflowStepContextLike as Z, WorkflowStepRollbackOptionsLike as _, Workflows as a, WorkflowEventDefinition as b, StepConfig as c, StepDefinition as d, WorkflowConfig as e, WorkflowBranch as f, WorkflowInstanceStatus as g, WorkflowEventLike as h, WorkflowStepLike as i, WorkflowRunContext as j, WorkflowLogger as k, WorkflowRunFunction as l, WorkflowRunStepFunction as m, WorkflowWaitForEventFunction as n, FunctionReference as o, RunStepOptions as p, StepHandler as q, StepRollbackContext as r, StepRollbackHandler as s, StepRunContext as t, WaitForEventOptions as u, WorkflowBatchDeleteResult as v, WorkflowBindingLike as w, WorkflowBranchOutputs as x, WorkflowCreateBatchError as y, WorkflowCreateBatchOptions as z };
|
|
@@ -61,6 +61,31 @@ interface WorkflowCreateOptions<Params = Record<string, unknown>> {
|
|
|
61
61
|
/** Instance retention policy (defaults to the workflow's `defaultRetention`, else the plan default). */
|
|
62
62
|
retention?: WorkflowRetention;
|
|
63
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Options for `Workflow.createBatch`, in the object form Cloudflare's binding takes:
|
|
66
|
+
* explicit `instances`, or `count` instances that share one `params` and `retention`.
|
|
67
|
+
* The array form is deprecated upstream and is not accepted here: it left out any
|
|
68
|
+
* instance it failed to create, and reported nothing for it.
|
|
69
|
+
*/
|
|
70
|
+
type WorkflowCreateBatchOptions<Params = Record<string, unknown>> = {
|
|
71
|
+
instances: ReadonlyArray<WorkflowCreateOptions<Params>>;
|
|
72
|
+
} | {
|
|
73
|
+
count: number;
|
|
74
|
+
params?: Params;
|
|
75
|
+
retention?: WorkflowRetention;
|
|
76
|
+
};
|
|
77
|
+
/** One instance a batch did not create. `index` is its position in the input (`count` form: its position among the `count`). */
|
|
78
|
+
interface WorkflowCreateBatchError {
|
|
79
|
+
code: number;
|
|
80
|
+
id?: string;
|
|
81
|
+
index: number;
|
|
82
|
+
message: string;
|
|
83
|
+
}
|
|
84
|
+
/** Result of `Workflow.createBatch`: the instances that were created, and an error for each one that was not. */
|
|
85
|
+
interface WorkflowCreateBatchResult {
|
|
86
|
+
created: WorkflowInstanceLike[];
|
|
87
|
+
errors: WorkflowCreateBatchError[];
|
|
88
|
+
}
|
|
64
89
|
/** Result of `Workflow.deleteBatch`. Mirrors Cloudflare's `WorkflowBatchDeleteResult`: one entry per input position. */
|
|
65
90
|
interface WorkflowBatchDeleteResult {
|
|
66
91
|
deleted: {
|
|
@@ -132,7 +157,7 @@ interface WorkflowInstanceLike {
|
|
|
132
157
|
*/
|
|
133
158
|
interface WorkflowBindingLike<Params = Record<string, unknown>> {
|
|
134
159
|
create: (options?: WorkflowCreateOptions<Params>) => Promise<WorkflowInstanceLike>;
|
|
135
|
-
createBatch: (
|
|
160
|
+
createBatch: (options: WorkflowCreateBatchOptions<Params>) => Promise<WorkflowCreateBatchResult>;
|
|
136
161
|
deleteBatch: (instanceIds: ReadonlyArray<string>) => Promise<WorkflowBatchDeleteResult>;
|
|
137
162
|
get: (id: string) => Promise<WorkflowInstanceLike>;
|
|
138
163
|
}
|
|
@@ -620,8 +645,11 @@ interface WorkflowDefinition<Params = Record<string, unknown>, Output = unknown>
|
|
|
620
645
|
interface WorkflowHandle<Params = Record<string, unknown>> {
|
|
621
646
|
/** Start a new instance (optionally with an id + params). */
|
|
622
647
|
create: (options?: WorkflowCreateOptions<Params>) => Promise<WorkflowInstanceLike>;
|
|
623
|
-
/**
|
|
624
|
-
|
|
648
|
+
/**
|
|
649
|
+
* Start many instances in one batched RPC. Returns what was created and a
|
|
650
|
+
* per-instance error for each one that was not, so a failed instance is never silently dropped.
|
|
651
|
+
*/
|
|
652
|
+
createBatch: (options: WorkflowCreateBatchOptions<Params>) => Promise<WorkflowCreateBatchResult>;
|
|
625
653
|
/** Delete up to 100 instances and their stored state; ids that do not exist come back as per-instance errors. */
|
|
626
654
|
deleteBatch: (instanceIds: ReadonlyArray<string>) => Promise<WorkflowBatchDeleteResult>;
|
|
627
655
|
/** Get a handle to an existing instance by id. */
|
|
@@ -655,4 +683,4 @@ interface LunoraWorkflowsOptions {
|
|
|
655
683
|
*/
|
|
656
684
|
bindings: Record<string, WorkflowBindingLike>;
|
|
657
685
|
}
|
|
658
|
-
export { ArgsOf as A, BranchCompensationParams as B,
|
|
686
|
+
export { ArgsOf as A, BranchCompensationParams as B, WorkflowCreateBatchResult as C, WorkflowCreateOptions as D, WorkflowDelayFunctionLike as E, FunctionKind as F, WorkflowHandle as G, WorkflowHandler as H, InferStepArgs as I, WorkflowInstanceEventLike as J, WorkflowInstanceLike as K, LunoraWorkflowsOptions as L, WorkflowInstanceSubscribeOptionsLike as M, WorkflowInstanceSubscriptionLike as N, WorkflowParallelFunction as O, WorkflowRetention as P, WorkflowRollbackContextLike as Q, RunFunctionOptions as R, StepArgsValidator as S, WorkflowRollbackHandlerLike as T, WorkflowSpawnFunction as U, WorkflowSpawnOptions as V, WorkflowDefinition as W, WorkflowStatusResult as X, WorkflowStepConfigLike as Y, WorkflowStepContextLike as Z, WorkflowStepRollbackOptionsLike as _, Workflows as a, WorkflowEventDefinition as b, StepConfig as c, StepDefinition as d, WorkflowConfig as e, WorkflowBranch as f, WorkflowInstanceStatus as g, WorkflowEventLike as h, WorkflowStepLike as i, WorkflowRunContext as j, WorkflowLogger as k, WorkflowRunFunction as l, WorkflowRunStepFunction as m, WorkflowWaitForEventFunction as n, FunctionReference as o, RunStepOptions as p, StepHandler as q, StepRollbackContext as r, StepRollbackHandler as s, StepRunContext as t, WaitForEventOptions as u, WorkflowBatchDeleteResult as v, WorkflowBindingLike as w, WorkflowBranchOutputs as x, WorkflowCreateBatchError as y, WorkflowCreateBatchOptions as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/workflow",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.73",
|
|
4
4
|
"description": "Durable workflows for Lunora: defineWorkflow over Cloudflare Workflows, generated WorkflowEntrypoint classes, and the ctx.workflows surface",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{LunoraError as a}from"@lunora/errors";import{h as w,B as l}from"./branch-marker-CCpWfS5k.mjs";import{eventDefinitionProblem as f}from"./defineWorkflowEvent-suERPEEV.mjs";const c=o=>{if(w(o?.params))throw new a("BAD_REQUEST",`@lunora/workflow: params ${l}`)},i=o=>({create:async e=>(c(e),o.create(e)),createBatch:async e=>{for(const r of e)c(r);return o.createBatch(e)},deleteBatch:async e=>o.deleteBatch(e),get:async e=>o.get(e),sendEvent:async(e,r,n)=>{const t=f(r);if(t!==void 0)throw new a("BAD_REQUEST",`@lunora/workflow: sendEvent ${t}`);await(await o.get(e)).sendEvent({payload:r.payload.parse(n),type:r.type})}}),h=o=>{const e=o.bindings??{};return{get:r=>{const n=e[r];if(n===void 0){const t=Object.keys(e),s=t.length===0?"no workflows are declared":`known workflows: ${t.join(", ")}`;throw new a("INTERNAL",`@lunora/workflow: no workflow named "${r}" (${s})`)}return i(n)}}};export{h as default};
|