entropic-bond 1.53.16 → 1.53.18
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/lib/entropic-bond.js +30 -29
- package/lib/entropic-bond.js.map +1 -1
- package/lib/entropic-bond.umd.cjs +2 -2
- package/lib/entropic-bond.umd.cjs.map +1 -1
- package/lib/store/data-source.d.ts +6 -8
- package/lib/store/json-data-source.d.ts +4 -4
- package/lib/store/model.d.ts +3 -3
- package/package.json +1 -1
package/lib/entropic-bond.js
CHANGED
|
@@ -46,18 +46,18 @@ class U {
|
|
|
46
46
|
const f = [];
|
|
47
47
|
for (let i = 0; i < 256; ++i)
|
|
48
48
|
f.push((i + 256).toString(16).slice(1));
|
|
49
|
-
function
|
|
49
|
+
function M(i, e = 0) {
|
|
50
50
|
return (f[i[e + 0]] + f[i[e + 1]] + f[i[e + 2]] + f[i[e + 3]] + "-" + f[i[e + 4]] + f[i[e + 5]] + "-" + f[i[e + 6]] + f[i[e + 7]] + "-" + f[i[e + 8]] + f[i[e + 9]] + "-" + f[i[e + 10]] + f[i[e + 11]] + f[i[e + 12]] + f[i[e + 13]] + f[i[e + 14]] + f[i[e + 15]]).toLowerCase();
|
|
51
51
|
}
|
|
52
|
-
let
|
|
52
|
+
let O;
|
|
53
53
|
const T = new Uint8Array(16);
|
|
54
54
|
function x() {
|
|
55
|
-
if (!
|
|
55
|
+
if (!O) {
|
|
56
56
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
57
57
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
58
|
-
|
|
58
|
+
O = crypto.getRandomValues.bind(crypto);
|
|
59
59
|
}
|
|
60
|
-
return
|
|
60
|
+
return O(T);
|
|
61
61
|
}
|
|
62
62
|
const B = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), A = { randomUUID: B };
|
|
63
63
|
function W(i, e, t) {
|
|
@@ -65,7 +65,7 @@ function W(i, e, t) {
|
|
|
65
65
|
const r = i.random ?? i.rng?.() ?? x();
|
|
66
66
|
if (r.length < 16)
|
|
67
67
|
throw new Error("Random bytes length must be >= 16");
|
|
68
|
-
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128,
|
|
68
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, M(r);
|
|
69
69
|
}
|
|
70
70
|
function Q(i, e, t) {
|
|
71
71
|
return A.randomUUID && !i ? A.randomUUID() : W(i);
|
|
@@ -537,10 +537,10 @@ class he extends u {
|
|
|
537
537
|
return this.notify({ [e]: this[e] }), t;
|
|
538
538
|
}
|
|
539
539
|
}
|
|
540
|
-
const
|
|
540
|
+
const D = class D {
|
|
541
541
|
constructor(e, t, r) {
|
|
542
542
|
if (r) {
|
|
543
|
-
if (!(t instanceof u)) throw new Error(
|
|
543
|
+
if (!(t instanceof u)) throw new Error(D.error.persistentNeedForSubCollection);
|
|
544
544
|
this.collectionName = `${t.className}/${t.id}/${r}`;
|
|
545
545
|
} else
|
|
546
546
|
this.collectionName = t instanceof u ? t.className : t;
|
|
@@ -637,7 +637,7 @@ const R = class R {
|
|
|
637
637
|
return this._stream.onCollectionChange(
|
|
638
638
|
e.getQueryObject(),
|
|
639
639
|
this.collectionName,
|
|
640
|
-
(r) => t(
|
|
640
|
+
(r) => t(r.map((s) => u.createInstance(s)))
|
|
641
641
|
);
|
|
642
642
|
}
|
|
643
643
|
toPersistentChangeObject(e) {
|
|
@@ -693,11 +693,11 @@ const R = class R {
|
|
|
693
693
|
};
|
|
694
694
|
}
|
|
695
695
|
};
|
|
696
|
-
|
|
696
|
+
D.error = {
|
|
697
697
|
persistentNeedForSubCollection: "The document parameter for a sub-collection should be a Persistent instace",
|
|
698
698
|
invalidQueryOrder: "Cannot add where calls after or calls"
|
|
699
699
|
};
|
|
700
|
-
let C =
|
|
700
|
+
let C = D;
|
|
701
701
|
class H {
|
|
702
702
|
constructor(e) {
|
|
703
703
|
this.queryObject = { operations: [] }, this.model = e;
|
|
@@ -1003,10 +1003,10 @@ class w {
|
|
|
1003
1003
|
});
|
|
1004
1004
|
const s = [];
|
|
1005
1005
|
return Object.entries(r).forEach(([n, o]) => {
|
|
1006
|
-
const a = this.
|
|
1006
|
+
const a = this.subscribeToDocumentChangeListener(n, (c) => w.processDocumentChange(c, o));
|
|
1007
1007
|
if (a)
|
|
1008
1008
|
s.push(a);
|
|
1009
|
-
else if (e.noThrowOnNonImplementedListener) throw new Error("The method
|
|
1009
|
+
else if (e.noThrowOnNonImplementedListener) throw new Error("The method documentChangeListener has not been implemented in the concrete data source");
|
|
1010
1010
|
}), s;
|
|
1011
1011
|
}
|
|
1012
1012
|
/**
|
|
@@ -1017,9 +1017,9 @@ class w {
|
|
|
1017
1017
|
* @param props the properties to be watched in the collection
|
|
1018
1018
|
* @param listener the listener to be called when a document is changed
|
|
1019
1019
|
* @returns a function that uninstalls the listener. If the returned value is undefined
|
|
1020
|
-
* the method
|
|
1020
|
+
* the method documentChangeListener has not been implemented in the concrete data source
|
|
1021
1021
|
*/
|
|
1022
|
-
|
|
1022
|
+
subscribeToDocumentChangeListener(e, t) {
|
|
1023
1023
|
}
|
|
1024
1024
|
/**
|
|
1025
1025
|
* Utility method to convert a query object to a property path query object
|
|
@@ -1141,7 +1141,8 @@ class le extends w {
|
|
|
1141
1141
|
onCollectionChange(e, t, r) {
|
|
1142
1142
|
return this._collectionListeners[t] = (s) => {
|
|
1143
1143
|
if (!s.after) return;
|
|
1144
|
-
this.retrieveQueryDocs([s.after], e.operations)
|
|
1144
|
+
const n = this.retrieveQueryDocs([s.after], e.operations);
|
|
1145
|
+
n.length > 0 && r(n);
|
|
1145
1146
|
}, () => delete this._serverCollectionListeners[t];
|
|
1146
1147
|
}
|
|
1147
1148
|
onDocumentChange(e, t, r) {
|
|
@@ -1173,7 +1174,7 @@ class le extends w {
|
|
|
1173
1174
|
delete: e
|
|
1174
1175
|
} : this._simulateError = e, this);
|
|
1175
1176
|
}
|
|
1176
|
-
|
|
1177
|
+
subscribeToDocumentChangeListener(e, t) {
|
|
1177
1178
|
return delete this._serverCollectionListeners[e], this._serverCollectionListeners[e] = t, {
|
|
1178
1179
|
uninstall: () => delete this._serverCollectionListeners[e],
|
|
1179
1180
|
nativeHandler: t,
|
|
@@ -1221,7 +1222,7 @@ class le extends w {
|
|
|
1221
1222
|
"<=": (h, d) => h <= d,
|
|
1222
1223
|
">": (h, d) => h > d,
|
|
1223
1224
|
">=": (h, d) => h >= d,
|
|
1224
|
-
containsAny: (h, d) => h?.some((
|
|
1225
|
+
containsAny: (h, d) => h?.some(($) => d?.includes($)),
|
|
1225
1226
|
contains: (h, d) => h?.includes(d)
|
|
1226
1227
|
}, { property: s, value: n, operator: o } = t, [a, c] = this.retrieveValuesToCompare(e, s, n);
|
|
1227
1228
|
return r[o](a, c);
|
|
@@ -1332,7 +1333,7 @@ let j = class extends P {
|
|
|
1332
1333
|
j = G([
|
|
1333
1334
|
J("MockCloudStorage", () => new j())
|
|
1334
1335
|
], j);
|
|
1335
|
-
var K = Object.defineProperty, X = Object.getOwnPropertyDescriptor,
|
|
1336
|
+
var K = Object.defineProperty, X = Object.getOwnPropertyDescriptor, R = (i, e, t, r) => {
|
|
1336
1337
|
for (var s = r > 1 ? void 0 : r ? X(e, t) : e, n = i.length - 1, o; n >= 0; n--)
|
|
1337
1338
|
(o = i[n]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
1338
1339
|
return r && s && K(e, t, s), s;
|
|
@@ -1384,22 +1385,22 @@ let b = class extends u {
|
|
|
1384
1385
|
return this._onChange.subscribe(i);
|
|
1385
1386
|
}
|
|
1386
1387
|
};
|
|
1387
|
-
|
|
1388
|
+
R([
|
|
1388
1389
|
S
|
|
1389
1390
|
], b.prototype, "_reference", 2);
|
|
1390
|
-
|
|
1391
|
+
R([
|
|
1391
1392
|
S
|
|
1392
1393
|
], b.prototype, "_url", 2);
|
|
1393
|
-
|
|
1394
|
+
R([
|
|
1394
1395
|
S
|
|
1395
1396
|
], b.prototype, "_cloudStorageProviderName", 2);
|
|
1396
|
-
|
|
1397
|
+
R([
|
|
1397
1398
|
S
|
|
1398
1399
|
], b.prototype, "_originalFileName", 2);
|
|
1399
|
-
|
|
1400
|
+
R([
|
|
1400
1401
|
S
|
|
1401
1402
|
], b.prototype, "_mimeType", 2);
|
|
1402
|
-
b =
|
|
1403
|
+
b = R([
|
|
1403
1404
|
z("StoredFile")
|
|
1404
1405
|
], b);
|
|
1405
1406
|
class L {
|
|
@@ -1646,9 +1647,9 @@ class fe {
|
|
|
1646
1647
|
return e(t);
|
|
1647
1648
|
}
|
|
1648
1649
|
}
|
|
1649
|
-
class
|
|
1650
|
+
class V {
|
|
1650
1651
|
}
|
|
1651
|
-
const m = class m extends
|
|
1652
|
+
const m = class m extends V {
|
|
1652
1653
|
constructor() {
|
|
1653
1654
|
super();
|
|
1654
1655
|
}
|
|
@@ -1674,7 +1675,7 @@ const m = class m extends M {
|
|
|
1674
1675
|
};
|
|
1675
1676
|
m.error = { shouldBeRegistered: "You should register a Server Auth service before using the Server Auth." }, m._instance = void 0;
|
|
1676
1677
|
let N = m;
|
|
1677
|
-
class pe extends
|
|
1678
|
+
class pe extends V {
|
|
1678
1679
|
constructor(e) {
|
|
1679
1680
|
super(), this._userCredentials = e;
|
|
1680
1681
|
}
|
|
@@ -1736,7 +1737,7 @@ export {
|
|
|
1736
1737
|
H as Query,
|
|
1737
1738
|
N as ServerAuth,
|
|
1738
1739
|
pe as ServerAuthMock,
|
|
1739
|
-
|
|
1740
|
+
V as ServerAuthService,
|
|
1740
1741
|
E as Store,
|
|
1741
1742
|
b as StoredFile,
|
|
1742
1743
|
ee as StoredFileEvent,
|