dexie-cloud-addon 4.0.1-beta.26 → 4.0.1-beta.27
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 +1 -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 +1 -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 +1 -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 +1 -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/package.json +3 -4
|
@@ -3034,12 +3034,12 @@ var undefinedDef = {
|
|
|
3034
3034
|
// serverRev.rev = new FakeBigInt(server.rev)
|
|
3035
3035
|
const hasBigIntSupport = typeof BigInt === 'function' && typeof BigInt(0) === 'bigint';
|
|
3036
3036
|
class FakeBigInt {
|
|
3037
|
-
constructor(value) {
|
|
3038
|
-
this.v = value;
|
|
3039
|
-
}
|
|
3040
3037
|
toString() {
|
|
3041
3038
|
return this.v;
|
|
3042
3039
|
}
|
|
3040
|
+
constructor(value) {
|
|
3041
|
+
this.v = value;
|
|
3042
|
+
}
|
|
3043
3043
|
}
|
|
3044
3044
|
const defs = Object.assign(Object.assign({}, undefinedDef), (hasBigIntSupport
|
|
3045
3045
|
? {}
|
|
@@ -3910,7 +3910,16 @@ function DexieCloudDB(dx) {
|
|
|
3910
3910
|
return db.$syncState.get('syncState');
|
|
3911
3911
|
},
|
|
3912
3912
|
getSchema() {
|
|
3913
|
-
return db.$syncState.get('schema')
|
|
3913
|
+
return db.$syncState.get('schema').then((schema) => {
|
|
3914
|
+
if (schema) {
|
|
3915
|
+
for (const table of db.tables) {
|
|
3916
|
+
if (table.schema.primKey && table.schema.primKey.keyPath && schema[table.name]) {
|
|
3917
|
+
schema[table.name].primaryKey = nameFromKeyPath(table.schema.primKey.keyPath);
|
|
3918
|
+
}
|
|
3919
|
+
}
|
|
3920
|
+
}
|
|
3921
|
+
return schema;
|
|
3922
|
+
});
|
|
3914
3923
|
},
|
|
3915
3924
|
getOptions() {
|
|
3916
3925
|
return db.$syncState.get('options');
|
|
@@ -3928,6 +3937,11 @@ function DexieCloudDB(dx) {
|
|
|
3928
3937
|
}
|
|
3929
3938
|
return db;
|
|
3930
3939
|
}
|
|
3940
|
+
function nameFromKeyPath(keyPath) {
|
|
3941
|
+
return typeof keyPath === 'string' ?
|
|
3942
|
+
keyPath :
|
|
3943
|
+
keyPath ? ('[' + [].join.call(keyPath, '+') + ']') : "";
|
|
3944
|
+
}
|
|
3931
3945
|
|
|
3932
3946
|
// Emulate true-private property db. Why? So it's not stored in DB.
|
|
3933
3947
|
const wm = new WeakMap();
|
|
@@ -5896,7 +5910,7 @@ function dexieCloud(dexie) {
|
|
|
5896
5910
|
currentUserEmitter.next(UNAUTHORIZED_USER);
|
|
5897
5911
|
});
|
|
5898
5912
|
dexie.cloud = {
|
|
5899
|
-
version: '4.0.1-beta.
|
|
5913
|
+
version: '4.0.1-beta.27',
|
|
5900
5914
|
options: Object.assign({}, DEFAULT_OPTIONS),
|
|
5901
5915
|
schema: null,
|
|
5902
5916
|
get currentUserId() {
|
|
@@ -6026,7 +6040,9 @@ function dexieCloud(dexie) {
|
|
|
6026
6040
|
// Update persisted options:
|
|
6027
6041
|
if (!options)
|
|
6028
6042
|
throw new Error(`Internal error`); // options cannot be null if configuredProgramatically is set.
|
|
6029
|
-
|
|
6043
|
+
const newPersistedOptions = Object.assign({}, options);
|
|
6044
|
+
delete newPersistedOptions.fetchTokens;
|
|
6045
|
+
yield db.$syncState.put(newPersistedOptions, 'options');
|
|
6030
6046
|
}
|
|
6031
6047
|
if (((_h = db.cloud.options) === null || _h === void 0 ? void 0 : _h.tryUseServiceWorker) &&
|
|
6032
6048
|
'serviceWorker' in navigator &&
|
|
@@ -6149,7 +6165,7 @@ function dexieCloud(dexie) {
|
|
|
6149
6165
|
});
|
|
6150
6166
|
}
|
|
6151
6167
|
}
|
|
6152
|
-
dexieCloud.version = '4.0.1-beta.
|
|
6168
|
+
dexieCloud.version = '4.0.1-beta.27';
|
|
6153
6169
|
Dexie.Cloud = dexieCloud;
|
|
6154
6170
|
|
|
6155
6171
|
// In case the SW lives for a while, let it reuse already opened connections:
|