jazz-tools 0.19.13 → 0.19.15

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.19.13 build /home/runner/_work/jazz/jazz/packages/jazz-tools
2
+ > jazz-tools@0.19.15 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"}
@@ -109,21 +109,21 @@
109
109
  ESM Build start
110
110
  ESM dist/tiptap/index.js 564.00 B
111
111
  ESM dist/tiptap/index.js.map 1.21 KB
112
- ESM ⚡️ Build success in 62ms
112
+ ESM ⚡️ Build success in 84ms
113
+ ESM dist/worker/index.js 3.19 KB
114
+ ESM dist/worker/edge-wasm.js 215.00 B
115
+ ESM dist/worker/napi-crypto.js 110.00 B
116
+ ESM dist/worker/edge-wasm.js.map 434.00 B
117
+ ESM dist/worker/index.js.map 6.26 KB
118
+ ESM dist/worker/napi-crypto.js.map 162.00 B
119
+ ESM ⚡️ Build success in 81ms
113
120
  ESM dist/better-auth/auth/client.js 4.50 KB
114
121
  ESM dist/better-auth/auth/server.js 8.36 KB
115
122
  ESM dist/better-auth/auth/react.js 799.00 B
116
123
  ESM dist/better-auth/auth/client.js.map 8.32 KB
117
124
  ESM dist/better-auth/auth/server.js.map 15.31 KB
118
125
  ESM dist/better-auth/auth/react.js.map 2.04 KB
119
- ESM ⚡️ Build success in 50ms
120
- ESM dist/worker/index.js 3.19 KB
121
- ESM dist/worker/edge-wasm.js 215.00 B
122
- ESM dist/worker/napi-crypto.js 110.00 B
123
- ESM dist/worker/index.js.map 6.26 KB
124
- ESM dist/worker/edge-wasm.js.map 434.00 B
125
- ESM dist/worker/napi-crypto.js.map 162.00 B
126
- ESM ⚡️ Build success in 72ms
126
+ ESM ⚡️ Build success in 74ms
127
127
  ESM dist/media/index.js 236.00 B
128
128
  ESM dist/media/index.browser.js 2.79 KB
129
129
  ESM dist/media/index.native.js 4.01 KB
@@ -134,88 +134,88 @@
134
134
  ESM dist/media/index.native.js.map 8.10 KB
135
135
  ESM dist/media/index.server.js.map 6.37 KB
136
136
  ESM dist/media/chunk-3LKBM3G3.js.map 16.99 KB
137
- ESM ⚡️ Build success in 82ms
138
- ESM dist/react-core/index.js 17.05 KB
139
- ESM dist/react-core/testing.js 1.22 KB
140
- ESM dist/react-core/chunk-7DYMJ74I.js 279.00 B
141
- ESM dist/react-core/index.js.map 49.77 KB
142
- ESM dist/react-core/testing.js.map 1.86 KB
143
- ESM dist/react-core/chunk-7DYMJ74I.js.map 533.00 B
144
- ESM ⚡️ Build success in 91ms
137
+ ESM ⚡️ Build success in 80ms
145
138
  ESM dist/expo/index.js 4.68 KB
146
- ESM dist/expo/testing.js 112.00 B
147
139
  ESM dist/expo/crypto.js 153.00 B
140
+ ESM dist/expo/testing.js 112.00 B
148
141
  ESM dist/expo/polyfills.js 858.00 B
149
142
  ESM dist/expo/index.js.map 10.23 KB
150
- ESM dist/expo/testing.js.map 168.00 B
151
143
  ESM dist/expo/crypto.js.map 189.00 B
144
+ ESM dist/expo/testing.js.map 168.00 B
152
145
  ESM dist/expo/polyfills.js.map 1.61 KB
153
- ESM ⚡️ Build success in 84ms
146
+ ESM ⚡️ Build success in 98ms
154
147
  ESM dist/prosemirror/index.js 77.76 KB
155
148
  ESM dist/prosemirror/index.js.map 307.20 KB
156
- ESM ⚡️ Build success in 108ms
149
+ ESM ⚡️ Build success in 117ms
150
+ ESM dist/react-core/index.js 17.05 KB
151
+ ESM dist/react-core/testing.js 1.22 KB
152
+ ESM dist/react-core/chunk-7DYMJ74I.js 279.00 B
153
+ ESM dist/react-core/index.js.map 49.77 KB
154
+ ESM dist/react-core/testing.js.map 1.86 KB
155
+ ESM dist/react-core/chunk-7DYMJ74I.js.map 533.00 B
156
+ ESM ⚡️ Build success in 119ms
157
157
  ESM dist/better-auth/database-adapter/index.js 26.65 KB
