dexie-cloud-addon 4.0.0-beta.24 → 4.0.1-beta.26
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 +21 -22
- 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 +20 -21
- 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 +21 -22
- 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/DexieCloudTable.d.ts +18 -2
- package/dist/types/extend-dexie-interface.d.ts +5 -3
- package/dist/types/sync/getTablesToSyncify.d.ts +1 -1
- package/dist/umd/dexie-cloud-addon.js +20 -21
- 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 +19 -20
- 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 +17 -18
- package/dist/umd-modern/dexie-cloud-addon.js.map +1 -1
- package/package.json +3 -3
- package/dist/types/DexieCloudEntity.d.ts +0 -8
- package/dist/types/DexieCloudServerState.d.ts +0 -5
- package/dist/types/WebSocketStatus.d.ts +0 -1
- package/dist/types/createMyMembersObservable.d.ts +0 -14
- package/dist/types/currentUserObservable.d.ts +0 -3
- package/dist/types/helpers/BroadcastedLocalEvent.d.ts +0 -8
- package/dist/types/helpers/visibleState.d.ts +0 -1
- package/dist/types/permissionsLookup.d.ts +0 -9
- package/dist/types/permissionsLookupObservable.d.ts +0 -14
- package/dist/types/sync/globalizePrivateIds.d.ts +0 -4
- package/dist/types/sync/syncServerToClientOnly.d.ts +0 -3
- package/dist/types/types/CloudConnectionStatus.d.ts +0 -0
- package/dist/types/types/ConnectionStatus.d.ts +0 -0
- package/dist/types/types/LoginState.d.ts +0 -41
- package/dist/types/types/SyncConnectionStatus.d.ts +0 -1
- package/dist/types/types/SyncFlowStatus.d.ts +0 -6
- package/dist/types/types/SyncStatus.d.ts +0 -6
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* ==========================================================================
|
|
10
10
|
*
|
|
11
|
-
* Version 4.0.
|
|
11
|
+
* Version 4.0.1-beta.26, Tue Jan 17 2023
|
|
12
12
|
*
|
|
13
13
|
* https://dexie.org
|
|
14
14
|
*
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import Dexie, { cmp, liveQuery } from 'dexie';
|
|
20
|
-
import { Observable as Observable$1, BehaviorSubject, Subject, fromEvent, of, merge, Subscription as Subscription$1, from as from$1, throwError, combineLatest, map as map$1, share, timer as timer$1
|
|
20
|
+
import { Observable as Observable$1, BehaviorSubject, Subject, fromEvent, of, merge, Subscription as Subscription$1, from as from$1, throwError, combineLatest, map as map$1, share, timer as timer$1 } from 'rxjs';
|
|
21
21
|
|
|
22
22
|
/******************************************************************************
|
|
23
23
|
Copyright (c) Microsoft Corporation.
|
|
@@ -152,7 +152,7 @@ function __asyncValues(o) {
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
//@ts-check
|
|
155
|
-
const randomFillSync = crypto.getRandomValues;
|
|
155
|
+
const randomFillSync = crypto.getRandomValues.bind(crypto);
|
|
156
156
|
|
|
157
157
|
function assert(b) {
|
|
158
158
|
if (!b)
|
|
@@ -214,17 +214,17 @@ function setByKeyPath(obj, keyPath, value) {
|
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
const randomString$1 = typeof
|
|
218
|
-
// Node
|
|
219
|
-
const buf = Buffer.alloc(bytes);
|
|
220
|
-
randomFillSync(buf);
|
|
221
|
-
return buf.toString("base64");
|
|
222
|
-
} : (bytes) => {
|
|
217
|
+
const randomString$1 = typeof self !== 'undefined' && typeof crypto !== 'undefined' ? (bytes) => {
|
|
223
218
|
// Web
|
|
224
219
|
const buf = new Uint8Array(bytes);
|
|
225
220
|
crypto.getRandomValues(buf);
|
|
226
221
|
return btoa(String.fromCharCode.apply(null, buf));
|
|
227
|
-
}
|
|
222
|
+
} : typeof Buffer !== 'undefined' ? (bytes) => {
|
|
223
|
+
// Node
|
|
224
|
+
const buf = Buffer.alloc(bytes);
|
|
225
|
+
randomFillSync(buf);
|
|
226
|
+
return buf.toString("base64");
|
|
227
|
+
} : () => { throw new Error("No implementation of randomString was found"); };
|
|
228
228
|
|
|
229
229
|
/** Verifies that given primary key is valid.
|
|
230
230
|
* The reason we narrow validity for valid keys are twofold:
|
|
@@ -3275,7 +3275,7 @@ var undefinedDef = {
|
|
|
3275
3275
|
// serverRev.rev = bigIntDef.bigint.revive(server.rev)
|
|
3276
3276
|
// else
|
|
3277
3277
|
// serverRev.rev = new FakeBigInt(server.rev)
|
|
3278
|
-
const hasBigIntSupport = typeof BigInt(0) === 'bigint';
|
|
3278
|
+
const hasBigIntSupport = typeof BigInt === 'function' && typeof BigInt(0) === 'bigint';
|
|
3279
3279
|
class FakeBigInt {
|
|
3280
3280
|
constructor(value) {
|
|
3281
3281
|
this.v = value;
|
|
@@ -4416,7 +4416,7 @@ function createImplicitPropSetterMiddleware(db) {
|
|
|
4416
4416
|
// modify operations. Reason: Server may not have
|
|
4417
4417
|
// the object. Object should be created on server only
|
|
4418
4418
|
// if is being updated. An update operation won't create it
|
|
4419
|
-
// so we must delete req.changeSpec to
|
|
4419
|
+
// so we must delete req.changeSpec to degrade operation to
|
|
4420
4420
|
// an upsert operation with timestamp so that it will be created.
|
|
4421
4421
|
// We must also degrade from consistent modify operations for the
|
|
4422
4422
|
// same reason - object might be there on server. Must but put up instead.
|
|
@@ -4428,7 +4428,7 @@ function createImplicitPropSetterMiddleware(db) {
|
|
|
4428
4428
|
if (req.type === 'put') {
|
|
4429
4429
|
delete req.criteria;
|
|
4430
4430
|
delete req.changeSpec;
|
|
4431
|
-
delete req.
|
|
4431
|
+
delete req.updates;
|
|
4432
4432
|
obj.$ts = Date.now();
|
|
4433
4433
|
}
|
|
4434
4434
|
}
|
|
@@ -4633,11 +4633,10 @@ function createMutationTrackingMiddleware({ currentUserObservable, db }) {
|
|
|
4633
4633
|
const { numFailures: hasFailures, failures } = res;
|
|
4634
4634
|
let keys = type === 'delete' ? req.keys : res.results;
|
|
4635
4635
|
let values = 'values' in req ? req.values : [];
|
|
4636
|
-
let
|
|
4636
|
+
let updates = 'updates' in req && req.updates;
|
|
4637
4637
|
if (hasFailures) {
|
|
4638
4638
|
keys = keys.filter((_, idx) => !failures[idx]);
|
|
4639
4639
|
values = values.filter((_, idx) => !failures[idx]);
|
|
4640
|
-
changeSpecs = changeSpecs.filter((_, idx) => !failures[idx]);
|
|
4641
4640
|
}
|
|
4642
4641
|
const ts = Date.now();
|
|
4643
4642
|
const mut = req.type === 'delete'
|
|
@@ -4669,13 +4668,13 @@ function createMutationTrackingMiddleware({ currentUserObservable, db }) {
|
|
|
4669
4668
|
txid,
|
|
4670
4669
|
userId
|
|
4671
4670
|
}
|
|
4672
|
-
:
|
|
4671
|
+
: updates
|
|
4673
4672
|
? {
|
|
4674
4673
|
// One changeSpec per key
|
|
4675
4674
|
type: 'update',
|
|
4676
4675
|
ts,
|
|
4677
|
-
keys,
|
|
4678
|
-
changeSpecs,
|
|
4676
|
+
keys: updates.keys,
|
|
4677
|
+
changeSpecs: updates.changeSpecs,
|
|
4679
4678
|
txid,
|
|
4680
4679
|
userId
|
|
4681
4680
|
}
|
|
@@ -5856,10 +5855,10 @@ function permissions(dexie, obj, tableName) {
|
|
|
5856
5855
|
}
|
|
5857
5856
|
|
|
5858
5857
|
const getInvitesObservable = associate((db) => {
|
|
5859
|
-
const membersByEmail = getCurrentUserEmitter(db._novip).pipe(switchMap
|
|
5858
|
+
const membersByEmail = getCurrentUserEmitter(db._novip).pipe(switchMap((currentUser) => liveQuery(() => db.members.where({ email: currentUser.email || '' }).toArray())));
|
|
5860
5859
|
const permissions = getPermissionsLookupObservable(db._novip);
|
|
5861
5860
|
const accessControl = getInternalAccessControlObservable(db._novip);
|
|
5862
|
-
return createSharedValueObservable(combineLatest([membersByEmail, accessControl, permissions]).pipe(map
|
|
5861
|
+
return createSharedValueObservable(combineLatest([membersByEmail, accessControl, permissions]).pipe(map(([membersByEmail, accessControl, realmLookup]) => {
|
|
5863
5862
|
const reducer = (result, m) => (Object.assign(Object.assign({}, result), { [m.id]: Object.assign(Object.assign({}, m), { realm: realmLookup[m.realmId] }) }));
|
|
5864
5863
|
const emailMembersById = membersByEmail.reduce(reducer, {});
|
|
5865
5864
|
const membersById = accessControl.selfMembers.reduce(reducer, emailMembersById);
|
|
@@ -5922,7 +5921,7 @@ function dexieCloud(dexie) {
|
|
|
5922
5921
|
currentUserEmitter.next(UNAUTHORIZED_USER);
|
|
5923
5922
|
});
|
|
5924
5923
|
dexie.cloud = {
|
|
5925
|
-
version: '4.0.
|
|
5924
|
+
version: '4.0.1-beta.26',
|
|
5926
5925
|
options: Object.assign({}, DEFAULT_OPTIONS),
|
|
5927
5926
|
schema: null,
|
|
5928
5927
|
get currentUserId() {
|
|
@@ -6175,7 +6174,7 @@ function dexieCloud(dexie) {
|
|
|
6175
6174
|
});
|
|
6176
6175
|
}
|
|
6177
6176
|
}
|
|
6178
|
-
dexieCloud.version = '4.0.
|
|
6177
|
+
dexieCloud.version = '4.0.1-beta.26';
|
|
6179
6178
|
Dexie.Cloud = dexieCloud;
|
|
6180
6179
|
|
|
6181
6180
|
export { dexieCloud as default, dexieCloud, getTiedObjectId, getTiedRealmId };
|