1- /*
2- import color from '@heroku-cli/color'
1+ import { color } from '@heroku-cli/color'
32import type { AddOnAttachment } from '@heroku-cli/schema'
4- import {ux} from '@oclif/core'
5- import type {ExtendedAddonAttachment} from '@heroku/heroku-cli-util'
6- import {renderAttachment} from '../../commands/addons'
7- import {multiSortCompareFn} from '../utils/multisort'
8- import type {CredentialsInfo} from './types'
3+ import { hux } from '@heroku/heroku-cli-util'
4+ import { renderAttachment } from '../../commands/addons/index.js'
5+ import { multiSortCompareFn } from '../utils/multisort.js'
6+ import type { CredentialsInfo } from './types.js'
97import { utils } from '@heroku/heroku-cli-util'
10- import type {ExtendedAddon} from './types'
11-
12- export const essentialNumPlan = (addon: ExtendedAddonAttachment['addon'] | ExtendedAddon) => Boolean(addon?.plan?.name?.split(':')[1].match(/^essential/))
13- export const legacyEssentialPlan = (addon: ExtendedAddonAttachment['addon'] | ExtendedAddon) => Boolean(addon?.plan?.name?.split(':')[1].match(/(dev|basic|mini)$/))
14-
15- export function essentialPlan(addon: ExtendedAddonAttachment['addon'] | ExtendedAddon) {
16- return essentialNumPlan(addon) || legacyEssentialPlan(addon)
17- }
188
199export function formatResponseWithCommands ( response : string ) : string {
2010 return response . replace ( / ` ( .* ?) ` / g, ( _ , word ) => color . cmd ( word ) )
@@ -53,7 +43,10 @@ export function presentCredentialAttachments(app: string, credAttachments: Requi
5343 if ( connectionInformationAvailable ) {
5444 const prefix = ' '
5545 rotationLines . push ( `${ prefix } Usernames currently active for this credential:` )
56- ux.table(formatted, {
46+ const printLine = ( line : unknown ) => {
47+ rotationLines . push ( line as string )
48+ }
49+ hux . table ( formatted , {
5750 user : {
5851 get ( row : typeof formatted [ 0 ] ) {
5952 return `${ prefix } ${ row . user } `
@@ -70,10 +63,7 @@ export function presentCredentialAttachments(app: string, credAttachments: Requi
7063 } ,
7164 } ,
7265 } , {
73- 'no-header': true,
74- printLine(line: unknown): void {
75- rotationLines.push(line)
76- },
66+ printLine,
7767 } )
7868 }
7969 }
@@ -121,4 +111,3 @@ export const databaseNameFromUrl = (uri: string, config: Record<string, string>)
121111 const conn = utils . pg . DatabaseResolver . parsePostgresConnectionString ( uri )
122112 return `${ conn . host } :${ conn . port } ${ conn . pathname } `
123113}
124- */
0 commit comments