From eda2c60805bbfd13bb097e5c28216d041a8809dd Mon Sep 17 00:00:00 2001 From: grahamc <76716+grahamc@users.noreply.github.com> Date: Thu, 10 Oct 2024 15:16:12 +0000 Subject: [PATCH] Update `detsys-ts` for: `Merge pull request #65 from DeterminateSystems/dependabot/npm_and_yarn/npm_and_yarn-cc3f4627d0` (`18dff575ee06557065bdbc22c099c05606a4285c`) --- dist/index.js | 983 +++++++++++++++++++++++-------------------------- pnpm-lock.yaml | 130 ++++--- 2 files changed, 535 insertions(+), 578 deletions(-) diff --git a/dist/index.js b/dist/index.js index c3b61ea..266bd02 100644 --- a/dist/index.js +++ b/dist/index.js @@ -86331,9 +86331,15 @@ var external_node_os_ = __nccwpck_require__(612); var external_node_util_ = __nccwpck_require__(7261); // EXTERNAL MODULE: external "os" var external_os_ = __nccwpck_require__(2037); +;// CONCATENATED MODULE: external "node:fs/promises" +const promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs/promises"); +;// CONCATENATED MODULE: external "node:zlib" +const external_node_zlib_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:zlib"); ;// 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: external "node:timers/promises" +const external_node_timers_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:timers/promises"); +;// CONCATENATED MODULE: ./node_modules/.pnpm/@sindresorhus+is@7.0.1/node_modules/@sindresorhus/is/distribution/index.js const typedArrayTypeNames = [ 'Int8Array', 'Uint8Array', @@ -86519,14 +86525,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, @@ -86541,8 +86543,6 @@ const is = Object.assign(detect, { float64Array: isFloat64Array, formData: isFormData, function: isFunction, - /** @deprecated Renamed to `function`. */ - function_: isFunction, generator: isGenerator, generatorFunction: isGeneratorFunction, htmlElement: isHtmlElement, @@ -86565,8 +86565,6 @@ const is = Object.assign(detect, { nonEmptyString: isNonEmptyString, nonEmptyStringAndNotWhitespace: isNonEmptyStringAndNotWhitespace, null: isNull, - /** @deprecated Renamed to `null`. */ - null_: isNull, nullOrUndefined: isNullOrUndefined, number: isNumber, numericString: isNumericString, @@ -86602,7 +86600,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) { @@ -86657,8 +86655,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; @@ -86704,7 +86705,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) { @@ -86843,7 +86844,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 @@ -86943,7 +86944,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'; } @@ -86995,11 +86996,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, @@ -87014,7 +87013,6 @@ const assert = { float64Array: assertFloat64Array, formData: assertFormData, function: assertFunction, - function_: assertFunction, generator: assertGenerator, generatorFunction: assertGeneratorFunction, htmlElement: assertHtmlElement, @@ -87037,7 +87035,6 @@ const assert = { nonEmptyString: assertNonEmptyString, nonEmptyStringAndNotWhitespace: assertNonEmptyStringAndNotWhitespace, null: assertNull, - null_: assertNull, nullOrUndefined: assertNullOrUndefined, number: assertNumber, numericString: assertNumericString, @@ -87092,8 +87089,6 @@ const methodTypeMap = { isDataView: 'DataView', isDate: 'Date', isDirectInstanceOf: 'T', - /** @deprecated */ - isDomElement: 'HTMLElement', isEmptyArray: 'empty array', isEmptyMap: 'empty map', isEmptyObject: 'empty object', @@ -87190,8 +87185,10 @@ function assertArray(value, assertion, message) { throw new TypeError(message ?? typeErrorMessage('Array', value)); } if (assertion) { - // eslint-disable-next-line unicorn/no-array-for-each, unicorn/no-array-callback-reference - value.forEach(assertion); + for (const element of value) { + // @ts-expect-error: "Assertions require every name in the call target to be declared with an explicit type annotation." + assertion(element, message); + } } } function assertArrayBuffer(value, message) { @@ -87256,6 +87253,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)); @@ -87622,7 +87622,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)); @@ -87639,7 +87639,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); @@ -87764,11 +87764,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.3/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. @@ -87803,7 +87803,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(); @@ -88519,7 +88519,7 @@ const nodeImports = {}; ;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/contents.js -const contents_getStreamContents = async (stream, {init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize}, {maxBuffer = Number.POSITIVE_INFINITY} = {}) => { +const getStreamContents = async (stream, {init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize}, {maxBuffer = Number.POSITIVE_INFINITY} = {}) => { const asyncIterable = getAsyncIterable(stream); const state = init(); @@ -88657,7 +88657,7 @@ const getLengthProperty = convertedChunk => convertedChunk.length; async function getStreamAsArrayBuffer(stream, options) { - return contents_getStreamContents(stream, arrayBufferMethods, options); + return getStreamContents(stream, arrayBufferMethods, options); } const initArrayBuffer = () => ({contents: new ArrayBuffer(0)}); @@ -89182,315 +89182,12 @@ 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; - } -}; - -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); -} - -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; - } -} - -// 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/form-data-encoder@4.0.2/node_modules/form-data-encoder/lib/index.js var __accessCheck = (obj, member, msg) => { if (!member.has(obj)) @@ -89854,13 +89551,13 @@ getContentLength_fn = function() { }; -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/utils/is-form-data.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.3/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); + return distribution.nodeStream(body) && distribution["function"](body.getBoundary); } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/utils/get-body-size.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.3/node_modules/got/dist/source/core/utils/get-body-size.js @@ -89872,10 +89569,10 @@ async function getBodySize(body, headers) { if (!body) { return 0; } - if (dist.string(body)) { + if (distribution.string(body)) { return external_node_buffer_namespaceObject.Buffer.byteLength(body); } - if (dist.buffer(body)) { + if (distribution.buffer(body)) { return body.length; } if (is_form_data_isFormData(body)) { @@ -89884,7 +89581,7 @@ async function getBodySize(body, headers) { return undefined; } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/utils/proxy-events.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.3/node_modules/got/dist/source/core/utils/proxy-events.js function proxyEvents(from, to, events) { const eventFunctions = {}; for (const event of events) { @@ -89903,7 +89600,7 @@ function proxyEvents(from, to, events) { ;// 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 +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.3/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, @@ -89925,7 +89622,7 @@ function unhandle() { }; } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/timed-out.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.3/node_modules/got/dist/source/core/timed-out.js const reentry = Symbol('reentry'); @@ -90056,14 +89753,14 @@ function timedOut(request, delays, options) { return cancelTimeouts; } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/utils/url-to-options.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.3/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, + hostname: distribution.string(url.hostname) && url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname, host: url.host, hash: url.hash, search: url.search, @@ -90071,7 +89768,7 @@ function urlToOptions(url) { href: url.href, path: `${url.pathname || ''}${url.search || ''}`, }; - if (dist.string(url.port) && url.port.length > 0) { + if (distribution.string(url.port) && url.port.length > 0) { options.port = Number(url.port); } if (url.username || url.password) { @@ -90080,7 +89777,7 @@ function urlToOptions(url) { return options; } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/utils/weakable-map.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.3/node_modules/got/dist/source/core/utils/weakable-map.js class WeakableMap { weakMap; map; @@ -90110,7 +89807,7 @@ class WeakableMap { } } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.0/node_modules/got/dist/source/core/calculate-retry-delay.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.4.3/node_modules/got/dist/source/core/calculate-retry-delay.js const calculateRetryDelay = ({ attemptCount, retryOptions, error, retryAfter, computedValue, }) => { if (error.name === 'RetryError') { return 1; @@ -90597,7 +90294,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.3/node_modules/got/dist/source/core/parse-link-header.js function parseLinkHeader(link) { const parsed = []; const items = link.split(','); @@ -90632,7 +90329,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.3/node_modules/got/dist/source/core/options.js @@ -90650,7 +90347,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(); @@ -90852,64 +90549,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; @@ -90935,9 +90632,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'); } @@ -90955,7 +90652,7 @@ class Options { // /* eslint-disable no-unsafe-finally */ try { - if (dist.plainObject(input)) { + if (distribution.plainObject(input)) { try { this.merge(input); this.merge(options); @@ -91048,7 +90745,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; } /** @@ -91084,7 +90781,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); @@ -91144,7 +90841,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); @@ -91198,7 +90895,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; @@ -91230,8 +90927,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) { @@ -91253,7 +90950,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); @@ -91299,12 +90996,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()}`; @@ -91359,14 +91056,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)); @@ -91446,7 +91143,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; @@ -91457,7 +91154,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) { @@ -91506,7 +91203,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; } /** @@ -91523,7 +91220,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(); } @@ -91593,10 +91290,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) { @@ -91628,7 +91325,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() { @@ -91658,7 +91355,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; } @@ -91834,7 +91531,7 @@ class Options { return this._internals.parseJson; } set parseJson(value) { - assert.function_(value); + assert["function"](value); this._internals.parseJson = value; } /** @@ -91882,7 +91579,7 @@ class Options { return this._internals.stringifyJson; } set stringifyJson(value) { - assert.function_(value); + assert["function"](value); this._internals.stringifyJson = value; } /** @@ -91912,13 +91609,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}`); } @@ -91947,7 +91644,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; } /** @@ -91966,7 +91663,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; } /** @@ -91979,10 +91676,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`); @@ -92003,23 +91700,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`); @@ -92049,7 +91746,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; } /** @@ -92149,7 +91846,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() { @@ -92178,7 +91875,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, @@ -92269,7 +91966,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.3/node_modules/got/dist/source/core/response.js const isResponseOk = (response) => { const { statusCode } = response; @@ -92312,19 +92009,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.3/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.3/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.3/node_modules/got/dist/source/core/index.js @@ -92346,8 +92043,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]); @@ -92445,7 +92141,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)); @@ -92671,14 +92367,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); @@ -92699,10 +92395,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) { @@ -92710,7 +92406,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)) { @@ -92754,7 +92450,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); } } @@ -92809,7 +92505,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 @@ -92954,10 +92650,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) { @@ -93018,10 +92712,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) { @@ -93034,7 +92728,7 @@ class Request extends external_node_stream_.Duplex { } })(); } - else if (!dist.undefined(body)) { + else if (!distribution.undefined(body)) { this._writeRequest(body, undefined, () => { }); currentRequest.end(); } @@ -93044,10 +92738,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 @@ -93062,13 +92756,13 @@ class Request extends external_node_stream_.Duplex { } })(); } - else if (event === 'abort') { + else if (event === 'abort' || event === 'destroy') { // The empty catch is needed here in case when // it rejects before it's `await`ed in `_makeRequest`. (async () => { try { const request = (await result); - request.once('abort', handler); + request.once(event, handler); } catch { } })(); @@ -93117,15 +92811,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) { @@ -93135,7 +92829,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; } } @@ -93145,7 +92839,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; @@ -93166,13 +92860,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; } } @@ -93328,7 +93022,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.3/node_modules/got/dist/source/as-promise/types.js /** An error to be thrown when the request is aborted with `.cancel()`. @@ -93347,7 +93041,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.3/node_modules/got/dist/source/as-promise/index.js @@ -93428,7 +93122,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'); } } @@ -93463,7 +93157,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; @@ -93474,7 +93168,7 @@ function asPromise(firstRequest) { makeRequest(newRetryCount); }); proxyEvents(request, emitter, as_promise_proxiedRequestEvents); - if (dist.undefined(firstRequest)) { + if (distribution.undefined(firstRequest)) { void request.flush(); } }; @@ -93513,16 +93207,13 @@ 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.3/node_modules/got/dist/source/create.js -// The `delay` package weighs 10KB (!) -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', @@ -93549,9 +93240,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); @@ -93561,7 +93252,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); @@ -93609,10 +93300,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); @@ -93622,7 +93313,7 @@ const create = (defaults) => { while (numberOfRequests < pagination.requestLimit) { if (numberOfRequests !== 0) { // eslint-disable-next-line no-await-in-loop - await delay(pagination.backoff); + await (0,external_node_timers_promises_namespaceObject.setTimeout)(pagination.backoff); } // eslint-disable-next-line no-await-in-loop const response = (await got(undefined, undefined, normalizedOptions)); @@ -93658,7 +93349,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; @@ -93698,7 +93389,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.3/node_modules/got/dist/source/index.js const defaults = { @@ -93722,20 +93413,14 @@ const got = source_create(defaults); ;// CONCATENATED MODULE: external "node:dns/promises" -const promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:dns/promises"); +const external_node_dns_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:dns/promises"); // EXTERNAL MODULE: ./node_modules/.pnpm/@actions+cache@3.2.4/node_modules/@actions/cache/lib/cache.js var cache = __nccwpck_require__(6878); ;// CONCATENATED MODULE: external "node:child_process" const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:child_process"); -;// CONCATENATED MODULE: external "node:fs/promises" -const external_node_fs_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs/promises"); ;// CONCATENATED MODULE: external "node:path" const external_node_path_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path"); -;// CONCATENATED MODULE: external "node:stream/promises" -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@bc45b6c0a6318ae30192c4bf23a73dc879bdb632_gnkvhsupsr4227wkpq3ncrmpsq/node_modules/detsys-ts/dist/index.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@18dff575ee06557065bdbc22c099c05606a4285c_dkxwcjsctwer2hqhdrsx5f7ab4/node_modules/detsys-ts/dist/index.js var __defProp = Object.defineProperty; var __export = (target, all) => { for (var name in all) @@ -93948,6 +93633,165 @@ async function getDetails() { }; } +// src/errors.ts +function stringifyError(e) { + if (e instanceof Error) { + return e.message; + } else if (typeof e === "string") { + return e; + } else { + return JSON.stringify(e); + } +} + +// src/backtrace.ts + + + + + +async function collectBacktraces(prefixes, startTimestampMs) { + if (isMacOS) { + return await collectBacktracesMacOS(prefixes, startTimestampMs); + } + if (isLinux) { + return await collectBacktracesSystemd(prefixes, startTimestampMs); + } + return /* @__PURE__ */ new Map(); +} +async function collectBacktracesMacOS(prefixes, startTimestampMs) { + const backtraces = /* @__PURE__ */ new Map(); + try { + const { stdout: logJson } = await exec.getExecOutput( + "log", + [ + "show", + "--style", + "json", + "--last", + // Note we collect the last 1m only, because it should only take a few seconds to write the crash log. + // Therefore, any crashes before this 1m should be long done by now. + "1m", + "--no-info", + "--predicate", + "sender = 'ReportCrash'" + ], + { + silent: true + } + ); + const sussyArray = JSON.parse(logJson); + if (!Array.isArray(sussyArray)) { + throw new Error(`Log json isn't an array: ${logJson}`); + } + if (sussyArray.length > 0) { + core.info(`Collecting crash data...`); + const delay = async (ms) => new Promise((resolve) => setTimeout(resolve, ms)); + await delay(5e3); + } + } catch (e) { + core.debug( + "Failed to check logs for in-progress crash dumps; now proceeding with the assumption that all crash dumps completed." + ); + } + const dirs = [ + ["system", "/Library/Logs/DiagnosticReports/"], + ["user", `${process.env["HOME"]}/Library/Logs/DiagnosticReports/`] + ]; + for (const [source, dir] of dirs) { + const fileNames = (await (0,promises_namespaceObject.readdir)(dir)).filter((fileName) => { + return prefixes.some((prefix) => fileName.startsWith(prefix)); + }).filter((fileName) => { + return !fileName.endsWith(".diag"); + }); + const doGzip = (0,external_node_util_.promisify)(external_node_zlib_namespaceObject.gzip); + for (const fileName of fileNames) { + try { + if ((await (0,promises_namespaceObject.stat)(`${dir}/${fileName}`)).ctimeMs >= startTimestampMs) { + const logText = await (0,promises_namespaceObject.readFile)(`${dir}/${fileName}`); + const buf = await doGzip(logText); + backtraces.set( + `backtrace_value_${source}_${fileName}`, + buf.toString("base64") + ); + } + } catch (innerError) { + backtraces.set( + `backtrace_failure_${source}_${fileName}`, + stringifyError(innerError) + ); + } + } + } + return backtraces; +} +async function collectBacktracesSystemd(prefixes, startTimestampMs) { + const sinceSeconds = Math.ceil((Date.now() - startTimestampMs) / 1e3); + const backtraces = /* @__PURE__ */ new Map(); + const coredumps = []; + try { + const { stdout: coredumpjson } = await exec.getExecOutput( + "coredumpctl", + ["--json=pretty", "list", "--since", `${sinceSeconds} seconds ago`], + { + silent: true + } + ); + const sussyArray = JSON.parse(coredumpjson); + if (!Array.isArray(sussyArray)) { + throw new Error(`Coredump isn't an array: ${coredumpjson}`); + } + for (const sussyObject of sussyArray) { + const keys = Object.keys(sussyObject); + if (keys.includes("exe") && keys.includes("pid")) { + if (typeof sussyObject.exe == "string" && typeof sussyObject.pid == "number") { + const execParts = sussyObject.exe.split("/"); + const binaryName = execParts[execParts.length - 1]; + if (prefixes.some((prefix) => binaryName.startsWith(prefix))) { + coredumps.push({ + exe: sussyObject.exe, + pid: sussyObject.pid + }); + } + } else { + core.debug( + `Mysterious coredump entry missing exe string and/or pid number: ${JSON.stringify(sussyObject)}` + ); + } + } else { + core.debug( + `Mysterious coredump entry missing exe value and/or pid value: ${JSON.stringify(sussyObject)}` + ); + } + } + } catch (innerError) { + core.debug( + `Cannot collect backtraces: ${stringifyError(innerError)}` + ); + return backtraces; + } + const doGzip = (0,external_node_util_.promisify)(external_node_zlib_namespaceObject.gzip); + for (const coredump of coredumps) { + try { + const { stdout: logText } = await exec.getExecOutput( + "coredumpctl", + ["info", `${coredump.pid}`], + { + silent: true + } + ); + const buf = await doGzip(logText); + backtraces.set(`backtrace_value_${coredump.pid}`, buf.toString("base64")); + } catch (innerError) { + backtraces.set( + `backtrace_failure_${coredump.pid}`, + stringifyError(innerError) + ); + } + } + return backtraces; +} + // src/correlation.ts @@ -94039,17 +93883,6 @@ function hashEnvironmentVariables(prefix, variables) { return `${prefix}-${hash.digest("hex")}`; } -// src/errors.ts -function stringifyError(e) { - if (e instanceof Error) { - return e.message; - } else if (typeof e === "string") { - return e; - } else { - return JSON.stringify(e); - } -} - // src/ids-host.ts @@ -94061,7 +93894,7 @@ var ALLOWED_SUFFIXES = [ ]; var DEFAULT_IDS_HOST = "https://install.determinate.systems"; var LOOKUP = process.env["IDS_LOOKUP"] ?? DEFAULT_LOOKUP; -var DEFAULT_TIMEOUT = 3e4; +var DEFAULT_TIMEOUT = 1e4; var IdsHost = class { constructor(idsProjectName, diagnosticsSuffix, runtimeDiagnosticsUrl) { this.idsProjectName = idsProjectName; @@ -94076,7 +93909,7 @@ var IdsHost = class { request: DEFAULT_TIMEOUT }, retry: { - limit: (await this.getUrlsByPreference()).length, + limit: Math.max((await this.getUrlsByPreference()).length, 3), methods: ["GET", "HEAD"] }, hooks: { @@ -94086,7 +93919,7 @@ var IdsHost = class { this.markCurrentHostBroken(); const nextUrl = await this.getRootUrl(); if (recordFailoverCallback !== void 0) { - recordFailoverCallback(prevUrl, nextUrl); + recordFailoverCallback(error3, prevUrl, nextUrl); } core.info( `Retrying after error ${error3.code}, retry #: ${retryCount}` @@ -94209,7 +94042,7 @@ function recordToUrl(record) { } } async function discoverServiceRecords() { - return await discoverServicesStub((0,promises_namespaceObject.resolveSrv)(LOOKUP), 1e3); + return await discoverServicesStub((0,external_node_dns_promises_namespaceObject.resolveSrv)(LOOKUP), 1e3); } async function discoverServicesStub(lookup, timeout) { const defaultFallback = new Promise( @@ -94449,6 +94282,7 @@ function noisilyGetInput(suffix, legacyPrefix) { +var EVENT_BACKTRACES = "backtrace"; var EVENT_EXCEPTION = "exception"; var EVENT_ARTIFACT_CACHE_HIT = "artifact_cache_hit"; var EVENT_ARTIFACT_CACHE_MISS = "artifact_cache_miss"; @@ -94469,8 +94303,10 @@ var FACT_NIX_STORE_CHECK_ERROR = "nix_store_check_error"; var STATE_KEY_EXECUTION_PHASE = "detsys_action_execution_phase"; var STATE_KEY_NIX_NOT_FOUND = "detsys_action_nix_not_found"; var STATE_NOT_FOUND = "not-found"; -var DIAGNOSTIC_ENDPOINT_TIMEOUT_MS = 3e4; -var CHECK_IN_ENDPOINT_TIMEOUT_MS = 5e3; +var STATE_KEY_CROSS_PHASE_ID = "detsys_cross_phase_id"; +var STATE_BACKTRACE_START_TIMESTAMP = "detsys_backtrace_start_timestamp"; +var DIAGNOSTIC_ENDPOINT_TIMEOUT_MS = 1e4; +var CHECK_IN_ENDPOINT_TIMEOUT_MS = 1e3; var DetSysAction = class { determineExecutionPhase() { const currentPhase = core.getState(STATE_KEY_EXECUTION_PHASE); @@ -94496,6 +94332,8 @@ var DetSysAction = class { this.features = {}; this.featureEventMetadata = {}; this.events = []; + this.getCrossPhaseId(); + this.collectBacktraceSetup(); this.facts = { $lib: "idslib", $lib_version: version, @@ -94585,6 +94423,15 @@ var DetSysAction = class { getUniqueId() { return this.identity.run_differentiator || process.env.RUNNER_TRACKING_ID || (0,external_node_crypto_namespaceObject.randomUUID)(); } + // This ID will be saved in the action's state, to be persisted across phase steps + getCrossPhaseId() { + let crossPhaseId = core.getState(STATE_KEY_CROSS_PHASE_ID); + if (crossPhaseId === "") { + crossPhaseId = (0,external_node_crypto_namespaceObject.randomUUID)(); + core.saveState(STATE_KEY_CROSS_PHASE_ID, crossPhaseId); + } + return crossPhaseId; + } getCorrelationHashes() { return this.identity; } @@ -94620,7 +94467,7 @@ var DetSysAction = class { */ async fetchExecutable() { const binaryPath = await this.fetchArtifact(); - await (0,external_node_fs_promises_namespaceObject.chmod)(binaryPath, external_node_fs_promises_namespaceObject.constants.S_IXUSR | external_node_fs_promises_namespaceObject.constants.S_IXGRP); + await (0,promises_namespaceObject.chmod)(binaryPath, promises_namespaceObject.constants.S_IXUSR | promises_namespaceObject.constants.S_IXGRP); return binaryPath; } get isMain() { @@ -94676,16 +94523,22 @@ var DetSysAction = class { } this.recordEvent(EVENT_EXCEPTION, Object.fromEntries(exceptionContext)); } finally { + if (this.isPost) { + await this.collectBacktraces(); + } await this.complete(); } } async getClient() { - return await this.idsHost.getGot((prevUrl, nextUrl) => { - this.recordEvent("ids-failover", { - previousUrl: prevUrl.toString(), - nextUrl: nextUrl.toString() - }); - }); + return await this.idsHost.getGot( + (incitingError, prevUrl, nextUrl) => { + this.recordPlausibleTimeout(incitingError); + this.recordEvent("ids-failover", { + previousUrl: prevUrl.toString(), + nextUrl: nextUrl.toString() + }); + } + ); } async checkIn() { const checkin = await this.requestCheckIn(); @@ -94769,12 +94622,27 @@ var DetSysAction = class { } }).json(); } catch (e) { + this.recordPlausibleTimeout(e); core.debug(`Error checking in: ${stringifyError2(e)}`); this.idsHost.markCurrentHostBroken(); } } return void 0; } + recordPlausibleTimeout(e) { + if (e instanceof TimeoutError && "timings" in e && "request" in e) { + const reportContext = { + url: e.request.requestUrl?.toString(), + retry_count: e.request.retryCount + }; + for (const [key, value] of Object.entries(e.timings.phases)) { + if (Number.isFinite(value)) { + reportContext[`timing_phase_${key}`] = value; + } + } + this.recordEvent("timeout", reportContext); + } + } /** * 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 @@ -94818,13 +94686,9 @@ var DetSysAction = class { `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 - }) + const fetchStream = await this.downloadFile( + new URL(versionCheckup.url), + destFile ); if (fetchStream.response?.headers.etag) { const v = fetchStream.response.headers.etag; @@ -94835,6 +94699,9 @@ var DetSysAction = class { } } return destFile; + } catch (e) { + this.recordPlausibleTimeout(e); + throw e; } finally { core.endGroup(); } @@ -94848,6 +94715,36 @@ var DetSysAction = class { core.setFailed(`strict mode failure: ${msg}`); } } + async downloadFile(url, destination) { + const client = await this.getClient(); + return new Promise((resolve, reject) => { + let writeStream; + let failed = false; + const retry = (stream) => { + if (writeStream) { + writeStream.destroy(); + } + writeStream = (0,external_node_fs_namespaceObject.createWriteStream)(destination, { + encoding: "binary", + mode: 493 + }); + writeStream.once("error", (error3) => { + failed = true; + reject(error3); + }); + writeStream.on("finish", () => { + if (!failed) { + resolve(stream); + } + }); + stream.once("retry", (_count, _error, createRetryStream) => { + retry(createRetryStream()); + }); + stream.pipe(writeStream); + }; + retry(client.stream(url)); + }); + } async complete() { this.recordEvent(`complete_${this.executionPhase}`); await this.submitEvents(); @@ -94891,7 +94788,7 @@ var DetSysAction = class { const startCwd = process.cwd(); try { const tempDir = this.getTemporaryName(); - await (0,external_node_fs_promises_namespaceObject.mkdir)(tempDir); + await (0,promises_namespaceObject.mkdir)(tempDir); process.chdir(tempDir); process.env.GITHUB_WORKSPACE_BACKUP = process.env.GITHUB_WORKSPACE; delete process.env.GITHUB_WORKSPACE; @@ -94917,9 +94814,9 @@ var DetSysAction = class { const startCwd = process.cwd(); try { const tempDir = this.getTemporaryName(); - await (0,external_node_fs_promises_namespaceObject.mkdir)(tempDir); + await (0,promises_namespaceObject.mkdir)(tempDir); process.chdir(tempDir); - await (0,external_node_fs_promises_namespaceObject.copyFile)(toolPath, `${tempDir}/${this.actionOptions.name}`); + 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( @@ -94935,13 +94832,41 @@ var DetSysAction = class { process.chdir(startCwd); } } + collectBacktraceSetup() { + if (process.env.DETSYS_BACKTRACE_COLLECTOR === "") { + core.exportVariable( + "DETSYS_BACKTRACE_COLLECTOR", + this.getCrossPhaseId() + ); + core.saveState(STATE_BACKTRACE_START_TIMESTAMP, Date.now()); + } + } + async collectBacktraces() { + try { + if (process.env.DETSYS_BACKTRACE_COLLECTOR !== this.getCrossPhaseId()) { + return; + } + const backtraces = await collectBacktraces( + this.actionOptions.binaryNamePrefixes, + parseInt(core.getState(STATE_BACKTRACE_START_TIMESTAMP)) + ); + core.debug(`Backtraces identified: ${backtraces.size}`); + if (backtraces.size > 0) { + this.recordEvent(EVENT_BACKTRACES, Object.fromEntries(backtraces)); + } + } catch (innerError) { + core.debug( + `Error collecting backtraces: ${stringifyError2(innerError)}` + ); + } + } 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 external_node_fs_promises_namespaceObject.access(candidateNix, external_node_fs_promises_namespaceObject.constants.X_OK); + await promises_namespaceObject.access(candidateNix, promises_namespaceObject.constants.X_OK); core.debug(`Found Nix at ${candidateNix}`); nixLocation = candidateNix; break; @@ -95043,6 +94968,7 @@ var DetSysAction = class { } }); } catch (err) { + this.recordPlausibleTimeout(err); core.debug( `Error submitting diagnostics event to ${diagnosticsUrl}: ${stringifyError2(err)}` ); @@ -95061,7 +94987,12 @@ function makeOptionsConfident(actionOptions) { eventPrefix: actionOptions.eventPrefix || "action:", fetchStyle: actionOptions.fetchStyle, legacySourcePrefix: actionOptions.legacySourcePrefix, - requireNix: actionOptions.requireNix + requireNix: actionOptions.requireNix, + binaryNamePrefixes: actionOptions.binaryNamePrefixes ?? [ + "nix", + "determinate-nixd", + actionOptions.name + ] }; core.debug("idslib options:"); core.debug(JSON.stringify(finalOpts, void 0, 2)); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 06670d8..b68da97 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,7 +13,7 @@ dependencies: version: 1.1.1 detsys-ts: specifier: github:DeterminateSystems/detsys-ts - version: github.com/DeterminateSystems/detsys-ts/bc45b6c0a6318ae30192c4bf23a73dc879bdb632 + version: github.com/DeterminateSystems/detsys-ts/18dff575ee06557065bdbc22c099c05606a4285c devDependencies: '@trivago/prettier-plugin-sort-imports': @@ -21,7 +21,7 @@ devDependencies: version: 4.3.0(prettier@3.2.5) '@typescript-eslint/eslint-plugin': specifier: ^7.11.0 - version: 7.11.0(@typescript-eslint/parser@7.12.0)(eslint@8.57.0)(typescript@5.4.5) + version: 7.11.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 @@ -30,13 +30,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.2.5) @@ -1055,9 +1055,9 @@ packages: resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} dev: true - /@sindresorhus/is@6.3.1: - resolution: {integrity: sha512-FX4MfcifwJyFOI2lPoX7PQxCqx8BG1HCho7WdiXwpEQx1Ycij0JxkfYtGK7yqNScrZGSlt6RE6sw8QYoH7eKnQ==} - engines: {node: '>=16'} + /@sindresorhus/is@7.0.1: + resolution: {integrity: sha512-QWLl2P+rsCJeofkDNIT3WFmb6NrRud1SUYW8dIhXK/46XFV8Q/g7Bsvib0Askb0reRLe+WYPeeE+l5cH7SlkuQ==} + engines: {node: '>=18'} dev: false /@szmarczak/http-timer@5.0.1: @@ -1145,7 +1145,7 @@ packages: - supports-color dev: true - /@typescript-eslint/eslint-plugin@7.11.0(@typescript-eslint/parser@7.12.0)(eslint@8.57.0)(typescript@5.4.5): + /@typescript-eslint/eslint-plugin@7.11.0(@typescript-eslint/parser@7.18.0)(eslint@8.57.0)(typescript@5.4.5): resolution: {integrity: sha512-P+qEahbgeHW4JQ/87FuItjBj8O3MYv5gELDzr8QaQ7fsll1gSMTYb6j87MYyxwf3DtD7uGFB9ShwgmCJB5KmaQ==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: @@ -1157,7 +1157,7 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.12.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.18.0(eslint@8.57.0)(typescript@5.4.5) '@typescript-eslint/scope-manager': 7.11.0 '@typescript-eslint/type-utils': 7.11.0(eslint@8.57.0)(typescript@5.4.5) '@typescript-eslint/utils': 7.11.0(eslint@8.57.0)(typescript@5.4.5) @@ -1193,8 +1193,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@7.12.0(eslint@8.57.0)(typescript@5.4.5): - resolution: {integrity: sha512-dm/J2UDY3oV3TKius2OUZIFHsomQmpHtsV0FTh1WO8EKgHLQ1QCADUqscPgTpU+ih1e21FQSRjXckHn3txn6kQ==} + /@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 @@ -1203,11 +1203,11 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 7.12.0 - '@typescript-eslint/types': 7.12.0 - '@typescript-eslint/typescript-estree': 7.12.0(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.12.0 - debug: 4.3.5 + '@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.7 eslint: 8.57.0 typescript: 5.4.5 transitivePeerDependencies: @@ -1222,12 +1222,12 @@ packages: '@typescript-eslint/visitor-keys': 7.11.0 dev: true - /@typescript-eslint/scope-manager@7.12.0: - resolution: {integrity: sha512-itF1pTnN6F3unPak+kutH9raIkL3lhH1YRPGgt7QQOh43DQKVJXmWkpb+vpc/TiDHs6RSd9CTbDsc/Y+Ygq7kg==} + /@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.12.0 - '@typescript-eslint/visitor-keys': 7.12.0 + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/visitor-keys': 7.18.0 dev: true /@typescript-eslint/type-utils@7.11.0(eslint@8.57.0)(typescript@5.4.5): @@ -1255,8 +1255,8 @@ packages: engines: {node: ^18.18.0 || >=20.0.0} dev: true - /@typescript-eslint/types@7.12.0: - resolution: {integrity: sha512-o+0Te6eWp2ppKY3mLCU+YA9pVJxhUJE15FV7kxuD9jgwIAa+w/ycGJBMrYDTpVGUM/tgpa9SeMOugSabWFq7bg==} + /@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 @@ -1282,8 +1282,8 @@ packages: - supports-color dev: true - /@typescript-eslint/typescript-estree@7.12.0(typescript@5.4.5): - resolution: {integrity: sha512-5bwqLsWBULv1h6pn7cMW5dXX/Y2amRqLaKqsASVwbBHMZSnHqE/HN4vT4fE0aFsiwxYvr98kqOWh1a8ZKXalCQ==} + /@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: '*' @@ -1291,13 +1291,13 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 7.12.0 - '@typescript-eslint/visitor-keys': 7.12.0 - debug: 4.3.5 + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/visitor-keys': 7.18.0 + debug: 4.3.7 globby: 11.1.0 is-glob: 4.0.3 - minimatch: 9.0.4 - semver: 7.6.2 + minimatch: 9.0.5 + semver: 7.6.3 ts-api-utils: 1.3.0(typescript@5.4.5) typescript: 5.4.5 transitivePeerDependencies: @@ -1328,11 +1328,11 @@ packages: eslint-visitor-keys: 3.4.3 dev: true - /@typescript-eslint/visitor-keys@7.12.0: - resolution: {integrity: sha512-uZk7DevrQLL3vSnfFl5bj4sL75qC9D6EdjemIdbtkuUmIheWpuiiylSY01JxJE7+zGrOWDZrp1WxOuDntvKrHQ==} + /@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.12.0 + '@typescript-eslint/types': 7.18.0 eslint-visitor-keys: 3.4.3 dev: true @@ -1821,6 +1821,18 @@ packages: ms: 2.1.2 dev: true + /debug@4.3.7: + resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.3 + dev: true + /decompress-response@6.0.0: resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} engines: {node: '>=10'} @@ -2133,7 +2145,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==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -2143,8 +2155,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 @@ -2181,12 +2193,12 @@ 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.12.0)(eslint-import-resolver-node@0.3.9)(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): resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==} engines: {node: '>=4'} peerDependencies: @@ -2207,11 +2219,11 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 7.12.0(eslint@8.57.0)(typescript@5.4.5) + '@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.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 @@ -2323,7 +2335,7 @@ packages: - supports-color dev: true - /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.12.0)(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): resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} engines: {node: '>=4'} peerDependencies: @@ -2333,7 +2345,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 7.12.0(eslint@8.57.0)(typescript@5.4.5) + '@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 @@ -2342,7 +2354,7 @@ packages: 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.12.0)(eslint-import-resolver-node@0.3.9)(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) hasown: 2.0.2 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -2711,6 +2723,7 @@ packages: /get-stream@8.0.1: resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} engines: {node: '>=16'} + dev: true /get-stream@9.0.1: resolution: {integrity: sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==} @@ -2811,21 +2824,21 @@ packages: get-intrinsic: 1.2.4 dev: true - /got@14.4.0: - resolution: {integrity: sha512-baa2HMfREJ9UQSXOPwWe0DNK+FT8Okcxe9kmTJvaetv2q/MUxq0qFzEnfSbxo+wj45/QioGcH5ZhuT9VBIPJ5Q==} + /got@14.4.3: + resolution: {integrity: sha512-iTC0Z87yxSijWTh/IpvGpwOhIQK7+GgWkYrMRoN/hB9qeRj9RPuLGODwevs0p5idUf7nrxCVa5IlOmK3b8z+KA==} engines: {node: '>=20'} dependencies: - '@sindresorhus/is': 6.3.1 + '@sindresorhus/is': 7.0.1 '@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.26.1 dev: false /graceful-fs@4.2.11: @@ -3383,6 +3396,13 @@ 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: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} dev: true @@ -3886,6 +3906,12 @@ 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: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} engines: {node: '>= 0.4'} @@ -4256,8 +4282,8 @@ packages: engines: {node: '>=10'} dev: true - /type-fest@4.19.0: - resolution: {integrity: sha512-CN2l+hWACRiejlnr68vY0/7734Kzu+9+TOslUXbSCQ1ruY9XIHDBSceVXCcHm/oXrdzhtLMMdJEKfemf1yXiZQ==} + /type-fest@4.26.1: + resolution: {integrity: sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg==} engines: {node: '>=16'} dev: false @@ -4619,16 +4645,16 @@ packages: engines: {node: '>=12.20'} dev: true - github.com/DeterminateSystems/detsys-ts/bc45b6c0a6318ae30192c4bf23a73dc879bdb632: - resolution: {tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/bc45b6c0a6318ae30192c4bf23a73dc879bdb632} + github.com/DeterminateSystems/detsys-ts/18dff575ee06557065bdbc22c099c05606a4285c: + resolution: {tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/18dff575ee06557065bdbc22c099c05606a4285c} name: detsys-ts version: 1.0.0 dependencies: '@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.3 + type-fest: 4.26.1 transitivePeerDependencies: - encoding dev: false