Skip to content

Commit

Permalink
[create-pull-request] automated change (#61)
Browse files Browse the repository at this point in the history
Co-authored-by: IEvangelist <IEvangelist@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and IEvangelist authored Jan 5, 2024
1 parent 5a68365 commit 4d1f4bf
Showing 1 changed file with 93 additions and 51 deletions.
144 changes: 93 additions & 51 deletions dist/resource-translator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23870,7 +23870,7 @@ module.exports = require("zlib");
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {

"use strict";
// Axios v1.4.0 Copyright (c) 2023 Matt Zabriskie and contributors
// Axios v1.6.0 Copyright (c) 2023 Matt Zabriskie and contributors


const FormData$1 = __nccwpck_require__(4334);
Expand Down Expand Up @@ -24440,8 +24440,9 @@ const reduceDescriptors = (obj, reducer) => {
const reducedDescriptors = {};

forEach(descriptors, (descriptor, name) => {
if (reducer(descriptor, name, obj) !== false) {
reducedDescriptors[name] = descriptor;
let ret;
if ((ret = reducer(descriptor, name, obj)) !== false) {
reducedDescriptors[name] = ret || descriptor;
}
});

Expand Down Expand Up @@ -25225,10 +25226,6 @@ function formDataToJSON(formData) {
return null;
}

const DEFAULT_CONTENT_TYPE = {
'Content-Type': undefined
};

/**
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
* of the input
Expand Down Expand Up @@ -25367,19 +25364,16 @@ const defaults = {

headers: {
common: {
'Accept': 'application/json, text/plain, */*'
'Accept': 'application/json, text/plain, */*',
'Content-Type': undefined
}
}
};

utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
defaults.headers[method] = {};
});

utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
});

const defaults$1 = defaults;

// RawAxiosHeaders whose duplicates are ignored by node
Expand Down Expand Up @@ -25713,7 +25707,17 @@ class AxiosHeaders {

AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);

utils.freezeMethods(AxiosHeaders.prototype);
// reserved names hotfix
utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
return {
get: () => value,
set(headerValue) {
this[mapped] = headerValue;
}
}
});

utils.freezeMethods(AxiosHeaders);

const AxiosHeaders$1 = AxiosHeaders;
Expand Down Expand Up @@ -25833,7 +25837,7 @@ function buildFullPath(baseURL, requestedURL) {
return requestedURL;
}

const VERSION = "1.4.0";
const VERSION = "1.6.0";

function parseProtocol(url) {
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
Expand Down Expand Up @@ -26437,6 +26441,18 @@ const wrapAsync = (asyncExecutor) => {
})
};

const resolveFamily = ({address, family}) => {
if (!utils.isString(address)) {
throw TypeError('address must be a string');
}
return ({
address,
family: family || (address.indexOf('.') < 0 ? 6 : 4)
});
};

const buildAddressEntry = (address, family) => resolveFamily(utils.isObject(address) ? address : {address, family});

/*eslint consistent-return:0*/
const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
Expand All @@ -26447,15 +26463,16 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
let rejected = false;
let req;

if (lookup && utils.isAsyncFn(lookup)) {
lookup = callbackify$1(lookup, (entry) => {
if(utils.isString(entry)) {
entry = [entry, entry.indexOf('.') < 0 ? 6 : 4];
} else if (!utils.isArray(entry)) {
throw new TypeError('lookup async function must return an array [ip: string, family: number]]')
}
return entry;
});
if (lookup) {
const _lookup = callbackify$1(lookup, (value) => utils.isArray(value) ? value : [value]);
// hotfix to support opt.all option which is required for node 20.x
lookup = (hostname, opt, cb) => {
_lookup(hostname, opt, (err, arg0, arg1) => {
const addresses = utils.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];

opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
});
};
}

// temporary internal emitter until the AxiosRequest class will be implemented
Expand Down Expand Up @@ -26682,11 +26699,13 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
auth,
protocol,
family,
lookup,
beforeRedirect: dispatchBeforeRedirect,
beforeRedirects: {}
};

// cacheable-lookup integration hotfix
!utils.isUndefined(lookup) && (options.lookup = lookup);

if (config.socketPath) {
options.socketPath = config.socketPath;
} else {
Expand Down Expand Up @@ -26760,7 +26779,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
delete res.headers['content-encoding'];
}

switch (res.headers['content-encoding']) {
switch ((res.headers['content-encoding'] || '').toLowerCase()) {
/*eslint default-case:0*/
case 'gzip':
case 'x-gzip':
Expand Down Expand Up @@ -26856,7 +26875,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
}
response.data = responseData;
} catch (err) {
reject(AxiosError.from(err, null, config, response.request, response));
return reject(AxiosError.from(err, null, config, response.request, response));
}
settle(resolve, reject, response);
});
Expand Down Expand Up @@ -26893,7 +26912,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
// This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
const timeout = parseInt(config.timeout, 10);

if (isNaN(timeout)) {
if (Number.isNaN(timeout)) {
reject(new AxiosError(
'error trying to parse `config.timeout` to int',
AxiosError.ERR_BAD_OPTION_VALUE,
Expand Down Expand Up @@ -27112,11 +27131,16 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
}
}

let contentType;

if (utils.isFormData(requestData)) {
if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
requestHeaders.setContentType(false); // Let the browser set it
} else {
requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks
} else if(!requestHeaders.getContentType(/^\s*multipart\/form-data/)){
requestHeaders.setContentType('multipart/form-data'); // mobile/desktop app frameworks
} else if(utils.isString(contentType = requestHeaders.getContentType())){
// fix semicolon duplication issue for ReactNative FormData implementation
requestHeaders.setContentType(contentType.replace(/^\s*(multipart\/form-data);+/, '$1'));
}
}

Expand Down Expand Up @@ -27234,8 +27258,8 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
// Specifically not if we're in a web worker, or react-native.
if (platform.isStandardBrowserEnv) {
// Add xsrf header
const xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath))
&& config.xsrfCookieName && cookies.read(config.xsrfCookieName);
// regarding CVE-2023-45857 config.withCredentials condition was removed temporarily
const xsrfValue = isURLSameOrigin(fullPath) && config.xsrfCookieName && cookies.read(config.xsrfCookieName);

if (xsrfValue) {
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
Expand Down Expand Up @@ -27309,7 +27333,7 @@ const knownAdapters = {
};

utils.forEach(knownAdapters, (fn, value) => {
if(fn) {
if (fn) {
try {
Object.defineProperty(fn, 'name', {value});
} catch (e) {
Expand All @@ -27319,6 +27343,10 @@ utils.forEach(knownAdapters, (fn, value) => {
}
});

const renderReason = (reason) => `- ${reason}`;

const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;

const adapters = {
getAdapter: (adapters) => {
adapters = utils.isArray(adapters) ? adapters : [adapters];
Expand All @@ -27327,30 +27355,44 @@ const adapters = {
let nameOrAdapter;
let adapter;

const rejectedReasons = {};

for (let i = 0; i < length; i++) {
nameOrAdapter = adapters[i];
if((adapter = utils.isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter)) {
let id;

adapter = nameOrAdapter;

if (!isResolvedHandle(nameOrAdapter)) {
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];

if (adapter === undefined) {
throw new AxiosError(`Unknown adapter '${id}'`);
}
}

if (adapter) {
break;
}

rejectedReasons[id || '#' + i] = adapter;
}

if (!adapter) {
if (adapter === false) {
throw new AxiosError(
`Adapter ${nameOrAdapter} is not supported by the environment`,
'ERR_NOT_SUPPORT'

const reasons = Object.entries(rejectedReasons)
.map(([id, state]) => `adapter ${id} ` +
(state === false ? 'is not supported by the environment' : 'is not available in the build')
);
}

throw new Error(
utils.hasOwnProp(knownAdapters, nameOrAdapter) ?
`Adapter '${nameOrAdapter}' is not available in the build` :
`Unknown adapter '${nameOrAdapter}'`
);
}
let s = length ?
(reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
'as no adapter specified';

if (!utils.isFunction(adapter)) {
throw new TypeError('adapter is not a function');
throw new AxiosError(
`There is no suitable adapter to dispatch the request ` + s,
'ERR_NOT_SUPPORT'
);
}

return adapter;
Expand Down Expand Up @@ -27683,15 +27725,13 @@ class Axios {
// Set config.method
config.method = (config.method || this.defaults.method || 'get').toLowerCase();

let contextHeaders;

// Flatten headers
contextHeaders = headers && utils.merge(
let contextHeaders = headers && utils.merge(
headers.common,
headers[config.method]
);

contextHeaders && utils.forEach(
headers && utils.forEach(
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
(method) => {
delete headers[method];
Expand Down Expand Up @@ -28101,6 +28141,8 @@ axios.AxiosHeaders = AxiosHeaders$1;

axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);

axios.getAdapter = adapters.getAdapter;

axios.HttpStatusCode = HttpStatusCode$1;

axios.default = axios;
Expand Down

0 comments on commit 4d1f4bf

Please sign in to comment.