dexie-cloud-addon 4.0.1-beta.47 → 4.0.1-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.
Files changed (260) hide show
  1. package/dist/{types → modern}/TSON.d.ts +1 -1
  2. package/dist/modern/dexie-cloud-addon.d.ts +3 -0
  3. package/dist/modern/dexie-cloud-addon.js +20 -57
  4. package/dist/modern/dexie-cloud-addon.js.map +1 -1
  5. package/dist/modern/dexie-cloud-addon.min.js +2 -2
  6. package/dist/modern/dexie-cloud-addon.min.js.map +1 -1
  7. package/dist/modern/service-worker.js +1568 -19
  8. package/dist/modern/service-worker.js.map +1 -1
  9. package/dist/modern/service-worker.min.js +2 -2
  10. package/dist/modern/service-worker.min.js.map +1 -1
  11. package/dist/umd/DISABLE_SERVICEWORKER_STRATEGY.d.ts +1 -0
  12. package/dist/umd/DXCWebSocketStatus.d.ts +1 -0
  13. package/dist/umd/DexieCloudAPI.d.ts +72 -0
  14. package/dist/umd/DexieCloudOptions.d.ts +22 -0
  15. package/dist/umd/DexieCloudSyncOptions.d.ts +4 -0
  16. package/dist/umd/DexieCloudTable.d.ts +18 -0
  17. package/dist/umd/InvalidLicenseError.d.ts +5 -0
  18. package/dist/umd/Invite.d.ts +8 -0
  19. package/dist/umd/PermissionChecker.d.ts +15 -0
  20. package/dist/umd/TSON.d.ts +17 -0
  21. package/dist/umd/WSObservable.d.ts +68 -0
  22. package/dist/umd/associate.d.ts +1 -0
  23. package/dist/umd/authentication/AuthPersistedContext.d.ts +9 -0
  24. package/dist/umd/authentication/TokenErrorResponseError.d.ts +10 -0
  25. package/dist/umd/authentication/TokenExpiredError.d.ts +3 -0
  26. package/dist/umd/authentication/UNAUTHORIZED_USER.d.ts +2 -0
  27. package/dist/umd/authentication/authenticate.d.ts +20 -0
  28. package/dist/umd/authentication/currentUserObservable.d.ts +1 -0
  29. package/dist/umd/authentication/interactWithUser.d.ts +21 -0
  30. package/dist/umd/authentication/login.d.ts +6 -0
  31. package/dist/umd/authentication/logout.d.ts +5 -0
  32. package/dist/umd/authentication/otpFetchTokenCallback.d.ts +3 -0
  33. package/dist/umd/authentication/setCurrentUser.d.ts +14 -0
  34. package/dist/umd/authentication/waitUntil.d.ts +3 -0
  35. package/dist/umd/computeSyncState.d.ts +4 -0
  36. package/dist/umd/createSharedValueObservable.d.ts +3 -0
  37. package/dist/umd/currentUserEmitter.d.ts +3 -0
  38. package/dist/umd/db/DexieCloudDB.d.ts +59 -0
  39. package/dist/umd/db/entities/BaseRevisionMapEntry.d.ts +5 -0
  40. package/dist/umd/db/entities/EntityCommon.d.ts +5 -0
  41. package/dist/umd/db/entities/GuardedJob.d.ts +5 -0
  42. package/dist/umd/db/entities/Member.d.ts +19 -0
  43. package/dist/umd/db/entities/PersistedSyncState.d.ts +14 -0
  44. package/dist/umd/db/entities/Realm.d.ts +16 -0
  45. package/dist/umd/db/entities/Role.d.ts +11 -0
  46. package/dist/umd/db/entities/UserLogin.d.ts +22 -0
  47. package/dist/umd/default-ui/Dialog.d.ts +5 -0
  48. package/dist/umd/default-ui/LoginDialog.d.ts +3 -0
  49. package/dist/umd/default-ui/Styles.d.ts +3 -0
  50. package/dist/umd/default-ui/index.d.ts +24 -0
  51. package/dist/umd/dexie-cloud-addon.d.ts +3 -0
  52. package/dist/umd/dexie-cloud-addon.js +40 -81
  53. package/dist/umd/dexie-cloud-addon.js.map +1 -1
  54. package/dist/umd/dexie-cloud-client.d.ts +13 -0
  55. package/dist/umd/errors/HttpError.d.ts +5 -0
  56. package/dist/umd/extend-dexie-interface.d.ts +23 -0
  57. package/dist/umd/getGlobalRolesObservable.d.ts +5 -0
  58. package/dist/umd/getInternalAccessControlObservable.d.ts +12 -0
  59. package/dist/umd/getInvitesObservable.d.ts +23 -0
  60. package/dist/umd/getPermissionsLookupObservable.d.ts +16 -0
  61. package/dist/umd/getTiedRealmId.d.ts +2 -0
  62. package/dist/umd/helpers/BroadcastedAndLocalEvent.d.ts +8 -0
  63. package/dist/umd/helpers/CancelToken.d.ts +4 -0
  64. package/dist/umd/helpers/IS_SERVICE_WORKER.d.ts +1 -0
  65. package/dist/umd/helpers/SWBroadcastChannel.d.ts +12 -0
  66. package/dist/umd/helpers/allSettled.d.ts +1 -0
  67. package/dist/umd/helpers/bulkUpdate.d.ts +4 -0
  68. package/dist/umd/helpers/computeRealmSetHash.d.ts +2 -0
  69. package/dist/umd/helpers/date-constants.d.ts +5 -0
  70. package/dist/umd/helpers/dbOnClosed.d.ts +2 -0
  71. package/dist/umd/helpers/flatten.d.ts +1 -0
  72. package/dist/umd/helpers/getMutationTable.d.ts +1 -0
  73. package/dist/umd/helpers/getSyncableTables.d.ts +4 -0
  74. package/dist/umd/helpers/getTableFromMutationTable.d.ts +1 -0
  75. package/dist/umd/helpers/makeArray.d.ts +1 -0
  76. package/dist/umd/helpers/randomString.d.ts +1 -0
  77. package/dist/umd/helpers/resolveText.d.ts +16 -0
  78. package/dist/umd/helpers/throwVersionIncrementNeeded.d.ts +1 -0
  79. package/dist/umd/helpers/visibilityState.d.ts +1 -0
  80. package/dist/umd/isEagerSyncDisabled.d.ts +2 -0
  81. package/dist/umd/isFirefox.d.ts +1 -0
  82. package/dist/umd/isSafari.d.ts +2 -0
  83. package/dist/umd/mapValueObservable.d.ts +5 -0
  84. package/dist/umd/mergePermissions.d.ts +2 -0
  85. package/dist/umd/middleware-helpers/guardedTable.d.ts +11 -0
  86. package/dist/umd/middleware-helpers/idGenerationHelpers.d.ts +18 -0
  87. package/dist/umd/middlewares/createIdGenerationMiddleware.d.ts +3 -0
  88. package/dist/umd/middlewares/createImplicitPropSetterMiddleware.d.ts +3 -0
  89. package/dist/umd/middlewares/createMutationTrackingMiddleware.d.ts +17 -0
  90. package/dist/umd/middlewares/outstandingTransaction.d.ts +4 -0
  91. package/dist/umd/overrideParseStoresSpec.d.ts +4 -0
  92. package/dist/umd/performInitialSync.d.ts +4 -0
  93. package/dist/umd/permissions.d.ts +9 -0
  94. package/dist/umd/prodLog.d.ts +9 -0
  95. package/dist/umd/service-worker.d.ts +1 -0
  96. package/dist/umd/service-worker.js +1624 -78
  97. package/dist/umd/service-worker.js.map +1 -1
  98. package/dist/umd/sync/LocalSyncWorker.d.ts +7 -0
  99. package/dist/umd/sync/SyncRequiredError.d.ts +3 -0
  100. package/dist/umd/sync/applyServerChanges.d.ts +3 -0
  101. package/dist/umd/sync/connectWebSocket.d.ts +2 -0
  102. package/dist/umd/sync/encodeIdsForServer.d.ts +4 -0
  103. package/dist/umd/sync/extractRealm.d.ts +2 -0
  104. package/dist/umd/sync/getLatestRevisionsPerTable.d.ts +6 -0
  105. package/dist/umd/sync/getTablesToSyncify.d.ts +3 -0
  106. package/dist/umd/sync/isOnline.d.ts +1 -0
  107. package/dist/umd/sync/isSyncNeeded.d.ts +2 -0
  108. package/dist/umd/sync/listClientChanges.d.ts +9 -0
  109. package/dist/umd/sync/listSyncifiedChanges.d.ts +5 -0
  110. package/dist/umd/sync/messageConsumerIsReady.d.ts +2 -0
  111. package/dist/umd/sync/messagesFromServerQueue.d.ts +8 -0
  112. package/dist/umd/sync/modifyLocalObjectsWithNewUserId.d.ts +4 -0
  113. package/dist/umd/sync/myId.d.ts +1 -0
  114. package/dist/umd/sync/numUnsyncedMutations.d.ts +2 -0
  115. package/dist/umd/sync/old_startSyncingClientChanges.d.ts +39 -0
  116. package/dist/umd/sync/performGuardedJob.d.ts +2 -0
  117. package/dist/umd/sync/ratelimit.d.ts +3 -0
  118. package/dist/umd/sync/registerSyncEvent.d.ts +3 -0
  119. package/dist/umd/sync/sync.d.ts +15 -0
  120. package/dist/umd/sync/syncIfPossible.d.ts +5 -0
  121. package/dist/umd/sync/syncWithServer.d.ts +6 -0
  122. package/dist/umd/sync/triggerSync.d.ts +2 -0
  123. package/dist/umd/sync/updateBaseRevs.d.ts +5 -0
  124. package/dist/umd/types/DXCAlert.d.ts +25 -0
  125. package/dist/umd/types/DXCInputField.d.ts +11 -0
  126. package/dist/umd/types/DXCUserInteraction.d.ts +93 -0
  127. package/dist/umd/types/NewIdOptions.d.ts +3 -0
  128. package/dist/umd/types/SWMessageEvent.d.ts +3 -0
  129. package/dist/umd/types/SWSyncEvent.d.ts +4 -0
  130. package/dist/umd/types/SyncState.d.ts +9 -0
  131. package/dist/umd/types/TXExpandos.d.ts +11 -0
  132. package/dist/umd/updateSchemaFromOptions.d.ts +3 -0
  133. package/dist/umd/userIsActive.d.ts +7 -0
  134. package/dist/umd/verifyConfig.d.ts +2 -0
  135. package/dist/umd/verifySchema.d.ts +2 -0
  136. package/package.json +12 -47
  137. package/copydts.sh +0 -5
  138. package/dist/umd/dexie-cloud-addon.min.js +0 -2
  139. package/dist/umd/dexie-cloud-addon.min.js.map +0 -1
  140. package/dist/umd/service-worker.min.js +0 -2
  141. package/dist/umd/service-worker.min.js.map +0 -1
  142. /package/dist/{types → modern}/DISABLE_SERVICEWORKER_STRATEGY.d.ts +0 -0
  143. /package/dist/{types → modern}/DXCWebSocketStatus.d.ts +0 -0
  144. /package/dist/{types → modern}/DexieCloudAPI.d.ts +0 -0
  145. /package/dist/{types → modern}/DexieCloudOptions.d.ts +0 -0
  146. /package/dist/{types → modern}/DexieCloudSyncOptions.d.ts +0 -0
  147. /package/dist/{types → modern}/DexieCloudTable.d.ts +0 -0
  148. /package/dist/{types → modern}/InvalidLicenseError.d.ts +0 -0
  149. /package/dist/{types → modern}/Invite.d.ts +0 -0
  150. /package/dist/{types → modern}/PermissionChecker.d.ts +0 -0
  151. /package/dist/{types → modern}/WSObservable.d.ts +0 -0
  152. /package/dist/{types → modern}/associate.d.ts +0 -0
  153. /package/dist/{types → modern}/authentication/AuthPersistedContext.d.ts +0 -0
  154. /package/dist/{types → modern}/authentication/TokenErrorResponseError.d.ts +0 -0
  155. /package/dist/{types → modern}/authentication/TokenExpiredError.d.ts +0 -0
  156. /package/dist/{types → modern}/authentication/UNAUTHORIZED_USER.d.ts +0 -0
  157. /package/dist/{types → modern}/authentication/authenticate.d.ts +0 -0
  158. /package/dist/{types → modern}/authentication/currentUserObservable.d.ts +0 -0
  159. /package/dist/{types → modern}/authentication/interactWithUser.d.ts +0 -0
  160. /package/dist/{types → modern}/authentication/login.d.ts +0 -0
  161. /package/dist/{types → modern}/authentication/logout.d.ts +0 -0
  162. /package/dist/{types → modern}/authentication/otpFetchTokenCallback.d.ts +0 -0
  163. /package/dist/{types → modern}/authentication/setCurrentUser.d.ts +0 -0
  164. /package/dist/{types → modern}/authentication/waitUntil.d.ts +0 -0
  165. /package/dist/{types → modern}/computeSyncState.d.ts +0 -0
  166. /package/dist/{types → modern}/createSharedValueObservable.d.ts +0 -0
  167. /package/dist/{types → modern}/currentUserEmitter.d.ts +0 -0
  168. /package/dist/{types → modern}/db/DexieCloudDB.d.ts +0 -0
  169. /package/dist/{types → modern}/db/entities/BaseRevisionMapEntry.d.ts +0 -0
  170. /package/dist/{types → modern}/db/entities/EntityCommon.d.ts +0 -0
  171. /package/dist/{types → modern}/db/entities/GuardedJob.d.ts +0 -0
  172. /package/dist/{types → modern}/db/entities/Member.d.ts +0 -0
  173. /package/dist/{types → modern}/db/entities/PersistedSyncState.d.ts +0 -0
  174. /package/dist/{types → modern}/db/entities/Realm.d.ts +0 -0
  175. /package/dist/{types → modern}/db/entities/Role.d.ts +0 -0
  176. /package/dist/{types → modern}/db/entities/UserLogin.d.ts +0 -0
  177. /package/dist/{types → modern}/default-ui/Dialog.d.ts +0 -0
  178. /package/dist/{types → modern}/default-ui/LoginDialog.d.ts +0 -0
  179. /package/dist/{types → modern}/default-ui/Styles.d.ts +0 -0
  180. /package/dist/{types → modern}/default-ui/index.d.ts +0 -0
  181. /package/dist/{types → modern}/dexie-cloud-client.d.ts +0 -0
  182. /package/dist/{types → modern}/errors/HttpError.d.ts +0 -0
  183. /package/dist/{types → modern}/extend-dexie-interface.d.ts +0 -0
  184. /package/dist/{types → modern}/getGlobalRolesObservable.d.ts +0 -0
  185. /package/dist/{types → modern}/getInternalAccessControlObservable.d.ts +0 -0
  186. /package/dist/{types → modern}/getInvitesObservable.d.ts +0 -0
  187. /package/dist/{types → modern}/getPermissionsLookupObservable.d.ts +0 -0
  188. /package/dist/{types → modern}/getTiedRealmId.d.ts +0 -0
  189. /package/dist/{types → modern}/helpers/BroadcastedAndLocalEvent.d.ts +0 -0
  190. /package/dist/{types → modern}/helpers/CancelToken.d.ts +0 -0
  191. /package/dist/{types → modern}/helpers/IS_SERVICE_WORKER.d.ts +0 -0
  192. /package/dist/{types → modern}/helpers/SWBroadcastChannel.d.ts +0 -0
  193. /package/dist/{types → modern}/helpers/allSettled.d.ts +0 -0
  194. /package/dist/{types → modern}/helpers/bulkUpdate.d.ts +0 -0
  195. /package/dist/{types → modern}/helpers/computeRealmSetHash.d.ts +0 -0
  196. /package/dist/{types → modern}/helpers/date-constants.d.ts +0 -0
  197. /package/dist/{types → modern}/helpers/dbOnClosed.d.ts +0 -0
  198. /package/dist/{types → modern}/helpers/flatten.d.ts +0 -0
  199. /package/dist/{types → modern}/helpers/getMutationTable.d.ts +0 -0
  200. /package/dist/{types → modern}/helpers/getSyncableTables.d.ts +0 -0
  201. /package/dist/{types → modern}/helpers/getTableFromMutationTable.d.ts +0 -0
  202. /package/dist/{types → modern}/helpers/makeArray.d.ts +0 -0
  203. /package/dist/{types → modern}/helpers/randomString.d.ts +0 -0
  204. /package/dist/{types → modern}/helpers/resolveText.d.ts +0 -0
  205. /package/dist/{types → modern}/helpers/throwVersionIncrementNeeded.d.ts +0 -0
  206. /package/dist/{types → modern}/helpers/visibilityState.d.ts +0 -0
  207. /package/dist/{types → modern}/isEagerSyncDisabled.d.ts +0 -0
  208. /package/dist/{types → modern}/isFirefox.d.ts +0 -0
  209. /package/dist/{types → modern}/isSafari.d.ts +0 -0
  210. /package/dist/{types → modern}/mapValueObservable.d.ts +0 -0
  211. /package/dist/{types → modern}/mergePermissions.d.ts +0 -0
  212. /package/dist/{types → modern}/middleware-helpers/guardedTable.d.ts +0 -0
  213. /package/dist/{types → modern}/middleware-helpers/idGenerationHelpers.d.ts +0 -0
  214. /package/dist/{types → modern}/middlewares/createIdGenerationMiddleware.d.ts +0 -0
  215. /package/dist/{types → modern}/middlewares/createImplicitPropSetterMiddleware.d.ts +0 -0
  216. /package/dist/{types → modern}/middlewares/createMutationTrackingMiddleware.d.ts +0 -0
  217. /package/dist/{types → modern}/middlewares/outstandingTransaction.d.ts +0 -0
  218. /package/dist/{types → modern}/overrideParseStoresSpec.d.ts +0 -0
  219. /package/dist/{types → modern}/performInitialSync.d.ts +0 -0
  220. /package/dist/{types → modern}/permissions.d.ts +0 -0
  221. /package/dist/{types → modern}/prodLog.d.ts +0 -0
  222. /package/dist/{types → modern}/service-worker.d.ts +0 -0
  223. /package/dist/{types → modern}/sync/LocalSyncWorker.d.ts +0 -0
  224. /package/dist/{types → modern}/sync/SyncRequiredError.d.ts +0 -0
  225. /package/dist/{types → modern}/sync/applyServerChanges.d.ts +0 -0
  226. /package/dist/{types → modern}/sync/connectWebSocket.d.ts +0 -0
  227. /package/dist/{types → modern}/sync/encodeIdsForServer.d.ts +0 -0
  228. /package/dist/{types → modern}/sync/extractRealm.d.ts +0 -0
  229. /package/dist/{types → modern}/sync/getLatestRevisionsPerTable.d.ts +0 -0
  230. /package/dist/{types → modern}/sync/getTablesToSyncify.d.ts +0 -0
  231. /package/dist/{types → modern}/sync/isOnline.d.ts +0 -0
  232. /package/dist/{types → modern}/sync/isSyncNeeded.d.ts +0 -0
  233. /package/dist/{types → modern}/sync/listClientChanges.d.ts +0 -0
  234. /package/dist/{types → modern}/sync/listSyncifiedChanges.d.ts +0 -0
  235. /package/dist/{types → modern}/sync/messageConsumerIsReady.d.ts +0 -0
  236. /package/dist/{types → modern}/sync/messagesFromServerQueue.d.ts +0 -0
  237. /package/dist/{types → modern}/sync/modifyLocalObjectsWithNewUserId.d.ts +0 -0
  238. /package/dist/{types → modern}/sync/myId.d.ts +0 -0
  239. /package/dist/{types → modern}/sync/numUnsyncedMutations.d.ts +0 -0
  240. /package/dist/{types → modern}/sync/old_startSyncingClientChanges.d.ts +0 -0
  241. /package/dist/{types → modern}/sync/performGuardedJob.d.ts +0 -0
  242. /package/dist/{types → modern}/sync/ratelimit.d.ts +0 -0
  243. /package/dist/{types → modern}/sync/registerSyncEvent.d.ts +0 -0
  244. /package/dist/{types → modern}/sync/sync.d.ts +0 -0
  245. /package/dist/{types → modern}/sync/syncIfPossible.d.ts +0 -0
  246. /package/dist/{types → modern}/sync/syncWithServer.d.ts +0 -0
  247. /package/dist/{types → modern}/sync/triggerSync.d.ts +0 -0
  248. /package/dist/{types → modern}/sync/updateBaseRevs.d.ts +0 -0
  249. /package/dist/{types → modern}/types/DXCAlert.d.ts +0 -0
  250. /package/dist/{types → modern}/types/DXCInputField.d.ts +0 -0
  251. /package/dist/{types → modern}/types/DXCUserInteraction.d.ts +0 -0
  252. /package/dist/{types → modern}/types/NewIdOptions.d.ts +0 -0
  253. /package/dist/{types → modern}/types/SWMessageEvent.d.ts +0 -0
  254. /package/dist/{types → modern}/types/SWSyncEvent.d.ts +0 -0
  255. /package/dist/{types → modern}/types/SyncState.d.ts +0 -0
  256. /package/dist/{types → modern}/types/TXExpandos.d.ts +0 -0
  257. /package/dist/{types → modern}/updateSchemaFromOptions.d.ts +0 -0
  258. /package/dist/{types → modern}/userIsActive.d.ts +0 -0
  259. /package/dist/{types → modern}/verifyConfig.d.ts +0 -0
  260. /package/dist/{types → modern}/verifySchema.d.ts +0 -0
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * ==========================================================================
10
10
  *
