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.
@@ -0,0 +1,2 @@
1
+ import Dexie from "dexie";
2
+ export declare function dbOnClosed(db: Dexie, handler: () => void): () => void;
@@ -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
  *
@@ -1800,10 +1800,11 @@ function triggerSync(db, purpose) {
1800
1800
  }
1801
1801
  }
1802
1802
 
1803
- const hasArrayBufferB64 = "fromBase64" in Uint8Array; // https://github.com/tc39/proposal-arraybuffer-base64;
1803
+ const hasArrayBufferFromBase64 = "fromBase64" in Uint8Array; // https://github.com/tc39/proposal-arraybuffer-base64;
1804
+ const hasArrayBufferToBase64 = "toBase64" in Uint8Array.prototype; // https://github.com/tc39/proposal-arraybuffer-base64;
1804
1805
  const b64decode = typeof Buffer !== "undefined"
1805
1806
  ? (base64) => Buffer.from(base64, "base64") // Node
1806
- : hasArrayBufferB64
1807
+ : hasArrayBufferFromBase64
1807
1808
  ? // @ts-ignore: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/fromBase64
1808
1809
  (base64) => Uint8Array.fromBase64(base64) // Modern javascript standard
1809
1810
  : (base64) => {
@@ -1826,9 +1827,13 @@ const b64encode = typeof Buffer !== "undefined"
1826
1827
  return Buffer.from(b).toString("base64");
1827
1828
  }
1828
1829
  }
1829
- : hasArrayBufferB64
1830
- ? // @ts-ignore https://github.com/tc39/proposal-arraybuffer-base64
1831
- (b) => b.toBase64() // Modern Javascript standard
1830
+ : hasArrayBufferToBase64
1831
+ ? (b) => {
1832
+ // Uint8Array.prototype.toBase64 is available in modern browsers
1833
+ const u8a = ArrayBuffer.isView(b) ? b : new Uint8Array(b);
1834
+ // @ts-ignore: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/toBase64
1835
+ return u8a.toBase64();
1836
+ }
1832
1837
  : (b) => {
1833
1838
  // Legacy DOM workaround
1834
1839
  const u8a = ArrayBuffer.isView(b) ? b : new Uint8Array(b);
@@ -3564,6 +3569,7 @@ function loadAccessToken(db) {
3564
3569
  accessTokenExpiration: refreshedLogin.accessTokenExpiration,
3565
3570
  claims: refreshedLogin.claims,
3566
3571
  license: refreshedLogin.license,
3572
+ data: refreshedLogin.data,
3567
3573
  });
3568
3574
  return refreshedLogin;
3569
3575
  });
@@ -8273,7 +8279,7 @@ function dexieCloud(dexie) {
8273
8279
  const syncComplete = new Subject();
8274
8280
  dexie.cloud = {
8275
8281
  // @ts-ignore
8276
- version: "4.1.0-beta.46",
8282
+ version: "4.1.0-beta.48",
8277
8283
  options: Object.assign({}, DEFAULT_OPTIONS),
8278
8284
  schema: null,
8279
8285
  get currentUserId() {
@@ -8591,7 +8597,7 @@ function dexieCloud(dexie) {
8591
8597
  }
8592
8598
  }
8593
8599
  // @ts-ignore
8594
- dexieCloud.version = "4.1.0-beta.46";
8600
+ dexieCloud.version = "4.1.0-beta.48";
8595
8601
  Dexie.Cloud = dexieCloud;
8596
8602
 
8597
8603
  // In case the SW lives for a while, let it reuse already opened connections: