jazz-tools 0.8.2 → 0.8.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. package/.turbo/turbo-build.log +11 -3
  2. package/CHANGELOG.md +17 -0
  3. package/dist/native/coValues/account.js.map +1 -0
  4. package/dist/native/coValues/coList.js.map +1 -0
  5. package/dist/native/coValues/coMap.js.map +1 -0
  6. package/dist/{coValues → native/coValues}/coStream.js +1 -0
  7. package/dist/native/coValues/coStream.js.map +1 -0
  8. package/dist/native/coValues/deepLoading.js.map +1 -0
  9. package/dist/native/coValues/extensions/imageDef.js.map +1 -0
  10. package/dist/native/coValues/group.js.map +1 -0
  11. package/dist/native/coValues/interfaces.js.map +1 -0
  12. package/dist/{implementation → native/implementation}/createContext.js +8 -1
  13. package/dist/native/implementation/createContext.js.map +1 -0
  14. package/dist/native/implementation/devtoolsFormatters.js.map +1 -0
  15. package/dist/{implementation → native/implementation}/errors.js.map +1 -1
  16. package/dist/native/implementation/inspect.js.map +1 -0
  17. package/dist/native/implementation/refs.js.map +1 -0
  18. package/dist/{implementation → native/implementation}/schema.js +14 -9
  19. package/dist/native/implementation/schema.js.map +1 -0
  20. package/dist/native/implementation/subscriptionScope.js.map +1 -0
  21. package/dist/native/implementation/symbols.js.map +1 -0
  22. package/dist/native/index.native.js +12 -0
  23. package/dist/native/index.native.js.map +1 -0
  24. package/dist/native/internal.js.map +1 -0
  25. package/dist/web/coValues/account.js +208 -0
  26. package/dist/web/coValues/account.js.map +1 -0
  27. package/dist/web/coValues/coList.js +395 -0
  28. package/dist/web/coValues/coList.js.map +1 -0
  29. package/dist/web/coValues/coMap.js +501 -0
  30. package/dist/web/coValues/coMap.js.map +1 -0
  31. package/dist/web/coValues/coStream.js +413 -0
  32. package/dist/web/coValues/coStream.js.map +1 -0
  33. package/dist/web/coValues/deepLoading.js +60 -0
  34. package/dist/web/coValues/deepLoading.js.map +1 -0
  35. package/dist/web/coValues/extensions/imageDef.js +37 -0
  36. package/dist/web/coValues/extensions/imageDef.js.map +1 -0
  37. package/dist/web/coValues/group.js +120 -0
  38. package/dist/web/coValues/group.js.map +1 -0
  39. package/dist/web/coValues/interfaces.js +109 -0
  40. package/dist/web/coValues/interfaces.js.map +1 -0
  41. package/dist/web/implementation/createContext.js +151 -0
  42. package/dist/web/implementation/createContext.js.map +1 -0
  43. package/dist/web/implementation/devtoolsFormatters.js +115 -0
  44. package/dist/web/implementation/devtoolsFormatters.js.map +1 -0
  45. package/dist/web/implementation/errors.js +2 -0
  46. package/dist/web/implementation/errors.js.map +1 -0
  47. package/dist/web/implementation/inspect.js +2 -0
  48. package/dist/web/implementation/inspect.js.map +1 -0
  49. package/dist/web/implementation/refs.js +127 -0
  50. package/dist/web/implementation/refs.js.map +1 -0
  51. package/dist/web/implementation/schema.js +96 -0
  52. package/dist/web/implementation/schema.js.map +1 -0
  53. package/dist/web/implementation/subscriptionScope.js +97 -0
  54. package/dist/web/implementation/subscriptionScope.js.map +1 -0
  55. package/dist/web/implementation/symbols.js +4 -0
  56. package/dist/web/implementation/symbols.js.map +1 -0
  57. package/dist/{index.js → web/index.web.js} +3 -3
  58. package/dist/{index.js.map → web/index.web.js.map} +1 -1
  59. package/dist/web/internal.js +17 -0
  60. package/dist/web/internal.js.map +1 -0
  61. package/package.json +25 -7
  62. package/src/coValues/account.ts +4 -1
  63. package/src/coValues/coStream.ts +26 -4
  64. package/src/coValues/group.ts +4 -1
  65. package/src/implementation/createContext.ts +12 -10
  66. package/src/implementation/schema.ts +21 -13
  67. package/src/{index.ts → index.native.ts} +2 -3
  68. package/src/index.web.ts +36 -0
  69. package/src/tests/coList.test.ts +2 -2
  70. package/src/tests/coMap.test.ts +12 -10
  71. package/src/tests/coStream.test.ts +2 -2
  72. package/src/tests/deepLoading.test.ts +2 -2
  73. package/src/tests/groupsAndAccounts.test.ts +1 -1
  74. package/src/tests/schema.test.ts +205 -0
  75. package/tsconfig.json +5 -4
  76. package/tsconfig.native.json +11 -0
  77. package/tsconfig.web.json +11 -0
  78. package/dist/coValues/account.js.map +0 -1
  79. package/dist/coValues/coList.js.map +0 -1
  80. package/dist/coValues/coMap.js.map +0 -1
  81. package/dist/coValues/coStream.js.map +0 -1
  82. package/dist/coValues/deepLoading.js.map +0 -1
  83. package/dist/coValues/extensions/imageDef.js.map +0 -1
  84. package/dist/coValues/group.js.map +0 -1
  85. package/dist/coValues/interfaces.js.map +0 -1
  86. package/dist/implementation/createContext.js.map +0 -1
  87. package/dist/implementation/devtoolsFormatters.js.map +0 -1
  88. package/dist/implementation/inspect.js.map +0 -1
  89. package/dist/implementation/refs.js.map +0 -1
  90. package/dist/implementation/schema.js.map +0 -1
  91. package/dist/implementation/subscriptionScope.js.map +0 -1
  92. package/dist/implementation/symbols.js.map +0 -1
  93. package/dist/internal.js.map +0 -1
  94. package/dist/tests/coList.test.js +0 -221
  95. package/dist/tests/coList.test.js.map +0 -1
  96. package/dist/tests/coMap.test.js +0 -615
  97. package/dist/tests/coMap.test.js.map +0 -1
  98. package/dist/tests/coStream.test.js +0 -324
  99. package/dist/tests/coStream.test.js.map +0 -1
  100. package/dist/tests/deepLoading.test.js +0 -175
  101. package/dist/tests/deepLoading.test.js.map +0 -1
  102. package/dist/tests/groupsAndAccounts.test.js +0 -69
  103. package/dist/tests/groupsAndAccounts.test.js.map +0 -1
  104. /package/dist/{coValues → native/coValues}/account.js +0 -0
  105. /package/dist/{coValues → native/coValues}/coList.js +0 -0
  106. /package/dist/{coValues → native/coValues}/coMap.js +0 -0
  107. /package/dist/{coValues → native/coValues}/deepLoading.js +0 -0
  108. /package/dist/{coValues → native/coValues}/extensions/imageDef.js +0 -0
  109. /package/dist/{coValues → native/coValues}/group.js +0 -0
  110. /package/dist/{coValues → native/coValues}/interfaces.js +0 -0
  111. /package/dist/{implementation → native/implementation}/devtoolsFormatters.js +0 -0
  112. /package/dist/{implementation → native/implementation}/errors.js +0 -0
  113. /package/dist/{implementation → native/implementation}/inspect.js +0 -0
  114. /package/dist/{implementation → native/implementation}/refs.js +0 -0
  115. /package/dist/{implementation → native/implementation}/subscriptionScope.js +0 -0
  116. /package/dist/{implementation → native/implementation}/symbols.js +0 -0
  117. /package/dist/{internal.js → native/internal.js} +0 -0
