File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed
Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,8 @@ const ERROR_NO_MANIFEST_FILES = 'No manifest files found'
195195const ERROR_NO_PACKAGE_JSON = 'No package.json found'
196196const ERROR_NO_REPO_FOUND = 'No repo found'
197197const ERROR_NO_SOCKET_DIR = 'No .socket directory found'
198- const ERROR_UNABLE_RESOLVE_ORG = 'Unable to resolve a Socket account organization'
198+ const ERROR_UNABLE_RESOLVE_ORG =
199+ 'Unable to resolve a Socket account organization'
199200const EXT_YAML = '.yaml'
200201const EXT_YML = '.yml'
201202const FLAG_CONFIG = '--config'
Original file line number Diff line number Diff line change @@ -34,7 +34,9 @@ export interface LocalConfig {
3434 org ?: string | undefined
3535}
3636
37- const sensitiveConfigKeyLookup : Set < keyof LocalConfig > = new Set ( [ CONFIG_KEY_API_TOKEN ] )
37+ const sensitiveConfigKeyLookup : Set < keyof LocalConfig > = new Set ( [
38+ CONFIG_KEY_API_TOKEN ,
39+ ] )
3840
3941const supportedConfig : Map < keyof LocalConfig , string > = new Map ( [
4042 [ CONFIG_KEY_API_BASE_URL , 'Base URL of the Socket API endpoint' ] ,
@@ -101,7 +103,11 @@ function normalizeConfigKey(
101103 // property apiKey, we'll copy that to apiToken and delete the old property.
102104 // We added `org` as a convenience alias for `defaultOrg`
103105 const normalizedKey =
104- key === 'apiKey' ? CONFIG_KEY_API_TOKEN : key === CONFIG_KEY_ORG ? CONFIG_KEY_DEFAULT_ORG : key
106+ key === 'apiKey'
107+ ? CONFIG_KEY_API_TOKEN
108+ : key === CONFIG_KEY_ORG
109+ ? CONFIG_KEY_DEFAULT_ORG
110+ : key
105111 if ( ! isSupportedConfigKey ( normalizedKey ) ) {
106112 return {
107113 ok : false ,
Original file line number Diff line number Diff line change @@ -22,14 +22,16 @@ const TOKEN_VISIBLE_LENGTH = 5
2222// The Socket API server that should be used for operations.
2323export function getDefaultApiBaseUrl ( ) : string | undefined {
2424 const baseUrl =
25- constants . ENV . SOCKET_CLI_API_BASE_URL || getConfigValueOrUndef ( CONFIG_KEY_API_BASE_URL )
25+ constants . ENV . SOCKET_CLI_API_BASE_URL ||
26+ getConfigValueOrUndef ( CONFIG_KEY_API_BASE_URL )
2627 return isUrl ( baseUrl ) ? baseUrl : undefined
2728}
2829
2930// The Socket API server that should be used for operations.
3031export function getDefaultProxyUrl ( ) : string | undefined {
3132 const apiProxy =
32- constants . ENV . SOCKET_CLI_API_PROXY || getConfigValueOrUndef ( CONFIG_KEY_API_PROXY )
33+ constants . ENV . SOCKET_CLI_API_PROXY ||
34+ getConfigValueOrUndef ( CONFIG_KEY_API_PROXY )
3335 return isUrl ( apiProxy ) ? apiProxy : undefined
3436}
3537
You can’t perform that action at this time.
0 commit comments