jazz-tools 0.7.35-new-auth.0 → 0.7.35
Sign up to get free protection for your applications and to get access to all the features.
- package/.turbo/turbo-build.log +2 -2
- package/.turbo/turbo-test.log +144 -0
- package/CHANGELOG.md +8 -2
- package/dist/coValues/account.js +35 -20
- package/dist/coValues/account.js.map +1 -1
- package/dist/coValues/coList.js +19 -14
- package/dist/coValues/coList.js.map +1 -1
- package/dist/coValues/coMap.js +30 -14
- package/dist/coValues/coMap.js.map +1 -1
- package/dist/coValues/coStream.js +37 -15
- package/dist/coValues/coStream.js.map +1 -1
- package/dist/coValues/extensions/imageDef.js +8 -3
- package/dist/coValues/extensions/imageDef.js.map +1 -1
- package/dist/coValues/group.js +23 -20
- package/dist/coValues/group.js.map +1 -1
- package/dist/implementation/devtoolsFormatters.js +1 -0
- package/dist/implementation/devtoolsFormatters.js.map +1 -1
- package/dist/implementation/refs.js +0 -3
- package/dist/implementation/refs.js.map +1 -1
- package/dist/implementation/schema.js.map +1 -1
- package/dist/implementation/subscriptionScope.js +5 -8
- package/dist/implementation/subscriptionScope.js.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/internal.js +0 -1
- package/dist/internal.js.map +1 -1
- package/dist/tests/coList.test.js +15 -23
- package/dist/tests/coList.test.js.map +1 -1
- package/dist/tests/coMap.test.js +213 -53
- package/dist/tests/coMap.test.js.map +1 -1
- package/dist/tests/coStream.test.js +59 -26
- package/dist/tests/coStream.test.js.map +1 -1
- package/dist/tests/deepLoading.test.js +41 -28
- package/dist/tests/deepLoading.test.js.map +1 -1
- package/dist/tests/groupsAndAccounts.test.js +22 -8
- package/dist/tests/groupsAndAccounts.test.js.map +1 -1
- package/package.json +3 -3
- package/src/coValues/account.ts +28 -5
- package/src/coValues/coList.ts +4 -4
- package/src/coValues/coMap.ts +54 -8
- package/src/coValues/coStream.ts +30 -5
- package/src/coValues/group.ts +2 -2
- package/src/coValues/interfaces.ts +4 -4
- package/src/implementation/devtoolsFormatters.ts +1 -0
- package/src/implementation/schema.ts +1 -0
- package/src/index.ts +1 -8
- package/src/internal.ts +0 -2
- package/src/tests/coList.test.ts +14 -30
- package/src/tests/coMap.test.ts +150 -16
- package/src/tests/coStream.test.ts +74 -27
- package/src/tests/deepLoading.test.ts +18 -22
- package/tsconfig.json +1 -1
- package/dist/implementation/createContext.js +0 -94
- package/dist/implementation/createContext.js.map +0 -1
- package/src/implementation/createContext.ts +0 -162
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"coStream.test.js","sourceRoot":"","sources":["../../src/tests/coStream.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EACH,cAAc,EAEd,OAAO,EACP,QAAQ,EACR,EAAE,EACF,UAAU,EACV,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,GACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC;AAEzC,QAAQ,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;IAC9C,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC;QAC5B,aAAa,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE;QAC5C,MAAM,EAAE,MAAM;KACjB,CAAC,CAAC;IACH,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC,EAAE,CAAC;QAC3B,MAAM,gCAAgC,CAAC;IAC3C,CAAC;IACD,MAAM,UAAW,SAAQ,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC;KAAG;IAElD,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CA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MAAM,CAAC,GAAG,EAAE,CAAC;QAEb,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC;QAE3B,kDAAkD;QAClD,6CAA6C;QAC7C,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
@@ -1,21 +1,30 @@
|
|
1
1
|
const Crypto = await WasmCrypto.create();
|
2
2
|
import { expect, describe, test, expectTypeOf } from "vitest";
|
3
3
|
import { connectedPeers } from "cojson/src/streamUtils.js";
|
4
|
-
import { Account, CoList, CoMap, CoStream, WasmCrypto, co, Profile, isControlledAccount,
|
5
|
-
import {
|
4
|
+
import { Account, CoList, CoMap, CoStream, WasmCrypto, co, Profile, isControlledAccount, } from "../index.js";
|
5
|
+
import { newRandomSessionID } from "cojson/src/coValueCore.js";
|
6
6
|
class TestMap extends CoMap {
|
7
|
-
|
8
|
-
|
7
|
+
constructor() {
|
8
|
+
super(...arguments);
|
9
|
+
this.list = co.ref(TestList);
|
10
|
+
this.optionalRef = co.ref(InnermostMap, { optional: true });
|
11
|
+
}
|
9
12
|
}
|
10
13
|
class TestList extends CoList.Of(co.ref(() => InnerMap)) {
|
11
14
|
}
|
12
15
|
class InnerMap extends CoMap {
|
13
|
-
|
16
|
+
constructor() {
|
17
|
+
super(...arguments);
|
18
|
+
this.stream = co.ref(TestStream);
|
19
|
+
}
|
14
20
|
}
|
15
21
|
class TestStream extends CoStream.Of(co.ref(() => InnermostMap)) {
|
16
22
|
}
|
17
23
|
class InnermostMap extends CoMap {
|
18
|
-
|
24
|
+
constructor() {
|
25
|
+
super(...arguments);
|
26
|
+
this.value = co.string;
|
27
|
+
}
|
19
28
|
}
|
20
29
|
describe("Deep loading with depth arg", async () => {
|
21
30
|
const me = await Account.create({
|
@@ -30,25 +39,25 @@ describe("Deep loading with depth arg", async () => {
|
|
30
39
|
throw "me is not a controlled account";
|
31
40
|
}
|
32
41
|
me._raw.core.node.syncManager.addPeer(secondPeer);
|
33
|
-
const
|
34
|
-
|
35
|
-
|
36
|
-
secret: me._raw.agentSecret,
|
37
|
-
}),
|
38
|
-
sessionProvider: randomSessionProvider,
|
42
|
+
const meOnSecondPeer = await Account.become({
|
43
|
+
accountID: me.id,
|
44
|
+
accountSecret: me._raw.agentSecret,
|
39
45
|
peersToLoadFrom: [initialAsPeer],
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
47
|
+
sessionID: newRandomSessionID(me.id),
|
40
48
|
crypto: Crypto,
|
41
49
|
});
|
42
50
|
test("loading a deeply nested object will wait until all required refs are loaded", async () => {
|
51
|
+
const ownership = { owner: me };
|
43
52
|
const map = TestMap.create({
|
44
53
|
list: TestList.create([
|
45
54
|
InnerMap.create({
|
46
55
|
stream: TestStream.create([
|
47
|
-
InnermostMap.create({ value: "hello" },
|
48
|
-
],
|
49
|
-
},
|
50
|
-
],
|
51
|
-
},
|
56
|
+
InnermostMap.create({ value: "hello" }, ownership),
|
57
|
+
], ownership),
|
58
|
+
}, ownership),
|
59
|
+
], ownership),
|
60
|
+
}, ownership);
|
52
61
|
const map1 = await TestMap.load(map.id, meOnSecondPeer, {});
|
53
62
|
expectTypeOf(map1).toEqualTypeOf();
|
54
63
|
if (map1 === undefined) {
|
@@ -81,8 +90,7 @@ describe("Deep loading with depth arg", async () => {
|
|
81
90
|
throw new Error("map4 is undefined");
|
82
91
|
}
|
83
92
|
expect(map4.list[0]?.stream).not.toBe(null);
|
84
|
-
|
85
|
-
// expect(map4.list[0]?.stream?.[me.id]).toBe(undefined)
|
93
|
+
expect(map4.list[0]?.stream?.[me.id]).not.toBe(null);
|
86
94
|
expect(map4.list[0]?.stream?.byMe?.value).toBe(null);
|
87
95
|
const map5 = await TestMap.load(map.id, meOnSecondPeer, {
|
88
96
|
list: [{ stream: [{}] }],
|
@@ -96,11 +104,17 @@ describe("Deep loading with depth arg", async () => {
|
|
96
104
|
});
|
97
105
|
});
|
98
106
|
class CustomProfile extends Profile {
|
99
|
-
|
107
|
+
constructor() {
|
108
|
+
super(...arguments);
|
109
|
+
this.stream = co.ref(TestStream);
|
110
|
+
}
|
100
111
|
}
|
101
112
|
class CustomAccount extends Account {
|
102
|
-
|
103
|
-
|
113
|
+
constructor() {
|
114
|
+
super(...arguments);
|
115
|
+
this.profile = co.ref(CustomProfile);
|
116
|
+
this.root = co.ref(TestMap);
|
117
|
+
}
|
104
118
|
async migrate(creationProps) {
|
105
119
|
if (creationProps) {
|
106
120
|
this.profile = CustomProfile.create({
|
@@ -147,13 +161,12 @@ test("Deep loading a record-like coMap", async () => {
|
|
147
161
|
throw "me is not a controlled account";
|
148
162
|
}
|
149
163
|
me._raw.core.node.syncManager.addPeer(secondPeer);
|
150
|
-
const
|
151
|
-
|
152
|
-
|
153
|
-
secret: me._raw.agentSecret,
|
154
|
-
}),
|
155
|
-
sessionProvider: randomSessionProvider,
|
164
|
+
const meOnSecondPeer = await Account.become({
|
165
|
+
accountID: me.id,
|
166
|
+
accountSecret: me._raw.agentSecret,
|
156
167
|
peersToLoadFrom: [initialAsPeer],
|
168
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
169
|
+
sessionID: newRandomSessionID(me.id),
|
157
170
|
crypto: Crypto,
|
158
171
|
});
|
159
172
|
const record = RecordLike.create({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"deepLoading.test.js","sourceRoot":"","sources":["../../src/tests/deepLoading.test.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC;AACzC,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,MAAM,EACN,KAAK,EACL,QAAQ,EAER,UAAU,EACV,EAAE,EACF,OAAO,EACP,mBAAmB,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AG,MAAM,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,cAAc,EAAE;QAClE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE;KACjB,CAAC,CAAC;IACH,YAAY,CAAC,YAAY,CAAC,CAAC,aAAa,EAOrC,CAAC;IACJ,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACjD,CAAC;IACD,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACpD,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACxD,CAAC,CAAC,CAAC"}
|
@@ -2,13 +2,20 @@ import { expect, describe, test } from "vitest";
|
|
2
2
|
import { Account, CoMap, co, Group, WasmCrypto } from "../index.js";
|
3
3
|
const Crypto = await WasmCrypto.create();
|
4
4
|
describe("Custom accounts and groups", async () => {
|
5
|
+
var _a;
|
5
6
|
class CustomProfile extends CoMap {
|
6
|
-
|
7
|
-
|
7
|
+
constructor() {
|
8
|
+
super(...arguments);
|
9
|
+
this.name = co.string;
|
10
|
+
this.color = co.string;
|
11
|
+
}
|
8
12
|
}
|
9
13
|
class CustomAccount extends Account {
|
10
|
-
|
11
|
-
|
14
|
+
constructor() {
|
15
|
+
super(...arguments);
|
16
|
+
this.profile = co.ref(CustomProfile);
|
17
|
+
this.root = co.ref(CoMap);
|
18
|
+
}
|
12
19
|
migrate(creationProps) {
|
13
20
|
if (creationProps) {
|
14
21
|
const profileGroup = Group.create({ owner: this });
|
@@ -18,13 +25,17 @@ describe("Custom accounts and groups", async () => {
|
|
18
25
|
}
|
19
26
|
}
|
20
27
|
class CustomGroup extends Group {
|
21
|
-
|
22
|
-
|
23
|
-
|
28
|
+
constructor() {
|
29
|
+
super(...arguments);
|
30
|
+
this.profile = co.null;
|
31
|
+
this.root = co.null;
|
32
|
+
this[_a] = co.ref(CustomAccount);
|
33
|
+
}
|
24
34
|
get nMembers() {
|
25
35
|
return this.members.length;
|
26
36
|
}
|
27
37
|
}
|
38
|
+
_a = co.members;
|
28
39
|
test("Custom account and group", async () => {
|
29
40
|
const me = await CustomAccount.create({
|
30
41
|
creationProps: { name: "Hermes Puggington" },
|
@@ -53,7 +64,10 @@ describe("Custom accounts and groups", async () => {
|
|
53
64
|
});
|
54
65
|
});
|
55
66
|
class MyMap extends CoMap {
|
56
|
-
|
67
|
+
constructor() {
|
68
|
+
super(...arguments);
|
69
|
+
this.name = co.string;
|
70
|
+
}
|
57
71
|
}
|
58
72
|
const map = MyMap.create({ name: "test" }, { owner: group });
|
59
73
|
const meAsCastMember = map._owner
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"groupsAndAccounts.test.js","sourceRoot":"","sources":["../../src/tests/groupsAndAccounts.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEpE,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC;AAEzC,QAAQ,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE
|
1
|
+
{"version":3,"file":"groupsAndAccounts.test.js","sourceRoot":"","sources":["../../src/tests/groupsAndAccounts.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,E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ACP,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
@@ -5,14 +5,14 @@
|
|
5
5
|
"types": "./src/index.ts",
|
6
6
|
"type": "module",
|
7
7
|
"license": "MIT",
|
8
|
-
"version": "0.7.35
|
8
|
+
"version": "0.7.35",
|
9
9
|
"dependencies": {
|
10
10
|
"fast-check": "^3.17.2",
|
11
|
-
"cojson": "0.7.
|
11
|
+
"cojson": "0.7.35"
|
12
12
|
},
|
13
13
|
"devDependencies": {
|
14
14
|
"typescript": "^5.3.3",
|
15
|
-
"vitest": "
|
15
|
+
"vitest": "1.5.3"
|
16
16
|
},
|
17
17
|
"madge": {
|
18
18
|
"detectiveOptions": {
|
package/src/coValues/account.ts
CHANGED
@@ -161,7 +161,6 @@ export class Account extends CoValueBase implements CoValue {
|
|
161
161
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
162
162
|
}
|
163
163
|
|
164
|
-
/** @private */
|
165
164
|
static async create<A extends Account>(
|
166
165
|
this: CoValueClass<A> & typeof Account,
|
167
166
|
options: {
|
@@ -185,6 +184,34 @@ export class Account extends CoValueBase implements CoValue {
|
|
185
184
|
return this.fromNode(node) as A;
|
186
185
|
}
|
187
186
|
|
187
|
+
static async become<A extends Account>(
|
188
|
+
this: CoValueClass<A> & typeof Account,
|
189
|
+
options: {
|
190
|
+
accountID: ID<Account>;
|
191
|
+
accountSecret: AgentSecret;
|
192
|
+
sessionID?: SessionID;
|
193
|
+
peersToLoadFrom: Peer[];
|
194
|
+
crypto: CryptoProvider;
|
195
|
+
},
|
196
|
+
): Promise<A> {
|
197
|
+
const node = await LocalNode.withLoadedAccount({
|
198
|
+
accountID: options.accountID as unknown as CoID<RawAccount>,
|
199
|
+
accountSecret: options.accountSecret,
|
200
|
+
sessionID: options.sessionID,
|
201
|
+
peersToLoadFrom: options.peersToLoadFrom,
|
202
|
+
crypto: options.crypto,
|
203
|
+
migration: async (rawAccount, _node, creationProps) => {
|
204
|
+
const account = new this({
|
205
|
+
fromRaw: rawAccount,
|
206
|
+
}) as A;
|
207
|
+
|
208
|
+
await account.migrate?.(creationProps);
|
209
|
+
},
|
210
|
+
});
|
211
|
+
|
212
|
+
return this.fromNode(node) as A;
|
213
|
+
}
|
214
|
+
|
188
215
|
static async createAs<A extends Account>(
|
189
216
|
this: CoValueClass<A> & typeof Account,
|
190
217
|
as: Account,
|
@@ -356,7 +383,3 @@ export function isControlledAccount(account: Account): account is Account & {
|
|
356
383
|
} {
|
357
384
|
return account.isMe;
|
358
385
|
}
|
359
|
-
|
360
|
-
export type AccountClass<Acc extends Account> = CoValueClass<Acc> & {
|
361
|
-
fromNode: (typeof Account)["fromNode"];
|
362
|
-
};
|
package/src/coValues/coList.ts
CHANGED
@@ -80,16 +80,16 @@ export class CoList<Item = any> extends Array<Item> implements CoValue {
|
|
80
80
|
/**
|
81
81
|
* The ID of this `CoList`
|
82
82
|
* @category Content */
|
83
|
-
|
83
|
+
id!: ID<this>;
|
84
84
|
/** @category Type Helpers */
|
85
|
-
|
85
|
+
_type!: "CoList";
|
86
86
|
static {
|
87
87
|
this.prototype._type = "CoList";
|
88
88
|
}
|
89
89
|
/** @category Internals */
|
90
|
-
|
90
|
+
_raw!: RawCoList;
|
91
91
|
/** @category Internals */
|
92
|
-
|
92
|
+
_instanceID!: string;
|
93
93
|
|
94
94
|
/** @internal This is only a marker type and doesn't exist at runtime */
|
95
95
|
[ItemsSym]!: Item;
|
package/src/coValues/coMap.ts
CHANGED
@@ -10,6 +10,7 @@ import type {
|
|
10
10
|
DepthsIn,
|
11
11
|
DeeplyLoaded,
|
12
12
|
CoValueClass,
|
13
|
+
co,
|
13
14
|
} from "../internal.js";
|
14
15
|
import {
|
15
16
|
Account,
|
@@ -35,8 +36,10 @@ type CoMapEdit<V> = {
|
|
35
36
|
};
|
36
37
|
|
37
38
|
export type Simplify<A> = {
|
38
|
-
[K in keyof A]: A[K]
|
39
|
-
} extends infer B
|
39
|
+
[K in keyof A]: A[K];
|
40
|
+
} extends infer B
|
41
|
+
? B
|
42
|
+
: never;
|
40
43
|
|
41
44
|
/**
|
42
45
|
* CoMaps are collaborative versions of plain objects, mapping string-like keys to values.
|
@@ -494,11 +497,44 @@ export type CoKeys<Map extends object> = Exclude<
|
|
494
497
|
keyof CoMap
|
495
498
|
>;
|
496
499
|
|
500
|
+
/**
|
501
|
+
* Force required ref fields to be non nullable
|
502
|
+
*
|
503
|
+
* Considering that:
|
504
|
+
* - Optional refs are typed as co<InstanceType<CoValueClass> | null | undefined>
|
505
|
+
* - Required refs are typed as co<InstanceType<CoValueClass> | null>
|
506
|
+
*
|
507
|
+
* This type works in two steps:
|
508
|
+
* - Remove the null from both types
|
509
|
+
* - Then we check if the input type accepts undefined, if positive we put the null union back
|
510
|
+
*
|
511
|
+
* So the optional refs stays unchanged while we safely remove the null union
|
512
|
+
* from required refs
|
513
|
+
*
|
514
|
+
* This way required refs can be marked as required in the CoMapInit while
|
515
|
+
* staying a nullable property for value access.
|
516
|
+
*
|
517
|
+
* Example:
|
518
|
+
*
|
519
|
+
* const map = MyCoMap.create({
|
520
|
+
* requiredRef: NestedMap.create({}) // null is not valid here
|
521
|
+
* })
|
522
|
+
*
|
523
|
+
* map.requiredRef // this value is still nullable
|
524
|
+
*/
|
525
|
+
type ForceRequiredRef<V> = V extends co<InstanceType<CoValueClass> | null>
|
526
|
+
? NonNullable<V>
|
527
|
+
: V extends co<InstanceType<CoValueClass> | undefined>
|
528
|
+
? V | null
|
529
|
+
: V;
|
530
|
+
|
497
531
|
export type CoMapInit<Map extends object> = {
|
498
532
|
[Key in CoKeys<Map> as undefined extends Map[Key]
|
499
533
|
? never
|
500
|
-
: IfCo<Map[Key], Key>]: Map[Key]
|
501
|
-
} & {
|
534
|
+
: IfCo<Map[Key], Key>]: ForceRequiredRef<Map[Key]>;
|
535
|
+
} & {
|
536
|
+
[Key in CoKeys<Map> as IfCo<Map[Key], Key>]?: ForceRequiredRef<Map[Key]>;
|
537
|
+
};
|
502
538
|
|
503
539
|
// TODO: cache handlers per descriptor for performance?
|
504
540
|
const CoMapProxyHandler: ProxyHandler<CoMap> = {
|
@@ -554,10 +590,20 @@ const CoMapProxyHandler: ProxyHandler<CoMap> = {
|
|
554
590
|
} else if ("encoded" in descriptor) {
|
555
591
|
target._raw.set(key, descriptor.encoded.encode(value));
|
556
592
|
} else if (isRefEncoded(descriptor)) {
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
593
|
+
if (value === null) {
|
594
|
+
if (descriptor.optional) {
|
595
|
+
target._raw.set(key, null);
|
596
|
+
} else {
|
597
|
+
throw new Error(
|
598
|
+
`Cannot set required reference ${key} to null`,
|
599
|
+
);
|
600
|
+
}
|
601
|
+
} else {
|
602
|
+
target._raw.set(key, value.id);
|
603
|
+
subscriptionsScopes
|
604
|
+
.get(target)
|
605
|
+
?.onRefAccessedOrSet(target.id, value.id);
|
606
|
+
}
|
561
607
|
}
|
562
608
|
return true;
|
563
609
|
} else {
|
package/src/coValues/coStream.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import type {
|
2
|
-
|
2
|
+
AccountID,
|
3
3
|
AgentID,
|
4
4
|
BinaryStreamInfo,
|
5
5
|
CojsonInternalTypes,
|
@@ -228,7 +228,7 @@ export class CoStream<Item = any> extends CoValueBase implements CoValue {
|
|
228
228
|
function entryFromRawEntry<Item>(
|
229
229
|
accessFrom: CoValue,
|
230
230
|
rawEntry: {
|
231
|
-
by:
|
231
|
+
by: AccountID | AgentID;
|
232
232
|
tx: CojsonInternalTypes.TransactionID;
|
233
233
|
at: Date;
|
234
234
|
value: JsonValue;
|
@@ -301,7 +301,7 @@ function entryFromRawEntry<Item>(
|
|
301
301
|
export const CoStreamProxyHandler: ProxyHandler<CoStream> = {
|
302
302
|
get(target, key, receiver) {
|
303
303
|
if (typeof key === "string" && key.startsWith("co_")) {
|
304
|
-
const rawEntry = target._raw.lastItemBy(key as
|
304
|
+
const rawEntry = target._raw.lastItemBy(key as AccountID);
|
305
305
|
|
306
306
|
if (!rawEntry) return;
|
307
307
|
const entry = entryFromRawEntry(
|
@@ -314,7 +314,7 @@ export const CoStreamProxyHandler: ProxyHandler<CoStream> = {
|
|
314
314
|
|
315
315
|
Object.defineProperty(entry, "all", {
|
316
316
|
get: () => {
|
317
|
-
const allRawEntries = target._raw.itemsBy(key as
|
317
|
+
const allRawEntries = target._raw.itemsBy(key as AccountID);
|
318
318
|
return (function* () {
|
319
319
|
while (true) {
|
320
320
|
const rawEntry = allRawEntries.next();
|
@@ -509,6 +509,10 @@ export class BinaryCoStream extends CoValueBase implements CoValue {
|
|
509
509
|
return this._raw.getBinaryChunks(options?.allowUnfinished);
|
510
510
|
}
|
511
511
|
|
512
|
+
isBinaryStreamEnded(): boolean {
|
513
|
+
return this._raw.isBinaryStreamEnded();
|
514
|
+
}
|
515
|
+
|
512
516
|
start(options: BinaryStreamInfo): void {
|
513
517
|
this._raw.startBinaryStream(options);
|
514
518
|
}
|
@@ -540,7 +544,28 @@ export class BinaryCoStream extends CoValueBase implements CoValue {
|
|
540
544
|
allowUnfinished?: boolean;
|
541
545
|
},
|
542
546
|
): Promise<Blob | undefined> {
|
543
|
-
|
547
|
+
let stream = await this.load(id, as, []);
|
548
|
+
|
549
|
+
/**
|
550
|
+
* If the user hasn't requested an incomplete blob and the
|
551
|
+
* stream isn't complete wait for the stream download before progressing
|
552
|
+
*/
|
553
|
+
if (!options?.allowUnfinished && !stream?.isBinaryStreamEnded()) {
|
554
|
+
stream = await new Promise<BinaryCoStream>((resolve) => {
|
555
|
+
const unsubscribe = subscribeToCoValue(
|
556
|
+
this,
|
557
|
+
id,
|
558
|
+
as,
|
559
|
+
[],
|
560
|
+
(value) => {
|
561
|
+
if (value.isBinaryStreamEnded()) {
|
562
|
+
unsubscribe();
|
563
|
+
resolve(value);
|
564
|
+
}
|
565
|
+
},
|
566
|
+
);
|
567
|
+
});
|
568
|
+
}
|
544
569
|
|
545
570
|
return stream?.toBlob({
|
546
571
|
allowUnfinished: options?.allowUnfinished,
|
package/src/coValues/group.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import type {
|
1
|
+
import type { AccountID, Everyone, RawGroup, Role } from "cojson";
|
2
2
|
import type {
|
3
3
|
CoValue,
|
4
4
|
ID,
|
@@ -158,7 +158,7 @@ export class Group extends CoValueBase implements CoValue {
|
|
158
158
|
return key === "everyone" || key.startsWith("co_");
|
159
159
|
})
|
160
160
|
.map((id) => {
|
161
|
-
const role = this._raw.get(id as Everyone |
|
161
|
+
const role = this._raw.get(id as Everyone | AccountID);
|
162
162
|
const accountID =
|
163
163
|
id === "everyone"
|
164
164
|
? undefined
|
@@ -63,11 +63,11 @@ type IDMarker<out T> = { __type(_: never): T };
|
|
63
63
|
|
64
64
|
/** @internal */
|
65
65
|
export class CoValueBase implements CoValue {
|
66
|
-
|
67
|
-
|
68
|
-
|
66
|
+
id!: ID<this>;
|
67
|
+
_type!: string;
|
68
|
+
_raw!: RawCoValue;
|
69
69
|
/** @category Internals */
|
70
|
-
|
70
|
+
_instanceID!: string;
|
71
71
|
|
72
72
|
get _owner(): Account | Group {
|
73
73
|
const owner =
|
@@ -88,6 +88,7 @@ function optionalRef<C extends CoValueClass>(
|
|
88
88
|
|
89
89
|
function ref<C extends CoValueClass>(
|
90
90
|
arg: C | ((_raw: InstanceType<C>["_raw"]) => C),
|
91
|
+
options?: never,
|
91
92
|
): co<InstanceType<C> | null>;
|
92
93
|
function ref<C extends CoValueClass>(
|
93
94
|
arg: C | ((_raw: InstanceType<C>["_raw"]) => C),
|
package/src/index.ts
CHANGED
@@ -21,16 +21,9 @@ export { CoMap, type CoMapInit } from "./internal.js";
|
|
21
21
|
export { CoList } from "./internal.js";
|
22
22
|
export { CoStream, BinaryCoStream } from "./internal.js";
|
23
23
|
export { Group, Profile } from "./internal.js";
|
24
|
-
export { Account, isControlledAccount
|
24
|
+
export { Account, isControlledAccount } from "./internal.js";
|
25
25
|
export { ImageDefinition } from "./internal.js";
|
26
26
|
export { CoValueBase, type CoValueClass } from "./internal.js";
|
27
27
|
export type { DepthsIn, DeeplyLoaded } from "./internal.js";
|
28
28
|
|
29
29
|
export { loadCoValue, subscribeToCoValue } from "./internal.js";
|
30
|
-
|
31
|
-
export {
|
32
|
-
type AuthMethod,
|
33
|
-
type AuthResult,
|
34
|
-
createJazzContext,
|
35
|
-
fixedCredentialsAuth,
|
36
|
-
} from "./internal.js";
|