@adonis-agora/durable 0.6.1 → 0.8.0
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/CHANGELOG.md +64 -0
- package/README.md +1 -1
- package/dist/commands/main.d.ts +3 -2
- package/dist/commands/main.d.ts.map +1 -1
- package/dist/commands/main.js +3 -2
- package/dist/commands/main.js.map +1 -1
- package/dist/commands/make_workflow.d.ts +4 -3
- package/dist/commands/make_workflow.d.ts.map +1 -1
- package/dist/commands/make_workflow.js +4 -3
- package/dist/commands/make_workflow.js.map +1 -1
- package/dist/configure.d.ts +6 -5
- package/dist/configure.d.ts.map +1 -1
- package/dist/configure.js +9 -6
- package/dist/configure.js.map +1 -1
- package/dist/providers/dashboard_provider.d.ts +34 -3
- package/dist/providers/dashboard_provider.d.ts.map +1 -1
- package/dist/providers/dashboard_provider.js +110 -6
- package/dist/providers/dashboard_provider.js.map +1 -1
- package/dist/providers/durable_provider.d.ts.map +1 -1
- package/dist/providers/durable_provider.js +41 -4
- package/dist/providers/durable_provider.js.map +1 -1
- package/dist/src/base-workflow.d.ts +78 -0
- package/dist/src/base-workflow.d.ts.map +1 -0
- package/dist/src/base-workflow.js +106 -0
- package/dist/src/base-workflow.js.map +1 -0
- package/dist/src/codec-state-store.d.ts +13 -0
- package/dist/src/codec-state-store.d.ts.map +1 -1
- package/dist/src/codec-state-store.js +13 -0
- package/dist/src/codec-state-store.js.map +1 -1
- package/dist/src/control-flow-signal.d.ts +50 -0
- package/dist/src/control-flow-signal.d.ts.map +1 -0
- package/dist/src/control-flow-signal.js +54 -0
- package/dist/src/control-flow-signal.js.map +1 -0
- package/dist/src/control-plane-redis/redis-control-plane.d.ts +57 -5
- package/dist/src/control-plane-redis/redis-control-plane.d.ts.map +1 -1
- package/dist/src/control-plane-redis/redis-control-plane.js +100 -2
- package/dist/src/control-plane-redis/redis-control-plane.js.map +1 -1
- package/dist/src/dashboard/auth.d.ts +89 -0
- package/dist/src/dashboard/auth.d.ts.map +1 -0
- package/dist/src/dashboard/auth.js +113 -0
- package/dist/src/dashboard/auth.js.map +1 -0
- package/dist/src/dashboard/define_config.d.ts +17 -0
- package/dist/src/dashboard/define_config.d.ts.map +1 -1
- package/dist/src/dashboard/define_config.js +23 -1
- package/dist/src/dashboard/define_config.js.map +1 -1
- package/dist/src/dashboard/index.d.ts +6 -1
- package/dist/src/dashboard/index.d.ts.map +1 -1
- package/dist/src/dashboard/index.js +5 -1
- package/dist/src/dashboard/index.js.map +1 -1
- package/dist/src/dashboard/login_page.d.ts +23 -0
- package/dist/src/dashboard/login_page.d.ts.map +1 -0
- package/dist/src/dashboard/login_page.js +170 -0
- package/dist/src/dashboard/login_page.js.map +1 -0
- package/dist/src/dashboard/session_cookie.d.ts +42 -0
- package/dist/src/dashboard/session_cookie.d.ts.map +1 -0
- package/dist/src/dashboard/session_cookie.js +97 -0
- package/dist/src/dashboard/session_cookie.js.map +1 -0
- package/dist/src/define_config.d.ts +11 -2
- package/dist/src/define_config.d.ts.map +1 -1
- package/dist/src/define_config.js.map +1 -1
- package/dist/src/engine.d.ts +91 -3
- package/dist/src/engine.d.ts.map +1 -1
- package/dist/src/engine.js +331 -44
- package/dist/src/engine.js.map +1 -1
- package/dist/src/entities.js +2 -2
- package/dist/src/entities.js.map +1 -1
- package/dist/src/errors.d.ts +6 -1
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +7 -2
- package/dist/src/errors.js.map +1 -1
- package/dist/src/event-accumulators.d.ts +1 -1
- package/dist/src/event-accumulators.d.ts.map +1 -1
- package/dist/src/events.d.ts +16 -0
- package/dist/src/events.d.ts.map +1 -1
- package/dist/src/events.js +26 -1
- package/dist/src/events.js.map +1 -1
- package/dist/src/hooks/steps.d.ts +43 -0
- package/dist/src/hooks/steps.d.ts.map +1 -0
- package/dist/src/hooks/steps.js +46 -0
- package/dist/src/hooks/steps.js.map +1 -0
- package/dist/src/hooks/workflows.d.ts +3 -2
- package/dist/src/hooks/workflows.d.ts.map +1 -1
- package/dist/src/hooks/workflows.js +3 -2
- package/dist/src/hooks/workflows.js.map +1 -1
- package/dist/src/index.d.ts +8 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +8 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/interfaces.d.ts +160 -43
- package/dist/src/interfaces.d.ts.map +1 -1
- package/dist/src/services/main.d.ts +13 -0
- package/dist/src/services/main.d.ts.map +1 -0
- package/dist/src/services/main.js +17 -0
- package/dist/src/services/main.js.map +1 -0
- package/dist/src/step-discovery.d.ts +42 -0
- package/dist/src/step-discovery.d.ts.map +1 -0
- package/dist/src/step-discovery.js +127 -0
- package/dist/src/step-discovery.js.map +1 -0
- package/dist/src/step-name-symbol.d.ts +63 -0
- package/dist/src/step-name-symbol.d.ts.map +1 -0
- package/dist/src/step-name-symbol.js +42 -0
- package/dist/src/step-name-symbol.js.map +1 -0
- package/dist/src/step-ref.d.ts +70 -0
- package/dist/src/step-ref.d.ts.map +1 -0
- package/dist/src/step-ref.js +93 -0
- package/dist/src/step-ref.js.map +1 -0
- package/dist/src/stores/lucid-schema.d.ts +1 -0
- package/dist/src/stores/lucid-schema.d.ts.map +1 -1
- package/dist/src/stores/lucid-schema.js +15 -0
- package/dist/src/stores/lucid-schema.js.map +1 -1
- package/dist/src/stores/lucid.d.ts +13 -0
- package/dist/src/stores/lucid.d.ts.map +1 -1
- package/dist/src/stores/lucid.js +43 -0
- package/dist/src/stores/lucid.js.map +1 -1
- package/dist/src/tenant-group.d.ts +18 -0
- package/dist/src/tenant-group.d.ts.map +1 -0
- package/dist/src/tenant-group.js +24 -0
- package/dist/src/tenant-group.js.map +1 -0
- package/dist/src/testing/in-memory-state-store.d.ts +16 -0
- package/dist/src/testing/in-memory-state-store.d.ts.map +1 -1
- package/dist/src/testing/in-memory-state-store.js +29 -0
- package/dist/src/testing/in-memory-state-store.js.map +1 -1
- package/dist/src/testing-kit/state-store-conformance.d.ts.map +1 -1
- package/dist/src/testing-kit/state-store-conformance.js +33 -2
- package/dist/src/testing-kit/state-store-conformance.js.map +1 -1
- package/dist/src/testing-kit/transport-conformance.d.ts.map +1 -1
- package/dist/src/testing-kit/transport-conformance.js +7 -12
- package/dist/src/testing-kit/transport-conformance.js.map +1 -1
- package/dist/src/transports/db.d.ts +14 -5
- package/dist/src/transports/db.d.ts.map +1 -1
- package/dist/src/transports/db.js +20 -15
- package/dist/src/transports/db.js.map +1 -1
- package/dist/src/transports/queue.d.ts +15 -5
- package/dist/src/transports/queue.d.ts.map +1 -1
- package/dist/src/transports/queue.js +19 -17
- package/dist/src/transports/queue.js.map +1 -1
- package/dist/src/workflow-als.d.ts +21 -0
- package/dist/src/workflow-als.d.ts.map +1 -0
- package/dist/src/workflow-als.js +22 -0
- package/dist/src/workflow-als.js.map +1 -0
- package/dist/src/workflow-ctx.d.ts +27 -8
- package/dist/src/workflow-ctx.d.ts.map +1 -1
- package/dist/src/workflow-ctx.js +183 -19
- package/dist/src/workflow-ctx.js.map +1 -1
- package/dist/src/workflow-discovery.d.ts +21 -15
- package/dist/src/workflow-discovery.d.ts.map +1 -1
- package/dist/src/workflow-discovery.js +17 -13
- package/dist/src/workflow-discovery.js.map +1 -1
- package/dist/src/workflow-ref.d.ts +9 -27
- package/dist/src/workflow-ref.d.ts.map +1 -1
- package/dist/src/workflow-ref.js +12 -34
- package/dist/src/workflow-ref.js.map +1 -1
- package/dist/stubs/database/migrations/create_durable_tables.stub +13 -1
- package/dist/stubs/make/workflow/main.stub +5 -4
- package/package.json +11 -1
- package/dist/src/remote-step-factory.d.ts +0 -15
- package/dist/src/remote-step-factory.d.ts.map +0 -1
- package/dist/src/remote-step-factory.js +0 -12
- package/dist/src/remote-step-factory.js.map +0 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { StepLogger } from './interfaces.js';
|
|
2
|
+
import type { StepHandler } from './protocol.js';
|
|
3
|
+
import { type DurableStepMeta } from './step-ref.js';
|
|
4
|
+
/** The narrow serve surface step discovery registers handlers on — satisfied by every transport
|
|
5
|
+
* (`InMemoryTransport`, `EventEmitterTransport`, `QueueTransport`, `DbTransport`). */
|
|
6
|
+
export interface StepServer {
|
|
7
|
+
handle(name: string, fn: StepHandler): void;
|
|
8
|
+
}
|
|
9
|
+
/** A discovered step handler: its routing metadata + the (already-bound) function to serve. */
|
|
10
|
+
export interface DiscoveredStep {
|
|
11
|
+
meta: DurableStepMeta;
|
|
12
|
+
handler: (input: unknown, log: StepLogger) => unknown | Promise<unknown>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Register a single discovered step on `server` under its stamped name, wrapping it with any
|
|
16
|
+
* declared zod validation. The low-level `transport.handle(name, fn)` stays the escape hatch — this
|
|
17
|
+
* is the convention the `app/steps` discovery builds on.
|
|
18
|
+
*/
|
|
19
|
+
export declare function registerStep(server: StepServer, step: DiscoveredStep): void;
|
|
20
|
+
/**
|
|
21
|
+
* Collect every `@Step`/`defineStep` handler reachable from an exported value:
|
|
22
|
+
* - a `defineStep(...)` function (stamped directly) → one handler, bound as-is.
|
|
23
|
+
* - a class with `@Step`-decorated methods → instantiate once and bind each stamped method.
|
|
24
|
+
* Anything else is ignored. So a module can `export` either style (or both) and be discovered.
|
|
25
|
+
*/
|
|
26
|
+
export declare function collectSteps(exported: unknown): DiscoveredStep[];
|
|
27
|
+
/** Discover + register every `@Step`/`defineStep` reachable from `exports` (e.g. a module's exports)
|
|
28
|
+
* onto `server`. De-duplicated by routing name (last wins). Returns the registered metadata. */
|
|
29
|
+
export declare function registerSteps(server: StepServer, exports: Iterable<unknown>): DurableStepMeta[];
|
|
30
|
+
/**
|
|
31
|
+
* Scan `dir` RECURSIVELY for modules and register every exported `@Step` class / `defineStep`
|
|
32
|
+
* handler on `server` — the `app/steps` convention, mirroring `app/workflows` discovery. Missing
|
|
33
|
+
* directory → no-op (the convention is opt-in). Returns the registered metadata.
|
|
34
|
+
*/
|
|
35
|
+
export declare function registerStepsFromDir(server: StepServer, dir: string): Promise<DurableStepMeta[]>;
|
|
36
|
+
/** The build-time barrel shape the Assembler `init` hook generates for `app/steps` (key → lazy
|
|
37
|
+
* module import), mirroring {@link import('./workflow-discovery.js').WorkflowsBarrel}. */
|
|
38
|
+
export type StepsBarrel = Record<string, () => Promise<Record<string, unknown>>>;
|
|
39
|
+
/** Register every `@Step`/`defineStep` reachable from a generated {@link StepsBarrel} onto `server`
|
|
40
|
+
* — the build-time equivalent of {@link registerStepsFromDir} with no runtime `readdir`. */
|
|
41
|
+
export declare function registerStepsFromBarrel(server: StepServer, barrel: StepsBarrel): Promise<DurableStepMeta[]>;
|
|
42
|
+
//# sourceMappingURL=step-discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-discovery.d.ts","sourceRoot":"","sources":["../../src/step-discovery.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,KAAK,eAAe,EAAc,MAAM,eAAe,CAAC;AAEjE;uFACuF;AACvF,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,GAAG,IAAI,CAAC;CAC7C;AAED,+FAA+F;AAC/F,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1E;AAeD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,cAAc,GAAG,IAAI,CAE3E;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,cAAc,EAAE,CA8BhE;AAED;iGACiG;AACjG,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,eAAe,EAAE,CAY/F;AAKD;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,eAAe,EAAE,CAAC,CAoB5B;AAED;2FAC2F;AAC3F,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;AAEjF;6FAC6F;AAC7F,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,eAAe,EAAE,CAAC,CAY5B"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { readdir } from 'node:fs/promises';
|
|
2
|
+
import { extname, join } from 'node:path';
|
|
3
|
+
import { pathToFileURL } from 'node:url';
|
|
4
|
+
import { DURABLE_STEP_NAME } from './step-name-symbol.js';
|
|
5
|
+
import { stepMetaOf } from './step-ref.js';
|
|
6
|
+
/** Wrap a handler with the opt-in zod validation its `@Step`/`defineStep` metadata declared: `input`
|
|
7
|
+
* is parsed before the body runs, `output` before the result is handed back. A handler with neither
|
|
8
|
+
* schema is served as-is (compile-time types only). */
|
|
9
|
+
function validating(step) {
|
|
10
|
+
const { meta, handler } = step;
|
|
11
|
+
if (!meta.input && !meta.output)
|
|
12
|
+
return handler;
|
|
13
|
+
return async (input, log) => {
|
|
14
|
+
const parsed = meta.input ? meta.input.parse(input) : input;
|
|
15
|
+
const output = await handler(parsed, log);
|
|
16
|
+
return meta.output ? meta.output.parse(output) : output;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Register a single discovered step on `server` under its stamped name, wrapping it with any
|
|
21
|
+
* declared zod validation. The low-level `transport.handle(name, fn)` stays the escape hatch — this
|
|
22
|
+
* is the convention the `app/steps` discovery builds on.
|
|
23
|
+
*/
|
|
24
|
+
export function registerStep(server, step) {
|
|
25
|
+
server.handle(step.meta.name, validating(step));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Collect every `@Step`/`defineStep` handler reachable from an exported value:
|
|
29
|
+
* - a `defineStep(...)` function (stamped directly) → one handler, bound as-is.
|
|
30
|
+
* - a class with `@Step`-decorated methods → instantiate once and bind each stamped method.
|
|
31
|
+
* Anything else is ignored. So a module can `export` either style (or both) and be discovered.
|
|
32
|
+
*/
|
|
33
|
+
export function collectSteps(exported) {
|
|
34
|
+
const found = [];
|
|
35
|
+
// A `defineStep(...)` handler: the function itself carries the stamp.
|
|
36
|
+
const directMeta = stepMetaOf(exported);
|
|
37
|
+
if (directMeta) {
|
|
38
|
+
found.push({ meta: directMeta, handler: exported });
|
|
39
|
+
return found;
|
|
40
|
+
}
|
|
41
|
+
// A class with `@Step` methods: scan its prototype for stamped methods and bind them to an instance.
|
|
42
|
+
if (typeof exported === 'function' && exported.prototype) {
|
|
43
|
+
const proto = exported.prototype;
|
|
44
|
+
const stamped = Object.getOwnPropertyNames(proto).filter((key) => {
|
|
45
|
+
const value = proto[key];
|
|
46
|
+
return (typeof value === 'function' &&
|
|
47
|
+
typeof value[DURABLE_STEP_NAME] === 'string');
|
|
48
|
+
});
|
|
49
|
+
if (stamped.length > 0) {
|
|
50
|
+
const Ctor = exported;
|
|
51
|
+
const instance = new Ctor();
|
|
52
|
+
for (const key of stamped) {
|
|
53
|
+
const method = proto[key];
|
|
54
|
+
const meta = stepMetaOf(method);
|
|
55
|
+
if (!meta)
|
|
56
|
+
continue;
|
|
57
|
+
found.push({ meta, handler: instance[key].bind(instance) });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return found;
|
|
62
|
+
}
|
|
63
|
+
/** Discover + register every `@Step`/`defineStep` reachable from `exports` (e.g. a module's exports)
|
|
64
|
+
* onto `server`. De-duplicated by routing name (last wins). Returns the registered metadata. */
|
|
65
|
+
export function registerSteps(server, exports) {
|
|
66
|
+
const registered = [];
|
|
67
|
+
const seen = new Set();
|
|
68
|
+
for (const exported of exports) {
|
|
69
|
+
for (const step of collectSteps(exported)) {
|
|
70
|
+
if (seen.has(step.meta.name))
|
|
71
|
+
continue;
|
|
72
|
+
seen.add(step.meta.name);
|
|
73
|
+
registerStep(server, step);
|
|
74
|
+
registered.push(step.meta);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return registered;
|
|
78
|
+
}
|
|
79
|
+
/** Same module-extension gate the workflow scanner uses (`.ts` from source, `.js` from `dist`). */
|
|
80
|
+
const MODULE_EXT = extname(import.meta.url || '') === '.ts' ? '.ts' : '.js';
|
|
81
|
+
/**
|
|
82
|
+
* Scan `dir` RECURSIVELY for modules and register every exported `@Step` class / `defineStep`
|
|
83
|
+
* handler on `server` — the `app/steps` convention, mirroring `app/workflows` discovery. Missing
|
|
84
|
+
* directory → no-op (the convention is opt-in). Returns the registered metadata.
|
|
85
|
+
*/
|
|
86
|
+
export async function registerStepsFromDir(server, dir) {
|
|
87
|
+
let entries;
|
|
88
|
+
try {
|
|
89
|
+
entries = await readdir(dir, { recursive: true });
|
|
90
|
+
}
|
|
91
|
+
catch (err) {
|
|
92
|
+
if (err.code === 'ENOENT')
|
|
93
|
+
return [];
|
|
94
|
+
throw err;
|
|
95
|
+
}
|
|
96
|
+
const registered = [];
|
|
97
|
+
const seen = new Set();
|
|
98
|
+
for (const entry of entries.sort()) {
|
|
99
|
+
if (extname(entry) !== MODULE_EXT || entry.endsWith(`.d${MODULE_EXT}`))
|
|
100
|
+
continue;
|
|
101
|
+
const mod = (await import(pathToFileURL(join(dir, entry)).href));
|
|
102
|
+
for (const meta of registerSteps(server, Object.values(mod))) {
|
|
103
|
+
if (seen.has(meta.name))
|
|
104
|
+
continue;
|
|
105
|
+
seen.add(meta.name);
|
|
106
|
+
registered.push(meta);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return registered;
|
|
110
|
+
}
|
|
111
|
+
/** Register every `@Step`/`defineStep` reachable from a generated {@link StepsBarrel} onto `server`
|
|
112
|
+
* — the build-time equivalent of {@link registerStepsFromDir} with no runtime `readdir`. */
|
|
113
|
+
export async function registerStepsFromBarrel(server, barrel) {
|
|
114
|
+
const registered = [];
|
|
115
|
+
const seen = new Set();
|
|
116
|
+
for (const load of Object.values(barrel)) {
|
|
117
|
+
const mod = await load();
|
|
118
|
+
for (const meta of registerSteps(server, Object.values(mod))) {
|
|
119
|
+
if (seen.has(meta.name))
|
|
120
|
+
continue;
|
|
121
|
+
seen.add(meta.name);
|
|
122
|
+
registered.push(meta);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return registered;
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=step-discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-discovery.js","sourceRoot":"","sources":["../../src/step-discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAwB,UAAU,EAAE,MAAM,eAAe,CAAC;AAcjE;;wDAEwD;AACxD,SAAS,UAAU,CAAC,IAAoB;IACtC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC/B,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM;QAAE,OAAO,OAAO,CAAC;IAChD,OAAO,KAAK,EAAE,KAAc,EAAE,GAAe,EAAE,EAAE;QAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,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EAClB,MAAmB;IAEnB,MAAM,UAAU,GAAsB,EAAE,CAAC;IACzC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QACzC,MAAM,GAAG,GAAG,MAAM,IAAI,EAAE,CAAC;QACzB,KAAK,MAAM,IAAI,IAAI,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YAC7D,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;gBAAE,SAAS;YAClC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpB,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { BackoffStrategy } from './interfaces.js';
|
|
2
|
+
/**
|
|
3
|
+
* Cross-package step-name stamp. The `@Step` decorator (and `defineStep`) writes a method's derived
|
|
4
|
+
* routing name under this key; `ctx.step` reads it (via {@link stepNameOf}) to route a
|
|
5
|
+
* method-reference call to the same handler a worker registers by name.
|
|
6
|
+
*
|
|
7
|
+
* `Symbol.for` (the GLOBAL registry), NOT a plain `Symbol()` — so a duplicate copy of this module
|
|
8
|
+
* (pnpm peer-dependency multiplexing, or a dual ESM/CJS load) still reads the SAME key. A plain
|
|
9
|
+
* `Symbol()` would mint a distinct token per copy, so a decorator running against one copy could
|
|
10
|
+
* stamp a name a different copy's `ctx.step` can never read back. Uses the `@agora/` wire namespace,
|
|
11
|
+
* matching the other cross-package symbols in this package.
|
|
12
|
+
*/
|
|
13
|
+
export declare const DURABLE_STEP_NAME: unique symbol;
|
|
14
|
+
/**
|
|
15
|
+
* Cross-package step-DISPATCH-POLICY stamp. `@Step({ retries, backoff, backoffMs, backoffMaxMs,
|
|
16
|
+
* jitter, timeoutMs })` writes the def-level durable-retry/liveness policy under this key; `ctx.step`
|
|
17
|
+
* reads it (via {@link stepConfigOf}) and merges it with any per-call {@link import('./interfaces.js').StepDispatchOpts}
|
|
18
|
+
* override to build the dispatched {@link import('./interfaces.js').StepDef}. Same `Symbol.for`
|
|
19
|
+
* rationale as {@link DURABLE_STEP_NAME}.
|
|
20
|
+
*/
|
|
21
|
+
export declare const DURABLE_STEP_CONFIG: unique symbol;
|
|
22
|
+
/**
|
|
23
|
+
* The def-level durable-dispatch policy a `@Step(...)` can stamp on a method: retry/backoff and the
|
|
24
|
+
* remote-liveness `timeoutMs` — the dispatch-relevant subset of the engine's `StepOptions`. Read off
|
|
25
|
+
* a handler reference via {@link stepConfigOf}; a per-call {@link import('./interfaces.js').StepDispatchOpts}
|
|
26
|
+
* passed to `ctx.step(ref, input, opts)` overrides these field-by-field.
|
|
27
|
+
*/
|
|
28
|
+
export interface StepConfig {
|
|
29
|
+
/** Max attempts before the step (and run) fails. */
|
|
30
|
+
retries?: number | undefined;
|
|
31
|
+
/** How the delay between retries grows: `fixed` (constant) or `exp` (doubles each attempt). */
|
|
32
|
+
backoff?: BackoffStrategy | undefined;
|
|
33
|
+
/** Base delay in ms between retries. Omit (or 0) to retry with no delay. */
|
|
34
|
+
backoffMs?: number | undefined;
|
|
35
|
+
/** Upper bound on the (exponential) backoff delay. */
|
|
36
|
+
backoffMaxMs?: number | undefined;
|
|
37
|
+
/** Add random jitter (50–100% of the computed delay) to avoid thundering-herd retries. */
|
|
38
|
+
jitter?: boolean | undefined;
|
|
39
|
+
/** Liveness window for the dispatched step: no result/heartbeat within this many ms presumes the
|
|
40
|
+
* worker dead and fails the dispatch with a `RemoteStepTimeout` (retryable — re-dispatches per
|
|
41
|
+
* `retries`). Omit to wait indefinitely. */
|
|
42
|
+
timeoutMs?: number | undefined;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A method carrying its `@Step`-stamped routing name (and, optionally, its dispatch policy).
|
|
46
|
+
* `ctx.step(ref, input)` reads the name via {@link stepNameOf} — the reference itself is never
|
|
47
|
+
* invoked directly by the caller's process (the worker serving that name re-resolves the real
|
|
48
|
+
* handler), so an unbound `this` on `ref` is irrelevant; `ref` is purely a typed, refactor-safe
|
|
49
|
+
* handle onto the stamped name (and policy).
|
|
50
|
+
*/
|
|
51
|
+
export type StepRef<TInput = unknown, TOutput = unknown> = ((input: TInput) => Promise<TOutput> | TOutput) & {
|
|
52
|
+
[DURABLE_STEP_NAME]?: string | undefined;
|
|
53
|
+
[DURABLE_STEP_CONFIG]?: StepConfig | undefined;
|
|
54
|
+
};
|
|
55
|
+
/** Read the `@Step`-stamped routing name off a function ref. `undefined` for anything unstamped
|
|
56
|
+
* (including a plain string — {@link stepNameOf} only reads function refs; a caller passing a
|
|
57
|
+
* string already has the routing name and dispatches it directly). */
|
|
58
|
+
export declare function stepNameOf(ref: unknown): string | undefined;
|
|
59
|
+
/** Read the `@Step`-stamped dispatch policy off a function ref. `undefined` for anything unstamped
|
|
60
|
+
* (including a plain string — a cross-runtime string-name call has no def-level policy to read; pass
|
|
61
|
+
* it via {@link import('./interfaces.js').StepDispatchOpts} instead). */
|
|
62
|
+
export declare function stepConfigOf(ref: unknown): StepConfig | undefined;
|
|
63
|
+
//# sourceMappingURL=step-name-symbol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-name-symbol.d.ts","sourceRoot":"","sources":["../../src/step-name-symbol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,EAAE,OAAO,MAA+C,CAAC;AAEvF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,EAAE,OAAO,MAAiD,CAAC;AAE3F;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,+FAA+F;IAC/F,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IACtC,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,0FAA0F;IAC1F,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B;;iDAE6C;IAC7C,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAMD;;;;;;GAMG;AACH,MAAM,MAAM,OAAO,CAAC,MAAM,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,CAAC,CAC1D,KAAK,EAAE,MAAM,KACV,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,GAAG;IACjC,CAAC,iBAAiB,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,CAAC,mBAAmB,CAAC,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CAChD,CAAC;AAEF;;uEAEuE;AACvE,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAI3D;AAED;;0EAE0E;AAC1E,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAIjE"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-package step-name stamp. The `@Step` decorator (and `defineStep`) writes a method's derived
|
|
3
|
+
* routing name under this key; `ctx.step` reads it (via {@link stepNameOf}) to route a
|
|
4
|
+
* method-reference call to the same handler a worker registers by name.
|
|
5
|
+
*
|
|
6
|
+
* `Symbol.for` (the GLOBAL registry), NOT a plain `Symbol()` — so a duplicate copy of this module
|
|
7
|
+
* (pnpm peer-dependency multiplexing, or a dual ESM/CJS load) still reads the SAME key. A plain
|
|
8
|
+
* `Symbol()` would mint a distinct token per copy, so a decorator running against one copy could
|
|
9
|
+
* stamp a name a different copy's `ctx.step` can never read back. Uses the `@agora/` wire namespace,
|
|
10
|
+
* matching the other cross-package symbols in this package.
|
|
11
|
+
*/
|
|
12
|
+
export const DURABLE_STEP_NAME = Symbol.for('@agora/durable:step-name');
|
|
13
|
+
/**
|
|
14
|
+
* Cross-package step-DISPATCH-POLICY stamp. `@Step({ retries, backoff, backoffMs, backoffMaxMs,
|
|
15
|
+
* jitter, timeoutMs })` writes the def-level durable-retry/liveness policy under this key; `ctx.step`
|
|
16
|
+
* reads it (via {@link stepConfigOf}) and merges it with any per-call {@link import('./interfaces.js').StepDispatchOpts}
|
|
17
|
+
* override to build the dispatched {@link import('./interfaces.js').StepDef}. Same `Symbol.for`
|
|
18
|
+
* rationale as {@link DURABLE_STEP_NAME}.
|
|
19
|
+
*/
|
|
20
|
+
export const DURABLE_STEP_CONFIG = Symbol.for('@agora/durable:step-config');
|
|
21
|
+
function isStepConfig(value) {
|
|
22
|
+
return typeof value === 'object' && value !== null;
|
|
23
|
+
}
|
|
24
|
+
/** Read the `@Step`-stamped routing name off a function ref. `undefined` for anything unstamped
|
|
25
|
+
* (including a plain string — {@link stepNameOf} only reads function refs; a caller passing a
|
|
26
|
+
* string already has the routing name and dispatches it directly). */
|
|
27
|
+
export function stepNameOf(ref) {
|
|
28
|
+
if (typeof ref !== 'function')
|
|
29
|
+
return undefined;
|
|
30
|
+
const stamped = ref[DURABLE_STEP_NAME];
|
|
31
|
+
return typeof stamped === 'string' ? stamped : undefined;
|
|
32
|
+
}
|
|
33
|
+
/** Read the `@Step`-stamped dispatch policy off a function ref. `undefined` for anything unstamped
|
|
34
|
+
* (including a plain string — a cross-runtime string-name call has no def-level policy to read; pass
|
|
35
|
+
* it via {@link import('./interfaces.js').StepDispatchOpts} instead). */
|
|
36
|
+
export function stepConfigOf(ref) {
|
|
37
|
+
if (typeof ref !== 'function')
|
|
38
|
+
return undefined;
|
|
39
|
+
const stamped = ref[DURABLE_STEP_CONFIG];
|
|
40
|
+
return isStepConfig(stamped) ? stamped : undefined;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=step-name-symbol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-name-symbol.js","sourceRoot":"","sources":["../../src/step-name-symbol.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAkB,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAEvF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAkB,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAyB3F,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC;AAgBD;;uEAEuE;AACvE,MAAM,UAAU,UAAU,CAAC,GAAY;IACrC,IAAI,OAAO,GAAG,KAAK,UAAU;QAAE,OAAO,SAAS,CAAC;IAChD,MAAM,OAAO,GAAI,GAAyC,CAAC,iBAAiB,CAAC,CAAC;IAC9E,OAAO,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3D,CAAC;AAED;;0EAE0E;AAC1E,MAAM,UAAU,YAAY,CAAC,GAAY;IACvC,IAAI,OAAO,GAAG,KAAK,UAAU;QAAE,OAAO,SAAS,CAAC;IAChD,MAAM,OAAO,GAAI,GAA2C,CAAC,mBAAmB,CAAC,CAAC;IAClF,OAAO,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { BackoffStrategy } from './interfaces.js';
|
|
3
|
+
import { type StepRef } from './step-name-symbol.js';
|
|
4
|
+
/**
|
|
5
|
+
* The full metadata a `@Step` / {@link defineStep} stamps on a step handler for discovery: its
|
|
6
|
+
* resolved routing `name` plus the opt-in runtime zod schemas an authoring layer attached. Stamped
|
|
7
|
+
* under {@link DURABLE_STEP_META} on the handler function so step discovery can wrap it with
|
|
8
|
+
* validation at the serve boundary. A global-registry symbol so it survives duplicate copies.
|
|
9
|
+
*/
|
|
10
|
+
export declare const DURABLE_STEP_META: unique symbol;
|
|
11
|
+
/** Discovery metadata a decorated/`defineStep` handler carries: routing name + optional zod schemas. */
|
|
12
|
+
export interface DurableStepMeta {
|
|
13
|
+
/** The resolved routing name — derived (`Class.method`) or explicit, always present. */
|
|
14
|
+
name: string;
|
|
15
|
+
/** Opt-in runtime input schema, validated when the handler is served. Absent on a bare `@Step()`. */
|
|
16
|
+
input?: z.ZodType | undefined;
|
|
17
|
+
/** Opt-in runtime output schema, validated before the handler's result is handed back. */
|
|
18
|
+
output?: z.ZodType | undefined;
|
|
19
|
+
}
|
|
20
|
+
/** Options for the object call form of {@link Step} / {@link defineStep}. */
|
|
21
|
+
export interface StepDecoratorOptions {
|
|
22
|
+
/** Explicit routing name, overriding the derived `Class.method`. */
|
|
23
|
+
name?: string;
|
|
24
|
+
/** Runtime input schema, validated at the serve boundary (opt-in — a bare `@Step()` skips it). */
|
|
25
|
+
input?: z.ZodType;
|
|
26
|
+
/** Runtime output schema, validated before the result is returned (opt-in). */
|
|
27
|
+
output?: z.ZodType;
|
|
28
|
+
/** Def-level policy: max attempts before the step (and run) fails. Read by `ctx.step` via `stepConfigOf`. */
|
|
29
|
+
retries?: number;
|
|
30
|
+
/** How the delay between retries grows: `fixed` (constant) or `exp` (doubles each attempt). */
|
|
31
|
+
backoff?: BackoffStrategy;
|
|
32
|
+
/** Base delay in ms between retries. Omit (or 0) to retry with no delay. */
|
|
33
|
+
backoffMs?: number;
|
|
34
|
+
/** Upper bound on the (exponential) backoff delay. */
|
|
35
|
+
backoffMaxMs?: number;
|
|
36
|
+
/** Add random jitter (50–100% of the computed delay) to avoid thundering-herd retries. */
|
|
37
|
+
jitter?: boolean;
|
|
38
|
+
/** Liveness window for the dispatched step (ms): presume the worker dead and re-dispatch on timeout. */
|
|
39
|
+
timeoutMs?: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Marks a class method as a durable **step handler**. A dispatched task is routed to it BY NAME —
|
|
43
|
+
* `ctx.step(this.svc.method, input)` reads that same name off the method reference (the shared
|
|
44
|
+
* `DURABLE_STEP_NAME` stamp), so there is no separately-declared def linking a call site to a
|
|
45
|
+
* handler. The method's single argument is the step input (plus an optional `StepLogger` 2nd arg);
|
|
46
|
+
* its return is the step output.
|
|
47
|
+
*
|
|
48
|
+
* Three call forms:
|
|
49
|
+
* - `@Step()` — bare: the routing name is DERIVED as `` `${ClassName}.${method}` `` — refactor-safe.
|
|
50
|
+
* - `@Step('custom:name')` — explicit name override (a stable cross-runtime contract).
|
|
51
|
+
* - `@Step({ name?, input?, output?, retries?, backoff?, backoffMs?, backoffMaxMs?, jitter?,
|
|
52
|
+
* timeoutMs? })` — optional name override, opt-in RUNTIME zod schemas (validated at the serve
|
|
53
|
+
* boundary by step discovery), and a def-level durable-retry/liveness policy `ctx.step` reads via
|
|
54
|
+
* `stepConfigOf` (a per-call `opts` overrides it field-by-field).
|
|
55
|
+
*/
|
|
56
|
+
export declare function Step(nameOrOptions?: string | StepDecoratorOptions): MethodDecorator;
|
|
57
|
+
/**
|
|
58
|
+
* Build a durable step handler WITHOUT a class/decorator: stamps `fn` with the routing `name` (and
|
|
59
|
+
* optional zod schemas + dispatch policy) so it works as a typed {@link StepRef} for
|
|
60
|
+
* `ctx.step(fn, input)` AND is discoverable/registerable by name. The cross-runtime baseline — pass
|
|
61
|
+
* the returned ref to `ctx.step`, or register it on a transport via `registerStep`.
|
|
62
|
+
*
|
|
63
|
+
* ```ts
|
|
64
|
+
* export const charge = defineStep('billing:charge', async (input: ChargeInput) => { ... })
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare function defineStep<TInput, TOutput>(name: string, fn: (input: TInput) => TOutput | Promise<TOutput>, config?: Omit<StepDecoratorOptions, 'name'>): StepRef<TInput, TOutput>;
|
|
68
|
+
/** Read the {@link DurableStepMeta} a `@Step`/`defineStep` stamped on a handler, or `undefined`. */
|
|
69
|
+
export declare function stepMetaOf(ref: unknown): DurableStepMeta | undefined;
|
|
70
|
+
//# sourceMappingURL=step-ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-ref.d.ts","sourceRoot":"","sources":["../../src/step-ref.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAIL,KAAK,OAAO,EACb,MAAM,uBAAuB,CAAC;AAE/B;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,OAAO,MAA+C,CAAC;AAEvF,wGAAwG;AACxG,MAAM,WAAW,eAAe;IAC9B,wFAAwF;IACxF,IAAI,EAAE,MAAM,CAAC;IACb,qGAAqG;IACrG,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,GAAG,SAAS,CAAC;IAC9B,0FAA0F;IAC1F,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,GAAG,SAAS,CAAC;CAChC;AAED,6EAA6E;AAC7E,MAAM,WAAW,oBAAoB;IACnC,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kGAAkG;IAClG,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC;IAClB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC;IACnB,6GAA6G;IAC7G,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+FAA+F;IAC/F,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0FAA0F;IAC1F,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,wGAAwG;IACxG,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAyBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,IAAI,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,oBAAoB,GAAG,eAAe,CAiBnF;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,EACxC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,EACjD,MAAM,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC,GAC1C,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAQ1B;AAED,oGAAoG;AACpG,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,GAAG,SAAS,CAGpE"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { DURABLE_STEP_CONFIG, DURABLE_STEP_NAME, } from './step-name-symbol.js';
|
|
2
|
+
/**
|
|
3
|
+
* The full metadata a `@Step` / {@link defineStep} stamps on a step handler for discovery: its
|
|
4
|
+
* resolved routing `name` plus the opt-in runtime zod schemas an authoring layer attached. Stamped
|
|
5
|
+
* under {@link DURABLE_STEP_META} on the handler function so step discovery can wrap it with
|
|
6
|
+
* validation at the serve boundary. A global-registry symbol so it survives duplicate copies.
|
|
7
|
+
*/
|
|
8
|
+
export const DURABLE_STEP_META = Symbol.for('@agora/durable:step-meta');
|
|
9
|
+
/** Build the {@link StepConfig} to stamp from options — omitting every unset field, so a bare
|
|
10
|
+
* `@Step()` (or one with only `name`/`input`/`output`) stamps nothing and leaves `ctx.step` reading
|
|
11
|
+
* only a per-call `opts` override. */
|
|
12
|
+
function stepConfigFrom(options) {
|
|
13
|
+
const config = {};
|
|
14
|
+
if (options.retries !== undefined)
|
|
15
|
+
config.retries = options.retries;
|
|
16
|
+
if (options.backoff !== undefined)
|
|
17
|
+
config.backoff = options.backoff;
|
|
18
|
+
if (options.backoffMs !== undefined)
|
|
19
|
+
config.backoffMs = options.backoffMs;
|
|
20
|
+
if (options.backoffMaxMs !== undefined)
|
|
21
|
+
config.backoffMaxMs = options.backoffMaxMs;
|
|
22
|
+
if (options.jitter !== undefined)
|
|
23
|
+
config.jitter = options.jitter;
|
|
24
|
+
if (options.timeoutMs !== undefined)
|
|
25
|
+
config.timeoutMs = options.timeoutMs;
|
|
26
|
+
return Object.keys(config).length > 0 ? config : undefined;
|
|
27
|
+
}
|
|
28
|
+
/** Stamp the shared cross-package name/config/meta keys onto a step handler function. */
|
|
29
|
+
function stamp(fn, meta, config) {
|
|
30
|
+
fn[DURABLE_STEP_NAME] = meta.name;
|
|
31
|
+
fn[DURABLE_STEP_META] = meta;
|
|
32
|
+
if (config !== undefined) {
|
|
33
|
+
fn[DURABLE_STEP_CONFIG] = config;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Marks a class method as a durable **step handler**. A dispatched task is routed to it BY NAME —
|
|
38
|
+
* `ctx.step(this.svc.method, input)` reads that same name off the method reference (the shared
|
|
39
|
+
* `DURABLE_STEP_NAME` stamp), so there is no separately-declared def linking a call site to a
|
|
40
|
+
* handler. The method's single argument is the step input (plus an optional `StepLogger` 2nd arg);
|
|
41
|
+
* its return is the step output.
|
|
42
|
+
*
|
|
43
|
+
* Three call forms:
|
|
44
|
+
* - `@Step()` — bare: the routing name is DERIVED as `` `${ClassName}.${method}` `` — refactor-safe.
|
|
45
|
+
* - `@Step('custom:name')` — explicit name override (a stable cross-runtime contract).
|
|
46
|
+
* - `@Step({ name?, input?, output?, retries?, backoff?, backoffMs?, backoffMaxMs?, jitter?,
|
|
47
|
+
* timeoutMs? })` — optional name override, opt-in RUNTIME zod schemas (validated at the serve
|
|
48
|
+
* boundary by step discovery), and a def-level durable-retry/liveness policy `ctx.step` reads via
|
|
49
|
+
* `stepConfigOf` (a per-call `opts` overrides it field-by-field).
|
|
50
|
+
*/
|
|
51
|
+
export function Step(nameOrOptions) {
|
|
52
|
+
return ((target, propertyKey, descriptor) => {
|
|
53
|
+
const options = typeof nameOrOptions === 'string' ? { name: nameOrOptions } : (nameOrOptions ?? {});
|
|
54
|
+
const ctorName = target?.constructor?.name ?? 'Step';
|
|
55
|
+
const name = options.name ?? `${ctorName}.${String(propertyKey)}`;
|
|
56
|
+
const value = descriptor.value;
|
|
57
|
+
if (typeof value !== 'function') {
|
|
58
|
+
throw new Error(`@Step can only decorate a method (${ctorName}.${String(propertyKey)})`);
|
|
59
|
+
}
|
|
60
|
+
const meta = {
|
|
61
|
+
name,
|
|
62
|
+
...(options.input ? { input: options.input } : {}),
|
|
63
|
+
...(options.output ? { output: options.output } : {}),
|
|
64
|
+
};
|
|
65
|
+
stamp(value, meta, stepConfigFrom(options));
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Build a durable step handler WITHOUT a class/decorator: stamps `fn` with the routing `name` (and
|
|
70
|
+
* optional zod schemas + dispatch policy) so it works as a typed {@link StepRef} for
|
|
71
|
+
* `ctx.step(fn, input)` AND is discoverable/registerable by name. The cross-runtime baseline — pass
|
|
72
|
+
* the returned ref to `ctx.step`, or register it on a transport via `registerStep`.
|
|
73
|
+
*
|
|
74
|
+
* ```ts
|
|
75
|
+
* export const charge = defineStep('billing:charge', async (input: ChargeInput) => { ... })
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export function defineStep(name, fn, config) {
|
|
79
|
+
const meta = {
|
|
80
|
+
name,
|
|
81
|
+
...(config?.input ? { input: config.input } : {}),
|
|
82
|
+
...(config?.output ? { output: config.output } : {}),
|
|
83
|
+
};
|
|
84
|
+
stamp(fn, meta, stepConfigFrom({ ...config, name }));
|
|
85
|
+
return fn;
|
|
86
|
+
}
|
|
87
|
+
/** Read the {@link DurableStepMeta} a `@Step`/`defineStep` stamped on a handler, or `undefined`. */
|
|
88
|
+
export function stepMetaOf(ref) {
|
|
89
|
+
if (typeof ref !== 'function' && typeof ref !== 'object')
|
|
90
|
+
return undefined;
|
|
91
|
+
return ref?.[DURABLE_STEP_META];
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=step-ref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-ref.js","sourceRoot":"","sources":["../../src/step-ref.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,GAGlB,MAAM,uBAAuB,CAAC;AAE/B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAkB,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAkCvF;;uCAEuC;AACvC,SAAS,cAAc,CAAC,OAA6B;IACnD,MAAM,MAAM,GAAe,EAAE,CAAC;IAC9B,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS;QAAE,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IACpE,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS;QAAE,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IACpE,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS;QAAE,MAAM,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAC1E,IAAI,OAAO,CAAC,YAAY,KAAK,SAAS;QAAE,MAAM,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;IACnF,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS;QAAE,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IACjE,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS;QAAE,MAAM,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAC1E,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC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,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACtD,CAAC;QACF,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9C,CAAC,CAAoB,CAAC;AACxB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CACxB,IAAY,EACZ,EAAiD,EACjD,MAA2C;IAE3C,MAAM,IAAI,GAAoB;QAC5B,IAAI;QACJ,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACrD,CAAC;IACF,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACrD,OAAO,EAA8B,CAAC;AACxC,CAAC;AAED,oGAAoG;AACpG,MAAM,UAAU,UAAU,CAAC,GAAY;IACrC,IAAI,OAAO,GAAG,KAAK,UAAU,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC3E,OAAQ,GAAwD,EAAE,CAAC,iBAAiB,CAAC,CAAC;AACxF,CAAC"}
|
|
@@ -10,6 +10,7 @@ export declare const DURABLE_TABLES: {
|
|
|
10
10
|
readonly attributes: "durable_run_attributes";
|
|
11
11
|
readonly signalWaiters: "durable_signal_waiters";
|
|
12
12
|
readonly bufferedSignals: "durable_buffered_signals";
|
|
13
|
+
readonly bufferedEvents: "durable_buffered_events";
|
|
13
14
|
};
|
|
14
15
|
/**
|
|
15
16
|
* Idempotent DDL for the durable tables, expressed via Lucid's schema builder (Knex). Works across
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lucid-schema.d.ts","sourceRoot":"","sources":["../../../src/stores/lucid-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"lucid-schema.d.ts","sourceRoot":"","sources":["../../../src/stores/lucid-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;;;;CAOjB,CAAC;AAEX;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAoIrE;AAED,uFAAuF;AACvF,wBAAsB,iBAAiB,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAQnE"}
|
|
@@ -9,6 +9,7 @@ export const DURABLE_TABLES = {
|
|
|
9
9
|
attributes: 'durable_run_attributes',
|
|
10
10
|
signalWaiters: 'durable_signal_waiters',
|
|
11
11
|
bufferedSignals: 'durable_buffered_signals',
|
|
12
|
+
bufferedEvents: 'durable_buffered_events',
|
|
12
13
|
};
|
|
13
14
|
/**
|
|
14
15
|
* Idempotent DDL for the durable tables, expressed via Lucid's schema builder (Knex). Works across
|
|
@@ -133,10 +134,24 @@ export async function createDurableTables(db) {
|
|
|
133
134
|
table.index(['token'], 'durable_buffered_signals_token_idx');
|
|
134
135
|
});
|
|
135
136
|
}
|
|
137
|
+
// Reliable (buffered) events: a publish that matched NO live waiter keeps ONE copy here, consumed
|
|
138
|
+
// by the first future matching `waitForEvent`. Keyed by `name` (not token) since many waiters can
|
|
139
|
+
// share a name with different `match` criteria; the caller-minted `id` is the PK so a claim targets
|
|
140
|
+
// an exact row. `published_at` is epoch-ms (for oldest-first scan + optional TTL pruning).
|
|
141
|
+
if (!(await conn().hasTable(DURABLE_TABLES.bufferedEvents))) {
|
|
142
|
+
await conn().createTable(DURABLE_TABLES.bufferedEvents, (table) => {
|
|
143
|
+
table.string('id').primary();
|
|
144
|
+
table.string('name').notNullable();
|
|
145
|
+
table.text('payload');
|
|
146
|
+
table.bigInteger('published_at').notNullable();
|
|
147
|
+
table.index(['name', 'published_at'], 'durable_buffered_events_name_idx');
|
|
148
|
+
});
|
|
149
|
+
}
|
|
136
150
|
}
|
|
137
151
|
/** Drop every durable table (reverse FK order). Used by tests and migration `down`. */
|
|
138
152
|
export async function dropDurableTables(db) {
|
|
139
153
|
const conn = () => db.connection().schema;
|
|
154
|
+
await conn().dropTableIfExists(DURABLE_TABLES.bufferedEvents);
|
|
140
155
|
await conn().dropTableIfExists(DURABLE_TABLES.bufferedSignals);
|
|
141
156
|
await conn().dropTableIfExists(DURABLE_TABLES.signalWaiters);
|
|
142
157
|
await conn().dropTableIfExists(DURABLE_TABLES.attributes);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lucid-schema.js","sourceRoot":"","sources":["../../../src/stores/lucid-schema.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,0BAA0B;IACvC,UAAU,EAAE,wBAAwB;IACpC,aAAa,EAAE,wBAAwB;IACvC,eAAe,EAAE,0BAA0B;
|
|
1
|
+
{"version":3,"file":"lucid-schema.js","sourceRoot":"","sources":["../../../src/stores/lucid-schema.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,0BAA0B;IACvC,UAAU,EAAE,wBAAwB;IACpC,aAAa,EAAE,wBAAwB;IACvC,eAAe,EAAE,0BAA0B;IAC3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AAC,iBAAiB,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IAC1D,MAAM,IAAI,EAAE,CAAC,iBAAiB,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAC3D,MAAM,IAAI,EAAE,CAAC,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -43,10 +43,23 @@ export declare class LucidStateStore implements StateStore {
|
|
|
43
43
|
putSignalWaiter(waiter: SignalWaiter): Promise<void>;
|
|
44
44
|
takeSignalWaiter(token: string): Promise<SignalWaiter | null>;
|
|
45
45
|
listSignalWaiters(prefix: string): Promise<SignalWaiter[]>;
|
|
46
|
+
removeSignalWaiter(waiter: SignalWaiter): Promise<void>;
|
|
46
47
|
bufferSignal(token: string, payload: unknown): Promise<void>;
|
|
47
48
|
takeBufferedSignal(token: string): Promise<{
|
|
48
49
|
payload: unknown;
|
|
49
50
|
} | null>;
|
|
51
|
+
bufferEvent(input: {
|
|
52
|
+
name: string;
|
|
53
|
+
payload: unknown;
|
|
54
|
+
id: string;
|
|
55
|
+
publishedAt: number;
|
|
56
|
+
}): Promise<void>;
|
|
57
|
+
listBufferedEvents(name: string, limit: number): Promise<Array<{
|
|
58
|
+
id: string;
|
|
59
|
+
payload: unknown;
|
|
60
|
+
publishedAt: number;
|
|
61
|
+
}>>;
|
|
62
|
+
removeBufferedEvent(id: string): Promise<boolean>;
|
|
50
63
|
transaction<T>(work: (tx: {
|
|
51
64
|
raw: unknown;
|
|
52
65
|
saveCheckpoint: (cp: StepCheckpoint) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lucid.d.ts","sourceRoot":"","sources":["../../../src/stores/lucid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAKzD,OAAO,KAAK,EAEV,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,cAAc,EACd,WAAW,EACZ,MAAM,kBAAk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