@nestjs-transactional/outbox 1.1.0 → 2.0.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/README.md +14 -0
- package/dist/api/completed-event-publications.d.ts +2 -2
- package/dist/api/completed-event-publications.js +6 -9
- package/dist/api/completed-event-publications.js.map +1 -1
- package/dist/api/failed-event-publications.d.ts +3 -3
- package/dist/api/failed-event-publications.js +10 -13
- package/dist/api/failed-event-publications.js.map +1 -1
- package/dist/api/incomplete-event-publications.d.ts +3 -3
- package/dist/api/incomplete-event-publications.js +11 -14
- package/dist/api/incomplete-event-publications.js.map +1 -1
- package/dist/decorators/inject-decorators.js +12 -24
- package/dist/decorators/inject-decorators.js.map +1 -1
- package/dist/decorators/outbox-events-handler.decorator.js +6 -11
- package/dist/decorators/outbox-events-handler.decorator.js.map +1 -1
- package/dist/dispatcher/data-source-outbox-publisher.d.ts +2 -2
- package/dist/dispatcher/data-source-outbox-publisher.js +7 -11
- package/dist/dispatcher/data-source-outbox-publisher.js.map +1 -1
- package/dist/dispatcher/event-publication-processor.d.ts +5 -5
- package/dist/dispatcher/event-publication-processor.js +18 -21
- package/dist/dispatcher/event-publication-processor.js.map +1 -1
- package/dist/dispatcher/outbox-event-publisher.js +16 -19
- package/dist/dispatcher/outbox-event-publisher.js.map +1 -1
- package/dist/dispatcher/processor-options.d.ts +1 -1
- package/dist/dispatcher/processor-options.js +5 -8
- package/dist/dispatcher/processor-options.js.map +1 -1
- package/dist/externalization/describe-thrown.js +1 -4
- package/dist/externalization/describe-thrown.js.map +1 -1
- package/dist/externalization/errors.d.ts +1 -1
- package/dist/externalization/errors.js +2 -6
- package/dist/externalization/errors.js.map +1 -1
- package/dist/externalization/event-externalizer.d.ts +1 -1
- package/dist/externalization/event-externalizer.js +1 -4
- package/dist/externalization/event-externalizer.js.map +1 -1
- package/dist/externalization/externalization-registry.d.ts +3 -3
- package/dist/externalization/externalization-registry.js +10 -13
- package/dist/externalization/externalization-registry.js.map +1 -1
- package/dist/externalization/externalized.decorator.js +6 -11
- package/dist/externalization/externalized.decorator.js.map +1 -1
- package/dist/externalization/types.js +1 -2
- package/dist/index.d.ts +43 -43
- package/dist/index.js +39 -65
- package/dist/index.js.map +1 -1
- package/dist/interfaces/outbox-event-handler.interface.js +1 -2
- package/dist/module/outbox-processing.module.d.ts +1 -1
- package/dist/module/outbox-processing.module.js +6 -9
- package/dist/module/outbox-processing.module.js.map +1 -1
- package/dist/module/outbox.module.d.ts +10 -10
- package/dist/module/outbox.module.js +145 -148
- package/dist/module/outbox.module.js.map +1 -1
- package/dist/recovery/outbox-cleanup-scheduler.d.ts +2 -2
- package/dist/recovery/outbox-cleanup-scheduler.js +7 -10
- package/dist/recovery/outbox-cleanup-scheduler.js.map +1 -1
- package/dist/recovery/outbox-retry-scheduler.d.ts +2 -2
- package/dist/recovery/outbox-retry-scheduler.js +11 -14
- package/dist/recovery/outbox-retry-scheduler.js.map +1 -1
- package/dist/recovery/staleness-monitor.d.ts +2 -2
- package/dist/recovery/staleness-monitor.js +14 -17
- package/dist/recovery/staleness-monitor.js.map +1 -1
- package/dist/recovery/startup-recovery.d.ts +1 -1
- package/dist/recovery/startup-recovery.js +11 -14
- package/dist/recovery/startup-recovery.js.map +1 -1
- package/dist/registry/event-publication-registry.d.ts +4 -4
- package/dist/registry/event-publication-registry.js +17 -20
- package/dist/registry/event-publication-registry.js.map +1 -1
- package/dist/registry/listener-registry.js +6 -9
- package/dist/registry/listener-registry.js.map +1 -1
- package/dist/registry/multi-ds-listener-registrar.d.ts +1 -1
- package/dist/registry/multi-ds-listener-registrar.js +15 -18
- package/dist/registry/multi-ds-listener-registrar.js.map +1 -1
- package/dist/registry/outbox-listener-scanner.d.ts +1 -1
- package/dist/registry/outbox-listener-scanner.js +23 -27
- package/dist/registry/outbox-listener-scanner.js.map +1 -1
- package/dist/repository/event-publication-repository.d.ts +2 -2
- package/dist/repository/event-publication-repository.js +1 -4
- package/dist/repository/event-publication-repository.js.map +1 -1
- package/dist/serialization/event-serializer.js +1 -4
- package/dist/serialization/event-serializer.js.map +1 -1
- package/dist/serialization/event-type-registry.js +5 -8
- package/dist/serialization/event-type-registry.js.map +1 -1
- package/dist/serialization/event-type-resolver.d.ts +1 -1
- package/dist/serialization/event-type-resolver.js +4 -7
- package/dist/serialization/event-type-resolver.js.map +1 -1
- package/dist/serialization/json-event-serializer.d.ts +2 -2
- package/dist/serialization/json-event-serializer.js +10 -13
- package/dist/serialization/json-event-serializer.js.map +1 -1
- package/dist/shutdown/drain.js +2 -6
- package/dist/shutdown/drain.js.map +1 -1
- package/dist/testing/assertable-published-events.d.ts +1 -1
- package/dist/testing/assertable-published-events.js +8 -13
- package/dist/testing/assertable-published-events.js.map +1 -1
- package/dist/testing/in-memory-repository.d.ts +3 -3
- package/dist/testing/in-memory-repository.js +22 -25
- package/dist/testing/in-memory-repository.js.map +1 -1
- package/dist/testing/index.d.ts +3 -3
- package/dist/testing/index.js +3 -19
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/published-events.d.ts +3 -3
- package/dist/testing/published-events.js +9 -13
- package/dist/testing/published-events.js.map +1 -1
- package/dist/tokens/index.d.ts +1 -1
- package/dist/tokens/index.js +1 -13
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/token-utils.js +10 -21
- package/dist/tokens/token-utils.js.map +1 -1
- package/dist/types/cleanup-config.js +3 -6
- package/dist/types/cleanup-config.js.map +1 -1
- package/dist/types/completion-mode.js +2 -5
- package/dist/types/completion-mode.js.map +1 -1
- package/dist/types/errors.d.ts +1 -1
- package/dist/types/errors.js +7 -16
- package/dist/types/errors.js.map +1 -1
- package/dist/types/event-publication.d.ts +1 -1
- package/dist/types/event-publication.js +1 -2
- package/dist/types/publication-status.js +2 -5
- package/dist/types/publication-status.js.map +1 -1
- package/dist/types/resubmission-options.d.ts +1 -1
- package/dist/types/resubmission-options.js +1 -5
- package/dist/types/resubmission-options.js.map +1 -1
- package/dist/types/retry-config.js +3 -6
- package/dist/types/retry-config.js.map +1 -1
- package/dist/types/staleness-config.js +3 -6
- package/dist/types/staleness-config.js.map +1 -1
- package/package.json +13 -12
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -12,13 +11,11 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
12
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
12
|
};
|
|
14
13
|
var OutboxEventPublisher_1;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const token_utils_1 = require("../tokens/token-utils");
|
|
21
|
-
const errors_1 = require("../types/errors");
|
|
14
|
+
import { Inject, Injectable, Logger } from '@nestjs/common';
|
|
15
|
+
import { ModuleRef } from '@nestjs/core';
|
|
16
|
+
import { resolveDataSourceByEventTypeName } from '../serialization/event-type-resolver.js';
|
|
17
|
+
import { getEventTypeRegistryToken, getOutboxPublisherToken } from '../tokens/token-utils.js';
|
|
18
|
+
import { OutboxError } from '../types/errors.js';
|
|
22
19
|
/**
|
|
23
20
|
* High-level smart-facade publisher (DD-024). The single user-facing
|
|
24
21
|
* publisher class — application code injects `OutboxEventPublisher`
|
|
@@ -52,11 +49,11 @@ const errors_1 = require("../types/errors");
|
|
|
52
49
|
* with the registered event-type ownership.
|
|
53
50
|
*/
|
|
54
51
|
/** @internal — DI token carrying the live Map of registered dataSources. */
|
|
55
|
-
|
|
52
|
+
export const OUTBOX_DATA_SOURCE_NAMES = Symbol('OUTBOX_DATA_SOURCE_NAMES');
|
|
56
53
|
let OutboxEventPublisher = OutboxEventPublisher_1 = class OutboxEventPublisher {
|
|
57
54
|
moduleRef;
|
|
58
55
|
dataSourceNames;
|
|
59
|
-
logger = new
|
|
56
|
+
logger = new Logger(OutboxEventPublisher_1.name);
|
|
60
57
|
publishers = new Map();
|
|
61
58
|
eventTypeRegistries = new Map();
|
|
62
59
|
constructor(moduleRef, dataSourceNames) {
|
|
@@ -73,10 +70,10 @@ let OutboxEventPublisher = OutboxEventPublisher_1 = class OutboxEventPublisher {
|
|
|
73
70
|
*/
|
|
74
71
|
onModuleInit() {
|
|
75
72
|
for (const ds of this.dataSourceNames.keys()) {
|
|
76
|
-
this.publishers.set(ds, this.moduleRef.get(
|
|
73
|
+
this.publishers.set(ds, this.moduleRef.get(getOutboxPublisherToken(ds), {
|
|
77
74
|
strict: false,
|
|
78
75
|
}));
|
|
79
|
-
this.eventTypeRegistries.set(ds, this.moduleRef.get(
|
|
76
|
+
this.eventTypeRegistries.set(ds, this.moduleRef.get(getEventTypeRegistryToken(ds), {
|
|
80
77
|
strict: false,
|
|
81
78
|
}));
|
|
82
79
|
}
|
|
@@ -152,21 +149,21 @@ let OutboxEventPublisher = OutboxEventPublisher_1 = class OutboxEventPublisher {
|
|
|
152
149
|
// owning DS per event class, throw on 0 or many matches) stays
|
|
153
150
|
// consistent across publish and listener-registration paths.
|
|
154
151
|
const eventType = event.constructor.name;
|
|
155
|
-
return
|
|
152
|
+
return resolveDataSourceByEventTypeName(eventType, this.eventTypeRegistries);
|
|
156
153
|
}
|
|
157
154
|
requirePublisher(dataSource) {
|
|
158
155
|
const publisher = this.publishers.get(dataSource);
|
|
159
156
|
if (publisher === undefined) {
|
|
160
|
-
throw new
|
|
157
|
+
throw new OutboxError(`No outbox configured for dataSource '${dataSource}'. ` +
|
|
161
158
|
`Add 'OutboxModule.forRoot({ dataSource: '${dataSource}' })' to the module imports.`);
|
|
162
159
|
}
|
|
163
160
|
return publisher;
|
|
164
161
|
}
|
|
165
162
|
};
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
(
|
|
169
|
-
|
|
170
|
-
__metadata("design:paramtypes", [core_1.ModuleRef, Object])
|
|
163
|
+
OutboxEventPublisher = OutboxEventPublisher_1 = __decorate([
|
|
164
|
+
Injectable(),
|
|
165
|
+
__param(1, Inject(OUTBOX_DATA_SOURCE_NAMES)),
|
|
166
|
+
__metadata("design:paramtypes", [ModuleRef, Object])
|
|
171
167
|
], OutboxEventPublisher);
|
|
168
|
+
export { OutboxEventPublisher };
|
|
172
169
|
//# sourceMappingURL=outbox-event-publisher.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outbox-event-publisher.js","sourceRoot":"","sources":["../../src/dispatcher/outbox-event-publisher.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"outbox-event-publisher.js","sourceRoot":"","sources":["../../src/dispatcher/outbox-event-publisher.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAqB,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAE,gCAAgC,EAAE,MAAM,yCAAyC,CAAC;AAC3F,OAAO,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAC9F,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAsBjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAMpE,IAAM,oBAAoB,4BAA1B,MAAM,oBAAoB;IAMZ;IASA;IAdF,MAAM,GAAG,IAAI,MAAM,CAAC,sBAAoB,CAAC,IAAI,CAAC,CAAC;IAC/C,UAAU,GAAG,IAAI,GAAG,EAAqC,CAAC;IAC1D,mBAAmB,GAAG,IAAI,GAAG,EAA6B,CAAC;IAE5E,YACmB,SAAoB,EASpB,eAAsC;QATtC,cAAS,GAAT,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AS,CAAC;IACnB,CAAC;CACF,CAAA;AAxIY,oBAAoB;IADhC,UAAU,EAAE;IAeR,WAAA,MAAM,CAAC,wBAAwB,CAAC,CAAA;qCARL,SAAS;GAN5B,oBAAoB,CAwIhC"}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.DEFAULT_PROCESSOR_OPTIONS = void 0;
|
|
4
|
-
const drain_1 = require("../shutdown/drain");
|
|
5
|
-
const completion_mode_1 = require("../types/completion-mode");
|
|
1
|
+
import { DEFAULT_DRAIN_TIMEOUT_MS } from '../shutdown/drain.js';
|
|
2
|
+
import { CompletionMode } from '../types/completion-mode.js';
|
|
6
3
|
/**
|
|
7
4
|
* Reasonable defaults for local development — a 1-second poll, 100 rows
|
|
8
5
|
* per batch, 10 parallel listener invocations, `UPDATE` completion, and
|
|
9
6
|
* a 10-second shutdown drain.
|
|
10
7
|
*/
|
|
11
|
-
|
|
8
|
+
export const DEFAULT_PROCESSOR_OPTIONS = {
|
|
12
9
|
pollingInterval: 1000,
|
|
13
10
|
batchSize: 100,
|
|
14
11
|
maxConcurrent: 10,
|
|
15
|
-
completionMode:
|
|
16
|
-
shutdownTimeout:
|
|
12
|
+
completionMode: CompletionMode.UPDATE,
|
|
13
|
+
shutdownTimeout: DEFAULT_DRAIN_TIMEOUT_MS,
|
|
17
14
|
};
|
|
18
15
|
//# sourceMappingURL=processor-options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processor-options.js","sourceRoot":"","sources":["../../src/dispatcher/processor-options.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"processor-options.js","sourceRoot":"","sources":["../../src/dispatcher/processor-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AA+B7D;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAqC;IACzE,eAAe,EAAE,IAAI;IACrB,SAAS,EAAE,GAAG;IACd,aAAa,EAAE,EAAE;IACjB,cAAc,EAAE,cAAc,CAAC,MAAM;IACrC,eAAe,EAAE,wBAAwB;CAC1C,CAAC"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.describeThrown = describeThrown;
|
|
4
1
|
/**
|
|
5
2
|
* Render an unknown thrown value as something an operator can read.
|
|
6
3
|
*
|
|
@@ -19,7 +16,7 @@ exports.describeThrown = describeThrown;
|
|
|
19
16
|
* `[object Object]` of last resort for something with a throwing or
|
|
20
17
|
* circular shape.
|
|
21
18
|
*/
|
|
22
|
-
function describeThrown(err) {
|
|
19
|
+
export function describeThrown(err) {
|
|
23
20
|
if (err instanceof Error) {
|
|
24
21
|
return err.message;
|
|
25
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe-thrown.js","sourceRoot":"","sources":["../../src/externalization/describe-thrown.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"describe-thrown.js","sourceRoot":"","sources":["../../src/externalization/describe-thrown.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,cAAc,CAAC,GAAY;IACzC,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;QACzB,OAAO,GAAG,CAAC,OAAO,CAAC;IACrB,CAAC;IACD,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,GAAG,CAAC;IACb,CAAC;IACD,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QAC5C,MAAM,OAAO,GAAI,GAA6B,CAAC,OAAO,CAAC;QACvD,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtD,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;YACjC,6DAA6D;YAC7D,iEAAiE;YACjE,0DAA0D;YAC1D,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;gBACxC,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,kDAAkD;QACpD,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ExternalizationError = void 0;
|
|
4
|
-
const errors_1 = require("../types/errors");
|
|
1
|
+
import { OutboxError } from '../types/errors.js';
|
|
5
2
|
/**
|
|
6
3
|
* Raised when an {@link EventExternalizer} fails to deliver a
|
|
7
4
|
* publication to its external broker target. Carries diagnostic
|
|
@@ -14,7 +11,7 @@ const errors_1 = require("../types/errors");
|
|
|
14
11
|
* require it — any rejection from `externalize()` is recorded on the
|
|
15
12
|
* publication.
|
|
16
13
|
*/
|
|
17
|
-
class ExternalizationError extends
|
|
14
|
+
export class ExternalizationError extends OutboxError {
|
|
18
15
|
eventType;
|
|
19
16
|
target;
|
|
20
17
|
cause;
|
|
@@ -26,5 +23,4 @@ class ExternalizationError extends errors_1.OutboxError {
|
|
|
26
23
|
this.cause = cause;
|
|
27
24
|
}
|
|
28
25
|
}
|
|
29
|
-
exports.ExternalizationError = ExternalizationError;
|
|
30
26
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/externalization/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/externalization/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,oBAAqB,SAAQ,WAAW;IAKxC;IACA;IACA;IANF,IAAI,GAAG,uBAAuB,CAAC;IAExC,YACE,OAAe,EACN,SAAiB,EACjB,MAAc,EACd,KAAa;QAEtB,KAAK,CAAC,OAAO,CAAC,CAAC;QAJN,cAAS,GAAT,SAAS,CAAQ;QACjB,WAAM,GAAN,MAAM,CAAQ;QACd,UAAK,GAAL,KAAK,CAAQ;IAGxB,CAAC;CACF"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EVENT_EXTERNALIZER = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* DI token for {@link EventExternalizer} bindings.
|
|
6
3
|
*
|
|
@@ -10,5 +7,5 @@ exports.EVENT_EXTERNALIZER = void 0;
|
|
|
10
7
|
* `useClass`, `useExisting`, or `useFactory` in the application's
|
|
11
8
|
* module configuration.
|
|
12
9
|
*/
|
|
13
|
-
|
|
10
|
+
export const EVENT_EXTERNALIZER = Symbol('EVENT_EXTERNALIZER');
|
|
14
11
|
//# sourceMappingURL=event-externalizer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-externalizer.js","sourceRoot":"","sources":["../../src/externalization/event-externalizer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"event-externalizer.js","sourceRoot":"","sources":["../../src/externalization/event-externalizer.ts"],"names":[],"mappings":"AAwCA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type OnModuleInit } from '@nestjs/common';
|
|
2
|
-
import { EventTypeRegistry } from '../serialization/event-type-registry';
|
|
3
|
-
import { type ExternalizedMetadata } from './externalized.decorator';
|
|
4
|
-
import type { ExternalizationMetadata } from './types';
|
|
2
|
+
import { EventTypeRegistry } from '../serialization/event-type-registry.js';
|
|
3
|
+
import { type ExternalizedMetadata } from './externalized.decorator.js';
|
|
4
|
+
import type { ExternalizationMetadata } from './types.js';
|
|
5
5
|
/**
|
|
6
6
|
* Registry mapping event type names to their {@link ExternalizedMetadata}.
|
|
7
7
|
*
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9,11 +8,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
10
|
var ExternalizationRegistry_1;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const event_type_registry_1 = require("../serialization/event-type-registry");
|
|
16
|
-
const externalized_decorator_1 = require("./externalized.decorator");
|
|
11
|
+
import { Injectable, Logger } from '@nestjs/common';
|
|
12
|
+
import { EventTypeRegistry } from '../serialization/event-type-registry.js';
|
|
13
|
+
import { getExternalizedMetadata } from './externalized.decorator.js';
|
|
17
14
|
/**
|
|
18
15
|
* Registry mapping event type names to their {@link ExternalizedMetadata}.
|
|
19
16
|
*
|
|
@@ -38,14 +35,14 @@ const externalized_decorator_1 = require("./externalized.decorator");
|
|
|
38
35
|
*/
|
|
39
36
|
let ExternalizationRegistry = ExternalizationRegistry_1 = class ExternalizationRegistry {
|
|
40
37
|
eventTypeRegistry;
|
|
41
|
-
logger = new
|
|
38
|
+
logger = new Logger(ExternalizationRegistry_1.name);
|
|
42
39
|
mapping = new Map();
|
|
43
40
|
constructor(eventTypeRegistry) {
|
|
44
41
|
this.eventTypeRegistry = eventTypeRegistry;
|
|
45
42
|
}
|
|
46
43
|
onModuleInit() {
|
|
47
44
|
for (const [name, type] of this.eventTypeRegistry.getAll()) {
|
|
48
|
-
const metadata =
|
|
45
|
+
const metadata = getExternalizedMetadata(type);
|
|
49
46
|
if (metadata !== undefined) {
|
|
50
47
|
this.mapping.set(name, metadata);
|
|
51
48
|
this.logger.debug(`Registered externalization for ${name} → ${metadata.target}`);
|
|
@@ -88,16 +85,16 @@ let ExternalizationRegistry = ExternalizationRegistry_1 = class ExternalizationR
|
|
|
88
85
|
};
|
|
89
86
|
}
|
|
90
87
|
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
(
|
|
94
|
-
__metadata("design:paramtypes", [event_type_registry_1.EventTypeRegistry])
|
|
88
|
+
ExternalizationRegistry = ExternalizationRegistry_1 = __decorate([
|
|
89
|
+
Injectable(),
|
|
90
|
+
__metadata("design:paramtypes", [EventTypeRegistry])
|
|
95
91
|
], ExternalizationRegistry);
|
|
92
|
+
export { ExternalizationRegistry };
|
|
96
93
|
/**
|
|
97
94
|
* DI token for {@link ExternalizationRegistry}. Use the class token
|
|
98
95
|
* for direct injection — this Symbol is available for code that
|
|
99
96
|
* prefers token-based wiring or needs to override the registry in
|
|
100
97
|
* tests.
|
|
101
98
|
*/
|
|
102
|
-
|
|
99
|
+
export const EXTERNALIZATION_REGISTRY = Symbol('EXTERNALIZATION_REGISTRY');
|
|
103
100
|
//# sourceMappingURL=externalization-registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"externalization-registry.js","sourceRoot":"","sources":["../../src/externalization/externalization-registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"externalization-registry.js","sourceRoot":"","sources":["../../src/externalization/externalization-registry.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAqB,MAAM,gBAAgB,CAAC;AAEvE,OAAO,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IACH,aAAa,CAAC,SAAiB,EAAE,KAAc;QAC7C,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC3C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,OAAO,GAAG,OAAO,MAAM,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;QAE9F,OAAO;YACL,SAAS;YACT,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC;YACtC,OAAO;SACR,CAAC;IACJ,CAAC;CACF,CAAA;AAxDY,uBAAuB;IADnC,UAAU,EAAE;qCAKqC,iBAAiB;GAJtD,uBAAuB,CAwDnC;;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EXTERNALIZED_METADATA = void 0;
|
|
4
|
-
exports.Externalized = Externalized;
|
|
5
|
-
exports.getExternalizedMetadata = getExternalizedMetadata;
|
|
6
|
-
require("reflect-metadata");
|
|
1
|
+
import 'reflect-metadata';
|
|
7
2
|
/**
|
|
8
3
|
* Metadata key under which {@link ExternalizedMetadata} is stored on
|
|
9
4
|
* classes decorated with {@link Externalized}.
|
|
@@ -12,7 +7,7 @@ require("reflect-metadata");
|
|
|
12
7
|
* only by `ExternalizationRegistry` inside outbox; cross-package
|
|
13
8
|
* sharing is not required.
|
|
14
9
|
*/
|
|
15
|
-
|
|
10
|
+
export const EXTERNALIZED_METADATA = Symbol('EXTERNALIZED_METADATA');
|
|
16
11
|
/**
|
|
17
12
|
* Mark an event class for externalization to a message broker.
|
|
18
13
|
*
|
|
@@ -57,7 +52,7 @@ exports.EXTERNALIZED_METADATA = Symbol('EXTERNALIZED_METADATA');
|
|
|
57
52
|
* }
|
|
58
53
|
* ```
|
|
59
54
|
*/
|
|
60
|
-
function Externalized(options) {
|
|
55
|
+
export function Externalized(options) {
|
|
61
56
|
if (typeof options.target !== 'string' || options.target.length === 0) {
|
|
62
57
|
throw new Error('@Externalized requires "target" option as a non-empty string');
|
|
63
58
|
}
|
|
@@ -71,7 +66,7 @@ function Externalized(options) {
|
|
|
71
66
|
headers: options.headers,
|
|
72
67
|
};
|
|
73
68
|
return (target) => {
|
|
74
|
-
Reflect.defineMetadata(
|
|
69
|
+
Reflect.defineMetadata(EXTERNALIZED_METADATA, metadata, target);
|
|
75
70
|
};
|
|
76
71
|
}
|
|
77
72
|
/**
|
|
@@ -79,8 +74,8 @@ function Externalized(options) {
|
|
|
79
74
|
* {@link Externalized}. Returns `undefined` when the class was not
|
|
80
75
|
* decorated.
|
|
81
76
|
*/
|
|
82
|
-
function getExternalizedMetadata(target) {
|
|
83
|
-
const value = Reflect.getMetadata(
|
|
77
|
+
export function getExternalizedMetadata(target) {
|
|
78
|
+
const value = Reflect.getMetadata(EXTERNALIZED_METADATA, target);
|
|
84
79
|
return value;
|
|
85
80
|
}
|
|
86
81
|
//# sourceMappingURL=externalized.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"externalized.decorator.js","sourceRoot":"","sources":["../../src/externalization/externalized.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"externalized.decorator.js","sourceRoot":"","sources":["../../src/externalization/externalized.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;AA8DrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,UAAU,YAAY,CAC1B,OAAoC;IAEpC,IAAI,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtE,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;IAClF,CAAC;IAED,mEAAmE;IACnE,kEAAkE;IAClE,4BAA4B;IAC5B,MAAM,QAAQ,GAAyB;QACrC,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,UAAU,EAAE,OAAO,CAAC,UAAsD;QAC1E,OAAO,EAAE,OAAO,CAAC,OACkE;KACpF,CAAC;IAEF,OAAO,CAAC,MAAc,EAAQ,EAAE;QAC9B,OAAO,CAAC,cAAc,CAAC,qBAAqB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACpD,MAAM,KAAK,GAAY,OAAO,CAAC,WAAW,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;IAC1E,OAAO,KAAyC,CAAC;AACnD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
export * from './types/publication-status';
|
|
2
|
-
export * from './types/event-publication';
|
|
3
|
-
export * from './types/completion-mode';
|
|
4
|
-
export * from './types/resubmission-options';
|
|
5
|
-
export * from './types/staleness-config';
|
|
6
|
-
export * from './types/cleanup-config';
|
|
7
|
-
export * from './types/retry-config';
|
|
8
|
-
export * from './types/errors';
|
|
9
|
-
export { DEFAULT_DRAIN_TIMEOUT_MS } from './shutdown/drain';
|
|
10
|
-
export * from './serialization/event-serializer';
|
|
11
|
-
export * from './serialization/event-type-registry';
|
|
12
|
-
export * from './serialization/event-type-resolver';
|
|
13
|
-
export * from './serialization/json-event-serializer';
|
|
14
|
-
export * from './repository/event-publication-repository';
|
|
15
|
-
export * from './registry/event-publication-registry';
|
|
16
|
-
export * from './registry/listener-registry';
|
|
17
|
-
export * from './registry/multi-ds-listener-registrar';
|
|
18
|
-
export * from './registry/outbox-listener-scanner';
|
|
19
|
-
export * from './decorators/outbox-events-handler.decorator';
|
|
20
|
-
export * from './decorators/inject-decorators';
|
|
21
|
-
export * from './tokens';
|
|
22
|
-
export type { IOutboxEventHandler } from './interfaces/outbox-event-handler.interface';
|
|
23
|
-
export * from './dispatcher/outbox-event-publisher';
|
|
24
|
-
export * from './dispatcher/data-source-outbox-publisher';
|
|
25
|
-
export * from './dispatcher/event-publication-processor';
|
|
26
|
-
export * from './dispatcher/processor-options';
|
|
27
|
-
export type { ExternalizationMetadata } from './externalization/types';
|
|
28
|
-
export type { EventExternalizer } from './externalization/event-externalizer';
|
|
29
|
-
export { EVENT_EXTERNALIZER } from './externalization/event-externalizer';
|
|
30
|
-
export { ExternalizationError } from './externalization/errors';
|
|
31
|
-
export { describeThrown } from './externalization/describe-thrown';
|
|
32
|
-
export { Externalized, getExternalizedMetadata, EXTERNALIZED_METADATA, } from './externalization/externalized.decorator';
|
|
33
|
-
export type { ExternalizedOptions, ExternalizedMetadata, } from './externalization/externalized.decorator';
|
|
34
|
-
export { ExternalizationRegistry, EXTERNALIZATION_REGISTRY, } from './externalization/externalization-registry';
|
|
35
|
-
export * from './recovery/staleness-monitor';
|
|
36
|
-
export * from './recovery/outbox-cleanup-scheduler';
|
|
37
|
-
export * from './recovery/outbox-retry-scheduler';
|
|
38
|
-
export * from './api/failed-event-publications';
|
|
39
|
-
export * from './api/incomplete-event-publications';
|
|
40
|
-
export * from './api/completed-event-publications';
|
|
41
|
-
export * from './recovery/startup-recovery';
|
|
42
|
-
export * from './module/outbox.module';
|
|
43
|
-
export * from './module/outbox-processing.module';
|
|
1
|
+
export * from './types/publication-status.js';
|
|
2
|
+
export * from './types/event-publication.js';
|
|
3
|
+
export * from './types/completion-mode.js';
|
|
4
|
+
export * from './types/resubmission-options.js';
|
|
5
|
+
export * from './types/staleness-config.js';
|
|
6
|
+
export * from './types/cleanup-config.js';
|
|
7
|
+
export * from './types/retry-config.js';
|
|
8
|
+
export * from './types/errors.js';
|
|
9
|
+
export { DEFAULT_DRAIN_TIMEOUT_MS } from './shutdown/drain.js';
|
|
10
|
+
export * from './serialization/event-serializer.js';
|
|
11
|
+
export * from './serialization/event-type-registry.js';
|
|
12
|
+
export * from './serialization/event-type-resolver.js';
|
|
13
|
+
export * from './serialization/json-event-serializer.js';
|
|
14
|
+
export * from './repository/event-publication-repository.js';
|
|
15
|
+
export * from './registry/event-publication-registry.js';
|
|
16
|
+
export * from './registry/listener-registry.js';
|
|
17
|
+
export * from './registry/multi-ds-listener-registrar.js';
|
|
18
|
+
export * from './registry/outbox-listener-scanner.js';
|
|
19
|
+
export * from './decorators/outbox-events-handler.decorator.js';
|
|
20
|
+
export * from './decorators/inject-decorators.js';
|
|
21
|
+
export * from './tokens/index.js';
|
|
22
|
+
export type { IOutboxEventHandler } from './interfaces/outbox-event-handler.interface.js';
|
|
23
|
+
export * from './dispatcher/outbox-event-publisher.js';
|
|
24
|
+
export * from './dispatcher/data-source-outbox-publisher.js';
|
|
25
|
+
export * from './dispatcher/event-publication-processor.js';
|
|
26
|
+
export * from './dispatcher/processor-options.js';
|
|
27
|
+
export type { ExternalizationMetadata } from './externalization/types.js';
|
|
28
|
+
export type { EventExternalizer } from './externalization/event-externalizer.js';
|
|
29
|
+
export { EVENT_EXTERNALIZER } from './externalization/event-externalizer.js';
|
|
30
|
+
export { ExternalizationError } from './externalization/errors.js';
|
|
31
|
+
export { describeThrown } from './externalization/describe-thrown.js';
|
|
32
|
+
export { Externalized, getExternalizedMetadata, EXTERNALIZED_METADATA, } from './externalization/externalized.decorator.js';
|
|
33
|
+
export type { ExternalizedOptions, ExternalizedMetadata, } from './externalization/externalized.decorator.js';
|
|
34
|
+
export { ExternalizationRegistry, EXTERNALIZATION_REGISTRY, } from './externalization/externalization-registry.js';
|
|
35
|
+
export * from './recovery/staleness-monitor.js';
|
|
36
|
+
export * from './recovery/outbox-cleanup-scheduler.js';
|
|
37
|
+
export * from './recovery/outbox-retry-scheduler.js';
|
|
38
|
+
export * from './api/failed-event-publications.js';
|
|
39
|
+
export * from './api/incomplete-event-publications.js';
|
|
40
|
+
export * from './api/completed-event-publications.js';
|
|
41
|
+
export * from './recovery/startup-recovery.js';
|
|
42
|
+
export * from './module/outbox.module.js';
|
|
43
|
+
export * from './module/outbox-processing.module.js';
|
|
44
44
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,68 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
__exportStar(require("./serialization/event-serializer"), exports);
|
|
29
|
-
__exportStar(require("./serialization/event-type-registry"), exports);
|
|
30
|
-
__exportStar(require("./serialization/event-type-resolver"), exports);
|
|
31
|
-
__exportStar(require("./serialization/json-event-serializer"), exports);
|
|
32
|
-
__exportStar(require("./repository/event-publication-repository"), exports);
|
|
33
|
-
__exportStar(require("./registry/event-publication-registry"), exports);
|
|
34
|
-
__exportStar(require("./registry/listener-registry"), exports);
|
|
35
|
-
__exportStar(require("./registry/multi-ds-listener-registrar"), exports);
|
|
36
|
-
__exportStar(require("./registry/outbox-listener-scanner"), exports);
|
|
37
|
-
__exportStar(require("./decorators/outbox-events-handler.decorator"), exports);
|
|
38
|
-
__exportStar(require("./decorators/inject-decorators"), exports);
|
|
39
|
-
__exportStar(require("./tokens"), exports);
|
|
40
|
-
__exportStar(require("./dispatcher/outbox-event-publisher"), exports);
|
|
41
|
-
__exportStar(require("./dispatcher/data-source-outbox-publisher"), exports);
|
|
42
|
-
__exportStar(require("./dispatcher/event-publication-processor"), exports);
|
|
43
|
-
__exportStar(require("./dispatcher/processor-options"), exports);
|
|
44
|
-
var event_externalizer_1 = require("./externalization/event-externalizer");
|
|
45
|
-
Object.defineProperty(exports, "EVENT_EXTERNALIZER", { enumerable: true, get: function () { return event_externalizer_1.EVENT_EXTERNALIZER; } });
|
|
46
|
-
var errors_1 = require("./externalization/errors");
|
|
47
|
-
Object.defineProperty(exports, "ExternalizationError", { enumerable: true, get: function () { return errors_1.ExternalizationError; } });
|
|
1
|
+
export * from './types/publication-status.js';
|
|
2
|
+
export * from './types/event-publication.js';
|
|
3
|
+
export * from './types/completion-mode.js';
|
|
4
|
+
export * from './types/resubmission-options.js';
|
|
5
|
+
export * from './types/staleness-config.js';
|
|
6
|
+
export * from './types/cleanup-config.js';
|
|
7
|
+
export * from './types/retry-config.js';
|
|
8
|
+
export * from './types/errors.js';
|
|
9
|
+
export { DEFAULT_DRAIN_TIMEOUT_MS } from './shutdown/drain.js';
|
|
10
|
+
export * from './serialization/event-serializer.js';
|
|
11
|
+
export * from './serialization/event-type-registry.js';
|
|
12
|
+
export * from './serialization/event-type-resolver.js';
|
|
13
|
+
export * from './serialization/json-event-serializer.js';
|
|
14
|
+
export * from './repository/event-publication-repository.js';
|
|
15
|
+
export * from './registry/event-publication-registry.js';
|
|
16
|
+
export * from './registry/listener-registry.js';
|
|
17
|
+
export * from './registry/multi-ds-listener-registrar.js';
|
|
18
|
+
export * from './registry/outbox-listener-scanner.js';
|
|
19
|
+
export * from './decorators/outbox-events-handler.decorator.js';
|
|
20
|
+
export * from './decorators/inject-decorators.js';
|
|
21
|
+
export * from './tokens/index.js';
|
|
22
|
+
export * from './dispatcher/outbox-event-publisher.js';
|
|
23
|
+
export * from './dispatcher/data-source-outbox-publisher.js';
|
|
24
|
+
export * from './dispatcher/event-publication-processor.js';
|
|
25
|
+
export * from './dispatcher/processor-options.js';
|
|
26
|
+
export { EVENT_EXTERNALIZER } from './externalization/event-externalizer.js';
|
|
27
|
+
export { ExternalizationError } from './externalization/errors.js';
|
|
48
28
|
// Exported because every externalizer implementation faces the same
|
|
49
29
|
// problem: broker clients reject with values that are not `Error`s.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
__exportStar(require("./api/failed-event-publications"), exports);
|
|
63
|
-
__exportStar(require("./api/incomplete-event-publications"), exports);
|
|
64
|
-
__exportStar(require("./api/completed-event-publications"), exports);
|
|
65
|
-
__exportStar(require("./recovery/startup-recovery"), exports);
|
|
66
|
-
__exportStar(require("./module/outbox.module"), exports);
|
|
67
|
-
__exportStar(require("./module/outbox-processing.module"), exports);
|
|
30
|
+
export { describeThrown } from './externalization/describe-thrown.js';
|
|
31
|
+
export { Externalized, getExternalizedMetadata, EXTERNALIZED_METADATA, } from './externalization/externalized.decorator.js';
|
|
32
|
+
export { ExternalizationRegistry, EXTERNALIZATION_REGISTRY, } from './externalization/externalization-registry.js';
|
|
33
|
+
export * from './recovery/staleness-monitor.js';
|
|
34
|
+
export * from './recovery/outbox-cleanup-scheduler.js';
|
|
35
|
+
export * from './recovery/outbox-retry-scheduler.js';
|
|
36
|
+
export * from './api/failed-event-publications.js';
|
|
37
|
+
export * from './api/incomplete-event-publications.js';
|
|
38
|
+
export * from './api/completed-event-publications.js';
|
|
39
|
+
export * from './recovery/startup-recovery.js';
|
|
40
|
+
export * from './module/outbox.module.js';
|
|
41
|
+
export * from './module/outbox-processing.module.js';
|
|
68
42
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAElC,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,0CAA0C,CAAC;AAEzD,cAAc,8CAA8C,CAAC;AAE7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC;AAChD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uCAAuC,CAAC;AAEtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,mCAAmC,CAAC;AAElD,cAAc,mBAAmB,CAAC;AAIlC,cAAc,wCAAwC,CAAC;AACvD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mCAAmC,CAAC;AAIlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,oEAAoE;AACpE,oEAAoE;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,6CAA6C,CAAC;AAKrD,OAAO,EACL,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,+CAA+C,CAAC;AAEvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AAErD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AAEtD,cAAc,gCAAgC,CAAC;AAE/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sCAAsC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type OnApplicationBootstrap, type OnApplicationShutdown } from '@nestjs/common';
|
|
2
|
-
import { type OutboxProcessingBundle } from './outbox.module';
|
|
2
|
+
import { type OutboxProcessingBundle } from './outbox.module.js';
|
|
3
3
|
/**
|
|
4
4
|
* Auto-starts every configured per-dataSource
|
|
5
5
|
* {@link EventPublicationProcessor} and {@link StalenessMonitor} on
|