buzzcasting-storage 3.12.0 → 3.12.1
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/dist/buzzcasting-storage.d.ts +2 -2
- package/dist/buzzcasting-storage.esm.js +166 -157
- package/package.json +1 -1
|
@@ -44,8 +44,8 @@ export declare class BuzzcastingStorageManager {
|
|
|
44
44
|
getDashboards: (query: IQuery) => Promise<IResponse | undefined>;
|
|
45
45
|
setDashboard: (query: IQuery) => Promise<IResponse | undefined>;
|
|
46
46
|
loadImages: (folder: string) => Promise<IResponse | undefined>;
|
|
47
|
-
storeImage: (imageFile: FormData) => Promise<IResponse | number>;
|
|
48
|
-
deleteImage: (imageName: string) => Promise<IResponse | number>;
|
|
47
|
+
storeImage: (folderName: string, imageFile: FormData) => Promise<IResponse | number>;
|
|
48
|
+
deleteImage: (folderName: string, imageName: string) => Promise<IResponse | number>;
|
|
49
49
|
getImages: (query: IQuery) => Promise<IResponse | undefined>;
|
|
50
50
|
setImage: (query: IQuery) => Promise<IResponse | undefined>;
|
|
51
51
|
}
|
|
@@ -45,8 +45,8 @@ function jr(h, t, o, l) {
|
|
|
45
45
|
return v;
|
|
46
46
|
try {
|
|
47
47
|
return Oe(v, String(t.valueOf()));
|
|
48
|
-
} catch (
|
|
49
|
-
return Oe(v, `[valueOf exception]${
|
|
48
|
+
} catch (T) {
|
|
49
|
+
return Oe(v, `[valueOf exception]${T.stack || T.message}`);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
return Oe(g, t.toString());
|
|
@@ -117,10 +117,10 @@ function Ta(h) {
|
|
|
117
117
|
}
|
|
118
118
|
function Ot(h, t) {
|
|
119
119
|
var o;
|
|
120
|
-
let l, g, v,
|
|
120
|
+
let l, g, v, T, K;
|
|
121
121
|
switch (h.moderation) {
|
|
122
122
|
case en.BEFORE:
|
|
123
|
-
l = /* @__PURE__ */ new Date(), g = (o = h.beforeTime) == null ? void 0 : o.split(":"), v = Number.parseInt(g ? g[0] : "00"),
|
|
123
|
+
l = /* @__PURE__ */ new Date(), g = (o = h.beforeTime) == null ? void 0 : o.split(":"), v = Number.parseInt(g ? g[0] : "00"), T = Number.parseInt(g ? g[1] : "00"), K = Number.parseInt(g ? g[2] : "00"), t.before = l.setHours(v, T, K, 0) / 1e3, t.period || (t.period = l.getDay() === 1 ? 72 : 24);
|
|
124
124
|
break;
|
|
125
125
|
case en.DELAYED:
|
|
126
126
|
h.delay && h.delay > 0 && (t.delay = `${h.delay}`);
|
|
@@ -133,7 +133,7 @@ function Ot(h, t) {
|
|
|
133
133
|
}
|
|
134
134
|
return t;
|
|
135
135
|
}
|
|
136
|
-
const xa = "3.
|
|
136
|
+
const xa = "3.12.0";
|
|
137
137
|
class ka {
|
|
138
138
|
options;
|
|
139
139
|
url;
|
|
@@ -174,16 +174,16 @@ class ka {
|
|
|
174
174
|
const { version: o } = this.options, l = this.headers(), g = Object.assign({}, t);
|
|
175
175
|
delete g.type, delete g.hash, delete g.order, g.topics = `${g.dashboard}-${g.widget}`, delete g.presentation;
|
|
176
176
|
const v = Object.keys(g).length > 0 ? `?${new URLSearchParams(g).toString()}` : "";
|
|
177
|
-
let
|
|
177
|
+
let T = "";
|
|
178
178
|
switch (t.type) {
|
|
179
179
|
case _.MESSAGES:
|
|
180
|
-
|
|
180
|
+
T = c.MESSAGES;
|
|
181
181
|
break;
|
|
182
182
|
case _.SERIES:
|
|
183
|
-
|
|
183
|
+
T = c.SERIES;
|
|
184
184
|
break;
|
|
185
185
|
case _.CLOUD:
|
|
186
|
-
|
|
186
|
+
T = c.CLOUD;
|
|
187
187
|
break;
|
|
188
188
|
}
|
|
189
189
|
return G(3, [
|
|
@@ -192,7 +192,7 @@ class ka {
|
|
|
192
192
|
c.NONE,
|
|
193
193
|
c.API,
|
|
194
194
|
c.NONE,
|
|
195
|
-
|
|
195
|
+
T,
|
|
196
196
|
t.widget
|
|
197
197
|
]), G(4, [t.type, g]), await fetch(
|
|
198
198
|
[this.url, "api", o, t.type].join("/") + v,
|
|
@@ -224,8 +224,8 @@ class ka {
|
|
|
224
224
|
}
|
|
225
225
|
async hideLabels(t) {
|
|
226
226
|
const { version: o } = this.options, l = this.formHeaders(), g = new URLSearchParams(), v = t.labels || [];
|
|
227
|
-
for (const [
|
|
228
|
-
g.append(`custom_filters[${
|
|
227
|
+
for (const [T, K] of v.entries())
|
|
228
|
+
g.append(`custom_filters[${T}]`, K);
|
|
229
229
|
return console.info(
|
|
230
230
|
"%capi%c %cput",
|
|
231
231
|
c.API,
|
|
@@ -237,11 +237,11 @@ class ka {
|
|
|
237
237
|
), await fetch(
|
|
238
238
|
[this.url, "api", o, t.type, t.widget].join("/"),
|
|
239
239
|
{ ...l, body: g, method: "put" }
|
|
240
|
-
).then((
|
|
241
|
-
if (!
|
|
242
|
-
throw new Error(
|
|
243
|
-
return
|
|
244
|
-
}).then((
|
|
240
|
+
).then((T) => {
|
|
241
|
+
if (!T.ok)
|
|
242
|
+
throw new Error(T.statusText);
|
|
243
|
+
return T;
|
|
244
|
+
}).then((T) => T.json()).catch((T) => ({ succes: !1, message: T, data: [] }));
|
|
245
245
|
}
|
|
246
246
|
async loadSlide(t) {
|
|
247
247
|
const { version: o } = this.options, l = this.headers(), g = Object.assign({}, t);
|
|
@@ -416,7 +416,9 @@ class ka {
|
|
|
416
416
|
async loadImages(t) {
|
|
417
417
|
const { version: o } = this.options, l = this.headers();
|
|
418
418
|
return console.info("%capi%c %cloadImage", c.API, c.NONE, c.WIDGET), await fetch(
|
|
419
|
-
[this.url, "api", o, _.IMAGES
|
|
419
|
+
`${[this.url, "api", o, _.IMAGES].join(
|
|
420
|
+
"/"
|
|
421
|
+
)}?folder=${t}`,
|
|
420
422
|
{
|
|
421
423
|
...l,
|
|
422
424
|
method: "get"
|
|
@@ -431,40 +433,47 @@ class ka {
|
|
|
431
433
|
success: !0
|
|
432
434
|
})).catch((g) => ({ success: !1, message: `${g}`, data: null }));
|
|
433
435
|
}
|
|
434
|
-
async storeImage(t) {
|
|
435
|
-
const { version:
|
|
436
|
+
async storeImage(t, o) {
|
|
437
|
+
const { version: l } = this.options, g = this.fileHeaders(), v = o;
|
|
436
438
|
return console.info(
|
|
437
439
|
"%capi%c %cstoreImage",
|
|
438
440
|
c.API,
|
|
439
441
|
c.NONE,
|
|
440
442
|
c.WIDGET,
|
|
441
|
-
|
|
442
|
-
), await fetch(
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
443
|
+
o.get("name")
|
|
444
|
+
), await fetch(
|
|
445
|
+
`${[this.url, "api", l, _.IMAGES].join(
|
|
446
|
+
"/"
|
|
447
|
+
)}?folder=${t}`,
|
|
448
|
+
{
|
|
449
|
+
...g,
|
|
450
|
+
body: v,
|
|
451
|
+
method: "post"
|
|
452
|
+
}
|
|
453
|
+
).then((T) => {
|
|
454
|
+
if (!T.ok)
|
|
455
|
+
throw new Error(T.statusText);
|
|
456
|
+
return T;
|
|
457
|
+
}).then((T) => T.json()).catch((T) => ({ succes: !1, message: T, data: [] }));
|
|
451
458
|
}
|
|
452
|
-
async deleteImage(t) {
|
|
453
|
-
const { version:
|
|
459
|
+
async deleteImage(t, o) {
|
|
460
|
+
const { version: l } = this.options, g = this.formHeaders();
|
|
454
461
|
return console.info(
|
|
455
462
|
"%capi%c %cdeleteImage",
|
|
456
463
|
c.API,
|
|
457
464
|
c.NONE,
|
|
458
465
|
c.WIDGET,
|
|
459
|
-
|
|
466
|
+
o
|
|
460
467
|
), await fetch(
|
|
461
|
-
[this.url, "api",
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
+
`${[this.url, "api", l, _.IMAGES, o].join(
|
|
469
|
+
"/"
|
|
470
|
+
)}?folder=${t}`,
|
|
471
|
+
{ ...g, method: "delete" }
|
|
472
|
+
).then((v) => {
|
|
473
|
+
if (!v.ok)
|
|
474
|
+
throw new Error(v.statusText);
|
|
475
|
+
return v;
|
|
476
|
+
}).then((v) => v.json()).catch((v) => ({ succes: !1, message: v, data: [] }));
|
|
468
477
|
}
|
|
469
478
|
}
|
|
470
479
|
var Ca = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
@@ -493,9 +502,9 @@ function Ma() {
|
|
|
493
502
|
for (var a, s = 0, i = n.length; s < i; s++) !a && s in n || ((a = a || Array.prototype.slice.call(n, 0, s))[s] = n[s]);
|
|
494
503
|
return e.concat(a || Array.prototype.slice.call(n));
|
|
495
504
|
}
|
|
496
|
-
var v = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Ca,
|
|
505
|
+
var v = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Ca, T = Object.keys, K = Array.isArray;
|
|
497
506
|
function te(e, n) {
|
|
498
|
-
return typeof n != "object" ||
|
|
507
|
+
return typeof n != "object" || T(n).forEach(function(r) {
|
|
499
508
|
e[r] = n[r];
|
|
500
509
|
}), e;
|
|
501
510
|
}
|
|
@@ -505,7 +514,7 @@ function Ma() {
|
|
|
505
514
|
return Ce.call(e, n);
|
|
506
515
|
}
|
|
507
516
|
function be(e, n) {
|
|
508
|
-
typeof n == "function" && (n = n(ge(e))), (typeof Reflect > "u" ?
|
|
517
|
+
typeof n == "function" && (n = n(ge(e))), (typeof Reflect > "u" ? T : Reflect.ownKeys)(n).forEach(function(r) {
|
|
509
518
|
Ae(e, r, n[r]);
|
|
510
519
|
});
|
|
511
520
|
}
|
|
@@ -1129,7 +1138,7 @@ function Ma() {
|
|
|
1129
1138
|
}, J.prototype.where = function(e) {
|
|
1130
1139
|
if (typeof e == "string") return new this.db.WhereClause(this, e);
|
|
1131
1140
|
if (K(e)) return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
1132
|
-
var n =
|
|
1141
|
+
var n = T(e);
|
|
1133
1142
|
if (n.length === 1) return this.where(n[0]).equals(e[n[0]]);
|
|
1134
1143
|
var r = this.schema.indexes.concat(this.schema.primKey).filter(function(d) {
|
|
1135
1144
|
if (d.compound && n.every(function(y) {
|
|
@@ -1362,7 +1371,7 @@ function Ma() {
|
|
|
1362
1371
|
} };
|
|
1363
1372
|
return r[u] = n[u] = w;
|
|
1364
1373
|
}
|
|
1365
|
-
|
|
1374
|
+
T(y = u).forEach(function(f) {
|
|
1366
1375
|
var O = y[f];
|
|
1367
1376
|
if (K(O)) i(f, y[f][0], y[f][1]);
|
|
1368
1377
|
else {
|
|
@@ -1636,7 +1645,7 @@ function Ma() {
|
|
|
1636
1645
|
var n = this, r = this._ctx;
|
|
1637
1646
|
return this._write(function(a) {
|
|
1638
1647
|
var s, i, u;
|
|
1639
|
-
u = typeof e == "function" ? e : (s =
|
|
1648
|
+
u = typeof e == "function" ? e : (s = T(e), i = s.length, function(b) {
|
|
1640
1649
|
for (var A = !1, P = 0; P < i; ++P) {
|
|
1641
1650
|
var D = s[P], I = e[D], N = ve(b, D);
|
|
1642
1651
|
I instanceof pt ? (ue(b, D, I.execute(N)), A = !0) : N !== I && (ue(b, D, I), A = !0);
|
|
@@ -1648,7 +1657,7 @@ function Ma() {
|
|
|
1648
1657
|
function O(b, D) {
|
|
1649
1658
|
var P = D.failures, D = D.numFailures;
|
|
1650
1659
|
E += b - D;
|
|
1651
|
-
for (var I = 0, N =
|
|
1660
|
+
for (var I = 0, N = T(P); I < N.length; I++) {
|
|
1652
1661
|
var C = N[I];
|
|
1653
1662
|
m.push(P[C]);
|
|
1654
1663
|
}
|
|
@@ -1658,15 +1667,15 @@ function Ma() {
|
|
|
1658
1667
|
function A(D) {
|
|
1659
1668
|
var I = Math.min(w, b.length - D);
|
|
1660
1669
|
return d.getMany({ trans: a, keys: b.slice(D, D + I), cache: "immutable" }).then(function(N) {
|
|
1661
|
-
for (var C = [], R = [],
|
|
1662
|
-
var M = N[
|
|
1663
|
-
u.call(F, F.value, F) !== !1 && (F.value == null ? $.push(b[D +
|
|
1670
|
+
for (var C = [], R = [], x = p ? [] : null, $ = [], k = 0; k < I; ++k) {
|
|
1671
|
+
var M = N[k], F = { value: $e(M), primKey: b[D + k] };
|
|
1672
|
+
u.call(F, F.value, F) !== !1 && (F.value == null ? $.push(b[D + k]) : p || H(y(M), y(F.value)) === 0 ? (R.push(F.value), p && x.push(b[D + k])) : ($.push(b[D + k]), C.push(F.value)));
|
|
1664
1673
|
}
|
|
1665
1674
|
return Promise.resolve(0 < C.length && d.mutate({ trans: a, type: "add", values: C }).then(function(U) {
|
|
1666
1675
|
for (var z in U.failures) $.splice(parseInt(z), 1);
|
|
1667
1676
|
O(C.length, U);
|
|
1668
1677
|
})).then(function() {
|
|
1669
|
-
return (0 < R.length || P && typeof e == "object") && d.mutate({ trans: a, type: "put", keys:
|
|
1678
|
+
return (0 < R.length || P && typeof e == "object") && d.mutate({ trans: a, type: "put", keys: x, values: R, criteria: P, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < D }).then(function(U) {
|
|
1670
1679
|
return O(R.length, U);
|
|
1671
1680
|
});
|
|
1672
1681
|
}).then(function() {
|
|
@@ -1757,13 +1766,13 @@ function Ma() {
|
|
|
1757
1766
|
var P = i(A);
|
|
1758
1767
|
if (n(P, p, m)) return !0;
|
|
1759
1768
|
for (var D = null, I = m; I < f; ++I) {
|
|
1760
|
-
var N = function(C, R,
|
|
1769
|
+
var N = function(C, R, x, $, k, M) {
|
|
1761
1770
|
for (var F = Math.min(C.length, $.length), U = -1, z = 0; z < F; ++z) {
|
|
1762
1771
|
var de = R[z];
|
|
1763
|
-
if (de !== $[z]) return
|
|
1764
|
-
|
|
1772
|
+
if (de !== $[z]) return k(C[z], x[z]) < 0 ? C.substr(0, z) + x[z] + x.substr(z + 1) : k(C[z], $[z]) < 0 ? C.substr(0, z) + $[z] + x.substr(z + 1) : 0 <= U ? C.substr(0, U) + R[U] + x.substr(U + 1) : null;
|
|
1773
|
+
k(C[z], de) < 0 && (U = z);
|
|
1765
1774
|
}
|
|
1766
|
-
return F < $.length && M === "next" ? C +
|
|
1775
|
+
return F < $.length && M === "next" ? C + x.substr(C.length) : F < C.length && M === "prev" ? C.substr(0, x.length) : U < 0 ? null : C.substr(0, U) + $[U] + x.substr(U + 1);
|
|
1767
1776
|
}(A, P, d[I], p[I], u, y);
|
|
1768
1777
|
N === null && D === null ? m = I + 1 : (D === null || 0 < u(D, N)) && (D = N);
|
|
1769
1778
|
}
|
|
@@ -2071,9 +2080,9 @@ function Ma() {
|
|
|
2071
2080
|
var b = S.trans, A = S.type, P = S.keys, D = S.values, I = S.range;
|
|
2072
2081
|
return new Promise(function(N, C) {
|
|
2073
2082
|
N = Z(N);
|
|
2074
|
-
var R = b.objectStore(E),
|
|
2083
|
+
var R = b.objectStore(E), x = R.keyPath == null, $ = A === "put" || A === "add";
|
|
2075
2084
|
if (!$ && A !== "delete" && A !== "deleteRange") throw new Error("Invalid operation type: " + A);
|
|
2076
|
-
var
|
|
2085
|
+
var k, M = (P || D || { length: 1 }).length;
|
|
2077
2086
|
if (P && D && P.length !== D.length) throw new Error("Given keys array must have same length as given values array.");
|
|
2078
2087
|
if (M === 0) return N({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
2079
2088
|
function F(ce) {
|
|
@@ -2082,11 +2091,11 @@ function Ma() {
|
|
|
2082
2091
|
var U = [], z = [], de = 0;
|
|
2083
2092
|
if (A === "deleteRange") {
|
|
2084
2093
|
if (I.type === 4) return N({ numFailures: de, failures: z, results: [], lastResult: void 0 });
|
|
2085
|
-
I.type === 3 ? U.push(
|
|
2094
|
+
I.type === 3 ? U.push(k = R.clear()) : U.push(k = R.delete(a(I)));
|
|
2086
2095
|
} else {
|
|
2087
|
-
var
|
|
2088
|
-
if ($) for (var oe = 0; oe < M; ++oe) U.push(
|
|
2089
|
-
else for (oe = 0; oe < M; ++oe) U.push(
|
|
2096
|
+
var x = $ ? x ? [D, P] : [D, null] : [P, null], W = x[0], se = x[1];
|
|
2097
|
+
if ($) for (var oe = 0; oe < M; ++oe) U.push(k = se && se[oe] !== void 0 ? R[A](W[oe], se[oe]) : R[A](W[oe])), k.onerror = F;
|
|
2098
|
+
else for (oe = 0; oe < M; ++oe) U.push(k = R[A](W[oe])), k.onerror = F;
|
|
2090
2099
|
}
|
|
2091
2100
|
function qt(ce) {
|
|
2092
2101
|
ce = ce.target.result, U.forEach(function(Ve, Wn) {
|
|
@@ -2095,18 +2104,18 @@ function Ma() {
|
|
|
2095
2104
|
return Ve.result;
|
|
2096
2105
|
}), lastResult: ce });
|
|
2097
2106
|
}
|
|
2098
|
-
|
|
2107
|
+
k.onerror = function(ce) {
|
|
2099
2108
|
F(ce), qt(ce);
|
|
2100
|
-
},
|
|
2109
|
+
}, k.onsuccess = qt;
|
|
2101
2110
|
});
|
|
2102
2111
|
}, getMany: function(S) {
|
|
2103
2112
|
var b = S.trans, A = S.keys;
|
|
2104
2113
|
return new Promise(function(P, D) {
|
|
2105
2114
|
P = Z(P);
|
|
2106
|
-
for (var I, N = b.objectStore(E), C = A.length, R = new Array(C),
|
|
2107
|
-
U = U.target, R[U._pos] = U.result, ++$ ===
|
|
2108
|
-
}, M = me(D), F = 0; F < C; ++F) A[F] != null && ((I = N.get(A[F]))._pos = F, I.onsuccess =
|
|
2109
|
-
|
|
2115
|
+
for (var I, N = b.objectStore(E), C = A.length, R = new Array(C), x = 0, $ = 0, k = function(U) {
|
|
2116
|
+
U = U.target, R[U._pos] = U.result, ++$ === x && P(R);
|
|
2117
|
+
}, M = me(D), F = 0; F < C; ++F) A[F] != null && ((I = N.get(A[F]))._pos = F, I.onsuccess = k, I.onerror = M, ++x);
|
|
2118
|
+
x === 0 && P(R);
|
|
2110
2119
|
});
|
|
2111
2120
|
}, get: function(S) {
|
|
2112
2121
|
var b = S.trans, A = S.key;
|
|
@@ -2120,11 +2129,11 @@ function Ma() {
|
|
|
2120
2129
|
}, query: (m = y, function(S) {
|
|
2121
2130
|
return new Promise(function(b, A) {
|
|
2122
2131
|
b = Z(b);
|
|
2123
|
-
var P, D, I,
|
|
2132
|
+
var P, D, I, x = S.trans, N = S.values, C = S.limit, k = S.query, R = C === 1 / 0 ? void 0 : C, $ = k.index, k = k.range, x = x.objectStore(E), $ = $.isPrimaryKey ? x : x.index($.name), k = a(k);
|
|
2124
2133
|
if (C === 0) return b({ result: [] });
|
|
2125
|
-
m ? ((R = N ? $.getAll(
|
|
2134
|
+
m ? ((R = N ? $.getAll(k, R) : $.getAllKeys(k, R)).onsuccess = function(M) {
|
|
2126
2135
|
return b({ result: M.target.result });
|
|
2127
|
-
}, R.onerror = me(A)) : (P = 0, D = !N && "openKeyCursor" in $ ? $.openKeyCursor(
|
|
2136
|
+
}, R.onerror = me(A)) : (P = 0, D = !N && "openKeyCursor" in $ ? $.openKeyCursor(k) : $.openCursor(k), I = [], D.onsuccess = function(M) {
|
|
2128
2137
|
var F = D.result;
|
|
2129
2138
|
return F ? (I.push(N ? F.value : F.primaryKey), ++P === C ? b({ result: I }) : void F.continue()) : b({ result: I });
|
|
2130
2139
|
}, D.onerror = me(A));
|
|
@@ -2133,9 +2142,9 @@ function Ma() {
|
|
|
2133
2142
|
var b = S.trans, A = S.values, P = S.query, D = S.reverse, I = S.unique;
|
|
2134
2143
|
return new Promise(function(N, C) {
|
|
2135
2144
|
N = Z(N);
|
|
2136
|
-
var $ = P.index, R = P.range,
|
|
2137
|
-
|
|
2138
|
-
var F, U, z, de, W =
|
|
2145
|
+
var $ = P.index, R = P.range, x = b.objectStore(E), x = $.isPrimaryKey ? x : x.index($.name), $ = D ? I ? "prevunique" : "prev" : I ? "nextunique" : "next", k = !A && "openKeyCursor" in x ? x.openKeyCursor(a(R), $) : x.openCursor(a(R), $);
|
|
2146
|
+
k.onerror = me(C), k.onsuccess = Z(function(M) {
|
|
2147
|
+
var F, U, z, de, W = k.result;
|
|
2139
2148
|
W ? (W.___id = ++la, W.done = !1, F = W.continue.bind(W), U = (U = W.continuePrimaryKey) && U.bind(W), z = W.advance.bind(W), de = function() {
|
|
2140
2149
|
throw new Error("Cursor not stopped");
|
|
2141
2150
|
}, W.trans = b, W.stop = W.continue = W.continuePrimaryKey = W.advance = function() {
|
|
@@ -2149,7 +2158,7 @@ function Ma() {
|
|
|
2149
2158
|
});
|
|
2150
2159
|
}, W.start = function(se) {
|
|
2151
2160
|
function oe() {
|
|
2152
|
-
if (
|
|
2161
|
+
if (k.result) try {
|
|
2153
2162
|
se();
|
|
2154
2163
|
} catch (ce) {
|
|
2155
2164
|
W.fail(ce);
|
|
@@ -2159,12 +2168,12 @@ function Ma() {
|
|
|
2159
2168
|
}, W.stop();
|
|
2160
2169
|
}
|
|
2161
2170
|
var qt = new Promise(function(ce, Ve) {
|
|
2162
|
-
ce = Z(ce),
|
|
2171
|
+
ce = Z(ce), k.onerror = me(Ve), W.fail = Ve, W.stop = function(Wn) {
|
|
2163
2172
|
W.stop = W.continue = W.continuePrimaryKey = W.advance = de, ce(Wn);
|
|
2164
2173
|
};
|
|
2165
2174
|
});
|
|
2166
|
-
return
|
|
2167
|
-
|
|
2175
|
+
return k.onsuccess = Z(function(ce) {
|
|
2176
|
+
k.onsuccess = oe, oe();
|
|
2168
2177
|
}), W.continue = F, W.continuePrimaryKey = U, W.advance = z, oe(), qt;
|
|
2169
2178
|
}, N(W)) : N(null);
|
|
2170
2179
|
}, C);
|
|
@@ -2173,8 +2182,8 @@ function Ma() {
|
|
|
2173
2182
|
var b = S.query, A = S.trans, P = b.index, D = b.range;
|
|
2174
2183
|
return new Promise(function(I, N) {
|
|
2175
2184
|
var C = A.objectStore(E), R = P.isPrimaryKey ? C : C.index(P.name), C = a(D), R = C ? R.count(C) : R.count();
|
|
2176
|
-
R.onsuccess = Z(function(
|
|
2177
|
-
return I(
|
|
2185
|
+
R.onsuccess = Z(function(x) {
|
|
2186
|
+
return I(x.target.result);
|
|
2178
2187
|
}), R.onerror = me(N);
|
|
2179
2188
|
});
|
|
2180
2189
|
} };
|
|
@@ -2258,13 +2267,13 @@ function Ma() {
|
|
|
2258
2267
|
Dn(E, $[0], $[1].primKey, $[1].indexes);
|
|
2259
2268
|
}), I.change.forEach(function($) {
|
|
2260
2269
|
if ($.recreate) throw new L.Upgrade("Not yet support for changing primary key");
|
|
2261
|
-
var
|
|
2270
|
+
var k = E.objectStore($.name);
|
|
2262
2271
|
$.add.forEach(function(M) {
|
|
2263
|
-
return Ft(
|
|
2272
|
+
return Ft(k, M);
|
|
2264
2273
|
}), $.change.forEach(function(M) {
|
|
2265
|
-
|
|
2274
|
+
k.deleteIndex(M.name), Ft(k, M);
|
|
2266
2275
|
}), $.del.forEach(function(M) {
|
|
2267
|
-
return
|
|
2276
|
+
return k.deleteIndex(M);
|
|
2268
2277
|
});
|
|
2269
2278
|
});
|
|
2270
2279
|
var N = A._cfg.contentUpgrade;
|
|
@@ -2273,11 +2282,11 @@ function Ma() {
|
|
|
2273
2282
|
var C = Qn(D);
|
|
2274
2283
|
I.del.forEach(function($) {
|
|
2275
2284
|
C[$] = P[$];
|
|
2276
|
-
}), An(f, [f.Transaction.prototype]), Wt(f, [f.Transaction.prototype],
|
|
2277
|
-
var R,
|
|
2278
|
-
return
|
|
2285
|
+
}), An(f, [f.Transaction.prototype]), Wt(f, [f.Transaction.prototype], T(C), C), m.schema = C;
|
|
2286
|
+
var R, x = an(N);
|
|
2287
|
+
return x && et(), I = j.follow(function() {
|
|
2279
2288
|
var $;
|
|
2280
|
-
(R = N(m)) &&
|
|
2289
|
+
(R = N(m)) && x && ($ = Ie.bind(null, null), R.then($, $));
|
|
2281
2290
|
}), R && typeof R.then == "function" ? j.resolve(R) : I.then(function() {
|
|
2282
2291
|
return R;
|
|
2283
2292
|
});
|
|
@@ -2298,7 +2307,7 @@ function Ma() {
|
|
|
2298
2307
|
vr(b, E);
|
|
2299
2308
|
})) : j.resolve();
|
|
2300
2309
|
var f, O, m, E, S, b;
|
|
2301
|
-
}).catch(u)) : (
|
|
2310
|
+
}).catch(u)) : (T(s).forEach(function(w) {
|
|
2302
2311
|
Dn(r, w, s[w].primKey, s[w].indexes);
|
|
2303
2312
|
}), Lt(e, r), void j.follow(function() {
|
|
2304
2313
|
return e.on.populate.fire(i);
|
|
@@ -2349,7 +2358,7 @@ function Ma() {
|
|
|
2349
2358
|
}), s;
|
|
2350
2359
|
}
|
|
2351
2360
|
function vr(e, n) {
|
|
2352
|
-
|
|
2361
|
+
T(e).forEach(function(r) {
|
|
2353
2362
|
n.db.objectStoreNames.contains(r) || (pe && console.debug("Dexie: Creating missing table", r), Dn(n, r, e[r].primKey, e[r].indexes));
|
|
2354
2363
|
});
|
|
2355
2364
|
}
|
|
@@ -2384,7 +2393,7 @@ function Ma() {
|
|
|
2384
2393
|
});
|
|
2385
2394
|
}
|
|
2386
2395
|
var ma = (Ht.prototype._parseStoresSpec = function(e, n) {
|
|
2387
|
-
|
|
2396
|
+
T(e).forEach(function(r) {
|
|
2388
2397
|
if (e[r] !== null) {
|
|
2389
2398
|
var a = Er(e[r]), s = a.shift();
|
|
2390
2399
|
if (s.unique = !0, s.multi) throw new L.Schema("Primary key cannot be multi-valued");
|
|
@@ -2400,7 +2409,7 @@ function Ma() {
|
|
|
2400
2409
|
var r = n._versions, a = {}, s = {};
|
|
2401
2410
|
return r.forEach(function(i) {
|
|
2402
2411
|
te(a, i._cfg.storesSource), s = i._cfg.dbschema = {}, i._parseStoresSpec(a, s);
|
|
2403
|
-
}), n._dbSchema = s, An(n, [n._allTables, n, n.Transaction.prototype]), Wt(n, [n._allTables, n, n.Transaction.prototype, this._cfg.tables],
|
|
2412
|
+
}), n._dbSchema = s, An(n, [n._allTables, n, n.Transaction.prototype]), Wt(n, [n._allTables, n, n.Transaction.prototype, this._cfg.tables], T(s), s), n._storeNames = T(s), this;
|
|
2404
2413
|
}, Ht.prototype.upgrade = function(e) {
|
|
2405
2414
|
return this._cfg.contentUpgrade = on(this._cfg.contentUpgrade || Q, e), this;
|
|
2406
2415
|
}, Ht);
|
|
@@ -2483,7 +2492,7 @@ function Ma() {
|
|
|
2483
2492
|
return (n ? r ? Math.max(n.d, r.d) : n.d : r ? r.d : 0) + 1;
|
|
2484
2493
|
}
|
|
2485
2494
|
function Yt(e, n) {
|
|
2486
|
-
return
|
|
2495
|
+
return T(n).forEach(function(r) {
|
|
2487
2496
|
e[r] ? wt(e[r], n[r]) : e[r] = function a(s) {
|
|
2488
2497
|
var i, u, d = {};
|
|
2489
2498
|
for (i in s) ie(s, i) && (u = s[i], d[i] = !u || typeof u != "object" || Jn.has(u.constructor) ? u : a(u));
|
|
@@ -2569,17 +2578,17 @@ function Ma() {
|
|
|
2569
2578
|
var b, A, P, D, I, N = e.idbdb = S.result, C = At(N.objectStoreNames);
|
|
2570
2579
|
if (0 < C.length) try {
|
|
2571
2580
|
var R = N.transaction((D = C).length === 1 ? D[0] : D, "readonly");
|
|
2572
|
-
if (n.autoSchema) A = N, P = R, (b = e).verno = A.version / 10, P = b._dbSchema = Ut(0, A, P), b._storeNames = At(A.objectStoreNames, 0), Wt(b, [b._allTables],
|
|
2573
|
-
else if (zt(e, e._dbSchema, R), ((I = Pn(Ut(0, (I = e).idbdb, R), I._dbSchema)).add.length || I.change.some(function(
|
|
2574
|
-
return
|
|
2581
|
+
if (n.autoSchema) A = N, P = R, (b = e).verno = A.version / 10, P = b._dbSchema = Ut(0, A, P), b._storeNames = At(A.objectStoreNames, 0), Wt(b, [b._allTables], T(P), P);
|
|
2582
|
+
else if (zt(e, e._dbSchema, R), ((I = Pn(Ut(0, (I = e).idbdb, R), I._dbSchema)).add.length || I.change.some(function(x) {
|
|
2583
|
+
return x.add.length || x.change.length;
|
|
2575
2584
|
})) && !i) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), N.close(), s = N.version + 1, i = !0, O(d());
|
|
2576
2585
|
Lt(e, R);
|
|
2577
2586
|
} catch {
|
|
2578
2587
|
}
|
|
2579
|
-
tt.push(e), N.onversionchange = Z(function(
|
|
2580
|
-
n.vcFired = !0, e.on("versionchange").fire(
|
|
2581
|
-
}), N.onclose = Z(function(
|
|
2582
|
-
e.on("close").fire(
|
|
2588
|
+
tt.push(e), N.onversionchange = Z(function(x) {
|
|
2589
|
+
n.vcFired = !0, e.on("versionchange").fire(x);
|
|
2590
|
+
}), N.onclose = Z(function(x) {
|
|
2591
|
+
e.on("close").fire(x);
|
|
2583
2592
|
}), f && (I = e._deps, R = E, N = I.indexedDB, I = I.IDBKeyRange, Nn(N) || R === jt || In(N, I).put({ name: R }).catch(Q)), O();
|
|
2584
2593
|
}, m);
|
|
2585
2594
|
}).catch(function(O) {
|
|
@@ -2698,10 +2707,10 @@ function Ma() {
|
|
|
2698
2707
|
} });
|
|
2699
2708
|
} };
|
|
2700
2709
|
function Mn(e, n, r, a) {
|
|
2701
|
-
return r = r || {}, a = a || "",
|
|
2710
|
+
return r = r || {}, a = a || "", T(e).forEach(function(s) {
|
|
2702
2711
|
var i, u, d;
|
|
2703
2712
|
ie(n, s) ? (i = e[s], u = n[s], typeof i == "object" && typeof u == "object" && i && u ? (d = nn(i)) !== nn(u) ? r[a + s] = n[s] : d === "Object" ? Mn(i, u, r, a + s + ".") : i !== u && (r[a + s] = n[s]) : i !== u && (r[a + s] = n[s])) : r[a + s] = void 0;
|
|
2704
|
-
}),
|
|
2713
|
+
}), T(n).forEach(function(s) {
|
|
2705
2714
|
ie(e, s) || (r[a + s] = n[s]);
|
|
2706
2715
|
}), r;
|
|
2707
2716
|
}
|
|
@@ -2748,15 +2757,15 @@ function Ma() {
|
|
|
2748
2757
|
if (!b) throw new Error("Keys missing");
|
|
2749
2758
|
return (f = f.type === "add" || f.type === "put" ? l(l({}, f), { keys: b }) : l({}, f)).type !== "delete" && (f.values = g([], f.values)), f.keys && (f.keys = g([], f.keys)), O = r, E = b, ((m = f).type === "add" ? Promise.resolve([]) : O.getMany({ trans: m.trans, keys: E, cache: "immutable" })).then(function(A) {
|
|
2750
2759
|
var P = b.map(function(D, I) {
|
|
2751
|
-
var N, C, R,
|
|
2752
|
-
return f.type === "delete" ? d.fire.call($, D,
|
|
2753
|
-
ie(R,
|
|
2760
|
+
var N, C, R, x = A[I], $ = { onerror: null, onsuccess: null };
|
|
2761
|
+
return f.type === "delete" ? d.fire.call($, D, x, S) : f.type === "add" || x === void 0 ? (N = p.fire.call($, D, f.values[I], S), D == null && N != null && (f.keys[I] = D = N, a.outbound || ue(f.values[I], a.keyPath, D))) : (N = Mn(x, f.values[I]), (C = y.fire.call($, N, D, x, S)) && (R = f.values[I], Object.keys(C).forEach(function(k) {
|
|
2762
|
+
ie(R, k) ? R[k] = C[k] : ue(R, k, C[k]);
|
|
2754
2763
|
}))), $;
|
|
2755
2764
|
});
|
|
2756
2765
|
return r.mutate(f).then(function(D) {
|
|
2757
2766
|
for (var I = D.failures, N = D.results, C = D.numFailures, D = D.lastResult, R = 0; R < b.length; ++R) {
|
|
2758
|
-
var
|
|
2759
|
-
|
|
2767
|
+
var x = (N || b)[R], $ = P[R];
|
|
2768
|
+
x == null ? $.onerror && $.onerror(I[R]) : $.onsuccess && $.onsuccess(f.type === "put" && A[R] ? f.values[R] : x);
|
|
2760
2769
|
}
|
|
2761
2770
|
return { failures: I, results: N, numFailures: C, lastResult: D };
|
|
2762
2771
|
}).catch(function(D) {
|
|
@@ -2815,19 +2824,19 @@ function Ma() {
|
|
|
2815
2824
|
var s = e.table(a), i = s.schema, u = i.primaryKey, f = i.indexes, d = u.extractKey, p = u.outbound, y = u.autoIncrement && f.filter(function(m) {
|
|
2816
2825
|
return m.compound && m.keyPath.includes(u.keyPath);
|
|
2817
2826
|
}), w = l(l({}, s), { mutate: function(m) {
|
|
2818
|
-
function E(
|
|
2819
|
-
return
|
|
2827
|
+
function E(k) {
|
|
2828
|
+
return k = "idb://".concat(n, "/").concat(a, "/").concat(k), D[k] || (D[k] = new ae());
|
|
2820
2829
|
}
|
|
2821
|
-
var S, b, A, P = m.trans, D = m.mutatedParts || (m.mutatedParts = {}), I = E(""), N = E(":dels"), C = m.type, $ = m.type === "deleteRange" ? [m.range] : m.type === "delete" ? [m.keys] : m.values.length < 50 ? [Gn(u, m).filter(function(
|
|
2822
|
-
return
|
|
2823
|
-
}), m.values] : [], R = $[0],
|
|
2824
|
-
return K(R) ? (I.addKeys(R), ($ = C === "delete" || R.length ===
|
|
2825
|
-
var M = S(
|
|
2830
|
+
var S, b, A, P = m.trans, D = m.mutatedParts || (m.mutatedParts = {}), I = E(""), N = E(":dels"), C = m.type, $ = m.type === "deleteRange" ? [m.range] : m.type === "delete" ? [m.keys] : m.values.length < 50 ? [Gn(u, m).filter(function(k) {
|
|
2831
|
+
return k;
|
|
2832
|
+
}), m.values] : [], R = $[0], x = $[1], $ = m.trans._cache;
|
|
2833
|
+
return K(R) ? (I.addKeys(R), ($ = C === "delete" || R.length === x.length ? Ar(R, $) : null) || N.addKeys(R), ($ || x) && (S = E, b = $, A = x, i.indexes.forEach(function(k) {
|
|
2834
|
+
var M = S(k.name || "");
|
|
2826
2835
|
function F(z) {
|
|
2827
|
-
return z != null ?
|
|
2836
|
+
return z != null ? k.extractKey(z) : null;
|
|
2828
2837
|
}
|
|
2829
2838
|
function U(z) {
|
|
2830
|
-
return
|
|
2839
|
+
return k.multiEntry && K(z) ? z.forEach(function(de) {
|
|
2831
2840
|
return M.addKey(de);
|
|
2832
2841
|
}) : M.addKey(z);
|
|
2833
2842
|
}
|
|
@@ -2835,17 +2844,17 @@ function Ma() {
|
|
|
2835
2844
|
var W = b && F(b[se]), se = A && F(A[se]);
|
|
2836
2845
|
H(W, se) !== 0 && (W != null && U(W), se != null && U(se));
|
|
2837
2846
|
});
|
|
2838
|
-
}))) : R ? (
|
|
2839
|
-
return E(
|
|
2840
|
-
})), s.mutate(m).then(function(
|
|
2841
|
-
return !R || m.type !== "add" && m.type !== "put" || (I.addKeys(
|
|
2847
|
+
}))) : R ? (x = { from: (x = R.lower) !== null && x !== void 0 ? x : e.MIN_KEY, to: (x = R.upper) !== null && x !== void 0 ? x : e.MAX_KEY }, N.add(x), I.add(x)) : (I.add(r), N.add(r), i.indexes.forEach(function(k) {
|
|
2848
|
+
return E(k.name).add(r);
|
|
2849
|
+
})), s.mutate(m).then(function(k) {
|
|
2850
|
+
return !R || m.type !== "add" && m.type !== "put" || (I.addKeys(k.results), y && y.forEach(function(M) {
|
|
2842
2851
|
for (var F = m.values.map(function(W) {
|
|
2843
2852
|
return M.extractKey(W);
|
|
2844
2853
|
}), U = M.keyPath.findIndex(function(W) {
|
|
2845
2854
|
return W === u.keyPath;
|
|
2846
|
-
}), z = 0, de =
|
|
2855
|
+
}), z = 0, de = k.results.length; z < de; ++z) F[z][U] = k.results[z];
|
|
2847
2856
|
E(M.name).addKeys(F);
|
|
2848
|
-
})), P.mutatedParts = Yt(P.mutatedParts || {}, D),
|
|
2857
|
+
})), P.mutatedParts = Yt(P.mutatedParts || {}, D), k;
|
|
2849
2858
|
});
|
|
2850
2859
|
} }), f = function(E) {
|
|
2851
2860
|
var S = E.query, E = S.index, S = S.range;
|
|
@@ -2855,35 +2864,35 @@ function Ma() {
|
|
|
2855
2864
|
}, getMany: function(m) {
|
|
2856
2865
|
return [u, new ae().addKeys(m.keys)];
|
|
2857
2866
|
}, count: f, query: f, openCursor: f };
|
|
2858
|
-
return
|
|
2867
|
+
return T(O).forEach(function(m) {
|
|
2859
2868
|
w[m] = function(E) {
|
|
2860
2869
|
var S = B.subscr, b = !!S, A = Pr(B, s) && Dr(m, E) ? E.obsSet = {} : S;
|
|
2861
2870
|
if (b) {
|
|
2862
|
-
var P = function(
|
|
2863
|
-
return
|
|
2871
|
+
var P = function(x) {
|
|
2872
|
+
return x = "idb://".concat(n, "/").concat(a, "/").concat(x), A[x] || (A[x] = new ae());
|
|
2864
2873
|
}, D = P(""), I = P(":dels"), S = O[m](E), b = S[0], S = S[1];
|
|
2865
2874
|
if ((m === "query" && b.isPrimaryKey && !E.values ? I : P(b.name || "")).add(S), !b.isPrimaryKey) {
|
|
2866
2875
|
if (m !== "count") {
|
|
2867
2876
|
var N = m === "query" && p && E.values && s.query(l(l({}, E), { values: !1 }));
|
|
2868
|
-
return s[m].apply(this, arguments).then(function(
|
|
2877
|
+
return s[m].apply(this, arguments).then(function(x) {
|
|
2869
2878
|
if (m === "query") {
|
|
2870
2879
|
if (p && E.values) return N.then(function(F) {
|
|
2871
|
-
return F = F.result, D.addKeys(F),
|
|
2880
|
+
return F = F.result, D.addKeys(F), x;
|
|
2872
2881
|
});
|
|
2873
|
-
var $ = E.values ?
|
|
2882
|
+
var $ = E.values ? x.result.map(d) : x.result;
|
|
2874
2883
|
(E.values ? D : I).addKeys($);
|
|
2875
2884
|
} else if (m === "openCursor") {
|
|
2876
|
-
var
|
|
2877
|
-
return
|
|
2878
|
-
return I.addKey(
|
|
2885
|
+
var k = x, M = E.values;
|
|
2886
|
+
return k && Object.create(k, { key: { get: function() {
|
|
2887
|
+
return I.addKey(k.primaryKey), k.key;
|
|
2879
2888
|
} }, primaryKey: { get: function() {
|
|
2880
|
-
var F =
|
|
2889
|
+
var F = k.primaryKey;
|
|
2881
2890
|
return I.addKey(F), F;
|
|
2882
2891
|
} }, value: { get: function() {
|
|
2883
|
-
return M && D.addKey(
|
|
2892
|
+
return M && D.addKey(k.primaryKey), k.value;
|
|
2884
2893
|
} } });
|
|
2885
2894
|
}
|
|
2886
|
-
return
|
|
2895
|
+
return x;
|
|
2887
2896
|
});
|
|
2888
2897
|
}
|
|
2889
2898
|
I.add(r);
|
|
@@ -2914,8 +2923,8 @@ function Ma() {
|
|
|
2914
2923
|
var S = m, b = [];
|
|
2915
2924
|
if (E.type === "add" || E.type === "put") for (var A = new ae(), P = E.values.length - 1; 0 <= P; --P) {
|
|
2916
2925
|
var D, I = E.values[P], N = y(I);
|
|
2917
|
-
A.hasKey(N) || (D = w(I), (d && K(D) ? D.some(function(
|
|
2918
|
-
return Kn(
|
|
2926
|
+
A.hasKey(N) || (D = w(I), (d && K(D) ? D.some(function(k) {
|
|
2927
|
+
return Kn(k, p);
|
|
2919
2928
|
}) : Kn(D, p)) && (A.addKey(N), b.push(I)));
|
|
2920
2929
|
}
|
|
2921
2930
|
switch (E.type) {
|
|
@@ -2941,9 +2950,9 @@ function Ma() {
|
|
|
2941
2950
|
}));
|
|
2942
2951
|
break;
|
|
2943
2952
|
case "delete":
|
|
2944
|
-
var
|
|
2953
|
+
var x = new ae().addKeys(E.keys);
|
|
2945
2954
|
S = m.filter(function(M) {
|
|
2946
|
-
return !
|
|
2955
|
+
return !x.hasKey(n.values ? y(M) : M);
|
|
2947
2956
|
});
|
|
2948
2957
|
break;
|
|
2949
2958
|
case "deleteRange":
|
|
@@ -3010,9 +3019,9 @@ function Ma() {
|
|
|
3010
3019
|
m.optimisticOps = m.optimisticOps.filter(function(M) {
|
|
3011
3020
|
return M.trans !== d;
|
|
3012
3021
|
});
|
|
3013
|
-
for (var I = 0, N = Object.values(m.queries.query); I < N.length; I++) for (var C, R,
|
|
3022
|
+
for (var I = 0, N = Object.values(m.queries.query); I < N.length; I++) for (var C, R, x, $ = 0, k = (C = N[I]).slice(); $ < k.length; $++) (R = k[$]).res != null && d.mutatedParts && (p && !R.dirty ? (x = Object.isFrozen(R.res), x = Nr(R.res, R.req, S, E, R, x), R.dirty ? (je(C, R), R.subscribers.forEach(function(M) {
|
|
3014
3023
|
return y.add(M);
|
|
3015
|
-
})) :
|
|
3024
|
+
})) : x !== R.res && (R.res = x, R.promise = j.resolve({ result: x }))) : (R.dirty && je(C, R), R.subscribers.forEach(function(M) {
|
|
3016
3025
|
return y.add(M);
|
|
3017
3026
|
})));
|
|
3018
3027
|
}
|
|
@@ -3166,7 +3175,7 @@ function Ma() {
|
|
|
3166
3175
|
return this._state.autoSchema;
|
|
3167
3176
|
}, Object.defineProperty(ee.prototype, "tables", { get: function() {
|
|
3168
3177
|
var e = this;
|
|
3169
|
-
return
|
|
3178
|
+
return T(this._allTables).map(function(n) {
|
|
3170
3179
|
return e._allTables[n];
|
|
3171
3180
|
});
|
|
3172
3181
|
}, enumerable: !1, configurable: !0 }), ee.prototype.transaction = function() {
|
|
@@ -3676,9 +3685,9 @@ class Mr {
|
|
|
3676
3685
|
};
|
|
3677
3686
|
const o = t?.order ?? "utc", l = Math.floor(Date.now() / 1e3);
|
|
3678
3687
|
o !== "utc" && (t.since = l - 60 * 60 * 24 * 30), this.options.delay != 0 ? t.before = l - (this.options.delay || 0) : t.before = l;
|
|
3679
|
-
const g = (K) => K.utc > (t?.since || 0), v = (K) => K.utc < (t?.before || l),
|
|
3688
|
+
const g = (K) => K.utc > (t?.since || 0), v = (K) => K.utc < (t?.before || l), T = (K) => K?.visible !== 0;
|
|
3680
3689
|
try {
|
|
3681
|
-
const te = await this.db.table(_.TOPICS).where("widget_id").equals(t.widget).filter(
|
|
3690
|
+
const te = await this.db.table(_.TOPICS).where("widget_id").equals(t.widget).filter(T).filter(g).filter(v).reverse().limit(t?.limit ?? 25).sortBy(o);
|
|
3682
3691
|
if (te.length === 0)
|
|
3683
3692
|
return {
|
|
3684
3693
|
data: null,
|
|
@@ -3753,7 +3762,7 @@ class Mr {
|
|
|
3753
3762
|
utc: v.utc,
|
|
3754
3763
|
data: v,
|
|
3755
3764
|
expires: v.expires
|
|
3756
|
-
}).catch((
|
|
3765
|
+
}).catch((T) => {
|
|
3757
3766
|
g++, G(4, [
|
|
3758
3767
|
"%cset%c %cstorage",
|
|
3759
3768
|
c.KO,
|
|
@@ -3762,7 +3771,7 @@ class Mr {
|
|
|
3762
3771
|
"set message",
|
|
3763
3772
|
`title: ${l}`,
|
|
3764
3773
|
v,
|
|
3765
|
-
|
|
3774
|
+
T.message
|
|
3766
3775
|
]);
|
|
3767
3776
|
}), await this.db.table(_.TOPICS).put({
|
|
3768
3777
|
title: l,
|
|
@@ -3775,7 +3784,7 @@ class Mr {
|
|
|
3775
3784
|
sentiment: v.topics[0]?.sentiment || 0,
|
|
3776
3785
|
utc: v.utc,
|
|
3777
3786
|
expires: v.expires
|
|
3778
|
-
}).catch((
|
|
3787
|
+
}).catch((T) => {
|
|
3779
3788
|
g++, G(4, [
|
|
3780
3789
|
"%cset%c %cstorage",
|
|
3781
3790
|
c.KO,
|
|
@@ -3784,10 +3793,10 @@ class Mr {
|
|
|
3784
3793
|
"set topic",
|
|
3785
3794
|
`title: ${l}`,
|
|
3786
3795
|
v,
|
|
3787
|
-
|
|
3796
|
+
T.message
|
|
3788
3797
|
]);
|
|
3789
|
-
}), await o.data.topics.forEach(async (
|
|
3790
|
-
const K =
|
|
3798
|
+
}), await o.data.topics.forEach(async (T) => {
|
|
3799
|
+
const K = T.message_id, te = T.visible ? 1 : 0, ge = T.title;
|
|
3791
3800
|
await this.db.table(_.TOPICS).where("message_id").equals(K).modify({ visible: te }).catch((Ce) => {
|
|
3792
3801
|
g++, G(4, [
|
|
3793
3802
|
"%cset%c %cstorage",
|
|
@@ -3796,7 +3805,7 @@ class Mr {
|
|
|
3796
3805
|
c.STORAGE,
|
|
3797
3806
|
"update message visibility",
|
|
3798
3807
|
`title: ${ge}`,
|
|
3799
|
-
`widget: ${
|
|
3808
|
+
`widget: ${T.widget_id}`,
|
|
3800
3809
|
Ce.message
|
|
3801
3810
|
]);
|
|
3802
3811
|
});
|
|
@@ -3907,7 +3916,7 @@ class Mr {
|
|
|
3907
3916
|
* @returns IResponse
|
|
3908
3917
|
*/
|
|
3909
3918
|
getWidgets = async (t) => {
|
|
3910
|
-
const o = (
|
|
3919
|
+
const o = (T) => t?.dashboard === T.dashboard_id, l = (T) => t?.type === T.type, g = (T) => t?.name ? T.name.includes(t?.name) : !1, v = await this.db.table(_.WIDGET).toArray().then((T) => t?.dashboard ? T.filter(o) : T).then((T) => t?.type ? T.filter(l) : T).then((T) => t?.name ? T.filter(g) : T).catch(() => {
|
|
3911
3920
|
G(2, ["%cstorage", c.STORAGE, X.WIDGET_LOAD, t]);
|
|
3912
3921
|
});
|
|
3913
3922
|
return v !== void 0 && G(3, [
|
|
@@ -3997,7 +4006,7 @@ class Mr {
|
|
|
3997
4006
|
* @returns IResponse
|
|
3998
4007
|
*/
|
|
3999
4008
|
getSlides = async (t) => {
|
|
4000
|
-
const o = (
|
|
4009
|
+
const o = (T) => t?.id ? t.id = T.id : !1, l = (T) => t?.name ? T.name.includes(t?.name) : !1, v = await this.db.table(_.SLIDE).toArray().then((T) => t?.id ? T.filter(o) : T).then((T) => t?.name ? T.filter(l) : T);
|
|
4001
4010
|
return v !== void 0 && G(3, ["%cstorage%c %cslides", c.STORAGE, c.NONE, c.SLIDE, t]), {
|
|
4002
4011
|
// @ts-ignore
|
|
4003
4012
|
data: v !== void 0 ? { slides: v, query: t } : null,
|
|
@@ -4228,7 +4237,7 @@ function Ka(h, t) {
|
|
|
4228
4237
|
}, () => {
|
|
4229
4238
|
}), o;
|
|
4230
4239
|
};
|
|
4231
|
-
return (g, v) => l().then((
|
|
4240
|
+
return (g, v) => l().then((T) => v(T.transaction(t, g).objectStore(t)));
|
|
4232
4241
|
}
|
|
4233
4242
|
let Un;
|
|
4234
4243
|
function Gr() {
|
|
@@ -5600,10 +5609,10 @@ class Ja {
|
|
|
5600
5609
|
let v = "";
|
|
5601
5610
|
switch (t.query.type) {
|
|
5602
5611
|
case _.MESSAGES:
|
|
5603
|
-
let
|
|
5604
|
-
|
|
5612
|
+
let T;
|
|
5613
|
+
T = t.data.messages.filter(
|
|
5605
5614
|
(K) => K.id !== null
|
|
5606
|
-
), t.data.messages =
|
|
5615
|
+
), t.data.messages = T, v = t.data.messages.length > 0 ? Fn(t.data.messages[0].utc) : "none", g?.hash && g.hash === v ? (G(3, [
|
|
5607
5616
|
"%cload%c %cmessages%c %cno updates",
|
|
5608
5617
|
c.OK,
|
|
5609
5618
|
c.NONE,
|
|
@@ -5809,8 +5818,8 @@ class Ja {
|
|
|
5809
5818
|
getDashboards = async (t) => await this.sm?.getDashboards();
|
|
5810
5819
|
setDashboard = async (t) => await this.sm?.setDashboard(t);
|
|
5811
5820
|
loadImages = async (t) => await this.api.loadImages(t);
|
|
5812
|
-
storeImage = async (t) => await this.api.storeImage(t);
|
|
5813
|
-
deleteImage = async (t) => await this.api.deleteImage(t);
|
|
5821
|
+
storeImage = async (t, o) => await this.api.storeImage(t, o);
|
|
5822
|
+
deleteImage = async (t, o) => await this.api.deleteImage(t, o);
|
|
5814
5823
|
getImages = async (t) => await this.sm?.getImages(t);
|
|
5815
5824
|
setImage = async (t) => await this.sm?.setImage(t);
|
|
5816
5825
|
}
|