@dudousxd/nestjs-durable-dashboard 0.22.2 → 0.22.4

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 (36) hide show
  1. package/LICENSE +21 -0
  2. package/dist/client/durable-client.d.ts +3 -3
  3. package/dist/client/durable-client.d.ts.map +1 -1
  4. package/dist/client/durable-client.js.map +1 -1
  5. package/dist/client/group-subprocesses.d.ts +5 -5
  6. package/dist/client/group-subprocesses.d.ts.map +1 -1
  7. package/dist/server/index.cjs +695 -0
  8. package/dist/server/index.cjs.map +1 -0
  9. package/dist/server/index.d.cts +160 -0
  10. package/dist/server/index.d.ts +160 -5
  11. package/dist/server/index.js +662 -4
  12. package/dist/server/index.js.map +1 -1
  13. package/dist/spa/assets/{index-B0Nn98HA.js → index-D8irnyfw.js} +2 -2
  14. package/dist/spa/index.html +1 -1
  15. package/package.json +14 -7
  16. package/dist/server/attr-filter.d.ts +0 -8
  17. package/dist/server/attr-filter.d.ts.map +0 -1
  18. package/dist/server/attr-filter.js +0 -30
  19. package/dist/server/attr-filter.js.map +0 -1
  20. package/dist/server/dashboard.service.d.ts +0 -70
  21. package/dist/server/dashboard.service.d.ts.map +0 -1
  22. package/dist/server/dashboard.service.js +0 -157
  23. package/dist/server/dashboard.service.js.map +0 -1
  24. package/dist/server/durable-api.controller.d.ts +0 -44
  25. package/dist/server/durable-api.controller.d.ts.map +0 -1
  26. package/dist/server/durable-api.controller.js +0 -197
  27. package/dist/server/durable-api.controller.js.map +0 -1
  28. package/dist/server/durable-dashboard.module.d.ts +0 -26
  29. package/dist/server/durable-dashboard.module.d.ts.map +0 -1
  30. package/dist/server/durable-dashboard.module.js +0 -60
  31. package/dist/server/durable-dashboard.module.js.map +0 -1
  32. package/dist/server/durable-ui.controller.d.ts +0 -19
  33. package/dist/server/durable-ui.controller.d.ts.map +0 -1
  34. package/dist/server/durable-ui.controller.js +0 -99
  35. package/dist/server/durable-ui.controller.js.map +0 -1
  36. package/dist/server/index.d.ts.map +0 -1
@@ -10,7 +10,7 @@
10
10
  rel="stylesheet"
11
11
  />
12
12
  <title>durable · control plane</title>
13
- <script type="module" crossorigin src="/durable/assets/index-B0Nn98HA.js"></script>
13
+ <script type="module" crossorigin src="/durable/assets/index-D8irnyfw.js"></script>
14
14
  <link rel="stylesheet" crossorigin href="/durable/assets/index-BaCR0uUG.css">
15
15
  </head>
16
16
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dudousxd/nestjs-durable-dashboard",
3
- "version": "0.22.2",
3
+ "version": "0.22.4",
4
4
  "description": "Embedded control plane (runs, step timeline, retry/cancel) for nestjs-durable — bundled React SPA served by NestJS",
5
5
  "license": "MIT",
6
6
  "author": "Davide Carvalho",
@@ -10,13 +10,19 @@
10
10
  "directory": "packages/dashboard"
11
11
  },
12
12
  "type": "module",
13
- "main": "./dist/server/index.js",
13
+ "main": "./dist/server/index.cjs",
14
+ "module": "./dist/server/index.js",
14
15
  "types": "./dist/server/index.d.ts",
15
16
  "exports": {
16
17
  ".": {
17
- "types": "./dist/server/index.d.ts",
18
- "import": "./dist/server/index.js",
19
- "default": "./dist/server/index.js"
18
+ "import": {
19
+ "types": "./dist/server/index.d.ts",
20
+ "default": "./dist/server/index.js"
21
+ },
22
+ "require": {
23
+ "types": "./dist/server/index.d.cts",
24
+ "default": "./dist/server/index.cjs"
25
+ }
20
26
  },
21
27
  "./client": {
22
28
  "types": "./dist/client/durable-client.d.ts",
@@ -47,12 +53,13 @@
47
53
  "react-dom": "18.3.1",
48
54
  "reflect-metadata": "0.2.2",
49
55
  "tailwindcss": "3.4.17",
56
+ "tsup": "8.3.5",
50
57
  "typescript": "5.9.3",
51
58
  "vite": "5.4.21",
52
- "@dudousxd/nestjs-durable-core": "^0.25.1"
59
+ "@dudousxd/nestjs-durable-core": "^0.32.1"
53
60
  },
54
61
  "scripts": {
55
- "build": "vite build && tsc -p tsconfig.server.json && tsc -p tsconfig.client.json",
62
+ "build": "vite build && tsup && tsc -p tsconfig.client.json",
56
63
  "typecheck": "tsc -p tsconfig.server.json --noEmit && tsc -p tsconfig.app.json --noEmit"
57
64
  }
58
65
  }
