@configdn/configdn-js
Advanced tools
Comparing version 0.1.4 to 0.1.5
{ | ||
"name": "@configdn/configdn-js", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "ConfigDN JS Client", | ||
"main": "dist.browser/src/index.js", | ||
"types": "dist.browser/src/index.d.ts", | ||
"main": "dist/configdn-js.js", | ||
"module": "dist/configdn-js.esm.js", | ||
"typings": "dist/configdn-js.d.ts", | ||
"browser": { | ||
"./dist/configdn-js.js": "./dist/configdn-js.js", | ||
"./dist/configdn-js.esm.js": "./dist/configdn-js.esm.js" | ||
}, | ||
"scripts": { | ||
"build": "tsc -p tsconfig.json", | ||
"browser" : "tsc -p tsconfig.browser.json", | ||
"prepublish": "npm run build && npm run browser" | ||
"prepublishOnly": "npm run build", | ||
"build": "npm run build:clear && rollup -c --bundleConfigAsCjs", | ||
"build:watch": "tsc -w", | ||
"build:clear": "rimraf dist && rimraf tsconfig.tsbuildinfo" | ||
}, | ||
"browser": { | ||
"./dist/src/index.js": "./dist.browser/src/index.js", | ||
"./dist/src/index.d.ts": "./dist.browser/src/index.d.ts" | ||
}, | ||
"repository": { | ||
@@ -31,4 +33,10 @@ "type": "git", | ||
"devDependencies": { | ||
"typescript": "^5.1.6" | ||
"@rollup/plugin-node-resolve": "^13.3.0", | ||
"rimraf": "^5.0.1", | ||
"rollup-plugin-dts": "^4.2.2", | ||
"rollup-plugin-esbuild": "^4.9.1", | ||
"@rollup/plugin-json": "^6.0.0", | ||
"ts-loader": "^9.4.4", | ||
"typescript": "^4.1.0" | ||
} | ||
} |
import { Settings } from './settings'; | ||
import version from '../package.json'; | ||
import axios from 'axios'; | ||
@@ -31,7 +30,6 @@ interface KeyValuePair { | ||
async refreshConfig(errorOnFail: boolean = false): Promise<void> { | ||
await axios.request({ | ||
await fetch(this.settings.getEndpoint() + 'public_api/v1/get_config/', { | ||
method: 'GET', | ||
url: this.settings.getEndpoint() + 'public_api/v1/get_config/', | ||
headers: { | ||
'ConfigDN-Client-Version': 'ConfigDN-JS/' + version, | ||
'User-Agent': 'ConfigDN-JS/' + version, | ||
'Authorization': this.settings.getAuthKey(), | ||
@@ -41,3 +39,3 @@ 'Content-Type': 'application/json' | ||
}).then((response) => { | ||
const responseMap = new Map(Object.entries(response.data)); | ||
const responseMap = new Map(Object.entries(response.json())); | ||
if (!responseMap.get('s')) { | ||
@@ -58,3 +56,3 @@ if (errorOnFail) { | ||
/** | ||
* Gets the value for a key, if local congif is blank, will attempt to retrieve it first, if it's time to refresh, it will wait for refresh first | ||
* Gets the value for a key, if local config is blank, will attempt to retrieve it first, if it's time to refresh, it will wait for refresh first | ||
* @param key Key to get value for | ||
@@ -61,0 +59,0 @@ * @param defaultValue Default value to return, cannot be null |
@@ -7,2 +7,4 @@ { | ||
"module": "es2015", | ||
"declaration": false, | ||
"declarationMap": false, | ||
"moduleResolution": "node", | ||
@@ -9,0 +11,0 @@ "resolveJsonModule": true, |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
45223
7
15
473
3