diff --git a/dist/index.js b/dist/index.js index fb8ee25..34cc5d5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -89321,7 +89321,7 @@ var external_node_util_ = __nccwpck_require__(7261); var external_os_ = __nccwpck_require__(2037); ;// CONCATENATED MODULE: external "node:crypto" const external_node_crypto_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:crypto"); -;// CONCATENATED MODULE: ./node_modules/.pnpm/@sindresorhus+is@6.3.1/node_modules/@sindresorhus/is/dist/index.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/@sindresorhus+is@7.0.0/node_modules/@sindresorhus/is/distribution/index.js const typedArrayTypeNames = [ 'Int8Array', 'Uint8Array', @@ -89507,14 +89507,10 @@ const is = Object.assign(detect, { boundFunction: isBoundFunction, buffer: isBuffer, class: isClass, - /** @deprecated Renamed to `class`. */ - class_: isClass, dataView: isDataView, date: isDate, detect, directInstanceOf: isDirectInstanceOf, - /** @deprecated Renamed to `htmlElement` */ - domElement: isHtmlElement, emptyArray: isEmptyArray, emptyMap: isEmptyMap, emptyObject: isEmptyObject, @@ -89529,8 +89525,6 @@ const is = Object.assign(detect, { float64Array: isFloat64Array, formData: isFormData, function: isFunction, - /** @deprecated Renamed to `function`. */ - function_: isFunction, generator: isGenerator, generatorFunction: isGeneratorFunction, htmlElement: isHtmlElement, @@ -89553,8 +89547,6 @@ const is = Object.assign(detect, { nonEmptyString: isNonEmptyString, nonEmptyStringAndNotWhitespace: isNonEmptyStringAndNotWhitespace, null: isNull, - /** @deprecated Renamed to `null`. */ - null_: isNull, nullOrUndefined: isNullOrUndefined, number: isNumber, numericString: isNumericString, @@ -89590,7 +89582,7 @@ const is = Object.assign(detect, { weakSet: isWeakSet, whitespaceString: isWhitespaceString, }); -function isAbsoluteMod2(remainder) { +function isAbsoluteModule2(remainder) { return (value) => isInteger(value) && Math.abs(value % 2) === remainder; } function isAll(predicate, ...values) { @@ -89645,8 +89637,11 @@ function isBoolean(value) { } // eslint-disable-next-line @typescript-eslint/ban-types function isBoundFunction(value) { - return isFunction(value) && !Object.prototype.hasOwnProperty.call(value, 'prototype'); + return isFunction(value) && !Object.hasOwn(value, 'prototype'); } +/** +Note: [Prefer using `Uint8Array` instead of `Buffer`.](https://sindresorhus.com/blog/goodbye-nodejs-buffer) +*/ function isBuffer(value) { // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call return value?.constructor?.isBuffer?.(value) ?? false; @@ -89692,7 +89687,7 @@ function isError(value) { return getObjectType(value) === 'Error'; } function isEvenInteger(value) { - return isAbsoluteMod2(0)(value); + return isAbsoluteModule2(0)(value); } // Example: `is.falsy = (value: unknown): value is (not true | 0 | '' | undefined | null) => Boolean(value);` function isFalsy(value) { @@ -89831,7 +89826,7 @@ function isObservable(value) { return false; } function isOddInteger(value) { - return isAbsoluteMod2(1)(value); + return isAbsoluteModule2(1)(value); } function isPlainObject(value) { // From: https://github.com/sindresorhus/is-plain-obj/blob/main/index.js @@ -89931,7 +89926,7 @@ function isValidLength(value) { function isWeakMap(value) { return getObjectType(value) === 'WeakMap'; } -// eslint-disable-next-line @typescript-eslint/ban-types +// eslint-disable-next-line @typescript-eslint/ban-types, unicorn/prevent-abbreviations function isWeakRef(value) { return getObjectType(value) === 'WeakRef'; } @@ -89983,11 +89978,9 @@ const assert = { boundFunction: assertBoundFunction, buffer: assertBuffer, class: assertClass, - class_: assertClass, dataView: assertDataView, date: assertDate, directInstanceOf: assertDirectInstanceOf, - domElement: assertHtmlElement, emptyArray: assertEmptyArray, emptyMap: assertEmptyMap, emptyObject: assertEmptyObject, @@ -90002,7 +89995,6 @@ const assert = { float64Array: assertFloat64Array, formData: assertFormData, function: assertFunction, - function_: assertFunction, generator: assertGenerator, generatorFunction: assertGeneratorFunction, htmlElement: assertHtmlElement, @@ -90025,7 +90017,6 @@ const assert = { nonEmptyString: assertNonEmptyString, nonEmptyStringAndNotWhitespace: assertNonEmptyStringAndNotWhitespace, null: assertNull, - null_: assertNull, nullOrUndefined: assertNullOrUndefined, number: assertNumber, numericString: assertNumericString, @@ -90080,8 +90071,6 @@ const methodTypeMap = { isDataView: 'DataView', isDate: 'Date', isDirectInstanceOf: 'T', - /** @deprecated */ - isDomElement: 'HTMLElement', isEmptyArray: 'empty array', isEmptyMap: 'empty map', isEmptyObject: 'empty object', @@ -90244,6 +90233,9 @@ function assertBoundFunction(value, message) { throw new TypeError(message ?? typeErrorMessage('Function', value)); } } +/** +Note: [Prefer using `Uint8Array` instead of `Buffer`.](https://sindresorhus.com/blog/goodbye-nodejs-buffer) +*/ function assertBuffer(value, message) { if (!isBuffer(value)) { throw new TypeError(message ?? typeErrorMessage('Buffer', value)); @@ -90610,7 +90602,7 @@ function assertWeakMap(value, message) { throw new TypeError(message ?? typeErrorMessage('WeakMap', value)); } } -// eslint-disable-next-line @typescript-eslint/ban-types +// eslint-disable-next-line @typescript-eslint/ban-types, unicorn/prevent-abbreviations function assertWeakRef(value, message) { if (!isWeakRef(value)) { throw new TypeError(message ?? typeErrorMessage('WeakRef', value)); @@ -90627,7 +90619,7 @@ function assertWhitespaceString(value, message) { throw new TypeError(message ?? typeErrorMessage('whitespace string', value)); } } -/* harmony default export */ const dist = (is); +/* harmony default export */ const distribution = (is); // EXTERNAL MODULE: external "node:events" var external_node_events_ = __nccwpck_require__(5673); @@ -90752,11 +90744,11 @@ class PCancelable { Object.setPrototypeOf(PCancelable.prototype, Promise.prototype); -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/errors.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.2/node_modules/got/dist/source/core/errors.js // A hacky check to prevent circular references. function isRequest(x) { - return dist.object(x) && '_onResponse' in x; + return distribution.object(x) && '_onResponse' in x; } /** An error to be thrown when a request fails. @@ -90791,7 +90783,7 @@ class RequestError extends Error { } this.timings = this.request?.timings; // Recover the original stacktrace - if (dist.string(error.stack) && dist.string(this.stack)) { + if (distribution.string(error.stack) && distribution.string(this.stack)) { const indexOfMessage = this.stack.indexOf(this.message) + this.message.length; const thisStackTrace = this.stack.slice(indexOfMessage).split('\n').reverse(); const errorStackTrace = error.stack.slice(error.stack.indexOf(error.message) + error.message.length).split('\n').reverse(); @@ -92170,995 +92162,692 @@ const convertHeaders = (headers) => { } return result; }; -/* harmony default export */ const cacheable_request_dist = (CacheableRequest); +/* harmony default export */ const dist = (CacheableRequest); const onResponse = 'onResponse'; //# sourceMappingURL=index.js.map // EXTERNAL MODULE: ./node_modules/.pnpm/decompress-response@6.0.0/node_modules/decompress-response/index.js var decompress_response = __nccwpck_require__(7748); -;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/contents.js -const source_contents_getStreamContents = async (stream, {init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize}, {maxBuffer = Number.POSITIVE_INFINITY} = {}) => { - if (!contents_isAsyncIterable(stream)) { - throw new Error('The first argument must be a Readable, a ReadableStream, or an async iterable.'); - } - - const state = init(); - state.length = 0; - - try { - for await (const chunk of stream) { - const chunkType = contents_getChunkType(chunk); - const convertedChunk = convertChunk[chunkType](chunk, state); - contents_appendChunk({convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer}); - } - - contents_appendFinalChunk({state, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer}); - return finalize(state); - } catch (error) { - error.bufferedData = finalize(state); - throw error; - } +;// CONCATENATED MODULE: ./node_modules/.pnpm/form-data-encoder@4.0.2/node_modules/form-data-encoder/lib/index.js +var __accessCheck = (obj, member, msg) => { + if (!member.has(obj)) + throw TypeError("Cannot " + msg); }; - -const contents_appendFinalChunk = ({state, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer}) => { - const convertedChunk = getFinalChunk(state); - if (convertedChunk !== undefined) { - contents_appendChunk({convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer}); - } +var __privateGet = (obj, member, getter) => { + __accessCheck(obj, member, "read from private field"); + return getter ? getter.call(obj) : member.get(obj); }; - -const contents_appendChunk = ({convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer}) => { - const chunkSize = getSize(convertedChunk); - const newLength = state.length + chunkSize; - - if (newLength <= maxBuffer) { - contents_addNewChunk(convertedChunk, state, addChunk, newLength); - return; - } - - const truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state.length); - - if (truncatedChunk !== undefined) { - contents_addNewChunk(truncatedChunk, state, addChunk, maxBuffer); - } - - throw new contents_MaxBufferError(); +var __privateAdd = (obj, member, value) => { + if (member.has(obj)) + throw TypeError("Cannot add the same private member more than once"); + member instanceof WeakSet ? member.add(obj) : member.set(obj, value); }; - -const contents_addNewChunk = (convertedChunk, state, addChunk, newLength) => { - state.contents = addChunk(convertedChunk, state, newLength); - state.length = newLength; +var __privateSet = (obj, member, value, setter) => { + __accessCheck(obj, member, "write to private field"); + setter ? setter.call(obj, value) : member.set(obj, value); + return value; }; - -const contents_isAsyncIterable = stream => typeof stream === 'object' && stream !== null && typeof stream[Symbol.asyncIterator] === 'function'; - -const contents_getChunkType = chunk => { - const typeOfChunk = typeof chunk; - - if (typeOfChunk === 'string') { - return 'string'; - } - - if (typeOfChunk !== 'object' || chunk === null) { - return 'others'; - } - - // eslint-disable-next-line n/prefer-global/buffer - if (globalThis.Buffer?.isBuffer(chunk)) { - return 'buffer'; - } - - const prototypeName = contents_objectToString.call(chunk); - - if (prototypeName === '[object ArrayBuffer]') { - return 'arrayBuffer'; - } - - if (prototypeName === '[object DataView]') { - return 'dataView'; - } - - if ( - Number.isInteger(chunk.byteLength) - && Number.isInteger(chunk.byteOffset) - && contents_objectToString.call(chunk.buffer) === '[object ArrayBuffer]' - ) { - return 'typedArray'; - } - - return 'others'; +var __privateMethod = (obj, member, method) => { + __accessCheck(obj, member, "access private method"); + return method; }; -const {toString: contents_objectToString} = Object.prototype; +// src/util/isFunction.ts +var lib_isFunction = (value) => typeof value === "function"; -class contents_MaxBufferError extends Error { - name = 'MaxBufferError'; +// src/util/isAsyncIterable.ts +var lib_isAsyncIterable = (value) => lib_isFunction(value[Symbol.asyncIterator]); - constructor() { - super('maxBuffer exceeded'); - } +// src/util/chunk.ts +var MAX_CHUNK_SIZE = 65536; +function* chunk(value) { + if (value.byteLength <= MAX_CHUNK_SIZE) { + yield value; + return; + } + let offset = 0; + while (offset < value.byteLength) { + const size = Math.min(value.byteLength - offset, MAX_CHUNK_SIZE); + const buffer = value.buffer.slice(offset, offset + size); + offset += buffer.byteLength; + yield new Uint8Array(buffer); + } } -;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/utils.js -const utils_identity = value => value; - -const utils_noop = () => undefined; - -const getContentsProp = ({contents}) => contents; - -const utils_throwObjectStream = chunk => { - throw new Error(`Streams in object mode are not supported: ${String(chunk)}`); +// src/util/getStreamIterator.ts +async function* readStream(readable) { + const reader = readable.getReader(); + while (true) { + const { done, value } = await reader.read(); + if (done) { + break; + } + yield value; + } +} +async function* chunkStream(stream) { + for await (const value of stream) { + yield* chunk(value); + } +} +var getStreamIterator = (source) => { + if (lib_isAsyncIterable(source)) { + return chunkStream(source); + } + if (lib_isFunction(source.getReader)) { + return chunkStream(readStream(source)); + } + throw new TypeError( + "Unsupported data source: Expected either ReadableStream or async iterable." + ); }; -const getLengthProp = convertedChunk => convertedChunk.length; - -;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array.js +// src/util/createBoundary.ts +var alphabet = "abcdefghijklmnopqrstuvwxyz0123456789"; +function createBoundary() { + let size = 16; + let res = ""; + while (size--) { + res += alphabet[Math.random() * alphabet.length << 0]; + } + return res; +} +// src/util/normalizeValue.ts +var normalizeValue = (value) => String(value).replace(/\r|\n/g, (match, i, str) => { + if (match === "\r" && str[i + 1] !== "\n" || match === "\n" && str[i - 1] !== "\r") { + return "\r\n"; + } + return match; +}); +// src/util/isPlainObject.ts +var getType = (value) => Object.prototype.toString.call(value).slice(8, -1).toLowerCase(); +function lib_isPlainObject(value) { + if (getType(value) !== "object") { + return false; + } + const pp = Object.getPrototypeOf(value); + if (pp === null || pp === void 0) { + return true; + } + const Ctor = pp.constructor && pp.constructor.toString(); + return Ctor === Object.toString(); +} -async function getStreamAsArray(stream, options) { - return getStreamContents(stream, arrayMethods, options); +// src/util/proxyHeaders.ts +function getProperty(target, prop) { + if (typeof prop === "string") { + for (const [name, value] of Object.entries(target)) { + if (prop.toLowerCase() === name.toLowerCase()) { + return value; + } + } + } + return void 0; } +var proxyHeaders = (object) => new Proxy( + object, + { + get: (target, prop) => getProperty(target, prop), + has: (target, prop) => getProperty(target, prop) !== void 0 + } +); -const initArray = () => ({contents: []}); +// src/util/isFormData.ts +var lib_isFormData = (value) => Boolean( + value && lib_isFunction(value.constructor) && value[Symbol.toStringTag] === "FormData" && lib_isFunction(value.append) && lib_isFunction(value.getAll) && lib_isFunction(value.entries) && lib_isFunction(value[Symbol.iterator]) +); -const increment = () => 1; +// src/util/escapeName.ts +var escapeName = (name) => String(name).replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/"/g, "%22"); -const addArrayChunk = (convertedChunk, {contents}) => { - contents.push(convertedChunk); - return contents; -}; +// src/util/isFile.ts +var isFile = (value) => Boolean( + value && typeof value === "object" && lib_isFunction(value.constructor) && value[Symbol.toStringTag] === "File" && lib_isFunction(value.stream) && value.name != null +); -const arrayMethods = { - init: initArray, - convertChunk: { - string: utils_identity, - buffer: utils_identity, - arrayBuffer: utils_identity, - dataView: utils_identity, - typedArray: utils_identity, - others: utils_identity, - }, - getSize: increment, - truncateChunk: utils_noop, - addChunk: addArrayChunk, - getFinalChunk: utils_noop, - finalize: getContentsProp, +// src/FormDataEncoder.ts +var defaultOptions = { + enableAdditionalHeaders: false +}; +var readonlyProp = { writable: false, configurable: false }; +var _CRLF, _CRLF_BYTES, _CRLF_BYTES_LENGTH, _DASHES, _encoder, _footer, _form, _options, _getFieldHeader, getFieldHeader_fn, _getContentLength, getContentLength_fn; +var FormDataEncoder = class { + constructor(form, boundaryOrOptions, options) { + __privateAdd(this, _getFieldHeader); + /** + * Returns form-data content length + */ + __privateAdd(this, _getContentLength); + __privateAdd(this, _CRLF, "\r\n"); + __privateAdd(this, _CRLF_BYTES, void 0); + __privateAdd(this, _CRLF_BYTES_LENGTH, void 0); + __privateAdd(this, _DASHES, "-".repeat(2)); + /** + * TextEncoder instance + */ + __privateAdd(this, _encoder, new TextEncoder()); + /** + * Returns form-data footer bytes + */ + __privateAdd(this, _footer, void 0); + /** + * FormData instance + */ + __privateAdd(this, _form, void 0); + /** + * Instance options + */ + __privateAdd(this, _options, void 0); + if (!lib_isFormData(form)) { + throw new TypeError("Expected first argument to be a FormData instance."); + } + let boundary; + if (lib_isPlainObject(boundaryOrOptions)) { + options = boundaryOrOptions; + } else { + boundary = boundaryOrOptions; + } + if (!boundary) { + boundary = createBoundary(); + } + if (typeof boundary !== "string") { + throw new TypeError("Expected boundary argument to be a string."); + } + if (options && !lib_isPlainObject(options)) { + throw new TypeError("Expected options argument to be an object."); + } + __privateSet(this, _form, Array.from(form.entries())); + __privateSet(this, _options, { ...defaultOptions, ...options }); + __privateSet(this, _CRLF_BYTES, __privateGet(this, _encoder).encode(__privateGet(this, _CRLF))); + __privateSet(this, _CRLF_BYTES_LENGTH, __privateGet(this, _CRLF_BYTES).byteLength); + this.boundary = `form-data-boundary-${boundary}`; + this.contentType = `multipart/form-data; boundary=${this.boundary}`; + __privateSet(this, _footer, __privateGet(this, _encoder).encode( + `${__privateGet(this, _DASHES)}${this.boundary}${__privateGet(this, _DASHES)}${__privateGet(this, _CRLF).repeat(2)}` + )); + const headers = { + "Content-Type": this.contentType + }; + const contentLength = __privateMethod(this, _getContentLength, getContentLength_fn).call(this); + if (contentLength) { + this.contentLength = contentLength; + headers["Content-Length"] = contentLength; + } + this.headers = proxyHeaders(Object.freeze(headers)); + Object.defineProperties(this, { + boundary: readonlyProp, + contentType: readonlyProp, + contentLength: readonlyProp, + headers: readonlyProp + }); + } + /** + * Creates an iterator allowing to go through form-data parts (with metadata). + * This method **will not** read the files and **will not** split values big into smaller chunks. + * + * Using this method, you can convert form-data content into Blob: + * + * @example + * + * ```ts + * import {Readable} from "stream" + * + * import {FormDataEncoder} from "form-data-encoder" + * + * import {FormData} from "formdata-polyfill/esm-min.js" + * import {fileFrom} from "fetch-blob/form.js" + * import {File} from "fetch-blob/file.js" + * import {Blob} from "fetch-blob" + * + * import fetch from "node-fetch" + * + * const form = new FormData() + * + * form.set("field", "Just a random string") + * form.set("file", new File(["Using files is class amazing"])) + * form.set("fileFromPath", await fileFrom("path/to/a/file.txt")) + * + * const encoder = new FormDataEncoder(form) + * + * const options = { + * method: "post", + * body: new Blob(encoder, {type: encoder.contentType}) + * } + * + * const response = await fetch("https://httpbin.org/post", options) + * + * console.log(await response.json()) + * ``` + */ + *values() { + for (const [name, raw] of __privateGet(this, _form)) { + const value = isFile(raw) ? raw : __privateGet(this, _encoder).encode( + normalizeValue(raw) + ); + yield __privateMethod(this, _getFieldHeader, getFieldHeader_fn).call(this, name, value); + yield value; + yield __privateGet(this, _CRLF_BYTES); + } + yield __privateGet(this, _footer); + } + /** + * Creates an async iterator allowing to perform the encoding by portions. + * This method reads through files and splits big values into smaller pieces (65536 bytes per each). + * + * @example + * + * ```ts + * import {Readable} from "stream" + * + * import {FormData, File, fileFromPath} from "formdata-node" + * import {FormDataEncoder} from "form-data-encoder" + * + * import fetch from "node-fetch" + * + * const form = new FormData() + * + * form.set("field", "Just a random string") + * form.set("file", new File(["Using files is class amazing"], "file.txt")) + * form.set("fileFromPath", await fileFromPath("path/to/a/file.txt")) + * + * const encoder = new FormDataEncoder(form) + * + * const options = { + * method: "post", + * headers: encoder.headers, + * body: Readable.from(encoder.encode()) // or Readable.from(encoder) + * } + * + * const response = await fetch("https://httpbin.org/post", options) + * + * console.log(await response.json()) + * ``` + */ + async *encode() { + for (const part of this.values()) { + if (isFile(part)) { + yield* getStreamIterator(part.stream()); + } else { + yield* chunk(part); + } + } + } + /** + * Creates an iterator allowing to read through the encoder data using for...of loops + */ + [Symbol.iterator]() { + return this.values(); + } + /** + * Creates an **async** iterator allowing to read through the encoder data using for-await...of loops + */ + [Symbol.asyncIterator]() { + return this.encode(); + } +}; +_CRLF = new WeakMap(); +_CRLF_BYTES = new WeakMap(); +_CRLF_BYTES_LENGTH = new WeakMap(); +_DASHES = new WeakMap(); +_encoder = new WeakMap(); +_footer = new WeakMap(); +_form = new WeakMap(); +_options = new WeakMap(); +_getFieldHeader = new WeakSet(); +getFieldHeader_fn = function(name, value) { + let header = ""; + header += `${__privateGet(this, _DASHES)}${this.boundary}${__privateGet(this, _CRLF)}`; + header += `Content-Disposition: form-data; name="${escapeName(name)}"`; + if (isFile(value)) { + header += `; filename="${escapeName(value.name)}"${__privateGet(this, _CRLF)}`; + header += `Content-Type: ${value.type || "application/octet-stream"}`; + } + if (__privateGet(this, _options).enableAdditionalHeaders === true) { + const size = isFile(value) ? value.size : value.byteLength; + if (size != null && !isNaN(size)) { + header += `${__privateGet(this, _CRLF)}Content-Length: ${size}`; + } + } + return __privateGet(this, _encoder).encode(`${header}${__privateGet(this, _CRLF).repeat(2)}`); +}; +_getContentLength = new WeakSet(); +getContentLength_fn = function() { + let length = 0; + for (const [name, raw] of __privateGet(this, _form)) { + const value = isFile(raw) ? raw : __privateGet(this, _encoder).encode( + normalizeValue(raw) + ); + const size = isFile(value) ? value.size : value.byteLength; + if (size == null || isNaN(size)) { + return void 0; + } + length += __privateMethod(this, _getFieldHeader, getFieldHeader_fn).call(this, name, value).byteLength; + length += size; + length += __privateGet(this, _CRLF_BYTES_LENGTH); + } + return String(length + __privateGet(this, _footer).byteLength); }; - -;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array-buffer.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.2/node_modules/got/dist/source/core/utils/is-form-data.js -async function array_buffer_getStreamAsArrayBuffer(stream, options) { - return source_contents_getStreamContents(stream, array_buffer_arrayBufferMethods, options); +function is_form_data_isFormData(body) { + return distribution.nodeStream(body) && distribution["function"](body.getBoundary); } -const array_buffer_initArrayBuffer = () => ({contents: new ArrayBuffer(0)}); +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.2/node_modules/got/dist/source/core/utils/get-body-size.js -const array_buffer_useTextEncoder = chunk => array_buffer_textEncoder.encode(chunk); -const array_buffer_textEncoder = new TextEncoder(); -const array_buffer_useUint8Array = chunk => new Uint8Array(chunk); -const array_buffer_useUint8ArrayWithOffset = chunk => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength); -const array_buffer_truncateArrayBufferChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize); +async function getBodySize(body, headers) { + if (headers && 'content-length' in headers) { + return Number(headers['content-length']); + } + if (!body) { + return 0; + } + if (distribution.string(body)) { + return external_node_buffer_namespaceObject.Buffer.byteLength(body); + } + if (distribution.buffer(body)) { + return body.length; + } + if (is_form_data_isFormData(body)) { + return (0,external_node_util_.promisify)(body.getLength.bind(body))(); + } + return undefined; +} -// `contents` is an increasingly growing `Uint8Array`. -const array_buffer_addArrayBufferChunk = (convertedChunk, {contents, length: previousLength}, length) => { - const newContents = array_buffer_hasArrayBufferResize() ? array_buffer_resizeArrayBuffer(contents, length) : array_buffer_resizeArrayBufferSlow(contents, length); - new Uint8Array(newContents).set(convertedChunk, previousLength); - return newContents; -}; - -// Without `ArrayBuffer.resize()`, `contents` size is always a power of 2. -// This means its last bytes are zeroes (not stream data), which need to be -// trimmed at the end with `ArrayBuffer.slice()`. -const array_buffer_resizeArrayBufferSlow = (contents, length) => { - if (length <= contents.byteLength) { - return contents; - } - - const arrayBuffer = new ArrayBuffer(array_buffer_getNewContentsLength(length)); - new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0); - return arrayBuffer; -}; - -// With `ArrayBuffer.resize()`, `contents` size matches exactly the size of -// the stream data. It does not include extraneous zeroes to trim at the end. -// The underlying `ArrayBuffer` does allocate a number of bytes that is a power -// of 2, but those bytes are only visible after calling `ArrayBuffer.resize()`. -const array_buffer_resizeArrayBuffer = (contents, length) => { - if (length <= contents.maxByteLength) { - contents.resize(length); - return contents; - } - - const arrayBuffer = new ArrayBuffer(length, {maxByteLength: array_buffer_getNewContentsLength(length)}); - new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0); - return arrayBuffer; -}; - -// Retrieve the closest `length` that is both >= and a power of 2 -const array_buffer_getNewContentsLength = length => array_buffer_SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(array_buffer_SCALE_FACTOR)); - -const array_buffer_SCALE_FACTOR = 2; - -const array_buffer_finalizeArrayBuffer = ({contents, length}) => array_buffer_hasArrayBufferResize() ? contents : contents.slice(0, length); - -// `ArrayBuffer.slice()` is slow. When `ArrayBuffer.resize()` is available -// (Node >=20.0.0, Safari >=16.4 and Chrome), we can use it instead. -// eslint-disable-next-line no-warning-comments -// TODO: remove after dropping support for Node 20. -// eslint-disable-next-line no-warning-comments -// TODO: use `ArrayBuffer.transferToFixedLength()` instead once it is available -const array_buffer_hasArrayBufferResize = () => 'resize' in ArrayBuffer.prototype; - -const array_buffer_arrayBufferMethods = { - init: array_buffer_initArrayBuffer, - convertChunk: { - string: array_buffer_useTextEncoder, - buffer: array_buffer_useUint8Array, - arrayBuffer: array_buffer_useUint8Array, - dataView: array_buffer_useUint8ArrayWithOffset, - typedArray: array_buffer_useUint8ArrayWithOffset, - others: utils_throwObjectStream, - }, - getSize: getLengthProp, - truncateChunk: array_buffer_truncateArrayBufferChunk, - addChunk: array_buffer_addArrayBufferChunk, - getFinalChunk: utils_noop, - finalize: array_buffer_finalizeArrayBuffer, -}; - -;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/buffer.js - - -async function buffer_getStreamAsBuffer(stream, options) { - if (!('Buffer' in globalThis)) { - throw new Error('getStreamAsBuffer() is only supported in Node.js'); - } - - try { - return buffer_arrayBufferToNodeBuffer(await array_buffer_getStreamAsArrayBuffer(stream, options)); - } catch (error) { - if (error.bufferedData !== undefined) { - error.bufferedData = buffer_arrayBufferToNodeBuffer(error.bufferedData); - } - - throw error; - } +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.2/node_modules/got/dist/source/core/utils/proxy-events.js +function proxyEvents(from, to, events) { + const eventFunctions = {}; + for (const event of events) { + const eventFunction = (...arguments_) => { + to.emit(event, ...arguments_); + }; + eventFunctions[event] = eventFunction; + from.on(event, eventFunction); + } + return () => { + for (const [event, eventFunction] of Object.entries(eventFunctions)) { + from.off(event, eventFunction); + } + }; } -// eslint-disable-next-line n/prefer-global/buffer -const buffer_arrayBufferToNodeBuffer = arrayBuffer => globalThis.Buffer.from(arrayBuffer); - -;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/string.js - - - -async function getStreamAsString(stream, options) { - return getStreamContents(stream, stringMethods, options); +;// CONCATENATED MODULE: external "node:net" +const external_node_net_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:net"); +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.2/node_modules/got/dist/source/core/utils/unhandle.js +// When attaching listeners, it's very easy to forget about them. +// Especially if you do error handling and set timeouts. +// So instead of checking if it's proper to throw an error on every timeout ever, +// use this simple tool which will remove all listeners you have attached. +function unhandle() { + const handlers = []; + return { + once(origin, event, function_) { + origin.once(event, function_); + handlers.push({ origin, event, fn: function_ }); + }, + unhandleAll() { + for (const handler of handlers) { + const { origin, event, fn } = handler; + origin.removeListener(event, fn); + } + handlers.length = 0; + }, + }; } -const initString = () => ({contents: '', textDecoder: new TextDecoder()}); - -const useTextDecoder = (chunk, {textDecoder}) => textDecoder.decode(chunk, {stream: true}); - -const addStringChunk = (convertedChunk, {contents}) => contents + convertedChunk; - -const truncateStringChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize); - -const getFinalStringChunk = ({textDecoder}) => { - const finalChunk = textDecoder.decode(); - return finalChunk === '' ? undefined : finalChunk; -}; - -const stringMethods = { - init: initString, - convertChunk: { - string: utils_identity, - buffer: useTextDecoder, - arrayBuffer: useTextDecoder, - dataView: useTextDecoder, - typedArray: useTextDecoder, - others: utils_throwObjectStream, - }, - getSize: getLengthProp, - truncateChunk: truncateStringChunk, - addChunk: addStringChunk, - getFinalChunk: getFinalStringChunk, - finalize: getContentsProp, -}; - -;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/index.js - - - - - - -;// CONCATENATED MODULE: ./node_modules/.pnpm/form-data-encoder@4.0.2/node_modules/form-data-encoder/lib/index.js -var __accessCheck = (obj, member, msg) => { - if (!member.has(obj)) - throw TypeError("Cannot " + msg); -}; -var __privateGet = (obj, member, getter) => { - __accessCheck(obj, member, "read from private field"); - return getter ? getter.call(obj) : member.get(obj); -}; -var __privateAdd = (obj, member, value) => { - if (member.has(obj)) - throw TypeError("Cannot add the same private member more than once"); - member instanceof WeakSet ? member.add(obj) : member.set(obj, value); -}; -var __privateSet = (obj, member, value, setter) => { - __accessCheck(obj, member, "write to private field"); - setter ? setter.call(obj, value) : member.set(obj, value); - return value; -}; -var __privateMethod = (obj, member, method) => { - __accessCheck(obj, member, "access private method"); - return method; -}; - -// src/util/isFunction.ts -var lib_isFunction = (value) => typeof value === "function"; - -// src/util/isAsyncIterable.ts -var lib_isAsyncIterable = (value) => lib_isFunction(value[Symbol.asyncIterator]); +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.2/node_modules/got/dist/source/core/timed-out.js -// src/util/chunk.ts -var MAX_CHUNK_SIZE = 65536; -function* chunk(value) { - if (value.byteLength <= MAX_CHUNK_SIZE) { - yield value; - return; - } - let offset = 0; - while (offset < value.byteLength) { - const size = Math.min(value.byteLength - offset, MAX_CHUNK_SIZE); - const buffer = value.buffer.slice(offset, offset + size); - offset += buffer.byteLength; - yield new Uint8Array(buffer); - } -} -// src/util/getStreamIterator.ts -async function* readStream(readable) { - const reader = readable.getReader(); - while (true) { - const { done, value } = await reader.read(); - if (done) { - break; +const reentry = Symbol('reentry'); +const timed_out_noop = () => { }; +class timed_out_TimeoutError extends Error { + event; + code; + constructor(threshold, event) { + super(`Timeout awaiting '${event}' for ${threshold}ms`); + this.event = event; + this.name = 'TimeoutError'; + this.code = 'ETIMEDOUT'; } - yield value; - } -} -async function* chunkStream(stream) { - for await (const value of stream) { - yield* chunk(value); - } -} -var getStreamIterator = (source) => { - if (lib_isAsyncIterable(source)) { - return chunkStream(source); - } - if (lib_isFunction(source.getReader)) { - return chunkStream(readStream(source)); - } - throw new TypeError( - "Unsupported data source: Expected either ReadableStream or async iterable." - ); -}; - -// src/util/createBoundary.ts -var alphabet = "abcdefghijklmnopqrstuvwxyz0123456789"; -function createBoundary() { - let size = 16; - let res = ""; - while (size--) { - res += alphabet[Math.random() * alphabet.length << 0]; - } - return res; } - -// src/util/normalizeValue.ts -var normalizeValue = (value) => String(value).replace(/\r|\n/g, (match, i, str) => { - if (match === "\r" && str[i + 1] !== "\n" || match === "\n" && str[i - 1] !== "\r") { - return "\r\n"; - } - return match; -}); - -// src/util/isPlainObject.ts -var getType = (value) => Object.prototype.toString.call(value).slice(8, -1).toLowerCase(); -function lib_isPlainObject(value) { - if (getType(value) !== "object") { - return false; - } - const pp = Object.getPrototypeOf(value); - if (pp === null || pp === void 0) { - return true; - } - const Ctor = pp.constructor && pp.constructor.toString(); - return Ctor === Object.toString(); -} - -// src/util/proxyHeaders.ts -function getProperty(target, prop) { - if (typeof prop === "string") { - for (const [name, value] of Object.entries(target)) { - if (prop.toLowerCase() === name.toLowerCase()) { - return value; - } +function timedOut(request, delays, options) { + if (reentry in request) { + return timed_out_noop; } - } - return void 0; + request[reentry] = true; + const cancelers = []; + const { once, unhandleAll } = unhandle(); + const addTimeout = (delay, callback, event) => { + const timeout = setTimeout(callback, delay, delay, event); + timeout.unref?.(); + const cancel = () => { + clearTimeout(timeout); + }; + cancelers.push(cancel); + return cancel; + }; + const { host, hostname } = options; + const timeoutHandler = (delay, event) => { + request.destroy(new timed_out_TimeoutError(delay, event)); + }; + const cancelTimeouts = () => { + for (const cancel of cancelers) { + cancel(); + } + unhandleAll(); + }; + request.once('error', error => { + cancelTimeouts(); + // Save original behavior + /* istanbul ignore next */ + if (request.listenerCount('error') === 0) { + throw error; + } + }); + if (delays.request !== undefined) { + const cancelTimeout = addTimeout(delays.request, timeoutHandler, 'request'); + once(request, 'response', (response) => { + once(response, 'end', cancelTimeout); + }); + } + if (delays.socket !== undefined) { + const { socket } = delays; + const socketTimeoutHandler = () => { + timeoutHandler(socket, 'socket'); + }; + request.setTimeout(socket, socketTimeoutHandler); + // `request.setTimeout(0)` causes a memory leak. + // We can just remove the listener and forget about the timer - it's unreffed. + // See https://github.com/sindresorhus/got/issues/690 + cancelers.push(() => { + request.removeListener('timeout', socketTimeoutHandler); + }); + } + const hasLookup = delays.lookup !== undefined; + const hasConnect = delays.connect !== undefined; + const hasSecureConnect = delays.secureConnect !== undefined; + const hasSend = delays.send !== undefined; + if (hasLookup || hasConnect || hasSecureConnect || hasSend) { + once(request, 'socket', (socket) => { + const { socketPath } = request; + /* istanbul ignore next: hard to test */ + if (socket.connecting) { + const hasPath = Boolean(socketPath ?? external_node_net_namespaceObject.isIP(hostname ?? host ?? '') !== 0); + if (hasLookup && !hasPath && socket.address().address === undefined) { + const cancelTimeout = addTimeout(delays.lookup, timeoutHandler, 'lookup'); + once(socket, 'lookup', cancelTimeout); + } + if (hasConnect) { + const timeConnect = () => addTimeout(delays.connect, timeoutHandler, 'connect'); + if (hasPath) { + once(socket, 'connect', timeConnect()); + } + else { + once(socket, 'lookup', (error) => { + if (error === null) { + once(socket, 'connect', timeConnect()); + } + }); + } + } + if (hasSecureConnect && options.protocol === 'https:') { + once(socket, 'connect', () => { + const cancelTimeout = addTimeout(delays.secureConnect, timeoutHandler, 'secureConnect'); + once(socket, 'secureConnect', cancelTimeout); + }); + } + } + if (hasSend) { + const timeRequest = () => addTimeout(delays.send, timeoutHandler, 'send'); + /* istanbul ignore next: hard to test */ + if (socket.connecting) { + once(socket, 'connect', () => { + once(request, 'upload-complete', timeRequest()); + }); + } + else { + once(request, 'upload-complete', timeRequest()); + } + } + }); + } + if (delays.response !== undefined) { + once(request, 'upload-complete', () => { + const cancelTimeout = addTimeout(delays.response, timeoutHandler, 'response'); + once(request, 'response', cancelTimeout); + }); + } + if (delays.read !== undefined) { + once(request, 'response', (response) => { + const cancelTimeout = addTimeout(delays.read, timeoutHandler, 'read'); + once(response, 'end', cancelTimeout); + }); + } + return cancelTimeouts; } -var proxyHeaders = (object) => new Proxy( - object, - { - get: (target, prop) => getProperty(target, prop), - has: (target, prop) => getProperty(target, prop) !== void 0 - } -); - -// src/util/isFormData.ts -var lib_isFormData = (value) => Boolean( - value && lib_isFunction(value.constructor) && value[Symbol.toStringTag] === "FormData" && lib_isFunction(value.append) && lib_isFunction(value.getAll) && lib_isFunction(value.entries) && lib_isFunction(value[Symbol.iterator]) -); -// src/util/escapeName.ts -var escapeName = (name) => String(name).replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/"/g, "%22"); +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.2/node_modules/got/dist/source/core/utils/url-to-options.js -// src/util/isFile.ts -var isFile = (value) => Boolean( - value && typeof value === "object" && lib_isFunction(value.constructor) && value[Symbol.toStringTag] === "File" && lib_isFunction(value.stream) && value.name != null -); +function urlToOptions(url) { + // Cast to URL + url = url; + const options = { + protocol: url.protocol, + hostname: distribution.string(url.hostname) && url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname, + host: url.host, + hash: url.hash, + search: url.search, + pathname: url.pathname, + href: url.href, + path: `${url.pathname || ''}${url.search || ''}`, + }; + if (distribution.string(url.port) && url.port.length > 0) { + options.port = Number(url.port); + } + if (url.username || url.password) { + options.auth = `${url.username || ''}:${url.password || ''}`; + } + return options; +} -// src/FormDataEncoder.ts -var defaultOptions = { - enableAdditionalHeaders: false -}; -var readonlyProp = { writable: false, configurable: false }; -var _CRLF, _CRLF_BYTES, _CRLF_BYTES_LENGTH, _DASHES, _encoder, _footer, _form, _options, _getFieldHeader, getFieldHeader_fn, _getContentLength, getContentLength_fn; -var FormDataEncoder = class { - constructor(form, boundaryOrOptions, options) { - __privateAdd(this, _getFieldHeader); - /** - * Returns form-data content length - */ - __privateAdd(this, _getContentLength); - __privateAdd(this, _CRLF, "\r\n"); - __privateAdd(this, _CRLF_BYTES, void 0); - __privateAdd(this, _CRLF_BYTES_LENGTH, void 0); - __privateAdd(this, _DASHES, "-".repeat(2)); - /** - * TextEncoder instance - */ - __privateAdd(this, _encoder, new TextEncoder()); - /** - * Returns form-data footer bytes - */ - __privateAdd(this, _footer, void 0); - /** - * FormData instance - */ - __privateAdd(this, _form, void 0); - /** - * Instance options - */ - __privateAdd(this, _options, void 0); - if (!lib_isFormData(form)) { - throw new TypeError("Expected first argument to be a FormData instance."); +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.2/node_modules/got/dist/source/core/utils/weakable-map.js +class WeakableMap { + weakMap; + map; + constructor() { + this.weakMap = new WeakMap(); + this.map = new Map(); } - let boundary; - if (lib_isPlainObject(boundaryOrOptions)) { - options = boundaryOrOptions; - } else { - boundary = boundaryOrOptions; + set(key, value) { + if (typeof key === 'object') { + this.weakMap.set(key, value); + } + else { + this.map.set(key, value); + } } - if (!boundary) { - boundary = createBoundary(); + get(key) { + if (typeof key === 'object') { + return this.weakMap.get(key); + } + return this.map.get(key); } - if (typeof boundary !== "string") { - throw new TypeError("Expected boundary argument to be a string."); + has(key) { + if (typeof key === 'object') { + return this.weakMap.has(key); + } + return this.map.has(key); } - if (options && !lib_isPlainObject(options)) { - throw new TypeError("Expected options argument to be an object."); +} + +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.2/node_modules/got/dist/source/core/calculate-retry-delay.js +const calculateRetryDelay = ({ attemptCount, retryOptions, error, retryAfter, computedValue, }) => { + if (error.name === 'RetryError') { + return 1; } - __privateSet(this, _form, Array.from(form.entries())); - __privateSet(this, _options, { ...defaultOptions, ...options }); - __privateSet(this, _CRLF_BYTES, __privateGet(this, _encoder).encode(__privateGet(this, _CRLF))); - __privateSet(this, _CRLF_BYTES_LENGTH, __privateGet(this, _CRLF_BYTES).byteLength); - this.boundary = `form-data-boundary-${boundary}`; - this.contentType = `multipart/form-data; boundary=${this.boundary}`; - __privateSet(this, _footer, __privateGet(this, _encoder).encode( - `${__privateGet(this, _DASHES)}${this.boundary}${__privateGet(this, _DASHES)}${__privateGet(this, _CRLF).repeat(2)}` - )); - const headers = { - "Content-Type": this.contentType - }; - const contentLength = __privateMethod(this, _getContentLength, getContentLength_fn).call(this); - if (contentLength) { - this.contentLength = contentLength; - headers["Content-Length"] = contentLength; - } - this.headers = proxyHeaders(Object.freeze(headers)); - Object.defineProperties(this, { - boundary: readonlyProp, - contentType: readonlyProp, - contentLength: readonlyProp, - headers: readonlyProp - }); - } - /** - * Creates an iterator allowing to go through form-data parts (with metadata). - * This method **will not** read the files and **will not** split values big into smaller chunks. - * - * Using this method, you can convert form-data content into Blob: - * - * @example - * - * ```ts - * import {Readable} from "stream" - * - * import {FormDataEncoder} from "form-data-encoder" - * - * import {FormData} from "formdata-polyfill/esm-min.js" - * import {fileFrom} from "fetch-blob/form.js" - * import {File} from "fetch-blob/file.js" - * import {Blob} from "fetch-blob" - * - * import fetch from "node-fetch" - * - * const form = new FormData() - * - * form.set("field", "Just a random string") - * form.set("file", new File(["Using files is class amazing"])) - * form.set("fileFromPath", await fileFrom("path/to/a/file.txt")) - * - * const encoder = new FormDataEncoder(form) - * - * const options = { - * method: "post", - * body: new Blob(encoder, {type: encoder.contentType}) - * } - * - * const response = await fetch("https://httpbin.org/post", options) - * - * console.log(await response.json()) - * ``` - */ - *values() { - for (const [name, raw] of __privateGet(this, _form)) { - const value = isFile(raw) ? raw : __privateGet(this, _encoder).encode( - normalizeValue(raw) - ); - yield __privateMethod(this, _getFieldHeader, getFieldHeader_fn).call(this, name, value); - yield value; - yield __privateGet(this, _CRLF_BYTES); - } - yield __privateGet(this, _footer); - } - /** - * Creates an async iterator allowing to perform the encoding by portions. - * This method reads through files and splits big values into smaller pieces (65536 bytes per each). - * - * @example - * - * ```ts - * import {Readable} from "stream" - * - * import {FormData, File, fileFromPath} from "formdata-node" - * import {FormDataEncoder} from "form-data-encoder" - * - * import fetch from "node-fetch" - * - * const form = new FormData() - * - * form.set("field", "Just a random string") - * form.set("file", new File(["Using files is class amazing"], "file.txt")) - * form.set("fileFromPath", await fileFromPath("path/to/a/file.txt")) - * - * const encoder = new FormDataEncoder(form) - * - * const options = { - * method: "post", - * headers: encoder.headers, - * body: Readable.from(encoder.encode()) // or Readable.from(encoder) - * } - * - * const response = await fetch("https://httpbin.org/post", options) - * - * console.log(await response.json()) - * ``` - */ - async *encode() { - for (const part of this.values()) { - if (isFile(part)) { - yield* getStreamIterator(part.stream()); - } else { - yield* chunk(part); - } + if (attemptCount > retryOptions.limit) { + return 0; } - } - /** - * Creates an iterator allowing to read through the encoder data using for...of loops - */ - [Symbol.iterator]() { - return this.values(); - } - /** - * Creates an **async** iterator allowing to read through the encoder data using for-await...of loops - */ - [Symbol.asyncIterator]() { - return this.encode(); - } -}; -_CRLF = new WeakMap(); -_CRLF_BYTES = new WeakMap(); -_CRLF_BYTES_LENGTH = new WeakMap(); -_DASHES = new WeakMap(); -_encoder = new WeakMap(); -_footer = new WeakMap(); -_form = new WeakMap(); -_options = new WeakMap(); -_getFieldHeader = new WeakSet(); -getFieldHeader_fn = function(name, value) { - let header = ""; - header += `${__privateGet(this, _DASHES)}${this.boundary}${__privateGet(this, _CRLF)}`; - header += `Content-Disposition: form-data; name="${escapeName(name)}"`; - if (isFile(value)) { - header += `; filename="${escapeName(value.name)}"${__privateGet(this, _CRLF)}`; - header += `Content-Type: ${value.type || "application/octet-stream"}`; - } - if (__privateGet(this, _options).enableAdditionalHeaders === true) { - const size = isFile(value) ? value.size : value.byteLength; - if (size != null && !isNaN(size)) { - header += `${__privateGet(this, _CRLF)}Content-Length: ${size}`; + const hasMethod = retryOptions.methods.includes(error.options.method); + const hasErrorCode = retryOptions.errorCodes.includes(error.code); + const hasStatusCode = error.response && retryOptions.statusCodes.includes(error.response.statusCode); + if (!hasMethod || (!hasErrorCode && !hasStatusCode)) { + return 0; } - } - return __privateGet(this, _encoder).encode(`${header}${__privateGet(this, _CRLF).repeat(2)}`); -}; -_getContentLength = new WeakSet(); -getContentLength_fn = function() { - let length = 0; - for (const [name, raw] of __privateGet(this, _form)) { - const value = isFile(raw) ? raw : __privateGet(this, _encoder).encode( - normalizeValue(raw) - ); - const size = isFile(value) ? value.size : value.byteLength; - if (size == null || isNaN(size)) { - return void 0; + if (error.response) { + if (retryAfter) { + // In this case `computedValue` is `options.request.timeout` + if (retryAfter > computedValue) { + return 0; + } + return retryAfter; + } + if (error.response.statusCode === 413) { + return 0; + } } - length += __privateMethod(this, _getFieldHeader, getFieldHeader_fn).call(this, name, value).byteLength; - length += size; - length += __privateGet(this, _CRLF_BYTES_LENGTH); - } - return String(length + __privateGet(this, _footer).byteLength); + const noise = Math.random() * retryOptions.noise; + return Math.min(((2 ** (attemptCount - 1)) * 1000), retryOptions.backoffLimit) + noise; }; +/* harmony default export */ const calculate_retry_delay = (calculateRetryDelay); +;// CONCATENATED MODULE: external "node:tls" +const external_node_tls_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:tls"); +;// CONCATENATED MODULE: external "node:https" +const external_node_https_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:https"); +;// CONCATENATED MODULE: external "node:dns" +const external_node_dns_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:dns"); +;// CONCATENATED MODULE: ./node_modules/.pnpm/cacheable-lookup@7.0.0/node_modules/cacheable-lookup/source/index.js -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/utils/is-form-data.js -function is_form_data_isFormData(body) { - return dist.nodeStream(body) && dist.function_(body.getBoundary); -} -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/utils/get-body-size.js +const {Resolver: AsyncResolver} = external_node_dns_namespaceObject.promises; +const kCacheableLookupCreateConnection = Symbol('cacheableLookupCreateConnection'); +const kCacheableLookupInstance = Symbol('cacheableLookupInstance'); +const kExpires = Symbol('expires'); +const supportsALL = typeof external_node_dns_namespaceObject.ALL === 'number'; -async function getBodySize(body, headers) { - if (headers && 'content-length' in headers) { - return Number(headers['content-length']); - } - if (!body) { - return 0; - } - if (dist.string(body)) { - return external_node_buffer_namespaceObject.Buffer.byteLength(body); - } - if (dist.buffer(body)) { - return body.length; - } - if (is_form_data_isFormData(body)) { - return (0,external_node_util_.promisify)(body.getLength.bind(body))(); - } - return undefined; -} +const verifyAgent = agent => { + if (!(agent && typeof agent.createConnection === 'function')) { + throw new Error('Expected an Agent instance as the first argument'); + } +}; -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/utils/proxy-events.js -function proxyEvents(from, to, events) { - const eventFunctions = {}; - for (const event of events) { - const eventFunction = (...arguments_) => { - to.emit(event, ...arguments_); - }; - eventFunctions[event] = eventFunction; - from.on(event, eventFunction); - } - return () => { - for (const [event, eventFunction] of Object.entries(eventFunctions)) { - from.off(event, eventFunction); - } - }; -} - -;// CONCATENATED MODULE: external "node:net" -const external_node_net_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:net"); -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/utils/unhandle.js -// When attaching listeners, it's very easy to forget about them. -// Especially if you do error handling and set timeouts. -// So instead of checking if it's proper to throw an error on every timeout ever, -// use this simple tool which will remove all listeners you have attached. -function unhandle() { - const handlers = []; - return { - once(origin, event, function_) { - origin.once(event, function_); - handlers.push({ origin, event, fn: function_ }); - }, - unhandleAll() { - for (const handler of handlers) { - const { origin, event, fn } = handler; - origin.removeListener(event, fn); - } - handlers.length = 0; - }, - }; -} - -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/timed-out.js - - -const reentry = Symbol('reentry'); -const timed_out_noop = () => { }; -class timed_out_TimeoutError extends Error { - event; - code; - constructor(threshold, event) { - super(`Timeout awaiting '${event}' for ${threshold}ms`); - this.event = event; - this.name = 'TimeoutError'; - this.code = 'ETIMEDOUT'; - } -} -function timedOut(request, delays, options) { - if (reentry in request) { - return timed_out_noop; - } - request[reentry] = true; - const cancelers = []; - const { once, unhandleAll } = unhandle(); - const addTimeout = (delay, callback, event) => { - const timeout = setTimeout(callback, delay, delay, event); - timeout.unref?.(); - const cancel = () => { - clearTimeout(timeout); - }; - cancelers.push(cancel); - return cancel; - }; - const { host, hostname } = options; - const timeoutHandler = (delay, event) => { - request.destroy(new timed_out_TimeoutError(delay, event)); - }; - const cancelTimeouts = () => { - for (const cancel of cancelers) { - cancel(); - } - unhandleAll(); - }; - request.once('error', error => { - cancelTimeouts(); - // Save original behavior - /* istanbul ignore next */ - if (request.listenerCount('error') === 0) { - throw error; - } - }); - if (delays.request !== undefined) { - const cancelTimeout = addTimeout(delays.request, timeoutHandler, 'request'); - once(request, 'response', (response) => { - once(response, 'end', cancelTimeout); - }); - } - if (delays.socket !== undefined) { - const { socket } = delays; - const socketTimeoutHandler = () => { - timeoutHandler(socket, 'socket'); - }; - request.setTimeout(socket, socketTimeoutHandler); - // `request.setTimeout(0)` causes a memory leak. - // We can just remove the listener and forget about the timer - it's unreffed. - // See https://github.com/sindresorhus/got/issues/690 - cancelers.push(() => { - request.removeListener('timeout', socketTimeoutHandler); - }); - } - const hasLookup = delays.lookup !== undefined; - const hasConnect = delays.connect !== undefined; - const hasSecureConnect = delays.secureConnect !== undefined; - const hasSend = delays.send !== undefined; - if (hasLookup || hasConnect || hasSecureConnect || hasSend) { - once(request, 'socket', (socket) => { - const { socketPath } = request; - /* istanbul ignore next: hard to test */ - if (socket.connecting) { - const hasPath = Boolean(socketPath ?? external_node_net_namespaceObject.isIP(hostname ?? host ?? '') !== 0); - if (hasLookup && !hasPath && socket.address().address === undefined) { - const cancelTimeout = addTimeout(delays.lookup, timeoutHandler, 'lookup'); - once(socket, 'lookup', cancelTimeout); - } - if (hasConnect) { - const timeConnect = () => addTimeout(delays.connect, timeoutHandler, 'connect'); - if (hasPath) { - once(socket, 'connect', timeConnect()); - } - else { - once(socket, 'lookup', (error) => { - if (error === null) { - once(socket, 'connect', timeConnect()); - } - }); - } - } - if (hasSecureConnect && options.protocol === 'https:') { - once(socket, 'connect', () => { - const cancelTimeout = addTimeout(delays.secureConnect, timeoutHandler, 'secureConnect'); - once(socket, 'secureConnect', cancelTimeout); - }); - } - } - if (hasSend) { - const timeRequest = () => addTimeout(delays.send, timeoutHandler, 'send'); - /* istanbul ignore next: hard to test */ - if (socket.connecting) { - once(socket, 'connect', () => { - once(request, 'upload-complete', timeRequest()); - }); - } - else { - once(request, 'upload-complete', timeRequest()); - } - } - }); - } - if (delays.response !== undefined) { - once(request, 'upload-complete', () => { - const cancelTimeout = addTimeout(delays.response, timeoutHandler, 'response'); - once(request, 'response', cancelTimeout); - }); - } - if (delays.read !== undefined) { - once(request, 'response', (response) => { - const cancelTimeout = addTimeout(delays.read, timeoutHandler, 'read'); - once(response, 'end', cancelTimeout); - }); - } - return cancelTimeouts; -} - -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/utils/url-to-options.js - -function urlToOptions(url) { - // Cast to URL - url = url; - const options = { - protocol: url.protocol, - hostname: dist.string(url.hostname) && url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname, - host: url.host, - hash: url.hash, - search: url.search, - pathname: url.pathname, - href: url.href, - path: `${url.pathname || ''}${url.search || ''}`, - }; - if (dist.string(url.port) && url.port.length > 0) { - options.port = Number(url.port); - } - if (url.username || url.password) { - options.auth = `${url.username || ''}:${url.password || ''}`; - } - return options; -} - -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/utils/weakable-map.js -class WeakableMap { - weakMap; - map; - constructor() { - this.weakMap = new WeakMap(); - this.map = new Map(); - } - set(key, value) { - if (typeof key === 'object') { - this.weakMap.set(key, value); - } - else { - this.map.set(key, value); - } - } - get(key) { - if (typeof key === 'object') { - return this.weakMap.get(key); - } - return this.map.get(key); - } - has(key) { - if (typeof key === 'object') { - return this.weakMap.has(key); - } - return this.map.has(key); - } -} - -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/calculate-retry-delay.js -const calculateRetryDelay = ({ attemptCount, retryOptions, error, retryAfter, computedValue, }) => { - if (error.name === 'RetryError') { - return 1; - } - if (attemptCount > retryOptions.limit) { - return 0; - } - const hasMethod = retryOptions.methods.includes(error.options.method); - const hasErrorCode = retryOptions.errorCodes.includes(error.code); - const hasStatusCode = error.response && retryOptions.statusCodes.includes(error.response.statusCode); - if (!hasMethod || (!hasErrorCode && !hasStatusCode)) { - return 0; - } - if (error.response) { - if (retryAfter) { - // In this case `computedValue` is `options.request.timeout` - if (retryAfter > computedValue) { - return 0; - } - return retryAfter; - } - if (error.response.statusCode === 413) { - return 0; - } - } - const noise = Math.random() * retryOptions.noise; - return Math.min(((2 ** (attemptCount - 1)) * 1000), retryOptions.backoffLimit) + noise; -}; -/* harmony default export */ const calculate_retry_delay = (calculateRetryDelay); - -;// CONCATENATED MODULE: external "node:tls" -const external_node_tls_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:tls"); -;// CONCATENATED MODULE: external "node:https" -const external_node_https_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:https"); -;// CONCATENATED MODULE: external "node:dns" -const external_node_dns_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:dns"); -;// CONCATENATED MODULE: ./node_modules/.pnpm/cacheable-lookup@7.0.0/node_modules/cacheable-lookup/source/index.js - - - - -const {Resolver: AsyncResolver} = external_node_dns_namespaceObject.promises; - -const kCacheableLookupCreateConnection = Symbol('cacheableLookupCreateConnection'); -const kCacheableLookupInstance = Symbol('cacheableLookupInstance'); -const kExpires = Symbol('expires'); - -const supportsALL = typeof external_node_dns_namespaceObject.ALL === 'number'; - -const verifyAgent = agent => { - if (!(agent && typeof agent.createConnection === 'function')) { - throw new Error('Expected an Agent instance as the first argument'); - } -}; - -const map4to6 = entries => { - for (const entry of entries) { - if (entry.family === 6) { - continue; - } +const map4to6 = entries => { + for (const entry of entries) { + if (entry.family === 6) { + continue; + } entry.address = `::ffff:${entry.address}`; entry.family = 6; @@ -93585,7 +93274,7 @@ class CacheableLookup { // EXTERNAL MODULE: ./node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/index.js var http2_wrapper_source = __nccwpck_require__(9695); -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/parse-link-header.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.2/node_modules/got/dist/source/core/parse-link-header.js function parseLinkHeader(link) { const parsed = []; const items = link.split(','); @@ -93620,7 +93309,7 @@ function parseLinkHeader(link) { return parsed; } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/options.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.2/node_modules/got/dist/source/core/options.js @@ -93638,7 +93327,7 @@ function validateSearchParameters(searchParameters) { // eslint-disable-next-line guard-for-in for (const key in searchParameters) { const value = searchParameters[key]; - assert.any([dist.string, dist.number, dist.boolean, dist.null_, dist.undefined], value); + assert.any([distribution.string, distribution.number, distribution.boolean, distribution["null"], distribution.undefined], value); } } const globalCache = new Map(); @@ -93840,64 +93529,64 @@ const cloneInternals = (internals) => { const cloneRaw = (raw) => { const { hooks, retry } = raw; const result = { ...raw }; - if (dist.object(raw.context)) { + if (distribution.object(raw.context)) { result.context = { ...raw.context }; } - if (dist.object(raw.cacheOptions)) { + if (distribution.object(raw.cacheOptions)) { result.cacheOptions = { ...raw.cacheOptions }; } - if (dist.object(raw.https)) { + if (distribution.object(raw.https)) { result.https = { ...raw.https }; } - if (dist.object(raw.cacheOptions)) { + if (distribution.object(raw.cacheOptions)) { result.cacheOptions = { ...result.cacheOptions }; } - if (dist.object(raw.agent)) { + if (distribution.object(raw.agent)) { result.agent = { ...raw.agent }; } - if (dist.object(raw.headers)) { + if (distribution.object(raw.headers)) { result.headers = { ...raw.headers }; } - if (dist.object(retry)) { + if (distribution.object(retry)) { result.retry = { ...retry }; - if (dist.array(retry.errorCodes)) { + if (distribution.array(retry.errorCodes)) { result.retry.errorCodes = [...retry.errorCodes]; } - if (dist.array(retry.methods)) { + if (distribution.array(retry.methods)) { result.retry.methods = [...retry.methods]; } - if (dist.array(retry.statusCodes)) { + if (distribution.array(retry.statusCodes)) { result.retry.statusCodes = [...retry.statusCodes]; } } - if (dist.object(raw.timeout)) { + if (distribution.object(raw.timeout)) { result.timeout = { ...raw.timeout }; } - if (dist.object(hooks)) { + if (distribution.object(hooks)) { result.hooks = { ...hooks, }; - if (dist.array(hooks.init)) { + if (distribution.array(hooks.init)) { result.hooks.init = [...hooks.init]; } - if (dist.array(hooks.beforeRequest)) { + if (distribution.array(hooks.beforeRequest)) { result.hooks.beforeRequest = [...hooks.beforeRequest]; } - if (dist.array(hooks.beforeError)) { + if (distribution.array(hooks.beforeError)) { result.hooks.beforeError = [...hooks.beforeError]; } - if (dist.array(hooks.beforeRedirect)) { + if (distribution.array(hooks.beforeRedirect)) { result.hooks.beforeRedirect = [...hooks.beforeRedirect]; } - if (dist.array(hooks.beforeRetry)) { + if (distribution.array(hooks.beforeRetry)) { result.hooks.beforeRetry = [...hooks.beforeRetry]; } - if (dist.array(hooks.afterResponse)) { + if (distribution.array(hooks.afterResponse)) { result.hooks.afterResponse = [...hooks.afterResponse]; } } // TODO: raw.searchParams - if (dist.object(raw.pagination)) { + if (distribution.object(raw.pagination)) { result.pagination = { ...raw.pagination }; } return result; @@ -93923,9 +93612,9 @@ class Options { _merging; _init; constructor(input, options, defaults) { - assert.any([dist.string, dist.urlInstance, dist.object, dist.undefined], input); - assert.any([dist.object, dist.undefined], options); - assert.any([dist.object, dist.undefined], defaults); + assert.any([distribution.string, distribution.urlInstance, distribution.object, distribution.undefined], input); + assert.any([distribution.object, distribution.undefined], options); + assert.any([distribution.object, distribution.undefined], defaults); if (input instanceof Options || options instanceof Options) { throw new TypeError('The defaults must be passed as the third argument'); } @@ -93943,7 +93632,7 @@ class Options { // /* eslint-disable no-unsafe-finally */ try { - if (dist.plainObject(input)) { + if (distribution.plainObject(input)) { try { this.merge(input); this.merge(options); @@ -94036,7 +93725,7 @@ class Options { return this._internals.request; } set request(value) { - assert.any([dist.function_, dist.undefined], value); + assert.any([distribution["function"], distribution.undefined], value); this._internals.request = value; } /** @@ -94072,7 +93761,7 @@ class Options { throw new TypeError(`Unexpected agent option: ${key}`); } // @ts-expect-error - No idea why `value[key]` doesn't work here. - assert.any([dist.object, dist.undefined], value[key]); + assert.any([distribution.object, distribution.undefined], value[key]); } if (this._merging) { Object.assign(this._internals.agent, value); @@ -94132,7 +93821,7 @@ class Options { throw new Error(`Unexpected timeout option: ${key}`); } // @ts-expect-error - No idea why `value[key]` doesn't work here. - assert.any([dist.number, dist.undefined], value[key]); + assert.any([distribution.number, distribution.undefined], value[key]); } if (this._merging) { Object.assign(this._internals.timeout, value); @@ -94186,7 +93875,7 @@ class Options { return this._internals.prefixUrl; } set prefixUrl(value) { - assert.any([dist.string, dist.urlInstance], value); + assert.any([distribution.string, distribution.urlInstance], value); if (value === '') { this._internals.prefixUrl = ''; return; @@ -94218,8 +93907,8 @@ class Options { return this._internals.body; } set body(value) { - assert.any([dist.string, dist.buffer, dist.nodeStream, dist.generator, dist.asyncGenerator, lib_isFormData, dist.undefined], value); - if (dist.nodeStream(value)) { + assert.any([distribution.string, distribution.buffer, distribution.nodeStream, distribution.generator, distribution.asyncGenerator, lib_isFormData, distribution.undefined], value); + if (distribution.nodeStream(value)) { assert.truthy(value.readable); } if (value !== undefined) { @@ -94241,7 +93930,7 @@ class Options { return this._internals.form; } set form(value) { - assert.any([dist.plainObject, dist.undefined], value); + assert.any([distribution.plainObject, distribution.undefined], value); if (value !== undefined) { assert.undefined(this._internals.body); assert.undefined(this._internals.json); @@ -94287,12 +93976,12 @@ class Options { return this._internals.url; } set url(value) { - assert.any([dist.string, dist.urlInstance, dist.undefined], value); + assert.any([distribution.string, distribution.urlInstance, distribution.undefined], value); if (value === undefined) { this._internals.url = undefined; return; } - if (dist.string(value) && value.startsWith('/')) { + if (distribution.string(value) && value.startsWith('/')) { throw new Error('`url` must not start with a slash'); } const urlString = `${this.prefixUrl}${value.toString()}`; @@ -94347,14 +94036,14 @@ class Options { return this._internals.cookieJar; } set cookieJar(value) { - assert.any([dist.object, dist.undefined], value); + assert.any([distribution.object, distribution.undefined], value); if (value === undefined) { this._internals.cookieJar = undefined; return; } let { setCookie, getCookieString } = value; - assert.function_(setCookie); - assert.function_(getCookieString); + assert["function"](setCookie); + assert["function"](getCookieString); /* istanbul ignore next: Horrible `tough-cookie` v3 check */ if (setCookie.length === 4 && getCookieString.length === 0) { setCookie = (0,external_node_util_.promisify)(setCookie.bind(value)); @@ -94434,7 +94123,7 @@ class Options { return this._internals.searchParams; } set searchParams(value) { - assert.any([dist.string, dist.object, dist.undefined], value); + assert.any([distribution.string, distribution.object, distribution.undefined], value); const url = this._internals.url; if (value === undefined) { this._internals.searchParams = undefined; @@ -94445,7 +94134,7 @@ class Options { } const searchParameters = this.searchParams; let updated; - if (dist.string(value)) { + if (distribution.string(value)) { updated = new URLSearchParams(value); } else if (value instanceof URLSearchParams) { @@ -94494,7 +94183,7 @@ class Options { return this._internals.dnsLookup; } set dnsLookup(value) { - assert.any([dist.function_, dist.undefined], value); + assert.any([distribution["function"], distribution.undefined], value); this._internals.dnsLookup = value; } /** @@ -94511,7 +94200,7 @@ class Options { return this._internals.dnsCache; } set dnsCache(value) { - assert.any([dist.object, dist.boolean, dist.undefined], value); + assert.any([distribution.object, distribution.boolean, distribution.undefined], value); if (value === true) { this._internals.dnsCache = getGlobalDnsCache(); } @@ -94581,10 +94270,10 @@ class Options { } const typedKnownHookEvent = knownHookEvent; const hooks = value[typedKnownHookEvent]; - assert.any([dist.array, dist.undefined], hooks); + assert.any([distribution.array, distribution.undefined], hooks); if (hooks) { for (const hook of hooks) { - assert.function_(hook); + assert["function"](hook); } } if (this._merging) { @@ -94616,7 +94305,7 @@ class Options { return this._internals.followRedirect; } set followRedirect(value) { - assert.any([dist.boolean, dist.function_], value); + assert.any([distribution.boolean, distribution["function"]], value); this._internals.followRedirect = value; } get followRedirects() { @@ -94646,7 +94335,7 @@ class Options { return this._internals.cache; } set cache(value) { - assert.any([dist.object, dist.string, dist.boolean, dist.undefined], value); + assert.any([distribution.object, distribution.string, distribution.boolean, distribution.undefined], value); if (value === true) { this._internals.cache = globalCache; } @@ -94822,7 +94511,7 @@ class Options { return this._internals.parseJson; } set parseJson(value) { - assert.function_(value); + assert["function"](value); this._internals.parseJson = value; } /** @@ -94870,7 +94559,7 @@ class Options { return this._internals.stringifyJson; } set stringifyJson(value) { - assert.function_(value); + assert["function"](value); this._internals.stringifyJson = value; } /** @@ -94900,13 +94589,13 @@ class Options { } set retry(value) { assert.plainObject(value); - assert.any([dist.function_, dist.undefined], value.calculateDelay); - assert.any([dist.number, dist.undefined], value.maxRetryAfter); - assert.any([dist.number, dist.undefined], value.limit); - assert.any([dist.array, dist.undefined], value.methods); - assert.any([dist.array, dist.undefined], value.statusCodes); - assert.any([dist.array, dist.undefined], value.errorCodes); - assert.any([dist.number, dist.undefined], value.noise); + assert.any([distribution["function"], distribution.undefined], value.calculateDelay); + assert.any([distribution.number, distribution.undefined], value.maxRetryAfter); + assert.any([distribution.number, distribution.undefined], value.limit); + assert.any([distribution.array, distribution.undefined], value.methods); + assert.any([distribution.array, distribution.undefined], value.statusCodes); + assert.any([distribution.array, distribution.undefined], value.errorCodes); + assert.any([distribution.number, distribution.undefined], value.noise); if (value.noise && Math.abs(value.noise) > 100) { throw new Error(`The maximum acceptable retry noise is +/- 100ms, got ${value.noise}`); } @@ -94935,7 +94624,7 @@ class Options { return this._internals.localAddress; } set localAddress(value) { - assert.any([dist.string, dist.undefined], value); + assert.any([distribution.string, distribution.undefined], value); this._internals.localAddress = value; } /** @@ -94954,7 +94643,7 @@ class Options { return this._internals.createConnection; } set createConnection(value) { - assert.any([dist.function_, dist.undefined], value); + assert.any([distribution["function"], distribution.undefined], value); this._internals.createConnection = value; } /** @@ -94967,10 +94656,10 @@ class Options { } set cacheOptions(value) { assert.plainObject(value); - assert.any([dist.boolean, dist.undefined], value.shared); - assert.any([dist.number, dist.undefined], value.cacheHeuristic); - assert.any([dist.number, dist.undefined], value.immutableMinTimeToLive); - assert.any([dist.boolean, dist.undefined], value.ignoreCargoCult); + assert.any([distribution.boolean, distribution.undefined], value.shared); + assert.any([distribution.number, distribution.undefined], value.cacheHeuristic); + assert.any([distribution.number, distribution.undefined], value.immutableMinTimeToLive); + assert.any([distribution.boolean, distribution.undefined], value.ignoreCargoCult); for (const key in value) { if (!(key in this._internals.cacheOptions)) { throw new Error(`Cache option \`${key}\` does not exist`); @@ -94991,23 +94680,23 @@ class Options { } set https(value) { assert.plainObject(value); - assert.any([dist.boolean, dist.undefined], value.rejectUnauthorized); - assert.any([dist.function_, dist.undefined], value.checkServerIdentity); - assert.any([dist.string, dist.object, dist.array, dist.undefined], value.certificateAuthority); - assert.any([dist.string, dist.object, dist.array, dist.undefined], value.key); - assert.any([dist.string, dist.object, dist.array, dist.undefined], value.certificate); - assert.any([dist.string, dist.undefined], value.passphrase); - assert.any([dist.string, dist.buffer, dist.array, dist.undefined], value.pfx); - assert.any([dist.array, dist.undefined], value.alpnProtocols); - assert.any([dist.string, dist.undefined], value.ciphers); - assert.any([dist.string, dist.buffer, dist.undefined], value.dhparam); - assert.any([dist.string, dist.undefined], value.signatureAlgorithms); - assert.any([dist.string, dist.undefined], value.minVersion); - assert.any([dist.string, dist.undefined], value.maxVersion); - assert.any([dist.boolean, dist.undefined], value.honorCipherOrder); - assert.any([dist.number, dist.undefined], value.tlsSessionLifetime); - assert.any([dist.string, dist.undefined], value.ecdhCurve); - assert.any([dist.string, dist.buffer, dist.array, dist.undefined], value.certificateRevocationLists); + assert.any([distribution.boolean, distribution.undefined], value.rejectUnauthorized); + assert.any([distribution["function"], distribution.undefined], value.checkServerIdentity); + assert.any([distribution.string, distribution.object, distribution.array, distribution.undefined], value.certificateAuthority); + assert.any([distribution.string, distribution.object, distribution.array, distribution.undefined], value.key); + assert.any([distribution.string, distribution.object, distribution.array, distribution.undefined], value.certificate); + assert.any([distribution.string, distribution.undefined], value.passphrase); + assert.any([distribution.string, distribution.buffer, distribution.array, distribution.undefined], value.pfx); + assert.any([distribution.array, distribution.undefined], value.alpnProtocols); + assert.any([distribution.string, distribution.undefined], value.ciphers); + assert.any([distribution.string, distribution.buffer, distribution.undefined], value.dhparam); + assert.any([distribution.string, distribution.undefined], value.signatureAlgorithms); + assert.any([distribution.string, distribution.undefined], value.minVersion); + assert.any([distribution.string, distribution.undefined], value.maxVersion); + assert.any([distribution.boolean, distribution.undefined], value.honorCipherOrder); + assert.any([distribution.number, distribution.undefined], value.tlsSessionLifetime); + assert.any([distribution.string, distribution.undefined], value.ecdhCurve); + assert.any([distribution.string, distribution.buffer, distribution.array, distribution.undefined], value.certificateRevocationLists); for (const key in value) { if (!(key in this._internals.https)) { throw new Error(`HTTPS option \`${key}\` does not exist`); @@ -95037,7 +94726,7 @@ class Options { if (value === null) { throw new TypeError('To get a Buffer, set `options.responseType` to `buffer` instead'); } - assert.any([dist.string, dist.undefined], value); + assert.any([distribution.string, distribution.undefined], value); this._internals.encoding = value; } /** @@ -95137,7 +94826,7 @@ class Options { return this._internals.maxHeaderSize; } set maxHeaderSize(value) { - assert.any([dist.number, dist.undefined], value); + assert.any([distribution.number, distribution.undefined], value); this._internals.maxHeaderSize = value; } get enableUnixSockets() { @@ -95166,7 +94855,7 @@ class Options { } const { https } = internals; let { pfx } = https; - if (dist.array(pfx) && dist.plainObject(pfx[0])) { + if (distribution.array(pfx) && distribution.plainObject(pfx[0])) { pfx = pfx.map(object => ({ buf: object.buffer, passphrase: object.passphrase, @@ -95257,7 +94946,7 @@ class Options { } } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/response.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.2/node_modules/got/dist/source/core/response.js const isResponseOk = (response) => { const { statusCode } = response; @@ -95300,20 +94989,19 @@ const parseBody = (response, responseType, parseJson, encoding) => { }, response); }; -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/utils/is-client-request.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.2/node_modules/got/dist/source/core/utils/is-client-request.js function isClientRequest(clientRequest) { return clientRequest.writable && !clientRequest.writableEnded; } /* harmony default export */ const is_client_request = (isClientRequest); -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/utils/is-unix-socket-url.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.2/node_modules/got/dist/source/core/utils/is-unix-socket-url.js // eslint-disable-next-line @typescript-eslint/naming-convention function isUnixSocketURL(url) { return url.protocol === 'unix:' || url.hostname === 'unix'; } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/index.js - +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.2/node_modules/got/dist/source/core/index.js @@ -95335,7 +95023,7 @@ function isUnixSocketURL(url) { -const supportsBrotli = dist.string(external_node_process_.versions.brotli); +const supportsBrotli = distribution.string(external_node_process_.versions.brotli); const methodsWithoutBody = new Set(['GET', 'HEAD']); const cacheableStore = new WeakableMap(); const redirectCodes = new Set([300, 301, 302, 303, 304, 307, 308]); @@ -95433,7 +95121,7 @@ class Request extends external_node_stream_.Duplex { // Important! If you replace `body` in a handler with another stream, make sure it's readable first. // The below is run only once. const { body } = this.options; - if (dist.nodeStream(body)) { + if (distribution.nodeStream(body)) { body.once('error', error => { if (this._flushed) { this._beforeError(new UploadError(error, this)); @@ -95659,14 +95347,14 @@ class Request extends external_node_stream_.Duplex { this._removeListeners(); if (this.options) { const { body } = this.options; - if (dist.nodeStream(body)) { + if (distribution.nodeStream(body)) { body.destroy(); } } if (this._request) { this._request.destroy(); } - if (error !== null && !dist.undefined(error) && !(error instanceof RequestError)) { + if (error !== null && !distribution.undefined(error) && !(error instanceof RequestError)) { error = new RequestError(error.message, error, this); } callback(error); @@ -95687,10 +95375,10 @@ class Request extends external_node_stream_.Duplex { async _finalizeBody() { const { options } = this; const { headers } = options; - const isForm = !dist.undefined(options.form); + const isForm = !distribution.undefined(options.form); // eslint-disable-next-line @typescript-eslint/naming-convention - const isJSON = !dist.undefined(options.json); - const isBody = !dist.undefined(options.body); + const isJSON = !distribution.undefined(options.json); + const isBody = !distribution.undefined(options.body); const cannotHaveBody = methodsWithoutBody.has(options.method) && !(options.method === 'GET' && options.allowGetBody); this._cannotHaveBody = cannotHaveBody; if (isForm || isJSON || isBody) { @@ -95698,7 +95386,7 @@ class Request extends external_node_stream_.Duplex { throw new TypeError(`The \`${options.method}\` method cannot be used with a body`); } // Serialize body - const noContentType = !dist.string(headers['content-type']); + const noContentType = !distribution.string(headers['content-type']); if (isBody) { // Body is spec-compliant FormData if (lib_isFormData(options.body)) { @@ -95742,7 +95430,7 @@ class Request extends external_node_stream_.Duplex { // Content-Length header field when the request message does not contain // a payload body and the method semantics do not anticipate such a // body. - if (dist.undefined(headers['content-length']) && dist.undefined(headers['transfer-encoding']) && !cannotHaveBody && !dist.undefined(uploadBodySize)) { + if (distribution.undefined(headers['content-length']) && distribution.undefined(headers['transfer-encoding']) && !cannotHaveBody && !distribution.undefined(uploadBodySize)) { headers['content-length'] = String(uploadBodySize); } } @@ -95797,7 +95485,7 @@ class Request extends external_node_stream_.Duplex { }); this.emit('downloadProgress', this.downloadProgress); const rawCookies = response.headers['set-cookie']; - if (dist.object(options.cookieJar) && rawCookies) { + if (distribution.object(options.cookieJar) && rawCookies) { let promises = rawCookies.map(async (rawCookie) => options.cookieJar.setCookie(rawCookie, url.toString())); if (options.ignoreInvalidCookies) { // eslint-disable-next-line @typescript-eslint/no-floating-promises @@ -95942,10 +95630,8 @@ class Request extends external_node_stream_.Duplex { } try { // Errors are emitted via the `error` event - const rawBody = await buffer_getStreamAsBuffer(from); - // TODO: Switch to this: - // let rawBody = await from.toArray(); - // rawBody = Buffer.concat(rawBody); + const fromArray = await from.toArray(); + const rawBody = isBuffer(fromArray.at(0)) ? external_node_buffer_namespaceObject.Buffer.concat(fromArray) : external_node_buffer_namespaceObject.Buffer.from(fromArray.join('')); // On retry Request is destroyed with no error, therefore the above will successfully resolve. // So in order to check if this was really successfull, we need to check if it has been properly ended. if (!this.isAborted) { @@ -96006,10 +95692,10 @@ class Request extends external_node_stream_.Duplex { // Send body const { body } = this.options; const currentRequest = this.redirectUrls.length === 0 ? this : this._request ?? this; - if (dist.nodeStream(body)) { + if (distribution.nodeStream(body)) { body.pipe(currentRequest); } - else if (dist.generator(body) || dist.asyncGenerator(body)) { + else if (distribution.generator(body) || distribution.asyncGenerator(body)) { (async () => { try { for await (const chunk of body) { @@ -96022,7 +95708,7 @@ class Request extends external_node_stream_.Duplex { } })(); } - else if (!dist.undefined(body)) { + else if (!distribution.undefined(body)) { this._writeRequest(body, undefined, () => { }); currentRequest.end(); } @@ -96032,10 +95718,10 @@ class Request extends external_node_stream_.Duplex { } _prepareCache(cache) { if (!cacheableStore.has(cache)) { - const cacheableRequest = new cacheable_request_dist(((requestOptions, handler) => { + const cacheableRequest = new dist(((requestOptions, handler) => { const result = requestOptions._request(requestOptions, handler); // TODO: remove this when `cacheable-request` supports async request functions. - if (dist.promise(result)) { + if (distribution.promise(result)) { // We only need to implement the error handler in order to support HTTP2 caching. // The result will be a promise anyway. // @ts-expect-error ignore @@ -96105,15 +95791,15 @@ class Request extends external_node_stream_.Duplex { const { headers, username, password } = options; const cookieJar = options.cookieJar; for (const key in headers) { - if (dist.undefined(headers[key])) { + if (distribution.undefined(headers[key])) { // eslint-disable-next-line @typescript-eslint/no-dynamic-delete delete headers[key]; } - else if (dist.null_(headers[key])) { + else if (distribution["null"](headers[key])) { throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${key}\` header`); } } - if (options.decompress && dist.undefined(headers['accept-encoding'])) { + if (options.decompress && distribution.undefined(headers['accept-encoding'])) { headers['accept-encoding'] = supportsBrotli ? 'gzip, deflate, br' : 'gzip, deflate'; } if (username || password) { @@ -96123,7 +95809,7 @@ class Request extends external_node_stream_.Duplex { // Set cookies if (cookieJar) { const cookieString = await cookieJar.getCookieString(options.url.toString()); - if (dist.nonEmptyString(cookieString)) { + if (distribution.nonEmptyString(cookieString)) { headers.cookie = cookieString; } } @@ -96133,7 +95819,7 @@ class Request extends external_node_stream_.Duplex { for (const hook of options.hooks.beforeRequest) { // eslint-disable-next-line no-await-in-loop const result = await hook(options); - if (!dist.undefined(result)) { + if (!distribution.undefined(result)) { // @ts-expect-error Skip the type mismatch to support abstract responses request = () => result; break; @@ -96154,13 +95840,13 @@ class Request extends external_node_stream_.Duplex { // We can't do `await fn(...)`, // because stream `error` event can be emitted before `Promise.resolve()`. let requestOrResponse = function_(url, this._requestOptions); - if (dist.promise(requestOrResponse)) { + if (distribution.promise(requestOrResponse)) { requestOrResponse = await requestOrResponse; } // Fallback - if (dist.undefined(requestOrResponse)) { + if (distribution.undefined(requestOrResponse)) { requestOrResponse = options.getFallbackRequestFunction()(url, this._requestOptions); - if (dist.promise(requestOrResponse)) { + if (distribution.promise(requestOrResponse)) { requestOrResponse = await requestOrResponse; } } @@ -96316,7 +96002,7 @@ class Request extends external_node_stream_.Duplex { } } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/as-promise/types.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.2/node_modules/got/dist/source/as-promise/types.js /** An error to be thrown when the request is aborted with `.cancel()`. @@ -96335,7 +96021,7 @@ class types_CancelError extends RequestError { } } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/as-promise/index.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.2/node_modules/got/dist/source/as-promise/index.js @@ -96416,7 +96102,7 @@ function asPromise(firstRequest) { options.hooks.afterResponse = options.hooks.afterResponse.slice(0, index); throw new RetryError(request); }); - if (!(dist.object(response) && dist.number(response.statusCode) && !dist.nullOrUndefined(response.body))) { + if (!(distribution.object(response) && distribution.number(response.statusCode) && !distribution.nullOrUndefined(response.body))) { throw new TypeError('The `afterResponse` hook returned an invalid value'); } } @@ -96451,7 +96137,7 @@ function asPromise(firstRequest) { request.once('retry', (newRetryCount, error) => { firstRequest = undefined; const newBody = request.options.body; - if (previousBody === newBody && dist.nodeStream(newBody)) { + if (previousBody === newBody && distribution.nodeStream(newBody)) { error.message = 'Cannot retry with consumed body stream'; onError(error); return; @@ -96462,7 +96148,7 @@ function asPromise(firstRequest) { makeRequest(newRetryCount); }); proxyEvents(request, emitter, as_promise_proxiedRequestEvents); - if (dist.undefined(firstRequest)) { + if (distribution.undefined(firstRequest)) { void request.flush(); } }; @@ -96501,7 +96187,7 @@ function asPromise(firstRequest) { return promise; } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/create.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.2/node_modules/got/dist/source/create.js @@ -96510,7 +96196,7 @@ function asPromise(firstRequest) { const delay = async (ms) => new Promise(resolve => { setTimeout(resolve, ms); }); -const isGotInstance = (value) => dist.function_(value); +const isGotInstance = (value) => distribution["function"](value); const aliases = [ 'get', 'post', @@ -96537,9 +96223,9 @@ const create = (defaults) => { const lastHandler = (normalized) => { // Note: `options` is `undefined` when `new Options(...)` fails request.options = normalized; - request._noPipe = !normalized.isStream; + request._noPipe = !normalized?.isStream; void request.flush(); - if (normalized.isStream) { + if (normalized?.isStream) { return request; } promise ||= asPromise(request); @@ -96549,7 +96235,7 @@ const create = (defaults) => { const iterateHandlers = (newOptions) => { const handler = defaults.handlers[iteration++] ?? lastHandler; const result = handler(newOptions, iterateHandlers); - if (dist.promise(result) && !request.options.isStream) { + if (distribution.promise(result) && !request.options?.isStream) { promise ||= asPromise(request); if (result !== promise) { const descriptors = Object.getOwnPropertyDescriptors(promise); @@ -96597,10 +96283,10 @@ const create = (defaults) => { let normalizedOptions = new Options(url, options, defaults.options); normalizedOptions.resolveBodyOnly = false; const { pagination } = normalizedOptions; - assert.function_(pagination.transform); - assert.function_(pagination.shouldContinue); - assert.function_(pagination.filter); - assert.function_(pagination.paginate); + assert["function"](pagination.transform); + assert["function"](pagination.shouldContinue); + assert["function"](pagination.filter); + assert["function"](pagination.paginate); assert.number(pagination.countLimit); assert.number(pagination.requestLimit); assert.number(pagination.backoff); @@ -96646,7 +96332,7 @@ const create = (defaults) => { } else { normalizedOptions.merge(optionsToMerge); - assert.any([dist.urlInstance, dist.undefined], optionsToMerge.url); + assert.any([distribution.urlInstance, distribution.undefined], optionsToMerge.url); if (optionsToMerge.url !== undefined) { normalizedOptions.prefixUrl = ''; normalizedOptions.url = optionsToMerge.url; @@ -96686,7 +96372,7 @@ const create = (defaults) => { }; /* harmony default export */ const source_create = (create); -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/index.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.2/node_modules/got/dist/source/index.js const defaults = { @@ -96719,7 +96405,7 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq const external_node_stream_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream/promises"); ;// CONCATENATED MODULE: external "node:zlib" const external_node_zlib_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:zlib"); -;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@dd1509475ee7fee37677b858b67aa96ef37a7531_5xj7muga2pf2jza4obzcpzufey/node_modules/detsys-ts/dist/index.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@d353465ae6a55761963005617a7780f2bf7e4ec2_u6jdk2qr4fvpfx7rzg4jx2tc4m/node_modules/detsys-ts/dist/index.js var __defProp = Object.defineProperty; var __export = (target, all) => { for (var name in all) @@ -97712,362 +97398,1670 @@ var DetSysAction = class { core.info(``); } } - } - getFeature(name) { - if (!this.features.hasOwnProperty(name)) { - return void 0; + } + getFeature(name) { + if (!this.features.hasOwnProperty(name)) { + return void 0; + } + const result = this.features[name]; + if (result === void 0) { + return void 0; + } + this.recordEvent("$feature_flag_called", { + $feature_flag: name, + $feature_flag_response: result.variant + }); + return result; + } + /** + * Check in to install.determinate.systems, to accomplish three things: + * + * 1. Preflight the server selected from IdsHost, to increase the chances of success. + * 2. Fetch any incidents and maintenance events to let users know in case things are weird. + * 3. Get feature flag data so we can gently roll out new features. + */ + async requestCheckIn() { + for (let attemptsRemaining = 5; attemptsRemaining > 0; attemptsRemaining--) { + const checkInUrl = await this.getCheckInUrl(); + if (checkInUrl === void 0) { + return void 0; + } + try { + core.debug(`Preflighting via ${checkInUrl}`); + checkInUrl.searchParams.set("ci", "github"); + checkInUrl.searchParams.set( + "correlation", + JSON.stringify(this.identity) + ); + return (await this.getClient()).get(checkInUrl, { + timeout: { + request: CHECK_IN_ENDPOINT_TIMEOUT_MS + } + }).json(); + } catch (e) { + core.debug(`Error checking in: ${stringifyError2(e)}`); + this.idsHost.markCurrentHostBroken(); + } + } + return void 0; + } + /** + * Fetch an artifact, such as a tarball, from the location determined by the + * `source-*` inputs. If `source-binary` is specified, this will return a path + * to a binary on disk; otherwise, the artifact will be downloaded from the + * URL determined by the other `source-*` inputs (`source-url`, `source-pr`, + * etc.). + */ + async fetchArtifact() { + const sourceBinary = getStringOrNull("source-binary"); + if (sourceBinary !== null && sourceBinary !== "") { + core.debug(`Using the provided source binary at ${sourceBinary}`); + return sourceBinary; + } + core.startGroup( + `Downloading ${this.actionOptions.name} for ${this.architectureFetchSuffix}` + ); + try { + core.info(`Fetching from ${await this.getSourceUrl()}`); + const correlatedUrl = await this.getSourceUrl(); + correlatedUrl.searchParams.set("ci", "github"); + correlatedUrl.searchParams.set( + "correlation", + JSON.stringify(this.identity) + ); + const versionCheckup = await (await this.getClient()).head(correlatedUrl); + if (versionCheckup.headers.etag) { + const v = versionCheckup.headers.etag; + this.addFact(FACT_SOURCE_URL_ETAG, v); + core.debug( + `Checking the tool cache for ${await this.getSourceUrl()} at ${v}` + ); + const cached = await this.getCachedVersion(v); + if (cached) { + this.facts[FACT_ARTIFACT_FETCHED_FROM_CACHE] = true; + core.debug(`Tool cache hit.`); + return cached; + } + } + this.facts[FACT_ARTIFACT_FETCHED_FROM_CACHE] = false; + core.debug( + `No match from the cache, re-fetching from the redirect: ${versionCheckup.url}` + ); + const destFile = this.getTemporaryName(); + const fetchStream = (await this.getClient()).stream(versionCheckup.url); + await (0,external_node_stream_promises_namespaceObject.pipeline)( + fetchStream, + (0,external_node_fs_namespaceObject.createWriteStream)(destFile, { + encoding: "binary", + mode: 493 + }) + ); + if (fetchStream.response?.headers.etag) { + const v = fetchStream.response.headers.etag; + try { + await this.saveCachedVersion(v, destFile); + } catch (e) { + core.debug(`Error caching the artifact: ${stringifyError2(e)}`); + } + } + return destFile; + } finally { + core.endGroup(); + } + } + /** + * A helper function for failing on error only if strict mode is enabled. + * This is intended only for CI environments testing Actions themselves. + */ + failOnError(msg) { + if (this.strictMode) { + core.setFailed(`strict mode failure: ${msg}`); + } + } + async complete() { + this.recordEvent(`complete_${this.executionPhase}`); + await this.submitEvents(); + } + async getCheckInUrl() { + const checkInUrl = await this.idsHost.getDynamicRootUrl(); + if (checkInUrl === void 0) { + return void 0; + } + checkInUrl.pathname += "check-in"; + return checkInUrl; + } + async getSourceUrl() { + const p = this.sourceParameters; + if (p.url) { + this.addFact(FACT_SOURCE_URL, p.url); + return new URL(p.url); + } + const fetchUrl = await this.idsHost.getRootUrl(); + fetchUrl.pathname += this.actionOptions.idsProjectName; + if (p.tag) { + fetchUrl.pathname += `/tag/${p.tag}`; + } else if (p.pr) { + fetchUrl.pathname += `/pr/${p.pr}`; + } else if (p.branch) { + fetchUrl.pathname += `/branch/${p.branch}`; + } else if (p.revision) { + fetchUrl.pathname += `/rev/${p.revision}`; + } else { + fetchUrl.pathname += `/stable`; + } + fetchUrl.pathname += `/${this.architectureFetchSuffix}`; + this.addFact(FACT_SOURCE_URL, fetchUrl.toString()); + return fetchUrl; + } + cacheKey(version2) { + const cleanedVersion = version2.replace(/[^a-zA-Z0-9-+.]/g, ""); + return `determinatesystem-${this.actionOptions.name}-${this.architectureFetchSuffix}-${cleanedVersion}`; + } + async getCachedVersion(version2) { + const startCwd = process.cwd(); + try { + const tempDir = this.getTemporaryName(); + await (0,promises_namespaceObject.mkdir)(tempDir); + process.chdir(tempDir); + process.env.GITHUB_WORKSPACE_BACKUP = process.env.GITHUB_WORKSPACE; + delete process.env.GITHUB_WORKSPACE; + if (await cache.restoreCache( + [this.actionOptions.name], + this.cacheKey(version2), + [], + void 0, + true + )) { + this.recordEvent(EVENT_ARTIFACT_CACHE_HIT); + return `${tempDir}/${this.actionOptions.name}`; + } + this.recordEvent(EVENT_ARTIFACT_CACHE_MISS); + return void 0; + } finally { + process.env.GITHUB_WORKSPACE = process.env.GITHUB_WORKSPACE_BACKUP; + delete process.env.GITHUB_WORKSPACE_BACKUP; + process.chdir(startCwd); + } + } + async saveCachedVersion(version2, toolPath) { + const startCwd = process.cwd(); + try { + const tempDir = this.getTemporaryName(); + await (0,promises_namespaceObject.mkdir)(tempDir); + process.chdir(tempDir); + await (0,promises_namespaceObject.copyFile)(toolPath, `${tempDir}/${this.actionOptions.name}`); + process.env.GITHUB_WORKSPACE_BACKUP = process.env.GITHUB_WORKSPACE; + delete process.env.GITHUB_WORKSPACE; + await cache.saveCache( + [this.actionOptions.name], + this.cacheKey(version2), + void 0, + true + ); + this.recordEvent(EVENT_ARTIFACT_CACHE_PERSIST); + } finally { + process.env.GITHUB_WORKSPACE = process.env.GITHUB_WORKSPACE_BACKUP; + delete process.env.GITHUB_WORKSPACE_BACKUP; + process.chdir(startCwd); + } + } + async preflightRequireNix() { + let nixLocation; + const pathParts = (process.env["PATH"] || "").split(":"); + for (const location of pathParts) { + const candidateNix = external_node_path_namespaceObject.join(location, "nix"); + try { + await promises_namespaceObject.access(candidateNix, promises_namespaceObject.constants.X_OK); + core.debug(`Found Nix at ${candidateNix}`); + nixLocation = candidateNix; + break; + } catch { + core.debug(`Nix not at ${candidateNix}`); + } + } + this.addFact(FACT_NIX_LOCATION, nixLocation || ""); + if (this.actionOptions.requireNix === "ignore") { + return true; + } + const currentNotFoundState = core.getState(STATE_KEY_NIX_NOT_FOUND); + if (currentNotFoundState === STATE_NOT_FOUND) { + return false; + } + if (nixLocation !== void 0) { + return true; + } + core.saveState(STATE_KEY_NIX_NOT_FOUND, STATE_NOT_FOUND); + switch (this.actionOptions.requireNix) { + case "fail": + core.setFailed( + [ + "This action can only be used when Nix is installed.", + "Add `- uses: DeterminateSystems/nix-installer-action@main` earlier in your workflow." + ].join(" ") + ); + break; + case "warn": + core.warning( + [ + "This action is in no-op mode because Nix is not installed.", + "Add `- uses: DeterminateSystems/nix-installer-action@main` earlier in your workflow." + ].join(" ") + ); + break; + } + return false; + } + async preflightNixStoreInfo() { + let output = ""; + const options = {}; + options.silent = true; + options.listeners = { + stdout: (data) => { + output += data.toString(); + } + }; + try { + output = ""; + await exec.exec("nix", ["store", "info", "--json"], options); + this.addFact(FACT_NIX_STORE_CHECK_METHOD, "info"); + } catch { + try { + output = ""; + await exec.exec("nix", ["store", "ping", "--json"], options); + this.addFact(FACT_NIX_STORE_CHECK_METHOD, "ping"); + } catch { + this.addFact(FACT_NIX_STORE_CHECK_METHOD, "none"); + return; + } + } + try { + const parsed = JSON.parse(output); + if (parsed.trusted === 1) { + this.nixStoreTrust = "trusted"; + } else if (parsed.trusted === 0) { + this.nixStoreTrust = "untrusted"; + } else if (parsed.trusted !== void 0) { + this.addFact( + FACT_NIX_STORE_CHECK_ERROR, + `Mysterious trusted value: ${JSON.stringify(parsed.trusted)}` + ); + } + this.addFact(FACT_NIX_STORE_VERSION, JSON.stringify(parsed.version)); + } catch (e) { + this.addFact(FACT_NIX_STORE_CHECK_ERROR, stringifyError2(e)); + } + } + async submitEvents() { + const diagnosticsUrl = await this.idsHost.getDiagnosticsUrl(); + if (diagnosticsUrl === void 0) { + core.debug( + "Diagnostics are disabled. Not sending the following events:" + ); + core.debug(JSON.stringify(this.events, void 0, 2)); + return; + } + const batch = { + type: "eventlog", + sent_at: /* @__PURE__ */ new Date(), + events: this.events + }; + try { + await (await this.getClient()).post(diagnosticsUrl, { + json: batch, + timeout: { + request: DIAGNOSTIC_ENDPOINT_TIMEOUT_MS + } + }); + } catch (err) { + core.debug( + `Error submitting diagnostics event to ${diagnosticsUrl}: ${stringifyError2(err)}` + ); + } + this.events = []; + } +}; +function stringifyError2(error3) { + return error3 instanceof Error || typeof error3 == "string" ? error3.toString() : JSON.stringify(error3); +} +function makeOptionsConfident(actionOptions) { + const idsProjectName = actionOptions.idsProjectName ?? actionOptions.name; + const finalOpts = { + name: actionOptions.name, + idsProjectName, + eventPrefix: actionOptions.eventPrefix || "action:", + fetchStyle: actionOptions.fetchStyle, + legacySourcePrefix: actionOptions.legacySourcePrefix, + requireNix: actionOptions.requireNix + }; + core.debug("idslib options:"); + core.debug(JSON.stringify(finalOpts, void 0, 2)); + return finalOpts; +} + +/*! + * linux-release-info + * Get Linux release info (distribution name, version, arch, release, etc.) + * from '/etc/os-release' or '/usr/lib/os-release' files and from native os + * module. On Windows and Darwin platforms it only returns common node os module + * info (platform, hostname, release, and arch) + * + * Licensed under MIT + * Copyright (c) 2018-2020 [Samuel Carreira] + */ +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/.pnpm/@sindresorhus+is@6.3.1/node_modules/@sindresorhus/is/dist/index.js +const dist_typedArrayTypeNames = [ + 'Int8Array', + 'Uint8Array', + 'Uint8ClampedArray', + 'Int16Array', + 'Uint16Array', + 'Int32Array', + 'Uint32Array', + 'Float32Array', + 'Float64Array', + 'BigInt64Array', + 'BigUint64Array', +]; +function dist_isTypedArrayName(name) { + return dist_typedArrayTypeNames.includes(name); +} +const dist_objectTypeNames = [ + 'Function', + 'Generator', + 'AsyncGenerator', + 'GeneratorFunction', + 'AsyncGeneratorFunction', + 'AsyncFunction', + 'Observable', + 'Array', + 'Buffer', + 'Blob', + 'Object', + 'RegExp', + 'Date', + 'Error', + 'Map', + 'Set', + 'WeakMap', + 'WeakSet', + 'WeakRef', + 'ArrayBuffer', + 'SharedArrayBuffer', + 'DataView', + 'Promise', + 'URL', + 'FormData', + 'URLSearchParams', + 'HTMLElement', + 'NaN', + ...dist_typedArrayTypeNames, +]; +function dist_isObjectTypeName(name) { + return dist_objectTypeNames.includes(name); +} +const dist_primitiveTypeNames = [ + 'null', + 'undefined', + 'string', + 'number', + 'bigint', + 'boolean', + 'symbol', +]; +function dist_isPrimitiveTypeName(name) { + return dist_primitiveTypeNames.includes(name); +} +const dist_assertionTypeDescriptions = [ + 'positive number', + 'negative number', + 'Class', + 'string with a number', + 'null or undefined', + 'Iterable', + 'AsyncIterable', + 'native Promise', + 'EnumCase', + 'string with a URL', + 'truthy', + 'falsy', + 'primitive', + 'integer', + 'plain object', + 'TypedArray', + 'array-like', + 'tuple-like', + 'Node.js Stream', + 'infinite number', + 'empty array', + 'non-empty array', + 'empty string', + 'empty string or whitespace', + 'non-empty string', + 'non-empty string and not whitespace', + 'empty object', + 'non-empty object', + 'empty set', + 'non-empty set', + 'empty map', + 'non-empty map', + 'PropertyKey', + 'even integer', + 'odd integer', + 'T', + 'in range', + 'predicate returns truthy for any value', + 'predicate returns truthy for all values', + 'valid Date', + 'valid length', + 'whitespace string', + ...dist_objectTypeNames, + ...dist_primitiveTypeNames, +]; +const dist_getObjectType = (value) => { + const objectTypeName = Object.prototype.toString.call(value).slice(8, -1); + if (/HTML\w+Element/.test(objectTypeName) && dist_isHtmlElement(value)) { + return 'HTMLElement'; + } + if (dist_isObjectTypeName(objectTypeName)) { + return objectTypeName; + } + return undefined; +}; +function dist_detect(value) { + if (value === null) { + return 'null'; + } + switch (typeof value) { + case 'undefined': { + return 'undefined'; + } + case 'string': { + return 'string'; + } + case 'number': { + return Number.isNaN(value) ? 'NaN' : 'number'; + } + case 'boolean': { + return 'boolean'; + } + case 'function': { + return 'Function'; + } + case 'bigint': { + return 'bigint'; + } + case 'symbol': { + return 'symbol'; + } + default: + } + if (dist_isObservable(value)) { + return 'Observable'; + } + if (dist_isArray(value)) { + return 'Array'; + } + if (dist_isBuffer(value)) { + return 'Buffer'; + } + const tagType = dist_getObjectType(value); + if (tagType) { + return tagType; + } + if (value instanceof String || value instanceof Boolean || value instanceof Number) { + throw new TypeError('Please don\'t use object wrappers for primitive types'); + } + return 'Object'; +} +function dist_hasPromiseApi(value) { + return dist_isFunction(value?.then) && dist_isFunction(value?.catch); +} +const dist_is = Object.assign(dist_detect, { + all: dist_isAll, + any: dist_isAny, + array: dist_isArray, + arrayBuffer: dist_isArrayBuffer, + arrayLike: dist_isArrayLike, + asyncFunction: dist_isAsyncFunction, + asyncGenerator: dist_isAsyncGenerator, + asyncGeneratorFunction: dist_isAsyncGeneratorFunction, + asyncIterable: dist_isAsyncIterable, + bigint: dist_isBigint, + bigInt64Array: dist_isBigInt64Array, + bigUint64Array: dist_isBigUint64Array, + blob: dist_isBlob, + boolean: dist_isBoolean, + boundFunction: dist_isBoundFunction, + buffer: dist_isBuffer, + class: dist_isClass, + /** @deprecated Renamed to `class`. */ + class_: dist_isClass, + dataView: dist_isDataView, + date: dist_isDate, + detect: dist_detect, + directInstanceOf: dist_isDirectInstanceOf, + /** @deprecated Renamed to `htmlElement` */ + domElement: dist_isHtmlElement, + emptyArray: dist_isEmptyArray, + emptyMap: dist_isEmptyMap, + emptyObject: dist_isEmptyObject, + emptySet: dist_isEmptySet, + emptyString: dist_isEmptyString, + emptyStringOrWhitespace: dist_isEmptyStringOrWhitespace, + enumCase: dist_isEnumCase, + error: dist_isError, + evenInteger: dist_isEvenInteger, + falsy: dist_isFalsy, + float32Array: dist_isFloat32Array, + float64Array: dist_isFloat64Array, + formData: dist_isFormData, + function: dist_isFunction, + /** @deprecated Renamed to `function`. */ + function_: dist_isFunction, + generator: dist_isGenerator, + generatorFunction: dist_isGeneratorFunction, + htmlElement: dist_isHtmlElement, + infinite: dist_isInfinite, + inRange: dist_isInRange, + int16Array: dist_isInt16Array, + int32Array: dist_isInt32Array, + int8Array: dist_isInt8Array, + integer: dist_isInteger, + iterable: dist_isIterable, + map: dist_isMap, + nan: dist_isNan, + nativePromise: dist_isNativePromise, + negativeNumber: dist_isNegativeNumber, + nodeStream: dist_isNodeStream, + nonEmptyArray: dist_isNonEmptyArray, + nonEmptyMap: dist_isNonEmptyMap, + nonEmptyObject: dist_isNonEmptyObject, + nonEmptySet: dist_isNonEmptySet, + nonEmptyString: dist_isNonEmptyString, + nonEmptyStringAndNotWhitespace: dist_isNonEmptyStringAndNotWhitespace, + null: dist_isNull, + /** @deprecated Renamed to `null`. */ + null_: dist_isNull, + nullOrUndefined: dist_isNullOrUndefined, + number: dist_isNumber, + numericString: dist_isNumericString, + object: dist_isObject, + observable: dist_isObservable, + oddInteger: dist_isOddInteger, + plainObject: dist_isPlainObject, + positiveNumber: dist_isPositiveNumber, + primitive: dist_isPrimitive, + promise: dist_isPromise, + propertyKey: dist_isPropertyKey, + regExp: dist_isRegExp, + safeInteger: dist_isSafeInteger, + set: dist_isSet, + sharedArrayBuffer: dist_isSharedArrayBuffer, + string: dist_isString, + symbol: dist_isSymbol, + truthy: dist_isTruthy, + tupleLike: dist_isTupleLike, + typedArray: dist_isTypedArray, + uint16Array: dist_isUint16Array, + uint32Array: dist_isUint32Array, + uint8Array: dist_isUint8Array, + uint8ClampedArray: dist_isUint8ClampedArray, + undefined: dist_isUndefined, + urlInstance: dist_isUrlInstance, + urlSearchParams: dist_isUrlSearchParams, + urlString: dist_isUrlString, + validDate: dist_isValidDate, + validLength: dist_isValidLength, + weakMap: dist_isWeakMap, + weakRef: dist_isWeakRef, + weakSet: dist_isWeakSet, + whitespaceString: dist_isWhitespaceString, +}); +function isAbsoluteMod2(remainder) { + return (value) => dist_isInteger(value) && Math.abs(value % 2) === remainder; +} +function dist_isAll(predicate, ...values) { + return dist_predicateOnArray(Array.prototype.every, predicate, values); +} +function dist_isAny(predicate, ...values) { + const predicates = dist_isArray(predicate) ? predicate : [predicate]; + return predicates.some(singlePredicate => dist_predicateOnArray(Array.prototype.some, singlePredicate, values)); +} +function dist_isArray(value, assertion) { + if (!Array.isArray(value)) { + return false; + } + if (!dist_isFunction(assertion)) { + return true; + } + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + return value.every(element => assertion(element)); +} +function dist_isArrayBuffer(value) { + return dist_getObjectType(value) === 'ArrayBuffer'; +} +function dist_isArrayLike(value) { + return !dist_isNullOrUndefined(value) && !dist_isFunction(value) && dist_isValidLength(value.length); +} +function dist_isAsyncFunction(value) { + return dist_getObjectType(value) === 'AsyncFunction'; +} +function dist_isAsyncGenerator(value) { + return dist_isAsyncIterable(value) && dist_isFunction(value.next) && dist_isFunction(value.throw); +} +function dist_isAsyncGeneratorFunction(value) { + return dist_getObjectType(value) === 'AsyncGeneratorFunction'; +} +function dist_isAsyncIterable(value) { + return dist_isFunction(value?.[Symbol.asyncIterator]); +} +function dist_isBigint(value) { + return typeof value === 'bigint'; +} +function dist_isBigInt64Array(value) { + return dist_getObjectType(value) === 'BigInt64Array'; +} +function dist_isBigUint64Array(value) { + return dist_getObjectType(value) === 'BigUint64Array'; +} +function dist_isBlob(value) { + return dist_getObjectType(value) === 'Blob'; +} +function dist_isBoolean(value) { + return value === true || value === false; +} +// eslint-disable-next-line @typescript-eslint/ban-types +function dist_isBoundFunction(value) { + return dist_isFunction(value) && !Object.prototype.hasOwnProperty.call(value, 'prototype'); +} +function dist_isBuffer(value) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call + return value?.constructor?.isBuffer?.(value) ?? false; +} +function dist_isClass(value) { + return dist_isFunction(value) && value.toString().startsWith('class '); +} +function dist_isDataView(value) { + return dist_getObjectType(value) === 'DataView'; +} +function dist_isDate(value) { + return dist_getObjectType(value) === 'Date'; +} +function dist_isDirectInstanceOf(instance, class_) { + if (instance === undefined || instance === null) { + return false; + } + return Object.getPrototypeOf(instance) === class_.prototype; +} +function dist_isEmptyArray(value) { + return dist_isArray(value) && value.length === 0; +} +function dist_isEmptyMap(value) { + return dist_isMap(value) && value.size === 0; +} +function dist_isEmptyObject(value) { + return dist_isObject(value) && !dist_isMap(value) && !dist_isSet(value) && Object.keys(value).length === 0; +} +function dist_isEmptySet(value) { + return dist_isSet(value) && value.size === 0; +} +function dist_isEmptyString(value) { + return dist_isString(value) && value.length === 0; +} +function dist_isEmptyStringOrWhitespace(value) { + return dist_isEmptyString(value) || dist_isWhitespaceString(value); +} +function dist_isEnumCase(value, targetEnum) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + return Object.values(targetEnum).includes(value); +} +function dist_isError(value) { + return dist_getObjectType(value) === 'Error'; +} +function dist_isEvenInteger(value) { + return isAbsoluteMod2(0)(value); +} +// Example: `is.falsy = (value: unknown): value is (not true | 0 | '' | undefined | null) => Boolean(value);` +function dist_isFalsy(value) { + return !value; +} +function dist_isFloat32Array(value) { + return dist_getObjectType(value) === 'Float32Array'; +} +function dist_isFloat64Array(value) { + return dist_getObjectType(value) === 'Float64Array'; +} +function dist_isFormData(value) { + return dist_getObjectType(value) === 'FormData'; +} +// eslint-disable-next-line @typescript-eslint/ban-types +function dist_isFunction(value) { + return typeof value === 'function'; +} +function dist_isGenerator(value) { + return dist_isIterable(value) && dist_isFunction(value?.next) && dist_isFunction(value?.throw); +} +function dist_isGeneratorFunction(value) { + return dist_getObjectType(value) === 'GeneratorFunction'; +} +// eslint-disable-next-line @typescript-eslint/naming-convention +const dist_NODE_TYPE_ELEMENT = 1; +// eslint-disable-next-line @typescript-eslint/naming-convention +const dist_DOM_PROPERTIES_TO_CHECK = [ + 'innerHTML', + 'ownerDocument', + 'style', + 'attributes', + 'nodeValue', +]; +function dist_isHtmlElement(value) { + return dist_isObject(value) + && value.nodeType === dist_NODE_TYPE_ELEMENT + && dist_isString(value.nodeName) + && !dist_isPlainObject(value) + && dist_DOM_PROPERTIES_TO_CHECK.every(property => property in value); +} +function dist_isInfinite(value) { + return value === Number.POSITIVE_INFINITY || value === Number.NEGATIVE_INFINITY; +} +function dist_isInRange(value, range) { + if (dist_isNumber(range)) { + return value >= Math.min(0, range) && value <= Math.max(range, 0); + } + if (dist_isArray(range) && range.length === 2) { + return value >= Math.min(...range) && value <= Math.max(...range); + } + throw new TypeError(`Invalid range: ${JSON.stringify(range)}`); +} +function dist_isInt16Array(value) { + return dist_getObjectType(value) === 'Int16Array'; +} +function dist_isInt32Array(value) { + return dist_getObjectType(value) === 'Int32Array'; +} +function dist_isInt8Array(value) { + return dist_getObjectType(value) === 'Int8Array'; +} +function dist_isInteger(value) { + return Number.isInteger(value); +} +function dist_isIterable(value) { + return dist_isFunction(value?.[Symbol.iterator]); +} +function dist_isMap(value) { + return dist_getObjectType(value) === 'Map'; +} +function dist_isNan(value) { + return Number.isNaN(value); +} +function dist_isNativePromise(value) { + return dist_getObjectType(value) === 'Promise'; +} +function dist_isNegativeNumber(value) { + return dist_isNumber(value) && value < 0; +} +function dist_isNodeStream(value) { + return dist_isObject(value) && dist_isFunction(value.pipe) && !dist_isObservable(value); +} +function dist_isNonEmptyArray(value) { + return dist_isArray(value) && value.length > 0; +} +function dist_isNonEmptyMap(value) { + return dist_isMap(value) && value.size > 0; +} +// TODO: Use `not` operator here to remove `Map` and `Set` from type guard: +// - https://github.com/Microsoft/TypeScript/pull/29317 +function dist_isNonEmptyObject(value) { + return dist_isObject(value) && !dist_isMap(value) && !dist_isSet(value) && Object.keys(value).length > 0; +} +function dist_isNonEmptySet(value) { + return dist_isSet(value) && value.size > 0; +} +// TODO: Use `not ''` when the `not` operator is available. +function dist_isNonEmptyString(value) { + return dist_isString(value) && value.length > 0; +} +// TODO: Use `not ''` when the `not` operator is available. +function dist_isNonEmptyStringAndNotWhitespace(value) { + return dist_isString(value) && !dist_isEmptyStringOrWhitespace(value); +} +// eslint-disable-next-line @typescript-eslint/ban-types +function dist_isNull(value) { + return value === null; +} +// eslint-disable-next-line @typescript-eslint/ban-types +function dist_isNullOrUndefined(value) { + return dist_isNull(value) || dist_isUndefined(value); +} +function dist_isNumber(value) { + return typeof value === 'number' && !Number.isNaN(value); +} +function dist_isNumericString(value) { + return dist_isString(value) && !dist_isEmptyStringOrWhitespace(value) && !Number.isNaN(Number(value)); +} +// eslint-disable-next-line @typescript-eslint/ban-types +function dist_isObject(value) { + return !dist_isNull(value) && (typeof value === 'object' || dist_isFunction(value)); +} +function dist_isObservable(value) { + if (!value) { + return false; + } + // eslint-disable-next-line no-use-extend-native/no-use-extend-native, @typescript-eslint/no-unsafe-call + if (value === value[Symbol.observable]?.()) { + return true; + } + // eslint-disable-next-line @typescript-eslint/no-unsafe-call + if (value === value['@@observable']?.()) { + return true; + } + return false; +} +function dist_isOddInteger(value) { + return isAbsoluteMod2(1)(value); +} +function dist_isPlainObject(value) { + // From: https://github.com/sindresorhus/is-plain-obj/blob/main/index.js + if (typeof value !== 'object' || value === null) { + return false; + } + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const prototype = Object.getPrototypeOf(value); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value); +} +function dist_isPositiveNumber(value) { + return dist_isNumber(value) && value > 0; +} +function dist_isPrimitive(value) { + return dist_isNull(value) || dist_isPrimitiveTypeName(typeof value); +} +function dist_isPromise(value) { + return dist_isNativePromise(value) || dist_hasPromiseApi(value); +} +// `PropertyKey` is any value that can be used as an object key (string, number, or symbol) +function dist_isPropertyKey(value) { + return dist_isAny([dist_isString, dist_isNumber, dist_isSymbol], value); +} +function dist_isRegExp(value) { + return dist_getObjectType(value) === 'RegExp'; +} +function dist_isSafeInteger(value) { + return Number.isSafeInteger(value); +} +function dist_isSet(value) { + return dist_getObjectType(value) === 'Set'; +} +function dist_isSharedArrayBuffer(value) { + return dist_getObjectType(value) === 'SharedArrayBuffer'; +} +function dist_isString(value) { + return typeof value === 'string'; +} +function dist_isSymbol(value) { + return typeof value === 'symbol'; +} +// Example: `is.truthy = (value: unknown): value is (not false | not 0 | not '' | not undefined | not null) => Boolean(value);` +// eslint-disable-next-line unicorn/prefer-native-coercion-functions +function dist_isTruthy(value) { + return Boolean(value); +} +function dist_isTupleLike(value, guards) { + if (dist_isArray(guards) && dist_isArray(value) && guards.length === value.length) { + return guards.every((guard, index) => guard(value[index])); + } + return false; +} +function dist_isTypedArray(value) { + return dist_isTypedArrayName(dist_getObjectType(value)); +} +function dist_isUint16Array(value) { + return dist_getObjectType(value) === 'Uint16Array'; +} +function dist_isUint32Array(value) { + return dist_getObjectType(value) === 'Uint32Array'; +} +function dist_isUint8Array(value) { + return dist_getObjectType(value) === 'Uint8Array'; +} +function dist_isUint8ClampedArray(value) { + return dist_getObjectType(value) === 'Uint8ClampedArray'; +} +function dist_isUndefined(value) { + return value === undefined; +} +function dist_isUrlInstance(value) { + return dist_getObjectType(value) === 'URL'; +} +// eslint-disable-next-line unicorn/prevent-abbreviations +function dist_isUrlSearchParams(value) { + return dist_getObjectType(value) === 'URLSearchParams'; +} +function dist_isUrlString(value) { + if (!dist_isString(value)) { + return false; + } + try { + new URL(value); // eslint-disable-line no-new + return true; + } + catch { + return false; + } +} +function dist_isValidDate(value) { + return dist_isDate(value) && !dist_isNan(Number(value)); +} +function dist_isValidLength(value) { + return dist_isSafeInteger(value) && value >= 0; +} +// eslint-disable-next-line @typescript-eslint/ban-types +function dist_isWeakMap(value) { + return dist_getObjectType(value) === 'WeakMap'; +} +// eslint-disable-next-line @typescript-eslint/ban-types +function dist_isWeakRef(value) { + return dist_getObjectType(value) === 'WeakRef'; +} +// eslint-disable-next-line @typescript-eslint/ban-types +function dist_isWeakSet(value) { + return dist_getObjectType(value) === 'WeakSet'; +} +function dist_isWhitespaceString(value) { + return dist_isString(value) && /^\s+$/.test(value); +} +function dist_predicateOnArray(method, predicate, values) { + if (!dist_isFunction(predicate)) { + throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`); + } + if (values.length === 0) { + throw new TypeError('Invalid number of values'); + } + return method.call(values, predicate); +} +function dist_typeErrorMessage(description, value) { + return `Expected value which is \`${description}\`, received value of type \`${dist_is(value)}\`.`; +} +function dist_unique(values) { + // eslint-disable-next-line unicorn/prefer-spread + return Array.from(new Set(values)); +} +const dist_andFormatter = new Intl.ListFormat('en', { style: 'long', type: 'conjunction' }); +const dist_orFormatter = new Intl.ListFormat('en', { style: 'long', type: 'disjunction' }); +function dist_typeErrorMessageMultipleValues(expectedType, values) { + const uniqueExpectedTypes = dist_unique((dist_isArray(expectedType) ? expectedType : [expectedType]).map(value => `\`${value}\``)); + const uniqueValueTypes = dist_unique(values.map(value => `\`${dist_is(value)}\``)); + return `Expected values which are ${dist_orFormatter.format(uniqueExpectedTypes)}. Received values of type${uniqueValueTypes.length > 1 ? 's' : ''} ${dist_andFormatter.format(uniqueValueTypes)}.`; +} +const dist_assert = { + all: dist_assertAll, + any: dist_assertAny, + array: dist_assertArray, + arrayBuffer: dist_assertArrayBuffer, + arrayLike: dist_assertArrayLike, + asyncFunction: dist_assertAsyncFunction, + asyncGenerator: dist_assertAsyncGenerator, + asyncGeneratorFunction: dist_assertAsyncGeneratorFunction, + asyncIterable: dist_assertAsyncIterable, + bigint: dist_assertBigint, + bigInt64Array: dist_assertBigInt64Array, + bigUint64Array: dist_assertBigUint64Array, + blob: dist_assertBlob, + boolean: dist_assertBoolean, + boundFunction: dist_assertBoundFunction, + buffer: dist_assertBuffer, + class: dist_assertClass, + class_: dist_assertClass, + dataView: dist_assertDataView, + date: dist_assertDate, + directInstanceOf: dist_assertDirectInstanceOf, + domElement: dist_assertHtmlElement, + emptyArray: dist_assertEmptyArray, + emptyMap: dist_assertEmptyMap, + emptyObject: dist_assertEmptyObject, + emptySet: dist_assertEmptySet, + emptyString: dist_assertEmptyString, + emptyStringOrWhitespace: dist_assertEmptyStringOrWhitespace, + enumCase: dist_assertEnumCase, + error: dist_assertError, + evenInteger: dist_assertEvenInteger, + falsy: dist_assertFalsy, + float32Array: dist_assertFloat32Array, + float64Array: dist_assertFloat64Array, + formData: dist_assertFormData, + function: dist_assertFunction, + function_: dist_assertFunction, + generator: dist_assertGenerator, + generatorFunction: dist_assertGeneratorFunction, + htmlElement: dist_assertHtmlElement, + infinite: dist_assertInfinite, + inRange: dist_assertInRange, + int16Array: dist_assertInt16Array, + int32Array: dist_assertInt32Array, + int8Array: dist_assertInt8Array, + integer: dist_assertInteger, + iterable: dist_assertIterable, + map: dist_assertMap, + nan: dist_assertNan, + nativePromise: dist_assertNativePromise, + negativeNumber: dist_assertNegativeNumber, + nodeStream: dist_assertNodeStream, + nonEmptyArray: dist_assertNonEmptyArray, + nonEmptyMap: dist_assertNonEmptyMap, + nonEmptyObject: dist_assertNonEmptyObject, + nonEmptySet: dist_assertNonEmptySet, + nonEmptyString: dist_assertNonEmptyString, + nonEmptyStringAndNotWhitespace: dist_assertNonEmptyStringAndNotWhitespace, + null: dist_assertNull, + null_: dist_assertNull, + nullOrUndefined: dist_assertNullOrUndefined, + number: dist_assertNumber, + numericString: dist_assertNumericString, + object: dist_assertObject, + observable: dist_assertObservable, + oddInteger: dist_assertOddInteger, + plainObject: dist_assertPlainObject, + positiveNumber: dist_assertPositiveNumber, + primitive: dist_assertPrimitive, + promise: dist_assertPromise, + propertyKey: dist_assertPropertyKey, + regExp: dist_assertRegExp, + safeInteger: dist_assertSafeInteger, + set: dist_assertSet, + sharedArrayBuffer: dist_assertSharedArrayBuffer, + string: dist_assertString, + symbol: dist_assertSymbol, + truthy: dist_assertTruthy, + tupleLike: dist_assertTupleLike, + typedArray: dist_assertTypedArray, + uint16Array: dist_assertUint16Array, + uint32Array: dist_assertUint32Array, + uint8Array: dist_assertUint8Array, + uint8ClampedArray: dist_assertUint8ClampedArray, + undefined: dist_assertUndefined, + urlInstance: dist_assertUrlInstance, + urlSearchParams: dist_assertUrlSearchParams, + urlString: dist_assertUrlString, + validDate: dist_assertValidDate, + validLength: dist_assertValidLength, + weakMap: dist_assertWeakMap, + weakRef: dist_assertWeakRef, + weakSet: dist_assertWeakSet, + whitespaceString: dist_assertWhitespaceString, +}; +const dist_methodTypeMap = { + isArray: 'Array', + isArrayBuffer: 'ArrayBuffer', + isArrayLike: 'array-like', + isAsyncFunction: 'AsyncFunction', + isAsyncGenerator: 'AsyncGenerator', + isAsyncGeneratorFunction: 'AsyncGeneratorFunction', + isAsyncIterable: 'AsyncIterable', + isBigint: 'bigint', + isBigInt64Array: 'BigInt64Array', + isBigUint64Array: 'BigUint64Array', + isBlob: 'Blob', + isBoolean: 'boolean', + isBoundFunction: 'Function', + isBuffer: 'Buffer', + isClass: 'Class', + isDataView: 'DataView', + isDate: 'Date', + isDirectInstanceOf: 'T', + /** @deprecated */ + isDomElement: 'HTMLElement', + isEmptyArray: 'empty array', + isEmptyMap: 'empty map', + isEmptyObject: 'empty object', + isEmptySet: 'empty set', + isEmptyString: 'empty string', + isEmptyStringOrWhitespace: 'empty string or whitespace', + isEnumCase: 'EnumCase', + isError: 'Error', + isEvenInteger: 'even integer', + isFalsy: 'falsy', + isFloat32Array: 'Float32Array', + isFloat64Array: 'Float64Array', + isFormData: 'FormData', + isFunction: 'Function', + isGenerator: 'Generator', + isGeneratorFunction: 'GeneratorFunction', + isHtmlElement: 'HTMLElement', + isInfinite: 'infinite number', + isInRange: 'in range', + isInt16Array: 'Int16Array', + isInt32Array: 'Int32Array', + isInt8Array: 'Int8Array', + isInteger: 'integer', + isIterable: 'Iterable', + isMap: 'Map', + isNan: 'NaN', + isNativePromise: 'native Promise', + isNegativeNumber: 'negative number', + isNodeStream: 'Node.js Stream', + isNonEmptyArray: 'non-empty array', + isNonEmptyMap: 'non-empty map', + isNonEmptyObject: 'non-empty object', + isNonEmptySet: 'non-empty set', + isNonEmptyString: 'non-empty string', + isNonEmptyStringAndNotWhitespace: 'non-empty string and not whitespace', + isNull: 'null', + isNullOrUndefined: 'null or undefined', + isNumber: 'number', + isNumericString: 'string with a number', + isObject: 'Object', + isObservable: 'Observable', + isOddInteger: 'odd integer', + isPlainObject: 'plain object', + isPositiveNumber: 'positive number', + isPrimitive: 'primitive', + isPromise: 'Promise', + isPropertyKey: 'PropertyKey', + isRegExp: 'RegExp', + isSafeInteger: 'integer', + isSet: 'Set', + isSharedArrayBuffer: 'SharedArrayBuffer', + isString: 'string', + isSymbol: 'symbol', + isTruthy: 'truthy', + isTupleLike: 'tuple-like', + isTypedArray: 'TypedArray', + isUint16Array: 'Uint16Array', + isUint32Array: 'Uint32Array', + isUint8Array: 'Uint8Array', + isUint8ClampedArray: 'Uint8ClampedArray', + isUndefined: 'undefined', + isUrlInstance: 'URL', + isUrlSearchParams: 'URLSearchParams', + isUrlString: 'string with a URL', + isValidDate: 'valid Date', + isValidLength: 'valid length', + isWeakMap: 'WeakMap', + isWeakRef: 'WeakRef', + isWeakSet: 'WeakSet', + isWhitespaceString: 'whitespace string', +}; +function dist_keysOf(value) { + return Object.keys(value); +} +const dist_isMethodNames = dist_keysOf(dist_methodTypeMap); +function dist_isIsMethodName(value) { + return dist_isMethodNames.includes(value); +} +function dist_assertAll(predicate, ...values) { + if (!dist_isAll(predicate, ...values)) { + const expectedType = dist_isIsMethodName(predicate.name) ? dist_methodTypeMap[predicate.name] : 'predicate returns truthy for all values'; + throw new TypeError(dist_typeErrorMessageMultipleValues(expectedType, values)); + } +} +function dist_assertAny(predicate, ...values) { + if (!dist_isAny(predicate, ...values)) { + const predicates = dist_isArray(predicate) ? predicate : [predicate]; + const expectedTypes = predicates.map(predicate => dist_isIsMethodName(predicate.name) ? dist_methodTypeMap[predicate.name] : 'predicate returns truthy for any value'); + throw new TypeError(dist_typeErrorMessageMultipleValues(expectedTypes, values)); + } +} +function dist_assertArray(value, assertion, message) { + if (!dist_isArray(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Array', value)); + } + if (assertion) { + // eslint-disable-next-line unicorn/no-array-for-each, unicorn/no-array-callback-reference + value.forEach(assertion); + } +} +function dist_assertArrayBuffer(value, message) { + if (!dist_isArrayBuffer(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('ArrayBuffer', value)); + } +} +function dist_assertArrayLike(value, message) { + if (!dist_isArrayLike(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('array-like', value)); + } +} +// eslint-disable-next-line @typescript-eslint/ban-types +function dist_assertAsyncFunction(value, message) { + if (!dist_isAsyncFunction(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('AsyncFunction', value)); + } +} +function dist_assertAsyncGenerator(value, message) { + if (!dist_isAsyncGenerator(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('AsyncGenerator', value)); + } +} +function dist_assertAsyncGeneratorFunction(value, message) { + if (!dist_isAsyncGeneratorFunction(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('AsyncGeneratorFunction', value)); + } +} +function dist_assertAsyncIterable(value, message) { + if (!dist_isAsyncIterable(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('AsyncIterable', value)); + } +} +function dist_assertBigint(value, message) { + if (!dist_isBigint(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('bigint', value)); + } +} +function dist_assertBigInt64Array(value, message) { + if (!dist_isBigInt64Array(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('BigInt64Array', value)); + } +} +function dist_assertBigUint64Array(value, message) { + if (!dist_isBigUint64Array(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('BigUint64Array', value)); + } +} +function dist_assertBlob(value, message) { + if (!dist_isBlob(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Blob', value)); + } +} +function dist_assertBoolean(value, message) { + if (!dist_isBoolean(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('boolean', value)); + } +} +// eslint-disable-next-line @typescript-eslint/ban-types +function dist_assertBoundFunction(value, message) { + if (!dist_isBoundFunction(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Function', value)); + } +} +function dist_assertBuffer(value, message) { + if (!dist_isBuffer(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Buffer', value)); + } +} +function dist_assertClass(value, message) { + if (!dist_isClass(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Class', value)); + } +} +function dist_assertDataView(value, message) { + if (!dist_isDataView(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('DataView', value)); + } +} +function dist_assertDate(value, message) { + if (!dist_isDate(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Date', value)); + } +} +function dist_assertDirectInstanceOf(instance, class_, message) { + if (!dist_isDirectInstanceOf(instance, class_)) { + throw new TypeError(message ?? dist_typeErrorMessage('T', instance)); + } +} +function dist_assertEmptyArray(value, message) { + if (!dist_isEmptyArray(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('empty array', value)); + } +} +function dist_assertEmptyMap(value, message) { + if (!dist_isEmptyMap(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('empty map', value)); + } +} +function dist_assertEmptyObject(value, message) { + if (!dist_isEmptyObject(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('empty object', value)); + } +} +function dist_assertEmptySet(value, message) { + if (!dist_isEmptySet(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('empty set', value)); + } +} +function dist_assertEmptyString(value, message) { + if (!dist_isEmptyString(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('empty string', value)); + } +} +function dist_assertEmptyStringOrWhitespace(value, message) { + if (!dist_isEmptyStringOrWhitespace(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('empty string or whitespace', value)); + } +} +function dist_assertEnumCase(value, targetEnum, message) { + if (!dist_isEnumCase(value, targetEnum)) { + throw new TypeError(message ?? dist_typeErrorMessage('EnumCase', value)); + } +} +function dist_assertError(value, message) { + if (!dist_isError(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Error', value)); + } +} +function dist_assertEvenInteger(value, message) { + if (!dist_isEvenInteger(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('even integer', value)); + } +} +function dist_assertFalsy(value, message) { + if (!dist_isFalsy(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('falsy', value)); + } +} +function dist_assertFloat32Array(value, message) { + if (!dist_isFloat32Array(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Float32Array', value)); + } +} +function dist_assertFloat64Array(value, message) { + if (!dist_isFloat64Array(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Float64Array', value)); + } +} +function dist_assertFormData(value, message) { + if (!dist_isFormData(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('FormData', value)); + } +} +// eslint-disable-next-line @typescript-eslint/ban-types +function dist_assertFunction(value, message) { + if (!dist_isFunction(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Function', value)); + } +} +function dist_assertGenerator(value, message) { + if (!dist_isGenerator(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Generator', value)); + } +} +function dist_assertGeneratorFunction(value, message) { + if (!dist_isGeneratorFunction(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('GeneratorFunction', value)); + } +} +function dist_assertHtmlElement(value, message) { + if (!dist_isHtmlElement(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('HTMLElement', value)); + } +} +function dist_assertInfinite(value, message) { + if (!dist_isInfinite(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('infinite number', value)); + } +} +function dist_assertInRange(value, range, message) { + if (!dist_isInRange(value, range)) { + throw new TypeError(message ?? dist_typeErrorMessage('in range', value)); + } +} +function dist_assertInt16Array(value, message) { + if (!dist_isInt16Array(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Int16Array', value)); + } +} +function dist_assertInt32Array(value, message) { + if (!dist_isInt32Array(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Int32Array', value)); + } +} +function dist_assertInt8Array(value, message) { + if (!dist_isInt8Array(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Int8Array', value)); + } +} +function dist_assertInteger(value, message) { + if (!dist_isInteger(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('integer', value)); + } +} +function dist_assertIterable(value, message) { + if (!dist_isIterable(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Iterable', value)); + } +} +function dist_assertMap(value, message) { + if (!dist_isMap(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Map', value)); + } +} +function dist_assertNan(value, message) { + if (!dist_isNan(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('NaN', value)); + } +} +function dist_assertNativePromise(value, message) { + if (!dist_isNativePromise(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('native Promise', value)); + } +} +function dist_assertNegativeNumber(value, message) { + if (!dist_isNegativeNumber(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('negative number', value)); + } +} +function dist_assertNodeStream(value, message) { + if (!dist_isNodeStream(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Node.js Stream', value)); + } +} +function dist_assertNonEmptyArray(value, message) { + if (!dist_isNonEmptyArray(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('non-empty array', value)); + } +} +function dist_assertNonEmptyMap(value, message) { + if (!dist_isNonEmptyMap(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('non-empty map', value)); + } +} +function dist_assertNonEmptyObject(value, message) { + if (!dist_isNonEmptyObject(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('non-empty object', value)); + } +} +function dist_assertNonEmptySet(value, message) { + if (!dist_isNonEmptySet(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('non-empty set', value)); + } +} +function dist_assertNonEmptyString(value, message) { + if (!dist_isNonEmptyString(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('non-empty string', value)); + } +} +function dist_assertNonEmptyStringAndNotWhitespace(value, message) { + if (!dist_isNonEmptyStringAndNotWhitespace(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('non-empty string and not whitespace', value)); + } +} +// eslint-disable-next-line @typescript-eslint/ban-types +function dist_assertNull(value, message) { + if (!dist_isNull(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('null', value)); + } +} +// eslint-disable-next-line @typescript-eslint/ban-types +function dist_assertNullOrUndefined(value, message) { + if (!dist_isNullOrUndefined(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('null or undefined', value)); + } +} +function dist_assertNumber(value, message) { + if (!dist_isNumber(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('number', value)); + } +} +function dist_assertNumericString(value, message) { + if (!dist_isNumericString(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('string with a number', value)); } - const result = this.features[name]; - if (result === void 0) { - return void 0; +} +// eslint-disable-next-line @typescript-eslint/ban-types +function dist_assertObject(value, message) { + if (!dist_isObject(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Object', value)); } - this.recordEvent("$feature_flag_called", { - $feature_flag: name, - $feature_flag_response: result.variant - }); - return result; - } - /** - * Check in to install.determinate.systems, to accomplish three things: - * - * 1. Preflight the server selected from IdsHost, to increase the chances of success. - * 2. Fetch any incidents and maintenance events to let users know in case things are weird. - * 3. Get feature flag data so we can gently roll out new features. - */ - async requestCheckIn() { - for (let attemptsRemaining = 5; attemptsRemaining > 0; attemptsRemaining--) { - const checkInUrl = await this.getCheckInUrl(); - if (checkInUrl === void 0) { - return void 0; - } - try { - core.debug(`Preflighting via ${checkInUrl}`); - checkInUrl.searchParams.set("ci", "github"); - checkInUrl.searchParams.set( - "correlation", - JSON.stringify(this.identity) - ); - return (await this.getClient()).get(checkInUrl, { - timeout: { - request: CHECK_IN_ENDPOINT_TIMEOUT_MS - } - }).json(); - } catch (e) { - core.debug(`Error checking in: ${stringifyError2(e)}`); - this.idsHost.markCurrentHostBroken(); - } +} +function dist_assertObservable(value, message) { + if (!dist_isObservable(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Observable', value)); } - return void 0; - } - /** - * Fetch an artifact, such as a tarball, from the location determined by the - * `source-*` inputs. If `source-binary` is specified, this will return a path - * to a binary on disk; otherwise, the artifact will be downloaded from the - * URL determined by the other `source-*` inputs (`source-url`, `source-pr`, - * etc.). - */ - async fetchArtifact() { - const sourceBinary = getStringOrNull("source-binary"); - if (sourceBinary !== null && sourceBinary !== "") { - core.debug(`Using the provided source binary at ${sourceBinary}`); - return sourceBinary; +} +function dist_assertOddInteger(value, message) { + if (!dist_isOddInteger(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('odd integer', value)); } - core.startGroup( - `Downloading ${this.actionOptions.name} for ${this.architectureFetchSuffix}` - ); - try { - core.info(`Fetching from ${await this.getSourceUrl()}`); - const correlatedUrl = await this.getSourceUrl(); - correlatedUrl.searchParams.set("ci", "github"); - correlatedUrl.searchParams.set( - "correlation", - JSON.stringify(this.identity) - ); - const versionCheckup = await (await this.getClient()).head(correlatedUrl); - if (versionCheckup.headers.etag) { - const v = versionCheckup.headers.etag; - this.addFact(FACT_SOURCE_URL_ETAG, v); - core.debug( - `Checking the tool cache for ${await this.getSourceUrl()} at ${v}` - ); - const cached = await this.getCachedVersion(v); - if (cached) { - this.facts[FACT_ARTIFACT_FETCHED_FROM_CACHE] = true; - core.debug(`Tool cache hit.`); - return cached; - } - } - this.facts[FACT_ARTIFACT_FETCHED_FROM_CACHE] = false; - core.debug( - `No match from the cache, re-fetching from the redirect: ${versionCheckup.url}` - ); - const destFile = this.getTemporaryName(); - const fetchStream = (await this.getClient()).stream(versionCheckup.url); - await (0,external_node_stream_promises_namespaceObject.pipeline)( - fetchStream, - (0,external_node_fs_namespaceObject.createWriteStream)(destFile, { - encoding: "binary", - mode: 493 - }) - ); - if (fetchStream.response?.headers.etag) { - const v = fetchStream.response.headers.etag; - try { - await this.saveCachedVersion(v, destFile); - } catch (e) { - core.debug(`Error caching the artifact: ${stringifyError2(e)}`); - } - } - return destFile; - } finally { - core.endGroup(); +} +function dist_assertPlainObject(value, message) { + if (!dist_isPlainObject(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('plain object', value)); } - } - /** - * A helper function for failing on error only if strict mode is enabled. - * This is intended only for CI environments testing Actions themselves. - */ - failOnError(msg) { - if (this.strictMode) { - core.setFailed(`strict mode failure: ${msg}`); +} +function dist_assertPositiveNumber(value, message) { + if (!dist_isPositiveNumber(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('positive number', value)); } - } - async complete() { - this.recordEvent(`complete_${this.executionPhase}`); - await this.submitEvents(); - } - async getCheckInUrl() { - const checkInUrl = await this.idsHost.getDynamicRootUrl(); - if (checkInUrl === void 0) { - return void 0; +} +function dist_assertPrimitive(value, message) { + if (!dist_isPrimitive(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('primitive', value)); } - checkInUrl.pathname += "check-in"; - return checkInUrl; - } - async getSourceUrl() { - const p = this.sourceParameters; - if (p.url) { - this.addFact(FACT_SOURCE_URL, p.url); - return new URL(p.url); +} +function dist_assertPromise(value, message) { + if (!dist_isPromise(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Promise', value)); } - const fetchUrl = await this.idsHost.getRootUrl(); - fetchUrl.pathname += this.actionOptions.idsProjectName; - if (p.tag) { - fetchUrl.pathname += `/tag/${p.tag}`; - } else if (p.pr) { - fetchUrl.pathname += `/pr/${p.pr}`; - } else if (p.branch) { - fetchUrl.pathname += `/branch/${p.branch}`; - } else if (p.revision) { - fetchUrl.pathname += `/rev/${p.revision}`; - } else { - fetchUrl.pathname += `/stable`; +} +function dist_assertPropertyKey(value, message) { + if (!dist_isPropertyKey(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('PropertyKey', value)); } - fetchUrl.pathname += `/${this.architectureFetchSuffix}`; - this.addFact(FACT_SOURCE_URL, fetchUrl.toString()); - return fetchUrl; - } - cacheKey(version2) { - const cleanedVersion = version2.replace(/[^a-zA-Z0-9-+.]/g, ""); - return `determinatesystem-${this.actionOptions.name}-${this.architectureFetchSuffix}-${cleanedVersion}`; - } - async getCachedVersion(version2) { - const startCwd = process.cwd(); - try { - const tempDir = this.getTemporaryName(); - await (0,promises_namespaceObject.mkdir)(tempDir); - process.chdir(tempDir); - process.env.GITHUB_WORKSPACE_BACKUP = process.env.GITHUB_WORKSPACE; - delete process.env.GITHUB_WORKSPACE; - if (await cache.restoreCache( - [this.actionOptions.name], - this.cacheKey(version2), - [], - void 0, - true - )) { - this.recordEvent(EVENT_ARTIFACT_CACHE_HIT); - return `${tempDir}/${this.actionOptions.name}`; - } - this.recordEvent(EVENT_ARTIFACT_CACHE_MISS); - return void 0; - } finally { - process.env.GITHUB_WORKSPACE = process.env.GITHUB_WORKSPACE_BACKUP; - delete process.env.GITHUB_WORKSPACE_BACKUP; - process.chdir(startCwd); +} +function dist_assertRegExp(value, message) { + if (!dist_isRegExp(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('RegExp', value)); } - } - async saveCachedVersion(version2, toolPath) { - const startCwd = process.cwd(); - try { - const tempDir = this.getTemporaryName(); - await (0,promises_namespaceObject.mkdir)(tempDir); - process.chdir(tempDir); - await (0,promises_namespaceObject.copyFile)(toolPath, `${tempDir}/${this.actionOptions.name}`); - process.env.GITHUB_WORKSPACE_BACKUP = process.env.GITHUB_WORKSPACE; - delete process.env.GITHUB_WORKSPACE; - await cache.saveCache( - [this.actionOptions.name], - this.cacheKey(version2), - void 0, - true - ); - this.recordEvent(EVENT_ARTIFACT_CACHE_PERSIST); - } finally { - process.env.GITHUB_WORKSPACE = process.env.GITHUB_WORKSPACE_BACKUP; - delete process.env.GITHUB_WORKSPACE_BACKUP; - process.chdir(startCwd); +} +function dist_assertSafeInteger(value, message) { + if (!dist_isSafeInteger(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('integer', value)); } - } - async preflightRequireNix() { - let nixLocation; - const pathParts = (process.env["PATH"] || "").split(":"); - for (const location of pathParts) { - const candidateNix = external_node_path_namespaceObject.join(location, "nix"); - try { - await promises_namespaceObject.access(candidateNix, promises_namespaceObject.constants.X_OK); - core.debug(`Found Nix at ${candidateNix}`); - nixLocation = candidateNix; - break; - } catch { - core.debug(`Nix not at ${candidateNix}`); - } +} +function dist_assertSet(value, message) { + if (!dist_isSet(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Set', value)); } - this.addFact(FACT_NIX_LOCATION, nixLocation || ""); - if (this.actionOptions.requireNix === "ignore") { - return true; +} +function dist_assertSharedArrayBuffer(value, message) { + if (!dist_isSharedArrayBuffer(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('SharedArrayBuffer', value)); } - const currentNotFoundState = core.getState(STATE_KEY_NIX_NOT_FOUND); - if (currentNotFoundState === STATE_NOT_FOUND) { - return false; +} +function dist_assertString(value, message) { + if (!dist_isString(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('string', value)); } - if (nixLocation !== void 0) { - return true; +} +function dist_assertSymbol(value, message) { + if (!dist_isSymbol(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('symbol', value)); + } +} +function dist_assertTruthy(value, message) { + if (!dist_isTruthy(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('truthy', value)); + } +} +function dist_assertTupleLike(value, guards, message) { + if (!dist_isTupleLike(value, guards)) { + throw new TypeError(message ?? dist_typeErrorMessage('tuple-like', value)); + } +} +function dist_assertTypedArray(value, message) { + if (!dist_isTypedArray(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('TypedArray', value)); + } +} +function dist_assertUint16Array(value, message) { + if (!dist_isUint16Array(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Uint16Array', value)); + } +} +function dist_assertUint32Array(value, message) { + if (!dist_isUint32Array(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Uint32Array', value)); + } +} +function dist_assertUint8Array(value, message) { + if (!dist_isUint8Array(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Uint8Array', value)); + } +} +function dist_assertUint8ClampedArray(value, message) { + if (!dist_isUint8ClampedArray(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('Uint8ClampedArray', value)); + } +} +function dist_assertUndefined(value, message) { + if (!dist_isUndefined(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('undefined', value)); + } +} +function dist_assertUrlInstance(value, message) { + if (!dist_isUrlInstance(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('URL', value)); + } +} +// eslint-disable-next-line unicorn/prevent-abbreviations +function dist_assertUrlSearchParams(value, message) { + if (!dist_isUrlSearchParams(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('URLSearchParams', value)); + } +} +function dist_assertUrlString(value, message) { + if (!dist_isUrlString(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('string with a URL', value)); } - core.saveState(STATE_KEY_NIX_NOT_FOUND, STATE_NOT_FOUND); - switch (this.actionOptions.requireNix) { - case "fail": - core.setFailed( - [ - "This action can only be used when Nix is installed.", - "Add `- uses: DeterminateSystems/nix-installer-action@main` earlier in your workflow." - ].join(" ") - ); - break; - case "warn": - core.warning( - [ - "This action is in no-op mode because Nix is not installed.", - "Add `- uses: DeterminateSystems/nix-installer-action@main` earlier in your workflow." - ].join(" ") - ); - break; +} +function dist_assertValidDate(value, message) { + if (!dist_isValidDate(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('valid Date', value)); } - return false; - } - async preflightNixStoreInfo() { - let output = ""; - const options = {}; - options.silent = true; - options.listeners = { - stdout: (data) => { - output += data.toString(); - } - }; - try { - output = ""; - await exec.exec("nix", ["store", "info", "--json"], options); - this.addFact(FACT_NIX_STORE_CHECK_METHOD, "info"); - } catch { - try { - output = ""; - await exec.exec("nix", ["store", "ping", "--json"], options); - this.addFact(FACT_NIX_STORE_CHECK_METHOD, "ping"); - } catch { - this.addFact(FACT_NIX_STORE_CHECK_METHOD, "none"); - return; - } +} +function dist_assertValidLength(value, message) { + if (!dist_isValidLength(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('valid length', value)); } - try { - const parsed = JSON.parse(output); - if (parsed.trusted === 1) { - this.nixStoreTrust = "trusted"; - } else if (parsed.trusted === 0) { - this.nixStoreTrust = "untrusted"; - } else if (parsed.trusted !== void 0) { - this.addFact( - FACT_NIX_STORE_CHECK_ERROR, - `Mysterious trusted value: ${JSON.stringify(parsed.trusted)}` - ); - } - this.addFact(FACT_NIX_STORE_VERSION, JSON.stringify(parsed.version)); - } catch (e) { - this.addFact(FACT_NIX_STORE_CHECK_ERROR, stringifyError2(e)); +} +// eslint-disable-next-line @typescript-eslint/ban-types +function dist_assertWeakMap(value, message) { + if (!dist_isWeakMap(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('WeakMap', value)); } - } - async submitEvents() { - const diagnosticsUrl = await this.idsHost.getDiagnosticsUrl(); - if (diagnosticsUrl === void 0) { - core.debug( - "Diagnostics are disabled. Not sending the following events:" - ); - core.debug(JSON.stringify(this.events, void 0, 2)); - return; +} +// eslint-disable-next-line @typescript-eslint/ban-types +function dist_assertWeakRef(value, message) { + if (!dist_isWeakRef(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('WeakRef', value)); } - const batch = { - type: "eventlog", - sent_at: /* @__PURE__ */ new Date(), - events: this.events - }; - try { - await (await this.getClient()).post(diagnosticsUrl, { - json: batch, - timeout: { - request: DIAGNOSTIC_ENDPOINT_TIMEOUT_MS - } - }); - } catch (err) { - core.debug( - `Error submitting diagnostics event to ${diagnosticsUrl}: ${stringifyError2(err)}` - ); +} +// eslint-disable-next-line @typescript-eslint/ban-types +function dist_assertWeakSet(value, message) { + if (!dist_isWeakSet(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('WeakSet', value)); } - this.events = []; - } -}; -function stringifyError2(error3) { - return error3 instanceof Error || typeof error3 == "string" ? error3.toString() : JSON.stringify(error3); } -function makeOptionsConfident(actionOptions) { - const idsProjectName = actionOptions.idsProjectName ?? actionOptions.name; - const finalOpts = { - name: actionOptions.name, - idsProjectName, - eventPrefix: actionOptions.eventPrefix || "action:", - fetchStyle: actionOptions.fetchStyle, - legacySourcePrefix: actionOptions.legacySourcePrefix, - requireNix: actionOptions.requireNix - }; - core.debug("idslib options:"); - core.debug(JSON.stringify(finalOpts, void 0, 2)); - return finalOpts; +function dist_assertWhitespaceString(value, message) { + if (!dist_isWhitespaceString(value)) { + throw new TypeError(message ?? dist_typeErrorMessage('whitespace string', value)); + } } +/* harmony default export */ const is_dist = (dist_is); -/*! - * linux-release-info - * Get Linux release info (distribution name, version, arch, release, etc.) - * from '/etc/os-release' or '/usr/lib/os-release' files and from native os - * module. On Windows and Darwin platforms it only returns common node os module - * info (platform, hostname, release, and arch) - * - * Licensed under MIT - * Copyright (c) 2018-2020 [Samuel Carreira] - */ -//# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/core/errors.js // A hacky check to prevent circular references. function errors_isRequest(x) { - return dist.object(x) && '_onResponse' in x; + return is_dist.object(x) && '_onResponse' in x; } /** An error to be thrown when a request fails. @@ -98102,7 +99096,7 @@ class errors_RequestError extends Error { } this.timings = this.request?.timings; // Recover the original stacktrace - if (dist.string(error.stack) && dist.string(this.stack)) { + if (is_dist.string(error.stack) && is_dist.string(this.stack)) { const indexOfMessage = this.stack.indexOf(this.message) + this.message.length; const thisStackTrace = this.stack.slice(indexOfMessage).split('\n').reverse(); const errorStackTrace = error.stack.slice(error.stack.indexOf(error.message) + error.message.length).split('\n').reverse(); @@ -98173,41 +99167,344 @@ class errors_TimeoutError extends errors_RequestError { this.timings = timings; } } -/** -An error to be thrown when reading from response stream fails. -*/ -class errors_ReadError extends errors_RequestError { - constructor(error, request) { - super(error.message, error, request); - this.name = 'ReadError'; - this.code = this.code === 'ERR_GOT_REQUEST_ERROR' ? 'ERR_READING_RESPONSE_STREAM' : this.code; - } +/** +An error to be thrown when reading from response stream fails. +*/ +class errors_ReadError extends errors_RequestError { + constructor(error, request) { + super(error.message, error, request); + this.name = 'ReadError'; + this.code = this.code === 'ERR_GOT_REQUEST_ERROR' ? 'ERR_READING_RESPONSE_STREAM' : this.code; + } +} +/** +An error which always triggers a new retry when thrown. +*/ +class errors_RetryError extends errors_RequestError { + constructor(request) { + super('Retrying', {}, request); + this.name = 'RetryError'; + this.code = 'ERR_RETRYING'; + } +} +/** +An error to be thrown when the request is aborted by AbortController. +*/ +class errors_AbortError extends errors_RequestError { + constructor(request) { + super('This operation was aborted.', {}, request); + this.code = 'ERR_ABORTED'; + this.name = 'AbortError'; + } +} + +;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/contents.js +const source_contents_getStreamContents = async (stream, {init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize}, {maxBuffer = Number.POSITIVE_INFINITY} = {}) => { + if (!contents_isAsyncIterable(stream)) { + throw new Error('The first argument must be a Readable, a ReadableStream, or an async iterable.'); + } + + const state = init(); + state.length = 0; + + try { + for await (const chunk of stream) { + const chunkType = contents_getChunkType(chunk); + const convertedChunk = convertChunk[chunkType](chunk, state); + contents_appendChunk({convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer}); + } + + contents_appendFinalChunk({state, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer}); + return finalize(state); + } catch (error) { + error.bufferedData = finalize(state); + throw error; + } +}; + +const contents_appendFinalChunk = ({state, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer}) => { + const convertedChunk = getFinalChunk(state); + if (convertedChunk !== undefined) { + contents_appendChunk({convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer}); + } +}; + +const contents_appendChunk = ({convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer}) => { + const chunkSize = getSize(convertedChunk); + const newLength = state.length + chunkSize; + + if (newLength <= maxBuffer) { + contents_addNewChunk(convertedChunk, state, addChunk, newLength); + return; + } + + const truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state.length); + + if (truncatedChunk !== undefined) { + contents_addNewChunk(truncatedChunk, state, addChunk, maxBuffer); + } + + throw new contents_MaxBufferError(); +}; + +const contents_addNewChunk = (convertedChunk, state, addChunk, newLength) => { + state.contents = addChunk(convertedChunk, state, newLength); + state.length = newLength; +}; + +const contents_isAsyncIterable = stream => typeof stream === 'object' && stream !== null && typeof stream[Symbol.asyncIterator] === 'function'; + +const contents_getChunkType = chunk => { + const typeOfChunk = typeof chunk; + + if (typeOfChunk === 'string') { + return 'string'; + } + + if (typeOfChunk !== 'object' || chunk === null) { + return 'others'; + } + + // eslint-disable-next-line n/prefer-global/buffer + if (globalThis.Buffer?.isBuffer(chunk)) { + return 'buffer'; + } + + const prototypeName = contents_objectToString.call(chunk); + + if (prototypeName === '[object ArrayBuffer]') { + return 'arrayBuffer'; + } + + if (prototypeName === '[object DataView]') { + return 'dataView'; + } + + if ( + Number.isInteger(chunk.byteLength) + && Number.isInteger(chunk.byteOffset) + && contents_objectToString.call(chunk.buffer) === '[object ArrayBuffer]' + ) { + return 'typedArray'; + } + + return 'others'; +}; + +const {toString: contents_objectToString} = Object.prototype; + +class contents_MaxBufferError extends Error { + name = 'MaxBufferError'; + + constructor() { + super('maxBuffer exceeded'); + } +} + +;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/utils.js +const utils_identity = value => value; + +const utils_noop = () => undefined; + +const getContentsProp = ({contents}) => contents; + +const utils_throwObjectStream = chunk => { + throw new Error(`Streams in object mode are not supported: ${String(chunk)}`); +}; + +const getLengthProp = convertedChunk => convertedChunk.length; + +;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array.js + + + +async function getStreamAsArray(stream, options) { + return getStreamContents(stream, arrayMethods, options); +} + +const initArray = () => ({contents: []}); + +const increment = () => 1; + +const addArrayChunk = (convertedChunk, {contents}) => { + contents.push(convertedChunk); + return contents; +}; + +const arrayMethods = { + init: initArray, + convertChunk: { + string: utils_identity, + buffer: utils_identity, + arrayBuffer: utils_identity, + dataView: utils_identity, + typedArray: utils_identity, + others: utils_identity, + }, + getSize: increment, + truncateChunk: utils_noop, + addChunk: addArrayChunk, + getFinalChunk: utils_noop, + finalize: getContentsProp, +}; + +;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array-buffer.js + + + +async function array_buffer_getStreamAsArrayBuffer(stream, options) { + return source_contents_getStreamContents(stream, array_buffer_arrayBufferMethods, options); } -/** -An error which always triggers a new retry when thrown. -*/ -class errors_RetryError extends errors_RequestError { - constructor(request) { - super('Retrying', {}, request); - this.name = 'RetryError'; - this.code = 'ERR_RETRYING'; - } + +const array_buffer_initArrayBuffer = () => ({contents: new ArrayBuffer(0)}); + +const array_buffer_useTextEncoder = chunk => array_buffer_textEncoder.encode(chunk); +const array_buffer_textEncoder = new TextEncoder(); + +const array_buffer_useUint8Array = chunk => new Uint8Array(chunk); + +const array_buffer_useUint8ArrayWithOffset = chunk => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength); + +const array_buffer_truncateArrayBufferChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize); + +// `contents` is an increasingly growing `Uint8Array`. +const array_buffer_addArrayBufferChunk = (convertedChunk, {contents, length: previousLength}, length) => { + const newContents = array_buffer_hasArrayBufferResize() ? array_buffer_resizeArrayBuffer(contents, length) : array_buffer_resizeArrayBufferSlow(contents, length); + new Uint8Array(newContents).set(convertedChunk, previousLength); + return newContents; +}; + +// Without `ArrayBuffer.resize()`, `contents` size is always a power of 2. +// This means its last bytes are zeroes (not stream data), which need to be +// trimmed at the end with `ArrayBuffer.slice()`. +const array_buffer_resizeArrayBufferSlow = (contents, length) => { + if (length <= contents.byteLength) { + return contents; + } + + const arrayBuffer = new ArrayBuffer(array_buffer_getNewContentsLength(length)); + new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0); + return arrayBuffer; +}; + +// With `ArrayBuffer.resize()`, `contents` size matches exactly the size of +// the stream data. It does not include extraneous zeroes to trim at the end. +// The underlying `ArrayBuffer` does allocate a number of bytes that is a power +// of 2, but those bytes are only visible after calling `ArrayBuffer.resize()`. +const array_buffer_resizeArrayBuffer = (contents, length) => { + if (length <= contents.maxByteLength) { + contents.resize(length); + return contents; + } + + const arrayBuffer = new ArrayBuffer(length, {maxByteLength: array_buffer_getNewContentsLength(length)}); + new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0); + return arrayBuffer; +}; + +// Retrieve the closest `length` that is both >= and a power of 2 +const array_buffer_getNewContentsLength = length => array_buffer_SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(array_buffer_SCALE_FACTOR)); + +const array_buffer_SCALE_FACTOR = 2; + +const array_buffer_finalizeArrayBuffer = ({contents, length}) => array_buffer_hasArrayBufferResize() ? contents : contents.slice(0, length); + +// `ArrayBuffer.slice()` is slow. When `ArrayBuffer.resize()` is available +// (Node >=20.0.0, Safari >=16.4 and Chrome), we can use it instead. +// eslint-disable-next-line no-warning-comments +// TODO: remove after dropping support for Node 20. +// eslint-disable-next-line no-warning-comments +// TODO: use `ArrayBuffer.transferToFixedLength()` instead once it is available +const array_buffer_hasArrayBufferResize = () => 'resize' in ArrayBuffer.prototype; + +const array_buffer_arrayBufferMethods = { + init: array_buffer_initArrayBuffer, + convertChunk: { + string: array_buffer_useTextEncoder, + buffer: array_buffer_useUint8Array, + arrayBuffer: array_buffer_useUint8Array, + dataView: array_buffer_useUint8ArrayWithOffset, + typedArray: array_buffer_useUint8ArrayWithOffset, + others: utils_throwObjectStream, + }, + getSize: getLengthProp, + truncateChunk: array_buffer_truncateArrayBufferChunk, + addChunk: array_buffer_addArrayBufferChunk, + getFinalChunk: utils_noop, + finalize: array_buffer_finalizeArrayBuffer, +}; + +;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/buffer.js + + +async function buffer_getStreamAsBuffer(stream, options) { + if (!('Buffer' in globalThis)) { + throw new Error('getStreamAsBuffer() is only supported in Node.js'); + } + + try { + return buffer_arrayBufferToNodeBuffer(await array_buffer_getStreamAsArrayBuffer(stream, options)); + } catch (error) { + if (error.bufferedData !== undefined) { + error.bufferedData = buffer_arrayBufferToNodeBuffer(error.bufferedData); + } + + throw error; + } } -/** -An error to be thrown when the request is aborted by AbortController. -*/ -class errors_AbortError extends errors_RequestError { - constructor(request) { - super('This operation was aborted.', {}, request); - this.code = 'ERR_ABORTED'; - this.name = 'AbortError'; - } + +// eslint-disable-next-line n/prefer-global/buffer +const buffer_arrayBufferToNodeBuffer = arrayBuffer => globalThis.Buffer.from(arrayBuffer); + +;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/string.js + + + +async function getStreamAsString(stream, options) { + return getStreamContents(stream, stringMethods, options); } +const initString = () => ({contents: '', textDecoder: new TextDecoder()}); + +const useTextDecoder = (chunk, {textDecoder}) => textDecoder.decode(chunk, {stream: true}); + +const addStringChunk = (convertedChunk, {contents}) => contents + convertedChunk; + +const truncateStringChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize); + +const getFinalStringChunk = ({textDecoder}) => { + const finalChunk = textDecoder.decode(); + return finalChunk === '' ? undefined : finalChunk; +}; + +const stringMethods = { + init: initString, + convertChunk: { + string: utils_identity, + buffer: useTextDecoder, + arrayBuffer: useTextDecoder, + dataView: useTextDecoder, + typedArray: useTextDecoder, + others: utils_throwObjectStream, + }, + getSize: getLengthProp, + truncateChunk: truncateStringChunk, + addChunk: addStringChunk, + getFinalChunk: getFinalStringChunk, + finalize: getContentsProp, +}; + +;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/index.js + + + + + + ;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/core/utils/is-form-data.js function utils_is_form_data_isFormData(body) { - return dist.nodeStream(body) && dist.function_(body.getBoundary); + return is_dist.nodeStream(body) && is_dist.function_(body.getBoundary); } ;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/core/utils/get-body-size.js @@ -98222,10 +99519,10 @@ async function get_body_size_getBodySize(body, headers) { if (!body) { return 0; } - if (dist.string(body)) { + if (is_dist.string(body)) { return external_node_buffer_namespaceObject.Buffer.byteLength(body); } - if (dist.buffer(body)) { + if (is_dist.buffer(body)) { return body.length; } if (utils_is_form_data_isFormData(body)) { @@ -98411,7 +99708,7 @@ function url_to_options_urlToOptions(url) { url = url; const options = { protocol: url.protocol, - hostname: dist.string(url.hostname) && url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname, + hostname: is_dist.string(url.hostname) && url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname, host: url.host, hash: url.hash, search: url.search, @@ -98419,7 +99716,7 @@ function url_to_options_urlToOptions(url) { href: url.href, path: `${url.pathname || ''}${url.search || ''}`, }; - if (dist.string(url.port) && url.port.length > 0) { + if (is_dist.string(url.port) && url.port.length > 0) { options.port = Number(url.port); } if (url.username || url.password) { @@ -98542,7 +99839,7 @@ function options_validateSearchParameters(searchParameters) { // eslint-disable-next-line guard-for-in for (const key in searchParameters) { const value = searchParameters[key]; - assert.any([dist.string, dist.number, dist.boolean, dist.null_, dist.undefined], value); + dist_assert.any([is_dist.string, is_dist.number, is_dist.boolean, is_dist.null_, is_dist.undefined], value); } } const options_globalCache = new Map(); @@ -98744,64 +100041,64 @@ const options_cloneInternals = (internals) => { const options_cloneRaw = (raw) => { const { hooks, retry } = raw; const result = { ...raw }; - if (dist.object(raw.context)) { + if (is_dist.object(raw.context)) { result.context = { ...raw.context }; } - if (dist.object(raw.cacheOptions)) { + if (is_dist.object(raw.cacheOptions)) { result.cacheOptions = { ...raw.cacheOptions }; } - if (dist.object(raw.https)) { + if (is_dist.object(raw.https)) { result.https = { ...raw.https }; } - if (dist.object(raw.cacheOptions)) { + if (is_dist.object(raw.cacheOptions)) { result.cacheOptions = { ...result.cacheOptions }; } - if (dist.object(raw.agent)) { + if (is_dist.object(raw.agent)) { result.agent = { ...raw.agent }; } - if (dist.object(raw.headers)) { + if (is_dist.object(raw.headers)) { result.headers = { ...raw.headers }; } - if (dist.object(retry)) { + if (is_dist.object(retry)) { result.retry = { ...retry }; - if (dist.array(retry.errorCodes)) { + if (is_dist.array(retry.errorCodes)) { result.retry.errorCodes = [...retry.errorCodes]; } - if (dist.array(retry.methods)) { + if (is_dist.array(retry.methods)) { result.retry.methods = [...retry.methods]; } - if (dist.array(retry.statusCodes)) { + if (is_dist.array(retry.statusCodes)) { result.retry.statusCodes = [...retry.statusCodes]; } } - if (dist.object(raw.timeout)) { + if (is_dist.object(raw.timeout)) { result.timeout = { ...raw.timeout }; } - if (dist.object(hooks)) { + if (is_dist.object(hooks)) { result.hooks = { ...hooks, }; - if (dist.array(hooks.init)) { + if (is_dist.array(hooks.init)) { result.hooks.init = [...hooks.init]; } - if (dist.array(hooks.beforeRequest)) { + if (is_dist.array(hooks.beforeRequest)) { result.hooks.beforeRequest = [...hooks.beforeRequest]; } - if (dist.array(hooks.beforeError)) { + if (is_dist.array(hooks.beforeError)) { result.hooks.beforeError = [...hooks.beforeError]; } - if (dist.array(hooks.beforeRedirect)) { + if (is_dist.array(hooks.beforeRedirect)) { result.hooks.beforeRedirect = [...hooks.beforeRedirect]; } - if (dist.array(hooks.beforeRetry)) { + if (is_dist.array(hooks.beforeRetry)) { result.hooks.beforeRetry = [...hooks.beforeRetry]; } - if (dist.array(hooks.afterResponse)) { + if (is_dist.array(hooks.afterResponse)) { result.hooks.afterResponse = [...hooks.afterResponse]; } } // TODO: raw.searchParams - if (dist.object(raw.pagination)) { + if (is_dist.object(raw.pagination)) { result.pagination = { ...raw.pagination }; } return result; @@ -98827,9 +100124,9 @@ class options_Options { _merging; _init; constructor(input, options, defaults) { - assert.any([dist.string, dist.urlInstance, dist.object, dist.undefined], input); - assert.any([dist.object, dist.undefined], options); - assert.any([dist.object, dist.undefined], defaults); + dist_assert.any([is_dist.string, is_dist.urlInstance, is_dist.object, is_dist.undefined], input); + dist_assert.any([is_dist.object, is_dist.undefined], options); + dist_assert.any([is_dist.object, is_dist.undefined], defaults); if (input instanceof options_Options || options instanceof options_Options) { throw new TypeError('The defaults must be passed as the third argument'); } @@ -98847,7 +100144,7 @@ class options_Options { // /* eslint-disable no-unsafe-finally */ try { - if (dist.plainObject(input)) { + if (is_dist.plainObject(input)) { try { this.merge(input); this.merge(options); @@ -98940,7 +100237,7 @@ class options_Options { return this._internals.request; } set request(value) { - assert.any([dist.function_, dist.undefined], value); + dist_assert.any([is_dist.function_, is_dist.undefined], value); this._internals.request = value; } /** @@ -98969,14 +100266,14 @@ class options_Options { return this._internals.agent; } set agent(value) { - assert.plainObject(value); + dist_assert.plainObject(value); // eslint-disable-next-line guard-for-in for (const key in value) { if (!(key in this._internals.agent)) { throw new TypeError(`Unexpected agent option: ${key}`); } // @ts-expect-error - No idea why `value[key]` doesn't work here. - assert.any([dist.object, dist.undefined], value[key]); + dist_assert.any([is_dist.object, is_dist.undefined], value[key]); } if (this._merging) { Object.assign(this._internals.agent, value); @@ -99005,7 +100302,7 @@ class options_Options { return this._internals.decompress; } set decompress(value) { - assert.boolean(value); + dist_assert.boolean(value); this._internals.decompress = value; } /** @@ -99029,14 +100326,14 @@ class options_Options { return this._internals.timeout; } set timeout(value) { - assert.plainObject(value); + dist_assert.plainObject(value); // eslint-disable-next-line guard-for-in for (const key in value) { if (!(key in this._internals.timeout)) { throw new Error(`Unexpected timeout option: ${key}`); } // @ts-expect-error - No idea why `value[key]` doesn't work here. - assert.any([dist.number, dist.undefined], value[key]); + dist_assert.any([is_dist.number, is_dist.undefined], value[key]); } if (this._merging) { Object.assign(this._internals.timeout, value); @@ -99090,7 +100387,7 @@ class options_Options { return this._internals.prefixUrl; } set prefixUrl(value) { - assert.any([dist.string, dist.urlInstance], value); + dist_assert.any([is_dist.string, is_dist.urlInstance], value); if (value === '') { this._internals.prefixUrl = ''; return; @@ -99122,13 +100419,13 @@ class options_Options { return this._internals.body; } set body(value) { - assert.any([dist.string, dist.buffer, dist.nodeStream, dist.generator, dist.asyncGenerator, lib_isFormData, dist.undefined], value); - if (dist.nodeStream(value)) { - assert.truthy(value.readable); + dist_assert.any([is_dist.string, is_dist.buffer, is_dist.nodeStream, is_dist.generator, is_dist.asyncGenerator, lib_isFormData, is_dist.undefined], value); + if (is_dist.nodeStream(value)) { + dist_assert.truthy(value.readable); } if (value !== undefined) { - assert.undefined(this._internals.form); - assert.undefined(this._internals.json); + dist_assert.undefined(this._internals.form); + dist_assert.undefined(this._internals.json); } this._internals.body = value; } @@ -99145,10 +100442,10 @@ class options_Options { return this._internals.form; } set form(value) { - assert.any([dist.plainObject, dist.undefined], value); + dist_assert.any([is_dist.plainObject, is_dist.undefined], value); if (value !== undefined) { - assert.undefined(this._internals.body); - assert.undefined(this._internals.json); + dist_assert.undefined(this._internals.body); + dist_assert.undefined(this._internals.json); } this._internals.form = value; } @@ -99164,8 +100461,8 @@ class options_Options { } set json(value) { if (value !== undefined) { - assert.undefined(this._internals.body); - assert.undefined(this._internals.form); + dist_assert.undefined(this._internals.body); + dist_assert.undefined(this._internals.form); } this._internals.json = value; } @@ -99191,12 +100488,12 @@ class options_Options { return this._internals.url; } set url(value) { - assert.any([dist.string, dist.urlInstance, dist.undefined], value); + dist_assert.any([is_dist.string, is_dist.urlInstance, is_dist.undefined], value); if (value === undefined) { this._internals.url = undefined; return; } - if (dist.string(value) && value.startsWith('/')) { + if (is_dist.string(value) && value.startsWith('/')) { throw new Error('`url` must not start with a slash'); } const urlString = `${this.prefixUrl}${value.toString()}`; @@ -99251,14 +100548,14 @@ class options_Options { return this._internals.cookieJar; } set cookieJar(value) { - assert.any([dist.object, dist.undefined], value); + dist_assert.any([is_dist.object, is_dist.undefined], value); if (value === undefined) { this._internals.cookieJar = undefined; return; } let { setCookie, getCookieString } = value; - assert.function_(setCookie); - assert.function_(getCookieString); + dist_assert.function_(setCookie); + dist_assert.function_(getCookieString); /* istanbul ignore next: Horrible `tough-cookie` v3 check */ if (setCookie.length === 4 && getCookieString.length === 0) { setCookie = (0,external_node_util_.promisify)(setCookie.bind(value)); @@ -99294,7 +100591,7 @@ class options_Options { return this._internals.signal; } set signal(value) { - assert.object(value); + dist_assert.object(value); this._internals.signal = value; } /** @@ -99307,7 +100604,7 @@ class options_Options { return this._internals.ignoreInvalidCookies; } set ignoreInvalidCookies(value) { - assert.boolean(value); + dist_assert.boolean(value); this._internals.ignoreInvalidCookies = value; } /** @@ -99338,7 +100635,7 @@ class options_Options { return this._internals.searchParams; } set searchParams(value) { - assert.any([dist.string, dist.object, dist.undefined], value); + dist_assert.any([is_dist.string, is_dist.object, is_dist.undefined], value); const url = this._internals.url; if (value === undefined) { this._internals.searchParams = undefined; @@ -99349,7 +100646,7 @@ class options_Options { } const searchParameters = this.searchParams; let updated; - if (dist.string(value)) { + if (is_dist.string(value)) { updated = new URLSearchParams(value); } else if (value instanceof URLSearchParams) { @@ -99398,7 +100695,7 @@ class options_Options { return this._internals.dnsLookup; } set dnsLookup(value) { - assert.any([dist.function_, dist.undefined], value); + dist_assert.any([is_dist.function_, is_dist.undefined], value); this._internals.dnsLookup = value; } /** @@ -99415,7 +100712,7 @@ class options_Options { return this._internals.dnsCache; } set dnsCache(value) { - assert.any([dist.object, dist.boolean, dist.undefined], value); + dist_assert.any([is_dist.object, is_dist.boolean, is_dist.undefined], value); if (value === true) { this._internals.dnsCache = options_getGlobalDnsCache(); } @@ -99461,7 +100758,7 @@ class options_Options { return this._internals.context; } set context(value) { - assert.object(value); + dist_assert.object(value); if (this._merging) { Object.assign(this._internals.context, value); } @@ -99477,7 +100774,7 @@ class options_Options { return this._internals.hooks; } set hooks(value) { - assert.object(value); + dist_assert.object(value); // eslint-disable-next-line guard-for-in for (const knownHookEvent in value) { if (!(knownHookEvent in this._internals.hooks)) { @@ -99485,10 +100782,10 @@ class options_Options { } const typedKnownHookEvent = knownHookEvent; const hooks = value[typedKnownHookEvent]; - assert.any([dist.array, dist.undefined], hooks); + dist_assert.any([is_dist.array, is_dist.undefined], hooks); if (hooks) { for (const hook of hooks) { - assert.function_(hook); + dist_assert.function_(hook); } } if (this._merging) { @@ -99520,7 +100817,7 @@ class options_Options { return this._internals.followRedirect; } set followRedirect(value) { - assert.any([dist.boolean, dist.function_], value); + dist_assert.any([is_dist.boolean, is_dist.function_], value); this._internals.followRedirect = value; } get followRedirects() { @@ -99538,7 +100835,7 @@ class options_Options { return this._internals.maxRedirects; } set maxRedirects(value) { - assert.number(value); + dist_assert.number(value); this._internals.maxRedirects = value; } /** @@ -99550,7 +100847,7 @@ class options_Options { return this._internals.cache; } set cache(value) { - assert.any([dist.object, dist.string, dist.boolean, dist.undefined], value); + dist_assert.any([is_dist.object, is_dist.string, is_dist.boolean, is_dist.undefined], value); if (value === true) { this._internals.cache = options_globalCache; } @@ -99573,7 +100870,7 @@ class options_Options { return this._internals.throwHttpErrors; } set throwHttpErrors(value) { - assert.boolean(value); + dist_assert.boolean(value); this._internals.throwHttpErrors = value; } get username() { @@ -99582,7 +100879,7 @@ class options_Options { return decodeURIComponent(value); } set username(value) { - assert.string(value); + dist_assert.string(value); const url = this._internals.url; const fixedValue = encodeURIComponent(value); if (url) { @@ -99598,7 +100895,7 @@ class options_Options { return decodeURIComponent(value); } set password(value) { - assert.string(value); + dist_assert.string(value); const url = this._internals.url; const fixedValue = encodeURIComponent(value); if (url) { @@ -99633,7 +100930,7 @@ class options_Options { return this._internals.http2; } set http2(value) { - assert.boolean(value); + dist_assert.boolean(value); this._internals.http2 = value; } /** @@ -99649,7 +100946,7 @@ class options_Options { return this._internals.allowGetBody; } set allowGetBody(value) { - assert.boolean(value); + dist_assert.boolean(value); this._internals.allowGetBody = value; } /** @@ -99663,7 +100960,7 @@ class options_Options { return this._internals.headers; } set headers(value) { - assert.plainObject(value); + dist_assert.plainObject(value); if (this._merging) { Object.assign(this._internals.headers, lowercaseKeys(value)); } @@ -99685,7 +100982,7 @@ class options_Options { return this._internals.methodRewriting; } set methodRewriting(value) { - assert.boolean(value); + dist_assert.boolean(value); this._internals.methodRewriting = value; } /** @@ -99726,7 +101023,7 @@ class options_Options { return this._internals.parseJson; } set parseJson(value) { - assert.function_(value); + dist_assert.function_(value); this._internals.parseJson = value; } /** @@ -99774,7 +101071,7 @@ class options_Options { return this._internals.stringifyJson; } set stringifyJson(value) { - assert.function_(value); + dist_assert.function_(value); this._internals.stringifyJson = value; } /** @@ -99803,14 +101100,14 @@ class options_Options { return this._internals.retry; } set retry(value) { - assert.plainObject(value); - assert.any([dist.function_, dist.undefined], value.calculateDelay); - assert.any([dist.number, dist.undefined], value.maxRetryAfter); - assert.any([dist.number, dist.undefined], value.limit); - assert.any([dist.array, dist.undefined], value.methods); - assert.any([dist.array, dist.undefined], value.statusCodes); - assert.any([dist.array, dist.undefined], value.errorCodes); - assert.any([dist.number, dist.undefined], value.noise); + dist_assert.plainObject(value); + dist_assert.any([is_dist.function_, is_dist.undefined], value.calculateDelay); + dist_assert.any([is_dist.number, is_dist.undefined], value.maxRetryAfter); + dist_assert.any([is_dist.number, is_dist.undefined], value.limit); + dist_assert.any([is_dist.array, is_dist.undefined], value.methods); + dist_assert.any([is_dist.array, is_dist.undefined], value.statusCodes); + dist_assert.any([is_dist.array, is_dist.undefined], value.errorCodes); + dist_assert.any([is_dist.number, is_dist.undefined], value.noise); if (value.noise && Math.abs(value.noise) > 100) { throw new Error(`The maximum acceptable retry noise is +/- 100ms, got ${value.noise}`); } @@ -99839,7 +101136,7 @@ class options_Options { return this._internals.localAddress; } set localAddress(value) { - assert.any([dist.string, dist.undefined], value); + dist_assert.any([is_dist.string, is_dist.undefined], value); this._internals.localAddress = value; } /** @@ -99851,14 +101148,14 @@ class options_Options { return this._internals.method; } set method(value) { - assert.string(value); + dist_assert.string(value); this._internals.method = value.toUpperCase(); } get createConnection() { return this._internals.createConnection; } set createConnection(value) { - assert.any([dist.function_, dist.undefined], value); + dist_assert.any([is_dist.function_, is_dist.undefined], value); this._internals.createConnection = value; } /** @@ -99870,11 +101167,11 @@ class options_Options { return this._internals.cacheOptions; } set cacheOptions(value) { - assert.plainObject(value); - assert.any([dist.boolean, dist.undefined], value.shared); - assert.any([dist.number, dist.undefined], value.cacheHeuristic); - assert.any([dist.number, dist.undefined], value.immutableMinTimeToLive); - assert.any([dist.boolean, dist.undefined], value.ignoreCargoCult); + dist_assert.plainObject(value); + dist_assert.any([is_dist.boolean, is_dist.undefined], value.shared); + dist_assert.any([is_dist.number, is_dist.undefined], value.cacheHeuristic); + dist_assert.any([is_dist.number, is_dist.undefined], value.immutableMinTimeToLive); + dist_assert.any([is_dist.boolean, is_dist.undefined], value.ignoreCargoCult); for (const key in value) { if (!(key in this._internals.cacheOptions)) { throw new Error(`Cache option \`${key}\` does not exist`); @@ -99894,24 +101191,24 @@ class options_Options { return this._internals.https; } set https(value) { - assert.plainObject(value); - assert.any([dist.boolean, dist.undefined], value.rejectUnauthorized); - assert.any([dist.function_, dist.undefined], value.checkServerIdentity); - assert.any([dist.string, dist.object, dist.array, dist.undefined], value.certificateAuthority); - assert.any([dist.string, dist.object, dist.array, dist.undefined], value.key); - assert.any([dist.string, dist.object, dist.array, dist.undefined], value.certificate); - assert.any([dist.string, dist.undefined], value.passphrase); - assert.any([dist.string, dist.buffer, dist.array, dist.undefined], value.pfx); - assert.any([dist.array, dist.undefined], value.alpnProtocols); - assert.any([dist.string, dist.undefined], value.ciphers); - assert.any([dist.string, dist.buffer, dist.undefined], value.dhparam); - assert.any([dist.string, dist.undefined], value.signatureAlgorithms); - assert.any([dist.string, dist.undefined], value.minVersion); - assert.any([dist.string, dist.undefined], value.maxVersion); - assert.any([dist.boolean, dist.undefined], value.honorCipherOrder); - assert.any([dist.number, dist.undefined], value.tlsSessionLifetime); - assert.any([dist.string, dist.undefined], value.ecdhCurve); - assert.any([dist.string, dist.buffer, dist.array, dist.undefined], value.certificateRevocationLists); + dist_assert.plainObject(value); + dist_assert.any([is_dist.boolean, is_dist.undefined], value.rejectUnauthorized); + dist_assert.any([is_dist.function_, is_dist.undefined], value.checkServerIdentity); + dist_assert.any([is_dist.string, is_dist.object, is_dist.array, is_dist.undefined], value.certificateAuthority); + dist_assert.any([is_dist.string, is_dist.object, is_dist.array, is_dist.undefined], value.key); + dist_assert.any([is_dist.string, is_dist.object, is_dist.array, is_dist.undefined], value.certificate); + dist_assert.any([is_dist.string, is_dist.undefined], value.passphrase); + dist_assert.any([is_dist.string, is_dist.buffer, is_dist.array, is_dist.undefined], value.pfx); + dist_assert.any([is_dist.array, is_dist.undefined], value.alpnProtocols); + dist_assert.any([is_dist.string, is_dist.undefined], value.ciphers); + dist_assert.any([is_dist.string, is_dist.buffer, is_dist.undefined], value.dhparam); + dist_assert.any([is_dist.string, is_dist.undefined], value.signatureAlgorithms); + dist_assert.any([is_dist.string, is_dist.undefined], value.minVersion); + dist_assert.any([is_dist.string, is_dist.undefined], value.maxVersion); + dist_assert.any([is_dist.boolean, is_dist.undefined], value.honorCipherOrder); + dist_assert.any([is_dist.number, is_dist.undefined], value.tlsSessionLifetime); + dist_assert.any([is_dist.string, is_dist.undefined], value.ecdhCurve); + dist_assert.any([is_dist.string, is_dist.buffer, is_dist.array, is_dist.undefined], value.certificateRevocationLists); for (const key in value) { if (!(key in this._internals.https)) { throw new Error(`HTTPS option \`${key}\` does not exist`); @@ -99941,7 +101238,7 @@ class options_Options { if (value === null) { throw new TypeError('To get a Buffer, set `options.responseType` to `buffer` instead'); } - assert.any([dist.string, dist.undefined], value); + dist_assert.any([is_dist.string, is_dist.undefined], value); this._internals.encoding = value; } /** @@ -99953,7 +101250,7 @@ class options_Options { return this._internals.resolveBodyOnly; } set resolveBodyOnly(value) { - assert.boolean(value); + dist_assert.boolean(value); this._internals.resolveBodyOnly = value; } /** @@ -99966,7 +101263,7 @@ class options_Options { return this._internals.isStream; } set isStream(value) { - assert.boolean(value); + dist_assert.boolean(value); this._internals.isStream = value; } /** @@ -100016,7 +101313,7 @@ class options_Options { return this._internals.pagination; } set pagination(value) { - assert.object(value); + dist_assert.object(value); if (this._merging) { Object.assign(this._internals.pagination, value); } @@ -100034,21 +101331,21 @@ class options_Options { return this._internals.setHost; } set setHost(value) { - assert.boolean(value); + dist_assert.boolean(value); this._internals.setHost = value; } get maxHeaderSize() { return this._internals.maxHeaderSize; } set maxHeaderSize(value) { - assert.any([dist.number, dist.undefined], value); + dist_assert.any([is_dist.number, is_dist.undefined], value); this._internals.maxHeaderSize = value; } get enableUnixSockets() { return this._internals.enableUnixSockets; } set enableUnixSockets(value) { - assert.boolean(value); + dist_assert.boolean(value); this._internals.enableUnixSockets = value; } // eslint-disable-next-line @typescript-eslint/naming-convention @@ -100070,7 +101367,7 @@ class options_Options { } const { https } = internals; let { pfx } = https; - if (dist.array(pfx) && dist.plainObject(pfx[0])) { + if (is_dist.array(pfx) && is_dist.plainObject(pfx[0])) { pfx = pfx.map(object => ({ buf: object.buffer, passphrase: object.passphrase, @@ -100239,7 +101536,7 @@ function is_unix_socket_url_isUnixSocketURL(url) { -const core_supportsBrotli = dist.string(external_node_process_.versions.brotli); +const core_supportsBrotli = is_dist.string(external_node_process_.versions.brotli); const core_methodsWithoutBody = new Set(['GET', 'HEAD']); const core_cacheableStore = new weakable_map_WeakableMap(); const core_redirectCodes = new Set([300, 301, 302, 303, 304, 307, 308]); @@ -100337,7 +101634,7 @@ class core_Request extends external_node_stream_.Duplex { // Important! If you replace `body` in a handler with another stream, make sure it's readable first. // The below is run only once. const { body } = this.options; - if (dist.nodeStream(body)) { + if (is_dist.nodeStream(body)) { body.once('error', error => { if (this._flushed) { this._beforeError(new errors_UploadError(error, this)); @@ -100563,14 +101860,14 @@ class core_Request extends external_node_stream_.Duplex { this._removeListeners(); if (this.options) { const { body } = this.options; - if (dist.nodeStream(body)) { + if (is_dist.nodeStream(body)) { body.destroy(); } } if (this._request) { this._request.destroy(); } - if (error !== null && !dist.undefined(error) && !(error instanceof errors_RequestError)) { + if (error !== null && !is_dist.undefined(error) && !(error instanceof errors_RequestError)) { error = new errors_RequestError(error.message, error, this); } callback(error); @@ -100591,10 +101888,10 @@ class core_Request extends external_node_stream_.Duplex { async _finalizeBody() { const { options } = this; const { headers } = options; - const isForm = !dist.undefined(options.form); + const isForm = !is_dist.undefined(options.form); // eslint-disable-next-line @typescript-eslint/naming-convention - const isJSON = !dist.undefined(options.json); - const isBody = !dist.undefined(options.body); + const isJSON = !is_dist.undefined(options.json); + const isBody = !is_dist.undefined(options.body); const cannotHaveBody = core_methodsWithoutBody.has(options.method) && !(options.method === 'GET' && options.allowGetBody); this._cannotHaveBody = cannotHaveBody; if (isForm || isJSON || isBody) { @@ -100602,7 +101899,7 @@ class core_Request extends external_node_stream_.Duplex { throw new TypeError(`The \`${options.method}\` method cannot be used with a body`); } // Serialize body - const noContentType = !dist.string(headers['content-type']); + const noContentType = !is_dist.string(headers['content-type']); if (isBody) { // Body is spec-compliant FormData if (lib_isFormData(options.body)) { @@ -100646,7 +101943,7 @@ class core_Request extends external_node_stream_.Duplex { // Content-Length header field when the request message does not contain // a payload body and the method semantics do not anticipate such a // body. - if (dist.undefined(headers['content-length']) && dist.undefined(headers['transfer-encoding']) && !cannotHaveBody && !dist.undefined(uploadBodySize)) { + if (is_dist.undefined(headers['content-length']) && is_dist.undefined(headers['transfer-encoding']) && !cannotHaveBody && !is_dist.undefined(uploadBodySize)) { headers['content-length'] = String(uploadBodySize); } } @@ -100701,7 +101998,7 @@ class core_Request extends external_node_stream_.Duplex { }); this.emit('downloadProgress', this.downloadProgress); const rawCookies = response.headers['set-cookie']; - if (dist.object(options.cookieJar) && rawCookies) { + if (is_dist.object(options.cookieJar) && rawCookies) { let promises = rawCookies.map(async (rawCookie) => options.cookieJar.setCookie(rawCookie, url.toString())); if (options.ignoreInvalidCookies) { // eslint-disable-next-line @typescript-eslint/no-floating-promises @@ -100910,10 +102207,10 @@ class core_Request extends external_node_stream_.Duplex { // Send body const { body } = this.options; const currentRequest = this.redirectUrls.length === 0 ? this : this._request ?? this; - if (dist.nodeStream(body)) { + if (is_dist.nodeStream(body)) { body.pipe(currentRequest); } - else if (dist.generator(body) || dist.asyncGenerator(body)) { + else if (is_dist.generator(body) || is_dist.asyncGenerator(body)) { (async () => { try { for await (const chunk of body) { @@ -100926,7 +102223,7 @@ class core_Request extends external_node_stream_.Duplex { } })(); } - else if (!dist.undefined(body)) { + else if (!is_dist.undefined(body)) { this._writeRequest(body, undefined, () => { }); currentRequest.end(); } @@ -100936,10 +102233,10 @@ class core_Request extends external_node_stream_.Duplex { } _prepareCache(cache) { if (!core_cacheableStore.has(cache)) { - const cacheableRequest = new cacheable_request_dist(((requestOptions, handler) => { + const cacheableRequest = new dist(((requestOptions, handler) => { const result = requestOptions._request(requestOptions, handler); // TODO: remove this when `cacheable-request` supports async request functions. - if (dist.promise(result)) { + if (is_dist.promise(result)) { // We only need to implement the error handler in order to support HTTP2 caching. // The result will be a promise anyway. // @ts-expect-error ignore @@ -101009,15 +102306,15 @@ class core_Request extends external_node_stream_.Duplex { const { headers, username, password } = options; const cookieJar = options.cookieJar; for (const key in headers) { - if (dist.undefined(headers[key])) { + if (is_dist.undefined(headers[key])) { // eslint-disable-next-line @typescript-eslint/no-dynamic-delete delete headers[key]; } - else if (dist.null_(headers[key])) { + else if (is_dist.null_(headers[key])) { throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${key}\` header`); } } - if (options.decompress && dist.undefined(headers['accept-encoding'])) { + if (options.decompress && is_dist.undefined(headers['accept-encoding'])) { headers['accept-encoding'] = core_supportsBrotli ? 'gzip, deflate, br' : 'gzip, deflate'; } if (username || password) { @@ -101027,7 +102324,7 @@ class core_Request extends external_node_stream_.Duplex { // Set cookies if (cookieJar) { const cookieString = await cookieJar.getCookieString(options.url.toString()); - if (dist.nonEmptyString(cookieString)) { + if (is_dist.nonEmptyString(cookieString)) { headers.cookie = cookieString; } } @@ -101037,7 +102334,7 @@ class core_Request extends external_node_stream_.Duplex { for (const hook of options.hooks.beforeRequest) { // eslint-disable-next-line no-await-in-loop const result = await hook(options); - if (!dist.undefined(result)) { + if (!is_dist.undefined(result)) { // @ts-expect-error Skip the type mismatch to support abstract responses request = () => result; break; @@ -101058,13 +102355,13 @@ class core_Request extends external_node_stream_.Duplex { // We can't do `await fn(...)`, // because stream `error` event can be emitted before `Promise.resolve()`. let requestOrResponse = function_(url, this._requestOptions); - if (dist.promise(requestOrResponse)) { + if (is_dist.promise(requestOrResponse)) { requestOrResponse = await requestOrResponse; } // Fallback - if (dist.undefined(requestOrResponse)) { + if (is_dist.undefined(requestOrResponse)) { requestOrResponse = options.getFallbackRequestFunction()(url, this._requestOptions); - if (dist.promise(requestOrResponse)) { + if (is_dist.promise(requestOrResponse)) { requestOrResponse = await requestOrResponse; } } @@ -101320,7 +102617,7 @@ function as_promise_asPromise(firstRequest) { options.hooks.afterResponse = options.hooks.afterResponse.slice(0, index); throw new errors_RetryError(request); }); - if (!(dist.object(response) && dist.number(response.statusCode) && !dist.nullOrUndefined(response.body))) { + if (!(is_dist.object(response) && is_dist.number(response.statusCode) && !is_dist.nullOrUndefined(response.body))) { throw new TypeError('The `afterResponse` hook returned an invalid value'); } } @@ -101355,7 +102652,7 @@ function as_promise_asPromise(firstRequest) { request.once('retry', (newRetryCount, error) => { firstRequest = undefined; const newBody = request.options.body; - if (previousBody === newBody && dist.nodeStream(newBody)) { + if (previousBody === newBody && is_dist.nodeStream(newBody)) { error.message = 'Cannot retry with consumed body stream'; onError(error); return; @@ -101366,7 +102663,7 @@ function as_promise_asPromise(firstRequest) { makeRequest(newRetryCount); }); proxy_events_proxyEvents(request, emitter, source_as_promise_proxiedRequestEvents); - if (dist.undefined(firstRequest)) { + if (is_dist.undefined(firstRequest)) { void request.flush(); } }; @@ -101414,7 +102711,7 @@ function as_promise_asPromise(firstRequest) { const create_delay = async (ms) => new Promise(resolve => { setTimeout(resolve, ms); }); -const create_isGotInstance = (value) => dist.function_(value); +const create_isGotInstance = (value) => is_dist.function_(value); const create_aliases = [ 'get', 'post', @@ -101453,7 +102750,7 @@ const create_create = (defaults) => { const iterateHandlers = (newOptions) => { const handler = defaults.handlers[iteration++] ?? lastHandler; const result = handler(newOptions, iterateHandlers); - if (dist.promise(result) && !request.options.isStream) { + if (is_dist.promise(result) && !request.options.isStream) { promise ||= as_promise_asPromise(request); if (result !== promise) { const descriptors = Object.getOwnPropertyDescriptors(promise); @@ -101501,13 +102798,13 @@ const create_create = (defaults) => { let normalizedOptions = new options_Options(url, options, defaults.options); normalizedOptions.resolveBodyOnly = false; const { pagination } = normalizedOptions; - assert.function_(pagination.transform); - assert.function_(pagination.shouldContinue); - assert.function_(pagination.filter); - assert.function_(pagination.paginate); - assert.number(pagination.countLimit); - assert.number(pagination.requestLimit); - assert.number(pagination.backoff); + dist_assert.function_(pagination.transform); + dist_assert.function_(pagination.shouldContinue); + dist_assert.function_(pagination.filter); + dist_assert.function_(pagination.paginate); + dist_assert.number(pagination.countLimit); + dist_assert.number(pagination.requestLimit); + dist_assert.number(pagination.backoff); const allItems = []; let { countLimit } = pagination; let numberOfRequests = 0; @@ -101521,7 +102818,7 @@ const create_create = (defaults) => { // eslint-disable-next-line no-await-in-loop const parsed = await pagination.transform(response); const currentItems = []; - assert.array(parsed); + dist_assert.array(parsed); for (const item of parsed) { if (pagination.filter({ item, currentItems, allItems })) { if (!pagination.shouldContinue({ item, currentItems, allItems })) { @@ -101550,7 +102847,7 @@ const create_create = (defaults) => { } else { normalizedOptions.merge(optionsToMerge); - assert.any([dist.urlInstance, dist.undefined], optionsToMerge.url); + dist_assert.any([is_dist.urlInstance, is_dist.undefined], optionsToMerge.url); if (optionsToMerge.url !== undefined) { normalizedOptions.prefixUrl = ''; normalizedOptions.url = optionsToMerge.url; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ed76fbc..df093a0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,7 +16,7 @@ dependencies: version: 5.1.1 detsys-ts: specifier: github:DeterminateSystems/detsys-ts - version: github.com/DeterminateSystems/detsys-ts/dd1509475ee7fee37677b858b67aa96ef37a7531 + version: github.com/DeterminateSystems/detsys-ts/d353465ae6a55761963005617a7780f2bf7e4ec2 got: specifier: ^14.3.0 version: 14.3.0 @@ -36,7 +36,7 @@ devDependencies: version: 9.0.8 "@typescript-eslint/eslint-plugin": specifier: ^7.12.0 - version: 7.12.0(@typescript-eslint/parser@7.12.0)(eslint@8.57.0)(typescript@5.4.5) + version: 7.12.0(@typescript-eslint/parser@7.18.0)(eslint@8.57.0)(typescript@5.4.5) "@vercel/ncc": specifier: ^0.38.1 version: 0.38.1 @@ -45,13 +45,13 @@ devDependencies: version: 8.57.0 eslint-import-resolver-typescript: specifier: ^3.6.1 - version: 3.6.1(@typescript-eslint/parser@7.12.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) + version: 3.6.1(@typescript-eslint/parser@7.18.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) eslint-plugin-github: specifier: ^4.10.2 version: 4.10.2(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)(typescript@5.4.5) eslint-plugin-import: specifier: ^2.29.1 - version: 2.29.1(@typescript-eslint/parser@7.12.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + version: 2.29.1(@typescript-eslint/parser@7.18.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-prettier: specifier: ^5.1.3 version: 5.1.3(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.3.0) @@ -1270,6 +1270,14 @@ packages: engines: { node: ">=16" } dev: false + /@sindresorhus/is@7.0.0: + resolution: + { + integrity: sha512-WDTlVTyvFivSOuyvMeedzg2hdoBLZ3f1uNVuEida2Rl9BrfjrIRjWA/VZIrMRLvSwJYCAlCRA3usDt1THytxWQ==, + } + engines: { node: ">=18" } + dev: false + /@szmarczak/http-timer@5.0.1: resolution: { @@ -1388,6 +1396,36 @@ packages: - supports-color dev: true + /@typescript-eslint/eslint-plugin@7.12.0(@typescript-eslint/parser@7.18.0)(eslint@8.57.0)(typescript@5.4.5): + resolution: + { + integrity: sha512-7F91fcbuDf/d3S8o21+r3ZncGIke/+eWk0EpO21LXhDfLahriZF9CGj4fbAetEjlaBdjdSm9a6VeXbpbT6Z40Q==, + } + engines: { node: ^18.18.0 || >=20.0.0 } + peerDependencies: + "@typescript-eslint/parser": ^7.0.0 + eslint: ^8.56.0 + typescript: "*" + peerDependenciesMeta: + typescript: + optional: true + dependencies: + "@eslint-community/regexpp": 4.10.1 + "@typescript-eslint/parser": 7.18.0(eslint@8.57.0)(typescript@5.4.5) + "@typescript-eslint/scope-manager": 7.12.0 + "@typescript-eslint/type-utils": 7.12.0(eslint@8.57.0)(typescript@5.4.5) + "@typescript-eslint/utils": 7.12.0(eslint@8.57.0)(typescript@5.4.5) + "@typescript-eslint/visitor-keys": 7.12.0 + eslint: 8.57.0 + graphemer: 1.4.0 + ignore: 5.3.1 + natural-compare: 1.4.0 + ts-api-utils: 1.3.0(typescript@5.4.5) + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5): resolution: { @@ -1412,6 +1450,30 @@ packages: - supports-color dev: true + /@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.4.5): + resolution: + { + integrity: sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==, + } + engines: { node: ^18.18.0 || >=20.0.0 } + peerDependencies: + eslint: ^8.56.0 + typescript: "*" + peerDependenciesMeta: + typescript: + optional: true + dependencies: + "@typescript-eslint/scope-manager": 7.18.0 + "@typescript-eslint/types": 7.18.0 + "@typescript-eslint/typescript-estree": 7.18.0(typescript@5.4.5) + "@typescript-eslint/visitor-keys": 7.18.0 + debug: 4.3.6 + eslint: 8.57.0 + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/scope-manager@7.12.0: resolution: { @@ -1423,6 +1485,17 @@ packages: "@typescript-eslint/visitor-keys": 7.12.0 dev: true + /@typescript-eslint/scope-manager@7.18.0: + resolution: + { + integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==, + } + engines: { node: ^18.18.0 || >=20.0.0 } + dependencies: + "@typescript-eslint/types": 7.18.0 + "@typescript-eslint/visitor-keys": 7.18.0 + dev: true + /@typescript-eslint/type-utils@7.12.0(eslint@8.57.0)(typescript@5.4.5): resolution: { @@ -1454,6 +1527,14 @@ packages: engines: { node: ^18.18.0 || >=20.0.0 } dev: true + /@typescript-eslint/types@7.18.0: + resolution: + { + integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==, + } + engines: { node: ^18.18.0 || >=20.0.0 } + dev: true + /@typescript-eslint/typescript-estree@7.12.0(typescript@5.4.5): resolution: { @@ -1479,6 +1560,31 @@ packages: - supports-color dev: true + /@typescript-eslint/typescript-estree@7.18.0(typescript@5.4.5): + resolution: + { + integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==, + } + engines: { node: ^18.18.0 || >=20.0.0 } + peerDependencies: + typescript: "*" + peerDependenciesMeta: + typescript: + optional: true + dependencies: + "@typescript-eslint/types": 7.18.0 + "@typescript-eslint/visitor-keys": 7.18.0 + debug: 4.3.6 + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.6.3 + ts-api-utils: 1.3.0(typescript@5.4.5) + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/utils@7.12.0(eslint@8.57.0)(typescript@5.4.5): resolution: { @@ -1509,6 +1615,17 @@ packages: eslint-visitor-keys: 3.4.3 dev: true + /@typescript-eslint/visitor-keys@7.18.0: + resolution: + { + integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==, + } + engines: { node: ^18.18.0 || >=20.0.0 } + dependencies: + "@typescript-eslint/types": 7.18.0 + eslint-visitor-keys: 3.4.3 + dev: true + /@ungap/structured-clone@1.2.0: resolution: { @@ -2096,6 +2213,21 @@ packages: ms: 2.1.2 dev: true + /debug@4.3.6: + resolution: + { + integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==, + } + engines: { node: ">=6.0" } + peerDependencies: + supports-color: "*" + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + dev: true + /decompress-response@6.0.0: resolution: { @@ -2459,7 +2591,7 @@ packages: - supports-color dev: true - /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.12.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0): + /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.18.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0): resolution: { integrity: sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==, @@ -2472,8 +2604,8 @@ packages: debug: 4.3.5 enhanced-resolve: 5.16.1 eslint: 8.57.0 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.12.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.12.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.18.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.18.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) fast-glob: 3.3.2 get-tsconfig: 4.7.5 is-core-module: 2.13.1 @@ -2513,7 +2645,40 @@ packages: debug: 3.2.7 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.12.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.18.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-module-utils@2.8.1(@typescript-eslint/parser@7.18.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): + resolution: + { + integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==, + } + engines: { node: ">=4" } + peerDependencies: + "@typescript-eslint/parser": "*" + eslint: "*" + eslint-import-resolver-node: "*" + eslint-import-resolver-typescript: "*" + eslint-import-resolver-webpack: "*" + peerDependenciesMeta: + "@typescript-eslint/parser": + optional: true + eslint: + optional: true + eslint-import-resolver-node: + optional: true + eslint-import-resolver-typescript: + optional: true + eslint-import-resolver-webpack: + optional: true + dependencies: + "@typescript-eslint/parser": 7.18.0(eslint@8.57.0)(typescript@5.4.5) + debug: 3.2.7 + eslint: 8.57.0 + eslint-import-resolver-node: 0.3.9 + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.18.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) transitivePeerDependencies: - supports-color dev: true @@ -2643,6 +2808,44 @@ packages: - supports-color dev: true + /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.18.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): + resolution: + { + integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==, + } + engines: { node: ">=4" } + peerDependencies: + "@typescript-eslint/parser": "*" + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + peerDependenciesMeta: + "@typescript-eslint/parser": + optional: true + dependencies: + "@typescript-eslint/parser": 7.18.0(eslint@8.57.0)(typescript@5.4.5) + array-includes: 3.1.8 + array.prototype.findlastindex: 1.2.5 + array.prototype.flat: 1.3.2 + array.prototype.flatmap: 1.3.2 + debug: 3.2.7 + doctrine: 2.1.0 + eslint: 8.57.0 + eslint-import-resolver-node: 0.3.9 + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.18.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + hasown: 2.0.2 + is-core-module: 2.13.1 + is-glob: 4.0.3 + minimatch: 3.1.2 + object.fromentries: 2.0.8 + object.groupby: 1.0.3 + object.values: 1.2.0 + semver: 6.3.1 + tsconfig-paths: 3.15.0 + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + dev: true + /eslint-plugin-jsx-a11y@6.8.0(eslint@8.57.0): resolution: { @@ -3245,24 +3448,24 @@ packages: responselike: 3.0.0 dev: false - /got@14.4.0: + /got@14.4.2: resolution: { - integrity: sha512-baa2HMfREJ9UQSXOPwWe0DNK+FT8Okcxe9kmTJvaetv2q/MUxq0qFzEnfSbxo+wj45/QioGcH5ZhuT9VBIPJ5Q==, + integrity: sha512-+Te/qEZ6hr7i+f0FNgXx/6WQteSM/QqueGvxeYQQFm0GDfoxLVJ/oiwUKYMTeioColWUTdewZ06hmrBjw6F7tw==, } engines: { node: ">=20" } dependencies: - "@sindresorhus/is": 6.3.1 + "@sindresorhus/is": 7.0.0 "@szmarczak/http-timer": 5.0.1 cacheable-lookup: 7.0.0 cacheable-request: 12.0.1 decompress-response: 6.0.0 form-data-encoder: 4.0.2 - get-stream: 8.0.1 http2-wrapper: 2.2.1 lowercase-keys: 3.0.0 p-cancelable: 4.0.1 responselike: 3.0.0 + type-fest: 4.23.0 dev: false /graceful-fs@4.2.11: @@ -4059,6 +4262,16 @@ packages: brace-expansion: 2.0.1 dev: true + /minimatch@9.0.5: + resolution: + { + integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==, + } + engines: { node: ">=16 || 14 >=14.17" } + dependencies: + brace-expansion: 2.0.1 + dev: true + /minimist@1.2.8: resolution: { @@ -4671,6 +4884,15 @@ packages: hasBin: true dev: true + /semver@7.6.3: + resolution: + { + integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==, + } + engines: { node: ">=10" } + hasBin: true + dev: true + /set-function-length@1.2.2: resolution: { @@ -5134,10 +5356,10 @@ packages: engines: { node: ">=10" } dev: true - /type-fest@4.19.0: + /type-fest@4.23.0: resolution: { - integrity: sha512-CN2l+hWACRiejlnr68vY0/7734Kzu+9+TOslUXbSCQ1ruY9XIHDBSceVXCcHm/oXrdzhtLMMdJEKfemf1yXiZQ==, + integrity: sha512-ZiBujro2ohr5+Z/hZWHESLz3g08BBdrdLMieYFULJO+tWc437sn8kQsWLJoZErY8alNhxre9K4p3GURAG11n+w==, } engines: { node: ">=16" } dev: false @@ -5463,10 +5685,10 @@ packages: engines: { node: ">=10" } dev: true - github.com/DeterminateSystems/detsys-ts/dd1509475ee7fee37677b858b67aa96ef37a7531: + github.com/DeterminateSystems/detsys-ts/d353465ae6a55761963005617a7780f2bf7e4ec2: resolution: { - tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/dd1509475ee7fee37677b858b67aa96ef37a7531, + tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/d353465ae6a55761963005617a7780f2bf7e4ec2, } name: detsys-ts version: 1.0.0 @@ -5474,8 +5696,8 @@ packages: "@actions/cache": 3.2.4 "@actions/core": 1.10.1 "@actions/exec": 1.1.1 - got: 14.4.0 - type-fest: 4.19.0 + got: 14.4.2 + type-fest: 4.23.0 transitivePeerDependencies: - encoding dev: false