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
  *
@@ -1803,10 +1803,11 @@
1803
1803
  }
1804
1804
  }
1805
1805
 
1806
- const hasArrayBufferB64 = "fromBase64" in Uint8Array; // https://github.com/tc39/proposal-arraybuffer-base64;
1806
+ const hasArrayBufferFromBase64 = "fromBase64" in Uint8Array; // https://github.com/tc39/proposal-arraybuffer-base64;
1807
+ const hasArrayBufferToBase64 = "toBase64" in Uint8Array.prototype; // https://github.com/tc39/proposal-arraybuffer-base64;
1807
1808
  const b64decode = typeof Buffer !== "undefined"
1808
1809
  ? (base64) => Buffer.from(base64, "base64") // Node
1809
- : hasArrayBufferB64
1810
+ : hasArrayBufferFromBase64
1810
1811
  ? // @ts-ignore: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/fromBase64
1811
1812
  (base64) => Uint8Array.fromBase64(base64) // Modern javascript standard
1812
1813
  : (base64) => {
@@ -1829,9 +1830,13 @@
1829
1830
  return Buffer.from(b).toString("base64");
1830
1831
  }
1831
1832
  }
1832
- : hasArrayBufferB64
1833
- ? // @ts-ignore https://github.com/tc39/proposal-arraybuffer-base64
1834
- (b) => b.toBase64() // Modern Javascript standard
1833
+ : hasArrayBufferToBase64
1834
+ ? (b) => {
1835
+ // Uint8Array.prototype.toBase64 is available in modern browsers
1836
+ const u8a = ArrayBuffer.isView(b) ? b : new Uint8Array(b);
1837
+ // @ts-ignore: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/toBase64
1838
+ return u8a.toBase64();
1839
+ }
1835
1840
  : (b) => {
1836
1841
  // Legacy DOM workaround
1837
1842
  const u8a = ArrayBuffer.isView(b) ? b : new Uint8Array(b);
@@ -3567,6 +3572,7 @@
3567
3572
  accessTokenExpiration: refreshedLogin.accessTokenExpiration,
3568
3573
  claims: refreshedLogin.claims,
3569
3574
  license: refreshedLogin.license,
3575
+ data: refreshedLogin.data,
3570
3576
  });
3571
3577
  return refreshedLogin;
3572
3578
  });
@@ -8276,7 +8282,7 @@
8276
8282
  const syncComplete = new rxjs.Subject();
8277
8283
  dexie.cloud = {
8278
8284
  // @ts-ignore
8279
- version: "4.1.0-beta.46",
8285
+ version: "4.1.0-beta.48",
8280
8286
  options: Object.assign({}, DEFAULT_OPTIONS),
8281
8287
  schema: null,
8282
8288
  get currentUserId() {
@@ -8594,7 +8600,7 @@
8594
8600
  }
8595
8601
  }
8596
8602
  // @ts-ignore
8597
- dexieCloud.version = "4.1.0-beta.46";
8603
+ dexieCloud.version = "4.1.0-beta.48";
8598
8604
  Dexie.Cloud = dexieCloud;
8599
8605
 
8600
8606
  // In case the SW lives for a while, let it reuse already opened connections: