| 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/cjs/ |
Upload File : |
{"version":3,"sources":["../../es/index.mjs"],"names":["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","axiosRetry","requestInterceptorId","interceptors","request","use","lastRequestTime","Date","now","responseInterceptorId","Promise","reject","timeout","lastRequestDuration","transformRequest","data","resolve","setTimeout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAEO,IAAMA,SAAS,GAAG,aAAlB;AAEP;AACA;AACA;AACA;;;;AACO,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;AAC3C,+BAAeJ,KAAf,CAJF,CAIwB;AAJxB;AAMD;;AAED,IAAMM,iBAAiB,GAAG,CAA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port 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"}