From 159e42038d7126472a0cb01d3f8584662113129d Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 3 Aug 2023 16:36:11 -0400 Subject: [PATCH] Audit Fix (#1480) * fixing audit failures * replacing lerna bootstrap with npm command * audit fix for cache and tool-cache * updating tunnel * upgrading core packages * re-adding tunnel as prod dep * updating dependencies * updating exec deps * updating exec io package * . * Revert * updating packages * adding core as dep * updating learna config * updating lerna commands * Removing audit failing packages in cache + tool-cache * updating contribution bootstrap description * updating libraries * prettier lint * hiding stricter rules * updating prettier command * Removing unknown flag * Adding eslint prettier * ignoring sym links * updating ignore path * updating prettier rules * changing prettier + github ver * updating ts and ignores * Revert ts * Adding unknown ignores * downgrading lerna * . * adding nx * Adding lint auto lint rules * updating eslint ignore for glob packages * Adding subdirs to ignore * adding flag for ignore pattern in linter * Expanding ignore regex * Adding ignore rules * adding another ignore pattern to tsconfig eslint * adding ignore pattern to eslintrc * syncing package-json * updating traverse * . * test adding core and http client to base package * running npm ci * adding tsconfig paths * adding base URL * Adding explicit path to core and http-client * editing tsc call * updating artifact packages * force build * updating lock file version * updating lock file version * upgrading node version * Adding babel traverse back * fixing build issue * fixing typescript ver * updating package json * Adding ignore for artifact test * adding ignore to flags * unlink after test completes * cleanup * merge + package edit --- __tests__/auth.test.ts | 5 ++--- package-lock.json | 4 ++-- package.json | 2 +- src/auth.ts | 3 ++- src/index.ts | 4 ++-- tsconfig.json | 3 ++- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/__tests__/auth.test.ts b/__tests__/auth.test.ts index dadcbfb..50d0a6a 100644 --- a/__tests__/auth.test.ts +++ b/__tests__/auth.test.ts @@ -31,9 +31,8 @@ describe('auth', () => { it('does basic http get request with pat token auth', async () => { const token = 'scbfb44vxzku5l4xgc3qfazn3lpk4awflfryc76esaiq7aypcbhs' - const ph: am.PersonalAccessTokenCredentialHandler = new am.PersonalAccessTokenCredentialHandler( - token - ) + const ph: am.PersonalAccessTokenCredentialHandler = + new am.PersonalAccessTokenCredentialHandler(token) const http: httpm.HttpClient = new httpm.HttpClient('http-client-tests', [ ph diff --git a/package-lock.json b/package-lock.json index e5e1e9e..333acf7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@actions/http-client", - "version": "2.0.1", + "version": "2.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@actions/http-client", - "version": "2.0.1", + "version": "2.1.0", "license": "MIT", "dependencies": { "tunnel": "^0.0.6" diff --git a/package.json b/package.json index 7f5c8ec..61af4ee 100644 --- a/package.json +++ b/package.json @@ -45,4 +45,4 @@ "dependencies": { "tunnel": "^0.0.6" } -} +} \ No newline at end of file diff --git a/src/auth.ts b/src/auth.ts index 639adbe..58938ac 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -57,7 +57,8 @@ export class BearerCredentialHandler implements ifm.RequestHandler { } export class PersonalAccessTokenCredentialHandler - implements ifm.RequestHandler { + implements ifm.RequestHandler +{ token: string constructor(token: string) { diff --git a/src/index.ts b/src/index.ts index f02c275..ebea203 100644 --- a/src/index.ts +++ b/src/index.ts @@ -519,7 +519,7 @@ export class HttpClient { handleResult(new Error(`Request timeout: ${info.options.path}`)) }) - req.on('error', function(err) { + req.on('error', function (err) { // err has statusCode property // res should have headers handleResult(err) @@ -530,7 +530,7 @@ export class HttpClient { } if (data && typeof data !== 'string') { - data.on('close', function() { + data.on('close', function () { req.end() }) diff --git a/tsconfig.json b/tsconfig.json index 4abc2b1..222ca41 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,8 @@ "compilerOptions": { "outDir": "./lib", "rootDir": "./src", - "moduleResolution": "node" + "moduleResolution": "node", + "declaration": true, }, "include": [ "./src"