jazz-tools 0.7.0-alpha.0 → 0.7.0-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.cjs +8 -1
- package/CHANGELOG.md +8 -0
- package/dist/coValues/account.js +138 -0
- package/dist/coValues/account.js.map +1 -0
- package/dist/coValues/coList.js +196 -0
- package/dist/coValues/coList.js.map +1 -0
- package/dist/coValues/coMap.js +249 -0
- package/dist/coValues/coMap.js.map +1 -0
- package/dist/coValues/coStream.js +189 -0
- package/dist/coValues/coStream.js.map +1 -0
- package/dist/coValues/extensions/imageDef.js +17 -12
- package/dist/coValues/extensions/imageDef.js.map +1 -1
- package/dist/coValues/group.js +96 -0
- package/dist/coValues/group.js.map +1 -0
- package/dist/coValues/interfaces.js +58 -0
- package/dist/coValues/interfaces.js.map +1 -0
- package/dist/implementation/errors.js.map +1 -0
- package/dist/implementation/inspect.js +2 -0
- package/dist/implementation/inspect.js.map +1 -0
- package/dist/{refs.js → implementation/refs.js} +11 -13
- package/dist/implementation/refs.js.map +1 -0
- package/dist/implementation/schema.js +6 -0
- package/dist/implementation/schema.js.map +1 -0
- package/dist/{subscriptionScope.js → implementation/subscriptionScope.js} +1 -1
- package/dist/implementation/subscriptionScope.js.map +1 -0
- package/dist/index.js +23 -27
- package/dist/index.js.map +1 -1
- package/dist/internal.js +13 -0
- package/dist/internal.js.map +1 -0
- package/dist/tests/coList.test.js +26 -22
- package/dist/tests/coList.test.js.map +1 -1
- package/dist/tests/coMap.test.js +91 -43
- package/dist/tests/coMap.test.js.map +1 -1
- package/dist/tests/coStream.test.js +35 -24
- package/dist/tests/coStream.test.js.map +1 -1
- package/package.json +11 -4
- package/src/coValues/account.ts +297 -0
- package/src/coValues/coList.ts +320 -0
- package/src/coValues/coMap.ts +447 -0
- package/src/coValues/coStream.ts +325 -0
- package/src/coValues/extensions/imageDef.ts +24 -16
- package/src/coValues/group.ts +187 -0
- package/src/coValues/interfaces.ts +216 -0
- package/src/implementation/inspect.ts +2 -0
- package/src/{refs.ts → implementation/refs.ts} +21 -32
- package/src/implementation/schema.ts +69 -0
- package/src/{subscriptionScope.ts → implementation/subscriptionScope.ts} +11 -13
- package/src/index.ts +22 -50
- package/src/internal.ts +15 -0
- package/src/tests/coList.test.ts +27 -25
- package/src/tests/coMap.test.ts +125 -50
- package/src/tests/coStream.test.ts +51 -38
- package/dist/coValueInterfaces.js +0 -8
- package/dist/coValueInterfaces.js.map +0 -1
- package/dist/coValues/account/account.js +0 -11
- package/dist/coValues/account/account.js.map +0 -1
- package/dist/coValues/account/accountOf.js +0 -150
- package/dist/coValues/account/accountOf.js.map +0 -1
- package/dist/coValues/account/migration.js +0 -4
- package/dist/coValues/account/migration.js.map +0 -1
- package/dist/coValues/coList/coList.js +0 -2
- package/dist/coValues/coList/coList.js.map +0 -1
- package/dist/coValues/coList/coListOf.js +0 -235
- package/dist/coValues/coList/coListOf.js.map +0 -1
- package/dist/coValues/coList/internalDocs.js +0 -2
- package/dist/coValues/coList/internalDocs.js.map +0 -1
- package/dist/coValues/coMap/coMap.js +0 -2
- package/dist/coValues/coMap/coMap.js.map +0 -1
- package/dist/coValues/coMap/coMapOf.js +0 -262
- package/dist/coValues/coMap/coMapOf.js.map +0 -1
- package/dist/coValues/coMap/internalDocs.js +0 -2
- package/dist/coValues/coMap/internalDocs.js.map +0 -1
- package/dist/coValues/coStream/coStream.js +0 -2
- package/dist/coValues/coStream/coStream.js.map +0 -1
- package/dist/coValues/coStream/coStreamOf.js +0 -244
- package/dist/coValues/coStream/coStreamOf.js.map +0 -1
- package/dist/coValues/construction.js +0 -34
- package/dist/coValues/construction.js.map +0 -1
- package/dist/coValues/group/group.js +0 -2
- package/dist/coValues/group/group.js.map +0 -1
- package/dist/coValues/group/groupOf.js +0 -109
- package/dist/coValues/group/groupOf.js.map +0 -1
- package/dist/coValues/resolution.js +0 -66
- package/dist/coValues/resolution.js.map +0 -1
- package/dist/errors.js.map +0 -1
- package/dist/refs.js.map +0 -1
- package/dist/schemaHelpers.js +0 -14
- package/dist/schemaHelpers.js.map +0 -1
- package/dist/subscriptionScope.js.map +0 -1
- package/dist/tests/types.test.js +0 -33
- package/dist/tests/types.test.js.map +0 -1
- package/src/coValueInterfaces.ts +0 -105
- package/src/coValues/account/account.ts +0 -106
- package/src/coValues/account/accountOf.ts +0 -284
- package/src/coValues/account/migration.ts +0 -12
- package/src/coValues/coList/coList.ts +0 -57
- package/src/coValues/coList/coListOf.ts +0 -377
- package/src/coValues/coList/internalDocs.ts +0 -1
- package/src/coValues/coMap/coMap.ts +0 -110
- package/src/coValues/coMap/coMapOf.ts +0 -451
- package/src/coValues/coMap/internalDocs.ts +0 -1
- package/src/coValues/coStream/coStream.ts +0 -63
- package/src/coValues/coStream/coStreamOf.ts +0 -404
- package/src/coValues/construction.ts +0 -110
- package/src/coValues/group/group.ts +0 -27
- package/src/coValues/group/groupOf.ts +0 -183
- package/src/coValues/resolution.ts +0 -111
- package/src/schemaHelpers.ts +0 -72
- package/src/tests/types.test.ts +0 -37
- /package/dist/{errors.js → implementation/errors.js} +0 -0
- /package/src/{errors.ts → implementation/errors.ts} +0 -0
@@ -0,0 +1,189 @@
|
|
1
|
+
var _a;
|
2
|
+
import { cojsonInternals } from "cojson";
|
3
|
+
import { Account, CoValueBase, ValueRef, inspect } from "../internal.js";
|
4
|
+
import { Schema } from "@effect/schema";
|
5
|
+
export class CoStream extends CoValueBase {
|
6
|
+
get _schema() {
|
7
|
+
return this.constructor._schema;
|
8
|
+
}
|
9
|
+
get byMe() {
|
10
|
+
return this.by[this._loadedAs.id];
|
11
|
+
}
|
12
|
+
get inCurrentSession() {
|
13
|
+
return this.in[this._loadedAs.sessionID];
|
14
|
+
}
|
15
|
+
constructor(init, options) {
|
16
|
+
super();
|
17
|
+
this.by = {};
|
18
|
+
this.in = {};
|
19
|
+
let raw;
|
20
|
+
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._schema._item);
|
49
|
+
},
|
50
|
+
configurable: true,
|
51
|
+
enumerable: true,
|
52
|
+
});
|
53
|
+
}
|
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._schema._item);
|
64
|
+
},
|
65
|
+
configurable: true,
|
66
|
+
enumerable: true,
|
67
|
+
});
|
68
|
+
}
|
69
|
+
}
|
70
|
+
push(...items) {
|
71
|
+
for (const item of items) {
|
72
|
+
this.pushItem(item);
|
73
|
+
}
|
74
|
+
this.updateEntries();
|
75
|
+
}
|
76
|
+
pushItem(item) {
|
77
|
+
const itemDescriptor = this._schema._item;
|
78
|
+
if (itemDescriptor === "json") {
|
79
|
+
this._raw.push(item);
|
80
|
+
}
|
81
|
+
else if ("encoded" in itemDescriptor) {
|
82
|
+
this._raw.push(Schema.encodeSync(itemDescriptor.encoded)(item));
|
83
|
+
}
|
84
|
+
else if ("ref" in itemDescriptor) {
|
85
|
+
this._raw.push(item.id);
|
86
|
+
}
|
87
|
+
}
|
88
|
+
toJSON() {
|
89
|
+
const itemDescriptor = this._schema._item;
|
90
|
+
const mapper = itemDescriptor === "json"
|
91
|
+
? (v) => v
|
92
|
+
: "encoded" in itemDescriptor
|
93
|
+
? Schema.encodeSync(itemDescriptor.encoded)
|
94
|
+
: (v) => v && v.id;
|
95
|
+
return {
|
96
|
+
id: this.id,
|
97
|
+
_type: this._type,
|
98
|
+
by: Object.fromEntries(Object.entries(this.by).map(([account, entry]) => [
|
99
|
+
account,
|
100
|
+
mapper(entry.value),
|
101
|
+
])),
|
102
|
+
in: Object.fromEntries(Object.entries(this.in).map(([session, entry]) => [
|
103
|
+
session,
|
104
|
+
mapper(entry.value),
|
105
|
+
])),
|
106
|
+
};
|
107
|
+
}
|
108
|
+
[inspect]() {
|
109
|
+
return this.toJSON();
|
110
|
+
}
|
111
|
+
static encoding(def) {
|
112
|
+
this._schema || (this._schema = {});
|
113
|
+
Object.assign(this._schema, def);
|
114
|
+
}
|
115
|
+
}
|
116
|
+
_a = CoStream;
|
117
|
+
(() => {
|
118
|
+
_a.prototype._type = "CoStream";
|
119
|
+
})();
|
120
|
+
function entryFromRawEntry(accessFrom, rawEntry, loadedAs, accountID, itemField) {
|
121
|
+
return {
|
122
|
+
get value() {
|
123
|
+
if (itemField === "json") {
|
124
|
+
return rawEntry.value;
|
125
|
+
}
|
126
|
+
else if ("encoded" in itemField) {
|
127
|
+
return Schema.decodeSync(itemField.encoded)(rawEntry.value);
|
128
|
+
}
|
129
|
+
else if ("ref" in itemField) {
|
130
|
+
return this.ref?.accessFrom(accessFrom);
|
131
|
+
}
|
132
|
+
},
|
133
|
+
get ref() {
|
134
|
+
if (itemField !== "json" && "ref" in itemField) {
|
135
|
+
const rawId = rawEntry.value;
|
136
|
+
return new ValueRef(rawId, loadedAs, itemField.ref());
|
137
|
+
}
|
138
|
+
},
|
139
|
+
get by() {
|
140
|
+
return (accountID &&
|
141
|
+
new ValueRef(accountID, loadedAs, Account)?.accessFrom(accessFrom));
|
142
|
+
},
|
143
|
+
madeAt: rawEntry.at,
|
144
|
+
tx: rawEntry.tx,
|
145
|
+
};
|
146
|
+
}
|
147
|
+
export class BinaryCoStream extends CoValueBase {
|
148
|
+
constructor(init, options) {
|
149
|
+
super();
|
150
|
+
let raw;
|
151
|
+
if ("fromRaw" in options) {
|
152
|
+
raw = options.fromRaw;
|
153
|
+
}
|
154
|
+
else {
|
155
|
+
const rawOwner = options.owner._raw;
|
156
|
+
raw = rawOwner.createBinaryStream();
|
157
|
+
}
|
158
|
+
Object.defineProperties(this, {
|
159
|
+
id: {
|
160
|
+
value: raw.id,
|
161
|
+
enumerable: false,
|
162
|
+
},
|
163
|
+
_raw: { value: raw, enumerable: false },
|
164
|
+
});
|
165
|
+
}
|
166
|
+
getChunks(options) {
|
167
|
+
return this._raw.getBinaryChunks(options?.allowUnfinished);
|
168
|
+
}
|
169
|
+
start(options) {
|
170
|
+
this._raw.startBinaryStream(options);
|
171
|
+
}
|
172
|
+
push(data) {
|
173
|
+
this._raw.pushBinaryStreamChunk(data);
|
174
|
+
}
|
175
|
+
end() {
|
176
|
+
this._raw.endBinaryStream();
|
177
|
+
}
|
178
|
+
toJSON() {
|
179
|
+
return {
|
180
|
+
id: this.id,
|
181
|
+
_type: this._type,
|
182
|
+
...this.getChunks(),
|
183
|
+
};
|
184
|
+
}
|
185
|
+
[inspect]() {
|
186
|
+
return this.toJSON();
|
187
|
+
}
|
188
|
+
}
|
189
|
+
//# sourceMappingURL=coStream.js.map
|
@@ -0,0 +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,W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C3B,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,CAAC,IAAgB;QACjB,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;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,15 +1,7 @@
|
|
1
|
-
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
export class ImageDefinition extends CoMapOf({
|
6
|
-
originalSize: S.tuple(S.number, S.number),
|
7
|
-
placeholderDataURL: S.optional(S.string),
|
8
|
-
}, {
|
9
|
-
key: S.templateLiteral(S.string, S.literal("x"), S.string),
|
10
|
-
value: BinaryCoStreamImpl,
|
11
|
-
}).as() {
|
12
|
-
get highestResAvailable() {
|
1
|
+
var _a;
|
2
|
+
import { BinaryCoStream, CoMap, indexSignature, subscriptionsScopes } from '../../internal.js';
|
3
|
+
export class ImageDefinition extends CoMap {
|
4
|
+
get _highestResAvailable() {
|
13
5
|
if (!subscriptionsScopes.get(this)) {
|
14
6
|
console.warn("highestResAvailable() only makes sense when used within a subscription.");
|
15
7
|
}
|
@@ -31,6 +23,19 @@ export class ImageDefinition extends CoMapOf({
|
|
31
23
|
});
|
32
24
|
}
|
33
25
|
}
|
26
|
+
return (highestAvailableResolution && {
|
27
|
+
res: highestAvailableResolution,
|
28
|
+
stream: this[highestAvailableResolution],
|
29
|
+
});
|
34
30
|
}
|
35
31
|
}
|
32
|
+
_a = ImageDefinition;
|
33
|
+
(() => {
|
34
|
+
_a.prototype._schema;
|
35
|
+
_a.encoding({
|
36
|
+
originalSize: "json",
|
37
|
+
placeholderDataURL: "json",
|
38
|
+
[indexSignature]: { ref: () => BinaryCoStream },
|
39
|
+
});
|
40
|
+
})();
|
36
41
|
//# sourceMappingURL=imageDef.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"imageDef.js","sourceRoot":"","sources":["../../../src/coValues/extensions/imageDef.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"imageDef.js","sourceRoot":"","sources":["../../../src/coValues/extensions/imageDef.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAE9F,MAAM,OAAO,eAAgB,SAAQ,KAAsB;IAgBvD,IAAI,oBAAoB;QAGpB,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACjC,OAAO,CAAC,IAAI,CACR,yEAAyE,CAC5E,CAAC;QACN,CAAC;QAED,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CACjD,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CACE,CAAC;QAE7B,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACtB,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,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;;AAjDG;IACI,GAAK,SAAS,CAAC,OAAO,CAAA;IACtB,GAAK,QAAQ,CAAC;QACV,YAAY,EAAE,MAAM;QACpB,kBAAkB,EAAE,MAAM;QAC1B,CAAC,cAAc,CAAC,EAAE,EAAC,GAAG,EAAE,GAAG,EAAE,CAAC,cAAc,EAAC;KAChD,CAAC,CAAA;AACN,CAAC,GAAA,CAAA"}
|
@@ -0,0 +1,96 @@
|
|
1
|
+
var _a, _b;
|
2
|
+
import { Account, CoMap, CoValueBase, ValueRef, isControlledAccount, } from "../internal.js";
|
3
|
+
export class Profile extends CoMap {
|
4
|
+
}
|
5
|
+
_a = Profile;
|
6
|
+
(() => {
|
7
|
+
_a.encoding({ name: "json" });
|
8
|
+
})();
|
9
|
+
export class Group extends CoValueBase {
|
10
|
+
get _schema() {
|
11
|
+
return this.constructor._schema;
|
12
|
+
}
|
13
|
+
get _refs() {
|
14
|
+
const profileID = this._raw.get("profile");
|
15
|
+
const rootID = this._raw.get("root");
|
16
|
+
return {
|
17
|
+
profile: profileID &&
|
18
|
+
new ValueRef(profileID, this._loadedAs, this._schema.profile.ref()),
|
19
|
+
root: rootID &&
|
20
|
+
new ValueRef(rootID, this._loadedAs, this._schema.root.ref()),
|
21
|
+
};
|
22
|
+
}
|
23
|
+
constructor(init, options) {
|
24
|
+
super();
|
25
|
+
let raw;
|
26
|
+
if (options && "fromRaw" in options) {
|
27
|
+
raw = options.fromRaw;
|
28
|
+
}
|
29
|
+
else {
|
30
|
+
const initOwner = options?.owner || init?.owner;
|
31
|
+
if (!initOwner)
|
32
|
+
throw new Error("No owner provided");
|
33
|
+
if (initOwner instanceof Account &&
|
34
|
+
isControlledAccount(initOwner)) {
|
35
|
+
const rawOwner = initOwner._raw;
|
36
|
+
raw = rawOwner.createGroup();
|
37
|
+
}
|
38
|
+
else {
|
39
|
+
throw new Error("Can only construct group as a controlled account");
|
40
|
+
}
|
41
|
+
}
|
42
|
+
Object.defineProperties(this, {
|
43
|
+
id: {
|
44
|
+
value: raw.id,
|
45
|
+
enumerable: false,
|
46
|
+
},
|
47
|
+
_raw: { value: raw, enumerable: false },
|
48
|
+
profile: {
|
49
|
+
get: () => {
|
50
|
+
const ref = this._refs.profile;
|
51
|
+
return ref ? ref.accessFrom(this) : undefined;
|
52
|
+
},
|
53
|
+
set: (value) => {
|
54
|
+
if (value) {
|
55
|
+
this._raw.set("profile", value.id);
|
56
|
+
}
|
57
|
+
},
|
58
|
+
},
|
59
|
+
root: {
|
60
|
+
get: () => {
|
61
|
+
const ref = this._refs.root;
|
62
|
+
return ref ? ref.accessFrom(this) : undefined;
|
63
|
+
},
|
64
|
+
set: (value) => {
|
65
|
+
if (value) {
|
66
|
+
this._raw.set("root", value.id);
|
67
|
+
}
|
68
|
+
},
|
69
|
+
},
|
70
|
+
});
|
71
|
+
}
|
72
|
+
myRole() {
|
73
|
+
return this._raw.myRole();
|
74
|
+
}
|
75
|
+
addMember(member, role) {
|
76
|
+
this._raw.addMember(member === "everyone" ? member : member._raw, role);
|
77
|
+
}
|
78
|
+
static define(fields) {
|
79
|
+
this._schema || (this._schema = {});
|
80
|
+
Object.assign(this._schema, fields);
|
81
|
+
}
|
82
|
+
}
|
83
|
+
_b = Group;
|
84
|
+
(() => {
|
85
|
+
_b.prototype._type = "Group";
|
86
|
+
})();
|
87
|
+
(() => {
|
88
|
+
_b._schema = {
|
89
|
+
profile: { json: true },
|
90
|
+
root: { json: true },
|
91
|
+
};
|
92
|
+
Object.defineProperty(_b.prototype, "_schema", {
|
93
|
+
get: () => _b._schema,
|
94
|
+
});
|
95
|
+
})();
|
96
|
+
//# sourceMappingURL=group.js.map
|
@@ -0,0 +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;CAMnD;;AAHG;IACI,GAAK,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAS,CAAC,CAAC;AAC3C,CAAC,GAAA,CAAA;AAGL,MAAM,OAAO,KAMT,SAAQ,WAAW;IAWnB,IAAI,OAAO;QAQP,OAAQ,IAAI,CAAC,WAA4B,CAAC,OAAO,CAAC;IACtD,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,OAAO,CAAC,OAGhB,CAAC,GAAG,EAAE,CACF;YACb,IAAI,EACA,MAAM;gBACL,IAAI,QAAQ,CACT,MAAM,EACN,IAAI,CAAC,SAAS,EAEV,IAAI,CAAC,OAAO,CAAC,IAChB,CAAC,GAAG,EAAE,CACF;SAChB,CAAC;IACN,CAAC;IAKD,YACI,IAA4C,EAC5C,OAA4D;QAE5D,KAAK,EAAE,CAAC;QACR,IAAI,GAAa,CA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1
|
+
import { Effect, Sink, Stream } from "effect";
|
2
|
+
import { RawAccount } from "cojson";
|
3
|
+
import { Account, AccountCtx, Group, SubscriptionScope, ValueRef, inspect, } from "../internal.js";
|
4
|
+
export function isCoValue(value) {
|
5
|
+
return value && value._type !== undefined;
|
6
|
+
}
|
7
|
+
export class CoValueBase {
|
8
|
+
get _owner() {
|
9
|
+
return this._raw.group instanceof RawAccount
|
10
|
+
? Account.fromRaw(this._raw.group)
|
11
|
+
: Group.fromRaw(this._raw.group);
|
12
|
+
}
|
13
|
+
get _loadedAs() {
|
14
|
+
return Account.fromNode(this._raw.core.node);
|
15
|
+
}
|
16
|
+
constructor(..._args) { }
|
17
|
+
static fromRaw(raw) {
|
18
|
+
return new this(undefined, { fromRaw: raw });
|
19
|
+
}
|
20
|
+
static loadEf(id) {
|
21
|
+
return Effect.gen(this, function* (_) {
|
22
|
+
const account = yield* _(AccountCtx);
|
23
|
+
return yield* _(new ValueRef(id, account, this).loadEf());
|
24
|
+
});
|
25
|
+
}
|
26
|
+
static load(id, options) {
|
27
|
+
return new ValueRef(id, options.as, this).load(options?.onProgress && { onProgress: options.onProgress });
|
28
|
+
}
|
29
|
+
static subscribe(id, options, onUpdate) {
|
30
|
+
void Effect.runPromise(Effect.provideService(this.subscribeEf(id).pipe(Stream.run(Sink.forEach((update) => Effect.sync(() => onUpdate(update))))), AccountCtx, options.as));
|
31
|
+
return function unsubscribe() { };
|
32
|
+
}
|
33
|
+
static subscribeEf(id) {
|
34
|
+
return Stream.fromEffect(this.loadEf(id)).pipe(Stream.flatMap((value) => Stream.asyncScoped((emit) => Effect.gen(this, function* (_) {
|
35
|
+
const subscription = new SubscriptionScope(value, this, (update) => {
|
36
|
+
void emit.single(update);
|
37
|
+
});
|
38
|
+
yield* _(Effect.addFinalizer(() => Effect.sync(() => subscription.unsubscribeAll())));
|
39
|
+
}))));
|
40
|
+
}
|
41
|
+
subscribe(listener) {
|
42
|
+
return this.constructor.subscribe(this.id, { as: this._loadedAs }, listener);
|
43
|
+
}
|
44
|
+
subscribeEf() {
|
45
|
+
return Stream.provideService(this.constructor.subscribeEf(this.id), AccountCtx, this._loadedAs);
|
46
|
+
}
|
47
|
+
toJSON() {
|
48
|
+
return {
|
49
|
+
id: this.id,
|
50
|
+
type: this._type,
|
51
|
+
error: "unknown CoValue class",
|
52
|
+
};
|
53
|
+
}
|
54
|
+
[inspect]() {
|
55
|
+
return this.toJSON();
|
56
|
+
}
|
57
|
+
}
|
58
|
+
//# sourceMappingURL=interfaces.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/coValues/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EACH,OAAO,EACP,UAAU,EACV,KAAK,EACL,iBAAiB,EACjB,QAAQ,EACR,OAAO,GACV,MAAM,gBAAgB,CAAC;AAqExB,MAAM,UAAU,SAAS,CAAC,KAAU;IAChC,OAAO,KAAK,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC;AAC9C,CAAC;AAOD,MAAM,OAAO,WAAW;IAKpB,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,YAAY,UAAU;YACxC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;YAClC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,SAAS;QACT,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IAED,YAAY,GAAG,KAAU,IAAG,CAAC;IAE7B,MAAM,CAAC,OAAO,CAEV,GAAe;Q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ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"inspect.js","sourceRoot":"","sources":["../../src/implementation/inspect.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC"}
|
@@ -1,11 +1,10 @@
|
|
1
1
|
import { Effect } from "effect";
|
2
|
-
import {
|
3
|
-
import { subscriptionsScopes } from "./subscriptionScope.js";
|
2
|
+
import { subscriptionsScopes } from '../internal.js';
|
4
3
|
export class ValueRef {
|
5
|
-
constructor(id, controlledAccount,
|
4
|
+
constructor(id, controlledAccount, valueConstructor) {
|
6
5
|
this.id = id;
|
7
6
|
this.controlledAccount = controlledAccount;
|
8
|
-
this.
|
7
|
+
this.valueConstructor = valueConstructor;
|
9
8
|
}
|
10
9
|
get value() {
|
11
10
|
if (this.cachedValue)
|
@@ -13,14 +12,13 @@ export class ValueRef {
|
|
13
12
|
// TODO: cache it for object identity!!!
|
14
13
|
const raw = this.controlledAccount._raw.core.node.getLoaded(this.id);
|
15
14
|
if (raw) {
|
16
|
-
const
|
17
|
-
if (!Constructor) {
|
18
|
-
throw new Error("Couldn't extract CoValue constructor from property definition");
|
19
|
-
}
|
20
|
-
const value = new Constructor(undefined, { fromRaw: raw });
|
15
|
+
const value = new this.valueConstructor(undefined, { fromRaw: raw });
|
21
16
|
this.cachedValue = value;
|
22
17
|
return value;
|
23
18
|
}
|
19
|
+
else {
|
20
|
+
return null;
|
21
|
+
}
|
24
22
|
}
|
25
23
|
loadEf() {
|
26
24
|
return Effect.async((fulfill) => {
|
@@ -44,7 +42,7 @@ export class ValueRef {
|
|
44
42
|
return "unavailable";
|
45
43
|
}
|
46
44
|
else {
|
47
|
-
return new ValueRef(this.id, this.controlledAccount, this.
|
45
|
+
return new ValueRef(this.id, this.controlledAccount, this.valueConstructor)
|
48
46
|
.value;
|
49
47
|
}
|
50
48
|
}
|
@@ -66,14 +64,14 @@ export class ValueRef {
|
|
66
64
|
return this.value;
|
67
65
|
}
|
68
66
|
}
|
69
|
-
export function makeRefs(getIdForKey, getKeysWithIds, controlledAccount,
|
67
|
+
export function makeRefs(getIdForKey, getKeysWithIds, controlledAccount, valueConstructorForKey) {
|
70
68
|
const refs = {};
|
71
69
|
return new Proxy(refs, {
|
72
70
|
get(target, key) {
|
73
71
|
if (key === Symbol.iterator) {
|
74
72
|
return function* () {
|
75
73
|
for (const key of getKeysWithIds()) {
|
76
|
-
yield new ValueRef(getIdForKey(key), controlledAccount,
|
74
|
+
yield new ValueRef(getIdForKey(key), controlledAccount, valueConstructorForKey(key));
|
77
75
|
}
|
78
76
|
};
|
79
77
|
}
|
@@ -85,7 +83,7 @@ export function makeRefs(getIdForKey, getKeysWithIds, controlledAccount, propDef
|
|
85
83
|
const id = getIdForKey(key);
|
86
84
|
if (!id)
|
87
85
|
return undefined;
|
88
|
-
return new ValueRef(id, controlledAccount,
|
86
|
+
return new ValueRef(id, controlledAccount, valueConstructorForKey(key));
|
89
87
|
},
|
90
88
|
ownKeys() {
|
91
89
|
return getKeysWithIds().map((key) => key.toString());
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"refs.js","sourceRoot":"","sources":["../../src/implementation/refs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,OAAO,QAAQ;IAGjB,YACa,EAAS,EACT,iBAA+B,EAC/B,gBAA0C;QAF1C,OAAE,GAAF,EAAE,CAAO;QACT,sBAAiB,GAAjB,iBAAiB,CAAc;QAC/B,qBAAgB,GAAhB,gBAAgB,CAA0B;IACpD,CAAC;IAEJ,IAAI,KAAK;QACL,IAAI,IAAI,CAAC,WAAW;YAAE,OAAO,IAAI,CAAC,WAAW,CAAC;QAC9C,wCAAwC;QACxC,MAAM,GAAG,GAAG,IAAI,CAAC,iBAAiB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AAG,KAAK,QAAQ;gBAAE,OAAO,SAAS,CAAC;YAC9C,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;gBACnB,OAAO,cAAc,EAAE,CAAC,MAAM,CAAC;YACnC,CAAC;YACD,MAAM,EAAE,GAAG,WAAW,CAAC,GAAW,CAAC,CAAC;YACpC,IAAI,CAAC,EAAE;gBAAE,OAAO,SAAS,CAAC;YAC1B,OAAO,IAAI,QAAQ,CACf,EAAiB,EACjB,iBAAiB,EACjB,sBAAsB,CAAC,GAAW,CAAC,CACtC,CAAC;QACN,CAAC;QACD,OAAO;YACH,OAAO,cAAc,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;QACzD,CAAC;KACJ,CAAC,CAAC;AACP,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/implementation/schema.ts"],"names":[],"mappings":"AAkCA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C,MAAM,CAAC,MAAM,QAAQ,GAAG;IACpB,IAAI;CACP,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC"}
|
@@ -42,7 +42,7 @@ export class SubscriptionScope {
|
|
42
42
|
immediatelyUnsub: false,
|
43
43
|
};
|
44
44
|
this.entries.set(accessedOrSetId, loadingEntry);
|
45
|
-
this.subscriber._raw.core.node
|
45
|
+
void this.subscriber._raw.core.node
|
46
46
|
.loadCoValueCore(accessedOrSetId)
|
47
47
|
.then((core) => {
|
48
48
|
if (loadingEntry.state === "loading" &&
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"subscriptionScope.js","sourceRoot":"","sources":["../../src/implementation/subscriptionScope.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,OAAO,EAG3C,CAAC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,CAAC,CAAC,CAAC;QACX,CAAC;IACL,CAAC;IAED,cAAc;QACV,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;YACxC,IAAI,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAC3B,KAAK,CAAC,QAAQ,EAAE,CAAC;YACrB,CAAC;iBAAM,CAAC;gBACJ,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAClC,CAAC;QACL,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;CACJ"}
|
package/dist/index.js
CHANGED
@@ -1,31 +1,27 @@
|
|
1
|
-
|
2
|
-
import {
|
3
|
-
import { CoMapOf } from "./coValues/coMap/coMapOf.js";
|
4
|
-
import { BinaryCoStreamImpl, CoStreamOf, } from "./coValues/coStream/coStreamOf.js";
|
5
|
-
import { ImageDefinition } from "./coValues/extensions/imageDef.js";
|
6
|
-
import { GroupOf } from "./coValues/group/groupOf.js";
|
7
|
-
/** @hidden */
|
8
|
-
export * as S from "@effect/schema/Schema";
|
1
|
+
/* eslint-disable @typescript-eslint/no-namespace */
|
2
|
+
import { BinaryCoStream, CoMap, ImageDefinition, Account as Account_, Group as Group_, CoList, CoStream } from "./internal.js";
|
9
3
|
/** @category Schemas & CoValues - Schema definers */
|
10
|
-
export
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
4
|
+
export var Co;
|
5
|
+
(function (Co) {
|
6
|
+
Co.Map = CoMap;
|
7
|
+
Co.List = CoList;
|
8
|
+
Co.Stream = CoStream;
|
9
|
+
Co.BinaryStream = BinaryCoStream;
|
10
|
+
Co.Account = Account_;
|
11
|
+
Co.Group = Group_;
|
12
|
+
let media;
|
13
|
+
(function (media) {
|
14
|
+
media.ImageDef = ImageDefinition;
|
15
|
+
})(media = Co.media || (Co.media = {}));
|
16
|
+
})(Co || (Co = {}));
|
21
17
|
/** @category Internal types */
|
22
18
|
export { cojsonReady as jazzReady, cojsonInternals, MAX_RECOMMENDED_TX_SIZE, } from "cojson";
|
23
|
-
|
24
|
-
export
|
25
|
-
|
26
|
-
export
|
27
|
-
export {
|
28
|
-
export { Account
|
29
|
-
export {
|
30
|
-
export {
|
19
|
+
export { Encoders } from "./internal.js";
|
20
|
+
export { CoMap, indexSignature } from "./internal.js";
|
21
|
+
export { CoList } from "./internal.js";
|
22
|
+
export { CoStream, BinaryCoStream } from "./internal.js";
|
23
|
+
export { Group, Profile } from "./internal.js";
|
24
|
+
export { Account } from "./internal.js";
|
25
|
+
export { ImageDefinition } from "./internal.js";
|
26
|
+
export { CoValueBase } from "./internal.js";
|
31
27
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,IAAI,QAAQ,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE/H,qDAAqD;AACrD,MAAM,KAAW,EAAE,CAWlB;AAXD,WAAiB,EAAE;IACF,MAAG,GAAG,KAAK,CAAC;IACZ,OAAI,GAAG,MAAM,CAAC;IACd,SAAM,GAAG,QAAQ,CAAC;IAClB,eAAY,GAAG,cAAc,CAAC;IAC9B,UAAO,GAAG,QAAQ,CAAC;IACnB,QAAK,GAAG,MAAM,CAAC;IAC5B,IAAiB,KAAK,CAGrB;IAHD,WAAiB,KAAK;QACL,cAAQ,GAAG,eAAe,CAAC;IAE5C,CAAC,EAHgB,KAAK,GAAL,QAAK,KAAL,QAAK,QAGrB;AACL,CAAC,EAXgB,EAAE,KAAF,EAAE,QAWlB;AAED,+BAA+B;AAC/B,OAAO,EACH,WAAW,IAAI,SAAS,EAMxB,eAAe,EACf,uBAAuB,GAC1B,MAAM,QAAQ,CAAC;AAIhB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAM,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,WAAW,EAAgB,MAAM,eAAe,CAAC"}
|
package/dist/internal.js
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
export * from './implementation/inspect.js';
|
2
|
+
export * from "./coValues/interfaces.js";
|
3
|
+
export * from "./coValues/coMap.js";
|
4
|
+
export * from "./coValues/account.js";
|
5
|
+
export * from "./coValues/coList.js";
|
6
|
+
export * from "./coValues/coStream.js";
|
7
|
+
export * from "./coValues/group.js";
|
8
|
+
export * from "./implementation/errors.js";
|
9
|
+
export * from "./implementation/refs.js";
|
10
|
+
export * from "./implementation/schema.js";
|
11
|
+
export * from "./implementation/subscriptionScope.js";
|
12
|
+
export * from "./coValues/extensions/imageDef.js";
|
13
|
+
//# sourceMappingURL=internal.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AAEzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AAEtD,cAAc,mCAAmC,CAAC"}
|