@adonis-agora/durable 0.50.0 → 0.51.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 +28 -0
- package/dist/commands/work.d.ts.map +1 -1
- package/dist/commands/work.js +3 -1
- package/dist/commands/work.js.map +1 -1
- package/dist/providers/durable_provider.d.ts.map +1 -1
- package/dist/providers/durable_provider.js +3 -1
- package/dist/providers/durable_provider.js.map +1 -1
- package/dist/src/commands/worker.d.ts +4 -2
- package/dist/src/commands/worker.d.ts.map +1 -1
- package/dist/src/commands/worker.js +8 -5
- package/dist/src/commands/worker.js.map +1 -1
- package/dist/src/dashboard/index.d.ts +1 -1
- package/dist/src/dashboard/index.js +1 -1
- package/dist/src/engine.d.ts +10 -1
- package/dist/src/engine.d.ts.map +1 -1
- package/dist/src/engine.js +55 -17
- package/dist/src/engine.js.map +1 -1
- package/dist/src/errors.d.ts +15 -5
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +11 -7
- package/dist/src/errors.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/on-error.d.ts +4 -1
- package/dist/src/on-error.d.ts.map +1 -1
- package/dist/src/on-error.js +15 -2
- package/dist/src/on-error.js.map +1 -1
- package/dist/src/scheduler.d.ts +44 -3
- package/dist/src/scheduler.d.ts.map +1 -1
- package/dist/src/scheduler.js +36 -1
- package/dist/src/scheduler.js.map +1 -1
- package/dist/src/standard-schema.d.ts +8 -5
- package/dist/src/standard-schema.d.ts.map +1 -1
- package/dist/src/standard-schema.js +9 -7
- package/dist/src/standard-schema.js.map +1 -1
- package/dist/src/step-discovery.js +2 -2
- package/dist/src/step-discovery.js.map +1 -1
- package/dist/src/workflow-ref.d.ts +4 -2
- package/dist/src/workflow-ref.d.ts.map +1 -1
- package/dist/src/workflow-ref.js.map +1 -1
- package/package.json +1 -1
- package/skills/durable-workflows/SKILL.md +15 -3
|
@@ -132,12 +132,14 @@ Schemas are **any Standard Schema** (zod 3.24+/4, valibot, arktype, effect
|
|
|
132
132
|
schema, …) — the package depends on none of them. They fit every schema slot:
|
|
133
133
|
`@Step({ input, output })` / `defineStep` (with an unannotated handler the types
|
|
134
134
|
are inferred from the schema), `static workflow = { inputSchema }` (validated at
|
|
135
|
-
`start`, nothing created on failure; the
|
|
136
|
-
|
|
135
|
+
`start`, nothing created on failure; the run stores the input as sent and
|
|
136
|
+
`run` receives the schema's output, re-parsed before every turn — keep the schema
|
|
137
|
+
deterministic and bump `version` when it changes), and `static workflow = { searchAttributes }` (every
|
|
137
138
|
`ctx.upsertSearchAttributes` is validated against the merged attributes; type
|
|
138
139
|
the ctx as `WorkflowCtx<InferSearchAttributes<typeof schema>>` and read back with
|
|
139
140
|
`attributesOf(WorkflowClass, run)`). A failure is a `SchemaValidationError`
|
|
140
|
-
(`FatalError`, code `
|
|
141
|
+
(`FatalError`, code `invalid_input` / `invalid_output` — `schema_validation` for a
|
|
142
|
+
`searchAttributes` write — issues in `details.issues`) — never
|
|
141
143
|
retried.
|
|
142
144
|
|
|
143
145
|
```ts
|
|
@@ -291,6 +293,16 @@ export default class DailyReportWorkflow extends BaseWorkflow {
|
|
|
291
293
|
}
|
|
292
294
|
```
|
|
293
295
|
|
|
296
|
+
In `config/durable.ts`, name the workflow with a lazy import, as Adonis does for
|
|
297
|
+
controllers — never a direct class import, which can hang the boot (a service the
|
|
298
|
+
workflow imports awaits `app.booted` while the config is still loading):
|
|
299
|
+
|
|
300
|
+
```ts
|
|
301
|
+
schedules: [
|
|
302
|
+
{ key: 'daily-report', workflow: () => import('#workflows/daily_report_workflow'), cron: '0 2 * * *' },
|
|
303
|
+
]
|
|
304
|
+
```
|
|
305
|
+
|
|
294
306
|
Each schedule window starts exactly once across a fleet via an idempotent
|
|
295
307
|
time-bucket run id.
|
|
296
308
|
|