jazz-tools 0.8.19 → 0.8.23
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +19 -0
- package/dist/native/coValues/account.js +15 -17
- package/dist/native/coValues/account.js.map +1 -1
- package/dist/native/coValues/{coStream.js → coFeed.js} +21 -14
- package/dist/native/coValues/coFeed.js.map +1 -0
- package/dist/native/coValues/coList.js +16 -13
- package/dist/native/coValues/coList.js.map +1 -1
- package/dist/native/coValues/coMap.js +14 -10
- package/dist/native/coValues/coMap.js.map +1 -1
- package/dist/native/coValues/deepLoading.js.map +1 -1
- package/dist/native/coValues/extensions/imageDef.js +9 -4
- package/dist/native/coValues/extensions/imageDef.js.map +1 -1
- package/dist/native/coValues/group.js +23 -20
- package/dist/native/coValues/group.js.map +1 -1
- package/dist/native/coValues/schemaUnion.js +93 -0
- package/dist/native/coValues/schemaUnion.js.map +1 -0
- package/dist/native/exports.js +1 -1
- package/dist/native/exports.js.map +1 -1
- package/dist/native/implementation/createContext.js +1 -2
- package/dist/native/implementation/createContext.js.map +1 -1
- package/dist/native/implementation/refs.js +0 -3
- package/dist/native/implementation/refs.js.map +1 -1
- package/dist/native/implementation/subscriptionScope.js +5 -8
- package/dist/native/implementation/subscriptionScope.js.map +1 -1
- package/dist/native/internal.js +2 -1
- package/dist/native/internal.js.map +1 -1
- package/dist/web/coValues/account.js +15 -17
- package/dist/web/coValues/account.js.map +1 -1
- package/dist/web/coValues/{coStream.js → coFeed.js} +21 -14
- package/dist/web/coValues/coFeed.js.map +1 -0
- package/dist/web/coValues/coList.js +16 -13
- package/dist/web/coValues/coList.js.map +1 -1
- package/dist/web/coValues/coMap.js +14 -10
- package/dist/web/coValues/coMap.js.map +1 -1
- package/dist/web/coValues/deepLoading.js.map +1 -1
- package/dist/web/coValues/extensions/imageDef.js +9 -4
- package/dist/web/coValues/extensions/imageDef.js.map +1 -1
- package/dist/web/coValues/group.js +23 -20
- package/dist/web/coValues/group.js.map +1 -1
- package/dist/web/coValues/schemaUnion.js +93 -0
- package/dist/web/coValues/schemaUnion.js.map +1 -0
- package/dist/web/exports.js +1 -1
- package/dist/web/exports.js.map +1 -1
- package/dist/web/implementation/createContext.js +1 -2
- package/dist/web/implementation/createContext.js.map +1 -1
- package/dist/web/implementation/refs.js +0 -3
- package/dist/web/implementation/refs.js.map +1 -1
- package/dist/web/implementation/subscriptionScope.js +5 -8
- package/dist/web/implementation/subscriptionScope.js.map +1 -1
- package/dist/web/internal.js +2 -1
- package/dist/web/internal.js.map +1 -1
- package/package.json +2 -2
- package/src/coValues/{coStream.ts → coFeed.ts} +50 -38
- package/src/coValues/coList.ts +2 -2
- package/src/coValues/coMap.ts +2 -2
- package/src/coValues/deepLoading.ts +6 -6
- package/src/coValues/extensions/imageDef.ts +4 -9
- package/src/coValues/schemaUnion.ts +106 -0
- package/src/exports.ts +3 -0
- package/src/internal.ts +2 -1
- package/src/tests/{coStream.test.ts → coFeed.test.ts} +21 -30
- package/src/tests/deepLoading.test.ts +2 -2
- package/src/tests/schemaUnion.test.ts +118 -0
- package/src/tests/subscribe.test.ts +4 -4
- package/tsconfig.json +1 -1
- package/dist/native/coValues/coStream.js.map +0 -1
- package/dist/web/coValues/coStream.js.map +0 -1
@@ -0,0 +1,93 @@
|
|
1
|
+
import { CoValueBase, } from "../internal.js";
|
2
|
+
/**
|
3
|
+
* SchemaUnion allows you to create union types of CoValues that can be discriminated at runtime.
|
4
|
+
*
|
5
|
+
* @categoryDescription Declaration
|
6
|
+
* Declare your union types by extending `SchemaUnion.Of(...)` and passing a discriminator function
|
7
|
+
* that determines which concrete type to use based on the raw data.
|
8
|
+
*
|
9
|
+
* ```ts
|
10
|
+
* import { SchemaUnion, CoMap } from "jazz-tools";
|
11
|
+
*
|
12
|
+
* class BaseWidget extends CoMap {
|
13
|
+
* type = co.string;
|
14
|
+
* }
|
15
|
+
*
|
16
|
+
* class ButtonWidget extends BaseWidget {
|
17
|
+
* type = co.literal("button");
|
18
|
+
* label = co.string;
|
19
|
+
* }
|
20
|
+
*
|
21
|
+
* class SliderWidget extends BaseWidget {
|
22
|
+
* type = co.literal("slider");
|
23
|
+
* min = co.number;
|
24
|
+
* max = co.number;
|
25
|
+
* }
|
26
|
+
*
|
27
|
+
* const WidgetUnion = SchemaUnion.Of<BaseWidget>((raw) => {
|
28
|
+
* switch (raw.get("type")) {
|
29
|
+
* case "button": return ButtonWidget;
|
30
|
+
* case "slider": return SliderWidget;
|
31
|
+
* default: throw new Error("Unknown widget type");
|
32
|
+
* }
|
33
|
+
* });
|
34
|
+
* ```
|
35
|
+
*
|
36
|
+
* @categoryDescription Loading
|
37
|
+
* When loading a SchemaUnion, the correct subclass will be instantiated based on the discriminator.
|
38
|
+
* You can narrow the returned instance to a subclass by using `instanceof` like so:
|
39
|
+
*
|
40
|
+
* ```ts
|
41
|
+
* const widget = await WidgetUnion.load(id, me, {});
|
42
|
+
* if (widget instanceof ButtonWidget) {
|
43
|
+
* console.log(widget.label);
|
44
|
+
* } else if (widget instanceof SliderWidget) {
|
45
|
+
* console.log(widget.min, widget.max);
|
46
|
+
* }
|
47
|
+
* ```
|
48
|
+
*
|
49
|
+
* @category CoValues
|
50
|
+
*/
|
51
|
+
export class SchemaUnion extends CoValueBase {
|
52
|
+
/**
|
53
|
+
* Create a new union type from a discriminator function.
|
54
|
+
*
|
55
|
+
* The discriminator function receives the raw data and should return the appropriate
|
56
|
+
* concrete class to use for that data.
|
57
|
+
*
|
58
|
+
* @param discriminator - Function that determines which concrete type to use
|
59
|
+
* @returns A new class that can create/load instances of the union type
|
60
|
+
*
|
61
|
+
* @example
|
62
|
+
* ```ts
|
63
|
+
* const WidgetUnion = SchemaUnion.Of<BaseWidget>((raw) => {
|
64
|
+
* switch (raw.get("type")) {
|
65
|
+
* case "button": return ButtonWidget;
|
66
|
+
* case "slider": return SliderWidget;
|
67
|
+
* default: throw new Error("Unknown widget type");
|
68
|
+
* }
|
69
|
+
* });
|
70
|
+
* ```
|
71
|
+
*
|
72
|
+
* @category Creation
|
73
|
+
*/
|
74
|
+
static Of(discriminator) {
|
75
|
+
return class SchemaUnionClass extends SchemaUnion {
|
76
|
+
static fromRaw(raw) {
|
77
|
+
const ResolvedClass = discriminator(raw);
|
78
|
+
return ResolvedClass.fromRaw(raw);
|
79
|
+
}
|
80
|
+
};
|
81
|
+
}
|
82
|
+
/**
|
83
|
+
* Create an instance from raw data. This is called internally and should not be used directly.
|
84
|
+
* Use {@link SchemaUnion.Of} to create a union type instead.
|
85
|
+
*
|
86
|
+
* @internal
|
87
|
+
*/
|
88
|
+
// @ts-ignore
|
89
|
+
static fromRaw(raw) {
|
90
|
+
throw new Error("Not implemented");
|
91
|
+
}
|
92
|
+
}
|
93
|
+
//# sourceMappingURL=schemaUnion.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"schemaUnion.js","sourceRoot":"","sources":["../../../src/coValues/schemaUnion.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,GAGZ,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,MAAM,OAAgB,WAAY,SAAQ,WAAW;IACnD;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,EAAE,CACP,aAAsE;QAEtE,OAAO,MAAM,gBAAiB,SAAQ,WAAW;YAC/C,MAAM,CAAU,OAAO,CAErB,GAAc;gBAEd,MAAM,aAAa,GAAG,aAAa,CACjC,GAAgB,CACiC,CAAC;gBACpD,OAAO,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACpC,CAAC;SACiD,CAAC;IACvD,CAAC;IAED;;;;;OAKG;IACH,aAAa;IACb,MAAM,CAAC,OAAO,CAA2C,GAAc;QACrE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACrC,CAAC;CACF"}
|
package/dist/native/exports.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
export { Encoders, co } from "./internal.js";
|
2
|
-
export { Account, BinaryCoStream, CoList, CoMap, CoStream, CoValueBase, Group, ImageDefinition, Profile, isControlledAccount, } from "./internal.js";
|
2
|
+
export { Account, FileStream, BinaryCoStream, CoList, CoMap, CoFeed, CoStream, CoValueBase, Group, ImageDefinition, Profile, isControlledAccount, SchemaUnion, } from "./internal.js";
|
3
3
|
export { createCoValueObservable, loadCoValue, subscribeToCoValue, } from "./internal.js";
|
4
4
|
export { AnonymousJazzAgent, createAnonymousJazzContext, createJazzContext, ephemeralCredentialsAuth, fixedCredentialsAuth, randomSessionProvider, } from "./internal.js";
|
5
5
|
//# sourceMappingURL=exports.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../src/exports.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EACL,OAAO,EACP,cAAc,EACd,MAAM,EACN,KAAK,EACL,QAAQ,EACR,WAAW,EACX,KAAK,EACL,eAAe,EACf,OAAO,EACP,mBAAmB,
|
1
|
+
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../src/exports.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EACL,OAAO,EACP,UAAU,EACV,cAAc,EACd,MAAM,EACN,KAAK,EACL,MAAM,EACN,QAAQ,EACR,WAAW,EACX,KAAK,EACL,eAAe,EACf,OAAO,EACP,mBAAmB,EACnB,WAAW,GAIZ,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,uBAAuB,EACvB,WAAW,EACX,kBAAkB,GACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,GAItB,MAAM,eAAe,CAAC"}
|
@@ -136,10 +136,9 @@ export async function createJazzContext(options) {
|
|
136
136
|
}
|
137
137
|
}
|
138
138
|
export class AnonymousJazzAgent {
|
139
|
-
node;
|
140
|
-
_type = "Anonymous";
|
141
139
|
constructor(node) {
|
142
140
|
this.node = node;
|
141
|
+
this._type = "Anonymous";
|
143
142
|
}
|
144
143
|
}
|
145
144
|
export async function createAnonymousJazzContext({ peersToLoadFrom, crypto, }) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createContext.js","sourceRoot":"","sources":["../../../src/implementation/createContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,eAAe,EAEf,SAAS,GAKV,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,OAAO,EAAoB,MAAM,gBAAgB,CAAC;AA8B3D,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,WAGpC,EAAc,EAAE;IACf,OAAO;QACL,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;YAClB,IAAI,EAAE,UAAU;YAChB,WAAW;YACX,eAAe,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;YAC/B,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC;YACnB,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;YACjB,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC;SACjB,CAAC;KACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAe,EAAE;IACvD,OAAO;QACL,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;YAClB,IAAI,EAAE,KAAK;YACX,aAAa,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;YACpC,eAAe,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;YAC/B,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC;YACnB,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;YACjB,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC;SACjB,CAAC;KACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,S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AC,CAAC,CAAC;YACxE,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,OAAO,kBAAkB;
|
1
|
+
{"version":3,"file":"createContext.js","sourceRoot":"","sources":["../../../src/implementation/createContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,eAAe,EAEf,SAAS,GAKV,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,OAAO,EAAoB,MAAM,gBAAgB,CAAC;AA8B3D,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,WAGpC,EAAc,EAAE;IACf,OAAO;QACL,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;YAClB,IAAI,EAAE,UAAU;YAChB,WAAW;YACX,eAAe,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;YAC/B,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC;YACnB,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;YACjB,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC;SACjB,CAAC;KACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAe,EAAE;IACvD,OAAO;QACL,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;YAClB,IAAI,EAAE,KAAK;YACX,aAAa,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;YACpC,eAAe,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;YAC/B,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC;YACnB,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;YACjB,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC;SACjB,CAAC;KACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,SAAsB,EACtB,MAAsB;IAEtB,OAAO;QACL,SAAS,EAAE,MAAM,CAAC,kBAAkB,CAAC,SAAoC,CAAC;QAC1E,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC;KACt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;QADlC,UAAK,GAAG,WAAoB,CAAC;IACQ,CAAC;CACvC;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,EAC/C,eAAe,EACf,MAAM,GAIP;IACC,MAAM,WAAW,GAAG,MAAM,CAAC,oBAAoB,EAAE,CAAC;IAClD,MAAM,QAAQ,GAAG,IAAI,eAAe,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAE1D,MAAM,IAAI,GAAG,IAAI,SAAS,CACxB,QAAQ,EACR,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC,EACtC,MAAM,CACP,CAAC;IAEF,KAAK,MAAM,IAAI,IAAI,eAAe,EAAE,CAAC;QACnC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,OAAO;QACL,KAAK,EAAE,IAAI,kBAAkB,CAAC,IAAI,CAAC;QACnC,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC;QACd,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC;KACjB,CAAC;AACJ,CAAC"}
|
@@ -2,9 +2,6 @@ import { instantiateRefEncoded, isRefEncoded, subscriptionsScopes, } from "../in
|
|
2
2
|
import { coValuesCache } from "../lib/cache.js";
|
3
3
|
const TRACE_ACCESSES = false;
|
4
4
|
export class Ref {
|
5
|
-
id;
|
6
|
-
controlledAccount;
|
7
|
-
schema;
|
8
5
|
constructor(id, controlledAccount, schema) {
|
9
6
|
this.id = id;
|
10
7
|
this.controlledAccount = controlledAccount;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"refs.js","sourceRoot":"","sources":["../../../src/implementation/refs.ts"],"names":[],"mappings":"AASA,OAAO,EACL,qBAAqB,EACrB,YAAY,EACZ,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,cAAc,GAAG,KAAK,CAAC;AAE7B,MAAM,OAAO,GAA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AO,cAAc,EAAE,CAAC,MAAM,CAAC;YACjC,CAAC;YACD,MAAM,EAAE,GAAG,WAAW,CAAC,GAAW,CAAC,CAAC;YACpC,IAAI,CAAC,EAAE;gBAAE,OAAO,SAAS,CAAC;YAC1B,OAAO,IAAI,GAAG,CACZ,EAAiB,EACjB,iBAAiB,EACjB,eAAe,CAAC,GAAW,CAAC,CAC7B,CAAC;QACJ,CAAC;QACD,OAAO;YACL,OAAO,cAAc,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;QACvD,CAAC;QACD,wBAAwB,CAAC,MAAM,EAAE,GAAG;YAClC,MAAM,EAAE,GAAG,WAAW,CAAC,GAAW,CAAC,CAAC;YACpC,IAAI,EAAE,EAAE,CAAC;gBACP,OAAO;oBACL,UAAU,EAAE,IAAI;oBAChB,YAAY,EAAE,IAAI;oBAClB,QAAQ,EAAE,IAAI;iBACf,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,OAAO,OAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
@@ -1,15 +1,12 @@
|
|
1
1
|
export const subscriptionsScopes = new WeakMap();
|
2
2
|
const TRACE_INVALIDATIONS = false;
|
3
3
|
export class SubscriptionScope {
|
4
|
-
scopeID = `scope-${Math.random().toString(36).slice(2)}`;
|
5
|
-
subscriber;
|
6
|
-
entries = new Map();
|
7
|
-
rootEntry;
|
8
|
-
scheduleUpdate;
|
9
|
-
scheduledUpdate = false;
|
10
|
-
cachedValues = {};
|
11
|
-
parents = {};
|
12
4
|
constructor(root, rootSchema, onUpdate) {
|
5
|
+
this.scopeID = `scope-${Math.random().toString(36).slice(2)}`;
|
6
|
+
this.entries = new Map();
|
7
|
+
this.scheduledUpdate = false;
|
8
|
+
this.cachedValues = {};
|
9
|
+
this.parents = {};
|
13
10
|
this.rootEntry = {
|
14
11
|
state: "loaded",
|
15
12
|
value: root._raw,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"subscriptionScope.js","sourceRoot":"","sources":["../../../src/implementation/subscriptionScope.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,OAAO,EAI3C,CAAC;AAEJ,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAElC,MAAM,OAAO,iBAAiB;
|
1
|
+
{"version":3,"file":"subscriptionScope.js","sourceRoot":"","sources":["../../../src/implementation/subscriptionScope.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,OAAO,EAI3C,CAAC;AAEJ,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAElC,MAAM,OAAO,iBAAiB;IAkB5B,YACE,IAAU,EACV,UAAqD,EACrD,QAAiC;QApBnC,YAAO,GAAW,SAAS,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAEjE,YAAO,GAAG,IAAI,GAAG,EAId,CAAC;QAOJ,oBAAe,GAAY,KAAK,CAAC;QACjC,iBAAY,GAAmC,EAAE,CAAC;QAClD,YAAO,GAA4C,EAAE,CAAC;QAOpD,IAAI,CAAC,SAAS,GAAG;YACf,KAAK,EAAE,QAAiB;YACxB,KAAK,EAAE,IAAI,CAAC,IAAI;YAChB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,cAAc;SACnC,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAE1C,mBAAmB,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAEpC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC;QACjC,IAAI,CAAC,cAAc,GAAG,GAAG,EAAE;YACzB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YAC5C,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IAED,cAAc;QACZ,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;YAC1C,IAAI,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAC7B,KAAK,CAAC,QAAQ,EAAE,CAAC;YACnB,CAAC;iBAAM,CAAC;gBACN,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAChC,CAAC;QACH,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;CACF"}
|
package/dist/native/internal.js
CHANGED
@@ -4,7 +4,8 @@ export * from "./coValues/interfaces.js";
|
|
4
4
|
export * from "./coValues/coMap.js";
|
5
5
|
export * from "./coValues/account.js";
|
6
6
|
export * from "./coValues/coList.js";
|
7
|
-
export * from "./coValues/
|
7
|
+
export * from "./coValues/coFeed.js";
|
8
|
+
export * from "./coValues/schemaUnion.js";
|
8
9
|
export * from "./coValues/group.js";
|
9
10
|
export * from "./implementation/errors.js";
|
10
11
|
export * from "./implementation/refs.js";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AAEzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AAEzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AAEpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,2BAA2B,CAAC;AAE1C,cAAc,mCAAmC,CAAC;AAElD,cAAc,mCAAmC,CAAC;AAElD,OAAO,wCAAwC,CAAC"}
|
@@ -1,25 +1,12 @@
|
|
1
|
+
var _a;
|
1
2
|
import { LocalNode, RawAccount, cojsonInternals, } from "cojson";
|
2
3
|
import { AnonymousJazzAgent, CoMap, CoValueBase, Group, MembersSym, Profile, Ref, SchemaInit, ensureCoValueLoaded, inspect, loadCoValue, subscribeToCoValue, subscribeToExistingCoValue, subscriptionsScopes, } from "../internal.js";
|
3
4
|
import { coValuesCache } from "../lib/cache.js";
|
4
5
|
/** @category Identity & Permissions */
|
5
6
|
export class Account extends CoValueBase {
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
7
|
-
static _schema;
|
8
7
|
get _schema() {
|
9
8
|
return this.constructor._schema;
|
10
9
|
}
|
11
|
-
static {
|
12
|
-
this._schema = {
|
13
|
-
profile: {
|
14
|
-
ref: () => Profile,
|
15
|
-
optional: false,
|
16
|
-
},
|
17
|
-
root: {
|
18
|
-
ref: () => CoMap,
|
19
|
-
optional: true,
|
20
|
-
},
|
21
|
-
};
|
22
|
-
}
|
23
10
|
get _owner() {
|
24
11
|
return this;
|
25
12
|
}
|
@@ -28,7 +15,7 @@ export class Account extends CoValueBase {
|
|
28
15
|
return this;
|
29
16
|
const rawAccount = this._raw.core.node.account;
|
30
17
|
if (rawAccount instanceof RawAccount) {
|
31
|
-
return coValuesCache.get(rawAccount, () =>
|
18
|
+
return coValuesCache.get(rawAccount, () => _a.fromRaw(rawAccount));
|
32
19
|
}
|
33
20
|
return new AnonymousJazzAgent(this._raw.core.node);
|
34
21
|
}
|
@@ -42,8 +29,6 @@ export class Account extends CoValueBase {
|
|
42
29
|
new Ref(rootID, this._loadedAs, this._schema.root),
|
43
30
|
};
|
44
31
|
}
|
45
|
-
isMe;
|
46
|
-
sessionID;
|
47
32
|
constructor(options) {
|
48
33
|
super();
|
49
34
|
if (!("fromRaw" in options)) {
|
@@ -138,6 +123,19 @@ export class Account extends CoValueBase {
|
|
138
123
|
return subscribeToExistingCoValue(this, depth, listener);
|
139
124
|
}
|
140
125
|
}
|
126
|
+
_a = Account;
|
127
|
+
(() => {
|
128
|
+
_a._schema = {
|
129
|
+
profile: {
|
130
|
+
ref: () => Profile,
|
131
|
+
optional: false,
|
132
|
+
},
|
133
|
+
root: {
|
134
|
+
ref: () => CoMap,
|
135
|
+
optional: true,
|
136
|
+
},
|
137
|
+
};
|
138
|
+
})();
|
141
139
|
export const AccountAndGroupProxyHandler = {
|
142
140
|
get(target, key, receiver) {
|
143
141
|
if (key === "profile") {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/coValues/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,SAAS,EAET,UAAU,EAKV,eAAe,GAChB,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,kBAAkB,EAClB,KAAK,EAEL,WAAW,EAIX,KAAK,EAEL,UAAU,EACV,OAAO,EACP,GAAG,EAIH,UAAU,EACV,mBAAmB,EACnB,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,uCAAuC;AACvC,MAAM,OAAO,OAAQ,SAAQ,WAAW;
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/coValues/account.ts"],"names":[],"mappings":";AAAA,OAAO,EAKL,SAAS,EAET,UAAU,EAKV,eAAe,GAChB,MAAM,QAA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C,OAAO,KAAK,EAAE,CAAC;YACnD,MAAM,CAAC,WAA4B,CAAC,OAAO,CAAC,GAAG,CAAC;gBAC/C,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YAC/B,OAAO,IAAI,CAAC;QACd,CAAC;aAAM,CAAC;YACN,OAAO,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;CACF,CAAC;AAEF,uCAAuC;AACvC,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAKlD,OAAO,OAAO,CAAC,IAAI,CAAC;AACtB,CAAC"}
|
@@ -1,20 +1,22 @@
|
|
1
|
+
var _a;
|
1
2
|
import { MAX_RECOMMENDED_TX_SIZE, cojsonInternals } from "cojson";
|
2
3
|
import { Account, CoValueBase, ItemsSym, Ref, SchemaInit, co, ensureCoValueLoaded, inspect, isRefEncoded, loadCoValue, subscribeToCoValue, subscribeToExistingCoValue, } from "../internal.js";
|
4
|
+
/** @deprecated Use CoFeed instead */
|
5
|
+
export { CoFeed as CoStream };
|
3
6
|
/** @category CoValues */
|
4
7
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
5
|
-
export class
|
8
|
+
export class CoFeed extends CoValueBase {
|
6
9
|
static Of(item) {
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
var _b, _c;
|
11
|
+
return _c = class CoFeedOf extends _a {
|
12
|
+
constructor() {
|
13
|
+
super(...arguments);
|
14
|
+
this[_b] = item;
|
15
|
+
}
|
16
|
+
},
|
17
|
+
_b = co.items,
|
18
|
+
_c;
|
13
19
|
}
|
14
|
-
/** @internal This is only a marker type and doesn't exist at runtime */
|
15
|
-
[ItemsSym];
|
16
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
17
|
-
static _schema;
|
18
20
|
get _schema() {
|
19
21
|
return this.constructor._schema;
|
20
22
|
}
|
@@ -26,7 +28,6 @@ export class CoStream extends CoValueBase {
|
|
26
28
|
return undefined;
|
27
29
|
}
|
28
30
|
}
|
29
|
-
perSession;
|
30
31
|
get inCurrentSession() {
|
31
32
|
if (this._loadedAs._type === "Account") {
|
32
33
|
return this.perSession[this._loadedAs.sessionID];
|
@@ -124,6 +125,10 @@ export class CoStream extends CoValueBase {
|
|
124
125
|
return subscribeToExistingCoValue(this, depth, listener);
|
125
126
|
}
|
126
127
|
}
|
128
|
+
_a = CoFeed;
|
129
|
+
(() => {
|
130
|
+
_a.prototype._type = "CoStream";
|
131
|
+
})();
|
127
132
|
function entryFromRawEntry(accessFrom, rawEntry, loadedAs, accountID, itemField) {
|
128
133
|
return {
|
129
134
|
get value() {
|
@@ -284,8 +289,10 @@ const CoStreamPerSessionProxyHandler = (innerTarget, accessFrom) => ({
|
|
284
289
|
}
|
285
290
|
},
|
286
291
|
});
|
292
|
+
/** @deprecated Use CoFeed instead */
|
293
|
+
export { FileStream as BinaryCoStream };
|
287
294
|
/** @category CoValues */
|
288
|
-
export class
|
295
|
+
export class FileStream extends CoValueBase {
|
289
296
|
constructor(options) {
|
290
297
|
super();
|
291
298
|
let raw;
|
@@ -405,4 +412,4 @@ export class BinaryCoStream extends CoValueBase {
|
|
405
412
|
return subscribeToExistingCoValue(this, depth, listener);
|
406
413
|
}
|
407
414
|
}
|
408
|
-
//# sourceMappingURL=
|
415
|
+
//# sourceMappingURL=coFeed.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"coFeed.js","sourceRoot":"","sources":["../../../src/coValues/coFeed.ts"],"names":[],"mappings":";AAWA,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAclE,OAAO,EACL,OAAO,EACP,WAAW,EACX,QAAQ,EACR,GAAG,EACH,UAAU,EACV,EAAE,EACF,mBAAmB,EACnB,OAAO,EACP,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AAoB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0B;QAE1B,OAAO,WAAW,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,uCAAuC;IACvC,MAAM,CAAC,SAAS,CAEd,EAAS,EACT,EAAW,EACX,KAA0B,EAC1B,QAAiD;QAEjD,OAAO,kBAAkB,CAAW,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IACrE,CAAC;IAED,uCAAuC;IACvC,YAAY,CAEV,KAA0B;QAE1B,OAAO,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,uCAAuC;IACvC,SAAS,CAEP,KAA0B,EAC1B,QAAiD;QAEjD,OAAO,0BAA0B,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC3D,CAAC;CACF"}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
var _a;
|
1
2
|
import { RawAccount } from "cojson";
|
2
3
|
import { Account, AnonymousJazzAgent, Group, ItemsSym, Ref, SchemaInit, co, ensureCoValueLoaded, inspect, isRefEncoded, loadCoValue, makeRefs, subscribeToCoValue, subscribeToExistingCoValue, subscriptionsScopes, } from "../internal.js";
|
3
4
|
import { coValuesCache } from "../lib/cache.js";
|
@@ -36,10 +37,16 @@ export class CoList extends Array {
|
|
36
37
|
* @category Declaration
|
37
38
|
*/
|
38
39
|
static Of(item) {
|
40
|
+
var _b, _c;
|
39
41
|
// TODO: cache superclass for item class
|
40
|
-
return class CoListOf extends
|
41
|
-
|
42
|
-
|
42
|
+
return _c = class CoListOf extends _a {
|
43
|
+
constructor() {
|
44
|
+
super(...arguments);
|
45
|
+
this[_b] = item;
|
46
|
+
}
|
47
|
+
},
|
48
|
+
_b = co.items,
|
49
|
+
_c;
|
43
50
|
}
|
44
51
|
/**
|
45
52
|
* @ignore
|
@@ -47,14 +54,6 @@ export class CoList extends Array {
|
|
47
54
|
static of(..._args) {
|
48
55
|
throw new Error("Can't use Array.of with CoLists");
|
49
56
|
}
|
50
|
-
static {
|
51
|
-
this.prototype._type = "CoList";
|
52
|
-
}
|
53
|
-
/** @internal This is only a marker type and doesn't exist at runtime */
|
54
|
-
[ItemsSym];
|
55
|
-
/** @internal */
|
56
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
57
|
-
static _schema;
|
58
57
|
/** @internal */
|
59
58
|
get _schema() {
|
60
59
|
return this.constructor._schema;
|
@@ -223,7 +222,7 @@ export class CoList extends Array {
|
|
223
222
|
*
|
224
223
|
* You can pass `[]` or for shallowly loading only this CoList, or `[itemDepth]` for recursively loading referenced CoValues.
|
225
224
|
*
|
226
|
-
* Check out the `load` methods on `CoMap`/`CoList`/`
|
225
|
+
* Check out the `load` methods on `CoMap`/`CoList`/`CoFeed`/`Group`/`Account` to see which depth structures are valid to nest.
|
227
226
|
*
|
228
227
|
* @example
|
229
228
|
* ```ts
|
@@ -250,7 +249,7 @@ export class CoList extends Array {
|
|
250
249
|
*
|
251
250
|
* You can pass `[]` or for shallowly loading only this CoList, or `[itemDepth]` for recursively loading referenced CoValues.
|
252
251
|
*
|
253
|
-
* Check out the `load` methods on `CoMap`/`CoList`/`
|
252
|
+
* Check out the `load` methods on `CoMap`/`CoList`/`CoFeed`/`Group`/`Account` to see which depth structures are valid to nest.
|
254
253
|
*
|
255
254
|
* Returns an unsubscribe function that you should call when you no longer need updates.
|
256
255
|
*
|
@@ -303,6 +302,10 @@ export class CoList extends Array {
|
|
303
302
|
return casted;
|
304
303
|
}
|
305
304
|
}
|
305
|
+
_a = CoList;
|
306
|
+
(() => {
|
307
|
+
_a.prototype._type = "CoList";
|
308
|
+
})();
|
306
309
|
function toRawItems(items, itemDescriptor) {
|
307
310
|
const rawItems = itemDescriptor === "json"
|
308
311
|
? items
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"coList.js","sourceRoot":"","sources":["../../../src/coValues/coList.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,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AAC,UAAU,CAAC,CAAC;YAC/B,OAAO,IAAI,CAAC;QACd,CAAC;aAAM,CAAC;YACN,OAAO,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;IACD,GAAG,CAAC,MAAM,EAAE,GAAG;QACb,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5C,OAAO,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC;QACpD,CAAC;aAAM,CAAC;YACN,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;CACF,CAAC"}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
var _a;
|
1
2
|
import { cojsonInternals, } from "cojson";
|
2
3
|
import { Account, CoValueBase, ItemsSym, Ref, SchemaInit, ensureCoValueLoaded, inspect, isRefEncoded, loadCoValue, makeRefs, subscribeToCoValue, subscribeToExistingCoValue, subscriptionsScopes, } from "../internal.js";
|
3
4
|
/**
|
@@ -34,12 +35,6 @@ import { Account, CoValueBase, ItemsSym, Ref, SchemaInit, ensureCoValueLoaded, i
|
|
34
35
|
* @category CoValues
|
35
36
|
* */
|
36
37
|
export class CoMap extends CoValueBase {
|
37
|
-
static {
|
38
|
-
this.prototype._type = "CoMap";
|
39
|
-
}
|
40
|
-
/** @internal */
|
41
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
42
|
-
static _schema;
|
43
38
|
/** @internal */
|
44
39
|
get _schema() {
|
45
40
|
return this.constructor._schema;
|
@@ -231,10 +226,15 @@ export class CoMap extends CoValueBase {
|
|
231
226
|
* @category Declaration
|
232
227
|
*/
|
233
228
|
static Record(value) {
|
229
|
+
var _b;
|
234
230
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
|
235
|
-
class RecordLikeCoMap extends
|
236
|
-
|
231
|
+
class RecordLikeCoMap extends _a {
|
232
|
+
constructor() {
|
233
|
+
super(...arguments);
|
234
|
+
this[_b] = value;
|
235
|
+
}
|
237
236
|
}
|
237
|
+
_b = ItemsSym;
|
238
238
|
return RecordLikeCoMap;
|
239
239
|
}
|
240
240
|
/**
|
@@ -245,7 +245,7 @@ export class CoMap extends CoValueBase {
|
|
245
245
|
*
|
246
246
|
* You can pass `[]` or `{}` for shallowly loading only this CoMap, or `{ fieldA: depthA, fieldB: depthB }` for recursively loading referenced CoValues.
|
247
247
|
*
|
248
|
-
* Check out the `load` methods on `CoMap`/`CoList`/`
|
248
|
+
* Check out the `load` methods on `CoMap`/`CoList`/`CoFeed`/`Group`/`Account` to see which depth structures are valid to nest.
|
249
249
|
*
|
250
250
|
* @example
|
251
251
|
* ```ts
|
@@ -271,7 +271,7 @@ export class CoMap extends CoValueBase {
|
|
271
271
|
*
|
272
272
|
* You can pass `[]` or `{}` for shallowly loading only this CoMap, or `{ fieldA: depthA, fieldB: depthB }` for recursively loading referenced CoValues.
|
273
273
|
*
|
274
|
-
* Check out the `load` methods on `CoMap`/`CoList`/`
|
274
|
+
* Check out the `load` methods on `CoMap`/`CoList`/`CoFeed`/`Group`/`Account` to see which depth structures are valid to nest.
|
275
275
|
*
|
276
276
|
* Returns an unsubscribe function that you should call when you no longer need updates.
|
277
277
|
*
|
@@ -356,6 +356,10 @@ export class CoMap extends CoValueBase {
|
|
356
356
|
return this;
|
357
357
|
}
|
358
358
|
}
|
359
|
+
_a = CoMap;
|
360
|
+
(() => {
|
361
|
+
_a.prototype._type = "CoMap";
|
362
|
+
})();
|
359
363
|
// TODO: cache handlers per descriptor for performance?
|
360
364
|
const CoMapProxyHandler = {
|
361
365
|
get(target, key, receiver) {
|