@fireproof/core-test 0.0.0-smoke-1b31059-1752074105

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.
Files changed (162) hide show
  1. package/LICENSE.md +232 -0
  2. package/blockstore/fp-envelope.test.ts-off +65 -0
  3. package/blockstore/fragment-gateway.test.ts-off +106 -0
  4. package/blockstore/interceptor-gateway.test.d.ts +19 -0
  5. package/blockstore/interceptor-gateway.test.js +217 -0
  6. package/blockstore/interceptor-gateway.test.js.map +1 -0
  7. package/blockstore/interceptor-gateway.test.ts +259 -0
  8. package/blockstore/keyed-crypto-indexeddb-file.test.d.ts +1 -0
  9. package/blockstore/keyed-crypto-indexeddb-file.test.js +114 -0
  10. package/blockstore/keyed-crypto-indexeddb-file.test.js.map +1 -0
  11. package/blockstore/keyed-crypto-indexeddb-file.test.ts +134 -0
  12. package/blockstore/keyed-crypto.test.d.ts +1 -0
  13. package/blockstore/keyed-crypto.test.js +310 -0
  14. package/blockstore/keyed-crypto.test.js.map +1 -0
  15. package/blockstore/keyed-crypto.test.ts +382 -0
  16. package/blockstore/loader.test.d.ts +1 -0
  17. package/blockstore/loader.test.js +241 -0
  18. package/blockstore/loader.test.js.map +1 -0
  19. package/blockstore/loader.test.ts +313 -0
  20. package/blockstore/standalone.test.d.ts +1 -0
  21. package/blockstore/standalone.test.js +112 -0
  22. package/blockstore/standalone.test.js.map +1 -0
  23. package/blockstore/standalone.test.ts +156 -0
  24. package/blockstore/store.test.d.ts +1 -0
  25. package/blockstore/store.test.js +152 -0
  26. package/blockstore/store.test.js.map +1 -0
  27. package/blockstore/store.test.ts +199 -0
  28. package/blockstore/transaction.test.d.ts +1 -0
  29. package/blockstore/transaction.test.js +109 -0
  30. package/blockstore/transaction.test.js.map +1 -0
  31. package/blockstore/transaction.test.ts +132 -0
  32. package/fireproof/all-gateway.test.d.ts +1 -0
  33. package/fireproof/all-gateway.test.js +333 -0
  34. package/fireproof/all-gateway.test.js.map +1 -0
  35. package/fireproof/all-gateway.test.ts +477 -0
  36. package/fireproof/attachable.test.d.ts +1 -0
  37. package/fireproof/attachable.test.js +438 -0
  38. package/fireproof/attachable.test.js.map +1 -0
  39. package/fireproof/attachable.test.ts +677 -0
  40. package/fireproof/cars/bafkreidxwt2nhvbl4fnqfw3ctlt6zbrir4kqwmjo5im6rf4q5si27kgo2i.car +0 -0
  41. package/fireproof/cars/bafkreidxwt2nhvbl4fnqfw3ctlt6zbrir4kqwmjo5im6rf4q5si27kgo2i.d.ts +4 -0
  42. package/fireproof/cars/bafkreidxwt2nhvbl4fnqfw3ctlt6zbrir4kqwmjo5im6rf4q5si27kgo2i.js +325 -0
  43. package/fireproof/cars/bafkreidxwt2nhvbl4fnqfw3ctlt6zbrir4kqwmjo5im6rf4q5si27kgo2i.js.map +1 -0
  44. package/fireproof/cars/bafkreidxwt2nhvbl4fnqfw3ctlt6zbrir4kqwmjo5im6rf4q5si27kgo2i.ts +324 -0
  45. package/fireproof/charwise-boolean.test.d.ts +1 -0
  46. package/fireproof/charwise-boolean.test.js +43 -0
  47. package/fireproof/charwise-boolean.test.js.map +1 -0
  48. package/fireproof/charwise-boolean.test.ts +68 -0
  49. package/fireproof/crdt.test.d.ts +1 -0
  50. package/fireproof/crdt.test.js +509 -0
  51. package/fireproof/crdt.test.js.map +1 -0
  52. package/fireproof/crdt.test.ts +572 -0
  53. package/fireproof/database.test.d.ts +1 -0
  54. package/fireproof/database.test.js +658 -0
  55. package/fireproof/database.test.js.map +1 -0
  56. package/fireproof/database.test.ts +772 -0
  57. package/fireproof/deleted-docs-handling.test.d.ts +1 -0
  58. package/fireproof/deleted-docs-handling.test.js +69 -0
  59. package/fireproof/deleted-docs-handling.test.js.map +1 -0
  60. package/fireproof/deleted-docs-handling.test.ts +112 -0
  61. package/fireproof/fireproof.test.d.ts +3 -0
  62. package/fireproof/fireproof.test.fixture.d.ts +15 -0
  63. package/fireproof/fireproof.test.fixture.js +134 -0
  64. package/fireproof/fireproof.test.fixture.js.map +1 -0
  65. package/fireproof/fireproof.test.fixture.ts +133 -0
  66. package/fireproof/fireproof.test.js +574 -0
  67. package/fireproof/fireproof.test.js.map +1 -0
  68. package/fireproof/fireproof.test.ts +767 -0
  69. package/fireproof/hello.test.d.ts +1 -0
  70. package/fireproof/hello.test.js +67 -0
  71. package/fireproof/hello.test.js.map +1 -0
  72. package/fireproof/hello.test.ts +75 -0
  73. package/fireproof/indexer.test.d.ts +1 -0
  74. package/fireproof/indexer.test.js +408 -0
  75. package/fireproof/indexer.test.js.map +1 -0
  76. package/fireproof/indexer.test.ts +459 -0
  77. package/fireproof/multiple-ledger.test.d.ts +1 -0
  78. package/fireproof/multiple-ledger.test.js +51 -0
  79. package/fireproof/multiple-ledger.test.js.map +1 -0
  80. package/fireproof/multiple-ledger.test.ts +67 -0
  81. package/fireproof/query-docs.test.d.ts +1 -0
  82. package/fireproof/query-docs.test.js +69 -0
  83. package/fireproof/query-docs.test.js.map +1 -0
  84. package/fireproof/query-docs.test.ts +117 -0
  85. package/fireproof/query-limit-issue.test.d.ts +1 -0
  86. package/fireproof/query-limit-issue.test.js +89 -0
  87. package/fireproof/query-limit-issue.test.js.map +1 -0
  88. package/fireproof/query-limit-issue.test.ts +147 -0
  89. package/fireproof/query-property-inconsistency.test.d.ts +1 -0
  90. package/fireproof/query-property-inconsistency.test.js +52 -0
  91. package/fireproof/query-property-inconsistency.test.js.map +1 -0
  92. package/fireproof/query-property-inconsistency.test.ts +90 -0
  93. package/fireproof/query-result-properties.test.d.ts +1 -0
  94. package/fireproof/query-result-properties.test.js +25 -0
  95. package/fireproof/query-result-properties.test.js.map +1 -0
  96. package/fireproof/query-result-properties.test.ts +43 -0
  97. package/fireproof/stable-cid.test.d.ts +1 -0
  98. package/fireproof/stable-cid.test.js +52 -0
  99. package/fireproof/stable-cid.test.js.map +1 -0
  100. package/fireproof/stable-cid.test.ts +72 -0
  101. package/fireproof/utils.test.d.ts +1 -0
  102. package/fireproof/utils.test.js +124 -0
  103. package/fireproof/utils.test.js.map +1 -0
  104. package/fireproof/utils.test.ts +137 -0
  105. package/gateway/file/loader-config.test.d.ts +1 -0
  106. package/gateway/file/loader-config.test.js +255 -0
  107. package/gateway/file/loader-config.test.js.map +1 -0
  108. package/gateway/file/loader-config.test.ts +309 -0
  109. package/gateway/indexeddb/loader-config.test.d.ts +1 -0
  110. package/gateway/indexeddb/loader-config.test.js +77 -0
  111. package/gateway/indexeddb/loader-config.test.js.map +1 -0
  112. package/gateway/indexeddb/loader-config.test.ts +80 -0
  113. package/global-setup.d.ts +2 -0
  114. package/global-setup.js +9 -0
  115. package/global-setup.js.map +1 -0
  116. package/global-setup.ts +11 -0
  117. package/helpers.d.ts +31 -0
  118. package/helpers.js +140 -0
  119. package/helpers.js.map +1 -0
  120. package/helpers.ts +177 -0
  121. package/package.json +75 -0
  122. package/protocols/cloud/msger.test.d.ts +1 -0
  123. package/protocols/cloud/msger.test.js +464 -0
  124. package/protocols/cloud/msger.test.js.map +1 -0
  125. package/protocols/cloud/msger.test.ts +559 -0
  126. package/runtime/fp-envelope-serialize.test.d.ts +1 -0
  127. package/runtime/fp-envelope-serialize.test.js +223 -0
  128. package/runtime/fp-envelope-serialize.test.js.map +1 -0
  129. package/runtime/fp-envelope-serialize.test.ts +266 -0
  130. package/runtime/meta-key-hack.test.d.ts +1 -0
  131. package/runtime/meta-key-hack.test.js +85 -0
  132. package/runtime/meta-key-hack.test.js.map +1 -0
  133. package/runtime/meta-key-hack.test.ts +103 -0
  134. package/setup.file.d.ts +1 -0
  135. package/setup.file.js +3 -0
  136. package/setup.file.js.map +1 -0
  137. package/setup.file.ts +1 -0
  138. package/setup.indexeddb.d.ts +1 -0
  139. package/setup.indexeddb.js +2 -0
  140. package/setup.indexeddb.js.map +1 -0
  141. package/setup.indexeddb.ts +0 -0
  142. package/setup.memory.d.ts +1 -0
  143. package/setup.memory.js +4 -0
  144. package/setup.memory.js.map +1 -0
  145. package/setup.memory.ts +2 -0
  146. package/tsconfig.json +18 -0
  147. package/vitest.config.d.ts +2 -0
  148. package/vitest.config.js +8 -0
  149. package/vitest.config.js.map +1 -0
  150. package/vitest.config.ts +8 -0
  151. package/vitest.file.config.d.ts +2 -0
  152. package/vitest.file.config.js +11 -0
  153. package/vitest.file.config.js.map +1 -0
  154. package/vitest.file.config.ts +11 -0
  155. package/vitest.indexeddb.config.d.ts +2 -0
  156. package/vitest.indexeddb.config.js +21 -0
  157. package/vitest.indexeddb.config.js.map +1 -0
  158. package/vitest.indexeddb.config.ts +34 -0
  159. package/vitest.memory.config.d.ts +2 -0
  160. package/vitest.memory.config.js +24 -0
  161. package/vitest.memory.config.js.map +1 -0
  162. package/vitest.memory.config.ts +24 -0
