@dudousxd/nestjs-durable-dashboard 0.49.0 → 0.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/durable-client.d.ts +23 -1
- 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/client/fan-pages.d.ts +8 -0
- package/dist/client/fan-pages.d.ts.map +1 -0
- package/dist/client/fan-pages.js +16 -0
- package/dist/client/fan-pages.js.map +1 -0
- package/dist/client/group-parallel-spans.d.ts +39 -4
- package/dist/client/group-parallel-spans.d.ts.map +1 -1
- package/dist/client/group-parallel-spans.js +65 -1
- package/dist/client/group-parallel-spans.js.map +1 -1
- package/dist/client/merge-live-events.d.ts +6 -1
- package/dist/client/merge-live-events.d.ts.map +1 -1
- package/dist/client/merge-live-events.js +15 -0
- package/dist/client/merge-live-events.js.map +1 -1
- package/dist/client/throttle.d.ts +11 -0
- package/dist/client/throttle.d.ts.map +1 -0
- package/dist/client/throttle.js +30 -0
- package/dist/client/throttle.js.map +1 -0
- package/dist/server/index.cjs +408 -278
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +24 -3
- package/dist/server/index.d.ts +24 -3
- package/dist/server/index.js +286 -156
- package/dist/server/index.js.map +1 -1
- package/dist/spa/assets/{bench-DH4bTOwJ.js → bench-UvOjwMnz.js} +1 -1
- package/dist/spa/assets/index-BbR4CZ1K.css +1 -0
- package/dist/spa/assets/index-DnQL-Xbv.js +66 -0
- package/dist/spa/assets/{index-DCWWFODc.js → index-ov2ocqi5.js} +1 -1
- package/dist/spa/assets/{preview-DeC52LPJ.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/spa/assets/index-LBQc7d3p.css +0 -1
- package/dist/spa/assets/index-xUQjm-z_.js +0 -66
package/dist/server/index.js
CHANGED
|
@@ -155,8 +155,12 @@ var DashboardService = class {
|
|
|
155
155
|
async workerHealth() {
|
|
156
156
|
return this.gateway.workerHealth();
|
|
157
157
|
}
|
|
158
|
-
getRunDetail(runId) {
|
|
159
|
-
return this.gateway.getRunDetail(runId);
|
|
158
|
+
getRunDetail(runId, options) {
|
|
159
|
+
return this.gateway.getRunDetail(runId, options);
|
|
160
|
+
}
|
|
161
|
+
/** A page of one fan's members, or null when the run is unknown or the gateway can't page fans. */
|
|
162
|
+
async getFanMembers(runId, group, query) {
|
|
163
|
+
return await this.gateway.getFanMembers?.(runId, group, query) ?? null;
|
|
160
164
|
}
|
|
161
165
|
/** Fix-and-replay a dead/failed run with a corrected input — a fresh linked run. Returns its id. */
|
|
162
166
|
retryWithInput(runId, input) {
|
|
@@ -251,7 +255,7 @@ DashboardService = _ts_decorate([
|
|
|
251
255
|
|
|
252
256
|
// src/server/durable-api.controller.ts
|
|
253
257
|
import { ApplyFilter, ApplyFilterInterceptor, FilterRunner } from "@dudousxd/nestjs-filter";
|
|
254
|
-
import { Body, Controller, Get, Header, NotFoundException, Param, Post, Query, Sse, UseInterceptors } from "@nestjs/common";
|
|
258
|
+
import { Body, Controller, Get, Header, Headers, NotFoundException, Param, Post, Query, Res, Sse, UseFilters, UseInterceptors } from "@nestjs/common";
|
|
255
259
|
|
|
256
260
|
// src/server/durable-run.ts
|
|
257
261
|
var DurableRun = class {
|
|
@@ -326,6 +330,129 @@ function runValueAxisFor(field) {
|
|
|
326
330
|
}
|
|
327
331
|
__name(runValueAxisFor, "runValueAxisFor");
|
|
328
332
|
|
|
333
|
+
// src/server/not-modified.ts
|
|
334
|
+
import { Catch, HttpException } from "@nestjs/common";
|
|
335
|
+
|
|
336
|
+
// src/server/auth/response.ts
|
|
337
|
+
function isRecord(value) {
|
|
338
|
+
return typeof value === "object" && value !== null;
|
|
339
|
+
}
|
|
340
|
+
__name(isRecord, "isRecord");
|
|
341
|
+
function isRawCookieResponse(value) {
|
|
342
|
+
return isRecord(value) && typeof value.getHeader === "function" && typeof value.setHeader === "function";
|
|
343
|
+
}
|
|
344
|
+
__name(isRawCookieResponse, "isRawCookieResponse");
|
|
345
|
+
function resolveCookieResponse(response) {
|
|
346
|
+
if (isRawCookieResponse(response)) return response;
|
|
347
|
+
if (isRecord(response) && isRawCookieResponse(response.raw)) return response.raw;
|
|
348
|
+
return null;
|
|
349
|
+
}
|
|
350
|
+
__name(resolveCookieResponse, "resolveCookieResponse");
|
|
351
|
+
function existingSetCookies(response) {
|
|
352
|
+
const current = response.getHeader("set-cookie");
|
|
353
|
+
if (Array.isArray(current)) return current;
|
|
354
|
+
if (typeof current === "string") return [
|
|
355
|
+
current
|
|
356
|
+
];
|
|
357
|
+
return [];
|
|
358
|
+
}
|
|
359
|
+
__name(existingSetCookies, "existingSetCookies");
|
|
360
|
+
function appendSetCookie(response, cookie) {
|
|
361
|
+
const raw = resolveCookieResponse(response);
|
|
362
|
+
if (!raw) return;
|
|
363
|
+
raw.setHeader("set-cookie", [
|
|
364
|
+
...existingSetCookies(raw),
|
|
365
|
+
cookie
|
|
366
|
+
]);
|
|
367
|
+
}
|
|
368
|
+
__name(appendSetCookie, "appendSetCookie");
|
|
369
|
+
function isRawRedirectResponse(value) {
|
|
370
|
+
return isRecord(value) && typeof value.getHeader === "function" && typeof value.setHeader === "function" && typeof value.end === "function";
|
|
371
|
+
}
|
|
372
|
+
__name(isRawRedirectResponse, "isRawRedirectResponse");
|
|
373
|
+
function resolveRedirectResponse(response) {
|
|
374
|
+
if (isRawRedirectResponse(response)) return response;
|
|
375
|
+
if (isRecord(response) && isRawRedirectResponse(response.raw)) return response.raw;
|
|
376
|
+
return null;
|
|
377
|
+
}
|
|
378
|
+
__name(resolveRedirectResponse, "resolveRedirectResponse");
|
|
379
|
+
function redirectRaw(response, location, status = 302) {
|
|
380
|
+
const raw = resolveRedirectResponse(response);
|
|
381
|
+
if (!raw) return;
|
|
382
|
+
raw.statusCode = status;
|
|
383
|
+
raw.setHeader("location", location);
|
|
384
|
+
raw.end();
|
|
385
|
+
}
|
|
386
|
+
__name(redirectRaw, "redirectRaw");
|
|
387
|
+
function responseAlreadyWritten(response) {
|
|
388
|
+
const raw = resolveRedirectResponse(response);
|
|
389
|
+
return raw?.headersSent === true;
|
|
390
|
+
}
|
|
391
|
+
__name(responseAlreadyWritten, "responseAlreadyWritten");
|
|
392
|
+
function writeHtmlRaw(response, html, status = 200) {
|
|
393
|
+
const raw = resolveRedirectResponse(response);
|
|
394
|
+
if (!raw) return;
|
|
395
|
+
raw.statusCode = status;
|
|
396
|
+
raw.setHeader("content-type", "text/html; charset=utf-8");
|
|
397
|
+
raw.setHeader("cache-control", "no-store, must-revalidate");
|
|
398
|
+
raw.end(html);
|
|
399
|
+
}
|
|
400
|
+
__name(writeHtmlRaw, "writeHtmlRaw");
|
|
401
|
+
function setRawHeader(response, name, value) {
|
|
402
|
+
resolveCookieResponse(response)?.setHeader(name, value);
|
|
403
|
+
}
|
|
404
|
+
__name(setRawHeader, "setRawHeader");
|
|
405
|
+
function writeNotModifiedRaw(response, etag) {
|
|
406
|
+
const raw = resolveRedirectResponse(response);
|
|
407
|
+
if (!raw) return;
|
|
408
|
+
raw.statusCode = 304;
|
|
409
|
+
raw.setHeader("etag", etag);
|
|
410
|
+
raw.setHeader("cache-control", "private, no-cache");
|
|
411
|
+
raw.end();
|
|
412
|
+
}
|
|
413
|
+
__name(writeNotModifiedRaw, "writeNotModifiedRaw");
|
|
414
|
+
|
|
415
|
+
// src/server/not-modified.ts
|
|
416
|
+
function _ts_decorate2(decorators, target, key, desc) {
|
|
417
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
418
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
419
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
420
|
+
} else {
|
|
421
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
422
|
+
if (d = decorators[i]) {
|
|
423
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
428
|
+
}
|
|
429
|
+
__name(_ts_decorate2, "_ts_decorate");
|
|
430
|
+
var NotModifiedException = class extends HttpException {
|
|
431
|
+
static {
|
|
432
|
+
__name(this, "NotModifiedException");
|
|
433
|
+
}
|
|
434
|
+
etag;
|
|
435
|
+
constructor(etag) {
|
|
436
|
+
super("Not Modified", 304), this.etag = etag;
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
var NotModifiedFilter = class {
|
|
440
|
+
static {
|
|
441
|
+
__name(this, "NotModifiedFilter");
|
|
442
|
+
}
|
|
443
|
+
catch(exception, host) {
|
|
444
|
+
writeNotModifiedRaw(host.switchToHttp().getResponse(), exception.etag);
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
NotModifiedFilter = _ts_decorate2([
|
|
448
|
+
Catch(NotModifiedException)
|
|
449
|
+
], NotModifiedFilter);
|
|
450
|
+
function setEtag(response, etag) {
|
|
451
|
+
setRawHeader(response, "etag", etag);
|
|
452
|
+
setRawHeader(response, "cache-control", "private, no-cache");
|
|
453
|
+
}
|
|
454
|
+
__name(setEtag, "setEtag");
|
|
455
|
+
|
|
329
456
|
// src/server/run-list-row.ts
|
|
330
457
|
function toRunListRow(run) {
|
|
331
458
|
const { input: _input, output: _output, error: _error, ...row } = run;
|
|
@@ -416,7 +543,7 @@ var RunQueryDraft2 = class {
|
|
|
416
543
|
};
|
|
417
544
|
|
|
418
545
|
// src/server/run-query.adapter.ts
|
|
419
|
-
function
|
|
546
|
+
function _ts_decorate3(decorators, target, key, desc) {
|
|
420
547
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
421
548
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
422
549
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -429,7 +556,7 @@ function _ts_decorate2(decorators, target, key, desc) {
|
|
|
429
556
|
}
|
|
430
557
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
431
558
|
}
|
|
432
|
-
__name(
|
|
559
|
+
__name(_ts_decorate3, "_ts_decorate");
|
|
433
560
|
function _ts_metadata2(metadataKey, metadataValue) {
|
|
434
561
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
435
562
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
@@ -709,7 +836,7 @@ var RunQueryAdapter = class {
|
|
|
709
836
|
}
|
|
710
837
|
}
|
|
711
838
|
};
|
|
712
|
-
RunQueryAdapter =
|
|
839
|
+
RunQueryAdapter = _ts_decorate3([
|
|
713
840
|
Injectable2(),
|
|
714
841
|
_ts_metadata2("design:type", Function),
|
|
715
842
|
_ts_metadata2("design:paramtypes", [
|
|
@@ -718,7 +845,7 @@ RunQueryAdapter = _ts_decorate2([
|
|
|
718
845
|
], RunQueryAdapter);
|
|
719
846
|
|
|
720
847
|
// src/server/run.filter.ts
|
|
721
|
-
function
|
|
848
|
+
function _ts_decorate4(decorators, target, key, desc) {
|
|
722
849
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
723
850
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
724
851
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -731,7 +858,7 @@ function _ts_decorate3(decorators, target, key, desc) {
|
|
|
731
858
|
}
|
|
732
859
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
733
860
|
}
|
|
734
|
-
__name(
|
|
861
|
+
__name(_ts_decorate4, "_ts_decorate");
|
|
735
862
|
function _ts_metadata3(metadataKey, metadataValue) {
|
|
736
863
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
737
864
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
@@ -857,7 +984,7 @@ var RunFilter = class extends BaseFilter {
|
|
|
857
984
|
});
|
|
858
985
|
}
|
|
859
986
|
};
|
|
860
|
-
|
|
987
|
+
_ts_decorate4([
|
|
861
988
|
FilterFor("status"),
|
|
862
989
|
_ts_metadata3("design:type", Function),
|
|
863
990
|
_ts_metadata3("design:paramtypes", [
|
|
@@ -865,7 +992,7 @@ _ts_decorate3([
|
|
|
865
992
|
]),
|
|
866
993
|
_ts_metadata3("design:returntype", void 0)
|
|
867
994
|
], RunFilter.prototype, "applyStatus", null);
|
|
868
|
-
|
|
995
|
+
_ts_decorate4([
|
|
869
996
|
FilterFor("workflow"),
|
|
870
997
|
_ts_metadata3("design:type", Function),
|
|
871
998
|
_ts_metadata3("design:paramtypes", [
|
|
@@ -873,7 +1000,7 @@ _ts_decorate3([
|
|
|
873
1000
|
]),
|
|
874
1001
|
_ts_metadata3("design:returntype", void 0)
|
|
875
1002
|
], RunFilter.prototype, "applyWorkflow", null);
|
|
876
|
-
|
|
1003
|
+
_ts_decorate4([
|
|
877
1004
|
FilterFor("namespace"),
|
|
878
1005
|
_ts_metadata3("design:type", Function),
|
|
879
1006
|
_ts_metadata3("design:paramtypes", [
|
|
@@ -881,7 +1008,7 @@ _ts_decorate3([
|
|
|
881
1008
|
]),
|
|
882
1009
|
_ts_metadata3("design:returntype", void 0)
|
|
883
1010
|
], RunFilter.prototype, "applyNamespace", null);
|
|
884
|
-
|
|
1011
|
+
_ts_decorate4([
|
|
885
1012
|
FilterFor("tag"),
|
|
886
1013
|
_ts_metadata3("design:type", Function),
|
|
887
1014
|
_ts_metadata3("design:paramtypes", [
|
|
@@ -889,19 +1016,19 @@ _ts_decorate3([
|
|
|
889
1016
|
]),
|
|
890
1017
|
_ts_metadata3("design:returntype", void 0)
|
|
891
1018
|
], RunFilter.prototype, "applyTag", null);
|
|
892
|
-
|
|
1019
|
+
_ts_decorate4([
|
|
893
1020
|
FilterFor("origin"),
|
|
894
1021
|
_ts_metadata3("design:type", Function),
|
|
895
1022
|
_ts_metadata3("design:paramtypes", []),
|
|
896
1023
|
_ts_metadata3("design:returntype", void 0)
|
|
897
1024
|
], RunFilter.prototype, "applyOrigin", null);
|
|
898
|
-
|
|
1025
|
+
_ts_decorate4([
|
|
899
1026
|
FilterFor("unattributed"),
|
|
900
1027
|
_ts_metadata3("design:type", Function),
|
|
901
1028
|
_ts_metadata3("design:paramtypes", []),
|
|
902
1029
|
_ts_metadata3("design:returntype", void 0)
|
|
903
1030
|
], RunFilter.prototype, "applyUnattributed", null);
|
|
904
|
-
|
|
1031
|
+
_ts_decorate4([
|
|
905
1032
|
FilterFor("attr"),
|
|
906
1033
|
_ts_metadata3("design:type", Function),
|
|
907
1034
|
_ts_metadata3("design:paramtypes", [
|
|
@@ -909,7 +1036,7 @@ _ts_decorate3([
|
|
|
909
1036
|
]),
|
|
910
1037
|
_ts_metadata3("design:returntype", void 0)
|
|
911
1038
|
], RunFilter.prototype, "applyAttributes", null);
|
|
912
|
-
|
|
1039
|
+
_ts_decorate4([
|
|
913
1040
|
FilterFor("limit"),
|
|
914
1041
|
_ts_metadata3("design:type", Function),
|
|
915
1042
|
_ts_metadata3("design:paramtypes", [
|
|
@@ -917,7 +1044,7 @@ _ts_decorate3([
|
|
|
917
1044
|
]),
|
|
918
1045
|
_ts_metadata3("design:returntype", void 0)
|
|
919
1046
|
], RunFilter.prototype, "applyLimit", null);
|
|
920
|
-
|
|
1047
|
+
_ts_decorate4([
|
|
921
1048
|
FilterFor("offset"),
|
|
922
1049
|
_ts_metadata3("design:type", Function),
|
|
923
1050
|
_ts_metadata3("design:paramtypes", [
|
|
@@ -925,7 +1052,7 @@ _ts_decorate3([
|
|
|
925
1052
|
]),
|
|
926
1053
|
_ts_metadata3("design:returntype", void 0)
|
|
927
1054
|
], RunFilter.prototype, "applyOffset", null);
|
|
928
|
-
RunFilter =
|
|
1055
|
+
RunFilter = _ts_decorate4([
|
|
929
1056
|
Injectable3(),
|
|
930
1057
|
Filterable({
|
|
931
1058
|
entity: DurableRun,
|
|
@@ -935,7 +1062,7 @@ RunFilter = _ts_decorate3([
|
|
|
935
1062
|
], RunFilter);
|
|
936
1063
|
|
|
937
1064
|
// src/server/durable-api.controller.ts
|
|
938
|
-
function
|
|
1065
|
+
function _ts_decorate5(decorators, target, key, desc) {
|
|
939
1066
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
940
1067
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
941
1068
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -948,7 +1075,7 @@ function _ts_decorate4(decorators, target, key, desc) {
|
|
|
948
1075
|
}
|
|
949
1076
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
950
1077
|
}
|
|
951
|
-
__name(
|
|
1078
|
+
__name(_ts_decorate5, "_ts_decorate");
|
|
952
1079
|
function _ts_metadata4(metadataKey, metadataValue) {
|
|
953
1080
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
954
1081
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
@@ -961,6 +1088,7 @@ function _ts_param2(paramIndex, decorator) {
|
|
|
961
1088
|
};
|
|
962
1089
|
}
|
|
963
1090
|
__name(_ts_param2, "_ts_param");
|
|
1091
|
+
var FAN_INLINE_MAX = 50;
|
|
964
1092
|
var DurableApiController = class {
|
|
965
1093
|
static {
|
|
966
1094
|
__name(this, "DurableApiController");
|
|
@@ -1059,10 +1187,46 @@ var DurableApiController = class {
|
|
|
1059
1187
|
topology() {
|
|
1060
1188
|
return this.dashboard.topology();
|
|
1061
1189
|
}
|
|
1062
|
-
|
|
1063
|
-
|
|
1190
|
+
/**
|
|
1191
|
+
* A run's detail. Fans wider than {@link FAN_INLINE_MAX} come back as one `FanSummary` each, their
|
|
1192
|
+
* members paged by `runs/:id/fans/:group`; `?full=true` returns every checkpoint instead.
|
|
1193
|
+
*
|
|
1194
|
+
* When the gateway can version the detail without reading it, the response carries an `ETag`, and
|
|
1195
|
+
* a poll whose `If-None-Match` still names it gets a 304 before the timeline is read. The browser
|
|
1196
|
+
* sends that header itself (the response is `no-cache`), so a console poll needs no code for it.
|
|
1197
|
+
*/
|
|
1198
|
+
async run(id, full, ifNoneMatch, response) {
|
|
1199
|
+
const detail = await this.dashboard.getRunDetail(id, full === "true" ? void 0 : {
|
|
1200
|
+
summarizeFansOver: FAN_INLINE_MAX,
|
|
1201
|
+
...ifNoneMatch && {
|
|
1202
|
+
ifNoneMatch
|
|
1203
|
+
}
|
|
1204
|
+
});
|
|
1064
1205
|
if (!detail) throw new NotFoundException(`run ${id} not found`);
|
|
1065
|
-
|
|
1206
|
+
const { etag, notModified, ...body } = detail;
|
|
1207
|
+
if (etag) {
|
|
1208
|
+
if (notModified) throw new NotModifiedException(etag);
|
|
1209
|
+
setEtag(response, etag);
|
|
1210
|
+
}
|
|
1211
|
+
return body;
|
|
1212
|
+
}
|
|
1213
|
+
/** One page of a summarized fan's members, in seq order. Versioned like {@link run}. */
|
|
1214
|
+
async fanMembers(id, group, offset, limit, failed, ifNoneMatch, response) {
|
|
1215
|
+
const page2 = await this.dashboard.getFanMembers(id, group, {
|
|
1216
|
+
offset: offset === void 0 ? void 0 : Number(offset),
|
|
1217
|
+
limit: limit === void 0 ? void 0 : Number(limit),
|
|
1218
|
+
failedOnly: failed === "true",
|
|
1219
|
+
...ifNoneMatch && {
|
|
1220
|
+
ifNoneMatch
|
|
1221
|
+
}
|
|
1222
|
+
});
|
|
1223
|
+
if (!page2) throw new NotFoundException(`fan ${group} of run ${id} not found`);
|
|
1224
|
+
const { etag, notModified, ...body } = page2;
|
|
1225
|
+
if (etag) {
|
|
1226
|
+
if (notModified) throw new NotModifiedException(etag);
|
|
1227
|
+
setEtag(response, etag);
|
|
1228
|
+
}
|
|
1229
|
+
return body;
|
|
1066
1230
|
}
|
|
1067
1231
|
/** Server-Sent Events stream of a run's live lifecycle events — the dashboard tails it instead
|
|
1068
1232
|
* of polling. Cross-pod when the transport has a control plane (see DashboardService.streamRun). */
|
|
@@ -1125,7 +1289,7 @@ var DurableApiController = class {
|
|
|
1125
1289
|
return this.dashboard.update(id, name, body);
|
|
1126
1290
|
}
|
|
1127
1291
|
};
|
|
1128
|
-
|
|
1292
|
+
_ts_decorate5([
|
|
1129
1293
|
Get("runs"),
|
|
1130
1294
|
_ts_param2(0, ApplyFilter(RunFilter)),
|
|
1131
1295
|
_ts_metadata4("design:type", Function),
|
|
@@ -1134,7 +1298,7 @@ _ts_decorate4([
|
|
|
1134
1298
|
]),
|
|
1135
1299
|
_ts_metadata4("design:returntype", Promise)
|
|
1136
1300
|
], DurableApiController.prototype, "runs", null);
|
|
1137
|
-
|
|
1301
|
+
_ts_decorate5([
|
|
1138
1302
|
Get("runs/facets"),
|
|
1139
1303
|
_ts_param2(0, ApplyFilter(RunFilter)),
|
|
1140
1304
|
_ts_metadata4("design:type", Function),
|
|
@@ -1143,7 +1307,7 @@ _ts_decorate4([
|
|
|
1143
1307
|
]),
|
|
1144
1308
|
_ts_metadata4("design:returntype", void 0)
|
|
1145
1309
|
], DurableApiController.prototype, "facets", null);
|
|
1146
|
-
|
|
1310
|
+
_ts_decorate5([
|
|
1147
1311
|
Get("runs/values"),
|
|
1148
1312
|
_ts_param2(0, Query()),
|
|
1149
1313
|
_ts_metadata4("design:type", Function),
|
|
@@ -1152,20 +1316,20 @@ _ts_decorate4([
|
|
|
1152
1316
|
]),
|
|
1153
1317
|
_ts_metadata4("design:returntype", void 0)
|
|
1154
1318
|
], DurableApiController.prototype, "values", null);
|
|
1155
|
-
|
|
1319
|
+
_ts_decorate5([
|
|
1156
1320
|
Get("metrics"),
|
|
1157
1321
|
Header("Content-Type", "text/plain; version=0.0.4"),
|
|
1158
1322
|
_ts_metadata4("design:type", Function),
|
|
1159
1323
|
_ts_metadata4("design:paramtypes", []),
|
|
1160
1324
|
_ts_metadata4("design:returntype", void 0)
|
|
1161
1325
|
], DurableApiController.prototype, "metrics", null);
|
|
1162
|
-
|
|
1326
|
+
_ts_decorate5([
|
|
1163
1327
|
Get("workers"),
|
|
1164
1328
|
_ts_metadata4("design:type", Function),
|
|
1165
1329
|
_ts_metadata4("design:paramtypes", []),
|
|
1166
1330
|
_ts_metadata4("design:returntype", void 0)
|
|
1167
1331
|
], DurableApiController.prototype, "workers", null);
|
|
1168
|
-
|
|
1332
|
+
_ts_decorate5([
|
|
1169
1333
|
Get("schedules"),
|
|
1170
1334
|
_ts_param2(0, Query("namespace")),
|
|
1171
1335
|
_ts_param2(1, Query("workflow")),
|
|
@@ -1182,7 +1346,7 @@ _ts_decorate4([
|
|
|
1182
1346
|
]),
|
|
1183
1347
|
_ts_metadata4("design:returntype", void 0)
|
|
1184
1348
|
], DurableApiController.prototype, "schedules", null);
|
|
1185
|
-
|
|
1349
|
+
_ts_decorate5([
|
|
1186
1350
|
Post("schedules/:id/pause"),
|
|
1187
1351
|
_ts_param2(0, Param("id")),
|
|
1188
1352
|
_ts_metadata4("design:type", Function),
|
|
@@ -1191,7 +1355,7 @@ _ts_decorate4([
|
|
|
1191
1355
|
]),
|
|
1192
1356
|
_ts_metadata4("design:returntype", void 0)
|
|
1193
1357
|
], DurableApiController.prototype, "pauseSchedule", null);
|
|
1194
|
-
|
|
1358
|
+
_ts_decorate5([
|
|
1195
1359
|
Post("schedules/:id/resume"),
|
|
1196
1360
|
_ts_param2(0, Param("id")),
|
|
1197
1361
|
_ts_metadata4("design:type", Function),
|
|
@@ -1200,7 +1364,7 @@ _ts_decorate4([
|
|
|
1200
1364
|
]),
|
|
1201
1365
|
_ts_metadata4("design:returntype", void 0)
|
|
1202
1366
|
], DurableApiController.prototype, "resumeSchedule", null);
|
|
1203
|
-
|
|
1367
|
+
_ts_decorate5([
|
|
1204
1368
|
Post("schedules/:id/trigger"),
|
|
1205
1369
|
_ts_param2(0, Param("id")),
|
|
1206
1370
|
_ts_metadata4("design:type", Function),
|
|
@@ -1209,22 +1373,53 @@ _ts_decorate4([
|
|
|
1209
1373
|
]),
|
|
1210
1374
|
_ts_metadata4("design:returntype", void 0)
|
|
1211
1375
|
], DurableApiController.prototype, "triggerSchedule", null);
|
|
1212
|
-
|
|
1376
|
+
_ts_decorate5([
|
|
1213
1377
|
Get("topology"),
|
|
1214
1378
|
_ts_metadata4("design:type", Function),
|
|
1215
1379
|
_ts_metadata4("design:paramtypes", []),
|
|
1216
1380
|
_ts_metadata4("design:returntype", void 0)
|
|
1217
1381
|
], DurableApiController.prototype, "topology", null);
|
|
1218
|
-
|
|
1382
|
+
_ts_decorate5([
|
|
1219
1383
|
Get("runs/:id"),
|
|
1220
1384
|
_ts_param2(0, Param("id")),
|
|
1385
|
+
_ts_param2(1, Query("full")),
|
|
1386
|
+
_ts_param2(2, Headers("if-none-match")),
|
|
1387
|
+
_ts_param2(3, Res({
|
|
1388
|
+
passthrough: true
|
|
1389
|
+
})),
|
|
1221
1390
|
_ts_metadata4("design:type", Function),
|
|
1222
1391
|
_ts_metadata4("design:paramtypes", [
|
|
1223
|
-
String
|
|
1392
|
+
String,
|
|
1393
|
+
String,
|
|
1394
|
+
String,
|
|
1395
|
+
Object
|
|
1224
1396
|
]),
|
|
1225
1397
|
_ts_metadata4("design:returntype", Promise)
|
|
1226
1398
|
], DurableApiController.prototype, "run", null);
|
|
1227
|
-
|
|
1399
|
+
_ts_decorate5([
|
|
1400
|
+
Get("runs/:id/fans/:group"),
|
|
1401
|
+
_ts_param2(0, Param("id")),
|
|
1402
|
+
_ts_param2(1, Param("group")),
|
|
1403
|
+
_ts_param2(2, Query("offset")),
|
|
1404
|
+
_ts_param2(3, Query("limit")),
|
|
1405
|
+
_ts_param2(4, Query("failed")),
|
|
1406
|
+
_ts_param2(5, Headers("if-none-match")),
|
|
1407
|
+
_ts_param2(6, Res({
|
|
1408
|
+
passthrough: true
|
|
1409
|
+
})),
|
|
1410
|
+
_ts_metadata4("design:type", Function),
|
|
1411
|
+
_ts_metadata4("design:paramtypes", [
|
|
1412
|
+
String,
|
|
1413
|
+
String,
|
|
1414
|
+
String,
|
|
1415
|
+
String,
|
|
1416
|
+
String,
|
|
1417
|
+
String,
|
|
1418
|
+
Object
|
|
1419
|
+
]),
|
|
1420
|
+
_ts_metadata4("design:returntype", Promise)
|
|
1421
|
+
], DurableApiController.prototype, "fanMembers", null);
|
|
1422
|
+
_ts_decorate5([
|
|
1228
1423
|
Sse("runs/:id/stream"),
|
|
1229
1424
|
_ts_param2(0, Param("id")),
|
|
1230
1425
|
_ts_metadata4("design:type", Function),
|
|
@@ -1233,7 +1428,7 @@ _ts_decorate4([
|
|
|
1233
1428
|
]),
|
|
1234
1429
|
_ts_metadata4("design:returntype", void 0)
|
|
1235
1430
|
], DurableApiController.prototype, "stream", null);
|
|
1236
|
-
|
|
1431
|
+
_ts_decorate5([
|
|
1237
1432
|
Post("runs/:id/retry"),
|
|
1238
1433
|
_ts_param2(0, Param("id")),
|
|
1239
1434
|
_ts_metadata4("design:type", Function),
|
|
@@ -1242,7 +1437,7 @@ _ts_decorate4([
|
|
|
1242
1437
|
]),
|
|
1243
1438
|
_ts_metadata4("design:returntype", void 0)
|
|
1244
1439
|
], DurableApiController.prototype, "retry", null);
|
|
1245
|
-
|
|
1440
|
+
_ts_decorate5([
|
|
1246
1441
|
Post("runs/:id/retry-with-input"),
|
|
1247
1442
|
_ts_param2(0, Param("id")),
|
|
1248
1443
|
_ts_param2(1, Body()),
|
|
@@ -1253,7 +1448,7 @@ _ts_decorate4([
|
|
|
1253
1448
|
]),
|
|
1254
1449
|
_ts_metadata4("design:returntype", void 0)
|
|
1255
1450
|
], DurableApiController.prototype, "retryWithInput", null);
|
|
1256
|
-
|
|
1451
|
+
_ts_decorate5([
|
|
1257
1452
|
Post("bulk/:action"),
|
|
1258
1453
|
_ts_param2(0, Param("action")),
|
|
1259
1454
|
_ts_param2(1, ApplyFilter(RunFilter)),
|
|
@@ -1266,7 +1461,7 @@ _ts_decorate4([
|
|
|
1266
1461
|
]),
|
|
1267
1462
|
_ts_metadata4("design:returntype", void 0)
|
|
1268
1463
|
], DurableApiController.prototype, "bulk", null);
|
|
1269
|
-
|
|
1464
|
+
_ts_decorate5([
|
|
1270
1465
|
Post("runs/:id/cancel"),
|
|
1271
1466
|
_ts_param2(0, Param("id")),
|
|
1272
1467
|
_ts_param2(1, Query("compensate")),
|
|
@@ -1277,7 +1472,7 @@ _ts_decorate4([
|
|
|
1277
1472
|
]),
|
|
1278
1473
|
_ts_metadata4("design:returntype", Promise)
|
|
1279
1474
|
], DurableApiController.prototype, "cancel", null);
|
|
1280
|
-
|
|
1475
|
+
_ts_decorate5([
|
|
1281
1476
|
Post("runs/:id/continue"),
|
|
1282
1477
|
_ts_param2(0, Param("id")),
|
|
1283
1478
|
_ts_metadata4("design:type", Function),
|
|
@@ -1286,7 +1481,7 @@ _ts_decorate4([
|
|
|
1286
1481
|
]),
|
|
1287
1482
|
_ts_metadata4("design:returntype", Promise)
|
|
1288
1483
|
], DurableApiController.prototype, "continue", null);
|
|
1289
|
-
|
|
1484
|
+
_ts_decorate5([
|
|
1290
1485
|
Post("runs/:id/redispatch"),
|
|
1291
1486
|
_ts_param2(0, Param("id")),
|
|
1292
1487
|
_ts_metadata4("design:type", Function),
|
|
@@ -1295,7 +1490,7 @@ _ts_decorate4([
|
|
|
1295
1490
|
]),
|
|
1296
1491
|
_ts_metadata4("design:returntype", Promise)
|
|
1297
1492
|
], DurableApiController.prototype, "redispatch", null);
|
|
1298
|
-
|
|
1493
|
+
_ts_decorate5([
|
|
1299
1494
|
Post("webhooks/:token"),
|
|
1300
1495
|
_ts_param2(0, Param("token")),
|
|
1301
1496
|
_ts_param2(1, Body()),
|
|
@@ -1306,7 +1501,7 @@ _ts_decorate4([
|
|
|
1306
1501
|
]),
|
|
1307
1502
|
_ts_metadata4("design:returntype", Promise)
|
|
1308
1503
|
], DurableApiController.prototype, "webhook", null);
|
|
1309
|
-
|
|
1504
|
+
_ts_decorate5([
|
|
1310
1505
|
Get("runs/:id/events/:key"),
|
|
1311
1506
|
_ts_param2(0, Param("id")),
|
|
1312
1507
|
_ts_param2(1, Param("key")),
|
|
@@ -1317,7 +1512,7 @@ _ts_decorate4([
|
|
|
1317
1512
|
]),
|
|
1318
1513
|
_ts_metadata4("design:returntype", void 0)
|
|
1319
1514
|
], DurableApiController.prototype, "event", null);
|
|
1320
|
-
|
|
1515
|
+
_ts_decorate5([
|
|
1321
1516
|
Post("runs/:id/updates/:name"),
|
|
1322
1517
|
_ts_param2(0, Param("id")),
|
|
1323
1518
|
_ts_param2(1, Param("name")),
|
|
@@ -1330,9 +1525,10 @@ _ts_decorate4([
|
|
|
1330
1525
|
]),
|
|
1331
1526
|
_ts_metadata4("design:returntype", void 0)
|
|
1332
1527
|
], DurableApiController.prototype, "update", null);
|
|
1333
|
-
DurableApiController =
|
|
1528
|
+
DurableApiController = _ts_decorate5([
|
|
1334
1529
|
Controller(),
|
|
1335
1530
|
UseInterceptors(ApplyFilterInterceptor),
|
|
1531
|
+
UseFilters(NotModifiedFilter),
|
|
1336
1532
|
_ts_metadata4("design:type", Function),
|
|
1337
1533
|
_ts_metadata4("design:paramtypes", [
|
|
1338
1534
|
typeof DashboardService === "undefined" ? Object : DashboardService,
|
|
@@ -1348,7 +1544,7 @@ function notFound(error) {
|
|
|
1348
1544
|
__name(notFound, "notFound");
|
|
1349
1545
|
|
|
1350
1546
|
// src/server/durable-auth.controller.ts
|
|
1351
|
-
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";
|
|
1547
|
+
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";
|
|
1352
1548
|
|
|
1353
1549
|
// src/server/auth/dashboard-auth-config.ts
|
|
1354
1550
|
var DASHBOARD_AUTH = Symbol("DASHBOARD_AUTH");
|
|
@@ -1588,14 +1784,14 @@ function renderSessionRequiredPage(basePath) {
|
|
|
1588
1784
|
__name(renderSessionRequiredPage, "renderSessionRequiredPage");
|
|
1589
1785
|
|
|
1590
1786
|
// src/server/auth/request.ts
|
|
1591
|
-
function
|
|
1787
|
+
function isRecord2(value) {
|
|
1592
1788
|
return typeof value === "object" && value !== null;
|
|
1593
1789
|
}
|
|
1594
|
-
__name(
|
|
1790
|
+
__name(isRecord2, "isRecord");
|
|
1595
1791
|
function readHeaders(request) {
|
|
1596
|
-
if (!
|
|
1792
|
+
if (!isRecord2(request)) return {};
|
|
1597
1793
|
const headers = request.headers;
|
|
1598
|
-
return
|
|
1794
|
+
return isRecord2(headers) ? headers : {};
|
|
1599
1795
|
}
|
|
1600
1796
|
__name(readHeaders, "readHeaders");
|
|
1601
1797
|
function headerToString(value) {
|
|
@@ -1611,14 +1807,14 @@ function readCookieHeader(request) {
|
|
|
1611
1807
|
}
|
|
1612
1808
|
__name(readCookieHeader, "readCookieHeader");
|
|
1613
1809
|
function isHttpsRequest(request) {
|
|
1614
|
-
if (
|
|
1810
|
+
if (isRecord2(request) && request.protocol === "https") return true;
|
|
1615
1811
|
const forwarded = headerToString(readHeaders(request)["x-forwarded-proto"]);
|
|
1616
1812
|
if (forwarded === void 0) return false;
|
|
1617
1813
|
return forwarded.split(",").map((proto) => proto.trim().toLowerCase()).includes("https");
|
|
1618
1814
|
}
|
|
1619
1815
|
__name(isHttpsRequest, "isHttpsRequest");
|
|
1620
1816
|
function originalRequestUrl(request) {
|
|
1621
|
-
if (!
|
|
1817
|
+
if (!isRecord2(request)) return "/";
|
|
1622
1818
|
if (typeof request.originalUrl === "string" && request.originalUrl !== "") {
|
|
1623
1819
|
return request.originalUrl;
|
|
1624
1820
|
}
|
|
@@ -1635,72 +1831,6 @@ function sanitizeReturnTo(candidate, fallback) {
|
|
|
1635
1831
|
}
|
|
1636
1832
|
__name(sanitizeReturnTo, "sanitizeReturnTo");
|
|
1637
1833
|
|
|
1638
|
-
// src/server/auth/response.ts
|
|
1639
|
-
function isRecord2(value) {
|
|
1640
|
-
return typeof value === "object" && value !== null;
|
|
1641
|
-
}
|
|
1642
|
-
__name(isRecord2, "isRecord");
|
|
1643
|
-
function isRawCookieResponse(value) {
|
|
1644
|
-
return isRecord2(value) && typeof value.getHeader === "function" && typeof value.setHeader === "function";
|
|
1645
|
-
}
|
|
1646
|
-
__name(isRawCookieResponse, "isRawCookieResponse");
|
|
1647
|
-
function resolveCookieResponse(response) {
|
|
1648
|
-
if (isRawCookieResponse(response)) return response;
|
|
1649
|
-
if (isRecord2(response) && isRawCookieResponse(response.raw)) return response.raw;
|
|
1650
|
-
return null;
|
|
1651
|
-
}
|
|
1652
|
-
__name(resolveCookieResponse, "resolveCookieResponse");
|
|
1653
|
-
function existingSetCookies(response) {
|
|
1654
|
-
const current = response.getHeader("set-cookie");
|
|
1655
|
-
if (Array.isArray(current)) return current;
|
|
1656
|
-
if (typeof current === "string") return [
|
|
1657
|
-
current
|
|
1658
|
-
];
|
|
1659
|
-
return [];
|
|
1660
|
-
}
|
|
1661
|
-
__name(existingSetCookies, "existingSetCookies");
|
|
1662
|
-
function appendSetCookie(response, cookie) {
|
|
1663
|
-
const raw = resolveCookieResponse(response);
|
|
1664
|
-
if (!raw) return;
|
|
1665
|
-
raw.setHeader("set-cookie", [
|
|
1666
|
-
...existingSetCookies(raw),
|
|
1667
|
-
cookie
|
|
1668
|
-
]);
|
|
1669
|
-
}
|
|
1670
|
-
__name(appendSetCookie, "appendSetCookie");
|
|
1671
|
-
function isRawRedirectResponse(value) {
|
|
1672
|
-
return isRecord2(value) && typeof value.getHeader === "function" && typeof value.setHeader === "function" && typeof value.end === "function";
|
|
1673
|
-
}
|
|
1674
|
-
__name(isRawRedirectResponse, "isRawRedirectResponse");
|
|
1675
|
-
function resolveRedirectResponse(response) {
|
|
1676
|
-
if (isRawRedirectResponse(response)) return response;
|
|
1677
|
-
if (isRecord2(response) && isRawRedirectResponse(response.raw)) return response.raw;
|
|
1678
|
-
return null;
|
|
1679
|
-
}
|
|
1680
|
-
__name(resolveRedirectResponse, "resolveRedirectResponse");
|
|
1681
|
-
function redirectRaw(response, location, status = 302) {
|
|
1682
|
-
const raw = resolveRedirectResponse(response);
|
|
1683
|
-
if (!raw) return;
|
|
1684
|
-
raw.statusCode = status;
|
|
1685
|
-
raw.setHeader("location", location);
|
|
1686
|
-
raw.end();
|
|
1687
|
-
}
|
|
1688
|
-
__name(redirectRaw, "redirectRaw");
|
|
1689
|
-
function responseAlreadyWritten(response) {
|
|
1690
|
-
const raw = resolveRedirectResponse(response);
|
|
1691
|
-
return raw?.headersSent === true;
|
|
1692
|
-
}
|
|
1693
|
-
__name(responseAlreadyWritten, "responseAlreadyWritten");
|
|
1694
|
-
function writeHtmlRaw(response, html, status = 200) {
|
|
1695
|
-
const raw = resolveRedirectResponse(response);
|
|
1696
|
-
if (!raw) return;
|
|
1697
|
-
raw.statusCode = status;
|
|
1698
|
-
raw.setHeader("content-type", "text/html; charset=utf-8");
|
|
1699
|
-
raw.setHeader("cache-control", "no-store, must-revalidate");
|
|
1700
|
-
raw.end(html);
|
|
1701
|
-
}
|
|
1702
|
-
__name(writeHtmlRaw, "writeHtmlRaw");
|
|
1703
|
-
|
|
1704
1834
|
// src/server/auth/cookie-header.ts
|
|
1705
1835
|
function parseCookieHeader(header) {
|
|
1706
1836
|
const cookies = {};
|
|
@@ -1900,11 +2030,11 @@ __name(maybeRenewSession, "maybeRenewSession");
|
|
|
1900
2030
|
import { existsSync, readFileSync } from "node:fs";
|
|
1901
2031
|
import { basename, extname, join, resolve, sep } from "node:path";
|
|
1902
2032
|
import { fileURLToPath } from "node:url";
|
|
1903
|
-
import { Controller as Controller2, Get as Get2, Header as Header2, Inject as Inject3, NotFoundException as NotFoundException2, Param as Param2, StreamableFile, UseFilters } from "@nestjs/common";
|
|
2033
|
+
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";
|
|
1904
2034
|
|
|
1905
2035
|
// src/server/auth/login-redirect.exception.ts
|
|
1906
|
-
import { Catch, HttpException, HttpStatus } from "@nestjs/common";
|
|
1907
|
-
function
|
|
2036
|
+
import { Catch as Catch2, HttpException as HttpException2, HttpStatus } from "@nestjs/common";
|
|
2037
|
+
function _ts_decorate6(decorators, target, key, desc) {
|
|
1908
2038
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1909
2039
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
1910
2040
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1917,8 +2047,8 @@ function _ts_decorate5(decorators, target, key, desc) {
|
|
|
1917
2047
|
}
|
|
1918
2048
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1919
2049
|
}
|
|
1920
|
-
__name(
|
|
1921
|
-
var DashboardLoginRedirectException = class extends
|
|
2050
|
+
__name(_ts_decorate6, "_ts_decorate");
|
|
2051
|
+
var DashboardLoginRedirectException = class extends HttpException2 {
|
|
1922
2052
|
static {
|
|
1923
2053
|
__name(this, "DashboardLoginRedirectException");
|
|
1924
2054
|
}
|
|
@@ -1938,13 +2068,13 @@ var DashboardLoginRedirectFilter = class {
|
|
|
1938
2068
|
redirectRaw(response, exception.location);
|
|
1939
2069
|
}
|
|
1940
2070
|
};
|
|
1941
|
-
DashboardLoginRedirectFilter =
|
|
1942
|
-
|
|
2071
|
+
DashboardLoginRedirectFilter = _ts_decorate6([
|
|
2072
|
+
Catch2(DashboardLoginRedirectException)
|
|
1943
2073
|
], DashboardLoginRedirectFilter);
|
|
1944
2074
|
|
|
1945
2075
|
// src/server/auth/session-required.exception.ts
|
|
1946
|
-
import { Catch as
|
|
1947
|
-
function
|
|
2076
|
+
import { Catch as Catch3, HttpException as HttpException3, HttpStatus as HttpStatus2, Inject as Inject2, Logger, Optional as Optional2 } from "@nestjs/common";
|
|
2077
|
+
function _ts_decorate7(decorators, target, key, desc) {
|
|
1948
2078
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1949
2079
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
1950
2080
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1957,7 +2087,7 @@ function _ts_decorate6(decorators, target, key, desc) {
|
|
|
1957
2087
|
}
|
|
1958
2088
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1959
2089
|
}
|
|
1960
|
-
__name(
|
|
2090
|
+
__name(_ts_decorate7, "_ts_decorate");
|
|
1961
2091
|
function _ts_metadata5(metadataKey, metadataValue) {
|
|
1962
2092
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
1963
2093
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
@@ -1970,7 +2100,7 @@ function _ts_param3(paramIndex, decorator) {
|
|
|
1970
2100
|
};
|
|
1971
2101
|
}
|
|
1972
2102
|
__name(_ts_param3, "_ts_param");
|
|
1973
|
-
var DashboardSessionRequiredException = class extends
|
|
2103
|
+
var DashboardSessionRequiredException = class extends HttpException3 {
|
|
1974
2104
|
static {
|
|
1975
2105
|
__name(this, "DashboardSessionRequiredException");
|
|
1976
2106
|
}
|
|
@@ -2018,8 +2148,8 @@ var DashboardSessionRequiredFilter = class _DashboardSessionRequiredFilter {
|
|
|
2018
2148
|
this.logger.warn(message);
|
|
2019
2149
|
}
|
|
2020
2150
|
};
|
|
2021
|
-
DashboardSessionRequiredFilter =
|
|
2022
|
-
|
|
2151
|
+
DashboardSessionRequiredFilter = _ts_decorate7([
|
|
2152
|
+
Catch3(DashboardSessionRequiredException),
|
|
2023
2153
|
_ts_param3(0, Optional2()),
|
|
2024
2154
|
_ts_param3(0, Inject2(DASHBOARD_AUTH)),
|
|
2025
2155
|
_ts_metadata5("design:type", Function),
|
|
@@ -2029,7 +2159,7 @@ DashboardSessionRequiredFilter = _ts_decorate6([
|
|
|
2029
2159
|
], DashboardSessionRequiredFilter);
|
|
2030
2160
|
|
|
2031
2161
|
// src/server/durable-ui.controller.ts
|
|
2032
|
-
function
|
|
2162
|
+
function _ts_decorate8(decorators, target, key, desc) {
|
|
2033
2163
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2034
2164
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2035
2165
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2042,7 +2172,7 @@ function _ts_decorate7(decorators, target, key, desc) {
|
|
|
2042
2172
|
}
|
|
2043
2173
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2044
2174
|
}
|
|
2045
|
-
__name(
|
|
2175
|
+
__name(_ts_decorate8, "_ts_decorate");
|
|
2046
2176
|
function _ts_metadata6(metadataKey, metadataValue) {
|
|
2047
2177
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2048
2178
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
@@ -2107,7 +2237,7 @@ var DurableUiController = class {
|
|
|
2107
2237
|
});
|
|
2108
2238
|
}
|
|
2109
2239
|
};
|
|
2110
|
-
|
|
2240
|
+
_ts_decorate8([
|
|
2111
2241
|
Get2(),
|
|
2112
2242
|
Header2("Content-Type", "text/html; charset=utf-8"),
|
|
2113
2243
|
Header2("Cache-Control", "no-store, must-revalidate"),
|
|
@@ -2115,7 +2245,7 @@ _ts_decorate7([
|
|
|
2115
2245
|
_ts_metadata6("design:paramtypes", []),
|
|
2116
2246
|
_ts_metadata6("design:returntype", String)
|
|
2117
2247
|
], DurableUiController.prototype, "index", null);
|
|
2118
|
-
|
|
2248
|
+
_ts_decorate8([
|
|
2119
2249
|
Get2("assets/:file"),
|
|
2120
2250
|
Header2("Cache-Control", "public, max-age=31536000, immutable"),
|
|
2121
2251
|
_ts_param4(0, Param2("file")),
|
|
@@ -2125,8 +2255,8 @@ _ts_decorate7([
|
|
|
2125
2255
|
]),
|
|
2126
2256
|
_ts_metadata6("design:returntype", typeof StreamableFile === "undefined" ? Object : StreamableFile)
|
|
2127
2257
|
], DurableUiController.prototype, "asset", null);
|
|
2128
|
-
DurableUiController =
|
|
2129
|
-
|
|
2258
|
+
DurableUiController = _ts_decorate8([
|
|
2259
|
+
UseFilters2(DashboardLoginRedirectFilter, DashboardSessionRequiredFilter),
|
|
2130
2260
|
Controller2(),
|
|
2131
2261
|
_ts_param4(0, Inject3(DASHBOARD_BASE_PATH)),
|
|
2132
2262
|
_ts_param4(1, Inject3(DASHBOARD_API_PATH)),
|
|
@@ -2138,7 +2268,7 @@ DurableUiController = _ts_decorate7([
|
|
|
2138
2268
|
], DurableUiController);
|
|
2139
2269
|
|
|
2140
2270
|
// src/server/durable-auth.controller.ts
|
|
2141
|
-
function
|
|
2271
|
+
function _ts_decorate9(decorators, target, key, desc) {
|
|
2142
2272
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2143
2273
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2144
2274
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2151,7 +2281,7 @@ function _ts_decorate8(decorators, target, key, desc) {
|
|
|
2151
2281
|
}
|
|
2152
2282
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2153
2283
|
}
|
|
2154
|
-
__name(
|
|
2284
|
+
__name(_ts_decorate9, "_ts_decorate");
|
|
2155
2285
|
function _ts_metadata7(metadataKey, metadataValue) {
|
|
2156
2286
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2157
2287
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
@@ -2259,7 +2389,7 @@ var DurableAuthController = class _DurableAuthController {
|
|
|
2259
2389
|
}
|
|
2260
2390
|
}
|
|
2261
2391
|
};
|
|
2262
|
-
|
|
2392
|
+
_ts_decorate9([
|
|
2263
2393
|
Get3("login"),
|
|
2264
2394
|
Header3("Content-Type", "text/html; charset=utf-8"),
|
|
2265
2395
|
Header3("Cache-Control", "no-store, must-revalidate"),
|
|
@@ -2267,12 +2397,12 @@ _ts_decorate8([
|
|
|
2267
2397
|
_ts_metadata7("design:paramtypes", []),
|
|
2268
2398
|
_ts_metadata7("design:returntype", String)
|
|
2269
2399
|
], DurableAuthController.prototype, "loginPage", null);
|
|
2270
|
-
|
|
2400
|
+
_ts_decorate9([
|
|
2271
2401
|
Post2("login"),
|
|
2272
2402
|
HttpCode(200),
|
|
2273
2403
|
_ts_param5(0, Body2()),
|
|
2274
2404
|
_ts_param5(1, Req()),
|
|
2275
|
-
_ts_param5(2,
|
|
2405
|
+
_ts_param5(2, Res2({
|
|
2276
2406
|
passthrough: true
|
|
2277
2407
|
})),
|
|
2278
2408
|
_ts_metadata7("design:type", Function),
|
|
@@ -2283,11 +2413,11 @@ _ts_decorate8([
|
|
|
2283
2413
|
]),
|
|
2284
2414
|
_ts_metadata7("design:returntype", Promise)
|
|
2285
2415
|
], DurableAuthController.prototype, "login", null);
|
|
2286
|
-
|
|
2416
|
+
_ts_decorate9([
|
|
2287
2417
|
Post2("session"),
|
|
2288
2418
|
HttpCode(204),
|
|
2289
2419
|
_ts_param5(0, Req()),
|
|
2290
|
-
_ts_param5(1,
|
|
2420
|
+
_ts_param5(1, Res2({
|
|
2291
2421
|
passthrough: true
|
|
2292
2422
|
})),
|
|
2293
2423
|
_ts_metadata7("design:type", Function),
|
|
@@ -2297,10 +2427,10 @@ _ts_decorate8([
|
|
|
2297
2427
|
]),
|
|
2298
2428
|
_ts_metadata7("design:returntype", Promise)
|
|
2299
2429
|
], DurableAuthController.prototype, "session", null);
|
|
2300
|
-
|
|
2430
|
+
_ts_decorate9([
|
|
2301
2431
|
Get3("logout"),
|
|
2302
2432
|
_ts_param5(0, Req()),
|
|
2303
|
-
_ts_param5(1,
|
|
2433
|
+
_ts_param5(1, Res2()),
|
|
2304
2434
|
_ts_metadata7("design:type", Function),
|
|
2305
2435
|
_ts_metadata7("design:paramtypes", [
|
|
2306
2436
|
Object,
|
|
@@ -2308,7 +2438,7 @@ _ts_decorate8([
|
|
|
2308
2438
|
]),
|
|
2309
2439
|
_ts_metadata7("design:returntype", void 0)
|
|
2310
2440
|
], DurableAuthController.prototype, "logout", null);
|
|
2311
|
-
DurableAuthController =
|
|
2441
|
+
DurableAuthController = _ts_decorate9([
|
|
2312
2442
|
Controller3(),
|
|
2313
2443
|
_ts_param5(0, Optional3()),
|
|
2314
2444
|
_ts_param5(0, Inject4(DASHBOARD_AUTH)),
|
|
@@ -2328,7 +2458,7 @@ import { ModuleRef, RouterModule } from "@nestjs/core";
|
|
|
2328
2458
|
|
|
2329
2459
|
// src/server/durable-session.guard.ts
|
|
2330
2460
|
import { Inject as Inject5, Injectable as Injectable4, UnauthorizedException as UnauthorizedException2 } from "@nestjs/common";
|
|
2331
|
-
function
|
|
2461
|
+
function _ts_decorate10(decorators, target, key, desc) {
|
|
2332
2462
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2333
2463
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2334
2464
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2341,7 +2471,7 @@ function _ts_decorate9(decorators, target, key, desc) {
|
|
|
2341
2471
|
}
|
|
2342
2472
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2343
2473
|
}
|
|
2344
|
-
__name(
|
|
2474
|
+
__name(_ts_decorate10, "_ts_decorate");
|
|
2345
2475
|
function _ts_metadata8(metadataKey, metadataValue) {
|
|
2346
2476
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
2347
2477
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
@@ -2394,7 +2524,7 @@ var DurableUiSessionGuard = class {
|
|
|
2394
2524
|
throw new DashboardLoginRedirectException(`${this.basePath}/login?returnTo=${returnTo}`);
|
|
2395
2525
|
}
|
|
2396
2526
|
};
|
|
2397
|
-
DurableUiSessionGuard =
|
|
2527
|
+
DurableUiSessionGuard = _ts_decorate10([
|
|
2398
2528
|
Injectable4(),
|
|
2399
2529
|
_ts_param6(0, Inject5(DASHBOARD_AUTH)),
|
|
2400
2530
|
_ts_param6(1, Inject5(DASHBOARD_BASE_PATH)),
|
|
@@ -2438,7 +2568,7 @@ var DurableApiSessionGuard = class {
|
|
|
2438
2568
|
});
|
|
2439
2569
|
}
|
|
2440
2570
|
};
|
|
2441
|
-
DurableApiSessionGuard =
|
|
2571
|
+
DurableApiSessionGuard = _ts_decorate10([
|
|
2442
2572
|
Injectable4(),
|
|
2443
2573
|
_ts_param6(0, Inject5(DASHBOARD_AUTH)),
|
|
2444
2574
|
_ts_metadata8("design:type", Function),
|
|
@@ -2448,7 +2578,7 @@ DurableApiSessionGuard = _ts_decorate9([
|
|
|
2448
2578
|
], DurableApiSessionGuard);
|
|
2449
2579
|
|
|
2450
2580
|
// src/server/durable-dashboard.module.ts
|
|
2451
|
-
function
|
|
2581
|
+
function _ts_decorate11(decorators, target, key, desc) {
|
|
2452
2582
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2453
2583
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
2454
2584
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -2461,7 +2591,7 @@ function _ts_decorate10(decorators, target, key, desc) {
|
|
|
2461
2591
|
}
|
|
2462
2592
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2463
2593
|
}
|
|
2464
|
-
__name(
|
|
2594
|
+
__name(_ts_decorate11, "_ts_decorate");
|
|
2465
2595
|
var GUARDS_METADATA = "__guards__";
|
|
2466
2596
|
function normalize(path) {
|
|
2467
2597
|
return `/${path.replace(/^\/+|\/+$/g, "")}`;
|
|
@@ -2534,7 +2664,7 @@ var DurableApiModule = class _DurableApiModule {
|
|
|
2534
2664
|
};
|
|
2535
2665
|
}
|
|
2536
2666
|
};
|
|
2537
|
-
DurableApiModule =
|
|
2667
|
+
DurableApiModule = _ts_decorate11([
|
|
2538
2668
|
Module({})
|
|
2539
2669
|
], DurableApiModule);
|
|
2540
2670
|
var DurableDashboardModule = class _DurableDashboardModule {
|
|
@@ -2620,7 +2750,7 @@ var DurableDashboardModule = class _DurableDashboardModule {
|
|
|
2620
2750
|
};
|
|
2621
2751
|
}
|
|
2622
2752
|
};
|
|
2623
|
-
DurableDashboardModule =
|
|
2753
|
+
DurableDashboardModule = _ts_decorate11([
|
|
2624
2754
|
Module({})
|
|
2625
2755
|
], DurableDashboardModule);
|
|
2626
2756
|
export {
|