@dudousxd/nestjs-durable 0.52.7 → 0.54.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/dist/index.cjs +527 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +185 -26
- package/dist/index.d.ts +185 -26
- package/dist/index.js +523 -54
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/skills/durable-signals-and-timers/SKILL.md +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dudousxd/nestjs-durable",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"description": "Durable workflows for NestJS — module, decorators, discovery and boot recovery",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Davide Carvalho",
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
"tsup": "8.3.5",
|
|
69
69
|
"@dudousxd/nestjs-diagnostics": "0.5.0",
|
|
70
70
|
"@tanstack/intent": "0.4.0",
|
|
71
|
-
"@dudousxd/durable-worker": "0.
|
|
72
|
-
"@dudousxd/nestjs-durable-core": "^0.
|
|
73
|
-
"@dudousxd/nestjs-durable-dashboard": "0.
|
|
74
|
-
"@dudousxd/nestjs-durable-testing": "^0.
|
|
75
|
-
"@dudousxd/nestjs-durable-transport-bullmq": "0.23.
|
|
71
|
+
"@dudousxd/durable-worker": "0.12.0",
|
|
72
|
+
"@dudousxd/nestjs-durable-core": "^0.87.0",
|
|
73
|
+
"@dudousxd/nestjs-durable-dashboard": "0.54.0",
|
|
74
|
+
"@dudousxd/nestjs-durable-testing": "^0.24.0",
|
|
75
|
+
"@dudousxd/nestjs-durable-transport-bullmq": "0.23.4",
|
|
76
76
|
"@dudousxd/nestjs-durable-transport-event-emitter": "^0.5.3"
|
|
77
77
|
},
|
|
78
78
|
"module": "./dist/index.js",
|
|
@@ -81,7 +81,8 @@ export class ApprovalController {
|
|
|
81
81
|
`workflows.signal(token, payload)`. One token, one waiting run.
|
|
82
82
|
- `ctx.waitForEvent<T>(name, { match?, timeoutMs? })` waits on a named event with optional `match`
|
|
83
83
|
filtering; `workflows.publishEvent(name, payload)` fans out to every run whose `match` the payload
|
|
84
|
-
satisfies (and starts any `@OnEvent` workflows
|
|
84
|
+
satisfies (and starts any `@OnEvent` workflows whose `where` accepts the payload, with
|
|
85
|
+
`input(payload)` as the run's input when the entry maps it). Returns how many runs it touched.
|
|
85
86
|
|
|
86
87
|
```ts
|
|
87
88
|
const order = await ctx.waitForEvent<Order>('order.paid', { match: { orderId: id } });
|
|
@@ -91,7 +92,8 @@ const order = await ctx.waitForEvent<Order>('order.paid', { match: { orderId: id
|
|
|
91
92
|
### Event-triggered workflow starts
|
|
92
93
|
|
|
93
94
|
`@Workflow({ onEvent })` or `@OnEvent(...)` start a **fresh run** whenever the event is published —
|
|
94
|
-
the payload becomes the run's input
|
|
95
|
+
the payload becomes the run's input, or `input(payload)` when the entry maps it; an entry
|
|
96
|
+
`{ event, where, input }` starts only when `where(payload)` accepts it. `debounce` / `batch` coalesce bursts.
|
|
95
97
|
|
|
96
98
|
```ts
|
|
97
99
|
import { Workflow, OnEvent } from '@dudousxd/nestjs-durable';
|