Skip to content

Commit 4eb89cf

Browse files
committed
fix: updated deps
1 parent e391dee commit 4eb89cf

File tree

13 files changed

+356
-357
lines changed

13 files changed

+356
-357
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
keys:
1515
- v1-yarn-{{checksum ".circleci/config.yml"}}-{{ checksum "yarn.lock"}}
1616
- v1-yarn-{{checksum ".circleci/config.yml"}}
17-
- run: .circleci/greenkeeper
18-
- run: yarn add -D nyc@11 @oclif/nyc-config@1 mocha-junit-reporter@1
17+
- run: yarn
18+
- run: yarn add -D nyc@13 @oclif/nyc-config@1 mocha-junit-reporter@1
1919
- run: |
2020
mkdir -p reports
2121
$NYC yarn test --reporter mocha-junit-reporter
@@ -33,7 +33,7 @@ jobs:
3333
- add_ssh_keys
3434
- checkout
3535
- restore_cache: *restore_cache
36-
- run: yarn global add @oclif/semantic-release@2 semantic-release@15
36+
- run: yarn global add @oclif/semantic-release@3 semantic-release@15
3737
- run: yarn --frozen-lockfile
3838
- run: |
3939
export PATH=/usr/local/share/.config/yarn/global/node_modules/.bin:$PATH

.circleci/greenkeeper

