jazz-tools 0.18.28 → 0.18.29

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.18.28 build /home/runner/_work/jazz/jazz/packages/jazz-tools
2
+ > jazz-tools@0.18.29 build /home/runner/_work/jazz/jazz/packages/jazz-tools
3
3
  > tsup && pnpm types && pnpm build:svelte
4
4
 
5
5
  CLI Building entry: {"index":"src/index.ts","testing":"src/testing.ts","tools/ssr":"src/tools/ssr/index.ts"}
@@ -107,105 +107,105 @@
107
107
  ESM Build start
108
108
  CLI Cleaning output folder
109
109
  ESM Build start
110
- ESM dist/tiptap/index.js 564.00 B
111
- ESM dist/tiptap/index.js.map 1.21 KB
112
- ESM ⚡️ Build success in 46ms
113
- ESM dist/worker/napi-crypto.js 110.00 B
114
110
  ESM dist/worker/index.js 3.16 KB
115
111
  ESM dist/worker/edge-wasm.js 215.00 B
116
- ESM dist/worker/napi-crypto.js.map 162.00 B
117
- ESM dist/worker/index.js.map 6.14 KB
112
+ ESM dist/worker/napi-crypto.js 110.00 B
118
113
  ESM dist/worker/edge-wasm.js.map 434.00 B
119
- ESM ⚡️ Build success in 46ms
120
- ESM dist/better-auth/auth/client.js 4.50 KB
114
+ ESM dist/worker/index.js.map 6.14 KB
115
+ ESM dist/worker/napi-crypto.js.map 162.00 B
116
+ ESM ⚡️ Build success in 35ms
117
+ ESM dist/tiptap/index.js 564.00 B
118
+ ESM dist/tiptap/index.js.map 1.21 KB
119
+ ESM ⚡️ Build success in 39ms
121
120
  ESM dist/better-auth/auth/server.js 8.36 KB
122
121
  ESM dist/better-auth/auth/react.js 799.00 B
123
- ESM dist/better-auth/auth/client.js.map 8.32 KB
122
+ ESM dist/better-auth/auth/client.js 4.50 KB
124
123
  ESM dist/better-auth/auth/server.js.map 15.29 KB
125
124
  ESM dist/better-auth/auth/react.js.map 2.04 KB
126
- ESM ⚡️ Build success in 40ms
125
+ ESM dist/better-auth/auth/client.js.map 8.32 KB
126
+ ESM ⚡️ Build success in 35ms
127
+ ESM dist/media/index.js 236.00 B
128
+ ESM dist/media/index.browser.js 2.79 KB
129
+ ESM dist/media/index.native.js 4.01 KB
130
+ ESM dist/media/index.server.js 2.95 KB
131
+ ESM dist/media/chunk-K6GCHLQU.js 6.47 KB
132
+ ESM dist/media/index.js.map 71.00 B
133
+ ESM dist/media/index.browser.js.map 6.15 KB
134
+ ESM dist/media/index.native.js.map 8.10 KB
135
+ ESM dist/media/index.server.js.map 6.37 KB
136
+ ESM dist/media/chunk-K6GCHLQU.js.map 16.64 KB
137
+ ESM ⚡️ Build success in 42ms
127
138
  ESM dist/react-native/index.js 2.53 KB
128
- ESM dist/react-native/crypto.js 161.00 B
129
139
  ESM dist/react-native/testing.js 120.00 B
140
+ ESM dist/react-native/crypto.js 161.00 B
141
+ ESM dist/react-native/testing.js.map 176.00 B
130
142
  ESM dist/react-native/index.js.map 5.68 KB
131
143
  ESM dist/react-native/crypto.js.map 197.00 B
132
- ESM dist/react-native/testing.js.map 176.00 B
133
- ESM ⚡️ Build success in 43ms
144
+ ESM ⚡️ Build success in 38ms
134
145
  ESM dist/expo/index.js 4.68 KB
135
- ESM dist/expo/crypto.js 153.00 B
136
146
  ESM dist/expo/testing.js 112.00 B
147
+ ESM dist/expo/crypto.js 153.00 B
137
148
  ESM dist/expo/index.js.map 10.23 KB
138
149
  ESM dist/expo/testing.js.map 168.00 B
