@rotorsoft/act 1.23.2 → 1.23.3
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/.tsbuildinfo +1 -1
- package/dist/@types/adapters/in-memory-store.d.ts.map +1 -1
- package/dist/{chunk-4HYYZOEH.js → chunk-5YIRFU4Y.js} +17 -4
- package/dist/chunk-5YIRFU4Y.js.map +1 -0
- package/dist/index.cjs +16 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/test/index.cjs +16 -3
- package/dist/test/index.cjs.map +1 -1
- package/dist/test/index.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-4HYYZOEH.js.map +0 -1
package/dist/index.js
CHANGED
package/dist/test/index.cjs
CHANGED
|
@@ -750,7 +750,7 @@ var InMemoryStore = class {
|
|
|
750
750
|
if (query?.created_before && e.created >= query.created_before)
|
|
751
751
|
continue;
|
|
752
752
|
if (query.after !== void 0 && e.id <= query.after) break;
|
|
753
|
-
if (query.created_after && e.created <= query.created_after)
|
|
753
|
+
if (query.created_after && e.created <= query.created_after) continue;
|
|
754
754
|
await Promise.resolve(
|
|
755
755
|
callback(this._with_pii(e))
|
|
756
756
|
);
|
|
@@ -773,7 +773,8 @@ var InMemoryStore = class {
|
|
|
773
773
|
if (query && !this.in_query(query, e)) continue;
|
|
774
774
|
if (query?.created_after && e.created <= query.created_after) continue;
|
|
775
775
|
if (query?.before !== void 0 && e.id >= query.before) break;
|
|
776
|
-
if (query?.created_before && e.created >= query.created_before)
|
|
776
|
+
if (query?.created_before && e.created >= query.created_before)
|
|
777
|
+
continue;
|
|
777
778
|
await Promise.resolve(
|
|
778
779
|
callback(this._with_pii(e))
|
|
779
780
|
);
|
|
@@ -1325,17 +1326,28 @@ var InMemoryStore = class {
|
|
|
1325
1326
|
const prev_stream_versions = this._stream_versions;
|
|
1326
1327
|
const prev_max_event_id_by_stream = this._max_event_id_by_stream;
|
|
1327
1328
|
const prev_max_non_snap_event_id = this._max_non_snap_event_id;
|
|
1329
|
+
const prev_pii = this._pii;
|
|
1328
1330
|
this._events = [];
|
|
1329
1331
|
this._next_id = 0;
|
|
1330
1332
|
this._streams = /* @__PURE__ */ new Map();
|
|
1331
1333
|
this._stream_versions = /* @__PURE__ */ new Map();
|
|
1332
1334
|
this._max_event_id_by_stream = /* @__PURE__ */ new Map();
|
|
1333
1335
|
this._max_non_snap_event_id = -1;
|
|
1336
|
+
this._pii = /* @__PURE__ */ new Map();
|
|
1334
1337
|
try {
|
|
1335
1338
|
await driver(async (event) => {
|
|
1336
1339
|
const id = this._next_id++;
|
|
1337
|
-
const
|
|
1340
|
+
const { pii, ...rest } = event;
|
|
1341
|
+
const committed = { ...rest, id };
|
|
1338
1342
|
this._events.push(committed);
|
|
1343
|
+
if (pii != null) {
|
|
1344
|
+
let per_stream = this._pii.get(event.stream);
|
|
1345
|
+
if (!per_stream) {
|
|
1346
|
+
per_stream = /* @__PURE__ */ new Map();
|
|
1347
|
+
this._pii.set(event.stream, per_stream);
|
|
1348
|
+
}
|
|
1349
|
+
per_stream.set(id, structuredClone(pii));
|
|
1350
|
+
}
|
|
1339
1351
|
this._stream_versions.set(event.stream, event.version);
|
|
1340
1352
|
if (event.name !== SNAP_EVENT) {
|
|
1341
1353
|
this._max_event_id_by_stream.set(event.stream, id);
|
|
@@ -1350,6 +1362,7 @@ var InMemoryStore = class {
|
|
|
1350
1362
|
this._stream_versions = prev_stream_versions;
|
|
1351
1363
|
this._max_event_id_by_stream = prev_max_event_id_by_stream;
|
|
1352
1364
|
this._max_non_snap_event_id = prev_max_non_snap_event_id;
|
|
1365
|
+
this._pii = prev_pii;
|
|
1353
1366
|
throw err;
|
|
1354
1367
|
}
|
|
1355
1368
|
}
|