@rotorsoft/act-tck 1.27.3 → 1.27.5
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/store-tck.d.ts.map +1 -1
- package/dist/index.cjs +91 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +91 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-tck.d.ts","sourceRoot":"","sources":["../../src/store-tck.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAQV,KAAK,EAEN,MAAM,sBAAsB,CAAC;AAc9B;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;;OAOG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC;;;;;;;;;OASG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACpC;;;;;;;;OAQG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IACxC;;;;;;;;OAQG;IACH,QAAQ,CAAC,gCAAgC,CAAC,EAAE,OAAO,CAAC;CACrD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/C;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,iB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/dist/index.cjs
CHANGED
|
@@ -3978,6 +3978,97 @@ var runStoreTck = (options) => {
|
|
|
3978
3978
|
);
|
|
3979
3979
|
(0, import_vitest9.expect)(calls).toEqual([1, 2]);
|
|
3980
3980
|
});
|
|
3981
|
+
(0, import_vitest9.it)("query created bounds are filters, not id-ordered breaks", async () => {
|
|
3982
|
+
const s = `restore-created-order-${uid()}`;
|
|
3983
|
+
const newest = /* @__PURE__ */ new Date("2020-06-01T00:00:00.000Z");
|
|
3984
|
+
const oldest = /* @__PURE__ */ new Date("2020-01-01T00:00:00.000Z");
|
|
3985
|
+
await restore(
|
|
3986
|
+
as_source([
|
|
3987
|
+
event(1, s, 0, "Incremented", newest, { amount: 10 }),
|
|
3988
|
+
event(2, s, 1, "Incremented", oldest, { amount: 20 })
|
|
3989
|
+
])
|
|
3990
|
+
);
|
|
3991
|
+
const cutoff = /* @__PURE__ */ new Date("2020-03-01T00:00:00.000Z");
|
|
3992
|
+
const fwd = [];
|
|
3993
|
+
await store.query(
|
|
3994
|
+
(e) => {
|
|
3995
|
+
fwd.push(e.data.amount);
|
|
3996
|
+
},
|
|
3997
|
+
{ stream: s, stream_exact: true, created_before: cutoff }
|
|
3998
|
+
);
|
|
3999
|
+
(0, import_vitest9.expect)(fwd).toEqual([20]);
|
|
4000
|
+
const bwd = [];
|
|
4001
|
+
await store.query(
|
|
4002
|
+
(e) => {
|
|
4003
|
+
bwd.push(e.data.amount);
|
|
4004
|
+
},
|
|
4005
|
+
{
|
|
4006
|
+
stream: s,
|
|
4007
|
+
stream_exact: true,
|
|
4008
|
+
created_after: cutoff,
|
|
4009
|
+
backward: true
|
|
4010
|
+
}
|
|
4011
|
+
);
|
|
4012
|
+
(0, import_vitest9.expect)(bwd).toEqual([10]);
|
|
4013
|
+
});
|
|
4014
|
+
import_vitest9.it.skipIf(!caps.pii_isolation)(
|
|
4015
|
+
"isolates restored pii so forget_pii erases it",
|
|
4016
|
+
async () => {
|
|
4017
|
+
const s = `restore-pii-${uid()}`;
|
|
4018
|
+
const t = /* @__PURE__ */ new Date("2020-05-01T00:00:00.000Z");
|
|
4019
|
+
const result = await restore(
|
|
4020
|
+
as_source([
|
|
4021
|
+
{
|
|
4022
|
+
id: 1,
|
|
4023
|
+
stream: s,
|
|
4024
|
+
version: 0,
|
|
4025
|
+
name: "Incremented",
|
|
4026
|
+
data: { amount: 1 },
|
|
4027
|
+
pii: { email: "first@example.com" },
|
|
4028
|
+
created: t,
|
|
4029
|
+
meta: { correlation: "restore-tck", causation: {} }
|
|
4030
|
+
},
|
|
4031
|
+
{
|
|
4032
|
+
id: 2,
|
|
4033
|
+
stream: s,
|
|
4034
|
+
version: 1,
|
|
4035
|
+
name: "Incremented",
|
|
4036
|
+
data: { amount: 2 },
|
|
4037
|
+
pii: { email: "second@example.com" },
|
|
4038
|
+
created: t,
|
|
4039
|
+
meta: { correlation: "restore-tck", causation: {} }
|
|
4040
|
+
}
|
|
4041
|
+
])
|
|
4042
|
+
);
|
|
4043
|
+
(0, import_vitest9.expect)(result.kept).toBe(2);
|
|
4044
|
+
const before = [];
|
|
4045
|
+
await store.query(
|
|
4046
|
+
(e) => {
|
|
4047
|
+
before.push(e);
|
|
4048
|
+
},
|
|
4049
|
+
{ stream: s, stream_exact: true }
|
|
4050
|
+
);
|
|
4051
|
+
(0, import_vitest9.expect)(before.map((e) => e.pii)).toEqual([
|
|
4052
|
+
{ email: "first@example.com" },
|
|
4053
|
+
{ email: "second@example.com" }
|
|
4054
|
+
]);
|
|
4055
|
+
const wiped = await store.forget_pii.call(store, s);
|
|
4056
|
+
(0, import_vitest9.expect)(wiped).toBe(2);
|
|
4057
|
+
const after = [];
|
|
4058
|
+
await store.query(
|
|
4059
|
+
(e) => {
|
|
4060
|
+
after.push(e);
|
|
4061
|
+
},
|
|
4062
|
+
{ stream: s, stream_exact: true }
|
|
4063
|
+
);
|
|
4064
|
+
(0, import_vitest9.expect)(after).toHaveLength(2);
|
|
4065
|
+
for (const e of after) (0, import_vitest9.expect)(e.pii == null).toBe(true);
|
|
4066
|
+
(0, import_vitest9.expect)(after.map((e) => e.data)).toEqual([
|
|
4067
|
+
{ amount: 1 },
|
|
4068
|
+
{ amount: 2 }
|
|
4069
|
+
]);
|
|
4070
|
+
}
|
|
4071
|
+
);
|
|
3981
4072
|
});
|
|
3982
4073
|
import_vitest9.describe.skipIf(!caps.pii_isolation)("pii_isolation (capability)", () => {
|
|
3983
4074
|
(0, import_vitest9.it)("commits and loads pii alongside data", async () => {
|