139
150
  ESM dist/expo/crypto.js.map 189.00 B
140
- ESM ⚡️ Build success in 45ms
151
+ ESM ⚡️ Build success in 44ms
141
152
  ESM dist/react-core/index.js 14.06 KB
142
- ESM dist/react-core/chunk-7DYMJ74I.js 279.00 B
143
153
  ESM dist/react-core/testing.js 1.22 KB
154
+ ESM dist/react-core/chunk-7DYMJ74I.js 279.00 B
144
155
  ESM dist/react-core/index.js.map 42.79 KB
145
156
  ESM dist/react-core/testing.js.map 1.86 KB
146
157
  ESM dist/react-core/chunk-7DYMJ74I.js.map 533.00 B
147
- ESM ⚡️ Build success in 50ms
148
- ESM dist/media/index.js 236.00 B
149
- ESM dist/media/index.native.js 4.01 KB
150
- ESM dist/media/index.browser.js 2.79 KB
151
- ESM dist/media/index.server.js 2.95 KB
152
- ESM dist/media/chunk-K6GCHLQU.js 6.47 KB
153
- ESM dist/media/index.js.map 71.00 B
154
- ESM dist/media/index.native.js.map 8.10 KB
155
- ESM dist/media/index.browser.js.map 6.15 KB
156
- ESM dist/media/index.server.js.map 6.37 KB
157
- ESM dist/media/chunk-K6GCHLQU.js.map 16.64 KB
158
- ESM ⚡️ Build success in 56ms
158
+ ESM ⚡️ Build success in 54ms
159
159
  ESM dist/browser/index.js 14.06 KB
160
160
  ESM dist/browser/index.js.map 29.94 KB
161
- ESM ⚡️ Build success in 55ms
161
+ ESM ⚡️ Build success in 58ms
162
162
  ESM dist/better-auth/database-adapter/index.js 26.34 KB
163
163
  ESM dist/better-auth/database-adapter/index.js.map 57.62 KB
164
- ESM ⚡️ Build success in 47ms
165
- ESM dist/react-native-core/testing.js 119.00 B
166
- ESM dist/react-native-core/crypto.js 2.10 KB
164
+ ESM ⚡️ Build success in 53ms
165
+ ESM dist/prosemirror/index.js 77.76 KB
166
+ ESM dist/prosemirror/index.js.map 307.20 KB
167
+ ESM ⚡️ Build success in 73ms
167
168
  ESM dist/react-native-core/index.js 18.93 KB
168
- ESM dist/react-native-core/testing.js.map 175.00 B
169
+ ESM dist/react-native-core/crypto.js 2.10 KB
170
+ ESM dist/react-native-core/testing.js 119.00 B
169
171
  ESM dist/react-native-core/crypto.js.map 4.25 KB
172
+ ESM dist/react-native-core/testing.js.map 175.00 B
170
173
  ESM dist/react-native-core/index.js.map 38.12 KB
171
- ESM ⚡️ Build success in 57ms
172
- ESM dist/prosemirror/index.js 77.76 KB
173
- ESM dist/prosemirror/index.js.map 307.20 KB
174
- ESM ⚡️ Build success in 67ms
174
+ ESM ⚡️ Build success in 71ms
175
175
  ESM dist/react/index.js 25.32 KB
176
- ESM dist/react/ssr.js 697.00 B
177
176
  ESM dist/react/testing.js 122.00 B
178
- ESM dist/react/ssr.js.map 1.11 KB
177
+ ESM dist/react/ssr.js 697.00 B
179
178
  ESM dist/react/index.js.map 54.33 KB
180
179
  ESM dist/react/testing.js.map 165.00 B
181
- ESM ⚡️ Build success in 56ms
182
- ESM dist/inspector/index.js 71.88 KB
183
- ESM dist/inspector/index.js.map 124.87 KB
184
- ESM ⚡️ Build success in 70ms
185
- ESM dist/tools/ssr.js 156.00 B
186
- ESM dist/index.js 28.78 KB
180
+ ESM dist/react/ssr.js.map 1.11 KB
181
+ ESM ⚡️ Build success in 66ms
182
+ ESM dist/inspector/index.js 71.82 KB
183
+ ESM dist/inspector/index.js.map 124.77 KB
184
+ ESM ⚡️ Build success in 76ms
185
+ ESM dist/index.js 28.82 KB
186
+ ESM dist/testing.js 8.32 KB
187
187
  ESM dist/chunk-M2HGBOXS.js 694.00 B
