@ztimson/momentum 0.39.2 → 0.39.3

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/index.cjs CHANGED
@@ -5,10 +5,10 @@
5
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
6
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
7
7
 
8
- var et = Object.defineProperty;
9
- var nt = (n, t, e) => t in n ? et(n, t, { enumerable: true, configurable: true, writable: true, value: e }) : n[t] = e;
10
- var i = (n, t, e) => (nt(n, typeof t != "symbol" ? t + "" : t, e), e);
11
- function rt(n, t = false) {
8
+ var nt = Object.defineProperty;
9
+ var rt = (n, t, e) => t in n ? nt(n, t, { enumerable: true, configurable: true, writable: true, value: e }) : n[t] = e;
10
+ var i = (n, t, e) => (rt(n, typeof t != "symbol" ? t + "" : t, e), e);
11
+ function ot(n, t = false) {
12
12
  if (n == null)
13
13
  throw new Error("Cannot clean a NULL value");
14
14
  return Array.isArray(n) ? n = n.filter((e) => e != null) : Object.entries(n).forEach(([e, r]) => {
@@ -26,6 +26,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
26
26
  return n;
27
27
  }
28
28
  }
29
+ function ut(n) {
30
+ return Array.isArray(n) ? n : [n];
31
+ }
29
32
  class m extends Promise {
30
33
  constructor(e) {
31
34
  super((r, o) => e(
@@ -63,14 +66,15 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
63
66
  return this.from(super.finally(e));
64
67
  }
65
68
  }
66
- function at(n, t) {
67
- const e = document.createElement("a");
68
- e.href = n, e.download = t, document.body.appendChild(e), e.click(), document.body.removeChild(e);
69
- }
70
69
  function Tt(n, t) {
70
+ n instanceof Blob || (n = new Blob(ut(n)));
71
71
  const e = URL.createObjectURL(n);
72
72
  at(e, t), URL.revokeObjectURL(e);
73
73
  }
74
+ function at(n, t) {
75
+ const e = document.createElement("a");
76
+ e.href = n, e.download = t || n.split("/").pop(), document.body.appendChild(e), e.click(), document.body.removeChild(e);
77
+ }
74
78
  function It(n = {}) {
75
79
  return new Promise((t) => {
76
80
  const e = document.createElement("input");
@@ -79,13 +83,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
79
83
  }, document.body.appendChild(e), e.click();
80
84
  });
81
85
  }
82
- function $t(n) {
86
+ function Dt(n) {
83
87
  return new m((t, e, r) => {
84
88
  const o = new XMLHttpRequest(), s = new FormData();
85
89
  n.files.forEach((c) => s.append("file", c)), o.withCredentials = !!n.withCredentials, o.upload.addEventListener("progress", (c) => c.lengthComputable ? r(c.loaded / c.total) : null), o.addEventListener("loadend", () => t(U(o.responseText))), o.addEventListener("error", () => e(U(o.responseText))), o.addEventListener("timeout", () => e({ error: "Request timed out" })), o.open("POST", n.url), Object.entries(n.headers || {}).forEach(([c, y]) => o.setRequestHeader(c, y)), o.send(s);
86
90
  });
87
91
  }
88
- class F {
92
+ class v {
89
93
  constructor() {
90
94
  i(this, "listeners", {});
91
95
  }
@@ -126,7 +130,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
126
130
  });
127
131
  }
128
132
  }
129
- i(F, "listeners", {});
133
+ i(v, "listeners", {});
130
134
  class p extends Error {
131
135
  constructor(e, r) {
132
136
  super(e);
@@ -155,7 +159,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
155
159
  }
156
160
  }
157
161
  i(p, "code", 500);
158
- class v extends p {
162
+ class Y extends p {
159
163
  constructor(t = "Bad Request") {
160
164
  super(t);
161
165
  }
@@ -163,8 +167,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
163
167
  return t.constructor.code == this.code;
164
168
  }
165
169
  }
166
- i(v, "code", 400);
167
- class Y extends p {
170
+ i(Y, "code", 400);
171
+ class H extends p {
168
172
  constructor(t = "Unauthorized") {
169
173
  super(t);
170
174
  }
@@ -172,8 +176,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
172
176
  return t.constructor.code == this.code;
173
177
  }
174
178
  }
175
- i(Y, "code", 401);
176
- class H extends p {
179
+ i(H, "code", 401);
180
+ class W extends p {
177
181
  constructor(t = "Payment Required") {
178
182
  super(t);
179
183
  }
@@ -181,8 +185,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
181
185
  return t.constructor.code == this.code;
182
186
  }
183
187
  }
184
- i(H, "code", 402);
185
- class W extends p {
188
+ i(W, "code", 402);
189
+ class z extends p {
186
190
  constructor(t = "Forbidden") {
187
191
  super(t);
188
192
  }
@@ -190,8 +194,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
190
194
  return t.constructor.code == this.code;
191
195
  }
192
196
  }
193
- i(W, "code", 403);
194
- class z extends p {
197
+ i(z, "code", 403);
198
+ class J extends p {
195
199
  constructor(t = "Not Found") {
196
200
  super(t);
197
201
  }
@@ -199,8 +203,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
199
203
  return t.constructor.code == this.code;
200
204
  }
201
205
  }
202
- i(z, "code", 404);
203
- class J extends p {
206
+ i(J, "code", 404);
207
+ class K extends p {
204
208
  constructor(t = "Method Not Allowed") {
205
209
  super(t);
206
210
  }
@@ -208,8 +212,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
208
212
  return t.constructor.code == this.code;
209
213
  }
210
214
  }
211
- i(J, "code", 405);
212
- class K extends p {
215
+ i(K, "code", 405);
216
+ class Z extends p {
213
217
  constructor(t = "Not Acceptable") {
214
218
  super(t);
215
219
  }
@@ -217,8 +221,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
217
221
  return t.constructor.code == this.code;
218
222
  }
219
223
  }
220
- i(K, "code", 406);
221
- class Z extends p {
224
+ i(Z, "code", 406);
225
+ class V extends p {
222
226
  constructor(t = "Internal Server Error") {
223
227
  super(t);
224
228
  }
@@ -226,8 +230,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
226
230
  return t.constructor.code == this.code;
227
231
  }
228
232
  }
229
- i(Z, "code", 500);
230
- class V extends p {
233
+ i(V, "code", 500);
234
+ class X extends p {
231
235
  constructor(t = "Not Implemented") {
232
236
  super(t);
233
237
  }
@@ -235,8 +239,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
235
239
  return t.constructor.code == this.code;
236
240
  }
237
241
  }
238
- i(V, "code", 501);
239
- class X extends p {
242
+ i(X, "code", 501);
243
+ class Q extends p {
240
244
  constructor(t = "Bad Gateway") {
241
245
  super(t);
242
246
  }
@@ -244,8 +248,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
244
248
  return t.constructor.code == this.code;
245
249
  }
246
250
  }
247
- i(X, "code", 502);
248
- class Q extends p {
251
+ i(Q, "code", 502);
252
+ class _ extends p {
249
253
  constructor(t = "Service Unavailable") {
250
254
  super(t);
251
255
  }
@@ -253,8 +257,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
253
257
  return t.constructor.code == this.code;
254
258
  }
255
259
  }
256
- i(Q, "code", 503);
257
- class _ extends p {
260
+ i(_, "code", 503);
261
+ class tt extends p {
258
262
  constructor(t = "Gateway Timeout") {
259
263
  super(t);
260
264
  }
@@ -262,7 +266,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
262
266
  return t.constructor.code == this.code;
263
267
  }
264
268
  }
265
- i(_, "code", 504);
269
+ i(tt, "code", 504);
266
270
  const w = class w2 {
267
271
  constructor(t = {}) {
268
272
  i(this, "interceptors", {});
@@ -291,7 +295,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
291
295
  const s = Array.isArray(t.query) ? t.query : Object.keys(t.query).map((c) => ({ key: c, value: t.query[c] }));
292
296
  e += (e.includes("?") ? "&" : "?") + s.map((c) => `${c.key}=${c.value}`).join("&");
293
297
  }
294
- const r = rt({
298
+ const r = ot({
295
299
  "Content-Type": t.body ? t.body instanceof FormData ? "multipart/form-data" : "application/json" : void 0,
296
300
  ...w2.headers,
297
301
  ...this.headers,
@@ -302,36 +306,36 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
302
306
  headers: r,
303
307
  method: t.method || (t.body ? "POST" : "GET"),
304
308
  body: t.body
305
- }).then(async (a) => {
306
- var M, j;
307
- for (let u of [...Object.values(w2.interceptors), ...Object.values(this.interceptors)])
308
- await new Promise((O) => u(a, () => O()));
309
- const R = a.headers.get("Content-Length"), N = R ? parseInt(R, 10) : 0;
310
- let k = 0;
311
- const T = (M = a.body) == null ? void 0 : M.getReader(), tt = new ReadableStream({
312
- start(u) {
309
+ }).then(async (u) => {
310
+ var j, k;
311
+ for (let a of [...Object.values(w2.interceptors), ...Object.values(this.interceptors)])
312
+ await new Promise((O) => a(u, () => O()));
313
+ const R = u.headers.get("Content-Length"), C = R ? parseInt(R, 10) : 0;
314
+ let D = 0;
315
+ const N = (j = u.body) == null ? void 0 : j.getReader(), et = new ReadableStream({
316
+ start(a) {
313
317
  function O() {
314
- T == null || T.read().then((x) => {
315
- if (x.done)
316
- return u.close();
317
- k += x.value.byteLength, y(k / N), u.enqueue(x.value), O();
318
- }).catch((x) => u.error(x));
318
+ N == null || N.read().then((B) => {
319
+ if (B.done)
320
+ return a.close();
321
+ D += B.value.byteLength, y(D / C), a.enqueue(B.value), O();
322
+ }).catch((B) => a.error(B));
319
323
  }
320
324
  O();
321
325
  }
322
326
  });
323
- if (a.data = new Response(tt), t.decode == null || t.decode) {
324
- const u = (j = a.headers.get("Content-Type")) == null ? void 0 : j.toLowerCase();
325
- u != null && u.includes("form") ? a.data = await a.data.formData() : u != null && u.includes("json") ? a.data = await a.data.json() : u != null && u.includes("text") ? a.data = await a.data.text() : u != null && u.includes("application") && (a.data = await a.data.blob());
327
+ if (u.data = new Response(et), t.decode == null || t.decode) {
328
+ const a = (k = u.headers.get("Content-Type")) == null ? void 0 : k.toLowerCase();
329
+ a != null && a.includes("form") ? u.data = await u.data.formData() : a != null && a.includes("json") ? u.data = await u.data.json() : a != null && a.includes("text") ? u.data = await u.data.text() : a != null && a.includes("application") && (u.data = await u.data.blob());
326
330
  }
327
- a.ok ? s(a) : c(a);
331
+ u.ok ? s(u) : c(u);
328
332
  });
329
333
  });
330
334
  }
331
335
  };
332
336
  i(w, "interceptors", {}), i(w, "headers", {});
333
337
  let q = w;
334
- const B = {
338
+ const S = {
335
339
  CLEAR: "\x1B[0m",
336
340
  BRIGHT: "\x1B[1m",
337
341
  DIM: "\x1B[2m",
@@ -339,7 +343,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
339
343
  BLINK: "\x1B[5m",
340
344
  REVERSE: "\x1B[7m",
341
345
  HIDDEN: "\x1B[8m"
342
- }, L = {
346
+ }, $ = {
343
347
  BLACK: "\x1B[30m",
344
348
  RED: "\x1B[31m",
345
349
  GREEN: "\x1B[32m",
@@ -357,8 +361,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
357
361
  LIGHT_CYAN: "\x1B[96m",
358
362
  WHITE: "\x1B[97m"
359
363
  };
360
- var ut = /* @__PURE__ */ ((n) => (n[n.ERROR = 0] = "ERROR", n[n.WARN = 1] = "WARN", n[n.INFO = 2] = "INFO", n[n.LOG = 3] = "LOG", n[n.DEBUG = 4] = "DEBUG", n))(ut || {});
361
- const g = class g2 extends F {
364
+ var lt = /* @__PURE__ */ ((n) => (n[n.ERROR = 0] = "ERROR", n[n.WARN = 1] = "WARN", n[n.INFO = 2] = "INFO", n[n.LOG = 3] = "LOG", n[n.DEBUG = 4] = "DEBUG", n))(lt || {});
365
+ const g = class g2 extends v {
362
366
  constructor(t) {
363
367
  super(), this.namespace = t;
364
368
  }
@@ -377,31 +381,31 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
377
381
  if (g2.LOG_LEVEL < 4)
378
382
  return;
379
383
  const e = this.format(...t);
380
- g2.emit(4, e), console.debug(L.LIGHT_GREY + e + B.CLEAR);
384
+ g2.emit(4, e), console.debug($.LIGHT_GREY + e + S.CLEAR);
381
385
  }
382
386
  log(...t) {
383
387
  if (g2.LOG_LEVEL < 3)
384
388
  return;
385
389
  const e = this.format(...t);
386
- g2.emit(3, e), console.log(B.CLEAR + e);
390
+ g2.emit(3, e), console.log(S.CLEAR + e);
387
391
  }
388
392
  info(...t) {
389
393
  if (g2.LOG_LEVEL < 2)
390
394
  return;
391
395
  const e = this.format(...t);
392
- g2.emit(2, e), console.info(L.BLUE + e + B.CLEAR);
396
+ g2.emit(2, e), console.info($.BLUE + e + S.CLEAR);
393
397
  }
394
398
  warn(...t) {
395
399
  if (g2.LOG_LEVEL < 1)
396
400
  return;
397
401
  const e = this.format(...t);
398
- g2.emit(1, e), console.warn(L.YELLOW + e + B.CLEAR);
402
+ g2.emit(1, e), console.warn($.YELLOW + e + S.CLEAR);
399
403
  }
400
404
  error(...t) {
401
405
  if (g2.LOG_LEVEL < 0)
402
406
  return;
403
407
  const e = this.format(...t);
404
- g2.emit(0, e), console.error(L.RED + e + B.CLEAR);
408
+ g2.emit(0, e), console.error($.RED + e + S.CLEAR);
405
409
  }
406
410
  };
407
411
  i(g, "LOG_LEVEL", 4);
@@ -409,7 +413,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
409
413
  constructor(url = location.origin, opts = {}) {
410
414
  opts.url = url;
411
415
  super(opts);
412
- __publicField(this, "emitter", new F());
416
+ __publicField(this, "emitter", new v());
413
417
  __publicField(this, "_token", null);
414
418
  __publicField(this, "emit", this.emitter.emit.bind(this.emitter));
415
419
  __publicField(this, "off", this.emitter.off.bind(this.emitter));
@@ -1162,7 +1166,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1162
1166
  ActionType2[ActionType2["PUT"] = 6] = "PUT";
1163
1167
  return ActionType2;
1164
1168
  })(ActionType || {});
1165
- class Actions extends F {
1169
+ class Actions extends v {
1166
1170
  constructor(api) {
1167
1171
  super();
1168
1172
  __publicField(this, "api");
@@ -1222,7 +1226,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1222
1226
  });
1223
1227
  }
1224
1228
  }
1225
- class Ai extends F {
1229
+ class Ai extends v {
1226
1230
  constructor(api) {
1227
1231
  super();
1228
1232
  __publicField(this, "api");
@@ -1241,7 +1245,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1241
1245
  return this.api.request({ url: "/api/ai", method: "DELETE" });
1242
1246
  }
1243
1247
  }
1244
- class Analytics extends F {
1248
+ class Analytics extends v {
1245
1249
  constructor(api) {
1246
1250
  super();
1247
1251
  __publicField(this, "api");
@@ -1266,13 +1270,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1266
1270
  return this.api.request({ url: `/api/auth/totp/${username}`, method: "POST" });
1267
1271
  }
1268
1272
  setup(username, method = "app", totp) {
1269
- return this.api.request({ url: `/api/auth/totp/${username}`, body: rt({
1273
+ return this.api.request({ url: `/api/auth/totp/${username}`, body: ot({
1270
1274
  method,
1271
1275
  totp
1272
1276
  }) });
1273
1277
  }
1274
1278
  }
1275
- class Auth extends F {
1279
+ class Auth extends v {
1276
1280
  constructor(api, opts = {}) {
1277
1281
  super();
1278
1282
  __publicField(this, "api");
@@ -1412,7 +1416,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1412
1416
  });
1413
1417
  }
1414
1418
  }
1415
- class Data extends F {
1419
+ class Data extends v {
1416
1420
  constructor(api) {
1417
1421
  super();
1418
1422
  __publicField(this, "api");
@@ -1456,7 +1460,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1456
1460
  });
1457
1461
  }
1458
1462
  }
1459
- class Email extends F {
1463
+ class Email extends v {
1460
1464
  constructor(api) {
1461
1465
  super();
1462
1466
  __publicField(this, "api");
@@ -1471,7 +1475,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1471
1475
  });
1472
1476
  }
1473
1477
  }
1474
- class Groups extends F {
1478
+ class Groups extends v {
1475
1479
  constructor(api) {
1476
1480
  super();
1477
1481
  __publicField(this, "api");
@@ -1564,32 +1568,32 @@ ${log}`;
1564
1568
  return this.api.request({ url: `/api/logs/server${query ? `?${query}` : ""}` }).then((resp) => resp);
1565
1569
  }
1566
1570
  debug(...logs) {
1567
- return this.api.request({ url: `/api/logs/client`, body: this.buildLog(ut.DEBUG, logs) }).then(() => {
1571
+ return this.api.request({ url: `/api/logs/client`, body: this.buildLog(lt.DEBUG, logs) }).then(() => {
1568
1572
  }).catch(() => {
1569
1573
  });
1570
1574
  }
1571
1575
  log(...logs) {
1572
- return this.api.request({ url: `/api/logs/client`, body: this.buildLog(ut.LOG, logs) }).then(() => {
1576
+ return this.api.request({ url: `/api/logs/client`, body: this.buildLog(lt.LOG, logs) }).then(() => {
1573
1577
  }).catch(() => {
1574
1578
  });
1575
1579
  }
1576
1580
  info(...logs) {
1577
- return this.api.request({ url: `/api/logs/client`, body: this.buildLog(ut.INFO, logs) }).then(() => {
1581
+ return this.api.request({ url: `/api/logs/client`, body: this.buildLog(lt.INFO, logs) }).then(() => {
1578
1582
  }).catch(() => {
1579
1583
  });
1580
1584
  }
1581
1585
  warn(...logs) {
1582
- return this.api.request({ url: `/api/logs/client`, body: this.buildLog(ut.WARN, logs) }).then(() => {
1586
+ return this.api.request({ url: `/api/logs/client`, body: this.buildLog(lt.WARN, logs) }).then(() => {
1583
1587
  }).catch(() => {
1584
1588
  });
1585
1589
  }
1586
1590
  error(...logs) {
1587
- return this.api.request({ url: `/api/logs/client`, body: this.buildLog(ut.ERROR, logs) }).then(() => {
1591
+ return this.api.request({ url: `/api/logs/client`, body: this.buildLog(lt.ERROR, logs) }).then(() => {
1588
1592
  }).catch(() => {
1589
1593
  });
1590
1594
  }
1591
1595
  }
1592
- class Payments extends F {
1596
+ class Payments extends v {
1593
1597
  constructor(api, secret) {
1594
1598
  super();
1595
1599
  __publicField(this, "api");
@@ -1630,7 +1634,7 @@ ${log}`;
1630
1634
  return history;
1631
1635
  }
1632
1636
  }
1633
- class Pdf extends F {
1637
+ class Pdf extends v {
1634
1638
  constructor(api) {
1635
1639
  super();
1636
1640
  __publicField(this, "api");
@@ -1703,7 +1707,7 @@ ${log}`;
1703
1707
  };
1704
1708
  __publicField(_Socket, "timeout", 1e4);
1705
1709
  let Socket = _Socket;
1706
- class Storage extends F {
1710
+ class Storage extends v {
1707
1711
  constructor(api) {
1708
1712
  super();
1709
1713
  __publicField(this, "api");
@@ -1766,9 +1770,9 @@ ${log}`;
1766
1770
  if (!files) files = await It(typeof opts == "object" ? opts : void 0);
1767
1771
  if (!files || Array.isArray(files) && !files.length) return [];
1768
1772
  const path = this.api.path("/api/storage/", typeof opts == "string" ? opts : opts.path || "");
1769
- return $t({
1773
+ return Dt({
1770
1774
  url: `${this.api.url}${path}`,
1771
- files: Array.isArray(files) ? files : [files],
1775
+ files: ut(files),
1772
1776
  headers: this.api.headers
1773
1777
  }).onProgress((p2) => {
1774
1778
  prog(p2);
@@ -1983,7 +1987,7 @@ ${log}`;
1983
1987
  }, 1e3);
1984
1988
  }
1985
1989
  }
1986
- class Users extends F {
1990
+ class Users extends v {
1987
1991
  constructor(api) {
1988
1992
  super();
1989
1993
  __publicField(this, "api");
@@ -2048,7 +2052,7 @@ ${log}`;
2048
2052
  });
2049
2053
  }
2050
2054
  uploadImage(username, file) {
2051
- return $t({
2055
+ return Dt({
2052
2056
  url: this.api.url + `/api/users/${username}/image`,
2053
2057
  files: [file],
2054
2058
  headers: this.api.headers
@@ -2058,7 +2062,7 @@ ${log}`;
2058
2062
  });
2059
2063
  }
2060
2064
  }
2061
- class Settings extends F {
2065
+ class Settings extends v {
2062
2066
  constructor(api) {
2063
2067
  super();
2064
2068
  __publicField(this, "api");
@@ -2100,7 +2104,7 @@ ${log}`;
2100
2104
  });
2101
2105
  }
2102
2106
  }
2103
- class Static extends F {
2107
+ class Static extends v {
2104
2108
  constructor(api) {
2105
2109
  super();
2106
2110
  __publicField(this, "api");
@@ -2113,9 +2117,9 @@ ${log}`;
2113
2117
  }
2114
2118
  upload(files, path = "/") {
2115
2119
  return new m(async (res, rej, prog) => {
2116
- return $t({
2120
+ return Dt({
2117
2121
  url: this.api.url + ("/api/static/" + path).replaceAll("//", "/"),
2118
- files: Array.isArray(files) ? files : [files],
2122
+ files: ut(files),
2119
2123
  headers: this.api.headers
2120
2124
  }).onProgress((p2) => {
2121
2125
  prog(p2);
@@ -2126,7 +2130,7 @@ ${log}`;
2126
2130
  });
2127
2131
  }
2128
2132
  }
2129
- class Momentum extends F {
2133
+ class Momentum extends v {
2130
2134
  constructor(url, opts) {
2131
2135
  super();
2132
2136
  __publicField(this, "api");
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- var et = Object.defineProperty;
5
- var nt = (n, t, e) => t in n ? et(n, t, { enumerable: true, configurable: true, writable: true, value: e }) : n[t] = e;
6
- var i = (n, t, e) => (nt(n, typeof t != "symbol" ? t + "" : t, e), e);
7
- function rt(n, t = false) {
4
+ var nt = Object.defineProperty;
5
+ var rt = (n, t, e) => t in n ? nt(n, t, { enumerable: true, configurable: true, writable: true, value: e }) : n[t] = e;
6
+ var i = (n, t, e) => (rt(n, typeof t != "symbol" ? t + "" : t, e), e);
7
+ function ot(n, t = false) {
8
8
  if (n == null)
9
9
  throw new Error("Cannot clean a NULL value");
10
10
  return Array.isArray(n) ? n = n.filter((e) => e != null) : Object.entries(n).forEach(([e, r]) => {
@@ -22,6 +22,9 @@ function U(n) {
22
22
  return n;
23
23
  }
24
24
  }
25
+ function ut(n) {
26
+ return Array.isArray(n) ? n : [n];
27
+ }
25
28
  class m extends Promise {
26
29
  constructor(e) {
27
30
  super((r, o) => e(
@@ -59,14 +62,15 @@ class m extends Promise {
59
62
  return this.from(super.finally(e));
60
63
  }
61
64
  }
62
- function at(n, t) {
63
- const e = document.createElement("a");
64
- e.href = n, e.download = t, document.body.appendChild(e), e.click(), document.body.removeChild(e);
65
- }
66
65
  function Tt(n, t) {
66
+ n instanceof Blob || (n = new Blob(ut(n)));
67
67
  const e = URL.createObjectURL(n);
68
68
  at(e, t), URL.revokeObjectURL(e);
69
69
  }
70
+ function at(n, t) {
71
+ const e = document.createElement("a");
72
+ e.href = n, e.download = t || n.split("/").pop(), document.body.appendChild(e), e.click(), document.body.removeChild(e);
73
+ }
70
74
  function It(n = {}) {
71
75
  return new Promise((t) => {
72
76
  const e = document.createElement("input");
@@ -75,13 +79,13 @@ function It(n = {}) {
75
79
  }, document.body.appendChild(e), e.click();
76
80
  });
77
81
  }
78
- function $t(n) {
82
+ function Dt(n) {
79
83
  return new m((t, e, r) => {
80
84
  const o = new XMLHttpRequest(), s = new FormData();
81
85
  n.files.forEach((c) => s.append("file", c)), o.withCredentials = !!n.withCredentials, o.upload.addEventListener("progress", (c) => c.lengthComputable ? r(c.loaded / c.total) : null), o.addEventListener("loadend", () => t(U(o.responseText))), o.addEventListener("error", () => e(U(o.responseText))), o.addEventListener("timeout", () => e({ error: "Request timed out" })), o.open("POST", n.url), Object.entries(n.headers || {}).forEach(([c, y]) => o.setRequestHeader(c, y)), o.send(s);
82
86
  });
83
87
  }
84
- class F {
88
+ class v {
85
89
  constructor() {
86
90
  i(this, "listeners", {});
87
91
  }
@@ -122,7 +126,7 @@ class F {
122
126
  });
123
127
  }
124
128
  }
125
- i(F, "listeners", {});
129
+ i(v, "listeners", {});
126
130
  class p extends Error {
127
131
  constructor(e, r) {
128
132
  super(e);
@@ -151,7 +155,7 @@ class p extends Error {
151
155
  }
152
156
  }
153
157
  i(p, "code", 500);
154
- class v extends p {
158
+ class Y extends p {
155
159
  constructor(t = "Bad Request") {
156
160
  super(t);
157
161
  }
@@ -159,8 +163,8 @@ class v extends p {
159
163
  return t.constructor.code == this.code;
160
164
  }
161
165
  }
162
- i(v, "code", 400);
163
- class Y extends p {
166
+ i(Y, "code", 400);
167
+ class H extends p {
164
168
  constructor(t = "Unauthorized") {
165
169
  super(t);
166
170
  }
@@ -168,8 +172,8 @@ class Y extends p {
168
172
  return t.constructor.code == this.code;
169
173
  }
170
174
  }
171
- i(Y, "code", 401);
172
- class H extends p {
175
+ i(H, "code", 401);
176
+ class W extends p {
173
177
  constructor(t = "Payment Required") {
174
178
  super(t);
175
179
  }
@@ -177,8 +181,8 @@ class H extends p {
177
181
  return t.constructor.code == this.code;
178
182
  }
179
183
  }
180
- i(H, "code", 402);
181
- class W extends p {
184
+ i(W, "code", 402);
185
+ class z extends p {
182
186
  constructor(t = "Forbidden") {
183
187
  super(t);
184
188
  }
@@ -186,8 +190,8 @@ class W extends p {
186
190
  return t.constructor.code == this.code;
187
191
  }
188
192
  }
189
- i(W, "code", 403);
190
- class z extends p {
193
+ i(z, "code", 403);
194
+ class J extends p {
191
195
  constructor(t = "Not Found") {
192
196
  super(t);
193
197
  }
@@ -195,8 +199,8 @@ class z extends p {
195
199
  return t.constructor.code == this.code;
196
200
  }
197
201
  }
198
- i(z, "code", 404);
199
- class J extends p {
202
+ i(J, "code", 404);
203
+ class K extends p {
200
204
  constructor(t = "Method Not Allowed") {
201
205
  super(t);
202
206
  }
@@ -204,8 +208,8 @@ class J extends p {
204
208
  return t.constructor.code == this.code;
205
209
  }
206
210
  }
207
- i(J, "code", 405);
208
- class K extends p {
211
+ i(K, "code", 405);
212
+ class Z extends p {
209
213
  constructor(t = "Not Acceptable") {
210
214
  super(t);
211
215
  }
@@ -213,8 +217,8 @@ class K extends p {
213
217
  return t.constructor.code == this.code;
214
218
  }
215
219
  }
216
- i(K, "code", 406);
217
- class Z extends p {
220
+ i(Z, "code", 406);
221
+ class V extends p {
218
222
  constructor(t = "Internal Server Error") {
219
223
  super(t);
220
224
  }
@@ -222,8 +226,8 @@ class Z extends p {
222
226
  return t.constructor.code == this.code;
223
227
  }
224
228
  }
225
- i(Z, "code", 500);
226
- class V extends p {
229
+ i(V, "code", 500);
230
+ class X extends p {
227
231
  constructor(t = "Not Implemented") {
228
232
  super(t);
229
233
  }
@@ -231,8 +235,8 @@ class V extends p {
231
235
  return t.constructor.code == this.code;
232
236
  }
233
237
  }
234
- i(V, "code", 501);
235
- class X extends p {
238
+ i(X, "code", 501);
239
+ class Q extends p {
236
240
  constructor(t = "Bad Gateway") {
237
241
  super(t);
238
242
  }
@@ -240,8 +244,8 @@ class X extends p {
240
244
  return t.constructor.code == this.code;
241
245
  }
242
246
  }
243
- i(X, "code", 502);
244
- class Q extends p {
247
+ i(Q, "code", 502);
248
+ class _ extends p {
245
249
  constructor(t = "Service Unavailable") {
246
250
  super(t);
247
251
  }
@@ -249,8 +253,8 @@ class Q extends p {
249
253
  return t.constructor.code == this.code;
250
254
  }
251
255
  }
252
- i(Q, "code", 503);
253
- class _ extends p {
256
+ i(_, "code", 503);
257
+ class tt extends p {
254
258
  constructor(t = "Gateway Timeout") {
255
259
  super(t);
256
260
  }
@@ -258,7 +262,7 @@ class _ extends p {
258
262
  return t.constructor.code == this.code;
259
263
  }
260
264
  }
261
- i(_, "code", 504);
265
+ i(tt, "code", 504);
262
266
  const w = class w2 {
263
267
  constructor(t = {}) {
264
268
  i(this, "interceptors", {});
@@ -287,7 +291,7 @@ const w = class w2 {
287
291
  const s = Array.isArray(t.query) ? t.query : Object.keys(t.query).map((c) => ({ key: c, value: t.query[c] }));
288
292
  e += (e.includes("?") ? "&" : "?") + s.map((c) => `${c.key}=${c.value}`).join("&");
289
293
  }
290
- const r = rt({
294
+ const r = ot({
291
295
  "Content-Type": t.body ? t.body instanceof FormData ? "multipart/form-data" : "application/json" : void 0,
292
296
  ...w2.headers,
293
297
  ...this.headers,
@@ -298,36 +302,36 @@ const w = class w2 {
298
302
  headers: r,
299
303
  method: t.method || (t.body ? "POST" : "GET"),
300
304
  body: t.body
301
- }).then(async (a) => {
302
- var M, j;
303
- for (let u of [...Object.values(w2.interceptors), ...Object.values(this.interceptors)])
304
- await new Promise((O) => u(a, () => O()));
305
- const R = a.headers.get("Content-Length"), N = R ? parseInt(R, 10) : 0;
306
- let k = 0;
307
- const T = (M = a.body) == null ? void 0 : M.getReader(), tt = new ReadableStream({
308
- start(u) {
305
+ }).then(async (u) => {
306
+ var j, k;
307
+ for (let a of [...Object.values(w2.interceptors), ...Object.values(this.interceptors)])
308
+ await new Promise((O) => a(u, () => O()));
309
+ const R = u.headers.get("Content-Length"), C = R ? parseInt(R, 10) : 0;
310
+ let D = 0;
311
+ const N = (j = u.body) == null ? void 0 : j.getReader(), et = new ReadableStream({
312
+ start(a) {
309
313
  function O() {
310
- T == null || T.read().then((x) => {
311
- if (x.done)
312
- return u.close();
313
- k += x.value.byteLength, y(k / N), u.enqueue(x.value), O();
314
- }).catch((x) => u.error(x));
314
+ N == null || N.read().then((B) => {
315
+ if (B.done)
316
+ return a.close();
317
+ D += B.value.byteLength, y(D / C), a.enqueue(B.value), O();
318
+ }).catch((B) => a.error(B));
315
319
  }
316
320
  O();
317
321
  }
318
322
  });
319
- if (a.data = new Response(tt), t.decode == null || t.decode) {
320
- const u = (j = a.headers.get("Content-Type")) == null ? void 0 : j.toLowerCase();
321
- u != null && u.includes("form") ? a.data = await a.data.formData() : u != null && u.includes("json") ? a.data = await a.data.json() : u != null && u.includes("text") ? a.data = await a.data.text() : u != null && u.includes("application") && (a.data = await a.data.blob());
323
+ if (u.data = new Response(et), t.decode == null || t.decode) {
324
+ const a = (k = u.headers.get("Content-Type")) == null ? void 0 : k.toLowerCase();
325
+ a != null && a.includes("form") ? u.data = await u.data.formData() : a != null && a.includes("json") ? u.data = await u.data.json() : a != null && a.includes("text") ? u.data = await u.data.text() : a != null && a.includes("application") && (u.data = await u.data.blob());
322
326
  }
323
- a.ok ? s(a) : c(a);
327
+ u.ok ? s(u) : c(u);
324
328
  });
325
329
  });
326
330
  }
327
331
  };
328
332
  i(w, "interceptors", {}), i(w, "headers", {});
329
333
  let q = w;
330
- const B = {
334
+ const S = {
331
335
  CLEAR: "\x1B[0m",
332
336
  BRIGHT: "\x1B[1m",
333
337
  DIM: "\x1B[2m",
@@ -335,7 +339,7 @@ const B = {
335
339
  BLINK: "\x1B[5m",
336
340
  REVERSE: "\x1B[7m",
337
341
  HIDDEN: "\x1B[8m"
338
- }, L = {
342
+ }, $ = {
339
343
  BLACK: "\x1B[30m",
340
344
  RED: "\x1B[31m",
341
345
  GREEN: "\x1B[32m",
@@ -353,8 +357,8 @@ const B = {
353
357
  LIGHT_CYAN: "\x1B[96m",
354
358
  WHITE: "\x1B[97m"
355
359
  };
356
- var ut = /* @__PURE__ */ ((n) => (n[n.ERROR = 0] = "ERROR", n[n.WARN = 1] = "WARN", n[n.INFO = 2] = "INFO", n[n.LOG = 3] = "LOG", n[n.DEBUG = 4] = "DEBUG", n))(ut || {});
357
- const g = class g2 extends F {
360
+ var lt = /* @__PURE__ */ ((n) => (n[n.ERROR = 0] = "ERROR", n[n.WARN = 1] = "WARN", n[n.INFO = 2] = "INFO", n[n.LOG = 3] = "LOG", n[n.DEBUG = 4] = "DEBUG", n))(lt || {});
361
+ const g = class g2 extends v {
358
362
  constructor(t) {
359
363
  super(), this.namespace = t;
360
364
  }
@@ -373,31 +377,31 @@ const g = class g2 extends F {
373
377
  if (g2.LOG_LEVEL < 4)
374
378
  return;
375
379
  const e = this.format(...t);
376
- g2.emit(4, e), console.debug(L.LIGHT_GREY + e + B.CLEAR);
380
+ g2.emit(4, e), console.debug($.LIGHT_GREY + e + S.CLEAR);
377
381
  }
378
382
  log(...t) {
379
383
  if (g2.LOG_LEVEL < 3)
380
384
  return;
381
385
  const e = this.format(...t);
382
- g2.emit(3, e), console.log(B.CLEAR + e);
386
+ g2.emit(3, e), console.log(S.CLEAR + e);
383
387
  }
384
388
  info(...t) {
385
389
  if (g2.LOG_LEVEL < 2)
386
390
  return;
387
391
  const e = this.format(...t);
388
- g2.emit(2, e), console.info(L.BLUE + e + B.CLEAR);
392
+ g2.emit(2, e), console.info($.BLUE + e + S.CLEAR);
389
393
  }
390
394
  warn(...t) {
391
395
  if (g2.LOG_LEVEL < 1)
392
396
  return;
393
397
  const e = this.format(...t);
394
- g2.emit(1, e), console.warn(L.YELLOW + e + B.CLEAR);
398
+ g2.emit(1, e), console.warn($.YELLOW + e + S.CLEAR);
395
399
  }
396
400
  error(...t) {
397
401
  if (g2.LOG_LEVEL < 0)
398
402
  return;
399
403
  const e = this.format(...t);
400
- g2.emit(0, e), console.error(L.RED + e + B.CLEAR);
404
+ g2.emit(0, e), console.error($.RED + e + S.CLEAR);
401
405
  }
402
406
  };
403
407
  i(g, "LOG_LEVEL", 4);
@@ -405,7 +409,7 @@ class Api extends q {
405
409
  constructor(url = location.origin, opts = {}) {
406
410
  opts.url = url;
407
411
  super(opts);
408
- __publicField(this, "emitter", new F());
412
+ __publicField(this, "emitter", new v());
409
413
  __publicField(this, "_token", null);
410
414
  __publicField(this, "emit", this.emitter.emit.bind(this.emitter));
411
415
  __publicField(this, "off", this.emitter.off.bind(this.emitter));
@@ -1158,7 +1162,7 @@ var ActionType = /* @__PURE__ */ ((ActionType2) => {
1158
1162
  ActionType2[ActionType2["PUT"] = 6] = "PUT";
1159
1163
  return ActionType2;
1160
1164
  })(ActionType || {});
1161
- class Actions extends F {
1165
+ class Actions extends v {
1162
1166
  constructor(api) {
1163
1167
  super();
1164
1168
  __publicField(this, "api");
@@ -1218,7 +1222,7 @@ class Actions extends F {
1218
1222
  });
1219
1223
  }
1220
1224
  }
1221
- class Ai extends F {
1225
+ class Ai extends v {
1222
1226
  constructor(api) {
1223
1227
  super();
1224
1228
  __publicField(this, "api");
@@ -1237,7 +1241,7 @@ class Ai extends F {
1237
1241
  return this.api.request({ url: "/api/ai", method: "DELETE" });
1238
1242
  }
1239
1243
  }
1240
- class Analytics extends F {
1244
+ class Analytics extends v {
1241
1245
  constructor(api) {
1242
1246
  super();
1243
1247
  __publicField(this, "api");
@@ -1262,13 +1266,13 @@ class Totp {
1262
1266
  return this.api.request({ url: `/api/auth/totp/${username}`, method: "POST" });
1263
1267
  }
1264
1268
  setup(username, method = "app", totp) {
1265
- return this.api.request({ url: `/api/auth/totp/${username}`, body: rt({
1269
+ return this.api.request({ url: `/api/auth/totp/${username}`, body: ot({
1266
1270
  method,
1267
1271
  totp
1268
1272
  }) });
1269
1273
  }
1270
1274
  }
1271
- class Auth extends F {
1275
+ class Auth extends v {
1272
1276
  constructor(api, opts = {}) {
1273
1277
  super();
1274
1278
  __publicField(this, "api");
@@ -1408,7 +1412,7 @@ class Auth extends F {
1408
1412
  });
1409
1413
  }
1410
1414
  }
1411
- class Data extends F {
1415
+ class Data extends v {
1412
1416
  constructor(api) {
1413
1417
  super();
1414
1418
  __publicField(this, "api");
@@ -1452,7 +1456,7 @@ class Data extends F {
1452
1456
  });
1453
1457
  }
1454
1458
  }
1455
- class Email extends F {
1459
+ class Email extends v {
1456
1460
  constructor(api) {
1457
1461
  super();
1458
1462
  __publicField(this, "api");
@@ -1467,7 +1471,7 @@ class Email extends F {
1467
1471
  });
1468
1472
  }
1469
1473
  }
1470
- class Groups extends F {
1474
+ class Groups extends v {
1471
1475
  constructor(api) {
1472
1476
  super();
1473
1477
  __publicField(this, "api");
@@ -1560,32 +1564,32 @@ ${log}`;
1560
1564
  return this.api.request({ url: `/api/logs/server${query ? `?${query}` : ""}` }).then((resp) => resp);
1561
1565
  }
1562
1566
  debug(...logs) {
1563
- return this.api.request({ url: `/api/logs/client`, body: this.buildLog(ut.DEBUG, logs) }).then(() => {
1567
+ return this.api.request({ url: `/api/logs/client`, body: this.buildLog(lt.DEBUG, logs) }).then(() => {
1564
1568
  }).catch(() => {
1565
1569
  });
1566
1570
  }
1567
1571
  log(...logs) {
1568
- return this.api.request({ url: `/api/logs/client`, body: this.buildLog(ut.LOG, logs) }).then(() => {
1572
+ return this.api.request({ url: `/api/logs/client`, body: this.buildLog(lt.LOG, logs) }).then(() => {
1569
1573
  }).catch(() => {
1570
1574
  });
1571
1575
  }
1572
1576
  info(...logs) {
1573
- return this.api.request({ url: `/api/logs/client`, body: this.buildLog(ut.INFO, logs) }).then(() => {
1577
+ return this.api.request({ url: `/api/logs/client`, body: this.buildLog(lt.INFO, logs) }).then(() => {
1574
1578
  }).catch(() => {
1575
1579
  });
1576
1580
  }
1577
1581
  warn(...logs) {
1578
- return this.api.request({ url: `/api/logs/client`, body: this.buildLog(ut.WARN, logs) }).then(() => {
1582
+ return this.api.request({ url: `/api/logs/client`, body: this.buildLog(lt.WARN, logs) }).then(() => {
1579
1583
  }).catch(() => {
1580
1584
  });
1581
1585
  }
1582
1586
  error(...logs) {
1583
- return this.api.request({ url: `/api/logs/client`, body: this.buildLog(ut.ERROR, logs) }).then(() => {
1587
+ return this.api.request({ url: `/api/logs/client`, body: this.buildLog(lt.ERROR, logs) }).then(() => {
1584
1588
  }).catch(() => {
1585
1589
  });
1586
1590
  }
1587
1591
  }
1588
- class Payments extends F {
1592
+ class Payments extends v {
1589
1593
  constructor(api, secret) {
1590
1594
  super();
1591
1595
  __publicField(this, "api");
@@ -1626,7 +1630,7 @@ class Payments extends F {
1626
1630
  return history;
1627
1631
  }
1628
1632
  }
1629
- class Pdf extends F {
1633
+ class Pdf extends v {
1630
1634
  constructor(api) {
1631
1635
  super();
1632
1636
  __publicField(this, "api");
@@ -1699,7 +1703,7 @@ const _Socket = class _Socket {
1699
1703
  };
1700
1704
  __publicField(_Socket, "timeout", 1e4);
1701
1705
  let Socket = _Socket;
1702
- class Storage extends F {
1706
+ class Storage extends v {
1703
1707
  constructor(api) {
1704
1708
  super();
1705
1709
  __publicField(this, "api");
@@ -1762,9 +1766,9 @@ class Storage extends F {
1762
1766
  if (!files) files = await It(typeof opts == "object" ? opts : void 0);
1763
1767
  if (!files || Array.isArray(files) && !files.length) return [];
1764
1768
  const path = this.api.path("/api/storage/", typeof opts == "string" ? opts : opts.path || "");
1765
- return $t({
1769
+ return Dt({
1766
1770
  url: `${this.api.url}${path}`,
1767
- files: Array.isArray(files) ? files : [files],
1771
+ files: ut(files),
1768
1772
  headers: this.api.headers
1769
1773
  }).onProgress((p2) => {
1770
1774
  prog(p2);
@@ -1979,7 +1983,7 @@ class UI {
1979
1983
  }, 1e3);
1980
1984
  }
1981
1985
  }
1982
- class Users extends F {
1986
+ class Users extends v {
1983
1987
  constructor(api) {
1984
1988
  super();
1985
1989
  __publicField(this, "api");
@@ -2044,7 +2048,7 @@ class Users extends F {
2044
2048
  });
2045
2049
  }
2046
2050
  uploadImage(username, file) {
2047
- return $t({
2051
+ return Dt({
2048
2052
  url: this.api.url + `/api/users/${username}/image`,
2049
2053
  files: [file],
2050
2054
  headers: this.api.headers
@@ -2054,7 +2058,7 @@ class Users extends F {
2054
2058
  });
2055
2059
  }
2056
2060
  }
2057
- class Settings extends F {
2061
+ class Settings extends v {
2058
2062
  constructor(api) {
2059
2063
  super();
2060
2064
  __publicField(this, "api");
@@ -2096,7 +2100,7 @@ class Settings extends F {
2096
2100
  });
2097
2101
  }
2098
2102
  }
2099
- class Static extends F {
2103
+ class Static extends v {
2100
2104
  constructor(api) {
2101
2105
  super();
2102
2106
  __publicField(this, "api");
@@ -2109,9 +2113,9 @@ class Static extends F {
2109
2113
  }
2110
2114
  upload(files, path = "/") {
2111
2115
  return new m(async (res, rej, prog) => {
2112
- return $t({
2116
+ return Dt({
2113
2117
  url: this.api.url + ("/api/static/" + path).replaceAll("//", "/"),
2114
- files: Array.isArray(files) ? files : [files],
2118
+ files: ut(files),
2115
2119
  headers: this.api.headers
2116
2120
  }).onProgress((p2) => {
2117
2121
  prog(p2);
@@ -2122,7 +2126,7 @@ class Static extends F {
2122
2126
  });
2123
2127
  }
2124
2128
  }
2125
- class Momentum extends F {
2129
+ class Momentum extends v {
2126
2130
  constructor(url, opts) {
2127
2131
  super();
2128
2132
  __publicField(this, "api");
package/dist/pdf.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"pdf.d.ts","sourceRoot":"","sources":["../src/pdf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAW,YAAY,EAAE,KAAK,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAExE,MAAM,MAAM,UAAU,GAAG;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG;IACrC,MAAM,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,CAAC;CAC3B,CAAA;AAED,qBAAa,GAAI,SAAQ,YAAY,CAAC,SAAS,CAAC;IAC/C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAO;gBAEf,GAAG,EAAE,GAAG,GAAG,MAAM;YAKf,cAAc;IAW5B,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,UAAe;IAK/C,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,UAAe;IAKlE,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,UAAe;CAI1C"}
1
+ {"version":3,"file":"pdf.d.ts","sourceRoot":"","sources":["../src/pdf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAc,YAAY,EAAE,KAAK,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAE3E,MAAM,MAAM,UAAU,GAAG;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG;IACrC,MAAM,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,CAAC;CAC3B,CAAA;AAED,qBAAa,GAAI,SAAQ,YAAY,CAAC,SAAS,CAAC;IAC/C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAO;gBAEf,GAAG,EAAE,GAAG,GAAG,MAAM;YAKf,cAAc;IAW5B,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,UAAe;IAK/C,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,UAAe;IAKlE,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,UAAe;CAI1C"}
@@ -1 +1 @@
1
- {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../src/static.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,eAAe,EAAE,YAAY,EAAE,KAAK,WAAW,EAAqB,MAAM,gBAAgB,CAAC;AAEnG,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG;IACxC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,GAAG,CAAC;IAC9B,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,GAAG,CAAC;CACjC,CAAC;AAEF,qBAAa,MAAO,SAAQ,YAAY,CAAC,YAAY,CAAC;IACrD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAO;gBAEf,GAAG,EAAE,GAAG,GAAG,MAAM;IAK7B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMnC,MAAM,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,EAAE,IAAI,SAAM,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC;CAcnE"}
1
+ {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../src/static.ts"],"names":[],"mappings":"AAAA,O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E,MAAM,EAAE,IAAI,GAAE,kBAAkB,GAAG;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAM,GAAG,eAAe,CAAC,IAAI,CAAC;IAWtG,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,QAAQ,CAAC;IAQ/C,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,GAAG,MAAM;IACzC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI;IAS9D,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAQrC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,QAAQ,CAAC;IAS3D,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,EAAE,IAAI,GAAE,MAAM,GAAG;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAM,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAC;CAkB3I"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztimson/momentum",
3
- "version": "0.39.2",
3
+ "version": "0.39.3",
4
4
  "description": "Client library for momentum",
5
5
  "keywords": ["Momentum"],
6
6
  "author": "Zak Timson <zaktimson@gmail.com>",
@@ -24,7 +24,7 @@
24
24
  "postbuild": "node -e \"const fs=require('fs');fs.cpSync('dist/index.mjs','../server/public/momentum.mjs');fs.cpSync('dist/index.cjs','../server/public/momentum.js')\""
25
25
  },
26
26
  "dependencies": {
27
- "@ztimson/utils": "0.15.6",
27
+ "@ztimson/utils": "0.16.1",
28
28
  "rxjs": "^7.8.1"
29
29
  },
30
30
  "devDependencies": {