@dudousxd/nestjs-durable-dashboard 0.55.1 → 0.56.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 +11 -0
- package/dist/client/durable-client.d.ts.map +1 -1
- package/dist/client/durable-client.js +32 -16
- package/dist/client/durable-client.js.map +1 -1
- package/dist/server/index.cjs +684 -350
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +136 -40
- package/dist/server/index.d.ts +136 -40
- package/dist/server/index.js +597 -283
- package/dist/server/index.js.map +1 -1
- package/dist/spa/assets/{bench-DCclNvcZ.js → bench-BXhQP2W7.js} +1 -1
- package/dist/spa/assets/index-C6Ih-K3x.js +1 -0
- package/dist/spa/assets/index-D_rIGnea.css +1 -0
- package/dist/spa/assets/{index-B-wtX4GV.js → index-DwGUovEa.js} +15 -15
- package/dist/spa/assets/{preview-CdsjvOrK.js → preview-ekPMzj7t.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 +7 -1
- package/dist/spa/assets/index-CJdk28vt.css +0 -1
- package/dist/spa/assets/index-ChjKRQZx.js +0 -1
package/dist/server/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
|
|
4
|
-
// src/server/
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
// src/server/console-authorize.ts
|
|
5
|
+
import "reflect-metadata";
|
|
6
|
+
import { createHash, timingSafeEqual } from "node:crypto";
|
|
7
|
+
import { Catch, HttpException, Inject, Injectable, Logger, UseFilters, UseGuards, applyDecorators } from "@nestjs/common";
|
|
8
|
+
import { HttpAdapterHost } from "@nestjs/core";
|
|
8
9
|
function _ts_decorate(decorators, target, key, desc) {
|
|
9
10
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
10
11
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
@@ -31,6 +32,310 @@ function _ts_param(paramIndex, decorator) {
|
|
|
31
32
|
};
|
|
32
33
|
}
|
|
33
34
|
__name(_ts_param, "_ts_param");
|
|
35
|
+
var CONSOLE_GATE = Symbol.for("@dudousxd/aviary:console-gate");
|
|
36
|
+
var PACKAGE = "@dudousxd/nestjs-durable-dashboard";
|
|
37
|
+
var MODULE = "DurableDashboardModule";
|
|
38
|
+
var CONSOLE_AUTHORIZE_MISSING_WARNING = `[${PACKAGE}] console has no \`authorize\` configured: it is open outside production and denies every request in production. Set \`authorize\` in ${MODULE}.forRoot().`;
|
|
39
|
+
var allow = /* @__PURE__ */ __name(() => ({
|
|
40
|
+
allowed: true
|
|
41
|
+
}), "allow");
|
|
42
|
+
var forbidden = /* @__PURE__ */ __name(() => ({
|
|
43
|
+
allowed: false,
|
|
44
|
+
reason: "forbidden"
|
|
45
|
+
}), "forbidden");
|
|
46
|
+
var unauthenticated = /* @__PURE__ */ __name(() => ({
|
|
47
|
+
allowed: false,
|
|
48
|
+
reason: "unauthenticated"
|
|
49
|
+
}), "unauthenticated");
|
|
50
|
+
function isProduction() {
|
|
51
|
+
return (process.env.NODE_ENV ?? "").trim().toLowerCase() === "production";
|
|
52
|
+
}
|
|
53
|
+
__name(isProduction, "isProduction");
|
|
54
|
+
function isAuthorizerClass(value) {
|
|
55
|
+
if (typeof value !== "function") return false;
|
|
56
|
+
if (typeof value.prototype?.authorize === "function") {
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
return /^class[\s{]/.test(Function.prototype.toString.call(value));
|
|
60
|
+
}
|
|
61
|
+
__name(isAuthorizerClass, "isAuthorizerClass");
|
|
62
|
+
function isPolicyCheck(value) {
|
|
63
|
+
return typeof value === "object" && value !== null && typeof value.policy === "function" && typeof value.ability === "string";
|
|
64
|
+
}
|
|
65
|
+
__name(isPolicyCheck, "isPolicyCheck");
|
|
66
|
+
function isLazyModule(value) {
|
|
67
|
+
return typeof value === "object" && value !== null && isAuthorizerClass(value.default);
|
|
68
|
+
}
|
|
69
|
+
__name(isLazyModule, "isLazyModule");
|
|
70
|
+
function normalizeConsoleResult(result) {
|
|
71
|
+
if (result === true) return allow();
|
|
72
|
+
if (typeof result !== "object" || result === null) return forbidden();
|
|
73
|
+
const shape = result;
|
|
74
|
+
if (typeof shape.redirectTo === "string" && shape.allowed !== true) {
|
|
75
|
+
return {
|
|
76
|
+
allowed: false,
|
|
77
|
+
reason: "unauthenticated",
|
|
78
|
+
redirectTo: shape.redirectTo
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
if (shape.allowed === true) return allow();
|
|
82
|
+
return shape.reason === "unauthenticated" ? unauthenticated() : forbidden();
|
|
83
|
+
}
|
|
84
|
+
__name(normalizeConsoleResult, "normalizeConsoleResult");
|
|
85
|
+
function hasUser(user) {
|
|
86
|
+
return user !== null && user !== void 0 && user !== false;
|
|
87
|
+
}
|
|
88
|
+
__name(hasUser, "hasUser");
|
|
89
|
+
async function policyDecider(check, moduleRef) {
|
|
90
|
+
let pkg;
|
|
91
|
+
try {
|
|
92
|
+
pkg = await import("@nestjs/authorization");
|
|
93
|
+
} catch {
|
|
94
|
+
throw new Error(`${MODULE}: \`authorize: { policy, ability }\` needs @nestjs/authorization installed, with AuthorizationModule.forRoot() imported in the app; or pass a function, a class, or a gate name.`);
|
|
95
|
+
}
|
|
96
|
+
const { AuthorizationService, AUTHORIZATION_MODULE_OPTIONS, defaultGetUser } = pkg;
|
|
97
|
+
try {
|
|
98
|
+
moduleRef.get(AuthorizationService, {
|
|
99
|
+
strict: false
|
|
100
|
+
});
|
|
101
|
+
} catch {
|
|
102
|
+
throw new Error(`${MODULE}: \`authorize: { policy, ability }\` needs AuthorizationModule.forRoot() from @nestjs/authorization imported in the app.`);
|
|
103
|
+
}
|
|
104
|
+
let getUser = defaultGetUser;
|
|
105
|
+
try {
|
|
106
|
+
const options = moduleRef.get(AUTHORIZATION_MODULE_OPTIONS, {
|
|
107
|
+
strict: false
|
|
108
|
+
});
|
|
109
|
+
if (typeof options?.getUser === "function") getUser = options.getUser;
|
|
110
|
+
} catch {
|
|
111
|
+
}
|
|
112
|
+
return async (context) => {
|
|
113
|
+
const authorization = moduleRef.get(AuthorizationService, {
|
|
114
|
+
strict: false
|
|
115
|
+
});
|
|
116
|
+
const user = await getUser(context);
|
|
117
|
+
const can = authorization.can;
|
|
118
|
+
if (await can.call(authorization, check.policy, check.ability, hasUser(user) ? user : null)) {
|
|
119
|
+
return allow();
|
|
120
|
+
}
|
|
121
|
+
return hasUser(user) ? forbidden() : unauthenticated();
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
__name(policyDecider, "policyDecider");
|
|
125
|
+
function gateDecider(name, moduleRef) {
|
|
126
|
+
try {
|
|
127
|
+
moduleRef.get(CONSOLE_GATE, {
|
|
128
|
+
strict: false
|
|
129
|
+
});
|
|
130
|
+
} catch {
|
|
131
|
+
throw new Error(`\`authorize: '${name}'\` needs @dudousxd/nestjs-authz's AuthzModule (it resolves gate names); or pass a function, a class, or { policy, ability }`);
|
|
132
|
+
}
|
|
133
|
+
return async (context) => {
|
|
134
|
+
const gate = moduleRef.get(CONSOLE_GATE, {
|
|
135
|
+
strict: false
|
|
136
|
+
});
|
|
137
|
+
return normalizeConsoleResult(await gate.allows(name, context));
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
__name(gateDecider, "gateDecider");
|
|
141
|
+
function classDecider(moduleRef) {
|
|
142
|
+
const instances = /* @__PURE__ */ new Map();
|
|
143
|
+
const instanceOf = /* @__PURE__ */ __name((Class) => {
|
|
144
|
+
const cached = instances.get(Class);
|
|
145
|
+
if (cached) return cached;
|
|
146
|
+
const pending = (async () => {
|
|
147
|
+
try {
|
|
148
|
+
const registered = moduleRef.get(Class, {
|
|
149
|
+
strict: false
|
|
150
|
+
});
|
|
151
|
+
if (registered) return registered;
|
|
152
|
+
} catch {
|
|
153
|
+
}
|
|
154
|
+
return moduleRef.create(Class);
|
|
155
|
+
})();
|
|
156
|
+
pending.catch(() => instances.delete(Class));
|
|
157
|
+
instances.set(Class, pending);
|
|
158
|
+
return pending;
|
|
159
|
+
}, "instanceOf");
|
|
160
|
+
return (Class) => async (context) => normalizeConsoleResult(await (await instanceOf(Class)).authorize(context));
|
|
161
|
+
}
|
|
162
|
+
__name(classDecider, "classDecider");
|
|
163
|
+
async function resolveConsoleAuthorize(authorize, moduleRef, options = {}) {
|
|
164
|
+
const logger = options.logger ?? new Logger(MODULE);
|
|
165
|
+
if (authorize === void 0) {
|
|
166
|
+
if (options.warnIfMissing !== false) logger.warn(CONSOLE_AUTHORIZE_MISSING_WARNING);
|
|
167
|
+
const production = isProduction();
|
|
168
|
+
return async () => production ? forbidden() : allow();
|
|
169
|
+
}
|
|
170
|
+
let decide;
|
|
171
|
+
if (typeof authorize === "string") {
|
|
172
|
+
decide = gateDecider(authorize, moduleRef);
|
|
173
|
+
} else if (isPolicyCheck(authorize)) {
|
|
174
|
+
decide = await policyDecider(authorize, moduleRef);
|
|
175
|
+
} else if (isAuthorizerClass(authorize)) {
|
|
176
|
+
decide = classDecider(moduleRef)(authorize);
|
|
177
|
+
} else if (typeof authorize === "function") {
|
|
178
|
+
const fromClass = classDecider(moduleRef);
|
|
179
|
+
let lazy;
|
|
180
|
+
const fn = authorize;
|
|
181
|
+
decide = /* @__PURE__ */ __name(async (context) => {
|
|
182
|
+
if (lazy) return lazy(context);
|
|
183
|
+
const result = await fn(context);
|
|
184
|
+
if (!isLazyModule(result)) return normalizeConsoleResult(result);
|
|
185
|
+
lazy = fromClass(result.default);
|
|
186
|
+
return lazy(context);
|
|
187
|
+
}, "decide");
|
|
188
|
+
} else {
|
|
189
|
+
throw new Error(`${MODULE}: \`authorize\` must be a function, a class with authorize(), a lazy import, { policy, ability } or a gate name.`);
|
|
190
|
+
}
|
|
191
|
+
return async (context) => {
|
|
192
|
+
try {
|
|
193
|
+
return await decide(context);
|
|
194
|
+
} catch (error) {
|
|
195
|
+
logger.warn(`console \`authorize\` threw, denying the request: ${error instanceof Error ? error.message : String(error)}`);
|
|
196
|
+
return forbidden();
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
__name(resolveConsoleAuthorize, "resolveConsoleAuthorize");
|
|
201
|
+
var sha256 = /* @__PURE__ */ __name((value) => createHash("sha256").update(value).digest(), "sha256");
|
|
202
|
+
function authorizeByToken(options) {
|
|
203
|
+
const token = options.token;
|
|
204
|
+
if (typeof token !== "string" || token.length === 0) {
|
|
205
|
+
throw new Error("authorizeByToken: `token` is empty; set it (e.g. from an env var).");
|
|
206
|
+
}
|
|
207
|
+
const expected = sha256(token);
|
|
208
|
+
return (context) => {
|
|
209
|
+
const header = context.switchToHttp().getRequest()?.headers?.authorization;
|
|
210
|
+
const match = typeof header === "string" ? /^Bearer\s+(.+)$/i.exec(header.trim()) : null;
|
|
211
|
+
if (match?.[1] && timingSafeEqual(sha256(match[1]), expected)) return true;
|
|
212
|
+
return {
|
|
213
|
+
allowed: false,
|
|
214
|
+
reason: "unauthenticated"
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
__name(authorizeByToken, "authorizeByToken");
|
|
219
|
+
var CONSOLE_AUTHORIZE_DECIDE = Symbol(`${PACKAGE}:console-authorize`);
|
|
220
|
+
var CONSOLE_PAGE_METADATA = `${PACKAGE}:console-page`;
|
|
221
|
+
var ConsolePage = /* @__PURE__ */ __name(() => (target) => {
|
|
222
|
+
Reflect.defineMetadata(CONSOLE_PAGE_METADATA, true, target);
|
|
223
|
+
}, "ConsolePage");
|
|
224
|
+
var ConsoleAccessDenied = class extends HttpException {
|
|
225
|
+
static {
|
|
226
|
+
__name(this, "ConsoleAccessDenied");
|
|
227
|
+
}
|
|
228
|
+
decision;
|
|
229
|
+
page;
|
|
230
|
+
constructor(decision, page) {
|
|
231
|
+
const unauthenticated2 = decision.reason === "unauthenticated";
|
|
232
|
+
super(unauthenticated2 ? {
|
|
233
|
+
error: "unauthenticated",
|
|
234
|
+
...decision.redirectTo ? {
|
|
235
|
+
redirectTo: decision.redirectTo
|
|
236
|
+
} : {}
|
|
237
|
+
} : {
|
|
238
|
+
error: "forbidden"
|
|
239
|
+
}, unauthenticated2 ? 401 : 403), this.decision = decision, this.page = page;
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
var ConsoleAuthorizeGuard = class {
|
|
243
|
+
static {
|
|
244
|
+
__name(this, "ConsoleAuthorizeGuard");
|
|
245
|
+
}
|
|
246
|
+
decide;
|
|
247
|
+
constructor(decide) {
|
|
248
|
+
this.decide = decide;
|
|
249
|
+
}
|
|
250
|
+
async canActivate(context) {
|
|
251
|
+
const decision = await this.decide(context);
|
|
252
|
+
if (decision.allowed) return true;
|
|
253
|
+
throw new ConsoleAccessDenied(decision, isPageNavigation(context));
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
ConsoleAuthorizeGuard = _ts_decorate([
|
|
257
|
+
Injectable(),
|
|
258
|
+
_ts_param(0, Inject(CONSOLE_AUTHORIZE_DECIDE)),
|
|
259
|
+
_ts_metadata("design:type", Function),
|
|
260
|
+
_ts_metadata("design:paramtypes", [
|
|
261
|
+
typeof ConsoleDecide === "undefined" ? Object : ConsoleDecide
|
|
262
|
+
])
|
|
263
|
+
], ConsoleAuthorizeGuard);
|
|
264
|
+
function isPageNavigation(context) {
|
|
265
|
+
if (context.getType() !== "http") return false;
|
|
266
|
+
if (Reflect.getMetadata(CONSOLE_PAGE_METADATA, context.getClass()) !== true) return false;
|
|
267
|
+
const request = context.switchToHttp().getRequest();
|
|
268
|
+
const accept = request?.headers?.accept;
|
|
269
|
+
return request?.method === "GET" && typeof accept === "string" && accept.includes("text/html");
|
|
270
|
+
}
|
|
271
|
+
__name(isPageNavigation, "isPageNavigation");
|
|
272
|
+
var consolePage = /* @__PURE__ */ __name((title, message) => `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${title}</title></head><body style="font-family:system-ui,sans-serif;display:grid;place-items:center;min-height:100vh;margin:0"><main style="text-align:center"><h1>${title}</h1><p>${message}</p></main></body></html>`, "consolePage");
|
|
273
|
+
var DENIED_PAGE = consolePage("Access denied", "You do not have access to this console.");
|
|
274
|
+
var SIGN_IN_PAGE = consolePage("Sign in required", "Sign in to open this console.");
|
|
275
|
+
var ConsoleAuthorizeFilter = class {
|
|
276
|
+
static {
|
|
277
|
+
__name(this, "ConsoleAuthorizeFilter");
|
|
278
|
+
}
|
|
279
|
+
adapterHost;
|
|
280
|
+
constructor(adapterHost) {
|
|
281
|
+
this.adapterHost = adapterHost;
|
|
282
|
+
}
|
|
283
|
+
catch(exception, host) {
|
|
284
|
+
const adapter = this.adapterHost.httpAdapter;
|
|
285
|
+
const response = host.switchToHttp().getResponse();
|
|
286
|
+
const { decision, page } = exception;
|
|
287
|
+
if (page && decision.redirectTo) {
|
|
288
|
+
adapter.redirect(response, 302, decision.redirectTo);
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
if (page) {
|
|
292
|
+
const forbiddenPage = decision.reason === "forbidden";
|
|
293
|
+
adapter.setHeader(response, "Content-Type", "text/html; charset=utf-8");
|
|
294
|
+
adapter.reply(response, forbiddenPage ? DENIED_PAGE : SIGN_IN_PAGE, forbiddenPage ? 403 : 401);
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
adapter.reply(response, exception.getResponse(), exception.getStatus());
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
ConsoleAuthorizeFilter = _ts_decorate([
|
|
301
|
+
Catch(ConsoleAccessDenied),
|
|
302
|
+
_ts_metadata("design:type", Function),
|
|
303
|
+
_ts_metadata("design:paramtypes", [
|
|
304
|
+
typeof HttpAdapterHost === "undefined" ? Object : HttpAdapterHost
|
|
305
|
+
])
|
|
306
|
+
], ConsoleAuthorizeFilter);
|
|
307
|
+
var UseConsoleAuthorize = /* @__PURE__ */ __name(() => applyDecorators(UseGuards(ConsoleAuthorizeGuard), UseFilters(ConsoleAuthorizeFilter)), "UseConsoleAuthorize");
|
|
308
|
+
|
|
309
|
+
// src/server/dashboard.service.ts
|
|
310
|
+
import { RunGateway, STATE_STORE_CANONICAL, TERMINAL_RUN_STATUSES, WorkflowEngine, collectMetrics, parseWebhookToken } from "@dudousxd/nestjs-durable-core";
|
|
311
|
+
import { Inject as Inject2, Injectable as Injectable2, Optional } from "@nestjs/common";
|
|
312
|
+
import { Observable } from "rxjs";
|
|
313
|
+
function _ts_decorate2(decorators, target, key, desc) {
|
|
314
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
315
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
316
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
317
|
+
} else {
|
|
318
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
319
|
+
if (d = decorators[i]) {
|
|
320
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
325
|
+
}
|
|
326
|
+
__name(_ts_decorate2, "_ts_decorate");
|
|
327
|
+
function _ts_metadata2(metadataKey, metadataValue) {
|
|
328
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
329
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
__name(_ts_metadata2, "_ts_metadata");
|
|
333
|
+
function _ts_param2(paramIndex, decorator) {
|
|
334
|
+
return function(target, key) {
|
|
335
|
+
decorator(target, key, paramIndex);
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
__name(_ts_param2, "_ts_param");
|
|
34
339
|
var DashboardService = class {
|
|
35
340
|
static {
|
|
36
341
|
__name(this, "DashboardService");
|
|
@@ -304,13 +609,13 @@ var DashboardService = class {
|
|
|
304
609
|
});
|
|
305
610
|
}
|
|
306
611
|
};
|
|
307
|
-
DashboardService =
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
612
|
+
DashboardService = _ts_decorate2([
|
|
613
|
+
Injectable2(),
|
|
614
|
+
_ts_param2(1, Optional()),
|
|
615
|
+
_ts_param2(1, Inject2(STATE_STORE_CANONICAL)),
|
|
616
|
+
_ts_param2(2, Optional()),
|
|
617
|
+
_ts_metadata2("design:type", Function),
|
|
618
|
+
_ts_metadata2("design:paramtypes", [
|
|
314
619
|
typeof RunGateway === "undefined" ? Object : RunGateway,
|
|
315
620
|
typeof StateStore === "undefined" ? Object : StateStore,
|
|
316
621
|
typeof WorkflowEngine === "undefined" ? Object : WorkflowEngine
|
|
@@ -319,7 +624,7 @@ DashboardService = _ts_decorate([
|
|
|
319
624
|
|
|
320
625
|
// src/server/durable-api.controller.ts
|
|
321
626
|
import { ApplyFilter, ApplyFilterInterceptor, FilterRunner } from "@dudousxd/nestjs-filter";
|
|
322
|
-
import { BadRequestException as BadRequestException2, Body, Controller, Get, Header, Headers, NotFoundException, NotImplementedException, Param, Post, Query, Res, Sse, UseFilters, UseInterceptors } from "@nestjs/common";
|
|
627
|
+
import { BadRequestException as BadRequestException2, Body, Controller, Get, Header, Headers, NotFoundException, NotImplementedException, Param, Post, Query, Res, Sse, UseFilters as UseFilters2, UseInterceptors } from "@nestjs/common";
|
|
323
628
|
|
|
324
629
|
// src/server/durable-run.ts
|
|
325
630
|
var DurableRun = class {
|
|
@@ -395,8 +700,8 @@ function runValueAxisFor(field) {
|
|
|
395
700
|
__name(runValueAxisFor, "runValueAxisFor");
|
|
396
701
|
|
|
397
702
|
// src/server/not-modified.ts
|
|
398
|
-
import { Catch, HttpException } from "@nestjs/common";
|
|
399
|
-
function
|
|
703
|
+
import { Catch as Catch2, HttpException as HttpException2 } from "@nestjs/common";
|
|
704
|
+
function _ts_decorate3(decorators, target, key, desc) {
|
|
400
705
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
401
706
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
402
707
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -409,7 +714,7 @@ function _ts_decorate2(decorators, target, key, desc) {
|
|
|
409
714
|
}
|
|
410
715
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
411
716
|
}
|
|
412
|
-
__name(
|
|
717
|
+
__name(_ts_decorate3, "_ts_decorate");
|
|
413
718
|
function isRawResponse(value) {
|
|
414
719
|
if (typeof value !== "object" || value === null) return false;
|
|
415
720
|
const candidate = value;
|
|
@@ -435,7 +740,7 @@ function writeNotModifiedRaw(response, etag) {
|
|
|
435
740
|
raw.end();
|
|
436
741
|
}
|
|
437
742
|
__name(writeNotModifiedRaw, "writeNotModifiedRaw");
|
|
438
|
-
var NotModifiedException = class extends
|
|
743
|
+
var NotModifiedException = class extends HttpException2 {
|
|
439
744
|
static {
|
|
440
745
|
__name(this, "NotModifiedException");
|
|
441
746
|
}
|
|
@@ -452,8 +757,8 @@ var NotModifiedFilter = class {
|
|
|
452
757
|
writeNotModifiedRaw(host.switchToHttp().getResponse(), exception.etag);
|
|
453
758
|
}
|
|
454
759
|
};
|
|
455
|
-
NotModifiedFilter =
|
|
456
|
-
|
|
760
|
+
NotModifiedFilter = _ts_decorate3([
|
|
761
|
+
Catch2(NotModifiedException)
|
|
457
762
|
], NotModifiedFilter);
|
|
458
763
|
function setEtag(response, etag) {
|
|
459
764
|
setRawHeader(response, "etag", etag);
|
|
@@ -470,7 +775,7 @@ __name(toRunListRow, "toRunListRow");
|
|
|
470
775
|
|
|
471
776
|
// src/server/run.filter.ts
|
|
472
777
|
import { BaseFilter, FilterFor, Filterable } from "@dudousxd/nestjs-filter";
|
|
473
|
-
import { Injectable as
|
|
778
|
+
import { Injectable as Injectable4 } from "@nestjs/common";
|
|
474
779
|
|
|
475
780
|
// src/server/attr-filter.ts
|
|
476
781
|
var SCALAR_OPS = /* @__PURE__ */ new Set([
|
|
@@ -521,7 +826,7 @@ __name(parseAttrFilters, "parseAttrFilters");
|
|
|
521
826
|
|
|
522
827
|
// src/server/run-query.adapter.ts
|
|
523
828
|
import { RUN_VALUE_FACET_LIMIT, RunGateway as RunGateway2 } from "@dudousxd/nestjs-durable-core";
|
|
524
|
-
import { BadRequestException, Injectable as
|
|
829
|
+
import { BadRequestException, Injectable as Injectable3 } from "@nestjs/common";
|
|
525
830
|
|
|
526
831
|
// src/server/run-query-draft.ts
|
|
527
832
|
var RunQueryDraft2 = class {
|
|
@@ -551,7 +856,7 @@ var RunQueryDraft2 = class {
|
|
|
551
856
|
};
|
|
552
857
|
|
|
553
858
|
// src/server/run-query.adapter.ts
|
|
554
|
-
function
|
|
859
|
+
function _ts_decorate4(decorators, target, key, desc) {
|
|
555
860
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
556
861
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
557
862
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -564,13 +869,13 @@ function _ts_decorate3(decorators, target, key, desc) {
|
|
|
564
869
|
}
|
|
565
870
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
566
871
|
}
|
|
567
|
-
__name(
|
|
568
|
-
function
|
|
872
|
+
__name(_ts_decorate4, "_ts_decorate");
|
|
873
|
+
function _ts_metadata3(metadataKey, metadataValue) {
|
|
569
874
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
570
875
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
571
876
|
}
|
|
572
877
|
}
|
|
573
|
-
__name(
|
|
878
|
+
__name(_ts_metadata3, "_ts_metadata");
|
|
574
879
|
var RUN_QUERY_ADAPTER = Symbol("DURABLE_RUN_QUERY_ADAPTER");
|
|
575
880
|
var FIXED_ORDER = {
|
|
576
881
|
field: "createdAt",
|
|
@@ -844,16 +1149,16 @@ var RunQueryAdapter = class {
|
|
|
844
1149
|
}
|
|
845
1150
|
}
|
|
846
1151
|
};
|
|
847
|
-
RunQueryAdapter =
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
1152
|
+
RunQueryAdapter = _ts_decorate4([
|
|
1153
|
+
Injectable3(),
|
|
1154
|
+
_ts_metadata3("design:type", Function),
|
|
1155
|
+
_ts_metadata3("design:paramtypes", [
|
|
851
1156
|
typeof RunGateway2 === "undefined" ? Object : RunGateway2
|
|
852
1157
|
])
|
|
853
1158
|
], RunQueryAdapter);
|
|
854
1159
|
|
|
855
1160
|
// src/server/run.filter.ts
|
|
856
|
-
function
|
|
1161
|
+
function _ts_decorate5(decorators, target, key, desc) {
|
|
857
1162
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
858
1163
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
859
1164
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -866,13 +1171,13 @@ function _ts_decorate4(decorators, target, key, desc) {
|
|
|
866
1171
|
}
|
|
867
1172
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
868
1173
|
}
|
|
869
|
-
__name(
|
|
870
|
-
function
|
|
1174
|
+
__name(_ts_decorate5, "_ts_decorate");
|
|
1175
|
+
function _ts_metadata4(metadataKey, metadataValue) {
|
|
871
1176
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
872
1177
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
873
1178
|
}
|
|
874
1179
|
}
|
|
875
|
-
__name(
|
|
1180
|
+
__name(_ts_metadata4, "_ts_metadata");
|
|
876
1181
|
function list(value) {
|
|
877
1182
|
return (Array.isArray(value) ? value : [
|
|
878
1183
|
value
|
|
@@ -992,76 +1297,76 @@ var RunFilter = class extends BaseFilter {
|
|
|
992
1297
|
});
|
|
993
1298
|
}
|
|
994
1299
|
};
|
|
995
|
-
|
|
1300
|
+
_ts_decorate5([
|
|
996
1301
|
FilterFor("status"),
|
|
997
|
-
|
|
998
|
-
|
|
1302
|
+
_ts_metadata4("design:type", Function),
|
|
1303
|
+
_ts_metadata4("design:paramtypes", [
|
|
999
1304
|
Object
|
|
1000
1305
|
]),
|
|
1001
|
-
|
|
1306
|
+
_ts_metadata4("design:returntype", void 0)
|
|
1002
1307
|
], RunFilter.prototype, "applyStatus", null);
|
|
1003
|
-
|
|
1308
|
+
_ts_decorate5([
|
|
1004
1309
|
FilterFor("workflow"),
|
|
1005
|
-
|
|
1006
|
-
|
|
1310
|
+
_ts_metadata4("design:type", Function),
|
|
1311
|
+
_ts_metadata4("design:paramtypes", [
|
|
1007
1312
|
Object
|
|
1008
1313
|
]),
|
|
1009
|
-
|
|
1314
|
+
_ts_metadata4("design:returntype", void 0)
|
|
1010
1315
|
], RunFilter.prototype, "applyWorkflow", null);
|
|
1011
|
-
|
|
1316
|
+
_ts_decorate5([
|
|
1012
1317
|
FilterFor("namespace"),
|
|
1013
|
-
|
|
1014
|
-
|
|
1318
|
+
_ts_metadata4("design:type", Function),
|
|
1319
|
+
_ts_metadata4("design:paramtypes", [
|
|
1015
1320
|
Object
|
|
1016
1321
|
]),
|
|
1017
|
-
|
|
1322
|
+
_ts_metadata4("design:returntype", void 0)
|
|
1018
1323
|
], RunFilter.prototype, "applyNamespace", null);
|
|
1019
|
-
|
|
1324
|
+
_ts_decorate5([
|
|
1020
1325
|
FilterFor("tag"),
|
|
1021
|
-
|
|
1022
|
-
|
|
1326
|
+
_ts_metadata4("design:type", Function),
|
|
1327
|
+
_ts_metadata4("design:paramtypes", [
|
|
1023
1328
|
Object
|
|
1024
1329
|
]),
|
|
1025
|
-
|
|
1330
|
+
_ts_metadata4("design:returntype", void 0)
|
|
1026
1331
|
], RunFilter.prototype, "applyTag", null);
|
|
1027
|
-
|
|
1332
|
+
_ts_decorate5([
|
|
1028
1333
|
FilterFor("origin"),
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1334
|
+
_ts_metadata4("design:type", Function),
|
|
1335
|
+
_ts_metadata4("design:paramtypes", []),
|
|
1336
|
+
_ts_metadata4("design:returntype", void 0)
|
|
1032
1337
|
], RunFilter.prototype, "applyOrigin", null);
|
|
1033
|
-
|
|
1338
|
+
_ts_decorate5([
|
|
1034
1339
|
FilterFor("unattributed"),
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1340
|
+
_ts_metadata4("design:type", Function),
|
|
1341
|
+
_ts_metadata4("design:paramtypes", []),
|
|
1342
|
+
_ts_metadata4("design:returntype", void 0)
|
|
1038
1343
|
], RunFilter.prototype, "applyUnattributed", null);
|
|
1039
|
-
|
|
1344
|
+
_ts_decorate5([
|
|
1040
1345
|
FilterFor("attr"),
|
|
1041
|
-
|
|
1042
|
-
|
|
1346
|
+
_ts_metadata4("design:type", Function),
|
|
1347
|
+
_ts_metadata4("design:paramtypes", [
|
|
1043
1348
|
Object
|
|
1044
1349
|
]),
|
|
1045
|
-
|
|
1350
|
+
_ts_metadata4("design:returntype", void 0)
|
|
1046
1351
|
], RunFilter.prototype, "applyAttributes", null);
|
|
1047
|
-
|
|
1352
|
+
_ts_decorate5([
|
|
1048
1353
|
FilterFor("limit"),
|
|
1049
|
-
|
|
1050
|
-
|
|
1354
|
+
_ts_metadata4("design:type", Function),
|
|
1355
|
+
_ts_metadata4("design:paramtypes", [
|
|
1051
1356
|
Object
|
|
1052
1357
|
]),
|
|
1053
|
-
|
|
1358
|
+
_ts_metadata4("design:returntype", void 0)
|
|
1054
1359
|
], RunFilter.prototype, "applyLimit", null);
|
|
1055
|
-
|
|
1360
|
+
_ts_decorate5([
|
|
1056
1361
|
FilterFor("offset"),
|
|
1057
|
-
|
|
1058
|
-
|
|
1362
|
+
_ts_metadata4("design:type", Function),
|
|
1363
|
+
_ts_metadata4("design:paramtypes", [
|
|
1059
1364
|
Object
|
|
1060
1365
|
]),
|
|
1061
|
-
|
|
1366
|
+
_ts_metadata4("design:returntype", void 0)
|
|
1062
1367
|
], RunFilter.prototype, "applyOffset", null);
|
|
1063
|
-
RunFilter =
|
|
1064
|
-
|
|
1368
|
+
RunFilter = _ts_decorate5([
|
|
1369
|
+
Injectable4(),
|
|
1065
1370
|
Filterable({
|
|
1066
1371
|
entity: DurableRun,
|
|
1067
1372
|
adapter: RUN_QUERY_ADAPTER,
|
|
@@ -1070,7 +1375,7 @@ RunFilter = _ts_decorate4([
|
|
|
1070
1375
|
], RunFilter);
|
|
1071
1376
|
|
|
1072
1377
|
// src/server/durable-api.controller.ts
|
|
1073
|
-
function
|
|
1378
|
+
function _ts_decorate6(decorators, target, key, desc) {
|
|
1074
1379
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1075
1380
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
1076
1381
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1083,19 +1388,19 @@ function _ts_decorate5(decorators, target, key, desc) {
|
|
|
1083
1388
|
}
|
|
1084
1389
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1085
1390
|
}
|
|
1086
|
-
__name(
|
|
1087
|
-
function
|
|
1391
|
+
__name(_ts_decorate6, "_ts_decorate");
|
|
1392
|
+
function _ts_metadata5(metadataKey, metadataValue) {
|
|
1088
1393
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
1089
1394
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
1090
1395
|
}
|
|
1091
1396
|
}
|
|
1092
|
-
__name(
|
|
1093
|
-
function
|
|
1397
|
+
__name(_ts_metadata5, "_ts_metadata");
|
|
1398
|
+
function _ts_param3(paramIndex, decorator) {
|
|
1094
1399
|
return function(target, key) {
|
|
1095
1400
|
decorator(target, key, paramIndex);
|
|
1096
1401
|
};
|
|
1097
1402
|
}
|
|
1098
|
-
__name(
|
|
1403
|
+
__name(_ts_param3, "_ts_param");
|
|
1099
1404
|
var FAN_INLINE_MAX = 50;
|
|
1100
1405
|
var DurableApiControllerBase = class {
|
|
1101
1406
|
static {
|
|
@@ -1328,135 +1633,135 @@ var DurableApiControllerBase = class {
|
|
|
1328
1633
|
return this.dashboard.update(id, name, body);
|
|
1329
1634
|
}
|
|
1330
1635
|
};
|
|
1331
|
-
|
|
1636
|
+
_ts_decorate6([
|
|
1332
1637
|
Get("runs"),
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1638
|
+
_ts_param3(0, ApplyFilter(RunFilter)),
|
|
1639
|
+
_ts_metadata5("design:type", Function),
|
|
1640
|
+
_ts_metadata5("design:paramtypes", [
|
|
1336
1641
|
typeof RunQueryDraft === "undefined" ? Object : RunQueryDraft
|
|
1337
1642
|
]),
|
|
1338
|
-
|
|
1643
|
+
_ts_metadata5("design:returntype", Promise)
|
|
1339
1644
|
], DurableApiControllerBase.prototype, "runs", null);
|
|
1340
|
-
|
|
1645
|
+
_ts_decorate6([
|
|
1341
1646
|
Get("runs/facets"),
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1647
|
+
_ts_param3(0, ApplyFilter(RunFilter)),
|
|
1648
|
+
_ts_metadata5("design:type", Function),
|
|
1649
|
+
_ts_metadata5("design:paramtypes", [
|
|
1345
1650
|
typeof RunQueryDraft === "undefined" ? Object : RunQueryDraft
|
|
1346
1651
|
]),
|
|
1347
|
-
|
|
1652
|
+
_ts_metadata5("design:returntype", void 0)
|
|
1348
1653
|
], DurableApiControllerBase.prototype, "facets", null);
|
|
1349
|
-
|
|
1654
|
+
_ts_decorate6([
|
|
1350
1655
|
Get("runs/values"),
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1656
|
+
_ts_param3(0, Query()),
|
|
1657
|
+
_ts_metadata5("design:type", Function),
|
|
1658
|
+
_ts_metadata5("design:paramtypes", [
|
|
1354
1659
|
typeof Record === "undefined" ? Object : Record
|
|
1355
1660
|
]),
|
|
1356
|
-
|
|
1661
|
+
_ts_metadata5("design:returntype", void 0)
|
|
1357
1662
|
], DurableApiControllerBase.prototype, "values", null);
|
|
1358
|
-
|
|
1663
|
+
_ts_decorate6([
|
|
1359
1664
|
Get("metrics"),
|
|
1360
1665
|
Header("Content-Type", "text/plain; version=0.0.4"),
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1666
|
+
_ts_metadata5("design:type", Function),
|
|
1667
|
+
_ts_metadata5("design:paramtypes", []),
|
|
1668
|
+
_ts_metadata5("design:returntype", void 0)
|
|
1364
1669
|
], DurableApiControllerBase.prototype, "metrics", null);
|
|
1365
|
-
|
|
1670
|
+
_ts_decorate6([
|
|
1366
1671
|
Get("workers"),
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1672
|
+
_ts_metadata5("design:type", Function),
|
|
1673
|
+
_ts_metadata5("design:paramtypes", []),
|
|
1674
|
+
_ts_metadata5("design:returntype", void 0)
|
|
1370
1675
|
], DurableApiControllerBase.prototype, "workers", null);
|
|
1371
|
-
|
|
1676
|
+
_ts_decorate6([
|
|
1372
1677
|
Get("schedules"),
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1678
|
+
_ts_param3(0, Query("namespace")),
|
|
1679
|
+
_ts_param3(1, Query("workflow")),
|
|
1680
|
+
_ts_param3(2, Query("tag")),
|
|
1681
|
+
_ts_param3(3, Query("paused")),
|
|
1682
|
+
_ts_param3(4, Query("limit")),
|
|
1683
|
+
_ts_metadata5("design:type", Function),
|
|
1684
|
+
_ts_metadata5("design:paramtypes", [
|
|
1380
1685
|
String,
|
|
1381
1686
|
String,
|
|
1382
1687
|
String,
|
|
1383
1688
|
String,
|
|
1384
1689
|
String
|
|
1385
1690
|
]),
|
|
1386
|
-
|
|
1691
|
+
_ts_metadata5("design:returntype", void 0)
|
|
1387
1692
|
], DurableApiControllerBase.prototype, "schedules", null);
|
|
1388
|
-
|
|
1693
|
+
_ts_decorate6([
|
|
1389
1694
|
Post("schedules/:id/pause"),
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1695
|
+
_ts_param3(0, Param("id")),
|
|
1696
|
+
_ts_metadata5("design:type", Function),
|
|
1697
|
+
_ts_metadata5("design:paramtypes", [
|
|
1393
1698
|
String
|
|
1394
1699
|
]),
|
|
1395
|
-
|
|
1700
|
+
_ts_metadata5("design:returntype", void 0)
|
|
1396
1701
|
], DurableApiControllerBase.prototype, "pauseSchedule", null);
|
|
1397
|
-
|
|
1702
|
+
_ts_decorate6([
|
|
1398
1703
|
Post("schedules/:id/resume"),
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1704
|
+
_ts_param3(0, Param("id")),
|
|
1705
|
+
_ts_metadata5("design:type", Function),
|
|
1706
|
+
_ts_metadata5("design:paramtypes", [
|
|
1402
1707
|
String
|
|
1403
1708
|
]),
|
|
1404
|
-
|
|
1709
|
+
_ts_metadata5("design:returntype", void 0)
|
|
1405
1710
|
], DurableApiControllerBase.prototype, "resumeSchedule", null);
|
|
1406
|
-
|
|
1711
|
+
_ts_decorate6([
|
|
1407
1712
|
Post("schedules/:id/trigger"),
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1713
|
+
_ts_param3(0, Param("id")),
|
|
1714
|
+
_ts_metadata5("design:type", Function),
|
|
1715
|
+
_ts_metadata5("design:paramtypes", [
|
|
1411
1716
|
String
|
|
1412
1717
|
]),
|
|
1413
|
-
|
|
1718
|
+
_ts_metadata5("design:returntype", void 0)
|
|
1414
1719
|
], DurableApiControllerBase.prototype, "triggerSchedule", null);
|
|
1415
|
-
|
|
1720
|
+
_ts_decorate6([
|
|
1416
1721
|
Get("workflows/:name/lifecycle"),
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1722
|
+
_ts_param3(0, Param("name")),
|
|
1723
|
+
_ts_metadata5("design:type", Function),
|
|
1724
|
+
_ts_metadata5("design:paramtypes", [
|
|
1420
1725
|
String
|
|
1421
1726
|
]),
|
|
1422
|
-
|
|
1727
|
+
_ts_metadata5("design:returntype", Promise)
|
|
1423
1728
|
], DurableApiControllerBase.prototype, "workflowLifecycle", null);
|
|
1424
|
-
|
|
1729
|
+
_ts_decorate6([
|
|
1425
1730
|
Get("topology"),
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1731
|
+
_ts_metadata5("design:type", Function),
|
|
1732
|
+
_ts_metadata5("design:paramtypes", []),
|
|
1733
|
+
_ts_metadata5("design:returntype", void 0)
|
|
1429
1734
|
], DurableApiControllerBase.prototype, "topology", null);
|
|
1430
|
-
|
|
1735
|
+
_ts_decorate6([
|
|
1431
1736
|
Get("runs/:id"),
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1737
|
+
_ts_param3(0, Param("id")),
|
|
1738
|
+
_ts_param3(1, Query("full")),
|
|
1739
|
+
_ts_param3(2, Headers("if-none-match")),
|
|
1740
|
+
_ts_param3(3, Res({
|
|
1436
1741
|
passthrough: true
|
|
1437
1742
|
})),
|
|
1438
|
-
|
|
1439
|
-
|
|
1743
|
+
_ts_metadata5("design:type", Function),
|
|
1744
|
+
_ts_metadata5("design:paramtypes", [
|
|
1440
1745
|
String,
|
|
1441
1746
|
String,
|
|
1442
1747
|
String,
|
|
1443
1748
|
Object
|
|
1444
1749
|
]),
|
|
1445
|
-
|
|
1750
|
+
_ts_metadata5("design:returntype", Promise)
|
|
1446
1751
|
], DurableApiControllerBase.prototype, "run", null);
|
|
1447
|
-
|
|
1752
|
+
_ts_decorate6([
|
|
1448
1753
|
Get("runs/:id/fans/:group"),
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1754
|
+
_ts_param3(0, Param("id")),
|
|
1755
|
+
_ts_param3(1, Param("group")),
|
|
1756
|
+
_ts_param3(2, Query("offset")),
|
|
1757
|
+
_ts_param3(3, Query("limit")),
|
|
1758
|
+
_ts_param3(4, Query("failed")),
|
|
1759
|
+
_ts_param3(5, Headers("if-none-match")),
|
|
1760
|
+
_ts_param3(6, Res({
|
|
1456
1761
|
passthrough: true
|
|
1457
1762
|
})),
|
|
1458
|
-
|
|
1459
|
-
|
|
1763
|
+
_ts_metadata5("design:type", Function),
|
|
1764
|
+
_ts_metadata5("design:paramtypes", [
|
|
1460
1765
|
String,
|
|
1461
1766
|
String,
|
|
1462
1767
|
String,
|
|
@@ -1465,131 +1770,131 @@ _ts_decorate5([
|
|
|
1465
1770
|
String,
|
|
1466
1771
|
Object
|
|
1467
1772
|
]),
|
|
1468
|
-
|
|
1773
|
+
_ts_metadata5("design:returntype", Promise)
|
|
1469
1774
|
], DurableApiControllerBase.prototype, "fanMembers", null);
|
|
1470
|
-
|
|
1775
|
+
_ts_decorate6([
|
|
1471
1776
|
Sse("runs/:id/stream"),
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1777
|
+
_ts_param3(0, Param("id")),
|
|
1778
|
+
_ts_metadata5("design:type", Function),
|
|
1779
|
+
_ts_metadata5("design:paramtypes", [
|
|
1475
1780
|
String
|
|
1476
1781
|
]),
|
|
1477
|
-
|
|
1782
|
+
_ts_metadata5("design:returntype", void 0)
|
|
1478
1783
|
], DurableApiControllerBase.prototype, "stream", null);
|
|
1479
|
-
|
|
1784
|
+
_ts_decorate6([
|
|
1480
1785
|
Post("runs/:id/retry"),
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1786
|
+
_ts_param3(0, Param("id")),
|
|
1787
|
+
_ts_metadata5("design:type", Function),
|
|
1788
|
+
_ts_metadata5("design:paramtypes", [
|
|
1484
1789
|
String
|
|
1485
1790
|
]),
|
|
1486
|
-
|
|
1791
|
+
_ts_metadata5("design:returntype", void 0)
|
|
1487
1792
|
], DurableApiControllerBase.prototype, "retry", null);
|
|
1488
|
-
|
|
1793
|
+
_ts_decorate6([
|
|
1489
1794
|
Post("runs/:id/retry-with-input"),
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1795
|
+
_ts_param3(0, Param("id")),
|
|
1796
|
+
_ts_param3(1, Body()),
|
|
1797
|
+
_ts_metadata5("design:type", Function),
|
|
1798
|
+
_ts_metadata5("design:paramtypes", [
|
|
1494
1799
|
String,
|
|
1495
1800
|
Object
|
|
1496
1801
|
]),
|
|
1497
|
-
|
|
1802
|
+
_ts_metadata5("design:returntype", void 0)
|
|
1498
1803
|
], DurableApiControllerBase.prototype, "retryWithInput", null);
|
|
1499
|
-
|
|
1804
|
+
_ts_decorate6([
|
|
1500
1805
|
Post("bulk/:action"),
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1806
|
+
_ts_param3(0, Param("action")),
|
|
1807
|
+
_ts_param3(1, ApplyFilter(RunFilter)),
|
|
1808
|
+
_ts_param3(2, Query("compensate")),
|
|
1809
|
+
_ts_metadata5("design:type", Function),
|
|
1810
|
+
_ts_metadata5("design:paramtypes", [
|
|
1506
1811
|
String,
|
|
1507
1812
|
typeof RunQueryDraft === "undefined" ? Object : RunQueryDraft,
|
|
1508
1813
|
String
|
|
1509
1814
|
]),
|
|
1510
|
-
|
|
1815
|
+
_ts_metadata5("design:returntype", void 0)
|
|
1511
1816
|
], DurableApiControllerBase.prototype, "bulk", null);
|
|
1512
|
-
|
|
1817
|
+
_ts_decorate6([
|
|
1513
1818
|
Post("runs/:id/cancel"),
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1819
|
+
_ts_param3(0, Param("id")),
|
|
1820
|
+
_ts_param3(1, Query("compensate")),
|
|
1821
|
+
_ts_metadata5("design:type", Function),
|
|
1822
|
+
_ts_metadata5("design:paramtypes", [
|
|
1518
1823
|
String,
|
|
1519
1824
|
String
|
|
1520
1825
|
]),
|
|
1521
|
-
|
|
1826
|
+
_ts_metadata5("design:returntype", Promise)
|
|
1522
1827
|
], DurableApiControllerBase.prototype, "cancel", null);
|
|
1523
|
-
|
|
1828
|
+
_ts_decorate6([
|
|
1524
1829
|
Post("runs/:id/republish-lifecycle"),
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1830
|
+
_ts_param3(0, Param("id")),
|
|
1831
|
+
_ts_param3(1, Body()),
|
|
1832
|
+
_ts_metadata5("design:type", Function),
|
|
1833
|
+
_ts_metadata5("design:paramtypes", [
|
|
1529
1834
|
String,
|
|
1530
1835
|
Object
|
|
1531
1836
|
]),
|
|
1532
|
-
|
|
1837
|
+
_ts_metadata5("design:returntype", Promise)
|
|
1533
1838
|
], DurableApiControllerBase.prototype, "republishLifecycle", null);
|
|
1534
|
-
|
|
1839
|
+
_ts_decorate6([
|
|
1535
1840
|
Post("runs/:id/continue"),
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1841
|
+
_ts_param3(0, Param("id")),
|
|
1842
|
+
_ts_metadata5("design:type", Function),
|
|
1843
|
+
_ts_metadata5("design:paramtypes", [
|
|
1539
1844
|
String
|
|
1540
1845
|
]),
|
|
1541
|
-
|
|
1846
|
+
_ts_metadata5("design:returntype", Promise)
|
|
1542
1847
|
], DurableApiControllerBase.prototype, "continue", null);
|
|
1543
|
-
|
|
1848
|
+
_ts_decorate6([
|
|
1544
1849
|
Post("runs/:id/redispatch"),
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1850
|
+
_ts_param3(0, Param("id")),
|
|
1851
|
+
_ts_metadata5("design:type", Function),
|
|
1852
|
+
_ts_metadata5("design:paramtypes", [
|
|
1548
1853
|
String
|
|
1549
1854
|
]),
|
|
1550
|
-
|
|
1855
|
+
_ts_metadata5("design:returntype", Promise)
|
|
1551
1856
|
], DurableApiControllerBase.prototype, "redispatch", null);
|
|
1552
|
-
|
|
1857
|
+
_ts_decorate6([
|
|
1553
1858
|
Post("webhooks/:token"),
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1859
|
+
_ts_param3(0, Param("token")),
|
|
1860
|
+
_ts_param3(1, Body()),
|
|
1861
|
+
_ts_metadata5("design:type", Function),
|
|
1862
|
+
_ts_metadata5("design:paramtypes", [
|
|
1558
1863
|
String,
|
|
1559
1864
|
Object
|
|
1560
1865
|
]),
|
|
1561
|
-
|
|
1866
|
+
_ts_metadata5("design:returntype", Promise)
|
|
1562
1867
|
], DurableApiControllerBase.prototype, "webhook", null);
|
|
1563
|
-
|
|
1868
|
+
_ts_decorate6([
|
|
1564
1869
|
Get("runs/:id/events/:key"),
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1870
|
+
_ts_param3(0, Param("id")),
|
|
1871
|
+
_ts_param3(1, Param("key")),
|
|
1872
|
+
_ts_metadata5("design:type", Function),
|
|
1873
|
+
_ts_metadata5("design:paramtypes", [
|
|
1569
1874
|
String,
|
|
1570
1875
|
String
|
|
1571
1876
|
]),
|
|
1572
|
-
|
|
1877
|
+
_ts_metadata5("design:returntype", void 0)
|
|
1573
1878
|
], DurableApiControllerBase.prototype, "event", null);
|
|
1574
|
-
|
|
1879
|
+
_ts_decorate6([
|
|
1575
1880
|
Post("runs/:id/updates/:name"),
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1881
|
+
_ts_param3(0, Param("id")),
|
|
1882
|
+
_ts_param3(1, Param("name")),
|
|
1883
|
+
_ts_param3(2, Body()),
|
|
1884
|
+
_ts_metadata5("design:type", Function),
|
|
1885
|
+
_ts_metadata5("design:paramtypes", [
|
|
1581
1886
|
String,
|
|
1582
1887
|
String,
|
|
1583
1888
|
Object
|
|
1584
1889
|
]),
|
|
1585
|
-
|
|
1890
|
+
_ts_metadata5("design:returntype", void 0)
|
|
1586
1891
|
], DurableApiControllerBase.prototype, "update", null);
|
|
1587
|
-
DurableApiControllerBase =
|
|
1892
|
+
DurableApiControllerBase = _ts_decorate6([
|
|
1588
1893
|
Controller(),
|
|
1589
1894
|
UseInterceptors(ApplyFilterInterceptor),
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1895
|
+
UseFilters2(NotModifiedFilter),
|
|
1896
|
+
_ts_metadata5("design:type", Function),
|
|
1897
|
+
_ts_metadata5("design:paramtypes", [
|
|
1593
1898
|
typeof DashboardService === "undefined" ? Object : DashboardService,
|
|
1594
1899
|
typeof FilterRunner === "undefined" ? Object : FilterRunner
|
|
1595
1900
|
])
|
|
@@ -1613,14 +1918,14 @@ var DurableApiController = class extends DurableApiControllerBase {
|
|
|
1613
1918
|
__name(this, "DurableApiController");
|
|
1614
1919
|
}
|
|
1615
1920
|
};
|
|
1616
|
-
DurableApiController =
|
|
1921
|
+
DurableApiController = _ts_decorate6([
|
|
1617
1922
|
Controller()
|
|
1618
1923
|
], DurableApiController);
|
|
1619
1924
|
|
|
1620
1925
|
// src/server/durable-dashboard.module.ts
|
|
1621
1926
|
import "reflect-metadata";
|
|
1622
1927
|
import { ApplyFilterInterceptor as ApplyFilterInterceptor2, FilterRunner as FilterRunner2 } from "@dudousxd/nestjs-filter";
|
|
1623
|
-
import {
|
|
1928
|
+
import { Module } from "@nestjs/common";
|
|
1624
1929
|
import { ModuleRef, RouterModule } from "@nestjs/core";
|
|
1625
1930
|
|
|
1626
1931
|
// src/server/controller-decorators.ts
|
|
@@ -1653,8 +1958,8 @@ __name(controllerFor, "controllerFor");
|
|
|
1653
1958
|
import { existsSync, readFileSync } from "node:fs";
|
|
1654
1959
|
import { basename, extname, join, resolve, sep } from "node:path";
|
|
1655
1960
|
import { fileURLToPath } from "node:url";
|
|
1656
|
-
import { Controller as Controller2, Get as Get2, Header as Header2, Inject as
|
|
1657
|
-
function
|
|
1961
|
+
import { Controller as Controller2, Get as Get2, Header as Header2, Inject as Inject3, NotFoundException as NotFoundException2, Param as Param2, StreamableFile } from "@nestjs/common";
|
|
1962
|
+
function _ts_decorate7(decorators, target, key, desc) {
|
|
1658
1963
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1659
1964
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
1660
1965
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1667,19 +1972,19 @@ function _ts_decorate6(decorators, target, key, desc) {
|
|
|
1667
1972
|
}
|
|
1668
1973
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1669
1974
|
}
|
|
1670
|
-
__name(
|
|
1671
|
-
function
|
|
1975
|
+
__name(_ts_decorate7, "_ts_decorate");
|
|
1976
|
+
function _ts_metadata6(metadataKey, metadataValue) {
|
|
1672
1977
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
1673
1978
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
1674
1979
|
}
|
|
1675
1980
|
}
|
|
1676
|
-
__name(
|
|
1677
|
-
function
|
|
1981
|
+
__name(_ts_metadata6, "_ts_metadata");
|
|
1982
|
+
function _ts_param4(paramIndex, decorator) {
|
|
1678
1983
|
return function(target, key) {
|
|
1679
1984
|
decorator(target, key, paramIndex);
|
|
1680
1985
|
};
|
|
1681
1986
|
}
|
|
1682
|
-
__name(
|
|
1987
|
+
__name(_ts_param4, "_ts_param");
|
|
1683
1988
|
var DASHBOARD_BASE_PATH = Symbol("DASHBOARD_BASE_PATH");
|
|
1684
1989
|
var DASHBOARD_API_PATH = Symbol("DASHBOARD_API_PATH");
|
|
1685
1990
|
var BUILD_BASE = "/durable";
|
|
@@ -1732,30 +2037,31 @@ var DurableUiControllerBase = class {
|
|
|
1732
2037
|
});
|
|
1733
2038
|
}
|
|
1734
2039
|
};
|
|
1735
|
-
|
|
2040
|
+
_ts_decorate7([
|
|
1736
2041
|
Get2(),
|
|
1737
2042
|
Header2("Content-Type", "text/html; charset=utf-8"),
|
|
1738
2043
|
Header2("Cache-Control", "no-store, must-revalidate"),
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
2044
|
+
_ts_metadata6("design:type", Function),
|
|
2045
|
+
_ts_metadata6("design:paramtypes", []),
|
|
2046
|
+
_ts_metadata6("design:returntype", String)
|
|
1742
2047
|
], DurableUiControllerBase.prototype, "index", null);
|
|
1743
|
-
|
|
2048
|
+
_ts_decorate7([
|
|
1744
2049
|
Get2("assets/:file"),
|
|
1745
2050
|
Header2("Cache-Control", "public, max-age=31536000, immutable"),
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
2051
|
+
_ts_param4(0, Param2("file")),
|
|
2052
|
+
_ts_metadata6("design:type", Function),
|
|
2053
|
+
_ts_metadata6("design:paramtypes", [
|
|
1749
2054
|
String
|
|
1750
2055
|
]),
|
|
1751
|
-
|
|
2056
|
+
_ts_metadata6("design:returntype", typeof StreamableFile === "undefined" ? Object : StreamableFile)
|
|
1752
2057
|
], DurableUiControllerBase.prototype, "asset", null);
|
|
1753
|
-
DurableUiControllerBase =
|
|
2058
|
+
DurableUiControllerBase = _ts_decorate7([
|
|
1754
2059
|
Controller2(),
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
2060
|
+
ConsolePage(),
|
|
2061
|
+
_ts_param4(0, Inject3(DASHBOARD_BASE_PATH)),
|
|
2062
|
+
_ts_param4(1, Inject3(DASHBOARD_API_PATH)),
|
|
2063
|
+
_ts_metadata6("design:type", Function),
|
|
2064
|
+
_ts_metadata6("design:paramtypes", [
|
|
1759
2065
|
String,
|
|
1760
2066
|
String
|
|
1761
2067
|
])
|
|
@@ -1765,12 +2071,12 @@ var DurableUiController = class extends DurableUiControllerBase {
|
|
|
1765
2071
|
__name(this, "DurableUiController");
|
|
1766
2072
|
}
|
|
1767
2073
|
};
|
|
1768
|
-
DurableUiController =
|
|
2074
|
+
DurableUiController = _ts_decorate7([
|
|
1769
2075
|
Controller2()
|
|
1770
2076
|
], DurableUiController);
|
|
1771
2077
|
|
|
1772
2078
|
// src/server/durable-dashboard.module.ts
|
|
1773
|
-
function
|
|
2079
|
+
function _ts_decorate8(decorators, target, key, desc) {
|
|
1774
2080
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1775
2081
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
1776
2082
|
r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1783,31 +2089,9 @@ function _ts_decorate7(decorators, target, key, desc) {
|
|
|
1783
2089
|
}
|
|
1784
2090
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1785
2091
|
}
|
|
1786
|
-
__name(
|
|
2092
|
+
__name(_ts_decorate8, "_ts_decorate");
|
|
1787
2093
|
markOpenToAuthorization(DurableApiController);
|
|
1788
2094
|
markOpenToAuthorization(DurableUiController);
|
|
1789
|
-
var DASHBOARD_PROTECTION_CHECK = Symbol("DASHBOARD_PROTECTION_CHECK");
|
|
1790
|
-
var UNPROTECTED_CONSOLE_IN_PRODUCTION = [
|
|
1791
|
-
"DurableDashboardModule: NODE_ENV=production and the durable console is mounted with no",
|
|
1792
|
-
"protection, so the app refuses to boot. Protect it one of two ways:",
|
|
1793
|
-
"(1) decorators on the mounted console: DurableDashboardModule.forRoot({ decorators: [UseGuards(AuthenticationGuard), Can(ConsolePolicy, 'view')] });",
|
|
1794
|
-
"(2) mount it yourself: DurableDashboardModule.forRoot({ routes: false }) plus @Controller('durable') @UseGuards(AuthenticationGuard) @Can(ConsolePolicy, 'view') class ConsoleUi extends DurableUiControllerBase {} (and the same over DurableApiControllerBase at 'durable/api')."
|
|
1795
|
-
].join(" ");
|
|
1796
|
-
function isProduction() {
|
|
1797
|
-
return (process.env.NODE_ENV ?? "").trim().toLowerCase() === "production";
|
|
1798
|
-
}
|
|
1799
|
-
__name(isProduction, "isProduction");
|
|
1800
|
-
function protectionCheckProvider() {
|
|
1801
|
-
return {
|
|
1802
|
-
provide: DASHBOARD_PROTECTION_CHECK,
|
|
1803
|
-
useFactory: /* @__PURE__ */ __name(() => {
|
|
1804
|
-
if (isProduction()) throw new Error(UNPROTECTED_CONSOLE_IN_PRODUCTION);
|
|
1805
|
-
new Logger("DurableDashboard").warn("The durable console is mounted with no `decorators`, so it is served OPEN (retry/cancel included). That is refused when NODE_ENV=production: pass `decorators` (e.g. [UseGuards(AuthenticationGuard), Can(ConsolePolicy, 'view')]) or mount it yourself with `routes: false`.");
|
|
1806
|
-
return true;
|
|
1807
|
-
}, "useFactory")
|
|
1808
|
-
};
|
|
1809
|
-
}
|
|
1810
|
-
__name(protectionCheckProvider, "protectionCheckProvider");
|
|
1811
2095
|
function assertNothingToDecorate(options) {
|
|
1812
2096
|
if (options.decorators === void 0) return;
|
|
1813
2097
|
throw new Error([
|
|
@@ -1818,6 +2102,13 @@ function assertNothingToDecorate(options) {
|
|
|
1818
2102
|
].join(" "));
|
|
1819
2103
|
}
|
|
1820
2104
|
__name(assertNothingToDecorate, "assertNothingToDecorate");
|
|
2105
|
+
function consoleController(base, decorators) {
|
|
2106
|
+
return controllerFor(base, [
|
|
2107
|
+
...decorators ?? [],
|
|
2108
|
+
UseConsoleAuthorize()
|
|
2109
|
+
]);
|
|
2110
|
+
}
|
|
2111
|
+
__name(consoleController, "consoleController");
|
|
1821
2112
|
function normalize(path) {
|
|
1822
2113
|
return `/${path.replace(/^\/+|\/+$/g, "")}`;
|
|
1823
2114
|
}
|
|
@@ -1834,10 +2125,20 @@ var DurableApiModule = class _DurableApiModule {
|
|
|
1834
2125
|
...options.imports ?? []
|
|
1835
2126
|
],
|
|
1836
2127
|
controllers: routes ? [
|
|
1837
|
-
|
|
2128
|
+
consoleController(DurableApiController, options.decorators)
|
|
1838
2129
|
] : [],
|
|
1839
2130
|
providers: [
|
|
1840
2131
|
DashboardService,
|
|
2132
|
+
// Resolved at boot: a gate name without nestjs-authz, or a policy without
|
|
2133
|
+
// @nestjs/authorization, fails here rather than on the first request.
|
|
2134
|
+
{
|
|
2135
|
+
provide: CONSOLE_AUTHORIZE_DECIDE,
|
|
2136
|
+
// Also with `routes: false`: `@UseConsoleAuthorize()` still applies the production 403.
|
|
2137
|
+
useFactory: /* @__PURE__ */ __name((moduleRef) => resolveConsoleAuthorize(options.authorize, moduleRef), "useFactory"),
|
|
2138
|
+
inject: [
|
|
2139
|
+
ModuleRef
|
|
2140
|
+
]
|
|
2141
|
+
},
|
|
1841
2142
|
// `@dudousxd/nestjs-filter` is wired PRIVATELY here rather than through
|
|
1842
2143
|
// `FilterModule.forRoot()`, which is a global registration. A library calling that would
|
|
1843
2144
|
// fight the host app over one set of module options and register a second app-wide
|
|
@@ -1875,15 +2176,17 @@ var DurableApiModule = class _DurableApiModule {
|
|
|
1875
2176
|
// is only exported then: exporting it from a mounted console would shadow a host's own
|
|
1876
2177
|
// `FilterModule` runner in whatever module imports the dashboard.
|
|
1877
2178
|
exports: routes ? [
|
|
1878
|
-
DashboardService
|
|
2179
|
+
DashboardService,
|
|
2180
|
+
CONSOLE_AUTHORIZE_DECIDE
|
|
1879
2181
|
] : [
|
|
1880
2182
|
DashboardService,
|
|
1881
|
-
FilterRunner2
|
|
2183
|
+
FilterRunner2,
|
|
2184
|
+
CONSOLE_AUTHORIZE_DECIDE
|
|
1882
2185
|
]
|
|
1883
2186
|
};
|
|
1884
2187
|
}
|
|
1885
2188
|
};
|
|
1886
|
-
DurableApiModule =
|
|
2189
|
+
DurableApiModule = _ts_decorate8([
|
|
1887
2190
|
Module({})
|
|
1888
2191
|
], DurableApiModule);
|
|
1889
2192
|
var DurableDashboardModule = class _DurableDashboardModule {
|
|
@@ -1909,6 +2212,9 @@ var DurableDashboardModule = class _DurableDashboardModule {
|
|
|
1909
2212
|
...options.imports ? {
|
|
1910
2213
|
imports: options.imports
|
|
1911
2214
|
} : {},
|
|
2215
|
+
...options.authorize !== void 0 ? {
|
|
2216
|
+
authorize: options.authorize
|
|
2217
|
+
} : {},
|
|
1912
2218
|
routes: false
|
|
1913
2219
|
});
|
|
1914
2220
|
return {
|
|
@@ -1920,7 +2226,8 @@ var DurableDashboardModule = class _DurableDashboardModule {
|
|
|
1920
2226
|
controllers: [],
|
|
1921
2227
|
providers: pathProviders,
|
|
1922
2228
|
// What a host's subclasses of `DurableUiControllerBase` / `DurableApiControllerBase` inject:
|
|
1923
|
-
// the SPA's paths,
|
|
2229
|
+
// the SPA's paths, the read/action service, the filter runner and the resolved `authorize`
|
|
2230
|
+
// (for `@UseConsoleAuthorize()`) via the API module.
|
|
1924
2231
|
exports: [
|
|
1925
2232
|
DurableApiModule,
|
|
1926
2233
|
DASHBOARD_BASE_PATH,
|
|
@@ -1928,7 +2235,6 @@ var DurableDashboardModule = class _DurableDashboardModule {
|
|
|
1928
2235
|
]
|
|
1929
2236
|
};
|
|
1930
2237
|
}
|
|
1931
|
-
const decorated = (options.decorators?.length ?? 0) > 0;
|
|
1932
2238
|
return {
|
|
1933
2239
|
module: _DurableDashboardModule,
|
|
1934
2240
|
imports: [
|
|
@@ -1942,6 +2248,9 @@ var DurableDashboardModule = class _DurableDashboardModule {
|
|
|
1942
2248
|
} : {},
|
|
1943
2249
|
...options.decorators ? {
|
|
1944
2250
|
decorators: options.decorators
|
|
2251
|
+
} : {},
|
|
2252
|
+
...options.authorize !== void 0 ? {
|
|
2253
|
+
authorize: options.authorize
|
|
1945
2254
|
} : {}
|
|
1946
2255
|
}),
|
|
1947
2256
|
RouterModule.register([
|
|
@@ -1956,14 +2265,9 @@ var DurableDashboardModule = class _DurableDashboardModule {
|
|
|
1956
2265
|
])
|
|
1957
2266
|
],
|
|
1958
2267
|
controllers: [
|
|
1959
|
-
|
|
1960
|
-
],
|
|
1961
|
-
providers: [
|
|
1962
|
-
...pathProviders,
|
|
1963
|
-
...decorated ? [] : [
|
|
1964
|
-
protectionCheckProvider()
|
|
1965
|
-
]
|
|
2268
|
+
consoleController(DurableUiController, options.decorators)
|
|
1966
2269
|
],
|
|
2270
|
+
providers: pathProviders,
|
|
1967
2271
|
// Re-export the API module so its DashboardService reaches importers (e.g. flip's own controllers).
|
|
1968
2272
|
exports: [
|
|
1969
2273
|
DurableApiModule
|
|
@@ -1971,13 +2275,20 @@ var DurableDashboardModule = class _DurableDashboardModule {
|
|
|
1971
2275
|
};
|
|
1972
2276
|
}
|
|
1973
2277
|
};
|
|
1974
|
-
DurableDashboardModule =
|
|
2278
|
+
DurableDashboardModule = _ts_decorate8([
|
|
1975
2279
|
Module({})
|
|
1976
2280
|
], DurableDashboardModule);
|
|
1977
2281
|
export {
|
|
2282
|
+
CONSOLE_AUTHORIZE_DECIDE,
|
|
2283
|
+
CONSOLE_AUTHORIZE_MISSING_WARNING,
|
|
2284
|
+
CONSOLE_GATE,
|
|
2285
|
+
CONSOLE_PAGE_METADATA,
|
|
2286
|
+
ConsoleAccessDenied,
|
|
2287
|
+
ConsoleAuthorizeFilter,
|
|
2288
|
+
ConsoleAuthorizeGuard,
|
|
2289
|
+
ConsolePage,
|
|
1978
2290
|
DASHBOARD_API_PATH,
|
|
1979
2291
|
DASHBOARD_BASE_PATH,
|
|
1980
|
-
DASHBOARD_PROTECTION_CHECK,
|
|
1981
2292
|
DashboardService,
|
|
1982
2293
|
DurableApiController,
|
|
1983
2294
|
DurableApiControllerBase,
|
|
@@ -1985,6 +2296,9 @@ export {
|
|
|
1985
2296
|
DurableDashboardModule,
|
|
1986
2297
|
DurableUiController,
|
|
1987
2298
|
DurableUiControllerBase,
|
|
1988
|
-
|
|
2299
|
+
UseConsoleAuthorize,
|
|
2300
|
+
authorizeByToken,
|
|
2301
|
+
normalizeConsoleResult,
|
|
2302
|
+
resolveConsoleAuthorize
|
|
1989
2303
|
};
|
|
1990
2304
|
//# sourceMappingURL=index.js.map
|