jazz-tools 0.7.3 → 0.7.8
Sign up to get free protection for your applications and to get access to all the features.
- package/.turbo/turbo-build.log +2 -17
- package/.turbo/turbo-test.log +32 -32
- package/CHANGELOG.md +12 -0
- package/dist/coValues/account.js +11 -1
- package/dist/coValues/account.js.map +1 -1
- package/dist/coValues/coList.js +168 -34
- package/dist/coValues/coList.js.map +1 -1
- package/dist/coValues/coMap.js +149 -48
- package/dist/coValues/coMap.js.map +1 -1
- package/dist/coValues/coStream.js +15 -28
- package/dist/coValues/coStream.js.map +1 -1
- package/dist/coValues/group.js +1 -1
- package/dist/coValues/group.js.map +1 -1
- package/dist/coValues/interfaces.js.map +1 -1
- package/dist/implementation/symbols.js +0 -1
- package/dist/implementation/symbols.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/tests/coMap.test.js +11 -0
- package/dist/tests/coMap.test.js.map +1 -1
- package/package.json +1 -1
- package/src/coValues/account.ts +24 -1
- package/src/coValues/coList.ts +180 -48
- package/src/coValues/coMap.ts +152 -63
- package/src/coValues/coStream.ts +16 -34
- package/src/coValues/group.ts +1 -1
- package/src/coValues/interfaces.ts +1 -0
- package/src/implementation/symbols.ts +0 -3
- package/src/index.ts +1 -1
- package/src/tests/coMap.test.ts +16 -0
package/.turbo/turbo-build.log
CHANGED
@@ -1,23 +1,8 @@
|
|
1
1
|
|
2
|
-
> jazz-tools@0.7.
|
2
|
+
> jazz-tools@0.7.6 build /Users/anselm/jazz/jazz/packages/jazz-tools
|
3
3
|
> npm run lint && rm -rf ./dist && tsc --sourceMap --outDir dist
|
4
4
|
|
5
5
|
|
6
|
-
> jazz-tools@0.7.
|
6
|
+
> jazz-tools@0.7.6 lint
|
7
7
|
> eslint . --ext ts,tsx
|
8
8
|
|
9
|
-
|
10
|
-
/Users/anselm/jazz/jazz/packages/jazz-tools/src/coValues/coStream.ts
|
11
|
-
671:9 error 'Cl' is defined but never used. Allowed unused vars must match /^_/u @typescript-eslint/no-unused-vars
|
12
|
-
686:9 error 'Cl' is defined but never used. Allowed unused vars must match /^_/u @typescript-eslint/no-unused-vars
|
13
|
-
|
14
|
-
/Users/anselm/jazz/jazz/packages/jazz-tools/src/coValues/interfaces.ts
|
15
|
-
56:12 error Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
16
|
-
|
17
|
-
✖ 3 problems (3 errors, 0 warnings)
|
18
|
-
|
19
|
-
npm ERR! Lifecycle script `lint` failed with error:
|
20
|
-
npm ERR! Error: command failed
|
21
|
-
npm ERR! in workspace: jazz-tools@0.7.1
|
22
|
-
npm ERR! at location: /Users/anselm/jazz/jazz/packages/jazz-tools
|
23
|
-
ELIFECYCLE Command failed with exit code 1.
|
package/.turbo/turbo-test.log
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
|
2
|
-
> jazz-tools@0.7.
|
2
|
+
> jazz-tools@0.7.3 test /Users/anselm/jazz/jazz/packages/jazz-tools
|
3
3
|
> vitest --run
|
4
4
|
|
5
5
|
|
6
6
|
RUN v0.34.6 /Users/anselm/jazz/jazz/packages/jazz-tools
|
7
7
|
|
8
|
-
✓ src/tests/groupsAndAccounts.test.ts (1 test)
|
9
|
-
✓ src/tests/deepLoading.test.ts (3 tests)
|
8
|
+
✓ src/tests/groupsAndAccounts.test.ts (1 test) 36ms
|
9
|
+
✓ src/tests/deepLoading.test.ts (3 tests) 83ms
|
10
10
|
stdout | unknown test
|
11
11
|
TestMap schema [90mundefined[39m
|
12
12
|
|
13
|
-
✓ src/tests/coList.test.ts (10 tests)
|
13
|
+
✓ src/tests/coList.test.ts (10 tests) 146ms
|
14
14
|
stdout | src/tests/coList.test.ts > Simple CoList operations > Mutation > splice
|
15
15
|
[ [32m'bread'[39m, [32m'onion'[39m ] [33m0[39m
|
16
16
|
[ [32m'bread'[39m, [32m'salt'[39m, [32m'onion'[39m ] [33m1[39m
|
@@ -28,9 +28,9 @@ subscribedStream[me.id] {
|
|
28
28
|
value: [36m[Getter][39m,
|
29
29
|
ref: [36m[Getter][39m,
|
30
30
|
by: [36m[Getter][39m,
|
31
|
-
madeAt: [35m2024-
|
31
|
+
madeAt: [35m2024-06-01T15:19:36.577Z[39m,
|
32
32
|
tx: {
|
33
|
-
sessionID: [32m'
|
33
|
+
sessionID: [32m'co_zTfn2PmmXRTHLaTmdhyPA1B8U3s_session_zCC7ikBTEsQF'[39m,
|
34
34
|
txIndex: [33m0[39m
|
35
35
|
}
|
36
36
|
}
|
@@ -40,9 +40,9 @@ subscribedStream[me.id] {
|
|
40
40
|
value: [36m[Getter][39m,
|
41
41
|
ref: [36m[Getter][39m,
|
42
42
|
by: [36m[Getter][39m,
|
43
|
-
madeAt: [35m2024-
|
43
|
+
madeAt: [35m2024-06-01T15:19:36.577Z[39m,
|
44
44
|
tx: {
|
45
|
-
sessionID: [32m'
|
45
|
+
sessionID: [32m'co_zTfn2PmmXRTHLaTmdhyPA1B8U3s_session_zCC7ikBTEsQF'[39m,
|
46
46
|
txIndex: [33m0[39m
|
47
47
|
}
|
48
48
|
}
|
@@ -52,36 +52,36 @@ subscribedStream[me.id] {
|
|
52
52
|
value: [36m[Getter][39m,
|
53
53
|
ref: [36m[Getter][39m,
|
54
54
|
by: [36m[Getter][39m,
|
55
|
-
madeAt: [35m2024-
|
55
|
+
madeAt: [35m2024-06-01T15:19:36.577Z[39m,
|
56
56
|
tx: {
|
57
|
-
sessionID: [32m'
|
57
|
+
sessionID: [32m'co_zTfn2PmmXRTHLaTmdhyPA1B8U3s_session_zCC7ikBTEsQF'[39m,
|
58
58
|
txIndex: [33m0[39m
|
59
59
|
}
|
60
60
|
}
|
61
61
|
subscribedStream[me.id]?.value?.[me.id]?.value {
|
62
|
-
id: [32m'
|
62
|
+
id: [32m'co_z52vwqjSZTf7HMLr5B1XvmSw1Rw'[39m,
|
63
63
|
_type: [32m'CoStream'[39m,
|
64
|
-
|
65
|
-
in: {
|
64
|
+
co_zTfn2PmmXRTHLaTmdhyPA1B8U3s: [32m'milk'[39m,
|
65
|
+
in: { co_zTfn2PmmXRTHLaTmdhyPA1B8U3s_session_zCC7ikBTEsQF: [32m'milk'[39m }
|
66
66
|
}
|
67
67
|
subscribedStream[me.id]?.value?.[me.id]?.value?.[me.id]?.value milk
|
68
68
|
subscribedStream[me.id] {
|
69
69
|
value: [36m[Getter][39m,
|
70
70
|
ref: [36m[Getter][39m,
|
71
71
|
by: [36m[Getter][39m,
|
72
|
-
madeAt: [35m2024-
|
72
|
+
madeAt: [35m2024-06-01T15:19:36.577Z[39m,
|
73
73
|
tx: {
|
74
|
-
sessionID: [32m'
|
74
|
+
sessionID: [32m'co_zTfn2PmmXRTHLaTmdhyPA1B8U3s_session_zCC7ikBTEsQF'[39m,
|
75
75
|
txIndex: [33m0[39m
|
76
76
|
}
|
77
77
|
}
|
78
78
|
subscribedStream[me.id]?.value?.[me.id]?.value {
|
79
|
-
id: [32m'
|
79
|
+
id: [32m'co_z52vwqjSZTf7HMLr5B1XvmSw1Rw'[39m,
|
80
80
|
_type: [32m'CoStream'[39m,
|
81
|
-
|
81
|
+
co_zTfn2PmmXRTHLaTmdhyPA1B8U3s: [32m'bread'[39m,
|
82
82
|
in: {
|
83
|
-
|
84
|
-
|
83
|
+
co_zTfn2PmmXRTHLaTmdhyPA1B8U3s_session_zCC7ikBTEsQF: [32m'milk'[39m,
|
84
|
+
co_zTfn2PmmXRTHLaTmdhyPA1B8U3s_session_zDtwUk7ycBdB: [32m'bread'[39m
|
85
85
|
}
|
86
86
|
}
|
87
87
|
subscribedStream[me.id]?.value?.[me.id]?.value?.[me.id]?.value bread
|
@@ -89,38 +89,38 @@ subscribedStream[me.id] {
|
|
89
89
|
value: [36m[Getter][39m,
|
90
90
|
ref: [36m[Getter][39m,
|
91
91
|
by: [36m[Getter][39m,
|
92
|
-
madeAt: [35m2024-
|
92
|
+
madeAt: [35m2024-06-01T15:19:36.592Z[39m,
|
93
93
|
tx: {
|
94
|
-
sessionID: [32m'
|
94
|
+
sessionID: [32m'co_zTfn2PmmXRTHLaTmdhyPA1B8U3s_session_zDtwUk7ycBdB'[39m,
|
95
95
|
txIndex: [33m0[39m
|
96
96
|
}
|
97
97
|
}
|
98
98
|
subscribedStream[me.id]?.value?.[me.id]?.value {
|
99
|
-
id: [32m'
|
99
|
+
id: [32m'co_zVxaWuHQmNZAokSKikCDq9NrrHU'[39m,
|
100
100
|
_type: [32m'CoStream'[39m,
|
101
|
-
|
102
|
-
in: {
|
101
|
+
co_zTfn2PmmXRTHLaTmdhyPA1B8U3s: [32m'butter'[39m,
|
102
|
+
in: { co_zTfn2PmmXRTHLaTmdhyPA1B8U3s_session_zDtwUk7ycBdB: [32m'butter'[39m }
|
103
103
|
}
|
104
104
|
subscribedStream[me.id]?.value?.[me.id]?.value?.[me.id]?.value butter
|
105
105
|
subscribedStream[me.id] {
|
106
106
|
value: [36m[Getter][39m,
|
107
107
|
ref: [36m[Getter][39m,
|
108
108
|
by: [36m[Getter][39m,
|
109
|
-
madeAt: [35m2024-
|
109
|
+
madeAt: [35m2024-06-01T15:19:36.592Z[39m,
|
110
110
|
tx: {
|
111
|
-
sessionID: [32m'
|
111
|
+
sessionID: [32m'co_zTfn2PmmXRTHLaTmdhyPA1B8U3s_session_zDtwUk7ycBdB'[39m,
|
112
112
|
txIndex: [33m0[39m
|
113
113
|
}
|
114
114
|
}
|
115
115
|
subscribedStream[me.id]?.value?.[me.id]?.value {
|
116
|
-
id: [32m'
|
116
|
+
id: [32m'co_zVxaWuHQmNZAokSKikCDq9NrrHU'[39m,
|
117
117
|
_type: [32m'CoStream'[39m,
|
118
|
-
|
119
|
-
in: {
|
118
|
+
co_zTfn2PmmXRTHLaTmdhyPA1B8U3s: [32m'jam'[39m,
|
119
|
+
in: { co_zTfn2PmmXRTHLaTmdhyPA1B8U3s_session_zDtwUk7ycBdB: [32m'jam'[39m }
|
120
120
|
}
|
121
121
|
subscribedStream[me.id]?.value?.[me.id]?.value?.[me.id]?.value jam
|
122
122
|
|
123
|
-
✓ src/tests/coStream.test.ts (10 tests)
|
123
|
+
✓ src/tests/coStream.test.ts (10 tests) 169ms
|
124
124
|
✓ src/tests/coMap.test.ts (11 tests) 188ms
|
125
125
|
stdout | src/tests/coMap.test.ts > CoMap resolution > Subscription & auto-resolution
|
126
126
|
subscribedMap.nested?.twiceNested?.taste [90mundefined[39m
|
@@ -135,6 +135,6 @@ subscribedMap.nested?.twiceNested?.taste umami
|
|
135
135
|
|
136
136
|
Test Files 5 passed (5)
|
137
137
|
Tests 35 passed (35)
|
138
|
-
Start at
|
139
|
-
Duration
|
138
|
+
Start at 17:19:35
|
139
|
+
Duration 716ms (transform 186ms, setup 0ms, collect 1.88s, tests 622ms, environment 0ms, prepare 242ms)
|
140
140
|
|
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# jazz-autosub
|
2
2
|
|
3
|
+
## 0.7.8
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- Fix CoMaps not initialising properly when passing too many init options
|
8
|
+
|
9
|
+
## 0.7.6
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- Provide way to create accounts as another account
|
14
|
+
|
3
15
|
## 0.7.3
|
4
16
|
|
5
17
|
### Patch Changes
|
package/dist/coValues/account.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
var _a;
|
2
|
-
import { LocalNode } from "cojson";
|
2
|
+
import { LocalNode, cojsonInternals } from "cojson";
|
3
3
|
import { Context } from "effect";
|
4
4
|
import { Group, CoValueBase, MembersSym, Profile, Ref, SchemaInit, inspect, subscriptionsScopes, loadCoValue, loadCoValueEf, subscribeToCoValue, subscribeToCoValueEf, ensureCoValueLoaded, subscribeToExistingCoValue, } from "../internal.js";
|
5
5
|
/** @category Identity & Permissions */
|
@@ -83,6 +83,16 @@ export class Account extends CoValueBase {
|
|
83
83
|
});
|
84
84
|
return this.fromNode(node);
|
85
85
|
}
|
86
|
+
static createAs(as, options) {
|
87
|
+
// TODO: is there a cleaner way to do this?
|
88
|
+
const connectedPeers = cojsonInternals.connectedPeers("creatingAccount", "createdAccount", { peer1role: "server", peer2role: "client" });
|
89
|
+
as._raw.core.node.syncManager.addPeer(connectedPeers[1]);
|
90
|
+
return this.create({
|
91
|
+
creationProps: options.creationProps,
|
92
|
+
crypto: as._raw.core.node.crypto,
|
93
|
+
peersToLoadFrom: [connectedPeers[0]],
|
94
|
+
});
|
95
|
+
}
|
86
96
|
static fromNode(node) {
|
87
97
|
return new this({
|
88
98
|
fromRaw: node.account,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/coValues/account.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/coValues/account.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAapD,OAAO,EAAE,OAAO,EAAkB,MAAM,QAAQ,CAAC;AAajD,OAAO,EACH,KAAK,EACL,WAAW,EACX,UAAU,EACV,OAAO,EACP,GAAG,EACH,UAAU,EACV,OAAO,EACP,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,0BAA0B,GAC7B,MAAM,gBAAgB,CAAC;AAExB,uCAAuC;AACvC,MAAM,OAAO,OAAQ,SAAQ,WAAW;IAOpC,IAAI,OAAO;QAIP,OAAQ,IAAI,CAAC,WAA8B,CAAC,OAAO,CAAC;IACxD,CAAC;IAYD,IAAI,MAAM;QACN,OAAO,IAAe,CAAC;IAC3B,CAAC;IACD,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpE,CAAC;IAKD,IAAI,KAAK;QACL,MAAM,SAAS,GAAG,IAAI,CAAC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BAC7C,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YACjC,OAAO,IAAI,CAAC;QAChB,CAAC;aAAM,CAAC;YACJ,OAAO,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;QAC3D,CAAC;IACL,CAAC;CACJ,CAAC;AAEF,uCAAuC;AACvC,MAAM,OAAO,UAAW,SAAQ,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAuB;CAAG;AAEhF,uCAAuC;AACvC,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAKhD,OAAO,OAAO,CAAC,IAAI,CAAC;AACxB,CAAC"}
|
package/dist/coValues/coList.js
CHANGED
@@ -1,10 +1,41 @@
|
|
1
1
|
var _a;
|
2
2
|
import { RawAccount } from "cojson";
|
3
|
-
import { Account, Group,
|
3
|
+
import { Account, Group, ItemsSym, Ref, SchemaInit, co, ensureCoValueLoaded, inspect, isRefEncoded, loadCoValue, loadCoValueEf, makeRefs, subscribeToCoValue, subscribeToCoValueEf, subscribeToExistingCoValue, } from "../internal.js";
|
4
4
|
import { encodeSync, decodeSync } from "@effect/schema/Schema";
|
5
|
-
/**
|
5
|
+
/**
|
6
|
+
* CoLists are collaborative versions of plain arrays.
|
7
|
+
*
|
8
|
+
* * @categoryDescription Content
|
9
|
+
* You can access items on a `CoList` as if they were normal items on a plain array, using `[]` notation, etc.
|
10
|
+
*
|
11
|
+
* Since `CoList` is a subclass of `Array`, you can use all the normal array methods like `push`, `pop`, `splice`, etc.
|
12
|
+
*
|
13
|
+
* ```ts
|
14
|
+
* colorList[0];
|
15
|
+
* colorList[3] = "yellow";
|
16
|
+
* colorList.push("Kawazaki Green");
|
17
|
+
* colorList.splice(1, 1);
|
18
|
+
* ```
|
19
|
+
*
|
20
|
+
* @category CoValues
|
21
|
+
*/
|
6
22
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
7
23
|
export class CoList extends Array {
|
24
|
+
/**
|
25
|
+
* Declare a `CoList` by subclassing `CoList.Of(...)` and passing the item schema using `co`.
|
26
|
+
*
|
27
|
+
* @example
|
28
|
+
* ```ts
|
29
|
+
* class ColorList extends CoList.Of(
|
30
|
+
* co.string
|
31
|
+
* ) {}
|
32
|
+
* class AnimalList extends CoList.Of(
|
33
|
+
* co.ref(Animal)
|
34
|
+
* ) {}
|
35
|
+
* ```
|
36
|
+
*
|
37
|
+
* @category Declaration
|
38
|
+
*/
|
8
39
|
static Of(item) {
|
9
40
|
var _b, _c;
|
10
41
|
// TODO: cache superclass for item class
|
@@ -17,19 +48,38 @@ export class CoList extends Array {
|
|
17
48
|
_b = co.items,
|
18
49
|
_c;
|
19
50
|
}
|
20
|
-
/**
|
51
|
+
/**
|
52
|
+
* @ignore
|
53
|
+
* @deprecated Use UPPERCASE `CoList.Of` instead! */
|
21
54
|
static of(..._args) {
|
22
55
|
throw new Error("Can't use Array.of with CoLists");
|
23
56
|
}
|
57
|
+
/** @internal */
|
24
58
|
get _schema() {
|
25
59
|
return this.constructor._schema;
|
26
60
|
}
|
61
|
+
/** @category Collaboration */
|
27
62
|
get _owner() {
|
28
63
|
return this._raw.group instanceof RawAccount
|
29
64
|
? Account.fromRaw(this._raw.group)
|
30
65
|
: Group.fromRaw(this._raw.group);
|
31
66
|
}
|
32
|
-
/**
|
67
|
+
/**
|
68
|
+
* If a `CoList`'s items are a `co.ref(...)`, you can use `coList._refs[i]` to access
|
69
|
+
* the `Ref` instead of the potentially loaded/null value.
|
70
|
+
*
|
71
|
+
* This allows you to always get the ID or load the value manually.
|
72
|
+
*
|
73
|
+
* @example
|
74
|
+
* ```ts
|
75
|
+
* animals._refs[0].id; // => ID<Animal>
|
76
|
+
* animals._refs[0].value;
|
77
|
+
* // => Animal | null
|
78
|
+
* const animal = await animals._refs[0].load();
|
79
|
+
* ```
|
80
|
+
*
|
81
|
+
* @category Content
|
82
|
+
**/
|
33
83
|
get _refs() {
|
34
84
|
return makeRefs((idx) => this._raw.get(idx), () => Array.from({ length: this._raw.entries().length }, (_, idx) => idx), this._loadedAs, (_idx) => this._schema[ItemsSym]);
|
35
85
|
}
|
@@ -48,13 +98,7 @@ export class CoList extends Array {
|
|
48
98
|
value: `instance-${Math.random().toString(36).slice(2)}`,
|
49
99
|
enumerable: false,
|
50
100
|
});
|
51
|
-
if ("
|
52
|
-
this[InitValues] = {
|
53
|
-
init: options.init,
|
54
|
-
owner: options.owner,
|
55
|
-
};
|
56
|
-
}
|
57
|
-
else if ("fromRaw" in options) {
|
101
|
+
if (options && "fromRaw" in options) {
|
58
102
|
Object.defineProperties(this, {
|
59
103
|
id: {
|
60
104
|
value: options.fromRaw.id,
|
@@ -65,8 +109,38 @@ export class CoList extends Array {
|
|
65
109
|
}
|
66
110
|
return new Proxy(this, CoListProxyHandler);
|
67
111
|
}
|
112
|
+
/**
|
113
|
+
* Create a new CoList with the given initial values and owner.
|
114
|
+
*
|
115
|
+
* The owner (a Group or Account) determines access rights to the CoMap.
|
116
|
+
*
|
117
|
+
* The CoList will immediately be persisted and synced to connected peers.
|
118
|
+
*
|
119
|
+
* @example
|
120
|
+
* ```ts
|
121
|
+
* const colours = ColorList.create(
|
122
|
+
* ["red", "green", "blue"],
|
123
|
+
* { owner: me }
|
124
|
+
* );
|
125
|
+
* const animals = AnimalList.create(
|
126
|
+
* [cat, dog, fish],
|
127
|
+
* { owner: me }
|
128
|
+
* );
|
129
|
+
* ```
|
130
|
+
*
|
131
|
+
* @category Creation
|
132
|
+
**/
|
68
133
|
static create(items, options) {
|
69
|
-
|
134
|
+
const instance = new this({ init: items, owner: options.owner });
|
135
|
+
const raw = options.owner._raw.createList(toRawItems(items, instance._schema[ItemsSym]));
|
136
|
+
Object.defineProperties(instance, {
|
137
|
+
id: {
|
138
|
+
value: raw.id,
|
139
|
+
enumerable: false,
|
140
|
+
},
|
141
|
+
_raw: { value: raw, enumerable: false },
|
142
|
+
});
|
143
|
+
return instance;
|
70
144
|
}
|
71
145
|
push(...items) {
|
72
146
|
for (const item of toRawItems(items, this._schema[ItemsSym])) {
|
@@ -123,34 +197,110 @@ export class CoList extends Array {
|
|
123
197
|
[inspect]() {
|
124
198
|
return this.toJSON();
|
125
199
|
}
|
200
|
+
/** @category Internals */
|
126
201
|
static fromRaw(raw) {
|
127
202
|
return new this({ fromRaw: raw });
|
128
203
|
}
|
204
|
+
/** @internal */
|
129
205
|
static schema(def) {
|
130
206
|
this._schema || (this._schema = {});
|
131
207
|
Object.assign(this._schema, def);
|
132
208
|
}
|
133
|
-
/**
|
209
|
+
/**
|
210
|
+
* Load a `CoList` with a given ID, as a given account.
|
211
|
+
*
|
212
|
+
* `depth` specifies if item CoValue references should be loaded as well before resolving.
|
213
|
+
* The `DeeplyLoaded` return type guarantees that corresponding referenced CoValues are loaded to the specified depth.
|
214
|
+
*
|
215
|
+
* You can pass `[]` or for shallowly loading only this CoList, or `[itemDepth]` for recursively loading referenced CoValues.
|
216
|
+
*
|
217
|
+
* Check out the `load` methods on `CoMap`/`CoList`/`CoStream`/`Group`/`Account` to see which depth structures are valid to nest.
|
218
|
+
*
|
219
|
+
* @example
|
220
|
+
* ```ts
|
221
|
+
* const animalsWithVets =
|
222
|
+
* await ListOfAnimals.load(
|
223
|
+
* "co_zdsMhHtfG6VNKt7RqPUPvUtN2Ax",
|
224
|
+
* me,
|
225
|
+
* [{ vet: {} }]
|
226
|
+
* );
|
227
|
+
* ```
|
228
|
+
*
|
229
|
+
* @category Subscription & Loading
|
230
|
+
*/
|
134
231
|
static load(id, as, depth) {
|
135
232
|
return loadCoValue(this, id, as, depth);
|
136
233
|
}
|
137
|
-
/**
|
234
|
+
/**
|
235
|
+
* Effectful version of `CoList.load()`.
|
236
|
+
*
|
237
|
+
* Needs to be run inside an `AccountCtx` context.
|
238
|
+
*
|
239
|
+
* @category Subscription & Loading
|
240
|
+
*/
|
138
241
|
static loadEf(id, depth) {
|
139
242
|
return loadCoValueEf(this, id, depth);
|
140
243
|
}
|
141
|
-
/**
|
244
|
+
/**
|
245
|
+
* Load and subscribe to a `CoList` with a given ID, as a given account.
|
246
|
+
*
|
247
|
+
* Automatically also subscribes to updates to all referenced/nested CoValues as soon as they are accessed in the listener.
|
248
|
+
*
|
249
|
+
* `depth` specifies if item CoValue references should be loaded as well before calling `listener` for the first time.
|
250
|
+
* The `DeeplyLoaded` return type guarantees that corresponding referenced CoValues are loaded to the specified depth.
|
251
|
+
*
|
252
|
+
* You can pass `[]` or for shallowly loading only this CoList, or `[itemDepth]` for recursively loading referenced CoValues.
|
253
|
+
*
|
254
|
+
* Check out the `load` methods on `CoMap`/`CoList`/`CoStream`/`Group`/`Account` to see which depth structures are valid to nest.
|
255
|
+
*
|
256
|
+
* Returns an unsubscribe function that you should call when you no longer need updates.
|
257
|
+
*
|
258
|
+
* Also see the `useCoState` hook to reactively subscribe to a CoValue in a React component.
|
259
|
+
*
|
260
|
+
* @example
|
261
|
+
* ```ts
|
262
|
+
* const unsub = ListOfAnimals.subscribe(
|
263
|
+
* "co_zdsMhHtfG6VNKt7RqPUPvUtN2Ax",
|
264
|
+
* me,
|
265
|
+
* { vet: {} },
|
266
|
+
* (animalsWithVets) => console.log(animalsWithVets)
|
267
|
+
* );
|
268
|
+
* ```
|
269
|
+
*
|
270
|
+
* @category Subscription & Loading
|
271
|
+
*/
|
142
272
|
static subscribe(id, as, depth, listener) {
|
143
273
|
return subscribeToCoValue(this, id, as, depth, listener);
|
144
274
|
}
|
145
|
-
/**
|
275
|
+
/**
|
276
|
+
* Effectful version of `CoList.subscribe()` that returns a stream of updates.
|
277
|
+
*
|
278
|
+
* Needs to be run inside an `AccountCtx` context.
|
279
|
+
*
|
280
|
+
* @category Subscription & Loading
|
281
|
+
*/
|
146
282
|
static subscribeEf(id, depth) {
|
147
283
|
return subscribeToCoValueEf(this, id, depth);
|
148
284
|
}
|
149
|
-
/**
|
285
|
+
/**
|
286
|
+
* Given an already loaded `CoList`, ensure that items are loaded to the specified depth.
|
287
|
+
*
|
288
|
+
* Works like `CoList.load()`, but you don't need to pass the ID or the account to load as again.
|
289
|
+
*
|
290
|
+
* @category Subscription & Loading
|
291
|
+
*/
|
150
292
|
ensureLoaded(depth) {
|
151
293
|
return ensureCoValueLoaded(this, depth);
|
152
294
|
}
|
153
|
-
/**
|
295
|
+
/**
|
296
|
+
* Given an already loaded `CoList`, subscribe to updates to the `CoList` and ensure that items are loaded to the specified depth.
|
297
|
+
*
|
298
|
+
* Works like `CoList.subscribe()`, but you don't need to pass the ID or the account to load as again.
|
299
|
+
*
|
300
|
+
* Returns an unsubscribe function that you should call when you no longer need updates.
|
301
|
+
*
|
302
|
+
* @category Subscription & Loading
|
303
|
+
**/
|
154
304
|
subscribe(depth, listener) {
|
155
305
|
return subscribeToExistingCoValue(this, depth, listener);
|
156
306
|
}
|
@@ -175,20 +325,6 @@ function toRawItems(items, itemDescriptor) {
|
|
175
325
|
})();
|
176
326
|
return rawItems;
|
177
327
|
}
|
178
|
-
function init(list) {
|
179
|
-
if (list[InitValues]) {
|
180
|
-
const { init, owner } = list[InitValues];
|
181
|
-
const raw = owner._raw.createList(toRawItems(init, list._schema[ItemsSym]));
|
182
|
-
Object.defineProperties(list, {
|
183
|
-
id: {
|
184
|
-
value: raw.id,
|
185
|
-
enumerable: false,
|
186
|
-
},
|
187
|
-
_raw: { value: raw, enumerable: false },
|
188
|
-
});
|
189
|
-
delete list[InitValues];
|
190
|
-
}
|
191
|
-
}
|
192
328
|
const CoListProxyHandler = {
|
193
329
|
get(target, key, receiver) {
|
194
330
|
if (typeof key === "string" && !isNaN(+key)) {
|
@@ -223,7 +359,6 @@ const CoListProxyHandler = {
|
|
223
359
|
(_b = target.constructor)._schema || (_b._schema = {});
|
224
360
|
target.constructor._schema[ItemsSym] =
|
225
361
|
value[SchemaInit];
|
226
|
-
init(target);
|
227
362
|
return true;
|
228
363
|
}
|
229
364
|
if (typeof key === "string" && !isNaN(+key)) {
|
@@ -254,7 +389,6 @@ const CoListProxyHandler = {
|
|
254
389
|
(_b = target.constructor)._schema || (_b._schema = {});
|
255
390
|
target.constructor._schema[ItemsSym] =
|
256
391
|
descriptor.value[SchemaInit];
|
257
|
-
init(target);
|
258
392
|
return true;
|
259
393
|
}
|
260
394
|
else {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"coList.js","sourceRoot":"","sources":["../../src/coValues/coList.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAepC,OAAO,EACH,OAAO,EACP,KAAK,EACL,
|
1
|
+
{"version":3,"file":"coList.js","sourceRoot":"","sources":["../../src/coValues/coList.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAepC,OAAO,EACH,OAAO,EACP,KAAK,EACL,QAAQ,EACR,GAAG,EACH,UAAU,EACV,EAAE,EACF,mBAAmB,EACnB,OAAO,EACP,YAAY,EACZ,WAAW,EACX,aAAa,EACb,QAAQ,EACR,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,GAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAG/D;;;;;;;;;;;;;;;;GAgBG;AACH,8DAA8D;AAC9D,MAAM,OAAO,MAAmB,SAAQ,KAAW;IAC/C;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,EAAE,CAAO,IAAU;;QACtB,wCAAwC;QACxC,YAAO,MAAM,QAAS,SAAQ,EAAY;gBAAnC;;oBACH,QAAU,GAAG,IAAI,CAAC;gBACtB,CAAC;aAAA;iBADI,EAAE,CAAC,KAAK;eACX;IACN,CAAC;IAED;;wDAEoD;IACpD,MAAM,CAAC,EAAE,CAAC,GAAG,KAAY;QACrB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACvD,CAAC;IAqBD,gBAAgB;IAChB,IAAI,OAAO;QAGP,OAAQ,IAAI,CAAC,WAA6B,CAAC,OAAO,CAAC;IACvD,CAAC;IAED,8BAA8B;I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