From 85c7e2f1d935f7b6c91703b196ea466f0004e729 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 30 Jun 2026 00:57:19 +0000 Subject: [PATCH] fix(deps): update dependency @actions/core to v3.0.1 --- dist/index.js | 3429 +++++++++++++++++++++++++++++++-------------- package-lock.json | 8 +- package.json | 2 +- 3 files changed, 2357 insertions(+), 1082 deletions(-) diff --git a/dist/index.js b/dist/index.js index 8ffeebd8..e9b6751c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2041,13 +2041,21 @@ var require_dispatcher_base = __commonJS({ var kOnDestroyed = Symbol("onDestroyed"); var kOnClosed = Symbol("onClosed"); var kInterceptedDispatch = Symbol("Intercepted Dispatch"); + var kWebSocketOptions = Symbol("webSocketOptions"); var DispatcherBase = class extends Dispatcher { - constructor() { + constructor(opts) { super(); this[kDestroyed] = false; this[kOnDestroyed] = null; this[kClosed] = false; this[kOnClosed] = []; + this[kWebSocketOptions] = opts?.webSocket ?? {}; + } + get webSocketOptions() { + return { + maxFragments: this[kWebSocketOptions].maxFragments ?? 131072, + maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024 + }; } get destroyed() { return this[kDestroyed]; @@ -5700,6 +5708,9 @@ var require_client_h1 = __commonJS({ var FastBuffer = Buffer[Symbol.species]; var addListener = util.addListener; var removeAllListeners = util.removeAllListeners; + var kIdleSocketValidation = Symbol("kIdleSocketValidation"); + var kIdleSocketValidationTimeout = Symbol("kIdleSocketValidationTimeout"); + var kSocketUsed = Symbol("kSocketUsed"); var extractBody; async function lazyllhttp() { const llhttpWasmData = process.env.JEST_WORKER_ID ? require_llhttp_wasm() : void 0; @@ -5862,24 +5873,55 @@ var require_client_h1 = __commonJS({ currentBufferRef = null; } const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr; - if (ret === constants3.ERROR.PAUSED_UPGRADE) { - this.onUpgrade(data.slice(offset)); - } else if (ret === constants3.ERROR.PAUSED) { - this.paused = true; - socket.unshift(data.slice(offset)); - } else if (ret !== constants3.ERROR.OK) { - const ptr = llhttp.llhttp_get_error_reason(this.ptr); - let message = ""; - if (ptr) { - const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0); - message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")"; - } - throw new HTTPParserError(message, constants3.ERROR[ret], data.slice(offset)); + if (ret !== constants3.ERROR.OK) { + const body = data.subarray(offset); + if (ret === constants3.ERROR.PAUSED_UPGRADE) { + this.onUpgrade(body); + } else if (ret === constants3.ERROR.PAUSED) { + this.paused = true; + socket.unshift(body); + } else { + throw this.createError(ret, body); + } } } catch (err) { util.destroy(socket, err); } } + finish() { + assert(currentParser === null); + assert(this.ptr != null); + assert(!this.paused); + const { llhttp } = this; + let ret; + try { + currentParser = this; + ret = llhttp.llhttp_finish(this.ptr); + } finally { + currentParser = null; + } + if (ret === constants3.ERROR.OK) { + return null; + } + if (ret === constants3.ERROR.PAUSED || ret === constants3.ERROR.PAUSED_UPGRADE) { + this.paused = true; + return null; + } + return this.createError(ret, EMPTY_BUF); + } + createError(ret, data) { + const { llhttp, contentLength, bytesRead } = this; + if (contentLength && bytesRead !== parseInt(contentLength, 10)) { + return new ResponseContentLengthMismatchError(); + } + const ptr = llhttp.llhttp_get_error_reason(this.ptr); + let message = ""; + if (ptr) { + const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0); + message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")"; + } + return new HTTPParserError(message, constants3.ERROR[ret], data); + } destroy() { assert(this.ptr != null); assert(currentParser == null); @@ -5899,6 +5941,10 @@ var require_client_h1 = __commonJS({ if (socket.destroyed) { return -1; } + if (client[kRunning] === 0) { + util.destroy(socket, new SocketError("bad response", util.getSocketInfo(socket))); + return -1; + } const request = client[kQueue][client[kRunningIdx]]; if (!request) { return -1; @@ -5978,6 +6024,10 @@ var require_client_h1 = __commonJS({ if (socket.destroyed) { return -1; } + if (client[kRunning] === 0) { + util.destroy(socket, new SocketError("bad response", util.getSocketInfo(socket))); + return -1; + } const request = client[kQueue][client[kRunningIdx]]; if (!request) { return -1; @@ -6103,6 +6153,7 @@ var require_client_h1 = __commonJS({ } request.onComplete(headers); client[kQueue][client[kRunningIdx]++] = null; + socket[kSocketUsed] = true; if (socket[kWriting]) { assert(client[kRunning] === 0); util.destroy(socket, new InformationalError("reset")); @@ -6146,12 +6197,19 @@ var require_client_h1 = __commonJS({ socket[kWriting] = false; socket[kReset] = false; socket[kBlocking] = false; + socket[kIdleSocketValidation] = 0; + socket[kIdleSocketValidationTimeout] = null; + socket[kSocketUsed] = false; socket[kParser] = new Parser(client, socket, llhttpInstance); addListener(socket, "error", function(err) { assert(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); const parser = this[kParser]; if (err.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) { - parser.onMessageComplete(); + const parserErr = parser.finish(); + if (parserErr) { + this[kError] = parserErr; + this[kClient][kOnError](parserErr); + } return; } this[kError] = err; @@ -6166,7 +6224,10 @@ var require_client_h1 = __commonJS({ addListener(socket, "end", function() { const parser = this[kParser]; if (parser.statusCode && !parser.shouldKeepAlive) { - parser.onMessageComplete(); + const parserErr = parser.finish(); + if (parserErr) { + util.destroy(this, parserErr); + } return; } util.destroy(this, new SocketError("other side closed", util.getSocketInfo(this))); @@ -6174,9 +6235,10 @@ var require_client_h1 = __commonJS({ addListener(socket, "close", function() { const client2 = this[kClient]; const parser = this[kParser]; + clearIdleSocketValidation(this); if (parser) { if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { - parser.onMessageComplete(); + this[kError] = parser.finish() || this[kError]; } this[kParser].destroy(); this[kParser] = null; @@ -6225,7 +6287,7 @@ var require_client_h1 = __commonJS({ return socket.destroyed; }, busy(request) { - if (socket[kWriting] || socket[kReset] || socket[kBlocking]) { + if (socket[kWriting] || socket[kReset] || socket[kBlocking] || socket[kIdleSocketValidation] === 1) { return true; } if (request) { @@ -6243,6 +6305,24 @@ var require_client_h1 = __commonJS({ } }; } + function clearIdleSocketValidation(socket) { + if (socket[kIdleSocketValidationTimeout]) { + clearTimeout(socket[kIdleSocketValidationTimeout]); + socket[kIdleSocketValidationTimeout] = null; + } + socket[kIdleSocketValidation] = 0; + } + function scheduleIdleSocketValidation(client, socket) { + socket[kIdleSocketValidation] = 1; + socket[kIdleSocketValidationTimeout] = setTimeout(() => { + socket[kIdleSocketValidationTimeout] = null; + socket[kIdleSocketValidation] = 2; + if (client[kSocket] === socket && !socket.destroyed) { + client[kResume](); + } + }, 0); + socket[kIdleSocketValidationTimeout].unref?.(); + } function resumeH1(client) { const socket = client[kSocket]; if (socket && !socket.destroyed) { @@ -6255,6 +6335,29 @@ var require_client_h1 = __commonJS({ socket.ref(); socket[kNoRef] = false; } + if (client[kRunning] === 0 && client[kPending] > 0 && socket[kSocketUsed]) { + if (socket[kIdleSocketValidation] === 0) { + scheduleIdleSocketValidation(client, socket); + socket[kParser].readMore(); + if (socket.destroyed) { + return; + } + return; + } + if (socket[kIdleSocketValidation] === 1) { + socket[kParser].readMore(); + if (socket.destroyed) { + return; + } + return; + } + } + if (client[kRunning] === 0) { + socket[kParser].readMore(); + if (socket.destroyed) { + return; + } + } if (client[kSize] === 0) { if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) { socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE); @@ -6307,6 +6410,7 @@ var require_client_h1 = __commonJS({ process.emitWarning(new RequestContentLengthMismatchError()); } const socket = client[kSocket]; + clearIdleSocketValidation(socket); const abort = (err) => { if (request.aborted || request.completed) { return; @@ -7486,9 +7590,10 @@ var require_client = __commonJS({ autoSelectFamilyAttemptTimeout, // h2 maxConcurrentStreams, - allowH2 + allowH2, + webSocket } = {}) { - super(); + super({ webSocket }); if (keepAlive !== void 0) { throw new InvalidArgumentError("unsupported keepAlive, use pipelining=0 instead"); } @@ -7994,8 +8099,8 @@ var require_pool_base = __commonJS({ var kRemoveClient = Symbol("remove client"); var kStats = Symbol("stats"); var PoolBase = class extends DispatcherBase { - constructor() { - super(); + constructor(opts) { + super(opts); this[kQueue] = new FixedQueue(); this[kClients] = []; this[kQueued] = 0; @@ -8166,7 +8271,6 @@ var require_pool = __commonJS({ allowH2, ...options } = {}) { - super(); if (connections != null && (!Number.isFinite(connections) || connections < 0)) { throw new InvalidArgumentError("invalid connections"); } @@ -8187,6 +8291,7 @@ var require_pool = __commonJS({ ...connect }); } + super(options); this[kInterceptors] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool) ? options.interceptors.Pool : []; this[kConnections] = connections || null; this[kUrl] = util.parseOrigin(origin); @@ -8386,7 +8491,6 @@ var require_agent = __commonJS({ } var Agent = class extends DispatcherBase { constructor({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { - super(); if (typeof factory !== "function") { throw new InvalidArgumentError("factory must be a function."); } @@ -8396,6 +8500,7 @@ var require_agent = __commonJS({ if (!Number.isInteger(maxRedirections) || maxRedirections < 0) { throw new InvalidArgumentError("maxRedirections must be a positive number"); } + super(options); if (connect && typeof connect !== "function") { connect = { ...connect }; } @@ -16090,18 +16195,14 @@ var require_parse = __commonJS({ } else if (attributeNameLowercase === "httponly") { cookieAttributeList.httpOnly = true; } else if (attributeNameLowercase === "samesite") { - let enforcement = "Default"; const attributeValueLowercase = attributeValue.toLowerCase(); - if (attributeValueLowercase.includes("none")) { - enforcement = "None"; - } - if (attributeValueLowercase.includes("strict")) { - enforcement = "Strict"; + if (attributeValueLowercase === "none") { + cookieAttributeList.sameSite = "None"; + } else if (attributeValueLowercase === "strict") { + cookieAttributeList.sameSite = "Strict"; + } else if (attributeValueLowercase === "lax") { + cookieAttributeList.sameSite = "Lax"; } - if (attributeValueLowercase.includes("lax")) { - enforcement = "Lax"; - } - cookieAttributeList.sameSite = enforcement; } else { cookieAttributeList.unparsed ??= []; cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`); @@ -17029,27 +17130,26 @@ var require_permessage_deflate = __commonJS({ var tail = Buffer.from([0, 0, 255, 255]); var kBuffer = Symbol("kBuffer"); var kLength = Symbol("kLength"); - var kDefaultMaxDecompressedSize = 4 * 1024 * 1024; var PerMessageDeflate = class { /** @type {import('node:zlib').InflateRaw} */ #inflate; #options = {}; - /** @type {boolean} */ - #aborted = false; - /** @type {Function|null} */ - #currentCallback = null; + #maxPayloadSize = 0; /** * @param {Map} extensions */ - constructor(extensions) { + constructor(extensions, options) { this.#options.serverNoContextTakeover = extensions.has("server_no_context_takeover"); this.#options.serverMaxWindowBits = extensions.get("server_max_window_bits"); + this.#maxPayloadSize = options.maxPayloadSize; } + /** + * Decompress a compressed payload. + * @param {Buffer} chunk Compressed data + * @param {boolean} fin Final fragment flag + * @param {Function} callback Callback function + */ decompress(chunk, fin, callback) { - if (this.#aborted) { - callback(new MessageSizeExceededError()); - return; - } if (!this.#inflate) { let windowBits = Z_DEFAULT_WINDOWBITS; if (this.#options.serverMaxWindowBits) { @@ -17068,20 +17168,11 @@ var require_permessage_deflate = __commonJS({ this.#inflate[kBuffer] = []; this.#inflate[kLength] = 0; this.#inflate.on("data", (data) => { - if (this.#aborted) { - return; - } this.#inflate[kLength] += data.length; - if (this.#inflate[kLength] > kDefaultMaxDecompressedSize) { - this.#aborted = true; + if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) { + callback(new MessageSizeExceededError()); this.#inflate.removeAllListeners(); - this.#inflate.destroy(); this.#inflate = null; - if (this.#currentCallback) { - const cb = this.#currentCallback; - this.#currentCallback = null; - cb(new MessageSizeExceededError()); - } return; } this.#inflate[kBuffer].push(data); @@ -17091,19 +17182,17 @@ var require_permessage_deflate = __commonJS({ callback(err); }); } - this.#currentCallback = callback; this.#inflate.write(chunk); if (fin) { this.#inflate.write(tail); } this.#inflate.flush(() => { - if (this.#aborted || !this.#inflate) { + if (!this.#inflate) { return; } const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength]); this.#inflate[kBuffer].length = 0; this.#inflate[kLength] = 0; - this.#currentCallback = null; callback(null, full); }); } @@ -17134,8 +17223,14 @@ var require_receiver = __commonJS({ var { WebsocketFrameSend } = require_frame(); var { closeWebSocketConnection } = require_connection(); var { PerMessageDeflate } = require_permessage_deflate(); + var { MessageSizeExceededError } = require_errors(); + function failWebsocketConnectionWithCode(ws, code, reason) { + closeWebSocketConnection(ws, code, reason, Buffer.byteLength(reason)); + failWebsocketConnection(ws, reason); + } var ByteParser = class extends Writable { #buffers = []; + #fragmentsBytes = 0; #byteOffset = 0; #loop = false; #state = parserStates.INFO; @@ -17143,16 +17238,23 @@ var require_receiver = __commonJS({ #fragments = []; /** @type {Map} */ #extensions; + /** @type {number} */ + #maxFragments; + /** @type {number} */ + #maxPayloadSize; /** * @param {import('./websocket').WebSocket} ws * @param {Map|null} extensions + * @param {{ maxFragments?: number, maxPayloadSize?: number }} [options] */ - constructor(ws, extensions) { + constructor(ws, extensions, options = {}) { super(); this.ws = ws; this.#extensions = extensions == null ? /* @__PURE__ */ new Map() : extensions; + this.#maxFragments = options.maxFragments ?? 0; + this.#maxPayloadSize = options.maxPayloadSize ?? 0; if (this.#extensions.has("permessage-deflate")) { - this.#extensions.set("permessage-deflate", new PerMessageDeflate(extensions)); + this.#extensions.set("permessage-deflate", new PerMessageDeflate(extensions, options)); } } /** @@ -17165,6 +17267,13 @@ var require_receiver = __commonJS({ this.#loop = true; this.run(callback); } + #validatePayloadLength() { + if (this.#maxPayloadSize > 0 && !isControlFrame(this.#info.opcode) && this.#info.payloadLength + this.#fragmentsBytes > this.#maxPayloadSize) { + failWebsocketConnectionWithCode(this.ws, 1009, "Payload size exceeds maximum allowed size"); + return false; + } + return true; + } /** * Runs whenever a new chunk is received. * Callback is called whenever there are no more chunks buffering, @@ -17224,6 +17333,9 @@ var require_receiver = __commonJS({ if (payloadLength <= 125) { this.#info.payloadLength = payloadLength; this.#state = parserStates.READ_DATA; + if (!this.#validatePayloadLength()) { + return; + } } else if (payloadLength === 126) { this.#state = parserStates.PAYLOADLENGTH_16; } else if (payloadLength === 127) { @@ -17244,6 +17356,9 @@ var require_receiver = __commonJS({ const buffer = this.consume(2); this.#info.payloadLength = buffer.readUInt16BE(0); this.#state = parserStates.READ_DATA; + if (!this.#validatePayloadLength()) { + return; + } } else if (this.#state === parserStates.PAYLOADLENGTH_64) { if (this.#byteOffset < 8) { return callback(); @@ -17257,6 +17372,9 @@ var require_receiver = __commonJS({ } this.#info.payloadLength = lower; this.#state = parserStates.READ_DATA; + if (!this.#validatePayloadLength()) { + return; + } } else if (this.#state === parserStates.READ_DATA) { if (this.#byteOffset < this.#info.payloadLength) { return callback(); @@ -17267,32 +17385,46 @@ var require_receiver = __commonJS({ this.#state = parserStates.INFO; } else { if (!this.#info.compressed) { - this.#fragments.push(body); + if (!this.writeFragments(body)) { + return; + } + if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) { + failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message); + return; + } if (!this.#info.fragmented && this.#info.fin) { - const fullMessage = Buffer.concat(this.#fragments); - websocketMessageReceived(this.ws, this.#info.binaryType, fullMessage); - this.#fragments.length = 0; + websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments()); } this.#state = parserStates.INFO; } else { - this.#extensions.get("permessage-deflate").decompress(body, this.#info.fin, (error2, data) => { - if (error2) { - failWebsocketConnection(this.ws, error2.message); - return; - } - this.#fragments.push(data); - if (!this.#info.fin) { - this.#state = parserStates.INFO; + this.#extensions.get("permessage-deflate").decompress( + body, + this.#info.fin, + (error2, data) => { + if (error2) { + const code = error2 instanceof MessageSizeExceededError ? 1009 : 1007; + failWebsocketConnectionWithCode(this.ws, code, error2.message); + return; + } + if (!this.writeFragments(data)) { + return; + } + if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) { + failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message); + return; + } + if (!this.#info.fin) { + this.#state = parserStates.INFO; + this.#loop = true; + this.run(callback); + return; + } + websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments()); this.#loop = true; + this.#state = parserStates.INFO; this.run(callback); - return; } - websocketMessageReceived(this.ws, this.#info.binaryType, Buffer.concat(this.#fragments)); - this.#loop = true; - this.#state = parserStates.INFO; - this.#fragments.length = 0; - this.run(callback); - }); + ); this.#loop = false; break; } @@ -17335,6 +17467,26 @@ var require_receiver = __commonJS({ this.#byteOffset -= n; return buffer; } + writeFragments(fragment) { + if (this.#maxFragments > 0 && this.#fragments.length === this.#maxFragments) { + failWebsocketConnectionWithCode(this.ws, 1008, "Too many message fragments"); + return false; + } + this.#fragmentsBytes += fragment.length; + this.#fragments.push(fragment); + return true; + } + consumeFragments() { + const fragments = this.#fragments; + if (fragments.length === 1) { + this.#fragmentsBytes = 0; + return fragments.shift(); + } + const output = Buffer.concat(fragments, this.#fragmentsBytes); + this.#fragments = []; + this.#fragmentsBytes = 0; + return output; + } parseCloseBody(data) { assert(data.length !== 1); let code; @@ -17772,7 +17924,13 @@ var require_websocket = __commonJS({ */ #onConnectionEstablished(response, parsedExtensions) { this[kResponse] = response; - const parser = new ByteParser(this, parsedExtensions); + const webSocketOptions = this[kController]?.dispatcher?.webSocketOptions; + const maxFragments = webSocketOptions?.maxFragments; + const maxPayloadSize = webSocketOptions?.maxPayloadSize; + const parser = new ByteParser(this, parsedExtensions, { + maxFragments, + maxPayloadSize + }); parser.on("drain", onParserDrain); parser.on("error", onParserError.bind(this)); response.socket.ws = this; @@ -18712,7 +18870,7 @@ var require_buildInformationRepository = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.BuildInformationRepository = void 0; var overwriteMode_1 = require_overwriteMode(); - var __1 = require_dist(); + var __1 = require_dist2(); var BuildInformationRepository = ( /** @class */ function() { @@ -19328,7 +19486,7 @@ var require_environmentRepository = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.EnvironmentRepository = void 0; - var __1 = require_dist(); + var __1 = require_dist2(); var spaceScopedBasicRepository_1 = require_spaceScopedBasicRepository(); var EnvironmentRepository = ( /** @class */ @@ -35193,6 +35351,9 @@ var require_form_data = __commonJS({ var setToStringTag = require_es_set_tostringtag(); var hasOwn = require_hasown(); var populate = require_populate(); + function escapeHeaderParam(str) { + return String(str).replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/"/g, "%22"); + } function FormData2(options) { if (!(this instanceof FormData2)) { return new FormData2(options); @@ -35282,7 +35443,7 @@ var require_form_data = __commonJS({ var contents = ""; var headers = { // add custom disposition as third element or keep it two elements if not - "Content-Disposition": ["form-data", 'name="' + field + '"'].concat(contentDisposition || []), + "Content-Disposition": ["form-data", 'name="' + escapeHeaderParam(field) + '"'].concat(contentDisposition || []), // if no content type. allow it to be empty array "Content-Type": [].concat(contentType || []) }; @@ -35316,7 +35477,7 @@ var require_form_data = __commonJS({ filename = path.basename(value.client._httpMessage.path || ""); } if (filename) { - return 'filename="' + filename + '"'; + return 'filename="' + escapeHeaderParam(filename) + '"'; } }; FormData2.prototype._getContentType = function(value, options) { @@ -35995,7 +36156,7 @@ var require_projectGroupRepository = __commonJS({ }(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.ProjectGroupRepository = void 0; - var __1 = require_dist(); + var __1 = require_dist2(); var spaceScopedBasicRepository_1 = require_spaceScopedBasicRepository(); var ProjectGroupRepository = ( /** @class */ @@ -41681,7 +41842,7 @@ var require_feedRepository = __commonJS({ }(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.FeedRepository = void 0; - var __1 = require_dist(); + var __1 = require_dist2(); var spaceScopedBasicRepository_1 = require_spaceScopedBasicRepository(); var FeedRepository = ( /** @class */ @@ -45206,7 +45367,7 @@ var require_deploymentProcessRepository = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DeploymentProcessRepository = void 0; - var __1 = require_dist(); + var __1 = require_dist2(); var DeploymentProcessRepository = ( /** @class */ function() { @@ -47452,7 +47613,7 @@ var require_deploymentRepository = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DeploymentRepository = void 0; - var __1 = require_dist(); + var __1 = require_dist2(); var semver_1 = require_semver2(); var DeploymentRepository = ( /** @class */ @@ -47723,7 +47884,7 @@ var require_releaseRepository = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.ReleaseRepository = void 0; - var __1 = require_dist(); + var __1 = require_dist2(); var semver_1 = require_semver2(); var ReleaseRepository2 = ( /** @class */ @@ -48772,7 +48933,7 @@ var require_projectRepository = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.ProjectRepository = void 0; var spaceScopedBasicRepository_1 = require_spaceScopedBasicRepository(); - var __1 = require_dist(); + var __1 = require_dist2(); var ProjectRepository = ( /** @class */ function(_super) { @@ -49658,7 +49819,7 @@ var require_spaceRepository = __commonJS({ }(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.SpaceRepository = void 0; - var __1 = require_dist(); + var __1 = require_dist2(); var basicRepository_1 = require_basicRepository(); var SpaceRepository = ( /** @class */ @@ -49828,7 +49989,7 @@ var require_tenantRepository = __commonJS({ }(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.TenantRepository = void 0; - var __1 = require_dist(); + var __1 = require_dist2(); var spaceScopedBasicRepository_1 = require_spaceScopedBasicRepository(); var TenantRepository = ( /** @class */ @@ -50113,7 +50274,7 @@ var require_user_get_current = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.userGetCurrent = void 0; - var __1 = require_dist(); + var __1 = require_dist2(); function userGetCurrent(client) { return __awaiter2(this, void 0, void 0, function() { var user; @@ -50298,76 +50459,6 @@ var require_adapter = __commonJS({ } }); -// node_modules/proxy-from-env/index.js -var require_proxy_from_env = __commonJS({ - "node_modules/proxy-from-env/index.js"(exports2) { - "use strict"; - var parseUrl = require("url").parse; - var DEFAULT_PORTS = { - ftp: 21, - gopher: 70, - http: 80, - https: 443, - ws: 80, - wss: 443 - }; - var stringEndsWith = String.prototype.endsWith || function(s) { - return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1; - }; - function getProxyForUrl(url) { - var parsedUrl = typeof url === "string" ? parseUrl(url) : url || {}; - var proto = parsedUrl.protocol; - var hostname = parsedUrl.host; - var port = parsedUrl.port; - if (typeof hostname !== "string" || !hostname || typeof proto !== "string") { - return ""; - } - proto = proto.split(":", 1)[0]; - hostname = hostname.replace(/:\d*$/, ""); - port = parseInt(port) || DEFAULT_PORTS[proto] || 0; - if (!shouldProxy(hostname, port)) { - return ""; - } - var proxy = getEnv("npm_config_" + proto + "_proxy") || getEnv(proto + "_proxy") || getEnv("npm_config_proxy") || getEnv("all_proxy"); - if (proxy && proxy.indexOf("://") === -1) { - proxy = proto + "://" + proxy; - } - return proxy; - } - function shouldProxy(hostname, port) { - var NO_PROXY = (getEnv("npm_config_no_proxy") || getEnv("no_proxy")).toLowerCase(); - if (!NO_PROXY) { - return true; - } - if (NO_PROXY === "*") { - return false; - } - return NO_PROXY.split(/[,\s]/).every(function(proxy) { - if (!proxy) { - return true; - } - var parsedProxy = proxy.match(/^(.+):(\d+)$/); - var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy; - var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0; - if (parsedProxyPort && parsedProxyPort !== port) { - return true; - } - if (!/^[.*]/.test(parsedProxyHostname)) { - return hostname !== parsedProxyHostname; - } - if (parsedProxyHostname.charAt(0) === "*") { - parsedProxyHostname = parsedProxyHostname.slice(1); - } - return !stringEndsWith.call(hostname, parsedProxyHostname); - }); - } - function getEnv(key) { - return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || ""; - } - exports2.getProxyForUrl = getProxyForUrl; - } -}); - // node_modules/ms/index.js var require_ms = __commonJS({ "node_modules/ms/index.js"(exports2, module2) { @@ -51131,6 +51222,456 @@ var require_src = __commonJS({ } }); +// node_modules/agent-base/dist/src/promisify.js +var require_promisify = __commonJS({ + "node_modules/agent-base/dist/src/promisify.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + function promisify(fn) { + return function(req, opts) { + return new Promise((resolve, reject) => { + fn.call(this, req, opts, (err, rtn) => { + if (err) { + reject(err); + } else { + resolve(rtn); + } + }); + }); + }; + } + exports2.default = promisify; + } +}); + +// node_modules/agent-base/dist/src/index.js +var require_src2 = __commonJS({ + "node_modules/agent-base/dist/src/index.js"(exports2, module2) { + "use strict"; + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + var events_1 = require("events"); + var debug_1 = __importDefault(require_src()); + var promisify_1 = __importDefault(require_promisify()); + var debug2 = debug_1.default("agent-base"); + function isAgent(v) { + return Boolean(v) && typeof v.addRequest === "function"; + } + function isSecureEndpoint() { + const { stack } = new Error(); + if (typeof stack !== "string") + return false; + return stack.split("\n").some((l) => l.indexOf("(https.js:") !== -1 || l.indexOf("node:https:") !== -1); + } + function createAgent(callback, opts) { + return new createAgent.Agent(callback, opts); + } + (function(createAgent2) { + class Agent extends events_1.EventEmitter { + constructor(callback, _opts) { + super(); + let opts = _opts; + if (typeof callback === "function") { + this.callback = callback; + } else if (callback) { + opts = callback; + } + this.timeout = null; + if (opts && typeof opts.timeout === "number") { + this.timeout = opts.timeout; + } + this.maxFreeSockets = 1; + this.maxSockets = 1; + this.maxTotalSockets = Infinity; + this.sockets = {}; + this.freeSockets = {}; + this.requests = {}; + this.options = {}; + } + get defaultPort() { + if (typeof this.explicitDefaultPort === "number") { + return this.explicitDefaultPort; + } + return isSecureEndpoint() ? 443 : 80; + } + set defaultPort(v) { + this.explicitDefaultPort = v; + } + get protocol() { + if (typeof this.explicitProtocol === "string") { + return this.explicitProtocol; + } + return isSecureEndpoint() ? "https:" : "http:"; + } + set protocol(v) { + this.explicitProtocol = v; + } + callback(req, opts, fn) { + throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`'); + } + /** + * Called by node-core's "_http_client.js" module when creating + * a new HTTP request with this Agent instance. + * + * @api public + */ + addRequest(req, _opts) { + const opts = Object.assign({}, _opts); + if (typeof opts.secureEndpoint !== "boolean") { + opts.secureEndpoint = isSecureEndpoint(); + } + if (opts.host == null) { + opts.host = "localhost"; + } + if (opts.port == null) { + opts.port = opts.secureEndpoint ? 443 : 80; + } + if (opts.protocol == null) { + opts.protocol = opts.secureEndpoint ? "https:" : "http:"; + } + if (opts.host && opts.path) { + delete opts.path; + } + delete opts.agent; + delete opts.hostname; + delete opts._defaultAgent; + delete opts.defaultPort; + delete opts.createConnection; + req._last = true; + req.shouldKeepAlive = false; + let timedOut = false; + let timeoutId = null; + const timeoutMs = opts.timeout || this.timeout; + const onerror = (err) => { + if (req._hadError) + return; + req.emit("error", err); + req._hadError = true; + }; + const ontimeout = () => { + timeoutId = null; + timedOut = true; + const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`); + err.code = "ETIMEOUT"; + onerror(err); + }; + const callbackError = (err) => { + if (timedOut) + return; + if (timeoutId !== null) { + clearTimeout(timeoutId); + timeoutId = null; + } + onerror(err); + }; + const onsocket = (socket) => { + if (timedOut) + return; + if (timeoutId != null) { + clearTimeout(timeoutId); + timeoutId = null; + } + if (isAgent(socket)) { + debug2("Callback returned another Agent instance %o", socket.constructor.name); + socket.addRequest(req, opts); + return; + } + if (socket) { + socket.once("free", () => { + this.freeSocket(socket, opts); + }); + req.onSocket(socket); + return; + } + const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``); + onerror(err); + }; + if (typeof this.callback !== "function") { + onerror(new Error("`callback` is not defined")); + return; + } + if (!this.promisifiedCallback) { + if (this.callback.length >= 3) { + debug2("Converting legacy callback function to promise"); + this.promisifiedCallback = promisify_1.default(this.callback); + } else { + this.promisifiedCallback = this.callback; + } + } + if (typeof timeoutMs === "number" && timeoutMs > 0) { + timeoutId = setTimeout(ontimeout, timeoutMs); + } + if ("port" in opts && typeof opts.port !== "number") { + opts.port = Number(opts.port); + } + try { + debug2("Resolving socket for %o request: %o", opts.protocol, `${req.method} ${req.path}`); + Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError); + } catch (err) { + Promise.reject(err).catch(callbackError); + } + } + freeSocket(socket, opts) { + debug2("Freeing socket %o %o", socket.constructor.name, opts); + socket.destroy(); + } + destroy() { + debug2("Destroying agent %o", this.constructor.name); + } + } + createAgent2.Agent = Agent; + createAgent2.prototype = createAgent2.Agent.prototype; + })(createAgent || (createAgent = {})); + module2.exports = createAgent; + } +}); + +// node_modules/https-proxy-agent/dist/parse-proxy-response.js +var require_parse_proxy_response = __commonJS({ + "node_modules/https-proxy-agent/dist/parse-proxy-response.js"(exports2) { + "use strict"; + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + var debug_1 = __importDefault(require_src()); + var debug2 = debug_1.default("https-proxy-agent:parse-proxy-response"); + function parseProxyResponse(socket) { + return new Promise((resolve, reject) => { + let buffersLength = 0; + const buffers = []; + function read() { + const b = socket.read(); + if (b) + ondata(b); + else + socket.once("readable", read); + } + function cleanup() { + socket.removeListener("end", onend); + socket.removeListener("error", onerror); + socket.removeListener("close", onclose); + socket.removeListener("readable", read); + } + function onclose(err) { + debug2("onclose had error %o", err); + } + function onend() { + debug2("onend"); + } + function onerror(err) { + cleanup(); + debug2("onerror %o", err); + reject(err); + } + function ondata(b) { + buffers.push(b); + buffersLength += b.length; + const buffered = Buffer.concat(buffers, buffersLength); + const endOfHeaders = buffered.indexOf("\r\n\r\n"); + if (endOfHeaders === -1) { + debug2("have not received end of HTTP headers yet..."); + read(); + return; + } + const firstLine = buffered.toString("ascii", 0, buffered.indexOf("\r\n")); + const statusCode = +firstLine.split(" ")[1]; + debug2("got proxy server response: %o", firstLine); + resolve({ + statusCode, + buffered + }); + } + socket.on("error", onerror); + socket.on("close", onclose); + socket.on("end", onend); + read(); + }); + } + exports2.default = parseProxyResponse; + } +}); + +// node_modules/https-proxy-agent/dist/agent.js +var require_agent2 = __commonJS({ + "node_modules/https-proxy-agent/dist/agent.js"(exports2) { + "use strict"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + var net_1 = __importDefault(require("net")); + var tls_1 = __importDefault(require("tls")); + var url_1 = __importDefault(require("url")); + var assert_1 = __importDefault(require("assert")); + var debug_1 = __importDefault(require_src()); + var agent_base_1 = require_src2(); + var parse_proxy_response_1 = __importDefault(require_parse_proxy_response()); + var debug2 = debug_1.default("https-proxy-agent:agent"); + var HttpsProxyAgent = class extends agent_base_1.Agent { + constructor(_opts) { + let opts; + if (typeof _opts === "string") { + opts = url_1.default.parse(_opts); + } else { + opts = _opts; + } + if (!opts) { + throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!"); + } + debug2("creating new HttpsProxyAgent instance: %o", opts); + super(opts); + const proxy = Object.assign({}, opts); + this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol); + proxy.host = proxy.hostname || proxy.host; + if (typeof proxy.port === "string") { + proxy.port = parseInt(proxy.port, 10); + } + if (!proxy.port && proxy.host) { + proxy.port = this.secureProxy ? 443 : 80; + } + if (this.secureProxy && !("ALPNProtocols" in proxy)) { + proxy.ALPNProtocols = ["http 1.1"]; + } + if (proxy.host && proxy.path) { + delete proxy.path; + delete proxy.pathname; + } + this.proxy = proxy; + } + /** + * Called when the node-core HTTP client library is creating a + * new HTTP request. + * + * @api protected + */ + callback(req, opts) { + return __awaiter2(this, void 0, void 0, function* () { + const { proxy, secureProxy } = this; + let socket; + if (secureProxy) { + debug2("Creating `tls.Socket`: %o", proxy); + socket = tls_1.default.connect(proxy); + } else { + debug2("Creating `net.Socket`: %o", proxy); + socket = net_1.default.connect(proxy); + } + const headers = Object.assign({}, proxy.headers); + const hostname = `${opts.host}:${opts.port}`; + let payload = `CONNECT ${hostname} HTTP/1.1\r +`; + if (proxy.auth) { + headers["Proxy-Authorization"] = `Basic ${Buffer.from(proxy.auth).toString("base64")}`; + } + let { host, port, secureEndpoint } = opts; + if (!isDefaultPort(port, secureEndpoint)) { + host += `:${port}`; + } + headers.Host = host; + headers.Connection = "close"; + for (const name of Object.keys(headers)) { + payload += `${name}: ${headers[name]}\r +`; + } + const proxyResponsePromise = parse_proxy_response_1.default(socket); + socket.write(`${payload}\r +`); + const { statusCode, buffered } = yield proxyResponsePromise; + if (statusCode === 200) { + req.once("socket", resume); + if (opts.secureEndpoint) { + debug2("Upgrading socket connection to TLS"); + const servername = opts.servername || opts.host; + return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, "host", "hostname", "path", "port")), { + socket, + servername + })); + } + return socket; + } + socket.destroy(); + const fakeSocket = new net_1.default.Socket({ writable: false }); + fakeSocket.readable = true; + req.once("socket", (s) => { + debug2("replaying proxy buffer for failed request"); + assert_1.default(s.listenerCount("data") > 0); + s.push(buffered); + s.push(null); + }); + return fakeSocket; + }); + } + }; + exports2.default = HttpsProxyAgent; + function resume(socket) { + socket.resume(); + } + function isDefaultPort(port, secure) { + return Boolean(!secure && port === 80 || secure && port === 443); + } + function isHTTPS(protocol) { + return typeof protocol === "string" ? /^https:?$/i.test(protocol) : false; + } + function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; + } + } + return ret; + } + } +}); + +// node_modules/https-proxy-agent/dist/index.js +var require_dist = __commonJS({ + "node_modules/https-proxy-agent/dist/index.js"(exports2, module2) { + "use strict"; + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + var agent_1 = __importDefault(require_agent2()); + function createHttpsProxyAgent(opts) { + return new agent_1.default(opts); + } + (function(createHttpsProxyAgent2) { + createHttpsProxyAgent2.HttpsProxyAgent = agent_1.default; + createHttpsProxyAgent2.prototype = agent_1.default.prototype; + })(createHttpsProxyAgent || (createHttpsProxyAgent = {})); + module2.exports = createHttpsProxyAgent; + } +}); + // node_modules/follow-redirects/debug.js var require_debug2 = __commonJS({ "node_modules/follow-redirects/debug.js"(exports2, module2) { @@ -51175,6 +51716,11 @@ var require_follow_redirects = __commonJS({ } catch (error2) { useNativeURL = error2.code === "ERR_INVALID_URL"; } + var sensitiveHeaders = [ + "Authorization", + "Proxy-Authorization", + "Cookie" + ]; var preservedUrlFields = [ "auth", "host", @@ -51239,6 +51785,7 @@ var require_follow_redirects = __commonJS({ self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause })); } }; + this._headerFilter = new RegExp("^(?:" + sensitiveHeaders.concat(options.sensitiveHeaders).map(escapeRegex).join("|") + ")$", "i"); this._performRequest(); } RedirectableRequest.prototype = Object.create(Writable.prototype); @@ -51376,6 +51923,9 @@ var require_follow_redirects = __commonJS({ if (!options.headers) { options.headers = {}; } + if (!isArray(options.sensitiveHeaders)) { + options.sensitiveHeaders = []; + } if (options.host) { if (!options.hostname) { options.hostname = options.host; @@ -51481,7 +52031,7 @@ var require_follow_redirects = __commonJS({ this._isRedirect = true; spreadUrlObject(redirectUrl, this._options); if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) { - removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers); + removeMatchingHeaders(this._headerFilter, this._options.headers); } if (isFunction(beforeRedirect)) { var responseDetails = { @@ -51630,6 +52180,9 @@ var require_follow_redirects = __commonJS({ var dot = subdomain.length - domain.length - 1; return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); } + function isArray(value) { + return value instanceof Array; + } function isString(value) { return typeof value === "string" || value instanceof String; } @@ -51642,6 +52195,9 @@ var require_follow_redirects = __commonJS({ function isURL(value) { return URL2 && value instanceof URL2; } + function escapeRegex(regex) { + return regex.replace(/[\]\\/()*+?.$]/g, "\\$&"); + } module2.exports = wrap({ http, https }); module2.exports.wrap = wrap; } @@ -51654,37 +52210,31 @@ var require_axios = __commonJS({ var FormData$1 = require_form_data(); var crypto2 = require("crypto"); var url = require("url"); - var proxyFromEnv = require_proxy_from_env(); + var HttpsProxyAgent = require_dist(); var http = require("http"); var https = require("https"); var http2 = require("http2"); var util = require("util"); + var path = require("path"); var followRedirects = require_follow_redirects(); var zlib = require("zlib"); var stream = require("stream"); var events = require("events"); - function _interopDefaultLegacy(e) { - return e && typeof e === "object" && "default" in e ? e : { "default": e }; - } - var FormData__default = /* @__PURE__ */ _interopDefaultLegacy(FormData$1); - var crypto__default = /* @__PURE__ */ _interopDefaultLegacy(crypto2); - var url__default = /* @__PURE__ */ _interopDefaultLegacy(url); - var proxyFromEnv__default = /* @__PURE__ */ _interopDefaultLegacy(proxyFromEnv); - var http__default = /* @__PURE__ */ _interopDefaultLegacy(http); - var https__default = /* @__PURE__ */ _interopDefaultLegacy(https); - var http2__default = /* @__PURE__ */ _interopDefaultLegacy(http2); - var util__default = /* @__PURE__ */ _interopDefaultLegacy(util); - var followRedirects__default = /* @__PURE__ */ _interopDefaultLegacy(followRedirects); - var zlib__default = /* @__PURE__ */ _interopDefaultLegacy(zlib); - var stream__default = /* @__PURE__ */ _interopDefaultLegacy(stream); function bind(fn, thisArg) { return function wrap() { return fn.apply(thisArg, arguments); }; } - var { toString } = Object.prototype; - var { getPrototypeOf } = Object; - var { iterator, toStringTag } = Symbol; + var { + toString + } = Object.prototype; + var { + getPrototypeOf + } = Object; + var { + iterator, + toStringTag + } = Symbol; var kindOf = /* @__PURE__ */ ((cache) => (thing) => { const str = toString.call(thing); return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); @@ -51694,7 +52244,9 @@ var require_axios = __commonJS({ return (thing) => kindOf(thing) === type; }; var typeOfTest = (type) => (thing) => typeof thing === type; - var { isArray } = Array; + var { + isArray + } = Array; var isUndefined = typeOfTest("undefined"); function isBuffer(val) { return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val); @@ -51733,23 +52285,40 @@ var require_axios = __commonJS({ }; var isDate = kindOfTest("Date"); var isFile = kindOfTest("File"); + var isReactNativeBlob = (value) => { + return !!(value && typeof value.uri !== "undefined"); + }; + var isReactNative = (formData) => formData && typeof formData.getParts !== "undefined"; var isBlob = kindOfTest("Blob"); var isFileList = kindOfTest("FileList"); var isStream = (val) => isObject(val) && isFunction$1(val.pipe); + function getGlobal() { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + return {}; + } + var G = getGlobal(); + var FormDataCtor = typeof G.FormData !== "undefined" ? G.FormData : void 0; var isFormData = (thing) => { - let kind; - return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance - kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]")); + if (!thing) return false; + if (FormDataCtor && thing instanceof FormDataCtor) return true; + const proto = getPrototypeOf(thing); + if (!proto || proto === Object.prototype) return false; + if (!isFunction$1(thing.append)) return false; + const kind = kindOf(thing); + return kind === "formdata" || // detect form-data instance + kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]"; }; var isURLSearchParams = kindOfTest("URLSearchParams"); - var [isReadableStream, isRequest, isResponse, isHeaders] = [ - "ReadableStream", - "Request", - "Response", - "Headers" - ].map(kindOfTest); - var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); - function forEach(obj, fn, { allOwnKeys = false } = {}) { + var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest); + var trim = (str) => { + return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); + }; + function forEach(obj, fn, { + allOwnKeys = false + } = {}) { if (obj === null || typeof obj === "undefined") { return; } @@ -51796,16 +52365,20 @@ var require_axios = __commonJS({ return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global; })(); var isContextDefined = (context) => !isUndefined(context) && context !== _global; - function merge() { - const { caseless, skipUndefined } = isContextDefined(this) && this || {}; + function merge(...objs) { + const { + caseless, + skipUndefined + } = isContextDefined(this) && this || {}; const result = {}; const assignValue = (val, key) => { if (key === "__proto__" || key === "constructor" || key === "prototype") { return; } - const targetKey = caseless && findKey(result, key) || key; - if (isPlainObject(result[targetKey]) && isPlainObject(val)) { - result[targetKey] = merge(result[targetKey], val); + const targetKey = caseless && typeof key === "string" && findKey(result, key) || key; + const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : void 0; + if (isPlainObject(existing) && isPlainObject(val)) { + result[targetKey] = merge(existing, val); } else if (isPlainObject(val)) { result[targetKey] = merge({}, val); } else if (isArray(val)) { @@ -51814,33 +52387,51 @@ var require_axios = __commonJS({ result[targetKey] = val; } }; - for (let i = 0, l = arguments.length; i < l; i++) { - arguments[i] && forEach(arguments[i], assignValue); + for (let i = 0, l = objs.length; i < l; i++) { + const source = objs[i]; + if (!source || isBuffer(source)) { + continue; + } + forEach(source, assignValue); + if (typeof source !== "object" || isArray(source)) { + continue; + } + const symbols = Object.getOwnPropertySymbols(source); + for (let j = 0; j < symbols.length; j++) { + const symbol = symbols[j]; + if (propertyIsEnumerable.call(source, symbol)) { + assignValue(source[symbol], symbol); + } + } } return result; } - var extend = (a, b, thisArg, { allOwnKeys } = {}) => { - forEach( - b, - (val, key) => { - if (thisArg && isFunction$1(val)) { - Object.defineProperty(a, key, { - value: bind(val, thisArg), - writable: true, - enumerable: true, - configurable: true - }); - } else { - Object.defineProperty(a, key, { - value: val, - writable: true, - enumerable: true, - configurable: true - }); - } - }, - { allOwnKeys } - ); + var extend = (a, b, thisArg, { + allOwnKeys + } = {}) => { + forEach(b, (val, key) => { + if (thisArg && isFunction$1(val)) { + Object.defineProperty(a, key, { + // Null-proto descriptor so a polluted Object.prototype.get cannot + // hijack defineProperty's accessor-vs-data resolution. + __proto__: null, + value: bind(val, thisArg), + writable: true, + enumerable: true, + configurable: true + }); + } else { + Object.defineProperty(a, key, { + __proto__: null, + value: val, + writable: true, + enumerable: true, + configurable: true + }); + } + }, { + allOwnKeys + }); return a; }; var stripBOM = (content) => { @@ -51850,17 +52441,16 @@ var require_axios = __commonJS({ return content; }; var inherits = (constructor, superConstructor, props, descriptors) => { - constructor.prototype = Object.create( - superConstructor.prototype, - descriptors - ); + constructor.prototype = Object.create(superConstructor.prototype, descriptors); Object.defineProperty(constructor.prototype, "constructor", { + __proto__: null, value: constructor, writable: true, enumerable: false, configurable: true }); Object.defineProperty(constructor, "super", { + __proto__: null, value: superConstructor.prototype }); props && Object.assign(constructor.prototype, props); @@ -51934,7 +52524,12 @@ var require_axios = __commonJS({ return p1.toUpperCase() + p2; }); }; - var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype); + var hasOwnProperty = (({ + hasOwnProperty: hasOwnProperty2 + }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype); + var { + propertyIsEnumerable + } = Object.prototype; var isRegExp = kindOfTest("RegExp"); var reduceDescriptors = (obj, reducer) => { const descriptors = Object.getOwnPropertyDescriptors(obj); @@ -51949,7 +52544,7 @@ var require_axios = __commonJS({ }; var freezeMethods = (obj) => { reduceDescriptors(obj, (descriptor, name) => { - if (isFunction$1(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) { + if (isFunction$1(obj) && ["arguments", "caller", "callee"].includes(name)) { return false; } const value = obj[name]; @@ -51985,29 +52580,29 @@ var require_axios = __commonJS({ return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]); } var toJSONObject = (obj) => { - const stack = new Array(10); - const visit = (source, i) => { + const visited = /* @__PURE__ */ new WeakSet(); + const visit = (source) => { if (isObject(source)) { - if (stack.indexOf(source) >= 0) { + if (visited.has(source)) { return; } if (isBuffer(source)) { return source; } if (!("toJSON" in source)) { - stack[i] = source; + visited.add(source); const target = isArray(source) ? [] : {}; forEach(source, (value, key) => { - const reducedValue = visit(value, i + 1); + const reducedValue = visit(value); !isUndefined(reducedValue) && (target[key] = reducedValue); }); - stack[i] = void 0; + visited.delete(source); return target; } } return source; }; - return visit(obj, 0); + return visit(obj); }; var isAsyncFn = kindOfTest("AsyncFunction"); var isThenable = (thing) => thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch); @@ -52016,15 +52611,14 @@ var require_axios = __commonJS({ return setImmediate; } return postMessageSupported ? ((token, callbacks) => { - _global.addEventListener( - "message", - ({ source, data }) => { - if (source === _global && data === token) { - callbacks.length && callbacks.shift()(); - } - }, - false - ); + _global.addEventListener("message", ({ + source, + data + }) => { + if (source === _global && data === token) { + callbacks.length && callbacks.shift()(); + } + }, false); return (cb) => { callbacks.push(cb); _global.postMessage(token, "*"); @@ -52052,6 +52646,8 @@ var require_axios = __commonJS({ isUndefined, isDate, isFile, + isReactNativeBlob, + isReactNative, isBlob, isRegExp, isFunction: isFunction$1, @@ -52093,11 +52689,358 @@ var require_axios = __commonJS({ asap, isIterable }; + var ignoreDuplicateOf = utils$1.toObjectSet(["age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent"]); + var parseHeaders = (rawHeaders) => { + const parsed = {}; + let key; + let val; + let i; + rawHeaders && rawHeaders.split("\n").forEach(function parser(line) { + i = line.indexOf(":"); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + if (!key || parsed[key] && ignoreDuplicateOf[key]) { + return; + } + if (key === "set-cookie") { + if (parsed[key]) { + parsed[key].push(val); + } else { + parsed[key] = [val]; + } + } else { + parsed[key] = parsed[key] ? parsed[key] + ", " + val : val; + } + }); + return parsed; + }; + function trimSPorHTAB(str) { + let start = 0; + let end = str.length; + while (start < end) { + const code = str.charCodeAt(start); + if (code !== 9 && code !== 32) { + break; + } + start += 1; + } + while (end > start) { + const code = str.charCodeAt(end - 1); + if (code !== 9 && code !== 32) { + break; + } + end -= 1; + } + return start === 0 && end === str.length ? str : str.slice(start, end); + } + var INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+", "g"); + var INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+", "g"); + function sanitizeValue(value, invalidChars) { + if (utils$1.isArray(value)) { + return value.map((item) => sanitizeValue(item, invalidChars)); + } + return trimSPorHTAB(String(value).replace(invalidChars, "")); + } + var sanitizeHeaderValue = (value) => sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS); + var sanitizeByteStringHeaderValue = (value) => sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS); + function toByteStringHeaderObject(headers) { + const byteStringHeaders = /* @__PURE__ */ Object.create(null); + utils$1.forEach(headers.toJSON(), (value, header) => { + byteStringHeaders[header] = sanitizeByteStringHeaderValue(value); + }); + return byteStringHeaders; + } + var $internals = Symbol("internals"); + function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); + } + function normalizeValue(value) { + if (value === false || value == null) { + return value; + } + return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value)); + } + function parseTokens(str) { + const tokens = /* @__PURE__ */ Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + while (match = tokensRE.exec(str)) { + tokens[match[1]] = match[2]; + } + return tokens; + } + var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); + function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (utils$1.isFunction(filter)) { + return filter.call(this, value, header); + } + if (isHeaderNameFilter) { + value = header; + } + if (!utils$1.isString(value)) return; + if (utils$1.isString(filter)) { + return value.indexOf(filter) !== -1; + } + if (utils$1.isRegExp(filter)) { + return filter.test(value); + } + } + function formatHeader(header) { + return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { + return char.toUpperCase() + str; + }); + } + function buildAccessors(obj, header) { + const accessorName = utils$1.toCamelCase(" " + header); + ["get", "set", "has"].forEach((methodName) => { + Object.defineProperty(obj, methodName + accessorName, { + // Null-proto descriptor so a polluted Object.prototype.get cannot turn + // this data descriptor into an accessor descriptor on the way in. + __proto__: null, + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); + } + var AxiosHeaders = class { + constructor(headers) { + headers && this.set(headers); + } + set(header, valueOrRewrite, rewrite) { + const self2 = this; + function setHeader(_value, _header, _rewrite) { + const lHeader = normalizeHeader(_header); + if (!lHeader) { + return; + } + const key = utils$1.findKey(self2, lHeader); + if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) { + self2[key || _header] = normalizeValue(_value); + } + } + const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); + if (utils$1.isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite); + } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders(parseHeaders(header), valueOrRewrite); + } else if (utils$1.isObject(header) && utils$1.isIterable(header)) { + let obj = {}, dest, key; + for (const entry of header) { + if (!utils$1.isArray(entry)) { + throw new TypeError("Object iterator must return a key-value pair"); + } + obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1]; + } + setHeaders(obj, valueOrRewrite); + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); + } + return this; + } + get(header, parser) { + header = normalizeHeader(header); + if (header) { + const key = utils$1.findKey(this, header); + if (key) { + const value = this[key]; + if (!parser) { + return value; + } + if (parser === true) { + return parseTokens(value); + } + if (utils$1.isFunction(parser)) { + return parser.call(this, value, key); + } + if (utils$1.isRegExp(parser)) { + return parser.exec(value); + } + throw new TypeError("parser must be boolean|regexp|function"); + } + } + } + has(header, matcher) { + header = normalizeHeader(header); + if (header) { + const key = utils$1.findKey(this, header); + return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + } + return false; + } + delete(header, matcher) { + const self2 = this; + let deleted = false; + function deleteHeader(_header) { + _header = normalizeHeader(_header); + if (_header) { + const key = utils$1.findKey(self2, _header); + if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) { + delete self2[key]; + deleted = true; + } + } + } + if (utils$1.isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); + } + return deleted; + } + clear(matcher) { + const keys = Object.keys(this); + let i = keys.length; + let deleted = false; + while (i--) { + const key = keys[i]; + if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } + } + return deleted; + } + normalize(format) { + const self2 = this; + const headers = {}; + utils$1.forEach(this, (value, header) => { + const key = utils$1.findKey(headers, header); + if (key) { + self2[key] = normalizeValue(value); + delete self2[header]; + return; + } + const normalized = format ? formatHeader(header) : String(header).trim(); + if (normalized !== header) { + delete self2[header]; + } + self2[normalized] = normalizeValue(value); + headers[normalized] = true; + }); + return this; + } + concat(...targets) { + return this.constructor.concat(this, ...targets); + } + toJSON(asStrings) { + const obj = /* @__PURE__ */ Object.create(null); + utils$1.forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value); + }); + return obj; + } + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n"); + } + getSetCookie() { + return this.get("set-cookie") || []; + } + get [Symbol.toStringTag]() { + return "AxiosHeaders"; + } + static from(thing) { + return thing instanceof this ? thing : new this(thing); + } + static concat(first, ...targets) { + const computed = new this(first); + targets.forEach((target) => computed.set(target)); + return computed; + } + static accessor(header) { + const internals = this[$internals] = this[$internals] = { + accessors: {} + }; + const accessors = internals.accessors; + const prototype2 = this.prototype; + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + if (!accessors[lHeader]) { + buildAccessors(prototype2, _header); + accessors[lHeader] = true; + } + } + utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + return this; + } + }; + AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]); + utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ + value + }, key) => { + let mapped = key[0].toUpperCase() + key.slice(1); + return { + get: () => value, + set(headerValue) { + this[mapped] = headerValue; + } + }; + }); + utils$1.freezeMethods(AxiosHeaders); + var REDACTED = "[REDACTED ****]"; + function hasOwnOrPrototypeToJSON(source) { + if (utils$1.hasOwnProp(source, "toJSON")) { + return true; + } + let prototype2 = Object.getPrototypeOf(source); + while (prototype2 && prototype2 !== Object.prototype) { + if (utils$1.hasOwnProp(prototype2, "toJSON")) { + return true; + } + prototype2 = Object.getPrototypeOf(prototype2); + } + return false; + } + function redactConfig(config, redactKeys) { + const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase())); + const seen = []; + const visit = (source) => { + if (source === null || typeof source !== "object") return source; + if (utils$1.isBuffer(source)) return source; + if (seen.indexOf(source) !== -1) return void 0; + if (source instanceof AxiosHeaders) { + source = source.toJSON(); + } + seen.push(source); + let result; + if (utils$1.isArray(source)) { + result = []; + source.forEach((v, i) => { + const reducedValue = visit(v); + if (!utils$1.isUndefined(reducedValue)) { + result[i] = reducedValue; + } + }); + } else { + if (!utils$1.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) { + seen.pop(); + return source; + } + result = /* @__PURE__ */ Object.create(null); + for (const [key, value] of Object.entries(source)) { + const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value); + if (!utils$1.isUndefined(reducedValue)) { + result[key] = reducedValue; + } + } + } + seen.pop(); + return result; + }; + return visit(config); + } var AxiosError = class _AxiosError extends Error { static from(error2, code, config, request, response, customProps) { const axiosError = new _AxiosError(error2.message, code || error2.code, config, request, response); axiosError.cause = error2; axiosError.name = error2.name; + if (error2.status != null && axiosError.status == null) { + axiosError.status = error2.status; + } customProps && Object.assign(axiosError, customProps); return axiosError; } @@ -52114,6 +53057,15 @@ var require_axios = __commonJS({ */ constructor(message, code, config, request, response) { super(message); + Object.defineProperty(this, "message", { + // Null-proto descriptor so a polluted Object.prototype.get cannot turn + // this data descriptor into an accessor descriptor on the way in. + __proto__: null, + value: message, + enumerable: true, + writable: true, + configurable: true + }); this.name = "AxiosError"; this.isAxiosError = true; code && (this.code = code); @@ -52125,6 +53077,9 @@ var require_axios = __commonJS({ } } toJSON() { + const config = this.config; + const redactKeys = config && utils$1.hasOwnProp(config, "redact") ? config.redact : void 0; + const serializedConfig = utils$1.isArray(redactKeys) && redactKeys.length > 0 ? redactConfig(config, redactKeys) : utils$1.toJSONObject(config); return { // Standard message: this.message, @@ -52138,7 +53093,7 @@ var require_axios = __commonJS({ columnNumber: this.columnNumber, stack: this.stack, // Axios - config: utils$1.toJSONObject(this.config), + config: serializedConfig, code: this.code, status: this.status }; @@ -52148,6 +53103,7 @@ var require_axios = __commonJS({ AxiosError.ERR_BAD_OPTION = "ERR_BAD_OPTION"; AxiosError.ECONNABORTED = "ECONNABORTED"; AxiosError.ETIMEDOUT = "ETIMEDOUT"; + AxiosError.ECONNREFUSED = "ECONNREFUSED"; AxiosError.ERR_NETWORK = "ERR_NETWORK"; AxiosError.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS"; AxiosError.ERR_DEPRECATED = "ERR_DEPRECATED"; @@ -52156,16 +53112,16 @@ var require_axios = __commonJS({ AxiosError.ERR_CANCELED = "ERR_CANCELED"; AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT"; AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL"; - var AxiosError$1 = AxiosError; + AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED"; function isVisitable(thing) { return utils$1.isPlainObject(thing) || utils$1.isArray(thing); } function removeBrackets(key) { return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key; } - function renderKey(path, key, dots) { - if (!path) return key; - return path.concat(key).map(function each(token, i) { + function renderKey(path2, key, dots) { + if (!path2) return key; + return path2.concat(key).map(function each(token, i) { token = removeBrackets(token); return !dots && i ? "[" + token + "]" : token; }).join(dots ? "." : ""); @@ -52180,7 +53136,7 @@ var require_axios = __commonJS({ if (!utils$1.isObject(obj)) { throw new TypeError("target must be an object"); } - formData = formData || new (FormData__default["default"] || FormData)(); + formData = formData || new (FormData$1 || FormData)(); options = utils$1.toFlatObject(options, { metaTokens: true, dots: false, @@ -52193,6 +53149,7 @@ var require_axios = __commonJS({ const dots = options.dots; const indexes = options.indexes; const _Blob = options.Blob || typeof Blob !== "undefined" && Blob; + const maxDepth = options.maxDepth === void 0 ? 100 : options.maxDepth; const useBlob = _Blob && utils$1.isSpecCompliantForm(formData); if (!utils$1.isFunction(visitor)) { throw new TypeError("visitor must be a function"); @@ -52206,16 +53163,20 @@ var require_axios = __commonJS({ return value.toString(); } if (!useBlob && utils$1.isBlob(value)) { - throw new AxiosError$1("Blob is not supported. Use a Buffer instead."); + throw new AxiosError("Blob is not supported. Use a Buffer instead."); } if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value); } return value; } - function defaultVisitor(value, key, path) { + function defaultVisitor(value, key, path2) { let arr = value; - if (value && !path && typeof value === "object") { + if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) { + formData.append(renderKey(path2, key, dots), convertValue(value)); + return false; + } + if (value && !path2 && typeof value === "object") { if (utils$1.endsWith(key, "{}")) { key = metaTokens ? key : key.slice(0, -2); value = JSON.stringify(value); @@ -52234,7 +53195,7 @@ var require_axios = __commonJS({ if (isVisitable(value)) { return true; } - formData.append(renderKey(path, key, dots), convertValue(value)); + formData.append(renderKey(path2, key, dots), convertValue(value)); return false; } const stack = []; @@ -52243,22 +53204,19 @@ var require_axios = __commonJS({ convertValue, isVisitable }); - function build(value, path) { + function build(value, path2, depth = 0) { if (utils$1.isUndefined(value)) return; + if (depth > maxDepth) { + throw new AxiosError("Object is too deeply nested (" + depth + " levels). Max depth: " + maxDepth, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED); + } if (stack.indexOf(value) !== -1) { - throw Error("Circular reference detected in " + path.join(".")); + throw new Error("Circular reference detected in " + path2.join(".")); } stack.push(value); utils$1.forEach(value, function each(el, key) { - const result = !(utils$1.isUndefined(el) || el === null) && visitor.call( - formData, - el, - utils$1.isString(key) ? key.trim() : key, - path, - exposedHelpers - ); + const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path2, exposedHelpers); if (result === true) { - build(el, path ? path.concat(key) : [key]); + build(el, path2 ? path2.concat(key) : [key], depth + 1); } }); stack.pop(); @@ -52276,10 +53234,9 @@ var require_axios = __commonJS({ "(": "%28", ")": "%29", "~": "%7E", - "%20": "+", - "%00": "\0" + "%20": "+" }; - return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) { return charMap[match]; }); } @@ -52388,14 +53345,14 @@ var require_axios = __commonJS({ }); } }; - var InterceptorManager$1 = InterceptorManager; var transitionalDefaults = { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false, - legacyInterceptorReqResOrdering: true + legacyInterceptorReqResOrdering: true, + advertiseZstdAcceptEncoding: false }; - var URLSearchParams2 = url__default["default"].URLSearchParams; + var URLSearchParams2 = url.URLSearchParams; var ALPHA = "abcdefghijklmnopqrstuvwxyz"; var DIGIT = "0123456789"; var ALPHABET = { @@ -52405,9 +53362,11 @@ var require_axios = __commonJS({ }; var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { let str = ""; - const { length } = alphabet; + const { + length + } = alphabet; const randomValues = new Uint32Array(size); - crypto__default["default"].randomFillSync(randomValues); + crypto2.randomFillSync(randomValues); for (let i = 0; i < size; i++) { str += alphabet[randomValues[i] % length]; } @@ -52417,7 +53376,7 @@ var require_axios = __commonJS({ isNode: true, classes: { URLSearchParams: URLSearchParams2, - FormData: FormData__default["default"], + FormData: FormData$1, Blob: typeof Blob !== "undefined" && Blob || null }, ALPHABET, @@ -52435,8 +53394,8 @@ var require_axios = __commonJS({ var utils = /* @__PURE__ */ Object.freeze({ __proto__: null, hasBrowserEnv, - hasStandardBrowserWebWorkerEnv, hasStandardBrowserEnv, + hasStandardBrowserWebWorkerEnv, navigator: _navigator, origin }); @@ -52446,7 +53405,7 @@ var require_axios = __commonJS({ }; function toURLEncodedForm(data, options) { return toFormData(data, new platform2.classes.URLSearchParams(), { - visitor: function(value, key, path, helpers) { + visitor: function(value, key, path2, helpers) { if (platform2.isNode && utils$1.isBuffer(value)) { this.append(key, value.toString("base64")); return false; @@ -52474,24 +53433,24 @@ var require_axios = __commonJS({ return obj; } function formDataToJSON(formData) { - function buildPath(path, value, target, index) { - let name = path[index++]; + function buildPath(path2, value, target, index) { + let name = path2[index++]; if (name === "__proto__") return true; const isNumericKey = Number.isFinite(+name); - const isLast = index >= path.length; + const isLast = index >= path2.length; name = !name && utils$1.isArray(target) ? target.length : name; if (isLast) { if (utils$1.hasOwnProp(target, name)) { - target[name] = [target[name], value]; + target[name] = utils$1.isArray(target[name]) ? target[name].concat(value) : [target[name], value]; } else { target[name] = value; } return !isNumericKey; } - if (!target[name] || !utils$1.isObject(target[name])) { + if (!utils$1.hasOwnProp(target, name) || !utils$1.isObject(target[name])) { target[name] = []; } - const result = buildPath(path, value, target[name], index); + const result = buildPath(path2, value, target[name], index); if (result && utils$1.isArray(target[name])) { target[name] = arrayToObject(target[name]); } @@ -52506,6 +53465,7 @@ var require_axios = __commonJS({ } return null; } + var own = (obj, key) => obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : void 0; function stringifySafely(rawValue, parser, encoder) { if (utils$1.isString(rawValue)) { try { @@ -52545,16 +53505,16 @@ var require_axios = __commonJS({ } let isFileList2; if (isObjectPayload) { + const formSerializer = own(this, "formSerializer"); if (contentType.indexOf("application/x-www-form-urlencoded") > -1) { - return toURLEncodedForm(data, this.formSerializer).toString(); + return toURLEncodedForm(data, formSerializer).toString(); } if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) { - const _FormData = this.env && this.env.FormData; - return toFormData( - isFileList2 ? { "files[]": data } : data, - _FormData && new _FormData(), - this.formSerializer - ); + const env = own(this, "env"); + const _FormData = env && env.FormData; + return toFormData(isFileList2 ? { + "files[]": data + } : data, _FormData && new _FormData(), formSerializer); } } if (isObjectPayload || hasJSONContentType) { @@ -52564,21 +53524,22 @@ var require_axios = __commonJS({ return data; }], transformResponse: [function transformResponse(data) { - const transitional = this.transitional || defaults.transitional; + const transitional = own(this, "transitional") || defaults.transitional; const forcedJSONParsing = transitional && transitional.forcedJSONParsing; - const JSONRequested = this.responseType === "json"; + const responseType = own(this, "responseType"); + const JSONRequested = responseType === "json"; if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) { return data; } - if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) { + if (data && utils$1.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) { const silentJSONParsing = transitional && transitional.silentJSONParsing; const strictJSONParsing = !silentJSONParsing && JSONRequested; try { - return JSON.parse(data, this.parseReviver); + return JSON.parse(data, own(this, "parseReviver")); } catch (e) { if (strictJSONParsing) { if (e.name === "SyntaxError") { - throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response); + throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, "response")); } throw e; } @@ -52604,289 +53565,18 @@ var require_axios = __commonJS({ }, headers: { common: { - "Accept": "application/json, text/plain, */*", + Accept: "application/json, text/plain, */*", "Content-Type": void 0 } } }; - utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => { + utils$1.forEach(["delete", "get", "head", "post", "put", "patch", "query"], (method) => { defaults.headers[method] = {}; }); - var defaults$1 = defaults; - var ignoreDuplicateOf = utils$1.toObjectSet([ - "age", - "authorization", - "content-length", - "content-type", - "etag", - "expires", - "from", - "host", - "if-modified-since", - "if-unmodified-since", - "last-modified", - "location", - "max-forwards", - "proxy-authorization", - "referer", - "retry-after", - "user-agent" - ]); - var parseHeaders = (rawHeaders) => { - const parsed = {}; - let key; - let val; - let i; - rawHeaders && rawHeaders.split("\n").forEach(function parser(line) { - i = line.indexOf(":"); - key = line.substring(0, i).trim().toLowerCase(); - val = line.substring(i + 1).trim(); - if (!key || parsed[key] && ignoreDuplicateOf[key]) { - return; - } - if (key === "set-cookie") { - if (parsed[key]) { - parsed[key].push(val); - } else { - parsed[key] = [val]; - } - } else { - parsed[key] = parsed[key] ? parsed[key] + ", " + val : val; - } - }); - return parsed; - }; - var $internals = Symbol("internals"); - function normalizeHeader(header) { - return header && String(header).trim().toLowerCase(); - } - function normalizeValue(value) { - if (value === false || value == null) { - return value; - } - return utils$1.isArray(value) ? value.map(normalizeValue) : String(value); - } - function parseTokens(str) { - const tokens = /* @__PURE__ */ Object.create(null); - const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; - let match; - while (match = tokensRE.exec(str)) { - tokens[match[1]] = match[2]; - } - return tokens; - } - var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); - function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { - if (utils$1.isFunction(filter)) { - return filter.call(this, value, header); - } - if (isHeaderNameFilter) { - value = header; - } - if (!utils$1.isString(value)) return; - if (utils$1.isString(filter)) { - return value.indexOf(filter) !== -1; - } - if (utils$1.isRegExp(filter)) { - return filter.test(value); - } - } - function formatHeader(header) { - return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { - return char.toUpperCase() + str; - }); - } - function buildAccessors(obj, header) { - const accessorName = utils$1.toCamelCase(" " + header); - ["get", "set", "has"].forEach((methodName) => { - Object.defineProperty(obj, methodName + accessorName, { - value: function(arg1, arg2, arg3) { - return this[methodName].call(this, header, arg1, arg2, arg3); - }, - configurable: true - }); - }); - } - var AxiosHeaders = class { - constructor(headers) { - headers && this.set(headers); - } - set(header, valueOrRewrite, rewrite) { - const self2 = this; - function setHeader(_value, _header, _rewrite) { - const lHeader = normalizeHeader(_header); - if (!lHeader) { - throw new Error("header name must be a non-empty string"); - } - const key = utils$1.findKey(self2, lHeader); - if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) { - self2[key || _header] = normalizeValue(_value); - } - } - const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); - if (utils$1.isPlainObject(header) || header instanceof this.constructor) { - setHeaders(header, valueOrRewrite); - } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { - setHeaders(parseHeaders(header), valueOrRewrite); - } else if (utils$1.isObject(header) && utils$1.isIterable(header)) { - let obj = {}, dest, key; - for (const entry of header) { - if (!utils$1.isArray(entry)) { - throw TypeError("Object iterator must return a key-value pair"); - } - obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1]; - } - setHeaders(obj, valueOrRewrite); - } else { - header != null && setHeader(valueOrRewrite, header, rewrite); - } - return this; - } - get(header, parser) { - header = normalizeHeader(header); - if (header) { - const key = utils$1.findKey(this, header); - if (key) { - const value = this[key]; - if (!parser) { - return value; - } - if (parser === true) { - return parseTokens(value); - } - if (utils$1.isFunction(parser)) { - return parser.call(this, value, key); - } - if (utils$1.isRegExp(parser)) { - return parser.exec(value); - } - throw new TypeError("parser must be boolean|regexp|function"); - } - } - } - has(header, matcher) { - header = normalizeHeader(header); - if (header) { - const key = utils$1.findKey(this, header); - return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher))); - } - return false; - } - delete(header, matcher) { - const self2 = this; - let deleted = false; - function deleteHeader(_header) { - _header = normalizeHeader(_header); - if (_header) { - const key = utils$1.findKey(self2, _header); - if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) { - delete self2[key]; - deleted = true; - } - } - } - if (utils$1.isArray(header)) { - header.forEach(deleteHeader); - } else { - deleteHeader(header); - } - return deleted; - } - clear(matcher) { - const keys = Object.keys(this); - let i = keys.length; - let deleted = false; - while (i--) { - const key = keys[i]; - if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { - delete this[key]; - deleted = true; - } - } - return deleted; - } - normalize(format) { - const self2 = this; - const headers = {}; - utils$1.forEach(this, (value, header) => { - const key = utils$1.findKey(headers, header); - if (key) { - self2[key] = normalizeValue(value); - delete self2[header]; - return; - } - const normalized = format ? formatHeader(header) : String(header).trim(); - if (normalized !== header) { - delete self2[header]; - } - self2[normalized] = normalizeValue(value); - headers[normalized] = true; - }); - return this; - } - concat(...targets) { - return this.constructor.concat(this, ...targets); - } - toJSON(asStrings) { - const obj = /* @__PURE__ */ Object.create(null); - utils$1.forEach(this, (value, header) => { - value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value); - }); - return obj; - } - [Symbol.iterator]() { - return Object.entries(this.toJSON())[Symbol.iterator](); - } - toString() { - return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n"); - } - getSetCookie() { - return this.get("set-cookie") || []; - } - get [Symbol.toStringTag]() { - return "AxiosHeaders"; - } - static from(thing) { - return thing instanceof this ? thing : new this(thing); - } - static concat(first, ...targets) { - const computed = new this(first); - targets.forEach((target) => computed.set(target)); - return computed; - } - static accessor(header) { - const internals = this[$internals] = this[$internals] = { - accessors: {} - }; - const accessors = internals.accessors; - const prototype2 = this.prototype; - function defineAccessor(_header) { - const lHeader = normalizeHeader(_header); - if (!accessors[lHeader]) { - buildAccessors(prototype2, _header); - accessors[lHeader] = true; - } - } - utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); - return this; - } - }; - AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]); - utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => { - let mapped = key[0].toUpperCase() + key.slice(1); - return { - get: () => value, - set(headerValue) { - this[mapped] = headerValue; - } - }; - }); - utils$1.freezeMethods(AxiosHeaders); - var AxiosHeaders$1 = AxiosHeaders; function transformData(fns, response) { - const config = this || defaults$1; + const config = this || defaults; const context = response || config; - const headers = AxiosHeaders$1.from(context.headers); + const headers = AxiosHeaders.from(context.headers); let data = context.data; utils$1.forEach(fns, function transform(fn) { data = fn.call(config, data, headers.normalize(), response ? response.status : void 0); @@ -52897,7 +53587,7 @@ var require_axios = __commonJS({ function isCancel(value) { return !!(value && value.__CANCEL__); } - var CanceledError = class extends AxiosError$1 { + var CanceledError = class extends AxiosError { /** * A `CanceledError` is an object that is thrown when an operation is canceled. * @@ -52908,24 +53598,17 @@ var require_axios = __commonJS({ * @returns {CanceledError} The created error. */ constructor(message, config, request) { - super(message == null ? "canceled" : message, AxiosError$1.ERR_CANCELED, config, request); + super(message == null ? "canceled" : message, AxiosError.ERR_CANCELED, config, request); this.name = "CanceledError"; this.__CANCEL__ = true; } }; - var CanceledError$1 = CanceledError; function settle(resolve, reject, response) { const validateStatus = response.config.validateStatus; if (!response.status || !validateStatus || validateStatus(response.status)) { resolve(response); } else { - reject(new AxiosError$1( - "Request failed with status code " + response.status, - [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], - response.config, - response.request, - response - )); + reject(new AxiosError("Request failed with status code " + response.status, response.status >= 400 && response.status < 500 ? AxiosError.ERR_BAD_REQUEST : AxiosError.ERR_BAD_RESPONSE, response.config, response.request, response)); } } function isAbsoluteURL(url2) { @@ -52939,17 +53622,82 @@ var require_axios = __commonJS({ } function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { let isRelativeUrl = !isAbsoluteURL(requestedURL); - if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) { + if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) { return combineURLs(baseURL, requestedURL); } return requestedURL; } - var VERSION = "1.13.5"; + var DEFAULT_PORTS$1 = { + ftp: 21, + gopher: 70, + http: 80, + https: 443, + ws: 80, + wss: 443 + }; + function parseUrl(urlString) { + try { + return new URL(urlString); + } catch { + return null; + } + } + function getProxyForUrl(url2) { + var parsedUrl = (typeof url2 === "string" ? parseUrl(url2) : url2) || {}; + var proto = parsedUrl.protocol; + var hostname = parsedUrl.host; + var port = parsedUrl.port; + if (typeof hostname !== "string" || !hostname || typeof proto !== "string") { + return ""; + } + proto = proto.split(":", 1)[0]; + hostname = hostname.replace(/:\d*$/, ""); + port = parseInt(port) || DEFAULT_PORTS$1[proto] || 0; + if (!shouldProxy(hostname, port)) { + return ""; + } + var proxy = getEnv(proto + "_proxy") || getEnv("all_proxy"); + if (proxy && proxy.indexOf("://") === -1) { + proxy = proto + "://" + proxy; + } + return proxy; + } + function shouldProxy(hostname, port) { + var NO_PROXY = getEnv("no_proxy").toLowerCase(); + if (!NO_PROXY) { + return true; + } + if (NO_PROXY === "*") { + return false; + } + return NO_PROXY.split(/[,\s]/).every(function(proxy) { + if (!proxy) { + return true; + } + var parsedProxy = proxy.match(/^(.+):(\d+)$/); + var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy; + var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0; + if (parsedProxyPort && parsedProxyPort !== port) { + return true; + } + if (!/^[.*]/.test(parsedProxyHostname)) { + return hostname !== parsedProxyHostname; + } + if (parsedProxyHostname.charAt(0) === "*") { + parsedProxyHostname = parsedProxyHostname.slice(1); + } + return !hostname.endsWith(parsedProxyHostname); + }); + } + function getEnv(key) { + return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || ""; + } + var VERSION = "1.17.0"; function parseProtocol(url2) { - const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2); + const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url2); return match && match[1] || ""; } - var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/; + var DATA_URL_PATTERN = /^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/; function fromDataURI(uri, asBlob, options) { const _Blob = options && options.Blob || platform2.classes.Blob; const protocol = parseProtocol(uri); @@ -52960,24 +53708,33 @@ var require_axios = __commonJS({ uri = protocol.length ? uri.slice(protocol.length + 1) : uri; const match = DATA_URL_PATTERN.exec(uri); if (!match) { - throw new AxiosError$1("Invalid URL", AxiosError$1.ERR_INVALID_URL); - } - const mime = match[1]; - const isBase64 = match[2]; - const body = match[3]; - const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? "base64" : "utf8"); + throw new AxiosError("Invalid URL", AxiosError.ERR_INVALID_URL); + } + const type = match[1]; + const params = match[2]; + const encoding = match[3] ? "base64" : "utf8"; + const body = match[4]; + let mime; + if (type) { + mime = params ? type + params : type; + } else if (params) { + mime = "text/plain" + params; + } + const buffer = Buffer.from(decodeURIComponent(body), encoding); if (asBlob) { if (!_Blob) { - throw new AxiosError$1("Blob is not supported", AxiosError$1.ERR_NOT_SUPPORT); + throw new AxiosError("Blob is not supported", AxiosError.ERR_NOT_SUPPORT); } - return new _Blob([buffer], { type: mime }); + return new _Blob([buffer], { + type: mime + }); } return buffer; } - throw new AxiosError$1("Unsupported protocol " + protocol, AxiosError$1.ERR_NOT_SUPPORT); + throw new AxiosError("Unsupported protocol " + protocol, AxiosError.ERR_NOT_SUPPORT); } var kInternals = Symbol("internals"); - var AxiosTransformStream = class extends stream__default["default"].Transform { + var AxiosTransformStream = class extends stream.Transform { constructor(options) { options = utils$1.toFlatObject(options, { maxRate: 0, @@ -53087,8 +53844,9 @@ var require_axios = __commonJS({ }); } }; - var AxiosTransformStream$1 = AxiosTransformStream; - var { asyncIterator } = Symbol; + var { + asyncIterator + } = Symbol; var readBlob = async function* (blob) { if (blob.stream) { yield* blob.stream(); @@ -53100,21 +53858,23 @@ var require_axios = __commonJS({ yield blob; } }; - var readBlob$1 = readBlob; var BOUNDARY_ALPHABET = platform2.ALPHABET.ALPHA_DIGIT + "-_"; - var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new util__default["default"].TextEncoder(); + var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new util.TextEncoder(); var CRLF = "\r\n"; var CRLF_BYTES = textEncoder.encode(CRLF); var CRLF_BYTES_COUNT = 2; var FormDataPart = class { constructor(name, value) { - const { escapeName } = this.constructor; + const { + escapeName + } = this.constructor; const isStringValue = utils$1.isString(value); let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${!isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ""}${CRLF}`; if (isStringValue) { value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF)); } else { - headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`; + const safeType = String(value.type || "application/octet-stream").replace(/[\r\n]/g, ""); + headers += `Content-Type: ${safeType}${CRLF}`; } this.headers = textEncoder.encode(headers + CRLF); this.contentLength = isStringValue ? value.byteLength : value.size; @@ -53124,11 +53884,13 @@ var require_axios = __commonJS({ } async *encode() { yield this.headers; - const { value } = this; + const { + value + } = this; if (utils$1.isTypedArray(value)) { yield value; } else { - yield* readBlob$1(value); + yield* readBlob(value); } yield CRLF_BYTES; } @@ -53147,10 +53909,10 @@ var require_axios = __commonJS({ boundary = tag + "-" + platform2.generateString(size, BOUNDARY_ALPHABET) } = options || {}; if (!utils$1.isFormData(form)) { - throw TypeError("FormData instance required"); + throw new TypeError("FormData instance required"); } if (boundary.length < 1 || boundary.length > 70) { - throw Error("boundary must be 10-70 characters long"); + throw new Error("boundary must be 1-70 characters long"); } const boundaryBytes = textEncoder.encode("--" + boundary + CRLF); const footerBytes = textEncoder.encode("--" + boundary + "--" + CRLF); @@ -53177,8 +53939,7 @@ var require_axios = __commonJS({ yield footerBytes; }()); }; - var formDataToStream$1 = formDataToStream; - var ZlibHeaderTransformStream = class extends stream__default["default"].Transform { + var ZlibHeaderTransformStream = class extends stream.Transform { __transform(chunk, encoding, callback) { this.push(chunk); callback(); @@ -53196,7 +53957,81 @@ var require_axios = __commonJS({ this.__transform(chunk, encoding, callback); } }; - var ZlibHeaderTransformStream$1 = ZlibHeaderTransformStream; + var Http2Sessions = class { + constructor() { + this.sessions = /* @__PURE__ */ Object.create(null); + } + getSession(authority, options) { + options = Object.assign({ + sessionTimeout: 1e3 + }, options); + let authoritySessions = this.sessions[authority]; + if (authoritySessions) { + let len = authoritySessions.length; + for (let i = 0; i < len; i++) { + const [sessionHandle, sessionOptions] = authoritySessions[i]; + if (!sessionHandle.destroyed && !sessionHandle.closed && util.isDeepStrictEqual(sessionOptions, options)) { + return sessionHandle; + } + } + } + const session = http2.connect(authority, options); + let removed; + let timer; + const removeSession = () => { + if (removed) { + return; + } + removed = true; + if (timer) { + clearTimeout(timer); + timer = null; + } + let entries = authoritySessions, len = entries.length, i = len; + while (i--) { + if (entries[i][0] === session) { + if (len === 1) { + delete this.sessions[authority]; + } else { + entries.splice(i, 1); + } + if (!session.closed) { + session.close(); + } + return; + } + } + }; + const originalRequestFn = session.request; + const { + sessionTimeout + } = options; + if (sessionTimeout != null) { + let streamsCount = 0; + session.request = function() { + const stream2 = originalRequestFn.apply(this, arguments); + streamsCount++; + if (timer) { + clearTimeout(timer); + timer = null; + } + stream2.once("close", () => { + if (!--streamsCount) { + timer = setTimeout(() => { + timer = null; + removeSession(); + }, sessionTimeout); + } + }); + return stream2; + }; + } + session.once("close", removeSession); + let entry = [session, options]; + authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry]; + return session; + } + }; var callbackify = (fn, reducer) => { return utils$1.isAsyncFn(fn) ? function(...args) { const cb = args.pop(); @@ -53209,7 +54044,126 @@ var require_axios = __commonJS({ }, cb); } : fn; }; - var callbackify$1 = callbackify; + var LOOPBACK_HOSTNAMES = /* @__PURE__ */ new Set(["localhost"]); + var isIPv4Loopback = (host) => { + const parts = host.split("."); + if (parts.length !== 4) return false; + if (parts[0] !== "127") return false; + return parts.every((p) => /^\d+$/.test(p) && Number(p) >= 0 && Number(p) <= 255); + }; + var isIPv6Loopback = (host) => { + if (host === "::1") return true; + const v4MappedDotted = host.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i); + if (v4MappedDotted) return isIPv4Loopback(v4MappedDotted[1]); + const v4MappedHex = host.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i); + if (v4MappedHex) { + const high = parseInt(v4MappedHex[1], 16); + return high >= 32512 && high <= 32767; + } + const groups = host.split(":"); + if (groups.length === 8) { + for (let i = 0; i < 7; i++) { + if (!/^0+$/.test(groups[i])) return false; + } + return /^0*1$/.test(groups[7]); + } + return false; + }; + var isLoopback = (host) => { + if (!host) return false; + if (LOOPBACK_HOSTNAMES.has(host)) return true; + if (isIPv4Loopback(host)) return true; + return isIPv6Loopback(host); + }; + var DEFAULT_PORTS = { + http: 80, + https: 443, + ws: 80, + wss: 443, + ftp: 21 + }; + var parseNoProxyEntry = (entry) => { + let entryHost = entry; + let entryPort = 0; + if (entryHost.charAt(0) === "[") { + const bracketIndex = entryHost.indexOf("]"); + if (bracketIndex !== -1) { + const host = entryHost.slice(1, bracketIndex); + const rest = entryHost.slice(bracketIndex + 1); + if (rest.charAt(0) === ":" && /^\d+$/.test(rest.slice(1))) { + entryPort = Number.parseInt(rest.slice(1), 10); + } + return [host, entryPort]; + } + } + const firstColon = entryHost.indexOf(":"); + const lastColon = entryHost.lastIndexOf(":"); + if (firstColon !== -1 && firstColon === lastColon && /^\d+$/.test(entryHost.slice(lastColon + 1))) { + entryPort = Number.parseInt(entryHost.slice(lastColon + 1), 10); + entryHost = entryHost.slice(0, lastColon); + } + return [entryHost, entryPort]; + }; + var IPV4_MAPPED_DOTTED_RE = /^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:(\d+\.\d+\.\d+\.\d+)$/i; + var IPV4_MAPPED_HEX_RE = /^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i; + var unmapIPv4MappedIPv6 = (host) => { + if (typeof host !== "string" || host.indexOf(":") === -1) return host; + const dotted = host.match(IPV4_MAPPED_DOTTED_RE); + if (dotted) return dotted[1]; + const hex = host.match(IPV4_MAPPED_HEX_RE); + if (hex) { + const high = parseInt(hex[1], 16); + const low = parseInt(hex[2], 16); + return `${high >> 8}.${high & 255}.${low >> 8}.${low & 255}`; + } + return host; + }; + var normalizeNoProxyHost = (hostname) => { + if (!hostname) { + return hostname; + } + if (hostname.charAt(0) === "[" && hostname.charAt(hostname.length - 1) === "]") { + hostname = hostname.slice(1, -1); + } + return unmapIPv4MappedIPv6(hostname.replace(/\.+$/, "")); + }; + function shouldBypassProxy(location2) { + let parsed; + try { + parsed = new URL(location2); + } catch (_err) { + return false; + } + const noProxy = (process.env.no_proxy || process.env.NO_PROXY || "").toLowerCase(); + if (!noProxy) { + return false; + } + if (noProxy === "*") { + return true; + } + const port = Number.parseInt(parsed.port, 10) || DEFAULT_PORTS[parsed.protocol.split(":", 1)[0]] || 0; + const hostname = normalizeNoProxyHost(parsed.hostname.toLowerCase()); + return noProxy.split(/[\s,]+/).some((entry) => { + if (!entry) { + return false; + } + let [entryHost, entryPort] = parseNoProxyEntry(entry); + entryHost = normalizeNoProxyHost(entryHost); + if (!entryHost) { + return false; + } + if (entryPort && entryPort !== port) { + return false; + } + if (entryHost.charAt(0) === "*") { + entryHost = entryHost.slice(1); + } + if (entryHost.charAt(0) === ".") { + return hostname.endsWith(entryHost); + } + return hostname === entryHost || isLoopback(hostname) && isLoopback(entryHost); + }); + } function speedometer(samplesCount, min) { samplesCount = samplesCount || 10; const bytes = new Array(samplesCount); @@ -53279,19 +54233,22 @@ var require_axios = __commonJS({ let bytesNotified = 0; const _speedometer = speedometer(50, 250); return throttle((e) => { - const loaded = e.loaded; + if (!e || typeof e.loaded !== "number") { + return; + } + const rawLoaded = e.loaded; const total = e.lengthComputable ? e.total : void 0; - const progressBytes = loaded - bytesNotified; + const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded; + const progressBytes = Math.max(0, loaded - bytesNotified); const rate = _speedometer(progressBytes); - const inRange = loaded <= total; - bytesNotified = loaded; + bytesNotified = Math.max(bytesNotified, loaded); const data = { loaded, total, progress: total ? loaded / total : void 0, bytes: progressBytes, rate: rate ? rate : void 0, - estimated: rate && total && inRange ? (total - loaded) / rate : void 0, + estimated: rate && total ? (total - loaded) / rate : void 0, event: e, lengthComputable: total != null, [isDownloadStream ? "download" : "upload"]: true @@ -53352,141 +54309,220 @@ var require_axios = __commonJS({ } } const groups = Math.floor(effectiveLen / 4); - const bytes = groups * 3 - (pad || 0); - return bytes > 0 ? bytes : 0; + const bytes2 = groups * 3 - (pad || 0); + return bytes2 > 0 ? bytes2 : 0; } - return Buffer.byteLength(body, "utf8"); + if (typeof Buffer !== "undefined" && typeof Buffer.byteLength === "function") { + return Buffer.byteLength(body, "utf8"); + } + let bytes = 0; + for (let i = 0, len = body.length; i < len; i++) { + const c = body.charCodeAt(i); + if (c < 128) { + bytes += 1; + } else if (c < 2048) { + bytes += 2; + } else if (c >= 55296 && c <= 56319 && i + 1 < len) { + const next = body.charCodeAt(i + 1); + if (next >= 56320 && next <= 57343) { + bytes += 4; + i++; + } else { + bytes += 3; + } + } else { + bytes += 3; + } + } + return bytes; } var zlibOptions = { - flush: zlib__default["default"].constants.Z_SYNC_FLUSH, - finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH + flush: zlib.constants.Z_SYNC_FLUSH, + finishFlush: zlib.constants.Z_SYNC_FLUSH }; var brotliOptions = { - flush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH, - finishFlush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH + flush: zlib.constants.BROTLI_OPERATION_FLUSH, + finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH }; - var isBrotliSupported = utils$1.isFunction(zlib__default["default"].createBrotliDecompress); - var { http: httpFollow, https: httpsFollow } = followRedirects__default["default"]; + var zstdOptions = { + flush: zlib.constants.ZSTD_e_flush, + finishFlush: zlib.constants.ZSTD_e_flush + }; + var isBrotliSupported = utils$1.isFunction(zlib.createBrotliDecompress); + var isZstdSupported = utils$1.isFunction(zlib.createZstdDecompress); + var ACCEPT_ENCODING = "gzip, compress, deflate" + (isBrotliSupported ? ", br" : ""); + var ACCEPT_ENCODING_WITH_ZSTD = ACCEPT_ENCODING + (isZstdSupported ? ", zstd" : ""); + var { + http: httpFollow, + https: httpsFollow + } = followRedirects; var isHttps = /https:?/; + var FORM_DATA_CONTENT_HEADERS$1 = ["content-type", "content-length"]; + function setFormDataHeaders$1(headers, formHeaders, policy) { + if (policy !== "content-only") { + headers.set(formHeaders); + return; + } + Object.entries(formHeaders).forEach(([key, val]) => { + if (FORM_DATA_CONTENT_HEADERS$1.includes(key.toLowerCase())) { + headers.set(key, val); + } + }); + } + var kAxiosSocketListener = Symbol("axios.http.socketListener"); + var kAxiosCurrentReq = Symbol("axios.http.currentReq"); + var kAxiosInstalledTunnel = Symbol("axios.http.installedTunnel"); + var tunnelingAgentCache = /* @__PURE__ */ new Map(); + var tunnelingAgentCacheUser = /* @__PURE__ */ new WeakMap(); + function getTunnelingAgent(agentOptions, userHttpsAgent) { + const key = agentOptions.protocol + "//" + agentOptions.hostname + ":" + (agentOptions.port || "") + "#" + (agentOptions.auth || ""); + const cache = userHttpsAgent ? tunnelingAgentCacheUser.get(userHttpsAgent) || tunnelingAgentCacheUser.set(userHttpsAgent, /* @__PURE__ */ new Map()).get(userHttpsAgent) : tunnelingAgentCache; + let agent = cache.get(key); + if (agent) return agent; + const merged = userHttpsAgent && userHttpsAgent.options ? { + ...userHttpsAgent.options, + ...agentOptions + } : agentOptions; + agent = new HttpsProxyAgent(merged); + if (userHttpsAgent && userHttpsAgent.options) { + const originTLSOptions = { + ...userHttpsAgent.options + }; + const callback = agent.callback; + agent.callback = function axiosTunnelingAgentCallback(req, opts) { + return callback.call(this, req, { + ...originTLSOptions, + ...opts + }); + }; + } + agent[kAxiosInstalledTunnel] = true; + cache.set(key, agent); + return agent; + } var supportedProtocols = platform2.protocols.map((protocol) => { return protocol + ":"; }); + var decodeURIComponentSafe$1 = (value) => { + if (!utils$1.isString(value)) { + return value; + } + try { + return decodeURIComponent(value); + } catch (error2) { + return value; + } + }; var flushOnFinish = (stream2, [throttled, flush]) => { stream2.on("end", flush).on("error", flush); return throttled; }; - var Http2Sessions = class { - constructor() { - this.sessions = /* @__PURE__ */ Object.create(null); - } - getSession(authority, options) { - options = Object.assign({ - sessionTimeout: 1e3 - }, options); - let authoritySessions = this.sessions[authority]; - if (authoritySessions) { - let len = authoritySessions.length; - for (let i = 0; i < len; i++) { - const [sessionHandle, sessionOptions] = authoritySessions[i]; - if (!sessionHandle.destroyed && !sessionHandle.closed && util__default["default"].isDeepStrictEqual(sessionOptions, options)) { - return sessionHandle; - } - } - } - const session = http2__default["default"].connect(authority, options); - let removed; - const removeSession = () => { - if (removed) { - return; - } - removed = true; - let entries = authoritySessions, len = entries.length, i = len; - while (i--) { - if (entries[i][0] === session) { - if (len === 1) { - delete this.sessions[authority]; - } else { - entries.splice(i, 1); - } - return; - } - } - }; - const originalRequestFn = session.request; - const { sessionTimeout } = options; - if (sessionTimeout != null) { - let timer; - let streamsCount = 0; - session.request = function() { - const stream2 = originalRequestFn.apply(this, arguments); - streamsCount++; - if (timer) { - clearTimeout(timer); - timer = null; - } - stream2.once("close", () => { - if (!--streamsCount) { - timer = setTimeout(() => { - timer = null; - removeSession(); - }, sessionTimeout); - } - }); - return stream2; - }; - } - session.once("close", removeSession); - let entry = [ - session, - options - ]; - authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry]; - return session; - } - }; var http2Sessions = new Http2Sessions(); - function dispatchBeforeRedirect(options, responseDetails) { + function dispatchBeforeRedirect(options, responseDetails, requestDetails) { if (options.beforeRedirects.proxy) { options.beforeRedirects.proxy(options); } + if (options.beforeRedirects.auth) { + options.beforeRedirects.auth(options); + } if (options.beforeRedirects.config) { - options.beforeRedirects.config(options, responseDetails); + options.beforeRedirects.config(options, responseDetails, requestDetails); } } - function setProxy(options, configProxy, location2) { + function setProxy(options, configProxy, location2, isRedirect, configHttpsAgent) { let proxy = configProxy; if (!proxy && proxy !== false) { - const proxyUrl = proxyFromEnv__default["default"].getProxyForUrl(location2); + const proxyUrl = getProxyForUrl(location2); if (proxyUrl) { - proxy = new URL(proxyUrl); + if (!shouldBypassProxy(location2)) { + proxy = new URL(proxyUrl); + } } } - if (proxy) { - if (proxy.username) { - proxy.auth = (proxy.username || "") + ":" + (proxy.password || ""); + if (isRedirect && options.headers) { + for (const name of Object.keys(options.headers)) { + if (name.toLowerCase() === "proxy-authorization") { + delete options.headers[name]; + } } - if (proxy.auth) { - const validProxyAuth = Boolean(proxy.auth.username || proxy.auth.password); + } + if (isRedirect && options.agent && options.agent[kAxiosInstalledTunnel]) { + options.agent = void 0; + } + if (proxy) { + const isProxyURL = proxy instanceof URL; + const readProxyField = (key) => isProxyURL || utils$1.hasOwnProp(proxy, key) ? proxy[key] : void 0; + const proxyUsername = readProxyField("username"); + const proxyPassword = readProxyField("password"); + let proxyAuth = utils$1.hasOwnProp(proxy, "auth") ? proxy.auth : void 0; + if (proxyUsername) { + proxyAuth = (proxyUsername || "") + ":" + (proxyPassword || ""); + } + if (proxyAuth) { + const authIsObject = typeof proxyAuth === "object"; + const authUsername = authIsObject && utils$1.hasOwnProp(proxyAuth, "username") ? proxyAuth.username : void 0; + const authPassword = authIsObject && utils$1.hasOwnProp(proxyAuth, "password") ? proxyAuth.password : void 0; + const validProxyAuth = Boolean(authUsername || authPassword); if (validProxyAuth) { - proxy.auth = (proxy.auth.username || "") + ":" + (proxy.auth.password || ""); - } else if (typeof proxy.auth === "object") { - throw new AxiosError$1("Invalid proxy authorization", AxiosError$1.ERR_BAD_OPTION, { proxy }); + proxyAuth = (authUsername || "") + ":" + (authPassword || ""); + } else if (authIsObject) { + throw new AxiosError("Invalid proxy authorization", AxiosError.ERR_BAD_OPTION, { + proxy + }); } - const base64 = Buffer.from(proxy.auth, "utf8").toString("base64"); - options.headers["Proxy-Authorization"] = "Basic " + base64; } - options.headers.host = options.hostname + (options.port ? ":" + options.port : ""); - const proxyHost = proxy.hostname || proxy.host; - options.hostname = proxyHost; - options.host = proxyHost; - options.port = proxy.port; - options.path = location2; - if (proxy.protocol) { - options.protocol = proxy.protocol.includes(":") ? proxy.protocol : `${proxy.protocol}:`; + const targetIsHttps = isHttps.test(options.protocol); + if (targetIsHttps) { + if (!(configHttpsAgent instanceof HttpsProxyAgent)) { + const proxyHost = readProxyField("hostname") || readProxyField("host"); + const proxyPort = readProxyField("port"); + const rawProxyProtocol = readProxyField("protocol"); + const normalizedProtocol = rawProxyProtocol ? rawProxyProtocol.includes(":") ? rawProxyProtocol : `${rawProxyProtocol}:` : "http:"; + const proxyHostForURL = proxyHost && proxyHost.includes(":") && !proxyHost.startsWith("[") ? `[${proxyHost}]` : proxyHost; + const proxyURL = new URL(`${normalizedProtocol}//${proxyHostForURL}${proxyPort ? ":" + proxyPort : ""}`); + const agentOptions = { + protocol: proxyURL.protocol, + hostname: proxyURL.hostname.replace(/^\[|\]$/g, ""), + port: proxyURL.port, + auth: proxyAuth && typeof proxyAuth === "string" ? proxyAuth : void 0 + }; + if (proxyURL.protocol === "https:") { + agentOptions.ALPNProtocols = ["http/1.1"]; + } + const tunnelingAgent = getTunnelingAgent(agentOptions, configHttpsAgent); + options.agent = tunnelingAgent; + if (options.agents) { + options.agents.https = tunnelingAgent; + } + } + } else { + if (proxyAuth) { + const base64 = Buffer.from(proxyAuth, "utf8").toString("base64"); + options.headers["Proxy-Authorization"] = "Basic " + base64; + } + let hasUserHostHeader = false; + for (const name of Object.keys(options.headers)) { + if (name.toLowerCase() === "host") { + hasUserHostHeader = true; + break; + } + } + if (!hasUserHostHeader) { + options.headers.host = options.hostname + (options.port ? ":" + options.port : ""); + } + const proxyHost = readProxyField("hostname") || readProxyField("host"); + options.hostname = proxyHost; + options.host = proxyHost; + options.port = readProxyField("port"); + options.path = location2; + const proxyProtocol = readProxyField("protocol"); + if (proxyProtocol) { + options.protocol = proxyProtocol.includes(":") ? proxyProtocol : `${proxyProtocol}:`; + } } } options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) { - setProxy(redirectOptions, configProxy, redirectOptions.href); + setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent); }; } var isHttpAdapterSupported = typeof process !== "undefined" && utils$1.kindOf(process) === "process"; @@ -53510,7 +54546,10 @@ var require_axios = __commonJS({ asyncExecutor(_resolve, _reject, (onDoneHandler) => onDone = onDoneHandler).catch(_reject); }); }; - var resolveFamily = ({ address, family }) => { + var resolveFamily = ({ + address, + family + }) => { if (!utils$1.isString(address)) { throw TypeError("address must be a string"); } @@ -53519,18 +54558,24 @@ var require_axios = __commonJS({ family: family || (address.indexOf(".") < 0 ? 6 : 4) }; }; - var buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : { address, family }); + var buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : { + address, + family + }); var http2Transport = { request(options, cb) { const authority = options.protocol + "//" + options.hostname + ":" + (options.port || (options.protocol === "https:" ? 443 : 80)); - const { http2Options, headers } = options; + const { + http2Options, + headers + } = options; const session = http2Sessions.getSession(authority, http2Options); const { HTTP2_HEADER_SCHEME, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_STATUS - } = http2__default["default"].constants; + } = http2.constants; const http2Headers = { [HTTP2_HEADER_SCHEME]: options.protocol.replace(":", ""), [HTTP2_HEADER_METHOD]: options.method, @@ -53554,12 +54599,21 @@ var require_axios = __commonJS({ }; var httpAdapter = isHttpAdapterSupported && function httpAdapter2(config) { return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) { - let { data, lookup, family, httpVersion = 1, http2Options } = config; - const { responseType, responseEncoding } = config; + const own2 = (key) => utils$1.hasOwnProp(config, key) ? config[key] : void 0; + const transitional = own2("transitional") || transitionalDefaults; + let data = own2("data"); + let lookup = own2("lookup"); + let family = own2("family"); + let httpVersion = own2("httpVersion"); + if (httpVersion === void 0) httpVersion = 1; + let http2Options = own2("http2Options"); + const responseType = own2("responseType"); + const responseEncoding = own2("responseEncoding"); const method = config.method.toUpperCase(); let isDone; let rejected = false; let req; + let connectPhaseTimer; httpVersion = +httpVersion; if (Number.isNaN(httpVersion)) { throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`); @@ -53569,7 +54623,7 @@ var require_axios = __commonJS({ } const isHttp2 = httpVersion === 2; if (lookup) { - const _lookup = callbackify$1(lookup, (value) => utils$1.isArray(value) ? value : [value]); + const _lookup = callbackify(lookup, (value) => utils$1.isArray(value) ? value : [value]); lookup = (hostname, opt, cb) => { _lookup(hostname, opt, (err, arg0, arg1) => { if (err) { @@ -53583,13 +54637,26 @@ var require_axios = __commonJS({ const abortEmitter = new events.EventEmitter(); function abort(reason) { try { - abortEmitter.emit("abort", !reason || reason.type ? new CanceledError$1(null, config, req) : reason); + abortEmitter.emit("abort", !reason || reason.type ? new CanceledError(null, config, req) : reason); } catch (err) { - console.warn("emit error", err); } } + function clearConnectPhaseTimer() { + if (connectPhaseTimer) { + clearTimeout(connectPhaseTimer); + connectPhaseTimer = null; + } + } + function createTimeoutError() { + let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded"; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + return new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, req); + } abortEmitter.once("abort", reject); const onFinished = () => { + clearConnectPhaseTimer(); if (config.cancelToken) { config.cancelToken.unsubscribe(abort); } @@ -53606,14 +54673,17 @@ var require_axios = __commonJS({ } onDone((response, isRejected) => { isDone = true; + clearConnectPhaseTimer(); if (isRejected) { rejected = true; onFinished(); return; } - const { data: data2 } = response; - if (data2 instanceof stream__default["default"].Readable || data2 instanceof stream__default["default"].Duplex) { - const offListeners = stream__default["default"].finished(data2, () => { + const { + data: data2 + } = response; + if (data2 instanceof stream.Readable || data2 instanceof stream.Duplex) { + const offListeners = stream.finished(data2, () => { offListeners(); onFinished(); }); @@ -53629,11 +54699,7 @@ var require_axios = __commonJS({ const dataUrl = String(config.url || fullPath || ""); const estimated = estimateDataURLDecodedBytes(dataUrl); if (estimated > config.maxContentLength) { - return reject(new AxiosError$1( - "maxContentLength size of " + config.maxContentLength + " exceeded", - AxiosError$1.ERR_BAD_RESPONSE, - config - )); + return reject(new AxiosError("maxContentLength size of " + config.maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config)); } } let convertedData; @@ -53650,7 +54716,7 @@ var require_axios = __commonJS({ Blob: config.env && config.env.Blob }); } catch (err) { - throw AxiosError$1.from(err, AxiosError$1.ERR_BAD_REQUEST, config); + throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config); } if (responseType === "text") { convertedData = convertedData.toString(responseEncoding); @@ -53658,42 +54724,41 @@ var require_axios = __commonJS({ convertedData = utils$1.stripBOM(convertedData); } } else if (responseType === "stream") { - convertedData = stream__default["default"].Readable.from(convertedData); + convertedData = stream.Readable.from(convertedData); } return settle(resolve, reject, { data: convertedData, status: 200, statusText: "OK", - headers: new AxiosHeaders$1(), + headers: new AxiosHeaders(), config }); } if (supportedProtocols.indexOf(protocol) === -1) { - return reject(new AxiosError$1( - "Unsupported protocol " + protocol, - AxiosError$1.ERR_BAD_REQUEST, - config - )); + return reject(new AxiosError("Unsupported protocol " + protocol, AxiosError.ERR_BAD_REQUEST, config)); } - const headers = AxiosHeaders$1.from(config.headers).normalize(); + const headers = AxiosHeaders.from(config.headers).normalize(); headers.set("User-Agent", "axios/" + VERSION, false); - const { onUploadProgress, onDownloadProgress } = config; + const { + onUploadProgress, + onDownloadProgress + } = config; const maxRate = config.maxRate; let maxUploadRate = void 0; let maxDownloadRate = void 0; if (utils$1.isSpecCompliantForm(data)) { const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i); - data = formDataToStream$1(data, (formHeaders) => { + data = formDataToStream(data, (formHeaders) => { headers.set(formHeaders); }, { tag: `axios-${VERSION}-boundary`, boundary: userBoundary && userBoundary[1] || void 0 }); - } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders)) { - headers.set(data.getHeaders()); + } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders) && data.getHeaders !== Object.prototype.getHeaders) { + setFormDataHeaders$1(headers, data.getHeaders(), own2("formDataHeaderPolicy")); if (!headers.hasContentLength()) { try { - const knownLength = await util__default["default"].promisify(data.getLength).call(data); + const knownLength = await util.promisify(data.getLength).call(data); Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength); } catch (e) { } @@ -53701,7 +54766,7 @@ var require_axios = __commonJS({ } 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)); + data = stream.Readable.from(readBlob(data)); } else if (data && !utils$1.isStream(data)) { if (Buffer.isBuffer(data)) ; else if (utils$1.isArrayBuffer(data)) { @@ -53709,19 +54774,11 @@ var require_axios = __commonJS({ } else if (utils$1.isString(data)) { data = Buffer.from(data, "utf-8"); } else { - return reject(new AxiosError$1( - "Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream", - AxiosError$1.ERR_BAD_REQUEST, - config - )); + return reject(new AxiosError("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream", AxiosError.ERR_BAD_REQUEST, config)); } headers.setContentLength(data.length, false); if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { - return reject(new AxiosError$1( - "Request body larger than maxBodyLength limit", - AxiosError$1.ERR_BAD_REQUEST, - config - )); + return reject(new AxiosError("Request body larger than maxBodyLength limit", AxiosError.ERR_BAD_REQUEST, config)); } } const contentLength = utils$1.toFiniteNumber(headers.getContentLength()); @@ -53733,38 +54790,31 @@ var require_axios = __commonJS({ } if (data && (onUploadProgress || maxUploadRate)) { if (!utils$1.isStream(data)) { - data = stream__default["default"].Readable.from(data, { objectMode: false }); + data = stream.Readable.from(data, { + objectMode: false + }); } - data = stream__default["default"].pipeline([data, new AxiosTransformStream$1({ + data = stream.pipeline([data, new AxiosTransformStream({ maxRate: utils$1.toFiniteNumber(maxUploadRate) })], utils$1.noop); - onUploadProgress && data.on("progress", flushOnFinish( - data, - progressEventDecorator( - contentLength, - progressEventReducer(asyncDecorator(onUploadProgress), false, 3) - ) - )); + onUploadProgress && data.on("progress", flushOnFinish(data, progressEventDecorator(contentLength, progressEventReducer(asyncDecorator(onUploadProgress), false, 3)))); } let auth = void 0; - if (config.auth) { - const username = config.auth.username || ""; - const password = config.auth.password || ""; + const configAuth = own2("auth"); + if (configAuth) { + const username = configAuth.username || ""; + const password = configAuth.password || ""; auth = username + ":" + password; } - if (!auth && parsed.username) { - const urlUsername = parsed.username; - const urlPassword = parsed.password; + if (!auth && (parsed.username || parsed.password)) { + const urlUsername = decodeURIComponentSafe$1(parsed.username); + const urlPassword = decodeURIComponentSafe$1(parsed.password); auth = urlUsername + ":" + urlPassword; } auth && headers.delete("authorization"); - let path; + let path$1; try { - path = buildURL( - parsed.pathname + parsed.search, - config.params, - config.paramsSerializer - ).replace(/^\?/, ""); + path$1 = buildURL(parsed.pathname + parsed.search, config.params, config.paramsSerializer).replace(/^\?/, ""); } catch (err) { const customErr = new Error(err.message); customErr.config = config; @@ -53772,47 +54822,77 @@ var require_axios = __commonJS({ customErr.exists = true; return reject(customErr); } - headers.set( - "Accept-Encoding", - "gzip, compress, deflate" + (isBrotliSupported ? ", br" : ""), - false - ); - const options = { - path, + headers.set("Accept-Encoding", utils$1.hasOwnProp(transitional, "advertiseZstdAcceptEncoding") && transitional.advertiseZstdAcceptEncoding === true ? ACCEPT_ENCODING_WITH_ZSTD : ACCEPT_ENCODING, false); + const options = Object.assign(/* @__PURE__ */ Object.create(null), { + path: path$1, method, - headers: headers.toJSON(), - agents: { http: config.httpAgent, https: config.httpsAgent }, + headers: toByteStringHeaderObject(headers), + agents: { + http: config.httpAgent, + https: config.httpsAgent + }, auth, protocol, family, beforeRedirect: dispatchBeforeRedirect, - beforeRedirects: {}, + beforeRedirects: /* @__PURE__ */ Object.create(null), http2Options - }; + }); !utils$1.isUndefined(lookup) && (options.lookup = lookup); - if (config.socketPath) { - options.socketPath = config.socketPath; + const socketPath = own2("socketPath"); + if (socketPath) { + if (typeof socketPath !== "string") { + return reject(new AxiosError("socketPath must be a string", AxiosError.ERR_BAD_OPTION_VALUE, config)); + } + const allowedSocketPaths = own2("allowedSocketPaths"); + if (allowedSocketPaths != null) { + const allowed = Array.isArray(allowedSocketPaths) ? allowedSocketPaths : [allowedSocketPaths]; + const resolvedSocket = path.resolve(socketPath); + const isAllowed = allowed.some((entry) => typeof entry === "string" && path.resolve(entry) === resolvedSocket); + if (!isAllowed) { + return reject(new AxiosError(`socketPath "${socketPath}" is not permitted by allowedSocketPaths`, AxiosError.ERR_BAD_OPTION_VALUE, config)); + } + } + options.socketPath = socketPath; } else { options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname; options.port = parsed.port; - setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path); + setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path, false, config.httpsAgent); } let transport; + let isNativeTransport = false; const isHttpsRequest = isHttps.test(options.protocol); - options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; + if (options.agent == null) { + options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; + } if (isHttp2) { transport = http2Transport; } else { - if (config.transport) { - transport = config.transport; + const configTransport = own2("transport"); + if (configTransport) { + transport = configTransport; } else if (config.maxRedirects === 0) { - transport = isHttpsRequest ? https__default["default"] : http__default["default"]; + transport = isHttpsRequest ? https : http; + isNativeTransport = true; } else { if (config.maxRedirects) { options.maxRedirects = config.maxRedirects; } - if (config.beforeRedirect) { - options.beforeRedirects.config = config.beforeRedirect; + const configBeforeRedirect = own2("beforeRedirect"); + if (configBeforeRedirect) { + options.beforeRedirects.config = configBeforeRedirect; + } + if (auth) { + const requestOrigin = parsed.origin; + const authToRestore = auth; + options.beforeRedirects.auth = function beforeRedirectAuth(redirectOptions) { + try { + if (new URL(redirectOptions.href).origin === requestOrigin) { + redirectOptions.auth = authToRestore; + } + } catch (e) { + } + }; } transport = isHttpsRequest ? httpsFollow : httpFollow; } @@ -53822,24 +54902,17 @@ var require_axios = __commonJS({ } else { options.maxBodyLength = Infinity; } - if (config.insecureHTTPParser) { - options.insecureHTTPParser = config.insecureHTTPParser; - } + options.insecureHTTPParser = Boolean(own2("insecureHTTPParser")); req = transport.request(options, function handleResponse(res) { + clearConnectPhaseTimer(); if (req.destroyed) return; const streams = [res]; const responseLength = utils$1.toFiniteNumber(res.headers["content-length"]); if (onDownloadProgress || maxDownloadRate) { - const transformStream = new AxiosTransformStream$1({ + const transformStream = new AxiosTransformStream({ maxRate: utils$1.toFiniteNumber(maxDownloadRate) }); - onDownloadProgress && transformStream.on("progress", flushOnFinish( - transformStream, - progressEventDecorator( - responseLength, - progressEventReducer(asyncDecorator(onDownloadProgress), true, 3) - ) - )); + onDownloadProgress && transformStream.on("progress", flushOnFinish(transformStream, progressEventDecorator(responseLength, progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)))); streams.push(transformStream); } let responseStream = res; @@ -53854,30 +54927,54 @@ var require_axios = __commonJS({ case "x-gzip": case "compress": case "x-compress": - streams.push(zlib__default["default"].createUnzip(zlibOptions)); + streams.push(zlib.createUnzip(zlibOptions)); delete res.headers["content-encoding"]; break; case "deflate": - streams.push(new ZlibHeaderTransformStream$1()); - streams.push(zlib__default["default"].createUnzip(zlibOptions)); + streams.push(new ZlibHeaderTransformStream()); + streams.push(zlib.createUnzip(zlibOptions)); delete res.headers["content-encoding"]; break; case "br": if (isBrotliSupported) { - streams.push(zlib__default["default"].createBrotliDecompress(brotliOptions)); + streams.push(zlib.createBrotliDecompress(brotliOptions)); + delete res.headers["content-encoding"]; + } + break; + case "zstd": + if (isZstdSupported) { + streams.push(zlib.createZstdDecompress(zstdOptions)); delete res.headers["content-encoding"]; } + break; } } - responseStream = streams.length > 1 ? stream__default["default"].pipeline(streams, utils$1.noop) : streams[0]; + responseStream = streams.length > 1 ? stream.pipeline(streams, utils$1.noop) : streams[0]; const response = { status: res.statusCode, statusText: res.statusMessage, - headers: new AxiosHeaders$1(res.headers), + headers: new AxiosHeaders(res.headers), config, request: lastRequest }; if (responseType === "stream") { + if (config.maxContentLength > -1) { + const limit = config.maxContentLength; + const source = responseStream; + async function* enforceMaxContentLength() { + let totalResponseBytes = 0; + for await (const chunk of source) { + totalResponseBytes += chunk.length; + if (totalResponseBytes > limit) { + throw new AxiosError("maxContentLength size of " + limit + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, lastRequest); + } + yield chunk; + } + } + responseStream = stream.Readable.from(enforceMaxContentLength(), { + objectMode: false + }); + } response.data = responseStream; settle(resolve, reject, response); } else { @@ -53889,30 +54986,20 @@ var require_axios = __commonJS({ if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { rejected = true; responseStream.destroy(); - abort(new AxiosError$1( - "maxContentLength size of " + config.maxContentLength + " exceeded", - AxiosError$1.ERR_BAD_RESPONSE, - config, - lastRequest - )); + abort(new AxiosError("maxContentLength size of " + config.maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, lastRequest)); } }); responseStream.on("aborted", function handlerStreamAborted() { if (rejected) { return; } - const err = new AxiosError$1( - "stream has been aborted", - AxiosError$1.ERR_BAD_RESPONSE, - config, - lastRequest - ); + const err = new AxiosError("stream has been aborted", AxiosError.ERR_BAD_RESPONSE, config, lastRequest, response); responseStream.destroy(err); reject(err); }); responseStream.on("error", function handleStreamError(err) { - if (req.destroyed) return; - reject(AxiosError$1.from(err, null, config, lastRequest)); + if (rejected) return; + reject(AxiosError.from(err, null, config, lastRequest, response)); }); responseStream.on("end", function handleStreamEnd() { try { @@ -53925,7 +55012,7 @@ var require_axios = __commonJS({ } response.data = responseData; } catch (err) { - return reject(AxiosError$1.from(err, null, config, response.request, response)); + return reject(AxiosError.from(err, null, config, response.request, response)); } settle(resolve, reject, response); }); @@ -53945,36 +55032,46 @@ var require_axios = __commonJS({ } }); req.on("error", function handleRequestError(err) { - reject(AxiosError$1.from(err, null, config, req)); + reject(AxiosError.from(err, null, config, req)); }); + const boundSockets = /* @__PURE__ */ new Set(); req.on("socket", function handleRequestSocket(socket) { socket.setKeepAlive(true, 1e3 * 60); + if (!socket[kAxiosSocketListener]) { + socket.on("error", function handleSocketError(err) { + const current = socket[kAxiosCurrentReq]; + if (current && !current.destroyed) { + current.destroy(err); + } + }); + socket[kAxiosSocketListener] = true; + } + socket[kAxiosCurrentReq] = req; + boundSockets.add(socket); + }); + req.once("close", function clearCurrentReq() { + clearConnectPhaseTimer(); + for (const socket of boundSockets) { + if (socket[kAxiosCurrentReq] === req) { + socket[kAxiosCurrentReq] = null; + } + } + boundSockets.clear(); }); if (config.timeout) { const timeout = parseInt(config.timeout, 10); if (Number.isNaN(timeout)) { - abort(new AxiosError$1( - "error trying to parse `config.timeout` to int", - AxiosError$1.ERR_BAD_OPTION_VALUE, - config, - req - )); + abort(new AxiosError("error trying to parse `config.timeout` to int", AxiosError.ERR_BAD_OPTION_VALUE, config, req)); return; } - req.setTimeout(timeout, function handleRequestTimeout() { + const handleTimeout = function handleTimeout2() { if (isDone) return; - let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded"; - const transitional = config.transitional || transitionalDefaults; - if (config.timeoutErrorMessage) { - timeoutErrorMessage = config.timeoutErrorMessage; - } - abort(new AxiosError$1( - timeoutErrorMessage, - transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED, - config, - req - )); - }); + abort(createTimeoutError()); + }; + if (isNativeTransport && timeout > 0) { + connectPhaseTimer = setTimeout(handleTimeout, timeout); + } + req.setTimeout(timeout, handleTimeout); } else { req.setTimeout(0); } @@ -53990,10 +55087,27 @@ var require_axios = __commonJS({ }); data.on("close", () => { if (!ended && !errored) { - abort(new CanceledError$1("Request stream has been aborted", config, req)); + abort(new CanceledError("Request stream has been aborted", config, req)); } }); - data.pipe(req); + let uploadStream = data; + if (config.maxBodyLength > -1 && config.maxRedirects === 0) { + const limit = config.maxBodyLength; + let bytesSent = 0; + uploadStream = stream.pipeline([data, new stream.Transform({ + transform(chunk, _enc, cb) { + bytesSent += chunk.length; + if (bytesSent > limit) { + return cb(new AxiosError("Request body larger than maxBodyLength limit", AxiosError.ERR_BAD_REQUEST, config, req)); + } + cb(null, chunk); + } + })], utils$1.noop); + uploadStream.on("error", (err) => { + if (!req.destroyed) req.destroy(err); + }); + } + uploadStream.pipe(req); } else { data && req.write(data); req.end(); @@ -54003,21 +55117,18 @@ var require_axios = __commonJS({ var isURLSameOrigin = platform2.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url2) => { url2 = new URL(url2, platform2.origin); return origin2.protocol === url2.protocol && origin2.host === url2.host && (isMSIE || origin2.port === url2.port); - })( - new URL(platform2.origin), - platform2.navigator && /(msie|trident)/i.test(platform2.navigator.userAgent) - ) : () => true; + })(new URL(platform2.origin), platform2.navigator && /(msie|trident)/i.test(platform2.navigator.userAgent)) : () => true; var cookies = platform2.hasStandardBrowserEnv ? ( // Standard browser envs support document.cookie { - write(name, value, expires, path, domain, secure, sameSite) { + write(name, value, expires, path2, domain, secure, sameSite) { if (typeof document === "undefined") return; const cookie = [`${name}=${encodeURIComponent(value)}`]; if (utils$1.isNumber(expires)) { cookie.push(`expires=${new Date(expires).toUTCString()}`); } - if (utils$1.isString(path)) { - cookie.push(`path=${path}`); + if (utils$1.isString(path2)) { + cookie.push(`path=${path2}`); } if (utils$1.isString(domain)) { cookie.push(`domain=${domain}`); @@ -54032,8 +55143,15 @@ var require_axios = __commonJS({ }, read(name) { if (typeof document === "undefined") return null; - const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)")); - return match ? decodeURIComponent(match[1]) : null; + const cookies2 = document.cookie.split(";"); + for (let i = 0; i < cookies2.length; i++) { + const cookie = cookies2[i].replace(/^\s+/, ""); + const eq = cookie.indexOf("="); + if (eq !== -1 && cookie.slice(0, eq) === name) { + return decodeURIComponent(cookie.slice(eq + 1)); + } + } + return null; }, remove(name) { this.write(name, "", Date.now() - 864e5, "/"); @@ -54051,13 +55169,26 @@ var require_axios = __commonJS({ } } ); - var headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing; + var headersToObject = (thing) => thing instanceof AxiosHeaders ? { + ...thing + } : thing; function mergeConfig(config1, config2) { config2 = config2 || {}; - const config = {}; + const config = /* @__PURE__ */ Object.create(null); + Object.defineProperty(config, "hasOwnProperty", { + // Null-proto descriptor so a polluted Object.prototype.get cannot turn + // this data descriptor into an accessor descriptor on the way in. + __proto__: null, + value: Object.prototype.hasOwnProperty, + enumerable: false, + writable: true, + configurable: true + }); function getMergedValue(target, source, prop, caseless) { if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { - return utils$1.merge.call({ caseless }, target, source); + return utils$1.merge.call({ + caseless + }, target, source); } else if (utils$1.isPlainObject(source)) { return utils$1.merge({}, source); } else if (utils$1.isArray(source)) { @@ -54085,9 +55216,9 @@ var require_axios = __commonJS({ } } function mergeDirectKeys(a, b, prop) { - if (prop in config2) { + if (utils$1.hasOwnProp(config2, prop)) { return getMergedValue(a, b); - } else if (prop in config1) { + } else if (utils$1.hasOwnProp(config1, prop)) { return getMergedValue(void 0, a); } } @@ -54118,49 +55249,67 @@ var require_axios = __commonJS({ httpsAgent: defaultToConfig2, cancelToken: defaultToConfig2, socketPath: defaultToConfig2, + allowedSocketPaths: defaultToConfig2, responseEncoding: defaultToConfig2, validateStatus: mergeDirectKeys, headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) }; - utils$1.forEach( - Object.keys({ ...config1, ...config2 }), - function computeConfigValue(prop) { - if (prop === "__proto__" || prop === "constructor" || prop === "prototype") - return; - const merge2 = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties; - const configValue = merge2(config1[prop], config2[prop], prop); - utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue); - } - ); + utils$1.forEach(Object.keys({ + ...config1, + ...config2 + }), function computeConfigValue(prop) { + if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return; + const merge2 = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties; + const a = utils$1.hasOwnProp(config1, prop) ? config1[prop] : void 0; + const b = utils$1.hasOwnProp(config2, prop) ? config2[prop] : void 0; + const configValue = merge2(a, b, prop); + utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue); + }); return config; } - var resolveConfig = (config) => { + var FORM_DATA_CONTENT_HEADERS = ["content-type", "content-length"]; + function setFormDataHeaders(headers, formHeaders, policy) { + if (policy !== "content-only") { + headers.set(formHeaders); + return; + } + Object.entries(formHeaders).forEach(([key, val]) => { + if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) { + headers.set(key, val); + } + }); + } + var encodeUTF8$1 = (str) => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16))); + function resolveConfig(config) { const newConfig = mergeConfig({}, config); - let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig; - newConfig.headers = headers = AxiosHeaders$1.from(headers); - newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer); + const own2 = (key) => utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : void 0; + const data = own2("data"); + let withXSRFToken = own2("withXSRFToken"); + const xsrfHeaderName = own2("xsrfHeaderName"); + const xsrfCookieName = own2("xsrfCookieName"); + let headers = own2("headers"); + const auth = own2("auth"); + const baseURL = own2("baseURL"); + const allowAbsoluteUrls = own2("allowAbsoluteUrls"); + const url2 = own2("url"); + newConfig.headers = headers = AxiosHeaders.from(headers); + newConfig.url = buildURL(buildFullPath(baseURL, url2, allowAbsoluteUrls), own2("params"), own2("paramsSerializer")); if (auth) { - headers.set( - "Authorization", - "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")) - ); + headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ? encodeUTF8$1(auth.password) : ""))); } if (utils$1.isFormData(data)) { - if (platform2.hasStandardBrowserEnv || platform2.hasStandardBrowserWebWorkerEnv) { + if (platform2.hasStandardBrowserEnv || platform2.hasStandardBrowserWebWorkerEnv || utils$1.isReactNative(data)) { headers.setContentType(void 0); } else if (utils$1.isFunction(data.getHeaders)) { - const formHeaders = data.getHeaders(); - const allowedHeaders = ["content-type", "content-length"]; - Object.entries(formHeaders).forEach(([key, val]) => { - if (allowedHeaders.includes(key.toLowerCase())) { - headers.set(key, val); - } - }); + setFormDataHeaders(headers, data.getHeaders(), own2("formDataHeaderPolicy")); } } if (platform2.hasStandardBrowserEnv) { - withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); - if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) { + if (utils$1.isFunction(withXSRFToken)) { + withXSRFToken = withXSRFToken(newConfig); + } + const shouldSendXSRF = withXSRFToken === true || withXSRFToken == null && isURLSameOrigin(newConfig.url); + if (shouldSendXSRF) { const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); if (xsrfValue) { headers.set(xsrfHeaderName, xsrfValue); @@ -54168,14 +55317,18 @@ var require_axios = __commonJS({ } } return newConfig; - }; + } var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined"; var xhrAdapter = isXHRAdapterSupported && function(config) { return new Promise(function dispatchXhrRequest(resolve, reject) { const _config = resolveConfig(config); let requestData = _config.data; - const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize(); - let { responseType, onUploadProgress, onDownloadProgress } = _config; + const requestHeaders = AxiosHeaders.from(_config.headers).normalize(); + let { + responseType, + onUploadProgress, + onDownloadProgress + } = _config; let onCanceled; let uploadThrottled, downloadThrottled; let flushUpload, flushDownload; @@ -54192,9 +55345,7 @@ var require_axios = __commonJS({ if (!request) { return; } - const responseHeaders = AxiosHeaders$1.from( - "getAllResponseHeaders" in request && request.getAllResponseHeaders() - ); + const responseHeaders = AxiosHeaders.from("getAllResponseHeaders" in request && request.getAllResponseHeaders()); const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response; const response = { data: responseData, @@ -54220,7 +55371,7 @@ var require_axios = __commonJS({ if (!request || request.readyState !== 4) { return; } - if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) { + if (request.status === 0 && !(request.responseURL && request.responseURL.startsWith("file:"))) { return; } setTimeout(onloadend); @@ -54230,14 +55381,16 @@ var require_axios = __commonJS({ if (!request) { return; } - reject(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, config, request)); + reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config, request)); + done(); request = null; }; request.onerror = function handleError(event) { const msg = event && event.message ? event.message : "Network Error"; - const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request); + const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request); err.event = event || null; reject(err); + done(); request = null; }; request.ontimeout = function handleTimeout() { @@ -54246,17 +55399,13 @@ var require_axios = __commonJS({ if (_config.timeoutErrorMessage) { timeoutErrorMessage = _config.timeoutErrorMessage; } - reject(new AxiosError$1( - timeoutErrorMessage, - transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED, - config, - request - )); + reject(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, request)); + done(); request = null; }; requestData === void 0 && requestHeaders.setContentType(null); if ("setRequestHeader" in request) { - utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { + utils$1.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) { request.setRequestHeader(key, val); }); } @@ -54280,8 +55429,9 @@ var require_axios = __commonJS({ if (!request) { return; } - reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel); + reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); request.abort(); + done(); request = null; }; _config.cancelToken && _config.cancelToken.subscribe(onCanceled); @@ -54290,50 +55440,53 @@ var require_axios = __commonJS({ } } const protocol = parseProtocol(_config.url); - if (protocol && platform2.protocols.indexOf(protocol) === -1) { - reject(new AxiosError$1("Unsupported protocol " + protocol + ":", AxiosError$1.ERR_BAD_REQUEST, config)); + if (protocol && !platform2.protocols.includes(protocol)) { + reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config)); return; } request.send(requestData || null); }); }; var composeSignals = (signals, timeout) => { - const { length } = signals = signals ? signals.filter(Boolean) : []; - if (timeout || length) { - let controller = new AbortController(); - let aborted; - const onabort = function(reason) { - if (!aborted) { - aborted = true; - unsubscribe(); - const err = reason instanceof Error ? reason : this.reason; - controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err)); - } - }; - let timer = timeout && setTimeout(() => { - timer = null; - onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT)); - }, timeout); - const unsubscribe = () => { - if (signals) { - timer && clearTimeout(timer); - timer = null; - signals.forEach((signal2) => { - signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort); - }); - signals = null; - } - }; - signals.forEach((signal2) => signal2.addEventListener("abort", onabort)); - const { signal } = controller; - signal.unsubscribe = () => utils$1.asap(unsubscribe); - return signal; + signals = signals ? signals.filter(Boolean) : []; + if (!timeout && !signals.length) { + return; } + const controller = new AbortController(); + let aborted = false; + const onabort = function(reason) { + if (!aborted) { + aborted = true; + unsubscribe(); + const err = reason instanceof Error ? reason : this.reason; + controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err)); + } + }; + let timer = timeout && setTimeout(() => { + timer = null; + onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT)); + }, timeout); + const unsubscribe = () => { + if (!signals) { + return; + } + timer && clearTimeout(timer); + timer = null; + signals.forEach((signal2) => { + signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort); + }); + signals = null; + }; + signals.forEach((signal2) => signal2.addEventListener("abort", onabort)); + const { + signal + } = controller; + signal.unsubscribe = () => utils$1.asap(unsubscribe); + return signal; }; - var composeSignals$1 = composeSignals; var streamChunk = function* (chunk, chunkSize) { let len = chunk.byteLength; - if (!chunkSize || len < chunkSize) { + if (len < chunkSize) { yield chunk; return; } @@ -54358,7 +55511,10 @@ var require_axios = __commonJS({ const reader = stream2.getReader(); try { for (; ; ) { - const { done, value } = await reader.read(); + const { + done, + value + } = await reader.read(); if (done) { break; } @@ -54381,7 +55537,10 @@ var require_axios = __commonJS({ return new ReadableStream({ async pull(controller) { try { - const { done: done2, value } = await iterator2.next(); + const { + done: done2, + value + } = await iterator2.next(); if (done2) { _onFinish(); controller.close(); @@ -54407,15 +55566,20 @@ var require_axios = __commonJS({ }); }; var DEFAULT_CHUNK_SIZE = 64 * 1024; - var { isFunction } = utils$1; - var globalFetchAPI = (({ Request, Response }) => ({ - Request, - Response - }))(utils$1.global); var { - ReadableStream: ReadableStream$1, - TextEncoder: TextEncoder$1 - } = utils$1.global; + isFunction + } = utils$1; + var encodeUTF8 = (str) => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16))); + var decodeURIComponentSafe = (value) => { + if (!utils$1.isString(value)) { + return value; + } + try { + return decodeURIComponent(value); + } catch (error2) { + return value; + } + }; var test = (fn, ...args) => { try { return !!fn(...args); @@ -54423,29 +55587,53 @@ var require_axios = __commonJS({ return false; } }; + var maybeWithAuthCredentials = (url2) => { + const protocolIndex = url2.indexOf("://"); + let urlToCheck = url2; + if (protocolIndex !== -1) { + urlToCheck = urlToCheck.slice(protocolIndex + 3); + } + return urlToCheck.includes("@") || urlToCheck.includes(":"); + }; var factory = (env) => { + const globalObject = utils$1.global !== void 0 && utils$1.global !== null ? utils$1.global : globalThis; + const { + ReadableStream: ReadableStream2, + TextEncoder: TextEncoder2 + } = globalObject; env = utils$1.merge.call({ skipUndefined: true - }, globalFetchAPI, env); - const { fetch: envFetch, Request, Response } = env; + }, { + Request: globalObject.Request, + Response: globalObject.Response + }, env); + const { + fetch: envFetch, + Request, + Response + } = env; const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function"; const isRequestSupported = isFunction(Request); const isResponseSupported = isFunction(Response); if (!isFetchSupported) { return false; } - const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1); - const encodeText = isFetchSupported && (typeof TextEncoder$1 === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder$1()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer())); + const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream2); + const encodeText = isFetchSupported && (typeof TextEncoder2 === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder2()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer())); const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => { let duplexAccessed = false; - const hasContentType = new Request(platform2.origin, { - body: new ReadableStream$1(), + const request = new Request(platform2.origin, { + body: new ReadableStream2(), method: "POST", get duplex() { duplexAccessed = true; return "half"; } - }).headers.has("Content-Type"); + }); + const hasContentType = request.headers.has("Content-Type"); + if (request.body != null) { + request.body.cancel(); + } return duplexAccessed && !hasContentType; }); const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body)); @@ -54459,7 +55647,7 @@ var require_axios = __commonJS({ if (method) { return method.call(res); } - throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config); + throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config); }); }); })(); @@ -54504,17 +55692,64 @@ var require_axios = __commonJS({ responseType, headers, withCredentials = "same-origin", - fetchOptions + fetchOptions, + maxContentLength, + maxBodyLength } = resolveConfig(config); + const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1; + const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1; + const own2 = (key) => utils$1.hasOwnProp(config, key) ? config[key] : void 0; let _fetch = envFetch || fetch; responseType = responseType ? (responseType + "").toLowerCase() : "text"; - let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout); + let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout); let request = null; const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { composedSignal.unsubscribe(); }); let requestContentLength; try { + let auth = void 0; + const configAuth = own2("auth"); + if (configAuth) { + const username = configAuth.username || ""; + const password = configAuth.password || ""; + auth = { + username, + password + }; + } + if (maybeWithAuthCredentials(url2)) { + const parsedURL = new URL(url2, platform2.origin); + if (!auth && (parsedURL.username || parsedURL.password)) { + const urlUsername = decodeURIComponentSafe(parsedURL.username); + const urlPassword = decodeURIComponentSafe(parsedURL.password); + auth = { + username: urlUsername, + password: urlPassword + }; + } + if (parsedURL.username || parsedURL.password) { + parsedURL.username = ""; + parsedURL.password = ""; + url2 = parsedURL.href; + } + } + if (auth) { + headers.delete("authorization"); + headers.set("Authorization", "Basic " + btoa(encodeUTF8((auth.username || "") + ":" + (auth.password || "")))); + } + if (hasMaxContentLength && typeof url2 === "string" && url2.startsWith("data:")) { + const estimated = estimateDataURLDecodedBytes(url2); + if (estimated > maxContentLength) { + throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request); + } + } + if (hasMaxBodyLength && method !== "get" && method !== "head") { + const outboundLength = await resolveBodyLength(headers, data); + if (typeof outboundLength === "number" && isFinite(outboundLength) && outboundLength > maxBodyLength) { + throw new AxiosError("Request body larger than maxBodyLength limit", AxiosError.ERR_BAD_REQUEST, config, request); + } + } if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) { let _request = new Request(url2, { method: "POST", @@ -54526,10 +55761,7 @@ var require_axios = __commonJS({ headers.setContentType(contentTypeHeader); } if (_request.body) { - const [onProgress, flush] = progressEventDecorator( - requestContentLength, - progressEventReducer(asyncDecorator(onUploadProgress)) - ); + const [onProgress, flush] = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))); data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush); } } @@ -54537,43 +55769,75 @@ var require_axios = __commonJS({ withCredentials = withCredentials ? "include" : "omit"; } const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype; + if (utils$1.isFormData(data)) { + const contentType = headers.getContentType(); + if (contentType && /^multipart\/form-data/i.test(contentType) && !/boundary=/i.test(contentType)) { + headers.delete("content-type"); + } + } + headers.set("User-Agent", "axios/" + VERSION, false); const resolvedOptions = { ...fetchOptions, signal: composedSignal, method: method.toUpperCase(), - headers: headers.normalize().toJSON(), + headers: toByteStringHeaderObject(headers.normalize()), body: data, duplex: "half", credentials: isCredentialsSupported ? withCredentials : void 0 }; request = isRequestSupported && new Request(url2, resolvedOptions); let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url2, resolvedOptions)); + if (hasMaxContentLength) { + const declaredLength = utils$1.toFiniteNumber(response.headers.get("content-length")); + if (declaredLength != null && declaredLength > maxContentLength) { + throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request); + } + } const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response"); - if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) { + if (supportsResponseStream && response.body && (onDownloadProgress || hasMaxContentLength || isStreamResponse && unsubscribe)) { const options = {}; ["status", "statusText", "headers"].forEach((prop) => { options[prop] = response[prop]; }); const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length")); - const [onProgress, flush] = onDownloadProgress && progressEventDecorator( - responseContentLength, - progressEventReducer(asyncDecorator(onDownloadProgress), true) - ) || []; - response = new Response( - trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { - flush && flush(); - unsubscribe && unsubscribe(); - }), - options - ); + const [onProgress, flush] = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || []; + let bytesRead = 0; + const onChunkProgress = (loadedBytes) => { + if (hasMaxContentLength) { + bytesRead = loadedBytes; + if (bytesRead > maxContentLength) { + throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request); + } + } + onProgress && onProgress(loadedBytes); + }; + response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => { + flush && flush(); + unsubscribe && unsubscribe(); + }), options); } responseType = responseType || "text"; let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config); + if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) { + let materializedSize; + if (responseData != null) { + if (typeof responseData.byteLength === "number") { + materializedSize = responseData.byteLength; + } else if (typeof responseData.size === "number") { + materializedSize = responseData.size; + } else if (typeof responseData === "string") { + materializedSize = typeof TextEncoder2 === "function" ? new TextEncoder2().encode(responseData).byteLength : responseData.length; + } + } + if (typeof materializedSize === "number" && materializedSize > maxContentLength) { + throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request); + } + } !isStreamResponse && unsubscribe && unsubscribe(); return await new Promise((resolve, reject) => { settle(resolve, reject, { data: responseData, - headers: AxiosHeaders$1.from(response.headers), + headers: AxiosHeaders.from(response.headers), status: response.status, statusText: response.statusText, config, @@ -54582,27 +55846,31 @@ var require_axios = __commonJS({ }); } catch (err) { unsubscribe && unsubscribe(); + if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError) { + const canceledError = composedSignal.reason; + canceledError.config = config; + request && (canceledError.request = request); + err !== canceledError && (canceledError.cause = err); + throw canceledError; + } if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) { - throw Object.assign( - new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request, err && err.response), - { - cause: err.cause || err - } - ); + throw Object.assign(new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request, err && err.response), { + cause: err.cause || err + }); } - throw AxiosError$1.from(err, err && err.code, config, request, err && err.response); + throw AxiosError.from(err, err && err.code, config, request, err && err.response); } }; }; var seedCache = /* @__PURE__ */ new Map(); var getFetch = (config) => { let env = config && config.env || {}; - const { fetch: fetch2, Request, Response } = env; - const seeds = [ + const { + fetch: fetch2, Request, - Response, - fetch2 - ]; + Response + } = env; + const seeds = [Request, Response, fetch2]; let len = seeds.length, i = len, seed, target, map = seedCache; while (i--) { seed = seeds[i]; @@ -54623,17 +55891,25 @@ var require_axios = __commonJS({ utils$1.forEach(knownAdapters, (fn, value) => { if (fn) { try { - Object.defineProperty(fn, "name", { value }); + Object.defineProperty(fn, "name", { + __proto__: null, + value + }); } catch (e) { } - Object.defineProperty(fn, "adapterName", { value }); + Object.defineProperty(fn, "adapterName", { + __proto__: null, + value + }); } }); var renderReason = (reason) => `- ${reason}`; var isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false; function getAdapter(adapters2, config) { adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2]; - const { length } = adapters2; + const { + length + } = adapters2; let nameOrAdapter; let adapter; const rejectedReasons = {}; @@ -54644,7 +55920,7 @@ var require_axios = __commonJS({ if (!isResolvedHandle(nameOrAdapter)) { adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; if (adapter === void 0) { - throw new AxiosError$1(`Unknown adapter '${id}'`); + throw new AxiosError(`Unknown adapter '${id}'`); } } if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) { @@ -54653,14 +55929,9 @@ var require_axios = __commonJS({ rejectedReasons[id || "#" + i] = adapter; } if (!adapter) { - const reasons = Object.entries(rejectedReasons).map( - ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build") - ); + const reasons = Object.entries(rejectedReasons).map(([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")); let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified"; - throw new AxiosError$1( - `There is no suitable adapter to dispatch the request ` + s, - "ERR_NOT_SUPPORT" - ); + throw new AxiosError(`There is no suitable adapter to dispatch the request ` + s, "ERR_NOT_SUPPORT"); } return adapter; } @@ -54681,39 +55952,38 @@ var require_axios = __commonJS({ config.cancelToken.throwIfRequested(); } if (config.signal && config.signal.aborted) { - throw new CanceledError$1(null, config); + throw new CanceledError(null, config); } } function dispatchRequest(config) { throwIfCancellationRequested(config); - config.headers = AxiosHeaders$1.from(config.headers); - config.data = transformData.call( - config, - config.transformRequest - ); + config.headers = AxiosHeaders.from(config.headers); + config.data = transformData.call(config, config.transformRequest); if (["post", "put", "patch"].indexOf(config.method) !== -1) { config.headers.setContentType("application/x-www-form-urlencoded", false); } - const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config); + const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config); return adapter(config).then(function onAdapterResolution(response) { throwIfCancellationRequested(config); - response.data = transformData.call( - config, - config.transformResponse, - response - ); - response.headers = AxiosHeaders$1.from(response.headers); + config.response = response; + try { + response.data = transformData.call(config, config.transformResponse, response); + } finally { + delete config.response; + } + response.headers = AxiosHeaders.from(response.headers); return response; }, function onAdapterRejection(reason) { if (!isCancel(reason)) { throwIfCancellationRequested(config); if (reason && reason.response) { - reason.response.data = transformData.call( - config, - config.transformResponse, - reason.response - ); - reason.response.headers = AxiosHeaders$1.from(reason.response.headers); + config.response = reason.response; + try { + reason.response.data = transformData.call(config, config.transformResponse, reason.response); + } finally { + delete config.response; + } + reason.response.headers = AxiosHeaders.from(reason.response.headers); } } return Promise.reject(reason); @@ -54732,19 +56002,11 @@ var require_axios = __commonJS({ } return (value, opt, opts) => { if (validator2 === false) { - throw new AxiosError$1( - formatMessage(opt, " has been removed" + (version ? " in " + version : "")), - AxiosError$1.ERR_DEPRECATED - ); + throw new AxiosError(formatMessage(opt, " has been removed" + (version ? " in " + version : "")), AxiosError.ERR_DEPRECATED); } if (version && !deprecatedWarnings[opt]) { deprecatedWarnings[opt] = true; - console.warn( - formatMessage( - opt, - " has been deprecated since v" + version + " and will be removed in the near future" - ) - ); + console.warn(formatMessage(opt, " has been deprecated since v" + version + " and will be removed in the near future")); } return validator2 ? validator2(value, opt, opts) : true; }; @@ -54757,23 +56019,23 @@ var require_axios = __commonJS({ }; function assertOptions(options, schema, allowUnknown) { if (typeof options !== "object") { - throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE); + throw new AxiosError("options must be an object", AxiosError.ERR_BAD_OPTION_VALUE); } const keys = Object.keys(options); let i = keys.length; while (i-- > 0) { const opt = keys[i]; - const validator2 = schema[opt]; + const validator2 = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : void 0; if (validator2) { const value = options[opt]; const result = value === void 0 || validator2(value, opt, options); if (result !== true) { - throw new AxiosError$1("option " + opt + " must be " + result, AxiosError$1.ERR_BAD_OPTION_VALUE); + throw new AxiosError("option " + opt + " must be " + result, AxiosError.ERR_BAD_OPTION_VALUE); } continue; } if (allowUnknown !== true) { - throw new AxiosError$1("Unknown option " + opt, AxiosError$1.ERR_BAD_OPTION); + throw new AxiosError("Unknown option " + opt, AxiosError.ERR_BAD_OPTION); } } } @@ -54786,8 +56048,8 @@ var require_axios = __commonJS({ constructor(instanceConfig) { this.defaults = instanceConfig || {}; this.interceptors = { - request: new InterceptorManager$1(), - response: new InterceptorManager$1() + request: new InterceptorManager(), + response: new InterceptorManager() }; } /** @@ -54805,12 +56067,23 @@ var require_axios = __commonJS({ if (err instanceof Error) { let dummy = {}; Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error(); - const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : ""; + const stack = (() => { + if (!dummy.stack) { + return ""; + } + const firstNewlineIndex = dummy.stack.indexOf("\n"); + return firstNewlineIndex === -1 ? "" : dummy.stack.slice(firstNewlineIndex + 1); + })(); try { if (!err.stack) { err.stack = stack; - } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) { - err.stack += "\n" + stack; + } else if (stack) { + const firstNewlineIndex = stack.indexOf("\n"); + const secondNewlineIndex = firstNewlineIndex === -1 ? -1 : stack.indexOf("\n", firstNewlineIndex + 1); + const stackWithoutTwoTopLines = secondNewlineIndex === -1 ? "" : stack.slice(secondNewlineIndex + 1); + if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) { + err.stack += "\n" + stack; + } } } catch (e) { } @@ -54826,13 +56099,18 @@ var require_axios = __commonJS({ config = configOrUrl || {}; } config = mergeConfig(this.defaults, config); - const { transitional, paramsSerializer, headers } = config; + const { + transitional, + paramsSerializer, + headers + } = config; if (transitional !== void 0) { validator.assertOptions(transitional, { silentJSONParsing: validators.transitional(validators.boolean), forcedJSONParsing: validators.transitional(validators.boolean), clarifyTimeoutError: validators.transitional(validators.boolean), - legacyInterceptorReqResOrdering: validators.transitional(validators.boolean) + legacyInterceptorReqResOrdering: validators.transitional(validators.boolean), + advertiseZstdAcceptEncoding: validators.transitional(validators.boolean) }, false); } if (paramsSerializer != null) { @@ -54858,17 +56136,11 @@ var require_axios = __commonJS({ withXsrfToken: validators.spelling("withXSRFToken") }, true); config.method = (config.method || this.defaults.method || "get").toLowerCase(); - let contextHeaders = headers && utils$1.merge( - headers.common, - headers[config.method] - ); - headers && utils$1.forEach( - ["delete", "get", "head", "post", "put", "patch", "common"], - (method) => { - delete headers[method]; - } - ); - config.headers = AxiosHeaders$1.concat(contextHeaders, headers); + let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]); + headers && utils$1.forEach(["delete", "get", "head", "post", "put", "patch", "query", "common"], (method) => { + delete headers[method]; + }); + config.headers = AxiosHeaders.concat(contextHeaders, headers); const requestInterceptorChain = []; let synchronousRequestInterceptors = true; this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { @@ -54941,7 +56213,7 @@ var require_axios = __commonJS({ })); }; }); - utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) { + utils$1.forEach(["post", "put", "patch", "query"], function forEachMethodWithData(method) { function generateHTTPMethod(isForm) { return function httpMethod(url2, data, config) { return this.request(mergeConfig(config || {}, { @@ -54955,9 +56227,10 @@ var require_axios = __commonJS({ }; } Axios.prototype[method] = generateHTTPMethod(); - Axios.prototype[method + "Form"] = generateHTTPMethod(true); + if (method !== "query") { + Axios.prototype[method + "Form"] = generateHTTPMethod(true); + } }); - var Axios$1 = Axios; var CancelToken = class _CancelToken { constructor(executor) { if (typeof executor !== "function") { @@ -54991,7 +56264,7 @@ var require_axios = __commonJS({ if (token.reason) { return; } - token.reason = new CanceledError$1(message, config, request); + token.reason = new CanceledError(message, config, request); resolvePromise(token.reason); }); } @@ -55053,7 +56326,6 @@ var require_axios = __commonJS({ }; } }; - var CancelToken$1 = CancelToken; function spread(callback) { return function wrap(arr) { return callback.apply(null, arr); @@ -55136,25 +56408,28 @@ var require_axios = __commonJS({ Object.entries(HttpStatusCode).forEach(([key, value]) => { HttpStatusCode[value] = key; }); - var HttpStatusCode$1 = HttpStatusCode; function createInstance(defaultConfig) { - const context = new Axios$1(defaultConfig); - const instance = bind(Axios$1.prototype.request, context); - utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true }); - utils$1.extend(instance, context, null, { allOwnKeys: true }); + const context = new Axios(defaultConfig); + const instance = bind(Axios.prototype.request, context); + utils$1.extend(instance, Axios.prototype, context, { + allOwnKeys: true + }); + utils$1.extend(instance, context, null, { + allOwnKeys: true + }); instance.create = function create(instanceConfig) { return createInstance(mergeConfig(defaultConfig, instanceConfig)); }; return instance; } - var axios = createInstance(defaults$1); - axios.Axios = Axios$1; - axios.CanceledError = CanceledError$1; - axios.CancelToken = CancelToken$1; + var axios = createInstance(defaults); + axios.Axios = Axios; + axios.CanceledError = CanceledError; + axios.CancelToken = CancelToken; axios.isCancel = isCancel; axios.VERSION = VERSION; axios.toFormData = toFormData; - axios.AxiosError = AxiosError$1; + axios.AxiosError = AxiosError; axios.Cancel = axios.CanceledError; axios.all = function all(promises3) { return Promise.all(promises3); @@ -55162,10 +56437,10 @@ var require_axios = __commonJS({ axios.spread = spread; axios.isAxiosError = isAxiosError; axios.mergeConfig = mergeConfig; - axios.AxiosHeaders = AxiosHeaders$1; + axios.AxiosHeaders = AxiosHeaders; axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing); axios.getAdapter = adapters.getAdapter; - axios.HttpStatusCode = HttpStatusCode$1; + axios.HttpStatusCode = HttpStatusCode; axios.default = axios; module2.exports = axios; } @@ -56332,7 +57607,7 @@ var require_spaceScopedResource = __commonJS({ }); // node_modules/@octopusdeploy/api-client/dist/index.js -var require_dist = __commonJS({ +var require_dist2 = __commonJS({ "node_modules/@octopusdeploy/api-client/dist/index.js"(exports2) { "use strict"; var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { @@ -56970,10 +58245,10 @@ function getInputParameters() { // src/index.ts var import_fs3 = require("fs"); -var import_api_client2 = __toESM(require_dist()); +var import_api_client2 = __toESM(require_dist2()); // src/api-wrapper.ts -var import_api_client = __toESM(require_dist()); +var import_api_client = __toESM(require_dist2()); var import_fs2 = __toESM(require("fs")); async function createReleaseFromInputs(client, parameters) { client.info("\u{1F419} Creating a release in Octopus Deploy..."); @@ -57146,5 +58421,5 @@ urijs/src/URITemplate.js: *) axios/dist/node/axios.cjs: - (*! Axios v1.13.5 Copyright (c) 2026 Matt Zabriskie and contributors *) + (*! Axios v1.17.0 Copyright (c) 2026 Matt Zabriskie and contributors *) */ diff --git a/package-lock.json b/package-lock.json index 9ab69543..2987cb64 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "4.1.4", "license": "Apache-2.0", "dependencies": { - "@actions/core": "3.0.0", + "@actions/core": "3.0.1", "@octopusdeploy/api-client": "3.7.0", "axios": "^1.17.0", "tmp": "0.2.7" @@ -41,9 +41,9 @@ } }, "node_modules/@actions/core": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-3.0.0.tgz", - "integrity": "sha512-zYt6cz+ivnTmiT/ksRVriMBOiuoUpDCJJlZ5KPl2/FRdvwU3f7MPh9qftvbkXJThragzUZieit2nyHUyw53Seg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-3.0.1.tgz", + "integrity": "sha512-a6d/Nwahm9fliVGRhdhofo40HjHQasUPusmc7vBfyky+7Z+P2A1J68zyFVaNcEclc/Se+eO595oAr5nwEIoIUA==", "license": "MIT", "dependencies": { "@actions/exec": "^3.0.0", diff --git a/package.json b/package.json index b4336b2a..0482497e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "url": "https://github.com/OctopusDeploy/create-release-action/issues" }, "dependencies": { - "@actions/core": "3.0.0", + "@actions/core": "3.0.1", "@octopusdeploy/api-client": "3.7.0", "axios": "^1.17.0", "tmp": "0.2.7"