11
- * Version 4.0.1-beta.47, Fri Oct 13 2023
11
+ * Version 4.0.1-beta.48, Tue Oct 17 2023
12
12
  *
13
13
  * https://dexie.org
14
14
  *
@@ -22,10 +22,6 @@
22
22
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.DexieCloud = {}, global.Dexie, global.rxjs));
23
23
  })(this, (function (exports, Dexie, rxjs) { 'use strict';
24
24
 
25
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
26
-
27
- var Dexie__default = /*#__PURE__*/_interopDefaultLegacy(Dexie);
28
-
29
25
  /******************************************************************************
30
26
  Copyright (c) Microsoft Corporation.
31
27
 
@@ -687,11 +683,7 @@
687
683
 
688
684
  function reportUnhandledError(err) {
689
685
  timeoutProvider.setTimeout(function () {
690
- var onUnhandledError = config.onUnhandledError;
691
- if (onUnhandledError) {
692
- onUnhandledError(err);
693
- }
694
- else {
686
+ {
695
687
  throw err;
696
688
  }
697
689
  });
@@ -699,38 +691,8 @@
699
691
 
700
692
  function noop() { }
701
693
 
702
- var COMPLETE_NOTIFICATION = (function () { return createNotification('C', undefined, undefined); })();
703
- function errorNotification(error) {
704
- return createNotification('E', undefined, error);
705
- }
706
- function nextNotification(value) {
707
- return createNotification('N', value, undefined);
708
- }
709
- function createNotification(kind, value, error) {
710
- return {
711
- kind: kind,
712
- value: value,
713
- error: error,
714
- };
715
- }
716
-
717
- var context = null;
718
694
  function errorContext(cb) {
719
- if (config.useDeprecatedSynchronousErrorHandling) {
720
- var isRoot = !context;
721
- if (isRoot) {
722
- context = { errorThrown: false, error: null };
723
- }
724
- cb();
725
- if (isRoot) {
726
- var _a = context, errorThrown = _a.errorThrown, error = _a.error;
727
- context = null;
728
- if (errorThrown) {
729
- throw error;
730
- }
731
- }
732
- }
733
- else {
695
+ {
734
696
  cb();
735
697
  }
736
698
  }
@@ -755,26 +717,20 @@
755
717
  return new SafeSubscriber(next, error, complete);
756
718
  };
757
719
  Subscriber.prototype.next = function (value) {
758
- if (this.isStopped) {
759
- handleStoppedNotification(nextNotification(value), this);
760
- }
720
+ if (this.isStopped) ;
761
721
  else {
762
722
  this._next(value);
763
723
  }
764
724
  };
765
725
  Subscriber.prototype.error = function (err) {
766
- if (this.isStopped) {
767
- handleStoppedNotification(errorNotification(err), this);
768
- }
726
+ if (this.isStopped) ;
769
727
  else {
770
728
  this.isStopped = true;
771
729
  this._error(err);
772
730
  }
773
731
  };
774
732
  Subscriber.prototype.complete = function () {
775
- if (this.isStopped) {
776
- handleStoppedNotification(COMPLETE_NOTIFICATION, this);
777
- }
733
+ if (this.isStopped) ;
778
734
  else {
779
735
  this.isStopped = true;
780
736
  this._complete();
@@ -894,10 +850,6 @@
894
850
  function defaultErrorHandler(err) {
895
851
  throw err;
896
852
  }
897
- function handleStoppedNotification(notification, subscriber) {
898
- var onStoppedNotification = config.onStoppedNotification;
899
- onStoppedNotification && timeoutProvider.setTimeout(function () { return onStoppedNotification(notification, subscriber); });
900
- }
901
853
  var EMPTY_OBSERVER = {
902
854
  closed: true,
903
855
  next: noop,
@@ -2013,7 +1965,14 @@
2013
1965
  }
2014
1966
  }
2015
1967
  : (b) => {
2016
- return btoa(String.fromCharCode.apply(null, ArrayBuffer.isView(b) ? b : new Uint8Array(b)));
1968
+ const u8a = ArrayBuffer.isView(b) ? b : new Uint8Array(b);
1969
+ const CHUNK_SIZE = 0x1000;
1970
+ const strs = [];
1971
+ for (let i = 0, l = u8a.length; i < l; i += CHUNK_SIZE) {
1972
+ const chunk = u8a.subarray(i, i + CHUNK_SIZE);
1973
+ strs.push(String.fromCharCode.apply(null, chunk));
1974
+ }
1975
+ return btoa(strs.join(""));
2017
1976
  };
2018
1977
 
2019
1978
  class TokenErrorResponseError extends Error {
@@ -2033,7 +1992,7 @@
2033
1992
  resolve(res);
2034
1993
  }, onCancel: () => {
2035
1994
  userInteraction.next(undefined);
2036
- reject(new Dexie__default["default"].AbortError('User cancelled'));
1995
+ reject(new Dexie.AbortError('User cancelled'));
2037
1996
  } });
2038
1997
  userInteraction.next(interactionProps);
2039
1998
  // Start subscribing for external updates to db.cloud.userInteraction, and if so, cancel this request.
@@ -2318,7 +2277,7 @@
2318
2277
  if (isOffline) {
2319
2278
  message = `You seem to be offline. Please connect to the internet and try again.`;
2320
2279
  }
2321
- else if (Dexie__default["default"].debug || (typeof location !== 'undefined' && (location.hostname === 'localhost' || location.hostname === '127.0.0.1'))) {
2280
+ else if (Dexie.debug || (typeof location !== 'undefined' && (location.hostname === 'localhost' || location.hostname === '127.0.0.1'))) {
2322
2281
  // The audience is most likely the developer. Suggest to whitelist the localhost origin:
2323
2282
  message = `Could not connect to server. Please verify that your origin '${location.origin}' is whitelisted using \`npx dexie-cloud whitelist\``;
2324
2283
  }
@@ -3159,13 +3118,13 @@
3159
3118
  },
3160
3119
  };
3161
3120
 
3162
- const _global = typeof globalThis !== "undefined"
3121
+ const _global = typeof globalThis !== "undefined" // All modern environments (node, bun, deno, browser, workers, webview etc)
3163
3122
  ? globalThis
3164
- : typeof self !== "undefined"
3123
+ : typeof self !== "undefined" // Older browsers, workers, webview, window etc
3165
3124
  ? self
3166
- : typeof global === "undefined"
3125
+ : typeof global !== "undefined" // Older versions of node
3167
3126
  ? global
3168
- : undefined;
3127
+ : undefined; // Unsupported environment. No idea to return 'this' since we are in a module or a function scope anyway.
3169
3128
 
3170
3129
  var TypedArraysDefs = [
3171
3130
  "Int8Array",
@@ -3531,7 +3490,7 @@
3531
3490
  const rewrittenKey = `${key}:${currentUser.userId}`;
3532
3491
  mutClone.keys[keyIndex] = rewrittenKey;
3533
3492
  if (rewriteValues) {
3534
- Dexie__default["default"].setByKeyPath(mutClone.values[keyIndex], primaryKey.keyPath, rewrittenKey);
3493
+ Dexie.setByKeyPath(mutClone.values[keyIndex], primaryKey.keyPath, rewrittenKey);
3535
3494
  }
3536
3495
  }
3537
3496
  });
@@ -3695,7 +3654,7 @@
3695
3654
 
3696
3655
  function throwIfCancelled(cancelToken) {
3697
3656
  if (cancelToken === null || cancelToken === void 0 ? void 0 : cancelToken.cancelled)
3698
- throw new Dexie__default["default"].AbortError(`Operation was cancelled`);
3657
+ throw new Dexie.AbortError(`Operation was cancelled`);
3699
3658
  }
3700
3659
 
3701
3660
  /* Need this because navigator.onLine seems to say "false" when it is actually online.
@@ -3747,7 +3706,7 @@
3747
3706
  }
3748
3707
  }
3749
3708
  else {
3750
- Dexie__default["default"].setByKeyPath(obj, keyPath, value);
3709
+ Dexie.setByKeyPath(obj, keyPath, value);
3751
3710
  }
3752
3711
  }
3753
3712
  resultKeys.push(key);
@@ -3762,7 +3721,7 @@
3762
3721
 
3763
3722
  function applyServerChanges(changes, db) {
3764
3723
  return __awaiter(this, void 0, void 0, function* () {
3765
- console.debug('Applying server changes', changes, Dexie__default["default"].currentTransaction);
3724
+ console.debug('Applying server changes', changes, Dexie.currentTransaction);
3766
3725
  for (const { table: tableName, muts } of changes) {
3767
3726
  const table = db.table(tableName);
3768
3727
  if (!table)
@@ -3799,7 +3758,7 @@
3799
3758
  else {
3800
3759
  keys.forEach((key, i) => {
3801
3760
  // Make sure inbound keys are consistent
3802
- Dexie__default["default"].setByKeyPath(mut.values[i], primaryKey.keyPath, key);
3761
+ Dexie.setByKeyPath(mut.values[i], primaryKey.keyPath, key);
3803
3762
  });
3804
3763
  yield table.bulkAdd(mut.values);
3805
3764
  }
@@ -3811,7 +3770,7 @@
3811
3770
  else {
3812
3771
  keys.forEach((key, i) => {
3813
3772
  // Make sure inbound keys are consistent
3814
- Dexie__default["default"].setByKeyPath(mut.values[i], primaryKey.keyPath, key);
3773
+ Dexie.setByKeyPath(mut.values[i], primaryKey.keyPath, key);
3815
3774
  });
3816
3775
  yield table.bulkPut(mut.values);
3817
3776
  }
@@ -4276,7 +4235,7 @@
4276
4235
  return; // Ignore message
4277
4236
  }
4278
4237
  // Verify also that the message is based on the exact same set of realms
4279
- const ourRealmSetHash = yield Dexie__default["default"].waitFor(
4238
+ const ourRealmSetHash = yield Dexie.waitFor(
4280
4239
  // Keep TX in non-IDB work
4281
4240
  computeRealmSetHash(syncState));
4282
4241
  console.debug('ourRealmSetHash', ourRealmSetHash);
@@ -4483,7 +4442,7 @@
4483
4442
  const IS_SERVICE_WORKER = typeof self !== "undefined" && "clients" in self && !self.document;
4484
4443
 
4485
4444
  function throwVersionIncrementNeeded() {
4486
- throw new Dexie__default["default"].SchemaError(`Version increment needed to allow dexie-cloud change tracking`);
4445
+ throw new Dexie.SchemaError(`Version increment needed to allow dexie-cloud change tracking`);
4487
4446
  }
4488
4447
 
4489
4448
  const { toString } = {};
@@ -4599,14 +4558,14 @@
4599
4558
  if (!table.schema.primaryKey.outbound) {
4600
4559
  if (!valueClones)
4601
4560
  valueClones = req.values.slice();
4602
- valueClones[idx] = Dexie__default["default"].deepClone(valueClones[idx]);
4603
- Dexie__default["default"].setByKeyPath(valueClones[idx], table.schema.primaryKey.keyPath, keys[idx]);
4561
+ valueClones[idx] = Dexie.deepClone(valueClones[idx]);
4562
+ Dexie.setByKeyPath(valueClones[idx], table.schema.primaryKey.keyPath, keys[idx]);
4604
4563
  }
4605
4564
  }
4606
4565
  else if (typeof key !== 'string' ||
4607
4566
  (!key.startsWith(idPrefix) && !key.startsWith('#' + idPrefix))) {
4608
4567
  // Key was specified by caller. Verify it complies with id prefix.
4609
- throw new Dexie__default["default"].ConstraintError(`The ID "${key}" is not valid for table "${tableName}". ` +
4568
+ throw new Dexie.ConstraintError(`The ID "${key}" is not valid for table "${tableName}". ` +
4610
4569
  `Primary '@' keys requires the key to be prefixed with "${idPrefix}" (or "#${idPrefix}).\n` +
4611
4570
  `If you want to generate IDs programmatically, remove '@' from the schema to get rid of this constraint. Dexie Cloud supports custom IDs as long as they are random and globally unique.`);
4612
4571
  }
@@ -4631,7 +4590,7 @@
4631
4590
  const type = Array.isArray(key)
4632
4591
  ? key.map(toStringTag).join(',')
4633
4592
  : toStringTag(key);
4634
- throw new Dexie__default["default"].ConstraintError(`Invalid primary key type ${type} for table ${tableName}. Tables marked for sync has primary keys of type string or Array of string (and optional numbers)`);
4593
+ throw new Dexie.ConstraintError(`Invalid primary key type ${type} for table ${tableName}. Tables marked for sync has primary keys of type string or Array of string (and optional numbers)`);
4635
4594
  }
4636
4595
  });
4637
4596
  }
@@ -5645,11 +5604,11 @@
5645
5604
  for (const table of db.tables) {
5646
5605
  if ((_b = (_a = db.cloud.schema) === null || _a === void 0 ? void 0 : _a[table.name]) === null || _b === void 0 ? void 0 : _b.markedForSync) {
5647
5606
  if (table.schema.primKey.auto) {
5648
- throw new Dexie__default["default"].SchemaError(`Table ${table.name} is both autoIncremented and synced. ` +
5607
+ throw new Dexie.SchemaError(`Table ${table.name} is both autoIncremented and synced. ` +
5649
5608
  `Use db.cloud.configure({unsyncedTables: [${JSON.stringify(table.name)}]}) to blacklist it from sync`);
5650
5609
  }
5651
5610
  if (!table.schema.primKey.keyPath) {
5652
- throw new Dexie__default["default"].SchemaError(`Table ${table.name} cannot be both synced and outbound. ` +
5611
+ throw new Dexie.SchemaError(`Table ${table.name} cannot be both synced and outbound. ` +
5653
5612
  `Use db.cloud.configure({unsyncedTables: [${JSON.stringify(table.name)}]}) to blacklist it from sync`);
5654
5613
  }
5655
5614
  }
@@ -6249,7 +6208,7 @@
6249
6208
  let closed = false;
6250
6209
  function throwIfClosed() {
6251
6210
  if (closed)
6252
- throw new Dexie__default["default"].DatabaseClosedError();
6211
+ throw new Dexie.DatabaseClosedError();
6253
6212
  }
6254
6213
  dbOnClosed(dexie, () => {
6255
6214
  subscriptions.forEach((subscription) => subscription.unsubscribe());
@@ -6260,7 +6219,7 @@
6260
6219
  });
6261
6220
  const syncComplete = new rxjs.Subject();
6262
6221
  dexie.cloud = {
6263
- version: '4.0.1-beta.47',
6222
+ version: '{version}',
6264
6223
  options: Object.assign({}, DEFAULT_OPTIONS),
6265
6224
  schema: null,
6266
6225
  get currentUserId() {
@@ -6351,7 +6310,7 @@
6351
6310
  return permissions(dexie._novip, obj, tableName);
6352
6311
  },
6353
6312
  };
6354
- dexie.Version.prototype['_parseStoresSpec'] = Dexie__default["default"].override(dexie.Version.prototype['_parseStoresSpec'], (origFunc) => overrideParseStoresSpec(origFunc, dexie));
6313
+ dexie.Version.prototype['_parseStoresSpec'] = Dexie.override(dexie.Version.prototype['_parseStoresSpec'], (origFunc) => overrideParseStoresSpec(origFunc, dexie));
6355
6314
  dexie.Table.prototype.newId = function ({ colocateWith } = {}) {
6356
6315
  const shardKey = colocateWith && colocateWith.substr(colocateWith.length - 3);
6357
6316
  return generateKey(dexie.cloud.schema[this.name].idPrefix || '', shardKey);
@@ -6536,10 +6495,10 @@
6536
6495
  });
6537
6496
  }
6538
6497
  }
6539
- dexieCloud.version = '4.0.1-beta.47';
6540
- Dexie__default["default"].Cloud = dexieCloud;
6498
+ dexieCloud.version = '{version}';
6499
+ Dexie.Cloud = dexieCloud;
6541
6500
 
6542
- exports["default"] = dexieCloud;
6501
+ exports.default = dexieCloud;
6543
6502
  exports.dexieCloud = dexieCloud;
6544
6503
  exports.getTiedObjectId = getTiedObjectId;
6545
6504
  exports.getTiedRealmId = getTiedRealmId;