jazz-tools 0.13.5 → 0.13.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +18 -0
- package/LICENSE.txt +1 -1
- package/dist/{chunk-IYNL2EJM.js → chunk-NFVKGXSH.js} +19 -4
- package/dist/chunk-NFVKGXSH.js.map +1 -0
- package/dist/coValues/account.d.ts.map +1 -1
- package/dist/coValues/deepLoading.d.ts.map +1 -1
- package/dist/coValues/group.d.ts +1 -1
- package/dist/coValues/group.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/testing.js +1 -1
- package/dist/tests/patterns/requestToJoin.test.d.ts +2 -0
- package/dist/tests/patterns/requestToJoin.test.d.ts.map +1 -0
- package/package.json +4 -4
- package/src/coValues/account.ts +5 -1
- package/src/coValues/coList.ts +5 -1
- package/src/coValues/deepLoading.ts +15 -1
- package/src/coValues/group.ts +1 -1
- package/src/tests/ContextManager.test.ts +1 -1
- package/src/tests/groupsAndAccounts.test.ts +7 -6
- package/src/tests/patterns/requestToJoin.test.ts +269 -0
- package/src/tests/subscribe.test.ts +205 -0
- package/tsconfig.json +1 -1
- package/dist/chunk-IYNL2EJM.js.map +0 -1
package/.turbo/turbo-build.log
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> jazz-tools@0.13.
|
2
|
+
> jazz-tools@0.13.9 build /home/runner/_work/jazz/jazz/packages/jazz-tools
|
3
3
|
> tsup && pnpm types
|
4
4
|
|
5
5
|
[34mCLI[39m Building entry: {"index":"src/index.ts","testing":"src/testing.ts"}
|
@@ -11,12 +11,12 @@
|
|
11
11
|
[34mESM[39m Build start
|
12
12
|
[32mESM[39m [1mdist/index.js [22m[32m1.50 KB[39m
|
13
13
|
[32mESM[39m [1mdist/testing.js [22m[32m6.26 KB[39m
|
14
|
-
[32mESM[39m [1mdist/chunk-
|
14
|
+
[32mESM[39m [1mdist/chunk-NFVKGXSH.js [22m[32m128.03 KB[39m
|
15
15
|
[32mESM[39m [1mdist/index.js.map [22m[32m259.00 B[39m
|
16
16
|
[32mESM[39m [1mdist/testing.js.map [22m[32m12.37 KB[39m
|
17
|
-
[32mESM[39m [1mdist/chunk-
|
18
|
-
[32mESM[39m ⚡️ Build success in
|
17
|
+
[32mESM[39m [1mdist/chunk-NFVKGXSH.js.map [22m[32m301.60 KB[39m
|
18
|
+
[32mESM[39m ⚡️ Build success in 58ms
|
19
19
|
|
20
|
-
> jazz-tools@0.13.
|
20
|
+
> jazz-tools@0.13.9 types /home/runner/_work/jazz/jazz/packages/jazz-tools
|
21
21
|
> tsc --outDir dist
|
22
22
|
|
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
# jazz-tools
|
2
2
|
|
3
|
+
## 0.13.9
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- a6cf01f: Handle null values on CoList when using $each: true
|
8
|
+
|
9
|
+
## 0.13.7
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- bc3d7bb: Allow to assign the writeOnly role to everyone
|
14
|
+
- Updated dependencies [bc3d7bb]
|
15
|
+
- Updated dependencies [4e9aae1]
|
16
|
+
- Updated dependencies [21c935c]
|
17
|
+
- Updated dependencies [aa1c80e]
|
18
|
+
- Updated dependencies [13074be]
|
19
|
+
- cojson@0.13.7
|
20
|
+
|
3
21
|
## 0.13.5
|
4
22
|
|
5
23
|
### Patch Changes
|
package/LICENSE.txt
CHANGED
@@ -73,7 +73,7 @@ function fulfillsDepth(depth, value) {
|
|
73
73
|
const result = { status: "fulfilled" };
|
74
74
|
for (const [key, item] of Object.entries(value)) {
|
75
75
|
const rawValue = map._raw.get(key);
|
76
|
-
if (rawValue !== void 0) {
|
76
|
+
if (rawValue !== void 0 && rawValue !== null) {
|
77
77
|
if (!item) {
|
78
78
|
if (hasReadAccess(map, key)) {
|
79
79
|
result.status = "unfulfilled";
|
@@ -154,7 +154,17 @@ function fulfillsDepth(depth, value) {
|
|
154
154
|
} else if (value._type === "CoList") {
|
155
155
|
if ("$each" in depth) {
|
156
156
|
const result = { status: "fulfilled" };
|
157
|
+
const list = value;
|
157
158
|
for (const [key, item] of value.entries()) {
|
159
|
+
const rawValue = list._raw.get(key);
|
160
|
+
if (!rawValue) {
|
161
|
+
if (isOptionalField(value, ItemsSym)) {
|
162
|
+
continue;
|
163
|
+
}
|
164
|
+
throw new Error(
|
165
|
+
`The ref ${key} on ${list.constructor.name} is required but missing`
|
166
|
+
);
|
167
|
+
}
|
158
168
|
if (hasRefValue(value, key)) {
|
159
169
|
if (!item) {
|
160
170
|
if (hasReadAccess(value, key)) {
|
@@ -1967,11 +1977,13 @@ var _Account = class _Account extends CoValueBase {
|
|
1967
1977
|
{ peer1role: "server", peer2role: "client" }
|
1968
1978
|
);
|
1969
1979
|
as._raw.core.node.syncManager.addPeer(connectedPeers[1]);
|
1970
|
-
|
1980
|
+
const account = await this.create({
|
1971
1981
|
creationProps: options.creationProps,
|
1972
1982
|
crypto: as._raw.core.node.crypto,
|
1973
1983
|
peersToLoadFrom: [connectedPeers[0]]
|
1974
1984
|
});
|
1985
|
+
await account.waitForAllCoValuesSync();
|
1986
|
+
return account;
|
1975
1987
|
}
|
1976
1988
|
static fromNode(node) {
|
1977
1989
|
return new this({
|
@@ -2963,7 +2975,10 @@ var _CoList = class _CoList extends Array {
|
|
2963
2975
|
_CoList.prototype._type = "CoList";
|
2964
2976
|
var CoList = _CoList;
|
2965
2977
|
function toRawItems(items, itemDescriptor) {
|
2966
|
-
const rawItems = itemDescriptor === "json" ? items : "encoded" in itemDescriptor ? items?.map((e) => itemDescriptor.encoded.encode(e)) : isRefEncoded(itemDescriptor) ? items?.map((v) =>
|
2978
|
+
const rawItems = itemDescriptor === "json" ? items : "encoded" in itemDescriptor ? items?.map((e) => itemDescriptor.encoded.encode(e)) : isRefEncoded(itemDescriptor) ? items?.map((v) => {
|
2979
|
+
if (!v) return null;
|
2980
|
+
return v.id;
|
2981
|
+
}) : (() => {
|
2967
2982
|
throw new Error("Invalid element descriptor");
|
2968
2983
|
})();
|
2969
2984
|
return rawItems;
|
@@ -4441,4 +4456,4 @@ export {
|
|
4441
4456
|
consumeInviteLink
|
4442
4457
|
};
|
4443
4458
|
/* istanbul ignore file -- @preserve */
|
4444
|
-
//# sourceMappingURL=chunk-
|
4459
|
+
//# sourceMappingURL=chunk-NFVKGXSH.js.map
|