From d26260b8e8cea5a3fdb7c3ec3d1403ec57b0bc78 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Mon, 21 Oct 2024 11:06:14 -0600 Subject: [PATCH] chore: review code --- src/commands/org/list/auth.ts | 18 +++++++-------- yarn.lock | 41 +++++++---------------------------- 2 files changed, 16 insertions(+), 43 deletions(-) diff --git a/src/commands/org/list/auth.ts b/src/commands/org/list/auth.ts index 67fd8856..89c09b09 100644 --- a/src/commands/org/list/auth.ts +++ b/src/commands/org/list/auth.ts @@ -38,18 +38,16 @@ export default class ListAuth extends SfCommand { }); const hasErrors = auths.filter((auth) => !!auth.error).length > 0; - this.table({ - data: mappedAuths, - columns: [ - { key: 'alias', name: 'ALIAS' }, - { key: 'username', name: 'USERNAME' }, - { key: 'orgId', name: 'ORG ID' }, - { key: 'instanceUrl', name: 'INSTANCE URL' }, - { key: 'oauthMethod', name: 'AUTH METHOD' }, - ], + data: mappedAuths.map((auth) => ({ + ALIAS: auth.alias, + USERNAME: auth.username, + 'ORG ID': auth.orgId, + 'INSTANCE URL': auth.instanceUrl, + 'AUTH METHOD': auth.oauthMethod, + ...(hasErrors ? { error: { header: 'ERROR' } } : {}), + })), title: 'authenticated orgs', - ...(hasErrors ? { error: { header: 'ERROR' } } : {}), }); return mappedAuths; } catch (err) { diff --git a/yarn.lock b/yarn.lock index 9c10d331..0c36485a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1630,10 +1630,10 @@ debug "^4.3.7" handlebars "^4.7.8" -"@salesforce/plugin-info@^3.4.12": - version "3.4.12" - resolved "https://registry.yarnpkg.com/@salesforce/plugin-info/-/plugin-info-3.4.12.tgz#1f966843ebab900db0f113295e28f31b7f26a4f2" - integrity sha512-K5MIGQ14K9ZGMlyhGmI/nHh2vqOGFjopgvoAla4PAa5imARntd4P/blTCoJpT/R1G1aTuIzHVyZUcoC85ruJ+w== +"@salesforce/plugin-info@^3.4.9": + version "3.4.13" + resolved "https://registry.yarnpkg.com/@salesforce/plugin-info/-/plugin-info-3.4.13.tgz#61800dbbd45b4e90d9c835e8cefd37321c192953" + integrity sha512-nKyDyDFytwzXbj0jhjjrsMpku6qpj08t3ljir9v/OfGIk+9M7SRrPPnxZmwNzqCAR3uJDyitNGCDiQVyD4ndAA== dependencies: "@inquirer/input" "^2.3.0" "@jsforce/jsforce-node" "^3.2.2" @@ -1658,7 +1658,7 @@ resolved "https://registry.yarnpkg.com/@salesforce/schemas/-/schemas-1.9.0.tgz#ba477a112653a20b4edcf989c61c57bdff9aa3ca" integrity sha512-LiN37zG5ODT6z70sL1fxF7BQwtCX9JOWofSU8iliSNIM+WDEeinnoFtVqPInRSNt8I0RiJxIKCrqstsmQRBNvA== -"@salesforce/sf-plugins-core@^11.3.10", "@salesforce/sf-plugins-core@^11.3.12", "@salesforce/sf-plugins-core@^11.3.5": +"@salesforce/sf-plugins-core@^11.3.12", "@salesforce/sf-plugins-core@^11.3.5": version "11.3.12" resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-11.3.12.tgz#18b3a553688428bcffea9d36abc72847497f06ae" integrity sha512-hi8EcSoRHRxj4sm/V5YDtzq9bPr/cKpM4fC6abo/jRzpXygwizinc2gVQkXfVdhjK7NGMskVRQB1N+0TThG7bA== @@ -7310,16 +7310,7 @@ stack-utils@^2.0.6: dependencies: escape-string-regexp "^2.0.0" -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -7387,14 +7378,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -7966,7 +7950,7 @@ workerpool@^6.5.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544" integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -7984,15 +7968,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"