entropic-bond 1.53.6 → 1.53.8
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 +173 -155
- 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 +9 -9
- package/lib/store/json-data-source.d.ts +3 -3
- package/lib/store/model.d.ts +2 -1
- package/package.json +1 -1
package/lib/entropic-bond.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class N {
|
|
2
2
|
constructor() {
|
|
3
3
|
this.subscribers = /* @__PURE__ */ new Set();
|
|
4
4
|
}
|
|
@@ -44,40 +44,40 @@ class I {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
var f = [];
|
|
47
|
-
for (var
|
|
48
|
-
f.push((
|
|
49
|
-
function
|
|
47
|
+
for (var A = 0; A < 256; ++A)
|
|
48
|
+
f.push((A + 256).toString(16).slice(1));
|
|
49
|
+
function Y(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
|
-
var
|
|
53
|
-
function
|
|
54
|
-
if (!
|
|
52
|
+
var E, z = new Uint8Array(16);
|
|
53
|
+
function H() {
|
|
54
|
+
if (!E && (E = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !E))
|
|
55
55
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
56
|
-
return
|
|
56
|
+
return E(z);
|
|
57
57
|
}
|
|
58
|
-
var
|
|
59
|
-
const
|
|
60
|
-
randomUUID:
|
|
58
|
+
var J = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
59
|
+
const k = {
|
|
60
|
+
randomUUID: J
|
|
61
61
|
};
|
|
62
|
-
function
|
|
63
|
-
if (
|
|
64
|
-
return
|
|
62
|
+
function Z(i, e, t) {
|
|
63
|
+
if (k.randomUUID && !e && !i)
|
|
64
|
+
return k.randomUUID();
|
|
65
65
|
i = i || {};
|
|
66
|
-
var r = i.random || (i.rng ||
|
|
66
|
+
var r = i.random || (i.rng || H)();
|
|
67
67
|
if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, e) {
|
|
68
68
|
t = t || 0;
|
|
69
69
|
for (var s = 0; s < 16; ++s)
|
|
70
70
|
e[t + s] = r[s];
|
|
71
71
|
return e;
|
|
72
72
|
}
|
|
73
|
-
return
|
|
73
|
+
return Y(r);
|
|
74
74
|
}
|
|
75
|
-
var
|
|
76
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
75
|
+
var G = Object.defineProperty, K = Object.getOwnPropertyDescriptor, X = (i, e, t, r) => {
|
|
76
|
+
for (var s = r > 1 ? void 0 : r ? K(e, t) : e, n = i.length - 1, o; n >= 0; n--)
|
|
77
77
|
(o = i[n]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
78
|
-
return r && s &&
|
|
78
|
+
return r && s && G(e, t, s), s;
|
|
79
79
|
}, d;
|
|
80
|
-
const
|
|
80
|
+
const W = (d = class {
|
|
81
81
|
/**
|
|
82
82
|
* Registers a class to be used by the persistence engine.
|
|
83
83
|
* @param className the name of the class to be registered
|
|
@@ -139,7 +139,7 @@ const T = (d = class {
|
|
|
139
139
|
* Returns a new instance of Persistent class.
|
|
140
140
|
* @param className the initial id of this instance. If not provided, a new id will be generated
|
|
141
141
|
*/
|
|
142
|
-
constructor(e =
|
|
142
|
+
constructor(e = Z()) {
|
|
143
143
|
this._id = e;
|
|
144
144
|
}
|
|
145
145
|
/**
|
|
@@ -386,14 +386,14 @@ const T = (d = class {
|
|
|
386
386
|
}, {});
|
|
387
387
|
}
|
|
388
388
|
}, d._factoryMap = {}, d);
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
],
|
|
392
|
-
let l =
|
|
393
|
-
function
|
|
389
|
+
X([
|
|
390
|
+
j
|
|
391
|
+
], W.prototype, "_id", 2);
|
|
392
|
+
let l = W;
|
|
393
|
+
function j(i, e) {
|
|
394
394
|
return y()(i, e);
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function ue(i) {
|
|
397
397
|
return function(e, t) {
|
|
398
398
|
return y({
|
|
399
399
|
storeInCollection: i,
|
|
@@ -401,10 +401,10 @@ function ae(i) {
|
|
|
401
401
|
})(e, t);
|
|
402
402
|
};
|
|
403
403
|
}
|
|
404
|
-
function
|
|
404
|
+
function he(i, e) {
|
|
405
405
|
return y({ isReference: !0 })(i, e);
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function le(i, e, t) {
|
|
408
408
|
const r = Array.isArray(i) ? { cachedProps: i } : i;
|
|
409
409
|
return function(s, n) {
|
|
410
410
|
return y({
|
|
@@ -415,10 +415,10 @@ function ue(i, e, t) {
|
|
|
415
415
|
})(s, n);
|
|
416
416
|
};
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function de(i, e, t) {
|
|
419
419
|
return y({ isReference: !0, isPureReference: !0, storeInCollection: t })(i, e);
|
|
420
420
|
}
|
|
421
|
-
function
|
|
421
|
+
function fe(i, e, t) {
|
|
422
422
|
return function(r, s) {
|
|
423
423
|
const n = Array.isArray(i) ? { cachedProps: i } : i;
|
|
424
424
|
return y({
|
|
@@ -440,30 +440,30 @@ function y(i) {
|
|
|
440
440
|
});
|
|
441
441
|
};
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function ee(i, e) {
|
|
444
444
|
return (t) => {
|
|
445
445
|
l.registerFactory(i, t, e), t.prototype.__className = i;
|
|
446
446
|
};
|
|
447
447
|
}
|
|
448
|
-
function
|
|
448
|
+
function pe(i) {
|
|
449
449
|
return (e) => {
|
|
450
450
|
l.registerFactory(i, e);
|
|
451
451
|
};
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function me(i, e) {
|
|
454
454
|
return y({ searchableArray: !0 })(i, e);
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function ge(i, e) {
|
|
457
457
|
return y({ validator: (t) => t != null })(i, e);
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function _e(i = (e) => e != null) {
|
|
460
460
|
return function(e, t) {
|
|
461
461
|
return y({ validator: i })(e, t);
|
|
462
462
|
};
|
|
463
463
|
}
|
|
464
|
-
class
|
|
464
|
+
class ye extends l {
|
|
465
465
|
constructor() {
|
|
466
|
-
super(...arguments), this._onChange = new
|
|
466
|
+
super(...arguments), this._onChange = new N();
|
|
467
467
|
}
|
|
468
468
|
/**
|
|
469
469
|
* Subscribes a listener callback function. Every time a property is changed,
|
|
@@ -546,11 +546,11 @@ class ge extends l {
|
|
|
546
546
|
return this.notify({ [e]: this[e] }), t;
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
|
-
const
|
|
549
|
+
const U = class U {
|
|
550
550
|
constructor(e, t, r) {
|
|
551
551
|
if (r) {
|
|
552
552
|
if (!(t instanceof l))
|
|
553
|
-
throw new Error(
|
|
553
|
+
throw new Error(U.error.persistentNeedForSubCollection);
|
|
554
554
|
this.collectionName = `${t.className}/${t.id}/${r}`;
|
|
555
555
|
} else
|
|
556
556
|
this.collectionName = t instanceof l ? t.className : t;
|
|
@@ -599,7 +599,7 @@ const E = class E {
|
|
|
599
599
|
* @returns a Query object
|
|
600
600
|
*/
|
|
601
601
|
find() {
|
|
602
|
-
return new
|
|
602
|
+
return new te(this);
|
|
603
603
|
}
|
|
604
604
|
/**
|
|
605
605
|
* Define the search conditions. You pass query operations and how the query
|
|
@@ -636,11 +636,26 @@ const E = class E {
|
|
|
636
636
|
next(e) {
|
|
637
637
|
return this.mapToInstance(() => this._stream.next(e));
|
|
638
638
|
}
|
|
639
|
-
onDocumentChange(e, t
|
|
640
|
-
return this._stream.onDocumentChange(
|
|
639
|
+
onDocumentChange(e, t) {
|
|
640
|
+
return this._stream.onDocumentChange(
|
|
641
|
+
this.collectionName,
|
|
642
|
+
e,
|
|
643
|
+
(r) => t(this.toPersistentChangeObject(r))
|
|
644
|
+
);
|
|
641
645
|
}
|
|
642
646
|
onCollectionChange(e, t) {
|
|
643
|
-
return this._stream.onCollectionChange(
|
|
647
|
+
return this._stream.onCollectionChange(
|
|
648
|
+
e.getQueryObject(),
|
|
649
|
+
this.collectionName,
|
|
650
|
+
(r) => t(this.toPersistentChangeObject(r))
|
|
651
|
+
);
|
|
652
|
+
}
|
|
653
|
+
toPersistentChangeObject(e) {
|
|
654
|
+
return {
|
|
655
|
+
...e,
|
|
656
|
+
before: e.before && l.createInstance(e.before),
|
|
657
|
+
after: e.after && l.createInstance(e.after)
|
|
658
|
+
};
|
|
644
659
|
}
|
|
645
660
|
// /**
|
|
646
661
|
// * Get the previous bunch of documents matching the last query
|
|
@@ -672,7 +687,7 @@ const E = class E {
|
|
|
672
687
|
return e;
|
|
673
688
|
const t = ((r = e.operations) == null ? void 0 : r.map((s) => {
|
|
674
689
|
const n = s.value[0] ?? s.value;
|
|
675
|
-
return
|
|
690
|
+
return O.isArrayOperator(s.operator) && n instanceof l ? {
|
|
676
691
|
property: l.searchableArrayNameFor(s.property),
|
|
677
692
|
operator: s.operator,
|
|
678
693
|
value: Array.isArray(s.value) ? s.value.map((o) => o.id) : n.id,
|
|
@@ -690,12 +705,12 @@ const E = class E {
|
|
|
690
705
|
};
|
|
691
706
|
}
|
|
692
707
|
};
|
|
693
|
-
|
|
708
|
+
U.error = {
|
|
694
709
|
persistentNeedForSubCollection: "The document parameter for a sub-collection should be a Persistent instace",
|
|
695
710
|
invalidQueryOrder: "Cannot add where calls after or calls"
|
|
696
711
|
};
|
|
697
|
-
let D =
|
|
698
|
-
class
|
|
712
|
+
let D = U;
|
|
713
|
+
class te {
|
|
699
714
|
constructor(e) {
|
|
700
715
|
this.queryObject = { operations: [] }, this.model = e;
|
|
701
716
|
}
|
|
@@ -759,8 +774,8 @@ class X {
|
|
|
759
774
|
throw new Error(D.error.invalidQueryOrder);
|
|
760
775
|
const n = e.split(".");
|
|
761
776
|
let o = {}, c = n.length > 1 ? o : r;
|
|
762
|
-
return n.slice(1).forEach((g,
|
|
763
|
-
o[g] =
|
|
777
|
+
return n.slice(1).forEach((g, v) => {
|
|
778
|
+
o[g] = v < n.length - 2 ? {} : r, o = o[g];
|
|
764
779
|
}), (u = this.queryObject.operations) == null || u.push({
|
|
765
780
|
property: n[0],
|
|
766
781
|
operator: t,
|
|
@@ -921,7 +936,7 @@ class X {
|
|
|
921
936
|
return this.queryObject;
|
|
922
937
|
}
|
|
923
938
|
}
|
|
924
|
-
const
|
|
939
|
+
const P = class P {
|
|
925
940
|
constructor() {
|
|
926
941
|
}
|
|
927
942
|
/**
|
|
@@ -937,7 +952,7 @@ const v = class v {
|
|
|
937
952
|
* @returns the data source
|
|
938
953
|
*/
|
|
939
954
|
static get dataSource() {
|
|
940
|
-
return
|
|
955
|
+
return P._dataSource;
|
|
941
956
|
}
|
|
942
957
|
/**
|
|
943
958
|
* Retrieves a model for a collection
|
|
@@ -945,9 +960,9 @@ const v = class v {
|
|
|
945
960
|
* @returns the model for the collection
|
|
946
961
|
*/
|
|
947
962
|
static getModel(e) {
|
|
948
|
-
if (!
|
|
963
|
+
if (!P._dataSource)
|
|
949
964
|
throw new Error(this.error.shouldBeRegistered);
|
|
950
|
-
return new D(
|
|
965
|
+
return new D(P._dataSource, e);
|
|
951
966
|
}
|
|
952
967
|
/**
|
|
953
968
|
* Retrieves a model for a subcollection
|
|
@@ -956,9 +971,9 @@ const v = class v {
|
|
|
956
971
|
* @returns the model for the subcollection
|
|
957
972
|
*/
|
|
958
973
|
static getModelForSubCollection(e, t) {
|
|
959
|
-
if (!
|
|
974
|
+
if (!P._dataSource)
|
|
960
975
|
throw new Error(this.error.shouldBeRegistered);
|
|
961
|
-
return new D(
|
|
976
|
+
return new D(P._dataSource, e, t);
|
|
962
977
|
}
|
|
963
978
|
/**
|
|
964
979
|
* Populates property references with actual data from the store.
|
|
@@ -992,11 +1007,11 @@ const v = class v {
|
|
|
992
1007
|
) : e.__documentReference === void 0;
|
|
993
1008
|
}
|
|
994
1009
|
};
|
|
995
|
-
|
|
996
|
-
let
|
|
997
|
-
class
|
|
1010
|
+
P.error = { shouldBeRegistered: "You should register a data source before using the data Store." };
|
|
1011
|
+
let I = P;
|
|
1012
|
+
class O {
|
|
998
1013
|
installCachedPropsUpdaters(e = {}) {
|
|
999
|
-
|
|
1014
|
+
O.onUpdate = e.onUpdate;
|
|
1000
1015
|
const t = l.getSystemRegisteredReferencesWithCachedProps(), r = {};
|
|
1001
1016
|
Object.entries(t).forEach(([n, o]) => {
|
|
1002
1017
|
o.forEach((c) => {
|
|
@@ -1009,7 +1024,7 @@ class C {
|
|
|
1009
1024
|
});
|
|
1010
1025
|
const s = [];
|
|
1011
1026
|
return Object.entries(r).forEach(([n, o]) => {
|
|
1012
|
-
const c = this.subscribeToDocumentChangeListerner(n, (h) =>
|
|
1027
|
+
const c = this.subscribeToDocumentChangeListerner(n, (h) => O.onDocumentChange(h, o));
|
|
1013
1028
|
if (c)
|
|
1014
1029
|
s.push(c);
|
|
1015
1030
|
else if (e.noThrowOnNonImplementedListener)
|
|
@@ -1042,7 +1057,7 @@ class C {
|
|
|
1042
1057
|
*/
|
|
1043
1058
|
static toPropertyPathOperations(e) {
|
|
1044
1059
|
return e ? e.map((t) => {
|
|
1045
|
-
if (
|
|
1060
|
+
if (O.isArrayOperator(t.operator) && t.value[0] instanceof l)
|
|
1046
1061
|
return {
|
|
1047
1062
|
property: l.searchableArrayNameFor(t.property),
|
|
1048
1063
|
operator: t.operator,
|
|
@@ -1072,27 +1087,28 @@ class C {
|
|
|
1072
1087
|
if (e.before)
|
|
1073
1088
|
return t.map(async (r) => {
|
|
1074
1089
|
var c, h;
|
|
1075
|
-
const s =
|
|
1090
|
+
const s = I.getModel(r.collectionPropOwner);
|
|
1076
1091
|
let n = s.find();
|
|
1077
1092
|
(h = (c = r.prop.cachedPropsConfig) == null ? void 0 : c.cachedProps) == null || h.forEach((a) => {
|
|
1078
|
-
|
|
1093
|
+
var v, R;
|
|
1094
|
+
const u = (v = e.before) == null ? void 0 : v[a], g = (R = e.after) == null ? void 0 : R[a];
|
|
1079
1095
|
u !== g && (n = n.orDeepProp(`${r.prop.name}.${a}`, "==", u));
|
|
1080
1096
|
});
|
|
1081
1097
|
const o = await n.get();
|
|
1082
1098
|
return Promise.all([
|
|
1083
1099
|
o.map(async (a) => {
|
|
1084
1100
|
var u, g;
|
|
1085
|
-
(g = (u = r.prop.cachedPropsConfig) == null ? void 0 : u.cachedProps) == null || g.forEach(async (
|
|
1086
|
-
var
|
|
1087
|
-
const
|
|
1088
|
-
|
|
1101
|
+
(g = (u = r.prop.cachedPropsConfig) == null ? void 0 : u.cachedProps) == null || g.forEach(async (v) => {
|
|
1102
|
+
var M, V, L;
|
|
1103
|
+
const R = (M = e.before) == null ? void 0 : M[v], $ = (V = e.after) == null ? void 0 : V[v];
|
|
1104
|
+
R !== $ && (a[`_${r.prop.name}`][`_${v}`] = $, await s.save(a), (L = this.onUpdate) == null || L.call(this, a, r.prop));
|
|
1089
1105
|
});
|
|
1090
1106
|
})
|
|
1091
1107
|
]);
|
|
1092
1108
|
});
|
|
1093
1109
|
}
|
|
1094
1110
|
}
|
|
1095
|
-
class
|
|
1111
|
+
class ve extends O {
|
|
1096
1112
|
/**
|
|
1097
1113
|
* @param jsonRawData the JSON object to be used as data store
|
|
1098
1114
|
*/
|
|
@@ -1128,7 +1144,7 @@ class _e extends C {
|
|
|
1128
1144
|
return Object.entries(e).forEach(([r, s]) => {
|
|
1129
1145
|
this._jsonRawData[r] || (this._jsonRawData[r] = {}), s == null || s.forEach((n) => {
|
|
1130
1146
|
const o = this._jsonRawData[r][n.id];
|
|
1131
|
-
this._jsonRawData[r][n.id] = n, o && this.notifyChange(r,
|
|
1147
|
+
this._jsonRawData[r][n.id] = n, o && this.notifyChange(r, n, o);
|
|
1132
1148
|
});
|
|
1133
1149
|
}), this.resolveWithDelay();
|
|
1134
1150
|
}
|
|
@@ -1158,12 +1174,14 @@ class _e extends C {
|
|
|
1158
1174
|
}
|
|
1159
1175
|
onCollectionChange(e, t, r) {
|
|
1160
1176
|
return this._collectionListeners[t] = (s) => {
|
|
1161
|
-
|
|
1177
|
+
if (!s.after)
|
|
1178
|
+
return;
|
|
1179
|
+
this.retrieveQueryDocs([s.after], e.operations).length > 0 && r(s);
|
|
1162
1180
|
}, () => delete this._serverCollectionListeners[t];
|
|
1163
1181
|
}
|
|
1164
1182
|
onDocumentChange(e, t, r) {
|
|
1165
1183
|
return this._documentListeners[e] = (s) => {
|
|
1166
|
-
s.after.id === t && r(s);
|
|
1184
|
+
s.after && s.after.id === t && r(s);
|
|
1167
1185
|
}, () => delete this._serverCollectionListeners[e];
|
|
1168
1186
|
}
|
|
1169
1187
|
/**
|
|
@@ -1266,12 +1284,12 @@ class _e extends C {
|
|
|
1266
1284
|
), t;
|
|
1267
1285
|
}
|
|
1268
1286
|
}
|
|
1269
|
-
const
|
|
1287
|
+
const b = class b {
|
|
1270
1288
|
static registerCloudStorage(e, t) {
|
|
1271
|
-
|
|
1289
|
+
b._cloudStorageFactoryMap[e] = t;
|
|
1272
1290
|
}
|
|
1273
1291
|
static createInstance(e) {
|
|
1274
|
-
const t =
|
|
1292
|
+
const t = b._cloudStorageFactoryMap[e];
|
|
1275
1293
|
if (!t)
|
|
1276
1294
|
throw new Error(`You should register the ${e} cloud storage provider prior to use it`);
|
|
1277
1295
|
return t();
|
|
@@ -1280,27 +1298,27 @@ const P = class P {
|
|
|
1280
1298
|
return this.__className;
|
|
1281
1299
|
}
|
|
1282
1300
|
static useCloudStorage(e) {
|
|
1283
|
-
|
|
1301
|
+
b._defaultCloudStorage = e;
|
|
1284
1302
|
}
|
|
1285
1303
|
static get defaultCloudStorage() {
|
|
1286
|
-
if (!
|
|
1304
|
+
if (!b._defaultCloudStorage)
|
|
1287
1305
|
throw new Error("You should define a default cloud storage provider prior to use it");
|
|
1288
|
-
return
|
|
1306
|
+
return b._defaultCloudStorage;
|
|
1289
1307
|
}
|
|
1290
1308
|
};
|
|
1291
|
-
|
|
1292
|
-
let w =
|
|
1293
|
-
function
|
|
1309
|
+
b._cloudStorageFactoryMap = {};
|
|
1310
|
+
let w = b;
|
|
1311
|
+
function re(i, e) {
|
|
1294
1312
|
return w.registerCloudStorage(i, e), (t) => {
|
|
1295
1313
|
t.prototype.__className = i;
|
|
1296
1314
|
};
|
|
1297
1315
|
}
|
|
1298
|
-
var
|
|
1299
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
1316
|
+
var se = Object.defineProperty, ie = Object.getOwnPropertyDescriptor, ne = (i, e, t, r) => {
|
|
1317
|
+
for (var s = r > 1 ? void 0 : r ? ie(e, t) : e, n = i.length - 1, o; n >= 0; n--)
|
|
1300
1318
|
(o = i[n]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
1301
|
-
return r && s &&
|
|
1319
|
+
return r && s && se(e, t, s), s;
|
|
1302
1320
|
};
|
|
1303
|
-
let
|
|
1321
|
+
let F = class extends w {
|
|
1304
1322
|
constructor(i = "") {
|
|
1305
1323
|
super(), this._simulateDelay = 0, this._pendingPromises = [], this.mockFileSystem = {}, this._pathToMockFiles = i;
|
|
1306
1324
|
}
|
|
@@ -1349,17 +1367,17 @@ let A = class extends w {
|
|
|
1349
1367
|
return delete this.mockFileSystem[i], this.resolveWithDelay();
|
|
1350
1368
|
}
|
|
1351
1369
|
};
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
],
|
|
1355
|
-
var
|
|
1356
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
1370
|
+
F = ne([
|
|
1371
|
+
re("MockCloudStorage", () => new F())
|
|
1372
|
+
], F);
|
|
1373
|
+
var oe = Object.defineProperty, ae = Object.getOwnPropertyDescriptor, S = (i, e, t, r) => {
|
|
1374
|
+
for (var s = r > 1 ? void 0 : r ? ae(e, t) : e, n = i.length - 1, o; n >= 0; n--)
|
|
1357
1375
|
(o = i[n]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
1358
|
-
return r && s &&
|
|
1359
|
-
},
|
|
1360
|
-
let
|
|
1376
|
+
return r && s && oe(e, t, s), s;
|
|
1377
|
+
}, ce = /* @__PURE__ */ ((i) => (i[i.stored = 0] = "stored", i[i.pendingDataSet = 1] = "pendingDataSet", i[i.deleted = 2] = "deleted", i))(ce || {});
|
|
1378
|
+
let C = class extends l {
|
|
1361
1379
|
constructor() {
|
|
1362
|
-
super(...arguments), this._onChange = new
|
|
1380
|
+
super(...arguments), this._onChange = new N();
|
|
1363
1381
|
}
|
|
1364
1382
|
async save({ data: i, fileName: e, progress: t, cloudStorageProvider: r } = {}) {
|
|
1365
1383
|
const s = i || this._pendingData;
|
|
@@ -1406,28 +1424,28 @@ let b = class extends l {
|
|
|
1406
1424
|
}
|
|
1407
1425
|
};
|
|
1408
1426
|
S([
|
|
1409
|
-
|
|
1410
|
-
],
|
|
1427
|
+
j
|
|
1428
|
+
], C.prototype, "_reference", 2);
|
|
1411
1429
|
S([
|
|
1412
|
-
|
|
1413
|
-
],
|
|
1430
|
+
j
|
|
1431
|
+
], C.prototype, "_url", 2);
|
|
1414
1432
|
S([
|
|
1415
|
-
|
|
1416
|
-
],
|
|
1433
|
+
j
|
|
1434
|
+
], C.prototype, "_cloudStorageProviderName", 2);
|
|
1417
1435
|
S([
|
|
1418
|
-
|
|
1419
|
-
],
|
|
1436
|
+
j
|
|
1437
|
+
], C.prototype, "_originalFileName", 2);
|
|
1420
1438
|
S([
|
|
1421
|
-
|
|
1422
|
-
],
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
],
|
|
1426
|
-
class
|
|
1439
|
+
j
|
|
1440
|
+
], C.prototype, "_mimeType", 2);
|
|
1441
|
+
C = S([
|
|
1442
|
+
ee("StoredFile")
|
|
1443
|
+
], C);
|
|
1444
|
+
class Q {
|
|
1427
1445
|
}
|
|
1428
|
-
const p = class p extends
|
|
1446
|
+
const p = class p extends Q {
|
|
1429
1447
|
constructor() {
|
|
1430
|
-
if (super(), this._onAuthStateChange = new
|
|
1448
|
+
if (super(), this._onAuthStateChange = new N(), !p._authService)
|
|
1431
1449
|
throw new Error(p.error.shouldBeRegistered);
|
|
1432
1450
|
p._authService.onAuthStateChange(
|
|
1433
1451
|
(e) => this.authStateChanged(e)
|
|
@@ -1552,8 +1570,8 @@ const p = class p extends x {
|
|
|
1552
1570
|
}
|
|
1553
1571
|
};
|
|
1554
1572
|
p.error = { shouldBeRegistered: "You should register an auth service before using Auth." }, p._instance = void 0;
|
|
1555
|
-
let
|
|
1556
|
-
class
|
|
1573
|
+
let T = p;
|
|
1574
|
+
class Pe extends Q {
|
|
1557
1575
|
constructor() {
|
|
1558
1576
|
super(...arguments), this.pendingPromises = [], this._fakeRegisteredUsers = {};
|
|
1559
1577
|
}
|
|
@@ -1658,8 +1676,8 @@ const _ = class _ {
|
|
|
1658
1676
|
}
|
|
1659
1677
|
};
|
|
1660
1678
|
_.error = { shouldBeRegistered: "You should register a cloud functions service with useCloudFunctionsService static method before using CloudFunctions." };
|
|
1661
|
-
let
|
|
1662
|
-
class
|
|
1679
|
+
let x = _;
|
|
1680
|
+
class be {
|
|
1663
1681
|
constructor(e) {
|
|
1664
1682
|
this._registeredFunctions = e;
|
|
1665
1683
|
}
|
|
@@ -1673,9 +1691,9 @@ class ve {
|
|
|
1673
1691
|
return e(t);
|
|
1674
1692
|
}
|
|
1675
1693
|
}
|
|
1676
|
-
class
|
|
1694
|
+
class q {
|
|
1677
1695
|
}
|
|
1678
|
-
const m = class m extends
|
|
1696
|
+
const m = class m extends q {
|
|
1679
1697
|
constructor() {
|
|
1680
1698
|
super();
|
|
1681
1699
|
}
|
|
@@ -1701,8 +1719,8 @@ const m = class m extends B {
|
|
|
1701
1719
|
}
|
|
1702
1720
|
};
|
|
1703
1721
|
m.error = { shouldBeRegistered: "You should register a Server Auth service before using the Server Auth." }, m._instance = void 0;
|
|
1704
|
-
let
|
|
1705
|
-
class
|
|
1722
|
+
let B = m;
|
|
1723
|
+
class we extends q {
|
|
1706
1724
|
constructor(e) {
|
|
1707
1725
|
super(), this._userCredentials = e;
|
|
1708
1726
|
}
|
|
@@ -1729,63 +1747,63 @@ class Pe extends B {
|
|
|
1729
1747
|
return this._userCredentials;
|
|
1730
1748
|
}
|
|
1731
1749
|
}
|
|
1732
|
-
function
|
|
1750
|
+
function Ce(i, e) {
|
|
1733
1751
|
return i ? i.replace(/\${\s*(\w*)\s*}/g, function(t, r) {
|
|
1734
1752
|
return e[r] || "";
|
|
1735
1753
|
}) : "";
|
|
1736
1754
|
}
|
|
1737
|
-
function
|
|
1755
|
+
function Oe(i) {
|
|
1738
1756
|
return i ? i.replace(
|
|
1739
1757
|
/([-_ ][\w])/g,
|
|
1740
1758
|
(e) => e.toUpperCase().replace("-", "").replace("_", "").replace(" ", "")
|
|
1741
1759
|
) : "";
|
|
1742
1760
|
}
|
|
1743
|
-
function
|
|
1761
|
+
function De(i, e = "-") {
|
|
1744
1762
|
if (!i)
|
|
1745
1763
|
return "";
|
|
1746
1764
|
const t = i.slice(1).replace(/( |[A-Z])/g, (r) => r === " " ? "-" : e + r[0].toLowerCase());
|
|
1747
1765
|
return i[0].toLocaleLowerCase() + t.replace(/--/g, "-");
|
|
1748
1766
|
}
|
|
1749
|
-
function
|
|
1767
|
+
function je(i, e) {
|
|
1750
1768
|
return e.split(".").reduce((t, r) => t[r], i);
|
|
1751
1769
|
}
|
|
1752
1770
|
export {
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1771
|
+
T as Auth,
|
|
1772
|
+
Pe as AuthMock,
|
|
1773
|
+
Q as AuthService,
|
|
1774
|
+
x as CloudFunctions,
|
|
1775
|
+
be as CloudFunctionsMock,
|
|
1758
1776
|
w as CloudStorage,
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1777
|
+
O as DataSource,
|
|
1778
|
+
ye as EntropicComponent,
|
|
1779
|
+
ve as JsonDataSource,
|
|
1780
|
+
F as MockCloudStorage,
|
|
1763
1781
|
D as Model,
|
|
1764
|
-
|
|
1782
|
+
N as Observable,
|
|
1765
1783
|
l as Persistent,
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1784
|
+
te as Query,
|
|
1785
|
+
B as ServerAuth,
|
|
1786
|
+
we as ServerAuthMock,
|
|
1787
|
+
q as ServerAuthService,
|
|
1788
|
+
I as Store,
|
|
1789
|
+
C as StoredFile,
|
|
1790
|
+
ce as StoredFileEvent,
|
|
1791
|
+
Oe as camelCase,
|
|
1792
|
+
je as getDeepValue,
|
|
1793
|
+
j as persistent,
|
|
1776
1794
|
y as persistentParser,
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1795
|
+
de as persistentPureReference,
|
|
1796
|
+
fe as persistentPureReferenceWithCachedProps,
|
|
1797
|
+
he as persistentReference,
|
|
1798
|
+
ue as persistentReferenceAt,
|
|
1799
|
+
le as persistentReferenceWithCachedProps,
|
|
1800
|
+
re as registerCloudStorage,
|
|
1801
|
+
pe as registerLegacyClassName,
|
|
1802
|
+
ee as registerPersistentClass,
|
|
1803
|
+
Ce as replaceValue,
|
|
1804
|
+
ge as required,
|
|
1805
|
+
_e as requiredWithValidator,
|
|
1806
|
+
me as searchableArray,
|
|
1807
|
+
De as snakeCase
|
|
1790
1808
|
};
|
|
1791
1809
|
//# sourceMappingURL=entropic-bond.js.map
|