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
|
@@ -3041,12 +3041,12 @@
|
|
|
3041
3041
|
// serverRev.rev = new FakeBigInt(server.rev)
|
|
3042
3042
|
const hasBigIntSupport = typeof BigInt === 'function' && typeof BigInt(0) === 'bigint';
|
|
3043
3043
|
class FakeBigInt {
|
|
3044
|
-
constructor(value) {
|
|
3045
|
-
this.v = value;
|
|
3046
|
-
}
|
|
3047
3044
|
toString() {
|
|
3048
3045
|
return this.v;
|
|
3049
3046
|
}
|
|
3047
|
+
constructor(value) {
|
|
3048
|
+
this.v = value;
|
|
3049
|
+
}
|
|
3050
3050
|
}
|
|
3051
3051
|
const defs = Object.assign(Object.assign({}, undefinedDef), (hasBigIntSupport
|
|
3052
3052
|
? {}
|
|
@@ -3917,7 +3917,16 @@
|
|
|
3917
3917
|
return db.$syncState.get('syncState');
|
|
3918
3918
|
},
|
|
3919
3919
|
getSchema() {
|
|
3920
|
-
return db.$syncState.get('schema')
|
|
3920
|
+
return db.$syncState.get('schema').then((schema) => {
|
|
3921
|
+
if (schema) {
|
|
3922
|
+
for (const table of db.tables) {
|
|
3923
|
+
if (table.schema.primKey && table.schema.primKey.keyPath && schema[table.name]) {
|
|
3924
|
+
schema[table.name].primaryKey = nameFromKeyPath(table.schema.primKey.keyPath);
|
|
3925
|
+
}
|
|
3926
|
+
}
|
|
3927
|
+
}
|
|
3928
|
+
return schema;
|
|
3929
|
+
});
|
|
3921
3930
|
},
|
|
3922
3931
|
getOptions() {
|
|
3923
3932
|
return db.$syncState.get('options');
|
|
@@ -3935,6 +3944,11 @@
|
|
|
3935
3944
|
}
|
|
3936
3945
|
return db;
|
|
3937
3946
|
}
|
|
3947
|
+
function nameFromKeyPath(keyPath) {
|
|
3948
|
+
return typeof keyPath === 'string' ?
|
|
3949
|
+
keyPath :
|
|
3950
|
+
keyPath ? ('[' + [].join.call(keyPath, '+') + ']') : "";
|
|
3951
|
+
}
|
|
3938
3952
|
|
|
3939
3953
|
// Emulate true-private property db. Why? So it's not stored in DB.
|
|
3940
3954
|
const wm = new WeakMap();
|
|
@@ -5903,7 +5917,7 @@
|
|
|
5903
5917
|
currentUserEmitter.next(UNAUTHORIZED_USER);
|
|
5904
5918
|
});
|
|
5905
5919
|
dexie.cloud = {
|
|
5906
|
-
version: '4.0.1-beta.
|
|
5920
|
+
version: '4.0.1-beta.28',
|
|
5907
5921
|
options: Object.assign({}, DEFAULT_OPTIONS),
|
|
5908
5922
|
schema: null,
|
|
5909
5923
|
get currentUserId() {
|
|
@@ -6033,7 +6047,9 @@
|
|
|
6033
6047
|
// Update persisted options:
|
|
6034
6048
|
if (!options)
|
|
6035
6049
|
throw new Error(`Internal error`); // options cannot be null if configuredProgramatically is set.
|
|
6036
|
-
|
|
6050
|
+
const newPersistedOptions = Object.assign({}, options);
|
|
6051
|
+
delete newPersistedOptions.fetchTokens;
|
|
6052
|
+
yield db.$syncState.put(newPersistedOptions, 'options');
|
|
6037
6053
|
}
|
|
6038
6054
|
if (((_h = db.cloud.options) === null || _h === void 0 ? void 0 : _h.tryUseServiceWorker) &&
|
|
6039
6055
|
'serviceWorker' in navigator &&
|
|
@@ -6156,7 +6172,7 @@
|
|
|
6156
6172
|
});
|
|
6157
6173
|
}
|
|
6158
6174
|
}
|
|
6159
|
-
dexieCloud.version = '4.0.1-beta.
|
|
6175
|
+
dexieCloud.version = '4.0.1-beta.28';
|
|
6160
6176
|
Dexie__default["default"].Cloud = dexieCloud;
|
|
6161
6177
|
|
|
6162
6178
|
// In case the SW lives for a while, let it reuse already opened connections:
|