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.
- package/dist/modern/dexie-cloud-addon.js +24 -8
- package/dist/modern/dexie-cloud-addon.js.map +1 -1
- package/dist/modern/dexie-cloud-addon.min.js +2 -1
- package/dist/modern/dexie-cloud-addon.min.js.map +1 -1
- package/dist/modern/service-worker.js +23 -7
- package/dist/modern/service-worker.js.map +1 -1
- package/dist/modern/service-worker.min.js +2 -1
- package/dist/modern/service-worker.min.js.map +1 -1
- package/dist/module-es5/dexie-cloud-addon.js +23 -6
- package/dist/module-es5/dexie-cloud-addon.js.map +1 -1
- package/dist/module-es5/dexie-cloud-addon.min.js +2 -1
- package/dist/module-es5/dexie-cloud-addon.min.js.map +1 -1
- package/dist/types/DXCWebSocketStatus.d.ts +1 -1
- package/dist/types/DexieCloudEntity.d.ts +8 -0
- package/dist/types/DexieCloudServerState.d.ts +5 -0
- package/dist/types/DexieCloudTable.d.ts +2 -2
- package/dist/types/PermissionChecker.d.ts +1 -1
- package/dist/types/TSON.d.ts +1 -1
- package/dist/types/WSObservable.d.ts +2 -2
- package/dist/types/WebSocketStatus.d.ts +1 -0
- package/dist/types/authentication/authenticate.d.ts +1 -1
- package/dist/types/createMyMembersObservable.d.ts +14 -0
- package/dist/types/currentUserObservable.d.ts +3 -0
- package/dist/types/db/DexieCloudDB.d.ts +1 -1
- package/dist/types/extend-dexie-interface.d.ts +1 -1
- package/dist/types/getInternalAccessControlObservable.d.ts +1 -1
- package/dist/types/getPermissionsLookupObservable.d.ts +2 -2
- package/dist/types/helpers/BroadcastedLocalEvent.d.ts +8 -0
- package/dist/types/helpers/visibleState.d.ts +1 -0
- package/dist/types/permissionsLookup.d.ts +9 -0
- package/dist/types/permissionsLookupObservable.d.ts +14 -0
- package/dist/types/sync/globalizePrivateIds.d.ts +4 -0
- package/dist/types/sync/messagesFromServerQueue.d.ts +1 -1
- package/dist/types/sync/syncServerToClientOnly.d.ts +3 -0
- package/dist/types/types/CloudConnectionStatus.d.ts +0 -0
- package/dist/types/types/ConnectionStatus.d.ts +0 -0
- package/dist/types/types/DXCAlert.d.ts +1 -1
- package/dist/types/types/DXCInputField.d.ts +1 -1
- package/dist/types/types/DXCUserInteraction.d.ts +1 -1
- package/dist/types/types/LoginState.d.ts +41 -0
- package/dist/types/types/SWSyncEvent.d.ts +1 -1
- package/dist/types/types/SyncConnectionStatus.d.ts +1 -0
- package/dist/types/types/SyncFlowStatus.d.ts +6 -0
- package/dist/types/types/SyncState.d.ts +2 -2
- package/dist/types/types/SyncStatus.d.ts +6 -0
- package/dist/umd/dexie-cloud-addon.js +23 -6
- package/dist/umd/dexie-cloud-addon.js.map +1 -1
- package/dist/umd/dexie-cloud-addon.min.js +1 -1
- package/dist/umd/dexie-cloud-addon.min.js.map +1 -1
- package/dist/umd/service-worker.js +23 -7
- package/dist/umd/service-worker.js.map +1 -1
- package/dist/umd/service-worker.min.js +2 -1
- package/dist/umd/service-worker.min.js.map +1 -1
- package/dist/umd-modern/dexie-cloud-addon.js +21 -5
- package/dist/umd-modern/dexie-cloud-addon.js.map +1 -1
- package/dist/umd-modern/dexie-cloud-addon.min.js +2 -0
- package/dist/umd-modern/dexie-cloud-addon.min.js.map +1 -0
- 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
|
-
|
|
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 &&
|