188
+ ESM dist/tools/ssr.js 156.00 B
188
189
  ESM dist/chunk-PZ5AY32C.js 233.00 B
189
- ESM dist/testing.js 8.32 KB
190
- ESM dist/chunk-YOL3XDDW.js 189.94 KB
190
+ ESM dist/chunk-F55R554M.js 190.62 KB
191
+ ESM dist/testing.js.map 15.83 KB
192
+ ESM dist/chunk-M2HGBOXS.js.map 1.10 KB
191
193
  ESM dist/tools/ssr.js.map 71.00 B
192
- ESM dist/chunk-PZ5AY32C.js.map 71.00 B
193
194
  ESM dist/index.js.map 59.94 KB
194
- ESM dist/chunk-M2HGBOXS.js.map 1.10 KB
195
- ESM dist/testing.js.map 15.83 KB
196
- ESM dist/chunk-YOL3XDDW.js.map 450.04 KB
197
- ESM ⚡️ Build success in 86ms
195
+ ESM dist/chunk-PZ5AY32C.js.map 71.00 B
196
+ ESM dist/chunk-F55R554M.js.map 451.36 KB
197
+ ESM ⚡️ Build success in 97ms
198
198
  ESM dist/inspector/register-custom-element.js 218.00 B
199
199
  ESM dist/inspector/register-custom-element.js.map 314.00 B
200
- ESM dist/inspector/custom-element-A7UAELEG.js 1.54 MB
201
- ESM dist/inspector/custom-element-A7UAELEG.js.map 2.36 MB
202
- ESM ⚡️ Build success in 139ms
200
+ ESM dist/inspector/custom-element-35MDW4SW.js 1.54 MB
201
+ ESM dist/inspector/custom-element-35MDW4SW.js.map 2.36 MB
202
+ ESM ⚡️ Build success in 144ms
203
203
 
204
- > jazz-tools@0.18.28 types /home/runner/_work/jazz/jazz/packages/jazz-tools
204
+ > jazz-tools@0.18.29 types /home/runner/_work/jazz/jazz/packages/jazz-tools
205
205
  > tsc --outDir dist
206
206
 
207
207
 
208
- > jazz-tools@0.18.28 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
208
+ > jazz-tools@0.18.29 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
209
209
  > rm -rf dist/svelte && svelte-package -i src/svelte -o dist/svelte --tsconfig tsconfig.svelte.json
210
210
 
211
211
  src/svelte -> dist/svelte
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # jazz-tools
2
2
 
3
+ ## 0.18.29
4
+
5
+ ### Patch Changes
6
+
7
+ - cc7efc8: Fix upsertUnique when the account doesn't have access to the value
8
+ - f55d17f: fix inspector component in non-React apps
9
+ - cojson@0.18.29
10
+ - cojson-storage-indexeddb@0.18.29
11
+ - cojson-transport-ws@0.18.29
12
+
3
13
  ## 0.18.28
4
14
 
5
15
  ### Patch Changes
@@ -476,7 +476,7 @@ var _CoMap = class _CoMap extends CoValueBase {
476
476
  options.unique,
477
477
  options.owner.$jazz.id
478
478
  );
