diff --git a/.github/actions/check-public-api/index.js b/.github/actions/check-public-api/index.js index 34181c53d5..894575dfba 100644 --- a/.github/actions/check-public-api/index.js +++ b/.github/actions/check-public-api/index.js @@ -18058,10 +18058,21 @@ var Writable = (__nccwpck_require__(2203).Writable); var assert = __nccwpck_require__(42613); var debug = __nccwpck_require__(8886); +// Preventive platform detection +// istanbul ignore next +(function detectUnsupportedEnvironment() { + var looksLikeNode = typeof process !== "undefined"; + var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined"; + var looksLikeV8 = isFunction(Error.captureStackTrace); + if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) { + console.warn("The follow-redirects package should be excluded from browser builds."); + } +}()); + // Whether to use the native URL object or the legacy url module var useNativeURL = false; try { - assert(new URL()); + assert(new URL("")); } catch (error) { useNativeURL = error.code === "ERR_INVALID_URL"; @@ -18398,17 +18409,17 @@ RedirectableRequest.prototype._performRequest = function () { var buffers = this._requestBodyBuffers; (function writeNext(error) { // Only write if this request has not been redirected yet - /* istanbul ignore else */ + // istanbul ignore else if (request === self._currentRequest) { // Report any write errors - /* istanbul ignore if */ + // istanbul ignore if if (error) { self.emit("error", error); } // Write the next buffer if there are still left else if (i < buffers.length) { var buffer = buffers[i++]; - /* istanbul ignore else */ + // istanbul ignore else if (!request.finished) { request.write(buffer.data, buffer.encoding, writeNext); } @@ -18604,7 +18615,7 @@ function noop() { /* empty */ } function parseUrl(input) { var parsed; - /* istanbul ignore else */ + // istanbul ignore else if (useNativeURL) { parsed = new URL(input); } @@ -18619,7 +18630,7 @@ function parseUrl(input) { } function resolveUrl(relative, base) { - /* istanbul ignore next */ + // istanbul ignore next return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative)); } @@ -18668,7 +18679,10 @@ function removeMatchingHeaders(regex, headers) { function createErrorType(code, message, baseClass) { // Create constructor function CustomError(properties) { - Error.captureStackTrace(this, this.constructor); + // istanbul ignore else + if (isFunction(Error.captureStackTrace)) { + Error.captureStackTrace(this, this.constructor); + } Object.assign(this, properties || {}); this.code = code; this.message = this.cause ? message + ": " + this.cause.message : message; @@ -86025,7 +86039,7 @@ exports.Minipass = Minipass; /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -// Axios v1.7.7 Copyright (c) 2024 Matt Zabriskie and contributors +// Axios v1.7.8 Copyright (c) 2024 Matt Zabriskie and contributors const FormData$1 = __nccwpck_require__(12226); @@ -86043,6 +86057,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau const FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData$1); const url__default = /*#__PURE__*/_interopDefaultLegacy(url); +const proxyFromEnv__default = /*#__PURE__*/_interopDefaultLegacy(proxyFromEnv); const http__default = /*#__PURE__*/_interopDefaultLegacy(http); const https__default = /*#__PURE__*/_interopDefaultLegacy(https); const util__default = /*#__PURE__*/_interopDefaultLegacy(util); @@ -87198,7 +87213,7 @@ function encode(val) { * * @param {string} url The base of the url (e.g., http://www.google.com) * @param {object} [params] The params to be appended - * @param {?object} options + * @param {?(object|Function)} options * * @returns {string} The formatted url */ @@ -87210,6 +87225,12 @@ function buildURL(url, params, options) { const _encode = options && options.encode || encode; + if (utils$1.isFunction(options)) { + options = { + serialize: options + }; + } + const serializeFn = options && options.serialize; let serializedParams; @@ -88098,7 +88119,7 @@ function buildFullPath(baseURL, requestedURL) { return requestedURL; } -const VERSION = "1.7.7"; +const VERSION = "1.7.8"; function parseProtocol(url) { const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); @@ -88310,7 +88331,7 @@ const readBlob$1 = readBlob; const BOUNDARY_ALPHABET = utils$1.ALPHABET.ALPHA_DIGIT + '-_'; -const textEncoder = new util.TextEncoder(); +const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util__default["default"].TextEncoder(); const CRLF = '\r\n'; const CRLF_BYTES = textEncoder.encode(CRLF); @@ -88648,7 +88669,7 @@ function dispatchBeforeRedirect(options, responseDetails) { function setProxy(options, configProxy, location) { let proxy = configProxy; if (!proxy && proxy !== false) { - const proxyUrl = proxyFromEnv.getProxyForUrl(location); + const proxyUrl = proxyFromEnv__default["default"].getProxyForUrl(location); if (proxyUrl) { proxy = new URL(proxyUrl); } @@ -88879,7 +88900,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { } catch (e) { } } - } else if (utils$1.isBlob(data)) { + } else if (utils$1.isBlob(data) || utils$1.isFile(data)) { data.size && headers.setContentType(data.type || 'application/octet-stream'); headers.setContentLength(data.size || 0); data = stream__default["default"].Readable.from(readBlob$1(data)); @@ -89132,7 +89153,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { } const err = new AxiosError( - 'maxContentLength size of ' + config.maxContentLength + ' exceeded', + 'stream has been aborted', AxiosError.ERR_BAD_RESPONSE, config, lastRequest @@ -89255,68 +89276,18 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { }); }; -const isURLSameOrigin = platform.hasStandardBrowserEnv ? - -// Standard browser envs have full support of the APIs needed to test -// whether the request URL is of the same origin as current location. - (function standardBrowserEnv() { - const msie = platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent); - const urlParsingNode = document.createElement('a'); - let originURL; - - /** - * Parse a URL to discover its components - * - * @param {String} url The URL to be parsed - * @returns {Object} - */ - function resolveURL(url) { - let href = url; - - if (msie) { - // IE needs attribute set twice to normalize properties - urlParsingNode.setAttribute('href', href); - href = urlParsingNode.href; - } - - urlParsingNode.setAttribute('href', href); - - // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils - return { - href: urlParsingNode.href, - protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', - host: urlParsingNode.host, - search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', - hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', - hostname: urlParsingNode.hostname, - port: urlParsingNode.port, - pathname: (urlParsingNode.pathname.charAt(0) === '/') ? - urlParsingNode.pathname : - '/' + urlParsingNode.pathname - }; - } - - originURL = resolveURL(window.location.href); - - /** - * Determine if a URL shares the same origin as the current location - * - * @param {String} requestURL The URL to test - * @returns {boolean} True if URL shares the same origin, otherwise false - */ - return function isURLSameOrigin(requestURL) { - const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL; - return (parsed.protocol === originURL.protocol && - parsed.host === originURL.host); - }; - })() : +const isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => { + url = new URL(url, platform.origin); - // Non standard browser envs (web workers, react-native) lack needed support. - (function nonStandardBrowserEnv() { - return function isURLSameOrigin() { - return true; - }; - })(); + return ( + origin.protocol === url.protocol && + origin.host === url.host && + (isMSIE || origin.port === url.port) + ); +})( + new URL(platform.origin), + platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent) +) : () => true; const cookies = platform.hasStandardBrowserEnv ? @@ -89373,7 +89344,7 @@ function mergeConfig(config1, config2) { config2 = config2 || {}; const config = {}; - function getMergedValue(target, source, caseless) { + function getMergedValue(target, source, prop, caseless) { if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { return utils$1.merge.call({caseless}, target, source); } else if (utils$1.isPlainObject(source)) { @@ -89385,11 +89356,11 @@ function mergeConfig(config1, config2) { } // eslint-disable-next-line consistent-return - function mergeDeepProperties(a, b, caseless) { + function mergeDeepProperties(a, b, prop , caseless) { if (!utils$1.isUndefined(b)) { - return getMergedValue(a, b, caseless); + return getMergedValue(a, b, prop , caseless); } else if (!utils$1.isUndefined(a)) { - return getMergedValue(undefined, a, caseless); + return getMergedValue(undefined, a, prop , caseless); } } @@ -89447,7 +89418,7 @@ function mergeConfig(config1, config2) { socketPath: defaultToConfig2, responseEncoding: defaultToConfig2, validateStatus: mergeDirectKeys, - headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) + headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true) }; utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { @@ -90240,6 +90211,14 @@ validators$1.transitional = function transitional(validator, version, message) { }; }; +validators$1.spelling = function spelling(correctSpelling) { + return (value, opt) => { + // eslint-disable-next-line no-console + console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); + return true; + } +}; + /** * Assert object's properties type * @@ -90309,9 +90288,9 @@ class Axios { return await this._request(configOrUrl, config); } catch (err) { if (err instanceof Error) { - let dummy; + let dummy = {}; - Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error()); + Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error()); // slice off the Error: ... line const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : ''; @@ -90366,6 +90345,11 @@ class Axios { } } + validator.assertOptions(config, { + baseUrl: validators.spelling('baseURL'), + withXsrfToken: validators.spelling('withXSRFToken') + }, true); + // Set config.method config.method = (config.method || this.defaults.method || 'get').toLowerCase(); diff --git a/package.json b/package.json index 8878de044a..02a7da53ac 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "@types/node": "^18.19.66", "@types/uuid": "^10.0.0", "@types/voca": "^1.4.6", - "axios": "^1.7.7", + "axios": "^1.7.8", "cross-env": "7.0.3", "depcheck": "^1.4.7", "eslint": "^8.57.1", diff --git a/packages/connectivity/package.json b/packages/connectivity/package.json index e90847e712..ee8f200b78 100644 --- a/packages/connectivity/package.json +++ b/packages/connectivity/package.json @@ -41,7 +41,7 @@ "@sap/xsenv": "^5.4.0", "@sap/xssec": "^4.2.7", "async-retry": "^1.3.3", - "axios": "^1.7.7", + "axios": "^1.7.8", "jsonwebtoken": "^9.0.2" }, "devDependencies": { diff --git a/packages/http-client/package.json b/packages/http-client/package.json index 4ef1e21632..818bfbd0f3 100644 --- a/packages/http-client/package.json +++ b/packages/http-client/package.json @@ -39,7 +39,7 @@ "@sap-cloud-sdk/connectivity": "^3.23.0", "@sap-cloud-sdk/resilience": "^3.23.0", "@sap-cloud-sdk/util": "^3.23.0", - "axios": "^1.7.7" + "axios": "^1.7.8" }, "devDependencies": { "https-proxy-agent": "^7.0.5", diff --git a/packages/openapi/package.json b/packages/openapi/package.json index c5eb9f7ae3..69a2a1c3ef 100644 --- a/packages/openapi/package.json +++ b/packages/openapi/package.json @@ -40,7 +40,7 @@ "@sap-cloud-sdk/http-client": "^3.23.0", "@sap-cloud-sdk/resilience": "^3.23.0", "@sap-cloud-sdk/util": "^3.23.0", - "axios": "^1.7.7" + "axios": "^1.7.8" }, "devDependencies": { "nock": "^14.0.0-beta.18", diff --git a/packages/resilience/package.json b/packages/resilience/package.json index 6b3fb5f3fa..efb56d4fbc 100644 --- a/packages/resilience/package.json +++ b/packages/resilience/package.json @@ -39,7 +39,7 @@ "dependencies": { "@sap-cloud-sdk/util": "^3.23.0", "async-retry": "^1.3.3", - "axios": "^1.7.7", + "axios": "^1.7.8", "opossum": "^8.3.1" }, "devDependencies": { diff --git a/packages/util/package.json b/packages/util/package.json index 48e6392ad3..d4de5439e9 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -34,7 +34,7 @@ "readme": "ts-node ../../scripts/replace-common-readme.ts" }, "dependencies": { - "axios": "^1.7.7", + "axios": "^1.7.8", "chalk": "^4.1.0", "logform": "^2.7.0", "voca": "^1.4.1", diff --git a/test-packages/e2e-tests/package.json b/test-packages/e2e-tests/package.json index d7c3a7394c..8a6dabda0a 100644 --- a/test-packages/e2e-tests/package.json +++ b/test-packages/e2e-tests/package.json @@ -36,7 +36,7 @@ "@sap-cloud-sdk/util": "^3.23.0", "@sap/cds": "^8.5.0", "@sap/cds-dk": "8.5.0", - "axios": "^1.7.7", + "axios": "^1.7.8", "execa": "^5.0.0", "express": "^4.21.1", "fs-extra": "^11.2.0", diff --git a/test-packages/integration-tests/package.json b/test-packages/integration-tests/package.json index 0f9740ef0f..1fba1ba224 100644 --- a/test-packages/integration-tests/package.json +++ b/test-packages/integration-tests/package.json @@ -23,7 +23,7 @@ "@sap-cloud-sdk/test-util": "^3.23.0", "@sap-cloud-sdk/util": "^3.23.0", "@sap/xssec": "^4.2.7", - "axios": "^1.7.7" + "axios": "^1.7.8" }, "devDependencies": { "@sap-cloud-sdk/generator": "^3.23.0", diff --git a/yarn.lock b/yarn.lock index 7a326f1e13..55d4c21407 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2626,10 +2626,10 @@ aws4@^1.8.0: resolved "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== -axios@^1, axios@^1.7.7: - version "1.7.7" - resolved "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz#2f554296f9892a72ac8d8e4c5b79c14a91d0a47f" - integrity sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q== +axios@^1, axios@^1.7.8: + version "1.7.8" + resolved "https://registry.npmjs.org/axios/-/axios-1.7.8.tgz#1997b1496b394c21953e68c14aaa51b7b5de3d6e" + integrity sha512-Uu0wb7KNqK2t5K+YQyVCLM76prD5sRFjKHbJYCP1J7JFGEQ6nN7HWn9+04LAeiJ3ji54lgS/gZCH1oxyrf1SPw== dependencies: follow-redirects "^1.15.6" form-data "^4.0.0" @@ -4742,12 +4742,7 @@ fn.name@1.x.x: resolved "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc" integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== -follow-redirects@^1.0.0, follow-redirects@^1.15.6: - version "1.15.6" - resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" - integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== - -follow-redirects@^1.14.0: +follow-redirects@^1.0.0, follow-redirects@^1.14.0, follow-redirects@^1.15.6: version "1.15.9" resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==