jazz-tools 0.7.0-alpha.2 → 0.7.0-alpha.21
Sign up to get free protection for your applications and to get access to all the features.
- package/.turbo/turbo-build.log +84 -9
- package/CHANGELOG.md +116 -0
- package/dist/coValues/account.js +66 -33
- package/dist/coValues/account.js.map +1 -1
- package/dist/coValues/coList.js +147 -97
- package/dist/coValues/coList.js.map +1 -1
- package/dist/coValues/coMap.js +151 -164
- package/dist/coValues/coMap.js.map +1 -1
- package/dist/coValues/coStream.js +176 -70
- package/dist/coValues/coStream.js.map +1 -1
- package/dist/coValues/extensions/imageDef.js +13 -8
- package/dist/coValues/extensions/imageDef.js.map +1 -1
- package/dist/coValues/group.js +13 -35
- package/dist/coValues/group.js.map +1 -1
- package/dist/coValues/interfaces.js +6 -3
- package/dist/coValues/interfaces.js.map +1 -1
- package/dist/implementation/refs.js +13 -10
- package/dist/implementation/refs.js.map +1 -1
- package/dist/implementation/schema.js +36 -1
- package/dist/implementation/schema.js.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/tests/coList.test.js +5 -9
- package/dist/tests/coList.test.js.map +1 -1
- package/dist/tests/coMap.test.js +108 -38
- package/dist/tests/coMap.test.js.map +1 -1
- package/dist/tests/coStream.test.js +46 -51
- package/dist/tests/coStream.test.js.map +1 -1
- package/package.json +5 -4
- package/src/coValues/account.ts +98 -68
- package/src/coValues/coList.ts +188 -120
- package/src/coValues/coMap.ts +232 -276
- package/src/coValues/coStream.ts +265 -124
- package/src/coValues/extensions/imageDef.ts +13 -15
- package/src/coValues/group.ts +33 -80
- package/src/coValues/interfaces.ts +12 -10
- package/src/implementation/refs.ts +45 -18
- package/src/implementation/schema.ts +86 -31
- package/src/index.ts +10 -8
- package/src/tests/coList.test.ts +5 -9
- package/src/tests/coMap.test.ts +89 -53
- package/src/tests/coStream.test.ts +61 -66
package/dist/coValues/coMap.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
var _a;
|
2
|
-
import {
|
3
|
-
import { Account, CoValueBase,
|
2
|
+
import { encodeSync, decodeSync } from "@effect/schema/Schema";
|
3
|
+
import { Account, CoValueBase, Ref, SchemaInit, inspect, makeRefs, subscriptionsScopes, ItemsSym, InitValues, isRefEncoded, } from "../internal.js";
|
4
4
|
export class CoMap extends CoValueBase {
|
5
|
-
get
|
6
|
-
return this.constructor.
|
5
|
+
get _schema() {
|
6
|
+
return this.constructor._schema;
|
7
7
|
}
|
8
8
|
get _refs() {
|
9
|
-
return makeRefs((key) => this._raw.get(key), () => Object.keys(this.
|
10
|
-
const schema = this.
|
11
|
-
schema !== "json" &&
|
12
|
-
}), this._loadedAs, (key) => this.
|
9
|
+
return makeRefs((key) => this._raw.get(key), () => Object.keys(this._schema).filter((key) => {
|
10
|
+
const schema = this._schema[key];
|
11
|
+
schema !== "json" && isRefEncoded(schema);
|
12
|
+
}), this._loadedAs, (key) => this._schema[key]);
|
13
13
|
}
|
14
14
|
get _edits() {
|
15
15
|
return new Proxy(this, {
|
@@ -17,18 +17,18 @@ export class CoMap extends CoValueBase {
|
|
17
17
|
const rawEdit = target._raw.lastEditAt(key);
|
18
18
|
if (!rawEdit)
|
19
19
|
return undefined;
|
20
|
-
const descriptor = target.
|
20
|
+
const descriptor = target._schema[key];
|
21
21
|
return {
|
22
22
|
value: descriptor === "json"
|
23
23
|
? rawEdit.value
|
24
24
|
: "encoded" in descriptor
|
25
|
-
?
|
26
|
-
: new
|
27
|
-
ref: descriptor !== "json" &&
|
28
|
-
? new
|
25
|
+
? decodeSync(descriptor.encoded)(rawEdit.value)
|
26
|
+
: new Ref(rawEdit.value, target._loadedAs, descriptor).accessFrom(target),
|
27
|
+
ref: descriptor !== "json" && isRefEncoded(descriptor)
|
28
|
+
? new Ref(rawEdit.value, target._loadedAs, descriptor)
|
29
29
|
: undefined,
|
30
30
|
by: rawEdit.by &&
|
31
|
-
new
|
31
|
+
new Ref(rawEdit.by, target._loadedAs, Account).accessFrom(target),
|
32
32
|
madeAt: rawEdit.at,
|
33
33
|
};
|
34
34
|
},
|
@@ -39,32 +39,34 @@ export class CoMap extends CoValueBase {
|
|
39
39
|
}
|
40
40
|
constructor(init, options) {
|
41
41
|
super();
|
42
|
-
if (
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
if (init && "owner" in options) {
|
43
|
+
this[InitValues] = {
|
44
|
+
init,
|
45
|
+
owner: options.owner,
|
46
|
+
};
|
46
47
|
}
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
48
|
+
else if ("fromRaw" in options) {
|
49
|
+
Object.defineProperties(this, {
|
50
|
+
id: {
|
51
|
+
value: options.fromRaw.id,
|
52
|
+
enumerable: false,
|
53
|
+
},
|
54
|
+
_raw: { value: options.fromRaw, enumerable: false },
|
55
|
+
});
|
56
|
+
}
|
57
|
+
else {
|
58
|
+
throw new Error("Invalid CoMap constructor arguments");
|
58
59
|
}
|
60
|
+
return new Proxy(this, CoMapProxyHandler);
|
59
61
|
}
|
60
62
|
toJSON() {
|
61
63
|
const jsonedFields = this._raw.keys().map((key) => {
|
62
64
|
const tKey = key;
|
63
|
-
const descriptor = this.
|
65
|
+
const descriptor = this._schema[tKey];
|
64
66
|
if (descriptor == "json" || "encode" in descriptor) {
|
65
67
|
return [key, this._raw.get(key)];
|
66
68
|
}
|
67
|
-
else if (
|
69
|
+
else if (isRefEncoded(descriptor)) {
|
68
70
|
const jsonedRef = this[tKey]?.toJSON();
|
69
71
|
return [key, jsonedRef];
|
70
72
|
}
|
@@ -81,111 +83,60 @@ export class CoMap extends CoValueBase {
|
|
81
83
|
[inspect]() {
|
82
84
|
return this.toJSON();
|
83
85
|
}
|
84
|
-
rawFromInit(
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
rawInit[key] = initValue;
|
98
|
-
}
|
99
|
-
else if ("ref" in descriptor) {
|
100
|
-
if (initValue) {
|
101
|
-
rawInit[key] = initValue.id;
|
102
|
-
}
|
103
|
-
}
|
104
|
-
else if ("encoded" in descriptor) {
|
105
|
-
rawInit[key] = Schema.encodeSync(descriptor.encoded)(initValue);
|
86
|
+
rawFromInit(init, owner) {
|
87
|
+
const rawOwner = owner._raw;
|
88
|
+
const rawInit = {};
|
89
|
+
if (init)
|
90
|
+
for (const key of Object.keys(init)) {
|
91
|
+
const initValue = init[key];
|
92
|
+
const descriptor = (this._schema[key] || this._schema[ItemsSym]);
|
93
|
+
if (descriptor === "json") {
|
94
|
+
rawInit[key] = initValue;
|
95
|
+
}
|
96
|
+
else if (isRefEncoded(descriptor)) {
|
97
|
+
if (initValue) {
|
98
|
+
rawInit[key] = initValue.id;
|
106
99
|
}
|
107
100
|
}
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
}
|
112
|
-
static encoding(fields) {
|
113
|
-
this._encoding || (this._encoding = {});
|
114
|
-
Object.assign(this._encoding, fields);
|
115
|
-
}
|
116
|
-
definePropertiesFromSchema() {
|
117
|
-
for (const [key, fieldSchema] of Object.entries(this._encoding)) {
|
118
|
-
if (key === "indexSignature")
|
119
|
-
continue;
|
120
|
-
const descriptor = fieldSchema;
|
121
|
-
if (descriptor === "json") {
|
122
|
-
Object.defineProperty(this, key, this.primitivePropDef(key));
|
123
|
-
}
|
124
|
-
else if ("encoded" in descriptor) {
|
125
|
-
Object.defineProperty(this, key, this.encodedPropDef(key, descriptor.encoded));
|
126
|
-
}
|
127
|
-
else if ("ref" in descriptor) {
|
128
|
-
Object.defineProperty(this, key, this.refPropDef(key, descriptor.ref));
|
101
|
+
else if ("encoded" in descriptor) {
|
102
|
+
rawInit[key] = encodeSync(descriptor.encoded)(initValue);
|
103
|
+
}
|
129
104
|
}
|
130
|
-
|
131
|
-
}
|
132
|
-
primitivePropDef(key) {
|
133
|
-
return {
|
134
|
-
get: () => {
|
135
|
-
return this._raw.get(key);
|
136
|
-
},
|
137
|
-
set(value) {
|
138
|
-
this._raw.set(key, value);
|
139
|
-
},
|
140
|
-
enumerable: true,
|
141
|
-
configurable: true,
|
142
|
-
};
|
143
|
-
}
|
144
|
-
encodedPropDef(key, arg) {
|
145
|
-
return {
|
146
|
-
get: () => {
|
147
|
-
const raw = this._raw.get(key);
|
148
|
-
return raw === undefined
|
149
|
-
? undefined
|
150
|
-
: Schema.decodeSync(arg)(raw);
|
151
|
-
},
|
152
|
-
set(value) {
|
153
|
-
this._raw.set(key, Schema.encodeSync(arg)(value));
|
154
|
-
},
|
155
|
-
enumerable: true,
|
156
|
-
configurable: true,
|
157
|
-
};
|
158
|
-
}
|
159
|
-
refPropDef(key, ref) {
|
160
|
-
return {
|
161
|
-
get: () => {
|
162
|
-
const rawID = this._raw.get(key);
|
163
|
-
return rawID === undefined
|
164
|
-
? undefined
|
165
|
-
: new ValueRef(rawID, this._loadedAs, ref()).accessFrom(this);
|
166
|
-
},
|
167
|
-
set: (value) => {
|
168
|
-
this._raw.set(key, value.id);
|
169
|
-
subscriptionsScopes.get(this)?.onRefAccessedOrSet(value.id);
|
170
|
-
},
|
171
|
-
enumerable: true,
|
172
|
-
configurable: true,
|
173
|
-
};
|
105
|
+
return rawOwner.createMap(rawInit);
|
174
106
|
}
|
175
107
|
}
|
176
108
|
_a = CoMap;
|
177
109
|
(() => {
|
178
110
|
_a.prototype._type = "CoMap";
|
179
111
|
})();
|
112
|
+
function tryInit(map) {
|
113
|
+
if (map[InitValues] &&
|
114
|
+
(map._schema[ItemsSym] ||
|
115
|
+
Object.keys(map[InitValues].init).every((key) => map._schema[key]))) {
|
116
|
+
const raw = map.rawFromInit(map[InitValues].init, map[InitValues].owner);
|
117
|
+
Object.defineProperties(map, {
|
118
|
+
id: {
|
119
|
+
value: raw.id,
|
120
|
+
enumerable: false,
|
121
|
+
},
|
122
|
+
_raw: { value: raw, enumerable: false },
|
123
|
+
});
|
124
|
+
delete map[InitValues];
|
125
|
+
}
|
126
|
+
}
|
180
127
|
// TODO: cache handlers per descriptor for performance?
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
128
|
+
const CoMapProxyHandler = {
|
129
|
+
get(target, key, receiver) {
|
130
|
+
if (key === "_schema") {
|
131
|
+
return Reflect.get(target, key);
|
132
|
+
}
|
133
|
+
else if (key in target) {
|
134
|
+
return Reflect.get(target, key, receiver);
|
135
|
+
}
|
136
|
+
else {
|
137
|
+
const descriptor = (target._schema[key] ||
|
138
|
+
target._schema[ItemsSym]);
|
139
|
+
if (descriptor && typeof key === "string") {
|
189
140
|
const raw = target._raw.get(key);
|
190
141
|
if (descriptor === "json") {
|
191
142
|
return raw;
|
@@ -193,57 +144,93 @@ function CoMapProxyHandler() {
|
|
193
144
|
else if ("encoded" in descriptor) {
|
194
145
|
return raw === undefined
|
195
146
|
? undefined
|
196
|
-
:
|
147
|
+
: decodeSync(descriptor.encoded)(raw);
|
197
148
|
}
|
198
|
-
else if (
|
149
|
+
else if (isRefEncoded(descriptor)) {
|
199
150
|
return raw === undefined
|
200
151
|
? undefined
|
201
|
-
: new
|
152
|
+
: new Ref(raw, target._loadedAs, descriptor).accessFrom(receiver);
|
202
153
|
}
|
203
154
|
}
|
204
|
-
},
|
205
|
-
set(target, key, value, receiver) {
|
206
|
-
const descriptor = target._encoding[indexSignature];
|
207
|
-
if (key in target || typeof key === "symbol") {
|
208
|
-
return Reflect.set(target, key, value, receiver);
|
209
|
-
}
|
210
155
|
else {
|
211
|
-
|
212
|
-
target._raw.set(key, value);
|
213
|
-
}
|
214
|
-
else if ("encoded" in descriptor) {
|
215
|
-
target._raw.set(key, Schema.encodeSync(descriptor.encoded)(value));
|
216
|
-
}
|
217
|
-
else if ("ref" in descriptor) {
|
218
|
-
target._raw.set(key, value.id);
|
219
|
-
subscriptionsScopes
|
220
|
-
.get(target)
|
221
|
-
?.onRefAccessedOrSet(value.id);
|
222
|
-
}
|
223
|
-
return true;
|
156
|
+
return undefined;
|
224
157
|
}
|
225
|
-
}
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
158
|
+
}
|
159
|
+
},
|
160
|
+
set(target, key, value, receiver) {
|
161
|
+
var _b;
|
162
|
+
if ((typeof key === "string" || ItemsSym) &&
|
163
|
+
typeof value === "object" &&
|
164
|
+
SchemaInit in value) {
|
165
|
+
(_b = target.constructor)._schema || (_b._schema = {});
|
166
|
+
target.constructor._schema[key] =
|
167
|
+
value[SchemaInit];
|
168
|
+
tryInit(target);
|
169
|
+
return true;
|
170
|
+
}
|
171
|
+
const descriptor = (target._schema[key] ||
|
172
|
+
target._schema[ItemsSym]);
|
173
|
+
if (descriptor && typeof key === "string") {
|
174
|
+
if (descriptor === "json") {
|
175
|
+
target._raw.set(key, value);
|
176
|
+
}
|
177
|
+
else if ("encoded" in descriptor) {
|
178
|
+
target._raw.set(key, encodeSync(descriptor.encoded)(value));
|
232
179
|
}
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
if (key in target) {
|
237
|
-
return Reflect.getOwnPropertyDescriptor(target, key);
|
180
|
+
else if (isRefEncoded(descriptor)) {
|
181
|
+
target._raw.set(key, value.id);
|
182
|
+
subscriptionsScopes.get(target)?.onRefAccessedOrSet(value.id);
|
238
183
|
}
|
239
|
-
|
184
|
+
return true;
|
185
|
+
}
|
186
|
+
else {
|
187
|
+
return Reflect.set(target, key, value, receiver);
|
188
|
+
}
|
189
|
+
},
|
190
|
+
defineProperty(target, key, attributes) {
|
191
|
+
var _b;
|
192
|
+
if ("value" in attributes &&
|
193
|
+
typeof attributes.value === "object" &&
|
194
|
+
SchemaInit in attributes.value) {
|
195
|
+
(_b = target.constructor)._schema || (_b._schema = {});
|
196
|
+
target.constructor._schema[key] =
|
197
|
+
attributes.value[SchemaInit];
|
198
|
+
tryInit(target);
|
199
|
+
return true;
|
200
|
+
}
|
201
|
+
else {
|
202
|
+
return Reflect.defineProperty(target, key, attributes);
|
203
|
+
}
|
204
|
+
},
|
205
|
+
ownKeys(target) {
|
206
|
+
const keys = Reflect.ownKeys(target).filter((k) => k !== ItemsSym);
|
207
|
+
for (const key of Reflect.ownKeys(target._schema)) {
|
208
|
+
if (key !== ItemsSym && !keys.includes(key)) {
|
209
|
+
keys.push(key);
|
210
|
+
}
|
211
|
+
}
|
212
|
+
for (const key of target._raw.keys()) {
|
213
|
+
if (!keys.includes(key)) {
|
214
|
+
keys.push(key);
|
215
|
+
}
|
216
|
+
}
|
217
|
+
return keys;
|
218
|
+
},
|
219
|
+
getOwnPropertyDescriptor(target, key) {
|
220
|
+
if (key in target) {
|
221
|
+
return Reflect.getOwnPropertyDescriptor(target, key);
|
222
|
+
}
|
223
|
+
else {
|
224
|
+
const descriptor = (target._schema[key] ||
|
225
|
+
target._schema[ItemsSym]);
|
226
|
+
if (descriptor || key in target._raw.ops) {
|
240
227
|
return {
|
241
228
|
enumerable: true,
|
242
229
|
configurable: true,
|
243
230
|
writable: true,
|
244
231
|
};
|
245
232
|
}
|
246
|
-
}
|
247
|
-
}
|
248
|
-
}
|
233
|
+
}
|
234
|
+
},
|
235
|
+
};
|
249
236
|
//# sourceMappingURL=coMap.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"coMap.js","sourceRoot":"","sources":["../../src/coValues/coMap.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"coMap.js","sourceRoot":"","sources":["../../src/coValues/coMap.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAY/D,OAAO,EACH,OAAO,EACP,WAAW,EACX,GAAG,EACH,UAAU,EACV,OAAO,EACP,QAAQ,EACR,mBAAmB,EACnB,QAAQ,EACR,UAAU,EACV,YAAY,GACf,MAAM,gBAAgB,CAAC;AAsDxB,MAAM,OAAO,KACT,SAAQ,WAAW;IAWnB,IAAI,OAAO;QACP,OAAQ,IAAI,CA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