479
- return unstable_loadUnique(this, {
479
+ return internalLoadUnique(this, {
480
480
  header,
481
481
  owner: options.owner,
482
482
  resolve: options.resolve,
@@ -506,7 +506,7 @@ var _CoMap = class _CoMap extends CoValueBase {
506
506
  loadAs: options?.loadAs
507
507
  });
508
508
  if (!owner) return owner;
509
- return unstable_loadUnique(this, {
509
+ return internalLoadUnique(this, {
510
510
  header,
511
511
  owner,
512
512
  resolve: options?.resolve
@@ -1030,7 +1030,7 @@ var _CoList = class _CoList extends Array {
1030
1030
  options.unique,
1031
1031
  options.owner.$jazz.id
1032
1032
  );
1033
- return unstable_loadUnique(this, {
1033
+ return internalLoadUnique(this, {
1034
1034
  header,
1035
1035
  owner: options.owner,
1036
1036
  resolve: options.resolve,
@@ -1058,7 +1058,7 @@ var _CoList = class _CoList extends Array {
1058
1058
  loadAs: options?.loadAs
1059
1059
  });
1060
1060
  if (!owner) return owner;
1061
- return unstable_loadUnique(this, {
1061
+ return internalLoadUnique(this, {
1062
1062
  header,
1063
1063
  owner,
1064
1064
  resolve: options?.resolve
@@ -6401,29 +6401,41 @@ function getIdFromHeader(header, loadAs) {
6401
6401
  const node = loadAs[TypeSym] === "Anonymous" ? loadAs.node : loadAs.$jazz.localNode;
6402
6402
  return cojsonInternals6.idforHeader(header, node.crypto);
6403
6403
  }
6404
- async function unstable_loadUnique(cls, options) {
6404
+ async function unstable_loadUnique(schema, options) {
6405
+ const cls = coValueClassFromCoValueClassOrSchema(schema);
6406
+ if (!("_getUniqueHeader" in cls) || typeof cls._getUniqueHeader !== "function") {
6407
+ throw new Error("CoValue class does not support unique headers");
6408
+ }
6409
+ const header = cls._getUniqueHeader(options.unique, options.owner.$jazz.id);
6410
+ return internalLoadUnique(cls, {
6411
+ header,
6412
+ onCreateWhenMissing: options.onCreateWhenMissing,
6413
+ // @ts-expect-error loaded is not compatible with Resolved at type level, but they are the same thing
6414
+ onUpdateWhenFound: options.onUpdateWhenFound,
6415
+ owner: options.owner,
6416
+ // @ts-expect-error loaded is not compatible with Resolved at type level, but they are the same thing
6417
+ resolve: options.resolve
6418
+ });
6419
+ }
6420
+ async function internalLoadUnique(cls, options) {
6405
6421
  const loadAs = options.owner.$jazz.loadedAs;
6406
6422
  const node = loadAs[TypeSym] === "Anonymous" ? loadAs.node : loadAs.$jazz.localNode;
6407
6423
  const id = cojsonInternals6.idforHeader(options.header, node.crypto);
6408
- let result = await loadCoValueWithoutMe(cls, id, {
6424
+ await loadCoValueWithoutMe(cls, id, {
6409
6425
  skipRetry: true,
6410
6426
  loadAs
6411
6427
  });
6412
- if (options.onCreateWhenMissing) {
6413
- if (!result && node.getCoValue(id).hasVerifiedContent()) {
6414
- result = await loadCoValueWithoutMe(cls, id, {
6415
- loadAs
6416
- });
6417
- }
6418
- if (!result) {
6419
- options.onCreateWhenMissing();
6420
- return loadCoValueWithoutMe(cls, id, {
6421
- loadAs,
6422
- resolve: options.resolve
6423
- });
6424
- }
6428
+ const isAvailable = node.getCoValue(id).hasVerifiedContent();
6429
+ if (options.onCreateWhenMissing && !isAvailable) {
6430
+ options.onCreateWhenMissing();
6431
+ return loadCoValueWithoutMe(cls, id, {
6432
+ loadAs,
6433
+ resolve: options.resolve
6434
+ });
6435
+ }
6436
+ if (!isAvailable) {
6437
+ return null;
6425
6438
  }
6426
- if (!result) return result;
6427
6439
  if (options.onUpdateWhenFound) {
6428
6440
  const loaded = await loadCoValueWithoutMe(cls, id, {
6429
6441
  loadAs,
@@ -6563,6 +6575,7 @@ export {
6563
6575
  zodReExport_exports,
6564
6576
  loadCoValue,
6565
6577
  subscribeToCoValue,
6578
+ unstable_loadUnique,
6566
6579
  exportCoValue,
6567
6580
  importContentPieces,
6568
6581
  CoValueBase,
@@ -6601,4 +6614,4 @@ export {
6601
6614
  JazzContextManager
6602
6615
  };
6603
6616
  /* istanbul ignore file -- @preserve */
6604
- //# sourceMappingURL=chunk-YOL3XDDW.js.map
6617
+ //# sourceMappingURL=chunk-F55R554M.js.map