bmlt-query-client 1.4.0 → 1.4.2
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/.claude/settings.local.json +12 -5
- package/CHANGELOG.md +16 -1
- package/CLAUDE.md +39 -0
- package/dist/app.d.ts +43 -37
- package/dist/app.js +195 -151
- 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) => {
|
|
@@ -555,7 +555,10 @@ var ye = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), T = /
|
|
|
555
555
|
return b(L, this) === b(R, this) && b(I, this).size > 0 || this.isRateLimited && b(I, this).size > 0;
|
|
556
556
|
}
|
|
557
557
|
get runningTasks() {
|
|
558
|
-
return [...b(B, this).values()].map((e) => ({
|
|
558
|
+
return [...b(B, this).values()].map((e) => ({
|
|
559
|
+
...e,
|
|
560
|
+
timeoutRemaining: e.timeout ? Math.max(0, e.startTime + e.timeout - Date.now()) : void 0
|
|
561
|
+
}));
|
|
559
562
|
}
|
|
560
563
|
};
|
|
561
564
|
function we(e) {
|
|
@@ -593,10 +596,10 @@ function ke() {
|
|
|
593
596
|
}
|
|
594
597
|
function Ae() {
|
|
595
598
|
var e;
|
|
596
|
-
x(L, this, (e = b(L, this), e--, e)), b(L, this) === 0 && this.emit("pendingZero"), y(H, this,
|
|
599
|
+
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
600
|
}
|
|
598
601
|
function je() {
|
|
599
|
-
x(M, this, void 0), y(H, this,
|
|
602
|
+
x(M, this, void 0), y(H, this, Re).call(this), y(H, this, Le).call(this);
|
|
600
603
|
}
|
|
601
604
|
function Me(e) {
|
|
602
605
|
if (b(N, this)) {
|
|
@@ -629,7 +632,7 @@ function Pe() {
|
|
|
629
632
|
function Fe() {
|
|
630
633
|
b(M, this) && (clearTimeout(b(M, this)), x(M, this, void 0));
|
|
631
634
|
}
|
|
632
|
-
function
|
|
635
|
+
function Ie() {
|
|
633
636
|
if (b(I, this).size === 0) {
|
|
634
637
|
if (y(H, this, Pe).call(this), this.emit("empty"), b(L, this) === 0) {
|
|
635
638
|
if (y(H, this, Fe).call(this), b(N, this) && b(F, this) > 0) {
|
|
@@ -645,23 +648,23 @@ function U() {
|
|
|
645
648
|
let t = Date.now(), n = !y(H, this, Me).call(this, t);
|
|
646
649
|
if (Oe.call(y(H, this)) && ke.call(y(H, this))) {
|
|
647
650
|
let r = b(I, this).dequeue();
|
|
648
|
-
b(w, this) || (y(H, this, Te).call(this, t), y(H, this,
|
|
651
|
+
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
652
|
}
|
|
650
653
|
}
|
|
651
654
|
return e;
|
|
652
655
|
}
|
|
653
|
-
function
|
|
656
|
+
function Le() {
|
|
654
657
|
b(w, this) || b(j, this) !== void 0 || b(N, this) || (x(j, this, setInterval(() => {
|
|
655
|
-
y(H, this,
|
|
658
|
+
y(H, this, Re).call(this);
|
|
656
659
|
}, b(k, this))), x(be, this, Date.now() + b(k, this)));
|
|
657
660
|
}
|
|
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
661
|
function Re() {
|
|
662
|
-
|
|
662
|
+
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);
|
|
663
663
|
}
|
|
664
|
-
|
|
664
|
+
function ze() {
|
|
665
|
+
for (; y(H, this, Ie).call(this););
|
|
666
|
+
}
|
|
667
|
+
async function U(e, t) {
|
|
665
668
|
return new Promise((n) => {
|
|
666
669
|
let r = () => {
|
|
667
670
|
t && !t() || (this.off(e, r), n());
|
|
@@ -669,22 +672,22 @@ async function W(e, t) {
|
|
|
669
672
|
this.on(e, r);
|
|
670
673
|
});
|
|
671
674
|
}
|
|
672
|
-
function
|
|
675
|
+
function Be() {
|
|
673
676
|
b(w, this) || (this.on("add", () => {
|
|
674
|
-
b(I, this).size > 0 && y(H, this,
|
|
677
|
+
b(I, this).size > 0 && y(H, this, W).call(this);
|
|
675
678
|
}), this.on("next", () => {
|
|
676
|
-
y(H, this,
|
|
679
|
+
y(H, this, W).call(this);
|
|
677
680
|
}));
|
|
678
681
|
}
|
|
679
|
-
function
|
|
682
|
+
function W() {
|
|
680
683
|
b(w, this) || b(O, this) || (x(O, this, !0), queueMicrotask(() => {
|
|
681
|
-
x(O, this, !1), y(H, this,
|
|
684
|
+
x(O, this, !1), y(H, this, He).call(this);
|
|
682
685
|
}));
|
|
683
686
|
}
|
|
684
|
-
function Be() {
|
|
685
|
-
b(w, this) || (y(H, this, Ee).call(this), y(H, this, G).call(this));
|
|
686
|
-
}
|
|
687
687
|
function Ve() {
|
|
688
|
+
b(w, this) || (y(H, this, Ee).call(this), y(H, this, W).call(this));
|
|
689
|
+
}
|
|
690
|
+
function He() {
|
|
688
691
|
let e = b(D, this);
|
|
689
692
|
if (b(w, this) || b(I, this).size === 0) {
|
|
690
693
|
e && (x(D, this, !1), this.emit("rateLimitCleared"));
|
|
@@ -700,9 +703,9 @@ function Ve() {
|
|
|
700
703
|
}
|
|
701
704
|
//#endregion
|
|
702
705
|
//#region src/utils/errors.ts
|
|
703
|
-
var
|
|
706
|
+
var Ue = /* @__PURE__ */ function(e) {
|
|
704
707
|
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
|
-
}({}),
|
|
708
|
+
}({}), G = class e extends Error {
|
|
706
709
|
constructor(t, n, r = {}) {
|
|
707
710
|
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
711
|
}
|
|
@@ -753,55 +756,55 @@ var He = /* @__PURE__ */ function(e) {
|
|
|
753
756
|
} : void 0
|
|
754
757
|
};
|
|
755
758
|
}
|
|
756
|
-
},
|
|
759
|
+
}, K = class {
|
|
757
760
|
static createApiError(e, t, n, r) {
|
|
758
761
|
let i;
|
|
759
|
-
return i = t ? t >= 500 ? "ServerError" : t === 401 || t === 403 ? "AuthenticationError" : t === 429 ? "RateLimitError" : t >= 400 ? "ClientError" : "ApiError" : "ApiError", new
|
|
762
|
+
return i = t ? t >= 500 ? "ServerError" : t === 401 || t === 403 ? "AuthenticationError" : t === 429 ? "RateLimitError" : t >= 400 ? "ClientError" : "ApiError" : "ApiError", new G(i, e, {
|
|
760
763
|
statusCode: t,
|
|
761
764
|
response: n,
|
|
762
765
|
originalError: r
|
|
763
766
|
});
|
|
764
767
|
}
|
|
765
768
|
static createNetworkError(e, t) {
|
|
766
|
-
return new
|
|
769
|
+
return new G("NetworkError", e, { originalError: t });
|
|
767
770
|
}
|
|
768
771
|
static createTimeoutError(e, t) {
|
|
769
|
-
return new
|
|
772
|
+
return new G("TimeoutError", e, { originalError: t });
|
|
770
773
|
}
|
|
771
774
|
static createValidationError(e, t) {
|
|
772
|
-
return new
|
|
775
|
+
return new G("ValidationError", e, { context: t });
|
|
773
776
|
}
|
|
774
777
|
static createGeocodingError(e, t, n) {
|
|
775
|
-
return new
|
|
778
|
+
return new G("GeocodingError", e, {
|
|
776
779
|
originalError: t,
|
|
777
780
|
context: n
|
|
778
781
|
});
|
|
779
782
|
}
|
|
780
783
|
static createRateLimitError(e, t, n) {
|
|
781
|
-
return new
|
|
784
|
+
return new G("RateLimitError", e, {
|
|
782
785
|
statusCode: t,
|
|
783
786
|
response: n
|
|
784
787
|
});
|
|
785
788
|
}
|
|
786
789
|
static createConfigurationError(e, t) {
|
|
787
|
-
return new
|
|
790
|
+
return new G("ConfigurationError", e, { context: t });
|
|
788
791
|
}
|
|
789
|
-
},
|
|
792
|
+
}, We = class e {
|
|
790
793
|
static handleFetchError(e, t) {
|
|
791
|
-
if (e instanceof Error && e.name === "AbortError") return
|
|
792
|
-
if (e instanceof TypeError) return
|
|
794
|
+
if (e instanceof Error && e.name === "AbortError") return K.createTimeoutError("Request timeout", e);
|
|
795
|
+
if (e instanceof TypeError) return K.createNetworkError("Network connection failed", e);
|
|
793
796
|
if (t && !t.ok) {
|
|
794
797
|
let n = `HTTP ${t.status}: ${t.statusText}`;
|
|
795
|
-
return
|
|
798
|
+
return K.createApiError(n, t.status, void 0, e);
|
|
796
799
|
}
|
|
797
|
-
return e instanceof Error ?
|
|
800
|
+
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
801
|
}
|
|
799
802
|
static handleAxiosError(t) {
|
|
800
803
|
return e.handleFetchError(t);
|
|
801
804
|
}
|
|
802
805
|
static handleValidationError(e, t, n, r) {
|
|
803
806
|
let i = `Invalid ${e}: expected ${n}`;
|
|
804
|
-
return r && r.length > 0 && (i += ` (${r.join(", ")})`),
|
|
807
|
+
return r && r.length > 0 && (i += ` (${r.join(", ")})`), K.createValidationError(i, {
|
|
805
808
|
field: e,
|
|
806
809
|
value: t,
|
|
807
810
|
expectedType: n,
|
|
@@ -810,21 +813,21 @@ var He = /* @__PURE__ */ function(e) {
|
|
|
810
813
|
}
|
|
811
814
|
static handleEndpointError(e, t) {
|
|
812
815
|
let n = `Invalid endpoint/format combination: ${e} with ${t}`;
|
|
813
|
-
return
|
|
816
|
+
return K.createValidationError(n, {
|
|
814
817
|
endpoint: e,
|
|
815
818
|
format: t
|
|
816
819
|
});
|
|
817
820
|
}
|
|
818
821
|
static handleUrlError(e, t) {
|
|
819
822
|
let n = `Invalid URL: ${t}`;
|
|
820
|
-
return
|
|
823
|
+
return K.createValidationError(n, {
|
|
821
824
|
url: e,
|
|
822
825
|
reason: t
|
|
823
826
|
});
|
|
824
827
|
}
|
|
825
828
|
static handleCoordinateError(e, t, n) {
|
|
826
829
|
let r = n || "Invalid coordinates provided";
|
|
827
|
-
return
|
|
830
|
+
return K.createValidationError(r, {
|
|
828
831
|
latitude: e,
|
|
829
832
|
longitude: t,
|
|
830
833
|
reason: n
|
|
@@ -832,7 +835,7 @@ var He = /* @__PURE__ */ function(e) {
|
|
|
832
835
|
}
|
|
833
836
|
static wrapError(e, t, n) {
|
|
834
837
|
let r = `${t}: ${e.message}`;
|
|
835
|
-
return e instanceof
|
|
838
|
+
return e instanceof G ? new G(e.type, r, {
|
|
836
839
|
statusCode: e.statusCode,
|
|
837
840
|
response: e.response,
|
|
838
841
|
originalError: e.originalError || e,
|
|
@@ -840,22 +843,22 @@ var He = /* @__PURE__ */ function(e) {
|
|
|
840
843
|
...e.context,
|
|
841
844
|
...n
|
|
842
845
|
}
|
|
843
|
-
}) :
|
|
846
|
+
}) : K.createApiError(r, void 0, void 0, e);
|
|
844
847
|
}
|
|
845
|
-
},
|
|
848
|
+
}, Ge = class {
|
|
846
849
|
static async withRetry(e, t) {
|
|
847
850
|
let { maxRetries: n, baseDelay: r, maxDelay: i, factor: a, onRetry: o } = t, s;
|
|
848
851
|
for (let t = 0; t <= n; t++) try {
|
|
849
852
|
return await e();
|
|
850
853
|
} catch (e) {
|
|
851
|
-
let c = e instanceof
|
|
854
|
+
let c = e instanceof G ? e : We.wrapError(e, "Operation failed");
|
|
852
855
|
if (s = c, t === n || !c.isRetryable()) throw c;
|
|
853
856
|
let l = Math.min(r * a ** +t, i);
|
|
854
857
|
o && o(c, t + 1), await new Promise((e) => setTimeout(e, l));
|
|
855
858
|
}
|
|
856
859
|
throw s;
|
|
857
860
|
}
|
|
858
|
-
},
|
|
861
|
+
}, Ke = class {
|
|
859
862
|
constructor(e = {}) {
|
|
860
863
|
_(this, "baseURL", void 0), _(this, "queue", void 0), _(this, "defaultOptions", void 0);
|
|
861
864
|
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 +930,7 @@ var He = /* @__PURE__ */ function(e) {
|
|
|
927
930
|
r.searchParams.append(e, String(t));
|
|
928
931
|
});
|
|
929
932
|
let i = await this.fetchWithTimeout(r.toString(), n.timeout, n.userAgent);
|
|
930
|
-
if (!i || i.length === 0) throw new
|
|
933
|
+
if (!i || i.length === 0) throw new G(Ue.GEOCODING_ERROR, `No results found for address: ${e}`);
|
|
931
934
|
let a = i[0], o = {
|
|
932
935
|
latitude: parseFloat(a.lat),
|
|
933
936
|
longitude: parseFloat(a.lon)
|
|
@@ -1036,22 +1039,22 @@ var He = /* @__PURE__ */ function(e) {
|
|
|
1036
1039
|
if (!e || e.trim().length === 0) throw Error("User agent must be a non-empty string");
|
|
1037
1040
|
this.defaultOptions.userAgent = e.trim();
|
|
1038
1041
|
}
|
|
1039
|
-
},
|
|
1042
|
+
}, q = /* @__PURE__ */ function(e) {
|
|
1040
1043
|
return e.JSON = "json", e.JSONP = "jsonp", e.TSML = "tsml", e.CSV = "csv", e;
|
|
1041
|
-
}({}),
|
|
1044
|
+
}({}), J = /* @__PURE__ */ function(e) {
|
|
1042
1045
|
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
|
-
}({}),
|
|
1046
|
+
}({}), Y = /* @__PURE__ */ function(e) {
|
|
1044
1047
|
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
|
-
}({}),
|
|
1048
|
+
}({}), X = /* @__PURE__ */ function(e) {
|
|
1046
1049
|
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
1050
|
}({}), qe = /* @__PURE__ */ function(e) {
|
|
1051
|
+
return e.WEEKDAY = "weekday", e.TIME = "time", e.TOWN = "town", e.STATE = "state", e.WEEKDAY_STATE = "weekday_state", e;
|
|
1052
|
+
}({}), Je = /* @__PURE__ */ function(e) {
|
|
1050
1053
|
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
1054
|
}({});
|
|
1052
1055
|
//#endregion
|
|
1053
1056
|
//#region src/utils/url-builder.ts
|
|
1054
|
-
function
|
|
1057
|
+
function Ye(e) {
|
|
1055
1058
|
let { serverURL: t, format: n, endpoint: r, parameters: i = {} } = e, a = `${t.endsWith("/") ? t : `${t}/`}client_interface/${n}/`, o = new URLSearchParams();
|
|
1056
1059
|
return o.set("switcher", r), Object.entries(i).forEach(([e, t]) => {
|
|
1057
1060
|
t != null && (Array.isArray(t) ? t.forEach((t, n) => {
|
|
@@ -1059,7 +1062,7 @@ function Je(e) {
|
|
|
1059
1062
|
}) : typeof t == "boolean" ? o.set(e, t ? "1" : "0") : o.set(e, t.toString()));
|
|
1060
1063
|
}), `${a}?${o.toString()}`;
|
|
1061
1064
|
}
|
|
1062
|
-
function
|
|
1065
|
+
function Xe(e) {
|
|
1063
1066
|
let t = {};
|
|
1064
1067
|
return Object.entries(e).forEach(([e, n]) => {
|
|
1065
1068
|
if (n != null) if (Array.isArray(n)) t[e] = n.map((e) => {
|
|
@@ -1077,25 +1080,25 @@ function Ye(e) {
|
|
|
1077
1080
|
} else t[e] = n;
|
|
1078
1081
|
}), t;
|
|
1079
1082
|
}
|
|
1080
|
-
function
|
|
1083
|
+
function Ze(e, t) {
|
|
1081
1084
|
let n = {
|
|
1082
|
-
[
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1085
|
+
[J.GET_SEARCH_RESULTS]: [
|
|
1086
|
+
q.JSON,
|
|
1087
|
+
q.JSONP,
|
|
1088
|
+
q.TSML
|
|
1086
1089
|
],
|
|
1087
|
-
[
|
|
1088
|
-
[
|
|
1089
|
-
[
|
|
1090
|
-
[
|
|
1091
|
-
[
|
|
1092
|
-
[
|
|
1093
|
-
[
|
|
1094
|
-
[
|
|
1090
|
+
[J.GET_FORMATS]: [q.JSON, q.JSONP],
|
|
1091
|
+
[J.GET_SERVICE_BODIES]: [q.JSON, q.JSONP],
|
|
1092
|
+
[J.GET_CHANGES]: [q.JSON, q.JSONP],
|
|
1093
|
+
[J.GET_FIELD_KEYS]: [q.JSON, q.JSONP],
|
|
1094
|
+
[J.GET_FIELD_VALUES]: [q.JSON, q.JSONP],
|
|
1095
|
+
[J.GET_NAWS_DUMP]: [q.CSV],
|
|
1096
|
+
[J.GET_SERVER_INFO]: [q.JSON, q.JSONP],
|
|
1097
|
+
[J.GET_COVERAGE_AREA]: [q.JSON, q.JSONP]
|
|
1095
1098
|
}[e];
|
|
1096
1099
|
if (!n.includes(t)) throw Error(`Invalid format '${t}' for endpoint '${e}'. Valid formats: ${n.join(", ")}`);
|
|
1097
1100
|
}
|
|
1098
|
-
function
|
|
1101
|
+
function Qe(e) {
|
|
1099
1102
|
try {
|
|
1100
1103
|
let t = new URL(e);
|
|
1101
1104
|
if (!["http:", "https:"].includes(t.protocol)) throw Error("Server URL must use http or https protocol");
|
|
@@ -1105,10 +1108,10 @@ function Ze(e) {
|
|
|
1105
1108
|
throw n.cause = t, n;
|
|
1106
1109
|
}
|
|
1107
1110
|
}
|
|
1108
|
-
function
|
|
1111
|
+
function $e(e) {
|
|
1109
1112
|
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
1113
|
}
|
|
1111
|
-
function
|
|
1114
|
+
function et(e, t) {
|
|
1112
1115
|
let n = {};
|
|
1113
1116
|
if (typeof e == "number") {
|
|
1114
1117
|
if (e < 0 || e > 23) throw Error("Hours must be between 0 and 23");
|
|
@@ -1120,29 +1123,68 @@ function $e(e, t) {
|
|
|
1120
1123
|
}
|
|
1121
1124
|
return n;
|
|
1122
1125
|
}
|
|
1123
|
-
function
|
|
1126
|
+
function tt(e, t) {
|
|
1124
1127
|
if (typeof e != "number" || isNaN(e)) throw Error("Latitude must be a valid number");
|
|
1125
1128
|
if (typeof t != "number" || isNaN(t)) throw Error("Longitude must be a valid number");
|
|
1126
1129
|
if (e < -90 || e > 90) throw Error("Latitude must be between -90 and 90 degrees");
|
|
1127
1130
|
if (t < -180 || t > 180) throw Error("Longitude must be between -180 and 180 degrees");
|
|
1128
1131
|
}
|
|
1129
|
-
function
|
|
1132
|
+
function Z(e) {
|
|
1130
1133
|
if (typeof e != "number" || isNaN(e)) throw Error("Radius must be a valid number");
|
|
1131
1134
|
if (e <= 0) throw Error("Radius must be greater than 0");
|
|
1132
1135
|
}
|
|
1133
|
-
function
|
|
1136
|
+
function nt(e) {
|
|
1134
1137
|
return e * 1.60934;
|
|
1135
1138
|
}
|
|
1136
|
-
function
|
|
1139
|
+
function rt(e) {
|
|
1137
1140
|
return e / 1.60934;
|
|
1138
1141
|
}
|
|
1139
1142
|
//#endregion
|
|
1143
|
+
//#region src/utils/transforms.ts
|
|
1144
|
+
var Q = (e) => typeof e == "number" ? e : parseFloat(e), it = (e) => {
|
|
1145
|
+
if (!(e == null || e === "")) return Q(e);
|
|
1146
|
+
};
|
|
1147
|
+
function at(e) {
|
|
1148
|
+
let t = e;
|
|
1149
|
+
return {
|
|
1150
|
+
...t,
|
|
1151
|
+
weekday_tinyint: Q(t.weekday_tinyint),
|
|
1152
|
+
venue_type: Q(t.venue_type),
|
|
1153
|
+
published: Q(t.published),
|
|
1154
|
+
latitude: Q(t.latitude),
|
|
1155
|
+
longitude: Q(t.longitude),
|
|
1156
|
+
distance_in_km: it(t.distance_in_km),
|
|
1157
|
+
distance_in_miles: it(t.distance_in_miles)
|
|
1158
|
+
};
|
|
1159
|
+
}
|
|
1160
|
+
function ot(e) {
|
|
1161
|
+
let t = e;
|
|
1162
|
+
return {
|
|
1163
|
+
...t,
|
|
1164
|
+
versionInt: Q(t.versionInt),
|
|
1165
|
+
centerLongitude: Q(t.centerLongitude),
|
|
1166
|
+
centerLatitude: Q(t.centerLatitude),
|
|
1167
|
+
centerZoom: Q(t.centerZoom),
|
|
1168
|
+
semanticAdmin: Q(t.semanticAdmin),
|
|
1169
|
+
changesPerMeeting: Q(t.changesPerMeeting)
|
|
1170
|
+
};
|
|
1171
|
+
}
|
|
1172
|
+
function st(e) {
|
|
1173
|
+
let t = e;
|
|
1174
|
+
return {
|
|
1175
|
+
nw_corner_longitude: Q(t.nw_corner_longitude),
|
|
1176
|
+
nw_corner_latitude: Q(t.nw_corner_latitude),
|
|
1177
|
+
se_corner_longitude: Q(t.se_corner_longitude),
|
|
1178
|
+
se_corner_latitude: Q(t.se_corner_latitude)
|
|
1179
|
+
};
|
|
1180
|
+
}
|
|
1181
|
+
//#endregion
|
|
1140
1182
|
//#region src/client/bmlt-client.ts
|
|
1141
|
-
var
|
|
1183
|
+
var ct = class {
|
|
1142
1184
|
constructor(e) {
|
|
1143
1185
|
_(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 =
|
|
1186
|
+
let { serverURL: t, defaultFormat: n = q.JSON, timeout: r = 3e4, userAgent: i = "bmlt-query-client/1.0.0", geocodingOptions: a = {}, enableGeocoding: o = !0 } = e;
|
|
1187
|
+
this.serverURL = Qe(t), this.defaultFormat = n, this.timeout = r, this.userAgent = i, o && (this.geocodingService = new Ke(a));
|
|
1146
1188
|
}
|
|
1147
1189
|
async fetchAndParse(e, t, n = {}) {
|
|
1148
1190
|
let r;
|
|
@@ -1157,22 +1199,22 @@ var rt = class {
|
|
|
1157
1199
|
} finally {
|
|
1158
1200
|
clearTimeout(a);
|
|
1159
1201
|
}
|
|
1160
|
-
if (!r.ok) throw
|
|
1202
|
+
if (!r.ok) throw We.handleFetchError(/* @__PURE__ */ Error(`HTTP ${r.status}: ${r.statusText}`), r);
|
|
1161
1203
|
let o = await r.text();
|
|
1162
|
-
if (t ===
|
|
1163
|
-
if (t ===
|
|
1204
|
+
if (t === q.CSV) return o;
|
|
1205
|
+
if (t === q.JSONP) {
|
|
1164
1206
|
let e = n.callback || "callback", t = o.match(RegExp(`${e}\\((.+)\\);?$`));
|
|
1165
1207
|
if (!t) throw Error("Invalid JSONP response format");
|
|
1166
1208
|
return JSON.parse(t[1]);
|
|
1167
1209
|
}
|
|
1168
|
-
return t ===
|
|
1210
|
+
return t === q.JSON || t === q.TSML ? JSON.parse(o) : o;
|
|
1169
1211
|
} catch (e) {
|
|
1170
|
-
throw
|
|
1212
|
+
throw We.handleFetchError(e, r);
|
|
1171
1213
|
}
|
|
1172
1214
|
}
|
|
1173
1215
|
async makeRequest(e, t = {}, n = this.defaultFormat) {
|
|
1174
|
-
|
|
1175
|
-
let r =
|
|
1216
|
+
Ze(e, n);
|
|
1217
|
+
let r = Ye({
|
|
1176
1218
|
serverURL: this.serverURL,
|
|
1177
1219
|
format: n,
|
|
1178
1220
|
endpoint: e,
|
|
@@ -1186,14 +1228,17 @@ var rt = class {
|
|
|
1186
1228
|
}
|
|
1187
1229
|
async searchMeetings(e = {}) {
|
|
1188
1230
|
let { format: t = this.defaultFormat, ...n } = e;
|
|
1189
|
-
return this.makeRequest(
|
|
1231
|
+
return (await this.makeRequest(J.GET_SEARCH_RESULTS, n, t)).map(at);
|
|
1190
1232
|
}
|
|
1191
1233
|
async searchMeetingsWithFormats(e = {}) {
|
|
1192
|
-
let { format: t = this.defaultFormat, ...n } = e
|
|
1193
|
-
return this.makeRequest(Y.GET_SEARCH_RESULTS, {
|
|
1234
|
+
let { format: t = this.defaultFormat, ...n } = e, r = await this.makeRequest(J.GET_SEARCH_RESULTS, {
|
|
1194
1235
|
...n,
|
|
1195
1236
|
get_used_formats: !0
|
|
1196
1237
|
}, t);
|
|
1238
|
+
return {
|
|
1239
|
+
meetings: r.meetings.map(at),
|
|
1240
|
+
formats: r.formats
|
|
1241
|
+
};
|
|
1197
1242
|
}
|
|
1198
1243
|
async searchMeetingsByAddress(e) {
|
|
1199
1244
|
if (!this.geocodingService) throw Error("Geocoding is not enabled. Initialize client with enableGeocoding: true");
|
|
@@ -1203,45 +1248,45 @@ var rt = class {
|
|
|
1203
1248
|
long_val: o.coordinates.longitude,
|
|
1204
1249
|
sort_results_by_distance: i
|
|
1205
1250
|
};
|
|
1206
|
-
return n === void 0 ? r !== void 0 && (
|
|
1251
|
+
return n === void 0 ? r !== void 0 && (Z(r), s.geo_width_km = r) : (Z(n), s.geo_width = n), this.searchMeetings(s);
|
|
1207
1252
|
}
|
|
1208
1253
|
async searchMeetingsByCoordinates(e, t, n, r = {}) {
|
|
1209
|
-
|
|
1254
|
+
tt(e.latitude, e.longitude);
|
|
1210
1255
|
let i = {
|
|
1211
1256
|
...r,
|
|
1212
1257
|
lat_val: e.latitude,
|
|
1213
1258
|
long_val: e.longitude,
|
|
1214
1259
|
sort_results_by_distance: !0
|
|
1215
1260
|
};
|
|
1216
|
-
return t === void 0 ? n !== void 0 && (
|
|
1261
|
+
return t === void 0 ? n !== void 0 && (Z(n), i.geo_width_km = n) : (Z(t), i.geo_width = t), this.searchMeetings(i);
|
|
1217
1262
|
}
|
|
1218
1263
|
async getFormats(e = {}) {
|
|
1219
1264
|
let { format: t = this.defaultFormat, ...n } = e;
|
|
1220
|
-
return this.makeRequest(
|
|
1265
|
+
return this.makeRequest(J.GET_FORMATS, n, t);
|
|
1221
1266
|
}
|
|
1222
1267
|
async getServiceBodies(e = {}) {
|
|
1223
1268
|
let { format: t = this.defaultFormat, ...n } = e;
|
|
1224
|
-
return this.makeRequest(
|
|
1269
|
+
return this.makeRequest(J.GET_SERVICE_BODIES, n, t);
|
|
1225
1270
|
}
|
|
1226
1271
|
async getChanges(e = {}) {
|
|
1227
1272
|
let { format: t = this.defaultFormat, ...n } = e;
|
|
1228
|
-
return this.makeRequest(
|
|
1273
|
+
return this.makeRequest(J.GET_CHANGES, n, t);
|
|
1229
1274
|
}
|
|
1230
1275
|
async getFieldKeys() {
|
|
1231
|
-
return this.makeRequest(
|
|
1276
|
+
return this.makeRequest(J.GET_FIELD_KEYS);
|
|
1232
1277
|
}
|
|
1233
1278
|
async getFieldValues(e) {
|
|
1234
1279
|
let { format: t = this.defaultFormat, ...n } = e;
|
|
1235
|
-
return this.makeRequest(
|
|
1280
|
+
return this.makeRequest(J.GET_FIELD_VALUES, n, t);
|
|
1236
1281
|
}
|
|
1237
1282
|
async getNAWSDump(e) {
|
|
1238
|
-
return this.makeRequest(
|
|
1283
|
+
return this.makeRequest(J.GET_NAWS_DUMP, e, q.CSV);
|
|
1239
1284
|
}
|
|
1240
1285
|
async getServerInfo() {
|
|
1241
|
-
return (await this.makeRequest(
|
|
1286
|
+
return ot((await this.makeRequest(J.GET_SERVER_INFO))[0]);
|
|
1242
1287
|
}
|
|
1243
1288
|
async getCoverageArea() {
|
|
1244
|
-
return (await this.makeRequest(
|
|
1289
|
+
return st((await this.makeRequest(J.GET_COVERAGE_AREA))[0]);
|
|
1245
1290
|
}
|
|
1246
1291
|
async geocodeAddress(e, t) {
|
|
1247
1292
|
if (!this.geocodingService) throw Error("Geocoding is not enabled. Initialize client with enableGeocoding: true");
|
|
@@ -1255,7 +1300,7 @@ var rt = class {
|
|
|
1255
1300
|
return this.serverURL;
|
|
1256
1301
|
}
|
|
1257
1302
|
setServerURL(e) {
|
|
1258
|
-
this.serverURL =
|
|
1303
|
+
this.serverURL = Qe(e);
|
|
1259
1304
|
}
|
|
1260
1305
|
getDefaultFormat() {
|
|
1261
1306
|
return this.defaultFormat;
|
|
@@ -1304,16 +1349,16 @@ var rt = class {
|
|
|
1304
1349
|
return this.params.venue_types = e.length === 1 ? e[0] : e, this;
|
|
1305
1350
|
}
|
|
1306
1351
|
inPersonOnly() {
|
|
1307
|
-
return this.venueTypes(
|
|
1352
|
+
return this.venueTypes(X.IN_PERSON);
|
|
1308
1353
|
}
|
|
1309
1354
|
virtualOnly() {
|
|
1310
|
-
return this.venueTypes(
|
|
1355
|
+
return this.venueTypes(X.VIRTUAL);
|
|
1311
1356
|
}
|
|
1312
1357
|
hybridOnly() {
|
|
1313
|
-
return this.venueTypes(
|
|
1358
|
+
return this.venueTypes(X.HYBRID);
|
|
1314
1359
|
}
|
|
1315
1360
|
virtualOrHybrid() {
|
|
1316
|
-
return this.venueTypes(
|
|
1361
|
+
return this.venueTypes(X.VIRTUAL, X.HYBRID);
|
|
1317
1362
|
}
|
|
1318
1363
|
formats(e, t = !1) {
|
|
1319
1364
|
return Array.isArray(e) ? this.params.formats = t ? e.map((e) => -e) : e : this.params.formats = t ? -e : e, this;
|
|
@@ -1416,19 +1461,19 @@ var rt = class {
|
|
|
1416
1461
|
searchParams: this.params
|
|
1417
1462
|
});
|
|
1418
1463
|
}
|
|
1419
|
-
},
|
|
1464
|
+
}, lt = class {
|
|
1420
1465
|
constructor(e) {
|
|
1421
1466
|
_(this, "client", void 0), this.client = e;
|
|
1422
1467
|
}
|
|
1423
1468
|
today() {
|
|
1424
|
-
let e = (/* @__PURE__ */ new Date()).getDay(), t = e === 0 ?
|
|
1469
|
+
let e = (/* @__PURE__ */ new Date()).getDay(), t = e === 0 ? Y.SUNDAY : e;
|
|
1425
1470
|
return new $(this.client).onWeekdays(t);
|
|
1426
1471
|
}
|
|
1427
1472
|
weekend() {
|
|
1428
|
-
return new $(this.client).onWeekdays(
|
|
1473
|
+
return new $(this.client).onWeekdays(Y.SATURDAY, Y.SUNDAY);
|
|
1429
1474
|
}
|
|
1430
1475
|
weekdays() {
|
|
1431
|
-
return new $(this.client).onWeekdays(
|
|
1476
|
+
return new $(this.client).onWeekdays(Y.MONDAY, Y.TUESDAY, Y.WEDNESDAY, Y.THURSDAY, Y.FRIDAY);
|
|
1432
1477
|
}
|
|
1433
1478
|
evening() {
|
|
1434
1479
|
return new $(this.client).startingAfter(17);
|
|
@@ -1445,23 +1490,23 @@ var rt = class {
|
|
|
1445
1490
|
byText(e) {
|
|
1446
1491
|
return new $(this.client).searchText(e);
|
|
1447
1492
|
}
|
|
1448
|
-
},
|
|
1493
|
+
}, ut = [
|
|
1449
1494
|
"weekday_tinyint",
|
|
1450
1495
|
"start_time",
|
|
1451
1496
|
"meeting_name",
|
|
1452
1497
|
"location_text"
|
|
1453
1498
|
];
|
|
1454
|
-
function
|
|
1499
|
+
function dt(e, t) {
|
|
1455
1500
|
let n = e == null ? "" : String(e);
|
|
1456
1501
|
return t ? n.toLowerCase().trim() : n;
|
|
1457
1502
|
}
|
|
1458
|
-
function
|
|
1459
|
-
return t.map((t) =>
|
|
1503
|
+
function ft(e, t, n) {
|
|
1504
|
+
return t.map((t) => dt(e[t], n)).join(" | ");
|
|
1460
1505
|
}
|
|
1461
|
-
function
|
|
1462
|
-
let { fields: n =
|
|
1506
|
+
function pt(e, t = {}) {
|
|
1507
|
+
let { fields: n = ut, normalize: r = !0 } = t, i = /* @__PURE__ */ new Map();
|
|
1463
1508
|
for (let t = 0; t < e.length; t++) for (let a of e[t]) {
|
|
1464
|
-
let e =
|
|
1509
|
+
let e = ft(a, n, r);
|
|
1465
1510
|
i.has(e) || i.set(e, []), i.get(e).push({
|
|
1466
1511
|
meeting: a,
|
|
1467
1512
|
listIndex: t
|
|
@@ -1474,18 +1519,17 @@ function ct(e, t = {}) {
|
|
|
1474
1519
|
});
|
|
1475
1520
|
return a;
|
|
1476
1521
|
}
|
|
1477
|
-
function
|
|
1478
|
-
let t = /* @__PURE__ */ new
|
|
1479
|
-
for (let
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
return n;
|
|
1522
|
+
function mt(e) {
|
|
1523
|
+
let t = /* @__PURE__ */ new Set();
|
|
1524
|
+
for (let n of e) {
|
|
1525
|
+
let e = n.service_body_bigint, r = n.meeting_name;
|
|
1526
|
+
if (!e || !r) continue;
|
|
1527
|
+
let i = r.trim().toLowerCase(), a = n.venue_type === 2 ? `${n.virtual_meeting_link ?? ""}|${n.virtual_meeting_additional_info ?? ""}` : `${n.latitude.toFixed(6)}|${n.longitude.toFixed(6)}`;
|
|
1528
|
+
t.add(`${e}|${i}|${a}`);
|
|
1529
|
+
}
|
|
1530
|
+
return t.size;
|
|
1487
1531
|
}
|
|
1488
1532
|
//#endregion
|
|
1489
|
-
export {
|
|
1533
|
+
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
1534
|
|
|
1491
1535
|
//# sourceMappingURL=app.js.map
|