| Server IP : 185.208.173.17 / Your IP : 87.236.161.98 Web Server : Microsoft-IIS/10.0 System : Windows NT SRV8576125506 10.0 build 26100 (Windows Server 2016) AMD64 User : IUSR ( 0) PHP Version : 7.4.13 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/parsmega.nuxt/node_modules/axios-retry/lib/esm/ |
Upload File : |
{"version":3,"sources":["../../es/index.mjs"],"names":["isRetryAllowed","namespace","isNetworkError","error","CODE_EXCLUDE_LIST","response","Boolean","code","includes","SAFE_HTTP_METHODS","IDEMPOTENT_HTTP_METHODS","concat","isRetryableError","status","isSafeRequestError","config","indexOf","method","isIdempotentRequestError","isNetworkOrIdempotentRequestError","noDelay","exponentialDelay","retryNumber","delayFactor","delay","Math","pow","randomSum","random","DEFAULT_OPTIONS","retries","retryCondition","retryDelay","shouldResetTimeout","onRetry","getRequestOptions","defaultOptions","getCurrentState","currentState","retryCount","fixConfig","axios","defaults","agent","httpAgent","httpsAgent","shouldRetry","shouldRetryOrPromise","shouldRetryPromiseResult","_err","axiosRetry","requestInterceptorId","interceptors","request","use","lastRequestTime","Date","now","responseInterceptorId","Promise","reject","timeout","lastRequestDuration","transformRequest","data","resolve","setTimeout"],"mappings":";;;;;;;;;;AAAA,OAAOA,cAAP,MAA2B,kBAA3B;AAEA,OAAO,IAAMC,SAAS,GAAG,aAAlB;AAEP;AACA;AACA;AACA;;AACA,OAAO,SAASC,cAAT,CAAwBC,KAAxB,EAA+B;AACpC,MAAMC,iBAAiB,GAAG,CAAC,cAAD,EAAiB,cAAjB,CAA1B;AAEA,SACE,CAACD,KAAK,CAACE,QAAP,IACAC,OAAO,CAACH,KAAK,CAACI,IAAP,CADP,IACuB;AACvB,GAACH,iBAAiB,CAACI,QAAlB,CAA2BL,KAAK,CAACI,IAAjC,CAFD,IAE2C;AAC3CP,EAAAA,cAAc,CAACG,KAAD,CAJhB,CAIwB;AAJ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AA,MAAM,CAAC8C,OAAP,GAAiBA,OAAjB;AACD;;AAED9C,QAAAA,MAAM,CAACgD,gBAAP,GAA0B,CAAEC,IAAD,IAAUA,IAAX,CAA1B;AAEA,cAAM9B,OAAO,CAACI,YAAY,CAACC,UAAd,EAA0BpC,KAA1B,EAAiCY,MAAjC,CAAb;AAEA,eAAO,IAAI4C,OAAJ,CAAaM,OAAD,IAAaC,UAAU,CAAC,MAAMD,OAAO,CAACxB,KAAK,CAAC1B,MAAD,CAAN,CAAd,EAA+BS,KAA/B,CAAnC,CAAP;AACD;;AAED,aAAOmC,OAAO,CAACC,MAAR,CAAezD,KAAf,CAAP;AACD,KApC6B;;AAAA;AAAA;AAAA;AAAA,MAA9B;AAsCA,SAAO;AAAEgD,IAAAA,oBAAF;AAAwBO,IAAAA;AAAxB,GAAP;AACD,C,CAED;;AACAR,UAAU,CAAChD,cAAX,GAA4BA,cAA5B;AACAgD,UAAU,CAACpC,kBAAX,GAAgCA,kBAAhC;AACAoC,UAAU,CAAChC,wBAAX,GAAsCA,wBAAtC;AACAgC,UAAU,CAAC/B,iCAAX,GAA+CA,iCAA/C;AACA+B,UAAU,CAAC7B,gBAAX,GAA8BA,gBAA9B;AACA6B,UAAU,CAACtC,gBAAX,GAA8BA,gBAA9B","sourcesContent":["import isRetryAllowed from 'is-retry-allowed';\n\nexport const namespace = 'axios-retry';\n\n/**\n * @param {Error} error\n * @return {boolean}\n */\nexport function isNetworkError(error) {\n const CODE_EXCLUDE_LIST = ['ERR_CANCELED', 'ECONNABORTED'];\n\n return (\n !error.response &&\n Boolean(error.code) && // Prevents retrying cancelled requests\n !CODE_EXCLUDE_LIST.includes(error.code) && // Prevents retrying timed out & cancelled requests\n isRetryAllowed(error) // Prevents retrying unsafe errors\n );\n}\n\nconst SAFE_HTTP_METHODS = ['get', 'head', 'options'];\nconst IDEMPOTENT_HTTP_METHODS = SAFE_HTTP_METHODS.concat(['put', 'delete']);\n\n/**\n * @param {Error} error\n * @return {boolean}\n */\nexport function isRetryableError(error) {\n return (\n error.code !== 'ECONNABORTED' &&\n (!error.response || (error.response.status >= 500 && error.response.status <= 599))\n );\n}\n\n/**\n * @param {Error} error\n * @return {boolean}\n */\nexport function isSafeRequestError(error) {\n if (!error.config) {\n // Cannot determine if the request can be retried\n return false;\n }\n\n return isRetryableError(error) && SAFE_HTTP_METHODS.indexOf(error.config.method) !== -1;\n}\n\n/**\n * @param {Error} error\n * @return {boolean}\n */\nexport function isIdempotentRequestError(error) {\n if (!error.config) {\n // Cannot determine if the request can be retried\n return false;\n }\n\n return isRetryableError(error) && IDEMPOTENT_HTTP_METHODS.indexOf(error.config.method) !== -1;\n}\n\n/**\n * @param {Error} error\n * @return {boolean}\n */\nexport function isNetworkOrIdempotentRequestError(error) {\n return isNetworkError(error) || isIdempotentRequestError(error);\n}\n\n/**\n * @return {number} - delay in milliseconds, always 0\n */\nfunction noDelay() {\n return 0;\n}\n\n/**\n * Set delayFactor 1000 for an exponential delay to occur on the order\n * of seconds\n * @param {number} [retryNumber=0]\n * @param {Error} error - unused; for existing API of retryDelay callback\n * @param {number} [delayFactor=100] milliseconds\n * @return {number} - delay in milliseconds\n */\nexport function exponentialDelay(retryNumber = 0, error, delayFactor = 100) {\n const delay = Math.pow(2, retryNumber) * delayFactor;\n const randomSum = delay * 0.2 * Math.random(); // 0-20% of the delay\n return delay + randomSum;\n}\n\n/** @type {IAxiosRetryConfig} */\nexport const DEFAULT_OPTIONS = {\n retries: 3,\n retryCondition: isNetworkOrIdempotentRequestError,\n retryDelay: noDelay,\n shouldResetTimeout: false,\n onRetry: () => {}\n};\n\n/**\n * Returns the axios-retry options for the current request\n * @param {AxiosRequestConfig} config\n * @param {IAxiosRetryConfig} defaultOptions\n * @return {IAxiosRetryConfigExtended}\n */\nfunction getRequestOptions(config, defaultOptions) {\n return { ...DEFAULT_OPTIONS, ...defaultOptions, ...config[namespace] };\n}\n\n/**\n * Initializes and returns the retry state for the given request/config\n * @param {AxiosRequestConfig} config\n * @param {IAxiosRetryConfig} defaultOptions\n * @return {IAxiosRetryConfigExtended}\n */\nfunction getCurrentState(config, defaultOptions) {\n const currentState = getRequestOptions(config, defaultOptions);\n currentState.retryCount = currentState.retryCount || 0;\n config[namespace] = currentState;\n return currentState;\n}\n\n/**\n * @param {Axios} axios\n * @param {AxiosRequestConfig} config\n */\nfunction fixConfig(axios, config) {\n if (axios.defaults.agent === config.agent) {\n delete config.agent;\n }\n if (axios.defaults.httpAgent === config.httpAgent) {\n delete config.httpAgent;\n }\n if (axios.defaults.httpsAgent === config.httpsAgent) {\n delete config.httpsAgent;\n }\n}\n\n/**\n * Checks retryCondition if request can be retried. Handles it's returning value or Promise.\n * @param {IAxiosRetryConfigExtended} currentState\n * @param {Error} error\n * @return {Promise<boolean>}\n */\nasync function shouldRetry(currentState, error) {\n const { retries, retryCondition } = currentState;\n const shouldRetryOrPromise = currentState.retryCount < retries && retryCondition(error);\n\n // This could be a promise\n if (typeof shouldRetryOrPromise === 'object') {\n try {\n const shouldRetryPromiseResult = await shouldRetryOrPromise;\n // keep return true unless shouldRetryPromiseResult return false for compatibility\n return shouldRetryPromiseResult !== false;\n } catch (_err) {\n return false;\n }\n }\n return shouldRetryOrPromise;\n}\n\n/**\n * Adds response interceptors to an axios instance to retry requests failed due to network issues\n *\n * @example\n *\n * import axios from 'axios';\n *\n * axiosRetry(axios, { retries: 3 });\n *\n * axios.get('http://example.com/test') // The first request fails and the second returns 'ok'\n * .then(result => {\n * result.data; // 'ok'\n * });\n *\n * // Exponential back-off retry delay between requests\n * axiosRetry(axios, { retryDelay : axiosRetry.exponentialDelay});\n *\n * // Custom retry delay\n * axiosRetry(axios, { retryDelay : (retryCount) => {\n * return retryCount * 1000;\n * }});\n *\n * // Also works with custom axios instances\n * const client = axios.create({ baseURL: 'http://example.com' });\n * axiosRetry(client, { retries: 3 });\n *\n * client.get('/test') // The first request fails and the second returns 'ok'\n * .then(result => {\n * result.data; // 'ok'\n * });\n *\n * // Allows request-specific configuration\n * client\n * .get('/test', {\n * 'axios-retry': {\n * retries: 0\n * }\n * })\n * .catch(error => { // The first request fails\n * error !== undefined\n * });\n *\n * @param {Axios} axios An axios instance (the axios object or one created from axios.create)\n * @param {Object} [defaultOptions]\n * @param {number} [defaultOptions.retries=3] Number of retries\n * @param {boolean} [defaultOptions.shouldResetTimeout=false]\n * Defines if the timeout should be reset between retries\n * @param {Function} [defaultOptions.retryCondition=isNetworkOrIdempotentRequestError]\n * A function to determine if the error can be retried\n * @param {Function} [defaultOptions.retryDelay=noDelay]\n * A function to determine the delay between retry requests\n * @param {Function} [defaultOptions.onRetry=()=>{}]\n * A function to get notified when a retry occurs\n * @return {{ requestInterceptorId: number, responseInterceptorId: number }}\n * The ids of the interceptors added to the request and to the response (so they can be ejected at a later time)\n */\nexport default function axiosRetry(axios, defaultOptions) {\n const requestInterceptorId = axios.interceptors.request.use((config) => {\n const currentState = getCurrentState(config, defaultOptions);\n currentState.lastRequestTime = Date.now();\n return config;\n });\n\n const responseInterceptorId = axios.interceptors.response.use(null, async (error) => {\n const { config } = error;\n\n // If we have no information to retry the request\n if (!config) {\n return Promise.reject(error);\n }\n\n const currentState = getCurrentState(config, defaultOptions);\n\n if (await shouldRetry(currentState, error)) {\n currentState.retryCount += 1;\n const { retryDelay, shouldResetTimeout, onRetry } = currentState;\n const delay = retryDelay(currentState.retryCount, error);\n\n // Axios fails merging this configuration to the default configuration because it has an issue\n // with circular structures: https://github.com/mzabriskie/axios/issues/370\n fixConfig(axios, config);\n\n if (!shouldResetTimeout && config.timeout && currentState.lastRequestTime) {\n const lastRequestDuration = Date.now() - currentState.lastRequestTime;\n const timeout = config.timeout - lastRequestDuration - delay;\n if (timeout <= 0) {\n return Promise.reject(error);\n }\n config.timeout = timeout;\n }\n\n config.transformRequest = [(data) => data];\n\n await onRetry(currentState.retryCount, error, config);\n\n return new Promise((resolve) => setTimeout(() => resolve(axios(config)), delay));\n }\n\n return Promise.reject(error);\n });\n\n return { requestInterceptorId, responseInterceptorId };\n}\n\n// Compatibility with CommonJS\naxiosRetry.isNetworkError = isNetworkError;\naxiosRetry.isSafeRequestError = isSafeRequestError;\naxiosRetry.isIdempotentRequestError = isIdempotentRequestError;\naxiosRetry.isNetworkOrIdempotentRequestError = isNetworkOrIdempotentRequestError;\naxiosRetry.exponentialDelay = exponentialDelay;\naxiosRetry.isRetryableError = isRetryableError;\n"],"file":"index.js"}