jazz-tools 0.7.0-alpha.1 → 0.7.0-alpha.12
Sign up to get free protection for your applications and to get access to all the features.
- package/.turbo/turbo-build.log +79 -9
- package/CHANGELOG.md +74 -0
- package/dist/coValues/account.js +63 -30
- package/dist/coValues/account.js.map +1 -1
- package/dist/coValues/coList.js +143 -93
- package/dist/coValues/coList.js.map +1 -1
- package/dist/coValues/coMap.js +145 -159
- package/dist/coValues/coMap.js.map +1 -1
- package/dist/coValues/coStream.js +140 -66
- package/dist/coValues/coStream.js.map +1 -1
- package/dist/coValues/extensions/imageDef.js +9 -11
- package/dist/coValues/extensions/imageDef.js.map +1 -1
- package/dist/coValues/group.js +14 -39
- 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 -19
- 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 +107 -61
- package/dist/tests/coMap.test.js.map +1 -1
- package/dist/tests/coStream.test.js +51 -56
- package/dist/tests/coStream.test.js.map +1 -1
- package/package.json +2 -2
- package/src/coValues/account.ts +94 -64
- package/src/coValues/coList.ts +186 -115
- package/src/coValues/coMap.ts +226 -260
- package/src/coValues/coStream.ts +190 -111
- package/src/coValues/extensions/imageDef.ts +12 -16
- package/src/coValues/group.ts +27 -75
- package/src/coValues/interfaces.ts +10 -8
- package/src/implementation/refs.ts +43 -18
- package/src/implementation/schema.ts +86 -31
- package/src/index.ts +10 -25
- package/src/tests/coList.test.ts +5 -9
- package/src/tests/coMap.test.ts +86 -74
- package/src/tests/coStream.test.ts +66 -71
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"coList.js","sourceRoot":"","sources":["../../src/coValues/coList.ts"],"names":[],"mappings":";AACA,OAAO,EA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AC;CACJ,CAAC"}
|
package/dist/coValues/coMap.js
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
var _a;
|
2
|
-
import { Schema } from "@effect/schema";
|
3
|
-
import { Account, CoValueBase,
|
2
|
+
import { Schema as EffectSchema } from "@effect/schema";
|
3
|
+
import { Account, CoValueBase, Ref, SchemaInit, inspect, makeRefs, subscriptionsScopes, ItemsSym, InitValues, isRefEncoded, } from "../internal.js";
|
4
4
|
export class CoMap extends CoValueBase {
|
5
5
|
get _schema() {
|
6
|
-
return this.constructor
|
6
|
+
return this.constructor
|
7
|
+
._schema;
|
7
8
|
}
|
8
9
|
get _refs() {
|
9
10
|
return makeRefs((key) => this._raw.get(key), () => Object.keys(this._schema).filter((key) => {
|
10
11
|
const schema = this._schema[key];
|
11
|
-
schema !== "json" &&
|
12
|
-
}), this._loadedAs, (key) => this._schema[key]
|
12
|
+
schema !== "json" && isRefEncoded(schema);
|
13
|
+
}), this._loadedAs, (key) => this._schema[key]);
|
13
14
|
}
|
14
15
|
get _edits() {
|
15
16
|
return new Proxy(this, {
|
@@ -22,13 +23,13 @@ export class CoMap extends CoValueBase {
|
|
22
23
|
value: descriptor === "json"
|
23
24
|
? rawEdit.value
|
24
25
|
: "encoded" in descriptor
|
25
|
-
?
|
26
|
-
: new
|
27
|
-
ref: descriptor !== "json" &&
|
28
|
-
? new
|
26
|
+
? EffectSchema.decodeSync(descriptor.encoded)(rawEdit.value)
|
27
|
+
: new Ref(rawEdit.value, target._loadedAs, descriptor).accessFrom(target),
|
28
|
+
ref: descriptor !== "json" && isRefEncoded(descriptor)
|
29
|
+
? new Ref(rawEdit.value, target._loadedAs, descriptor)
|
29
30
|
: undefined,
|
30
31
|
by: rawEdit.by &&
|
31
|
-
new
|
32
|
+
new Ref(rawEdit.by, target._loadedAs, Account).accessFrom(target),
|
32
33
|
madeAt: rawEdit.at,
|
33
34
|
};
|
34
35
|
},
|
@@ -39,23 +40,25 @@ export class CoMap extends CoValueBase {
|
|
39
40
|
}
|
40
41
|
constructor(init, options) {
|
41
42
|
super();
|
42
|
-
if (
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
if (init && "owner" in options) {
|
44
|
+
this[InitValues] = {
|
45
|
+
init,
|
46
|
+
owner: options.owner,
|
47
|
+
};
|
46
48
|
}
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
49
|
+
else if ("fromRaw" in options) {
|
50
|
+
Object.defineProperties(this, {
|
51
|
+
id: {
|
52
|
+
value: options.fromRaw.id,
|
53
|
+
enumerable: false,
|
54
|
+
},
|
55
|
+
_raw: { value: options.fromRaw, enumerable: false },
|
56
|
+
});
|
57
|
+
}
|
58
|
+
else {
|
59
|
+
throw new Error("Invalid CoMap constructor arguments");
|
58
60
|
}
|
61
|
+
return new Proxy(this, CoMapProxyHandler);
|
59
62
|
}
|
60
63
|
toJSON() {
|
61
64
|
const jsonedFields = this._raw.keys().map((key) => {
|
@@ -64,7 +67,7 @@ export class CoMap extends CoValueBase {
|
|
64
67
|
if (descriptor == "json" || "encode" in descriptor) {
|
65
68
|
return [key, this._raw.get(key)];
|
66
69
|
}
|
67
|
-
else if (
|
70
|
+
else if (isRefEncoded(descriptor)) {
|
68
71
|
const jsonedRef = this[tKey]?.toJSON();
|
69
72
|
return [key, jsonedRef];
|
70
73
|
}
|
@@ -81,111 +84,59 @@ export class CoMap extends CoValueBase {
|
|
81
84
|
[inspect]() {
|
82
85
|
return this.toJSON();
|
83
86
|
}
|
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);
|
87
|
+
rawFromInit(init, owner) {
|
88
|
+
const rawOwner = owner._raw;
|
89
|
+
const rawInit = {};
|
90
|
+
if (init)
|
91
|
+
for (const key of Object.keys(init)) {
|
92
|
+
const initValue = init[key];
|
93
|
+
const descriptor = (this._schema[key] || this._schema[ItemsSym]);
|
94
|
+
if (descriptor === "json") {
|
95
|
+
rawInit[key] = initValue;
|
96
|
+
}
|
97
|
+
else if (isRefEncoded(descriptor)) {
|
98
|
+
if (initValue) {
|
99
|
+
rawInit[key] = initValue.id;
|
106
100
|
}
|
107
101
|
}
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
}
|
112
|
-
static encoding(fields) {
|
113
|
-
this._schema || (this._schema = {});
|
114
|
-
Object.assign(this._schema, fields);
|
115
|
-
}
|
116
|
-
definePropertiesFromSchema() {
|
117
|
-
for (const [key, fieldSchema] of Object.entries(this._schema)) {
|
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));
|
102
|
+
else if ("encoded" in descriptor) {
|
103
|
+
rawInit[key] = EffectSchema.encodeSync(descriptor.encoded)(initValue);
|
104
|
+
}
|
129
105
|
}
|
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
|
-
};
|
106
|
+
return rawOwner.createMap(rawInit);
|
174
107
|
}
|
175
108
|
}
|
176
109
|
_a = CoMap;
|
177
110
|
(() => {
|
178
111
|
_a.prototype._type = "CoMap";
|
179
112
|
})();
|
113
|
+
function tryInit(map) {
|
114
|
+
if (map[InitValues] &&
|
115
|
+
(map._schema[ItemsSym] ||
|
116
|
+
Object.keys(map[InitValues].init).every((key) => map._schema[key]))) {
|
117
|
+
const raw = map.rawFromInit(map[InitValues].init, map[InitValues].owner);
|
118
|
+
Object.defineProperties(map, {
|
119
|
+
id: {
|
120
|
+
value: raw.id,
|
121
|
+
enumerable: false,
|
122
|
+
},
|
123
|
+
_raw: { value: raw, enumerable: false },
|
124
|
+
});
|
125
|
+
delete map[InitValues];
|
126
|
+
}
|
127
|
+
}
|
180
128
|
// TODO: cache handlers per descriptor for performance?
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
129
|
+
const CoMapProxyHandler = {
|
130
|
+
get(target, key, receiver) {
|
131
|
+
if (key === "_schema") {
|
132
|
+
return Reflect.get(target, key);
|
133
|
+
}
|
134
|
+
else if (key in target) {
|
135
|
+
return Reflect.get(target, key, receiver);
|
136
|
+
}
|
137
|
+
else {
|
138
|
+
const descriptor = (target._schema[key] || 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,92 @@ function CoMapProxyHandler() {
|
|
193
144
|
else if ("encoded" in descriptor) {
|
194
145
|
return raw === undefined
|
195
146
|
? undefined
|
196
|
-
:
|
147
|
+
: EffectSchema.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._schema[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, EffectSchema.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] || target._schema[ItemsSym]);
|
225
|
+
if (descriptor || key in target._raw.ops) {
|
240
226
|
return {
|
241
227
|
enumerable: true,
|
242
228
|
configurable: true,
|
243
229
|
writable: true,
|
244
230
|
};
|
245
231
|
}
|
246
|
-
}
|
247
|
-
}
|
248
|
-
}
|
232
|
+
}
|
233
|
+
},
|
234
|
+
};
|
249
235
|
//# sourceMappingURL=coMap.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"coMap.js","sourceRoot":"","sources":["../../src/coValues/coMap.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;
|
1
|
+
{"version":3,"file":"coMap.js","sourceRoot":"","sources":["../../src/coValues/coMap.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAWxD,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;AAwDxB,MAAM,OAAO,KACT,SAAQ,WAAW;IAWnB,IAAI,OAAO;QACP,OAAQ,IAAI,CAAC,WAA4B;aACpC,OAA4B,CAAC;IACtC,CAAC;IAED,IA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