dexie-cloud-addon 4.1.0-beta.46 → 4.1.0-beta.48

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
- * dexie-cloud-addom.js
2
+ * dexie-cloud-addon.js
3
3
  * ==========================================================================
4
4
  *
5
5
  * Dexie addon that syncs IndexedDB with Dexie Cloud.
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * ==========================================================================
10
10
  *
11
- * Version 4.1.0-beta.46, Thu Apr 03 2025
11
+ * Version 4.1.0-beta.48, Tue Jun 03 2025
12
12
  *
13
13
  * https://dexie.org
14
14
  *
@@ -3037,10 +3037,11 @@ function triggerSync(db, purpose) {
3037
3037
  }
3038
3038
  }
3039
3039
 
3040
- const hasArrayBufferB64 = "fromBase64" in Uint8Array; // https://github.com/tc39/proposal-arraybuffer-base64;
3040
+ const hasArrayBufferFromBase64 = "fromBase64" in Uint8Array; // https://github.com/tc39/proposal-arraybuffer-base64;
3041
+ const hasArrayBufferToBase64 = "toBase64" in Uint8Array.prototype; // https://github.com/tc39/proposal-arraybuffer-base64;
3041
3042
  const b64decode = typeof Buffer !== "undefined"
3042
3043
  ? (base64) => Buffer.from(base64, "base64") // Node
3043
- : hasArrayBufferB64
3044
+ : hasArrayBufferFromBase64
3044
3045
  ? // @ts-ignore: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/fromBase64
3045
3046
  (base64) => Uint8Array.fromBase64(base64) // Modern javascript standard
3046
3047
  : (base64) => {
@@ -3063,9 +3064,13 @@ const b64encode = typeof Buffer !== "undefined"
3063
3064
  return Buffer.from(b).toString("base64");
3064
3065
  }
3065
3066
  }
3066
- : hasArrayBufferB64
3067
- ? // @ts-ignore https://github.com/tc39/proposal-arraybuffer-base64
3068
- (b) => b.toBase64() // Modern Javascript standard
3067
+ : hasArrayBufferToBase64
3068
+ ? (b) => {
3069
+ // Uint8Array.prototype.toBase64 is available in modern browsers
3070
+ const u8a = ArrayBuffer.isView(b) ? b : new Uint8Array(b);
3071
+ // @ts-ignore: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/toBase64
3072
+ return u8a.toBase64();
3073
+ }
3069
3074
  : (b) => {
3070
3075
  // Legacy DOM workaround
3071
3076
  const u8a = ArrayBuffer.isView(b) ? b : new Uint8Array(b);
@@ -3247,6 +3252,7 @@ function loadAccessToken(db) {
3247
3252
  accessTokenExpiration: refreshedLogin.accessTokenExpiration,
3248
3253
  claims: refreshedLogin.claims,
3249
3254
  license: refreshedLogin.license,
3255
+ data: refreshedLogin.data,
3250
3256
  });
3251
3257
  return refreshedLogin;
3252
3258
  });
@@ -8444,7 +8450,7 @@ function dexieCloud(dexie) {
8444
8450
  const syncComplete = new Subject();
8445
8451
  dexie.cloud = {
8446
8452
  // @ts-ignore
8447
- version: "4.1.0-beta.46",
8453
+ version: "4.1.0-beta.48",
8448
8454
  options: Object.assign({}, DEFAULT_OPTIONS),
8449
8455
  schema: null,
8450
8456
  get currentUserId() {
@@ -8762,7 +8768,7 @@ function dexieCloud(dexie) {
8762
8768
  }
8763
8769
  }
8764
8770
  // @ts-ignore
8765
- dexieCloud.version = "4.1.0-beta.46";
8771
+ dexieCloud.version = "4.1.0-beta.48";
8766
8772
  Dexie.Cloud = dexieCloud;
8767
8773
 
8768
8774
  export { dexieCloud as default, defineYDocTrigger, dexieCloud, getTiedObjectId, getTiedRealmId, resolveText };