nestjs-serverless-workflow 0.0.7 → 0.0.8

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 (97) hide show
  1. package/README.md +55 -32
  2. package/dist/adapter/durable-lambda.adapter.d.ts +55 -0
  3. package/dist/adapter/durable-lambda.adapter.d.ts.map +1 -0
  4. package/dist/adapter/durable-lambda.adapter.js +71 -0
  5. package/dist/adapter/durable-lambda.adapter.js.map +1 -0
  6. package/dist/adapter/index.d.ts +1 -1
  7. package/dist/adapter/index.d.ts.map +1 -1
  8. package/dist/adapter/index.js +1 -1
  9. package/dist/adapter/index.js.map +1 -1
  10. package/dist/core/decorators/default.decorator.js +1 -1
  11. package/dist/core/decorators/default.decorator.js.map +1 -1
  12. package/dist/core/decorators/event.decorator.d.ts +0 -2
  13. package/dist/core/decorators/event.decorator.d.ts.map +1 -1
  14. package/dist/core/decorators/event.decorator.js +0 -9
  15. package/dist/core/decorators/event.decorator.js.map +1 -1
  16. package/dist/core/decorators/params.decorator.d.ts.map +1 -1
  17. package/dist/core/decorators/params.decorator.js.map +1 -1
  18. package/dist/core/decorators/with-retry.decorator.d.ts +1 -1
  19. package/dist/core/decorators/with-retry.decorator.d.ts.map +1 -1
  20. package/dist/core/decorators/with-retry.decorator.js +0 -1
  21. package/dist/core/decorators/with-retry.decorator.js.map +1 -1
  22. package/dist/core/decorators/workflow.decorator.d.ts +1 -1
  23. package/dist/core/decorators/workflow.decorator.d.ts.map +1 -1
  24. package/dist/core/decorators/workflow.decorator.js +1 -2
  25. package/dist/core/decorators/workflow.decorator.js.map +1 -1
  26. package/dist/core/providers/index.d.ts +1 -1
  27. package/dist/core/providers/index.d.ts.map +1 -1
  28. package/dist/core/providers/index.js +1 -1
  29. package/dist/core/providers/index.js.map +1 -1
  30. package/dist/core/providers/orchestrator.service.d.ts +21 -0
  31. package/dist/core/providers/orchestrator.service.d.ts.map +1 -0
  32. package/dist/core/providers/orchestrator.service.js +156 -0
  33. package/dist/core/providers/orchestrator.service.js.map +1 -0
  34. package/dist/core/providers/router.factory.d.ts +2 -2
  35. package/dist/core/providers/router.factory.d.ts.map +1 -1
  36. package/dist/core/providers/router.factory.js +1 -1
  37. package/dist/core/providers/router.factory.js.map +1 -1
  38. package/dist/core/providers/router.service.d.ts +8 -3
  39. package/dist/core/providers/router.service.d.ts.map +1 -1
  40. package/dist/core/providers/router.service.js +29 -23
  41. package/dist/core/providers/router.service.js.map +1 -1
  42. package/dist/core/types/index.d.ts +3 -2
  43. package/dist/core/types/index.d.ts.map +1 -1
  44. package/dist/core/types/index.js +3 -4
  45. package/dist/core/types/index.js.map +1 -1
  46. package/dist/core/types/transit-result.type.d.ts +15 -0
  47. package/dist/core/types/transit-result.type.d.ts.map +1 -0
  48. package/dist/core/types/transit-result.type.js +2 -0
  49. package/dist/core/types/transit-result.type.js.map +1 -0
  50. package/dist/core/types/workflow-definition.interface.d.ts +1 -20
  51. package/dist/core/types/workflow-definition.interface.d.ts.map +1 -1
  52. package/dist/{event-bus → core}/types/workflow-event.interface.d.ts +1 -1
  53. package/dist/core/types/workflow-event.interface.d.ts.map +1 -0
  54. package/dist/core/types/workflow-event.interface.js.map +1 -0
  55. package/dist/core/utils/retry-backoff.d.ts.map +1 -1
  56. package/dist/core/utils/retry-backoff.js +6 -6
  57. package/dist/core/utils/retry-backoff.js.map +1 -1
  58. package/dist/core/workflow.module.d.ts +0 -2
  59. package/dist/core/workflow.module.d.ts.map +1 -1
  60. package/dist/core/workflow.module.js +9 -3
  61. package/dist/core/workflow.module.js.map +1 -1
  62. package/package.json +15 -4
  63. package/dist/adapter/lambda.adapater.d.ts +0 -4
  64. package/dist/adapter/lambda.adapater.d.ts.map +0 -1
  65. package/dist/adapter/lambda.adapater.js +0 -66
  66. package/dist/adapter/lambda.adapater.js.map +0 -1
  67. package/dist/core/providers/ochestrator.service.d.ts +0 -33
  68. package/dist/core/providers/ochestrator.service.d.ts.map +0 -1
  69. package/dist/core/providers/ochestrator.service.js +0 -184
  70. package/dist/core/providers/ochestrator.service.js.map +0 -1
  71. package/dist/core/providers/saga.service.d.ts +0 -28
  72. package/dist/core/providers/saga.service.d.ts.map +0 -1
  73. package/dist/core/providers/saga.service.js +0 -156
  74. package/dist/core/providers/saga.service.js.map +0 -1
  75. package/dist/core/types/saga.interface.d.ts +0 -144
  76. package/dist/core/types/saga.interface.d.ts.map +0 -1
  77. package/dist/core/types/saga.interface.js +0 -26
  78. package/dist/core/types/saga.interface.js.map +0 -1
  79. package/dist/event-bus/index.d.ts +0 -3
  80. package/dist/event-bus/index.d.ts.map +0 -1
  81. package/dist/event-bus/index.js +0 -3
  82. package/dist/event-bus/index.js.map +0 -1
  83. package/dist/event-bus/sqs/sqs.emitter.d.ts +0 -6
  84. package/dist/event-bus/sqs/sqs.emitter.d.ts.map +0 -1
  85. package/dist/event-bus/sqs/sqs.emitter.js +0 -6
  86. package/dist/event-bus/sqs/sqs.emitter.js.map +0 -1
  87. package/dist/event-bus/types/broker-publisher.interface.d.ts +0 -5
  88. package/dist/event-bus/types/broker-publisher.interface.d.ts.map +0 -1
  89. package/dist/event-bus/types/broker-publisher.interface.js +0 -2
  90. package/dist/event-bus/types/broker-publisher.interface.js.map +0 -1
  91. package/dist/event-bus/types/index.d.ts +0 -3
  92. package/dist/event-bus/types/index.d.ts.map +0 -1
  93. package/dist/event-bus/types/index.js +0 -3
  94. package/dist/event-bus/types/index.js.map +0 -1
  95. package/dist/event-bus/types/workflow-event.interface.d.ts.map +0 -1
  96. package/dist/event-bus/types/workflow-event.interface.js.map +0 -1
  97. /package/dist/{event-bus → core}/types/workflow-event.interface.js +0 -0
