@dudousxd/nestjs-durable 0.63.0 → 0.64.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/index.cjs +171 -86
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -3
- package/dist/index.d.ts +38 -3
- package/dist/index.js +102 -19
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -70,6 +70,7 @@ __export(src_exports, {
|
|
|
70
70
|
Step: () => Step,
|
|
71
71
|
StepInterceptor: () => StepInterceptor,
|
|
72
72
|
StoreRunGateway: () => StoreRunGateway,
|
|
73
|
+
TENANT_AUTH: () => TENANT_AUTH,
|
|
73
74
|
TENANT_REPUBLISH_MAX_LIMIT: () => TENANT_REPUBLISH_MAX_LIMIT,
|
|
74
75
|
TenantEventRepublisher: () => TenantEventRepublisher,
|
|
75
76
|
ThinStepRegistrar: () => ThinStepRegistrar,
|
|
@@ -105,6 +106,7 @@ __export(src_exports, {
|
|
|
105
106
|
scheduleRunIdAt: () => import_nestjs_durable_core21.scheduleRunIdAt,
|
|
106
107
|
scheduledRunId: () => import_nestjs_durable_core21.scheduledRunId,
|
|
107
108
|
signTenantToken: () => import_nestjs_durable_core21.signTenantToken,
|
|
109
|
+
tenantScheduleAnnouncement: () => tenantScheduleAnnouncement,
|
|
108
110
|
thinWorkerProviders: () => thinWorkerProviders,
|
|
109
111
|
triggeredRunsOf: () => import_nestjs_durable_core21.triggeredRunsOf,
|
|
110
112
|
unavailableRunGateway: () => unavailableRunGateway
|
|
@@ -914,7 +916,7 @@ function tenantUnsupported(method) {
|
|
|
914
916
|
__name(tenantUnsupported, "tenantUnsupported");
|
|
915
917
|
|
|
916
918
|
// src/durable-worker.module.ts
|
|
917
|
-
var
|
|
919
|
+
var import_nestjs_durable_core7 = require("@dudousxd/nestjs-durable-core");
|
|
918
920
|
var import_common2 = require("@nestjs/common");
|
|
919
921
|
var import_core = require("@nestjs/core");
|
|
920
922
|
|
|
@@ -1111,6 +1113,12 @@ function registerOnRuntime(runtime, scanner, meta, instance, origin) {
|
|
|
1111
1113
|
}
|
|
1112
1114
|
__name(registerOnRuntime, "registerOnRuntime");
|
|
1113
1115
|
|
|
1116
|
+
// src/tokens.ts
|
|
1117
|
+
var import_nestjs_durable_core6 = require("@dudousxd/nestjs-durable-core");
|
|
1118
|
+
var CONTEXT_ACCESSOR = Symbol.for("@dudousxd/nestjs-context:accessor");
|
|
1119
|
+
var TENANT_AUTH = Symbol("nestjs-durable:tenant-auth");
|
|
1120
|
+
var RUN_GATEWAY = import_nestjs_durable_core6.RunGateway;
|
|
1121
|
+
|
|
1114
1122
|
// src/durable-worker.module.ts
|
|
1115
1123
|
function _ts_decorate2(decorators, target, key, desc) {
|
|
1116
1124
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -1167,7 +1175,7 @@ var ThinWorkflowRegistrar = class {
|
|
|
1167
1175
|
const starter = this.starter;
|
|
1168
1176
|
scanWorkflows(this.discovery, (meta, instance, origin) => {
|
|
1169
1177
|
registerOnRuntime(runtime, this.metadataScanner, meta, instance, origin);
|
|
1170
|
-
(0,
|
|
1178
|
+
(0, import_nestjs_durable_core7.bindWorkflowClass)(instance.constructor, {
|
|
1171
1179
|
start: /* @__PURE__ */ __name((name, input, runId, opts) => starter.start(name, input, runId, opts), "start")
|
|
1172
1180
|
});
|
|
1173
1181
|
});
|
|
@@ -1176,8 +1184,8 @@ var ThinWorkflowRegistrar = class {
|
|
|
1176
1184
|
ThinWorkflowRegistrar = _ts_decorate2([
|
|
1177
1185
|
(0, import_common2.Injectable)(),
|
|
1178
1186
|
_ts_param(2, (0, import_common2.Inject)(DURABLE_WORKER_RUNTIME)),
|
|
1179
|
-
_ts_param(3, (0, import_common2.Inject)(
|
|
1180
|
-
_ts_param(4, (0, import_common2.Inject)(
|
|
1187
|
+
_ts_param(3, (0, import_common2.Inject)(import_nestjs_durable_core7.DURABLE_OPTIONS_CANONICAL)),
|
|
1188
|
+
_ts_param(4, (0, import_common2.Inject)(import_nestjs_durable_core7.WorkflowEngine)),
|
|
1181
1189
|
_ts_metadata2("design:type", Function),
|
|
1182
1190
|
_ts_metadata2("design:paramtypes", [
|
|
1183
1191
|
typeof import_core.DiscoveryService === "undefined" ? Object : import_core.DiscoveryService,
|
|
@@ -1210,7 +1218,7 @@ var ThinStepRegistrar = class {
|
|
|
1210
1218
|
ThinStepRegistrar = _ts_decorate2([
|
|
1211
1219
|
(0, import_common2.Injectable)(),
|
|
1212
1220
|
_ts_param(2, (0, import_common2.Inject)(DURABLE_WORKER_RUNTIME)),
|
|
1213
|
-
_ts_param(3, (0, import_common2.Inject)(
|
|
1221
|
+
_ts_param(3, (0, import_common2.Inject)(import_nestjs_durable_core7.DURABLE_OPTIONS_CANONICAL)),
|
|
1214
1222
|
_ts_metadata2("design:type", Function),
|
|
1215
1223
|
_ts_metadata2("design:paramtypes", [
|
|
1216
1224
|
typeof import_core.DiscoveryService === "undefined" ? Object : import_core.DiscoveryService,
|
|
@@ -1227,18 +1235,25 @@ var ThinWorkerBootstrap = class {
|
|
|
1227
1235
|
options;
|
|
1228
1236
|
runRedisWorker;
|
|
1229
1237
|
runnersSink;
|
|
1238
|
+
auth;
|
|
1230
1239
|
runners = [];
|
|
1231
|
-
constructor(runtime, options, runRedisWorker2, runnersSink) {
|
|
1240
|
+
constructor(runtime, options, runRedisWorker2, runnersSink, auth) {
|
|
1232
1241
|
this.runtime = runtime;
|
|
1233
1242
|
this.options = options;
|
|
1234
1243
|
this.runRedisWorker = runRedisWorker2;
|
|
1235
1244
|
this.runnersSink = runnersSink;
|
|
1245
|
+
this.auth = auth;
|
|
1236
1246
|
}
|
|
1237
1247
|
async onApplicationBootstrap() {
|
|
1238
1248
|
const options = this.options;
|
|
1239
1249
|
const runtime = this.runtime;
|
|
1240
1250
|
if (runtime === null || !isPureThinWorker(options) || options.connection === void 0) return;
|
|
1241
|
-
if (options.consumers === false)
|
|
1251
|
+
if (options.consumers === false) {
|
|
1252
|
+
if ((options.schedules?.length ?? 0) > 0) {
|
|
1253
|
+
console.warn("[nestjs-durable] `schedules` on a tenant with `consumers: false` are not announced: a tenant announces its schedules on its worker descriptor, so declare them on the processes that run its workers.");
|
|
1254
|
+
}
|
|
1255
|
+
return;
|
|
1256
|
+
}
|
|
1242
1257
|
const handle = await this.runRedisWorker({
|
|
1243
1258
|
runtime,
|
|
1244
1259
|
connection: options.connection,
|
|
@@ -1253,7 +1268,10 @@ var ThinWorkerBootstrap = class {
|
|
|
1253
1268
|
} : {},
|
|
1254
1269
|
...options.concurrency !== void 0 ? {
|
|
1255
1270
|
concurrency: options.concurrency
|
|
1256
|
-
} : {}
|
|
1271
|
+
} : {},
|
|
1272
|
+
// Announce the app's schedules (an empty list too) so the control plane adopts, updates and
|
|
1273
|
+
// withdraws them: a tenant has no store to fire them from.
|
|
1274
|
+
...await tenantScheduleAnnouncement(options, this.auth.tenantToken)
|
|
1257
1275
|
});
|
|
1258
1276
|
this.runners.push(handle);
|
|
1259
1277
|
this.runnersSink.push(handle);
|
|
@@ -1265,17 +1283,50 @@ var ThinWorkerBootstrap = class {
|
|
|
1265
1283
|
ThinWorkerBootstrap = _ts_decorate2([
|
|
1266
1284
|
(0, import_common2.Injectable)(),
|
|
1267
1285
|
_ts_param(0, (0, import_common2.Inject)(DURABLE_WORKER_RUNTIME)),
|
|
1268
|
-
_ts_param(1, (0, import_common2.Inject)(
|
|
1286
|
+
_ts_param(1, (0, import_common2.Inject)(import_nestjs_durable_core7.DURABLE_OPTIONS_CANONICAL)),
|
|
1269
1287
|
_ts_param(2, (0, import_common2.Inject)(RUN_REDIS_WORKER)),
|
|
1270
1288
|
_ts_param(3, (0, import_common2.Inject)(DURABLE_WORKER_RUNNERS)),
|
|
1289
|
+
_ts_param(4, (0, import_common2.Inject)(TENANT_AUTH)),
|
|
1271
1290
|
_ts_metadata2("design:type", Function),
|
|
1272
1291
|
_ts_metadata2("design:paramtypes", [
|
|
1273
1292
|
Object,
|
|
1274
1293
|
typeof DurableModuleOptions === "undefined" ? Object : DurableModuleOptions,
|
|
1275
1294
|
typeof RunRedisWorkerFn === "undefined" ? Object : RunRedisWorkerFn,
|
|
1276
|
-
Array
|
|
1295
|
+
Array,
|
|
1296
|
+
typeof ResolvedTenantAuth === "undefined" ? Object : ResolvedTenantAuth
|
|
1277
1297
|
])
|
|
1278
1298
|
], ThinWorkerBootstrap);
|
|
1299
|
+
async function tenantScheduleAnnouncement(options, tenantToken) {
|
|
1300
|
+
let tenant;
|
|
1301
|
+
try {
|
|
1302
|
+
tenant = tenantToken !== void 0 ? await (0, import_nestjs_durable_core7.resolveTenantToken)(tenantToken) : options.partition ?? "default";
|
|
1303
|
+
} catch (error) {
|
|
1304
|
+
console.warn(`[nestjs-durable] this worker announces no schedules: its tenantToken failed (${error instanceof Error ? error.message : String(error)})`);
|
|
1305
|
+
return {};
|
|
1306
|
+
}
|
|
1307
|
+
return {
|
|
1308
|
+
schedules: {
|
|
1309
|
+
tenant,
|
|
1310
|
+
items: (options.schedules ?? []).map(announcedSchedule)
|
|
1311
|
+
}
|
|
1312
|
+
};
|
|
1313
|
+
}
|
|
1314
|
+
__name(tenantScheduleAnnouncement, "tenantScheduleAnnouncement");
|
|
1315
|
+
function announcedSchedule(s) {
|
|
1316
|
+
const item = {
|
|
1317
|
+
key: s.key,
|
|
1318
|
+
workflow: (0, import_nestjs_durable_core7.workflowName)(s.workflow)
|
|
1319
|
+
};
|
|
1320
|
+
if (s.input !== void 0) item.input = s.input;
|
|
1321
|
+
if (s.everyMs !== void 0) item.everyMs = s.everyMs;
|
|
1322
|
+
if (s.cron !== void 0) item.cron = s.cron;
|
|
1323
|
+
if (s.timezone !== void 0) item.timezone = s.timezone;
|
|
1324
|
+
if (s.paused === true) item.paused = true;
|
|
1325
|
+
if (s.overlap !== void 0) item.overlap = s.overlap;
|
|
1326
|
+
if (s.jitter !== void 0 && s.jitter > 0) item.jitterMs = s.jitter;
|
|
1327
|
+
return item;
|
|
1328
|
+
}
|
|
1329
|
+
__name(announcedSchedule, "announcedSchedule");
|
|
1279
1330
|
function thinWorkerProviders() {
|
|
1280
1331
|
return [
|
|
1281
1332
|
{
|
|
@@ -1295,7 +1346,7 @@ function thinWorkerProviders() {
|
|
|
1295
1346
|
workflowGroup: options.partition ?? ""
|
|
1296
1347
|
}) : null, "useFactory"),
|
|
1297
1348
|
inject: [
|
|
1298
|
-
|
|
1349
|
+
import_nestjs_durable_core7.DURABLE_OPTIONS_CANONICAL
|
|
1299
1350
|
]
|
|
1300
1351
|
},
|
|
1301
1352
|
{
|
|
@@ -1370,7 +1421,7 @@ var import_common13 = require("@nestjs/common");
|
|
|
1370
1421
|
var import_core6 = require("@nestjs/core");
|
|
1371
1422
|
|
|
1372
1423
|
// src/durable-step.registrar.ts
|
|
1373
|
-
var
|
|
1424
|
+
var import_nestjs_durable_core8 = require("@dudousxd/nestjs-durable-core");
|
|
1374
1425
|
var import_common3 = require("@nestjs/common");
|
|
1375
1426
|
var import_core2 = require("@nestjs/core");
|
|
1376
1427
|
|
|
@@ -1438,8 +1489,8 @@ var DurableStepRegistrar = class {
|
|
|
1438
1489
|
};
|
|
1439
1490
|
DurableStepRegistrar = _ts_decorate3([
|
|
1440
1491
|
(0, import_common3.Injectable)(),
|
|
1441
|
-
_ts_param2(2, (0, import_common3.Inject)(
|
|
1442
|
-
_ts_param2(3, (0, import_common3.Inject)(
|
|
1492
|
+
_ts_param2(2, (0, import_common3.Inject)(import_nestjs_durable_core8.TRANSPORT_CANONICAL)),
|
|
1493
|
+
_ts_param2(3, (0, import_common3.Inject)(import_nestjs_durable_core8.DURABLE_OPTIONS_CANONICAL)),
|
|
1443
1494
|
_ts_metadata3("design:type", Function),
|
|
1444
1495
|
_ts_metadata3("design:paramtypes", [
|
|
1445
1496
|
typeof import_core2.DiscoveryService === "undefined" ? Object : import_core2.DiscoveryService,
|
|
@@ -1450,7 +1501,7 @@ DurableStepRegistrar = _ts_decorate3([
|
|
|
1450
1501
|
], DurableStepRegistrar);
|
|
1451
1502
|
|
|
1452
1503
|
// src/entity.ts
|
|
1453
|
-
var
|
|
1504
|
+
var import_nestjs_durable_core9 = require("@dudousxd/nestjs-durable-core");
|
|
1454
1505
|
var import_common4 = require("@nestjs/common");
|
|
1455
1506
|
var import_reflect_metadata2 = require("reflect-metadata");
|
|
1456
1507
|
function _ts_decorate4(decorators, target, key, desc) {
|
|
@@ -1533,12 +1584,12 @@ EntityService = _ts_decorate4([
|
|
|
1533
1584
|
(0, import_common4.Injectable)(),
|
|
1534
1585
|
_ts_metadata4("design:type", Function),
|
|
1535
1586
|
_ts_metadata4("design:paramtypes", [
|
|
1536
|
-
typeof
|
|
1587
|
+
typeof import_nestjs_durable_core9.WorkflowEngine === "undefined" ? Object : import_nestjs_durable_core9.WorkflowEngine
|
|
1537
1588
|
])
|
|
1538
1589
|
], EntityService);
|
|
1539
1590
|
|
|
1540
1591
|
// src/in-app-worker.ts
|
|
1541
|
-
var
|
|
1592
|
+
var import_nestjs_durable_core10 = require("@dudousxd/nestjs-durable-core");
|
|
1542
1593
|
var import_common5 = require("@nestjs/common");
|
|
1543
1594
|
var import_core3 = require("@nestjs/core");
|
|
1544
1595
|
function _ts_decorate5(decorators, target, key, desc) {
|
|
@@ -1643,7 +1694,7 @@ var InAppWorkerBootstrap = class {
|
|
|
1643
1694
|
};
|
|
1644
1695
|
InAppWorkerBootstrap = _ts_decorate5([
|
|
1645
1696
|
(0, import_common5.Injectable)(),
|
|
1646
|
-
_ts_param3(2, (0, import_common5.Inject)(
|
|
1697
|
+
_ts_param3(2, (0, import_common5.Inject)(import_nestjs_durable_core10.DURABLE_OPTIONS_CANONICAL)),
|
|
1647
1698
|
_ts_param3(3, (0, import_common5.Inject)(IN_APP_WORKER_RUNTIME)),
|
|
1648
1699
|
_ts_param3(4, (0, import_common5.Inject)(IN_APP_RUN_REDIS_WORKER)),
|
|
1649
1700
|
_ts_param3(5, (0, import_common5.Inject)(IN_APP_WORKER_RUNNERS)),
|
|
@@ -1663,8 +1714,8 @@ function inAppWorkerProviders() {
|
|
|
1663
1714
|
provide: IN_APP_WORKER_BINDING,
|
|
1664
1715
|
useFactory: /* @__PURE__ */ __name((transport, options) => inAppWorkerBinding(transport, options), "useFactory"),
|
|
1665
1716
|
inject: [
|
|
1666
|
-
|
|
1667
|
-
|
|
1717
|
+
import_nestjs_durable_core10.TRANSPORT_CANONICAL,
|
|
1718
|
+
import_nestjs_durable_core10.DURABLE_OPTIONS_CANONICAL
|
|
1668
1719
|
]
|
|
1669
1720
|
},
|
|
1670
1721
|
{
|
|
@@ -1684,7 +1735,7 @@ function inAppWorkerProviders() {
|
|
|
1684
1735
|
workflowGroup: options.partition ?? ""
|
|
1685
1736
|
}) : null, "useFactory"),
|
|
1686
1737
|
inject: [
|
|
1687
|
-
|
|
1738
|
+
import_nestjs_durable_core10.DURABLE_OPTIONS_CANONICAL
|
|
1688
1739
|
]
|
|
1689
1740
|
},
|
|
1690
1741
|
{
|
|
@@ -1701,11 +1752,11 @@ function inAppWorkerProviders() {
|
|
|
1701
1752
|
__name(inAppWorkerProviders, "inAppWorkerProviders");
|
|
1702
1753
|
|
|
1703
1754
|
// src/proxy-run-gateway.ts
|
|
1704
|
-
var
|
|
1755
|
+
var import_nestjs_durable_core12 = require("@dudousxd/nestjs-durable-core");
|
|
1705
1756
|
var import_common6 = require("@nestjs/common");
|
|
1706
1757
|
|
|
1707
1758
|
// src/run-request-responder.ts
|
|
1708
|
-
var
|
|
1759
|
+
var import_nestjs_durable_core11 = require("@dudousxd/nestjs-durable-core");
|
|
1709
1760
|
var UNSUPPORTED_RUN_REQUEST = "unsupported-request";
|
|
1710
1761
|
var BAD_RUN_REQUEST = "bad-request";
|
|
1711
1762
|
var TENANT_REPUBLISH_MAX_LIMIT = 1e3;
|
|
@@ -1802,7 +1853,7 @@ var RunRequestResponder = class {
|
|
|
1802
1853
|
});
|
|
1803
1854
|
}
|
|
1804
1855
|
async handle(wire) {
|
|
1805
|
-
const tenant = await (0,
|
|
1856
|
+
const tenant = await (0, import_nestjs_durable_core11.resolveWireTenant)(wire.tenant, this.verifyTenant);
|
|
1806
1857
|
if (tenant === null) {
|
|
1807
1858
|
return {
|
|
1808
1859
|
requestId: wire.requestId,
|
|
@@ -2030,7 +2081,7 @@ var RunRequestResponder = class {
|
|
|
2030
2081
|
};
|
|
2031
2082
|
}
|
|
2032
2083
|
if (body.kind === "republishLifecycle" && "runId" in body.target && run) {
|
|
2033
|
-
const kind = (0,
|
|
2084
|
+
const kind = (0, import_nestjs_durable_core11.lifecycleKindOf)(run.status);
|
|
2034
2085
|
const refused = kind ? await this.refuseSubscriber(run.workflow, kind, body.target.subscriber, msg.tenant) : void 0;
|
|
2035
2086
|
if (refused) return badRequest(msg.requestId, refused);
|
|
2036
2087
|
}
|
|
@@ -2096,7 +2147,7 @@ var RunRequestResponder = class {
|
|
|
2096
2147
|
namespace: tenant
|
|
2097
2148
|
});
|
|
2098
2149
|
if (!links) return rest;
|
|
2099
|
-
const kind = (0,
|
|
2150
|
+
const kind = (0, import_nestjs_durable_core11.lifecycleKindOf)(detail.run.status);
|
|
2100
2151
|
const subscribers = kind ? [
|
|
2101
2152
|
...new Set(links.startsOnSettle.filter((l) => l.kind === kind).map((l) => l.workflow))
|
|
2102
2153
|
] : [];
|
|
@@ -2273,12 +2324,12 @@ var ProxyRunGateway = class {
|
|
|
2273
2324
|
} catch (err) {
|
|
2274
2325
|
return Promise.reject(err);
|
|
2275
2326
|
}
|
|
2276
|
-
return send(filter ? (0,
|
|
2327
|
+
return send(filter ? (0, import_nestjs_durable_core12.scopeTenantQuery)(query, filter) : query);
|
|
2277
2328
|
}
|
|
2278
2329
|
/** `run` when the request may see it, else null (an invisible run reads like a missing one). */
|
|
2279
2330
|
visible(run, filter = this.restrictive()) {
|
|
2280
2331
|
if (!run) return null;
|
|
2281
|
-
return !filter || (0,
|
|
2332
|
+
return !filter || (0, import_nestjs_durable_core12.tenantVisible)(run, filter) ? run : null;
|
|
2282
2333
|
}
|
|
2283
2334
|
/** Run a control call unless the request may not act on `runId` (then `null`, like a missing run).
|
|
2284
2335
|
* Sent at once when nothing narrows the request. */
|
|
@@ -2314,7 +2365,7 @@ var ProxyRunGateway = class {
|
|
|
2314
2365
|
request(body) {
|
|
2315
2366
|
const source = this.tenantToken;
|
|
2316
2367
|
if (typeof source !== "function") return this.send(source ?? this.tenant, body);
|
|
2317
|
-
return (0,
|
|
2368
|
+
return (0, import_nestjs_durable_core12.resolveTenantToken)(source).then((tenant) => this.send(tenant, body));
|
|
2318
2369
|
}
|
|
2319
2370
|
send(tenant, body) {
|
|
2320
2371
|
return new Promise((resolve, reject) => {
|
|
@@ -2364,12 +2415,12 @@ var ProxyRunGateway = class {
|
|
|
2364
2415
|
if (detail && filter && !this.visible(detail.run, filter)) return null;
|
|
2365
2416
|
const over = options?.summarizeFansOver;
|
|
2366
2417
|
if (over === void 0 || !detail || detail.fans !== void 0) return detail;
|
|
2367
|
-
const { timeline, fans } = (0,
|
|
2368
|
-
const ids = (0,
|
|
2418
|
+
const { timeline, fans } = (0, import_nestjs_durable_core12.summarizeTimeline)(detail.timeline, over);
|
|
2419
|
+
const ids = (0, import_nestjs_durable_core12.childIdsOf)(detail.timeline);
|
|
2369
2420
|
return {
|
|
2370
2421
|
...detail,
|
|
2371
2422
|
timeline,
|
|
2372
|
-
children: ids.slice(0,
|
|
2423
|
+
children: ids.slice(0, import_nestjs_durable_core12.SUMMARY_CHILD_LIMIT),
|
|
2373
2424
|
fans,
|
|
2374
2425
|
childCount: ids.length
|
|
2375
2426
|
};
|
|
@@ -2395,7 +2446,7 @@ var ProxyRunGateway = class {
|
|
|
2395
2446
|
kind: "getRunDetail",
|
|
2396
2447
|
runId
|
|
2397
2448
|
});
|
|
2398
|
-
return detail ? (0,
|
|
2449
|
+
return detail ? (0, import_nestjs_durable_core12.pageFan)(detail.timeline, group, query) : null;
|
|
2399
2450
|
}
|
|
2400
2451
|
/**
|
|
2401
2452
|
* The run alone, without its timeline. Read from the full detail when the control plane is too old
|
|
@@ -2562,7 +2613,7 @@ ProxyRunGateway = _ts_decorate6([
|
|
|
2562
2613
|
], ProxyRunGateway);
|
|
2563
2614
|
|
|
2564
2615
|
// src/retention-poller.ts
|
|
2565
|
-
var
|
|
2616
|
+
var import_nestjs_durable_core14 = require("@dudousxd/nestjs-durable-core");
|
|
2566
2617
|
var import_common8 = require("@nestjs/common");
|
|
2567
2618
|
|
|
2568
2619
|
// src/settle-within.ts
|
|
@@ -2589,7 +2640,7 @@ async function settleWithin(p, timeoutMs) {
|
|
|
2589
2640
|
__name(settleWithin, "settleWithin");
|
|
2590
2641
|
|
|
2591
2642
|
// src/sweep-leases.ts
|
|
2592
|
-
var
|
|
2643
|
+
var import_nestjs_durable_core13 = require("@dudousxd/nestjs-durable-core");
|
|
2593
2644
|
var import_common7 = require("@nestjs/common");
|
|
2594
2645
|
var import_core4 = require("@nestjs/core");
|
|
2595
2646
|
function _ts_decorate7(decorators, target, key, desc) {
|
|
@@ -2687,7 +2738,7 @@ SweepLeases = _ts_decorate7([
|
|
|
2687
2738
|
(0, import_common7.Injectable)(),
|
|
2688
2739
|
_ts_param4(0, (0, import_common7.Optional)()),
|
|
2689
2740
|
_ts_param4(1, (0, import_common7.Optional)()),
|
|
2690
|
-
_ts_param4(1, (0, import_common7.Inject)(
|
|
2741
|
+
_ts_param4(1, (0, import_common7.Inject)(import_nestjs_durable_core13.DURABLE_OPTIONS_CANONICAL)),
|
|
2691
2742
|
_ts_metadata7("design:type", Function),
|
|
2692
2743
|
_ts_metadata7("design:paramtypes", [
|
|
2693
2744
|
typeof import_core4.ModuleRef === "undefined" ? Object : import_core4.ModuleRef,
|
|
@@ -2735,10 +2786,10 @@ function validateRetention(retention) {
|
|
|
2735
2786
|
if (policy.maxAge == null && policy.maxCount == null) {
|
|
2736
2787
|
throw new Error("durable retention: each policy must set maxAge and/or maxCount");
|
|
2737
2788
|
}
|
|
2738
|
-
if (policy.maxAge != null) (0,
|
|
2789
|
+
if (policy.maxAge != null) (0, import_nestjs_durable_core14.parseDuration)(policy.maxAge);
|
|
2739
2790
|
for (const status of policy.statuses) {
|
|
2740
|
-
if (!
|
|
2741
|
-
throw new Error(`durable retention: status "${status}" is not terminal; only ${
|
|
2791
|
+
if (!import_nestjs_durable_core14.TERMINAL_RUN_STATUSES.includes(status)) {
|
|
2792
|
+
throw new Error(`durable retention: status "${status}" is not terminal; only ${import_nestjs_durable_core14.TERMINAL_RUN_STATUSES.join(", ")} can be pruned`);
|
|
2742
2793
|
}
|
|
2743
2794
|
const key = `${scopeKey}|${status}`;
|
|
2744
2795
|
if (seen.has(key)) {
|
|
@@ -2792,7 +2843,7 @@ var RetentionPoller = class {
|
|
|
2792
2843
|
return;
|
|
2793
2844
|
}
|
|
2794
2845
|
void this.sweep();
|
|
2795
|
-
const intervalMs = retention.sweepInterval != null ? (0,
|
|
2846
|
+
const intervalMs = retention.sweepInterval != null ? (0, import_nestjs_durable_core14.parseDuration)(retention.sweepInterval) : DEFAULT_SWEEP_INTERVAL_MS;
|
|
2796
2847
|
if (intervalMs > 0) {
|
|
2797
2848
|
this.timer = setInterval(() => void this.sweep(), intervalMs);
|
|
2798
2849
|
this.timer.unref?.();
|
|
@@ -2856,8 +2907,8 @@ var RetentionPoller = class {
|
|
|
2856
2907
|
};
|
|
2857
2908
|
RetentionPoller = _ts_decorate8([
|
|
2858
2909
|
(0, import_common8.Injectable)(),
|
|
2859
|
-
_ts_param5(0, (0, import_common8.Inject)(
|
|
2860
|
-
_ts_param5(1, (0, import_common8.Inject)(
|
|
2910
|
+
_ts_param5(0, (0, import_common8.Inject)(import_nestjs_durable_core14.STATE_STORE_CANONICAL)),
|
|
2911
|
+
_ts_param5(1, (0, import_common8.Inject)(import_nestjs_durable_core14.DURABLE_OPTIONS_CANONICAL)),
|
|
2861
2912
|
_ts_param5(2, (0, import_common8.Optional)()),
|
|
2862
2913
|
_ts_metadata8("design:type", Function),
|
|
2863
2914
|
_ts_metadata8("design:paramtypes", [
|
|
@@ -2868,7 +2919,7 @@ RetentionPoller = _ts_decorate8([
|
|
|
2868
2919
|
], RetentionPoller);
|
|
2869
2920
|
|
|
2870
2921
|
// src/store-run-gateway.ts
|
|
2871
|
-
var
|
|
2922
|
+
var import_nestjs_durable_core15 = require("@dudousxd/nestjs-durable-core");
|
|
2872
2923
|
var import_common9 = require("@nestjs/common");
|
|
2873
2924
|
function _ts_decorate9(decorators, target, key, desc) {
|
|
2874
2925
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -2911,14 +2962,14 @@ function detailExtras(links) {
|
|
|
2911
2962
|
}
|
|
2912
2963
|
__name(detailExtras, "detailExtras");
|
|
2913
2964
|
function withoutRegistry(query) {
|
|
2914
|
-
if (query.workflow ===
|
|
2965
|
+
if (query.workflow === import_nestjs_durable_core15.LIFECYCLE_REGISTRY_WORKFLOW || query.workflows?.includes(import_nestjs_durable_core15.LIFECYCLE_REGISTRY_WORKFLOW)) {
|
|
2915
2966
|
return query;
|
|
2916
2967
|
}
|
|
2917
2968
|
return {
|
|
2918
2969
|
...query,
|
|
2919
2970
|
excludeWorkflows: [
|
|
2920
2971
|
...query.excludeWorkflows ?? [],
|
|
2921
|
-
|
|
2972
|
+
import_nestjs_durable_core15.LIFECYCLE_REGISTRY_WORKFLOW
|
|
2922
2973
|
]
|
|
2923
2974
|
};
|
|
2924
2975
|
}
|
|
@@ -2969,10 +3020,10 @@ var StoreRunGateway = class {
|
|
|
2969
3020
|
...links
|
|
2970
3021
|
};
|
|
2971
3022
|
}
|
|
2972
|
-
if ((0,
|
|
3023
|
+
if ((0, import_nestjs_durable_core15.aggregatesCheckpoints)(this.store)) {
|
|
2973
3024
|
const stats = await this.store.checkpointStats(runId);
|
|
2974
|
-
const etag = (0,
|
|
2975
|
-
if ((0,
|
|
3025
|
+
const etag = (0, import_nestjs_durable_core15.extendEtag)((0, import_nestjs_durable_core15.runDetailEtag)(run, stats, over), detailExtras(links));
|
|
3026
|
+
if ((0, import_nestjs_durable_core15.etagMatches)(options?.ifNoneMatch, etag)) {
|
|
2976
3027
|
return {
|
|
2977
3028
|
run,
|
|
2978
3029
|
timeline: [],
|
|
@@ -2983,18 +3034,18 @@ var StoreRunGateway = class {
|
|
|
2983
3034
|
}
|
|
2984
3035
|
return {
|
|
2985
3036
|
run,
|
|
2986
|
-
...await (0,
|
|
3037
|
+
...await (0, import_nestjs_durable_core15.summarizeRunFromStore)(this.store, runId, over, stats),
|
|
2987
3038
|
etag,
|
|
2988
3039
|
...links
|
|
2989
3040
|
};
|
|
2990
3041
|
}
|
|
2991
3042
|
const full = await this.store.listCheckpoints(runId);
|
|
2992
|
-
const { timeline, fans } = (0,
|
|
2993
|
-
const ids = (0,
|
|
3043
|
+
const { timeline, fans } = (0, import_nestjs_durable_core15.summarizeTimeline)(full, over);
|
|
3044
|
+
const ids = (0, import_nestjs_durable_core15.childIdsOf)(full);
|
|
2994
3045
|
return {
|
|
2995
3046
|
run,
|
|
2996
3047
|
timeline,
|
|
2997
|
-
children: ids.slice(0,
|
|
3048
|
+
children: ids.slice(0, import_nestjs_durable_core15.SUMMARY_CHILD_LIMIT),
|
|
2998
3049
|
fans,
|
|
2999
3050
|
childCount: ids.length,
|
|
3000
3051
|
...links
|
|
@@ -3009,24 +3060,24 @@ var StoreRunGateway = class {
|
|
|
3009
3060
|
*/
|
|
3010
3061
|
async lifecycleLinks(run) {
|
|
3011
3062
|
const triggered = await this.engine.triggeredRuns(run);
|
|
3012
|
-
const source = (0,
|
|
3013
|
-
const kind = (0,
|
|
3063
|
+
const source = (0, import_nestjs_durable_core15.lifecycleSourceOf)(run);
|
|
3064
|
+
const kind = (0, import_nestjs_durable_core15.lifecycleKindOf)(run.status);
|
|
3014
3065
|
const subscribers = kind ? await this.engine.lifecycleSubscribers(run.workflow, kind, run.namespace || "default") : [];
|
|
3015
3066
|
const workflowLifecycle = await this.engine.workflowLifecycle(run.workflow);
|
|
3016
3067
|
const linked = workflowLifecycle.startsOnSettle.length > 0 || workflowLifecycle.startedBy.length > 0;
|
|
3017
|
-
const deliveries = kind ? (0,
|
|
3068
|
+
const deliveries = kind ? (0, import_nestjs_durable_core15.lifecycleDeliveriesOf)(run, {
|
|
3018
3069
|
subscribers,
|
|
3019
3070
|
live: new Set(subscribers),
|
|
3020
3071
|
coalesced: this.engine.coalescedSubscribers(run)
|
|
3021
3072
|
}) : [];
|
|
3022
3073
|
const [own, onIt] = await Promise.all([
|
|
3023
|
-
run.status === "suspended" ? (0,
|
|
3074
|
+
run.status === "suspended" ? (0, import_nestjs_durable_core15.listSignalWaitersOfRuns)(this.store, [
|
|
3024
3075
|
run.id
|
|
3025
3076
|
]) : [],
|
|
3026
|
-
run.workflow.startsWith("__") ? [] : this.store.listSignalWaiters((0,
|
|
3077
|
+
run.workflow.startsWith("__") ? [] : this.store.listSignalWaiters((0, import_nestjs_durable_core15.runWaitPrefix)(run.id))
|
|
3027
3078
|
]);
|
|
3028
3079
|
const waitsFor = own.flatMap((w) => {
|
|
3029
|
-
const target = (0,
|
|
3080
|
+
const target = (0, import_nestjs_durable_core15.runWaitTargetOf)(w);
|
|
3030
3081
|
return target !== void 0 ? [
|
|
3031
3082
|
{
|
|
3032
3083
|
runId: target,
|
|
@@ -3034,14 +3085,14 @@ var StoreRunGateway = class {
|
|
|
3034
3085
|
}
|
|
3035
3086
|
] : [];
|
|
3036
3087
|
});
|
|
3037
|
-
const awaitedBy = onIt.filter((w) => (0,
|
|
3088
|
+
const awaitedBy = onIt.filter((w) => (0, import_nestjs_durable_core15.runWaitTargetOf)(w) === run.id).map((w) => ({
|
|
3038
3089
|
runId: w.runId,
|
|
3039
3090
|
seq: w.seq
|
|
3040
3091
|
}));
|
|
3041
3092
|
const started = deliveries.flatMap((d) => d.state === "started" && d.runId !== void 0 ? [
|
|
3042
3093
|
d.runId
|
|
3043
3094
|
] : []);
|
|
3044
|
-
const { runs } = await (0,
|
|
3095
|
+
const { runs } = await (0, import_nestjs_durable_core15.readRunsByIds)(this.store, [
|
|
3045
3096
|
...source ? [
|
|
3046
3097
|
source.runId
|
|
3047
3098
|
] : [],
|
|
@@ -3058,7 +3109,7 @@ var StoreRunGateway = class {
|
|
|
3058
3109
|
} : link;
|
|
3059
3110
|
}, "withRun");
|
|
3060
3111
|
const sourceRun = source ? runs.get(source.runId) : void 0;
|
|
3061
|
-
const traceId = (0,
|
|
3112
|
+
const traceId = (0, import_nestjs_durable_core15.traceIdOfTraceparent)((0, import_nestjs_durable_core15.lifecycleTraceparentOf)(sourceRun?.tags));
|
|
3062
3113
|
return {
|
|
3063
3114
|
...triggered.length > 0 ? {
|
|
3064
3115
|
triggered
|
|
@@ -3103,12 +3154,12 @@ var StoreRunGateway = class {
|
|
|
3103
3154
|
}
|
|
3104
3155
|
async getFanMembers(runId, group, query) {
|
|
3105
3156
|
if (!await this.visibleRun(runId)) return null;
|
|
3106
|
-
if ((0,
|
|
3157
|
+
if ((0, import_nestjs_durable_core15.aggregatesCheckpoints)(this.store)) {
|
|
3107
3158
|
const stats = await this.store.checkpointStats(runId, {
|
|
3108
3159
|
group
|
|
3109
3160
|
});
|
|
3110
|
-
const etag = (0,
|
|
3111
|
-
if ((0,
|
|
3161
|
+
const etag = (0, import_nestjs_durable_core15.fanPageEtag)(group, stats, query);
|
|
3162
|
+
if ((0, import_nestjs_durable_core15.etagMatches)(query.ifNoneMatch, etag)) {
|
|
3112
3163
|
return {
|
|
3113
3164
|
items: [],
|
|
3114
3165
|
total: 0,
|
|
@@ -3117,17 +3168,17 @@ var StoreRunGateway = class {
|
|
|
3117
3168
|
};
|
|
3118
3169
|
}
|
|
3119
3170
|
return {
|
|
3120
|
-
...await (0,
|
|
3171
|
+
...await (0, import_nestjs_durable_core15.pageFanFromStore)(this.store, runId, group, query, stats),
|
|
3121
3172
|
etag
|
|
3122
3173
|
};
|
|
3123
3174
|
}
|
|
3124
|
-
return (0,
|
|
3175
|
+
return (0, import_nestjs_durable_core15.pageFan)(await this.store.listCheckpoints(runId), group, query);
|
|
3125
3176
|
}
|
|
3126
3177
|
async listRuns(query) {
|
|
3127
3178
|
const runs = await this.store.listRuns(this.scoped(withoutRegistry(query)));
|
|
3128
|
-
const waiterByRun = (0,
|
|
3179
|
+
const waiterByRun = (0, import_nestjs_durable_core15.indexWaitersByRun)(await (0, import_nestjs_durable_core15.listSignalWaitersOfRuns)(this.store, runs.filter((run) => run.status === "suspended").map((run) => run.id)));
|
|
3129
3180
|
return runs.map((run) => {
|
|
3130
|
-
const waiting = (0,
|
|
3181
|
+
const waiting = (0, import_nestjs_durable_core15.resolveRunWaiting)(run, waiterByRun);
|
|
3131
3182
|
return waiting ? {
|
|
3132
3183
|
...run,
|
|
3133
3184
|
waiting
|
|
@@ -3144,7 +3195,7 @@ var StoreRunGateway = class {
|
|
|
3144
3195
|
const scoped = this.scoped(withoutRegistry(query));
|
|
3145
3196
|
if (this.store.runFacets) return this.store.runFacets(scoped);
|
|
3146
3197
|
const runs = await this.store.listRuns(scoped);
|
|
3147
|
-
return (0,
|
|
3198
|
+
return (0, import_nestjs_durable_core15.mergeRunFacetRows)(runs.map((r) => ({
|
|
3148
3199
|
status: r.status,
|
|
3149
3200
|
origin: r.origin,
|
|
3150
3201
|
count: 1
|
|
@@ -3179,13 +3230,13 @@ var StoreRunGateway = class {
|
|
|
3179
3230
|
"suspended"
|
|
3180
3231
|
]
|
|
3181
3232
|
})),
|
|
3182
|
-
(0,
|
|
3233
|
+
(0, import_nestjs_durable_core15.listSignalWaitersOfRuns)(this.store, runIds)
|
|
3183
3234
|
]);
|
|
3184
|
-
const waiterByRun = (0,
|
|
3235
|
+
const waiterByRun = (0, import_nestjs_durable_core15.indexWaitersByRun)(waiters);
|
|
3185
3236
|
const result = {};
|
|
3186
3237
|
for (const run of suspended) {
|
|
3187
3238
|
if (!idSet.has(run.id)) continue;
|
|
3188
|
-
const waiting = (0,
|
|
3239
|
+
const waiting = (0, import_nestjs_durable_core15.resolveRunWaiting)(run, waiterByRun);
|
|
3189
3240
|
if (waiting) result[run.id] = waiting;
|
|
3190
3241
|
}
|
|
3191
3242
|
return result;
|
|
@@ -3277,11 +3328,11 @@ var StoreRunGateway = class {
|
|
|
3277
3328
|
};
|
|
3278
3329
|
StoreRunGateway = _ts_decorate9([
|
|
3279
3330
|
(0, import_common9.Injectable)(),
|
|
3280
|
-
_ts_param6(0, (0, import_common9.Inject)(
|
|
3331
|
+
_ts_param6(0, (0, import_common9.Inject)(import_nestjs_durable_core15.STATE_STORE_CANONICAL)),
|
|
3281
3332
|
_ts_metadata9("design:type", Function),
|
|
3282
3333
|
_ts_metadata9("design:paramtypes", [
|
|
3283
3334
|
typeof StateStore === "undefined" ? Object : StateStore,
|
|
3284
|
-
typeof
|
|
3335
|
+
typeof import_nestjs_durable_core15.WorkflowEngine === "undefined" ? Object : import_nestjs_durable_core15.WorkflowEngine
|
|
3285
3336
|
])
|
|
3286
3337
|
], StoreRunGateway);
|
|
3287
3338
|
|
|
@@ -3328,7 +3379,7 @@ var TenantEventRepublisher = class {
|
|
|
3328
3379
|
|
|
3329
3380
|
// src/timer-poller.ts
|
|
3330
3381
|
var durableCore = __toESM(require("@dudousxd/nestjs-durable-core"), 1);
|
|
3331
|
-
var
|
|
3382
|
+
var import_nestjs_durable_core16 = require("@dudousxd/nestjs-durable-core");
|
|
3332
3383
|
var import_common10 = require("@nestjs/common");
|
|
3333
3384
|
function _ts_decorate10(decorators, target, key, desc) {
|
|
3334
3385
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -3379,13 +3430,15 @@ var TimerPoller = class {
|
|
|
3379
3430
|
endWait;
|
|
3380
3431
|
/** When the owed-lifecycle listing last succeeded (see {@link owedSweepDue}). */
|
|
3381
3432
|
owedSweptAt;
|
|
3433
|
+
/** When the tenant schedule announcements were last reconciled (see {@link announcedSchedules}). */
|
|
3434
|
+
announcedSyncedAt;
|
|
3382
3435
|
constructor(engine, options, leases = new SweepLeases()) {
|
|
3383
3436
|
this.engine = engine;
|
|
3384
3437
|
this.options = options;
|
|
3385
3438
|
this.leases = leases;
|
|
3386
3439
|
}
|
|
3387
3440
|
async onApplicationBootstrap() {
|
|
3388
|
-
for (const s of this.options.schedules ?? []) (0,
|
|
3441
|
+
for (const s of this.options.schedules ?? []) (0, import_nestjs_durable_core16.workflowName)(s.workflow);
|
|
3389
3442
|
if (!isDrivingOperator(this.options)) return;
|
|
3390
3443
|
this.engine.consumeRuns?.();
|
|
3391
3444
|
this.unsubscribeEnqueued = this.engine.onEnqueued((runId) => {
|
|
@@ -3468,7 +3521,8 @@ var TimerPoller = class {
|
|
|
3468
3521
|
try {
|
|
3469
3522
|
const now = Date.now();
|
|
3470
3523
|
const stored = await this.engine.nextDueAt(now + wait, {
|
|
3471
|
-
persistedSchedules: this.options.persistedSchedules === true
|
|
3524
|
+
persistedSchedules: this.options.persistedSchedules === true,
|
|
3525
|
+
announcedSchedules: this.announcedSchedules() !== void 0
|
|
3472
3526
|
});
|
|
3473
3527
|
const schedules = this.options.schedules;
|
|
3474
3528
|
const scheduled = schedules && schedules.length > 0 && nextScheduleFireAt2 ? nextScheduleFireAt2(this.engine, schedules, now) : void 0;
|
|
@@ -3485,6 +3539,22 @@ var TimerPoller = class {
|
|
|
3485
3539
|
}
|
|
3486
3540
|
}
|
|
3487
3541
|
/**
|
|
3542
|
+
* The tenant schedule adoption settings when it is on (see
|
|
3543
|
+
* {@link DurableModuleOptions.announcedSchedules}), else undefined: off by option, on a core
|
|
3544
|
+
* without it, or on a store that does not persist schedules.
|
|
3545
|
+
*/
|
|
3546
|
+
announcedSchedules() {
|
|
3547
|
+
const option = this.options.announcedSchedules;
|
|
3548
|
+
if (option === false) return void 0;
|
|
3549
|
+
if (typeof this.engine.syncAnnouncedSchedules !== "function") return void 0;
|
|
3550
|
+
if (this.engine.schedules?.supported !== true) return void 0;
|
|
3551
|
+
const settings = typeof option === "object" ? option : {};
|
|
3552
|
+
return {
|
|
3553
|
+
syncMs: settings.syncMs ?? 15e3,
|
|
3554
|
+
graceMs: settings.graceMs
|
|
3555
|
+
};
|
|
3556
|
+
}
|
|
3557
|
+
/**
|
|
3488
3558
|
* Whether this poll lists the owed lifecycle runs: until a sweep that listed them succeeded, then
|
|
3489
3559
|
* once per `owedLifecycleSweepMs` (a clock that went back lists them again).
|
|
3490
3560
|
*/
|
|
@@ -3565,10 +3635,29 @@ var TimerPoller = class {
|
|
|
3565
3635
|
}));
|
|
3566
3636
|
const schedules = this.options.schedules;
|
|
3567
3637
|
if (schedules && schedules.length > 0) {
|
|
3568
|
-
note(await this.sweep("schedules", () => (0,
|
|
3638
|
+
note(await this.sweep("schedules", () => (0, import_nestjs_durable_core16.runSchedules)(this.engine, schedules, Date.now())));
|
|
3639
|
+
}
|
|
3640
|
+
const announced = this.announcedSchedules();
|
|
3641
|
+
if (announced) {
|
|
3642
|
+
const at = Date.now();
|
|
3643
|
+
const last = this.announcedSyncedAt;
|
|
3644
|
+
if (last === void 0 || at < last || at - last >= announced.syncMs) {
|
|
3645
|
+
await this.sweep("announcedSchedules", () => this.leases.run("announced-schedules", async () => {
|
|
3646
|
+
await this.engine.syncAnnouncedSchedules({
|
|
3647
|
+
...announced.graceMs !== void 0 ? {
|
|
3648
|
+
graceMs: announced.graceMs
|
|
3649
|
+
} : {}
|
|
3650
|
+
});
|
|
3651
|
+
this.announcedSyncedAt = at;
|
|
3652
|
+
}));
|
|
3653
|
+
}
|
|
3569
3654
|
}
|
|
3570
3655
|
if (this.options.persistedSchedules) {
|
|
3571
3656
|
note(await this.sweep("persistedSchedules", () => this.engine.schedules.tick()));
|
|
3657
|
+
} else if (announced) {
|
|
3658
|
+
note(await this.sweep("announcedScheduleFires", () => this.engine.schedules.tick(Date.now(), {
|
|
3659
|
+
tag: import_nestjs_durable_core16.ANNOUNCED_SCHEDULE_TAG
|
|
3660
|
+
})));
|
|
3572
3661
|
}
|
|
3573
3662
|
return worked;
|
|
3574
3663
|
}
|
|
@@ -3584,21 +3673,16 @@ var TimerPoller = class {
|
|
|
3584
3673
|
};
|
|
3585
3674
|
TimerPoller = _ts_decorate10([
|
|
3586
3675
|
(0, import_common10.Injectable)(),
|
|
3587
|
-
_ts_param7(1, (0, import_common10.Inject)(
|
|
3676
|
+
_ts_param7(1, (0, import_common10.Inject)(import_nestjs_durable_core16.DURABLE_OPTIONS_CANONICAL)),
|
|
3588
3677
|
_ts_param7(2, (0, import_common10.Optional)()),
|
|
3589
3678
|
_ts_metadata10("design:type", Function),
|
|
3590
3679
|
_ts_metadata10("design:paramtypes", [
|
|
3591
|
-
typeof
|
|
3680
|
+
typeof import_nestjs_durable_core16.WorkflowEngine === "undefined" ? Object : import_nestjs_durable_core16.WorkflowEngine,
|
|
3592
3681
|
typeof DurableModuleOptions === "undefined" ? Object : DurableModuleOptions,
|
|
3593
3682
|
typeof SweepLeases === "undefined" ? Object : SweepLeases
|
|
3594
3683
|
])
|
|
3595
3684
|
], TimerPoller);
|
|
3596
3685
|
|
|
3597
|
-
// src/tokens.ts
|
|
3598
|
-
var import_nestjs_durable_core16 = require("@dudousxd/nestjs-durable-core");
|
|
3599
|
-
var CONTEXT_ACCESSOR = Symbol.for("@dudousxd/nestjs-context:accessor");
|
|
3600
|
-
var RUN_GATEWAY = import_nestjs_durable_core16.RunGateway;
|
|
3601
|
-
|
|
3602
3686
|
// src/workflow.registrar.ts
|
|
3603
3687
|
var import_nestjs_durable_core17 = require("@dudousxd/nestjs-durable-core");
|
|
3604
3688
|
var import_common11 = require("@nestjs/common");
|
|
@@ -4117,7 +4201,6 @@ function resolveTopologyPreset(options) {
|
|
|
4117
4201
|
};
|
|
4118
4202
|
}
|
|
4119
4203
|
__name(resolveTopologyPreset, "resolveTopologyPreset");
|
|
4120
|
-
var TENANT_AUTH = Symbol("nestjs-durable:tenant-auth");
|
|
4121
4204
|
var RunGatewayBootstrap = class RunGatewayBootstrap2 {
|
|
4122
4205
|
static {
|
|
4123
4206
|
__name(this, "RunGatewayBootstrap");
|
|
@@ -4741,6 +4824,7 @@ var import_nestjs_durable_core21 = require("@dudousxd/nestjs-durable-core");
|
|
|
4741
4824
|
Step,
|
|
4742
4825
|
StepInterceptor,
|
|
4743
4826
|
StoreRunGateway,
|
|
4827
|
+
TENANT_AUTH,
|
|
4744
4828
|
TENANT_REPUBLISH_MAX_LIMIT,
|
|
4745
4829
|
TenantEventRepublisher,
|
|
4746
4830
|
ThinStepRegistrar,
|
|
@@ -4776,6 +4860,7 @@ var import_nestjs_durable_core21 = require("@dudousxd/nestjs-durable-core");
|
|
|
4776
4860
|
scheduleRunIdAt,
|
|
4777
4861
|
scheduledRunId,
|
|
4778
4862
|
signTenantToken,
|
|
4863
|
+
tenantScheduleAnnouncement,
|
|
4779
4864
|
thinWorkerProviders,
|
|
4780
4865
|
triggeredRunsOf,
|
|
4781
4866
|
unavailableRunGateway
|