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.
@@ -1,5 +1,5 @@
1
1
 
2
- > jazz-tools@0.13.5 build /home/runner/_work/jazz/jazz/packages/jazz-tools
2
+ > jazz-tools@0.13.9 build /home/runner/_work/jazz/jazz/packages/jazz-tools
3
3
  > tsup && pnpm types
4
4
 
5
5
  CLI Building entry: {"index":"src/index.ts","testing":"src/testing.ts"}
@@ -11,12 +11,12 @@
11
11
  ESM Build start
12
12
  ESM dist/index.js 1.50 KB
13
13
  ESM dist/testing.js 6.26 KB
14
- ESM dist/chunk-IYNL2EJM.js 127.59 KB
14
+ ESM dist/chunk-NFVKGXSH.js 128.03 KB
15
15
  ESM dist/index.js.map 259.00 B
16
16
  ESM dist/testing.js.map 12.37 KB
17
- ESM dist/chunk-IYNL2EJM.js.map 300.73 KB
18
- ESM ⚡️ Build success in 69ms
17
+ ESM dist/chunk-NFVKGXSH.js.map 301.60 KB
18
+ ESM ⚡️ Build success in 58ms
19
19
 
20
- > jazz-tools@0.13.5 types /home/runner/_work/jazz/jazz/packages/jazz-tools
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
@@ -1,4 +1,4 @@
1
- Copyright 2024, Garden Computing, Inc.
1
+ Copyright 2025, Garden Computing, Inc.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
@@ -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
- return this.create({
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) => v.id) : (() => {
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-IYNL2EJM.js.map
4459
+ //# sourceMappingURL=chunk-NFVKGXSH.js.map