Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
node-version: [16.x]
node-version: [20.x, 22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs 16.20.2
nodejs 20.18.3
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@
"@types/chai": "^4.3.16",
"@types/fs-extra": "^9.0.13",
"@types/mocha": "^10.0.6",
"@types/nock": "^9.3.1",
"@types/node": "^18.11.9",
"@types/node": "20.14.8",
"@types/proxyquire": "^1.3.31",
"@types/sinon": "^10.0.13",
"@types/sinon": "^17.0.3",
"@types/supports-color": "^5.3.0",
"@types/uuid": "^8.3.0",
"@types/yargs-parser": "^21.0.3",
Expand All @@ -43,17 +42,17 @@
"eslint-plugin-mocha": "^10.4.3",
"fancy-test": "^2.0.42",
"mocha": "^10.7.3",
"nock": "^10.0.6",
"np": "^7.7.0",
"nock": "^14.0.1",
"np": "^10.2.0",
"proxyquire": "^2.1.3",
"sinon": "^14.0.2",
"sinon": "^16.1.3",
"stdout-stderr": "^0.1.13",
"ts-node": "^10.9.1",
"tslint": "^6.1.3",
"typescript": "^5.7.3"
},
"engines": {
"node": ">= 16.20.0"
"node": ">= 20"
},
"files": [
"lib"
Expand Down
2 changes: 1 addition & 1 deletion src/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import {vars} from './vars'
import {ParticleboardClient, IDelinquencyInfo, IDelinquencyConfig} from './particleboard-client'

const debug = require('debug')

Check warning on line 14 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 20.x)

Do not use "require"

Check warning on line 14 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 22.x)

Do not use "require"

Check warning on line 14 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest, 22.x)

Do not use "require"

Check warning on line 14 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest, 20.x)

Do not use "require"

Check warning on line 14 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest, 22.x)

Do not use "require"

Check warning on line 14 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest, 20.x)

Do not use "require"

export namespace APIClient {
export interface Options extends HTTPRequestOptions {
Expand Down Expand Up @@ -70,7 +70,7 @@
if (options.debug) debug.enable('http')
if (options.debug && options.debugHeaders) debug.enable('http,http:headers')
this.options = options
const apiUrl = url.URL ? new url.URL(vars.apiUrl) : url.parse(vars.apiUrl)

Check warning on line 73 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 20.x)

'url.parse' was deprecated since v11.0.0. Use 'url.URL' constructor instead

Check warning on line 73 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 22.x)

'url.parse' was deprecated since v11.0.0. Use 'url.URL' constructor instead

Check warning on line 73 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest, 22.x)

'url.parse' was deprecated since v11.0.0. Use 'url.URL' constructor instead

Check warning on line 73 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (macos-latest, 20.x)

'url.parse' was deprecated since v11.0.0. Use 'url.URL' constructor instead

Check warning on line 73 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest, 22.x)

'url.parse' was deprecated since v11.0.0. Use 'url.URL' constructor instead

Check warning on line 73 in src/api-client.ts

View workflow job for this annotation

GitHub Actions / test (windows-latest, 20.x)

'url.parse' was deprecated since v11.0.0. Use 'url.URL' constructor instead
const envHeaders = JSON.parse(process.env.HEROKU_HEADERS || '{}')
this.preauthPromises = {}
const self = this as any
Expand Down Expand Up @@ -110,7 +110,7 @@
}

static trackRequestIds<T>(response: HTTP<T>) {
const responseRequestIdHeader = response.headers[requestIdHeader]
const responseRequestIdHeader = response.headers[requestIdHeader] || response.headers[requestIdHeader.toLocaleLowerCase()]
if (responseRequestIdHeader) {
const requestIds = Array.isArray(responseRequestIdHeader) ? responseRequestIdHeader : responseRequestIdHeader.split(',')
RequestId.track(...requestIds)
Expand Down
3 changes: 2 additions & 1 deletion src/particleboard-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export class ParticleboardClient {
}
this.http = class ParticleboardHTTPClient<T> extends deps.HTTP.HTTP.create(particleboardOpts)<T> {
static trackRequestIds<T>(response: HTTP<T>) {
const responseRequestIdHeader = response.headers[requestIdHeader]
const responseRequestIdHeader = response.headers[requestIdHeader] || response.headers[requestIdHeader.toLocaleLowerCase()]

if (responseRequestIdHeader) {
const requestIds = Array.isArray(responseRequestIdHeader) ? responseRequestIdHeader : responseRequestIdHeader.split(',')
RequestId.track(...requestIds)
Expand Down
5 changes: 4 additions & 1 deletion test/api-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,10 @@ describe('api_client', () => {
.it('tracks response request ids for subsequent request ids', async ctx => {
const cmd = new Command([], ctx.config)
const existingRequestIds = ['first-existing-request-id', 'second-existing-request-id'].join(',')
api = nock('https://api.heroku.com').get('/apps').twice().reply(() => [200, JSON.stringify({name: 'myapp'}), {[requestIdHeader]: existingRequestIds}])
api = nock('https://api.heroku.com')
.get('/apps')
.twice()
.reply(() => [200, JSON.stringify({name: 'myapp'}), {[requestIdHeader]: existingRequestIds}])

generateStub.returns('random-uuid')
await cmd.heroku.get('/apps')
Expand Down
Loading
Loading