@hyperone/cli-core
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -36,8 +36,2 @@ import openapi from './lib/openapi'; | ||
program.addCommand(new Category({ | ||
name: 'config', | ||
summary: 'Management of CLI configuration', | ||
extensions: ['cli-ext-config'], | ||
})); | ||
return { | ||
@@ -44,0 +38,0 @@ program, |
@@ -1,20 +0,10 @@ | ||
import { get, set, unset } from './transform'; | ||
export default (device) => { | ||
const config = device.configLoad() || { | ||
parameter: { | ||
location: { | ||
value: 'pl-waw-1', | ||
}, | ||
}, | ||
}; | ||
const api = {}; | ||
api.get = async (key, defaultValue) => get(await config, key, defaultValue); | ||
api.set = async (key, value) => set(await config, key, value); | ||
api.unset = async key => unset(await config, key); | ||
api.store = async () => device.configSave(await config); | ||
api.all = () => config; | ||
api.get = (key, defaultValue) => device.configGet(key, defaultValue); | ||
api.set = (key, value) => device.configSet(key, value); | ||
api.unset = key => device.configUnset(key); | ||
api.store = () => device.configStore(); | ||
api.all = () => device.configLoad(); | ||
return api; | ||
}; | ||
@@ -6,3 +6,3 @@ import fetch from 'node-fetch'; | ||
const baseRequest = async (method, uri, {json, headers, body, query}={}) => { | ||
const baseRequest = async (method, uri, { json, headers, body, query } = {}) => { | ||
headers = { | ||
@@ -17,2 +17,5 @@ ...headers, | ||
} | ||
if (query) { | ||
uri = `${uri}?${new URLSearchParams(query)}`; | ||
} | ||
@@ -19,0 +22,0 @@ uri = device.mapUrl(uri); |
{ | ||
"name": "@hyperone/cli-core", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "", | ||
@@ -8,3 +8,3 @@ "main": "index.js", | ||
"@apidevtools/json-schema-ref-parser": "^9.0.3", | ||
"@hyperone/cli-framework": "^1.0.2", | ||
"@hyperone/cli-framework": "^1.0.3", | ||
"camel-case": "^4.1.1", | ||
@@ -30,3 +30,3 @@ "command-line-args": "^5.1.1", | ||
"license": "MIT", | ||
"gitHead": "a1f4646802ff375cf76525b67a8defdfba6cc5a4" | ||
"gitHead": "a29a3896594a8d151caddae859dbbd9a50969fe6" | ||
} |
24988
627