package/README.md CHANGED
@@ -8,23 +8,22 @@ A powerful, tree-shakable workflow and state machine library for NestJS applicat
8
8
  ## Features
9
9
 
10
10
  - 🎯 **State Machine Engine**: Define workflows with states, transitions, and events
11
- - 🔄 **Event-Driven Architecture**: Integrate with message brokers (SQS, Kafka, RabbitMQ, etc.)
12
- - **Serverless Optimized**: Built for AWS Lambda with automatic timeout handling
11
+ - **Serverless Optimized**: Built for AWS Lambda with durable execution support
12
+ - 🔄 **Durable Execution**: Checkpoint and replay workflows across Lambda invocations using AWS Durable Functions
13
13
  - 📦 **Tree-Shakable**: Subpath exports ensure minimal bundle sizes
14
14
  - 🛡️ **Type-Safe**: Full TypeScript support with comprehensive type definitions
15
15
  - 🔁 **Retry Logic**: Built-in retry mechanisms with exponential backoff
16
16
  - 🎨 **Decorator-Based API**: Clean, declarative workflow definitions
17
- - 📊 **Saga Pattern Support**: Distributed transaction managementa (TODO)
18
17
 
19
18
  ## Installation
20
19
 
21
20
  ```bash
22
- # Using npm
23
- npm install nestjs-serverless-workflow @nestjs/common @nestjs/core reflect-metadata rxjs
24
-
25
21
  # Using bun
26
22
  bun add nestjs-serverless-workflow @nestjs/common @nestjs/core reflect-metadata rxjs
27
23
 
24
+ # Using npm
25
+ npm install nestjs-serverless-workflow @nestjs/common @nestjs/core reflect-metadata rxjs
26
+
28
27
  # Using yarn
29
28
  yarn add nestjs-serverless-workflow @nestjs/common @nestjs/core reflect-metadata rxjs
30
29
  ```
@@ -73,7 +72,6 @@ import { Workflow, OnEvent, Entity, Payload } from 'nestjs-serverless-workflow/c
73
72
  },
74
73
  ],
75
74
  entityService: 'entity.order',
76
- brokerPublisher: 'broker.order',
77
75
  })
78
76
  export class OrderWorkflow {
79
77
  @OnEvent('order.submit')
@@ -133,7 +131,6 @@ import { OrderEntityService } from './order-entity.service';
133
131
  WorkflowModule.register({
134
132
  entities: [{ provide: 'entity.order', useClass: OrderEntityService }],
135
133
  workflows: [OrderWorkflow],
136
- brokers: [{ provide: 'broker.order', useClass: MySqsEmitter }],
137
134
  }),
138
135
  ],
