diff --git a/bin/dev b/bin/dev new file mode 100755 index 0000000..bbc3f51 --- /dev/null +++ b/bin/dev @@ -0,0 +1,17 @@ +#!/usr/bin/env node + +const oclif = require('@oclif/core') + +const path = require('path') +const project = path.join(__dirname, '..', 'tsconfig.json') + +// In dev mode -> use ts-node and dev plugins +process.env.NODE_ENV = 'development' + +require('ts-node').register({project}) + +// In dev mode, always show stack traces +oclif.settings.debug = true; + +// Start the CLI +oclif.run().then(oclif.flush).catch(oclif.Errors.handle) diff --git a/bin/dev.cmd b/bin/dev.cmd new file mode 100644 index 0000000..6f2aae1 --- /dev/null +++ b/bin/dev.cmd @@ -0,0 +1,3 @@ +@echo off + +node "%~dp0\dev" %* diff --git a/bin/run b/bin/run index 3c4ae3a..a7635de 100755 --- a/bin/run +++ b/bin/run @@ -1,4 +1,5 @@ #!/usr/bin/env node -require('@oclif/command').run() -.catch(require('@oclif/errors/handle')) +const oclif = require('@oclif/core') + +oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle')) diff --git a/package.json b/package.json index 778827c..d42f943 100644 --- a/package.json +++ b/package.json @@ -5,11 +5,9 @@ "author": "Boreal Information Systems Inc.", "bugs": "https://github.com/OldSneerJaw/borealis-pg-cli/issues", "dependencies": { - "@heroku-cli/command": "^8.5.0", - "@oclif/command": "^1.8.21", - "@oclif/config": "^1.18.6", + "@heroku-cli/command": "^9.0.1", + "@oclif/core": "^1.26.1", "chalk": "^2.4.2", - "cli-ux": "^5.6.7", "dotenv": "^16.0.3", "http-call": "^5.3.0", "pg": "^8.7.3", @@ -60,6 +58,7 @@ "oclif-plugin" ], "license": "MIT", + "main": "lib/index.js", "nyc": { "all": true, "reporter": [ diff --git a/src/async-actions.ts b/src/async-actions.ts index 46e00b9..4fc3b3c 100644 --- a/src/async-actions.ts +++ b/src/async-actions.ts @@ -1,5 +1,5 @@ import color from '@heroku-cli/color' -import cli from 'cli-ux' +import {CliUx} from '@oclif/core' /** * Used to display a spinner while a given asynchronous action is executed @@ -11,13 +11,13 @@ import cli from 'cli-ux' */ export async function applyActionSpinner(message: string, action: Promise): Promise { try { - cli.action.start(message) + CliUx.ux.action.start(message) const result = await action - cli.action.stop() + CliUx.ux.action.stop() return result } catch (error: any) { - cli.action.stop(color.bold.redBright('!')) + CliUx.ux.action.stop(color.bold.redBright('!')) throw error } diff --git a/src/command-components.ts b/src/command-components.ts index 2b732b1..ef210ae 100644 --- a/src/command-components.ts +++ b/src/command-components.ts @@ -48,17 +48,8 @@ export const cliOptions = { char: 'p', default: defaultPorts.pg, description: 'local port number for the secure tunnel to the add-on Postgres server', - parse: input => { - if (!/^-?\d+$/.test(input)) - throw new Error(`Value "${input}" is not a valid integer`) - - const value = Number.parseInt(input, 10) - if (value < 1 || value > 65_535) { - throw new Error(`Value ${value} is outside the range of valid port numbers`) - } - - return value - }, + min: 1, + max: 65_535, }), writeAccess: flags.boolean({ char: 'w', diff --git a/src/commands/borealis-pg/extensions/index.ts b/src/commands/borealis-pg/extensions/index.ts index d40ccde..5113451 100644 --- a/src/commands/borealis-pg/extensions/index.ts +++ b/src/commands/borealis-pg/extensions/index.ts @@ -24,7 +24,7 @@ export default class ListPgExtensionsCommand extends Command { } async run() { - const {flags} = this.parse(ListPgExtensionsCommand) + const {flags} = await this.parse(ListPgExtensionsCommand) const authorization = await createHerokuAuth(this.heroku) const attachmentInfo = await fetchAddonAttachmentInfo(this.heroku, flags.addon, flags.app, this.error) diff --git a/src/commands/borealis-pg/extensions/install.ts b/src/commands/borealis-pg/extensions/install.ts index 772edfe..1afa6e3 100644 --- a/src/commands/borealis-pg/extensions/install.ts +++ b/src/commands/borealis-pg/extensions/install.ts @@ -61,7 +61,7 @@ static examples = [ } async run() { - const {args, flags} = this.parse(InstallPgExtensionsCommand) + const {args, flags} = await this.parse(InstallPgExtensionsCommand) const pgExtension = args[cliArgs.pgExtension.name] const suppressConflict = flags[suppressConflictOptionName] const authorization = await createHerokuAuth(this.heroku) @@ -159,7 +159,7 @@ static examples = [ } async catch(err: any) { - const {args} = this.parse(InstallPgExtensionsCommand) + const {args} = await this.parse(InstallPgExtensionsCommand) const pgExtension = args[cliArgs.pgExtension.name] /* istanbul ignore else */ diff --git a/src/commands/borealis-pg/extensions/remove.ts b/src/commands/borealis-pg/extensions/remove.ts index 741d5c6..9fb7b2f 100644 --- a/src/commands/borealis-pg/extensions/remove.ts +++ b/src/commands/borealis-pg/extensions/remove.ts @@ -1,6 +1,6 @@ import color from '@heroku-cli/color' import {Command, flags} from '@heroku-cli/command' -import cli from 'cli-ux' +import {CliUx} from '@oclif/core' import {HTTP, HTTPError} from 'http-call' import {applyActionSpinner} from '../../../async-actions' import {getBorealisPgApiUrl, getBorealisPgAuthHeader} from '../../../borealis-api' @@ -50,13 +50,13 @@ export default class RemovePgExtensionCommand extends Command { } async run() { - const {args, flags} = this.parse(RemovePgExtensionCommand) + const {args, flags} = await this.parse(RemovePgExtensionCommand) const pgExtension = args[cliArgs.pgExtension.name] const suppressMissing = flags[suppressMissingOptionName] const confirmation = flags.confirm ? flags.confirm : - (await cli.prompt('Enter the name of the extension to confirm its removal')) + (await CliUx.ux.prompt('Enter the name of the extension to confirm its removal')) if (confirmation.trim() !== pgExtension) { this.error(`Invalid confirmation provided. Expected ${pgExtensionColour(pgExtension)}.`) @@ -90,7 +90,7 @@ export default class RemovePgExtensionCommand extends Command { } async catch(err: any) { - const {args} = this.parse(RemovePgExtensionCommand) + const {args} = await this.parse(RemovePgExtensionCommand) const pgExtension = args[cliArgs.pgExtension.name] /* istanbul ignore else */ diff --git a/src/commands/borealis-pg/info.ts b/src/commands/borealis-pg/info.ts index 3d3ed90..023e6a8 100644 --- a/src/commands/borealis-pg/info.ts +++ b/src/commands/borealis-pg/info.ts @@ -60,7 +60,7 @@ export default class AddonInfoCommand extends Command { } async run() { - const {flags} = this.parse(AddonInfoCommand) + const {flags} = await this.parse(AddonInfoCommand) const authorization = await createHerokuAuth(this.heroku) const attachmentInfo = await fetchAddonAttachmentInfo(this.heroku, flags.addon, flags.app, this.error) diff --git a/src/commands/borealis-pg/integrations/index.ts b/src/commands/borealis-pg/integrations/index.ts index 63caa1d..d0e55e7 100644 --- a/src/commands/borealis-pg/integrations/index.ts +++ b/src/commands/borealis-pg/integrations/index.ts @@ -1,6 +1,6 @@ import color from '@heroku-cli/color' import {Command} from '@heroku-cli/command' -import cli from 'cli-ux' +import {CliUx} from '@oclif/core' import {HTTP, HTTPError} from 'http-call' import {applyActionSpinner} from '../../../async-actions' import {getBorealisPgApiUrl, getBorealisPgAuthHeader} from '../../../borealis-api' @@ -24,7 +24,7 @@ via a secure tunnel using semi-permanent SSH server and database credentials.` } async run() { - const {flags} = this.parse(ListDataIntegrationsCommand) + const {flags} = await this.parse(ListDataIntegrationsCommand) const authorization = await createHerokuAuth(this.heroku) const attachmentInfo = await fetchAddonAttachmentInfo(this.heroku, flags.addon, flags.app, this.error) @@ -57,7 +57,7 @@ via a secure tunnel using semi-permanent SSH server and database credentials.` }) this.log() - cli.table(normalizedIntegrations, columns, {'no-truncate': true}) + CliUx.ux.table(normalizedIntegrations, columns, {'no-truncate': true}) } else { this.warn('No data integrations found') } diff --git a/src/commands/borealis-pg/integrations/register.test.ts b/src/commands/borealis-pg/integrations/register.test.ts index 0a75176..98720c0 100644 --- a/src/commands/borealis-pg/integrations/register.test.ts +++ b/src/commands/borealis-pg/integrations/register.test.ts @@ -263,7 +263,7 @@ describe('data integration registration command', () => { '-n', fakeIntegrationName, ]) - .catch(/^Missing 1 required arg:/) + .catch(/.*Missing 1 required arg:.*/) .it('exits with an error if there is no SSH public key argument', ctx => { expect(ctx.stdout).to.equal('') }) @@ -271,7 +271,7 @@ describe('data integration registration command', () => { test.stdout() .stderr() .command(['borealis-pg:integrations:register', '-a', fakeHerokuAppName, fakeSshPublicKey]) - .catch(/^Missing required flag:/) + .catch(/.*Missing required flag name.*/) .it('exits with an error if there is no integration name option', ctx => { expect(ctx.stdout).to.equal('') }) diff --git a/src/commands/borealis-pg/integrations/register.ts b/src/commands/borealis-pg/integrations/register.ts index 7e302bb..249b91f 100644 --- a/src/commands/borealis-pg/integrations/register.ts +++ b/src/commands/borealis-pg/integrations/register.ts @@ -71,7 +71,7 @@ supports it.` } async run() { - const {args, flags} = this.parse(RegisterDataIntegrationsCommand) + const {args, flags} = await this.parse(RegisterDataIntegrationsCommand) const sshPublicKey = args[sshPublicKeyCliArgName] const integrationName = flags[dataIntegrationOptionName] const enableWriteAccess = flags[writeAccessOptionName] diff --git a/src/commands/borealis-pg/integrations/remove.test.ts b/src/commands/borealis-pg/integrations/remove.test.ts index 6b35e8e..e8f6165 100644 --- a/src/commands/borealis-pg/integrations/remove.test.ts +++ b/src/commands/borealis-pg/integrations/remove.test.ts @@ -208,7 +208,7 @@ describe('data integration removal command', () => { test.stdout() .stderr() .command(['borealis-pg:integrations:remove', '-a', fakeHerokuAppName]) - .catch(/^Missing required flag:/) + .catch(/.*Missing required flag name.*/) .it('exits with an error if the data integration option is missing', ctx => { expect(ctx.stdout).to.equal('') }) diff --git a/src/commands/borealis-pg/integrations/remove.ts b/src/commands/borealis-pg/integrations/remove.ts index 18e1360..e31b04e 100644 --- a/src/commands/borealis-pg/integrations/remove.ts +++ b/src/commands/borealis-pg/integrations/remove.ts @@ -1,6 +1,6 @@ import color from '@heroku-cli/color' import {Command, flags} from '@heroku-cli/command' -import cli from 'cli-ux' +import {CliUx} from '@oclif/core' import {HTTP, HTTPError} from 'http-call' import {applyActionSpinner} from '../../../async-actions' import {getBorealisPgApiUrl, getBorealisPgAuthHeader} from '../../../borealis-api' @@ -43,11 +43,11 @@ export default class RemoveDataIntegrationCommand extends Command { } async run() { - const {flags} = this.parse(RemoveDataIntegrationCommand) + const {flags} = await this.parse(RemoveDataIntegrationCommand) const integrationName = flags[dataIntegrationOptionName] const confirmation = flags.confirm ? flags.confirm : - (await cli.prompt('Enter the name of the data integration to confirm its removal')) + (await CliUx.ux.prompt('Enter the name of the data integration to confirm its removal')) if (confirmation.trim() !== integrationName) { this.error( diff --git a/src/commands/borealis-pg/psql.test.ts b/src/commands/borealis-pg/psql.test.ts index ba39190..90374c8 100644 --- a/src/commands/borealis-pg/psql.test.ts +++ b/src/commands/borealis-pg/psql.test.ts @@ -398,7 +398,7 @@ describe('interactive psql command', () => { test.stdout() .stderr() .command(['borealis-pg:psql', '--app', fakeHerokuAppName, '--port', 'port-must-be-an-integer']) - .catch('Value "port-must-be-an-integer" is not a valid integer') + .catch(/.*Expected an integer but received: port-must-be-an-integer.*/) .it('rejects a custom port that is not an integer', () => { verify(mockTcpServerFactoryType.create(anyFunction())).never() verify(mockSshClientFactoryType.create()).never() @@ -406,8 +406,8 @@ describe('interactive psql command', () => { test.stdout() .stderr() - .command(['borealis-pg:psql', '-a', fakeHerokuAppName, '-p', '-1']) - .catch('Value -1 is outside the range of valid port numbers') + .command(['borealis-pg:psql', '-a', fakeHerokuAppName, '-p', '0']) + .catch(/.*Expected an integer greater than or equal to 1 but received: 0.*/) .it('rejects a custom port that is less than 1', () => { verify(mockTcpServerFactoryType.create(anyFunction())).never() verify(mockSshClientFactoryType.create()).never() @@ -416,7 +416,7 @@ describe('interactive psql command', () => { test.stdout() .stderr() .command(['borealis-pg:psql', '-a', fakeHerokuAppName, '-p', '65536']) - .catch('Value 65536 is outside the range of valid port numbers') + .catch(/.*Expected an integer less than or equal to 65535 but received: 65536.*/) .it('rejects a custom port that is greater than 65535', () => { verify(mockTcpServerFactoryType.create(anyFunction())).never() verify(mockSshClientFactoryType.create()).never() diff --git a/src/commands/borealis-pg/psql.ts b/src/commands/borealis-pg/psql.ts index 66afc58..f42a65f 100644 --- a/src/commands/borealis-pg/psql.ts +++ b/src/commands/borealis-pg/psql.ts @@ -70,7 +70,7 @@ pgAdmin).` } async run() { - const {flags} = this.parse(PsqlCommand) + const {flags} = await this.parse(PsqlCommand) const customBinaryPath = flags[binaryPathOptionName] if (customBinaryPath && !fs.existsSync(customBinaryPath)) { diff --git a/src/commands/borealis-pg/run.test.ts b/src/commands/borealis-pg/run.test.ts index f0690c3..25089bd 100644 --- a/src/commands/borealis-pg/run.test.ts +++ b/src/commands/borealis-pg/run.test.ts @@ -456,7 +456,7 @@ describe('noninteractive run command', () => { expect(ctx.stdout).to.contain( ' id value1 value2 \n' + ' ── ────── ────── \n' + - ' 21 test1 null \n' + + ' 21 test1 \n' + ' 33 test2 test3 \n') expect(ctx.stdout).to.contain('(2 rows)') @@ -641,7 +641,7 @@ describe('noninteractive run command', () => { ' ─── ──── \n' + ' 9 val1 \n' + ' 104 val2 \n' + - ' 23 null \n' + + ' 23 \n' + ' 1 one \n') expect(ctx.stdout).to.contain('(4 rows)') @@ -908,7 +908,7 @@ describe('noninteractive run command', () => { '--shell-cmd', fakeShellCommand, ]) - .catch('Value "port-must-be-an-integer" is not a valid integer') + .catch(/.*Expected an integer but received: port-must-be-an-integer.*/) .it('rejects a --port value that is not an integer', () => { verify(mockTcpServerFactoryType.create(anyFunction())).never() verify(mockSshClientFactoryType.create()).never() @@ -918,7 +918,7 @@ describe('noninteractive run command', () => { .stdout() .stderr() .command(['borealis-pg:run', '-a', fakeHerokuAppName, '-p', '-1', '-e', fakeShellCommand]) - .catch('Value -1 is outside the range of valid port numbers') + .catch(/.*Expected an integer greater than or equal to 1 but received: -1.*/) .it('rejects a --port value that is less than 1', () => { verify(mockTcpServerFactoryType.create(anyFunction())).never() verify(mockSshClientFactoryType.create()).never() @@ -928,7 +928,7 @@ describe('noninteractive run command', () => { .stdout() .stderr() .command(['borealis-pg:run', '-a', fakeHerokuAppName, '-p', '65536', '-e', fakeShellCommand]) - .catch('Value 65536 is outside the range of valid port numbers') + .catch(/.*Expected an integer less than or equal to 65535 but received: 65536.*/) .it('rejects a --port value that is greater than 65535', () => { verify(mockTcpServerFactoryType.create(anyFunction())).never() verify(mockSshClientFactoryType.create()).never() @@ -948,7 +948,7 @@ describe('noninteractive run command', () => { .stderr() .command( ['borealis-pg:run', '-a', fakeHerokuAppName, '-e', fakeShellCommand, '-d', fakeDbCommand]) - .catch('--shell-cmd= cannot also be provided when using --db-cmd=') + .catch(/.*--shell-cmd=my-cool-shell-command cannot also be provided when using --db-cmd.*/) .it('exits with an error if both a shell command and a database command are provided', ctx => { expect(ctx.stdout).to.equal('') }) @@ -964,7 +964,7 @@ describe('noninteractive run command', () => { '--format', 'yaml', ]) - .catch('--shell-cmd= cannot also be provided when using --format=') + .catch(/.*--shell-cmd=my-cool-shell-command cannot also be provided when using --format.*/) .it('exits with an error if the --format option is specified for a shell command', ctx => { expect(ctx.stdout).to.equal('') }) diff --git a/src/commands/borealis-pg/run.ts b/src/commands/borealis-pg/run.ts index 15d4200..0a4da72 100644 --- a/src/commands/borealis-pg/run.ts +++ b/src/commands/borealis-pg/run.ts @@ -1,7 +1,7 @@ import color from '@heroku-cli/color' import {Command, flags} from '@heroku-cli/command' import {ConfigVars} from '@heroku-cli/schema' -import cli from 'cli-ux' +import {CliUx} from '@oclif/core' import {readFileSync} from 'fs' import {HTTP, HTTPError} from 'http-call' import {QueryResult} from 'pg' @@ -121,7 +121,7 @@ like pgAdmin).` } async run() { - const {flags} = this.parse(RunCommand) + const {flags} = await this.parse(RunCommand) const shellCommand = flags[shellCommandOptionName] if ( @@ -305,7 +305,7 @@ like pgAdmin).` }, {}) - cli.table( + CliUx.ux.table( resultInstance.rows, columns, {'no-truncate': true, output: outputFormat}) diff --git a/src/commands/borealis-pg/tunnel.test.ts b/src/commands/borealis-pg/tunnel.test.ts index 0033357..e1a4679 100644 --- a/src/commands/borealis-pg/tunnel.test.ts +++ b/src/commands/borealis-pg/tunnel.test.ts @@ -228,7 +228,7 @@ describe('secure tunnel command', () => { }) defaultTestContext - .command(['borealis-pg:tunnel', '-a', fakeHerokuAppName, '--port', '15432']) + .command(['borealis-pg:tunnel', '-a', fakeHerokuAppName, '--port', '65535']) .it('outputs DB connection instructions for a custom DB port option', ctx => { verify(mockSshClientType.on(anyString(), anyFunction())).once() const [event, listener] = capture(mockSshClientType.on).last() @@ -240,10 +240,10 @@ describe('secure tunnel command', () => { expect(ctx.stdout).to.containIgnoreSpaces(`Username: ${fakePgReadonlyUsername}`) expect(ctx.stdout).to.containIgnoreSpaces(`Password: ${fakePgPassword}`) expect(ctx.stdout).to.containIgnoreSpaces(`Host: ${localPgHostname}`) - expect(ctx.stdout).to.containIgnoreSpaces('Port: 15432') + expect(ctx.stdout).to.containIgnoreSpaces('Port: 65535') expect(ctx.stdout).to.containIgnoreSpaces(`Database name: ${fakePgDbName}`) expect(ctx.stdout).to.containIgnoreSpaces( - `URL: postgres://${fakePgReadonlyUsername}:${fakePgPassword}@${localPgHostname}:15432/${fakePgDbName}`) + `URL: postgres://${fakePgReadonlyUsername}:${fakePgPassword}@${localPgHostname}:65535/${fakePgDbName}`) expect(ctx.stdout).to.containIgnoreCase('Ctrl+C') }) @@ -307,7 +307,7 @@ describe('secure tunnel command', () => { .stdout() .stderr() .command(['borealis-pg:tunnel', '-a', fakeHerokuAppName, '--port', 'not-an-integer']) - .catch('Value "not-an-integer" is not a valid integer') + .catch(/.*Expected an integer but received: not-an-integer.*/) .it('rejects a --port value that is not an integer', () => { verify(mockTcpServerFactoryType.create(anyFunction())).never() verify(mockSshClientFactoryType.create()).never() @@ -317,7 +317,7 @@ describe('secure tunnel command', () => { .stdout() .stderr() .command(['borealis-pg:tunnel', '-a', fakeHerokuAppName, '-p', '0']) - .catch('Value 0 is outside the range of valid port numbers') + .catch(/.*Expected an integer greater than or equal to 1 but received: 0.*/) .it('rejects a --port value that is less than 1', () => { verify(mockTcpServerFactoryType.create(anyFunction())).never() verify(mockSshClientFactoryType.create()).never() @@ -327,7 +327,7 @@ describe('secure tunnel command', () => { .stdout() .stderr() .command(['borealis-pg:tunnel', '-a', fakeHerokuAppName, '--port', '65536']) - .catch('Value 65536 is outside the range of valid port numbers') + .catch(/.*Expected an integer less than or equal to 65535 but received: 65536.*/) .it('rejects a --port value that is greater than 65535', () => { verify(mockTcpServerFactoryType.create(anyFunction())).never() verify(mockSshClientFactoryType.create()).never() diff --git a/src/commands/borealis-pg/tunnel.ts b/src/commands/borealis-pg/tunnel.ts index 92f14c5..c591d3f 100644 --- a/src/commands/borealis-pg/tunnel.ts +++ b/src/commands/borealis-pg/tunnel.ts @@ -64,7 +64,7 @@ ${consoleColours.cliCmdName('borealis-pg:psql')} command to launch an interactiv } async run() { - const {flags} = this.parse(TunnelCommand) + const {flags} = await this.parse(TunnelCommand) const attachmentInfo = await fetchAddonAttachmentInfo(this.heroku, flags.addon, flags.app, this.error) const {addonName} = processAddonAttachmentInfo(attachmentInfo, this.error) diff --git a/src/commands/borealis-pg/users/index.ts b/src/commands/borealis-pg/users/index.ts index 11624c1..8e0dc26 100644 --- a/src/commands/borealis-pg/users/index.ts +++ b/src/commands/borealis-pg/users/index.ts @@ -1,6 +1,6 @@ import color from '@heroku-cli/color' import {Command} from '@heroku-cli/command' -import cli from 'cli-ux' +import {CliUx} from '@oclif/core' import {HTTP, HTTPError} from 'http-call' import {applyActionSpinner} from '../../../async-actions' import {getBorealisPgApiUrl, getBorealisPgAuthHeader} from '../../../borealis-api' @@ -35,7 +35,7 @@ ${cliCmdColour('borealis-pg:users:reset')} command).` } async run() { - const {flags} = this.parse(ListUsersCommand) + const {flags} = await this.parse(ListUsersCommand) const authorization = await createHerokuAuth(this.heroku) const attachmentInfo = await fetchAddonAttachmentInfo(this.heroku, flags.addon, flags.app, this.error) @@ -64,7 +64,7 @@ ${cliCmdColour('borealis-pg:users:reset')} command).` }) this.log() - cli.table(normalizedUsers, columns, {'no-truncate': true}) + CliUx.ux.table(normalizedUsers, columns, {'no-truncate': true}) } else { this.warn('No users found') } diff --git a/src/commands/borealis-pg/users/reset.ts b/src/commands/borealis-pg/users/reset.ts index 33380ab..3f096ea 100644 --- a/src/commands/borealis-pg/users/reset.ts +++ b/src/commands/borealis-pg/users/reset.ts @@ -42,7 +42,7 @@ ${formatCliOptionName('personal-user')} option).` } async run() { - const {flags} = this.parse(ResetUsersCommand) + const {flags} = await this.parse(ResetUsersCommand) const authorization = await createHerokuAuth(this.heroku) const attachmentInfo = await fetchAddonAttachmentInfo(this.heroku, flags.addon, flags.app, this.error) diff --git a/yarn.lock b/yarn.lock index e49679a..abe5681 100644 --- a/yarn.lock +++ b/yarn.lock @@ -228,13 +228,14 @@ supports-color "^5.5.0" tslib "^1.9.3" -"@heroku-cli/command@^8.5.0": - version "8.5.0" - resolved "https://registry.npmjs.org/@heroku-cli/command/-/command-8.5.0.tgz" +"@heroku-cli/command@^9.0.1": + version "9.0.1" + resolved "https://registry.yarnpkg.com/@heroku-cli/command/-/command-9.0.1.tgz#b7717b5770966d7db59be67d0d624885e1985347" + integrity sha512-RyVK88qFcsUSuZob2nE1foVGk0pyyTFzkMq8iBTuRPLfmyx/SpFaVX0jpkAnUbxMa6XAC1JwDHBkXMdM3yL/UQ== dependencies: "@heroku-cli/color" "^1.1.14" - "@oclif/errors" "^1.2.2" - cli-ux "^4.9.3" + "@oclif/core" "^1.20.4" + cli-ux "^6.0.9" debug "^4.1.1" fs-extra "^7.0.1" heroku-client "^3.1.0" @@ -306,7 +307,7 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@oclif/command@^1.8.14", "@oclif/command@^1.8.15", "@oclif/command@^1.8.21": +"@oclif/command@^1.8.14", "@oclif/command@^1.8.15": version "1.8.21" resolved "https://registry.yarnpkg.com/@oclif/command/-/command-1.8.21.tgz#32f876f8c02d61094b9693e34167e08fe67b6411" integrity sha512-kIDrRIbAcicVl+CWMzXeZkg5dRNuF1VI7koyFTAQMNYwRNZpeya5x7XDPr+fh7rDiBL7psnxc3B1+zoOWj96lQ== @@ -329,7 +330,7 @@ is-wsl "^2.1.1" tslib "^2.0.0" -"@oclif/config@^1.18.2", "@oclif/config@^1.18.6": +"@oclif/config@^1.18.2": version "1.18.6" resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.18.6.tgz#37367026b3110a2f04875509b1920a8ee4489f21" integrity sha512-OWhCpdu4QqggOPX1YPZ4XVmLLRX+lhGjXV6RNA7sogOwLqlEmSslnN/lhR5dkhcWZbKWBQH29YCrB3LDPRu/IA== @@ -341,6 +342,40 @@ is-wsl "^2.1.1" tslib "^2.3.1" +"@oclif/core@^1.1.1", "@oclif/core@^1.20.4", "@oclif/core@^1.26.1": + version "1.26.1" + resolved "https://registry.yarnpkg.com/@oclif/core/-/core-1.26.1.tgz#26e46c96143d3e2b1dd9bd558ae1653fe9a4f3fa" + integrity sha512-g+OWJcM7JOVI53caTEtq0BB1nPotWctRLUyFODPgvDqXhVR7QED+Qz3LwFAMD8dt7/Ar2ZNq15U3bnpnOv453A== + dependencies: + "@oclif/linewrap" "^1.0.0" + "@oclif/screen" "^3.0.4" + ansi-escapes "^4.3.2" + ansi-styles "^4.3.0" + cardinal "^2.1.1" + chalk "^4.1.2" + clean-stack "^3.0.1" + cli-progress "^3.10.0" + debug "^4.3.4" + ejs "^3.1.6" + fs-extra "^9.1.0" + get-package-type "^0.1.0" + globby "^11.1.0" + hyperlinker "^1.0.0" + indent-string "^4.0.0" + is-wsl "^2.2.0" + js-yaml "^3.14.1" + natural-orderby "^2.0.3" + object-treeify "^1.1.33" + password-prompt "^1.1.2" + semver "^7.3.7" + string-width "^4.2.3" + strip-ansi "^6.0.1" + supports-color "^8.1.1" + supports-hyperlinks "^2.2.0" + tslib "^2.4.1" + widest-line "^3.1.0" + wrap-ansi "^7.0.0" + "@oclif/core@^2.0.3": version "2.0.3" resolved "https://registry.yarnpkg.com/@oclif/core/-/core-2.0.3.tgz#ce71efbfc6e4c2655579ce81adce6471be2bc799" @@ -403,7 +438,7 @@ strip-ansi "^6.0.0" wrap-ansi "^7.0.0" -"@oclif/errors@^1.2.2", "@oclif/errors@^1.3.3", "@oclif/errors@^1.3.5", "@oclif/errors@^1.3.6": +"@oclif/errors@^1.3.3", "@oclif/errors@^1.3.5", "@oclif/errors@^1.3.6": version "1.3.6" resolved "https://registry.yarnpkg.com/@oclif/errors/-/errors-1.3.6.tgz#e8fe1fc12346cb77c4f274e26891964f5175f75d" integrity sha512-fYaU4aDceETd89KXP+3cLyg9EHZsLD3RxF2IU9yxahhBpspWjkWi3Dy3bTgcwZ3V47BgxQaGapzJWDM33XIVDQ== @@ -465,9 +500,15 @@ dependencies: "@oclif/core" "^2.0.3" -"@oclif/screen@^1.0.3", "@oclif/screen@^1.0.4": +"@oclif/screen@^1.0.4", "@oclif/screen@^1.0.4 ": version "1.0.4" - resolved "https://registry.npmjs.org/@oclif/screen/-/screen-1.0.4.tgz" + resolved "https://registry.yarnpkg.com/@oclif/screen/-/screen-1.0.4.tgz#b740f68609dfae8aa71c3a6cab15d816407ba493" + integrity sha512-60CHpq+eqnTxLZQ4PGHYNwUX572hgpMHGPtTWMjdTMsAvlm69lZV/4ly6O3sAYkomo4NggGcomrDpBe34rxUqw== + +"@oclif/screen@^3.0.4": + version "3.0.4" + resolved "https://registry.yarnpkg.com/@oclif/screen/-/screen-3.0.4.tgz#663db0ecaf23f3184e7f01886ed578060e4a7f1c" + integrity sha512-IMsTN1dXEXaOSre27j/ywGbBjrzx0FNd1XmuhCWCB9NTPrhWI1Ifbz+YLSEcstfQfocYsrbrIessxXb2oon4lA== "@oclif/test@^1.2.9": version "1.2.9" @@ -996,7 +1037,7 @@ cli-progress@^3.4.0: colors "^1.1.2" string-width "^4.2.0" -cli-ux@5.6.7, cli-ux@^5.6.7: +cli-ux@5.6.7: version "5.6.7" resolved "https://registry.npmjs.org/cli-ux/-/cli-ux-5.6.7.tgz" dependencies: @@ -1027,31 +1068,36 @@ cli-ux@5.6.7, cli-ux@^5.6.7: supports-hyperlinks "^2.1.0" tslib "^2.0.0" -cli-ux@^4.9.3: - version "4.9.3" - resolved "https://registry.npmjs.org/cli-ux/-/cli-ux-4.9.3.tgz" +cli-ux@^6.0.9: + version "6.0.9" + resolved "https://registry.yarnpkg.com/cli-ux/-/cli-ux-6.0.9.tgz#b5ab690314348b45b2c7458dad7621ae1be7c61d" + integrity sha512-0Ku29QLf+P6SeBNWM7zyoJ49eKKOjxZBZ4OH2aFeRtC0sNXU3ftdJxQPKJ1SJ+axX34I1NsfTFahpXdnxklZgA== dependencies: - "@oclif/errors" "^1.2.2" + "@oclif/core" "^1.1.1" "@oclif/linewrap" "^1.0.0" - "@oclif/screen" "^1.0.3" - ansi-escapes "^3.1.0" - ansi-styles "^3.2.1" + "@oclif/screen" "^1.0.4 " + ansi-escapes "^4.3.0" + ansi-styles "^4.2.0" cardinal "^2.1.1" - chalk "^2.4.1" - clean-stack "^2.0.0" - extract-stack "^1.0.0" - fs-extra "^7.0.0" + chalk "^4.1.0" + clean-stack "^3.0.0" + cli-progress "^3.10.0" + extract-stack "^2.0.0" + fs-extra "^8.1" hyperlinker "^1.0.0" - indent-string "^3.2.0" - is-wsl "^1.1.0" - lodash "^4.17.11" - password-prompt "^1.0.7" - semver "^5.6.0" - strip-ansi "^5.0.0" - supports-color "^5.5.0" - supports-hyperlinks "^1.0.1" - treeify "^1.1.0" - tslib "^1.9.3" + indent-string "^4.0.0" + is-wsl "^2.2.0" + js-yaml "^3.13.1" + lodash "^4.17.21" + natural-orderby "^2.0.1" + object-treeify "^1.1.4" + password-prompt "^1.1.2" + semver "^7.3.2" + string-width "^4.2.0" + strip-ansi "^6.0.0" + supports-color "^8.1.0" + supports-hyperlinks "^2.1.0" + tslib "^2.0.0" cliui@^6.0.0: version "6.0.0" @@ -1489,11 +1535,6 @@ execa@^0.10.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -extract-stack@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/extract-stack/-/extract-stack-1.0.0.tgz" - integrity "sha1-uXrK+UQe6iMyUpYktzL8WhyBZfo= sha512-M5Ge0JIrn12EtIVpje2G+hI5X78hmX4UDzynZ7Vnp1MiPSqleEonmgr2Rh59eygEEgq3YJ1GDP96rnM8tnVg/Q==" - extract-stack@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/extract-stack/-/extract-stack-2.0.0.tgz" @@ -1624,7 +1665,7 @@ fs-extra@^6.0.1: jsonfile "^4.0.0" universalify "^0.1.0" -fs-extra@^7.0.0, fs-extra@^7.0.1: +fs-extra@^7.0.1: version "7.0.1" resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz" dependencies: @@ -1756,11 +1797,6 @@ graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0: version "4.2.6" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz" -has-flag@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz" - integrity "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE= sha512-P+1n3MnwjR/Epg9BBo1KT8qbye2g2Ou4sFumihwt6I4tsUX7jnLcX4BTOSKg/B1ZrIYMN9FcEnG4x5a7NB8Eng==" - has-flag@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" @@ -1851,11 +1887,6 @@ imurmurhash@^0.1.4: resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz" integrity "sha1-khi5srkoojixPcT7a21XbyMUU+o= sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==" -indent-string@^3.2.0: - version "3.2.0" - resolved "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz" - integrity "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= sha512-BYqTHXTGUIvg7t1r4sJNKcbDZkL92nkXA8YtRpbjFHRHGDL/NtUeiBJMeE60kIFN/Mg8ESaWQvftaYMGJzQZCQ==" - indent-string@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz" @@ -2463,7 +2494,7 @@ parse-json@^5.0.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" -password-prompt@^1.0.7, password-prompt@^1.1.2: +password-prompt@^1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/password-prompt/-/password-prompt-1.1.2.tgz" dependencies: @@ -2761,7 +2792,7 @@ safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" -"semver@2 || 3 || 4 || 5", semver@^5.5.0, semver@^5.6.0: +"semver@2 || 3 || 4 || 5", semver@^5.5.0: version "5.7.1" resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" @@ -2946,7 +2977,7 @@ supports-color@8.1.1, supports-color@^8.1.0, supports-color@^8.1.1: dependencies: has-flag "^4.0.0" -supports-color@^5.0.0, supports-color@^5.3.0, supports-color@^5.5.0: +supports-color@^5.3.0, supports-color@^5.5.0: version "5.5.0" resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" dependencies: @@ -2958,13 +2989,6 @@ supports-color@^7.0.0, supports-color@^7.1.0: dependencies: has-flag "^4.0.0" -supports-hyperlinks@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-1.0.1.tgz" - dependencies: - has-flag "^2.0.0" - supports-color "^5.0.0" - supports-hyperlinks@^2.1.0, supports-hyperlinks@^2.2.0: version "2.2.0" resolved "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz" @@ -3031,10 +3055,6 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -treeify@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/treeify/-/treeify-1.1.0.tgz" - ts-mockito@^2.6.1: version "2.6.1" resolved "https://registry.npmjs.org/ts-mockito/-/ts-mockito-2.6.1.tgz"