@ddd-ts-kit/kernel 0.82.0 → 0.83.2
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 +138 -67
- package/README.md +133 -64
- 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/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 @@
|
|
|
1
|
+
{"version":3,"file":"is-transaction-conflict.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/persistence/is-transaction-conflict.ts"],"names":[],"mappings":"AAUA,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE7D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DomainError } from '../../domain/errors/domain-error.js';
|
|
2
|
+
import { hasDriverCode } from './has-driver-code.js';
|
|
3
|
+
/**
|
|
4
|
+
* What a database answers when it gives a transaction up for a concurrent one: a serialization
|
|
5
|
+
* failure (40001, the SQLSTATE MySQL also gives a deadlock) or a deadlock (40P01) of PostgreSQL,
|
|
6
|
+
* `P2034` of Prisma, which stands for both. A refusal already raised is never one.
|
|
7
|
+
*/
|
|
8
|
+
const CONFLICTS = new Set(['40001', '40P01', 'P2034']);
|
|
9
|
+
export function isTransactionConflict(error) {
|
|
10
|
+
return !(error instanceof DomainError) && hasDriverCode(error, CONFLICTS);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=is-transaction-conflict.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-transaction-conflict.js","sourceRoot":"","sources":["../../../src/infrastructure/persistence/is-transaction-conflict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD;;;;GAIG;AACH,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAEvD,MAAM,UAAU,qBAAqB,CAAC,KAAc;IAClD,OAAO,CAAC,CAAC,KAAK,YAAY,WAAW,CAAC,IAAI,aAAa,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAC5E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ddd-ts-kit/kernel",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.83.2",
|
|
4
4
|
"description": "Framework-agnostic Domain-Driven Design (DDD) building blocks for TypeScript: aggregates, entities, value objects, domain events, CQRS command and query buses, unit of work and application ports, with an in-memory event bus.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ddd",
|