entropic-bond 1.51.8 → 1.51.9
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
|
@@ -43,12 +43,12 @@ class F {
|
|
|
43
43
|
return this.subscribers.size;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
let
|
|
46
|
+
let j;
|
|
47
47
|
const B = new Uint8Array(16);
|
|
48
48
|
function L() {
|
|
49
|
-
if (!
|
|
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
|
|
51
|
+
return j(B);
|
|
52
52
|
}
|
|
53
53
|
const f = [];
|
|
54
54
|
for (let i = 0; i < 256; ++i)
|
|
@@ -380,10 +380,10 @@ const M = (d = class {
|
|
|
380
380
|
}
|
|
381
381
|
}, d._factoryMap = {}, d);
|
|
382
382
|
H([
|
|
383
|
-
|
|
383
|
+
R
|
|
384
384
|
], M.prototype, "_id", 2);
|
|
385
385
|
let l = M;
|
|
386
|
-
function
|
|
386
|
+
function R(i, e) {
|
|
387
387
|
return _()(i, e);
|
|
388
388
|
}
|
|
389
389
|
function ie(i) {
|
|
@@ -535,11 +535,11 @@ class fe extends l {
|
|
|
535
535
|
return this.notify({ [e]: this[e] }), t;
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
|
-
const
|
|
538
|
+
const E = class E {
|
|
539
539
|
constructor(e, t, r) {
|
|
540
540
|
if (r) {
|
|
541
541
|
if (!(t instanceof l))
|
|
542
|
-
throw new Error(
|
|
542
|
+
throw new Error(E.error.persistentNeedForSubCollection);
|
|
543
543
|
this.collectionName = `${t.className}/${t.id}/${r}`;
|
|
544
544
|
} else
|
|
545
545
|
this.collectionName = t instanceof l ? t.className : t;
|
|
@@ -655,7 +655,7 @@ const j = class j {
|
|
|
655
655
|
return e;
|
|
656
656
|
const t = ((r = e.operations) == null ? void 0 : r.map((s) => {
|
|
657
657
|
const n = s.value[0] ?? s.value;
|
|
658
|
-
return
|
|
658
|
+
return C.isArrayOperator(s.operator) && n instanceof l ? {
|
|
659
659
|
property: l.searchableArrayNameFor(s.property),
|
|
660
660
|
operator: s.operator,
|
|
661
661
|
value: Array.isArray(s.value) ? s.value.map((o) => o.id) : n.id,
|
|
@@ -673,11 +673,11 @@ const j = class j {
|
|
|
673
673
|
};
|
|
674
674
|
}
|
|
675
675
|
};
|
|
676
|
-
|
|
676
|
+
E.error = {
|
|
677
677
|
persistentNeedForSubCollection: "The document parameter for a sub-collection should be a Persistent instace",
|
|
678
678
|
invalidQueryOrder: "Cannot add where calls after or calls"
|
|
679
679
|
};
|
|
680
|
-
let
|
|
680
|
+
let S = E;
|
|
681
681
|
class Z {
|
|
682
682
|
constructor(e) {
|
|
683
683
|
this.queryObject = { operations: [] }, this.model = e;
|
|
@@ -704,7 +704,7 @@ class Z {
|
|
|
704
704
|
where(e, t, r, s) {
|
|
705
705
|
var n, o, c;
|
|
706
706
|
if ((o = (n = this.queryObject.operations) == null ? void 0 : n.at(-1)) != null && o.aggregate && !s)
|
|
707
|
-
throw new Error(
|
|
707
|
+
throw new Error(S.error.invalidQueryOrder);
|
|
708
708
|
return (c = this.queryObject.operations) == null || c.push({
|
|
709
709
|
property: e,
|
|
710
710
|
operator: t,
|
|
@@ -739,11 +739,11 @@ class Z {
|
|
|
739
739
|
whereDeepProp(e, t, r, s) {
|
|
740
740
|
var h, a, u;
|
|
741
741
|
if ((a = (h = this.queryObject.operations) == null ? void 0 : h.at(-1)) != null && a.aggregate && !s)
|
|
742
|
-
throw new Error(
|
|
742
|
+
throw new Error(S.error.invalidQueryOrder);
|
|
743
743
|
const n = e.split(".");
|
|
744
744
|
let o = {}, c = n.length > 1 ? o : r;
|
|
745
|
-
return n.slice(1).forEach((b,
|
|
746
|
-
o[b] =
|
|
745
|
+
return n.slice(1).forEach((b, O) => {
|
|
746
|
+
o[b] = O < n.length - 2 ? {} : r, o = o[b];
|
|
747
747
|
}), (u = this.queryObject.operations) == null || u.push({
|
|
748
748
|
property: n[0],
|
|
749
749
|
operator: t,
|
|
@@ -927,7 +927,7 @@ const y = class y {
|
|
|
927
927
|
static getModel(e) {
|
|
928
928
|
if (!y._dataSource)
|
|
929
929
|
throw new Error(this.error.shouldBeRegistered);
|
|
930
|
-
return new
|
|
930
|
+
return new S(y._dataSource, e);
|
|
931
931
|
}
|
|
932
932
|
/**
|
|
933
933
|
* Retrieves a model for a subcollection
|
|
@@ -938,7 +938,7 @@ const y = class y {
|
|
|
938
938
|
static getModelForSubCollection(e, t) {
|
|
939
939
|
if (!y._dataSource)
|
|
940
940
|
throw new Error(this.error.shouldBeRegistered);
|
|
941
|
-
return new
|
|
941
|
+
return new S(y._dataSource, e, t);
|
|
942
942
|
}
|
|
943
943
|
/**
|
|
944
944
|
* Populates property references with actual data from the store.
|
|
@@ -974,9 +974,9 @@ const y = class y {
|
|
|
974
974
|
};
|
|
975
975
|
y.error = { shouldBeRegistered: "You should register a data source before using the data Store." };
|
|
976
976
|
let A = y;
|
|
977
|
-
class
|
|
977
|
+
class C {
|
|
978
978
|
installCachedPropsUpdaters(e = {}) {
|
|
979
|
-
|
|
979
|
+
C.onUpdate = e.onUpdate;
|
|
980
980
|
const t = l.getSystemRegisteredReferencesWithCachedProps(), r = {};
|
|
981
981
|
Object.entries(t).forEach(([n, o]) => {
|
|
982
982
|
o.forEach((c) => {
|
|
@@ -989,7 +989,7 @@ class E {
|
|
|
989
989
|
});
|
|
990
990
|
const s = [];
|
|
991
991
|
return Object.entries(r).forEach(([n, o]) => {
|
|
992
|
-
const c = this.subscribeToDocumentChangeListerner(n, (h) =>
|
|
992
|
+
const c = this.subscribeToDocumentChangeListerner(n, (h) => C.onDocumentChange(h, o));
|
|
993
993
|
if (c)
|
|
994
994
|
s.push(c);
|
|
995
995
|
else if (e.noThrowOnNonImplementedListener)
|
|
@@ -1022,7 +1022,7 @@ class E {
|
|
|
1022
1022
|
*/
|
|
1023
1023
|
static toPropertyPathOperations(e) {
|
|
1024
1024
|
return e ? e.map((t) => {
|
|
1025
|
-
if (
|
|
1025
|
+
if (C.isArrayOperator(t.operator) && t.value[0] instanceof l)
|
|
1026
1026
|
return {
|
|
1027
1027
|
property: l.searchableArrayNameFor(t.property),
|
|
1028
1028
|
operator: t.operator,
|
|
@@ -1048,7 +1048,7 @@ class E {
|
|
|
1048
1048
|
} else
|
|
1049
1049
|
return [void 0, e];
|
|
1050
1050
|
}
|
|
1051
|
-
async onDocumentChange(e, t) {
|
|
1051
|
+
static async onDocumentChange(e, t) {
|
|
1052
1052
|
if (e.before)
|
|
1053
1053
|
return t.map(async (r) => {
|
|
1054
1054
|
var c;
|
|
@@ -1064,15 +1064,15 @@ class E {
|
|
|
1064
1064
|
var a;
|
|
1065
1065
|
(a = r.prop.cachedProps) == null || a.forEach(async (u) => {
|
|
1066
1066
|
var I;
|
|
1067
|
-
const b = e.before[u],
|
|
1068
|
-
b !==
|
|
1067
|
+
const b = e.before[u], O = e.after[u];
|
|
1068
|
+
b !== O && (h[`_${r.prop.name}`][`_${u}`] = O, await s.save(h), (I = this.onUpdate) == null || I.call(this, h, r.prop));
|
|
1069
1069
|
});
|
|
1070
1070
|
})
|
|
1071
1071
|
]);
|
|
1072
1072
|
});
|
|
1073
1073
|
}
|
|
1074
1074
|
}
|
|
1075
|
-
class pe extends
|
|
1075
|
+
class pe extends C {
|
|
1076
1076
|
/**
|
|
1077
1077
|
* @param jsonRawData the JSON object to be used as data store
|
|
1078
1078
|
*/
|
|
@@ -1373,19 +1373,19 @@ let w = class extends l {
|
|
|
1373
1373
|
}
|
|
1374
1374
|
};
|
|
1375
1375
|
D([
|
|
1376
|
-
|
|
1376
|
+
R
|
|
1377
1377
|
], w.prototype, "_reference", 2);
|
|
1378
1378
|
D([
|
|
1379
|
-
|
|
1379
|
+
R
|
|
1380
1380
|
], w.prototype, "_url", 2);
|
|
1381
1381
|
D([
|
|
1382
|
-
|
|
1382
|
+
R
|
|
1383
1383
|
], w.prototype, "_cloudStorageProviderName", 2);
|
|
1384
1384
|
D([
|
|
1385
|
-
|
|
1385
|
+
R
|
|
1386
1386
|
], w.prototype, "_originalFileName", 2);
|
|
1387
1387
|
D([
|
|
1388
|
-
|
|
1388
|
+
R
|
|
1389
1389
|
], w.prototype, "_mimeType", 2);
|
|
1390
1390
|
w = D([
|
|
1391
1391
|
J("StoredFile")
|
|
@@ -1723,11 +1723,11 @@ export {
|
|
|
1723
1723
|
$ as CloudFunctions,
|
|
1724
1724
|
ge as CloudFunctionsMock,
|
|
1725
1725
|
v as CloudStorage,
|
|
1726
|
-
|
|
1726
|
+
C as DataSource,
|
|
1727
1727
|
fe as EntropicComponent,
|
|
1728
1728
|
pe as JsonDataSource,
|
|
1729
1729
|
U as MockCloudStorage,
|
|
1730
|
-
|
|
1730
|
+
S as Model,
|
|
1731
1731
|
F as Observable,
|
|
1732
1732
|
l as Persistent,
|
|
1733
1733
|
Z as Query,
|
|
@@ -1739,7 +1739,7 @@ export {
|
|
|
1739
1739
|
se as StoredFileEvent,
|
|
1740
1740
|
Pe as camelCase,
|
|
1741
1741
|
we as getDeepValue,
|
|
1742
|
-
|
|
1742
|
+
R as persistent,
|
|
1743
1743
|
_ as persistentParser,
|
|
1744
1744
|
ae as persistentPureReference,
|
|
1745
1745
|
ce as persistentPureReferenceWithCachedProps,
|