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.
Files changed (51) hide show
  1. package/.turbo/turbo-build.log +78 -8
  2. package/CHANGELOG.md +181 -0
  3. package/dist/coValues/account.js +81 -41
  4. package/dist/coValues/account.js.map +1 -1
  5. package/dist/coValues/coList.js +156 -104
  6. package/dist/coValues/coList.js.map +1 -1
  7. package/dist/coValues/coMap.js +182 -163
  8. package/dist/coValues/coMap.js.map +1 -1
  9. package/dist/coValues/coStream.js +202 -71
  10. package/dist/coValues/coStream.js.map +1 -1
  11. package/dist/coValues/extensions/imageDef.js +13 -8
  12. package/dist/coValues/extensions/imageDef.js.map +1 -1
  13. package/dist/coValues/group.js +46 -38
  14. package/dist/coValues/group.js.map +1 -1
  15. package/dist/coValues/interfaces.js +23 -5
  16. package/dist/coValues/interfaces.js.map +1 -1
  17. package/dist/implementation/refs.js +26 -12
  18. package/dist/implementation/refs.js.map +1 -1
  19. package/dist/implementation/schema.js +38 -1
  20. package/dist/implementation/schema.js.map +1 -1
  21. package/dist/implementation/symbols.js +5 -0
  22. package/dist/implementation/symbols.js.map +1 -0
  23. package/dist/index.js +4 -3
  24. package/dist/index.js.map +1 -1
  25. package/dist/internal.js +1 -0
  26. package/dist/internal.js.map +1 -1
  27. package/dist/tests/coList.test.js +32 -36
  28. package/dist/tests/coList.test.js.map +1 -1
  29. package/dist/tests/coMap.test.js +170 -59
  30. package/dist/tests/coMap.test.js.map +1 -1
  31. package/dist/tests/coStream.test.js +59 -64
  32. package/dist/tests/coStream.test.js.map +1 -1
  33. package/dist/tests/groupsAndAccounts.test.js +88 -0
  34. package/dist/tests/groupsAndAccounts.test.js.map +1 -0
  35. package/package.json +5 -4
  36. package/src/coValues/account.ts +129 -105
  37. package/src/coValues/coList.ts +200 -131
  38. package/src/coValues/coMap.ts +243 -305
  39. package/src/coValues/coStream.ts +300 -127
  40. package/src/coValues/extensions/imageDef.ts +14 -16
  41. package/src/coValues/group.ts +90 -106
  42. package/src/coValues/interfaces.ts +33 -12
  43. package/src/implementation/refs.ts +42 -25
  44. package/src/implementation/schema.ts +69 -46
  45. package/src/implementation/symbols.ts +12 -0
  46. package/src/index.ts +10 -8
  47. package/src/internal.ts +1 -0
  48. package/src/tests/coList.test.ts +35 -39
  49. package/src/tests/coMap.test.ts +176 -81
  50. package/src/tests/coStream.test.ts +76 -81
  51. package/src/tests/groupsAndAccounts.test.ts +100 -0
@@ -1,105 +1,82 @@
1
1
  var _a;
2
2
  import { cojsonInternals } from "cojson";
