jazz-tools 0.7.35 → 0.8.0
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-lint.log +1 -1
- package/CHANGELOG.md +23 -1
- package/dist/coValues/account.js +27 -36
- package/dist/coValues/account.js.map +1 -1
- package/dist/coValues/coList.js +19 -21
- package/dist/coValues/coList.js.map +1 -1
- package/dist/coValues/coMap.js +29 -23
- package/dist/coValues/coMap.js.map +1 -1
- package/dist/coValues/coStream.js +26 -21
- package/dist/coValues/coStream.js.map +1 -1
- package/dist/coValues/extensions/imageDef.js +3 -8
- package/dist/coValues/extensions/imageDef.js.map +1 -1
- package/dist/coValues/group.js +20 -23
- package/dist/coValues/group.js.map +1 -1
- package/dist/coValues/interfaces.js +5 -2
- package/dist/coValues/interfaces.js.map +1 -1
- package/dist/implementation/createContext.js +144 -0
- package/dist/implementation/createContext.js.map +1 -0
- package/dist/implementation/refs.js +11 -2
- package/dist/implementation/refs.js.map +1 -1
- package/dist/implementation/subscriptionScope.js +12 -8
- package/dist/implementation/subscriptionScope.js.map +1 -1
- package/dist/index.js +1 -0
- 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 +23 -15
- package/dist/tests/coList.test.js.map +1 -1
- package/dist/tests/coMap.test.js +89 -139
- package/dist/tests/coMap.test.js.map +1 -1
- package/dist/tests/coStream.test.js +26 -22
- package/dist/tests/coStream.test.js.map +1 -1
- package/dist/tests/deepLoading.test.js +21 -34
- package/dist/tests/deepLoading.test.js.map +1 -1
- package/dist/tests/groupsAndAccounts.test.js +8 -22
- package/dist/tests/groupsAndAccounts.test.js.map +1 -1
- package/package.json +3 -3
- package/src/coValues/account.ts +14 -31
- package/src/coValues/coList.ts +9 -5
- package/src/coValues/coMap.ts +40 -9
- package/src/coValues/coStream.ts +16 -7
- package/src/coValues/group.ts +2 -2
- package/src/coValues/interfaces.ts +12 -8
- package/src/implementation/createContext.ts +268 -0
- package/src/implementation/refs.ts +13 -6
- package/src/implementation/subscriptionScope.ts +28 -25
- package/src/index.ts +12 -1
- package/src/internal.ts +2 -0
- package/src/tests/coList.test.ts +30 -14
- package/src/tests/coMap.test.ts +56 -27
- package/src/tests/coStream.test.ts +27 -21
- package/src/tests/deepLoading.test.ts +15 -11
- package/tsconfig.json +1 -1
@@ -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,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EACH,cAAc,EAEd,OAAO,EACP,QAAQ,EACR,EAAE,EACF,UAAU,EACV,mBAAmB,EACnB,eAAe,GAClB,MAAM,aAAa,CAAC;AAErB,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,CAAC;IAE1D,IAAI,CAAC,cAAc,EAAE,GAAG,EAAE;QACtB,MAAM,CAAC,MAAM,CAAC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AI,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,0DAA0D,EAAE,KAAK,IAAI,EAAE;QACxE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,KAAK,EAAE,CAAC;QACrC,MAAM,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAEjC,MAAM,OAAO,GAAG,cAAc,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE;YACrD,eAAe,EAAE,IAAI;SACxB,CAAC,CAAC;QAEH,MAAM,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAE9B,MAAM,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACjC,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,30 +1,21 @@
|
|
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, } from "../index.js";
|
5
|
-
import {
|
4
|
+
import { Account, CoList, CoMap, CoStream, WasmCrypto, co, Profile, isControlledAccount, createJazzContext, fixedCredentialsAuth, } from "../index.js";
|
5
|
+
import { randomSessionProvider } from "../internal.js";
|
6
6
|
class TestMap extends CoMap {
|
7
|
-
|
8
|
-
|
9
|
-
this.list = co.ref(TestList);
|
10
|
-
this.optionalRef = co.ref(InnermostMap, { optional: true });
|
11
|
-
}
|
7
|
+
list = co.ref(TestList);
|
8
|
+
optionalRef = co.ref(InnermostMap, { optional: true });
|
12
9
|
}
|
13
10
|
class TestList extends CoList.Of(co.ref(() => InnerMap)) {
|
14
11
|
}
|
15
12
|
class InnerMap extends CoMap {
|
16
|
-
|
17
|
-
super(...arguments);
|
18
|
-
this.stream = co.ref(TestStream);
|
19
|
-
}
|
13
|
+
stream = co.ref(TestStream);
|
20
14
|
}
|
21
15
|
class TestStream extends CoStream.Of(co.ref(() => InnermostMap)) {
|
22
16
|
}
|
23
17
|
class InnermostMap extends CoMap {
|
24
|
-
|
25
|
-
super(...arguments);
|
26
|
-
this.value = co.string;
|
27
|
-
}
|
18
|
+
value = co.string;
|
28
19
|
}
|
29
20
|
describe("Deep loading with depth arg", async () => {
|
30
21
|
const me = await Account.create({
|
@@ -39,12 +30,13 @@ describe("Deep loading with depth arg", async () => {
|
|
39
30
|
throw "me is not a controlled account";
|
40
31
|
}
|
41
32
|
me._raw.core.node.syncManager.addPeer(secondPeer);
|
42
|
-
const meOnSecondPeer = await
|
43
|
-
|
44
|
-
|
33
|
+
const { account: meOnSecondPeer } = await createJazzContext({
|
34
|
+
auth: fixedCredentialsAuth({
|
35
|
+
accountID: me.id,
|
36
|
+
secret: me._raw.agentSecret,
|
37
|
+
}),
|
38
|
+
sessionProvider: randomSessionProvider,
|
45
39
|
peersToLoadFrom: [initialAsPeer],
|
46
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
47
|
-
sessionID: newRandomSessionID(me.id),
|
48
40
|
crypto: Crypto,
|
49
41
|
});
|
50
42
|
test("loading a deeply nested object will wait until all required refs are loaded", async () => {
|
@@ -104,17 +96,11 @@ describe("Deep loading with depth arg", async () => {
|
|
104
96
|
});
|
105
97
|
});
|
106
98
|
class CustomProfile extends Profile {
|
107
|
-
|
108
|
-
super(...arguments);
|
109
|
-
this.stream = co.ref(TestStream);
|
110
|
-
}
|
99
|
+
stream = co.ref(TestStream);
|
111
100
|
}
|
112
101
|
class CustomAccount extends Account {
|
113
|
-
|
114
|
-
|
115
|
-
this.profile = co.ref(CustomProfile);
|
116
|
-
this.root = co.ref(TestMap);
|
117
|
-
}
|
102
|
+
profile = co.ref(CustomProfile);
|
103
|
+
root = co.ref(TestMap);
|
118
104
|
async migrate(creationProps) {
|
119
105
|
if (creationProps) {
|
120
106
|
this.profile = CustomProfile.create({
|
@@ -161,12 +147,13 @@ test("Deep loading a record-like coMap", async () => {
|
|
161
147
|
throw "me is not a controlled account";
|
162
148
|
}
|
163
149
|
me._raw.core.node.syncManager.addPeer(secondPeer);
|
164
|
-
const meOnSecondPeer = await
|
165
|
-
|
166
|
-
|
150
|
+
const { account: meOnSecondPeer } = await createJazzContext({
|
151
|
+
auth: fixedCredentialsAuth({
|
152
|
+
accountID: me.id,
|
153
|
+
secret: me._raw.agentSecret,
|
154
|
+
}),
|
155
|
+
sessionProvider: randomSessionProvider,
|
167
156
|
peersToLoadFrom: [initialAsPeer],
|
168
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
169
|
-
sessionID: newRandomSessionID(me.id),
|
170
157
|
crypto: Crypto,
|
171
158
|
});
|
172
159
|
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,
|
1
|
+
{"version":3,"file":"deepLoading.test.js","sourceRoot":"","sources":["../../src/tests/deepLoading.test.ts"],"names":[],"mappings":"AAAA,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C;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,20 +2,13 @@ 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;
|
6
5
|
class CustomProfile extends CoMap {
|
7
|
-
|
8
|
-
|
9
|
-
this.name = co.string;
|
10
|
-
this.color = co.string;
|
11
|
-
}
|
6
|
+
name = co.string;
|
7
|
+
color = co.string;
|
12
8
|
}
|
13
9
|
class CustomAccount extends Account {
|
14
|
-
|
15
|
-
|
16
|
-
this.profile = co.ref(CustomProfile);
|
17
|
-
this.root = co.ref(CoMap);
|
18
|
-
}
|
10
|
+
profile = co.ref(CustomProfile);
|
11
|
+
root = co.ref(CoMap);
|
19
12
|
migrate(creationProps) {
|
20
13
|
if (creationProps) {
|
21
14
|
const profileGroup = Group.create({ owner: this });
|
@@ -25,17 +18,13 @@ describe("Custom accounts and groups", async () => {
|
|
25
18
|
}
|
26
19
|
}
|
27
20
|
class CustomGroup extends Group {
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
this.root = co.null;
|
32
|
-
this[_a] = co.ref(CustomAccount);
|
33
|
-
}
|
21
|
+
profile = co.null;
|
22
|
+
root = co.null;
|
23
|
+
[co.members] = co.ref(CustomAccount);
|
34
24
|
get nMembers() {
|
35
25
|
return this.members.length;
|
36
26
|
}
|
37
27
|
}
|
38
|
-
_a = co.members;
|
39
28
|
test("Custom account and group", async () => {
|
40
29
|
const me = await CustomAccount.create({
|
41
30
|
creationProps: { name: "Hermes Puggington" },
|
@@ -64,10 +53,7 @@ describe("Custom accounts and groups", async () => {
|
|
64
53
|
});
|
65
54
|
});
|
66
55
|
class MyMap extends CoMap {
|
67
|
-
|
68
|
-
super(...arguments);
|
69
|
-
this.name = co.string;
|
70
|
-
}
|
56
|
+
name = co.string;
|
71
57
|
}
|
72
58
|
const map = MyMap.create({ name: "test" }, { owner: group });
|
73
59
|
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,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE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encies": {
|
10
|
-
"
|
11
|
-
"
|
10
|
+
"cojson": "0.8.0",
|
11
|
+
"fast-check": "^3.17.2"
|
12
12
|
},
|
13
13
|
"devDependencies": {
|
14
14
|
"typescript": "^5.3.3",
|
package/src/coValues/account.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { LocalNode, cojsonInternals } from "cojson";
|
2
|
-
import
|
2
|
+
import {
|
3
3
|
AgentSecret,
|
4
4
|
CoID,
|
5
5
|
CryptoProvider,
|
@@ -21,6 +21,7 @@ import {
|
|
21
21
|
RefIfCoValue,
|
22
22
|
DeeplyLoaded,
|
23
23
|
DepthsIn,
|
24
|
+
AnonymousJazzAgent,
|
24
25
|
} from "../internal.js";
|
25
26
|
import {
|
26
27
|
Group,
|
@@ -67,8 +68,13 @@ export class Account extends CoValueBase implements CoValue {
|
|
67
68
|
get _owner(): Account {
|
68
69
|
return this as Account;
|
69
70
|
}
|
70
|
-
get _loadedAs(): Account {
|
71
|
-
|
71
|
+
get _loadedAs(): Account | AnonymousJazzAgent {
|
72
|
+
if (this.isMe) return this;
|
73
|
+
|
74
|
+
if (this._raw.core.node.account instanceof RawAccount) {
|
75
|
+
return Account.fromRaw(this._raw.core.node.account);
|
76
|
+
}
|
77
|
+
return new AnonymousJazzAgent(this._raw.core.node);
|
72
78
|
}
|
73
79
|
|
74
80
|
declare profile: Profile | null;
|
@@ -161,6 +167,7 @@ export class Account extends CoValueBase implements CoValue {
|
|
161
167
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
162
168
|
}
|
163
169
|
|
170
|
+
/** @private */
|
164
171
|
static async create<A extends Account>(
|
165
172
|
this: CoValueClass<A> & typeof Account,
|
166
173
|
options: {
|
@@ -184,34 +191,6 @@ export class Account extends CoValueBase implements CoValue {
|
|
184
191
|
return this.fromNode(node) as A;
|
185
192
|
}
|
186
193
|
|
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
|
-
|
215
194
|
static async createAs<A extends Account>(
|
216
195
|
this: CoValueClass<A> & typeof Account,
|
217
196
|
as: Account,
|
@@ -383,3 +362,7 @@ export function isControlledAccount(account: Account): account is Account & {
|
|
383
362
|
} {
|
384
363
|
return account.isMe;
|
385
364
|
}
|
365
|
+
|
366
|
+
export type AccountClass<Acc extends Account> = CoValueClass<Acc> & {
|
367
|
+
fromNode: (typeof Account)["fromNode"];
|
368
|
+
};
|
package/src/coValues/coList.ts
CHANGED
@@ -14,6 +14,7 @@ import type {
|
|
14
14
|
} from "../internal.js";
|
15
15
|
import {
|
16
16
|
Account,
|
17
|
+
AnonymousJazzAgent,
|
17
18
|
Group,
|
18
19
|
ItemsSym,
|
19
20
|
Ref,
|
@@ -80,16 +81,16 @@ export class CoList<Item = any> extends Array<Item> implements CoValue {
|
|
80
81
|
/**
|
81
82
|
* The ID of this `CoList`
|
82
83
|
* @category Content */
|
83
|
-
id
|
84
|
+
declare id: ID<this>;
|
84
85
|
/** @category Type Helpers */
|
85
|
-
_type
|
86
|
+
declare _type: "CoList";
|
86
87
|
static {
|
87
88
|
this.prototype._type = "CoList";
|
88
89
|
}
|
89
90
|
/** @category Internals */
|
90
|
-
_raw
|
91
|
+
declare _raw: RawCoList;
|
91
92
|
/** @category Internals */
|
92
|
-
_instanceID
|
93
|
+
declare _instanceID: string;
|
93
94
|
|
94
95
|
/** @internal This is only a marker type and doesn't exist at runtime */
|
95
96
|
[ItemsSym]!: Item;
|
@@ -163,7 +164,10 @@ export class CoList<Item = any> extends Array<Item> implements CoValue {
|
|
163
164
|
}
|
164
165
|
|
165
166
|
get _loadedAs() {
|
166
|
-
|
167
|
+
if (this._raw.core.node.account instanceof RawAccount) {
|
168
|
+
return Account.fromRaw(this._raw.core.node.account);
|
169
|
+
}
|
170
|
+
return new AnonymousJazzAgent(this._raw.core.node);
|
167
171
|
}
|
168
172
|
|
169
173
|
static get [Symbol.species]() {
|
package/src/coValues/coMap.ts
CHANGED
@@ -1,4 +1,9 @@
|
|
1
|
-
import
|
1
|
+
import {
|
2
|
+
cojsonInternals,
|
3
|
+
type CoValueUniqueness,
|
4
|
+
type JsonValue,
|
5
|
+
type RawCoMap,
|
6
|
+
} from "cojson";
|
2
7
|
import type {
|
3
8
|
CoValue,
|
4
9
|
Schema,
|
@@ -10,6 +15,7 @@ import type {
|
|
10
15
|
DepthsIn,
|
11
16
|
DeeplyLoaded,
|
12
17
|
CoValueClass,
|
18
|
+
AnonymousJazzAgent,
|
13
19
|
co,
|
14
20
|
} from "../internal.js";
|
15
21
|
import {
|
@@ -190,11 +196,6 @@ export class CoMap extends CoValueBase implements CoValue {
|
|
190
196
|
};
|
191
197
|
}
|
192
198
|
|
193
|
-
/** @internal */
|
194
|
-
get _loadedAs() {
|
195
|
-
return Account.fromNode(this._raw.core.node);
|
196
|
-
}
|
197
|
-
|
198
199
|
/** @internal */
|
199
200
|
constructor(
|
200
201
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
@@ -240,10 +241,19 @@ export class CoMap extends CoValueBase implements CoValue {
|
|
240
241
|
static create<M extends CoMap>(
|
241
242
|
this: CoValueClass<M>,
|
242
243
|
init: Simplify<CoMapInit<M>>,
|
243
|
-
options: {
|
244
|
+
options: {
|
245
|
+
owner: Account | Group;
|
246
|
+
unique?: CoValueUniqueness["uniqueness"];
|
247
|
+
},
|
244
248
|
) {
|
245
249
|
const instance = new this();
|
246
|
-
const raw = instance.rawFromInit(
|
250
|
+
const raw = instance.rawFromInit(
|
251
|
+
init,
|
252
|
+
options.owner,
|
253
|
+
options.unique === undefined
|
254
|
+
? undefined
|
255
|
+
: { uniqueness: options.unique },
|
256
|
+
);
|
247
257
|
Object.defineProperties(instance, {
|
248
258
|
id: {
|
249
259
|
value: raw.id,
|
@@ -296,6 +306,7 @@ export class CoMap extends CoValueBase implements CoValue {
|
|
296
306
|
rawFromInit<Fields extends object = Record<string, any>>(
|
297
307
|
init: Simplify<CoMapInit<Fields>> | undefined,
|
298
308
|
owner: Account | Group,
|
309
|
+
uniqueness?: CoValueUniqueness,
|
299
310
|
) {
|
300
311
|
const rawOwner = owner._raw;
|
301
312
|
|
@@ -329,7 +340,7 @@ export class CoMap extends CoValueBase implements CoValue {
|
|
329
340
|
}
|
330
341
|
}
|
331
342
|
|
332
|
-
return rawOwner.createMap(rawInit);
|
343
|
+
return rawOwner.createMap(rawInit, null, "private", uniqueness);
|
333
344
|
}
|
334
345
|
|
335
346
|
/**
|
@@ -429,6 +440,26 @@ export class CoMap extends CoValueBase implements CoValue {
|
|
429
440
|
return subscribeToCoValue<M, Depth>(this, id, as, depth, listener);
|
430
441
|
}
|
431
442
|
|
443
|
+
static findUnique<M extends CoMap>(
|
444
|
+
this: CoValueClass<M>,
|
445
|
+
unique: CoValueUniqueness["uniqueness"],
|
446
|
+
ownerID: ID<Account> | ID<Group>,
|
447
|
+
as: Account | Group | AnonymousJazzAgent,
|
448
|
+
) {
|
449
|
+
const header = {
|
450
|
+
type: "comap" as const,
|
451
|
+
ruleset: {
|
452
|
+
type: "ownedByGroup" as const,
|
453
|
+
group: ownerID,
|
454
|
+
},
|
455
|
+
meta: null,
|
456
|
+
uniqueness: unique,
|
457
|
+
};
|
458
|
+
const crypto =
|
459
|
+
as._type === "Anonymous" ? as.node.crypto : as._raw.core.crypto;
|
460
|
+
return cojsonInternals.idforHeader(header, crypto) as ID<M>;
|
461
|
+
}
|
462
|
+
|
432
463
|
/**
|
433
464
|
* Given an already loaded `CoMap`, ensure that the specified fields are loaded to the specified depth.
|
434
465
|
*
|
package/src/coValues/coStream.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import type {
|
2
|
-
|
2
|
+
RawAccountID,
|
3
3
|
AgentID,
|
4
4
|
BinaryStreamInfo,
|
5
5
|
CojsonInternalTypes,
|
@@ -20,6 +20,7 @@ import type {
|
|
20
20
|
CoValueClass,
|
21
21
|
DeeplyLoaded,
|
22
22
|
DepthsIn,
|
23
|
+
AnonymousJazzAgent,
|
23
24
|
} from "../internal.js";
|
24
25
|
import {
|
25
26
|
ItemsSym,
|
@@ -77,13 +78,21 @@ export class CoStream<Item = any> extends CoValueBase implements CoValue {
|
|
77
78
|
[key: ID<Account>]: CoStreamEntry<Item>;
|
78
79
|
|
79
80
|
get byMe(): CoStreamEntry<Item> | undefined {
|
80
|
-
|
81
|
+
if (this._loadedAs._type === "Account") {
|
82
|
+
return this[this._loadedAs.id];
|
83
|
+
} else {
|
84
|
+
return undefined;
|
85
|
+
}
|
81
86
|
}
|
82
87
|
perSession!: {
|
83
88
|
[key: SessionID]: CoStreamEntry<Item>;
|
84
89
|
};
|
85
90
|
get inCurrentSession(): CoStreamEntry<Item> | undefined {
|
86
|
-
|
91
|
+
if (this._loadedAs._type === "Account") {
|
92
|
+
return this.perSession[this._loadedAs.sessionID!];
|
93
|
+
} else {
|
94
|
+
return undefined;
|
95
|
+
}
|
87
96
|
}
|
88
97
|
|
89
98
|
constructor(
|
@@ -228,12 +237,12 @@ export class CoStream<Item = any> extends CoValueBase implements CoValue {
|
|
228
237
|
function entryFromRawEntry<Item>(
|
229
238
|
accessFrom: CoValue,
|
230
239
|
rawEntry: {
|
231
|
-
by:
|
240
|
+
by: RawAccountID | AgentID;
|
232
241
|
tx: CojsonInternalTypes.TransactionID;
|
233
242
|
at: Date;
|
234
243
|
value: JsonValue;
|
235
244
|
},
|
236
|
-
loadedAs: Account,
|
245
|
+
loadedAs: Account | AnonymousJazzAgent,
|
237
246
|
accountID: ID<Account> | undefined,
|
238
247
|
itemField: Schema,
|
239
248
|
): Omit<CoStreamEntry<Item>, "all"> {
|
@@ -301,7 +310,7 @@ function entryFromRawEntry<Item>(
|
|
301
310
|
export const CoStreamProxyHandler: ProxyHandler<CoStream> = {
|
302
311
|
get(target, key, receiver) {
|
303
312
|
if (typeof key === "string" && key.startsWith("co_")) {
|
304
|
-
const rawEntry = target._raw.lastItemBy(key as
|
313
|
+
const rawEntry = target._raw.lastItemBy(key as RawAccountID);
|
305
314
|
|
306
315
|
if (!rawEntry) return;
|
307
316
|
const entry = entryFromRawEntry(
|
@@ -314,7 +323,7 @@ export const CoStreamProxyHandler: ProxyHandler<CoStream> = {
|
|
314
323
|
|
315
324
|
Object.defineProperty(entry, "all", {
|
316
325
|
get: () => {
|
317
|
-
const allRawEntries = target._raw.itemsBy(key as
|
326
|
+
const allRawEntries = target._raw.itemsBy(key as RawAccountID);
|
318
327
|
return (function* () {
|
319
328
|
while (true) {
|
320
329
|
const rawEntry = allRawEntries.next();
|
package/src/coValues/group.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import type {
|
1
|
+
import type { RawAccountID, 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 | RawAccountID);
|
162
162
|
const accountID =
|
163
163
|
id === "everyone"
|
164
164
|
? undefined
|