@hyperone/cli-core
Advanced tools
Comparing version 2.0.13 to 2.0.14
@@ -14,8 +14,11 @@ import openapi from './lib/openapi'; | ||
export async function buildCli (options = {}) { | ||
export async function buildCli(options = {}) { | ||
const device = options.device; | ||
const config = options.config || cfg(device); | ||
try { | ||
await openapi.init(options); | ||
} catch (err) { | ||
return device.displayError(err); | ||
} | ||
await openapi.init(options); | ||
const program = new Category({ | ||
@@ -22,0 +25,0 @@ name: options.device.getName(), |
@@ -21,3 +21,6 @@ | ||
result.getConfiguration = async () => http.get(`${defaultAudience}/.well-known/openid-configuration`); | ||
result.getConfiguration = async () => { | ||
const resp = await http.get(`${defaultAudience}/.well-known/openid-configuration`); | ||
return resp.bodyJson; | ||
}; | ||
@@ -56,3 +59,3 @@ const refreshToken = async () => { | ||
const openid_configuration = await result.getConfiguration(); | ||
return http.post(openid_configuration.token_endpoint, { | ||
const resp = await http.post(openid_configuration.token_endpoint, { | ||
json: { | ||
@@ -69,2 +72,3 @@ ...{ | ||
}); | ||
return resp.bodyJson; | ||
}; | ||
@@ -71,0 +75,0 @@ |
{ | ||
"name": "@hyperone/cli-core", | ||
"version": "2.0.13", | ||
"version": "2.0.14", | ||
"description": "", | ||
@@ -8,3 +8,3 @@ "main": "index.js", | ||
"@apidevtools/json-schema-ref-parser": "^9.0.3", | ||
"@hyperone/cli-framework": "^2.0.13", | ||
"@hyperone/cli-framework": "^2.0.14", | ||
"abort-controller": "^3.0.0", | ||
@@ -31,3 +31,3 @@ "camel-case": "^4.1.1", | ||
"license": "MIT", | ||
"gitHead": "9f7621663b4418ffaf570e6a0d025f4b73ec2626" | ||
"gitHead": "8a06a2020264c832a69e967bf25996889b8c5820" | ||
} |
@@ -7,3 +7,5 @@ import jmespath from 'jmespath'; | ||
result = Array.isArray(result) ? result : [result]; | ||
result = jmespath.search(result, query); | ||
if (query) { | ||
result = jmespath.search(result, query); | ||
} | ||
return result; | ||
@@ -54,3 +56,2 @@ }; | ||
if (cmd.findCommand) return; | ||
cmd.options.push(...[ | ||
@@ -78,3 +79,3 @@ { | ||
const formatter = outputFormat[optsAll.output]; | ||
opts.format = (opts, output) => { | ||
opts.format = (output) => { | ||
if (output && output.headers && output.status) { | ||
@@ -91,3 +92,3 @@ if (output.bodyText) { | ||
} | ||
if (typeof output == 'string' || !optsAll.query) return output; | ||
if (typeof output == 'string') return output; | ||
return formatter(output, optsAll.query); | ||
@@ -94,0 +95,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28417
715