buzzcasting-storage 1.0.10 → 1.0.12
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.esm.js +11 -11
- package/package.json +1 -1
|
@@ -34,15 +34,13 @@ class hr {
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
async get(e) {
|
|
37
|
-
|
|
38
|
-
const r = this.auth(), s = this.csrf();
|
|
39
|
-
n = { ...r, ...s };
|
|
37
|
+
const n = this.auth(), r = this.csrf(), s = { ...n, ...r };
|
|
40
38
|
let i = Object.assign({}, e);
|
|
41
39
|
delete i.type;
|
|
42
40
|
const o = Object.keys(i).length > 0 ? "?" + new URLSearchParams(i).toString() : "";
|
|
43
41
|
return await fetch(
|
|
44
42
|
[this.url, "api", this.options.version, e.type].join("/") + o,
|
|
45
|
-
{ ...
|
|
43
|
+
{ ...s, method: "get" }
|
|
46
44
|
).then((a) => {
|
|
47
45
|
if (!a.ok)
|
|
48
46
|
throw Error(a.statusText);
|
|
@@ -2860,7 +2858,9 @@ class rs {
|
|
|
2860
2858
|
});
|
|
2861
2859
|
});
|
|
2862
2860
|
k(this, "getMessages", async (e) => {
|
|
2863
|
-
const n = (l) => l.widget_id === e.widget, r = (l) => l.utc > ((e == null ? void 0 : e.since) || 0), s = (l) => !l.hasOwnProperty("visible") || (l == null ? void 0 : l.visible) !== 0, i = await this.db.table("topics").orderBy("utc").reverse().filter(n).filter(r).filter(s).limit((e == null ? void 0 : e.limit) ?? 25).toArray(), o = i[0].title || "No results", a = i.map(
|
|
2861
|
+
const n = (l) => l.widget_id === e.widget, r = (l) => l.utc > ((e == null ? void 0 : e.since) || 0), s = (l) => !l.hasOwnProperty("visible") || (l == null ? void 0 : l.visible) !== 0, i = await this.db.table("topics").orderBy("utc").reverse().filter(n).filter(r).filter(s).limit((e == null ? void 0 : e.limit) ?? 25).toArray(), o = i[0].title || "No results", a = i.map(
|
|
2862
|
+
(l) => l.message_id
|
|
2863
|
+
), c = await this.db.table("messages").where("id").anyOf(a).toArray().then((l) => l.sort(function(u, d) {
|
|
2864
2864
|
return d.utc - u.utc;
|
|
2865
2865
|
}));
|
|
2866
2866
|
return {
|
|
@@ -2886,7 +2886,9 @@ class rs {
|
|
|
2886
2886
|
const s = (r = e.topics) == null ? void 0 : r.split("-");
|
|
2887
2887
|
e.dashboard = s ? s[0] : "", e.widget = s ? s[1] : "";
|
|
2888
2888
|
}
|
|
2889
|
-
this.subscribers.filter(
|
|
2889
|
+
this.subscribers.filter(
|
|
2890
|
+
(s) => s.widget == e.widget
|
|
2891
|
+
).length > 0 || (e.type === be && (e = Je(this.options, e)), console.log("[storage] subscribe", e), this.subscribers.push(e));
|
|
2890
2892
|
});
|
|
2891
2893
|
this.options = e, this.db = new me(e.app), this.db.version(2).stores({
|
|
2892
2894
|
player: "id,title,name,location",
|
|
@@ -3115,13 +3117,11 @@ class cs {
|
|
|
3115
3117
|
k(this, "options");
|
|
3116
3118
|
k(this, "setCloud", async (e, n) => {
|
|
3117
3119
|
const r = B(e);
|
|
3118
|
-
window.BuzzCasting.WidgetData[r] = n, await new Promise((s, i) => s(
|
|
3119
|
-
window.BuzzCasting.WidgetData[r] = n;
|
|
3120
|
-
}));
|
|
3120
|
+
window.BuzzCasting.WidgetData[r] = n, await new Promise((s, i) => s());
|
|
3121
3121
|
});
|
|
3122
3122
|
k(this, "getCloud", async (e) => {
|
|
3123
|
-
const n = B(e);
|
|
3124
|
-
return await new Promise((
|
|
3123
|
+
const n = B(e), r = window.BuzzCasting.WidgetData[n];
|
|
3124
|
+
return await new Promise((s, i) => s(r));
|
|
3125
3125
|
});
|
|
3126
3126
|
k(this, "setSeries", async (e, n) => {
|
|
3127
3127
|
const r = B(e);
|