@@ -0,0 +1,223 @@
1
+ import { createDbMetaEvent } from "@fireproof/core-blockstore";
2
+ import { mockSuperThis, simpleCID } from "../helpers.js";
3
+ import { BuildURI, Result } from "@adviser/cement";
4
+ import { fpDeserialize, fpSerialize } from "@fireproof/core-gateways-base";
5
+ import { FPEnvelopeTypes, } from "@fireproof/core-types-blockstore";
6
+ import { toJSON } from "multiformats/link";
7
+ import { describe, expect, it } from "vitest";
8
+ describe("storage-content", () => {
9
+ const sthis = mockSuperThis();
10
+ it("car", async () => {
11
+ const raw = new Uint8Array([55, 56, 57]);
12
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=car&suffix=.car").URI(), Result.Ok(raw));
13
+ expect(res.isOk()).toBeTruthy();
14
+ expect(res.unwrap().type).toEqual(FPEnvelopeTypes.CAR);
15
+ expect(res.unwrap().payload).toEqual(raw);
16
+ });
17
+ it("file", async () => {
18
+ const raw = new Uint8Array([55, 56, 57]);
19
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=file").URI(), Result.Ok(raw));
20
+ expect(res.isOk()).toBeTruthy();
21
+ expect(res.unwrap().type).toEqual(FPEnvelopeTypes.FILE);
22
+ expect(res.unwrap().payload).toEqual(raw);
23
+ });
24
+ it("meta", async () => {
25
+ const ref = [
26
+ {
27
+ cid: "bafyreiaqmtw5jfudn6r6dq7mcmytc2z5z3ggohcj3gco3omjsp3hr73fpy",
28
+ data: "MomRkYXRhoWZkYk1ldGFYU3siY2FycyI6W3siLyI6ImJhZzR5dnFhYmNpcWNod29zeXQ3dTJqMmxtcHpyM2w3aWRlaTU1YzNmNnJ2Z3U3cXRmYXRoMnl2NnZuaWtjeXEifV19Z3BhcmVudHOA",
29
+ parents: [(await simpleCID(sthis)).toString(), (await simpleCID(sthis)).toString()],
30
+ },
31
+ ];
32
+ const raw = sthis.txt.encode(JSON.stringify(ref));
33
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=meta").URI(), Result.Ok(raw));
34
+ expect(res.isOk()).toBeTruthy();
35
+ expect(res.unwrap().type).toEqual(FPEnvelopeTypes.META);
36
+ const dbMetas = res.unwrap().payload;
37
+ expect(dbMetas.length).toBe(1);
38
+ const dbMeta = dbMetas[0];
39
+ expect(dbMeta.parents.map((i) => i.toString())).toStrictEqual(ref[0].parents);
40
+ expect(dbMeta.eventCid.toString()).toEqual("bafyreiaqmtw5jfudn6r6dq7mcmytc2z5z3ggohcj3gco3omjsp3hr73fpy");
41
+ expect(dbMeta.dbMeta.cars.map((i) => i.toString())).toEqual([
42
+ "bag4yvqabciqchwosyt7u2j2lmpzr3l7idei55c3f6rvgu7qtfath2yv6vnikcyq",
43
+ ]);
44
+ });
45
+ it("wal", async () => {
46
+ const ref = {
47
+ fileOperations: [
48
+ {
49
+ cid: "bafyreiaqmtw5jfudn6r6dq7mcmytc2z5z3ggohcj3gco3omjsp3hr73fpy",
50
+ public: false,
51
+ },
52
+ ],
53
+ noLoaderOps: [
54
+ {
55
+ cars: [
56
+ {
57
+ "/": "bag4yvqabciqchwosyt7u2j2lmpzr3l7idei55c3f6rvgu7qtfath2yv6vnikcyq",
58
+ },
59
+ ],
60
+ },
61
+ ],
62
+ operations: [
63
+ {
64
+ cars: [{ "/": "bag4yvqabciqchwosyt7u2j2lmpzr3l7idei55c3f6rvgu7qtfath2yv6vnikcyq" }],
65
+ },
66
+ ],
67
+ };
68
+ const raw = sthis.txt.encode(JSON.stringify(ref));
69
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=wal").URI(), Result.Ok(raw));
70
+ expect(res.isOk()).toBeTruthy();
71
+ expect(res.unwrap().type).toEqual(FPEnvelopeTypes.WAL);
72
+ const walstate = res.unwrap().payload;
73
+ expect(walstate.fileOperations.map((i) => ({
74
+ ...i,
75
+ cid: i.cid.toString(),
76
+ }))).toEqual(ref.fileOperations);
77
+ expect(walstate.noLoaderOps.map((i) => ({
78
+ cars: i.cars.map((i) => toJSON(i)),
79
+ }))).toEqual(ref.noLoaderOps);
80
+ expect(walstate.operations.map((i) => ({
81
+ cars: i.cars.map((i) => toJSON(i)),
82
+ }))).toEqual(ref.operations);
83
+ });
84
+ });
85
+ describe("de-serialize", () => {
86
+ const sthis = mockSuperThis();
87
+ it("car", async () => {
88
+ const msg = {
89
+ type: FPEnvelopeTypes.CAR,
90
+ payload: new Uint8Array([55, 56, 57]),
91
+ };
92
+ const res = await fpSerialize(sthis, msg);
93
+ expect(res.Ok()).toEqual(msg.payload);
94
+ });
95
+ it("file", async () => {
96
+ const msg = {
97
+ type: FPEnvelopeTypes.FILE,
98
+ payload: new Uint8Array([55, 56, 57]),
99
+ };
100
+ const res = await fpSerialize(sthis, msg);
101
+ expect(res.Ok()).toEqual(msg.payload);
102
+ });
103
+ it("meta", async () => {
104
+ const msg = {
105
+ type: FPEnvelopeTypes.META,
106
+ payload: [
107
+ await createDbMetaEvent(sthis, {
108
+ cars: [await simpleCID(sthis)],
109
+ }, [await simpleCID(sthis), await simpleCID(sthis)]),
110
+ ],
111
+ };
112
+ const ser = await fpSerialize(sthis, msg);
113
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=meta").URI(), ser);
114
+ const dbMetas = res.unwrap().payload;
115
+ expect(dbMetas.length).toBe(1);
116
+ const dbMeta = dbMetas[0];
117
+ expect(dbMeta.parents).toEqual(msg.payload[0].parents);
118
+ expect(dbMeta.dbMeta).toEqual(msg.payload[0].dbMeta);
119
+ expect(dbMeta.eventCid).toEqual(msg.payload[0].eventCid);
120
+ });
121
+ it("wal", async () => {
122
+ const msg = {
123
+ type: FPEnvelopeTypes.WAL,
124
+ payload: {
125
+ fileOperations: [
126
+ {
127
+ cid: await simpleCID(sthis),
128
+ public: false,
129
+ },
130
+ ],
131
+ noLoaderOps: [
132
+ {
133
+ cars: [await simpleCID(sthis)],
134
+ },
135
+ ],
136
+ operations: [
137
+ {
138
+ cars: [await simpleCID(sthis)],
139
+ },
140
+ ],
141
+ },
142
+ };
143
+ const ser = await fpSerialize(sthis, msg);
144
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=wal").URI(), ser);
145
+ expect(res.isOk()).toBeTruthy();
146
+ expect(res.unwrap().type).toEqual("wal");
147
+ const walstate = res.unwrap().payload;
148
+ expect(walstate.fileOperations).toEqual(msg.payload.fileOperations);
149
+ expect(walstate.noLoaderOps).toEqual(msg.payload.noLoaderOps);
150
+ expect(walstate.operations).toEqual(msg.payload.operations);
151
+ });
152
+ it("coerce into fpDeserialize Result", async () => {
153
+ const raw = new Uint8Array([55, 56, 57]);
154
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=car&suffix=.car").URI(), Result.Ok(raw));
155
+ expect(res.isOk()).toBeTruthy();
156
+ expect(res.unwrap().type).toEqual(FPEnvelopeTypes.CAR);
157
+ expect(res.unwrap().payload).toEqual(raw);
158
+ });
159
+ it("coerce into fpDeserialize Promise", async () => {
160
+ const raw = new Uint8Array([55, 56, 57]);
161
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=car&suffix=.car").URI(), Promise.resolve(raw));
162
+ expect(res.isOk()).toBeTruthy();
163
+ expect(res.unwrap().type).toEqual(FPEnvelopeTypes.CAR);
164
+ expect(res.unwrap().payload).toEqual(raw);
165
+ });
166
+ it("coerce into fpDeserialize Promise Result", async () => {
167
+ const raw = new Uint8Array([55, 56, 57]);
168
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=car&suffix=.car").URI(), Promise.resolve(Result.Ok(raw)));
169
+ expect(res.isOk()).toBeTruthy();
170
+ expect(res.unwrap().type).toEqual(FPEnvelopeTypes.CAR);
171
+ expect(res.unwrap().payload).toEqual(raw);
172
+ });
173
+ it("coerce into fpDeserialize Promise Result.Err", async () => {
174
+ const raw = Promise.resolve(Result.Err("error"));
175
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=car&suffix=.car").URI(), raw);
176
+ expect(res.isErr()).toBeTruthy();
177
+ expect(res.unwrap_err().message).toEqual("error");
178
+ });
179
+ it("coerce into fpDeserialize Promise.reject", async () => {
180
+ const raw = Promise.reject(new Error("error"));
181
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=car&suffix=.car").URI(), raw);
182
+ expect(res.isErr()).toBeTruthy();
183
+ expect(res.unwrap_err().message).toEqual("error");
184
+ });
185
+ it("coerce into fpDeserialize Result.Err", async () => {
186
+ const raw = Result.Err("error");
187
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=car&suffix=.car").URI(), raw);
188
+ expect(res.isErr()).toBeTruthy();
189
+ expect(res.unwrap_err().message).toEqual("error");
190
+ });
191
+ it("attach Key to Meta", async () => {
192
+ const msg = {
193
+ type: FPEnvelopeTypes.META,
194
+ payload: [
195
+ await createDbMetaEvent(sthis, {
196
+ cars: [await simpleCID(sthis)],
197
+ }, [await simpleCID(sthis), await simpleCID(sthis)]),
198
+ ],
199
+ };
200
+ const ser = await fpSerialize(sthis, msg, {
201
+ meta: async (sthis, payload) => {
202
+ return Result.Ok(sthis.txt.encode(JSON.stringify(payload.map((i) => ({ ...i, key: "key" })))));
203
+ },
204
+ });
205
+ let key = "";
206
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=meta").URI(), ser, {
207
+ meta: async (sthis, payload) => {
208
+ const json = JSON.parse(sthis.txt.decode(payload));
209
+ key = json[0].key;
210
+ return Result.Ok(json.map((i) => {
211
+ delete i.key;
212
+ return i;
213
+ }));
214
+ },
215
+ });
216
+ expect(res.isOk()).toBeTruthy();
217
+ const meta = res.unwrap();
218
+ expect(meta.type).toEqual("meta");
219
+ expect(Object.keys(meta.payload).includes("key")).toBeFalsy();
220
+ expect(key).toEqual("key");
221
+ });
222
+ });
223
+ //# sourceMappingURL=fp-envelope-serialize.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fp-envelope-serialize.test.js","sourceRoot":"","sources":["fp-envelope-serialize.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAKL,eAAe,GAIhB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,MAAM,KAAK,GAAG,aAAa,EAAE,CAAC;IAC9B,EAAE,CAAC,KAAK,EAAE,KAAK,IAAI,EAAE;QACnB,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QACzC,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAClH,MAAM,CAAC,GAAG,CAAC,IAAI,EAA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,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,266 @@
1
+ import { createDbMetaEvent } from "@fireproof/core-blockstore";
2
+ import { mockSuperThis, simpleCID } from "../helpers.js";
3
+ import { BuildURI, Result } from "@adviser/cement";
4
+ import { fpDeserialize, fpSerialize } from "@fireproof/core-gateways-base";
5
+ import {
6
+ DbMetaEvent,
7
+ FPEnvelopeCar,
8
+ FPEnvelopeFile,
9
+ FPEnvelopeMeta,
10
+ FPEnvelopeTypes,
11
+ FPEnvelopeWAL,
12
+ SerializedMeta,
13
+ WALState,
14
+ } from "@fireproof/core-types-blockstore";
15
+ import { toJSON } from "multiformats/link";
16
+ import { describe, expect, it } from "vitest";
17
+
18
+ describe("storage-content", () => {
19
+ const sthis = mockSuperThis();
20
+ it("car", async () => {
21
+ const raw = new Uint8Array([55, 56, 57]);
22
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=car&suffix=.car").URI(), Result.Ok(raw));
23
+ expect(res.isOk()).toBeTruthy();
24
+ expect(res.unwrap().type).toEqual(FPEnvelopeTypes.CAR);
25
+ expect(res.unwrap().payload).toEqual(raw);
26
+ });
27
+
28
+ it("file", async () => {
29
+ const raw = new Uint8Array([55, 56, 57]);
30
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=file").URI(), Result.Ok(raw));
31
+ expect(res.isOk()).toBeTruthy();
32
+ expect(res.unwrap().type).toEqual(FPEnvelopeTypes.FILE);
33
+ expect(res.unwrap().payload).toEqual(raw);
34
+ });
35
+
36
+ it("meta", async () => {
37
+ const ref = [
38
+ {
39
+ cid: "bafyreiaqmtw5jfudn6r6dq7mcmytc2z5z3ggohcj3gco3omjsp3hr73fpy",
40
+ data: "MomRkYXRhoWZkYk1ldGFYU3siY2FycyI6W3siLyI6ImJhZzR5dnFhYmNpcWNod29zeXQ3dTJqMmxtcHpyM2w3aWRlaTU1YzNmNnJ2Z3U3cXRmYXRoMnl2NnZuaWtjeXEifV19Z3BhcmVudHOA",
41
+ parents: [(await simpleCID(sthis)).toString(), (await simpleCID(sthis)).toString()],
42
+ },
43
+ ];
44
+ const raw = sthis.txt.encode(JSON.stringify(ref));
45
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=meta").URI(), Result.Ok(raw));
46
+ expect(res.isOk()).toBeTruthy();
47
+ expect(res.unwrap().type).toEqual(FPEnvelopeTypes.META);
48
+ const dbMetas = res.unwrap().payload as DbMetaEvent[];
49
+ expect(dbMetas.length).toBe(1);
50
+ const dbMeta = dbMetas[0];
51
+ expect(dbMeta.parents.map((i) => i.toString())).toStrictEqual(ref[0].parents);
52
+ expect(dbMeta.eventCid.toString()).toEqual("bafyreiaqmtw5jfudn6r6dq7mcmytc2z5z3ggohcj3gco3omjsp3hr73fpy");
53
+ expect(dbMeta.dbMeta.cars.map((i) => i.toString())).toEqual([
54
+ "bag4yvqabciqchwosyt7u2j2lmpzr3l7idei55c3f6rvgu7qtfath2yv6vnikcyq",
55
+ ]);
56
+ });
57
+
58
+ it("wal", async () => {
59
+ const ref = {
60
+ fileOperations: [
61
+ {
62
+ cid: "bafyreiaqmtw5jfudn6r6dq7mcmytc2z5z3ggohcj3gco3omjsp3hr73fpy",
63
+ public: false,
64
+ },
65
+ ],
66
+ noLoaderOps: [
67
+ {
68
+ cars: [
69
+ {
70
+ "/": "bag4yvqabciqchwosyt7u2j2lmpzr3l7idei55c3f6rvgu7qtfath2yv6vnikcyq",
71
+ },
72
+ ],
73
+ },
74
+ ],
75
+ operations: [
76
+ {
77
+ cars: [{ "/": "bag4yvqabciqchwosyt7u2j2lmpzr3l7idei55c3f6rvgu7qtfath2yv6vnikcyq" }],
78
+ },
79
+ ],
80
+ };
81
+ const raw = sthis.txt.encode(JSON.stringify(ref));
82
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=wal").URI(), Result.Ok(raw));
83
+ expect(res.isOk()).toBeTruthy();
84
+ expect(res.unwrap().type).toEqual(FPEnvelopeTypes.WAL);
85
+ const walstate = res.unwrap().payload as WALState;
86
+ expect(
87
+ walstate.fileOperations.map((i) => ({
88
+ ...i,
89
+ cid: i.cid.toString(),
90
+ })),
91
+ ).toEqual(ref.fileOperations);
92
+ expect(
93
+ walstate.noLoaderOps.map((i) => ({
94
+ cars: i.cars.map((i) => toJSON(i)),
95
+ })),
96
+ ).toEqual(ref.noLoaderOps);
97
+ expect(
98
+ walstate.operations.map((i) => ({
99
+ cars: i.cars.map((i) => toJSON(i)),
100
+ })),
101
+ ).toEqual(ref.operations);
102
+ });
103
+ });
104
+
105
+ describe("de-serialize", () => {
106
+ const sthis = mockSuperThis();
107
+ it("car", async () => {
108
+ const msg = {
109
+ type: FPEnvelopeTypes.CAR,
110
+ payload: new Uint8Array([55, 56, 57]),
111
+ } satisfies FPEnvelopeCar;
112
+ const res = await fpSerialize(sthis, msg);
113
+ expect(res.Ok()).toEqual(msg.payload);
114
+ });
115
+
116
+ it("file", async () => {
117
+ const msg = {
118
+ type: FPEnvelopeTypes.FILE,
119
+ payload: new Uint8Array([55, 56, 57]),
120
+ } satisfies FPEnvelopeFile;
121
+ const res = await fpSerialize(sthis, msg);
122
+ expect(res.Ok()).toEqual(msg.payload);
123
+ });
124
+
125
+ it("meta", async () => {
126
+ const msg = {
127
+ type: FPEnvelopeTypes.META,
128
+ payload: [
129
+ await createDbMetaEvent(
130
+ sthis,
131
+ {
132
+ cars: [await simpleCID(sthis)],
133
+ },
134
+ [await simpleCID(sthis), await simpleCID(sthis)],
135
+ ),
136
+ ],
137
+ } satisfies FPEnvelopeMeta;
138
+ const ser = await fpSerialize(sthis, msg);
139
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=meta").URI(), ser);
140
+ const dbMetas = res.unwrap().payload as DbMetaEvent[];
141
+ expect(dbMetas.length).toBe(1);
142
+ const dbMeta = dbMetas[0];
143
+ expect(dbMeta.parents).toEqual(msg.payload[0].parents);
144
+ expect(dbMeta.dbMeta).toEqual(msg.payload[0].dbMeta);
145
+ expect(dbMeta.eventCid).toEqual(msg.payload[0].eventCid);
146
+ });
147
+
148
+ it("wal", async () => {
149
+ const msg = {
150
+ type: FPEnvelopeTypes.WAL,
151
+ payload: {
152
+ fileOperations: [
153
+ {
154
+ cid: await simpleCID(sthis),
155
+ public: false,
156
+ },
157
+ ],
158
+ noLoaderOps: [
159
+ {
160
+ cars: [await simpleCID(sthis)],
161
+ },
162
+ ],
163
+ operations: [
164
+ {
165
+ cars: [await simpleCID(sthis)],
166
+ },
167
+ ],
168
+ },
169
+ } satisfies FPEnvelopeWAL;
170
+ const ser = await fpSerialize(sthis, msg);
171
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=wal").URI(), ser);
172
+ expect(res.isOk()).toBeTruthy();
173
+ expect(res.unwrap().type).toEqual("wal");
174
+ const walstate = res.unwrap().payload as WALState;
175
+ expect(walstate.fileOperations).toEqual(msg.payload.fileOperations);
176
+ expect(walstate.noLoaderOps).toEqual(msg.payload.noLoaderOps);
177
+ expect(walstate.operations).toEqual(msg.payload.operations);
178
+ });
179
+
180
+ it("coerce into fpDeserialize Result", async () => {
181
+ const raw = new Uint8Array([55, 56, 57]);
182
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=car&suffix=.car").URI(), Result.Ok(raw));
183
+ expect(res.isOk()).toBeTruthy();
184
+ expect(res.unwrap().type).toEqual(FPEnvelopeTypes.CAR);
185
+ expect(res.unwrap().payload).toEqual(raw);
186
+ });
187
+
188
+ it("coerce into fpDeserialize Promise", async () => {
189
+ const raw = new Uint8Array([55, 56, 57]);
190
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=car&suffix=.car").URI(), Promise.resolve(raw));
191
+ expect(res.isOk()).toBeTruthy();
192
+ expect(res.unwrap().type).toEqual(FPEnvelopeTypes.CAR);
193
+ expect(res.unwrap().payload).toEqual(raw);
194
+ });
195
+
196
+ it("coerce into fpDeserialize Promise Result", async () => {
197
+ const raw = new Uint8Array([55, 56, 57]);
198
+ const res = await fpDeserialize(
199
+ sthis,
200
+ BuildURI.from("http://x.com?store=car&suffix=.car").URI(),
201
+ Promise.resolve(Result.Ok(raw)),
202
+ );
203
+ expect(res.isOk()).toBeTruthy();
204
+ expect(res.unwrap().type).toEqual(FPEnvelopeTypes.CAR);
205
+ expect(res.unwrap().payload).toEqual(raw);
206
+ });
207
+
208
+ it("coerce into fpDeserialize Promise Result.Err", async () => {
209
+ const raw = Promise.resolve(Result.Err<Uint8Array>("error"));
210
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=car&suffix=.car").URI(), raw);
211
+ expect(res.isErr()).toBeTruthy();
212
+ expect(res.unwrap_err().message).toEqual("error");
213
+ });
214
+
215
+ it("coerce into fpDeserialize Promise.reject", async () => {
216
+ const raw = Promise.reject(new Error("error"));
217
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=car&suffix=.car").URI(), raw);
218
+ expect(res.isErr()).toBeTruthy();
219
+ expect(res.unwrap_err().message).toEqual("error");
220
+ });
221
+
222
+ it("coerce into fpDeserialize Result.Err", async () => {
223
+ const raw = Result.Err<Uint8Array>("error");
224
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=car&suffix=.car").URI(), raw);
225
+ expect(res.isErr()).toBeTruthy();
226
+ expect(res.unwrap_err().message).toEqual("error");
227
+ });
228
+
229
+ it("attach Key to Meta", async () => {
230
+ const msg = {
231
+ type: FPEnvelopeTypes.META,
232
+ payload: [
233
+ await createDbMetaEvent(
234
+ sthis,
235
+ {
236
+ cars: [await simpleCID(sthis)],
237
+ },
238
+ [await simpleCID(sthis), await simpleCID(sthis)],
239
+ ),
240
+ ],
241
+ } satisfies FPEnvelopeMeta;
242
+ const ser = await fpSerialize(sthis, msg, {
243
+ meta: async (sthis, payload) => {
244
+ return Result.Ok(sthis.txt.encode(JSON.stringify(payload.map((i) => ({ ...i, key: "key" })))));
245
+ },
246
+ });
247
+ let key = "";
248
+ const res = await fpDeserialize(sthis, BuildURI.from("http://x.com?store=meta").URI(), ser, {
249
+ meta: async (sthis, payload) => {
250
+ const json = JSON.parse(sthis.txt.decode(payload));
251
+ key = json[0].key;
252
+ return Result.Ok(
253
+ json.map((i: { key?: string }) => {
254
+ delete i.key;
255
+ return i;
256
+ }) as SerializedMeta[],
257
+ );
258
+ },
259
+ });
260
+ expect(res.isOk()).toBeTruthy();
261
+ const meta = res.unwrap() as FPEnvelopeMeta;
262
+ expect(meta.type).toEqual("meta");
263
+ expect(Object.keys(meta.payload).includes("key")).toBeFalsy();
264
+ expect(key).toEqual("key");
265
+ });
266
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,85 @@
1
+ import { BuildURI, URI } from "@adviser/cement";
2
+ import { fireproof } from "@fireproof/core-base";
3
+ import { registerStoreProtocol } from "@fireproof/core-blockstore";
4
+ import { MemoryGateway } from "@fireproof/core-gateways-memory";
5
+ import { AddKeyToDbMetaGateway } from "@fireproof/core-gateways-base";
6
+ import { beforeAll, describe, expect, it, vitest } from "vitest";
7
+ import { KeyBag } from "@fireproof/core-keybag";
8
+ import { ensureSuperThis } from "@fireproof/core-runtime";
9
+ import { PARAM } from "@fireproof/core-types-base";
10
+ describe("MetaKeyHack", () => {
11
+ const storageMap = new Map();
12
+ const sthis = ensureSuperThis();
13
+ const memGw = new MemoryGateway(sthis, storageMap);
14
+ registerStoreProtocol({
15
+ protocol: "hack:",
16
+ defaultURI: () => URI.from(`hack://localhost?version=hack`),
17
+ serdegateway: async () => {
18
+ return new AddKeyToDbMetaGateway(memGw, "v2");
19
+ },
20
+ });
21
+ let db;
22
+ let ctx;
23
+ beforeAll(async () => {
24
+ db = fireproof("test", {
25
+ storeUrls: {
26
+ base: BuildURI.from("hack://localhost").setParam(PARAM.SELF_REFLECT, "x"),
27
+ },
28
+ keyBag: {
29
+ url: "memory://./dist/kb-dir-partykit?extractKey=_deprecated_internal_api",
30
+ },
31
+ });
32
+ await db.ready();
33
+ ctx = { loader: db.ledger.crdt.blockstore.loader };
34
+ });
35
+ it("inject key into meta", async () => {
36
+ const loader = db.ledger.crdt.blockstore.loader;
37
+ const metaStore = loader.attachedStores.local().active.meta;
38
+ const subscribeFn = vitest.fn();
39
+ const unreg = await metaStore.realGateway.subscribe(ctx, metaStore.url(), subscribeFn);
40
+ expect(unreg.isOk()).toBeTruthy();
41
+ await db.put({ val: "test" });
42
+ const dataStore = loader.attachedStores.local().active.car;
43
+ const kb = new KeyBag(db.ledger.opts.keyBag);
44
+ const rDataStoreKeyItem = await kb.getNamedKey(dataStore.url().getParam(PARAM.STORE_KEY) ?? "");
45
+ await rDataStoreKeyItem.Ok().upsert("zBUFMmu5c3VdCa4r2DZTzhR", false);
46
+ await rDataStoreKeyItem.Ok().upsert("zH1fyizirAiYVxoaQ2XZ3Xj", false);
47
+ expect(rDataStoreKeyItem.isOk()).toBeTruthy();
48
+ const rUrl = await memGw.buildUrl(metaStore.url(), "main");
49
+ const rGet = await memGw.get(rUrl.Ok(), sthis);
50
+ const metas = JSON.parse(ctx.loader.sthis.txt.decode(rGet.Ok()));
51
+ const keyMaterials = metas.keys;
52
+ const dataStoreKeyMaterial = await rDataStoreKeyItem.Ok().asKeysItem();
53
+ expect(keyMaterials.length).toBeGreaterThan(0);
54
+ expect(dataStoreKeyMaterial).toEqual({
55
+ keys: {
56
+ ...(await rDataStoreKeyItem
57
+ .Ok()
58
+ .get()
59
+ .then(async (r) => ({
60
+ [r?.fingerPrint]: {
61
+ default: true,
62
+ fingerPrint: r?.fingerPrint,
63
+ key: await r?.extract().then((i) => i.keyStr),
64
+ },
65
+ }))),
66
+ z3boMcLEQxjZAMrVo2j3k9bZJzmSqXkQmh6q7bLZ2nRuo: {
67
+ default: false,
68
+ fingerPrint: "z3boMcLEQxjZAMrVo2j3k9bZJzmSqXkQmh6q7bLZ2nRuo",
69
+ key: "zH1fyizirAiYVxoaQ2XZ3Xj",
70
+ },
71
+ zG5F2VWVAs3uAFyLE5rty5WWo7zJ1oBmYTdnraxfhaHG5: {
72
+ default: false,
73
+ fingerPrint: "zG5F2VWVAs3uAFyLE5rty5WWo7zJ1oBmYTdnraxfhaHG5",
74
+ key: "zBUFMmu5c3VdCa4r2DZTzhR",
75
+ },
76
+ },
77
+ name: "@test-data@",
78
+ });
79
+ expect(subscribeFn).toHaveBeenCalledTimes(2);
80
+ const addKeyToDbMetaGateway = metaStore.realGateway;
81
+ expect(subscribeFn.mock.calls.map((i) => i.map((i) => i.payload.map((i) => i.eventCid.toString()))).flat(2)).toEqual(Array.from(new Set(addKeyToDbMetaGateway.lastDecodedMetas.map((i) => i.metas.map((i) => i.cid)).flat(2))));
82
+ unreg.Ok()();
83
+ });
84
+ });
85
+ //# sourceMappingURL=meta-key-hack.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta-key-hack.test.js","sourceRoot":"","sources":["meta-key-hack.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAY,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAE7D,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,MAAM,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;IAE7B,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAChC,MAAM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