@entifix/mongo 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/errors/translate-mongo-error.d.ts +20 -1
- package/dist/errors/translate-mongo-error.d.ts.map +1 -1
- package/dist/errors/translate-mongo-error.js +20 -1
- package/dist/errors/translate-mongo-error.js.map +1 -1
- package/dist/transactions/index.d.ts +6 -0
- package/dist/transactions/index.d.ts.map +1 -1
- package/dist/transactions/index.js +6 -1
- package/dist/transactions/index.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type StoreFailure, type StoreFault } from '@entifix/core';
|
|
1
|
+
import { Contention, type StoreFailure, type StoreFault, Unavailable } from '@entifix/core';
|
|
2
2
|
/**
|
|
3
3
|
* What a Mongo driver error means, as a categorised failure
|
|
4
4
|
* ([ADR 0013](../../../../../docs/adr/0013-failures-are-typed-values-decided-at-the-shell.md)).
|
|
@@ -20,6 +20,25 @@ export interface MongoErrorContext {
|
|
|
20
20
|
}
|
|
21
21
|
/** Whether a server label is on `error` or in its cause chain. */
|
|
22
22
|
export declare const mongoErrorLabelled: (error: unknown, label: string) => boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether a driver error is a transaction losing a race: a write conflict, or
|
|
25
|
+
* anything the server labels `TransientTransactionError`. A unit of work runs
|
|
26
|
+
* itself again on exactly this — so a body that maps its own driver errors
|
|
27
|
+
* must answer {@link Contention} for these and nothing else, or the retry
|
|
28
|
+
* never happens and a contended write that would have serialized fails.
|
|
29
|
+
*/
|
|
30
|
+
export declare const isMongoContention: (error: unknown) => boolean;
|
|
31
|
+
/**
|
|
32
|
+
* A failure of a driver call a unit of work's **body** makes itself: a lost
|
|
33
|
+
* race is {@link Contention}, which the unit runs itself again on, and
|
|
34
|
+
* anything else is the store failing to answer.
|
|
35
|
+
*
|
|
36
|
+
* ⚠️ **Not an `Unavailable` for everything.** A body that answered every
|
|
37
|
+
* driver error that way hid the write conflict from the unit, so a contended
|
|
38
|
+
* write that the retry would have serialized failed instead — measured on a
|
|
39
|
+
* burst of partial refunds against one allocation, 18 of 20 answered `503`.
|
|
40
|
+
*/
|
|
41
|
+
export declare const mongoUnitFault: (error: unknown) => Contention | Unavailable;
|
|
23
42
|
export declare const translateMongoError: (error: unknown, context?: MongoErrorContext) => StoreFailure;
|
|
24
43
|
/**
|
|
25
44
|
* A driver error as the store's own fault, for the bookkeeping a mechanism
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translate-mongo-error.d.ts","sourceRoot":"","sources":["../../src/errors/translate-mongo-error.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"translate-mongo-error.d.ts","sourceRoot":"","sources":["../../src/errors/translate-mongo-error.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAKV,KAAK,YAAY,EACjB,KAAK,UAAU,EAEf,WAAW,EACZ,MAAM,eAAe,CAAC;AAEvB;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,qEAAqE;IACrE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;CAChD;AAqBD,kEAAkE;AAClE,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,EAAE,OAAO,MAAM,KAAG,OAOlE,CAAC;AAwBF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,OAAO,KAAG,OAEK,CAAC;AAEzD;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,OAAO,KAAG,UAAU,GAAG,WAGf,CAAC;AAE/C,eAAO,MAAM,mBAAmB,GAC9B,OAAO,OAAO,EACd,UAAS,iBAAsB,KAC9B,YA2BF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,OAAO,OAAO,EACd,UAAS,IAAI,CAAC,iBAAiB,EAAE,WAAW,CAAM,KACjD,UAMF,CAAC"}
|
|
@@ -31,6 +31,25 @@ const isDuplicate = (error)=>{
|
|
|
31
31
|
return error.code === DUPLICATE_KEY || ((_ref = (_error_writeErrors = error.writeErrors) == null ? void 0 : _error_writeErrors.some((write)=>write.code === DUPLICATE_KEY)) != null ? _ref : false);
|
|
32
32
|
};
|
|
33
33
|
const duplicatedKey = (error)=>typeof error.keyPattern === 'object' && error.keyPattern !== null ? Object.keys(error.keyPattern).join(',') : undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Whether a driver error is a transaction losing a race: a write conflict, or
|
|
36
|
+
* anything the server labels `TransientTransactionError`. A unit of work runs
|
|
37
|
+
* itself again on exactly this — so a body that maps its own driver errors
|
|
38
|
+
* must answer {@link Contention} for these and nothing else, or the retry
|
|
39
|
+
* never happens and a contended write that would have serialized fails.
|
|
40
|
+
*/ export const isMongoContention = (error)=>shape(error).code === WRITE_CONFLICT || mongoErrorLabelled(error, 'TransientTransactionError');
|
|
41
|
+
/**
|
|
42
|
+
* A failure of a driver call a unit of work's **body** makes itself: a lost
|
|
43
|
+
* race is {@link Contention}, which the unit runs itself again on, and
|
|
44
|
+
* anything else is the store failing to answer.
|
|
45
|
+
*
|
|
46
|
+
* ⚠️ **Not an `Unavailable` for everything.** A body that answered every
|
|
47
|
+
* driver error that way hid the write conflict from the unit, so a contended
|
|
48
|
+
* write that the retry would have serialized failed instead — measured on a
|
|
49
|
+
* burst of partial refunds against one allocation, 18 of 20 answered `503`.
|
|
50
|
+
*/ export const mongoUnitFault = (error)=>isMongoContention(error) ? new Contention() : new Unavailable({
|
|
51
|
+
dependency: 'mongo'
|
|
52
|
+
});
|
|
34
53
|
export const translateMongoError = (error, context = {})=>{
|
|
35
54
|
var _context_dependency;
|
|
36
55
|
// Already translated, by an inner call: pass it through as it is.
|
|
@@ -44,7 +63,7 @@ export const translateMongoError = (error, context = {})=>{
|
|
|
44
63
|
key
|
|
45
64
|
});
|
|
46
65
|
}
|
|
47
|
-
if (
|
|
66
|
+
if (isMongoContention(error)) return new Contention();
|
|
48
67
|
if (driver.code === MAX_TIME_EXPIRED || driver.name === 'MongoNetworkTimeoutError' || driver.name === 'MongoOperationTimeoutError') return new Timeout({
|
|
49
68
|
dependency
|
|
50
69
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/errors/translate-mongo-error.ts"],"sourcesContent":["import {\n Contention,\n DuplicateKey,\n isFailure,\n isStoreFault,\n ProtocolFailure,\n type StoreFailure,\n type StoreFault,\n Timeout,\n Unavailable,\n} from '@entifix/core';\n\n/**\n * What a Mongo driver error means, as a categorised failure\n * ([ADR 0013](../../../../../docs/adr/0013-failures-are-typed-values-decided-at-the-shell.md)).\n *\n * Read by **name, code and label**, never by class: the driver's error classes\n * are not what a consumer can match on, and a second copy of the driver in one\n * process would answer `instanceof` with `false`.\n */\nexport interface MongoErrorContext {\n /** What the failure names as its dependency; `mongo` when absent. */\n readonly dependency?: string;\n /**\n * What a duplicate key means here. On a declared uniqueness it is a\n * `conflict` — the caller asked for something that already exists. On a\n * claim or a race (an inbox, a command claim, a saga claim) it is\n * `contention` — someone else got there first, and retrying wins or replays.\n */\n readonly duplicate?: 'conflict' | 'contention';\n}\n\ninterface DriverErrorShape {\n readonly name?: unknown;\n readonly code?: unknown;\n readonly codeName?: unknown;\n readonly keyPattern?: unknown;\n readonly writeErrors?: ReadonlyArray<{ readonly code?: unknown }>;\n readonly errorLabels?: readonly string[];\n readonly hasErrorLabel?: (label: string) => boolean;\n readonly cause?: unknown;\n}\n\nconst shape = (error: unknown): DriverErrorShape =>\n typeof error === 'object' && error !== null\n ? (error as DriverErrorShape)\n : {};\n\nconst labelled = (error: DriverErrorShape, label: string): boolean =>\n error.hasErrorLabel?.(label) ?? error.errorLabels?.includes(label) ?? false;\n\n/** Whether a server label is on `error` or in its cause chain. */\nexport const mongoErrorLabelled = (error: unknown, label: string): boolean => {\n let current: unknown = error;\n for (let depth = 0; current != null && depth < 5; depth += 1) {\n if (labelled(shape(current), label)) return true;\n current = shape(current).cause;\n }\n return false;\n};\n\nconst DUPLICATE_KEY = 11000;\nconst WRITE_CONFLICT = 112;\nconst MAX_TIME_EXPIRED = 50;\n\nconst UNREACHABLE = new Set([\n 'MongoNetworkError',\n 'MongoServerSelectionError',\n 'MongoNotConnectedError',\n 'MongoTopologyClosedError',\n 'MongoServerClosedError',\n 'MongoPoolClosedError',\n]);\n\nconst isDuplicate = (error: DriverErrorShape): boolean =>\n error.code === DUPLICATE_KEY ||\n (error.writeErrors?.some(write => write.code === DUPLICATE_KEY) ?? false);\n\nconst duplicatedKey = (error: DriverErrorShape): string | undefined =>\n typeof error.keyPattern === 'object' && error.keyPattern !== null\n ? Object.keys(error.keyPattern).join(',')\n : undefined;\n\nexport const translateMongoError = (\n error: unknown,\n context: MongoErrorContext = {},\n): StoreFailure => {\n // Already translated, by an inner call: pass it through as it is.\n if (isFailure(error)) return error as StoreFailure;\n const dependency = context.dependency ?? 'mongo';\n const driver = shape(error);\n\n if (isDuplicate(driver)) {\n if (context.duplicate === 'contention') return new Contention();\n const key = duplicatedKey(driver);\n return new DuplicateKey(key === undefined ? {} : { key });\n }\n if (
|
|
1
|
+
{"version":3,"sources":["../../src/errors/translate-mongo-error.ts"],"sourcesContent":["import {\n Contention,\n DuplicateKey,\n isFailure,\n isStoreFault,\n ProtocolFailure,\n type StoreFailure,\n type StoreFault,\n Timeout,\n Unavailable,\n} from '@entifix/core';\n\n/**\n * What a Mongo driver error means, as a categorised failure\n * ([ADR 0013](../../../../../docs/adr/0013-failures-are-typed-values-decided-at-the-shell.md)).\n *\n * Read by **name, code and label**, never by class: the driver's error classes\n * are not what a consumer can match on, and a second copy of the driver in one\n * process would answer `instanceof` with `false`.\n */\nexport interface MongoErrorContext {\n /** What the failure names as its dependency; `mongo` when absent. */\n readonly dependency?: string;\n /**\n * What a duplicate key means here. On a declared uniqueness it is a\n * `conflict` — the caller asked for something that already exists. On a\n * claim or a race (an inbox, a command claim, a saga claim) it is\n * `contention` — someone else got there first, and retrying wins or replays.\n */\n readonly duplicate?: 'conflict' | 'contention';\n}\n\ninterface DriverErrorShape {\n readonly name?: unknown;\n readonly code?: unknown;\n readonly codeName?: unknown;\n readonly keyPattern?: unknown;\n readonly writeErrors?: ReadonlyArray<{ readonly code?: unknown }>;\n readonly errorLabels?: readonly string[];\n readonly hasErrorLabel?: (label: string) => boolean;\n readonly cause?: unknown;\n}\n\nconst shape = (error: unknown): DriverErrorShape =>\n typeof error === 'object' && error !== null\n ? (error as DriverErrorShape)\n : {};\n\nconst labelled = (error: DriverErrorShape, label: string): boolean =>\n error.hasErrorLabel?.(label) ?? error.errorLabels?.includes(label) ?? false;\n\n/** Whether a server label is on `error` or in its cause chain. */\nexport const mongoErrorLabelled = (error: unknown, label: string): boolean => {\n let current: unknown = error;\n for (let depth = 0; current != null && depth < 5; depth += 1) {\n if (labelled(shape(current), label)) return true;\n current = shape(current).cause;\n }\n return false;\n};\n\nconst DUPLICATE_KEY = 11000;\nconst WRITE_CONFLICT = 112;\nconst MAX_TIME_EXPIRED = 50;\n\nconst UNREACHABLE = new Set([\n 'MongoNetworkError',\n 'MongoServerSelectionError',\n 'MongoNotConnectedError',\n 'MongoTopologyClosedError',\n 'MongoServerClosedError',\n 'MongoPoolClosedError',\n]);\n\nconst isDuplicate = (error: DriverErrorShape): boolean =>\n error.code === DUPLICATE_KEY ||\n (error.writeErrors?.some(write => write.code === DUPLICATE_KEY) ?? false);\n\nconst duplicatedKey = (error: DriverErrorShape): string | undefined =>\n typeof error.keyPattern === 'object' && error.keyPattern !== null\n ? Object.keys(error.keyPattern).join(',')\n : undefined;\n\n/**\n * Whether a driver error is a transaction losing a race: a write conflict, or\n * anything the server labels `TransientTransactionError`. A unit of work runs\n * itself again on exactly this — so a body that maps its own driver errors\n * must answer {@link Contention} for these and nothing else, or the retry\n * never happens and a contended write that would have serialized fails.\n */\nexport const isMongoContention = (error: unknown): boolean =>\n shape(error).code === WRITE_CONFLICT ||\n mongoErrorLabelled(error, 'TransientTransactionError');\n\n/**\n * A failure of a driver call a unit of work's **body** makes itself: a lost\n * race is {@link Contention}, which the unit runs itself again on, and\n * anything else is the store failing to answer.\n *\n * ⚠️ **Not an `Unavailable` for everything.** A body that answered every\n * driver error that way hid the write conflict from the unit, so a contended\n * write that the retry would have serialized failed instead — measured on a\n * burst of partial refunds against one allocation, 18 of 20 answered `503`.\n */\nexport const mongoUnitFault = (error: unknown): Contention | Unavailable =>\n isMongoContention(error)\n ? new Contention()\n : new Unavailable({ dependency: 'mongo' });\n\nexport const translateMongoError = (\n error: unknown,\n context: MongoErrorContext = {},\n): StoreFailure => {\n // Already translated, by an inner call: pass it through as it is.\n if (isFailure(error)) return error as StoreFailure;\n const dependency = context.dependency ?? 'mongo';\n const driver = shape(error);\n\n if (isDuplicate(driver)) {\n if (context.duplicate === 'contention') return new Contention();\n const key = duplicatedKey(driver);\n return new DuplicateKey(key === undefined ? {} : { key });\n }\n if (isMongoContention(error)) return new Contention();\n if (\n driver.code === MAX_TIME_EXPIRED ||\n driver.name === 'MongoNetworkTimeoutError' ||\n driver.name === 'MongoOperationTimeoutError'\n )\n return new Timeout({ dependency });\n if (driver.name === 'BSONError')\n return new ProtocolFailure({\n reason: `${dependency} answered a document that does not decode`,\n });\n if (typeof driver.name === 'string' && UNREACHABLE.has(driver.name))\n return new Unavailable({ dependency });\n // Anything else the driver raised is still the store failing to answer,\n // which is what the class tree called every one of these.\n return new Unavailable({ dependency });\n};\n\n/**\n * A driver error as the store's own fault, for the bookkeeping a mechanism\n * does around a caller's work — a claim, a commit, a remembered answer. A\n * duplicate key there means a race lost, never an answer for the caller.\n */\nexport const translateMongoFault = (\n error: unknown,\n context: Omit<MongoErrorContext, 'duplicate'> = {},\n): StoreFault => {\n const failure = translateMongoError(error, {\n ...context,\n duplicate: 'contention',\n });\n return isStoreFault(failure) ? failure : new Contention();\n};\n"],"names":["Contention","DuplicateKey","isFailure","isStoreFault","ProtocolFailure","Timeout","Unavailable","shape","error","labelled","label","hasErrorLabel","errorLabels","includes","mongoErrorLabelled","current","depth","cause","DUPLICATE_KEY","WRITE_CONFLICT","MAX_TIME_EXPIRED","UNREACHABLE","Set","isDuplicate","code","writeErrors","some","write","duplicatedKey","keyPattern","Object","keys","join","undefined","isMongoContention","mongoUnitFault","dependency","translateMongoError","context","driver","duplicate","key","name","reason","has","translateMongoFault","failure"],"mappings":"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"}
|
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
* the manifest — importing this module without that peer installed is the
|
|
10
10
|
* error, and it is the adopter's to make deliberately.
|
|
11
11
|
*/
|
|
12
|
+
/**
|
|
13
|
+
* How a unit of work's body answers its own driver calls' failures, so the
|
|
14
|
+
* write conflict the unit retries on is never hidden behind a failure of the
|
|
15
|
+
* body's choosing.
|
|
16
|
+
*/
|
|
17
|
+
export { mongoUnitFault } from '../errors/translate-mongo-error.js';
|
|
12
18
|
export * from '../idempotency/store.js';
|
|
13
19
|
export * from '../inbox/store.js';
|
|
14
20
|
export * from '../outbox/relay.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transactions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transactions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH;;;;GAIG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC"}
|
|
@@ -8,7 +8,12 @@
|
|
|
8
8
|
* actually keeps it optional is the `peerDependenciesMeta.optional` entry in
|
|
9
9
|
* the manifest — importing this module without that peer installed is the
|
|
10
10
|
* error, and it is the adopter's to make deliberately.
|
|
11
|
-
*/
|
|
11
|
+
*/ /**
|
|
12
|
+
* How a unit of work's body answers its own driver calls' failures, so the
|
|
13
|
+
* write conflict the unit retries on is never hidden behind a failure of the
|
|
14
|
+
* body's choosing.
|
|
15
|
+
*/ export { mongoUnitFault } from '../errors/translate-mongo-error.js';
|
|
16
|
+
export * from '../idempotency/store.js';
|
|
12
17
|
export * from '../inbox/store.js';
|
|
13
18
|
export * from '../outbox/relay.js';
|
|
14
19
|
export * from '../outbox/store.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/transactions/index.ts"],"sourcesContent":["/**\n * The half of this package that needs `@entifix/transactions`: the\n * transactional outbox written inside the entity's own Mongo\n * transaction, and the inbox that makes a redelivered command idempotent.\n *\n * Behind a subpath so entity CRUD over Mongo does not arrive with the saga\n * engine attached. Package-level dependencies are not per-subpath, so what\n * actually keeps it optional is the `peerDependenciesMeta.optional` entry in\n * the manifest — importing this module without that peer installed is the\n * error, and it is the adopter's to make deliberately.\n */\nexport * from '../idempotency/store.js';\nexport * from '../inbox/store.js';\nexport * from '../outbox/relay.js';\nexport * from '../outbox/store.js';\nexport * from '../unit-of-work/command-inbox.js';\nexport * from '../unit-of-work/mongo-unit-of-work.js';\n"],"names":[],"mappings":"AAAA;;;;;;;;;;CAUC,GACD,cAAc,0BAA0B;AACxC,cAAc,oBAAoB;AAClC,cAAc,qBAAqB;AACnC,cAAc,qBAAqB;AACnC,cAAc,mCAAmC;AACjD,cAAc,wCAAwC"}
|
|
1
|
+
{"version":3,"sources":["../../src/transactions/index.ts"],"sourcesContent":["/**\n * The half of this package that needs `@entifix/transactions`: the\n * transactional outbox written inside the entity's own Mongo\n * transaction, and the inbox that makes a redelivered command idempotent.\n *\n * Behind a subpath so entity CRUD over Mongo does not arrive with the saga\n * engine attached. Package-level dependencies are not per-subpath, so what\n * actually keeps it optional is the `peerDependenciesMeta.optional` entry in\n * the manifest — importing this module without that peer installed is the\n * error, and it is the adopter's to make deliberately.\n */\n/**\n * How a unit of work's body answers its own driver calls' failures, so the\n * write conflict the unit retries on is never hidden behind a failure of the\n * body's choosing.\n */\nexport { mongoUnitFault } from '../errors/translate-mongo-error.js';\nexport * from '../idempotency/store.js';\nexport * from '../inbox/store.js';\nexport * from '../outbox/relay.js';\nexport * from '../outbox/store.js';\nexport * from '../unit-of-work/command-inbox.js';\nexport * from '../unit-of-work/mongo-unit-of-work.js';\n"],"names":["mongoUnitFault"],"mappings":"AAAA;;;;;;;;;;CAUC,GACD;;;;CAIC,GACD,SAASA,cAAc,QAAQ,qCAAqC;AACpE,cAAc,0BAA0B;AACxC,cAAc,oBAAoB;AAClC,cAAc,qBAAqB;AACnC,cAAc,qBAAqB;AACnC,cAAc,mCAAmC;AACjD,cAAc,wCAAwC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entifix/mongo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "MongoDB adapter: an entity repository, RSQL-to-Mongo query translation, per-tenant databases, and an optional transactional outbox.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -57,17 +57,17 @@
|
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@swc/helpers": "0.5.23",
|
|
59
59
|
"mongodb": "7.8.0",
|
|
60
|
-
"@entifix/business": "0.
|
|
61
|
-
"@entifix/core": "0.
|
|
60
|
+
"@entifix/business": "0.18.0",
|
|
61
|
+
"@entifix/core": "0.18.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"effect": "4.0.7",
|
|
65
|
-
"@entifix/testing-unit": "0.
|
|
66
|
-
"@entifix/transactions": "0.
|
|
65
|
+
"@entifix/testing-unit": "0.18.0",
|
|
66
|
+
"@entifix/transactions": "0.18.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"effect": "^4.0.7",
|
|
70
|
-
"@entifix/transactions": "0.
|
|
70
|
+
"@entifix/transactions": "0.18.0"
|
|
71
71
|
},
|
|
72
72
|
"peerDependenciesMeta": {
|
|
73
73
|
"@entifix/transactions": {
|