bmlt-query-client 1.2.0 → 1.3.0
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/CHANGELOG.md +22 -1
- package/dist/app.d.ts +112 -50
- package/dist/app.js +93 -93
- package/dist/app.js.map +1 -1
- package/package.json +1 -1
package/dist/app.js
CHANGED
|
@@ -223,7 +223,7 @@ var oe = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
|
223
223
|
}, c.prototype.off = c.prototype.removeListener, c.prototype.addListener = c.prototype.on, c.prefixed = r, c.EventEmitter = c, t !== void 0 && (t.exports = c);
|
|
224
224
|
})))(), 1);
|
|
225
225
|
//#endregion
|
|
226
|
-
//#region \0@oxc-project+runtime@0.
|
|
226
|
+
//#region \0@oxc-project+runtime@0.130.0/helpers/typeof.js
|
|
227
227
|
function g(e) {
|
|
228
228
|
"@babel/helpers - typeof";
|
|
229
229
|
return g = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
@@ -233,7 +233,7 @@ function g(e) {
|
|
|
233
233
|
}, g(e);
|
|
234
234
|
}
|
|
235
235
|
//#endregion
|
|
236
|
-
//#region \0@oxc-project+runtime@0.
|
|
236
|
+
//#region \0@oxc-project+runtime@0.130.0/helpers/toPrimitive.js
|
|
237
237
|
function se(e, t) {
|
|
238
238
|
if (g(e) != "object" || !e) return e;
|
|
239
239
|
var n = e[Symbol.toPrimitive];
|
|
@@ -245,13 +245,13 @@ function se(e, t) {
|
|
|
245
245
|
return (t === "string" ? String : Number)(e);
|
|
246
246
|
}
|
|
247
247
|
//#endregion
|
|
248
|
-
//#region \0@oxc-project+runtime@0.
|
|
248
|
+
//#region \0@oxc-project+runtime@0.130.0/helpers/toPropertyKey.js
|
|
249
249
|
function ce(e) {
|
|
250
250
|
var t = se(e, "string");
|
|
251
251
|
return g(t) == "symbol" ? t : t + "";
|
|
252
252
|
}
|
|
253
253
|
//#endregion
|
|
254
|
-
//#region \0@oxc-project+runtime@0.
|
|
254
|
+
//#region \0@oxc-project+runtime@0.130.0/helpers/defineProperty.js
|
|
255
255
|
function _(e, t, n) {
|
|
256
256
|
return (t = ce(t)) in e ? Object.defineProperty(e, t, {
|
|
257
257
|
value: n,
|
|
@@ -310,33 +310,33 @@ function fe(e, t, n) {
|
|
|
310
310
|
return r;
|
|
311
311
|
}
|
|
312
312
|
//#endregion
|
|
313
|
-
//#region \0@oxc-project+runtime@0.
|
|
313
|
+
//#region \0@oxc-project+runtime@0.130.0/helpers/checkPrivateRedeclaration.js
|
|
314
314
|
function pe(e, t) {
|
|
315
315
|
if (t.has(e)) throw TypeError("Cannot initialize the same private elements twice on an object");
|
|
316
316
|
}
|
|
317
317
|
//#endregion
|
|
318
|
-
//#region \0@oxc-project+runtime@0.
|
|
318
|
+
//#region \0@oxc-project+runtime@0.130.0/helpers/classPrivateMethodInitSpec.js
|
|
319
319
|
function me(e, t) {
|
|
320
320
|
pe(e, t), t.add(e);
|
|
321
321
|
}
|
|
322
322
|
//#endregion
|
|
323
|
-
//#region \0@oxc-project+runtime@0.
|
|
323
|
+
//#region \0@oxc-project+runtime@0.130.0/helpers/classPrivateFieldInitSpec.js
|
|
324
324
|
function v(e, t, n) {
|
|
325
325
|
pe(e, t), t.set(e, n);
|
|
326
326
|
}
|
|
327
327
|
//#endregion
|
|
328
|
-
//#region \0@oxc-project+runtime@0.
|
|
328
|
+
//#region \0@oxc-project+runtime@0.130.0/helpers/assertClassBrand.js
|
|
329
329
|
function y(e, t, n) {
|
|
330
330
|
if (typeof e == "function" ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
331
331
|
throw TypeError("Private element is not present on this object");
|
|
332
332
|
}
|
|
333
333
|
//#endregion
|
|
334
|
-
//#region \0@oxc-project+runtime@0.
|
|
334
|
+
//#region \0@oxc-project+runtime@0.130.0/helpers/classPrivateFieldGet2.js
|
|
335
335
|
function b(e, t) {
|
|
336
336
|
return e.get(y(e, t));
|
|
337
337
|
}
|
|
338
338
|
//#endregion
|
|
339
|
-
//#region \0@oxc-project+runtime@0.
|
|
339
|
+
//#region \0@oxc-project+runtime@0.130.0/helpers/classPrivateFieldSet2.js
|
|
340
340
|
function x(e, t, n) {
|
|
341
341
|
return e.set(y(e, t), n), n;
|
|
342
342
|
}
|
|
@@ -400,9 +400,9 @@ function ve() {
|
|
|
400
400
|
}
|
|
401
401
|
//#endregion
|
|
402
402
|
//#region node_modules/p-queue/dist/index.js
|
|
403
|
-
var
|
|
403
|
+
var ye = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), D = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), be = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), xe = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), Se = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new WeakSet(), Ce = class extends oe.default {
|
|
404
404
|
constructor(e) {
|
|
405
|
-
if (super(), me(this, H), v(this,
|
|
405
|
+
if (super(), me(this, H), v(this, ye, void 0), v(this, w, void 0), v(this, T, 0), v(this, E, void 0), v(this, D, !1), v(this, O, !1), v(this, k, void 0), v(this, be, 0), v(this, A, 0), v(this, j, void 0), v(this, M, void 0), v(this, N, void 0), v(this, P, []), v(this, F, 0), v(this, I, void 0), v(this, xe, void 0), v(this, L, 0), v(this, R, void 0), v(this, z, void 0), v(this, Se, 1n), v(this, B, /* @__PURE__ */ new Map()), v(this, V, /* @__PURE__ */ new Set()), _(this, "timeout", void 0), e = {
|
|
406
406
|
carryoverIntervalCount: !1,
|
|
407
407
|
intervalCap: Infinity,
|
|
408
408
|
interval: 0,
|
|
@@ -415,15 +415,15 @@ var w = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), E = /*
|
|
|
415
415
|
if (e.interval === void 0 || !(Number.isFinite(e.interval) && e.interval >= 0)) throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString() ?? ""}\` (${typeof e.interval})`);
|
|
416
416
|
if (e.strict && e.interval === 0) throw TypeError("The `strict` option requires a non-zero `interval`");
|
|
417
417
|
if (e.strict && e.intervalCap === Infinity) throw TypeError("The `strict` option requires a finite `intervalCap`");
|
|
418
|
-
if (x(
|
|
419
|
-
this.timeout = e.timeout, x(z, this, e.autoStart === !1), y(H, this,
|
|
418
|
+
if (x(ye, this, e.carryoverIntervalCount ?? e.carryoverConcurrencyCount ?? !1), x(w, this, e.intervalCap === Infinity || e.interval === 0), x(E, this, e.intervalCap), x(k, this, e.interval), x(N, this, e.strict), x(I, this, new e.queueClass()), x(xe, this, e.queueClass), this.concurrency = e.concurrency, e.timeout !== void 0 && !(Number.isFinite(e.timeout) && e.timeout > 0)) throw TypeError(`Expected \`timeout\` to be a positive finite number, got \`${e.timeout}\` (${typeof e.timeout})`);
|
|
419
|
+
this.timeout = e.timeout, x(z, this, e.autoStart === !1), y(H, this, ze).call(this);
|
|
420
420
|
}
|
|
421
421
|
get concurrency() {
|
|
422
422
|
return b(R, this);
|
|
423
423
|
}
|
|
424
424
|
set concurrency(e) {
|
|
425
425
|
if (!(typeof e == "number" && e >= 1)) throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);
|
|
426
|
-
x(R, this, e), y(H, this,
|
|
426
|
+
x(R, this, e), y(H, this, Re).call(this);
|
|
427
427
|
}
|
|
428
428
|
setPriority(e, t) {
|
|
429
429
|
if (typeof t != "number" || !Number.isFinite(t)) throw TypeError(`Expected \`priority\` to be a finite number, got \`${t}\` (${typeof t})`);
|
|
@@ -449,9 +449,9 @@ var w = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), E = /*
|
|
|
449
449
|
try {
|
|
450
450
|
t.signal?.throwIfAborted();
|
|
451
451
|
} catch (e) {
|
|
452
|
-
throw y(H, this,
|
|
452
|
+
throw y(H, this, Be).call(this), b(B, this).delete(i), e;
|
|
453
453
|
}
|
|
454
|
-
x(
|
|
454
|
+
x(A, this, Date.now());
|
|
455
455
|
let r = e({ signal: t.signal });
|
|
456
456
|
if (t.timeout && (r = de(Promise.resolve(r), {
|
|
457
457
|
milliseconds: t.timeout,
|
|
@@ -484,7 +484,7 @@ var w = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), E = /*
|
|
|
484
484
|
};
|
|
485
485
|
if (t.signal) {
|
|
486
486
|
let { signal: e } = t, n = () => {
|
|
487
|
-
a(), s(), r(e.reason), y(H, this,
|
|
487
|
+
a(), s(), r(e.reason), y(H, this, U).call(this), this.emit("next");
|
|
488
488
|
};
|
|
489
489
|
if (a = () => {
|
|
490
490
|
e.removeEventListener("abort", n), b(V, this).delete(a);
|
|
@@ -494,39 +494,39 @@ var w = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), E = /*
|
|
|
494
494
|
}
|
|
495
495
|
e.addEventListener("abort", n, { once: !0 }), b(V, this).add(a);
|
|
496
496
|
}
|
|
497
|
-
this.emit("add"), y(H, this,
|
|
497
|
+
this.emit("add"), y(H, this, U).call(this);
|
|
498
498
|
});
|
|
499
499
|
}
|
|
500
500
|
async addAll(e, t) {
|
|
501
501
|
return Promise.all(e.map(async (e) => this.add(e, t)));
|
|
502
502
|
}
|
|
503
503
|
start() {
|
|
504
|
-
return b(z, this) ? (x(z, this, !1), y(H, this,
|
|
504
|
+
return b(z, this) ? (x(z, this, !1), y(H, this, Re).call(this), this) : this;
|
|
505
505
|
}
|
|
506
506
|
pause() {
|
|
507
507
|
x(z, this, !0);
|
|
508
508
|
}
|
|
509
509
|
clear() {
|
|
510
510
|
for (let e of b(V, this)) e();
|
|
511
|
-
x(I, this, new (b(xe, this))()), y(H, this, Pe).call(this), y(H, this,
|
|
511
|
+
x(I, this, new (b(xe, this))()), y(H, this, Pe).call(this), y(H, this, Ve).call(this), this.emit("empty"), b(L, this) === 0 && (y(H, this, Fe).call(this), this.emit("idle")), this.emit("next");
|
|
512
512
|
}
|
|
513
513
|
async onEmpty() {
|
|
514
|
-
b(I, this).size !== 0 && await y(H, this,
|
|
514
|
+
b(I, this).size !== 0 && await y(H, this, W).call(this, "empty");
|
|
515
515
|
}
|
|
516
516
|
async onSizeLessThan(e) {
|
|
517
|
-
b(I, this).size < e || await y(H, this,
|
|
517
|
+
b(I, this).size < e || await y(H, this, W).call(this, "next", () => b(I, this).size < e);
|
|
518
518
|
}
|
|
519
519
|
async onIdle() {
|
|
520
|
-
b(L, this) === 0 && b(I, this).size === 0 || await y(H, this,
|
|
520
|
+
b(L, this) === 0 && b(I, this).size === 0 || await y(H, this, W).call(this, "idle");
|
|
521
521
|
}
|
|
522
522
|
async onPendingZero() {
|
|
523
|
-
b(L, this) !== 0 && await y(H, this,
|
|
523
|
+
b(L, this) !== 0 && await y(H, this, W).call(this, "pendingZero");
|
|
524
524
|
}
|
|
525
525
|
async onRateLimit() {
|
|
526
|
-
this.isRateLimited || await y(H, this,
|
|
526
|
+
this.isRateLimited || await y(H, this, W).call(this, "rateLimit");
|
|
527
527
|
}
|
|
528
528
|
async onRateLimitCleared() {
|
|
529
|
-
this.isRateLimited && await y(H, this,
|
|
529
|
+
this.isRateLimited && await y(H, this, W).call(this, "rateLimitCleared");
|
|
530
530
|
}
|
|
531
531
|
onError() {
|
|
532
532
|
return new Promise((e, t) => {
|
|
@@ -549,7 +549,7 @@ var w = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), E = /*
|
|
|
549
549
|
return b(z, this);
|
|
550
550
|
}
|
|
551
551
|
get isRateLimited() {
|
|
552
|
-
return b(
|
|
552
|
+
return b(D, this);
|
|
553
553
|
}
|
|
554
554
|
get isSaturated() {
|
|
555
555
|
return b(L, this) === b(R, this) && b(I, this).size > 0 || this.isRateLimited && b(I, this).size > 0;
|
|
@@ -561,7 +561,7 @@ var w = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), E = /*
|
|
|
561
561
|
function we(e) {
|
|
562
562
|
for (; b(F, this) < b(P, this).length;) {
|
|
563
563
|
let n = b(P, this)[b(F, this)];
|
|
564
|
-
if (n !== void 0 && e - n >= b(
|
|
564
|
+
if (n !== void 0 && e - n >= b(k, this)) {
|
|
565
565
|
var t;
|
|
566
566
|
x(F, this, (t = b(F, this), t++, t));
|
|
567
567
|
} else break;
|
|
@@ -572,48 +572,48 @@ function Te(e) {
|
|
|
572
572
|
if (b(N, this)) b(P, this).push(e);
|
|
573
573
|
else {
|
|
574
574
|
var t;
|
|
575
|
-
x(
|
|
575
|
+
x(T, this, (t = b(T, this), t++, t));
|
|
576
576
|
}
|
|
577
577
|
}
|
|
578
578
|
function Ee() {
|
|
579
579
|
if (b(N, this)) b(P, this).length > b(F, this) && b(P, this).pop();
|
|
580
|
-
else if (b(
|
|
580
|
+
else if (b(T, this) > 0) {
|
|
581
581
|
var e;
|
|
582
|
-
x(
|
|
582
|
+
x(T, this, (e = b(T, this), e--, e));
|
|
583
583
|
}
|
|
584
584
|
}
|
|
585
585
|
function De() {
|
|
586
586
|
return b(P, this).length - b(F, this);
|
|
587
587
|
}
|
|
588
588
|
function Oe() {
|
|
589
|
-
return b(
|
|
589
|
+
return b(w, this) ? !0 : b(N, this) ? y(H, this, De).call(this) < b(E, this) : b(T, this) < b(E, this);
|
|
590
590
|
}
|
|
591
591
|
function ke() {
|
|
592
592
|
return b(L, this) < b(R, this);
|
|
593
593
|
}
|
|
594
594
|
function Ae() {
|
|
595
595
|
var e;
|
|
596
|
-
x(L, this, (e = b(L, this), e--, e)), b(L, this) === 0 && this.emit("pendingZero"), y(H, this,
|
|
596
|
+
x(L, this, (e = b(L, this), e--, e)), b(L, this) === 0 && this.emit("pendingZero"), y(H, this, U).call(this), this.emit("next");
|
|
597
597
|
}
|
|
598
598
|
function je() {
|
|
599
|
-
x(M, this, void 0), y(H, this,
|
|
599
|
+
x(M, this, void 0), y(H, this, Le).call(this), y(H, this, Ie).call(this);
|
|
600
600
|
}
|
|
601
601
|
function Me(e) {
|
|
602
602
|
if (b(N, this)) {
|
|
603
|
-
if (y(H, this, we).call(this, e), y(H, this, De).call(this) >= b(
|
|
604
|
-
let t = b(P, this)[b(F, this)], n = b(
|
|
603
|
+
if (y(H, this, we).call(this, e), y(H, this, De).call(this) >= b(E, this)) {
|
|
604
|
+
let t = b(P, this)[b(F, this)], n = b(k, this) - (e - t);
|
|
605
605
|
return y(H, this, Ne).call(this, n), !0;
|
|
606
606
|
}
|
|
607
607
|
return !1;
|
|
608
608
|
}
|
|
609
609
|
if (b(j, this) === void 0) {
|
|
610
|
-
let t = b(
|
|
610
|
+
let t = b(be, this) - e;
|
|
611
611
|
if (t < 0) {
|
|
612
|
-
if (b(
|
|
613
|
-
let t = e - b(
|
|
614
|
-
if (t < b(
|
|
612
|
+
if (b(A, this) > 0) {
|
|
613
|
+
let t = e - b(A, this);
|
|
614
|
+
if (t < b(k, this)) return y(H, this, Ne).call(this, b(k, this) - t), !0;
|
|
615
615
|
}
|
|
616
|
-
x(
|
|
616
|
+
x(T, this, b(ye, this) ? b(L, this) : 0);
|
|
617
617
|
} else return y(H, this, Ne).call(this, t), !0;
|
|
618
618
|
}
|
|
619
619
|
return !1;
|
|
@@ -629,7 +629,7 @@ function Pe() {
|
|
|
629
629
|
function Fe() {
|
|
630
630
|
b(M, this) && (clearTimeout(b(M, this)), x(M, this, void 0));
|
|
631
631
|
}
|
|
632
|
-
function
|
|
632
|
+
function U() {
|
|
633
633
|
if (b(I, this).size === 0) {
|
|
634
634
|
if (y(H, this, Pe).call(this), this.emit("empty"), b(L, this) === 0) {
|
|
635
635
|
if (y(H, this, Fe).call(this), b(N, this) && b(F, this) > 0) {
|
|
@@ -645,23 +645,23 @@ function Ie() {
|
|
|
645
645
|
let t = Date.now(), n = !y(H, this, Me).call(this, t);
|
|
646
646
|
if (Oe.call(y(H, this)) && ke.call(y(H, this))) {
|
|
647
647
|
let r = b(I, this).dequeue();
|
|
648
|
-
b(
|
|
648
|
+
b(w, this) || (y(H, this, Te).call(this, t), y(H, this, G).call(this)), this.emit("active"), r(), n && y(H, this, Ie).call(this), e = !0;
|
|
649
649
|
}
|
|
650
650
|
}
|
|
651
651
|
return e;
|
|
652
652
|
}
|
|
653
|
+
function Ie() {
|
|
654
|
+
b(w, this) || b(j, this) !== void 0 || b(N, this) || (x(j, this, setInterval(() => {
|
|
655
|
+
y(H, this, Le).call(this);
|
|
656
|
+
}, b(k, this))), x(be, this, Date.now() + b(k, this)));
|
|
657
|
+
}
|
|
653
658
|
function Le() {
|
|
654
|
-
b(
|
|
655
|
-
y(H, this, Re).call(this);
|
|
656
|
-
}, b(A, this))), x(ye, this, Date.now() + b(A, this)));
|
|
659
|
+
b(N, this) || (b(T, this) === 0 && b(L, this) === 0 && b(j, this) && y(H, this, Pe).call(this), x(T, this, b(ye, this) ? b(L, this) : 0)), y(H, this, Re).call(this), y(H, this, G).call(this);
|
|
657
660
|
}
|
|
658
661
|
function Re() {
|
|
659
|
-
|
|
660
|
-
}
|
|
661
|
-
function ze() {
|
|
662
|
-
for (; y(H, this, Ie).call(this););
|
|
662
|
+
for (; y(H, this, U).call(this););
|
|
663
663
|
}
|
|
664
|
-
async function
|
|
664
|
+
async function W(e, t) {
|
|
665
665
|
return new Promise((n) => {
|
|
666
666
|
let r = () => {
|
|
667
667
|
t && !t() || (this.off(e, r), n());
|
|
@@ -669,38 +669,38 @@ async function U(e, t) {
|
|
|
669
669
|
this.on(e, r);
|
|
670
670
|
});
|
|
671
671
|
}
|
|
672
|
-
function
|
|
673
|
-
b(
|
|
674
|
-
b(I, this).size > 0 && y(H, this,
|
|
672
|
+
function ze() {
|
|
673
|
+
b(w, this) || (this.on("add", () => {
|
|
674
|
+
b(I, this).size > 0 && y(H, this, G).call(this);
|
|
675
675
|
}), this.on("next", () => {
|
|
676
|
-
y(H, this,
|
|
676
|
+
y(H, this, G).call(this);
|
|
677
677
|
}));
|
|
678
678
|
}
|
|
679
|
-
function
|
|
680
|
-
b(
|
|
681
|
-
x(
|
|
679
|
+
function G() {
|
|
680
|
+
b(w, this) || b(O, this) || (x(O, this, !0), queueMicrotask(() => {
|
|
681
|
+
x(O, this, !1), y(H, this, Ve).call(this);
|
|
682
682
|
}));
|
|
683
683
|
}
|
|
684
|
-
function
|
|
685
|
-
b(
|
|
684
|
+
function Be() {
|
|
685
|
+
b(w, this) || (y(H, this, Ee).call(this), y(H, this, G).call(this));
|
|
686
686
|
}
|
|
687
|
-
function
|
|
688
|
-
let e = b(
|
|
689
|
-
if (b(
|
|
690
|
-
e && (x(
|
|
687
|
+
function Ve() {
|
|
688
|
+
let e = b(D, this);
|
|
689
|
+
if (b(w, this) || b(I, this).size === 0) {
|
|
690
|
+
e && (x(D, this, !1), this.emit("rateLimitCleared"));
|
|
691
691
|
return;
|
|
692
692
|
}
|
|
693
693
|
let t;
|
|
694
694
|
if (b(N, this)) {
|
|
695
695
|
let e = Date.now();
|
|
696
696
|
y(H, this, we).call(this, e), t = y(H, this, De).call(this);
|
|
697
|
-
} else t = b(
|
|
698
|
-
let n = t >= b(
|
|
699
|
-
n !== e && (x(
|
|
697
|
+
} else t = b(T, this);
|
|
698
|
+
let n = t >= b(E, this);
|
|
699
|
+
n !== e && (x(D, this, n), this.emit(n ? "rateLimit" : "rateLimitCleared"));
|
|
700
700
|
}
|
|
701
701
|
//#endregion
|
|
702
702
|
//#region src/utils/errors.ts
|
|
703
|
-
var
|
|
703
|
+
var He = /* @__PURE__ */ function(e) {
|
|
704
704
|
return e.API_ERROR = "ApiError", e.NETWORK_ERROR = "NetworkError", e.VALIDATION_ERROR = "ValidationError", e.GEOCODING_ERROR = "GeocodingError", e.RATE_LIMIT_ERROR = "RateLimitError", e.TIMEOUT_ERROR = "TimeoutError", e.AUTHENTICATION_ERROR = "AuthenticationError", e.SERVER_ERROR = "ServerError", e.CLIENT_ERROR = "ClientError", e.CONFIGURATION_ERROR = "ConfigurationError", e;
|
|
705
705
|
}({}), K = class e extends Error {
|
|
706
706
|
constructor(t, n, r = {}) {
|
|
@@ -711,10 +711,10 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
711
711
|
}
|
|
712
712
|
isRetryable() {
|
|
713
713
|
return [
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
714
|
+
"NetworkError",
|
|
715
|
+
"TimeoutError",
|
|
716
|
+
"RateLimitError",
|
|
717
|
+
"ServerError"
|
|
718
718
|
].includes(this.type);
|
|
719
719
|
}
|
|
720
720
|
isClientError() {
|
|
@@ -725,15 +725,15 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
725
725
|
}
|
|
726
726
|
getUserMessage() {
|
|
727
727
|
switch (this.type) {
|
|
728
|
-
case
|
|
729
|
-
case
|
|
730
|
-
case
|
|
731
|
-
case
|
|
732
|
-
case
|
|
733
|
-
case
|
|
734
|
-
case
|
|
735
|
-
case
|
|
736
|
-
case
|
|
728
|
+
case "NetworkError": return "Unable to connect to the BMLT server. Please check your internet connection and try again.";
|
|
729
|
+
case "TimeoutError": return "The request timed out. Please try again later.";
|
|
730
|
+
case "RateLimitError": return "Too many requests. Please wait a moment and try again.";
|
|
731
|
+
case "GeocodingError": return "Unable to find the specified address. Please check the address and try again.";
|
|
732
|
+
case "ValidationError": return "Invalid input provided. Please check your parameters and try again.";
|
|
733
|
+
case "AuthenticationError": return "Authentication failed. Please check your credentials.";
|
|
734
|
+
case "ServerError": return "The BMLT server encountered an error. Please try again later.";
|
|
735
|
+
case "ApiError": return this.statusCode === 404 ? "The requested resource was not found." : "An error occurred while communicating with the BMLT server.";
|
|
736
|
+
case "ConfigurationError": return "Invalid configuration. Please check your settings.";
|
|
737
737
|
default: return this.message || "An unexpected error occurred.";
|
|
738
738
|
}
|
|
739
739
|
}
|
|
@@ -756,35 +756,35 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
756
756
|
}, q = class {
|
|
757
757
|
static createApiError(e, t, n, r) {
|
|
758
758
|
let i;
|
|
759
|
-
return i = t ? t >= 500 ?
|
|
759
|
+
return i = t ? t >= 500 ? "ServerError" : t === 401 || t === 403 ? "AuthenticationError" : t === 429 ? "RateLimitError" : t >= 400 ? "ClientError" : "ApiError" : "ApiError", new K(i, e, {
|
|
760
760
|
statusCode: t,
|
|
761
761
|
response: n,
|
|
762
762
|
originalError: r
|
|
763
763
|
});
|
|
764
764
|
}
|
|
765
765
|
static createNetworkError(e, t) {
|
|
766
|
-
return new K(
|
|
766
|
+
return new K("NetworkError", e, { originalError: t });
|
|
767
767
|
}
|
|
768
768
|
static createTimeoutError(e, t) {
|
|
769
|
-
return new K(
|
|
769
|
+
return new K("TimeoutError", e, { originalError: t });
|
|
770
770
|
}
|
|
771
771
|
static createValidationError(e, t) {
|
|
772
|
-
return new K(
|
|
772
|
+
return new K("ValidationError", e, { context: t });
|
|
773
773
|
}
|
|
774
774
|
static createGeocodingError(e, t, n) {
|
|
775
|
-
return new K(
|
|
775
|
+
return new K("GeocodingError", e, {
|
|
776
776
|
originalError: t,
|
|
777
777
|
context: n
|
|
778
778
|
});
|
|
779
779
|
}
|
|
780
780
|
static createRateLimitError(e, t, n) {
|
|
781
|
-
return new K(
|
|
781
|
+
return new K("RateLimitError", e, {
|
|
782
782
|
statusCode: t,
|
|
783
783
|
response: n
|
|
784
784
|
});
|
|
785
785
|
}
|
|
786
786
|
static createConfigurationError(e, t) {
|
|
787
|
-
return new K(
|
|
787
|
+
return new K("ConfigurationError", e, { context: t });
|
|
788
788
|
}
|
|
789
789
|
}, Ue = class e {
|
|
790
790
|
static handleFetchError(e, t) {
|
|
@@ -927,7 +927,7 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
927
927
|
r.searchParams.append(e, String(t));
|
|
928
928
|
});
|
|
929
929
|
let i = await this.fetchWithTimeout(r.toString(), n.timeout, n.userAgent);
|
|
930
|
-
if (!i || i.length === 0) throw new K(
|
|
930
|
+
if (!i || i.length === 0) throw new K(He.GEOCODING_ERROR, `No results found for address: ${e}`);
|
|
931
931
|
let a = i[0], o = {
|
|
932
932
|
latitude: parseFloat(a.lat),
|
|
933
933
|
longitude: parseFloat(a.lon)
|
|
@@ -1238,10 +1238,10 @@ var rt = class {
|
|
|
1238
1238
|
return this.makeRequest(Y.GET_NAWS_DUMP, e, J.CSV);
|
|
1239
1239
|
}
|
|
1240
1240
|
async getServerInfo() {
|
|
1241
|
-
return this.makeRequest(Y.GET_SERVER_INFO);
|
|
1241
|
+
return (await this.makeRequest(Y.GET_SERVER_INFO))[0];
|
|
1242
1242
|
}
|
|
1243
1243
|
async getCoverageArea() {
|
|
1244
|
-
return this.makeRequest(Y.GET_COVERAGE_AREA);
|
|
1244
|
+
return (await this.makeRequest(Y.GET_COVERAGE_AREA))[0];
|
|
1245
1245
|
}
|
|
1246
1246
|
async geocodeAddress(e, t) {
|
|
1247
1247
|
if (!this.geocodingService) throw Error("Geocoding is not enabled. Initialize client with enableGeocoding: true");
|
|
@@ -1486,6 +1486,6 @@ function lt(e) {
|
|
|
1486
1486
|
return n;
|
|
1487
1487
|
}
|
|
1488
1488
|
//#endregion
|
|
1489
|
-
export { rt as BmltClient, J as BmltDataFormat, Y as BmltEndpoint,
|
|
1489
|
+
export { rt as BmltClient, J as BmltDataFormat, Y as BmltEndpoint, He as BmltErrorType, K as BmltQueryError, q as ErrorFactory, Ue as ErrorHandler, Ge as GeocodingService, qe as Language, $ as MeetingQueryBuilder, it as QuickSearch, We as RetryHandler, Ke as SortKey, Z as VenueType, X as Weekday, Je as buildBmltURL, lt as countUniqueGroups, Qe as extractIds, ct as findDuplicateMeetings, $e as formatTimeValue, nt as kilometersToMiles, tt as milesToKilometers, Ye as normalizeParameters, et as validateCoordinates, Xe as validateEndpointFormat, Q as validateRadius, Ze as validateServerURL };
|
|
1490
1490
|
|
|
1491
1491
|
//# sourceMappingURL=app.js.map
|