jazz-tools 0.7.0-alpha.3 → 0.7.0-alpha.31
Sign up to get free protection for your applications and to get access to all the features.
- package/.turbo/turbo-build.log +78 -8
- package/CHANGELOG.md +181 -0
- package/dist/coValues/account.js +81 -41
- package/dist/coValues/account.js.map +1 -1
- package/dist/coValues/coList.js +156 -104
- package/dist/coValues/coList.js.map +1 -1
- package/dist/coValues/coMap.js +182 -163
- package/dist/coValues/coMap.js.map +1 -1
- package/dist/coValues/coStream.js +202 -71
- package/dist/coValues/coStream.js.map +1 -1
- package/dist/coValues/extensions/imageDef.js +13 -8
- package/dist/coValues/extensions/imageDef.js.map +1 -1
- package/dist/coValues/group.js +46 -38
- package/dist/coValues/group.js.map +1 -1
- package/dist/coValues/interfaces.js +23 -5
- package/dist/coValues/interfaces.js.map +1 -1
- package/dist/implementation/refs.js +26 -12
- package/dist/implementation/refs.js.map +1 -1
- package/dist/implementation/schema.js +38 -1
- package/dist/implementation/schema.js.map +1 -1
- package/dist/implementation/symbols.js +5 -0
- package/dist/implementation/symbols.js.map +1 -0
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/internal.js +1 -0
- package/dist/internal.js.map +1 -1
- package/dist/tests/coList.test.js +32 -36
- package/dist/tests/coList.test.js.map +1 -1
- package/dist/tests/coMap.test.js +170 -59
- package/dist/tests/coMap.test.js.map +1 -1
- package/dist/tests/coStream.test.js +59 -64
- package/dist/tests/coStream.test.js.map +1 -1
- package/dist/tests/groupsAndAccounts.test.js +88 -0
- package/dist/tests/groupsAndAccounts.test.js.map +1 -0
- package/package.json +5 -4
- package/src/coValues/account.ts +129 -105
- package/src/coValues/coList.ts +200 -131
- package/src/coValues/coMap.ts +243 -305
- package/src/coValues/coStream.ts +300 -127
- package/src/coValues/extensions/imageDef.ts +14 -16
- package/src/coValues/group.ts +90 -106
- package/src/coValues/interfaces.ts +33 -12
- package/src/implementation/refs.ts +42 -25
- package/src/implementation/schema.ts +69 -46
- package/src/implementation/symbols.ts +12 -0
- package/src/index.ts +10 -8
- package/src/internal.ts +1 -0
- package/src/tests/coList.test.ts +35 -39
- package/src/tests/coMap.test.ts +176 -81
- package/src/tests/coStream.test.ts +76 -81
- package/src/tests/groupsAndAccounts.test.ts +100 -0
package/dist/tests/coMap.test.js
CHANGED
@@ -3,7 +3,7 @@ import { webcrypto } from "node:crypto";
|
|
3
3
|
import { connectedPeers } from "cojson/src/streamUtils.js";
|
4
4
|
import { newRandomSessionID } from "cojson/src/coValueCore.js";
|
5
5
|
import { Effect, Queue } from "effect";
|
6
|
-
import { Account, jazzReady, Encoders,
|
6
|
+
import { Account, jazzReady, Encoders, CoMap, co } from "..";
|
7
7
|
if (!("crypto" in globalThis)) {
|
8
8
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
9
9
|
globalThis.crypto = webcrypto;
|
@@ -13,35 +13,37 @@ beforeEach(async () => {
|
|
13
13
|
});
|
14
14
|
describe("Simple CoMap operations", async () => {
|
15
15
|
const me = await Account.create({
|
16
|
-
name: "Hermes Puggington",
|
16
|
+
creationProps: { name: "Hermes Puggington" },
|
17
17
|
});
|
18
18
|
class TestMap extends CoMap {
|
19
|
-
|
19
|
+
constructor() {
|
20
|
+
super(...arguments);
|
21
|
+
this.color = co.string;
|
22
|
+
this._height = co.number;
|
23
|
+
this.birthday = co.encoded(Encoders.Date);
|
24
|
+
this.name = co.string;
|
25
|
+
}
|
26
|
+
get roughColor() {
|
20
27
|
return this.color + "ish";
|
21
28
|
}
|
22
29
|
}
|
23
|
-
TestMap.
|
24
|
-
color: "json",
|
25
|
-
height: "json",
|
26
|
-
birthday: { encoded: Encoders.Date },
|
27
|
-
name: "json",
|
28
|
-
});
|
29
|
-
console.log("TestMap schema", TestMap.prototype._encoding);
|
30
|
+
console.log("TestMap schema", TestMap.prototype._schema);
|
30
31
|
const birthday = new Date();
|
31
|
-
const map =
|
32
|
+
const map = TestMap.create({
|
32
33
|
color: "red",
|
33
|
-
|
34
|
+
_height: 10,
|
34
35
|
birthday: birthday,
|
35
36
|
}, { owner: me });
|
36
37
|
test("Construction", () => {
|
37
38
|
expect(map.color).toEqual("red");
|
38
|
-
expect(map.
|
39
|
-
expect(map.
|
39
|
+
expect(map.roughColor).toEqual("redish");
|
40
|
+
expect(map._height).toEqual(10);
|
40
41
|
expect(map.birthday).toEqual(birthday);
|
41
42
|
expect(map._raw.get("birthday")).toEqual(birthday.toISOString());
|
43
|
+
expect(Object.keys(map)).toEqual(["color", "_height", "birthday"]);
|
42
44
|
});
|
43
45
|
describe("Mutation", () => {
|
44
|
-
test("assignment", () => {
|
46
|
+
test("assignment & deletion", () => {
|
45
47
|
map.color = "blue";
|
46
48
|
expect(map.color).toEqual("blue");
|
47
49
|
expect(map._raw.get("color")).toEqual("blue");
|
@@ -49,28 +51,33 @@ describe("Simple CoMap operations", async () => {
|
|
49
51
|
map.birthday = newBirthday;
|
50
52
|
expect(map.birthday).toEqual(newBirthday);
|
51
53
|
expect(map._raw.get("birthday")).toEqual(newBirthday.toISOString());
|
52
|
-
Object.assign(map, { color: "green",
|
54
|
+
Object.assign(map, { color: "green", _height: 20 });
|
53
55
|
expect(map.color).toEqual("green");
|
54
56
|
expect(map._raw.get("color")).toEqual("green");
|
55
|
-
expect(map.
|
56
|
-
expect(map._raw.get("
|
57
|
+
expect(map._height).toEqual(20);
|
58
|
+
expect(map._raw.get("_height")).toEqual(20);
|
57
59
|
map.name = "Secret name";
|
58
60
|
expect(map.name).toEqual("Secret name");
|
59
61
|
map.name = undefined;
|
60
62
|
expect(map.name).toEqual(undefined);
|
63
|
+
expect(Object.keys(map)).toContain("name");
|
64
|
+
delete map.name;
|
65
|
+
expect(map.name).toEqual(undefined);
|
66
|
+
expect(Object.keys(map)).not.toContain("name");
|
61
67
|
});
|
62
68
|
});
|
63
69
|
class RecursiveMap extends CoMap {
|
70
|
+
constructor() {
|
71
|
+
super(...arguments);
|
72
|
+
this.name = co.string;
|
73
|
+
this.next = co.ref(RecursiveMap);
|
74
|
+
}
|
64
75
|
}
|
65
|
-
RecursiveMap.
|
66
|
-
name: "json",
|
67
|
-
next: { ref: () => RecursiveMap },
|
68
|
-
});
|
69
|
-
const recursiveMap = new RecursiveMap({
|
76
|
+
const recursiveMap = RecursiveMap.create({
|
70
77
|
name: "first",
|
71
|
-
next:
|
78
|
+
next: RecursiveMap.create({
|
72
79
|
name: "second",
|
73
|
-
next:
|
80
|
+
next: RecursiveMap.create({
|
74
81
|
name: "third",
|
75
82
|
}, { owner: me }),
|
76
83
|
}, { owner: me }),
|
@@ -82,42 +89,101 @@ describe("Simple CoMap operations", async () => {
|
|
82
89
|
expect(recursiveMap.next?.next?.name).toEqual("third");
|
83
90
|
});
|
84
91
|
});
|
92
|
+
class MapWithEnumOfMaps extends CoMap {
|
93
|
+
constructor() {
|
94
|
+
super(...arguments);
|
95
|
+
this.name = co.string;
|
96
|
+
this.child = co.ref((raw) => raw.get("type") === "a" ? ChildA : ChildB);
|
97
|
+
}
|
98
|
+
}
|
99
|
+
class ChildA extends CoMap {
|
100
|
+
constructor() {
|
101
|
+
super(...arguments);
|
102
|
+
this.type = co.literal("a");
|
103
|
+
this.value = co.number;
|
104
|
+
}
|
105
|
+
}
|
106
|
+
class ChildB extends CoMap {
|
107
|
+
constructor() {
|
108
|
+
super(...arguments);
|
109
|
+
this.type = co.literal("b");
|
110
|
+
this.value = co.string;
|
111
|
+
}
|
112
|
+
}
|
113
|
+
const mapWithEnum = MapWithEnumOfMaps.create({
|
114
|
+
name: "enum",
|
115
|
+
child: ChildA.create({
|
116
|
+
type: "a",
|
117
|
+
value: 5,
|
118
|
+
}, { owner: me }),
|
119
|
+
}, { owner: me });
|
120
|
+
test("Enum of maps", () => {
|
121
|
+
expect(mapWithEnum.name).toEqual("enum");
|
122
|
+
expect(mapWithEnum.child?.type).toEqual("a");
|
123
|
+
expect(mapWithEnum.child?.value).toEqual(5);
|
124
|
+
expect(mapWithEnum.child?.id).toBeDefined();
|
125
|
+
});
|
126
|
+
class SuperClassMap extends CoMap {
|
127
|
+
constructor() {
|
128
|
+
super(...arguments);
|
129
|
+
this.name = co.string;
|
130
|
+
}
|
131
|
+
}
|
132
|
+
class SubClassMap extends SuperClassMap {
|
133
|
+
constructor() {
|
134
|
+
super(...arguments);
|
135
|
+
this.name = co.literal("specificString");
|
136
|
+
this.value = co.number;
|
137
|
+
this.extra = co.ref(TestMap);
|
138
|
+
}
|
139
|
+
}
|
140
|
+
class GenericMapWithLoose extends CoMap {
|
141
|
+
constructor() {
|
142
|
+
super(...arguments);
|
143
|
+
this.name = co.json();
|
144
|
+
}
|
145
|
+
}
|
146
|
+
const loose = {};
|
85
147
|
});
|
86
148
|
describe("CoMap resolution", async () => {
|
149
|
+
var _a;
|
87
150
|
class TwiceNestedMap extends CoMap {
|
151
|
+
constructor() {
|
152
|
+
super(...arguments);
|
153
|
+
this.taste = co.string;
|
154
|
+
}
|
88
155
|
}
|
89
|
-
TwiceNestedMap.encoding({
|
90
|
-
taste: "json",
|
91
|
-
});
|
92
156
|
class NestedMap extends CoMap {
|
157
|
+
constructor() {
|
158
|
+
super(...arguments);
|
159
|
+
this.name = co.string;
|
160
|
+
this.twiceNested = co.ref(TwiceNestedMap);
|
161
|
+
}
|
93
162
|
get _fancyName() {
|
94
163
|
return "Sir " + this.name;
|
95
164
|
}
|
96
165
|
}
|
97
|
-
NestedMap.encoding({
|
98
|
-
name: "json",
|
99
|
-
twiceNested: { ref: () => TwiceNestedMap },
|
100
|
-
});
|
101
166
|
class TestMap extends CoMap {
|
167
|
+
constructor() {
|
168
|
+
super(...arguments);
|
169
|
+
this.color = co.string;
|
170
|
+
this.height = co.number;
|
171
|
+
this.nested = co.ref(NestedMap);
|
172
|
+
}
|
102
173
|
get _roughColor() {
|
103
174
|
return this.color + "ish";
|
104
175
|
}
|
105
176
|
}
|
106
|
-
TestMap.encoding({
|
107
|
-
color: "json",
|
108
|
-
height: "json",
|
109
|
-
nested: { ref: () => NestedMap },
|
110
|
-
});
|
111
177
|
const initNodeAndMap = async () => {
|
112
178
|
const me = await Account.create({
|
113
|
-
name: "Hermes Puggington",
|
179
|
+
creationProps: { name: "Hermes Puggington" },
|
114
180
|
});
|
115
|
-
const map =
|
181
|
+
const map = TestMap.create({
|
116
182
|
color: "red",
|
117
183
|
height: 10,
|
118
|
-
nested:
|
184
|
+
nested: NestedMap.create({
|
119
185
|
name: "nested",
|
120
|
-
twiceNested:
|
186
|
+
twiceNested: TwiceNestedMap.create({ taste: "sour" }, { owner: me }),
|
121
187
|
}, { owner: me }),
|
122
188
|
}, { owner: me });
|
123
189
|
return { me, map };
|
@@ -159,9 +225,9 @@ describe("CoMap resolution", async () => {
|
|
159
225
|
const loadedTwiceNestedMap = await TwiceNestedMap.load(map.nested.twiceNested.id, { as: meOnSecondPeer });
|
160
226
|
expect(loadedMap?.nested?.twiceNested?.taste).toEqual("sour");
|
161
227
|
expect(loadedMap?.nested?._refs.twiceNested?.value).toEqual(loadedTwiceNestedMap);
|
162
|
-
const otherNestedMap =
|
228
|
+
const otherNestedMap = NestedMap.create({
|
163
229
|
name: "otherNested",
|
164
|
-
twiceNested:
|
230
|
+
twiceNested: TwiceNestedMap.create({ taste: "sweet" }, { owner: meOnSecondPeer }),
|
165
231
|
}, { owner: meOnSecondPeer });
|
166
232
|
loadedMap.nested = otherNestedMap;
|
167
233
|
expect(loadedMap?.nested?.name).toEqual("otherNested");
|
@@ -197,10 +263,10 @@ describe("CoMap resolution", async () => {
|
|
197
263
|
const oldTwiceNested = update3.nested.twiceNested;
|
198
264
|
expect(oldTwiceNested?.taste).toEqual("sour");
|
199
265
|
// When assigning a new nested value, we get an update
|
200
|
-
const newTwiceNested =
|
266
|
+
const newTwiceNested = TwiceNestedMap.create({
|
201
267
|
taste: "sweet",
|
202
268
|
}, { owner: meOnSecondPeer });
|
203
|
-
const newNested =
|
269
|
+
const newNested = NestedMap.create({
|
204
270
|
name: "newNested",
|
205
271
|
twiceNested: newTwiceNested,
|
206
272
|
}, { owner: meOnSecondPeer });
|
@@ -220,25 +286,26 @@ describe("CoMap resolution", async () => {
|
|
220
286
|
}));
|
221
287
|
});
|
222
288
|
class TestMapWithOptionalRef extends CoMap {
|
289
|
+
constructor() {
|
290
|
+
super(...arguments);
|
291
|
+
this.color = co.string;
|
292
|
+
this.nested = co.ref(NestedMap);
|
293
|
+
}
|
223
294
|
}
|
224
|
-
TestMapWithOptionalRef.encoding({
|
225
|
-
color: "json",
|
226
|
-
nested: { ref: () => NestedMap },
|
227
|
-
});
|
228
295
|
test("Construction with optional", async () => {
|
229
296
|
const me = await Account.create({
|
230
|
-
name: "Hermes Puggington",
|
297
|
+
creationProps: { name: "Hermes Puggington" },
|
231
298
|
});
|
232
|
-
const mapWithout =
|
299
|
+
const mapWithout = TestMapWithOptionalRef.create({
|
233
300
|
color: "red",
|
234
301
|
}, { owner: me });
|
235
302
|
expect(mapWithout.color).toEqual("red");
|
236
303
|
expect(mapWithout.nested).toEqual(undefined);
|
237
|
-
const mapWith =
|
304
|
+
const mapWith = TestMapWithOptionalRef.create({
|
238
305
|
color: "red",
|
239
|
-
nested:
|
306
|
+
nested: NestedMap.create({
|
240
307
|
name: "wow!",
|
241
|
-
twiceNested:
|
308
|
+
twiceNested: TwiceNestedMap.create({ taste: "sour" }, { owner: me }),
|
242
309
|
}, { owner: me }),
|
243
310
|
}, { owner: me });
|
244
311
|
expect(mapWith.color).toEqual("red");
|
@@ -247,15 +314,39 @@ describe("CoMap resolution", async () => {
|
|
247
314
|
expect(mapWith.nested?._raw).toBeDefined();
|
248
315
|
});
|
249
316
|
class TestRecord extends CoMap {
|
317
|
+
constructor() {
|
318
|
+
super(...arguments);
|
319
|
+
this[_a] = co.number;
|
320
|
+
}
|
250
321
|
}
|
251
|
-
|
252
|
-
[indexSignature]: "json",
|
253
|
-
});
|
322
|
+
_a = co.items;
|
254
323
|
test("Construction with index signature", async () => {
|
255
324
|
const me = await Account.create({
|
256
|
-
name: "Hermes Puggington",
|
325
|
+
creationProps: { name: "Hermes Puggington" },
|
326
|
+
});
|
327
|
+
const record = TestRecord.create({
|
328
|
+
height: 5,
|
329
|
+
other: 3,
|
330
|
+
}, { owner: me });
|
331
|
+
expect(record.height).toEqual(5);
|
332
|
+
expect(record._raw.get("height")).toEqual(5);
|
333
|
+
expect(record.other).toEqual(3);
|
334
|
+
expect(record._raw.get("other")).toEqual(3);
|
335
|
+
expect(Object.keys(record)).toEqual(["height", "other"]);
|
336
|
+
expect(record.toJSON()).toMatchObject({
|
337
|
+
_type: "CoMap",
|
338
|
+
height: 5,
|
339
|
+
id: expect.any(String),
|
340
|
+
other: 3,
|
341
|
+
});
|
342
|
+
});
|
343
|
+
class TestRecord2 extends CoMap.Record(co.number) {
|
344
|
+
}
|
345
|
+
test("Construction with index signature (shorthand)", async () => {
|
346
|
+
const me = await Account.create({
|
347
|
+
creationProps: { name: "Hermes Puggington" },
|
257
348
|
});
|
258
|
-
const record =
|
349
|
+
const record = TestRecord2.create({
|
259
350
|
height: 5,
|
260
351
|
other: 3,
|
261
352
|
}, { owner: me });
|
@@ -265,5 +356,25 @@ describe("CoMap resolution", async () => {
|
|
265
356
|
expect(record._raw.get("other")).toEqual(3);
|
266
357
|
expect(Object.keys(record)).toEqual(["height", "other"]);
|
267
358
|
});
|
359
|
+
class TestRecordRef extends CoMap.Record(co.ref(TwiceNestedMap)) {
|
360
|
+
}
|
361
|
+
test("Construction with index signature ref", async () => {
|
362
|
+
const me = await Account.create({
|
363
|
+
creationProps: { name: "Hermes Puggington" },
|
364
|
+
});
|
365
|
+
const record = TestRecordRef.create({
|
366
|
+
firstNested: TwiceNestedMap.create({ taste: "sour" }, { owner: me }),
|
367
|
+
secondNested: TwiceNestedMap.create({ taste: "sweet" }, { owner: me }),
|
368
|
+
}, { owner: me });
|
369
|
+
expect(record.firstNested?.taste).toEqual("sour");
|
370
|
+
expect(record.firstNested?.id).toBeDefined();
|
371
|
+
expect(record.secondNested?.taste).toEqual("sweet");
|
372
|
+
expect(record.secondNested?.id).toBeDefined();
|
373
|
+
expect(Object.keys(record)).toEqual(["firstNested", "secondNested"]);
|
374
|
+
expect(Object.keys(record._refs)).toEqual([
|
375
|
+
"firstNested",
|
376
|
+
"secondNested",
|
377
|
+
]);
|
378
|
+
});
|
268
379
|
});
|
269
380
|
//# sourceMappingURL=coMap.test.js.map
|
@@ -1 +1 @@
|
|
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,UAAU,EAAE,MAAM,QAAQ,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzE,IAAI,CAAC,CAAC,QAAQ,IAAI,UAAU,CAAC,EAAE,CAAC;IAC5B,8DAA8D;IAC7D,UAAkB,CAAC,MAAM,GAAG,SAAS,CAAC;AAC3C,CAAC;AAED,UAAU,CAAC,KAAK,IAAI,EAAE;IAClB,MAAM,SAAS,CAAC;AACpB,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;IAC3C,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC;QAC5B,IAAI,EAAE,mBAAmB;KAC5B,CAAC,CAAC;IAEH,MAAM,OAAQ,SAAQ,KAAc;QAMhC,IAAI,WAAW;YACX,OAAO,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAC9B,CAAC;KACJ;IACD,OAAO,CAAC,QAAQ,CAAC;QACb,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;QACd,Q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"node:crypto";
|
|
3
3
|
import { connectedPeers } from "cojson/src/streamUtils.js";
|
4
4
|
import { newRandomSessionID } from "cojson/src/coValueCore.js";
|
5
5
|
import { Effect, Queue } from "effect";
|
6
|
-
import { BinaryCoStream, Account, jazzReady, CoStream } from "..";
|
6
|
+
import { BinaryCoStream, Account, jazzReady, CoStream, co } from "..";
|
7
7
|
if (!("crypto" in globalThis)) {
|
8
8
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
9
9
|
globalThis.crypto = webcrypto;
|
@@ -13,52 +13,48 @@ beforeEach(async () => {
|
|
13
13
|
});
|
14
14
|
describe("Simple CoStream operations", async () => {
|
15
15
|
const me = await Account.create({
|
16
|
-
name: "Hermes Puggington",
|
16
|
+
creationProps: { name: "Hermes Puggington" },
|
17
17
|
});
|
18
|
-
class TestStream extends CoStream {
|
18
|
+
class TestStream extends CoStream.Of(co.string) {
|
19
19
|
}
|
20
|
-
TestStream.
|
21
|
-
const stream = new TestStream(["milk"], { owner: me });
|
20
|
+
const stream = TestStream.create(["milk"], { owner: me });
|
22
21
|
test("Construction", () => {
|
23
|
-
expect(stream
|
24
|
-
expect(stream.
|
22
|
+
expect(stream[me.id]?.value).toEqual("milk");
|
23
|
+
expect(stream.perSession[me.sessionID]?.value).toEqual("milk");
|
25
24
|
});
|
26
25
|
describe("Mutation", () => {
|
27
26
|
test("pushing", () => {
|
28
27
|
stream.push("bread");
|
29
|
-
expect(stream
|
30
|
-
expect(stream.
|
28
|
+
expect(stream[me.id]?.value).toEqual("bread");
|
29
|
+
expect(stream.perSession[me.sessionID]?.value).toEqual("bread");
|
31
30
|
stream.push("butter");
|
32
|
-
expect(stream
|
33
|
-
expect(stream.
|
31
|
+
expect(stream[me.id]?.value).toEqual("butter");
|
32
|
+
expect(stream.perSession[me.sessionID]?.value).toEqual("butter");
|
34
33
|
});
|
35
34
|
});
|
36
35
|
});
|
37
36
|
describe("CoStream resolution", async () => {
|
38
|
-
class TwiceNestedStream extends CoStream {
|
37
|
+
class TwiceNestedStream extends CoStream.Of(co.string) {
|
39
38
|
fancyValueOf(account) {
|
40
|
-
return "Sir " + this
|
39
|
+
return "Sir " + this[account]?.value;
|
41
40
|
}
|
42
41
|
}
|
43
|
-
|
44
|
-
class NestedStream extends CoStream {
|
42
|
+
class NestedStream extends CoStream.Of(co.ref(TwiceNestedStream)) {
|
45
43
|
}
|
46
|
-
|
47
|
-
class TestStream extends CoStream {
|
44
|
+
class TestStream extends CoStream.Of(co.ref(NestedStream)) {
|
48
45
|
}
|
49
|
-
TestStream.encoding({ _item: { ref: () => NestedStream } });
|
50
46
|
const initNodeAndStream = async () => {
|
51
47
|
const me = await Account.create({
|
52
|
-
name: "Hermes Puggington",
|
48
|
+
creationProps: { name: "Hermes Puggington" },
|
53
49
|
});
|
54
|
-
const stream =
|
55
|
-
|
50
|
+
const stream = TestStream.create([
|
51
|
+
NestedStream.create([TwiceNestedStream.create(["milk"], { owner: me })], { owner: me }),
|
56
52
|
], { owner: me });
|
57
53
|
return { me, stream };
|
58
54
|
};
|
59
55
|
test("Construction", async () => {
|
60
56
|
const { me, stream } = await initNodeAndStream();
|
61
|
-
expect(stream
|
57
|
+
expect(stream[me.id]?.value?.[me.id]?.value?.[me.id]?.value).toEqual("milk");
|
62
58
|
});
|
63
59
|
test("Loading and availability", async () => {
|
64
60
|
const { me, stream } = await initNodeAndStream();
|
@@ -73,31 +69,31 @@ describe("CoStream resolution", async () => {
|
|
73
69
|
const loadedStream = await TestStream.load(stream.id, {
|
74
70
|
as: meOnSecondPeer,
|
75
71
|
});
|
76
|
-
expect(loadedStream?.
|
77
|
-
expect(loadedStream?.
|
78
|
-
const loadedNestedStream = await NestedStream.load(stream
|
79
|
-
// expect(loadedStream?.
|
80
|
-
expect(loadedStream?.
|
81
|
-
expect(loadedStream?.
|
82
|
-
// expect(loadedStream?.
|
83
|
-
expect(loadedStream?.
|
84
|
-
expect(loadedStream?.
|
85
|
-
const loadedTwiceNestedStream = await TwiceNestedStream.load(stream
|
86
|
-
// expect(loadedStream?.
|
72
|
+
expect(loadedStream?.[me.id]?.value).toEqual(null);
|
73
|
+
expect(loadedStream?.[me.id]?.ref?.id).toEqual(stream[me.id]?.value?.id);
|
74
|
+
const loadedNestedStream = await NestedStream.load(stream[me.id].value.id, { as: meOnSecondPeer });
|
75
|
+
// expect(loadedStream?.[me.id]?.value).toEqual(loadedNestedStream);
|
76
|
+
expect(loadedStream?.[me.id]?.value?.id).toEqual(loadedNestedStream?.id);
|
77
|
+
expect(loadedStream?.[me.id]?.value?.[me.id]?.value).toEqual(null);
|
78
|
+
// expect(loadedStream?.[me.id]?.ref?.value).toEqual(loadedNestedStream);
|
79
|
+
expect(loadedStream?.[me.id]?.ref?.value?.id).toEqual(loadedNestedStream?.id);
|
80
|
+
expect(loadedStream?.[me.id]?.value?.[me.id]?.ref?.id).toEqual(stream[me.id]?.value?.[me.id]?.value?.id);
|
81
|
+
const loadedTwiceNestedStream = await TwiceNestedStream.load(stream[me.id].value[me.id].value.id, { as: meOnSecondPeer });
|
82
|
+
// expect(loadedStream?.[me.id]?.value?.[me.id]?.value).toEqual(
|
87
83
|
// loadedTwiceNestedStream
|
88
84
|
// );
|
89
|
-
expect(loadedStream?.
|
90
|
-
expect(loadedStream?.
|
91
|
-
// expect(loadedStream?.
|
92
|
-
expect(loadedStream?.
|
93
|
-
expect(loadedStream?.
|
94
|
-
const otherNestedStream =
|
85
|
+
expect(loadedStream?.[me.id]?.value?.[me.id]?.value?.id).toEqual(loadedTwiceNestedStream?.id);
|
86
|
+
expect(loadedStream?.[me.id]?.value?.[me.id]?.value?.fancyValueOf(me.id)).toEqual("Sir milk");
|
87
|
+
// expect(loadedStream?.[me.id]?.ref?.value).toEqual(loadedNestedStream);
|
88
|
+
expect(loadedStream?.[me.id]?.ref?.value?.id).toEqual(loadedNestedStream?.id);
|
89
|
+
expect(loadedStream?.[me.id]?.value?.[me.id]?.ref?.value?.id).toEqual(loadedTwiceNestedStream?.id);
|
90
|
+
const otherNestedStream = NestedStream.create([TwiceNestedStream.create(["butter"], { owner: meOnSecondPeer })], { owner: meOnSecondPeer });
|
95
91
|
loadedStream?.push(otherNestedStream);
|
96
|
-
// expect(loadedStream?.
|
97
|
-
expect(loadedStream?.
|
98
|
-
expect(loadedStream?.
|
99
|
-
expect(loadedStream?.
|
100
|
-
expect(loadedStream?.
|
92
|
+
// expect(loadedStream?.[me.id]?.value).toEqual(otherNestedStream);
|
93
|
+
expect(loadedStream?.[me.id]?.value?.id).toEqual(otherNestedStream?.id);
|
94
|
+
expect(loadedStream?.[me.id]?.ref?.value?.id).toEqual(otherNestedStream?.id);
|
95
|
+
expect(loadedStream?.[me.id]?.value?.[me.id]?.value?.id).toEqual(otherNestedStream[me.id]?.value?.id);
|
96
|
+
expect(loadedStream?.[me.id]?.value?.[me.id]?.value?.fancyValueOf(me.id)).toEqual("Sir butter");
|
101
97
|
});
|
102
98
|
test("Subscription & auto-resolution", async () => {
|
103
99
|
const { me, stream } = await initNodeAndStream();
|
@@ -112,46 +108,45 @@ describe("CoStream resolution", async () => {
|
|
112
108
|
await Effect.runPromise(Effect.gen(function* ($) {
|
113
109
|
const queue = yield* $(Queue.unbounded());
|
114
110
|
TestStream.subscribe(stream.id, { as: meOnSecondPeer }, (subscribedStream) => {
|
115
|
-
console.log("subscribedStream
|
116
|
-
console.log("subscribedStream
|
117
|
-
console.log("subscribedStream
|
118
|
-
?.by[me.id]?.value);
|
111
|
+
console.log("subscribedStream[me.id]", subscribedStream[me.id]);
|
112
|
+
console.log("subscribedStream[me.id]?.value?.[me.id]?.value", subscribedStream[me.id]?.value?.[me.id]?.value);
|
113
|
+
console.log("subscribedStream[me.id]?.value?.[me.id]?.value?.[me.id]?.value", subscribedStream[me.id]?.value?.[me.id]?.value?.[me.id]?.value);
|
119
114
|
Effect.runPromise(Queue.offer(queue, subscribedStream));
|
120
115
|
});
|
121
116
|
const te = stream;
|
122
117
|
const update1 = yield* $(Queue.take(queue));
|
123
|
-
expect(update1
|
118
|
+
expect(update1[me.id]?.value).toEqual(null);
|
124
119
|
const update2 = yield* $(Queue.take(queue));
|
125
|
-
expect(update2
|
126
|
-
expect(update2
|
120
|
+
expect(update2[me.id]?.value).toBeDefined();
|
121
|
+
expect(update2[me.id]?.value?.[me.id]?.value).toBe(null);
|
127
122
|
const update3 = yield* $(Queue.take(queue));
|
128
|
-
expect(update3
|
129
|
-
expect(update3
|
130
|
-
update3
|
123
|
+
expect(update3[me.id]?.value?.[me.id]?.value).toBeDefined();
|
124
|
+
expect(update3[me.id]?.value?.[me.id]?.value?.[me.id]?.value).toBe("milk");
|
125
|
+
update3[me.id].value[me.id].value.push("bread");
|
131
126
|
const update4 = yield* $(Queue.take(queue));
|
132
|
-
expect(update4
|
127
|
+
expect(update4[me.id]?.value?.[me.id]?.value?.[me.id]?.value).toBe("bread");
|
133
128
|
// When assigning a new nested stream, we get an update
|
134
|
-
const newTwiceNested =
|
129
|
+
const newTwiceNested = TwiceNestedStream.create(["butter"], {
|
135
130
|
owner: meOnSecondPeer,
|
136
131
|
});
|
137
|
-
const newNested =
|
132
|
+
const newNested = NestedStream.create([newTwiceNested], {
|
138
133
|
owner: meOnSecondPeer,
|
139
134
|
});
|
140
135
|
update4.push(newNested);
|
141
136
|
const update5 = yield* $(Queue.take(queue));
|
142
|
-
expect(update5
|
137
|
+
expect(update5[me.id]?.value?.[me.id]?.value?.[me.id]?.value).toBe("butter");
|
143
138
|
// we get updates when the new nested stream changes
|
144
139
|
newTwiceNested.push("jam");
|
145
140
|
const update6 = yield* $(Queue.take(queue));
|
146
|
-
expect(update6
|
141
|
+
expect(update6[me.id]?.value?.[me.id]?.value?.[me.id]?.value).toBe("jam");
|
147
142
|
}));
|
148
143
|
});
|
149
144
|
});
|
150
145
|
describe("Simple BinaryCoStream operations", async () => {
|
151
146
|
const me = await Account.create({
|
152
|
-
name: "Hermes Puggington",
|
147
|
+
creationProps: { name: "Hermes Puggington" },
|
153
148
|
});
|
154
|
-
const stream =
|
149
|
+
const stream = BinaryCoStream.create({ owner: me });
|
155
150
|
test("Construction", () => {
|
156
151
|
expect(stream.getChunks()).toBe(undefined);
|
157
152
|
});
|
@@ -172,9 +167,9 @@ describe("Simple BinaryCoStream operations", async () => {
|
|
172
167
|
describe("BinaryCoStream loading & Subscription", async () => {
|
173
168
|
const initNodeAndStream = async () => {
|
174
169
|
const me = await Account.create({
|
175
|
-
name: "Hermes Puggington",
|
170
|
+
creationProps: { name: "Hermes Puggington" },
|
176
171
|
});
|
177
|
-
const stream =
|
172
|
+
const stream = BinaryCoStream.create({ owner: me });
|
178
173
|
stream.start({ mimeType: "text/plain" });
|
179
174
|
stream.push(new Uint8Array([1, 2, 3]));
|
180
175
|
stream.push(new Uint8Array([4, 5, 6]));
|
@@ -210,7 +205,7 @@ describe("BinaryCoStream loading & Subscription", async () => {
|
|
210
205
|
});
|
211
206
|
test("Subscription", async () => {
|
212
207
|
const { me } = await initNodeAndStream();
|
213
|
-
const stream =
|
208
|
+
const stream = BinaryCoStream.create({ owner: me });
|
214
209
|
const [initialAsPeer, secondAsPeer] = connectedPeers("initial", "second", { peer1role: "server", peer2role: "client" });
|
215
210
|
me._raw.core.node.syncManager.addPeer(secondAsPeer);
|
216
211
|
const meOnSecondPeer = await Account.become({
|