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