entropic-bond 1.53.19 → 1.53.21
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
|
@@ -49,26 +49,26 @@ for (let i = 0; i < 256; ++i)
|
|
|
49
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 D;
|
|
53
53
|
const T = new Uint8Array(16);
|
|
54
54
|
function x() {
|
|
55
|
-
if (!
|
|
55
|
+
if (!D) {
|
|
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
|
+
D = crypto.getRandomValues.bind(crypto);
|
|
59
59
|
}
|
|
60
|
-
return
|
|
60
|
+
return D(T);
|
|
61
61
|
}
|
|
62
62
|
const B = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), A = { randomUUID: B };
|
|
63
|
-
function
|
|
63
|
+
function Q(i, e, t) {
|
|
64
64
|
i = i || {};
|
|
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
68
|
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, M(r);
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
return A.randomUUID && !i ? A.randomUUID() :
|
|
70
|
+
function W(i, e, t) {
|
|
71
|
+
return A.randomUUID && !i ? A.randomUUID() : Q(i);
|
|
72
72
|
}
|
|
73
73
|
var q = Object.defineProperty, Y = (i, e, t, r) => {
|
|
74
74
|
for (var s = void 0, n = i.length - 1, o; n >= 0; n--)
|
|
@@ -143,7 +143,7 @@ const k = (l = class {
|
|
|
143
143
|
* Returns a new instance of Persistent class.
|
|
144
144
|
* @param className the initial id of this instance. If not provided, a new id will be generated
|
|
145
145
|
*/
|
|
146
|
-
constructor(e =
|
|
146
|
+
constructor(e = W()) {
|
|
147
147
|
this._id = e;
|
|
148
148
|
}
|
|
149
149
|
/**
|
|
@@ -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 R = class R {
|
|
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(R.error.persistentNeedForSubCollection);
|
|
544
544
|
this.collectionName = `${t.className}/${t.id}/${r}`;
|
|
545
545
|
} else
|
|
546
546
|
this.collectionName = t instanceof u ? t.className : t;
|
|
@@ -635,9 +635,14 @@ const D = class D {
|
|
|
635
635
|
}
|
|
636
636
|
onCollectionChange(e, t) {
|
|
637
637
|
return this._stream.onCollectionChange(
|
|
638
|
-
e.getQueryObject(),
|
|
638
|
+
this.preprocessQueryObject(e.getQueryObject()),
|
|
639
639
|
this.collectionName,
|
|
640
|
-
(r) => t(r.map((s) =>
|
|
640
|
+
(r) => t(r.map((s) => ({
|
|
641
|
+
after: s.after && u.createInstance(s.after),
|
|
642
|
+
before: s.before && u.createInstance(s.before),
|
|
643
|
+
type: s.type,
|
|
644
|
+
params: s.params
|
|
645
|
+
})))
|
|
641
646
|
);
|
|
642
647
|
}
|
|
643
648
|
toPersistentChangeObject(e) {
|
|
@@ -693,11 +698,11 @@ const D = class D {
|
|
|
693
698
|
};
|
|
694
699
|
}
|
|
695
700
|
};
|
|
696
|
-
|
|
701
|
+
R.error = {
|
|
697
702
|
persistentNeedForSubCollection: "The document parameter for a sub-collection should be a Persistent instace",
|
|
698
703
|
invalidQueryOrder: "Cannot add where calls after or calls"
|
|
699
704
|
};
|
|
700
|
-
let C =
|
|
705
|
+
let C = R;
|
|
701
706
|
class H {
|
|
702
707
|
constructor(e) {
|
|
703
708
|
this.queryObject = { operations: [] }, this.model = e;
|
|
@@ -1142,7 +1147,12 @@ class le extends w {
|
|
|
1142
1147
|
return this._collectionListeners[t] = (s) => {
|
|
1143
1148
|
if (!s.after) return;
|
|
1144
1149
|
const n = this.retrieveQueryDocs([s.after], e.operations);
|
|
1145
|
-
n.length > 0 && r(n)
|
|
1150
|
+
n.length > 0 && r(n.map((o) => ({
|
|
1151
|
+
before: void 0,
|
|
1152
|
+
after: o,
|
|
1153
|
+
type: s.type,
|
|
1154
|
+
params: s.params
|
|
1155
|
+
})));
|
|
1146
1156
|
}, () => delete this._serverCollectionListeners[t];
|
|
1147
1157
|
}
|
|
1148
1158
|
onDocumentChange(e, t, r) {
|
|
@@ -1333,7 +1343,7 @@ let j = class extends P {
|
|
|
1333
1343
|
j = G([
|
|
1334
1344
|
J("MockCloudStorage", () => new j())
|
|
1335
1345
|
], j);
|
|
1336
|
-
var K = Object.defineProperty, X = Object.getOwnPropertyDescriptor,
|
|
1346
|
+
var K = Object.defineProperty, X = Object.getOwnPropertyDescriptor, O = (i, e, t, r) => {
|
|
1337
1347
|
for (var s = r > 1 ? void 0 : r ? X(e, t) : e, n = i.length - 1, o; n >= 0; n--)
|
|
1338
1348
|
(o = i[n]) && (s = (r ? o(e, t, s) : o(s)) || s);
|
|
1339
1349
|
return r && s && K(e, t, s), s;
|
|
@@ -1385,22 +1395,22 @@ let b = class extends u {
|
|
|
1385
1395
|
return this._onChange.subscribe(i);
|
|
1386
1396
|
}
|
|
1387
1397
|
};
|
|
1388
|
-
|
|
1398
|
+
O([
|
|
1389
1399
|
S
|
|
1390
1400
|
], b.prototype, "_reference", 2);
|
|
1391
|
-
|
|
1401
|
+
O([
|
|
1392
1402
|
S
|
|
1393
1403
|
], b.prototype, "_url", 2);
|
|
1394
|
-
|
|
1404
|
+
O([
|
|
1395
1405
|
S
|
|
1396
1406
|
], b.prototype, "_cloudStorageProviderName", 2);
|
|
1397
|
-
|
|
1407
|
+
O([
|
|
1398
1408
|
S
|
|
1399
1409
|
], b.prototype, "_originalFileName", 2);
|
|
1400
|
-
|
|
1410
|
+
O([
|
|
1401
1411
|
S
|
|
1402
1412
|
], b.prototype, "_mimeType", 2);
|
|
1403
|
-
b =
|
|
1413
|
+
b = O([
|
|
1404
1414
|
z("StoredFile")
|
|
1405
1415
|
], b);
|
|
1406
1416
|
class L {
|