158
158
  ESM dist/better-auth/database-adapter/index.js.map 58.26 KB
159
- ESM ⚡️ Build success in 93ms
159
+ ESM ⚡️ Build success in 111ms
160
160
  ESM dist/browser/index.js 16.14 KB
161
161
  ESM dist/browser/index.js.map 34.66 KB
162
- ESM ⚡️ Build success in 114ms
163
- ESM dist/react-native-core/index.js 19.96 KB
162
+ ESM ⚡️ Build success in 130ms
163
+ ESM dist/react-native-core/index.js 20.57 KB
164
164
  ESM dist/react-native-core/testing.js 119.00 B
165
165
  ESM dist/react-native-core/crypto.js 2.58 KB
166
166
  ESM dist/react-native-core/crypto/RNCrypto.js 120.00 B
167
- ESM dist/react-native-core/index.js.map 40.58 KB
167
+ ESM dist/react-native-core/index.js.map 41.80 KB
168
168
  ESM dist/react-native-core/testing.js.map 175.00 B
169
169
  ESM dist/react-native-core/crypto.js.map 5.25 KB
170
170
  ESM dist/react-native-core/crypto/RNCrypto.js.map 178.00 B
171
- ESM ⚡️ Build success in 107ms
172
- ESM dist/react-native/index.js 22.50 KB
173
- ESM dist/react-native/testing.js 120.00 B
174
- ESM dist/react-native/crypto.js 161.00 B
175
- ESM dist/react-native/polyfills.js 858.00 B
176
- ESM dist/react-native/index.js.map 46.13 KB
177
- ESM dist/react-native/testing.js.map 176.00 B
178
- ESM dist/react-native/crypto.js.map 197.00 B
179
- ESM dist/react-native/polyfills.js.map 1.61 KB
180
- ESM ⚡️ Build success in 111ms
171
+ ESM ⚡️ Build success in 130ms
181
172
  ESM dist/react/index.js 25.96 KB
182
173
  ESM dist/react/testing.js 122.00 B
183
174
  ESM dist/react/ssr.js 697.00 B
184
175
  ESM dist/react/index.js.map 55.44 KB
185
176
  ESM dist/react/testing.js.map 165.00 B
186
177
  ESM dist/react/ssr.js.map 1.11 KB
187
- ESM ⚡️ Build success in 111ms
178
+ ESM ⚡️ Build success in 121ms
179
+ ESM dist/react-native/index.js 23.11 KB
180
+ ESM dist/react-native/testing.js 120.00 B
181
+ ESM dist/react-native/crypto.js 161.00 B
182
+ ESM dist/react-native/polyfills.js 858.00 B
183
+ ESM dist/react-native/index.js.map 47.35 KB
184
+ ESM dist/react-native/testing.js.map 176.00 B
185
+ ESM dist/react-native/crypto.js.map 197.00 B
186
+ ESM dist/react-native/polyfills.js.map 1.61 KB
187
+ ESM ⚡️ Build success in 134ms
188
188
  ESM dist/inspector/index.js 6.29 KB
189
189
  ESM dist/inspector/standalone.js 12.61 KB
190
190
  ESM dist/inspector/chunk-YQNK5Y7B.js 127.21 KB
191
191
  ESM dist/inspector/index.js.map 9.65 KB
192
192
  ESM dist/inspector/standalone.js.map 20.11 KB
193
193
  ESM dist/inspector/chunk-YQNK5Y7B.js.map 221.30 KB
194
- ESM ⚡️ Build success in 153ms
194
+ ESM ⚡️ Build success in 186ms
195
+ ESM dist/inspector/register-custom-element.js 218.00 B
196
+ ESM dist/inspector/register-custom-element.js.map 314.00 B
197
+ ESM dist/inspector/custom-element-KYV64IOC.js 1.60 MB
198
+ ESM dist/inspector/custom-element-KYV64IOC.js.map 2.47 MB
199
+ ESM ⚡️ Build success in 251ms
195
200
  ESM dist/index.js 29.82 KB
196
201
  ESM dist/testing.js 8.56 KB
