@nestjs-transactional/outbox 1.0.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 +38 -5
- 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.d.ts +20 -0
- package/dist/externalization/describe-thrown.js +46 -0
- package/dist/externalization/describe-thrown.js.map +1 -0
- 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 -40
- package/dist/index.js +41 -61
- 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 +12 -9
- package/dist/module/outbox-processing.module.js.map +1 -1
- package/dist/module/outbox.module.d.ts +15 -8
- package/dist/module/outbox.module.js +179 -145
- package/dist/module/outbox.module.js.map +1 -1
- package/dist/recovery/outbox-cleanup-scheduler.d.ts +56 -0
- package/dist/recovery/outbox-cleanup-scheduler.js +136 -0
- package/dist/recovery/outbox-cleanup-scheduler.js.map +1 -0
- 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 +14 -3
- 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 +32 -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 +11 -14
- 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.d.ts +59 -0
- package/dist/types/cleanup-config.js +14 -0
- package/dist/types/cleanup-config.js.map +1 -0
- 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 +21 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-utils.js","sourceRoot":"","sources":["../../src/tokens/token-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"token-utils.js","sourceRoot":"","sources":["../../src/tokens/token-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE;;;;;;;;;;GAUG;AAEH;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,aAAqB,wBAAwB;IACnF,OAAO,GAAG,UAAU,sBAAsB,CAAC;AAC7C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CAAC,aAAqB,wBAAwB;IACrF,OAAO,GAAG,UAAU,mBAAmB,CAAC;AAC1C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gCAAgC,CAC9C,aAAqB,wBAAwB;IAE7C,OAAO,GAAG,UAAU,0BAA0B,CAAC;AACjD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iCAAiC,CAC/C,aAAqB,wBAAwB;IAE7C,OAAO,GAAG,UAAU,2BAA2B,CAAC;AAClD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,8BAA8B,CAC5C,aAAqB,wBAAwB;IAE7C,OAAO,GAAG,UAAU,wBAAwB,CAAC;AAC/C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,+BAA+B,CAC7C,aAAqB,wBAAwB;IAE7C,OAAO,GAAG,UAAU,yBAAyB,CAAC;AAChD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kCAAkC,CAChD,aAAqB,wBAAwB;IAE7C,OAAO,GAAG,UAAU,4BAA4B,CAAC;AACnD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CAAC,aAAqB,wBAAwB;IACrF,OAAO,GAAG,UAAU,mBAAmB,CAAC;AAC1C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,6BAA6B,CAC3C,aAAqB,wBAAwB;IAE7C,OAAO,GAAG,UAAU,uBAAuB,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retention policy for publications that reached `COMPLETED`.
|
|
3
|
+
*
|
|
4
|
+
* Under the default `UPDATE` completion mode a delivered publication
|
|
5
|
+
* stays in the table as an audit record, and nothing removes it. That is
|
|
6
|
+
* deliberate, but it means the table grows without bound unless someone
|
|
7
|
+
* purges it. This config puts that purge on a timer.
|
|
8
|
+
*
|
|
9
|
+
* Disabled unless you ask for it: `interval: 0` means the scheduler
|
|
10
|
+
* never schedules its loop, following the same "0 disables" convention
|
|
11
|
+
* as {@link StalenessConfig} and {@link OutboxRetryConfig}. It says so
|
|
12
|
+
* in the log on boot rather than staying quiet, so a half-configured
|
|
13
|
+
* policy is visible instead of silently inert.
|
|
14
|
+
*/
|
|
15
|
+
export interface OutboxCleanupConfig {
|
|
16
|
+
/**
|
|
17
|
+
* How often (ms) a purge pass runs. `0` disables cleanup entirely, in
|
|
18
|
+
* which case retention stays manual through
|
|
19
|
+
* `CompletedEventPublications.purge(...)`.
|
|
20
|
+
*/
|
|
21
|
+
readonly interval: number;
|
|
22
|
+
/**
|
|
23
|
+
* How long (ms) a publication is kept after completion. A pass removes
|
|
24
|
+
* only rows whose `completionDate` is older than this.
|
|
25
|
+
*
|
|
26
|
+
* `0` is allowed and means "no grace period": everything already
|
|
27
|
+
* `COMPLETED` at the moment of the pass is eligible. That is a
|
|
28
|
+
* reasonable choice when the row carries no audit value, and a poor
|
|
29
|
+
* one when it does, so it is not the default.
|
|
30
|
+
*/
|
|
31
|
+
readonly retention: number;
|
|
32
|
+
/**
|
|
33
|
+
* Maximum publications removed per pass.
|
|
34
|
+
*
|
|
35
|
+
* The bound is the point. A single unbounded `DELETE` across a mature
|
|
36
|
+
* table is one long transaction holding locks the writers need, and
|
|
37
|
+
* the first pass after enabling cleanup on an existing deployment is
|
|
38
|
+
* exactly when that table is at its largest. Passes are cheap and
|
|
39
|
+
* frequent, so a backlog drains over several of them instead.
|
|
40
|
+
*/
|
|
41
|
+
readonly batchSize: number;
|
|
42
|
+
/**
|
|
43
|
+
* How long (ms) `stop()` waits for an in-flight pass to finish before
|
|
44
|
+
* abandoning it. `0` disables the wait.
|
|
45
|
+
*
|
|
46
|
+
* Abandoning a pass is safe: deletion is per-publication, so an
|
|
47
|
+
* interrupted pass leaves the rows it had not reached yet, and the
|
|
48
|
+
* next pass picks them up.
|
|
49
|
+
*/
|
|
50
|
+
readonly shutdownTimeout: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Cleanup off; every other value is what it would use if switched on.
|
|
54
|
+
* Seven days of retention is a starting point rather than a
|
|
55
|
+
* recommendation: the right window depends on what the audit trail is
|
|
56
|
+
* for in a given deployment.
|
|
57
|
+
*/
|
|
58
|
+
export declare const DEFAULT_CLEANUP_CONFIG: OutboxCleanupConfig;
|
|
59
|
+
//# sourceMappingURL=cleanup-config.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DEFAULT_DRAIN_TIMEOUT_MS } from '../shutdown/drain.js';
|
|
2
|
+
/**
|
|
3
|
+
* Cleanup off; every other value is what it would use if switched on.
|
|
4
|
+
* Seven days of retention is a starting point rather than a
|
|
5
|
+
* recommendation: the right window depends on what the audit trail is
|
|
6
|
+
* for in a given deployment.
|
|
7
|
+
*/
|
|
8
|
+
export const DEFAULT_CLEANUP_CONFIG = {
|
|
9
|
+
interval: 0,
|
|
10
|
+
retention: 7 * 24 * 60 * 60 * 1000,
|
|
11
|
+
batchSize: 500,
|
|
12
|
+
shutdownTimeout: DEFAULT_DRAIN_TIMEOUT_MS,
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=cleanup-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleanup-config.js","sourceRoot":"","sources":["../../src/types/cleanup-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAsDhE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAwB;IACzD,QAAQ,EAAE,CAAC;IACX,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAClC,SAAS,EAAE,GAAG;IACd,eAAe,EAAE,wBAAwB;CAC1C,CAAC"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CompletionMode = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* Behavior when a publication is successfully completed.
|
|
6
3
|
*
|
|
@@ -11,10 +8,10 @@ exports.CompletionMode = void 0;
|
|
|
11
8
|
* - `ARCHIVE`: move the record to an archive table, keeping it for
|
|
12
9
|
* inspection without weighing down the hot queue.
|
|
13
10
|
*/
|
|
14
|
-
var CompletionMode;
|
|
11
|
+
export var CompletionMode;
|
|
15
12
|
(function (CompletionMode) {
|
|
16
13
|
CompletionMode["UPDATE"] = "UPDATE";
|
|
17
14
|
CompletionMode["DELETE"] = "DELETE";
|
|
18
15
|
CompletionMode["ARCHIVE"] = "ARCHIVE";
|
|
19
|
-
})(CompletionMode || (
|
|
16
|
+
})(CompletionMode || (CompletionMode = {}));
|
|
20
17
|
//# sourceMappingURL=completion-mode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completion-mode.js","sourceRoot":"","sources":["../../src/types/completion-mode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"completion-mode.js","sourceRoot":"","sources":["../../src/types/completion-mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,qCAAmB,CAAA;AACrB,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB"}
|
package/dist/types/errors.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TransactionError } from '@nestjs-transactional/core';
|
|
2
|
-
import type { PublicationStatus } from './publication-status';
|
|
2
|
+
import type { PublicationStatus } from './publication-status.js';
|
|
3
3
|
/**
|
|
4
4
|
* Base class for errors raised by `@nestjs-transactional/outbox`.
|
|
5
5
|
* Subclass for any specific failure mode so that callers can match on
|
package/dist/types/errors.js
CHANGED
|
@@ -1,64 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DuplicateListenerIdError = exports.DeserializationError = exports.SerializationError = exports.InvalidPublicationTransitionError = exports.PublicationNotFoundError = exports.OutboxError = void 0;
|
|
4
|
-
const core_1 = require("@nestjs-transactional/core");
|
|
1
|
+
import { TransactionError } from '@nestjs-transactional/core';
|
|
5
2
|
/**
|
|
6
3
|
* Base class for errors raised by `@nestjs-transactional/outbox`.
|
|
7
4
|
* Subclass for any specific failure mode so that callers can match on
|
|
8
5
|
* `code` without relying on string parsing.
|
|
9
6
|
*/
|
|
10
|
-
class OutboxError extends
|
|
7
|
+
export class OutboxError extends TransactionError {
|
|
11
8
|
code = 'OUTBOX_ERROR';
|
|
12
9
|
}
|
|
13
|
-
exports.OutboxError = OutboxError;
|
|
14
10
|
/**
|
|
15
11
|
* Raised when a lookup by publication ID finds no matching record.
|
|
16
12
|
*/
|
|
17
|
-
class PublicationNotFoundError extends OutboxError {
|
|
13
|
+
export class PublicationNotFoundError extends OutboxError {
|
|
18
14
|
code = 'PUBLICATION_NOT_FOUND';
|
|
19
15
|
constructor(id) {
|
|
20
16
|
super(`Publication not found: ${id}`);
|
|
21
17
|
}
|
|
22
18
|
}
|
|
23
|
-
exports.PublicationNotFoundError = PublicationNotFoundError;
|
|
24
19
|
/**
|
|
25
20
|
* Raised when the registry is asked to move a publication to a state
|
|
26
21
|
* that is not reachable from its current one — e.g. `COMPLETED` →
|
|
27
22
|
* `PROCESSING`.
|
|
28
23
|
*/
|
|
29
|
-
class InvalidPublicationTransitionError extends OutboxError {
|
|
24
|
+
export class InvalidPublicationTransitionError extends OutboxError {
|
|
30
25
|
code = 'INVALID_PUBLICATION_TRANSITION';
|
|
31
26
|
constructor(from, to) {
|
|
32
27
|
super(`Invalid publication state transition: ${from} → ${to}`);
|
|
33
28
|
}
|
|
34
29
|
}
|
|
35
|
-
exports.InvalidPublicationTransitionError = InvalidPublicationTransitionError;
|
|
36
30
|
/**
|
|
37
31
|
* Raised when the serializer cannot encode an event payload — typically
|
|
38
32
|
* because the payload contains non-plain values (functions, cycles, ...).
|
|
39
33
|
*/
|
|
40
|
-
class SerializationError extends OutboxError {
|
|
34
|
+
export class SerializationError extends OutboxError {
|
|
41
35
|
code = 'SERIALIZATION_ERROR';
|
|
42
36
|
}
|
|
43
|
-
exports.SerializationError = SerializationError;
|
|
44
37
|
/**
|
|
45
38
|
* Raised when the serializer cannot decode a stored event payload —
|
|
46
39
|
* typically because the schema has drifted or the type is unregistered.
|
|
47
40
|
*/
|
|
48
|
-
class DeserializationError extends OutboxError {
|
|
41
|
+
export class DeserializationError extends OutboxError {
|
|
49
42
|
code = 'DESERIALIZATION_ERROR';
|
|
50
43
|
}
|
|
51
|
-
exports.DeserializationError = DeserializationError;
|
|
52
44
|
/**
|
|
53
45
|
* Raised when two listeners are registered with the same id. Listener
|
|
54
46
|
* ids must be globally unique because they are stored on each
|
|
55
47
|
* `EventPublication` row and drive retry / resume resolution.
|
|
56
48
|
*/
|
|
57
|
-
class DuplicateListenerIdError extends OutboxError {
|
|
49
|
+
export class DuplicateListenerIdError extends OutboxError {
|
|
58
50
|
code = 'DUPLICATE_LISTENER_ID';
|
|
59
51
|
constructor(id) {
|
|
60
52
|
super(`Listener with id '${id}' is already registered`);
|
|
61
53
|
}
|
|
62
54
|
}
|
|
63
|
-
exports.DuplicateListenerIdError = DuplicateListenerIdError;
|
|
64
55
|
//# sourceMappingURL=errors.js.map
|
package/dist/types/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/types/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/types/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAI9D;;;;GAIG;AACH,MAAM,OAAO,WAAY,SAAQ,gBAAgB;IACtC,IAAI,GAAW,cAAc,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,OAAO,wBAAyB,SAAQ,WAAW;IAC9C,IAAI,GAAG,uBAAuB,CAAC;IAExC,YAAY,EAAU;QACpB,KAAK,CAAC,0BAA0B,EAAE,EAAE,CAAC,CAAC;IACxC,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,iCAAkC,SAAQ,WAAW;IACvD,IAAI,GAAG,gCAAgC,CAAC;IAEjD,YAAY,IAAuB,EAAE,EAAqB;QACxD,KAAK,CAAC,yCAAyC,IAAI,MAAM,EAAE,EAAE,CAAC,CAAC;IACjE,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,kBAAmB,SAAQ,WAAW;IACxC,IAAI,GAAG,qBAAqB,CAAC;CACvC;AAED;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,WAAW;IAC1C,IAAI,GAAG,uBAAuB,CAAC;CACzC;AAED;;;;GAIG;AACH,MAAM,OAAO,wBAAyB,SAAQ,WAAW;IAC9C,IAAI,GAAG,uBAAuB,CAAC;IAExC,YAAY,EAAU;QACpB,KAAK,CAAC,qBAAqB,EAAE,yBAAyB,CAAC,CAAC;IAC1D,CAAC;CACF"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PublicationStatus = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* Lifecycle state of an {@link EventPublication}.
|
|
6
3
|
*
|
|
@@ -14,7 +11,7 @@ exports.PublicationStatus = void 0;
|
|
|
14
11
|
*
|
|
15
12
|
* PUBLISHED → PROCESSING → FAILED → RESUBMITTED → PROCESSING → COMPLETED
|
|
16
13
|
*/
|
|
17
|
-
var PublicationStatus;
|
|
14
|
+
export var PublicationStatus;
|
|
18
15
|
(function (PublicationStatus) {
|
|
19
16
|
/** Created, waiting to be picked up by a listener. */
|
|
20
17
|
PublicationStatus["PUBLISHED"] = "PUBLISHED";
|
|
@@ -26,5 +23,5 @@ var PublicationStatus;
|
|
|
26
23
|
PublicationStatus["FAILED"] = "FAILED";
|
|
27
24
|
/** Previously FAILED, now queued for retry. */
|
|
28
25
|
PublicationStatus["RESUBMITTED"] = "RESUBMITTED";
|
|
29
|
-
})(PublicationStatus || (
|
|
26
|
+
})(PublicationStatus || (PublicationStatus = {}));
|
|
30
27
|
//# sourceMappingURL=publication-status.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publication-status.js","sourceRoot":"","sources":["../../src/types/publication-status.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"publication-status.js","sourceRoot":"","sources":["../../src/types/publication-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAN,IAAY,iBAWX;AAXD,WAAY,iBAAiB;IAC3B,sDAAsD;IACtD,4CAAuB,CAAA;IACvB,8DAA8D;IAC9D,8CAAyB,CAAA;IACzB,sCAAsC;IACtC,4CAAuB,CAAA;IACvB,mCAAmC;IACnC,sCAAiB,CAAA;IACjB,+CAA+C;IAC/C,gDAA2B,CAAA;AAC7B,CAAC,EAXW,iBAAiB,KAAjB,iBAAiB,QAW5B"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ResubmissionOptions = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* Builder-style configuration for a resubmission pass.
|
|
6
3
|
*
|
|
@@ -12,7 +9,7 @@ exports.ResubmissionOptions = void 0;
|
|
|
12
9
|
* .withMaxAttempts(3);
|
|
13
10
|
* ```
|
|
14
11
|
*/
|
|
15
|
-
class ResubmissionOptions {
|
|
12
|
+
export class ResubmissionOptions {
|
|
16
13
|
_batchSize = 100;
|
|
17
14
|
_minAge = 0;
|
|
18
15
|
_maxCompletionAttempts = null;
|
|
@@ -49,5 +46,4 @@ class ResubmissionOptions {
|
|
|
49
46
|
return this._filter;
|
|
50
47
|
}
|
|
51
48
|
}
|
|
52
|
-
exports.ResubmissionOptions = ResubmissionOptions;
|
|
53
49
|
//# sourceMappingURL=resubmission-options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resubmission-options.js","sourceRoot":"","sources":["../../src/types/resubmission-options.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resubmission-options.js","sourceRoot":"","sources":["../../src/types/resubmission-options.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;GAUG;AACH,MAAM,OAAO,mBAAmB;IACtB,UAAU,GAAG,GAAG,CAAC;IACjB,OAAO,GAAG,CAAC,CAAC;IACZ,sBAAsB,GAAkB,IAAI,CAAC;IAC7C,OAAO,GAA8B,IAAI,CAAC;IAElD,MAAM,CAAC,QAAQ;QACb,OAAO,IAAI,mBAAmB,EAAE,CAAC;IACnC,CAAC;IAED,aAAa,CAAC,IAAY;QACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,UAAU,CAAC,EAAU;QACnB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,eAAe,CAAC,CAAS;QACvB,IAAI,CAAC,sBAAsB,GAAG,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,UAAU,CAAC,MAA0B;QACnC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAI,qBAAqB;QACvB,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACrC,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_RETRY_CONFIG = void 0;
|
|
4
|
-
const drain_1 = require("../shutdown/drain");
|
|
1
|
+
import { DEFAULT_DRAIN_TIMEOUT_MS } from '../shutdown/drain.js';
|
|
5
2
|
/** Automatic retry off; every other value is the curve it would use if switched on. */
|
|
6
|
-
|
|
3
|
+
export const DEFAULT_RETRY_CONFIG = {
|
|
7
4
|
maxAttempts: 0,
|
|
8
5
|
interval: 60_000,
|
|
9
6
|
baseDelay: 1_000,
|
|
@@ -11,6 +8,6 @@ exports.DEFAULT_RETRY_CONFIG = {
|
|
|
11
8
|
maxDelay: 300_000,
|
|
12
9
|
jitter: 0.2,
|
|
13
10
|
batchSize: 100,
|
|
14
|
-
shutdownTimeout:
|
|
11
|
+
shutdownTimeout: DEFAULT_DRAIN_TIMEOUT_MS,
|
|
15
12
|
};
|
|
16
13
|
//# sourceMappingURL=retry-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry-config.js","sourceRoot":"","sources":["../../src/types/retry-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"retry-config.js","sourceRoot":"","sources":["../../src/types/retry-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAmDhE,uFAAuF;AACvF,MAAM,CAAC,MAAM,oBAAoB,GAAsB;IACrD,WAAW,EAAE,CAAC;IACd,QAAQ,EAAE,MAAM;IAChB,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE,CAAC;IACT,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE,GAAG;IACX,SAAS,EAAE,GAAG;IACd,eAAe,EAAE,wBAAwB;CAC1C,CAAC"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.DEFAULT_STALENESS_CONFIG = void 0;
|
|
4
|
-
const drain_1 = require("../shutdown/drain");
|
|
5
|
-
exports.DEFAULT_STALENESS_CONFIG = {
|
|
1
|
+
import { DEFAULT_DRAIN_TIMEOUT_MS } from '../shutdown/drain.js';
|
|
2
|
+
export const DEFAULT_STALENESS_CONFIG = {
|
|
6
3
|
published: 0,
|
|
7
4
|
processing: 0,
|
|
8
5
|
resubmitted: 0,
|
|
9
6
|
monitorInterval: 60_000,
|
|
10
|
-
shutdownTimeout:
|
|
7
|
+
shutdownTimeout: DEFAULT_DRAIN_TIMEOUT_MS,
|
|
11
8
|
};
|
|
12
9
|
//# sourceMappingURL=staleness-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staleness-config.js","sourceRoot":"","sources":["../../src/types/staleness-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"staleness-config.js","sourceRoot":"","sources":["../../src/types/staleness-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AA2BhE,MAAM,CAAC,MAAM,wBAAwB,GAAoB;IACvD,SAAS,EAAE,CAAC;IACZ,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;IACd,eAAe,EAAE,MAAM;IACvB,eAAe,EAAE,wBAAwB;CAC1C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs-transactional/outbox",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Persistent Event Publication Registry for @nestjs-transactional — Spring Modulith equivalent (ORM-agnostic core)",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"type": "
|
|
6
|
+
"type": "module",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"author": "Igor Golovanov",
|
|
9
9
|
"repository": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"transaction"
|
|
25
25
|
],
|
|
26
26
|
"engines": {
|
|
27
|
-
"node": ">=22.
|
|
27
|
+
"node": ">=22.13.0"
|
|
28
28
|
},
|
|
29
29
|
"main": "dist/index.js",
|
|
30
30
|
"types": "dist/index.d.ts",
|
|
@@ -56,34 +56,36 @@
|
|
|
56
56
|
"provenance": true
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@nestjs/common": "^10.0.0 || ^11.0.0",
|
|
60
|
-
"@nestjs/core": "^10.0.0 || ^11.0.0",
|
|
59
|
+
"@nestjs/common": "^10.0.0 || ^11.0.0 || ^12.0.0",
|
|
60
|
+
"@nestjs/core": "^10.0.0 || ^11.0.0 || ^12.0.0",
|
|
61
61
|
"reflect-metadata": "^0.1.13 || ^0.2.0",
|
|
62
62
|
"rxjs": "^7.0.0",
|
|
63
|
-
"@nestjs-transactional/core": "^
|
|
63
|
+
"@nestjs-transactional/core": "^2.0.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@
|
|
67
|
-
"@nestjs/
|
|
68
|
-
"@nestjs/
|
|
69
|
-
"@
|
|
70
|
-
"jest": "^
|
|
66
|
+
"@jest/globals": "^30.4.2",
|
|
67
|
+
"@nestjs/common": "^11.2.3",
|
|
68
|
+
"@nestjs/core": "^11.2.3",
|
|
69
|
+
"@nestjs/testing": "^11.2.3",
|
|
70
|
+
"@types/jest": "^30.0.0",
|
|
71
|
+
"@types/node": "^22.20.1",
|
|
72
|
+
"jest": "^30.5.1",
|
|
71
73
|
"reflect-metadata": "^0.2.2",
|
|
72
74
|
"rxjs": "^7.8.1",
|
|
73
|
-
"ts-jest": "^29.
|
|
74
|
-
"typescript": "^
|
|
75
|
-
"@nestjs-transactional/core": "
|
|
75
|
+
"ts-jest": "^29.4.12",
|
|
76
|
+
"typescript": "^6.0.3",
|
|
77
|
+
"@nestjs-transactional/core": "2.0.0"
|
|
76
78
|
},
|
|
77
79
|
"scripts": {
|
|
78
80
|
"build": "tsc -p tsconfig.build.json",
|
|
79
81
|
"clean": "rimraf dist *.tsbuildinfo coverage",
|
|
80
|
-
"test": "jest",
|
|
81
|
-
"test:watch": "jest --watch",
|
|
82
|
-
"test:cov": "jest --coverage",
|
|
82
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
83
|
+
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch",
|
|
84
|
+
"test:cov": "NODE_OPTIONS=--experimental-vm-modules jest --coverage",
|
|
83
85
|
"type-check": "tsc --noEmit",
|
|
84
|
-
"lint": "eslint
|
|
86
|
+
"lint": "eslint .",
|
|
85
87
|
"api:check": "api-extractor run && api-extractor run -c api-extractor.testing.json",
|
|
86
88
|
"api:update": "api-extractor run --local && api-extractor run --local -c api-extractor.testing.json",
|
|
87
|
-
"publish:check": "publint && attw --pack ."
|
|
89
|
+
"publish:check": "publint && attw --pack . --profile esm-only"
|
|
88
90
|
}
|
|
89
91
|
}
|