bmlt-query-client 1.4.0 → 1.4.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/CHANGELOG.md +9 -1
- package/dist/app.d.ts +34 -34
- package/dist/app.js +183 -141
- package/dist/app.js.map +1 -1
- package/package.json +3 -2
package/dist/app.js
CHANGED
|
@@ -38,19 +38,19 @@ function m(e, t, { min: n = 0, allowInfinity: r = !1 } = {}) {
|
|
|
38
38
|
if (t < n) throw TypeError(`Expected \`${e}\` to be \u2265 ${n}.`);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function ee(e, t) {
|
|
42
42
|
if (t !== void 0 && typeof t != "function") throw TypeError(`Expected \`${e}\` to be a function.`);
|
|
43
43
|
}
|
|
44
|
-
var
|
|
44
|
+
var te = class extends Error {
|
|
45
45
|
constructor(e) {
|
|
46
46
|
super(), e instanceof Error ? (this.originalError = e, {message: e} = e) : (this.originalError = Error(e), this.originalError.stack = this.stack), this.name = "AbortError", this.message = e;
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
-
function
|
|
49
|
+
function ne(e, t) {
|
|
50
50
|
let n = Math.max(1, e + 1), r = t.randomize ? Math.random() + 1 : 1, i = Math.round(r * t.minTimeout * t.factor ** (n - 1));
|
|
51
51
|
return i = Math.min(i, t.maxTimeout), i;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function h(e, t) {
|
|
54
54
|
return Number.isFinite(t) ? t - (performance.now() - e) : t;
|
|
55
55
|
}
|
|
56
56
|
async function re(e, t) {
|
|
@@ -65,9 +65,9 @@ async function re(e, t) {
|
|
|
65
65
|
}
|
|
66
66
|
async function ie({ error: e, attemptNumber: t, retriesConsumed: n, startTime: r, options: i }) {
|
|
67
67
|
let a = e instanceof Error ? e : /* @__PURE__ */ TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);
|
|
68
|
-
if (a instanceof
|
|
69
|
-
let o = Number.isFinite(i.retries) ? Math.max(0, i.retries - n) : i.retries, s = i.maxRetryTime ?? Infinity, c =
|
|
70
|
-
if (
|
|
68
|
+
if (a instanceof te) throw a.originalError;
|
|
69
|
+
let o = Number.isFinite(i.retries) ? Math.max(0, i.retries - n) : i.retries, s = i.maxRetryTime ?? Infinity, c = ne(n, i);
|
|
70
|
+
if (h(r, s) <= 0) {
|
|
71
71
|
let e = Object.freeze({
|
|
72
72
|
error: a,
|
|
73
73
|
attemptNumber: t,
|
|
@@ -90,17 +90,17 @@ async function ie({ error: e, attemptNumber: t, retriesConsumed: n, startTime: r
|
|
|
90
90
|
retriesConsumed: n,
|
|
91
91
|
retryDelay: d
|
|
92
92
|
});
|
|
93
|
-
if (await i.onFailedAttempt(p),
|
|
94
|
-
let m =
|
|
93
|
+
if (await i.onFailedAttempt(p), h(r, s) <= 0 || h(r, s) <= 0 || o <= 0 || a instanceof TypeError && !f(a) || !await i.shouldRetry(p)) throw a;
|
|
94
|
+
let m = h(r, s);
|
|
95
95
|
if (m <= 0) throw a;
|
|
96
96
|
if (!u) return i.signal?.throwIfAborted(), !1;
|
|
97
|
-
let
|
|
98
|
-
return i.signal?.throwIfAborted(), await re(
|
|
97
|
+
let ee = Math.min(d, m);
|
|
98
|
+
return i.signal?.throwIfAborted(), await re(ee, i), i.signal?.throwIfAborted(), !0;
|
|
99
99
|
}
|
|
100
100
|
async function ae(e, t = {}) {
|
|
101
101
|
var n, r, i, a, o, s, c, l, u;
|
|
102
102
|
if (t = { ...t }, p(t.retries), Object.hasOwn(t, "forever")) throw Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");
|
|
103
|
-
(n = t).retries ?? (n.retries = 10), (r = t).factor ?? (r.factor = 2), (i = t).minTimeout ?? (i.minTimeout = 1e3), (a = t).maxTimeout ?? (a.maxTimeout = Infinity), (o = t).maxRetryTime ?? (o.maxRetryTime = Infinity), (s = t).randomize ?? (s.randomize = !1), (c = t).onFailedAttempt ?? (c.onFailedAttempt = () => {}), (l = t).shouldRetry ?? (l.shouldRetry = () => !0), (u = t).shouldConsumeRetry ?? (u.shouldConsumeRetry = () => !0),
|
|
103
|
+
(n = t).retries ?? (n.retries = 10), (r = t).factor ?? (r.factor = 2), (i = t).minTimeout ?? (i.minTimeout = 1e3), (a = t).maxTimeout ?? (a.maxTimeout = Infinity), (o = t).maxRetryTime ?? (o.maxRetryTime = Infinity), (s = t).randomize ?? (s.randomize = !1), (c = t).onFailedAttempt ?? (c.onFailedAttempt = () => {}), (l = t).shouldRetry ?? (l.shouldRetry = () => !0), (u = t).shouldConsumeRetry ?? (u.shouldConsumeRetry = () => !0), ee("onFailedAttempt", t.onFailedAttempt), ee("shouldRetry", t.shouldRetry), ee("shouldConsumeRetry", t.shouldConsumeRetry), m("factor", t.factor, {
|
|
104
104
|
min: 0,
|
|
105
105
|
allowInfinity: !1
|
|
106
106
|
}), m("minTimeout", t.minTimeout, {
|
|
@@ -113,7 +113,7 @@ async function ae(e, t = {}) {
|
|
|
113
113
|
min: 0,
|
|
114
114
|
allowInfinity: !0
|
|
115
115
|
}), t.factor > 0 || (t.factor = 1), t.signal?.throwIfAborted();
|
|
116
|
-
let d = 0, f = 0,
|
|
116
|
+
let d = 0, f = 0, te = performance.now();
|
|
117
117
|
for (; !Number.isFinite(t.retries) || f <= t.retries;) {
|
|
118
118
|
d++;
|
|
119
119
|
try {
|
|
@@ -125,7 +125,7 @@ async function ae(e, t = {}) {
|
|
|
125
125
|
error: e,
|
|
126
126
|
attemptNumber: d,
|
|
127
127
|
retriesConsumed: f,
|
|
128
|
-
startTime:
|
|
128
|
+
startTime: te,
|
|
129
129
|
options: t
|
|
130
130
|
}) && f++;
|
|
131
131
|
}
|
|
@@ -416,14 +416,14 @@ var ye = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), T = /
|
|
|
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
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,
|
|
419
|
+
this.timeout = e.timeout, x(z, this, e.autoStart === !1), y(H, this, Be).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, ze).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,7 +449,7 @@ var ye = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), T = /
|
|
|
449
449
|
try {
|
|
450
450
|
t.signal?.throwIfAborted();
|
|
451
451
|
} catch (e) {
|
|
452
|
-
throw y(H, this,
|
|
452
|
+
throw y(H, this, Ve).call(this), b(B, this).delete(i), e;
|
|
453
453
|
}
|
|
454
454
|
x(A, this, Date.now());
|
|
455
455
|
let r = e({ signal: t.signal });
|
|
@@ -484,7 +484,7 @@ var ye = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), T = /
|
|
|
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, Ie).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 ye = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), T = /
|
|
|
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, Ie).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, ze).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, He).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, U).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, U).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, U).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, U).call(this, "pendingZero");
|
|
524
524
|
}
|
|
525
525
|
async onRateLimit() {
|
|
526
|
-
this.isRateLimited || await y(H, this,
|
|
526
|
+
this.isRateLimited || await y(H, this, U).call(this, "rateLimit");
|
|
527
527
|
}
|
|
528
528
|
async onRateLimitCleared() {
|
|
529
|
-
this.isRateLimited && await y(H, this,
|
|
529
|
+
this.isRateLimited && await y(H, this, U).call(this, "rateLimitCleared");
|
|
530
530
|
}
|
|
531
531
|
onError() {
|
|
532
532
|
return new Promise((e, t) => {
|
|
@@ -593,10 +593,10 @@ function ke() {
|
|
|
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, Ie).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, Re).call(this), y(H, this, Le).call(this);
|
|
600
600
|
}
|
|
601
601
|
function Me(e) {
|
|
602
602
|
if (b(N, this)) {
|
|
@@ -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 Ie() {
|
|
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 U() {
|
|
|
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(w, this) || (y(H, this, Te).call(this, t), y(H, this,
|
|
648
|
+
b(w, this) || (y(H, this, Te).call(this, t), y(H, this, W).call(this)), this.emit("active"), r(), n && y(H, this, Le).call(this), e = !0;
|
|
649
649
|
}
|
|
650
650
|
}
|
|
651
651
|
return e;
|
|
652
652
|
}
|
|
653
|
-
function
|
|
653
|
+
function Le() {
|
|
654
654
|
b(w, this) || b(j, this) !== void 0 || b(N, this) || (x(j, this, setInterval(() => {
|
|
655
|
-
y(H, this,
|
|
655
|
+
y(H, this, Re).call(this);
|
|
656
656
|
}, b(k, this))), x(be, this, Date.now() + b(k, this)));
|
|
657
657
|
}
|
|
658
|
-
function Le() {
|
|
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);
|
|
660
|
-
}
|
|
661
658
|
function Re() {
|
|
662
|
-
|
|
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, ze).call(this), y(H, this, W).call(this);
|
|
660
|
+
}
|
|
661
|
+
function ze() {
|
|
662
|
+
for (; y(H, this, Ie).call(this););
|
|
663
663
|
}
|
|
664
|
-
async function
|
|
664
|
+
async function U(e, t) {
|
|
665
665
|
return new Promise((n) => {
|
|
666
666
|
let r = () => {
|
|
667
667
|
t && !t() || (this.off(e, r), n());
|
|
@@ -669,22 +669,22 @@ async function W(e, t) {
|
|
|
669
669
|
this.on(e, r);
|
|
670
670
|
});
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function Be() {
|
|
673
673
|
b(w, this) || (this.on("add", () => {
|
|
674
|
-
b(I, this).size > 0 && y(H, this,
|
|
674
|
+
b(I, this).size > 0 && y(H, this, W).call(this);
|
|
675
675
|
}), this.on("next", () => {
|
|
676
|
-
y(H, this,
|
|
676
|
+
y(H, this, W).call(this);
|
|
677
677
|
}));
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function W() {
|
|
680
680
|
b(w, this) || b(O, this) || (x(O, this, !0), queueMicrotask(() => {
|
|
681
|
-
x(O, this, !1), y(H, this,
|
|
681
|
+
x(O, this, !1), y(H, this, He).call(this);
|
|
682
682
|
}));
|
|
683
683
|
}
|
|
684
|
-
function Be() {
|
|
685
|
-
b(w, this) || (y(H, this, Ee).call(this), y(H, this, G).call(this));
|
|
686
|
-
}
|
|
687
684
|
function Ve() {
|
|
685
|
+
b(w, this) || (y(H, this, Ee).call(this), y(H, this, W).call(this));
|
|
686
|
+
}
|
|
687
|
+
function He() {
|
|
688
688
|
let e = b(D, this);
|
|
689
689
|
if (b(w, this) || b(I, this).size === 0) {
|
|
690
690
|
e && (x(D, this, !1), this.emit("rateLimitCleared"));
|
|
@@ -700,9 +700,9 @@ function Ve() {
|
|
|
700
700
|
}
|
|
701
701
|
//#endregion
|
|
702
702
|
//#region src/utils/errors.ts
|
|
703
|
-
var
|
|
703
|
+
var Ue = /* @__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
|
+
}({}), G = class e extends Error {
|
|
706
706
|
constructor(t, n, r = {}) {
|
|
707
707
|
super(n), _(this, "type", void 0), _(this, "statusCode", void 0), _(this, "response", void 0), _(this, "originalError", void 0), _(this, "context", void 0), this.name = "BmltQueryError", this.type = t, this.statusCode = r.statusCode, this.response = r.response, this.originalError = r.originalError, this.context = r.context, Object.setPrototypeOf(this, e.prototype);
|
|
708
708
|
}
|
|
@@ -753,55 +753,55 @@ var He = /* @__PURE__ */ function(e) {
|
|
|
753
753
|
} : void 0
|
|
754
754
|
};
|
|
755
755
|
}
|
|
756
|
-
},
|
|
756
|
+
}, K = class {
|
|
757
757
|
static createApiError(e, t, n, r) {
|
|
758
758
|
let i;
|
|
759
|
-
return i = t ? t >= 500 ? "ServerError" : t === 401 || t === 403 ? "AuthenticationError" : t === 429 ? "RateLimitError" : t >= 400 ? "ClientError" : "ApiError" : "ApiError", new
|
|
759
|
+
return i = t ? t >= 500 ? "ServerError" : t === 401 || t === 403 ? "AuthenticationError" : t === 429 ? "RateLimitError" : t >= 400 ? "ClientError" : "ApiError" : "ApiError", new G(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
|
|
766
|
+
return new G("NetworkError", e, { originalError: t });
|
|
767
767
|
}
|
|
768
768
|
static createTimeoutError(e, t) {
|
|
769
|
-
return new
|
|
769
|
+
return new G("TimeoutError", e, { originalError: t });
|
|
770
770
|
}
|
|
771
771
|
static createValidationError(e, t) {
|
|
772
|
-
return new
|
|
772
|
+
return new G("ValidationError", e, { context: t });
|
|
773
773
|
}
|
|
774
774
|
static createGeocodingError(e, t, n) {
|
|
775
|
-
return new
|
|
775
|
+
return new G("GeocodingError", e, {
|
|
776
776
|
originalError: t,
|
|
777
777
|
context: n
|
|
778
778
|
});
|
|
779
779
|
}
|
|
780
780
|
static createRateLimitError(e, t, n) {
|
|
781
|
-
return new
|
|
781
|
+
return new G("RateLimitError", e, {
|
|
782
782
|
statusCode: t,
|
|
783
783
|
response: n
|
|
784
784
|
});
|
|
785
785
|
}
|
|
786
786
|
static createConfigurationError(e, t) {
|
|
787
|
-
return new
|
|
787
|
+
return new G("ConfigurationError", e, { context: t });
|
|
788
788
|
}
|
|
789
|
-
},
|
|
789
|
+
}, We = class e {
|
|
790
790
|
static handleFetchError(e, t) {
|
|
791
|
-
if (e instanceof Error && e.name === "AbortError") return
|
|
792
|
-
if (e instanceof TypeError) return
|
|
791
|
+
if (e instanceof Error && e.name === "AbortError") return K.createTimeoutError("Request timeout", e);
|
|
792
|
+
if (e instanceof TypeError) return K.createNetworkError("Network connection failed", e);
|
|
793
793
|
if (t && !t.ok) {
|
|
794
794
|
let n = `HTTP ${t.status}: ${t.statusText}`;
|
|
795
|
-
return
|
|
795
|
+
return K.createApiError(n, t.status, void 0, e);
|
|
796
796
|
}
|
|
797
|
-
return e instanceof Error ?
|
|
797
|
+
return e instanceof Error ? K.createApiError(e.message, void 0, void 0, e) : K.createApiError("Unknown error occurred", void 0, void 0, Error(String(e)));
|
|
798
798
|
}
|
|
799
799
|
static handleAxiosError(t) {
|
|
800
800
|
return e.handleFetchError(t);
|
|
801
801
|
}
|
|
802
802
|
static handleValidationError(e, t, n, r) {
|
|
803
803
|
let i = `Invalid ${e}: expected ${n}`;
|
|
804
|
-
return r && r.length > 0 && (i += ` (${r.join(", ")})`),
|
|
804
|
+
return r && r.length > 0 && (i += ` (${r.join(", ")})`), K.createValidationError(i, {
|
|
805
805
|
field: e,
|
|
806
806
|
value: t,
|
|
807
807
|
expectedType: n,
|
|
@@ -810,21 +810,21 @@ var He = /* @__PURE__ */ function(e) {
|
|
|
810
810
|
}
|
|
811
811
|
static handleEndpointError(e, t) {
|
|
812
812
|
let n = `Invalid endpoint/format combination: ${e} with ${t}`;
|
|
813
|
-
return
|
|
813
|
+
return K.createValidationError(n, {
|
|
814
814
|
endpoint: e,
|
|
815
815
|
format: t
|
|
816
816
|
});
|
|
817
817
|
}
|
|
818
818
|
static handleUrlError(e, t) {
|
|
819
819
|
let n = `Invalid URL: ${t}`;
|
|
820
|
-
return
|
|
820
|
+
return K.createValidationError(n, {
|
|
821
821
|
url: e,
|
|
822
822
|
reason: t
|
|
823
823
|
});
|
|
824
824
|
}
|
|
825
825
|
static handleCoordinateError(e, t, n) {
|
|
826
826
|
let r = n || "Invalid coordinates provided";
|
|
827
|
-
return
|
|
827
|
+
return K.createValidationError(r, {
|
|
828
828
|
latitude: e,
|
|
829
829
|
longitude: t,
|
|
830
830
|
reason: n
|
|
@@ -832,7 +832,7 @@ var He = /* @__PURE__ */ function(e) {
|
|
|
832
832
|
}
|
|
833
833
|
static wrapError(e, t, n) {
|
|
834
834
|
let r = `${t}: ${e.message}`;
|
|
835
|
-
return e instanceof
|
|
835
|
+
return e instanceof G ? new G(e.type, r, {
|
|
836
836
|
statusCode: e.statusCode,
|
|
837
837
|
response: e.response,
|
|
838
838
|
originalError: e.originalError || e,
|
|
@@ -840,22 +840,22 @@ var He = /* @__PURE__ */ function(e) {
|
|
|
840
840
|
...e.context,
|
|
841
841
|
...n
|
|
842
842
|
}
|
|
843
|
-
}) :
|
|
843
|
+
}) : K.createApiError(r, void 0, void 0, e);
|
|
844
844
|
}
|
|
845
|
-
},
|
|
845
|
+
}, Ge = class {
|
|
846
846
|
static async withRetry(e, t) {
|
|
847
847
|
let { maxRetries: n, baseDelay: r, maxDelay: i, factor: a, onRetry: o } = t, s;
|
|
848
848
|
for (let t = 0; t <= n; t++) try {
|
|
849
849
|
return await e();
|
|
850
850
|
} catch (e) {
|
|
851
|
-
let c = e instanceof
|
|
851
|
+
let c = e instanceof G ? e : We.wrapError(e, "Operation failed");
|
|
852
852
|
if (s = c, t === n || !c.isRetryable()) throw c;
|
|
853
853
|
let l = Math.min(r * a ** +t, i);
|
|
854
854
|
o && o(c, t + 1), await new Promise((e) => setTimeout(e, l));
|
|
855
855
|
}
|
|
856
856
|
throw s;
|
|
857
857
|
}
|
|
858
|
-
},
|
|
858
|
+
}, Ke = class {
|
|
859
859
|
constructor(e = {}) {
|
|
860
860
|
_(this, "baseURL", void 0), _(this, "queue", void 0), _(this, "defaultOptions", void 0);
|
|
861
861
|
let { retryCount: t = 3, timeout: n = 1e4, userAgent: r = "bmlt-query-client/1.0.0", countryCode: i = "us", viewbox: a, bounded: o = !1, intervalCap: s = 1, interval: c = 1e3, concurrency: l = 1, carryoverConcurrencyCount: u = !1, ...d } = e;
|
|
@@ -927,7 +927,7 @@ var He = /* @__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
|
|
930
|
+
if (!i || i.length === 0) throw new G(Ue.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)
|
|
@@ -1036,22 +1036,22 @@ var He = /* @__PURE__ */ function(e) {
|
|
|
1036
1036
|
if (!e || e.trim().length === 0) throw Error("User agent must be a non-empty string");
|
|
1037
1037
|
this.defaultOptions.userAgent = e.trim();
|
|
1038
1038
|
}
|
|
1039
|
-
},
|
|
1039
|
+
}, q = /* @__PURE__ */ function(e) {
|
|
1040
1040
|
return e.JSON = "json", e.JSONP = "jsonp", e.TSML = "tsml", e.CSV = "csv", e;
|
|
1041
|
-
}({}),
|
|
1041
|
+
}({}), J = /* @__PURE__ */ function(e) {
|
|
1042
1042
|
return e.GET_SEARCH_RESULTS = "GetSearchResults", e.GET_FORMATS = "GetFormats", e.GET_SERVICE_BODIES = "GetServiceBodies", e.GET_CHANGES = "GetChanges", e.GET_FIELD_KEYS = "GetFieldKeys", e.GET_FIELD_VALUES = "GetFieldValues", e.GET_NAWS_DUMP = "GetNAWSDump", e.GET_SERVER_INFO = "GetServerInfo", e.GET_COVERAGE_AREA = "GetCoverageArea", e;
|
|
1043
|
-
}({}),
|
|
1043
|
+
}({}), Y = /* @__PURE__ */ function(e) {
|
|
1044
1044
|
return e[e.SUNDAY = 1] = "SUNDAY", e[e.MONDAY = 2] = "MONDAY", e[e.TUESDAY = 3] = "TUESDAY", e[e.WEDNESDAY = 4] = "WEDNESDAY", e[e.THURSDAY = 5] = "THURSDAY", e[e.FRIDAY = 6] = "FRIDAY", e[e.SATURDAY = 7] = "SATURDAY", e;
|
|
1045
|
-
}({}),
|
|
1045
|
+
}({}), X = /* @__PURE__ */ function(e) {
|
|
1046
1046
|
return e[e.IN_PERSON = 1] = "IN_PERSON", e[e.VIRTUAL = 2] = "VIRTUAL", e[e.HYBRID = 3] = "HYBRID", e;
|
|
1047
|
-
}({}), Ke = /* @__PURE__ */ function(e) {
|
|
1048
|
-
return e.WEEKDAY = "weekday", e.TIME = "time", e.TOWN = "town", e.STATE = "state", e.WEEKDAY_STATE = "weekday_state", e;
|
|
1049
1047
|
}({}), qe = /* @__PURE__ */ function(e) {
|
|
1048
|
+
return e.WEEKDAY = "weekday", e.TIME = "time", e.TOWN = "town", e.STATE = "state", e.WEEKDAY_STATE = "weekday_state", e;
|
|
1049
|
+
}({}), Je = /* @__PURE__ */ function(e) {
|
|
1050
1050
|
return e.DANISH = "da", e.GERMAN = "de", e.GREEK = "el", e.ENGLISH = "en", e.SPANISH = "es", e.PERSIAN = "fa", e.FRENCH = "fr", e.ITALIAN = "it", e.POLISH = "pl", e.PORTUGUESE = "pt", e.RUSSIAN = "ru", e.SWEDISH = "sv", e;
|
|
1051
1051
|
}({});
|
|
1052
1052
|
//#endregion
|
|
1053
1053
|
//#region src/utils/url-builder.ts
|
|
1054
|
-
function
|
|
1054
|
+
function Ye(e) {
|
|
1055
1055
|
let { serverURL: t, format: n, endpoint: r, parameters: i = {} } = e, a = `${t.endsWith("/") ? t : `${t}/`}client_interface/${n}/`, o = new URLSearchParams();
|
|
1056
1056
|
return o.set("switcher", r), Object.entries(i).forEach(([e, t]) => {
|
|
1057
1057
|
t != null && (Array.isArray(t) ? t.forEach((t, n) => {
|
|
@@ -1059,7 +1059,7 @@ function Je(e) {
|
|
|
1059
1059
|
}) : typeof t == "boolean" ? o.set(e, t ? "1" : "0") : o.set(e, t.toString()));
|
|
1060
1060
|
}), `${a}?${o.toString()}`;
|
|
1061
1061
|
}
|
|
1062
|
-
function
|
|
1062
|
+
function Xe(e) {
|
|
1063
1063
|
let t = {};
|
|
1064
1064
|
return Object.entries(e).forEach(([e, n]) => {
|
|
1065
1065
|
if (n != null) if (Array.isArray(n)) t[e] = n.map((e) => {
|
|
@@ -1077,25 +1077,25 @@ function Ye(e) {
|
|
|
1077
1077
|
} else t[e] = n;
|
|
1078
1078
|
}), t;
|
|
1079
1079
|
}
|
|
1080
|
-
function
|
|
1080
|
+
function Ze(e, t) {
|
|
1081
1081
|
let n = {
|
|
1082
|
-
[
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1082
|
+
[J.GET_SEARCH_RESULTS]: [
|
|
1083
|
+
q.JSON,
|
|
1084
|
+
q.JSONP,
|
|
1085
|
+
q.TSML
|
|
1086
1086
|
],
|
|
1087
|
-
[
|
|
1088
|
-
[
|
|
1089
|
-
[
|
|
1090
|
-
[
|
|
1091
|
-
[
|
|
1092
|
-
[
|
|
1093
|
-
[
|
|
1094
|
-
[
|
|
1087
|
+
[J.GET_FORMATS]: [q.JSON, q.JSONP],
|
|
1088
|
+
[J.GET_SERVICE_BODIES]: [q.JSON, q.JSONP],
|
|
1089
|
+
[J.GET_CHANGES]: [q.JSON, q.JSONP],
|
|
1090
|
+
[J.GET_FIELD_KEYS]: [q.JSON, q.JSONP],
|
|
1091
|
+
[J.GET_FIELD_VALUES]: [q.JSON, q.JSONP],
|
|
1092
|
+
[J.GET_NAWS_DUMP]: [q.CSV],
|
|
1093
|
+
[J.GET_SERVER_INFO]: [q.JSON, q.JSONP],
|
|
1094
|
+
[J.GET_COVERAGE_AREA]: [q.JSON, q.JSONP]
|
|
1095
1095
|
}[e];
|
|
1096
1096
|
if (!n.includes(t)) throw Error(`Invalid format '${t}' for endpoint '${e}'. Valid formats: ${n.join(", ")}`);
|
|
1097
1097
|
}
|
|
1098
|
-
function
|
|
1098
|
+
function Qe(e) {
|
|
1099
1099
|
try {
|
|
1100
1100
|
let t = new URL(e);
|
|
1101
1101
|
if (!["http:", "https:"].includes(t.protocol)) throw Error("Server URL must use http or https protocol");
|
|
@@ -1105,10 +1105,10 @@ function Ze(e) {
|
|
|
1105
1105
|
throw n.cause = t, n;
|
|
1106
1106
|
}
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1108
|
+
function $e(e) {
|
|
1109
1109
|
return typeof e == "number" ? [e] : typeof e == "string" ? e.split(",").map((e) => parseInt(e.trim(), 10)).filter((e) => !isNaN(e)) : Array.isArray(e) ? e.map((e) => typeof e == "number" ? e : parseInt(String(e), 10)).filter((e) => !isNaN(e)) : [];
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1111
|
+
function et(e, t) {
|
|
1112
1112
|
let n = {};
|
|
1113
1113
|
if (typeof e == "number") {
|
|
1114
1114
|
if (e < 0 || e > 23) throw Error("Hours must be between 0 and 23");
|
|
@@ -1120,29 +1120,68 @@ function $e(e, t) {
|
|
|
1120
1120
|
}
|
|
1121
1121
|
return n;
|
|
1122
1122
|
}
|
|
1123
|
-
function
|
|
1123
|
+
function tt(e, t) {
|
|
1124
1124
|
if (typeof e != "number" || isNaN(e)) throw Error("Latitude must be a valid number");
|
|
1125
1125
|
if (typeof t != "number" || isNaN(t)) throw Error("Longitude must be a valid number");
|
|
1126
1126
|
if (e < -90 || e > 90) throw Error("Latitude must be between -90 and 90 degrees");
|
|
1127
1127
|
if (t < -180 || t > 180) throw Error("Longitude must be between -180 and 180 degrees");
|
|
1128
1128
|
}
|
|
1129
|
-
function
|
|
1129
|
+
function Z(e) {
|
|
1130
1130
|
if (typeof e != "number" || isNaN(e)) throw Error("Radius must be a valid number");
|
|
1131
1131
|
if (e <= 0) throw Error("Radius must be greater than 0");
|
|
1132
1132
|
}
|
|
1133
|
-
function
|
|
1133
|
+
function nt(e) {
|
|
1134
1134
|
return e * 1.60934;
|
|
1135
1135
|
}
|
|
1136
|
-
function
|
|
1136
|
+
function rt(e) {
|
|
1137
1137
|
return e / 1.60934;
|
|
1138
1138
|
}
|
|
1139
1139
|
//#endregion
|
|
1140
|
+
//#region src/utils/transforms.ts
|
|
1141
|
+
var Q = (e) => typeof e == "number" ? e : parseFloat(e), it = (e) => {
|
|
1142
|
+
if (!(e == null || e === "")) return Q(e);
|
|
1143
|
+
};
|
|
1144
|
+
function at(e) {
|
|
1145
|
+
let t = e;
|
|
1146
|
+
return {
|
|
1147
|
+
...t,
|
|
1148
|
+
weekday_tinyint: Q(t.weekday_tinyint),
|
|
1149
|
+
venue_type: Q(t.venue_type),
|
|
1150
|
+
published: Q(t.published),
|
|
1151
|
+
latitude: Q(t.latitude),
|
|
1152
|
+
longitude: Q(t.longitude),
|
|
1153
|
+
distance_in_km: it(t.distance_in_km),
|
|
1154
|
+
distance_in_miles: it(t.distance_in_miles)
|
|
1155
|
+
};
|
|
1156
|
+
}
|
|
1157
|
+
function ot(e) {
|
|
1158
|
+
let t = e;
|
|
1159
|
+
return {
|
|
1160
|
+
...t,
|
|
1161
|
+
versionInt: Q(t.versionInt),
|
|
1162
|
+
centerLongitude: Q(t.centerLongitude),
|
|
1163
|
+
centerLatitude: Q(t.centerLatitude),
|
|
1164
|
+
centerZoom: Q(t.centerZoom),
|
|
1165
|
+
semanticAdmin: Q(t.semanticAdmin),
|
|
1166
|
+
changesPerMeeting: Q(t.changesPerMeeting)
|
|
1167
|
+
};
|
|
1168
|
+
}
|
|
1169
|
+
function st(e) {
|
|
1170
|
+
let t = e;
|
|
1171
|
+
return {
|
|
1172
|
+
nw_corner_longitude: Q(t.nw_corner_longitude),
|
|
1173
|
+
nw_corner_latitude: Q(t.nw_corner_latitude),
|
|
1174
|
+
se_corner_longitude: Q(t.se_corner_longitude),
|
|
1175
|
+
se_corner_latitude: Q(t.se_corner_latitude)
|
|
1176
|
+
};
|
|
1177
|
+
}
|
|
1178
|
+
//#endregion
|
|
1140
1179
|
//#region src/client/bmlt-client.ts
|
|
1141
|
-
var
|
|
1180
|
+
var ct = class {
|
|
1142
1181
|
constructor(e) {
|
|
1143
1182
|
_(this, "timeout", void 0), _(this, "userAgent", void 0), _(this, "geocodingService", void 0), _(this, "serverURL", void 0), _(this, "defaultFormat", void 0);
|
|
1144
|
-
let { serverURL: t, defaultFormat: n =
|
|
1145
|
-
this.serverURL =
|
|
1183
|
+
let { serverURL: t, defaultFormat: n = q.JSON, timeout: r = 3e4, userAgent: i = "bmlt-query-client/1.0.0", geocodingOptions: a = {}, enableGeocoding: o = !0 } = e;
|
|
1184
|
+
this.serverURL = Qe(t), this.defaultFormat = n, this.timeout = r, this.userAgent = i, o && (this.geocodingService = new Ke(a));
|
|
1146
1185
|
}
|
|
1147
1186
|
async fetchAndParse(e, t, n = {}) {
|
|
1148
1187
|
let r;
|
|
@@ -1157,22 +1196,22 @@ var rt = class {
|
|
|
1157
1196
|
} finally {
|
|
1158
1197
|
clearTimeout(a);
|
|
1159
1198
|
}
|
|
1160
|
-
if (!r.ok) throw
|
|
1199
|
+
if (!r.ok) throw We.handleFetchError(/* @__PURE__ */ Error(`HTTP ${r.status}: ${r.statusText}`), r);
|
|
1161
1200
|
let o = await r.text();
|
|
1162
|
-
if (t ===
|
|
1163
|
-
if (t ===
|
|
1201
|
+
if (t === q.CSV) return o;
|
|
1202
|
+
if (t === q.JSONP) {
|
|
1164
1203
|
let e = n.callback || "callback", t = o.match(RegExp(`${e}\\((.+)\\);?$`));
|
|
1165
1204
|
if (!t) throw Error("Invalid JSONP response format");
|
|
1166
1205
|
return JSON.parse(t[1]);
|
|
1167
1206
|
}
|
|
1168
|
-
return t ===
|
|
1207
|
+
return t === q.JSON || t === q.TSML ? JSON.parse(o) : o;
|
|
1169
1208
|
} catch (e) {
|
|
1170
|
-
throw
|
|
1209
|
+
throw We.handleFetchError(e, r);
|
|
1171
1210
|
}
|
|
1172
1211
|
}
|
|
1173
1212
|
async makeRequest(e, t = {}, n = this.defaultFormat) {
|
|
1174
|
-
|
|
1175
|
-
let r =
|
|
1213
|
+
Ze(e, n);
|
|
1214
|
+
let r = Ye({
|
|
1176
1215
|
serverURL: this.serverURL,
|
|
1177
1216
|
format: n,
|
|
1178
1217
|
endpoint: e,
|
|
@@ -1186,14 +1225,17 @@ var rt = class {
|
|
|
1186
1225
|
}
|
|
1187
1226
|
async searchMeetings(e = {}) {
|
|
1188
1227
|
let { format: t = this.defaultFormat, ...n } = e;
|
|
1189
|
-
return this.makeRequest(
|
|
1228
|
+
return (await this.makeRequest(J.GET_SEARCH_RESULTS, n, t)).map(at);
|
|
1190
1229
|
}
|
|
1191
1230
|
async searchMeetingsWithFormats(e = {}) {
|
|
1192
|
-
let { format: t = this.defaultFormat, ...n } = e
|
|
1193
|
-
return this.makeRequest(Y.GET_SEARCH_RESULTS, {
|
|
1231
|
+
let { format: t = this.defaultFormat, ...n } = e, r = await this.makeRequest(J.GET_SEARCH_RESULTS, {
|
|
1194
1232
|
...n,
|
|
1195
1233
|
get_used_formats: !0
|
|
1196
1234
|
}, t);
|
|
1235
|
+
return {
|
|
1236
|
+
meetings: r.meetings.map(at),
|
|
1237
|
+
formats: r.formats
|
|
1238
|
+
};
|
|
1197
1239
|
}
|
|
1198
1240
|
async searchMeetingsByAddress(e) {
|
|
1199
1241
|
if (!this.geocodingService) throw Error("Geocoding is not enabled. Initialize client with enableGeocoding: true");
|
|
@@ -1203,45 +1245,45 @@ var rt = class {
|
|
|
1203
1245
|
long_val: o.coordinates.longitude,
|
|
1204
1246
|
sort_results_by_distance: i
|
|
1205
1247
|
};
|
|
1206
|
-
return n === void 0 ? r !== void 0 && (
|
|
1248
|
+
return n === void 0 ? r !== void 0 && (Z(r), s.geo_width_km = r) : (Z(n), s.geo_width = n), this.searchMeetings(s);
|
|
1207
1249
|
}
|
|
1208
1250
|
async searchMeetingsByCoordinates(e, t, n, r = {}) {
|
|
1209
|
-
|
|
1251
|
+
tt(e.latitude, e.longitude);
|
|
1210
1252
|
let i = {
|
|
1211
1253
|
...r,
|
|
1212
1254
|
lat_val: e.latitude,
|
|
1213
1255
|
long_val: e.longitude,
|
|
1214
1256
|
sort_results_by_distance: !0
|
|
1215
1257
|
};
|
|
1216
|
-
return t === void 0 ? n !== void 0 && (
|
|
1258
|
+
return t === void 0 ? n !== void 0 && (Z(n), i.geo_width_km = n) : (Z(t), i.geo_width = t), this.searchMeetings(i);
|
|
1217
1259
|
}
|
|
1218
1260
|
async getFormats(e = {}) {
|
|
1219
1261
|
let { format: t = this.defaultFormat, ...n } = e;
|
|
1220
|
-
return this.makeRequest(
|
|
1262
|
+
return this.makeRequest(J.GET_FORMATS, n, t);
|
|
1221
1263
|
}
|
|
1222
1264
|
async getServiceBodies(e = {}) {
|
|
1223
1265
|
let { format: t = this.defaultFormat, ...n } = e;
|
|
1224
|
-
return this.makeRequest(
|
|
1266
|
+
return this.makeRequest(J.GET_SERVICE_BODIES, n, t);
|
|
1225
1267
|
}
|
|
1226
1268
|
async getChanges(e = {}) {
|
|
1227
1269
|
let { format: t = this.defaultFormat, ...n } = e;
|
|
1228
|
-
return this.makeRequest(
|
|
1270
|
+
return this.makeRequest(J.GET_CHANGES, n, t);
|
|
1229
1271
|
}
|
|
1230
1272
|
async getFieldKeys() {
|
|
1231
|
-
return this.makeRequest(
|
|
1273
|
+
return this.makeRequest(J.GET_FIELD_KEYS);
|
|
1232
1274
|
}
|
|
1233
1275
|
async getFieldValues(e) {
|
|
1234
1276
|
let { format: t = this.defaultFormat, ...n } = e;
|
|
1235
|
-
return this.makeRequest(
|
|
1277
|
+
return this.makeRequest(J.GET_FIELD_VALUES, n, t);
|
|
1236
1278
|
}
|
|
1237
1279
|
async getNAWSDump(e) {
|
|
1238
|
-
return this.makeRequest(
|
|
1280
|
+
return this.makeRequest(J.GET_NAWS_DUMP, e, q.CSV);
|
|
1239
1281
|
}
|
|
1240
1282
|
async getServerInfo() {
|
|
1241
|
-
return (await this.makeRequest(
|
|
1283
|
+
return ot((await this.makeRequest(J.GET_SERVER_INFO))[0]);
|
|
1242
1284
|
}
|
|
1243
1285
|
async getCoverageArea() {
|
|
1244
|
-
return (await this.makeRequest(
|
|
1286
|
+
return st((await this.makeRequest(J.GET_COVERAGE_AREA))[0]);
|
|
1245
1287
|
}
|
|
1246
1288
|
async geocodeAddress(e, t) {
|
|
1247
1289
|
if (!this.geocodingService) throw Error("Geocoding is not enabled. Initialize client with enableGeocoding: true");
|
|
@@ -1255,7 +1297,7 @@ var rt = class {
|
|
|
1255
1297
|
return this.serverURL;
|
|
1256
1298
|
}
|
|
1257
1299
|
setServerURL(e) {
|
|
1258
|
-
this.serverURL =
|
|
1300
|
+
this.serverURL = Qe(e);
|
|
1259
1301
|
}
|
|
1260
1302
|
getDefaultFormat() {
|
|
1261
1303
|
return this.defaultFormat;
|
|
@@ -1304,16 +1346,16 @@ var rt = class {
|
|
|
1304
1346
|
return this.params.venue_types = e.length === 1 ? e[0] : e, this;
|
|
1305
1347
|
}
|
|
1306
1348
|
inPersonOnly() {
|
|
1307
|
-
return this.venueTypes(
|
|
1349
|
+
return this.venueTypes(X.IN_PERSON);
|
|
1308
1350
|
}
|
|
1309
1351
|
virtualOnly() {
|
|
1310
|
-
return this.venueTypes(
|
|
1352
|
+
return this.venueTypes(X.VIRTUAL);
|
|
1311
1353
|
}
|
|
1312
1354
|
hybridOnly() {
|
|
1313
|
-
return this.venueTypes(
|
|
1355
|
+
return this.venueTypes(X.HYBRID);
|
|
1314
1356
|
}
|
|
1315
1357
|
virtualOrHybrid() {
|
|
1316
|
-
return this.venueTypes(
|
|
1358
|
+
return this.venueTypes(X.VIRTUAL, X.HYBRID);
|
|
1317
1359
|
}
|
|
1318
1360
|
formats(e, t = !1) {
|
|
1319
1361
|
return Array.isArray(e) ? this.params.formats = t ? e.map((e) => -e) : e : this.params.formats = t ? -e : e, this;
|
|
@@ -1416,19 +1458,19 @@ var rt = class {
|
|
|
1416
1458
|
searchParams: this.params
|
|
1417
1459
|
});
|
|
1418
1460
|
}
|
|
1419
|
-
},
|
|
1461
|
+
}, lt = class {
|
|
1420
1462
|
constructor(e) {
|
|
1421
1463
|
_(this, "client", void 0), this.client = e;
|
|
1422
1464
|
}
|
|
1423
1465
|
today() {
|
|
1424
|
-
let e = (/* @__PURE__ */ new Date()).getDay(), t = e === 0 ?
|
|
1466
|
+
let e = (/* @__PURE__ */ new Date()).getDay(), t = e === 0 ? Y.SUNDAY : e;
|
|
1425
1467
|
return new $(this.client).onWeekdays(t);
|
|
1426
1468
|
}
|
|
1427
1469
|
weekend() {
|
|
1428
|
-
return new $(this.client).onWeekdays(
|
|
1470
|
+
return new $(this.client).onWeekdays(Y.SATURDAY, Y.SUNDAY);
|
|
1429
1471
|
}
|
|
1430
1472
|
weekdays() {
|
|
1431
|
-
return new $(this.client).onWeekdays(
|
|
1473
|
+
return new $(this.client).onWeekdays(Y.MONDAY, Y.TUESDAY, Y.WEDNESDAY, Y.THURSDAY, Y.FRIDAY);
|
|
1432
1474
|
}
|
|
1433
1475
|
evening() {
|
|
1434
1476
|
return new $(this.client).startingAfter(17);
|
|
@@ -1445,23 +1487,23 @@ var rt = class {
|
|
|
1445
1487
|
byText(e) {
|
|
1446
1488
|
return new $(this.client).searchText(e);
|
|
1447
1489
|
}
|
|
1448
|
-
},
|
|
1490
|
+
}, ut = [
|
|
1449
1491
|
"weekday_tinyint",
|
|
1450
1492
|
"start_time",
|
|
1451
1493
|
"meeting_name",
|
|
1452
1494
|
"location_text"
|
|
1453
1495
|
];
|
|
1454
|
-
function
|
|
1496
|
+
function dt(e, t) {
|
|
1455
1497
|
let n = e == null ? "" : String(e);
|
|
1456
1498
|
return t ? n.toLowerCase().trim() : n;
|
|
1457
1499
|
}
|
|
1458
|
-
function
|
|
1459
|
-
return t.map((t) =>
|
|
1500
|
+
function ft(e, t, n) {
|
|
1501
|
+
return t.map((t) => dt(e[t], n)).join(" | ");
|
|
1460
1502
|
}
|
|
1461
|
-
function
|
|
1462
|
-
let { fields: n =
|
|
1503
|
+
function pt(e, t = {}) {
|
|
1504
|
+
let { fields: n = ut, normalize: r = !0 } = t, i = /* @__PURE__ */ new Map();
|
|
1463
1505
|
for (let t = 0; t < e.length; t++) for (let a of e[t]) {
|
|
1464
|
-
let e =
|
|
1506
|
+
let e = ft(a, n, r);
|
|
1465
1507
|
i.has(e) || i.set(e, []), i.get(e).push({
|
|
1466
1508
|
meeting: a,
|
|
1467
1509
|
listIndex: t
|
|
@@ -1474,7 +1516,7 @@ function ct(e, t = {}) {
|
|
|
1474
1516
|
});
|
|
1475
1517
|
return a;
|
|
1476
1518
|
}
|
|
1477
|
-
function
|
|
1519
|
+
function mt(e) {
|
|
1478
1520
|
let t = /* @__PURE__ */ new Map();
|
|
1479
1521
|
for (let { service_body_bigint: n, meeting_name: r } of e) {
|
|
1480
1522
|
if (!n || !r) continue;
|
|
@@ -1486,6 +1528,6 @@ function lt(e) {
|
|
|
1486
1528
|
return n;
|
|
1487
1529
|
}
|
|
1488
1530
|
//#endregion
|
|
1489
|
-
export {
|
|
1531
|
+
export { ct as BmltClient, q as BmltDataFormat, J as BmltEndpoint, Ue as BmltErrorType, G as BmltQueryError, K as ErrorFactory, We as ErrorHandler, Ke as GeocodingService, Je as Language, $ as MeetingQueryBuilder, lt as QuickSearch, Ge as RetryHandler, qe as SortKey, X as VenueType, Y as Weekday, Ye as buildBmltURL, mt as countUniqueGroups, $e as extractIds, pt as findDuplicateMeetings, et as formatTimeValue, rt as kilometersToMiles, nt as milesToKilometers, Xe as normalizeParameters, tt as validateCoordinates, Ze as validateEndpointFormat, Z as validateRadius, Qe as validateServerURL };
|
|
1490
1532
|
|
|
1491
1533
|
//# sourceMappingURL=app.js.map
|