Lines changed: 0 additions & 25 deletions
This file was deleted.

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,40 @@
77
"dependencies": {
88
"@heroku-cli/color": "^1.1.10",
99
"@oclif/errors": "^1.2.0",
10-
"cli-ux": "^4.8.1",
11-
"debug": "^3.1.0",
10+
"cli-ux": "^4.8.2",
11+
"debug": "^4.0.1",
1212
"fs-extra": "^7.0.0",
1313
"heroku-client": "^3.0.6",
14-
"http-call": "^5.2.1",
14+
"http-call": "^5.2.2",
1515
"netrc-parser": "^3.1.6",
1616
"opn": "^5.3.0"
1717
},
1818
"devDependencies": {
19-
"@heroku-cli/schema": "^1.0.16",
19+
"@heroku-cli/schema": "^1.0.20",
2020
"@heroku-cli/tslint": "^1.1.4",
21-
"@oclif/command": "^1.5.0",
22-
"@oclif/config": "^1.7.2",
23-
"@oclif/tslint": "^2.0.0",
21+
"@oclif/command": "^1.5.1",
22+
"@oclif/config": "^1.7.6",
23+
"@oclif/tslint": "^3.1.0",
2424
"@types/ansi-styles": "^3.2.0",
2525
"@types/chai": "^4.1.4",
2626
"@types/fs-extra": "^5.0.4",
2727
"@types/mocha": "^5.2.5",
2828
"@types/nock": "^9.3.0",
29-
"@types/node": "^10.9.3",
29+
"@types/node": "^10.9.4",
3030
"@types/opn": "^5.1.0",
3131
"@types/proxyquire": "^1.3.28",
3232
"@types/sinon": "^5.0.2",
3333
"@types/supports-color": "^5.3.0",
3434
"chai": "^4.1.2",
35-
"fancy-test": "^1.3.0",
35+
"fancy-test": "^1.4.1",
3636
"mocha": "^5.2.0",
3737
"nock": "^9.6.1",
3838
"proxyquire": "^2.1.0",
39-
"sinon": "^6.1.5",
39+
"sinon": "^6.3.2",
4040
"testdouble": "^3.8.1",
4141
"ts-node": "^7.0.1",
4242
"tslint": "^5.11.0",
43-
"typescript": "^3.0.1"
43+
"typescript": "^3.0.3"
4444
},
4545
"engines": {
4646
"node": ">=6.0.0"

src/login.ts

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,20 @@ export class Login {
7272
let auth
7373
delete this.settings.method
7474
switch (input) {
75-
case 'b':
76-
case 'browser':
77-
auth = await this.browser(opts.browser)
78-
break
79-
case 'i':
80-
case 'interactive':
81-
auth = await this.interactive(previousEntry && previousEntry.login, opts.expiresIn)
82-
break
83-
case 's':
84-
case 'sso':
85-
auth = await this.sso()
86-
break
87-
default:
88-
return this.login(opts)
75+
case 'b':
76+
case 'browser':
77+
auth = await this.browser(opts.browser)
78+
break
79+
case 'i':
80+
case 'interactive':
81+
auth = await this.interactive(previousEntry && previousEntry.login, opts.expiresIn)
82+
break
83+
case 's':
84+
case 'sso':
85+
auth = await this.sso()
86+
break
87+
default:
88+
return this.login(opts)
8989
}
9090
await this.saveToken(auth)
9191
await this.saveSettings()
@@ -102,40 +102,40 @@ export class Login {
102102
// for SSO logins we delete the session since those do not show up in
103103
// authorizations because they are created a trusted client
104104
requests.push(HTTP.delete(`${vars.apiUrl}/oauth/sessions/~`, headers(token))
105-
.catch(err => {
106-
if (!err.http) throw err
107-
if (err.http.statusCode === 404 && err.http.body && err.http.body.id === 'not_found' && err.http.body.resource === 'session') {
108-
return
109-
}
110-
if (err.http.statusCode === 401 && err.http.body && err.http.body.id === 'unauthorized') {
111-
return
112-
}
113-
throw err
114-
}))
105+
.catch(err => {
106+
if (!err.http) throw err
107+
if (err.http.statusCode === 404 && err.http.body && err.http.body.id === 'not_found' && err.http.body.resource === 'session') {
108+
return
109+
}
110+
if (err.http.statusCode === 401 && err.http.body && err.http.body.id === 'unauthorized') {
111+
return
112+
}
113+
throw err
114+
}))
115115

116116
// grab all the authorizations so that we can delete the token they are
117117
// using in the CLI. we have to do this rather than delete ~ because
118118
// the ~ is the API Key, not the authorization that is currently requesting
119119
requests.push(HTTP.get<Heroku.OAuthAuthorization[]>(`${vars.apiUrl}/oauth/authorizations`, headers(token))
120-
.then(async ({body: authorizations}) => {
120+
.then(async ({body: authorizations}) => {
121121
// grab the default authorization because that is the token shown in the
122122
// dashboard as API Key and they may be using it for something else and we
123123
// would unwittingly break an integration that they are depending on
124-
const d = await this.defaultToken()
125-
if (d === token) return
126-
return Promise.all(
124+
const d = await this.defaultToken()
125+
if (d === token) return
126+
return Promise.all(
127127
authorizations
128-
.filter(a => a.access_token && a.access_token.token === this.heroku.auth)
129-
.map(a => HTTP.delete(`${vars.apiUrl}/oauth/authorizations/${a.id}`, headers(token)))
128+
.filter(a => a.access_token && a.access_token.token === this.heroku.auth)
129+
.map(a => HTTP.delete(`${vars.apiUrl}/oauth/authorizations/${a.id}`, headers(token)))
130130
)
131-
})
132-
.catch(err => {
133-
if (!err.http) throw err
134-
if (err.http.statusCode === 401 && err.http.body && err.http.body.id === 'unauthorized') {
135-
return []
136-
}
137-
throw err
138-
}))
131+
})
132+
.catch(err => {
133+
if (!err.http) throw err
134+
if (err.http.statusCode === 401 && err.http.body && err.http.body.id === 'unauthorized') {
135+
return []
136+
}
137+
throw err
138+
}))
139139

140140
await Promise.all(requests)
141141
}

test/api-client.test.ts

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -41,82 +41,82 @@ const test = base
4141

4242
describe('api_client', () => {
4343
test
44-
.it('makes an HTTP request', async ctx => {
45-
api = nock('https://api.heroku.com', {
46-
reqheaders: {authorization: 'Bearer mypass'},
47-
})
48-
api.get('/apps').reply(200, [{name: 'myapp'}])
44+
.it('makes an HTTP request', async ctx => {
45+
api = nock('https://api.heroku.com', {
46+
reqheaders: {authorization: 'Bearer mypass'},
47+
})
48+
api.get('/apps').reply(200, [{name: 'myapp'}])
4949

50-
const cmd = new Command([], ctx.config)
51-
const {body} = await cmd.heroku.get('/apps')
52-
expect(body).to.deep.equal([{name: 'myapp'}])
50+
const cmd = new Command([], ctx.config)
51+
const {body} = await cmd.heroku.get('/apps')
52+
expect(body).to.deep.equal([{name: 'myapp'}])
5353
// expect(netrc.loadSync).toBeCalled()
54-
})
55-
56-
test
57-
.it('can override authorization header', async ctx => {
58-
api = nock('https://api.heroku.com', {
59-
reqheaders: {authorization: 'Bearer myotherpass'},
6054
})
61-
api.get('/apps').reply(200, [{name: 'myapp'}])
62-
63-
const cmd = new Command([], ctx.config)
64-
const {body} = await cmd.heroku.get('/apps', {headers: {Authorization: 'Bearer myotherpass'}})
65-
expect(body).to.deep.equal([{name: 'myapp'}])
66-
})
6755

68-
describe('with HEROKU_HEADERS', () => {
69-
test
70-
.it('makes an HTTP request with HEROKU_HEADERS', async ctx => {
71-
process.env.HEROKU_HEADERS = '{"x-foo": "bar"}'
56+
test
57+
.it('can override authorization header', async ctx => {
7258
api = nock('https://api.heroku.com', {
73-
reqheaders: {'x-foo': 'bar'},
59+
reqheaders: {authorization: 'Bearer myotherpass'},
7460
})
7561
api.get('/apps').reply(200, [{name: 'myapp'}])
7662

7763
const cmd = new Command([], ctx.config)
78-
const {body} = await cmd.heroku.get('/apps')
64+
const {body} = await cmd.heroku.get('/apps', {headers: {Authorization: 'Bearer myotherpass'}})
7965
expect(body).to.deep.equal([{name: 'myapp'}])
8066
})
67+
68+
describe('with HEROKU_HEADERS', () => {
69+
test
70+
.it('makes an HTTP request with HEROKU_HEADERS', async ctx => {
71+
process.env.HEROKU_HEADERS = '{"x-foo": "bar"}'
72+
api = nock('https://api.heroku.com', {
73+
reqheaders: {'x-foo': 'bar'},
74+
})
75+
api.get('/apps').reply(200, [{name: 'myapp'}])
76+
77+
const cmd = new Command([], ctx.config)
78+
const {body} = await cmd.heroku.get('/apps')
79+
expect(body).to.deep.equal([{name: 'myapp'}])
80+
})
8181
})
8282

8383
test
84-
.it('2fa no preauth', async ctx => {
85-
api = nock('https://api.heroku.com')
86-
api.get('/apps').reply(403, {id: 'two_factor'})
87-
let _api = api as any
88-
_api.get('/apps').matchHeader('heroku-two-factor-code', '123456').reply(200, [{name: 'myapp'}])
89-
90-
const cmd = new Command([], ctx.config)
91-
Object.defineProperty(cli, 'prompt', {
92-
get: () => () => Promise.resolve('123456')
84+
.it('2fa no preauth', async ctx => {
85+
api = nock('https://api.heroku.com')
86+
api.get('/apps').reply(403, {id: 'two_factor'})
87+
let _api = api as any
88+
_api.get('/apps').matchHeader('heroku-two-factor-code', '123456').reply(200, [{name: 'myapp'}])
89+
90+
const cmd = new Command([], ctx.config)
91+
Object.defineProperty(cli, 'prompt', {
92+
get: () => () => Promise.resolve('123456')
93+
})
94+
const {body} = await cmd.heroku.get('/apps')
95+
expect(body).to.deep.equal([{name: 'myapp'}])
9396
})
94-
const {body} = await cmd.heroku.get('/apps')
95-
expect(body).to.deep.equal([{name: 'myapp'}])
96-
})
9797

9898
test
99-
.it('2fa preauth', async ctx => {
100-
api = nock('https://api.heroku.com')
101-
api.get('/apps/myapp').reply(403, {id: 'two_factor', app: {name: 'myapp'}})
102-
let _api = api as any
103-
_api.put('/apps/myapp/pre-authorizations').matchHeader('heroku-two-factor-code', '123456').reply(200, {})
104-
api.get('/apps/myapp').reply(200, {name: 'myapp'})
105-
api.get('/apps/anotherapp').reply(200, {name: 'anotherapp'})
106-
api.get('/apps/myapp/config').reply(200, {foo: 'bar'})
107-
api.get('/apps/myapp/dynos').reply(200, {web: 1})
108-
109-
const cmd = new Command([], ctx.config)
110-
Object.defineProperty(cli, 'prompt', {
111-
get: () => () => Promise.resolve('123456')
99+
.it('2fa preauth', async ctx => {
100+
api = nock('https://api.heroku.com')
101+
api.get('/apps/myapp').reply(403, {id: 'two_factor', app: {name: 'myapp'}})
102+
let _api = api as any
103+
_api.put('/apps/myapp/pre-authorizations').matchHeader('heroku-two-factor-code', '123456').reply(200, {})
104+
api.get('/apps/myapp').reply(200, {name: 'myapp'})
105+
api.get('/apps/anotherapp').reply(200, {name: 'anotherapp'})
106+
api.get('/apps/myapp/config').reply(200, {foo: 'bar'})
107+
api.get('/apps/myapp/dynos').reply(200, {web: 1})
108+
109+
const cmd = new Command([], ctx.config)
110+
Object.defineProperty(cli, 'prompt', {
111+
get: () => () => Promise.resolve('123456')
112+
})
113+
const info = cmd.heroku.get('/apps/myapp')
114+
const anotherapp = cmd.heroku.get('/apps/anotherapp')
115+
const _config = cmd.heroku.get('/apps/myapp/config')
116+
const dynos = cmd.heroku.get('/apps/myapp/dynos')
117+
expect((await info).body).to.deep.equal({name: 'myapp'})
118+
expect((await anotherapp).body).to.deep.equal({name: 'anotherapp'})
119+
expect((await _config).body).to.deep.equal({foo: 'bar'})
120+
expect((await dynos).body).to.deep.equal({web: 1})
112121
})
113-
const info = cmd.heroku.get('/apps/myapp')
114-
const anotherapp = cmd.heroku.get('/apps/anotherapp')
115-
const _config = cmd.heroku.get('/apps/myapp/config')
116-
const dynos = cmd.heroku.get('/apps/myapp/dynos')
117-
expect((await info).body).to.deep.equal({name: 'myapp'})
118-
expect((await anotherapp).body).to.deep.equal({name: 'anotherapp'})
119-
expect((await _config).body).to.deep.equal({foo: 'bar'})
120-
expect((await dynos).body).to.deep.equal({web: 1})
121-
})
122122
})

test/command.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ describe('command', () => {
2727
})
2828

2929
test
30-
.it('has heroku clients', async ctx => {
31-
let cmd = new MyCommand([], ctx.config)
32-
expect(cmd.heroku).to.be.ok
33-
expect(cmd.legacyHerokuClient).to.be.ok
34-
})
30+
.it('has heroku clients', async ctx => {
31+
let cmd = new MyCommand([], ctx.config)
32+
expect(cmd.heroku).to.be.ok
33+
expect(cmd.legacyHerokuClient).to.be.ok
34+
})
3535
})

test/flags/app.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@ describe('required', () => {
3939
})
4040

4141
fancy
42-
.it('gets app from --remote flag', async () => {
43-
withRemotes([
42+
.it('gets app from --remote flag', async () => {
43+
withRemotes([
4444
{name: 'staging', url: 'https://git.heroku.com/myapp-staging.git'},
4545
{name: 'production', url: 'https://git.heroku.com/myapp-production.git'},
46-
])
47-
await class extends Command {
48-
async run() {
49-
const {flags} = this.parse(Command)
50-
expect(flags.app).to.equal('myapp-staging')
51-
}
52-
}.run(['--remote', 'staging'])
53-
})
46+
])
47+
await class extends Command {
48+
async run() {
49+
const {flags} = this.parse(Command)
50+
expect(flags.app).to.equal('myapp-staging')
51+
}
52+
}.run(['--remote', 'staging'])
53+
})
5454

5555
it('errors if --remote not found', async () => {
5656
withRemotes([

0 commit comments

Comments
 (0)