@@ -1,615 +0,0 @@
1
- import { expect, describe, test, expectTypeOf } from "vitest";
2
- import { connectedPeers } from "cojson/src/streamUtils.js";
3
- import { Account, Encoders, CoMap, co, WasmCrypto, isControlledAccount, cojsonInternals, createJazzContext, fixedCredentialsAuth, } from "../index.js";
4
- import { Group, randomSessionProvider } from "../internal.js";
5
- const Crypto = await WasmCrypto.create();
6
- class TestMap extends CoMap {
7
- color = co.string;
8
- _height = co.number;
9
- birthday = co.encoded(Encoders.Date);
10
- name = co.string;
11
- nullable = co.optional.encoded({
12
- encode: (value) => value || null,
13
- decode: (value) => value || undefined,
14
- });
15
- optionalDate = co.optional.encoded(Encoders.Date);
16
- get roughColor() {
17
- return this.color + "ish";
18
- }
19
- }
20
- describe("Simple CoMap operations", async () => {
21
- const me = await Account.create({
22
- creationProps: { name: "Hermes Puggington" },
23
- crypto: Crypto,
24
- });
25
- console.log("TestMap schema", TestMap.prototype._schema);
26
- const birthday = new Date();
27
- const map = TestMap.create({
28
- color: "red",
29
- _height: 10,
30
- birthday: birthday,
31
- nullable: undefined,
32
- }, { owner: me });
33
- test("Construction", () => {
34
- expect(map.color).toEqual("red");
35
- expect(map.roughColor).toEqual("redish");
36
- expect(map._height).toEqual(10);
37
- expect(map.birthday).toEqual(birthday);
38
- expect(map._raw.get("birthday")).toEqual(birthday.toISOString());
39
- expect(Object.keys(map)).toEqual([
40
- "color",
41
- "_height",
42
- "birthday",
43
- "nullable",
44
- ]);
45
- });
46
- test("Construction with too many things provided", () => {
47
- const mapWithExtra = TestMap.create({
48
- color: "red",
49
- _height: 10,
50
- birthday: birthday,
51
- name: "Hermes",
52
- extra: "extra",
53
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
54
- }, { owner: me });
55
- expect(mapWithExtra.color).toEqual("red");
56
- });
57
- describe("Mutation", () => {
58
- test("assignment & deletion", () => {
59
- map.color = "blue";
60
- expect(map.color).toEqual("blue");
61
- expect(map._raw.get("color")).toEqual("blue");
62
- const newBirthday = new Date();
63
- map.birthday = newBirthday;
64
- expect(map.birthday).toEqual(newBirthday);
65
- expect(map._raw.get("birthday")).toEqual(newBirthday.toISOString());
66
- Object.assign(map, { color: "green", _height: 20 });
67
- expect(map.color).toEqual("green");
68
- expect(map._raw.get("color")).toEqual("green");
69
- expect(map._height).toEqual(20);
70
- expect(map._raw.get("_height")).toEqual(20);
71
- map.nullable = "not null";
72
- map.nullable = undefined;
73
- delete map.nullable;
74
- map.nullable = undefined;
75
- map.name = "Secret name";
76
- expect(map.name).toEqual("Secret name");
77
- map.name = undefined;
78
- expect(map.name).toEqual(undefined);
79
- expect(Object.keys(map)).toContain("name");
80
- delete map.name;
81
- expect(map.name).toEqual(undefined);
82
- expect(Object.keys(map)).not.toContain("name");
83
- });
84
- });
85
- describe("property existence", () => {
86
- class TestMap extends CoMap.Record(co.string) {
87
- }
88
- test("CoMap", () => {
89
- const map = TestMap.create({ name: "test" }, {
90
- owner: me,
91
- });
92
- expect("name" in map).toBe(true);
93
- expect("something" in map).toBe(false);
94
- });
95
- });
96
- class RecursiveMap extends CoMap {
97
- name = co.string;
98
- next = co.ref(RecursiveMap);
99
- }
100
- const recursiveMap = RecursiveMap.create({
101
- name: "first",
102
- next: RecursiveMap.create({
103
- name: "second",
104
- next: RecursiveMap.create({
105
- name: "third",
106
- }, { owner: me }),
107
- }, { owner: me }),
108
- }, { owner: me });
109
- describe("Recursive CoMap", () => {
110
- test("Construction", () => {
111
- expect(recursiveMap.name).toEqual("first");
112
- expect(recursiveMap.next?.name).toEqual("second");
113
- expect(recursiveMap.next?.next?.name).toEqual("third");
114
- });
115
- });
116
- class MapWithEnumOfMaps extends CoMap {
117
- name = co.string;
118
- child = co.ref((raw) => raw.get("type") === "a" ? ChildA : ChildB);
119
- }
120
- class ChildA extends CoMap {
121
- type = co.literal("a");
122
- value = co.number;
123
- }
124
- class ChildB extends CoMap {
125
- type = co.literal("b");
126
- value = co.string;
127
- }
128
- const mapWithEnum = MapWithEnumOfMaps.create({
129
- name: "enum",
130
- child: ChildA.create({
131
- type: "a",
132
- value: 5,
133
- }, { owner: me }),
134
- }, { owner: me });
135
- test("Enum of maps", () => {
136
- expect(mapWithEnum.name).toEqual("enum");
137
- expect(mapWithEnum.child?.type).toEqual("a");
138
- expect(mapWithEnum.child?.value).toEqual(5);
139
- expect(mapWithEnum.child?.id).toBeDefined();
140
- });
141
- class SuperClassMap extends CoMap {
142
- name = co.string;
143
- }
144
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
145
- class SubClassMap extends SuperClassMap {
146
- name = co.literal("specificString");
147
- value = co.number;
148
- extra = co.ref(TestMap);
149
- }
150
- class GenericMapWithLoose extends CoMap {
151
- name = co.json();
152
- }
153
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
154
- const loose = {};
155
- });
156
- describe("CoMap resolution", async () => {
157
- class TwiceNestedMap extends CoMap {
158
- taste = co.string;
159
- }
160
- class NestedMap extends CoMap {
161
- name = co.string;
162
- twiceNested = co.ref(TwiceNestedMap);
163
- get _fancyName() {
164
- return "Sir " + this.name;
165
- }
166
- }
167
- class TestMap extends CoMap {
168
- color = co.string;
169
- height = co.number;
170
- nested = co.ref(NestedMap);
171
- get _roughColor() {
172
- return this.color + "ish";
173
- }
174
- }
175
- const initNodeAndMap = async () => {
176
- const me = await Account.create({
177
- creationProps: { name: "Hermes Puggington" },
178
- crypto: Crypto,
179
- });
180
- const map = TestMap.create({
181
- color: "red",
182
- height: 10,
183
- nested: NestedMap.create({
184
- name: "nested",
185
- twiceNested: TwiceNestedMap.create({ taste: "sour" }, { owner: me }),
186
- }, { owner: me }),
187
- }, { owner: me });
188
- return { me, map };
189
- };
190
- test("Construction", async () => {
191
- const { map } = await initNodeAndMap();
192
- // const test: Schema.Schema.To<typeof NestedMap>
193
- expect(map.color).toEqual("red");
194
- expect(map._roughColor).toEqual("redish");
195
- expect(map.height).toEqual(10);
196
- expect(map.nested?.name).toEqual("nested");
197
- expect(map.nested?._fancyName).toEqual("Sir nested");
198
- expect(map.nested?.id).toBeDefined();
199
- expect(map.nested?.twiceNested?.taste).toEqual("sour");
200
- });
201
- test("Loading and availability", async () => {
202
- const { me, map } = await initNodeAndMap();
203
- const [initialAsPeer, secondPeer] = connectedPeers("initial", "second", {
204
- peer1role: "server",
205
- peer2role: "client",
206
- });
207
- if (!isControlledAccount(me)) {
208
- throw "me is not a controlled account";
209
- }
210
- me._raw.core.node.syncManager.addPeer(secondPeer);
211
- const { account: meOnSecondPeer } = await createJazzContext({
212
- auth: fixedCredentialsAuth({
213
- accountID: me.id,
214
- secret: me._raw.agentSecret,
215
- }),
216
- sessionProvider: randomSessionProvider,
217
- peersToLoadFrom: [initialAsPeer],
218
- crypto: Crypto,
219
- });
220
- const loadedMap = await TestMap.load(map.id, meOnSecondPeer, {});
221
- expect(loadedMap?.color).toEqual("red");
222
- expect(loadedMap?.height).toEqual(10);
223
- expect(loadedMap?.nested).toEqual(null);
224
- expect(loadedMap?._refs.nested?.id).toEqual(map.nested?.id);
225
- expect(loadedMap?._refs.nested?.value).toEqual(null);
226
- const loadedNestedMap = await NestedMap.load(map.nested.id, meOnSecondPeer, {});
227
- expect(loadedMap?.nested?.name).toEqual("nested");
228
- expect(loadedMap?.nested?._fancyName).toEqual("Sir nested");
229
- expect(loadedMap?._refs.nested?.value).toEqual(loadedNestedMap);
230
- expect(loadedMap?.nested?.twiceNested?.taste).toEqual(undefined);
231
- const loadedTwiceNestedMap = await TwiceNestedMap.load(map.nested.twiceNested.id, meOnSecondPeer, {});
232
- expect(loadedMap?.nested?.twiceNested?.taste).toEqual("sour");
233
- expect(loadedMap?.nested?._refs.twiceNested?.value).toEqual(loadedTwiceNestedMap);
234
- const otherNestedMap = NestedMap.create({
235
- name: "otherNested",
236
- twiceNested: TwiceNestedMap.create({ taste: "sweet" }, { owner: meOnSecondPeer }),
237
- }, { owner: meOnSecondPeer });
238
- loadedMap.nested = otherNestedMap;
239
- expect(loadedMap?.nested?.name).toEqual("otherNested");
240
- expect(loadedMap?._refs.nested?.id).toEqual(otherNestedMap.id);
241
- expect(loadedMap?._refs.nested?.value).toEqual(otherNestedMap);
242
- expect(loadedMap?.nested?.twiceNested?.taste).toEqual("sweet");
243
- expect(loadedMap?.nested?._refs.twiceNested?.value).toBeDefined();
244
- });
245
- test("Subscription & auto-resolution", async () => {
246
- const { me, map } = await initNodeAndMap();
247
- const [initialAsPeer, secondAsPeer] = connectedPeers("initial", "second", {
248
- peer1role: "server",
249
- peer2role: "client",
250
- });
251
- if (!isControlledAccount(me)) {
252
- throw "me is not a controlled account";
253
- }
254
- me._raw.core.node.syncManager.addPeer(secondAsPeer);
255
- const { account: meOnSecondPeer } = await createJazzContext({
256
- auth: fixedCredentialsAuth({
257
- accountID: me.id,
258
- secret: me._raw.agentSecret,
259
- }),
260
- sessionProvider: randomSessionProvider,
261
- peersToLoadFrom: [initialAsPeer],
262
- crypto: Crypto,
263
- });
264
- const queue = new cojsonInternals.Channel();
265
- TestMap.subscribe(map.id, meOnSecondPeer, {}, (subscribedMap) => {
266
- console.log("subscribedMap.nested?.twiceNested?.taste", subscribedMap.nested?.twiceNested?.taste);
267
- void queue.push(subscribedMap);
268
- });
269
- const update1 = (await queue.next()).value;
270
- expect(update1.nested).toEqual(null);
271
- const update2 = (await queue.next()).value;
272
- expect(update2.nested?.name).toEqual("nested");
273
- map.nested.name = "nestedUpdated";
274
- const _ = (await queue.next()).value;
275
- const update3 = (await queue.next()).value;
276
- expect(update3.nested?.name).toEqual("nestedUpdated");
277
- const oldTwiceNested = update3.nested.twiceNested;
278
- expect(oldTwiceNested?.taste).toEqual("sour");
279
- // When assigning a new nested value, we get an update
280
- const newTwiceNested = TwiceNestedMap.create({
281
- taste: "sweet",
282
- }, { owner: meOnSecondPeer });
283
- const newNested = NestedMap.create({
284
- name: "newNested",
285
- twiceNested: newTwiceNested,
286
- }, { owner: meOnSecondPeer });
287
- update3.nested = newNested;
288
- (await queue.next()).value;
289
- // const update4 = (await queue.next()).value;
290
- const update4b = (await queue.next()).value;
291
- expect(update4b.nested?.name).toEqual("newNested");
292
- expect(update4b.nested?.twiceNested?.taste).toEqual("sweet");
293
- // we get updates when the new nested value changes
294
- newTwiceNested.taste = "salty";
295
- const update5 = (await queue.next()).value;
296
- expect(update5.nested?.twiceNested?.taste).toEqual("salty");
297
- newTwiceNested.taste = "umami";
298
- const update6 = (await queue.next()).value;
299
- expect(update6.nested?.twiceNested?.taste).toEqual("umami");
300
- });
301
- class TestMapWithOptionalRef extends CoMap {
302
- color = co.string;
303
- nested = co.optional.ref(NestedMap);
304
- }
305
- test("Construction with optional", async () => {
306
- const me = await Account.create({
307
- creationProps: { name: "Hermes Puggington" },
308
- crypto: Crypto,
309
- });
310
- const mapWithout = TestMapWithOptionalRef.create({
311
- color: "red",
312
- }, { owner: me });
313
- expect(mapWithout.color).toEqual("red");
314
- expect(mapWithout.nested).toEqual(undefined);
315
- const mapWith = TestMapWithOptionalRef.create({
316
- color: "red",
317
- nested: NestedMap.create({
318
- name: "wow!",
319
- twiceNested: TwiceNestedMap.create({ taste: "sour" }, { owner: me }),
320
- }, { owner: me }),
321
- }, { owner: me });
322
- expect(mapWith.color).toEqual("red");
323
- expect(mapWith.nested?.name).toEqual("wow!");
324
- expect(mapWith.nested?._fancyName).toEqual("Sir wow!");
325
- expect(mapWith.nested?._raw).toBeDefined();
326
- });
327
- // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
328
- class TestRecord extends CoMap {
329
- [co.items] = co.number;
330
- }
331
- test("Construction with index signature", async () => {
332
- const me = await Account.create({
333
- creationProps: { name: "Hermes Puggington" },
334
- crypto: Crypto,
335
- });
336
- const record = TestRecord.create({
337
- height: 5,
338
- other: 3,
339
- }, { owner: me });
340
- expect(record.height).toEqual(5);
341
- expect(record._raw.get("height")).toEqual(5);
342
- expect(record.other).toEqual(3);
343
- expect(record._raw.get("other")).toEqual(3);
344
- expect(Object.keys(record)).toEqual(["height", "other"]);
345
- expect(record.toJSON()).toMatchObject({
346
- _type: "CoMap",
347
- height: 5,
348
- id: expect.any(String),
349
- other: 3,
350
- });
351
- });
352
- class TestRecord2 extends CoMap.Record(co.number) {
353
- }
354
- test("Construction with index signature (shorthand)", async () => {
355
- const me = await Account.create({
356
- creationProps: { name: "Hermes Puggington" },
357
- crypto: Crypto,
358
- });
359
- const record = TestRecord2.create({
360
- height: 5,
361
- other: 3,
362
- }, { owner: me });
363
- expect(record.height).toEqual(5);
364
- expect(record._raw.get("height")).toEqual(5);
365
- expect(record.other).toEqual(3);
366
- expect(record._raw.get("other")).toEqual(3);
367
- expect(Object.keys(record)).toEqual(["height", "other"]);
368
- });
369
- class TestRecordRef extends CoMap.Record(co.ref(TwiceNestedMap)) {
370
- }
371
- test("Construction with index signature ref", async () => {
372
- const me = await Account.create({
373
- creationProps: { name: "Hermes Puggington" },
374
- crypto: Crypto,
375
- });
376
- const record = TestRecordRef.create({
377
- firstNested: TwiceNestedMap.create({ taste: "sour" }, { owner: me }),
378
- secondNested: TwiceNestedMap.create({ taste: "sweet" }, { owner: me }),
379
- }, { owner: me });
380
- expect(record.firstNested?.taste).toEqual("sour");
381
- expect(record.firstNested?.id).toBeDefined();
382
- expect(record.secondNested?.taste).toEqual("sweet");
383
- expect(record.secondNested?.id).toBeDefined();
384
- expect(Object.keys(record)).toEqual(["firstNested", "secondNested"]);
385
- expect(Object.keys(record._refs)).toEqual([
386
- "firstNested",
387
- "secondNested",
388
- ]);
389
- });
390
- });
391
- describe("CoMap applyDiff", async () => {
392
- const me = await Account.create({
393
- creationProps: { name: "Tester McTesterson" },
394
- crypto: Crypto,
395
- });
396
- class TestMap extends CoMap {
397
- name = co.string;
398
- age = co.number;
399
- isActive = co.boolean;
400
- birthday = co.encoded(Encoders.Date);
401
- nested = co.ref(NestedMap);
402
- optionalField = co.optional.string;
403
- optionalNested = co.optional.ref(NestedMap);
404
- }
405
- class NestedMap extends CoMap {
406
- value = co.string;
407
- }
408
- test("Basic applyDiff", () => {
409
- const map = TestMap.create({
410
- name: "Alice",
411
- age: 30,
412
- isActive: true,
413
- birthday: new Date("1990-01-01"),
414
- nested: NestedMap.create({ value: "original" }, { owner: me }),
415
- }, { owner: me });
416
- const newValues = {
417
- name: "Bob",
418
- age: 35,
419
- isActive: false,
420
- };
421
- map.applyDiff(newValues);
422
- expect(map.name).toEqual("Bob");
423
- expect(map.age).toEqual(35);
424
- expect(map.isActive).toEqual(false);
425
- expect(map.birthday).toEqual(new Date("1990-01-01"));
426
- expect(map.nested?.value).toEqual("original");
427
- });
428
- test("applyDiff with nested changes", () => {
429
- const map = TestMap.create({
430
- name: "Charlie",
431
- age: 25,
432
- isActive: true,
433
- birthday: new Date("1995-01-01"),
434
- nested: NestedMap.create({ value: "original" }, { owner: me }),
435
- }, { owner: me });
436
- const newValues = {
437
- name: "David",
438
- nested: NestedMap.create({ value: "updated" }, { owner: me }),
439
- };
440
- map.applyDiff(newValues);
441
- expect(map.name).toEqual("David");
442
- expect(map.age).toEqual(25);
443
- expect(map.nested?.value).toEqual("updated");
444
- });
445
- test("applyDiff with encoded fields", () => {
446
- const map = TestMap.create({
447
- name: "Eve",
448
- age: 28,
449
- isActive: true,
450
- birthday: new Date("1993-01-01"),
451
- nested: NestedMap.create({ value: "original" }, { owner: me }),
452
- }, { owner: me });
453
- const newValues = {
454
- birthday: new Date("1993-06-15"),
455
- };
456
- map.applyDiff(newValues);
457
- expect(map.birthday).toEqual(new Date("1993-06-15"));
458
- });
459
- test("applyDiff with optional fields", () => {
460
- const map = TestMap.create({
461
- name: "Frank",
462
- age: 40,
463
- isActive: true,
464
- birthday: new Date("1980-01-01"),
465
- nested: NestedMap.create({ value: "original" }, { owner: me }),
466
- }, { owner: me });
467
- const newValues = {
468
- optionalField: "New optional value",
469
- };
470
- map.applyDiff(newValues);
471
- expect(map.optionalField).toEqual("New optional value");
472
- map.applyDiff({ optionalField: undefined });
473
- expect(map.optionalField).toBeUndefined();
474
- });
475
- test("applyDiff with no changes", () => {
476
- const map = TestMap.create({
477
- name: "Grace",
478
- age: 35,
479
- isActive: true,
480
- birthday: new Date("1985-01-01"),
481
- nested: NestedMap.create({ value: "original" }, { owner: me }),
482
- }, { owner: me });
483
- const originalJSON = map.toJSON();
484
- map.applyDiff({});
485
- expect(map.toJSON()).toEqual(originalJSON);
486
- });
487
- test("applyDiff with invalid field", () => {
488
- const map = TestMap.create({
489
- name: "Henry",
490
- age: 45,
491
- isActive: false,
492
- birthday: new Date("1975-01-01"),
493
- nested: NestedMap.create({ value: "original" }, { owner: me }),
494
- }, { owner: me });
495
- const newValues = {
496
- name: "Ian",
497
- invalidField: "This should be ignored",
498
- };
499
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
500
- map.applyDiff(newValues);
501
- expect(map.name).toEqual("Ian");
502
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
503
- expect(map.invalidField).toBeUndefined();
504
- });
505
- test("applyDiff with optional reference set to null", () => {
506
- const map = TestMap.create({
507
- name: "Jack",
508
- age: 50,
509
- isActive: true,
510
- birthday: new Date("1970-01-01"),
511
- nested: NestedMap.create({ value: "original" }, { owner: me }),
512
- optionalNested: NestedMap.create({ value: "optional" }, { owner: me }),
513
- }, { owner: me });
514
- const newValues = {
515
- optionalNested: null,
516
- };
517
- map.applyDiff(newValues);
518
- expect(map.optionalNested).toBeNull();
519
- });
520
- test("applyDiff with required reference set to null should throw", () => {
521
- const map = TestMap.create({
522
- name: "Kate",
523
- age: 55,
524
- isActive: true,
525
- birthday: new Date("1965-01-01"),
526
- nested: NestedMap.create({ value: "original" }, { owner: me }),
527
- }, { owner: me });
528
- const newValues = {
529
- nested: null,
530
- };
531
- // @ts-expect-error testing invalid usage
532
- expect(() => map.applyDiff(newValues)).toThrowError("Cannot set required reference nested to null");
533
- });
534
- });
535
- describe("CoMap Typescript validation", async () => {
536
- const me = await Account.create({
537
- creationProps: { name: "Hermes Puggington" },
538
- crypto: Crypto,
539
- });
540
- test("Is not ok to pass null into a required ref", () => {
541
- class TestMap extends CoMap {
542
- required = co.ref(NestedMap);
543
- optional = co.optional.ref(NestedMap);
544
- }
545
- class NestedMap extends CoMap {
546
- value = co.string;
547
- }
548
- expectTypeOf().toBeCallableWith({
549
- optional: NestedMap.create({ value: "" }, { owner: me }),
550
- // @ts-expect-error null can't be passed to a non-optional field
551
- required: null,
552
- }, { owner: me });
553
- });
554
- test("Is not ok if a required ref is omitted", () => {
555
- class TestMap extends CoMap {
556
- required = co.ref(NestedMap);
557
- optional = co.ref(NestedMap, { optional: true });
558
- }
559
- class NestedMap extends CoMap {
560
- value = co.string;
561
- }
562
- expectTypeOf().toBeCallableWith(
563
- // @ts-expect-error non-optional fields can't be omitted
564
- {}, { owner: me });
565
- });
566
- test("Is ok to omit optional fields", () => {
567
- class TestMap extends CoMap {
568
- required = co.ref(NestedMap);
569
- optional = co.ref(NestedMap, { optional: true });
570
- }
571
- class NestedMap extends CoMap {
572
- value = co.string;
573
- }
574
- expectTypeOf().toBeCallableWith({
575
- required: NestedMap.create({ value: "" }, { owner: me }),
576
- }, { owner: me });
577
- expectTypeOf().toBeCallableWith({
578
- required: NestedMap.create({ value: "" }, { owner: me }),
579
- optional: null,
580
- }, { owner: me });
581
- });
582
- test("the required refs should be nullable", () => {
583
- class TestMap extends CoMap {
584
- required = co.ref(NestedMap);
585
- optional = co.ref(NestedMap, { optional: true });
586
- }
587
- class NestedMap extends CoMap {
588
- value = co.string;
589
- }
590
- const map = TestMap.create({
591
- required: NestedMap.create({ value: "" }, { owner: me }),
592
- }, { owner: me });
593
- expectTypeOf(map.required).toBeNullable();
594
- });
595
- });
596
- describe("Creating and finding unique CoMaps", async () => {
597
- test("Creating and finding unique CoMaps", async () => {
598
- const me = await Account.create({
599
- creationProps: { name: "Tester McTesterson" },
600
- crypto: Crypto,
601
- });
602
- const group = await Group.create({
603
- owner: me,
604
- });
605
- const alice = TestMap.create({
606
- name: "Alice",
607
- _height: 100,
608
- birthday: new Date("1990-01-01"),
609
- color: "red",
610
- }, { owner: group, unique: { name: "Alice" } });
611
- const foundAlice = TestMap.findUnique({ name: "Alice" }, group.id, me);
612
- expect(foundAlice).toEqual(alice.id);
613
- });
614
- });
615
- //# sourceMappingURL=coMap.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"coMap.test.js","sourceRoot":"","sources":["../../src/tests/coMap.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EACH,OAAO,EACP,QAAQ,EACR,KAAK,EACL,EAAE,EACF,UAAU,EACV,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,GACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE9D,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC;AAEzC,MAAM,OAAQ,SAAQ,KAAK;IACvB,KAAK,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC;IACpB,QAAQ,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACrC,IAAI,GAAI,EAAE,CAAC,MAAM,CAAC;IAClB,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAqB;QAC/C,MAAM,EAAE,CAAC,KAAyB,EAAE,EAAE,CAAC,KAAK,IAAI,IAAI;QACpD,MAAM,EAAE,CAAC,KAAc,EAAE,EAAE,CAAE,KAAgB,IAAI,SAAS;KAC7D,CAAC,CAAC;IACH,YAAY,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAElD,IAAI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