From 0747ab357791869a3139765f6855a25d9cc0aafc Mon Sep 17 00:00:00 2001 From: MSP-Greg Date: Mon, 20 Mar 2023 18:28:00 -0500 Subject: [PATCH 001/198] cache - getCacheVersion - dup paths array --- packages/cache/src/internal/cacheHttpClient.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/cache/src/internal/cacheHttpClient.ts b/packages/cache/src/internal/cacheHttpClient.ts index e05cac58..6e1b0acf 100644 --- a/packages/cache/src/internal/cacheHttpClient.ts +++ b/packages/cache/src/internal/cacheHttpClient.ts @@ -76,7 +76,8 @@ export function getCacheVersion( compressionMethod?: CompressionMethod, enableCrossOsArchive = false ): string { - const components = paths + // don't pass changes upstream + const components = paths.slice() // Add compression method to cache version to restore // compressed cache as per compression method From 20f826bfe76164099ab2403d9ea8509e16843223 Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii <130154213+nikolai-laevskii@users.noreply.github.com> Date: Tue, 14 Nov 2023 20:15:26 +0100 Subject: [PATCH 002/198] Add platform info utilities to @actions/core (#1551) * Introduce platform utilities into @actions/core * Add tests for the platform helper * Update README.md * Update README.md with more details --- packages/core/README.md | 25 +++++++ packages/core/__tests__/platform.test.ts | 29 ++++++++ packages/core/package-lock.json | 27 ++++++++ packages/core/package.json | 1 + packages/core/src/core.ts | 5 ++ packages/core/src/platform.ts | 87 ++++++++++++++++++++++++ 6 files changed, 174 insertions(+) create mode 100644 packages/core/__tests__/platform.test.ts create mode 100644 packages/core/src/platform.ts diff --git a/packages/core/README.md b/packages/core/README.md index 8a471430..35bd72db 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -333,3 +333,28 @@ toPlatformPath('/foo/bar') // => \foo\bar // On a Linux runner. toPlatformPath('\\foo\\bar') // => /foo/bar ``` + +#### Platform helper + +Provides shorthands for getting information about platform action is running on. + +```js +import { platform } from '@actions/core' + +/* equals to a call of os.platform() */ +platform.platform // 'win32' | 'darwin' | 'linux' | 'freebsd' | 'openbsd' | 'android' | 'cygwin' | 'sunos' + +/* equals to a call of os.arch() */ +platform.arch // 'x64' | 'arm' | 'arm64' | 'ia32' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 'riscv64' | 's390' | 's390x' + +/* common shorthands for platform-specific logic */ +platform.isWindows // true +platform.isMacOS // false +platform.isLinux // false + +/* run platform-specific script to get more details about the exact platform, works on Windows, MacOS and Linux */ +const { + name, // Microsoft Windows 11 Enterprise + version, // 10.0.22621 +} = await platform.getDetails() +``` diff --git a/packages/core/__tests__/platform.test.ts b/packages/core/__tests__/platform.test.ts new file mode 100644 index 00000000..c80be330 --- /dev/null +++ b/packages/core/__tests__/platform.test.ts @@ -0,0 +1,29 @@ +import os from 'os' +import {platform} from '../src/core' + +describe('getInfo', () => { + it('returns the platform info', async () => { + const info = await platform.getDetails() + expect(info).toEqual({ + name: expect.any(String), + platform: expect.any(String), + arch: expect.any(String), + version: expect.any(String), + isWindows: expect.any(Boolean), + isMacOS: expect.any(Boolean), + isLinux: expect.any(Boolean) + }) + }) + + it('returns the platform info with the correct name', async () => { + const isWindows = os.platform() === 'win32' + const isMacOS = os.platform() === 'darwin' + const isLinux = os.platform() === 'linux' + + const info = await platform.getDetails() + expect(info.platform).toEqual(os.platform()) + expect(info.isWindows).toEqual(isWindows) + expect(info.isMacOS).toEqual(isMacOS) + expect(info.isLinux).toEqual(isLinux) + }) +}) diff --git a/packages/core/package-lock.json b/packages/core/package-lock.json index d86f7ef0..7b1cf7bb 100644 --- a/packages/core/package-lock.json +++ b/packages/core/package-lock.json @@ -9,6 +9,7 @@ "version": "1.10.1", "license": "MIT", "dependencies": { + "@actions/exec": "^1.1.1", "@actions/http-client": "^2.0.1", "uuid": "^8.3.2" }, @@ -17,6 +18,14 @@ "@types/uuid": "^8.3.4" } }, + "node_modules/@actions/exec": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz", + "integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==", + "dependencies": { + "@actions/io": "^1.0.1" + } + }, "node_modules/@actions/http-client": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz", @@ -25,6 +34,11 @@ "tunnel": "^0.0.6" } }, + "node_modules/@actions/io": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz", + "integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==" + }, "node_modules/@types/node": { "version": "12.0.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.2.tgz", @@ -55,6 +69,14 @@ } }, "dependencies": { + "@actions/exec": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz", + "integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==", + "requires": { + "@actions/io": "^1.0.1" + } + }, "@actions/http-client": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz", @@ -63,6 +85,11 @@ "tunnel": "^0.0.6" } }, + "@actions/io": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz", + "integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==" + }, "@types/node": { "version": "12.0.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.2.tgz", diff --git a/packages/core/package.json b/packages/core/package.json index 1558268c..2eda27b5 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -36,6 +36,7 @@ "url": "https://github.com/actions/toolkit/issues" }, "dependencies": { + "@actions/exec": "^1.1.1", "@actions/http-client": "^2.0.1", "uuid": "^8.3.2" }, diff --git a/packages/core/src/core.ts b/packages/core/src/core.ts index 1e8d940a..0a141693 100644 --- a/packages/core/src/core.ts +++ b/packages/core/src/core.ts @@ -386,3 +386,8 @@ export {markdownSummary} from './summary' * Path exports */ export {toPosixPath, toWin32Path, toPlatformPath} from './path-utils' + +/** + * Platform utilities exports + */ +export * as platform from './platform' diff --git a/packages/core/src/platform.ts b/packages/core/src/platform.ts new file mode 100644 index 00000000..55fdee64 --- /dev/null +++ b/packages/core/src/platform.ts @@ -0,0 +1,87 @@ +import os from 'os' +import * as exec from '@actions/exec' + +const getWindowsInfo = async (): Promise<{name: string; version: string}> => { + const {stdout: version} = await exec.getExecOutput( + 'powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', + undefined, + { + silent: true + } + ) + + const {stdout: name} = await exec.getExecOutput( + 'powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', + undefined, + { + silent: true + } + ) + + return { + name: name.trim(), + version: version.trim() + } +} + +const getMacOsInfo = async (): Promise<{ + name: string + version: string +}> => { + const {stdout} = await exec.getExecOutput('sw_vers', undefined, { + silent: true + }) + + const version = stdout.match(/ProductVersion:\s*(.+)/)?.[1] ?? '' + const name = stdout.match(/ProductName:\s*(.+)/)?.[1] ?? '' + + return { + name, + version + } +} + +const getLinuxInfo = async (): Promise<{ + name: string + version: string +}> => { + const {stdout} = await exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], { + silent: true + }) + + const [name, version] = stdout.trim().split('\n') + + return { + name, + version + } +} + +export const platform = os.platform() +export const arch = os.arch() +export const isWindows = platform === 'win32' +export const isMacOS = platform === 'darwin' +export const isLinux = platform === 'linux' + +export async function getDetails(): Promise<{ + name: string + platform: string + arch: string + version: string + isWindows: boolean + isMacOS: boolean + isLinux: boolean +}> { + return { + ...(await (isWindows + ? getWindowsInfo() + : isMacOS + ? getMacOsInfo() + : getLinuxInfo())), + platform, + arch, + isWindows, + isMacOS, + isLinux + } +} From 7b01731091c67da6f4bb02254d3767855c6c9495 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Mon, 20 Nov 2023 15:03:58 +0000 Subject: [PATCH 003/198] increase upload concurrency based on cpus, adjust highWaterMark, specify compression level --- packages/artifact/src/internal/shared/config.ts | 16 ++++++++++++++++ .../artifact/src/internal/shared/interfaces.ts | 11 +++++++++++ .../artifact/src/internal/upload/blob-upload.ts | 8 ++++---- .../src/internal/upload/upload-artifact.ts | 2 +- packages/artifact/src/internal/upload/zip.ts | 12 ++++++------ 5 files changed, 38 insertions(+), 11 deletions(-) diff --git a/packages/artifact/src/internal/shared/config.ts b/packages/artifact/src/internal/shared/config.ts index 8d8a1668..73a9fcc5 100644 --- a/packages/artifact/src/internal/shared/config.ts +++ b/packages/artifact/src/internal/shared/config.ts @@ -1,3 +1,5 @@ +import os from 'os' + // Used for controlling the highWaterMark value of the zip that is being streamed // The same value is used as the chunk size that is use during upload to blob storage export function getUploadChunkSize(): number { @@ -34,3 +36,17 @@ export function getGitHubWorkspaceDir(): string { } return ghWorkspaceDir } + +// Mimics behavior of azcopy: https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-optimize +// If your machine has fewer than 5 CPUs, then the value of this variable is set to 32. +// Otherwise, the default value is equal to 16 multiplied by the number of CPUs. The maximum value of this variable is 300. +export function getConcurrency() { + const numCPUs = os.cpus().length + + if (numCPUs <= 4) { + return 32 + } + + const concurrency = 16 * numCPUs + return concurrency > 300 ? 300 : concurrency +} diff --git a/packages/artifact/src/internal/shared/interfaces.ts b/packages/artifact/src/internal/shared/interfaces.ts index 7e3e862f..b160d1be 100644 --- a/packages/artifact/src/internal/shared/interfaces.ts +++ b/packages/artifact/src/internal/shared/interfaces.ts @@ -38,6 +38,17 @@ export interface UploadOptions { * input of 0 assumes default retention setting. */ retentionDays?: number + /** + * The level of compression for Zlib to be applied to the artifact archive. + * The value can range from 0 to 9: + * - 0: No compression + * - 1: Best speed + * - 6: Default compression (same as GNU Gzip) + * - 9: Best compression + * Higher levels will result in better compression, but will take longer to complete. + * For large files that are not easily compressed, a value of 0 is recommended for significantly faster uploads. + */ + compressionLevel?: number } /***************************************************************************** diff --git a/packages/artifact/src/internal/upload/blob-upload.ts b/packages/artifact/src/internal/upload/blob-upload.ts index 2bed1f39..cb7a11b7 100644 --- a/packages/artifact/src/internal/upload/blob-upload.ts +++ b/packages/artifact/src/internal/upload/blob-upload.ts @@ -1,7 +1,7 @@ import {BlobClient, BlockBlobUploadStreamOptions} from '@azure/storage-blob' import {TransferProgressEvent} from '@azure/core-http' import {ZipUploadStream} from './zip' -import {getUploadChunkSize} from '../shared/config' +import {getUploadChunkSize, getConcurrency} from '../shared/config' import * as core from '@actions/core' import * as crypto from 'crypto' import * as stream from 'stream' @@ -29,13 +29,13 @@ export async function uploadZipToBlobStorage( ): Promise { let uploadByteCount = 0 - const maxBuffers = 5 + const maxConcurrency = getConcurrency() const bufferSize = getUploadChunkSize() const blobClient = new BlobClient(authenticatedUploadURL) const blockBlobClient = blobClient.getBlockBlobClient() core.debug( - `Uploading artifact zip to blob storage with maxBuffers: ${maxBuffers}, bufferSize: ${bufferSize}` + `Uploading artifact zip to blob storage with maxConcurrency: ${maxConcurrency}, bufferSize: ${bufferSize}` ) const uploadCallback = (progress: TransferProgressEvent): void => { @@ -61,7 +61,7 @@ export async function uploadZipToBlobStorage( await blockBlobClient.uploadStream( uploadStream, bufferSize, - maxBuffers, + maxConcurrency, options ) diff --git a/packages/artifact/src/internal/upload/upload-artifact.ts b/packages/artifact/src/internal/upload/upload-artifact.ts index ced05568..f2547516 100644 --- a/packages/artifact/src/internal/upload/upload-artifact.ts +++ b/packages/artifact/src/internal/upload/upload-artifact.ts @@ -37,7 +37,7 @@ export async function uploadArtifact( } } - const zipUploadStream = await createZipUploadStream(zipSpecification) + const zipUploadStream = await createZipUploadStream(zipSpecification, options?.compressionLevel) // get the IDs needed for the artifact creation const backendIds = getBackendIdsFromToken() diff --git a/packages/artifact/src/internal/upload/zip.ts b/packages/artifact/src/internal/upload/zip.ts index 81a12343..d8a5e5b7 100644 --- a/packages/artifact/src/internal/upload/zip.ts +++ b/packages/artifact/src/internal/upload/zip.ts @@ -5,6 +5,8 @@ import {createReadStream} from 'fs' import {UploadZipSpecification} from './upload-zip-specification' import {getUploadChunkSize} from '../shared/config' +export const DEFAULT_COMPRESSION_LEVEL = 6 + // Custom stream transformer so we can set the highWaterMark property // See https://github.com/nodejs/node/issues/8855 export class ZipUploadStream extends stream.Transform { @@ -21,14 +23,12 @@ export class ZipUploadStream extends stream.Transform { } export async function createZipUploadStream( - uploadSpecification: UploadZipSpecification[] + uploadSpecification: UploadZipSpecification[], + compressionLevel: number = DEFAULT_COMPRESSION_LEVEL ): Promise { const zip = archiver.create('zip', { - zlib: {level: 9} // Sets the compression level. - // Available options are 0-9 - // 0 => no compression - // 1 => fastest with low compression - // 9 => highest compression ratio but the slowest + highWaterMark: getUploadChunkSize(), + zlib: {level: compressionLevel} }) // register callbacks for various events during the zip lifecycle From 606ebdcf6d8e25ec4b259fc5ac248474de5c0a4b Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Mon, 20 Nov 2023 16:27:35 +0000 Subject: [PATCH 004/198] extra log line for debug --- packages/artifact/src/internal/upload/zip.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/artifact/src/internal/upload/zip.ts b/packages/artifact/src/internal/upload/zip.ts index d8a5e5b7..5a923119 100644 --- a/packages/artifact/src/internal/upload/zip.ts +++ b/packages/artifact/src/internal/upload/zip.ts @@ -26,6 +26,10 @@ export async function createZipUploadStream( uploadSpecification: UploadZipSpecification[], compressionLevel: number = DEFAULT_COMPRESSION_LEVEL ): Promise { + core.debug( + `Creating Artifact archive with compressionLevel: ${compressionLevel}` + ) + const zip = archiver.create('zip', { highWaterMark: getUploadChunkSize(), zlib: {level: compressionLevel} From 3a610e848c05f3d2b61750351ac322721b20bf75 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Mon, 20 Nov 2023 16:46:08 +0000 Subject: [PATCH 005/198] linter --- packages/artifact/src/internal/shared/config.ts | 2 +- packages/artifact/src/internal/upload/upload-artifact.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/artifact/src/internal/shared/config.ts b/packages/artifact/src/internal/shared/config.ts index 73a9fcc5..eb122207 100644 --- a/packages/artifact/src/internal/shared/config.ts +++ b/packages/artifact/src/internal/shared/config.ts @@ -40,7 +40,7 @@ export function getGitHubWorkspaceDir(): string { // Mimics behavior of azcopy: https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-optimize // If your machine has fewer than 5 CPUs, then the value of this variable is set to 32. // Otherwise, the default value is equal to 16 multiplied by the number of CPUs. The maximum value of this variable is 300. -export function getConcurrency() { +export function getConcurrency(): number { const numCPUs = os.cpus().length if (numCPUs <= 4) { diff --git a/packages/artifact/src/internal/upload/upload-artifact.ts b/packages/artifact/src/internal/upload/upload-artifact.ts index f2547516..bcc91ec8 100644 --- a/packages/artifact/src/internal/upload/upload-artifact.ts +++ b/packages/artifact/src/internal/upload/upload-artifact.ts @@ -37,7 +37,10 @@ export async function uploadArtifact( } } - const zipUploadStream = await createZipUploadStream(zipSpecification, options?.compressionLevel) + const zipUploadStream = await createZipUploadStream( + zipSpecification, + options?.compressionLevel + ) // get the IDs needed for the artifact creation const backendIds = getBackendIdsFromToken() From 9e7201ff5b56c803c5f541262c20972883643599 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Mon, 20 Nov 2023 16:51:13 +0000 Subject: [PATCH 006/198] audit fix --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c0fd14ed..e72dedbd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3262,9 +3262,9 @@ } }, "node_modules/axios": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz", - "integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", + "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", "dev": true, "dependencies": { "follow-redirects": "^1.15.0", From a920781ca9ff07aec4d7c339072c06960c5d2a8b Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Mon, 20 Nov 2023 18:06:44 +0000 Subject: [PATCH 007/198] fix results url construction --- .../artifact/src/internal/shared/artifact-twirp-client.ts | 4 ++-- packages/artifact/src/internal/shared/config.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/artifact/src/internal/shared/artifact-twirp-client.ts b/packages/artifact/src/internal/shared/artifact-twirp-client.ts index 444e3fac..09355808 100644 --- a/packages/artifact/src/internal/shared/artifact-twirp-client.ts +++ b/packages/artifact/src/internal/shared/artifact-twirp-client.ts @@ -52,8 +52,8 @@ class ArtifactHttpClient implements Rpc { contentType: 'application/json' | 'application/protobuf', data: object | Uint8Array ): Promise { - const url = `${this.baseUrl}/twirp/${service}/${method}` - debug(`Requesting ${url}`) + const url = new URL(`/twirp/${service}/${method}`, this.baseUrl).href + debug(`Requesting: ${url}`) const headers = { 'Content-Type': contentType } diff --git a/packages/artifact/src/internal/shared/config.ts b/packages/artifact/src/internal/shared/config.ts index eb122207..a5631bfc 100644 --- a/packages/artifact/src/internal/shared/config.ts +++ b/packages/artifact/src/internal/shared/config.ts @@ -19,7 +19,8 @@ export function getResultsServiceUrl(): string { if (!resultsUrl) { throw new Error('Unable to get the ACTIONS_RESULTS_URL env variable') } - return resultsUrl + + return new URL(resultsUrl).origin } export function isGhes(): boolean { From faa425440f86f9c16587a19dfb59491253a2c92a Mon Sep 17 00:00:00 2001 From: Maxime Aubanel Date: Tue, 28 Nov 2023 15:38:41 +0100 Subject: [PATCH 008/198] Add RUN_ATTEMPT to Github context --- packages/github/src/context.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/github/src/context.ts b/packages/github/src/context.ts index d3f65f7a..691c9690 100644 --- a/packages/github/src/context.ts +++ b/packages/github/src/context.ts @@ -16,6 +16,7 @@ export class Context { action: string actor: string job: string + runAttempt: number runNumber: number runId: number apiUrl: string @@ -44,6 +45,7 @@ export class Context { this.action = process.env.GITHUB_ACTION as string this.actor = process.env.GITHUB_ACTOR as string this.job = process.env.GITHUB_JOB as string + this.runAttempt = parseInt(process.env.GITHUB_RUN_ATTEMPT as string, 10) this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER as string, 10) this.runId = parseInt(process.env.GITHUB_RUN_ID as string, 10) this.apiUrl = process.env.GITHUB_API_URL ?? `https://api.github.com` From 695bf98f84a759546b1c2d09e2e26423eede9aaa Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Thu, 30 Nov 2023 03:47:04 +0000 Subject: [PATCH 009/198] rewrite artifacts client to have public and internal implementations --- .../src/generated/results/api/v1/artifact.ts | 401 +++++++++++- .../results/api/v1/artifact.twirp.ts | 610 ++++++++++++++---- packages/artifact/src/internal/client.ts | 131 ++-- .../internal/download/download-artifact.ts | 85 ++- .../src/internal/find/get-artifact.ts | 64 +- .../src/internal/find/list-artifacts.ts | 36 +- .../internal/shared/artifact-twirp-client.ts | 18 +- .../src/internal/shared/interfaces.ts | 18 +- packages/artifact/src/internal/shared/util.ts | 24 +- .../src/internal/upload/upload-artifact.ts | 16 +- 10 files changed, 1149 insertions(+), 254 deletions(-) diff --git a/packages/artifact/src/generated/results/api/v1/artifact.ts b/packages/artifact/src/generated/results/api/v1/artifact.ts index 106c4cda..7acbd3aa 100644 --- a/packages/artifact/src/generated/results/api/v1/artifact.ts +++ b/packages/artifact/src/generated/results/api/v1/artifact.ts @@ -90,6 +90,105 @@ export interface FinalizeArtifactResponse { */ artifactId: string; } +/** + * @generated from protobuf message github.actions.results.api.v1.ListArtifactsRequest + */ +export interface ListArtifactsRequest { + /** + * The backend plan ID + * + * @generated from protobuf field: string workflow_run_backend_id = 1; + */ + workflowRunBackendId: string; + /** + * The backend job ID + * + * @generated from protobuf field: string workflow_job_run_backend_id = 2; + */ + workflowJobRunBackendId: string; + /** + * (optional) Name of the artifact to filter on + * + * @generated from protobuf field: string name_filter = 3; + */ + nameFilter: string; + /** + * (optional) Monolith Database ID of the artifact to filter on + * + * @generated from protobuf field: int64 id_filter = 4; + */ + idFilter: string; +} +/** + * @generated from protobuf message github.actions.results.api.v1.ListArtifactsResponse + */ +export interface ListArtifactsResponse { + /** + * @generated from protobuf field: repeated github.actions.results.api.v1.ListArtifactsResponse.MonolithArtifact artifacts = 1; + */ + artifacts: ListArtifactsResponse_MonolithArtifact[]; +} +/** + * @generated from protobuf message github.actions.results.api.v1.ListArtifactsResponse.MonolithArtifact + */ +export interface ListArtifactsResponse_MonolithArtifact { + /** + * The backend plan ID + * + * @generated from protobuf field: string workflow_run_backend_id = 1; + */ + workflowRunBackendId: string; + /** + * The backend job ID + * + * @generated from protobuf field: string workflow_job_run_backend_id = 2; + */ + workflowJobRunBackendId: string; + /** + * Monolith database ID of the artifact + * + * @generated from protobuf field: int64 database_id = 3; + */ + databaseId: string; + /** + * Name of the artifact + * + * @generated from protobuf field: string name = 4; + */ + name: string; + /** + * Size of the artifact in bytes + * + * @generated from protobuf field: int64 size = 5; + */ + size: string; +} +/** + * @generated from protobuf message github.actions.results.api.v1.GetSignedArtifactURLRequest + */ +export interface GetSignedArtifactURLRequest { + /** + * @generated from protobuf field: string workflow_run_backend_id = 1; + */ + workflowRunBackendId: string; + /** + * @generated from protobuf field: string workflow_job_run_backend_id = 2; + */ + workflowJobRunBackendId: string; + /** + * @generated from protobuf field: string name = 3; + */ + name: string; +} +/** + * @generated from protobuf message github.actions.results.api.v1.GetSignedArtifactURLResponse + */ +export interface GetSignedArtifactURLResponse { + /** + * @generated from protobuf field: string signed_url = 1; + */ + signedUrl: string; +} // @generated message type with reflection information, may provide speed optimized methods class CreateArtifactRequest$Type extends MessageType { constructor() { @@ -348,10 +447,310 @@ class FinalizeArtifactResponse$Type extends MessageType { + constructor() { + super("github.actions.results.api.v1.ListArtifactsRequest", [ + { no: 1, name: "workflow_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "workflow_job_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "name_filter", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "id_filter", kind: "scalar", T: 3 /*ScalarType.INT64*/ } + ]); + } + create(value?: PartialMessage): ListArtifactsRequest { + const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", nameFilter: "", idFilter: "0" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListArtifactsRequest): ListArtifactsRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string workflow_run_backend_id */ 1: + message.workflowRunBackendId = reader.string(); + break; + case /* string workflow_job_run_backend_id */ 2: + message.workflowJobRunBackendId = reader.string(); + break; + case /* string name_filter */ 3: + message.nameFilter = reader.string(); + break; + case /* int64 id_filter */ 4: + message.idFilter = reader.int64().toString(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListArtifactsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string workflow_run_backend_id = 1; */ + if (message.workflowRunBackendId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.workflowRunBackendId); + /* string workflow_job_run_backend_id = 2; */ + if (message.workflowJobRunBackendId !== "") + writer.tag(2, WireType.LengthDelimited).string(message.workflowJobRunBackendId); + /* string name_filter = 3; */ + if (message.nameFilter !== "") + writer.tag(3, WireType.LengthDelimited).string(message.nameFilter); + /* int64 id_filter = 4; */ + if (message.idFilter !== "0") + writer.tag(4, WireType.Varint).int64(message.idFilter); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message github.actions.results.api.v1.ListArtifactsRequest + */ +export const ListArtifactsRequest = new ListArtifactsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListArtifactsResponse$Type extends MessageType { + constructor() { + super("github.actions.results.api.v1.ListArtifactsResponse", [ + { no: 1, name: "artifacts", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ListArtifactsResponse_MonolithArtifact } + ]); + } + create(value?: PartialMessage): ListArtifactsResponse { + const message = { artifacts: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListArtifactsResponse): ListArtifactsResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated github.actions.results.api.v1.ListArtifactsResponse.MonolithArtifact artifacts */ 1: + message.artifacts.push(ListArtifactsResponse_MonolithArtifact.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListArtifactsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated github.actions.results.api.v1.ListArtifactsResponse.MonolithArtifact artifacts = 1; */ + for (let i = 0; i < message.artifacts.length; i++) + ListArtifactsResponse_MonolithArtifact.internalBinaryWrite(message.artifacts[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message github.actions.results.api.v1.ListArtifactsResponse + */ +export const ListArtifactsResponse = new ListArtifactsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListArtifactsResponse_MonolithArtifact$Type extends MessageType { + constructor() { + super("github.actions.results.api.v1.ListArtifactsResponse.MonolithArtifact", [ + { no: 1, name: "workflow_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "workflow_job_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "database_id", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 4, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "size", kind: "scalar", T: 3 /*ScalarType.INT64*/ } + ]); + } + create(value?: PartialMessage): ListArtifactsResponse_MonolithArtifact { + const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", databaseId: "0", name: "", size: "0" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListArtifactsResponse_MonolithArtifact): ListArtifactsResponse_MonolithArtifact { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string workflow_run_backend_id */ 1: + message.workflowRunBackendId = reader.string(); + break; + case /* string workflow_job_run_backend_id */ 2: + message.workflowJobRunBackendId = reader.string(); + break; + case /* int64 database_id */ 3: + message.databaseId = reader.int64().toString(); + break; + case /* string name */ 4: + message.name = reader.string(); + break; + case /* int64 size */ 5: + message.size = reader.int64().toString(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListArtifactsResponse_MonolithArtifact, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string workflow_run_backend_id = 1; */ + if (message.workflowRunBackendId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.workflowRunBackendId); + /* string workflow_job_run_backend_id = 2; */ + if (message.workflowJobRunBackendId !== "") + writer.tag(2, WireType.LengthDelimited).string(message.workflowJobRunBackendId); + /* int64 database_id = 3; */ + if (message.databaseId !== "0") + writer.tag(3, WireType.Varint).int64(message.databaseId); + /* string name = 4; */ + if (message.name !== "") + writer.tag(4, WireType.LengthDelimited).string(message.name); + /* int64 size = 5; */ + if (message.size !== "0") + writer.tag(5, WireType.Varint).int64(message.size); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message github.actions.results.api.v1.ListArtifactsResponse.MonolithArtifact + */ +export const ListArtifactsResponse_MonolithArtifact = new ListArtifactsResponse_MonolithArtifact$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetSignedArtifactURLRequest$Type extends MessageType { + constructor() { + super("github.actions.results.api.v1.GetSignedArtifactURLRequest", [ + { no: 1, name: "workflow_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "workflow_job_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): GetSignedArtifactURLRequest { + const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", name: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetSignedArtifactURLRequest): GetSignedArtifactURLRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string workflow_run_backend_id */ 1: + message.workflowRunBackendId = reader.string(); + break; + case /* string workflow_job_run_backend_id */ 2: + message.workflowJobRunBackendId = reader.string(); + break; + case /* string name */ 3: + message.name = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: GetSignedArtifactURLRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string workflow_run_backend_id = 1; */ + if (message.workflowRunBackendId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.workflowRunBackendId); + /* string workflow_job_run_backend_id = 2; */ + if (message.workflowJobRunBackendId !== "") + writer.tag(2, WireType.LengthDelimited).string(message.workflowJobRunBackendId); + /* string name = 3; */ + if (message.name !== "") + writer.tag(3, WireType.LengthDelimited).string(message.name); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message github.actions.results.api.v1.GetSignedArtifactURLRequest + */ +export const GetSignedArtifactURLRequest = new GetSignedArtifactURLRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetSignedArtifactURLResponse$Type extends MessageType { + constructor() { + super("github.actions.results.api.v1.GetSignedArtifactURLResponse", [ + { no: 1, name: "signed_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): GetSignedArtifactURLResponse { + const message = { signedUrl: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetSignedArtifactURLResponse): GetSignedArtifactURLResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string signed_url */ 1: + message.signedUrl = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: GetSignedArtifactURLResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string signed_url = 1; */ + if (message.signedUrl !== "") + writer.tag(1, WireType.LengthDelimited).string(message.signedUrl); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message github.actions.results.api.v1.GetSignedArtifactURLResponse + */ +export const GetSignedArtifactURLResponse = new GetSignedArtifactURLResponse$Type(); /** * @generated ServiceType for protobuf service github.actions.results.api.v1.ArtifactService */ export const ArtifactService = new ServiceType("github.actions.results.api.v1.ArtifactService", [ { name: "CreateArtifact", options: {}, I: CreateArtifactRequest, O: CreateArtifactResponse }, - { name: "FinalizeArtifact", options: {}, I: FinalizeArtifactRequest, O: FinalizeArtifactResponse } + { name: "FinalizeArtifact", options: {}, I: FinalizeArtifactRequest, O: FinalizeArtifactResponse }, + { name: "ListArtifacts", options: {}, I: ListArtifactsRequest, O: ListArtifactsResponse }, + { name: "GetSignedArtifactURL", options: {}, I: GetSignedArtifactURLRequest, O: GetSignedArtifactURLResponse } ]); diff --git a/packages/artifact/src/generated/results/api/v1/artifact.twirp.ts b/packages/artifact/src/generated/results/api/v1/artifact.twirp.ts index 3d5f124e..4871eb6b 100644 --- a/packages/artifact/src/generated/results/api/v1/artifact.twirp.ts +++ b/packages/artifact/src/generated/results/api/v1/artifact.twirp.ts @@ -6,14 +6,18 @@ import { TwirpErrorCode, Interceptor, TwirpContentType, - chainInterceptors -} from 'twirp-ts' + chainInterceptors, +} from "twirp-ts"; import { CreateArtifactRequest, CreateArtifactResponse, FinalizeArtifactRequest, - FinalizeArtifactResponse -} from './artifact' + FinalizeArtifactResponse, + ListArtifactsRequest, + ListArtifactsResponse, + GetSignedArtifactURLRequest, + GetSignedArtifactURLResponse, +} from "./artifact"; //==================================// // Client Code // @@ -23,43 +27,51 @@ interface Rpc { request( service: string, method: string, - contentType: 'application/json' | 'application/protobuf', + contentType: "application/json" | "application/protobuf", data: object | Uint8Array - ): Promise + ): Promise; } export interface ArtifactServiceClient { CreateArtifact( request: CreateArtifactRequest - ): Promise + ): Promise; FinalizeArtifact( request: FinalizeArtifactRequest - ): Promise + ): Promise; + ListArtifacts(request: ListArtifactsRequest): Promise; + GetSignedArtifactURL( + request: GetSignedArtifactURLRequest + ): Promise; } export class ArtifactServiceClientJSON implements ArtifactServiceClient { - private readonly rpc: Rpc + private readonly rpc: Rpc; constructor(rpc: Rpc) { - this.rpc = rpc - this.CreateArtifact.bind(this) - this.FinalizeArtifact.bind(this) + this.rpc = rpc; + this.CreateArtifact.bind(this); + this.FinalizeArtifact.bind(this); + this.ListArtifacts.bind(this); + this.GetSignedArtifactURL.bind(this); } CreateArtifact( request: CreateArtifactRequest ): Promise { const data = CreateArtifactRequest.toJson(request, { useProtoFieldName: true, - emitDefaultValues: false - }) + emitDefaultValues: false, + }); const promise = this.rpc.request( - 'github.actions.results.api.v1.ArtifactService', - 'CreateArtifact', - 'application/json', + "github.actions.results.api.v1.ArtifactService", + "CreateArtifact", + "application/json", data as object - ) - return promise.then(data => - CreateArtifactResponse.fromJson(data as any, {ignoreUnknownFields: true}) - ) + ); + return promise.then((data) => + CreateArtifactResponse.fromJson(data as any, { + ignoreUnknownFields: true, + }) + ); } FinalizeArtifact( @@ -67,57 +79,123 @@ export class ArtifactServiceClientJSON implements ArtifactServiceClient { ): Promise { const data = FinalizeArtifactRequest.toJson(request, { useProtoFieldName: true, - emitDefaultValues: false - }) + emitDefaultValues: false, + }); const promise = this.rpc.request( - 'github.actions.results.api.v1.ArtifactService', - 'FinalizeArtifact', - 'application/json', + "github.actions.results.api.v1.ArtifactService", + "FinalizeArtifact", + "application/json", data as object - ) - return promise.then(data => + ); + return promise.then((data) => FinalizeArtifactResponse.fromJson(data as any, { - ignoreUnknownFields: true + ignoreUnknownFields: true, }) - ) + ); + } + + ListArtifacts(request: ListArtifactsRequest): Promise { + const data = ListArtifactsRequest.toJson(request, { + useProtoFieldName: true, + emitDefaultValues: false, + }); + const promise = this.rpc.request( + "github.actions.results.api.v1.ArtifactService", + "ListArtifacts", + "application/json", + data as object + ); + return promise.then((data) => + ListArtifactsResponse.fromJson(data as any, { ignoreUnknownFields: true }) + ); + } + + GetSignedArtifactURL( + request: GetSignedArtifactURLRequest + ): Promise { + const data = GetSignedArtifactURLRequest.toJson(request, { + useProtoFieldName: true, + emitDefaultValues: false, + }); + const promise = this.rpc.request( + "github.actions.results.api.v1.ArtifactService", + "GetSignedArtifactURL", + "application/json", + data as object + ); + return promise.then((data) => + GetSignedArtifactURLResponse.fromJson(data as any, { + ignoreUnknownFields: true, + }) + ); } } export class ArtifactServiceClientProtobuf implements ArtifactServiceClient { - private readonly rpc: Rpc + private readonly rpc: Rpc; constructor(rpc: Rpc) { - this.rpc = rpc - this.CreateArtifact.bind(this) - this.FinalizeArtifact.bind(this) + this.rpc = rpc; + this.CreateArtifact.bind(this); + this.FinalizeArtifact.bind(this); + this.ListArtifacts.bind(this); + this.GetSignedArtifactURL.bind(this); } CreateArtifact( request: CreateArtifactRequest ): Promise { - const data = CreateArtifactRequest.toBinary(request) + const data = CreateArtifactRequest.toBinary(request); const promise = this.rpc.request( - 'github.actions.results.api.v1.ArtifactService', - 'CreateArtifact', - 'application/protobuf', + "github.actions.results.api.v1.ArtifactService", + "CreateArtifact", + "application/protobuf", data - ) - return promise.then(data => + ); + return promise.then((data) => CreateArtifactResponse.fromBinary(data as Uint8Array) - ) + ); } FinalizeArtifact( request: FinalizeArtifactRequest ): Promise { - const data = FinalizeArtifactRequest.toBinary(request) + const data = FinalizeArtifactRequest.toBinary(request); const promise = this.rpc.request( - 'github.actions.results.api.v1.ArtifactService', - 'FinalizeArtifact', - 'application/protobuf', + "github.actions.results.api.v1.ArtifactService", + "FinalizeArtifact", + "application/protobuf", data - ) - return promise.then(data => + ); + return promise.then((data) => FinalizeArtifactResponse.fromBinary(data as Uint8Array) - ) + ); + } + + ListArtifacts(request: ListArtifactsRequest): Promise { + const data = ListArtifactsRequest.toBinary(request); + const promise = this.rpc.request( + "github.actions.results.api.v1.ArtifactService", + "ListArtifacts", + "application/protobuf", + data + ); + return promise.then((data) => + ListArtifactsResponse.fromBinary(data as Uint8Array) + ); + } + + GetSignedArtifactURL( + request: GetSignedArtifactURLRequest + ): Promise { + const data = GetSignedArtifactURLRequest.toBinary(request); + const promise = this.rpc.request( + "github.actions.results.api.v1.ArtifactService", + "GetSignedArtifactURL", + "application/protobuf", + data + ); + return promise.then((data) => + GetSignedArtifactURLResponse.fromBinary(data as Uint8Array) + ); } } @@ -129,33 +207,45 @@ export interface ArtifactServiceTwirp { CreateArtifact( ctx: T, request: CreateArtifactRequest - ): Promise + ): Promise; FinalizeArtifact( ctx: T, request: FinalizeArtifactRequest - ): Promise + ): Promise; + ListArtifacts( + ctx: T, + request: ListArtifactsRequest + ): Promise; + GetSignedArtifactURL( + ctx: T, + request: GetSignedArtifactURLRequest + ): Promise; } export enum ArtifactServiceMethod { - CreateArtifact = 'CreateArtifact', - FinalizeArtifact = 'FinalizeArtifact' + CreateArtifact = "CreateArtifact", + FinalizeArtifact = "FinalizeArtifact", + ListArtifacts = "ListArtifacts", + GetSignedArtifactURL = "GetSignedArtifactURL", } export const ArtifactServiceMethodList = [ ArtifactServiceMethod.CreateArtifact, - ArtifactServiceMethod.FinalizeArtifact -] + ArtifactServiceMethod.FinalizeArtifact, + ArtifactServiceMethod.ListArtifacts, + ArtifactServiceMethod.GetSignedArtifactURL, +]; export function createArtifactServiceServer< T extends TwirpContext = TwirpContext >(service: ArtifactServiceTwirp) { return new TwirpServer({ service, - packageName: 'github.actions.results.api.v1', - serviceName: 'ArtifactService', + packageName: "github.actions.results.api.v1", + serviceName: "ArtifactService", methodList: ArtifactServiceMethodList, - matchRoute: matchArtifactServiceRoute - }) + matchRoute: matchArtifactServiceRoute, + }); } function matchArtifactServiceRoute( @@ -163,7 +253,7 @@ function matchArtifactServiceRoute( events: RouterEvents ) { switch (method) { - case 'CreateArtifact': + case "CreateArtifact": return async ( ctx: T, service: ArtifactServiceTwirp, @@ -174,16 +264,16 @@ function matchArtifactServiceRoute( CreateArtifactResponse >[] ) => { - ctx = {...ctx, methodName: 'CreateArtifact'} - await events.onMatch(ctx) + ctx = { ...ctx, methodName: "CreateArtifact" }; + await events.onMatch(ctx); return handleArtifactServiceCreateArtifactRequest( ctx, service, data, interceptors - ) - } - case 'FinalizeArtifact': + ); + }; + case "FinalizeArtifact": return async ( ctx: T, service: ArtifactServiceTwirp, @@ -194,19 +284,59 @@ function matchArtifactServiceRoute( FinalizeArtifactResponse >[] ) => { - ctx = {...ctx, methodName: 'FinalizeArtifact'} - await events.onMatch(ctx) + ctx = { ...ctx, methodName: "FinalizeArtifact" }; + await events.onMatch(ctx); return handleArtifactServiceFinalizeArtifactRequest( ctx, service, data, interceptors - ) - } + ); + }; + case "ListArtifacts": + return async ( + ctx: T, + service: ArtifactServiceTwirp, + data: Buffer, + interceptors?: Interceptor< + T, + ListArtifactsRequest, + ListArtifactsResponse + >[] + ) => { + ctx = { ...ctx, methodName: "ListArtifacts" }; + await events.onMatch(ctx); + return handleArtifactServiceListArtifactsRequest( + ctx, + service, + data, + interceptors + ); + }; + case "GetSignedArtifactURL": + return async ( + ctx: T, + service: ArtifactServiceTwirp, + data: Buffer, + interceptors?: Interceptor< + T, + GetSignedArtifactURLRequest, + GetSignedArtifactURLResponse + >[] + ) => { + ctx = { ...ctx, methodName: "GetSignedArtifactURL" }; + await events.onMatch(ctx); + return handleArtifactServiceGetSignedArtifactURLRequest( + ctx, + service, + data, + interceptors + ); + }; default: - events.onNotFound() - const msg = `no handler found` - throw new TwirpError(TwirpErrorCode.BadRoute, msg) + events.onNotFound(); + const msg = `no handler found`; + throw new TwirpError(TwirpErrorCode.BadRoute, msg); } } @@ -225,17 +355,17 @@ function handleArtifactServiceCreateArtifactRequest< service, data, interceptors - ) + ); case TwirpContentType.Protobuf: return handleArtifactServiceCreateArtifactProtobuf( ctx, service, data, interceptors - ) + ); default: - const msg = 'unexpected Content-Type' - throw new TwirpError(TwirpErrorCode.BadRoute, msg) + const msg = "unexpected Content-Type"; + throw new TwirpError(TwirpErrorCode.BadRoute, msg); } } @@ -258,17 +388,79 @@ function handleArtifactServiceFinalizeArtifactRequest< service, data, interceptors - ) + ); case TwirpContentType.Protobuf: return handleArtifactServiceFinalizeArtifactProtobuf( ctx, service, data, interceptors - ) + ); default: - const msg = 'unexpected Content-Type' - throw new TwirpError(TwirpErrorCode.BadRoute, msg) + const msg = "unexpected Content-Type"; + throw new TwirpError(TwirpErrorCode.BadRoute, msg); + } +} + +function handleArtifactServiceListArtifactsRequest< + T extends TwirpContext = TwirpContext +>( + ctx: T, + service: ArtifactServiceTwirp, + data: Buffer, + interceptors?: Interceptor[] +): Promise { + switch (ctx.contentType) { + case TwirpContentType.JSON: + return handleArtifactServiceListArtifactsJSON( + ctx, + service, + data, + interceptors + ); + case TwirpContentType.Protobuf: + return handleArtifactServiceListArtifactsProtobuf( + ctx, + service, + data, + interceptors + ); + default: + const msg = "unexpected Content-Type"; + throw new TwirpError(TwirpErrorCode.BadRoute, msg); + } +} + +function handleArtifactServiceGetSignedArtifactURLRequest< + T extends TwirpContext = TwirpContext +>( + ctx: T, + service: ArtifactServiceTwirp, + data: Buffer, + interceptors?: Interceptor< + T, + GetSignedArtifactURLRequest, + GetSignedArtifactURLResponse + >[] +): Promise { + switch (ctx.contentType) { + case TwirpContentType.JSON: + return handleArtifactServiceGetSignedArtifactURLJSON( + ctx, + service, + data, + interceptors + ); + case TwirpContentType.Protobuf: + return handleArtifactServiceGetSignedArtifactURLProtobuf( + ctx, + service, + data, + interceptors + ); + default: + const msg = "unexpected Content-Type"; + throw new TwirpError(TwirpErrorCode.BadRoute, msg); } } async function handleArtifactServiceCreateArtifactJSON< @@ -279,16 +471,18 @@ async function handleArtifactServiceCreateArtifactJSON< data: Buffer, interceptors?: Interceptor[] ) { - let request: CreateArtifactRequest - let response: CreateArtifactResponse + let request: CreateArtifactRequest; + let response: CreateArtifactResponse; try { - const body = JSON.parse(data.toString() || '{}') - request = CreateArtifactRequest.fromJson(body, {ignoreUnknownFields: true}) + const body = JSON.parse(data.toString() || "{}"); + request = CreateArtifactRequest.fromJson(body, { + ignoreUnknownFields: true, + }); } catch (e) { if (e instanceof Error) { - const msg = 'the json request could not be decoded' - throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true) + const msg = "the json request could not be decoded"; + throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true); } } @@ -297,20 +491,20 @@ async function handleArtifactServiceCreateArtifactJSON< T, CreateArtifactRequest, CreateArtifactResponse - > + >; response = await interceptor(ctx, request!, (ctx, inputReq) => { - return service.CreateArtifact(ctx, inputReq) - }) + return service.CreateArtifact(ctx, inputReq); + }); } else { - response = await service.CreateArtifact(ctx, request!) + response = await service.CreateArtifact(ctx, request!); } return JSON.stringify( CreateArtifactResponse.toJson(response, { useProtoFieldName: true, - emitDefaultValues: false + emitDefaultValues: false, }) as string - ) + ); } async function handleArtifactServiceFinalizeArtifactJSON< @@ -325,18 +519,18 @@ async function handleArtifactServiceFinalizeArtifactJSON< FinalizeArtifactResponse >[] ) { - let request: FinalizeArtifactRequest - let response: FinalizeArtifactResponse + let request: FinalizeArtifactRequest; + let response: FinalizeArtifactResponse; try { - const body = JSON.parse(data.toString() || '{}') + const body = JSON.parse(data.toString() || "{}"); request = FinalizeArtifactRequest.fromJson(body, { - ignoreUnknownFields: true - }) + ignoreUnknownFields: true, + }); } catch (e) { if (e instanceof Error) { - const msg = 'the json request could not be decoded' - throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true) + const msg = "the json request could not be decoded"; + throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true); } } @@ -345,20 +539,112 @@ async function handleArtifactServiceFinalizeArtifactJSON< T, FinalizeArtifactRequest, FinalizeArtifactResponse - > + >; response = await interceptor(ctx, request!, (ctx, inputReq) => { - return service.FinalizeArtifact(ctx, inputReq) - }) + return service.FinalizeArtifact(ctx, inputReq); + }); } else { - response = await service.FinalizeArtifact(ctx, request!) + response = await service.FinalizeArtifact(ctx, request!); } return JSON.stringify( FinalizeArtifactResponse.toJson(response, { useProtoFieldName: true, - emitDefaultValues: false + emitDefaultValues: false, }) as string - ) + ); +} + +async function handleArtifactServiceListArtifactsJSON< + T extends TwirpContext = TwirpContext +>( + ctx: T, + service: ArtifactServiceTwirp, + data: Buffer, + interceptors?: Interceptor[] +) { + let request: ListArtifactsRequest; + let response: ListArtifactsResponse; + + try { + const body = JSON.parse(data.toString() || "{}"); + request = ListArtifactsRequest.fromJson(body, { + ignoreUnknownFields: true, + }); + } catch (e) { + if (e instanceof Error) { + const msg = "the json request could not be decoded"; + throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true); + } + } + + if (interceptors && interceptors.length > 0) { + const interceptor = chainInterceptors(...interceptors) as Interceptor< + T, + ListArtifactsRequest, + ListArtifactsResponse + >; + response = await interceptor(ctx, request!, (ctx, inputReq) => { + return service.ListArtifacts(ctx, inputReq); + }); + } else { + response = await service.ListArtifacts(ctx, request!); + } + + return JSON.stringify( + ListArtifactsResponse.toJson(response, { + useProtoFieldName: true, + emitDefaultValues: false, + }) as string + ); +} + +async function handleArtifactServiceGetSignedArtifactURLJSON< + T extends TwirpContext = TwirpContext +>( + ctx: T, + service: ArtifactServiceTwirp, + data: Buffer, + interceptors?: Interceptor< + T, + GetSignedArtifactURLRequest, + GetSignedArtifactURLResponse + >[] +) { + let request: GetSignedArtifactURLRequest; + let response: GetSignedArtifactURLResponse; + + try { + const body = JSON.parse(data.toString() || "{}"); + request = GetSignedArtifactURLRequest.fromJson(body, { + ignoreUnknownFields: true, + }); + } catch (e) { + if (e instanceof Error) { + const msg = "the json request could not be decoded"; + throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true); + } + } + + if (interceptors && interceptors.length > 0) { + const interceptor = chainInterceptors(...interceptors) as Interceptor< + T, + GetSignedArtifactURLRequest, + GetSignedArtifactURLResponse + >; + response = await interceptor(ctx, request!, (ctx, inputReq) => { + return service.GetSignedArtifactURL(ctx, inputReq); + }); + } else { + response = await service.GetSignedArtifactURL(ctx, request!); + } + + return JSON.stringify( + GetSignedArtifactURLResponse.toJson(response, { + useProtoFieldName: true, + emitDefaultValues: false, + }) as string + ); } async function handleArtifactServiceCreateArtifactProtobuf< T extends TwirpContext = TwirpContext @@ -368,15 +654,15 @@ async function handleArtifactServiceCreateArtifactProtobuf< data: Buffer, interceptors?: Interceptor[] ) { - let request: CreateArtifactRequest - let response: CreateArtifactResponse + let request: CreateArtifactRequest; + let response: CreateArtifactResponse; try { - request = CreateArtifactRequest.fromBinary(data) + request = CreateArtifactRequest.fromBinary(data); } catch (e) { if (e instanceof Error) { - const msg = 'the protobuf request could not be decoded' - throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true) + const msg = "the protobuf request could not be decoded"; + throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true); } } @@ -385,15 +671,15 @@ async function handleArtifactServiceCreateArtifactProtobuf< T, CreateArtifactRequest, CreateArtifactResponse - > + >; response = await interceptor(ctx, request!, (ctx, inputReq) => { - return service.CreateArtifact(ctx, inputReq) - }) + return service.CreateArtifact(ctx, inputReq); + }); } else { - response = await service.CreateArtifact(ctx, request!) + response = await service.CreateArtifact(ctx, request!); } - return Buffer.from(CreateArtifactResponse.toBinary(response)) + return Buffer.from(CreateArtifactResponse.toBinary(response)); } async function handleArtifactServiceFinalizeArtifactProtobuf< @@ -408,15 +694,15 @@ async function handleArtifactServiceFinalizeArtifactProtobuf< FinalizeArtifactResponse >[] ) { - let request: FinalizeArtifactRequest - let response: FinalizeArtifactResponse + let request: FinalizeArtifactRequest; + let response: FinalizeArtifactResponse; try { - request = FinalizeArtifactRequest.fromBinary(data) + request = FinalizeArtifactRequest.fromBinary(data); } catch (e) { if (e instanceof Error) { - const msg = 'the protobuf request could not be decoded' - throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true) + const msg = "the protobuf request could not be decoded"; + throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true); } } @@ -425,13 +711,89 @@ async function handleArtifactServiceFinalizeArtifactProtobuf< T, FinalizeArtifactRequest, FinalizeArtifactResponse - > + >; response = await interceptor(ctx, request!, (ctx, inputReq) => { - return service.FinalizeArtifact(ctx, inputReq) - }) + return service.FinalizeArtifact(ctx, inputReq); + }); } else { - response = await service.FinalizeArtifact(ctx, request!) + response = await service.FinalizeArtifact(ctx, request!); } - return Buffer.from(FinalizeArtifactResponse.toBinary(response)) + return Buffer.from(FinalizeArtifactResponse.toBinary(response)); +} + +async function handleArtifactServiceListArtifactsProtobuf< + T extends TwirpContext = TwirpContext +>( + ctx: T, + service: ArtifactServiceTwirp, + data: Buffer, + interceptors?: Interceptor[] +) { + let request: ListArtifactsRequest; + let response: ListArtifactsResponse; + + try { + request = ListArtifactsRequest.fromBinary(data); + } catch (e) { + if (e instanceof Error) { + const msg = "the protobuf request could not be decoded"; + throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true); + } + } + + if (interceptors && interceptors.length > 0) { + const interceptor = chainInterceptors(...interceptors) as Interceptor< + T, + ListArtifactsRequest, + ListArtifactsResponse + >; + response = await interceptor(ctx, request!, (ctx, inputReq) => { + return service.ListArtifacts(ctx, inputReq); + }); + } else { + response = await service.ListArtifacts(ctx, request!); + } + + return Buffer.from(ListArtifactsResponse.toBinary(response)); +} + +async function handleArtifactServiceGetSignedArtifactURLProtobuf< + T extends TwirpContext = TwirpContext +>( + ctx: T, + service: ArtifactServiceTwirp, + data: Buffer, + interceptors?: Interceptor< + T, + GetSignedArtifactURLRequest, + GetSignedArtifactURLResponse + >[] +) { + let request: GetSignedArtifactURLRequest; + let response: GetSignedArtifactURLResponse; + + try { + request = GetSignedArtifactURLRequest.fromBinary(data); + } catch (e) { + if (e instanceof Error) { + const msg = "the protobuf request could not be decoded"; + throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true); + } + } + + if (interceptors && interceptors.length > 0) { + const interceptor = chainInterceptors(...interceptors) as Interceptor< + T, + GetSignedArtifactURLRequest, + GetSignedArtifactURLResponse + >; + response = await interceptor(ctx, request!, (ctx, inputReq) => { + return service.GetSignedArtifactURL(ctx, inputReq); + }); + } else { + response = await service.GetSignedArtifactURL(ctx, request!); + } + + return Buffer.from(GetSignedArtifactURLResponse.toBinary(response)); } diff --git a/packages/artifact/src/internal/client.ts b/packages/artifact/src/internal/client.ts index 6ffc632c..c32611b6 100644 --- a/packages/artifact/src/internal/client.ts +++ b/packages/artifact/src/internal/client.ts @@ -6,12 +6,16 @@ import { DownloadArtifactOptions, GetArtifactResponse, ListArtifactsResponse, - DownloadArtifactResponse + DownloadArtifactResponse, + LookupOptions } from './shared/interfaces' import {uploadArtifact} from './upload/upload-artifact' -import {downloadArtifact} from './download/download-artifact' -import {getArtifact} from './find/get-artifact' -import {listArtifacts} from './find/list-artifacts' +import { + downloadArtifactPublic, + downloadArtifactInternal +} from './download/download-artifact' +import {getArtifactPublic, getArtifactInternal} from './find/get-artifact' +import {listArtifactsPublic, listArtifactsInternal} from './find/list-artifacts' export interface ArtifactClient { /** @@ -31,62 +35,46 @@ export interface ArtifactClient { ): Promise /** - * Lists all artifacts that are part of a workflow run. + * Lists all artifacts that are part of the current workflow run. + * This function will return at most 1000 artifacts per workflow run. * - * This calls the public List-Artifacts API https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts - * Due to paginated responses from the public API. This function will return at most 1000 artifacts per workflow run (100 per page * maximum 10 calls) + * If options.token is specified, this will call the public List-Artifacts API which can list from other runs. + * https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts * - * @param workflowRunId The workflow run id that the artifact belongs to - * @param repositoryOwner The owner of the repository that the artifact belongs to - * @param repositoryName The name of the repository that the artifact belongs to - * @param token A token with the appropriate permission to the repository to list artifacts + * @param options Extra options that allow for the customization of the list behavior * @returns ListArtifactResponse object */ - listArtifacts( - workflowRunId: number, - repositoryOwner: string, - repositoryName: string, - token: string - ): Promise + listArtifacts(options?: LookupOptions): Promise /** - * Finds an artifact by name given a repository and workflow run id. + * Finds an artifact by name. * - * This calls the public List-Artifacts API with a name filter https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts + * If options.token is specified, this will use the public List Artifacts API with a name filter which can get artifacts from other runs. + * https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts * @actions/artifact > 2.0.0 does not allow for creating multiple artifacts with the same name in the same workflow run. - * It is possible to have multiple artifacts with the same name in the same workflow run by using old versions of upload-artifact (v1,v2 and v3) or @actions/artifact < v2.0.0 + * It is possible to have multiple artifacts with the same name in the same workflow run by using old versions of upload-artifact (v1,v2 and v3), @actions/artifact < v2.0.0 or it is a rerun. * If there are multiple artifacts with the same name in the same workflow run this function will return the first artifact that matches the name. * * @param artifactName The name of the artifact to find - * @param workflowRunId The workflow run id that the artifact belongs to - * @param repositoryOwner The owner of the repository that the artifact belongs to - * @param repositoryName The name of the repository that the artifact belongs to - * @param token A token with the appropriate permission to the repository to find the artifact + * @param options Extra options that allow for the customization of the get behavior */ getArtifact( artifactName: string, - workflowRunId: number, - repositoryOwner: string, - repositoryName: string, - token: string + options?: LookupOptions ): Promise /** - * Downloads an artifact and unzips the content + * Downloads an artifact and unzips the content. + * + * If options.token is specified, this will use the public Download Artifact API https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#download-an-artifact * * @param artifactId The name of the artifact to download - * @param repositoryOwner The owner of the repository that the artifact belongs to - * @param repositoryName The name of the repository that the artifact belongs to - * @param token A token with the appropriate permission to the repository to download the artifact * @param options Extra options that allow for the customization of the download behavior * @returns single DownloadArtifactResponse object */ downloadArtifact( artifactId: number, - repositoryOwner: string, - repositoryName: string, - token: string, - options?: DownloadArtifactOptions + options?: DownloadArtifactOptions & LookupOptions ): Promise } @@ -137,10 +125,7 @@ If the error persists, please check whether Actions is operating normally at [ht */ async downloadArtifact( artifactId: number, - repositoryOwner: string, - repositoryName: string, - token: string, - options?: DownloadArtifactOptions + options?: DownloadArtifactOptions & LookupOptions ): Promise { if (isGhes()) { warning( @@ -152,13 +137,19 @@ If the error persists, please check whether Actions is operating normally at [ht } try { - return downloadArtifact( - artifactId, - repositoryOwner, - repositoryName, - token, - options - ) + if (options?.token) { + const {repositoryOwner, repositoryName, token, ...downloadOptions} = + options + return downloadArtifactPublic( + artifactId, + repositoryOwner, + repositoryName, + token, + downloadOptions + ) + } + + return downloadArtifactInternal(artifactId) } catch (error) { warning( `Artifact download failed with error: ${error}. @@ -177,12 +168,7 @@ If the error persists, please check whether Actions and API requests are operati /** * List Artifacts */ - async listArtifacts( - workflowRunId: number, - repositoryOwner: string, - repositoryName: string, - token: string - ): Promise { + async listArtifacts(options?: LookupOptions): Promise { if (isGhes()) { warning( `@actions/artifact v2.0.0+ and download-artifact@v4+ are not currently supported on GHES.` @@ -193,12 +179,16 @@ If the error persists, please check whether Actions and API requests are operati } try { - return listArtifacts( - workflowRunId, - repositoryOwner, - repositoryName, - token - ) + if (options?.token) { + return listArtifactsPublic( + options.workflowRunId, + options.repositoryOwner, + options.repositoryName, + options.token + ) + } + + return listArtifactsInternal() } catch (error: unknown) { warning( `Listing Artifacts failed with error: ${error}. @@ -219,10 +209,7 @@ If the error persists, please check whether Actions and API requests are operati */ async getArtifact( artifactName: string, - workflowRunId: number, - repositoryOwner: string, - repositoryName: string, - token: string + options?: LookupOptions ): Promise { if (isGhes()) { warning( @@ -234,13 +221,17 @@ If the error persists, please check whether Actions and API requests are operati } try { - return getArtifact( - artifactName, - workflowRunId, - repositoryOwner, - repositoryName, - token - ) + if (options?.token) { + return getArtifactPublic( + artifactName, + options.workflowRunId, + options.repositoryOwner, + options.repositoryName, + options.token + ) + } + + return getArtifactInternal(artifactName) } catch (error: unknown) { warning( `Fetching Artifact failed with error: ${error}. diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 6301bfb5..ad629d5c 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -9,6 +9,9 @@ import { } from '../shared/interfaces' import {getUserAgentString} from '../shared/user-agent' import {getGitHubWorkspaceDir} from '../shared/config' +import {internalArtifactTwirpClient} from '../shared/artifact-twirp-client' +import {GetSignedArtifactURLRequest, ListArtifactsRequest} from 'src/generated' +import {getBackendIdsFromToken} from '../shared/util' const scrubQueryParameters = (url: string): string => { const parsed = new URL(url) @@ -42,23 +45,14 @@ async function streamExtract(url: string, directory: string): Promise { return response.message.pipe(unzipper.Extract({path: directory})).promise() } -export async function downloadArtifact( +export async function downloadArtifactPublic( artifactId: number, repositoryOwner: string, repositoryName: string, token: string, options?: DownloadArtifactOptions ): Promise { - const downloadPath = options?.path || getGitHubWorkspaceDir() - - if (!(await exists(downloadPath))) { - core.debug( - `Artifact destination folder does not exist, creating: ${downloadPath}` - ) - await fs.mkdir(downloadPath, {recursive: true}) - } else { - core.debug(`Artifact destination folder already exists: ${downloadPath}`) - } + const downloadPath = await resolveOrCreateDirectory(options?.path) const api = github.getOctokit(token) @@ -99,3 +93,72 @@ export async function downloadArtifact( return {success: true, downloadPath} } + +export async function downloadArtifactInternal( + artifactId: number, + options?: DownloadArtifactOptions +): Promise { + const downloadPath = await resolveOrCreateDirectory(options?.path) + + const artifactClient = internalArtifactTwirpClient() + + const {workflowRunBackendId, workflowJobRunBackendId} = + getBackendIdsFromToken() + + const listReq: ListArtifactsRequest = { + workflowRunBackendId, + workflowJobRunBackendId, + nameFilter: '', + idFilter: '0' // TODO(robherley): zero values are awkward, use pb wrappers + } + + const {artifacts} = await artifactClient.ListArtifacts(listReq) + + if (artifacts.length === 0) { + core.warning( + `No artifacts found for ID: ${artifactId}\nAre you trying to download from a different run? Try specifying a github-token with \`actions:read\` scope.` + ) + return {success: false} + } + + if (artifacts.length > 1) { + core.warning('Multiple artifacts found, defaulting to first.') + } + + const signedReq: GetSignedArtifactURLRequest = { + workflowRunBackendId: artifacts[0].workflowRunBackendId, + workflowJobRunBackendId: artifacts[0].workflowJobRunBackendId, + name: artifacts[0].name + } + + const {signedUrl} = await artifactClient.GetSignedArtifactURL(signedReq) + + core.info( + `Redirecting to blob download url: ${scrubQueryParameters(signedUrl)}` + ) + + try { + core.info(`Starting download of artifact to: ${downloadPath}`) + await streamExtract(signedUrl, downloadPath) + core.info(`Artifact download completed successfully.`) + } catch (error) { + throw new Error(`Unable to download and extract artifact: ${error.message}`) + } + + return {success: true, downloadPath} +} + +async function resolveOrCreateDirectory( + downloadPath = getGitHubWorkspaceDir() +): Promise { + if (!(await exists(downloadPath))) { + core.debug( + `Artifact destination folder does not exist, creating: ${downloadPath}` + ) + await fs.mkdir(downloadPath, {recursive: true}) + } else { + core.debug(`Artifact destination folder already exists: ${downloadPath}`) + } + + return downloadPath +} diff --git a/packages/artifact/src/internal/find/get-artifact.ts b/packages/artifact/src/internal/find/get-artifact.ts index 24c38a99..5112f573 100644 --- a/packages/artifact/src/internal/find/get-artifact.ts +++ b/packages/artifact/src/internal/find/get-artifact.ts @@ -1,14 +1,17 @@ -import {GetArtifactResponse} from '../shared/interfaces' import {getOctokit} from '@actions/github' -import {getUserAgentString} from '../shared/user-agent' -import {defaults as defaultGitHubOptions} from '@actions/github/lib/utils' -import {getRetryOptions} from './retry-options' -import {requestLog} from '@octokit/plugin-request-log' import {retry} from '@octokit/plugin-retry' import * as core from '@actions/core' import {OctokitOptions} from '@octokit/core/dist-types/types' +import {defaults as defaultGitHubOptions} from '@actions/github/lib/utils' +import {getRetryOptions} from './retry-options' +import {requestLog} from '@octokit/plugin-request-log' +import {GetArtifactResponse} from '../shared/interfaces' +import {getBackendIdsFromToken} from '../shared/util' +import {getUserAgentString} from '../shared/user-agent' +import {internalArtifactTwirpClient} from '../shared/artifact-twirp-client' +import {ListArtifactsRequest} from '../../generated' -export async function getArtifact( +export async function getArtifactPublic( artifactName: string, workflowRunId: number, repositoryOwner: string, @@ -62,8 +65,55 @@ export async function getArtifact( artifact: { name: getArtifactResp.data.artifacts[0].name, id: getArtifactResp.data.artifacts[0].id, - url: getArtifactResp.data.artifacts[0].url, size: getArtifactResp.data.artifacts[0].size_in_bytes } } } + +export async function getArtifactInternal( + artifactName: string +): Promise { + const artifactClient = internalArtifactTwirpClient() + + const {workflowRunBackendId, workflowJobRunBackendId} = + getBackendIdsFromToken() + + const req: ListArtifactsRequest = { + workflowRunBackendId, + workflowJobRunBackendId, + nameFilter: artifactName, + idFilter: '0' // TODO(robherley): int64 zero value, change this to be optional + } + + const res = await artifactClient.ListArtifacts(req) + + if (res.artifacts.length === 0) { + core.warning('no artifacts found') + return { + success: false + } + } + + if (res.artifacts.length > 1) { + core.warning( + 'more than one artifact found for a single name, returning first' + ) + } + + // In the case of reruns, we may have artifacts with the same name scoped under the same workflow run. + // Let's prefer the artifact closest scoped to this run. + // If it doesn't exist (e.g. partial rerun) we'll use the first match. + const artifact = + res.artifacts.find( + artifact => artifact.workflowRunBackendId === workflowRunBackendId + ) || res.artifacts[0] + + return { + success: true, + artifact: { + name: artifact.name, + id: Number(artifact.databaseId), + size: Number(artifact.size) + } + } +} diff --git a/packages/artifact/src/internal/find/list-artifacts.ts b/packages/artifact/src/internal/find/list-artifacts.ts index ea15fb36..7a23aea1 100644 --- a/packages/artifact/src/internal/find/list-artifacts.ts +++ b/packages/artifact/src/internal/find/list-artifacts.ts @@ -7,13 +7,16 @@ import {defaults as defaultGitHubOptions} from '@actions/github/lib/utils' import {requestLog} from '@octokit/plugin-request-log' import {retry} from '@octokit/plugin-retry' import {OctokitOptions} from '@octokit/core/dist-types/types' +import {internalArtifactTwirpClient} from '../shared/artifact-twirp-client' +import {getBackendIdsFromToken} from '../shared/util' +import {ListArtifactsRequest} from 'src/generated' // Limiting to 1000 for perf reasons const maximumArtifactCount = 1000 const paginationCount = 100 const maxNumberOfPages = maximumArtifactCount / paginationCount -export async function listArtifacts( +export async function listArtifactsPublic( workflowRunId: number, repositoryOwner: string, repositoryName: string, @@ -62,7 +65,6 @@ export async function listArtifacts( artifacts.push({ name: artifact.name, id: artifact.id, - url: artifact.url, size: artifact.size_in_bytes }) } @@ -89,13 +91,39 @@ export async function listArtifacts( artifacts.push({ name: artifact.name, id: artifact.id, - url: artifact.url, size: artifact.size_in_bytes }) } } - info(`Finished fetching artifact list`) + info(`Found ${artifacts.length} artifact(s)`) + + return { + artifacts + } +} + +export async function listArtifactsInternal(): Promise { + const artifactClient = internalArtifactTwirpClient() + + const {workflowRunBackendId, workflowJobRunBackendId} = + getBackendIdsFromToken() + + const req: ListArtifactsRequest = { + workflowRunBackendId, + workflowJobRunBackendId, + nameFilter: '', + idFilter: '0' // TODO(robherley): zero values are awkward, use pb wrappers + } + + const res = await artifactClient.ListArtifacts(req) + const artifacts = res.artifacts.map(artifact => ({ + name: artifact.name, + id: Number(artifact.databaseId), + size: Number(artifact.size) + })) + + info(`Found ${artifacts.length} artifact(s)`) return { artifacts diff --git a/packages/artifact/src/internal/shared/artifact-twirp-client.ts b/packages/artifact/src/internal/shared/artifact-twirp-client.ts index 09355808..2498ba3f 100644 --- a/packages/artifact/src/internal/shared/artifact-twirp-client.ts +++ b/packages/artifact/src/internal/shared/artifact-twirp-client.ts @@ -3,6 +3,7 @@ import {BearerCredentialHandler} from '@actions/http-client/lib/auth' import {info, debug} from '@actions/core' import {ArtifactServiceClientJSON} from '../../generated' import {getResultsServiceUrl, getRuntimeToken} from './config' +import {getUserAgentString} from './user-agent' // The twirp http client must implement this interface interface Rpc { @@ -157,17 +158,16 @@ class ArtifactHttpClient implements Rpc { } } -export function createArtifactTwirpClient( - type: 'upload' | 'download', - maxAttempts?: number, - baseRetryIntervalMilliseconds?: number, +export function internalArtifactTwirpClient(options?: { + maxAttempts?: number + baseRetryIntervalMilliseconds?: number retryMultiplier?: number -): ArtifactServiceClientJSON { +}): ArtifactServiceClientJSON { const client = new ArtifactHttpClient( - `@actions/artifact-${type}`, - maxAttempts, - baseRetryIntervalMilliseconds, - retryMultiplier + getUserAgentString(), + options?.maxAttempts, + options?.baseRetryIntervalMilliseconds, + options?.retryMultiplier ) return new ArtifactServiceClientJSON(client) } diff --git a/packages/artifact/src/internal/shared/interfaces.ts b/packages/artifact/src/internal/shared/interfaces.ts index b160d1be..a312c5db 100644 --- a/packages/artifact/src/internal/shared/interfaces.ts +++ b/packages/artifact/src/internal/shared/interfaces.ts @@ -120,13 +120,21 @@ export interface Artifact { */ id: number - /** - * The URL of the artifact - */ - url: string - /** * The size of the artifact in bytes */ size: number } + +// LookupOptions are for fetching Artifact(s) out of the scope of the current run. +// Must specify a PAT with actions:read scope for cross run/repo lookup otherwise these will be ignored. +export interface LookupOptions { + // Token with actions:read permissions + token: string + // WorkflowRun of the artifact(s) to lookup + workflowRunId: number + // Repository owner + repositoryOwner: string + // Repository name + repositoryName: string +} diff --git a/packages/artifact/src/internal/shared/util.ts b/packages/artifact/src/internal/shared/util.ts index bc98abde..07392b36 100644 --- a/packages/artifact/src/internal/shared/util.ts +++ b/packages/artifact/src/internal/shared/util.ts @@ -1,3 +1,4 @@ +import * as core from '@actions/core' import {getRuntimeToken} from './config' import jwt_decode from 'jwt-decode' @@ -11,7 +12,7 @@ interface ActionsToken { } const InvalidJwtError = new Error( - 'Failed to get backend IDs: The provided JWT token is invalid' + 'Failed to get backend IDs: The provided JWT token is invalid and/or missing claims' ) // uses the JWT token claims to get the @@ -41,24 +42,29 @@ export function getBackendIdsFromToken(): BackendIds { for (const scopes of scpParts) { const scopeParts = scopes.split(':') + if (scopeParts?.[0] !== 'Actions.Results') { + // not the Actions.Results scope + continue + } + /* * example scopeParts: * ["Actions.Results", "ce7f54c7-61c7-4aae-887f-30da475f5f1a", "ca395085-040a-526b-2ce8-bdc85f692774"] */ if (scopeParts.length !== 3) { - // not the Actions.Results scope - continue + // missing expected number of claims + throw InvalidJwtError } - if (scopeParts[0] !== 'Actions.Results') { - // not the Actions.Results scope - continue - } - - return { + const ids = { workflowRunBackendId: scopeParts[1], workflowJobRunBackendId: scopeParts[2] } + + core.debug(`Workflow Run Backend ID: ${ids.workflowRunBackendId}`) + core.debug(`Workflow Job Run Backend ID: ${ids.workflowJobRunBackendId}`) + + return ids } throw InvalidJwtError diff --git a/packages/artifact/src/internal/upload/upload-artifact.ts b/packages/artifact/src/internal/upload/upload-artifact.ts index bcc91ec8..011dc4c8 100644 --- a/packages/artifact/src/internal/upload/upload-artifact.ts +++ b/packages/artifact/src/internal/upload/upload-artifact.ts @@ -2,7 +2,7 @@ import * as core from '@actions/core' import {UploadOptions, UploadResponse} from '../shared/interfaces' import {getExpiration} from './retention' import {validateArtifactName} from './path-and-artifact-name-validation' -import {createArtifactTwirpClient} from '../shared/artifact-twirp-client' +import {internalArtifactTwirpClient} from '../shared/artifact-twirp-client' import { UploadZipSpecification, getUploadZipSpecification, @@ -44,21 +44,9 @@ export async function uploadArtifact( // get the IDs needed for the artifact creation const backendIds = getBackendIdsFromToken() - if (!backendIds.workflowRunBackendId || !backendIds.workflowJobRunBackendId) { - core.warning( - `Failed to get the necessary backend ids which are required to create the artifact` - ) - return { - success: false - } - } - core.debug(`Workflow Run Backend ID: ${backendIds.workflowRunBackendId}`) - core.debug( - `Workflow Job Run Backend ID: ${backendIds.workflowJobRunBackendId}` - ) // create the artifact client - const artifactClient = createArtifactTwirpClient('upload') + const artifactClient = internalArtifactTwirpClient() // create the artifact const createArtifactReq: CreateArtifactRequest = { From e9d6649a14353dd890397906964a1a25169e4ba8 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Thu, 30 Nov 2023 19:10:07 +0000 Subject: [PATCH 010/198] consume new pb wrappers --- .../src/generated/results/api/v1/artifact.ts | 39 ++++++++++--------- .../internal/download/download-artifact.ts | 4 +- .../src/internal/find/get-artifact.ts | 5 +-- .../src/internal/find/list-artifacts.ts | 4 +- 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/packages/artifact/src/generated/results/api/v1/artifact.ts b/packages/artifact/src/generated/results/api/v1/artifact.ts index 7acbd3aa..adabae5e 100644 --- a/packages/artifact/src/generated/results/api/v1/artifact.ts +++ b/packages/artifact/src/generated/results/api/v1/artifact.ts @@ -12,6 +12,7 @@ import type { PartialMessage } from "@protobuf-ts/runtime"; import { reflectionMergePartial } from "@protobuf-ts/runtime"; import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; import { MessageType } from "@protobuf-ts/runtime"; +import { Int64Value } from "../../../google/protobuf/wrappers"; import { StringValue } from "../../../google/protobuf/wrappers"; import { Timestamp } from "../../../google/protobuf/timestamp"; /** @@ -107,17 +108,17 @@ export interface ListArtifactsRequest { */ workflowJobRunBackendId: string; /** - * (optional) Name of the artifact to filter on + * Name of the artifact to filter on * - * @generated from protobuf field: string name_filter = 3; + * @generated from protobuf field: google.protobuf.StringValue name_filter = 3; */ - nameFilter: string; + nameFilter?: StringValue; // optional /** - * (optional) Monolith Database ID of the artifact to filter on + * Monolith Database ID of the artifact to filter on * - * @generated from protobuf field: int64 id_filter = 4; + * @generated from protobuf field: google.protobuf.Int64Value id_filter = 4; */ - idFilter: string; + idFilter?: Int64Value; // optional } /** * @generated from protobuf message github.actions.results.api.v1.ListArtifactsResponse @@ -453,12 +454,12 @@ class ListArtifactsRequest$Type extends MessageType { super("github.actions.results.api.v1.ListArtifactsRequest", [ { no: 1, name: "workflow_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "workflow_job_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "name_filter", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "id_filter", kind: "scalar", T: 3 /*ScalarType.INT64*/ } + { no: 3, name: "name_filter", kind: "message", T: () => StringValue }, + { no: 4, name: "id_filter", kind: "message", T: () => Int64Value } ]); } create(value?: PartialMessage): ListArtifactsRequest { - const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", nameFilter: "", idFilter: "0" }; + const message = { workflowRunBackendId: "", workflowJobRunBackendId: "" }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -475,11 +476,11 @@ class ListArtifactsRequest$Type extends MessageType { case /* string workflow_job_run_backend_id */ 2: message.workflowJobRunBackendId = reader.string(); break; - case /* string name_filter */ 3: - message.nameFilter = reader.string(); + case /* google.protobuf.StringValue name_filter */ 3: + message.nameFilter = StringValue.internalBinaryRead(reader, reader.uint32(), options, message.nameFilter); break; - case /* int64 id_filter */ 4: - message.idFilter = reader.int64().toString(); + case /* google.protobuf.Int64Value id_filter */ 4: + message.idFilter = Int64Value.internalBinaryRead(reader, reader.uint32(), options, message.idFilter); break; default: let u = options.readUnknownField; @@ -499,12 +500,12 @@ class ListArtifactsRequest$Type extends MessageType { /* string workflow_job_run_backend_id = 2; */ if (message.workflowJobRunBackendId !== "") writer.tag(2, WireType.LengthDelimited).string(message.workflowJobRunBackendId); - /* string name_filter = 3; */ - if (message.nameFilter !== "") - writer.tag(3, WireType.LengthDelimited).string(message.nameFilter); - /* int64 id_filter = 4; */ - if (message.idFilter !== "0") - writer.tag(4, WireType.Varint).int64(message.idFilter); + /* google.protobuf.StringValue name_filter = 3; */ + if (message.nameFilter) + StringValue.internalBinaryWrite(message.nameFilter, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* google.protobuf.Int64Value id_filter = 4; */ + if (message.idFilter) + Int64Value.internalBinaryWrite(message.idFilter, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index ad629d5c..ae8d4c4a 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -107,9 +107,7 @@ export async function downloadArtifactInternal( const listReq: ListArtifactsRequest = { workflowRunBackendId, - workflowJobRunBackendId, - nameFilter: '', - idFilter: '0' // TODO(robherley): zero values are awkward, use pb wrappers + workflowJobRunBackendId } const {artifacts} = await artifactClient.ListArtifacts(listReq) diff --git a/packages/artifact/src/internal/find/get-artifact.ts b/packages/artifact/src/internal/find/get-artifact.ts index 5112f573..c15a653b 100644 --- a/packages/artifact/src/internal/find/get-artifact.ts +++ b/packages/artifact/src/internal/find/get-artifact.ts @@ -9,7 +9,7 @@ import {GetArtifactResponse} from '../shared/interfaces' import {getBackendIdsFromToken} from '../shared/util' import {getUserAgentString} from '../shared/user-agent' import {internalArtifactTwirpClient} from '../shared/artifact-twirp-client' -import {ListArtifactsRequest} from '../../generated' +import {ListArtifactsRequest, StringValue} from '../../generated' export async function getArtifactPublic( artifactName: string, @@ -81,8 +81,7 @@ export async function getArtifactInternal( const req: ListArtifactsRequest = { workflowRunBackendId, workflowJobRunBackendId, - nameFilter: artifactName, - idFilter: '0' // TODO(robherley): int64 zero value, change this to be optional + nameFilter: StringValue.create({value: artifactName}) } const res = await artifactClient.ListArtifacts(req) diff --git a/packages/artifact/src/internal/find/list-artifacts.ts b/packages/artifact/src/internal/find/list-artifacts.ts index 7a23aea1..c25a58bd 100644 --- a/packages/artifact/src/internal/find/list-artifacts.ts +++ b/packages/artifact/src/internal/find/list-artifacts.ts @@ -111,9 +111,7 @@ export async function listArtifactsInternal(): Promise { const req: ListArtifactsRequest = { workflowRunBackendId, - workflowJobRunBackendId, - nameFilter: '', - idFilter: '0' // TODO(robherley): zero values are awkward, use pb wrappers + workflowJobRunBackendId } const res = await artifactClient.ListArtifacts(req) From 22b7aeb7079b82842b477f159d47cc080dee7861 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Fri, 1 Dec 2023 00:31:27 +0000 Subject: [PATCH 011/198] some test updates --- .../__tests__/artifact-http-client.test.ts | 47 +-- packages/artifact/__tests__/common.test.ts | 9 + .../__tests__/download-artifact.test.ts | 374 +++++++++--------- .../path-and-artifact-name-validation.test.ts | 8 +- .../__tests__/upload-artifact.test.ts | 8 +- .../upload-zip-specification.test.ts | 8 +- packages/artifact/__tests__/util.test.ts | 9 +- packages/artifact/package.json | 2 +- .../internal/download/download-artifact.ts | 5 +- .../internal/shared/artifact-twirp-client.ts | 4 +- 10 files changed, 237 insertions(+), 237 deletions(-) create mode 100644 packages/artifact/__tests__/common.test.ts diff --git a/packages/artifact/__tests__/artifact-http-client.test.ts b/packages/artifact/__tests__/artifact-http-client.test.ts index 37908111..31bd24c3 100644 --- a/packages/artifact/__tests__/artifact-http-client.test.ts +++ b/packages/artifact/__tests__/artifact-http-client.test.ts @@ -2,18 +2,14 @@ import * as http from 'http' import * as net from 'net' import {HttpClient} from '@actions/http-client' import * as config from '../src/internal/shared/config' -import {createArtifactTwirpClient} from '../src/internal/shared/artifact-twirp-client' -import * as core from '@actions/core' +import {internalArtifactTwirpClient} from '../src/internal/shared/artifact-twirp-client' +import {noopLogs} from './common.test' jest.mock('@actions/http-client') describe('artifact-http-client', () => { beforeAll(() => { - // mock all output so that there is less noise when running tests - jest.spyOn(console, 'log').mockImplementation(() => {}) - jest.spyOn(core, 'debug').mockImplementation(() => {}) - jest.spyOn(core, 'info').mockImplementation(() => {}) - jest.spyOn(core, 'warning').mockImplementation(() => {}) + noopLogs() jest .spyOn(config, 'getResultsServiceUrl') .mockReturnValue('http://localhost:8080') @@ -25,7 +21,7 @@ describe('artifact-http-client', () => { }) it('should successfully create a client', () => { - const client = createArtifactTwirpClient('upload') + const client = internalArtifactTwirpClient() expect(client).toBeDefined() }) @@ -50,7 +46,7 @@ describe('artifact-http-client', () => { } }) - const client = createArtifactTwirpClient('upload') + const client = internalArtifactTwirpClient() const artifact = await client.CreateArtifact({ workflowRunBackendId: '1234', workflowJobRunBackendId: '5678', @@ -98,12 +94,11 @@ describe('artifact-http-client', () => { } }) - const client = createArtifactTwirpClient( - 'upload', - 5, // retry 5 times - 1, // wait 1 ms - 1.5 // backoff factor - ) + const client = internalArtifactTwirpClient({ + maxAttempts: 5, + retryIntervalMs: 1, + retryMultiplier: 1.5 + }) const artifact = await client.CreateArtifact({ workflowRunBackendId: '1234', workflowJobRunBackendId: '5678', @@ -138,12 +133,11 @@ describe('artifact-http-client', () => { post: mockPost } }) - const client = createArtifactTwirpClient( - 'upload', - 5, // retry 5 times - 1, // wait 1 ms - 1.5 // backoff factor - ) + const client = internalArtifactTwirpClient({ + maxAttempts: 5, + retryIntervalMs: 1, + retryMultiplier: 1.5 + }) await expect(async () => { await client.CreateArtifact({ workflowRunBackendId: '1234', @@ -178,12 +172,11 @@ describe('artifact-http-client', () => { post: mockPost } }) - const client = createArtifactTwirpClient( - 'upload', - 5, // retry 5 times - 1, // wait 1 ms - 1.5 // backoff factor - ) + const client = internalArtifactTwirpClient({ + maxAttempts: 5, + retryIntervalMs: 1, + retryMultiplier: 1.5 + }) await expect(async () => { await client.CreateArtifact({ workflowRunBackendId: '1234', diff --git a/packages/artifact/__tests__/common.test.ts b/packages/artifact/__tests__/common.test.ts new file mode 100644 index 00000000..02955f10 --- /dev/null +++ b/packages/artifact/__tests__/common.test.ts @@ -0,0 +1,9 @@ +import * as core from '@actions/core' + +// noopLogs mocks the console.log and core.* functions to prevent output in the console while testing +export const noopLogs = (): void => { + // jest.spyOn(console, 'log').mockImplementation(() => {}) + jest.spyOn(core, 'debug').mockImplementation(() => {}) + jest.spyOn(core, 'info').mockImplementation(() => {}) + jest.spyOn(core, 'warning').mockImplementation(() => {}) +} diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index e86cb3a7..8f80ff76 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -2,14 +2,14 @@ import fs from 'fs' import * as http from 'http' import * as net from 'net' import * as path from 'path' -import * as core from '@actions/core' import * as github from '@actions/github' import {HttpClient} from '@actions/http-client' import type {RestEndpointMethods} from '@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types' import archiver from 'archiver' -import {downloadArtifact} from '../src/internal/download/download-artifact' +import {downloadArtifactPublic} from '../src/internal/download/download-artifact' import {getUserAgentString} from '../src/internal/shared/user-agent' +import {noopLogs} from './common.test' type MockedDownloadArtifact = jest.MockedFunction< RestEndpointMethods['actions']['downloadArtifact'] @@ -74,206 +74,214 @@ const expectExtractedArchive = async (dir: string): Promise => { } } +const setup = async (): Promise => { + noopLogs() + await fs.promises.mkdir(testDir, {recursive: true}) + await createTestArchive() + + process.env['GITHUB_WORKSPACE'] = fixtures.workspaceDir +} + +const cleanup = async (): Promise => { + jest.restoreAllMocks() + await fs.promises.rm(testDir, {recursive: true}) + delete process.env['GITHUB_WORKSPACE'] +} + describe('download-artifact', () => { - beforeEach(async () => { - jest.spyOn(core, 'debug').mockImplementation(() => {}) - jest.spyOn(core, 'info').mockImplementation(() => {}) - jest.spyOn(core, 'warning').mockImplementation(() => {}) + describe('public', () => { + beforeEach(setup) + afterEach(cleanup) - await fs.promises.mkdir(testDir, {recursive: true}) - await createTestArchive() + it('should successfully download an artifact to $GITHUB_WORKSPACE', async () => { + const downloadArtifactMock = github.getOctokit(fixtures.token).rest + .actions.downloadArtifact as MockedDownloadArtifact + downloadArtifactMock.mockResolvedValueOnce({ + headers: { + location: fixtures.blobStorageUrl + }, + status: 302, + url: '', + data: Buffer.from('') + }) - process.env['GITHUB_WORKSPACE'] = fixtures.workspaceDir - }) + const getMock = jest.fn(() => { + const message = new http.IncomingMessage(new net.Socket()) + message.statusCode = 200 + message.push(fs.readFileSync(fixtures.exampleArtifact.path)) + return { + message + } + }) + const httpClientMock = (HttpClient as jest.Mock).mockImplementation( + () => { + return { + get: getMock + } + } + ) - afterEach(async () => { - jest.restoreAllMocks() - await fs.promises.rm(testDir, {recursive: true}) - delete process.env['GITHUB_WORKSPACE'] - }) - - it('should successfully download an artifact to $GITHUB_WORKSPACE', async () => { - const downloadArtifactMock = github.getOctokit(fixtures.token).rest.actions - .downloadArtifact as MockedDownloadArtifact - downloadArtifactMock.mockResolvedValueOnce({ - headers: { - location: fixtures.blobStorageUrl - }, - status: 302, - url: '', - data: Buffer.from('') - }) - - const getMock = jest.fn(() => { - const message = new http.IncomingMessage(new net.Socket()) - message.statusCode = 200 - message.push(fs.readFileSync(fixtures.exampleArtifact.path)) - return { - message - } - }) - const httpClientMock = (HttpClient as jest.Mock).mockImplementation(() => { - return { - get: getMock - } - }) - - const response = await downloadArtifact( - fixtures.artifactID, - fixtures.repositoryOwner, - fixtures.repositoryName, - fixtures.token - ) - - expect(downloadArtifactMock).toHaveBeenCalledWith({ - owner: fixtures.repositoryOwner, - repo: fixtures.repositoryName, - artifact_id: fixtures.artifactID, - archive_format: 'zip', - request: { - redirect: 'manual' - } - }) - expect(httpClientMock).toHaveBeenCalledWith(getUserAgentString()) - expect(getMock).toHaveBeenCalledWith(fixtures.blobStorageUrl) - - expectExtractedArchive(fixtures.workspaceDir) - - expect(response.success).toBe(true) - expect(response.downloadPath).toBe(fixtures.workspaceDir) - }) - - it('should successfully download an artifact to user defined path', async () => { - const customPath = path.join(testDir, 'custom') - - const downloadArtifactMock = github.getOctokit(fixtures.token).rest.actions - .downloadArtifact as MockedDownloadArtifact - downloadArtifactMock.mockResolvedValueOnce({ - headers: { - location: fixtures.blobStorageUrl - }, - status: 302, - url: '', - data: Buffer.from('') - }) - - const getMock = jest.fn(() => { - const message = new http.IncomingMessage(new net.Socket()) - message.statusCode = 200 - message.push(fs.readFileSync(fixtures.exampleArtifact.path)) - return { - message - } - }) - const httpClientMock = (HttpClient as jest.Mock).mockImplementation(() => { - return { - get: getMock - } - }) - - const response = await downloadArtifact( - fixtures.artifactID, - fixtures.repositoryOwner, - fixtures.repositoryName, - fixtures.token, - { - path: customPath - } - ) - - expect(downloadArtifactMock).toHaveBeenCalledWith({ - owner: fixtures.repositoryOwner, - repo: fixtures.repositoryName, - artifact_id: fixtures.artifactID, - archive_format: 'zip', - request: { - redirect: 'manual' - } - }) - expect(httpClientMock).toHaveBeenCalledWith(getUserAgentString()) - expect(getMock).toHaveBeenCalledWith(fixtures.blobStorageUrl) - - expectExtractedArchive(customPath) - - expect(response.success).toBe(true) - expect(response.downloadPath).toBe(customPath) - }) - - it('should fail if download artifact API does not respond with location', async () => { - const downloadArtifactMock = github.getOctokit(fixtures.token).rest.actions - .downloadArtifact as MockedDownloadArtifact - downloadArtifactMock.mockResolvedValueOnce({ - headers: {}, - status: 302, - url: '', - data: Buffer.from('') - }) - - await expect( - downloadArtifact( + const response = await downloadArtifactPublic( fixtures.artifactID, fixtures.repositoryOwner, fixtures.repositoryName, fixtures.token ) - ).rejects.toBeInstanceOf(Error) - expect(downloadArtifactMock).toHaveBeenCalledWith({ - owner: fixtures.repositoryOwner, - repo: fixtures.repositoryName, - artifact_id: fixtures.artifactID, - archive_format: 'zip', - request: { - redirect: 'manual' - } - }) - }) + expect(downloadArtifactMock).toHaveBeenCalledWith({ + owner: fixtures.repositoryOwner, + repo: fixtures.repositoryName, + artifact_id: fixtures.artifactID, + archive_format: 'zip', + request: { + redirect: 'manual' + } + }) + expect(httpClientMock).toHaveBeenCalledWith(getUserAgentString()) + expect(getMock).toHaveBeenCalledWith(fixtures.blobStorageUrl) - it('should fail if blob storage response is non-200', async () => { - const downloadArtifactMock = github.getOctokit(fixtures.token).rest.actions - .downloadArtifact as MockedDownloadArtifact - downloadArtifactMock.mockResolvedValueOnce({ - headers: { - location: fixtures.blobStorageUrl - }, - status: 302, - url: '', - data: Buffer.from('') + expectExtractedArchive(fixtures.workspaceDir) + + expect(response.success).toBe(true) + expect(response.downloadPath).toBe(fixtures.workspaceDir) }) - const getMock = jest.fn(() => { - const message = new http.IncomingMessage(new net.Socket()) - message.statusCode = 500 - message.push('Internal Server Error') - return { - message - } - }) - const httpClientMock = (HttpClient as jest.Mock).mockImplementation(() => { - return { - get: getMock - } - }) + it('should successfully download an artifact to user defined path', async () => { + const customPath = path.join(testDir, 'custom') - await expect( - downloadArtifact( + const downloadArtifactMock = github.getOctokit(fixtures.token).rest + .actions.downloadArtifact as MockedDownloadArtifact + downloadArtifactMock.mockResolvedValueOnce({ + headers: { + location: fixtures.blobStorageUrl + }, + status: 302, + url: '', + data: Buffer.from('') + }) + + const getMock = jest.fn(() => { + const message = new http.IncomingMessage(new net.Socket()) + message.statusCode = 200 + message.push(fs.readFileSync(fixtures.exampleArtifact.path)) + return { + message + } + }) + const httpClientMock = (HttpClient as jest.Mock).mockImplementation( + () => { + return { + get: getMock + } + } + ) + + const response = await downloadArtifactPublic( fixtures.artifactID, fixtures.repositoryOwner, fixtures.repositoryName, - fixtures.token + fixtures.token, + { + path: customPath + } ) - ).rejects.toBeInstanceOf(Error) - expect(downloadArtifactMock).toHaveBeenCalledWith({ - owner: fixtures.repositoryOwner, - repo: fixtures.repositoryName, - artifact_id: fixtures.artifactID, - archive_format: 'zip', - request: { - redirect: 'manual' - } + expect(downloadArtifactMock).toHaveBeenCalledWith({ + owner: fixtures.repositoryOwner, + repo: fixtures.repositoryName, + artifact_id: fixtures.artifactID, + archive_format: 'zip', + request: { + redirect: 'manual' + } + }) + expect(httpClientMock).toHaveBeenCalledWith(getUserAgentString()) + expect(getMock).toHaveBeenCalledWith(fixtures.blobStorageUrl) + + expectExtractedArchive(customPath) + + expect(response.success).toBe(true) + expect(response.downloadPath).toBe(customPath) + }) + + it('should fail if download artifact API does not respond with location', async () => { + const downloadArtifactMock = github.getOctokit(fixtures.token).rest + .actions.downloadArtifact as MockedDownloadArtifact + downloadArtifactMock.mockResolvedValueOnce({ + headers: {}, + status: 302, + url: '', + data: Buffer.from('') + }) + + await expect( + downloadArtifactPublic( + fixtures.artifactID, + fixtures.repositoryOwner, + fixtures.repositoryName, + fixtures.token + ) + ).rejects.toBeInstanceOf(Error) + + expect(downloadArtifactMock).toHaveBeenCalledWith({ + owner: fixtures.repositoryOwner, + repo: fixtures.repositoryName, + artifact_id: fixtures.artifactID, + archive_format: 'zip', + request: { + redirect: 'manual' + } + }) + }) + + it('should fail if blob storage response is non-200', async () => { + const downloadArtifactMock = github.getOctokit(fixtures.token).rest + .actions.downloadArtifact as MockedDownloadArtifact + downloadArtifactMock.mockResolvedValueOnce({ + headers: { + location: fixtures.blobStorageUrl + }, + status: 302, + url: '', + data: Buffer.from('') + }) + + const getMock = jest.fn(() => { + const message = new http.IncomingMessage(new net.Socket()) + message.statusCode = 500 + message.push('Internal Server Error') + return { + message + } + }) + const httpClientMock = (HttpClient as jest.Mock).mockImplementation( + () => { + return { + get: getMock + } + } + ) + + await expect( + downloadArtifactPublic( + fixtures.artifactID, + fixtures.repositoryOwner, + fixtures.repositoryName, + fixtures.token + ) + ).rejects.toBeInstanceOf(Error) + + expect(downloadArtifactMock).toHaveBeenCalledWith({ + owner: fixtures.repositoryOwner, + repo: fixtures.repositoryName, + artifact_id: fixtures.artifactID, + archive_format: 'zip', + request: { + redirect: 'manual' + } + }) + expect(httpClientMock).toHaveBeenCalledWith(getUserAgentString()) + expect(getMock).toHaveBeenCalledWith(fixtures.blobStorageUrl) }) - expect(httpClientMock).toHaveBeenCalledWith(getUserAgentString()) - expect(getMock).toHaveBeenCalledWith(fixtures.blobStorageUrl) }) }) diff --git a/packages/artifact/__tests__/path-and-artifact-name-validation.test.ts b/packages/artifact/__tests__/path-and-artifact-name-validation.test.ts index 069d0fcb..cd3fcd52 100644 --- a/packages/artifact/__tests__/path-and-artifact-name-validation.test.ts +++ b/packages/artifact/__tests__/path-and-artifact-name-validation.test.ts @@ -3,15 +3,11 @@ import { validateFilePath } from '../src/internal/upload/path-and-artifact-name-validation' -import * as core from '@actions/core' +import {noopLogs} from './common.test' describe('Path and artifact name validation', () => { beforeAll(() => { - // mock all output so that there is less noise when running tests - jest.spyOn(console, 'log').mockImplementation(() => {}) - jest.spyOn(core, 'debug').mockImplementation(() => {}) - jest.spyOn(core, 'info').mockImplementation(() => {}) - jest.spyOn(core, 'warning').mockImplementation(() => {}) + noopLogs() }) it('Check Artifact Name for any invalid characters', () => { diff --git a/packages/artifact/__tests__/upload-artifact.test.ts b/packages/artifact/__tests__/upload-artifact.test.ts index 955929b1..fc7b79f5 100644 --- a/packages/artifact/__tests__/upload-artifact.test.ts +++ b/packages/artifact/__tests__/upload-artifact.test.ts @@ -1,4 +1,3 @@ -import * as core from '@actions/core' import * as uploadZipSpecification from '../src/internal/upload/upload-zip-specification' import * as zip from '../src/internal/upload/zip' import * as util from '../src/internal/shared/util' @@ -7,14 +6,11 @@ import * as config from '../src/internal/shared/config' import {Timestamp, ArtifactServiceClientJSON} from '../src/generated' import * as blobUpload from '../src/internal/upload/blob-upload' import {uploadArtifact} from '../src/internal/upload/upload-artifact' +import {noopLogs} from './common.test' describe('upload-artifact', () => { beforeEach(() => { - // mock all output so that there is less noise when running tests - jest.spyOn(console, 'log').mockImplementation(() => {}) - jest.spyOn(core, 'debug').mockImplementation(() => {}) - jest.spyOn(core, 'info').mockImplementation(() => {}) - jest.spyOn(core, 'warning').mockImplementation(() => {}) + noopLogs() }) afterEach(() => { diff --git a/packages/artifact/__tests__/upload-zip-specification.test.ts b/packages/artifact/__tests__/upload-zip-specification.test.ts index a9757618..cf606d31 100644 --- a/packages/artifact/__tests__/upload-zip-specification.test.ts +++ b/packages/artifact/__tests__/upload-zip-specification.test.ts @@ -1,11 +1,11 @@ import * as io from '../../io/src/io' import * as path from 'path' import {promises as fs} from 'fs' -import * as core from '@actions/core' import { getUploadZipSpecification, validateRootDirectory } from '../src/internal/upload/upload-zip-specification' +import {noopLogs} from './common.test' const root = path.join(__dirname, '_temp', 'upload-specification') const goodItem1Path = path.join( @@ -51,11 +51,7 @@ const artifactFilesToUpload = [ describe('Search', () => { beforeAll(async () => { - // mock all output so that there is less noise when running tests - jest.spyOn(console, 'log').mockImplementation(() => {}) - jest.spyOn(core, 'debug').mockImplementation(() => {}) - jest.spyOn(core, 'info').mockImplementation(() => {}) - jest.spyOn(core, 'warning').mockImplementation(() => {}) + noopLogs() // clear temp directory await io.rmRF(root) diff --git a/packages/artifact/__tests__/util.test.ts b/packages/artifact/__tests__/util.test.ts index 76f760fa..76fe4e18 100644 --- a/packages/artifact/__tests__/util.test.ts +++ b/packages/artifact/__tests__/util.test.ts @@ -1,13 +1,12 @@ import * as config from '../src/internal/shared/config' import * as util from '../src/internal/shared/util' +export const testRuntimeToken = + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwic2NwIjoiQWN0aW9ucy5FeGFtcGxlIEFjdGlvbnMuQW5vdGhlckV4YW1wbGU6dGVzdCBBY3Rpb25zLlJlc3VsdHM6Y2U3ZjU0YzctNjFjNy00YWFlLTg4N2YtMzBkYTQ3NWY1ZjFhOmNhMzk1MDg1LTA0MGEtNTI2Yi0yY2U4LWJkYzg1ZjY5Mjc3NCIsImlhdCI6MTUxNjIzOTAyMn0.XYnI_wHPBlUi1mqYveJnnkJhp4dlFjqxzRmISPsqfw8' + describe('get-backend-ids-from-token', () => { it('should return backend ids when the token is valid', () => { - jest - .spyOn(config, 'getRuntimeToken') - .mockReturnValue( - 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwic2NwIjoiQWN0aW9ucy5FeGFtcGxlIEFjdGlvbnMuQW5vdGhlckV4YW1wbGU6dGVzdCBBY3Rpb25zLlJlc3VsdHM6Y2U3ZjU0YzctNjFjNy00YWFlLTg4N2YtMzBkYTQ3NWY1ZjFhOmNhMzk1MDg1LTA0MGEtNTI2Yi0yY2U4LWJkYzg1ZjY5Mjc3NCIsImlhdCI6MTUxNjIzOTAyMn0.XYnI_wHPBlUi1mqYveJnnkJhp4dlFjqxzRmISPsqfw8' - ) + jest.spyOn(config, 'getRuntimeToken').mockReturnValue(testRuntimeToken) const backendIds = util.getBackendIdsFromToken() expect(backendIds.workflowRunBackendId).toBe( diff --git a/packages/artifact/package.json b/packages/artifact/package.json index 64ff39c0..7dc7eafc 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -30,7 +30,7 @@ }, "scripts": { "audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json", - "test": "echo \"Error: run tests from root\" && exit 1", + "test": "cd ../../ && npm run test ./packages/artifact", "bootstrap": "cd ../../ && npm run bootstrap", "tsc-run": "tsc", "tsc": "npm run bootstrap && npm run tsc-run" diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index ae8d4c4a..24fe3e24 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -10,7 +10,10 @@ import { import {getUserAgentString} from '../shared/user-agent' import {getGitHubWorkspaceDir} from '../shared/config' import {internalArtifactTwirpClient} from '../shared/artifact-twirp-client' -import {GetSignedArtifactURLRequest, ListArtifactsRequest} from 'src/generated' +import { + GetSignedArtifactURLRequest, + ListArtifactsRequest +} from '../../generated' import {getBackendIdsFromToken} from '../shared/util' const scrubQueryParameters = (url: string): string => { diff --git a/packages/artifact/src/internal/shared/artifact-twirp-client.ts b/packages/artifact/src/internal/shared/artifact-twirp-client.ts index 2498ba3f..04256c8b 100644 --- a/packages/artifact/src/internal/shared/artifact-twirp-client.ts +++ b/packages/artifact/src/internal/shared/artifact-twirp-client.ts @@ -160,13 +160,13 @@ class ArtifactHttpClient implements Rpc { export function internalArtifactTwirpClient(options?: { maxAttempts?: number - baseRetryIntervalMilliseconds?: number + retryIntervalMs?: number retryMultiplier?: number }): ArtifactServiceClientJSON { const client = new ArtifactHttpClient( getUserAgentString(), options?.maxAttempts, - options?.baseRetryIntervalMilliseconds, + options?.retryIntervalMs, options?.retryMultiplier ) return new ArtifactServiceClientJSON(client) From 32549e8197e1d742177b585f89c55a947773c92d Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Fri, 1 Dec 2023 01:32:45 +0000 Subject: [PATCH 012/198] update download-artifact tests for public and internal impl --- .../__tests__/artifact-http-client.test.ts | 2 +- .../__tests__/{common.test.ts => common.ts} | 2 +- .../__tests__/download-artifact.test.ts | 260 +++++++++++++++--- .../path-and-artifact-name-validation.test.ts | 2 +- .../__tests__/upload-artifact.test.ts | 9 +- .../upload-zip-specification.test.ts | 2 +- 6 files changed, 224 insertions(+), 53 deletions(-) rename packages/artifact/__tests__/{common.test.ts => common.ts} (85%) diff --git a/packages/artifact/__tests__/artifact-http-client.test.ts b/packages/artifact/__tests__/artifact-http-client.test.ts index 31bd24c3..2dd6c5c4 100644 --- a/packages/artifact/__tests__/artifact-http-client.test.ts +++ b/packages/artifact/__tests__/artifact-http-client.test.ts @@ -3,7 +3,7 @@ import * as net from 'net' import {HttpClient} from '@actions/http-client' import * as config from '../src/internal/shared/config' import {internalArtifactTwirpClient} from '../src/internal/shared/artifact-twirp-client' -import {noopLogs} from './common.test' +import {noopLogs} from './common' jest.mock('@actions/http-client') diff --git a/packages/artifact/__tests__/common.test.ts b/packages/artifact/__tests__/common.ts similarity index 85% rename from packages/artifact/__tests__/common.test.ts rename to packages/artifact/__tests__/common.ts index 02955f10..4fae850c 100644 --- a/packages/artifact/__tests__/common.test.ts +++ b/packages/artifact/__tests__/common.ts @@ -2,7 +2,7 @@ import * as core from '@actions/core' // noopLogs mocks the console.log and core.* functions to prevent output in the console while testing export const noopLogs = (): void => { - // jest.spyOn(console, 'log').mockImplementation(() => {}) + jest.spyOn(console, 'log').mockImplementation(() => {}) jest.spyOn(core, 'debug').mockImplementation(() => {}) jest.spyOn(core, 'info').mockImplementation(() => {}) jest.spyOn(core, 'warning').mockImplementation(() => {}) diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index 8f80ff76..207a9d01 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -7,9 +7,15 @@ import {HttpClient} from '@actions/http-client' import type {RestEndpointMethods} from '@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types' import archiver from 'archiver' -import {downloadArtifactPublic} from '../src/internal/download/download-artifact' +import { + downloadArtifactInternal, + downloadArtifactPublic +} from '../src/internal/download/download-artifact' import {getUserAgentString} from '../src/internal/shared/user-agent' -import {noopLogs} from './common.test' +import {noopLogs} from './common' +import * as config from '../src/internal/shared/config' +import {ArtifactServiceClientJSON} from '../src/generated' +import * as util from '../src/internal/shared/util' type MockedDownloadArtifact = jest.MockedFunction< RestEndpointMethods['actions']['downloadArtifact'] @@ -32,10 +38,16 @@ const fixtures = { ] }, artifactID: 1234, + artifactName: 'my-artifact', + artifactSize: 123456, repositoryOwner: 'actions', repositoryName: 'toolkit', token: 'ghp_1234567890', - blobStorageUrl: 'https://blob-storage.local?signed=true' + blobStorageUrl: 'https://blob-storage.local?signed=true', + backendIds: { + workflowRunBackendId: 'c4d7c21f-ba3f-4ddc-a8c8-6f2f626f8422', + workflowJobRunBackendId: '760803a1-f890-4d25-9a6e-a3fc01a0c7cf' + } } jest.mock('@actions/github', () => ({ @@ -88,6 +100,24 @@ const cleanup = async (): Promise => { delete process.env['GITHUB_WORKSPACE'] } +const mockGetArtifactSuccess = jest.fn(() => { + const message = new http.IncomingMessage(new net.Socket()) + message.statusCode = 200 + message.push(fs.readFileSync(fixtures.exampleArtifact.path)) + return { + message + } +}) + +const mockGetArtifactFailure = jest.fn(() => { + const message = new http.IncomingMessage(new net.Socket()) + message.statusCode = 500 + message.push('Internal Server Error') + return { + message + } +}) + describe('download-artifact', () => { describe('public', () => { beforeEach(setup) @@ -105,18 +135,10 @@ describe('download-artifact', () => { data: Buffer.from('') }) - const getMock = jest.fn(() => { - const message = new http.IncomingMessage(new net.Socket()) - message.statusCode = 200 - message.push(fs.readFileSync(fixtures.exampleArtifact.path)) - return { - message - } - }) - const httpClientMock = (HttpClient as jest.Mock).mockImplementation( + const mockHttpClient = (HttpClient as jest.Mock).mockImplementation( () => { return { - get: getMock + get: mockGetArtifactSuccess } } ) @@ -137,11 +159,11 @@ describe('download-artifact', () => { redirect: 'manual' } }) - expect(httpClientMock).toHaveBeenCalledWith(getUserAgentString()) - expect(getMock).toHaveBeenCalledWith(fixtures.blobStorageUrl) - + expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) + expect(mockGetArtifactSuccess).toHaveBeenCalledWith( + fixtures.blobStorageUrl + ) expectExtractedArchive(fixtures.workspaceDir) - expect(response.success).toBe(true) expect(response.downloadPath).toBe(fixtures.workspaceDir) }) @@ -160,18 +182,10 @@ describe('download-artifact', () => { data: Buffer.from('') }) - const getMock = jest.fn(() => { - const message = new http.IncomingMessage(new net.Socket()) - message.statusCode = 200 - message.push(fs.readFileSync(fixtures.exampleArtifact.path)) - return { - message - } - }) - const httpClientMock = (HttpClient as jest.Mock).mockImplementation( + const mockHttpClient = (HttpClient as jest.Mock).mockImplementation( () => { return { - get: getMock + get: mockGetArtifactSuccess } } ) @@ -195,11 +209,11 @@ describe('download-artifact', () => { redirect: 'manual' } }) - expect(httpClientMock).toHaveBeenCalledWith(getUserAgentString()) - expect(getMock).toHaveBeenCalledWith(fixtures.blobStorageUrl) - + expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) + expect(mockGetArtifactSuccess).toHaveBeenCalledWith( + fixtures.blobStorageUrl + ) expectExtractedArchive(customPath) - expect(response.success).toBe(true) expect(response.downloadPath).toBe(customPath) }) @@ -246,18 +260,10 @@ describe('download-artifact', () => { data: Buffer.from('') }) - const getMock = jest.fn(() => { - const message = new http.IncomingMessage(new net.Socket()) - message.statusCode = 500 - message.push('Internal Server Error') - return { - message - } - }) - const httpClientMock = (HttpClient as jest.Mock).mockImplementation( + const mockHttpClient = (HttpClient as jest.Mock).mockImplementation( () => { return { - get: getMock + get: mockGetArtifactFailure } } ) @@ -280,8 +286,176 @@ describe('download-artifact', () => { redirect: 'manual' } }) - expect(httpClientMock).toHaveBeenCalledWith(getUserAgentString()) - expect(getMock).toHaveBeenCalledWith(fixtures.blobStorageUrl) + expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) + expect(mockGetArtifactFailure).toHaveBeenCalledWith( + fixtures.blobStorageUrl + ) + }) + }) + + describe('internal', () => { + beforeEach(async () => { + await setup() + + jest.spyOn(config, 'getRuntimeToken').mockReturnValue('test-token') + + jest + .spyOn(util, 'getBackendIdsFromToken') + .mockReturnValue(fixtures.backendIds) + + jest + .spyOn(config, 'getResultsServiceUrl') + .mockReturnValue('https://results.local') + }) + afterEach(async () => { + await cleanup() + }) + + it('should successfully download an artifact to $GITHUB_WORKSPACE', async () => { + const mockListArtifacts = jest + .spyOn(ArtifactServiceClientJSON.prototype, 'ListArtifacts') + .mockResolvedValue({ + artifacts: [ + { + ...fixtures.backendIds, + databaseId: fixtures.artifactID.toString(), + name: fixtures.artifactName, + size: fixtures.artifactSize.toString() + } + ] + }) + + const mockGetSignedArtifactURL = jest + .spyOn(ArtifactServiceClientJSON.prototype, 'GetSignedArtifactURL') + .mockReturnValue( + Promise.resolve({ + signedUrl: fixtures.blobStorageUrl + }) + ) + + const mockHttpClient = (HttpClient as jest.Mock).mockImplementation( + () => { + return { + get: mockGetArtifactSuccess + } + } + ) + + const response = await downloadArtifactInternal(fixtures.artifactID) + + expectExtractedArchive(fixtures.workspaceDir) + expect(response.success).toBe(true) + expect(response.downloadPath).toBe(fixtures.workspaceDir) + expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) + expect(mockListArtifacts).toHaveBeenCalledWith({ + ...fixtures.backendIds + }) + expect(mockGetSignedArtifactURL).toHaveBeenCalledWith({ + ...fixtures.backendIds, + name: fixtures.artifactName + }) + }) + + it('should successfully download an artifact to user defined path', async () => { + const customPath = path.join(testDir, 'custom') + + const mockListArtifacts = jest + .spyOn(ArtifactServiceClientJSON.prototype, 'ListArtifacts') + .mockResolvedValue({ + artifacts: [ + { + ...fixtures.backendIds, + databaseId: fixtures.artifactID.toString(), + name: fixtures.artifactName, + size: fixtures.artifactSize.toString() + } + ] + }) + + const mockGetSignedArtifactURL = jest + .spyOn(ArtifactServiceClientJSON.prototype, 'GetSignedArtifactURL') + .mockReturnValue( + Promise.resolve({ + signedUrl: fixtures.blobStorageUrl + }) + ) + + const mockHttpClient = (HttpClient as jest.Mock).mockImplementation( + () => { + return { + get: mockGetArtifactSuccess + } + } + ) + + const response = await downloadArtifactInternal(fixtures.artifactID, { + path: customPath + }) + + expectExtractedArchive(customPath) + expect(response.success).toBe(true) + expect(response.downloadPath).toBe(customPath) + expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) + expect(mockListArtifacts).toHaveBeenCalledWith({ + ...fixtures.backendIds + }) + expect(mockGetSignedArtifactURL).toHaveBeenCalledWith({ + ...fixtures.backendIds, + name: fixtures.artifactName + }) + }) + + it('should fail if download artifact API does not respond with location', async () => { + jest + .spyOn(ArtifactServiceClientJSON.prototype, 'ListArtifacts') + .mockRejectedValue(new Error('boom')) + + await expect( + downloadArtifactInternal(fixtures.artifactID) + ).rejects.toBeInstanceOf(Error) + }) + + it('should fail if blob storage response is non-200', async () => { + const mockListArtifacts = jest + .spyOn(ArtifactServiceClientJSON.prototype, 'ListArtifacts') + .mockResolvedValue({ + artifacts: [ + { + ...fixtures.backendIds, + databaseId: fixtures.artifactID.toString(), + name: fixtures.artifactName, + size: fixtures.artifactSize.toString() + } + ] + }) + + const mockGetSignedArtifactURL = jest + .spyOn(ArtifactServiceClientJSON.prototype, 'GetSignedArtifactURL') + .mockReturnValue( + Promise.resolve({ + signedUrl: fixtures.blobStorageUrl + }) + ) + + const mockHttpClient = (HttpClient as jest.Mock).mockImplementation( + () => { + return { + get: mockGetArtifactFailure + } + } + ) + + await expect( + downloadArtifactInternal(fixtures.artifactID) + ).rejects.toBeInstanceOf(Error) + expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) + expect(mockListArtifacts).toHaveBeenCalledWith({ + ...fixtures.backendIds + }) + expect(mockGetSignedArtifactURL).toHaveBeenCalledWith({ + ...fixtures.backendIds, + name: fixtures.artifactName + }) }) }) }) diff --git a/packages/artifact/__tests__/path-and-artifact-name-validation.test.ts b/packages/artifact/__tests__/path-and-artifact-name-validation.test.ts index cd3fcd52..3ecdde45 100644 --- a/packages/artifact/__tests__/path-and-artifact-name-validation.test.ts +++ b/packages/artifact/__tests__/path-and-artifact-name-validation.test.ts @@ -3,7 +3,7 @@ import { validateFilePath } from '../src/internal/upload/path-and-artifact-name-validation' -import {noopLogs} from './common.test' +import {noopLogs} from './common' describe('Path and artifact name validation', () => { beforeAll(() => { diff --git a/packages/artifact/__tests__/upload-artifact.test.ts b/packages/artifact/__tests__/upload-artifact.test.ts index fc7b79f5..439a96a3 100644 --- a/packages/artifact/__tests__/upload-artifact.test.ts +++ b/packages/artifact/__tests__/upload-artifact.test.ts @@ -6,7 +6,7 @@ import * as config from '../src/internal/shared/config' import {Timestamp, ArtifactServiceClientJSON} from '../src/generated' import * as blobUpload from '../src/internal/upload/blob-upload' import {uploadArtifact} from '../src/internal/upload/upload-artifact' -import {noopLogs} from './common.test' +import {noopLogs} from './common' describe('upload-artifact', () => { beforeEach(() => { @@ -127,7 +127,7 @@ describe('upload-artifact', () => { expect(uploadResp).resolves.toEqual({success: false}) }) - it('should return false if no backend IDs are found', () => { + it('should reject if no backend IDs are found', () => { jest .spyOn(uploadZipSpecification, 'validateRootDirectory') .mockReturnValue() @@ -151,9 +151,6 @@ describe('upload-artifact', () => { jest .spyOn(zip, 'createZipUploadStream') .mockReturnValue(Promise.resolve(new zip.ZipUploadStream(1))) - jest - .spyOn(util, 'getBackendIdsFromToken') - .mockReturnValue({workflowRunBackendId: '', workflowJobRunBackendId: ''}) const uploadResp = uploadArtifact( 'test-artifact', @@ -165,7 +162,7 @@ describe('upload-artifact', () => { '/home/user/files/plz-upload' ) - expect(uploadResp).resolves.toEqual({success: false}) + expect(uploadResp).rejects.toThrow() }) it('should return false if the creation request fails', () => { diff --git a/packages/artifact/__tests__/upload-zip-specification.test.ts b/packages/artifact/__tests__/upload-zip-specification.test.ts index cf606d31..0b59bff7 100644 --- a/packages/artifact/__tests__/upload-zip-specification.test.ts +++ b/packages/artifact/__tests__/upload-zip-specification.test.ts @@ -5,7 +5,7 @@ import { getUploadZipSpecification, validateRootDirectory } from '../src/internal/upload/upload-zip-specification' -import {noopLogs} from './common.test' +import {noopLogs} from './common' const root = path.join(__dirname, '_temp', 'upload-specification') const goodItem1Path = path.join( From 4789a465782a98ca53abfca1b38f66517af606a6 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Fri, 1 Dec 2023 02:15:25 +0000 Subject: [PATCH 013/198] make FindOptions interface more user friendly --- packages/artifact/src/internal/client.ts | 59 +++++++++++-------- .../src/internal/shared/interfaces.ts | 22 +++---- 2 files changed, 47 insertions(+), 34 deletions(-) diff --git a/packages/artifact/src/internal/client.ts b/packages/artifact/src/internal/client.ts index c32611b6..3d5b999b 100644 --- a/packages/artifact/src/internal/client.ts +++ b/packages/artifact/src/internal/client.ts @@ -7,7 +7,7 @@ import { GetArtifactResponse, ListArtifactsResponse, DownloadArtifactResponse, - LookupOptions + FindOptions } from './shared/interfaces' import {uploadArtifact} from './upload/upload-artifact' import { @@ -38,18 +38,18 @@ export interface ArtifactClient { * Lists all artifacts that are part of the current workflow run. * This function will return at most 1000 artifacts per workflow run. * - * If options.token is specified, this will call the public List-Artifacts API which can list from other runs. + * If options.findBy is specified, this will call the public List-Artifacts API which can list from other runs. * https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts * * @param options Extra options that allow for the customization of the list behavior * @returns ListArtifactResponse object */ - listArtifacts(options?: LookupOptions): Promise + listArtifacts(options?: FindOptions): Promise /** * Finds an artifact by name. * - * If options.token is specified, this will use the public List Artifacts API with a name filter which can get artifacts from other runs. + * If options.findBy is specified, this will use the public List Artifacts API with a name filter which can get artifacts from other runs. * https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts * @actions/artifact > 2.0.0 does not allow for creating multiple artifacts with the same name in the same workflow run. * It is possible to have multiple artifacts with the same name in the same workflow run by using old versions of upload-artifact (v1,v2 and v3), @actions/artifact < v2.0.0 or it is a rerun. @@ -60,13 +60,13 @@ export interface ArtifactClient { */ getArtifact( artifactName: string, - options?: LookupOptions + options?: FindOptions ): Promise /** * Downloads an artifact and unzips the content. * - * If options.token is specified, this will use the public Download Artifact API https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#download-an-artifact + * If options.findBy is specified, this will use the public Download Artifact API https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#download-an-artifact * * @param artifactId The name of the artifact to download * @param options Extra options that allow for the customization of the download behavior @@ -74,7 +74,7 @@ export interface ArtifactClient { */ downloadArtifact( artifactId: number, - options?: DownloadArtifactOptions & LookupOptions + options?: DownloadArtifactOptions & FindOptions ): Promise } @@ -93,7 +93,7 @@ export class Client implements ArtifactClient { name: string, files: string[], rootDirectory: string, - options?: UploadOptions | undefined + options?: UploadOptions ): Promise { if (isGhes()) { warning( @@ -125,7 +125,7 @@ If the error persists, please check whether Actions is operating normally at [ht */ async downloadArtifact( artifactId: number, - options?: DownloadArtifactOptions & LookupOptions + options?: Partial ): Promise { if (isGhes()) { warning( @@ -137,9 +137,12 @@ If the error persists, please check whether Actions is operating normally at [ht } try { - if (options?.token) { - const {repositoryOwner, repositoryName, token, ...downloadOptions} = - options + if (options?.findBy) { + const { + findBy: {repositoryOwner, repositoryName, token}, + ...downloadOptions + } = options + return downloadArtifactPublic( artifactId, repositoryOwner, @@ -168,7 +171,7 @@ If the error persists, please check whether Actions and API requests are operati /** * List Artifacts */ - async listArtifacts(options?: LookupOptions): Promise { + async listArtifacts(options?: FindOptions): Promise { if (isGhes()) { warning( `@actions/artifact v2.0.0+ and download-artifact@v4+ are not currently supported on GHES.` @@ -179,12 +182,16 @@ If the error persists, please check whether Actions and API requests are operati } try { - if (options?.token) { + if (options?.findBy) { + const { + findBy: {workflowRunId, repositoryOwner, repositoryName, token} + } = options + return listArtifactsPublic( - options.workflowRunId, - options.repositoryOwner, - options.repositoryName, - options.token + workflowRunId, + repositoryOwner, + repositoryName, + token ) } @@ -209,7 +216,7 @@ If the error persists, please check whether Actions and API requests are operati */ async getArtifact( artifactName: string, - options?: LookupOptions + options?: FindOptions ): Promise { if (isGhes()) { warning( @@ -221,13 +228,17 @@ If the error persists, please check whether Actions and API requests are operati } try { - if (options?.token) { + if (options?.findBy) { + const { + findBy: {workflowRunId, repositoryOwner, repositoryName, token} + } = options + return getArtifactPublic( artifactName, - options.workflowRunId, - options.repositoryOwner, - options.repositoryName, - options.token + workflowRunId, + repositoryOwner, + repositoryName, + token ) } diff --git a/packages/artifact/src/internal/shared/interfaces.ts b/packages/artifact/src/internal/shared/interfaces.ts index a312c5db..bd764412 100644 --- a/packages/artifact/src/internal/shared/interfaces.ts +++ b/packages/artifact/src/internal/shared/interfaces.ts @@ -126,15 +126,17 @@ export interface Artifact { size: number } -// LookupOptions are for fetching Artifact(s) out of the scope of the current run. +// FindOptions are for fetching Artifact(s) out of the scope of the current run. // Must specify a PAT with actions:read scope for cross run/repo lookup otherwise these will be ignored. -export interface LookupOptions { - // Token with actions:read permissions - token: string - // WorkflowRun of the artifact(s) to lookup - workflowRunId: number - // Repository owner - repositoryOwner: string - // Repository name - repositoryName: string +export interface FindOptions { + findBy?: { + // Token with actions:read permissions + token: string + // WorkflowRun of the artifact(s) to lookup + workflowRunId: number + // Repository owner + repositoryOwner: string + // Repository name + repositoryName: string + } } From 57db7a6302a36fbaab180658229dbff637844210 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Fri, 1 Dec 2023 03:04:10 +0000 Subject: [PATCH 014/198] more debug info --- .../artifact/src/internal/shared/artifact-twirp-client.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/artifact/src/internal/shared/artifact-twirp-client.ts b/packages/artifact/src/internal/shared/artifact-twirp-client.ts index 04256c8b..dde3d4a4 100644 --- a/packages/artifact/src/internal/shared/artifact-twirp-client.ts +++ b/packages/artifact/src/internal/shared/artifact-twirp-client.ts @@ -54,7 +54,7 @@ class ArtifactHttpClient implements Rpc { data: object | Uint8Array ): Promise { const url = new URL(`/twirp/${service}/${method}`, this.baseUrl).href - debug(`Requesting: ${url}`) + debug(`[Request] ${method} ${url}`) const headers = { 'Content-Type': contentType } @@ -80,6 +80,8 @@ class ArtifactHttpClient implements Rpc { try { const response = await operation() const statusCode = response.message.statusCode + debug(`[Response] ${response.message.statusCode}`) + debug(JSON.stringify(response.message.headers, null, 2)) if (this.isSuccessStatusCode(statusCode)) { return response From a59f976dd459cec5928d6a80f7cd414e999a5aa3 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Fri, 1 Dec 2023 09:05:46 -0500 Subject: [PATCH 015/198] minor fixes --- packages/artifact/src/internal/client.ts | 4 ++-- packages/artifact/src/internal/download/download-artifact.ts | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/artifact/src/internal/client.ts b/packages/artifact/src/internal/client.ts index 3d5b999b..20563abc 100644 --- a/packages/artifact/src/internal/client.ts +++ b/packages/artifact/src/internal/client.ts @@ -125,7 +125,7 @@ If the error persists, please check whether Actions is operating normally at [ht */ async downloadArtifact( artifactId: number, - options?: Partial + options?: DownloadArtifactOptions & FindOptions ): Promise { if (isGhes()) { warning( @@ -152,7 +152,7 @@ If the error persists, please check whether Actions is operating normally at [ht ) } - return downloadArtifactInternal(artifactId) + return downloadArtifactInternal(artifactId, options) } catch (error) { warning( `Artifact download failed with error: ${error}. diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 24fe3e24..cf5b5e15 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -12,6 +12,7 @@ import {getGitHubWorkspaceDir} from '../shared/config' import {internalArtifactTwirpClient} from '../shared/artifact-twirp-client' import { GetSignedArtifactURLRequest, + Int64Value, ListArtifactsRequest } from '../../generated' import {getBackendIdsFromToken} from '../shared/util' @@ -110,7 +111,8 @@ export async function downloadArtifactInternal( const listReq: ListArtifactsRequest = { workflowRunBackendId, - workflowJobRunBackendId + workflowJobRunBackendId, + idFilter: Int64Value.create({value: artifactId.toString()}) } const {artifacts} = await artifactClient.ListArtifacts(listReq) From 281697ecbed1ab34e4948e690721f0893c9d327c Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Fri, 1 Dec 2023 16:34:27 +0000 Subject: [PATCH 016/198] fix test expectations --- packages/artifact/__tests__/download-artifact.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index 207a9d01..f28d442d 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -348,6 +348,9 @@ describe('download-artifact', () => { expect(response.downloadPath).toBe(fixtures.workspaceDir) expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) expect(mockListArtifacts).toHaveBeenCalledWith({ + idFilter: { + value: fixtures.artifactID.toString() + }, ...fixtures.backendIds }) expect(mockGetSignedArtifactURL).toHaveBeenCalledWith({ @@ -397,6 +400,9 @@ describe('download-artifact', () => { expect(response.downloadPath).toBe(customPath) expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) expect(mockListArtifacts).toHaveBeenCalledWith({ + idFilter: { + value: fixtures.artifactID.toString() + }, ...fixtures.backendIds }) expect(mockGetSignedArtifactURL).toHaveBeenCalledWith({ @@ -450,6 +456,9 @@ describe('download-artifact', () => { ).rejects.toBeInstanceOf(Error) expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) expect(mockListArtifacts).toHaveBeenCalledWith({ + idFilter: { + value: fixtures.artifactID.toString() + }, ...fixtures.backendIds }) expect(mockGetSignedArtifactURL).toHaveBeenCalledWith({ From c1f9d37323afac4dced1431052013461238d8493 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Sat, 2 Dec 2023 21:18:22 -0500 Subject: [PATCH 017/198] updates to get/list artifacts --- .../src/generated/results/api/v1/artifact.ts | 15 ++++++- .../src/internal/find/get-artifact.ts | 42 +++++++++++-------- .../src/internal/find/list-artifacts.ts | 15 +++++-- .../src/internal/shared/interfaces.ts | 5 +++ 4 files changed, 55 insertions(+), 22 deletions(-) diff --git a/packages/artifact/src/generated/results/api/v1/artifact.ts b/packages/artifact/src/generated/results/api/v1/artifact.ts index adabae5e..acce3037 100644 --- a/packages/artifact/src/generated/results/api/v1/artifact.ts +++ b/packages/artifact/src/generated/results/api/v1/artifact.ts @@ -163,6 +163,12 @@ export interface ListArtifactsResponse_MonolithArtifact { * @generated from protobuf field: int64 size = 5; */ size: string; + /** + * When the artifact was created in the monolith + * + * @generated from protobuf field: google.protobuf.Timestamp created_at = 6; + */ + createdAt?: Timestamp; } /** * @generated from protobuf message github.actions.results.api.v1.GetSignedArtifactURLRequest @@ -571,7 +577,8 @@ class ListArtifactsResponse_MonolithArtifact$Type extends MessageType Timestamp } ]); } create(value?: PartialMessage): ListArtifactsResponse_MonolithArtifact { @@ -601,6 +608,9 @@ class ListArtifactsResponse_MonolithArtifact$Type extends MessageType 1) { - core.warning( - 'more than one artifact found for a single name, returning first' + artifact = getArtifactResp.data.artifacts.reduce((prev, current) => { + new Date(prev.created_at) > new Date(current.created_at) ? prev : current + }) + + core.debug( + `more than one artifact found for a single name, returning newest (id: ${artifact.id})` ) } return { success: true, artifact: { - name: getArtifactResp.data.artifacts[0].name, - id: getArtifactResp.data.artifacts[0].id, - size: getArtifactResp.data.artifacts[0].size_in_bytes + name: artifact.name, + id: artifact.id, + size: artifact.size_in_bytes, + createdAt: artifact.created_at ? new Date(artifact.created_at) : undefined } } } @@ -93,26 +99,28 @@ export async function getArtifactInternal( } } + let artifact = res.artifacts[0] if (res.artifacts.length > 1) { - core.warning( - 'more than one artifact found for a single name, returning first' + artifact = res.artifacts.reduce((prev, current) => { + const prevDate = Timestamp.toDate(prev.createdAt || Timestamp.now()) + const currentDate = Timestamp.toDate(current.createdAt || Timestamp.now()) + return prevDate > currentDate ? prev : current + }) + + core.debug( + `more than one artifact found for a single name, returning newest (id: ${artifact.databaseId})` ) } - // In the case of reruns, we may have artifacts with the same name scoped under the same workflow run. - // Let's prefer the artifact closest scoped to this run. - // If it doesn't exist (e.g. partial rerun) we'll use the first match. - const artifact = - res.artifacts.find( - artifact => artifact.workflowRunBackendId === workflowRunBackendId - ) || res.artifacts[0] - return { success: true, artifact: { name: artifact.name, id: Number(artifact.databaseId), - size: Number(artifact.size) + size: Number(artifact.size), + createdAt: artifact.createdAt + ? Timestamp.toDate(artifact.createdAt) + : undefined } } } diff --git a/packages/artifact/src/internal/find/list-artifacts.ts b/packages/artifact/src/internal/find/list-artifacts.ts index c25a58bd..a951fed1 100644 --- a/packages/artifact/src/internal/find/list-artifacts.ts +++ b/packages/artifact/src/internal/find/list-artifacts.ts @@ -9,7 +9,7 @@ import {retry} from '@octokit/plugin-retry' import {OctokitOptions} from '@octokit/core/dist-types/types' import {internalArtifactTwirpClient} from '../shared/artifact-twirp-client' import {getBackendIdsFromToken} from '../shared/util' -import {ListArtifactsRequest} from 'src/generated' +import {ListArtifactsRequest, Timestamp} from 'src/generated' // Limiting to 1000 for perf reasons const maximumArtifactCount = 1000 @@ -65,7 +65,8 @@ export async function listArtifactsPublic( artifacts.push({ name: artifact.name, id: artifact.id, - size: artifact.size_in_bytes + size: artifact.size_in_bytes, + createdAt: artifact.created_at ? new Date(artifact.created_at) : undefined }) } @@ -91,7 +92,10 @@ export async function listArtifactsPublic( artifacts.push({ name: artifact.name, id: artifact.id, - size: artifact.size_in_bytes + size: artifact.size_in_bytes, + createdAt: artifact.created_at + ? new Date(artifact.created_at) + : undefined }) } } @@ -118,7 +122,10 @@ export async function listArtifactsInternal(): Promise { const artifacts = res.artifacts.map(artifact => ({ name: artifact.name, id: Number(artifact.databaseId), - size: Number(artifact.size) + size: Number(artifact.size), + createdAt: artifact.createdAt + ? Timestamp.toDate(artifact.createdAt) + : undefined })) info(`Found ${artifacts.length} artifact(s)`) diff --git a/packages/artifact/src/internal/shared/interfaces.ts b/packages/artifact/src/internal/shared/interfaces.ts index bd764412..0b0e3768 100644 --- a/packages/artifact/src/internal/shared/interfaces.ts +++ b/packages/artifact/src/internal/shared/interfaces.ts @@ -124,6 +124,11 @@ export interface Artifact { * The size of the artifact in bytes */ size: number + + /** + * The time when the artifact was created + */ + createdAt?: Date } // FindOptions are for fetching Artifact(s) out of the scope of the current run. From fa7657714a70dc1072a1245a72ab012d96262f98 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Sat, 2 Dec 2023 21:34:07 -0500 Subject: [PATCH 018/198] fix import --- packages/artifact/src/internal/find/list-artifacts.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/src/internal/find/list-artifacts.ts b/packages/artifact/src/internal/find/list-artifacts.ts index a951fed1..e88c676e 100644 --- a/packages/artifact/src/internal/find/list-artifacts.ts +++ b/packages/artifact/src/internal/find/list-artifacts.ts @@ -9,7 +9,7 @@ import {retry} from '@octokit/plugin-retry' import {OctokitOptions} from '@octokit/core/dist-types/types' import {internalArtifactTwirpClient} from '../shared/artifact-twirp-client' import {getBackendIdsFromToken} from '../shared/util' -import {ListArtifactsRequest, Timestamp} from 'src/generated' +import {ListArtifactsRequest, Timestamp} from '../../generated' // Limiting to 1000 for perf reasons const maximumArtifactCount = 1000 From c94ca49c9c6442b56a6fe850a06624b8838eafce Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Sun, 3 Dec 2023 05:01:20 +0000 Subject: [PATCH 019/198] ability to filter artifacts by latest --- packages/artifact/src/internal/client.ts | 14 ++++-- .../src/internal/find/list-artifacts.ts | 50 +++++++++++++++++-- .../src/internal/shared/interfaces.ts | 9 ++++ 3 files changed, 65 insertions(+), 8 deletions(-) diff --git a/packages/artifact/src/internal/client.ts b/packages/artifact/src/internal/client.ts index 20563abc..4811104c 100644 --- a/packages/artifact/src/internal/client.ts +++ b/packages/artifact/src/internal/client.ts @@ -5,6 +5,7 @@ import { UploadResponse, DownloadArtifactOptions, GetArtifactResponse, + ListArtifactsOptions, ListArtifactsResponse, DownloadArtifactResponse, FindOptions @@ -44,7 +45,9 @@ export interface ArtifactClient { * @param options Extra options that allow for the customization of the list behavior * @returns ListArtifactResponse object */ - listArtifacts(options?: FindOptions): Promise + listArtifacts( + options?: ListArtifactsOptions & FindOptions + ): Promise /** * Finds an artifact by name. @@ -171,7 +174,9 @@ If the error persists, please check whether Actions and API requests are operati /** * List Artifacts */ - async listArtifacts(options?: FindOptions): Promise { + async listArtifacts( + options?: ListArtifactsOptions & FindOptions + ): Promise { if (isGhes()) { warning( `@actions/artifact v2.0.0+ and download-artifact@v4+ are not currently supported on GHES.` @@ -191,11 +196,12 @@ If the error persists, please check whether Actions and API requests are operati workflowRunId, repositoryOwner, repositoryName, - token + token, + options?.latest ) } - return listArtifactsInternal() + return listArtifactsInternal(options?.latest) } catch (error: unknown) { warning( `Listing Artifacts failed with error: ${error}. diff --git a/packages/artifact/src/internal/find/list-artifacts.ts b/packages/artifact/src/internal/find/list-artifacts.ts index e88c676e..a61ca583 100644 --- a/packages/artifact/src/internal/find/list-artifacts.ts +++ b/packages/artifact/src/internal/find/list-artifacts.ts @@ -20,13 +20,14 @@ export async function listArtifactsPublic( workflowRunId: number, repositoryOwner: string, repositoryName: string, - token: string + token: string, + latest = false ): Promise { info( `Fetching artifact list for workflow run ${workflowRunId} in repository ${repositoryOwner}/${repositoryName}` ) - const artifacts: Artifact[] = [] + let artifacts: Artifact[] = [] const [retryOpts, requestOpts] = getRetryOptions(defaultGitHubOptions) const opts: OctokitOptions = { @@ -100,6 +101,10 @@ export async function listArtifactsPublic( } } + if (latest) { + artifacts = filterLatest(artifacts) + } + info(`Found ${artifacts.length} artifact(s)`) return { @@ -107,7 +112,9 @@ export async function listArtifactsPublic( } } -export async function listArtifactsInternal(): Promise { +export async function listArtifactsInternal( + latest = false +): Promise { const artifactClient = internalArtifactTwirpClient() const {workflowRunBackendId, workflowJobRunBackendId} = @@ -119,7 +126,7 @@ export async function listArtifactsInternal(): Promise { } const res = await artifactClient.ListArtifacts(req) - const artifacts = res.artifacts.map(artifact => ({ + let artifacts: Artifact[] = res.artifacts.map(artifact => ({ name: artifact.name, id: Number(artifact.databaseId), size: Number(artifact.size), @@ -128,9 +135,44 @@ export async function listArtifactsInternal(): Promise { : undefined })) + if (latest) { + artifacts = filterLatest(artifacts) + } + info(`Found ${artifacts.length} artifact(s)`) return { artifacts } } + +/** + * Filters a list of artifacts to only include the latest artifact for each name + * @param artifacts The artifacts to filter + * @returns The filtered list of artifacts + */ +function filterLatest(artifacts: Artifact[]): Artifact[] { + artifacts.sort((a, b) => { + if (!a.createdAt && !b.createdAt) { + return 0 + } + if (!a.createdAt) { + return -1 + } + if (!b.createdAt) { + return 1 + } + return b.createdAt.getTime() - a.createdAt.getTime() + }) + + const latestArtifacts: Artifact[] = [] + const seenArtifactNames = new Set() + for (const artifact of artifacts) { + if (!seenArtifactNames.has(artifact.name)) { + latestArtifacts.push(artifact) + seenArtifactNames.add(artifact.name) + } + } + + return latestArtifacts +} diff --git a/packages/artifact/src/internal/shared/interfaces.ts b/packages/artifact/src/internal/shared/interfaces.ts index 0b0e3768..647e265f 100644 --- a/packages/artifact/src/internal/shared/interfaces.ts +++ b/packages/artifact/src/internal/shared/interfaces.ts @@ -74,6 +74,15 @@ export interface GetArtifactResponse { * ListArtifact * * * *****************************************************************************/ + +export interface ListArtifactsOptions { + /** + * Filter the workflow run's artifacts to the latest by name + * In the case of reruns, this can be useful to avoid duplicates + */ + latest?: boolean +} + export interface ListArtifactsResponse { /** * A list of artifacts that were found From c11a7cdeac6204d06b80cdb3d763af4361cd5791 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Sun, 3 Dec 2023 06:24:49 +0000 Subject: [PATCH 020/198] wip --- .../artifact/__tests__/get-artifact.test.ts | 205 ++++++++++++++++++ packages/artifact/src/internal/client.ts | 14 +- .../src/internal/find/get-artifact.ts | 15 +- .../src/internal/find/list-artifacts.ts | 15 +- .../src/internal/shared/interfaces.ts | 4 +- 5 files changed, 220 insertions(+), 33 deletions(-) create mode 100644 packages/artifact/__tests__/get-artifact.test.ts diff --git a/packages/artifact/__tests__/get-artifact.test.ts b/packages/artifact/__tests__/get-artifact.test.ts new file mode 100644 index 00000000..aa2b5331 --- /dev/null +++ b/packages/artifact/__tests__/get-artifact.test.ts @@ -0,0 +1,205 @@ +import * as github from '@actions/github' +import type {RequestInterface} from '@octokit/types' +import { + getArtifactInternal, + getArtifactPublic +} from '../src/internal/find/get-artifact' +import * as config from '../src/internal/shared/config' +import {ArtifactServiceClientJSON} from '../src/generated' +import * as util from '../src/internal/shared/util' +import {noopLogs} from './common' + +type MockedRequest = jest.MockedFunction> + +jest.mock('@actions/github', () => ({ + getOctokit: jest.fn().mockReturnValue({ + request: jest.fn() + }) +})) + +const fixtures = { + repo: 'toolkit', + owner: 'actions', + token: 'ghp_1234567890', + runId: 123, + backendIds: { + workflowRunBackendId: 'c4d7c21f-ba3f-4ddc-a8c8-6f2f626f8422', + workflowJobRunBackendId: '760803a1-f890-4d25-9a6e-a3fc01a0c7cf' + }, + artifacts: [ + { + id: 1, + name: 'my-artifact', + size: 456, + createdAt: new Date('2023-12-01') + }, + { + id: 2, + name: 'my-artifact', + size: 456, + createdAt: new Date('2023-12-02') + } + ] +} + +describe('get-artifact', () => { + beforeAll(() => { + noopLogs() + }) + + describe('public', () => { + it('should return the artifact if it is found', async () => { + const mockRequest = github.getOctokit(fixtures.token) + .request as MockedRequest + mockRequest.mockResolvedValueOnce({ + status: 200, + headers: {}, + url: '', + data: { + artifacts: [ + { + name: fixtures.artifacts[0].name, + id: fixtures.artifacts[0].id, + size_in_bytes: fixtures.artifacts[0].size, + created_at: fixtures.artifacts[0].createdAt.toISOString() + } + ] + } + }) + + const response = await getArtifactPublic( + fixtures.artifacts[0].name, + fixtures.runId, + fixtures.owner, + fixtures.repo, + fixtures.token + ) + + expect(response).toEqual({ + success: true, + artifact: fixtures.artifacts[0] + }) + }) + + it('should return the latest artifact if multiple are found', async () => { + const mockRequest = github.getOctokit(fixtures.token) + .request as MockedRequest + mockRequest.mockResolvedValueOnce({ + status: 200, + headers: {}, + url: '', + data: { + artifacts: fixtures.artifacts.map(artifact => ({ + name: artifact.name, + id: artifact.id, + size_in_bytes: artifact.size, + created_at: artifact.createdAt.toISOString() + })) + } + }) + + const response = await getArtifactPublic( + fixtures.artifacts[0].name, + fixtures.runId, + fixtures.owner, + fixtures.repo, + fixtures.token + ) + + expect(response).toEqual({ + success: true, + artifact: fixtures.artifacts[1] + }) + }) + + it('should fail if no artifacts are found', async () => { + const mockRequest = github.getOctokit(fixtures.token) + .request as MockedRequest + mockRequest.mockResolvedValueOnce({ + status: 200, + headers: {}, + url: '', + data: { + artifacts: [] + } + }) + + const response = await getArtifactPublic( + fixtures.artifacts[0].name, + fixtures.runId, + fixtures.owner, + fixtures.repo, + fixtures.token + ) + + expect(response).toEqual({ + success: false + }) + }) + + it('should fail if non-200 response', async () => { + const mockRequest = github.getOctokit(fixtures.token) + .request as MockedRequest + mockRequest.mockResolvedValueOnce({ + status: 404, + headers: {}, + url: '', + data: {} + }) + + const response = await getArtifactPublic( + fixtures.artifacts[0].name, + fixtures.runId, + fixtures.owner, + fixtures.repo, + fixtures.token + ) + + expect(response).toEqual({ + success: false + }) + }) + }) + + describe('internal', () => { + beforeEach(() => { + jest.spyOn(config, 'getRuntimeToken').mockReturnValue('test-token') + + jest + .spyOn(util, 'getBackendIdsFromToken') + .mockReturnValue(fixtures.backendIds) + + jest + .spyOn(config, 'getResultsServiceUrl') + .mockReturnValue('https://results.local') + }) + + it('should return the artifact if it is found', async () => { + jest + .spyOn(ArtifactServiceClientJSON.prototype, 'ListArtifacts') + .mockResolvedValue({ + artifacts: [ + { + ...fixtures.backendIds, + databaseId: fixtures.artifacts[0].id.toString(), + name: fixtures.artifacts[0].name, + size: fixtures.artifacts[0].size.toString() + } + ] + }) + + const response = await getArtifactInternal(fixtures.artifacts[0].name) + + expect(response).toEqual({ + success: true, + artifact: fixtures.artifacts[0] + }) + }) + + it('should return the latest artifact if multiple are found', async () => {}) + + it('should fail if no artifacts are found', async () => {}) + + it('should fail if non-200 response', async () => {}) + }) +}) diff --git a/packages/artifact/src/internal/client.ts b/packages/artifact/src/internal/client.ts index 4811104c..97559652 100644 --- a/packages/artifact/src/internal/client.ts +++ b/packages/artifact/src/internal/client.ts @@ -1,8 +1,8 @@ import {warning} from '@actions/core' import {isGhes} from './shared/config' import { - UploadOptions, - UploadResponse, + UploadArtifactOptions, + UploadArtifactResponse, DownloadArtifactOptions, GetArtifactResponse, ListArtifactsOptions, @@ -26,14 +26,14 @@ export interface ArtifactClient { * @param files A list of absolute or relative paths that denote what files should be uploaded * @param rootDirectory An absolute or relative file path that denotes the root parent directory of the files being uploaded * @param options Extra options for customizing the upload behavior - * @returns single UploadResponse object + * @returns single UploadArtifactResponse object */ uploadArtifact( name: string, files: string[], rootDirectory: string, - options?: UploadOptions - ): Promise + options?: UploadArtifactOptions + ): Promise /** * Lists all artifacts that are part of the current workflow run. @@ -96,8 +96,8 @@ export class Client implements ArtifactClient { name: string, files: string[], rootDirectory: string, - options?: UploadOptions - ): Promise { + options?: UploadArtifactOptions + ): Promise { if (isGhes()) { warning( `@actions/artifact v2.0.0+ and upload-artifact@v4+ are not currently supported on GHES.` diff --git a/packages/artifact/src/internal/find/get-artifact.ts b/packages/artifact/src/internal/find/get-artifact.ts index 2bc1dc97..91c85818 100644 --- a/packages/artifact/src/internal/find/get-artifact.ts +++ b/packages/artifact/src/internal/find/get-artifact.ts @@ -56,12 +56,9 @@ export async function getArtifactPublic( let artifact = getArtifactResp.data.artifacts[0] if (getArtifactResp.data.artifacts.length > 1) { - artifact = getArtifactResp.data.artifacts.reduce((prev, current) => { - new Date(prev.created_at) > new Date(current.created_at) ? prev : current - }) - + artifact = getArtifactResp.data.artifacts.sort((a, b) => b.id - a.id)[0] core.debug( - `more than one artifact found for a single name, returning newest (id: ${artifact.id})` + `More than one artifact found for a single name, returning newest (id: ${artifact.id})` ) } @@ -101,11 +98,9 @@ export async function getArtifactInternal( let artifact = res.artifacts[0] if (res.artifacts.length > 1) { - artifact = res.artifacts.reduce((prev, current) => { - const prevDate = Timestamp.toDate(prev.createdAt || Timestamp.now()) - const currentDate = Timestamp.toDate(current.createdAt || Timestamp.now()) - return prevDate > currentDate ? prev : current - }) + artifact = res.artifacts.sort( + (a, b) => Number(b.databaseId) - Number(a.databaseId) + )[0] core.debug( `more than one artifact found for a single name, returning newest (id: ${artifact.databaseId})` diff --git a/packages/artifact/src/internal/find/list-artifacts.ts b/packages/artifact/src/internal/find/list-artifacts.ts index a61ca583..cd83320c 100644 --- a/packages/artifact/src/internal/find/list-artifacts.ts +++ b/packages/artifact/src/internal/find/list-artifacts.ts @@ -152,19 +152,7 @@ export async function listArtifactsInternal( * @returns The filtered list of artifacts */ function filterLatest(artifacts: Artifact[]): Artifact[] { - artifacts.sort((a, b) => { - if (!a.createdAt && !b.createdAt) { - return 0 - } - if (!a.createdAt) { - return -1 - } - if (!b.createdAt) { - return 1 - } - return b.createdAt.getTime() - a.createdAt.getTime() - }) - + artifacts.sort((a, b) => b.id - a.id) const latestArtifacts: Artifact[] = [] const seenArtifactNames = new Set() for (const artifact of artifacts) { @@ -173,6 +161,5 @@ function filterLatest(artifacts: Artifact[]): Artifact[] { seenArtifactNames.add(artifact.name) } } - return latestArtifacts } diff --git a/packages/artifact/src/internal/shared/interfaces.ts b/packages/artifact/src/internal/shared/interfaces.ts index 647e265f..61994b2b 100644 --- a/packages/artifact/src/internal/shared/interfaces.ts +++ b/packages/artifact/src/internal/shared/interfaces.ts @@ -3,7 +3,7 @@ * UploadArtifact * * * *****************************************************************************/ -export interface UploadResponse { +export interface UploadArtifactResponse { /** * Denotes if an artifact was successfully uploaded */ @@ -21,7 +21,7 @@ export interface UploadResponse { id?: number } -export interface UploadOptions { +export interface UploadArtifactOptions { /** * Duration after which artifact will expire in days. * From 86ce0b159a27ce90292da2201a7ce62f8698a842 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Sun, 3 Dec 2023 19:43:37 +0000 Subject: [PATCH 021/198] get artifact tests --- .../artifact/__tests__/get-artifact.test.ts | 50 +++++++++++++++++-- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/packages/artifact/__tests__/get-artifact.test.ts b/packages/artifact/__tests__/get-artifact.test.ts index aa2b5331..82008a4b 100644 --- a/packages/artifact/__tests__/get-artifact.test.ts +++ b/packages/artifact/__tests__/get-artifact.test.ts @@ -5,7 +5,7 @@ import { getArtifactPublic } from '../src/internal/find/get-artifact' import * as config from '../src/internal/shared/config' -import {ArtifactServiceClientJSON} from '../src/generated' +import {ArtifactServiceClientJSON, Timestamp} from '../src/generated' import * as util from '../src/internal/shared/util' import {noopLogs} from './common' @@ -183,7 +183,8 @@ describe('get-artifact', () => { ...fixtures.backendIds, databaseId: fixtures.artifacts[0].id.toString(), name: fixtures.artifacts[0].name, - size: fixtures.artifacts[0].size.toString() + size: fixtures.artifacts[0].size.toString(), + createdAt: Timestamp.fromDate(fixtures.artifacts[0].createdAt) } ] }) @@ -196,10 +197,49 @@ describe('get-artifact', () => { }) }) - it('should return the latest artifact if multiple are found', async () => {}) + it('should return the latest artifact if multiple are found', async () => { + jest + .spyOn(ArtifactServiceClientJSON.prototype, 'ListArtifacts') + .mockResolvedValue({ + artifacts: fixtures.artifacts.map(artifact => ({ + ...fixtures.backendIds, + databaseId: artifact.id.toString(), + name: artifact.name, + size: artifact.size.toString(), + createdAt: Timestamp.fromDate(artifact.createdAt) + })) + }) - it('should fail if no artifacts are found', async () => {}) + const response = await getArtifactInternal(fixtures.artifacts[0].name) - it('should fail if non-200 response', async () => {}) + expect(response).toEqual({ + success: true, + artifact: fixtures.artifacts[1] + }) + }) + + it('should fail if no artifacts are found', async () => { + jest + .spyOn(ArtifactServiceClientJSON.prototype, 'ListArtifacts') + .mockResolvedValue({ + artifacts: [] + }) + + const response = await getArtifactInternal(fixtures.artifacts[0].name) + + expect(response).toEqual({ + success: false + }) + }) + + it('should fail if non-200 response', async () => { + jest + .spyOn(ArtifactServiceClientJSON.prototype, 'ListArtifacts') + .mockRejectedValue(new Error('test error')) + + await expect( + getArtifactInternal(fixtures.artifacts[0].name) + ).rejects.toThrow('test error') + }) }) }) From ef454f0991074c7772587d36e9c3585bf3d4d030 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Sun, 3 Dec 2023 20:48:33 +0000 Subject: [PATCH 022/198] add tests for list-artifacts --- .../artifact/__tests__/list-artifacts.test.ts | 242 ++++++++++++++++++ 1 file changed, 242 insertions(+) create mode 100644 packages/artifact/__tests__/list-artifacts.test.ts diff --git a/packages/artifact/__tests__/list-artifacts.test.ts b/packages/artifact/__tests__/list-artifacts.test.ts new file mode 100644 index 00000000..7c8699e7 --- /dev/null +++ b/packages/artifact/__tests__/list-artifacts.test.ts @@ -0,0 +1,242 @@ +import * as github from '@actions/github' +import type {RestEndpointMethods} from '@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types' +import type {RestEndpointMethodTypes} from '@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types' +import { + listArtifactsInternal, + listArtifactsPublic +} from '../src/internal/find/list-artifacts' +import * as config from '../src/internal/shared/config' +import {ArtifactServiceClientJSON, Timestamp} from '../src/generated' +import * as util from '../src/internal/shared/util' +import {noopLogs} from './common' +import {Artifact} from '../src/internal/shared/interfaces' + +type MockedListWorkflowRunArtifacts = jest.MockedFunction< + RestEndpointMethods['actions']['listWorkflowRunArtifacts'] +> + +jest.mock('@actions/github', () => ({ + getOctokit: jest.fn().mockReturnValue({ + rest: { + actions: { + listWorkflowRunArtifacts: jest.fn() + } + } + }) +})) + +const artifactsToListResponse = ( + artifacts: Artifact[] +): RestEndpointMethodTypes['actions']['listWorkflowRunArtifacts']['response']['data'] => { + return { + total_count: artifacts.length, + artifacts: artifacts.map(artifact => ({ + name: artifact.name, + id: artifact.id, + size_in_bytes: artifact.size, + created_at: artifact.createdAt?.toISOString() || '', + run_id: fixtures.runId, + // unused fields for tests + url: '', + archive_download_url: '', + expired: false, + expires_at: '', + node_id: '', + run_url: '', + type: '', + updated_at: '' + })) + } +} + +const fixtures = { + repo: 'toolkit', + owner: 'actions', + token: 'ghp_1234567890', + runId: 123, + backendIds: { + workflowRunBackendId: 'c4d7c21f-ba3f-4ddc-a8c8-6f2f626f8422', + workflowJobRunBackendId: '760803a1-f890-4d25-9a6e-a3fc01a0c7cf' + }, + artifacts: [ + { + id: 1, + name: 'my-artifact', + size: 456, + createdAt: new Date('2023-12-01') + }, + { + id: 2, + name: 'my-artifact', + size: 456, + createdAt: new Date('2023-12-02') + } + ] +} + +describe('list-artifact', () => { + beforeAll(() => { + noopLogs() + }) + + describe('public', () => { + it('should return a list of artifacts', async () => { + const mockListArtifacts = github.getOctokit(fixtures.token).rest.actions + .listWorkflowRunArtifacts as MockedListWorkflowRunArtifacts + + mockListArtifacts.mockResolvedValueOnce({ + status: 200, + headers: {}, + url: '', + data: artifactsToListResponse(fixtures.artifacts) + }) + + const response = await listArtifactsPublic( + fixtures.runId, + fixtures.owner, + fixtures.repo, + fixtures.token, + false + ) + + expect(response).toEqual({ + artifacts: fixtures.artifacts + }) + }) + + it('should return the latest artifact when latest is specified', async () => { + const mockListArtifacts = github.getOctokit(fixtures.token).rest.actions + .listWorkflowRunArtifacts as MockedListWorkflowRunArtifacts + + mockListArtifacts.mockResolvedValueOnce({ + status: 200, + headers: {}, + url: '', + data: artifactsToListResponse(fixtures.artifacts) + }) + + const response = await listArtifactsPublic( + fixtures.runId, + fixtures.owner, + fixtures.repo, + fixtures.token, + true + ) + + expect(response).toEqual({ + artifacts: [fixtures.artifacts[1]] + }) + }) + + it('can return empty artifacts', async () => { + const mockListArtifacts = github.getOctokit(fixtures.token).rest.actions + .listWorkflowRunArtifacts as MockedListWorkflowRunArtifacts + + mockListArtifacts.mockResolvedValueOnce({ + status: 200, + headers: {}, + url: '', + data: { + total_count: 0, + artifacts: [] + } + }) + + const response = await listArtifactsPublic( + fixtures.runId, + fixtures.owner, + fixtures.repo, + fixtures.token, + true + ) + + expect(response).toEqual({ + artifacts: [] + }) + }) + + it('should fail if non-200 response', async () => { + const mockListArtifacts = github.getOctokit(fixtures.token).rest.actions + .listWorkflowRunArtifacts as MockedListWorkflowRunArtifacts + + mockListArtifacts.mockRejectedValue(new Error('boom')) + + await expect( + listArtifactsPublic( + fixtures.runId, + fixtures.owner, + fixtures.repo, + fixtures.token, + false + ) + ).rejects.toThrow('boom') + }) + }) + + describe('internal', () => { + beforeEach(() => { + jest.spyOn(config, 'getRuntimeToken').mockReturnValue('test-token') + jest + .spyOn(util, 'getBackendIdsFromToken') + .mockReturnValue(fixtures.backendIds) + jest + .spyOn(config, 'getResultsServiceUrl') + .mockReturnValue('https://results.local') + }) + + it('should return a list of artifacts', async () => { + jest + .spyOn(ArtifactServiceClientJSON.prototype, 'ListArtifacts') + .mockResolvedValue({ + artifacts: fixtures.artifacts.map(artifact => ({ + ...fixtures.backendIds, + databaseId: artifact.id.toString(), + name: artifact.name, + size: artifact.size.toString(), + createdAt: Timestamp.fromDate(artifact.createdAt) + })) + }) + const response = await listArtifactsInternal(false) + expect(response).toEqual({ + artifacts: fixtures.artifacts + }) + }) + + it('should return the latest artifact when latest is specified', async () => { + jest + .spyOn(ArtifactServiceClientJSON.prototype, 'ListArtifacts') + .mockResolvedValue({ + artifacts: fixtures.artifacts.map(artifact => ({ + ...fixtures.backendIds, + databaseId: artifact.id.toString(), + name: artifact.name, + size: artifact.size.toString(), + createdAt: Timestamp.fromDate(artifact.createdAt) + })) + }) + const response = await listArtifactsInternal(true) + expect(response).toEqual({ + artifacts: [fixtures.artifacts[1]] + }) + }) + + it('can return empty artifacts', async () => { + jest + .spyOn(ArtifactServiceClientJSON.prototype, 'ListArtifacts') + .mockResolvedValue({ + artifacts: [] + }) + const response = await listArtifactsInternal(false) + expect(response).toEqual({ + artifacts: [] + }) + }) + + it('should fail if non-200 response', async () => { + jest + .spyOn(ArtifactServiceClientJSON.prototype, 'ListArtifacts') + .mockRejectedValue(new Error('boom')) + await expect(listArtifactsInternal(false)).rejects.toThrow('boom') + }) + }) +}) From 790e6f71945483a87e9d56e50ff7f24686304886 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Sun, 3 Dec 2023 20:52:36 +0000 Subject: [PATCH 023/198] more docs --- packages/artifact/src/internal/client.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/artifact/src/internal/client.ts b/packages/artifact/src/internal/client.ts index 97559652..45ba0bfe 100644 --- a/packages/artifact/src/internal/client.ts +++ b/packages/artifact/src/internal/client.ts @@ -51,6 +51,7 @@ export interface ArtifactClient { /** * Finds an artifact by name. + * If there are multiple artifacts with the same name in the same workflow run, this will return the latest. * * If options.findBy is specified, this will use the public List Artifacts API with a name filter which can get artifacts from other runs. * https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts From 141b3509e4095f289a05a12bdf8a02ba4146f8b2 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Sun, 3 Dec 2023 21:13:55 +0000 Subject: [PATCH 024/198] update import --- packages/artifact/src/internal/upload/upload-artifact.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/artifact/src/internal/upload/upload-artifact.ts b/packages/artifact/src/internal/upload/upload-artifact.ts index 011dc4c8..6546f98f 100644 --- a/packages/artifact/src/internal/upload/upload-artifact.ts +++ b/packages/artifact/src/internal/upload/upload-artifact.ts @@ -1,5 +1,8 @@ import * as core from '@actions/core' -import {UploadOptions, UploadResponse} from '../shared/interfaces' +import { + UploadArtifactOptions, + UploadArtifactResponse +} from '../shared/interfaces' import {getExpiration} from './retention' import {validateArtifactName} from './path-and-artifact-name-validation' import {internalArtifactTwirpClient} from '../shared/artifact-twirp-client' @@ -21,8 +24,8 @@ export async function uploadArtifact( name: string, files: string[], rootDirectory: string, - options?: UploadOptions | undefined -): Promise { + options?: UploadArtifactOptions | undefined +): Promise { validateArtifactName(name) validateRootDirectory(rootDirectory) From 75a35860615d2c8cb85640d8ec0e2c936c952bf9 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Tue, 5 Dec 2023 17:35:46 +0000 Subject: [PATCH 025/198] consistent promise behavior for upload artifact --- .../__tests__/upload-artifact.test.ts | 19 ++++----- packages/artifact/src/artifact.ts | 1 + .../artifact/src/internal/shared/errors.ts | 21 ++++++++++ .../src/internal/shared/interfaces.ts | 5 --- .../src/internal/upload/blob-upload.ts | 42 ++++++------------- .../src/internal/upload/upload-artifact.ts | 28 +++++-------- 6 files changed, 53 insertions(+), 63 deletions(-) create mode 100644 packages/artifact/src/internal/shared/errors.ts diff --git a/packages/artifact/__tests__/upload-artifact.test.ts b/packages/artifact/__tests__/upload-artifact.test.ts index 439a96a3..b0dca5c8 100644 --- a/packages/artifact/__tests__/upload-artifact.test.ts +++ b/packages/artifact/__tests__/upload-artifact.test.ts @@ -7,6 +7,7 @@ import {Timestamp, ArtifactServiceClientJSON} from '../src/generated' import * as blobUpload from '../src/internal/upload/blob-upload' import {uploadArtifact} from '../src/internal/upload/upload-artifact' import {noopLogs} from './common' +import {FilesNotFoundError} from '../src/internal/shared/errors' describe('upload-artifact', () => { beforeEach(() => { @@ -59,7 +60,6 @@ describe('upload-artifact', () => { ) jest.spyOn(blobUpload, 'uploadZipToBlobStorage').mockReturnValue( Promise.resolve({ - isSuccess: true, uploadSize: 1234, sha256Hash: 'test-sha256-hash' }) @@ -84,7 +84,7 @@ describe('upload-artifact', () => { '/home/user/files/plz-upload' ) - expect(uploadResp).resolves.toEqual({success: true, size: 1234, id: 1}) + expect(uploadResp).resolves.toEqual({size: 1234, id: 1}) }) it('should throw an error if the root directory is invalid', () => { @@ -107,7 +107,7 @@ describe('upload-artifact', () => { expect(uploadResp).rejects.toThrow('Invalid root directory') }) - it('should return false if there are no files to upload', () => { + it('should reject if there are no files to upload', () => { jest .spyOn(uploadZipSpecification, 'validateRootDirectory') .mockReturnValue() @@ -124,7 +124,7 @@ describe('upload-artifact', () => { ], '/home/user/files/plz-upload' ) - expect(uploadResp).resolves.toEqual({success: false}) + expect(uploadResp).rejects.toThrowError(FilesNotFoundError) }) it('should reject if no backend IDs are found', () => { @@ -217,7 +217,7 @@ describe('upload-artifact', () => { '/home/user/files/plz-upload' ) - expect(uploadResp).resolves.toEqual({success: false}) + expect(uploadResp).rejects.toThrow() }) it('should return false if blob storage upload is unsuccessful', () => { @@ -262,7 +262,7 @@ describe('upload-artifact', () => { ) jest .spyOn(blobUpload, 'uploadZipToBlobStorage') - .mockReturnValue(Promise.resolve({isSuccess: false})) + .mockReturnValue(Promise.reject(new Error('boom'))) // ArtifactHttpClient mocks jest.spyOn(config, 'getRuntimeToken').mockReturnValue('test-token') @@ -280,10 +280,10 @@ describe('upload-artifact', () => { '/home/user/files/plz-upload' ) - expect(uploadResp).resolves.toEqual({success: false}) + expect(uploadResp).rejects.toThrow() }) - it('should return false if finalize artifact fails', () => { + it('should reject if finalize artifact fails', () => { const mockDate = new Date('2020-01-01') jest .spyOn(uploadZipSpecification, 'validateRootDirectory') @@ -325,7 +325,6 @@ describe('upload-artifact', () => { ) jest.spyOn(blobUpload, 'uploadZipToBlobStorage').mockReturnValue( Promise.resolve({ - isSuccess: true, uploadSize: 1234, sha256Hash: 'test-sha256-hash' }) @@ -350,6 +349,6 @@ describe('upload-artifact', () => { '/home/user/files/plz-upload' ) - expect(uploadResp).resolves.toEqual({success: false}) + expect(uploadResp).rejects.toThrow() }) }) diff --git a/packages/artifact/src/artifact.ts b/packages/artifact/src/artifact.ts index 5742b32d..3ba38448 100644 --- a/packages/artifact/src/artifact.ts +++ b/packages/artifact/src/artifact.ts @@ -4,6 +4,7 @@ import {ArtifactClient, Client} from './internal/client' * Exported functionality that we want to expose for any users of @actions/artifact */ export * from './internal/shared/interfaces' +export * from './internal/shared/errors' export {ArtifactClient} export function create(): ArtifactClient { diff --git a/packages/artifact/src/internal/shared/errors.ts b/packages/artifact/src/internal/shared/errors.ts new file mode 100644 index 00000000..37b92d14 --- /dev/null +++ b/packages/artifact/src/internal/shared/errors.ts @@ -0,0 +1,21 @@ +export class FilesNotFoundError extends Error { + files: string[] + + constructor(files: string[] = []) { + let message = 'No files were found to upload' + if (files.length > 0) { + message += `: ${files.join(', ')}` + } + + super(message) + this.files = files + this.name = 'FilesNotFoundError' + } +} + +export class InvalidResponseError extends Error { + constructor(message: string) { + super(message) + this.name = 'InvalidResponseError' + } +} diff --git a/packages/artifact/src/internal/shared/interfaces.ts b/packages/artifact/src/internal/shared/interfaces.ts index 61994b2b..654c5981 100644 --- a/packages/artifact/src/internal/shared/interfaces.ts +++ b/packages/artifact/src/internal/shared/interfaces.ts @@ -4,11 +4,6 @@ * * *****************************************************************************/ export interface UploadArtifactResponse { - /** - * Denotes if an artifact was successfully uploaded - */ - success: boolean - /** * Total size of the artifact in bytes. Not provided if no artifact was uploaded */ diff --git a/packages/artifact/src/internal/upload/blob-upload.ts b/packages/artifact/src/internal/upload/blob-upload.ts index cb7a11b7..59472385 100644 --- a/packages/artifact/src/internal/upload/blob-upload.ts +++ b/packages/artifact/src/internal/upload/blob-upload.ts @@ -7,11 +7,6 @@ import * as crypto from 'crypto' import * as stream from 'stream' export interface BlobUploadResponse { - /** - * If the upload was successful or not - */ - isSuccess: boolean - /** * The total reported upload size in bytes. Empty if the upload failed */ @@ -55,41 +50,28 @@ export async function uploadZipToBlobStorage( zipUploadStream.pipe(uploadStream) // This stream is used for the upload zipUploadStream.pipe(hashStream).setEncoding('hex') // This stream is used to compute a hash of the zip content that gets used. Integrity check - try { - core.info('Beginning upload of artifact content to blob storage') + core.info('Beginning upload of artifact content to blob storage') - await blockBlobClient.uploadStream( - uploadStream, - bufferSize, - maxConcurrency, - options - ) + await blockBlobClient.uploadStream( + uploadStream, + bufferSize, + maxConcurrency, + options + ) - core.info('Finished uploading artifact content to blob storage!') + core.info('Finished uploading artifact content to blob storage!') - hashStream.end() - sha256Hash = hashStream.read() as string - core.info(`SHA256 hash of uploaded artifact zip is ${sha256Hash}`) - } catch (error) { - core.warning( - `Failed to upload artifact zip to blob storage, error: ${error}` - ) - return { - isSuccess: false - } - } + hashStream.end() + sha256Hash = hashStream.read() as string + core.info(`SHA256 hash of uploaded artifact zip is ${sha256Hash}`) if (uploadByteCount === 0) { core.warning( - `No data was uploaded to blob storage. Reported upload byte count is 0` + `No data was uploaded to blob storage. Reported upload byte count is 0.` ) - return { - isSuccess: false - } } return { - isSuccess: true, uploadSize: uploadByteCount, sha256Hash } diff --git a/packages/artifact/src/internal/upload/upload-artifact.ts b/packages/artifact/src/internal/upload/upload-artifact.ts index 6546f98f..55921252 100644 --- a/packages/artifact/src/internal/upload/upload-artifact.ts +++ b/packages/artifact/src/internal/upload/upload-artifact.ts @@ -19,6 +19,7 @@ import { FinalizeArtifactRequest, StringValue } from '../../generated' +import {FilesNotFoundError, InvalidResponseError} from '../shared/errors' export async function uploadArtifact( name: string, @@ -34,10 +35,9 @@ export async function uploadArtifact( rootDirectory ) if (zipSpecification.length === 0) { - core.warning(`No files were found to upload`) - return { - success: false - } + throw new FilesNotFoundError( + zipSpecification.flatMap(s => (s.sourcePath ? [s.sourcePath] : [])) + ) } const zipUploadStream = await createZipUploadStream( @@ -68,10 +68,9 @@ export async function uploadArtifact( const createArtifactResp = await artifactClient.CreateArtifact(createArtifactReq) if (!createArtifactResp.ok) { - core.warning(`Failed to create artifact`) - return { - success: false - } + throw new InvalidResponseError( + 'CreateArtifact: response from backend was not ok' + ) } // Upload zip to blob storage @@ -79,11 +78,6 @@ export async function uploadArtifact( createArtifactResp.signedUploadUrl, zipUploadStream ) - if (uploadResult.isSuccess === false) { - return { - success: false - } - } // finalize the artifact const finalizeArtifactReq: FinalizeArtifactRequest = { @@ -104,10 +98,9 @@ export async function uploadArtifact( const finalizeArtifactResp = await artifactClient.FinalizeArtifact(finalizeArtifactReq) if (!finalizeArtifactResp.ok) { - core.warning(`Failed to finalize artifact`) - return { - success: false - } + throw new InvalidResponseError( + 'FinalizeArtifact: response from backend was not ok' + ) } const artifactId = BigInt(finalizeArtifactResp.artifactId) @@ -116,7 +109,6 @@ export async function uploadArtifact( ) return { - success: true, size: uploadResult.uploadSize, id: Number(artifactId) } From d3c5f358d11f9b074021398c0c6bc98f6c9bff5f Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Tue, 5 Dec 2023 17:56:18 +0000 Subject: [PATCH 026/198] consistent promise behavior for get artifact --- .../artifact/__tests__/get-artifact.test.ts | 34 ++++++++----------- .../src/internal/find/get-artifact.ts | 22 ++++-------- .../artifact/src/internal/shared/errors.ts | 8 +++++ .../src/internal/shared/interfaces.ts | 5 --- 4 files changed, 29 insertions(+), 40 deletions(-) diff --git a/packages/artifact/__tests__/get-artifact.test.ts b/packages/artifact/__tests__/get-artifact.test.ts index 82008a4b..56ed0d34 100644 --- a/packages/artifact/__tests__/get-artifact.test.ts +++ b/packages/artifact/__tests__/get-artifact.test.ts @@ -8,6 +8,10 @@ import * as config from '../src/internal/shared/config' import {ArtifactServiceClientJSON, Timestamp} from '../src/generated' import * as util from '../src/internal/shared/util' import {noopLogs} from './common' +import { + ArtifactNotFoundError, + InvalidResponseError +} from '../src/internal/shared/errors' type MockedRequest = jest.MockedFunction> @@ -76,7 +80,6 @@ describe('get-artifact', () => { ) expect(response).toEqual({ - success: true, artifact: fixtures.artifacts[0] }) }) @@ -107,7 +110,6 @@ describe('get-artifact', () => { ) expect(response).toEqual({ - success: true, artifact: fixtures.artifacts[1] }) }) @@ -124,7 +126,7 @@ describe('get-artifact', () => { } }) - const response = await getArtifactPublic( + const response = getArtifactPublic( fixtures.artifacts[0].name, fixtures.runId, fixtures.owner, @@ -132,9 +134,7 @@ describe('get-artifact', () => { fixtures.token ) - expect(response).toEqual({ - success: false - }) + expect(response).rejects.toThrowError(ArtifactNotFoundError) }) it('should fail if non-200 response', async () => { @@ -147,7 +147,7 @@ describe('get-artifact', () => { data: {} }) - const response = await getArtifactPublic( + const response = getArtifactPublic( fixtures.artifacts[0].name, fixtures.runId, fixtures.owner, @@ -155,9 +155,7 @@ describe('get-artifact', () => { fixtures.token ) - expect(response).toEqual({ - success: false - }) + expect(response).rejects.toThrowError(InvalidResponseError) }) }) @@ -192,7 +190,6 @@ describe('get-artifact', () => { const response = await getArtifactInternal(fixtures.artifacts[0].name) expect(response).toEqual({ - success: true, artifact: fixtures.artifacts[0] }) }) @@ -213,7 +210,6 @@ describe('get-artifact', () => { const response = await getArtifactInternal(fixtures.artifacts[0].name) expect(response).toEqual({ - success: true, artifact: fixtures.artifacts[1] }) }) @@ -225,21 +221,19 @@ describe('get-artifact', () => { artifacts: [] }) - const response = await getArtifactInternal(fixtures.artifacts[0].name) + const response = getArtifactInternal(fixtures.artifacts[0].name) - expect(response).toEqual({ - success: false - }) + expect(response).rejects.toThrowError(ArtifactNotFoundError) }) it('should fail if non-200 response', async () => { jest .spyOn(ArtifactServiceClientJSON.prototype, 'ListArtifacts') - .mockRejectedValue(new Error('test error')) + .mockRejectedValue(new Error('boom')) - await expect( - getArtifactInternal(fixtures.artifacts[0].name) - ).rejects.toThrow('test error') + const response = getArtifactInternal(fixtures.artifacts[0].name) + + expect(response).rejects.toThrow() }) }) }) diff --git a/packages/artifact/src/internal/find/get-artifact.ts b/packages/artifact/src/internal/find/get-artifact.ts index 91c85818..45db581f 100644 --- a/packages/artifact/src/internal/find/get-artifact.ts +++ b/packages/artifact/src/internal/find/get-artifact.ts @@ -10,6 +10,7 @@ import {getBackendIdsFromToken} from '../shared/util' import {getUserAgentString} from '../shared/user-agent' import {internalArtifactTwirpClient} from '../shared/artifact-twirp-client' import {ListArtifactsRequest, StringValue, Timestamp} from '../../generated' +import {ArtifactNotFoundError, InvalidResponseError} from '../shared/errors' export async function getArtifactPublic( artifactName: string, @@ -41,17 +42,13 @@ export async function getArtifactPublic( ) if (getArtifactResp.status !== 200) { - core.warning(`non-200 response from GitHub API: ${getArtifactResp.status}`) - return { - success: false - } + throw new InvalidResponseError( + `Invalid response from GitHub API: ${getArtifactResp.status} (${getArtifactResp?.headers?.['x-github-request-id']})` + ) } if (getArtifactResp.data.artifacts.length === 0) { - core.warning('no artifacts found') - return { - success: false - } + throw new ArtifactNotFoundError(artifactName) } let artifact = getArtifactResp.data.artifacts[0] @@ -63,7 +60,6 @@ export async function getArtifactPublic( } return { - success: true, artifact: { name: artifact.name, id: artifact.id, @@ -90,10 +86,7 @@ export async function getArtifactInternal( const res = await artifactClient.ListArtifacts(req) if (res.artifacts.length === 0) { - core.warning('no artifacts found') - return { - success: false - } + throw new ArtifactNotFoundError(artifactName) } let artifact = res.artifacts[0] @@ -103,12 +96,11 @@ export async function getArtifactInternal( )[0] core.debug( - `more than one artifact found for a single name, returning newest (id: ${artifact.databaseId})` + `More than one artifact found for a single name, returning newest (id: ${artifact.databaseId})` ) } return { - success: true, artifact: { name: artifact.name, id: Number(artifact.databaseId), diff --git a/packages/artifact/src/internal/shared/errors.ts b/packages/artifact/src/internal/shared/errors.ts index 37b92d14..2ddf79ab 100644 --- a/packages/artifact/src/internal/shared/errors.ts +++ b/packages/artifact/src/internal/shared/errors.ts @@ -19,3 +19,11 @@ export class InvalidResponseError extends Error { this.name = 'InvalidResponseError' } } + +export class ArtifactNotFoundError extends Error { + constructor(name: string) { + const message = `No artifact found for name: ${name}` + super(message) + this.name = 'ArtifactNotFoundError' + } +} diff --git a/packages/artifact/src/internal/shared/interfaces.ts b/packages/artifact/src/internal/shared/interfaces.ts index 654c5981..b72274de 100644 --- a/packages/artifact/src/internal/shared/interfaces.ts +++ b/packages/artifact/src/internal/shared/interfaces.ts @@ -53,11 +53,6 @@ export interface UploadArtifactOptions { *****************************************************************************/ export interface GetArtifactResponse { - /** - * If an artifact was found - */ - success: boolean - /** * Metadata about the artifact that was found */ From ce9eae0785a556ab1e9e3cb095353e7045378b0b Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Tue, 5 Dec 2023 18:35:26 +0000 Subject: [PATCH 027/198] consistent promise behavior for download artifact --- packages/artifact/__tests__/download-artifact.test.ts | 4 ---- .../artifact/src/internal/download/download-artifact.ts | 8 ++++---- packages/artifact/src/internal/find/get-artifact.ts | 8 ++++++-- packages/artifact/src/internal/shared/errors.ts | 3 +-- packages/artifact/src/internal/shared/interfaces.ts | 4 ---- 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index f28d442d..247a5e42 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -164,7 +164,6 @@ describe('download-artifact', () => { fixtures.blobStorageUrl ) expectExtractedArchive(fixtures.workspaceDir) - expect(response.success).toBe(true) expect(response.downloadPath).toBe(fixtures.workspaceDir) }) @@ -214,7 +213,6 @@ describe('download-artifact', () => { fixtures.blobStorageUrl ) expectExtractedArchive(customPath) - expect(response.success).toBe(true) expect(response.downloadPath).toBe(customPath) }) @@ -344,7 +342,6 @@ describe('download-artifact', () => { const response = await downloadArtifactInternal(fixtures.artifactID) expectExtractedArchive(fixtures.workspaceDir) - expect(response.success).toBe(true) expect(response.downloadPath).toBe(fixtures.workspaceDir) expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) expect(mockListArtifacts).toHaveBeenCalledWith({ @@ -396,7 +393,6 @@ describe('download-artifact', () => { }) expectExtractedArchive(customPath) - expect(response.success).toBe(true) expect(response.downloadPath).toBe(customPath) expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) expect(mockListArtifacts).toHaveBeenCalledWith({ diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index cf5b5e15..3bb3de61 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -16,6 +16,7 @@ import { ListArtifactsRequest } from '../../generated' import {getBackendIdsFromToken} from '../shared/util' +import {ArtifactNotFoundError} from '../shared/errors' const scrubQueryParameters = (url: string): string => { const parsed = new URL(url) @@ -95,7 +96,7 @@ export async function downloadArtifactPublic( throw new Error(`Unable to download and extract artifact: ${error.message}`) } - return {success: true, downloadPath} + return {downloadPath} } export async function downloadArtifactInternal( @@ -118,10 +119,9 @@ export async function downloadArtifactInternal( const {artifacts} = await artifactClient.ListArtifacts(listReq) if (artifacts.length === 0) { - core.warning( + throw new ArtifactNotFoundError( `No artifacts found for ID: ${artifactId}\nAre you trying to download from a different run? Try specifying a github-token with \`actions:read\` scope.` ) - return {success: false} } if (artifacts.length > 1) { @@ -148,7 +148,7 @@ export async function downloadArtifactInternal( throw new Error(`Unable to download and extract artifact: ${error.message}`) } - return {success: true, downloadPath} + return {downloadPath} } async function resolveOrCreateDirectory( diff --git a/packages/artifact/src/internal/find/get-artifact.ts b/packages/artifact/src/internal/find/get-artifact.ts index 45db581f..b19e5d6e 100644 --- a/packages/artifact/src/internal/find/get-artifact.ts +++ b/packages/artifact/src/internal/find/get-artifact.ts @@ -48,7 +48,9 @@ export async function getArtifactPublic( } if (getArtifactResp.data.artifacts.length === 0) { - throw new ArtifactNotFoundError(artifactName) + throw new ArtifactNotFoundError( + `Artifact not found for name: ${artifactName}` + ) } let artifact = getArtifactResp.data.artifacts[0] @@ -86,7 +88,9 @@ export async function getArtifactInternal( const res = await artifactClient.ListArtifacts(req) if (res.artifacts.length === 0) { - throw new ArtifactNotFoundError(artifactName) + throw new ArtifactNotFoundError( + `Artifact not found for name: ${artifactName}` + ) } let artifact = res.artifacts[0] diff --git a/packages/artifact/src/internal/shared/errors.ts b/packages/artifact/src/internal/shared/errors.ts index 2ddf79ab..7ca33bdb 100644 --- a/packages/artifact/src/internal/shared/errors.ts +++ b/packages/artifact/src/internal/shared/errors.ts @@ -21,8 +21,7 @@ export class InvalidResponseError extends Error { } export class ArtifactNotFoundError extends Error { - constructor(name: string) { - const message = `No artifact found for name: ${name}` + constructor(message = 'Artifact not found') { super(message) this.name = 'ArtifactNotFoundError' } diff --git a/packages/artifact/src/internal/shared/interfaces.ts b/packages/artifact/src/internal/shared/interfaces.ts index b72274de..a8a6daa7 100644 --- a/packages/artifact/src/internal/shared/interfaces.ts +++ b/packages/artifact/src/internal/shared/interfaces.ts @@ -86,10 +86,6 @@ export interface ListArtifactsResponse { * * *****************************************************************************/ export interface DownloadArtifactResponse { - /** - * If the artifact download was successful - */ - success: boolean /** * The path where the artifact was downloaded to */ From b9872153b88fc1b4de6d067c02f8a730caba295e Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Tue, 5 Dec 2023 18:42:36 +0000 Subject: [PATCH 028/198] update GHES warning behavior --- packages/artifact/src/internal/client.ts | 75 +++++++------------ .../artifact/src/internal/shared/errors.ts | 9 +++ .../src/internal/shared/interfaces.ts | 2 +- 3 files changed, 35 insertions(+), 51 deletions(-) diff --git a/packages/artifact/src/internal/client.ts b/packages/artifact/src/internal/client.ts index 45ba0bfe..921d5faa 100644 --- a/packages/artifact/src/internal/client.ts +++ b/packages/artifact/src/internal/client.ts @@ -17,6 +17,7 @@ import { } from './download/download-artifact' import {getArtifactPublic, getArtifactInternal} from './find/get-artifact' import {listArtifactsPublic, listArtifactsInternal} from './find/list-artifacts' +import {GHESNotSupportError} from './shared/errors' export interface ArtifactClient { /** @@ -52,6 +53,7 @@ export interface ArtifactClient { /** * Finds an artifact by name. * If there are multiple artifacts with the same name in the same workflow run, this will return the latest. + * If the artifact is not found, it will throw. * * If options.findBy is specified, this will use the public List Artifacts API with a name filter which can get artifacts from other runs. * https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts @@ -99,16 +101,11 @@ export class Client implements ArtifactClient { rootDirectory: string, options?: UploadArtifactOptions ): Promise { - if (isGhes()) { - warning( - `@actions/artifact v2.0.0+ and upload-artifact@v4+ are not currently supported on GHES.` - ) - return { - success: false - } - } - try { + if (isGhes()) { + throw new GHESNotSupportError() + } + return uploadArtifact(name, files, rootDirectory, options) } catch (error) { warning( @@ -118,9 +115,8 @@ Errors can be temporary, so please try again and optionally run the action with If the error persists, please check whether Actions is operating normally at [https://githubstatus.com](https://www.githubstatus.com).` ) - return { - success: false - } + + throw error } } @@ -131,16 +127,11 @@ If the error persists, please check whether Actions is operating normally at [ht artifactId: number, options?: DownloadArtifactOptions & FindOptions ): Promise { - if (isGhes()) { - warning( - `@actions/artifact v2.0.0+ and download-artifact@v4+ are not currently supported on GHES.` - ) - return { - success: false - } - } - try { + if (isGhes()) { + throw new GHESNotSupportError() + } + if (options?.findBy) { const { findBy: {repositoryOwner, repositoryName, token}, @@ -159,16 +150,14 @@ If the error persists, please check whether Actions is operating normally at [ht return downloadArtifactInternal(artifactId, options) } catch (error) { warning( - `Artifact download failed with error: ${error}. + `Download Artifact failed with error: ${error}. Errors can be temporary, so please try again and optionally run the action with debug mode enabled for more information. If the error persists, please check whether Actions and API requests are operating normally at [https://githubstatus.com](https://www.githubstatus.com).` ) - return { - success: false - } + throw error } } @@ -178,16 +167,11 @@ If the error persists, please check whether Actions and API requests are operati async listArtifacts( options?: ListArtifactsOptions & FindOptions ): Promise { - if (isGhes()) { - warning( - `@actions/artifact v2.0.0+ and download-artifact@v4+ are not currently supported on GHES.` - ) - return { - artifacts: [] - } - } - try { + if (isGhes()) { + throw new GHESNotSupportError() + } + if (options?.findBy) { const { findBy: {workflowRunId, repositoryOwner, repositoryName, token} @@ -212,9 +196,7 @@ Errors can be temporary, so please try again and optionally run the action with If the error persists, please check whether Actions and API requests are operating normally at [https://githubstatus.com](https://www.githubstatus.com).` ) - return { - artifacts: [] - } + throw error } } @@ -225,16 +207,11 @@ If the error persists, please check whether Actions and API requests are operati artifactName: string, options?: FindOptions ): Promise { - if (isGhes()) { - warning( - `@actions/artifact v2.0.0+ and download-artifact@v4+ are not currently supported on GHES.` - ) - return { - success: false - } - } - try { + if (isGhes()) { + throw new GHESNotSupportError() + } + if (options?.findBy) { const { findBy: {workflowRunId, repositoryOwner, repositoryName, token} @@ -252,15 +229,13 @@ If the error persists, please check whether Actions and API requests are operati return getArtifactInternal(artifactName) } catch (error: unknown) { warning( - `Fetching Artifact failed with error: ${error}. + `Get Artifact failed with error: ${error}. Errors can be temporary, so please try again and optionally run the action with debug mode enabled for more information. If the error persists, please check whether Actions and API requests are operating normally at [https://githubstatus.com](https://www.githubstatus.com).` ) - return { - success: false - } + throw error } } } diff --git a/packages/artifact/src/internal/shared/errors.ts b/packages/artifact/src/internal/shared/errors.ts index 7ca33bdb..71e8e304 100644 --- a/packages/artifact/src/internal/shared/errors.ts +++ b/packages/artifact/src/internal/shared/errors.ts @@ -26,3 +26,12 @@ export class ArtifactNotFoundError extends Error { this.name = 'ArtifactNotFoundError' } } + +export class GHESNotSupportError extends Error { + constructor( + message = '@actions/artifact v2.0.0+ and download-artifact@v4+ are not currently supported on GHES.' + ) { + super(message) + this.name = 'NotSupportedGHESError' + } +} diff --git a/packages/artifact/src/internal/shared/interfaces.ts b/packages/artifact/src/internal/shared/interfaces.ts index a8a6daa7..dfd3e1da 100644 --- a/packages/artifact/src/internal/shared/interfaces.ts +++ b/packages/artifact/src/internal/shared/interfaces.ts @@ -56,7 +56,7 @@ export interface GetArtifactResponse { /** * Metadata about the artifact that was found */ - artifact?: Artifact + artifact: Artifact } /***************************************************************************** From a3053b5cc2ac2a8274ef96127b0f6c592a850660 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Tue, 5 Dec 2023 18:47:37 +0000 Subject: [PATCH 029/198] fix typo --- packages/artifact/src/internal/client.ts | 10 +++++----- packages/artifact/src/internal/shared/errors.ts | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/artifact/src/internal/client.ts b/packages/artifact/src/internal/client.ts index 921d5faa..4dd40b84 100644 --- a/packages/artifact/src/internal/client.ts +++ b/packages/artifact/src/internal/client.ts @@ -17,7 +17,7 @@ import { } from './download/download-artifact' import {getArtifactPublic, getArtifactInternal} from './find/get-artifact' import {listArtifactsPublic, listArtifactsInternal} from './find/list-artifacts' -import {GHESNotSupportError} from './shared/errors' +import {GHESNotSupportedError} from './shared/errors' export interface ArtifactClient { /** @@ -103,7 +103,7 @@ export class Client implements ArtifactClient { ): Promise { try { if (isGhes()) { - throw new GHESNotSupportError() + throw new GHESNotSupportedError() } return uploadArtifact(name, files, rootDirectory, options) @@ -129,7 +129,7 @@ If the error persists, please check whether Actions is operating normally at [ht ): Promise { try { if (isGhes()) { - throw new GHESNotSupportError() + throw new GHESNotSupportedError() } if (options?.findBy) { @@ -169,7 +169,7 @@ If the error persists, please check whether Actions and API requests are operati ): Promise { try { if (isGhes()) { - throw new GHESNotSupportError() + throw new GHESNotSupportedError() } if (options?.findBy) { @@ -209,7 +209,7 @@ If the error persists, please check whether Actions and API requests are operati ): Promise { try { if (isGhes()) { - throw new GHESNotSupportError() + throw new GHESNotSupportedError() } if (options?.findBy) { diff --git a/packages/artifact/src/internal/shared/errors.ts b/packages/artifact/src/internal/shared/errors.ts index 71e8e304..a46a01ff 100644 --- a/packages/artifact/src/internal/shared/errors.ts +++ b/packages/artifact/src/internal/shared/errors.ts @@ -27,11 +27,11 @@ export class ArtifactNotFoundError extends Error { } } -export class GHESNotSupportError extends Error { +export class GHESNotSupportedError extends Error { constructor( message = '@actions/artifact v2.0.0+ and download-artifact@v4+ are not currently supported on GHES.' ) { super(message) - this.name = 'NotSupportedGHESError' + this.name = 'GHESNotSupportedError' } } From c390199be6c889df82e741b932657f08e54d00aa Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Tue, 5 Dec 2023 13:51:51 -0500 Subject: [PATCH 030/198] Update artifact-tests.yml --- .github/workflows/artifact-tests.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/artifact-tests.yml b/.github/workflows/artifact-tests.yml index c6988efe..6c1d8bc2 100644 --- a/.github/workflows/artifact-tests.yml +++ b/.github/workflows/artifact-tests.yml @@ -68,15 +68,10 @@ jobs: const uploadResult = await artifact.create().uploadArtifact(artifactName, fileContents, './') console.log(uploadResult) - const success = uploadResult.success const size = uploadResult.size const id = uploadResult.id - if (!success) { - throw new Error('Failed to upload artifact') - } else { - console.log(`Successfully uploaded artifact ${id}`) - } + console.log(`Successfully uploaded artifact ${id}`) verify: runs-on: ubuntu-latest From 5f152b798e7a41bc42501229800f5863d28dfe1b Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Tue, 5 Dec 2023 13:54:14 -0500 Subject: [PATCH 031/198] Update artifact-tests.yml --- .github/workflows/artifact-tests.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/artifact-tests.yml b/.github/workflows/artifact-tests.yml index 6c1d8bc2..7bbb4aa9 100644 --- a/.github/workflows/artifact-tests.yml +++ b/.github/workflows/artifact-tests.yml @@ -24,10 +24,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set Node.js 20.x - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 20.x @@ -54,8 +54,8 @@ jobs: echo '${{ env.file1 }}' > artifact-path/first.txt echo '${{ env.file2 }}' > artifact-path/second.txt - - name: Upload Artifacts using actions/github-script@v6 - uses: actions/github-script@v6 + - name: Upload Artifacts using actions/github-script@v7 + uses: actions/github-script@v7 with: script: | const artifact = require('./packages/artifact/lib/artifact') @@ -78,10 +78,10 @@ jobs: needs: [build] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set Node.js 20.x - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 20.x @@ -96,8 +96,8 @@ jobs: npm run tsc working-directory: packages/artifact - - name: List artifacts using actions/github-script@v6 - uses: actions/github-script@v6 + - name: List artifacts using actions/github-script@v7 + uses: actions/github-script@v7 with: script: | const artifact = require('./packages/artifact/lib/artifact') From 449b28aee2be59a28b6d0632c0e962e5089206ce Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Tue, 5 Dec 2023 21:10:48 +0000 Subject: [PATCH 032/198] update contributing docs --- packages/artifact/CONTRIBUTIONS.md | 35 ++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/packages/artifact/CONTRIBUTIONS.md b/packages/artifact/CONTRIBUTIONS.md index c6147287..67a017f5 100644 --- a/packages/artifact/CONTRIBUTIONS.md +++ b/packages/artifact/CONTRIBUTIONS.md @@ -1,6 +1,6 @@ # Contributions -This package is used internally by the v2+ versions of [upload-artifact](https://github.com/actions/upload-artifact) and [download-artifact](https://github.com/actions/download-artifact). This package can also be used by other actions to interact with artifacts. Any changes or updates to this package will propagate updates to these actions so it is important that major changes or updates get properly tested. +This package is used internally by the v4 versions of [upload-artifact](https://github.com/actions/upload-artifact) and [download-artifact](https://github.com/actions/download-artifact). This package can also be used by other actions to interact with artifacts. Any changes or updates to this package will propagate updates to these actions so it is important that major changes or updates get properly tested. Any issues or feature requests that are related to the artifact actions should be filled in the appropriate repo. @@ -8,23 +8,36 @@ A limited range of unit tests run as part of each PR when making changes to the If making large changes, there are a few scenarios that should be tested. -- Uploading very large artifacts (large artifacts get compressed using gzip so compression/decompression must be tested) -- Uploading artifacts with lots of small files (each file is uploaded with its own HTTP call, timeouts and non-success HTTP responses can be expected so they must be properly handled) +- Uploading very large artifacts +- Uploading artifacts with lots of small files - Uploading artifacts using a self-hosted runner (uploads and downloads behave differently due to extra latency) - Downloading a single artifact (large and small, if lots of small files are part of an artifact, timeouts and non-success HTTP responses can be expected) - Downloading all artifacts at once Large architectural changes can impact upload/download performance so it is important to separately run extra tests. We request that any large contributions/changes have extra detailed testing so we can verify performance and possible regressions. -It is not possible to run end-to-end tests for artifacts as part of a PR in this repo because certain env variables such as `ACTIONS_RUNTIME_URL` are only available from the context of an action as opposed to a shell script. These env variables are needed in order to make the necessary API calls. +Tests will run for every push/pull_request [via Actions](https://github.com/actions/toolkit/blob/main/.github/workflows/artifact-tests.yml). # Testing -Any easy way to test changes is to fork the artifact actions and to use `npm link` to test your changes. +## Package tests -1. Fork the [upload-artifact](https://github.com/actions/upload-artifact) and [download-artifact](https://github.com/actions/download-artifact) repos -2. Clone the forks locally -3. With your local changes to the toolkit repo, type `npm link` after ensuring there are no errors when running `tsc` -4. In the locally cloned fork, type `npm link @actions/artifact` -4. Create a new release for your local fork using `tsc` and `npm run release` (this will create a new `dist/index.js` file using `@vercel/ncc`) -5. Commit and push your local changes, you will then be able to test your changes with your forked action +To run unit tests for the `@actions/artifact` package: + +1. Clone `actions/toolkit` locally +2. Install dependencies: `npm bootstrap` +3. Change working directory to `packages/artifact` +4. Run jest tests: `npm run test` + +## Within upload-artifact or download-artifact actions + +Any easy way to test changes for the official upload/download actions is to fork them, compile changes and run them. + +1. For your local `actions/toolkit` changes: + 1. Change directory to `packages/artifact` + 2. Compile the changes: `npm run tsc` + 3. Symlink your package change: `npm link` +2. Fork and clone either [upload-artifact](https://github.com/actions/upload-artifact) and [download-artifact](https://github.com/actions/download-artifact) + 1. In the locally cloned fork, link to your local toolkit changes: `npm link @actions/artifact` + 2. Then, compile your changes with: `npm run release`. The local `dist/index.js` should be updated with your changes. + 3. Commit and push to your fork, you can then test with a `uses:` in your workflow pointed at your fork. From e27efe5620ba1ffb6607b05f95b4d38da220a73a Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Tue, 5 Dec 2023 21:55:22 +0000 Subject: [PATCH 033/198] readme & error updates --- packages/artifact/README.md | 56 +++++++++++++++++-- .../artifact/src/internal/shared/errors.ts | 2 +- 2 files changed, 51 insertions(+), 7 deletions(-) diff --git a/packages/artifact/README.md b/packages/artifact/README.md index fee9a6a8..040d2f0f 100644 --- a/packages/artifact/README.md +++ b/packages/artifact/README.md @@ -1,13 +1,57 @@ # `@actions/artifact` -## Usage +Interact programmatically with [Actions Artifacts](https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts). -You can use this package to interact with the Actions artifacts. +This is the core library that powers the [`@actions/upload-artifact`](https://github.com/actions/upload-artifact) and [`@actions/download-artifact`](https://github.com/actions/download-artifact) actions. -This most recently published version of this package (`1.1.1`) can be found [here](https://github.com/actions/toolkit/tree/@actions/artifact@1.1.1/packages/artifact) -## 🚧 Under construction 🚧 +- [`@actions/artifact`](#actionsartifact) + - [v2 - Major Performance and Behavioral Improvements](#v2---major-performance-and-behavioral-improvements) + - [Improvements](#improvements) + - [Breaking changes](#breaking-changes) + - [Example scenarios](#example-scenarios) + - [Basic Upload and Download](#basic-upload-and-download) + - [Using `actions/github-script`](#using-actionsgithub-script) + - [Downloading from other runs or repos](#downloading-from-other-runs-or-repos) + - [Speeding up large uploads](#speeding-up-large-uploads) -This package is currently undergoing a major overhaul in preparation for `v4` versions of `upload-artifact` and `download-artifact` (these Actions will use a new `2.0.0` version of `@actions/artifact` that will soon be released). The upcoming version of `@actions/artifact` will take advantage of a major re-architecture with entirely new APIs. -The upcoming `2.0.0` package and `v4` artifact Actions aim to solve some of the major pain-points that have made artifact usage difficult up until now. +## v2 - Major Performance and Behavioral Improvements + +> [!IMPORTANT] +> @actions/artifact v2+, download-artifact@v4+ download-artifact@v4+ are not currently supported on GHES yet. The previous version of this package can be found at [this tag](https://github.com/actions/toolkit/tree/@actions/artifact@1.1.2/packages/artifact) and [on npm](https://www.npmjs.com/package/@actions/artifact/v/1.1.2). + +The release of `@actions/artifact@v2` (including `download-artifact@v4` and `download-artifact@v4`) are major changes to the backend architecture of Artifacts. They have numerous performance and behavioral improvements. + +### Improvements + +1. All upload and download operations are exponentially faster, up to 80% faster download times and 96% faster upload times in worst case scenarios. +2. Once uploaded, Artifacts becoming immediately available in the UI and [REST API](https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28). Previously, you would have to wait for the run to be completed. +3. Artifacts are _immutable_ once they are uploaded. They cannot be altered by subsequent jobs. (Digest/integrity hash coming soon in API!) +4. This library (and `actions/download-artifact`) now support downloading Artifacts from _other_ repositories and runs if a `GITHUB_TOKEN` with sufficient `actions:read` permissions are provided. + +### Breaking changes + +1. Firewall rules required for self-hosted runners. + + If you are using self-hosted runners behind a firewall, you must have flows open to [Actions endpoints](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#communication-between-self-hosted-runners-and-github). If you cannot use wildcard rules for your firewall, see the GitHub [meta endpoint](https://api.github.com/meta) for specific endpoints. + + e.g. + + ``` + curl https://api.github.com/meta | jq .domains.actions + ``` + +2. Uploading to the same named Artifact multiple times. + + Due to the behavior of how Artifacts are created in this new version, it is no longer possible to upload to the same named Artifact multiple times. You must either split the uploads into multiple names Artifacts, or only upload once. + +## Example scenarios + +### Basic Upload and Download + +### Using `actions/github-script` + +### Downloading from other runs or repos + +### Speeding up large uploads diff --git a/packages/artifact/src/internal/shared/errors.ts b/packages/artifact/src/internal/shared/errors.ts index a46a01ff..841c44a6 100644 --- a/packages/artifact/src/internal/shared/errors.ts +++ b/packages/artifact/src/internal/shared/errors.ts @@ -29,7 +29,7 @@ export class ArtifactNotFoundError extends Error { export class GHESNotSupportedError extends Error { constructor( - message = '@actions/artifact v2.0.0+ and download-artifact@v4+ are not currently supported on GHES.' + message = '@actions/artifact v2.0.0+, upload-artifact@v4+ and download-artifact@v4+ are not currently supported on GHES.' ) { super(message) this.name = 'GHESNotSupportedError' From befa19f3a87363fe3fa311f48ecb55a5400f3aa8 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 6 Dec 2023 04:00:07 +0000 Subject: [PATCH 034/198] initalize artifact client as default export --- .github/workflows/artifact-tests.yml | 10 ++--- packages/artifact/src/artifact.ts | 12 ++---- packages/artifact/src/internal/client.ts | 39 +++++++------------ .../src/internal/shared/interfaces.ts | 2 +- 4 files changed, 23 insertions(+), 40 deletions(-) diff --git a/.github/workflows/artifact-tests.yml b/.github/workflows/artifact-tests.yml index 7bbb4aa9..4c7c6ab6 100644 --- a/.github/workflows/artifact-tests.yml +++ b/.github/workflows/artifact-tests.yml @@ -58,21 +58,21 @@ jobs: uses: actions/github-script@v7 with: script: | - const artifact = require('./packages/artifact/lib/artifact') + const {default: artifact} = require('./packages/artifact/lib/artifact') const artifactName = 'my-artifact-${{ matrix.runs-on }}' console.log('artifactName: ' + artifactName) const fileContents = ['artifact-path/first.txt','artifact-path/second.txt'] - const uploadResult = await artifact.create().uploadArtifact(artifactName, fileContents, './') + const uploadResult = await artifact.uploadArtifact(artifactName, fileContents, './') console.log(uploadResult) const size = uploadResult.size const id = uploadResult.id console.log(`Successfully uploaded artifact ${id}`) - + verify: runs-on: ubuntu-latest needs: [build] @@ -100,14 +100,14 @@ jobs: uses: actions/github-script@v7 with: script: | - const artifact = require('./packages/artifact/lib/artifact') + const {default: artifact} = require('./packages/artifact/lib/artifact') const workflowRunId = process.env.GITHUB_RUN_ID const repository = process.env.GITHUB_REPOSITORY const repositoryOwner = repository.split('/')[0] const repositoryName = repository.split('/')[1] - const listResult = await artifact.create().listArtifacts(workflowRunId, repositoryOwner, repositoryName, '${{ secrets.GITHUB_TOKEN }}') + const listResult = await artifact.listArtifacts(workflowRunId, repositoryOwner, repositoryName, '${{ secrets.GITHUB_TOKEN }}') console.log(listResult) const artifacts = listResult.artifacts diff --git a/packages/artifact/src/artifact.ts b/packages/artifact/src/artifact.ts index 3ba38448..f5d91445 100644 --- a/packages/artifact/src/artifact.ts +++ b/packages/artifact/src/artifact.ts @@ -1,12 +1,8 @@ -import {ArtifactClient, Client} from './internal/client' +import {ArtifactClient, DefaultArtifactClient} from './internal/client' -/** - * Exported functionality that we want to expose for any users of @actions/artifact - */ export * from './internal/shared/interfaces' export * from './internal/shared/errors' -export {ArtifactClient} +export * from './internal/client' -export function create(): ArtifactClient { - return Client.create() -} +const client: ArtifactClient = new DefaultArtifactClient() +export default client diff --git a/packages/artifact/src/internal/client.ts b/packages/artifact/src/internal/client.ts index 4dd40b84..c4971d9f 100644 --- a/packages/artifact/src/internal/client.ts +++ b/packages/artifact/src/internal/client.ts @@ -19,9 +19,12 @@ import {getArtifactPublic, getArtifactInternal} from './find/get-artifact' import {listArtifactsPublic, listArtifactsInternal} from './find/list-artifacts' import {GHESNotSupportedError} from './shared/errors' +/** + * Generic interface for the artifact client. + */ export interface ArtifactClient { /** - * Uploads an artifact + * Uploads an artifact. * * @param name The name of the artifact, required * @param files A list of absolute or relative paths that denote what files should be uploaded @@ -40,7 +43,7 @@ export interface ArtifactClient { * Lists all artifacts that are part of the current workflow run. * This function will return at most 1000 artifacts per workflow run. * - * If options.findBy is specified, this will call the public List-Artifacts API which can list from other runs. + * If `options.findBy` is specified, this will call the public List-Artifacts API which can list from other runs. * https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts * * @param options Extra options that allow for the customization of the list behavior @@ -55,10 +58,10 @@ export interface ArtifactClient { * If there are multiple artifacts with the same name in the same workflow run, this will return the latest. * If the artifact is not found, it will throw. * - * If options.findBy is specified, this will use the public List Artifacts API with a name filter which can get artifacts from other runs. + * If `options.findBy` is specified, this will use the public List Artifacts API with a name filter which can get artifacts from other runs. * https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts - * @actions/artifact > 2.0.0 does not allow for creating multiple artifacts with the same name in the same workflow run. - * It is possible to have multiple artifacts with the same name in the same workflow run by using old versions of upload-artifact (v1,v2 and v3), @actions/artifact < v2.0.0 or it is a rerun. + * `@actions/artifact` v2+ does not allow for creating multiple artifacts with the same name in the same workflow run. + * It is possible to have multiple artifacts with the same name in the same workflow run by using old versions of upload-artifact (v1,v2 and v3), @actions/artifact < v2 or it is a rerun. * If there are multiple artifacts with the same name in the same workflow run this function will return the first artifact that matches the name. * * @param artifactName The name of the artifact to find @@ -72,7 +75,7 @@ export interface ArtifactClient { /** * Downloads an artifact and unzips the content. * - * If options.findBy is specified, this will use the public Download Artifact API https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#download-an-artifact + * If `options.findBy` is specified, this will use the public Download Artifact API https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#download-an-artifact * * @param artifactId The name of the artifact to download * @param options Extra options that allow for the customization of the download behavior @@ -84,17 +87,10 @@ export interface ArtifactClient { ): Promise } -export class Client implements ArtifactClient { - /** - * Constructs a Client - */ - static create(): Client { - return new Client() - } - - /** - * Upload Artifact - */ +/** + * The default artifact client that is used by the artifact action(s). + */ +export class DefaultArtifactClient implements ArtifactClient { async uploadArtifact( name: string, files: string[], @@ -120,9 +116,6 @@ If the error persists, please check whether Actions is operating normally at [ht } } - /** - * Download Artifact - */ async downloadArtifact( artifactId: number, options?: DownloadArtifactOptions & FindOptions @@ -161,9 +154,6 @@ If the error persists, please check whether Actions and API requests are operati } } - /** - * List Artifacts - */ async listArtifacts( options?: ListArtifactsOptions & FindOptions ): Promise { @@ -200,9 +190,6 @@ If the error persists, please check whether Actions and API requests are operati } } - /** - * Get Artifact - */ async getArtifact( artifactName: string, options?: FindOptions diff --git a/packages/artifact/src/internal/shared/interfaces.ts b/packages/artifact/src/internal/shared/interfaces.ts index dfd3e1da..e40fb661 100644 --- a/packages/artifact/src/internal/shared/interfaces.ts +++ b/packages/artifact/src/internal/shared/interfaces.ts @@ -127,7 +127,7 @@ export interface Artifact { } // FindOptions are for fetching Artifact(s) out of the scope of the current run. -// Must specify a PAT with actions:read scope for cross run/repo lookup otherwise these will be ignored. +// Must specify a token with actions:read scope for cross run/repo lookup otherwise these will be ignored. export interface FindOptions { findBy?: { // Token with actions:read permissions From 9b31b034968f481c7619e1eb26f04a1f4263e57e Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 6 Dec 2023 04:10:46 +0000 Subject: [PATCH 035/198] more readme updates --- packages/artifact/README.md | 107 +++++++++++++++++++++++++++++++----- 1 file changed, 94 insertions(+), 13 deletions(-) diff --git a/packages/artifact/README.md b/packages/artifact/README.md index 040d2f0f..580c4ae8 100644 --- a/packages/artifact/README.md +++ b/packages/artifact/README.md @@ -6,17 +6,16 @@ This is the core library that powers the [`@actions/upload-artifact`](https://gi - [`@actions/artifact`](#actionsartifact) - - [v2 - Major Performance and Behavioral Improvements](#v2---major-performance-and-behavioral-improvements) + - [v2 - What's New](#v2---whats-new) - [Improvements](#improvements) - [Breaking changes](#breaking-changes) - - [Example scenarios](#example-scenarios) - - [Basic Upload and Download](#basic-upload-and-download) - - [Using `actions/github-script`](#using-actionsgithub-script) - - [Downloading from other runs or repos](#downloading-from-other-runs-or-repos) + - [Quick Start](#quick-start) + - [Examples](#examples) + - [Upload and Download](#upload-and-download) + - [Downloading from other workflow runs or repos](#downloading-from-other-workflow-runs-or-repos) - [Speeding up large uploads](#speeding-up-large-uploads) - -## v2 - Major Performance and Behavioral Improvements +## v2 - What's New > [!IMPORTANT] > @actions/artifact v2+, download-artifact@v4+ download-artifact@v4+ are not currently supported on GHES yet. The previous version of this package can be found at [this tag](https://github.com/actions/toolkit/tree/@actions/artifact@1.1.2/packages/artifact) and [on npm](https://www.npmjs.com/package/@actions/artifact/v/1.1.2). @@ -25,8 +24,8 @@ The release of `@actions/artifact@v2` (including `download-artifact@v4` and `dow ### Improvements -1. All upload and download operations are exponentially faster, up to 80% faster download times and 96% faster upload times in worst case scenarios. -2. Once uploaded, Artifacts becoming immediately available in the UI and [REST API](https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28). Previously, you would have to wait for the run to be completed. +1. All upload and download operations are much quicker, up to 80% faster download times and 96% faster upload times in worst case scenarios. +2. Once uploaded, Artifacts becoming immediately available in the UI and [REST API](https://docs.github.com/en/rest/actions/artifacts). Previously, you would have to wait for the run to be completed. 3. Artifacts are _immutable_ once they are uploaded. They cannot be altered by subsequent jobs. (Digest/integrity hash coming soon in API!) 4. This library (and `actions/download-artifact`) now support downloading Artifacts from _other_ repositories and runs if a `GITHUB_TOKEN` with sufficient `actions:read` permissions are provided. @@ -46,12 +45,94 @@ The release of `@actions/artifact@v2` (including `download-artifact@v4` and `dow Due to the behavior of how Artifacts are created in this new version, it is no longer possible to upload to the same named Artifact multiple times. You must either split the uploads into multiple names Artifacts, or only upload once. -## Example scenarios +## Quick Start -### Basic Upload and Download +Install the package: -### Using `actions/github-script` +``` +npm i @actions/artifact +``` -### Downloading from other runs or repos +Import the module: + +```js +// ES6 module +import artifact from '@actions/artifact' + +// CommonJS +const {default: artifact} = require('@actions/artifact') +``` + +ℹ️ For a comprehensive list of classes, interfaces, functions and more, see the [generated documentation](./docs/generated/README.md). + +## Examples + +### Upload and Download + +This is the most basic scenario, uploading one or more files to an Artifact, then downloading it. Downloads are based on the Artifact ID, which can be obtained in the response of `uploadArtifact`, `getArtifact`, `listArtifacts` or via the [REST API](https://docs.github.com/en/rest/actions/artifacts). + +```js +const {id, size} = await artifact.uploadArtifact( + // name of the artifact + 'my-artifact', + // files to include (supports absolute and relative paths) + ['/absolute/path/file1.txt', './relative/file2.txt'], + { + // optional: how long to retain the artifact + // if unspecified, defaults to repository/org retention settings (the limit of this value) + retentionDays: 10 + } +) + +console.log(`Created artifact with id: ${id} (bytes: ${size}`) + +const {downloadPath} = await artifact.downloadArtifact(id, { + // optional: download destination path. otherwise defaults to $GITHUB_WORKSPACE + path: '/tmp/dst/path', +}) + +console.log(`Downloaded artifact ${id} to: ${downloadPath}`) +``` + +### Downloading from other workflow runs or repos + +It may be useful to download Artifacts from other workflow runs, or even other repositories. By default, the permissions are scoped so they can only download Artifacts within the current workflow run. To elevate permissions for this scenario, you must specify `options.findBy` to `downloadArtifact`. + +```ts +const findBy = { + // must have actions:read permission on target repository + token: process.env['GITHUB_TOKEN'], + workflowRunId: 123, + repositoryOwner: 'actions', + repositoryName: 'toolkit' +} + +await artifact.downloadArtifact(1337, { + findBy +}) + +// can also be used in other methods + +await artifact.getArtifact('my-artifact', { + findBy +}) + +await artifact.listArtifacts({ + findBy +}) +``` ### Speeding up large uploads + +If you have large files that need to be uploaded (or file types that don't compress well), you may benefit from changing the compression level of the Artifact archive. NOTE: This is a tradeoff between artifact upload time and stored data size. + +```ts +await artifact.uploadArtifact('my-massive-artifact', ['big_file.bin'], { + // The level of compression for Zlib to be applied to the artifact archive. + // - 0: No compression + // - 1: Best speed + // - 6: Default compression (same as GNU Gzip) + // - 9: Best compression + compressionLevel: 0 +}) +``` From 0c9621922ee6525f2ad6fd31df39f1c558868f9f Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 6 Dec 2023 04:22:18 +0000 Subject: [PATCH 036/198] add faq, update releases --- packages/artifact/README.md | 7 +++++++ packages/artifact/RELEASES.md | 5 +++++ packages/artifact/docs/docs.md | 1 - packages/artifact/docs/faq.md | 35 ++++++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) delete mode 100644 packages/artifact/docs/docs.md create mode 100644 packages/artifact/docs/faq.md diff --git a/packages/artifact/README.md b/packages/artifact/README.md index 580c4ae8..70752289 100644 --- a/packages/artifact/README.md +++ b/packages/artifact/README.md @@ -14,6 +14,7 @@ This is the core library that powers the [`@actions/upload-artifact`](https://gi - [Upload and Download](#upload-and-download) - [Downloading from other workflow runs or repos](#downloading-from-other-workflow-runs-or-repos) - [Speeding up large uploads](#speeding-up-large-uploads) + - [Additional Resources](#additional-resources) ## v2 - What's New @@ -136,3 +137,9 @@ await artifact.uploadArtifact('my-massive-artifact', ['big_file.bin'], { compressionLevel: 0 }) ``` + +## Additional Resources + +- [Releases](./RELEASES.md) +- [Contribution Guide](./CONTRIBUTIONS.md) +- [Frequently Asked Questions](./docs/faq.md) diff --git a/packages/artifact/RELEASES.md b/packages/artifact/RELEASES.md index 580d840b..53a8dda5 100644 --- a/packages/artifact/RELEASES.md +++ b/packages/artifact/RELEASES.md @@ -94,3 +94,8 @@ ### 1.1.1 - Fixed a bug in Node16 where if an HTTP download finished too quickly (<1ms, e.g. when it's mocked) we attempt to delete a temp file that has not been created yet [#1278](https://github.com/actions/toolkit/pull/1278/commits/b9de68a590daf37c6747e38d3cb4f1dd2cfb791c) + +### 2.0.0 + +Major release. Supports new Artifact backend for improved speed, reliability and behavior. +Numerous API changes, some breaking. diff --git a/packages/artifact/docs/docs.md b/packages/artifact/docs/docs.md deleted file mode 100644 index e0fa3110..00000000 --- a/packages/artifact/docs/docs.md +++ /dev/null @@ -1 +0,0 @@ -Docs will be added here once development of version `2.0.0` has finished \ No newline at end of file diff --git a/packages/artifact/docs/faq.md b/packages/artifact/docs/faq.md new file mode 100644 index 00000000..8700787f --- /dev/null +++ b/packages/artifact/docs/faq.md @@ -0,0 +1,35 @@ +# Frequently Asked Questions + +- [Frequently Asked Questions](#frequently-asked-questions) + - [Supported Characters](#supported-characters) + - [Compression? ZIP? How is my artifact stored?](#compression-zip-how-is-my-artifact-stored) + +## Supported Characters + +When uploading an artifact, the inputted `name` parameter along with the files specified in `files` cannot contain any of the following characters. They will be rejected by the server if attempted to be sent over and the upload will fail. These characters are not allowed due to limitations and restrictions with certain file systems such as NTFS. To maintain platform-agnostic behavior, all characters that are not supported by an individual filesystem/platform will not be supported on all filesystems/platforms. + +- " +- : +- < +- \> +- | +- \* +- ? + +In addition to the aforementioned characters, the inputted `name` also cannot include the following +- \ +- / + +## Compression? ZIP? How is my artifact stored? + +When creating an Artifact, the files are dynamically compressed and streamed into a ZIP archive. Since they are stored in a ZIP, they can be compressed by Zlib in varying levels. + +The value can range from 0 to 9: + +- 0: No compression +- 1: Best speed +- 6: Default compression (same as GNU Gzip) +- 9: Best compression + +Higher levels will result in better compression, but will take longer to complete. +For large files that are not easily compressed, a value of 0 is recommended for significantly faster uploads. From 68958c2486d50febf570cae4c52685c6ca411b4c Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 6 Dec 2023 09:30:20 -0500 Subject: [PATCH 037/198] Update packages/artifact/README.md Co-authored-by: Bethany --- packages/artifact/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/README.md b/packages/artifact/README.md index 70752289..0ff82b9b 100644 --- a/packages/artifact/README.md +++ b/packages/artifact/README.md @@ -26,7 +26,7 @@ The release of `@actions/artifact@v2` (including `download-artifact@v4` and `dow ### Improvements 1. All upload and download operations are much quicker, up to 80% faster download times and 96% faster upload times in worst case scenarios. -2. Once uploaded, Artifacts becoming immediately available in the UI and [REST API](https://docs.github.com/en/rest/actions/artifacts). Previously, you would have to wait for the run to be completed. +2. Once uploaded, Artifacts are immediately available in the UI and [REST API](https://docs.github.com/en/rest/actions/artifacts). Previously, you would have to wait for the run to be completed. 3. Artifacts are _immutable_ once they are uploaded. They cannot be altered by subsequent jobs. (Digest/integrity hash coming soon in API!) 4. This library (and `actions/download-artifact`) now support downloading Artifacts from _other_ repositories and runs if a `GITHUB_TOKEN` with sufficient `actions:read` permissions are provided. From 79ace256d6810249383ceefb6bbdcc799c8dc795 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 6 Dec 2023 09:30:35 -0500 Subject: [PATCH 038/198] Update packages/artifact/README.md Co-authored-by: Bethany --- packages/artifact/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/README.md b/packages/artifact/README.md index 0ff82b9b..e1867d06 100644 --- a/packages/artifact/README.md +++ b/packages/artifact/README.md @@ -27,7 +27,7 @@ The release of `@actions/artifact@v2` (including `download-artifact@v4` and `dow 1. All upload and download operations are much quicker, up to 80% faster download times and 96% faster upload times in worst case scenarios. 2. Once uploaded, Artifacts are immediately available in the UI and [REST API](https://docs.github.com/en/rest/actions/artifacts). Previously, you would have to wait for the run to be completed. -3. Artifacts are _immutable_ once they are uploaded. They cannot be altered by subsequent jobs. (Digest/integrity hash coming soon in API!) +3. Artifacts are _immutable_ once they are uploaded. They cannot be altered by subsequent jobs. (Digest/integrity hash coming soon in the API!) 4. This library (and `actions/download-artifact`) now support downloading Artifacts from _other_ repositories and runs if a `GITHUB_TOKEN` with sufficient `actions:read` permissions are provided. ### Breaking changes From dc515188a877e075fbf7d1c4a1d53f008ca080ce Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 6 Dec 2023 09:30:53 -0500 Subject: [PATCH 039/198] Update packages/artifact/README.md Co-authored-by: Bethany --- packages/artifact/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/README.md b/packages/artifact/README.md index e1867d06..edda74e9 100644 --- a/packages/artifact/README.md +++ b/packages/artifact/README.md @@ -44,7 +44,7 @@ The release of `@actions/artifact@v2` (including `download-artifact@v4` and `dow 2. Uploading to the same named Artifact multiple times. - Due to the behavior of how Artifacts are created in this new version, it is no longer possible to upload to the same named Artifact multiple times. You must either split the uploads into multiple names Artifacts, or only upload once. + Due to how Artifacts are created in this new version, it is no longer possible to upload to the same named Artifact multiple times. You must either split the uploads into multiple Artifacts with different names, or only upload once. ## Quick Start From 23fb8c47827b58233f8834b3c5284d7c10de715e Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 6 Dec 2023 09:31:09 -0500 Subject: [PATCH 040/198] Update packages/artifact/README.md Co-authored-by: Bethany --- packages/artifact/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/README.md b/packages/artifact/README.md index edda74e9..0f2b61dc 100644 --- a/packages/artifact/README.md +++ b/packages/artifact/README.md @@ -70,7 +70,7 @@ const {default: artifact} = require('@actions/artifact') ### Upload and Download -This is the most basic scenario, uploading one or more files to an Artifact, then downloading it. Downloads are based on the Artifact ID, which can be obtained in the response of `uploadArtifact`, `getArtifact`, `listArtifacts` or via the [REST API](https://docs.github.com/en/rest/actions/artifacts). +The most basic scenario is uploading one or more files to an Artifact, then downloading that Artifact. Downloads are based on the Artifact ID, which can be obtained in the response of `uploadArtifact`, `getArtifact`, `listArtifacts` or via the [REST API](https://docs.github.com/en/rest/actions/artifacts). ```js const {id, size} = await artifact.uploadArtifact( From b43b97985ca6d4af7f0838b60cadca6532ee709b Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 6 Dec 2023 09:31:55 -0500 Subject: [PATCH 041/198] Update packages/artifact/docs/faq.md Co-authored-by: Bethany --- packages/artifact/docs/faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/docs/faq.md b/packages/artifact/docs/faq.md index 8700787f..c88d5c11 100644 --- a/packages/artifact/docs/faq.md +++ b/packages/artifact/docs/faq.md @@ -6,7 +6,7 @@ ## Supported Characters -When uploading an artifact, the inputted `name` parameter along with the files specified in `files` cannot contain any of the following characters. They will be rejected by the server if attempted to be sent over and the upload will fail. These characters are not allowed due to limitations and restrictions with certain file systems such as NTFS. To maintain platform-agnostic behavior, all characters that are not supported by an individual filesystem/platform will not be supported on all filesystems/platforms. +When uploading an artifact, the inputted `name` parameter along with the files specified in `files` cannot contain any of the following characters. If they are present in `name` or `files`, the Artifact will be rejected by the server and the upload will fail. These characters are not allowed due to limitations and restrictions with certain file systems such as NTFS. To maintain platform-agnostic behavior, characters that are not supported by an individual filesystem/platform will not be supported on all filesystems/platforms. - " - : From 19d4d9d3b25b410ffa72b1e6e1bf4ce4122eedcb Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 6 Dec 2023 14:52:49 +0000 Subject: [PATCH 042/198] releases.md: link to breaking v2 changes --- packages/artifact/RELEASES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/RELEASES.md b/packages/artifact/RELEASES.md index 53a8dda5..cd10f57e 100644 --- a/packages/artifact/RELEASES.md +++ b/packages/artifact/RELEASES.md @@ -98,4 +98,4 @@ ### 2.0.0 Major release. Supports new Artifact backend for improved speed, reliability and behavior. -Numerous API changes, some breaking. +Numerous API changes, [some breaking](./README.md#breaking-changes). From 49ef8b93a8eddbbb3aca5a346e878747b4ac41dd Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 6 Dec 2023 15:38:59 +0000 Subject: [PATCH 043/198] fix typo --- packages/artifact/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/artifact/README.md b/packages/artifact/README.md index 0f2b61dc..ac393d8f 100644 --- a/packages/artifact/README.md +++ b/packages/artifact/README.md @@ -19,9 +19,9 @@ This is the core library that powers the [`@actions/upload-artifact`](https://gi ## v2 - What's New > [!IMPORTANT] -> @actions/artifact v2+, download-artifact@v4+ download-artifact@v4+ are not currently supported on GHES yet. The previous version of this package can be found at [this tag](https://github.com/actions/toolkit/tree/@actions/artifact@1.1.2/packages/artifact) and [on npm](https://www.npmjs.com/package/@actions/artifact/v/1.1.2). +> @actions/artifact v2+, upload-artifact@v4+ download-artifact@v4+ are not currently supported on GHES yet. The previous version of this package can be found at [this tag](https://github.com/actions/toolkit/tree/@actions/artifact@1.1.2/packages/artifact) and [on npm](https://www.npmjs.com/package/@actions/artifact/v/1.1.2). -The release of `@actions/artifact@v2` (including `download-artifact@v4` and `download-artifact@v4`) are major changes to the backend architecture of Artifacts. They have numerous performance and behavioral improvements. +The release of `@actions/artifact@v2` (including `upload-artifact@v4` and `download-artifact@v4`) are major changes to the backend architecture of Artifacts. They have numerous performance and behavioral improvements. ### Improvements From c08a7d1b2e4aa35b352a2d8756943bd486a91be9 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 6 Dec 2023 12:19:49 -0500 Subject: [PATCH 044/198] Update packages/artifact/README.md Co-authored-by: Konrad Pabjan --- packages/artifact/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/README.md b/packages/artifact/README.md index ac393d8f..436173ba 100644 --- a/packages/artifact/README.md +++ b/packages/artifact/README.md @@ -26,7 +26,7 @@ The release of `@actions/artifact@v2` (including `upload-artifact@v4` and `downl ### Improvements 1. All upload and download operations are much quicker, up to 80% faster download times and 96% faster upload times in worst case scenarios. -2. Once uploaded, Artifacts are immediately available in the UI and [REST API](https://docs.github.com/en/rest/actions/artifacts). Previously, you would have to wait for the run to be completed. +2. Once uploaded, an Artifact ID is returned and Artifacts are immediately available in the UI and [REST API](https://docs.github.com/en/rest/actions/artifacts). Previously, you would have to wait for the run to be completed before an ID was available or any APIs could be utilized. 3. Artifacts are _immutable_ once they are uploaded. They cannot be altered by subsequent jobs. (Digest/integrity hash coming soon in the API!) 4. This library (and `actions/download-artifact`) now support downloading Artifacts from _other_ repositories and runs if a `GITHUB_TOKEN` with sufficient `actions:read` permissions are provided. From 2e6c9a1f14ae6be31c7e12891d84ec18583b59d9 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 6 Dec 2023 17:28:03 +0000 Subject: [PATCH 045/198] pr feedback --- packages/artifact/README.md | 5 +++-- packages/artifact/RELEASES.md | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/artifact/README.md b/packages/artifact/README.md index 436173ba..8ea5814d 100644 --- a/packages/artifact/README.md +++ b/packages/artifact/README.md @@ -27,8 +27,9 @@ The release of `@actions/artifact@v2` (including `upload-artifact@v4` and `downl 1. All upload and download operations are much quicker, up to 80% faster download times and 96% faster upload times in worst case scenarios. 2. Once uploaded, an Artifact ID is returned and Artifacts are immediately available in the UI and [REST API](https://docs.github.com/en/rest/actions/artifacts). Previously, you would have to wait for the run to be completed before an ID was available or any APIs could be utilized. -3. Artifacts are _immutable_ once they are uploaded. They cannot be altered by subsequent jobs. (Digest/integrity hash coming soon in the API!) -4. This library (and `actions/download-artifact`) now support downloading Artifacts from _other_ repositories and runs if a `GITHUB_TOKEN` with sufficient `actions:read` permissions are provided. +3. Artifacts can now be downloaded and deleted from the UI _before_ the entire workflow run finishes. +4. The contents of an Artifact are uploaded together into an _immutable_ archive. They cannot be altered by subsequent jobs. Both of these factors help reduce the possibility of accidentally corrupting Artifact files. (Digest/integrity hash coming soon in the API!) +5. This library (and `actions/download-artifact`) now support downloading Artifacts from _other_ repositories and runs if a `GITHUB_TOKEN` with sufficient `actions:read` permissions are provided. ### Breaking changes diff --git a/packages/artifact/RELEASES.md b/packages/artifact/RELEASES.md index cd10f57e..ce3ed43b 100644 --- a/packages/artifact/RELEASES.md +++ b/packages/artifact/RELEASES.md @@ -99,3 +99,5 @@ Major release. Supports new Artifact backend for improved speed, reliability and behavior. Numerous API changes, [some breaking](./README.md#breaking-changes). + +Blog post with more info: TBD From 8cd4434523366d14fadbabdedb7857ac224caee5 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 6 Dec 2023 17:30:13 +0000 Subject: [PATCH 046/198] mention job limit --- packages/artifact/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/artifact/README.md b/packages/artifact/README.md index 8ea5814d..e68fc26c 100644 --- a/packages/artifact/README.md +++ b/packages/artifact/README.md @@ -47,6 +47,10 @@ The release of `@actions/artifact@v2` (including `upload-artifact@v4` and `downl Due to how Artifacts are created in this new version, it is no longer possible to upload to the same named Artifact multiple times. You must either split the uploads into multiple Artifacts with different names, or only upload once. +3. Limit of Artifacts for an individual job. + + Each job in a workflow run now has a limit of 10 artifacts. + ## Quick Start Install the package: From 1f87038676af60355e8e6c1c6773588618c21ef9 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 6 Dec 2023 13:19:32 -0500 Subject: [PATCH 047/198] Update packages/artifact/README.md Co-authored-by: Konrad Pabjan --- packages/artifact/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/README.md b/packages/artifact/README.md index e68fc26c..4dcee38f 100644 --- a/packages/artifact/README.md +++ b/packages/artifact/README.md @@ -39,7 +39,7 @@ The release of `@actions/artifact@v2` (including `upload-artifact@v4` and `downl e.g. - ``` + ```bash curl https://api.github.com/meta | jq .domains.actions ``` From 70cad3f6355cc5c5dbae684e6dbc68874aab3831 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 6 Dec 2023 13:19:38 -0500 Subject: [PATCH 048/198] Update packages/artifact/README.md Co-authored-by: Konrad Pabjan --- packages/artifact/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/README.md b/packages/artifact/README.md index 4dcee38f..d03dfc24 100644 --- a/packages/artifact/README.md +++ b/packages/artifact/README.md @@ -55,7 +55,7 @@ The release of `@actions/artifact@v2` (including `upload-artifact@v4` and `downl Install the package: -``` +```bash npm i @actions/artifact ``` From c042a30d3ddae40b17372644006b5b15fd28b9d8 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 6 Dec 2023 14:05:38 -0500 Subject: [PATCH 049/198] Update packages/artifact/CONTRIBUTIONS.md Co-authored-by: Mattia Richetto --- packages/artifact/CONTRIBUTIONS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/CONTRIBUTIONS.md b/packages/artifact/CONTRIBUTIONS.md index 67a017f5..23ede984 100644 --- a/packages/artifact/CONTRIBUTIONS.md +++ b/packages/artifact/CONTRIBUTIONS.md @@ -6,7 +6,7 @@ Any issues or feature requests that are related to the artifact actions should b A limited range of unit tests run as part of each PR when making changes to the artifact packages. For small contributions and fixes, they should be sufficient. -If making large changes, there are a few scenarios that should be tested. +If making large changes, there are a few scenarios that should be tested: - Uploading very large artifacts - Uploading artifacts with lots of small files From 715b1acc05966f1b2eb21ada2b1c9acdda73455e Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 6 Dec 2023 23:42:07 +0000 Subject: [PATCH 050/198] cleanup artifact handlers hanging node process --- .../src/internal/shared/artifact-twirp-client.ts | 15 +++++++++------ .../src/internal/upload/upload-artifact.ts | 10 +++++----- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/packages/artifact/src/internal/shared/artifact-twirp-client.ts b/packages/artifact/src/internal/shared/artifact-twirp-client.ts index dde3d4a4..c59fcc0f 100644 --- a/packages/artifact/src/internal/shared/artifact-twirp-client.ts +++ b/packages/artifact/src/internal/shared/artifact-twirp-client.ts @@ -59,10 +59,10 @@ class ArtifactHttpClient implements Rpc { 'Content-Type': contentType } try { - const response = await this.retryableRequest(async () => + const {body} = await this.retryableRequest(async () => this.httpClient.post(url, JSON.stringify(data), headers) ) - const body = await response.readBody() + return JSON.parse(body) } catch (error) { throw new Error(`Failed to ${method}: ${error.message}`) @@ -71,7 +71,7 @@ class ArtifactHttpClient implements Rpc { async retryableRequest( operation: () => Promise - ): Promise { + ): Promise<{response: HttpClientResponse, body: string}> { let attempt = 0 let errorMessage = '' while (attempt < this.maxAttempts) { @@ -80,11 +80,14 @@ class ArtifactHttpClient implements Rpc { try { const response = await operation() const statusCode = response.message.statusCode - debug(`[Response] ${response.message.statusCode}`) - debug(JSON.stringify(response.message.headers, null, 2)) + const raw = await response.readBody() + const body = JSON.parse(raw) + debug(`[Response] - ${response.message.statusCode}`) + debug(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`) + debug(`Body: ${JSON.stringify(body, null, 2)}`) if (this.isSuccessStatusCode(statusCode)) { - return response + return {response, body} } isRetryable = this.isRetryableHttpStatusCode(statusCode) diff --git a/packages/artifact/src/internal/upload/upload-artifact.ts b/packages/artifact/src/internal/upload/upload-artifact.ts index 55921252..e880102f 100644 --- a/packages/artifact/src/internal/upload/upload-artifact.ts +++ b/packages/artifact/src/internal/upload/upload-artifact.ts @@ -40,11 +40,6 @@ export async function uploadArtifact( ) } - const zipUploadStream = await createZipUploadStream( - zipSpecification, - options?.compressionLevel - ) - // get the IDs needed for the artifact creation const backendIds = getBackendIdsFromToken() @@ -73,6 +68,11 @@ export async function uploadArtifact( ) } + const zipUploadStream = await createZipUploadStream( + zipSpecification, + options?.compressionLevel + ) + // Upload zip to blob storage const uploadResult = await uploadZipToBlobStorage( createArtifactResp.signedUploadUrl, From 8c317a0e59177696981abfbbe86f04f4599ff08e Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 6 Dec 2023 23:51:16 +0000 Subject: [PATCH 051/198] one too many parses --- .../artifact/src/internal/shared/artifact-twirp-client.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/artifact/src/internal/shared/artifact-twirp-client.ts b/packages/artifact/src/internal/shared/artifact-twirp-client.ts index c59fcc0f..1e981675 100644 --- a/packages/artifact/src/internal/shared/artifact-twirp-client.ts +++ b/packages/artifact/src/internal/shared/artifact-twirp-client.ts @@ -80,11 +80,10 @@ class ArtifactHttpClient implements Rpc { try { const response = await operation() const statusCode = response.message.statusCode - const raw = await response.readBody() - const body = JSON.parse(raw) + const body = await response.readBody() debug(`[Response] - ${response.message.statusCode}`) debug(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`) - debug(`Body: ${JSON.stringify(body, null, 2)}`) + debug(`Body: ${body}`) if (this.isSuccessStatusCode(statusCode)) { return {response, body} From f732e4cd62275a56d1fd95a3ad2f24204d8b4e46 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 6 Dec 2023 23:57:33 +0000 Subject: [PATCH 052/198] linter --- .../artifact/src/internal/shared/artifact-twirp-client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/artifact/src/internal/shared/artifact-twirp-client.ts b/packages/artifact/src/internal/shared/artifact-twirp-client.ts index 1e981675..9166e799 100644 --- a/packages/artifact/src/internal/shared/artifact-twirp-client.ts +++ b/packages/artifact/src/internal/shared/artifact-twirp-client.ts @@ -62,7 +62,7 @@ class ArtifactHttpClient implements Rpc { const {body} = await this.retryableRequest(async () => this.httpClient.post(url, JSON.stringify(data), headers) ) - + return JSON.parse(body) } catch (error) { throw new Error(`Failed to ${method}: ${error.message}`) @@ -71,7 +71,7 @@ class ArtifactHttpClient implements Rpc { async retryableRequest( operation: () => Promise - ): Promise<{response: HttpClientResponse, body: string}> { + ): Promise<{response: HttpClientResponse; body: string}> { let attempt = 0 let errorMessage = '' while (attempt < this.maxAttempts) { From 64d1b104d0b1bfe13f590db87226ffd73930e900 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Thu, 7 Dec 2023 12:57:20 -0500 Subject: [PATCH 053/198] Generate Typescript Docs for `@actions/artifact` (#1595) * autogenerate artifact documentation * clean up comments for better autogen docs --- packages/artifact/docs/generated/README.md | 40 ++++ .../classes/ArtifactNotFoundError.md | 169 ++++++++++++++++ .../classes/DefaultArtifactClient.md | 161 ++++++++++++++++ .../generated/classes/FilesNotFoundError.md | 180 ++++++++++++++++++ .../classes/GHESNotSupportedError.md | 169 ++++++++++++++++ .../generated/classes/InvalidResponseError.md | 169 ++++++++++++++++ .../docs/generated/interfaces/Artifact.md | 62 ++++++ .../generated/interfaces/ArtifactClient.md | 131 +++++++++++++ .../interfaces/DownloadArtifactOptions.md | 23 +++ .../interfaces/DownloadArtifactResponse.md | 23 +++ .../docs/generated/interfaces/FindOptions.md | 30 +++ .../interfaces/GetArtifactResponse.md | 23 +++ .../interfaces/ListArtifactsOptions.md | 24 +++ .../interfaces/ListArtifactsResponse.md | 23 +++ .../interfaces/UploadArtifactOptions.md | 55 ++++++ .../interfaces/UploadArtifactResponse.md | 37 ++++ packages/artifact/package-lock.json | 168 ++++++++++++++++ packages/artifact/package.json | 5 +- .../src/internal/shared/interfaces.ts | 71 +++---- 19 files changed, 1530 insertions(+), 33 deletions(-) create mode 100644 packages/artifact/docs/generated/README.md create mode 100644 packages/artifact/docs/generated/classes/ArtifactNotFoundError.md create mode 100644 packages/artifact/docs/generated/classes/DefaultArtifactClient.md create mode 100644 packages/artifact/docs/generated/classes/FilesNotFoundError.md create mode 100644 packages/artifact/docs/generated/classes/GHESNotSupportedError.md create mode 100644 packages/artifact/docs/generated/classes/InvalidResponseError.md create mode 100644 packages/artifact/docs/generated/interfaces/Artifact.md create mode 100644 packages/artifact/docs/generated/interfaces/ArtifactClient.md create mode 100644 packages/artifact/docs/generated/interfaces/DownloadArtifactOptions.md create mode 100644 packages/artifact/docs/generated/interfaces/DownloadArtifactResponse.md create mode 100644 packages/artifact/docs/generated/interfaces/FindOptions.md create mode 100644 packages/artifact/docs/generated/interfaces/GetArtifactResponse.md create mode 100644 packages/artifact/docs/generated/interfaces/ListArtifactsOptions.md create mode 100644 packages/artifact/docs/generated/interfaces/ListArtifactsResponse.md create mode 100644 packages/artifact/docs/generated/interfaces/UploadArtifactOptions.md create mode 100644 packages/artifact/docs/generated/interfaces/UploadArtifactResponse.md diff --git a/packages/artifact/docs/generated/README.md b/packages/artifact/docs/generated/README.md new file mode 100644 index 00000000..a1244395 --- /dev/null +++ b/packages/artifact/docs/generated/README.md @@ -0,0 +1,40 @@ +@actions/artifact + +# @actions/artifact + +## Table of contents + +### Classes + +- [ArtifactNotFoundError](classes/ArtifactNotFoundError.md) +- [DefaultArtifactClient](classes/DefaultArtifactClient.md) +- [FilesNotFoundError](classes/FilesNotFoundError.md) +- [GHESNotSupportedError](classes/GHESNotSupportedError.md) +- [InvalidResponseError](classes/InvalidResponseError.md) + +### Interfaces + +- [Artifact](interfaces/Artifact.md) +- [ArtifactClient](interfaces/ArtifactClient.md) +- [DownloadArtifactOptions](interfaces/DownloadArtifactOptions.md) +- [DownloadArtifactResponse](interfaces/DownloadArtifactResponse.md) +- [FindOptions](interfaces/FindOptions.md) +- [GetArtifactResponse](interfaces/GetArtifactResponse.md) +- [ListArtifactsOptions](interfaces/ListArtifactsOptions.md) +- [ListArtifactsResponse](interfaces/ListArtifactsResponse.md) +- [UploadArtifactOptions](interfaces/UploadArtifactOptions.md) +- [UploadArtifactResponse](interfaces/UploadArtifactResponse.md) + +### Variables + +- [default](README.md#default) + +## Variables + +### default + +• `Const` **default**: [`ArtifactClient`](interfaces/ArtifactClient.md) + +#### Defined in + +[src/artifact.ts:7](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/artifact.ts#L7) diff --git a/packages/artifact/docs/generated/classes/ArtifactNotFoundError.md b/packages/artifact/docs/generated/classes/ArtifactNotFoundError.md new file mode 100644 index 00000000..61700bb3 --- /dev/null +++ b/packages/artifact/docs/generated/classes/ArtifactNotFoundError.md @@ -0,0 +1,169 @@ +[@actions/artifact](../README.md) / ArtifactNotFoundError + +# Class: ArtifactNotFoundError + +## Hierarchy + +- `Error` + + ↳ **`ArtifactNotFoundError`** + +## Table of contents + +### Constructors + +- [constructor](ArtifactNotFoundError.md#constructor) + +### Properties + +- [message](ArtifactNotFoundError.md#message) +- [name](ArtifactNotFoundError.md#name) +- [stack](ArtifactNotFoundError.md#stack) +- [prepareStackTrace](ArtifactNotFoundError.md#preparestacktrace) +- [stackTraceLimit](ArtifactNotFoundError.md#stacktracelimit) + +### Methods + +- [captureStackTrace](ArtifactNotFoundError.md#capturestacktrace) + +## Constructors + +### constructor + +• **new ArtifactNotFoundError**(`message?`): [`ArtifactNotFoundError`](ArtifactNotFoundError.md) + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `message` | `string` | `'Artifact not found'` | + +#### Returns + +[`ArtifactNotFoundError`](ArtifactNotFoundError.md) + +#### Overrides + +Error.constructor + +#### Defined in + +[src/internal/shared/errors.ts:24](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/errors.ts#L24) + +## Properties + +### message + +• **message**: `string` + +#### Inherited from + +Error.message + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1068 + +___ + +### name + +• **name**: `string` + +#### Inherited from + +Error.name + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1067 + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +Error.stack + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1069 + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +Error.prepareStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:11 + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +Error.stackTraceLimit + +#### Defined in + +node_modules/@types/node/globals.d.ts:13 + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +Error.captureStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:4 diff --git a/packages/artifact/docs/generated/classes/DefaultArtifactClient.md b/packages/artifact/docs/generated/classes/DefaultArtifactClient.md new file mode 100644 index 00000000..b93afc3e --- /dev/null +++ b/packages/artifact/docs/generated/classes/DefaultArtifactClient.md @@ -0,0 +1,161 @@ +[@actions/artifact](../README.md) / DefaultArtifactClient + +# Class: DefaultArtifactClient + +The default artifact client that is used by the artifact action(s). + +## Implements + +- [`ArtifactClient`](../interfaces/ArtifactClient.md) + +## Table of contents + +### Constructors + +- [constructor](DefaultArtifactClient.md#constructor) + +### Methods + +- [downloadArtifact](DefaultArtifactClient.md#downloadartifact) +- [getArtifact](DefaultArtifactClient.md#getartifact) +- [listArtifacts](DefaultArtifactClient.md#listartifacts) +- [uploadArtifact](DefaultArtifactClient.md#uploadartifact) + +## Constructors + +### constructor + +• **new DefaultArtifactClient**(): [`DefaultArtifactClient`](DefaultArtifactClient.md) + +#### Returns + +[`DefaultArtifactClient`](DefaultArtifactClient.md) + +## Methods + +### downloadArtifact + +▸ **downloadArtifact**(`artifactId`, `options?`): `Promise`\<[`DownloadArtifactResponse`](../interfaces/DownloadArtifactResponse.md)\> + +Downloads an artifact and unzips the content. + +If `options.findBy` is specified, this will use the public Download Artifact API https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#download-an-artifact + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `artifactId` | `number` | The name of the artifact to download | +| `options?` | [`DownloadArtifactOptions`](../interfaces/DownloadArtifactOptions.md) & [`FindOptions`](../interfaces/FindOptions.md) | Extra options that allow for the customization of the download behavior | + +#### Returns + +`Promise`\<[`DownloadArtifactResponse`](../interfaces/DownloadArtifactResponse.md)\> + +single DownloadArtifactResponse object + +#### Implementation of + +[ArtifactClient](../interfaces/ArtifactClient.md).[downloadArtifact](../interfaces/ArtifactClient.md#downloadartifact) + +#### Defined in + +[src/internal/client.ts:119](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L119) + +___ + +### getArtifact + +▸ **getArtifact**(`artifactName`, `options?`): `Promise`\<[`GetArtifactResponse`](../interfaces/GetArtifactResponse.md)\> + +Finds an artifact by name. +If there are multiple artifacts with the same name in the same workflow run, this will return the latest. +If the artifact is not found, it will throw. + +If `options.findBy` is specified, this will use the public List Artifacts API with a name filter which can get artifacts from other runs. +https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts +`@actions/artifact` v2+ does not allow for creating multiple artifacts with the same name in the same workflow run. +It is possible to have multiple artifacts with the same name in the same workflow run by using old versions of upload-artifact (v1,v2 and v3), @actions/artifact < v2 or it is a rerun. +If there are multiple artifacts with the same name in the same workflow run this function will return the first artifact that matches the name. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `artifactName` | `string` | The name of the artifact to find | +| `options?` | [`FindOptions`](../interfaces/FindOptions.md) | Extra options that allow for the customization of the get behavior | + +#### Returns + +`Promise`\<[`GetArtifactResponse`](../interfaces/GetArtifactResponse.md)\> + +#### Implementation of + +[ArtifactClient](../interfaces/ArtifactClient.md).[getArtifact](../interfaces/ArtifactClient.md#getartifact) + +#### Defined in + +[src/internal/client.ts:193](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L193) + +___ + +### listArtifacts + +▸ **listArtifacts**(`options?`): `Promise`\<[`ListArtifactsResponse`](../interfaces/ListArtifactsResponse.md)\> + +Lists all artifacts that are part of the current workflow run. +This function will return at most 1000 artifacts per workflow run. + +If `options.findBy` is specified, this will call the public List-Artifacts API which can list from other runs. +https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `options?` | [`ListArtifactsOptions`](../interfaces/ListArtifactsOptions.md) & [`FindOptions`](../interfaces/FindOptions.md) | Extra options that allow for the customization of the list behavior | + +#### Returns + +`Promise`\<[`ListArtifactsResponse`](../interfaces/ListArtifactsResponse.md)\> + +ListArtifactResponse object + +#### Implementation of + +[ArtifactClient](../interfaces/ArtifactClient.md).[listArtifacts](../interfaces/ArtifactClient.md#listartifacts) + +#### Defined in + +[src/internal/client.ts:157](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L157) + +___ + +### uploadArtifact + +▸ **uploadArtifact**(`name`, `files`, `rootDirectory`, `options?`): `Promise`\<[`UploadArtifactResponse`](../interfaces/UploadArtifactResponse.md)\> + +Uploads an artifact. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `name` | `string` | The name of the artifact, required | +| `files` | `string`[] | A list of absolute or relative paths that denote what files should be uploaded | +| `rootDirectory` | `string` | An absolute or relative file path that denotes the root parent directory of the files being uploaded | +| `options?` | [`UploadArtifactOptions`](../interfaces/UploadArtifactOptions.md) | Extra options for customizing the upload behavior | + +#### Returns + +`Promise`\<[`UploadArtifactResponse`](../interfaces/UploadArtifactResponse.md)\> + +single UploadArtifactResponse object + +#### Implementation of + +[ArtifactClient](../interfaces/ArtifactClient.md).[uploadArtifact](../interfaces/ArtifactClient.md#uploadartifact) + +#### Defined in + +[src/internal/client.ts:94](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L94) diff --git a/packages/artifact/docs/generated/classes/FilesNotFoundError.md b/packages/artifact/docs/generated/classes/FilesNotFoundError.md new file mode 100644 index 00000000..c7d22014 --- /dev/null +++ b/packages/artifact/docs/generated/classes/FilesNotFoundError.md @@ -0,0 +1,180 @@ +[@actions/artifact](../README.md) / FilesNotFoundError + +# Class: FilesNotFoundError + +## Hierarchy + +- `Error` + + ↳ **`FilesNotFoundError`** + +## Table of contents + +### Constructors + +- [constructor](FilesNotFoundError.md#constructor) + +### Properties + +- [files](FilesNotFoundError.md#files) +- [message](FilesNotFoundError.md#message) +- [name](FilesNotFoundError.md#name) +- [stack](FilesNotFoundError.md#stack) +- [prepareStackTrace](FilesNotFoundError.md#preparestacktrace) +- [stackTraceLimit](FilesNotFoundError.md#stacktracelimit) + +### Methods + +- [captureStackTrace](FilesNotFoundError.md#capturestacktrace) + +## Constructors + +### constructor + +• **new FilesNotFoundError**(`files?`): [`FilesNotFoundError`](FilesNotFoundError.md) + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `files` | `string`[] | `[]` | + +#### Returns + +[`FilesNotFoundError`](FilesNotFoundError.md) + +#### Overrides + +Error.constructor + +#### Defined in + +[src/internal/shared/errors.ts:4](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/errors.ts#L4) + +## Properties + +### files + +• **files**: `string`[] + +#### Defined in + +[src/internal/shared/errors.ts:2](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/errors.ts#L2) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +Error.message + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1068 + +___ + +### name + +• **name**: `string` + +#### Inherited from + +Error.name + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1067 + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +Error.stack + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1069 + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +Error.prepareStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:11 + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +Error.stackTraceLimit + +#### Defined in + +node_modules/@types/node/globals.d.ts:13 + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +Error.captureStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:4 diff --git a/packages/artifact/docs/generated/classes/GHESNotSupportedError.md b/packages/artifact/docs/generated/classes/GHESNotSupportedError.md new file mode 100644 index 00000000..942ae287 --- /dev/null +++ b/packages/artifact/docs/generated/classes/GHESNotSupportedError.md @@ -0,0 +1,169 @@ +[@actions/artifact](../README.md) / GHESNotSupportedError + +# Class: GHESNotSupportedError + +## Hierarchy + +- `Error` + + ↳ **`GHESNotSupportedError`** + +## Table of contents + +### Constructors + +- [constructor](GHESNotSupportedError.md#constructor) + +### Properties + +- [message](GHESNotSupportedError.md#message) +- [name](GHESNotSupportedError.md#name) +- [stack](GHESNotSupportedError.md#stack) +- [prepareStackTrace](GHESNotSupportedError.md#preparestacktrace) +- [stackTraceLimit](GHESNotSupportedError.md#stacktracelimit) + +### Methods + +- [captureStackTrace](GHESNotSupportedError.md#capturestacktrace) + +## Constructors + +### constructor + +• **new GHESNotSupportedError**(`message?`): [`GHESNotSupportedError`](GHESNotSupportedError.md) + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `message` | `string` | `'@actions/artifact v2.0.0+, upload-artifact@v4+ and download-artifact@v4+ are not currently supported on GHES.'` | + +#### Returns + +[`GHESNotSupportedError`](GHESNotSupportedError.md) + +#### Overrides + +Error.constructor + +#### Defined in + +[src/internal/shared/errors.ts:31](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/errors.ts#L31) + +## Properties + +### message + +• **message**: `string` + +#### Inherited from + +Error.message + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1068 + +___ + +### name + +• **name**: `string` + +#### Inherited from + +Error.name + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1067 + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +Error.stack + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1069 + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +Error.prepareStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:11 + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +Error.stackTraceLimit + +#### Defined in + +node_modules/@types/node/globals.d.ts:13 + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +Error.captureStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:4 diff --git a/packages/artifact/docs/generated/classes/InvalidResponseError.md b/packages/artifact/docs/generated/classes/InvalidResponseError.md new file mode 100644 index 00000000..1f6b0b5b --- /dev/null +++ b/packages/artifact/docs/generated/classes/InvalidResponseError.md @@ -0,0 +1,169 @@ +[@actions/artifact](../README.md) / InvalidResponseError + +# Class: InvalidResponseError + +## Hierarchy + +- `Error` + + ↳ **`InvalidResponseError`** + +## Table of contents + +### Constructors + +- [constructor](InvalidResponseError.md#constructor) + +### Properties + +- [message](InvalidResponseError.md#message) +- [name](InvalidResponseError.md#name) +- [stack](InvalidResponseError.md#stack) +- [prepareStackTrace](InvalidResponseError.md#preparestacktrace) +- [stackTraceLimit](InvalidResponseError.md#stacktracelimit) + +### Methods + +- [captureStackTrace](InvalidResponseError.md#capturestacktrace) + +## Constructors + +### constructor + +• **new InvalidResponseError**(`message`): [`InvalidResponseError`](InvalidResponseError.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `message` | `string` | + +#### Returns + +[`InvalidResponseError`](InvalidResponseError.md) + +#### Overrides + +Error.constructor + +#### Defined in + +[src/internal/shared/errors.ts:17](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/errors.ts#L17) + +## Properties + +### message + +• **message**: `string` + +#### Inherited from + +Error.message + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1068 + +___ + +### name + +• **name**: `string` + +#### Inherited from + +Error.name + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1067 + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +Error.stack + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1069 + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +Error.prepareStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:11 + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +Error.stackTraceLimit + +#### Defined in + +node_modules/@types/node/globals.d.ts:13 + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +Error.captureStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:4 diff --git a/packages/artifact/docs/generated/interfaces/Artifact.md b/packages/artifact/docs/generated/interfaces/Artifact.md new file mode 100644 index 00000000..1597daa5 --- /dev/null +++ b/packages/artifact/docs/generated/interfaces/Artifact.md @@ -0,0 +1,62 @@ +[@actions/artifact](../README.md) / Artifact + +# Interface: Artifact + +An Actions Artifact + +## Table of contents + +### Properties + +- [createdAt](Artifact.md#createdat) +- [id](Artifact.md#id) +- [name](Artifact.md#name) +- [size](Artifact.md#size) + +## Properties + +### createdAt + +• `Optional` **createdAt**: `Date` + +The time when the artifact was created + +#### Defined in + +[src/internal/shared/interfaces.ts:123](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L123) + +___ + +### id + +• **id**: `number` + +The ID of the artifact + +#### Defined in + +[src/internal/shared/interfaces.ts:113](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L113) + +___ + +### name + +• **name**: `string` + +The name of the artifact + +#### Defined in + +[src/internal/shared/interfaces.ts:108](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L108) + +___ + +### size + +• **size**: `number` + +The size of the artifact in bytes + +#### Defined in + +[src/internal/shared/interfaces.ts:118](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L118) diff --git a/packages/artifact/docs/generated/interfaces/ArtifactClient.md b/packages/artifact/docs/generated/interfaces/ArtifactClient.md new file mode 100644 index 00000000..39f7d923 --- /dev/null +++ b/packages/artifact/docs/generated/interfaces/ArtifactClient.md @@ -0,0 +1,131 @@ +[@actions/artifact](../README.md) / ArtifactClient + +# Interface: ArtifactClient + +Generic interface for the artifact client. + +## Implemented by + +- [`DefaultArtifactClient`](../classes/DefaultArtifactClient.md) + +## Table of contents + +### Methods + +- [downloadArtifact](ArtifactClient.md#downloadartifact) +- [getArtifact](ArtifactClient.md#getartifact) +- [listArtifacts](ArtifactClient.md#listartifacts) +- [uploadArtifact](ArtifactClient.md#uploadartifact) + +## Methods + +### downloadArtifact + +▸ **downloadArtifact**(`artifactId`, `options?`): `Promise`\<[`DownloadArtifactResponse`](DownloadArtifactResponse.md)\> + +Downloads an artifact and unzips the content. + +If `options.findBy` is specified, this will use the public Download Artifact API https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#download-an-artifact + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `artifactId` | `number` | The name of the artifact to download | +| `options?` | [`DownloadArtifactOptions`](DownloadArtifactOptions.md) & [`FindOptions`](FindOptions.md) | Extra options that allow for the customization of the download behavior | + +#### Returns + +`Promise`\<[`DownloadArtifactResponse`](DownloadArtifactResponse.md)\> + +single DownloadArtifactResponse object + +#### Defined in + +[src/internal/client.ts:84](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L84) + +___ + +### getArtifact + +▸ **getArtifact**(`artifactName`, `options?`): `Promise`\<[`GetArtifactResponse`](GetArtifactResponse.md)\> + +Finds an artifact by name. +If there are multiple artifacts with the same name in the same workflow run, this will return the latest. +If the artifact is not found, it will throw. + +If `options.findBy` is specified, this will use the public List Artifacts API with a name filter which can get artifacts from other runs. +https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts +`@actions/artifact` v2+ does not allow for creating multiple artifacts with the same name in the same workflow run. +It is possible to have multiple artifacts with the same name in the same workflow run by using old versions of upload-artifact (v1,v2 and v3), @actions/artifact < v2 or it is a rerun. +If there are multiple artifacts with the same name in the same workflow run this function will return the first artifact that matches the name. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `artifactName` | `string` | The name of the artifact to find | +| `options?` | [`FindOptions`](FindOptions.md) | Extra options that allow for the customization of the get behavior | + +#### Returns + +`Promise`\<[`GetArtifactResponse`](GetArtifactResponse.md)\> + +#### Defined in + +[src/internal/client.ts:70](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L70) + +___ + +### listArtifacts + +▸ **listArtifacts**(`options?`): `Promise`\<[`ListArtifactsResponse`](ListArtifactsResponse.md)\> + +Lists all artifacts that are part of the current workflow run. +This function will return at most 1000 artifacts per workflow run. + +If `options.findBy` is specified, this will call the public List-Artifacts API which can list from other runs. +https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `options?` | [`ListArtifactsOptions`](ListArtifactsOptions.md) & [`FindOptions`](FindOptions.md) | Extra options that allow for the customization of the list behavior | + +#### Returns + +`Promise`\<[`ListArtifactsResponse`](ListArtifactsResponse.md)\> + +ListArtifactResponse object + +#### Defined in + +[src/internal/client.ts:52](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L52) + +___ + +### uploadArtifact + +▸ **uploadArtifact**(`name`, `files`, `rootDirectory`, `options?`): `Promise`\<[`UploadArtifactResponse`](UploadArtifactResponse.md)\> + +Uploads an artifact. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `name` | `string` | The name of the artifact, required | +| `files` | `string`[] | A list of absolute or relative paths that denote what files should be uploaded | +| `rootDirectory` | `string` | An absolute or relative file path that denotes the root parent directory of the files being uploaded | +| `options?` | [`UploadArtifactOptions`](UploadArtifactOptions.md) | Extra options for customizing the upload behavior | + +#### Returns + +`Promise`\<[`UploadArtifactResponse`](UploadArtifactResponse.md)\> + +single UploadArtifactResponse object + +#### Defined in + +[src/internal/client.ts:35](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L35) diff --git a/packages/artifact/docs/generated/interfaces/DownloadArtifactOptions.md b/packages/artifact/docs/generated/interfaces/DownloadArtifactOptions.md new file mode 100644 index 00000000..8eff4d8f --- /dev/null +++ b/packages/artifact/docs/generated/interfaces/DownloadArtifactOptions.md @@ -0,0 +1,23 @@ +[@actions/artifact](../README.md) / DownloadArtifactOptions + +# Interface: DownloadArtifactOptions + +Options for downloading an artifact + +## Table of contents + +### Properties + +- [path](DownloadArtifactOptions.md#path) + +## Properties + +### path + +• `Optional` **path**: `string` + +Denotes where the artifact will be downloaded to. If not specified then the artifact is download to GITHUB_WORKSPACE + +#### Defined in + +[src/internal/shared/interfaces.ts:98](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L98) diff --git a/packages/artifact/docs/generated/interfaces/DownloadArtifactResponse.md b/packages/artifact/docs/generated/interfaces/DownloadArtifactResponse.md new file mode 100644 index 00000000..b2220364 --- /dev/null +++ b/packages/artifact/docs/generated/interfaces/DownloadArtifactResponse.md @@ -0,0 +1,23 @@ +[@actions/artifact](../README.md) / DownloadArtifactResponse + +# Interface: DownloadArtifactResponse + +Response from the server when downloading an artifact + +## Table of contents + +### Properties + +- [downloadPath](DownloadArtifactResponse.md#downloadpath) + +## Properties + +### downloadPath + +• `Optional` **downloadPath**: `string` + +The path where the artifact was downloaded to + +#### Defined in + +[src/internal/shared/interfaces.ts:88](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L88) diff --git a/packages/artifact/docs/generated/interfaces/FindOptions.md b/packages/artifact/docs/generated/interfaces/FindOptions.md new file mode 100644 index 00000000..68f56706 --- /dev/null +++ b/packages/artifact/docs/generated/interfaces/FindOptions.md @@ -0,0 +1,30 @@ +[@actions/artifact](../README.md) / FindOptions + +# Interface: FindOptions + +## Table of contents + +### Properties + +- [findBy](FindOptions.md#findby) + +## Properties + +### findBy + +• `Optional` **findBy**: `Object` + +The criteria for finding Artifact(s) out of the scope of the current run. + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `repositoryName` | `string` | Repository owner (eg. 'toolkit') | +| `repositoryOwner` | `string` | Repository owner (eg. 'actions') | +| `token` | `string` | Token with actions:read permissions | +| `workflowRunId` | `number` | WorkflowRun of the artifact(s) to lookup | + +#### Defined in + +[src/internal/shared/interfaces.ts:131](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L131) diff --git a/packages/artifact/docs/generated/interfaces/GetArtifactResponse.md b/packages/artifact/docs/generated/interfaces/GetArtifactResponse.md new file mode 100644 index 00000000..f4d56509 --- /dev/null +++ b/packages/artifact/docs/generated/interfaces/GetArtifactResponse.md @@ -0,0 +1,23 @@ +[@actions/artifact](../README.md) / GetArtifactResponse + +# Interface: GetArtifactResponse + +Response from the server when getting an artifact + +## Table of contents + +### Properties + +- [artifact](GetArtifactResponse.md#artifact) + +## Properties + +### artifact + +• **artifact**: [`Artifact`](Artifact.md) + +Metadata about the artifact that was found + +#### Defined in + +[src/internal/shared/interfaces.ts:57](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L57) diff --git a/packages/artifact/docs/generated/interfaces/ListArtifactsOptions.md b/packages/artifact/docs/generated/interfaces/ListArtifactsOptions.md new file mode 100644 index 00000000..27e3d5f7 --- /dev/null +++ b/packages/artifact/docs/generated/interfaces/ListArtifactsOptions.md @@ -0,0 +1,24 @@ +[@actions/artifact](../README.md) / ListArtifactsOptions + +# Interface: ListArtifactsOptions + +Options for listing artifacts + +## Table of contents + +### Properties + +- [latest](ListArtifactsOptions.md#latest) + +## Properties + +### latest + +• `Optional` **latest**: `boolean` + +Filter the workflow run's artifacts to the latest by name +In the case of reruns, this can be useful to avoid duplicates + +#### Defined in + +[src/internal/shared/interfaces.ts:68](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L68) diff --git a/packages/artifact/docs/generated/interfaces/ListArtifactsResponse.md b/packages/artifact/docs/generated/interfaces/ListArtifactsResponse.md new file mode 100644 index 00000000..836cbbd7 --- /dev/null +++ b/packages/artifact/docs/generated/interfaces/ListArtifactsResponse.md @@ -0,0 +1,23 @@ +[@actions/artifact](../README.md) / ListArtifactsResponse + +# Interface: ListArtifactsResponse + +Response from the server when listing artifacts + +## Table of contents + +### Properties + +- [artifacts](ListArtifactsResponse.md#artifacts) + +## Properties + +### artifacts + +• **artifacts**: [`Artifact`](Artifact.md)[] + +A list of artifacts that were found + +#### Defined in + +[src/internal/shared/interfaces.ts:78](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L78) diff --git a/packages/artifact/docs/generated/interfaces/UploadArtifactOptions.md b/packages/artifact/docs/generated/interfaces/UploadArtifactOptions.md new file mode 100644 index 00000000..acff13df --- /dev/null +++ b/packages/artifact/docs/generated/interfaces/UploadArtifactOptions.md @@ -0,0 +1,55 @@ +[@actions/artifact](../README.md) / UploadArtifactOptions + +# Interface: UploadArtifactOptions + +Options for uploading an artifact + +## Table of contents + +### Properties + +- [compressionLevel](UploadArtifactOptions.md#compressionlevel) +- [retentionDays](UploadArtifactOptions.md#retentiondays) + +## Properties + +### compressionLevel + +• `Optional` **compressionLevel**: `number` + +The level of compression for Zlib to be applied to the artifact archive. +The value can range from 0 to 9: +- 0: No compression +- 1: Best speed +- 6: Default compression (same as GNU Gzip) +- 9: Best compression +Higher levels will result in better compression, but will take longer to complete. +For large files that are not easily compressed, a value of 0 is recommended for significantly faster uploads. + +#### Defined in + +[src/internal/shared/interfaces.ts:47](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L47) + +___ + +### retentionDays + +• `Optional` **retentionDays**: `number` + +Duration after which artifact will expire in days. + +By default artifact expires after 90 days: +https://docs.github.com/en/actions/configuring-and-managing-workflows/persisting-workflow-data-using-artifacts#downloading-and-deleting-artifacts-after-a-workflow-run-is-complete + +Use this option to override the default expiry. + +Min value: 1 +Max value: 90 unless changed by repository setting + +If this is set to a greater value than the retention settings allowed, the retention on artifacts +will be reduced to match the max value allowed on server, and the upload process will continue. An +input of 0 assumes default retention setting. + +#### Defined in + +[src/internal/shared/interfaces.ts:36](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L36) diff --git a/packages/artifact/docs/generated/interfaces/UploadArtifactResponse.md b/packages/artifact/docs/generated/interfaces/UploadArtifactResponse.md new file mode 100644 index 00000000..574366fc --- /dev/null +++ b/packages/artifact/docs/generated/interfaces/UploadArtifactResponse.md @@ -0,0 +1,37 @@ +[@actions/artifact](../README.md) / UploadArtifactResponse + +# Interface: UploadArtifactResponse + +Response from the server when an artifact is uploaded + +## Table of contents + +### Properties + +- [id](UploadArtifactResponse.md#id) +- [size](UploadArtifactResponse.md#size) + +## Properties + +### id + +• `Optional` **id**: `number` + +The id of the artifact that was created. Not provided if no artifact was uploaded +This ID can be used as input to other APIs to download, delete or get more information about an artifact: https://docs.github.com/en/rest/actions/artifacts + +#### Defined in + +[src/internal/shared/interfaces.ts:14](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L14) + +___ + +### size + +• `Optional` **size**: `number` + +Total size of the artifact in bytes. Not provided if no artifact was uploaded + +#### Defined in + +[src/internal/shared/interfaces.ts:8](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L8) diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index 4706d54a..26967402 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -27,6 +27,8 @@ }, "devDependencies": { "@types/archiver": "^5.3.2", + "typedoc": "^0.25.4", + "typedoc-plugin-markdown": "^3.17.1", "typescript": "^5.2.2" } }, @@ -477,6 +479,12 @@ "@types/node": "*" } }, + "node_modules/ansi-sequence-parser": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz", + "integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==", + "dev": true + }, "node_modules/archiver": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/archiver/-/archiver-5.3.1.tgz", @@ -905,6 +913,27 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, + "node_modules/handlebars": { + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.2", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -951,6 +980,12 @@ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" }, + "node_modules/jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", + "dev": true + }, "node_modules/jwt-decode": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz", @@ -1037,6 +1072,24 @@ "tslib": "^2.0.3" } }, + "node_modules/lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "dev": true + }, + "node_modules/marked": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", + "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", + "dev": true, + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 12" + } + }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -1086,6 +1139,12 @@ "mkdirp": "bin/cmd.js" } }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, "node_modules/no-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", @@ -1259,6 +1318,27 @@ "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" }, + "node_modules/shiki": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.5.tgz", + "integrity": "sha512-1gCAYOcmCFONmErGTrS1fjzJLA7MGZmKzrBNX7apqSwhyITJg2O102uFzXUeBxNnEkDA9vHIKLyeKq0V083vIw==", + "dev": true, + "dependencies": { + "ansi-sequence-parser": "^1.1.0", + "jsonc-parser": "^3.2.0", + "vscode-oniguruma": "^1.7.0", + "vscode-textmate": "^8.0.0" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -1345,6 +1425,63 @@ } } }, + "node_modules/typedoc": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.4.tgz", + "integrity": "sha512-Du9ImmpBCw54bX275yJrxPVnjdIyJO/84co0/L9mwe0R3G4FSR6rQ09AlXVRvZEGMUg09+z/usc8mgygQ1aidA==", + "dev": true, + "dependencies": { + "lunr": "^2.3.9", + "marked": "^4.3.0", + "minimatch": "^9.0.3", + "shiki": "^0.14.1" + }, + "bin": { + "typedoc": "bin/typedoc" + }, + "engines": { + "node": ">= 16" + }, + "peerDependencies": { + "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x" + } + }, + "node_modules/typedoc-plugin-markdown": { + "version": "3.17.1", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.17.1.tgz", + "integrity": "sha512-QzdU3fj0Kzw2XSdoL15ExLASt2WPqD7FbLeaqwT70+XjKyTshBnUlQA5nNREO1C2P8Uen0CDjsBLMsCQ+zd0lw==", + "dev": true, + "dependencies": { + "handlebars": "^4.7.7" + }, + "peerDependencies": { + "typedoc": ">=0.24.0" + } + }, + "node_modules/typedoc/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/typedoc/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/typescript": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", @@ -1358,6 +1495,19 @@ "node": ">=14.17" } }, + "node_modules/uglify-js": { + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", + "dev": true, + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/universal-user-agent": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", @@ -1420,6 +1570,18 @@ "uuid": "dist/bin/uuid" } }, + "node_modules/vscode-oniguruma": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", + "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==", + "dev": true + }, + "node_modules/vscode-textmate": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz", + "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==", + "dev": true + }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -1434,6 +1596,12 @@ "webidl-conversions": "^3.0.0" } }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/packages/artifact/package.json b/packages/artifact/package.json index 7dc7eafc..894e1607 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -33,7 +33,8 @@ "test": "cd ../../ && npm run test ./packages/artifact", "bootstrap": "cd ../../ && npm run bootstrap", "tsc-run": "tsc", - "tsc": "npm run bootstrap && npm run tsc-run" + "tsc": "npm run bootstrap && npm run tsc-run", + "gen:docs": "typedoc --plugin typedoc-plugin-markdown --out docs/generated src/artifact.ts --githubPages false --readme none" }, "bugs": { "url": "https://github.com/actions/toolkit/issues" @@ -57,6 +58,8 @@ }, "devDependencies": { "@types/archiver": "^5.3.2", + "typedoc": "^0.25.4", + "typedoc-plugin-markdown": "^3.17.1", "typescript": "^5.2.2" } } diff --git a/packages/artifact/src/internal/shared/interfaces.ts b/packages/artifact/src/internal/shared/interfaces.ts index e40fb661..c661721e 100644 --- a/packages/artifact/src/internal/shared/interfaces.ts +++ b/packages/artifact/src/internal/shared/interfaces.ts @@ -1,8 +1,6 @@ -/***************************************************************************** - * * - * UploadArtifact * - * * - *****************************************************************************/ +/** + * Response from the server when an artifact is uploaded + */ export interface UploadArtifactResponse { /** * Total size of the artifact in bytes. Not provided if no artifact was uploaded @@ -16,6 +14,9 @@ export interface UploadArtifactResponse { id?: number } +/** + * Options for uploading an artifact + */ export interface UploadArtifactOptions { /** * Duration after which artifact will expire in days. @@ -46,12 +47,9 @@ export interface UploadArtifactOptions { compressionLevel?: number } -/***************************************************************************** - * * - * GetArtifact * - * * - *****************************************************************************/ - +/** + * Response from the server when getting an artifact + */ export interface GetArtifactResponse { /** * Metadata about the artifact that was found @@ -59,12 +57,9 @@ export interface GetArtifactResponse { artifact: Artifact } -/***************************************************************************** - * * - * ListArtifact * - * * - *****************************************************************************/ - +/** + * Options for listing artifacts + */ export interface ListArtifactsOptions { /** * Filter the workflow run's artifacts to the latest by name @@ -73,6 +68,9 @@ export interface ListArtifactsOptions { latest?: boolean } +/** + * Response from the server when listing artifacts + */ export interface ListArtifactsResponse { /** * A list of artifacts that were found @@ -80,11 +78,9 @@ export interface ListArtifactsResponse { artifacts: Artifact[] } -/***************************************************************************** - * * - * DownloadArtifact * - * * - *****************************************************************************/ +/** + * Response from the server when downloading an artifact + */ export interface DownloadArtifactResponse { /** * The path where the artifact was downloaded to @@ -92,6 +88,9 @@ export interface DownloadArtifactResponse { downloadPath?: string } +/** + * Options for downloading an artifact + */ export interface DownloadArtifactOptions { /** * Denotes where the artifact will be downloaded to. If not specified then the artifact is download to GITHUB_WORKSPACE @@ -99,11 +98,9 @@ export interface DownloadArtifactOptions { path?: string } -/***************************************************************************** - * * - * Shared * - * * - *****************************************************************************/ +/** + * An Actions Artifact + */ export interface Artifact { /** * The name of the artifact @@ -127,16 +124,26 @@ export interface Artifact { } // FindOptions are for fetching Artifact(s) out of the scope of the current run. -// Must specify a token with actions:read scope for cross run/repo lookup otherwise these will be ignored. export interface FindOptions { + /** + * The criteria for finding Artifact(s) out of the scope of the current run. + */ findBy?: { - // Token with actions:read permissions + /** + * Token with actions:read permissions + */ token: string - // WorkflowRun of the artifact(s) to lookup + /** + * WorkflowRun of the artifact(s) to lookup + */ workflowRunId: number - // Repository owner + /** + * Repository owner (eg. 'actions') + */ repositoryOwner: string - // Repository name + /** + * Repository owner (eg. 'toolkit') + */ repositoryName: string } } From 55a05255d7b8de00e3d0a91ccefe29e9d04a5441 Mon Sep 17 00:00:00 2001 From: Jonathan Tamsut Date: Thu, 7 Dec 2023 13:22:17 -0800 Subject: [PATCH 054/198] Remove 429 request from list of retry-able status codes (#1597) * remove 429 request from retryable * remove 413 * make linter happy --- .../artifact/src/internal/shared/artifact-twirp-client.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/artifact/src/internal/shared/artifact-twirp-client.ts b/packages/artifact/src/internal/shared/artifact-twirp-client.ts index 9166e799..4ad3f970 100644 --- a/packages/artifact/src/internal/shared/artifact-twirp-client.ts +++ b/packages/artifact/src/internal/shared/artifact-twirp-client.ts @@ -132,9 +132,7 @@ class ArtifactHttpClient implements Rpc { HttpCodes.BadGateway, HttpCodes.GatewayTimeout, HttpCodes.InternalServerError, - HttpCodes.ServiceUnavailable, - HttpCodes.TooManyRequests, - 413 // Payload Too Large + HttpCodes.ServiceUnavailable ] return retryableStatusCodes.includes(statusCode) From 88b76de595daf09bb2e034be3dd69d728e8df98b Mon Sep 17 00:00:00 2001 From: Jonathan Tamsut Date: Fri, 8 Dec 2023 11:00:44 -0800 Subject: [PATCH 055/198] Add back 429 to list of retryable requests (#1599) * add back 429 to list of retryable requests * fix lint error --- packages/artifact/src/internal/shared/artifact-twirp-client.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/artifact/src/internal/shared/artifact-twirp-client.ts b/packages/artifact/src/internal/shared/artifact-twirp-client.ts index 4ad3f970..f5f72775 100644 --- a/packages/artifact/src/internal/shared/artifact-twirp-client.ts +++ b/packages/artifact/src/internal/shared/artifact-twirp-client.ts @@ -132,7 +132,8 @@ class ArtifactHttpClient implements Rpc { HttpCodes.BadGateway, HttpCodes.GatewayTimeout, HttpCodes.InternalServerError, - HttpCodes.ServiceUnavailable + HttpCodes.ServiceUnavailable, + HttpCodes.TooManyRequests ] return retryableStatusCodes.includes(statusCode) From 950e1711a17dee44e90a77088550d897d0d37e31 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Mon, 11 Dec 2023 11:26:54 -0500 Subject: [PATCH 056/198] Improve error messages (duplicate artifacts; too many artifacts) (#1600) * cleaning up error messages * updating package-json * updating package-lock * . * . * testing return message * updating error check * adding test * rmv unused var * updating status code to match conflict message --- .../__tests__/artifact-http-client.test.ts | 48 +++++++++++++++++++ .../internal/shared/artifact-twirp-client.ts | 6 ++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/packages/artifact/__tests__/artifact-http-client.test.ts b/packages/artifact/__tests__/artifact-http-client.test.ts index 2dd6c5c4..3c6c3784 100644 --- a/packages/artifact/__tests__/artifact-http-client.test.ts +++ b/packages/artifact/__tests__/artifact-http-client.test.ts @@ -190,4 +190,52 @@ describe('artifact-http-client', () => { expect(mockHttpClient).toHaveBeenCalledTimes(1) expect(mockPost).toHaveBeenCalledTimes(1) }) + + it('should fail with a descriptive error', async () => { + // 409 duplicate error + const mockPost = jest.fn(() => { + const msgFailed = new http.IncomingMessage(new net.Socket()) + msgFailed.statusCode = 409 + msgFailed.statusMessage = 'Conflict' + return { + message: msgFailed, + readBody: async () => { + return Promise.resolve( + `{"msg": "an artifact with this name already exists on the workflow run"}` + ) + } + } + }) + + const mockHttpClient = ( + HttpClient as unknown as jest.Mock + ).mockImplementation(() => { + return { + post: mockPost + } + }) + const client = internalArtifactTwirpClient({ + maxAttempts: 5, + retryIntervalMs: 1, + retryMultiplier: 1.5 + }) + await expect(async () => { + await client.CreateArtifact({ + workflowRunBackendId: '1234', + workflowJobRunBackendId: '5678', + name: 'artifact', + version: 4 + }) + await client.CreateArtifact({ + workflowRunBackendId: '1234', + workflowJobRunBackendId: '5678', + name: 'artifact', + version: 4 + }) + }).rejects.toThrowError( + 'Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run' + ) + expect(mockHttpClient).toHaveBeenCalledTimes(1) + expect(mockPost).toHaveBeenCalledTimes(1) + }) }) diff --git a/packages/artifact/src/internal/shared/artifact-twirp-client.ts b/packages/artifact/src/internal/shared/artifact-twirp-client.ts index f5f72775..4feba626 100644 --- a/packages/artifact/src/internal/shared/artifact-twirp-client.ts +++ b/packages/artifact/src/internal/shared/artifact-twirp-client.ts @@ -84,13 +84,15 @@ class ArtifactHttpClient implements Rpc { debug(`[Response] - ${response.message.statusCode}`) debug(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`) debug(`Body: ${body}`) - if (this.isSuccessStatusCode(statusCode)) { return {response, body} } - isRetryable = this.isRetryableHttpStatusCode(statusCode) errorMessage = `Failed request: (${statusCode}) ${response.message.statusMessage}` + const responseMessage = JSON.parse(body).msg + if (responseMessage) { + errorMessage = `${errorMessage}: ${responseMessage}` + } } catch (error) { isRetryable = true errorMessage = error.message From 3c3af56b2919a71f1524f80e4cbca0287ccd2bb1 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Mon, 11 Dec 2023 12:15:40 -0500 Subject: [PATCH 057/198] replace unzipper with unzip-stream --- packages/artifact/package-lock.json | 19 +++++++++++++++++++ packages/artifact/package.json | 2 ++ .../internal/download/download-artifact.ts | 9 +++++++-- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index 26967402..472e06bc 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -18,11 +18,13 @@ "@octokit/plugin-retry": "^3.0.9", "@octokit/request-error": "^5.0.0", "@protobuf-ts/plugin": "^2.2.3-alpha.1", + "@types/unzip-stream": "^0.3.4", "@types/unzipper": "^0.10.6", "archiver": "^5.3.1", "crypto": "^1.0.1", "jwt-decode": "^3.1.2", "twirp-ts": "^2.5.0", + "unzip-stream": "^0.3.1", "unzipper": "^0.10.14" }, "devDependencies": { @@ -471,6 +473,14 @@ "@types/node": "*" } }, + "node_modules/@types/unzip-stream": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@types/unzip-stream/-/unzip-stream-0.3.4.tgz", + "integrity": "sha512-ud0vtsNRF+joUCyvNMyo0j5DKX2Lh/im+xVgRzBEsfHhQYZ+i4fKTveova9XxLzt6Jl6G0e/0mM4aC0gqZYSnA==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/unzipper": { "version": "0.10.6", "resolved": "https://registry.npmjs.org/@types/unzipper/-/unzipper-0.10.6.tgz", @@ -1513,6 +1523,15 @@ "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" }, + "node_modules/unzip-stream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/unzip-stream/-/unzip-stream-0.3.1.tgz", + "integrity": "sha512-RzaGXLNt+CW+T41h1zl6pGz3EaeVhYlK+rdAap+7DxW5kqsqePO8kRtWPaCiVqdhZc86EctSPVYNix30YOMzmw==", + "dependencies": { + "binary": "^0.3.0", + "mkdirp": "^0.5.1" + } + }, "node_modules/unzipper": { "version": "0.10.14", "resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.10.14.tgz", diff --git a/packages/artifact/package.json b/packages/artifact/package.json index 894e1607..902f57bd 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -49,11 +49,13 @@ "@octokit/plugin-retry": "^3.0.9", "@octokit/request-error": "^5.0.0", "@protobuf-ts/plugin": "^2.2.3-alpha.1", + "@types/unzip-stream": "^0.3.4", "@types/unzipper": "^0.10.6", "archiver": "^5.3.1", "crypto": "^1.0.1", "jwt-decode": "^3.1.2", "twirp-ts": "^2.5.0", + "unzip-stream": "^0.3.1", "unzipper": "^0.10.14" }, "devDependencies": { diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 3bb3de61..a61e2937 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -2,7 +2,7 @@ import fs from 'fs/promises' import * as github from '@actions/github' import * as core from '@actions/core' import * as httpClient from '@actions/http-client' -import unzipper from 'unzipper' +import unzip from 'unzip-stream' import { DownloadArtifactOptions, DownloadArtifactResponse @@ -47,7 +47,12 @@ async function streamExtract(url: string, directory: string): Promise { ) } - return response.message.pipe(unzipper.Extract({path: directory})).promise() + return new Promise((resolve, reject) => { + response.message + .pipe(unzip.Extract({path: directory})) + .on('close', resolve) + .on('error', reject) + }) } export async function downloadArtifactPublic( From 4c531c013ae8df70f4b2cf5609cf422a99046ad4 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Mon, 11 Dec 2023 12:24:41 -0500 Subject: [PATCH 058/198] update packages --- packages/artifact/package-lock.json | 150 +--------------------------- packages/artifact/package.json | 6 +- 2 files changed, 5 insertions(+), 151 deletions(-) diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index 472e06bc..abe007be 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -18,17 +18,15 @@ "@octokit/plugin-retry": "^3.0.9", "@octokit/request-error": "^5.0.0", "@protobuf-ts/plugin": "^2.2.3-alpha.1", - "@types/unzip-stream": "^0.3.4", - "@types/unzipper": "^0.10.6", "archiver": "^5.3.1", "crypto": "^1.0.1", "jwt-decode": "^3.1.2", "twirp-ts": "^2.5.0", - "unzip-stream": "^0.3.1", - "unzipper": "^0.10.14" + "unzip-stream": "^0.3.1" }, "devDependencies": { "@types/archiver": "^5.3.2", + "@types/unzip-stream": "^0.3.4", "typedoc": "^0.25.4", "typedoc-plugin-markdown": "^3.17.1", "typescript": "^5.2.2" @@ -477,14 +475,7 @@ "version": "0.3.4", "resolved": "https://registry.npmjs.org/@types/unzip-stream/-/unzip-stream-0.3.4.tgz", "integrity": "sha512-ud0vtsNRF+joUCyvNMyo0j5DKX2Lh/im+xVgRzBEsfHhQYZ+i4fKTveova9XxLzt6Jl6G0e/0mM4aC0gqZYSnA==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/unzipper": { - "version": "0.10.6", - "resolved": "https://registry.npmjs.org/@types/unzipper/-/unzipper-0.10.6.tgz", - "integrity": "sha512-zcBj329AHgKLQyz209N/S9R0GZqXSkUQO4tJSYE3x02qg4JuDFpgKMj50r82Erk1natCWQDIvSccDddt7jPzjA==", + "dev": true, "dependencies": { "@types/node": "*" } @@ -598,14 +589,6 @@ "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==" }, - "node_modules/big-integer": { - "version": "1.6.51", - "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", - "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", - "engines": { - "node": ">=0.6" - } - }, "node_modules/binary": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz", @@ -628,11 +611,6 @@ "readable-stream": "^3.4.0" } }, - "node_modules/bluebird": { - "version": "3.4.7", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz", - "integrity": "sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA==" - }, "node_modules/bottleneck": { "version": "2.19.5", "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", @@ -678,14 +656,6 @@ "node": "*" } }, - "node_modules/buffer-indexof-polyfill": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.2.tgz", - "integrity": "sha512-I7wzHwA3t1/lwXQh+A5PbNvJxgfo5r3xulgpYDB5zckTu/Z9oUK9biouBKQUjEqzaz3HnAT6TYoovmE+GqSf7A==", - "engines": { - "node": ">=0.10" - } - }, "node_modules/buffers": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz", @@ -811,41 +781,6 @@ "dot-object": "bin/dot-object" } }, - "node_modules/duplexer2": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", - "dependencies": { - "readable-stream": "^2.0.2" - } - }, - "node_modules/duplexer2/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/duplexer2/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/duplexer2/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -885,20 +820,6 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, - "node_modules/fstream": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", - "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", - "dependencies": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - }, - "engines": { - "node": ">=0.6" - } - }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -1039,11 +960,6 @@ "safe-buffer": "~5.1.0" } }, - "node_modules/listenercount": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/listenercount/-/listenercount-1.0.1.tgz", - "integrity": "sha512-3mk/Zag0+IJxeDrxSgaDPy4zZ3w05PRZeJNnlWhzFz5OkX49J4krc+A8X2d2M69vGMBEX0uyl8M+W+8gH+kBqQ==" - }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -1288,17 +1204,6 @@ "node": ">=10" } }, - "node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1323,11 +1228,6 @@ "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, - "node_modules/setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" - }, "node_modules/shiki": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.5.tgz", @@ -1532,50 +1432,6 @@ "mkdirp": "^0.5.1" } }, - "node_modules/unzipper": { - "version": "0.10.14", - "resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.10.14.tgz", - "integrity": "sha512-ti4wZj+0bQTiX2KmKWuwj7lhV+2n//uXEotUmGuQqrbVZSEGFMbI68+c6JCQ8aAmUWYvtHEz2A8K6wXvueR/6g==", - "dependencies": { - "big-integer": "^1.6.17", - "binary": "~0.3.0", - "bluebird": "~3.4.1", - "buffer-indexof-polyfill": "~1.0.0", - "duplexer2": "~0.1.4", - "fstream": "^1.0.12", - "graceful-fs": "^4.2.2", - "listenercount": "~1.0.1", - "readable-stream": "~2.3.6", - "setimmediate": "~1.0.4" - } - }, - "node_modules/unzipper/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/unzipper/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/unzipper/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/packages/artifact/package.json b/packages/artifact/package.json index 902f57bd..c4f826c6 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -49,17 +49,15 @@ "@octokit/plugin-retry": "^3.0.9", "@octokit/request-error": "^5.0.0", "@protobuf-ts/plugin": "^2.2.3-alpha.1", - "@types/unzip-stream": "^0.3.4", - "@types/unzipper": "^0.10.6", "archiver": "^5.3.1", "crypto": "^1.0.1", "jwt-decode": "^3.1.2", "twirp-ts": "^2.5.0", - "unzip-stream": "^0.3.1", - "unzipper": "^0.10.14" + "unzip-stream": "^0.3.1" }, "devDependencies": { "@types/archiver": "^5.3.2", + "@types/unzip-stream": "^0.3.4", "typedoc": "^0.25.4", "typedoc-plugin-markdown": "^3.17.1", "typescript": "^5.2.2" From 09249a72d7b7b84d4768e53ee06a10dd4c0abf1d Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Mon, 11 Dec 2023 13:41:11 -0500 Subject: [PATCH 059/198] push null at end of mocked message --- packages/artifact/__tests__/download-artifact.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index 247a5e42..815a760c 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -104,6 +104,7 @@ const mockGetArtifactSuccess = jest.fn(() => { const message = new http.IncomingMessage(new net.Socket()) message.statusCode = 200 message.push(fs.readFileSync(fixtures.exampleArtifact.path)) + message.push(null) return { message } @@ -113,6 +114,7 @@ const mockGetArtifactFailure = jest.fn(() => { const message = new http.IncomingMessage(new net.Socket()) message.statusCode = 500 message.push('Internal Server Error') + message.push(null) return { message } From a4bd0f12142bbe44d179de5973b20a5bd9378fe7 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Mon, 11 Dec 2023 17:07:48 -0500 Subject: [PATCH 060/198] Add specific messages for network-specific node error codes --- .../__tests__/artifact-http-client.test.ts | 65 +++++++++++++------ .../internal/shared/artifact-twirp-client.ts | 4 ++ .../artifact/src/internal/shared/errors.ts | 22 +++++++ .../src/internal/upload/blob-upload.ts | 21 ++++-- 4 files changed, 86 insertions(+), 26 deletions(-) diff --git a/packages/artifact/__tests__/artifact-http-client.test.ts b/packages/artifact/__tests__/artifact-http-client.test.ts index 3c6c3784..d96c0d59 100644 --- a/packages/artifact/__tests__/artifact-http-client.test.ts +++ b/packages/artifact/__tests__/artifact-http-client.test.ts @@ -7,6 +7,12 @@ import {noopLogs} from './common' jest.mock('@actions/http-client') +const clientOptions = { + maxAttempts: 5, + retryIntervalMs: 1, + retryMultiplier: 1.5 +} + describe('artifact-http-client', () => { beforeAll(() => { noopLogs() @@ -94,11 +100,7 @@ describe('artifact-http-client', () => { } }) - const client = internalArtifactTwirpClient({ - maxAttempts: 5, - retryIntervalMs: 1, - retryMultiplier: 1.5 - }) + const client = internalArtifactTwirpClient(clientOptions) const artifact = await client.CreateArtifact({ workflowRunBackendId: '1234', workflowJobRunBackendId: '5678', @@ -133,11 +135,7 @@ describe('artifact-http-client', () => { post: mockPost } }) - const client = internalArtifactTwirpClient({ - maxAttempts: 5, - retryIntervalMs: 1, - retryMultiplier: 1.5 - }) + const client = internalArtifactTwirpClient(clientOptions) await expect(async () => { await client.CreateArtifact({ workflowRunBackendId: '1234', @@ -172,11 +170,7 @@ describe('artifact-http-client', () => { post: mockPost } }) - const client = internalArtifactTwirpClient({ - maxAttempts: 5, - retryIntervalMs: 1, - retryMultiplier: 1.5 - }) + const client = internalArtifactTwirpClient(clientOptions) await expect(async () => { await client.CreateArtifact({ workflowRunBackendId: '1234', @@ -214,11 +208,7 @@ describe('artifact-http-client', () => { post: mockPost } }) - const client = internalArtifactTwirpClient({ - maxAttempts: 5, - retryIntervalMs: 1, - retryMultiplier: 1.5 - }) + const client = internalArtifactTwirpClient(clientOptions) await expect(async () => { await client.CreateArtifact({ workflowRunBackendId: '1234', @@ -238,4 +228,39 @@ describe('artifact-http-client', () => { expect(mockHttpClient).toHaveBeenCalledTimes(1) expect(mockPost).toHaveBeenCalledTimes(1) }) + + it('should properly describe a network failure', async () => { + class FakeNodeError extends Error { + code: string + constructor(code: string) { + super() + this.code = code + } + } + + const mockPost = jest.fn(() => { + throw new FakeNodeError('ENOTFOUND') + }) + + const mockHttpClient = ( + HttpClient as unknown as jest.Mock + ).mockImplementation(() => { + return { + post: mockPost + } + }) + const client = internalArtifactTwirpClient() + await expect(async () => { + await client.CreateArtifact({ + workflowRunBackendId: '1234', + workflowJobRunBackendId: '5678', + name: 'artifact', + version: 4 + }) + }).rejects.toThrowError( + 'Failed to CreateArtifact: Unable to make request: ENOTFOUND\nIf you are using self-hosted runners, please make sure your runner has access to all GitHub endpoints: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#communication-between-self-hosted-runners-and-github' + ) + expect(mockHttpClient).toHaveBeenCalledTimes(1) + expect(mockPost).toHaveBeenCalledTimes(1) + }) }) diff --git a/packages/artifact/src/internal/shared/artifact-twirp-client.ts b/packages/artifact/src/internal/shared/artifact-twirp-client.ts index 4feba626..be26c648 100644 --- a/packages/artifact/src/internal/shared/artifact-twirp-client.ts +++ b/packages/artifact/src/internal/shared/artifact-twirp-client.ts @@ -4,6 +4,7 @@ import {info, debug} from '@actions/core' import {ArtifactServiceClientJSON} from '../../generated' import {getResultsServiceUrl, getRuntimeToken} from './config' import {getUserAgentString} from './user-agent' +import {NetworkError} from './errors' // The twirp http client must implement this interface interface Rpc { @@ -96,6 +97,9 @@ class ArtifactHttpClient implements Rpc { } catch (error) { isRetryable = true errorMessage = error.message + if (NetworkError.isNetworkErrorCode(error?.code)) { + throw new NetworkError(error?.code) + } } if (!isRetryable) { diff --git a/packages/artifact/src/internal/shared/errors.ts b/packages/artifact/src/internal/shared/errors.ts index 841c44a6..4f23ecd3 100644 --- a/packages/artifact/src/internal/shared/errors.ts +++ b/packages/artifact/src/internal/shared/errors.ts @@ -35,3 +35,25 @@ export class GHESNotSupportedError extends Error { this.name = 'GHESNotSupportedError' } } + +export class NetworkError extends Error { + code: string + + constructor(code: string) { + const message = `Unable to make request: ${code}\nIf you are using self-hosted runners, please make sure your runner has access to all GitHub endpoints: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#communication-between-self-hosted-runners-and-github` + super(message) + this.code = code + this.name = 'NetworkError' + } + + static isNetworkErrorCode = (code?: string): boolean => { + if (!code) return false + return [ + 'ECONNRESET', + 'ENOTFOUND', + 'ETIMEDOUT', + 'ECONNREFUSED', + 'EHOSTUNREACH' + ].includes(code) + } +} diff --git a/packages/artifact/src/internal/upload/blob-upload.ts b/packages/artifact/src/internal/upload/blob-upload.ts index 59472385..87bb7237 100644 --- a/packages/artifact/src/internal/upload/blob-upload.ts +++ b/packages/artifact/src/internal/upload/blob-upload.ts @@ -5,6 +5,7 @@ import {getUploadChunkSize, getConcurrency} from '../shared/config' import * as core from '@actions/core' import * as crypto from 'crypto' import * as stream from 'stream' +import {NetworkError} from '../shared/errors' export interface BlobUploadResponse { /** @@ -52,12 +53,20 @@ export async function uploadZipToBlobStorage( core.info('Beginning upload of artifact content to blob storage') - await blockBlobClient.uploadStream( - uploadStream, - bufferSize, - maxConcurrency, - options - ) + try { + await blockBlobClient.uploadStream( + uploadStream, + bufferSize, + maxConcurrency, + options + ) + } catch (error) { + if (NetworkError.isNetworkErrorCode(error?.code)) { + throw new NetworkError(error?.code) + } + + throw error + } core.info('Finished uploading artifact content to blob storage!') From 16b786a545a0b3a90e4dc4330af7225cf06f7e93 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Mon, 11 Dec 2023 22:01:08 -0500 Subject: [PATCH 061/198] better error message for usage limits --- .../__tests__/artifact-http-client.test.ts | 40 +++++++++++++++++-- .../internal/shared/artifact-twirp-client.ts | 35 +++++++++++----- .../artifact/src/internal/shared/errors.ts | 13 ++++++ 3 files changed, 75 insertions(+), 13 deletions(-) diff --git a/packages/artifact/__tests__/artifact-http-client.test.ts b/packages/artifact/__tests__/artifact-http-client.test.ts index d96c0d59..e6768346 100644 --- a/packages/artifact/__tests__/artifact-http-client.test.ts +++ b/packages/artifact/__tests__/artifact-http-client.test.ts @@ -4,6 +4,7 @@ import {HttpClient} from '@actions/http-client' import * as config from '../src/internal/shared/config' import {internalArtifactTwirpClient} from '../src/internal/shared/artifact-twirp-client' import {noopLogs} from './common' +import {NetworkError, UsageError} from '../src/internal/shared/errors' jest.mock('@actions/http-client') @@ -257,9 +258,42 @@ describe('artifact-http-client', () => { name: 'artifact', version: 4 }) - }).rejects.toThrowError( - 'Failed to CreateArtifact: Unable to make request: ENOTFOUND\nIf you are using self-hosted runners, please make sure your runner has access to all GitHub endpoints: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#communication-between-self-hosted-runners-and-github' - ) + }).rejects.toThrowError(new NetworkError('ENOTFOUND').message) + expect(mockHttpClient).toHaveBeenCalledTimes(1) + expect(mockPost).toHaveBeenCalledTimes(1) + }) + + it('should properly describe a usage error', async () => { + const mockPost = jest.fn(() => { + const msgFailed = new http.IncomingMessage(new net.Socket()) + msgFailed.statusCode = 403 + msgFailed.statusMessage = 'Forbidden' + return { + message: msgFailed, + readBody: async () => { + return Promise.resolve( + `{"msg": "insufficient usage to create artifact"}` + ) + } + } + }) + + const mockHttpClient = ( + HttpClient as unknown as jest.Mock + ).mockImplementation(() => { + return { + post: mockPost + } + }) + const client = internalArtifactTwirpClient() + await expect(async () => { + await client.CreateArtifact({ + workflowRunBackendId: '1234', + workflowJobRunBackendId: '5678', + name: 'artifact', + version: 4 + }) + }).rejects.toThrowError(new UsageError().message) expect(mockHttpClient).toHaveBeenCalledTimes(1) expect(mockPost).toHaveBeenCalledTimes(1) }) diff --git a/packages/artifact/src/internal/shared/artifact-twirp-client.ts b/packages/artifact/src/internal/shared/artifact-twirp-client.ts index be26c648..1f987a1a 100644 --- a/packages/artifact/src/internal/shared/artifact-twirp-client.ts +++ b/packages/artifact/src/internal/shared/artifact-twirp-client.ts @@ -4,7 +4,7 @@ import {info, debug} from '@actions/core' import {ArtifactServiceClientJSON} from '../../generated' import {getResultsServiceUrl, getRuntimeToken} from './config' import {getUserAgentString} from './user-agent' -import {NetworkError} from './errors' +import {NetworkError, UsageError} from './errors' // The twirp http client must implement this interface interface Rpc { @@ -64,7 +64,7 @@ class ArtifactHttpClient implements Rpc { this.httpClient.post(url, JSON.stringify(data), headers) ) - return JSON.parse(body) + return body } catch (error) { throw new Error(`Failed to ${method}: ${error.message}`) } @@ -72,34 +72,49 @@ class ArtifactHttpClient implements Rpc { async retryableRequest( operation: () => Promise - ): Promise<{response: HttpClientResponse; body: string}> { + ): Promise<{response: HttpClientResponse; body: object}> { let attempt = 0 let errorMessage = '' + let rawBody = '' while (attempt < this.maxAttempts) { let isRetryable = false try { const response = await operation() const statusCode = response.message.statusCode - const body = await response.readBody() + rawBody = await response.readBody() debug(`[Response] - ${response.message.statusCode}`) debug(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`) - debug(`Body: ${body}`) + const body = JSON.parse(rawBody) + debug(`Body: ${JSON.stringify(body, null, 2)}`) if (this.isSuccessStatusCode(statusCode)) { return {response, body} } isRetryable = this.isRetryableHttpStatusCode(statusCode) errorMessage = `Failed request: (${statusCode}) ${response.message.statusMessage}` - const responseMessage = JSON.parse(body).msg - if (responseMessage) { - errorMessage = `${errorMessage}: ${responseMessage}` + if (body.msg) { + if (UsageError.isUsageErrorMessage(body.msg)) { + throw new UsageError() + } + + errorMessage = `${errorMessage}: ${body.msg}` } } catch (error) { - isRetryable = true - errorMessage = error.message + if (error instanceof SyntaxError) { + debug(`Raw Body: ${rawBody}`) + throw error + } + + if (error instanceof UsageError) { + throw error + } + if (NetworkError.isNetworkErrorCode(error?.code)) { throw new NetworkError(error?.code) } + + isRetryable = true + errorMessage = error.message } if (!isRetryable) { diff --git a/packages/artifact/src/internal/shared/errors.ts b/packages/artifact/src/internal/shared/errors.ts index 4f23ecd3..1ceb5c66 100644 --- a/packages/artifact/src/internal/shared/errors.ts +++ b/packages/artifact/src/internal/shared/errors.ts @@ -57,3 +57,16 @@ export class NetworkError extends Error { ].includes(code) } } + +export class UsageError extends Error { + constructor() { + const message = `Artifact storage quota has been hit. Unable to upload any new artifacts. Usage is recalculated every 6-12 hours.\nMore info on storage limits: https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#calculating-minute-and-storage-spending` + super(message) + this.name = 'UsageError' + } + + static isUsageErrorMessage = (msg?: string): boolean => { + if (!msg) return false + return msg.includes('insufficient usage') + } +} From 6a9034d6925f26109ff8883900ab3512366b624f Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 13 Dec 2023 12:19:14 -0500 Subject: [PATCH 062/198] update artifact workflow tests --- .github/workflows/artifact-tests.yml | 102 ++++++++++++++++++--------- 1 file changed, 69 insertions(+), 33 deletions(-) diff --git a/.github/workflows/artifact-tests.yml b/.github/workflows/artifact-tests.yml index 4c7c6ab6..aa0ab371 100644 --- a/.github/workflows/artifact-tests.yml +++ b/.github/workflows/artifact-tests.yml @@ -1,5 +1,3 @@ -# Temporarily disabled while v2.0.0 of @actions/artifact is under development - name: artifact-unit-tests on: push: @@ -12,8 +10,8 @@ on: - '**.md' jobs: - build: - name: Build + upload: + name: Upload strategy: matrix: @@ -42,19 +40,13 @@ jobs: npm run tsc working-directory: packages/artifact - - name: Set artifact file contents - shell: bash - run: | - echo "file1=hello from file 1" >> $GITHUB_ENV - echo "file2=hello from file 2" >> $GITHUB_ENV - - name: Create files that will be uploaded run: | mkdir artifact-path - echo '${{ env.file1 }}' > artifact-path/first.txt - echo '${{ env.file2 }}' > artifact-path/second.txt + echo -n 'hello from file 1' > artifact-path/first.txt + echo -n 'hello from file 2' > artifact-path/second.txt - - name: Upload Artifacts using actions/github-script@v7 + - name: Upload Artifacts uses: actions/github-script@v7 with: script: | @@ -73,9 +65,16 @@ jobs: console.log(`Successfully uploaded artifact ${id}`) + try { + await artifact.uploadArtifact(artifactName, fileContents, './') + throw new Error('should have failed second upload') + } catch (err) { + console.log('Successfully blocked second artifact upload') + } verify: + name: Verify runs-on: ubuntu-latest - needs: [build] + needs: [upload] steps: - name: Checkout uses: actions/checkout@v4 @@ -96,35 +95,72 @@ jobs: npm run tsc working-directory: packages/artifact - - name: List artifacts using actions/github-script@v7 + - name: List and Download Artifacts uses: actions/github-script@v7 with: script: | - const {default: artifact} = require('./packages/artifact/lib/artifact') + const {default: artifactClient} = require('./packages/artifact/lib/artifact') - const workflowRunId = process.env.GITHUB_RUN_ID - const repository = process.env.GITHUB_REPOSITORY - const repositoryOwner = repository.split('/')[0] - const repositoryName = repository.split('/')[1] + const {readFile} = require('fs/promises') + const path = require('path') - const listResult = await artifact.listArtifacts(workflowRunId, repositoryOwner, repositoryName, '${{ secrets.GITHUB_TOKEN }}') + const findBy = { + repositoryOwner: process.env.GITHUB_REPOSITORY.split('/')[0], + repositoryName: process.env.GITHUB_REPOSITORY.split('/')[1], + token: '${{ secrets.GITHUB_TOKEN }}', + workflowRunId: process.env.GITHUB_RUN_ID + } + + const listResult = await artifactClient.listArtifacts({latest: true, findBy}) console.log(listResult) const artifacts = listResult.artifacts + const expected = [ + 'my-artifact-ubuntu-latest', + 'my-artifact-windows-latest', + 'my-artifact-macos-latest' + ] - if (artifacts.length !== 3) { - throw new Error('Expected 3 artifacts but only found ' + artifacts.length + ' artifacts') - } + const foundArtifacts = artifacts.filter(artifact => + expected.includes(artifact.name) + ) - const artifactNames = artifacts.map(artifact => artifact.name) - if (!artifactNames.includes('my-artifact-ubuntu-latest')){ - throw new Error("Expected artifact list to contain an artifact named my-artifact-ubuntu-latest but it's missing") - } - if (!artifactNames.includes('my-artifact-windows-latest')){ - throw new Error("Expected artifact list to contain an artifact named my-artifact-windows-latest but it's missing") - } - if (!artifactNames.includes('my-artifact-macos-latest')){ - throw new Error("Expected artifact list to contain an artifact named my-artifact-macos-latest but it's missing") + if (foundArtifacts.length !== 3) { + console.log('Unexpected length of found artifacts', foundArtifacts) + throw new Error( + `Expected 3 artifacts but found ${foundArtifacts.length} artifacts.` + ) } console.log('Successfully listed artifacts that were uploaded') + + const files = [ + {name: 'artifact-path/first.txt', content: 'hello from file 1'}, + {name: 'artifact-path/second.txt', content: 'hello from file 2'} + ] + + for (const artifact of foundArtifacts) { + const {downloadPath} = await artifactClient.downloadArtifact(artifact.id, { + path: artifact.name, + findBy + }) + + console.log('Downloaded artifact to:', downloadPath) + + for (const file of files) { + const filepath = path.join( + process.env.GITHUB_WORKSPACE, + downloadPath, + file.name + ) + + console.log('Checking file:', filepath) + + const content = await readFile(filepath, 'utf8') + if (content.trim() !== file.content.trim()) { + throw new Error( + `Expected file '${file.name}' to contain '${file.content}' but found '${content}'` + ) + } + } + } From 11a2dd3117d07bec18494a428098ea25aaead547 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Thu, 14 Dec 2023 15:38:49 -0500 Subject: [PATCH 063/198] update artifact module quick start --- packages/artifact/README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/artifact/README.md b/packages/artifact/README.md index d03dfc24..ac7d03dd 100644 --- a/packages/artifact/README.md +++ b/packages/artifact/README.md @@ -63,10 +63,16 @@ Import the module: ```js // ES6 module -import artifact from '@actions/artifact' +import {DefaultArtifactClient} from '@actions/artifact' // CommonJS -const {default: artifact} = require('@actions/artifact') +const {DefaultArtifactClient} = require('@actions/artifact') +``` + +Then instantiate: + +```js +const artifact = new DefaultArtifactClient() ``` ℹ️ For a comprehensive list of classes, interfaces, functions and more, see the [generated documentation](./docs/generated/README.md). From 571bf222ee54f2a9d46a7702cd83aedfbdfb2f02 Mon Sep 17 00:00:00 2001 From: srryan Date: Mon, 18 Dec 2023 17:11:14 -0500 Subject: [PATCH 064/198] update to use blob client over http client --- .../src/internal/download/download-artifact.ts | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index a61e2937..00e13853 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -17,6 +17,8 @@ import { } from '../../generated' import {getBackendIdsFromToken} from '../shared/util' import {ArtifactNotFoundError} from '../shared/errors' +import {BlobClient, } from '@azure/storage-blob' + const scrubQueryParameters = (url: string): string => { const parsed = new URL(url) @@ -38,18 +40,11 @@ async function exists(path: string): Promise { } async function streamExtract(url: string, directory: string): Promise { - const client = new httpClient.HttpClient(getUserAgentString()) - const response = await client.get(url) - - if (response.message.statusCode !== 200) { - throw new Error( - `Unexpected HTTP response from blob storage: ${response.message.statusCode} ${response.message.statusMessage}` - ) - } - + const blobClient = new BlobClient(url) + const response = await blobClient.download() + return new Promise((resolve, reject) => { - response.message - .pipe(unzip.Extract({path: directory})) + response.readableStreamBody?.pipe(unzip.Extract({path: directory})) .on('close', resolve) .on('error', reject) }) From 0c0770ce572bccd22a1cc9579dd0dff0eb2904bb Mon Sep 17 00:00:00 2001 From: srryan Date: Mon, 18 Dec 2023 17:52:55 -0500 Subject: [PATCH 065/198] cleanup --- packages/artifact/src/internal/download/download-artifact.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 00e13853..d4900c92 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -17,7 +17,7 @@ import { } from '../../generated' import {getBackendIdsFromToken} from '../shared/util' import {ArtifactNotFoundError} from '../shared/errors' -import {BlobClient, } from '@azure/storage-blob' +import {BlobClient} from '@azure/storage-blob' const scrubQueryParameters = (url: string): string => { From bf93b54558064d6af5c024299b75e8f7ad2c7704 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Mon, 18 Dec 2023 23:09:10 +0000 Subject: [PATCH 066/198] adding logger for blob client and response --- packages/artifact/package-lock.json | 237 +++++++++++++++++- packages/artifact/package.json | 3 +- .../internal/download/download-artifact.ts | 12 +- 3 files changed, 245 insertions(+), 7 deletions(-) diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index abe007be..aa86d4d9 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -22,7 +22,8 @@ "crypto": "^1.0.1", "jwt-decode": "^3.1.2", "twirp-ts": "^2.5.0", - "unzip-stream": "^0.3.1" + "unzip-stream": "^0.3.1", + "util": "^0.12.5" }, "devDependencies": { "@types/archiver": "^5.3.2", @@ -560,6 +561,17 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, + "node_modules/available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -664,6 +676,19 @@ "node": ">=0.2.0" } }, + "node_modules/call-bind": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", + "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", + "dependencies": { + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.1", + "set-function-length": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/camel-case": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", @@ -756,6 +781,19 @@ "integrity": "sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==", "deprecated": "This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in." }, + "node_modules/define-data-property": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", + "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", + "dependencies": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -797,6 +835,14 @@ "node": ">=0.8.x" } }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dependencies": { + "is-callable": "^1.1.3" + } + }, "node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -820,6 +866,28 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", + "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", + "dependencies": { + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -839,6 +907,17 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -865,6 +944,64 @@ "uglify-js": "^3.1.4" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", + "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", + "dependencies": { + "get-intrinsic": "^1.2.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -898,6 +1035,46 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "node_modules/is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-plain-object": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", @@ -906,6 +1083,20 @@ "node": ">=0.10.0" } }, + "node_modules/is-typed-array": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", + "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", + "dependencies": { + "which-typed-array": "^1.1.11" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -1228,6 +1419,20 @@ "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, + "node_modules/set-function-length": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", + "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", + "dependencies": { + "define-data-property": "^1.1.1", + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/shiki": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.5.tgz", @@ -1432,6 +1637,18 @@ "mkdirp": "^0.5.1" } }, + "node_modules/util": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "dependencies": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -1471,6 +1688,24 @@ "webidl-conversions": "^3.0.0" } }, + "node_modules/which-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.13.tgz", + "integrity": "sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==", + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.4", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", diff --git a/packages/artifact/package.json b/packages/artifact/package.json index c4f826c6..6cdde611 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -53,7 +53,8 @@ "crypto": "^1.0.1", "jwt-decode": "^3.1.2", "twirp-ts": "^2.5.0", - "unzip-stream": "^0.3.1" + "unzip-stream": "^0.3.1", + "util": "^0.12.5" }, "devDependencies": { "@types/archiver": "^5.3.2", diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index d4900c92..7b67454d 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -1,13 +1,14 @@ import fs from 'fs/promises' import * as github from '@actions/github' import * as core from '@actions/core' -import * as httpClient from '@actions/http-client' +// import * as httpClient from '@actions/http-client' +import * as util from 'util' import unzip from 'unzip-stream' import { DownloadArtifactOptions, DownloadArtifactResponse } from '../shared/interfaces' -import {getUserAgentString} from '../shared/user-agent' +// import {getUserAgentString} from '../shared/user-agent' import {getGitHubWorkspaceDir} from '../shared/config' import {internalArtifactTwirpClient} from '../shared/artifact-twirp-client' import { @@ -19,7 +20,6 @@ import {getBackendIdsFromToken} from '../shared/util' import {ArtifactNotFoundError} from '../shared/errors' import {BlobClient} from '@azure/storage-blob' - const scrubQueryParameters = (url: string): string => { const parsed = new URL(url) parsed.search = '' @@ -42,9 +42,11 @@ async function exists(path: string): Promise { async function streamExtract(url: string, directory: string): Promise { const blobClient = new BlobClient(url) const response = await blobClient.download() - + core.info(util.inspect(blobClient)) + core.info(util.inspect(response)) return new Promise((resolve, reject) => { - response.readableStreamBody?.pipe(unzip.Extract({path: directory})) + response.readableStreamBody + ?.pipe(unzip.Extract({path: directory})) .on('close', resolve) .on('error', reject) }) From 73babeabefd68ff5bd922a4507d757c0b80d2a3d Mon Sep 17 00:00:00 2001 From: srryan Date: Tue, 19 Dec 2023 11:49:39 -0500 Subject: [PATCH 067/198] add explicit options --- .../src/internal/download/download-artifact.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 7b67454d..443eb47b 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -18,7 +18,7 @@ import { } from '../../generated' import {getBackendIdsFromToken} from '../shared/util' import {ArtifactNotFoundError} from '../shared/errors' -import {BlobClient} from '@azure/storage-blob' +import {BlobClient, BlobDownloadOptions} from '@azure/storage-blob' const scrubQueryParameters = (url: string): string => { const parsed = new URL(url) @@ -41,14 +41,20 @@ async function exists(path: string): Promise { async function streamExtract(url: string, directory: string): Promise { const blobClient = new BlobClient(url) - const response = await blobClient.download() - core.info(util.inspect(blobClient)) - core.info(util.inspect(response)) + const options: BlobDownloadOptions = { + maxRetryRequests: 3, + abortSignal: undefined, + onProgress: (progress) => core.debug(`Download progress: ${progress.loadedBytes}`) + } + + const response = await blobClient.download(0, 0, options) + return new Promise((resolve, reject) => { response.readableStreamBody ?.pipe(unzip.Extract({path: directory})) .on('close', resolve) .on('error', reject) + .on('aborted', reject) }) } From c119fcd773dc830a2310599e790da7efc4364749 Mon Sep 17 00:00:00 2001 From: srryan Date: Tue, 19 Dec 2023 12:02:10 -0500 Subject: [PATCH 068/198] update optional settings for blob client --- .../artifact/src/internal/download/download-artifact.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 443eb47b..bc64d51d 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -42,12 +42,11 @@ async function exists(path: string): Promise { async function streamExtract(url: string, directory: string): Promise { const blobClient = new BlobClient(url) const options: BlobDownloadOptions = { - maxRetryRequests: 3, - abortSignal: undefined, - onProgress: (progress) => core.debug(`Download progress: ${progress.loadedBytes}`) + maxRetryRequests: 5, + onProgress: (progress) => core.info(`Download bytes ${progress.loadedBytes}`) } - const response = await blobClient.download(0, 0, options) + const response = await blobClient.download(0, undefined, options) return new Promise((resolve, reject) => { response.readableStreamBody From 78ed49ff8807a9c7aee2376c68719f799afbeb6b Mon Sep 17 00:00:00 2001 From: srryan Date: Tue, 19 Dec 2023 12:46:58 -0500 Subject: [PATCH 069/198] update error handling abort --- .../artifact/src/internal/download/download-artifact.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index bc64d51d..6ff72a02 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -50,10 +50,11 @@ async function streamExtract(url: string, directory: string): Promise { return new Promise((resolve, reject) => { response.readableStreamBody - ?.pipe(unzip.Extract({path: directory})) - .on('close', resolve) - .on('error', reject) + ?.on('error', reject) .on('aborted', reject) + .pipe(unzip.Extract({path: directory})) + .on('error', reject) + .on('close', resolve) }) } From bc68ce94eab9dc0d0626079de8f894cddcc4ec40 Mon Sep 17 00:00:00 2001 From: James Renaud <29545188+jamesrenaud@users.noreply.github.com> Date: Wed, 20 Dec 2023 03:12:17 -0500 Subject: [PATCH 070/198] chore(docs): add missing job summary documentation (#1574) Co-authored-by: Konrad Pabjan --- packages/core/README.md | 126 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) diff --git a/packages/core/README.md b/packages/core/README.md index 35bd72db..ac8ced92 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -358,3 +358,129 @@ const { version, // 10.0.22621 } = await platform.getDetails() ``` + +#### Populating job summary + +These methods can be used to populate a [job summary](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary). A job summary is a buffer that can be added to throughout your job via `core.summary` methods. + +Job summaries when complete must be written to the summary buffer file via the `core.summary.write()` method. + +All methods except `addRaw()` utilize the `addRaw()` method to append to the buffer, followed by an EOL using the `addEOL()` method. + +```typescript + +// Write raw text, optionally add an EOL after the content, defaults to false +core.summary.addRaw('Some content here :speech_balloon:', true) +// Output: Some content here :speech_balloon:\n + +// Add an operating system-specific end-of-line marker +core.summary.addEOL() +// Output (POSIX): \n +// Output (Windows): \r\n + +// Add a codeblock with an optional language for syntax highlighting +core.summary.addCodeBlock('console.log(\'hello world\')', 'javascript') +// Output:
console.log('hello world')
+ +// Add a list, second parameter indicates if list is ordered, defaults to false +core.summary.addList(['item1','item2','item3'], true) +// Output:
  1. item1
  2. item2
  3. item3
+ +// Add a collapsible HTML details element +core.summary.addDetails('Label', 'Some detail that will be collapsed') +// Output:
LabelSome detail that will be collapsed
+ +// Add an image, image options parameter is optional, you can supply one of or both width and height in pixels +core.summary.addImage('example.png', 'alt description of img', {width: '100', height: '100'}) +// Output: alt description of img + +// Add an HTML section heading element, optionally pass a level that translates to 'hX' ie. h2. Defaults to h1 +core.summary.addHeading('My Heading', '2') +// Output:

My Heading

+ +// Add an HTML thematic break
+core.summary.addSeparator() +// Output:
+ +// Add an HTML line break
+core.summary.addBreak() +// Output:
+ +// Add an HTML blockquote with an optional citation +core.summary.addQuote('To be or not to be', 'Shakespeare') +// Output:
To be or not to be
+ +// Add an HTML anchor tag +core.summary.addLink('click here', 'https://github.com') +// Output: click here + +``` + +Tables are added using the `addTable()` method, and an array of `SummaryTableRow`. + +```typescript + +export type SummaryTableRow = (SummaryTableCell | string)[] + +export interface SummaryTableCell { + /** + * Cell content + */ + data: string + /** + * Render cell as header + * (optional) default: false + */ + header?: boolean + /** + * Number of columns the cell extends + * (optional) default: '1' + */ + colspan?: string + /** + * Number of rows the cell extends + * (optional) default: '1' + */ + rowspan?: string +} + +``` + +For example + +```typescript + +const tableData = [ + {data: 'Header1', header: true}, + {data: 'Header2', header: true}, + {data: 'Header3', header: true}, + {data: 'MyData1'}, + {data: 'MyData2'}, + {data: 'MyData3'} +] + +// Add an HTML table +core.summary.addTable([tableData]) +// Output:
Header1Header2Header3
MyData1MyData2MyData3
+ +``` + +In addition to job summary content, there are utility functions for interfacing with the buffer. + +```typescript + +// Empties the summary buffer AND wipes the summary file on disk +core.summary.clear() + +// Returns the current summary buffer as a string +core.summary.stringify() + +// If the summary buffer is empty +core.summary.isEmptyBuffer() + +// Resets the summary buffer without writing to the summary file on disk +core.summary.emptyBuffer() + +// Writes text in the buffer to the summary buffer file and empties the buffer, optionally overwriting all existing content in the summary file with buffer contents. Defaults to false. +core.summary.write({overwrite: true}) +``` \ No newline at end of file From 5430c5d84832076372990c7c27f900878ff66dc9 Mon Sep 17 00:00:00 2001 From: Yukai Chou Date: Wed, 20 Dec 2023 16:16:52 +0800 Subject: [PATCH 071/198] fix typo (#1611) --- packages/artifact/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/README.md b/packages/artifact/README.md index ac7d03dd..1e03ecdf 100644 --- a/packages/artifact/README.md +++ b/packages/artifact/README.md @@ -19,7 +19,7 @@ This is the core library that powers the [`@actions/upload-artifact`](https://gi ## v2 - What's New > [!IMPORTANT] -> @actions/artifact v2+, upload-artifact@v4+ download-artifact@v4+ are not currently supported on GHES yet. The previous version of this package can be found at [this tag](https://github.com/actions/toolkit/tree/@actions/artifact@1.1.2/packages/artifact) and [on npm](https://www.npmjs.com/package/@actions/artifact/v/1.1.2). +> @actions/artifact v2+, upload-artifact@v4+, and download-artifact@v4+ are not currently supported on GHES yet. The previous version of this package can be found at [this tag](https://github.com/actions/toolkit/tree/@actions/artifact@1.1.2/packages/artifact) and [on npm](https://www.npmjs.com/package/@actions/artifact/v/1.1.2). The release of `@actions/artifact@v2` (including `upload-artifact@v4` and `download-artifact@v4`) are major changes to the backend architecture of Artifacts. They have numerous performance and behavioral improvements. From 2d6ba67518bb8d4a1a0974a591804b3457bd5eae Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 20 Dec 2023 13:11:04 -0500 Subject: [PATCH 072/198] retry the promise --- packages/artifact/package-lock.json | 237 +----------------- packages/artifact/package.json | 3 +- .../internal/download/download-artifact.ts | 48 ++-- 3 files changed, 35 insertions(+), 253 deletions(-) diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index aa86d4d9..abe007be 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -22,8 +22,7 @@ "crypto": "^1.0.1", "jwt-decode": "^3.1.2", "twirp-ts": "^2.5.0", - "unzip-stream": "^0.3.1", - "util": "^0.12.5" + "unzip-stream": "^0.3.1" }, "devDependencies": { "@types/archiver": "^5.3.2", @@ -561,17 +560,6 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, - "node_modules/available-typed-arrays": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -676,19 +664,6 @@ "node": ">=0.2.0" } }, - "node_modules/call-bind": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", - "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", - "dependencies": { - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.1", - "set-function-length": "^1.1.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/camel-case": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", @@ -781,19 +756,6 @@ "integrity": "sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==", "deprecated": "This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in." }, - "node_modules/define-data-property": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", - "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", - "dependencies": { - "get-intrinsic": "^1.2.1", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -835,14 +797,6 @@ "node": ">=0.8.x" } }, - "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dependencies": { - "is-callable": "^1.1.3" - } - }, "node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -866,28 +820,6 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", - "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", - "dependencies": { - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -907,17 +839,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dependencies": { - "get-intrinsic": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -944,64 +865,6 @@ "uglify-js": "^3.1.4" } }, - "node_modules/has-property-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", - "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", - "dependencies": { - "get-intrinsic": "^1.2.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "dependencies": { - "has-symbols": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", - "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -1035,46 +898,6 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "node_modules/is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-generator-function": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", - "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-plain-object": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", @@ -1083,20 +906,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-typed-array": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", - "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", - "dependencies": { - "which-typed-array": "^1.1.11" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -1419,20 +1228,6 @@ "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, - "node_modules/set-function-length": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", - "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", - "dependencies": { - "define-data-property": "^1.1.1", - "get-intrinsic": "^1.2.1", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/shiki": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.5.tgz", @@ -1637,18 +1432,6 @@ "mkdirp": "^0.5.1" } }, - "node_modules/util": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", - "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", - "dependencies": { - "inherits": "^2.0.3", - "is-arguments": "^1.0.4", - "is-generator-function": "^1.0.7", - "is-typed-array": "^1.1.3", - "which-typed-array": "^1.1.2" - } - }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -1688,24 +1471,6 @@ "webidl-conversions": "^3.0.0" } }, - "node_modules/which-typed-array": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.13.tgz", - "integrity": "sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==", - "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.4", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", diff --git a/packages/artifact/package.json b/packages/artifact/package.json index 6cdde611..c4f826c6 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -53,8 +53,7 @@ "crypto": "^1.0.1", "jwt-decode": "^3.1.2", "twirp-ts": "^2.5.0", - "unzip-stream": "^0.3.1", - "util": "^0.12.5" + "unzip-stream": "^0.3.1" }, "devDependencies": { "@types/archiver": "^5.3.2", diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 6ff72a02..0bc4a508 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -1,14 +1,13 @@ import fs from 'fs/promises' import * as github from '@actions/github' import * as core from '@actions/core' -// import * as httpClient from '@actions/http-client' -import * as util from 'util' +import * as httpClient from '@actions/http-client' import unzip from 'unzip-stream' import { DownloadArtifactOptions, DownloadArtifactResponse } from '../shared/interfaces' -// import {getUserAgentString} from '../shared/user-agent' +import {getUserAgentString} from '../shared/user-agent' import {getGitHubWorkspaceDir} from '../shared/config' import {internalArtifactTwirpClient} from '../shared/artifact-twirp-client' import { @@ -18,7 +17,6 @@ import { } from '../../generated' import {getBackendIdsFromToken} from '../shared/util' import {ArtifactNotFoundError} from '../shared/errors' -import {BlobClient, BlobDownloadOptions} from '@azure/storage-blob' const scrubQueryParameters = (url: string): string => { const parsed = new URL(url) @@ -40,21 +38,41 @@ async function exists(path: string): Promise { } async function streamExtract(url: string, directory: string): Promise { - const blobClient = new BlobClient(url) - const options: BlobDownloadOptions = { - maxRetryRequests: 5, - onProgress: (progress) => core.info(`Download bytes ${progress.loadedBytes}`) + let retryCount = 0 + while (retryCount < 3) { + try { + await streamExtractInternal(url, directory) + return + } catch (error) { + retryCount++ + core.warning(`Failed to download artifact. Retrying...`) + } } - const response = await blobClient.download(0, undefined, options) + throw new Error(`Artifact download failed after ${retryCount} retries.`) +} + +async function streamExtractInternal( + url: string, + directory: string +): Promise { + const client = new httpClient.HttpClient(getUserAgentString()) + const response = await client.get(url) + + if (response.message.statusCode !== 200) { + throw new Error( + `Unexpected HTTP response from blob storage: ${response.message.statusCode} ${response.message.statusMessage}` + ) + } return new Promise((resolve, reject) => { - response.readableStreamBody - ?.on('error', reject) - .on('aborted', reject) - .pipe(unzip.Extract({path: directory})) - .on('error', reject) - .on('close', resolve) + const zipStream = unzip.Extract({path: directory}) + try { + response.message.pipe(zipStream).on('close', resolve).on('error', reject) + } catch (error) { + zipStream.end() + reject(error) + } }) } From 34a411f3c0f1f7386969a141589b5ececd628151 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 20 Dec 2023 13:59:31 -0500 Subject: [PATCH 073/198] add timeout in between data chunks --- .../internal/download/download-artifact.ts | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 0bc4a508..697a10c8 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -67,11 +67,30 @@ async function streamExtractInternal( return new Promise((resolve, reject) => { const zipStream = unzip.Extract({path: directory}) + + const timeout = 30 * 1000 + const timerFn = (): void => { + throw new Error(`Blob storage chunk did not respond in ${timeout}ms `) + } + let timer = setTimeout(timerFn, timeout) + try { - response.message.pipe(zipStream).on('close', resolve).on('error', reject) + response.message + .on('data', () => { + clearTimeout(timer) + timer = setTimeout(timerFn, timeout) + }) + .pipe(zipStream) + .on('close', () => { + clearTimeout(timer) + resolve() + }) + .on('error', reject) } catch (error) { zipStream.end() reject(error) + } finally { + clearTimeout(timer) } }) } From d6f3ee93b8e8f669a89200765442748bd7a08df2 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 20 Dec 2023 14:37:13 -0500 Subject: [PATCH 074/198] reject don't throw --- packages/artifact/src/internal/download/download-artifact.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 697a10c8..110375ab 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -70,7 +70,7 @@ async function streamExtractInternal( const timeout = 30 * 1000 const timerFn = (): void => { - throw new Error(`Blob storage chunk did not respond in ${timeout}ms `) + reject(new Error(`Blob storage chunk did not respond in ${timeout}ms `)) } let timer = setTimeout(timerFn, timeout) From c33724abbd6a193e7109d9c8afe087efa65d2b06 Mon Sep 17 00:00:00 2001 From: srryan Date: Wed, 20 Dec 2023 15:45:19 -0500 Subject: [PATCH 075/198] update to http client --- .../artifact/src/internal/download/download-artifact.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 110375ab..2caa92ab 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -39,13 +39,15 @@ async function exists(path: string): Promise { async function streamExtract(url: string, directory: string): Promise { let retryCount = 0 - while (retryCount < 3) { + while (retryCount < 5) { try { await streamExtractInternal(url, directory) return } catch (error) { retryCount++ - core.warning(`Failed to download artifact. Retrying...`) + core.warning(`Failed to download artifact. Retrying in 5 seconds...`) + // wait 5 seconds before retrying + await new Promise(resolve => setTimeout(resolve, 5000)) } } @@ -70,6 +72,7 @@ async function streamExtractInternal( const timeout = 30 * 1000 const timerFn = (): void => { + zipStream.end() reject(new Error(`Blob storage chunk did not respond in ${timeout}ms `)) } let timer = setTimeout(timerFn, timeout) @@ -82,6 +85,7 @@ async function streamExtractInternal( }) .pipe(zipStream) .on('close', () => { + core.debug(`zip stream: Artifact downloaded to: ${directory}`) clearTimeout(timer) resolve() }) From 03319fcffa358f46fb4dac52083e554d324f194d Mon Sep 17 00:00:00 2001 From: srryan Date: Wed, 20 Dec 2023 18:08:00 -0500 Subject: [PATCH 076/198] client fixes for retries + logging --- .../internal/download/download-artifact.ts | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 2caa92ab..101253bd 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -17,6 +17,7 @@ import { } from '../../generated' import {getBackendIdsFromToken} from '../shared/util' import {ArtifactNotFoundError} from '../shared/errors' +import { clear } from 'console' const scrubQueryParameters = (url: string): string => { const parsed = new URL(url) @@ -41,11 +42,12 @@ async function streamExtract(url: string, directory: string): Promise { let retryCount = 0 while (retryCount < 5) { try { - await streamExtractInternal(url, directory) - return + await streamExtractInternal(url, directory) + core.info(`Artifact downloaded successfully after ${retryCount} retries.`) + return } catch (error) { retryCount++ - core.warning(`Failed to download artifact. Retrying in 5 seconds...`) + core.warning(`Failed to download artifact after ${retryCount} retries due to ${error.message}. Retrying in 5 seconds...`) // wait 5 seconds before retrying await new Promise(resolve => setTimeout(resolve, 5000)) } @@ -54,10 +56,7 @@ async function streamExtract(url: string, directory: string): Promise { throw new Error(`Artifact download failed after ${retryCount} retries.`) } -async function streamExtractInternal( - url: string, - directory: string -): Promise { +async function streamExtractInternal(url: string,directory: string): Promise { const client = new httpClient.HttpClient(getUserAgentString()) const response = await client.get(url) @@ -67,35 +66,35 @@ async function streamExtractInternal( ) } - return new Promise((resolve, reject) => { - const zipStream = unzip.Extract({path: directory}) + const timeout = 30 * 1000 // 30 seconds - const timeout = 30 * 1000 + return new Promise((resolve, reject) => { const timerFn = (): void => { - zipStream.end() - reject(new Error(`Blob storage chunk did not respond in ${timeout}ms `)) + // close response stream + core.warning("timerFn: closing response stream") + response.message.destroy(new Error(`Blob storage chunk did not respond in ${timeout}ms`)) } let timer = setTimeout(timerFn, timeout) - try { - response.message - .on('data', () => { - clearTimeout(timer) - timer = setTimeout(timerFn, timeout) - }) - .pipe(zipStream) - .on('close', () => { - core.debug(`zip stream: Artifact downloaded to: ${directory}`) - clearTimeout(timer) - resolve() - }) - .on('error', reject) - } catch (error) { - zipStream.end() - reject(error) - } finally { - clearTimeout(timer) - } + response.message + .on('data', () => { + timer.refresh() + }) + .on('error', (error: Error) => { + core.warning(`response.message: Artifact download failed: ${error.message}`) + clearTimeout(timer) + reject(error) + }) + .pipe(unzip.Extract({path: directory})) + .on('close', () => { + core.info(`zip stream: Artifact downloaded to: ${directory}`) + clearTimeout(timer) + resolve() + }) + .on('error', (error: Error) => { + core.warning(`zip stream: Artifact download failed: ${error.message}`) + reject(error) + }) }) } @@ -193,6 +192,7 @@ export async function downloadArtifactInternal( core.info(`Starting download of artifact to: ${downloadPath}`) await streamExtract(signedUrl, downloadPath) core.info(`Artifact download completed successfully.`) + process.exit(0) } catch (error) { throw new Error(`Unable to download and extract artifact: ${error.message}`) } From ecb4df89bfb69eb5ddd27b2802e0263383c4ca9c Mon Sep 17 00:00:00 2001 From: srryan Date: Wed, 20 Dec 2023 18:23:47 -0500 Subject: [PATCH 077/198] remove the exit --- packages/artifact/src/internal/download/download-artifact.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 101253bd..b7698102 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -192,7 +192,6 @@ export async function downloadArtifactInternal( core.info(`Starting download of artifact to: ${downloadPath}`) await streamExtract(signedUrl, downloadPath) core.info(`Artifact download completed successfully.`) - process.exit(0) } catch (error) { throw new Error(`Unable to download and extract artifact: ${error.message}`) } From ff2c52461146fe3f983a215d2865cc101b410729 Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Thu, 21 Dec 2023 09:25:34 -0500 Subject: [PATCH 078/198] lint and format --- .../internal/download/download-artifact.ts | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index b7698102..38837642 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -17,7 +17,6 @@ import { } from '../../generated' import {getBackendIdsFromToken} from '../shared/util' import {ArtifactNotFoundError} from '../shared/errors' -import { clear } from 'console' const scrubQueryParameters = (url: string): string => { const parsed = new URL(url) @@ -42,12 +41,14 @@ async function streamExtract(url: string, directory: string): Promise { let retryCount = 0 while (retryCount < 5) { try { - await streamExtractInternal(url, directory) - core.info(`Artifact downloaded successfully after ${retryCount} retries.`) - return + await streamExtractInternal(url, directory) + core.info(`Artifact downloaded successfully after ${retryCount} retries.`) + return } catch (error) { retryCount++ - core.warning(`Failed to download artifact after ${retryCount} retries due to ${error.message}. Retrying in 5 seconds...`) + core.warning( + `Failed to download artifact after ${retryCount} retries due to ${error.message}. Retrying in 5 seconds...` + ) // wait 5 seconds before retrying await new Promise(resolve => setTimeout(resolve, 5000)) } @@ -56,7 +57,10 @@ async function streamExtract(url: string, directory: string): Promise { throw new Error(`Artifact download failed after ${retryCount} retries.`) } -async function streamExtractInternal(url: string,directory: string): Promise { +async function streamExtractInternal( + url: string, + directory: string +): Promise { const client = new httpClient.HttpClient(getUserAgentString()) const response = await client.get(url) @@ -71,17 +75,21 @@ async function streamExtractInternal(url: string,directory: string): Promise { const timerFn = (): void => { // close response stream - core.warning("timerFn: closing response stream") - response.message.destroy(new Error(`Blob storage chunk did not respond in ${timeout}ms`)) + core.warning('timerFn: closing response stream') + response.message.destroy( + new Error(`Blob storage chunk did not respond in ${timeout}ms`) + ) } - let timer = setTimeout(timerFn, timeout) + const timer = setTimeout(timerFn, timeout) response.message .on('data', () => { timer.refresh() }) .on('error', (error: Error) => { - core.warning(`response.message: Artifact download failed: ${error.message}`) + core.warning( + `response.message: Artifact download failed: ${error.message}` + ) clearTimeout(timer) reject(error) }) From f482643a6ef891a1dbf4f608eff4760ccd9dfc8f Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 21 Dec 2023 15:10:01 +0000 Subject: [PATCH 079/198] updating timeout for retries --- packages/artifact/__tests__/download-artifact.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index 815a760c..bc22c95a 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -290,7 +290,7 @@ describe('download-artifact', () => { expect(mockGetArtifactFailure).toHaveBeenCalledWith( fixtures.blobStorageUrl ) - }) + }, 28000) }) describe('internal', () => { From 0d399758140f3f628ccb53b4329718129bec964d Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 21 Dec 2023 18:31:01 +0000 Subject: [PATCH 080/198] updating test with blob timeouts --- .../__tests__/download-artifact.test.ts | 134 +++++++++++++++++- 1 file changed, 131 insertions(+), 3 deletions(-) diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index bc22c95a..37c1aa5e 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -12,7 +12,7 @@ import { downloadArtifactPublic } from '../src/internal/download/download-artifact' import {getUserAgentString} from '../src/internal/shared/user-agent' -import {noopLogs} from './common' +//import {noopLogs} from './common' import * as config from '../src/internal/shared/config' import {ArtifactServiceClientJSON} from '../src/generated' import * as util from '../src/internal/shared/util' @@ -87,7 +87,7 @@ const expectExtractedArchive = async (dir: string): Promise => { } const setup = async (): Promise => { - noopLogs() + //noopLogs() await fs.promises.mkdir(testDir, {recursive: true}) await createTestArchive() @@ -120,6 +120,32 @@ const mockGetArtifactFailure = jest.fn(() => { } }) +const mockDelayBlobResponse = jest.fn(async () => { + // await new Promise(r => setTimeout(r, 31000)) + const timeout = 31000 + const message = new http.IncomingMessage(new net.Socket()) + setTimeout(() => { + message.emit('data', 'test response') + setTimeout(() => { + message.statusCode = 200 + message.push('OK') + message.push(null) + }, timeout) + }, timeout) + // message + // .on('data', async () => { + // await new Promise(r => setTimeout(r, 31000)) + // }) + // .on('done', () => { + // message.statusCode = 200 + // message.push('OK') + // message.push(null) + // }) + return { + message + } +}) + describe('download-artifact', () => { describe('public', () => { beforeEach(setup) @@ -248,7 +274,56 @@ describe('download-artifact', () => { }) }) - it('should fail if blob storage response is non-200', async () => { + it('should fail if blob storage storage chunk does not respond within 30s', async () => { + // jest.useFakeTimers() + + const downloadArtifactMock = github.getOctokit(fixtures.token).rest + .actions.downloadArtifact as MockedDownloadArtifact + downloadArtifactMock.mockResolvedValueOnce({ + headers: { + location: fixtures.blobStorageUrl + }, + status: 302, + url: '', + data: Buffer.from('') + }) + const mockHttpClient = (HttpClient as jest.Mock).mockImplementation( + () => { + return { + get: mockDelayBlobResponse + } + } + ) + + await downloadArtifactPublic( + fixtures.artifactID, + fixtures.repositoryOwner, + fixtures.repositoryName, + fixtures.token + ) + + // jest.runAllTimers() + + expect(downloadArtifactMock).toHaveBeenCalledWith({ + owner: fixtures.repositoryOwner, + repo: fixtures.repositoryName, + artifact_id: fixtures.artifactID, + archive_format: 'zip', + request: { + redirect: 'manual' + } + }) + // expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) + await expect( + downloadArtifactPublic( + fixtures.artifactID, + fixtures.repositoryOwner, + fixtures.repositoryName, + fixtures.token + ) + ).rejects.toBeInstanceOf(Error) + }, 40000) + it('should fail if blob storage response is non-200 after 5 retries', async () => { const downloadArtifactMock = github.getOctokit(fixtures.token).rest .actions.downloadArtifact as MockedDownloadArtifact downloadArtifactMock.mockResolvedValueOnce({ @@ -290,6 +365,59 @@ describe('download-artifact', () => { expect(mockGetArtifactFailure).toHaveBeenCalledWith( fixtures.blobStorageUrl ) + expect(mockGetArtifactFailure).toHaveBeenCalledTimes(5) + }, 28000) + + it('should retry if blob storage response is non-200 and then succeed with a 200', async () => { + const downloadArtifactMock = github.getOctokit(fixtures.token).rest + .actions.downloadArtifact as MockedDownloadArtifact + downloadArtifactMock.mockResolvedValueOnce({ + headers: { + location: fixtures.blobStorageUrl + }, + status: 302, + url: '', + data: Buffer.from('') + }) + + const mockGetArtifact = jest + .fn(mockGetArtifactSuccess) + .mockImplementationOnce(mockGetArtifactFailure) + + const mockHttpClient = (HttpClient as jest.Mock).mockImplementation( + () => { + return { + get: mockGetArtifact + } + } + ) + + const response = await downloadArtifactPublic( + fixtures.artifactID, + fixtures.repositoryOwner, + fixtures.repositoryName, + fixtures.token + ) + + expect(downloadArtifactMock).toHaveBeenCalledWith({ + owner: fixtures.repositoryOwner, + repo: fixtures.repositoryName, + artifact_id: fixtures.artifactID, + archive_format: 'zip', + request: { + redirect: 'manual' + } + }) + expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) + expect(mockGetArtifactFailure).toHaveBeenCalledWith( + fixtures.blobStorageUrl + ) + expect(mockGetArtifactFailure).toHaveBeenCalledTimes(1) + expect(mockGetArtifactSuccess).toHaveBeenCalledWith( + fixtures.blobStorageUrl + ) + expect(mockGetArtifactSuccess).toHaveBeenCalledTimes(1) + expect(response.downloadPath).toBe(fixtures.workspaceDir) }, 28000) }) From 98e1a813dbc18a10ff203e344744cc71362c9303 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 21 Dec 2023 20:22:20 +0000 Subject: [PATCH 081/198] testing ci --- package.json | 2 +- .../__tests__/download-artifact.test.ts | 24 +++++++------------ 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 73a7093c..01566f9e 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "lint": "eslint packages/**/*.ts", "lint-fix": "eslint packages/**/*.ts --fix", "new-package": "scripts/create-package", - "test": "jest --testTimeout 10000" + "test": "jest --testTimeout 20000" }, "devDependencies": { "@types/jest": "^29.5.4", diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index 37c1aa5e..bd59dfd2 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -295,13 +295,14 @@ describe('download-artifact', () => { } ) - await downloadArtifactPublic( - fixtures.artifactID, - fixtures.repositoryOwner, - fixtures.repositoryName, - fixtures.token - ) - + await expect( + downloadArtifactPublic( + fixtures.artifactID, + fixtures.repositoryOwner, + fixtures.repositoryName, + fixtures.token + ) + ).rejects.toBeInstanceOf(Error) // jest.runAllTimers() expect(downloadArtifactMock).toHaveBeenCalledWith({ @@ -313,15 +314,6 @@ describe('download-artifact', () => { redirect: 'manual' } }) - // expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) - await expect( - downloadArtifactPublic( - fixtures.artifactID, - fixtures.repositoryOwner, - fixtures.repositoryName, - fixtures.token - ) - ).rejects.toBeInstanceOf(Error) }, 40000) it('should fail if blob storage response is non-200 after 5 retries', async () => { const downloadArtifactMock = github.getOctokit(fixtures.token).rest From 7f47ffaee2cf75b384649968529078a0a4d1d4ee Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Fri, 22 Dec 2023 03:51:47 +0000 Subject: [PATCH 082/198] committing v1 --- .../__tests__/download-artifact.test.ts | 84 +++++++++++++++---- .../internal/download/download-artifact.ts | 4 + 2 files changed, 73 insertions(+), 15 deletions(-) diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index bd59dfd2..f2a74f93 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -120,27 +120,42 @@ const mockGetArtifactFailure = jest.fn(() => { } }) -const mockDelayBlobResponse = jest.fn(async () => { - // await new Promise(r => setTimeout(r, 31000)) - const timeout = 31000 +const mockDelayWritableResponse = jest.fn(async () => { + //const message = new stream.PassThrough() const message = new http.IncomingMessage(new net.Socket()) + message.statusCode = 200 + message.push('Internal Server Error') + message.push(null) + setTimeout(() => { - message.emit('data', 'test response') + message.emit('error', () => {}) + }, 31000) + return { + message + } +}) +const mockDelayBlobResponse = jest.fn(async () => { + const message = new http.IncomingMessage(new net.Socket()) + message.on('data', () => { setTimeout(() => { message.statusCode = 200 message.push('OK') message.push(null) - }, timeout) - }, timeout) - // message - // .on('data', async () => { - // await new Promise(r => setTimeout(r, 31000)) - // }) - // .on('done', () => { + }, 31000) + }) + // setTimeout(() => { + // setTimeout(() => { // message.statusCode = 200 // message.push('OK') // message.push(null) - // }) + // }, 31000) + // message.emit('data') + // }, 31000) + // message.on('done', () => { + // message.statusCode = 200 + // message.push('OK') + // message.push(null) + // }) return { message } @@ -290,12 +305,18 @@ describe('download-artifact', () => { const mockHttpClient = (HttpClient as jest.Mock).mockImplementation( () => { return { - get: mockDelayBlobResponse + get: mockDelayWritableResponse } } ) + await downloadArtifactPublic( + fixtures.artifactID, + fixtures.repositoryOwner, + fixtures.repositoryName, + fixtures.token + ) - await expect( + expect( downloadArtifactPublic( fixtures.artifactID, fixtures.repositoryOwner, @@ -303,7 +324,6 @@ describe('download-artifact', () => { fixtures.token ) ).rejects.toBeInstanceOf(Error) - // jest.runAllTimers() expect(downloadArtifactMock).toHaveBeenCalledWith({ owner: fixtures.repositoryOwner, @@ -314,6 +334,40 @@ describe('download-artifact', () => { redirect: 'manual' } }) + expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) + expect(mockGetArtifactFailure).toHaveBeenCalledWith( + fixtures.blobStorageUrl + ) + expect(mockGetArtifactFailure).toHaveBeenCalledTimes(5) + // const mockHttpClient = (HttpClient as jest.Mock).mockImplementation( + // () => { + // return { + // get: mockDelayBlobResponse + // } + // } + // ) + + // expect(downloadArtifactMock).toHaveBeenCalledWith({ + // owner: fixtures.repositoryOwner, + // repo: fixtures.repositoryName, + // artifact_id: fixtures.artifactID, + // archive_format: 'zip', + // request: { + // redirect: 'manual' + // } + // }) + // expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) + // expect(mockGetArtifactFailure).toHaveBeenCalledWith( + // fixtures.blobStorageUrl + // ) + // await expect( + // downloadArtifactPublic( + // fixtures.artifactID, + // fixtures.repositoryOwner, + // fixtures.repositoryName, + // fixtures.token + // ) + // ).rejects.toBeInstanceOf(Error) }, 40000) it('should fail if blob storage response is non-200 after 5 retries', async () => { const downloadArtifactMock = github.getOctokit(fixtures.token).rest diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 38837642..a840ba85 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -38,6 +38,7 @@ async function exists(path: string): Promise { } async function streamExtract(url: string, directory: string): Promise { + core.info(`Stream extract started`) let retryCount = 0 while (retryCount < 5) { try { @@ -61,8 +62,11 @@ async function streamExtractInternal( url: string, directory: string ): Promise { + core.info(`Stream extract internal started`) + const client = new httpClient.HttpClient(getUserAgentString()) const response = await client.get(url) + core.info(`Stream extract internal get called`) if (response.message.statusCode !== 200) { throw new Error( From 9d70b8a9fb0439f8ba921a7a8df09877428cd084 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Mon, 8 Jan 2024 15:20:05 +0000 Subject: [PATCH 083/198] testing reject after timeout --- .../__tests__/download-artifact.test.ts | 79 +++++++------------ 1 file changed, 28 insertions(+), 51 deletions(-) diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index f2a74f93..7a48029b 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -309,65 +309,42 @@ describe('download-artifact', () => { } } ) - await downloadArtifactPublic( - fixtures.artifactID, - fixtures.repositoryOwner, - fixtures.repositoryName, - fixtures.token - ) - expect( - downloadArtifactPublic( + try { + await downloadArtifactPublic( fixtures.artifactID, fixtures.repositoryOwner, fixtures.repositoryName, fixtures.token ) - ).rejects.toBeInstanceOf(Error) - expect(downloadArtifactMock).toHaveBeenCalledWith({ - owner: fixtures.repositoryOwner, - repo: fixtures.repositoryName, - artifact_id: fixtures.artifactID, - archive_format: 'zip', - request: { - redirect: 'manual' - } - }) - expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) - expect(mockGetArtifactFailure).toHaveBeenCalledWith( - fixtures.blobStorageUrl - ) - expect(mockGetArtifactFailure).toHaveBeenCalledTimes(5) - // const mockHttpClient = (HttpClient as jest.Mock).mockImplementation( - // () => { - // return { - // get: mockDelayBlobResponse - // } - // } - // ) + expect( + downloadArtifactPublic( + fixtures.artifactID, + fixtures.repositoryOwner, + fixtures.repositoryName, + fixtures.token + ) + ).rejects.toBeInstanceOf(Error) - // expect(downloadArtifactMock).toHaveBeenCalledWith({ - // owner: fixtures.repositoryOwner, - // repo: fixtures.repositoryName, - // artifact_id: fixtures.artifactID, - // archive_format: 'zip', - // request: { - // redirect: 'manual' - // } - // }) - // expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) - // expect(mockGetArtifactFailure).toHaveBeenCalledWith( - // fixtures.blobStorageUrl - // ) - // await expect( - // downloadArtifactPublic( - // fixtures.artifactID, - // fixtures.repositoryOwner, - // fixtures.repositoryName, - // fixtures.token - // ) - // ).rejects.toBeInstanceOf(Error) + expect(downloadArtifactMock).toHaveBeenCalledWith({ + owner: fixtures.repositoryOwner, + repo: fixtures.repositoryName, + artifact_id: fixtures.artifactID, + archive_format: 'zip', + request: { + redirect: 'manual' + } + }) + expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) + expect(mockGetArtifactFailure).toHaveBeenCalledWith( + fixtures.blobStorageUrl + ) + expect(mockGetArtifactFailure).toHaveBeenCalledTimes(5) + } catch (err) { + // eslint-disable-next-line no-console + console.log(err) + } }, 40000) it('should fail if blob storage response is non-200 after 5 retries', async () => { const downloadArtifactMock = github.getOctokit(fixtures.token).rest From 67d2d582dcaae5549aab57d5bb7a5c6c128d4300 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Jan 2024 16:44:12 +0000 Subject: [PATCH 084/198] adding delayed response to message body http mock --- .../__tests__/download-artifact.test.ts | 115 +++++------------- .../internal/download/download-artifact.ts | 4 +- 2 files changed, 30 insertions(+), 89 deletions(-) diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index 7a48029b..970d1fdd 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -9,7 +9,8 @@ import archiver from 'archiver' import { downloadArtifactInternal, - downloadArtifactPublic + downloadArtifactPublic, + streamExtractExternal } from '../src/internal/download/download-artifact' import {getUserAgentString} from '../src/internal/shared/user-agent' //import {noopLogs} from './common' @@ -120,47 +121,6 @@ const mockGetArtifactFailure = jest.fn(() => { } }) -const mockDelayWritableResponse = jest.fn(async () => { - //const message = new stream.PassThrough() - const message = new http.IncomingMessage(new net.Socket()) - message.statusCode = 200 - message.push('Internal Server Error') - message.push(null) - - setTimeout(() => { - message.emit('error', () => {}) - }, 31000) - return { - message - } -}) -const mockDelayBlobResponse = jest.fn(async () => { - const message = new http.IncomingMessage(new net.Socket()) - message.on('data', () => { - setTimeout(() => { - message.statusCode = 200 - message.push('OK') - message.push(null) - }, 31000) - }) - // setTimeout(() => { - // setTimeout(() => { - // message.statusCode = 200 - // message.push('OK') - // message.push(null) - // }, 31000) - // message.emit('data') - // }, 31000) - // message.on('done', () => { - // message.statusCode = 200 - // message.push('OK') - // message.push(null) - // }) - return { - message - } -}) - describe('download-artifact', () => { describe('public', () => { beforeEach(setup) @@ -290,62 +250,43 @@ describe('download-artifact', () => { }) it('should fail if blob storage storage chunk does not respond within 30s', async () => { - // jest.useFakeTimers() + // mock http client to delay response data by 30s + // + const msg = new http.IncomingMessage(new net.Socket()) + msg.statusCode = 200 - const downloadArtifactMock = github.getOctokit(fixtures.token).rest - .actions.downloadArtifact as MockedDownloadArtifact - downloadArtifactMock.mockResolvedValueOnce({ - headers: { - location: fixtures.blobStorageUrl - }, - status: 302, - url: '', - data: Buffer.from('') + const mockGet = jest.fn(async () => { + return new Promise((resolve, reject) => { + // Resolve with a 200 status code immediately + resolve({ + message: msg, + readBody: async () => { + return Promise.resolve(`{"ok": true}`) + } + }) + + // Reject with an error after 31 seconds + setTimeout(() => { + reject(new Error('Request timeout')) + }, 31000) // Timeout after 31 seconds + }) }) + const mockHttpClient = (HttpClient as jest.Mock).mockImplementation( () => { return { - get: mockDelayWritableResponse + get: mockGet } } ) - try { - await downloadArtifactPublic( - fixtures.artifactID, - fixtures.repositoryOwner, - fixtures.repositoryName, - fixtures.token - ) + await expect( + streamExtractExternal(fixtures.blobStorageUrl, fixtures.workspaceDir) + ).rejects.toBeInstanceOf(Error) - expect( - downloadArtifactPublic( - fixtures.artifactID, - fixtures.repositoryOwner, - fixtures.repositoryName, - fixtures.token - ) - ).rejects.toBeInstanceOf(Error) + expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) + }, 35000) - expect(downloadArtifactMock).toHaveBeenCalledWith({ - owner: fixtures.repositoryOwner, - repo: fixtures.repositoryName, - artifact_id: fixtures.artifactID, - archive_format: 'zip', - request: { - redirect: 'manual' - } - }) - expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) - expect(mockGetArtifactFailure).toHaveBeenCalledWith( - fixtures.blobStorageUrl - ) - expect(mockGetArtifactFailure).toHaveBeenCalledTimes(5) - } catch (err) { - // eslint-disable-next-line no-console - console.log(err) - } - }, 40000) it('should fail if blob storage response is non-200 after 5 retries', async () => { const downloadArtifactMock = github.getOctokit(fixtures.token).rest .actions.downloadArtifact as MockedDownloadArtifact diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index a840ba85..42dfa1cf 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -42,7 +42,7 @@ async function streamExtract(url: string, directory: string): Promise { let retryCount = 0 while (retryCount < 5) { try { - await streamExtractInternal(url, directory) + await streamExtractExternal(url, directory) core.info(`Artifact downloaded successfully after ${retryCount} retries.`) return } catch (error) { @@ -58,7 +58,7 @@ async function streamExtract(url: string, directory: string): Promise { throw new Error(`Artifact download failed after ${retryCount} retries.`) } -async function streamExtractInternal( +export async function streamExtractExternal( url: string, directory: string ): Promise { From d63a8c4d3f0f6321c6dd165d539c25eb3f379f87 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Jan 2024 17:13:35 +0000 Subject: [PATCH 085/198] updating package-json --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e72dedbd..1d43fbf3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5781,9 +5781,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "version": "1.15.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", + "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==", "dev": true, "funding": [ { From e19b629130ce52d2d14204d020e0e7c9d6ae6d48 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Jan 2024 18:45:26 +0000 Subject: [PATCH 086/198] increasing timeout --- packages/artifact/__tests__/download-artifact.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index 970d1fdd..cd1896aa 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -330,7 +330,7 @@ describe('download-artifact', () => { fixtures.blobStorageUrl ) expect(mockGetArtifactFailure).toHaveBeenCalledTimes(5) - }, 28000) + }, 38000) it('should retry if blob storage response is non-200 and then succeed with a 200', async () => { const downloadArtifactMock = github.getOctokit(fixtures.token).rest From 58ec2bdcc9b33da137f7c621395c2fb482e143cd Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Jan 2024 18:55:50 +0000 Subject: [PATCH 087/198] increase timeout --- jest.config.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jest.config.js b/jest.config.js index 101666d6..da496052 100644 --- a/jest.config.js +++ b/jest.config.js @@ -7,5 +7,6 @@ module.exports = { transform: { '^.+\\.ts$': 'ts-jest' }, - verbose: true -} \ No newline at end of file + verbose: true, + testTimeout: 70000 +} From 8a6aae0a1634c48dbc80571c55549095604e9d4e Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Jan 2024 19:03:41 +0000 Subject: [PATCH 088/198] updating global timeout --- jest.config.js | 3 +-- package.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/jest.config.js b/jest.config.js index da496052..105aae23 100644 --- a/jest.config.js +++ b/jest.config.js @@ -7,6 +7,5 @@ module.exports = { transform: { '^.+\\.ts$': 'ts-jest' }, - verbose: true, - testTimeout: 70000 + verbose: tru } diff --git a/package.json b/package.json index 01566f9e..886033c3 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "lint": "eslint packages/**/*.ts", "lint-fix": "eslint packages/**/*.ts --fix", "new-package": "scripts/create-package", - "test": "jest --testTimeout 20000" + "test": "jest --testTimeout 70000" }, "devDependencies": { "@types/jest": "^29.5.4", From 47157e5ade481cb731bda787ac1b842262da68bb Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Jan 2024 19:05:11 +0000 Subject: [PATCH 089/198] fixing true --- jest.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index 105aae23..f25dbdc9 100644 --- a/jest.config.js +++ b/jest.config.js @@ -7,5 +7,5 @@ module.exports = { transform: { '^.+\\.ts$': 'ts-jest' }, - verbose: tru + verbose: true } From d617670abc8cc06c5f6fd82c9f927d6198ded0d4 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Jan 2024 19:23:57 +0000 Subject: [PATCH 090/198] updating timer; removing logs --- package.json | 2 +- packages/artifact/__tests__/download-artifact.test.ts | 7 +++---- .../artifact/src/internal/download/download-artifact.ts | 6 +----- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 886033c3..ea3ac2ed 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "lint": "eslint packages/**/*.ts", "lint-fix": "eslint packages/**/*.ts --fix", "new-package": "scripts/create-package", - "test": "jest --testTimeout 70000" + "test": "jest --testTimeout 60000" }, "devDependencies": { "@types/jest": "^29.5.4", diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index cd1896aa..1c0c9b0d 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -13,7 +13,7 @@ import { streamExtractExternal } from '../src/internal/download/download-artifact' import {getUserAgentString} from '../src/internal/shared/user-agent' -//import {noopLogs} from './common' +import {noopLogs} from './common' import * as config from '../src/internal/shared/config' import {ArtifactServiceClientJSON} from '../src/generated' import * as util from '../src/internal/shared/util' @@ -88,7 +88,7 @@ const expectExtractedArchive = async (dir: string): Promise => { } const setup = async (): Promise => { - //noopLogs() + noopLogs() await fs.promises.mkdir(testDir, {recursive: true}) await createTestArchive() @@ -251,7 +251,6 @@ describe('download-artifact', () => { it('should fail if blob storage storage chunk does not respond within 30s', async () => { // mock http client to delay response data by 30s - // const msg = new http.IncomingMessage(new net.Socket()) msg.statusCode = 200 @@ -285,7 +284,7 @@ describe('download-artifact', () => { ).rejects.toBeInstanceOf(Error) expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) - }, 35000) + }, 35000) // add longer timeout to allow for timer to run out it('should fail if blob storage response is non-200 after 5 retries', async () => { const downloadArtifactMock = github.getOctokit(fixtures.token).rest diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 42dfa1cf..21a1bdb1 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -38,7 +38,6 @@ async function exists(path: string): Promise { } async function streamExtract(url: string, directory: string): Promise { - core.info(`Stream extract started`) let retryCount = 0 while (retryCount < 5) { try { @@ -66,7 +65,6 @@ export async function streamExtractExternal( const client = new httpClient.HttpClient(getUserAgentString()) const response = await client.get(url) - core.info(`Stream extract internal get called`) if (response.message.statusCode !== 200) { throw new Error( @@ -78,8 +76,6 @@ export async function streamExtractExternal( return new Promise((resolve, reject) => { const timerFn = (): void => { - // close response stream - core.warning('timerFn: closing response stream') response.message.destroy( new Error(`Blob storage chunk did not respond in ${timeout}ms`) ) @@ -91,7 +87,7 @@ export async function streamExtractExternal( timer.refresh() }) .on('error', (error: Error) => { - core.warning( + core.debug( `response.message: Artifact download failed: ${error.message}` ) clearTimeout(timer) From 2124ef24137ba4c153729cd1f323af25b4212f08 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Jan 2024 19:36:26 +0000 Subject: [PATCH 091/198] cleaning up logs --- .../artifact/src/internal/download/download-artifact.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 21a1bdb1..7201b2f2 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -42,11 +42,10 @@ async function streamExtract(url: string, directory: string): Promise { while (retryCount < 5) { try { await streamExtractExternal(url, directory) - core.info(`Artifact downloaded successfully after ${retryCount} retries.`) return } catch (error) { retryCount++ - core.warning( + core.debug( `Failed to download artifact after ${retryCount} retries due to ${error.message}. Retrying in 5 seconds...` ) // wait 5 seconds before retrying @@ -61,11 +60,8 @@ export async function streamExtractExternal( url: string, directory: string ): Promise { - core.info(`Stream extract internal started`) - const client = new httpClient.HttpClient(getUserAgentString()) const response = await client.get(url) - if (response.message.statusCode !== 200) { throw new Error( `Unexpected HTTP response from blob storage: ${response.message.statusCode} ${response.message.statusMessage}` From 7549d1b2187f0ca0ac71072272698bc1cc9ec463 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Jan 2024 19:42:04 +0000 Subject: [PATCH 092/198] removing info logs --- packages/artifact/src/internal/download/download-artifact.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 7201b2f2..dc54f6fe 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -91,12 +91,10 @@ export async function streamExtractExternal( }) .pipe(unzip.Extract({path: directory})) .on('close', () => { - core.info(`zip stream: Artifact downloaded to: ${directory}`) clearTimeout(timer) resolve() }) .on('error', (error: Error) => { - core.warning(`zip stream: Artifact download failed: ${error.message}`) reject(error) }) }) From f37c445bc5ef316917b91580601771fe1a50ed91 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Jan 2024 19:46:17 +0000 Subject: [PATCH 094/198] reverting jest --- jest.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index f25dbdc9..101666d6 100644 --- a/jest.config.js +++ b/jest.config.js @@ -8,4 +8,4 @@ module.exports = { '^.+\\.ts$': 'ts-jest' }, verbose: true -} +} \ No newline at end of file From c1ded1dc4deef7c895cad774e8dc14f4cbcc1e30 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Jan 2024 19:47:02 +0000 Subject: [PATCH 095/198] appeasing linter --- jest.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index 101666d6..15077ce9 100644 --- a/jest.config.js +++ b/jest.config.js @@ -8,4 +8,5 @@ module.exports = { '^.+\\.ts$': 'ts-jest' }, verbose: true -} \ No newline at end of file +} +// adding extra line for linter From 439cd9b37e3c3a245101d6c87d5e91326f6d3c4f Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Jan 2024 19:47:25 +0000 Subject: [PATCH 096/198] appeasing linter --- jest.config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index 15077ce9..f25dbdc9 100644 --- a/jest.config.js +++ b/jest.config.js @@ -9,4 +9,3 @@ module.exports = { }, verbose: true } -// adding extra line for linter From 0389dcd5e45f77675a9d06a8da8bdc331f07e883 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Wed, 10 Jan 2024 10:43:38 -0500 Subject: [PATCH 097/198] updating release notes (#1620) --- packages/artifact/RELEASES.md | 10 +++++++--- packages/artifact/package-lock.json | 4 ++-- packages/artifact/package.json | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/artifact/RELEASES.md b/packages/artifact/RELEASES.md index ce3ed43b..064a34e6 100644 --- a/packages/artifact/RELEASES.md +++ b/packages/artifact/RELEASES.md @@ -97,7 +97,11 @@ ### 2.0.0 -Major release. Supports new Artifact backend for improved speed, reliability and behavior. -Numerous API changes, [some breaking](./README.md#breaking-changes). +- Major release. Supports new Artifact backend for improved speed, reliability and behavior. +- Numerous API changes, [some breaking](./README.md#breaking-changes). -Blog post with more info: TBD +- Blog post with more info: TBD + +### 2.0.1 + +- Patch to fix transient request timeouts https://github.com/actions/download-artifact/issues/249 diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index abe007be..5750628e 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -1,12 +1,12 @@ { "name": "@actions/artifact", - "version": "2.0.0", + "version": "2.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@actions/artifact", - "version": "2.0.0", + "version": "2.0.1", "license": "MIT", "dependencies": { "@actions/core": "^1.10.0", diff --git a/packages/artifact/package.json b/packages/artifact/package.json index c4f826c6..3dfa461a 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -1,6 +1,6 @@ { "name": "@actions/artifact", - "version": "2.0.0", + "version": "2.0.1", "preview": true, "description": "Actions artifact lib", "keywords": [ @@ -62,4 +62,4 @@ "typedoc-plugin-markdown": "^3.17.1", "typescript": "^5.2.2" } -} +} \ No newline at end of file From b9079670ebae741afa82dfa7ddfafb28796ea1d7 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 10 Jan 2024 17:05:13 -0500 Subject: [PATCH 098/198] Update cache npm package version --- packages/cache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cache/package.json b/packages/cache/package.json index b742c525..8be7c740 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -1,6 +1,6 @@ { "name": "@actions/cache", - "version": "3.2.2", + "version": "3.2.3", "preview": true, "description": "Actions cache lib", "keywords": [ From 7c27528ab4125da93a48588a11327ec429f28987 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 10 Jan 2024 17:32:52 -0500 Subject: [PATCH 099/198] Update RELEASES.md Updates release notes for @actions/cache v3.2.3 --- packages/cache/RELEASES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/cache/RELEASES.md b/packages/cache/RELEASES.md index eb86a8b0..43cbfef9 100644 --- a/packages/cache/RELEASES.md +++ b/packages/cache/RELEASES.md @@ -164,3 +164,7 @@ ### 3.2.2 - Add new default cache download method to improve performance and reduce hangs [#1484](https://github.com/actions/toolkit/pull/1484) + +### 3.2.3 + +- Fixed a bug that mutated path arguments to `getCacheVersion` [#1378](https://github.com/actions/toolkit/pull/1378) From b62d4c91b60dda013224ff324dead43a4f0bc21b Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 17 Jan 2024 16:18:49 -0500 Subject: [PATCH 100/198] add public and internal methods to delete artifacts --- .../__tests__/delete-artifacts.test.ts | 170 +++++++++++++++++ .../src/generated/results/api/v1/artifact.ts | 148 ++++++++++++++- .../results/api/v1/artifact.twirp.ts | 177 ++++++++++++++++++ packages/artifact/src/internal/client.ts | 60 +++++- .../src/internal/delete/delete-artifact.ts | 80 ++++++++ .../src/internal/shared/interfaces.ts | 10 + 6 files changed, 642 insertions(+), 3 deletions(-) create mode 100644 packages/artifact/__tests__/delete-artifacts.test.ts create mode 100644 packages/artifact/src/internal/delete/delete-artifact.ts diff --git a/packages/artifact/__tests__/delete-artifacts.test.ts b/packages/artifact/__tests__/delete-artifacts.test.ts new file mode 100644 index 00000000..98727d62 --- /dev/null +++ b/packages/artifact/__tests__/delete-artifacts.test.ts @@ -0,0 +1,170 @@ +import * as github from '@actions/github' +import type {RestEndpointMethods} from '@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types' +import type {RequestInterface} from '@octokit/types' +import { + deleteArtifactInternal, + deleteArtifactPublic +} from '../src/internal/delete/delete-artifact' +import * as config from '../src/internal/shared/config' +import {ArtifactServiceClientJSON} from '../src/generated' +import * as util from '../src/internal/shared/util' +import {noopLogs} from './common' + +type MockedRequest = jest.MockedFunction> + +type MockedDeleteArtifact = jest.MockedFunction< + RestEndpointMethods['actions']['deleteArtifact'] +> + +jest.mock('@actions/github', () => ({ + getOctokit: jest.fn().mockReturnValue({ + request: jest.fn(), + rest: { + actions: { + deleteArtifact: jest.fn() + } + } + }) +})) + +const fixtures = { + repo: 'toolkit', + owner: 'actions', + token: 'ghp_1234567890', + runId: 123, + backendIds: { + workflowRunBackendId: 'c4d7c21f-ba3f-4ddc-a8c8-6f2f626f8422', + workflowJobRunBackendId: '760803a1-f890-4d25-9a6e-a3fc01a0c7cf' + }, + artifacts: [ + { + id: 1, + name: 'my-artifact', + size: 456, + createdAt: new Date('2023-12-01') + }, + { + id: 2, + name: 'my-artifact', + size: 456, + createdAt: new Date('2023-12-02') + } + ] +} + +describe('delete-artifact', () => { + beforeAll(() => { + noopLogs() + }) + + describe('public', () => { + it('should delete an artifact', async () => { + const mockRequest = github.getOctokit(fixtures.token) + .request as MockedRequest + mockRequest.mockResolvedValueOnce({ + status: 200, + headers: {}, + url: '', + data: { + artifacts: [ + { + name: fixtures.artifacts[0].name, + id: fixtures.artifacts[0].id, + size_in_bytes: fixtures.artifacts[0].size, + created_at: fixtures.artifacts[0].createdAt.toISOString() + } + ] + } + }) + + const mockDeleteArtifact = github.getOctokit(fixtures.token).rest.actions + .deleteArtifact as MockedDeleteArtifact + mockDeleteArtifact.mockResolvedValueOnce({ + status: 204, + headers: {}, + url: '', + data: null as never + }) + + const response = await deleteArtifactPublic( + fixtures.artifacts[0].name, + fixtures.runId, + fixtures.owner, + fixtures.repo, + fixtures.token + ) + + expect(response).toEqual({ + id: fixtures.artifacts[0].id + }) + }) + + it('should fail if non-200 response', async () => { + const mockRequest = github.getOctokit(fixtures.token) + .request as MockedRequest + mockRequest.mockResolvedValueOnce({ + status: 200, + headers: {}, + url: '', + data: { + artifacts: [ + { + name: fixtures.artifacts[0].name, + id: fixtures.artifacts[0].id, + size_in_bytes: fixtures.artifacts[0].size, + created_at: fixtures.artifacts[0].createdAt.toISOString() + } + ] + } + }) + + const mockDeleteArtifact = github.getOctokit(fixtures.token).rest.actions + .deleteArtifact as MockedDeleteArtifact + mockDeleteArtifact.mockRejectedValue(new Error('boom')) + + await expect( + deleteArtifactPublic( + fixtures.artifacts[0].name, + fixtures.runId, + fixtures.owner, + fixtures.repo, + fixtures.token + ) + ).rejects.toThrow('boom') + }) + }) + + describe('internal', () => { + beforeEach(() => { + jest.spyOn(config, 'getRuntimeToken').mockReturnValue('test-token') + jest + .spyOn(util, 'getBackendIdsFromToken') + .mockReturnValue(fixtures.backendIds) + jest + .spyOn(config, 'getResultsServiceUrl') + .mockReturnValue('https://results.local') + }) + + it('should return a list of artifacts', async () => { + jest + .spyOn(ArtifactServiceClientJSON.prototype, 'DeleteArtifact') + .mockResolvedValue({ + ok: true, + artifactId: fixtures.artifacts[0].id.toString() + }) + const response = await deleteArtifactInternal(fixtures.artifacts[0].name) + expect(response).toEqual({ + id: fixtures.artifacts[0].id + }) + }) + + it('should fail if non-200 response', async () => { + jest + .spyOn(ArtifactServiceClientJSON.prototype, 'DeleteArtifact') + .mockRejectedValue(new Error('boom')) + await expect( + deleteArtifactInternal(fixtures.artifacts[0].id) + ).rejects.toThrow('boom') + }) + }) +}) diff --git a/packages/artifact/src/generated/results/api/v1/artifact.ts b/packages/artifact/src/generated/results/api/v1/artifact.ts index acce3037..7bb7f4be 100644 --- a/packages/artifact/src/generated/results/api/v1/artifact.ts +++ b/packages/artifact/src/generated/results/api/v1/artifact.ts @@ -196,6 +196,36 @@ export interface GetSignedArtifactURLResponse { */ signedUrl: string; } +/** + * @generated from protobuf message github.actions.results.api.v1.DeleteArtifactRequest + */ +export interface DeleteArtifactRequest { + /** + * @generated from protobuf field: string workflow_run_backend_id = 1; + */ + workflowRunBackendId: string; + /** + * @generated from protobuf field: string workflow_job_run_backend_id = 2; + */ + workflowJobRunBackendId: string; + /** + * @generated from protobuf field: string name = 3; + */ + name: string; +} +/** + * @generated from protobuf message github.actions.results.api.v1.DeleteArtifactResponse + */ +export interface DeleteArtifactResponse { + /** + * @generated from protobuf field: bool ok = 1; + */ + ok: boolean; + /** + * @generated from protobuf field: int64 artifact_id = 2; + */ + artifactId: string; +} // @generated message type with reflection information, may provide speed optimized methods class CreateArtifactRequest$Type extends MessageType { constructor() { @@ -759,6 +789,121 @@ class GetSignedArtifactURLResponse$Type extends MessageType { + constructor() { + super("github.actions.results.api.v1.DeleteArtifactRequest", [ + { no: 1, name: "workflow_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "workflow_job_run_backend_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): DeleteArtifactRequest { + const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", name: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteArtifactRequest): DeleteArtifactRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string workflow_run_backend_id */ 1: + message.workflowRunBackendId = reader.string(); + break; + case /* string workflow_job_run_backend_id */ 2: + message.workflowJobRunBackendId = reader.string(); + break; + case /* string name */ 3: + message.name = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DeleteArtifactRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string workflow_run_backend_id = 1; */ + if (message.workflowRunBackendId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.workflowRunBackendId); + /* string workflow_job_run_backend_id = 2; */ + if (message.workflowJobRunBackendId !== "") + writer.tag(2, WireType.LengthDelimited).string(message.workflowJobRunBackendId); + /* string name = 3; */ + if (message.name !== "") + writer.tag(3, WireType.LengthDelimited).string(message.name); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message github.actions.results.api.v1.DeleteArtifactRequest + */ +export const DeleteArtifactRequest = new DeleteArtifactRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DeleteArtifactResponse$Type extends MessageType { + constructor() { + super("github.actions.results.api.v1.DeleteArtifactResponse", [ + { no: 1, name: "ok", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "artifact_id", kind: "scalar", T: 3 /*ScalarType.INT64*/ } + ]); + } + create(value?: PartialMessage): DeleteArtifactResponse { + const message = { ok: false, artifactId: "0" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteArtifactResponse): DeleteArtifactResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool ok */ 1: + message.ok = reader.bool(); + break; + case /* int64 artifact_id */ 2: + message.artifactId = reader.int64().toString(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DeleteArtifactResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool ok = 1; */ + if (message.ok !== false) + writer.tag(1, WireType.Varint).bool(message.ok); + /* int64 artifact_id = 2; */ + if (message.artifactId !== "0") + writer.tag(2, WireType.Varint).int64(message.artifactId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message github.actions.results.api.v1.DeleteArtifactResponse + */ +export const DeleteArtifactResponse = new DeleteArtifactResponse$Type(); /** * @generated ServiceType for protobuf service github.actions.results.api.v1.ArtifactService */ @@ -766,5 +911,6 @@ export const ArtifactService = new ServiceType("github.actions.results.api.v1.Ar { name: "CreateArtifact", options: {}, I: CreateArtifactRequest, O: CreateArtifactResponse }, { name: "FinalizeArtifact", options: {}, I: FinalizeArtifactRequest, O: FinalizeArtifactResponse }, { name: "ListArtifacts", options: {}, I: ListArtifactsRequest, O: ListArtifactsResponse }, - { name: "GetSignedArtifactURL", options: {}, I: GetSignedArtifactURLRequest, O: GetSignedArtifactURLResponse } + { name: "GetSignedArtifactURL", options: {}, I: GetSignedArtifactURLRequest, O: GetSignedArtifactURLResponse }, + { name: "DeleteArtifact", options: {}, I: DeleteArtifactRequest, O: DeleteArtifactResponse } ]); diff --git a/packages/artifact/src/generated/results/api/v1/artifact.twirp.ts b/packages/artifact/src/generated/results/api/v1/artifact.twirp.ts index 4871eb6b..bc092117 100644 --- a/packages/artifact/src/generated/results/api/v1/artifact.twirp.ts +++ b/packages/artifact/src/generated/results/api/v1/artifact.twirp.ts @@ -17,6 +17,8 @@ import { ListArtifactsResponse, GetSignedArtifactURLRequest, GetSignedArtifactURLResponse, + DeleteArtifactRequest, + DeleteArtifactResponse, } from "./artifact"; //==================================// @@ -43,6 +45,9 @@ export interface ArtifactServiceClient { GetSignedArtifactURL( request: GetSignedArtifactURLRequest ): Promise; + DeleteArtifact( + request: DeleteArtifactRequest + ): Promise; } export class ArtifactServiceClientJSON implements ArtifactServiceClient { @@ -53,6 +58,7 @@ export class ArtifactServiceClientJSON implements ArtifactServiceClient { this.FinalizeArtifact.bind(this); this.ListArtifacts.bind(this); this.GetSignedArtifactURL.bind(this); + this.DeleteArtifact.bind(this); } CreateArtifact( request: CreateArtifactRequest @@ -129,6 +135,26 @@ export class ArtifactServiceClientJSON implements ArtifactServiceClient { }) ); } + + DeleteArtifact( + request: DeleteArtifactRequest + ): Promise { + const data = DeleteArtifactRequest.toJson(request, { + useProtoFieldName: true, + emitDefaultValues: false, + }); + const promise = this.rpc.request( + "github.actions.results.api.v1.ArtifactService", + "DeleteArtifact", + "application/json", + data as object + ); + return promise.then((data) => + DeleteArtifactResponse.fromJson(data as any, { + ignoreUnknownFields: true, + }) + ); + } } export class ArtifactServiceClientProtobuf implements ArtifactServiceClient { @@ -139,6 +165,7 @@ export class ArtifactServiceClientProtobuf implements ArtifactServiceClient { this.FinalizeArtifact.bind(this); this.ListArtifacts.bind(this); this.GetSignedArtifactURL.bind(this); + this.DeleteArtifact.bind(this); } CreateArtifact( request: CreateArtifactRequest @@ -197,6 +224,21 @@ export class ArtifactServiceClientProtobuf implements ArtifactServiceClient { GetSignedArtifactURLResponse.fromBinary(data as Uint8Array) ); } + + DeleteArtifact( + request: DeleteArtifactRequest + ): Promise { + const data = DeleteArtifactRequest.toBinary(request); + const promise = this.rpc.request( + "github.actions.results.api.v1.ArtifactService", + "DeleteArtifact", + "application/protobuf", + data + ); + return promise.then((data) => + DeleteArtifactResponse.fromBinary(data as Uint8Array) + ); + } } //==================================// @@ -220,6 +262,10 @@ export interface ArtifactServiceTwirp { ctx: T, request: GetSignedArtifactURLRequest ): Promise; + DeleteArtifact( + ctx: T, + request: DeleteArtifactRequest + ): Promise; } export enum ArtifactServiceMethod { @@ -227,6 +273,7 @@ export enum ArtifactServiceMethod { FinalizeArtifact = "FinalizeArtifact", ListArtifacts = "ListArtifacts", GetSignedArtifactURL = "GetSignedArtifactURL", + DeleteArtifact = "DeleteArtifact", } export const ArtifactServiceMethodList = [ @@ -234,6 +281,7 @@ export const ArtifactServiceMethodList = [ ArtifactServiceMethod.FinalizeArtifact, ArtifactServiceMethod.ListArtifacts, ArtifactServiceMethod.GetSignedArtifactURL, + ArtifactServiceMethod.DeleteArtifact, ]; export function createArtifactServiceServer< @@ -333,6 +381,26 @@ function matchArtifactServiceRoute( interceptors ); }; + case "DeleteArtifact": + return async ( + ctx: T, + service: ArtifactServiceTwirp, + data: Buffer, + interceptors?: Interceptor< + T, + DeleteArtifactRequest, + DeleteArtifactResponse + >[] + ) => { + ctx = { ...ctx, methodName: "DeleteArtifact" }; + await events.onMatch(ctx); + return handleArtifactServiceDeleteArtifactRequest( + ctx, + service, + data, + interceptors + ); + }; default: events.onNotFound(); const msg = `no handler found`; @@ -463,6 +531,35 @@ function handleArtifactServiceGetSignedArtifactURLRequest< throw new TwirpError(TwirpErrorCode.BadRoute, msg); } } + +function handleArtifactServiceDeleteArtifactRequest< + T extends TwirpContext = TwirpContext +>( + ctx: T, + service: ArtifactServiceTwirp, + data: Buffer, + interceptors?: Interceptor[] +): Promise { + switch (ctx.contentType) { + case TwirpContentType.JSON: + return handleArtifactServiceDeleteArtifactJSON( + ctx, + service, + data, + interceptors + ); + case TwirpContentType.Protobuf: + return handleArtifactServiceDeleteArtifactProtobuf( + ctx, + service, + data, + interceptors + ); + default: + const msg = "unexpected Content-Type"; + throw new TwirpError(TwirpErrorCode.BadRoute, msg); + } +} async function handleArtifactServiceCreateArtifactJSON< T extends TwirpContext = TwirpContext >( @@ -646,6 +743,50 @@ async function handleArtifactServiceGetSignedArtifactURLJSON< }) as string ); } + +async function handleArtifactServiceDeleteArtifactJSON< + T extends TwirpContext = TwirpContext +>( + ctx: T, + service: ArtifactServiceTwirp, + data: Buffer, + interceptors?: Interceptor[] +) { + let request: DeleteArtifactRequest; + let response: DeleteArtifactResponse; + + try { + const body = JSON.parse(data.toString() || "{}"); + request = DeleteArtifactRequest.fromJson(body, { + ignoreUnknownFields: true, + }); + } catch (e) { + if (e instanceof Error) { + const msg = "the json request could not be decoded"; + throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true); + } + } + + if (interceptors && interceptors.length > 0) { + const interceptor = chainInterceptors(...interceptors) as Interceptor< + T, + DeleteArtifactRequest, + DeleteArtifactResponse + >; + response = await interceptor(ctx, request!, (ctx, inputReq) => { + return service.DeleteArtifact(ctx, inputReq); + }); + } else { + response = await service.DeleteArtifact(ctx, request!); + } + + return JSON.stringify( + DeleteArtifactResponse.toJson(response, { + useProtoFieldName: true, + emitDefaultValues: false, + }) as string + ); +} async function handleArtifactServiceCreateArtifactProtobuf< T extends TwirpContext = TwirpContext >( @@ -797,3 +938,39 @@ async function handleArtifactServiceGetSignedArtifactURLProtobuf< return Buffer.from(GetSignedArtifactURLResponse.toBinary(response)); } + +async function handleArtifactServiceDeleteArtifactProtobuf< + T extends TwirpContext = TwirpContext +>( + ctx: T, + service: ArtifactServiceTwirp, + data: Buffer, + interceptors?: Interceptor[] +) { + let request: DeleteArtifactRequest; + let response: DeleteArtifactResponse; + + try { + request = DeleteArtifactRequest.fromBinary(data); + } catch (e) { + if (e instanceof Error) { + const msg = "the protobuf request could not be decoded"; + throw new TwirpError(TwirpErrorCode.Malformed, msg).withCause(e, true); + } + } + + if (interceptors && interceptors.length > 0) { + const interceptor = chainInterceptors(...interceptors) as Interceptor< + T, + DeleteArtifactRequest, + DeleteArtifactResponse + >; + response = await interceptor(ctx, request!, (ctx, inputReq) => { + return service.DeleteArtifact(ctx, inputReq); + }); + } else { + response = await service.DeleteArtifact(ctx, request!); + } + + return Buffer.from(DeleteArtifactResponse.toBinary(response)); +} diff --git a/packages/artifact/src/internal/client.ts b/packages/artifact/src/internal/client.ts index c4971d9f..fc55236a 100644 --- a/packages/artifact/src/internal/client.ts +++ b/packages/artifact/src/internal/client.ts @@ -8,13 +8,18 @@ import { ListArtifactsOptions, ListArtifactsResponse, DownloadArtifactResponse, - FindOptions + FindOptions, + DeleteArtifactResponse } from './shared/interfaces' import {uploadArtifact} from './upload/upload-artifact' import { downloadArtifactPublic, downloadArtifactInternal } from './download/download-artifact' +import { + deleteArtifactPublic, + deleteArtifactInternal +} from './delete/delete-artifact' import {getArtifactPublic, getArtifactInternal} from './find/get-artifact' import {listArtifactsPublic, listArtifactsInternal} from './find/list-artifacts' import {GHESNotSupportedError} from './shared/errors' @@ -77,7 +82,7 @@ export interface ArtifactClient { * * If `options.findBy` is specified, this will use the public Download Artifact API https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#download-an-artifact * - * @param artifactId The name of the artifact to download + * @param artifactId The id of the artifact to download * @param options Extra options that allow for the customization of the download behavior * @returns single DownloadArtifactResponse object */ @@ -85,6 +90,20 @@ export interface ArtifactClient { artifactId: number, options?: DownloadArtifactOptions & FindOptions ): Promise + + /** + * Delete an Artifact + * + * If `options.findBy` is specified, this will use the public Download Artifact API https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#delete-an-artifact + * + * @param artifactName The name of the artifact to delete + * @param options Extra options that allow for the customization of the delete behavior + * @returns single DeleteArtifactResponse object + */ + deleteArtifact( + artifactName: string, + options?: FindOptions + ): Promise } /** @@ -225,4 +244,41 @@ If the error persists, please check whether Actions and API requests are operati throw error } } + + async deleteArtifact( + artifactName: string, + options?: FindOptions + ): Promise { + try { + if (isGhes()) { + throw new GHESNotSupportedError() + } + + if (options?.findBy) { + const { + findBy: {repositoryOwner, repositoryName, workflowRunId, token} + } = options + + return deleteArtifactPublic( + artifactName, + workflowRunId, + repositoryOwner, + repositoryName, + token + ) + } + + return deleteArtifactInternal(artifactName) + } catch (error) { + warning( + `Delete Artifact failed with error: ${error}. + +Errors can be temporary, so please try again and optionally run the action with debug mode enabled for more information. + +If the error persists, please check whether Actions and API requests are operating normally at [https://githubstatus.com](https://www.githubstatus.com).` + ) + + throw error + } + } } diff --git a/packages/artifact/src/internal/delete/delete-artifact.ts b/packages/artifact/src/internal/delete/delete-artifact.ts new file mode 100644 index 00000000..4183049b --- /dev/null +++ b/packages/artifact/src/internal/delete/delete-artifact.ts @@ -0,0 +1,80 @@ +import {info} from '@actions/core' +import {getOctokit} from '@actions/github' +import {DeleteArtifactResponse} from '../shared/interfaces' +import {getUserAgentString} from '../shared/user-agent' +import {getRetryOptions} from '../find/retry-options' +import {defaults as defaultGitHubOptions} from '@actions/github/lib/utils' +import {requestLog} from '@octokit/plugin-request-log' +import {retry} from '@octokit/plugin-retry' +import {OctokitOptions} from '@octokit/core/dist-types/types' +import {internalArtifactTwirpClient} from '../shared/artifact-twirp-client' +import {getBackendIdsFromToken} from '../shared/util' +import {DeleteArtifactRequest} from '../../generated' +import {getArtifactPublic} from '../find/get-artifact' +import {InvalidResponseError} from '../shared/errors' + +export async function deleteArtifactPublic( + artifactName: string, + workflowRunId: number, + repositoryOwner: string, + repositoryName: string, + token: string +): Promise { + const [retryOpts, requestOpts] = getRetryOptions(defaultGitHubOptions) + + const opts: OctokitOptions = { + log: undefined, + userAgent: getUserAgentString(), + previews: undefined, + retry: retryOpts, + request: requestOpts + } + + const github = getOctokit(token, opts, retry, requestLog) + + const getArtifactResp = await getArtifactPublic( + artifactName, + workflowRunId, + repositoryOwner, + repositoryName, + token + ) + + const deleteArtifactResp = await github.rest.actions.deleteArtifact({ + owner: repositoryOwner, + repo: repositoryName, + artifact_id: getArtifactResp.artifact.id + }) + + if (deleteArtifactResp.status !== 204) { + throw new InvalidResponseError( + `Invalid response from GitHub API: ${deleteArtifactResp.status} (${deleteArtifactResp?.headers?.['x-github-request-id']})` + ) + } + + return { + id: getArtifactResp.artifact.id + } +} + +export async function deleteArtifactInternal( + artifactName +): Promise { + const artifactClient = internalArtifactTwirpClient() + + const {workflowRunBackendId, workflowJobRunBackendId} = + getBackendIdsFromToken() + + const req: DeleteArtifactRequest = { + workflowRunBackendId, + workflowJobRunBackendId, + name: artifactName + } + + const res = await artifactClient.DeleteArtifact(req) + info(`Artifact '${artifactName}' (ID: ${res.artifactId}) deleted`) + + return { + id: Number(res.artifactId) + } +} diff --git a/packages/artifact/src/internal/shared/interfaces.ts b/packages/artifact/src/internal/shared/interfaces.ts index c661721e..eb55ae8b 100644 --- a/packages/artifact/src/internal/shared/interfaces.ts +++ b/packages/artifact/src/internal/shared/interfaces.ts @@ -147,3 +147,13 @@ export interface FindOptions { repositoryName: string } } + +/** + * Response from the server when deleting an artifact + */ +export interface DeleteArtifactResponse { + /** + * The id of the artifact that was deleted + */ + id: number +} From 7fd71a5e13092dd1a933e6d30e703a0f3f1d6726 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 17 Jan 2024 16:56:34 -0500 Subject: [PATCH 101/198] fix typo --- packages/artifact/src/internal/client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/src/internal/client.ts b/packages/artifact/src/internal/client.ts index fc55236a..25565270 100644 --- a/packages/artifact/src/internal/client.ts +++ b/packages/artifact/src/internal/client.ts @@ -94,7 +94,7 @@ export interface ArtifactClient { /** * Delete an Artifact * - * If `options.findBy` is specified, this will use the public Download Artifact API https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#delete-an-artifact + * If `options.findBy` is specified, this will use the public Delete Artifact API https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#delete-an-artifact * * @param artifactName The name of the artifact to delete * @param options Extra options that allow for the customization of the delete behavior From 2f5fb3f92b71b303a20d6b74fbc64dc64f3e32d8 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 17 Jan 2024 17:53:49 -0500 Subject: [PATCH 102/198] list for correct backend ids in internal delete --- .../__tests__/delete-artifacts.test.ts | 26 ++++++++++++- .../src/internal/delete/delete-artifact.ts | 39 ++++++++++++++++--- 2 files changed, 58 insertions(+), 7 deletions(-) diff --git a/packages/artifact/__tests__/delete-artifacts.test.ts b/packages/artifact/__tests__/delete-artifacts.test.ts index 98727d62..70a39412 100644 --- a/packages/artifact/__tests__/delete-artifacts.test.ts +++ b/packages/artifact/__tests__/delete-artifacts.test.ts @@ -6,7 +6,7 @@ import { deleteArtifactPublic } from '../src/internal/delete/delete-artifact' import * as config from '../src/internal/shared/config' -import {ArtifactServiceClientJSON} from '../src/generated' +import {ArtifactServiceClientJSON, Timestamp} from '../src/generated' import * as util from '../src/internal/shared/util' import {noopLogs} from './common' @@ -145,7 +145,18 @@ describe('delete-artifact', () => { .mockReturnValue('https://results.local') }) - it('should return a list of artifacts', async () => { + it('should delete an artifact', async () => { + jest + .spyOn(ArtifactServiceClientJSON.prototype, 'ListArtifacts') + .mockResolvedValue({ + artifacts: fixtures.artifacts.map(artifact => ({ + ...fixtures.backendIds, + databaseId: artifact.id.toString(), + name: artifact.name, + size: artifact.size.toString(), + createdAt: Timestamp.fromDate(artifact.createdAt) + })) + }) jest .spyOn(ArtifactServiceClientJSON.prototype, 'DeleteArtifact') .mockResolvedValue({ @@ -159,6 +170,17 @@ describe('delete-artifact', () => { }) it('should fail if non-200 response', async () => { + jest + .spyOn(ArtifactServiceClientJSON.prototype, 'ListArtifacts') + .mockResolvedValue({ + artifacts: fixtures.artifacts.map(artifact => ({ + ...fixtures.backendIds, + databaseId: artifact.id.toString(), + name: artifact.name, + size: artifact.size.toString(), + createdAt: Timestamp.fromDate(artifact.createdAt) + })) + }) jest .spyOn(ArtifactServiceClientJSON.prototype, 'DeleteArtifact') .mockRejectedValue(new Error('boom')) diff --git a/packages/artifact/src/internal/delete/delete-artifact.ts b/packages/artifact/src/internal/delete/delete-artifact.ts index 4183049b..785b4035 100644 --- a/packages/artifact/src/internal/delete/delete-artifact.ts +++ b/packages/artifact/src/internal/delete/delete-artifact.ts @@ -1,4 +1,4 @@ -import {info} from '@actions/core' +import {info, debug} from '@actions/core' import {getOctokit} from '@actions/github' import {DeleteArtifactResponse} from '../shared/interfaces' import {getUserAgentString} from '../shared/user-agent' @@ -9,9 +9,13 @@ import {retry} from '@octokit/plugin-retry' import {OctokitOptions} from '@octokit/core/dist-types/types' import {internalArtifactTwirpClient} from '../shared/artifact-twirp-client' import {getBackendIdsFromToken} from '../shared/util' -import {DeleteArtifactRequest} from '../../generated' +import { + DeleteArtifactRequest, + ListArtifactsRequest, + StringValue +} from '../../generated' import {getArtifactPublic} from '../find/get-artifact' -import {InvalidResponseError} from '../shared/errors' +import {ArtifactNotFoundError, InvalidResponseError} from '../shared/errors' export async function deleteArtifactPublic( artifactName: string, @@ -65,10 +69,35 @@ export async function deleteArtifactInternal( const {workflowRunBackendId, workflowJobRunBackendId} = getBackendIdsFromToken() - const req: DeleteArtifactRequest = { + const listReq: ListArtifactsRequest = { workflowRunBackendId, workflowJobRunBackendId, - name: artifactName + nameFilter: StringValue.create({value: artifactName}) + } + + const listRes = await artifactClient.ListArtifacts(listReq) + + if (listRes.artifacts.length === 0) { + throw new ArtifactNotFoundError( + `Artifact not found for name: ${artifactName}` + ) + } + + let artifact = listRes.artifacts[0] + if (listRes.artifacts.length > 1) { + artifact = listRes.artifacts.sort( + (a, b) => Number(b.databaseId) - Number(a.databaseId) + )[0] + + debug( + `More than one artifact found for a single name, returning newest (id: ${artifact.databaseId})` + ) + } + + const req: DeleteArtifactRequest = { + workflowRunBackendId: artifact.workflowRunBackendId, + workflowJobRunBackendId: artifact.workflowJobRunBackendId, + name: artifact.name } const res = await artifactClient.DeleteArtifact(req) From 2ad687a32e07b6a6864773bc61602cfacc19476a Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 17 Jan 2024 17:54:10 -0500 Subject: [PATCH 103/198] add integration test for delete --- .github/workflows/artifact-tests.yml | 30 +++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/artifact-tests.yml b/.github/workflows/artifact-tests.yml index aa0ab371..a74db480 100644 --- a/.github/workflows/artifact-tests.yml +++ b/.github/workflows/artifact-tests.yml @@ -72,7 +72,7 @@ jobs: console.log('Successfully blocked second artifact upload') } verify: - name: Verify + name: Verify and Delete runs-on: ubuntu-latest needs: [upload] steps: @@ -164,3 +164,31 @@ jobs: } } } + - name: Delete Artifacts + uses: actions/github-script@v7 + with: + script: | + const {default: artifactClient} = require('./packages/artifact/lib/artifact') + + const artifactsToDelete = [ + 'my-artifact-ubuntu-latest', + 'my-artifact-windows-latest', + 'my-artifact-macos-latest' + ] + + for (const artifactName of artifactsToDelete) { + const {id} = await artifactClient.deleteArtifact(artifactName) + } + + const {artifacts} = await artifactClient.listArtifacts({latest: true}) + const foundArtifacts = artifacts.filter(artifact => + artifactsToDelete.includes(artifact.name) + ) + + if (foundArtifacts.length !== 0) { + console.log('Unexpected length of found artifacts:', foundArtifacts) + throw new Error( + `Expected 0 artifacts but found ${foundArtifacts.length} artifacts.` + ) + } + From abe0bd98df90ce012351fb61591597bbb4a4d1f6 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 17 Jan 2024 18:21:25 -0500 Subject: [PATCH 104/198] delete example --- packages/artifact/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/artifact/README.md b/packages/artifact/README.md index 1e03ecdf..9de4e154 100644 --- a/packages/artifact/README.md +++ b/packages/artifact/README.md @@ -12,6 +12,7 @@ This is the core library that powers the [`@actions/upload-artifact`](https://gi - [Quick Start](#quick-start) - [Examples](#examples) - [Upload and Download](#upload-and-download) + - [Delete an Artifact](#delete-an-artifact) - [Downloading from other workflow runs or repos](#downloading-from-other-workflow-runs-or-repos) - [Speeding up large uploads](#speeding-up-large-uploads) - [Additional Resources](#additional-resources) @@ -106,6 +107,19 @@ const {downloadPath} = await artifact.downloadArtifact(id, { console.log(`Downloaded artifact ${id} to: ${downloadPath}`) ``` +### Delete an Artifact + +To delete an artifact, all you need is the name. Also supports options to delete from other repos/runs given a token with proper permissions is supplied. + +```js +const {id} = await artifact.deleteArtifact( + // name of the artifact + 'my-artifact' +) + +console.log(`Deleted Artifact ID: ${id}`) +``` + ### Downloading from other workflow runs or repos It may be useful to download Artifacts from other workflow runs, or even other repositories. By default, the permissions are scoped so they can only download Artifacts within the current workflow run. To elevate permissions for this scenario, you must specify `options.findBy` to `downloadArtifact`. From 1852eb2115645114d47975ca9eef48d4e56b17b0 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Wed, 17 Jan 2024 18:58:58 -0500 Subject: [PATCH 105/198] more delete examples --- packages/artifact/README.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/packages/artifact/README.md b/packages/artifact/README.md index 9de4e154..5a98da0e 100644 --- a/packages/artifact/README.md +++ b/packages/artifact/README.md @@ -109,7 +109,7 @@ console.log(`Downloaded artifact ${id} to: ${downloadPath}`) ### Delete an Artifact -To delete an artifact, all you need is the name. Also supports options to delete from other repos/runs given a token with proper permissions is supplied. +To delete an artifact, all you need is the name. ```js const {id} = await artifact.deleteArtifact( @@ -117,7 +117,29 @@ const {id} = await artifact.deleteArtifact( 'my-artifact' ) -console.log(`Deleted Artifact ID: ${id}`) +console.log(`Deleted Artifact ID '${id}'`) +``` + +It also supports options to delete from other repos/runs given a github token with `actions:write` permissions on the target repository is supplied. + +```js +const findBy = { + // must have actions:write permission on target repository + token: process.env['GITHUB_TOKEN'], + workflowRunId: 123, + repositoryOwner: 'actions', + repositoryName: 'toolkit' +} + + +const {id} = await artifact.deleteArtifact( + // name of the artifact + 'my-artifact', + // options to find by other repo/owner + { findBy } +) + +console.log(`Deleted Artifact ID '${id}' from ${findBy.repositoryOwner}/ ${findBy.repositoryName}`) ``` ### Downloading from other workflow runs or repos From 64c0992283a3416056fda5c5721008c728e11d2c Mon Sep 17 00:00:00 2001 From: eggyhead <28715808+eggyhead@users.noreply.github.com> Date: Thu, 18 Jan 2024 03:58:06 +0000 Subject: [PATCH 106/198] adding version compatibility and retention to artifacts FAQ --- packages/artifact/docs/faq.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/artifact/docs/faq.md b/packages/artifact/docs/faq.md index c88d5c11..b589bef2 100644 --- a/packages/artifact/docs/faq.md +++ b/packages/artifact/docs/faq.md @@ -33,3 +33,24 @@ The value can range from 0 to 9: Higher levels will result in better compression, but will take longer to complete. For large files that are not easily compressed, a value of 0 is recommended for significantly faster uploads. + +## Which versions of the artifacts packages are compatible? +[actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact), are part of the [GitHub Actions toolkit](https://github.com/actions/toolkit) and are typically used together to upload and download artifacts in your workflows. + +1. **Matching Versions:** + - Use matching versions of `actions/upload-artifact` and `actions/download-artifact` to ensure compatibility. + +2. **Workflow YAML File:** + - In your GitHub Actions workflow YAML file, you specify the version of the actions you want to use. For example: + ```yaml + uses: actions/upload-artifact@v4 + # ... + uses: actions/download-artifact@v4 + # ... + ``` + +3. **Release Notes:** + - Check the release notes for each repository to see if there are any specific notes about compatibility or changes in behavior. + +## How long will my artifact be available? +The default retention period is 90 days. For more information, visit: https://github.com/actions/upload-artifact?tab=readme-ov-file#retention-period From 98f72c3040e38347bfb30aaf110420c5205a55b9 Mon Sep 17 00:00:00 2001 From: eggyhead <28715808+eggyhead@users.noreply.github.com> Date: Thu, 18 Jan 2024 04:03:48 +0000 Subject: [PATCH 107/198] adding hyperlinks for new section of artifacts faq --- packages/artifact/docs/faq.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/artifact/docs/faq.md b/packages/artifact/docs/faq.md index b589bef2..22e518f5 100644 --- a/packages/artifact/docs/faq.md +++ b/packages/artifact/docs/faq.md @@ -3,6 +3,8 @@ - [Frequently Asked Questions](#frequently-asked-questions) - [Supported Characters](#supported-characters) - [Compression? ZIP? How is my artifact stored?](#compression-zip-how-is-my-artifact-stored) + - [Which versions of the artifacts packages are compatible?](#which-versions-of-the-artifacts-packages-are-compatible) + - [How long will my artifact be available?](#how-long-will-my-artifact-be-available) ## Supported Characters From 30942cc4ae0fb74359ce2506312557474d5219ee Mon Sep 17 00:00:00 2001 From: eggyhead <28715808+eggyhead@users.noreply.github.com> Date: Thu, 18 Jan 2024 04:10:35 +0000 Subject: [PATCH 108/198] updating artifact not found error message to include more information and link to FAQ --- packages/artifact/src/internal/find/get-artifact.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/artifact/src/internal/find/get-artifact.ts b/packages/artifact/src/internal/find/get-artifact.ts index b19e5d6e..a7b9f1b3 100644 --- a/packages/artifact/src/internal/find/get-artifact.ts +++ b/packages/artifact/src/internal/find/get-artifact.ts @@ -49,7 +49,9 @@ export async function getArtifactPublic( if (getArtifactResp.data.artifacts.length === 0) { throw new ArtifactNotFoundError( - `Artifact not found for name: ${artifactName}` + `Artifact not found for name: ${artifactName}\n + Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact.\n + For more information, visit the Github Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md` ) } From 5016db01fee4300348d9078e3a3d8ac4d8bb3d4d Mon Sep 17 00:00:00 2001 From: eggyhead <28715808+eggyhead@users.noreply.github.com> Date: Thu, 18 Jan 2024 04:14:39 +0000 Subject: [PATCH 109/198] update message for internal method --- packages/artifact/src/internal/find/get-artifact.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/artifact/src/internal/find/get-artifact.ts b/packages/artifact/src/internal/find/get-artifact.ts index a7b9f1b3..cbc5f137 100644 --- a/packages/artifact/src/internal/find/get-artifact.ts +++ b/packages/artifact/src/internal/find/get-artifact.ts @@ -91,7 +91,9 @@ export async function getArtifactInternal( if (res.artifacts.length === 0) { throw new ArtifactNotFoundError( - `Artifact not found for name: ${artifactName}` + `Artifact not found for name: ${artifactName}\n + Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact.\n + For more information, visit the Github Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md` ) } From 58c2878fce24c68ab0f93026b93e2b2f186cd279 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Thu, 18 Jan 2024 09:51:01 -0500 Subject: [PATCH 110/198] generate docs + update releases --- packages/artifact/RELEASES.md | 4 + packages/artifact/docs/generated/README.md | 5 +- .../classes/ArtifactNotFoundError.md | 2 +- .../classes/DefaultArtifactClient.md | 42 +++- .../generated/classes/FilesNotFoundError.md | 4 +- .../classes/GHESNotSupportedError.md | 2 +- .../generated/classes/InvalidResponseError.md | 2 +- .../docs/generated/classes/NetworkError.md | 201 ++++++++++++++++++ .../docs/generated/classes/UsageError.md | 184 ++++++++++++++++ .../docs/generated/interfaces/Artifact.md | 8 +- .../generated/interfaces/ArtifactClient.md | 38 +++- .../interfaces/DeleteArtifactResponse.md | 23 ++ .../interfaces/DownloadArtifactOptions.md | 2 +- .../interfaces/DownloadArtifactResponse.md | 2 +- .../docs/generated/interfaces/FindOptions.md | 2 +- .../interfaces/GetArtifactResponse.md | 2 +- .../interfaces/ListArtifactsOptions.md | 2 +- .../interfaces/ListArtifactsResponse.md | 2 +- .../interfaces/UploadArtifactOptions.md | 4 +- .../interfaces/UploadArtifactResponse.md | 4 +- packages/artifact/package.json | 4 +- 21 files changed, 507 insertions(+), 32 deletions(-) create mode 100644 packages/artifact/docs/generated/classes/NetworkError.md create mode 100644 packages/artifact/docs/generated/classes/UsageError.md create mode 100644 packages/artifact/docs/generated/interfaces/DeleteArtifactResponse.md diff --git a/packages/artifact/RELEASES.md b/packages/artifact/RELEASES.md index 064a34e6..27cd74a3 100644 --- a/packages/artifact/RELEASES.md +++ b/packages/artifact/RELEASES.md @@ -105,3 +105,7 @@ ### 2.0.1 - Patch to fix transient request timeouts https://github.com/actions/download-artifact/issues/249 + +### 2.1.0 + +- Added `ArtifactClient#deleteArtifact` to delete artifacts by name [#1626](https://github.com/actions/toolkit/pull/1626) diff --git a/packages/artifact/docs/generated/README.md b/packages/artifact/docs/generated/README.md index a1244395..aeeaade2 100644 --- a/packages/artifact/docs/generated/README.md +++ b/packages/artifact/docs/generated/README.md @@ -11,11 +11,14 @@ - [FilesNotFoundError](classes/FilesNotFoundError.md) - [GHESNotSupportedError](classes/GHESNotSupportedError.md) - [InvalidResponseError](classes/InvalidResponseError.md) +- [NetworkError](classes/NetworkError.md) +- [UsageError](classes/UsageError.md) ### Interfaces - [Artifact](interfaces/Artifact.md) - [ArtifactClient](interfaces/ArtifactClient.md) +- [DeleteArtifactResponse](interfaces/DeleteArtifactResponse.md) - [DownloadArtifactOptions](interfaces/DownloadArtifactOptions.md) - [DownloadArtifactResponse](interfaces/DownloadArtifactResponse.md) - [FindOptions](interfaces/FindOptions.md) @@ -37,4 +40,4 @@ #### Defined in -[src/artifact.ts:7](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/artifact.ts#L7) +[src/artifact.ts:7](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/artifact.ts#L7) diff --git a/packages/artifact/docs/generated/classes/ArtifactNotFoundError.md b/packages/artifact/docs/generated/classes/ArtifactNotFoundError.md index 61700bb3..8b39bd0b 100644 --- a/packages/artifact/docs/generated/classes/ArtifactNotFoundError.md +++ b/packages/artifact/docs/generated/classes/ArtifactNotFoundError.md @@ -48,7 +48,7 @@ Error.constructor #### Defined in -[src/internal/shared/errors.ts:24](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/errors.ts#L24) +[src/internal/shared/errors.ts:24](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/errors.ts#L24) ## Properties diff --git a/packages/artifact/docs/generated/classes/DefaultArtifactClient.md b/packages/artifact/docs/generated/classes/DefaultArtifactClient.md index b93afc3e..6ac11c31 100644 --- a/packages/artifact/docs/generated/classes/DefaultArtifactClient.md +++ b/packages/artifact/docs/generated/classes/DefaultArtifactClient.md @@ -16,6 +16,7 @@ The default artifact client that is used by the artifact action(s). ### Methods +- [deleteArtifact](DefaultArtifactClient.md#deleteartifact) - [downloadArtifact](DefaultArtifactClient.md#downloadartifact) - [getArtifact](DefaultArtifactClient.md#getartifact) - [listArtifacts](DefaultArtifactClient.md#listartifacts) @@ -33,6 +34,37 @@ The default artifact client that is used by the artifact action(s). ## Methods +### deleteArtifact + +▸ **deleteArtifact**(`artifactName`, `options?`): `Promise`\<[`DeleteArtifactResponse`](../interfaces/DeleteArtifactResponse.md)\> + +Delete an Artifact + +If `options.findBy` is specified, this will use the public Delete Artifact API https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#delete-an-artifact + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `artifactName` | `string` | The name of the artifact to delete | +| `options?` | [`FindOptions`](../interfaces/FindOptions.md) | Extra options that allow for the customization of the delete behavior | + +#### Returns + +`Promise`\<[`DeleteArtifactResponse`](../interfaces/DeleteArtifactResponse.md)\> + +single DeleteArtifactResponse object + +#### Implementation of + +[ArtifactClient](../interfaces/ArtifactClient.md).[deleteArtifact](../interfaces/ArtifactClient.md#deleteartifact) + +#### Defined in + +[src/internal/client.ts:248](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/client.ts#L248) + +___ + ### downloadArtifact ▸ **downloadArtifact**(`artifactId`, `options?`): `Promise`\<[`DownloadArtifactResponse`](../interfaces/DownloadArtifactResponse.md)\> @@ -45,7 +77,7 @@ If `options.findBy` is specified, this will use the public Download Artifact API | Name | Type | Description | | :------ | :------ | :------ | -| `artifactId` | `number` | The name of the artifact to download | +| `artifactId` | `number` | The id of the artifact to download | | `options?` | [`DownloadArtifactOptions`](../interfaces/DownloadArtifactOptions.md) & [`FindOptions`](../interfaces/FindOptions.md) | Extra options that allow for the customization of the download behavior | #### Returns @@ -60,7 +92,7 @@ single DownloadArtifactResponse object #### Defined in -[src/internal/client.ts:119](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L119) +[src/internal/client.ts:138](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/client.ts#L138) ___ @@ -95,7 +127,7 @@ If there are multiple artifacts with the same name in the same workflow run this #### Defined in -[src/internal/client.ts:193](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L193) +[src/internal/client.ts:212](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/client.ts#L212) ___ @@ -127,7 +159,7 @@ ListArtifactResponse object #### Defined in -[src/internal/client.ts:157](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L157) +[src/internal/client.ts:176](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/client.ts#L176) ___ @@ -158,4 +190,4 @@ single UploadArtifactResponse object #### Defined in -[src/internal/client.ts:94](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L94) +[src/internal/client.ts:113](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/client.ts#L113) diff --git a/packages/artifact/docs/generated/classes/FilesNotFoundError.md b/packages/artifact/docs/generated/classes/FilesNotFoundError.md index c7d22014..f20b608b 100644 --- a/packages/artifact/docs/generated/classes/FilesNotFoundError.md +++ b/packages/artifact/docs/generated/classes/FilesNotFoundError.md @@ -49,7 +49,7 @@ Error.constructor #### Defined in -[src/internal/shared/errors.ts:4](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/errors.ts#L4) +[src/internal/shared/errors.ts:4](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/errors.ts#L4) ## Properties @@ -59,7 +59,7 @@ Error.constructor #### Defined in -[src/internal/shared/errors.ts:2](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/errors.ts#L2) +[src/internal/shared/errors.ts:2](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/errors.ts#L2) ___ diff --git a/packages/artifact/docs/generated/classes/GHESNotSupportedError.md b/packages/artifact/docs/generated/classes/GHESNotSupportedError.md index 942ae287..63e89906 100644 --- a/packages/artifact/docs/generated/classes/GHESNotSupportedError.md +++ b/packages/artifact/docs/generated/classes/GHESNotSupportedError.md @@ -48,7 +48,7 @@ Error.constructor #### Defined in -[src/internal/shared/errors.ts:31](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/errors.ts#L31) +[src/internal/shared/errors.ts:31](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/errors.ts#L31) ## Properties diff --git a/packages/artifact/docs/generated/classes/InvalidResponseError.md b/packages/artifact/docs/generated/classes/InvalidResponseError.md index 1f6b0b5b..bd1d80cb 100644 --- a/packages/artifact/docs/generated/classes/InvalidResponseError.md +++ b/packages/artifact/docs/generated/classes/InvalidResponseError.md @@ -48,7 +48,7 @@ Error.constructor #### Defined in -[src/internal/shared/errors.ts:17](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/errors.ts#L17) +[src/internal/shared/errors.ts:17](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/errors.ts#L17) ## Properties diff --git a/packages/artifact/docs/generated/classes/NetworkError.md b/packages/artifact/docs/generated/classes/NetworkError.md new file mode 100644 index 00000000..1383b639 --- /dev/null +++ b/packages/artifact/docs/generated/classes/NetworkError.md @@ -0,0 +1,201 @@ +[@actions/artifact](../README.md) / NetworkError + +# Class: NetworkError + +## Hierarchy + +- `Error` + + ↳ **`NetworkError`** + +## Table of contents + +### Constructors + +- [constructor](NetworkError.md#constructor) + +### Properties + +- [code](NetworkError.md#code) +- [message](NetworkError.md#message) +- [name](NetworkError.md#name) +- [stack](NetworkError.md#stack) +- [prepareStackTrace](NetworkError.md#preparestacktrace) +- [stackTraceLimit](NetworkError.md#stacktracelimit) + +### Methods + +- [captureStackTrace](NetworkError.md#capturestacktrace) +- [isNetworkErrorCode](NetworkError.md#isnetworkerrorcode) + +## Constructors + +### constructor + +• **new NetworkError**(`code`): [`NetworkError`](NetworkError.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `code` | `string` | + +#### Returns + +[`NetworkError`](NetworkError.md) + +#### Overrides + +Error.constructor + +#### Defined in + +[src/internal/shared/errors.ts:42](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/errors.ts#L42) + +## Properties + +### code + +• **code**: `string` + +#### Defined in + +[src/internal/shared/errors.ts:40](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/errors.ts#L40) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +Error.message + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1068 + +___ + +### name + +• **name**: `string` + +#### Inherited from + +Error.name + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1067 + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +Error.stack + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1069 + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +Error.prepareStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:11 + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +Error.stackTraceLimit + +#### Defined in + +node_modules/@types/node/globals.d.ts:13 + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +Error.captureStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:4 + +___ + +### isNetworkErrorCode + +▸ **isNetworkErrorCode**(`code?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `code?` | `string` | + +#### Returns + +`boolean` + +#### Defined in + +[src/internal/shared/errors.ts:49](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/errors.ts#L49) diff --git a/packages/artifact/docs/generated/classes/UsageError.md b/packages/artifact/docs/generated/classes/UsageError.md new file mode 100644 index 00000000..9d7900fd --- /dev/null +++ b/packages/artifact/docs/generated/classes/UsageError.md @@ -0,0 +1,184 @@ +[@actions/artifact](../README.md) / UsageError + +# Class: UsageError + +## Hierarchy + +- `Error` + + ↳ **`UsageError`** + +## Table of contents + +### Constructors + +- [constructor](UsageError.md#constructor) + +### Properties + +- [message](UsageError.md#message) +- [name](UsageError.md#name) +- [stack](UsageError.md#stack) +- [prepareStackTrace](UsageError.md#preparestacktrace) +- [stackTraceLimit](UsageError.md#stacktracelimit) + +### Methods + +- [captureStackTrace](UsageError.md#capturestacktrace) +- [isUsageErrorMessage](UsageError.md#isusageerrormessage) + +## Constructors + +### constructor + +• **new UsageError**(): [`UsageError`](UsageError.md) + +#### Returns + +[`UsageError`](UsageError.md) + +#### Overrides + +Error.constructor + +#### Defined in + +[src/internal/shared/errors.ts:62](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/errors.ts#L62) + +## Properties + +### message + +• **message**: `string` + +#### Inherited from + +Error.message + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1068 + +___ + +### name + +• **name**: `string` + +#### Inherited from + +Error.name + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1067 + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +Error.stack + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1069 + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +Error.prepareStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:11 + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +Error.stackTraceLimit + +#### Defined in + +node_modules/@types/node/globals.d.ts:13 + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +Error.captureStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:4 + +___ + +### isUsageErrorMessage + +▸ **isUsageErrorMessage**(`msg?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `msg?` | `string` | + +#### Returns + +`boolean` + +#### Defined in + +[src/internal/shared/errors.ts:68](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/errors.ts#L68) diff --git a/packages/artifact/docs/generated/interfaces/Artifact.md b/packages/artifact/docs/generated/interfaces/Artifact.md index 1597daa5..a4cb4e17 100644 --- a/packages/artifact/docs/generated/interfaces/Artifact.md +++ b/packages/artifact/docs/generated/interfaces/Artifact.md @@ -23,7 +23,7 @@ The time when the artifact was created #### Defined in -[src/internal/shared/interfaces.ts:123](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L123) +[src/internal/shared/interfaces.ts:123](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/interfaces.ts#L123) ___ @@ -35,7 +35,7 @@ The ID of the artifact #### Defined in -[src/internal/shared/interfaces.ts:113](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L113) +[src/internal/shared/interfaces.ts:113](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/interfaces.ts#L113) ___ @@ -47,7 +47,7 @@ The name of the artifact #### Defined in -[src/internal/shared/interfaces.ts:108](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L108) +[src/internal/shared/interfaces.ts:108](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/interfaces.ts#L108) ___ @@ -59,4 +59,4 @@ The size of the artifact in bytes #### Defined in -[src/internal/shared/interfaces.ts:118](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L118) +[src/internal/shared/interfaces.ts:118](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/interfaces.ts#L118) diff --git a/packages/artifact/docs/generated/interfaces/ArtifactClient.md b/packages/artifact/docs/generated/interfaces/ArtifactClient.md index 39f7d923..cf97ff33 100644 --- a/packages/artifact/docs/generated/interfaces/ArtifactClient.md +++ b/packages/artifact/docs/generated/interfaces/ArtifactClient.md @@ -12,6 +12,7 @@ Generic interface for the artifact client. ### Methods +- [deleteArtifact](ArtifactClient.md#deleteartifact) - [downloadArtifact](ArtifactClient.md#downloadartifact) - [getArtifact](ArtifactClient.md#getartifact) - [listArtifacts](ArtifactClient.md#listartifacts) @@ -19,6 +20,33 @@ Generic interface for the artifact client. ## Methods +### deleteArtifact + +▸ **deleteArtifact**(`artifactName`, `options?`): `Promise`\<[`DeleteArtifactResponse`](DeleteArtifactResponse.md)\> + +Delete an Artifact + +If `options.findBy` is specified, this will use the public Delete Artifact API https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#delete-an-artifact + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `artifactName` | `string` | The name of the artifact to delete | +| `options?` | [`FindOptions`](FindOptions.md) | Extra options that allow for the customization of the delete behavior | + +#### Returns + +`Promise`\<[`DeleteArtifactResponse`](DeleteArtifactResponse.md)\> + +single DeleteArtifactResponse object + +#### Defined in + +[src/internal/client.ts:103](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/client.ts#L103) + +___ + ### downloadArtifact ▸ **downloadArtifact**(`artifactId`, `options?`): `Promise`\<[`DownloadArtifactResponse`](DownloadArtifactResponse.md)\> @@ -31,7 +59,7 @@ If `options.findBy` is specified, this will use the public Download Artifact API | Name | Type | Description | | :------ | :------ | :------ | -| `artifactId` | `number` | The name of the artifact to download | +| `artifactId` | `number` | The id of the artifact to download | | `options?` | [`DownloadArtifactOptions`](DownloadArtifactOptions.md) & [`FindOptions`](FindOptions.md) | Extra options that allow for the customization of the download behavior | #### Returns @@ -42,7 +70,7 @@ single DownloadArtifactResponse object #### Defined in -[src/internal/client.ts:84](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L84) +[src/internal/client.ts:89](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/client.ts#L89) ___ @@ -73,7 +101,7 @@ If there are multiple artifacts with the same name in the same workflow run this #### Defined in -[src/internal/client.ts:70](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L70) +[src/internal/client.ts:75](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/client.ts#L75) ___ @@ -101,7 +129,7 @@ ListArtifactResponse object #### Defined in -[src/internal/client.ts:52](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L52) +[src/internal/client.ts:57](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/client.ts#L57) ___ @@ -128,4 +156,4 @@ single UploadArtifactResponse object #### Defined in -[src/internal/client.ts:35](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/client.ts#L35) +[src/internal/client.ts:40](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/client.ts#L40) diff --git a/packages/artifact/docs/generated/interfaces/DeleteArtifactResponse.md b/packages/artifact/docs/generated/interfaces/DeleteArtifactResponse.md new file mode 100644 index 00000000..209b2095 --- /dev/null +++ b/packages/artifact/docs/generated/interfaces/DeleteArtifactResponse.md @@ -0,0 +1,23 @@ +[@actions/artifact](../README.md) / DeleteArtifactResponse + +# Interface: DeleteArtifactResponse + +Response from the server when deleting an artifact + +## Table of contents + +### Properties + +- [id](DeleteArtifactResponse.md#id) + +## Properties + +### id + +• **id**: `number` + +The id of the artifact that was deleted + +#### Defined in + +[src/internal/shared/interfaces.ts:158](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/interfaces.ts#L158) diff --git a/packages/artifact/docs/generated/interfaces/DownloadArtifactOptions.md b/packages/artifact/docs/generated/interfaces/DownloadArtifactOptions.md index 8eff4d8f..1b34e637 100644 --- a/packages/artifact/docs/generated/interfaces/DownloadArtifactOptions.md +++ b/packages/artifact/docs/generated/interfaces/DownloadArtifactOptions.md @@ -20,4 +20,4 @@ Denotes where the artifact will be downloaded to. If not specified then the arti #### Defined in -[src/internal/shared/interfaces.ts:98](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L98) +[src/internal/shared/interfaces.ts:98](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/interfaces.ts#L98) diff --git a/packages/artifact/docs/generated/interfaces/DownloadArtifactResponse.md b/packages/artifact/docs/generated/interfaces/DownloadArtifactResponse.md index b2220364..dd3e80bf 100644 --- a/packages/artifact/docs/generated/interfaces/DownloadArtifactResponse.md +++ b/packages/artifact/docs/generated/interfaces/DownloadArtifactResponse.md @@ -20,4 +20,4 @@ The path where the artifact was downloaded to #### Defined in -[src/internal/shared/interfaces.ts:88](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L88) +[src/internal/shared/interfaces.ts:88](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/interfaces.ts#L88) diff --git a/packages/artifact/docs/generated/interfaces/FindOptions.md b/packages/artifact/docs/generated/interfaces/FindOptions.md index 68f56706..32e0f5b7 100644 --- a/packages/artifact/docs/generated/interfaces/FindOptions.md +++ b/packages/artifact/docs/generated/interfaces/FindOptions.md @@ -27,4 +27,4 @@ The criteria for finding Artifact(s) out of the scope of the current run. #### Defined in -[src/internal/shared/interfaces.ts:131](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L131) +[src/internal/shared/interfaces.ts:131](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/interfaces.ts#L131) diff --git a/packages/artifact/docs/generated/interfaces/GetArtifactResponse.md b/packages/artifact/docs/generated/interfaces/GetArtifactResponse.md index f4d56509..8f4405ae 100644 --- a/packages/artifact/docs/generated/interfaces/GetArtifactResponse.md +++ b/packages/artifact/docs/generated/interfaces/GetArtifactResponse.md @@ -20,4 +20,4 @@ Metadata about the artifact that was found #### Defined in -[src/internal/shared/interfaces.ts:57](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L57) +[src/internal/shared/interfaces.ts:57](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/interfaces.ts#L57) diff --git a/packages/artifact/docs/generated/interfaces/ListArtifactsOptions.md b/packages/artifact/docs/generated/interfaces/ListArtifactsOptions.md index 27e3d5f7..c6a65432 100644 --- a/packages/artifact/docs/generated/interfaces/ListArtifactsOptions.md +++ b/packages/artifact/docs/generated/interfaces/ListArtifactsOptions.md @@ -21,4 +21,4 @@ In the case of reruns, this can be useful to avoid duplicates #### Defined in -[src/internal/shared/interfaces.ts:68](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L68) +[src/internal/shared/interfaces.ts:68](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/interfaces.ts#L68) diff --git a/packages/artifact/docs/generated/interfaces/ListArtifactsResponse.md b/packages/artifact/docs/generated/interfaces/ListArtifactsResponse.md index 836cbbd7..3b1ebe8e 100644 --- a/packages/artifact/docs/generated/interfaces/ListArtifactsResponse.md +++ b/packages/artifact/docs/generated/interfaces/ListArtifactsResponse.md @@ -20,4 +20,4 @@ A list of artifacts that were found #### Defined in -[src/internal/shared/interfaces.ts:78](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L78) +[src/internal/shared/interfaces.ts:78](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/interfaces.ts#L78) diff --git a/packages/artifact/docs/generated/interfaces/UploadArtifactOptions.md b/packages/artifact/docs/generated/interfaces/UploadArtifactOptions.md index acff13df..d2c07a0c 100644 --- a/packages/artifact/docs/generated/interfaces/UploadArtifactOptions.md +++ b/packages/artifact/docs/generated/interfaces/UploadArtifactOptions.md @@ -28,7 +28,7 @@ For large files that are not easily compressed, a value of 0 is recommended for #### Defined in -[src/internal/shared/interfaces.ts:47](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L47) +[src/internal/shared/interfaces.ts:47](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/interfaces.ts#L47) ___ @@ -52,4 +52,4 @@ input of 0 assumes default retention setting. #### Defined in -[src/internal/shared/interfaces.ts:36](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L36) +[src/internal/shared/interfaces.ts:36](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/interfaces.ts#L36) diff --git a/packages/artifact/docs/generated/interfaces/UploadArtifactResponse.md b/packages/artifact/docs/generated/interfaces/UploadArtifactResponse.md index 574366fc..ea98efb0 100644 --- a/packages/artifact/docs/generated/interfaces/UploadArtifactResponse.md +++ b/packages/artifact/docs/generated/interfaces/UploadArtifactResponse.md @@ -22,7 +22,7 @@ This ID can be used as input to other APIs to download, delete or get more infor #### Defined in -[src/internal/shared/interfaces.ts:14](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L14) +[src/internal/shared/interfaces.ts:14](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/interfaces.ts#L14) ___ @@ -34,4 +34,4 @@ Total size of the artifact in bytes. Not provided if no artifact was uploaded #### Defined in -[src/internal/shared/interfaces.ts:8](https://github.com/actions/toolkit/blob/e3764a5/packages/artifact/src/internal/shared/interfaces.ts#L8) +[src/internal/shared/interfaces.ts:8](https://github.com/actions/toolkit/blob/daf23ba/packages/artifact/src/internal/shared/interfaces.ts#L8) diff --git a/packages/artifact/package.json b/packages/artifact/package.json index 3dfa461a..b25a30af 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -1,6 +1,6 @@ { "name": "@actions/artifact", - "version": "2.0.1", + "version": "2.1.0", "preview": true, "description": "Actions artifact lib", "keywords": [ @@ -62,4 +62,4 @@ "typedoc-plugin-markdown": "^3.17.1", "typescript": "^5.2.2" } -} \ No newline at end of file +} From cca96584eb4a246c50525990eb9e47d513a3ef7c Mon Sep 17 00:00:00 2001 From: eggyhead <28715808+eggyhead@users.noreply.github.com> Date: Thu, 18 Jan 2024 15:57:21 +0000 Subject: [PATCH 111/198] removing newline and camelcasing GitHub --- packages/artifact/src/internal/find/get-artifact.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/artifact/src/internal/find/get-artifact.ts b/packages/artifact/src/internal/find/get-artifact.ts index cbc5f137..900f9b8d 100644 --- a/packages/artifact/src/internal/find/get-artifact.ts +++ b/packages/artifact/src/internal/find/get-artifact.ts @@ -49,9 +49,9 @@ export async function getArtifactPublic( if (getArtifactResp.data.artifacts.length === 0) { throw new ArtifactNotFoundError( - `Artifact not found for name: ${artifactName}\n - Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact.\n - For more information, visit the Github Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md` + `Artifact not found for name: ${artifactName} + Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact. + For more information, visit the GitHub Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md` ) } @@ -91,9 +91,9 @@ export async function getArtifactInternal( if (res.artifacts.length === 0) { throw new ArtifactNotFoundError( - `Artifact not found for name: ${artifactName}\n - Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact.\n - For more information, visit the Github Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md` + `Artifact not found for name: ${artifactName} + Please ensure that your artifact is not expired and the artifact was uploaded using a compatible version of toolkit/upload-artifact. + For more information, visit the GitHub Artifacts FAQ: https://github.com/actions/toolkit/blob/main/packages/artifact/docs/faq.md` ) } From 017d757dd40c2deadf4b19f3bf44951001f21e94 Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Thu, 18 Jan 2024 11:07:25 -0500 Subject: [PATCH 112/198] update releases.md --- packages/artifact/RELEASES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/artifact/RELEASES.md b/packages/artifact/RELEASES.md index 27cd74a3..e4bc0c1f 100644 --- a/packages/artifact/RELEASES.md +++ b/packages/artifact/RELEASES.md @@ -109,3 +109,4 @@ ### 2.1.0 - Added `ArtifactClient#deleteArtifact` to delete artifacts by name [#1626](https://github.com/actions/toolkit/pull/1626) +- Update error messaging to be more useful [#1628](https://github.com/actions/toolkit/pull/1628) From 8e13afa0db32ab68f57f16f93a6fd48f32805b96 Mon Sep 17 00:00:00 2001 From: eggyhead <28715808+eggyhead@users.noreply.github.com> Date: Thu, 18 Jan 2024 17:32:19 +0000 Subject: [PATCH 113/198] updating language and adding compatibility table --- packages/artifact/docs/faq.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/artifact/docs/faq.md b/packages/artifact/docs/faq.md index 22e518f5..de4fbf4d 100644 --- a/packages/artifact/docs/faq.md +++ b/packages/artifact/docs/faq.md @@ -37,7 +37,12 @@ Higher levels will result in better compression, but will take longer to complet For large files that are not easily compressed, a value of 0 is recommended for significantly faster uploads. ## Which versions of the artifacts packages are compatible? -[actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact), are part of the [GitHub Actions toolkit](https://github.com/actions/toolkit) and are typically used together to upload and download artifacts in your workflows. +[actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact), leverage [GitHub Actions toolkit](https://github.com/actions/toolkit) and are typically used together to upload and download artifacts in your workflows. + +| upload-artifact | download-artifact | toolkit | +|---|---|---| +| v4 | v4 | v2 | +| Date: Thu, 18 Jan 2024 17:33:39 +0000 Subject: [PATCH 114/198] bold text --- packages/artifact/docs/faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/docs/faq.md b/packages/artifact/docs/faq.md index de4fbf4d..84f6dcb1 100644 --- a/packages/artifact/docs/faq.md +++ b/packages/artifact/docs/faq.md @@ -60,4 +60,4 @@ For large files that are not easily compressed, a value of 0 is recommended for - Check the release notes for each repository to see if there are any specific notes about compatibility or changes in behavior. ## How long will my artifact be available? -The default retention period is 90 days. For more information, visit: https://github.com/actions/upload-artifact?tab=readme-ov-file#retention-period +The default retention period is **90 days**. For more information, visit: https://github.com/actions/upload-artifact?tab=readme-ov-file#retention-period From dbfca0275d21588d16c8a0a8effabe86fb0a8c08 Mon Sep 17 00:00:00 2001 From: eggyhead <28715808+eggyhead@users.noreply.github.com> Date: Thu, 18 Jan 2024 17:35:08 +0000 Subject: [PATCH 115/198] removing numbered list --- packages/artifact/docs/faq.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/artifact/docs/faq.md b/packages/artifact/docs/faq.md index 84f6dcb1..427180f4 100644 --- a/packages/artifact/docs/faq.md +++ b/packages/artifact/docs/faq.md @@ -44,11 +44,9 @@ For large files that are not easily compressed, a value of 0 is recommended for | v4 | v4 | v2 | | Date: Thu, 18 Jan 2024 17:36:26 +0000 Subject: [PATCH 116/198] yaml formatting --- packages/artifact/docs/faq.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/artifact/docs/faq.md b/packages/artifact/docs/faq.md index 427180f4..861f492c 100644 --- a/packages/artifact/docs/faq.md +++ b/packages/artifact/docs/faq.md @@ -44,15 +44,16 @@ For large files that are not easily compressed, a value of 0 is recommended for | v4 | v4 | v2 | | Date: Fri, 19 Jan 2024 08:37:38 -0800 Subject: [PATCH 117/198] Update packages/artifact/docs/faq.md Consistent spacing in version table Co-authored-by: Bethany --- packages/artifact/docs/faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/docs/faq.md b/packages/artifact/docs/faq.md index 861f492c..d784508e 100644 --- a/packages/artifact/docs/faq.md +++ b/packages/artifact/docs/faq.md @@ -42,7 +42,7 @@ For large files that are not easily compressed, a value of 0 is recommended for | upload-artifact | download-artifact | toolkit | |---|---|---| | v4 | v4 | v2 | -| Date: Tue, 30 Jan 2024 21:55:50 +0000 Subject: [PATCH 118/198] updating alowed hosts in isGhes check updating alowed hosts in artifact ghes check using dot prepend ghe host --- packages/artifact/__tests__/config.test.ts | 29 +++++++++++++++++++ .../artifact/src/internal/shared/config.ts | 7 ++++- packages/cache/__tests__/cacheUtils.test.ts | 24 +++++++++++++++ packages/cache/src/internal/cacheUtils.ts | 7 ++++- 4 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 packages/artifact/__tests__/config.test.ts diff --git a/packages/artifact/__tests__/config.test.ts b/packages/artifact/__tests__/config.test.ts new file mode 100644 index 00000000..d1d86049 --- /dev/null +++ b/packages/artifact/__tests__/config.test.ts @@ -0,0 +1,29 @@ +import * as config from '../src/internal/shared/config' + + +beforeEach(() => { + jest.resetModules() + }); + + +describe('isGhes', () => { + it('should return false when the request domain is github.com', () => { + process.env.GITHUB_SERVER_URL = 'https://github.com' + expect(config.isGhes()).toBe(false) + }) + + it('should return false when the request domain ends with ghe.com', () => { + process.env.GITHUB_SERVER_URL = 'https://my.domain.ghe.com' + expect(config.isGhes()).toBe(false) + }) + + it('should return false when the request domain ends with ghe.localhost', () => { + process.env.GITHUB_SERVER_URL = 'https://my.domain.ghe.localhost' + expect(config.isGhes()).toBe(false) + }) + + it('should return false when the request domain is specific to an enterprise', () => { + process.env.GITHUB_SERVER_URL = 'https://my-enterprise.github.com' + expect(config.isGhes()).toBe(true) + }) +}) \ No newline at end of file diff --git a/packages/artifact/src/internal/shared/config.ts b/packages/artifact/src/internal/shared/config.ts index a5631bfc..fc39a1c9 100644 --- a/packages/artifact/src/internal/shared/config.ts +++ b/packages/artifact/src/internal/shared/config.ts @@ -27,7 +27,12 @@ export function isGhes(): boolean { const ghUrl = new URL( process.env['GITHUB_SERVER_URL'] || 'https://github.com' ) - return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM' + + const hostname = ghUrl.hostname.trimEnd().toUpperCase() + const isGitHubHost = (hostname == 'GITHUB.COM') + const isGheHost = (hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST')) + + return !isGitHubHost && !isGheHost } export function getGitHubWorkspaceDir(): string { diff --git a/packages/cache/__tests__/cacheUtils.test.ts b/packages/cache/__tests__/cacheUtils.test.ts index 25124b46..9a4166cb 100644 --- a/packages/cache/__tests__/cacheUtils.test.ts +++ b/packages/cache/__tests__/cacheUtils.test.ts @@ -2,6 +2,10 @@ import {promises as fs} from 'fs' import * as path from 'path' import * as cacheUtils from '../src/internal/cacheUtils' +beforeEach(() => { + jest.resetModules() +}); + test('getArchiveFileSizeInBytes returns file size', () => { const filePath = path.join(__dirname, '__fixtures__', 'helloWorld.txt') @@ -38,3 +42,23 @@ test('resolvePaths works on github workspace directory', async () => { const paths = await cacheUtils.resolvePaths([workspace]) expect(paths.length).toBeGreaterThan(0) }) + +test('isGhes returns false for github.com', async () => { + process.env.GITHUB_SERVER_URL = 'https://github.com' + expect(cacheUtils.isGhes()).toBe(false) +}) + +test('isGhes returns false for ghe.com', async () => { + process.env.GITHUB_SERVER_URL = 'https://somedomain.ghe.com' + expect(cacheUtils.isGhes()).toBe(false) +}) + +test('isGhes returns true for enterprise URL', async () => { + process.env.GITHUB_SERVER_URL = 'https://my-enterprise.github.com' + expect(cacheUtils.isGhes()).toBe(true) +}) + +test('isGhes returns false for ghe.localhost', () => { + process.env.GITHUB_SERVER_URL = 'https://my.domain.ghe.localhost' + expect(cacheUtils.isGhes()).toBe(false) +}) \ No newline at end of file diff --git a/packages/cache/src/internal/cacheUtils.ts b/packages/cache/src/internal/cacheUtils.ts index 650653ad..8bc3ce23 100644 --- a/packages/cache/src/internal/cacheUtils.ts +++ b/packages/cache/src/internal/cacheUtils.ts @@ -135,5 +135,10 @@ export function isGhes(): boolean { const ghUrl = new URL( process.env['GITHUB_SERVER_URL'] || 'https://github.com' ) - return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM' + + const hostname = ghUrl.hostname.trimEnd().toUpperCase() + const isGitHubHost = (hostname == 'GITHUB.COM') + const isGheHost = (hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST')) + + return !isGitHubHost && !isGheHost } From d134334a38ef2fe178400557e6ff979534e32ebc Mon Sep 17 00:00:00 2001 From: eggyhead <28715808+eggyhead@users.noreply.github.com> Date: Wed, 31 Jan 2024 16:51:04 +0000 Subject: [PATCH 119/198] lint fixes --- packages/artifact/__tests__/config.test.ts | 40 +++++++++---------- .../artifact/src/internal/shared/config.ts | 5 ++- packages/cache/__tests__/cacheUtils.test.ts | 6 +-- packages/cache/src/internal/cacheUtils.ts | 5 ++- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/packages/artifact/__tests__/config.test.ts b/packages/artifact/__tests__/config.test.ts index d1d86049..5afed94d 100644 --- a/packages/artifact/__tests__/config.test.ts +++ b/packages/artifact/__tests__/config.test.ts @@ -1,29 +1,27 @@ import * as config from '../src/internal/shared/config' - beforeEach(() => { - jest.resetModules() - }); - + jest.resetModules() +}) describe('isGhes', () => { - it('should return false when the request domain is github.com', () => { - process.env.GITHUB_SERVER_URL = 'https://github.com' - expect(config.isGhes()).toBe(false) - }) + it('should return false when the request domain is github.com', () => { + process.env.GITHUB_SERVER_URL = 'https://github.com' + expect(config.isGhes()).toBe(false) + }) - it('should return false when the request domain ends with ghe.com', () => { - process.env.GITHUB_SERVER_URL = 'https://my.domain.ghe.com' - expect(config.isGhes()).toBe(false) - }) + it('should return false when the request domain ends with ghe.com', () => { + process.env.GITHUB_SERVER_URL = 'https://my.domain.ghe.com' + expect(config.isGhes()).toBe(false) + }) - it('should return false when the request domain ends with ghe.localhost', () => { - process.env.GITHUB_SERVER_URL = 'https://my.domain.ghe.localhost' - expect(config.isGhes()).toBe(false) - }) + it('should return false when the request domain ends with ghe.localhost', () => { + process.env.GITHUB_SERVER_URL = 'https://my.domain.ghe.localhost' + expect(config.isGhes()).toBe(false) + }) - it('should return false when the request domain is specific to an enterprise', () => { - process.env.GITHUB_SERVER_URL = 'https://my-enterprise.github.com' - expect(config.isGhes()).toBe(true) - }) -}) \ No newline at end of file + it('should return false when the request domain is specific to an enterprise', () => { + process.env.GITHUB_SERVER_URL = 'https://my-enterprise.github.com' + expect(config.isGhes()).toBe(true) + }) +}) diff --git a/packages/artifact/src/internal/shared/config.ts b/packages/artifact/src/internal/shared/config.ts index fc39a1c9..089fae14 100644 --- a/packages/artifact/src/internal/shared/config.ts +++ b/packages/artifact/src/internal/shared/config.ts @@ -29,8 +29,9 @@ export function isGhes(): boolean { ) const hostname = ghUrl.hostname.trimEnd().toUpperCase() - const isGitHubHost = (hostname == 'GITHUB.COM') - const isGheHost = (hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST')) + const isGitHubHost = hostname === 'GITHUB.COM' + const isGheHost = + hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST') return !isGitHubHost && !isGheHost } diff --git a/packages/cache/__tests__/cacheUtils.test.ts b/packages/cache/__tests__/cacheUtils.test.ts index 9a4166cb..4388026a 100644 --- a/packages/cache/__tests__/cacheUtils.test.ts +++ b/packages/cache/__tests__/cacheUtils.test.ts @@ -3,8 +3,8 @@ import * as path from 'path' import * as cacheUtils from '../src/internal/cacheUtils' beforeEach(() => { - jest.resetModules() -}); + jest.resetModules() +}) test('getArchiveFileSizeInBytes returns file size', () => { const filePath = path.join(__dirname, '__fixtures__', 'helloWorld.txt') @@ -61,4 +61,4 @@ test('isGhes returns true for enterprise URL', async () => { test('isGhes returns false for ghe.localhost', () => { process.env.GITHUB_SERVER_URL = 'https://my.domain.ghe.localhost' expect(cacheUtils.isGhes()).toBe(false) -}) \ No newline at end of file +}) diff --git a/packages/cache/src/internal/cacheUtils.ts b/packages/cache/src/internal/cacheUtils.ts index 8bc3ce23..91bae9a8 100644 --- a/packages/cache/src/internal/cacheUtils.ts +++ b/packages/cache/src/internal/cacheUtils.ts @@ -137,8 +137,9 @@ export function isGhes(): boolean { ) const hostname = ghUrl.hostname.trimEnd().toUpperCase() - const isGitHubHost = (hostname == 'GITHUB.COM') - const isGheHost = (hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST')) + const isGitHubHost = hostname === 'GITHUB.COM' + const isGheHost = + hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST') return !isGitHubHost && !isGheHost } From c4f4f5ae0716be0a39c150667d784df112a36168 Mon Sep 17 00:00:00 2001 From: eggyhead <28715808+eggyhead@users.noreply.github.com> Date: Wed, 31 Jan 2024 21:15:11 +0000 Subject: [PATCH 120/198] updating artifact version and release to include ghes check change --- packages/artifact/RELEASES.md | 4 ++++ packages/artifact/package-lock.json | 4 ++-- packages/artifact/package.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/artifact/RELEASES.md b/packages/artifact/RELEASES.md index e4bc0c1f..9e14a6b6 100644 --- a/packages/artifact/RELEASES.md +++ b/packages/artifact/RELEASES.md @@ -110,3 +110,7 @@ - Added `ArtifactClient#deleteArtifact` to delete artifacts by name [#1626](https://github.com/actions/toolkit/pull/1626) - Update error messaging to be more useful [#1628](https://github.com/actions/toolkit/pull/1628) + +### 2.1.1 + +- Updated `isGhes` check to include `.ghe.com` and `.ghe.localhost` as accepted hosts \ No newline at end of file diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index 5750628e..550cbb01 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -1,12 +1,12 @@ { "name": "@actions/artifact", - "version": "2.0.1", + "version": "2.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@actions/artifact", - "version": "2.0.1", + "version": "2.1.1", "license": "MIT", "dependencies": { "@actions/core": "^1.10.0", diff --git a/packages/artifact/package.json b/packages/artifact/package.json index b25a30af..a5f6ad10 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -1,6 +1,6 @@ { "name": "@actions/artifact", - "version": "2.1.0", + "version": "2.1.1", "preview": true, "description": "Actions artifact lib", "keywords": [ From c500de6dea44f328b2c654ff8174191450e19d42 Mon Sep 17 00:00:00 2001 From: eggyhead <28715808+eggyhead@users.noreply.github.com> Date: Wed, 31 Jan 2024 21:19:20 +0000 Subject: [PATCH 121/198] updating cache version and release to include ghes check change Revert "updating cache version and release to include ghes check change" This reverts commit 7185d8964514361b7b8dcdba1f9dd54ef24b8bdd. updating cache version and release to include ghes check change --- packages/cache/RELEASES.md | 4 ++++ packages/cache/package-lock.json | 4 ++-- packages/cache/package.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/cache/RELEASES.md b/packages/cache/RELEASES.md index 43cbfef9..23791046 100644 --- a/packages/cache/RELEASES.md +++ b/packages/cache/RELEASES.md @@ -168,3 +168,7 @@ ### 3.2.3 - Fixed a bug that mutated path arguments to `getCacheVersion` [#1378](https://github.com/actions/toolkit/pull/1378) + +### 3.2.4 + +- Updated `isGhes` check to include `.ghe.com` and `.ghe.localhost` as accepted hosts \ No newline at end of file diff --git a/packages/cache/package-lock.json b/packages/cache/package-lock.json index 31a81013..422f2264 100644 --- a/packages/cache/package-lock.json +++ b/packages/cache/package-lock.json @@ -1,12 +1,12 @@ { "name": "@actions/cache", - "version": "3.2.2", + "version": "3.2.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@actions/cache", - "version": "3.2.2", + "version": "3.2.4", "license": "MIT", "dependencies": { "@actions/core": "^1.10.0", diff --git a/packages/cache/package.json b/packages/cache/package.json index 8be7c740..d3251083 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -1,6 +1,6 @@ { "name": "@actions/cache", - "version": "3.2.3", + "version": "3.2.4", "preview": true, "description": "Actions cache lib", "keywords": [ From 415c42d27ca2a24f3801dd9406344aaea00b7866 Mon Sep 17 00:00:00 2001 From: Konrad Pabjan Date: Thu, 1 Feb 2024 12:50:47 -0500 Subject: [PATCH 122/198] Update workflows to use v4 actions (#1652) * Update releases.yml to use v4 actions * Bump all workflows --- .github/workflows/audit.yml | 4 ++-- .github/workflows/cache-tests.yml | 4 ++-- .github/workflows/codeql.yml | 2 +- .github/workflows/releases.yml | 8 ++++---- .github/workflows/unit-tests.yml | 4 ++-- .github/workflows/update-github.yaml | 2 +- docs/action-types.md | 2 +- docs/container-action.md | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 6e492488..a8f5be4a 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -18,10 +18,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set Node.js 20.x - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 20.x diff --git a/.github/workflows/cache-tests.yml b/.github/workflows/cache-tests.yml index e05362a3..dfe89f68 100644 --- a/.github/workflows/cache-tests.yml +++ b/.github/workflows/cache-tests.yml @@ -22,10 +22,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set Node.js 20.x - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 20.x diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 4b44be98..4ebb4ef3 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 13d494f2..e63d8185 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -13,13 +13,13 @@ jobs: steps: - name: setup repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: verify package exists run: ls packages/${{ github.event.inputs.package }} - name: Set Node.js 20.x - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 20.x @@ -40,7 +40,7 @@ jobs: working-directory: packages/${{ github.event.inputs.package }} - name: upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ github.event.inputs.package }} path: packages/${{ github.event.inputs.package }}/*.tgz @@ -52,7 +52,7 @@ jobs: steps: - name: download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ github.event.inputs.package }} diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 453f9bcc..952fa6b2 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -23,10 +23,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set Node.js 20.x - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 20.x diff --git a/.github/workflows/update-github.yaml b/.github/workflows/update-github.yaml index 6de4eed2..5be06447 100644 --- a/.github/workflows/update-github.yaml +++ b/.github/workflows/update-github.yaml @@ -9,7 +9,7 @@ jobs: if: ${{ github.repository_owner == 'actions' }} steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Update Octokit working-directory: packages/github run: | diff --git a/docs/action-types.md b/docs/action-types.md index 299ce76a..a8cdb83d 100644 --- a/docs/action-types.md +++ b/docs/action-types.md @@ -32,7 +32,7 @@ jobs: os: [ubuntu-16.04, windows-2019] runs-on: ${{matrix.os}} actions: - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: version: ${{matrix.node}} - run: | diff --git a/docs/container-action.md b/docs/container-action.md index 06f3a246..83742ee1 100644 --- a/docs/container-action.md +++ b/docs/container-action.md @@ -18,7 +18,7 @@ e.g. To use https://github.com/actions/setup-node, users will author: ```yaml steps: - using: actions/setup-node@v3 + using: actions/setup-node@v4 ``` # Define Metadata From bc5b3a85ae98c7ef52f354703f87e9b94c85ea61 Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Thu, 22 Feb 2024 17:16:32 -0500 Subject: [PATCH 123/198] use on entry --- packages/artifact/__tests__/download-artifact.test.ts | 5 +++-- .../artifact/src/internal/download/download-artifact.ts | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index 1c0c9b0d..7d8fead5 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -13,7 +13,7 @@ import { streamExtractExternal } from '../src/internal/download/download-artifact' import {getUserAgentString} from '../src/internal/shared/user-agent' -import {noopLogs} from './common' +//import {noopLogs} from './common' import * as config from '../src/internal/shared/config' import {ArtifactServiceClientJSON} from '../src/generated' import * as util from '../src/internal/shared/util' @@ -83,12 +83,13 @@ const createTestArchive = async (): Promise => { const expectExtractedArchive = async (dir: string): Promise => { for (const file of fixtures.exampleArtifact.files) { const filePath = path.join(dir, file.path) + console.log('Checking file:', filePath) expect(fs.readFileSync(filePath, 'utf8')).toEqual(file.content) } } const setup = async (): Promise => { - noopLogs() + //noopLogs() await fs.promises.mkdir(testDir, {recursive: true}) await createTestArchive() diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index dc54f6fe..995dbafb 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -1,4 +1,6 @@ import fs from 'fs/promises' +import {createWriteStream} from 'fs' +import * as path from 'path' import * as github from '@actions/github' import * as core from '@actions/core' import * as httpClient from '@actions/http-client' @@ -89,7 +91,12 @@ export async function streamExtractExternal( clearTimeout(timer) reject(error) }) - .pipe(unzip.Extract({path: directory})) + .pipe(unzip.Parse()) + .on('entry', (entry: unzip.Entry) => { + const fullPath = path.normalize(path.join(directory, entry.path)) + core.debug(`Extracting artifact entry: ${fullPath}`) + entry.pipe(createWriteStream(fullPath)) + }) .on('close', () => { clearTimeout(timer) resolve() From 81d5e48db0a475d61abc3e79f8640b26f515ebcb Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Thu, 22 Feb 2024 17:51:15 -0500 Subject: [PATCH 124/198] update tests --- packages/artifact/__tests__/download-artifact.test.ts | 4 ++-- packages/artifact/src/internal/download/download-artifact.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index 7d8fead5..574f6b15 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -13,7 +13,7 @@ import { streamExtractExternal } from '../src/internal/download/download-artifact' import {getUserAgentString} from '../src/internal/shared/user-agent' -//import {noopLogs} from './common' +import {noopLogs} from './common' import * as config from '../src/internal/shared/config' import {ArtifactServiceClientJSON} from '../src/generated' import * as util from '../src/internal/shared/util' @@ -89,7 +89,7 @@ const expectExtractedArchive = async (dir: string): Promise => { } const setup = async (): Promise => { - //noopLogs() + noopLogs() await fs.promises.mkdir(testDir, {recursive: true}) await createTestArchive() diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 995dbafb..a06dcf28 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -97,7 +97,7 @@ export async function streamExtractExternal( core.debug(`Extracting artifact entry: ${fullPath}`) entry.pipe(createWriteStream(fullPath)) }) - .on('close', () => { + .on('end', () => { clearTimeout(timer) resolve() }) From b956d8a4dd9857695d632371161695cc5aa1b4ef Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Thu, 22 Feb 2024 17:55:53 -0500 Subject: [PATCH 125/198] audit, lint, format --- package-lock.json | 6 +++--- packages/artifact/__tests__/download-artifact.test.ts | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1d43fbf3..7575e429 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6664,9 +6664,9 @@ } }, "node_modules/ip": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", - "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz", + "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==", "dev": true }, "node_modules/is-array-buffer": { diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index 574f6b15..1c0c9b0d 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -83,7 +83,6 @@ const createTestArchive = async (): Promise => { const expectExtractedArchive = async (dir: string): Promise => { for (const file of fixtures.exampleArtifact.files) { const filePath = path.join(dir, file.path) - console.log('Checking file:', filePath) expect(fs.readFileSync(filePath, 'utf8')).toEqual(file.content) } } From 9dea373bba6cf394ffc1a74b7129ffdd68034e5c Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Thu, 22 Feb 2024 20:29:42 -0500 Subject: [PATCH 126/198] wait for upload to finish --- .../src/internal/download/download-artifact.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index a06dcf28..9d337043 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -80,6 +80,7 @@ export async function streamExtractExternal( } const timer = setTimeout(timerFn, timeout) + const promises: Promise[] = [] response.message .on('data', () => { timer.refresh() @@ -95,11 +96,18 @@ export async function streamExtractExternal( .on('entry', (entry: unzip.Entry) => { const fullPath = path.normalize(path.join(directory, entry.path)) core.debug(`Extracting artifact entry: ${fullPath}`) - entry.pipe(createWriteStream(fullPath)) + const writeStream = createWriteStream(fullPath) + promises.push(new Promise((resolve, reject) => { + writeStream.on('finish', () => resolve()) + writeStream.on('error', reject) + })) + entry.pipe(writeStream) }) .on('end', () => { clearTimeout(timer) - resolve() + Promise.all(promises) + .then(() => resolve()) + .catch(error => reject(error)) }) .on('error', (error: Error) => { reject(error) From 31c555afdae9db6cc687cc4913b371f6dd1be64e Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Thu, 22 Feb 2024 20:31:49 -0500 Subject: [PATCH 127/198] prettier --- .../src/internal/download/download-artifact.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 9d337043..ef4d3fca 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -97,10 +97,12 @@ export async function streamExtractExternal( const fullPath = path.normalize(path.join(directory, entry.path)) core.debug(`Extracting artifact entry: ${fullPath}`) const writeStream = createWriteStream(fullPath) - promises.push(new Promise((resolve, reject) => { - writeStream.on('finish', () => resolve()) - writeStream.on('error', reject) - })) + promises.push( + new Promise((resolve, reject) => { + writeStream.on('finish', () => resolve()) + writeStream.on('error', reject) + }) + ) entry.pipe(writeStream) }) .on('end', () => { From a24b9c018472b37d4672b1e9e956f5d6b59d6e76 Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Thu, 22 Feb 2024 21:54:54 -0500 Subject: [PATCH 128/198] handle directories --- .../internal/download/download-artifact.ts | 47 +++++++++++++------ 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index ef4d3fca..5e893b4c 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -72,7 +72,7 @@ export async function streamExtractExternal( const timeout = 30 * 1000 // 30 seconds - return new Promise((resolve, reject) => { + return new Promise(async (resolve, reject) => { const timerFn = (): void => { response.message.destroy( new Error(`Blob storage chunk did not respond in ${timeout}ms`) @@ -93,23 +93,42 @@ export async function streamExtractExternal( reject(error) }) .pipe(unzip.Parse()) - .on('entry', (entry: unzip.Entry) => { + .on('entry', async (entry: unzip.Entry) => { const fullPath = path.normalize(path.join(directory, entry.path)) core.debug(`Extracting artifact entry: ${fullPath}`) - const writeStream = createWriteStream(fullPath) - promises.push( - new Promise((resolve, reject) => { - writeStream.on('finish', () => resolve()) - writeStream.on('error', reject) - }) - ) - entry.pipe(writeStream) + if (entry.type === 'Directory') { + if (!(await exists(fullPath))) { + await fs.mkdir(fullPath, {recursive: true}) + } + entry.autodrain() + } else { + if (!(await exists(path.dirname(fullPath)))) { + await fs.mkdir(path.dirname(fullPath), {recursive: true}) + } + const writeStream = createWriteStream(fullPath) + promises.push( + new Promise((resolve, reject) => { + writeStream.on('finish', () => { + console.log(`Finished writing ${fullPath}`) + resolve() + }) + writeStream.on('error', reject) + }) + ) + entry.pipe(writeStream) + } }) - .on('end', () => { + .on('end', async () => { + console.log('All entries have been extracted') clearTimeout(timer) - Promise.all(promises) - .then(() => resolve()) - .catch(error => reject(error)) + try { + console.log('Waiting for all write streams to finish') + await Promise.all(promises) + console.log('All write streams have finished') + resolve() + } catch (error) { + reject(error) + } }) .on('error', (error: Error) => { reject(error) From 83731e6528966f6dccc8284d5eea8c528a635f02 Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Thu, 22 Feb 2024 22:06:32 -0500 Subject: [PATCH 129/198] remove awaits from on entry --- .../src/internal/download/download-artifact.ts | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 5e893b4c..cd2f8490 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -72,7 +72,7 @@ export async function streamExtractExternal( const timeout = 30 * 1000 // 30 seconds - return new Promise(async (resolve, reject) => { + return new Promise((resolve, reject) => { const timerFn = (): void => { response.message.destroy( new Error(`Blob storage chunk did not respond in ${timeout}ms`) @@ -93,23 +93,17 @@ export async function streamExtractExternal( reject(error) }) .pipe(unzip.Parse()) - .on('entry', async (entry: unzip.Entry) => { + .on('entry', (entry: unzip.Entry) => { const fullPath = path.normalize(path.join(directory, entry.path)) core.debug(`Extracting artifact entry: ${fullPath}`) if (entry.type === 'Directory') { - if (!(await exists(fullPath))) { - await fs.mkdir(fullPath, {recursive: true}) - } + promises.push(fs.mkdir(fullPath, {recursive: true}).then(() => {})) entry.autodrain() } else { - if (!(await exists(path.dirname(fullPath)))) { - await fs.mkdir(path.dirname(fullPath), {recursive: true}) - } const writeStream = createWriteStream(fullPath) promises.push( new Promise((resolve, reject) => { writeStream.on('finish', () => { - console.log(`Finished writing ${fullPath}`) resolve() }) writeStream.on('error', reject) @@ -119,12 +113,9 @@ export async function streamExtractExternal( } }) .on('end', async () => { - console.log('All entries have been extracted') clearTimeout(timer) try { - console.log('Waiting for all write streams to finish') await Promise.all(promises) - console.log('All write streams have finished') resolve() } catch (error) { reject(error) From 1e326de4744cd44f766a6a1ca03f6fcb532a9fcc Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Fri, 23 Feb 2024 08:28:37 -0500 Subject: [PATCH 130/198] use existing function --- packages/artifact/src/internal/download/download-artifact.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index cd2f8490..f040d2f5 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -97,9 +97,12 @@ export async function streamExtractExternal( const fullPath = path.normalize(path.join(directory, entry.path)) core.debug(`Extracting artifact entry: ${fullPath}`) if (entry.type === 'Directory') { - promises.push(fs.mkdir(fullPath, {recursive: true}).then(() => {})) + promises.push(resolveOrCreateDirectory(fullPath).then(() => {})) entry.autodrain() } else { + promises.push( + resolveOrCreateDirectory(path.dirname(fullPath)).then(() => {}) + ) const writeStream = createWriteStream(fullPath) promises.push( new Promise((resolve, reject) => { From d3301c9bc26a357dff44590e92f2918ef7e48b31 Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Fri, 23 Feb 2024 08:42:23 -0500 Subject: [PATCH 131/198] update path parsing --- packages/artifact/src/internal/download/download-artifact.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index f040d2f5..62e8577e 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -94,7 +94,8 @@ export async function streamExtractExternal( }) .pipe(unzip.Parse()) .on('entry', (entry: unzip.Entry) => { - const fullPath = path.normalize(path.join(directory, entry.path)) + const entryPath = path.normalize(entry.path).replace(/^(\.\.(\/|\\|$))+/, '') + const fullPath = path.join(directory, entryPath) core.debug(`Extracting artifact entry: ${fullPath}`) if (entry.type === 'Directory') { promises.push(resolveOrCreateDirectory(fullPath).then(() => {})) From 8d03fb4787403d2c678f74684d842bcb24540b60 Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Fri, 23 Feb 2024 08:46:56 -0500 Subject: [PATCH 132/198] prettier --- packages/artifact/src/internal/download/download-artifact.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 62e8577e..358044f1 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -94,7 +94,9 @@ export async function streamExtractExternal( }) .pipe(unzip.Parse()) .on('entry', (entry: unzip.Entry) => { - const entryPath = path.normalize(entry.path).replace(/^(\.\.(\/|\\|$))+/, '') + const entryPath = path + .normalize(entry.path) + .replace(/^(\.\.(\/|\\|$))+/, '') const fullPath = path.join(directory, entryPath) core.debug(`Extracting artifact entry: ${fullPath}`) if (entry.type === 'Directory') { From e9005f772745209f88df5406a2491964465596af Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Fri, 23 Feb 2024 10:54:12 -0500 Subject: [PATCH 133/198] ensure no path traversal --- .../__tests__/download-artifact.test.ts | 57 ++++++++++++++++++ packages/artifact/__tests__/fixtures/evil.zip | Bin 0 -> 238 bytes 2 files changed, 57 insertions(+) create mode 100644 packages/artifact/__tests__/fixtures/evil.zip diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index 1c0c9b0d..a593c709 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -121,6 +121,16 @@ const mockGetArtifactFailure = jest.fn(() => { } }) +const mockGetArtifactMalicious = jest.fn(() => { + const message = new http.IncomingMessage(new net.Socket()) + message.statusCode = 200 + message.push(fs.readFileSync(path.join(__dirname, 'fixtures', 'evil.zip'))) + message.push(null) + return { + message + } +}) + describe('download-artifact', () => { describe('public', () => { beforeEach(setup) @@ -170,6 +180,53 @@ describe('download-artifact', () => { expect(response.downloadPath).toBe(fixtures.workspaceDir) }) + it('should not allow path traversal from malicious artifacts', async () => { + const downloadArtifactMock = github.getOctokit(fixtures.token).rest + .actions.downloadArtifact as MockedDownloadArtifact + downloadArtifactMock.mockResolvedValueOnce({ + headers: { + location: fixtures.blobStorageUrl + }, + status: 302, + url: '', + data: Buffer.from('') + }) + + const mockHttpClient = (HttpClient as jest.Mock).mockImplementation( + () => { + return { + get: mockGetArtifactMalicious + } + } + ) + + const response = await downloadArtifactPublic( + fixtures.artifactID, + fixtures.repositoryOwner, + fixtures.repositoryName, + fixtures.token + ) + + expect(downloadArtifactMock).toHaveBeenCalledWith({ + owner: fixtures.repositoryOwner, + repo: fixtures.repositoryName, + artifact_id: fixtures.artifactID, + archive_format: 'zip', + request: { + redirect: 'manual' + } + }) + + expect(mockHttpClient).toHaveBeenCalledWith(getUserAgentString()) + expect(mockGetArtifactMalicious).toHaveBeenCalledWith( + fixtures.blobStorageUrl + ) + expect( + fs.readFileSync(path.join(fixtures.workspaceDir, 'etc/hosts'), 'utf8') + ).toEqual('foo') + expect(response.downloadPath).toBe(fixtures.workspaceDir) + }) + it('should successfully download an artifact to user defined path', async () => { const customPath = path.join(testDir, 'custom') diff --git a/packages/artifact/__tests__/fixtures/evil.zip b/packages/artifact/__tests__/fixtures/evil.zip new file mode 100644 index 0000000000000000000000000000000000000000..71d842b8205bf1718df485886ef30edb26e858fc GIT binary patch literal 238 zcmWIWW@Zs#U|`^22nh<0P)sfEVFmJ-ftUw~_4M>pOOo|7@{3D~y-%NKX9&QloFAeb ziw;I65oX+00JVWZ10#q+)*j%ETPMgi7-(SB2Qq;=Q8lx&ffO(SVL6aa1aTMuwt6QT literal 0 HcmV?d00001 From 76489f433bfce35e3ff6732c04455d80f73e32e1 Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Fri, 23 Feb 2024 11:59:36 -0500 Subject: [PATCH 134/198] attempt with comparing index --- packages/artifact/__tests__/download-artifact.test.ts | 6 +++--- .../src/internal/download/download-artifact.ts | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index a593c709..11707a64 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -13,7 +13,7 @@ import { streamExtractExternal } from '../src/internal/download/download-artifact' import {getUserAgentString} from '../src/internal/shared/user-agent' -import {noopLogs} from './common' +//import {noopLogs} from './common' import * as config from '../src/internal/shared/config' import {ArtifactServiceClientJSON} from '../src/generated' import * as util from '../src/internal/shared/util' @@ -88,7 +88,7 @@ const expectExtractedArchive = async (dir: string): Promise => { } const setup = async (): Promise => { - noopLogs() + //noopLogs() await fs.promises.mkdir(testDir, {recursive: true}) await createTestArchive() @@ -180,7 +180,7 @@ describe('download-artifact', () => { expect(response.downloadPath).toBe(fixtures.workspaceDir) }) - it('should not allow path traversal from malicious artifacts', async () => { + it.only('should not allow path traversal from malicious artifacts', async () => { const downloadArtifactMock = github.getOctokit(fixtures.token).rest .actions.downloadArtifact as MockedDownloadArtifact downloadArtifactMock.mockResolvedValueOnce({ diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 358044f1..9781ce90 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -94,10 +94,12 @@ export async function streamExtractExternal( }) .pipe(unzip.Parse()) .on('entry', (entry: unzip.Entry) => { - const entryPath = path - .normalize(entry.path) - .replace(/^(\.\.(\/|\\|$))+/, '') - const fullPath = path.join(directory, entryPath) + console.log(`entryPath: ${entry.path}`) + const fullPath = path.normalize(path.join(directory, entry.path)) + console.log(`fullPath: ${fullPath}`) + if (fullPath.indexOf(directory) != 0) { + reject(new Error(`Invalid file path: ${fullPath}`)) + } core.debug(`Extracting artifact entry: ${fullPath}`) if (entry.type === 'Directory') { promises.push(resolveOrCreateDirectory(fullPath).then(() => {})) From 4256ea99c5003c99de2118b78a39e80945434672 Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Fri, 23 Feb 2024 13:41:40 -0500 Subject: [PATCH 135/198] update test case and handling --- .../__tests__/download-artifact.test.ts | 10 +++---- packages/artifact/__tests__/fixtures/evil.zip | Bin 238 -> 246 bytes .../internal/download/download-artifact.ts | 25 ++++++++++++------ 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index 11707a64..3f0efc9d 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -180,7 +180,7 @@ describe('download-artifact', () => { expect(response.downloadPath).toBe(fixtures.workspaceDir) }) - it.only('should not allow path traversal from malicious artifacts', async () => { + it('should not allow path traversal from malicious artifacts', async () => { const downloadArtifactMock = github.getOctokit(fixtures.token).rest .actions.downloadArtifact as MockedDownloadArtifact downloadArtifactMock.mockResolvedValueOnce({ @@ -200,12 +200,12 @@ describe('download-artifact', () => { } ) - const response = await downloadArtifactPublic( + await expect(downloadArtifactPublic( fixtures.artifactID, fixtures.repositoryOwner, fixtures.repositoryName, fixtures.token - ) + )).rejects.toBeInstanceOf(Error) expect(downloadArtifactMock).toHaveBeenCalledWith({ owner: fixtures.repositoryOwner, @@ -221,10 +221,6 @@ describe('download-artifact', () => { expect(mockGetArtifactMalicious).toHaveBeenCalledWith( fixtures.blobStorageUrl ) - expect( - fs.readFileSync(path.join(fixtures.workspaceDir, 'etc/hosts'), 'utf8') - ).toEqual('foo') - expect(response.downloadPath).toBe(fixtures.workspaceDir) }) it('should successfully download an artifact to user defined path', async () => { diff --git a/packages/artifact/__tests__/fixtures/evil.zip b/packages/artifact/__tests__/fixtures/evil.zip index 71d842b8205bf1718df485886ef30edb26e858fc..d345590fd7f3c863837c3344b26714b631f5ce3e 100644 GIT binary patch literal 246 zcmWIWW@Zs#U|`^2V9XAWP)sfEVFmJ-ftU}7EA;jB^ixZc^)vE|ONzZupJ!(Xz^OqH zsG$<10gE0+CJ|=b)&MnvK?5U*LbWu&8@FDNjWE!_Xb5Ct*dO4{$_7%x1ccQpOOo|7@{3D~y-%NKX9&QloFAeb ziw;I65oX+00JVWZ10#q+)*j%ETPMgi7-(SB2Qq;=Q8lx&ffO(SVL6aa1aTMuwt6QT diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 9781ce90..1c6c8ec2 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -46,6 +46,9 @@ async function streamExtract(url: string, directory: string): Promise { await streamExtractExternal(url, directory) return } catch (error) { + if (error.message.includes('Malformed extraction path')) { + throw new Error(`Artifact download failed with unretryable error: ${error.message}`) + } retryCount++ core.debug( `Failed to download artifact after ${retryCount} retries due to ${error.message}. Retrying in 5 seconds...` @@ -81,6 +84,7 @@ export async function streamExtractExternal( const timer = setTimeout(timerFn, timeout) const promises: Promise[] = [] + const createdDirectories = new Set() response.message .on('data', () => { timer.refresh() @@ -94,20 +98,25 @@ export async function streamExtractExternal( }) .pipe(unzip.Parse()) .on('entry', (entry: unzip.Entry) => { - console.log(`entryPath: ${entry.path}`) const fullPath = path.normalize(path.join(directory, entry.path)) - console.log(`fullPath: ${fullPath}`) - if (fullPath.indexOf(directory) != 0) { - reject(new Error(`Invalid file path: ${fullPath}`)) + if (fullPath.indexOf(directory) !== 0) { + reject(new Error(`Malformed extraction path: ${fullPath}`)) } + core.debug(`Extracting artifact entry: ${fullPath}`) if (entry.type === 'Directory') { - promises.push(resolveOrCreateDirectory(fullPath).then(() => {})) + if (!createdDirectories.has(fullPath)) { + promises.push(resolveOrCreateDirectory(fullPath).then(() => {})) + createdDirectories.add(fullPath) + } entry.autodrain() } else { - promises.push( - resolveOrCreateDirectory(path.dirname(fullPath)).then(() => {}) - ) + if (!createdDirectories.has(path.dirname(fullPath))) { + promises.push( + resolveOrCreateDirectory(path.dirname(fullPath)).then(() => {}) + ) + createdDirectories.add(path.dirname(fullPath)) + } const writeStream = createWriteStream(fullPath) promises.push( new Promise((resolve, reject) => { From ac84a9bee36dff3220e402afe05a2eb525eb46f2 Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Fri, 23 Feb 2024 13:46:22 -0500 Subject: [PATCH 136/198] re-add noop logs and format + lint --- .../__tests__/download-artifact.test.ts | 18 ++++++++++-------- .../src/internal/download/download-artifact.ts | 6 ++++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index 3f0efc9d..7e93d1b4 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -13,7 +13,7 @@ import { streamExtractExternal } from '../src/internal/download/download-artifact' import {getUserAgentString} from '../src/internal/shared/user-agent' -//import {noopLogs} from './common' +import {noopLogs} from './common' import * as config from '../src/internal/shared/config' import {ArtifactServiceClientJSON} from '../src/generated' import * as util from '../src/internal/shared/util' @@ -88,7 +88,7 @@ const expectExtractedArchive = async (dir: string): Promise => { } const setup = async (): Promise => { - //noopLogs() + noopLogs() await fs.promises.mkdir(testDir, {recursive: true}) await createTestArchive() @@ -200,12 +200,14 @@ describe('download-artifact', () => { } ) - await expect(downloadArtifactPublic( - fixtures.artifactID, - fixtures.repositoryOwner, - fixtures.repositoryName, - fixtures.token - )).rejects.toBeInstanceOf(Error) + await expect( + downloadArtifactPublic( + fixtures.artifactID, + fixtures.repositoryOwner, + fixtures.repositoryName, + fixtures.token + ) + ).rejects.toBeInstanceOf(Error) expect(downloadArtifactMock).toHaveBeenCalledWith({ owner: fixtures.repositoryOwner, diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 1c6c8ec2..3c2c26eb 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -47,7 +47,9 @@ async function streamExtract(url: string, directory: string): Promise { return } catch (error) { if (error.message.includes('Malformed extraction path')) { - throw new Error(`Artifact download failed with unretryable error: ${error.message}`) + throw new Error( + `Artifact download failed with unretryable error: ${error.message}` + ) } retryCount++ core.debug( @@ -99,7 +101,7 @@ export async function streamExtractExternal( .pipe(unzip.Parse()) .on('entry', (entry: unzip.Entry) => { const fullPath = path.normalize(path.join(directory, entry.path)) - if (fullPath.indexOf(directory) !== 0) { + if (!fullPath.startsWith(directory)) { reject(new Error(`Malformed extraction path: ${fullPath}`)) } From 614f27a4fbcad3f360082ffd9711c2f3da022ae1 Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Fri, 23 Feb 2024 14:34:39 -0500 Subject: [PATCH 137/198] use stream transform --- .../internal/download/download-artifact.ts | 83 ++++++++++--------- 1 file changed, 45 insertions(+), 38 deletions(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 3c2c26eb..09890c29 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -1,4 +1,5 @@ import fs from 'fs/promises' +import * as stream from 'stream' import {createWriteStream} from 'fs' import * as path from 'path' import * as github from '@actions/github' @@ -85,8 +86,8 @@ export async function streamExtractExternal( } const timer = setTimeout(timerFn, timeout) - const promises: Promise[] = [] const createdDirectories = new Set() + createdDirectories.add(directory) response.message .on('data', () => { timer.refresh() @@ -99,46 +100,52 @@ export async function streamExtractExternal( reject(error) }) .pipe(unzip.Parse()) - .on('entry', (entry: unzip.Entry) => { - const fullPath = path.normalize(path.join(directory, entry.path)) - if (!fullPath.startsWith(directory)) { - reject(new Error(`Malformed extraction path: ${fullPath}`)) - } + .pipe( + new stream.Transform({ + objectMode: true, + transform: async (entry, _, callback) => { + const fullPath = path.normalize(path.join(directory, entry.path)) + if (!directory.endsWith(path.sep)) { + directory += path.sep + } + if (!fullPath.startsWith(directory)) { + reject(new Error(`Malformed extraction path: ${fullPath}`)) + } - core.debug(`Extracting artifact entry: ${fullPath}`) - if (entry.type === 'Directory') { - if (!createdDirectories.has(fullPath)) { - promises.push(resolveOrCreateDirectory(fullPath).then(() => {})) - createdDirectories.add(fullPath) - } - entry.autodrain() - } else { - if (!createdDirectories.has(path.dirname(fullPath))) { - promises.push( - resolveOrCreateDirectory(path.dirname(fullPath)).then(() => {}) - ) - createdDirectories.add(path.dirname(fullPath)) - } - const writeStream = createWriteStream(fullPath) - promises.push( - new Promise((resolve, reject) => { - writeStream.on('finish', () => { - resolve() - }) + core.debug(`Extracting artifact entry: ${fullPath}`) + if (entry.type === 'Directory') { + if (!createdDirectories.has(fullPath)) { + createdDirectories.add(fullPath) + await resolveOrCreateDirectory(fullPath).then(() => { + entry.autodrain() + callback() + }) + } else { + entry.autodrain() + callback() + } + } else { + if (!createdDirectories.has(path.dirname(fullPath))) { + createdDirectories.add(path.dirname(fullPath)) + await resolveOrCreateDirectory(path.dirname(fullPath)).then( + () => { + entry.autodrain() + callback() + } + ) + } + + const writeStream = createWriteStream(fullPath) + writeStream.on('finish', callback) writeStream.on('error', reject) - }) - ) - entry.pipe(writeStream) - } - }) - .on('end', async () => { + entry.pipe(writeStream) + } + } + }) + ) + .on('finish', async () => { clearTimeout(timer) - try { - await Promise.all(promises) - resolve() - } catch (error) { - reject(error) - } + resolve() }) .on('error', (error: Error) => { reject(error) From 90894a8853d1f5c325da17886831dda24a12d797 Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Fri, 23 Feb 2024 15:03:09 -0500 Subject: [PATCH 138/198] bump version --- packages/artifact/RELEASES.md | 6 +++++- packages/artifact/package-lock.json | 4 ++-- packages/artifact/package.json | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/artifact/RELEASES.md b/packages/artifact/RELEASES.md index 9e14a6b6..7c30fe79 100644 --- a/packages/artifact/RELEASES.md +++ b/packages/artifact/RELEASES.md @@ -113,4 +113,8 @@ ### 2.1.1 -- Updated `isGhes` check to include `.ghe.com` and `.ghe.localhost` as accepted hosts \ No newline at end of file +- Updated `isGhes` check to include `.ghe.com` and `.ghe.localhost` as accepted hosts + +### 2.1.2 + +- Updated the stream extract functionality to use `unzip.Parse()` instead of `unzip.Extract()` for greater control of unzipping artifacts diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index 550cbb01..d25b1524 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -1,12 +1,12 @@ { "name": "@actions/artifact", - "version": "2.1.1", + "version": "2.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@actions/artifact", - "version": "2.1.1", + "version": "2.1.2", "license": "MIT", "dependencies": { "@actions/core": "^1.10.0", diff --git a/packages/artifact/package.json b/packages/artifact/package.json index a5f6ad10..35f088e6 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -1,6 +1,6 @@ { "name": "@actions/artifact", - "version": "2.1.1", + "version": "2.1.2", "preview": true, "description": "Actions artifact lib", "keywords": [ From 8a1800c5da292e0e5a2fa346f4d48724f1c12167 Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Fri, 23 Feb 2024 15:15:17 -0500 Subject: [PATCH 139/198] use resolve instead of normalize --- packages/artifact/src/internal/download/download-artifact.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 09890c29..a5574e82 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -104,7 +104,7 @@ export async function streamExtractExternal( new stream.Transform({ objectMode: true, transform: async (entry, _, callback) => { - const fullPath = path.normalize(path.join(directory, entry.path)) + const fullPath = path.resolve(path.join(directory, entry.path)) if (!directory.endsWith(path.sep)) { directory += path.sep } From f77cbc9ef712200a1572866c6f41567e9dc3c2e9 Mon Sep 17 00:00:00 2001 From: Bethany Date: Fri, 23 Feb 2024 15:20:01 -0500 Subject: [PATCH 140/198] Update packages/artifact/src/internal/download/download-artifact.ts Co-authored-by: Tingluo Huang --- packages/artifact/src/internal/download/download-artifact.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index a5574e82..ef78faa4 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -104,7 +104,7 @@ export async function streamExtractExternal( new stream.Transform({ objectMode: true, transform: async (entry, _, callback) => { - const fullPath = path.resolve(path.join(directory, entry.path)) + const fullPath = path.resolve(directory, entry.path) if (!directory.endsWith(path.sep)) { directory += path.sep } From 7fa864a4f41863b88b3c42ea4fcb6eb4ece99b8c Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Fri, 23 Feb 2024 15:28:25 -0500 Subject: [PATCH 141/198] go back to normalize) --- packages/artifact/src/internal/download/download-artifact.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index ef78faa4..09890c29 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -104,7 +104,7 @@ export async function streamExtractExternal( new stream.Transform({ objectMode: true, transform: async (entry, _, callback) => { - const fullPath = path.resolve(directory, entry.path) + const fullPath = path.normalize(path.join(directory, entry.path)) if (!directory.endsWith(path.sep)) { directory += path.sep } From 6cf4fbcef866f531163664bc15c5b738f4af9b04 Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Fri, 23 Feb 2024 15:33:24 -0500 Subject: [PATCH 142/198] add a comment --- packages/artifact/__tests__/download-artifact.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index 7e93d1b4..e961532a 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -124,7 +124,7 @@ const mockGetArtifactFailure = jest.fn(() => { const mockGetArtifactMalicious = jest.fn(() => { const message = new http.IncomingMessage(new net.Socket()) message.statusCode = 200 - message.push(fs.readFileSync(path.join(__dirname, 'fixtures', 'evil.zip'))) + message.push(fs.readFileSync(path.join(__dirname, 'fixtures', 'evil.zip'))) // evil.zip contains files that are formatted x/../../etc/hosts message.push(null) return { message From 902046e4d8056014468f5a9f8907fde2b0514eee Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Mon, 26 Feb 2024 09:36:35 -0500 Subject: [PATCH 143/198] ensure callback is only called once --- packages/artifact/src/internal/download/download-artifact.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 09890c29..2880c536 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -128,10 +128,7 @@ export async function streamExtractExternal( if (!createdDirectories.has(path.dirname(fullPath))) { createdDirectories.add(path.dirname(fullPath)) await resolveOrCreateDirectory(path.dirname(fullPath)).then( - () => { - entry.autodrain() - callback() - } + () => {} ) } From dcc55dfd0485545474048b888c6167aa9206d92c Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Mon, 26 Feb 2024 09:56:00 -0500 Subject: [PATCH 144/198] feedback --- packages/artifact/src/internal/download/download-artifact.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 2880c536..c30d65f2 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -127,9 +127,7 @@ export async function streamExtractExternal( } else { if (!createdDirectories.has(path.dirname(fullPath))) { createdDirectories.add(path.dirname(fullPath)) - await resolveOrCreateDirectory(path.dirname(fullPath)).then( - () => {} - ) + await resolveOrCreateDirectory(path.dirname(fullPath)) } const writeStream = createWriteStream(fullPath) From 97c606b61253abc8bd03de62f1fa2d772cedc75b Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Mon, 26 Feb 2024 10:18:02 -0500 Subject: [PATCH 145/198] update to 2.1.3 --- packages/artifact/package-lock.json | 4 ++-- packages/artifact/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index d25b1524..28ee4de7 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -1,12 +1,12 @@ { "name": "@actions/artifact", - "version": "2.1.2", + "version": "2.1.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@actions/artifact", - "version": "2.1.2", + "version": "2.1.3", "license": "MIT", "dependencies": { "@actions/core": "^1.10.0", diff --git a/packages/artifact/package.json b/packages/artifact/package.json index 35f088e6..e5668fba 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -1,6 +1,6 @@ { "name": "@actions/artifact", - "version": "2.1.2", + "version": "2.1.3", "preview": true, "description": "Actions artifact lib", "keywords": [ From 6079dea4c41902d4951ac5a95a440f722f857932 Mon Sep 17 00:00:00 2001 From: Brian DeHamer Date: Sat, 17 Feb 2024 19:14:10 -0800 Subject: [PATCH 146/198] add new @actions/attest package Signed-off-by: Brian DeHamer --- CODEOWNERS | 1 + README.md | 9 + package-lock.json | 6 +- packages/attest/LICENSE.md | 9 + packages/attest/README.md | 172 + packages/attest/RELEASES.md | 5 + .../__snapshots__/intoto.test.ts.snap | 19 + .../__snapshots__/provenance.test.ts.snap | 42 + packages/attest/__tests__/index.test.ts | 6 + packages/attest/__tests__/intoto.test.ts | 23 + packages/attest/__tests__/provenance.test.ts | 213 ++ packages/attest/__tests__/sign.test.ts | 105 + packages/attest/__tests__/store.test.ts | 45 + packages/attest/package-lock.json | 3041 +++++++++++++++++ packages/attest/package.json | 49 + packages/attest/src/attest.ts | 96 + packages/attest/src/endpoints.ts | 50 + packages/attest/src/index.ts | 9 + packages/attest/src/intoto.ts | 32 + packages/attest/src/provenance.ts | 93 + packages/attest/src/shared.types.ts | 52 + packages/attest/src/sign.ts | 107 + packages/attest/src/store.ts | 31 + packages/attest/tsconfig.json | 12 + 24 files changed, 4224 insertions(+), 3 deletions(-) create mode 100644 packages/attest/LICENSE.md create mode 100644 packages/attest/README.md create mode 100644 packages/attest/RELEASES.md create mode 100644 packages/attest/__tests__/__snapshots__/intoto.test.ts.snap create mode 100644 packages/attest/__tests__/__snapshots__/provenance.test.ts.snap create mode 100644 packages/attest/__tests__/index.test.ts create mode 100644 packages/attest/__tests__/intoto.test.ts create mode 100644 packages/attest/__tests__/provenance.test.ts create mode 100644 packages/attest/__tests__/sign.test.ts create mode 100644 packages/attest/__tests__/store.test.ts create mode 100644 packages/attest/package-lock.json create mode 100644 packages/attest/package.json create mode 100644 packages/attest/src/attest.ts create mode 100644 packages/attest/src/endpoints.ts create mode 100644 packages/attest/src/index.ts create mode 100644 packages/attest/src/intoto.ts create mode 100644 packages/attest/src/provenance.ts create mode 100644 packages/attest/src/shared.types.ts create mode 100644 packages/attest/src/sign.ts create mode 100644 packages/attest/src/store.ts create mode 100644 packages/attest/tsconfig.json diff --git a/CODEOWNERS b/CODEOWNERS index f82b14f2..d6b5d118 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -2,3 +2,4 @@ /packages/artifact/ @actions/artifacts-actions /packages/cache/ @actions/actions-cache +/package/attest/ @actions/package-security diff --git a/README.md b/README.md index 43ee8acd..686d07a5 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,15 @@ $ npm install @actions/cache ```
+:lock_with_ink_pen: [@actions/attest](packages/attest) + +Provides functions to write attestations for workflow artifacts. Read more [here](packages/attest) + +```bash +$ npm install @actions/attest +``` +
+ ## Creating an Action with the Toolkit :question: [Choosing an action type](docs/action-types.md) diff --git a/package-lock.json b/package-lock.json index 1d43fbf3..7575e429 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6664,9 +6664,9 @@ } }, "node_modules/ip": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", - "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz", + "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==", "dev": true }, "node_modules/is-array-buffer": { diff --git a/packages/attest/LICENSE.md b/packages/attest/LICENSE.md new file mode 100644 index 00000000..284603e6 --- /dev/null +++ b/packages/attest/LICENSE.md @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright 2024 GitHub + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/attest/README.md b/packages/attest/README.md new file mode 100644 index 00000000..cb3fe1ff --- /dev/null +++ b/packages/attest/README.md @@ -0,0 +1,172 @@ +# `@actions/attest` + +Functions for generating signed attestations for workflow artifacts. + +Attestations bind some subject (a named artifact along with its digest) to a +predicate (some assertion about that subject) using the [in-toto +statement](https://github.com/in-toto/attestation/tree/main/spec/v1) format. A +signature is generated for the attestation using a +[Sigstore](https://www.sigstore.dev/)-issued signing certificate. + +Once the attestation has been created and signed, it will be uploaded to the GH +attestations API and associated with the repository from which the workflow was +initiated. + +## Usage + +### `attest` + +The `attest` function takes the supplied subject/predicate pair and generates a +signed attestation. + +```js +const { attest } = require('@actions/attest'); +const core = require('@actions/core'); + +async function run() { + // In order to persist attestations to the repo, this should be a token with + // repository write permissions. + const ghToken = core.getInput('gh-token'); + + const attestation = await attest({ + subjectName: 'my-artifact-name', + subjectDigest: { 'sha256': '36ab4667...'}, + predicateType: 'https://in-toto.io/attestation/release', + predicate: { . . . }, + token: ghToken + }); + + console.log(attestation); +} + +run(); +``` + +The `attest` function supports the following options: + +```typescript +export type AttestOptions = { + // The name of the subject to be attested. + subjectName: string + // The digest of the subject to be attested. Should be a map of digest + // algorithms to their hex-encoded values. + subjectDigest: Record + // URI identifying the content type of the predicate being attested. + predicateType: string + // Predicate to be attested. + predicate: object + // GitHub token for writing attestations. + token: string + // Sigstore instance to use for signing. Must be one of "public-good" or + // "github". + sigstore?: 'public-good' | 'github' + // Whether to skip writing the attestation to the GH attestations API. + skipWrite?: boolean +} +``` + +### `attestProvenance` + +The `attestProvenance` function accepts the name and digest of some artifact and +generates a build provenance attestation over those values. + +The attestation is formed by first generating a [SLSA provenance +predicate](https://slsa.dev/spec/v1.0/provenance) populated with +[metadata](https://github.com/slsa-framework/github-actions-buildtypes/tree/main/workflow/v1) +pulled from the GitHub Actions run. + +```js +const { attestProvenance } = require('@actions/attest'); +const core = require('@actions/core'); + +async function run() { + // In order to persist attestations to the repo, this should be a token with + // repository write permissions. + const ghToken = core.getInput('gh-token'); + + const attestation = await attestProvenance({ + subjectName: 'my-artifact-name', + subjectDigest: { 'sha256': '36ab4667...'}, + token: ghToken + }); + + console.log(attestation); +} + +run(); +``` + +The `attestProvenance` function supports the following options: + +```typescript +export type AttestProvenanceOptions = { + // The name of the subject to be attested. + subjectName: string + // The digest of the subject to be attested. Should be a map of digest + // algorithms to their hex-encoded values. + subjectDigest: Record + // GitHub token for writing attestations. + token: string + // Sigstore instance to use for signing. Must be one of "public-good" or + // "github". + sigstore?: 'public-good' | 'github' + // Whether to skip writing the attestation to the GH attestations API. + skipWrite?: boolean +} +``` + +### `Attestation` + +The `Attestation` returned by `attest`/`attestProvenance` has the following +fields: + +```typescript +export type Attestation = { + /* + * JSON-serialized Sigstore bundle containing the provenance attestation, + * signature, signing certificate and witnessed timestamp. + */ + bundle: SerializedBundle + /* + * PEM-encoded signing certificate used to sign the attestation. + */ + certificate: string + /* + * ID of Rekor transparency log entry created for the attestation (if + * applicable). + */ + tlogID?: string + /* + * ID of the persisted attestation (accessible via the GH API). + */ + attestationID?: string +} +``` + +For details about the Sigstore bundle format, see the [Bundle protobuf +specification](https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto). + +## Sigstore Instance + +When generating the signed attestation there are two different Sigstore +instances which can be used to issue the signing certificate. By default, +workflows initiated from public repositories will use the Sigstore public-good +instance and persist the attestation signature to the public [Rekor transparency +log](https://docs.sigstore.dev/logging/overview/). Workflows initiated from +private/internal repositories will use the GitHub-internal Sigstore instance +which uses a signed timestamp issued by GitHub's timestamp authority in place of +the public transparency log. + +The default Sigstore instance selection can be overridden by passing an explicit +value of either "public-good" or "github" for the `sigstore` option when calling +either `attest` or `attestProvenance`. + +## Storage + +Attestations created by `attest`/`attestProvenance` will be uploaded to the GH +attestations API and associated with the appropriate repository. Attestation +storage is only supported for public repositories or repositories which belong +to a GitHub Enterprise Cloud account. + +In order to generate attestations for private, non-Enterprise repositories, the +`skipWrite` option should be set to `true`. diff --git a/packages/attest/RELEASES.md b/packages/attest/RELEASES.md new file mode 100644 index 00000000..a05e5d0d --- /dev/null +++ b/packages/attest/RELEASES.md @@ -0,0 +1,5 @@ +# @actions/attest Releases + +### 1.0.0 + +- Initial release diff --git a/packages/attest/__tests__/__snapshots__/intoto.test.ts.snap b/packages/attest/__tests__/__snapshots__/intoto.test.ts.snap new file mode 100644 index 00000000..8f20e804 --- /dev/null +++ b/packages/attest/__tests__/__snapshots__/intoto.test.ts.snap @@ -0,0 +1,19 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`buildIntotoStatement returns a provenance hydrated from env vars 1`] = ` +{ + "_type": "https://in-toto.io/Statement/v1", + "predicate": { + "key": "value", + }, + "predicateType": "predicatey", + "subject": [ + { + "digest": { + "sha256": "7d070f6b64d9bcc530fe99cc21eaaa4b3c364e0b2d367d7735671fa202a03b32", + }, + "name": "subjecty", + }, + ], +} +`; diff --git a/packages/attest/__tests__/__snapshots__/provenance.test.ts.snap b/packages/attest/__tests__/__snapshots__/provenance.test.ts.snap new file mode 100644 index 00000000..2138d6f8 --- /dev/null +++ b/packages/attest/__tests__/__snapshots__/provenance.test.ts.snap @@ -0,0 +1,42 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`buildSLSAProvenancePredicate returns a provenance hydrated from env vars 1`] = ` +{ + "params": { + "buildDefinition": { + "buildType": "https://slsa-framework.github.io/github-actions-buildtypes/workflow/v1", + "externalParameters": { + "workflow": { + "path": ".github/workflows/main.yml", + "ref": "main", + "repository": "https://github.com/owner/repo", + }, + }, + "internalParameters": { + "github": { + "event_name": "push", + "repository_id": "repo-id", + "repository_owner_id": "owner-id", + }, + }, + "resolvedDependencies": [ + { + "digest": { + "gitCommit": "babca52ab0c93ae16539e5923cb0d7403b9a093b", + }, + "uri": "git+https://github.com/owner/repo@refs/heads/main", + }, + ], + }, + "runDetails": { + "builder": { + "id": "https://github.com/actions/runner/github-hosted", + }, + "metadata": { + "invocationId": "https://github.com/owner/repo/actions/runs/run-id/attempts/run-attempt", + }, + }, + }, + "type": "https://slsa.dev/provenance/v1", +} +`; diff --git a/packages/attest/__tests__/index.test.ts b/packages/attest/__tests__/index.test.ts new file mode 100644 index 00000000..e5645f13 --- /dev/null +++ b/packages/attest/__tests__/index.test.ts @@ -0,0 +1,6 @@ +import {attest, attestProvenance} from '../src' + +it('exports functions', () => { + expect(attestProvenance).toBeInstanceOf(Function) + expect(attest).toBeInstanceOf(Function) +}) diff --git a/packages/attest/__tests__/intoto.test.ts b/packages/attest/__tests__/intoto.test.ts new file mode 100644 index 00000000..ada7e1ee --- /dev/null +++ b/packages/attest/__tests__/intoto.test.ts @@ -0,0 +1,23 @@ +import {buildIntotoStatement} from '../src/intoto' +import type {Predicate, Subject} from '../src/shared.types' + +describe('buildIntotoStatement', () => { + const subject: Subject = { + name: 'subjecty', + digest: { + sha256: '7d070f6b64d9bcc530fe99cc21eaaa4b3c364e0b2d367d7735671fa202a03b32' + } + } + + const predicate: Predicate = { + type: 'predicatey', + params: { + key: 'value' + } + } + + it('returns a provenance hydrated from env vars', () => { + const statement = buildIntotoStatement(subject, predicate) + expect(statement).toMatchSnapshot() + }) +}) diff --git a/packages/attest/__tests__/provenance.test.ts b/packages/attest/__tests__/provenance.test.ts new file mode 100644 index 00000000..d08b6c74 --- /dev/null +++ b/packages/attest/__tests__/provenance.test.ts @@ -0,0 +1,213 @@ +import * as github from '@actions/github' +import {mockFulcio, mockRekor, mockTSA} from '@sigstore/mock' +import nock from 'nock' +import {SIGSTORE_GITHUB, SIGSTORE_PUBLIC_GOOD} from '../src/endpoints' +import {attestProvenance, buildSLSAProvenancePredicate} from '../src/provenance' + +// Dummy workflow environment +const env = { + GITHUB_REPOSITORY: 'owner/repo', + GITHUB_REF: 'refs/heads/main', + GITHUB_SHA: 'babca52ab0c93ae16539e5923cb0d7403b9a093b', + GITHUB_WORKFLOW_REF: 'owner/repo/.github/workflows/main.yml@main', + GITHUB_SERVER_URL: 'https://github.com', + GITHUB_EVENT_NAME: 'push', + GITHUB_REPOSITORY_ID: 'repo-id', + GITHUB_REPOSITORY_OWNER_ID: 'owner-id', + GITHUB_RUN_ID: 'run-id', + GITHUB_RUN_ATTEMPT: 'run-attempt', + RUNNER_ENVIRONMENT: 'github-hosted' +} + +describe('buildSLSAProvenancePredicate', () => { + it('returns a provenance hydrated from env vars', () => { + const predicate = buildSLSAProvenancePredicate(env) + expect(predicate).toMatchSnapshot() + }) +}) + +describe('attestProvenance', () => { + // Capture original environment variables so we can restore them after each + // test + const originalEnv = process.env + + // Subject to attest + const subjectName = 'subjective' + const subjectDigest = { + sha256: '7d070f6b64d9bcc530fe99cc21eaaa4b3c364e0b2d367d7735671fa202a03b32' + } + + // Fake an OIDC token + const oidcPayload = {sub: 'foo@bar.com', iss: ''} + const oidcToken = `.${Buffer.from(JSON.stringify(oidcPayload)).toString( + 'base64' + )}.}` + + const tokenURL = 'https://token.url' + const attestationID = '1234567890' + + beforeEach(async () => { + jest.clearAllMocks() + + nock(tokenURL) + .get('/') + .query({audience: 'sigstore'}) + .reply(200, {value: oidcToken}) + + // Set-up GHA environment variables + process.env = { + ...originalEnv, + ...env, + ACTIONS_ID_TOKEN_REQUEST_URL: tokenURL, + ACTIONS_ID_TOKEN_REQUEST_TOKEN: 'token' + } + }) + + afterEach(() => { + // Restore the original environment + process.env = originalEnv + }) + + describe('when using the github Sigstore instance', () => { + const {fulcioURL, tsaServerURL} = SIGSTORE_GITHUB + + beforeEach(async () => { + // Mock Sigstore + await mockFulcio({baseURL: fulcioURL, strict: false}) + await mockTSA({baseURL: tsaServerURL}) + + // Mock GH attestations API + nock('https://api.github.com') + .post(/^\/repos\/.*\/.*\/attestations$/) + .reply(201, {id: attestationID}) + }) + + describe('when the sigstore instance is explicitly set', () => { + it('attests provenance', async () => { + const attestation = await attestProvenance({ + subjectName, + subjectDigest, + token: 'token', + sigstore: 'github' + }) + + expect(attestation).toBeDefined() + expect(attestation.bundle).toBeDefined() + expect(attestation.certificate).toMatch(/-----BEGIN CERTIFICATE-----/) + expect(attestation.tlogID).toBeUndefined() + expect(attestation.attestationID).toBe(attestationID) + }) + }) + + describe('when the sigstore instance is inferred from the repo visibility', () => { + const savedRepository = github.context.payload.repository + + beforeEach(() => { + /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ + github.context.payload.repository = {visibility: 'private'} as any + }) + + afterEach(() => { + github.context.payload.repository = savedRepository + }) + + it('attests provenance', async () => { + const attestation = await attestProvenance({ + subjectName, + subjectDigest, + token: 'token' + }) + + expect(attestation).toBeDefined() + expect(attestation.bundle).toBeDefined() + expect(attestation.certificate).toMatch(/-----BEGIN CERTIFICATE-----/) + expect(attestation.tlogID).toBeUndefined() + expect(attestation.attestationID).toBe(attestationID) + }) + }) + }) + + describe('when using the public-good Sigstore instance', () => { + const {fulcioURL, rekorURL} = SIGSTORE_PUBLIC_GOOD + + beforeEach(async () => { + // Mock Sigstore + await mockFulcio({baseURL: fulcioURL, strict: false}) + await mockRekor({baseURL: rekorURL}) + + // Mock GH attestations API + nock('https://api.github.com') + .post(/^\/repos\/.*\/.*\/attestations$/) + .reply(201, {id: attestationID}) + }) + + describe('when the sigstore instance is explicitly set', () => { + it('attests provenance', async () => { + const attestation = await attestProvenance({ + subjectName, + subjectDigest, + token: 'token', + sigstore: 'public-good' + }) + + expect(attestation).toBeDefined() + expect(attestation.bundle).toBeDefined() + expect(attestation.certificate).toMatch(/-----BEGIN CERTIFICATE-----/) + expect(attestation.tlogID).toBeDefined() + expect(attestation.attestationID).toBe(attestationID) + }) + }) + + describe('when the sigstore instance is inferred from the repo visibility', () => { + const savedRepository = github.context.payload.repository + + beforeEach(() => { + /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ + github.context.payload.repository = {visibility: 'public'} as any + }) + + afterEach(() => { + github.context.payload.repository = savedRepository + }) + + it('attests provenance', async () => { + const attestation = await attestProvenance({ + subjectName, + subjectDigest, + token: 'token' + }) + + expect(attestation).toBeDefined() + expect(attestation.bundle).toBeDefined() + expect(attestation.certificate).toMatch(/-----BEGIN CERTIFICATE-----/) + expect(attestation.tlogID).toBeDefined() + expect(attestation.attestationID).toBe(attestationID) + }) + }) + }) + + describe('when skipWrite is set to true', () => { + const {fulcioURL, rekorURL} = SIGSTORE_PUBLIC_GOOD + beforeEach(async () => { + // Mock Sigstore + await mockFulcio({baseURL: fulcioURL, strict: false}) + await mockRekor({baseURL: rekorURL}) + }) + + it('attests provenance', async () => { + const attestation = await attestProvenance({ + subjectName, + subjectDigest, + token: 'token', + sigstore: 'public-good', + skipWrite: true + }) + + expect(attestation).toBeDefined() + expect(attestation.bundle).toBeDefined() + expect(attestation.certificate).toMatch(/-----BEGIN CERTIFICATE-----/) + expect(attestation.tlogID).toBeDefined() + expect(attestation.attestationID).toBeUndefined() + }) + }) +}) diff --git a/packages/attest/__tests__/sign.test.ts b/packages/attest/__tests__/sign.test.ts new file mode 100644 index 00000000..8aa1a5b8 --- /dev/null +++ b/packages/attest/__tests__/sign.test.ts @@ -0,0 +1,105 @@ +import {mockFulcio, mockRekor, mockTSA} from '@sigstore/mock' +import nock from 'nock' +import {Payload, signPayload} from '../src/sign' + +describe('signProvenance', () => { + const originalEnv = process.env + + // Fake an OIDC token + const subject = 'foo@bar.com' + const oidcPayload = {sub: subject, iss: ''} + const oidcToken = `.${Buffer.from(JSON.stringify(oidcPayload)).toString( + 'base64' + )}.}` + + // Dummy provenance to be signed + const provenance = { + _type: 'https://in-toto.io/Statement/v1', + subject: { + name: 'subjective', + digest: { + sha256: + '7d070f6b64d9bcc530fe99cc21eaaa4b3c364e0b2d367d7735671fa202a03b32' + } + } + } + + const payload: Payload = { + body: Buffer.from(JSON.stringify(provenance)), + type: 'application/vnd.in-toto+json' + } + + const fulcioURL = 'https://fulcio.url' + const rekorURL = 'https://rekor.url' + const tsaServerURL = 'https://tsa.url' + + beforeEach(() => { + // Mock OIDC token endpoint + const tokenURL = 'https://token.url' + + process.env = { + ...originalEnv, + ACTIONS_ID_TOKEN_REQUEST_URL: tokenURL, + ACTIONS_ID_TOKEN_REQUEST_TOKEN: 'token' + } + + nock(tokenURL) + .get('/') + .query({audience: 'sigstore'}) + .reply(200, {value: oidcToken}) + }) + + afterEach(() => { + process.env = originalEnv + }) + + describe('when visibility is public', () => { + beforeEach(async () => { + await mockFulcio({baseURL: fulcioURL, strict: false}) + await mockRekor({baseURL: rekorURL}) + }) + + it('returns a bundle', async () => { + const att = await signPayload(payload, {fulcioURL, rekorURL}) + + expect(att).toBeDefined() + expect(att.mediaType).toEqual( + 'application/vnd.dev.sigstore.bundle+json;version=0.2' + ) + + expect(att.content.$case).toEqual('dsseEnvelope') + expect(att.verificationMaterial.content.$case).toEqual( + 'x509CertificateChain' + ) + expect(att.verificationMaterial.tlogEntries).toHaveLength(1) + expect( + att.verificationMaterial.timestampVerificationData?.rfc3161Timestamps + ).toHaveLength(0) + }) + }) + + describe('when visibility is private', () => { + beforeEach(async () => { + await mockFulcio({baseURL: fulcioURL, strict: false}) + await mockTSA({baseURL: tsaServerURL}) + }) + + it('returns a bundle', async () => { + const att = await signPayload(payload, {fulcioURL, tsaServerURL}) + + expect(att).toBeDefined() + expect(att.mediaType).toEqual( + 'application/vnd.dev.sigstore.bundle+json;version=0.2' + ) + + expect(att.content.$case).toEqual('dsseEnvelope') + expect(att.verificationMaterial.content.$case).toEqual( + 'x509CertificateChain' + ) + expect(att.verificationMaterial.tlogEntries).toHaveLength(0) + expect( + att.verificationMaterial.timestampVerificationData?.rfc3161Timestamps + ).toHaveLength(1) + }) + }) +}) diff --git a/packages/attest/__tests__/store.test.ts b/packages/attest/__tests__/store.test.ts new file mode 100644 index 00000000..071d513e --- /dev/null +++ b/packages/attest/__tests__/store.test.ts @@ -0,0 +1,45 @@ +import nock from 'nock' +import {writeAttestation} from '../src/store' + +describe('writeAttestation', () => { + const originalEnv = process.env + const attestation = {foo: 'bar '} + const token = 'token' + + beforeEach(() => { + process.env = { + ...originalEnv, + GITHUB_REPOSITORY: 'foo/bar' + } + }) + + afterEach(() => { + process.env = originalEnv + }) + + describe('when the api call is successful', () => { + beforeEach(() => { + nock('https://api.github.com') + .matchHeader('authorization', `token ${token}`) + .post('/repos/foo/bar/attestations', {bundle: attestation}) + .reply(201, {id: '123'}) + }) + + it('persists the attestation', async () => { + await expect(writeAttestation(attestation, token)).resolves.toEqual('123') + }) + }) + + describe('when the api call fails', () => { + beforeEach(() => { + nock('https://api.github.com') + .matchHeader('authorization', `token ${token}`) + .post('/repos/foo/bar/attestations', {bundle: attestation}) + .reply(500, 'oops') + }) + + it('persists the attestation', async () => { + await expect(writeAttestation(attestation, token)).rejects.toThrow(/oops/) + }) + }) +}) diff --git a/packages/attest/package-lock.json b/packages/attest/package-lock.json new file mode 100644 index 00000000..2fb3b6b6 --- /dev/null +++ b/packages/attest/package-lock.json @@ -0,0 +1,3041 @@ +{ + "name": "@actions/attest", + "version": "0.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "@actions/attest", + "version": "0.0.0", + "license": "MIT", + "dependencies": { + "@actions/github": "^6.0.0", + "@sigstore/bundle": "^2.2.0", + "@sigstore/sign": "^2.2.3", + "make-fetch-happen": "^13.0.0" + }, + "devDependencies": { + "@sigstore/mock": "^0.6.5", + "@sigstore/rekor-types": "^2.0.0", + "@types/make-fetch-happen": "^10.0.4", + "nock": "^13.5.1" + } + }, + "node_modules/@actions/github": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@actions/github/-/github-6.0.0.tgz", + "integrity": "sha512-alScpSVnYmjNEXboZjarjukQEzgCRmjMv6Xj47fsdnqGS73bjJNDpiiXmp8jr0UZLdUB6d9jW63IcmddUP+l0g==", + "dependencies": { + "@actions/http-client": "^2.2.0", + "@octokit/core": "^5.0.1", + "@octokit/plugin-paginate-rest": "^9.0.0", + "@octokit/plugin-rest-endpoint-methods": "^10.0.0" + } + }, + "node_modules/@actions/http-client": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.0.tgz", + "integrity": "sha512-q+epW0trjVUUHboliPb4UF9g2msf+w61b32tAkFEwL/IwP0DQWgbCMM0Hbe3e3WXSKz5VcUXbzJQgy8Hkra/Lg==", + "dependencies": { + "tunnel": "^0.0.6", + "undici": "^5.25.4" + } + }, + "node_modules/@fastify/busboy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.0.tgz", + "integrity": "sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@npmcli/agent": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@npmcli/agent/-/agent-2.2.1.tgz", + "integrity": "sha512-H4FrOVtNyWC8MUwL3UfjOsAihHvT1Pe8POj3JvjXhSTJipsZMtgUALCT4mGyYZNxymkUfOw3PUj6dE4QPp6osQ==", + "dependencies": { + "agent-base": "^7.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/fs": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.0.tgz", + "integrity": "sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@octokit/auth-token": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", + "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==", + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/core": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.1.0.tgz", + "integrity": "sha512-BDa2VAMLSh3otEiaMJ/3Y36GU4qf6GI+VivQ/P41NC6GHcdxpKlqV0ikSZ5gdQsmS3ojXeRx5vasgNTinF0Q4g==", + "dependencies": { + "@octokit/auth-token": "^4.0.0", + "@octokit/graphql": "^7.0.0", + "@octokit/request": "^8.0.2", + "@octokit/request-error": "^5.0.0", + "@octokit/types": "^12.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/endpoint": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.4.tgz", + "integrity": "sha512-DWPLtr1Kz3tv8L0UvXTDP1fNwM0S+z6EJpRcvH66orY6Eld4XBMCSYsaWp4xIm61jTWxK68BrR7ibO+vSDnZqw==", + "dependencies": { + "@octokit/types": "^12.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/graphql": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.0.2.tgz", + "integrity": "sha512-OJ2iGMtj5Tg3s6RaXH22cJcxXRi7Y3EBqbHTBRq+PQAqfaS8f/236fUrWhfSn8P4jovyzqucxme7/vWSSZBX2Q==", + "dependencies": { + "@octokit/request": "^8.0.1", + "@octokit/types": "^12.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/openapi-types": { + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-19.1.0.tgz", + "integrity": "sha512-6G+ywGClliGQwRsjvqVYpklIfa7oRPA0vyhPQG/1Feh+B+wU0vGH1JiJ5T25d3g1JZYBHzR2qefLi9x8Gt+cpw==" + }, + "node_modules/@octokit/plugin-paginate-rest": { + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-9.1.5.tgz", + "integrity": "sha512-WKTQXxK+bu49qzwv4qKbMMRXej1DU2gq017euWyKVudA6MldaSSQuxtz+vGbhxV4CjxpUxjZu6rM2wfc1FiWVg==", + "dependencies": { + "@octokit/types": "^12.4.0" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "@octokit/core": ">=5" + } + }, + "node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-10.3.0.tgz", + "integrity": "sha512-c/fjpoHispRvBZuRoTVt/uALg7pXa9RQbXWJiDMk6NDkGNomuAZG7YuYYpZoxeoXv+kVRjIDTsO0e1z0pei+PQ==", + "dependencies": { + "@octokit/types": "^12.4.0" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "@octokit/core": ">=5" + } + }, + "node_modules/@octokit/request": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.2.0.tgz", + "integrity": "sha512-exPif6x5uwLqv1N1irkLG1zZNJkOtj8bZxuVHd71U5Ftuxf2wGNvAJyNBcPbPC+EBzwYEbBDdSFb8EPcjpYxPQ==", + "dependencies": { + "@octokit/endpoint": "^9.0.0", + "@octokit/request-error": "^5.0.0", + "@octokit/types": "^12.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/request-error": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.0.1.tgz", + "integrity": "sha512-X7pnyTMV7MgtGmiXBwmO6M5kIPrntOXdyKZLigNfQWSEQzVxR4a4vo49vJjTWX70mPndj8KhfT4Dx+2Ng3vnBQ==", + "dependencies": { + "@octokit/types": "^12.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@octokit/types": { + "version": "12.5.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.5.0.tgz", + "integrity": "sha512-YJEKcb0KkJlIUNU/zjnZwHEP8AoVh/OoIcP/1IyR4UHxExz7fzpe/a8IG4wBtQi7QDEqiomVLX88S6FpxxAJtg==", + "dependencies": { + "@octokit/openapi-types": "^19.1.0" + } + }, + "node_modules/@peculiar/asn1-cms": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-cms/-/asn1-cms-2.3.8.tgz", + "integrity": "sha512-Wtk9R7yQxGaIaawHorWKP2OOOm/RZzamOmSWwaqGphIuU6TcKYih0slL6asZlSSZtVoYTrBfrddSOD/jTu9vuQ==", + "dev": true, + "dependencies": { + "@peculiar/asn1-schema": "^2.3.8", + "@peculiar/asn1-x509": "^2.3.8", + "@peculiar/asn1-x509-attr": "^2.3.8", + "asn1js": "^3.0.5", + "tslib": "^2.6.2" + } + }, + "node_modules/@peculiar/asn1-csr": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-csr/-/asn1-csr-2.3.8.tgz", + "integrity": "sha512-ZmAaP2hfzgIGdMLcot8gHTykzoI+X/S53x1xoGbTmratETIaAbSWMiPGvZmXRA0SNEIydpMkzYtq4fQBxN1u1w==", + "dev": true, + "dependencies": { + "@peculiar/asn1-schema": "^2.3.8", + "@peculiar/asn1-x509": "^2.3.8", + "asn1js": "^3.0.5", + "tslib": "^2.6.2" + } + }, + "node_modules/@peculiar/asn1-ecc": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-ecc/-/asn1-ecc-2.3.8.tgz", + "integrity": "sha512-Ah/Q15y3A/CtxbPibiLM/LKcMbnLTdUdLHUgdpB5f60sSvGkXzxJCu5ezGTFHogZXWNX3KSmYqilCrfdmBc6pQ==", + "dev": true, + "dependencies": { + "@peculiar/asn1-schema": "^2.3.8", + "@peculiar/asn1-x509": "^2.3.8", + "asn1js": "^3.0.5", + "tslib": "^2.6.2" + } + }, + "node_modules/@peculiar/asn1-pfx": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-pfx/-/asn1-pfx-2.3.8.tgz", + "integrity": "sha512-XhdnCVznMmSmgy68B9pVxiZ1XkKoE1BjO4Hv+eUGiY1pM14msLsFZ3N7K46SoITIVZLq92kKkXpGiTfRjlNLyg==", + "dev": true, + "dependencies": { + "@peculiar/asn1-cms": "^2.3.8", + "@peculiar/asn1-pkcs8": "^2.3.8", + "@peculiar/asn1-rsa": "^2.3.8", + "@peculiar/asn1-schema": "^2.3.8", + "asn1js": "^3.0.5", + "tslib": "^2.6.2" + } + }, + "node_modules/@peculiar/asn1-pkcs8": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-pkcs8/-/asn1-pkcs8-2.3.8.tgz", + "integrity": "sha512-rL8k2x59v8lZiwLRqdMMmOJ30GHt6yuHISFIuuWivWjAJjnxzZBVzMTQ72sknX5MeTSSvGwPmEFk2/N8+UztFQ==", + "dev": true, + "dependencies": { + "@peculiar/asn1-schema": "^2.3.8", + "@peculiar/asn1-x509": "^2.3.8", + "asn1js": "^3.0.5", + "tslib": "^2.6.2" + } + }, + "node_modules/@peculiar/asn1-pkcs9": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-pkcs9/-/asn1-pkcs9-2.3.8.tgz", + "integrity": "sha512-+nONq5tcK7vm3qdY7ZKoSQGQjhJYMJbwJGbXLFOhmqsFIxEWyQPHyV99+wshOjpOjg0wUSSkEEzX2hx5P6EKeQ==", + "dev": true, + "dependencies": { + "@peculiar/asn1-cms": "^2.3.8", + "@peculiar/asn1-pfx": "^2.3.8", + "@peculiar/asn1-pkcs8": "^2.3.8", + "@peculiar/asn1-schema": "^2.3.8", + "@peculiar/asn1-x509": "^2.3.8", + "@peculiar/asn1-x509-attr": "^2.3.8", + "asn1js": "^3.0.5", + "tslib": "^2.6.2" + } + }, + "node_modules/@peculiar/asn1-rsa": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-rsa/-/asn1-rsa-2.3.8.tgz", + "integrity": "sha512-ES/RVEHu8VMYXgrg3gjb1m/XG0KJWnV4qyZZ7mAg7rrF3VTmRbLxO8mk+uy0Hme7geSMebp+Wvi2U6RLLEs12Q==", + "dev": true, + "dependencies": { + "@peculiar/asn1-schema": "^2.3.8", + "@peculiar/asn1-x509": "^2.3.8", + "asn1js": "^3.0.5", + "tslib": "^2.6.2" + } + }, + "node_modules/@peculiar/asn1-schema": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-2.3.8.tgz", + "integrity": "sha512-ULB1XqHKx1WBU/tTFIA+uARuRoBVZ4pNdOA878RDrRbBfBGcSzi5HBkdScC6ZbHn8z7L8gmKCgPC1LHRrP46tA==", + "dev": true, + "dependencies": { + "asn1js": "^3.0.5", + "pvtsutils": "^1.3.5", + "tslib": "^2.6.2" + } + }, + "node_modules/@peculiar/asn1-x509": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-x509/-/asn1-x509-2.3.8.tgz", + "integrity": "sha512-voKxGfDU1c6r9mKiN5ZUsZWh3Dy1BABvTM3cimf0tztNwyMJPhiXY94eRTgsMQe6ViLfT6EoXxkWVzcm3mFAFw==", + "dev": true, + "dependencies": { + "@peculiar/asn1-schema": "^2.3.8", + "asn1js": "^3.0.5", + "ipaddr.js": "^2.1.0", + "pvtsutils": "^1.3.5", + "tslib": "^2.6.2" + } + }, + "node_modules/@peculiar/asn1-x509-attr": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-x509-attr/-/asn1-x509-attr-2.3.8.tgz", + "integrity": "sha512-4Z8mSN95MOuX04Aku9BUyMdsMKtVQUqWnr627IheiWnwFoheUhX3R4Y2zh23M7m80r4/WG8MOAckRKc77IRv6g==", + "dev": true, + "dependencies": { + "@peculiar/asn1-schema": "^2.3.8", + "@peculiar/asn1-x509": "^2.3.8", + "asn1js": "^3.0.5", + "tslib": "^2.6.2" + } + }, + "node_modules/@peculiar/json-schema": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/@peculiar/json-schema/-/json-schema-1.1.12.tgz", + "integrity": "sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w==", + "dev": true, + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@peculiar/webcrypto": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@peculiar/webcrypto/-/webcrypto-1.4.5.tgz", + "integrity": "sha512-oDk93QCDGdxFRM8382Zdminzs44dg3M2+E5Np+JWkpqLDyJC9DviMh8F8mEJkYuUcUOGA5jHO5AJJ10MFWdbZw==", + "dev": true, + "dependencies": { + "@peculiar/asn1-schema": "^2.3.8", + "@peculiar/json-schema": "^1.1.12", + "pvtsutils": "^1.3.5", + "tslib": "^2.6.2", + "webcrypto-core": "^1.7.8" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/@peculiar/x509": { + "version": "1.9.7", + "resolved": "https://registry.npmjs.org/@peculiar/x509/-/x509-1.9.7.tgz", + "integrity": "sha512-O+fR1ge6U8upO52q5b3d4tF4SxUdK4IQ0y++Z/Wlqq+ySZUf+deHnbMlDB1YZsIQ/DXU0i5M7Y1DyF5kwpXouQ==", + "dev": true, + "dependencies": { + "@peculiar/asn1-cms": "^2.3.8", + "@peculiar/asn1-csr": "^2.3.8", + "@peculiar/asn1-ecc": "^2.3.8", + "@peculiar/asn1-pkcs9": "^2.3.8", + "@peculiar/asn1-rsa": "^2.3.8", + "@peculiar/asn1-schema": "^2.3.8", + "@peculiar/asn1-x509": "^2.3.8", + "pvtsutils": "^1.3.5", + "reflect-metadata": "^0.2.1", + "tslib": "^2.6.2", + "tsyringe": "^4.8.0" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@sigstore/bundle": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-2.2.0.tgz", + "integrity": "sha512-5VI58qgNs76RDrwXNhpmyN/jKpq9evV/7f1XrcqcAfvxDl5SeVY/I5Rmfe96ULAV7/FK5dge9RBKGBJPhL1WsQ==", + "dependencies": { + "@sigstore/protobuf-specs": "^0.3.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@sigstore/core": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@sigstore/core/-/core-1.0.0.tgz", + "integrity": "sha512-dW2qjbWLRKGu6MIDUTBuJwXCnR8zivcSpf5inUzk7y84zqy/dji0/uahppoIgMoKeR+6pUZucrwHfkQQtiG9Rw==", + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@sigstore/mock": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@sigstore/mock/-/mock-0.6.5.tgz", + "integrity": "sha512-mMWj6SNmM+yGVZ9Qk2sDsVPZuwoPaLGzMFpVGdNeSYNC4HtzdrCihKYxJ+VSo0tdh+X6HwOUKaVtkRsjpY1ZbQ==", + "dev": true, + "dependencies": { + "@peculiar/webcrypto": "^1.4.5", + "@peculiar/x509": "^1.9.7", + "@sigstore/protobuf-specs": "^0.3.0", + "asn1js": "^3.0.5", + "bytestreamjs": "^2.0.1", + "canonicalize": "^2.0.0", + "jose": "^5.2.2", + "nock": "^13.5.1", + "pkijs": "^3.0.15", + "pvutils": "^1.1.3" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@sigstore/protobuf-specs": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.3.0.tgz", + "integrity": "sha512-zxiQ66JFOjVvP9hbhGj/F/qNdsZfkGb/dVXSanNRNuAzMlr4MC95voPUBX8//ZNnmv3uSYzdfR/JSkrgvZTGxA==", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@sigstore/rekor-types": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sigstore/rekor-types/-/rekor-types-2.0.0.tgz", + "integrity": "sha512-gArf4ZWF5PNjxSlOZnNePwKTJ8uXn10D2jRm1e7CKSOZmRdblW0rHbGhjeVn312M+vuXzyaeii7jm0fcmA1UsQ==", + "dev": true, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@sigstore/sign": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/@sigstore/sign/-/sign-2.2.3.tgz", + "integrity": "sha512-LqlA+ffyN02yC7RKszCdMTS6bldZnIodiox+IkT8B2f8oRYXCB3LQ9roXeiEL21m64CVH1wyveYAORfD65WoSw==", + "dependencies": { + "@sigstore/bundle": "^2.2.0", + "@sigstore/core": "^1.0.0", + "@sigstore/protobuf-specs": "^0.3.0", + "make-fetch-happen": "^13.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@types/make-fetch-happen": { + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/@types/make-fetch-happen/-/make-fetch-happen-10.0.4.tgz", + "integrity": "sha512-jKzweQaEMMAi55ehvR1z0JF6aSVQm/h1BXBhPLOJriaeQBctjw5YbpIGs7zAx9dN0Sa2OO5bcXwCkrlgenoPEA==", + "dev": true, + "dependencies": { + "@types/node-fetch": "*", + "@types/retry": "*", + "@types/ssri": "*" + } + }, + "node_modules/@types/node": { + "version": "20.11.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.19.tgz", + "integrity": "sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/node-fetch": { + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.11.tgz", + "integrity": "sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==", + "dev": true, + "dependencies": { + "@types/node": "*", + "form-data": "^4.0.0" + } + }, + "node_modules/@types/retry": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.5.tgz", + "integrity": "sha512-3xSjTp3v03X/lSQLkczaN9UIEwJMoMCA1+Nb5HfbJEQWogdeQIyVtTvxPXDQjZ5zws8rFQfVfRdz03ARihPJgw==", + "dev": true + }, + "node_modules/@types/ssri": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/@types/ssri/-/ssri-7.1.5.tgz", + "integrity": "sha512-odD/56S3B51liILSk5aXJlnYt99S6Rt9EFDDqGtJM26rKHApHcwyU/UoYHrzKkdkHMAIquGWCuHtQTbes+FRQw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/asn1js": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/asn1js/-/asn1js-3.0.5.tgz", + "integrity": "sha512-FVnvrKJwpt9LP2lAMl8qZswRNm3T4q9CON+bxldk2iwk3FFpuwhx2FfinyitizWHsVYyaY+y5JzDR0rCMV5yTQ==", + "dev": true, + "dependencies": { + "pvtsutils": "^1.3.2", + "pvutils": "^1.1.3", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/before-after-hook": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", + "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==" + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/bytestreamjs": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bytestreamjs/-/bytestreamjs-2.0.1.tgz", + "integrity": "sha512-U1Z/ob71V/bXfVABvNr/Kumf5VyeQRBEm6Txb0PQ6S7V5GpBM3w4Cbqz/xPDicR5tN0uvDifng8C+5qECeGwyQ==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/cacache": { + "version": "18.0.2", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-18.0.2.tgz", + "integrity": "sha512-r3NU8h/P+4lVUHfeRw1dtgQYar3DZMm4/cm2bZgOvrFC/su7budSOeqh52VJIC4U4iG1WWwV6vRW0znqBvxNuw==", + "dependencies": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^2.0.1", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/canonicalize": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/canonicalize/-/canonicalize-2.0.0.tgz", + "integrity": "sha512-ulDEYPv7asdKvqahuAY35c1selLdzDwHqugK92hfkzvlDCwXRRelDkR+Er33md/PtnpqHemgkuDPanZ4fiYZ8w==", + "dev": true + }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "engines": { + "node": ">=10" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "engines": { + "node": ">=6" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + }, + "node_modules/encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, + "node_modules/err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==" + }, + "node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fs-minipass": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz", + "integrity": "sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/glob": { + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/ipaddr.js": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.1.0.tgz", + "integrity": "sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/jackspeak": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jose": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/jose/-/jose-5.2.2.tgz", + "integrity": "sha512-/WByRr4jDcsKlvMd1dRJnPfS1GVO3WuKyaurJ/vvXcOaUQO8rnNObCQMlv/5uCceVQIq5Q4WLF44ohsdiTohdg==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==" + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true + }, + "node_modules/lru-cache": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", + "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/make-fetch-happen": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-13.0.0.tgz", + "integrity": "sha512-7ThobcL8brtGo9CavByQrQi+23aIfgYU++wg4B87AIS8Rb2ZBt/MEaDqzA00Xwv/jUjAjYkLHjVolYuTLKda2A==", + "dependencies": { + "@npmcli/agent": "^2.0.0", + "cacache": "^18.0.0", + "http-cache-semantics": "^4.1.1", + "is-lambda": "^1.0.1", + "minipass": "^7.0.2", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "ssri": "^10.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", + "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minipass-collect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-2.0.1.tgz", + "integrity": "sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw==", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minipass-fetch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.4.tgz", + "integrity": "sha512-jHAqnA728uUpIaFm7NWsCnqKT6UqZz7GcI/bDpPATuwYyKwJwW0remxSCxUlKiEty+eopHGa3oc8WxgQ1FFJqg==", + "dependencies": { + "minipass": "^7.0.3", + "minipass-sized": "^1.0.3", + "minizlib": "^2.1.2" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + }, + "optionalDependencies": { + "encoding": "^0.1.13" + } + }, + "node_modules/minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-flush/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-pipeline/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nock": { + "version": "13.5.1", + "resolved": "https://registry.npmjs.org/nock/-/nock-13.5.1.tgz", + "integrity": "sha512-+s7b73fzj5KnxbKH4Oaqz07tQ8degcMilU4rrmnKvI//b0JMBU4wEXFQ8zqr+3+L4eWSfU3H/UoIVGUV0tue1Q==", + "dev": true, + "dependencies": { + "debug": "^4.1.0", + "json-stringify-safe": "^5.0.1", + "propagate": "^2.0.0" + }, + "engines": { + "node": ">= 10.13" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", + "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", + "dependencies": { + "lru-cache": "^9.1.1 || ^10.0.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/pkijs": { + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/pkijs/-/pkijs-3.0.15.tgz", + "integrity": "sha512-n7nAl9JpqdeQsjy+rPmswkmZ3oO/Fu5uN9me45PPQVdWjd0X7HKfL8+HYwfxihqoDSSPUIajkOcqFxEUxMqhwQ==", + "dev": true, + "dependencies": { + "asn1js": "^3.0.5", + "bytestreamjs": "^2.0.0", + "pvtsutils": "^1.3.2", + "pvutils": "^1.1.3", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/propagate": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/propagate/-/propagate-2.0.1.tgz", + "integrity": "sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/pvtsutils": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/pvtsutils/-/pvtsutils-1.3.5.tgz", + "integrity": "sha512-ARvb14YB9Nm2Xi6nBq1ZX6dAM0FsJnuk+31aUp4TrcZEdKUlSqOqsxJHUPJDNE3qiIp+iUPEIeR6Je/tgV7zsA==", + "dev": true, + "dependencies": { + "tslib": "^2.6.1" + } + }, + "node_modules/pvutils": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/pvutils/-/pvutils-1.1.3.tgz", + "integrity": "sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/reflect-metadata": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.1.tgz", + "integrity": "sha512-i5lLI6iw9AU3Uu4szRNPPEkomnkjRTaVt9hy/bn5g/oSzekBSMeLZblcjP74AW0vBabqERLLIrz+gR8QYR54Tw==", + "dev": true + }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "optional": true + }, + "node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.3.tgz", + "integrity": "sha512-vfuYK48HXCTFD03G/1/zkIls3Ebr2YNa4qU9gHDZdblHLiqhJrJGkY3+0Nx0JpN9qBhJbVObc1CNciT1bIZJxw==", + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.2.tgz", + "integrity": "sha512-8zuqoLv1aP/66PHF5TqwJ7Czm3Yv32urJQHrVyhD7mmA6d61Zv8cIXQYPTWwmg6qlupnPvs/QKDmfa4P/qct2g==", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "socks": "^2.7.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==" + }, + "node_modules/ssri": { + "version": "10.0.5", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.5.tgz", + "integrity": "sha512-bSf16tAFkGeRlUNDjXu8FzaMQt6g2HZJrun7mtMbIPOddxt3GLMSz5VWUWcqTJUPfLEaDIepGxv+bYQW49596A==", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/tar": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", + "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, + "node_modules/tsyringe": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/tsyringe/-/tsyringe-4.8.0.tgz", + "integrity": "sha512-YB1FG+axdxADa3ncEtRnQCFq/M0lALGLxSZeVNbTU8NqhOVc51nnv2CISTcvc1kyv6EGPtXVr0v6lWeDxiijOA==", + "dev": true, + "dependencies": { + "tslib": "^1.9.3" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/tsyringe/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + } + }, + "node_modules/undici": { + "version": "5.28.3", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.3.tgz", + "integrity": "sha512-3ItfzbrhDlINjaP0duwnNsKpDQk3acHI3gVJ1z4fmwMK31k5G9OVIAMLSIaP6w4FaGkaAkN6zaQO9LUvZ1t7VA==", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/unique-filename": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-3.0.0.tgz", + "integrity": "sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==", + "dependencies": { + "unique-slug": "^4.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/unique-slug": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-4.0.0.tgz", + "integrity": "sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==", + "dependencies": { + "imurmurhash": "^0.1.4" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/universal-user-agent": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", + "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==" + }, + "node_modules/webcrypto-core": { + "version": "1.7.8", + "resolved": "https://registry.npmjs.org/webcrypto-core/-/webcrypto-core-1.7.8.tgz", + "integrity": "sha512-eBR98r9nQXTqXt/yDRtInszPMjTaSAMJAFDg2AHsgrnczawT1asx9YNBX6k5p+MekbPF4+s/UJJrr88zsTqkSg==", + "dev": true, + "dependencies": { + "@peculiar/asn1-schema": "^2.3.8", + "@peculiar/json-schema": "^1.1.12", + "asn1js": "^3.0.1", + "pvtsutils": "^1.3.5", + "tslib": "^2.6.2" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + }, + "dependencies": { + "@actions/github": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@actions/github/-/github-6.0.0.tgz", + "integrity": "sha512-alScpSVnYmjNEXboZjarjukQEzgCRmjMv6Xj47fsdnqGS73bjJNDpiiXmp8jr0UZLdUB6d9jW63IcmddUP+l0g==", + "requires": { + "@actions/http-client": "^2.2.0", + "@octokit/core": "^5.0.1", + "@octokit/plugin-paginate-rest": "^9.0.0", + "@octokit/plugin-rest-endpoint-methods": "^10.0.0" + } + }, + "@actions/http-client": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.0.tgz", + "integrity": "sha512-q+epW0trjVUUHboliPb4UF9g2msf+w61b32tAkFEwL/IwP0DQWgbCMM0Hbe3e3WXSKz5VcUXbzJQgy8Hkra/Lg==", + "requires": { + "tunnel": "^0.0.6", + "undici": "^5.25.4" + } + }, + "@fastify/busboy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.0.tgz", + "integrity": "sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==" + }, + "@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "requires": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + } + }, + "@npmcli/agent": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@npmcli/agent/-/agent-2.2.1.tgz", + "integrity": "sha512-H4FrOVtNyWC8MUwL3UfjOsAihHvT1Pe8POj3JvjXhSTJipsZMtgUALCT4mGyYZNxymkUfOw3PUj6dE4QPp6osQ==", + "requires": { + "agent-base": "^7.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.1" + } + }, + "@npmcli/fs": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.0.tgz", + "integrity": "sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==", + "requires": { + "semver": "^7.3.5" + } + }, + "@octokit/auth-token": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", + "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==" + }, + "@octokit/core": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.1.0.tgz", + "integrity": "sha512-BDa2VAMLSh3otEiaMJ/3Y36GU4qf6GI+VivQ/P41NC6GHcdxpKlqV0ikSZ5gdQsmS3ojXeRx5vasgNTinF0Q4g==", + "requires": { + "@octokit/auth-token": "^4.0.0", + "@octokit/graphql": "^7.0.0", + "@octokit/request": "^8.0.2", + "@octokit/request-error": "^5.0.0", + "@octokit/types": "^12.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + } + }, + "@octokit/endpoint": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.4.tgz", + "integrity": "sha512-DWPLtr1Kz3tv8L0UvXTDP1fNwM0S+z6EJpRcvH66orY6Eld4XBMCSYsaWp4xIm61jTWxK68BrR7ibO+vSDnZqw==", + "requires": { + "@octokit/types": "^12.0.0", + "universal-user-agent": "^6.0.0" + } + }, + "@octokit/graphql": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.0.2.tgz", + "integrity": "sha512-OJ2iGMtj5Tg3s6RaXH22cJcxXRi7Y3EBqbHTBRq+PQAqfaS8f/236fUrWhfSn8P4jovyzqucxme7/vWSSZBX2Q==", + "requires": { + "@octokit/request": "^8.0.1", + "@octokit/types": "^12.0.0", + "universal-user-agent": "^6.0.0" + } + }, + "@octokit/openapi-types": { + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-19.1.0.tgz", + "integrity": "sha512-6G+ywGClliGQwRsjvqVYpklIfa7oRPA0vyhPQG/1Feh+B+wU0vGH1JiJ5T25d3g1JZYBHzR2qefLi9x8Gt+cpw==" + }, + "@octokit/plugin-paginate-rest": { + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-9.1.5.tgz", + "integrity": "sha512-WKTQXxK+bu49qzwv4qKbMMRXej1DU2gq017euWyKVudA6MldaSSQuxtz+vGbhxV4CjxpUxjZu6rM2wfc1FiWVg==", + "requires": { + "@octokit/types": "^12.4.0" + } + }, + "@octokit/plugin-rest-endpoint-methods": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-10.3.0.tgz", + "integrity": "sha512-c/fjpoHispRvBZuRoTVt/uALg7pXa9RQbXWJiDMk6NDkGNomuAZG7YuYYpZoxeoXv+kVRjIDTsO0e1z0pei+PQ==", + "requires": { + "@octokit/types": "^12.4.0" + } + }, + "@octokit/request": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.2.0.tgz", + "integrity": "sha512-exPif6x5uwLqv1N1irkLG1zZNJkOtj8bZxuVHd71U5Ftuxf2wGNvAJyNBcPbPC+EBzwYEbBDdSFb8EPcjpYxPQ==", + "requires": { + "@octokit/endpoint": "^9.0.0", + "@octokit/request-error": "^5.0.0", + "@octokit/types": "^12.0.0", + "universal-user-agent": "^6.0.0" + } + }, + "@octokit/request-error": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.0.1.tgz", + "integrity": "sha512-X7pnyTMV7MgtGmiXBwmO6M5kIPrntOXdyKZLigNfQWSEQzVxR4a4vo49vJjTWX70mPndj8KhfT4Dx+2Ng3vnBQ==", + "requires": { + "@octokit/types": "^12.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + } + }, + "@octokit/types": { + "version": "12.5.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.5.0.tgz", + "integrity": "sha512-YJEKcb0KkJlIUNU/zjnZwHEP8AoVh/OoIcP/1IyR4UHxExz7fzpe/a8IG4wBtQi7QDEqiomVLX88S6FpxxAJtg==", + "requires": { + "@octokit/openapi-types": "^19.1.0" + } + }, + "@peculiar/asn1-cms": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-cms/-/asn1-cms-2.3.8.tgz", + "integrity": "sha512-Wtk9R7yQxGaIaawHorWKP2OOOm/RZzamOmSWwaqGphIuU6TcKYih0slL6asZlSSZtVoYTrBfrddSOD/jTu9vuQ==", + "dev": true, + "requires": { + "@peculiar/asn1-schema": "^2.3.8", + "@peculiar/asn1-x509": "^2.3.8", + "@peculiar/asn1-x509-attr": "^2.3.8", + "asn1js": "^3.0.5", + "tslib": "^2.6.2" + } + }, + "@peculiar/asn1-csr": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-csr/-/asn1-csr-2.3.8.tgz", + "integrity": "sha512-ZmAaP2hfzgIGdMLcot8gHTykzoI+X/S53x1xoGbTmratETIaAbSWMiPGvZmXRA0SNEIydpMkzYtq4fQBxN1u1w==", + "dev": true, + "requires": { + "@peculiar/asn1-schema": "^2.3.8", + "@peculiar/asn1-x509": "^2.3.8", + "asn1js": "^3.0.5", + "tslib": "^2.6.2" + } + }, + "@peculiar/asn1-ecc": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-ecc/-/asn1-ecc-2.3.8.tgz", + "integrity": "sha512-Ah/Q15y3A/CtxbPibiLM/LKcMbnLTdUdLHUgdpB5f60sSvGkXzxJCu5ezGTFHogZXWNX3KSmYqilCrfdmBc6pQ==", + "dev": true, + "requires": { + "@peculiar/asn1-schema": "^2.3.8", + "@peculiar/asn1-x509": "^2.3.8", + "asn1js": "^3.0.5", + "tslib": "^2.6.2" + } + }, + "@peculiar/asn1-pfx": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-pfx/-/asn1-pfx-2.3.8.tgz", + "integrity": "sha512-XhdnCVznMmSmgy68B9pVxiZ1XkKoE1BjO4Hv+eUGiY1pM14msLsFZ3N7K46SoITIVZLq92kKkXpGiTfRjlNLyg==", + "dev": true, + "requires": { + "@peculiar/asn1-cms": "^2.3.8", + "@peculiar/asn1-pkcs8": "^2.3.8", + "@peculiar/asn1-rsa": "^2.3.8", + "@peculiar/asn1-schema": "^2.3.8", + "asn1js": "^3.0.5", + "tslib": "^2.6.2" + } + }, + "@peculiar/asn1-pkcs8": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-pkcs8/-/asn1-pkcs8-2.3.8.tgz", + "integrity": "sha512-rL8k2x59v8lZiwLRqdMMmOJ30GHt6yuHISFIuuWivWjAJjnxzZBVzMTQ72sknX5MeTSSvGwPmEFk2/N8+UztFQ==", + "dev": true, + "requires": { + "@peculiar/asn1-schema": "^2.3.8", + "@peculiar/asn1-x509": "^2.3.8", + "asn1js": "^3.0.5", + "tslib": "^2.6.2" + } + }, + "@peculiar/asn1-pkcs9": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-pkcs9/-/asn1-pkcs9-2.3.8.tgz", + "integrity": "sha512-+nONq5tcK7vm3qdY7ZKoSQGQjhJYMJbwJGbXLFOhmqsFIxEWyQPHyV99+wshOjpOjg0wUSSkEEzX2hx5P6EKeQ==", + "dev": true, + "requires": { + "@peculiar/asn1-cms": "^2.3.8", + "@peculiar/asn1-pfx": "^2.3.8", + "@peculiar/asn1-pkcs8": "^2.3.8", + "@peculiar/asn1-schema": "^2.3.8", + "@peculiar/asn1-x509": "^2.3.8", + "@peculiar/asn1-x509-attr": "^2.3.8", + "asn1js": "^3.0.5", + "tslib": "^2.6.2" + } + }, + "@peculiar/asn1-rsa": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-rsa/-/asn1-rsa-2.3.8.tgz", + "integrity": "sha512-ES/RVEHu8VMYXgrg3gjb1m/XG0KJWnV4qyZZ7mAg7rrF3VTmRbLxO8mk+uy0Hme7geSMebp+Wvi2U6RLLEs12Q==", + "dev": true, + "requires": { + "@peculiar/asn1-schema": "^2.3.8", + "@peculiar/asn1-x509": "^2.3.8", + "asn1js": "^3.0.5", + "tslib": "^2.6.2" + } + }, + "@peculiar/asn1-schema": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-2.3.8.tgz", + "integrity": "sha512-ULB1XqHKx1WBU/tTFIA+uARuRoBVZ4pNdOA878RDrRbBfBGcSzi5HBkdScC6ZbHn8z7L8gmKCgPC1LHRrP46tA==", + "dev": true, + "requires": { + "asn1js": "^3.0.5", + "pvtsutils": "^1.3.5", + "tslib": "^2.6.2" + } + }, + "@peculiar/asn1-x509": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-x509/-/asn1-x509-2.3.8.tgz", + "integrity": "sha512-voKxGfDU1c6r9mKiN5ZUsZWh3Dy1BABvTM3cimf0tztNwyMJPhiXY94eRTgsMQe6ViLfT6EoXxkWVzcm3mFAFw==", + "dev": true, + "requires": { + "@peculiar/asn1-schema": "^2.3.8", + "asn1js": "^3.0.5", + "ipaddr.js": "^2.1.0", + "pvtsutils": "^1.3.5", + "tslib": "^2.6.2" + } + }, + "@peculiar/asn1-x509-attr": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-x509-attr/-/asn1-x509-attr-2.3.8.tgz", + "integrity": "sha512-4Z8mSN95MOuX04Aku9BUyMdsMKtVQUqWnr627IheiWnwFoheUhX3R4Y2zh23M7m80r4/WG8MOAckRKc77IRv6g==", + "dev": true, + "requires": { + "@peculiar/asn1-schema": "^2.3.8", + "@peculiar/asn1-x509": "^2.3.8", + "asn1js": "^3.0.5", + "tslib": "^2.6.2" + } + }, + "@peculiar/json-schema": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/@peculiar/json-schema/-/json-schema-1.1.12.tgz", + "integrity": "sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w==", + "dev": true, + "requires": { + "tslib": "^2.0.0" + } + }, + "@peculiar/webcrypto": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@peculiar/webcrypto/-/webcrypto-1.4.5.tgz", + "integrity": "sha512-oDk93QCDGdxFRM8382Zdminzs44dg3M2+E5Np+JWkpqLDyJC9DviMh8F8mEJkYuUcUOGA5jHO5AJJ10MFWdbZw==", + "dev": true, + "requires": { + "@peculiar/asn1-schema": "^2.3.8", + "@peculiar/json-schema": "^1.1.12", + "pvtsutils": "^1.3.5", + "tslib": "^2.6.2", + "webcrypto-core": "^1.7.8" + } + }, + "@peculiar/x509": { + "version": "1.9.7", + "resolved": "https://registry.npmjs.org/@peculiar/x509/-/x509-1.9.7.tgz", + "integrity": "sha512-O+fR1ge6U8upO52q5b3d4tF4SxUdK4IQ0y++Z/Wlqq+ySZUf+deHnbMlDB1YZsIQ/DXU0i5M7Y1DyF5kwpXouQ==", + "dev": true, + "requires": { + "@peculiar/asn1-cms": "^2.3.8", + "@peculiar/asn1-csr": "^2.3.8", + "@peculiar/asn1-ecc": "^2.3.8", + "@peculiar/asn1-pkcs9": "^2.3.8", + "@peculiar/asn1-rsa": "^2.3.8", + "@peculiar/asn1-schema": "^2.3.8", + "@peculiar/asn1-x509": "^2.3.8", + "pvtsutils": "^1.3.5", + "reflect-metadata": "^0.2.1", + "tslib": "^2.6.2", + "tsyringe": "^4.8.0" + } + }, + "@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "optional": true + }, + "@sigstore/bundle": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-2.2.0.tgz", + "integrity": "sha512-5VI58qgNs76RDrwXNhpmyN/jKpq9evV/7f1XrcqcAfvxDl5SeVY/I5Rmfe96ULAV7/FK5dge9RBKGBJPhL1WsQ==", + "requires": { + "@sigstore/protobuf-specs": "^0.3.0" + } + }, + "@sigstore/core": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@sigstore/core/-/core-1.0.0.tgz", + "integrity": "sha512-dW2qjbWLRKGu6MIDUTBuJwXCnR8zivcSpf5inUzk7y84zqy/dji0/uahppoIgMoKeR+6pUZucrwHfkQQtiG9Rw==" + }, + "@sigstore/mock": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@sigstore/mock/-/mock-0.6.5.tgz", + "integrity": "sha512-mMWj6SNmM+yGVZ9Qk2sDsVPZuwoPaLGzMFpVGdNeSYNC4HtzdrCihKYxJ+VSo0tdh+X6HwOUKaVtkRsjpY1ZbQ==", + "dev": true, + "requires": { + "@peculiar/webcrypto": "^1.4.5", + "@peculiar/x509": "^1.9.7", + "@sigstore/protobuf-specs": "^0.3.0", + "asn1js": "^3.0.5", + "bytestreamjs": "^2.0.1", + "canonicalize": "^2.0.0", + "jose": "^5.2.2", + "nock": "^13.5.1", + "pkijs": "^3.0.15", + "pvutils": "^1.1.3" + } + }, + "@sigstore/protobuf-specs": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.3.0.tgz", + "integrity": "sha512-zxiQ66JFOjVvP9hbhGj/F/qNdsZfkGb/dVXSanNRNuAzMlr4MC95voPUBX8//ZNnmv3uSYzdfR/JSkrgvZTGxA==" + }, + "@sigstore/rekor-types": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sigstore/rekor-types/-/rekor-types-2.0.0.tgz", + "integrity": "sha512-gArf4ZWF5PNjxSlOZnNePwKTJ8uXn10D2jRm1e7CKSOZmRdblW0rHbGhjeVn312M+vuXzyaeii7jm0fcmA1UsQ==", + "dev": true + }, + "@sigstore/sign": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/@sigstore/sign/-/sign-2.2.3.tgz", + "integrity": "sha512-LqlA+ffyN02yC7RKszCdMTS6bldZnIodiox+IkT8B2f8oRYXCB3LQ9roXeiEL21m64CVH1wyveYAORfD65WoSw==", + "requires": { + "@sigstore/bundle": "^2.2.0", + "@sigstore/core": "^1.0.0", + "@sigstore/protobuf-specs": "^0.3.0", + "make-fetch-happen": "^13.0.0" + } + }, + "@types/make-fetch-happen": { + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/@types/make-fetch-happen/-/make-fetch-happen-10.0.4.tgz", + "integrity": "sha512-jKzweQaEMMAi55ehvR1z0JF6aSVQm/h1BXBhPLOJriaeQBctjw5YbpIGs7zAx9dN0Sa2OO5bcXwCkrlgenoPEA==", + "dev": true, + "requires": { + "@types/node-fetch": "*", + "@types/retry": "*", + "@types/ssri": "*" + } + }, + "@types/node": { + "version": "20.11.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.19.tgz", + "integrity": "sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==", + "dev": true, + "requires": { + "undici-types": "~5.26.4" + } + }, + "@types/node-fetch": { + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.11.tgz", + "integrity": "sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==", + "dev": true, + "requires": { + "@types/node": "*", + "form-data": "^4.0.0" + } + }, + "@types/retry": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.5.tgz", + "integrity": "sha512-3xSjTp3v03X/lSQLkczaN9UIEwJMoMCA1+Nb5HfbJEQWogdeQIyVtTvxPXDQjZ5zws8rFQfVfRdz03ARihPJgw==", + "dev": true + }, + "@types/ssri": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/@types/ssri/-/ssri-7.1.5.tgz", + "integrity": "sha512-odD/56S3B51liILSk5aXJlnYt99S6Rt9EFDDqGtJM26rKHApHcwyU/UoYHrzKkdkHMAIquGWCuHtQTbes+FRQw==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "requires": { + "debug": "^4.3.4" + } + }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, + "ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==" + }, + "ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==" + }, + "asn1js": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/asn1js/-/asn1js-3.0.5.tgz", + "integrity": "sha512-FVnvrKJwpt9LP2lAMl8qZswRNm3T4q9CON+bxldk2iwk3FFpuwhx2FfinyitizWHsVYyaY+y5JzDR0rCMV5yTQ==", + "dev": true, + "requires": { + "pvtsutils": "^1.3.2", + "pvutils": "^1.1.3", + "tslib": "^2.4.0" + } + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "before-after-hook": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", + "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==" + }, + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "requires": { + "balanced-match": "^1.0.0" + } + }, + "bytestreamjs": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bytestreamjs/-/bytestreamjs-2.0.1.tgz", + "integrity": "sha512-U1Z/ob71V/bXfVABvNr/Kumf5VyeQRBEm6Txb0PQ6S7V5GpBM3w4Cbqz/xPDicR5tN0uvDifng8C+5qECeGwyQ==", + "dev": true + }, + "cacache": { + "version": "18.0.2", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-18.0.2.tgz", + "integrity": "sha512-r3NU8h/P+4lVUHfeRw1dtgQYar3DZMm4/cm2bZgOvrFC/su7budSOeqh52VJIC4U4iG1WWwV6vRW0znqBvxNuw==", + "requires": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^2.0.1", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + } + }, + "canonicalize": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/canonicalize/-/canonicalize-2.0.0.tgz", + "integrity": "sha512-ulDEYPv7asdKvqahuAY35c1selLdzDwHqugK92hfkzvlDCwXRRelDkR+Er33md/PtnpqHemgkuDPanZ4fiYZ8w==", + "dev": true + }, + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==" + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true + }, + "deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" + }, + "eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" + }, + "emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + }, + "encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "optional": true, + "requires": { + "iconv-lite": "^0.6.2" + } + }, + "err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==" + }, + "foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + } + }, + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "fs-minipass": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz", + "integrity": "sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==", + "requires": { + "minipass": "^7.0.3" + } + }, + "glob": { + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "requires": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + } + }, + "http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" + }, + "http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "requires": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + } + }, + "https-proxy-agent": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "requires": { + "agent-base": "^7.0.2", + "debug": "4" + } + }, + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==" + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" + }, + "ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "requires": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + } + }, + "ipaddr.js": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.1.0.tgz", + "integrity": "sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "jackspeak": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "requires": { + "@isaacs/cliui": "^8.0.2", + "@pkgjs/parseargs": "^0.11.0" + } + }, + "jose": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/jose/-/jose-5.2.2.tgz", + "integrity": "sha512-/WByRr4jDcsKlvMd1dRJnPfS1GVO3WuKyaurJ/vvXcOaUQO8rnNObCQMlv/5uCceVQIq5Q4WLF44ohsdiTohdg==", + "dev": true + }, + "jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true + }, + "lru-cache": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", + "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==" + }, + "make-fetch-happen": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-13.0.0.tgz", + "integrity": "sha512-7ThobcL8brtGo9CavByQrQi+23aIfgYU++wg4B87AIS8Rb2ZBt/MEaDqzA00Xwv/jUjAjYkLHjVolYuTLKda2A==", + "requires": { + "@npmcli/agent": "^2.0.0", + "cacache": "^18.0.0", + "http-cache-semantics": "^4.1.1", + "is-lambda": "^1.0.1", + "minipass": "^7.0.2", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "ssri": "^10.0.0" + } + }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "requires": { + "mime-db": "1.52.0" + } + }, + "minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "minipass": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", + "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==" + }, + "minipass-collect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-2.0.1.tgz", + "integrity": "sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw==", + "requires": { + "minipass": "^7.0.3" + } + }, + "minipass-fetch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.4.tgz", + "integrity": "sha512-jHAqnA728uUpIaFm7NWsCnqKT6UqZz7GcI/bDpPATuwYyKwJwW0remxSCxUlKiEty+eopHGa3oc8WxgQ1FFJqg==", + "requires": { + "encoding": "^0.1.13", + "minipass": "^7.0.3", + "minipass-sized": "^1.0.3", + "minizlib": "^2.1.2" + } + }, + "minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "requires": { + "minipass": "^3.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "requires": { + "yallist": "^4.0.0" + } + } + } + }, + "minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "requires": { + "minipass": "^3.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "requires": { + "yallist": "^4.0.0" + } + } + } + }, + "minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "requires": { + "minipass": "^3.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "requires": { + "yallist": "^4.0.0" + } + } + } + }, + "minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "requires": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "requires": { + "yallist": "^4.0.0" + } + } + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" + }, + "nock": { + "version": "13.5.1", + "resolved": "https://registry.npmjs.org/nock/-/nock-13.5.1.tgz", + "integrity": "sha512-+s7b73fzj5KnxbKH4Oaqz07tQ8degcMilU4rrmnKvI//b0JMBU4wEXFQ8zqr+3+L4eWSfU3H/UoIVGUV0tue1Q==", + "dev": true, + "requires": { + "debug": "^4.1.0", + "json-stringify-safe": "^5.0.1", + "propagate": "^2.0.0" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "requires": { + "wrappy": "1" + } + }, + "p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, + "path-scurry": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", + "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", + "requires": { + "lru-cache": "^9.1.1 || ^10.0.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + } + }, + "pkijs": { + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/pkijs/-/pkijs-3.0.15.tgz", + "integrity": "sha512-n7nAl9JpqdeQsjy+rPmswkmZ3oO/Fu5uN9me45PPQVdWjd0X7HKfL8+HYwfxihqoDSSPUIajkOcqFxEUxMqhwQ==", + "dev": true, + "requires": { + "asn1js": "^3.0.5", + "bytestreamjs": "^2.0.0", + "pvtsutils": "^1.3.2", + "pvutils": "^1.1.3", + "tslib": "^2.4.0" + } + }, + "promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "requires": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + } + }, + "propagate": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/propagate/-/propagate-2.0.1.tgz", + "integrity": "sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==", + "dev": true + }, + "pvtsutils": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/pvtsutils/-/pvtsutils-1.3.5.tgz", + "integrity": "sha512-ARvb14YB9Nm2Xi6nBq1ZX6dAM0FsJnuk+31aUp4TrcZEdKUlSqOqsxJHUPJDNE3qiIp+iUPEIeR6Je/tgV7zsA==", + "dev": true, + "requires": { + "tslib": "^2.6.1" + } + }, + "pvutils": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/pvutils/-/pvutils-1.1.3.tgz", + "integrity": "sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ==", + "dev": true + }, + "reflect-metadata": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.1.tgz", + "integrity": "sha512-i5lLI6iw9AU3Uu4szRNPPEkomnkjRTaVt9hy/bn5g/oSzekBSMeLZblcjP74AW0vBabqERLLIrz+gR8QYR54Tw==", + "dev": true + }, + "retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "optional": true + }, + "semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "requires": { + "lru-cache": "^6.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + } + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + }, + "signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==" + }, + "smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==" + }, + "socks": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.3.tgz", + "integrity": "sha512-vfuYK48HXCTFD03G/1/zkIls3Ebr2YNa4qU9gHDZdblHLiqhJrJGkY3+0Nx0JpN9qBhJbVObc1CNciT1bIZJxw==", + "requires": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + } + }, + "socks-proxy-agent": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.2.tgz", + "integrity": "sha512-8zuqoLv1aP/66PHF5TqwJ7Czm3Yv32urJQHrVyhD7mmA6d61Zv8cIXQYPTWwmg6qlupnPvs/QKDmfa4P/qct2g==", + "requires": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "socks": "^2.7.1" + } + }, + "sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==" + }, + "ssri": { + "version": "10.0.5", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.5.tgz", + "integrity": "sha512-bSf16tAFkGeRlUNDjXu8FzaMQt6g2HZJrun7mtMbIPOddxt3GLMSz5VWUWcqTJUPfLEaDIepGxv+bYQW49596A==", + "requires": { + "minipass": "^7.0.3" + } + }, + "string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "requires": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + } + }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, + "strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "requires": { + "ansi-regex": "^6.0.1" + } + }, + "strip-ansi-cjs": { + "version": "npm:strip-ansi@6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + } + } + }, + "tar": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", + "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", + "requires": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "dependencies": { + "fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "requires": { + "minipass": "^3.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "requires": { + "yallist": "^4.0.0" + } + } + } + }, + "minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==" + } + } + }, + "tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, + "tsyringe": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/tsyringe/-/tsyringe-4.8.0.tgz", + "integrity": "sha512-YB1FG+axdxADa3ncEtRnQCFq/M0lALGLxSZeVNbTU8NqhOVc51nnv2CISTcvc1kyv6EGPtXVr0v6lWeDxiijOA==", + "dev": true, + "requires": { + "tslib": "^1.9.3" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } + } + }, + "tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" + }, + "undici": { + "version": "5.28.3", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.3.tgz", + "integrity": "sha512-3ItfzbrhDlINjaP0duwnNsKpDQk3acHI3gVJ1z4fmwMK31k5G9OVIAMLSIaP6w4FaGkaAkN6zaQO9LUvZ1t7VA==", + "requires": { + "@fastify/busboy": "^2.0.0" + } + }, + "undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "unique-filename": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-3.0.0.tgz", + "integrity": "sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==", + "requires": { + "unique-slug": "^4.0.0" + } + }, + "unique-slug": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-4.0.0.tgz", + "integrity": "sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==", + "requires": { + "imurmurhash": "^0.1.4" + } + }, + "universal-user-agent": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", + "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==" + }, + "webcrypto-core": { + "version": "1.7.8", + "resolved": "https://registry.npmjs.org/webcrypto-core/-/webcrypto-core-1.7.8.tgz", + "integrity": "sha512-eBR98r9nQXTqXt/yDRtInszPMjTaSAMJAFDg2AHsgrnczawT1asx9YNBX6k5p+MekbPF4+s/UJJrr88zsTqkSg==", + "dev": true, + "requires": { + "@peculiar/asn1-schema": "^2.3.8", + "@peculiar/json-schema": "^1.1.12", + "asn1js": "^3.0.1", + "pvtsutils": "^1.3.5", + "tslib": "^2.6.2" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + }, + "wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "requires": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + } + }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } +} diff --git a/packages/attest/package.json b/packages/attest/package.json new file mode 100644 index 00000000..1e6eecea --- /dev/null +++ b/packages/attest/package.json @@ -0,0 +1,49 @@ +{ + "name": "@actions/attest", + "version": "0.0.0", + "description": "Actions attestation lib", + "keywords": [ + "github", + "actions", + "attestation" + ], + "homepage": "https://github.com/actions/toolkit/tree/main/packages/attest", + "license": "MIT", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "directories": { + "lib": "lib", + "test": "__tests__" + }, + "files": [ + "lib" + ], + "publishConfig": { + "access": "public", + "provenance": true + }, + "repository": { + "type": "git", + "url": "git+https://github.com/actions/toolkit.git", + "directory": "packages/attest" + }, + "scripts": { + "test": "echo \"Error: run tests from root\" && exit 1", + "tsc": "tsc" + }, + "bugs": { + "url": "https://github.com/actions/toolkit/issues" + }, + "devDependencies": { + "@sigstore/mock": "^0.6.5", + "@sigstore/rekor-types": "^2.0.0", + "@types/make-fetch-happen": "^10.0.4", + "nock": "^13.5.1" + }, + "dependencies": { + "@actions/github": "^6.0.0", + "@sigstore/bundle": "^2.2.0", + "@sigstore/sign": "^2.2.3", + "make-fetch-happen": "^13.0.0" + } +} diff --git a/packages/attest/src/attest.ts b/packages/attest/src/attest.ts new file mode 100644 index 00000000..2749132d --- /dev/null +++ b/packages/attest/src/attest.ts @@ -0,0 +1,96 @@ +import {Bundle, bundleToJSON} from '@sigstore/bundle' +import {X509Certificate} from 'crypto' +import {SigstoreInstance, signingEndpoints} from './endpoints' +import {buildIntotoStatement} from './intoto' +import {Payload, signPayload} from './sign' +import {writeAttestation} from './store' + +import type {Attestation, Predicate, Subject} from './shared.types' + +const INTOTO_PAYLOAD_TYPE = 'application/vnd.in-toto+json' + +/** + * Options for attesting a subject / predicate. + */ +export type AttestOptions = { + // The name of the subject to be attested. + subjectName: string + // The digest of the subject to be attested. Should be a map of digest + // algorithms to their hex-encoded values. + subjectDigest: Record + // Content type of the predicate being attested. + predicateType: string + // Predicate to be attested. + predicate: object + // GitHub token for writing attestations. + token: string + // Sigstore instance to use for signing. Must be one of "public-good" or + // "github". + sigstore?: SigstoreInstance + // Whether to skip writing the attestation to the GH attestations API. + skipWrite?: boolean +} + +/** + * Generates an attestation for the given subject and predicate. The subject and + * predicate are combined into an in-toto statement, which is then signed using + * the identified Sigstore instance and stored as an attestation. + * @param options - The options for attestation. + * @returns A promise that resolves to the attestation. + */ +export async function attest(options: AttestOptions): Promise { + const subject: Subject = { + name: options.subjectName, + digest: options.subjectDigest + } + const predicate: Predicate = { + type: options.predicateType, + params: options.predicate + } + const statement = buildIntotoStatement(subject, predicate) + + // Sign the provenance statement + const payload: Payload = { + body: Buffer.from(JSON.stringify(statement)), + type: INTOTO_PAYLOAD_TYPE + } + const endpoints = signingEndpoints(options.sigstore) + const bundle = await signPayload(payload, endpoints) + + // Store the attestation + let attestationID: string | undefined + if (options.skipWrite !== true) { + attestationID = await writeAttestation(bundleToJSON(bundle), options.token) + } + + return toAttestation(bundle, attestationID) +} + +function toAttestation(bundle: Bundle, attestationID?: string): Attestation { + let certBytes: Buffer + switch (bundle.verificationMaterial.content.$case) { + case 'x509CertificateChain': + certBytes = + bundle.verificationMaterial.content.x509CertificateChain.certificates[0] + .rawBytes + break + case 'certificate': + certBytes = bundle.verificationMaterial.content.certificate.rawBytes + break + default: + throw new Error('Bundle must contain an x509 certificate') + } + + const signingCert = new X509Certificate(certBytes) + + // Collect transparency log ID if available + const tlogEntries = bundle.verificationMaterial.tlogEntries + const tlogID = tlogEntries.length > 0 ? tlogEntries[0].logIndex : undefined + + return { + bundle: bundleToJSON(bundle), + certificate: signingCert.toString(), + tlogID, + attestationID + } +} diff --git a/packages/attest/src/endpoints.ts b/packages/attest/src/endpoints.ts new file mode 100644 index 00000000..3abecd1a --- /dev/null +++ b/packages/attest/src/endpoints.ts @@ -0,0 +1,50 @@ +import * as github from '@actions/github' + +const PUBLIC_GOOD_ID = 'public-good' +const GITHUB_ID = 'github' + +const FULCIO_PUBLIC_GOOD_URL = 'https://fulcio.sigstore.dev' +const REKOR_PUBLIC_GOOD_URL = 'https://rekor.sigstore.dev' + +const FULCIO_INTERNAL_URL = 'https://fulcio.githubapp.com' +const TSA_INTERNAL_URL = 'https://timestamp.githubapp.com' + +export type SigstoreInstance = typeof PUBLIC_GOOD_ID | typeof GITHUB_ID + +export type Endpoints = { + fulcioURL: string + rekorURL?: string + tsaServerURL?: string +} + +export const SIGSTORE_PUBLIC_GOOD: Endpoints = { + fulcioURL: FULCIO_PUBLIC_GOOD_URL, + rekorURL: REKOR_PUBLIC_GOOD_URL +} + +export const SIGSTORE_GITHUB: Endpoints = { + fulcioURL: FULCIO_INTERNAL_URL, + tsaServerURL: TSA_INTERNAL_URL +} + +export const signingEndpoints = (sigstore?: SigstoreInstance): Endpoints => { + let instance: SigstoreInstance + + // An explicitly set instance type takes precedence, but if not set, use the + // repository's visibility to determine the instance type. + if (sigstore && [PUBLIC_GOOD_ID, GITHUB_ID].includes(sigstore)) { + instance = sigstore + } else { + instance = + github.context.payload.repository?.visibility === 'public' + ? PUBLIC_GOOD_ID + : GITHUB_ID + } + + switch (instance) { + case PUBLIC_GOOD_ID: + return SIGSTORE_PUBLIC_GOOD + case GITHUB_ID: + return SIGSTORE_GITHUB + } +} diff --git a/packages/attest/src/index.ts b/packages/attest/src/index.ts new file mode 100644 index 00000000..43c0a472 --- /dev/null +++ b/packages/attest/src/index.ts @@ -0,0 +1,9 @@ +export {AttestOptions, attest} from './attest' +export { + AttestProvenanceOptions, + attestProvenance, + buildSLSAProvenancePredicate +} from './provenance' + +export type {SerializedBundle} from '@sigstore/bundle' +export type {Attestation, Predicate, Subject} from './shared.types' diff --git a/packages/attest/src/intoto.ts b/packages/attest/src/intoto.ts new file mode 100644 index 00000000..9d6a2d0e --- /dev/null +++ b/packages/attest/src/intoto.ts @@ -0,0 +1,32 @@ +import {Predicate, Subject} from './shared.types' + +const INTOTO_STATEMENT_V1_TYPE = 'https://in-toto.io/Statement/v1' + +/** + * An in-toto statement. + * https://github.com/in-toto/attestation/blob/main/spec/v1/statement.md + */ +export type InTotoStatement = { + _type: string + subject: Subject[] + predicateType: string + predicate: object +} + +/** + * Assembles the given subject and predicate into an in-toto statement. + * @param subject - The subject of the statement. + * @param predicate - The predicate of the statement. + * @returns The constructed in-toto statement. + */ +export const buildIntotoStatement = ( + subject: Subject, + predicate: Predicate +): InTotoStatement => { + return { + _type: INTOTO_STATEMENT_V1_TYPE, + subject: [subject], + predicateType: predicate.type, + predicate: predicate.params + } +} diff --git a/packages/attest/src/provenance.ts b/packages/attest/src/provenance.ts new file mode 100644 index 00000000..03f424f1 --- /dev/null +++ b/packages/attest/src/provenance.ts @@ -0,0 +1,93 @@ +import {attest, AttestOptions} from './attest' +import type {Attestation, Predicate} from './shared.types' + +const SLSA_PREDICATE_V1_TYPE = 'https://slsa.dev/provenance/v1' + +const GITHUB_BUILDER_ID_PREFIX = 'https://github.com/actions/runner' +const GITHUB_BUILD_TYPE = + 'https://slsa-framework.github.io/github-actions-buildtypes/workflow/v1' + +export type AttestProvenanceOptions = Omit< + AttestOptions, + 'predicate' | 'predicateType' +> + +/** + * Builds an SLSA (Supply Chain Levels for Software Artifacts) provenance + * predicate using the GitHub Actions Workflow build type. + * https://slsa.dev/spec/v1.0/provenance + * https://github.com/slsa-framework/github-actions-buildtypes/tree/main/workflow/v1 + * @param env - The Node.js process environment variables. Defaults to + * `process.env`. + * @returns The SLSA provenance predicate. + */ +export const buildSLSAProvenancePredicate = ( + env: NodeJS.ProcessEnv = process.env +): Predicate => { + const workflow = env.GITHUB_WORKFLOW_REF || '' + + // Split just the path and ref from the workflow string. + // owner/repo/.github/workflows/main.yml@main => + // .github/workflows/main.yml, main + const [workflowPath, workflowRef] = workflow + .replace(`${env.GITHUB_REPOSITORY}/`, '') + .split('@') + + return { + type: SLSA_PREDICATE_V1_TYPE, + params: { + buildDefinition: { + buildType: GITHUB_BUILD_TYPE, + externalParameters: { + workflow: { + ref: workflowRef, + repository: `${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}`, + path: workflowPath + } + }, + internalParameters: { + github: { + event_name: env.GITHUB_EVENT_NAME, + repository_id: env.GITHUB_REPOSITORY_ID, + repository_owner_id: env.GITHUB_REPOSITORY_OWNER_ID + } + }, + resolvedDependencies: [ + { + uri: `git+${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}@${env.GITHUB_REF}`, + digest: { + gitCommit: env.GITHUB_SHA + } + } + ] + }, + runDetails: { + builder: { + id: `${GITHUB_BUILDER_ID_PREFIX}/${env.RUNNER_ENVIRONMENT}` + }, + metadata: { + invocationId: `${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}/attempts/${env.GITHUB_RUN_ATTEMPT}` + } + } + } + } +} + +/** + * Attests the build provenance of the provided subject. Generates the SLSA + * build provenance predicate, assembles it into an in-toto statement, and + * attests it. + * + * @param options - The options for attesting the provenance. + * @returns A promise that resolves to the attestation. + */ +export async function attestProvenance( + options: AttestProvenanceOptions +): Promise { + const predicate = buildSLSAProvenancePredicate(process.env) + return attest({ + ...options, + predicateType: predicate.type, + predicate: predicate.params + }) +} diff --git a/packages/attest/src/shared.types.ts b/packages/attest/src/shared.types.ts new file mode 100644 index 00000000..92a896f7 --- /dev/null +++ b/packages/attest/src/shared.types.ts @@ -0,0 +1,52 @@ +import type {SerializedBundle} from '@sigstore/bundle' + +/* + * The subject of an attestation. + */ +export type Subject = { + /* + * Name of the subject. + */ + name: string + /* + * Digests of the subject. Should be a map of digest algorithms to their hex-encoded values. + */ + digest: Record +} + +/* + * The predicate of an attestation. + */ +export type Predicate = { + /* + * URI identifying the content type of the predicate. + */ + type: string + /* + * Predicate parameters. + */ + params: object +} + +/* + * Artifact attestation. + */ +export type Attestation = { + /* + * Serialized Sigstore bundle containing the provenance attestation, + * signature, signing certificate and witnessed timestamp. + */ + bundle: SerializedBundle + /* + * PEM-encoded signing certificate used to sign the attestation. + */ + certificate: string + /* + * ID of Rekor transparency log entry created for the attestation. + */ + tlogID?: string + /* + * ID of the persisted attestation (accessible via the GH API). + */ + attestationID?: string +} diff --git a/packages/attest/src/sign.ts b/packages/attest/src/sign.ts new file mode 100644 index 00000000..a8bc1dcd --- /dev/null +++ b/packages/attest/src/sign.ts @@ -0,0 +1,107 @@ +import {Bundle} from '@sigstore/bundle' +import { + BundleBuilder, + CIContextProvider, + DSSEBundleBuilder, + FulcioSigner, + RekorWitness, + TSAWitness, + Witness +} from '@sigstore/sign' + +const OIDC_AUDIENCE = 'sigstore' +const DEFAULT_TIMEOUT = 10000 +const DEFAULT_RETRIES = 3 + +/** + * The payload to be signed (body) and its media type (type). + */ +export type Payload = { + body: Buffer + type: string +} + +/** + * Options for signing a document. + */ +export type SignOptions = { + /** + * The URL of the Fulcio service. + */ + fulcioURL: string + /** + * The URL of the Rekor service. + */ + rekorURL?: string + /** + * The URL of the TSA (Time Stamping Authority) server. + */ + tsaServerURL?: string + /** + * The timeout duration in milliseconds when communicating with Sigstore + * services. + */ + timeout?: number + /** + * The number of retry attempts. + */ + retry?: number +} + +/** + * Signs the provided payload with a Sigstore-issued certificate and returns the + * signature bundle. + * @param payload Payload to be signed. + * @param options Signing options. + * @returns A promise that resolves to the Sigstore signature bundle. + */ +export const signPayload = async ( + payload: Payload, + options: SignOptions +): Promise => { + const artifact = { + data: payload.body, + type: payload.type + } + + // Sign the artifact and build the bundle + return initBundleBuilder(options).create(artifact) +} + +// Assembles the Sigstore bundle builder with the appropriate options +const initBundleBuilder = (opts: SignOptions): BundleBuilder => { + const identityProvider = new CIContextProvider(OIDC_AUDIENCE) + const timeout = opts.timeout || DEFAULT_TIMEOUT + const retry = opts.retry || DEFAULT_RETRIES + const witnesses: Witness[] = [] + + const signer = new FulcioSigner({ + identityProvider, + fulcioBaseURL: opts.fulcioURL, + timeout, + retry + }) + + if (opts.rekorURL) { + witnesses.push( + new RekorWitness({ + rekorBaseURL: opts.rekorURL, + entryType: 'dsse', + timeout, + retry + }) + ) + } + + if (opts.tsaServerURL) { + witnesses.push( + new TSAWitness({ + tsaBaseURL: opts.tsaServerURL, + timeout, + retry + }) + ) + } + + return new DSSEBundleBuilder({signer, witnesses}) +} diff --git a/packages/attest/src/store.ts b/packages/attest/src/store.ts new file mode 100644 index 00000000..e7ebf659 --- /dev/null +++ b/packages/attest/src/store.ts @@ -0,0 +1,31 @@ +import * as github from '@actions/github' +import fetch from 'make-fetch-happen' + +const CREATE_ATTESTATION_REQUEST = 'POST /repos/{owner}/{repo}/attestations' + +/** + * Writes an attestation to the repository's attestations endpoint. + * @param attestation - The attestation to write. + * @param token - The GitHub token for authentication. + * @returns The ID of the attestation. + * @throws Error if the attestation fails to persist. + */ +export const writeAttestation = async ( + attestation: unknown, + token: string +): Promise => { + const octokit = github.getOctokit(token, {request: {fetch}}) + + try { + const response = await octokit.request(CREATE_ATTESTATION_REQUEST, { + owner: github.context.repo.owner, + repo: github.context.repo.repo, + data: {bundle: attestation} + }) + + return response.data?.id + } catch (err) { + const message = err instanceof Error ? err.message : err + throw new Error(`Failed to persist attestation: ${message}`) + } +} diff --git a/packages/attest/tsconfig.json b/packages/attest/tsconfig.json new file mode 100644 index 00000000..993eab1d --- /dev/null +++ b/packages/attest/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "baseUrl": "./", + "outDir": "./lib", + "declaration": true, + "rootDir": "./src" + }, + "include": [ + "./src" + ] +} From 37a562b194507e37df61d9232423ee89d3183bc0 Mon Sep 17 00:00:00 2001 From: Brian DeHamer Date: Mon, 26 Feb 2024 10:21:47 -0800 Subject: [PATCH 147/198] bump @actions/attest to 1.0.0 Signed-off-by: Brian DeHamer --- packages/attest/package-lock.json | 4 ++-- packages/attest/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/attest/package-lock.json b/packages/attest/package-lock.json index 2fb3b6b6..4840b0e8 100644 --- a/packages/attest/package-lock.json +++ b/packages/attest/package-lock.json @@ -1,12 +1,12 @@ { "name": "@actions/attest", - "version": "0.0.0", + "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@actions/attest", - "version": "0.0.0", + "version": "1.0.0", "license": "MIT", "dependencies": { "@actions/github": "^6.0.0", diff --git a/packages/attest/package.json b/packages/attest/package.json index 1e6eecea..82d9cd49 100644 --- a/packages/attest/package.json +++ b/packages/attest/package.json @@ -1,6 +1,6 @@ { "name": "@actions/attest", - "version": "0.0.0", + "version": "1.0.0", "description": "Actions attestation lib", "keywords": [ "github", From 8f53a1d37fc0223649d388cfd3a439b9260b930c Mon Sep 17 00:00:00 2001 From: Thomas Boop <52323235+thboop@users.noreply.github.com> Date: Mon, 26 Feb 2024 13:31:23 -0500 Subject: [PATCH 148/198] Update CODEOWNERS (#1673) --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index d6b5d118..9a505cb9 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -2,4 +2,4 @@ /packages/artifact/ @actions/artifacts-actions /packages/cache/ @actions/actions-cache -/package/attest/ @actions/package-security +/packages/attest/ @actions/package-security From 7f96bd610dc5c72bbb43a167dd19e95a8cd5844b Mon Sep 17 00:00:00 2001 From: Brian DeHamer Date: Mon, 26 Feb 2024 10:42:33 -0800 Subject: [PATCH 149/198] publish npm packages with build provenance Signed-off-by: Brian DeHamer --- .github/workflows/releases.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index e63d8185..5e70163e 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -62,7 +62,7 @@ jobs: NPM_TOKEN: ${{ secrets.TOKEN }} - name: publish - run: npm publish *.tgz + run: npm publish --provenance *.tgz - name: notify slack on failure if: failure() From 68b042febd888984b5fc2b4e850543bdd6936d3c Mon Sep 17 00:00:00 2001 From: Brian DeHamer Date: Mon, 26 Feb 2024 11:32:45 -0800 Subject: [PATCH 150/198] fix permissions for release workflow Signed-off-by: Brian DeHamer --- .github/workflows/releases.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 5e70163e..3f69cb63 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -5,7 +5,7 @@ on: inputs: package: required: true - description: 'core, artifact, cache, exec, github, glob, http-client, io, tool-cache' + description: 'core, artifact, cache, exec, github, glob, http-client, io, tool-cache, attest' jobs: test: @@ -49,6 +49,9 @@ jobs: runs-on: macos-latest needs: test environment: npm-publish + permissions: + contents: read + id-token: write steps: - name: download artifact From b7770574c2478dcac9dda9aa2ca7d951c680e61f Mon Sep 17 00:00:00 2001 From: Bethany Date: Wed, 28 Feb 2024 10:35:01 -0500 Subject: [PATCH 151/198] flip releases order --- packages/artifact/RELEASES.md | 204 +++++++++++++++++----------------- 1 file changed, 102 insertions(+), 102 deletions(-) diff --git a/packages/artifact/RELEASES.md b/packages/artifact/RELEASES.md index 7c30fe79..7298e3f5 100644 --- a/packages/artifact/RELEASES.md +++ b/packages/artifact/RELEASES.md @@ -1,15 +1,103 @@ # @actions/artifact Releases -### 0.1.0 +### 2.1.2 -- Initial release +- Updated the stream extract functionality to use `unzip.Parse()` instead of `unzip.Extract()` for greater control of unzipping artifacts + +### 2.1.1 + +- Updated `isGhes` check to include `.ghe.com` and `.ghe.localhost` as accepted hosts -### 0.2.0 +### 2.1.0 -- Fixes to TCP connections not closing -- GZip file compression to speed up downloads -- Improved logging and output -- Extra documentation +- Added `ArtifactClient#deleteArtifact` to delete artifacts by name [#1626](https://github.com/actions/toolkit/pull/1626) +- Update error messaging to be more useful [#1628](https://github.com/actions/toolkit/pull/1628) + +### 2.0.1 + +- Patch to fix transient request timeouts https://github.com/actions/download-artifact/issues/249 + +### 2.0.0 + +- Major release. Supports new Artifact backend for improved speed, reliability and behavior. +- Numerous API changes, [some breaking](./README.md#breaking-changes). + +- [Blog post with more info](https://github.blog/2024-02-12-get-started-with-v4-of-github-actions-artifacts/) + +### 1.1.1 + +- Fixed a bug in Node16 where if an HTTP download finished too quickly (<1ms, e.g. when it's mocked) we attempt to delete a temp file that has not been created yet [#1278](https://github.com/actions/toolkit/pull/1278/commits/b9de68a590daf37c6747e38d3cb4f1dd2cfb791c) + +### 1.1.0 + +- Add `x-actions-results-crc64` and `x-actions-results-md5` checksum headers on upload [#1063](https://github.com/actions/toolkit/pull/1063) + +### 1.0.2 + +- Update to v2.0.1 of `@actions/http-client` [#1087](https://github.com/actions/toolkit/pull/1087) + +### 1.0.1 + +- Update to v2.0.0 of `@actions/http-client` + +### 1.0.0 + +- Update `lockfileVersion` to `v2` in `package-lock.json` [#1009](https://github.com/actions/toolkit/pull/1009) + +### 0.6.1 + +- Fix for failing 0 byte file uploads on Windows [#962](https://github.com/actions/toolkit/pull/962) + +### 0.6.0 + +- Support upload from named pipes [#748](https://github.com/actions/toolkit/pull/748) +- Fixes to percentage values being greater than 100% when downloading all artifacts [#889](https://github.com/actions/toolkit/pull/889) +- Improved logging and output during artifact upload [#949](https://github.com/actions/toolkit/pull/949) +- Improvements to client-side validation for certain invalid characters not allowed during upload: [#951](https://github.com/actions/toolkit/pull/951) +- Faster upload speeds for certain types of large files by exempting gzip compression [#956](https://github.com/actions/toolkit/pull/956) +- More detailed logging when dealing with chunked uploads [#957](https://github.com/actions/toolkit/pull/957) + +### 0.5.2 + +- Add HTTP 500 as a retryable status code for artifact upload and download. + +### 0.5.1 + +- Bump @actions/http-client to version 1.0.11 to fix proxy related issues during artifact upload and download + +### 0.5.0 + +- Improved retry-ability for all http calls during artifact upload and download if an error is encountered + +### 0.4.2 + +- Improved retry-ability when a partial artifact download is encountered + +### 0.4.1 + +- Update to latest @actions/core version + +### 0.4.0 + +- Add option to specify custom retentions on artifacts +- +### 0.3.5 + +- Retry in the event of a 413 response + +### 0.3.3 + +- Increase chunk size during upload from 4MB to 8MB +- Improve user-agent strings during API calls to help internally diagnose issues + +### 0.3.2 + +- Fix to ensure readstreams get correctly reset in the event of a retry + +### 0.3.1 + +- Fix to ensure temporary gzip files get correctly deleted during artifact upload +- Remove spaces as a forbidden character during upload ### 0.3.0 @@ -20,101 +108,13 @@ - Clearer error message if storage quota has been reached - Improved logging and output during artifact download -### 0.3.1 +### 0.2.0 -- Fix to ensure temporary gzip files get correctly deleted during artifact upload -- Remove spaces as a forbidden character during upload +- Fixes to TCP connections not closing +- GZip file compression to speed up downloads +- Improved logging and output +- Extra documentation -### 0.3.2 +### 0.1.0 -- Fix to ensure readstreams get correctly reset in the event of a retry - -### 0.3.3 - -- Increase chunk size during upload from 4MB to 8MB -- Improve user-agent strings during API calls to help internally diagnose issues - -### 0.3.5 - -- Retry in the event of a 413 response - -### 0.4.0 - -- Add option to specify custom retentions on artifacts - -### 0.4.1 - -- Update to latest @actions/core version - -### 0.4.2 - -- Improved retry-ability when a partial artifact download is encountered - -### 0.5.0 - -- Improved retry-ability for all http calls during artifact upload and download if an error is encountered - -### 0.5.1 - -- Bump @actions/http-client to version 1.0.11 to fix proxy related issues during artifact upload and download - -### 0.5.2 - -- Add HTTP 500 as a retryable status code for artifact upload and download. - -### 0.6.0 - -- Support upload from named pipes [#748](https://github.com/actions/toolkit/pull/748) -- Fixes to percentage values being greater than 100% when downloading all artifacts [#889](https://github.com/actions/toolkit/pull/889) -- Improved logging and output during artifact upload [#949](https://github.com/actions/toolkit/pull/949) -- Improvements to client-side validation for certain invalid characters not allowed during upload: [#951](https://github.com/actions/toolkit/pull/951) -- Faster upload speeds for certain types of large files by exempting gzip compression [#956](https://github.com/actions/toolkit/pull/956) -- More detailed logging when dealing with chunked uploads [#957](https://github.com/actions/toolkit/pull/957) - -### 0.6.1 - -- Fix for failing 0 byte file uploads on Windows [#962](https://github.com/actions/toolkit/pull/962) - -### 1.0.0 - -- Update `lockfileVersion` to `v2` in `package-lock.json` [#1009](https://github.com/actions/toolkit/pull/1009) - -### 1.0.1 - -- Update to v2.0.0 of `@actions/http-client` - -### 1.0.2 - -- Update to v2.0.1 of `@actions/http-client` [#1087](https://github.com/actions/toolkit/pull/1087) - -### 1.1.0 - -- Add `x-actions-results-crc64` and `x-actions-results-md5` checksum headers on upload [#1063](https://github.com/actions/toolkit/pull/1063) - -### 1.1.1 - -- Fixed a bug in Node16 where if an HTTP download finished too quickly (<1ms, e.g. when it's mocked) we attempt to delete a temp file that has not been created yet [#1278](https://github.com/actions/toolkit/pull/1278/commits/b9de68a590daf37c6747e38d3cb4f1dd2cfb791c) - -### 2.0.0 - -- Major release. Supports new Artifact backend for improved speed, reliability and behavior. -- Numerous API changes, [some breaking](./README.md#breaking-changes). - -- Blog post with more info: TBD - -### 2.0.1 - -- Patch to fix transient request timeouts https://github.com/actions/download-artifact/issues/249 - -### 2.1.0 - -- Added `ArtifactClient#deleteArtifact` to delete artifacts by name [#1626](https://github.com/actions/toolkit/pull/1626) -- Update error messaging to be more useful [#1628](https://github.com/actions/toolkit/pull/1628) - -### 2.1.1 - -- Updated `isGhes` check to include `.ghe.com` and `.ghe.localhost` as accepted hosts - -### 2.1.2 - -- Updated the stream extract functionality to use `unzip.Parse()` instead of `unzip.Extract()` for greater control of unzipping artifacts +- Initial release From ff435e591d8adcef0ed2c17c28a42430d5ddd900 Mon Sep 17 00:00:00 2001 From: teatimeguest Date: Thu, 29 Feb 2024 02:10:57 +0900 Subject: [PATCH 152/198] Make sure RequestOptions.keepAlive is applied properly on node20 runtime (#1572) --- packages/http-client/__tests__/keepalive.test.ts | 6 ++++++ packages/http-client/src/index.ts | 11 +++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/http-client/__tests__/keepalive.test.ts b/packages/http-client/__tests__/keepalive.test.ts index 1faff5ff..160069aa 100644 --- a/packages/http-client/__tests__/keepalive.test.ts +++ b/packages/http-client/__tests__/keepalive.test.ts @@ -11,6 +11,12 @@ describe('basics', () => { _http.dispose() }) + it.each([true, false])('creates Agent with keepAlive %s', keepAlive => { + const http = new httpm.HttpClient('http-client-tests', [], {keepAlive}) + const agent = http.getAgent('http://postman-echo.com') + expect(agent).toHaveProperty('keepAlive', keepAlive) + }) + it('does basic http get request with keepAlive true', async () => { const res: httpm.HttpClientResponse = await _http.get( 'http://postman-echo.com/get' diff --git a/packages/http-client/src/index.ts b/packages/http-client/src/index.ts index f1170ea0..6f575f7d 100644 --- a/packages/http-client/src/index.ts +++ b/packages/http-client/src/index.ts @@ -649,7 +649,7 @@ export class HttpClient { agent = this._proxyAgent } - if (this._keepAlive && !useProxy) { + if (!useProxy) { agent = this._agent } @@ -690,18 +690,13 @@ export class HttpClient { this._proxyAgent = agent } - // if reusing agent across request and tunneling agent isn't assigned create a new agent - if (this._keepAlive && !agent) { + // if tunneling agent isn't assigned create a new agent + if (!agent) { const options = {keepAlive: this._keepAlive, maxSockets} agent = usingSsl ? new https.Agent(options) : new http.Agent(options) this._agent = agent } - // if not using private agent and tunnel agent isn't setup then use global agent - if (!agent) { - agent = usingSsl ? https.globalAgent : http.globalAgent - } - if (usingSsl && this._ignoreSslError) { // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options From eea6b7f517770ffbd5888f9c642a30993aa05d5f Mon Sep 17 00:00:00 2001 From: Bethany Date: Thu, 29 Feb 2024 10:40:22 -0500 Subject: [PATCH 153/198] Update RELEASES.md --- packages/cache/RELEASES.md | 308 ++++++++++++++++++------------------- 1 file changed, 152 insertions(+), 156 deletions(-) diff --git a/packages/cache/RELEASES.md b/packages/cache/RELEASES.md index 23791046..43566ef1 100644 --- a/packages/cache/RELEASES.md +++ b/packages/cache/RELEASES.md @@ -1,16 +1,154 @@ # @actions/cache Releases -### 0.1.0 +### 3.2.4 -- Initial release +- Updated `isGhes` check to include `.ghe.com` and `.ghe.localhost` as accepted hosts + +### 3.2.3 -### 0.2.0 +- Fixed a bug that mutated path arguments to `getCacheVersion` [#1378](https://github.com/actions/toolkit/pull/1378) -- Fixes issues with the zstd compression algorithm on Windows and Ubuntu 16.04 [#469](https://github.com/actions/toolkit/pull/469) +### 3.2.2 -### 0.2.1 +- Add new default cache download method to improve performance and reduce hangs [#1484](https://github.com/actions/toolkit/pull/1484) -- Fix to await async function getCompressionMethod +### 3.2.1 + +- Updated @azure/storage-blob to `v12.13.0` + +### 3.2.0 + +- Add `lookupOnly` to cache restore `DownloadOptions`. + +### 3.1.4 + +- Fix zstd not being used due to `zstd --version` output change in zstd 1.5.4 release. See [#1353](https://github.com/actions/toolkit/pull/1353). + +### 3.1.3 + +- Fix to prevent from setting MYSYS environement variable globally [#1329](https://github.com/actions/toolkit/pull/1329). + +### 3.1.2 + +- Fix issue with symlink restoration on windows. + +### 3.1.1 + +- Reverted changes in 3.1.0 to fix issue with symlink restoration on windows. +- Added support for verbose logging about cache version during cache miss. + +### 3.1.0 + +- Update actions/cache on windows to use gnu tar and zstd by default +- Update actions/cache on windows to fallback to bsdtar and zstd if gnu tar is not available. +- Added support for fallback to gzip to restore old caches on windows. + +### 3.1.0-beta.3 + +- Bug Fixes for fallback to gzip to restore old caches on windows and bsdtar if gnutar is not available. + +### 3.1.0-beta.2 + +- Added support for fallback to gzip to restore old caches on windows. + +### 3.0.6 + +- Added `@azure/abort-controller` to dependencies to fix compatibility issue with ESM [#1208](https://github.com/actions/toolkit/issues/1208) + +### 3.0.5 + +- Update `@actions/cache` to use `@actions/core@^1.10.0` + +### 3.0.4 + +- Fix zstd not working for windows on gnu tar in issues [#888](https://github.com/actions/cache/issues/888) and [#891](https://github.com/actions/cache/issues/891). +- Allowing users to provide a custom timeout as input for aborting download of a cache segment using an environment variable `SEGMENT_DOWNLOAD_TIMEOUT_MINS`. Default is 60 minutes. + +### 3.0.3 + +- Bug fixes for download stuck issue [#810](https://github.com/actions/cache/issues/810). + +### 3.0.2 + +- Added 1 hour timeout for the download stuck issue [#810](https://github.com/actions/cache/issues/810). + +### 3.0.1 + +- Fix [#833](https://github.com/actions/cache/issues/833) - cache doesn't work with github workspace directory. +- Fix [#809](https://github.com/actions/cache/issues/809) `zstd -d: no such file or directory` error on AWS self-hosted runners. + +### 3.0.0 + +- Updated actions/cache to suppress Actions cache server error and log warning for those error [#1122](https://github.com/actions/toolkit/pull/1122) + +### 2.0.6 + +- Fix `Tar failed with error: The process '/usr/bin/tar' failed with exit code 1` issue when temp directory where tar is getting created is actually the subdirectory of the path mentioned by the user for caching. ([issue](https://github.com/actions/cache/issues/689)) + +### 2.0.5 + +- Fix to avoid saving empty cache when no files are available for caching. ([issue](https://github.com/actions/cache/issues/624)) + +### 2.0.4 + +- Update to v2.0.1 of `@actions/http-client` [#1087](https://github.com/actions/toolkit/pull/1087) + +### 2.0.3 + +- Update to v2.0.0 of `@actions/http-client` + +### 2.0.0 + +- Added support to check if Actions cache service feature is available or not [#1028](https://github.com/actions/toolkit/pull/1028) + +### 1.0.11 + +- Fix file downloads > 2GB([issue](https://github.com/actions/cache/issues/773)) + +### 1.0.10 + +- Update `lockfileVersion` to `v2` in `package-lock.json [#1022](https://github.com/actions/toolkit/pull/1022) + +### 1.0.9 + +- Use @azure/ms-rest-js v2.6.0 +- Use @azure/storage-blob v12.8.0 + +### 1.0.8 + +- Increase the allowed artifact cache size from 5GB to 10GB ([issue](https://github.com/actions/cache/discussions/497)) + +### 1.0.7 + +- Fixes permissions issue extracting archives with GNU tar on macOS ([issue](https://github.com/actions/cache/issues/527)) + +### 1.0.6 + +- Make caching more verbose [#650](https://github.com/actions/toolkit/pull/650) +- Use GNU tar on macOS if available [#701](https://github.com/actions/toolkit/pull/701) + +### 1.0.5 + +- Fix to ensure Windows cache paths get resolved correctly + +### 1.0.4 + +- Use @actions/core v1.2.6 +- Fixes uploadChunk to throw an error if any unsuccessful response code is received + +### 1.0.3 + +- Use http-client v1.0.9 +- Fixes error handling so retries are not attempted on non-retryable errors (409 Conflict, for example) +- Adds 5 second delay between retry attempts + +### 1.0.2 + +- Use posix archive format to add support for some tools + +### 1.0.1 + +- Fix bug in downloading large files (> 2 GBs) with the Azure SDK ### 1.0.0 @@ -19,156 +157,14 @@ - Includes changes that break compatibility with earlier versions, including: - `retry`, `retryTypedResponse`, and `retryHttpClientResponse` moved from `cacheHttpClient` to `requestUtils` -### 1.0.1 +### 0.2.1 -- Fix bug in downloading large files (> 2 GBs) with the Azure SDK +- Fix to await async function getCompressionMethod + +### 0.2.0 -### 1.0.2 +- Fixes issues with the zstd compression algorithm on Windows and Ubuntu 16.04 [#469](https://github.com/actions/toolkit/pull/469) + +### 0.1.0 -- Use posix archive format to add support for some tools - -### 1.0.3 - -- Use http-client v1.0.9 -- Fixes error handling so retries are not attempted on non-retryable errors (409 Conflict, for example) -- Adds 5 second delay between retry attempts - -### 1.0.4 - -- Use @actions/core v1.2.6 -- Fixes uploadChunk to throw an error if any unsuccessful response code is received - -### 1.0.5 - -- Fix to ensure Windows cache paths get resolved correctly - -### 1.0.6 - -- Make caching more verbose [#650](https://github.com/actions/toolkit/pull/650) -- Use GNU tar on macOS if available [#701](https://github.com/actions/toolkit/pull/701) - -### 1.0.7 - -- Fixes permissions issue extracting archives with GNU tar on macOS ([issue](https://github.com/actions/cache/issues/527)) - -### 1.0.8 - -- Increase the allowed artifact cache size from 5GB to 10GB ([issue](https://github.com/actions/cache/discussions/497)) - -### 1.0.9 - -- Use @azure/ms-rest-js v2.6.0 -- Use @azure/storage-blob v12.8.0 - -### 1.0.10 - -- Update `lockfileVersion` to `v2` in `package-lock.json [#1022](https://github.com/actions/toolkit/pull/1022) - -### 1.0.11 - -- Fix file downloads > 2GB([issue](https://github.com/actions/cache/issues/773)) - -### 2.0.0 - -- Added support to check if Actions cache service feature is available or not [#1028](https://github.com/actions/toolkit/pull/1028) - -### 2.0.3 - -- Update to v2.0.0 of `@actions/http-client` - -### 2.0.4 - -- Update to v2.0.1 of `@actions/http-client` [#1087](https://github.com/actions/toolkit/pull/1087) - -### 2.0.5 - -- Fix to avoid saving empty cache when no files are available for caching. ([issue](https://github.com/actions/cache/issues/624)) - -### 2.0.6 - -- Fix `Tar failed with error: The process '/usr/bin/tar' failed with exit code 1` issue when temp directory where tar is getting created is actually the subdirectory of the path mentioned by the user for caching. ([issue](https://github.com/actions/cache/issues/689)) - -### 3.0.0 - -- Updated actions/cache to suppress Actions cache server error and log warning for those error [#1122](https://github.com/actions/toolkit/pull/1122) - -### 3.0.1 - -- Fix [#833](https://github.com/actions/cache/issues/833) - cache doesn't work with github workspace directory. -- Fix [#809](https://github.com/actions/cache/issues/809) `zstd -d: no such file or directory` error on AWS self-hosted runners. - -### 3.0.2 - -- Added 1 hour timeout for the download stuck issue [#810](https://github.com/actions/cache/issues/810). - -### 3.0.3 - -- Bug fixes for download stuck issue [#810](https://github.com/actions/cache/issues/810). - -### 3.0.4 - -- Fix zstd not working for windows on gnu tar in issues [#888](https://github.com/actions/cache/issues/888) and [#891](https://github.com/actions/cache/issues/891). -- Allowing users to provide a custom timeout as input for aborting download of a cache segment using an environment variable `SEGMENT_DOWNLOAD_TIMEOUT_MINS`. Default is 60 minutes. - -### 3.0.5 - -- Update `@actions/cache` to use `@actions/core@^1.10.0` - -### 3.0.6 - -- Added `@azure/abort-controller` to dependencies to fix compatibility issue with ESM [#1208](https://github.com/actions/toolkit/issues/1208) - -### 3.1.0-beta.1 - -- Update actions/cache on windows to use gnu tar and zstd by default and fallback to bsdtar and zstd if gnu tar is not available. ([issue](https://github.com/actions/cache/issues/984)) - -### 3.1.0-beta.2 - -- Added support for fallback to gzip to restore old caches on windows. - -### 3.1.0-beta.3 - -- Bug Fixes for fallback to gzip to restore old caches on windows and bsdtar if gnutar is not available. - -### 3.1.0 - -- Update actions/cache on windows to use gnu tar and zstd by default -- Update actions/cache on windows to fallback to bsdtar and zstd if gnu tar is not available. -- Added support for fallback to gzip to restore old caches on windows. - -### 3.1.1 - -- Reverted changes in 3.1.0 to fix issue with symlink restoration on windows. -- Added support for verbose logging about cache version during cache miss. - -### 3.1.2 - -- Fix issue with symlink restoration on windows. - -### 3.1.3 - -- Fix to prevent from setting MYSYS environement variable globally [#1329](https://github.com/actions/toolkit/pull/1329). - -### 3.1.4 - -- Fix zstd not being used due to `zstd --version` output change in zstd 1.5.4 release. See [#1353](https://github.com/actions/toolkit/pull/1353). - -### 3.2.0 - -- Add `lookupOnly` to cache restore `DownloadOptions`. - -### 3.2.1 - -- Updated @azure/storage-blob to `v12.13.0` - -### 3.2.2 - -- Add new default cache download method to improve performance and reduce hangs [#1484](https://github.com/actions/toolkit/pull/1484) - -### 3.2.3 - -- Fixed a bug that mutated path arguments to `getCacheVersion` [#1378](https://github.com/actions/toolkit/pull/1378) - -### 3.2.4 - -- Updated `isGhes` check to include `.ghe.com` and `.ghe.localhost` as accepted hosts \ No newline at end of file +- Initial release From e918bf24aec5f7f3ed32906a02e9534c191e2aa8 Mon Sep 17 00:00:00 2001 From: Bethany Date: Thu, 29 Feb 2024 10:41:57 -0500 Subject: [PATCH 154/198] Update RELEASES.md --- packages/artifact/RELEASES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/artifact/RELEASES.md b/packages/artifact/RELEASES.md index 7298e3f5..9a1b6100 100644 --- a/packages/artifact/RELEASES.md +++ b/packages/artifact/RELEASES.md @@ -1,5 +1,9 @@ # @actions/artifact Releases +### 2.1.3 + +- Fixes a bug in the extract logic updated in 2.1.2 + ### 2.1.2 - Updated the stream extract functionality to use `unzip.Parse()` instead of `unzip.Extract()` for greater control of unzipping artifacts From bb420e4681af5920dd5be5314ebfc400031dcd31 Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Fri, 1 Mar 2024 12:54:40 -0500 Subject: [PATCH 155/198] add info level logging for zip extract --- packages/artifact/src/internal/download/download-artifact.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index c30d65f2..fb7fe0a3 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -112,7 +112,6 @@ export async function streamExtractExternal( reject(new Error(`Malformed extraction path: ${fullPath}`)) } - core.debug(`Extracting artifact entry: ${fullPath}`) if (entry.type === 'Directory') { if (!createdDirectories.has(fullPath)) { createdDirectories.add(fullPath) @@ -125,6 +124,7 @@ export async function streamExtractExternal( callback() } } else { + core.info(`Extracting artifact entry: ${fullPath}`) if (!createdDirectories.has(path.dirname(fullPath))) { createdDirectories.add(path.dirname(fullPath)) await resolveOrCreateDirectory(path.dirname(fullPath)) From 4799020e289c420c907c9745965e7f5a9f41de9d Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Fri, 1 Mar 2024 13:04:16 -0500 Subject: [PATCH 156/198] bump version --- packages/artifact/RELEASES.md | 4 ++++ packages/artifact/package-lock.json | 4 ++-- packages/artifact/package.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/artifact/RELEASES.md b/packages/artifact/RELEASES.md index 9a1b6100..ca32b7eb 100644 --- a/packages/artifact/RELEASES.md +++ b/packages/artifact/RELEASES.md @@ -1,5 +1,9 @@ # @actions/artifact Releases +### 2.1.4 + +- Adds info-level logging for zip extraction + ### 2.1.3 - Fixes a bug in the extract logic updated in 2.1.2 diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index 28ee4de7..4ce3c7fb 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -1,12 +1,12 @@ { "name": "@actions/artifact", - "version": "2.1.3", + "version": "2.1.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@actions/artifact", - "version": "2.1.3", + "version": "2.1.4", "license": "MIT", "dependencies": { "@actions/core": "^1.10.0", diff --git a/packages/artifact/package.json b/packages/artifact/package.json index e5668fba..c1557081 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -1,6 +1,6 @@ { "name": "@actions/artifact", - "version": "2.1.3", + "version": "2.1.4", "preview": true, "description": "Actions artifact lib", "keywords": [ From b807fc9c541224508f753d1cc8a18c66072c181e Mon Sep 17 00:00:00 2001 From: Luke Tomlinson Date: Fri, 1 Mar 2024 15:09:37 -0500 Subject: [PATCH 157/198] Update http-client to 2.2.1 (#1679) --- packages/http-client/package-lock.json | 2 +- packages/http-client/package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/http-client/package-lock.json b/packages/http-client/package-lock.json index dc7a9bd8..ea3d7951 100644 --- a/packages/http-client/package-lock.json +++ b/packages/http-client/package-lock.json @@ -1,6 +1,6 @@ { "name": "@actions/http-client", - "version": "2.2.0", + "version": "2.2.1", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/packages/http-client/package.json b/packages/http-client/package.json index ed134372..0ae89c34 100644 --- a/packages/http-client/package.json +++ b/packages/http-client/package.json @@ -1,6 +1,6 @@ { "name": "@actions/http-client", - "version": "2.2.0", + "version": "2.2.1", "description": "Actions Http Client", "keywords": [ "github", @@ -48,4 +48,4 @@ "tunnel": "^0.0.6", "undici": "^5.25.4" } -} +} \ No newline at end of file From 8fee77b04b4804acda1ad44a2857ba4239984d7f Mon Sep 17 00:00:00 2001 From: Smeb Date: Mon, 27 Nov 2023 13:53:26 +0100 Subject: [PATCH 158/198] fix #1579: add test to check getCacheVersion does not mutate arguments --- packages/cache/__tests__/cacheHttpClient.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/cache/__tests__/cacheHttpClient.test.ts b/packages/cache/__tests__/cacheHttpClient.test.ts index 02dd91c1..21c5ae86 100644 --- a/packages/cache/__tests__/cacheHttpClient.test.ts +++ b/packages/cache/__tests__/cacheHttpClient.test.ts @@ -5,6 +5,12 @@ import {DownloadOptions, getDownloadOptions} from '../src/options' jest.mock('../src/internal/downloadUtils') +test('getCacheVersion does not mutate arguments', async () => { + const paths = ['node_modules'] + getCacheVersion(paths, undefined, true) + expect(paths).toEqual(['node_modules']) +}) + test('getCacheVersion with one path returns version', async () => { const paths = ['node_modules'] const result = getCacheVersion(paths, undefined, true) From a0e6af1e532366e430aef99c44f002ec3abba38d Mon Sep 17 00:00:00 2001 From: Brian DeHamer Date: Thu, 21 Mar 2024 19:25:36 -0700 Subject: [PATCH 159/198] build provenance stmt from OIDC claims Signed-off-by: Brian DeHamer --- packages/attest/README.md | 4 + packages/attest/RELEASES.md | 4 + .../__snapshots__/intoto.test.ts.snap | 2 +- .../__snapshots__/provenance.test.ts.snap | 2 +- packages/attest/__tests__/intoto.test.ts | 2 +- packages/attest/__tests__/oidc.test.ts | 147 +++++ packages/attest/__tests__/provenance.test.ts | 369 ++++++------ packages/attest/__tests__/store.test.ts | 2 +- packages/attest/package-lock.json | 559 +++++++++++++++++- packages/attest/package.json | 8 +- packages/attest/src/oidc.ts | 102 ++++ packages/attest/src/provenance.ts | 42 +- 12 files changed, 1031 insertions(+), 212 deletions(-) create mode 100644 packages/attest/__tests__/oidc.test.ts create mode 100644 packages/attest/src/oidc.ts diff --git a/packages/attest/README.md b/packages/attest/README.md index cb3fe1ff..a8a98403 100644 --- a/packages/attest/README.md +++ b/packages/attest/README.md @@ -112,6 +112,10 @@ export type AttestProvenanceOptions = { sigstore?: 'public-good' | 'github' // Whether to skip writing the attestation to the GH attestations API. skipWrite?: boolean + // Issuer URL responsible for minting the OIDC token from which the + // provenance data is read. Defaults to + // 'https://token.actions.githubusercontent.com". + issuer?: string } ``` diff --git a/packages/attest/RELEASES.md b/packages/attest/RELEASES.md index a05e5d0d..d30960a1 100644 --- a/packages/attest/RELEASES.md +++ b/packages/attest/RELEASES.md @@ -1,5 +1,9 @@ # @actions/attest Releases +### 1.1.0 + +- Updates the `attestProvenance` function to retrieve a token from the GitHub OIDC provider and use the token claims to populate the provenance statement. + ### 1.0.0 - Initial release diff --git a/packages/attest/__tests__/__snapshots__/intoto.test.ts.snap b/packages/attest/__tests__/__snapshots__/intoto.test.ts.snap index 8f20e804..0d3be79a 100644 --- a/packages/attest/__tests__/__snapshots__/intoto.test.ts.snap +++ b/packages/attest/__tests__/__snapshots__/intoto.test.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`buildIntotoStatement returns a provenance hydrated from env vars 1`] = ` +exports[`buildIntotoStatement returns an intoto statement 1`] = ` { "_type": "https://in-toto.io/Statement/v1", "predicate": { diff --git a/packages/attest/__tests__/__snapshots__/provenance.test.ts.snap b/packages/attest/__tests__/__snapshots__/provenance.test.ts.snap index 2138d6f8..2aed4a16 100644 --- a/packages/attest/__tests__/__snapshots__/provenance.test.ts.snap +++ b/packages/attest/__tests__/__snapshots__/provenance.test.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`buildSLSAProvenancePredicate returns a provenance hydrated from env vars 1`] = ` +exports[`provenance functions buildSLSAProvenancePredicate returns a provenance hydrated from an OIDC token 1`] = ` { "params": { "buildDefinition": { diff --git a/packages/attest/__tests__/intoto.test.ts b/packages/attest/__tests__/intoto.test.ts index ada7e1ee..dd6a1a95 100644 --- a/packages/attest/__tests__/intoto.test.ts +++ b/packages/attest/__tests__/intoto.test.ts @@ -16,7 +16,7 @@ describe('buildIntotoStatement', () => { } } - it('returns a provenance hydrated from env vars', () => { + it('returns an intoto statement', () => { const statement = buildIntotoStatement(subject, predicate) expect(statement).toMatchSnapshot() }) diff --git a/packages/attest/__tests__/oidc.test.ts b/packages/attest/__tests__/oidc.test.ts new file mode 100644 index 00000000..5a6a665f --- /dev/null +++ b/packages/attest/__tests__/oidc.test.ts @@ -0,0 +1,147 @@ +import * as jose from 'jose' +import nock from 'nock' +import {getIDTokenClaims} from '../src/oidc' + +describe('getIDTokenClaims', () => { + const originalEnv = process.env + const issuer = 'https://example.com' + const audience = 'nobody' + const requestToken = 'token' + const openidConfigPath = '/.well-known/openid-configuration' + const jwksPath = '/.well-known/jwks.json' + const tokenPath = '/token' + const openIDConfig = {jwks_uri: `${issuer}${jwksPath}`} + + /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ + let key: any + + beforeEach(async () => { + process.env = { + ...originalEnv, + ACTIONS_ID_TOKEN_REQUEST_URL: `${issuer}${tokenPath}?`, + ACTIONS_ID_TOKEN_REQUEST_TOKEN: requestToken + } + + // Generate JWT signing key + key = await jose.generateKeyPair('PS256') + + // Create JWK and JWKS + const jwk = await jose.exportJWK(key.publicKey) + const jwks = {keys: [jwk]} + + nock(issuer).get(openidConfigPath).reply(200, openIDConfig) + nock(issuer).get(jwksPath).reply(200, jwks) + }) + + afterEach(() => { + process.env = originalEnv + }) + + describe('when ID token is valid', () => { + const claims = { + iss: issuer, + aud: audience, + ref: 'ref', + sha: 'sha', + repository: 'repo', + event_name: 'push', + workflow_ref: 'main', + repository_id: '1', + repository_owner_id: '1', + runner_environment: 'github-hosted', + run_id: '1', + run_attempt: '1' + } + + beforeEach(async () => { + const jwt = await new jose.SignJWT(claims) + .setProtectedHeader({alg: 'PS256'}) + .sign(key.privateKey) + + nock(issuer).get(tokenPath).query({audience}).reply(200, {value: jwt}) + }) + + it('returns the ID token claims', async () => { + const result = await getIDTokenClaims(issuer) + expect(result).toEqual(claims) + }) + }) + + describe('when ID token is missing required claims', () => { + const claims = { + iss: issuer, + aud: audience + } + + beforeEach(async () => { + const jwt = await new jose.SignJWT(claims) + .setProtectedHeader({alg: 'PS256'}) + .sign(key.privateKey) + + nock(issuer).get(tokenPath).query({audience}).reply(200, {value: jwt}) + }) + + it('throws an error', async () => { + await expect(getIDTokenClaims(issuer)).rejects.toThrow(/missing claims/i) + }) + }) + + describe('when ID has the wrong issuer', () => { + const claims = {foo: 'bar', iss: 'foo', aud: 'nobody'} + + beforeEach(async () => { + const jwt = await new jose.SignJWT(claims) + .setProtectedHeader({alg: 'PS256'}) + .sign(key.privateKey) + + nock(issuer).get(tokenPath).query({audience}).reply(200, {value: jwt}) + }) + + it('throws an error', async () => { + await expect(getIDTokenClaims(issuer)).rejects.toThrow(/issuer invalid/) + }) + }) + + describe('when ID has the wrong audience', () => { + const claims = {foo: 'bar', iss: issuer, aud: 'bar'} + + beforeEach(async () => { + const jwt = await new jose.SignJWT(claims) + .setProtectedHeader({alg: 'PS256'}) + .sign(key.privateKey) + + nock(issuer).get(tokenPath).query({audience}).reply(200, {value: jwt}) + }) + + it('throw an error', async () => { + await expect(getIDTokenClaims(issuer)).rejects.toThrow(/audience invalid/) + }) + }) + + describe('when openid config cannot be retrieved', () => { + const claims = {foo: 'bar', iss: issuer, aud: 'nobody'} + + beforeEach(async () => { + const jwt = await new jose.SignJWT(claims) + .setProtectedHeader({alg: 'PS256'}) + .sign(key.privateKey) + + nock(issuer).get(tokenPath).query({audience}).reply(200, {value: jwt}) + + // Disable the openid config endpoint + nock.removeInterceptor({ + proto: 'https', + hostname: 'example.com', + port: '443', + method: 'GET', + path: openidConfigPath + }) + }) + + it('throws an error', async () => { + await expect(getIDTokenClaims(issuer)).rejects.toThrow( + /failed to get id/i + ) + }) + }) +}) diff --git a/packages/attest/__tests__/provenance.test.ts b/packages/attest/__tests__/provenance.test.ts index d08b6c74..d08a6a63 100644 --- a/packages/attest/__tests__/provenance.test.ts +++ b/packages/attest/__tests__/provenance.test.ts @@ -1,213 +1,240 @@ import * as github from '@actions/github' import {mockFulcio, mockRekor, mockTSA} from '@sigstore/mock' +import * as jose from 'jose' import nock from 'nock' import {SIGSTORE_GITHUB, SIGSTORE_PUBLIC_GOOD} from '../src/endpoints' import {attestProvenance, buildSLSAProvenancePredicate} from '../src/provenance' -// Dummy workflow environment -const env = { - GITHUB_REPOSITORY: 'owner/repo', - GITHUB_REF: 'refs/heads/main', - GITHUB_SHA: 'babca52ab0c93ae16539e5923cb0d7403b9a093b', - GITHUB_WORKFLOW_REF: 'owner/repo/.github/workflows/main.yml@main', - GITHUB_SERVER_URL: 'https://github.com', - GITHUB_EVENT_NAME: 'push', - GITHUB_REPOSITORY_ID: 'repo-id', - GITHUB_REPOSITORY_OWNER_ID: 'owner-id', - GITHUB_RUN_ID: 'run-id', - GITHUB_RUN_ATTEMPT: 'run-attempt', - RUNNER_ENVIRONMENT: 'github-hosted' -} - -describe('buildSLSAProvenancePredicate', () => { - it('returns a provenance hydrated from env vars', () => { - const predicate = buildSLSAProvenancePredicate(env) - expect(predicate).toMatchSnapshot() - }) -}) - -describe('attestProvenance', () => { - // Capture original environment variables so we can restore them after each - // test +describe('provenance functions', () => { const originalEnv = process.env + const issuer = 'https://example.com' + const audience = 'nobody' + const jwksPath = '/.well-known/jwks.json' + const tokenPath = '/token' - // Subject to attest - const subjectName = 'subjective' - const subjectDigest = { - sha256: '7d070f6b64d9bcc530fe99cc21eaaa4b3c364e0b2d367d7735671fa202a03b32' + const claims = { + iss: issuer, + aud: 'nobody', + repository: 'owner/repo', + ref: 'refs/heads/main', + sha: 'babca52ab0c93ae16539e5923cb0d7403b9a093b', + workflow_ref: 'owner/repo/.github/workflows/main.yml@main', + event_name: 'push', + repository_id: 'repo-id', + repository_owner_id: 'owner-id', + run_id: 'run-id', + run_attempt: 'run-attempt', + runner_environment: 'github-hosted' } - // Fake an OIDC token - const oidcPayload = {sub: 'foo@bar.com', iss: ''} - const oidcToken = `.${Buffer.from(JSON.stringify(oidcPayload)).toString( - 'base64' - )}.}` - - const tokenURL = 'https://token.url' - const attestationID = '1234567890' - beforeEach(async () => { - jest.clearAllMocks() - - nock(tokenURL) - .get('/') - .query({audience: 'sigstore'}) - .reply(200, {value: oidcToken}) - - // Set-up GHA environment variables process.env = { ...originalEnv, - ...env, - ACTIONS_ID_TOKEN_REQUEST_URL: tokenURL, - ACTIONS_ID_TOKEN_REQUEST_TOKEN: 'token' + ACTIONS_ID_TOKEN_REQUEST_URL: `${issuer}${tokenPath}?`, + ACTIONS_ID_TOKEN_REQUEST_TOKEN: 'token', + GITHUB_SERVER_URL: 'https://github.com', + GITHUB_REPOSITORY: claims.repository } + + // Generate JWT signing key + const key = await jose.generateKeyPair('PS256') + + // Create JWK, JWKS, and JWT + const jwk = await jose.exportJWK(key.publicKey) + const jwks = {keys: [jwk]} + const jwt = await new jose.SignJWT(claims) + .setProtectedHeader({alg: 'PS256'}) + .sign(key.privateKey) + + // Mock OpenID configuration and JWKS endpoints + nock(issuer) + .get('/.well-known/openid-configuration') + .reply(200, {jwks_uri: `${issuer}${jwksPath}`}) + nock(issuer).get(jwksPath).reply(200, jwks) + + // Mock OIDC token endpoint for populating the provenance + nock(issuer).get(tokenPath).query({audience}).reply(200, {value: jwt}) }) afterEach(() => { - // Restore the original environment process.env = originalEnv }) - describe('when using the github Sigstore instance', () => { - const {fulcioURL, tsaServerURL} = SIGSTORE_GITHUB - - beforeEach(async () => { - // Mock Sigstore - await mockFulcio({baseURL: fulcioURL, strict: false}) - await mockTSA({baseURL: tsaServerURL}) - - // Mock GH attestations API - nock('https://api.github.com') - .post(/^\/repos\/.*\/.*\/attestations$/) - .reply(201, {id: attestationID}) - }) - - describe('when the sigstore instance is explicitly set', () => { - it('attests provenance', async () => { - const attestation = await attestProvenance({ - subjectName, - subjectDigest, - token: 'token', - sigstore: 'github' - }) - - expect(attestation).toBeDefined() - expect(attestation.bundle).toBeDefined() - expect(attestation.certificate).toMatch(/-----BEGIN CERTIFICATE-----/) - expect(attestation.tlogID).toBeUndefined() - expect(attestation.attestationID).toBe(attestationID) - }) - }) - - describe('when the sigstore instance is inferred from the repo visibility', () => { - const savedRepository = github.context.payload.repository - - beforeEach(() => { - /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ - github.context.payload.repository = {visibility: 'private'} as any - }) - - afterEach(() => { - github.context.payload.repository = savedRepository - }) - - it('attests provenance', async () => { - const attestation = await attestProvenance({ - subjectName, - subjectDigest, - token: 'token' - }) - - expect(attestation).toBeDefined() - expect(attestation.bundle).toBeDefined() - expect(attestation.certificate).toMatch(/-----BEGIN CERTIFICATE-----/) - expect(attestation.tlogID).toBeUndefined() - expect(attestation.attestationID).toBe(attestationID) - }) + describe('buildSLSAProvenancePredicate', () => { + it('returns a provenance hydrated from an OIDC token', async () => { + const predicate = await buildSLSAProvenancePredicate(issuer) + expect(predicate).toMatchSnapshot() }) }) - describe('when using the public-good Sigstore instance', () => { - const {fulcioURL, rekorURL} = SIGSTORE_PUBLIC_GOOD + describe('attestProvenance', () => { + // Subject to attest + const subjectName = 'subjective' + const subjectDigest = { + sha256: '7d070f6b64d9bcc530fe99cc21eaaa4b3c364e0b2d367d7735671fa202a03b32' + } + + // Fake an OIDC token + const oidcPayload = {sub: 'foo@bar.com', iss: ''} + const oidcToken = `.${Buffer.from(JSON.stringify(oidcPayload)).toString( + 'base64' + )}.}` + + const attestationID = '1234567890' beforeEach(async () => { - // Mock Sigstore - await mockFulcio({baseURL: fulcioURL, strict: false}) - await mockRekor({baseURL: rekorURL}) - - // Mock GH attestations API - nock('https://api.github.com') - .post(/^\/repos\/.*\/.*\/attestations$/) - .reply(201, {id: attestationID}) + nock(issuer) + .get(tokenPath) + .query({audience: 'sigstore'}) + .reply(200, {value: oidcToken}) }) - describe('when the sigstore instance is explicitly set', () => { + describe('when using the github Sigstore instance', () => { + const {fulcioURL, tsaServerURL} = SIGSTORE_GITHUB + + beforeEach(async () => { + // Mock Sigstore + await mockFulcio({baseURL: fulcioURL, strict: false}) + await mockTSA({baseURL: tsaServerURL}) + + // Mock GH attestations API + nock('https://api.github.com') + .post(/^\/repos\/.*\/.*\/attestations$/) + .reply(201, {id: attestationID}) + }) + + describe('when the sigstore instance is explicitly set', () => { + it('attests provenance', async () => { + const attestation = await attestProvenance({ + subjectName, + subjectDigest, + token: 'token', + sigstore: 'github', + issuer + }) + + expect(attestation).toBeDefined() + expect(attestation.bundle).toBeDefined() + expect(attestation.certificate).toMatch(/-----BEGIN CERTIFICATE-----/) + expect(attestation.tlogID).toBeUndefined() + expect(attestation.attestationID).toBe(attestationID) + }) + }) + + describe('when the sigstore instance is inferred from the repo visibility', () => { + const savedRepository = github.context.payload.repository + + beforeEach(() => { + /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ + github.context.payload.repository = {visibility: 'private'} as any + }) + + afterEach(() => { + github.context.payload.repository = savedRepository + }) + + it('attests provenance', async () => { + const attestation = await attestProvenance({ + subjectName, + subjectDigest, + token: 'token', + issuer + }) + + expect(attestation).toBeDefined() + expect(attestation.bundle).toBeDefined() + expect(attestation.certificate).toMatch(/-----BEGIN CERTIFICATE-----/) + expect(attestation.tlogID).toBeUndefined() + expect(attestation.attestationID).toBe(attestationID) + }) + }) + }) + + describe('when using the public-good Sigstore instance', () => { + const {fulcioURL, rekorURL} = SIGSTORE_PUBLIC_GOOD + + beforeEach(async () => { + // Mock Sigstore + await mockFulcio({baseURL: fulcioURL, strict: false}) + await mockRekor({baseURL: rekorURL}) + + // Mock GH attestations API + nock('https://api.github.com') + .post(/^\/repos\/.*\/.*\/attestations$/) + .reply(201, {id: attestationID}) + }) + + describe('when the sigstore instance is explicitly set', () => { + it('attests provenance', async () => { + const attestation = await attestProvenance({ + subjectName, + subjectDigest, + token: 'token', + sigstore: 'public-good', + issuer + }) + + expect(attestation).toBeDefined() + expect(attestation.bundle).toBeDefined() + expect(attestation.certificate).toMatch(/-----BEGIN CERTIFICATE-----/) + expect(attestation.tlogID).toBeDefined() + expect(attestation.attestationID).toBe(attestationID) + }) + }) + + describe('when the sigstore instance is inferred from the repo visibility', () => { + const savedRepository = github.context.payload.repository + + beforeEach(() => { + /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ + github.context.payload.repository = {visibility: 'public'} as any + }) + + afterEach(() => { + github.context.payload.repository = savedRepository + }) + + it('attests provenance', async () => { + const attestation = await attestProvenance({ + subjectName, + subjectDigest, + token: 'token', + issuer + }) + + expect(attestation).toBeDefined() + expect(attestation.bundle).toBeDefined() + expect(attestation.certificate).toMatch(/-----BEGIN CERTIFICATE-----/) + expect(attestation.tlogID).toBeDefined() + expect(attestation.attestationID).toBe(attestationID) + }) + }) + }) + + describe('when skipWrite is set to true', () => { + const {fulcioURL, rekorURL} = SIGSTORE_PUBLIC_GOOD + beforeEach(async () => { + // Mock Sigstore + await mockFulcio({baseURL: fulcioURL, strict: false}) + await mockRekor({baseURL: rekorURL}) + }) + it('attests provenance', async () => { const attestation = await attestProvenance({ subjectName, subjectDigest, token: 'token', - sigstore: 'public-good' + sigstore: 'public-good', + skipWrite: true, + issuer }) expect(attestation).toBeDefined() expect(attestation.bundle).toBeDefined() expect(attestation.certificate).toMatch(/-----BEGIN CERTIFICATE-----/) expect(attestation.tlogID).toBeDefined() - expect(attestation.attestationID).toBe(attestationID) + expect(attestation.attestationID).toBeUndefined() }) }) - - describe('when the sigstore instance is inferred from the repo visibility', () => { - const savedRepository = github.context.payload.repository - - beforeEach(() => { - /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ - github.context.payload.repository = {visibility: 'public'} as any - }) - - afterEach(() => { - github.context.payload.repository = savedRepository - }) - - it('attests provenance', async () => { - const attestation = await attestProvenance({ - subjectName, - subjectDigest, - token: 'token' - }) - - expect(attestation).toBeDefined() - expect(attestation.bundle).toBeDefined() - expect(attestation.certificate).toMatch(/-----BEGIN CERTIFICATE-----/) - expect(attestation.tlogID).toBeDefined() - expect(attestation.attestationID).toBe(attestationID) - }) - }) - }) - - describe('when skipWrite is set to true', () => { - const {fulcioURL, rekorURL} = SIGSTORE_PUBLIC_GOOD - beforeEach(async () => { - // Mock Sigstore - await mockFulcio({baseURL: fulcioURL, strict: false}) - await mockRekor({baseURL: rekorURL}) - }) - - it('attests provenance', async () => { - const attestation = await attestProvenance({ - subjectName, - subjectDigest, - token: 'token', - sigstore: 'public-good', - skipWrite: true - }) - - expect(attestation).toBeDefined() - expect(attestation.bundle).toBeDefined() - expect(attestation.certificate).toMatch(/-----BEGIN CERTIFICATE-----/) - expect(attestation.tlogID).toBeDefined() - expect(attestation.attestationID).toBeUndefined() - }) }) }) diff --git a/packages/attest/__tests__/store.test.ts b/packages/attest/__tests__/store.test.ts index 071d513e..755739d0 100644 --- a/packages/attest/__tests__/store.test.ts +++ b/packages/attest/__tests__/store.test.ts @@ -38,7 +38,7 @@ describe('writeAttestation', () => { .reply(500, 'oops') }) - it('persists the attestation', async () => { + it('throws an error', async () => { await expect(writeAttestation(attestation, token)).rejects.toThrow(/oops/) }) }) diff --git a/packages/attest/package-lock.json b/packages/attest/package-lock.json index 4840b0e8..f1c53771 100644 --- a/packages/attest/package-lock.json +++ b/packages/attest/package-lock.json @@ -9,18 +9,33 @@ "version": "1.0.0", "license": "MIT", "dependencies": { + "@actions/core": "^1.10.1", "@actions/github": "^6.0.0", + "@actions/http-client": "^2.2.1", "@sigstore/bundle": "^2.2.0", "@sigstore/sign": "^2.2.3", + "jsonwebtoken": "^9.0.2", + "jwks-rsa": "^3.1.0", "make-fetch-happen": "^13.0.0" }, "devDependencies": { "@sigstore/mock": "^0.6.5", "@sigstore/rekor-types": "^2.0.0", + "@types/jsonwebtoken": "^9.0.6", "@types/make-fetch-happen": "^10.0.4", + "jose": "^5.2.3", "nock": "^13.5.1" } }, + "node_modules/@actions/core": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.1.tgz", + "integrity": "sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==", + "dependencies": { + "@actions/http-client": "^2.0.1", + "uuid": "^8.3.2" + } + }, "node_modules/@actions/github": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@actions/github/-/github-6.0.0.tgz", @@ -33,9 +48,9 @@ } }, "node_modules/@actions/http-client": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.0.tgz", - "integrity": "sha512-q+epW0trjVUUHboliPb4UF9g2msf+w61b32tAkFEwL/IwP0DQWgbCMM0Hbe3e3WXSKz5VcUXbzJQgy8Hkra/Lg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.1.tgz", + "integrity": "sha512-KhC/cZsq7f8I4LfZSJKgCvEwfkE8o1538VoBeoGzokVLLnbFDEAdFD3UhoMklxo2un9NJVBdANOresx7vTHlHw==", "dependencies": { "tunnel": "^0.0.6", "undici": "^5.25.4" @@ -463,6 +478,58 @@ "node": "^16.14.0 || >=18.0.0" } }, + "node_modules/@types/body-parser": { + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/express": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.17.43", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz", + "integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/http-errors": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==" + }, + "node_modules/@types/jsonwebtoken": { + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.6.tgz", + "integrity": "sha512-/5hndP5dCjloafCXns6SZyESp3Ldq7YjH3zwzwczYnjxIT0Fqzk5ROSYVGfFyczIue7IUEj8hkvLbPoLQ18vQw==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/make-fetch-happen": { "version": "10.0.4", "resolved": "https://registry.npmjs.org/@types/make-fetch-happen/-/make-fetch-happen-10.0.4.tgz", @@ -474,11 +541,15 @@ "@types/ssri": "*" } }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" + }, "node_modules/@types/node": { "version": "20.11.19", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.19.tgz", "integrity": "sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==", - "dev": true, "dependencies": { "undici-types": "~5.26.4" } @@ -493,12 +564,41 @@ "form-data": "^4.0.0" } }, + "node_modules/@types/qs": { + "version": "6.9.14", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.14.tgz", + "integrity": "sha512-5khscbd3SwWMhFqylJBLQ0zIu7c1K6Vz0uBIt915BI3zV0q1nfjRQD3RqSBcPaO6PHEF4ov/t9y89fSiyThlPA==" + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" + }, "node_modules/@types/retry": { "version": "0.12.5", "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.5.tgz", "integrity": "sha512-3xSjTp3v03X/lSQLkczaN9UIEwJMoMCA1+Nb5HfbJEQWogdeQIyVtTvxPXDQjZ5zws8rFQfVfRdz03ARihPJgw==", "dev": true }, + "node_modules/@types/send": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.5.tgz", + "integrity": "sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==", + "dependencies": { + "@types/http-errors": "*", + "@types/mime": "*", + "@types/node": "*" + } + }, "node_modules/@types/ssri": { "version": "7.1.5", "resolved": "https://registry.npmjs.org/@types/ssri/-/ssri-7.1.5.tgz", @@ -591,6 +691,11 @@ "balanced-match": "^1.0.0" } }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, "node_modules/bytestreamjs": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/bytestreamjs/-/bytestreamjs-2.0.1.tgz", @@ -720,6 +825,14 @@ "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, "node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", @@ -914,9 +1027,9 @@ } }, "node_modules/jose": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/jose/-/jose-5.2.2.tgz", - "integrity": "sha512-/WByRr4jDcsKlvMd1dRJnPfS1GVO3WuKyaurJ/vvXcOaUQO8rnNObCQMlv/5uCceVQIq5Q4WLF44ohsdiTohdg==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/jose/-/jose-5.2.3.tgz", + "integrity": "sha512-KUXdbctm1uHVL8BYhnyHkgp3zDX5KW8ZhAKVFEfUbU2P8Alpzjb+48hHvjOdQIyPshoblhzsuqOwEEAbtHVirA==", "dev": true, "funding": { "url": "https://github.com/sponsors/panva" @@ -933,6 +1046,115 @@ "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", "dev": true }, + "node_modules/jsonwebtoken": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jwks-rsa": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jwks-rsa/-/jwks-rsa-3.1.0.tgz", + "integrity": "sha512-v7nqlfezb9YfHHzYII3ef2a2j1XnGeSE/bK3WfumaYCqONAIstJbrEGapz4kadScZzEt7zYCN7bucj8C0Mv/Rg==", + "dependencies": { + "@types/express": "^4.17.17", + "@types/jsonwebtoken": "^9.0.2", + "debug": "^4.3.4", + "jose": "^4.14.6", + "limiter": "^1.1.5", + "lru-memoizer": "^2.2.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/jwks-rsa/node_modules/jose": { + "version": "4.15.5", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.5.tgz", + "integrity": "sha512-jc7BFxgKPKi94uOvEmzlSWFFe2+vASyXaKUpdQKatWAESU2MWjDfFf0fdfc83CDKcA5QecabZeNLyfhe3yKNkg==", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/limiter": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.5.tgz", + "integrity": "sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==" + }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==" + }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" + }, "node_modules/lru-cache": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", @@ -941,6 +1163,29 @@ "node": "14 || >=16.14" } }, + "node_modules/lru-memoizer": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/lru-memoizer/-/lru-memoizer-2.2.0.tgz", + "integrity": "sha512-QfOZ6jNkxCcM/BkIPnFsqDhtrazLRsghi9mBwFAzol5GCvj4EkFT899Za3+QwikCg5sRX8JstioBDwOxEyzaNw==", + "dependencies": { + "lodash.clonedeep": "^4.5.0", + "lru-cache": "~4.0.0" + } + }, + "node_modules/lru-memoizer/node_modules/lru-cache": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.2.tgz", + "integrity": "sha512-uQw9OqphAGiZhkuPlpFGmdTU2tEuhxTourM/19qGJrxBPHAr/f8BT1a0i/lOclESnGatdJG/UCkP9kZB/Lh1iw==", + "dependencies": { + "pseudomap": "^1.0.1", + "yallist": "^2.0.0" + } + }, + "node_modules/lru-memoizer/node_modules/yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==" + }, "node_modules/make-fetch-happen": { "version": "13.0.0", "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-13.0.0.tgz", @@ -1241,6 +1486,11 @@ "node": ">= 8" } }, + "node_modules/pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==" + }, "node_modules/pvtsutils": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/pvtsutils/-/pvtsutils-1.3.5.tgz", @@ -1273,6 +1523,25 @@ "node": ">= 4" } }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -1565,8 +1834,7 @@ "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, "node_modules/unique-filename": { "version": "3.0.0", @@ -1595,6 +1863,14 @@ "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==" }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/webcrypto-core": { "version": "1.7.8", "resolved": "https://registry.npmjs.org/webcrypto-core/-/webcrypto-core-1.7.8.tgz", @@ -1718,6 +1994,15 @@ } }, "dependencies": { + "@actions/core": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.1.tgz", + "integrity": "sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==", + "requires": { + "@actions/http-client": "^2.0.1", + "uuid": "^8.3.2" + } + }, "@actions/github": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@actions/github/-/github-6.0.0.tgz", @@ -1730,9 +2015,9 @@ } }, "@actions/http-client": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.0.tgz", - "integrity": "sha512-q+epW0trjVUUHboliPb4UF9g2msf+w61b32tAkFEwL/IwP0DQWgbCMM0Hbe3e3WXSKz5VcUXbzJQgy8Hkra/Lg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.1.tgz", + "integrity": "sha512-KhC/cZsq7f8I4LfZSJKgCvEwfkE8o1538VoBeoGzokVLLnbFDEAdFD3UhoMklxo2un9NJVBdANOresx7vTHlHw==", "requires": { "tunnel": "^0.0.6", "undici": "^5.25.4" @@ -2091,6 +2376,58 @@ "make-fetch-happen": "^13.0.0" } }, + "@types/body-parser": { + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", + "requires": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "requires": { + "@types/node": "*" + } + }, + "@types/express": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", + "requires": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "@types/express-serve-static-core": { + "version": "4.17.43", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz", + "integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==", + "requires": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "@types/http-errors": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==" + }, + "@types/jsonwebtoken": { + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.6.tgz", + "integrity": "sha512-/5hndP5dCjloafCXns6SZyESp3Ldq7YjH3zwzwczYnjxIT0Fqzk5ROSYVGfFyczIue7IUEj8hkvLbPoLQ18vQw==", + "requires": { + "@types/node": "*" + } + }, "@types/make-fetch-happen": { "version": "10.0.4", "resolved": "https://registry.npmjs.org/@types/make-fetch-happen/-/make-fetch-happen-10.0.4.tgz", @@ -2102,11 +2439,15 @@ "@types/ssri": "*" } }, + "@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" + }, "@types/node": { "version": "20.11.19", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.19.tgz", "integrity": "sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==", - "dev": true, "requires": { "undici-types": "~5.26.4" } @@ -2121,12 +2462,41 @@ "form-data": "^4.0.0" } }, + "@types/qs": { + "version": "6.9.14", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.14.tgz", + "integrity": "sha512-5khscbd3SwWMhFqylJBLQ0zIu7c1K6Vz0uBIt915BI3zV0q1nfjRQD3RqSBcPaO6PHEF4ov/t9y89fSiyThlPA==" + }, + "@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" + }, "@types/retry": { "version": "0.12.5", "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.5.tgz", "integrity": "sha512-3xSjTp3v03X/lSQLkczaN9UIEwJMoMCA1+Nb5HfbJEQWogdeQIyVtTvxPXDQjZ5zws8rFQfVfRdz03ARihPJgw==", "dev": true }, + "@types/send": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "requires": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "@types/serve-static": { + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.5.tgz", + "integrity": "sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==", + "requires": { + "@types/http-errors": "*", + "@types/mime": "*", + "@types/node": "*" + } + }, "@types/ssri": { "version": "7.1.5", "resolved": "https://registry.npmjs.org/@types/ssri/-/ssri-7.1.5.tgz", @@ -2198,6 +2568,11 @@ "balanced-match": "^1.0.0" } }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, "bytestreamjs": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/bytestreamjs/-/bytestreamjs-2.0.1.tgz", @@ -2295,6 +2670,14 @@ "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, "emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", @@ -2436,9 +2819,9 @@ } }, "jose": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/jose/-/jose-5.2.2.tgz", - "integrity": "sha512-/WByRr4jDcsKlvMd1dRJnPfS1GVO3WuKyaurJ/vvXcOaUQO8rnNObCQMlv/5uCceVQIq5Q4WLF44ohsdiTohdg==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/jose/-/jose-5.2.3.tgz", + "integrity": "sha512-KUXdbctm1uHVL8BYhnyHkgp3zDX5KW8ZhAKVFEfUbU2P8Alpzjb+48hHvjOdQIyPshoblhzsuqOwEEAbtHVirA==", "dev": true }, "jsbn": { @@ -2452,11 +2835,137 @@ "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", "dev": true }, + "jsonwebtoken": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "requires": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + } + }, + "jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jwks-rsa": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jwks-rsa/-/jwks-rsa-3.1.0.tgz", + "integrity": "sha512-v7nqlfezb9YfHHzYII3ef2a2j1XnGeSE/bK3WfumaYCqONAIstJbrEGapz4kadScZzEt7zYCN7bucj8C0Mv/Rg==", + "requires": { + "@types/express": "^4.17.17", + "@types/jsonwebtoken": "^9.0.2", + "debug": "^4.3.4", + "jose": "^4.14.6", + "limiter": "^1.1.5", + "lru-memoizer": "^2.2.0" + }, + "dependencies": { + "jose": { + "version": "4.15.5", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.5.tgz", + "integrity": "sha512-jc7BFxgKPKi94uOvEmzlSWFFe2+vASyXaKUpdQKatWAESU2MWjDfFf0fdfc83CDKcA5QecabZeNLyfhe3yKNkg==" + } + } + }, + "jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "requires": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "limiter": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.5.tgz", + "integrity": "sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==" + }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==" + }, + "lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" + }, + "lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" + }, + "lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" + }, + "lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + }, + "lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" + }, "lru-cache": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==" }, + "lru-memoizer": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/lru-memoizer/-/lru-memoizer-2.2.0.tgz", + "integrity": "sha512-QfOZ6jNkxCcM/BkIPnFsqDhtrazLRsghi9mBwFAzol5GCvj4EkFT899Za3+QwikCg5sRX8JstioBDwOxEyzaNw==", + "requires": { + "lodash.clonedeep": "^4.5.0", + "lru-cache": "~4.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.2.tgz", + "integrity": "sha512-uQw9OqphAGiZhkuPlpFGmdTU2tEuhxTourM/19qGJrxBPHAr/f8BT1a0i/lOclESnGatdJG/UCkP9kZB/Lh1iw==", + "requires": { + "pseudomap": "^1.0.1", + "yallist": "^2.0.0" + } + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==" + } + } + }, "make-fetch-happen": { "version": "13.0.0", "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-13.0.0.tgz", @@ -2679,6 +3188,11 @@ "integrity": "sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==", "dev": true }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==" + }, "pvtsutils": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/pvtsutils/-/pvtsutils-1.3.5.tgz", @@ -2705,6 +3219,11 @@ "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==" }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -2924,8 +3443,7 @@ "undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, "unique-filename": { "version": "3.0.0", @@ -2948,6 +3466,11 @@ "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==" }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, "webcrypto-core": { "version": "1.7.8", "resolved": "https://registry.npmjs.org/webcrypto-core/-/webcrypto-core-1.7.8.tgz", diff --git a/packages/attest/package.json b/packages/attest/package.json index 82d9cd49..43f7d51a 100644 --- a/packages/attest/package.json +++ b/packages/attest/package.json @@ -1,6 +1,6 @@ { "name": "@actions/attest", - "version": "1.0.0", + "version": "1.1.0", "description": "Actions attestation lib", "keywords": [ "github", @@ -37,13 +37,19 @@ "devDependencies": { "@sigstore/mock": "^0.6.5", "@sigstore/rekor-types": "^2.0.0", + "@types/jsonwebtoken": "^9.0.6", "@types/make-fetch-happen": "^10.0.4", + "jose": "^5.2.3", "nock": "^13.5.1" }, "dependencies": { + "@actions/core": "^1.10.1", "@actions/github": "^6.0.0", + "@actions/http-client": "^2.2.1", "@sigstore/bundle": "^2.2.0", "@sigstore/sign": "^2.2.3", + "jsonwebtoken": "^9.0.2", + "jwks-rsa": "^3.1.0", "make-fetch-happen": "^13.0.0" } } diff --git a/packages/attest/src/oidc.ts b/packages/attest/src/oidc.ts new file mode 100644 index 00000000..51ebad42 --- /dev/null +++ b/packages/attest/src/oidc.ts @@ -0,0 +1,102 @@ +import {getIDToken} from '@actions/core' +import {HttpClient} from '@actions/http-client' +import * as jwt from 'jsonwebtoken' +import jwks from 'jwks-rsa' + +const OIDC_AUDIENCE = 'nobody' + +const REQUIRED_CLAIMS = [ + 'iss', + 'ref', + 'sha', + 'repository', + 'event_name', + 'workflow_ref', + 'repository_id', + 'repository_owner_id', + 'runner_environment', + 'run_id', + 'run_attempt' +] as const + +export type ClaimSet = {[K in (typeof REQUIRED_CLAIMS)[number]]: string} + +type OIDCConfig = { + jwks_uri: string +} + +export const getIDTokenClaims = async (issuer: string): Promise => { + try { + const token = await getIDToken(OIDC_AUDIENCE) + const claims = await decodeOIDCToken(token, issuer) + assertClaimSet(claims) + return claims + } catch (error) { + throw new Error(`Failed to get ID token: ${error.message}`) + } +} + +const decodeOIDCToken = async ( + token: string, + issuer: string +): Promise => { + // Verify and decode token + return new Promise((resolve, reject) => { + jwt.verify( + token, + getPublicKey(issuer), + {audience: OIDC_AUDIENCE, issuer}, + (err, decoded) => { + if (err) { + reject(err) + } else if (!decoded || typeof decoded === 'string') { + reject(new Error('No decoded token')) + } else { + resolve(decoded) + } + } + ) + }) +} + +// Returns a callback to locate the public key for the given JWT header. This +// involves two calls: +// 1. Fetch the OpenID configuration to get the JWKS URI. +// 2. Fetch the public key from the JWKS URI. +const getPublicKey = + (issuer: string): jwt.GetPublicKeyOrSecret => + (header: jwt.JwtHeader, callback: jwt.SigningKeyCallback) => { + // Look up the JWKS URI from the issuer's OpenID configuration + new HttpClient('actions/attest') + .getJson(`${issuer}/.well-known/openid-configuration`) + .then(data => { + if (!data.result) { + callback(new Error('No OpenID configuration found')) + } else { + // Fetch the public key from the JWKS URI + jwks({jwksUri: data.result.jwks_uri}).getSigningKey( + header.kid, + (err, key) => { + callback(err, key?.getPublicKey()) + } + ) + } + }) + .catch(err => { + callback(err) + }) + } + +function assertClaimSet(claims: jwt.JwtPayload): asserts claims is ClaimSet { + const missingClaims: string[] = [] + + for (const claim of REQUIRED_CLAIMS) { + if (!(claim in claims)) { + missingClaims.push(claim) + } + } + + if (missingClaims.length > 0) { + throw new Error(`Missing claims: ${missingClaims.join(', ')}`) + } +} diff --git a/packages/attest/src/provenance.ts b/packages/attest/src/provenance.ts index 03f424f1..29d7c92a 100644 --- a/packages/attest/src/provenance.ts +++ b/packages/attest/src/provenance.ts @@ -1,4 +1,5 @@ import {attest, AttestOptions} from './attest' +import {getIDTokenClaims} from './oidc' import type {Attestation, Predicate} from './shared.types' const SLSA_PREDICATE_V1_TYPE = 'https://slsa.dev/provenance/v1' @@ -7,30 +8,35 @@ const GITHUB_BUILDER_ID_PREFIX = 'https://github.com/actions/runner' const GITHUB_BUILD_TYPE = 'https://slsa-framework.github.io/github-actions-buildtypes/workflow/v1' +const DEFAULT_ISSUER = 'https://token.actions.githubusercontent.com' + export type AttestProvenanceOptions = Omit< AttestOptions, 'predicate' | 'predicateType' -> +> & { + issuer?: string +} /** * Builds an SLSA (Supply Chain Levels for Software Artifacts) provenance * predicate using the GitHub Actions Workflow build type. * https://slsa.dev/spec/v1.0/provenance * https://github.com/slsa-framework/github-actions-buildtypes/tree/main/workflow/v1 - * @param env - The Node.js process environment variables. Defaults to - * `process.env`. + * @param issuer - URL for the OIDC issuer. Defaults to the GitHub Actions token + * issuer. * @returns The SLSA provenance predicate. */ -export const buildSLSAProvenancePredicate = ( - env: NodeJS.ProcessEnv = process.env -): Predicate => { - const workflow = env.GITHUB_WORKFLOW_REF || '' +export const buildSLSAProvenancePredicate = async ( + issuer: string = DEFAULT_ISSUER +): Promise => { + const serverURL = process.env.GITHUB_SERVER_URL + const claims = await getIDTokenClaims(issuer) // Split just the path and ref from the workflow string. // owner/repo/.github/workflows/main.yml@main => // .github/workflows/main.yml, main - const [workflowPath, workflowRef] = workflow - .replace(`${env.GITHUB_REPOSITORY}/`, '') + const [workflowPath, workflowRef] = claims.workflow_ref + .replace(`${claims.repository}/`, '') .split('@') return { @@ -41,32 +47,32 @@ export const buildSLSAProvenancePredicate = ( externalParameters: { workflow: { ref: workflowRef, - repository: `${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}`, + repository: `${serverURL}/${claims.repository}`, path: workflowPath } }, internalParameters: { github: { - event_name: env.GITHUB_EVENT_NAME, - repository_id: env.GITHUB_REPOSITORY_ID, - repository_owner_id: env.GITHUB_REPOSITORY_OWNER_ID + event_name: claims.event_name, + repository_id: claims.repository_id, + repository_owner_id: claims.repository_owner_id } }, resolvedDependencies: [ { - uri: `git+${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}@${env.GITHUB_REF}`, + uri: `git+${serverURL}/${claims.repository}@${claims.ref}`, digest: { - gitCommit: env.GITHUB_SHA + gitCommit: claims.sha } } ] }, runDetails: { builder: { - id: `${GITHUB_BUILDER_ID_PREFIX}/${env.RUNNER_ENVIRONMENT}` + id: `${GITHUB_BUILDER_ID_PREFIX}/${claims.runner_environment}` }, metadata: { - invocationId: `${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}/attempts/${env.GITHUB_RUN_ATTEMPT}` + invocationId: `${serverURL}/${claims.repository}/actions/runs/${claims.run_id}/attempts/${claims.run_attempt}` } } } @@ -84,7 +90,7 @@ export const buildSLSAProvenancePredicate = ( export async function attestProvenance( options: AttestProvenanceOptions ): Promise { - const predicate = buildSLSAProvenancePredicate(process.env) + const predicate = await buildSLSAProvenancePredicate(options.issuer) return attest({ ...options, predicateType: predicate.type, From 4ce4c767e26042e362e0ba2b8d757a9eb0cabda7 Mon Sep 17 00:00:00 2001 From: Brian DeHamer Date: Fri, 22 Mar 2024 12:44:24 -0700 Subject: [PATCH 160/198] npm audit fix Signed-off-by: Brian DeHamer --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7575e429..63f54a4d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5781,9 +5781,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.4", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", - "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "dev": true, "funding": [ { From f8d95a85df38a9ea9ce82d9d4409a16e6a6b9ed5 Mon Sep 17 00:00:00 2001 From: Brian DeHamer Date: Wed, 3 Apr 2024 12:12:26 -0700 Subject: [PATCH 161/198] generate v0.3 bundles in attest package Signed-off-by: Brian DeHamer --- packages/attest/RELEASES.md | 6 +++ packages/attest/__tests__/sign.test.ts | 12 ++---- packages/attest/package-lock.json | 58 +++++++++++++------------- packages/attest/package.json | 6 +-- packages/attest/src/attest.ts | 3 +- packages/attest/src/sign.ts | 6 ++- 6 files changed, 48 insertions(+), 43 deletions(-) diff --git a/packages/attest/RELEASES.md b/packages/attest/RELEASES.md index d30960a1..92120cdd 100644 --- a/packages/attest/RELEASES.md +++ b/packages/attest/RELEASES.md @@ -1,5 +1,11 @@ # @actions/attest Releases +### 1.2.0 + +- Generate attestations using the v0.3 Sigstore bundle format. +- Bump @sigstore/bundle from 2.2.0 to 2.3.0. +- Bump @sigstore/sign from 2.2.3 to 2.3.0. + ### 1.1.0 - Updates the `attestProvenance` function to retrieve a token from the GitHub OIDC provider and use the token claims to populate the provenance statement. diff --git a/packages/attest/__tests__/sign.test.ts b/packages/attest/__tests__/sign.test.ts index 8aa1a5b8..16e8cd08 100644 --- a/packages/attest/__tests__/sign.test.ts +++ b/packages/attest/__tests__/sign.test.ts @@ -64,13 +64,11 @@ describe('signProvenance', () => { expect(att).toBeDefined() expect(att.mediaType).toEqual( - 'application/vnd.dev.sigstore.bundle+json;version=0.2' + 'application/vnd.dev.sigstore.bundle.v0.3+json' ) expect(att.content.$case).toEqual('dsseEnvelope') - expect(att.verificationMaterial.content.$case).toEqual( - 'x509CertificateChain' - ) + expect(att.verificationMaterial.content.$case).toEqual('certificate') expect(att.verificationMaterial.tlogEntries).toHaveLength(1) expect( att.verificationMaterial.timestampVerificationData?.rfc3161Timestamps @@ -89,13 +87,11 @@ describe('signProvenance', () => { expect(att).toBeDefined() expect(att.mediaType).toEqual( - 'application/vnd.dev.sigstore.bundle+json;version=0.2' + 'application/vnd.dev.sigstore.bundle.v0.3+json' ) expect(att.content.$case).toEqual('dsseEnvelope') - expect(att.verificationMaterial.content.$case).toEqual( - 'x509CertificateChain' - ) + expect(att.verificationMaterial.content.$case).toEqual('certificate') expect(att.verificationMaterial.tlogEntries).toHaveLength(0) expect( att.verificationMaterial.timestampVerificationData?.rfc3161Timestamps diff --git a/packages/attest/package-lock.json b/packages/attest/package-lock.json index f1c53771..569cc7ed 100644 --- a/packages/attest/package-lock.json +++ b/packages/attest/package-lock.json @@ -1,19 +1,19 @@ { "name": "@actions/attest", - "version": "1.0.0", + "version": "1.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@actions/attest", - "version": "1.0.0", + "version": "1.2.0", "license": "MIT", "dependencies": { "@actions/core": "^1.10.1", "@actions/github": "^6.0.0", "@actions/http-client": "^2.2.1", - "@sigstore/bundle": "^2.2.0", - "@sigstore/sign": "^2.2.3", + "@sigstore/bundle": "^2.3.0", + "@sigstore/sign": "^2.3.0", "jsonwebtoken": "^9.0.2", "jwks-rsa": "^3.1.0", "make-fetch-happen": "^13.0.0" @@ -408,11 +408,11 @@ } }, "node_modules/@sigstore/bundle": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-2.2.0.tgz", - "integrity": "sha512-5VI58qgNs76RDrwXNhpmyN/jKpq9evV/7f1XrcqcAfvxDl5SeVY/I5Rmfe96ULAV7/FK5dge9RBKGBJPhL1WsQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-2.3.0.tgz", + "integrity": "sha512-MU3XYHkOvKEFnuUtcAtVh0s4RTemRyi1NN87+v9fAL0qR9JZuK/nF27YJ79wjPvvi1W9sz3qc7cTgshH5tji6Q==", "dependencies": { - "@sigstore/protobuf-specs": "^0.3.0" + "@sigstore/protobuf-specs": "^0.3.1" }, "engines": { "node": "^16.14.0 || >=18.0.0" @@ -448,11 +448,11 @@ } }, "node_modules/@sigstore/protobuf-specs": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.3.0.tgz", - "integrity": "sha512-zxiQ66JFOjVvP9hbhGj/F/qNdsZfkGb/dVXSanNRNuAzMlr4MC95voPUBX8//ZNnmv3uSYzdfR/JSkrgvZTGxA==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.3.1.tgz", + "integrity": "sha512-aIL8Z9NsMr3C64jyQzE0XlkEyBLpgEJJFDHLVVStkFV5Q3Il/r/YtY6NJWKQ4cy4AE7spP1IX5Jq7VCAxHHMfQ==", "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/@sigstore/rekor-types": { @@ -465,13 +465,13 @@ } }, "node_modules/@sigstore/sign": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@sigstore/sign/-/sign-2.2.3.tgz", - "integrity": "sha512-LqlA+ffyN02yC7RKszCdMTS6bldZnIodiox+IkT8B2f8oRYXCB3LQ9roXeiEL21m64CVH1wyveYAORfD65WoSw==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@sigstore/sign/-/sign-2.3.0.tgz", + "integrity": "sha512-tsAyV6FC3R3pHmKS880IXcDJuiFJiKITO1jxR1qbplcsBkZLBmjrEw5GbC7ikD6f5RU1hr7WnmxB/2kKc1qUWQ==", "dependencies": { - "@sigstore/bundle": "^2.2.0", + "@sigstore/bundle": "^2.3.0", "@sigstore/core": "^1.0.0", - "@sigstore/protobuf-specs": "^0.3.0", + "@sigstore/protobuf-specs": "^0.3.1", "make-fetch-happen": "^13.0.0" }, "engines": { @@ -2324,11 +2324,11 @@ "optional": true }, "@sigstore/bundle": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-2.2.0.tgz", - "integrity": "sha512-5VI58qgNs76RDrwXNhpmyN/jKpq9evV/7f1XrcqcAfvxDl5SeVY/I5Rmfe96ULAV7/FK5dge9RBKGBJPhL1WsQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-2.3.0.tgz", + "integrity": "sha512-MU3XYHkOvKEFnuUtcAtVh0s4RTemRyi1NN87+v9fAL0qR9JZuK/nF27YJ79wjPvvi1W9sz3qc7cTgshH5tji6Q==", "requires": { - "@sigstore/protobuf-specs": "^0.3.0" + "@sigstore/protobuf-specs": "^0.3.1" } }, "@sigstore/core": { @@ -2355,9 +2355,9 @@ } }, "@sigstore/protobuf-specs": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.3.0.tgz", - "integrity": "sha512-zxiQ66JFOjVvP9hbhGj/F/qNdsZfkGb/dVXSanNRNuAzMlr4MC95voPUBX8//ZNnmv3uSYzdfR/JSkrgvZTGxA==" + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.3.1.tgz", + "integrity": "sha512-aIL8Z9NsMr3C64jyQzE0XlkEyBLpgEJJFDHLVVStkFV5Q3Il/r/YtY6NJWKQ4cy4AE7spP1IX5Jq7VCAxHHMfQ==" }, "@sigstore/rekor-types": { "version": "2.0.0", @@ -2366,13 +2366,13 @@ "dev": true }, "@sigstore/sign": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@sigstore/sign/-/sign-2.2.3.tgz", - "integrity": "sha512-LqlA+ffyN02yC7RKszCdMTS6bldZnIodiox+IkT8B2f8oRYXCB3LQ9roXeiEL21m64CVH1wyveYAORfD65WoSw==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@sigstore/sign/-/sign-2.3.0.tgz", + "integrity": "sha512-tsAyV6FC3R3pHmKS880IXcDJuiFJiKITO1jxR1qbplcsBkZLBmjrEw5GbC7ikD6f5RU1hr7WnmxB/2kKc1qUWQ==", "requires": { - "@sigstore/bundle": "^2.2.0", + "@sigstore/bundle": "^2.3.0", "@sigstore/core": "^1.0.0", - "@sigstore/protobuf-specs": "^0.3.0", + "@sigstore/protobuf-specs": "^0.3.1", "make-fetch-happen": "^13.0.0" } }, diff --git a/packages/attest/package.json b/packages/attest/package.json index 43f7d51a..eae9bea3 100644 --- a/packages/attest/package.json +++ b/packages/attest/package.json @@ -1,6 +1,6 @@ { "name": "@actions/attest", - "version": "1.1.0", + "version": "1.2.0", "description": "Actions attestation lib", "keywords": [ "github", @@ -46,8 +46,8 @@ "@actions/core": "^1.10.1", "@actions/github": "^6.0.0", "@actions/http-client": "^2.2.1", - "@sigstore/bundle": "^2.2.0", - "@sigstore/sign": "^2.2.3", + "@sigstore/bundle": "^2.3.0", + "@sigstore/sign": "^2.3.0", "jsonwebtoken": "^9.0.2", "jwks-rsa": "^3.1.0", "make-fetch-happen": "^13.0.0" diff --git a/packages/attest/src/attest.ts b/packages/attest/src/attest.ts index 2749132d..430f2413 100644 --- a/packages/attest/src/attest.ts +++ b/packages/attest/src/attest.ts @@ -1,10 +1,11 @@ -import {Bundle, bundleToJSON} from '@sigstore/bundle' +import {bundleToJSON} from '@sigstore/bundle' import {X509Certificate} from 'crypto' import {SigstoreInstance, signingEndpoints} from './endpoints' import {buildIntotoStatement} from './intoto' import {Payload, signPayload} from './sign' import {writeAttestation} from './store' +import type {Bundle} from '@sigstore/sign' import type {Attestation, Predicate, Subject} from './shared.types' const INTOTO_PAYLOAD_TYPE = 'application/vnd.in-toto+json' diff --git a/packages/attest/src/sign.ts b/packages/attest/src/sign.ts index a8bc1dcd..aad916f7 100644 --- a/packages/attest/src/sign.ts +++ b/packages/attest/src/sign.ts @@ -1,5 +1,5 @@ -import {Bundle} from '@sigstore/bundle' import { + Bundle, BundleBuilder, CIContextProvider, DSSEBundleBuilder, @@ -103,5 +103,7 @@ const initBundleBuilder = (opts: SignOptions): BundleBuilder => { ) } - return new DSSEBundleBuilder({signer, witnesses}) + // Build the bundle with the singleCertificate option which will + // trigger the creation of v0.3 DSSE bundles + return new DSSEBundleBuilder({signer, witnesses, singleCertificate: true}) } From 2e7a11c409485dfebf71f23c006f162721afd168 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Apr 2024 18:02:48 +0000 Subject: [PATCH 162/198] upgrading archiver package along with chunk timeout --- .../__tests__/upload-artifact.test.ts | 80 +++ packages/artifact/package-lock.json | 680 ++++++++++++++---- packages/artifact/package.json | 2 +- .../src/internal/upload/blob-upload.ts | 15 + packages/http-client/package-lock.json | 392 ---------- 5 files changed, 642 insertions(+), 527 deletions(-) delete mode 100644 packages/http-client/package-lock.json diff --git a/packages/artifact/__tests__/upload-artifact.test.ts b/packages/artifact/__tests__/upload-artifact.test.ts index b0dca5c8..4c825438 100644 --- a/packages/artifact/__tests__/upload-artifact.test.ts +++ b/packages/artifact/__tests__/upload-artifact.test.ts @@ -8,6 +8,7 @@ import * as blobUpload from '../src/internal/upload/blob-upload' import {uploadArtifact} from '../src/internal/upload/upload-artifact' import {noopLogs} from './common' import {FilesNotFoundError} from '../src/internal/shared/errors' +import {BlockBlobClient} from '@azure/storage-blob' describe('upload-artifact', () => { beforeEach(() => { @@ -351,4 +352,83 @@ describe('upload-artifact', () => { expect(uploadResp).rejects.toThrow() }) + + it('should throw an error uploading blob chunks get delayed', async () => { + const mockDate = new Date('2020-01-01') + jest + .spyOn(uploadZipSpecification, 'validateRootDirectory') + .mockReturnValue() + jest + .spyOn(uploadZipSpecification, 'getUploadZipSpecification') + .mockReturnValue([ + { + sourcePath: '/home/user/files/plz-upload/file1.txt', + destinationPath: 'file1.txt' + }, + { + sourcePath: '/home/user/files/plz-upload/file2.txt', + destinationPath: 'file2.txt' + }, + { + sourcePath: '/home/user/files/plz-upload/dir/file3.txt', + destinationPath: 'dir/file3.txt' + } + ]) + + jest.spyOn(util, 'getBackendIdsFromToken').mockReturnValue({ + workflowRunBackendId: '1234', + workflowJobRunBackendId: '5678' + }) + jest + .spyOn(retention, 'getExpiration') + .mockReturnValue(Timestamp.fromDate(mockDate)) + jest + .spyOn(ArtifactServiceClientJSON.prototype, 'CreateArtifact') + .mockReturnValue( + Promise.resolve({ + ok: true, + signedUploadUrl: 'https://signed-upload-url.com' + }) + ) + jest + .spyOn(blobUpload, 'uploadZipToBlobStorage') + .mockReturnValue(Promise.reject(new Error('Upload progress stalled.'))) + + // ArtifactHttpClient mocks + jest.spyOn(config, 'getRuntimeToken').mockReturnValue('test-token') + jest + .spyOn(config, 'getResultsServiceUrl') + .mockReturnValue('https://test-url.com') + + BlockBlobClient.prototype.uploadStream = jest + .fn() + .mockImplementation( + async (stream, bufferSize, maxConcurrency, options) => { + return new Promise(resolve => { + // Call the onProgress callback with a progress event + options.onProgress({loadedBytes: 0}) + + // Wait for 31 seconds before resolving the promise + setTimeout(() => { + // Call the onProgress callback again to simulate progress + options.onProgress({loadedBytes: 100}) + + resolve() + }, 31000) // Delay longer than your timeout + }) + } + ) + + const uploadResp = uploadArtifact( + 'test-artifact', + [ + '/home/user/files/plz-upload/file1.txt', + '/home/user/files/plz-upload/file2.txt', + '/home/user/files/plz-upload/dir/file3.txt' + ], + '/home/user/files/plz-upload' + ) + + expect(uploadResp).rejects.toThrow('Upload progress stalled.') + }) }) diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index 4ce3c7fb..4eebe9e5 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -18,7 +18,7 @@ "@octokit/plugin-retry": "^3.0.9", "@octokit/request-error": "^5.0.0", "@protobuf-ts/plugin": "^2.2.3-alpha.1", - "archiver": "^5.3.1", + "archiver": "^7.0.1", "crypto": "^1.0.1", "jwt-decode": "^3.1.2", "twirp-ts": "^2.5.0", @@ -186,6 +186,22 @@ "node": ">=14.0.0" } }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@octokit/auth-token": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz", @@ -348,6 +364,15 @@ "node": ">=8.0.0" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@protobuf-ts/plugin": { "version": "2.9.1", "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.9.1.tgz", @@ -480,74 +505,120 @@ "@types/node": "*" } }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, "node_modules/ansi-sequence-parser": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz", "integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==", "dev": true }, + "node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/archiver": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/archiver/-/archiver-5.3.1.tgz", - "integrity": "sha512-8KyabkmbYrH+9ibcTScQ1xCJC/CGcugdVIwB+53f5sZziXgwUh3iXlAlANMxcZyDEfTHMe6+Z5FofV8nopXP7w==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-7.0.1.tgz", + "integrity": "sha512-ZcbTaIqJOfCc03QwD468Unz/5Ir8ATtvAHsK+FdXbDIbGfihqh9mrvdcYunQzqn4HrvWWaFyaxJhGZagaJJpPQ==", "dependencies": { - "archiver-utils": "^2.1.0", - "async": "^3.2.3", - "buffer-crc32": "^0.2.1", - "readable-stream": "^3.6.0", - "readdir-glob": "^1.0.0", - "tar-stream": "^2.2.0", - "zip-stream": "^4.1.0" + "archiver-utils": "^5.0.2", + "async": "^3.2.4", + "buffer-crc32": "^1.0.0", + "readable-stream": "^4.0.0", + "readdir-glob": "^1.1.2", + "tar-stream": "^3.0.0", + "zip-stream": "^6.0.1" }, "engines": { - "node": ">= 10" + "node": ">= 14" } }, "node_modules/archiver-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-2.1.0.tgz", - "integrity": "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-5.0.2.tgz", + "integrity": "sha512-wuLJMmIBQYCsGZgYLTy5FIB2pF6Lfb6cXMSF8Qywwk3t20zWnAi7zLcQFdKQmIB8wyZpY5ER38x08GbwtR2cLA==", "dependencies": { - "glob": "^7.1.4", + "glob": "^10.0.0", "graceful-fs": "^4.2.0", + "is-stream": "^2.0.1", "lazystream": "^1.0.0", - "lodash.defaults": "^4.2.0", - "lodash.difference": "^4.5.0", - "lodash.flatten": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.union": "^4.6.0", + "lodash": "^4.17.15", "normalize-path": "^3.0.0", - "readable-stream": "^2.0.0" + "readable-stream": "^4.0.0" }, "engines": { - "node": ">= 6" + "node": ">= 14" } }, - "node_modules/archiver-utils/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "node_modules/archiver-utils/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "balanced-match": "^1.0.0" } }, - "node_modules/archiver-utils/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/archiver-utils/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "node_modules/archiver-utils/node_modules/glob": { + "version": "10.3.12", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.12.tgz", + "integrity": "sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg==", "dependencies": { - "safe-buffer": "~5.1.0" + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.6", + "minimatch": "^9.0.1", + "minipass": "^7.0.4", + "path-scurry": "^1.10.2" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/archiver-utils/node_modules/minimatch": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/async": { @@ -560,11 +631,22 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, + "node_modules/b4a": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.6.tgz", + "integrity": "sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg==" + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "node_modules/bare-events": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.2.2.tgz", + "integrity": "sha512-h7z00dWdG0PYOQEvChhOSWvOfkIKsdZGkWr083FgN/HyoQuebSew/cgirYqh9SCuy/hRvxc5Vy6Fw8xAmYHLkQ==", + "optional": true + }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -601,16 +683,6 @@ "node": "*" } }, - "node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, "node_modules/bottleneck": { "version": "2.19.5", "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", @@ -626,9 +698,9 @@ } }, "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "funding": [ { "type": "github", @@ -645,15 +717,15 @@ ], "dependencies": { "base64-js": "^1.3.1", - "ieee754": "^1.1.13" + "ieee754": "^1.2.1" } }, "node_modules/buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-1.0.0.tgz", + "integrity": "sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==", "engines": { - "node": "*" + "node": ">=8.0.0" } }, "node_modules/buffers": { @@ -684,6 +756,22 @@ "node": "*" } }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -704,17 +792,18 @@ } }, "node_modules/compress-commons": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-4.1.1.tgz", - "integrity": "sha512-QLdDLCKNV2dtoTorqgxngQCMA+gWXkM/Nwu7FpeBhk/RdkzimqC3jueb/FDmaZeXh+uby1jkBqE3xArsLBE5wQ==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-6.0.2.tgz", + "integrity": "sha512-6FqVXeETqWPoGcfzrXb37E50NP0LXT8kAMu5ooZayhWWdgEY4lBEEcbQNXtkuKQsGduxiIcI4gOTsxTmuq/bSg==", "dependencies": { - "buffer-crc32": "^0.2.13", - "crc32-stream": "^4.0.2", + "crc-32": "^1.2.0", + "crc32-stream": "^6.0.0", + "is-stream": "^2.0.1", "normalize-path": "^3.0.0", - "readable-stream": "^3.6.0" + "readable-stream": "^4.0.0" }, "engines": { - "node": ">= 10" + "node": ">= 14" } }, "node_modules/concat-map": { @@ -739,15 +828,28 @@ } }, "node_modules/crc32-stream": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-4.0.2.tgz", - "integrity": "sha512-DxFZ/Hk473b/muq1VJ///PMNLj0ZMnzye9thBpmjpJKCc5eMgB95aK8zCGrGfQ90cWo561Te6HK9D+j4KPdM6w==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-6.0.0.tgz", + "integrity": "sha512-piICUB6ei4IlTv1+653yq5+KoqfBYmj9bw6LqXoOneTMDXk5nM1qt12mFW1caG3LlJXEKW1Bp0WggEmIfQB34g==", "dependencies": { "crc-32": "^1.2.0", - "readable-stream": "^3.4.0" + "readable-stream": "^4.0.0" }, "engines": { - "node": ">= 10" + "node": ">= 14" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" } }, "node_modules/crypto": { @@ -781,12 +883,22 @@ "dot-object": "bin/dot-object" } }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dependencies": { - "once": "^1.4.0" + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "engines": { + "node": ">=6" } }, "node_modules/events": { @@ -797,6 +909,26 @@ "node": ">=0.8.x" } }, + "node_modules/fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==" + }, + "node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -810,11 +942,6 @@ "node": ">= 6" } }, - "node_modules/fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -898,6 +1025,14 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, "node_modules/is-plain-object": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", @@ -906,11 +1041,44 @@ "node": ">=0.10.0" } }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/jackspeak": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/jsonc-parser": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", @@ -965,31 +1133,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "node_modules/lodash.defaults": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", - "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==" - }, - "node_modules/lodash.difference": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", - "integrity": "sha512-dS2j+W26TQ7taQBGN8Lbbq04ssV3emRw4NY58WErlTO29pIqS0HmoT5aJ9+TUQ1N3G+JOZSji4eugsWwGp9yPA==" - }, - "node_modules/lodash.flatten": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", - "integrity": "sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==" - }, - "node_modules/lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" - }, - "node_modules/lodash.union": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", - "integrity": "sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw==" - }, "node_modules/lower-case": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", @@ -998,6 +1141,14 @@ "tslib": "^2.0.3" } }, + "node_modules/lru-cache": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", + "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", + "engines": { + "node": "14 || >=16.14" + } + }, "node_modules/lunr": { "version": "2.3.9", "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", @@ -1054,6 +1205,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/minipass": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", + "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/mkdirp": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", @@ -1132,6 +1291,29 @@ "node": ">=0.10.0" } }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.2.tgz", + "integrity": "sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/path-to-regexp": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz", @@ -1164,17 +1346,24 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, + "node_modules/queue-tick": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", + "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==" + }, "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" }, "engines": { - "node": ">= 6" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/readdir-glob": { @@ -1228,6 +1417,25 @@ "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "engines": { + "node": ">=8" + } + }, "node_modules/shiki": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.5.tgz", @@ -1240,6 +1448,17 @@ "vscode-textmate": "^8.0.0" } }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -1249,6 +1468,18 @@ "node": ">=0.10.0" } }, + "node_modules/streamx": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.16.1.tgz", + "integrity": "sha512-m9QYj6WygWyWa3H1YY69amr4nVgy61xfjys7xO7kviL5rfIEc2naf+ewFiOA+aEJD7y0JO3h2GoiUv4TDwEGzQ==", + "dependencies": { + "fast-fifo": "^1.1.0", + "queue-tick": "^1.0.1" + }, + "optionalDependencies": { + "bare-events": "^2.2.0" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -1257,19 +1488,102 @@ "safe-buffer": "~5.2.0" } }, - "node_modules/tar-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dependencies": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=6" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/tar-stream": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", + "dependencies": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" } }, "node_modules/tr46": { @@ -1471,12 +1785,110 @@ "webidl-conversions": "^3.0.0" } }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", "dev": true }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -1511,16 +1923,16 @@ } }, "node_modules/zip-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-4.1.0.tgz", - "integrity": "sha512-zshzwQW7gG7hjpBlgeQP9RuyPGNxvJdzR8SUM3QhxCnLjWN2E7j3dOvpeDcQoETfHx0urRS7EtmVToql7YpU4A==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-6.0.1.tgz", + "integrity": "sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==", "dependencies": { - "archiver-utils": "^2.1.0", - "compress-commons": "^4.1.0", - "readable-stream": "^3.6.0" + "archiver-utils": "^5.0.0", + "compress-commons": "^6.0.2", + "readable-stream": "^4.0.0" }, "engines": { - "node": ">= 10" + "node": ">= 14" } } } diff --git a/packages/artifact/package.json b/packages/artifact/package.json index c1557081..38878192 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -49,7 +49,7 @@ "@octokit/plugin-retry": "^3.0.9", "@octokit/request-error": "^5.0.0", "@protobuf-ts/plugin": "^2.2.3-alpha.1", - "archiver": "^5.3.1", + "archiver": "^7.0.1", "crypto": "^1.0.1", "jwt-decode": "^3.1.2", "twirp-ts": "^2.5.0", diff --git a/packages/artifact/src/internal/upload/blob-upload.ts b/packages/artifact/src/internal/upload/blob-upload.ts index 87bb7237..25a72866 100644 --- a/packages/artifact/src/internal/upload/blob-upload.ts +++ b/packages/artifact/src/internal/upload/blob-upload.ts @@ -24,11 +24,13 @@ export async function uploadZipToBlobStorage( zipUploadStream: ZipUploadStream ): Promise { let uploadByteCount = 0 + const lastProgressTime = Date.now() const maxConcurrency = getConcurrency() const bufferSize = getUploadChunkSize() const blobClient = new BlobClient(authenticatedUploadURL) const blockBlobClient = blobClient.getBlockBlobClient() + const timeoutDuration = 300000 // 30 seconds core.debug( `Uploading artifact zip to blob storage with maxConcurrency: ${maxConcurrency}, bufferSize: ${bufferSize}` @@ -37,8 +39,19 @@ export async function uploadZipToBlobStorage( const uploadCallback = (progress: TransferProgressEvent): void => { core.info(`Uploaded bytes ${progress.loadedBytes}`) uploadByteCount = progress.loadedBytes + progressTimeout(timeoutDuration) } + // Timeout if the upload stalls + const progressTimeout = (timeout: number): NodeJS.Timeout => + setTimeout(() => { + const now = Date.now() + // if there's been more than 30 seconds since the + // last progress event, then we'll consider the upload stalled + if (now - lastProgressTime > timeout) { + throw new Error('Upload progress stalled.') + } + }, timeout) const options: BlockBlobUploadStreamOptions = { blobHTTPHeaders: {blobContentType: 'zip'}, onProgress: uploadCallback @@ -80,6 +93,8 @@ export async function uploadZipToBlobStorage( ) } + // clear the progress timeout when upload completes + clearTimeout(progressTimeout(timeoutDuration)) return { uploadSize: uploadByteCount, sha256Hash diff --git a/packages/http-client/package-lock.json b/packages/http-client/package-lock.json deleted file mode 100644 index ea3d7951..00000000 --- a/packages/http-client/package-lock.json +++ /dev/null @@ -1,392 +0,0 @@ -{ - "name": "@actions/http-client", - "version": "2.2.1", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "@actions/http-client", - "version": "2.2.0", - "license": "MIT", - "dependencies": { - "tunnel": "^0.0.6", - "undici": "^5.25.4" - }, - "devDependencies": { - "@types/node": "20.7.1", - "@types/proxy": "^1.0.1", - "@types/tunnel": "0.0.3", - "proxy": "^2.1.1" - } - }, - "node_modules/@fastify/busboy": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.0.0.tgz", - "integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==", - "engines": { - "node": ">=14" - } - }, - "node_modules/@types/node": { - "version": "20.7.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.7.1.tgz", - "integrity": "sha512-LT+OIXpp2kj4E2S/p91BMe+VgGX2+lfO+XTpfXhh+bCk2LkQtHZSub8ewFBMGP5ClysPjTDFa4sMI8Q3n4T0wg==", - "dev": true - }, - "node_modules/@types/proxy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/proxy/-/proxy-1.0.2.tgz", - "integrity": "sha512-NDNsg7YuClVzEenn9SUButu43blypWvljGsIkDV7HI4N9apjrS0aeeMTUG0PYa71lD1AvIgvjkBagqHDiomDjA==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/tunnel": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@types/tunnel/-/tunnel-0.0.3.tgz", - "integrity": "sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/args": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/args/-/args-5.0.3.tgz", - "integrity": "sha512-h6k/zfFgusnv3i5TU08KQkVKuCPBtL/PWQbWkHUxvJrZ2nAyeaUupneemcrgn1xmqxPQsPIzwkUhOpoqPDRZuA==", - "dev": true, - "dependencies": { - "camelcase": "5.0.0", - "chalk": "2.4.2", - "leven": "2.1.0", - "mri": "1.1.4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/basic-auth-parser": { - "version": "0.0.2-1", - "resolved": "https://registry.npmjs.org/basic-auth-parser/-/basic-auth-parser-0.0.2-1.tgz", - "integrity": "sha512-GFj8iVxo9onSU6BnnQvVwqvxh60UcSHJEDnIk3z4B6iOjsKSmqe+ibW0Rsz7YO7IE1HG3D3tqCNIidP46SZVdQ==", - "dev": true - }, - "node_modules/camelcase": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", - "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/leven": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", - "integrity": "sha512-nvVPLpIHUxCUoRLrFqTgSxXJ614d8AgQoWl7zPe/2VadE8+1dpU3LBhowRuBAcuwruWtOdD8oYC9jDNJjXDPyA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/mri": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.4.tgz", - "integrity": "sha512-6y7IjGPm8AzlvoUrwAaw1tLnUBudaS3752vcd8JtrpGGQn+rXIe63LFVHm/YMwtqAuh+LJPCFdlLYPWM1nYn6w==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/proxy": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/proxy/-/proxy-2.1.1.tgz", - "integrity": "sha512-nLgd7zdUAOpB3ZO/xCkU8gy74UER7P0aihU8DkUsDS5ZoFwVCX7u8dy+cv5tVK8UaB/yminU1GiLWE26TKPYpg==", - "dev": true, - "dependencies": { - "args": "^5.0.3", - "basic-auth-parser": "0.0.2-1", - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/tunnel": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", - "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", - "engines": { - "node": ">=0.6.11 <=0.7.0 || >=0.7.3" - } - }, - "node_modules/undici": { - "version": "5.25.4", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.25.4.tgz", - "integrity": "sha512-450yJxT29qKMf3aoudzFpIciqpx6Pji3hEWaXqXmanbXF58LTAGCKxcJjxMXWu3iG+Mudgo3ZUfDB6YDFd/dAw==", - "dependencies": { - "@fastify/busboy": "^2.0.0" - }, - "engines": { - "node": ">=14.0" - } - } - }, - "dependencies": { - "@fastify/busboy": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.0.0.tgz", - "integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==" - }, - "@types/node": { - "version": "20.7.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.7.1.tgz", - "integrity": "sha512-LT+OIXpp2kj4E2S/p91BMe+VgGX2+lfO+XTpfXhh+bCk2LkQtHZSub8ewFBMGP5ClysPjTDFa4sMI8Q3n4T0wg==", - "dev": true - }, - "@types/proxy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/proxy/-/proxy-1.0.2.tgz", - "integrity": "sha512-NDNsg7YuClVzEenn9SUButu43blypWvljGsIkDV7HI4N9apjrS0aeeMTUG0PYa71lD1AvIgvjkBagqHDiomDjA==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/tunnel": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@types/tunnel/-/tunnel-0.0.3.tgz", - "integrity": "sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "args": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/args/-/args-5.0.3.tgz", - "integrity": "sha512-h6k/zfFgusnv3i5TU08KQkVKuCPBtL/PWQbWkHUxvJrZ2nAyeaUupneemcrgn1xmqxPQsPIzwkUhOpoqPDRZuA==", - "dev": true, - "requires": { - "camelcase": "5.0.0", - "chalk": "2.4.2", - "leven": "2.1.0", - "mri": "1.1.4" - } - }, - "basic-auth-parser": { - "version": "0.0.2-1", - "resolved": "https://registry.npmjs.org/basic-auth-parser/-/basic-auth-parser-0.0.2-1.tgz", - "integrity": "sha512-GFj8iVxo9onSU6BnnQvVwqvxh60UcSHJEDnIk3z4B6iOjsKSmqe+ibW0Rsz7YO7IE1HG3D3tqCNIidP46SZVdQ==", - "dev": true - }, - "camelcase": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", - "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", - "dev": true - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true - }, - "leven": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", - "integrity": "sha512-nvVPLpIHUxCUoRLrFqTgSxXJ614d8AgQoWl7zPe/2VadE8+1dpU3LBhowRuBAcuwruWtOdD8oYC9jDNJjXDPyA==", - "dev": true - }, - "mri": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.4.tgz", - "integrity": "sha512-6y7IjGPm8AzlvoUrwAaw1tLnUBudaS3752vcd8JtrpGGQn+rXIe63LFVHm/YMwtqAuh+LJPCFdlLYPWM1nYn6w==", - "dev": true - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "proxy": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/proxy/-/proxy-2.1.1.tgz", - "integrity": "sha512-nLgd7zdUAOpB3ZO/xCkU8gy74UER7P0aihU8DkUsDS5ZoFwVCX7u8dy+cv5tVK8UaB/yminU1GiLWE26TKPYpg==", - "dev": true, - "requires": { - "args": "^5.0.3", - "basic-auth-parser": "0.0.2-1", - "debug": "^4.3.4" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "tunnel": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", - "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" - }, - "undici": { - "version": "5.25.4", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.25.4.tgz", - "integrity": "sha512-450yJxT29qKMf3aoudzFpIciqpx6Pji3hEWaXqXmanbXF58LTAGCKxcJjxMXWu3iG+Mudgo3ZUfDB6YDFd/dAw==", - "requires": { - "@fastify/busboy": "^2.0.0" - } - } - } -} From 7f0a981b2e74f0dc24dd5a6cd722191b0a8577f4 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Apr 2024 18:09:34 +0000 Subject: [PATCH 163/198] Revert http --- packages/http-client/package-lock.json | 392 +++++++++++++++++++++++++ 1 file changed, 392 insertions(+) create mode 100644 packages/http-client/package-lock.json diff --git a/packages/http-client/package-lock.json b/packages/http-client/package-lock.json new file mode 100644 index 00000000..ea3d7951 --- /dev/null +++ b/packages/http-client/package-lock.json @@ -0,0 +1,392 @@ +{ + "name": "@actions/http-client", + "version": "2.2.1", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "@actions/http-client", + "version": "2.2.0", + "license": "MIT", + "dependencies": { + "tunnel": "^0.0.6", + "undici": "^5.25.4" + }, + "devDependencies": { + "@types/node": "20.7.1", + "@types/proxy": "^1.0.1", + "@types/tunnel": "0.0.3", + "proxy": "^2.1.1" + } + }, + "node_modules/@fastify/busboy": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.0.0.tgz", + "integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@types/node": { + "version": "20.7.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.7.1.tgz", + "integrity": "sha512-LT+OIXpp2kj4E2S/p91BMe+VgGX2+lfO+XTpfXhh+bCk2LkQtHZSub8ewFBMGP5ClysPjTDFa4sMI8Q3n4T0wg==", + "dev": true + }, + "node_modules/@types/proxy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/proxy/-/proxy-1.0.2.tgz", + "integrity": "sha512-NDNsg7YuClVzEenn9SUButu43blypWvljGsIkDV7HI4N9apjrS0aeeMTUG0PYa71lD1AvIgvjkBagqHDiomDjA==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/tunnel": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/@types/tunnel/-/tunnel-0.0.3.tgz", + "integrity": "sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/args": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/args/-/args-5.0.3.tgz", + "integrity": "sha512-h6k/zfFgusnv3i5TU08KQkVKuCPBtL/PWQbWkHUxvJrZ2nAyeaUupneemcrgn1xmqxPQsPIzwkUhOpoqPDRZuA==", + "dev": true, + "dependencies": { + "camelcase": "5.0.0", + "chalk": "2.4.2", + "leven": "2.1.0", + "mri": "1.1.4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/basic-auth-parser": { + "version": "0.0.2-1", + "resolved": "https://registry.npmjs.org/basic-auth-parser/-/basic-auth-parser-0.0.2-1.tgz", + "integrity": "sha512-GFj8iVxo9onSU6BnnQvVwqvxh60UcSHJEDnIk3z4B6iOjsKSmqe+ibW0Rsz7YO7IE1HG3D3tqCNIidP46SZVdQ==", + "dev": true + }, + "node_modules/camelcase": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", + "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/leven": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", + "integrity": "sha512-nvVPLpIHUxCUoRLrFqTgSxXJ614d8AgQoWl7zPe/2VadE8+1dpU3LBhowRuBAcuwruWtOdD8oYC9jDNJjXDPyA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mri": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.4.tgz", + "integrity": "sha512-6y7IjGPm8AzlvoUrwAaw1tLnUBudaS3752vcd8JtrpGGQn+rXIe63LFVHm/YMwtqAuh+LJPCFdlLYPWM1nYn6w==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/proxy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/proxy/-/proxy-2.1.1.tgz", + "integrity": "sha512-nLgd7zdUAOpB3ZO/xCkU8gy74UER7P0aihU8DkUsDS5ZoFwVCX7u8dy+cv5tVK8UaB/yminU1GiLWE26TKPYpg==", + "dev": true, + "dependencies": { + "args": "^5.0.3", + "basic-auth-parser": "0.0.2-1", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + } + }, + "node_modules/undici": { + "version": "5.25.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.25.4.tgz", + "integrity": "sha512-450yJxT29qKMf3aoudzFpIciqpx6Pji3hEWaXqXmanbXF58LTAGCKxcJjxMXWu3iG+Mudgo3ZUfDB6YDFd/dAw==", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + } + }, + "dependencies": { + "@fastify/busboy": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.0.0.tgz", + "integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==" + }, + "@types/node": { + "version": "20.7.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.7.1.tgz", + "integrity": "sha512-LT+OIXpp2kj4E2S/p91BMe+VgGX2+lfO+XTpfXhh+bCk2LkQtHZSub8ewFBMGP5ClysPjTDFa4sMI8Q3n4T0wg==", + "dev": true + }, + "@types/proxy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/proxy/-/proxy-1.0.2.tgz", + "integrity": "sha512-NDNsg7YuClVzEenn9SUButu43blypWvljGsIkDV7HI4N9apjrS0aeeMTUG0PYa71lD1AvIgvjkBagqHDiomDjA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/tunnel": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/@types/tunnel/-/tunnel-0.0.3.tgz", + "integrity": "sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "args": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/args/-/args-5.0.3.tgz", + "integrity": "sha512-h6k/zfFgusnv3i5TU08KQkVKuCPBtL/PWQbWkHUxvJrZ2nAyeaUupneemcrgn1xmqxPQsPIzwkUhOpoqPDRZuA==", + "dev": true, + "requires": { + "camelcase": "5.0.0", + "chalk": "2.4.2", + "leven": "2.1.0", + "mri": "1.1.4" + } + }, + "basic-auth-parser": { + "version": "0.0.2-1", + "resolved": "https://registry.npmjs.org/basic-auth-parser/-/basic-auth-parser-0.0.2-1.tgz", + "integrity": "sha512-GFj8iVxo9onSU6BnnQvVwqvxh60UcSHJEDnIk3z4B6iOjsKSmqe+ibW0Rsz7YO7IE1HG3D3tqCNIidP46SZVdQ==", + "dev": true + }, + "camelcase": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", + "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "leven": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", + "integrity": "sha512-nvVPLpIHUxCUoRLrFqTgSxXJ614d8AgQoWl7zPe/2VadE8+1dpU3LBhowRuBAcuwruWtOdD8oYC9jDNJjXDPyA==", + "dev": true + }, + "mri": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.4.tgz", + "integrity": "sha512-6y7IjGPm8AzlvoUrwAaw1tLnUBudaS3752vcd8JtrpGGQn+rXIe63LFVHm/YMwtqAuh+LJPCFdlLYPWM1nYn6w==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "proxy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/proxy/-/proxy-2.1.1.tgz", + "integrity": "sha512-nLgd7zdUAOpB3ZO/xCkU8gy74UER7P0aihU8DkUsDS5ZoFwVCX7u8dy+cv5tVK8UaB/yminU1GiLWE26TKPYpg==", + "dev": true, + "requires": { + "args": "^5.0.3", + "basic-auth-parser": "0.0.2-1", + "debug": "^4.3.4" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" + }, + "undici": { + "version": "5.25.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.25.4.tgz", + "integrity": "sha512-450yJxT29qKMf3aoudzFpIciqpx6Pji3hEWaXqXmanbXF58LTAGCKxcJjxMXWu3iG+Mudgo3ZUfDB6YDFd/dAw==", + "requires": { + "@fastify/busboy": "^2.0.0" + } + } + } +} From f98ccd1e39093913ef977bfe94a5505fdc38ae24 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Apr 2024 18:21:41 +0000 Subject: [PATCH 164/198] updating tests --- packages/artifact/__tests__/upload-artifact.test.ts | 11 ++++++++++- packages/artifact/package-lock.json | 9 +++++++++ packages/artifact/package.json | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/artifact/__tests__/upload-artifact.test.ts b/packages/artifact/__tests__/upload-artifact.test.ts index 4c825438..e90e6160 100644 --- a/packages/artifact/__tests__/upload-artifact.test.ts +++ b/packages/artifact/__tests__/upload-artifact.test.ts @@ -9,7 +9,7 @@ import {uploadArtifact} from '../src/internal/upload/upload-artifact' import {noopLogs} from './common' import {FilesNotFoundError} from '../src/internal/shared/errors' import {BlockBlobClient} from '@azure/storage-blob' - +import mockFs from 'mock-fs' describe('upload-artifact', () => { beforeEach(() => { noopLogs() @@ -374,6 +374,15 @@ describe('upload-artifact', () => { destinationPath: 'dir/file3.txt' } ]) + mockFs({ + '/home/user/files/plz-upload': { + 'file1.txt': 'file1 content', + 'file2.txt': 'file2 content', + dir: { + 'file3.txt': 'file3 content' + } + } + }) jest.spyOn(util, 'getBackendIdsFromToken').mockReturnValue({ workflowRunBackendId: '1234', diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index 4eebe9e5..907ceff3 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -21,6 +21,7 @@ "archiver": "^7.0.1", "crypto": "^1.0.1", "jwt-decode": "^3.1.2", + "mock-fs": "^5.2.0", "twirp-ts": "^2.5.0", "unzip-stream": "^0.3.1" }, @@ -1224,6 +1225,14 @@ "mkdirp": "bin/cmd.js" } }, + "node_modules/mock-fs": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-5.2.0.tgz", + "integrity": "sha512-2dF2R6YMSZbpip1V1WHKGLNjr/k48uQClqMVb5H3MOvwc9qhYis3/IWbj02qIg/Y8MDXKFF4c5v0rxx2o6xTZw==", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", diff --git a/packages/artifact/package.json b/packages/artifact/package.json index 38878192..140c3ca8 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -52,6 +52,7 @@ "archiver": "^7.0.1", "crypto": "^1.0.1", "jwt-decode": "^3.1.2", + "mock-fs": "^5.2.0", "twirp-ts": "^2.5.0", "unzip-stream": "^0.3.1" }, From 61d6acdeb130a7e2ba14cd684c69b61a32aa6fea Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Apr 2024 18:52:19 +0000 Subject: [PATCH 165/198] updating test --- .../__tests__/upload-artifact.test.ts | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/packages/artifact/__tests__/upload-artifact.test.ts b/packages/artifact/__tests__/upload-artifact.test.ts index e90e6160..a6ebcb8f 100644 --- a/packages/artifact/__tests__/upload-artifact.test.ts +++ b/packages/artifact/__tests__/upload-artifact.test.ts @@ -9,7 +9,9 @@ import {uploadArtifact} from '../src/internal/upload/upload-artifact' import {noopLogs} from './common' import {FilesNotFoundError} from '../src/internal/shared/errors' import {BlockBlobClient} from '@azure/storage-blob' -import mockFs from 'mock-fs' +import fs from 'fs' +import {Readable} from 'stream' + describe('upload-artifact', () => { beforeEach(() => { noopLogs() @@ -355,6 +357,16 @@ describe('upload-artifact', () => { it('should throw an error uploading blob chunks get delayed', async () => { const mockDate = new Date('2020-01-01') + jest.mock('fs') + + // Mock fs.createReadStream to return a mock stream + fs.createReadStream = jest.fn().mockImplementation(() => { + const mockStream = new Readable() + mockStream.push('file content') + mockStream.push(null) + return mockStream + }) + jest .spyOn(uploadZipSpecification, 'validateRootDirectory') .mockReturnValue() @@ -374,15 +386,6 @@ describe('upload-artifact', () => { destinationPath: 'dir/file3.txt' } ]) - mockFs({ - '/home/user/files/plz-upload': { - 'file1.txt': 'file1 content', - 'file2.txt': 'file2 content', - dir: { - 'file3.txt': 'file3 content' - } - } - }) jest.spyOn(util, 'getBackendIdsFromToken').mockReturnValue({ workflowRunBackendId: '1234', From 4fc93ec1159ad75f532dea9f3e8e2969fc728c6f Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Apr 2024 19:01:54 +0000 Subject: [PATCH 166/198] . --- packages/artifact/__tests__/upload-artifact.test.ts | 2 +- packages/artifact/package-lock.json | 3 ++- packages/artifact/package.json | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/artifact/__tests__/upload-artifact.test.ts b/packages/artifact/__tests__/upload-artifact.test.ts index a6ebcb8f..c98114d6 100644 --- a/packages/artifact/__tests__/upload-artifact.test.ts +++ b/packages/artifact/__tests__/upload-artifact.test.ts @@ -357,7 +357,6 @@ describe('upload-artifact', () => { it('should throw an error uploading blob chunks get delayed', async () => { const mockDate = new Date('2020-01-01') - jest.mock('fs') // Mock fs.createReadStream to return a mock stream fs.createReadStream = jest.fn().mockImplementation(() => { @@ -431,6 +430,7 @@ describe('upload-artifact', () => { } ) + jest.mock('fs') const uploadResp = uploadArtifact( 'test-artifact', [ diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index 907ceff3..b78d919d 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -21,13 +21,13 @@ "archiver": "^7.0.1", "crypto": "^1.0.1", "jwt-decode": "^3.1.2", - "mock-fs": "^5.2.0", "twirp-ts": "^2.5.0", "unzip-stream": "^0.3.1" }, "devDependencies": { "@types/archiver": "^5.3.2", "@types/unzip-stream": "^0.3.4", + "mock-fs": "^5.2.0", "typedoc": "^0.25.4", "typedoc-plugin-markdown": "^3.17.1", "typescript": "^5.2.2" @@ -1229,6 +1229,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-5.2.0.tgz", "integrity": "sha512-2dF2R6YMSZbpip1V1WHKGLNjr/k48uQClqMVb5H3MOvwc9qhYis3/IWbj02qIg/Y8MDXKFF4c5v0rxx2o6xTZw==", + "dev": true, "engines": { "node": ">=12.0.0" } diff --git a/packages/artifact/package.json b/packages/artifact/package.json index 140c3ca8..ce9faec1 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -52,7 +52,6 @@ "archiver": "^7.0.1", "crypto": "^1.0.1", "jwt-decode": "^3.1.2", - "mock-fs": "^5.2.0", "twirp-ts": "^2.5.0", "unzip-stream": "^0.3.1" }, @@ -61,6 +60,7 @@ "@types/unzip-stream": "^0.3.4", "typedoc": "^0.25.4", "typedoc-plugin-markdown": "^3.17.1", + "mock-fs": "^5.2.0", "typescript": "^5.2.2" } -} +} \ No newline at end of file From 2ed9516172902d39e232318dc3b63267f1c49913 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Apr 2024 19:24:52 +0000 Subject: [PATCH 167/198] updating timeout --- packages/artifact/__tests__/upload-artifact.test.ts | 2 +- packages/artifact/src/internal/upload/blob-upload.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/artifact/__tests__/upload-artifact.test.ts b/packages/artifact/__tests__/upload-artifact.test.ts index c98114d6..59d9ed87 100644 --- a/packages/artifact/__tests__/upload-artifact.test.ts +++ b/packages/artifact/__tests__/upload-artifact.test.ts @@ -425,7 +425,7 @@ describe('upload-artifact', () => { options.onProgress({loadedBytes: 100}) resolve() - }, 31000) // Delay longer than your timeout + }, 61000) // Delay longer than your timeout }) } ) diff --git a/packages/artifact/src/internal/upload/blob-upload.ts b/packages/artifact/src/internal/upload/blob-upload.ts index 25a72866..1bbe6b25 100644 --- a/packages/artifact/src/internal/upload/blob-upload.ts +++ b/packages/artifact/src/internal/upload/blob-upload.ts @@ -30,7 +30,7 @@ export async function uploadZipToBlobStorage( const bufferSize = getUploadChunkSize() const blobClient = new BlobClient(authenticatedUploadURL) const blockBlobClient = blobClient.getBlockBlobClient() - const timeoutDuration = 300000 // 30 seconds + const timeoutDuration = 600000 // 30 seconds core.debug( `Uploading artifact zip to blob storage with maxConcurrency: ${maxConcurrency}, bufferSize: ${bufferSize}` From 98ce947a6cfa8cac5931f18071cbedc36e9e28b9 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Apr 2024 19:38:57 +0000 Subject: [PATCH 168/198] updating timeout --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ea3ac2ed..ac84d550 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "lint": "eslint packages/**/*.ts", "lint-fix": "eslint packages/**/*.ts --fix", "new-package": "scripts/create-package", - "test": "jest --testTimeout 60000" + "test": "jest --testTimeout 62000" }, "devDependencies": { "@types/jest": "^29.5.4", From 0d3d3bbb40fa04dfe8e2644c493099152ccbb00c Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Apr 2024 20:40:08 +0000 Subject: [PATCH 169/198] Adding missing progress time --- packages/artifact/src/internal/upload/blob-upload.ts | 4 +++- packages/http-client/package-lock.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/artifact/src/internal/upload/blob-upload.ts b/packages/artifact/src/internal/upload/blob-upload.ts index 1bbe6b25..6558f605 100644 --- a/packages/artifact/src/internal/upload/blob-upload.ts +++ b/packages/artifact/src/internal/upload/blob-upload.ts @@ -24,7 +24,7 @@ export async function uploadZipToBlobStorage( zipUploadStream: ZipUploadStream ): Promise { let uploadByteCount = 0 - const lastProgressTime = Date.now() + let lastProgressTime = Date.now() const maxConcurrency = getConcurrency() const bufferSize = getUploadChunkSize() @@ -52,6 +52,8 @@ export async function uploadZipToBlobStorage( throw new Error('Upload progress stalled.') } }, timeout) + + lastProgressTime = Date.now() const options: BlockBlobUploadStreamOptions = { blobHTTPHeaders: {blobContentType: 'zip'}, onProgress: uploadCallback diff --git a/packages/http-client/package-lock.json b/packages/http-client/package-lock.json index ea3d7951..52038ad3 100644 --- a/packages/http-client/package-lock.json +++ b/packages/http-client/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "@actions/http-client", - "version": "2.2.0", + "version": "2.2.1", "license": "MIT", "dependencies": { "tunnel": "^0.0.6", From 90fca239206a7884130b41a7d5775dfe2816d418 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Apr 2024 20:51:12 +0000 Subject: [PATCH 170/198] replacing timeout --- package.json | 2 +- packages/artifact/__tests__/upload-artifact.test.ts | 2 +- packages/artifact/src/internal/upload/blob-upload.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ac84d550..ea3ac2ed 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "lint": "eslint packages/**/*.ts", "lint-fix": "eslint packages/**/*.ts --fix", "new-package": "scripts/create-package", - "test": "jest --testTimeout 62000" + "test": "jest --testTimeout 60000" }, "devDependencies": { "@types/jest": "^29.5.4", diff --git a/packages/artifact/__tests__/upload-artifact.test.ts b/packages/artifact/__tests__/upload-artifact.test.ts index 59d9ed87..c98114d6 100644 --- a/packages/artifact/__tests__/upload-artifact.test.ts +++ b/packages/artifact/__tests__/upload-artifact.test.ts @@ -425,7 +425,7 @@ describe('upload-artifact', () => { options.onProgress({loadedBytes: 100}) resolve() - }, 61000) // Delay longer than your timeout + }, 31000) // Delay longer than your timeout }) } ) diff --git a/packages/artifact/src/internal/upload/blob-upload.ts b/packages/artifact/src/internal/upload/blob-upload.ts index 6558f605..88ed54cd 100644 --- a/packages/artifact/src/internal/upload/blob-upload.ts +++ b/packages/artifact/src/internal/upload/blob-upload.ts @@ -30,7 +30,7 @@ export async function uploadZipToBlobStorage( const bufferSize = getUploadChunkSize() const blobClient = new BlobClient(authenticatedUploadURL) const blockBlobClient = blobClient.getBlockBlobClient() - const timeoutDuration = 600000 // 30 seconds + const timeoutDuration = 300000 // 30 seconds core.debug( `Uploading artifact zip to blob storage with maxConcurrency: ${maxConcurrency}, bufferSize: ${bufferSize}` From 425f05e29d8c6ebb68a53812af873f88c906bad0 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Apr 2024 21:04:29 +0000 Subject: [PATCH 171/198] moving timer outside of uploadZipToBlobStorage --- .../src/internal/upload/blob-upload.ts | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/artifact/src/internal/upload/blob-upload.ts b/packages/artifact/src/internal/upload/blob-upload.ts index 88ed54cd..f7c0fcf9 100644 --- a/packages/artifact/src/internal/upload/blob-upload.ts +++ b/packages/artifact/src/internal/upload/blob-upload.ts @@ -25,6 +25,15 @@ export async function uploadZipToBlobStorage( ): Promise { let uploadByteCount = 0 let lastProgressTime = Date.now() + const chunkTimer = (timeout: number): NodeJS.Timeout => + setTimeout(() => { + const now = Date.now() + // if there's been more than 30 seconds since the + // last progress event, then we'll consider the upload stalled + if (now - lastProgressTime > timeout) { + throw new Error('Upload progress stalled.') + } + }, timeout) const maxConcurrency = getConcurrency() const bufferSize = getUploadChunkSize() @@ -39,21 +48,12 @@ export async function uploadZipToBlobStorage( const uploadCallback = (progress: TransferProgressEvent): void => { core.info(`Uploaded bytes ${progress.loadedBytes}`) uploadByteCount = progress.loadedBytes - progressTimeout(timeoutDuration) + chunkTimer(timeoutDuration) + lastProgressTime = Date.now() } - // Timeout if the upload stalls - const progressTimeout = (timeout: number): NodeJS.Timeout => - setTimeout(() => { - const now = Date.now() - // if there's been more than 30 seconds since the - // last progress event, then we'll consider the upload stalled - if (now - lastProgressTime > timeout) { - throw new Error('Upload progress stalled.') - } - }, timeout) - - lastProgressTime = Date.now() + // // Timeout if the upload stalls + // const progressTimeout const options: BlockBlobUploadStreamOptions = { blobHTTPHeaders: {blobContentType: 'zip'}, onProgress: uploadCallback @@ -96,7 +96,7 @@ export async function uploadZipToBlobStorage( } // clear the progress timeout when upload completes - clearTimeout(progressTimeout(timeoutDuration)) + clearTimeout(chunkTimer(timeoutDuration)) return { uploadSize: uploadByteCount, sha256Hash From 18a8a22c657179e18088afbbd041d1252ed855d5 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Apr 2024 21:05:58 +0000 Subject: [PATCH 172/198] updating upload try catch to always call cleartimeout --- packages/artifact/src/internal/upload/blob-upload.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/artifact/src/internal/upload/blob-upload.ts b/packages/artifact/src/internal/upload/blob-upload.ts index f7c0fcf9..edf02fc3 100644 --- a/packages/artifact/src/internal/upload/blob-upload.ts +++ b/packages/artifact/src/internal/upload/blob-upload.ts @@ -81,6 +81,9 @@ export async function uploadZipToBlobStorage( } throw error + } finally { + // clear the progress timeout when upload completes + clearTimeout(chunkTimer(timeoutDuration)) } core.info('Finished uploading artifact content to blob storage!') From fa9db3c8fa451ce842374a5de379a6e82461554d Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Apr 2024 21:18:30 +0000 Subject: [PATCH 173/198] wrapping timeout in try catch --- packages/artifact/src/internal/upload/blob-upload.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/artifact/src/internal/upload/blob-upload.ts b/packages/artifact/src/internal/upload/blob-upload.ts index edf02fc3..1fbdf771 100644 --- a/packages/artifact/src/internal/upload/blob-upload.ts +++ b/packages/artifact/src/internal/upload/blob-upload.ts @@ -25,6 +25,8 @@ export async function uploadZipToBlobStorage( ): Promise { let uploadByteCount = 0 let lastProgressTime = Date.now() + let timeoutId: NodeJS.Timeout | undefined + const chunkTimer = (timeout: number): NodeJS.Timeout => setTimeout(() => { const now = Date.now() @@ -34,7 +36,6 @@ export async function uploadZipToBlobStorage( throw new Error('Upload progress stalled.') } }, timeout) - const maxConcurrency = getConcurrency() const bufferSize = getUploadChunkSize() const blobClient = new BlobClient(authenticatedUploadURL) @@ -69,6 +70,8 @@ export async function uploadZipToBlobStorage( core.info('Beginning upload of artifact content to blob storage') try { + // Start the chunk timer + timeoutId = chunkTimer(timeoutDuration) await blockBlobClient.uploadStream( uploadStream, bufferSize, @@ -79,11 +82,12 @@ export async function uploadZipToBlobStorage( if (NetworkError.isNetworkErrorCode(error?.code)) { throw new NetworkError(error?.code) } - throw error } finally { - // clear the progress timeout when upload completes - clearTimeout(chunkTimer(timeoutDuration)) + // clear the timeout whether or not the upload completes + if (timeoutId) { + clearTimeout(timeoutId) + } } core.info('Finished uploading artifact content to blob storage!') From 222733049e3dc37adf0f8fc8c18e1f08ea548976 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Tue, 9 Apr 2024 21:22:40 +0000 Subject: [PATCH 174/198] . --- packages/artifact/src/internal/upload/blob-upload.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/artifact/src/internal/upload/blob-upload.ts b/packages/artifact/src/internal/upload/blob-upload.ts index 1fbdf771..f08bbe81 100644 --- a/packages/artifact/src/internal/upload/blob-upload.ts +++ b/packages/artifact/src/internal/upload/blob-upload.ts @@ -27,8 +27,13 @@ export async function uploadZipToBlobStorage( let lastProgressTime = Date.now() let timeoutId: NodeJS.Timeout | undefined - const chunkTimer = (timeout: number): NodeJS.Timeout => - setTimeout(() => { + const chunkTimer = (timeout: number): NodeJS.Timeout => { + // clear the previous timeout + if (timeoutId) { + clearTimeout(timeoutId) + } + + timeoutId = setTimeout(() => { const now = Date.now() // if there's been more than 30 seconds since the // last progress event, then we'll consider the upload stalled @@ -36,6 +41,8 @@ export async function uploadZipToBlobStorage( throw new Error('Upload progress stalled.') } }, timeout) + return timeoutId + } const maxConcurrency = getConcurrency() const bufferSize = getUploadChunkSize() const blobClient = new BlobClient(authenticatedUploadURL) From c01bc907edb9ab4c330ece6b7b6d19ae03c2a980 Mon Sep 17 00:00:00 2001 From: eggyhead <28715808+eggyhead@users.noreply.github.com> Date: Wed, 10 Apr 2024 21:30:24 +0000 Subject: [PATCH 175/198] fixing https://github.com/advisories/GHSA-f5x3-32g6-xq36 --- package-lock.json | 5342 +++++++++++++++++++++++++++++---------------- package.json | 4 +- 2 files changed, 3478 insertions(+), 1868 deletions(-) diff --git a/package-lock.json b/package-lock.json index 63f54a4d..7eeae1d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "eslint-plugin-prettier": "^5.0.0", "flow-bin": "^0.115.0", "jest": "^29.6.4", - "lerna": "^7.1.4", + "lerna": "^6.4.1", "nx": "16.6.0", "prettier": "^3.0.0", "ts-jest": "^29.1.1", @@ -769,6 +769,12 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@gar/promisify": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", + "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", + "dev": true + }, "node_modules/@github/browserslist-config": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@github/browserslist-config/-/browserslist-config-1.0.0.tgz", @@ -817,95 +823,11 @@ "node": ">=6.9.0" } }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } + "node_modules/@isaacs/string-locale-compare": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@isaacs/string-locale-compare/-/string-locale-compare-1.1.0.tgz", + "integrity": "sha512-SQ7Kzhh9+D+ZW9MA0zkYv3VXhIDNx+LzM6EJ+/65I3QY+enU6Itte7E5XX7EWrqLW2FN4n06GWzBnPoC3th2aQ==", + "dev": true }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", @@ -1341,10 +1263,109 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@lerna/add": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/add/-/add-6.4.1.tgz", + "integrity": "sha512-YSRnMcsdYnQtQQK0NSyrS9YGXvB3jzvx183o+JTH892MKzSlBqwpBHekCknSibyxga1HeZ0SNKQXgsHAwWkrRw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/bootstrap": "6.4.1", + "@lerna/command": "6.4.1", + "@lerna/filter-options": "6.4.1", + "@lerna/npm-conf": "6.4.1", + "@lerna/validation-error": "6.4.1", + "dedent": "^0.7.0", + "npm-package-arg": "8.1.1", + "p-map": "^4.0.0", + "pacote": "^13.6.1", + "semver": "^7.3.4" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/add/node_modules/dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", + "dev": true + }, + "node_modules/@lerna/bootstrap": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/bootstrap/-/bootstrap-6.4.1.tgz", + "integrity": "sha512-64cm0mnxzxhUUjH3T19ZSjPdn28vczRhhTXhNAvOhhU0sQgHrroam1xQC1395qbkV3iosSertlu8e7xbXW033w==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/command": "6.4.1", + "@lerna/filter-options": "6.4.1", + "@lerna/has-npm-version": "6.4.1", + "@lerna/npm-install": "6.4.1", + "@lerna/package-graph": "6.4.1", + "@lerna/pulse-till-done": "6.4.1", + "@lerna/rimraf-dir": "6.4.1", + "@lerna/run-lifecycle": "6.4.1", + "@lerna/run-topologically": "6.4.1", + "@lerna/symlink-binary": "6.4.1", + "@lerna/symlink-dependencies": "6.4.1", + "@lerna/validation-error": "6.4.1", + "@npmcli/arborist": "5.3.0", + "dedent": "^0.7.0", + "get-port": "^5.1.1", + "multimatch": "^5.0.0", + "npm-package-arg": "8.1.1", + "npmlog": "^6.0.2", + "p-map": "^4.0.0", + "p-map-series": "^2.1.0", + "p-waterfall": "^2.1.1", + "semver": "^7.3.4" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/bootstrap/node_modules/dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", + "dev": true + }, + "node_modules/@lerna/changed": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/changed/-/changed-6.4.1.tgz", + "integrity": "sha512-Z/z0sTm3l/iZW0eTSsnQpcY5d6eOpNO0g4wMOK+hIboWG0QOTc8b28XCnfCUO+33UisKl8PffultgoaHMKkGgw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/collect-updates": "6.4.1", + "@lerna/command": "6.4.1", + "@lerna/listable": "6.4.1", + "@lerna/output": "6.4.1" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/check-working-tree": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/check-working-tree/-/check-working-tree-6.4.1.tgz", + "integrity": "sha512-EnlkA1wxaRLqhJdn9HX7h+JYxqiTK9aWEFOPqAE8lqjxHn3RpM9qBp1bAdL7CeUk3kN1lvxKwDEm0mfcIyMbPA==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/collect-uncommitted": "6.4.1", + "@lerna/describe-ref": "6.4.1", + "@lerna/validation-error": "6.4.1" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, "node_modules/@lerna/child-process": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@lerna/child-process/-/child-process-7.2.0.tgz", - "integrity": "sha512-8cRsYYX8rGZTXL1KcLBv0RHD9PMvphWZay8yg4qf2giX6x86dQyTetSU4SplG2LBGVClilmNHJa/CQwvPQNUFA==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/child-process/-/child-process-6.4.1.tgz", + "integrity": "sha512-dvEKK0yKmxOv8pccf3I5D/k+OGiLxQp5KYjsrDtkes2pjpCFfQAMbmpol/Tqx6w/2o2rSaRrLsnX8TENo66FsA==", "dev": true, "dependencies": { "chalk": "^4.1.0", @@ -1352,99 +1373,203 @@ "strong-log-transformer": "^2.1.0" }, "engines": { - "node": "^14.17.0 || >=16.0.0" + "node": "^14.15.0 || >=16.0.0" } }, - "node_modules/@lerna/create": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@lerna/create/-/create-7.2.0.tgz", - "integrity": "sha512-bBypNfwqOQNcfR2nXJ3mWUeIAIoSFpXg8MjuFSf87PzIiyeTEKa3Z57vAa3bDbHQtcB7x6f0rWysK1eQZSH15Q==", + "node_modules/@lerna/clean": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/clean/-/clean-6.4.1.tgz", + "integrity": "sha512-FuVyW3mpos5ESCWSkQ1/ViXyEtsZ9k45U66cdM/HnteHQk/XskSQw0sz9R+whrZRUDu6YgYLSoj1j0YAHVK/3A==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", "dev": true, "dependencies": { - "@lerna/child-process": "7.2.0", - "@npmcli/run-script": "6.0.2", - "@nx/devkit": ">=16.5.1 < 17", - "@octokit/plugin-enterprise-rest": "6.0.1", - "@octokit/rest": "19.0.11", - "byte-size": "8.1.1", - "chalk": "4.1.0", - "clone-deep": "4.0.1", - "cmd-shim": "6.0.1", - "columnify": "1.6.0", - "conventional-changelog-core": "5.0.1", - "conventional-recommended-bump": "7.0.1", - "cosmiconfig": "^8.2.0", - "dedent": "0.7.0", - "execa": "5.0.0", - "fs-extra": "^11.1.1", - "get-stream": "6.0.0", - "git-url-parse": "13.1.0", - "glob-parent": "5.1.2", - "globby": "11.1.0", - "graceful-fs": "4.2.11", - "has-unicode": "2.0.1", - "ini": "^1.3.8", - "init-package-json": "5.0.0", - "inquirer": "^8.2.4", - "is-ci": "3.0.1", - "is-stream": "2.0.0", - "js-yaml": "4.1.0", - "libnpmpublish": "7.3.0", - "load-json-file": "6.2.0", - "lodash": "^4.17.21", - "make-dir": "3.1.0", - "minimatch": "3.0.5", - "multimatch": "5.0.0", - "node-fetch": "2.6.7", - "npm-package-arg": "8.1.1", - "npm-packlist": "5.1.1", - "npm-registry-fetch": "^14.0.5", - "npmlog": "^6.0.2", - "nx": ">=16.5.1 < 17", - "p-map": "4.0.0", - "p-map-series": "2.1.0", - "p-queue": "6.6.2", - "p-reduce": "^2.1.0", - "pacote": "^15.2.0", - "pify": "5.0.0", - "read-cmd-shim": "4.0.0", - "read-package-json": "6.0.4", - "resolve-from": "5.0.0", - "rimraf": "^4.4.1", - "semver": "^7.3.4", - "signal-exit": "3.0.7", - "slash": "^3.0.0", - "ssri": "^9.0.1", - "strong-log-transformer": "2.1.0", - "tar": "6.1.11", - "temp-dir": "1.0.0", - "upath": "2.0.1", - "uuid": "^9.0.0", - "validate-npm-package-license": "^3.0.4", - "validate-npm-package-name": "5.0.0", - "write-file-atomic": "5.0.1", - "write-pkg": "4.0.0", - "yargs": "16.2.0", - "yargs-parser": "20.2.4" + "@lerna/command": "6.4.1", + "@lerna/filter-options": "6.4.1", + "@lerna/prompt": "6.4.1", + "@lerna/pulse-till-done": "6.4.1", + "@lerna/rimraf-dir": "6.4.1", + "p-map": "^4.0.0", + "p-map-series": "^2.1.0", + "p-waterfall": "^2.1.1" }, "engines": { - "node": "^14.17.0 || >=16.0.0" + "node": "^14.15.0 || >=16.0.0" } }, - "node_modules/@lerna/create/node_modules/chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "node_modules/@lerna/cli": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/cli/-/cli-6.4.1.tgz", + "integrity": "sha512-2pNa48i2wzFEd9LMPKWI3lkW/3widDqiB7oZUM1Xvm4eAOuDWc9I3RWmAUIVlPQNf3n4McxJCvsZZ9BpQN50Fg==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "@lerna/global-options": "6.4.1", + "dedent": "^0.7.0", + "npmlog": "^6.0.2", + "yargs": "^16.2.0" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/cli/node_modules/dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", + "dev": true + }, + "node_modules/@lerna/collect-uncommitted": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/collect-uncommitted/-/collect-uncommitted-6.4.1.tgz", + "integrity": "sha512-5IVQGhlLrt7Ujc5ooYA1Xlicdba/wMcDSnbQwr8ufeqnzV2z4729pLCVk55gmi6ZienH/YeBPHxhB5u34ofE0Q==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/child-process": "6.4.1", + "chalk": "^4.1.0", + "npmlog": "^6.0.2" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/collect-updates": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/collect-updates/-/collect-updates-6.4.1.tgz", + "integrity": "sha512-pzw2/FC+nIqYkknUHK9SMmvP3MsLEjxI597p3WV86cEDN3eb1dyGIGuHiKShtjvT08SKSwpTX+3bCYvLVxtC5Q==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/child-process": "6.4.1", + "@lerna/describe-ref": "6.4.1", + "minimatch": "^3.0.4", + "npmlog": "^6.0.2", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/command": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/command/-/command-6.4.1.tgz", + "integrity": "sha512-3Lifj8UTNYbRad8JMP7IFEEdlIyclWyyvq/zvNnTS9kCOEymfmsB3lGXr07/AFoi6qDrvN64j7YSbPZ6C6qonw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/child-process": "6.4.1", + "@lerna/package-graph": "6.4.1", + "@lerna/project": "6.4.1", + "@lerna/validation-error": "6.4.1", + "@lerna/write-log-file": "6.4.1", + "clone-deep": "^4.0.1", + "dedent": "^0.7.0", + "execa": "^5.0.0", + "is-ci": "^2.0.0", + "npmlog": "^6.0.2" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/command/node_modules/dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", + "dev": true + }, + "node_modules/@lerna/conventional-commits": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/conventional-commits/-/conventional-commits-6.4.1.tgz", + "integrity": "sha512-NIvCOjStjQy5O8VojB7/fVReNNDEJOmzRG2sTpgZ/vNS4AzojBQZ/tobzhm7rVkZZ43R9srZeuhfH9WgFsVUSA==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/validation-error": "6.4.1", + "conventional-changelog-angular": "^5.0.12", + "conventional-changelog-core": "^4.2.4", + "conventional-recommended-bump": "^6.1.0", + "fs-extra": "^9.1.0", + "get-stream": "^6.0.0", + "npm-package-arg": "8.1.1", + "npmlog": "^6.0.2", + "pify": "^5.0.0", + "semver": "^7.3.4" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/conventional-commits/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" }, "engines": { "node": ">=10" + } + }, + "node_modules/@lerna/create": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/create/-/create-6.4.1.tgz", + "integrity": "sha512-qfQS8PjeGDDlxEvKsI/tYixIFzV2938qLvJohEKWFn64uvdLnXCamQ0wvRJST8p1ZpHWX4AXrB+xEJM3EFABrA==", + "dev": true, + "dependencies": { + "@lerna/child-process": "6.4.1", + "@lerna/command": "6.4.1", + "@lerna/npm-conf": "6.4.1", + "@lerna/validation-error": "6.4.1", + "dedent": "^0.7.0", + "fs-extra": "^9.1.0", + "init-package-json": "^3.0.2", + "npm-package-arg": "8.1.1", + "p-reduce": "^2.1.0", + "pacote": "^13.6.1", + "pify": "^5.0.0", + "semver": "^7.3.4", + "slash": "^3.0.0", + "validate-npm-package-license": "^3.0.4", + "validate-npm-package-name": "^4.0.0", + "yargs-parser": "20.2.4" }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/create-symlink": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/create-symlink/-/create-symlink-6.4.1.tgz", + "integrity": "sha512-rNivHFYV1GAULxnaTqeGb2AdEN2OZzAiZcx5CFgj45DWXQEGwPEfpFmCSJdXhFZbyd3K0uiDlAXjAmV56ov3FQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "cmd-shim": "^5.0.0", + "fs-extra": "^9.1.0", + "npmlog": "^6.0.2" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/create-symlink/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" } }, "node_modules/@lerna/create/node_modules/dedent": { @@ -1453,60 +1578,625 @@ "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", "dev": true }, - "node_modules/@lerna/create/node_modules/execa": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz", - "integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==", + "node_modules/@lerna/create/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "dev": true, "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@lerna/describe-ref": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/describe-ref/-/describe-ref-6.4.1.tgz", + "integrity": "sha512-MXGXU8r27wl355kb1lQtAiu6gkxJ5tAisVJvFxFM1M+X8Sq56icNoaROqYrvW6y97A9+3S8Q48pD3SzkFv31Xw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/child-process": "6.4.1", + "npmlog": "^6.0.2" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/diff": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/diff/-/diff-6.4.1.tgz", + "integrity": "sha512-TnzJsRPN2fOjUrmo5Boi43fJmRtBJDsVgwZM51VnLoKcDtO1kcScXJ16Od2Xx5bXbp5dES5vGDLL/USVVWfeAg==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/child-process": "6.4.1", + "@lerna/command": "6.4.1", + "@lerna/validation-error": "6.4.1", + "npmlog": "^6.0.2" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/exec": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/exec/-/exec-6.4.1.tgz", + "integrity": "sha512-KAWfuZpoyd3FMejHUORd0GORMr45/d9OGAwHitfQPVs4brsxgQFjbbBEEGIdwsg08XhkDb4nl6IYVASVTq9+gA==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/child-process": "6.4.1", + "@lerna/command": "6.4.1", + "@lerna/filter-options": "6.4.1", + "@lerna/profiler": "6.4.1", + "@lerna/run-topologically": "6.4.1", + "@lerna/validation-error": "6.4.1", + "p-map": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/filter-options": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/filter-options/-/filter-options-6.4.1.tgz", + "integrity": "sha512-efJh3lP2T+9oyNIP2QNd9EErf0Sm3l3Tz8CILMsNJpjSU6kO43TYWQ+L/ezu2zM99KVYz8GROLqDcHRwdr8qUA==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/collect-updates": "6.4.1", + "@lerna/filter-packages": "6.4.1", + "dedent": "^0.7.0", + "npmlog": "^6.0.2" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/filter-options/node_modules/dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", + "dev": true + }, + "node_modules/@lerna/filter-packages": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/filter-packages/-/filter-packages-6.4.1.tgz", + "integrity": "sha512-LCMGDGy4b+Mrb6xkcVzp4novbf5MoZEE6ZQF1gqG0wBWqJzNcKeFiOmf352rcDnfjPGZP6ct5+xXWosX/q6qwg==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/validation-error": "6.4.1", + "multimatch": "^5.0.0", + "npmlog": "^6.0.2" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/get-npm-exec-opts": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-6.4.1.tgz", + "integrity": "sha512-IvN/jyoklrWcjssOf121tZhOc16MaFPOu5ii8a+Oy0jfTriIGv929Ya8MWodj75qec9s+JHoShB8yEcMqZce4g==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "npmlog": "^6.0.2" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/get-packed": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/get-packed/-/get-packed-6.4.1.tgz", + "integrity": "sha512-uaDtYwK1OEUVIXn84m45uPlXShtiUcw6V9TgB3rvHa3rrRVbR7D4r+JXcwVxLGrAS7LwxVbYWEEO/Z/bX7J/Lg==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "fs-extra": "^9.1.0", + "ssri": "^9.0.1", + "tar": "^6.1.0" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/get-packed/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@lerna/github-client": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/github-client/-/github-client-6.4.1.tgz", + "integrity": "sha512-ridDMuzmjMNlcDmrGrV9mxqwUKzt9iYqCPwVYJlRYrnE3jxyg+RdooquqskVFj11djcY6xCV2Q2V1lUYwF+PmA==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/child-process": "6.4.1", + "@octokit/plugin-enterprise-rest": "^6.0.1", + "@octokit/rest": "^19.0.3", + "git-url-parse": "^13.1.0", + "npmlog": "^6.0.2" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/gitlab-client": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/gitlab-client/-/gitlab-client-6.4.1.tgz", + "integrity": "sha512-AdLG4d+jbUvv0jQyygQUTNaTCNSMDxioJso6aAjQ/vkwyy3fBJ6FYzX74J4adSfOxC2MQZITFyuG+c9ggp7pyQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "node-fetch": "^2.6.1", + "npmlog": "^6.0.2" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/global-options": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/global-options/-/global-options-6.4.1.tgz", + "integrity": "sha512-UTXkt+bleBB8xPzxBPjaCN/v63yQdfssVjhgdbkQ//4kayaRA65LyEtJTi9rUrsLlIy9/rbeb+SAZUHg129fJg==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/has-npm-version": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/has-npm-version/-/has-npm-version-6.4.1.tgz", + "integrity": "sha512-vW191w5iCkwNWWWcy4542ZOpjKYjcP/pU3o3+w6NM1J3yBjWZcNa8lfzQQgde2QkGyNi+i70o6wIca1o0sdKwg==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/child-process": "6.4.1", + "semver": "^7.3.4" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/import": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/import/-/import-6.4.1.tgz", + "integrity": "sha512-oDg8g1PNrCM1JESLsG3rQBtPC+/K9e4ohs0xDKt5E6p4l7dc0Ib4oo0oCCT/hGzZUlNwHxrc2q9JMRzSAn6P/Q==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/child-process": "6.4.1", + "@lerna/command": "6.4.1", + "@lerna/prompt": "6.4.1", + "@lerna/pulse-till-done": "6.4.1", + "@lerna/validation-error": "6.4.1", + "dedent": "^0.7.0", + "fs-extra": "^9.1.0", + "p-map-series": "^2.1.0" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/import/node_modules/dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", + "dev": true + }, + "node_modules/@lerna/import/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@lerna/info": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/info/-/info-6.4.1.tgz", + "integrity": "sha512-Ks4R7IndIr4vQXz+702gumPVhH6JVkshje0WKA3+ew2qzYZf68lU1sBe1OZsQJU3eeY2c60ax+bItSa7aaIHGw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/command": "6.4.1", + "@lerna/output": "6.4.1", + "envinfo": "^7.7.4" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/init": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/init/-/init-6.4.1.tgz", + "integrity": "sha512-CXd/s/xgj0ZTAoOVyolOTLW2BG7uQOhWW4P/ktlwwJr9s3c4H/z+Gj36UXw3q5X1xdR29NZt7Vc6fvROBZMjUQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/child-process": "6.4.1", + "@lerna/command": "6.4.1", + "@lerna/project": "6.4.1", + "fs-extra": "^9.1.0", + "p-map": "^4.0.0", + "write-json-file": "^4.3.0" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/init/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@lerna/link": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/link/-/link-6.4.1.tgz", + "integrity": "sha512-O8Rt7MAZT/WT2AwrB/+HY76ktnXA9cDFO9rhyKWZGTHdplbzuJgfsGzu8Xv0Ind+w+a8xLfqtWGPlwiETnDyrw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/command": "6.4.1", + "@lerna/package-graph": "6.4.1", + "@lerna/symlink-dependencies": "6.4.1", + "@lerna/validation-error": "6.4.1", + "p-map": "^4.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/list": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/list/-/list-6.4.1.tgz", + "integrity": "sha512-7a6AKgXgC4X7nK6twVPNrKCiDhrCiAhL/FE4u9HYhHqw9yFwyq8Qe/r1RVOkAOASNZzZ8GuBvob042bpunupCw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/command": "6.4.1", + "@lerna/filter-options": "6.4.1", + "@lerna/listable": "6.4.1", + "@lerna/output": "6.4.1" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/listable": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/listable/-/listable-6.4.1.tgz", + "integrity": "sha512-L8ANeidM10aoF8aL3L/771Bb9r/TRkbEPzAiC8Iy2IBTYftS87E3rT/4k5KBEGYzMieSKJaskSFBV0OQGYV1Cw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/query-graph": "6.4.1", + "chalk": "^4.1.0", + "columnify": "^1.6.0" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/log-packed": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/log-packed/-/log-packed-6.4.1.tgz", + "integrity": "sha512-Pwv7LnIgWqZH4vkM1rWTVF+pmWJu7d0ZhVwyhCaBJUsYbo+SyB2ZETGygo3Z/A+vZ/S7ImhEEKfIxU9bg5lScQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "byte-size": "^7.0.0", + "columnify": "^1.6.0", + "has-unicode": "^2.0.1", + "npmlog": "^6.0.2" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/npm-conf": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/npm-conf/-/npm-conf-6.4.1.tgz", + "integrity": "sha512-Q+83uySGXYk3n1pYhvxtzyGwBGijYgYecgpiwRG1YNyaeGy+Mkrj19cyTWubT+rU/kM5c6If28+y9kdudvc7zQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "config-chain": "^1.1.12", + "pify": "^5.0.0" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/npm-dist-tag": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/npm-dist-tag/-/npm-dist-tag-6.4.1.tgz", + "integrity": "sha512-If1Hn4q9fn0JWuBm455iIZDWE6Fsn4Nv8Tpqb+dYf0CtoT5Hn+iT64xSiU5XJw9Vc23IR7dIujkEXm2MVbnvZw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/otplease": "6.4.1", + "npm-package-arg": "8.1.1", + "npm-registry-fetch": "^13.3.0", + "npmlog": "^6.0.2" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/npm-install": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/npm-install/-/npm-install-6.4.1.tgz", + "integrity": "sha512-7gI1txMA9qTaT3iiuk/8/vL78wIhtbbOLhMf8m5yQ2G+3t47RUA8MNgUMsq4Zszw9C83drayqesyTf0u8BzVRg==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/child-process": "6.4.1", + "@lerna/get-npm-exec-opts": "6.4.1", + "fs-extra": "^9.1.0", + "npm-package-arg": "8.1.1", + "npmlog": "^6.0.2", "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" + "write-pkg": "^4.0.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" + "node": "^14.15.0 || >=16.0.0" } }, - "node_modules/@lerna/create/node_modules/get-stream": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.0.tgz", - "integrity": "sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@lerna/create/node_modules/glob": { - "version": "9.3.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz", - "integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==", + "node_modules/@lerna/npm-install/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "minimatch": "^8.0.2", - "minipass": "^4.2.4", - "path-scurry": "^1.6.1" + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" }, "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=10" } }, - "node_modules/@lerna/create/node_modules/glob-parent": { + "node_modules/@lerna/npm-publish": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/npm-publish/-/npm-publish-6.4.1.tgz", + "integrity": "sha512-lbNEg+pThPAD8lIgNArm63agtIuCBCF3umxvgTQeLzyqUX6EtGaKJFyz/6c2ANcAuf8UfU7WQxFFbOiolibXTQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/otplease": "6.4.1", + "@lerna/run-lifecycle": "6.4.1", + "fs-extra": "^9.1.0", + "libnpmpublish": "^6.0.4", + "npm-package-arg": "8.1.1", + "npmlog": "^6.0.2", + "pify": "^5.0.0", + "read-package-json": "^5.0.1" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/npm-publish/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@lerna/npm-run-script": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/npm-run-script/-/npm-run-script-6.4.1.tgz", + "integrity": "sha512-HyvwuyhrGqDa1UbI+pPbI6v+wT6I34R0PW3WCADn6l59+AyqLOCUQQr+dMW7jdYNwjO6c/Ttbvj4W58EWsaGtQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/child-process": "6.4.1", + "@lerna/get-npm-exec-opts": "6.4.1", + "npmlog": "^6.0.2" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/otplease": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/otplease/-/otplease-6.4.1.tgz", + "integrity": "sha512-ePUciFfFdythHNMp8FP5K15R/CoGzSLVniJdD50qm76c4ATXZHnGCW2PGwoeAZCy4QTzhlhdBq78uN0wAs75GA==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/prompt": "6.4.1" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/output": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/output/-/output-6.4.1.tgz", + "integrity": "sha512-A1yRLF0bO+lhbIkrryRd6hGSD0wnyS1rTPOWJhScO/Zyv8vIPWhd2fZCLR1gI2d/Kt05qmK3T/zETTwloK7Fww==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "npmlog": "^6.0.2" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/pack-directory": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/pack-directory/-/pack-directory-6.4.1.tgz", + "integrity": "sha512-kBtDL9bPP72/Nl7Gqa2CA3Odb8CYY1EF2jt801f+B37TqRLf57UXQom7yF3PbWPCPmhoU+8Fc4RMpUwSbFC46Q==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/get-packed": "6.4.1", + "@lerna/package": "6.4.1", + "@lerna/run-lifecycle": "6.4.1", + "@lerna/temp-write": "6.4.1", + "npm-packlist": "^5.1.1", + "npmlog": "^6.0.2", + "tar": "^6.1.0" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/package": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/package/-/package-6.4.1.tgz", + "integrity": "sha512-TrOah58RnwS9R8d3+WgFFTu5lqgZs7M+e1dvcRga7oSJeKscqpEK57G0xspvF3ycjfXQwRMmEtwPmpkeEVLMzA==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "load-json-file": "^6.2.0", + "npm-package-arg": "8.1.1", + "write-pkg": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/package-graph": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/package-graph/-/package-graph-6.4.1.tgz", + "integrity": "sha512-fQvc59stRYOqxT3Mn7g/yI9/Kw5XetJoKcW5l8XeqKqcTNDURqKnN0qaNBY6lTTLOe4cR7gfXF2l1u3HOz0qEg==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/prerelease-id-from-version": "6.4.1", + "@lerna/validation-error": "6.4.1", + "npm-package-arg": "8.1.1", + "npmlog": "^6.0.2", + "semver": "^7.3.4" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/prerelease-id-from-version": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-6.4.1.tgz", + "integrity": "sha512-uGicdMFrmfHXeC0FTosnUKRgUjrBJdZwrmw7ZWMb5DAJGOuTzrvJIcz5f0/eL3XqypC/7g+9DoTgKjX3hlxPZA==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "semver": "^7.3.4" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/profiler": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/profiler/-/profiler-6.4.1.tgz", + "integrity": "sha512-dq2uQxcu0aq6eSoN+JwnvHoAnjtZAVngMvywz5bTAfzz/sSvIad1v8RCpJUMBQHxaPtbfiNvOIQgDZOmCBIM4g==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "fs-extra": "^9.1.0", + "npmlog": "^6.0.2", + "upath": "^2.0.1" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/profiler/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@lerna/project": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/project/-/project-6.4.1.tgz", + "integrity": "sha512-BPFYr4A0mNZ2jZymlcwwh7PfIC+I6r52xgGtJ4KIrIOB6mVKo9u30dgYJbUQxmSuMRTOnX7PJZttQQzSda4gEg==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/package": "6.4.1", + "@lerna/validation-error": "6.4.1", + "cosmiconfig": "^7.0.0", + "dedent": "^0.7.0", + "dot-prop": "^6.0.1", + "glob-parent": "^5.1.1", + "globby": "^11.0.2", + "js-yaml": "^4.1.0", + "load-json-file": "^6.2.0", + "npmlog": "^6.0.2", + "p-map": "^4.0.0", + "resolve-from": "^5.0.0", + "write-json-file": "^4.3.0" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/project/node_modules/dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", + "dev": true + }, + "node_modules/@lerna/project/node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", @@ -1518,40 +2208,588 @@ "node": ">= 6" } }, - "node_modules/@lerna/create/node_modules/glob/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@lerna/create/node_modules/glob/node_modules/minimatch": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.4.tgz", - "integrity": "sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@lerna/create/node_modules/is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "node_modules/@lerna/project/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, "engines": { "node": ">=8" } }, - "node_modules/@lerna/create/node_modules/make-dir": { + "node_modules/@lerna/prompt": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/prompt/-/prompt-6.4.1.tgz", + "integrity": "sha512-vMxCIgF9Vpe80PnargBGAdS/Ib58iYEcfkcXwo7mYBCxEVcaUJFKZ72FEW8rw+H5LkxBlzrBJyfKRoOe0ks9gQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "inquirer": "^8.2.4", + "npmlog": "^6.0.2" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/publish": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/publish/-/publish-6.4.1.tgz", + "integrity": "sha512-/D/AECpw2VNMa1Nh4g29ddYKRIqygEV1ftV8PYXVlHpqWN7VaKrcbRU6pn0ldgpFlMyPtESfv1zS32F5CQ944w==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/check-working-tree": "6.4.1", + "@lerna/child-process": "6.4.1", + "@lerna/collect-updates": "6.4.1", + "@lerna/command": "6.4.1", + "@lerna/describe-ref": "6.4.1", + "@lerna/log-packed": "6.4.1", + "@lerna/npm-conf": "6.4.1", + "@lerna/npm-dist-tag": "6.4.1", + "@lerna/npm-publish": "6.4.1", + "@lerna/otplease": "6.4.1", + "@lerna/output": "6.4.1", + "@lerna/pack-directory": "6.4.1", + "@lerna/prerelease-id-from-version": "6.4.1", + "@lerna/prompt": "6.4.1", + "@lerna/pulse-till-done": "6.4.1", + "@lerna/run-lifecycle": "6.4.1", + "@lerna/run-topologically": "6.4.1", + "@lerna/validation-error": "6.4.1", + "@lerna/version": "6.4.1", + "fs-extra": "^9.1.0", + "libnpmaccess": "^6.0.3", + "npm-package-arg": "8.1.1", + "npm-registry-fetch": "^13.3.0", + "npmlog": "^6.0.2", + "p-map": "^4.0.0", + "p-pipe": "^3.1.0", + "pacote": "^13.6.1", + "semver": "^7.3.4" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/publish/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@lerna/pulse-till-done": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/pulse-till-done/-/pulse-till-done-6.4.1.tgz", + "integrity": "sha512-efAkOC1UuiyqYBfrmhDBL6ufYtnpSqAG+lT4d/yk3CzJEJKkoCwh2Hb692kqHHQ5F74Uusc8tcRB7GBcfNZRWA==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "npmlog": "^6.0.2" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/query-graph": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/query-graph/-/query-graph-6.4.1.tgz", + "integrity": "sha512-gBGZLgu2x6L4d4ZYDn4+d5rxT9RNBC+biOxi0QrbaIq83I+JpHVmFSmExXK3rcTritrQ3JT9NCqb+Yu9tL9adQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/package-graph": "6.4.1" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/resolve-symlink": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/resolve-symlink/-/resolve-symlink-6.4.1.tgz", + "integrity": "sha512-gnqltcwhWVLUxCuwXWe/ch9WWTxXRI7F0ZvCtIgdfOpbosm3f1g27VO1LjXeJN2i6ks03qqMowqy4xB4uMR9IA==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "fs-extra": "^9.1.0", + "npmlog": "^6.0.2", + "read-cmd-shim": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/resolve-symlink/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@lerna/rimraf-dir": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/rimraf-dir/-/rimraf-dir-6.4.1.tgz", + "integrity": "sha512-5sDOmZmVj0iXIiEgdhCm0Prjg5q2SQQKtMd7ImimPtWKkV0IyJWxrepJFbeQoFj5xBQF7QB5jlVNEfQfKhD6pQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/child-process": "6.4.1", + "npmlog": "^6.0.2", + "path-exists": "^4.0.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/run": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/run/-/run-6.4.1.tgz", + "integrity": "sha512-HRw7kS6KNqTxqntFiFXPEeBEct08NjnL6xKbbOV6pXXf+lXUQbJlF8S7t6UYqeWgTZ4iU9caIxtZIY+EpW93mQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/command": "6.4.1", + "@lerna/filter-options": "6.4.1", + "@lerna/npm-run-script": "6.4.1", + "@lerna/output": "6.4.1", + "@lerna/profiler": "6.4.1", + "@lerna/run-topologically": "6.4.1", + "@lerna/timer": "6.4.1", + "@lerna/validation-error": "6.4.1", + "fs-extra": "^9.1.0", + "nx": ">=15.4.2 < 16", + "p-map": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/run-lifecycle": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/run-lifecycle/-/run-lifecycle-6.4.1.tgz", + "integrity": "sha512-42VopI8NC8uVCZ3YPwbTycGVBSgukJltW5Saein0m7TIqFjwSfrcP0n7QJOr+WAu9uQkk+2kBstF5WmvKiqgEA==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/npm-conf": "6.4.1", + "@npmcli/run-script": "^4.1.7", + "npmlog": "^6.0.2", + "p-queue": "^6.6.2" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/run-topologically": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/run-topologically/-/run-topologically-6.4.1.tgz", + "integrity": "sha512-gXlnAsYrjs6KIUGDnHM8M8nt30Amxq3r0lSCNAt+vEu2sMMEOh9lffGGaJobJZ4bdwoXnKay3uER/TU8E9owMw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/query-graph": "6.4.1", + "p-queue": "^6.6.2" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/run/node_modules/@nrwl/tao": { + "version": "15.9.7", + "resolved": "https://registry.npmjs.org/@nrwl/tao/-/tao-15.9.7.tgz", + "integrity": "sha512-OBnHNvQf3vBH0qh9YnvBQQWyyFZ+PWguF6dJ8+1vyQYlrLVk/XZ8nJ4ukWFb+QfPv/O8VBmqaofaOI9aFC4yTw==", + "dev": true, + "dependencies": { + "nx": "15.9.7" + }, + "bin": { + "tao": "index.js" + } + }, + "node_modules/@lerna/run/node_modules/cli-spinners": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", + "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@lerna/run/node_modules/define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@lerna/run/node_modules/fast-glob": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", + "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@lerna/run/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@lerna/run/node_modules/glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@lerna/run/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@lerna/run/node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@lerna/run/node_modules/lines-and-columns": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.4.tgz", + "integrity": "sha512-wM1+Z03eypVAVUCE7QdSqpVIvelbOakn1M0bPDoA4SGWPx3sNDVUiMo3L6To6WWGClB7VyXnhQ4Sn7gxiJbE6A==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/@lerna/run/node_modules/minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@lerna/run/node_modules/nx": { + "version": "15.9.7", + "resolved": "https://registry.npmjs.org/nx/-/nx-15.9.7.tgz", + "integrity": "sha512-1qlEeDjX9OKZEryC8i4bA+twNg+lB5RKrozlNwWx/lLJHqWPUfvUTvxh+uxlPYL9KzVReQjUuxMLFMsHNqWUrA==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@nrwl/cli": "15.9.7", + "@nrwl/tao": "15.9.7", + "@parcel/watcher": "2.0.4", + "@yarnpkg/lockfile": "^1.1.0", + "@yarnpkg/parsers": "3.0.0-rc.46", + "@zkochan/js-yaml": "0.0.6", + "axios": "^1.0.0", + "chalk": "^4.1.0", + "cli-cursor": "3.1.0", + "cli-spinners": "2.6.1", + "cliui": "^7.0.2", + "dotenv": "~10.0.0", + "enquirer": "~2.3.6", + "fast-glob": "3.2.7", + "figures": "3.2.0", + "flat": "^5.0.2", + "fs-extra": "^11.1.0", + "glob": "7.1.4", + "ignore": "^5.0.4", + "js-yaml": "4.1.0", + "jsonc-parser": "3.2.0", + "lines-and-columns": "~2.0.3", + "minimatch": "3.0.5", + "npm-run-path": "^4.0.1", + "open": "^8.4.0", + "semver": "7.5.4", + "string-width": "^4.2.3", + "strong-log-transformer": "^2.1.0", + "tar-stream": "~2.2.0", + "tmp": "~0.2.1", + "tsconfig-paths": "^4.1.2", + "tslib": "^2.3.0", + "v8-compile-cache": "2.3.0", + "yargs": "^17.6.2", + "yargs-parser": "21.1.1" + }, + "bin": { + "nx": "bin/nx.js" + }, + "optionalDependencies": { + "@nrwl/nx-darwin-arm64": "15.9.7", + "@nrwl/nx-darwin-x64": "15.9.7", + "@nrwl/nx-linux-arm-gnueabihf": "15.9.7", + "@nrwl/nx-linux-arm64-gnu": "15.9.7", + "@nrwl/nx-linux-arm64-musl": "15.9.7", + "@nrwl/nx-linux-x64-gnu": "15.9.7", + "@nrwl/nx-linux-x64-musl": "15.9.7", + "@nrwl/nx-win32-arm64-msvc": "15.9.7", + "@nrwl/nx-win32-x64-msvc": "15.9.7" + }, + "peerDependencies": { + "@swc-node/register": "^1.4.2", + "@swc/core": "^1.2.173" + }, + "peerDependenciesMeta": { + "@swc-node/register": { + "optional": true + }, + "@swc/core": { + "optional": true + } + } + }, + "node_modules/@lerna/run/node_modules/nx/node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/@lerna/run/node_modules/open": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", + "dev": true, + "dependencies": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@lerna/run/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@lerna/run/node_modules/tsconfig-paths": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", + "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", + "dev": true, + "dependencies": { + "json5": "^2.2.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@lerna/run/node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, + "node_modules/@lerna/run/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@lerna/run/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@lerna/run/node_modules/yargs/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@lerna/symlink-binary": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/symlink-binary/-/symlink-binary-6.4.1.tgz", + "integrity": "sha512-poZX90VmXRjL/JTvxaUQPeMDxFUIQvhBkHnH+dwW0RjsHB/2Tu4QUAsE0OlFnlWQGsAtXF4FTtW8Xs57E/19Kw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/create-symlink": "6.4.1", + "@lerna/package": "6.4.1", + "fs-extra": "^9.1.0", + "p-map": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/symlink-binary/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@lerna/symlink-dependencies": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/symlink-dependencies/-/symlink-dependencies-6.4.1.tgz", + "integrity": "sha512-43W2uLlpn3TTYuHVeO/2A6uiTZg6TOk/OSKi21ujD7IfVIYcRYCwCV+8LPP12R3rzyab0JWkWnhp80Z8A2Uykw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "@lerna/create-symlink": "6.4.1", + "@lerna/resolve-symlink": "6.4.1", + "@lerna/symlink-binary": "6.4.1", + "fs-extra": "^9.1.0", + "p-map": "^4.0.0", + "p-map-series": "^2.1.0" + }, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/symlink-dependencies/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@lerna/temp-write": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/temp-write/-/temp-write-6.4.1.tgz", + "integrity": "sha512-7uiGFVoTyos5xXbVQg4bG18qVEn9dFmboXCcHbMj5mc/+/QmU9QeNz/Cq36O5TY6gBbLnyj3lfL5PhzERWKMFg==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.15", + "is-stream": "^2.0.0", + "make-dir": "^3.0.0", + "temp-dir": "^1.0.0", + "uuid": "^8.3.2" + } + }, + "node_modules/@lerna/temp-write/node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", @@ -1566,7 +2804,7 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@lerna/create/node_modules/make-dir/node_modules/semver": { + "node_modules/@lerna/temp-write/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", @@ -1575,89 +2813,86 @@ "semver": "bin/semver.js" } }, - "node_modules/@lerna/create/node_modules/minimatch": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", - "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", + "node_modules/@lerna/timer": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/timer/-/timer-6.4.1.tgz", + "integrity": "sha512-ogmjFTWwRvevZr76a2sAbhmu3Ut2x73nDIn0bcwZwZ3Qc3pHD8eITdjs/wIKkHse3J7l3TO5BFJPnrvDS7HLnw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "engines": { + "node": "^14.15.0 || >=16.0.0" + } + }, + "node_modules/@lerna/validation-error": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/validation-error/-/validation-error-6.4.1.tgz", + "integrity": "sha512-fxfJvl3VgFd7eBfVMRX6Yal9omDLs2mcGKkNYeCEyt4Uwlz1B5tPAXyk/sNMfkKV2Aat/mlK5tnY13vUrMKkyA==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "npmlog": "^6.0.2" }, "engines": { - "node": "*" + "node": "^14.15.0 || >=16.0.0" } }, - "node_modules/@lerna/create/node_modules/minipass": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.8.tgz", - "integrity": "sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@lerna/create/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@lerna/create/node_modules/rimraf": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.4.1.tgz", - "integrity": "sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og==", + "node_modules/@lerna/version": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/version/-/version-6.4.1.tgz", + "integrity": "sha512-1/krPq0PtEqDXtaaZsVuKev9pXJCkNC1vOo2qCcn6PBkODw/QTAvGcUi0I+BM2c//pdxge9/gfmbDo1lC8RtAQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", "dev": true, "dependencies": { - "glob": "^9.2.0" - }, - "bin": { - "rimraf": "dist/cjs/src/bin.js" + "@lerna/check-working-tree": "6.4.1", + "@lerna/child-process": "6.4.1", + "@lerna/collect-updates": "6.4.1", + "@lerna/command": "6.4.1", + "@lerna/conventional-commits": "6.4.1", + "@lerna/github-client": "6.4.1", + "@lerna/gitlab-client": "6.4.1", + "@lerna/output": "6.4.1", + "@lerna/prerelease-id-from-version": "6.4.1", + "@lerna/prompt": "6.4.1", + "@lerna/run-lifecycle": "6.4.1", + "@lerna/run-topologically": "6.4.1", + "@lerna/temp-write": "6.4.1", + "@lerna/validation-error": "6.4.1", + "@nrwl/devkit": ">=15.4.2 < 16", + "chalk": "^4.1.0", + "dedent": "^0.7.0", + "load-json-file": "^6.2.0", + "minimatch": "^3.0.4", + "npmlog": "^6.0.2", + "p-map": "^4.0.0", + "p-pipe": "^3.1.0", + "p-reduce": "^2.1.0", + "p-waterfall": "^2.1.1", + "semver": "^7.3.4", + "slash": "^3.0.0", + "write-json-file": "^4.3.0" }, "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": "^14.15.0 || >=16.0.0" } }, - "node_modules/@lerna/create/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/@lerna/version/node_modules/dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", + "dev": true + }, + "node_modules/@lerna/write-log-file": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@lerna/write-log-file/-/write-log-file-6.4.1.tgz", + "integrity": "sha512-LE4fueQSDrQo76F4/gFXL0wnGhqdG7WHVH8D8TrKouF2Afl4NHltObCm4WsSMPjcfciVnZQFfx1ruxU4r/enHQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "npmlog": "^6.0.2", + "write-file-atomic": "^4.0.1" }, "engines": { - "node": ">=8" - } - }, - "node_modules/@lerna/create/node_modules/write-file-atomic": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", - "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@lerna/create/node_modules/write-file-atomic/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": "^14.15.0 || >=16.0.0" } }, "node_modules/@nodelib/fs.scandir": { @@ -1695,35 +2930,121 @@ "node": ">= 8" } }, - "node_modules/@npmcli/fs": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.0.tgz", - "integrity": "sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==", + "node_modules/@npmcli/arborist": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-5.3.0.tgz", + "integrity": "sha512-+rZ9zgL1lnbl8Xbb1NQdMjveOMwj4lIYfcDtyJHHi5x4X8jtR6m8SXooJMZy5vmFVZ8w7A2Bnd/oX9eTuU8w5A==", "dev": true, "dependencies": { + "@isaacs/string-locale-compare": "^1.1.0", + "@npmcli/installed-package-contents": "^1.0.7", + "@npmcli/map-workspaces": "^2.0.3", + "@npmcli/metavuln-calculator": "^3.0.1", + "@npmcli/move-file": "^2.0.0", + "@npmcli/name-from-folder": "^1.0.1", + "@npmcli/node-gyp": "^2.0.0", + "@npmcli/package-json": "^2.0.0", + "@npmcli/run-script": "^4.1.3", + "bin-links": "^3.0.0", + "cacache": "^16.0.6", + "common-ancestor-path": "^1.0.1", + "json-parse-even-better-errors": "^2.3.1", + "json-stringify-nice": "^1.1.4", + "mkdirp": "^1.0.4", + "mkdirp-infer-owner": "^2.0.0", + "nopt": "^5.0.0", + "npm-install-checks": "^5.0.0", + "npm-package-arg": "^9.0.0", + "npm-pick-manifest": "^7.0.0", + "npm-registry-fetch": "^13.0.0", + "npmlog": "^6.0.2", + "pacote": "^13.6.1", + "parse-conflict-json": "^2.0.1", + "proc-log": "^2.0.0", + "promise-all-reject-late": "^1.0.0", + "promise-call-limit": "^1.0.1", + "read-package-json-fast": "^2.0.2", + "readdir-scoped-modules": "^1.1.0", + "rimraf": "^3.0.2", + "semver": "^7.3.7", + "ssri": "^9.0.0", + "treeverse": "^2.0.0", + "walk-up-path": "^1.0.0" + }, + "bin": { + "arborist": "bin/index.js" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/@npmcli/arborist/node_modules/hosted-git-info": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", + "dev": true, + "dependencies": { + "lru-cache": "^7.5.1" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/@npmcli/arborist/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@npmcli/arborist/node_modules/npm-package-arg": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", + "dev": true, + "dependencies": { + "hosted-git-info": "^5.0.0", + "proc-log": "^2.0.1", + "semver": "^7.3.5", + "validate-npm-package-name": "^4.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/@npmcli/fs": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.2.tgz", + "integrity": "sha512-yOJKRvohFOaLqipNtwYB9WugyZKhC/DZC4VYPmpaCzDBrA8YpK3qHZ8/HGscMnE4GqbkLNuVcCnxkeQEdGt6LQ==", + "dev": true, + "dependencies": { + "@gar/promisify": "^1.1.3", "semver": "^7.3.5" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/@npmcli/git": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-4.1.0.tgz", - "integrity": "sha512-9hwoB3gStVfa0N31ymBmrX+GuDGdVA/QWShZVqE0HK2Af+7QGGrCTbZia/SW0ImUTjTne7SP91qxDmtXvDHRPQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-3.0.2.tgz", + "integrity": "sha512-CAcd08y3DWBJqJDpfuVL0uijlq5oaXaOJEKHKc4wqrjd00gkvTZB+nFuLn+doOOKddaQS9JfqtNoFCO2LCvA3w==", "dev": true, "dependencies": { - "@npmcli/promise-spawn": "^6.0.0", + "@npmcli/promise-spawn": "^3.0.0", "lru-cache": "^7.4.4", - "npm-pick-manifest": "^8.0.0", - "proc-log": "^3.0.0", + "mkdirp": "^1.0.4", + "npm-pick-manifest": "^7.0.0", + "proc-log": "^2.0.0", "promise-inflight": "^1.0.1", "promise-retry": "^2.0.1", "semver": "^7.3.5", - "which": "^3.0.0" + "which": "^2.0.2" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/@npmcli/git/node_modules/lru-cache": { @@ -1735,132 +3056,605 @@ "node": ">=12" } }, - "node_modules/@npmcli/git/node_modules/which": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", - "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/which.js" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/@npmcli/installed-package-contents": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-2.0.2.tgz", - "integrity": "sha512-xACzLPhnfD51GKvTOOuNX2/V4G4mz9/1I2MfDoye9kBM3RYe5g2YbscsaGoTlaWqkxeiapBWyseULVKpSVHtKQ==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-1.0.7.tgz", + "integrity": "sha512-9rufe0wnJusCQoLpV9ZPKIVP55itrM5BxOXs10DmdbRfgWtHy1LDyskbwRnBghuB0PrF7pNPOqREVtpz4HqzKw==", "dev": true, "dependencies": { - "npm-bundled": "^3.0.0", - "npm-normalize-package-bin": "^3.0.0" + "npm-bundled": "^1.1.1", + "npm-normalize-package-bin": "^1.0.1" }, "bin": { - "installed-package-contents": "lib/index.js" + "installed-package-contents": "index.js" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": ">= 10" } }, - "node_modules/@npmcli/installed-package-contents/node_modules/npm-bundled": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-3.0.0.tgz", - "integrity": "sha512-Vq0eyEQy+elFpzsKjMss9kxqb9tG3YHg4dsyWuUENuzvSUWe1TCnW/vV9FkhvBk/brEDoDiVd+M1Btosa6ImdQ==", + "node_modules/@npmcli/map-workspaces": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-2.0.4.tgz", + "integrity": "sha512-bMo0aAfwhVwqoVM5UzX1DJnlvVvzDCHae821jv48L1EsrYwfOZChlqWYXEtto/+BkBXetPbEWgau++/brh4oVg==", "dev": true, "dependencies": { - "npm-normalize-package-bin": "^3.0.0" + "@npmcli/name-from-folder": "^1.0.1", + "glob": "^8.0.1", + "minimatch": "^5.0.1", + "read-package-json-fast": "^2.0.3" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@npmcli/installed-package-contents/node_modules/npm-normalize-package-bin": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.1.tgz", - "integrity": "sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ==", + "node_modules/@npmcli/map-workspaces/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "dependencies": { + "balanced-match": "^1.0.0" } }, + "node_modules/@npmcli/map-workspaces/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@npmcli/map-workspaces/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@npmcli/metavuln-calculator": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-3.1.1.tgz", + "integrity": "sha512-n69ygIaqAedecLeVH3KnO39M6ZHiJ2dEv5A7DGvcqCB8q17BGUgW8QaanIkbWUo2aYGZqJaOORTLAlIvKjNDKA==", + "dev": true, + "dependencies": { + "cacache": "^16.0.0", + "json-parse-even-better-errors": "^2.3.1", + "pacote": "^13.0.3", + "semver": "^7.3.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/@npmcli/move-file": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.1.tgz", + "integrity": "sha512-mJd2Z5TjYWq/ttPLLGqArdtnC74J6bOzg4rMDnN+p1xTacZ2yPRCk2y0oSWQtygLR9YVQXgOcONrwtnk3JupxQ==", + "deprecated": "This functionality has been moved to @npmcli/fs", + "dev": true, + "dependencies": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/@npmcli/name-from-folder": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/name-from-folder/-/name-from-folder-1.0.1.tgz", + "integrity": "sha512-qq3oEfcLFwNfEYOQ8HLimRGKlD8WSeGEdtUa7hmzpR8Sa7haL1KVQrvgO6wqMjhWFFVjgtrh1gIxDz+P8sjUaA==", + "dev": true + }, "node_modules/@npmcli/node-gyp": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-3.0.0.tgz", - "integrity": "sha512-gp8pRXC2oOxu0DUE1/M3bYtb1b3/DbJ5aM113+XJBgfXdussRAsX0YOrOhdd8WvnAR6auDBvJomGAkLKA5ydxA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-2.0.0.tgz", + "integrity": "sha512-doNI35wIe3bBaEgrlPfdJPaCpUR89pJWep4Hq3aRdh6gKazIVWfs0jHttvSSoq47ZXgC7h73kDsUl8AoIQUB+A==", "dev": true, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/@npmcli/package-json": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/package-json/-/package-json-2.0.0.tgz", + "integrity": "sha512-42jnZ6yl16GzjWSH7vtrmWyJDGVa/LXPdpN2rcUWolFjc9ON2N3uz0qdBbQACfmhuJZ2lbKYtmK5qx68ZPLHMA==", + "dev": true, + "dependencies": { + "json-parse-even-better-errors": "^2.3.1" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/@npmcli/promise-spawn": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-6.0.2.tgz", - "integrity": "sha512-gGq0NJkIGSwdbUt4yhdF8ZrmkGKVz9vAdVzpOfnom+V8PLSmSOVhZwbNvZZS1EYcJN5hzzKBxmmVVAInM6HQLg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-3.0.0.tgz", + "integrity": "sha512-s9SgS+p3a9Eohe68cSI3fi+hpcZUmXq5P7w0kMlAsWVtR7XbK3ptkZqKT2cK1zLDObJ3sR+8P59sJE0w/KTL1g==", "dev": true, "dependencies": { - "which": "^3.0.0" + "infer-owner": "^1.0.4" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/promise-spawn/node_modules/which": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", - "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/which.js" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/@npmcli/run-script": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-6.0.2.tgz", - "integrity": "sha512-NCcr1uQo1k5U+SYlnIrbAh3cxy+OQT1VtqiAbxdymSlptbzBb62AjH2xXgjNCoP073hoa1CfCAcwoZ8k96C4nA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-4.2.1.tgz", + "integrity": "sha512-7dqywvVudPSrRCW5nTHpHgeWnbBtz8cFkOuKrecm6ih+oO9ciydhWt6OF7HlqupRRmB8Q/gECVdB9LMfToJbRg==", "dev": true, "dependencies": { - "@npmcli/node-gyp": "^3.0.0", - "@npmcli/promise-spawn": "^6.0.0", + "@npmcli/node-gyp": "^2.0.0", + "@npmcli/promise-spawn": "^3.0.0", "node-gyp": "^9.0.0", - "read-package-json-fast": "^3.0.0", - "which": "^3.0.0" + "read-package-json-fast": "^2.0.3", + "which": "^2.0.2" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@npmcli/run-script/node_modules/which": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", - "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", + "node_modules/@nrwl/cli": { + "version": "15.9.7", + "resolved": "https://registry.npmjs.org/@nrwl/cli/-/cli-15.9.7.tgz", + "integrity": "sha512-1jtHBDuJzA57My5nLzYiM372mJW0NY6rFKxlWt5a0RLsAZdPTHsd8lE3Gs9XinGC1jhXbruWmhhnKyYtZvX/zA==", "dev": true, "dependencies": { - "isexe": "^2.0.0" + "nx": "15.9.7" + } + }, + "node_modules/@nrwl/cli/node_modules/@nrwl/tao": { + "version": "15.9.7", + "resolved": "https://registry.npmjs.org/@nrwl/tao/-/tao-15.9.7.tgz", + "integrity": "sha512-OBnHNvQf3vBH0qh9YnvBQQWyyFZ+PWguF6dJ8+1vyQYlrLVk/XZ8nJ4ukWFb+QfPv/O8VBmqaofaOI9aFC4yTw==", + "dev": true, + "dependencies": { + "nx": "15.9.7" }, "bin": { - "node-which": "bin/which.js" + "tao": "index.js" + } + }, + "node_modules/@nrwl/cli/node_modules/cli-spinners": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", + "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@nrwl/cli/node_modules/define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@nrwl/cli/node_modules/fast-glob": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", + "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": ">=8" + } + }, + "node_modules/@nrwl/cli/node_modules/glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@nrwl/cli/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@nrwl/cli/node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@nrwl/cli/node_modules/lines-and-columns": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.4.tgz", + "integrity": "sha512-wM1+Z03eypVAVUCE7QdSqpVIvelbOakn1M0bPDoA4SGWPx3sNDVUiMo3L6To6WWGClB7VyXnhQ4Sn7gxiJbE6A==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/@nrwl/cli/node_modules/minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@nrwl/cli/node_modules/nx": { + "version": "15.9.7", + "resolved": "https://registry.npmjs.org/nx/-/nx-15.9.7.tgz", + "integrity": "sha512-1qlEeDjX9OKZEryC8i4bA+twNg+lB5RKrozlNwWx/lLJHqWPUfvUTvxh+uxlPYL9KzVReQjUuxMLFMsHNqWUrA==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@nrwl/cli": "15.9.7", + "@nrwl/tao": "15.9.7", + "@parcel/watcher": "2.0.4", + "@yarnpkg/lockfile": "^1.1.0", + "@yarnpkg/parsers": "3.0.0-rc.46", + "@zkochan/js-yaml": "0.0.6", + "axios": "^1.0.0", + "chalk": "^4.1.0", + "cli-cursor": "3.1.0", + "cli-spinners": "2.6.1", + "cliui": "^7.0.2", + "dotenv": "~10.0.0", + "enquirer": "~2.3.6", + "fast-glob": "3.2.7", + "figures": "3.2.0", + "flat": "^5.0.2", + "fs-extra": "^11.1.0", + "glob": "7.1.4", + "ignore": "^5.0.4", + "js-yaml": "4.1.0", + "jsonc-parser": "3.2.0", + "lines-and-columns": "~2.0.3", + "minimatch": "3.0.5", + "npm-run-path": "^4.0.1", + "open": "^8.4.0", + "semver": "7.5.4", + "string-width": "^4.2.3", + "strong-log-transformer": "^2.1.0", + "tar-stream": "~2.2.0", + "tmp": "~0.2.1", + "tsconfig-paths": "^4.1.2", + "tslib": "^2.3.0", + "v8-compile-cache": "2.3.0", + "yargs": "^17.6.2", + "yargs-parser": "21.1.1" + }, + "bin": { + "nx": "bin/nx.js" + }, + "optionalDependencies": { + "@nrwl/nx-darwin-arm64": "15.9.7", + "@nrwl/nx-darwin-x64": "15.9.7", + "@nrwl/nx-linux-arm-gnueabihf": "15.9.7", + "@nrwl/nx-linux-arm64-gnu": "15.9.7", + "@nrwl/nx-linux-arm64-musl": "15.9.7", + "@nrwl/nx-linux-x64-gnu": "15.9.7", + "@nrwl/nx-linux-x64-musl": "15.9.7", + "@nrwl/nx-win32-arm64-msvc": "15.9.7", + "@nrwl/nx-win32-x64-msvc": "15.9.7" + }, + "peerDependencies": { + "@swc-node/register": "^1.4.2", + "@swc/core": "^1.2.173" + }, + "peerDependenciesMeta": { + "@swc-node/register": { + "optional": true + }, + "@swc/core": { + "optional": true + } + } + }, + "node_modules/@nrwl/cli/node_modules/open": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", + "dev": true, + "dependencies": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@nrwl/cli/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@nrwl/cli/node_modules/tsconfig-paths": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", + "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", + "dev": true, + "dependencies": { + "json5": "^2.2.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@nrwl/cli/node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, + "node_modules/@nrwl/cli/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@nrwl/cli/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@nrwl/cli/node_modules/yargs/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" } }, "node_modules/@nrwl/devkit": { - "version": "16.7.4", - "resolved": "https://registry.npmjs.org/@nrwl/devkit/-/devkit-16.7.4.tgz", - "integrity": "sha512-Gt2q3cqDWzGP1woavGIo4bl8g9YaXic/Xfsl7qPq0LHJedLj49p1vXetB0wawkavSE2MTyo7yDh6YDK/38XoLw==", + "version": "15.9.7", + "resolved": "https://registry.npmjs.org/@nrwl/devkit/-/devkit-15.9.7.tgz", + "integrity": "sha512-Sb7Am2TMT8AVq8e+vxOlk3AtOA2M0qCmhBzoM1OJbdHaPKc0g0UgSnWRml1kPGg5qfPk72tWclLoZJ5/ut0vTg==", "dev": true, "dependencies": { - "@nx/devkit": "16.7.4" + "ejs": "^3.1.7", + "ignore": "^5.0.4", + "semver": "7.5.4", + "tmp": "~0.2.1", + "tslib": "^2.3.0" + }, + "peerDependencies": { + "nx": ">= 14.1 <= 16" + } + }, + "node_modules/@nrwl/devkit/node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, + "node_modules/@nrwl/nx-darwin-arm64": { + "version": "15.9.7", + "resolved": "https://registry.npmjs.org/@nrwl/nx-darwin-arm64/-/nx-darwin-arm64-15.9.7.tgz", + "integrity": "sha512-aBUgnhlkrgC0vu0fK6eb9Vob7eFnkuknrK+YzTjmLrrZwj7FGNAeyGXSlyo1dVokIzjVKjJg2saZZ0WQbfuCJw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nrwl/nx-darwin-x64": { + "version": "15.9.7", + "resolved": "https://registry.npmjs.org/@nrwl/nx-darwin-x64/-/nx-darwin-x64-15.9.7.tgz", + "integrity": "sha512-L+elVa34jhGf1cmn38Z0sotQatmLovxoASCIw5r1CBZZeJ5Tg7Y9nOwjRiDixZxNN56hPKXm6xl9EKlVHVeKlg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nrwl/nx-linux-arm-gnueabihf": { + "version": "15.9.7", + "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-arm-gnueabihf/-/nx-linux-arm-gnueabihf-15.9.7.tgz", + "integrity": "sha512-pqmfqqEUGFu6PmmHKyXyUw1Al0Ki8PSaR0+ndgCAb1qrekVDGDfznJfaqxN0JSLeolPD6+PFtLyXNr9ZyPFlFg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nrwl/nx-linux-arm64-gnu": { + "version": "15.9.7", + "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-arm64-gnu/-/nx-linux-arm64-gnu-15.9.7.tgz", + "integrity": "sha512-NYOa/eRrqmM+In5g3M0rrPVIS9Z+q6fvwXJYf/KrjOHqqan/KL+2TOfroA30UhcBrwghZvib7O++7gZ2hzwOnA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nrwl/nx-linux-arm64-musl": { + "version": "15.9.7", + "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-arm64-musl/-/nx-linux-arm64-musl-15.9.7.tgz", + "integrity": "sha512-zyStqjEcmbvLbejdTOrLUSEdhnxNtdQXlmOuymznCzYUEGRv+4f7OAepD3yRoR0a/57SSORZmmGQB7XHZoYZJA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nrwl/nx-linux-x64-gnu": { + "version": "15.9.7", + "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-x64-gnu/-/nx-linux-x64-gnu-15.9.7.tgz", + "integrity": "sha512-saNK5i2A8pKO3Il+Ejk/KStTApUpWgCxjeUz9G+T8A+QHeDloZYH2c7pU/P3jA9QoNeKwjVO9wYQllPL9loeVg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nrwl/nx-linux-x64-musl": { + "version": "15.9.7", + "resolved": "https://registry.npmjs.org/@nrwl/nx-linux-x64-musl/-/nx-linux-x64-musl-15.9.7.tgz", + "integrity": "sha512-extIUThYN94m4Vj4iZggt6hhMZWQSukBCo8pp91JHnDcryBg7SnYmnikwtY1ZAFyyRiNFBLCKNIDFGkKkSrZ9Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nrwl/nx-win32-arm64-msvc": { + "version": "15.9.7", + "resolved": "https://registry.npmjs.org/@nrwl/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-15.9.7.tgz", + "integrity": "sha512-GSQ54hJ5AAnKZb4KP4cmBnJ1oC4ILxnrG1mekxeM65c1RtWg9NpBwZ8E0gU3xNrTv8ZNsBeKi/9UhXBxhsIh8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nrwl/nx-win32-x64-msvc": { + "version": "15.9.7", + "resolved": "https://registry.npmjs.org/@nrwl/nx-win32-x64-msvc/-/nx-win32-x64-msvc-15.9.7.tgz", + "integrity": "sha512-x6URof79RPd8AlapVbPefUD3ynJZpmah3tYaYZ9xZRMXojVtEHV8Qh5vysKXQ1rNYJiiB8Ah6evSKWLbAH60tw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" } }, "node_modules/@nrwl/tao": { @@ -1882,75 +3676,6 @@ "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", "dev": true }, - "node_modules/@nx/devkit": { - "version": "16.7.4", - "resolved": "https://registry.npmjs.org/@nx/devkit/-/devkit-16.7.4.tgz", - "integrity": "sha512-SLito+/TAeDYR+d7IIpp/sBJm41WM+nIevILv0TSQW4Pq0ylUy1nUvV8Pe7l1ohZccDrQuebMUWPwGO0hv8SeQ==", - "dev": true, - "dependencies": { - "@nrwl/devkit": "16.7.4", - "ejs": "^3.1.7", - "enquirer": "~2.3.6", - "ignore": "^5.0.4", - "semver": "7.5.3", - "tmp": "~0.2.1", - "tslib": "^2.3.0" - }, - "peerDependencies": { - "nx": ">= 15 <= 17" - } - }, - "node_modules/@nx/devkit/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@nx/devkit/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@nx/devkit/node_modules/tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "dev": true, - "dependencies": { - "rimraf": "^3.0.0" - }, - "engines": { - "node": ">=8.17.0" - } - }, - "node_modules/@nx/devkit/node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true - }, - "node_modules/@nx/devkit/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/@nx/nx-darwin-arm64": { "version": "16.6.0", "resolved": "https://registry.npmjs.org/@nx/nx-darwin-arm64/-/nx-darwin-arm64-16.6.0.tgz", @@ -2167,9 +3892,9 @@ } }, "node_modules/@octokit/openapi-types": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.0.0.tgz", - "integrity": "sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw==", + "version": "18.1.1", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.1.1.tgz", + "integrity": "sha512-VRaeH8nCDtF5aXWnjPuEMIYf1itK/s3JYyJcWFJT8X9pSNnBtriDf7wlEWsGuhPLl4QIH4xM8fqTXDwJ3Mu6sw==", "dev": true }, "node_modules/@octokit/plugin-enterprise-rest": { @@ -2259,9 +3984,9 @@ } }, "node_modules/@octokit/rest": { - "version": "19.0.11", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.11.tgz", - "integrity": "sha512-m2a9VhaP5/tUw8FwfnW2ICXlXpLPIqxtg3XcAiGMLj/Xhw3RSBfZ8le/466ktO1Gcjr8oXudGnHhxV1TXJgFxw==", + "version": "19.0.13", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.13.tgz", + "integrity": "sha512-/EzVox5V9gYGdbAI+ovYj3nXQT1TtTHRT+0eZPcuC05UFSWO3mdO9UY1C0i2eLF9Un1ONJkAk+IEtYGAC+TahA==", "dev": true, "dependencies": { "@octokit/core": "^4.2.1", @@ -2306,16 +4031,6 @@ "url": "https://opencollective.com/parcel" } }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "dev": true, - "optional": true, - "engines": { - "node": ">=14" - } - }, "node_modules/@pkgr/utils": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.2.tgz", @@ -2342,40 +4057,6 @@ "integrity": "sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==", "dev": true }, - "node_modules/@sigstore/bundle": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-1.0.0.tgz", - "integrity": "sha512-yLvrWDOh6uMOUlFCTJIZEnwOT9Xte7NPXUqVexEKGSF5XtBAuSg5du0kn3dRR0p47a4ah10Y0mNt8+uyeQXrBQ==", - "dev": true, - "dependencies": { - "@sigstore/protobuf-specs": "^0.2.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@sigstore/protobuf-specs": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.2.0.tgz", - "integrity": "sha512-8ZhZKAVfXjIspDWwm3D3Kvj0ddbJ0HqDZ/pOs5cx88HpT8mVsotFrg7H1UMnXOuDHz6Zykwxn4mxG3QLuN+RUg==", - "dev": true, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@sigstore/tuf": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@sigstore/tuf/-/tuf-1.0.3.tgz", - "integrity": "sha512-2bRovzs0nJZFlCN3rXirE4gwxCn97JNjMmwpecqlbgV9WcxX7WRuIrgzx/X7Ib7MYRbyUTpBYE0s2x6AmZXnlg==", - "dev": true, - "dependencies": { - "@sigstore/protobuf-specs": "^0.2.0", - "tuf-js": "^1.1.7" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -2400,50 +4081,13 @@ "@sinonjs/commons": "^3.0.0" } }, - "node_modules/@tufjs/canonical-json": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@tufjs/canonical-json/-/canonical-json-1.0.0.tgz", - "integrity": "sha512-QTnf++uxunWvG2z3UFNzAoQPHxnSXOwtaI3iJ+AohhV+5vONuArPjJE7aPXPVXfXJsqrVbZBu9b81AJoSd09IQ==", + "node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@tufjs/models": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@tufjs/models/-/models-1.0.4.tgz", - "integrity": "sha512-qaGV9ltJP0EO25YfFUPhxRVK0evXFIAGicsVXuRim4Ed9cjPxYhNnNJ49SFmbeLgtxpslIkX317IgpfcHPVj/A==", - "dev": true, - "dependencies": { - "@tufjs/canonical-json": "1.0.0", - "minimatch": "^9.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@tufjs/models/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@tufjs/models/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">= 10" } }, "node_modules/@types/babel__core": { @@ -2549,9 +4193,9 @@ "dev": true }, "node_modules/@types/minimist": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", - "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==", "dev": true }, "node_modules/@types/node": { @@ -2561,9 +4205,15 @@ "dev": true }, "node_modules/@types/normalize-package-data": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", - "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", + "dev": true + }, + "node_modules/@types/parse-json": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.2.tgz", + "integrity": "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==", "dev": true }, "node_modules/@types/semver": { @@ -2933,13 +4583,11 @@ } }, "node_modules/agentkeepalive": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.3.0.tgz", - "integrity": "sha512-7Epl1Blf4Sy37j4v9f9FjICCh4+KAQOyXgHEwlyBiAQLbhKdq/i2QQU3amQalS/wPhdPzDXPL5DMR5bkn+YeWg==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz", + "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==", "dev": true, "dependencies": { - "debug": "^4.1.0", - "depd": "^2.0.0", "humanize-ms": "^1.2.1" }, "engines": { @@ -3222,6 +4870,12 @@ "node": ">=0.10.0" } }, + "node_modules/asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "dev": true + }, "node_modules/ast-types-flow": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", @@ -3229,9 +4883,9 @@ "dev": true }, "node_modules/async": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", - "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", + "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", "dev": true }, "node_modules/asynckit": { @@ -3240,6 +4894,15 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", @@ -3452,6 +5115,32 @@ "node": ">=0.6" } }, + "node_modules/bin-links": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-3.0.3.tgz", + "integrity": "sha512-zKdnMPWEdh4F5INR07/eBrodC7QrF5JKvqskjz/ZZRXg5YSAZIbn8zGhbhUrElzHBZ2fvEQdOU59RHcTG3GiwA==", + "dev": true, + "dependencies": { + "cmd-shim": "^5.0.0", + "mkdirp-infer-owner": "^2.0.0", + "npm-normalize-package-bin": "^2.0.0", + "read-cmd-shim": "^3.0.0", + "rimraf": "^3.0.0", + "write-file-atomic": "^4.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/bin-links/node_modules/npm-normalize-package-bin": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-2.0.0.tgz", + "integrity": "sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==", + "dev": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, "node_modules/bl": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", @@ -3581,9 +5270,9 @@ "dev": true }, "node_modules/builtins": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", - "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.1.0.tgz", + "integrity": "sha512-SW9lzGTLvWTP1AY8xeAMZimqDrIaSdLQUcVr9DMef51niJ022Ri87SwRRKYm4A6iHfkPaiVUu/Duw2Wc4J7kKg==", "dev": true, "dependencies": { "semver": "^7.0.0" @@ -3605,35 +5294,41 @@ } }, "node_modules/byte-size": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/byte-size/-/byte-size-8.1.1.tgz", - "integrity": "sha512-tUkzZWK0M/qdoLEqikxBWe4kumyuwjl3HO6zHTr4yEI23EojPtLYXdG1+AQY7MN0cGyNDvEaJ8wiYQm6P2bPxg==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/byte-size/-/byte-size-7.0.1.tgz", + "integrity": "sha512-crQdqyCwhokxwV1UyDzLZanhkugAgft7vt0qbbdt60C6Zf3CAiGmtUCylbtYwrU6loOUw3euGrNtW1J651ot1A==", "dev": true, "engines": { - "node": ">=12.17" + "node": ">=10" } }, "node_modules/cacache": { - "version": "17.1.3", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-17.1.3.tgz", - "integrity": "sha512-jAdjGxmPxZh0IipMdR7fK/4sDSrHMLUV0+GvVUsjwyGNKHsh79kW/otg+GkbXwl6Uzvy9wsvHOX4nUoWldeZMg==", + "version": "16.1.3", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.3.tgz", + "integrity": "sha512-/+Emcj9DAXxX4cwlLmRI9c166RuL3w30zp4R7Joiv2cQTtTtA+jeuCAjH3ZlGnYS3tKENSrKhAzVVP9GVyzeYQ==", "dev": true, "dependencies": { - "@npmcli/fs": "^3.1.0", - "fs-minipass": "^3.0.0", - "glob": "^10.2.2", + "@npmcli/fs": "^2.1.0", + "@npmcli/move-file": "^2.0.0", + "chownr": "^2.0.0", + "fs-minipass": "^2.1.0", + "glob": "^8.0.1", + "infer-owner": "^1.0.4", "lru-cache": "^7.7.1", - "minipass": "^5.0.0", + "minipass": "^3.1.6", "minipass-collect": "^1.0.2", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", + "mkdirp": "^1.0.4", "p-map": "^4.0.0", - "ssri": "^10.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^9.0.0", "tar": "^6.1.11", - "unique-filename": "^3.0.0" + "unique-filename": "^2.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/cacache/node_modules/brace-expansion": { @@ -3646,22 +5341,19 @@ } }, "node_modules/cacache/node_modules/glob": { - "version": "10.3.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.3.tgz", - "integrity": "sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^2.0.3", - "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", - "path-scurry": "^1.10.1" - }, - "bin": { - "glob": "dist/cjs/src/bin.js" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -3677,30 +5369,15 @@ } }, "node_modules/cacache/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/cacache/node_modules/ssri": { - "version": "10.0.4", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.4.tgz", - "integrity": "sha512-12+IR2CB2C28MMAw0Ncqwj5QbTcs0nGIhgJzYWzDkb21vWmfNI83KS4f3Ci6GI98WreIfG7o9UXp3C0qbpA8nQ==", - "dev": true, - "dependencies": { - "minipass": "^5.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": ">=10" } }, "node_modules/call-bind": { @@ -3866,9 +5543,9 @@ } }, "node_modules/cli-spinners": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.0.tgz", - "integrity": "sha512-4/aL9X3Wh0yiMQlE+eeRhWP6vclO3QRtw1JHKIT0FFUs5FjpFmESqtMvYZ0+lbzBw900b95mS0hohy+qn2VK/g==", + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", "dev": true, "engines": { "node": ">=6" @@ -3933,12 +5610,15 @@ } }, "node_modules/cmd-shim": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-6.0.1.tgz", - "integrity": "sha512-S9iI9y0nKR4hwEQsVWpyxld/6kRfGepGfzff83FcaiEBpmvlbA2nnGe7Cylgrx2f/p1P5S5wpRm9oL8z1PbS3Q==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-5.0.0.tgz", + "integrity": "sha512-qkCtZ59BidfEwHltnJwkyVZn+XQojdAySM1D1gSeh11Z4pW1Kpolkyo53L5noc0nrxmIvyFwTmJRo4xs7FFLPw==", "dev": true, + "dependencies": { + "mkdirp-infer-owner": "^2.0.0" + }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/co": { @@ -4009,6 +5689,12 @@ "node": ">= 0.8" } }, + "node_modules/common-ancestor-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/common-ancestor-path/-/common-ancestor-path-1.0.1.tgz", + "integrity": "sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==", + "dev": true + }, "node_modules/compare-func": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", @@ -4019,6 +5705,18 @@ "dot-prop": "^5.1.0" } }, + "node_modules/compare-func/node_modules/dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -4074,6 +5772,16 @@ "npm": ">=2.0.0" } }, + "node_modules/config-chain": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", + "dev": true, + "dependencies": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, "node_modules/console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", @@ -4081,119 +5789,137 @@ "dev": true }, "node_modules/conventional-changelog-angular": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-6.0.0.tgz", - "integrity": "sha512-6qLgrBF4gueoC7AFVHu51nHL9pF9FRjXrH+ceVf7WmAfH3gs+gEYOkvxhjMPjZu57I4AGUGoNTY8V7Hrgf1uqg==", + "version": "5.0.13", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.13.tgz", + "integrity": "sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA==", "dev": true, "dependencies": { - "compare-func": "^2.0.0" + "compare-func": "^2.0.0", + "q": "^1.5.1" }, "engines": { - "node": ">=14" + "node": ">=10" } }, "node_modules/conventional-changelog-core": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-5.0.1.tgz", - "integrity": "sha512-Rvi5pH+LvgsqGwZPZ3Cq/tz4ty7mjijhr3qR4m9IBXNbxGGYgTVVO+duXzz9aArmHxFtwZ+LRkrNIMDQzgoY4A==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.2.4.tgz", + "integrity": "sha512-gDVS+zVJHE2v4SLc6B0sLsPiloR0ygU7HaDW14aNJE1v4SlqJPILPl/aJC7YdtRE4CybBf8gDwObBvKha8Xlyg==", "dev": true, "dependencies": { "add-stream": "^1.0.0", - "conventional-changelog-writer": "^6.0.0", - "conventional-commits-parser": "^4.0.0", - "dateformat": "^3.0.3", - "get-pkg-repo": "^4.2.1", - "git-raw-commits": "^3.0.0", + "conventional-changelog-writer": "^5.0.0", + "conventional-commits-parser": "^3.2.0", + "dateformat": "^3.0.0", + "get-pkg-repo": "^4.0.0", + "git-raw-commits": "^2.0.8", "git-remote-origin-url": "^2.0.0", - "git-semver-tags": "^5.0.0", - "normalize-package-data": "^3.0.3", + "git-semver-tags": "^4.1.1", + "lodash": "^4.17.15", + "normalize-package-data": "^3.0.0", + "q": "^1.5.1", "read-pkg": "^3.0.0", - "read-pkg-up": "^3.0.0" + "read-pkg-up": "^3.0.0", + "through2": "^4.0.0" }, "engines": { - "node": ">=14" + "node": ">=10" } }, "node_modules/conventional-changelog-preset-loader": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-3.0.0.tgz", - "integrity": "sha512-qy9XbdSLmVnwnvzEisjxdDiLA4OmV3o8db+Zdg4WiFw14fP3B6XNz98X0swPPpkTd/pc1K7+adKgEDM1JCUMiA==", + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz", + "integrity": "sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g==", "dev": true, "engines": { - "node": ">=14" + "node": ">=10" } }, "node_modules/conventional-changelog-writer": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-6.0.1.tgz", - "integrity": "sha512-359t9aHorPw+U+nHzUXHS5ZnPBOizRxfQsWT5ZDHBfvfxQOAik+yfuhKXG66CN5LEWPpMNnIMHUTCKeYNprvHQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-5.0.1.tgz", + "integrity": "sha512-5WsuKUfxW7suLblAbFnxAcrvf6r+0b7GvNaWUwUIk0bXMnENP/PEieGKVUQrjPqwPT4o3EPAASBXiY6iHooLOQ==", "dev": true, "dependencies": { - "conventional-commits-filter": "^3.0.0", - "dateformat": "^3.0.3", + "conventional-commits-filter": "^2.0.7", + "dateformat": "^3.0.0", "handlebars": "^4.7.7", "json-stringify-safe": "^5.0.1", - "meow": "^8.1.2", - "semver": "^7.0.0", - "split": "^1.0.1" + "lodash": "^4.17.15", + "meow": "^8.0.0", + "semver": "^6.0.0", + "split": "^1.0.0", + "through2": "^4.0.0" }, "bin": { "conventional-changelog-writer": "cli.js" }, "engines": { - "node": ">=14" + "node": ">=10" + } + }, + "node_modules/conventional-changelog-writer/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" } }, "node_modules/conventional-commits-filter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-3.0.0.tgz", - "integrity": "sha512-1ymej8b5LouPx9Ox0Dw/qAO2dVdfpRFq28e5Y0jJEU8ZrLdy0vOSkkIInwmxErFGhg6SALro60ZrwYFVTUDo4Q==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz", + "integrity": "sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA==", "dev": true, "dependencies": { "lodash.ismatch": "^4.4.0", - "modify-values": "^1.0.1" + "modify-values": "^1.0.0" }, "engines": { - "node": ">=14" + "node": ">=10" } }, "node_modules/conventional-commits-parser": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-4.0.0.tgz", - "integrity": "sha512-WRv5j1FsVM5FISJkoYMR6tPk07fkKT0UodruX4je86V4owk451yjXAKzKAPOs9l7y59E2viHUS9eQ+dfUA9NSg==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.4.tgz", + "integrity": "sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q==", "dev": true, "dependencies": { "is-text-path": "^1.0.1", - "JSONStream": "^1.3.5", - "meow": "^8.1.2", - "split2": "^3.2.2" + "JSONStream": "^1.0.4", + "lodash": "^4.17.15", + "meow": "^8.0.0", + "split2": "^3.0.0", + "through2": "^4.0.0" }, "bin": { "conventional-commits-parser": "cli.js" }, "engines": { - "node": ">=14" + "node": ">=10" } }, "node_modules/conventional-recommended-bump": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-7.0.1.tgz", - "integrity": "sha512-Ft79FF4SlOFvX4PkwFDRnaNiIVX7YbmqGU0RwccUaiGvgp3S0a8ipR2/Qxk31vclDNM+GSdJOVs2KrsUCjblVA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-6.1.0.tgz", + "integrity": "sha512-uiApbSiNGM/kkdL9GTOLAqC4hbptObFo4wW2QRyHsKciGAfQuLU1ShZ1BIVI/+K2BE/W1AWYQMCXAsv4dyKPaw==", "dev": true, "dependencies": { "concat-stream": "^2.0.0", - "conventional-changelog-preset-loader": "^3.0.0", - "conventional-commits-filter": "^3.0.0", - "conventional-commits-parser": "^4.0.0", - "git-raw-commits": "^3.0.0", - "git-semver-tags": "^5.0.0", - "meow": "^8.1.2" + "conventional-changelog-preset-loader": "^2.3.4", + "conventional-commits-filter": "^2.0.7", + "conventional-commits-parser": "^3.2.0", + "git-raw-commits": "^2.0.8", + "git-semver-tags": "^4.1.1", + "meow": "^8.0.0", + "q": "^1.5.1" }, "bin": { "conventional-recommended-bump": "cli.js" }, "engines": { - "node": ">=14" + "node": ">=10" } }, "node_modules/convert-source-map": { @@ -4209,21 +5935,19 @@ "dev": true }, "node_modules/cosmiconfig": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.2.0.tgz", - "integrity": "sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", + "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", "dev": true, "dependencies": { + "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", "parse-json": "^5.0.0", - "path-type": "^4.0.0" + "path-type": "^4.0.0", + "yaml": "^1.10.0" }, "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/d-fischer" + "node": ">=10" } }, "node_modules/cross-spawn": { @@ -4297,6 +6021,16 @@ } } }, + "node_modules/debuglog": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz", + "integrity": "sha512-syBZ+rnAK3EgMsH2aYEOLUW7mZSY9Gb+0wUMCFsZvcmiz+HigA0LOcq/HoQqVuGG+EKykunc7QG2bzrponfaSw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", @@ -4559,15 +6293,6 @@ "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", "dev": true }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/deprecation": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", @@ -4584,12 +6309,12 @@ } }, "node_modules/detect-indent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", - "integrity": "sha512-rlpvsxUtM0PQvy9iZe640/IWwWYyBsTApREbA1pHOpmOUIl9MkP/U4z7vTtg4Oaojvqhxt7sdufnT0EzGaR31g==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz", + "integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/detect-newline": { @@ -4601,6 +6326,16 @@ "node": ">=8" } }, + "node_modules/dezalgo": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", + "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==", + "dev": true, + "dependencies": { + "asap": "^2.0.0", + "wrappy": "1" + } + }, "node_modules/diff-sequences": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", @@ -4635,15 +6370,18 @@ } }, "node_modules/dot-prop": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", - "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", + "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", "dev": true, "dependencies": { "is-obj": "^2.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/dotenv": { @@ -4661,12 +6399,6 @@ "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", "dev": true }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true - }, "node_modules/ejs": { "version": "3.1.9", "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.9.tgz", @@ -4760,9 +6492,9 @@ } }, "node_modules/envinfo": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", - "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "version": "7.12.0", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.12.0.tgz", + "integrity": "sha512-Iw9rQJBGpJRd3rwXm9ft/JiGoAZmLxxJZELYDQoPRZ4USVhkKtIcNBPw6U+/K2mBpaqM25JSV6Yl4Az9vO2wJg==", "dev": true, "bin": { "envinfo": "dist/cli.js" @@ -5576,6 +7308,18 @@ "node": ">=4" } }, + "node_modules/external-editor/node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -5809,34 +7553,6 @@ "is-callable": "^1.1.3" } }, - "node_modules/foreground-child": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", - "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/foreground-child/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", @@ -5858,15 +7574,15 @@ } }, "node_modules/fs-minipass": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.2.tgz", - "integrity": "sha512-2GAfyfoaCDRrM6jaOS3UsBts8yJ55VioXdWcOL7dK9zdAuKT71+WBA4ifnNYqVjYv+4SsPxjK0JT4yIIn4cA/g==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", "dev": true, "dependencies": { - "minipass": "^5.0.0" + "minipass": "^3.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": ">= 8" } }, "node_modules/fs.realpath": { @@ -6001,6 +7717,52 @@ "node": ">=6.9.0" } }, + "node_modules/get-pkg-repo/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/get-pkg-repo/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/get-pkg-repo/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/get-pkg-repo/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/get-pkg-repo/node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, "node_modules/get-port": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz", @@ -6042,20 +7804,22 @@ } }, "node_modules/git-raw-commits": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-3.0.0.tgz", - "integrity": "sha512-b5OHmZ3vAgGrDn/X0kS+9qCfNKWe4K/jFnhwzVWWg0/k5eLa3060tZShrRg8Dja5kPc+YjS0Gc6y7cRr44Lpjw==", + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.11.tgz", + "integrity": "sha512-VnctFhw+xfj8Va1xtfEqCUD2XDrbAPSJx+hSrE5K7fGdjZruW7XV+QOrN7LF/RJyvspRiD2I0asWsxFp0ya26A==", "dev": true, "dependencies": { "dargs": "^7.0.0", - "meow": "^8.1.2", - "split2": "^3.2.2" + "lodash": "^4.17.15", + "meow": "^8.0.0", + "split2": "^3.0.0", + "through2": "^4.0.0" }, "bin": { "git-raw-commits": "cli.js" }, "engines": { - "node": ">=14" + "node": ">=10" } }, "node_modules/git-remote-origin-url": { @@ -6081,19 +7845,28 @@ } }, "node_modules/git-semver-tags": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-5.0.1.tgz", - "integrity": "sha512-hIvOeZwRbQ+7YEUmCkHqo8FOLQZCEn18yevLHADlFPZY02KJGsu5FZt9YW/lybfK2uhWFI7Qg/07LekJiTv7iA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.1.1.tgz", + "integrity": "sha512-OWyMt5zBe7xFs8vglMmhM9lRQzCWL3WjHtxNNfJTMngGym7pC1kh8sP6jevfydJ6LP3ZvGxfb6ABYgPUM0mtsA==", "dev": true, "dependencies": { - "meow": "^8.1.2", - "semver": "^7.0.0" + "meow": "^8.0.0", + "semver": "^6.0.0" }, "bin": { "git-semver-tags": "cli.js" }, "engines": { - "node": ">=14" + "node": ">=10" + } + }, + "node_modules/git-semver-tags/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" } }, "node_modules/git-up": { @@ -6107,9 +7880,9 @@ } }, "node_modules/git-url-parse": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-13.1.0.tgz", - "integrity": "sha512-5FvPJP/70WkIprlUZ33bm4UAaFdjcLkJLpWft1BeZKqwR0uhhNGoKwlUaPtVb4LxCSQ++erHapRak9kWGj+FCA==", + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-13.1.1.tgz", + "integrity": "sha512-PCFJyeSSdtnbfhSNRw9Wk96dDCNx+sogTe4YNXeXSJxt7xz5hvXekuRn9JX7m+Mf4OscCu8h+mtAl3+h5Fo8lQ==", "dev": true, "dependencies": { "git-up": "^7.0.0" @@ -6231,13 +8004,13 @@ "dev": true }, "node_modules/handlebars": { - "version": "4.7.7", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", - "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", "dev": true, "dependencies": { "minimist": "^1.2.5", - "neo-async": "^2.6.0", + "neo-async": "^2.6.2", "source-map": "^0.6.1", "wordwrap": "^1.0.0" }, @@ -6389,6 +8162,20 @@ "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", "dev": true }, + "node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "dev": true, + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/https-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", @@ -6547,6 +8334,12 @@ "node": ">=8" } }, + "node_modules/infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "dev": true + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -6570,33 +8363,33 @@ "dev": true }, "node_modules/init-package-json": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-5.0.0.tgz", - "integrity": "sha512-kBhlSheBfYmq3e0L1ii+VKe3zBTLL5lDCDWR+f9dLmEGSB3MqLlMlsolubSsyI88Bg6EA+BIMlomAnQ1SwgQBw==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-3.0.2.tgz", + "integrity": "sha512-YhlQPEjNFqlGdzrBfDNRLhvoSgX7iQRgSxgsNknRQ9ITXFT7UMfVMWhBTOh2Y+25lRnGrv5Xz8yZwQ3ACR6T3A==", "dev": true, "dependencies": { - "npm-package-arg": "^10.0.0", - "promzard": "^1.0.0", - "read": "^2.0.0", - "read-package-json": "^6.0.0", + "npm-package-arg": "^9.0.1", + "promzard": "^0.3.0", + "read": "^1.0.7", + "read-package-json": "^5.0.0", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4", - "validate-npm-package-name": "^5.0.0" + "validate-npm-package-name": "^4.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/init-package-json/node_modules/hosted-git-info": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", - "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "dependencies": { "lru-cache": "^7.5.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/init-package-json/node_modules/lru-cache": { @@ -6609,24 +8402,24 @@ } }, "node_modules/init-package-json/node_modules/npm-package-arg": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz", - "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, "dependencies": { - "hosted-git-info": "^6.0.0", - "proc-log": "^3.0.0", + "hosted-git-info": "^5.0.0", + "proc-log": "^2.0.1", "semver": "^7.3.5", - "validate-npm-package-name": "^5.0.0" + "validate-npm-package-name": "^4.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/inquirer": { - "version": "8.2.5", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.5.tgz", - "integrity": "sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ==", + "version": "8.2.6", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz", + "integrity": "sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==", "dev": true, "dependencies": { "ansi-escapes": "^4.2.1", @@ -6643,12 +8436,26 @@ "string-width": "^4.1.0", "strip-ansi": "^6.0.0", "through": "^2.3.6", - "wrap-ansi": "^7.0.0" + "wrap-ansi": "^6.0.1" }, "engines": { "node": ">=12.0.0" } }, + "node_modules/inquirer/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/internal-slot": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", @@ -6663,10 +8470,23 @@ "node": ">= 0.4" } }, - "node_modules/ip": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz", - "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==", + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dev": true, + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/ip-address/node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", "dev": true }, "node_modules/is-array-buffer": { @@ -6730,17 +8550,23 @@ } }, "node_modules/is-ci": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", - "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", "dev": true, "dependencies": { - "ci-info": "^3.2.0" + "ci-info": "^2.0.0" }, "bin": { "is-ci": "bin.js" } }, + "node_modules/is-ci/node_modules/ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, "node_modules/is-core-module": { "version": "2.12.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", @@ -7033,6 +8859,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", + "dev": true + }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -7183,24 +9015,6 @@ "node": ">=8" } }, - "node_modules/jackspeak": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.2.2.tgz", - "integrity": "sha512-mgNtVv4vUuaKA97yxUHoA3+FkuhtxkjdXEWOyB/N76fjy0FjezEt34oy3epBtvCvS+7DyKwqCFWx/oJLV5+kCg==", - "dev": true, - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } - }, "node_modules/jake": { "version": "10.8.7", "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.7.tgz", @@ -7819,6 +9633,12 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "dev": true + }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -7855,6 +9675,15 @@ "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true }, + "node_modules/json-stringify-nice": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/json-stringify-nice/-/json-stringify-nice-1.1.4.tgz", + "integrity": "sha512-5Z5RFW63yxReJ7vANgW6eZFGWaQvnPE3WNmZoOJrSkGju2etKA2L5rrOa1sm877TVTFt57A80BH1bArcmlLfPw==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -7931,6 +9760,18 @@ "node": ">=4.0" } }, + "node_modules/just-diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/just-diff/-/just-diff-5.2.0.tgz", + "integrity": "sha512-6ufhP9SHjb7jibNFrNxyFZ6od3g+An6Ai9mhGRvcYe8UJlH0prseN64M+6ZBBUoKYHZsitDP42gAJ8+eVWr3lw==", + "dev": true + }, + "node_modules/just-diff-apply": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/just-diff-apply/-/just-diff-apply-5.5.0.tgz", + "integrity": "sha512-OYTthRfSh55WOItVqwpefPtNt2VdKsq5AnAK6apdtR6yCH8pr0CmSr710J0Mf+WdQy7K/OzMy7K2MgAfdQURDw==", + "dev": true + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -7965,151 +9806,110 @@ } }, "node_modules/lerna": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/lerna/-/lerna-7.2.0.tgz", - "integrity": "sha512-E13iAY4Tdo+86m4ClAe0j0bP7f8QG2neJReglILPOe+gAOoX17TGqEWanmkDELlUXOrTTwnte0ewc6I6/NOqpg==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/lerna/-/lerna-6.4.1.tgz", + "integrity": "sha512-0t8TSG4CDAn5+vORjvTFn/ZEGyc4LOEsyBUpzcdIxODHPKM4TVOGvbW9dBs1g40PhOrQfwhHS+3fSx/42j42dQ==", "dev": true, "dependencies": { - "@lerna/child-process": "7.2.0", - "@lerna/create": "7.2.0", - "@npmcli/run-script": "6.0.2", - "@nx/devkit": ">=16.5.1 < 17", - "@octokit/plugin-enterprise-rest": "6.0.1", - "@octokit/rest": "19.0.11", - "byte-size": "8.1.1", - "chalk": "4.1.0", - "clone-deep": "4.0.1", - "cmd-shim": "6.0.1", - "columnify": "1.6.0", - "conventional-changelog-angular": "6.0.0", - "conventional-changelog-core": "5.0.1", - "conventional-recommended-bump": "7.0.1", - "cosmiconfig": "^8.2.0", - "dedent": "0.7.0", - "envinfo": "7.8.1", - "execa": "5.0.0", - "fs-extra": "^11.1.1", - "get-port": "5.1.1", - "get-stream": "6.0.0", - "git-url-parse": "13.1.0", - "glob-parent": "5.1.2", - "globby": "11.1.0", - "graceful-fs": "4.2.11", - "has-unicode": "2.0.1", - "import-local": "3.1.0", - "ini": "^1.3.8", - "init-package-json": "5.0.0", + "@lerna/add": "6.4.1", + "@lerna/bootstrap": "6.4.1", + "@lerna/changed": "6.4.1", + "@lerna/clean": "6.4.1", + "@lerna/cli": "6.4.1", + "@lerna/command": "6.4.1", + "@lerna/create": "6.4.1", + "@lerna/diff": "6.4.1", + "@lerna/exec": "6.4.1", + "@lerna/filter-options": "6.4.1", + "@lerna/import": "6.4.1", + "@lerna/info": "6.4.1", + "@lerna/init": "6.4.1", + "@lerna/link": "6.4.1", + "@lerna/list": "6.4.1", + "@lerna/publish": "6.4.1", + "@lerna/run": "6.4.1", + "@lerna/validation-error": "6.4.1", + "@lerna/version": "6.4.1", + "@nrwl/devkit": ">=15.4.2 < 16", + "import-local": "^3.0.2", "inquirer": "^8.2.4", - "is-ci": "3.0.1", - "is-stream": "2.0.0", - "jest-diff": ">=29.4.3 < 30", - "js-yaml": "4.1.0", - "libnpmaccess": "7.0.2", - "libnpmpublish": "7.3.0", - "load-json-file": "6.2.0", - "lodash": "^4.17.21", - "make-dir": "3.1.0", - "minimatch": "3.0.5", - "multimatch": "5.0.0", - "node-fetch": "2.6.7", - "npm-package-arg": "8.1.1", - "npm-packlist": "5.1.1", - "npm-registry-fetch": "^14.0.5", "npmlog": "^6.0.2", - "nx": ">=16.5.1 < 17", - "p-map": "4.0.0", - "p-map-series": "2.1.0", - "p-pipe": "3.1.0", - "p-queue": "6.6.2", - "p-reduce": "2.1.0", - "p-waterfall": "2.1.1", - "pacote": "^15.2.0", - "pify": "5.0.0", - "read-cmd-shim": "4.0.0", - "read-package-json": "6.0.4", - "resolve-from": "5.0.0", - "rimraf": "^4.4.1", - "semver": "^7.3.8", - "signal-exit": "3.0.7", - "slash": "3.0.0", - "ssri": "^9.0.1", - "strong-log-transformer": "2.1.0", - "tar": "6.1.11", - "temp-dir": "1.0.0", - "typescript": ">=3 < 6", - "upath": "2.0.1", - "uuid": "^9.0.0", - "validate-npm-package-license": "3.0.4", - "validate-npm-package-name": "5.0.0", - "write-file-atomic": "5.0.1", - "write-pkg": "4.0.0", - "yargs": "16.2.0", - "yargs-parser": "20.2.4" + "nx": ">=15.4.2 < 16", + "typescript": "^3 || ^4" }, "bin": { - "lerna": "dist/cli.js" + "lerna": "cli.js" }, "engines": { - "node": "^14.17.0 || >=16.0.0" + "node": "^14.15.0 || >=16.0.0" } }, - "node_modules/lerna/node_modules/chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "node_modules/lerna/node_modules/@nrwl/tao": { + "version": "15.9.7", + "resolved": "https://registry.npmjs.org/@nrwl/tao/-/tao-15.9.7.tgz", + "integrity": "sha512-OBnHNvQf3vBH0qh9YnvBQQWyyFZ+PWguF6dJ8+1vyQYlrLVk/XZ8nJ4ukWFb+QfPv/O8VBmqaofaOI9aFC4yTw==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "nx": "15.9.7" }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "bin": { + "tao": "index.js" } }, - "node_modules/lerna/node_modules/dedent": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", - "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", - "dev": true - }, - "node_modules/lerna/node_modules/execa": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz", - "integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/lerna/node_modules/get-stream": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.0.tgz", - "integrity": "sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg==", + "node_modules/lerna/node_modules/cli-spinners": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", + "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==", "dev": true, "engines": { - "node": ">=10" + "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lerna/node_modules/define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/lerna/node_modules/fast-glob": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", + "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lerna/node_modules/glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, "node_modules/lerna/node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -8122,34 +9922,13 @@ "node": ">= 6" } }, - "node_modules/lerna/node_modules/is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "node_modules/lerna/node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/lerna/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/lerna/node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "dependencies": { - "semver": "^6.0.0" + "bin": { + "is-docker": "cli.js" }, "engines": { "node": ">=8" @@ -8158,13 +9937,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lerna/node_modules/make-dir/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "node_modules/lerna/node_modules/lines-and-columns": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.4.tgz", + "integrity": "sha512-wM1+Z03eypVAVUCE7QdSqpVIvelbOakn1M0bPDoA4SGWPx3sNDVUiMo3L6To6WWGClB7VyXnhQ4Sn7gxiJbE6A==", "dev": true, - "bin": { - "semver": "bin/semver.js" + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/lerna/node_modules/minimatch": { @@ -8179,142 +9958,176 @@ "node": "*" } }, - "node_modules/lerna/node_modules/minipass": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.8.tgz", - "integrity": "sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/lerna/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/lerna/node_modules/rimraf": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.4.1.tgz", - "integrity": "sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og==", + "node_modules/lerna/node_modules/nx": { + "version": "15.9.7", + "resolved": "https://registry.npmjs.org/nx/-/nx-15.9.7.tgz", + "integrity": "sha512-1qlEeDjX9OKZEryC8i4bA+twNg+lB5RKrozlNwWx/lLJHqWPUfvUTvxh+uxlPYL9KzVReQjUuxMLFMsHNqWUrA==", "dev": true, + "hasInstallScript": true, "dependencies": { - "glob": "^9.2.0" + "@nrwl/cli": "15.9.7", + "@nrwl/tao": "15.9.7", + "@parcel/watcher": "2.0.4", + "@yarnpkg/lockfile": "^1.1.0", + "@yarnpkg/parsers": "3.0.0-rc.46", + "@zkochan/js-yaml": "0.0.6", + "axios": "^1.0.0", + "chalk": "^4.1.0", + "cli-cursor": "3.1.0", + "cli-spinners": "2.6.1", + "cliui": "^7.0.2", + "dotenv": "~10.0.0", + "enquirer": "~2.3.6", + "fast-glob": "3.2.7", + "figures": "3.2.0", + "flat": "^5.0.2", + "fs-extra": "^11.1.0", + "glob": "7.1.4", + "ignore": "^5.0.4", + "js-yaml": "4.1.0", + "jsonc-parser": "3.2.0", + "lines-and-columns": "~2.0.3", + "minimatch": "3.0.5", + "npm-run-path": "^4.0.1", + "open": "^8.4.0", + "semver": "7.5.4", + "string-width": "^4.2.3", + "strong-log-transformer": "^2.1.0", + "tar-stream": "~2.2.0", + "tmp": "~0.2.1", + "tsconfig-paths": "^4.1.2", + "tslib": "^2.3.0", + "v8-compile-cache": "2.3.0", + "yargs": "^17.6.2", + "yargs-parser": "21.1.1" }, "bin": { - "rimraf": "dist/cjs/src/bin.js" + "nx": "bin/nx.js" + }, + "optionalDependencies": { + "@nrwl/nx-darwin-arm64": "15.9.7", + "@nrwl/nx-darwin-x64": "15.9.7", + "@nrwl/nx-linux-arm-gnueabihf": "15.9.7", + "@nrwl/nx-linux-arm64-gnu": "15.9.7", + "@nrwl/nx-linux-arm64-musl": "15.9.7", + "@nrwl/nx-linux-x64-gnu": "15.9.7", + "@nrwl/nx-linux-x64-musl": "15.9.7", + "@nrwl/nx-win32-arm64-msvc": "15.9.7", + "@nrwl/nx-win32-x64-msvc": "15.9.7" + }, + "peerDependencies": { + "@swc-node/register": "^1.4.2", + "@swc/core": "^1.2.173" + }, + "peerDependenciesMeta": { + "@swc-node/register": { + "optional": true + }, + "@swc/core": { + "optional": true + } + } + }, + "node_modules/lerna/node_modules/open": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", + "dev": true, + "dependencies": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" }, "engines": { - "node": ">=14" + "node": ">=12" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lerna/node_modules/rimraf/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/lerna/node_modules/rimraf/node_modules/glob": { - "version": "9.3.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz", - "integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "minimatch": "^8.0.2", - "minipass": "^4.2.4", - "path-scurry": "^1.6.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/lerna/node_modules/rimraf/node_modules/minimatch": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.4.tgz", - "integrity": "sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/lerna/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/lerna/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/lerna/node_modules/write-file-atomic": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", - "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/lerna/node_modules/write-file-atomic/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "node_modules/lerna/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=4" } }, - "node_modules/lerna/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "node_modules/lerna/node_modules/tsconfig-paths": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", + "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", + "dev": true, + "dependencies": { + "json5": "^2.2.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/lerna/node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", "dev": true }, + "node_modules/lerna/node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/lerna/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/lerna/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/lerna/node_modules/yargs/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -8338,28 +10151,30 @@ } }, "node_modules/libnpmaccess": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/libnpmaccess/-/libnpmaccess-7.0.2.tgz", - "integrity": "sha512-vHBVMw1JFMTgEk15zRsJuSAg7QtGGHpUSEfnbcRL1/gTBag9iEfJbyjpDmdJmwMhvpoLoNBtdAUCdGnaP32hhw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/libnpmaccess/-/libnpmaccess-6.0.4.tgz", + "integrity": "sha512-qZ3wcfIyUoW0+qSFkMBovcTrSGJ3ZeyvpR7d5N9pEYv/kXs8sHP2wiqEIXBKLFrZlmM0kR0RJD7mtfLngtlLag==", "dev": true, "dependencies": { - "npm-package-arg": "^10.1.0", - "npm-registry-fetch": "^14.0.3" + "aproba": "^2.0.0", + "minipass": "^3.1.1", + "npm-package-arg": "^9.0.1", + "npm-registry-fetch": "^13.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/libnpmaccess/node_modules/hosted-git-info": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", - "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "dependencies": { "lru-cache": "^7.5.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/libnpmaccess/node_modules/lru-cache": { @@ -8372,49 +10187,46 @@ } }, "node_modules/libnpmaccess/node_modules/npm-package-arg": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz", - "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, "dependencies": { - "hosted-git-info": "^6.0.0", - "proc-log": "^3.0.0", + "hosted-git-info": "^5.0.0", + "proc-log": "^2.0.1", "semver": "^7.3.5", - "validate-npm-package-name": "^5.0.0" + "validate-npm-package-name": "^4.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/libnpmpublish": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/libnpmpublish/-/libnpmpublish-7.3.0.tgz", - "integrity": "sha512-fHUxw5VJhZCNSls0KLNEG0mCD2PN1i14gH5elGOgiVnU3VgTcRahagYP2LKI1m0tFCJ+XrAm0zVYyF5RCbXzcg==", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/libnpmpublish/-/libnpmpublish-6.0.5.tgz", + "integrity": "sha512-LUR08JKSviZiqrYTDfywvtnsnxr+tOvBU0BF8H+9frt7HMvc6Qn6F8Ubm72g5hDTHbq8qupKfDvDAln2TVPvFg==", "dev": true, "dependencies": { - "ci-info": "^3.6.1", - "normalize-package-data": "^5.0.0", - "npm-package-arg": "^10.1.0", - "npm-registry-fetch": "^14.0.3", - "proc-log": "^3.0.0", + "normalize-package-data": "^4.0.0", + "npm-package-arg": "^9.0.1", + "npm-registry-fetch": "^13.0.0", "semver": "^7.3.7", - "sigstore": "^1.4.0", - "ssri": "^10.0.1" + "ssri": "^9.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/libnpmpublish/node_modules/hosted-git-info": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", - "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "dependencies": { "lru-cache": "^7.5.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/libnpmpublish/node_modules/lru-cache": { @@ -8427,45 +10239,33 @@ } }, "node_modules/libnpmpublish/node_modules/normalize-package-data": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-5.0.0.tgz", - "integrity": "sha512-h9iPVIfrVZ9wVYQnxFgtw1ugSvGEMOlyPWWtm8BMJhnwyEL/FLbYbTY3V3PpjI/BUK67n9PEWDu6eHzu1fB15Q==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-4.0.1.tgz", + "integrity": "sha512-EBk5QKKuocMJhB3BILuKhmaPjI8vNRSpIfO9woLC6NyHVkKKdVEdAO1mrT0ZfxNR1lKwCcTkuZfmGIFdizZ8Pg==", "dev": true, "dependencies": { - "hosted-git-info": "^6.0.0", + "hosted-git-info": "^5.0.0", "is-core-module": "^2.8.1", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/libnpmpublish/node_modules/npm-package-arg": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz", - "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, "dependencies": { - "hosted-git-info": "^6.0.0", - "proc-log": "^3.0.0", + "hosted-git-info": "^5.0.0", + "proc-log": "^2.0.1", "semver": "^7.3.5", - "validate-npm-package-name": "^5.0.0" + "validate-npm-package-name": "^4.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/libnpmpublish/node_modules/ssri": { - "version": "10.0.4", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.4.tgz", - "integrity": "sha512-12+IR2CB2C28MMAw0Ncqwj5QbTcs0nGIhgJzYWzDkb21vWmfNI83KS4f3Ci6GI98WreIfG7o9UXp3C0qbpA8nQ==", - "dev": true, - "dependencies": { - "minipass": "^5.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/lines-and-columns": { @@ -8608,52 +10408,30 @@ "dev": true }, "node_modules/make-fetch-happen": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.1.1.tgz", - "integrity": "sha512-rLWS7GCSTcEujjVBs2YqG7Y4643u8ucvCJeSRqiLYhesrDuzeuFIk37xREzAsfQaqzl8b9rNCE4m6J8tvX4Q8w==", + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.2.1.tgz", + "integrity": "sha512-NgOPbRiaQM10DYXvN3/hhGVI2M5MtITFryzBGxHM5p4wnFxsVCbxkrBrDsk+EZ5OB4jEOT7AjDxtdF+KVEFT7w==", "dev": true, "dependencies": { "agentkeepalive": "^4.2.1", - "cacache": "^17.0.0", - "http-cache-semantics": "^4.1.1", + "cacache": "^16.1.0", + "http-cache-semantics": "^4.1.0", "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", "lru-cache": "^7.7.1", - "minipass": "^5.0.0", - "minipass-fetch": "^3.0.0", + "minipass": "^3.1.6", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^2.0.3", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", "negotiator": "^0.6.3", "promise-retry": "^2.0.1", "socks-proxy-agent": "^7.0.0", - "ssri": "^10.0.0" + "ssri": "^9.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/make-fetch-happen/node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", - "dev": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/make-fetch-happen/node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", - "dev": true, - "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/make-fetch-happen/node_modules/lru-cache": { @@ -8665,18 +10443,6 @@ "node": ">=12" } }, - "node_modules/make-fetch-happen/node_modules/ssri": { - "version": "10.0.4", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.4.tgz", - "integrity": "sha512-12+IR2CB2C28MMAw0Ncqwj5QbTcs0nGIhgJzYWzDkb21vWmfNI83KS4f3Ci6GI98WreIfG7o9UXp3C0qbpA8nQ==", - "dev": true, - "dependencies": { - "minipass": "^5.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/makeerror": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", @@ -8967,10 +10733,13 @@ } }, "node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, "engines": { "node": ">=8" } @@ -8987,36 +10756,18 @@ "node": ">= 8" } }, - "node_modules/minipass-collect/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass-collect/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/minipass-fetch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.3.tgz", - "integrity": "sha512-n5ITsTkDqYkYJZjcRWzZt9qnZKCT7nKCosJhHoj7S7zD+BP4jVbWs+odsniw5TA3E0sLomhTKOKjF86wf11PuQ==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.2.tgz", + "integrity": "sha512-LT49Zi2/WMROHYoqGgdlQIZh8mLPZmOrN2NdJjMXxYe4nkN6FUyuPuOAOedNJDrx0IRGg9+4guZewtp8hE6TxA==", "dev": true, "dependencies": { - "minipass": "^5.0.0", + "minipass": "^3.1.6", "minipass-sized": "^1.0.3", "minizlib": "^2.1.2" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "optionalDependencies": { "encoding": "^0.1.13" @@ -9034,24 +10785,6 @@ "node": ">= 8" } }, - "node_modules/minipass-flush/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass-flush/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/minipass-json-stream": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minipass-json-stream/-/minipass-json-stream-1.0.1.tgz", @@ -9062,24 +10795,6 @@ "minipass": "^3.0.0" } }, - "node_modules/minipass-json-stream/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass-json-stream/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/minipass-pipeline": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", @@ -9092,24 +10807,6 @@ "node": ">=8" } }, - "node_modules/minipass-pipeline/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass-pipeline/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/minipass-sized": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", @@ -9122,19 +10819,7 @@ "node": ">=8" } }, - "node_modules/minipass-sized/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass-sized/node_modules/yallist": { + "node_modules/minipass/node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", @@ -9153,18 +10838,6 @@ "node": ">= 8" } }, - "node_modules/minizlib/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/minizlib/node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", @@ -9183,6 +10856,20 @@ "node": ">=10" } }, + "node_modules/mkdirp-infer-owner": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mkdirp-infer-owner/-/mkdirp-infer-owner-2.0.0.tgz", + "integrity": "sha512-sdqtiFt3lkOaYvTXSRIUjkIdPTcxgv5+fgqYE/5qgwdw12cOrAuzzgzvVExIkH/ul1oeHN3bCLOWSG3XOqbKKw==", + "dev": true, + "dependencies": { + "chownr": "^2.0.0", + "infer-owner": "^1.0.4", + "mkdirp": "^1.0.3" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/modify-values": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", @@ -9266,9 +10953,9 @@ "dev": true }, "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dev": true, "dependencies": { "whatwg-url": "^5.0.0" @@ -9285,39 +10972,17 @@ } } }, - "node_modules/node-fetch/node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true - }, - "node_modules/node-fetch/node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "dev": true - }, - "node_modules/node-fetch/node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dev": true, - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/node-gyp": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.4.0.tgz", - "integrity": "sha512-dMXsYP6gc9rRbejLXmTbVRYjAHw7ppswsKyMxuxJxxOHzluIO1rGp9TOQgjFJ+2MCqcOcQTOPB/8Xwhr+7s4Eg==", + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.4.1.tgz", + "integrity": "sha512-OQkWKbjQKbGkMf/xqI1jjy3oCTgMKJac58G2+bjZb3fza6gW2YrCSdMQYaoTb70crvE//Gngr4f0AgVHmqHvBQ==", "dev": true, "dependencies": { "env-paths": "^2.2.0", "exponential-backoff": "^3.1.1", "glob": "^7.1.4", "graceful-fs": "^4.2.6", - "make-fetch-happen": "^11.0.3", + "make-fetch-happen": "^10.0.3", "nopt": "^6.0.0", "npmlog": "^6.0.0", "rimraf": "^3.0.2", @@ -9343,6 +11008,21 @@ "node-gyp-build-test": "build-test.js" } }, + "node_modules/node-gyp/node_modules/nopt": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-6.0.0.tgz", + "integrity": "sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==", + "dev": true, + "dependencies": { + "abbrev": "^1.0.0" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -9362,18 +11042,18 @@ "dev": true }, "node_modules/nopt": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-6.0.0.tgz", - "integrity": "sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", "dev": true, "dependencies": { - "abbrev": "^1.0.0" + "abbrev": "1" }, "bin": { "nopt": "bin/nopt.js" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=6" } }, "node_modules/normalize-package-data": { @@ -9410,15 +11090,15 @@ } }, "node_modules/npm-install-checks": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-6.2.0.tgz", - "integrity": "sha512-744wat5wAAHsxa4590mWO0tJ8PKxR8ORZsH9wGpQc3nWTzozMAgBN/XyqYw7mg3yqLM8dLwEnwSfKMmXAjF69g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-5.0.0.tgz", + "integrity": "sha512-65lUsMI8ztHCxFz5ckCEC44DRvEGdZX5usQFriauxHEwt7upv1FKaQEmAtU0YnOAdwuNWCmk64xYiQABNrEyLA==", "dev": true, "dependencies": { "semver": "^7.1.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm-normalize-package-bin": { @@ -9487,15 +11167,15 @@ "dev": true }, "node_modules/npm-packlist": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.1.1.tgz", - "integrity": "sha512-UfpSvQ5YKwctmodvPPkK6Fwk603aoVsf8AEbmVKAEECrfvL8SSe1A2YIwrJ6xmTHAITKPwwZsWo7WwEbNk0kxw==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.1.3.tgz", + "integrity": "sha512-263/0NGrn32YFYi4J533qzrQ/krmmrWwhKkzwTuM4f/07ug51odoaNjUexxO4vxlzURHcmYMH1QjvHjsNDKLVg==", "dev": true, "dependencies": { "glob": "^8.0.1", "ignore-walk": "^5.0.1", - "npm-bundled": "^1.1.2", - "npm-normalize-package-bin": "^1.0.1" + "npm-bundled": "^2.0.0", + "npm-normalize-package-bin": "^2.0.0" }, "bin": { "npm-packlist": "bin/index.js" @@ -9544,31 +11224,52 @@ "node": ">=10" } }, - "node_modules/npm-pick-manifest": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-8.0.2.tgz", - "integrity": "sha512-1dKY+86/AIiq1tkKVD3l0WI+Gd3vkknVGAggsFeBkTvbhMQ1OND/LKkYv4JtXPKUJ8bOTCyLiqEg2P6QNdK+Gg==", + "node_modules/npm-packlist/node_modules/npm-bundled": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-2.0.1.tgz", + "integrity": "sha512-gZLxXdjEzE/+mOstGDqR6b0EkhJ+kM6fxM6vUuckuctuVPh80Q6pw/rSZj9s4Gex9GxWtIicO1pc8DB9KZWudw==", "dev": true, "dependencies": { - "npm-install-checks": "^6.0.0", - "npm-normalize-package-bin": "^3.0.0", - "npm-package-arg": "^10.0.0", + "npm-normalize-package-bin": "^2.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/npm-packlist/node_modules/npm-normalize-package-bin": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-2.0.0.tgz", + "integrity": "sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==", + "dev": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/npm-pick-manifest": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-7.0.2.tgz", + "integrity": "sha512-gk37SyRmlIjvTfcYl6RzDbSmS9Y4TOBXfsPnoYqTHARNgWbyDiCSMLUpmALDj4jjcTZpURiEfsSHJj9k7EV4Rw==", + "dev": true, + "dependencies": { + "npm-install-checks": "^5.0.0", + "npm-normalize-package-bin": "^2.0.0", + "npm-package-arg": "^9.0.0", "semver": "^7.3.5" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm-pick-manifest/node_modules/hosted-git-info": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", - "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "dependencies": { "lru-cache": "^7.5.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm-pick-manifest/node_modules/lru-cache": { @@ -9581,57 +11282,57 @@ } }, "node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.1.tgz", - "integrity": "sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-2.0.0.tgz", + "integrity": "sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==", "dev": true, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm-pick-manifest/node_modules/npm-package-arg": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz", - "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, "dependencies": { - "hosted-git-info": "^6.0.0", - "proc-log": "^3.0.0", + "hosted-git-info": "^5.0.0", + "proc-log": "^2.0.1", "semver": "^7.3.5", - "validate-npm-package-name": "^5.0.0" + "validate-npm-package-name": "^4.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm-registry-fetch": { - "version": "14.0.5", - "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-14.0.5.tgz", - "integrity": "sha512-kIDMIo4aBm6xg7jOttupWZamsZRkAqMqwqqbVXnUqstY5+tapvv6bkH/qMR76jdgV+YljEUCyWx3hRYMrJiAgA==", + "version": "13.3.1", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-13.3.1.tgz", + "integrity": "sha512-eukJPi++DKRTjSBRcDZSDDsGqRK3ehbxfFUcgaRd0Yp6kRwOwh2WVn0r+8rMB4nnuzvAk6rQVzl6K5CkYOmnvw==", "dev": true, "dependencies": { - "make-fetch-happen": "^11.0.0", - "minipass": "^5.0.0", - "minipass-fetch": "^3.0.0", + "make-fetch-happen": "^10.0.6", + "minipass": "^3.1.6", + "minipass-fetch": "^2.0.3", "minipass-json-stream": "^1.0.1", "minizlib": "^2.1.2", - "npm-package-arg": "^10.0.0", - "proc-log": "^3.0.0" + "npm-package-arg": "^9.0.1", + "proc-log": "^2.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm-registry-fetch/node_modules/hosted-git-info": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", - "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "dependencies": { "lru-cache": "^7.5.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm-registry-fetch/node_modules/lru-cache": { @@ -9644,18 +11345,18 @@ } }, "node_modules/npm-registry-fetch/node_modules/npm-package-arg": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz", - "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, "dependencies": { - "hosted-git-info": "^6.0.0", - "proc-log": "^3.0.0", + "hosted-git-info": "^5.0.0", + "proc-log": "^2.0.1", "semver": "^7.3.5", - "validate-npm-package-name": "^5.0.0" + "validate-npm-package-name": "^4.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm-run-path": { @@ -9911,18 +11612,6 @@ "node": ">=4" } }, - "node_modules/nx/node_modules/tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "dev": true, - "dependencies": { - "rimraf": "^3.0.0" - }, - "engines": { - "node": ">=8.17.0" - } - }, "node_modules/nx/node_modules/tsconfig-paths": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", @@ -10314,68 +12003,50 @@ } }, "node_modules/pacote": { - "version": "15.2.0", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-15.2.0.tgz", - "integrity": "sha512-rJVZeIwHTUta23sIZgEIM62WYwbmGbThdbnkt81ravBplQv+HjyroqnLRNH2+sLJHcGZmLRmhPwACqhfTcOmnA==", + "version": "13.6.2", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.6.2.tgz", + "integrity": "sha512-Gu8fU3GsvOPkak2CkbojR7vjs3k3P9cA6uazKTHdsdV0gpCEQq2opelnEv30KRQWgVzP5Vd/5umjcedma3MKtg==", "dev": true, "dependencies": { - "@npmcli/git": "^4.0.0", - "@npmcli/installed-package-contents": "^2.0.1", - "@npmcli/promise-spawn": "^6.0.1", - "@npmcli/run-script": "^6.0.0", - "cacache": "^17.0.0", - "fs-minipass": "^3.0.0", - "minipass": "^5.0.0", - "npm-package-arg": "^10.0.0", - "npm-packlist": "^7.0.0", - "npm-pick-manifest": "^8.0.0", - "npm-registry-fetch": "^14.0.0", - "proc-log": "^3.0.0", + "@npmcli/git": "^3.0.0", + "@npmcli/installed-package-contents": "^1.0.7", + "@npmcli/promise-spawn": "^3.0.0", + "@npmcli/run-script": "^4.1.0", + "cacache": "^16.0.0", + "chownr": "^2.0.0", + "fs-minipass": "^2.1.0", + "infer-owner": "^1.0.4", + "minipass": "^3.1.6", + "mkdirp": "^1.0.4", + "npm-package-arg": "^9.0.0", + "npm-packlist": "^5.1.0", + "npm-pick-manifest": "^7.0.0", + "npm-registry-fetch": "^13.0.1", + "proc-log": "^2.0.0", "promise-retry": "^2.0.1", - "read-package-json": "^6.0.0", - "read-package-json-fast": "^3.0.0", - "sigstore": "^1.3.0", - "ssri": "^10.0.0", + "read-package-json": "^5.0.0", + "read-package-json-fast": "^2.0.3", + "rimraf": "^3.0.2", + "ssri": "^9.0.0", "tar": "^6.1.11" }, "bin": { "pacote": "lib/bin.js" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/pacote/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/pacote/node_modules/hosted-git-info": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", - "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "dependencies": { "lru-cache": "^7.5.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/pacote/node_modules/ignore-walk": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-6.0.3.tgz", - "integrity": "sha512-C7FfFoTA+bI10qfeydT8aZbvr91vAEU+2W5BZUlzPec47oNb07SsOfwYrtxuvOYdUApPP/Qlh4DtAO51Ekk2QA==", - "dev": true, - "dependencies": { - "minimatch": "^9.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/pacote/node_modules/lru-cache": { @@ -10387,67 +12058,19 @@ "node": ">=12" } }, - "node_modules/pacote/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/pacote/node_modules/npm-package-arg": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz", - "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.1.2.tgz", + "integrity": "sha512-pzd9rLEx4TfNJkovvlBSLGhq31gGu2QDexFPWT19yCDh0JgnRhlBLNo5759N0AJmBk+kQ9Y/hXoLnlgFD+ukmg==", "dev": true, "dependencies": { - "hosted-git-info": "^6.0.0", - "proc-log": "^3.0.0", + "hosted-git-info": "^5.0.0", + "proc-log": "^2.0.1", "semver": "^7.3.5", - "validate-npm-package-name": "^5.0.0" + "validate-npm-package-name": "^4.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/pacote/node_modules/npm-packlist": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-7.0.4.tgz", - "integrity": "sha512-d6RGEuRrNS5/N84iglPivjaJPxhDbZmlbTwTDX2IbcRHG5bZCdtysYMhwiPvcF4GisXHGn7xsxv+GQ7T/02M5Q==", - "dev": true, - "dependencies": { - "ignore-walk": "^6.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/pacote/node_modules/ssri": { - "version": "10.0.5", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.5.tgz", - "integrity": "sha512-bSf16tAFkGeRlUNDjXu8FzaMQt6g2HZJrun7mtMbIPOddxt3GLMSz5VWUWcqTJUPfLEaDIepGxv+bYQW49596A==", - "dev": true, - "dependencies": { - "minipass": "^7.0.3" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/pacote/node_modules/ssri/node_modules/minipass": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.3.tgz", - "integrity": "sha512-LhbbwCfz3vsb12j/WkWQPZfKTsgqIe1Nf/ti1pKjYESGLHIVjWU96G9/ljLH4F9mWNVhlQOm0VySdAWzf05dpg==", - "dev": true, - "engines": { - "node": ">=16 || 14 >=14.17" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/parent-module": { @@ -10462,6 +12085,20 @@ "node": ">=6" } }, + "node_modules/parse-conflict-json": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/parse-conflict-json/-/parse-conflict-json-2.0.2.tgz", + "integrity": "sha512-jDbRGb00TAPFsKWCpZZOT93SxVP9nONOSgES3AevqRq/CHvavEBvKAjxX9p5Y5F0RZLxH9Ufd9+RwtCsa+lFDA==", + "dev": true, + "dependencies": { + "json-parse-even-better-errors": "^2.3.1", + "just-diff": "^5.0.1", + "just-diff-apply": "^5.2.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -10531,31 +12168,6 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, - "node_modules/path-scurry": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", - "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", - "dev": true, - "dependencies": { - "lru-cache": "^9.1.1 || ^10.0.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.0.tgz", - "integrity": "sha512-svTf/fzsKHffP42sujkO/Rjs37BCIsQVRCeNYIm9WN8rgT7ffoUnRtZCqU+6BqcSBdv8gwJeTz8knJpgACeQMw==", - "dev": true, - "engines": { - "node": "14 || >=16.14" - } - }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -10731,12 +12343,12 @@ } }, "node_modules/proc-log": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-3.0.0.tgz", - "integrity": "sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-2.0.1.tgz", + "integrity": "sha512-Kcmo2FhfDTXdcbfDH76N7uBYHINxc/8GW7UAVuVP9I+Va3uHSerrnKV6dLooga/gh7GlgzuCCr/eoldnL1muGw==", "dev": true, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/process-nextick-args": { @@ -10745,6 +12357,24 @@ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, + "node_modules/promise-all-reject-late": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-all-reject-late/-/promise-all-reject-late-1.0.1.tgz", + "integrity": "sha512-vuf0Lf0lOxyQREH7GDIOUMLS7kz+gs8i6B+Yi8dC68a2sychGrHTJYghMBD6k7eUcH0H5P73EckCA48xijWqXw==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/promise-call-limit": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/promise-call-limit/-/promise-call-limit-1.0.2.tgz", + "integrity": "sha512-1vTUnfI2hzui8AEIixbdAJlFY4LFDXqQswy/2eOlThAscXCY4It8FdVuI0fMJGAB2aWGbdQf/gv0skKYXmdrHA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/promise-inflight": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", @@ -10778,17 +12408,20 @@ } }, "node_modules/promzard": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/promzard/-/promzard-1.0.0.tgz", - "integrity": "sha512-KQVDEubSUHGSt5xLakaToDFrSoZhStB8dXLzk2xvwR67gJktrHFvpR63oZgHyK19WKbHFLXJqCPXdVR3aBP8Ig==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz", + "integrity": "sha512-JZeYqd7UAcHCwI+sTOeUDYkvEU+1bQ7iE0UT1MgB/tERkAPkesW46MrpIySzODi+owTjZtiF8Ay5j9m60KmMBw==", "dev": true, "dependencies": { - "read": "^2.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "read": "1" } }, + "node_modules/proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", + "dev": true + }, "node_modules/protocols": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/protocols/-/protocols-2.0.1.tgz", @@ -10826,6 +12459,16 @@ } ] }, + "node_modules/q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==", + "dev": true, + "engines": { + "node": ">=0.6.0", + "teleport": ">=0.2.0" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -10862,70 +12505,52 @@ "dev": true }, "node_modules/read": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/read/-/read-2.1.0.tgz", - "integrity": "sha512-bvxi1QLJHcaywCAEsAk4DG3nVoqiY2Csps3qzWalhj5hFqRn1d/OixkFXtLO1PrgHUcAP0FNaSY/5GYNfENFFQ==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", + "integrity": "sha512-rSOKNYUmaxy0om1BNjMN4ezNT6VKK+2xF4GBhc81mkH7L60i6dp8qPYrkndNLT3QPphoII3maL9PVC9XmhHwVQ==", "dev": true, "dependencies": { - "mute-stream": "~1.0.0" + "mute-stream": "~0.0.4" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": ">=0.8" } }, "node_modules/read-cmd-shim": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-4.0.0.tgz", - "integrity": "sha512-yILWifhaSEEytfXI76kB9xEEiG1AiozaCJZ83A87ytjRiN+jVibXjedjCRNjoZviinhG+4UkalO3mWTd8u5O0Q==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-3.0.1.tgz", + "integrity": "sha512-kEmDUoYf/CDy8yZbLTmhB1X9kkjf9Q80PCNsDMb7ufrGd6zZSQA1+UyjrO+pZm5K/S4OXCWJeiIt1JA8kAsa6g==", "dev": true, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/read-package-json": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-6.0.4.tgz", - "integrity": "sha512-AEtWXYfopBj2z5N5PbkAOeNHRPUg5q+Nen7QLxV8M2zJq1ym6/lCz3fYNTCXe19puu2d06jfHhrP7v/S2PtMMw==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-5.0.2.tgz", + "integrity": "sha512-BSzugrt4kQ/Z0krro8zhTwV1Kd79ue25IhNN/VtHFy1mG/6Tluyi+msc0UpwaoQzxSHa28mntAjIZY6kEgfR9Q==", "dev": true, "dependencies": { - "glob": "^10.2.2", - "json-parse-even-better-errors": "^3.0.0", - "normalize-package-data": "^5.0.0", - "npm-normalize-package-bin": "^3.0.0" + "glob": "^8.0.1", + "json-parse-even-better-errors": "^2.3.1", + "normalize-package-data": "^4.0.0", + "npm-normalize-package-bin": "^2.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/read-package-json-fast": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-3.0.2.tgz", - "integrity": "sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz", + "integrity": "sha512-W/BKtbL+dUjTuRL2vziuYhp76s5HZ9qQhd/dKfWIZveD0O40453QNyZhC0e63lqZrAQ4jiOapVoeJ7JrszenQQ==", "dev": true, "dependencies": { - "json-parse-even-better-errors": "^3.0.0", - "npm-normalize-package-bin": "^3.0.0" + "json-parse-even-better-errors": "^2.3.0", + "npm-normalize-package-bin": "^1.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/read-package-json-fast/node_modules/json-parse-even-better-errors": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.0.tgz", - "integrity": "sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==", - "dev": true, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/read-package-json-fast/node_modules/npm-normalize-package-bin": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.1.tgz", - "integrity": "sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ==", - "dev": true, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": ">=10" } }, "node_modules/read-package-json/node_modules/brace-expansion": { @@ -10938,46 +12563,34 @@ } }, "node_modules/read-package-json/node_modules/glob": { - "version": "10.3.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.3.tgz", - "integrity": "sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^2.0.3", - "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", - "path-scurry": "^1.10.1" - }, - "bin": { - "glob": "dist/cjs/src/bin.js" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/read-package-json/node_modules/hosted-git-info": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", - "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.2.1.tgz", + "integrity": "sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==", "dev": true, "dependencies": { "lru-cache": "^7.5.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/read-package-json/node_modules/json-parse-even-better-errors": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.0.tgz", - "integrity": "sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==", - "dev": true, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/read-package-json/node_modules/lru-cache": { @@ -10990,42 +12603,39 @@ } }, "node_modules/read-package-json/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=10" } }, "node_modules/read-package-json/node_modules/normalize-package-data": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-5.0.0.tgz", - "integrity": "sha512-h9iPVIfrVZ9wVYQnxFgtw1ugSvGEMOlyPWWtm8BMJhnwyEL/FLbYbTY3V3PpjI/BUK67n9PEWDu6eHzu1fB15Q==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-4.0.1.tgz", + "integrity": "sha512-EBk5QKKuocMJhB3BILuKhmaPjI8vNRSpIfO9woLC6NyHVkKKdVEdAO1mrT0ZfxNR1lKwCcTkuZfmGIFdizZ8Pg==", "dev": true, "dependencies": { - "hosted-git-info": "^6.0.0", + "hosted-git-info": "^5.0.0", "is-core-module": "^2.8.1", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/read-package-json/node_modules/npm-normalize-package-bin": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.1.tgz", - "integrity": "sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-2.0.0.tgz", + "integrity": "sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==", "dev": true, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/read-pkg": { @@ -11207,15 +12817,6 @@ "node": ">=4" } }, - "node_modules/read/node_modules/mute-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", - "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", - "dev": true, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -11230,6 +12831,19 @@ "node": ">= 6" } }, + "node_modules/readdir-scoped-modules": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz", + "integrity": "sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw==", + "deprecated": "This functionality has been moved to @npmcli/fs", + "dev": true, + "dependencies": { + "debuglog": "^1.0.1", + "dezalgo": "^1.0.0", + "graceful-fs": "^4.1.2", + "once": "^1.3.0" + } + }, "node_modules/redent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", @@ -11590,24 +13204,6 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, - "node_modules/sigstore": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/sigstore/-/sigstore-1.8.0.tgz", - "integrity": "sha512-ogU8qtQ3VFBawRJ8wjsBEX/vIFeHuGs1fm4jZtjWQwjo8pfAt7T/rh+udlAN4+QUe0IzA8qRSc/YZ7dHP6kh+w==", - "dev": true, - "dependencies": { - "@sigstore/bundle": "^1.0.0", - "@sigstore/protobuf-specs": "^0.2.0", - "@sigstore/tuf": "^1.0.3", - "make-fetch-happen": "^11.0.1" - }, - "bin": { - "sigstore": "bin/sigstore.js" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", @@ -11634,16 +13230,16 @@ } }, "node_modules/socks": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", - "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz", + "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==", "dev": true, "dependencies": { - "ip": "^2.0.0", + "ip-address": "^9.0.5", "smart-buffer": "^4.2.0" }, "engines": { - "node": ">= 10.13.0", + "node": ">= 10.0.0", "npm": ">= 3.0.0" } }, @@ -11662,15 +13258,27 @@ } }, "node_modules/sort-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", - "integrity": "sha512-/dPCrG1s3ePpWm6yBbxZq5Be1dXGLyLn9Z791chDC3NFrpkVbWGzkBwPN1knaciexFXgRJ7hzdnwZ4stHSDmjg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-4.2.0.tgz", + "integrity": "sha512-aUYIEU/UviqPgc8mHR6IW1EGxkAXpeRETYcrzg8cLAvUPZcpAlleSXHV2mY7G12GphSH6Gzv+4MMVSSkbdteHg==", "dev": true, "dependencies": { - "is-plain-obj": "^1.0.0" + "is-plain-obj": "^2.0.0" }, "engines": { - "node": ">=4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/sort-keys/node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "engines": { + "node": ">=8" } }, "node_modules/source-map": { @@ -11709,9 +13317,9 @@ } }, "node_modules/spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", "dev": true }, "node_modules/spdx-expression-parse": { @@ -11725,9 +13333,9 @@ } }, "node_modules/spdx-license-ids": { - "version": "3.0.13", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz", - "integrity": "sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==", + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz", + "integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==", "dev": true }, "node_modules/split": { @@ -11769,24 +13377,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/ssri/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ssri/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/stack-utils": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", @@ -11844,27 +13434,6 @@ "node": ">=8" } }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, "node_modules/string-width/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -11928,19 +13497,6 @@ "node": ">=8" } }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", @@ -12060,20 +13616,20 @@ "dev": true }, "node_modules/tar": { - "version": "6.1.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", - "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", "dev": true, "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", + "minipass": "^5.0.0", "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" }, "engines": { - "node": ">= 10" + "node": ">=10" } }, "node_modules/tar-stream": { @@ -12092,26 +13648,11 @@ "node": ">=6" } }, - "node_modules/tar/node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "dev": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/tar/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, "engines": { "node": ">=8" } @@ -12167,49 +13708,12 @@ "dev": true }, "node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", "dev": true, "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/through2/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "node_modules/through2/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/through2/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/through2/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" + "readable-stream": "3" } }, "node_modules/titleize": { @@ -12225,15 +13729,12 @@ } }, "node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", + "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", "dev": true, - "dependencies": { - "os-tmpdir": "~1.0.2" - }, "engines": { - "node": ">=0.6.0" + "node": ">=14.14" } }, "node_modules/tmpl": { @@ -12263,6 +13764,12 @@ "node": ">=8.0" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, "node_modules/tree-kill": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", @@ -12272,6 +13779,15 @@ "tree-kill": "cli.js" } }, + "node_modules/treeverse": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/treeverse/-/treeverse-2.0.0.tgz", + "integrity": "sha512-N5gJCkLu1aXccpOTtqV6ddSEi6ZmGkh3hjmbu1IjcavJK4qyOVQmi0myQKM7z5jVGmD68SJoliaVrMmVObhj6A==", + "dev": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, "node_modules/trim-newlines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", @@ -12387,20 +13903,6 @@ "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" } }, - "node_modules/tuf-js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-1.1.7.tgz", - "integrity": "sha512-i3P9Kgw3ytjELUfpuKVDNBJvk4u5bXL6gskv572mcevPbSKCV3zt3djhmlEQ65yERjIbOSncy7U4cQJaB1CBCg==", - "dev": true, - "dependencies": { - "@tufjs/models": "1.0.4", - "debug": "^4.3.4", - "make-fetch-happen": "^11.1.1" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -12505,6 +14007,15 @@ "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", "dev": true }, + "node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, "node_modules/typescript": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", @@ -12547,33 +14058,33 @@ } }, "node_modules/unique-filename": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-3.0.0.tgz", - "integrity": "sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-2.0.1.tgz", + "integrity": "sha512-ODWHtkkdx3IAR+veKxFV+VBkUMcN+FaqzUUd7IZzt+0zhDZFPFxhlqwPF3YQvMHx1TD0tdgYl+kuPnJ8E6ql7A==", "dev": true, "dependencies": { - "unique-slug": "^4.0.0" + "unique-slug": "^3.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/unique-slug": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-4.0.0.tgz", - "integrity": "sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-3.0.0.tgz", + "integrity": "sha512-8EyMynh679x/0gqE9fT9oilG+qEt+ibFyqjuVTsZn1+CMxH+XLlpvr2UZx4nVcCwTpx81nICr2JQFkM+HPLq4w==", "dev": true, "dependencies": { "imurmurhash": "^0.1.4" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/universal-user-agent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", - "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", + "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==", "dev": true }, "node_modules/universalify": { @@ -12650,9 +14161,9 @@ "dev": true }, "node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "dev": true, "bin": { "uuid": "dist/bin/uuid" @@ -12695,17 +14206,23 @@ } }, "node_modules/validate-npm-package-name": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.0.tgz", - "integrity": "sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz", + "integrity": "sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==", "dev": true, "dependencies": { "builtins": "^5.0.0" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/walk-up-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/walk-up-path/-/walk-up-path-1.0.0.tgz", + "integrity": "sha512-hwj/qMDUEjCU5h0xr90KGCf0tg0/LgJbmOWgrWKYlcJZM7XvquvUJZ0G/HMGr7F7OQMOUuPHWP9JpriinkAlkg==", + "dev": true + }, "node_modules/walker": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", @@ -12724,6 +14241,22 @@ "defaults": "^1.0.3" } }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -12806,24 +14339,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -12844,62 +14359,68 @@ } }, "node_modules/write-json-file": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-3.2.0.tgz", - "integrity": "sha512-3xZqT7Byc2uORAatYiP3DHUUAVEkNOswEWNs9H5KXiicRTvzYzYqKjYc4G7p+8pltvAw641lVByKVtMpf+4sYQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-4.3.0.tgz", + "integrity": "sha512-PxiShnxf0IlnQuMYOPPhPkhExoCQuTUNPOa/2JWCYTmBquU9njyyDuwRKN26IZBlp4yn1nt+Agh2HOOBl+55HQ==", "dev": true, "dependencies": { - "detect-indent": "^5.0.0", + "detect-indent": "^6.0.0", "graceful-fs": "^4.1.15", - "make-dir": "^2.1.0", - "pify": "^4.0.1", - "sort-keys": "^2.0.0", - "write-file-atomic": "^2.4.2" + "is-plain-obj": "^2.0.0", + "make-dir": "^3.0.0", + "sort-keys": "^4.0.0", + "write-file-atomic": "^3.0.0" }, "engines": { - "node": ">=6" + "node": ">=8.3" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/write-json-file/node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "engines": { + "node": ">=8" } }, "node_modules/write-json-file/node_modules/make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "dependencies": { - "pify": "^4.0.1", - "semver": "^5.6.0" + "semver": "^6.0.0" }, "engines": { - "node": ">=6" - } - }, - "node_modules/write-json-file/node_modules/pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true, - "engines": { - "node": ">=6" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/write-json-file/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { - "semver": "bin/semver" + "semver": "bin/semver.js" } }, "node_modules/write-json-file/node_modules/write-file-atomic": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", - "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", "dev": true, "dependencies": { - "graceful-fs": "^4.1.11", "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" } }, "node_modules/write-pkg": { @@ -12916,6 +14437,58 @@ "node": ">=8" } }, + "node_modules/write-pkg/node_modules/detect-indent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", + "integrity": "sha512-rlpvsxUtM0PQvy9iZe640/IWwWYyBsTApREbA1pHOpmOUIl9MkP/U4z7vTtg4Oaojvqhxt7sdufnT0EzGaR31g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/write-pkg/node_modules/make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "dependencies": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/write-pkg/node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/write-pkg/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/write-pkg/node_modules/sort-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", + "integrity": "sha512-/dPCrG1s3ePpWm6yBbxZq5Be1dXGLyLn9Z791chDC3NFrpkVbWGzkBwPN1knaciexFXgRJ7hzdnwZ4stHSDmjg==", + "dev": true, + "dependencies": { + "is-plain-obj": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/write-pkg/node_modules/type-fest": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.4.1.tgz", @@ -12925,6 +14498,34 @@ "node": ">=6" } }, + "node_modules/write-pkg/node_modules/write-file-atomic": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, + "node_modules/write-pkg/node_modules/write-json-file": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-3.2.0.tgz", + "integrity": "sha512-3xZqT7Byc2uORAatYiP3DHUUAVEkNOswEWNs9H5KXiicRTvzYzYqKjYc4G7p+8pltvAw641lVByKVtMpf+4sYQ==", + "dev": true, + "dependencies": { + "detect-indent": "^5.0.0", + "graceful-fs": "^4.1.15", + "make-dir": "^2.1.0", + "pify": "^4.0.1", + "sort-keys": "^2.0.0", + "write-file-atomic": "^2.4.2" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", @@ -12949,6 +14550,15 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true }, + "node_modules/yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, "node_modules/yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", diff --git a/package.json b/package.json index ea3ac2ed..88034664 100644 --- a/package.json +++ b/package.json @@ -27,10 +27,10 @@ "eslint-plugin-prettier": "^5.0.0", "flow-bin": "^0.115.0", "jest": "^29.6.4", - "lerna": "^7.1.4", + "lerna": "^6.4.1", "nx": "16.6.0", "prettier": "^3.0.0", "ts-jest": "^29.1.1", "typescript": "^5.2.2" } -} \ No newline at end of file +} From df5a794b3d967bf123de0ef95f3e982a098c2b11 Mon Sep 17 00:00:00 2001 From: eggyhead <28715808+eggyhead@users.noreply.github.com> Date: Wed, 10 Apr 2024 21:48:57 +0000 Subject: [PATCH 176/198] fixing new-package script instruction --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index fa05ba3e..5e457b53 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -43,7 +43,7 @@ Note that before a PR will be accepted, you must ensure: 1. In a new branch, create a new Lerna package: ```console -$ npm run create-package new-package +$ npm run new-package [name] ``` This will ask you some questions about the new package. Start with `0.0.0` as the first version (look generally at some of the other packages for how the package.json is structured). From 5d943d4b7fd238379a0985b7bdebd7e0fa848c31 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Mon, 15 Apr 2024 12:59:58 +0000 Subject: [PATCH 177/198] Rever http --- packages/http-client/package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/http-client/package-lock.json b/packages/http-client/package-lock.json index 52038ad3..ea3d7951 100644 --- a/packages/http-client/package-lock.json +++ b/packages/http-client/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "@actions/http-client", - "version": "2.2.1", + "version": "2.2.0", "license": "MIT", "dependencies": { "tunnel": "^0.0.6", From be507421b1a0a7107fb9a6653129e21812d9b6cd Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Mon, 15 Apr 2024 15:24:57 +0000 Subject: [PATCH 178/198] . --- package.json | 4 +- .../__tests__/upload-artifact.test.ts | 57 +++++++++++++++---- packages/http-client/package-lock.json | 2 +- 3 files changed, 48 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 88034664..d394979b 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "lint": "eslint packages/**/*.ts", "lint-fix": "eslint packages/**/*.ts --fix", "new-package": "scripts/create-package", - "test": "jest --testTimeout 60000" + "test": "jest --testTimeout 70000" }, "devDependencies": { "@types/jest": "^29.5.4", @@ -33,4 +33,4 @@ "ts-jest": "^29.1.1", "typescript": "^5.2.2" } -} +} \ No newline at end of file diff --git a/packages/artifact/__tests__/upload-artifact.test.ts b/packages/artifact/__tests__/upload-artifact.test.ts index c98114d6..afe4bca6 100644 --- a/packages/artifact/__tests__/upload-artifact.test.ts +++ b/packages/artifact/__tests__/upload-artifact.test.ts @@ -9,8 +9,8 @@ import {uploadArtifact} from '../src/internal/upload/upload-artifact' import {noopLogs} from './common' import {FilesNotFoundError} from '../src/internal/shared/errors' import {BlockBlobClient} from '@azure/storage-blob' -import fs from 'fs' -import {Readable} from 'stream' +import * as fs from 'fs' +import * as path from 'path' describe('upload-artifact', () => { beforeEach(() => { @@ -357,14 +357,47 @@ describe('upload-artifact', () => { it('should throw an error uploading blob chunks get delayed', async () => { const mockDate = new Date('2020-01-01') + // const root = path.join('/home/user/files/') + const dirPath = path.join(__dirname, `plz-upload`) - // Mock fs.createReadStream to return a mock stream - fs.createReadStream = jest.fn().mockImplementation(() => { - const mockStream = new Readable() - mockStream.push('file content') - mockStream.push(null) - return mockStream - }) + // const filePath = path.join(dirPath, 'file1.txt') + // const root = '/home/user/files' + if (!fs.existsSync(dirPath)) { + fs.mkdirSync(dirPath, {recursive: true}) + // fs.mkdirSync(path.join(dirPath, 'file1.txt'), {recursive: true}) + } + + // Now write the file + // eslint-disable-next-line @typescript-eslint/await-thenable + await fs.writeFile( + path.join(dirPath, 'file1.txt'), + 'test file content', + err => { + if (err) { + throw err + } + } + ) + // eslint-disable-next-line @typescript-eslint/await-thenable + await fs.writeFile( + path.join(dirPath, 'file2.txt'), + 'test file content', + err => { + if (err) { + throw err + } + } + ) + // eslint-disable-next-line @typescript-eslint/await-thenable + await fs.writeFile( + path.join(dirPath, 'file3.txt'), + 'test file content', + err => { + if (err) { + throw err + } + } + ) jest .spyOn(uploadZipSpecification, 'validateRootDirectory') @@ -373,15 +406,15 @@ describe('upload-artifact', () => { .spyOn(uploadZipSpecification, 'getUploadZipSpecification') .mockReturnValue([ { - sourcePath: '/home/user/files/plz-upload/file1.txt', + sourcePath: path.join(dirPath, 'file1.txt'), destinationPath: 'file1.txt' }, { - sourcePath: '/home/user/files/plz-upload/file2.txt', + sourcePath: path.join(dirPath, 'file2.txt'), destinationPath: 'file2.txt' }, { - sourcePath: '/home/user/files/plz-upload/dir/file3.txt', + sourcePath: path.join(dirPath, 'file3.txt'), destinationPath: 'dir/file3.txt' } ]) diff --git a/packages/http-client/package-lock.json b/packages/http-client/package-lock.json index ea3d7951..52038ad3 100644 --- a/packages/http-client/package-lock.json +++ b/packages/http-client/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "@actions/http-client", - "version": "2.2.0", + "version": "2.2.1", "license": "MIT", "dependencies": { "tunnel": "^0.0.6", From 75b5e5376d2f63f35c6606a20755813e12325669 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Mon, 15 Apr 2024 15:32:08 +0000 Subject: [PATCH 179/198] updating artifact version --- packages/artifact/RELEASES.md | 4 ++++ packages/artifact/package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/artifact/RELEASES.md b/packages/artifact/RELEASES.md index ca32b7eb..0ae6fe59 100644 --- a/packages/artifact/RELEASES.md +++ b/packages/artifact/RELEASES.md @@ -1,5 +1,9 @@ # @actions/artifact Releases +### 2.1.5 + +- Upgrading `archiver` dependency for uploads + ### 2.1.4 - Adds info-level logging for zip extraction diff --git a/packages/artifact/package.json b/packages/artifact/package.json index ce9faec1..9c2c1ed9 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -1,6 +1,6 @@ { "name": "@actions/artifact", - "version": "2.1.4", + "version": "2.1.5", "preview": true, "description": "Actions artifact lib", "keywords": [ From 5eea9e34e7939744ed10d85b5a7532e2501b703e Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Mon, 15 Apr 2024 16:08:45 +0000 Subject: [PATCH 180/198] cleaning up comments and removing clear timeout outside of finaly --- packages/artifact/src/internal/upload/blob-upload.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/artifact/src/internal/upload/blob-upload.ts b/packages/artifact/src/internal/upload/blob-upload.ts index f08bbe81..6c62fd49 100644 --- a/packages/artifact/src/internal/upload/blob-upload.ts +++ b/packages/artifact/src/internal/upload/blob-upload.ts @@ -60,8 +60,6 @@ export async function uploadZipToBlobStorage( lastProgressTime = Date.now() } - // // Timeout if the upload stalls - // const progressTimeout const options: BlockBlobUploadStreamOptions = { blobHTTPHeaders: {blobContentType: 'zip'}, onProgress: uploadCallback @@ -108,9 +106,6 @@ export async function uploadZipToBlobStorage( `No data was uploaded to blob storage. Reported upload byte count is 0.` ) } - - // clear the progress timeout when upload completes - clearTimeout(chunkTimer(timeoutDuration)) return { uploadSize: uploadByteCount, sha256Hash From fa06a1eadf8ad4c1bfd58c618bed2ee23231410c Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Mon, 15 Apr 2024 16:18:41 +0000 Subject: [PATCH 181/198] removing minor ver for now --- packages/artifact/RELEASES.md | 4 ---- packages/artifact/package.json | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/artifact/RELEASES.md b/packages/artifact/RELEASES.md index 0ae6fe59..ca32b7eb 100644 --- a/packages/artifact/RELEASES.md +++ b/packages/artifact/RELEASES.md @@ -1,9 +1,5 @@ # @actions/artifact Releases -### 2.1.5 - -- Upgrading `archiver` dependency for uploads - ### 2.1.4 - Adds info-level logging for zip extraction diff --git a/packages/artifact/package.json b/packages/artifact/package.json index 9c2c1ed9..ce9faec1 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -1,6 +1,6 @@ { "name": "@actions/artifact", - "version": "2.1.5", + "version": "2.1.4", "preview": true, "description": "Actions artifact lib", "keywords": [ From 2bbbf928aebff1536e3ae2b108e896f8eaafc95e Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Mon, 15 Apr 2024 16:20:24 +0000 Subject: [PATCH 182/198] re-adding minor ver for now --- packages/artifact/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/package.json b/packages/artifact/package.json index ce9faec1..9c2c1ed9 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -1,6 +1,6 @@ { "name": "@actions/artifact", - "version": "2.1.4", + "version": "2.1.5", "preview": true, "description": "Actions artifact lib", "keywords": [ From e998cf1216ccd64247af298f7c3aa0bcd931d0b1 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Mon, 15 Apr 2024 16:32:31 +0000 Subject: [PATCH 183/198] cleaning up tests --- packages/artifact/__tests__/upload-artifact.test.ts | 7 ------- packages/artifact/package-lock.json | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/artifact/__tests__/upload-artifact.test.ts b/packages/artifact/__tests__/upload-artifact.test.ts index afe4bca6..1e8e9153 100644 --- a/packages/artifact/__tests__/upload-artifact.test.ts +++ b/packages/artifact/__tests__/upload-artifact.test.ts @@ -357,17 +357,10 @@ describe('upload-artifact', () => { it('should throw an error uploading blob chunks get delayed', async () => { const mockDate = new Date('2020-01-01') - // const root = path.join('/home/user/files/') const dirPath = path.join(__dirname, `plz-upload`) - - // const filePath = path.join(dirPath, 'file1.txt') - // const root = '/home/user/files' if (!fs.existsSync(dirPath)) { fs.mkdirSync(dirPath, {recursive: true}) - // fs.mkdirSync(path.join(dirPath, 'file1.txt'), {recursive: true}) } - - // Now write the file // eslint-disable-next-line @typescript-eslint/await-thenable await fs.writeFile( path.join(dirPath, 'file1.txt'), diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index b78d919d..4d243ffd 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -1,12 +1,12 @@ { "name": "@actions/artifact", - "version": "2.1.4", + "version": "2.1.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@actions/artifact", - "version": "2.1.4", + "version": "2.1.5", "license": "MIT", "dependencies": { "@actions/core": "^1.10.0", From fa1cb5d1535c7c5cff5831a8b9e8a7f8efea6a33 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Mon, 15 Apr 2024 16:49:47 +0000 Subject: [PATCH 184/198] correcting imports --- .../__tests__/upload-artifact.test.ts | 36 ++++--------------- packages/artifact/package-lock.json | 10 ------ packages/artifact/package.json | 1 - 3 files changed, 6 insertions(+), 41 deletions(-) diff --git a/packages/artifact/__tests__/upload-artifact.test.ts b/packages/artifact/__tests__/upload-artifact.test.ts index 1e8e9153..9fb324d4 100644 --- a/packages/artifact/__tests__/upload-artifact.test.ts +++ b/packages/artifact/__tests__/upload-artifact.test.ts @@ -10,6 +10,7 @@ import {noopLogs} from './common' import {FilesNotFoundError} from '../src/internal/shared/errors' import {BlockBlobClient} from '@azure/storage-blob' import * as fs from 'fs' +import {writeFile} from 'fs/promises' import * as path from 'path' describe('upload-artifact', () => { @@ -361,36 +362,11 @@ describe('upload-artifact', () => { if (!fs.existsSync(dirPath)) { fs.mkdirSync(dirPath, {recursive: true}) } - // eslint-disable-next-line @typescript-eslint/await-thenable - await fs.writeFile( - path.join(dirPath, 'file1.txt'), - 'test file content', - err => { - if (err) { - throw err - } - } - ) - // eslint-disable-next-line @typescript-eslint/await-thenable - await fs.writeFile( - path.join(dirPath, 'file2.txt'), - 'test file content', - err => { - if (err) { - throw err - } - } - ) - // eslint-disable-next-line @typescript-eslint/await-thenable - await fs.writeFile( - path.join(dirPath, 'file3.txt'), - 'test file content', - err => { - if (err) { - throw err - } - } - ) + + await writeFile(path.join(dirPath, 'file1.txt'), 'test file content') + await writeFile(path.join(dirPath, 'file2.txt'), 'test file content') + + await writeFile(path.join(dirPath, 'file3.txt'), 'test file content') jest .spyOn(uploadZipSpecification, 'validateRootDirectory') diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index 4d243ffd..643dcb86 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -27,7 +27,6 @@ "devDependencies": { "@types/archiver": "^5.3.2", "@types/unzip-stream": "^0.3.4", - "mock-fs": "^5.2.0", "typedoc": "^0.25.4", "typedoc-plugin-markdown": "^3.17.1", "typescript": "^5.2.2" @@ -1225,15 +1224,6 @@ "mkdirp": "bin/cmd.js" } }, - "node_modules/mock-fs": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-5.2.0.tgz", - "integrity": "sha512-2dF2R6YMSZbpip1V1WHKGLNjr/k48uQClqMVb5H3MOvwc9qhYis3/IWbj02qIg/Y8MDXKFF4c5v0rxx2o6xTZw==", - "dev": true, - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", diff --git a/packages/artifact/package.json b/packages/artifact/package.json index 9c2c1ed9..ab60a271 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -60,7 +60,6 @@ "@types/unzip-stream": "^0.3.4", "typedoc": "^0.25.4", "typedoc-plugin-markdown": "^3.17.1", - "mock-fs": "^5.2.0", "typescript": "^5.2.2" } } \ No newline at end of file From 234761dc05aaa310276df404e9d3401467d8674b Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Mon, 15 Apr 2024 16:51:30 +0000 Subject: [PATCH 185/198] replacing writeFile with writeFileSync --- packages/artifact/__tests__/upload-artifact.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/artifact/__tests__/upload-artifact.test.ts b/packages/artifact/__tests__/upload-artifact.test.ts index 9fb324d4..a9f4e233 100644 --- a/packages/artifact/__tests__/upload-artifact.test.ts +++ b/packages/artifact/__tests__/upload-artifact.test.ts @@ -10,7 +10,7 @@ import {noopLogs} from './common' import {FilesNotFoundError} from '../src/internal/shared/errors' import {BlockBlobClient} from '@azure/storage-blob' import * as fs from 'fs' -import {writeFile} from 'fs/promises' +import {writeFileSync} from 'fs/promises' import * as path from 'path' describe('upload-artifact', () => { @@ -363,10 +363,10 @@ describe('upload-artifact', () => { fs.mkdirSync(dirPath, {recursive: true}) } - await writeFile(path.join(dirPath, 'file1.txt'), 'test file content') - await writeFile(path.join(dirPath, 'file2.txt'), 'test file content') + writeFileSync(path.join(dirPath, 'file1.txt'), 'test file content') + writeFileSync(path.join(dirPath, 'file2.txt'), 'test file content') - await writeFile(path.join(dirPath, 'file3.txt'), 'test file content') + writeFileSync(path.join(dirPath, 'file3.txt'), 'test file content') jest .spyOn(uploadZipSpecification, 'validateRootDirectory') From 918b468a41650cc298f7917e7e474caf54b7890e Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Mon, 15 Apr 2024 16:57:28 +0000 Subject: [PATCH 186/198] replacing writeFile with writeFileSync --- packages/artifact/__tests__/upload-artifact.test.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/artifact/__tests__/upload-artifact.test.ts b/packages/artifact/__tests__/upload-artifact.test.ts index a9f4e233..1761fa01 100644 --- a/packages/artifact/__tests__/upload-artifact.test.ts +++ b/packages/artifact/__tests__/upload-artifact.test.ts @@ -10,7 +10,6 @@ import {noopLogs} from './common' import {FilesNotFoundError} from '../src/internal/shared/errors' import {BlockBlobClient} from '@azure/storage-blob' import * as fs from 'fs' -import {writeFileSync} from 'fs/promises' import * as path from 'path' describe('upload-artifact', () => { @@ -363,10 +362,10 @@ describe('upload-artifact', () => { fs.mkdirSync(dirPath, {recursive: true}) } - writeFileSync(path.join(dirPath, 'file1.txt'), 'test file content') - writeFileSync(path.join(dirPath, 'file2.txt'), 'test file content') + fs.writeFileSync(path.join(dirPath, 'file1.txt'), 'test file content') + fs.writeFileSync(path.join(dirPath, 'file2.txt'), 'test file content') - writeFileSync(path.join(dirPath, 'file3.txt'), 'test file content') + fs.writeFileSync(path.join(dirPath, 'file3.txt'), 'test file content') jest .spyOn(uploadZipSpecification, 'validateRootDirectory') From ccb1df45d159adde17d61acb0300bc025626372a Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Fri, 19 Apr 2024 14:03:47 +0000 Subject: [PATCH 187/198] artifact client: retry on non-JSON response --- .../__tests__/artifact-http-client.test.ts | 48 +++++++++++++++++++ .../internal/shared/artifact-twirp-client.ts | 1 - 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/packages/artifact/__tests__/artifact-http-client.test.ts b/packages/artifact/__tests__/artifact-http-client.test.ts index e6768346..feb2b04a 100644 --- a/packages/artifact/__tests__/artifact-http-client.test.ts +++ b/packages/artifact/__tests__/artifact-http-client.test.ts @@ -116,6 +116,54 @@ describe('artifact-http-client', () => { expect(mockPost).toHaveBeenCalledTimes(2) }) + it('should retry if invalid body response', async () => { + const mockPost = jest + .fn(() => { + const msgSucceeded = new http.IncomingMessage(new net.Socket()) + msgSucceeded.statusCode = 200 + return { + message: msgSucceeded, + readBody: async () => { + return Promise.resolve( + `{"ok": true, "signedUploadUrl": "http://localhost:8080/upload"}` + ) + } + } + }) + .mockImplementationOnce(() => { + const msgFailed = new http.IncomingMessage(new net.Socket()) + msgFailed.statusCode = 502 + msgFailed.statusMessage = 'Bad Gateway' + return { + message: msgFailed, + readBody: async () => { + return Promise.resolve('💥') + } + } + }) + const mockHttpClient = ( + HttpClient as unknown as jest.Mock + ).mockImplementation(() => { + return { + post: mockPost + } + }) + + const client = internalArtifactTwirpClient(clientOptions) + const artifact = await client.CreateArtifact({ + workflowRunBackendId: '1234', + workflowJobRunBackendId: '5678', + name: 'artifact', + version: 4 + }) + + expect(mockHttpClient).toHaveBeenCalledTimes(1) + expect(artifact).toBeDefined() + expect(artifact.ok).toBe(true) + expect(artifact.signedUploadUrl).toBe('http://localhost:8080/upload') + expect(mockPost).toHaveBeenCalledTimes(2) + }) + it('should fail if the request fails 5 times', async () => { const mockPost = jest.fn(() => { const msgFailed = new http.IncomingMessage(new net.Socket()) diff --git a/packages/artifact/src/internal/shared/artifact-twirp-client.ts b/packages/artifact/src/internal/shared/artifact-twirp-client.ts index 1f987a1a..00c65bc7 100644 --- a/packages/artifact/src/internal/shared/artifact-twirp-client.ts +++ b/packages/artifact/src/internal/shared/artifact-twirp-client.ts @@ -102,7 +102,6 @@ class ArtifactHttpClient implements Rpc { } catch (error) { if (error instanceof SyntaxError) { debug(`Raw Body: ${rawBody}`) - throw error } if (error instanceof UsageError) { From b384fe17ba3eaae4a3ba0b3c839f328f69ac2e4c Mon Sep 17 00:00:00 2001 From: Rob Herley Date: Fri, 19 Apr 2024 15:08:30 +0000 Subject: [PATCH 188/198] bump pkg version + release notes --- packages/artifact/RELEASES.md | 12 ++++++++++-- packages/artifact/package.json | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/artifact/RELEASES.md b/packages/artifact/RELEASES.md index ca32b7eb..75d76f3e 100644 --- a/packages/artifact/RELEASES.md +++ b/packages/artifact/RELEASES.md @@ -1,5 +1,13 @@ # @actions/artifact Releases +### 2.1.6 + +- Will retry on invalid request responses. + +### 2.1.5 + +- Bumped `archiver` dependency to 7.0.1 + ### 2.1.4 - Adds info-level logging for zip extraction @@ -11,9 +19,9 @@ ### 2.1.2 - Updated the stream extract functionality to use `unzip.Parse()` instead of `unzip.Extract()` for greater control of unzipping artifacts - + ### 2.1.1 - + - Updated `isGhes` check to include `.ghe.com` and `.ghe.localhost` as accepted hosts ### 2.1.0 diff --git a/packages/artifact/package.json b/packages/artifact/package.json index ab60a271..83d56a83 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -1,6 +1,6 @@ { "name": "@actions/artifact", - "version": "2.1.5", + "version": "2.1.6", "preview": true, "description": "Actions artifact lib", "keywords": [ @@ -62,4 +62,4 @@ "typedoc-plugin-markdown": "^3.17.1", "typescript": "^5.2.2" } -} \ No newline at end of file +} From 2961d73391c5fc4f5ef0f68e4b4a9c3304873edf Mon Sep 17 00:00:00 2001 From: Brian DeHamer Date: Wed, 10 Apr 2024 16:53:17 -0700 Subject: [PATCH 189/198] remove dep on make-fetch-happen Signed-off-by: Brian DeHamer --- packages/attest/RELEASES.md | 1 + packages/attest/__tests__/provenance.test.ts | 22 +- packages/attest/__tests__/store.test.ts | 27 ++- packages/attest/package-lock.json | 212 ++----------------- packages/attest/package.json | 7 +- packages/attest/src/store.ts | 9 +- 6 files changed, 62 insertions(+), 216 deletions(-) diff --git a/packages/attest/RELEASES.md b/packages/attest/RELEASES.md index 92120cdd..a1c5f684 100644 --- a/packages/attest/RELEASES.md +++ b/packages/attest/RELEASES.md @@ -5,6 +5,7 @@ - Generate attestations using the v0.3 Sigstore bundle format. - Bump @sigstore/bundle from 2.2.0 to 2.3.0. - Bump @sigstore/sign from 2.2.3 to 2.3.0. +- Remove dependency on make-fetch-happen ### 1.1.0 diff --git a/packages/attest/__tests__/provenance.test.ts b/packages/attest/__tests__/provenance.test.ts index d08a6a63..91770f9e 100644 --- a/packages/attest/__tests__/provenance.test.ts +++ b/packages/attest/__tests__/provenance.test.ts @@ -2,6 +2,7 @@ import * as github from '@actions/github' import {mockFulcio, mockRekor, mockTSA} from '@sigstore/mock' import * as jose from 'jose' import nock from 'nock' +import {MockAgent, setGlobalDispatcher} from 'undici' import {SIGSTORE_GITHUB, SIGSTORE_PUBLIC_GOOD} from '../src/endpoints' import {attestProvenance, buildSLSAProvenancePredicate} from '../src/provenance' @@ -12,6 +13,10 @@ describe('provenance functions', () => { const jwksPath = '/.well-known/jwks.json' const tokenPath = '/token' + // MockAgent for mocking @actions/github + const mockAgent = new MockAgent() + setGlobalDispatcher(mockAgent) + const claims = { iss: issuer, aud: 'nobody', @@ -97,9 +102,12 @@ describe('provenance functions', () => { await mockFulcio({baseURL: fulcioURL, strict: false}) await mockTSA({baseURL: tsaServerURL}) - // Mock GH attestations API - nock('https://api.github.com') - .post(/^\/repos\/.*\/.*\/attestations$/) + mockAgent + .get('https://api.github.com') + .intercept({ + path: /^\/repos\/.*\/.*\/attestations$/, + method: 'post' + }) .reply(201, {id: attestationID}) }) @@ -159,8 +167,12 @@ describe('provenance functions', () => { await mockRekor({baseURL: rekorURL}) // Mock GH attestations API - nock('https://api.github.com') - .post(/^\/repos\/.*\/.*\/attestations$/) + mockAgent + .get('https://api.github.com') + .intercept({ + path: /^\/repos\/.*\/.*\/attestations$/, + method: 'post' + }) .reply(201, {id: attestationID}) }) diff --git a/packages/attest/__tests__/store.test.ts b/packages/attest/__tests__/store.test.ts index 755739d0..874d4d62 100644 --- a/packages/attest/__tests__/store.test.ts +++ b/packages/attest/__tests__/store.test.ts @@ -1,4 +1,4 @@ -import nock from 'nock' +import {MockAgent, setGlobalDispatcher} from 'undici' import {writeAttestation} from '../src/store' describe('writeAttestation', () => { @@ -6,6 +6,9 @@ describe('writeAttestation', () => { const attestation = {foo: 'bar '} const token = 'token' + const mockAgent = new MockAgent() + setGlobalDispatcher(mockAgent) + beforeEach(() => { process.env = { ...originalEnv, @@ -19,9 +22,14 @@ describe('writeAttestation', () => { describe('when the api call is successful', () => { beforeEach(() => { - nock('https://api.github.com') - .matchHeader('authorization', `token ${token}`) - .post('/repos/foo/bar/attestations', {bundle: attestation}) + mockAgent + .get('https://api.github.com') + .intercept({ + path: '/repos/foo/bar/attestations', + method: 'POST', + headers: {authorization: `token ${token}`}, + body: JSON.stringify({bundle: attestation}) + }) .reply(201, {id: '123'}) }) @@ -32,9 +40,14 @@ describe('writeAttestation', () => { describe('when the api call fails', () => { beforeEach(() => { - nock('https://api.github.com') - .matchHeader('authorization', `token ${token}`) - .post('/repos/foo/bar/attestations', {bundle: attestation}) + mockAgent + .get('https://api.github.com') + .intercept({ + path: '/repos/foo/bar/attestations', + method: 'POST', + headers: {authorization: `token ${token}`}, + body: JSON.stringify({bundle: attestation}) + }) .reply(500, 'oops') }) diff --git a/packages/attest/package-lock.json b/packages/attest/package-lock.json index 569cc7ed..af85c4b4 100644 --- a/packages/attest/package-lock.json +++ b/packages/attest/package-lock.json @@ -15,16 +15,15 @@ "@sigstore/bundle": "^2.3.0", "@sigstore/sign": "^2.3.0", "jsonwebtoken": "^9.0.2", - "jwks-rsa": "^3.1.0", - "make-fetch-happen": "^13.0.0" + "jwks-rsa": "^3.1.0" }, "devDependencies": { "@sigstore/mock": "^0.6.5", "@sigstore/rekor-types": "^2.0.0", "@types/jsonwebtoken": "^9.0.6", - "@types/make-fetch-happen": "^10.0.4", "jose": "^5.2.3", - "nock": "^13.5.1" + "nock": "^13.5.1", + "undici": "^5.28.4" } }, "node_modules/@actions/core": { @@ -530,17 +529,6 @@ "@types/node": "*" } }, - "node_modules/@types/make-fetch-happen": { - "version": "10.0.4", - "resolved": "https://registry.npmjs.org/@types/make-fetch-happen/-/make-fetch-happen-10.0.4.tgz", - "integrity": "sha512-jKzweQaEMMAi55ehvR1z0JF6aSVQm/h1BXBhPLOJriaeQBctjw5YbpIGs7zAx9dN0Sa2OO5bcXwCkrlgenoPEA==", - "dev": true, - "dependencies": { - "@types/node-fetch": "*", - "@types/retry": "*", - "@types/ssri": "*" - } - }, "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", @@ -554,16 +542,6 @@ "undici-types": "~5.26.4" } }, - "node_modules/@types/node-fetch": { - "version": "2.6.11", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.11.tgz", - "integrity": "sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==", - "dev": true, - "dependencies": { - "@types/node": "*", - "form-data": "^4.0.0" - } - }, "node_modules/@types/qs": { "version": "6.9.14", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.14.tgz", @@ -574,12 +552,6 @@ "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" }, - "node_modules/@types/retry": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.5.tgz", - "integrity": "sha512-3xSjTp3v03X/lSQLkczaN9UIEwJMoMCA1+Nb5HfbJEQWogdeQIyVtTvxPXDQjZ5zws8rFQfVfRdz03ARihPJgw==", - "dev": true - }, "node_modules/@types/send": { "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", @@ -599,15 +571,6 @@ "@types/node": "*" } }, - "node_modules/@types/ssri": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/@types/ssri/-/ssri-7.1.5.tgz", - "integrity": "sha512-odD/56S3B51liILSk5aXJlnYt99S6Rt9EFDDqGtJM26rKHApHcwyU/UoYHrzKkdkHMAIquGWCuHtQTbes+FRQw==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/agent-base": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", @@ -667,12 +630,6 @@ "node": ">=12.0.0" } }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -765,18 +722,6 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -806,15 +751,6 @@ } } }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/deprecation": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", @@ -867,20 +803,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/fs-minipass": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz", @@ -1207,27 +1129,6 @@ "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/minimatch": { "version": "9.0.3", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", @@ -1743,9 +1644,9 @@ } }, "node_modules/tar": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", - "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -1821,9 +1722,9 @@ } }, "node_modules/undici": { - "version": "5.28.3", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.3.tgz", - "integrity": "sha512-3ItfzbrhDlINjaP0duwnNsKpDQk3acHI3gVJ1z4fmwMK31k5G9OVIAMLSIaP6w4FaGkaAkN6zaQO9LUvZ1t7VA==", + "version": "5.28.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", + "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", "dependencies": { "@fastify/busboy": "^2.0.0" }, @@ -2428,17 +2329,6 @@ "@types/node": "*" } }, - "@types/make-fetch-happen": { - "version": "10.0.4", - "resolved": "https://registry.npmjs.org/@types/make-fetch-happen/-/make-fetch-happen-10.0.4.tgz", - "integrity": "sha512-jKzweQaEMMAi55ehvR1z0JF6aSVQm/h1BXBhPLOJriaeQBctjw5YbpIGs7zAx9dN0Sa2OO5bcXwCkrlgenoPEA==", - "dev": true, - "requires": { - "@types/node-fetch": "*", - "@types/retry": "*", - "@types/ssri": "*" - } - }, "@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", @@ -2452,16 +2342,6 @@ "undici-types": "~5.26.4" } }, - "@types/node-fetch": { - "version": "2.6.11", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.11.tgz", - "integrity": "sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==", - "dev": true, - "requires": { - "@types/node": "*", - "form-data": "^4.0.0" - } - }, "@types/qs": { "version": "6.9.14", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.14.tgz", @@ -2472,12 +2352,6 @@ "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" }, - "@types/retry": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.5.tgz", - "integrity": "sha512-3xSjTp3v03X/lSQLkczaN9UIEwJMoMCA1+Nb5HfbJEQWogdeQIyVtTvxPXDQjZ5zws8rFQfVfRdz03ARihPJgw==", - "dev": true - }, "@types/send": { "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", @@ -2497,15 +2371,6 @@ "@types/node": "*" } }, - "@types/ssri": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/@types/ssri/-/ssri-7.1.5.tgz", - "integrity": "sha512-odD/56S3B51liILSk5aXJlnYt99S6Rt9EFDDqGtJM26rKHApHcwyU/UoYHrzKkdkHMAIquGWCuHtQTbes+FRQw==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, "agent-base": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", @@ -2544,12 +2409,6 @@ "tslib": "^2.4.0" } }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true - }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -2627,15 +2486,6 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -2654,12 +2504,6 @@ "ms": "2.1.2" } }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true - }, "deprecation": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", @@ -2706,17 +2550,6 @@ "signal-exit": "^4.0.1" } }, - "form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, "fs-minipass": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz", @@ -2984,21 +2817,6 @@ "ssri": "^10.0.0" } }, - "mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true - }, - "mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "requires": { - "mime-db": "1.52.0" - } - }, "minimatch": { "version": "9.0.3", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", @@ -3367,9 +3185,9 @@ } }, "tar": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", - "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", "requires": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -3433,9 +3251,9 @@ "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" }, "undici": { - "version": "5.28.3", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.3.tgz", - "integrity": "sha512-3ItfzbrhDlINjaP0duwnNsKpDQk3acHI3gVJ1z4fmwMK31k5G9OVIAMLSIaP6w4FaGkaAkN6zaQO9LUvZ1t7VA==", + "version": "5.28.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", + "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", "requires": { "@fastify/busboy": "^2.0.0" } diff --git a/packages/attest/package.json b/packages/attest/package.json index eae9bea3..eb6bd07e 100644 --- a/packages/attest/package.json +++ b/packages/attest/package.json @@ -38,9 +38,9 @@ "@sigstore/mock": "^0.6.5", "@sigstore/rekor-types": "^2.0.0", "@types/jsonwebtoken": "^9.0.6", - "@types/make-fetch-happen": "^10.0.4", "jose": "^5.2.3", - "nock": "^13.5.1" + "nock": "^13.5.1", + "undici": "^5.28.4" }, "dependencies": { "@actions/core": "^1.10.1", @@ -49,7 +49,6 @@ "@sigstore/bundle": "^2.3.0", "@sigstore/sign": "^2.3.0", "jsonwebtoken": "^9.0.2", - "jwks-rsa": "^3.1.0", - "make-fetch-happen": "^13.0.0" + "jwks-rsa": "^3.1.0" } } diff --git a/packages/attest/src/store.ts b/packages/attest/src/store.ts index e7ebf659..e4a778e8 100644 --- a/packages/attest/src/store.ts +++ b/packages/attest/src/store.ts @@ -1,5 +1,4 @@ import * as github from '@actions/github' -import fetch from 'make-fetch-happen' const CREATE_ATTESTATION_REQUEST = 'POST /repos/{owner}/{repo}/attestations' @@ -14,7 +13,7 @@ export const writeAttestation = async ( attestation: unknown, token: string ): Promise => { - const octokit = github.getOctokit(token, {request: {fetch}}) + const octokit = github.getOctokit(token) try { const response = await octokit.request(CREATE_ATTESTATION_REQUEST, { @@ -23,7 +22,11 @@ export const writeAttestation = async ( data: {bundle: attestation} }) - return response.data?.id + const data = + typeof response.data == 'string' + ? JSON.parse(response.data) + : response.data + return data?.id } catch (err) { const message = err instanceof Error ? err.message : err throw new Error(`Failed to persist attestation: ${message}`) From 476276bf98a0b95a88713272e32de69ae2085833 Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Tue, 23 Apr 2024 15:54:54 -0400 Subject: [PATCH 190/198] use latest unzip-stream --- .../__tests__/download-artifact.test.ts | 20 ++++--- packages/artifact/package-lock.json | 10 ++-- .../internal/download/download-artifact.ts | 52 +------------------ 3 files changed, 19 insertions(+), 63 deletions(-) diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index e961532a..d886a55c 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -200,14 +200,12 @@ describe('download-artifact', () => { } ) - await expect( - downloadArtifactPublic( - fixtures.artifactID, - fixtures.repositoryOwner, - fixtures.repositoryName, - fixtures.token - ) - ).rejects.toBeInstanceOf(Error) + const response = await downloadArtifactPublic( + fixtures.artifactID, + fixtures.repositoryOwner, + fixtures.repositoryName, + fixtures.token + ) expect(downloadArtifactMock).toHaveBeenCalledWith({ owner: fixtures.repositoryOwner, @@ -223,6 +221,12 @@ describe('download-artifact', () => { expect(mockGetArtifactMalicious).toHaveBeenCalledWith( fixtures.blobStorageUrl ) + + // ensure path traversal was not possible + expect(fs.existsSync(path.join(fixtures.workspaceDir, 'x/etc/hosts'))).toBe(true); + expect(fs.existsSync(path.join(fixtures.workspaceDir, 'y/etc/hosts'))).toBe(true); + + expect(response.downloadPath).toBe(fixtures.workspaceDir) }) it('should successfully download an artifact to user defined path', async () => { diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index 643dcb86..878360b6 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -1,12 +1,12 @@ { "name": "@actions/artifact", - "version": "2.1.5", + "version": "2.1.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@actions/artifact", - "version": "2.1.5", + "version": "2.1.6", "license": "MIT", "dependencies": { "@actions/core": "^1.10.0", @@ -1738,9 +1738,9 @@ "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" }, "node_modules/unzip-stream": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/unzip-stream/-/unzip-stream-0.3.1.tgz", - "integrity": "sha512-RzaGXLNt+CW+T41h1zl6pGz3EaeVhYlK+rdAap+7DxW5kqsqePO8kRtWPaCiVqdhZc86EctSPVYNix30YOMzmw==", + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/unzip-stream/-/unzip-stream-0.3.4.tgz", + "integrity": "sha512-PyofABPVv+d7fL7GOpusx7eRT9YETY2X04PhwbSipdj6bMxVCFJrr+nm0Mxqbf9hUiTin/UsnuFWBXlDZFy0Cw==", "dependencies": { "binary": "^0.3.0", "mkdirp": "^0.5.1" diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index fb7fe0a3..31965c45 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -1,7 +1,4 @@ import fs from 'fs/promises' -import * as stream from 'stream' -import {createWriteStream} from 'fs' -import * as path from 'path' import * as github from '@actions/github' import * as core from '@actions/core' import * as httpClient from '@actions/http-client' @@ -47,11 +44,6 @@ async function streamExtract(url: string, directory: string): Promise { await streamExtractExternal(url, directory) return } catch (error) { - if (error.message.includes('Malformed extraction path')) { - throw new Error( - `Artifact download failed with unretryable error: ${error.message}` - ) - } retryCount++ core.debug( `Failed to download artifact after ${retryCount} retries due to ${error.message}. Retrying in 5 seconds...` @@ -86,8 +78,6 @@ export async function streamExtractExternal( } const timer = setTimeout(timerFn, timeout) - const createdDirectories = new Set() - createdDirectories.add(directory) response.message .on('data', () => { timer.refresh() @@ -99,46 +89,8 @@ export async function streamExtractExternal( clearTimeout(timer) reject(error) }) - .pipe(unzip.Parse()) - .pipe( - new stream.Transform({ - objectMode: true, - transform: async (entry, _, callback) => { - const fullPath = path.normalize(path.join(directory, entry.path)) - if (!directory.endsWith(path.sep)) { - directory += path.sep - } - if (!fullPath.startsWith(directory)) { - reject(new Error(`Malformed extraction path: ${fullPath}`)) - } - - if (entry.type === 'Directory') { - if (!createdDirectories.has(fullPath)) { - createdDirectories.add(fullPath) - await resolveOrCreateDirectory(fullPath).then(() => { - entry.autodrain() - callback() - }) - } else { - entry.autodrain() - callback() - } - } else { - core.info(`Extracting artifact entry: ${fullPath}`) - if (!createdDirectories.has(path.dirname(fullPath))) { - createdDirectories.add(path.dirname(fullPath)) - await resolveOrCreateDirectory(path.dirname(fullPath)) - } - - const writeStream = createWriteStream(fullPath) - writeStream.on('finish', callback) - writeStream.on('error', reject) - entry.pipe(writeStream) - } - } - }) - ) - .on('finish', async () => { + .pipe(unzip.Extract({path: directory})) + .on('close', () => { clearTimeout(timer) resolve() }) From 0159bbe7f2469315c88f3fe687a7ab68837fa71b Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Tue, 23 Apr 2024 16:03:52 -0400 Subject: [PATCH 191/198] bump version --- packages/artifact/RELEASES.md | 4 ++++ packages/artifact/package-lock.json | 4 ++-- packages/artifact/package.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/artifact/RELEASES.md b/packages/artifact/RELEASES.md index 75d76f3e..afc7f6a7 100644 --- a/packages/artifact/RELEASES.md +++ b/packages/artifact/RELEASES.md @@ -1,5 +1,9 @@ # @actions/artifact Releases +### 2.1.7 + +- Update unzip-stream dependency and reverted to using `unzip.Extract()` + ### 2.1.6 - Will retry on invalid request responses. diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index 878360b6..dce18974 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -1,12 +1,12 @@ { "name": "@actions/artifact", - "version": "2.1.6", + "version": "2.1.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@actions/artifact", - "version": "2.1.6", + "version": "2.1.7", "license": "MIT", "dependencies": { "@actions/core": "^1.10.0", diff --git a/packages/artifact/package.json b/packages/artifact/package.json index 83d56a83..ab84d0f2 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -1,6 +1,6 @@ { "name": "@actions/artifact", - "version": "2.1.6", + "version": "2.1.7", "preview": true, "description": "Actions artifact lib", "keywords": [ From 6e642f628f1636a50841102529403838cde4b6cb Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Tue, 23 Apr 2024 16:06:02 -0400 Subject: [PATCH 192/198] lint --- packages/artifact/__tests__/download-artifact.test.ts | 4 ++-- packages/artifact/src/internal/download/download-artifact.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index d886a55c..7c6849c8 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -223,8 +223,8 @@ describe('download-artifact', () => { ) // ensure path traversal was not possible - expect(fs.existsSync(path.join(fixtures.workspaceDir, 'x/etc/hosts'))).toBe(true); - expect(fs.existsSync(path.join(fixtures.workspaceDir, 'y/etc/hosts'))).toBe(true); + expect(fs.existsSync(path.join(fixtures.workspaceDir, 'x/etc/hosts'))).toBe(true) + expect(fs.existsSync(path.join(fixtures.workspaceDir, 'y/etc/hosts'))).toBe(true) expect(response.downloadPath).toBe(fixtures.workspaceDir) }) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index 31965c45..dc54f6fe 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -90,7 +90,7 @@ export async function streamExtractExternal( reject(error) }) .pipe(unzip.Extract({path: directory})) - .on('close', () => { + .on('close', () => { clearTimeout(timer) resolve() }) From 9eb3d3a673314b5f1b563801594f919b28562c03 Mon Sep 17 00:00:00 2001 From: bethanyj28 Date: Tue, 23 Apr 2024 16:10:57 -0400 Subject: [PATCH 193/198] lint --- packages/artifact/__tests__/download-artifact.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/artifact/__tests__/download-artifact.test.ts b/packages/artifact/__tests__/download-artifact.test.ts index 7c6849c8..f73c9fc7 100644 --- a/packages/artifact/__tests__/download-artifact.test.ts +++ b/packages/artifact/__tests__/download-artifact.test.ts @@ -223,8 +223,12 @@ describe('download-artifact', () => { ) // ensure path traversal was not possible - expect(fs.existsSync(path.join(fixtures.workspaceDir, 'x/etc/hosts'))).toBe(true) - expect(fs.existsSync(path.join(fixtures.workspaceDir, 'y/etc/hosts'))).toBe(true) + expect( + fs.existsSync(path.join(fixtures.workspaceDir, 'x/etc/hosts')) + ).toBe(true) + expect( + fs.existsSync(path.join(fixtures.workspaceDir, 'y/etc/hosts')) + ).toBe(true) expect(response.downloadPath).toBe(fixtures.workspaceDir) }) From 0e8fe8af6248e7a7a93207792ce47738c47c687e Mon Sep 17 00:00:00 2001 From: Brian DeHamer Date: Wed, 24 Apr 2024 11:31:11 -0700 Subject: [PATCH 194/198] retry request on failure to save attestation Signed-off-by: Brian DeHamer --- packages/attest/RELEASES.md | 4 + packages/attest/__tests__/store.test.ts | 34 ++- packages/attest/package-lock.json | 281 +++++++++++++++++++----- packages/attest/package.json | 8 +- packages/attest/src/store.ts | 11 +- 5 files changed, 282 insertions(+), 56 deletions(-) diff --git a/packages/attest/RELEASES.md b/packages/attest/RELEASES.md index a1c5f684..60d08dd8 100644 --- a/packages/attest/RELEASES.md +++ b/packages/attest/RELEASES.md @@ -1,5 +1,9 @@ # @actions/attest Releases +### 1.2.1 + +- Retry request on attestation persistence failure + ### 1.2.0 - Generate attestations using the v0.3 Sigstore bundle format. diff --git a/packages/attest/__tests__/store.test.ts b/packages/attest/__tests__/store.test.ts index 874d4d62..205e0427 100644 --- a/packages/attest/__tests__/store.test.ts +++ b/packages/attest/__tests__/store.test.ts @@ -52,7 +52,39 @@ describe('writeAttestation', () => { }) it('throws an error', async () => { - await expect(writeAttestation(attestation, token)).rejects.toThrow(/oops/) + await expect( + writeAttestation(attestation, token, {retry: 0}) + ).rejects.toThrow(/oops/) + }) + }) + + describe('when the api call fails but succeeds on retry', () => { + beforeEach(() => { + const pool = mockAgent.get('https://api.github.com') + + pool + .intercept({ + path: '/repos/foo/bar/attestations', + method: 'POST', + headers: {authorization: `token ${token}`}, + body: JSON.stringify({bundle: attestation}) + }) + .reply(500, 'oops') + .times(1) + + pool + .intercept({ + path: '/repos/foo/bar/attestations', + method: 'POST', + headers: {authorization: `token ${token}`}, + body: JSON.stringify({bundle: attestation}) + }) + .reply(201, {id: '123'}) + .times(1) + }) + + it('persists the attestation', async () => { + await expect(writeAttestation(attestation, token)).resolves.toEqual('123') }) }) }) diff --git a/packages/attest/package-lock.json b/packages/attest/package-lock.json index af85c4b4..98f20097 100644 --- a/packages/attest/package-lock.json +++ b/packages/attest/package-lock.json @@ -12,6 +12,7 @@ "@actions/core": "^1.10.1", "@actions/github": "^6.0.0", "@actions/http-client": "^2.2.1", + "@octokit/plugin-retry": "^6.0.1", "@sigstore/bundle": "^2.3.0", "@sigstore/sign": "^2.3.0", "jsonwebtoken": "^9.0.2", @@ -114,15 +115,15 @@ } }, "node_modules/@octokit/core": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.1.0.tgz", - "integrity": "sha512-BDa2VAMLSh3otEiaMJ/3Y36GU4qf6GI+VivQ/P41NC6GHcdxpKlqV0ikSZ5gdQsmS3ojXeRx5vasgNTinF0Q4g==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.2.0.tgz", + "integrity": "sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==", "dependencies": { "@octokit/auth-token": "^4.0.0", - "@octokit/graphql": "^7.0.0", - "@octokit/request": "^8.0.2", - "@octokit/request-error": "^5.0.0", - "@octokit/types": "^12.0.0", + "@octokit/graphql": "^7.1.0", + "@octokit/request": "^8.3.1", + "@octokit/request-error": "^5.1.0", + "@octokit/types": "^13.0.0", "before-after-hook": "^2.2.0", "universal-user-agent": "^6.0.0" }, @@ -130,31 +131,70 @@ "node": ">= 18" } }, - "node_modules/@octokit/endpoint": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.4.tgz", - "integrity": "sha512-DWPLtr1Kz3tv8L0UvXTDP1fNwM0S+z6EJpRcvH66orY6Eld4XBMCSYsaWp4xIm61jTWxK68BrR7ibO+vSDnZqw==", + "node_modules/@octokit/core/node_modules/@octokit/openapi-types": { + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.1.0.tgz", + "integrity": "sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q==" + }, + "node_modules/@octokit/core/node_modules/@octokit/types": { + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.4.1.tgz", + "integrity": "sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==", "dependencies": { - "@octokit/types": "^12.0.0", + "@octokit/openapi-types": "^22.1.0" + } + }, + "node_modules/@octokit/endpoint": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.5.tgz", + "integrity": "sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==", + "dependencies": { + "@octokit/types": "^13.1.0", "universal-user-agent": "^6.0.0" }, "engines": { "node": ">= 18" } }, - "node_modules/@octokit/graphql": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.0.2.tgz", - "integrity": "sha512-OJ2iGMtj5Tg3s6RaXH22cJcxXRi7Y3EBqbHTBRq+PQAqfaS8f/236fUrWhfSn8P4jovyzqucxme7/vWSSZBX2Q==", + "node_modules/@octokit/endpoint/node_modules/@octokit/openapi-types": { + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.1.0.tgz", + "integrity": "sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q==" + }, + "node_modules/@octokit/endpoint/node_modules/@octokit/types": { + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.4.1.tgz", + "integrity": "sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==", "dependencies": { - "@octokit/request": "^8.0.1", - "@octokit/types": "^12.0.0", + "@octokit/openapi-types": "^22.1.0" + } + }, + "node_modules/@octokit/graphql": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.1.0.tgz", + "integrity": "sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==", + "dependencies": { + "@octokit/request": "^8.3.0", + "@octokit/types": "^13.0.0", "universal-user-agent": "^6.0.0" }, "engines": { "node": ">= 18" } }, + "node_modules/@octokit/graphql/node_modules/@octokit/openapi-types": { + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.1.0.tgz", + "integrity": "sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q==" + }, + "node_modules/@octokit/graphql/node_modules/@octokit/types": { + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.4.1.tgz", + "integrity": "sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==", + "dependencies": { + "@octokit/openapi-types": "^22.1.0" + } + }, "node_modules/@octokit/openapi-types": { "version": "19.1.0", "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-19.1.0.tgz", @@ -188,14 +228,30 @@ "@octokit/core": ">=5" } }, - "node_modules/@octokit/request": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.2.0.tgz", - "integrity": "sha512-exPif6x5uwLqv1N1irkLG1zZNJkOtj8bZxuVHd71U5Ftuxf2wGNvAJyNBcPbPC+EBzwYEbBDdSFb8EPcjpYxPQ==", + "node_modules/@octokit/plugin-retry": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-6.0.1.tgz", + "integrity": "sha512-SKs+Tz9oj0g4p28qkZwl/topGcb0k0qPNX/i7vBKmDsjoeqnVfFUquqrE/O9oJY7+oLzdCtkiWSXLpLjvl6uog==", "dependencies": { - "@octokit/endpoint": "^9.0.0", "@octokit/request-error": "^5.0.0", "@octokit/types": "^12.0.0", + "bottleneck": "^2.15.3" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "@octokit/core": ">=5" + } + }, + "node_modules/@octokit/request": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.4.0.tgz", + "integrity": "sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==", + "dependencies": { + "@octokit/endpoint": "^9.0.1", + "@octokit/request-error": "^5.1.0", + "@octokit/types": "^13.1.0", "universal-user-agent": "^6.0.0" }, "engines": { @@ -203,11 +259,11 @@ } }, "node_modules/@octokit/request-error": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.0.1.tgz", - "integrity": "sha512-X7pnyTMV7MgtGmiXBwmO6M5kIPrntOXdyKZLigNfQWSEQzVxR4a4vo49vJjTWX70mPndj8KhfT4Dx+2Ng3vnBQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.0.tgz", + "integrity": "sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==", "dependencies": { - "@octokit/types": "^12.0.0", + "@octokit/types": "^13.1.0", "deprecation": "^2.0.0", "once": "^1.4.0" }, @@ -215,6 +271,32 @@ "node": ">= 18" } }, + "node_modules/@octokit/request-error/node_modules/@octokit/openapi-types": { + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.1.0.tgz", + "integrity": "sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q==" + }, + "node_modules/@octokit/request-error/node_modules/@octokit/types": { + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.4.1.tgz", + "integrity": "sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==", + "dependencies": { + "@octokit/openapi-types": "^22.1.0" + } + }, + "node_modules/@octokit/request/node_modules/@octokit/openapi-types": { + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.1.0.tgz", + "integrity": "sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q==" + }, + "node_modules/@octokit/request/node_modules/@octokit/types": { + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.4.1.tgz", + "integrity": "sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==", + "dependencies": { + "@octokit/openapi-types": "^22.1.0" + } + }, "node_modules/@octokit/types": { "version": "12.5.0", "resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.5.0.tgz", @@ -640,6 +722,11 @@ "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==" }, + "node_modules/bottleneck": { + "version": "2.19.5", + "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", + "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==" + }, "node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -1968,36 +2055,81 @@ "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==" }, "@octokit/core": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.1.0.tgz", - "integrity": "sha512-BDa2VAMLSh3otEiaMJ/3Y36GU4qf6GI+VivQ/P41NC6GHcdxpKlqV0ikSZ5gdQsmS3ojXeRx5vasgNTinF0Q4g==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.2.0.tgz", + "integrity": "sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==", "requires": { "@octokit/auth-token": "^4.0.0", - "@octokit/graphql": "^7.0.0", - "@octokit/request": "^8.0.2", - "@octokit/request-error": "^5.0.0", - "@octokit/types": "^12.0.0", + "@octokit/graphql": "^7.1.0", + "@octokit/request": "^8.3.1", + "@octokit/request-error": "^5.1.0", + "@octokit/types": "^13.0.0", "before-after-hook": "^2.2.0", "universal-user-agent": "^6.0.0" + }, + "dependencies": { + "@octokit/openapi-types": { + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.1.0.tgz", + "integrity": "sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q==" + }, + "@octokit/types": { + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.4.1.tgz", + "integrity": "sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==", + "requires": { + "@octokit/openapi-types": "^22.1.0" + } + } } }, "@octokit/endpoint": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.4.tgz", - "integrity": "sha512-DWPLtr1Kz3tv8L0UvXTDP1fNwM0S+z6EJpRcvH66orY6Eld4XBMCSYsaWp4xIm61jTWxK68BrR7ibO+vSDnZqw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.5.tgz", + "integrity": "sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==", "requires": { - "@octokit/types": "^12.0.0", + "@octokit/types": "^13.1.0", "universal-user-agent": "^6.0.0" + }, + "dependencies": { + "@octokit/openapi-types": { + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.1.0.tgz", + "integrity": "sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q==" + }, + "@octokit/types": { + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.4.1.tgz", + "integrity": "sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==", + "requires": { + "@octokit/openapi-types": "^22.1.0" + } + } } }, "@octokit/graphql": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.0.2.tgz", - "integrity": "sha512-OJ2iGMtj5Tg3s6RaXH22cJcxXRi7Y3EBqbHTBRq+PQAqfaS8f/236fUrWhfSn8P4jovyzqucxme7/vWSSZBX2Q==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.1.0.tgz", + "integrity": "sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==", "requires": { - "@octokit/request": "^8.0.1", - "@octokit/types": "^12.0.0", + "@octokit/request": "^8.3.0", + "@octokit/types": "^13.0.0", "universal-user-agent": "^6.0.0" + }, + "dependencies": { + "@octokit/openapi-types": { + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.1.0.tgz", + "integrity": "sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q==" + }, + "@octokit/types": { + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.4.1.tgz", + "integrity": "sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==", + "requires": { + "@octokit/openapi-types": "^22.1.0" + } + } } }, "@octokit/openapi-types": { @@ -2021,25 +2153,65 @@ "@octokit/types": "^12.4.0" } }, - "@octokit/request": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.2.0.tgz", - "integrity": "sha512-exPif6x5uwLqv1N1irkLG1zZNJkOtj8bZxuVHd71U5Ftuxf2wGNvAJyNBcPbPC+EBzwYEbBDdSFb8EPcjpYxPQ==", + "@octokit/plugin-retry": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-6.0.1.tgz", + "integrity": "sha512-SKs+Tz9oj0g4p28qkZwl/topGcb0k0qPNX/i7vBKmDsjoeqnVfFUquqrE/O9oJY7+oLzdCtkiWSXLpLjvl6uog==", "requires": { - "@octokit/endpoint": "^9.0.0", "@octokit/request-error": "^5.0.0", "@octokit/types": "^12.0.0", + "bottleneck": "^2.15.3" + } + }, + "@octokit/request": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.4.0.tgz", + "integrity": "sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==", + "requires": { + "@octokit/endpoint": "^9.0.1", + "@octokit/request-error": "^5.1.0", + "@octokit/types": "^13.1.0", "universal-user-agent": "^6.0.0" + }, + "dependencies": { + "@octokit/openapi-types": { + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.1.0.tgz", + "integrity": "sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q==" + }, + "@octokit/types": { + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.4.1.tgz", + "integrity": "sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==", + "requires": { + "@octokit/openapi-types": "^22.1.0" + } + } } }, "@octokit/request-error": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.0.1.tgz", - "integrity": "sha512-X7pnyTMV7MgtGmiXBwmO6M5kIPrntOXdyKZLigNfQWSEQzVxR4a4vo49vJjTWX70mPndj8KhfT4Dx+2Ng3vnBQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.0.tgz", + "integrity": "sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==", "requires": { - "@octokit/types": "^12.0.0", + "@octokit/types": "^13.1.0", "deprecation": "^2.0.0", "once": "^1.4.0" + }, + "dependencies": { + "@octokit/openapi-types": { + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.1.0.tgz", + "integrity": "sha512-pGUdSP+eEPfZiQHNkZI0U01HLipxncisdJQB4G//OAmfeO8sqTQ9KRa0KF03TUPCziNsoXUrTg4B2Q1EX++T0Q==" + }, + "@octokit/types": { + "version": "13.4.1", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.4.1.tgz", + "integrity": "sha512-Y73oOAzRBAUzR/iRAbGULzpNkX8vaxKCqEtg6K74Ff3w9f5apFnWtE/2nade7dMWWW3bS5Kkd6DJS4HF04xreg==", + "requires": { + "@octokit/openapi-types": "^22.1.0" + } + } } }, "@octokit/types": { @@ -2419,6 +2591,11 @@ "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==" }, + "bottleneck": { + "version": "2.19.5", + "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", + "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==" + }, "brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", diff --git a/packages/attest/package.json b/packages/attest/package.json index eb6bd07e..aa4d0cab 100644 --- a/packages/attest/package.json +++ b/packages/attest/package.json @@ -1,6 +1,6 @@ { "name": "@actions/attest", - "version": "1.2.0", + "version": "1.2.1", "description": "Actions attestation lib", "keywords": [ "github", @@ -46,9 +46,15 @@ "@actions/core": "^1.10.1", "@actions/github": "^6.0.0", "@actions/http-client": "^2.2.1", + "@octokit/plugin-retry": "^6.0.1", "@sigstore/bundle": "^2.3.0", "@sigstore/sign": "^2.3.0", "jsonwebtoken": "^9.0.2", "jwks-rsa": "^3.1.0" + }, + "overrides": { + "@octokit/plugin-retry": { + "@octokit/core": "^5.2.0" + } } } diff --git a/packages/attest/src/store.ts b/packages/attest/src/store.ts index e4a778e8..20c7666d 100644 --- a/packages/attest/src/store.ts +++ b/packages/attest/src/store.ts @@ -1,7 +1,12 @@ import * as github from '@actions/github' +import {retry} from '@octokit/plugin-retry' const CREATE_ATTESTATION_REQUEST = 'POST /repos/{owner}/{repo}/attestations' +const DEFAULT_RETRY_COUNT = 5 +export type WriteOptions = { + retry?: number +} /** * Writes an attestation to the repository's attestations endpoint. * @param attestation - The attestation to write. @@ -11,9 +16,11 @@ const CREATE_ATTESTATION_REQUEST = 'POST /repos/{owner}/{repo}/attestations' */ export const writeAttestation = async ( attestation: unknown, - token: string + token: string, + options: WriteOptions = {} ): Promise => { - const octokit = github.getOctokit(token) + const retries = options.retry ?? DEFAULT_RETRY_COUNT + const octokit = github.getOctokit(token, {retry: {retries}}, retry) try { const response = await octokit.request(CREATE_ATTESTATION_REQUEST, { From abb586d71e9d43ce959f49dedf4f62add8e50ec3 Mon Sep 17 00:00:00 2001 From: Brian DeHamer Date: Wed, 1 May 2024 11:30:45 -0700 Subject: [PATCH 195/198] add doc link in @actions/attest readme Signed-off-by: Brian DeHamer --- packages/attest/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/attest/README.md b/packages/attest/README.md index a8a98403..56e2adb5 100644 --- a/packages/attest/README.md +++ b/packages/attest/README.md @@ -12,6 +12,9 @@ Once the attestation has been created and signed, it will be uploaded to the GH attestations API and associated with the repository from which the workflow was initiated. +See [Using artifact attestations to establish provenance for builds](https://docs.github.com/en/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds) +for more information on artifact attestations. + ## Usage ### `attest` From e60694077d705f565409259111af2eabe5ae47d2 Mon Sep 17 00:00:00 2001 From: Fredrik Skogman Date: Thu, 16 May 2024 10:55:41 +0200 Subject: [PATCH 196/198] Read the server url from the environment variable. Instead of having the urls hardcoded, read them from the environment. I opted to read from the environment variable instead of the github context because it would be easier to test. --- packages/attest/__tests__/endpoints.test.ts | 41 ++++++++++++++++++++ packages/attest/__tests__/provenance.test.ts | 4 +- packages/attest/src/endpoints.ts | 24 +++++++----- 3 files changed, 58 insertions(+), 11 deletions(-) create mode 100644 packages/attest/__tests__/endpoints.test.ts diff --git a/packages/attest/__tests__/endpoints.test.ts b/packages/attest/__tests__/endpoints.test.ts new file mode 100644 index 00000000..5ddbab43 --- /dev/null +++ b/packages/attest/__tests__/endpoints.test.ts @@ -0,0 +1,41 @@ +import {signingEndpoints} from '../src/endpoints' + +describe('signingEndpoints', () => { + const originalEnv = process.env + + afterEach(() => { + process.env = originalEnv + }) + + describe('when using github.com', () => { + beforeEach(async () => { + process.env = { + ...originalEnv, + GITHUB_SERVER_URL: 'https://github.com' + } + }) + + it('returns expected endpoints', async () => { + const endpoints = signingEndpoints('github') + + expect(endpoints.fulcioURL).toEqual('https://fulcio.githubapp.com') + expect(endpoints.tsaServerURL).toEqual('https://timestamp.githubapp.com') + }) + }) + + describe('when using custom domain', () => { + beforeEach(async () => { + process.env = { + ...originalEnv, + GITHUB_SERVER_URL: 'https://foo.bar.com' + } + }) + + it('returns a expected endpoints', async () => { + const endpoints = signingEndpoints('github') + + expect(endpoints.fulcioURL).toEqual('https://fulcio.foo.bar.com') + expect(endpoints.tsaServerURL).toEqual('https://timestamp.foo.bar.com') + }) + }) +}) diff --git a/packages/attest/__tests__/provenance.test.ts b/packages/attest/__tests__/provenance.test.ts index 91770f9e..f4ac707e 100644 --- a/packages/attest/__tests__/provenance.test.ts +++ b/packages/attest/__tests__/provenance.test.ts @@ -3,7 +3,7 @@ import {mockFulcio, mockRekor, mockTSA} from '@sigstore/mock' import * as jose from 'jose' import nock from 'nock' import {MockAgent, setGlobalDispatcher} from 'undici' -import {SIGSTORE_GITHUB, SIGSTORE_PUBLIC_GOOD} from '../src/endpoints' +import {SIGSTORE_PUBLIC_GOOD, signingEndpoints} from '../src/endpoints' import {attestProvenance, buildSLSAProvenancePredicate} from '../src/provenance' describe('provenance functions', () => { @@ -95,7 +95,7 @@ describe('provenance functions', () => { }) describe('when using the github Sigstore instance', () => { - const {fulcioURL, tsaServerURL} = SIGSTORE_GITHUB + const {fulcioURL, tsaServerURL} = signingEndpoints('github') beforeEach(async () => { // Mock Sigstore diff --git a/packages/attest/src/endpoints.ts b/packages/attest/src/endpoints.ts index 3abecd1a..28b63ac7 100644 --- a/packages/attest/src/endpoints.ts +++ b/packages/attest/src/endpoints.ts @@ -6,9 +6,6 @@ const GITHUB_ID = 'github' const FULCIO_PUBLIC_GOOD_URL = 'https://fulcio.sigstore.dev' const REKOR_PUBLIC_GOOD_URL = 'https://rekor.sigstore.dev' -const FULCIO_INTERNAL_URL = 'https://fulcio.githubapp.com' -const TSA_INTERNAL_URL = 'https://timestamp.githubapp.com' - export type SigstoreInstance = typeof PUBLIC_GOOD_ID | typeof GITHUB_ID export type Endpoints = { @@ -22,11 +19,6 @@ export const SIGSTORE_PUBLIC_GOOD: Endpoints = { rekorURL: REKOR_PUBLIC_GOOD_URL } -export const SIGSTORE_GITHUB: Endpoints = { - fulcioURL: FULCIO_INTERNAL_URL, - tsaServerURL: TSA_INTERNAL_URL -} - export const signingEndpoints = (sigstore?: SigstoreInstance): Endpoints => { let instance: SigstoreInstance @@ -45,6 +37,20 @@ export const signingEndpoints = (sigstore?: SigstoreInstance): Endpoints => { case PUBLIC_GOOD_ID: return SIGSTORE_PUBLIC_GOOD case GITHUB_ID: - return SIGSTORE_GITHUB + return buildGitHubEndpoints() } } + +function buildGitHubEndpoints(): Endpoints { + const serverURL = process.env.GITHUB_SERVER_URL ?? `https://github.com` + let url = serverURL.replace('https://', '') + + if (url === 'github.com') { + url = 'githubapp.com' + } + const endpoints: Endpoints = { + fulcioURL: `https://fulcio.${url}`, + tsaServerURL: `https://timestamp.${url}` + } + return endpoints +} From 7d18e7aa0d80fe8db8b610d39b971b7876e9e234 Mon Sep 17 00:00:00 2001 From: Fredrik Skogman Date: Mon, 20 May 2024 07:52:36 +0200 Subject: [PATCH 197/198] PR feedback. Juse more JS idiomatic code --- packages/attest/src/endpoints.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/attest/src/endpoints.ts b/packages/attest/src/endpoints.ts index 28b63ac7..9f6467de 100644 --- a/packages/attest/src/endpoints.ts +++ b/packages/attest/src/endpoints.ts @@ -42,15 +42,14 @@ export const signingEndpoints = (sigstore?: SigstoreInstance): Endpoints => { } function buildGitHubEndpoints(): Endpoints { - const serverURL = process.env.GITHUB_SERVER_URL ?? `https://github.com` - let url = serverURL.replace('https://', '') + const serverURL = process.env.GITHUB_SERVER_URL || 'https://github.com' + let host = new URL(serverURL).hostname - if (url === 'github.com') { - url = 'githubapp.com' + if (host === 'github.com') { + host = 'githubapp.com' } - const endpoints: Endpoints = { - fulcioURL: `https://fulcio.${url}`, - tsaServerURL: `https://timestamp.${url}` + return { + fulcioURL: `https://fulcio.${hostl}`, + tsaServerURL: `https://timestamp.${host}` } - return endpoints } From d3d7736baeb618f34b4a3d1d8f07c4b843682cab Mon Sep 17 00:00:00 2001 From: Fredrik Skogman Date: Mon, 20 May 2024 07:57:44 +0200 Subject: [PATCH 198/198] Fixed a spelling error --- packages/attest/src/endpoints.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/attest/src/endpoints.ts b/packages/attest/src/endpoints.ts index 9f6467de..0510e19b 100644 --- a/packages/attest/src/endpoints.ts +++ b/packages/attest/src/endpoints.ts @@ -49,7 +49,7 @@ function buildGitHubEndpoints(): Endpoints { host = 'githubapp.com' } return { - fulcioURL: `https://fulcio.${hostl}`, + fulcioURL: `https://fulcio.${host}`, tsaServerURL: `https://timestamp.${host}` } }