jazz-tools 0.7.0-alpha.0 → 0.7.0-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.cjs +8 -1
- package/CHANGELOG.md +8 -0
- package/dist/coValues/account.js +138 -0
- package/dist/coValues/account.js.map +1 -0
- package/dist/coValues/coList.js +196 -0
- package/dist/coValues/coList.js.map +1 -0
- package/dist/coValues/coMap.js +249 -0
- package/dist/coValues/coMap.js.map +1 -0
- package/dist/coValues/coStream.js +189 -0
- package/dist/coValues/coStream.js.map +1 -0
- package/dist/coValues/extensions/imageDef.js +17 -12
- package/dist/coValues/extensions/imageDef.js.map +1 -1
- package/dist/coValues/group.js +96 -0
- package/dist/coValues/group.js.map +1 -0
- package/dist/coValues/interfaces.js +58 -0
- package/dist/coValues/interfaces.js.map +1 -0
- package/dist/implementation/errors.js.map +1 -0
- package/dist/implementation/inspect.js +2 -0
- package/dist/implementation/inspect.js.map +1 -0
- package/dist/{refs.js → implementation/refs.js} +11 -13
- package/dist/implementation/refs.js.map +1 -0
- package/dist/implementation/schema.js +6 -0
- package/dist/implementation/schema.js.map +1 -0
- package/dist/{subscriptionScope.js → implementation/subscriptionScope.js} +1 -1
- package/dist/implementation/subscriptionScope.js.map +1 -0
- package/dist/index.js +23 -27
- package/dist/index.js.map +1 -1
- package/dist/internal.js +13 -0
- package/dist/internal.js.map +1 -0
- package/dist/tests/coList.test.js +26 -22
- package/dist/tests/coList.test.js.map +1 -1
- package/dist/tests/coMap.test.js +91 -43
- package/dist/tests/coMap.test.js.map +1 -1
- package/dist/tests/coStream.test.js +35 -24
- package/dist/tests/coStream.test.js.map +1 -1
- package/package.json +11 -4
- package/src/coValues/account.ts +297 -0
- package/src/coValues/coList.ts +320 -0
- package/src/coValues/coMap.ts +447 -0
- package/src/coValues/coStream.ts +325 -0
- package/src/coValues/extensions/imageDef.ts +24 -16
- package/src/coValues/group.ts +187 -0
- package/src/coValues/interfaces.ts +216 -0
- package/src/implementation/inspect.ts +2 -0
- package/src/{refs.ts → implementation/refs.ts} +21 -32
- package/src/implementation/schema.ts +69 -0
- package/src/{subscriptionScope.ts → implementation/subscriptionScope.ts} +11 -13
- package/src/index.ts +22 -50
- package/src/internal.ts +15 -0
- package/src/tests/coList.test.ts +27 -25
- package/src/tests/coMap.test.ts +125 -50
- package/src/tests/coStream.test.ts +51 -38
- package/dist/coValueInterfaces.js +0 -8
- package/dist/coValueInterfaces.js.map +0 -1
- package/dist/coValues/account/account.js +0 -11
- package/dist/coValues/account/account.js.map +0 -1
- package/dist/coValues/account/accountOf.js +0 -150
- package/dist/coValues/account/accountOf.js.map +0 -1
- package/dist/coValues/account/migration.js +0 -4
- package/dist/coValues/account/migration.js.map +0 -1
- package/dist/coValues/coList/coList.js +0 -2
- package/dist/coValues/coList/coList.js.map +0 -1
- package/dist/coValues/coList/coListOf.js +0 -235
- package/dist/coValues/coList/coListOf.js.map +0 -1
- package/dist/coValues/coList/internalDocs.js +0 -2
- package/dist/coValues/coList/internalDocs.js.map +0 -1
- package/dist/coValues/coMap/coMap.js +0 -2
- package/dist/coValues/coMap/coMap.js.map +0 -1
- package/dist/coValues/coMap/coMapOf.js +0 -262
- package/dist/coValues/coMap/coMapOf.js.map +0 -1
- package/dist/coValues/coMap/internalDocs.js +0 -2
- package/dist/coValues/coMap/internalDocs.js.map +0 -1
- package/dist/coValues/coStream/coStream.js +0 -2
- package/dist/coValues/coStream/coStream.js.map +0 -1
- package/dist/coValues/coStream/coStreamOf.js +0 -244
- package/dist/coValues/coStream/coStreamOf.js.map +0 -1
- package/dist/coValues/construction.js +0 -34
- package/dist/coValues/construction.js.map +0 -1
- package/dist/coValues/group/group.js +0 -2
- package/dist/coValues/group/group.js.map +0 -1
- package/dist/coValues/group/groupOf.js +0 -109
- package/dist/coValues/group/groupOf.js.map +0 -1
- package/dist/coValues/resolution.js +0 -66
- package/dist/coValues/resolution.js.map +0 -1
- package/dist/errors.js.map +0 -1
- package/dist/refs.js.map +0 -1
- package/dist/schemaHelpers.js +0 -14
- package/dist/schemaHelpers.js.map +0 -1
- package/dist/subscriptionScope.js.map +0 -1
- package/dist/tests/types.test.js +0 -33
- package/dist/tests/types.test.js.map +0 -1
- package/src/coValueInterfaces.ts +0 -105
- package/src/coValues/account/account.ts +0 -106
- package/src/coValues/account/accountOf.ts +0 -284
- package/src/coValues/account/migration.ts +0 -12
- package/src/coValues/coList/coList.ts +0 -57
- package/src/coValues/coList/coListOf.ts +0 -377
- package/src/coValues/coList/internalDocs.ts +0 -1
- package/src/coValues/coMap/coMap.ts +0 -110
- package/src/coValues/coMap/coMapOf.ts +0 -451
- package/src/coValues/coMap/internalDocs.ts +0 -1
- package/src/coValues/coStream/coStream.ts +0 -63
- package/src/coValues/coStream/coStreamOf.ts +0 -404
- package/src/coValues/construction.ts +0 -110
- package/src/coValues/group/group.ts +0 -27
- package/src/coValues/group/groupOf.ts +0 -183
- package/src/coValues/resolution.ts +0 -111
- package/src/schemaHelpers.ts +0 -72
- package/src/tests/types.test.ts +0 -37
- /package/dist/{errors.js → implementation/errors.js} +0 -0
- /package/src/{errors.ts → implementation/errors.ts} +0 -0
package/src/tests/coMap.test.ts
CHANGED
@@ -4,7 +4,7 @@ import { webcrypto } from "node:crypto";
|
|
4
4
|
import { connectedPeers } from "cojson/src/streamUtils.js";
|
5
5
|
import { newRandomSessionID } from "cojson/src/coValueCore.js";
|
6
6
|
import { Effect, Queue } from "effect";
|
7
|
-
import { Co,
|
7
|
+
import { Co, Account, jazzReady, Encoders, indexSignature } from "..";
|
8
8
|
|
9
9
|
if (!("crypto" in globalThis)) {
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
@@ -20,17 +20,28 @@ describe("Simple CoMap operations", async () => {
|
|
20
20
|
name: "Hermes Puggington",
|
21
21
|
});
|
22
22
|
|
23
|
-
class TestMap extends Co.
|
24
|
-
color:
|
25
|
-
height:
|
26
|
-
birthday:
|
27
|
-
name
|
28
|
-
|
29
|
-
get
|
23
|
+
class TestMap extends Co.Map<TestMap> {
|
24
|
+
declare color: string;
|
25
|
+
declare height: number;
|
26
|
+
declare birthday: Date;
|
27
|
+
declare name?: string;
|
28
|
+
|
29
|
+
get _roughColor() {
|
30
30
|
return this.color + "ish";
|
31
31
|
}
|
32
|
+
|
33
|
+
static {
|
34
|
+
this.encoding({
|
35
|
+
color: "json",
|
36
|
+
height: "json",
|
37
|
+
birthday: { encoded: Encoders.Date },
|
38
|
+
name: "json",
|
39
|
+
});
|
40
|
+
}
|
32
41
|
}
|
33
42
|
|
43
|
+
console.log("TestMap schema", TestMap.prototype._schema);
|
44
|
+
|
34
45
|
const birthday = new Date();
|
35
46
|
|
36
47
|
const map = new TestMap(
|
@@ -44,7 +55,7 @@ describe("Simple CoMap operations", async () => {
|
|
44
55
|
|
45
56
|
test("Construction", () => {
|
46
57
|
expect(map.color).toEqual("red");
|
47
|
-
expect(map.
|
58
|
+
expect(map._roughColor).toEqual("redish");
|
48
59
|
expect(map.height).toEqual(10);
|
49
60
|
expect(map.birthday).toEqual(birthday);
|
50
61
|
expect(map._raw.get("birthday")).toEqual(birthday.toISOString());
|
@@ -58,9 +69,7 @@ describe("Simple CoMap operations", async () => {
|
|
58
69
|
const newBirthday = new Date();
|
59
70
|
map.birthday = newBirthday;
|
60
71
|
expect(map.birthday).toEqual(newBirthday);
|
61
|
-
expect(map._raw.get("birthday")).toEqual(
|
62
|
-
newBirthday.toISOString()
|
63
|
-
);
|
72
|
+
expect(map._raw.get("birthday")).toEqual(newBirthday.toISOString());
|
64
73
|
|
65
74
|
Object.assign(map, { color: "green", height: 20 });
|
66
75
|
expect(map.color).toEqual("green");
|
@@ -70,32 +79,85 @@ describe("Simple CoMap operations", async () => {
|
|
70
79
|
|
71
80
|
map.name = "Secret name";
|
72
81
|
expect(map.name).toEqual("Secret name");
|
73
|
-
|
82
|
+
map.name = undefined;
|
74
83
|
expect(map.name).toEqual(undefined);
|
75
84
|
});
|
76
85
|
});
|
86
|
+
|
87
|
+
class RecursiveMap extends Co.Map<RecursiveMap> {
|
88
|
+
declare name: string;
|
89
|
+
declare next: RecursiveMap | null;
|
90
|
+
|
91
|
+
static {
|
92
|
+
this.encoding({
|
93
|
+
name: "json",
|
94
|
+
next: { ref: () => RecursiveMap },
|
95
|
+
});
|
96
|
+
}
|
97
|
+
}
|
98
|
+
const recursiveMap = new RecursiveMap(
|
99
|
+
{
|
100
|
+
name: "first",
|
101
|
+
next: new RecursiveMap(
|
102
|
+
{
|
103
|
+
name: "second",
|
104
|
+
next: new RecursiveMap(
|
105
|
+
{
|
106
|
+
name: "third",
|
107
|
+
},
|
108
|
+
{ owner: me }
|
109
|
+
),
|
110
|
+
},
|
111
|
+
{ owner: me }
|
112
|
+
),
|
113
|
+
},
|
114
|
+
{ owner: me }
|
115
|
+
);
|
116
|
+
|
117
|
+
describe("Recursive CoMap", () => {
|
118
|
+
test("Construction", () => {
|
119
|
+
expect(recursiveMap.name).toEqual("first");
|
120
|
+
expect(recursiveMap.next?.name).toEqual("second");
|
121
|
+
expect(recursiveMap.next?.next?.name).toEqual("third");
|
122
|
+
});
|
123
|
+
});
|
77
124
|
});
|
78
125
|
|
79
126
|
describe("CoMap resolution", async () => {
|
80
|
-
class TwiceNestedMap extends Co.
|
81
|
-
taste
|
82
|
-
}
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
127
|
+
class TwiceNestedMap extends Co.Map<TwiceNestedMap> {
|
128
|
+
taste!: string;
|
129
|
+
}
|
130
|
+
TwiceNestedMap.encoding({
|
131
|
+
taste: "json",
|
132
|
+
});
|
133
|
+
|
134
|
+
class NestedMap extends Co.Map<NestedMap> {
|
135
|
+
name!: string;
|
136
|
+
twiceNested!: TwiceNestedMap | null;
|
137
|
+
|
138
|
+
get _fancyName() {
|
89
139
|
return "Sir " + this.name;
|
90
140
|
}
|
91
141
|
}
|
142
|
+
NestedMap.encoding({
|
143
|
+
name: "json",
|
144
|
+
twiceNested: { ref: () => TwiceNestedMap },
|
145
|
+
});
|
146
|
+
|
147
|
+
class TestMap extends Co.Map<TestMap> {
|
148
|
+
declare color: string;
|
149
|
+
declare height: number;
|
150
|
+
declare nested: NestedMap | null;
|
151
|
+
|
152
|
+
static {
|
153
|
+
this.encoding({
|
154
|
+
color: "json",
|
155
|
+
height: "json",
|
156
|
+
nested: { ref: () => NestedMap },
|
157
|
+
});
|
158
|
+
}
|
92
159
|
|
93
|
-
|
94
|
-
color: S.string,
|
95
|
-
height: S.number,
|
96
|
-
nested: NestedMap,
|
97
|
-
}).as<TestMap>() {
|
98
|
-
get roughColor() {
|
160
|
+
get _roughColor() {
|
99
161
|
return this.color + "ish";
|
100
162
|
}
|
101
163
|
}
|
@@ -132,10 +194,10 @@ describe("CoMap resolution", async () => {
|
|
132
194
|
// const test: Schema.Schema.To<typeof NestedMap>
|
133
195
|
|
134
196
|
expect(map.color).toEqual("red");
|
135
|
-
expect(map.
|
197
|
+
expect(map._roughColor).toEqual("redish");
|
136
198
|
expect(map.height).toEqual(10);
|
137
199
|
expect(map.nested?.name).toEqual("nested");
|
138
|
-
expect(map.nested?.
|
200
|
+
expect(map.nested?._fancyName).toEqual("Sir nested");
|
139
201
|
expect(map.nested?.id).toBeDefined();
|
140
202
|
expect(map.nested?.twiceNested?.taste).toEqual("sour");
|
141
203
|
});
|
@@ -159,16 +221,16 @@ describe("CoMap resolution", async () => {
|
|
159
221
|
|
160
222
|
expect(loadedMap?.color).toEqual("red");
|
161
223
|
expect(loadedMap?.height).toEqual(10);
|
162
|
-
expect(loadedMap?.nested).toEqual(
|
224
|
+
expect(loadedMap?.nested).toEqual(null);
|
163
225
|
expect(loadedMap?._refs.nested?.id).toEqual(map.nested?.id);
|
164
|
-
expect(loadedMap?._refs.nested?.value).toEqual(
|
226
|
+
expect(loadedMap?._refs.nested?.value).toEqual(null);
|
165
227
|
|
166
228
|
const loadedNestedMap = await NestedMap.load(map.nested!.id, {
|
167
229
|
as: meOnSecondPeer,
|
168
230
|
});
|
169
231
|
|
170
232
|
expect(loadedMap?.nested?.name).toEqual("nested");
|
171
|
-
expect(loadedMap?.nested
|
233
|
+
expect(loadedMap?.nested?._fancyName).toEqual("Sir nested");
|
172
234
|
expect(loadedMap?._refs.nested?.value).toEqual(loadedNestedMap);
|
173
235
|
expect(loadedMap?.nested?.twiceNested?.taste).toEqual(undefined);
|
174
236
|
|
@@ -236,7 +298,7 @@ describe("CoMap resolution", async () => {
|
|
236
298
|
);
|
237
299
|
|
238
300
|
const update1 = yield* $(Queue.take(queue));
|
239
|
-
expect(update1.nested).toEqual(
|
301
|
+
expect(update1.nested).toEqual(null);
|
240
302
|
|
241
303
|
const update2 = yield* $(Queue.take(queue));
|
242
304
|
expect(update2.nested?.name).toEqual("nested");
|
@@ -287,10 +349,17 @@ describe("CoMap resolution", async () => {
|
|
287
349
|
);
|
288
350
|
});
|
289
351
|
|
290
|
-
class TestMapWithOptionalRef extends Co.
|
291
|
-
color:
|
292
|
-
nested
|
293
|
-
|
352
|
+
class TestMapWithOptionalRef extends Co.Map<TestMapWithOptionalRef> {
|
353
|
+
declare color: string;
|
354
|
+
declare nested?: NestedMap | null;
|
355
|
+
|
356
|
+
static {
|
357
|
+
this.encoding({
|
358
|
+
color: "json",
|
359
|
+
nested: { ref: () => NestedMap },
|
360
|
+
});
|
361
|
+
}
|
362
|
+
}
|
294
363
|
|
295
364
|
test("Construction with optional", async () => {
|
296
365
|
const me = await Account.create({
|
@@ -326,14 +395,20 @@ describe("CoMap resolution", async () => {
|
|
326
395
|
|
327
396
|
expect(mapWith.color).toEqual("red");
|
328
397
|
expect(mapWith.nested?.name).toEqual("wow!");
|
329
|
-
expect(mapWith.nested?.
|
398
|
+
expect(mapWith.nested?._fancyName).toEqual("Sir wow!");
|
330
399
|
expect(mapWith.nested?._raw).toBeDefined();
|
331
400
|
});
|
332
401
|
|
333
|
-
class TestRecord extends Co.
|
334
|
-
|
335
|
-
|
336
|
-
|
402
|
+
class TestRecord extends Co.Map<TestRecord> {
|
403
|
+
declare [indexSignature]: number;
|
404
|
+
|
405
|
+
static {
|
406
|
+
this.encoding({
|
407
|
+
[indexSignature]: "json"
|
408
|
+
});
|
409
|
+
}
|
410
|
+
}
|
411
|
+
interface TestRecord extends Record<string, number> {}
|
337
412
|
|
338
413
|
test("Construction with index signature", async () => {
|
339
414
|
const me = await Account.create({
|
@@ -342,16 +417,16 @@ describe("CoMap resolution", async () => {
|
|
342
417
|
|
343
418
|
const record = new TestRecord(
|
344
419
|
{
|
345
|
-
|
346
|
-
other:
|
420
|
+
height: 5,
|
421
|
+
other: 3,
|
347
422
|
},
|
348
423
|
{ owner: me }
|
349
424
|
);
|
350
425
|
|
351
|
-
expect(record.
|
352
|
-
expect(record._raw.get("
|
353
|
-
expect(record.other).toEqual(
|
354
|
-
expect(record._raw.get("other")).toEqual(
|
355
|
-
expect(Object.keys(record)).toEqual(["
|
426
|
+
expect(record.height).toEqual(5);
|
427
|
+
expect(record._raw.get("height")).toEqual(5);
|
428
|
+
expect(record.other).toEqual(3);
|
429
|
+
expect(record._raw.get("other")).toEqual(3);
|
430
|
+
expect(Object.keys(record)).toEqual(["height", "other"]);
|
356
431
|
});
|
357
432
|
});
|
@@ -4,7 +4,7 @@ import { webcrypto } from "node:crypto";
|
|
4
4
|
import { connectedPeers } from "cojson/src/streamUtils.js";
|
5
5
|
import { newRandomSessionID } from "cojson/src/coValueCore.js";
|
6
6
|
import { Effect, Queue } from "effect";
|
7
|
-
import {
|
7
|
+
import { BinaryCoStream, Co, ID, Account, jazzReady } from "..";
|
8
8
|
import { Simplify } from "effect/Types";
|
9
9
|
|
10
10
|
if (!("crypto" in globalThis)) {
|
@@ -21,7 +21,8 @@ describe("Simple CoStream operations", async () => {
|
|
21
21
|
name: "Hermes Puggington",
|
22
22
|
});
|
23
23
|
|
24
|
-
class TestStream extends Co.
|
24
|
+
class TestStream extends Co.Stream<string> {}
|
25
|
+
TestStream.encoding({ _item: "json" });
|
25
26
|
|
26
27
|
const stream = new TestStream(["milk"], { owner: me });
|
27
28
|
|
@@ -44,19 +45,18 @@ describe("Simple CoStream operations", async () => {
|
|
44
45
|
});
|
45
46
|
|
46
47
|
describe("CoStream resolution", async () => {
|
47
|
-
class TwiceNestedStream extends Co.
|
48
|
-
|
49
|
-
).as<TwiceNestedStream>() {
|
50
|
-
fancyValueOf(account: ID<AnyAccount>) {
|
48
|
+
class TwiceNestedStream extends Co.Stream<string> {
|
49
|
+
fancyValueOf(account: ID<Account>) {
|
51
50
|
return "Sir " + this.by[account]?.value;
|
52
51
|
}
|
53
52
|
}
|
53
|
+
TwiceNestedStream.encoding({ _item: "json" });
|
54
54
|
|
55
|
-
class NestedStream extends Co.
|
56
|
-
|
57
|
-
).as<NestedStream>() {}
|
55
|
+
class NestedStream extends Co.Stream<TwiceNestedStream | null>{}
|
56
|
+
NestedStream.encoding({ _item: {ref: () => TwiceNestedStream} });
|
58
57
|
|
59
|
-
class TestStream extends Co.
|
58
|
+
class TestStream extends Co.Stream<NestedStream | null> {}
|
59
|
+
TestStream.encoding({ _item: {ref: () => NestedStream} });
|
60
60
|
|
61
61
|
const initNodeAndStream = async () => {
|
62
62
|
const me = await Account.create({
|
@@ -102,7 +102,7 @@ describe("CoStream resolution", async () => {
|
|
102
102
|
as: meOnSecondPeer,
|
103
103
|
});
|
104
104
|
|
105
|
-
expect(loadedStream?.by[me.id]?.value).toEqual(
|
105
|
+
expect(loadedStream?.by[me.id]?.value).toEqual(null);
|
106
106
|
expect(loadedStream?.by[me.id]?.ref?.id).toEqual(
|
107
107
|
stream.by[me.id]?.value?.id
|
108
108
|
);
|
@@ -112,11 +112,15 @@ describe("CoStream resolution", async () => {
|
|
112
112
|
{ as: meOnSecondPeer }
|
113
113
|
);
|
114
114
|
|
115
|
-
expect(loadedStream?.by[me.id]?.value).toEqual(loadedNestedStream);
|
116
|
-
expect(loadedStream?.by[me.id]?.value?.
|
117
|
-
|
115
|
+
// expect(loadedStream?.by[me.id]?.value).toEqual(loadedNestedStream);
|
116
|
+
expect(loadedStream?.by[me.id]?.value?.id).toEqual(
|
117
|
+
loadedNestedStream?.id
|
118
|
+
);
|
119
|
+
expect(loadedStream?.by[me.id]?.value?.by[me.id]?.value).toEqual(null);
|
120
|
+
// expect(loadedStream?.by[me.id]?.ref?.value).toEqual(loadedNestedStream);
|
121
|
+
expect(loadedStream?.by[me.id]?.ref?.value?.id).toEqual(
|
122
|
+
loadedNestedStream?.id
|
118
123
|
);
|
119
|
-
expect(loadedStream?.by[me.id]?.ref?.value).toEqual(loadedNestedStream);
|
120
124
|
expect(loadedStream?.by[me.id]?.value?.by[me.id]?.ref?.id).toEqual(
|
121
125
|
stream.by[me.id]?.value?.by[me.id]?.value?.id
|
122
126
|
);
|
@@ -126,15 +130,21 @@ describe("CoStream resolution", async () => {
|
|
126
130
|
{ as: meOnSecondPeer }
|
127
131
|
);
|
128
132
|
|
129
|
-
expect(loadedStream?.by[me.id]?.value?.by[me.id]?.value).toEqual(
|
130
|
-
|
133
|
+
// expect(loadedStream?.by[me.id]?.value?.by[me.id]?.value).toEqual(
|
134
|
+
// loadedTwiceNestedStream
|
135
|
+
// );
|
136
|
+
expect(loadedStream?.by[me.id]?.value?.by[me.id]?.value?.id).toEqual(
|
137
|
+
loadedTwiceNestedStream?.id
|
131
138
|
);
|
132
139
|
expect(
|
133
|
-
loadedStream?.by[me.id]?.value?.by[me.id]?.value?.fancyValueOf(
|
140
|
+
loadedStream?.by[me.id]?.value?.by[me.id]?.value?.fancyValueOf(
|
141
|
+
me.id
|
142
|
+
)
|
134
143
|
).toEqual("Sir milk");
|
135
|
-
expect(loadedStream?.by[me.id]?.ref?.value).toEqual(loadedNestedStream);
|
136
|
-
expect(loadedStream?.by[me.id]?.value?.
|
137
|
-
|
144
|
+
// expect(loadedStream?.by[me.id]?.ref?.value).toEqual(loadedNestedStream);
|
145
|
+
expect(loadedStream?.by[me.id]?.ref?.value?.id).toEqual(loadedNestedStream?.id);
|
146
|
+
expect(loadedStream?.by[me.id]?.value?.by[me.id]?.ref?.value?.id).toEqual(
|
147
|
+
loadedTwiceNestedStream?.id
|
138
148
|
);
|
139
149
|
|
140
150
|
const otherNestedStream = new NestedStream(
|
@@ -142,13 +152,16 @@ describe("CoStream resolution", async () => {
|
|
142
152
|
{ owner: meOnSecondPeer }
|
143
153
|
);
|
144
154
|
loadedStream?.push(otherNestedStream);
|
145
|
-
expect(loadedStream?.by[me.id]?.value).toEqual(otherNestedStream);
|
146
|
-
expect(loadedStream?.by[me.id]?.
|
147
|
-
expect(loadedStream?.by[me.id]?.value?.
|
148
|
-
|
155
|
+
// expect(loadedStream?.by[me.id]?.value).toEqual(otherNestedStream);
|
156
|
+
expect(loadedStream?.by[me.id]?.value?.id).toEqual(otherNestedStream?.id);
|
157
|
+
expect(loadedStream?.by[me.id]?.ref?.value?.id).toEqual(otherNestedStream?.id);
|
158
|
+
expect(loadedStream?.by[me.id]?.value?.by[me.id]?.value?.id).toEqual(
|
159
|
+
otherNestedStream.by[me.id]?.value?.id
|
149
160
|
);
|
150
161
|
expect(
|
151
|
-
loadedStream?.by[me.id]?.value?.by[me.id]?.value?.fancyValueOf(
|
162
|
+
loadedStream?.by[me.id]?.value?.by[me.id]?.value?.fancyValueOf(
|
163
|
+
me.id
|
164
|
+
)
|
152
165
|
).toEqual("Sir butter");
|
153
166
|
});
|
154
167
|
|
@@ -199,16 +212,16 @@ describe("CoStream resolution", async () => {
|
|
199
212
|
const te: T = stream;
|
200
213
|
|
201
214
|
const update1 = yield* $(Queue.take(queue));
|
202
|
-
expect(update1.by[me.id]?.value).toEqual(
|
215
|
+
expect(update1.by[me.id]?.value).toEqual(null);
|
203
216
|
|
204
217
|
const update2 = yield* $(Queue.take(queue));
|
205
218
|
expect(update2.by[me.id]?.value).toBeDefined();
|
206
|
-
expect(
|
207
|
-
update2.by[me.id]?.value?.by[me.id]?.value
|
208
|
-
).toBeUndefined();
|
219
|
+
expect(update2.by[me.id]?.value?.by[me.id]?.value).toBe(null);
|
209
220
|
|
210
221
|
const update3 = yield* $(Queue.take(queue));
|
211
|
-
expect(
|
222
|
+
expect(
|
223
|
+
update3.by[me.id]?.value?.by[me.id]?.value
|
224
|
+
).toBeDefined();
|
212
225
|
expect(
|
213
226
|
update3.by[me.id]?.value?.by[me.id]?.value?.by[me.id]?.value
|
214
227
|
).toBe("milk");
|
@@ -252,10 +265,10 @@ describe("Simple BinaryCoStream operations", async () => {
|
|
252
265
|
name: "Hermes Puggington",
|
253
266
|
});
|
254
267
|
|
255
|
-
const stream = new Co.
|
268
|
+
const stream = new Co.BinaryStream(undefined, { owner: me });
|
256
269
|
|
257
270
|
test("Construction", () => {
|
258
|
-
expect(stream.getChunks()).
|
271
|
+
expect(stream.getChunks()).toBe(undefined);
|
259
272
|
});
|
260
273
|
|
261
274
|
test("Mutation", () => {
|
@@ -280,7 +293,7 @@ describe("BinaryCoStream loading & Subscription", async () => {
|
|
280
293
|
name: "Hermes Puggington",
|
281
294
|
});
|
282
295
|
|
283
|
-
const stream = new Co.
|
296
|
+
const stream = new Co.BinaryStream(undefined, { owner: me });
|
284
297
|
|
285
298
|
stream.start({ mimeType: "text/plain" });
|
286
299
|
stream.push(new Uint8Array([1, 2, 3]));
|
@@ -314,7 +327,7 @@ describe("BinaryCoStream loading & Subscription", async () => {
|
|
314
327
|
sessionID: newRandomSessionID(me.id as any),
|
315
328
|
});
|
316
329
|
|
317
|
-
const loadedStream = await Co.
|
330
|
+
const loadedStream = await Co.BinaryStream.load(stream.id, {
|
318
331
|
as: meOnSecondPeer,
|
319
332
|
});
|
320
333
|
|
@@ -328,7 +341,7 @@ describe("BinaryCoStream loading & Subscription", async () => {
|
|
328
341
|
test("Subscription", async () => {
|
329
342
|
const { me } = await initNodeAndStream();
|
330
343
|
|
331
|
-
const stream = new Co.
|
344
|
+
const stream = new Co.BinaryStream(undefined, { owner: me });
|
332
345
|
|
333
346
|
const [initialAsPeer, secondAsPeer] = connectedPeers(
|
334
347
|
"initial",
|
@@ -349,7 +362,7 @@ describe("BinaryCoStream loading & Subscription", async () => {
|
|
349
362
|
Effect.gen(function* ($) {
|
350
363
|
const queue = yield* $(Queue.unbounded<BinaryCoStream>());
|
351
364
|
|
352
|
-
Co.
|
365
|
+
Co.BinaryStream.subscribe(
|
353
366
|
stream.id,
|
354
367
|
{ as: meOnSecondPeer },
|
355
368
|
(subscribedStream) => {
|
@@ -358,7 +371,7 @@ describe("BinaryCoStream loading & Subscription", async () => {
|
|
358
371
|
);
|
359
372
|
|
360
373
|
const update1 = yield* $(Queue.take(queue));
|
361
|
-
expect(update1.getChunks()).
|
374
|
+
expect(update1.getChunks()).toBe(undefined);
|
362
375
|
|
363
376
|
stream.start({ mimeType: "text/plain" });
|
364
377
|
|
@@ -1,8 +0,0 @@
|
|
1
|
-
export function isCoValueSchema(value) {
|
2
|
-
return value && value.type !== undefined;
|
3
|
-
}
|
4
|
-
export const inspect = Symbol.for("nodejs.util.inspect.custom");
|
5
|
-
export function isCoValue(value) {
|
6
|
-
return value && value._type !== undefined;
|
7
|
-
}
|
8
|
-
//# sourceMappingURL=coValueInterfaces.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"coValueInterfaces.js","sourceRoot":"","sources":["../src/coValueInterfaces.ts"],"names":[],"mappings":"AAoEA,MAAM,UAAU,eAAe,CAAC,KAAU;IACtC,OAAO,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC;AAC7C,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AA2BhE,MAAM,UAAU,SAAS,CAAC,KAAU;IAChC,OAAO,KAAK,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC;AAC9C,CAAC"}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import { Context } from "effect";
|
2
|
-
export function isAccount(value) {
|
3
|
-
return value._type === "Account";
|
4
|
-
}
|
5
|
-
export function isControlledAccount(value) {
|
6
|
-
return isAccount(value) && value.isMe;
|
7
|
-
}
|
8
|
-
export const controlledAccountSym = Symbol("@jazz/controlledAccount");
|
9
|
-
export class ControlledAccountCtx extends Context.Tag("ControlledAccount")() {
|
10
|
-
}
|
11
|
-
//# sourceMappingURL=account.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/coValues/account/account.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AA0BjC,MAAM,UAAU,SAAS,CAAC,KAAc;IACpC,OAAO,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,mBAAmB,CAC/B,KAAc;IAEd,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC;AAC1C,CAAC;AA+CD,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC;AAGtE,MAAM,OAAO,oBAAqB,SAAQ,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAGvE;CAAG"}
|
@@ -1,150 +0,0 @@
|
|
1
|
-
import { LocalNode, RawControlledAccount, } from "cojson";
|
2
|
-
import { inspect, } from "../../coValueInterfaces.js";
|
3
|
-
import { CoMapOf } from "../coMap/coMapOf.js";
|
4
|
-
import { controlledAccountSym, } from "./account.js";
|
5
|
-
import * as S from "@effect/schema/Schema";
|
6
|
-
import { AST, Schema } from "@effect/schema";
|
7
|
-
import { SharedCoValueConstructor } from "../construction.js";
|
8
|
-
import { constructorOfSchemaSym } from "../resolution.js";
|
9
|
-
import { pipeArguments } from "effect/Pipeable";
|
10
|
-
import { ValueRef } from "../../refs.js";
|
11
|
-
export function AccountOf(fields) {
|
12
|
-
class AccountOfProfileAndRoot extends SharedCoValueConstructor {
|
13
|
-
static get ast() {
|
14
|
-
return AST.setAnnotation(Schema.instanceOf(this).ast, constructorOfSchemaSym, this);
|
15
|
-
}
|
16
|
-
static pipe() {
|
17
|
-
// eslint-disable-next-line prefer-rest-params
|
18
|
-
return pipeArguments(this, arguments);
|
19
|
-
}
|
20
|
-
constructor(init, options) {
|
21
|
-
super();
|
22
|
-
if (!("fromRaw" in options)) {
|
23
|
-
throw new Error("Can only construct account from raw or with .create()");
|
24
|
-
}
|
25
|
-
this.isMe =
|
26
|
-
options.fromRaw.id == options.fromRaw.core.node.account.id;
|
27
|
-
const refs = {
|
28
|
-
get profile() {
|
29
|
-
const profileID = options.fromRaw.get("profile");
|
30
|
-
return profileID && new ValueRef(profileID, controlledAccountFromNode(options.fromRaw.core.node), fields.profile);
|
31
|
-
},
|
32
|
-
get root() {
|
33
|
-
const rootID = options.fromRaw.get("root");
|
34
|
-
return rootID && new ValueRef(rootID, controlledAccountFromNode(options.fromRaw.core.node), fields.root);
|
35
|
-
},
|
36
|
-
};
|
37
|
-
Object.defineProperties(this, {
|
38
|
-
id: { value: options.fromRaw.id, enumerable: false },
|
39
|
-
_type: { value: "Account", enumerable: false },
|
40
|
-
_owner: { value: this, enumerable: false },
|
41
|
-
_refs: { value: refs, enumerable: false },
|
42
|
-
_raw: { value: options.fromRaw, enumerable: false },
|
43
|
-
_loadedAs: {
|
44
|
-
get: () => this.isMe
|
45
|
-
? this
|
46
|
-
: controlledAccountFromNode(options.fromRaw.core.node),
|
47
|
-
enumerable: false,
|
48
|
-
},
|
49
|
-
_schema: { value: AccountOfProfileAndRoot, enumerable: false },
|
50
|
-
});
|
51
|
-
if (this.isMe) {
|
52
|
-
this.sessionID =
|
53
|
-
options.fromRaw.core.node.currentSessionID;
|
54
|
-
}
|
55
|
-
}
|
56
|
-
static fromRaw(raw) {
|
57
|
-
return new AccountOfProfileAndRoot(undefined, {
|
58
|
-
fromRaw: raw,
|
59
|
-
});
|
60
|
-
}
|
61
|
-
static async create(options) {
|
62
|
-
const { node } = await LocalNode.withNewlyCreatedAccount({
|
63
|
-
...options,
|
64
|
-
migration: options.migration &&
|
65
|
-
(async (rawAccount) => {
|
66
|
-
const account = new AccountOfProfileAndRoot(undefined, {
|
67
|
-
fromRaw: rawAccount,
|
68
|
-
});
|
69
|
-
await options.migration(account);
|
70
|
-
}),
|
71
|
-
});
|
72
|
-
return new AccountOfProfileAndRoot(undefined, {
|
73
|
-
fromRaw: node.account,
|
74
|
-
});
|
75
|
-
}
|
76
|
-
static async become(options) {
|
77
|
-
const node = await LocalNode.withLoadedAccount({
|
78
|
-
accountID: options.accountID,
|
79
|
-
accountSecret: options.accountSecret,
|
80
|
-
sessionID: options.sessionID,
|
81
|
-
peersToLoadFrom: options.peersToLoadFrom,
|
82
|
-
migration: options.migration &&
|
83
|
-
(async (rawAccount) => {
|
84
|
-
const account = new AccountOfProfileAndRoot(undefined, {
|
85
|
-
fromRaw: rawAccount,
|
86
|
-
});
|
87
|
-
await options.migration(account);
|
88
|
-
}),
|
89
|
-
});
|
90
|
-
return new AccountOfProfileAndRoot(undefined, {
|
91
|
-
fromRaw: node.account,
|
92
|
-
});
|
93
|
-
}
|
94
|
-
async acceptInvite(valueID, inviteSecret, valueSchema) {
|
95
|
-
if (!this.isMe) {
|
96
|
-
throw new Error("Only a controlled account can accept invites");
|
97
|
-
}
|
98
|
-
await this._raw.acceptInvite(valueID, inviteSecret);
|
99
|
-
return valueSchema.load(valueID, { as: this });
|
100
|
-
}
|
101
|
-
get profile() {
|
102
|
-
return this._refs.profile.accessFrom(this);
|
103
|
-
}
|
104
|
-
get root() {
|
105
|
-
return this._refs.root.accessFrom(this);
|
106
|
-
}
|
107
|
-
myRole() {
|
108
|
-
return "admin";
|
109
|
-
}
|
110
|
-
toJSON() {
|
111
|
-
return {
|
112
|
-
profile: this.profile?.toJSON(),
|
113
|
-
root: this.root?.toJSON(),
|
114
|
-
};
|
115
|
-
}
|
116
|
-
[(Schema.TypeId, inspect)]() {
|
117
|
-
return this.toJSON();
|
118
|
-
}
|
119
|
-
static as() {
|
120
|
-
return this;
|
121
|
-
}
|
122
|
-
}
|
123
|
-
AccountOfProfileAndRoot.type = "Account";
|
124
|
-
return AccountOfProfileAndRoot;
|
125
|
-
}
|
126
|
-
export class BaseProfile extends CoMapOf({
|
127
|
-
name: S.string,
|
128
|
-
}).as() {
|
129
|
-
}
|
130
|
-
export class Account extends AccountOf({
|
131
|
-
profile: BaseProfile,
|
132
|
-
root: S.null,
|
133
|
-
}).as() {
|
134
|
-
}
|
135
|
-
const simpleControlledAccounts = new WeakMap();
|
136
|
-
export function controlledAccountFromNode(node) {
|
137
|
-
if (!(node.account instanceof RawControlledAccount)) {
|
138
|
-
throw new Error("Expected a controlled account");
|
139
|
-
}
|
140
|
-
let simpleAccount;
|
141
|
-
if (simpleControlledAccounts.has(node.account)) {
|
142
|
-
simpleAccount = simpleControlledAccounts.get(node.account);
|
143
|
-
}
|
144
|
-
else {
|
145
|
-
simpleAccount = Account.fromRaw(node.account);
|
146
|
-
simpleControlledAccounts.set(node.account, simpleAccount);
|
147
|
-
}
|
148
|
-
return simpleAccount;
|
149
|
-
}
|
150
|
-
//# sourceMappingURL=accountOf.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"accountOf.js","sourceRoot":"","sources":["../../../src/coValues/account/accountOf.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,SAAS,EAIT,oBAAoB,GAEvB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAGH,OAAO,GAEV,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAKH,oBAAoB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,CAAC,MAAM,uBAAuB,CAAC;AAE3C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAA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