3
- import { Account, CoValueBase, ValueRef, inspect } from "../internal.js";
4
- import { Schema } from "@effect/schema";
3
+ import { ItemsSym, Account, CoValueBase, Ref, inspect, co, InitValues, SchemaInit, isRefEncoded, } from "../internal.js";
4
+ import { encodeSync, decodeSync } from "@effect/schema/Schema";
5
5
  export class CoStream extends CoValueBase {
6
- get _encoding() {
7
- return this.constructor._encoding;
6
+ static Of(item) {
7
+ var _b, _c;
8
+ return _c = class CoStreamOf extends _a {
9
+ constructor() {
10
+ super(...arguments);
11
+ this[_b] = item;
12
+ }
13
+ },
14
+ _b = co.items,
15
+ _c;
16
+ }
17
+ get _schema() {
18
+ return this.constructor._schema;
8
19
  }
9
20
  get byMe() {
10
- return this.by[this._loadedAs.id];
21
+ return this[this._loadedAs.id];
11
22
  }
12
23
  get inCurrentSession() {
13
- return this.in[this._loadedAs.sessionID];
24
+ return this.perSession[this._loadedAs.sessionID];
14
25
  }
15
- constructor(init, options) {
26
+ constructor(options) {
16
27
  super();
17
- this.by = {};
18
- this.in = {};
19
- let raw;
20
28
  if ("fromRaw" in options) {
21
- raw = options.fromRaw;
22
- }
23
- else {
24
- const rawOwner = options.owner._raw;
25
- raw = rawOwner.createStream();
26
- }
27
- Object.defineProperties(this, {
28
- id: {
29
- value: raw.id,
30
- enumerable: false,
31
- },
32
- _raw: { value: raw, enumerable: false },
33
- });
34
- if (init !== undefined) {
35
- for (const item of init) {
36
- this.pushItem(item);
37
- }
38
- }
39
- this.updateEntries();
40
- }
41
- updateEntries() {
42
- for (const accountID of this._raw.accounts()) {
43
- Object.defineProperty(this.by, accountID, {
44
- get: () => {
45
- const rawEntry = this._raw.lastItemBy(accountID);
46
- if (!rawEntry)
47
- return;
48
- return entryFromRawEntry(this, rawEntry, this._loadedAs, accountID, this._encoding._item);
29
+ Object.defineProperties(this, {
30
+ id: {
31
+ value: options.fromRaw.id,
32
+ enumerable: false,
49
33
  },
50
- configurable: true,
51
- enumerable: true,
34
+ _raw: { value: options.fromRaw, enumerable: false },
52
35
  });
53
36
  }
54
- for (const sessionID of this._raw.sessions()) {
55
- Object.defineProperty(this.in, sessionID, {
56
- get: () => {
57
- const rawEntry = this._raw.lastItemIn(sessionID);
58
- if (!rawEntry)
59
- return;
60
- const by = cojsonInternals.accountOrAgentIDfromSessionID(sessionID);
61
- return entryFromRawEntry(this, rawEntry, this._loadedAs, cojsonInternals.isAccountID(by)
62
- ? by
63
- : undefined, this._encoding._item);
64
- },
65
- configurable: true,
66
- enumerable: true,
67
- });
37
+ else {
38
+ this[InitValues] = {
39
+ init: options.init,
40
+ owner: options.owner,
41
+ };
68
42
  }
43
+ return new Proxy(this, CoStreamProxyHandler);
44
+ }
45
+ static create(init, options) {
46
+ return new this({ init, owner: options.owner });
69
47
  }
70
48
  push(...items) {
71
49
  for (const item of items) {
72
50
  this.pushItem(item);
73
51
  }
74
- this.updateEntries();
75
52
  }
76
53
  pushItem(item) {
77
- const itemDescriptor = this._encoding._item;
54
+ const itemDescriptor = this._schema[ItemsSym];
78
55
  if (itemDescriptor === "json") {
79
56
  this._raw.push(item);
80
57
  }
81
58
  else if ("encoded" in itemDescriptor) {
82
- this._raw.push(Schema.encodeSync(itemDescriptor.encoded)(item));
59
+ this._raw.push(encodeSync(itemDescriptor.encoded)(item));
83
60
  }
84
- else if ("ref" in itemDescriptor) {
61
+ else if (isRefEncoded(itemDescriptor)) {
85
62
  this._raw.push(item.id);
86
63
  }
87
64
  }
88
65
  toJSON() {
89
- const itemDescriptor = this._encoding._item;
66
+ const itemDescriptor = this._schema[ItemsSym];
90
67
  const mapper = itemDescriptor === "json"
91
68
  ? (v) => v
92
69
  : "encoded" in itemDescriptor
93
- ? Schema.encodeSync(itemDescriptor.encoded)
70
+ ? encodeSync(itemDescriptor.encoded)
94
71
  : (v) => v && v.id;
95
72
  return {
96
73
  id: this.id,
97
74
  _type: this._type,
98
- by: Object.fromEntries(Object.entries(this.by).map(([account, entry]) => [
75
+ ...Object.fromEntries(Object.entries(this).map(([account, entry]) => [
99
76
  account,
100
77
  mapper(entry.value),
101
78
  ])),
102
- in: Object.fromEntries(Object.entries(this.in).map(([session, entry]) => [
79
+ in: Object.fromEntries(Object.entries(this.perSession).map(([session, entry]) => [
103
80
  session,
104
81
  mapper(entry.value),
105
82
  ])),
@@ -108,9 +85,9 @@ export class CoStream extends CoValueBase {
108
85
  [inspect]() {
109
86
  return this.toJSON();
110
87
  }
111
- static encoding(def) {
112
- this._encoding || (this._encoding = {});
113
- Object.assign(this._encoding, def);
88
+ static schema(def) {
89
+ this._schema || (this._schema = {});
90
+ Object.assign(this._schema, def);
114
91
  }
115
92
  }
116
93
  _a = CoStream;
@@ -124,28 +101,179 @@ function entryFromRawEntry(accessFrom, rawEntry, loadedAs, accountID, itemField)
124
101
  return rawEntry.value;
125
102
  }
126
103
  else if ("encoded" in itemField) {
127
- return Schema.decodeSync(itemField.encoded)(rawEntry.value);
104
+ return decodeSync(itemField.encoded)(rawEntry.value);
128
105
  }
129
- else if ("ref" in itemField) {
106
+ else if (isRefEncoded(itemField)) {
130
107
  return this.ref?.accessFrom(accessFrom);
131
108
  }
109
+ else {
110
+ throw new Error("Invalid item field schema");
111
+ }
132
112
  },
133
113
  get ref() {
134
- if (itemField !== "json" && "ref" in itemField) {
114
+ if (itemField !== "json" && isRefEncoded(itemField)) {
135
115
  const rawId = rawEntry.value;
136
- return new ValueRef(rawId, loadedAs, itemField.ref());
116
+ return new Ref(rawId, loadedAs, itemField);
117
+ }
118
+ else {
119
+ return undefined;
137
120
  }
138
121
  },
139
122
  get by() {
140
123
  return (accountID &&
141
- new ValueRef(accountID, loadedAs, Account)?.accessFrom(accessFrom));
124
+ new Ref(accountID, loadedAs, Account)?.accessFrom(accessFrom));
142
125
  },
143
126
  madeAt: rawEntry.at,
144
127
  tx: rawEntry.tx,
145
128
  };
146
129
  }
130
+ function init(stream) {
131
+ const init = stream[InitValues];
132
+ if (!init)
133
+ return;
134
+ const raw = init.owner._raw.createStream();
135
+ Object.defineProperties(stream, {
136
+ id: {
137
+ value: raw.id,
138
+ enumerable: false,
139
+ },
140
+ _raw: { value: raw, enumerable: false },
141
+ });
142
+ if (init.init) {
143
+ stream.push(...init.init);
144
+ }
145
+ delete stream[InitValues];
146
+ }
147
+ export const CoStreamProxyHandler = {
148
+ get(target, key, receiver) {
149
+ if (typeof key === "string" && key.startsWith("co_")) {
150
+ const rawEntry = target._raw.lastItemBy(key);
151
+ if (!rawEntry)
152
+ return;
153
+ const entry = entryFromRawEntry(receiver, rawEntry, target._loadedAs, key, target._schema[ItemsSym]);
154
+ Object.defineProperty(entry, "all", {
155
+ get: () => {
156
+ const allRawEntries = target._raw.itemsBy(key);
157
+ return (function* () {
158
+ while (true) {
159
+ const rawEntry = allRawEntries.next();
160
+ if (rawEntry.done)
161
+ return;
162
+ yield entryFromRawEntry(receiver, rawEntry.value, target._loadedAs, key, target._schema[ItemsSym]);
163
+ }
164
+ })();
165
+ },
166
+ });
167
+ return entry;
168
+ }
169
+ else if (key === "perSession") {
170
+ return new Proxy({}, CoStreamPerSessionProxyHandler(target, receiver));
171
+ }
172
+ else {
173
+ return Reflect.get(target, key, receiver);
174
+ }
175
+ },
176
+ set(target, key, value, receiver) {
177
+ var _b;
178
+ if (key === ItemsSym &&
179
+ typeof value === "object" &&
180
+ SchemaInit in value) {
181
+ (_b = target.constructor)._schema || (_b._schema = {});
182
+ target.constructor._schema[ItemsSym] =
183
+ value[SchemaInit];
184
+ init(target);
185
+ return true;
186
+ }
187
+ else {
188
+ return Reflect.set(target, key, value, receiver);
189
+ }
190
+ },
191
+ defineProperty(target, key, descriptor) {
192
+ var _b;
193
+ if (descriptor.value &&
194
+ key === ItemsSym &&
195
+ typeof descriptor.value === "object" &&
196
+ SchemaInit in descriptor.value) {
197
+ (_b = target.constructor)._schema || (_b._schema = {});
198
+ target.constructor._schema[ItemsSym] =
199
+ descriptor.value[SchemaInit];
200
+ init(target);
201
+ return true;
202
+ }
203
+ else {
204
+ return Reflect.defineProperty(target, key, descriptor);
205
+ }
206
+ },
207
+ ownKeys(target) {
208
+ const keys = Reflect.ownKeys(target);
209
+ for (const accountID of target._raw.accounts()) {
210
+ keys.push(accountID);
211
+ }
212
+ return keys;
213
+ },
214
+ getOwnPropertyDescriptor(target, key) {
215
+ if (typeof key === "string" && key.startsWith("co_")) {
216
+ return {
217
+ configurable: true,
218
+ enumerable: true,
219
+ writable: false,
220
+ };
221
+ }
222
+ else {
223
+ return Reflect.getOwnPropertyDescriptor(target, key);
224
+ }
225
+ },
226
+ };
227
+ const CoStreamPerSessionProxyHandler = (innerTarget, accessFrom) => ({
228
+ get(_target, key, receiver) {
229
+ if (typeof key === "string" && key.includes("session")) {
230
+ const sessionID = key;
231
+ const rawEntry = innerTarget._raw.lastItemIn(sessionID);
232
+ if (!rawEntry)
233
+ return;
234
+ const by = cojsonInternals.accountOrAgentIDfromSessionID(sessionID);
235
+ const entry = entryFromRawEntry(accessFrom, rawEntry, innerTarget._loadedAs, cojsonInternals.isAccountID(by)
236
+ ? by
237
+ : undefined, innerTarget._schema[ItemsSym]);
238
+ Object.defineProperty(entry, "all", {
239
+ get: () => {
240
+ const allRawEntries = innerTarget._raw.itemsIn(sessionID);
241
+ return (function* () {
242
+ while (true) {
243
+ const rawEntry = allRawEntries.next();
244
+ if (rawEntry.done)
245
+ return;
246
+ yield entryFromRawEntry(accessFrom, rawEntry.value, innerTarget._loadedAs, cojsonInternals.isAccountID(by)
247
+ ? by
248
+ : undefined, innerTarget._schema[ItemsSym]);
249
+ }
250
+ })();
251
+ },
252
+ });
253
+ return entry;
254
+ }
255
+ else {
256
+ return Reflect.get(innerTarget, key, receiver);
257
+ }
258
+ },
259
+ ownKeys() {
260
+ return innerTarget._raw.sessions();
261
+ },
262
+ getOwnPropertyDescriptor(target, key) {
263
+ if (typeof key === "string" && key.startsWith("co_")) {
264
+ return {
265
+ configurable: true,
266
+ enumerable: true,
267
+ writable: false,
268
+ };
269
+ }
270
+ else {
271
+ return Reflect.getOwnPropertyDescriptor(target, key);
272
+ }
273
+ },
274
+ });
147
275
  export class BinaryCoStream extends CoValueBase {
148
- constructor(init, options) {
276
+ constructor(options) {
149
277
  super();
150
278
  let raw;
151
279
  if ("fromRaw" in options) {
@@ -163,6 +291,9 @@ export class BinaryCoStream extends CoValueBase {
163
291
  _raw: { value: raw, enumerable: false },
164
292
  });
165
293
  }
294
+ static create(options) {
295
+ return new this(options);
296
+ }
166
297
  getChunks(options) {
167
298
  return this._raw.getBinaryChunks(options?.allowUnfinished);
168
299
  }
@@ -1 +1 @@
1
- {"version":3,"file":"coStream.js","sourceRoot":"","sources":["../../src/coValues/coStream.ts"],"names":[],"mappings":";AAUA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAUzC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAYxC,MAAM,OAAO,QACT,SAAQ,WAAW;IAanB,IAAI,SAAS;QAGT,OAAQ,IAAI,CAAC,WAA+B,CAAC,SAAS,CAAC;IAC3D,CAAC;IAKD,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACtC,CAAC;IAID,IAAI,gBAAgB;QAChB,OAAO,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAA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C;IAED,GAAG;QACC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;IAChC,CAAC;IAED,MAAM;QACF,OAAO;YACH,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,GAAG,IAAI,CAAC,SAAS,EAAE;SACtB,CAAC;IACN,CAAC;IAED,CAAC,OAAO,CAAC;QACL,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACzB,CAAC;CACJ"}
@@ -1,10 +1,19 @@
1
- import { BinaryCoStream, CoMap, indexSignature, subscriptionsScopes, } from "../../internal.js";
1
+ var _a;
2
+ import { BinaryCoStream, CoMap, co, subscriptionsScopes, } from "../../internal.js";
2
3
  export class ImageDefinition extends CoMap {
3
- get _highestResAvailable() {
4
+ constructor() {
5
+ super(...arguments);
6
+ this.originalSize = co.json();
7
+ this.placeholderDataURL = co.string;
8
+ this[_a] = co.ref(BinaryCoStream);
9
+ }
10
+ highestResAvailable(options) {
4
11
  if (!subscriptionsScopes.get(this)) {
5
12
  console.warn("highestResAvailable() only makes sense when used within a subscription.");
6
13
  }
7
- const resolutions = Object.keys(this).filter((key) => key.match(/^\d+x\d+$/));
14
+ const resolutions = Object.keys(this).filter((key) => key.match(/^\d+x\d+$/) &&
15
+ (!options?.maxWidth ||
16
+ Number(key.split("x")[0]) <= options.maxWidth));
8
17
  resolutions.sort((a, b) => {
9
18
  const aWidth = Number(a.split("x")[0]);
10
19
  const bWidth = Number(b.split("x")[0]);
@@ -28,9 +37,5 @@ export class ImageDefinition extends CoMap {
28
37
  });
29
38
  }
30
39
  }
31
- ImageDefinition.encoding({
32
- originalSize: "json",
33
- placeholderDataURL: "json",
34
- [indexSignature]: { ref: () => BinaryCoStream },
35
- });
40
+ _a = co.items;
36
41
  //# sourceMappingURL=imageDef.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"imageDef.js","sourceRoot":"","sources":["../../../src/coValues/extensions/imageDef.ts"],"names":[],"mappings":"AAAA,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AAC,CAAC;YACvC,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACvC,OAAO,MAAM,GAAG,MAAM,CAAC;QAC3B,CAAC,CAAC,CAAC;QAEH,IAAI,0BAA6D,CAAC;QAElE,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACnC,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC;gBACpD,0BAA0B,GAAG,UAAU,CAAC;YAC5C,CAAC;iBAAM,CAAC;gBACJ,OAAO,CACH,0BAA0B,IAAI;oBAC1B,GAAG,EAAE,0BAA0B;oBAC/B,MAAM,EAAE,IAAI,CAAC,0BAA0B,CAAE;iBAC5C,CACJ,CAAC;YACN,CAAC;QACL,CAAC;QACD,OAAO,CACH,0BAA0B,IAAI;YAC1B,GAAG,EAAE,0BAA0B;YAC/B,MAAM,EAAE,IAAI,CAAC,0BAA0B,CAAE;SAC5C,CACJ,CAAC;IACN,CAAC;CACJ;KA9CI,EAAE,CAAC,KAAK"}
@@ -1,30 +1,34 @@
1
1
  var _a;
2
- import { Account, CoMap, CoValueBase, ValueRef, isControlledAccount, } from "../internal.js";
2
+ import { Account, CoMap, CoValueBase, Ref, co, isControlledAccount, AccountAndGroupProxyHandler, MembersSym, } from "../internal.js";
3
3
  export class Profile extends CoMap {
4
+ constructor() {
5
+ super(...arguments);
6
+ this.name = co.string;
7
+ }
4
8
  }
5
- Profile.encoding({ name: "json" });
6
9
  export class Group extends CoValueBase {
7
- get _encoding() {
8
- return this.constructor._encoding;
10
+ get _schema() {
11
+ return this.constructor._schema;
9
12
  }
10
13
  get _refs() {
11
14
  const profileID = this._raw.get("profile");
12
15
  const rootID = this._raw.get("root");
13
16
  return {
14
17
  profile: profileID &&
15
- new ValueRef(profileID, this._loadedAs, this._encoding.profile.ref()),
18
+ new Ref(profileID, this._loadedAs, this._schema.profile),
16
19
  root: rootID &&
17
- new ValueRef(rootID, this._loadedAs, this._encoding.root.ref()),
20
+ new Ref(rootID, this._loadedAs, this._schema.root),
18
21
  };
19
22
  }
20
- constructor(init, options) {
23
+ /** @deprecated Don't use constructor directly, use .create */
24
+ constructor(options) {
21
25
  super();
22
26
  let raw;
23
27
  if (options && "fromRaw" in options) {
24
28
  raw = options.fromRaw;
25
29
  }
26
30
  else {
27
- const initOwner = options?.owner || init?.owner;
31
+ const initOwner = options.owner;
28
32
  if (!initOwner)
29
33
  throw new Error("No owner provided");
30
34
  if (initOwner instanceof Account &&
@@ -42,39 +46,42 @@ export class Group extends CoValueBase {
42
46
  enumerable: false,
43
47
  },
44
48
  _raw: { value: raw, enumerable: false },
45
- profile: {
46
- get: () => {
47
- const ref = this._refs.profile;
48
- return ref ? ref.accessFrom(this) : undefined;
49
- },
50
- set: (value) => {
51
- if (value) {
52
- this._raw.set("profile", value.id);
53
- }
54
- },
55
- },
56
- root: {
57
- get: () => {
58
- const ref = this._refs.root;
59
- return ref ? ref.accessFrom(this) : undefined;
60
- },
61
- set: (value) => {
62
- if (value) {
63
- this._raw.set("root", value.id);
64
- }
65
- },
66
- },
67
49
  });
50
+ return new Proxy(this, AccountAndGroupProxyHandler);
51
+ }
52
+ static create(options) {
53
+ return new this(options);
68
54
  }
69
55
  myRole() {
70
56
  return this._raw.myRole();
71
57
  }
72
58
  addMember(member, role) {
73
59
  this._raw.addMember(member === "everyone" ? member : member._raw, role);
60
+ return this;
74
61
  }
75
- static define(fields) {
76
- this._encoding || (this._encoding = {});
77
- Object.assign(this._encoding, fields);
62
+ get members() {
63
+ return this._raw
64
+ .keys()
65
+ .filter((key) => {
66
+ return key === "everyone" || key.startsWith("co_");
67
+ })
68
+ .map((id) => {
69
+ const role = this._raw.get(id);
70
+ const accountID = id === "everyone"
71
+ ? undefined
72
+ : id;
73
+ const ref = accountID &&
74
+ new Ref(accountID, this._loadedAs, this._schema[MembersSym]);
75
+ const accessRef = () => ref?.accessFrom(this);
76
+ return {
77
+ id: id,
78
+ role,
79
+ ref,
80
+ get account() {
81
+ return accessRef();
82
+ },
83
+ };
84
+ });
78
85
  }
79
86
  }
80
87
  _a = Group;
@@ -82,12 +89,13 @@ _a = Group;
82
89
  _a.prototype._type = "Group";
83
90
  })();
84
91
  (() => {
85
- _a._encoding = {
86
- profile: { json: true },
87
- root: { json: true },
92
+ _a._schema = {
93
+ profile: "json",
94
+ root: "json",
95
+ [MembersSym]: () => Account,
88
96
  };
89
- Object.defineProperty(_a.prototype, "_encoding", {
90
- get: () => _a._encoding,
97
+ Object.defineProperty(_a.prototype, "_schema", {
98
+ get: () => _a._schema,
91
99
  });
92
100
  })();
93
101
  //# sourceMappingURL=group.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"group.js","sourceRoot":"","sources":["../../src/coValues/group.ts"],"names":[],"mappings":";AAQA,OAAO,EACH,OAAO,EACP,KAAK,EACL,WAAW,EACX,QAAQ,EACR,mBAAmB,GACtB,MAAM,gBAAgB,CAAC;AAExB,MAAM,OAAO,OAAQ,SAAQ,KAAuB;CAEnD;AACD,OAAO,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;AAEnC,MAAM,OAAO,KAMT,SAAQ,WAAW;IAWnB,IAAI,SAAS;QAQT,OAAQ,IAAI,CAAC,WAA4B,CAAC,SAAS,CAAC;IACxD,CAAC;IAiBD,IAAI,KAAK;QAML,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAE1B,CAAC;QAChB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAEpB,CAAC;QAChB,OAAO;YACH,OAAO,EACH,SAAS;gBACR,IAAI,QAAQ,CACT,SAAS,EACT,IAAI,CAAC,SAAS,EAEV,IAAI,CAAC,SAAS,CAAC,OAGlB,CAAC,GAAG,EAAE,CACF;YACb,IAAI,EACA,MAAM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