197
- ESM dist/tools/ssr.js 156.00 B
198
202
  ESM dist/chunk-M2HGBOXS.js 694.00 B
203
+ ESM dist/tools/ssr.js 156.00 B
199
204
  ESM dist/chunk-PZ5AY32C.js 233.00 B
200
- ESM dist/chunk-GAPMDNJY.js 225.38 KB
201
- ESM dist/tools/ssr.js.map 71.00 B
205
+ ESM dist/chunk-R3KIZG4P.js 226.01 KB
202
206
  ESM dist/testing.js.map 16.21 KB
203
- ESM dist/chunk-PZ5AY32C.js.map 71.00 B
204
207
  ESM dist/index.js.map 60.59 KB
205
208
  ESM dist/chunk-M2HGBOXS.js.map 1.10 KB
206
- ESM dist/chunk-GAPMDNJY.js.map 530.58 KB
207
- ESM ⚡️ Build success in 193ms
208
- ESM dist/inspector/register-custom-element.js 218.00 B
209
- ESM dist/inspector/register-custom-element.js.map 314.00 B
210
- ESM dist/inspector/custom-element-KYV64IOC.js 1.60 MB
211
- ESM dist/inspector/custom-element-KYV64IOC.js.map 2.47 MB
212
- ESM ⚡️ Build success in 215ms
209
+ ESM dist/tools/ssr.js.map 71.00 B
210
+ ESM dist/chunk-PZ5AY32C.js.map 71.00 B
211
+ ESM dist/chunk-R3KIZG4P.js.map 531.93 KB
212
+ ESM ⚡️ Build success in 236ms
213
213
 
214
- > jazz-tools@0.19.13 types /home/runner/_work/jazz/jazz/packages/jazz-tools
214
+ > jazz-tools@0.19.15 types /home/runner/_work/jazz/jazz/packages/jazz-tools
215
215
  > tsc --outDir dist
216
216
 
217
217
 
218
- > jazz-tools@0.19.13 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
218
+ > jazz-tools@0.19.15 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
219
219
  > rm -rf dist/svelte && svelte-package -i src/svelte -o dist/svelte --tsconfig tsconfig.svelte.json
220
220
 
221
221
  src/svelte -> dist/svelte
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # jazz-tools
2
2
 
3
+ ## 0.19.15
4
+
5
+ ### Patch Changes
6
+
7
+ - 94012a1: Added a locking system for session IDs in React Native
8
+
9
+ Now it should be safer to mount multiple JazzProviders, but still not advised as it is really expensive
10
+
11
+ - 86f9676: Adds a createdBy getter
12
+ - b27dbc2: Fix Object.keys(coMap.getEdits()) to return also deleted keys
13
+ - Updated dependencies [71ed9d6]
14
+ - cojson@0.19.15
15
+ - cojson-storage-indexeddb@0.19.15
16
+ - cojson-transport-ws@0.19.15
17
+
18
+ ## 0.19.14
19
+
20
+ ### Patch Changes
21
+
22
+ - cojson@0.19.14
23
+ - cojson-storage-indexeddb@0.19.14
24
+ - cojson-transport-ws@0.19.14
25
+
3
26
  ## 0.19.13
4
27
 
5
28
  ### Patch Changes
@@ -203,6 +203,26 @@ var CoValueJazzApi = class {
203
203
  }
204
204
  return this.raw.core.earliestTxMadeAt;
205
205
  }