@@ -1,8 +0,0 @@
1
- import type { AttributeFilter } from '@dudousxd/nestjs-durable-core';
2
- /**
3
- * Parse `attr=key:op:value` query params (repeatable, ANDed) into {@link AttributeFilter}s — e.g.
4
- * `?attr=amount:gte:200&attr=tier:eq:pro`. `op` must be a known operator; a colon in the value is
5
- * preserved (only the first two colons delimit). Malformed entries are skipped.
6
- */
7
- export declare function parseAttrFilters(attr?: string | string[]): AttributeFilter[] | undefined;
8
- //# sourceMappingURL=attr-filter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attr-filter.d.ts","sourceRoot":"","sources":["../../src/server/attr-filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,+BAA+B,CAAC;AAYlF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,eAAe,EAAE,GAAG,SAAS,CAUxF"}
@@ -1,30 +0,0 @@
1
- const ATTR_OPS = new Set(['eq', 'ne', 'gt', 'gte', 'lt', 'lte']);
2
- /** Coerce a query-string value: `true`/`false` → boolean, numeric → number, else the raw string. */
3
- function coerce(v) {
4
- if (v === 'true')
5
- return true;
6
- if (v === 'false')
7
- return false;
8
- if (v !== '' && !Number.isNaN(Number(v)))
9
- return Number(v);
10
- return v;
11
- }
12
- /**
13
- * Parse `attr=key:op:value` query params (repeatable, ANDed) into {@link AttributeFilter}s — e.g.
14
- * `?attr=amount:gte:200&attr=tier:eq:pro`. `op` must be a known operator; a colon in the value is
15
- * preserved (only the first two colons delimit). Malformed entries are skipped.
16
- */
17
- export function parseAttrFilters(attr) {
18
- if (!attr)
19
- return undefined;
20
- const raw = Array.isArray(attr) ? attr : [attr];
21
- const filters = [];
22
- for (const entry of raw) {
23
- const [key, op, ...rest] = entry.split(':');
24
- if (!key || !ATTR_OPS.has(op) || rest.length === 0)
25
- continue;
26
- filters.push({ key, op: op, value: coerce(rest.join(':')) });
27
- }
28
- return filters.length ? filters : undefined;
29
- }
30
- //# sourceMappingURL=attr-filter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attr-filter.js","sourceRoot":"","sources":["../../src/server/attr-filter.ts"],"names":[],"mappings":"AAEA,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAc,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;AAE9E,oGAAoG;AACpG,SAAS,MAAM,CAAC,CAAS;IACvB,IAAI,CAAC,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IAC9B,IAAI,CAAC,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IAChC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAAE,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;IAC3D,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAwB;IACvD,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAChD,MAAM,OAAO,GAAsB,EAAE,CAAC;IACtC,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE,CAAC;QACxB,MAAM,CAAC,GAAG,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAiB,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAC5E,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,EAAiB,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;IAC9E,CAAC;IACD,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9C,CAAC"}
@@ -1,70 +0,0 @@
1
- import { type EngineEvent, type GroupHealth, type RunQuery, type RunResult, type StateStore, type StepCheckpoint, type UpdateResult, WorkflowEngine, type WorkflowRun } from '@dudousxd/nestjs-durable-core';
2
- import { Observable } from 'rxjs';
3
- export interface RunDetail {
4
- run: WorkflowRun;
5
- /** Steps in execution order — the end-to-end timeline (local + remote). */
6
- timeline: StepCheckpoint[];
7
- /** Ids of runs this run spawned (ctx.child / ctx.startChild) — the parent→children tree. */
8
- children: string[];
9
- }
10
- /** Read-model and actions backing the control-plane UI. */
11
- export declare class DashboardService {
12
- private readonly store;
13
- private readonly engine;
14
- /** Prometheus counters accumulated from engine events since boot (per process). */
15
- private readonly metricsCollector;
16
- constructor(store: StateStore, engine: WorkflowEngine);
17
- /**
18
- * Prometheus-text metrics for a `/metrics` scrape: the event-counters (runs/steps by outcome,
19
- * per-workflow counts) plus live **backlog gauges** queried at scrape time — `durable_pending_runs`
20
- * (the dispatch backlog: the key health signal of the dispatch model) and `durable_dead_runs` (DLQ
21
- * size). Capped per status so the scrape can't load an unbounded result set.
22
- */
23
- metrics(): Promise<string>;
24
- listRuns(query: RunQuery): Promise<WorkflowRun[]>;
25
- /** Per-group worker health (queue backlog + live worker heartbeats) for the Workers panel. The
26
- * alert state a row turns red on is `depth > 0 && liveWorkers.length === 0`. */
27
- workerHealth(): Promise<GroupHealth[]>;
28
- getRunDetail(runId: string): Promise<RunDetail | null>;
29
- /** Fix-and-replay a dead/failed run with a corrected input — a fresh linked run. Returns its id. */
30
- retryWithInput(runId: string, input: unknown): Promise<{
31
- runId: string;
32
- } | null>;
33
- /** Re-run a failed/incomplete run; completed steps replay from their checkpoints. */
34
- retry(runId: string): Promise<RunResult | null>;
35
- cancel(runId: string, opts?: {
36
- compensate?: boolean;
37
- }): Promise<RunResult | null>;
38
- /**
39
- * Apply `retry` or `cancel` to every run matching a filter (status / tag / workflow) — e.g. "retry
40
- * every `dead` run tagged `type:mel`". Capped at 500 runs per call; runs that can't be acted on
41
- * (already terminal) are skipped. Returns how many matched and how many the action applied to.
42
- */
43
- bulk(action: 'retry' | 'cancel', filter: Pick<RunQuery, 'status' | 'tag' | 'workflow' | 'attributes'>, opts?: {
44
- compensate?: boolean;
45
- }): Promise<{
46
- matched: number;
47
- applied: number;
48
- }>;
49
- /** Resume a run paused at a `ctx.breakpoint` (the "continue" button). */
50
- continue(runId: string): Promise<RunResult | null>;
51
- /**
52
- * Deliver a `ctx.webhook()` callback: turn an inbound POST (token + body) into the signal the
53
- * waiting run is parked on. Returns the run result, or `null` if no run waits on that token (a
54
- * stale/duplicate callback) — a safe no-op the controller maps to 404.
55
- */
56
- deliverWebhook(token: string, body: unknown): Promise<RunResult | null>;
57
- /** Side-effect-free read of a value a run published via `ctx.setEvent` (a live query). */
58
- getEvent(runId: string, key: string): Promise<unknown>;
59
- /** Deliver a validated `ctx.onUpdate` to a run; the validator may reject it (see UpdateResult). */
60
- update(runId: string, name: string, arg: unknown): Promise<UpdateResult>;
61
- /**
62
- * Live stream of a run's lifecycle events for SSE. Backed by `engine.subscribe`, which — when the
63
- * transport has a control plane — receives events from EVERY instance, so a dashboard-only pod
64
- * tails a run executing on a worker pod. Without a control plane it only sees same-process events.
65
- */
66
- streamRun(runId: string): Observable<{
67
- data: EngineEvent;
68
- }>;
69
- }
70
- //# sourceMappingURL=dashboard.service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dashboard.service.d.ts","sourceRoot":"","sources":["../../src/server/dashboard.service.ts"],"names":[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AU,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAIjF;;;;OAIG;IACG,IAAI,CACR,MAAM,EAAE,OAAO,GAAG,QAAQ,EAC1B,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,KAAK,GAAG,UAAU,GAAG,YAAY,CAAC,EACpE,IAAI,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,OAAO,CAAA;KAAE,GAC9B,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAehD,yEAAyE;IACzE,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAIlD;;;;OAIG;IACH,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAIvE,0FAA0F;IAC1F,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAItD,mGAAmG;IACnG,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC;IAIxE;;;;OAIG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC;QAAE,IAAI,EAAE,WAAW,CAAA;KAAE,CAAC;CAQ5D"}
@@ -1,157 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- var __param = (this && this.__param) || function (paramIndex, decorator) {
11
- return function (target, key) { decorator(target, key, paramIndex); }
12
- };
13
- import { STATE_STORE, WorkflowEngine, collectMetrics, } from '@dudousxd/nestjs-durable-core';
14
- import { Inject, Injectable } from '@nestjs/common';
15
- import { Observable } from 'rxjs';
16
- /** Read-model and actions backing the control-plane UI. */
17
- let DashboardService = class DashboardService {
18
- store;
19
- engine;
20
- /** Prometheus counters accumulated from engine events since boot (per process). */
21
- metricsCollector;
22
- constructor(store, engine) {
23
- this.store = store;
24
- this.engine = engine;
25
- this.metricsCollector = collectMetrics(this.engine);
26
- }
27
- /**
28
- * Prometheus-text metrics for a `/metrics` scrape: the event-counters (runs/steps by outcome,
29
- * per-workflow counts) plus live **backlog gauges** queried at scrape time — `durable_pending_runs`
30
- * (the dispatch backlog: the key health signal of the dispatch model) and `durable_dead_runs` (DLQ
31
- * size). Capped per status so the scrape can't load an unbounded result set.
32
- */
33
- async metrics() {
34
- const cap = 10_000;
35
- const [pending, running, dead] = await Promise.all([
36
- this.store.listRuns({ status: 'pending', limit: cap }),
37
- this.store.listRuns({ status: 'running', limit: cap }),
38
- this.store.listRuns({ status: 'dead', limit: cap }),
39
- ]);
40
- const gauges = [
41
- '# TYPE durable_pending_runs gauge',
42
- `durable_pending_runs ${pending.length}`,
43
- '# TYPE durable_running_runs gauge',
44
- `durable_running_runs ${running.length}`,
45
- '# TYPE durable_dead_runs gauge',
46
- `durable_dead_runs ${dead.length}`,
47
- ];
48
- // Per-group worker health: backlog vs. live workers. `depth>0 && live==0` is the alert (work
49
- // piling up with no consumer) — expressible as a Prometheus rule on these two series.
50
- const health = await this.engine.workerHealth();
51
- if (health.length > 0) {
52
- gauges.push('# TYPE durable_group_queue_depth gauge');
53
- for (const h of health) {
54
- gauges.push(`durable_group_queue_depth{group="${h.group}"} ${h.depth}`);
55
- }
56
- gauges.push('# TYPE durable_group_live_workers gauge');
57
- for (const h of health) {
58
- gauges.push(`durable_group_live_workers{group="${h.group}"} ${h.liveWorkers.length}`);
59
- }
60
- }
61
- return `${this.metricsCollector.prometheus()}${gauges.join('\n')}\n`;
62
- }
63
- listRuns(query) {
64
- return this.store.listRuns(query);
65
- }
66
- /** Per-group worker health (queue backlog + live worker heartbeats) for the Workers panel. The
67
- * alert state a row turns red on is `depth > 0 && liveWorkers.length === 0`. */
68
- workerHealth() {
69
- return this.engine.workerHealth();
70
- }
71
- async getRunDetail(runId) {
72
- const run = await this.store.getRun(runId);
73
- if (!run)
74
- return null;
75
- const [timeline, children] = await Promise.all([
76
- this.store.listCheckpoints(runId),
77
- this.engine.getRunChildren(runId), // canonical parent→children edge (shared with cancel cascade)
78
- ]);
79
- return { run, timeline, children };
80
- }
81
- /** Fix-and-replay a dead/failed run with a corrected input — a fresh linked run. Returns its id. */
82
- retryWithInput(runId, input) {
83
- return this.engine.retryWithInput(runId, input);
84
- }
85
- /** Re-run a failed/incomplete run; completed steps replay from their checkpoints. */
86
- retry(runId) {
87
- // Re-enqueue (dispatch model) instead of resuming inline, so the request can't hang on workflow
88
- // execution — a worker picks the run up and replays it.
89
- return this.engine.requeue(runId);
90
- }
91
- cancel(runId, opts) {
92
- return this.engine.cancel(runId, opts);
93
- }
94
- /**
95
- * Apply `retry` or `cancel` to every run matching a filter (status / tag / workflow) — e.g. "retry
96
- * every `dead` run tagged `type:mel`". Capped at 500 runs per call; runs that can't be acted on
97
- * (already terminal) are skipped. Returns how many matched and how many the action applied to.
98
- */
99
- async bulk(action, filter, opts) {
100
- const runs = await this.store.listRuns({ ...filter, limit: 500 });
101
- let applied = 0;
102
- for (const r of runs) {
103
- try {
104
- if (action === 'retry')
105
- await this.engine.requeue(r.id);
106
- else
107
- await this.engine.cancel(r.id, opts);
108
- applied += 1;
109
- }
110
- catch {
111
- // Skip a run that can't take the action (e.g. already terminal) — keep going.
112
- }
113
- }
114
- return { matched: runs.length, applied };
115
- }
116
- /** Resume a run paused at a `ctx.breakpoint` (the "continue" button). */
117
- continue(runId) {
118
- return this.engine.continue(runId);
119
- }
120
- /**
121
- * Deliver a `ctx.webhook()` callback: turn an inbound POST (token + body) into the signal the
122
- * waiting run is parked on. Returns the run result, or `null` if no run waits on that token (a
123
- * stale/duplicate callback) — a safe no-op the controller maps to 404.
124
- */
125
- deliverWebhook(token, body) {
126
- return this.engine.signal(token, body);
127
- }
128
- /** Side-effect-free read of a value a run published via `ctx.setEvent` (a live query). */
129
- getEvent(runId, key) {
130
- return this.engine.getEvent(runId, key);
131
- }
132
- /** Deliver a validated `ctx.onUpdate` to a run; the validator may reject it (see UpdateResult). */
133
- update(runId, name, arg) {
134
- return this.engine.update(runId, name, arg);
135
- }
136
- /**
137
- * Live stream of a run's lifecycle events for SSE. Backed by `engine.subscribe`, which — when the
138
- * transport has a control plane — receives events from EVERY instance, so a dashboard-only pod
139
- * tails a run executing on a worker pod. Without a control plane it only sees same-process events.
140
- */
141
- streamRun(runId) {
142
- return new Observable((subscriber) => {
143
- const off = this.engine.subscribe((event) => {
144
- if (event.runId === runId)
145
- subscriber.next({ data: event });
146
- });
147
- return () => off();
148
- });
149
- }
150
- };
151
- DashboardService = __decorate([
152
- Injectable(),
153
- __param(0, Inject(STATE_STORE)),
154
- __metadata("design:paramtypes", [Object, WorkflowEngine])
155
- ], DashboardService);
156
- export { DashboardService };
157
- //# sourceMappingURL=dashboard.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dashboard.service.js","sourceRoot":"","sources":["../../src/server/dashboard.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAML,WAAW,EAIX,cAAc,EAEd,cAAc,GACf,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;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MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,0FAA0F;IAC1F,QAAQ,CAAC,KAAa,EAAE,GAAW;QACjC,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC1C,CAAC;IAED,mGAAmG;IACnG,MAAM,CAAC,KAAa,EAAE,IAAY,EAAE,GAAY;QAC9C,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;IAC9C,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,KAAa;QACrB,OAAO,IAAI,UAAU,CAAwB,CAAC,UAAU,EAAE,EAAE;YAC1D,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;gBAC1C,IAAI,KAAK,CAAC,KAAK,KAAK,KAAK;oBAAE,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;YAC9D,CAAC,CAAC,CAAC;YACH,OAAO,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC;QACrB,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAjJY,gBAAgB;IAD5B,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,WAAW,CAAC,CAAA;6CACK,cAAc;GAN9B,gBAAgB,CAiJ5B"}
@@ -1,44 +0,0 @@
1
- import type { RunStatus } from '@dudousxd/nestjs-durable-core';
2
- import { DashboardService } from './dashboard.service.js';
3
- /** JSON API consumed by the control-plane SPA. Mounted at `apiBasePath` (set by RouterModule). */
4
- export declare class DurableApiController {
5
- private readonly dashboard;
6
- constructor(dashboard: DashboardService);
7
- runs(status?: RunStatus, workflow?: string, tag?: string, attr?: string | string[]): Promise<import("@dudousxd/nestjs-durable-core").WorkflowRun[]>;
8
- /** Prometheus-text metrics (runs/steps by outcome, per-workflow counts) for a scrape. */
9
- metrics(): Promise<string>;
10
- /** Per-group worker health (queue backlog + live worker heartbeats) for the Workers panel. */
11
- workers(): Promise<import("@dudousxd/nestjs-durable-core").GroupHealth[]>;
12
- run(id: string): Promise<import("./dashboard.service.js").RunDetail>;
13
- /** Server-Sent Events stream of a run's live lifecycle events — the dashboard tails it instead
14
- * of polling. Cross-pod when the transport has a control plane (see DashboardService.streamRun). */
15
- stream(id: string): import("rxjs").Observable<{
16
- data: import("@dudousxd/nestjs-durable-core").EngineEvent;
17
- }>;
18
- retry(id: string): Promise<import("@dudousxd/nestjs-durable-core").RunResult | null>;
19
- /** Fix-and-replay: re-run a dead/failed run with a corrected input (a fresh linked run). */
20
- retryWithInput(id: string, body: {
21
- input: unknown;
22
- }): Promise<{
23
- runId: string;
24
- } | null>;
25
- /** Bulk retry/cancel every run matching a filter (status / tag / workflow). */
26
- bulk(action: 'retry' | 'cancel', status?: RunStatus, tag?: string, workflow?: string, attr?: string | string[], compensate?: string): Promise<{
27
- matched: number;
28
- applied: number;
29
- }>;
30
- cancel(id: string, compensate?: string): Promise<import("@dudousxd/nestjs-durable-core").RunResult>;
31
- continue(id: string): Promise<import("@dudousxd/nestjs-durable-core").RunResult>;
32
- /**
33
- * Public callback endpoint for `ctx.webhook()`: a third party POSTs here (the url handed to it),
34
- * and the body resumes the waiting run. NOTE: this is reachable by external systems — protect it
35
- * by treating the token as a secret (it embeds runId:seq) and/or fronting it with signature
36
- * verification in your own middleware.
37
- */
38
- webhook(token: string, body: unknown): Promise<import("@dudousxd/nestjs-durable-core").RunResult>;
39
- /** Live query: the latest value a run published for `key` via `ctx.setEvent` (no side effect). */
40
- event(id: string, key: string): Promise<unknown>;
41
- /** Deliver a validated `ctx.onUpdate` to a run; the body is the update argument. */
42
- update(id: string, name: string, body: unknown): Promise<import("@dudousxd/nestjs-durable-core").UpdateResult>;
43
- }
44
- //# sourceMappingURL=durable-api.controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"durable-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F;IAEpF,MAAM,CAAc,EAAE,EAAE,MAAM,EAAiB,IAAI,EAAE,MAAM,EAAU,IAAI,EAAE,OAAO;CAGnF"}
@@ -1,197 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- var __param = (this && this.__param) || function (paramIndex, decorator) {
11
- return function (target, key) { decorator(target, key, paramIndex); }
12
- };
13
- import { Body, Controller, Get, Header, NotFoundException, Param, Post, Query, Sse, } from '@nestjs/common';
14
- import { parseAttrFilters } from './attr-filter.js';
15
- import { DashboardService } from './dashboard.service.js';
16
- /** JSON API consumed by the control-plane SPA. Mounted at `apiBasePath` (set by RouterModule). */
17
- let DurableApiController = class DurableApiController {
18
- dashboard;
19
- constructor(dashboard) {
20
- this.dashboard = dashboard;
21
- }
22
- runs(status, workflow, tag, attr) {
23
- return this.dashboard.listRuns({ status, workflow, tag, attributes: parseAttrFilters(attr) });
24
- }
25
- /** Prometheus-text metrics (runs/steps by outcome, per-workflow counts) for a scrape. */
26
- metrics() {
27
- return this.dashboard.metrics();
28
- }
29
- /** Per-group worker health (queue backlog + live worker heartbeats) for the Workers panel. */
30
- workers() {
31
- return this.dashboard.workerHealth();
32
- }
33
- async run(id) {
34
- const detail = await this.dashboard.getRunDetail(id);
35
- if (!detail)
36
- throw new NotFoundException(`run ${id} not found`);
37
- return detail;
38
- }
39
- /** Server-Sent Events stream of a run's live lifecycle events — the dashboard tails it instead
40
- * of polling. Cross-pod when the transport has a control plane (see DashboardService.streamRun). */
41
- stream(id) {
42
- return this.dashboard.streamRun(id);
43
- }
44
- retry(id) {
45
- return this.dashboard.retry(id);
46
- }
47
- /** Fix-and-replay: re-run a dead/failed run with a corrected input (a fresh linked run). */
48
- retryWithInput(id, body) {
49
- return this.dashboard.retryWithInput(id, body?.input);
50
- }
51
- /** Bulk retry/cancel every run matching a filter (status / tag / workflow). */
52
- bulk(action, status, tag, workflow, attr, compensate) {
53
- return this.dashboard.bulk(action === 'cancel' ? 'cancel' : 'retry', { status, tag, workflow, attributes: parseAttrFilters(attr) }, { compensate: compensate === 'true' });
54
- }
55
- async cancel(id, compensate) {
56
- const result = await this.dashboard.cancel(id, { compensate: compensate === 'true' });
57
- if (!result)
58
- throw new NotFoundException(`run ${id} not found`);
59
- return result;
60
- }
61
- async continue(id) {
62
- const result = await this.dashboard.continue(id);
63
- if (!result)
64
- throw new NotFoundException(`run ${id} is not paused at a breakpoint`);
65
- return result;
66
- }
67
- /**
68
- * Public callback endpoint for `ctx.webhook()`: a third party POSTs here (the url handed to it),
69
- * and the body resumes the waiting run. NOTE: this is reachable by external systems — protect it
70
- * by treating the token as a secret (it embeds runId:seq) and/or fronting it with signature
71
- * verification in your own middleware.
72
- */
73
- async webhook(token, body) {
74
- const result = await this.dashboard.deliverWebhook(token, body);
75
- if (!result)
76
- throw new NotFoundException(`no run is waiting on webhook ${token}`);
77
- return result;
78
- }
79
- /** Live query: the latest value a run published for `key` via `ctx.setEvent` (no side effect). */
80
- event(id, key) {
81
- return this.dashboard.getEvent(id, key);
82
- }
83
- /** Deliver a validated `ctx.onUpdate` to a run; the body is the update argument. */
84
- update(id, name, body) {
85
- return this.dashboard.update(id, name, body);
86
- }
87
- };
88
- __decorate([
89
- Get('runs'),
90
- __param(0, Query('status')),
91
- __param(1, Query('workflow')),
92
- __param(2, Query('tag')),
93
- __param(3, Query('attr')),
94
- __metadata("design:type", Function),
95
- __metadata("design:paramtypes", [String, String, String, Object]),
96
- __metadata("design:returntype", void 0)
97
- ], DurableApiController.prototype, "runs", null);
98
- __decorate([
99
- Get('metrics'),
100
- Header('Content-Type', 'text/plain; version=0.0.4'),
101
- __metadata("design:type", Function),
102
- __metadata("design:paramtypes", []),
103
- __metadata("design:returntype", void 0)
104
- ], DurableApiController.prototype, "metrics", null);
105
- __decorate([
106
- Get('workers'),
107
- __metadata("design:type", Function),
108
- __metadata("design:paramtypes", []),
109
- __metadata("design:returntype", void 0)
110
- ], DurableApiController.prototype, "workers", null);
111
- __decorate([
112
- Get('runs/:id'),
113
- __param(0, Param('id')),
114
- __metadata("design:type", Function),
115
- __metadata("design:paramtypes", [String]),
116
- __metadata("design:returntype", Promise)
117
- ], DurableApiController.prototype, "run", null);
118
- __decorate([
119
- Sse('runs/:id/stream'),
120
- __param(0, Param('id')),
121
- __metadata("design:type", Function),
122
- __metadata("design:paramtypes", [String]),
123
- __metadata("design:returntype", void 0)
124
- ], DurableApiController.prototype, "stream", null);
125
- __decorate([
126
- Post('runs/:id/retry'),
127
- __param(0, Param('id')),
128
- __metadata("design:type", Function),
129
- __metadata("design:paramtypes", [String]),
130
- __metadata("design:returntype", void 0)
131
- ], DurableApiController.prototype, "retry", null);
132
- __decorate([
133
- Post('runs/:id/retry-with-input'),
134
- __param(0, Param('id')),
135
- __param(1, Body()),
136
- __metadata("design:type", Function),
137
- __metadata("design:paramtypes", [String, Object]),
138
- __metadata("design:returntype", void 0)
139
- ], DurableApiController.prototype, "retryWithInput", null);
140
- __decorate([
141
- Post('bulk/:action'),
142
- __param(0, Param('action')),
143
- __param(1, Query('status')),
144
- __param(2, Query('tag')),
145
- __param(3, Query('workflow')),
146
- __param(4, Query('attr')),
147
- __param(5, Query('compensate')),
148
- __metadata("design:type", Function),
149
- __metadata("design:paramtypes", [String, String, String, String, Object, String]),
150
- __metadata("design:returntype", void 0)
151
- ], DurableApiController.prototype, "bulk", null);
152
- __decorate([
153
- Post('runs/:id/cancel'),
154
- __param(0, Param('id')),
155
- __param(1, Query('compensate')),
156
- __metadata("design:type", Function),
157
- __metadata("design:paramtypes", [String, String]),
158
- __metadata("design:returntype", Promise)
159
- ], DurableApiController.prototype, "cancel", null);
160
- __decorate([
161
- Post('runs/:id/continue'),
162
- __param(0, Param('id')),
163
- __metadata("design:type", Function),
164
- __metadata("design:paramtypes", [String]),
165
- __metadata("design:returntype", Promise)
166
- ], DurableApiController.prototype, "continue", null);
167
- __decorate([
168
- Post('webhooks/:token'),
169
- __param(0, Param('token')),
170
- __param(1, Body()),
171
- __metadata("design:type", Function),
172
- __metadata("design:paramtypes", [String, Object]),
173
- __metadata("design:returntype", Promise)
174
- ], DurableApiController.prototype, "webhook", null);
175
- __decorate([
176
- Get('runs/:id/events/:key'),
177
- __param(0, Param('id')),
178
- __param(1, Param('key')),
179
- __metadata("design:type", Function),
180
- __metadata("design:paramtypes", [String, String]),
181
- __metadata("design:returntype", void 0)
182
- ], DurableApiController.prototype, "event", null);
183
- __decorate([
184
- Post('runs/:id/updates/:name'),
185
- __param(0, Param('id')),
186
- __param(1, Param('name')),
187
- __param(2, Body()),
188
- __metadata("design:type", Function),
189
- __metadata("design:paramtypes", [String, String, Object]),
190
- __metadata("design:returntype", void 0)
191
- ], DurableApiController.prototype, "update", null);
192
- DurableApiController = __decorate([
193
- Controller(),
194
- __metadata("design:paramtypes", [DashboardService])
195
- ], DurableApiController);
196
- export { DurableApiController };
197
- //# sourceMappingURL=durable-api.controller.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"durable-api.controller.js","sourceRoot":"","sources":["../../src/server/durable-api.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EACL,IAAI,EACJ,UAAU,EACV,GAAG,EACH,MAAM,EACN,iBAAiB,EACjB,KAAK,EACL,IAAI,EACJ,KAAK,EACL,GAAG,GACJ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;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K,CAAC,UAAU,CAAC,CAAA;IACjB,WAAA,KAAK,CAAC,MAAM,CAAC,CAAA;IACb,WAAA,KAAK,CAAC,YAAY,CAAC,CAAA;;;;gDAOrB;AAGK;IADL,IAAI,CAAC,iBAAiB,CAAC;IACV,WAAA,KAAK,CAAC,IAAI,CAAC,CAAA;IAAc,WAAA,KAAK,CAAC,YAAY,CAAC,CAAA;;;;kDAIzD;AAGK;IADL,IAAI,CAAC,mBAAmB,CAAC;IACV,WAAA,KAAK,CAAC,IAAI,CAAC,CAAA;;;;oDAI1B;AASK;IADL,IAAI,CAAC,iBAAiB,CAAC;IACT,WAAA,KAAK,CAAC,OAAO,CAAC,CAAA;IAAiB,WAAA,IAAI,EAAE,CAAA;;;;mDAInD;AAID;IADC,GAAG,CAAC,sBAAsB,CAAC;IACrB,WAAA,KAAK,CAAC,IAAI,CAAC,CAAA;IAAc,WAAA,KAAK,CAAC,KAAK,CAAC,CAAA;;;;iDAE3C;AAID;IADC,IAAI,CAAC,wBAAwB,CAAC;IACvB,WAAA,KAAK,CAAC,IAAI,CAAC,CAAA;IAAc,WAAA,KAAK,CAAC,MAAM,CAAC,CAAA;IAAgB,WAAA,IAAI,EAAE,CAAA;;;;kDAEnE;AAzGU,oBAAoB;IADhC,UAAU,EAAE;qCAE6B,gBAAgB;GAD7C,oBAAoB,CA0GhC"}
@@ -1,26 +0,0 @@
1
- import { type DynamicModule } from '@nestjs/common';
2
- export interface DurableDashboardOptions {
3
- /**
4
- * Where the SPA (UI) is served. Default `/durable`. This is a page route — keep it out of an
5
- * `/api` prefix so it reads as a UI, not an endpoint.
6
- */
7
- basePath?: string;
8
- /**
9
- * Where the JSON API is mounted (what the SPA fetches). Default `<basePath>/api`. Set it under
10
- * your app's `/api` prefix — e.g. `/api/durable` — so the API inherits the app's auth/proxy rules
11
- * while the UI stays at `basePath`.
12
- */
13
- apiBasePath?: string;
14
- }
15
- /** Holds the JSON API controller + its read service, mounted on its own path by `forRoot`. */
16
- export declare class DurableApiModule {
17
- }
18
- /**
19
- * Mounts the control plane: the bundled React SPA at `basePath` and its JSON API at `apiBasePath`
20
- * (default `<basePath>/api`). Import via `DurableDashboardModule.forRoot(...)` alongside
21
- * `DurableModule` (global), so it resolves the engine and store. Front the routes with a guard.
22
- */
23
- export declare class DurableDashboardModule {
24
- static forRoot(options?: DurableDashboardOptions): DynamicModule;
25
- }
26
- //# sourceMappingURL=durable-dashboard.module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"durable-dashboard.module.d.ts","sourceRoot":"","sources":["../../src/server/durable-dashboard.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAU5D,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAOD,8FAA8F;AAC9F,qBAKa,gBAAgB;CAAG;AAEhC;;;;GAIG;AACH,qBACa,sBAAsB;IACjC,MAAM,CAAC,OAAO,CAAC,OAAO,GAAE,uBAA4B,GAAG,aAAa;CAqBrE"}