@microlink/mql 0.10.28 → 0.10.30
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/dist/mql.js +2 -2
- package/dist/mql.js.map +1 -1
- package/dist/mql.min.js +1 -1
- package/dist/mql.min.js.map +1 -1
- package/dist/mql.min.mjs +3 -0
- package/dist/mql.min.mjs.map +1 -0
- package/dist/mql.mjs +723 -0
- package/dist/mql.mjs.map +1 -0
- package/package.json +7 -4
- package/src/browser.js +1 -1
package/dist/mql.js
CHANGED
|
@@ -678,9 +678,9 @@
|
|
|
678
678
|
const { default: ky } = ky$1.exports;
|
|
679
679
|
|
|
680
680
|
class MicrolinkError extends Error {
|
|
681
|
-
name = 'MicrolinkError'
|
|
682
681
|
constructor (props) {
|
|
683
682
|
super();
|
|
683
|
+
this.name = 'MicrolinkError';
|
|
684
684
|
Object.assign(this, props);
|
|
685
685
|
this.description = this.message;
|
|
686
686
|
this.message = this.code
|
|
@@ -722,7 +722,7 @@
|
|
|
722
722
|
stringify,
|
|
723
723
|
got,
|
|
724
724
|
flatten,
|
|
725
|
-
VERSION: '0.10.
|
|
725
|
+
VERSION: '0.10.30'
|
|
726
726
|
});
|
|
727
727
|
|
|
728
728
|
return browser;
|
package/dist/mql.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mql.js","sources":["../node_modules/.pnpm/url-http@1.0.7/node_modules/url-http/lightweight.js","../node_modules/.pnpm/flattie@1.1.0/node_modules/flattie/dist/index.js","../node_modules/.pnpm/qss@2.0.3/node_modules/qss/dist/qss.m.js","../src/factory.js","../src/ky.js","../src/browser.js"],"sourcesContent":["'use strict'\n\nconst URL = globalThis ? globalThis.URL : require('url').URL\n\nconst REGEX_HTTP_PROTOCOL = /^https?:\\/\\//i\n\nmodule.exports = url => {\n try {\n const { href } = new URL(url)\n return REGEX_HTTP_PROTOCOL.test(href) && href\n } catch (err) {\n return false\n }\n}\n","function iter(output, nullish, sep, val, key) {\n\tvar k, pfx = key ? (key + sep) : key;\n\n\tif (val == null) {\n\t\tif (nullish) output[key] = val;\n\t} else if (typeof val != 'object') {\n\t\toutput[key] = val;\n\t} else if (Array.isArray(val)) {\n\t\tfor (k=0; k < val.length; k++) {\n\t\t\titer(output, nullish, sep, val[k], pfx + k);\n\t\t}\n\t} else {\n\t\tfor (k in val) {\n\t\t\titer(output, nullish, sep, val[k], pfx + k);\n\t\t}\n\t}\n}\n\nfunction flattie(input, glue, toNull) {\n\tvar output = {};\n\tif (typeof input == 'object') {\n\t\titer(output, !!toNull, glue || '.', input, '');\n\t}\n\treturn output;\n}\n\nexports.flattie = flattie;","export function encode(obj, pfx) {\n\tvar k, i, tmp, str='';\n\n\tfor (k in obj) {\n\t\tif ((tmp = obj[k]) !== void 0) {\n\t\t\tif (Array.isArray(tmp)) {\n\t\t\t\tfor (i=0; i < tmp.length; i++) {\n\t\t\t\t\tstr && (str += '&');\n\t\t\t\t\tstr += encodeURIComponent(k) + '=' + encodeURIComponent(tmp[i]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstr && (str += '&');\n\t\t\t\tstr += encodeURIComponent(k) + '=' + encodeURIComponent(tmp);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn (pfx || '') + str;\n}\n\nfunction toValue(mix) {\n\tif (!mix) return '';\n\tvar str = decodeURIComponent(mix);\n\tif (str === 'false') return false;\n\tif (str === 'true') return true;\n\treturn (+str * 0 === 0) ? (+str) : str;\n}\n\nexport function decode(str) {\n\tvar tmp, k, out={}, arr=str.split('&');\n\n\twhile (tmp = arr.shift()) {\n\t\ttmp = tmp.split('=');\n\t\tk = tmp.shift();\n\t\tif (out[k] !== void 0) {\n\t\t\tout[k] = [].concat(out[k], toValue(tmp.shift()));\n\t\t} else {\n\t\t\tout[k] = toValue(tmp.shift());\n\t\t}\n\t}\n\n\treturn out;\n}\n","const ENDPOINT = {\n FREE: 'https://api.microlink.io',\n PRO: 'https://pro.microlink.io'\n}\n\nconst isObject = input => input !== null && typeof input === 'object'\n\nconst isBuffer = input =>\n input != null &&\n input.constructor != null &&\n typeof input.constructor.isBuffer === 'function' &&\n input.constructor.isBuffer(input)\n\nconst parseBody = (input, error, url) => {\n try {\n return JSON.parse(input)\n } catch (_) {\n const message = input || error.message\n\n return {\n status: 'error',\n data: { url: message },\n more: 'https://microlink.io/efatalclient',\n code: 'EFATALCLIENT',\n message,\n url\n }\n }\n}\n\nconst factory = ({\n VERSION,\n MicrolinkError,\n urlHttp,\n stringify,\n got,\n flatten\n}) => {\n const assertUrl = (url = '') => {\n if (!urlHttp(url)) {\n const message = `The \\`url\\` as \\`${url}\\` is not valid. Ensure it has protocol (http or https) and hostname.`\n throw new MicrolinkError({\n status: 'fail',\n data: { url: message },\n more: 'https://microlink.io/docs/api/api-parameters/url',\n code: 'EINVALURLCLIENT',\n message,\n url\n })\n }\n }\n\n const mapRules = rules => {\n if (!isObject(rules)) return\n const flatRules = flatten(rules)\n return Object.keys(flatRules).reduce((acc, key) => {\n acc[`data.${key}`] = flatRules[key].toString()\n return acc\n }, {})\n }\n\n const fetchFromApi = async (apiUrl, opts = {}, retryCount = 0) => {\n try {\n const response = await got(apiUrl, opts)\n return opts.responseType === 'buffer'\n ? { body: response.body, response }\n : { ...response.body, response }\n } catch (err) {\n const { response = {} } = err\n const {\n statusCode,\n body: rawBody,\n headers = {},\n url: uri = apiUrl\n } = response\n const isBodyBuffer = isBuffer(rawBody)\n\n const body =\n isObject(rawBody) && !isBodyBuffer\n ? rawBody\n : parseBody(isBodyBuffer ? rawBody.toString() : rawBody, err, uri)\n\n if (body.code === 'EFATALCLIENT' && retryCount++ < 2) {\n return fetchFromApi(apiUrl, opts, retryCount)\n }\n\n throw new MicrolinkError({\n ...body,\n message: body.message,\n url: uri,\n statusCode,\n headers\n })\n }\n }\n\n const getApiUrl = (\n url,\n { data, apiKey, endpoint, retry, cache, ...opts } = {},\n { responseType = 'json', headers: gotHeaders, ...gotOpts } = {}\n ) => {\n const isPro = !!apiKey\n const apiEndpoint = endpoint || ENDPOINT[isPro ? 'PRO' : 'FREE']\n\n const apiUrl = `${apiEndpoint}?${stringify({\n url,\n ...mapRules(data),\n ...flatten(opts)\n })}`\n\n const headers = isPro\n ? { ...gotHeaders, 'x-api-key': apiKey }\n : { ...gotHeaders }\n return [apiUrl, { ...gotOpts, responseType, cache, retry, headers }]\n }\n\n const createMql = defaultOpts => async (url, opts, gotOpts) => {\n assertUrl(url)\n const [apiUrl, fetchOpts] = getApiUrl(url, opts, {\n ...defaultOpts,\n ...gotOpts\n })\n return fetchFromApi(apiUrl, fetchOpts)\n }\n\n const mql = createMql()\n mql.MicrolinkError = MicrolinkError\n mql.getApiUrl = getApiUrl\n mql.fetchFromApi = fetchFromApi\n mql.mapRules = mapRules\n mql.version = VERSION\n mql.stream = got.stream\n mql.buffer = createMql({ responseType: 'buffer' })\n\n return mql\n}\n\nmodule.exports = factory\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ky = {}));\n})(this, (function (exports) { 'use strict';\n\n // eslint-lint-disable-next-line @typescript-eslint/naming-convention\n class HTTPError extends Error {\n constructor(response, request, options) {\n const code = (response.status || response.status === 0) ? response.status : '';\n const title = response.statusText || '';\n const status = `${code} ${title}`.trim();\n const reason = status ? `status code ${status}` : 'an unknown error';\n super(`Request failed with ${reason}`);\n this.name = 'HTTPError';\n this.response = response;\n this.request = request;\n this.options = options;\n }\n }\n\n class TimeoutError extends Error {\n constructor(request) {\n super('Request timed out');\n this.name = 'TimeoutError';\n this.request = request;\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n const isObject = (value) => value !== null && typeof value === 'object';\n\n const validateAndMerge = (...sources) => {\n for (const source of sources) {\n if ((!isObject(source) || Array.isArray(source)) && typeof source !== 'undefined') {\n throw new TypeError('The `options` argument must be an object');\n }\n }\n return deepMerge({}, ...sources);\n };\n const mergeHeaders = (source1 = {}, source2 = {}) => {\n const result = new globalThis.Headers(source1);\n const isHeadersInstance = source2 instanceof globalThis.Headers;\n const source = new globalThis.Headers(source2);\n for (const [key, value] of source.entries()) {\n if ((isHeadersInstance && value === 'undefined') || value === undefined) {\n result.delete(key);\n }\n else {\n result.set(key, value);\n }\n }\n return result;\n };\n // TODO: Make this strongly-typed (no `any`).\n const deepMerge = (...sources) => {\n let returnValue = {};\n let headers = {};\n for (const source of sources) {\n if (Array.isArray(source)) {\n if (!Array.isArray(returnValue)) {\n returnValue = [];\n }\n returnValue = [...returnValue, ...source];\n }\n else if (isObject(source)) {\n for (let [key, value] of Object.entries(source)) {\n if (isObject(value) && key in returnValue) {\n value = deepMerge(returnValue[key], value);\n }\n returnValue = { ...returnValue, [key]: value };\n }\n if (isObject(source.headers)) {\n headers = mergeHeaders(headers, source.headers);\n returnValue.headers = headers;\n }\n }\n }\n return returnValue;\n };\n\n const supportsAbortController = typeof globalThis.AbortController === 'function';\n const supportsStreams = typeof globalThis.ReadableStream === 'function';\n const supportsFormData = typeof globalThis.FormData === 'function';\n const requestMethods = ['get', 'post', 'put', 'patch', 'head', 'delete'];\n const responseTypes = {\n json: 'application/json',\n text: 'text/*',\n formData: 'multipart/form-data',\n arrayBuffer: '*/*',\n blob: '*/*',\n };\n // The maximum value of a 32bit int (see issue #117)\n const maxSafeTimeout = 2147483647;\n const stop = Symbol('stop');\n\n const normalizeRequestMethod = (input) => requestMethods.includes(input) ? input.toUpperCase() : input;\n const retryMethods = ['get', 'put', 'head', 'delete', 'options', 'trace'];\n const retryStatusCodes = [408, 413, 429, 500, 502, 503, 504];\n const retryAfterStatusCodes = [413, 429, 503];\n const defaultRetryOptions = {\n limit: 2,\n methods: retryMethods,\n statusCodes: retryStatusCodes,\n afterStatusCodes: retryAfterStatusCodes,\n maxRetryAfter: Number.POSITIVE_INFINITY,\n };\n const normalizeRetryOptions = (retry = {}) => {\n if (typeof retry === 'number') {\n return {\n ...defaultRetryOptions,\n limit: retry,\n };\n }\n if (retry.methods && !Array.isArray(retry.methods)) {\n throw new Error('retry.methods must be an array');\n }\n if (retry.statusCodes && !Array.isArray(retry.statusCodes)) {\n throw new Error('retry.statusCodes must be an array');\n }\n return {\n ...defaultRetryOptions,\n ...retry,\n afterStatusCodes: retryAfterStatusCodes,\n };\n };\n\n // `Promise.race()` workaround (#91)\n const timeout = async (request, abortController, options) => new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n if (abortController) {\n abortController.abort();\n }\n reject(new TimeoutError(request));\n }, options.timeout);\n void options\n .fetch(request)\n .then(resolve)\n .catch(reject)\n .then(() => {\n clearTimeout(timeoutId);\n });\n });\n const delay = async (ms) => new Promise(resolve => {\n setTimeout(resolve, ms);\n });\n\n class Ky {\n // eslint-disable-next-line complexity\n constructor(input, options = {}) {\n var _a, _b, _c;\n this._retryCount = 0;\n this._input = input;\n this._options = {\n // TODO: credentials can be removed when the spec change is implemented in all browsers. Context: https://www.chromestatus.com/feature/4539473312350208\n credentials: this._input.credentials || 'same-origin',\n ...options,\n headers: mergeHeaders(this._input.headers, options.headers),\n hooks: deepMerge({\n beforeRequest: [],\n beforeRetry: [],\n beforeError: [],\n afterResponse: [],\n }, options.hooks),\n method: normalizeRequestMethod((_a = options.method) !== null && _a !== void 0 ? _a : this._input.method),\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n prefixUrl: String(options.prefixUrl || ''),\n retry: normalizeRetryOptions(options.retry),\n throwHttpErrors: options.throwHttpErrors !== false,\n timeout: typeof options.timeout === 'undefined' ? 10000 : options.timeout,\n fetch: (_b = options.fetch) !== null && _b !== void 0 ? _b : globalThis.fetch.bind(globalThis),\n };\n if (typeof this._input !== 'string' && !(this._input instanceof URL || this._input instanceof globalThis.Request)) {\n throw new TypeError('`input` must be a string, URL, or Request');\n }\n if (this._options.prefixUrl && typeof this._input === 'string') {\n if (this._input.startsWith('/')) {\n throw new Error('`input` must not begin with a slash when using `prefixUrl`');\n }\n if (!this._options.prefixUrl.endsWith('/')) {\n this._options.prefixUrl += '/';\n }\n this._input = this._options.prefixUrl + this._input;\n }\n if (supportsAbortController) {\n this.abortController = new globalThis.AbortController();\n if (this._options.signal) {\n this._options.signal.addEventListener('abort', () => {\n this.abortController.abort();\n });\n }\n this._options.signal = this.abortController.signal;\n }\n this.request = new globalThis.Request(this._input, this._options);\n if (this._options.searchParams) {\n // eslint-disable-next-line unicorn/prevent-abbreviations\n const textSearchParams = typeof this._options.searchParams === 'string'\n ? this._options.searchParams.replace(/^\\?/, '')\n : new URLSearchParams(this._options.searchParams).toString();\n // eslint-disable-next-line unicorn/prevent-abbreviations\n const searchParams = '?' + textSearchParams;\n const url = this.request.url.replace(/(?:\\?.*?)?(?=#|$)/, searchParams);\n // To provide correct form boundary, Content-Type header should be deleted each time when new Request instantiated from another one\n if (((supportsFormData && this._options.body instanceof globalThis.FormData)\n || this._options.body instanceof URLSearchParams) && !(this._options.headers && this._options.headers['content-type'])) {\n this.request.headers.delete('content-type');\n }\n this.request = new globalThis.Request(new globalThis.Request(url, this.request), this._options);\n }\n if (this._options.json !== undefined) {\n this._options.body = JSON.stringify(this._options.json);\n this.request.headers.set('content-type', (_c = this._options.headers.get('content-type')) !== null && _c !== void 0 ? _c : 'application/json');\n this.request = new globalThis.Request(this.request, { body: this._options.body });\n }\n }\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n static create(input, options) {\n const ky = new Ky(input, options);\n const fn = async () => {\n if (ky._options.timeout > maxSafeTimeout) {\n throw new RangeError(`The \\`timeout\\` option cannot be greater than ${maxSafeTimeout}`);\n }\n // Delay the fetch so that body method shortcuts can set the Accept header\n await Promise.resolve();\n let response = await ky._fetch();\n for (const hook of ky._options.hooks.afterResponse) {\n // eslint-disable-next-line no-await-in-loop\n const modifiedResponse = await hook(ky.request, ky._options, ky._decorateResponse(response.clone()));\n if (modifiedResponse instanceof globalThis.Response) {\n response = modifiedResponse;\n }\n }\n ky._decorateResponse(response);\n if (!response.ok && ky._options.throwHttpErrors) {\n let error = new HTTPError(response, ky.request, ky._options);\n for (const hook of ky._options.hooks.beforeError) {\n // eslint-disable-next-line no-await-in-loop\n error = await hook(error);\n }\n throw error;\n }\n // If `onDownloadProgress` is passed, it uses the stream API internally\n /* istanbul ignore next */\n if (ky._options.onDownloadProgress) {\n if (typeof ky._options.onDownloadProgress !== 'function') {\n throw new TypeError('The `onDownloadProgress` option must be a function');\n }\n if (!supportsStreams) {\n throw new Error('Streams are not supported in your environment. `ReadableStream` is missing.');\n }\n return ky._stream(response.clone(), ky._options.onDownloadProgress);\n }\n return response;\n };\n const isRetriableMethod = ky._options.retry.methods.includes(ky.request.method.toLowerCase());\n const result = (isRetriableMethod ? ky._retry(fn) : fn());\n for (const [type, mimeType] of Object.entries(responseTypes)) {\n result[type] = async () => {\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n ky.request.headers.set('accept', ky.request.headers.get('accept') || mimeType);\n const awaitedResult = await result;\n const response = awaitedResult.clone();\n if (type === 'json') {\n if (response.status === 204) {\n return '';\n }\n if (options.parseJson) {\n return options.parseJson(await response.text());\n }\n }\n return response[type]();\n };\n }\n return result;\n }\n _calculateRetryDelay(error) {\n this._retryCount++;\n if (this._retryCount < this._options.retry.limit && !(error instanceof TimeoutError)) {\n if (error instanceof HTTPError) {\n if (!this._options.retry.statusCodes.includes(error.response.status)) {\n return 0;\n }\n const retryAfter = error.response.headers.get('Retry-After');\n if (retryAfter && this._options.retry.afterStatusCodes.includes(error.response.status)) {\n let after = Number(retryAfter);\n if (Number.isNaN(after)) {\n after = Date.parse(retryAfter) - Date.now();\n }\n else {\n after *= 1000;\n }\n if (typeof this._options.retry.maxRetryAfter !== 'undefined' && after > this._options.retry.maxRetryAfter) {\n return 0;\n }\n return after;\n }\n if (error.response.status === 413) {\n return 0;\n }\n }\n const BACKOFF_FACTOR = 0.3;\n return BACKOFF_FACTOR * (2 ** (this._retryCount - 1)) * 1000;\n }\n return 0;\n }\n _decorateResponse(response) {\n if (this._options.parseJson) {\n response.json = async () => this._options.parseJson(await response.text());\n }\n return response;\n }\n async _retry(fn) {\n try {\n return await fn();\n // eslint-disable-next-line @typescript-eslint/no-implicit-any-catch\n }\n catch (error) {\n const ms = Math.min(this._calculateRetryDelay(error), maxSafeTimeout);\n if (ms !== 0 && this._retryCount > 0) {\n await delay(ms);\n for (const hook of this._options.hooks.beforeRetry) {\n // eslint-disable-next-line no-await-in-loop\n const hookResult = await hook({\n request: this.request,\n options: this._options,\n error: error,\n retryCount: this._retryCount,\n });\n // If `stop` is returned from the hook, the retry process is stopped\n if (hookResult === stop) {\n return;\n }\n }\n return this._retry(fn);\n }\n throw error;\n }\n }\n async _fetch() {\n for (const hook of this._options.hooks.beforeRequest) {\n // eslint-disable-next-line no-await-in-loop\n const result = await hook(this.request, this._options);\n if (result instanceof Request) {\n this.request = result;\n break;\n }\n if (result instanceof Response) {\n return result;\n }\n }\n if (this._options.timeout === false) {\n return this._options.fetch(this.request.clone());\n }\n return timeout(this.request.clone(), this.abortController, this._options);\n }\n /* istanbul ignore next */\n _stream(response, onDownloadProgress) {\n const totalBytes = Number(response.headers.get('content-length')) || 0;\n let transferredBytes = 0;\n return new globalThis.Response(new globalThis.ReadableStream({\n async start(controller) {\n const reader = response.body.getReader();\n if (onDownloadProgress) {\n onDownloadProgress({ percent: 0, transferredBytes: 0, totalBytes }, new Uint8Array());\n }\n async function read() {\n const { done, value } = await reader.read();\n if (done) {\n controller.close();\n return;\n }\n if (onDownloadProgress) {\n transferredBytes += value.byteLength;\n const percent = totalBytes === 0 ? 0 : transferredBytes / totalBytes;\n onDownloadProgress({ percent, transferredBytes, totalBytes }, value);\n }\n controller.enqueue(value);\n await read();\n }\n await read();\n },\n }));\n }\n }\n\n /*! MIT License © Sindre Sorhus */\n const createInstance = (defaults) => {\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n const ky = (input, options) => Ky.create(input, validateAndMerge(defaults, options));\n for (const method of requestMethods) {\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n ky[method] = (input, options) => Ky.create(input, validateAndMerge(defaults, options, { method }));\n }\n ky.create = (newDefaults) => createInstance(validateAndMerge(newDefaults));\n ky.extend = (newDefaults) => createInstance(validateAndMerge(defaults, newDefaults));\n ky.stop = stop;\n return ky;\n };\n const ky = createInstance();\n\n exports.HTTPError = HTTPError;\n exports.TimeoutError = TimeoutError;\n exports[\"default\"] = ky;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","'use strict'\n\nconst urlHttp = require('url-http/lightweight')\nconst { flattie: flatten } = require('flattie')\nconst { encode: stringify } = require('qss')\n\nconst factory = require('./factory')\nconst { default: ky } = require('./ky')\n\nclass MicrolinkError extends Error {\n name = 'MicrolinkError'\n constructor (props) {\n super()\n Object.assign(this, props)\n this.description = this.message\n this.message = this.code\n ? `${this.code}, ${this.description}`\n : this.description\n }\n}\n\nconst got = async (url, opts) => {\n try {\n if (opts.timeout === undefined) opts.timeout = false\n const response = await ky(url, opts)\n const body = await response.json()\n const { headers, status: statusCode } = response\n return { url: response.url, body, headers, statusCode }\n } catch (err) {\n if (err.response) {\n const { response } = err\n err.response = {\n ...response,\n headers: Array.from(response.headers.entries()).reduce(\n (acc, [key, value]) => {\n acc[key] = value\n return acc\n },\n {}\n ),\n statusCode: response.status,\n body: await response.text()\n }\n }\n throw err\n }\n}\n\nmodule.exports = factory({\n MicrolinkError,\n urlHttp,\n stringify,\n got,\n flatten,\n VERSION: '__MQL_VERSION__'\n})\n"],"names":["URL","factory","this","require$$0","require$$1","require$$3","require$$4"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEA,MAA4DA,KAAA,GAAA,UAAA,CAAA,IAAA;AAC5D;CACA,MAAM,mBAAmB,GAAG,gBAAe;AAC3C;KACA,WAAc,GAAG,GAAG,IAAI;CACxB,EAAE,IAAI;CACN,IAAI,MAAM,EAAE,IAAI,EAAE,GAAG,IAAIA,KAAG,CAAC,GA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G;CAC9B,MAAM,GAAG,CAAC,QAAQ,GAAG;CACrB,QAAQ,GAAG,QAAQ;CACnB,QAAQ,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM;CAC9D,UAAU,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK;CACjC,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,MAAK;CAC5B,YAAY,OAAO,GAAG;CACtB,WAAW;CACX,UAAU,EAAE;CACZ,SAAS;CACT,QAAQ,UAAU,EAAE,QAAQ,CAAC,MAAM;CACnC,QAAQ,IAAI,EAAE,MAAM,QAAQ,CAAC,IAAI,EAAE;CACnC,QAAO;CACP,KAAK;CACL,IAAI,MAAM,GAAG;CACb,GAAG;CACH,EAAC;AACD;KACA,OAAc,GAAG,OAAO,CAAC;CACzB,EAAE,cAAc;CAChB,EAAE,OAAO;CACT,EAAE,SAAS;CACX,EAAE,GAAG;CACL,EAAE,OAAO;CACT,EAAE,OAAO,EAAE,SAAiB;CAC5B,CAAC;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"mql.js","sources":["../node_modules/.pnpm/url-http@1.0.7/node_modules/url-http/lightweight.js","../node_modules/.pnpm/flattie@1.1.0/node_modules/flattie/dist/index.js","../node_modules/.pnpm/qss@2.0.3/node_modules/qss/dist/qss.m.js","../src/factory.js","../src/ky.js","../src/browser.js"],"sourcesContent":["'use strict'\n\nconst URL = globalThis ? globalThis.URL : require('url').URL\n\nconst REGEX_HTTP_PROTOCOL = /^https?:\\/\\//i\n\nmodule.exports = url => {\n try {\n const { href } = new URL(url)\n return REGEX_HTTP_PROTOCOL.test(href) && href\n } catch (err) {\n return false\n }\n}\n","function iter(output, nullish, sep, val, key) {\n\tvar k, pfx = key ? (key + sep) : key;\n\n\tif (val == null) {\n\t\tif (nullish) output[key] = val;\n\t} else if (typeof val != 'object') {\n\t\toutput[key] = val;\n\t} else if (Array.isArray(val)) {\n\t\tfor (k=0; k < val.length; k++) {\n\t\t\titer(output, nullish, sep, val[k], pfx + k);\n\t\t}\n\t} else {\n\t\tfor (k in val) {\n\t\t\titer(output, nullish, sep, val[k], pfx + k);\n\t\t}\n\t}\n}\n\nfunction flattie(input, glue, toNull) {\n\tvar output = {};\n\tif (typeof input == 'object') {\n\t\titer(output, !!toNull, glue || '.', input, '');\n\t}\n\treturn output;\n}\n\nexports.flattie = flattie;","export function encode(obj, pfx) {\n\tvar k, i, tmp, str='';\n\n\tfor (k in obj) {\n\t\tif ((tmp = obj[k]) !== void 0) {\n\t\t\tif (Array.isArray(tmp)) {\n\t\t\t\tfor (i=0; i < tmp.length; i++) {\n\t\t\t\t\tstr && (str += '&');\n\t\t\t\t\tstr += encodeURIComponent(k) + '=' + encodeURIComponent(tmp[i]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstr && (str += '&');\n\t\t\t\tstr += encodeURIComponent(k) + '=' + encodeURIComponent(tmp);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn (pfx || '') + str;\n}\n\nfunction toValue(mix) {\n\tif (!mix) return '';\n\tvar str = decodeURIComponent(mix);\n\tif (str === 'false') return false;\n\tif (str === 'true') return true;\n\treturn (+str * 0 === 0) ? (+str) : str;\n}\n\nexport function decode(str) {\n\tvar tmp, k, out={}, arr=str.split('&');\n\n\twhile (tmp = arr.shift()) {\n\t\ttmp = tmp.split('=');\n\t\tk = tmp.shift();\n\t\tif (out[k] !== void 0) {\n\t\t\tout[k] = [].concat(out[k], toValue(tmp.shift()));\n\t\t} else {\n\t\t\tout[k] = toValue(tmp.shift());\n\t\t}\n\t}\n\n\treturn out;\n}\n","const ENDPOINT = {\n FREE: 'https://api.microlink.io',\n PRO: 'https://pro.microlink.io'\n}\n\nconst isObject = input => input !== null && typeof input === 'object'\n\nconst isBuffer = input =>\n input != null &&\n input.constructor != null &&\n typeof input.constructor.isBuffer === 'function' &&\n input.constructor.isBuffer(input)\n\nconst parseBody = (input, error, url) => {\n try {\n return JSON.parse(input)\n } catch (_) {\n const message = input || error.message\n\n return {\n status: 'error',\n data: { url: message },\n more: 'https://microlink.io/efatalclient',\n code: 'EFATALCLIENT',\n message,\n url\n }\n }\n}\n\nconst factory = ({\n VERSION,\n MicrolinkError,\n urlHttp,\n stringify,\n got,\n flatten\n}) => {\n const assertUrl = (url = '') => {\n if (!urlHttp(url)) {\n const message = `The \\`url\\` as \\`${url}\\` is not valid. Ensure it has protocol (http or https) and hostname.`\n throw new MicrolinkError({\n status: 'fail',\n data: { url: message },\n more: 'https://microlink.io/docs/api/api-parameters/url',\n code: 'EINVALURLCLIENT',\n message,\n url\n })\n }\n }\n\n const mapRules = rules => {\n if (!isObject(rules)) return\n const flatRules = flatten(rules)\n return Object.keys(flatRules).reduce((acc, key) => {\n acc[`data.${key}`] = flatRules[key].toString()\n return acc\n }, {})\n }\n\n const fetchFromApi = async (apiUrl, opts = {}, retryCount = 0) => {\n try {\n const response = await got(apiUrl, opts)\n return opts.responseType === 'buffer'\n ? { body: response.body, response }\n : { ...response.body, response }\n } catch (err) {\n const { response = {} } = err\n const {\n statusCode,\n body: rawBody,\n headers = {},\n url: uri = apiUrl\n } = response\n const isBodyBuffer = isBuffer(rawBody)\n\n const body =\n isObject(rawBody) && !isBodyBuffer\n ? rawBody\n : parseBody(isBodyBuffer ? rawBody.toString() : rawBody, err, uri)\n\n if (body.code === 'EFATALCLIENT' && retryCount++ < 2) {\n return fetchFromApi(apiUrl, opts, retryCount)\n }\n\n throw new MicrolinkError({\n ...body,\n message: body.message,\n url: uri,\n statusCode,\n headers\n })\n }\n }\n\n const getApiUrl = (\n url,\n { data, apiKey, endpoint, retry, cache, ...opts } = {},\n { responseType = 'json', headers: gotHeaders, ...gotOpts } = {}\n ) => {\n const isPro = !!apiKey\n const apiEndpoint = endpoint || ENDPOINT[isPro ? 'PRO' : 'FREE']\n\n const apiUrl = `${apiEndpoint}?${stringify({\n url,\n ...mapRules(data),\n ...flatten(opts)\n })}`\n\n const headers = isPro\n ? { ...gotHeaders, 'x-api-key': apiKey }\n : { ...gotHeaders }\n return [apiUrl, { ...gotOpts, responseType, cache, retry, headers }]\n }\n\n const createMql = defaultOpts => async (url, opts, gotOpts) => {\n assertUrl(url)\n const [apiUrl, fetchOpts] = getApiUrl(url, opts, {\n ...defaultOpts,\n ...gotOpts\n })\n return fetchFromApi(apiUrl, fetchOpts)\n }\n\n const mql = createMql()\n mql.MicrolinkError = MicrolinkError\n mql.getApiUrl = getApiUrl\n mql.fetchFromApi = fetchFromApi\n mql.mapRules = mapRules\n mql.version = VERSION\n mql.stream = got.stream\n mql.buffer = createMql({ responseType: 'buffer' })\n\n return mql\n}\n\nmodule.exports = factory\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ky = {}));\n})(this, (function (exports) { 'use strict';\n\n // eslint-lint-disable-next-line @typescript-eslint/naming-convention\n class HTTPError extends Error {\n constructor(response, request, options) {\n const code = (response.status || response.status === 0) ? response.status : '';\n const title = response.statusText || '';\n const status = `${code} ${title}`.trim();\n const reason = status ? `status code ${status}` : 'an unknown error';\n super(`Request failed with ${reason}`);\n this.name = 'HTTPError';\n this.response = response;\n this.request = request;\n this.options = options;\n }\n }\n\n class TimeoutError extends Error {\n constructor(request) {\n super('Request timed out');\n this.name = 'TimeoutError';\n this.request = request;\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n const isObject = (value) => value !== null && typeof value === 'object';\n\n const validateAndMerge = (...sources) => {\n for (const source of sources) {\n if ((!isObject(source) || Array.isArray(source)) && typeof source !== 'undefined') {\n throw new TypeError('The `options` argument must be an object');\n }\n }\n return deepMerge({}, ...sources);\n };\n const mergeHeaders = (source1 = {}, source2 = {}) => {\n const result = new globalThis.Headers(source1);\n const isHeadersInstance = source2 instanceof globalThis.Headers;\n const source = new globalThis.Headers(source2);\n for (const [key, value] of source.entries()) {\n if ((isHeadersInstance && value === 'undefined') || value === undefined) {\n result.delete(key);\n }\n else {\n result.set(key, value);\n }\n }\n return result;\n };\n // TODO: Make this strongly-typed (no `any`).\n const deepMerge = (...sources) => {\n let returnValue = {};\n let headers = {};\n for (const source of sources) {\n if (Array.isArray(source)) {\n if (!Array.isArray(returnValue)) {\n returnValue = [];\n }\n returnValue = [...returnValue, ...source];\n }\n else if (isObject(source)) {\n for (let [key, value] of Object.entries(source)) {\n if (isObject(value) && key in returnValue) {\n value = deepMerge(returnValue[key], value);\n }\n returnValue = { ...returnValue, [key]: value };\n }\n if (isObject(source.headers)) {\n headers = mergeHeaders(headers, source.headers);\n returnValue.headers = headers;\n }\n }\n }\n return returnValue;\n };\n\n const supportsAbortController = typeof globalThis.AbortController === 'function';\n const supportsStreams = typeof globalThis.ReadableStream === 'function';\n const supportsFormData = typeof globalThis.FormData === 'function';\n const requestMethods = ['get', 'post', 'put', 'patch', 'head', 'delete'];\n const responseTypes = {\n json: 'application/json',\n text: 'text/*',\n formData: 'multipart/form-data',\n arrayBuffer: '*/*',\n blob: '*/*',\n };\n // The maximum value of a 32bit int (see issue #117)\n const maxSafeTimeout = 2147483647;\n const stop = Symbol('stop');\n\n const normalizeRequestMethod = (input) => requestMethods.includes(input) ? input.toUpperCase() : input;\n const retryMethods = ['get', 'put', 'head', 'delete', 'options', 'trace'];\n const retryStatusCodes = [408, 413, 429, 500, 502, 503, 504];\n const retryAfterStatusCodes = [413, 429, 503];\n const defaultRetryOptions = {\n limit: 2,\n methods: retryMethods,\n statusCodes: retryStatusCodes,\n afterStatusCodes: retryAfterStatusCodes,\n maxRetryAfter: Number.POSITIVE_INFINITY,\n };\n const normalizeRetryOptions = (retry = {}) => {\n if (typeof retry === 'number') {\n return {\n ...defaultRetryOptions,\n limit: retry,\n };\n }\n if (retry.methods && !Array.isArray(retry.methods)) {\n throw new Error('retry.methods must be an array');\n }\n if (retry.statusCodes && !Array.isArray(retry.statusCodes)) {\n throw new Error('retry.statusCodes must be an array');\n }\n return {\n ...defaultRetryOptions,\n ...retry,\n afterStatusCodes: retryAfterStatusCodes,\n };\n };\n\n // `Promise.race()` workaround (#91)\n const timeout = async (request, abortController, options) => new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n if (abortController) {\n abortController.abort();\n }\n reject(new TimeoutError(request));\n }, options.timeout);\n void options\n .fetch(request)\n .then(resolve)\n .catch(reject)\n .then(() => {\n clearTimeout(timeoutId);\n });\n });\n const delay = async (ms) => new Promise(resolve => {\n setTimeout(resolve, ms);\n });\n\n class Ky {\n // eslint-disable-next-line complexity\n constructor(input, options = {}) {\n var _a, _b, _c;\n this._retryCount = 0;\n this._input = input;\n this._options = {\n // TODO: credentials can be removed when the spec change is implemented in all browsers. Context: https://www.chromestatus.com/feature/4539473312350208\n credentials: this._input.credentials || 'same-origin',\n ...options,\n headers: mergeHeaders(this._input.headers, options.headers),\n hooks: deepMerge({\n beforeRequest: [],\n beforeRetry: [],\n beforeError: [],\n afterResponse: [],\n }, options.hooks),\n method: normalizeRequestMethod((_a = options.method) !== null && _a !== void 0 ? _a : this._input.method),\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n prefixUrl: String(options.prefixUrl || ''),\n retry: normalizeRetryOptions(options.retry),\n throwHttpErrors: options.throwHttpErrors !== false,\n timeout: typeof options.timeout === 'undefined' ? 10000 : options.timeout,\n fetch: (_b = options.fetch) !== null && _b !== void 0 ? _b : globalThis.fetch.bind(globalThis),\n };\n if (typeof this._input !== 'string' && !(this._input instanceof URL || this._input instanceof globalThis.Request)) {\n throw new TypeError('`input` must be a string, URL, or Request');\n }\n if (this._options.prefixUrl && typeof this._input === 'string') {\n if (this._input.startsWith('/')) {\n throw new Error('`input` must not begin with a slash when using `prefixUrl`');\n }\n if (!this._options.prefixUrl.endsWith('/')) {\n this._options.prefixUrl += '/';\n }\n this._input = this._options.prefixUrl + this._input;\n }\n if (supportsAbortController) {\n this.abortController = new globalThis.AbortController();\n if (this._options.signal) {\n this._options.signal.addEventListener('abort', () => {\n this.abortController.abort();\n });\n }\n this._options.signal = this.abortController.signal;\n }\n this.request = new globalThis.Request(this._input, this._options);\n if (this._options.searchParams) {\n // eslint-disable-next-line unicorn/prevent-abbreviations\n const textSearchParams = typeof this._options.searchParams === 'string'\n ? this._options.searchParams.replace(/^\\?/, '')\n : new URLSearchParams(this._options.searchParams).toString();\n // eslint-disable-next-line unicorn/prevent-abbreviations\n const searchParams = '?' + textSearchParams;\n const url = this.request.url.replace(/(?:\\?.*?)?(?=#|$)/, searchParams);\n // To provide correct form boundary, Content-Type header should be deleted each time when new Request instantiated from another one\n if (((supportsFormData && this._options.body instanceof globalThis.FormData)\n || this._options.body instanceof URLSearchParams) && !(this._options.headers && this._options.headers['content-type'])) {\n this.request.headers.delete('content-type');\n }\n this.request = new globalThis.Request(new globalThis.Request(url, this.request), this._options);\n }\n if (this._options.json !== undefined) {\n this._options.body = JSON.stringify(this._options.json);\n this.request.headers.set('content-type', (_c = this._options.headers.get('content-type')) !== null && _c !== void 0 ? _c : 'application/json');\n this.request = new globalThis.Request(this.request, { body: this._options.body });\n }\n }\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n static create(input, options) {\n const ky = new Ky(input, options);\n const fn = async () => {\n if (ky._options.timeout > maxSafeTimeout) {\n throw new RangeError(`The \\`timeout\\` option cannot be greater than ${maxSafeTimeout}`);\n }\n // Delay the fetch so that body method shortcuts can set the Accept header\n await Promise.resolve();\n let response = await ky._fetch();\n for (const hook of ky._options.hooks.afterResponse) {\n // eslint-disable-next-line no-await-in-loop\n const modifiedResponse = await hook(ky.request, ky._options, ky._decorateResponse(response.clone()));\n if (modifiedResponse instanceof globalThis.Response) {\n response = modifiedResponse;\n }\n }\n ky._decorateResponse(response);\n if (!response.ok && ky._options.throwHttpErrors) {\n let error = new HTTPError(response, ky.request, ky._options);\n for (const hook of ky._options.hooks.beforeError) {\n // eslint-disable-next-line no-await-in-loop\n error = await hook(error);\n }\n throw error;\n }\n // If `onDownloadProgress` is passed, it uses the stream API internally\n /* istanbul ignore next */\n if (ky._options.onDownloadProgress) {\n if (typeof ky._options.onDownloadProgress !== 'function') {\n throw new TypeError('The `onDownloadProgress` option must be a function');\n }\n if (!supportsStreams) {\n throw new Error('Streams are not supported in your environment. `ReadableStream` is missing.');\n }\n return ky._stream(response.clone(), ky._options.onDownloadProgress);\n }\n return response;\n };\n const isRetriableMethod = ky._options.retry.methods.includes(ky.request.method.toLowerCase());\n const result = (isRetriableMethod ? ky._retry(fn) : fn());\n for (const [type, mimeType] of Object.entries(responseTypes)) {\n result[type] = async () => {\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n ky.request.headers.set('accept', ky.request.headers.get('accept') || mimeType);\n const awaitedResult = await result;\n const response = awaitedResult.clone();\n if (type === 'json') {\n if (response.status === 204) {\n return '';\n }\n if (options.parseJson) {\n return options.parseJson(await response.text());\n }\n }\n return response[type]();\n };\n }\n return result;\n }\n _calculateRetryDelay(error) {\n this._retryCount++;\n if (this._retryCount < this._options.retry.limit && !(error instanceof TimeoutError)) {\n if (error instanceof HTTPError) {\n if (!this._options.retry.statusCodes.includes(error.response.status)) {\n return 0;\n }\n const retryAfter = error.response.headers.get('Retry-After');\n if (retryAfter && this._options.retry.afterStatusCodes.includes(error.response.status)) {\n let after = Number(retryAfter);\n if (Number.isNaN(after)) {\n after = Date.parse(retryAfter) - Date.now();\n }\n else {\n after *= 1000;\n }\n if (typeof this._options.retry.maxRetryAfter !== 'undefined' && after > this._options.retry.maxRetryAfter) {\n return 0;\n }\n return after;\n }\n if (error.response.status === 413) {\n return 0;\n }\n }\n const BACKOFF_FACTOR = 0.3;\n return BACKOFF_FACTOR * (2 ** (this._retryCount - 1)) * 1000;\n }\n return 0;\n }\n _decorateResponse(response) {\n if (this._options.parseJson) {\n response.json = async () => this._options.parseJson(await response.text());\n }\n return response;\n }\n async _retry(fn) {\n try {\n return await fn();\n // eslint-disable-next-line @typescript-eslint/no-implicit-any-catch\n }\n catch (error) {\n const ms = Math.min(this._calculateRetryDelay(error), maxSafeTimeout);\n if (ms !== 0 && this._retryCount > 0) {\n await delay(ms);\n for (const hook of this._options.hooks.beforeRetry) {\n // eslint-disable-next-line no-await-in-loop\n const hookResult = await hook({\n request: this.request,\n options: this._options,\n error: error,\n retryCount: this._retryCount,\n });\n // If `stop` is returned from the hook, the retry process is stopped\n if (hookResult === stop) {\n return;\n }\n }\n return this._retry(fn);\n }\n throw error;\n }\n }\n async _fetch() {\n for (const hook of this._options.hooks.beforeRequest) {\n // eslint-disable-next-line no-await-in-loop\n const result = await hook(this.request, this._options);\n if (result instanceof Request) {\n this.request = result;\n break;\n }\n if (result instanceof Response) {\n return result;\n }\n }\n if (this._options.timeout === false) {\n return this._options.fetch(this.request.clone());\n }\n return timeout(this.request.clone(), this.abortController, this._options);\n }\n /* istanbul ignore next */\n _stream(response, onDownloadProgress) {\n const totalBytes = Number(response.headers.get('content-length')) || 0;\n let transferredBytes = 0;\n return new globalThis.Response(new globalThis.ReadableStream({\n async start(controller) {\n const reader = response.body.getReader();\n if (onDownloadProgress) {\n onDownloadProgress({ percent: 0, transferredBytes: 0, totalBytes }, new Uint8Array());\n }\n async function read() {\n const { done, value } = await reader.read();\n if (done) {\n controller.close();\n return;\n }\n if (onDownloadProgress) {\n transferredBytes += value.byteLength;\n const percent = totalBytes === 0 ? 0 : transferredBytes / totalBytes;\n onDownloadProgress({ percent, transferredBytes, totalBytes }, value);\n }\n controller.enqueue(value);\n await read();\n }\n await read();\n },\n }));\n }\n }\n\n /*! MIT License © Sindre Sorhus */\n const createInstance = (defaults) => {\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n const ky = (input, options) => Ky.create(input, validateAndMerge(defaults, options));\n for (const method of requestMethods) {\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n ky[method] = (input, options) => Ky.create(input, validateAndMerge(defaults, options, { method }));\n }\n ky.create = (newDefaults) => createInstance(validateAndMerge(newDefaults));\n ky.extend = (newDefaults) => createInstance(validateAndMerge(defaults, newDefaults));\n ky.stop = stop;\n return ky;\n };\n const ky = createInstance();\n\n exports.HTTPError = HTTPError;\n exports.TimeoutError = TimeoutError;\n exports[\"default\"] = ky;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","'use strict'\n\nconst urlHttp = require('url-http/lightweight')\nconst { flattie: flatten } = require('flattie')\nconst { encode: stringify } = require('qss')\n\nconst factory = require('./factory')\nconst { default: ky } = require('./ky')\n\nclass MicrolinkError extends Error {\n constructor (props) {\n super()\n this.name = 'MicrolinkError'\n Object.assign(this, props)\n this.description = this.message\n this.message = this.code\n ? `${this.code}, ${this.description}`\n : this.description\n }\n}\n\nconst got = async (url, opts) => {\n try {\n if (opts.timeout === undefined) opts.timeout = false\n const response = await ky(url, opts)\n const body = await response.json()\n const { headers, status: statusCode } = response\n return { url: response.url, body, headers, statusCode }\n } catch (err) {\n if (err.response) {\n const { response } = err\n err.response = {\n ...response,\n headers: Array.from(response.headers.entries()).reduce(\n (acc, [key, value]) => {\n acc[key] = value\n return acc\n },\n {}\n ),\n statusCode: response.status,\n body: await response.text()\n }\n }\n throw err\n }\n}\n\nmodule.exports = factory({\n MicrolinkError,\n urlHttp,\n stringify,\n got,\n flatten,\n VERSION: '__MQL_VERSION__'\n})\n"],"names":["URL","factory","this","require$$0","require$$1","require$$3","require$$4"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEA,MAA4DA,KAAA,GAAA,UAAA,CAAA,IAAA;AAC5D;CACA,MAAM,mBAAmB,GAAG,gBAAe;AAC3C;KACA,WAAc,GAAG,GAAG,IAAI;CACxB,EAAE,IAAI;CACN,IAAI,MAAM,EAAE,IAAI,EAAE,GAAG,IAAIA,KAAG,CAAC,GAAG,EAAC;CACjC,IAAI,OAAO,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI;CACjD,GAAG,CAAC,OAAO,GAAG,EAAE;CAChB,IAAI,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C,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM;CAC9D,UAAU,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK;CACjC,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,MAAK;CAC5B,YAAY,OAAO,GAAG;CACtB,WAAW;CACX,UAAU,EAAE;CACZ,SAAS;CACT,QAAQ,UAAU,EAAE,QAAQ,CAAC,MAAM;CACnC,QAAQ,IAAI,EAAE,MAAM,QAAQ,CAAC,IAAI,EAAE;CACnC,QAAO;CACP,KAAK;CACL,IAAI,MAAM,GAAG;CACb,GAAG;CACH,EAAC;AACD;KACA,OAAc,GAAG,OAAO,CAAC;CACzB,EAAE,cAAc;CAChB,EAAE,OAAO;CACT,EAAE,SAAS;CACX,EAAE,GAAG;CACL,EAAE,OAAO;CACT,EAAE,OAAO,EAAE,SAAiB;CAC5B,CAAC;;;;;;;;"}
|
package/dist/mql.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).mql=e()}(this,(function(){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function t(t){var e=t.default;if("function"==typeof e){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var o=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,o.get?o:{enumerable:!0,get:function(){return t[e]}})})),r}const e=globalThis.URL,r=/^https?:\/\//i;var o={};function s(t,e,r,o,n){var i,a=n?n+r:n;if(null==o)e&&(t[n]=o);else if("object"!=typeof o)t[n]=o;else if(Array.isArray(o))for(i=0;i<o.length;i++)s(t,e,r,o[i],a+i);else for(i in o)s(t,e,r,o[i],a+i)}function n(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||(0*+e==0?+e:e))}o.flattie=function(t,e,r){var o={};return"object"==typeof t&&s(o,!!r,e||".",t,""),o};var i=t(Object.freeze({__proto__:null,encode:function(t,e){var r,o,s,n="";for(r in t)if(void 0!==(s=t[r]))if(Array.isArray(s))for(o=0;o<s.length;o++)n&&(n+="&"),n+=encodeURIComponent(r)+"="+encodeURIComponent(s[o]);else n&&(n+="&"),n+=encodeURIComponent(r)+"="+encodeURIComponent(s);return(e||"")+n},decode:function(t){for(var e,r,o={},s=t.split("&");e=s.shift();)void 0!==o[r=(e=e.split("=")).shift()]?o[r]=[].concat(o[r],n(e.shift())):o[r]=n(e.shift());return o}}));const a={FREE:"https://api.microlink.io",PRO:"https://pro.microlink.io"},u=t=>null!==t&&"object"==typeof t;var h=({VERSION:t,MicrolinkError:e,urlHttp:r,stringify:o,got:s,flatten:n})=>{const i=t=>{if(!u(t))return;const e=n(t);return Object.keys(e).reduce(((t,r)=>(t[`data.${r}`]=e[r].toString(),t)),{})},h=async(t,r={},o=0)=>{try{const e=await s(t,r);return"buffer"===r.responseType?{body:e.body,response:e}:{...e.body,response:e}}catch(s){const{response:i={}}=s,{statusCode:a,body:c,headers:p={},url:l=t}=i,f=null!=(n=c)&&null!=n.constructor&&"function"==typeof n.constructor.isBuffer&&n.constructor.isBuffer(n),d=u(c)&&!f?c:((t,e,r)=>{try{return JSON.parse(t)}catch(o){const s=t||e.message;return{status:"error",data:{url:s},more:"https://microlink.io/efatalclient",code:"EFATALCLIENT",message:s,url:r}}})(f?c.toString():c,s,l);if("EFATALCLIENT"===d.code&&o++<2)return h(t,r,o);throw new e({...d,message:d.message,url:l,statusCode:a,headers:p})}var n},c=(t,{data:e,apiKey:r,endpoint:s,retry:u,cache:h,...c}={},{responseType:p="json",headers:l,...f}={})=>{const d=!!r;return[`${s||a[d?"PRO":"FREE"]}?${o({url:t,...i(e),...n(c)})}`,{...f,responseType:p,cache:h,retry:u,headers:d?{...l,"x-api-key":r}:{...l}}]},p=t=>async(o,s,n)=>{((t="")=>{if(!r(t)){const r=`The \`url\` as \`${t}\` is not valid. Ensure it has protocol (http or https) and hostname.`;throw new e({status:"fail",data:{url:r},more:"https://microlink.io/docs/api/api-parameters/url",code:"EINVALURLCLIENT",message:r,url:t})}})(o);const[i,a]=c(o,s,{...t,...n});return h(i,a)},l=p();return l.MicrolinkError=e,l.getApiUrl=c,l.fetchFromApi=h,l.mapRules=i,l.version=t,l.stream=s.stream,l.buffer=p({responseType:"buffer"}),l},c={exports:{}};!function(t,e){!function(t){class e extends Error{constructor(t,e,r){const o=`${t.status||0===t.status?t.status:""} ${t.statusText||""}`.trim();super("Request failed with "+(o?`status code ${o}`:"an unknown error")),this.name="HTTPError",this.response=t,this.request=e,this.options=r}}class r extends Error{constructor(t){super("Request timed out"),this.name="TimeoutError",this.request=t}}const o=t=>null!==t&&"object"==typeof t,s=(...t)=>{for(const e of t)if((!o(e)||Array.isArray(e))&&void 0!==e)throw new TypeError("The `options` argument must be an object");return i({},...t)},n=(t={},e={})=>{const r=new globalThis.Headers(t),o=e instanceof globalThis.Headers,s=new globalThis.Headers(e);for(const[t,e]of s.entries())o&&"undefined"===e||void 0===e?r.delete(t):r.set(t,e);return r},i=(...t)=>{let e={},r={};for(const s of t)if(Array.isArray(s))Array.isArray(e)||(e=[]),e=[...e,...s];else if(o(s)){for(let[t,r]of Object.entries(s))o(r)&&t in e&&(r=i(e[t],r)),e={...e,[t]:r};o(s.headers)&&(r=n(r,s.headers),e.headers=r)}return e},a="function"==typeof globalThis.AbortController,u="function"==typeof globalThis.ReadableStream,h="function"==typeof globalThis.FormData,c=["get","post","put","patch","head","delete"],p={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},l=2147483647,f=Symbol("stop"),d=t=>c.includes(t)?t.toUpperCase():t,y=[413,429,503],m={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:y,maxRetryAfter:Number.POSITIVE_INFINITY},b=(t={})=>{if("number"==typeof t)return{...m,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...m,...t,afterStatusCodes:y}},_=async(t,e,o)=>new Promise(((s,n)=>{const i=setTimeout((()=>{e&&e.abort(),n(new r(t))}),o.timeout);o.fetch(t).then(s).catch(n).then((()=>{clearTimeout(i)}))})),g=async t=>new Promise((e=>{setTimeout(e,t)}));class w{constructor(t,e={}){var r,o,s;if(this._retryCount=0,this._input=t,this._options={credentials:this._input.credentials||"same-origin",...e,headers:n(this._input.headers,e.headers),hooks:i({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},e.hooks),method:d(null!==(r=e.method)&&void 0!==r?r:this._input.method),prefixUrl:String(e.prefixUrl||""),retry:b(e.retry),throwHttpErrors:!1!==e.throwHttpErrors,timeout:void 0===e.timeout?1e4:e.timeout,fetch:null!==(o=e.fetch)&&void 0!==o?o:globalThis.fetch.bind(globalThis)},"string"!=typeof this._input&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&"string"==typeof this._input){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(a&&(this.abortController=new globalThis.AbortController,this._options.signal&&this._options.signal.addEventListener("abort",(()=>{this.abortController.abort()})),this._options.signal=this.abortController.signal),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){const t="?"+("string"==typeof this._options.searchParams?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),e=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,t);!(h&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)||this._options.headers&&this._options.headers["content-type"]||this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(e,this.request),this._options)}void 0!==this._options.json&&(this._options.body=JSON.stringify(this._options.json),this.request.headers.set("content-type",null!==(s=this._options.headers.get("content-type"))&&void 0!==s?s:"application/json"),this.request=new globalThis.Request(this.request,{body:this._options.body}))}static create(t,r){const o=new w(t,r),s=async()=>{if(o._options.timeout>l)throw new RangeError(`The \`timeout\` option cannot be greater than ${l}`);await Promise.resolve();let t=await o._fetch();for(const e of o._options.hooks.afterResponse){const r=await e(o.request,o._options,o._decorateResponse(t.clone()));r instanceof globalThis.Response&&(t=r)}if(o._decorateResponse(t),!t.ok&&o._options.throwHttpErrors){let r=new e(t,o.request,o._options);for(const t of o._options.hooks.beforeError)r=await t(r);throw r}if(o._options.onDownloadProgress){if("function"!=typeof o._options.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!u)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return o._stream(t.clone(),o._options.onDownloadProgress)}return t},n=o._options.retry.methods.includes(o.request.method.toLowerCase())?o._retry(s):s();for(const[t,e]of Object.entries(p))n[t]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||e);const s=(await n).clone();if("json"===t){if(204===s.status)return"";if(r.parseJson)return r.parseJson(await s.text())}return s[t]()};return n}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount<this._options.retry.limit&&!(t instanceof r)){if(t instanceof e){if(!this._options.retry.statusCodes.includes(t.response.status))return 0;const e=t.response.headers.get("Retry-After");if(e&&this._options.retry.afterStatusCodes.includes(t.response.status)){let t=Number(e);return Number.isNaN(t)?t=Date.parse(e)-Date.now():t*=1e3,void 0!==this._options.retry.maxRetryAfter&&t>this._options.retry.maxRetryAfter?0:t}if(413===t.response.status)return 0}return.3*2**(this._retryCount-1)*1e3}return 0}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(e){const r=Math.min(this._calculateRetryDelay(e),l);if(0!==r&&this._retryCount>0){await g(r);for(const t of this._options.hooks.beforeRetry)if(await t({request:this.request,options:this._options,error:e,retryCount:this._retryCount})===f)return;return this._retry(t)}throw e}}async _fetch(){for(const t of this._options.hooks.beforeRequest){const e=await t(this.request,this._options);if(e instanceof Request){this.request=e;break}if(e instanceof Response)return e}return!1===this._options.timeout?this._options.fetch(this.request.clone()):_(this.request.clone(),this.abortController,this._options)}_stream(t,e){const r=Number(t.headers.get("content-length"))||0;let o=0;return new globalThis.Response(new globalThis.ReadableStream({async start(s){const n=t.body.getReader();async function i(){const{done:t,value:a}=await n.read();t?s.close():(e&&(o+=a.byteLength,e({percent:0===r?0:o/r,transferredBytes:o,totalBytes:r},a)),s.enqueue(a),await i())}e&&e({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array),await i()}}))}}
|
|
2
|
-
/*! MIT License © Sindre Sorhus */const T=t=>{const e=(e,r)=>w.create(e,s(t,r));for(const r of c)e[r]=(e,o)=>w.create(e,s(t,o,{method:r}));return e.create=t=>T(s(t)),e.extend=e=>T(s(t,e)),e.stop=f,e},R=T();t.HTTPError=e,t.TimeoutError=r,t.default=R,Object.defineProperty(t,"__esModule",{value:!0})}(e)}(0,c.exports);const p=t=>{try{const{href:o}=new e(t);return r.test(o)&&o}catch(t){return!1}},{flattie:l}=o,{encode:f}=i,d=h,{default:y}=c.exports;class m extends Error{
|
|
2
|
+
/*! MIT License © Sindre Sorhus */const T=t=>{const e=(e,r)=>w.create(e,s(t,r));for(const r of c)e[r]=(e,o)=>w.create(e,s(t,o,{method:r}));return e.create=t=>T(s(t)),e.extend=e=>T(s(t,e)),e.stop=f,e},R=T();t.HTTPError=e,t.TimeoutError=r,t.default=R,Object.defineProperty(t,"__esModule",{value:!0})}(e)}(0,c.exports);const p=t=>{try{const{href:o}=new e(t);return r.test(o)&&o}catch(t){return!1}},{flattie:l}=o,{encode:f}=i,d=h,{default:y}=c.exports;class m extends Error{constructor(t){super(),this.name="MicrolinkError",Object.assign(this,t),this.description=this.message,this.message=this.code?`${this.code}, ${this.description}`:this.description}}return d({MicrolinkError:m,urlHttp:p,stringify:f,got:async(t,e)=>{try{void 0===e.timeout&&(e.timeout=!1);const r=await y(t,e),o=await r.json(),{headers:s,status:n}=r;return{url:r.url,body:o,headers:s,statusCode:n}}catch(t){if(t.response){const{response:e}=t;t.response={...e,headers:Array.from(e.headers.entries()).reduce(((t,[e,r])=>(t[e]=r,t)),{}),statusCode:e.status,body:await e.text()}}throw t}},flatten:l,VERSION:"0.10.30"})}));
|
|
3
3
|
//# sourceMappingURL=mql.min.js.map
|
package/dist/mql.min.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mql.min.js","sources":["../node_modules/.pnpm/url-http@1.0.7/node_modules/url-http/lightweight.js","../node_modules/.pnpm/flattie@1.1.0/node_modules/flattie/dist/index.js","../node_modules/.pnpm/qss@2.0.3/node_modules/qss/dist/qss.m.js","../src/factory.js","../src/ky.js","../src/browser.js"],"sourcesContent":["'use strict'\n\nconst URL = globalThis ? globalThis.URL : require('url').URL\n\nconst REGEX_HTTP_PROTOCOL = /^https?:\\/\\//i\n\nmodule.exports = url => {\n try {\n const { href } = new URL(url)\n return REGEX_HTTP_PROTOCOL.test(href) && href\n } catch (err) {\n return false\n }\n}\n","function iter(output, nullish, sep, val, key) {\n\tvar k, pfx = key ? (key + sep) : key;\n\n\tif (val == null) {\n\t\tif (nullish) output[key] = val;\n\t} else if (typeof val != 'object') {\n\t\toutput[key] = val;\n\t} else if (Array.isArray(val)) {\n\t\tfor (k=0; k < val.length; k++) {\n\t\t\titer(output, nullish, sep, val[k], pfx + k);\n\t\t}\n\t} else {\n\t\tfor (k in val) {\n\t\t\titer(output, nullish, sep, val[k], pfx + k);\n\t\t}\n\t}\n}\n\nfunction flattie(input, glue, toNull) {\n\tvar output = {};\n\tif (typeof input == 'object') {\n\t\titer(output, !!toNull, glue || '.', input, '');\n\t}\n\treturn output;\n}\n\nexports.flattie = flattie;","export function encode(obj, pfx) {\n\tvar k, i, tmp, str='';\n\n\tfor (k in obj) {\n\t\tif ((tmp = obj[k]) !== void 0) {\n\t\t\tif (Array.isArray(tmp)) {\n\t\t\t\tfor (i=0; i < tmp.length; i++) {\n\t\t\t\t\tstr && (str += '&');\n\t\t\t\t\tstr += encodeURIComponent(k) + '=' + encodeURIComponent(tmp[i]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstr && (str += '&');\n\t\t\t\tstr += encodeURIComponent(k) + '=' + encodeURIComponent(tmp);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn (pfx || '') + str;\n}\n\nfunction toValue(mix) {\n\tif (!mix) return '';\n\tvar str = decodeURIComponent(mix);\n\tif (str === 'false') return false;\n\tif (str === 'true') return true;\n\treturn (+str * 0 === 0) ? (+str) : str;\n}\n\nexport function decode(str) {\n\tvar tmp, k, out={}, arr=str.split('&');\n\n\twhile (tmp = arr.shift()) {\n\t\ttmp = tmp.split('=');\n\t\tk = tmp.shift();\n\t\tif (out[k] !== void 0) {\n\t\t\tout[k] = [].concat(out[k], toValue(tmp.shift()));\n\t\t} else {\n\t\t\tout[k] = toValue(tmp.shift());\n\t\t}\n\t}\n\n\treturn out;\n}\n","const ENDPOINT = {\n FREE: 'https://api.microlink.io',\n PRO: 'https://pro.microlink.io'\n}\n\nconst isObject = input => input !== null && typeof input === 'object'\n\nconst isBuffer = input =>\n input != null &&\n input.constructor != null &&\n typeof input.constructor.isBuffer === 'function' &&\n input.constructor.isBuffer(input)\n\nconst parseBody = (input, error, url) => {\n try {\n return JSON.parse(input)\n } catch (_) {\n const message = input || error.message\n\n return {\n status: 'error',\n data: { url: message },\n more: 'https://microlink.io/efatalclient',\n code: 'EFATALCLIENT',\n message,\n url\n }\n }\n}\n\nconst factory = ({\n VERSION,\n MicrolinkError,\n urlHttp,\n stringify,\n got,\n flatten\n}) => {\n const assertUrl = (url = '') => {\n if (!urlHttp(url)) {\n const message = `The \\`url\\` as \\`${url}\\` is not valid. Ensure it has protocol (http or https) and hostname.`\n throw new MicrolinkError({\n status: 'fail',\n data: { url: message },\n more: 'https://microlink.io/docs/api/api-parameters/url',\n code: 'EINVALURLCLIENT',\n message,\n url\n })\n }\n }\n\n const mapRules = rules => {\n if (!isObject(rules)) return\n const flatRules = flatten(rules)\n return Object.keys(flatRules).reduce((acc, key) => {\n acc[`data.${key}`] = flatRules[key].toString()\n return acc\n }, {})\n }\n\n const fetchFromApi = async (apiUrl, opts = {}, retryCount = 0) => {\n try {\n const response = await got(apiUrl, opts)\n return opts.responseType === 'buffer'\n ? { body: response.body, response }\n : { ...response.body, response }\n } catch (err) {\n const { response = {} } = err\n const {\n statusCode,\n body: rawBody,\n headers = {},\n url: uri = apiUrl\n } = response\n const isBodyBuffer = isBuffer(rawBody)\n\n const body =\n isObject(rawBody) && !isBodyBuffer\n ? rawBody\n : parseBody(isBodyBuffer ? rawBody.toString() : rawBody, err, uri)\n\n if (body.code === 'EFATALCLIENT' && retryCount++ < 2) {\n return fetchFromApi(apiUrl, opts, retryCount)\n }\n\n throw new MicrolinkError({\n ...body,\n message: body.message,\n url: uri,\n statusCode,\n headers\n })\n }\n }\n\n const getApiUrl = (\n url,\n { data, apiKey, endpoint, retry, cache, ...opts } = {},\n { responseType = 'json', headers: gotHeaders, ...gotOpts } = {}\n ) => {\n const isPro = !!apiKey\n const apiEndpoint = endpoint || ENDPOINT[isPro ? 'PRO' : 'FREE']\n\n const apiUrl = `${apiEndpoint}?${stringify({\n url,\n ...mapRules(data),\n ...flatten(opts)\n })}`\n\n const headers = isPro\n ? { ...gotHeaders, 'x-api-key': apiKey }\n : { ...gotHeaders }\n return [apiUrl, { ...gotOpts, responseType, cache, retry, headers }]\n }\n\n const createMql = defaultOpts => async (url, opts, gotOpts) => {\n assertUrl(url)\n const [apiUrl, fetchOpts] = getApiUrl(url, opts, {\n ...defaultOpts,\n ...gotOpts\n })\n return fetchFromApi(apiUrl, fetchOpts)\n }\n\n const mql = createMql()\n mql.MicrolinkError = MicrolinkError\n mql.getApiUrl = getApiUrl\n mql.fetchFromApi = fetchFromApi\n mql.mapRules = mapRules\n mql.version = VERSION\n mql.stream = got.stream\n mql.buffer = createMql({ responseType: 'buffer' })\n\n return mql\n}\n\nmodule.exports = factory\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ky = {}));\n})(this, (function (exports) { 'use strict';\n\n // eslint-lint-disable-next-line @typescript-eslint/naming-convention\n class HTTPError extends Error {\n constructor(response, request, options) {\n const code = (response.status || response.status === 0) ? response.status : '';\n const title = response.statusText || '';\n const status = `${code} ${title}`.trim();\n const reason = status ? `status code ${status}` : 'an unknown error';\n super(`Request failed with ${reason}`);\n this.name = 'HTTPError';\n this.response = response;\n this.request = request;\n this.options = options;\n }\n }\n\n class TimeoutError extends Error {\n constructor(request) {\n super('Request timed out');\n this.name = 'TimeoutError';\n this.request = request;\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n const isObject = (value) => value !== null && typeof value === 'object';\n\n const validateAndMerge = (...sources) => {\n for (const source of sources) {\n if ((!isObject(source) || Array.isArray(source)) && typeof source !== 'undefined') {\n throw new TypeError('The `options` argument must be an object');\n }\n }\n return deepMerge({}, ...sources);\n };\n const mergeHeaders = (source1 = {}, source2 = {}) => {\n const result = new globalThis.Headers(source1);\n const isHeadersInstance = source2 instanceof globalThis.Headers;\n const source = new globalThis.Headers(source2);\n for (const [key, value] of source.entries()) {\n if ((isHeadersInstance && value === 'undefined') || value === undefined) {\n result.delete(key);\n }\n else {\n result.set(key, value);\n }\n }\n return result;\n };\n // TODO: Make this strongly-typed (no `any`).\n const deepMerge = (...sources) => {\n let returnValue = {};\n let headers = {};\n for (const source of sources) {\n if (Array.isArray(source)) {\n if (!Array.isArray(returnValue)) {\n returnValue = [];\n }\n returnValue = [...returnValue, ...source];\n }\n else if (isObject(source)) {\n for (let [key, value] of Object.entries(source)) {\n if (isObject(value) && key in returnValue) {\n value = deepMerge(returnValue[key], value);\n }\n returnValue = { ...returnValue, [key]: value };\n }\n if (isObject(source.headers)) {\n headers = mergeHeaders(headers, source.headers);\n returnValue.headers = headers;\n }\n }\n }\n return returnValue;\n };\n\n const supportsAbortController = typeof globalThis.AbortController === 'function';\n const supportsStreams = typeof globalThis.ReadableStream === 'function';\n const supportsFormData = typeof globalThis.FormData === 'function';\n const requestMethods = ['get', 'post', 'put', 'patch', 'head', 'delete'];\n const responseTypes = {\n json: 'application/json',\n text: 'text/*',\n formData: 'multipart/form-data',\n arrayBuffer: '*/*',\n blob: '*/*',\n };\n // The maximum value of a 32bit int (see issue #117)\n const maxSafeTimeout = 2147483647;\n const stop = Symbol('stop');\n\n const normalizeRequestMethod = (input) => requestMethods.includes(input) ? input.toUpperCase() : input;\n const retryMethods = ['get', 'put', 'head', 'delete', 'options', 'trace'];\n const retryStatusCodes = [408, 413, 429, 500, 502, 503, 504];\n const retryAfterStatusCodes = [413, 429, 503];\n const defaultRetryOptions = {\n limit: 2,\n methods: retryMethods,\n statusCodes: retryStatusCodes,\n afterStatusCodes: retryAfterStatusCodes,\n maxRetryAfter: Number.POSITIVE_INFINITY,\n };\n const normalizeRetryOptions = (retry = {}) => {\n if (typeof retry === 'number') {\n return {\n ...defaultRetryOptions,\n limit: retry,\n };\n }\n if (retry.methods && !Array.isArray(retry.methods)) {\n throw new Error('retry.methods must be an array');\n }\n if (retry.statusCodes && !Array.isArray(retry.statusCodes)) {\n throw new Error('retry.statusCodes must be an array');\n }\n return {\n ...defaultRetryOptions,\n ...retry,\n afterStatusCodes: retryAfterStatusCodes,\n };\n };\n\n // `Promise.race()` workaround (#91)\n const timeout = async (request, abortController, options) => new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n if (abortController) {\n abortController.abort();\n }\n reject(new TimeoutError(request));\n }, options.timeout);\n void options\n .fetch(request)\n .then(resolve)\n .catch(reject)\n .then(() => {\n clearTimeout(timeoutId);\n });\n });\n const delay = async (ms) => new Promise(resolve => {\n setTimeout(resolve, ms);\n });\n\n class Ky {\n // eslint-disable-next-line complexity\n constructor(input, options = {}) {\n var _a, _b, _c;\n this._retryCount = 0;\n this._input = input;\n this._options = {\n // TODO: credentials can be removed when the spec change is implemented in all browsers. Context: https://www.chromestatus.com/feature/4539473312350208\n credentials: this._input.credentials || 'same-origin',\n ...options,\n headers: mergeHeaders(this._input.headers, options.headers),\n hooks: deepMerge({\n beforeRequest: [],\n beforeRetry: [],\n beforeError: [],\n afterResponse: [],\n }, options.hooks),\n method: normalizeRequestMethod((_a = options.method) !== null && _a !== void 0 ? _a : this._input.method),\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n prefixUrl: String(options.prefixUrl || ''),\n retry: normalizeRetryOptions(options.retry),\n throwHttpErrors: options.throwHttpErrors !== false,\n timeout: typeof options.timeout === 'undefined' ? 10000 : options.timeout,\n fetch: (_b = options.fetch) !== null && _b !== void 0 ? _b : globalThis.fetch.bind(globalThis),\n };\n if (typeof this._input !== 'string' && !(this._input instanceof URL || this._input instanceof globalThis.Request)) {\n throw new TypeError('`input` must be a string, URL, or Request');\n }\n if (this._options.prefixUrl && typeof this._input === 'string') {\n if (this._input.startsWith('/')) {\n throw new Error('`input` must not begin with a slash when using `prefixUrl`');\n }\n if (!this._options.prefixUrl.endsWith('/')) {\n this._options.prefixUrl += '/';\n }\n this._input = this._options.prefixUrl + this._input;\n }\n if (supportsAbortController) {\n this.abortController = new globalThis.AbortController();\n if (this._options.signal) {\n this._options.signal.addEventListener('abort', () => {\n this.abortController.abort();\n });\n }\n this._options.signal = this.abortController.signal;\n }\n this.request = new globalThis.Request(this._input, this._options);\n if (this._options.searchParams) {\n // eslint-disable-next-line unicorn/prevent-abbreviations\n const textSearchParams = typeof this._options.searchParams === 'string'\n ? this._options.searchParams.replace(/^\\?/, '')\n : new URLSearchParams(this._options.searchParams).toString();\n // eslint-disable-next-line unicorn/prevent-abbreviations\n const searchParams = '?' + textSearchParams;\n const url = this.request.url.replace(/(?:\\?.*?)?(?=#|$)/, searchParams);\n // To provide correct form boundary, Content-Type header should be deleted each time when new Request instantiated from another one\n if (((supportsFormData && this._options.body instanceof globalThis.FormData)\n || this._options.body instanceof URLSearchParams) && !(this._options.headers && this._options.headers['content-type'])) {\n this.request.headers.delete('content-type');\n }\n this.request = new globalThis.Request(new globalThis.Request(url, this.request), this._options);\n }\n if (this._options.json !== undefined) {\n this._options.body = JSON.stringify(this._options.json);\n this.request.headers.set('content-type', (_c = this._options.headers.get('content-type')) !== null && _c !== void 0 ? _c : 'application/json');\n this.request = new globalThis.Request(this.request, { body: this._options.body });\n }\n }\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n static create(input, options) {\n const ky = new Ky(input, options);\n const fn = async () => {\n if (ky._options.timeout > maxSafeTimeout) {\n throw new RangeError(`The \\`timeout\\` option cannot be greater than ${maxSafeTimeout}`);\n }\n // Delay the fetch so that body method shortcuts can set the Accept header\n await Promise.resolve();\n let response = await ky._fetch();\n for (const hook of ky._options.hooks.afterResponse) {\n // eslint-disable-next-line no-await-in-loop\n const modifiedResponse = await hook(ky.request, ky._options, ky._decorateResponse(response.clone()));\n if (modifiedResponse instanceof globalThis.Response) {\n response = modifiedResponse;\n }\n }\n ky._decorateResponse(response);\n if (!response.ok && ky._options.throwHttpErrors) {\n let error = new HTTPError(response, ky.request, ky._options);\n for (const hook of ky._options.hooks.beforeError) {\n // eslint-disable-next-line no-await-in-loop\n error = await hook(error);\n }\n throw error;\n }\n // If `onDownloadProgress` is passed, it uses the stream API internally\n /* istanbul ignore next */\n if (ky._options.onDownloadProgress) {\n if (typeof ky._options.onDownloadProgress !== 'function') {\n throw new TypeError('The `onDownloadProgress` option must be a function');\n }\n if (!supportsStreams) {\n throw new Error('Streams are not supported in your environment. `ReadableStream` is missing.');\n }\n return ky._stream(response.clone(), ky._options.onDownloadProgress);\n }\n return response;\n };\n const isRetriableMethod = ky._options.retry.methods.includes(ky.request.method.toLowerCase());\n const result = (isRetriableMethod ? ky._retry(fn) : fn());\n for (const [type, mimeType] of Object.entries(responseTypes)) {\n result[type] = async () => {\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n ky.request.headers.set('accept', ky.request.headers.get('accept') || mimeType);\n const awaitedResult = await result;\n const response = awaitedResult.clone();\n if (type === 'json') {\n if (response.status === 204) {\n return '';\n }\n if (options.parseJson) {\n return options.parseJson(await response.text());\n }\n }\n return response[type]();\n };\n }\n return result;\n }\n _calculateRetryDelay(error) {\n this._retryCount++;\n if (this._retryCount < this._options.retry.limit && !(error instanceof TimeoutError)) {\n if (error instanceof HTTPError) {\n if (!this._options.retry.statusCodes.includes(error.response.status)) {\n return 0;\n }\n const retryAfter = error.response.headers.get('Retry-After');\n if (retryAfter && this._options.retry.afterStatusCodes.includes(error.response.status)) {\n let after = Number(retryAfter);\n if (Number.isNaN(after)) {\n after = Date.parse(retryAfter) - Date.now();\n }\n else {\n after *= 1000;\n }\n if (typeof this._options.retry.maxRetryAfter !== 'undefined' && after > this._options.retry.maxRetryAfter) {\n return 0;\n }\n return after;\n }\n if (error.response.status === 413) {\n return 0;\n }\n }\n const BACKOFF_FACTOR = 0.3;\n return BACKOFF_FACTOR * (2 ** (this._retryCount - 1)) * 1000;\n }\n return 0;\n }\n _decorateResponse(response) {\n if (this._options.parseJson) {\n response.json = async () => this._options.parseJson(await response.text());\n }\n return response;\n }\n async _retry(fn) {\n try {\n return await fn();\n // eslint-disable-next-line @typescript-eslint/no-implicit-any-catch\n }\n catch (error) {\n const ms = Math.min(this._calculateRetryDelay(error), maxSafeTimeout);\n if (ms !== 0 && this._retryCount > 0) {\n await delay(ms);\n for (const hook of this._options.hooks.beforeRetry) {\n // eslint-disable-next-line no-await-in-loop\n const hookResult = await hook({\n request: this.request,\n options: this._options,\n error: error,\n retryCount: this._retryCount,\n });\n // If `stop` is returned from the hook, the retry process is stopped\n if (hookResult === stop) {\n return;\n }\n }\n return this._retry(fn);\n }\n throw error;\n }\n }\n async _fetch() {\n for (const hook of this._options.hooks.beforeRequest) {\n // eslint-disable-next-line no-await-in-loop\n const result = await hook(this.request, this._options);\n if (result instanceof Request) {\n this.request = result;\n break;\n }\n if (result instanceof Response) {\n return result;\n }\n }\n if (this._options.timeout === false) {\n return this._options.fetch(this.request.clone());\n }\n return timeout(this.request.clone(), this.abortController, this._options);\n }\n /* istanbul ignore next */\n _stream(response, onDownloadProgress) {\n const totalBytes = Number(response.headers.get('content-length')) || 0;\n let transferredBytes = 0;\n return new globalThis.Response(new globalThis.ReadableStream({\n async start(controller) {\n const reader = response.body.getReader();\n if (onDownloadProgress) {\n onDownloadProgress({ percent: 0, transferredBytes: 0, totalBytes }, new Uint8Array());\n }\n async function read() {\n const { done, value } = await reader.read();\n if (done) {\n controller.close();\n return;\n }\n if (onDownloadProgress) {\n transferredBytes += value.byteLength;\n const percent = totalBytes === 0 ? 0 : transferredBytes / totalBytes;\n onDownloadProgress({ percent, transferredBytes, totalBytes }, value);\n }\n controller.enqueue(value);\n await read();\n }\n await read();\n },\n }));\n }\n }\n\n /*! MIT License © Sindre Sorhus */\n const createInstance = (defaults) => {\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n const ky = (input, options) => Ky.create(input, validateAndMerge(defaults, options));\n for (const method of requestMethods) {\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n ky[method] = (input, options) => Ky.create(input, validateAndMerge(defaults, options, { method }));\n }\n ky.create = (newDefaults) => createInstance(validateAndMerge(newDefaults));\n ky.extend = (newDefaults) => createInstance(validateAndMerge(defaults, newDefaults));\n ky.stop = stop;\n return ky;\n };\n const ky = createInstance();\n\n exports.HTTPError = HTTPError;\n exports.TimeoutError = TimeoutError;\n exports[\"default\"] = ky;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","'use strict'\n\nconst urlHttp = require('url-http/lightweight')\nconst { flattie: flatten } = require('flattie')\nconst { encode: stringify } = require('qss')\n\nconst factory = require('./factory')\nconst { default: ky } = require('./ky')\n\nclass MicrolinkError extends Error {\n name = 'MicrolinkError'\n constructor (props) {\n super()\n Object.assign(this, props)\n this.description = this.message\n this.message = this.code\n ? `${this.code}, ${this.description}`\n : this.description\n }\n}\n\nconst got = async (url, opts) => {\n try {\n if (opts.timeout === undefined) opts.timeout = false\n const response = await ky(url, opts)\n const body = await response.json()\n const { headers, status: statusCode } = response\n return { url: response.url, body, headers, statusCode }\n } catch (err) {\n if (err.response) {\n const { response } = err\n err.response = {\n ...response,\n headers: Array.from(response.headers.entries()).reduce(\n (acc, [key, value]) => {\n acc[key] = value\n return acc\n },\n {}\n ),\n statusCode: response.status,\n body: await response.text()\n }\n }\n throw err\n }\n}\n\nmodule.exports = factory({\n MicrolinkError,\n urlHttp,\n stringify,\n got,\n flatten,\n VERSION: '__MQL_VERSION__'\n})\n"],"names":["URL","globalThis","REGEX_HTTP_PROTOCOL","iter","output","nullish","sep","val","key","k","pfx","Array","isArray","length","toValue","mix","str","decodeURIComponent","dist","flattie","input","glue","toNull","obj","i","tmp","encodeURIComponent","out","arr","split","shift","concat","ENDPOINT","FREE","PRO","isObject","factory_1","VERSION","MicrolinkError","urlHttp","stringify","got","flatten","mapRules","rules","flatRules","Object","keys","reduce","acc","toString","fetchFromApi","async","apiUrl","opts","retryCount","response","responseType","body","err","statusCode","rawBody","headers","url","uri","isBodyBuffer","constructor","isBuffer","error","JSON","parse","_","message","status","data","more","code","parseBody","getApiUrl","apiKey","endpoint","retry","cache","gotHeaders","gotOpts","isPro","createMql","defaultOpts","assertUrl","fetchOpts","mql","version","stream","buffer","exports","HTTPError","Error","request","options","statusText","trim","super","this","name","TimeoutError","value","validateAndMerge","sources","source","TypeError","deepMerge","mergeHeaders","source1","source2","result","Headers","isHeadersInstance","entries","undefined","delete","set","returnValue","supportsAbortController","AbortController","supportsStreams","ReadableStream","supportsFormData","FormData","requestMethods","responseTypes","json","text","formData","arrayBuffer","blob","maxSafeTimeout","stop","Symbol","normalizeRequestMethod","includes","toUpperCase","retryAfterStatusCodes","defaultRetryOptions","limit","methods","statusCodes","afterStatusCodes","maxRetryAfter","Number","POSITIVE_INFINITY","normalizeRetryOptions","timeout","abortController","Promise","resolve","reject","timeoutId","setTimeout","abort","fetch","then","catch","clearTimeout","delay","ms","Ky","_a","_b","_c","_retryCount","_input","_options","credentials","hooks","beforeRequest","beforeRetry","beforeError","afterResponse","method","prefixUrl","String","throwHttpErrors","bind","Request","startsWith","endsWith","signal","addEventListener","searchParams","replace","URLSearchParams","get","static","ky","fn","RangeError","_fetch","hook","modifiedResponse","_decorateResponse","clone","Response","ok","onDownloadProgress","_stream","toLowerCase","_retry","type","mimeType","parseJson","_calculateRetryDelay","retryAfter","after","isNaN","Date","now","Math","min","totalBytes","transferredBytes","controller","reader","getReader","read","done","close","byteLength","percent","enqueue","Uint8Array","createInstance","defaults","create","newDefaults","extend","defineProperty","factory","href","test","require$$1","encode","require$$2","require$$3","default","require$$4","props","assign","description","from"],"mappings":"stBAEA,MAA4DA,EAAAC,WAAAD,IAEtDE,EAAsB,yBCJ5B,SAASC,EAAKC,EAAQC,EAASC,EAAKC,EAAKC,GACxC,IAAIC,EAAGC,EAAMF,EAAOA,EAAMF,EAAOE,EAEjC,GAAW,MAAPD,EACCF,IAASD,EAAOI,GAAOD,QACrB,GAAkB,iBAAPA,EACjBH,EAAOI,GAAOD,OACR,GAAII,MAAMC,QAAQL,GACxB,IAAKE,EAAE,EAAGA,EAAIF,EAAIM,OAAQJ,IACzBN,EAAKC,EAAQC,EAASC,EAAKC,EAAIE,GAAIC,EAAMD,QAG1C,IAAKA,KAAKF,EACTJ,EAAKC,EAAQC,EAASC,EAAKC,EAAIE,GAAIC,EAAMD,GCO5C,SAASK,EAAQC,GAChB,IAAKA,EAAK,MAAO,GACjB,IAAIC,EAAMC,mBAAmBF,GAC7B,MAAY,UAARC,IACQ,SAARA,IACW,GAANA,GAAY,GAAOA,EAAOA,IDCpCE,EAAAC,QARA,SAAiBC,EAAOC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AS0E,QACtBpE,QAAEA,EAASW,OAAQb,GAAeJ,EACxC,MAAO,CAAEO,IAAKP,EAASO,IAAKL,OAAMI,UAASF,cAC3C,MAAOD,GACP,GAAIA,EAAIH,SAAU,CAChB,MAAMA,SAAEA,GAAaG,EACrBA,EAAIH,SAAW,IACVA,EACHM,QAASnD,MAAM6O,KAAKhM,EAASM,QAAQuD,WAAWrE,QAC9C,CAACC,GAAMzC,EAAKiG,MACVxD,EAAIzC,GAAOiG,EACJxD,IAET,IAEFW,WAAYJ,EAASiB,OACrBf,WAAYF,EAAS2E,QAGzB,MAAMxE,IASRjB,UACAL,QAAS"}
|
|
1
|
+
{"version":3,"file":"mql.min.js","sources":["../node_modules/.pnpm/url-http@1.0.7/node_modules/url-http/lightweight.js","../node_modules/.pnpm/flattie@1.1.0/node_modules/flattie/dist/index.js","../node_modules/.pnpm/qss@2.0.3/node_modules/qss/dist/qss.m.js","../src/factory.js","../src/ky.js","../src/browser.js"],"sourcesContent":["'use strict'\n\nconst URL = globalThis ? globalThis.URL : require('url').URL\n\nconst REGEX_HTTP_PROTOCOL = /^https?:\\/\\//i\n\nmodule.exports = url => {\n try {\n const { href } = new URL(url)\n return REGEX_HTTP_PROTOCOL.test(href) && href\n } catch (err) {\n return false\n }\n}\n","function iter(output, nullish, sep, val, key) {\n\tvar k, pfx = key ? (key + sep) : key;\n\n\tif (val == null) {\n\t\tif (nullish) output[key] = val;\n\t} else if (typeof val != 'object') {\n\t\toutput[key] = val;\n\t} else if (Array.isArray(val)) {\n\t\tfor (k=0; k < val.length; k++) {\n\t\t\titer(output, nullish, sep, val[k], pfx + k);\n\t\t}\n\t} else {\n\t\tfor (k in val) {\n\t\t\titer(output, nullish, sep, val[k], pfx + k);\n\t\t}\n\t}\n}\n\nfunction flattie(input, glue, toNull) {\n\tvar output = {};\n\tif (typeof input == 'object') {\n\t\titer(output, !!toNull, glue || '.', input, '');\n\t}\n\treturn output;\n}\n\nexports.flattie = flattie;","export function encode(obj, pfx) {\n\tvar k, i, tmp, str='';\n\n\tfor (k in obj) {\n\t\tif ((tmp = obj[k]) !== void 0) {\n\t\t\tif (Array.isArray(tmp)) {\n\t\t\t\tfor (i=0; i < tmp.length; i++) {\n\t\t\t\t\tstr && (str += '&');\n\t\t\t\t\tstr += encodeURIComponent(k) + '=' + encodeURIComponent(tmp[i]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstr && (str += '&');\n\t\t\t\tstr += encodeURIComponent(k) + '=' + encodeURIComponent(tmp);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn (pfx || '') + str;\n}\n\nfunction toValue(mix) {\n\tif (!mix) return '';\n\tvar str = decodeURIComponent(mix);\n\tif (str === 'false') return false;\n\tif (str === 'true') return true;\n\treturn (+str * 0 === 0) ? (+str) : str;\n}\n\nexport function decode(str) {\n\tvar tmp, k, out={}, arr=str.split('&');\n\n\twhile (tmp = arr.shift()) {\n\t\ttmp = tmp.split('=');\n\t\tk = tmp.shift();\n\t\tif (out[k] !== void 0) {\n\t\t\tout[k] = [].concat(out[k], toValue(tmp.shift()));\n\t\t} else {\n\t\t\tout[k] = toValue(tmp.shift());\n\t\t}\n\t}\n\n\treturn out;\n}\n","const ENDPOINT = {\n FREE: 'https://api.microlink.io',\n PRO: 'https://pro.microlink.io'\n}\n\nconst isObject = input => input !== null && typeof input === 'object'\n\nconst isBuffer = input =>\n input != null &&\n input.constructor != null &&\n typeof input.constructor.isBuffer === 'function' &&\n input.constructor.isBuffer(input)\n\nconst parseBody = (input, error, url) => {\n try {\n return JSON.parse(input)\n } catch (_) {\n const message = input || error.message\n\n return {\n status: 'error',\n data: { url: message },\n more: 'https://microlink.io/efatalclient',\n code: 'EFATALCLIENT',\n message,\n url\n }\n }\n}\n\nconst factory = ({\n VERSION,\n MicrolinkError,\n urlHttp,\n stringify,\n got,\n flatten\n}) => {\n const assertUrl = (url = '') => {\n if (!urlHttp(url)) {\n const message = `The \\`url\\` as \\`${url}\\` is not valid. Ensure it has protocol (http or https) and hostname.`\n throw new MicrolinkError({\n status: 'fail',\n data: { url: message },\n more: 'https://microlink.io/docs/api/api-parameters/url',\n code: 'EINVALURLCLIENT',\n message,\n url\n })\n }\n }\n\n const mapRules = rules => {\n if (!isObject(rules)) return\n const flatRules = flatten(rules)\n return Object.keys(flatRules).reduce((acc, key) => {\n acc[`data.${key}`] = flatRules[key].toString()\n return acc\n }, {})\n }\n\n const fetchFromApi = async (apiUrl, opts = {}, retryCount = 0) => {\n try {\n const response = await got(apiUrl, opts)\n return opts.responseType === 'buffer'\n ? { body: response.body, response }\n : { ...response.body, response }\n } catch (err) {\n const { response = {} } = err\n const {\n statusCode,\n body: rawBody,\n headers = {},\n url: uri = apiUrl\n } = response\n const isBodyBuffer = isBuffer(rawBody)\n\n const body =\n isObject(rawBody) && !isBodyBuffer\n ? rawBody\n : parseBody(isBodyBuffer ? rawBody.toString() : rawBody, err, uri)\n\n if (body.code === 'EFATALCLIENT' && retryCount++ < 2) {\n return fetchFromApi(apiUrl, opts, retryCount)\n }\n\n throw new MicrolinkError({\n ...body,\n message: body.message,\n url: uri,\n statusCode,\n headers\n })\n }\n }\n\n const getApiUrl = (\n url,\n { data, apiKey, endpoint, retry, cache, ...opts } = {},\n { responseType = 'json', headers: gotHeaders, ...gotOpts } = {}\n ) => {\n const isPro = !!apiKey\n const apiEndpoint = endpoint || ENDPOINT[isPro ? 'PRO' : 'FREE']\n\n const apiUrl = `${apiEndpoint}?${stringify({\n url,\n ...mapRules(data),\n ...flatten(opts)\n })}`\n\n const headers = isPro\n ? { ...gotHeaders, 'x-api-key': apiKey }\n : { ...gotHeaders }\n return [apiUrl, { ...gotOpts, responseType, cache, retry, headers }]\n }\n\n const createMql = defaultOpts => async (url, opts, gotOpts) => {\n assertUrl(url)\n const [apiUrl, fetchOpts] = getApiUrl(url, opts, {\n ...defaultOpts,\n ...gotOpts\n })\n return fetchFromApi(apiUrl, fetchOpts)\n }\n\n const mql = createMql()\n mql.MicrolinkError = MicrolinkError\n mql.getApiUrl = getApiUrl\n mql.fetchFromApi = fetchFromApi\n mql.mapRules = mapRules\n mql.version = VERSION\n mql.stream = got.stream\n mql.buffer = createMql({ responseType: 'buffer' })\n\n return mql\n}\n\nmodule.exports = factory\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ky = {}));\n})(this, (function (exports) { 'use strict';\n\n // eslint-lint-disable-next-line @typescript-eslint/naming-convention\n class HTTPError extends Error {\n constructor(response, request, options) {\n const code = (response.status || response.status === 0) ? response.status : '';\n const title = response.statusText || '';\n const status = `${code} ${title}`.trim();\n const reason = status ? `status code ${status}` : 'an unknown error';\n super(`Request failed with ${reason}`);\n this.name = 'HTTPError';\n this.response = response;\n this.request = request;\n this.options = options;\n }\n }\n\n class TimeoutError extends Error {\n constructor(request) {\n super('Request timed out');\n this.name = 'TimeoutError';\n this.request = request;\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n const isObject = (value) => value !== null && typeof value === 'object';\n\n const validateAndMerge = (...sources) => {\n for (const source of sources) {\n if ((!isObject(source) || Array.isArray(source)) && typeof source !== 'undefined') {\n throw new TypeError('The `options` argument must be an object');\n }\n }\n return deepMerge({}, ...sources);\n };\n const mergeHeaders = (source1 = {}, source2 = {}) => {\n const result = new globalThis.Headers(source1);\n const isHeadersInstance = source2 instanceof globalThis.Headers;\n const source = new globalThis.Headers(source2);\n for (const [key, value] of source.entries()) {\n if ((isHeadersInstance && value === 'undefined') || value === undefined) {\n result.delete(key);\n }\n else {\n result.set(key, value);\n }\n }\n return result;\n };\n // TODO: Make this strongly-typed (no `any`).\n const deepMerge = (...sources) => {\n let returnValue = {};\n let headers = {};\n for (const source of sources) {\n if (Array.isArray(source)) {\n if (!Array.isArray(returnValue)) {\n returnValue = [];\n }\n returnValue = [...returnValue, ...source];\n }\n else if (isObject(source)) {\n for (let [key, value] of Object.entries(source)) {\n if (isObject(value) && key in returnValue) {\n value = deepMerge(returnValue[key], value);\n }\n returnValue = { ...returnValue, [key]: value };\n }\n if (isObject(source.headers)) {\n headers = mergeHeaders(headers, source.headers);\n returnValue.headers = headers;\n }\n }\n }\n return returnValue;\n };\n\n const supportsAbortController = typeof globalThis.AbortController === 'function';\n const supportsStreams = typeof globalThis.ReadableStream === 'function';\n const supportsFormData = typeof globalThis.FormData === 'function';\n const requestMethods = ['get', 'post', 'put', 'patch', 'head', 'delete'];\n const responseTypes = {\n json: 'application/json',\n text: 'text/*',\n formData: 'multipart/form-data',\n arrayBuffer: '*/*',\n blob: '*/*',\n };\n // The maximum value of a 32bit int (see issue #117)\n const maxSafeTimeout = 2147483647;\n const stop = Symbol('stop');\n\n const normalizeRequestMethod = (input) => requestMethods.includes(input) ? input.toUpperCase() : input;\n const retryMethods = ['get', 'put', 'head', 'delete', 'options', 'trace'];\n const retryStatusCodes = [408, 413, 429, 500, 502, 503, 504];\n const retryAfterStatusCodes = [413, 429, 503];\n const defaultRetryOptions = {\n limit: 2,\n methods: retryMethods,\n statusCodes: retryStatusCodes,\n afterStatusCodes: retryAfterStatusCodes,\n maxRetryAfter: Number.POSITIVE_INFINITY,\n };\n const normalizeRetryOptions = (retry = {}) => {\n if (typeof retry === 'number') {\n return {\n ...defaultRetryOptions,\n limit: retry,\n };\n }\n if (retry.methods && !Array.isArray(retry.methods)) {\n throw new Error('retry.methods must be an array');\n }\n if (retry.statusCodes && !Array.isArray(retry.statusCodes)) {\n throw new Error('retry.statusCodes must be an array');\n }\n return {\n ...defaultRetryOptions,\n ...retry,\n afterStatusCodes: retryAfterStatusCodes,\n };\n };\n\n // `Promise.race()` workaround (#91)\n const timeout = async (request, abortController, options) => new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n if (abortController) {\n abortController.abort();\n }\n reject(new TimeoutError(request));\n }, options.timeout);\n void options\n .fetch(request)\n .then(resolve)\n .catch(reject)\n .then(() => {\n clearTimeout(timeoutId);\n });\n });\n const delay = async (ms) => new Promise(resolve => {\n setTimeout(resolve, ms);\n });\n\n class Ky {\n // eslint-disable-next-line complexity\n constructor(input, options = {}) {\n var _a, _b, _c;\n this._retryCount = 0;\n this._input = input;\n this._options = {\n // TODO: credentials can be removed when the spec change is implemented in all browsers. Context: https://www.chromestatus.com/feature/4539473312350208\n credentials: this._input.credentials || 'same-origin',\n ...options,\n headers: mergeHeaders(this._input.headers, options.headers),\n hooks: deepMerge({\n beforeRequest: [],\n beforeRetry: [],\n beforeError: [],\n afterResponse: [],\n }, options.hooks),\n method: normalizeRequestMethod((_a = options.method) !== null && _a !== void 0 ? _a : this._input.method),\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n prefixUrl: String(options.prefixUrl || ''),\n retry: normalizeRetryOptions(options.retry),\n throwHttpErrors: options.throwHttpErrors !== false,\n timeout: typeof options.timeout === 'undefined' ? 10000 : options.timeout,\n fetch: (_b = options.fetch) !== null && _b !== void 0 ? _b : globalThis.fetch.bind(globalThis),\n };\n if (typeof this._input !== 'string' && !(this._input instanceof URL || this._input instanceof globalThis.Request)) {\n throw new TypeError('`input` must be a string, URL, or Request');\n }\n if (this._options.prefixUrl && typeof this._input === 'string') {\n if (this._input.startsWith('/')) {\n throw new Error('`input` must not begin with a slash when using `prefixUrl`');\n }\n if (!this._options.prefixUrl.endsWith('/')) {\n this._options.prefixUrl += '/';\n }\n this._input = this._options.prefixUrl + this._input;\n }\n if (supportsAbortController) {\n this.abortController = new globalThis.AbortController();\n if (this._options.signal) {\n this._options.signal.addEventListener('abort', () => {\n this.abortController.abort();\n });\n }\n this._options.signal = this.abortController.signal;\n }\n this.request = new globalThis.Request(this._input, this._options);\n if (this._options.searchParams) {\n // eslint-disable-next-line unicorn/prevent-abbreviations\n const textSearchParams = typeof this._options.searchParams === 'string'\n ? this._options.searchParams.replace(/^\\?/, '')\n : new URLSearchParams(this._options.searchParams).toString();\n // eslint-disable-next-line unicorn/prevent-abbreviations\n const searchParams = '?' + textSearchParams;\n const url = this.request.url.replace(/(?:\\?.*?)?(?=#|$)/, searchParams);\n // To provide correct form boundary, Content-Type header should be deleted each time when new Request instantiated from another one\n if (((supportsFormData && this._options.body instanceof globalThis.FormData)\n || this._options.body instanceof URLSearchParams) && !(this._options.headers && this._options.headers['content-type'])) {\n this.request.headers.delete('content-type');\n }\n this.request = new globalThis.Request(new globalThis.Request(url, this.request), this._options);\n }\n if (this._options.json !== undefined) {\n this._options.body = JSON.stringify(this._options.json);\n this.request.headers.set('content-type', (_c = this._options.headers.get('content-type')) !== null && _c !== void 0 ? _c : 'application/json');\n this.request = new globalThis.Request(this.request, { body: this._options.body });\n }\n }\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n static create(input, options) {\n const ky = new Ky(input, options);\n const fn = async () => {\n if (ky._options.timeout > maxSafeTimeout) {\n throw new RangeError(`The \\`timeout\\` option cannot be greater than ${maxSafeTimeout}`);\n }\n // Delay the fetch so that body method shortcuts can set the Accept header\n await Promise.resolve();\n let response = await ky._fetch();\n for (const hook of ky._options.hooks.afterResponse) {\n // eslint-disable-next-line no-await-in-loop\n const modifiedResponse = await hook(ky.request, ky._options, ky._decorateResponse(response.clone()));\n if (modifiedResponse instanceof globalThis.Response) {\n response = modifiedResponse;\n }\n }\n ky._decorateResponse(response);\n if (!response.ok && ky._options.throwHttpErrors) {\n let error = new HTTPError(response, ky.request, ky._options);\n for (const hook of ky._options.hooks.beforeError) {\n // eslint-disable-next-line no-await-in-loop\n error = await hook(error);\n }\n throw error;\n }\n // If `onDownloadProgress` is passed, it uses the stream API internally\n /* istanbul ignore next */\n if (ky._options.onDownloadProgress) {\n if (typeof ky._options.onDownloadProgress !== 'function') {\n throw new TypeError('The `onDownloadProgress` option must be a function');\n }\n if (!supportsStreams) {\n throw new Error('Streams are not supported in your environment. `ReadableStream` is missing.');\n }\n return ky._stream(response.clone(), ky._options.onDownloadProgress);\n }\n return response;\n };\n const isRetriableMethod = ky._options.retry.methods.includes(ky.request.method.toLowerCase());\n const result = (isRetriableMethod ? ky._retry(fn) : fn());\n for (const [type, mimeType] of Object.entries(responseTypes)) {\n result[type] = async () => {\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n ky.request.headers.set('accept', ky.request.headers.get('accept') || mimeType);\n const awaitedResult = await result;\n const response = awaitedResult.clone();\n if (type === 'json') {\n if (response.status === 204) {\n return '';\n }\n if (options.parseJson) {\n return options.parseJson(await response.text());\n }\n }\n return response[type]();\n };\n }\n return result;\n }\n _calculateRetryDelay(error) {\n this._retryCount++;\n if (this._retryCount < this._options.retry.limit && !(error instanceof TimeoutError)) {\n if (error instanceof HTTPError) {\n if (!this._options.retry.statusCodes.includes(error.response.status)) {\n return 0;\n }\n const retryAfter = error.response.headers.get('Retry-After');\n if (retryAfter && this._options.retry.afterStatusCodes.includes(error.response.status)) {\n let after = Number(retryAfter);\n if (Number.isNaN(after)) {\n after = Date.parse(retryAfter) - Date.now();\n }\n else {\n after *= 1000;\n }\n if (typeof this._options.retry.maxRetryAfter !== 'undefined' && after > this._options.retry.maxRetryAfter) {\n return 0;\n }\n return after;\n }\n if (error.response.status === 413) {\n return 0;\n }\n }\n const BACKOFF_FACTOR = 0.3;\n return BACKOFF_FACTOR * (2 ** (this._retryCount - 1)) * 1000;\n }\n return 0;\n }\n _decorateResponse(response) {\n if (this._options.parseJson) {\n response.json = async () => this._options.parseJson(await response.text());\n }\n return response;\n }\n async _retry(fn) {\n try {\n return await fn();\n // eslint-disable-next-line @typescript-eslint/no-implicit-any-catch\n }\n catch (error) {\n const ms = Math.min(this._calculateRetryDelay(error), maxSafeTimeout);\n if (ms !== 0 && this._retryCount > 0) {\n await delay(ms);\n for (const hook of this._options.hooks.beforeRetry) {\n // eslint-disable-next-line no-await-in-loop\n const hookResult = await hook({\n request: this.request,\n options: this._options,\n error: error,\n retryCount: this._retryCount,\n });\n // If `stop` is returned from the hook, the retry process is stopped\n if (hookResult === stop) {\n return;\n }\n }\n return this._retry(fn);\n }\n throw error;\n }\n }\n async _fetch() {\n for (const hook of this._options.hooks.beforeRequest) {\n // eslint-disable-next-line no-await-in-loop\n const result = await hook(this.request, this._options);\n if (result instanceof Request) {\n this.request = result;\n break;\n }\n if (result instanceof Response) {\n return result;\n }\n }\n if (this._options.timeout === false) {\n return this._options.fetch(this.request.clone());\n }\n return timeout(this.request.clone(), this.abortController, this._options);\n }\n /* istanbul ignore next */\n _stream(response, onDownloadProgress) {\n const totalBytes = Number(response.headers.get('content-length')) || 0;\n let transferredBytes = 0;\n return new globalThis.Response(new globalThis.ReadableStream({\n async start(controller) {\n const reader = response.body.getReader();\n if (onDownloadProgress) {\n onDownloadProgress({ percent: 0, transferredBytes: 0, totalBytes }, new Uint8Array());\n }\n async function read() {\n const { done, value } = await reader.read();\n if (done) {\n controller.close();\n return;\n }\n if (onDownloadProgress) {\n transferredBytes += value.byteLength;\n const percent = totalBytes === 0 ? 0 : transferredBytes / totalBytes;\n onDownloadProgress({ percent, transferredBytes, totalBytes }, value);\n }\n controller.enqueue(value);\n await read();\n }\n await read();\n },\n }));\n }\n }\n\n /*! MIT License © Sindre Sorhus */\n const createInstance = (defaults) => {\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n const ky = (input, options) => Ky.create(input, validateAndMerge(defaults, options));\n for (const method of requestMethods) {\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n ky[method] = (input, options) => Ky.create(input, validateAndMerge(defaults, options, { method }));\n }\n ky.create = (newDefaults) => createInstance(validateAndMerge(newDefaults));\n ky.extend = (newDefaults) => createInstance(validateAndMerge(defaults, newDefaults));\n ky.stop = stop;\n return ky;\n };\n const ky = createInstance();\n\n exports.HTTPError = HTTPError;\n exports.TimeoutError = TimeoutError;\n exports[\"default\"] = ky;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","'use strict'\n\nconst urlHttp = require('url-http/lightweight')\nconst { flattie: flatten } = require('flattie')\nconst { encode: stringify } = require('qss')\n\nconst factory = require('./factory')\nconst { default: ky } = require('./ky')\n\nclass MicrolinkError extends Error {\n constructor (props) {\n super()\n this.name = 'MicrolinkError'\n Object.assign(this, props)\n this.description = this.message\n this.message = this.code\n ? `${this.code}, ${this.description}`\n : this.description\n }\n}\n\nconst got = async (url, opts) => {\n try {\n if (opts.timeout === undefined) opts.timeout = false\n const response = await ky(url, opts)\n const body = await response.json()\n const { headers, status: statusCode } = response\n return { url: response.url, body, headers, statusCode }\n } catch (err) {\n if (err.response) {\n const { response } = err\n err.response = {\n ...response,\n headers: Array.from(response.headers.entries()).reduce(\n (acc, [key, value]) => {\n acc[key] = value\n return acc\n },\n {}\n ),\n statusCode: response.status,\n body: await response.text()\n }\n }\n throw err\n }\n}\n\nmodule.exports = factory({\n MicrolinkError,\n urlHttp,\n stringify,\n got,\n flatten,\n VERSION: '__MQL_VERSION__'\n})\n"],"names":["URL","globalThis","REGEX_HTTP_PROTOCOL","iter","output","nullish","sep","val","key","k","pfx","Array","isArray","length","toValue","mix","str","decodeURIComponent","dist","flattie","input","glue","toNull","obj","i","tmp","encodeURIComponent","out","arr","split","shift","concat","ENDPOINT","FREE","PRO","isObject","factory_1","VERSION","MicrolinkError","urlHttp","stringify","got","flatten","mapRules","rules","flatRules","Object","keys","reduce","acc","toString","fetchFromApi","async","apiUrl","opts","retryCount","response","responseType","body","err","statusCode","rawBody","headers","url","uri","isBodyBuffer","constructor","isBuffer","error","JSON","parse","_","message","status","data","more","code","parseBody","getApiUrl","apiKey","endpoint","retry","cache","gotHeaders","gotOpts","isPro","createMql","defaultOpts","assertUrl","fetchOpts","mql","version","stream","buffer","exports","HTTPError","Error","request","options","statusText","trim","super","this","name","TimeoutError","value","validateAndMerge","sources","source","TypeError","deepMerge","mergeHeaders","source1","source2","result","Headers","isHeadersInstance","entries","undefined","delete","set","returnValue","supportsAbortController","AbortController","supportsStreams","ReadableStream","supportsFormData","FormData","requestMethods","responseTypes","json","text","formData","arrayBuffer","blob","maxSafeTimeout","stop","Symbol","normalizeRequestMethod","includes","toUpperCase","retryAfterStatusCodes","defaultRetryOptions","limit","methods","statusCodes","afterStatusCodes","maxRetryAfter","Number","POSITIVE_INFINITY","normalizeRetryOptions","timeout","abortController","Promise","resolve","reject","timeoutId","setTimeout","abort","fetch","then","catch","clearTimeout","delay","ms","Ky","_a","_b","_c","_retryCount","_input","_options","credentials","hooks","beforeRequest","beforeRetry","beforeError","afterResponse","method","prefixUrl","String","throwHttpErrors","bind","Request","startsWith","endsWith","signal","addEventListener","searchParams","replace","URLSearchParams","get","static","ky","fn","RangeError","_fetch","hook","modifiedResponse","_decorateResponse","clone","Response","ok","onDownloadProgress","_stream","toLowerCase","_retry","type","mimeType","parseJson","_calculateRetryDelay","retryAfter","after","isNaN","Date","now","Math","min","totalBytes","transferredBytes","controller","reader","getReader","read","done","close","byteLength","percent","enqueue","Uint8Array","createInstance","defaults","create","newDefaults","extend","defineProperty","factory","href","test","require$$1","encode","require$$2","require$$3","default","require$$4","props","assign","description","from"],"mappings":"stBAEA,MAA4DA,EAAAC,WAAAD,IAEtDE,EAAsB,yBCJ5B,SAASC,EAAKC,EAAQC,EAASC,EAAKC,EAAKC,GACxC,IAAIC,EAAGC,EAAMF,EAAOA,EAAMF,EAAOE,EAEjC,GAAW,MAAPD,EACCF,IAASD,EAAOI,GAAOD,QACrB,GAAkB,iBAAPA,EACjBH,EAAOI,GAAOD,OACR,GAAII,MAAMC,QAAQL,GACxB,IAAKE,EAAE,EAAGA,EAAIF,EAAIM,OAAQJ,IACzBN,EAAKC,EAAQC,EAASC,EAAKC,EAAIE,GAAIC,EAAMD,QAG1C,IAAKA,KAAKF,EACTJ,EAAKC,EAAQC,EAASC,EAAKC,EAAIE,GAAIC,EAAMD,EAG5C,CCIA,SAASK,EAAQC,GAChB,IAAKA,EAAK,MAAO,GACjB,IAAIC,EAAMC,mBAAmBF,GAC7B,MAAY,UAARC,IACQ,SAARA,IACW,GAANA,GAAY,GAAOA,EAAOA,GACpC,CDAAE,EAAAC,QARA,SAAiBC,EAAO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amL,GACXhJ,QACAC,KAAKC,KAAO,iBACZzD,OAAOwM,OAAOhJ,KAAM+I,GACpB/I,KAAKiJ,YAAcjJ,KAAK9B,QACxB8B,KAAK9B,QAAU8B,KAAK1B,KAChB,GAAG0B,KAAK1B,SAAS0B,KAAKiJ,cACtBjJ,KAAKiJ,WACV,SA8BcX,EAAQ,CACvBtM,iBACAC,UACAC,YACAC,IA/BUW,MAAOW,EAAKT,KACtB,SACuBgE,IAAjBhE,EAAKiG,UAAuBjG,EAAKiG,SAAU,GAC/C,MAAM/F,QAAiByI,EAAGlI,EAAKT,GACzBI,QAAaF,EAAS0E,QACtBpE,QAAEA,EAASW,OAAQb,GAAeJ,EACxC,MAAO,CAAEO,IAAKP,EAASO,IAAKL,OAAMI,UAASF,aAkB5C,CAjBC,MAAOD,GACP,GAAIA,EAAIH,SAAU,CAChB,MAAMA,SAAEA,GAAaG,EACrBA,EAAIH,SAAW,IACVA,EACHM,QAASnD,MAAM6O,KAAKhM,EAASM,QAAQuD,WAAWrE,QAC9C,CAACC,GAAMzC,EAAKiG,MACVxD,EAAIzC,GAAOiG,EACJxD,IAET,CAAE,GAEJW,WAAYJ,EAASiB,OACrBf,WAAYF,EAAS2E,OAExB,CACD,MAAMxE,CACP,GAQDjB,UACAL,QAAS"}
|
package/dist/mql.min.mjs
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function t(t){var e=t.default;if("function"==typeof e){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var s=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,s.get?s:{enumerable:!0,get:function(){return t[e]}})})),r}const e=globalThis.URL,r=/^https?:\/\//i;var s={};function o(t,e,r,s,n){var i,a=n?n+r:n;if(null==s)e&&(t[n]=s);else if("object"!=typeof s)t[n]=s;else if(Array.isArray(s))for(i=0;i<s.length;i++)o(t,e,r,s[i],a+i);else for(i in s)o(t,e,r,s[i],a+i)}function n(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||(0*+e==0?+e:e))}s.flattie=function(t,e,r){var s={};return"object"==typeof t&&o(s,!!r,e||".",t,""),s};var i=t(Object.freeze({__proto__:null,encode:function(t,e){var r,s,o,n="";for(r in t)if(void 0!==(o=t[r]))if(Array.isArray(o))for(s=0;s<o.length;s++)n&&(n+="&"),n+=encodeURIComponent(r)+"="+encodeURIComponent(o[s]);else n&&(n+="&"),n+=encodeURIComponent(r)+"="+encodeURIComponent(o);return(e||"")+n},decode:function(t){for(var e,r,s={},o=t.split("&");e=o.shift();)void 0!==s[r=(e=e.split("=")).shift()]?s[r]=[].concat(s[r],n(e.shift())):s[r]=n(e.shift());return s}}));const a={FREE:"https://api.microlink.io",PRO:"https://pro.microlink.io"},u=t=>null!==t&&"object"==typeof t;var h=({VERSION:t,MicrolinkError:e,urlHttp:r,stringify:s,got:o,flatten:n})=>{const i=t=>{if(!u(t))return;const e=n(t);return Object.keys(e).reduce(((t,r)=>(t[`data.${r}`]=e[r].toString(),t)),{})},h=async(t,r={},s=0)=>{try{const e=await o(t,r);return"buffer"===r.responseType?{body:e.body,response:e}:{...e.body,response:e}}catch(o){const{response:i={}}=o,{statusCode:a,body:c,headers:p={},url:l=t}=i,f=null!=(n=c)&&null!=n.constructor&&"function"==typeof n.constructor.isBuffer&&n.constructor.isBuffer(n),d=u(c)&&!f?c:((t,e,r)=>{try{return JSON.parse(t)}catch(s){const o=t||e.message;return{status:"error",data:{url:o},more:"https://microlink.io/efatalclient",code:"EFATALCLIENT",message:o,url:r}}})(f?c.toString():c,o,l);if("EFATALCLIENT"===d.code&&s++<2)return h(t,r,s);throw new e({...d,message:d.message,url:l,statusCode:a,headers:p})}var n},c=(t,{data:e,apiKey:r,endpoint:o,retry:u,cache:h,...c}={},{responseType:p="json",headers:l,...f}={})=>{const d=!!r;return[`${o||a[d?"PRO":"FREE"]}?${s({url:t,...i(e),...n(c)})}`,{...f,responseType:p,cache:h,retry:u,headers:d?{...l,"x-api-key":r}:{...l}}]},p=t=>async(s,o,n)=>{((t="")=>{if(!r(t)){const r=`The \`url\` as \`${t}\` is not valid. Ensure it has protocol (http or https) and hostname.`;throw new e({status:"fail",data:{url:r},more:"https://microlink.io/docs/api/api-parameters/url",code:"EINVALURLCLIENT",message:r,url:t})}})(s);const[i,a]=c(s,o,{...t,...n});return h(i,a)},l=p();return l.MicrolinkError=e,l.getApiUrl=c,l.fetchFromApi=h,l.mapRules=i,l.version=t,l.stream=o.stream,l.buffer=p({responseType:"buffer"}),l},c={exports:{}};!function(t){class e extends Error{constructor(t,e,r){const s=`${t.status||0===t.status?t.status:""} ${t.statusText||""}`.trim();super("Request failed with "+(s?`status code ${s}`:"an unknown error")),this.name="HTTPError",this.response=t,this.request=e,this.options=r}}class r extends Error{constructor(t){super("Request timed out"),this.name="TimeoutError",this.request=t}}const s=t=>null!==t&&"object"==typeof t,o=(...t)=>{for(const e of t)if((!s(e)||Array.isArray(e))&&void 0!==e)throw new TypeError("The `options` argument must be an object");return i({},...t)},n=(t={},e={})=>{const r=new globalThis.Headers(t),s=e instanceof globalThis.Headers,o=new globalThis.Headers(e);for(const[t,e]of o.entries())s&&"undefined"===e||void 0===e?r.delete(t):r.set(t,e);return r},i=(...t)=>{let e={},r={};for(const o of t)if(Array.isArray(o))Array.isArray(e)||(e=[]),e=[...e,...o];else if(s(o)){for(let[t,r]of Object.entries(o))s(r)&&t in e&&(r=i(e[t],r)),e={...e,[t]:r};s(o.headers)&&(r=n(r,o.headers),e.headers=r)}return e},a="function"==typeof globalThis.AbortController,u="function"==typeof globalThis.ReadableStream,h="function"==typeof globalThis.FormData,c=["get","post","put","patch","head","delete"],p={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},l=2147483647,f=Symbol("stop"),d=t=>c.includes(t)?t.toUpperCase():t,y=[413,429,503],m={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:y,maxRetryAfter:Number.POSITIVE_INFINITY},b=(t={})=>{if("number"==typeof t)return{...m,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...m,...t,afterStatusCodes:y}},_=async(t,e,s)=>new Promise(((o,n)=>{const i=setTimeout((()=>{e&&e.abort(),n(new r(t))}),s.timeout);s.fetch(t).then(o).catch(n).then((()=>{clearTimeout(i)}))})),w=async t=>new Promise((e=>{setTimeout(e,t)}));class g{constructor(t,e={}){var r,s,o;if(this._retryCount=0,this._input=t,this._options={credentials:this._input.credentials||"same-origin",...e,headers:n(this._input.headers,e.headers),hooks:i({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},e.hooks),method:d(null!==(r=e.method)&&void 0!==r?r:this._input.method),prefixUrl:String(e.prefixUrl||""),retry:b(e.retry),throwHttpErrors:!1!==e.throwHttpErrors,timeout:void 0===e.timeout?1e4:e.timeout,fetch:null!==(s=e.fetch)&&void 0!==s?s:globalThis.fetch.bind(globalThis)},"string"!=typeof this._input&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&"string"==typeof this._input){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(a&&(this.abortController=new globalThis.AbortController,this._options.signal&&this._options.signal.addEventListener("abort",(()=>{this.abortController.abort()})),this._options.signal=this.abortController.signal),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){const t="?"+("string"==typeof this._options.searchParams?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),e=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,t);!(h&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)||this._options.headers&&this._options.headers["content-type"]||this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(e,this.request),this._options)}void 0!==this._options.json&&(this._options.body=JSON.stringify(this._options.json),this.request.headers.set("content-type",null!==(o=this._options.headers.get("content-type"))&&void 0!==o?o:"application/json"),this.request=new globalThis.Request(this.request,{body:this._options.body}))}static create(t,r){const s=new g(t,r),o=async()=>{if(s._options.timeout>l)throw new RangeError(`The \`timeout\` option cannot be greater than ${l}`);await Promise.resolve();let t=await s._fetch();for(const e of s._options.hooks.afterResponse){const r=await e(s.request,s._options,s._decorateResponse(t.clone()));r instanceof globalThis.Response&&(t=r)}if(s._decorateResponse(t),!t.ok&&s._options.throwHttpErrors){let r=new e(t,s.request,s._options);for(const t of s._options.hooks.beforeError)r=await t(r);throw r}if(s._options.onDownloadProgress){if("function"!=typeof s._options.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!u)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return s._stream(t.clone(),s._options.onDownloadProgress)}return t},n=s._options.retry.methods.includes(s.request.method.toLowerCase())?s._retry(o):o();for(const[t,e]of Object.entries(p))n[t]=async()=>{s.request.headers.set("accept",s.request.headers.get("accept")||e);const o=(await n).clone();if("json"===t){if(204===o.status)return"";if(r.parseJson)return r.parseJson(await o.text())}return o[t]()};return n}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount<this._options.retry.limit&&!(t instanceof r)){if(t instanceof e){if(!this._options.retry.statusCodes.includes(t.response.status))return 0;const e=t.response.headers.get("Retry-After");if(e&&this._options.retry.afterStatusCodes.includes(t.response.status)){let t=Number(e);return Number.isNaN(t)?t=Date.parse(e)-Date.now():t*=1e3,void 0!==this._options.retry.maxRetryAfter&&t>this._options.retry.maxRetryAfter?0:t}if(413===t.response.status)return 0}return.3*2**(this._retryCount-1)*1e3}return 0}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(e){const r=Math.min(this._calculateRetryDelay(e),l);if(0!==r&&this._retryCount>0){await w(r);for(const t of this._options.hooks.beforeRetry)if(await t({request:this.request,options:this._options,error:e,retryCount:this._retryCount})===f)return;return this._retry(t)}throw e}}async _fetch(){for(const t of this._options.hooks.beforeRequest){const e=await t(this.request,this._options);if(e instanceof Request){this.request=e;break}if(e instanceof Response)return e}return!1===this._options.timeout?this._options.fetch(this.request.clone()):_(this.request.clone(),this.abortController,this._options)}_stream(t,e){const r=Number(t.headers.get("content-length"))||0;let s=0;return new globalThis.Response(new globalThis.ReadableStream({async start(o){const n=t.body.getReader();async function i(){const{done:t,value:a}=await n.read();t?o.close():(e&&(s+=a.byteLength,e({percent:0===r?0:s/r,transferredBytes:s,totalBytes:r},a)),o.enqueue(a),await i())}e&&e({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array),await i()}}))}}
|
|
2
|
+
/*! MIT License © Sindre Sorhus */const R=t=>{const e=(e,r)=>g.create(e,o(t,r));for(const r of c)e[r]=(e,s)=>g.create(e,o(t,s,{method:r}));return e.create=t=>R(o(t)),e.extend=e=>R(o(t,e)),e.stop=f,e},T=R();t.HTTPError=e,t.TimeoutError=r,t.default=T,Object.defineProperty(t,"__esModule",{value:!0})}(c.exports);const p=t=>{try{const{href:s}=new e(t);return r.test(s)&&s}catch(t){return!1}},{flattie:l}=s,{encode:f}=i,d=h,{default:y}=c.exports;class m extends Error{constructor(t){super(),this.name="MicrolinkError",Object.assign(this,t),this.description=this.message,this.message=this.code?`${this.code}, ${this.description}`:this.description}}var b=d({MicrolinkError:m,urlHttp:p,stringify:f,got:async(t,e)=>{try{void 0===e.timeout&&(e.timeout=!1);const r=await y(t,e),s=await r.json(),{headers:o,status:n}=r;return{url:r.url,body:s,headers:o,statusCode:n}}catch(t){if(t.response){const{response:e}=t;t.response={...e,headers:Array.from(e.headers.entries()).reduce(((t,[e,r])=>(t[e]=r,t)),{}),statusCode:e.status,body:await e.text()}}throw t}},flatten:l,VERSION:"0.10.30"});export{b as default};
|
|
3
|
+
//# sourceMappingURL=mql.min.mjs.map
|