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/coList.js
CHANGED
@@ -1,10 +1,25 @@
|
|
1
1
|
var _a;
|
2
2
|
import { RawAccount } from "cojson";
|
3
|
-
import { Account, CoValueBase, Group,
|
4
|
-
import {
|
3
|
+
import { Account, CoValueBase, Group, InitValues, ItemsSym, Ref, SchemaInit, co, inspect, isRefEncoded, makeRefs, } from "../internal.js";
|
4
|
+
import { encodeSync, decodeSync } from "@effect/schema/Schema";
|
5
5
|
export class CoList extends Array {
|
6
|
-
|
7
|
-
|
6
|
+
static Of(item) {
|
7
|
+
var _b, _c;
|
8
|
+
return _c = class CoListOf extends _a {
|
9
|
+
constructor() {
|
10
|
+
super(...arguments);
|
11
|
+
this[_b] = item;
|
12
|
+
}
|
13
|
+
},
|
14
|
+
_b = co.items,
|
15
|
+
_c;
|
16
|
+
}
|
17
|
+
/** @deprecated Use UPPERCASE `CoList.Of` instead! */
|
18
|
+
static of(..._args) {
|
19
|
+
throw new Error("Can't use Array.of with CoLists");
|
20
|
+
}
|
21
|
+
get _schema() {
|
22
|
+
return this.constructor._schema;
|
8
23
|
}
|
9
24
|
get _owner() {
|
10
25
|
return this._raw.group instanceof RawAccount
|
@@ -12,7 +27,7 @@ export class CoList extends Array {
|
|
12
27
|
: Group.fromRaw(this._raw.group);
|
13
28
|
}
|
14
29
|
get _refs() {
|
15
|
-
return makeRefs((idx) => this._raw.get(idx), () => Array.from({ length: this._raw.entries().length }, (_, idx) => idx), this._loadedAs, (_idx) => this.
|
30
|
+
return makeRefs((idx) => this._raw.get(idx), () => Array.from({ length: this._raw.entries().length }, (_, idx) => idx), this._loadedAs, (_idx) => this._schema[ItemsSym]);
|
16
31
|
}
|
17
32
|
get _edits() {
|
18
33
|
throw new Error("Not implemented");
|
@@ -20,56 +35,39 @@ export class CoList extends Array {
|
|
20
35
|
get _loadedAs() {
|
21
36
|
return Account.fromNode(this._raw.core.node);
|
22
37
|
}
|
38
|
+
static get [Symbol.species]() {
|
39
|
+
return Array;
|
40
|
+
}
|
23
41
|
constructor(init, options) {
|
24
|
-
if (typeof init === "number") {
|
25
|
-
// this might be called from an intrinsic, like map, trying to create an empty array
|
26
|
-
// passing `0` as the only parameter
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
28
|
-
return new Array(init);
|
29
|
-
}
|
30
42
|
super();
|
31
43
|
if (!options) {
|
32
44
|
throw new Error("Must provide options");
|
33
45
|
}
|
34
|
-
|
35
|
-
|
36
|
-
|
46
|
+
if (init && "owner" in options) {
|
47
|
+
this[InitValues] = {
|
48
|
+
init,
|
49
|
+
owner: options.owner,
|
50
|
+
};
|
37
51
|
}
|
38
|
-
else {
|
39
|
-
|
40
|
-
|
41
|
-
|
52
|
+
else if ("fromRaw" in options) {
|
53
|
+
Object.defineProperties(this, {
|
54
|
+
id: {
|
55
|
+
value: options.fromRaw.id,
|
56
|
+
enumerable: false,
|
57
|
+
},
|
58
|
+
_raw: { value: options.fromRaw, enumerable: false },
|
59
|
+
});
|
42
60
|
}
|
43
|
-
|
44
|
-
id: {
|
45
|
-
value: raw.id,
|
46
|
-
enumerable: false,
|
47
|
-
},
|
48
|
-
_raw: { value: raw, enumerable: false },
|
49
|
-
});
|
50
|
-
return new Proxy(this, CoListProxyHandler(this._encoding._item));
|
51
|
-
}
|
52
|
-
toRawItems(items) {
|
53
|
-
const itemDescriptor = this._encoding._item;
|
54
|
-
const rawItems = itemDescriptor === "json"
|
55
|
-
? items
|
56
|
-
: "encoded" in itemDescriptor
|
57
|
-
? items?.map((e) => Schema.encodeSync(itemDescriptor.encoded)(e))
|
58
|
-
: "ref" in itemDescriptor
|
59
|
-
? items?.map((v) => v.id)
|
60
|
-
: (() => {
|
61
|
-
throw new Error("Invalid element descriptor");
|
62
|
-
})();
|
63
|
-
return rawItems;
|
61
|
+
return new Proxy(this, CoListProxyHandler);
|
64
62
|
}
|
65
63
|
push(...items) {
|
66
|
-
for (const item of
|
64
|
+
for (const item of toRawItems(items, this._schema[ItemsSym])) {
|
67
65
|
this._raw.append(item);
|
68
66
|
}
|
69
67
|
return this._raw.entries().length;
|
70
68
|
}
|
71
69
|
unshift(...items) {
|
72
|
-
for (const item of
|
70
|
+
for (const item of toRawItems(items, this._schema[ItemsSym])) {
|
73
71
|
this._raw.prepend(item);
|
74
72
|
}
|
75
73
|
return this._raw.entries().length;
|
@@ -86,27 +84,28 @@ export class CoList extends Array {
|
|
86
84
|
}
|
87
85
|
splice(start, deleteCount, ...items) {
|
88
86
|
const deleted = this.slice(start, start + deleteCount);
|
89
|
-
for (let idxToDelete = start + deleteCount; idxToDelete
|
87
|
+
for (let idxToDelete = start + deleteCount - 1; idxToDelete >= start; idxToDelete--) {
|
90
88
|
this._raw.delete(idxToDelete);
|
91
89
|
}
|
92
|
-
let appendAfter = start;
|
93
|
-
for (const item of
|
90
|
+
let appendAfter = Math.max(start - 1, 0);
|
91
|
+
for (const item of toRawItems(items, this._schema[ItemsSym])) {
|
92
|
+
console.log(this._raw.asArray(), appendAfter);
|
94
93
|
this._raw.append(item, appendAfter);
|
95
94
|
appendAfter++;
|
96
95
|
}
|
97
96
|
return deleted;
|
98
97
|
}
|
99
98
|
toJSON() {
|
100
|
-
const itemDescriptor = this.
|
99
|
+
const itemDescriptor = this._schema[ItemsSym];
|
101
100
|
if (itemDescriptor === "json") {
|
102
101
|
return this._raw.asArray();
|
103
102
|
}
|
104
103
|
else if ("encoded" in itemDescriptor) {
|
105
104
|
return this._raw
|
106
105
|
.asArray()
|
107
|
-
.map((e) =>
|
106
|
+
.map((e) => encodeSync(itemDescriptor.encoded)(e));
|
108
107
|
}
|
109
|
-
else if (
|
108
|
+
else if (isRefEncoded(itemDescriptor)) {
|
110
109
|
return this.map((item) => item?.toJSON());
|
111
110
|
}
|
112
111
|
else {
|
@@ -119,9 +118,9 @@ export class CoList extends Array {
|
|
119
118
|
static fromRaw(raw) {
|
120
119
|
return new this(undefined, { fromRaw: raw });
|
121
120
|
}
|
122
|
-
static
|
123
|
-
this.
|
124
|
-
Object.assign(this.
|
121
|
+
static schema(def) {
|
122
|
+
this._schema || (this._schema = {});
|
123
|
+
Object.assign(this._schema, def);
|
125
124
|
}
|
126
125
|
}
|
127
126
|
_a = CoList;
|
@@ -138,59 +137,111 @@ CoList.loadEf = CoValueBase.loadEf;
|
|
138
137
|
CoList.load = CoValueBase.load;
|
139
138
|
CoList.subscribeEf = CoValueBase.subscribeEf;
|
140
139
|
CoList.subscribe = CoValueBase.subscribe;
|
141
|
-
function
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
140
|
+
function toRawItems(items, itemDescriptor) {
|
141
|
+
const rawItems = itemDescriptor === "json"
|
142
|
+
? items
|
143
|
+
: "encoded" in itemDescriptor
|
144
|
+
? items?.map((e) => encodeSync(itemDescriptor.encoded)(e))
|
145
|
+
: isRefEncoded(itemDescriptor)
|
146
|
+
? items?.map((v) => v.id)
|
147
|
+
: (() => {
|
148
|
+
throw new Error("Invalid element descriptor");
|
149
|
+
})();
|
150
|
+
return rawItems;
|
151
|
+
}
|
152
|
+
function init(list) {
|
153
|
+
if (list[InitValues]) {
|
154
|
+
const { init, owner } = list[InitValues];
|
155
|
+
const raw = owner._raw.createList(toRawItems(init, list._schema[ItemsSym]));
|
156
|
+
Object.defineProperties(list, {
|
157
|
+
id: {
|
158
|
+
value: raw.id,
|
159
|
+
enumerable: false,
|
160
|
+
},
|
161
|
+
_raw: { value: raw, enumerable: false },
|
162
|
+
});
|
163
|
+
delete list[InitValues];
|
164
|
+
}
|
165
|
+
}
|
166
|
+
const CoListProxyHandler = {
|
167
|
+
get(target, key, receiver) {
|
168
|
+
if (typeof key === "string" && !isNaN(+key)) {
|
169
|
+
const itemDescriptor = target._schema[ItemsSym];
|
170
|
+
const rawValue = target._raw.get(Number(key));
|
171
|
+
if (itemDescriptor === "json") {
|
172
|
+
return rawValue;
|
162
173
|
}
|
163
|
-
else {
|
164
|
-
return
|
174
|
+
else if ("encoded" in itemDescriptor) {
|
175
|
+
return rawValue === undefined
|
176
|
+
? undefined
|
177
|
+
: decodeSync(itemDescriptor.encoded)(rawValue);
|
165
178
|
}
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
if (itemDescriptor === "json") {
|
171
|
-
rawValue = value;
|
172
|
-
}
|
173
|
-
else if ("encoded" in itemDescriptor) {
|
174
|
-
rawValue = Schema.encodeSync(itemDescriptor.encoded)(value);
|
175
|
-
}
|
176
|
-
else if ("ref" in itemDescriptor) {
|
177
|
-
rawValue = value.id;
|
178
|
-
}
|
179
|
-
target._raw.replace(Number(key), rawValue);
|
180
|
-
return true;
|
179
|
+
else if (isRefEncoded(itemDescriptor)) {
|
180
|
+
return rawValue === undefined
|
181
|
+
? undefined
|
182
|
+
: new Ref(rawValue, target._loadedAs, itemDescriptor).accessFrom(receiver);
|
181
183
|
}
|
182
|
-
|
183
|
-
|
184
|
+
}
|
185
|
+
else if (key === "length") {
|
186
|
+
return target._raw.entries().length;
|
187
|
+
}
|
188
|
+
else {
|
189
|
+
return Reflect.get(target, key, receiver);
|
190
|
+
}
|
191
|
+
},
|
192
|
+
set(target, key, value, receiver) {
|
193
|
+
var _b;
|
194
|
+
if (key === ItemsSym &&
|
195
|
+
typeof value === "object" &&
|
196
|
+
SchemaInit in value) {
|
197
|
+
(_b = target.constructor)._schema || (_b._schema = {});
|
198
|
+
target.constructor._schema[ItemsSym] =
|
199
|
+
value[SchemaInit];
|
200
|
+
init(target);
|
201
|
+
return true;
|
202
|
+
}
|
203
|
+
if (typeof key === "string" && !isNaN(+key)) {
|
204
|
+
const itemDescriptor = target._schema[ItemsSym];
|
205
|
+
let rawValue;
|
206
|
+
if (itemDescriptor === "json") {
|
207
|
+
rawValue = value;
|
184
208
|
}
|
185
|
-
|
186
|
-
|
187
|
-
if (typeof key === "string" && !isNaN(+key)) {
|
188
|
-
return Number(key) < target._raw.entries().length;
|
209
|
+
else if ("encoded" in itemDescriptor) {
|
210
|
+
rawValue = encodeSync(itemDescriptor.encoded)(value);
|
189
211
|
}
|
190
|
-
else {
|
191
|
-
|
212
|
+
else if (isRefEncoded(itemDescriptor)) {
|
213
|
+
rawValue = value.id;
|
192
214
|
}
|
193
|
-
|
194
|
-
|
195
|
-
}
|
215
|
+
target._raw.replace(Number(key), rawValue);
|
216
|
+
return true;
|
217
|
+
}
|
218
|
+
else {
|
219
|
+
return Reflect.set(target, key, value, receiver);
|
220
|
+
}
|
221
|
+
},
|
222
|
+
defineProperty(target, key, descriptor) {
|
223
|
+
var _b;
|
224
|
+
if (descriptor.value &&
|
225
|
+
key === ItemsSym &&
|
226
|
+
typeof descriptor.value === "object" &&
|
227
|
+
SchemaInit in descriptor.value) {
|
228
|
+
(_b = target.constructor)._schema || (_b._schema = {});
|
229
|
+
target.constructor._schema[ItemsSym] =
|
230
|
+
descriptor.value[SchemaInit];
|
231
|
+
init(target);
|
232
|
+
return true;
|
233
|
+
}
|
234
|
+
else {
|
235
|
+
return Reflect.defineProperty(target, key, descriptor);
|
236
|
+
}
|
237
|
+
},
|
238
|
+
has(target, key) {
|
239
|
+
if (typeof key === "string" && !isNaN(+key)) {
|
240
|
+
return Number(key) < target._raw.entries().length;
|
241
|
+
}
|
242
|
+
else {
|
243
|
+
return Reflect.has(target, key);
|
244
|
+
}
|
245
|
+
},
|
246
|
+
};
|
196
247
|
//# sourceMappingURL=coList.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"coList.js","sourceRoot":"","sources":["../../src/coValues/coList.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CA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