diff --git a/notify-discord/dist/index.js b/notify-discord/dist/index.js index d512583..a65ba59 100644 --- a/notify-discord/dist/index.js +++ b/notify-discord/dist/index.js @@ -2922,6 +2922,7 @@ function useColors() { // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + // eslint-disable-next-line no-return-assign return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // Is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || @@ -3237,24 +3238,62 @@ function setup(env) { createDebug.names = []; createDebug.skips = []; - let i; - const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - const len = split.length; + const split = (typeof namespaces === 'string' ? namespaces : '') + .trim() + .replace(' ', ',') + .split(',') + .filter(Boolean); - for (i = 0; i < len; i++) { - if (!split[i]) { - // ignore empty strings - continue; + for (const ns of split) { + if (ns[0] === '-') { + createDebug.skips.push(ns.slice(1)); + } else { + createDebug.names.push(ns); } + } + } - namespaces = split[i].replace(/\*/g, '.*?'); - - if (namespaces[0] === '-') { - createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); + /** + * Checks if the given string matches a namespace template, honoring + * asterisks as wildcards. + * + * @param {String} search + * @param {String} template + * @return {Boolean} + */ + function matchesTemplate(search, template) { + let searchIndex = 0; + let templateIndex = 0; + let starIndex = -1; + let matchIndex = 0; + + while (searchIndex < search.length) { + if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) { + // Match character or proceed with wildcard + if (template[templateIndex] === '*') { + starIndex = templateIndex; + matchIndex = searchIndex; + templateIndex++; // Skip the '*' + } else { + searchIndex++; + templateIndex++; + } + } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition + // Backtrack to the last '*' and try to match more characters + templateIndex = starIndex + 1; + matchIndex++; + searchIndex = matchIndex; } else { - createDebug.names.push(new RegExp('^' + namespaces + '$')); + return false; // No match } } + + // Handle trailing '*' in template + while (templateIndex < template.length && template[templateIndex] === '*') { + templateIndex++; + } + + return templateIndex === template.length; } /** @@ -3265,8 +3304,8 @@ function setup(env) { */ function disable() { const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) + ...createDebug.names, + ...createDebug.skips.map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; @@ -3280,21 +3319,14 @@ function setup(env) { * @api public */ function enabled(name) { - if (name[name.length - 1] === '*') { - return true; - } - - let i; - let len; - - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { + for (const skip of createDebug.skips) { + if (matchesTemplate(name, skip)) { return false; } } - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { + for (const ns of createDebug.names) { + if (matchesTemplate(name, ns)) { return true; } } @@ -3302,19 +3334,6 @@ function setup(env) { return false; } - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - function toNamespace(regexp) { - return regexp.toString() - .substring(2, regexp.toString().length - 2) - .replace(/\.\*\?$/, '*'); - } - /** * Coerce `val`. * @@ -30951,7 +30970,7 @@ module.exports = parseParams /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -// Axios v1.7.7 Copyright (c) 2024 Matt Zabriskie and contributors +// Axios v1.7.9 Copyright (c) 2024 Matt Zabriskie and contributors const FormData$1 = __nccwpck_require__(2220); @@ -30969,6 +30988,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); @@ -32124,7 +32144,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 */ @@ -32136,6 +32156,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; @@ -33024,7 +33050,7 @@ function buildFullPath(baseURL, requestedURL) { return requestedURL; } -const VERSION = "1.7.7"; +const VERSION = "1.7.9"; function parseProtocol(url) { const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); @@ -33236,7 +33262,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); @@ -33574,7 +33600,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); } @@ -33805,7 +33831,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)); @@ -34058,7 +34084,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 @@ -34181,68 +34207,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 ? @@ -34299,7 +34275,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)) { @@ -34311,11 +34287,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); } } @@ -34373,7 +34349,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) { @@ -35166,6 +35142,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 * @@ -35235,9 +35219,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/, '') : ''; @@ -35292,6 +35276,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/release/dist/index.js b/release/dist/index.js index 6a05001..df03403 100644 --- a/release/dist/index.js +++ b/release/dist/index.js @@ -5658,6 +5658,7 @@ function useColors() { // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + // eslint-disable-next-line no-return-assign return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // Is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || @@ -5973,24 +5974,62 @@ function setup(env) { createDebug.names = []; createDebug.skips = []; - let i; - const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - const len = split.length; + const split = (typeof namespaces === 'string' ? namespaces : '') + .trim() + .replace(' ', ',') + .split(',') + .filter(Boolean); - for (i = 0; i < len; i++) { - if (!split[i]) { - // ignore empty strings - continue; + for (const ns of split) { + if (ns[0] === '-') { + createDebug.skips.push(ns.slice(1)); + } else { + createDebug.names.push(ns); } + } + } - namespaces = split[i].replace(/\*/g, '.*?'); - - if (namespaces[0] === '-') { - createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); + /** + * Checks if the given string matches a namespace template, honoring + * asterisks as wildcards. + * + * @param {String} search + * @param {String} template + * @return {Boolean} + */ + function matchesTemplate(search, template) { + let searchIndex = 0; + let templateIndex = 0; + let starIndex = -1; + let matchIndex = 0; + + while (searchIndex < search.length) { + if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) { + // Match character or proceed with wildcard + if (template[templateIndex] === '*') { + starIndex = templateIndex; + matchIndex = searchIndex; + templateIndex++; // Skip the '*' + } else { + searchIndex++; + templateIndex++; + } + } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition + // Backtrack to the last '*' and try to match more characters + templateIndex = starIndex + 1; + matchIndex++; + searchIndex = matchIndex; } else { - createDebug.names.push(new RegExp('^' + namespaces + '$')); + return false; // No match } } + + // Handle trailing '*' in template + while (templateIndex < template.length && template[templateIndex] === '*') { + templateIndex++; + } + + return templateIndex === template.length; } /** @@ -6001,8 +6040,8 @@ function setup(env) { */ function disable() { const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) + ...createDebug.names, + ...createDebug.skips.map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; @@ -6016,21 +6055,14 @@ function setup(env) { * @api public */ function enabled(name) { - if (name[name.length - 1] === '*') { - return true; - } - - let i; - let len; - - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { + for (const skip of createDebug.skips) { + if (matchesTemplate(name, skip)) { return false; } } - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { + for (const ns of createDebug.names) { + if (matchesTemplate(name, ns)) { return true; } } @@ -6038,19 +6070,6 @@ function setup(env) { return false; } - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - function toNamespace(regexp) { - return regexp.toString() - .substring(2, regexp.toString().length - 2) - .replace(/\.\*\?$/, '*'); - } - /** * Coerce `val`. * @@ -52597,7 +52616,7 @@ exports.LRUCache = LRUCache; /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -// Axios v1.7.7 Copyright (c) 2024 Matt Zabriskie and contributors +// Axios v1.7.9 Copyright (c) 2024 Matt Zabriskie and contributors const FormData$1 = __nccwpck_require__(2220); @@ -52615,6 +52634,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); @@ -53770,7 +53790,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 */ @@ -53782,6 +53802,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; @@ -54670,7 +54696,7 @@ function buildFullPath(baseURL, requestedURL) { return requestedURL; } -const VERSION = "1.7.7"; +const VERSION = "1.7.9"; function parseProtocol(url) { const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); @@ -54882,7 +54908,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); @@ -55220,7 +55246,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); } @@ -55451,7 +55477,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)); @@ -55704,7 +55730,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 @@ -55827,68 +55853,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); +const isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => { + url = new URL(url, platform.origin); - /** - * 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); - }; - })() : - - // 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 ? @@ -55945,7 +55921,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)) { @@ -55957,11 +55933,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); } } @@ -56019,7 +55995,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) { @@ -56812,6 +56788,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 * @@ -56881,9 +56865,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/, '') : ''; @@ -56938,6 +56922,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/upload-multi-artifact/dist/index.js b/upload-multi-artifact/dist/index.js index 10652eb..45ea685 100644 --- a/upload-multi-artifact/dist/index.js +++ b/upload-multi-artifact/dist/index.js @@ -10187,8 +10187,8 @@ class BaseRequestPolicy { // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -const SDK_VERSION = "12.25.0"; -const SERVICE_VERSION = "2024-11-04"; +const SDK_VERSION = "12.26.0"; +const SERVICE_VERSION = "2025-01-05"; const BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB const BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB const BLOCK_BLOB_MAX_BLOCKS = 50000; @@ -20850,7 +20850,7 @@ const timeoutInSeconds = { const version = { parameterPath: "version", mapper: { - defaultValue: "2024-11-04", + defaultValue: "2025-01-05", isConstant: true, serializedName: "x-ms-version", type: { @@ -23848,7 +23848,12 @@ const setImmutabilityPolicyOperationSpec = { headersMapper: BlobSetImmutabilityPolicyExceptionHeaders, }, }, - queryParameters: [timeoutInSeconds, comp12], + queryParameters: [ + timeoutInSeconds, + snapshot, + versionId, + comp12, + ], urlParameters: [url], headerParameters: [ version, @@ -23873,7 +23878,12 @@ const deleteImmutabilityPolicyOperationSpec = { headersMapper: BlobDeleteImmutabilityPolicyExceptionHeaders, }, }, - queryParameters: [timeoutInSeconds, comp12], + queryParameters: [ + timeoutInSeconds, + snapshot, + versionId, + comp12, + ], urlParameters: [url], headerParameters: [ version, @@ -23895,7 +23905,12 @@ const setLegalHoldOperationSpec = { headersMapper: BlobSetLegalHoldExceptionHeaders, }, }, - queryParameters: [timeoutInSeconds, comp13], + queryParameters: [ + timeoutInSeconds, + snapshot, + versionId, + comp13, + ], urlParameters: [url], headerParameters: [ version, @@ -25467,7 +25482,7 @@ let StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.Exte const defaults = { requestContentType: "application/json; charset=utf-8", }; - const packageDetails = `azsdk-js-azure-storage-blob/12.25.0`; + const packageDetails = `azsdk-js-azure-storage-blob/12.26.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; @@ -25478,7 +25493,7 @@ let StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.Exte // Parameter assignments this.url = url; // Assigning values to Constant parameters - this.version = options.version || "2024-11-04"; + this.version = options.version || "2025-01-05"; this.service = new ServiceImpl(this); this.container = new ContainerImpl(this); this.blob = new BlobImpl(this); @@ -27769,7 +27784,7 @@ class AvroType { return AvroType.fromStringSchema(type); } catch (_a) { - // eslint-disable-line no-empty + // no-op } switch (type) { case AvroComplex.RECORD: @@ -27896,7 +27911,6 @@ class AvroRecordType extends AvroType { function arraysEqual(a, b) { if (a === b) return true; - // eslint-disable-next-line eqeqeq if (a == null || b == null) return false; if (a.length !== b.length) @@ -30424,6 +30438,38 @@ class BlobClient extends StorageClient { } return generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).stringToSign; } + /** + * + * Generates a Blob Service Shared Access Signature (SAS) URI based on + * the client properties and parameters passed in. The SAS is signed by the input user delegation key. + * + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * + * @param options - Optional parameters. + * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()` + * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. + */ + generateUserDelegationSasUrl(options, userDelegationKey) { + return new Promise((resolve) => { + const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), userDelegationKey, this.accountName).toString(); + resolve(appendToURLQuery(this.url, sas)); + }); + } + /** + * Only available for BlobClient constructed with a shared key credential. + * + * Generates string to sign for a Blob Service Shared Access Signature (SAS) URI based on + * the client properties and parameters passed in. The SAS is signed by the input user delegation key. + * + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * + * @param options - Optional parameters. + * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()` + * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. + */ + generateUserDelegationSasStringToSign(options, userDelegationKey) { + return generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), userDelegationKey, this.accountName).stringToSign; + } /** * Delete the immutablility policy on the blob. * @@ -33788,6 +33834,35 @@ class ContainerClient extends StorageClient { } return generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName }, options), this.credential).stringToSign; } + /** + * Generates a Blob Container Service Shared Access Signature (SAS) URI based on the client properties + * and parameters passed in. The SAS is signed by the input user delegation key. + * + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * + * @param options - Optional parameters. + * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()` + * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. + */ + generateUserDelegationSasUrl(options, userDelegationKey) { + return new Promise((resolve) => { + const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName }, options), userDelegationKey, this.accountName).toString(); + resolve(appendToURLQuery(this.url, sas)); + }); + } + /** + * Generates string to sign for a Blob Container Service Shared Access Signature (SAS) URI + * based on the client properties and parameters passed in. The SAS is signed by the input user delegation key. + * + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * + * @param options - Optional parameters. + * @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()` + * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token. + */ + generateUserDelegationSasStringToSign(options, userDelegationKey) { + return generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName }, options), userDelegationKey, this.accountName).stringToSign; + } /** * Creates a BlobBatchClient object to conduct batch operations. * @@ -43915,8 +43990,13 @@ class Agent extends http.Agent { .then((socket) => { this.decrementSockets(name, fakeSocket); if (socket instanceof http.Agent) { - // @ts-expect-error `addRequest()` isn't defined in `@types/node` - return socket.addRequest(req, connectOpts); + try { + // @ts-expect-error `addRequest()` isn't defined in `@types/node` + return socket.addRequest(req, connectOpts); + } + catch (err) { + return cb(err); + } } this[INTERNAL].currentSocket = socket; // @ts-expect-error `createSocket()` isn't defined in `@types/node` @@ -56888,6 +56968,7 @@ function useColors() { // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + // eslint-disable-next-line no-return-assign return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // Is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || @@ -57203,24 +57284,62 @@ function setup(env) { createDebug.names = []; createDebug.skips = []; - let i; - const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - const len = split.length; + const split = (typeof namespaces === 'string' ? namespaces : '') + .trim() + .replace(' ', ',') + .split(',') + .filter(Boolean); - for (i = 0; i < len; i++) { - if (!split[i]) { - // ignore empty strings - continue; + for (const ns of split) { + if (ns[0] === '-') { + createDebug.skips.push(ns.slice(1)); + } else { + createDebug.names.push(ns); } + } + } - namespaces = split[i].replace(/\*/g, '.*?'); - - if (namespaces[0] === '-') { - createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); + /** + * Checks if the given string matches a namespace template, honoring + * asterisks as wildcards. + * + * @param {String} search + * @param {String} template + * @return {Boolean} + */ + function matchesTemplate(search, template) { + let searchIndex = 0; + let templateIndex = 0; + let starIndex = -1; + let matchIndex = 0; + + while (searchIndex < search.length) { + if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) { + // Match character or proceed with wildcard + if (template[templateIndex] === '*') { + starIndex = templateIndex; + matchIndex = searchIndex; + templateIndex++; // Skip the '*' + } else { + searchIndex++; + templateIndex++; + } + } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition + // Backtrack to the last '*' and try to match more characters + templateIndex = starIndex + 1; + matchIndex++; + searchIndex = matchIndex; } else { - createDebug.names.push(new RegExp('^' + namespaces + '$')); + return false; // No match } } + + // Handle trailing '*' in template + while (templateIndex < template.length && template[templateIndex] === '*') { + templateIndex++; + } + + return templateIndex === template.length; } /** @@ -57231,8 +57350,8 @@ function setup(env) { */ function disable() { const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) + ...createDebug.names, + ...createDebug.skips.map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; @@ -57246,21 +57365,14 @@ function setup(env) { * @api public */ function enabled(name) { - if (name[name.length - 1] === '*') { - return true; - } - - let i; - let len; - - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { + for (const skip of createDebug.skips) { + if (matchesTemplate(name, skip)) { return false; } } - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { + for (const ns of createDebug.names) { + if (matchesTemplate(name, ns)) { return true; } } @@ -57268,19 +57380,6 @@ function setup(env) { return false; } - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - function toNamespace(regexp) { - return regexp.toString() - .substring(2, regexp.toString().length - 2) - .replace(/\.\*\?$/, '*'); - } - /** * Coerce `val`. * @@ -60216,6 +60315,7 @@ function readDocType(xmlData, i){ if (xmlData[i] === '<' && !comment) { //Determine the tag type if( hasBody && isEntity(xmlData, i)){ i += 7; + let entityName, val; [entityName, val,i] = readEntityExp(xmlData,i+1); if(val.indexOf("&") === -1) //Parameter entities are not supported entities[ validateEntityName(entityName) ] = { @@ -62405,6 +62505,17 @@ const agent_base_1 = __nccwpck_require__(29462); const url_1 = __nccwpck_require__(57310); const parse_proxy_response_1 = __nccwpck_require__(55401); const debug = (0, debug_1.default)('https-proxy-agent'); +const setServernameFromNonIpHost = (options) => { + if (options.servername === undefined && + options.host && + !net.isIP(options.host)) { + return { + ...options, + servername: options.host, + }; + } + return options; +}; /** * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests. @@ -62452,11 +62563,7 @@ class HttpsProxyAgent extends agent_base_1.Agent { let socket; if (proxy.protocol === 'https:') { debug('Creating `tls.Socket`: %o', this.connectOpts); - const servername = this.connectOpts.servername || this.connectOpts.host; - socket = tls.connect({ - ...this.connectOpts, - servername, - }); + socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); } else { debug('Creating `net.Socket`: %o', this.connectOpts); @@ -62492,11 +62599,9 @@ class HttpsProxyAgent extends agent_base_1.Agent { // The proxy is connecting to a TLS server, so upgrade // this socket connection to a TLS connection. debug('Upgrading socket connection to TLS'); - const servername = opts.servername || opts.host; return tls.connect({ - ...omit(opts, 'host', 'path', 'port'), + ...omit(setServernameFromNonIpHost(opts), 'host', 'path', 'port'), socket, - servername, }); } return socket; @@ -79102,6 +79207,7 @@ const READ_READABLE_STATUS = OPEN_STATUS | READ_EMIT_READABLE | READ_QUEUED | RE const SHOULD_NOT_READ = OPEN_STATUS | READ_ACTIVE | READ_ENDING | READ_DONE | READ_NEEDS_PUSH | READ_READ_AHEAD const READ_BACKPRESSURE_STATUS = DESTROY_STATUS | READ_ENDING | READ_DONE const READ_UPDATE_SYNC_STATUS = READ_UPDATING | OPEN_STATUS | READ_NEXT_TICK | READ_PRIMARY +const READ_NEXT_TICK_OR_OPENING = READ_NEXT_TICK | OPENING // Combined write state const WRITE_PRIMARY_STATUS = OPEN_STATUS | WRITE_FINISHING | WRITE_DONE @@ -79421,6 +79527,12 @@ class ReadableState { else this.updateNextTick() } + updateNextTickIfOpen () { + if ((this.stream._duplexState & READ_NEXT_TICK_OR_OPENING) !== 0) return + this.stream._duplexState |= READ_NEXT_TICK + if ((this.stream._duplexState & READ_UPDATING) === 0) queueTick(this.afterUpdateNextTick) + } + updateNextTick () { if ((this.stream._duplexState & READ_NEXT_TICK) !== 0) return this.stream._duplexState |= READ_NEXT_TICK @@ -79732,12 +79844,12 @@ class Readable extends Stream { } push (data) { - this._readableState.updateNextTick() + this._readableState.updateNextTickIfOpen() return this._readableState.push(data) } unshift (data) { - this._readableState.updateNextTick() + this._readableState.updateNextTickIfOpen() return this._readableState.unshift(data) } @@ -80138,6 +80250,10 @@ function isReadStreamx (stream) { return isStreamx(stream) && stream.readable } +function isDisturbed (stream) { + return (stream._duplexState & OPENING) !== OPENING || (stream._duplexState & ACTIVE_OR_TICKING) !== 0 +} + function isTypedArray (data) { return typeof data === 'object' && data !== null && typeof data.byteLength === 'number' } @@ -80163,6 +80279,7 @@ module.exports = { isStreamx, isEnded, isFinished, + isDisturbed, getStreamError, Stream, Writable, @@ -81444,7 +81561,9 @@ function normalizeEncoding (encoding) { /***/ }), /***/ 30574: -/***/ ((module) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const b4a = __nccwpck_require__(61658) module.exports = class PassThroughDecoder { constructor (encoding) { @@ -81456,7 +81575,7 @@ module.exports = class PassThroughDecoder { } decode (tail) { - return tail.toString(this.encoding) + return b4a.toString(tail, this.encoding) } flush () { @@ -81468,7 +81587,9 @@ module.exports = class PassThroughDecoder { /***/ }), /***/ 99485: -/***/ ((module) => { +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const b4a = __nccwpck_require__(61658) /** * https://encoding.spec.whatwg.org/#utf-8-decoder @@ -81495,7 +81616,7 @@ module.exports = class UTF8Decoder { isBoundary = data[i] <= 0x7f } - if (isBoundary) return data.toString() + if (isBoundary) return b4a.toString(data, 'utf8') } let result = '' @@ -114771,7 +114892,7 @@ exports.buildCreatePoller = buildCreatePoller; // Licensed under the MIT License. Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DEFAULT_RETRY_POLICY_COUNT = exports.SDK_VERSION = void 0; -exports.SDK_VERSION = "1.18.0"; +exports.SDK_VERSION = "1.18.1"; exports.DEFAULT_RETRY_POLICY_COUNT = 3; //# sourceMappingURL=constants.js.map @@ -115883,12 +116004,12 @@ async function authorizeRequestOnCaeChallenge(onChallengeOptions, caeClaims) { * then apply it to the Authorization header of a request as a Bearer token. */ function bearerTokenAuthenticationPolicy(options) { - var _a; + var _a, _b, _c; const { credential, scopes, challengeCallbacks } = options; const logger = options.logger || log_js_1.logger; const callbacks = { - authorizeRequest: (_a = challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequest) !== null && _a !== void 0 ? _a : defaultAuthorizeRequest, - authorizeRequestOnChallenge: challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequestOnChallenge, + authorizeRequest: (_b = (_a = challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequest) === null || _a === void 0 ? void 0 : _a.bind(challengeCallbacks)) !== null && _b !== void 0 ? _b : defaultAuthorizeRequest, + authorizeRequestOnChallenge: (_c = challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequestOnChallenge) === null || _c === void 0 ? void 0 : _c.bind(challengeCallbacks), }; // This function encapsulates the entire process of reliably retrieving the token // The options are left out of the public API until there's demand to configure this. diff --git a/upload-release/dist/lib/protocol/crypto/build/Release/sshcrypto.node b/upload-release/dist/lib/protocol/crypto/build/Release/sshcrypto.node index a5f0e49..0f51894 100755 Binary files a/upload-release/dist/lib/protocol/crypto/build/Release/sshcrypto.node and b/upload-release/dist/lib/protocol/crypto/build/Release/sshcrypto.node differ