jazz-tools 0.8.44 → 0.8.48
Sign up to get free protection for your applications and to get access to all the features.
- package/.turbo/turbo-build.log +16 -10
- package/CHANGELOG.md +21 -0
- package/dist/chunk-6OHBW32Q.js +2853 -0
- package/dist/chunk-6OHBW32Q.js.map +1 -0
- package/dist/index.native.js +63 -0
- package/dist/index.native.js.map +1 -0
- package/dist/index.web.js +61 -0
- package/dist/index.web.js.map +1 -0
- package/package.json +9 -12
- package/src/coValues/account.ts +29 -10
- package/src/coValues/coFeed.ts +4 -3
- package/src/coValues/coList.ts +8 -5
- package/src/coValues/coMap.ts +14 -5
- package/src/coValues/deepLoading.ts +6 -12
- package/src/coValues/extensions/imageDef.ts +3 -1
- package/src/coValues/group.ts +8 -11
- package/src/coValues/inbox.ts +377 -0
- package/src/coValues/interfaces.ts +9 -6
- package/src/coValues/profile.ts +11 -0
- package/src/coValues/registeredSchemas.ts +12 -0
- package/src/exports.ts +21 -15
- package/src/implementation/anonymousJazzAgent.ts +6 -0
- package/src/implementation/createContext.ts +8 -9
- package/src/implementation/refs.ts +1 -1
- package/src/implementation/subscriptionScope.ts +1 -1
- package/src/index.native.ts +0 -1
- package/src/internal.ts +1 -9
- package/src/tests/account.test.ts +2 -2
- package/src/tests/coFeed.test.ts +0 -9
- package/src/tests/coMap.test.ts +11 -8
- package/src/tests/groupsAndAccounts.test.ts +1 -63
- package/src/tests/inbox.test.ts +299 -0
- package/src/tests/schemaUnion.test.ts +1 -1
- package/src/tests/utils.ts +14 -0
- package/tsup.config.ts +13 -0
- package/dist/native/coValues/account.js +0 -221
- package/dist/native/coValues/account.js.map +0 -1
- package/dist/native/coValues/coFeed.js +0 -571
- package/dist/native/coValues/coFeed.js.map +0 -1
- package/dist/native/coValues/coList.js +0 -404
- package/dist/native/coValues/coList.js.map +0 -1
- package/dist/native/coValues/coMap.js +0 -537
- package/dist/native/coValues/coMap.js.map +0 -1
- package/dist/native/coValues/deepLoading.js +0 -63
- package/dist/native/coValues/deepLoading.js.map +0 -1
- package/dist/native/coValues/extensions/imageDef.js +0 -42
- package/dist/native/coValues/extensions/imageDef.js.map +0 -1
- package/dist/native/coValues/group.js +0 -136
- package/dist/native/coValues/group.js.map +0 -1
- package/dist/native/coValues/interfaces.js +0 -135
- package/dist/native/coValues/interfaces.js.map +0 -1
- package/dist/native/coValues/schemaUnion.js +0 -89
- package/dist/native/coValues/schemaUnion.js.map +0 -1
- package/dist/native/exports.js +0 -5
- package/dist/native/exports.js.map +0 -1
- package/dist/native/implementation/createContext.js +0 -157
- package/dist/native/implementation/createContext.js.map +0 -1
- package/dist/native/implementation/devtoolsFormatters.js +0 -95
- package/dist/native/implementation/devtoolsFormatters.js.map +0 -1
- package/dist/native/implementation/errors.js +0 -2
- package/dist/native/implementation/errors.js.map +0 -1
- package/dist/native/implementation/inspect.js +0 -2
- package/dist/native/implementation/inspect.js.map +0 -1
- package/dist/native/implementation/refs.js +0 -115
- package/dist/native/implementation/refs.js.map +0 -1
- package/dist/native/implementation/schema.js +0 -96
- package/dist/native/implementation/schema.js.map +0 -1
- package/dist/native/implementation/subscriptionScope.js +0 -91
- package/dist/native/implementation/subscriptionScope.js.map +0 -1
- package/dist/native/implementation/symbols.js +0 -4
- package/dist/native/implementation/symbols.js.map +0 -1
- package/dist/native/index.native.js +0 -3
- package/dist/native/index.native.js.map +0 -1
- package/dist/native/internal.js +0 -18
- package/dist/native/internal.js.map +0 -1
- package/dist/native/lib/cache.js +0 -13
- package/dist/native/lib/cache.js.map +0 -1
- package/dist/native/lib/cache.test.js +0 -52
- package/dist/native/lib/cache.test.js.map +0 -1
- package/dist/web/coValues/account.js +0 -221
- package/dist/web/coValues/account.js.map +0 -1
- package/dist/web/coValues/coFeed.js +0 -571
- package/dist/web/coValues/coFeed.js.map +0 -1
- package/dist/web/coValues/coList.js +0 -404
- package/dist/web/coValues/coList.js.map +0 -1
- package/dist/web/coValues/coMap.js +0 -537
- package/dist/web/coValues/coMap.js.map +0 -1
- package/dist/web/coValues/deepLoading.js +0 -63
- package/dist/web/coValues/deepLoading.js.map +0 -1
- package/dist/web/coValues/extensions/imageDef.js +0 -42
- package/dist/web/coValues/extensions/imageDef.js.map +0 -1
- package/dist/web/coValues/group.js +0 -136
- package/dist/web/coValues/group.js.map +0 -1
- package/dist/web/coValues/interfaces.js +0 -135
- package/dist/web/coValues/interfaces.js.map +0 -1
- package/dist/web/coValues/schemaUnion.js +0 -89
- package/dist/web/coValues/schemaUnion.js.map +0 -1
- package/dist/web/exports.js +0 -5
- package/dist/web/exports.js.map +0 -1
- package/dist/web/implementation/createContext.js +0 -157
- package/dist/web/implementation/createContext.js.map +0 -1
- package/dist/web/implementation/devtoolsFormatters.js +0 -95
- package/dist/web/implementation/devtoolsFormatters.js.map +0 -1
- package/dist/web/implementation/errors.js +0 -2
- package/dist/web/implementation/errors.js.map +0 -1
- package/dist/web/implementation/inspect.js +0 -2
- package/dist/web/implementation/inspect.js.map +0 -1
- package/dist/web/implementation/refs.js +0 -115
- package/dist/web/implementation/refs.js.map +0 -1
- package/dist/web/implementation/schema.js +0 -96
- package/dist/web/implementation/schema.js.map +0 -1
- package/dist/web/implementation/subscriptionScope.js +0 -91
- package/dist/web/implementation/subscriptionScope.js.map +0 -1
- package/dist/web/implementation/symbols.js +0 -4
- package/dist/web/implementation/symbols.js.map +0 -1
- package/dist/web/index.web.js +0 -3
- package/dist/web/index.web.js.map +0 -1
- package/dist/web/internal.js +0 -18
- package/dist/web/internal.js.map +0 -1
- package/dist/web/lib/cache.js +0 -13
- package/dist/web/lib/cache.js.map +0 -1
- package/dist/web/lib/cache.test.js +0 -52
- package/dist/web/lib/cache.test.js.map +0 -1
@@ -1,537 +0,0 @@
|
|
1
|
-
var _a;
|
2
|
-
import { cojsonInternals, } from "cojson";
|
3
|
-
import { Account, CoValueBase, ItemsSym, Ref, SchemaInit, ensureCoValueLoaded, inspect, isRefEncoded, loadCoValue, makeRefs, subscribeToCoValue, subscribeToExistingCoValue, subscriptionsScopes, } from "../internal.js";
|
4
|
-
/**
|
5
|
-
* CoMaps are collaborative versions of plain objects, mapping string-like keys to values.
|
6
|
-
*
|
7
|
-
* @categoryDescription Declaration
|
8
|
-
* Declare your own CoMap schemas by subclassing `CoMap` and assigning field schemas with `co`.
|
9
|
-
*
|
10
|
-
* Optional `co.ref(...)` fields must be marked with `{ optional: true }`.
|
11
|
-
*
|
12
|
-
* ```ts
|
13
|
-
* import { co, CoMap } from "jazz-tools";
|
14
|
-
*
|
15
|
-
* class Person extends CoMap {
|
16
|
-
* name = co.string;
|
17
|
-
* age = co.number;
|
18
|
-
* pet = co.ref(Animal);
|
19
|
-
* car = co.ref(Car, { optional: true });
|
20
|
-
* }
|
21
|
-
* ```
|
22
|
-
*
|
23
|
-
* @categoryDescription Content
|
24
|
-
* You can access properties you declare on a `CoMap` (using `co`) as if they were normal properties on a plain object, using dot notation, `Object.keys()`, etc.
|
25
|
-
*
|
26
|
-
* ```ts
|
27
|
-
* person.name;
|
28
|
-
* person["age"];
|
29
|
-
* person.age = 42;
|
30
|
-
* person.pet?.name;
|
31
|
-
* Object.keys(person);
|
32
|
-
* // => ["name", "age", "pet"]
|
33
|
-
* ```
|
34
|
-
*
|
35
|
-
* @category CoValues
|
36
|
-
* */
|
37
|
-
export class CoMap extends CoValueBase {
|
38
|
-
/** @internal */
|
39
|
-
get _schema() {
|
40
|
-
return this.constructor._schema;
|
41
|
-
}
|
42
|
-
/**
|
43
|
-
* If property `prop` is a `co.ref(...)`, you can use `coMaps._refs.prop` to access
|
44
|
-
* the `Ref` instead of the potentially loaded/null value.
|
45
|
-
*
|
46
|
-
* This allows you to always get the ID or load the value manually.
|
47
|
-
*
|
48
|
-
* @example
|
49
|
-
* ```ts
|
50
|
-
* person._refs.pet.id; // => ID<Animal>
|
51
|
-
* person._refs.pet.value;
|
52
|
-
* // => Animal | null
|
53
|
-
* const pet = await person._refs.pet.load();
|
54
|
-
* ```
|
55
|
-
*
|
56
|
-
* @category Content
|
57
|
-
**/
|
58
|
-
get _refs() {
|
59
|
-
return makeRefs((key) => this._raw.get(key), () => {
|
60
|
-
const keys = this._raw.keys().filter((key) => {
|
61
|
-
const schema = this._schema[key] ||
|
62
|
-
this._schema[ItemsSym];
|
63
|
-
return schema && schema !== "json" && isRefEncoded(schema);
|
64
|
-
});
|
65
|
-
return keys;
|
66
|
-
}, this._loadedAs, (key) => (this._schema[key] || this._schema[ItemsSym]));
|
67
|
-
}
|
68
|
-
/** @internal */
|
69
|
-
getEditFromRaw(target, rawEdit, descriptor, key) {
|
70
|
-
return {
|
71
|
-
value: descriptor === "json"
|
72
|
-
? rawEdit.value
|
73
|
-
: "encoded" in descriptor
|
74
|
-
? rawEdit.value === null || rawEdit.value === undefined
|
75
|
-
? rawEdit.value
|
76
|
-
: descriptor.encoded.decode(rawEdit.value)
|
77
|
-
: new Ref(rawEdit.value, target._loadedAs, descriptor).accessFrom(target, "_edits." + key + ".value"),
|
78
|
-
ref: descriptor !== "json" && isRefEncoded(descriptor)
|
79
|
-
? new Ref(rawEdit.value, target._loadedAs, descriptor)
|
80
|
-
: undefined,
|
81
|
-
by: rawEdit.by &&
|
82
|
-
new Ref(rawEdit.by, target._loadedAs, {
|
83
|
-
ref: Account,
|
84
|
-
optional: false,
|
85
|
-
}).accessFrom(target, "_edits." + key + ".by"),
|
86
|
-
madeAt: rawEdit.at,
|
87
|
-
};
|
88
|
-
}
|
89
|
-
/** @category Collaboration */
|
90
|
-
get _edits() {
|
91
|
-
const map = this;
|
92
|
-
return new Proxy({}, {
|
93
|
-
get(_target, key) {
|
94
|
-
const rawEdit = map._raw.lastEditAt(key);
|
95
|
-
if (!rawEdit)
|
96
|
-
return undefined;
|
97
|
-
const descriptor = map._schema[key];
|
98
|
-
return {
|
99
|
-
...map.getEditFromRaw(map, rawEdit, descriptor, key),
|
100
|
-
get all() {
|
101
|
-
return [...map._raw.editsAt(key)].map((rawEdit) => map.getEditFromRaw(map, rawEdit, descriptor, key));
|
102
|
-
},
|
103
|
-
};
|
104
|
-
},
|
105
|
-
ownKeys(_target) {
|
106
|
-
return map._raw.keys();
|
107
|
-
},
|
108
|
-
getOwnPropertyDescriptor(target, key) {
|
109
|
-
return {
|
110
|
-
value: Reflect.get(target, key),
|
111
|
-
writable: false,
|
112
|
-
enumerable: true,
|
113
|
-
configurable: true,
|
114
|
-
};
|
115
|
-
},
|
116
|
-
});
|
117
|
-
}
|
118
|
-
/** @internal */
|
119
|
-
constructor(
|
120
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
121
|
-
options) {
|
122
|
-
super();
|
123
|
-
if (options) {
|
124
|
-
if ("fromRaw" in options) {
|
125
|
-
Object.defineProperties(this, {
|
126
|
-
id: {
|
127
|
-
value: options.fromRaw.id,
|
128
|
-
enumerable: false,
|
129
|
-
},
|
130
|
-
_raw: { value: options.fromRaw, enumerable: false },
|
131
|
-
});
|
132
|
-
}
|
133
|
-
else {
|
134
|
-
throw new Error("Invalid CoMap constructor arguments");
|
135
|
-
}
|
136
|
-
}
|
137
|
-
return new Proxy(this, CoMapProxyHandler);
|
138
|
-
}
|
139
|
-
/**
|
140
|
-
* Create a new CoMap with the given initial values and owner.
|
141
|
-
*
|
142
|
-
* The owner (a Group or Account) determines access rights to the CoMap.
|
143
|
-
*
|
144
|
-
* The CoMap will immediately be persisted and synced to connected peers.
|
145
|
-
*
|
146
|
-
* @example
|
147
|
-
* ```ts
|
148
|
-
* const person = Person.create({
|
149
|
-
* name: "Alice",
|
150
|
-
* age: 42,
|
151
|
-
* pet: cat,
|
152
|
-
* }, { owner: friendGroup });
|
153
|
-
* ```
|
154
|
-
*
|
155
|
-
* @category Creation
|
156
|
-
**/
|
157
|
-
static create(init, options) {
|
158
|
-
const instance = new this();
|
159
|
-
const raw = instance.rawFromInit(init, options.owner, options.unique === undefined ? undefined : { uniqueness: options.unique });
|
160
|
-
Object.defineProperties(instance, {
|
161
|
-
id: {
|
162
|
-
value: raw.id,
|
163
|
-
enumerable: false,
|
164
|
-
},
|
165
|
-
_raw: { value: raw, enumerable: false },
|
166
|
-
});
|
167
|
-
return instance;
|
168
|
-
}
|
169
|
-
/**
|
170
|
-
* Return a JSON representation of the `CoMap`
|
171
|
-
* @category Content
|
172
|
-
*/
|
173
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
174
|
-
toJSON(_key, seenAbove) {
|
175
|
-
const jsonedFields = this._raw.keys().map((key) => {
|
176
|
-
const tKey = key;
|
177
|
-
const descriptor = (this._schema[tKey] ||
|
178
|
-
this._schema[ItemsSym]);
|
179
|
-
if (descriptor == "json" || "encode" in descriptor) {
|
180
|
-
return [key, this._raw.get(key)];
|
181
|
-
}
|
182
|
-
else if (isRefEncoded(descriptor)) {
|
183
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
184
|
-
if (seenAbove?.includes(this[tKey]?.id)) {
|
185
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
186
|
-
return [key, { _circular: this[tKey]?.id }];
|
187
|
-
}
|
188
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
189
|
-
const jsonedRef = this[tKey]?.toJSON(tKey, [
|
190
|
-
...(seenAbove || []),
|
191
|
-
this.id,
|
192
|
-
]);
|
193
|
-
return [key, jsonedRef];
|
194
|
-
}
|
195
|
-
else {
|
196
|
-
return [key, undefined];
|
197
|
-
}
|
198
|
-
});
|
199
|
-
return {
|
200
|
-
id: this.id,
|
201
|
-
_type: this._type,
|
202
|
-
...Object.fromEntries(jsonedFields),
|
203
|
-
};
|
204
|
-
}
|
205
|
-
[inspect]() {
|
206
|
-
return this.toJSON();
|
207
|
-
}
|
208
|
-
/**
|
209
|
-
* Create a new `RawCoMap` from an initialization object
|
210
|
-
* @internal
|
211
|
-
*/
|
212
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
213
|
-
rawFromInit(init, owner, uniqueness) {
|
214
|
-
const rawOwner = owner._raw;
|
215
|
-
const rawInit = {};
|
216
|
-
if (init)
|
217
|
-
for (const key of Object.keys(init)) {
|
218
|
-
const initValue = init[key];
|
219
|
-
const descriptor = (this._schema[key] ||
|
220
|
-
this._schema[ItemsSym]);
|
221
|
-
if (!descriptor) {
|
222
|
-
continue;
|
223
|
-
}
|
224
|
-
if (descriptor === "json") {
|
225
|
-
rawInit[key] = initValue;
|
226
|
-
}
|
227
|
-
else if (isRefEncoded(descriptor)) {
|
228
|
-
if (initValue) {
|
229
|
-
rawInit[key] = initValue.id;
|
230
|
-
}
|
231
|
-
}
|
232
|
-
else if ("encoded" in descriptor) {
|
233
|
-
rawInit[key] = descriptor.encoded.encode(
|
234
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
235
|
-
initValue);
|
236
|
-
}
|
237
|
-
}
|
238
|
-
return rawOwner.createMap(rawInit, null, "private", uniqueness);
|
239
|
-
}
|
240
|
-
/**
|
241
|
-
* Declare a Record-like CoMap schema, by extending `CoMap.Record(...)` and passing the value schema using `co`. Keys are always `string`.
|
242
|
-
*
|
243
|
-
* @example
|
244
|
-
* ```ts
|
245
|
-
* import { co, CoMap } from "jazz-tools";
|
246
|
-
*
|
247
|
-
* class ColorToFruitMap extends CoMap.Record(
|
248
|
-
* co.ref(Fruit)
|
249
|
-
* ) {}
|
250
|
-
*
|
251
|
-
* // assume we have map: ColorToFruitMap
|
252
|
-
* // and strawberry: Fruit
|
253
|
-
* map["red"] = strawberry;
|
254
|
-
* ```
|
255
|
-
*
|
256
|
-
* @category Declaration
|
257
|
-
*/
|
258
|
-
static Record(value) {
|
259
|
-
var _b;
|
260
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
|
261
|
-
class RecordLikeCoMap extends _a {
|
262
|
-
constructor() {
|
263
|
-
super(...arguments);
|
264
|
-
this[_b] = value;
|
265
|
-
}
|
266
|
-
}
|
267
|
-
_b = ItemsSym;
|
268
|
-
return RecordLikeCoMap;
|
269
|
-
}
|
270
|
-
/**
|
271
|
-
* Load a `CoMap` with a given ID, as a given account.
|
272
|
-
*
|
273
|
-
* `depth` specifies which (if any) fields that reference other CoValues to load as well before resolving.
|
274
|
-
* The `DeeplyLoaded` return type guarantees that corresponding referenced CoValues are loaded to the specified depth.
|
275
|
-
*
|
276
|
-
* You can pass `[]` or `{}` for shallowly loading only this CoMap, or `{ fieldA: depthA, fieldB: depthB }` for recursively loading referenced CoValues.
|
277
|
-
*
|
278
|
-
* Check out the `load` methods on `CoMap`/`CoList`/`CoFeed`/`Group`/`Account` to see which depth structures are valid to nest.
|
279
|
-
*
|
280
|
-
* @example
|
281
|
-
* ```ts
|
282
|
-
* const person = await Person.load(
|
283
|
-
* "co_zdsMhHtfG6VNKt7RqPUPvUtN2Ax",
|
284
|
-
* me,
|
285
|
-
* { pet: {} }
|
286
|
-
* );
|
287
|
-
* ```
|
288
|
-
*
|
289
|
-
* @category Subscription & Loading
|
290
|
-
*/
|
291
|
-
static load(id, as, depth) {
|
292
|
-
return loadCoValue(this, id, as, depth);
|
293
|
-
}
|
294
|
-
/**
|
295
|
-
* Load and subscribe to a `CoMap` with a given ID, as a given account.
|
296
|
-
*
|
297
|
-
* Automatically also subscribes to updates to all referenced/nested CoValues as soon as they are accessed in the listener.
|
298
|
-
*
|
299
|
-
* `depth` specifies which (if any) fields that reference other CoValues to load as well before calling `listener` for the first time.
|
300
|
-
* The `DeeplyLoaded` return type guarantees that corresponding referenced CoValues are loaded to the specified depth.
|
301
|
-
*
|
302
|
-
* You can pass `[]` or `{}` for shallowly loading only this CoMap, or `{ fieldA: depthA, fieldB: depthB }` for recursively loading referenced CoValues.
|
303
|
-
*
|
304
|
-
* Check out the `load` methods on `CoMap`/`CoList`/`CoFeed`/`Group`/`Account` to see which depth structures are valid to nest.
|
305
|
-
*
|
306
|
-
* Returns an unsubscribe function that you should call when you no longer need updates.
|
307
|
-
*
|
308
|
-
* Also see the `useCoState` hook to reactively subscribe to a CoValue in a React component.
|
309
|
-
*
|
310
|
-
* @example
|
311
|
-
* ```ts
|
312
|
-
* const unsub = Person.subscribe(
|
313
|
-
* "co_zdsMhHtfG6VNKt7RqPUPvUtN2Ax",
|
314
|
-
* me,
|
315
|
-
* { pet: {} },
|
316
|
-
* (person) => console.log(person)
|
317
|
-
* );
|
318
|
-
* ```
|
319
|
-
*
|
320
|
-
* @category Subscription & Loading
|
321
|
-
*/
|
322
|
-
static subscribe(id, as, depth, listener) {
|
323
|
-
return subscribeToCoValue(this, id, as, depth, listener);
|
324
|
-
}
|
325
|
-
static findUnique(unique, ownerID, as) {
|
326
|
-
const header = {
|
327
|
-
type: "comap",
|
328
|
-
ruleset: {
|
329
|
-
type: "ownedByGroup",
|
330
|
-
group: ownerID,
|
331
|
-
},
|
332
|
-
meta: null,
|
333
|
-
uniqueness: unique,
|
334
|
-
};
|
335
|
-
const crypto = as._type === "Anonymous" ? as.node.crypto : as._raw.core.crypto;
|
336
|
-
return cojsonInternals.idforHeader(header, crypto);
|
337
|
-
}
|
338
|
-
/**
|
339
|
-
* Given an already loaded `CoMap`, ensure that the specified fields are loaded to the specified depth.
|
340
|
-
*
|
341
|
-
* Works like `CoMap.load()`, but you don't need to pass the ID or the account to load as again.
|
342
|
-
*
|
343
|
-
* @category Subscription & Loading
|
344
|
-
*/
|
345
|
-
ensureLoaded(depth) {
|
346
|
-
return ensureCoValueLoaded(this, depth);
|
347
|
-
}
|
348
|
-
/**
|
349
|
-
* Given an already loaded `CoMap`, subscribe to updates to the `CoMap` and ensure that the specified fields are loaded to the specified depth.
|
350
|
-
*
|
351
|
-
* Works like `CoMap.subscribe()`, but you don't need to pass the ID or the account to load as again.
|
352
|
-
*
|
353
|
-
* Returns an unsubscribe function that you should call when you no longer need updates.
|
354
|
-
*
|
355
|
-
* @category Subscription & Loading
|
356
|
-
**/
|
357
|
-
subscribe(depth, listener) {
|
358
|
-
return subscribeToExistingCoValue(this, depth, listener);
|
359
|
-
}
|
360
|
-
applyDiff(newValues) {
|
361
|
-
for (const key in newValues) {
|
362
|
-
if (Object.prototype.hasOwnProperty.call(newValues, key)) {
|
363
|
-
const tKey = key;
|
364
|
-
const descriptor = (this._schema[tKey] ||
|
365
|
-
this._schema[ItemsSym]);
|
366
|
-
if (tKey in this._schema) {
|
367
|
-
const newValue = newValues[tKey];
|
368
|
-
const currentValue = this[tKey];
|
369
|
-
if (descriptor === "json" || "encoded" in descriptor) {
|
370
|
-
if (currentValue !== newValue) {
|
371
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
372
|
-
this[tKey] = newValue;
|
373
|
-
}
|
374
|
-
}
|
375
|
-
else if (isRefEncoded(descriptor)) {
|
376
|
-
const currentId = currentValue?.id;
|
377
|
-
const newId = newValue?.id;
|
378
|
-
if (currentId !== newId) {
|
379
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
380
|
-
this[tKey] = newValue;
|
381
|
-
}
|
382
|
-
}
|
383
|
-
}
|
384
|
-
}
|
385
|
-
}
|
386
|
-
return this;
|
387
|
-
}
|
388
|
-
/**
|
389
|
-
* Wait for the `CoMap` to be uploaded to the other peers.
|
390
|
-
*
|
391
|
-
* @category Subscription & Loading
|
392
|
-
*/
|
393
|
-
waitForSync(options) {
|
394
|
-
return this._raw.core.waitForSync(options);
|
395
|
-
}
|
396
|
-
}
|
397
|
-
_a = CoMap;
|
398
|
-
(() => {
|
399
|
-
_a.prototype._type = "CoMap";
|
400
|
-
})();
|
401
|
-
// TODO: cache handlers per descriptor for performance?
|
402
|
-
const CoMapProxyHandler = {
|
403
|
-
get(target, key, receiver) {
|
404
|
-
if (key === "_schema") {
|
405
|
-
return Reflect.get(target, key);
|
406
|
-
}
|
407
|
-
else if (key in target) {
|
408
|
-
return Reflect.get(target, key, receiver);
|
409
|
-
}
|
410
|
-
else {
|
411
|
-
const descriptor = (target._schema[key] ||
|
412
|
-
target._schema[ItemsSym]);
|
413
|
-
if (descriptor && typeof key === "string") {
|
414
|
-
const raw = target._raw.get(key);
|
415
|
-
if (descriptor === "json") {
|
416
|
-
return raw;
|
417
|
-
}
|
418
|
-
else if ("encoded" in descriptor) {
|
419
|
-
return raw === undefined ? undefined : descriptor.encoded.decode(raw);
|
420
|
-
}
|
421
|
-
else if (isRefEncoded(descriptor)) {
|
422
|
-
return raw === undefined
|
423
|
-
? undefined
|
424
|
-
: new Ref(raw, target._loadedAs, descriptor).accessFrom(receiver, key);
|
425
|
-
}
|
426
|
-
}
|
427
|
-
else {
|
428
|
-
return undefined;
|
429
|
-
}
|
430
|
-
}
|
431
|
-
},
|
432
|
-
set(target, key, value, receiver) {
|
433
|
-
if ((typeof key === "string" || ItemsSym) &&
|
434
|
-
typeof value === "object" &&
|
435
|
-
value !== null &&
|
436
|
-
SchemaInit in value) {
|
437
|
-
target.constructor._schema ||= {};
|
438
|
-
target.constructor._schema[key] = value[SchemaInit];
|
439
|
-
return true;
|
440
|
-
}
|
441
|
-
const descriptor = (target._schema[key] ||
|
442
|
-
target._schema[ItemsSym]);
|
443
|
-
if (descriptor && typeof key === "string") {
|
444
|
-
if (descriptor === "json") {
|
445
|
-
target._raw.set(key, value);
|
446
|
-
}
|
447
|
-
else if ("encoded" in descriptor) {
|
448
|
-
target._raw.set(key, descriptor.encoded.encode(value));
|
449
|
-
}
|
450
|
-
else if (isRefEncoded(descriptor)) {
|
451
|
-
if (value === null) {
|
452
|
-
if (descriptor.optional) {
|
453
|
-
target._raw.set(key, null);
|
454
|
-
}
|
455
|
-
else {
|
456
|
-
throw new Error(`Cannot set required reference ${key} to null`);
|
457
|
-
}
|
458
|
-
}
|
459
|
-
else {
|
460
|
-
target._raw.set(key, value.id);
|
461
|
-
subscriptionsScopes
|
462
|
-
.get(target)
|
463
|
-
?.onRefAccessedOrSet(target.id, value.id);
|
464
|
-
}
|
465
|
-
}
|
466
|
-
return true;
|
467
|
-
}
|
468
|
-
else {
|
469
|
-
return Reflect.set(target, key, value, receiver);
|
470
|
-
}
|
471
|
-
},
|
472
|
-
defineProperty(target, key, attributes) {
|
473
|
-
if ("value" in attributes &&
|
474
|
-
typeof attributes.value === "object" &&
|
475
|
-
SchemaInit in attributes.value) {
|
476
|
-
target.constructor._schema ||= {};
|
477
|
-
target.constructor._schema[key] =
|
478
|
-
attributes.value[SchemaInit];
|
479
|
-
return true;
|
480
|
-
}
|
481
|
-
else {
|
482
|
-
return Reflect.defineProperty(target, key, attributes);
|
483
|
-
}
|
484
|
-
},
|
485
|
-
ownKeys(target) {
|
486
|
-
const keys = Reflect.ownKeys(target).filter((k) => k !== ItemsSym);
|
487
|
-
// for (const key of Reflect.ownKeys(target._schema)) {
|
488
|
-
// if (key !== ItemsSym && !keys.includes(key)) {
|
489
|
-
// keys.push(key);
|
490
|
-
// }
|
491
|
-
// }
|
492
|
-
for (const key of target._raw.keys()) {
|
493
|
-
if (!keys.includes(key)) {
|
494
|
-
keys.push(key);
|
495
|
-
}
|
496
|
-
}
|
497
|
-
return keys;
|
498
|
-
},
|
499
|
-
getOwnPropertyDescriptor(target, key) {
|
500
|
-
if (key in target) {
|
501
|
-
return Reflect.getOwnPropertyDescriptor(target, key);
|
502
|
-
}
|
503
|
-
else {
|
504
|
-
const descriptor = (target._schema[key] ||
|
505
|
-
target._schema[ItemsSym]);
|
506
|
-
if (descriptor || key in target._raw.latest) {
|
507
|
-
return {
|
508
|
-
enumerable: true,
|
509
|
-
configurable: true,
|
510
|
-
writable: true,
|
511
|
-
};
|
512
|
-
}
|
513
|
-
}
|
514
|
-
},
|
515
|
-
has(target, key) {
|
516
|
-
const descriptor = (target._schema?.[key] ||
|
517
|
-
target._schema?.[ItemsSym]);
|
518
|
-
if (target._raw && typeof key === "string" && descriptor) {
|
519
|
-
return target._raw.get(key) !== undefined;
|
520
|
-
}
|
521
|
-
else {
|
522
|
-
return Reflect.has(target, key);
|
523
|
-
}
|
524
|
-
},
|
525
|
-
deleteProperty(target, key) {
|
526
|
-
const descriptor = (target._schema[key] ||
|
527
|
-
target._schema[ItemsSym]);
|
528
|
-
if (typeof key === "string" && descriptor) {
|
529
|
-
target._raw.delete(key);
|
530
|
-
return true;
|
531
|
-
}
|
532
|
-
else {
|
533
|
-
return Reflect.deleteProperty(target, key);
|
534
|
-
}
|
535
|
-
},
|
536
|
-
};
|
537
|
-
//# sourceMappingURL=coMap.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"coMap.js","sourceRoot":"","sources":["../../../src/coValues/coMap.ts"],"names":[],"mappings":";AAAA,OAAO,EAOL,eAAe,GAChB,MAAM,QAAQ,CAAC;AAehB,OAAO,EACL,OAAO,EACP,WAAW,EACX,QAAQ,EACR,GAAG,EACH,UAAU,EACV,mBAAmB,EACnB,OAAO,EACP,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,kBAAkB,EAClB,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AAiBxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgCM;AACN,MAAM,OAAO,KAAM,SAAQ,WAAW;IAgBpC,gBAAgB;IAChB,IAAI,OAAO;QACT,OAAQ,IAAI,CAAC,WAA4B,CAAC,OAEf,CAAC;IAC9B,CAAC;IAED;;;;;;;;;;;;;;;QAeI;IACJ,IAAI,KAAK;QAGP,OAAO,QAAQ,CACb,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAa,CAA2B,EAC/D,GAAG,EAAE;YACH,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE;gBAC3C,MAAM,MAAM,GACV,IAAI,CAAC,OAAO,CAAC,GAAgC,CAAC;oBAC7C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAwB,CAAC;gBACjD,OAAO,MAAM,IAAI,MAAM,KAAK,MAAM,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;YAC7D,CAAC,CAAmB,CAAC;YAErB,OAAO,IAAI,CAAC;QACd,CAAC,EACD,IAAI,CAAC,SAAS,EACd,CAAC,GAAG,EAAE,EAAE,CACN,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,I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,CAAC;QAC7C,CAAC;IACH,CAAC;CACF,CAAC"}
|
@@ -1,63 +0,0 @@
|
|
1
|
-
import { ItemsSym, } from "../internal.js";
|
2
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
3
|
-
export function fulfillsDepth(depth, value) {
|
4
|
-
if (value._type === "CoMap" ||
|
5
|
-
value._type === "Group" ||
|
6
|
-
value._type === "Account") {
|
7
|
-
if (Array.isArray(depth) && depth.length === 1) {
|
8
|
-
return Object.entries(value).every(([key, item]) => {
|
9
|
-
return value._refs[key]
|
10
|
-
? item && fulfillsDepth(depth[0], item)
|
11
|
-
: value._schema[ItemsSym]
|
12
|
-
.optional;
|
13
|
-
});
|
14
|
-
}
|
15
|
-
else {
|
16
|
-
for (const key of Object.keys(depth)) {
|
17
|
-
const map = value;
|
18
|
-
if (!map._refs[key] && map._schema[key].optional) {
|
19
|
-
continue;
|
20
|
-
}
|
21
|
-
if (!map[key]) {
|
22
|
-
return false;
|
23
|
-
}
|
24
|
-
if (!fulfillsDepth(depth[key], map[key])) {
|
25
|
-
return false;
|
26
|
-
}
|
27
|
-
}
|
28
|
-
return true;
|
29
|
-
}
|
30
|
-
}
|
31
|
-
else if (value._type === "CoList") {
|
32
|
-
if (depth.length === 0) {
|
33
|
-
return true;
|
34
|
-
}
|
35
|
-
else {
|
36
|
-
const itemDepth = depth[0];
|
37
|
-
return value.every((item, i) => value._refs[i]
|
38
|
-
? item && fulfillsDepth(itemDepth, item)
|
39
|
-
: value._schema[ItemsSym]
|
40
|
-
.optional);
|
41
|
-
}
|
42
|
-
}
|
43
|
-
else if (value._type === "CoStream") {
|
44
|
-
if (depth.length === 0) {
|
45
|
-
return true;
|
46
|
-
}
|
47
|
-
else {
|
48
|
-
const itemDepth = depth[0];
|
49
|
-
return Object.values(value.perSession).every((entry) => entry.ref
|
50
|
-
? entry.value && fulfillsDepth(itemDepth, entry.value)
|
51
|
-
: value._schema[ItemsSym]
|
52
|
-
.optional);
|
53
|
-
}
|
54
|
-
}
|
55
|
-
else if (value._type === "BinaryCoStream") {
|
56
|
-
return true;
|
57
|
-
}
|
58
|
-
else {
|
59
|
-
console.error(value);
|
60
|
-
throw new Error("Unexpected value type: " + value._type);
|
61
|
-
}
|
62
|
-
}
|
63
|
-
//# sourceMappingURL=deepLoading.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"deepLoading.js","sourceRoot":"","sources":["../../../src/coValues/deepLoading.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,QAAQ,GAIT,MAAM,gBAAgB,CAAC;AAIxB,8DAA8D;AAC9D,MAAM,UAAU,aAAa,CAAC,KAAU,EAAE,KAAc;IACtD,IACE,KAAK,CAAC,KAAK,KAAK,OAAO;QACvB,KAAK,CAAC,KAAK,KAAK,OAAO;QACvB,KAAK,CAAC,KAAK,KAAK,SAAS,EACzB,CAAC;QACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/C,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE;gBACjD,OACE,KAGD,CAAC,KAAK,CAAC,GAAG,CAAC;oBACV,CAAC,CAAC,IAAI,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;oBACvC,CAAC,CAAG,KAAe,CAAC,OAAO,CAAC,QAAQ,CAA0B;yBACzD,QAAQ,CAAC;YAClB,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBACrC,MAAM,GAAG,GAAG,KAIX,CAAC;gBACF,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE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AAC,KAAK,CAAC;gBACtD,CAAC,CAAG,KAAgB,CAAC,OAAO,CAAC,QAAQ,CAAyB;qBACzD,QAAQ,CAChB,CAAC;QACJ,CAAC;IACH,CAAC;SAAM,IAAI,KAAK,CAAC,KAAK,KAAK,gBAAgB,EAAE,CAAC;QAC5C,OAAO,IAAI,CAAC;IACd,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC"}
|
@@ -1,42 +0,0 @@
|
|
1
|
-
var _a;
|
2
|
-
import { CoMap, FileStream, co, subscriptionsScopes } from "../../internal.js";
|
3
|
-
/** @category Media */
|
4
|
-
export class ImageDefinition extends CoMap {
|
5
|
-
constructor() {
|
6
|
-
super(...arguments);
|
7
|
-
this.originalSize = co.json();
|
8
|
-
this.placeholderDataURL = co.string;
|
9
|
-
this[_a] = co.ref(FileStream);
|
10
|
-
}
|
11
|
-
highestResAvailable(options) {
|
12
|
-
if (!subscriptionsScopes.get(this)) {
|
13
|
-
console.warn("highestResAvailable() only makes sense when used within a subscription.");
|
14
|
-
}
|
15
|
-
const resolutions = Object.keys(this).filter((key) => key.match(/^\d+x\d+$/) &&
|
16
|
-
(options?.maxWidth === undefined ||
|
17
|
-
Number(key.split("x")[0]) <= options.maxWidth));
|
18
|
-
resolutions.sort((a, b) => {
|
19
|
-
const aWidth = Number(a.split("x")[0]);
|
20
|
-
const bWidth = Number(b.split("x")[0]);
|
21
|
-
return aWidth - bWidth;
|
22
|
-
});
|
23
|
-
let highestAvailableResolution;
|
24
|
-
for (const resolution of resolutions) {
|
25
|
-
if (this[resolution] && this[resolution]?.getChunks()) {
|
26
|
-
highestAvailableResolution = resolution;
|
27
|
-
}
|
28
|
-
else {
|
29
|
-
return (highestAvailableResolution && {
|
30
|
-
res: highestAvailableResolution,
|
31
|
-
stream: this[highestAvailableResolution],
|
32
|
-
});
|
33
|
-
}
|
34
|
-
}
|
35
|
-
return (highestAvailableResolution && {
|
36
|
-
res: highestAvailableResolution,
|
37
|
-
stream: this[highestAvailableResolution],
|
38
|
-
});
|
39
|
-
}
|
40
|
-
}
|
41
|
-
_a = co.items;
|
42
|
-
//# sourceMappingURL=imageDef.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"imageDef.js","sourceRoot":"","sources":["../../../../src/coValues/extensions/imageDef.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE/E,sBAAsB;AACtB,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAA1C;;QACE,iBAAY,GAAG,EAAE,CAAC,IAAI,EAAoB,CAAC;QAC3C,uBAAkB,GAAI,EAAE,CAAC,MAAM,CAAC;QAEhC,QAAU,GAAG,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IA8ClC,CAAC;IA3CC,mBAAmB,CAAC,OAEnB;QACC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACnC,OAAO,CAAC,IAAI,CACV,yEAAyE,CAC1E,CAAC;QACJ,CAAC;QAED,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAC1C,CAAC,GAAG,EAAE,EAAE,CACN,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC;YACtB,CAAC,OAAO,EAAE,QAAQ,KAAK,SAAS;gBAC9B,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,CACxB,CAAC;QAE7B,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACxB,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,KA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