@dudousxd/nestjs-durable 0.19.0 → 0.21.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 +176 -68
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +41 -2
- package/dist/index.d.ts +41 -2
- package/dist/index.js +154 -46
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -342,8 +342,8 @@ DurableWorkerModule = _ts_decorate([
|
|
|
342
342
|
], DurableWorkerModule);
|
|
343
343
|
|
|
344
344
|
// src/durable.module.ts
|
|
345
|
-
var
|
|
346
|
-
var
|
|
345
|
+
var import_nestjs_durable_core8 = require("@dudousxd/nestjs-durable-core");
|
|
346
|
+
var import_common8 = require("@nestjs/common");
|
|
347
347
|
var import_core4 = require("@nestjs/core");
|
|
348
348
|
|
|
349
349
|
// src/durable-step.registrar.ts
|
|
@@ -484,7 +484,7 @@ EntityService = _ts_decorate3([
|
|
|
484
484
|
])
|
|
485
485
|
], EntityService);
|
|
486
486
|
|
|
487
|
-
// src/
|
|
487
|
+
// src/retention-poller.ts
|
|
488
488
|
var import_nestjs_durable_core4 = require("@dudousxd/nestjs-durable-core");
|
|
489
489
|
var import_common4 = require("@nestjs/common");
|
|
490
490
|
function _ts_decorate4(decorators, target, key, desc) {
|
|
@@ -504,6 +504,112 @@ function _ts_param3(paramIndex, decorator) {
|
|
|
504
504
|
};
|
|
505
505
|
}
|
|
506
506
|
__name(_ts_param3, "_ts_param");
|
|
507
|
+
var DEFAULT_SWEEP_INTERVAL_MS = 6e4;
|
|
508
|
+
var DEFAULT_BATCH_SIZE = 1e3;
|
|
509
|
+
var MAX_BATCHES_PER_POLICY = 100;
|
|
510
|
+
function validateRetention(retention) {
|
|
511
|
+
const seen = /* @__PURE__ */ new Set();
|
|
512
|
+
for (const policy of retention.policies) {
|
|
513
|
+
if (policy.statuses.length === 0) {
|
|
514
|
+
throw new Error("durable retention: each policy must list at least one status");
|
|
515
|
+
}
|
|
516
|
+
if (policy.maxAgeMs == null && policy.maxCount == null) {
|
|
517
|
+
throw new Error("durable retention: each policy must set maxAgeMs and/or maxCount");
|
|
518
|
+
}
|
|
519
|
+
for (const status of policy.statuses) {
|
|
520
|
+
if (!import_nestjs_durable_core4.TERMINAL_RUN_STATUSES.includes(status)) {
|
|
521
|
+
throw new Error(`durable retention: status "${status}" is not terminal; only ${import_nestjs_durable_core4.TERMINAL_RUN_STATUSES.join(", ")} can be pruned`);
|
|
522
|
+
}
|
|
523
|
+
if (seen.has(status)) {
|
|
524
|
+
throw new Error(`durable retention: status "${status}" appears in more than one policy; status sets must be disjoint`);
|
|
525
|
+
}
|
|
526
|
+
seen.add(status);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
__name(validateRetention, "validateRetention");
|
|
531
|
+
var RetentionPoller = class {
|
|
532
|
+
static {
|
|
533
|
+
__name(this, "RetentionPoller");
|
|
534
|
+
}
|
|
535
|
+
store;
|
|
536
|
+
options;
|
|
537
|
+
timer;
|
|
538
|
+
sweeping = false;
|
|
539
|
+
constructor(store, options) {
|
|
540
|
+
this.store = store;
|
|
541
|
+
this.options = options;
|
|
542
|
+
}
|
|
543
|
+
async onApplicationBootstrap() {
|
|
544
|
+
if (this.options.worker === false) return;
|
|
545
|
+
const retention = this.options.retention;
|
|
546
|
+
if (!retention || retention.policies.length === 0) return;
|
|
547
|
+
validateRetention(retention);
|
|
548
|
+
if (typeof this.store.pruneTerminalRuns !== "function") {
|
|
549
|
+
console.warn("[nestjs-durable] `retention` is configured but the store adapter does not implement pruneTerminalRuns; retention is disabled.");
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
552
|
+
await this.sweep();
|
|
553
|
+
const intervalMs = retention.sweepIntervalMs ?? DEFAULT_SWEEP_INTERVAL_MS;
|
|
554
|
+
if (intervalMs > 0) {
|
|
555
|
+
this.timer = setInterval(() => void this.sweep(), intervalMs);
|
|
556
|
+
this.timer.unref?.();
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
onModuleDestroy() {
|
|
560
|
+
if (this.timer) clearInterval(this.timer);
|
|
561
|
+
}
|
|
562
|
+
async sweep() {
|
|
563
|
+
if (this.sweeping) return;
|
|
564
|
+
const retention = this.options.retention;
|
|
565
|
+
const prune = this.store.pruneTerminalRuns;
|
|
566
|
+
if (!retention || typeof prune !== "function") return;
|
|
567
|
+
this.sweeping = true;
|
|
568
|
+
try {
|
|
569
|
+
const batchSize = retention.batchSize ?? DEFAULT_BATCH_SIZE;
|
|
570
|
+
const now = Date.now();
|
|
571
|
+
for (const policy of retention.policies) {
|
|
572
|
+
for (let batch = 0; batch < MAX_BATCHES_PER_POLICY; batch++) {
|
|
573
|
+
const deleted = await prune.call(this.store, policy, now, batchSize);
|
|
574
|
+
if (deleted < batchSize) break;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
} finally {
|
|
578
|
+
this.sweeping = false;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
RetentionPoller = _ts_decorate4([
|
|
583
|
+
(0, import_common4.Injectable)(),
|
|
584
|
+
_ts_param3(0, (0, import_common4.Inject)(import_nestjs_durable_core4.STATE_STORE_CANONICAL)),
|
|
585
|
+
_ts_param3(1, (0, import_common4.Inject)(import_nestjs_durable_core4.DURABLE_OPTIONS_CANONICAL)),
|
|
586
|
+
_ts_metadata4("design:type", Function),
|
|
587
|
+
_ts_metadata4("design:paramtypes", [
|
|
588
|
+
typeof StateStore === "undefined" ? Object : StateStore,
|
|
589
|
+
typeof DurableModuleOptions === "undefined" ? Object : DurableModuleOptions
|
|
590
|
+
])
|
|
591
|
+
], RetentionPoller);
|
|
592
|
+
|
|
593
|
+
// src/timer-poller.ts
|
|
594
|
+
var import_nestjs_durable_core5 = require("@dudousxd/nestjs-durable-core");
|
|
595
|
+
var import_common5 = require("@nestjs/common");
|
|
596
|
+
function _ts_decorate5(decorators, target, key, desc) {
|
|
597
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
598
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
599
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
600
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
601
|
+
}
|
|
602
|
+
__name(_ts_decorate5, "_ts_decorate");
|
|
603
|
+
function _ts_metadata5(k, v) {
|
|
604
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
605
|
+
}
|
|
606
|
+
__name(_ts_metadata5, "_ts_metadata");
|
|
607
|
+
function _ts_param4(paramIndex, decorator) {
|
|
608
|
+
return function(target, key) {
|
|
609
|
+
decorator(target, key, paramIndex);
|
|
610
|
+
};
|
|
611
|
+
}
|
|
612
|
+
__name(_ts_param4, "_ts_param");
|
|
507
613
|
var TimerPoller = class {
|
|
508
614
|
static {
|
|
509
615
|
__name(this, "TimerPoller");
|
|
@@ -541,19 +647,19 @@ var TimerPoller = class {
|
|
|
541
647
|
await this.engine.sweepTimeouts();
|
|
542
648
|
const schedules = this.options.schedules;
|
|
543
649
|
if (schedules && schedules.length > 0) {
|
|
544
|
-
await (0,
|
|
650
|
+
await (0, import_nestjs_durable_core5.runSchedules)(this.engine, schedules, Date.now());
|
|
545
651
|
}
|
|
546
652
|
} finally {
|
|
547
653
|
this.polling = false;
|
|
548
654
|
}
|
|
549
655
|
}
|
|
550
656
|
};
|
|
551
|
-
TimerPoller =
|
|
552
|
-
(0,
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
typeof
|
|
657
|
+
TimerPoller = _ts_decorate5([
|
|
658
|
+
(0, import_common5.Injectable)(),
|
|
659
|
+
_ts_param4(1, (0, import_common5.Inject)(import_nestjs_durable_core5.DURABLE_OPTIONS_CANONICAL)),
|
|
660
|
+
_ts_metadata5("design:type", Function),
|
|
661
|
+
_ts_metadata5("design:paramtypes", [
|
|
662
|
+
typeof import_nestjs_durable_core5.WorkflowEngine === "undefined" ? Object : import_nestjs_durable_core5.WorkflowEngine,
|
|
557
663
|
typeof DurableModuleOptions === "undefined" ? Object : DurableModuleOptions
|
|
558
664
|
])
|
|
559
665
|
], TimerPoller);
|
|
@@ -562,8 +668,8 @@ TimerPoller = _ts_decorate4([
|
|
|
562
668
|
var CONTEXT_ACCESSOR = Symbol.for("@dudousxd/nestjs-context:accessor");
|
|
563
669
|
|
|
564
670
|
// src/workflow.registrar.ts
|
|
565
|
-
var
|
|
566
|
-
var
|
|
671
|
+
var import_nestjs_durable_core6 = require("@dudousxd/nestjs-durable-core");
|
|
672
|
+
var import_common6 = require("@nestjs/common");
|
|
567
673
|
var import_core3 = require("@nestjs/core");
|
|
568
674
|
|
|
569
675
|
// src/input-validation.ts
|
|
@@ -606,23 +712,23 @@ function isStepInterceptor(target) {
|
|
|
606
712
|
__name(isStepInterceptor, "isStepInterceptor");
|
|
607
713
|
|
|
608
714
|
// src/workflow.registrar.ts
|
|
609
|
-
function
|
|
715
|
+
function _ts_decorate6(decorators, target, key, desc) {
|
|
610
716
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
611
717
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
612
718
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
613
719
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
614
720
|
}
|
|
615
|
-
__name(
|
|
616
|
-
function
|
|
721
|
+
__name(_ts_decorate6, "_ts_decorate");
|
|
722
|
+
function _ts_metadata6(k, v) {
|
|
617
723
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
618
724
|
}
|
|
619
|
-
__name(
|
|
620
|
-
function
|
|
725
|
+
__name(_ts_metadata6, "_ts_metadata");
|
|
726
|
+
function _ts_param5(paramIndex, decorator) {
|
|
621
727
|
return function(target, key) {
|
|
622
728
|
decorator(target, key, paramIndex);
|
|
623
729
|
};
|
|
624
730
|
}
|
|
625
|
-
__name(
|
|
731
|
+
__name(_ts_param5, "_ts_param");
|
|
626
732
|
var WorkflowRegistrar = class {
|
|
627
733
|
static {
|
|
628
734
|
__name(this, "WorkflowRegistrar");
|
|
@@ -675,11 +781,11 @@ var WorkflowRegistrar = class {
|
|
|
675
781
|
const validateInput = meta.validateInput ?? (meta.inputSchema ? classValidatorInput(meta.inputSchema) : void 0);
|
|
676
782
|
const eventBatch = meta.debounce ? {
|
|
677
783
|
mode: "debounce",
|
|
678
|
-
windowMs: (0,
|
|
784
|
+
windowMs: (0, import_nestjs_durable_core6.parseDuration)(meta.debounce)
|
|
679
785
|
} : meta.batch ? {
|
|
680
786
|
mode: "batch",
|
|
681
787
|
maxSize: meta.batch.maxSize,
|
|
682
|
-
windowMs: (0,
|
|
788
|
+
windowMs: (0, import_nestjs_durable_core6.parseDuration)(meta.batch.within)
|
|
683
789
|
} : void 0;
|
|
684
790
|
const workflowCtor = workflow.constructor;
|
|
685
791
|
this.engine.register(meta.name, meta.version, (ctx, input) => workflow.run(ctx, input), {
|
|
@@ -699,7 +805,7 @@ var WorkflowRegistrar = class {
|
|
|
699
805
|
this.engine.register(dlqName, meta.version, inline);
|
|
700
806
|
deadLetterByWorkflow.set(meta.name, dlqName);
|
|
701
807
|
} else if (meta.deadLetterWorkflow) {
|
|
702
|
-
deadLetterByWorkflow.set(meta.name, (0,
|
|
808
|
+
deadLetterByWorkflow.set(meta.name, (0, import_nestjs_durable_core6.workflowName)(meta.deadLetterWorkflow));
|
|
703
809
|
}
|
|
704
810
|
});
|
|
705
811
|
this.installDeadLetterRouting(deadLetterByWorkflow);
|
|
@@ -721,7 +827,7 @@ var WorkflowRegistrar = class {
|
|
|
721
827
|
* a `dlq:<runId>` id, so re-recovery never double-dispatches.
|
|
722
828
|
*/
|
|
723
829
|
installDeadLetterRouting(byWorkflow) {
|
|
724
|
-
const fallback = this.options.deadLetterWorkflow ? (0,
|
|
830
|
+
const fallback = this.options.deadLetterWorkflow ? (0, import_nestjs_durable_core6.workflowName)(this.options.deadLetterWorkflow) : void 0;
|
|
725
831
|
if (byWorkflow.size === 0 && !fallback) return;
|
|
726
832
|
this.engine.onDead((run) => {
|
|
727
833
|
const target = byWorkflow.get(run.workflow) ?? fallback;
|
|
@@ -735,15 +841,15 @@ var WorkflowRegistrar = class {
|
|
|
735
841
|
});
|
|
736
842
|
}
|
|
737
843
|
};
|
|
738
|
-
WorkflowRegistrar =
|
|
739
|
-
(0,
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
844
|
+
WorkflowRegistrar = _ts_decorate6([
|
|
845
|
+
(0, import_common6.Injectable)(),
|
|
846
|
+
_ts_param5(3, (0, import_common6.Inject)(import_nestjs_durable_core6.STATE_STORE_CANONICAL)),
|
|
847
|
+
_ts_param5(4, (0, import_common6.Inject)(import_nestjs_durable_core6.DURABLE_OPTIONS_CANONICAL)),
|
|
848
|
+
_ts_metadata6("design:type", Function),
|
|
849
|
+
_ts_metadata6("design:paramtypes", [
|
|
744
850
|
typeof import_core3.DiscoveryService === "undefined" ? Object : import_core3.DiscoveryService,
|
|
745
851
|
typeof import_core3.MetadataScanner === "undefined" ? Object : import_core3.MetadataScanner,
|
|
746
|
-
typeof
|
|
852
|
+
typeof import_nestjs_durable_core6.WorkflowEngine === "undefined" ? Object : import_nestjs_durable_core6.WorkflowEngine,
|
|
747
853
|
typeof StateStore === "undefined" ? Object : StateStore,
|
|
748
854
|
typeof DurableModuleOptions === "undefined" ? Object : DurableModuleOptions
|
|
749
855
|
])
|
|
@@ -751,19 +857,19 @@ WorkflowRegistrar = _ts_decorate5([
|
|
|
751
857
|
|
|
752
858
|
// src/workflow.service.ts
|
|
753
859
|
var import_node_crypto = require("crypto");
|
|
754
|
-
var
|
|
755
|
-
var
|
|
756
|
-
function
|
|
860
|
+
var import_nestjs_durable_core7 = require("@dudousxd/nestjs-durable-core");
|
|
861
|
+
var import_common7 = require("@nestjs/common");
|
|
862
|
+
function _ts_decorate7(decorators, target, key, desc) {
|
|
757
863
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
758
864
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
759
865
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
760
866
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
761
867
|
}
|
|
762
|
-
__name(
|
|
763
|
-
function
|
|
868
|
+
__name(_ts_decorate7, "_ts_decorate");
|
|
869
|
+
function _ts_metadata7(k, v) {
|
|
764
870
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
765
871
|
}
|
|
766
|
-
__name(
|
|
872
|
+
__name(_ts_metadata7, "_ts_metadata");
|
|
767
873
|
var WorkflowService = class {
|
|
768
874
|
static {
|
|
769
875
|
__name(this, "WorkflowService");
|
|
@@ -803,22 +909,22 @@ var WorkflowService = class {
|
|
|
803
909
|
return this.engine.publishEvent(name, payload, opts);
|
|
804
910
|
}
|
|
805
911
|
};
|
|
806
|
-
WorkflowService =
|
|
807
|
-
(0,
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
typeof
|
|
912
|
+
WorkflowService = _ts_decorate7([
|
|
913
|
+
(0, import_common7.Injectable)(),
|
|
914
|
+
_ts_metadata7("design:type", Function),
|
|
915
|
+
_ts_metadata7("design:paramtypes", [
|
|
916
|
+
typeof import_nestjs_durable_core7.WorkflowEngine === "undefined" ? Object : import_nestjs_durable_core7.WorkflowEngine
|
|
811
917
|
])
|
|
812
918
|
], WorkflowService);
|
|
813
919
|
|
|
814
920
|
// src/durable.module.ts
|
|
815
|
-
function
|
|
921
|
+
function _ts_decorate8(decorators, target, key, desc) {
|
|
816
922
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
817
923
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
818
924
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
819
925
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
820
926
|
}
|
|
821
|
-
__name(
|
|
927
|
+
__name(_ts_decorate8, "_ts_decorate");
|
|
822
928
|
function resolveAccessor(moduleRef) {
|
|
823
929
|
try {
|
|
824
930
|
return moduleRef.get(CONTEXT_ACCESSOR, {
|
|
@@ -864,13 +970,13 @@ var DurableModule = class _DurableModule {
|
|
|
864
970
|
}
|
|
865
971
|
static forRoot(options) {
|
|
866
972
|
return _DurableModule.build({
|
|
867
|
-
provide:
|
|
973
|
+
provide: import_nestjs_durable_core8.DURABLE_OPTIONS_CANONICAL,
|
|
868
974
|
useValue: options
|
|
869
975
|
});
|
|
870
976
|
}
|
|
871
977
|
static forRootAsync(options) {
|
|
872
978
|
return _DurableModule.build({
|
|
873
|
-
provide:
|
|
979
|
+
provide: import_nestjs_durable_core8.DURABLE_OPTIONS_CANONICAL,
|
|
874
980
|
useFactory: options.useFactory,
|
|
875
981
|
inject: options.inject ?? []
|
|
876
982
|
});
|
|
@@ -885,41 +991,41 @@ var DurableModule = class _DurableModule {
|
|
|
885
991
|
providers: [
|
|
886
992
|
optionsProvider,
|
|
887
993
|
{
|
|
888
|
-
provide:
|
|
994
|
+
provide: import_nestjs_durable_core8.STATE_STORE_CANONICAL,
|
|
889
995
|
useFactory: /* @__PURE__ */ __name((options) => options.store, "useFactory"),
|
|
890
996
|
inject: [
|
|
891
|
-
|
|
997
|
+
import_nestjs_durable_core8.DURABLE_OPTIONS_CANONICAL
|
|
892
998
|
]
|
|
893
999
|
},
|
|
894
1000
|
{
|
|
895
|
-
provide:
|
|
1001
|
+
provide: import_nestjs_durable_core8.TRANSPORT_CANONICAL,
|
|
896
1002
|
useFactory: /* @__PURE__ */ __name((options) => options.transport ?? null, "useFactory"),
|
|
897
1003
|
inject: [
|
|
898
|
-
|
|
1004
|
+
import_nestjs_durable_core8.DURABLE_OPTIONS_CANONICAL
|
|
899
1005
|
]
|
|
900
1006
|
},
|
|
901
1007
|
// Legacy back-compat aliases (deprecated tokens still resolve to the same instances):
|
|
902
1008
|
{
|
|
903
|
-
provide:
|
|
904
|
-
useExisting:
|
|
1009
|
+
provide: import_nestjs_durable_core8.STATE_STORE,
|
|
1010
|
+
useExisting: import_nestjs_durable_core8.STATE_STORE_CANONICAL
|
|
905
1011
|
},
|
|
906
1012
|
{
|
|
907
|
-
provide:
|
|
908
|
-
useExisting:
|
|
1013
|
+
provide: import_nestjs_durable_core8.TRANSPORT,
|
|
1014
|
+
useExisting: import_nestjs_durable_core8.TRANSPORT_CANONICAL
|
|
909
1015
|
},
|
|
910
1016
|
{
|
|
911
|
-
provide:
|
|
912
|
-
useExisting:
|
|
1017
|
+
provide: import_nestjs_durable_core8.DURABLE_OPTIONS,
|
|
1018
|
+
useExisting: import_nestjs_durable_core8.DURABLE_OPTIONS_CANONICAL
|
|
913
1019
|
},
|
|
914
1020
|
{
|
|
915
|
-
provide:
|
|
1021
|
+
provide: import_nestjs_durable_core8.WorkflowEngine,
|
|
916
1022
|
useFactory: /* @__PURE__ */ __name(async (store, transport, opts, moduleRef) => {
|
|
917
1023
|
const primary = transport ?? opts.transports?.[0]?.transport;
|
|
918
1024
|
const accessor = resolveAccessor(moduleRef);
|
|
919
1025
|
const context = opts.context ?? (accessor ? () => carrierFromAccessor(accessor) : void 0);
|
|
920
1026
|
const runtime = accessor ? await resolveContextRuntime() : void 0;
|
|
921
1027
|
const rehydrate = runtime && ((carrier, fn) => carrier && Object.keys(carrier).length > 0 ? runtime.deserialize(carrier, fn) : fn());
|
|
922
|
-
const engine = new
|
|
1028
|
+
const engine = new import_nestjs_durable_core8.WorkflowEngine({
|
|
923
1029
|
store,
|
|
924
1030
|
transport: transport ?? void 0,
|
|
925
1031
|
transports: opts.transports,
|
|
@@ -927,6 +1033,7 @@ var DurableModule = class _DurableModule {
|
|
|
927
1033
|
leaseMs: opts.leaseMs,
|
|
928
1034
|
admission: opts.admission,
|
|
929
1035
|
maxRecoveryAttempts: opts.maxRecoveryAttempts,
|
|
1036
|
+
remoteAdvanceSilenceMs: opts.remoteAdvanceSilenceMs,
|
|
930
1037
|
instanceId: opts.instanceId,
|
|
931
1038
|
webhookUrl: opts.webhookUrl,
|
|
932
1039
|
traceparent: opts.traceparent,
|
|
@@ -945,9 +1052,9 @@ var DurableModule = class _DurableModule {
|
|
|
945
1052
|
return engine;
|
|
946
1053
|
}, "useFactory"),
|
|
947
1054
|
inject: [
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
1055
|
+
import_nestjs_durable_core8.STATE_STORE_CANONICAL,
|
|
1056
|
+
import_nestjs_durable_core8.TRANSPORT_CANONICAL,
|
|
1057
|
+
import_nestjs_durable_core8.DURABLE_OPTIONS_CANONICAL,
|
|
951
1058
|
import_core4.ModuleRef
|
|
952
1059
|
]
|
|
953
1060
|
},
|
|
@@ -955,23 +1062,24 @@ var DurableModule = class _DurableModule {
|
|
|
955
1062
|
EntityService,
|
|
956
1063
|
WorkflowRegistrar,
|
|
957
1064
|
DurableStepRegistrar,
|
|
958
|
-
TimerPoller
|
|
1065
|
+
TimerPoller,
|
|
1066
|
+
RetentionPoller
|
|
959
1067
|
],
|
|
960
1068
|
exports: [
|
|
961
1069
|
WorkflowService,
|
|
962
1070
|
EntityService,
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
1071
|
+
import_nestjs_durable_core8.WorkflowEngine,
|
|
1072
|
+
import_nestjs_durable_core8.STATE_STORE,
|
|
1073
|
+
import_nestjs_durable_core8.STATE_STORE_CANONICAL,
|
|
1074
|
+
import_nestjs_durable_core8.TRANSPORT,
|
|
1075
|
+
import_nestjs_durable_core8.TRANSPORT_CANONICAL,
|
|
1076
|
+
import_nestjs_durable_core8.DURABLE_OPTIONS_CANONICAL
|
|
969
1077
|
]
|
|
970
1078
|
};
|
|
971
1079
|
}
|
|
972
1080
|
};
|
|
973
|
-
DurableModule =
|
|
974
|
-
(0,
|
|
1081
|
+
DurableModule = _ts_decorate8([
|
|
1082
|
+
(0, import_common8.Module)({})
|
|
975
1083
|
], DurableModule);
|
|
976
1084
|
// Annotate the CommonJS export names for ESM import in node:
|
|
977
1085
|
0 && (module.exports = {
|