Skip to content

Commit

Permalink
chore(cli): Update dependencies for 9.2 release (#2982)
Browse files Browse the repository at this point in the history
* Updating dependencies and removing duplicated warnings in authorization commands

* Update lockfile

---------

Co-authored-by: Eric Black <eblack@salesforce.com>
  • Loading branch information
sbosio and eablack committed Aug 21, 2024
1 parent 725f5c3 commit c2e8093
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 107 deletions.
5 changes: 2 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
"bugs": "https://github.com/heroku/cli/issues",
"dependencies": {
"@heroku-cli/color": "2.0.1",
"@heroku-cli/command": "^11.2.2",
"@heroku-cli/command": "^11.3.0",
"@heroku-cli/notifications": "^1.2.4",
"@heroku-cli/plugin-ps": "^8.1.7",
"@heroku-cli/plugin-ps-exec": "^2.4.0",
"@heroku-cli/schema": "^1.0.25",
"@heroku/buildpack-registry": "^1.0.1",
Expand Down Expand Up @@ -46,7 +45,7 @@
"execa": "5.1.1",
"filesize": "^10.1.2",
"foreman": "^3.0.1",
"fs-extra": "7.0.1",
"fs-extra": "^9.1",
"github-url-to-object": "^4.0.4",
"glob": "^10.3.10",
"got": "^11.8.6",
Expand Down
8 changes: 1 addition & 7 deletions packages/cli/src/commands/authorizations/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default class AuthorizationsCreate extends Command {

ux.action.start('Creating OAuth Authorization')

const {body: auth, headers} = await this.heroku.post<Heroku.OAuthAuthorization>('/oauth/authorizations', {
const {body: auth} = await this.heroku.post<Heroku.OAuthAuthorization>('/oauth/authorizations', {
body: {
description: flags.description,
scope: flags.scope ? flags.scope.split(',') : undefined,
Expand All @@ -35,12 +35,6 @@ export default class AuthorizationsCreate extends Command {

ux.action.stop()

const apiWarnings = headers['warning-message'] as string || ''

if (apiWarnings) {
ux.warn(apiWarnings)
}

if (flags.short) {
ux.log(auth.access_token && auth.access_token.token)
} else if (flags.json) {
Expand Down
8 changes: 1 addition & 7 deletions packages/cli/src/commands/authorizations/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,10 @@ export default class AuthorizationsInfo extends Command {
async run() {
const {args, flags} = await this.parse(AuthorizationsInfo)

const {body: authentication, headers} = await this.heroku.get<Heroku.OAuthAuthorization>(
const {body: authentication} = await this.heroku.get<Heroku.OAuthAuthorization>(
`/oauth/authorizations/${args.id}`,
)

const apiWarnings = headers['warning-message'] as string || ''

if (apiWarnings) {
ux.warn(apiWarnings)
}

if (flags.json) {
ux.styledJSON(authentication)
} else {
Expand Down
10 changes: 1 addition & 9 deletions packages/cli/src/commands/authorizations/revoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,9 @@ export default class AuthorizationsRevoke extends Command {
const {args} = await this.parse(AuthorizationsRevoke)

ux.action.start('Revoking OAuth Authorization')

const {body: auth, headers} = await this.heroku.delete<Heroku.OAuthAuthorization>(
const {body: auth} = await this.heroku.delete<Heroku.OAuthAuthorization>(
`/oauth/authorizations/${encodeURIComponent(args.id)}`,
)

const apiWarnings = headers['warning-message'] as string || ''

if (apiWarnings) {
ux.warn(apiWarnings)
}

ux.action.stop(`done, revoked authorization from ${color.cyan(auth.description)}`)
}
}
10 changes: 1 addition & 9 deletions packages/cli/src/commands/authorizations/rotate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,9 @@ export default class AuthorizationsRotate extends Command {
const {args} = await this.parse(AuthorizationsRotate)

ux.action.start('Rotating OAuth Authorization')

const {body: authorization, headers} = await this.heroku.post<Heroku.OAuthAuthorization>(
const {body: authorization} = await this.heroku.post<Heroku.OAuthAuthorization>(
`/oauth/authorizations/${encodeURIComponent(args.id)}/actions/regenerate-tokens`,
)

const apiWarnings = headers['warning-message'] as string || ''

if (apiWarnings) {
ux.warn(apiWarnings)
}

ux.action.stop()

display(authorization)
Expand Down
8 changes: 1 addition & 7 deletions packages/cli/src/commands/authorizations/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default class AuthorizationsUpdate extends Command {
}
}

const {body: authentication, headers} = await this.heroku.patch<Heroku.OAuthAuthorization>(
const {body: authentication} = await this.heroku.patch<Heroku.OAuthAuthorization>(
`/oauth/authorizations/${args.id}`,
{
body: {
Expand All @@ -40,12 +40,6 @@ export default class AuthorizationsUpdate extends Command {
},
)

const apiWarnings = headers['warning-message'] as string || ''

if (apiWarnings) {
ux.warn(apiWarnings)
}

ux.action.stop()

display(authentication)
Expand Down
15 changes: 0 additions & 15 deletions packages/cli/test/unit/commands/authorizations/create.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,4 @@ describe('authorizations:create', function () {
expect(json.scope).to.contain('global')
})
})

context('API warning headers', function () {
test
.stderr()
.stdout()
.nock('https://api.heroku.com:443', api => {
api
.post('/oauth/authorizations', {description: 'awesome'})
.reply(201, {scope: ['global'], access_token: {token: 'secrettoken'}}, {'warning-message': 'this is an API warning message example'})
})
.command(['authorizations:create', '--description', 'awesome'])
.it('outputs API warning message', ctx => {
expect(ctx.stderr).contains('this is an API warning message example')
})
})
})
69 changes: 19 additions & 50 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1616,9 +1616,9 @@ __metadata:
languageName: node
linkType: hard

"@heroku-cli/command@npm:^11.2.2":
version: 11.2.2
resolution: "@heroku-cli/command@npm:11.2.2"
"@heroku-cli/command@npm:^11.3.0":
version: 11.3.0
resolution: "@heroku-cli/command@npm:11.3.0"
dependencies:
"@heroku-cli/color": ^2.0.1
"@oclif/core": ^2.16.0
Expand All @@ -1633,7 +1633,7 @@ __metadata:
peerDependencies:
yargs-parser: ">=18.x"
yargs-unparser: ^2.0.0
checksum: 049415c4dad3eb116b50974c75c692905fa00bf0d25d0aff466d15ea18ee97f095fda78cc2d4da5921eb207ee5937c68de46006b63f4c6dc5ae3ebdffd58be03
checksum: 8db7c5e3cbca931f83f8afc857ed75dc4a0db690049b91fe8448c46caf53388450b5f4743a812ae350f218fbfd2b9a5f84e9f9f8f8f24bd2267d653191303f96
languageName: node
linkType: hard

Expand All @@ -1655,24 +1655,6 @@ __metadata:
languageName: node
linkType: hard

"@heroku-cli/command@npm:^9.0.2":
version: 9.0.2
resolution: "@heroku-cli/command@npm:9.0.2"
dependencies:
"@heroku-cli/color": ^1.1.14
"@oclif/core": ^1.26.2
cli-ux: ^6.0.9
debug: ^4.1.1
fs-extra: ^7.0.1
heroku-client: ^3.1.0
http-call: ^5.2.4
netrc-parser: ^3.1.6
open: ^6.2.0
uuid: ^8.3.0
checksum: bbe4933dd94517491f34cd24ba762ed75e7ce5b3ec615047fd8287c58b2ef029b6599c252c6b6f739554f329d160a6c5e8634b58206818ff332a668eb257fae4
languageName: node
linkType: hard

"@heroku-cli/heroku-exec-util@npm:0.7.6":
version: 0.7.6
resolution: "@heroku-cli/heroku-exec-util@npm:0.7.6"
Expand Down Expand Up @@ -1710,18 +1692,6 @@ __metadata:
languageName: node
linkType: hard

"@heroku-cli/plugin-ps@npm:^8.1.7":
version: 8.1.7
resolution: "@heroku-cli/plugin-ps@npm:8.1.7"
dependencies:
"@heroku-cli/color": ^1.1.14
"@heroku-cli/command": ^9.0.2
"@oclif/core": ^1.26.2
lodash: ^4.17.11
checksum: f4ecd2769f5e14c14b2209b548cf72cc2ca0df2835f1f77262728a43421a9f5bfc415665de43f1d3b33ca386b96b8165dda7203e779e951486bd797c244eab51
languageName: node
linkType: hard

"@heroku-cli/schema@npm:^1.0.25":
version: 1.0.25
resolution: "@heroku-cli/schema@npm:1.0.25"
Expand Down Expand Up @@ -3425,7 +3395,7 @@ __metadata:
languageName: node
linkType: hard

"@oclif/core@npm:^1.1.1, @oclif/core@npm:^1.25.0, @oclif/core@npm:^1.26.2":
"@oclif/core@npm:^1.1.1, @oclif/core@npm:^1.25.0":
version: 1.26.2
resolution: "@oclif/core@npm:1.26.2"
dependencies:
Expand Down Expand Up @@ -10133,17 +10103,6 @@ __metadata:
languageName: node
linkType: hard

"fs-extra@npm:7.0.1, fs-extra@npm:^7.0.0, fs-extra@npm:^7.0.1":
version: 7.0.1
resolution: "fs-extra@npm:7.0.1"
dependencies:
graceful-fs: ^4.1.2
jsonfile: ^4.0.0
universalify: ^0.1.0
checksum: 141b9dccb23b66a66cefdd81f4cda959ff89282b1d721b98cea19ba08db3dcbe6f862f28841f3cf24bb299e0b7e6c42303908f65093cb7e201708e86ea5a8dcf
languageName: node
linkType: hard

"fs-extra@npm:^11.1.0":
version: 11.1.0
resolution: "fs-extra@npm:11.1.0"
Expand All @@ -10166,6 +10125,17 @@ __metadata:
languageName: node
linkType: hard

"fs-extra@npm:^7.0.0, fs-extra@npm:^7.0.1":
version: 7.0.1
resolution: "fs-extra@npm:7.0.1"
dependencies:
graceful-fs: ^4.1.2
jsonfile: ^4.0.0
universalify: ^0.1.0
checksum: 141b9dccb23b66a66cefdd81f4cda959ff89282b1d721b98cea19ba08db3dcbe6f862f28841f3cf24bb299e0b7e6c42303908f65093cb7e201708e86ea5a8dcf
languageName: node
linkType: hard

"fs-extra@npm:^8.1":
version: 8.1.0
resolution: "fs-extra@npm:8.1.0"
Expand All @@ -10177,7 +10147,7 @@ __metadata:
languageName: node
linkType: hard

"fs-extra@npm:^9.0, fs-extra@npm:^9.0.1, fs-extra@npm:^9.1.0":
"fs-extra@npm:^9.0, fs-extra@npm:^9.0.1, fs-extra@npm:^9.1, fs-extra@npm:^9.1.0":
version: 9.1.0
resolution: "fs-extra@npm:9.1.0"
dependencies:
Expand Down Expand Up @@ -11171,9 +11141,8 @@ __metadata:
resolution: "heroku@workspace:packages/cli"
dependencies:
"@heroku-cli/color": 2.0.1
"@heroku-cli/command": ^11.2.2
"@heroku-cli/command": ^11.3.0
"@heroku-cli/notifications": ^1.2.4
"@heroku-cli/plugin-ps": ^8.1.7
"@heroku-cli/plugin-ps-exec": ^2.4.0
"@heroku-cli/schema": ^1.0.25
"@heroku/buildpack-registry": ^1.0.1
Expand Down Expand Up @@ -11242,7 +11211,7 @@ __metadata:
execa: 5.1.1
filesize: ^10.1.2
foreman: ^3.0.1
fs-extra: 7.0.1
fs-extra: ^9.1
github-url-to-object: ^4.0.4
glob: ^10.3.10
globby: ^10.0.2
Expand Down

0 comments on commit c2e8093

Please sign in to comment.