@dudousxd/nestjs-durable-dashboard 0.50.0 → 0.51.1
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 +2 -0
- package/dist/client/durable-client.d.ts.map +1 -1
- package/dist/client/durable-client.js +8 -0
- package/dist/client/durable-client.js.map +1 -1
- package/dist/server/index.cjs +402 -293
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +22 -5
- package/dist/server/index.d.ts +22 -5
- package/dist/server/index.js +274 -165
- package/dist/server/index.js.map +1 -1
- package/dist/spa/assets/{bench-bNSq4C-e.js → bench-UvOjwMnz.js} +1 -1
- package/dist/spa/assets/{index-DYEe8Ag-.css → index-BbR4CZ1K.css} +1 -1
- package/dist/spa/assets/{index-CwX0J7uV.js → index-DnQL-Xbv.js} +15 -15
- package/dist/spa/assets/{index-CMQJ1rjL.js → index-ov2ocqi5.js} +1 -1
- package/dist/spa/assets/{preview-CehDLs8M.js → preview-BSiqTdta.js} +1 -1
- package/dist/spa/bench.html +3 -3
- package/dist/spa/index.html +3 -3
- package/dist/spa/preview.html +3 -3
- package/package.json +2 -2
package/dist/server/index.js
CHANGED
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
|
|
4
4
|
// src/server/dashboard.service.ts
|
|
5
|
-
import { RunGateway, STATE_STORE_CANONICAL, WorkflowEngine, collectMetrics } from "@dudousxd/nestjs-durable-core";
|
|
5
|
+
import { RunGateway, STATE_STORE_CANONICAL, TERMINAL_RUN_STATUSES, WorkflowEngine, collectMetrics, parseWebhookToken } from "@dudousxd/nestjs-durable-core";
|
|
6
6
|
import { Inject, Injectable, Optional } from "@nestjs/common";
|
|
7
7
|
import { Observable } from "rxjs";
|
|
8
8
|
function _ts_decorate(decorators, target, key, desc) {
|
|
@@ -211,11 +211,30 @@ var DashboardService = class {
|
|
|
211
211
|
}
|
|
212
212
|
/**
|
|
213
213
|
* Deliver a `ctx.webhook()` callback: turn an inbound POST (token + body) into the signal the
|
|
214
|
-
*
|
|
215
|
-
*
|
|
214
|
+
* run is (or will be) parked on. A callback that arrives BEFORE the run reaches `wait()` (the url
|
|
215
|
+
* was handed out and the run is still busy or sleeping) is buffered, and `wait()` consumes it, so
|
|
216
|
+
* the result is the run's current status. Returns `null` — mapped to 404 by the controller — for a
|
|
217
|
+
* token that is not a webhook token, whose run doesn't exist or is terminal, or whose wait already
|
|
218
|
+
* resolved (a duplicate): nothing is buffered for those, so a public endpoint can't leave junk
|
|
219
|
+
* rows behind or signal non-webhook tokens. Control-plane-only.
|
|
216
220
|
*/
|
|
217
221
|
async deliverWebhook(token, body) {
|
|
218
|
-
|
|
222
|
+
const { store, engine } = this.controlPlane();
|
|
223
|
+
const parsed = parseWebhookToken(token);
|
|
224
|
+
if (!parsed) return null;
|
|
225
|
+
const run = await store.getRun(parsed.runId);
|
|
226
|
+
if (!run || TERMINAL_RUN_STATUSES.includes(run.status)) return null;
|
|
227
|
+
const resolved = await store.getCheckpoint(parsed.runId, parsed.seq);
|
|
228
|
+
if (resolved?.status === "completed") return null;
|
|
229
|
+
const delivered = await engine.signal(token, body);
|
|
230
|
+
if (delivered) return delivered;
|
|
231
|
+
const now = await store.getCheckpoint(parsed.runId, parsed.seq);
|
|
232
|
+
if (now?.status === "completed" && await store.takeBufferedSignal(token)) return null;
|
|
233
|
+
const fresh = await store.getRun(parsed.runId);
|
|
234
|
+
return {
|
|
235
|
+
runId: run.id,
|
|
236
|
+
status: fresh?.status ?? run.status
|
|
237
|
+
};
|
|
219
238
|
}
|
|
220
239
|
/** Side-effect-free read of a value a run published via `ctx.setEvent` (a live query). Control-plane-only. */
|
|
221
240
|
async getEvent(runId, key) {
|
|
@@ -255,7 +274,7 @@ DashboardService = _ts_decorate([
|
|
|
255
274
|
|
|
256
275
|
// src/server/durable-api.controller.ts
|
|
257
276
|
import { ApplyFilter, ApplyFilterInterceptor, FilterRunner } from "@dudousxd/nestjs-filter";
|
|
258
|
-
import { Body, Controller, Get, Header, NotFoundException, Param, Post, Query, Sse, UseInterceptors } from "@nestjs/common";
|
|
277
|
+
import { Body, Controller, Get, Header, Headers, NotFoundException, Param, Post, Query, Res, Sse, UseFilters, UseInterceptors } from "@nestjs/common";
|
|
259
278
|
|
|
260
279
|
// src/server/durable-run.ts
|
|
261
280
|
var DurableRun = class {
|
|
@@ -330,6 +349,129 @@ function runValueAxisFor(field) {
|
|
|
330
349
|
}
|
|
331
350
|
__name(runValueAxisFor, "runValueAxisFor");
|
|
332
351
|
|
|
352
|
+
// src/server/not-modified.ts
|
|
353
|
+
import { Catch, HttpException } from "@nestjs/common";
|
|
354
|
+
|
|
355
|
+
// src/server/auth/response.ts
|
|
356
|
+
function isRecord(value) {
|
|
357
|
+
return typeof value === "object" && value !== null;
|
|
358
|
+
}
|
|
359
|
+
__name(isRecord, "isRecord");
|
|
360
|
+
function isRawCookieResponse(value) {
|
|
361
|
+
return isRecord(value) && typeof value.getHeader === "function" && typeof value.setHeader === "function";
|
|
362
|
+
}
|
|
363
|
+
__name(isRawCookieResponse, "isRawCookieResponse");
|
|
364
|
+
function resolveCookieResponse(response) {
|
|
365
|
+
if (isRawCookieResponse(response)) return response;
|
|
366
|
+
if (isRecord(response) && isRawCookieResponse(response.raw)) return response.raw;
|
|
367
|
+
return null;
|
|
368
|
+
}
|
|
369
|
+
__name(resolveCookieResponse, "resolveCookieResponse");
|
|
370
|
+
function existingSetCookies(response) {
|
|
371
|
+
const current = response.getHeader("set-cookie");
|
|
372
|
+
if (Array.isArray(current)) return current;
|
|
373
|
+
if (typeof current === "string") return [
|
|
374
|
+
current
|
|
375
|
+
];
|
|
376
|
+
return [];
|
|
377
|
+
}
|
|
378
|
+
__name(existingSetCookies, "existingSetCookies");
|
|
379
|
+
function appendSetCookie(response, cookie) {
|
|
380
|
+
const raw = resolveCookieResponse(response);
|
|
381
|
+
if (!raw) return;
|
|
382
|
+
raw.setHeader("set-cookie", [
|
|
383
|
+
...existingSetCookies(raw),
|
|
384
|
+
cookie
|
|
385
|
+
]);
|
|
386
|
+
}
|
|
387
|
+
__name(appendSetCookie, "appendSetCookie");
|
|
388
|
+
function isRawRedirectResponse(value) {
|
|
389
|
+
return isRecord(value) && typeof value.getHeader === "function" && typeof value.setHeader === "function" && typeof value.end === "function";
|
|
390
|
+
}
|
|
391
|
+
__name(isRawRedirectResponse, "isRawRedirectResponse");
|
|
392
|
+
function resolveRedirectResponse(response) {
|
|
393
|
+
if (isRawRedirectResponse(response)) return response;
|
|
394
|
+
if (isRecord(response) && isRawRedirectResponse(response.raw)) return response.raw;
|
|
395
|
+
return null;
|
|
396
|
+
}
|
|
397
|
+
__name(resolveRedirectResponse, "resolveRedirectResponse");
|
|
398
|
+
function redirectRaw(response, location, status = 302) {
|
|
399
|
+
const raw = resolveRedirectResponse(response);
|
|
400
|
+
if (!raw) return;
|
|
401
|
+
raw.statusCode = status;
|
|
402
|
+
raw.setHeader("location", location);
|
|
403
|
+
raw.end();
|
|
404
|
+
}
|
|
405
|
+
__name(redirectRaw, "redirectRaw");
|
|
406
|
+
function responseAlreadyWritten(response) {
|
|
407
|
+
const raw = resolveRedirectResponse(response);
|
|
408
|
+
return raw?.headersSent === true;
|
|
409
|
+
}
|
|
410
|
+
__name(responseAlreadyWritten, "responseAlreadyWritten");
|
|
411
|
+
function writeHtmlRaw(response, html, status = 200) {
|
|
412
|
+
const raw = resolveRedirectResponse(response);
|
|
413
|
+
if (!raw) return;
|
|
414
|
+
raw.statusCode = status;
|
|
415
|
+
raw.setHeader("content-type", "text/html; charset=utf-8");
|
|
416
|
+
raw.setHeader("cache-control", "no-store, must-revalidate");
|
|
417
|
+
raw.end(html);
|
|
418
|
+
}
|
|
419
|
+
__name(writeHtmlRaw, "writeHtmlRaw");
|
|
420
|
+
function setRawHeader(response, name, value) {
|
|
421
|
+
resolveCookieResponse(response)?.setHeader(name, value);
|
|
422
|
+
}
|
|
423
|
+
__name(setRawHeader, "setRawHeader");
|
|
424
|
+
function writeNotModifiedRaw(response, etag) {
|
|
425
|
+
const raw = resolveRedirectResponse(response);
|
|
426
|
+
if (!raw) return;
|
|
427
|
+
raw.statusCode = 304;
|
|
428
|
+
raw.setHeader("etag", etag);
|
|
429
|
+
raw.setHeader("cache-control", "private, no-cache");
|
|
430
|
+
raw.end();
|
|
431
|
+
}
|
|
432
|
+
__name(writeNotModifiedRaw, "writeNotModifiedRaw");
|
|
433
|
+
|
|
434
|
+
// src/server/not-modified.ts
|
|
435
|
+
function _ts_decorate2(decorators, target, key, desc) {
|
|
436
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
437
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
438
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
439
|
+
} else {
|
|
440
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
441
|
+
if (d = decorators[i]) {
|
|
442
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
447
|
+
}
|
|
448
|
+
__name(_ts_decorate2, "_ts_decorate");
|
|
449
|
+
var NotModifiedException = class extends HttpException {
|
|
450
|
+
static {
|
|
451
|
+
__name(this, "NotModifiedException");
|
|
452
|
+
}
|
|
453
|
+
etag;
|
|
454
|
+
constructor(etag) {
|
|
455
|
+
super("Not Modified", 304), this.etag = etag;
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
var NotModifiedFilter = class {
|
|
459
|
+
static {
|
|
460
|
+
__name(this, "NotModifiedFilter");
|
|
461
|
+
}
|
|
462
|
+
catch(exception, host) {
|
|
463
|
+
writeNotModifiedRaw(host.switchToHttp().getResponse(), exception.etag);
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
NotModifiedFilter = _ts_decorate2([
|
|
467
|
+
Catch(NotModifiedException)
|
|
468
|
+
], NotModifiedFilter);
|
|
469
|
+
function setEtag(response, etag) {
|
|
470
|
+
setRawHeader(response, "etag", etag);
|
|
471
|
+
setRawHeader(response, "cache-control", "private, no-cache");
|
|
472
|
+
}
|
|
473
|
+
__name(setEtag, "setEtag");
|
|
474
|
+
|
|
333
475
|
// src/server/run-list-row.ts
|
|
334
476
|
function toRunListRow(run) {
|
|
335
477
|
const { input: _input, output: _output, error: _error, ...row } = run;
|
|
@@ -420,7 +562,7 @@ var RunQueryDraft2 = class {
|
|
|
420
562
|
};
|
|
421
563
|
|
|
422
564
|
// src/server/run-query.adapter.ts
|
|
423
|
-
function
|
|
565
|
+
function _ts_decorate3(decorators, target, key, desc) {
|
|
424
566
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
425
567
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
426
568
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -433,7 +575,7 @@ function _ts_decorate2(decorators, target, key, desc) {
|
|
|
433
575
|
}
|
|
434
576
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
435
577
|
}
|
|
436
|
-
__name(
|
|
578
|
+
__name(_ts_decorate3, "_ts_decorate");
|
|
437
579
|
function _ts_metadata2(metadataKey, metadataValue) {
|
|
438
580
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
439
581
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
@@ -713,7 +855,7 @@ var RunQueryAdapter = class {
|
|
|
713
855
|
}
|
|
714
856
|
}
|
|
715
857
|
};
|
|
716
|
-
RunQueryAdapter =
|
|
858
|
+
RunQueryAdapter = _ts_decorate3([
|
|
717
859
|
Injectable2(),
|
|
718
860
|
_ts_metadata2("design:type", Function),
|
|
719
861
|
_ts_metadata2("design:paramtypes", [
|
|
@@ -722,7 +864,7 @@ RunQueryAdapter = _ts_decorate2([
|
|
|
722
864
|
], RunQueryAdapter);
|
|
723
865
|
|
|
724
866
|
// src/server/run.filter.ts
|
|
725
|
-
function
|
|
867
|
+
function _ts_decorate4(decorators, target, key, desc) {
|
|
726
868
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
727
869
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
728
870
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -735,7 +877,7 @@ function _ts_decorate3(decorators, target, key, desc) {
|
|
|
735
877
|
}
|
|
736
878
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
737
879
|
}
|
|
738
|
-
__name(
|
|
880
|
+
__name(_ts_decorate4, "_ts_decorate");
|
|
739
881
|
function _ts_metadata3(metadataKey, metadataValue) {
|
|
740
882
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
741
883
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
@@ -861,7 +1003,7 @@ var RunFilter = class extends BaseFilter {
|
|
|
861
1003
|
});
|
|
862
1004
|
}
|
|
863
1005
|
};
|
|
864
|
-
|
|
1006
|
+
_ts_decorate4([
|
|
865
1007
|
FilterFor("status"),
|
|
866
1008
|
_ts_metadata3("design:type", Function),
|
|
867
1009
|
_ts_metadata3("design:paramtypes", [
|
|
@@ -869,7 +1011,7 @@ _ts_decorate3([
|
|
|
869
1011
|
]),
|
|
870
1012
|
_ts_metadata3("design:returntype", void 0)
|
|
871
1013
|
], RunFilter.prototype, "applyStatus", null);
|
|
872
|
-
|
|
1014
|
+
_ts_decorate4([
|
|
873
1015
|
FilterFor("workflow"),
|
|
874
1016
|
_ts_metadata3("design:type", Function),
|
|
875
1017
|
_ts_metadata3("design:paramtypes", [
|
|
@@ -877,7 +1019,7 @@ _ts_decorate3([
|
|
|
877
1019
|
]),
|
|
878
1020
|
_ts_metadata3("design:returntype", void 0)
|
|
879
1021
|
], RunFilter.prototype, "applyWorkflow", null);
|
|
880
|
-
|
|
1022
|
+
_ts_decorate4([
|
|
881
1023
|
FilterFor("namespace"),
|
|
882
1024
|
_ts_metadata3("design:type", Function),
|
|
883
1025
|
_ts_metadata3("design:paramtypes", [
|
|
@@ -885,7 +1027,7 @@ _ts_decorate3([
|
|
|
885
1027
|
]),
|
|
886
1028
|
_ts_metadata3("design:returntype", void 0)
|
|
887
1029
|
], RunFilter.prototype, "applyNamespace", null);
|
|
888
|
-
|
|
1030
|
+
_ts_decorate4([
|
|
889
1031
|
FilterFor("tag"),
|
|
890
1032
|
_ts_metadata3("design:type", Function),
|
|
891
1033
|
_ts_metadata3("design:paramtypes", [
|
|
@@ -893,19 +1035,19 @@ _ts_decorate3([
|
|
|
893
1035
|
]),
|
|
894
1036
|
_ts_metadata3("design:returntype", void 0)
|
|
895
1037
|
], RunFilter.prototype, "applyTag", null);
|
|
896
|
-
|
|
1038
|
+
_ts_decorate4([
|
|
897
1039
|
FilterFor("origin"),
|
|
898
1040
|
_ts_metadata3("design:type", Function),
|
|
899
1041
|
_ts_metadata3("design:paramtypes", []),
|
|
900
1042
|
_ts_metadata3("design:returntype", void 0)
|
|
901
1043
|
], RunFilter.prototype, "applyOrigin", null);
|
|
902
|
-
|
|
1044
|
+
_ts_decorate4([
|
|
903
1045
|
FilterFor("unattributed"),
|
|
904
1046
|
_ts_metadata3("design:type", Function),
|
|
905
1047
|
_ts_metadata3("design:paramtypes", []),
|
|
906
1048
|
_ts_metadata3("design:returntype", void 0)
|
|
907
1049
|
], RunFilter.prototype, "applyUnattributed", null);
|
|
908
|
-
|
|
1050
|
+
_ts_decorate4([
|
|
909
1051
|
FilterFor("attr"),
|
|
910
1052
|
_ts_metadata3("design:type", Function),
|
|
911
1053
|
_ts_metadata3("design:paramtypes", [
|
|
@@ -913,7 +1055,7 @@ _ts_decorate3([
|
|
|
913
1055
|
]),
|
|
914
1056
|
_ts_metadata3("design:returntype", void 0)
|
|
915
1057
|
], RunFilter.prototype, "applyAttributes", null);
|
|
916
|
-
|
|
1058
|
+
_ts_decorate4([
|
|
917
1059
|
FilterFor("limit"),
|
|
918
1060
|
_ts_metadata3("design:type", Function),
|
|
919
1061
|
_ts_metadata3("design:paramtypes", [
|
|
@@ -921,7 +1063,7 @@ _ts_decorate3([
|
|
|
921
1063
|
]),
|
|
922
1064
|
_ts_metadata3("design:returntype", void 0)
|
|
923
1065
|
], RunFilter.prototype, "applyLimit", null);
|
|
924
|
-
|
|
1066
|
+
_ts_decorate4([
|
|
925
1067
|
FilterFor("offset"),
|
|
926
1068
|
_ts_metadata3("design:type", Function),
|
|
927
1069
|
_ts_metadata3("design:paramtypes", [
|
|
@@ -929,7 +1071,7 @@ _ts_decorate3([
|
|
|
929
1071
|
]),
|
|
930
1072
|
_ts_metadata3("design:returntype", void 0)
|
|
931
1073
|
], RunFilter.prototype, "applyOffset", null);
|
|
932
|
-
RunFilter =
|
|
1074
|
+
RunFilter = _ts_decorate4([
|
|
933
1075
|
Injectable3(),
|
|
934
1076
|
Filterable({
|
|
935
1077
|
entity: DurableRun,
|
|
@@ -939,7 +1081,7 @@ RunFilter = _ts_decorate3([
|
|
|
939
1081
|
], RunFilter);
|
|
940
1082
|
|
|
941
1083
|
// src/server/durable-api.controller.ts
|
|
942
|
-
function
|
|
1084
|
+
function _ts_decorate5(decorators, target, key, desc) {
|
|
943
1085
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
944
1086
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
945
1087
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -952,7 +1094,7 @@ function _ts_decorate4(decorators, target, key, desc) {
|
|
|
952
1094
|
}
|
|
953
1095
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
954
1096
|
}
|
|
955
|
-
__name(
|
|
1097
|
+
__name(_ts_decorate5, "_ts_decorate");
|
|
956
1098
|
function _ts_metadata4(metadataKey, metadataValue) {
|
|
957
1099
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
958
1100
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
@@ -1067,23 +1209,43 @@ var DurableApiController = class {
|
|
|
1067
1209
|
/**
|
|
1068
1210
|
* A run's detail. Fans wider than {@link FAN_INLINE_MAX} come back as one `FanSummary` each, their
|
|
1069
1211
|
* members paged by `runs/:id/fans/:group`; `?full=true` returns every checkpoint instead.
|
|
1212
|
+
*
|
|
1213
|
+
* When the gateway can version the detail without reading it, the response carries an `ETag`, and
|
|
1214
|
+
* a poll whose `If-None-Match` still names it gets a 304 before the timeline is read. The browser
|
|
1215
|
+
* sends that header itself (the response is `no-cache`), so a console poll needs no code for it.
|
|
1070
1216
|
*/
|
|
1071
|
-
async run(id, full) {
|
|
1217
|
+
async run(id, full, ifNoneMatch, response) {
|
|
1072
1218
|
const detail = await this.dashboard.getRunDetail(id, full === "true" ? void 0 : {
|
|
1073
|
-
summarizeFansOver: FAN_INLINE_MAX
|
|
1219
|
+
summarizeFansOver: FAN_INLINE_MAX,
|
|
1220
|
+
...ifNoneMatch && {
|
|
1221
|
+
ifNoneMatch
|
|
1222
|
+
}
|
|
1074
1223
|
});
|
|
1075
1224
|
if (!detail) throw new NotFoundException(`run ${id} not found`);
|
|
1076
|
-
|
|
1225
|
+
const { etag, notModified, ...body } = detail;
|
|
1226
|
+
if (etag) {
|
|
1227
|
+
if (notModified) throw new NotModifiedException(etag);
|
|
1228
|
+
setEtag(response, etag);
|
|
1229
|
+
}
|
|
1230
|
+
return body;
|
|
1077
1231
|
}
|
|
1078
|
-
/** One page of a summarized fan's members, in seq order. */
|
|
1079
|
-
async fanMembers(id, group, offset, limit, failed) {
|
|
1232
|
+
/** One page of a summarized fan's members, in seq order. Versioned like {@link run}. */
|
|
1233
|
+
async fanMembers(id, group, offset, limit, failed, ifNoneMatch, response) {
|
|
1080
1234
|
const page2 = await this.dashboard.getFanMembers(id, group, {
|
|
1081
1235
|
offset: offset === void 0 ? void 0 : Number(offset),
|
|
1082
1236
|
limit: limit === void 0 ? void 0 : Number(limit),
|
|
1083
|
-
failedOnly: failed === "true"
|
|
1237
|
+
failedOnly: failed === "true",
|
|
1238
|
+
...ifNoneMatch && {
|
|
1239
|
+
ifNoneMatch
|
|
1240
|
+
}
|
|
1084
1241
|
});
|
|
1085
1242
|
if (!page2) throw new NotFoundException(`fan ${group} of run ${id} not found`);
|
|
1086
|
-
|
|
1243
|
+
const { etag, notModified, ...body } = page2;
|
|
1244
|
+
if (etag) {
|
|
1245
|
+
if (notModified) throw new NotModifiedException(etag);
|
|
1246
|
+
setEtag(response, etag);
|
|
1247
|
+
}
|
|
1248
|
+
return body;
|
|
1087
1249
|
}
|
|
1088
1250
|
/** Server-Sent Events stream of a run's live lifecycle events — the dashboard tails it instead
|
|
1089
1251
|
* of polling. Cross-pod when the transport has a control plane (see DashboardService.streamRun). */
|
|
@@ -1134,7 +1296,7 @@ var DurableApiController = class {
|
|
|
1134
1296
|
*/
|
|
1135
1297
|
async webhook(token, body) {
|
|
1136
1298
|
const result = await this.dashboard.deliverWebhook(token, body);
|
|
1137
|
-
if (!result) throw new NotFoundException(`no run is waiting
|
|
1299
|
+
if (!result) throw new NotFoundException(`no live run is waiting for webhook ${token}`);
|
|
1138
1300
|
return result;
|
|
1139
1301
|
}
|
|
1140
1302
|
/** Live query: the latest value a run published for `key` via `ctx.setEvent` (no side effect). */
|
|
@@ -1146,7 +1308,7 @@ var DurableApiController = class {
|
|
|
1146
1308
|
return this.dashboard.update(id, name, body);
|
|
1147
1309
|
}
|
|
1148
1310
|
};
|
|
1149
|
-
|
|
1311
|
+
_ts_decorate5([
|
|
1150
1312
|
Get("runs"),
|
|
1151
1313
|
_ts_param2(0, ApplyFilter(RunFilter)),
|
|
1152
1314
|
_ts_metadata4("design:type", Function),
|
|
@@ -1155,7 +1317,7 @@ _ts_decorate4([
|
|
|
1155
1317
|
]),
|
|
1156
1318
|
_ts_metadata4("design:returntype", Promise)
|
|
1157
1319
|
], DurableApiController.prototype, "runs", null);
|
|
1158
|
-
|
|
1320
|
+
_ts_decorate5([
|
|
1159
1321
|
Get("runs/facets"),
|
|
1160
1322
|
_ts_param2(0, ApplyFilter(RunFilter)),
|
|
1161
1323
|
_ts_metadata4("design:type", Function),
|
|
@@ -1164,7 +1326,7 @@ _ts_decorate4([
|
|
|
1164
1326
|
]),
|
|
1165
1327
|
_ts_metadata4("design:returntype", void 0)
|
|
1166
1328
|
], DurableApiController.prototype, "facets", null);
|
|
1167
|
-
|
|
1329
|
+
_ts_decorate5([
|
|
1168
1330
|
Get("runs/values"),
|
|
1169
1331
|
_ts_param2(0, Query()),
|
|
1170
1332
|
_ts_metadata4("design:type", Function),
|
|
@@ -1173,20 +1335,20 @@ _ts_decorate4([
|
|
|
1173
1335
|
]),
|
|
1174
1336
|
_ts_metadata4("design:returntype", void 0)
|
|
1175
1337
|
], DurableApiController.prototype, "values", null);
|
|
1176
|
-
|
|
1338
|
+
_ts_decorate5([
|
|
1177
1339
|
Get("metrics"),
|
|
1178
1340
|
Header("Content-Type", "text/plain; version=0.0.4"),
|
|
1179
1341
|
_ts_metadata4("design:type", Function),
|
|
1180
1342
|
_ts_metadata4("design:paramtypes", []),
|
|
1181
1343
|
_ts_metadata4("design:returntype", void 0)
|
|
1182
1344
|
], DurableApiController.prototype, "metrics", null);
|
|
1183
|
-
|
|
1345
|
+
_ts_decorate5([
|
|
1184
1346
|
Get("workers"),
|
|
1185
1347
|
_ts_metadata4("design:type", Function),
|
|
1186
1348
|
_ts_metadata4("design:paramtypes", []),
|
|
1187
1349
|
_ts_metadata4("design:returntype", void 0)
|
|
1188
1350
|
], DurableApiController.prototype, "workers", null);
|
|
1189
|
-
|
|
1351
|
+
_ts_decorate5([
|
|
1190
1352
|
Get("schedules"),
|
|
1191
1353
|
_ts_param2(0, Query("namespace")),
|
|
1192
1354
|
_ts_param2(1, Query("workflow")),
|
|
@@ -1203,7 +1365,7 @@ _ts_decorate4([
|
|
|
1203
1365
|
]),
|
|
1204
1366
|
_ts_metadata4("design:returntype", void 0)
|
|
1205
1367
|
], DurableApiController.prototype, "schedules", null);
|
|
1206
|
-
|
|
1368
|
+
_ts_decorate5([
|
|
1207
1369
|
Post("schedules/:id/pause"),
|
|
1208
1370
|
_ts_param2(0, Param("id")),
|
|
1209
1371
|
_ts_metadata4("design:type", Function),
|
|
@@ -1212,7 +1374,7 @@ _ts_decorate4([
|
|
|
1212
1374
|
]),
|
|
1213
1375
|
_ts_metadata4("design:returntype", void 0)
|
|
1214
1376
|
], DurableApiController.prototype, "pauseSchedule", null);
|
|
1215
|
-
|
|
1377
|
+
_ts_decorate5([
|
|
1216
1378
|
Post("schedules/:id/resume"),
|
|
1217
1379
|
_ts_param2(0, Param("id")),
|
|
1218
1380
|
_ts_metadata4("design:type", Function),
|
|
@@ -1221,7 +1383,7 @@ _ts_decorate4([
|
|
|
1221
1383
|
]),
|
|
1222
1384
|
_ts_metadata4("design:returntype", void 0)
|
|
1223
1385
|
], DurableApiController.prototype, "resumeSchedule", null);
|
|
1224
|
-
|
|
1386
|
+
_ts_decorate5([
|
|
1225
1387
|
Post("schedules/:id/trigger"),
|
|
1226
1388
|
_ts_param2(0, Param("id")),
|
|
1227
1389
|
_ts_metadata4("design:type", Function),
|
|
@@ -1230,41 +1392,53 @@ _ts_decorate4([
|
|
|
1230
1392
|
]),
|
|
1231
1393
|
_ts_metadata4("design:returntype", void 0)
|
|
1232
1394
|
], DurableApiController.prototype, "triggerSchedule", null);
|
|
1233
|
-
|
|
1395
|
+
_ts_decorate5([
|
|
1234
1396
|
Get("topology"),
|
|
1235
1397
|
_ts_metadata4("design:type", Function),
|
|
1236
1398
|
_ts_metadata4("design:paramtypes", []),
|
|
1237
1399
|
_ts_metadata4("design:returntype", void 0)
|
|
1238
1400
|
], DurableApiController.prototype, "topology", null);
|
|
1239
|
-
|
|
1401
|
+
_ts_decorate5([
|
|
1240
1402
|
Get("runs/:id"),
|
|
1241
1403
|
_ts_param2(0, Param("id")),
|
|
1242
1404
|
_ts_param2(1, Query("full")),
|
|
1405
|
+
_ts_param2(2, Headers("if-none-match")),
|
|
1406
|
+
_ts_param2(3, Res({
|
|
1407
|
+
passthrough: true
|
|
1408
|
+
})),
|
|
1243
1409
|
_ts_metadata4("design:type", Function),
|
|
1244
1410
|
_ts_metadata4("design:paramtypes", [
|
|
1245
1411
|
String,
|
|
1246
|
-
String
|
|
1412
|
+
String,
|
|
1413
|
+
String,
|
|
1414
|
+
Object
|
|
1247
1415
|
]),
|
|
1248
1416
|
_ts_metadata4("design:returntype", Promise)
|
|
1249
1417
|
], DurableApiController.prototype, "run", null);
|
|
1250
|
-
|
|
1418
|
+
_ts_decorate5([
|
|
1251
1419
|
Get("runs/:id/fans/:group"),
|
|
1252
1420
|
_ts_param2(0, Param("id")),
|
|
1253
1421
|
_ts_param2(1, Param("group")),
|
|
1254
1422
|
_ts_param2(2, Query("offset")),
|
|
1255
1423
|
_ts_param2(3, Query("limit")),
|
|
1256
1424
|
_ts_param2(4, Query("failed")),
|
|
1425
|
+
_ts_param2(5, Headers("if-none-match")),
|
|
1426
|
+
_ts_param2(6, Res({
|
|
1427
|
+
passthrough: true
|
|
1428
|
+
})),
|
|
1257
1429
|
_ts_metadata4("design:type", Function),
|
|
1258
1430
|
_ts_metadata4("design:paramtypes", [
|
|
1259
1431
|
String,
|
|
1260
1432
|
String,
|
|
1261
1433
|
String,
|
|
1262
1434
|
String,
|
|
1263
|
-
String
|
|
1435
|
+
String,
|
|
1436
|
+
String,
|
|
1437
|
+
Object
|
|
1264
1438
|
]),
|
|
1265
1439
|
_ts_metadata4("design:returntype", Promise)
|
|
1266
1440
|
], DurableApiController.prototype, "fanMembers", null);
|
|
1267
|
-
|
|
1441
|
+
_ts_decorate5([
|
|
1268
1442
|
Sse("runs/:id/stream"),
|
|
1269
1443
|
_ts_param2(0, Param("id")),
|
|
1270
1444
|
_ts_metadata4("design:type", Function),
|
|
@@ -1273,7 +1447,7 @@ _ts_decorate4([
|
|
|
1273
1447
|
]),
|
|
1274
1448
|
_ts_metadata4("design:returntype", void 0)
|
|
1275
1449
|
], DurableApiController.prototype, "stream", null);
|
|
1276
|
-
|
|
1450
|
+
_ts_decorate5([
|
|
1277
1451
|
Post("runs/:id/retry"),
|
|
1278
1452
|
_ts_param2(0, Param("id")),
|
|
1279
1453
|
_ts_metadata4("design:type", Function),
|
|
@@ -1282,7 +1456,7 @@ _ts_decorate4([
|
|
|
1282
1456
|
]),
|
|
1283
1457
|
_ts_metadata4("design:returntype", void 0)
|
|
1284
1458
|
], DurableApiController.prototype, "retry", null);
|
|
1285
|
-
|
|
1459
|
+
_ts_decorate5([
|
|
1286
1460
|
Post("runs/:id/retry-with-input"),
|
|
1287
1461
|
_ts_param2(0, Param("id")),
|
|
1288
1462
|
_ts_param2(1, Body()),
|
|
@@ -1293,7 +1467,7 @@ _ts_decorate4([
|
|
|
1293
1467
|
]),
|
|
1294
1468
|
_ts_metadata4("design:returntype", void 0)
|
|
1295
1469
|
], DurableApiController.prototype, "retryWithInput", null);
|
|
1296
|
-
|
|
1470
|
+
_ts_decorate5([
|
|
1297
1471
|
Post("bulk/:action"),
|
|
1298
1472
|
_ts_param2(0, Param("action")),
|
|
1299
1473
|
_ts_param2(1, ApplyFilter(RunFilter)),
|
|
@@ -1306,7 +1480,7 @@ _ts_decorate4([
|
|
|
1306
1480
|
]),
|
|
1307
1481
|
_ts_metadata4("design:returntype", void 0)
|
|
1308
1482
|
], DurableApiController.prototype, "bulk", null);
|
|
1309
|
-
|
|
1483
|
+
_ts_decorate5([
|
|
1310
1484
|
Post("runs/:id/cancel"),
|
|
1311
1485
|
_ts_param2(0, Param("id")),
|
|
1312
1486
|
_ts_param2(1, Query("compensate")),
|
|
@@ -1317,7 +1491,7 @@ _ts_decorate4([
|
|
|
1317
1491
|
]),
|
|
1318
1492
|
_ts_metadata4("design:returntype", Promise)
|
|
1319
1493
|
], DurableApiController.prototype, "cancel", null);
|
|
1320
|
-
|
|
1494
|
+
_ts_decorate5([
|
|
1321
1495
|
Post("runs/:id/continue"),
|
|
1322
1496
|
_ts_param2(0, Param("id")),
|
|
1323
1497
|
_ts_metadata4("design:type", Function),
|
|
@@ -1326,7 +1500,7 @@ _ts_decorate4([
|
|
|
1326
1500
|
]),
|
|
1327
1501
|
_ts_metadata4("design:returntype", Promise)
|
|
1328
1502
|
], DurableApiController.prototype, "continue", null);
|
|
1329
|
-
|
|
1503
|
+
_ts_decorate5([
|
|
1330
1504
|
Post("runs/:id/redispatch"),
|
|
1331
1505
|
_ts_param2(0, Param("id")),
|
|
1332
1506
|
_ts_metadata4("design:type", Function),
|
|
@@ -1335,7 +1509,7 @@ _ts_decorate4([
|
|
|
1335
1509
|
]),
|
|
1336
1510
|
_ts_metadata4("design:returntype", Promise)
|
|
1337
1511
|
], DurableApiController.prototype, "redispatch", null);
|
|
1338
|
-
|
|
1512
|
+
_ts_decorate5([
|
|
1339
1513
|
Post("webhooks/:token"),
|
|
1340
1514
|
_ts_param2(0, Param("token")),
|
|
1341
1515
|
_ts_param2(1, Body()),
|
|
@@ -1346,7 +1520,7 @@ _ts_decorate4([
|
|
|
1346
1520
|
]),
|
|
1347
1521
|
_ts_metadata4("design:returntype", Promise)
|
|
1348
1522
|
], DurableApiController.prototype, "webhook", null);
|
|
1349
|
-
|
|
1523
|
+
_ts_decorate5([
|
|
1350
1524
|
Get("runs/:id/events/:key"),
|
|
1351
1525
|
_ts_param2(0, Param("id")),
|
|
1352
1526
|
_ts_param2(1, Param("key")),
|
|
@@ -1357,7 +1531,7 @@ _ts_decorate4([
|
|
|
1357
1531
|
]),
|
|
1358
1532
|
_ts_metadata4("design:returntype", void 0)
|
|
1359
1533
|
], DurableApiController.prototype, "event", null);
|
|
1360
|
-
|
|
1534
|
+
_ts_decorate5([
|
|
1361
1535
|
Post("runs/:id/updates/:name"),
|
|
1362
1536
|
_ts_param2(0, Param("id")),
|
|
1363
1537
|
_ts_param2(1, Param("name")),
|
|
@@ -1370,9 +1544,10 @@ _ts_decorate4([
|
|
|
1370
1544
|
]),
|
|
1371
1545
|
_ts_metadata4("design:returntype", void 0)
|
|
1372
1546
|
], DurableApiController.prototype, "update", null);
|
|
1373
|
-
DurableApiController =
|
|
1547
|
+
DurableApiController = _ts_decorate5([
|
|
1374
1548
|
Controller(),
|
|
1375
1549
|
UseInterceptors(ApplyFilterInterceptor),
|
|
1550
|
+
UseFilters(NotModifiedFilter),
|
|
1376
1551
|
_ts_metadata4("design:type", Function),
|
|
1377
1552
|
_ts_metadata4("design:paramtypes", [
|
|
1378
1553
|
typeof DashboardService === "undefined" ? Object : DashboardService,
|
|
@@ -1388,7 +1563,7 @@ function notFound(error) {
|
|
|
1388
1563
|
__name(notFound, "notFound");
|
|
1389
1564
|
|
|
1390
1565
|
// src/server/durable-auth.controller.ts
|
|
1391
|
-
import { BadRequestException as BadRequestException2, Body as Body2, Controller as Controller3, Get as Get3, Header as Header3, HttpCode, Inject as Inject4, Logger as Logger2, NotFoundException as NotFoundException3, Optional as Optional3, Post as Post2, Req, Res, UnauthorizedException } from "@nestjs/common";
|
|
1566
|
+
import { BadRequestException as BadRequestException2, Body as Body2, Controller as Controller3, Get as Get3, Header as Header3, HttpCode, Inject as Inject4, Logger as Logger2, NotFoundException as NotFoundException3, Optional as Optional3, Post as Post2, Req, Res as Res2, UnauthorizedException } from "@nestjs/common";
|
|
1392
1567
|
|
|
1393
1568
|
// src/server/auth/dashboard-auth-config.ts
|
|
1394
1569
|
var DASHBOARD_AUTH = Symbol("DASHBOARD_AUTH");
|
|
@@ -1628,14 +1803,14 @@ function renderSessionRequiredPage(basePath) {
|
|
|
1628
1803
|
__name(renderSessionRequiredPage, "renderSessionRequiredPage");
|
|
1629
1804
|
|
|
1630
1805
|
// src/server/auth/request.ts
|
|
1631
|
-
function
|
|
1806
|
+
function isRecord2(value) {
|
|
1632
1807
|
return typeof value === "object" && value !== null;
|
|
1633
1808
|
}
|
|
1634
|
-
__name(
|
|
1809
|
+
__name(isRecord2, "isRecord");
|
|
1635
1810
|
function readHeaders(request) {
|
|
1636
|
-
if (!
|
|
1811
|
+
if (!isRecord2(request)) return {};
|
|
1637
1812
|
const headers = request.headers;
|
|
1638
|
-
return
|
|
1813
|
+
return isRecord2(headers) ? headers : {};
|
|
1639
1814
|
}
|
|
1640
1815
|
__name(readHeaders, "readHeaders");
|
|
1641
1816
|
function headerToString(value) {
|
|
@@ -1651,14 +1826,14 @@ function readCookieHeader(request) {
|
|
|
1651
1826
|
}
|
|
1652
1827
|
__name(readCookieHeader, "readCookieHeader");
|
|
1653
1828
|
function isHttpsRequest(request) {
|
|
1654
|
-
if (
|
|
1829
|
+
if (isRecord2(request) && request.protocol === "https") return true;
|
|
1655
1830
|
const forwarded = headerToString(readHeaders(request)["x-forwarded-proto"]);
|
|
1656
1831
|
if (forwarded === void 0) return false;
|
|
1657
1832
|
return forwarded.split(",").map((proto) => proto.trim().toLowerCase()).includes("https");
|
|
1658
1833
|
}
|
|
1659
1834
|
__name(isHttpsRequest, "isHttpsRequest");
|
|
1660
1835
|
function originalRequestUrl(request) {
|
|
1661
|
-
if (!
|
|
1836
|
+
if (!isRecord2(request)) return "/";
|
|
1662
1837
|
if (typeof request.originalUrl === "string" && request.originalUrl !== "") {
|
|
1663
1838
|
return request.originalUrl;
|
|
1664
1839
|
}
|
|
@@ -1675,72 +1850,6 @@ function sanitizeReturnTo(candidate, fallback) {
|
|
|
1675
1850
|
}
|
|
1676
1851
|
__name(sanitizeReturnTo, "sanitizeReturnTo");
|
|
1677
1852
|
|
|
1678
|
-
// src/server/auth/response.ts
|
|
1679
|
-
function isRecord2(value) {
|
|
1680
|
-
return typeof value === "object" && value !== null;
|
|
1681
|
-
}
|
|
1682
|
-
__name(isRecord2, "isRecord");
|
|
1683
|
-
function isRawCookieResponse(value) {
|
|
1684
|
-
return isRecord2(value) && typeof value.getHeader === "function" && typeof value.setHeader === "function";
|
|
1685
|
-
}
|
|
1686
|
-
__name(isRawCookieResponse, "isRawCookieResponse");
|
|
1687
|
-
function resolveCookieResponse(response) {
|
|
1688
|
-
if (isRawCookieResponse(response)) return response;
|
|
1689
|
-
if (isRecord2(response) && isRawCookieResponse(response.raw)) return response.raw;
|
|
1690
|
-
return null;
|
|
1691
|
-
}
|
|
1692
|
-
__name(resolveCookieResponse, "resolveCookieResponse");
|
|
1693
|
-
function existingSetCookies(response) {
|
|
1694
|
-
const current = response.getHeader("set-cookie");
|
|
1695
|
-
if (Array.isArray(current)) return current;
|
|
1696
|
-
if (typeof current === "string") return [
|
|
1697
|
-
current
|
|
1698
|
-
];
|
|
1699
|
-
return [];
|
|
1700
|
-
}
|
|
1701
|
-
__name(existingSetCookies, "existingSetCookies");
|
|
1702
|
-
function appendSetCookie(response, cookie) {
|
|
1703
|
-
const raw = resolveCookieResponse(response);
|
|
1704
|
-
if (!raw) return;
|
|
1705
|
-
raw.setHeader("set-cookie", [
|
|
1706
|
-
...existingSetCookies(raw),
|
|
1707
|
-
cookie
|
|
1708
|
-
]);
|
|
1709
|
-
}
|
|
1710
|
-
__name(appendSetCookie, "appendSetCookie");
|
|
1711
|
-
function isRawRedirectResponse(value) {
|
|
1712
|
-
return isRecord2(value) && typeof value.getHeader === "function" && typeof value.setHeader === "function" && typeof value.end === "function";
|
|
1713
|
-
}
|
|
1714
|
-
__name(isRawRedirectResponse, "isRawRedirectResponse");
|
|
1715
|
-
function resolveRedirectResponse(response) {
|
|
1716
|
-
if (isRawRedirectResponse(response)) return response;
|
|
1717
|
-
if (isRecord2(response) && isRawRedirectResponse(response.raw)) return response.raw;
|
|
1718
|
-
return null;
|
|
1719
|
-
}
|
|
1720
|
-
__name(resolveRedirectResponse, "resolveRedirectResponse");
|
|
1721
|
-
function redirectRaw(response, location, status = 302) {
|
|
1722
|
-
const raw = resolveRedirectResponse(response);
|
|
1723
|
-
if (!raw) return;
|
|
1724
|
-
raw.statusCode = status;
|
|
1725
|
-
raw.setHeader("location", location);
|
|
1726
|
-
raw.end();
|
|
1727
|
-
}
|
|
1728
|
-
__name(redirectRaw, "redirectRaw");
|
|
1729
|
-
function responseAlreadyWritten(response) {
|
|
1730
|
-
const raw = resolveRedirectResponse(response);
|
|
1731
|
-
return raw?.headersSent === true;
|
|
1732
|
-
}
|
|
1733
|
-
__name(responseAlreadyWritten, "responseAlreadyWritten");
|
|
1734
|
-
function writeHtmlRaw(response, html, status = 200) {
|
|
1735
|
-
const raw = resolveRedirectResponse(response);
|
|
1736
|
-
if (!raw) return;
|
|
1737
|
-
raw.statusCode = status;
|
|
1738
|
-
raw.setHeader("content-type", "text/html; charset=utf-8");
|
|
1739
|
-
raw.setHeader("cache-control", "no-store, must-revalidate");
|
|
1740
|
-
raw.end(html);
|
|
1741
|
-
}
|
|
1742
|
-
__name(writeHtmlRaw, "writeHtmlRaw");
|
|
1743
|
-
|
|
1744
1853
|
// src/server/auth/cookie-header.ts
|
|
1745
1854
|
function parseCookieHeader(header) {
|
|
1746
1855
|
const cookies = {};
|
|
@@ -1940,11 +2049,11 @@ __name(maybeRenewSession, "maybeRenewSession");
|
|
|
1940
2049
|
import { existsSync, readFileSync } from "node:fs";
|
|
1941
2050
|
import { basename, extname, join, resolve, sep } from "node:path";
|
|
1942
2051
|
import { fileURLToPath } from "node:url";
|
|
1943
|
-
import { Controller as Controller2, Get as Get2, Header as Header2, Inject as Inject3, NotFoundException as NotFoundException2, Param as Param2, StreamableFile, UseFilters } from "@nestjs/common";
|
|
2052
|
+
import { Controller as Controller2, Get as Get2, Header as Header2, Inject as Inject3, NotFoundException as NotFoundException2, Param as Param2, StreamableFile, UseFilters as UseFilters2 } from "@nestjs/common";
|
|
1944
2053
|
|
|
1945
2054
|
// src/server/auth/login-redirect.exception.ts
|
|
1946
|
-
import { Catch, HttpException, HttpStatus } from "@nestjs/common";
|
|
1947
|
-
function
|
|
2055
|
+
import { Catch as Catch2, HttpException as HttpException2, HttpStatus } from "@nestjs/common";
|
|
2056
|
+
function _ts_decorate6(decorators, target, key, desc) {
|
|
1948
2057
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1949
2058
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
1950
2059
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1957,8 +2066,8 @@ function _ts_decorate5(decorators, target, key, desc) {
|
|
|
1957
2066
|
}
|
|
1958
2067
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1959
2068
|
}
|
|
1960
|
-
__name(
|
|
1961
|
-
var DashboardLoginRedirectException = class extends
|
|
2069
|
+
__name(_ts_decorate6, "_ts_decorate");
|
|
2070
|
+
var DashboardLoginRedirectException = class extends HttpException2 {
|
|
1962
2071
|
static {
|
|
1963
2072
|
__name(this, "DashboardLoginRedirectException");
|
|
1964
2073
|
}
|
|
@@ -1978,13 +2087,13 @@ var DashboardLoginRedirectFilter = class {
|
|
|
1978
2087
|
redirectRaw(response, exception.location);
|
|
1979
2088
|
}
|
|
1980
2089
|
};
|
|
1981
|
-
DashboardLoginRedirectFilter =
|
|
1982
|
-
|
|
2090
|
+
DashboardLoginRedirectFilter = _ts_decorate6([
|
|
2091
|
+
Catch2(DashboardLoginRedirectException)
|
|
1983
2092
|
], DashboardLoginRedirectFilter);
|
|
1984
2093
|
|
|
1985
2094
|
// src/server/auth/session-required.exception.ts
|
|
1986
|
-
import { Catch as
|
|
1987
|
-
function
|
|
2095
|
+
import { Catch as Catch3, HttpException as HttpException3, HttpStatus as HttpStatus2, Inject as Inject2, Logger, Optional as Optional2 } from "@nestjs/common";
|
|
2096
|
+
function _ts_decorate7(decorators, target, key, desc) {
|
|
1988
2097
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1989
2098
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
1990
2099
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1997,7 +2106,7 @@ function _ts_decorate6(decorators, target, key, desc) {
|
|
|
1997
2106
|
}
|
|
1998
2107
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1999
2108
|
}
|
|
2000
|
-
__name(
|
|
2109
|
+
__name(_ts_decorate7, "_ts_decorate");
|
|
2001
2110
|
function _ts_metadata5(metadataKey, metadataValue) {
|
|
2002
2111
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2003
2112
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
@@ -2010,7 +2119,7 @@ function _ts_param3(paramIndex, decorator) {
|
|
|
2010
2119
|
};
|
|
2011
2120
|
}
|
|
2012
2121
|
__name(_ts_param3, "_ts_param");
|
|
2013
|
-
var DashboardSessionRequiredException = class extends
|
|
2122
|
+
var DashboardSessionRequiredException = class extends HttpException3 {
|
|
2014
2123
|
static {
|
|
2015
2124
|
__name(this, "DashboardSessionRequiredException");
|
|
2016
2125
|
}
|
|
@@ -2058,8 +2167,8 @@ var DashboardSessionRequiredFilter = class _DashboardSessionRequiredFilter {
|
|
|
2058
2167
|
this.logger.warn(message);
|
|
2059
2168
|
}
|
|
2060
2169
|
};
|
|
2061
|
-
DashboardSessionRequiredFilter =
|
|
2062
|
-
|
|
2170
|
+
DashboardSessionRequiredFilter = _ts_decorate7([
|
|
2171
|
+
Catch3(DashboardSessionRequiredException),
|
|
2063
2172
|
_ts_param3(0, Optional2()),
|
|
2064
2173
|
_ts_param3(0, Inject2(DASHBOARD_AUTH)),
|
|
2065
2174
|
_ts_metadata5("design:type", Function),
|
|
@@ -2069,7 +2178,7 @@ DashboardSessionRequiredFilter = _ts_decorate6([
|
|
|
2069
2178
|
], DashboardSessionRequiredFilter);
|
|
2070
2179
|
|
|
2071
2180
|
// src/server/durable-ui.controller.ts
|
|
2072
|
-
function
|
|
2181
|
+
function _ts_decorate8(decorators, target, key, desc) {
|
|
2073
2182
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2074
2183
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2075
2184
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2082,7 +2191,7 @@ function _ts_decorate7(decorators, target, key, desc) {
|
|
|
2082
2191
|
}
|
|
2083
2192
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2084
2193
|
}
|
|
2085
|
-
__name(
|
|
2194
|
+
__name(_ts_decorate8, "_ts_decorate");
|
|
2086
2195
|
function _ts_metadata6(metadataKey, metadataValue) {
|
|
2087
2196
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2088
2197
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
@@ -2147,7 +2256,7 @@ var DurableUiController = class {
|
|
|
2147
2256
|
});
|
|
2148
2257
|
}
|
|
2149
2258
|
};
|
|
2150
|
-
|
|
2259
|
+
_ts_decorate8([
|
|
2151
2260
|
Get2(),
|
|
2152
2261
|
Header2("Content-Type", "text/html; charset=utf-8"),
|
|
2153
2262
|
Header2("Cache-Control", "no-store, must-revalidate"),
|
|
@@ -2155,7 +2264,7 @@ _ts_decorate7([
|
|
|
2155
2264
|
_ts_metadata6("design:paramtypes", []),
|
|
2156
2265
|
_ts_metadata6("design:returntype", String)
|
|
2157
2266
|
], DurableUiController.prototype, "index", null);
|
|
2158
|
-
|
|
2267
|
+
_ts_decorate8([
|
|
2159
2268
|
Get2("assets/:file"),
|
|
2160
2269
|
Header2("Cache-Control", "public, max-age=31536000, immutable"),
|
|
2161
2270
|
_ts_param4(0, Param2("file")),
|
|
@@ -2165,8 +2274,8 @@ _ts_decorate7([
|
|
|
2165
2274
|
]),
|
|
2166
2275
|
_ts_metadata6("design:returntype", typeof StreamableFile === "undefined" ? Object : StreamableFile)
|
|
2167
2276
|
], DurableUiController.prototype, "asset", null);
|
|
2168
|
-
DurableUiController =
|
|
2169
|
-
|
|
2277
|
+
DurableUiController = _ts_decorate8([
|
|
2278
|
+
UseFilters2(DashboardLoginRedirectFilter, DashboardSessionRequiredFilter),
|
|
2170
2279
|
Controller2(),
|
|
2171
2280
|
_ts_param4(0, Inject3(DASHBOARD_BASE_PATH)),
|
|
2172
2281
|
_ts_param4(1, Inject3(DASHBOARD_API_PATH)),
|
|
@@ -2178,7 +2287,7 @@ DurableUiController = _ts_decorate7([
|
|
|
2178
2287
|
], DurableUiController);
|
|
2179
2288
|
|
|
2180
2289
|
// src/server/durable-auth.controller.ts
|
|
2181
|
-
function
|
|
2290
|
+
function _ts_decorate9(decorators, target, key, desc) {
|
|
2182
2291
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2183
2292
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2184
2293
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2191,7 +2300,7 @@ function _ts_decorate8(decorators, target, key, desc) {
|
|
|
2191
2300
|
}
|
|
2192
2301
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2193
2302
|
}
|
|
2194
|
-
__name(
|
|
2303
|
+
__name(_ts_decorate9, "_ts_decorate");
|
|
2195
2304
|
function _ts_metadata7(metadataKey, metadataValue) {
|
|
2196
2305
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2197
2306
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
@@ -2299,7 +2408,7 @@ var DurableAuthController = class _DurableAuthController {
|
|
|
2299
2408
|
}
|
|
2300
2409
|
}
|
|
2301
2410
|
};
|
|
2302
|
-
|
|
2411
|
+
_ts_decorate9([
|
|
2303
2412
|
Get3("login"),
|
|
2304
2413
|
Header3("Content-Type", "text/html; charset=utf-8"),
|
|
2305
2414
|
Header3("Cache-Control", "no-store, must-revalidate"),
|
|
@@ -2307,12 +2416,12 @@ _ts_decorate8([
|
|
|
2307
2416
|
_ts_metadata7("design:paramtypes", []),
|
|
2308
2417
|
_ts_metadata7("design:returntype", String)
|
|
2309
2418
|
], DurableAuthController.prototype, "loginPage", null);
|
|
2310
|
-
|
|
2419
|
+
_ts_decorate9([
|
|
2311
2420
|
Post2("login"),
|
|
2312
2421
|
HttpCode(200),
|
|
2313
2422
|
_ts_param5(0, Body2()),
|
|
2314
2423
|
_ts_param5(1, Req()),
|
|
2315
|
-
_ts_param5(2,
|
|
2424
|
+
_ts_param5(2, Res2({
|
|
2316
2425
|
passthrough: true
|
|
2317
2426
|
})),
|
|
2318
2427
|
_ts_metadata7("design:type", Function),
|
|
@@ -2323,11 +2432,11 @@ _ts_decorate8([
|
|
|
2323
2432
|
]),
|
|
2324
2433
|
_ts_metadata7("design:returntype", Promise)
|
|
2325
2434
|
], DurableAuthController.prototype, "login", null);
|
|
2326
|
-
|
|
2435
|
+
_ts_decorate9([
|
|
2327
2436
|
Post2("session"),
|
|
2328
2437
|
HttpCode(204),
|
|
2329
2438
|
_ts_param5(0, Req()),
|
|
2330
|
-
_ts_param5(1,
|
|
2439
|
+
_ts_param5(1, Res2({
|
|
2331
2440
|
passthrough: true
|
|
2332
2441
|
})),
|
|
2333
2442
|
_ts_metadata7("design:type", Function),
|
|
@@ -2337,10 +2446,10 @@ _ts_decorate8([
|
|
|
2337
2446
|
]),
|
|
2338
2447
|
_ts_metadata7("design:returntype", Promise)
|
|
2339
2448
|
], DurableAuthController.prototype, "session", null);
|
|
2340
|
-
|
|
2449
|
+
_ts_decorate9([
|
|
2341
2450
|
Get3("logout"),
|
|
2342
2451
|
_ts_param5(0, Req()),
|
|
2343
|
-
_ts_param5(1,
|
|
2452
|
+
_ts_param5(1, Res2()),
|
|
2344
2453
|
_ts_metadata7("design:type", Function),
|
|
2345
2454
|
_ts_metadata7("design:paramtypes", [
|
|
2346
2455
|
Object,
|
|
@@ -2348,7 +2457,7 @@ _ts_decorate8([
|
|
|
2348
2457
|
]),
|
|
2349
2458
|
_ts_metadata7("design:returntype", void 0)
|
|
2350
2459
|
], DurableAuthController.prototype, "logout", null);
|
|
2351
|
-
DurableAuthController =
|
|
2460
|
+
DurableAuthController = _ts_decorate9([
|
|
2352
2461
|
Controller3(),
|
|
2353
2462
|
_ts_param5(0, Optional3()),
|
|
2354
2463
|
_ts_param5(0, Inject4(DASHBOARD_AUTH)),
|
|
@@ -2368,7 +2477,7 @@ import { ModuleRef, RouterModule } from "@nestjs/core";
|
|
|
2368
2477
|
|
|
2369
2478
|
// src/server/durable-session.guard.ts
|
|
2370
2479
|
import { Inject as Inject5, Injectable as Injectable4, UnauthorizedException as UnauthorizedException2 } from "@nestjs/common";
|
|
2371
|
-
function
|
|
2480
|
+
function _ts_decorate10(decorators, target, key, desc) {
|
|
2372
2481
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2373
2482
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2374
2483
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2381,7 +2490,7 @@ function _ts_decorate9(decorators, target, key, desc) {
|
|
|
2381
2490
|
}
|
|
2382
2491
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2383
2492
|
}
|
|
2384
|
-
__name(
|
|
2493
|
+
__name(_ts_decorate10, "_ts_decorate");
|
|
2385
2494
|
function _ts_metadata8(metadataKey, metadataValue) {
|
|
2386
2495
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2387
2496
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
@@ -2434,7 +2543,7 @@ var DurableUiSessionGuard = class {
|
|
|
2434
2543
|
throw new DashboardLoginRedirectException(`${this.basePath}/login?returnTo=${returnTo}`);
|
|
2435
2544
|
}
|
|
2436
2545
|
};
|
|
2437
|
-
DurableUiSessionGuard =
|
|
2546
|
+
DurableUiSessionGuard = _ts_decorate10([
|
|
2438
2547
|
Injectable4(),
|
|
2439
2548
|
_ts_param6(0, Inject5(DASHBOARD_AUTH)),
|
|
2440
2549
|
_ts_param6(1, Inject5(DASHBOARD_BASE_PATH)),
|
|
@@ -2478,7 +2587,7 @@ var DurableApiSessionGuard = class {
|
|
|
2478
2587
|
});
|
|
2479
2588
|
}
|
|
2480
2589
|
};
|
|
2481
|
-
DurableApiSessionGuard =
|
|
2590
|
+
DurableApiSessionGuard = _ts_decorate10([
|
|
2482
2591
|
Injectable4(),
|
|
2483
2592
|
_ts_param6(0, Inject5(DASHBOARD_AUTH)),
|
|
2484
2593
|
_ts_metadata8("design:type", Function),
|
|
@@ -2488,7 +2597,7 @@ DurableApiSessionGuard = _ts_decorate9([
|
|
|
2488
2597
|
], DurableApiSessionGuard);
|
|
2489
2598
|
|
|
2490
2599
|
// src/server/durable-dashboard.module.ts
|
|
2491
|
-
function
|
|
2600
|
+
function _ts_decorate11(decorators, target, key, desc) {
|
|
2492
2601
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2493
2602
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2494
2603
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2501,7 +2610,7 @@ function _ts_decorate10(decorators, target, key, desc) {
|
|
|
2501
2610
|
}
|
|
2502
2611
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2503
2612
|
}
|
|
2504
|
-
__name(
|
|
2613
|
+
__name(_ts_decorate11, "_ts_decorate");
|
|
2505
2614
|
var GUARDS_METADATA = "__guards__";
|
|
2506
2615
|
function normalize(path) {
|
|
2507
2616
|
return `/${path.replace(/^\/+|\/+$/g, "")}`;
|
|
@@ -2574,7 +2683,7 @@ var DurableApiModule = class _DurableApiModule {
|
|
|
2574
2683
|
};
|
|
2575
2684
|
}
|
|
2576
2685
|
};
|
|
2577
|
-
DurableApiModule =
|
|
2686
|
+
DurableApiModule = _ts_decorate11([
|
|
2578
2687
|
Module({})
|
|
2579
2688
|
], DurableApiModule);
|
|
2580
2689
|
var DurableDashboardModule = class _DurableDashboardModule {
|
|
@@ -2660,7 +2769,7 @@ var DurableDashboardModule = class _DurableDashboardModule {
|
|
|
2660
2769
|
};
|
|
2661
2770
|
}
|
|
2662
2771
|
};
|
|
2663
|
-
DurableDashboardModule =
|
|
2772
|
+
DurableDashboardModule = _ts_decorate11([
|
|
2664
2773
|
Module({})
|
|
2665
2774
|
], DurableDashboardModule);
|
|
2666
2775
|
export {
|