diff --git a/packages/cli/package.json b/packages/cli/package.json index 3d1cacc652..aa34f46296 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -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", @@ -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", diff --git a/packages/cli/src/commands/authorizations/create.ts b/packages/cli/src/commands/authorizations/create.ts index 305feebb20..0e8f022ce1 100644 --- a/packages/cli/src/commands/authorizations/create.ts +++ b/packages/cli/src/commands/authorizations/create.ts @@ -25,7 +25,7 @@ export default class AuthorizationsCreate extends Command { ux.action.start('Creating OAuth Authorization') - const {body: auth, headers} = await this.heroku.post('/oauth/authorizations', { + const {body: auth} = await this.heroku.post('/oauth/authorizations', { body: { description: flags.description, scope: flags.scope ? flags.scope.split(',') : undefined, @@ -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) { diff --git a/packages/cli/src/commands/authorizations/info.ts b/packages/cli/src/commands/authorizations/info.ts index 37f2a0ac73..108a59bd2e 100644 --- a/packages/cli/src/commands/authorizations/info.ts +++ b/packages/cli/src/commands/authorizations/info.ts @@ -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( + const {body: authentication} = await this.heroku.get( `/oauth/authorizations/${args.id}`, ) - const apiWarnings = headers['warning-message'] as string || '' - - if (apiWarnings) { - ux.warn(apiWarnings) - } - if (flags.json) { ux.styledJSON(authentication) } else { diff --git a/packages/cli/src/commands/authorizations/revoke.ts b/packages/cli/src/commands/authorizations/revoke.ts index fba980d767..812757bf82 100644 --- a/packages/cli/src/commands/authorizations/revoke.ts +++ b/packages/cli/src/commands/authorizations/revoke.ts @@ -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( + const {body: auth} = await this.heroku.delete( `/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)}`) } } diff --git a/packages/cli/src/commands/authorizations/rotate.ts b/packages/cli/src/commands/authorizations/rotate.ts index b3c73aa2e5..c2f159eb34 100644 --- a/packages/cli/src/commands/authorizations/rotate.ts +++ b/packages/cli/src/commands/authorizations/rotate.ts @@ -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( + const {body: authorization} = await this.heroku.post( `/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) diff --git a/packages/cli/src/commands/authorizations/update.ts b/packages/cli/src/commands/authorizations/update.ts index dd51beabaf..34a4ccde6b 100644 --- a/packages/cli/src/commands/authorizations/update.ts +++ b/packages/cli/src/commands/authorizations/update.ts @@ -30,7 +30,7 @@ export default class AuthorizationsUpdate extends Command { } } - const {body: authentication, headers} = await this.heroku.patch( + const {body: authentication} = await this.heroku.patch( `/oauth/authorizations/${args.id}`, { body: { @@ -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) diff --git a/packages/cli/test/unit/commands/authorizations/create.unit.test.ts b/packages/cli/test/unit/commands/authorizations/create.unit.test.ts index 02f15f4bcf..f2ea405c4c 100644 --- a/packages/cli/test/unit/commands/authorizations/create.unit.test.ts +++ b/packages/cli/test/unit/commands/authorizations/create.unit.test.ts @@ -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') - }) - }) })