@ddd-ts/store-inmemory 0.0.3-17 → 0.0.3-19

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.
@@ -0,0 +1,10 @@
1
+ import { TransactionPerformer } from "@ddd-ts/model";
2
+ import { InMemoryDatabase } from "./store/in-memory.database";
3
+ import { InMemoryTransaction } from "./store/in-memory.transaction";
4
+ export declare class InMemoryTransactionPerformer extends TransactionPerformer<InMemoryTransaction> {
5
+ constructor(db: InMemoryDatabase);
6
+ }
7
+ export declare class FakeInMemoryTransactionPerformer extends TransactionPerformer<null> {
8
+ constructor();
9
+ }
10
+ //# sourceMappingURL=in-memory.transaction-performer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"in-memory.transaction-performer.d.ts","sourceRoot":"","sources":["../src/in-memory.transaction-performer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,qBAAa,4BAA6B,SAAQ,oBAAoB,CAAC,mBAAmB,CAAC;gBAC7E,EAAE,EAAE,gBAAgB;CAGjC;AAED,qBAAa,gCAAiC,SAAQ,oBAAoB,CAAC,IAAI,CAAC;;CAI/E"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FakeInMemoryTransactionPerformer = exports.InMemoryTransactionPerformer = void 0;
4
+ const model_1 = require("@ddd-ts/model");
5
+ class InMemoryTransactionPerformer extends model_1.TransactionPerformer {
6
+ constructor(db) {
7
+ super((effect) => db.transactionally(effect));
8
+ }
9
+ }
10
+ exports.InMemoryTransactionPerformer = InMemoryTransactionPerformer;
11
+ class FakeInMemoryTransactionPerformer extends model_1.TransactionPerformer {
12
+ constructor() {
13
+ super((effect) => effect(null));
14
+ }
15
+ }
16
+ exports.FakeInMemoryTransactionPerformer = FakeInMemoryTransactionPerformer;
17
+ //# sourceMappingURL=in-memory.transaction-performer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"in-memory.transaction-performer.js","sourceRoot":"","sources":["../src/in-memory.transaction-performer.ts"],"names":[],"mappings":";;;AAAA,yCAAqD;AAIrD,MAAa,4BAA6B,SAAQ,4BAAyC;IACzF,YAAY,EAAoB;QAC9B,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAChD,CAAC;CACF;AAJD,oEAIC;AAED,MAAa,gCAAiC,SAAQ,4BAA0B;IAC9E;QACE,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAClC,CAAC;CACF;AAJD,4EAIC"}
@@ -0,0 +1,31 @@
1
+ import { Storage } from "./in-memory.storage";
2
+ interface LoadOperation {
3
+ type: "load";
4
+ id: string;
5
+ collection: string;
6
+ }
7
+ export interface LoadAllOperation {
8
+ type: "loadMany";
9
+ collection: string;
10
+ ids: string[];
11
+ }
12
+ export interface WriteOperation {
13
+ type: "write";
14
+ collection: string;
15
+ id: string;
16
+ data: any;
17
+ }
18
+ export interface DeleteOperation {
19
+ type: "delete";
20
+ collection: string;
21
+ id: string;
22
+ }
23
+ export interface InMemoryTransaction {
24
+ storageAtInitialization: Storage;
25
+ operations: (LoadOperation | LoadAllOperation | WriteOperation | DeleteOperation)[];
26
+ }
27
+ export declare class WriteCollisionDetected extends Error {
28
+ constructor(id: string);
29
+ }
30
+ export {};
31
+ //# sourceMappingURL=in-memory.transaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"in-memory.transaction.d.ts","sourceRoot":"","sources":["../../src/store/in-memory.transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,UAAU,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,EAAE,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,GAAG,CAAC;CACX;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,mBAAmB;IAClC,uBAAuB,EAAE,OAAO,CAAC;IACjC,UAAU,EAAE,CACR,aAAa,GACb,gBAAgB,GAChB,cAAc,GACd,eAAe,CAClB,EAAE,CAAC;CACL;AAED,qBAAa,sBAAuB,SAAQ,KAAK;gBACnC,EAAE,EAAE,MAAM;CAGvB"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WriteCollisionDetected = void 0;
4
+ class WriteCollisionDetected extends Error {
5
+ constructor(id) {
6
+ super(`Write collision detected for key "${id}"`);
7
+ }
8
+ }
9
+ exports.WriteCollisionDetected = WriteCollisionDetected;
10
+ //# sourceMappingURL=in-memory.transaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"in-memory.transaction.js","sourceRoot":"","sources":["../../src/store/in-memory.transaction.ts"],"names":[],"mappings":";;;AAqCA,MAAa,sBAAuB,SAAQ,KAAK;IAC/C,YAAY,EAAU;QACpB,KAAK,CAAC,qCAAqC,EAAE,GAAG,CAAC,CAAC;IACpD,CAAC;CACF;AAJD,wDAIC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ddd-ts/store-inmemory",
3
- "version": "0.0.3-17",
3
+ "version": "0.0.3-19",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "MIT",