@dudousxd/nestjs-durable-dashboard 0.4.0 → 0.5.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/client/durable-client.d.ts +38 -2
- package/dist/client/durable-client.d.ts.map +1 -1
- package/dist/client/durable-client.js +21 -0
- package/dist/client/durable-client.js.map +1 -1
- package/dist/server/dashboard.service.d.ts +10 -1
- package/dist/server/dashboard.service.d.ts.map +1 -1
- package/dist/server/dashboard.service.js +15 -0
- package/dist/server/dashboard.service.js.map +1 -1
- package/dist/server/durable-api.controller.d.ts +5 -0
- package/dist/server/durable-api.controller.d.ts.map +1 -1
- package/dist/server/durable-api.controller.js +13 -1
- package/dist/server/durable-api.controller.js.map +1 -1
- package/dist/spa/assets/{index-Da_GEmqT.js → index-xV2a3OK0.js} +11 -11
- package/dist/spa/index.html +1 -1
- package/package.json +10 -4
|
@@ -15,19 +15,37 @@ export interface WorkflowRun {
|
|
|
15
15
|
createdAt: string;
|
|
16
16
|
updatedAt: string;
|
|
17
17
|
}
|
|
18
|
+
export interface StepEvent {
|
|
19
|
+
at: number;
|
|
20
|
+
level: 'debug' | 'info' | 'warn' | 'error';
|
|
21
|
+
message: string;
|
|
22
|
+
/** For a sub-step/sub-process within the step: its name. */
|
|
23
|
+
name?: string;
|
|
24
|
+
/** For a sub-step: its outcome. */
|
|
25
|
+
status?: 'ok' | 'failed' | 'skipped';
|
|
26
|
+
data?: unknown;
|
|
27
|
+
}
|
|
18
28
|
export interface StepCheckpoint {
|
|
19
29
|
runId: string;
|
|
20
30
|
seq: number;
|
|
21
31
|
name: string;
|
|
22
32
|
kind: StepKind;
|
|
23
|
-
|
|
33
|
+
/** `pending` = a remote step dispatched and awaiting its worker result (in-flight). */
|
|
34
|
+
status: 'pending' | 'completed' | 'failed';
|
|
35
|
+
/** What the step was called with (a remote step's `ctx.call` args). */
|
|
36
|
+
input?: unknown;
|
|
24
37
|
output?: unknown;
|
|
25
38
|
error?: {
|
|
26
39
|
message: string;
|
|
27
40
|
};
|
|
41
|
+
/** Structured events the step (or its worker) emitted — sub-process outcomes + debug/error logs. */
|
|
42
|
+
events?: StepEvent[];
|
|
28
43
|
attempts: number;
|
|
29
44
|
workerGroup?: string;
|
|
30
45
|
wakeAt?: number;
|
|
46
|
+
/** When the step was dispatched (remote) or began (local). Queue-wait = startedAt − enqueuedAt. */
|
|
47
|
+
enqueuedAt?: string;
|
|
48
|
+
/** When processing actually began: worker pickup for a remote step, execution start for a local one. */
|
|
31
49
|
startedAt: string;
|
|
32
50
|
finishedAt: string;
|
|
33
51
|
}
|
|
@@ -35,10 +53,22 @@ export interface RunDetail {
|
|
|
35
53
|
run: WorkflowRun;
|
|
36
54
|
timeline: StepCheckpoint[];
|
|
37
55
|
}
|
|
56
|
+
export interface EngineEvent {
|
|
57
|
+
type: 'run.started' | 'run.completed' | 'run.failed' | 'run.suspended' | 'step.started' | 'step.completed' | 'step.failed';
|
|
58
|
+
runId: string;
|
|
59
|
+
workflow?: string;
|
|
60
|
+
seq?: number;
|
|
61
|
+
name?: string;
|
|
62
|
+
kind?: StepKind;
|
|
63
|
+
durationMs?: number;
|
|
64
|
+
at: string;
|
|
65
|
+
}
|
|
38
66
|
declare global {
|
|
39
67
|
interface Window {
|
|
40
|
-
/**
|
|
68
|
+
/** UI mount base (e.g. `/durable`) injected by the UI controller; falls back to `/durable`. */
|
|
41
69
|
__DURABLE_BASE__?: string;
|
|
70
|
+
/** JSON API base (e.g. `/api/durable`) injected by the UI controller; falls back to `<base>/api`. */
|
|
71
|
+
__DURABLE_API__?: string;
|
|
42
72
|
}
|
|
43
73
|
}
|
|
44
74
|
export declare const durableClient: {
|
|
@@ -46,5 +76,11 @@ export declare const durableClient: {
|
|
|
46
76
|
run(id: string): Promise<RunDetail>;
|
|
47
77
|
retry(id: string): Promise<WorkflowRun>;
|
|
48
78
|
cancel(id: string): Promise<WorkflowRun>;
|
|
79
|
+
continue(id: string): Promise<WorkflowRun>;
|
|
80
|
+
/**
|
|
81
|
+
* Live-tail a run's lifecycle events over SSE (replaces polling). Calls `onEvent` per event;
|
|
82
|
+
* returns a function to close the stream. Cross-pod when the server transport has a control plane.
|
|
83
|
+
*/
|
|
84
|
+
streamRun(id: string, onEvent: (event: EngineEvent) => void): () => void;
|
|
49
85
|
};
|
|
50
86
|
//# sourceMappingURL=durable-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"durable-client.d.ts","sourceRoot":"","sources":["../../src/client/durable-client.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;AACvF,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE/D,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,WAAW,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"durable-client.d.ts","sourceRoot":"","sources":["../../src/client/durable-client.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SA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AC,KAAK,EAAE,WAAW,KAAK,IAAI,GAAG,MAAM,IAAI;CAWzE,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
function apiBase() {
|
|
2
|
+
if (typeof window !== 'undefined' && window.__DURABLE_API__)
|
|
3
|
+
return window.__DURABLE_API__;
|
|
2
4
|
const base = (typeof window !== 'undefined' && window.__DURABLE_BASE__) || '/durable';
|
|
3
5
|
return `${base}/api`;
|
|
4
6
|
}
|
|
@@ -21,5 +23,24 @@ export const durableClient = {
|
|
|
21
23
|
cancel(id) {
|
|
22
24
|
return http(`/runs/${encodeURIComponent(id)}/cancel`, { method: 'POST' });
|
|
23
25
|
},
|
|
26
|
+
continue(id) {
|
|
27
|
+
return http(`/runs/${encodeURIComponent(id)}/continue`, { method: 'POST' });
|
|
28
|
+
},
|
|
29
|
+
/**
|
|
30
|
+
* Live-tail a run's lifecycle events over SSE (replaces polling). Calls `onEvent` per event;
|
|
31
|
+
* returns a function to close the stream. Cross-pod when the server transport has a control plane.
|
|
32
|
+
*/
|
|
33
|
+
streamRun(id, onEvent) {
|
|
34
|
+
const source = new EventSource(`${apiBase()}/runs/${encodeURIComponent(id)}/stream`);
|
|
35
|
+
source.onmessage = (msg) => {
|
|
36
|
+
try {
|
|
37
|
+
onEvent(JSON.parse(msg.data));
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
/* ignore malformed event */
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
return () => source.close();
|
|
44
|
+
},
|
|
24
45
|
};
|
|
25
46
|
//# sourceMappingURL=durable-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"durable-client.js","sourceRoot":"","sources":["../../src/client/durable-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"durable-client.js","sourceRoot":"","sources":["../../src/client/durable-client.ts"],"names":[],"mappings":"AAkFA,SAAS,OAAO;IACd,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,C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AE,MAAM,EAAE,CAAC,CAAC;IAC3F,CAAC;IACD;;;OAGG;IACH,SAAS,CAAC,EAAU,EAAE,OAAqC;QACzD,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,GAAG,OAAO,EAAE,SAAS,kBAAkB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;QACrF,MAAM,CAAC,SAAS,GAAG,CAAC,GAAG,EAAE,EAAE;YACzB,IAAI,CAAC;gBACH,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAgB,CAAC,CAAC;YAC/C,CAAC;YAAC,MAAM,CAAC;gBACP,4BAA4B;YAC9B,CAAC;QACH,CAAC,CAAC;QACF,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC;CACF,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type RunQuery, type RunResult, type StateStore, type StepCheckpoint, WorkflowEngine, type WorkflowRun } from '@dudousxd/nestjs-durable-core';
|
|
1
|
+
import { type EngineEvent, type RunQuery, type RunResult, type StateStore, type StepCheckpoint, WorkflowEngine, type WorkflowRun } from '@dudousxd/nestjs-durable-core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
2
3
|
export interface RunDetail {
|
|
3
4
|
run: WorkflowRun;
|
|
4
5
|
/** Steps in execution order — the end-to-end timeline (local + remote). */
|
|
@@ -16,5 +17,13 @@ export declare class DashboardService {
|
|
|
16
17
|
cancel(runId: string): Promise<RunResult | null>;
|
|
17
18
|
/** Resume a run paused at a `ctx.breakpoint` (the "continue" button). */
|
|
18
19
|
continue(runId: string): Promise<RunResult | null>;
|
|
20
|
+
/**
|
|
21
|
+
* Live stream of a run's lifecycle events for SSE. Backed by `engine.subscribe`, which — when the
|
|
22
|
+
* transport has a control plane — receives events from EVERY instance, so a dashboard-only pod
|
|
23
|
+
* tails a run executing on a worker pod. Without a control plane it only sees same-process events.
|
|
24
|
+
*/
|
|
25
|
+
streamRun(runId: string): Observable<{
|
|
26
|
+
data: EngineEvent;
|
|
27
|
+
}>;
|
|
19
28
|
}
|
|
20
29
|
//# sourceMappingURL=dashboard.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.service.d.ts","sourceRoot":"","sources":["../../src/server/dashboard.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,SAAS,EAEd,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,cAAc,EACd,KAAK,WAAW,EACjB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"dashboard.service.d.ts","sourceRoot":"","sources":["../../src/server/dashboard.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,SAAS,EAEd,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,cAAc,EACd,KAAK,WAAW,EACjB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,WAAW,CAAC;IACjB,2EAA2E;IAC3E,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC5B;AAED,2DAA2D;AAC3D,qBACa,gBAAgB;IAEJ,OAAO,CAAC,QAAQ,CAAC,KAAK;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADe,KAAK,EAAE,UAAU,EACtC,MAAM,EAAE,cAAc;IAGzC,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAI3C,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAO5D,qFAAqF;IACrF,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAIxC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAIhD,yEAAyE;IACzE,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAIlD;;;;OAIG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC;QAAE,IAAI,EAAE,WAAW,CAAA;KAAE,CAAC;CAQ5D"}
|
|
@@ -12,6 +12,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
12
12
|
};
|
|
13
13
|
import { STATE_STORE, WorkflowEngine, } from '@dudousxd/nestjs-durable-core';
|
|
14
14
|
import { Inject, Injectable } from '@nestjs/common';
|
|
15
|
+
import { Observable } from 'rxjs';
|
|
15
16
|
/** Read-model and actions backing the control-plane UI. */
|
|
16
17
|
let DashboardService = class DashboardService {
|
|
17
18
|
store;
|
|
@@ -41,6 +42,20 @@ let DashboardService = class DashboardService {
|
|
|
41
42
|
continue(runId) {
|
|
42
43
|
return this.engine.continue(runId);
|
|
43
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Live stream of a run's lifecycle events for SSE. Backed by `engine.subscribe`, which — when the
|
|
47
|
+
* transport has a control plane — receives events from EVERY instance, so a dashboard-only pod
|
|
48
|
+
* tails a run executing on a worker pod. Without a control plane it only sees same-process events.
|
|
49
|
+
*/
|
|
50
|
+
streamRun(runId) {
|
|
51
|
+
return new Observable((subscriber) => {
|
|
52
|
+
const off = this.engine.subscribe((event) => {
|
|
53
|
+
if (event.runId === runId)
|
|
54
|
+
subscriber.next({ data: event });
|
|
55
|
+
});
|
|
56
|
+
return () => off();
|
|
57
|
+
});
|
|
58
|
+
}
|
|
44
59
|
};
|
|
45
60
|
DashboardService = __decorate([
|
|
46
61
|
Injectable(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.service.js","sourceRoot":"","sources":["../../src/server/dashboard.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"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AAI,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;AA5CY,gBAAgB;IAD5B,UAAU,EAAE;IAGR,WAAA,MAAM,CAAC,WAAW,CAAC,CAAA;6CACK,cAAc;GAH9B,gBAAgB,CA4C5B"}
|
|
@@ -6,6 +6,11 @@ export declare class DurableApiController {
|
|
|
6
6
|
constructor(dashboard: DashboardService);
|
|
7
7
|
runs(status?: RunStatus, workflow?: string): Promise<import("@dudousxd/nestjs-durable-core").WorkflowRun[]>;
|
|
8
8
|
run(id: string): Promise<import("./dashboard.service.js").RunDetail>;
|
|
9
|
+
/** Server-Sent Events stream of a run's live lifecycle events — the dashboard tails it instead
|
|
10
|
+
* of polling. Cross-pod when the transport has a control plane (see DashboardService.streamRun). */
|
|
11
|
+
stream(id: string): import("rxjs").Observable<{
|
|
12
|
+
data: import("@dudousxd/nestjs-durable-core").EngineEvent;
|
|
13
|
+
}>;
|
|
9
14
|
retry(id: string): Promise<import("@dudousxd/nestjs-durable-core").RunResult>;
|
|
10
15
|
cancel(id: string): Promise<import("@dudousxd/nestjs-durable-core").RunResult>;
|
|
11
16
|
continue(id: string): Promise<import("@dudousxd/nestjs-durable-core").RunResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"durable-api.controller.d.ts","sourceRoot":"","sources":["../../src/server/durable-api.controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,kGAAkG;AAClG,qBACa,oBAAoB;IACnB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,gBAAgB;IAGxD,IAAI,CAAkB,MAAM,CAAC,EAAE,SAAS,EAAqB,QAAQ,CAAC,EAAE,MAAM;IAKxE,GAAG,CAAc,EAAE,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"durable-api.controller.d.ts","sourceRoot":"","sources":["../../src/server/durable-api.controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,kGAAkG;AAClG,qBACa,oBAAoB;IACnB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,gBAAgB;IAGxD,IAAI,CAAkB,MAAM,CAAC,EAAE,SAAS,EAAqB,QAAQ,CAAC,EAAE,MAAM;IAKxE,GAAG,CAAc,EAAE,EAAE,MAAM;IAMjC;yGACqG;IAErG,MAAM,CAAc,EAAE,EAAE,MAAM;;;IAK9B,KAAK,CAAc,EAAE,EAAE,MAAM;IAKvB,MAAM,CAAc,EAAE,EAAE,MAAM;IAO9B,QAAQ,CAAc,EAAE,EAAE,MAAM;CAKvC"}
|
|
@@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
12
|
};
|
|
13
|
-
import { Controller, Get, NotFoundException, Param, Post, Query } from '@nestjs/common';
|
|
13
|
+
import { Controller, Get, NotFoundException, Param, Post, Query, Sse } from '@nestjs/common';
|
|
14
14
|
import { DashboardService } from './dashboard.service.js';
|
|
15
15
|
/** JSON API consumed by the control-plane SPA. Mounted at `apiBasePath` (set by RouterModule). */
|
|
16
16
|
let DurableApiController = class DurableApiController {
|
|
@@ -27,6 +27,11 @@ let DurableApiController = class DurableApiController {
|
|
|
27
27
|
throw new NotFoundException(`run ${id} not found`);
|
|
28
28
|
return detail;
|
|
29
29
|
}
|
|
30
|
+
/** Server-Sent Events stream of a run's live lifecycle events — the dashboard tails it instead
|
|
31
|
+
* of polling. Cross-pod when the transport has a control plane (see DashboardService.streamRun). */
|
|
32
|
+
stream(id) {
|
|
33
|
+
return this.dashboard.streamRun(id);
|
|
34
|
+
}
|
|
30
35
|
retry(id) {
|
|
31
36
|
return this.dashboard.retry(id);
|
|
32
37
|
}
|
|
@@ -58,6 +63,13 @@ __decorate([
|
|
|
58
63
|
__metadata("design:paramtypes", [String]),
|
|
59
64
|
__metadata("design:returntype", Promise)
|
|
60
65
|
], DurableApiController.prototype, "run", null);
|
|
66
|
+
__decorate([
|
|
67
|
+
Sse('runs/:id/stream'),
|
|
68
|
+
__param(0, Param('id')),
|
|
69
|
+
__metadata("design:type", Function),
|
|
70
|
+
__metadata("design:paramtypes", [String]),
|
|
71
|
+
__metadata("design:returntype", void 0)
|
|
72
|
+
], DurableApiController.prototype, "stream", null);
|
|
61
73
|
__decorate([
|
|
62
74
|
Post('runs/:id/retry'),
|
|
63
75
|
__param(0, Param('id')),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"durable-api.controller.js","sourceRoot":"","sources":["../../src/server/durable-api.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"durable-api.controller.js","sourceRoot":"","sources":["../../src/server/durable-api.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,MA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