dexie-cloud-addon 4.0.1-beta.26 → 4.0.1-beta.28

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 (58) hide show
  1. package/dist/modern/dexie-cloud-addon.js +24 -8
  2. package/dist/modern/dexie-cloud-addon.js.map +1 -1
  3. package/dist/modern/dexie-cloud-addon.min.js +2 -1
  4. package/dist/modern/dexie-cloud-addon.min.js.map +1 -1
  5. package/dist/modern/service-worker.js +23 -7
  6. package/dist/modern/service-worker.js.map +1 -1
  7. package/dist/modern/service-worker.min.js +2 -1
  8. package/dist/modern/service-worker.min.js.map +1 -1
  9. package/dist/module-es5/dexie-cloud-addon.js +23 -6
  10. package/dist/module-es5/dexie-cloud-addon.js.map +1 -1
  11. package/dist/module-es5/dexie-cloud-addon.min.js +2 -1
  12. package/dist/module-es5/dexie-cloud-addon.min.js.map +1 -1
  13. package/dist/types/DXCWebSocketStatus.d.ts +1 -1
  14. package/dist/types/DexieCloudEntity.d.ts +8 -0
  15. package/dist/types/DexieCloudServerState.d.ts +5 -0
  16. package/dist/types/DexieCloudTable.d.ts +2 -2
  17. package/dist/types/PermissionChecker.d.ts +1 -1
  18. package/dist/types/TSON.d.ts +1 -1
  19. package/dist/types/WSObservable.d.ts +2 -2
  20. package/dist/types/WebSocketStatus.d.ts +1 -0
  21. package/dist/types/authentication/authenticate.d.ts +1 -1
  22. package/dist/types/createMyMembersObservable.d.ts +14 -0
  23. package/dist/types/currentUserObservable.d.ts +3 -0
  24. package/dist/types/db/DexieCloudDB.d.ts +1 -1
  25. package/dist/types/extend-dexie-interface.d.ts +1 -1
  26. package/dist/types/getInternalAccessControlObservable.d.ts +1 -1
  27. package/dist/types/getPermissionsLookupObservable.d.ts +2 -2
  28. package/dist/types/helpers/BroadcastedLocalEvent.d.ts +8 -0
  29. package/dist/types/helpers/visibleState.d.ts +1 -0
  30. package/dist/types/permissionsLookup.d.ts +9 -0
  31. package/dist/types/permissionsLookupObservable.d.ts +14 -0
  32. package/dist/types/sync/globalizePrivateIds.d.ts +4 -0
  33. package/dist/types/sync/messagesFromServerQueue.d.ts +1 -1
  34. package/dist/types/sync/syncServerToClientOnly.d.ts +3 -0
  35. package/dist/types/types/CloudConnectionStatus.d.ts +0 -0
  36. package/dist/types/types/ConnectionStatus.d.ts +0 -0
  37. package/dist/types/types/DXCAlert.d.ts +1 -1
  38. package/dist/types/types/DXCInputField.d.ts +1 -1
  39. package/dist/types/types/DXCUserInteraction.d.ts +1 -1
  40. package/dist/types/types/LoginState.d.ts +41 -0
  41. package/dist/types/types/SWSyncEvent.d.ts +1 -1
  42. package/dist/types/types/SyncConnectionStatus.d.ts +1 -0
  43. package/dist/types/types/SyncFlowStatus.d.ts +6 -0
  44. package/dist/types/types/SyncState.d.ts +2 -2
  45. package/dist/types/types/SyncStatus.d.ts +6 -0
  46. package/dist/umd/dexie-cloud-addon.js +23 -6
  47. package/dist/umd/dexie-cloud-addon.js.map +1 -1
  48. package/dist/umd/dexie-cloud-addon.min.js +1 -1
  49. package/dist/umd/dexie-cloud-addon.min.js.map +1 -1
  50. package/dist/umd/service-worker.js +23 -7
  51. package/dist/umd/service-worker.js.map +1 -1
  52. package/dist/umd/service-worker.min.js +2 -1
  53. package/dist/umd/service-worker.min.js.map +1 -1
  54. package/dist/umd-modern/dexie-cloud-addon.js +21 -5
  55. package/dist/umd-modern/dexie-cloud-addon.js.map +1 -1
  56. package/dist/umd-modern/dexie-cloud-addon.min.js +2 -0
  57. package/dist/umd-modern/dexie-cloud-addon.min.js.map +1 -0
  58. package/package.json +41 -12
@@ -3284,12 +3284,12 @@
3284
3284
  // serverRev.rev = new FakeBigInt(server.rev)
3285
3285
  const hasBigIntSupport = typeof BigInt === 'function' && typeof BigInt(0) === 'bigint';
3286
3286
  class FakeBigInt {
3287
- constructor(value) {
3288
- this.v = value;
3289
- }
3290
3287
  toString() {
3291
3288
  return this.v;
3292
3289
  }
3290
+ constructor(value) {
3291
+ this.v = value;
3292
+ }
3293
3293
  }
3294
3294
  const defs = Object.assign(Object.assign({}, undefinedDef), (hasBigIntSupport
3295
3295
  ? {}
@@ -4150,7 +4150,16 @@
4150
4150
  return db.$syncState.get('syncState');
4151
4151
  },
4152
4152
  getSchema() {
4153
- return db.$syncState.get('schema');
4153
+ return db.$syncState.get('schema').then((schema) => {
4154
+ if (schema) {
4155
+ for (const table of db.tables) {
4156
+ if (table.schema.primKey && table.schema.primKey.keyPath && schema[table.name]) {
4157
+ schema[table.name].primaryKey = nameFromKeyPath(table.schema.primKey.keyPath);
4158
+ }
4159
+ }
4160
+ }
4161
+ return schema;
4162
+ });
4154
4163
  },
4155
4164
  getOptions() {
4156
4165
  return db.$syncState.get('options');
@@ -4168,6 +4177,11 @@
4168
4177
  }
4169
4178
  return db;
4170
4179
  }
4180
+ function nameFromKeyPath(keyPath) {
4181
+ return typeof keyPath === 'string' ?
4182
+ keyPath :
4183
+ keyPath ? ('[' + [].join.call(keyPath, '+') + ']') : "";
4184
+ }
4171
4185
 
4172
4186
  // @ts-ignore
4173
4187
  const isFirefox = typeof InstallTrigger !== 'undefined';
@@ -6058,7 +6072,9 @@
6058
6072
  // Update persisted options:
6059
6073
  if (!options)
6060
6074
  throw new Error(`Internal error`); // options cannot be null if configuredProgramatically is set.
6061
- yield db.$syncState.put(options, 'options');
6075
+ const newPersistedOptions = Object.assign({}, options);
6076
+ delete newPersistedOptions.fetchTokens;
6077
+ yield db.$syncState.put(newPersistedOptions, 'options');
6062
6078
  }
6063
6079
  if (((_h = db.cloud.options) === null || _h === void 0 ? void 0 : _h.tryUseServiceWorker) &&
6064
6080
  'serviceWorker' in navigator &&