bmlt-query-client 1.0.2 → 1.0.4
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/.eslintrc.json +1 -3
- package/.prettierignore +32 -0
- package/.prettierrc +14 -0
- package/PROJECT_SUMMARY.md +12 -2
- package/README.md +85 -51
- package/dist/app.d.ts +28 -2
- package/dist/app.js +114 -70
- package/dist/app.js.map +1 -1
- package/eslint.config.mjs +42 -0
- package/package.json +14 -9
- package/vite.config.ts +6 -6
- package/README.old.md +0 -490
package/dist/app.js
CHANGED
|
@@ -113,8 +113,8 @@ function Ge() {
|
|
|
113
113
|
var o = n[s], u = t[o];
|
|
114
114
|
t[o] = function(h) {
|
|
115
115
|
var f = r.operation(i), p = Array.prototype.slice.call(arguments, 1), E = p.pop();
|
|
116
|
-
p.push(function(
|
|
117
|
-
f.retry(
|
|
116
|
+
p.push(function(y) {
|
|
117
|
+
f.retry(y) || (y && (arguments[0] = f.mainError()), E.apply(this, arguments));
|
|
118
118
|
}), f.attempt(function() {
|
|
119
119
|
h.apply(t, p);
|
|
120
120
|
});
|
|
@@ -127,8 +127,8 @@ var ne, fe;
|
|
|
127
127
|
function Le() {
|
|
128
128
|
return fe || (fe = 1, ne = Ge()), ne;
|
|
129
129
|
}
|
|
130
|
-
var
|
|
131
|
-
const
|
|
130
|
+
var Ue = Le();
|
|
131
|
+
const xe = /* @__PURE__ */ ve(Ue), De = Object.prototype.toString, Fe = (r) => De.call(r) === "[object Error]", ke = /* @__PURE__ */ new Set([
|
|
132
132
|
"network error",
|
|
133
133
|
// Chrome
|
|
134
134
|
"Failed to fetch",
|
|
@@ -162,7 +162,7 @@ async function me(r, e) {
|
|
|
162
162
|
return new Promise((t, i) => {
|
|
163
163
|
e = { ...e }, e.onFailedAttempt ?? (e.onFailedAttempt = () => {
|
|
164
164
|
}), e.shouldRetry ?? (e.shouldRetry = () => !0), e.retries ?? (e.retries = 10);
|
|
165
|
-
const n =
|
|
165
|
+
const n = xe.operation(e), a = () => {
|
|
166
166
|
n.stop(), i(e.signal?.reason);
|
|
167
167
|
};
|
|
168
168
|
e.signal && !e.signal.aborted && e.signal.addEventListener("abort", a, { once: !0 });
|
|
@@ -203,8 +203,8 @@ function qe() {
|
|
|
203
203
|
function a(u, c, h, f, p) {
|
|
204
204
|
if (typeof h != "function")
|
|
205
205
|
throw new TypeError("The listener must be a function");
|
|
206
|
-
var E = new n(h, f || u, p),
|
|
207
|
-
return u._events[
|
|
206
|
+
var E = new n(h, f || u, p), y = t ? t + c : c;
|
|
207
|
+
return u._events[y] ? u._events[y].fn ? u._events[y] = [u._events[y], E] : u._events[y].push(E) : (u._events[y] = E, u._eventsCount++), u;
|
|
208
208
|
}
|
|
209
209
|
function s(u, c) {
|
|
210
210
|
--u._eventsCount === 0 ? u._events = new i() : delete u._events[c];
|
|
@@ -222,18 +222,18 @@ function qe() {
|
|
|
222
222
|
var h = t ? t + c : c, f = this._events[h];
|
|
223
223
|
if (!f) return [];
|
|
224
224
|
if (f.fn) return [f.fn];
|
|
225
|
-
for (var p = 0, E = f.length,
|
|
226
|
-
|
|
227
|
-
return
|
|
225
|
+
for (var p = 0, E = f.length, y = new Array(E); p < E; p++)
|
|
226
|
+
y[p] = f[p].fn;
|
|
227
|
+
return y;
|
|
228
228
|
}, o.prototype.listenerCount = function(c) {
|
|
229
229
|
var h = t ? t + c : c, f = this._events[h];
|
|
230
230
|
return f ? f.fn ? 1 : f.length : 0;
|
|
231
|
-
}, o.prototype.emit = function(c, h, f, p, E,
|
|
231
|
+
}, o.prototype.emit = function(c, h, f, p, E, y) {
|
|
232
232
|
var P = t ? t + c : c;
|
|
233
233
|
if (!this._events[P]) return !1;
|
|
234
|
-
var d = this._events[P],
|
|
234
|
+
var d = this._events[P], U = arguments.length, D, w;
|
|
235
235
|
if (d.fn) {
|
|
236
|
-
switch (d.once && this.removeListener(c, d.fn, void 0, !0),
|
|
236
|
+
switch (d.once && this.removeListener(c, d.fn, void 0, !0), U) {
|
|
237
237
|
case 1:
|
|
238
238
|
return d.fn.call(d.context), !0;
|
|
239
239
|
case 2:
|
|
@@ -245,15 +245,15 @@ function qe() {
|
|
|
245
245
|
case 5:
|
|
246
246
|
return d.fn.call(d.context, h, f, p, E), !0;
|
|
247
247
|
case 6:
|
|
248
|
-
return d.fn.call(d.context, h, f, p, E,
|
|
248
|
+
return d.fn.call(d.context, h, f, p, E, y), !0;
|
|
249
249
|
}
|
|
250
|
-
for (w = 1,
|
|
251
|
-
|
|
252
|
-
d.fn.apply(d.context,
|
|
250
|
+
for (w = 1, D = new Array(U - 1); w < U; w++)
|
|
251
|
+
D[w - 1] = arguments[w];
|
|
252
|
+
d.fn.apply(d.context, D);
|
|
253
253
|
} else {
|
|
254
254
|
var Oe = d.length, Y;
|
|
255
255
|
for (w = 0; w < Oe; w++)
|
|
256
|
-
switch (d[w].once && this.removeListener(c, d[w].fn, void 0, !0),
|
|
256
|
+
switch (d[w].once && this.removeListener(c, d[w].fn, void 0, !0), U) {
|
|
257
257
|
case 1:
|
|
258
258
|
d[w].fn.call(d[w].context);
|
|
259
259
|
break;
|
|
@@ -267,9 +267,9 @@ function qe() {
|
|
|
267
267
|
d[w].fn.call(d[w].context, h, f, p);
|
|
268
268
|
break;
|
|
269
269
|
default:
|
|
270
|
-
if (!
|
|
271
|
-
|
|
272
|
-
d[w].fn.apply(d[w].context,
|
|
270
|
+
if (!D) for (Y = 1, D = new Array(U - 1); Y < U; Y++)
|
|
271
|
+
D[Y - 1] = arguments[Y];
|
|
272
|
+
d[w].fn.apply(d[w].context, D);
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
return !0;
|
|
@@ -282,12 +282,12 @@ function qe() {
|
|
|
282
282
|
if (!this._events[E]) return this;
|
|
283
283
|
if (!h)
|
|
284
284
|
return s(this, E), this;
|
|
285
|
-
var
|
|
286
|
-
if (
|
|
287
|
-
|
|
285
|
+
var y = this._events[E];
|
|
286
|
+
if (y.fn)
|
|
287
|
+
y.fn === h && (!p || y.once) && (!f || y.context === f) && s(this, E);
|
|
288
288
|
else {
|
|
289
|
-
for (var P = 0, d = [],
|
|
290
|
-
(
|
|
289
|
+
for (var P = 0, d = [], U = y.length; P < U; P++)
|
|
290
|
+
(y[P].fn !== h || p && !y[P].once || f && y[P].context !== f) && d.push(y[P]);
|
|
291
291
|
d.length ? this._events[E] = d.length === 1 ? d[0] : d : s(this, E);
|
|
292
292
|
}
|
|
293
293
|
return this;
|
|
@@ -309,7 +309,7 @@ class He extends Error {
|
|
|
309
309
|
super(), this.name = "AbortError", this.message = e;
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
|
-
const pe = (r) => globalThis.DOMException === void 0 ? new He(r) : new DOMException(r),
|
|
312
|
+
const pe = (r) => globalThis.DOMException === void 0 ? new He(r) : new DOMException(r), ge = (r) => {
|
|
313
313
|
const e = r.reason === void 0 ? pe("This operation was aborted.") : r.reason;
|
|
314
314
|
return e instanceof Error ? e : pe(e);
|
|
315
315
|
};
|
|
@@ -326,8 +326,8 @@ function Je(r, e) {
|
|
|
326
326
|
throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);
|
|
327
327
|
if (e.signal) {
|
|
328
328
|
const { signal: E } = e;
|
|
329
|
-
E.aborted && f(
|
|
330
|
-
f(
|
|
329
|
+
E.aborted && f(ge(E)), o = () => {
|
|
330
|
+
f(ge(E));
|
|
331
331
|
}, E.addEventListener("abort", o, { once: !0 });
|
|
332
332
|
}
|
|
333
333
|
if (t === Number.POSITIVE_INFINITY) {
|
|
@@ -408,7 +408,7 @@ class We {
|
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
A = new WeakMap();
|
|
411
|
-
var k, $,
|
|
411
|
+
var k, $, x, z, M, W, N, q, R, Q, O, V, L, j, ee, m, _e, Te, Se, Re, be, K, oe, ae, X, Ae, Z;
|
|
412
412
|
class Qe extends Ye {
|
|
413
413
|
// TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()`
|
|
414
414
|
constructor(t) {
|
|
@@ -416,7 +416,7 @@ class Qe extends Ye {
|
|
|
416
416
|
T(this, m);
|
|
417
417
|
T(this, k);
|
|
418
418
|
T(this, $);
|
|
419
|
-
T(this,
|
|
419
|
+
T(this, x, 0);
|
|
420
420
|
T(this, z);
|
|
421
421
|
T(this, M);
|
|
422
422
|
T(this, W, 0);
|
|
@@ -505,9 +505,9 @@ class Qe extends Ye {
|
|
|
505
505
|
...i
|
|
506
506
|
}, new Promise((n, a) => {
|
|
507
507
|
l(this, R).enqueue(async () => {
|
|
508
|
-
H(this, O)._
|
|
508
|
+
H(this, O)._++;
|
|
509
509
|
try {
|
|
510
|
-
i.signal?.throwIfAborted()
|
|
510
|
+
i.signal?.throwIfAborted(), H(this, x)._++;
|
|
511
511
|
let s = t({ signal: i.signal });
|
|
512
512
|
i.timeout && (s = Je(Promise.resolve(s), { milliseconds: i.timeout })), i.signal && (s = Promise.race([s, S(this, m, Ae).call(this, i.signal)]));
|
|
513
513
|
const o = await s;
|
|
@@ -598,8 +598,8 @@ class Qe extends Ye {
|
|
|
598
598
|
return l(this, L);
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
|
-
k = new WeakMap(), $ = new WeakMap(),
|
|
602
|
-
return l(this, $) || l(this,
|
|
601
|
+
k = new WeakMap(), $ = new WeakMap(), x = new WeakMap(), z = new WeakMap(), M = new WeakMap(), W = new WeakMap(), N = new WeakMap(), q = new WeakMap(), R = new WeakMap(), Q = new WeakMap(), O = new WeakMap(), V = new WeakMap(), L = new WeakMap(), j = new WeakMap(), ee = new WeakMap(), m = new WeakSet(), _e = function() {
|
|
602
|
+
return l(this, $) || l(this, x) < l(this, z);
|
|
603
603
|
}, Te = function() {
|
|
604
604
|
return l(this, O) < l(this, V);
|
|
605
605
|
}, Se = function() {
|
|
@@ -611,7 +611,7 @@ k = new WeakMap(), $ = new WeakMap(), D = new WeakMap(), z = new WeakMap(), M =
|
|
|
611
611
|
if (l(this, N) === void 0) {
|
|
612
612
|
const i = l(this, W) - t;
|
|
613
613
|
if (i < 0)
|
|
614
|
-
v(this,
|
|
614
|
+
v(this, x, l(this, k) ? l(this, O) : 0);
|
|
615
615
|
else
|
|
616
616
|
return l(this, q) === void 0 && v(this, q, setTimeout(() => {
|
|
617
617
|
S(this, m, Re).call(this);
|
|
@@ -634,7 +634,7 @@ k = new WeakMap(), $ = new WeakMap(), D = new WeakMap(), z = new WeakMap(), M =
|
|
|
634
634
|
S(this, m, ae).call(this);
|
|
635
635
|
}, l(this, M))), v(this, W, Date.now() + l(this, M)));
|
|
636
636
|
}, ae = function() {
|
|
637
|
-
l(this,
|
|
637
|
+
l(this, x) === 0 && l(this, O) === 0 && l(this, N) && (clearInterval(l(this, N)), v(this, N, void 0)), v(this, x, l(this, k) ? l(this, O) : 0), S(this, m, X).call(this);
|
|
638
638
|
}, /**
|
|
639
639
|
Executes all queued functions until it reaches the limit.
|
|
640
640
|
*/
|
|
@@ -792,7 +792,12 @@ class J {
|
|
|
792
792
|
const i = `HTTP ${t.status}: ${t.statusText}`;
|
|
793
793
|
return I.createApiError(i, t.status, void 0, e);
|
|
794
794
|
}
|
|
795
|
-
return e instanceof Error ? I.createApiError(e.message, void 0, void 0, e) : I.createApiError(
|
|
795
|
+
return e instanceof Error ? I.createApiError(e.message, void 0, void 0, e) : I.createApiError(
|
|
796
|
+
"Unknown error occurred",
|
|
797
|
+
void 0,
|
|
798
|
+
void 0,
|
|
799
|
+
new Error(String(e))
|
|
800
|
+
);
|
|
796
801
|
}
|
|
797
802
|
/**
|
|
798
803
|
* @deprecated Use handleFetchError instead
|
|
@@ -861,13 +866,7 @@ class J {
|
|
|
861
866
|
}
|
|
862
867
|
class it {
|
|
863
868
|
static async withRetry(e, t) {
|
|
864
|
-
const {
|
|
865
|
-
maxRetries: i,
|
|
866
|
-
baseDelay: n,
|
|
867
|
-
maxDelay: a,
|
|
868
|
-
factor: s,
|
|
869
|
-
onRetry: o
|
|
870
|
-
} = t;
|
|
869
|
+
const { maxRetries: i, baseDelay: n, maxDelay: a, factor: s, onRetry: o } = t;
|
|
871
870
|
let u;
|
|
872
871
|
for (let c = 0; c <= i; c++)
|
|
873
872
|
try {
|
|
@@ -876,10 +875,7 @@ class it {
|
|
|
876
875
|
const f = h instanceof b ? h : J.wrapError(h, "Operation failed");
|
|
877
876
|
if (u = f, c === i || !f.isRetryable())
|
|
878
877
|
throw f;
|
|
879
|
-
const p = Math.min(
|
|
880
|
-
n * Math.pow(s, c),
|
|
881
|
-
a
|
|
882
|
-
);
|
|
878
|
+
const p = Math.min(n * Math.pow(s, c), a);
|
|
883
879
|
o && o(f, c + 1), await new Promise((E) => setTimeout(E, p));
|
|
884
880
|
}
|
|
885
881
|
throw u;
|
|
@@ -991,7 +987,9 @@ class je {
|
|
|
991
987
|
longitude: parseFloat(o.lon)
|
|
992
988
|
};
|
|
993
989
|
if (isNaN(u.latitude) || isNaN(u.longitude)) {
|
|
994
|
-
const c = new Error(
|
|
990
|
+
const c = new Error(
|
|
991
|
+
"Invalid coordinates received from geocoding service"
|
|
992
|
+
);
|
|
995
993
|
throw c.name = "GeocodingError", c;
|
|
996
994
|
}
|
|
997
995
|
if (u.latitude < -90 || u.latitude > 90 || u.longitude < -180 || u.longitude > 180) {
|
|
@@ -1117,8 +1115,22 @@ class je {
|
|
|
1117
1115
|
setConcurrency(e) {
|
|
1118
1116
|
this.queue.concurrency = e;
|
|
1119
1117
|
}
|
|
1118
|
+
/**
|
|
1119
|
+
* Get the current user agent string
|
|
1120
|
+
*/
|
|
1121
|
+
getUserAgent() {
|
|
1122
|
+
return this.defaultOptions.userAgent;
|
|
1123
|
+
}
|
|
1124
|
+
/**
|
|
1125
|
+
* Set the user agent string for geocoding requests
|
|
1126
|
+
*/
|
|
1127
|
+
setUserAgent(e) {
|
|
1128
|
+
if (!e || typeof e != "string" || e.trim().length === 0)
|
|
1129
|
+
throw new Error("User agent must be a non-empty string");
|
|
1130
|
+
this.defaultOptions.userAgent = e.trim();
|
|
1131
|
+
}
|
|
1120
1132
|
}
|
|
1121
|
-
var
|
|
1133
|
+
var g = /* @__PURE__ */ ((r) => (r.JSON = "json", r.JSONP = "jsonp", r.TSML = "tsml", r.CSV = "csv", r))(g || {}), _ = /* @__PURE__ */ ((r) => (r.GET_SEARCH_RESULTS = "GetSearchResults", r.GET_FORMATS = "GetFormats", r.GET_SERVICE_BODIES = "GetServiceBodies", r.GET_CHANGES = "GetChanges", r.GET_FIELD_KEYS = "GetFieldKeys", r.GET_FIELD_VALUES = "GetFieldValues", r.GET_NAWS_DUMP = "GetNAWSDump", r.GET_SERVER_INFO = "GetServerInfo", r.GET_COVERAGE_AREA = "GetCoverageArea", r))(_ || {}), G = /* @__PURE__ */ ((r) => (r[r.SUNDAY = 1] = "SUNDAY", r[r.MONDAY = 2] = "MONDAY", r[r.TUESDAY = 3] = "TUESDAY", r[r.WEDNESDAY = 4] = "WEDNESDAY", r[r.THURSDAY = 5] = "THURSDAY", r[r.FRIDAY = 6] = "FRIDAY", r[r.SATURDAY = 7] = "SATURDAY", r))(G || {}), F = /* @__PURE__ */ ((r) => (r[r.IN_PERSON = 1] = "IN_PERSON", r[r.VIRTUAL = 2] = "VIRTUAL", r[r.HYBRID = 3] = "HYBRID", r))(F || {}), Be = /* @__PURE__ */ ((r) => (r.WEEKDAY = "weekday", r.TIME = "time", r.TOWN = "town", r.STATE = "state", r.WEEKDAY_STATE = "weekday_state", r))(Be || {}), Ke = /* @__PURE__ */ ((r) => (r.ENGLISH = "en", r.GERMAN = "de", r.DANISH = "dk", r.SPANISH = "es", r.PERSIAN = "fa", r.FRENCH = "fr", r.ITALIAN = "it", r.POLISH = "pl", r.PORTUGUESE = "pt", r.SWEDISH = "sv", r))(Ke || {});
|
|
1122
1134
|
function Xe(r) {
|
|
1123
1135
|
const { rootServerURL: e, format: t, endpoint: i, parameters: n = {} } = r, s = `${e.endsWith("/") ? e : `${e}/`}client_interface/${t}/`, o = new URLSearchParams();
|
|
1124
1136
|
return o.set("switcher", i), Object.entries(n).forEach(([u, c]) => {
|
|
@@ -1152,22 +1164,26 @@ function nt(r) {
|
|
|
1152
1164
|
}
|
|
1153
1165
|
function Ze(r, e) {
|
|
1154
1166
|
const i = {
|
|
1155
|
-
[_.GET_SEARCH_RESULTS]: [
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
[_.
|
|
1161
|
-
[_.
|
|
1162
|
-
[_.
|
|
1163
|
-
[_.
|
|
1167
|
+
[_.GET_SEARCH_RESULTS]: [
|
|
1168
|
+
g.JSON,
|
|
1169
|
+
g.JSONP,
|
|
1170
|
+
g.TSML
|
|
1171
|
+
],
|
|
1172
|
+
[_.GET_FORMATS]: [g.JSON, g.JSONP],
|
|
1173
|
+
[_.GET_SERVICE_BODIES]: [g.JSON, g.JSONP],
|
|
1174
|
+
[_.GET_CHANGES]: [g.JSON, g.JSONP],
|
|
1175
|
+
[_.GET_FIELD_KEYS]: [g.JSON, g.JSONP],
|
|
1176
|
+
[_.GET_FIELD_VALUES]: [g.JSON, g.JSONP],
|
|
1177
|
+
[_.GET_NAWS_DUMP]: [g.CSV],
|
|
1178
|
+
[_.GET_SERVER_INFO]: [g.JSON, g.JSONP],
|
|
1179
|
+
[_.GET_COVERAGE_AREA]: [g.JSON, g.JSONP]
|
|
1164
1180
|
}[r];
|
|
1165
1181
|
if (!i.includes(e))
|
|
1166
1182
|
throw new Error(
|
|
1167
1183
|
`Invalid format '${e}' for endpoint '${r}'. Valid formats: ${i.join(", ")}`
|
|
1168
1184
|
);
|
|
1169
1185
|
}
|
|
1170
|
-
function
|
|
1186
|
+
function ye(r) {
|
|
1171
1187
|
try {
|
|
1172
1188
|
const e = new URL(r);
|
|
1173
1189
|
if (!["http:", "https:"].includes(e.protocol))
|
|
@@ -1220,13 +1236,13 @@ class ct {
|
|
|
1220
1236
|
constructor(e) {
|
|
1221
1237
|
const {
|
|
1222
1238
|
rootServerURL: t,
|
|
1223
|
-
defaultFormat: i =
|
|
1239
|
+
defaultFormat: i = g.JSON,
|
|
1224
1240
|
timeout: n = 3e4,
|
|
1225
1241
|
userAgent: a = "bmlt-query-client/1.0.0",
|
|
1226
1242
|
geocodingOptions: s = {},
|
|
1227
1243
|
enableGeocoding: o = !0
|
|
1228
1244
|
} = e;
|
|
1229
|
-
this.rootServerURL =
|
|
1245
|
+
this.rootServerURL = ye(t), this.defaultFormat = i, this.timeout = n, this.userAgent = a, o && (this.geocodingService = new je(s));
|
|
1230
1246
|
}
|
|
1231
1247
|
/**
|
|
1232
1248
|
* Make a request to the BMLT API
|
|
@@ -1258,15 +1274,15 @@ class ct {
|
|
|
1258
1274
|
n
|
|
1259
1275
|
);
|
|
1260
1276
|
const u = await n.text();
|
|
1261
|
-
if (i ===
|
|
1277
|
+
if (i === g.CSV)
|
|
1262
1278
|
return u;
|
|
1263
|
-
if (i ===
|
|
1279
|
+
if (i === g.JSONP) {
|
|
1264
1280
|
const c = t.callback || "callback", h = u.match(new RegExp(`${c}\\((.+)\\);?$`));
|
|
1265
1281
|
if (!h)
|
|
1266
1282
|
throw new Error("Invalid JSONP response format");
|
|
1267
1283
|
return JSON.parse(h[1]);
|
|
1268
1284
|
}
|
|
1269
|
-
return i ===
|
|
1285
|
+
return i === g.JSON || i === g.TSML ? JSON.parse(u) : u;
|
|
1270
1286
|
} catch (a) {
|
|
1271
1287
|
throw J.handleFetchError(a, n);
|
|
1272
1288
|
}
|
|
@@ -1343,7 +1359,7 @@ class ct {
|
|
|
1343
1359
|
* Get NAWS dump for a service body (CSV format only)
|
|
1344
1360
|
*/
|
|
1345
1361
|
async getNAWSDump(e) {
|
|
1346
|
-
return this.makeRequest(_.GET_NAWS_DUMP, e,
|
|
1362
|
+
return this.makeRequest(_.GET_NAWS_DUMP, e, g.CSV);
|
|
1347
1363
|
}
|
|
1348
1364
|
/**
|
|
1349
1365
|
* Get server information
|
|
@@ -1383,7 +1399,7 @@ class ct {
|
|
|
1383
1399
|
* Update the root server URL
|
|
1384
1400
|
*/
|
|
1385
1401
|
setRootServerURL(e) {
|
|
1386
|
-
this.rootServerURL =
|
|
1402
|
+
this.rootServerURL = ye(e);
|
|
1387
1403
|
}
|
|
1388
1404
|
/**
|
|
1389
1405
|
* Get the default data format
|
|
@@ -1412,6 +1428,34 @@ class ct {
|
|
|
1412
1428
|
clearGeocodingQueue() {
|
|
1413
1429
|
this.geocodingService && this.geocodingService.clearQueue();
|
|
1414
1430
|
}
|
|
1431
|
+
/**
|
|
1432
|
+
* Get the current user agent string
|
|
1433
|
+
*/
|
|
1434
|
+
getUserAgent() {
|
|
1435
|
+
return this.userAgent;
|
|
1436
|
+
}
|
|
1437
|
+
/**
|
|
1438
|
+
* Set the user agent string for HTTP requests
|
|
1439
|
+
*/
|
|
1440
|
+
setUserAgent(e) {
|
|
1441
|
+
if (!e || typeof e != "string" || e.trim().length === 0)
|
|
1442
|
+
throw new Error("User agent must be a non-empty string");
|
|
1443
|
+
this.userAgent = e.trim(), this.geocodingService && this.geocodingService.setUserAgent(this.userAgent);
|
|
1444
|
+
}
|
|
1445
|
+
/**
|
|
1446
|
+
* Get the current timeout setting
|
|
1447
|
+
*/
|
|
1448
|
+
getTimeout() {
|
|
1449
|
+
return this.timeout;
|
|
1450
|
+
}
|
|
1451
|
+
/**
|
|
1452
|
+
* Set the timeout for HTTP requests
|
|
1453
|
+
*/
|
|
1454
|
+
setTimeout(e) {
|
|
1455
|
+
if (!Number.isInteger(e) || e <= 0)
|
|
1456
|
+
throw new Error("Timeout must be a positive integer");
|
|
1457
|
+
this.timeout = e;
|
|
1458
|
+
}
|
|
1415
1459
|
}
|
|
1416
1460
|
class C {
|
|
1417
1461
|
constructor(e) {
|
|
@@ -1710,7 +1754,7 @@ class ht {
|
|
|
1710
1754
|
}
|
|
1711
1755
|
export {
|
|
1712
1756
|
ct as BmltClient,
|
|
1713
|
-
|
|
1757
|
+
g as BmltDataFormat,
|
|
1714
1758
|
_ as BmltEndpoint,
|
|
1715
1759
|
Ne as BmltErrorType,
|
|
1716
1760
|
b as BmltQueryError,
|
|
@@ -1733,6 +1777,6 @@ export {
|
|
|
1733
1777
|
et as validateCoordinates,
|
|
1734
1778
|
Ze as validateEndpointFormat,
|
|
1735
1779
|
B as validateRadius,
|
|
1736
|
-
|
|
1780
|
+
ye as validateRootServerURL
|
|
1737
1781
|
};
|
|
1738
1782
|
//# sourceMappingURL=app.js.map
|