bmlt-query-client 1.0.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/.eslintrc.json +23 -0
- package/PROJECT_SUMMARY.md +166 -0
- package/README.md +272 -0
- package/README.old.md +490 -0
- package/dist/app.js +1738 -0
- package/dist/app.js.map +1 -0
- package/package.json +62 -0
- package/test/setup.ts +16 -0
- package/vite.config.ts +35 -0
- package/vite.esm.config.ts +20 -0
package/dist/app.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.js","sources":["../node_modules/retry/lib/retry_operation.js","../node_modules/retry/lib/retry.js","../node_modules/retry/index.js","../node_modules/is-network-error/index.js","../node_modules/p-retry/index.js","../node_modules/eventemitter3/index.js","../node_modules/p-timeout/index.js","../node_modules/p-queue/dist/lower-bound.js","../node_modules/p-queue/dist/priority-queue.js","../node_modules/p-queue/dist/index.js","../src/utils/errors.ts","../src/services/geocoding.ts","../src/types/base.ts","../src/utils/url-builder.ts","../src/client/bmlt-client.ts","../src/client/query-builder.ts"],"sourcesContent":["function RetryOperation(timeouts, options) {\n // Compatibility for the old (timeouts, retryForever) signature\n if (typeof options === 'boolean') {\n options = { forever: options };\n }\n\n this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));\n this._timeouts = timeouts;\n this._options = options || {};\n this._maxRetryTime = options && options.maxRetryTime || Infinity;\n this._fn = null;\n this._errors = [];\n this._attempts = 1;\n this._operationTimeout = null;\n this._operationTimeoutCb = null;\n this._timeout = null;\n this._operationStart = null;\n this._timer = null;\n\n if (this._options.forever) {\n this._cachedTimeouts = this._timeouts.slice(0);\n }\n}\nmodule.exports = RetryOperation;\n\nRetryOperation.prototype.reset = function() {\n this._attempts = 1;\n this._timeouts = this._originalTimeouts.slice(0);\n}\n\nRetryOperation.prototype.stop = function() {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n if (this._timer) {\n clearTimeout(this._timer);\n }\n\n this._timeouts = [];\n this._cachedTimeouts = null;\n};\n\nRetryOperation.prototype.retry = function(err) {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n\n if (!err) {\n return false;\n }\n var currentTime = new Date().getTime();\n if (err && currentTime - this._operationStart >= this._maxRetryTime) {\n this._errors.push(err);\n this._errors.unshift(new Error('RetryOperation timeout occurred'));\n return false;\n }\n\n this._errors.push(err);\n\n var timeout = this._timeouts.shift();\n if (timeout === undefined) {\n if (this._cachedTimeouts) {\n // retry forever, only keep last error\n this._errors.splice(0, this._errors.length - 1);\n timeout = this._cachedTimeouts.slice(-1);\n } else {\n return false;\n }\n }\n\n var self = this;\n this._timer = setTimeout(function() {\n self._attempts++;\n\n if (self._operationTimeoutCb) {\n self._timeout = setTimeout(function() {\n self._operationTimeoutCb(self._attempts);\n }, self._operationTimeout);\n\n if (self._options.unref) {\n self._timeout.unref();\n }\n }\n\n self._fn(self._attempts);\n }, timeout);\n\n if (this._options.unref) {\n this._timer.unref();\n }\n\n return true;\n};\n\nRetryOperation.prototype.attempt = function(fn, timeoutOps) {\n this._fn = fn;\n\n if (timeoutOps) {\n if (timeoutOps.timeout) {\n this._operationTimeout = timeoutOps.timeout;\n }\n if (timeoutOps.cb) {\n this._operationTimeoutCb = timeoutOps.cb;\n }\n }\n\n var self = this;\n if (this._operationTimeoutCb) {\n this._timeout = setTimeout(function() {\n self._operationTimeoutCb();\n }, self._operationTimeout);\n }\n\n this._operationStart = new Date().getTime();\n\n this._fn(this._attempts);\n};\n\nRetryOperation.prototype.try = function(fn) {\n console.log('Using RetryOperation.try() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = function(fn) {\n console.log('Using RetryOperation.start() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = RetryOperation.prototype.try;\n\nRetryOperation.prototype.errors = function() {\n return this._errors;\n};\n\nRetryOperation.prototype.attempts = function() {\n return this._attempts;\n};\n\nRetryOperation.prototype.mainError = function() {\n if (this._errors.length === 0) {\n return null;\n }\n\n var counts = {};\n var mainError = null;\n var mainErrorCount = 0;\n\n for (var i = 0; i < this._errors.length; i++) {\n var error = this._errors[i];\n var message = error.message;\n var count = (counts[message] || 0) + 1;\n\n counts[message] = count;\n\n if (count >= mainErrorCount) {\n mainError = error;\n mainErrorCount = count;\n }\n }\n\n return mainError;\n};\n","var RetryOperation = require('./retry_operation');\n\nexports.operation = function(options) {\n var timeouts = exports.timeouts(options);\n return new RetryOperation(timeouts, {\n forever: options && (options.forever || options.retries === Infinity),\n unref: options && options.unref,\n maxRetryTime: options && options.maxRetryTime\n });\n};\n\nexports.timeouts = function(options) {\n if (options instanceof Array) {\n return [].concat(options);\n }\n\n var opts = {\n retries: 10,\n factor: 2,\n minTimeout: 1 * 1000,\n maxTimeout: Infinity,\n randomize: false\n };\n for (var key in options) {\n opts[key] = options[key];\n }\n\n if (opts.minTimeout > opts.maxTimeout) {\n throw new Error('minTimeout is greater than maxTimeout');\n }\n\n var timeouts = [];\n for (var i = 0; i < opts.retries; i++) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n if (options && options.forever && !timeouts.length) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n // sort the array numerically ascending\n timeouts.sort(function(a,b) {\n return a - b;\n });\n\n return timeouts;\n};\n\nexports.createTimeout = function(attempt, opts) {\n var random = (opts.randomize)\n ? (Math.random() + 1)\n : 1;\n\n var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));\n timeout = Math.min(timeout, opts.maxTimeout);\n\n return timeout;\n};\n\nexports.wrap = function(obj, options, methods) {\n if (options instanceof Array) {\n methods = options;\n options = null;\n }\n\n if (!methods) {\n methods = [];\n for (var key in obj) {\n if (typeof obj[key] === 'function') {\n methods.push(key);\n }\n }\n }\n\n for (var i = 0; i < methods.length; i++) {\n var method = methods[i];\n var original = obj[method];\n\n obj[method] = function retryWrapper(original) {\n var op = exports.operation(options);\n var args = Array.prototype.slice.call(arguments, 1);\n var callback = args.pop();\n\n args.push(function(err) {\n if (op.retry(err)) {\n return;\n }\n if (err) {\n arguments[0] = op.mainError();\n }\n callback.apply(this, arguments);\n });\n\n op.attempt(function() {\n original.apply(obj, args);\n });\n }.bind(obj, original);\n obj[method].options = options;\n }\n};\n","module.exports = require('./lib/retry');","const objectToString = Object.prototype.toString;\n\nconst isError = value => objectToString.call(value) === '[object Error]';\n\nconst errorMessages = new Set([\n\t'network error', // Chrome\n\t'Failed to fetch', // Chrome\n\t'NetworkError when attempting to fetch resource.', // Firefox\n\t'The Internet connection appears to be offline.', // Safari 16\n\t'Load failed', // Safari 17+\n\t'Network request failed', // `cross-fetch`\n\t'fetch failed', // Undici (Node.js)\n\t'terminated', // Undici (Node.js)\n]);\n\nexport default function isNetworkError(error) {\n\tconst isValid = error\n\t\t&& isError(error)\n\t\t&& error.name === 'TypeError'\n\t\t&& typeof error.message === 'string';\n\n\tif (!isValid) {\n\t\treturn false;\n\t}\n\n\t// We do an extra check for Safari 17+ as it has a very generic error message.\n\t// Network errors in Safari have no stack.\n\tif (error.message === 'Load failed') {\n\t\treturn error.stack === undefined;\n\t}\n\n\treturn errorMessages.has(error.message);\n}\n","import retry from 'retry';\nimport isNetworkError from 'is-network-error';\n\nexport class AbortError extends Error {\n\tconstructor(message) {\n\t\tsuper();\n\n\t\tif (message instanceof Error) {\n\t\t\tthis.originalError = message;\n\t\t\t({message} = message);\n\t\t} else {\n\t\t\tthis.originalError = new Error(message);\n\t\t\tthis.originalError.stack = this.stack;\n\t\t}\n\n\t\tthis.name = 'AbortError';\n\t\tthis.message = message;\n\t}\n}\n\nconst decorateErrorWithCounts = (error, attemptNumber, options) => {\n\t// Minus 1 from attemptNumber because the first attempt does not count as a retry\n\tconst retriesLeft = options.retries - (attemptNumber - 1);\n\n\terror.attemptNumber = attemptNumber;\n\terror.retriesLeft = retriesLeft;\n\treturn error;\n};\n\nexport default async function pRetry(input, options) {\n\treturn new Promise((resolve, reject) => {\n\t\toptions = {...options};\n\t\toptions.onFailedAttempt ??= () => {};\n\t\toptions.shouldRetry ??= () => true;\n\t\toptions.retries ??= 10;\n\n\t\tconst operation = retry.operation(options);\n\n\t\tconst abortHandler = () => {\n\t\t\toperation.stop();\n\t\t\treject(options.signal?.reason);\n\t\t};\n\n\t\tif (options.signal && !options.signal.aborted) {\n\t\t\toptions.signal.addEventListener('abort', abortHandler, {once: true});\n\t\t}\n\n\t\tconst cleanUp = () => {\n\t\t\toptions.signal?.removeEventListener('abort', abortHandler);\n\t\t\toperation.stop();\n\t\t};\n\n\t\toperation.attempt(async attemptNumber => {\n\t\t\ttry {\n\t\t\t\tconst result = await input(attemptNumber);\n\t\t\t\tcleanUp();\n\t\t\t\tresolve(result);\n\t\t\t} catch (error) {\n\t\t\t\ttry {\n\t\t\t\t\tif (!(error instanceof Error)) {\n\t\t\t\t\t\tthrow new TypeError(`Non-error was thrown: \"${error}\". You should only throw errors.`);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (error instanceof AbortError) {\n\t\t\t\t\t\tthrow error.originalError;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (error instanceof TypeError && !isNetworkError(error)) {\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\n\t\t\t\t\tdecorateErrorWithCounts(error, attemptNumber, options);\n\n\t\t\t\t\tif (!(await options.shouldRetry(error))) {\n\t\t\t\t\t\toperation.stop();\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\n\t\t\t\t\tawait options.onFailedAttempt(error);\n\n\t\t\t\t\tif (!operation.retry(error)) {\n\t\t\t\t\t\tthrow operation.mainError();\n\t\t\t\t\t}\n\t\t\t\t} catch (finalError) {\n\t\t\t\t\tdecorateErrorWithCounts(finalError, attemptNumber, options);\n\t\t\t\t\tcleanUp();\n\t\t\t\t\treject(finalError);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","export class TimeoutError extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = 'TimeoutError';\n\t}\n}\n\n/**\nAn error to be thrown when the request is aborted by AbortController.\nDOMException is thrown instead of this Error when DOMException is available.\n*/\nexport class AbortError extends Error {\n\tconstructor(message) {\n\t\tsuper();\n\t\tthis.name = 'AbortError';\n\t\tthis.message = message;\n\t}\n}\n\n/**\nTODO: Remove AbortError and just throw DOMException when targeting Node 18.\n*/\nconst getDOMException = errorMessage => globalThis.DOMException === undefined\n\t? new AbortError(errorMessage)\n\t: new DOMException(errorMessage);\n\n/**\nTODO: Remove below function and just 'reject(signal.reason)' when targeting Node 18.\n*/\nconst getAbortedReason = signal => {\n\tconst reason = signal.reason === undefined\n\t\t? getDOMException('This operation was aborted.')\n\t\t: signal.reason;\n\n\treturn reason instanceof Error ? reason : getDOMException(reason);\n};\n\nexport default function pTimeout(promise, options) {\n\tconst {\n\t\tmilliseconds,\n\t\tfallback,\n\t\tmessage,\n\t\tcustomTimers = {setTimeout, clearTimeout},\n\t} = options;\n\n\tlet timer;\n\tlet abortHandler;\n\n\tconst wrappedPromise = new Promise((resolve, reject) => {\n\t\tif (typeof milliseconds !== 'number' || Math.sign(milliseconds) !== 1) {\n\t\t\tthrow new TypeError(`Expected \\`milliseconds\\` to be a positive number, got \\`${milliseconds}\\``);\n\t\t}\n\n\t\tif (options.signal) {\n\t\t\tconst {signal} = options;\n\t\t\tif (signal.aborted) {\n\t\t\t\treject(getAbortedReason(signal));\n\t\t\t}\n\n\t\t\tabortHandler = () => {\n\t\t\t\treject(getAbortedReason(signal));\n\t\t\t};\n\n\t\t\tsignal.addEventListener('abort', abortHandler, {once: true});\n\t\t}\n\n\t\tif (milliseconds === Number.POSITIVE_INFINITY) {\n\t\t\tpromise.then(resolve, reject);\n\t\t\treturn;\n\t\t}\n\n\t\t// We create the error outside of `setTimeout` to preserve the stack trace.\n\t\tconst timeoutError = new TimeoutError();\n\n\t\ttimer = customTimers.setTimeout.call(undefined, () => {\n\t\t\tif (fallback) {\n\t\t\t\ttry {\n\t\t\t\t\tresolve(fallback());\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (typeof promise.cancel === 'function') {\n\t\t\t\tpromise.cancel();\n\t\t\t}\n\n\t\t\tif (message === false) {\n\t\t\t\tresolve();\n\t\t\t} else if (message instanceof Error) {\n\t\t\t\treject(message);\n\t\t\t} else {\n\t\t\t\ttimeoutError.message = message ?? `Promise timed out after ${milliseconds} milliseconds`;\n\t\t\t\treject(timeoutError);\n\t\t\t}\n\t\t}, milliseconds);\n\n\t\t(async () => {\n\t\t\ttry {\n\t\t\t\tresolve(await promise);\n\t\t\t} catch (error) {\n\t\t\t\treject(error);\n\t\t\t}\n\t\t})();\n\t});\n\n\tconst cancelablePromise = wrappedPromise.finally(() => {\n\t\tcancelablePromise.clear();\n\t\tif (abortHandler && options.signal) {\n\t\t\toptions.signal.removeEventListener('abort', abortHandler);\n\t\t}\n\t});\n\n\tcancelablePromise.clear = () => {\n\t\tcustomTimers.clearTimeout.call(undefined, timer);\n\t\ttimer = undefined;\n\t};\n\n\treturn cancelablePromise;\n}\n","// Port of lower_bound from https://en.cppreference.com/w/cpp/algorithm/lower_bound\n// Used to compute insertion index to keep queue sorted after insertion\nexport default function lowerBound(array, value, comparator) {\n let first = 0;\n let count = array.length;\n while (count > 0) {\n const step = Math.trunc(count / 2);\n let it = first + step;\n if (comparator(array[it], value) <= 0) {\n first = ++it;\n count -= step + 1;\n }\n else {\n count = step;\n }\n }\n return first;\n}\n","import lowerBound from './lower-bound.js';\nexport default class PriorityQueue {\n #queue = [];\n enqueue(run, options) {\n options = {\n priority: 0,\n ...options,\n };\n const element = {\n priority: options.priority,\n id: options.id,\n run,\n };\n if (this.size === 0 || this.#queue[this.size - 1].priority >= options.priority) {\n this.#queue.push(element);\n return;\n }\n const index = lowerBound(this.#queue, element, (a, b) => b.priority - a.priority);\n this.#queue.splice(index, 0, element);\n }\n setPriority(id, priority) {\n const index = this.#queue.findIndex((element) => element.id === id);\n if (index === -1) {\n throw new ReferenceError(`No promise function with the id \"${id}\" exists in the queue.`);\n }\n const [item] = this.#queue.splice(index, 1);\n this.enqueue(item.run, { priority, id });\n }\n dequeue() {\n const item = this.#queue.shift();\n return item?.run;\n }\n filter(options) {\n return this.#queue.filter((element) => element.priority === options.priority).map((element) => element.run);\n }\n get size() {\n return this.#queue.length;\n }\n}\n","import { EventEmitter } from 'eventemitter3';\nimport pTimeout, { TimeoutError } from 'p-timeout';\nimport PriorityQueue from './priority-queue.js';\n/**\nPromise queue with concurrency control.\n*/\nexport default class PQueue extends EventEmitter {\n #carryoverConcurrencyCount;\n #isIntervalIgnored;\n #intervalCount = 0;\n #intervalCap;\n #interval;\n #intervalEnd = 0;\n #intervalId;\n #timeoutId;\n #queue;\n #queueClass;\n #pending = 0;\n // The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194\n #concurrency;\n #isPaused;\n #throwOnTimeout;\n // Use to assign a unique identifier to a promise function, if not explicitly specified\n #idAssigner = 1n;\n /**\n Per-operation timeout in milliseconds. Operations fulfill once `timeout` elapses if they haven't already.\n\n Applies to each future operation.\n */\n timeout;\n // TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()`\n constructor(options) {\n super();\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n options = {\n carryoverConcurrencyCount: false,\n intervalCap: Number.POSITIVE_INFINITY,\n interval: 0,\n concurrency: Number.POSITIVE_INFINITY,\n autoStart: true,\n queueClass: PriorityQueue,\n ...options,\n };\n if (!(typeof options.intervalCap === 'number' && options.intervalCap >= 1)) {\n throw new TypeError(`Expected \\`intervalCap\\` to be a number from 1 and up, got \\`${options.intervalCap?.toString() ?? ''}\\` (${typeof options.intervalCap})`);\n }\n if (options.interval === undefined || !(Number.isFinite(options.interval) && options.interval >= 0)) {\n throw new TypeError(`Expected \\`interval\\` to be a finite number >= 0, got \\`${options.interval?.toString() ?? ''}\\` (${typeof options.interval})`);\n }\n this.#carryoverConcurrencyCount = options.carryoverConcurrencyCount;\n this.#isIntervalIgnored = options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0;\n this.#intervalCap = options.intervalCap;\n this.#interval = options.interval;\n this.#queue = new options.queueClass();\n this.#queueClass = options.queueClass;\n this.concurrency = options.concurrency;\n this.timeout = options.timeout;\n this.#throwOnTimeout = options.throwOnTimeout === true;\n this.#isPaused = options.autoStart === false;\n }\n get #doesIntervalAllowAnother() {\n return this.#isIntervalIgnored || this.#intervalCount < this.#intervalCap;\n }\n get #doesConcurrentAllowAnother() {\n return this.#pending < this.#concurrency;\n }\n #next() {\n this.#pending--;\n this.#tryToStartAnother();\n this.emit('next');\n }\n #onResumeInterval() {\n this.#onInterval();\n this.#initializeIntervalIfNeeded();\n this.#timeoutId = undefined;\n }\n get #isIntervalPaused() {\n const now = Date.now();\n if (this.#intervalId === undefined) {\n const delay = this.#intervalEnd - now;\n if (delay < 0) {\n // Act as the interval was done\n // We don't need to resume it here because it will be resumed on line 160\n this.#intervalCount = (this.#carryoverConcurrencyCount) ? this.#pending : 0;\n }\n else {\n // Act as the interval is pending\n if (this.#timeoutId === undefined) {\n this.#timeoutId = setTimeout(() => {\n this.#onResumeInterval();\n }, delay);\n }\n return true;\n }\n }\n return false;\n }\n #tryToStartAnother() {\n if (this.#queue.size === 0) {\n // We can clear the interval (\"pause\")\n // Because we can redo it later (\"resume\")\n if (this.#intervalId) {\n clearInterval(this.#intervalId);\n }\n this.#intervalId = undefined;\n this.emit('empty');\n if (this.#pending === 0) {\n this.emit('idle');\n }\n return false;\n }\n if (!this.#isPaused) {\n const canInitializeInterval = !this.#isIntervalPaused;\n if (this.#doesIntervalAllowAnother && this.#doesConcurrentAllowAnother) {\n const job = this.#queue.dequeue();\n if (!job) {\n return false;\n }\n this.emit('active');\n job();\n if (canInitializeInterval) {\n this.#initializeIntervalIfNeeded();\n }\n return true;\n }\n }\n return false;\n }\n #initializeIntervalIfNeeded() {\n if (this.#isIntervalIgnored || this.#intervalId !== undefined) {\n return;\n }\n this.#intervalId = setInterval(() => {\n this.#onInterval();\n }, this.#interval);\n this.#intervalEnd = Date.now() + this.#interval;\n }\n #onInterval() {\n if (this.#intervalCount === 0 && this.#pending === 0 && this.#intervalId) {\n clearInterval(this.#intervalId);\n this.#intervalId = undefined;\n }\n this.#intervalCount = this.#carryoverConcurrencyCount ? this.#pending : 0;\n this.#processQueue();\n }\n /**\n Executes all queued functions until it reaches the limit.\n */\n #processQueue() {\n // eslint-disable-next-line no-empty\n while (this.#tryToStartAnother()) { }\n }\n get concurrency() {\n return this.#concurrency;\n }\n set concurrency(newConcurrency) {\n if (!(typeof newConcurrency === 'number' && newConcurrency >= 1)) {\n throw new TypeError(`Expected \\`concurrency\\` to be a number from 1 and up, got \\`${newConcurrency}\\` (${typeof newConcurrency})`);\n }\n this.#concurrency = newConcurrency;\n this.#processQueue();\n }\n async #throwOnAbort(signal) {\n return new Promise((_resolve, reject) => {\n signal.addEventListener('abort', () => {\n reject(signal.reason);\n }, { once: true });\n });\n }\n /**\n Updates the priority of a promise function by its id, affecting its execution order. Requires a defined concurrency limit to take effect.\n\n For example, this can be used to prioritize a promise function to run earlier.\n\n ```js\n import PQueue from 'p-queue';\n\n const queue = new PQueue({concurrency: 1});\n\n queue.add(async () => '🦄', {priority: 1});\n queue.add(async () => '🦀', {priority: 0, id: '🦀'});\n queue.add(async () => '🦄', {priority: 1});\n queue.add(async () => '🦄', {priority: 1});\n\n queue.setPriority('🦀', 2);\n ```\n\n In this case, the promise function with `id: '🦀'` runs second.\n\n You can also deprioritize a promise function to delay its execution:\n\n ```js\n import PQueue from 'p-queue';\n\n const queue = new PQueue({concurrency: 1});\n\n queue.add(async () => '🦄', {priority: 1});\n queue.add(async () => '🦀', {priority: 1, id: '🦀'});\n queue.add(async () => '🦄');\n queue.add(async () => '🦄', {priority: 0});\n\n queue.setPriority('🦀', -1);\n ```\n Here, the promise function with `id: '🦀'` executes last.\n */\n setPriority(id, priority) {\n this.#queue.setPriority(id, priority);\n }\n async add(function_, options = {}) {\n // In case `id` is not defined.\n options.id ??= (this.#idAssigner++).toString();\n options = {\n timeout: this.timeout,\n throwOnTimeout: this.#throwOnTimeout,\n ...options,\n };\n return new Promise((resolve, reject) => {\n this.#queue.enqueue(async () => {\n this.#pending++;\n this.#intervalCount++;\n try {\n options.signal?.throwIfAborted();\n let operation = function_({ signal: options.signal });\n if (options.timeout) {\n operation = pTimeout(Promise.resolve(operation), { milliseconds: options.timeout });\n }\n if (options.signal) {\n operation = Promise.race([operation, this.#throwOnAbort(options.signal)]);\n }\n const result = await operation;\n resolve(result);\n this.emit('completed', result);\n }\n catch (error) {\n if (error instanceof TimeoutError && !options.throwOnTimeout) {\n resolve();\n return;\n }\n reject(error);\n this.emit('error', error);\n }\n finally {\n this.#next();\n }\n }, options);\n this.emit('add');\n this.#tryToStartAnother();\n });\n }\n async addAll(functions, options) {\n return Promise.all(functions.map(async (function_) => this.add(function_, options)));\n }\n /**\n Start (or resume) executing enqueued tasks within concurrency limit. No need to call this if queue is not paused (via `options.autoStart = false` or by `.pause()` method.)\n */\n start() {\n if (!this.#isPaused) {\n return this;\n }\n this.#isPaused = false;\n this.#processQueue();\n return this;\n }\n /**\n Put queue execution on hold.\n */\n pause() {\n this.#isPaused = true;\n }\n /**\n Clear the queue.\n */\n clear() {\n this.#queue = new this.#queueClass();\n }\n /**\n Can be called multiple times. Useful if you for example add additional items at a later time.\n\n @returns A promise that settles when the queue becomes empty.\n */\n async onEmpty() {\n // Instantly resolve if the queue is empty\n if (this.#queue.size === 0) {\n return;\n }\n await this.#onEvent('empty');\n }\n /**\n @returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.\n\n If you want to avoid having the queue grow beyond a certain size you can `await queue.onSizeLessThan()` before adding a new item.\n\n Note that this only limits the number of items waiting to start. There could still be up to `concurrency` jobs already running that this call does not include in its calculation.\n */\n async onSizeLessThan(limit) {\n // Instantly resolve if the queue is empty.\n if (this.#queue.size < limit) {\n return;\n }\n await this.#onEvent('next', () => this.#queue.size < limit);\n }\n /**\n The difference with `.onEmpty` is that `.onIdle` guarantees that all work from the queue has finished. `.onEmpty` merely signals that the queue is empty, but it could mean that some promises haven't completed yet.\n\n @returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.\n */\n async onIdle() {\n // Instantly resolve if none pending and if nothing else is queued\n if (this.#pending === 0 && this.#queue.size === 0) {\n return;\n }\n await this.#onEvent('idle');\n }\n async #onEvent(event, filter) {\n return new Promise(resolve => {\n const listener = () => {\n if (filter && !filter()) {\n return;\n }\n this.off(event, listener);\n resolve();\n };\n this.on(event, listener);\n });\n }\n /**\n Size of the queue, the number of queued items waiting to run.\n */\n get size() {\n return this.#queue.size;\n }\n /**\n Size of the queue, filtered by the given options.\n\n For example, this can be used to find the number of items remaining in the queue with a specific priority level.\n */\n sizeBy(options) {\n // eslint-disable-next-line unicorn/no-array-callback-reference\n return this.#queue.filter(options).length;\n }\n /**\n Number of running items (no longer in the queue).\n */\n get pending() {\n return this.#pending;\n }\n /**\n Whether the queue is currently paused.\n */\n get isPaused() {\n return this.#isPaused;\n }\n}\n","/**\n * Comprehensive error handling for BMLT Query Client\n */\n\nexport enum BmltErrorType {\n API_ERROR = 'ApiError',\n NETWORK_ERROR = 'NetworkError',\n VALIDATION_ERROR = 'ValidationError',\n GEOCODING_ERROR = 'GeocodingError',\n RATE_LIMIT_ERROR = 'RateLimitError',\n TIMEOUT_ERROR = 'TimeoutError',\n AUTHENTICATION_ERROR = 'AuthenticationError',\n SERVER_ERROR = 'ServerError',\n CLIENT_ERROR = 'ClientError',\n CONFIGURATION_ERROR = 'ConfigurationError'\n}\n\nexport class BmltQueryError extends Error {\n public readonly type: BmltErrorType;\n public readonly statusCode?: number;\n public readonly response?: unknown;\n public readonly originalError?: Error;\n public readonly context?: Record<string, unknown>;\n\n constructor(\n type: BmltErrorType,\n message: string,\n options: {\n statusCode?: number;\n response?: unknown;\n originalError?: Error;\n context?: Record<string, unknown>;\n } = {}\n ) {\n super(message);\n this.name = 'BmltQueryError';\n this.type = type;\n this.statusCode = options.statusCode;\n this.response = options.response;\n this.originalError = options.originalError;\n this.context = options.context;\n\n // Ensure proper prototype chain for instanceof checks\n Object.setPrototypeOf(this, BmltQueryError.prototype);\n }\n\n /**\n * Check if error is of a specific type\n */\n isType(type: BmltErrorType): boolean {\n return this.type === type;\n }\n\n /**\n * Check if error is retryable\n */\n isRetryable(): boolean {\n const retryableTypes = [\n BmltErrorType.NETWORK_ERROR,\n BmltErrorType.TIMEOUT_ERROR,\n BmltErrorType.RATE_LIMIT_ERROR,\n BmltErrorType.SERVER_ERROR\n ];\n return retryableTypes.includes(this.type);\n }\n\n /**\n * Check if error is a client-side error (4xx)\n */\n isClientError(): boolean {\n return this.statusCode !== undefined && this.statusCode >= 400 && this.statusCode < 500;\n }\n\n /**\n * Check if error is a server-side error (5xx)\n */\n isServerError(): boolean {\n return this.statusCode !== undefined && this.statusCode >= 500;\n }\n\n /**\n * Get a user-friendly error message\n */\n getUserMessage(): string {\n switch (this.type) {\n case BmltErrorType.NETWORK_ERROR:\n return 'Unable to connect to the BMLT server. Please check your internet connection and try again.';\n \n case BmltErrorType.TIMEOUT_ERROR:\n return 'The request timed out. Please try again later.';\n \n case BmltErrorType.RATE_LIMIT_ERROR:\n return 'Too many requests. Please wait a moment and try again.';\n \n case BmltErrorType.GEOCODING_ERROR:\n return 'Unable to find the specified address. Please check the address and try again.';\n \n case BmltErrorType.VALIDATION_ERROR:\n return 'Invalid input provided. Please check your parameters and try again.';\n \n case BmltErrorType.AUTHENTICATION_ERROR:\n return 'Authentication failed. Please check your credentials.';\n \n case BmltErrorType.SERVER_ERROR:\n return 'The BMLT server encountered an error. Please try again later.';\n \n case BmltErrorType.API_ERROR:\n if (this.statusCode === 404) {\n return 'The requested resource was not found.';\n }\n return 'An error occurred while communicating with the BMLT server.';\n \n case BmltErrorType.CONFIGURATION_ERROR:\n return 'Invalid configuration. Please check your settings.';\n \n default:\n return this.message || 'An unexpected error occurred.';\n }\n }\n\n /**\n * Convert error to JSON for logging\n */\n toJSON() {\n return {\n name: this.name,\n type: this.type,\n message: this.message,\n statusCode: this.statusCode,\n response: this.response,\n context: this.context,\n stack: this.stack,\n originalError: this.originalError ? {\n name: this.originalError.name,\n message: this.originalError.message,\n stack: this.originalError.stack\n } : undefined\n };\n }\n}\n\n/**\n * Factory class for creating specific error types\n */\nexport class ErrorFactory {\n static createApiError(\n message: string,\n statusCode?: number,\n response?: unknown,\n originalError?: Error\n ): BmltQueryError {\n let type: BmltErrorType;\n \n if (statusCode) {\n if (statusCode >= 500) {\n type = BmltErrorType.SERVER_ERROR;\n } else if (statusCode === 401 || statusCode === 403) {\n type = BmltErrorType.AUTHENTICATION_ERROR;\n } else if (statusCode === 429) {\n type = BmltErrorType.RATE_LIMIT_ERROR;\n } else if (statusCode >= 400) {\n type = BmltErrorType.CLIENT_ERROR;\n } else {\n type = BmltErrorType.API_ERROR;\n }\n } else {\n type = BmltErrorType.API_ERROR;\n }\n\n return new BmltQueryError(type, message, {\n statusCode,\n response,\n originalError\n });\n }\n\n static createNetworkError(message: string, originalError?: Error): BmltQueryError {\n return new BmltQueryError(BmltErrorType.NETWORK_ERROR, message, {\n originalError\n });\n }\n\n static createTimeoutError(message: string, originalError?: Error): BmltQueryError {\n return new BmltQueryError(BmltErrorType.TIMEOUT_ERROR, message, {\n originalError\n });\n }\n\n static createValidationError(\n message: string,\n context?: Record<string, unknown>\n ): BmltQueryError {\n return new BmltQueryError(BmltErrorType.VALIDATION_ERROR, message, {\n context\n });\n }\n\n static createGeocodingError(\n message: string,\n originalError?: Error,\n context?: Record<string, unknown>\n ): BmltQueryError {\n return new BmltQueryError(BmltErrorType.GEOCODING_ERROR, message, {\n originalError,\n context\n });\n }\n\n static createRateLimitError(\n message: string,\n statusCode?: number,\n response?: unknown\n ): BmltQueryError {\n return new BmltQueryError(BmltErrorType.RATE_LIMIT_ERROR, message, {\n statusCode,\n response\n });\n }\n\n static createConfigurationError(\n message: string,\n context?: Record<string, unknown>\n ): BmltQueryError {\n return new BmltQueryError(BmltErrorType.CONFIGURATION_ERROR, message, {\n context\n });\n }\n}\n\n/**\n * Error handler utility class\n */\nexport class ErrorHandler {\n /**\n * Handle and transform fetch errors\n */\n static handleFetchError(error: unknown, response?: Response): BmltQueryError {\n // Handle AbortError (timeout)\n if (error instanceof Error && error.name === 'AbortError') {\n return ErrorFactory.createTimeoutError('Request timeout', error);\n }\n\n // Handle TypeError (network errors)\n if (error instanceof TypeError) {\n return ErrorFactory.createNetworkError('Network connection failed', error);\n }\n\n if (response && !response.ok) {\n // Server responded with error status\n const message = `HTTP ${response.status}: ${response.statusText}`;\n return ErrorFactory.createApiError(message, response.status, undefined, error as Error);\n }\n\n // Handle other errors\n if (error instanceof Error) {\n return ErrorFactory.createApiError(error.message, undefined, undefined, error);\n }\n\n // Fallback for unknown errors\n return ErrorFactory.createApiError('Unknown error occurred', undefined, undefined, new Error(String(error)));\n }\n\n /**\n * @deprecated Use handleFetchError instead\n */\n static handleAxiosError(error: any): BmltQueryError {\n return ErrorHandler.handleFetchError(error);\n }\n\n /**\n * Handle validation errors with detailed context\n */\n static handleValidationError(\n field: string,\n value: unknown,\n expectedType: string,\n constraints?: string[]\n ): BmltQueryError {\n let message = `Invalid ${field}: expected ${expectedType}`;\n \n if (constraints && constraints.length > 0) {\n message += ` (${constraints.join(', ')})`;\n }\n \n return ErrorFactory.createValidationError(message, {\n field,\n value,\n expectedType,\n constraints\n });\n }\n\n /**\n * Handle endpoint validation errors\n */\n static handleEndpointError(endpoint: string, format: string): BmltQueryError {\n const message = `Invalid endpoint/format combination: ${endpoint} with ${format}`;\n return ErrorFactory.createValidationError(message, {\n endpoint,\n format\n });\n }\n\n /**\n * Handle URL validation errors\n */\n static handleUrlError(url: string, reason: string): BmltQueryError {\n const message = `Invalid URL: ${reason}`;\n return ErrorFactory.createValidationError(message, {\n url,\n reason\n });\n }\n\n /**\n * Handle coordinate validation errors\n */\n static handleCoordinateError(\n latitude?: number,\n longitude?: number,\n reason?: string\n ): BmltQueryError {\n const message = reason || 'Invalid coordinates provided';\n return ErrorFactory.createValidationError(message, {\n latitude,\n longitude,\n reason\n });\n }\n\n /**\n * Wrap and enhance existing errors\n */\n static wrapError(\n originalError: Error,\n context: string,\n additionalContext?: Record<string, unknown>\n ): BmltQueryError {\n const message = `${context}: ${originalError.message}`;\n \n // Try to preserve the original error type if it's already a BmltQueryError\n if (originalError instanceof BmltQueryError) {\n return new BmltQueryError(originalError.type, message, {\n statusCode: originalError.statusCode,\n response: originalError.response,\n originalError: originalError.originalError || originalError,\n context: {\n ...originalError.context,\n ...additionalContext\n }\n });\n }\n\n // Default to API error for unknown errors\n return ErrorFactory.createApiError(message, undefined, undefined, originalError);\n }\n}\n\n/**\n * Retry utility for handling retryable errors\n */\nexport interface RetryOptions {\n maxRetries: number;\n baseDelay: number;\n maxDelay: number;\n factor: number;\n onRetry?: (error: BmltQueryError, attempt: number) => void;\n}\n\nexport class RetryHandler {\n static async withRetry<T>(\n operation: () => Promise<T>,\n options: RetryOptions\n ): Promise<T> {\n const {\n maxRetries,\n baseDelay,\n maxDelay,\n factor,\n onRetry\n } = options;\n\n let lastError: BmltQueryError;\n \n for (let attempt = 0; attempt <= maxRetries; attempt++) {\n try {\n return await operation();\n } catch (error) {\n const bmltError = error instanceof BmltQueryError \n ? error \n : ErrorHandler.wrapError(error as Error, 'Operation failed');\n\n lastError = bmltError;\n\n // Don't retry if it's the last attempt or error is not retryable\n if (attempt === maxRetries || !bmltError.isRetryable()) {\n throw bmltError;\n }\n\n // Calculate delay for next attempt\n const delay = Math.min(\n baseDelay * Math.pow(factor, attempt),\n maxDelay\n );\n\n // Call retry callback if provided\n if (onRetry) {\n onRetry(bmltError, attempt + 1);\n }\n\n // Wait before retrying\n await new Promise(resolve => setTimeout(resolve, delay));\n }\n }\n\n throw lastError!;\n }\n}\n","/**\n * Nominatim geocoding service with retry logic and rate limiting\n */\n\nimport pRetry from 'p-retry';\nimport PQueue from 'p-queue';\nimport { GeocodeResult, GeocodeOptions, RateLimitOptions, BmltError, Coordinates } from '../types';\nimport { BmltQueryError, BmltErrorType, ErrorHandler } from '../utils/errors';\n\nexport interface NominatimResponse {\n place_id: number;\n licence: string;\n osm_type: string;\n osm_id: number;\n lat: string;\n lon: string;\n display_name: string;\n address?: {\n house_number?: string;\n road?: string;\n neighbourhood?: string;\n suburb?: string;\n city?: string;\n town?: string;\n village?: string;\n county?: string;\n state?: string;\n postcode?: string;\n country?: string;\n country_code?: string;\n };\n importance?: number;\n boundingbox: string[];\n}\n\nexport class GeocodingService {\n private baseURL: string;\n private queue: PQueue;\n private readonly defaultOptions: Required<Omit<GeocodeOptions, 'viewbox'>> & { viewbox?: [number, number, number, number] };\n\n constructor(options: GeocodeOptions & RateLimitOptions = {}) {\n const {\n retryCount = 3,\n timeout = 10000,\n userAgent = 'bmlt-query-client/1.0.0',\n countryCode = 'us',\n viewbox,\n bounded = false,\n intervalCap = 1,\n interval = 1000, // 1 second between requests\n concurrency = 1,\n carryoverConcurrencyCount = false,\n ...rateLimitOptions\n } = options;\n\n this.defaultOptions = {\n retryCount,\n timeout,\n userAgent,\n countryCode,\n viewbox,\n bounded\n };\n\n this.baseURL = 'https://nominatim.openstreetmap.org';\n\n this.queue = new PQueue({\n intervalCap,\n interval,\n concurrency,\n carryoverConcurrencyCount,\n ...rateLimitOptions\n });\n }\n\n /**\n * Make a fetch request with timeout and error handling\n */\n private async fetchWithTimeout<T>(url: string, timeout: number, userAgent: string): Promise<T> {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), timeout);\n\n try {\n const response = await fetch(url, {\n method: 'GET',\n headers: {\n 'User-Agent': userAgent\n },\n signal: controller.signal\n });\n\n if (!response.ok) {\n if (response.status === 429) {\n const error: BmltError = new Error('Rate limit exceeded for geocoding service');\n error.name = 'RateLimitError';\n error.statusCode = 429;\n throw error;\n }\n\n if (response.status >= 400) {\n const error: BmltError = new Error(\n `Geocoding service error: ${response.status} ${response.statusText}`\n );\n error.name = 'GeocodingError';\n error.statusCode = response.status;\n throw error;\n }\n }\n\n const data = await response.json();\n return data as T;\n } catch (error) {\n if (error instanceof Error && error.name === 'AbortError') {\n const timeoutError: BmltError = new Error('Request timeout during geocoding');\n timeoutError.name = 'TimeoutError';\n throw timeoutError;\n }\n\n if (error instanceof TypeError) {\n const networkError: BmltError = new Error('Network error occurred during geocoding');\n networkError.name = 'NetworkError';\n throw networkError;\n }\n\n throw error;\n } finally {\n clearTimeout(timeoutId);\n }\n }\n\n /**\n * Geocode an address using Nominatim\n */\n async geocode(address: string, options: Partial<GeocodeOptions> = {}): Promise<GeocodeResult> {\n const geocodeOptions = { ...this.defaultOptions, ...options };\n\n return (this.queue.add(async (): Promise<GeocodeResult> => {\n return pRetry(\n async () => {\n try {\n // Build search parameters with region bias\n const searchParams: Record<string, string | number> = {\n q: address,\n format: 'json',\n addressdetails: 1,\n limit: 1,\n dedupe: 1\n };\n\n // Add country code bias if specified\n if (geocodeOptions.countryCode) {\n searchParams.countrycodes = geocodeOptions.countryCode;\n }\n\n // Add viewbox if specified\n if (geocodeOptions.viewbox) {\n searchParams.viewbox = geocodeOptions.viewbox.join(',');\n if (geocodeOptions.bounded) {\n searchParams.bounded = 1;\n }\n }\n\n // Build URL with parameters\n const searchUrl = new URL(`${this.baseURL}/search`);\n Object.entries(searchParams).forEach(([key, value]) => {\n searchUrl.searchParams.append(key, String(value));\n });\n\n const response = await this.fetchWithTimeout<NominatimResponse[]>(\n searchUrl.toString(),\n geocodeOptions.timeout,\n geocodeOptions.userAgent\n );\n\n if (!response || response.length === 0) {\n throw new BmltQueryError(\n BmltErrorType.GEOCODING_ERROR,\n `No results found for address: ${address}`\n );\n }\n\n // Always take the first result (most relevant based on search parameters)\n const result = response[0];\n const coordinates: Coordinates = {\n latitude: parseFloat(result.lat),\n longitude: parseFloat(result.lon)\n };\n\n // Validate coordinates\n if (isNaN(coordinates.latitude) || isNaN(coordinates.longitude)) {\n const error: BmltError = new Error('Invalid coordinates received from geocoding service');\n error.name = 'GeocodingError';\n throw error;\n }\n\n if (coordinates.latitude < -90 || coordinates.latitude > 90 ||\n coordinates.longitude < -180 || coordinates.longitude > 180) {\n const error: BmltError = new Error('Coordinates out of valid range');\n error.name = 'GeocodingError';\n throw error;\n }\n\n return {\n coordinates,\n display_name: result.display_name,\n confidence: result.importance,\n address: result.address ? {\n house_number: result.address.house_number,\n road: result.address.road,\n neighbourhood: result.address.neighbourhood,\n suburb: result.address.suburb,\n city: result.address.city || result.address.town || result.address.village,\n county: result.address.county,\n state: result.address.state,\n postcode: result.address.postcode,\n country: result.address.country\n } : undefined\n };\n\n } catch (error) {\n // Re-throw errors from fetchWithTimeout or validation\n throw error;\n }\n },\n {\n retries: geocodeOptions.retryCount,\n factor: 2,\n minTimeout: 1000,\n maxTimeout: 10000,\n onFailedAttempt: (error) => {\n console.warn(\n `Geocoding attempt ${error.attemptNumber} failed. ${error.retriesLeft} retries left. Error: ${error.message}`\n );\n }\n }\n );\n }) as Promise<GeocodeResult>);\n }\n\n /**\n * Batch geocode multiple addresses\n */\n async batchGeocode(addresses: string[], options: Partial<GeocodeOptions> = {}): Promise<GeocodeResult[]> {\n const promises = addresses.map(address => \n this.geocode(address, options).catch(error => {\n console.warn(`Failed to geocode address \"${address}\":`, error.message);\n return null;\n })\n );\n\n const results = await Promise.all(promises);\n return results.filter((result): result is GeocodeResult => result !== null);\n }\n\n /**\n * Reverse geocode coordinates to an address\n */\n async reverseGeocode(coordinates: Coordinates, options: Partial<GeocodeOptions> = {}): Promise<GeocodeResult> {\n const geocodeOptions = { ...this.defaultOptions, ...options };\n\n return (this.queue.add(async (): Promise<GeocodeResult> => {\n return pRetry(\n async () => {\n try {\n // Build URL with parameters\n const reverseUrl = new URL(`${this.baseURL}/reverse`);\n reverseUrl.searchParams.append('lat', String(coordinates.latitude));\n reverseUrl.searchParams.append('lon', String(coordinates.longitude));\n reverseUrl.searchParams.append('format', 'json');\n reverseUrl.searchParams.append('addressdetails', '1');\n\n const response = await this.fetchWithTimeout<NominatimResponse>(\n reverseUrl.toString(),\n geocodeOptions.timeout,\n geocodeOptions.userAgent\n );\n\n if (!response) {\n const error: BmltError = new Error(\n `No results found for coordinates: ${coordinates.latitude}, ${coordinates.longitude}`\n );\n error.name = 'GeocodingError';\n throw error;\n }\n\n const result = response;\n\n return {\n coordinates: {\n latitude: parseFloat(result.lat),\n longitude: parseFloat(result.lon)\n },\n display_name: result.display_name,\n confidence: result.importance,\n address: result.address ? {\n house_number: result.address.house_number,\n road: result.address.road,\n neighbourhood: result.address.neighbourhood,\n suburb: result.address.suburb,\n city: result.address.city || result.address.town || result.address.village,\n county: result.address.county,\n state: result.address.state,\n postcode: result.address.postcode,\n country: result.address.country\n } : undefined\n };\n\n } catch (error) {\n // Re-throw errors from fetchWithTimeout\n throw error;\n }\n },\n {\n retries: geocodeOptions.retryCount,\n factor: 2,\n minTimeout: 1000,\n maxTimeout: 10000\n }\n );\n }) as Promise<GeocodeResult>);\n }\n\n /**\n * Get the current queue size\n */\n getQueueSize(): number {\n return this.queue.size;\n }\n\n /**\n * Get the number of pending operations\n */\n getPendingCount(): number {\n return this.queue.pending;\n }\n\n /**\n * Clear the queue\n */\n clearQueue(): void {\n this.queue.clear();\n }\n\n /**\n * Set concurrency limit\n */\n setConcurrency(concurrency: number): void {\n this.queue.concurrency = concurrency;\n }\n}\n","/**\n * Base types and enums for BMLT API\n */\n\nexport enum BmltDataFormat {\n JSON = 'json',\n JSONP = 'jsonp',\n TSML = 'tsml',\n CSV = 'csv'\n}\n\nexport enum BmltEndpoint {\n GET_SEARCH_RESULTS = 'GetSearchResults',\n GET_FORMATS = 'GetFormats',\n GET_SERVICE_BODIES = 'GetServiceBodies',\n GET_CHANGES = 'GetChanges',\n GET_FIELD_KEYS = 'GetFieldKeys',\n GET_FIELD_VALUES = 'GetFieldValues',\n GET_NAWS_DUMP = 'GetNAWSDump',\n GET_SERVER_INFO = 'GetServerInfo',\n GET_COVERAGE_AREA = 'GetCoverageArea'\n}\n\nexport enum Weekday {\n SUNDAY = 1,\n MONDAY = 2,\n TUESDAY = 3,\n WEDNESDAY = 4,\n THURSDAY = 5,\n FRIDAY = 6,\n SATURDAY = 7\n}\n\nexport enum VenueType {\n IN_PERSON = 1,\n VIRTUAL = 2,\n HYBRID = 3\n}\n\nexport enum SortKey {\n WEEKDAY = 'weekday',\n TIME = 'time',\n TOWN = 'town',\n STATE = 'state',\n WEEKDAY_STATE = 'weekday_state'\n}\n\nexport enum Language {\n ENGLISH = 'en',\n GERMAN = 'de',\n DANISH = 'dk',\n SPANISH = 'es',\n PERSIAN = 'fa',\n FRENCH = 'fr',\n ITALIAN = 'it',\n POLISH = 'pl',\n PORTUGUESE = 'pt',\n SWEDISH = 'sv'\n}\n\nexport interface Coordinates {\n latitude: number;\n longitude: number;\n}\n\nexport interface BmltError extends Error {\n statusCode?: number;\n response?: unknown;\n}\n\nexport interface GeocodeOptions {\n retryCount?: number;\n timeout?: number;\n userAgent?: string;\n /** Country code for region bias (e.g., 'us', 'ca', 'gb') */\n countryCode?: string;\n /** Viewbox for region bias [minLon, minLat, maxLon, maxLat] */\n viewbox?: [number, number, number, number];\n /** Bounded search - restrict results to viewbox */\n bounded?: boolean;\n}\n\nexport interface RateLimitOptions {\n intervalCap?: number;\n interval?: number;\n carryoverConcurrencyCount?: boolean;\n concurrency?: number;\n}\n","/**\n * Utility functions for building BMLT API URLs and handling parameters\n */\n\nimport { BmltDataFormat, BmltEndpoint } from '../types';\n\nexport interface URLBuilderOptions {\n rootServerURL: string;\n format: BmltDataFormat;\n endpoint: BmltEndpoint;\n parameters?: Record<string, unknown>;\n}\n\n/**\n * Build a BMLT API URL with parameters\n */\nexport function buildBmltURL(options: URLBuilderOptions): string {\n const { rootServerURL, format, endpoint, parameters = {} } = options;\n \n // Ensure root server URL ends with slash\n const baseURL = rootServerURL.endsWith('/') ? rootServerURL : `${rootServerURL}/`;\n \n // Build the base endpoint URL\n const endpointURL = `${baseURL}client_interface/${format}/`;\n \n // Convert parameters to query string\n const queryParams = new URLSearchParams();\n queryParams.set('switcher', endpoint);\n \n // Add other parameters\n Object.entries(parameters).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n if (Array.isArray(value)) {\n // Handle array parameters\n value.forEach((item, index) => {\n if (typeof item === 'number' || typeof item === 'string') {\n queryParams.append(`${key}[]`, item.toString());\n }\n });\n } else if (typeof value === 'boolean') {\n queryParams.set(key, value ? '1' : '0');\n } else {\n queryParams.set(key, value.toString());\n }\n }\n });\n \n return `${endpointURL}?${queryParams.toString()}`;\n}\n\n/**\n * Normalize parameter values for BMLT API\n */\nexport function normalizeParameters(params: Record<string, unknown>): Record<string, unknown> {\n const normalized: Record<string, unknown> = {};\n \n Object.entries(params).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n // Handle array parameters with positive/negative values\n if (Array.isArray(value)) {\n normalized[key] = value.map(item => {\n if (typeof item === 'number') {\n return item;\n } else if (typeof item === 'string') {\n const num = parseFloat(item);\n return isNaN(num) ? item : num;\n }\n return item;\n });\n } \n // Handle boolean parameters\n else if (typeof value === 'boolean') {\n normalized[key] = value;\n }\n // Handle numeric strings\n else if (typeof value === 'string') {\n const num = parseFloat(value);\n if (!isNaN(num) && isFinite(num)) {\n normalized[key] = num;\n } else {\n normalized[key] = value;\n }\n }\n // Keep other values as-is\n else {\n normalized[key] = value;\n }\n }\n });\n \n return normalized;\n}\n\n/**\n * Validate endpoint/format combinations\n */\nexport function validateEndpointFormat(endpoint: BmltEndpoint, format: BmltDataFormat): void {\n const validCombinations: Record<BmltEndpoint, BmltDataFormat[]> = {\n [BmltEndpoint.GET_SEARCH_RESULTS]: [BmltDataFormat.JSON, BmltDataFormat.JSONP, BmltDataFormat.TSML],\n [BmltEndpoint.GET_FORMATS]: [BmltDataFormat.JSON, BmltDataFormat.JSONP],\n [BmltEndpoint.GET_SERVICE_BODIES]: [BmltDataFormat.JSON, BmltDataFormat.JSONP],\n [BmltEndpoint.GET_CHANGES]: [BmltDataFormat.JSON, BmltDataFormat.JSONP],\n [BmltEndpoint.GET_FIELD_KEYS]: [BmltDataFormat.JSON, BmltDataFormat.JSONP],\n [BmltEndpoint.GET_FIELD_VALUES]: [BmltDataFormat.JSON, BmltDataFormat.JSONP],\n [BmltEndpoint.GET_NAWS_DUMP]: [BmltDataFormat.CSV],\n [BmltEndpoint.GET_SERVER_INFO]: [BmltDataFormat.JSON, BmltDataFormat.JSONP],\n [BmltEndpoint.GET_COVERAGE_AREA]: [BmltDataFormat.JSON, BmltDataFormat.JSONP]\n };\n\n const validFormats = validCombinations[endpoint];\n if (!validFormats.includes(format)) {\n throw new Error(\n `Invalid format '${format}' for endpoint '${endpoint}'. Valid formats: ${validFormats.join(', ')}`\n );\n }\n}\n\n/**\n * Clean and validate a root server URL\n */\nexport function validateRootServerURL(url: string): string {\n try {\n const urlObj = new URL(url);\n if (!['http:', 'https:'].includes(urlObj.protocol)) {\n throw new Error('Root server URL must use http or https protocol');\n }\n \n // Return the URL without trailing slash for consistency\n return urlObj.href.replace(/\\/$/, '');\n } catch (error) {\n throw new Error(`Invalid root server URL: ${url}`);\n }\n}\n\n/**\n * Extract numeric IDs from various parameter formats\n */\nexport function extractIds(value: unknown): number[] {\n if (typeof value === 'number') {\n return [value];\n }\n \n if (typeof value === 'string') {\n // Handle comma-separated values\n return value.split(',')\n .map(id => parseInt(id.trim(), 10))\n .filter(id => !isNaN(id));\n }\n \n if (Array.isArray(value)) {\n return value\n .map(item => typeof item === 'number' ? item : parseInt(String(item), 10))\n .filter(id => !isNaN(id));\n }\n \n return [];\n}\n\n/**\n * Format time values for BMLT API\n */\nexport function formatTimeValue(hours?: number, minutes?: number): { hours?: number; minutes?: number } {\n const result: { hours?: number; minutes?: number } = {};\n \n if (typeof hours === 'number') {\n if (hours < 0 || hours > 23) {\n throw new Error('Hours must be between 0 and 23');\n }\n result.hours = hours;\n }\n \n if (typeof minutes === 'number') {\n if (minutes < 0 || minutes > 59) {\n throw new Error('Minutes must be between 0 and 59');\n }\n result.minutes = minutes;\n }\n \n return result;\n}\n\n/**\n * Validate coordinate values\n */\nexport function validateCoordinates(latitude: number, longitude: number): void {\n if (typeof latitude !== 'number' || isNaN(latitude)) {\n throw new Error('Latitude must be a valid number');\n }\n \n if (typeof longitude !== 'number' || isNaN(longitude)) {\n throw new Error('Longitude must be a valid number');\n }\n \n if (latitude < -90 || latitude > 90) {\n throw new Error('Latitude must be between -90 and 90 degrees');\n }\n \n if (longitude < -180 || longitude > 180) {\n throw new Error('Longitude must be between -180 and 180 degrees');\n }\n}\n\n/**\n * Validate radius values\n */\nexport function validateRadius(radius: number): void {\n if (typeof radius !== 'number' || isNaN(radius)) {\n throw new Error('Radius must be a valid number');\n }\n \n if (radius <= 0) {\n throw new Error('Radius must be greater than 0');\n }\n}\n\n/**\n * Convert miles to kilometers\n */\nexport function milesToKilometers(miles: number): number {\n return miles * 1.60934;\n}\n\n/**\n * Convert kilometers to miles\n */\nexport function kilometersToMiles(km: number): number {\n return km / 1.60934;\n}\n","/**\n * Main BMLT client class for querying BMLT servers\n */\n\nimport { GeocodingService } from '../services/geocoding';\nimport {\n BmltDataFormat,\n BmltEndpoint,\n BmltError,\n Meeting,\n Format,\n ServiceBody,\n Change,\n ServerInfo,\n CoverageArea,\n FieldKey,\n FieldValue,\n SearchResultsParams,\n GeographicSearchParams,\n FormatsParams,\n ServiceBodiesParams,\n ChangesParams,\n FieldValuesParams,\n NAWSDumpParams,\n GeocodeOptions,\n RateLimitOptions,\n Coordinates\n} from '../types';\nimport {\n buildBmltURL,\n validateEndpointFormat,\n validateRootServerURL,\n validateCoordinates,\n validateRadius\n} from '../utils/url-builder';\nimport { ErrorHandler } from '../utils/errors';\n\nexport interface BmltClientOptions {\n /** Root server URL */\n rootServerURL: string;\n \n /** Default data format */\n defaultFormat?: BmltDataFormat;\n \n /** HTTP request timeout in milliseconds */\n timeout?: number;\n \n /** User agent string */\n userAgent?: string;\n \n /** Geocoding options */\n geocodingOptions?: GeocodeOptions & RateLimitOptions;\n \n /** Enable automatic geocoding for address searches */\n enableGeocoding?: boolean;\n}\n\nexport class BmltClient {\n private timeout: number;\n private userAgent: string;\n private geocodingService?: GeocodingService;\n private rootServerURL: string;\n private defaultFormat: BmltDataFormat;\n\n constructor(options: BmltClientOptions) {\n const {\n rootServerURL,\n defaultFormat = BmltDataFormat.JSON,\n timeout = 30000,\n userAgent = 'bmlt-query-client/1.0.0',\n geocodingOptions = {},\n enableGeocoding = true\n } = options;\n\n // Validate and normalize root server URL\n this.rootServerURL = validateRootServerURL(rootServerURL);\n this.defaultFormat = defaultFormat;\n this.timeout = timeout;\n this.userAgent = userAgent;\n\n // Initialize geocoding service if enabled\n if (enableGeocoding) {\n this.geocodingService = new GeocodingService(geocodingOptions);\n }\n }\n\n /**\n * Make a request to the BMLT API\n */\n private async makeRequest<T>(\n endpoint: BmltEndpoint,\n parameters: Record<string, unknown> = {},\n format: BmltDataFormat = this.defaultFormat\n ): Promise<T> {\n let response: Response | undefined;\n \n try {\n // Validate endpoint/format combination\n validateEndpointFormat(endpoint, format);\n\n // Build the request URL\n const url = buildBmltURL({\n rootServerURL: this.rootServerURL,\n format,\n endpoint,\n parameters\n });\n\n // Create abort controller for timeout\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.timeout);\n\n try {\n // Make the request\n response = await fetch(url, {\n method: 'GET',\n headers: {\n 'User-Agent': this.userAgent\n },\n signal: controller.signal\n });\n } finally {\n clearTimeout(timeoutId);\n }\n\n // Check if response is ok\n if (!response.ok) {\n throw ErrorHandler.handleFetchError(\n new Error(`HTTP ${response.status}: ${response.statusText}`), \n response\n );\n }\n\n // Get response text\n const responseText = await response.text();\n\n // Handle CSV responses\n if (format === BmltDataFormat.CSV) {\n return responseText as T;\n }\n\n // Handle JSONP responses\n if (format === BmltDataFormat.JSONP) {\n // Extract JSON from JSONP callback\n const callbackName = (parameters.callback as string) || 'callback';\n const jsonMatch = responseText.match(new RegExp(`${callbackName}\\\\((.+)\\\\);?$`));\n \n if (!jsonMatch) {\n throw new Error('Invalid JSONP response format');\n }\n \n return JSON.parse(jsonMatch[1]) as T;\n }\n\n // Handle JSON and TSML responses\n if (format === BmltDataFormat.JSON || format === BmltDataFormat.TSML) {\n return JSON.parse(responseText) as T;\n }\n\n // Fallback - return as text\n return responseText as T;\n\n } catch (error) {\n throw ErrorHandler.handleFetchError(error, response);\n }\n }\n\n /**\n * Search for meetings\n */\n async searchMeetings(params: SearchResultsParams = {}): Promise<Meeting[]> {\n const { format = this.defaultFormat, ...searchParams } = params;\n return this.makeRequest<Meeting[]>(BmltEndpoint.GET_SEARCH_RESULTS, searchParams, format);\n }\n\n /**\n * Search for meetings by geographic location using geocoding\n */\n async searchMeetingsByAddress(params: GeographicSearchParams): Promise<Meeting[]> {\n if (!this.geocodingService) {\n throw new Error('Geocoding is not enabled. Initialize client with enableGeocoding: true');\n }\n\n const { address, radiusMiles, radiusKm, sortByDistance = true, searchParams = {} } = params;\n\n // Geocode the address\n const geocodeResult = await this.geocodingService.geocode(address);\n\n // Build search parameters with coordinates\n const geoSearchParams: SearchResultsParams = {\n ...searchParams,\n lat_val: geocodeResult.coordinates.latitude,\n long_val: geocodeResult.coordinates.longitude,\n sort_results_by_distance: sortByDistance\n };\n\n // Add radius parameter\n if (radiusMiles !== undefined) {\n validateRadius(radiusMiles);\n geoSearchParams.geo_width = radiusMiles;\n } else if (radiusKm !== undefined) {\n validateRadius(radiusKm);\n geoSearchParams.geo_width_km = radiusKm;\n }\n\n return this.searchMeetings(geoSearchParams);\n }\n\n /**\n * Search for meetings by coordinates\n */\n async searchMeetingsByCoordinates(\n coordinates: Coordinates,\n radiusMiles?: number,\n radiusKm?: number,\n searchParams: Omit<SearchResultsParams, 'lat_val' | 'long_val' | 'geo_width' | 'geo_width_km'> = {}\n ): Promise<Meeting[]> {\n validateCoordinates(coordinates.latitude, coordinates.longitude);\n\n const geoSearchParams: SearchResultsParams = {\n ...searchParams,\n lat_val: coordinates.latitude,\n long_val: coordinates.longitude,\n sort_results_by_distance: true\n };\n\n if (radiusMiles !== undefined) {\n validateRadius(radiusMiles);\n geoSearchParams.geo_width = radiusMiles;\n } else if (radiusKm !== undefined) {\n validateRadius(radiusKm);\n geoSearchParams.geo_width_km = radiusKm;\n }\n\n return this.searchMeetings(geoSearchParams);\n }\n\n /**\n * Get available meeting formats\n */\n async getFormats(params: FormatsParams = {}): Promise<Format[]> {\n const { format = this.defaultFormat, ...formatParams } = params;\n return this.makeRequest<Format[]>(BmltEndpoint.GET_FORMATS, formatParams, format);\n }\n\n /**\n * Get service bodies\n */\n async getServiceBodies(params: ServiceBodiesParams = {}): Promise<ServiceBody[]> {\n const { format = this.defaultFormat, ...serviceParams } = params;\n return this.makeRequest<ServiceBody[]>(BmltEndpoint.GET_SERVICE_BODIES, serviceParams, format);\n }\n\n /**\n * Get meeting changes within a date range\n */\n async getChanges(params: ChangesParams = {}): Promise<Change[]> {\n const { format = this.defaultFormat, ...changeParams } = params;\n return this.makeRequest<Change[]>(BmltEndpoint.GET_CHANGES, changeParams, format);\n }\n\n /**\n * Get available field keys\n */\n async getFieldKeys(): Promise<FieldKey[]> {\n return this.makeRequest<FieldKey[]>(BmltEndpoint.GET_FIELD_KEYS);\n }\n\n /**\n * Get field values for a specific field key\n */\n async getFieldValues(params: FieldValuesParams): Promise<FieldValue[]> {\n const { format = this.defaultFormat, ...fieldParams } = params;\n return this.makeRequest<FieldValue[]>(BmltEndpoint.GET_FIELD_VALUES, fieldParams, format);\n }\n\n /**\n * Get NAWS dump for a service body (CSV format only)\n */\n async getNAWSDump(params: NAWSDumpParams): Promise<string> {\n return this.makeRequest<string>(BmltEndpoint.GET_NAWS_DUMP, params, BmltDataFormat.CSV);\n }\n\n /**\n * Get server information\n */\n async getServerInfo(): Promise<ServerInfo> {\n return this.makeRequest<ServerInfo>(BmltEndpoint.GET_SERVER_INFO);\n }\n\n /**\n * Get server coverage area\n */\n async getCoverageArea(): Promise<CoverageArea> {\n return this.makeRequest<CoverageArea>(BmltEndpoint.GET_COVERAGE_AREA);\n }\n\n /**\n * Geocode an address using the built-in geocoding service\n */\n async geocodeAddress(address: string, options?: Partial<GeocodeOptions>) {\n if (!this.geocodingService) {\n throw new Error('Geocoding is not enabled. Initialize client with enableGeocoding: true');\n }\n\n return this.geocodingService.geocode(address, options);\n }\n\n /**\n * Reverse geocode coordinates to an address\n */\n async reverseGeocode(coordinates: Coordinates, options?: Partial<GeocodeOptions>) {\n if (!this.geocodingService) {\n throw new Error('Geocoding is not enabled. Initialize client with enableGeocoding: true');\n }\n\n return this.geocodingService.reverseGeocode(coordinates, options);\n }\n\n /**\n * Get the root server URL\n */\n getRootServerURL(): string {\n return this.rootServerURL;\n }\n\n /**\n * Update the root server URL\n */\n setRootServerURL(url: string): void {\n this.rootServerURL = validateRootServerURL(url);\n }\n\n /**\n * Get the default data format\n */\n getDefaultFormat(): BmltDataFormat {\n return this.defaultFormat;\n }\n\n /**\n * Set the default data format\n */\n setDefaultFormat(format: BmltDataFormat): void {\n this.defaultFormat = format;\n }\n\n /**\n * Get geocoding service statistics\n */\n getGeocodingStats() {\n if (!this.geocodingService) {\n return null;\n }\n\n return {\n queueSize: this.geocodingService.getQueueSize(),\n pendingCount: this.geocodingService.getPendingCount()\n };\n }\n\n /**\n * Clear the geocoding queue\n */\n clearGeocodingQueue(): void {\n if (this.geocodingService) {\n this.geocodingService.clearQueue();\n }\n }\n}\n","/**\n * Fluent query builder for BMLT meeting searches\n */\n\nimport {\n SearchResultsParams,\n Meeting,\n Weekday,\n VenueType,\n SortKey,\n Language,\n BmltDataFormat,\n Coordinates\n} from '../types';\nimport { BmltClient } from './bmlt-client';\n\nexport class MeetingQueryBuilder {\n private params: SearchResultsParams = {};\n private client: BmltClient;\n\n constructor(client: BmltClient) {\n this.client = client;\n }\n\n /**\n * Include or exclude specific meeting IDs\n */\n meetingIds(ids: number | number[], exclude = false): this {\n if (Array.isArray(ids)) {\n this.params.meeting_ids = exclude ? ids.map(id => -id) : ids;\n } else {\n this.params.meeting_ids = exclude ? -ids : ids;\n }\n return this;\n }\n\n /**\n * Include meetings on specific weekdays\n */\n onWeekdays(...days: Weekday[]): this {\n this.params.weekdays = days.length === 1 ? days[0] : days;\n return this;\n }\n\n /**\n * Exclude meetings on specific weekdays\n */\n notOnWeekdays(...days: Weekday[]): this {\n const excludeDays = days.map(day => -day);\n this.params.weekdays = excludeDays.length === 1 ? excludeDays[0] : excludeDays;\n return this;\n }\n\n /**\n * Filter by venue types\n */\n venueTypes(...types: VenueType[]): this {\n this.params.venue_types = types.length === 1 ? types[0] : types;\n return this;\n }\n\n /**\n * Include only in-person meetings\n */\n inPersonOnly(): this {\n return this.venueTypes(VenueType.IN_PERSON);\n }\n\n /**\n * Include only virtual meetings\n */\n virtualOnly(): this {\n return this.venueTypes(VenueType.VIRTUAL);\n }\n\n /**\n * Include only hybrid meetings\n */\n hybridOnly(): this {\n return this.venueTypes(VenueType.HYBRID);\n }\n\n /**\n * Include virtual and hybrid meetings\n */\n virtualOrHybrid(): this {\n return this.venueTypes(VenueType.VIRTUAL, VenueType.HYBRID);\n }\n\n /**\n * Filter by meeting formats\n */\n formats(formatIds: number | number[], exclude = false): this {\n if (Array.isArray(formatIds)) {\n this.params.formats = exclude ? formatIds.map(id => -id) : formatIds;\n } else {\n this.params.formats = exclude ? -formatIds : formatIds;\n }\n return this;\n }\n\n /**\n * Use OR logic for format matching instead of AND\n */\n anyFormat(): this {\n this.params.formats_comparison_operator = 'OR';\n return this;\n }\n\n /**\n * Filter by service bodies\n */\n serviceBodies(serviceBodyIds: number | number[], exclude = false): this {\n if (Array.isArray(serviceBodyIds)) {\n this.params.services = exclude ? serviceBodyIds.map(id => -id) : serviceBodyIds;\n } else {\n this.params.services = exclude ? -serviceBodyIds : serviceBodyIds;\n }\n return this;\n }\n\n /**\n * Include child service bodies\n */\n includeChildServiceBodies(): this {\n this.params.recursive = true;\n return this;\n }\n\n /**\n * Search for specific text\n */\n searchText(text: string): this {\n this.params.SearchString = text;\n return this;\n }\n\n /**\n * Meetings starting after specific time\n */\n startingAfter(hours: number, minutes = 0): this {\n this.params.StartsAfterH = hours;\n this.params.StartsAfterM = minutes;\n return this;\n }\n\n /**\n * Meetings starting before specific time\n */\n startingBefore(hours: number, minutes = 0): this {\n this.params.StartsBeforeH = hours;\n this.params.StartsBeforeM = minutes;\n return this;\n }\n\n /**\n * Meetings ending before specific time\n */\n endingBefore(hours: number, minutes = 0): this {\n this.params.EndsBeforeH = hours;\n this.params.EndsBeforeM = minutes;\n return this;\n }\n\n /**\n * Minimum meeting duration\n */\n minimumDuration(hours = 0, minutes = 0): this {\n if (hours > 0) this.params.MinDurationH = hours;\n if (minutes > 0) this.params.MinDurationM = minutes;\n return this;\n }\n\n /**\n * Maximum meeting duration\n */\n maximumDuration(hours = 0, minutes = 0): this {\n if (hours > 0) this.params.MaxDurationH = hours;\n if (minutes > 0) this.params.MaxDurationM = minutes;\n return this;\n }\n\n /**\n * Search within geographic area by coordinates\n */\n nearCoordinates(coordinates: Coordinates, radiusMiles?: number, radiusKm?: number): this {\n this.params.lat_val = coordinates.latitude;\n this.params.long_val = coordinates.longitude;\n \n if (radiusMiles !== undefined) {\n this.params.geo_width = radiusMiles;\n } else if (radiusKm !== undefined) {\n this.params.geo_width_km = radiusKm;\n }\n \n return this;\n }\n\n /**\n * Search for specific field value\n */\n fieldValue(fieldKey: string, value: string): this {\n this.params.meeting_key = fieldKey;\n this.params.meeting_key_value = value;\n return this;\n }\n\n /**\n * Return only specific fields\n */\n selectFields(...fields: string[]): this {\n this.params.data_field_key = fields.join(',');\n return this;\n }\n\n /**\n * Sort results by specific fields\n */\n sortBy(...fields: string[]): this {\n this.params.sort_keys = fields.join(',');\n return this;\n }\n\n /**\n * Sort by predefined aliases\n */\n sortByAlias(alias: SortKey): this {\n this.params.sort_key = alias;\n return this;\n }\n\n /**\n * Sort by distance (requires geographic search)\n */\n sortByDistance(): this {\n this.params.sort_results_by_distance = true;\n return this;\n }\n\n /**\n * Set pagination\n */\n paginate(pageSize: number, pageNumber = 1): this {\n this.params.page_size = pageSize;\n this.params.page_num = pageNumber;\n return this;\n }\n\n /**\n * Include unpublished meetings\n */\n includeUnpublished(): this {\n this.params.advanced_published = 0;\n return this;\n }\n\n /**\n * Include only unpublished meetings\n */\n unpublishedOnly(): this {\n this.params.advanced_published = -1;\n return this;\n }\n\n /**\n * Set language for format names\n */\n language(lang: Language): this {\n this.params.lang_enum = lang;\n return this;\n }\n\n /**\n * Set response format\n */\n format(format: BmltDataFormat): this {\n this.params.format = format;\n return this;\n }\n\n /**\n * Include formats used in search results\n */\n includeFormats(): this {\n this.params.get_used_formats = true;\n return this;\n }\n\n /**\n * Return only formats (requires includeFormats)\n */\n formatsOnly(): this {\n this.params.get_used_formats = true;\n this.params.get_formats_only = true;\n return this;\n }\n\n /**\n * Filter by root server IDs (aggregator mode)\n */\n rootServerIds(serverIds: number | number[], exclude = false): this {\n if (Array.isArray(serverIds)) {\n this.params.root_server_ids = exclude ? serverIds.map(id => -id) : serverIds;\n } else {\n this.params.root_server_ids = exclude ? -serverIds : serverIds;\n }\n return this;\n }\n\n /**\n * Get the current query parameters\n */\n getParams(): SearchResultsParams {\n return { ...this.params };\n }\n\n /**\n * Reset the query builder\n */\n reset(): this {\n this.params = {};\n return this;\n }\n\n /**\n * Clone the current query builder\n */\n clone(): MeetingQueryBuilder {\n const cloned = new MeetingQueryBuilder(this.client);\n cloned.params = { ...this.params };\n return cloned;\n }\n\n /**\n * Execute the search and return results\n */\n async execute(): Promise<Meeting[]> {\n return this.client.searchMeetings(this.params);\n }\n\n /**\n * Execute the search by geocoding an address first\n */\n async executeNearAddress(\n address: string,\n radiusMiles?: number,\n radiusKm?: number,\n sortByDistance = true\n ): Promise<Meeting[]> {\n return this.client.searchMeetingsByAddress({\n address,\n radiusMiles,\n radiusKm,\n sortByDistance,\n searchParams: this.params\n });\n }\n}\n\n/**\n * Convenience methods for common search patterns\n */\nexport class QuickSearch {\n private client: BmltClient;\n\n constructor(client: BmltClient) {\n this.client = client;\n }\n\n /**\n * Search for today's meetings\n */\n today(): MeetingQueryBuilder {\n const today = new Date().getDay();\n const weekday = today === 0 ? Weekday.SUNDAY : (today as Weekday);\n return new MeetingQueryBuilder(this.client).onWeekdays(weekday);\n }\n\n /**\n * Search for weekend meetings\n */\n weekend(): MeetingQueryBuilder {\n return new MeetingQueryBuilder(this.client).onWeekdays(Weekday.SATURDAY, Weekday.SUNDAY);\n }\n\n /**\n * Search for weekday meetings\n */\n weekdays(): MeetingQueryBuilder {\n return new MeetingQueryBuilder(this.client).onWeekdays(\n Weekday.MONDAY,\n Weekday.TUESDAY,\n Weekday.WEDNESDAY,\n Weekday.THURSDAY,\n Weekday.FRIDAY\n );\n }\n\n /**\n * Search for evening meetings (after 5 PM)\n */\n evening(): MeetingQueryBuilder {\n return new MeetingQueryBuilder(this.client).startingAfter(17);\n }\n\n /**\n * Search for morning meetings (before 12 PM)\n */\n morning(): MeetingQueryBuilder {\n return new MeetingQueryBuilder(this.client).startingBefore(12);\n }\n\n /**\n * Search for virtual meetings only\n */\n virtual(): MeetingQueryBuilder {\n return new MeetingQueryBuilder(this.client).virtualOnly();\n }\n\n /**\n * Search for in-person meetings only\n */\n inPerson(): MeetingQueryBuilder {\n return new MeetingQueryBuilder(this.client).inPersonOnly();\n }\n\n /**\n * Search by meeting name or location\n */\n byText(searchText: string): MeetingQueryBuilder {\n return new MeetingQueryBuilder(this.client).searchText(searchText);\n }\n}\n"],"names":["RetryOperation","timeouts","options","retry_operation","err","currentTime","timeout","self","fn","timeoutOps","counts","mainError","mainErrorCount","i","error","message","count","require$$0","exports","opts","key","a","b","attempt","random","obj","methods","method","original","op","args","callback","retry","objectToString","isError","value","errorMessages","isNetworkError","decorateErrorWithCounts","attemptNumber","retriesLeft","pRetry","input","resolve","reject","operation","abortHandler","cleanUp","result","AbortError","finalError","has","prefix","Events","EE","context","once","addListener","emitter","event","listener","evt","clearEvent","EventEmitter","names","events","name","handlers","l","ee","listeners","a1","a2","a3","a4","a5","len","length","j","module","TimeoutError","getDOMException","errorMessage","getAbortedReason","signal","reason","pTimeout","promise","milliseconds","fallback","customTimers","timer","cancelablePromise","timeoutError","lowerBound","array","comparator","first","step","it","PriorityQueue","__privateAdd","_queue","run","element","__privateGet","index","id","priority","item","PQueue","_PQueue_instances","_carryoverConcurrencyCount","_isIntervalIgnored","_intervalCount","_intervalCap","_interval","_intervalEnd","_intervalId","_timeoutId","_queueClass","_pending","_concurrency","_isPaused","_throwOnTimeout","_idAssigner","__publicField","__privateSet","newConcurrency","__privateMethod","processQueue_fn","function_","__privateWrapper","throwOnAbort_fn","next_fn","tryToStartAnother_fn","functions","onEvent_fn","limit","doesIntervalAllowAnother_get","doesConcurrentAllowAnother_get","onResumeInterval_fn","onInterval_fn","initializeIntervalIfNeeded_fn","isIntervalPaused_get","now","delay","canInitializeInterval","job","_resolve","filter","BmltErrorType","BmltQueryError","type","ErrorFactory","statusCode","response","originalError","ErrorHandler","field","expectedType","constraints","endpoint","format","url","latitude","longitude","additionalContext","RetryHandler","maxRetries","baseDelay","maxDelay","factor","onRetry","lastError","bmltError","GeocodingService","retryCount","userAgent","countryCode","viewbox","bounded","intervalCap","interval","concurrency","carryoverConcurrencyCount","rateLimitOptions","controller","timeoutId","networkError","address","geocodeOptions","searchParams","searchUrl","coordinates","addresses","promises","reverseUrl","BmltDataFormat","BmltEndpoint","Weekday","VenueType","SortKey","Language","buildBmltURL","rootServerURL","parameters","endpointURL","queryParams","normalizeParameters","params","normalized","num","validateEndpointFormat","validFormats","validateRootServerURL","urlObj","extractIds","formatTimeValue","hours","minutes","validateCoordinates","validateRadius","radius","milesToKilometers","miles","kilometersToMiles","km","BmltClient","defaultFormat","geocodingOptions","enableGeocoding","responseText","callbackName","jsonMatch","radiusMiles","radiusKm","sortByDistance","geocodeResult","geoSearchParams","formatParams","serviceParams","changeParams","fieldParams","MeetingQueryBuilder","client","ids","exclude","days","excludeDays","day","types","formatIds","serviceBodyIds","text","fieldKey","fields","alias","pageSize","pageNumber","lang","serverIds","cloned","QuickSearch","today","weekday","searchText"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,WAASA,EAAeC,GAAUC,GAAS;AAEzC,IAAI,OAAOA,KAAY,cACrBA,IAAU,EAAE,SAASA,EAAO,IAG9B,KAAK,oBAAoB,KAAK,MAAM,KAAK,UAAUD,CAAQ,CAAC,GAC5D,KAAK,YAAYA,GACjB,KAAK,WAAWC,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6,7,8,9]}
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "bmlt-query-client",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "A TypeScript client for querying BMLT (Basic Meeting List Tool) servers with built-in geocoding support",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.cjs.js",
|
|
7
|
+
"module": "dist/index.es.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.es.js",
|
|
13
|
+
"require": "./dist/index.cjs.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "vite build",
|
|
18
|
+
"build:esm": "vite build --config vite.esm.config.ts",
|
|
19
|
+
"build:all": "npm run build && npm run build:esm",
|
|
20
|
+
"dev": "vite build --watch",
|
|
21
|
+
"test": "vitest",
|
|
22
|
+
"test:ui": "vitest --ui",
|
|
23
|
+
"lint": "eslint src --ext .ts",
|
|
24
|
+
"prepublishOnly": "npm run build:all",
|
|
25
|
+
"clean": "rimraf dist"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"bmlt",
|
|
29
|
+
"meetings",
|
|
30
|
+
"recovery",
|
|
31
|
+
"na",
|
|
32
|
+
"aa",
|
|
33
|
+
"typescript",
|
|
34
|
+
"geocoding",
|
|
35
|
+
"api-client"
|
|
36
|
+
],
|
|
37
|
+
"author": "Your Name",
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "https://github.com/your-username/bmlt-query-client.git"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"p-retry": "^6.2.0",
|
|
45
|
+
"p-queue": "^8.0.1"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/node": "^20.0.0",
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
50
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
51
|
+
"eslint": "^8.0.0",
|
|
52
|
+
"rimraf": "^5.0.0",
|
|
53
|
+
"typescript": "^5.0.0",
|
|
54
|
+
"vite": "^7.0.0",
|
|
55
|
+
"vitest": "^3.0.0",
|
|
56
|
+
"@vitest/ui": "^3.2.4",
|
|
57
|
+
"vite-plugin-dts": "^4.5.4"
|
|
58
|
+
},
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">=16"
|
|
61
|
+
}
|
|
62
|
+
}
|
package/test/setup.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vitest test setup
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// Vitest timeout is configured in vite.config.ts
|
|
6
|
+
|
|
7
|
+
// Suppress console.warn during tests (for expected warnings)
|
|
8
|
+
const originalWarn = console.warn;
|
|
9
|
+
console.warn = (...args: any[]) => {
|
|
10
|
+
if (args[0]?.includes?.('Geocoding attempt') || args[0]?.includes?.('Failed to geocode')) {
|
|
11
|
+
return; // Suppress expected geocoding warnings
|
|
12
|
+
}
|
|
13
|
+
originalWarn.apply(console, args);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// Global test utilities can be added here
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/// <reference types="vitest/config" />
|
|
2
|
+
|
|
3
|
+
import { defineConfig } from 'vite';
|
|
4
|
+
import { resolve } from 'path';
|
|
5
|
+
import dts from 'vite-plugin-dts';
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
plugins: [dts()],
|
|
9
|
+
build: {
|
|
10
|
+
lib: {
|
|
11
|
+
entry: resolve(__dirname, 'src/index.ts'),
|
|
12
|
+
name: 'BmltQueryClient',
|
|
13
|
+
fileName: (format) => `index.${format}.js`,
|
|
14
|
+
formats: ['es', 'cjs']
|
|
15
|
+
},
|
|
16
|
+
rollupOptions: {
|
|
17
|
+
external: ['axios', 'p-retry', 'p-queue'],
|
|
18
|
+
output: {
|
|
19
|
+
globals: {
|
|
20
|
+
axios: 'axios',
|
|
21
|
+
'p-retry': 'pRetry',
|
|
22
|
+
'p-queue': 'PQueue'
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
sourcemap: true,
|
|
27
|
+
target: 'es2020'
|
|
28
|
+
},
|
|
29
|
+
test: {
|
|
30
|
+
environment: 'node',
|
|
31
|
+
globals: true,
|
|
32
|
+
timeout: 30000,
|
|
33
|
+
setupFiles: ['./test/setup.ts']
|
|
34
|
+
}
|
|
35
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import { resolve } from 'path';
|
|
3
|
+
|
|
4
|
+
// ES Module build for direct browser import via <script type="module">
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
build: {
|
|
7
|
+
lib: {
|
|
8
|
+
entry: resolve(__dirname, 'src/index.ts'),
|
|
9
|
+
fileName: () => 'app.js',
|
|
10
|
+
formats: ['es']
|
|
11
|
+
},
|
|
12
|
+
outDir: 'dist',
|
|
13
|
+
sourcemap: true,
|
|
14
|
+
target: 'es2020',
|
|
15
|
+
rollupOptions: {
|
|
16
|
+
// Don't externalize any dependencies - bundle everything for browser use
|
|
17
|
+
external: []
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|