206
+ /**
207
+ * Returns the account ID of the user who created this CoValue.
208
+ *
209
+ * Creation is determined by inspecting the earliest valid transaction,
210
+ * Note: Where the author is a sealer/signer identifiers (e.g. accounts)
211
+ * nothing is returned intentionally
212
+ *
213
+ * @returns {string | undefined} The creating user's account ID, or
214
+ * `undefined` if no author can be determined
215
+ *
216
+ * @category Content
217
+ */
218
+ get createdBy() {
219
+ const createdBy = this.raw.core.getValidSortedTransactions({
220
+ ignorePrivateTransactions: false
221
+ })[0]?.author;
222
+ if (typeof createdBy === "string" && createdBy.startsWith("co_z"))
223
+ return createdBy;
224
+ return void 0;
225
+ }
206
226
  /**
207
227
  * The timestamp of the last updated time of the CoValue
208
228
  *
@@ -739,7 +759,7 @@ var CoMapJazzApi = class extends CoValueJazzApi {
739
759
  };
740
760
  },
741
761
  ownKeys(_target) {
742
- return map.$jazz.raw.keys();
762
+ return Object.keys(map.$jazz.raw.ops);
743
763
  },
744
764
  getOwnPropertyDescriptor(target, key) {
745
765
  return {
@@ -4290,29 +4310,6 @@ var SubscriptionScope = class _SubscriptionScope {
4290
4310
  this.migrating = false;
4291
4311
  this.closed = false;
4292
4312
  this.silenceUpdates = false;
4293
- this.handleChildUpdate = (id, value, key) => {
4294
- if (value.type === CoValueLoadingState.LOADING) {
4295
- return;
4296
- }
4297
- this.pendingLoadedChildren.delete(id);
4298
- this.pendingAutoloadedChildren.delete(id);
4299
- this.childValues.set(id, value);
4300
- if (value.type === CoValueLoadingState.UNAVAILABLE || value.type === CoValueLoadingState.UNAUTHORIZED) {
4301
- this.childErrors.set(id, value.prependPath(key ?? id));
4302
- this.errorFromChildren = this.computeChildErrors();
4303
- } else if (this.errorFromChildren && this.childErrors.has(id)) {
4304
- this.childErrors.delete(id);
4305
- this.errorFromChildren = this.computeChildErrors();
4306
- }
4307
- if (this.shouldSendUpdates()) {
4308
- if (this.value.type === CoValueLoadingState.LOADED) {
4309
- this.updateValue(
4310
- createCoValue(this.schema, this.value.value.$jazz.raw, this)
4311
- );
4312
- }
4313
- }
4314
- this.triggerUpdate();
4315
- };
4316
4313
  this.subscribers = /* @__PURE__ */ new Set();
4317
4314
  this.subscriberChangeCallbacks = /* @__PURE__ */ new Set();
4318
4315
  this.callerStack = callerStack;
@@ -4438,6 +4435,29 @@ var SubscriptionScope = class _SubscriptionScope {
4438
4435
  }
4439
4436
  return void 0;
4440
4437
  }
4438
+ handleChildUpdate(id, value, key) {
4439
+ if (value.type === CoValueLoadingState.LOADING) {
4440
+ return;
4441
+ }
4442
+ this.pendingLoadedChildren.delete(id);
4443
+ this.pendingAutoloadedChildren.delete(id);
4444
+ this.childValues.set(id, value);
4445
+ if (value.type === CoValueLoadingState.UNAVAILABLE || value.type === CoValueLoadingState.UNAUTHORIZED) {
4446
+ this.childErrors.set(id, value.prependPath(key ?? id));
4447
+ this.errorFromChildren = this.computeChildErrors();
4448
+ } else if (this.errorFromChildren && this.childErrors.has(id)) {
4449
+ this.childErrors.delete(id);
4450
+ this.errorFromChildren = this.computeChildErrors();
4451
+ }
4452
+ if (this.shouldSendUpdates()) {
4453
+ if (this.value.type === CoValueLoadingState.LOADED) {
4454
+ this.updateValue(
4455
+ createCoValue(this.schema, this.value.value.$jazz.raw, this)
4456
+ );
4457
+ }
4458
+ }
4459
+ this.triggerUpdate();
4460
+ }
4441
4461
  shouldSendUpdates() {
4442
4462
  if (this.value.type === CoValueLoadingState.LOADING) return false;
4443
4463
  if (this.value.type !== CoValueLoadingState.LOADED) return true;
@@ -5096,8 +5116,8 @@ async function createJazzContext(options) {
5096
5116
  crypto,
5097
5117
  AccountSchema: options.AccountSchema,
5098
5118
  sessionProvider: options.sessionProvider,
5099
- onLogOut: () => {
5100
- authSecretStorage.clearWithoutNotify();
5119
+ onLogOut: async () => {
5120
+ await authSecretStorage.clearWithoutNotify();
5101
5121
  },
5102
5122
  storage: options.storage,
5103
5123
  asActiveAccount: true
@@ -7782,4 +7802,4 @@ export {
7782
7802
  JazzContextManager
7783
7803
  };
7784
7804
  /* istanbul ignore file -- @preserve */
7785
- //# sourceMappingURL=chunk-GAPMDNJY.js.map
7805
+ //# sourceMappingURL=chunk-R3KIZG4P.js.map