@ddd-ts-kit/kernel 0.27.0 → 0.83.1
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.fr.md +139 -68
- package/README.md +134 -65
- package/dist/application/ports/read-model-rows.d.ts +1 -1
- package/dist/application/ports/read-model-rows.d.ts.map +1 -1
- package/dist/application/scheduling/parse-cron.d.ts.map +1 -1
- package/dist/application/scheduling/parse-cron.js +24 -2
- package/dist/application/scheduling/parse-cron.js.map +1 -1
- package/dist/domain/errors/concept-error.d.ts +2 -13
- package/dist/domain/errors/concept-error.d.ts.map +1 -1
- package/dist/domain/errors/concept-error.js +3 -24
- package/dist/domain/errors/concept-error.js.map +1 -1
- package/dist/domain/errors/concurrency-error.d.ts +3 -1
- package/dist/domain/errors/concurrency-error.d.ts.map +1 -1
- package/dist/domain/errors/concurrency-error.js +2 -2
- package/dist/domain/errors/concurrency-error.js.map +1 -1
- package/dist/domain/errors/domain-refusal.d.ts +36 -0
- package/dist/domain/errors/domain-refusal.d.ts.map +1 -0
- package/dist/domain/errors/domain-refusal.js +33 -0
- package/dist/domain/errors/domain-refusal.js.map +1 -0
- package/dist/domain/errors/factual-refusal.d.ts +23 -0
- package/dist/domain/errors/factual-refusal.d.ts.map +1 -0
- package/dist/domain/errors/factual-refusal.js +34 -0
- package/dist/domain/errors/factual-refusal.js.map +1 -0
- package/dist/domain/errors/index.d.ts +17 -0
- package/dist/domain/errors/index.d.ts.map +1 -0
- package/dist/domain/errors/index.js +17 -0
- package/dist/domain/errors/index.js.map +1 -0
- package/dist/domain/errors/is-refusal.d.ts +4 -3
- package/dist/domain/errors/is-refusal.d.ts.map +1 -1
- package/dist/domain/errors/is-refusal.js +10 -3
- package/dist/domain/errors/is-refusal.js.map +1 -1
- package/dist/domain/errors/transaction-conflict-error.d.ts +10 -0
- package/dist/domain/errors/transaction-conflict-error.d.ts.map +1 -0
- package/dist/domain/errors/transaction-conflict-error.js +13 -0
- package/dist/domain/errors/transaction-conflict-error.js.map +1 -0
- package/dist/index.d.ts +1 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -13
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/domain-events/within-unit-of-work.d.ts +4 -0
- package/dist/infrastructure/domain-events/within-unit-of-work.d.ts.map +1 -1
- package/dist/infrastructure/domain-events/within-unit-of-work.js +7 -1
- package/dist/infrastructure/domain-events/within-unit-of-work.js.map +1 -1
- package/dist/infrastructure/event-sourcing/postgres/is-append-conflict.d.ts +2 -2
- package/dist/infrastructure/event-sourcing/postgres/is-append-conflict.d.ts.map +1 -1
- package/dist/infrastructure/event-sourcing/postgres/is-append-conflict.js +4 -12
- package/dist/infrastructure/event-sourcing/postgres/is-append-conflict.js.map +1 -1
- package/dist/infrastructure/event-sourcing/postgres/postgres-event-store.d.ts +3 -1
- package/dist/infrastructure/event-sourcing/postgres/postgres-event-store.d.ts.map +1 -1
- package/dist/infrastructure/event-sourcing/postgres/postgres-event-store.js +3 -1
- package/dist/infrastructure/event-sourcing/postgres/postgres-event-store.js.map +1 -1
- package/dist/infrastructure/files/self-signed-file-storage.d.ts +1 -0
- package/dist/infrastructure/files/self-signed-file-storage.d.ts.map +1 -1
- package/dist/infrastructure/files/self-signed-file-storage.js +5 -9
- package/dist/infrastructure/files/self-signed-file-storage.js.map +1 -1
- package/dist/infrastructure/in-memory/in-memory-read-model-table.js +1 -1
- package/dist/infrastructure/in-memory/in-memory-read-model-table.js.map +1 -1
- package/dist/infrastructure/persistence/has-driver-code.d.ts +7 -0
- package/dist/infrastructure/persistence/has-driver-code.d.ts.map +1 -0
- package/dist/infrastructure/persistence/has-driver-code.js +20 -0
- package/dist/infrastructure/persistence/has-driver-code.js.map +1 -0
- package/dist/infrastructure/persistence/is-transaction-conflict.d.ts +2 -0
- package/dist/infrastructure/persistence/is-transaction-conflict.d.ts.map +1 -0
- package/dist/infrastructure/persistence/is-transaction-conflict.js +12 -0
- package/dist/infrastructure/persistence/is-transaction-conflict.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FactualRefusal } from './factual-refusal.js';
|
|
2
|
+
import type { RefusalFacts } from './refusal-facts.js';
|
|
3
|
+
import type { RefusalOf } from './refusal-of.js';
|
|
4
|
+
import type { Refusal } from './refusal.js';
|
|
5
|
+
/**
|
|
6
|
+
* One refusal of the model, named after what is refused, with its code, and built by static
|
|
7
|
+
* factories named after what the refusal is about:
|
|
8
|
+
*
|
|
9
|
+
* export class InsufficientFunds extends DomainRefusal {
|
|
10
|
+
* readonly code = 'INSUFFICIENT_FUNDS';
|
|
11
|
+
*
|
|
12
|
+
* static forAccountId(accountId: string, missing: number) {
|
|
13
|
+
* return InsufficientFunds.refusal(`Account ${accountId} lacks ${missing}.`, { accountId, missing });
|
|
14
|
+
* }
|
|
15
|
+
* }
|
|
16
|
+
*
|
|
17
|
+
* throw InsufficientFunds.forAccountId(account.id, missing);
|
|
18
|
+
*
|
|
19
|
+
* The constructor is protected and a subclass declares none: outside its class a refusal exists
|
|
20
|
+
* only through a factory, with the message that factory wrote. The facts are private until the
|
|
21
|
+
* factory exposes some by name (`.exposing('missing')`).
|
|
22
|
+
*/
|
|
23
|
+
export declare abstract class DomainRefusal extends FactualRefusal {
|
|
24
|
+
/** Narrows what was caught to this refusal, with the facts of its factories. */
|
|
25
|
+
static is<C extends {
|
|
26
|
+
readonly prototype: object;
|
|
27
|
+
}>(this: C, error: unknown): error is RefusalOf<C>;
|
|
28
|
+
protected constructor(message: string, facts?: RefusalFacts);
|
|
29
|
+
/** Builds the refusal of a factory: the message it wrote and the facts it was given. */
|
|
30
|
+
protected static refusal<E extends {
|
|
31
|
+
readonly code: string;
|
|
32
|
+
}, const Facts extends RefusalFacts = RefusalFacts>(this: {
|
|
33
|
+
readonly prototype: E;
|
|
34
|
+
}, message: string, facts?: Facts): Refusal<E, E['code'], Facts>;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=domain-refusal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-refusal.d.ts","sourceRoot":"","sources":["../../../src/domain/errors/domain-refusal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;;;;;;;;;;;;;;;GAiBG;AACH,8BAAsB,aAAc,SAAQ,cAAc;IACxD,gFAAgF;IAChF,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS;QAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;KAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAAC,CAAC,CAAC,CAElG;IAGD,SAAS,aAAa,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,YAAiB,EAE9D;IAED,wFAAwF;IACxF,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,KAAK,CAAC,KAAK,SAAS,YAAY,GAAG,YAAY,EAC3G,IAAI,EAAE;QAAE,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAA;KAAE,EAC/B,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,KAAK,GACZ,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC;CAYjC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FactualRefusal } from './factual-refusal.js';
|
|
2
|
+
/**
|
|
3
|
+
* One refusal of the model, named after what is refused, with its code, and built by static
|
|
4
|
+
* factories named after what the refusal is about:
|
|
5
|
+
*
|
|
6
|
+
* export class InsufficientFunds extends DomainRefusal {
|
|
7
|
+
* readonly code = 'INSUFFICIENT_FUNDS';
|
|
8
|
+
*
|
|
9
|
+
* static forAccountId(accountId: string, missing: number) {
|
|
10
|
+
* return InsufficientFunds.refusal(`Account ${accountId} lacks ${missing}.`, { accountId, missing });
|
|
11
|
+
* }
|
|
12
|
+
* }
|
|
13
|
+
*
|
|
14
|
+
* throw InsufficientFunds.forAccountId(account.id, missing);
|
|
15
|
+
*
|
|
16
|
+
* The constructor is protected and a subclass declares none: outside its class a refusal exists
|
|
17
|
+
* only through a factory, with the message that factory wrote. The facts are private until the
|
|
18
|
+
* factory exposes some by name (`.exposing('missing')`).
|
|
19
|
+
*/
|
|
20
|
+
export class DomainRefusal extends FactualRefusal {
|
|
21
|
+
/** Narrows what was caught to this refusal, with the facts of its factories. */
|
|
22
|
+
static is(error) {
|
|
23
|
+
return error instanceof DomainRefusal && Object.prototype.isPrototypeOf.call(this.prototype, error);
|
|
24
|
+
}
|
|
25
|
+
// A factory calls `refusal`; the facts a subclass is built with are the ones `refusal` was given.
|
|
26
|
+
constructor(message, facts = {}) {
|
|
27
|
+
super(message, facts);
|
|
28
|
+
}
|
|
29
|
+
static refusal(message, facts) {
|
|
30
|
+
return new this(message, facts);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=domain-refusal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-refusal.js","sourceRoot":"","sources":["../../../src/domain/errors/domain-refusal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAgB,aAAc,SAAQ,cAAc;IACxD,gFAAgF;IAChF,MAAM,CAAC,EAAE,CAAoD,KAAc;QACzE,OAAO,KAAK,YAAY,aAAa,IAAI,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IACtG,CAAC;IAED,kGAAkG;IAClG,YAAsB,OAAe,EAAE,KAAK,GAAiB,EAAE;QAC7D,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACxB,CAAC;IASS,MAAM,CAAC,OAAO,CAKtB,OAAe,EACf,KAAoB;QAEpB,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { DomainErrorJson } from './domain-error-json.js';
|
|
2
|
+
import { DomainError } from './domain-error.js';
|
|
3
|
+
import type { RefusalFacts } from './refusal-facts.js';
|
|
4
|
+
/**
|
|
5
|
+
* A refusal built by a static factory, whichever form the project writes (`DomainRefusal`, one
|
|
6
|
+
* class per refusal, or `ConceptError`, one class per concept): it carries the facts the factory
|
|
7
|
+
* was given, keeps them private until the factory exposes some by name (`.exposing('startsAt')`),
|
|
8
|
+
* and may keep the error it translates (`.causedBy(cause)`).
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class FactualRefusal extends DomainError {
|
|
11
|
+
/** Every fact of the refusal, for the code that catches it and for the tests. Private to the process. */
|
|
12
|
+
readonly facts: RefusalFacts;
|
|
13
|
+
private exposedNames;
|
|
14
|
+
protected constructor(message: string, facts: RefusalFacts);
|
|
15
|
+
/** The facts a client may read: the ones the factory named, none by default. */
|
|
16
|
+
get exposedFacts(): RefusalFacts;
|
|
17
|
+
toJSON(): DomainErrorJson;
|
|
18
|
+
/** Called by a factory: these facts may leave the process, in a problem document for instance. */
|
|
19
|
+
protected exposing(...names: readonly (keyof this['facts'] & string)[]): this;
|
|
20
|
+
/** Called by a factory: the error this refusal translates. */
|
|
21
|
+
protected causedBy(cause: unknown): this;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=factual-refusal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factual-refusal.d.ts","sourceRoot":"","sources":["../../../src/domain/errors/factual-refusal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;GAKG;AACH,8BAAsB,cAAe,SAAQ,WAAW;IACtD,yGAAyG;IACzG,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAE7B,OAAO,CAAC,YAAY,CAAyB;IAE7C,SAAS,aAAa,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAGzD;IAED,gFAAgF;IAChF,IAAI,YAAY,IAAI,YAAY,CAE/B;IAEQ,MAAM,IAAI,eAAe,CAEjC;IAED,kGAAkG;IAClG,SAAS,CAAC,QAAQ,CAAC,GAAG,KAAK,EAAE,SAAS,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC,EAAE,GAAG,IAAI,CAI5E;IAED,8DAA8D;IAC9D,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAIvC;CACF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DomainError } from './domain-error.js';
|
|
2
|
+
/**
|
|
3
|
+
* A refusal built by a static factory, whichever form the project writes (`DomainRefusal`, one
|
|
4
|
+
* class per refusal, or `ConceptError`, one class per concept): it carries the facts the factory
|
|
5
|
+
* was given, keeps them private until the factory exposes some by name (`.exposing('startsAt')`),
|
|
6
|
+
* and may keep the error it translates (`.causedBy(cause)`).
|
|
7
|
+
*/
|
|
8
|
+
export class FactualRefusal extends DomainError {
|
|
9
|
+
/** Every fact of the refusal, for the code that catches it and for the tests. Private to the process. */
|
|
10
|
+
facts;
|
|
11
|
+
exposedNames = [];
|
|
12
|
+
constructor(message, facts) {
|
|
13
|
+
super(message);
|
|
14
|
+
this.facts = facts;
|
|
15
|
+
}
|
|
16
|
+
/** The facts a client may read: the ones the factory named, none by default. */
|
|
17
|
+
get exposedFacts() {
|
|
18
|
+
return Object.fromEntries(this.exposedNames.map((name) => [name, this.facts[name] ?? null]));
|
|
19
|
+
}
|
|
20
|
+
toJSON() {
|
|
21
|
+
return { ...super.toJSON(), ...(this.exposedNames.length === 0 ? {} : { facts: this.exposedFacts }) };
|
|
22
|
+
}
|
|
23
|
+
/** Called by a factory: these facts may leave the process, in a problem document for instance. */
|
|
24
|
+
exposing(...names) {
|
|
25
|
+
this.exposedNames = names;
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
/** Called by a factory: the error this refusal translates. */
|
|
29
|
+
causedBy(cause) {
|
|
30
|
+
Object.defineProperty(this, 'cause', { value: cause, writable: true, configurable: true, enumerable: false });
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=factual-refusal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factual-refusal.js","sourceRoot":"","sources":["../../../src/domain/errors/factual-refusal.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD;;;;;GAKG;AACH,MAAM,OAAgB,cAAe,SAAQ,WAAW;IACtD,yGAAyG;IAChG,KAAK,CAAe;IAErB,YAAY,GAAsB,EAAE,CAAC;IAE7C,YAAsB,OAAe,EAAE,KAAmB;QACxD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,gFAAgF;IAChF,IAAI,YAAY;QACd,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/F,CAAC;IAEQ,MAAM;QACb,OAAO,EAAE,GAAG,KAAK,CAAC,MAAM,EAAE,EAAE,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,EAAE,CAAC;IACxG,CAAC;IAED,kGAAkG;IACxF,QAAQ,CAAC,GAAG,KAAgD;QACpE,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAE1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,8DAA8D;IACpD,QAAQ,CAAC,KAAc;QAC/B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;QAE9G,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './code-of.js';
|
|
2
|
+
export * from './concept-error.js';
|
|
3
|
+
export * from './concurrency-error.js';
|
|
4
|
+
export * from './conflict-error.js';
|
|
5
|
+
export * from './domain-error-json.js';
|
|
6
|
+
export * from './domain-error.js';
|
|
7
|
+
export * from './domain-refusal.js';
|
|
8
|
+
export * from './factual-refusal.js';
|
|
9
|
+
export * from './invariant-violation.js';
|
|
10
|
+
export * from './is-refusal.js';
|
|
11
|
+
export * from './not-found-error.js';
|
|
12
|
+
export * from './precondition-failed-error.js';
|
|
13
|
+
export * from './refusal-facts.js';
|
|
14
|
+
export * from './refusal-of.js';
|
|
15
|
+
export * from './refusal.js';
|
|
16
|
+
export * from './transaction-conflict-error.js';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './code-of.js';
|
|
2
|
+
export * from './concept-error.js';
|
|
3
|
+
export * from './concurrency-error.js';
|
|
4
|
+
export * from './conflict-error.js';
|
|
5
|
+
export * from './domain-error-json.js';
|
|
6
|
+
export * from './domain-error.js';
|
|
7
|
+
export * from './domain-refusal.js';
|
|
8
|
+
export * from './factual-refusal.js';
|
|
9
|
+
export * from './invariant-violation.js';
|
|
10
|
+
export * from './is-refusal.js';
|
|
11
|
+
export * from './not-found-error.js';
|
|
12
|
+
export * from './precondition-failed-error.js';
|
|
13
|
+
export * from './refusal-facts.js';
|
|
14
|
+
export * from './refusal-of.js';
|
|
15
|
+
export * from './refusal.js';
|
|
16
|
+
export * from './transaction-conflict-error.js';
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iCAAiC,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { DomainError } from './domain-error.js';
|
|
2
2
|
/**
|
|
3
|
-
* Whether what was caught is a business refusal and, when a code is given, this one
|
|
4
|
-
*
|
|
3
|
+
* Whether what was caught is a business refusal and, when a code is given, this one; when the
|
|
4
|
+
* closed list of the codes of a context is given (`SchedulingCodes`), one of them, so that a
|
|
5
|
+
* `switch` on the code is exhaustive. Whatever its class: the code is the identity of a refusal.
|
|
5
6
|
*/
|
|
6
|
-
export declare function isRefusal<const Code extends string = string>(error: unknown, code?: Code): error is DomainError & {
|
|
7
|
+
export declare function isRefusal<const Code extends string = string>(error: unknown, code?: Code | Readonly<Record<string, Code>>): error is DomainError & {
|
|
7
8
|
readonly code: Code;
|
|
8
9
|
};
|
|
9
10
|
//# sourceMappingURL=is-refusal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-refusal.d.ts","sourceRoot":"","sources":["../../../src/domain/errors/is-refusal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD
|
|
1
|
+
{"version":3,"file":"is-refusal.d.ts","sourceRoot":"","sources":["../../../src/domain/errors/is-refusal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,EAC1D,KAAK,EAAE,OAAO,EACd,IAAI,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,GAC3C,KAAK,IAAI,WAAW,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAUhD"}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { DomainError } from './domain-error.js';
|
|
2
2
|
/**
|
|
3
|
-
* Whether what was caught is a business refusal and, when a code is given, this one
|
|
4
|
-
*
|
|
3
|
+
* Whether what was caught is a business refusal and, when a code is given, this one; when the
|
|
4
|
+
* closed list of the codes of a context is given (`SchedulingCodes`), one of them, so that a
|
|
5
|
+
* `switch` on the code is exhaustive. Whatever its class: the code is the identity of a refusal.
|
|
5
6
|
*/
|
|
6
7
|
export function isRefusal(error, code) {
|
|
7
|
-
|
|
8
|
+
if (!(error instanceof DomainError)) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
if (code === undefined) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
return typeof code === 'string' ? error.code === code : Object.values(code).includes(error.code);
|
|
8
15
|
}
|
|
9
16
|
//# sourceMappingURL=is-refusal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-refusal.js","sourceRoot":"","sources":["../../../src/domain/errors/is-refusal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD
|
|
1
|
+
{"version":3,"file":"is-refusal.js","sourceRoot":"","sources":["../../../src/domain/errors/is-refusal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,UAAU,SAAS,CACvB,KAAc,EACd,IAA4C;IAE5C,IAAI,CAAC,CAAC,KAAK,YAAY,WAAW,CAAC,EAAE,CAAC;QACpC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAS,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC3G,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ConcurrencyError } from './concurrency-error.js';
|
|
2
|
+
/**
|
|
3
|
+
* The database gave the transaction of a unit of work up for a concurrent one: a deadlock or a
|
|
4
|
+
* serialization failure, raised by whichever statement it chose. Nothing of it committed, so the
|
|
5
|
+
* unit of work can run again; the error of the driver is the `cause`.
|
|
6
|
+
*/
|
|
7
|
+
export declare class TransactionConflictError extends ConcurrencyError {
|
|
8
|
+
constructor(cause: unknown);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=transaction-conflict-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-conflict-error.d.ts","sourceRoot":"","sources":["../../../src/domain/errors/transaction-conflict-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;;;GAIG;AACH,qBAAa,wBAAyB,SAAQ,gBAAgB;IAC5D,YAAY,KAAK,EAAE,OAAO,EAGzB;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ConcurrencyError } from './concurrency-error.js';
|
|
2
|
+
/**
|
|
3
|
+
* The database gave the transaction of a unit of work up for a concurrent one: a deadlock or a
|
|
4
|
+
* serialization failure, raised by whichever statement it chose. Nothing of it committed, so the
|
|
5
|
+
* unit of work can run again; the error of the driver is the `cause`.
|
|
6
|
+
*/
|
|
7
|
+
export class TransactionConflictError extends ConcurrencyError {
|
|
8
|
+
constructor(cause) {
|
|
9
|
+
super('', { cause });
|
|
10
|
+
this.message = 'The transaction was given up for a concurrent one (deadlock or serialization failure)';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=transaction-conflict-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-conflict-error.js","sourceRoot":"","sources":["../../../src/domain/errors/transaction-conflict-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;;;GAIG;AACH,MAAM,OAAO,wBAAyB,SAAQ,gBAAgB;IAC5D,YAAY,KAAc;QACxB,KAAK,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,uFAAuF,CAAC;IACzG,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,19 +5,7 @@ export * from './domain/event-sourcing/aggregate-history.js';
|
|
|
5
5
|
export * from './domain/event-sourcing/aggregate-snapshot.js';
|
|
6
6
|
export * from './domain/event-sourcing/appliers.js';
|
|
7
7
|
export * from './domain/event-sourcing/event-sourced-aggregate.js';
|
|
8
|
-
export * from './domain/errors/
|
|
9
|
-
export * from './domain/errors/concept-error.js';
|
|
10
|
-
export * from './domain/errors/concurrency-error.js';
|
|
11
|
-
export * from './domain/errors/conflict-error.js';
|
|
12
|
-
export * from './domain/errors/domain-error-json.js';
|
|
13
|
-
export * from './domain/errors/domain-error.js';
|
|
14
|
-
export * from './domain/errors/invariant-violation.js';
|
|
15
|
-
export * from './domain/errors/is-refusal.js';
|
|
16
|
-
export * from './domain/errors/not-found-error.js';
|
|
17
|
-
export * from './domain/errors/precondition-failed-error.js';
|
|
18
|
-
export * from './domain/errors/refusal-facts.js';
|
|
19
|
-
export * from './domain/errors/refusal-of.js';
|
|
20
|
-
export * from './domain/errors/refusal.js';
|
|
8
|
+
export * from './domain/errors/index.js';
|
|
21
9
|
export * from './domain/result/err.js';
|
|
22
10
|
export * from './domain/result/ok.js';
|
|
23
11
|
export * from './domain/result/result.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8CAA8C,CAAC;AAC7D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qCAAqC,CAAC;AACpD,cAAc,oDAAoD,CAAC;AACnE,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8CAA8C,CAAC;AAC7D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qCAAqC,CAAC;AACpD,cAAc,oDAAoD,CAAC;AACnE,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wCAAwC,CAAC;AACvD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,yCAAyC,CAAC;AACxD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,yCAAyC,CAAC;AACxD,cAAc,kCAAkC,CAAC;AACjD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qCAAqC,CAAC;AACpD,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC;AACpD,cAAc,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;AAClE,cAAc,qDAAqD,CAAC;AACpE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,iDAAiD,CAAC;AAChE,cAAc,uDAAuD,CAAC;AACtE,cAAc,+DAA+D,CAAC;AAC9E,cAAc,mDAAmD,CAAC;AAClE,cAAc,0DAA0D,CAAC;AACzE,cAAc,0DAA0D,CAAC;AACzE,cAAc,wDAAwD,CAAC;AACvE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,sDAAsD,CAAC;AACrE,cAAc,sDAAsD,CAAC;AACrE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,uDAAuD,CAAC;AACtE,cAAc,0DAA0D,CAAC;AACzE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,mDAAmD,CAAC;AAClE,cAAc,wDAAwD,CAAC;AACvE,cAAc,wCAAwC,CAAC;AACvD,cAAc,uDAAuD,CAAC;AACtE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mDAAmD,CAAC;AAClE,cAAc,uDAAuD,CAAC;AACtE,cAAc,uDAAuD,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,19 +5,7 @@ export * from './domain/event-sourcing/aggregate-history.js';
|
|
|
5
5
|
export * from './domain/event-sourcing/aggregate-snapshot.js';
|
|
6
6
|
export * from './domain/event-sourcing/appliers.js';
|
|
7
7
|
export * from './domain/event-sourcing/event-sourced-aggregate.js';
|
|
8
|
-
export * from './domain/errors/
|
|
9
|
-
export * from './domain/errors/concept-error.js';
|
|
10
|
-
export * from './domain/errors/concurrency-error.js';
|
|
11
|
-
export * from './domain/errors/conflict-error.js';
|
|
12
|
-
export * from './domain/errors/domain-error-json.js';
|
|
13
|
-
export * from './domain/errors/domain-error.js';
|
|
14
|
-
export * from './domain/errors/invariant-violation.js';
|
|
15
|
-
export * from './domain/errors/is-refusal.js';
|
|
16
|
-
export * from './domain/errors/not-found-error.js';
|
|
17
|
-
export * from './domain/errors/precondition-failed-error.js';
|
|
18
|
-
export * from './domain/errors/refusal-facts.js';
|
|
19
|
-
export * from './domain/errors/refusal-of.js';
|
|
20
|
-
export * from './domain/errors/refusal.js';
|
|
8
|
+
export * from './domain/errors/index.js';
|
|
21
9
|
export * from './domain/result/err.js';
|
|
22
10
|
export * from './domain/result/ok.js';
|
|
23
11
|
export * from './domain/result/result.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8CAA8C,CAAC;AAC7D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qCAAqC,CAAC;AACpD,cAAc,oDAAoD,CAAC;AACnE,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8CAA8C,CAAC;AAC7D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qCAAqC,CAAC;AACpD,cAAc,oDAAoD,CAAC;AACnE,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wCAAwC,CA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|
* handlers run, then the work handed to `afterCommit`.
|
|
13
13
|
*
|
|
14
|
+
* A deadlock or a serialization failure the database raised anywhere in the transaction, on the
|
|
15
|
+
* statement it chose, rejects the outermost unit of work as a `TransactionConflictError`, a
|
|
16
|
+
* `ConcurrencyError` whose `cause` is the error of the driver: the caller runs it again.
|
|
17
|
+
*
|
|
14
18
|
* Called inside a unit of work already running on the same asynchronous call chain it joins it:
|
|
15
19
|
* `transaction(work)` and nothing else, so one dispatch, at the end of the outermost. Two
|
|
16
20
|
* concurrent calls never share a scope.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"within-unit-of-work.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/within-unit-of-work.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"within-unit-of-work.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/within-unit-of-work.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACtB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GAClD,OAAO,CAAC,CAAC,CAAC,CAsBZ"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { TransactionConflictError } from '../../domain/errors/transaction-conflict-error.js';
|
|
2
|
+
import { isTransactionConflict } from '../persistence/is-transaction-conflict.js';
|
|
1
3
|
import { dispatchAfterCommit } from './dispatch-after-commit.js';
|
|
2
4
|
import { dispatchBeforeCommit } from './dispatch-before-commit.js';
|
|
3
5
|
import { unitOfWorkScope } from './unit-of-work-scope.js';
|
|
@@ -14,6 +16,10 @@ import { unitOfWorkScope } from './unit-of-work-scope.js';
|
|
|
14
16
|
* those applied are undone. Once `transaction` has resolved, and only then, the `after-commit`
|
|
15
17
|
* handlers run, then the work handed to `afterCommit`.
|
|
16
18
|
*
|
|
19
|
+
* A deadlock or a serialization failure the database raised anywhere in the transaction, on the
|
|
20
|
+
* statement it chose, rejects the outermost unit of work as a `TransactionConflictError`, a
|
|
21
|
+
* `ConcurrencyError` whose `cause` is the error of the driver: the caller runs it again.
|
|
22
|
+
*
|
|
17
23
|
* Called inside a unit of work already running on the same asynchronous call chain it joins it:
|
|
18
24
|
* `transaction(work)` and nothing else, so one dispatch, at the end of the outermost. Two
|
|
19
25
|
* concurrent calls never share a scope.
|
|
@@ -28,7 +34,7 @@ export async function withinUnitOfWork(work, transaction) {
|
|
|
28
34
|
.run(scope, () => transaction(() => thenDispatched(work, scope, applied)))
|
|
29
35
|
.catch(async (error) => {
|
|
30
36
|
await undone(applied);
|
|
31
|
-
throw error;
|
|
37
|
+
throw isTransactionConflict(error) ? new TransactionConflictError(error) : error;
|
|
32
38
|
})
|
|
33
39
|
.finally(() => {
|
|
34
40
|
scope.stage = 'closed';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"within-unit-of-work.js","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/within-unit-of-work.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAwB,MAAM,yBAAyB,CAAC;AAEhF
|
|
1
|
+
{"version":3,"file":"within-unit-of-work.js","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/within-unit-of-work.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mDAAmD,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAwB,MA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,EAAE,UAAU,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AACzG,CAAC;AAED,KAAK,UAAU,cAAc,CAAI,IAAsB,EAAE,KAAsB,EAAE,OAAqB;IACpG,MAAM,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;IAE5B,MAAM,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAElC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,QAAQ,IAAI,EAAE,EAAE,CAAC;QACxC,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACnB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,kFAAkF;AAClF,KAAK,UAAU,MAAM,CAAC,OAA8B;IAClD,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;QAC1C,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC;AAED,6HAA6H;AAC7H,KAAK,UAAU,cAAc,CAAC,KAAsB;IAClD,MAAM,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAEjC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,SAAS,IAAI,EAAE,EAAE,CAAC;QACzC,MAAM,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC;AACH,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/** Whether an append lost to a concurrent one, whatever wraps the error of the driver
|
|
2
|
-
export declare function isAppendConflict(error: unknown
|
|
1
|
+
/** Whether an append lost to a concurrent one, whatever wraps the error of the driver. */
|
|
2
|
+
export declare function isAppendConflict(error: unknown): boolean;
|
|
3
3
|
//# sourceMappingURL=is-append-conflict.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-append-conflict.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/event-sourcing/postgres/is-append-conflict.ts"],"names":[],"mappings":"AAWA,
|
|
1
|
+
{"version":3,"file":"is-append-conflict.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/event-sourcing/postgres/is-append-conflict.ts"],"names":[],"mappings":"AAWA,0FAA0F;AAC1F,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAExD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hasDriverCode } from '../../persistence/has-driver-code.js';
|
|
1
2
|
/**
|
|
2
3
|
* What PostgreSQL answers when another transaction appended first: a duplicate (stream, version)
|
|
3
4
|
* (23505); a serialization failure (40001) when the unit of work runs at REPEATABLE READ or
|
|
@@ -6,17 +7,8 @@
|
|
|
6
7
|
* caller retries, never a fault of the store.
|
|
7
8
|
*/
|
|
8
9
|
const CONFLICTS = new Set(['23505', '40001', '40P01']);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export function isAppendConflict(error, depth = DEPTH) {
|
|
13
|
-
if (typeof error !== 'object' || error === null || depth === 0) {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
const code = Reflect.get(error, 'code');
|
|
17
|
-
if (typeof code === 'string' && CONFLICTS.has(code)) {
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
return WRAPPERS.some((key) => isAppendConflict(Reflect.get(error, key), depth - 1));
|
|
10
|
+
/** Whether an append lost to a concurrent one, whatever wraps the error of the driver. */
|
|
11
|
+
export function isAppendConflict(error) {
|
|
12
|
+
return hasDriverCode(error, CONFLICTS);
|
|
21
13
|
}
|
|
22
14
|
//# sourceMappingURL=is-append-conflict.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-append-conflict.js","sourceRoot":"","sources":["../../../../src/infrastructure/event-sourcing/postgres/is-append-conflict.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"is-append-conflict.js","sourceRoot":"","sources":["../../../../src/infrastructure/event-sourcing/postgres/is-append-conflict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE;;;;;;GAMG;AACH,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAEvD,0FAA0F;AAC1F,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,aAAa,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -13,7 +13,9 @@ import type { EventStoreTablesOptions } from './event-store-tables-options.js';
|
|
|
13
13
|
* price is that two appends never run side by side, whatever their streams. A conflict that slips
|
|
14
14
|
* between the check and the insert hits the unique (stream, version) and is a ConcurrencyError too,
|
|
15
15
|
* and so are a serialization failure (a unit of work at REPEATABLE READ or SERIALIZABLE) and a
|
|
16
|
-
* deadlock with row locks the same transaction took in another order: the caller retries.
|
|
16
|
+
* deadlock with row locks the same transaction took in another order: the caller retries. When
|
|
17
|
+
* PostgreSQL gives up the other statement of such a cycle, the unit of work rejects with a
|
|
18
|
+
* `TransactionConflictError`, a `ConcurrencyError` too.
|
|
17
19
|
*/
|
|
18
20
|
export declare class PostgresEventStore implements EventStore {
|
|
19
21
|
private readonly run;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres-event-store.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/event-sourcing/postgres/postgres-event-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wDAAwD,CAAC;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,KAAK,EAAE,U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AAO,CAAC,MAAM,CAAC,CAI5B;YAEa,QAAQ;IAYtB,OAAO,CAAC,eAAe;YAmBT,SAAS;CAYxB"}
|
|
@@ -15,7 +15,9 @@ const SELECTED = `position, stream, version, event_id, type, schema_version, dat
|
|
|
15
15
|
* price is that two appends never run side by side, whatever their streams. A conflict that slips
|
|
16
16
|
* between the check and the insert hits the unique (stream, version) and is a ConcurrencyError too,
|
|
17
17
|
* and so are a serialization failure (a unit of work at REPEATABLE READ or SERIALIZABLE) and a
|
|
18
|
-
* deadlock with row locks the same transaction took in another order: the caller retries.
|
|
18
|
+
* deadlock with row locks the same transaction took in another order: the caller retries. When
|
|
19
|
+
* PostgreSQL gives up the other statement of such a cycle, the unit of work rejects with a
|
|
20
|
+
* `TransactionConflictError`, a `ConcurrencyError` too.
|
|
19
21
|
*/
|
|
20
22
|
export class PostgresEventStore {
|
|
21
23
|
run;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres-event-store.js","sourceRoot":"","sources":["../../../../src/infrastructure/event-sourcing/postgres/postgres-event-store.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAG/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD,MAAM,OAAO,GAAG,wFAAwF,CAAC;AAEzG,oFAAoF;AACpF,MAAM,QAAQ,GAAG;0FACyE,CAAC;AAE3F
|
|
1
|
+
{"version":3,"file":"postgres-event-store.js","sourceRoot":"","sources":["../../../../src/infrastructure/event-sourcing/postgres/postgres-event-store.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAG/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,cAAc,EA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,OAAO;QACL,EAAE;QACF,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC7B,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC/B,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACjC,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACzB,aAAa,EAAE,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC5C,IAAI,EAAE,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,4BAA4B,EAAE,EAAE,CAAC;QACnE,QAAQ,EAAE,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,gCAAgC,EAAE,EAAE,CAAC;QAC/E,UAAU,EAAE,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;KAC1C,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,KAAK,YAAY,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -12,6 +12,7 @@ export declare abstract class SelfSignedFileStorage extends ServedFileStorage {
|
|
|
12
12
|
private readonly tokens;
|
|
13
13
|
private readonly baseUrl;
|
|
14
14
|
protected constructor(options: SignedLinkOptions);
|
|
15
|
+
/** Async, so that a key or an expiry it refuses rejects the promise instead of throwing at the call. */
|
|
15
16
|
signedDownloadUrl(key: string, options: DownloadUrlOptions): Promise<SignedUrl>;
|
|
16
17
|
signedUploadUrl(key: string, options: UploadUrlOptions): Promise<SignedUpload>;
|
|
17
18
|
openSigned(token: string): Promise<SignedDownload | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"self-signed-file-storage.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/files/self-signed-file-storage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAE1F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AACjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAEnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAIlE,2GAA2G;AAC3G,8BAAsB,qBAAsB,SAAQ,iBAAiB;IACnE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmB;IAE1C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IAEjC,SAAS,aAAa,OAAO,EAAE,iBAAiB,EAS/C;IAED,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"self-signed-file-storage.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/files/self-signed-file-storage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAE1F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AACjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,KAAK,EAAE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