entropic-bond 1.51.0 → 1.51.2
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
CHANGED
|
@@ -44,11 +44,11 @@ class F {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
let j;
|
|
47
|
-
const
|
|
47
|
+
const x = new Uint8Array(16);
|
|
48
48
|
function B() {
|
|
49
49
|
if (!j && (j = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !j))
|
|
50
50
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
51
|
-
return j(
|
|
51
|
+
return j(x);
|
|
52
52
|
}
|
|
53
53
|
const f = [];
|
|
54
54
|
for (let i = 0; i < 256; ++i)
|
|
@@ -417,7 +417,7 @@ function _(i) {
|
|
|
417
417
|
});
|
|
418
418
|
};
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function H(i, e) {
|
|
421
421
|
return (t) => {
|
|
422
422
|
l.registerFactory(i, t, e), t.prototype.__className = i;
|
|
423
423
|
};
|
|
@@ -576,7 +576,7 @@ const E = class E {
|
|
|
576
576
|
* @returns a Query object
|
|
577
577
|
*/
|
|
578
578
|
find() {
|
|
579
|
-
return new
|
|
579
|
+
return new J(this);
|
|
580
580
|
}
|
|
581
581
|
/**
|
|
582
582
|
* Define the search conditions. You pass query operations and how the query
|
|
@@ -643,7 +643,7 @@ const E = class E {
|
|
|
643
643
|
return e;
|
|
644
644
|
const t = ((r = e.operations) == null ? void 0 : r.map((s) => {
|
|
645
645
|
const n = s.value[0] ?? s.value;
|
|
646
|
-
return
|
|
646
|
+
return D.isArrayOperator(s.operator) && n instanceof l ? {
|
|
647
647
|
property: l.searchableArrayNameFor(s.property),
|
|
648
648
|
operator: s.operator,
|
|
649
649
|
value: Array.isArray(s.value) ? s.value.map((o) => o.id) : n.id,
|
|
@@ -666,7 +666,7 @@ E.error = {
|
|
|
666
666
|
invalidQueryOrder: "Cannot add where calls after or calls"
|
|
667
667
|
};
|
|
668
668
|
let C = E;
|
|
669
|
-
class
|
|
669
|
+
class J {
|
|
670
670
|
constructor(e) {
|
|
671
671
|
this.queryObject = { operations: [] }, this.model = e;
|
|
672
672
|
}
|
|
@@ -730,8 +730,8 @@ class H {
|
|
|
730
730
|
throw new Error(C.error.invalidQueryOrder);
|
|
731
731
|
const n = e.split(".");
|
|
732
732
|
let o = {}, c = n.length > 1 ? o : r;
|
|
733
|
-
return n.slice(1).forEach((v,
|
|
734
|
-
o[v] =
|
|
733
|
+
return n.slice(1).forEach((v, O) => {
|
|
734
|
+
o[v] = O < n.length - 2 ? {} : r, o = o[v];
|
|
735
735
|
}), (u = this.queryObject.operations) == null || u.push({
|
|
736
736
|
property: n[0],
|
|
737
737
|
operator: t,
|
|
@@ -962,13 +962,13 @@ const y = class y {
|
|
|
962
962
|
};
|
|
963
963
|
y.error = { shouldBeRegistered: "You should register a data source before using the data Store." };
|
|
964
964
|
let A = y;
|
|
965
|
-
class
|
|
965
|
+
class D {
|
|
966
966
|
installReferencePersistentPropsUpdaters(e, t = !0) {
|
|
967
967
|
this.onUpdate = e;
|
|
968
|
-
const r = [], s =
|
|
968
|
+
const r = [], s = D.getSystemRegisteredReferencesWithStoredProps();
|
|
969
969
|
return Object.entries(s).forEach(([n, o]) => {
|
|
970
970
|
o.forEach((c) => {
|
|
971
|
-
const h = this.
|
|
971
|
+
const h = this.subscribeToDocumentChangeListerner(c, (a) => this.onDocumentChange(a, c, n));
|
|
972
972
|
if (h)
|
|
973
973
|
r.push(h);
|
|
974
974
|
else if (t)
|
|
@@ -980,11 +980,12 @@ class O {
|
|
|
980
980
|
* Installs a document change listener
|
|
981
981
|
* Implement the required logic to install a listener that will be called
|
|
982
982
|
* when a document is changed in your concrete the data source
|
|
983
|
-
* @param
|
|
984
|
-
* @param listener the
|
|
985
|
-
* @returns a function that uninstalls the listener
|
|
983
|
+
* @param prop the property that has a reference to a persistent object
|
|
984
|
+
* @param listener the listener to be called when a document is changed
|
|
985
|
+
* @returns a function that uninstalls the listener. If the returned value is undefined
|
|
986
|
+
* the method documentChangeListerner has not been implemented in the concrete data source
|
|
986
987
|
*/
|
|
987
|
-
|
|
988
|
+
subscribeToDocumentChangeListerner(e, t) {
|
|
988
989
|
}
|
|
989
990
|
/**
|
|
990
991
|
* Utility method to convert a query object to a property path query object
|
|
@@ -1000,7 +1001,7 @@ class O {
|
|
|
1000
1001
|
*/
|
|
1001
1002
|
static toPropertyPathOperations(e) {
|
|
1002
1003
|
return e ? e.map((t) => {
|
|
1003
|
-
if (
|
|
1004
|
+
if (D.isArrayOperator(t.operator) && t.value[0] instanceof l)
|
|
1004
1005
|
return {
|
|
1005
1006
|
property: l.searchableArrayNameFor(t.property),
|
|
1006
1007
|
operator: t.operator,
|
|
@@ -1040,9 +1041,9 @@ class O {
|
|
|
1040
1041
|
o.map(async (c) => {
|
|
1041
1042
|
var h;
|
|
1042
1043
|
(h = t.forcedPersistentProps) == null || h.forEach(async (a) => {
|
|
1043
|
-
var
|
|
1044
|
+
var O;
|
|
1044
1045
|
const u = e.before[a], v = e.after[a];
|
|
1045
|
-
u !== v && (c[`_${t.name}`][`_${a}`] = v, await s.save(c), (
|
|
1046
|
+
u !== v && (c[`_${t.name}`][`_${a}`] = v, await s.save(c), (O = this.onUpdate) == null || O.call(this, c));
|
|
1046
1047
|
});
|
|
1047
1048
|
})
|
|
1048
1049
|
]);
|
|
@@ -1056,7 +1057,7 @@ class O {
|
|
|
1056
1057
|
}, {});
|
|
1057
1058
|
}
|
|
1058
1059
|
}
|
|
1059
|
-
class fe extends
|
|
1060
|
+
class fe extends D {
|
|
1060
1061
|
/**
|
|
1061
1062
|
* @param jsonRawData the JSON object to be used as data store
|
|
1062
1063
|
*/
|
|
@@ -1144,10 +1145,13 @@ class fe extends O {
|
|
|
1144
1145
|
delete: e
|
|
1145
1146
|
} : this._simulateError = e, this);
|
|
1146
1147
|
}
|
|
1147
|
-
|
|
1148
|
+
subscribeToDocumentChangeListerner(e, t) {
|
|
1148
1149
|
const r = l.collectionPath(void 0, e);
|
|
1149
|
-
|
|
1150
|
-
|
|
1150
|
+
if (r)
|
|
1151
|
+
return delete this._listener[r], this._listener[r] = t, {
|
|
1152
|
+
uninstall: () => delete this._listener[r],
|
|
1153
|
+
nativeHandler: t
|
|
1154
|
+
};
|
|
1151
1155
|
}
|
|
1152
1156
|
notifyChange(e, t, r) {
|
|
1153
1157
|
const s = this._listener[e];
|
|
@@ -1369,7 +1373,7 @@ R([
|
|
|
1369
1373
|
S
|
|
1370
1374
|
], b.prototype, "_mimeType", 2);
|
|
1371
1375
|
b = R([
|
|
1372
|
-
|
|
1376
|
+
H("StoredFile")
|
|
1373
1377
|
], b);
|
|
1374
1378
|
class M {
|
|
1375
1379
|
}
|
|
@@ -1621,9 +1625,9 @@ class me {
|
|
|
1621
1625
|
return e(t);
|
|
1622
1626
|
}
|
|
1623
1627
|
}
|
|
1624
|
-
class
|
|
1628
|
+
class T {
|
|
1625
1629
|
}
|
|
1626
|
-
const m = class m extends
|
|
1630
|
+
const m = class m extends T {
|
|
1627
1631
|
constructor() {
|
|
1628
1632
|
super();
|
|
1629
1633
|
}
|
|
@@ -1650,7 +1654,7 @@ const m = class m extends x {
|
|
|
1650
1654
|
};
|
|
1651
1655
|
m.error = { shouldBeRegistered: "You should register a Server Auth service before using the Server Auth." }, m._instance = void 0;
|
|
1652
1656
|
let $ = m;
|
|
1653
|
-
class ge extends
|
|
1657
|
+
class ge extends T {
|
|
1654
1658
|
constructor(e) {
|
|
1655
1659
|
super(), this._userCredentials = e;
|
|
1656
1660
|
}
|
|
@@ -1704,17 +1708,17 @@ export {
|
|
|
1704
1708
|
V as CloudFunctions,
|
|
1705
1709
|
me as CloudFunctionsMock,
|
|
1706
1710
|
w as CloudStorage,
|
|
1707
|
-
|
|
1711
|
+
D as DataSource,
|
|
1708
1712
|
de as EntropicComponent,
|
|
1709
1713
|
fe as JsonDataSource,
|
|
1710
1714
|
U as MockCloudStorage,
|
|
1711
1715
|
C as Model,
|
|
1712
1716
|
F as Observable,
|
|
1713
1717
|
l as Persistent,
|
|
1714
|
-
|
|
1718
|
+
J as Query,
|
|
1715
1719
|
$ as ServerAuth,
|
|
1716
1720
|
ge as ServerAuthMock,
|
|
1717
|
-
|
|
1721
|
+
T as ServerAuthService,
|
|
1718
1722
|
A as Store,
|
|
1719
1723
|
b as StoredFile,
|
|
1720
1724
|
re as StoredFileEvent,
|
|
@@ -1729,7 +1733,7 @@ export {
|
|
|
1729
1733
|
ne as persistentReferenceWithPersistentProps,
|
|
1730
1734
|
Z as registerCloudStorage,
|
|
1731
1735
|
ce as registerLegacyClassName,
|
|
1732
|
-
|
|
1736
|
+
H as registerPersistentClass,
|
|
1733
1737
|
_e as replaceValue,
|
|
1734
1738
|
he as required,
|
|
1735
1739
|
le as requiredWithValidator,
|