139
136
  })
@@ -146,7 +143,6 @@ export class OrderModule {}
146
143
 
147
144
  - [Getting Started](https://tung-dnt.github.io/nestjs-serverless-workflow/docs/getting-started)
148
145
  - [Workflow Module](https://tung-dnt.github.io/nestjs-serverless-workflow/docs/workflow)
149
- - [Event Bus](https://tung-dnt.github.io/nestjs-serverless-workflow/docs/event-bus)
150
146
  - [Lambda Adapter](https://tung-dnt.github.io/nestjs-serverless-workflow/docs/adapters)
151
147
  - [API Reference](https://tung-dnt.github.io/nestjs-serverless-workflow/docs/api-reference/workflow-module)
152
148
  - [Examples](https://tung-dnt.github.io/nestjs-serverless-workflow/docs/examples/lambda-order-state-machine)
@@ -157,35 +153,48 @@ The library is organized into tree-shakable subpath exports:
157
153
 
158
154
  ```
159
155
  nestjs-serverless-workflow/
160
- ├── core # Core workflow engine (decorators, services, types)
161
- ├── event-bus # Event publishing and broker integration
162
- ├── adapter # Runtime adapters (Lambda, HTTP)
156
+ ├── core # Core workflow engine (decorators, services, types, IWorkflowEvent)
157
+ ├── adapter # Durable Lambda adapter for checkpoint/replay execution
163
158
  └── exception # Custom exception types
164
159
  ```
165
160
 
166
161
  ### Import Only What You Need
167
162
 
168
163
  ```typescript
169
- // Only imports workflow module
170
- import { WorkflowModule } from 'nestjs-serverless-workflow/core';
171
-
172
- // Only imports event bus
173
- import { IBrokerPublisher } from 'nestjs-serverless-workflow/event-bus';
164
+ // Core workflow engine
165
+ import { WorkflowModule, IWorkflowEvent } from 'nestjs-serverless-workflow/core';
174
166
 
175
- // Only imports Lambda adapter
176
- import { LambdaEventHandler } from 'nestjs-serverless-workflow/adapter';
167
+ // Durable Lambda adapter
168
+ import { DurableLambdaEventHandler } from 'nestjs-serverless-workflow/adapter';
177
169
 
178
- // Only imports exceptions
170
+ // Exceptions
179
171
  import { UnretriableException } from 'nestjs-serverless-workflow/exception';
180
172
  ```
181
173
 
182
174
  This ensures minimal bundle sizes and faster cold starts in serverless environments.
183
175
 
176
+ ## Transit Result
177
+
178
+ The `transit()` method on the orchestrator returns a `TransitResult`, which adapters use to decide what to do next:
179
+
180
+ ```typescript
181
+ type TransitResult =
182
+ | { status: 'final'; state: string | number }
183
+ | { status: 'idle'; state: string | number }
184
+ | { status: 'continued'; nextEvent: IWorkflowEvent }
185
+ | { status: 'no_transition'; state: string | number };
186
+ ```
187
+
188
+ - **`final`** -- the workflow has reached a terminal state.
189
+ - **`idle`** -- the workflow is waiting for an external event.
190
+ - **`continued`** -- the workflow auto-transitioned and provides the next event to process.
191
+ - **`no_transition`** -- no matching transition was found from the current state.
192
+
184
193
  ## Examples
185
194
 
186
195
  Check out the [examples directory](https://github.com/tung-dnt/nestjs-serverless-workflow/tree/main/examples) for complete working examples:
187
196
 
188
- - **[Lambda Order State Machine](https://github.com/tung-dnt/nestjs-serverless-workflow/tree/main/examples/lambda-order-state-machine/)**: Complete AWS Lambda example with SQS and DynamoDB
197
+ - **[Lambda Order State Machine](https://github.com/tung-dnt/nestjs-serverless-workflow/tree/main/examples/lambda-order-state-machine/)**: Complete AWS Lambda example with DynamoDB and durable execution
189
198
 
190
199
  ## Key Concepts
191
200
 
@@ -214,7 +223,18 @@ Transitions define how entities move from one state to another, triggered by eve
214
223
 
215
224
  ### Events
216
225
 
217
- Events trigger state transitions. Define event handlers using the `@OnEvent` decorator:
226
+ Events trigger state transitions. The `IWorkflowEvent` interface (from `nestjs-serverless-workflow/core`) defines the shape of workflow events:
227
+
228
+ ```typescript
229
+ interface IWorkflowEvent<T = any> {
230
+ event: string; // event name that triggers a transition
231
+ urn: string | number; // unique identifier of the entity
232
+ payload?: T; // optional data passed to the handler
233
+ attempt: number; // retry attempt counter
234
+ }
235
+ ```
236
+
237
+ Define event handlers using the `@OnEvent` decorator:
218
238
 
219
239
  ```typescript
220
240
  @OnEvent('order.submit')
@@ -225,19 +245,22 @@ async onSubmit(@Entity() entity: Order, @Payload() data: any) {
225
245
 
226
246
  ## AWS Lambda Integration
227
247
 
228
- The library includes a Lambda adapter that handles:
248
+ The library includes a Durable Lambda adapter (`DurableLambdaEventHandler`) that leverages [AWS Lambda Durable Functions](https://aws.amazon.com/blogs/compute/) for checkpoint and replay. Each workflow instance runs as a single durable execution spanning multiple Lambda invocations:
229
249
 
230
- - Automatic timeout management
231
- - Batch item failures
232
- - Graceful shutdown before timeout
233
- - SQS event source integration
250
+ - **Checkpointed steps** -- completed transitions are persisted; on replay they return stored results.
251
+ - **Idle state pausing** -- idle states pause via `waitForCallback()` until an external system resumes the workflow.
252
+ - **Final state completion** -- reaching a final state ends the durable execution.
234
253
 
235
254
  ```typescript
236
- import { LambdaEventHandler } from 'nestjs-serverless-workflow/adapter';
237
- import { type SQSHandler } from 'aws-lambda';
255
+ import { withDurableExecution } from '@aws/durable-execution-sdk-js';
256
+ import { NestFactory } from '@nestjs/core';
257
+ import { DurableLambdaEventHandler } from 'nestjs-serverless-workflow/adapter';
258
+ import { OrderModule } from './order/order.module';
259
+
260
+ const app = await NestFactory.createApplicationContext(OrderModule);
261
+ await app.init();
238
262
 
239
- const app = await NestFactory.createApplicationContext(AppModule);
240
- export const handler: SQSHandler = LambdaEventHandler(app);
263
+ export const handler = DurableLambdaEventHandler(app, withDurableExecution);
241
264
  ```
242
265
 
243
266
  ## Requirements
@@ -276,4 +299,4 @@ This project is licensed under the MIT License - see the [LICENSE](https://githu
276
299
 
277
300
  - [NestJS](https://nestjs.com/) - A progressive Node.js framework
278
301
  - [AWS Lambda](https://aws.amazon.com/lambda/) - Serverless compute service
279
- - [AWS SQS](https://aws.amazon.com/sqs/) - Message queuing service
302
+ - [AWS Lambda Durable Functions](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html) - Durable execution for Lambda
@@ -0,0 +1,55 @@
1
+ import type { INestApplicationContext } from '@nestjs/common';
2
+ export interface DurableWorkflowEvent {
3
+ urn: string | number;
4
+ initialEvent: string;
5
+ payload?: any;
6
+ }
7
+ export interface DurableWorkflowResult {
8
+ urn: string | number;
9
+ status: string;
10
+ state: string | number;
11
+ }
12
+ /**
13
+ * Minimal interface for the AWS Durable Execution SDK's DurableContext.
14
+ * The actual SDK (`@aws/durable-execution-sdk-js`) is a peer dependency — only needed at runtime.
15
+ */
16
+ export interface IDurableContext {
17
+ step<T>(name: string, fn: () => Promise<T>): Promise<T>;
18
+ waitForCallback<T>(name: string, onRegister: (callbackId: string) => Promise<void>, options?: {
19
+ timeout?: {
20
+ hours?: number;
21
+ minutes?: number;
22
+ seconds?: number;
23
+ };
24
+ }): Promise<T>;
25
+ wait(duration: {
26
+ seconds?: number;
27
+ minutes?: number;
28
+ hours?: number;
29
+ }): Promise<void>;
30
+ logger: {
31
+ info(msg: string, data?: any): void;
32
+ };
33
+ }
34
+ /**
35
+ * Type for the withDurableExecution wrapper function from the AWS SDK.
36
+ */
37
+ export type WithDurableExecution = <TEvent, TResult>(handler: (event: TEvent, ctx: IDurableContext) => Promise<TResult>) => (event: TEvent, ctx: any) => Promise<TResult>;
38
+ /**
39
+ * Creates a Lambda handler that wraps the workflow orchestrator in a durable execution.
40
+ *
41
+ * Each workflow instance runs as a single durable execution spanning multiple Lambda invocations.
42
+ * Steps are checkpointed at event boundaries — on replay, completed steps return stored results.
43
+ *
44
+ * Idle states pause via `ctx.waitForCallback()` until an external system submits a callback.
45
+ * Final states end the durable execution.
46
+ *
47
+ * @param app - NestJS application context
48
+ * @param withDurableExecution - The `withDurableExecution` function from `@aws/durable-execution-sdk-js`
49
+ */
50
+ export declare const DurableLambdaEventHandler: (app: INestApplicationContext, withDurableExecution: WithDurableExecution) => (event: DurableWorkflowEvent, ctx: any) => Promise<{
51
+ urn: string | number;
52
+ status: string;
53
+ state: string | number;
54
+ }>;
55
+ //# sourceMappingURL=durable-lambda.adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"durable-lambda.adapter.d.ts","sourceRoot":"","sources":["../../packages/adapter/durable-lambda.adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAG9D,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,GAAG,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MA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0 +1,71 @@
1
+ import { OrchestratorService } from '../core/index.js';
2
+ /**
3
+ * Creates a Lambda handler that wraps the workflow orchestrator in a durable execution.
4
+ *
5
+ * Each workflow instance runs as a single durable execution spanning multiple Lambda invocations.
6
+ * Steps are checkpointed at event boundaries — on replay, completed steps return stored results.
7
+ *
8
+ * Idle states pause via `ctx.waitForCallback()` until an external system submits a callback.
9
+ * Final states end the durable execution.
10
+ *
11
+ * @param app - NestJS application context
12
+ * @param withDurableExecution - The `withDurableExecution` function from `@aws/durable-execution-sdk-js`
13
+ */
14
+ export const DurableLambdaEventHandler = (app, withDurableExecution) => {
15
+ const orchestrator = app.get(OrchestratorService);
16
+ return withDurableExecution(async (event, ctx) => {
17
+ let currentEvent = {
18
+ event: event.initialEvent,
19
+ urn: event.urn,
20
+ payload: event.payload,
21
+ attempt: 0,
22
+ };
23
+ let iteration = 0;
24
+ while (true) {
25
+ const result = await orchestrator.transit(currentEvent);
26
+ switch (result.status) {
27
+ case 'final':
28
+ return { urn: event.urn, status: 'completed', state: result.state };
29
+ case 'idle': {
30
+ const callbackPayload = await ctx.waitForCallback(`idle:${result.state}:${iteration}`, async (callbackId) => {
31
+ // External systems use this callbackId to resume the workflow
32
+ // via SendDurableExecutionCallbackSuccess Lambda API
33
+ ctx.logger.info(`Waiting for callback at idle state ${result.state}`, { callbackId });
34
+ },
35
+ // TODO: remove hard-coded, exposed via execution function
36
+ { timeout: { hours: 24 } });
37
+ currentEvent = {
38
+ event: callbackPayload.event,
39
+ urn: event.urn,
40
+ payload: callbackPayload.payload,
41
+ attempt: 0,
42
+ };
43
+ break;
44
+ }
45
+ case 'continued': {
46
+ // Checkpoint the progression — on replay, returns stored result
47
+ await ctx.step(`${result.nextEvent.event}:${iteration}`, async () => result.nextEvent);
48
+ currentEvent = result.nextEvent;
49
+ break;
50
+ }
51
+ case 'no_transition': {
52
+ // No unambiguous auto-transition — wait for explicit event via callback
53
+ const noTransitionPayload = await ctx.waitForCallback(`awaiting:${result.state}:${iteration}`, async (callbackId) => {
54
+ ctx.logger.info(`No auto-transition from ${result.state}, waiting for explicit event`, { callbackId });
55
+ },
56
+ // TODO: remove hard-coded, exposed via execution function
57
+ { timeout: { hours: 24 } });
58
+ currentEvent = {
59
+ event: noTransitionPayload.event,
60
+ urn: event.urn,
61
+ payload: noTransitionPayload.payload,
62
+ attempt: 0,
63
+ };
64
+ break;
65
+ }
66
+ }
67
+ iteration++;
68
+ }
69
+ });
70
+ };
71
+ //# sourceMappingURL=durable-lambda.adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"durable-lambda.adapter.js","sourceRoot":"","sources":["../../packages/adapter/durable-lambda.adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAuB,MAAM,QAAQ,CAAC;AAoClE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,GAA4B,EAAE,oBAA0C,EAAE,EAAE,CAAC;IACrH,MAAM,YAAY,GAAG,GAAG,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IAElD,OAAO,oBAAoB,CAAC,KAAK,EAAE,KAA2B,EAAE,GAAoB,EAAE,EAAE,CAAC;QACvF,IAAI,YAAY,GAAmB;YACjC,KAAK,EAAE,KAAK,CAAC,YAAY;YACzB,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,OAAO,EAAE,CAAC;SACX,CAAC;QAEF,IAAI,SAAS,GAAG,CAAC,CAAC;QAElB,OAAO,IAAI,EAAE,CAAC;YACZ,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YAExD,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;gBACtB,KAAK,OAAO;oBACV,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAkC,CAAC;gBAEtG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,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAC3B,CAAC;oBACF,YAAY,GAAG;wBACb,KAAK,EAAE,mBAAmB,CAAC,KAAK;wBAChC,GAAG,EAAE,KAAK,CAAC,GAAG;wBACd,OAAO,EAAE,mBAAmB,CAAC,OAAO;wBACpC,OAAO,EAAE,CAAC;qBACX,CAAC;oBACF,MAAM;gBACR,CAAC;YACH,CAAC;YAED,SAAS,EAAE,CAAC;QACd,CAAC;IAAA,CACF,CAAC,CAAC;AAAA,CACJ,CAAC"}
@@ -1,2 +1,2 @@
1
- export * from './lambda.adapater.js';
1
+ export * from './durable-lambda.adapter.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/adapter/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/adapter/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -1,2 +1,2 @@
1
- export * from './lambda.adapater.js';
1
+ export * from './durable-lambda.adapter.js';
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../packages/adapter/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../packages/adapter/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export const WORKFLOW_DEFAULT_EVENT = 'workflow.default';
2
2
  export const OnDefault = (target, _propertyKey, descriptor) => {
3
- let existingFallback = Reflect.getMetadata(WORKFLOW_DEFAULT_EVENT, target.constructor);
3
+ const existingFallback = Reflect.getMetadata(WORKFLOW_DEFAULT_EVENT, target.constructor);
4
4
  if (!existingFallback) {
5
5
  Reflect.defineMetadata(WORKFLOW_DEFAULT_EVENT, descriptor.value, target.constructor);
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"default.decorator.js","sourceRoot":"","sources":["../../../packages/core/decorators/default.decorator.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAEzD,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAW,EAAE,YAAoB,EAAE,UAA8B,EAAE,EAAE,CAAC;IAC9F,IAAI,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,sBAAsB,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IACvF,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,OAAO,CAAC,cAAc,CAAC,sBAAsB,EAAE,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IACvF,CAAC;IACD,OAAO,UAAU,CAAC;AAAA,CACnB,CAAC"}
1
+ {"version":3,"file":"default.decorator.js","sourceRoot":"","sources":["../../../packages/core/decorators/default.decorator.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAEzD,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAW,EAAE,YAAoB,EAAE,UAA8B,EAAE,EAAE,CAAC;IAC9F,MAAM,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,sBAAsB,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IACzF,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,OAAO,CAAC,cAAc,CAAC,sBAAsB,EAAE,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IACvF,CAAC;IACD,OAAO,UAAU,CAAC;AAAA,CACnB,CAAC"}
@@ -1,5 +1,3 @@
1
- import type { ISagaConfig } from '../../core/index.js';
2
1
  export declare const WORKFLOW_HANDLER_KEY = "workflow:metadata";
3
2
  export declare const OnEvent: (event: string) => (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
4
- export declare const OnCompensation: (event: string, config: ISagaConfig) => (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
5
3
  //# sourceMappingURL=event.decorator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"event.decorator.d.ts","sourceRoot":"","sources":["../../../packages/core/decorators/event.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAoB,MAAM,QAAQ,CAAC;AAE5D,eAAO,MAAM,oBAAoB,sBAAsB,CAAC;AAExD,eAAO,MAAM,OAAO,6GAWnB,CAAC;AAEF,eAAO,MAAM,cAAc,kIAYxB,CAAC"}
1
+ {"version":3,"file":"event.decorator.d.ts","sourceRoot":"","sources":["../../../packages/core/decorators/event.decorator.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,sBAAsB,CAAC;AAExD,eAAO,MAAM,OAAO,6GAWnB,CAAC"}
@@ -8,13 +8,4 @@ export const OnEvent = (event) => (target, propertyKey, descriptor) => {
8
8
  workflowHandlers.push({ event, handler: descriptor.value, name: propertyKey });
9
9
  return descriptor;
10
10
  };
11
- export const OnCompensation = (event, config) => (target, propertyKey, descriptor) => {
12
- let workflowHandlers = Reflect.getMetadata(WORKFLOW_HANDLER_KEY, target.constructor);
13
- if (!workflowHandlers) {
14
- workflowHandlers = [];
15
- Reflect.defineMetadata(WORKFLOW_HANDLER_KEY, workflowHandlers, target.constructor);
16
- }
17
- workflowHandlers.push({ event, handler: descriptor.value, name: propertyKey, sagaConfig: config });
18
- return descriptor;
19
- };
20
11
  //# sourceMappingURL=event.decorator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"event.decorator.js","sourceRoot":"","sources":["../../../packages/core/decorators/event.decorator.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,oBAAoB,GAAG,mBAAmB,CAAC;AAExD,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,MAAW,EAAE,WAAmB,EA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,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,MAAW,EAAE,WAAmB,EAAE,UAA8B,EAAE,EAAE,CAAC;IAC9G,IAAI,gBAAgB,GAAuB,OAAO,CAAC,WAAW,CAAC,oBAAoB,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IAEzG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,gBAAgB,GAAG,EAAE,CAAC;QACtB,OAAO,CAAC,cAAc,CAAC,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IACrF,CAAC;IAED,gBAAgB,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;IAE/E,OAAO,UAAU,CAAC;AAAA,CACnB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"params.decorator.d.ts","sourceRoot":"","sources":["../../../packages/core/decorators/params.decorator.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM,IAAI,kBAAkB,CAO3C;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,kBAAkB,CAOtD"}
1
+ {"version":3,"file":"params.decorator.d.ts","sourceRoot":"","sources":["../../../packages/core/decorators/params.decorator.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM,IAAI,kBAAkB,CAQ3C;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,kBAAkB,CAQtD"}
@@ -1 +1 @@
1
- {"version":3,"file":"params.decorator.js","sourceRoot":"","sources":["../../../packages/core/decorators/params.decorator.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,MAAM,GAAuB;IAC3C,OAAO,CAAC,MAAc,EAAE,WAA6B,EAAE,cAAuB,EAAE,EAAE,CAAC;QACjF,IAAI,CAAC,WAAW,IAAI,cAAc,KAAK,SAAS;YAAE,MAAM,IAAI,KAA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,iBAAiB,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC;QAClG,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QACzD,OAAO,CAAC,cAAc,CAAC,iBAAiB,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;IAAA,CAC1E,CAAC;AAAA,CACH;AAED,MAAM,UAAU,OAAO,CAAI,GAAO,EAAsB;IACtD,OAAO,CAAC,MAAc,EAAE,WAA6B,EAAE,cAAuB,EAAE,EAAE,CAAC;QACjF,IAAI,CAAC,WAAW,IAAI,cAAc,KAAK,SAAS;YAC9C,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;QAC7E,MAAM,QAAQ,GAAe,OAAO,CAAC,cAAc,CAAC,iBAAiB,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC;QAClG,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;QAC/D,OAAO,CAAC,cAAc,CAAC,iBAAiB,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;IAAA,CAC1E,CAAC;AAAA,CACH"}
@@ -1,4 +1,4 @@
1
- import { type IBackoffRetryConfig } from '../types/index.js';
1
+ import type { IBackoffRetryConfig } from '../types/index.js';
2
2
  export declare const getRetryKey: (propertyKey: string) => string;
3
3
  export declare function WithRetry(config: IBackoffRetryConfig): (_target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
4
4
  //# sourceMappingURL=with-retry.decorator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"with-retry.decorator.d.ts","sourceRoot":"","sources":["../../../packages/core/decorators/with-retry.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAIpD,eAAO,MAAM,WAAW,iCAA8D,CAAC;AAEvF,wBAAgB,SAAS,CAAC,MAAM,EAAE,mBAAmB,6FAKpD"}
1
+ {"version":3,"file":"with-retry.decorator.d.ts","sourceRoot":"","sources":["../../../packages/core/decorators/with-retry.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAIpD,eAAO,MAAM,WAAW,iCAA8D,CAAC;AAEvF,wBAAgB,SAAS,CAAC,MAAM,EAAE,mBAAmB,6FAKpD"}
@@ -1,4 +1,3 @@
1
- import {} from '../types/index.js';
2
1
  const WITH_RETRY_KEY = 'workflow:retry';
3
2
  export const getRetryKey = (propertyKey) => `${WITH_RETRY_KEY}:${propertyKey}`;
4
3
  export function WithRetry(config) {
@@ -1 +1 @@
1
- {"version":3,"file":"with-retry.decorator.js","sourceRoot":"","sources":["../../../packages/core/decorators/with-retry.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,MAAM,UAAU,CAAC;AAEpD,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAExC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,WAAmB,EAAE,EAAE,CAAC,GAAG,cAAc,IAAI,WAAW,EAAE,CAAC;AAEvF,MAAM,UAAU,SAAS,CAAC,MAA2B,EAAE;IACrD,OAAO,CAAC,OAAY,EAAE,WAAmB,EAAE,UAA8B,EAAE,EAAE,CAAC;QAC5E,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;QAC3E,OAAO,UAAU,CAAC;IAAA,CACnB,CAAC;AAAA,CACH"}
1
+ {"version":3,"file":"with-retry.decorator.js","sourceRoot":"","sources":["../../../packages/core/decorators/with-retry.decorator.ts"],"names":[],"mappings":"AAEA,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAExC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,WAAmB,EAAE,EAAE,CAAC,GAAG,cAAc,IAAI,WAAW,EAAE,CAAC;AAEvF,MAAM,UAAU,SAAS,CAAC,MAA2B,EAAE;IACrD,OAAO,CAAC,OAAY,EAAE,WAAmB,EAAE,UAA8B,EAAE,EAAE,CAAC;QAC5E,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;QAC3E,OAAO,UAAU,CAAC;IAAA,CACnB,CAAC;AAAA,CACH"}
@@ -1,4 +1,4 @@
1
- import { type IWorkflowDefinition } from '../../core/index.js';
1
+ import type { IWorkflowDefinition } from '../../core/index.js';
2
2
  export declare const WORKFLOW_DEFINITION_KEY = "workflow:definition";
3
3
  export declare function Workflow<T, Event, State>(definition: IWorkflowDefinition<T, Event, State>): <T extends new (...args: any[]) => {}>(instance: T) => T;
4
4
  //# sourceMappingURL=workflow.decorator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.decorator.d.ts","sourceRoot":"","sources":["../../../packages/core/decorators/workflow.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAElD,eAAO,MAAM,uBAAuB,wBAAwB,CAAC;AAE7D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,IACvE,CAAC,uDAKnB"}
1
+ {"version":3,"file":"workflow.decorator.d.ts","sourceRoot":"","sources":["../../../packages/core/decorators/workflow.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAElD,eAAO,MAAM,uBAAuB,wBAAwB,CAAC;AAE7D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,IAChF,CAAC,uDAKV"}
@@ -1,7 +1,6 @@
1
- import {} from '../../core/index.js';
2
1
  export const WORKFLOW_DEFINITION_KEY = 'workflow:definition';
3
2
  export function Workflow(definition) {
4
- return function (instance) {
3
+ return (instance) => {
5
4
  Reflect.defineMetadata(WORKFLOW_DEFINITION_KEY, definition, instance);
6
5
  return instance;
7
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.decorator.js","sourceRoot":"","sources":["../../../packages/core/decorators/workflow.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,MAAM,QAAQ,CAAC;AAElD,MAAM,CAAC,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAE7D,MAAM,UAAU,QAAQ,CAAkB,UAAgD,EAAE;IAC1F,OAAO,UAAkD,QAAW,EAAE;QACpE,OAAO,CAAC,cAAc,CAAC,uBAAuB,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QAEtE,OAAO,QAAQ,CAAC;IAAA,CACjB,CAAC;AAAA,CACH"}
1
+ {"version":3,"file":"workflow.decorator.js","sourceRoot":"","sources":["../../../packages/core/decorators/workflow.decorator.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAE7D,MAAM,UAAU,QAAQ,CAAkB,UAAgD,EAAE;IAC1F,OAAO,CAAyC,QAAW,EAAE,EAAE,CAAC;QAC9D,OAAO,CAAC,cAAc,CAAC,uBAAuB,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QAEtE,OAAO,QAAQ,CAAC;IAAA,CACjB,CAAC;AAAA,CACH"}
@@ -1,4 +1,4 @@
1
- export * from './ochestrator.service.js';
1
+ export * from './orchestrator.service.js';
2
2
  export * from './router.factory.js';
3
3
  export * from './router.service.js';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/core/providers/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/core/providers/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
@@ -1,4 +1,4 @@
1
- export * from './ochestrator.service.js';
1
+ export * from './orchestrator.service.js';
2
2
  export * from './router.factory.js';
3
3
  export * from './router.service.js';
4
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/core/providers/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/core/providers/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { type TransitResult } from '../../core/index.js';
2
+ import { type OnModuleInit } from '@nestjs/common';
3
+ import { DiscoveryService, ModuleRef } from '@nestjs/core';
4
+ import type { IWorkflowEvent } from '../types/workflow-event.interface.js';
5
+ import { StateRouterHelperFactory } from './router.factory.js';
6
+ /**
7
+ * TODO:
8
+ * 1. Retry Service: Retry in state handler level via `IRetryHandler`
9
+ * +) Bind configs to lambda retry config
10
+ */
11
+ export declare class OrchestratorService implements OnModuleInit {
12
+ private readonly discoveryService;
13
+ private readonly routerHelperFactory;
14
+ private readonly moduleRef;
15
+ private routes;
16
+ private readonly logger;
17
+ constructor(discoveryService: DiscoveryService, routerHelperFactory: StateRouterHelperFactory, moduleRef: ModuleRef);
18
+ onModuleInit(): void;
19
+ transit(params: IWorkflowEvent): Promise<TransitResult>;
20
+ }
21
+ //# sourceMappingURL=orchestrator.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrator.service.d.ts","sourceRoot":"","sources":["../../../packages/core/providers/orchestrator.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAWL,KAAK,aAAa,EACnB,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAA2C,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAE5D;;;;GAIG;AACH,qBACa,mBAAoB,YAAW,YAAY;IAKpD,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAN5B,OAAO,CAAC,MAAM,CAA4C;IAC1D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwC;IAE/D,YACmB,gBAAgB,EAAE,gBAAgB,EAClC,mBAAmB,EAAE,wBAAwB,EAC7C,SAAS,EAAE,SAAS,EACnC;IAEJ,YAAY,SA4CX;IAEK,OAAO,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAmG5D;CACF"}