New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@configdn/configdn-js

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@configdn/configdn-js - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

2

dist/configdn-js.esm.js

@@ -1,2 +0,2 @@

import a from"axios";var h=Object.defineProperty,l=(i,e,t)=>e in i?h(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,n=(i,e,t)=>(l(i,typeof e!="symbol"?e+"":e,t),t);class g{constructor(e,t,s){n(this,"endpoint","https://cdn.configdn.com/"),n(this,"refreshInterval",60),n(this,"authKey",""),this.setAuthKey(e),this.setEndpoint(t),this.changeRefreshInterval(s)}setAuthKey(e){this.authKey=e}setEndpoint(e){const t=/[-a-zA-Z0-9@:%._\+~=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~?&//=]*)?/gi,s=new RegExp(t);e.match(s),e.endsWith("/")||(e+="/"),this.endpoint=e}changeRefreshInterval(e){if(Math.sign(e)!==1)throw new Error("New interval must be a positive integer");this.refreshInterval=e}getEndpoint(){return this.endpoint}getRefreshInterval(){return this.refreshInterval}getAuthKey(){return this.authKey}}var d="@configdn/configdn-js",c="0.2.0",f="ConfigDN JS Client",u="dist/configdn-js.js",p="dist/configdn-js.esm.js",v="dist/configdn-js.d.ts",m={"./dist/configdn-js.js":"./dist/configdn-js.js","./dist/configdn-js.esm.js":"./dist/configdn-js.esm.js"},b={prepublishOnly:"npm run build",build:"npm run build:clear && rollup -c --bundleConfigAsCjs","build:watch":"tsc -w","build:clear":"rimraf dist && rimraf tsconfig.tsbuildinfo"},w={type:"git",url:"git+https://github.com/dBuidl/ConfigDN-client-js.git"},y=[],j="Rishi<rishipanthee@ryamer.com>",C="MIT",D={url:"https://github.com/dBuidl/ConfigDN-client-js/issues"},I="https://github.com/dBuidl/ConfigDN-client-js#readme",A={axios:"^1.4.0"},E={"@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"},R={name:d,version:c,description:f,main:u,module:p,typings:v,browser:m,scripts:b,repository:w,keywords:y,author:j,license:C,bugs:D,homepage:I,dependencies:A,devDependencies:E},K=Object.defineProperty,N=(i,e,t)=>e in i?K(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,r=(i,e,t)=>(N(i,typeof e!="symbol"?e+"":e,t),t);class z{constructor(e,t="https://cdn.configdn.com/",s=60){r(this,"settings"),r(this,"lastUpdate"),r(this,"fetchedConfig",new Map),this.settings=new g(e,t,s),this.refreshConfig(!0),this.lastUpdate=Date.now()/1e3}async refreshConfig(e=!1){await a.request({method:"GET",url:this.settings.getEndpoint()+"public_api/v1/get_config/",headers:{"User-Agent":"ConfigDN-JS/"+R,Authorization:this.settings.getAuthKey(),"Content-Type":"application/json"}}).then(t=>{const s=new Map(Object.entries(t.data));if(!s.get("s")){if(e)throw new Error("Could not download config, problem: "+s.get("e"));return}const o=s.get("d");this.fetchedConfig=new Map(Object.entries(o))}).catch(t=>{throw new Error(t)})}async get(e,t=null){return(this.fetchedConfig.size===0||this.lastUpdate+this.settings.getRefreshInterval()>Date.now()/1e3)&&await this.refreshConfig(),this.getLocal(e,t)}getLocal(e,t=null){if(this.lastUpdate+this.settings.getRefreshInterval()>Date.now()/1e3&&this.refreshConfig(),this.fetchedConfig.has(e))return this.fetchedConfig.get(e).v;if(t!==null)return t;throw new Error("Key not in config")}changeRefreshInterval(e){this.settings.changeRefreshInterval(e)}}export{z as ConfigDN};
import a from"axios";var h=Object.defineProperty,l=(i,e,t)=>e in i?h(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,n=(i,e,t)=>(l(i,typeof e!="symbol"?e+"":e,t),t);class g{constructor(e,t,s){n(this,"endpoint","https://cdn.configdn.com/"),n(this,"refreshInterval",60),n(this,"authKey",""),this.setAuthKey(e),this.setEndpoint(t),this.changeRefreshInterval(s)}setAuthKey(e){this.authKey=e}setEndpoint(e){const t=/[-a-zA-Z0-9@:%._\+~=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~?&//=]*)?/gi,s=new RegExp(t);e.match(s),e.endsWith("/")||(e+="/"),this.endpoint=e}changeRefreshInterval(e){if(Math.sign(e)!==1)throw new Error("New interval must be a positive integer");this.refreshInterval=e}getEndpoint(){return this.endpoint}getRefreshInterval(){return this.refreshInterval}getAuthKey(){return this.authKey}}var d="@configdn/configdn-js",c="0.2.1",f="ConfigDN JS Client",u="dist/configdn-js.js",p="dist/configdn-js.esm.js",v="dist/configdn-js.d.ts",m={"./dist/configdn-js.js":"./dist/configdn-js.js","./dist/configdn-js.esm.js":"./dist/configdn-js.esm.js"},b={prepublishOnly:"npm run build",build:"npm run build:clear && rollup -c --bundleConfigAsCjs","build:watch":"tsc -w","build:clear":"rimraf dist && rimraf tsconfig.tsbuildinfo"},w={type:"git",url:"git+https://github.com/dBuidl/ConfigDN-client-js.git"},y=[],j="Rishi<rishipanthee@ryamer.com>",C="MIT",D={url:"https://github.com/dBuidl/ConfigDN-client-js/issues"},I="https://github.com/dBuidl/ConfigDN-client-js#readme",E={axios:"^1.4.0"},A={"@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"},R={name:d,version:c,description:f,main:u,module:p,typings:v,browser:m,scripts:b,repository:w,keywords:y,author:j,license:C,bugs:D,homepage:I,dependencies:E,devDependencies:A},K=Object.defineProperty,N=(i,e,t)=>e in i?K(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,r=(i,e,t)=>(N(i,typeof e!="symbol"?e+"":e,t),t);class z{constructor(e,t="https://cdn.configdn.com/",s=60){r(this,"settings"),r(this,"lastUpdate"),r(this,"fetchedConfig",new Map),this.settings=new g(e,t,s),this.refreshConfig(!0),this.lastUpdate=Date.now()/1e3}async refreshConfig(e=!1){await a.request({method:"GET",url:this.settings.getEndpoint()+"public_api/v1/get_config/",headers:{"X-ConfigDN-Version":"ConfigDN-JS/"+R,Authorization:this.settings.getAuthKey(),"Content-Type":"application/json"}}).then(t=>{const s=new Map(Object.entries(t.data));if(!s.get("s")){if(e)throw new Error("Could not download config, problem: "+s.get("e"));return}const o=s.get("d");this.fetchedConfig=new Map(Object.entries(o))}).catch(t=>{throw new Error(t)})}async get(e,t=null){return(this.fetchedConfig.size===0||this.lastUpdate+this.settings.getRefreshInterval()>Date.now()/1e3)&&await this.refreshConfig(),this.getLocal(e,t)}getLocal(e,t=null){if(this.lastUpdate+this.settings.getRefreshInterval()>Date.now()/1e3&&this.refreshConfig(),this.fetchedConfig.has(e))return this.fetchedConfig.get(e).v;if(t!==null)return t;throw new Error("Key not in config")}changeRefreshInterval(e){this.settings.changeRefreshInterval(e)}}export{z as ConfigDN};
//# sourceMappingURL=configdn-js.esm.js.map

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var a=require("axios");function h(i){return i&&typeof i=="object"&&"default"in i?i:{default:i}}var l=h(a),d=Object.defineProperty,g=(i,e,t)=>e in i?d(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,s=(i,e,t)=>(g(i,typeof e!="symbol"?e+"":e,t),t);class c{constructor(e,t,n){s(this,"endpoint","https://cdn.configdn.com/"),s(this,"refreshInterval",60),s(this,"authKey",""),this.setAuthKey(e),this.setEndpoint(t),this.changeRefreshInterval(n)}setAuthKey(e){this.authKey=e}setEndpoint(e){const t=/[-a-zA-Z0-9@:%._\+~=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~?&//=]*)?/gi,n=new RegExp(t);e.match(n),e.endsWith("/")||(e+="/"),this.endpoint=e}changeRefreshInterval(e){if(Math.sign(e)!==1)throw new Error("New interval must be a positive integer");this.refreshInterval=e}getEndpoint(){return this.endpoint}getRefreshInterval(){return this.refreshInterval}getAuthKey(){return this.authKey}}var u="@configdn/configdn-js",f="0.2.0",p="ConfigDN JS Client",v="dist/configdn-js.js",b="dist/configdn-js.esm.js",m="dist/configdn-js.d.ts",y={"./dist/configdn-js.js":"./dist/configdn-js.js","./dist/configdn-js.esm.js":"./dist/configdn-js.esm.js"},w={prepublishOnly:"npm run build",build:"npm run build:clear && rollup -c --bundleConfigAsCjs","build:watch":"tsc -w","build:clear":"rimraf dist && rimraf tsconfig.tsbuildinfo"},j={type:"git",url:"git+https://github.com/dBuidl/ConfigDN-client-js.git"},C=[],D="Rishi<rishipanthee@ryamer.com>",I="MIT",A={url:"https://github.com/dBuidl/ConfigDN-client-js/issues"},E="https://github.com/dBuidl/ConfigDN-client-js#readme",R={axios:"^1.4.0"},_={"@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"},K={name:u,version:f,description:p,main:v,module:b,typings:m,browser:y,scripts:w,repository:j,keywords:C,author:D,license:I,bugs:A,homepage:E,dependencies:R,devDependencies:_},N=Object.defineProperty,M=(i,e,t)=>e in i?N(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,r=(i,e,t)=>(M(i,typeof e!="symbol"?e+"":e,t),t);class O{constructor(e,t="https://cdn.configdn.com/",n=60){r(this,"settings"),r(this,"lastUpdate"),r(this,"fetchedConfig",new Map),this.settings=new c(e,t,n),this.refreshConfig(!0),this.lastUpdate=Date.now()/1e3}async refreshConfig(e=!1){await l.default.request({method:"GET",url:this.settings.getEndpoint()+"public_api/v1/get_config/",headers:{"User-Agent":"ConfigDN-JS/"+K,Authorization:this.settings.getAuthKey(),"Content-Type":"application/json"}}).then(t=>{const n=new Map(Object.entries(t.data));if(!n.get("s")){if(e)throw new Error("Could not download config, problem: "+n.get("e"));return}const o=n.get("d");this.fetchedConfig=new Map(Object.entries(o))}).catch(t=>{throw new Error(t)})}async get(e,t=null){return(this.fetchedConfig.size===0||this.lastUpdate+this.settings.getRefreshInterval()>Date.now()/1e3)&&await this.refreshConfig(),this.getLocal(e,t)}getLocal(e,t=null){if(this.lastUpdate+this.settings.getRefreshInterval()>Date.now()/1e3&&this.refreshConfig(),this.fetchedConfig.has(e))return this.fetchedConfig.get(e).v;if(t!==null)return t;throw new Error("Key not in config")}changeRefreshInterval(e){this.settings.changeRefreshInterval(e)}}exports.ConfigDN=O;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var a=require("axios");function h(i){return i&&typeof i=="object"&&"default"in i?i:{default:i}}var l=h(a),d=Object.defineProperty,g=(i,e,t)=>e in i?d(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,s=(i,e,t)=>(g(i,typeof e!="symbol"?e+"":e,t),t);class c{constructor(e,t,n){s(this,"endpoint","https://cdn.configdn.com/"),s(this,"refreshInterval",60),s(this,"authKey",""),this.setAuthKey(e),this.setEndpoint(t),this.changeRefreshInterval(n)}setAuthKey(e){this.authKey=e}setEndpoint(e){const t=/[-a-zA-Z0-9@:%._\+~=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~?&//=]*)?/gi,n=new RegExp(t);e.match(n),e.endsWith("/")||(e+="/"),this.endpoint=e}changeRefreshInterval(e){if(Math.sign(e)!==1)throw new Error("New interval must be a positive integer");this.refreshInterval=e}getEndpoint(){return this.endpoint}getRefreshInterval(){return this.refreshInterval}getAuthKey(){return this.authKey}}var u="@configdn/configdn-js",f="0.2.1",p="ConfigDN JS Client",v="dist/configdn-js.js",b="dist/configdn-js.esm.js",m="dist/configdn-js.d.ts",y={"./dist/configdn-js.js":"./dist/configdn-js.js","./dist/configdn-js.esm.js":"./dist/configdn-js.esm.js"},w={prepublishOnly:"npm run build",build:"npm run build:clear && rollup -c --bundleConfigAsCjs","build:watch":"tsc -w","build:clear":"rimraf dist && rimraf tsconfig.tsbuildinfo"},j={type:"git",url:"git+https://github.com/dBuidl/ConfigDN-client-js.git"},C=[],D="Rishi<rishipanthee@ryamer.com>",I="MIT",E={url:"https://github.com/dBuidl/ConfigDN-client-js/issues"},A="https://github.com/dBuidl/ConfigDN-client-js#readme",N={axios:"^1.4.0"},R={"@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"},_={name:u,version:f,description:p,main:v,module:b,typings:m,browser:y,scripts:w,repository:j,keywords:C,author:D,license:I,bugs:E,homepage:A,dependencies:N,devDependencies:R},K=Object.defineProperty,M=(i,e,t)=>e in i?K(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,r=(i,e,t)=>(M(i,typeof e!="symbol"?e+"":e,t),t);class O{constructor(e,t="https://cdn.configdn.com/",n=60){r(this,"settings"),r(this,"lastUpdate"),r(this,"fetchedConfig",new Map),this.settings=new c(e,t,n),this.refreshConfig(!0),this.lastUpdate=Date.now()/1e3}async refreshConfig(e=!1){await l.default.request({method:"GET",url:this.settings.getEndpoint()+"public_api/v1/get_config/",headers:{"X-ConfigDN-Version":"ConfigDN-JS/"+_,Authorization:this.settings.getAuthKey(),"Content-Type":"application/json"}}).then(t=>{const n=new Map(Object.entries(t.data));if(!n.get("s")){if(e)throw new Error("Could not download config, problem: "+n.get("e"));return}const o=n.get("d");this.fetchedConfig=new Map(Object.entries(o))}).catch(t=>{throw new Error(t)})}async get(e,t=null){return(this.fetchedConfig.size===0||this.lastUpdate+this.settings.getRefreshInterval()>Date.now()/1e3)&&await this.refreshConfig(),this.getLocal(e,t)}getLocal(e,t=null){if(this.lastUpdate+this.settings.getRefreshInterval()>Date.now()/1e3&&this.refreshConfig(),this.fetchedConfig.has(e))return this.fetchedConfig.get(e).v;if(t!==null)return t;throw new Error("Key not in config")}changeRefreshInterval(e){this.settings.changeRefreshInterval(e)}}exports.ConfigDN=O;
//# sourceMappingURL=configdn-js.js.map
{
"name": "@configdn/configdn-js",
"version": "0.2.0",
"version": "0.2.1",
"description": "ConfigDN JS Client",

@@ -5,0 +5,0 @@ "main": "dist/configdn-js.js",

@@ -35,3 +35,3 @@ import { Settings } from './settings';

headers: {
'User-Agent': 'ConfigDN-JS/' + version,
'X-ConfigDN-Version': 'ConfigDN-JS/' + version,
'Authorization': this.settings.getAuthKey(),

@@ -53,3 +53,3 @@ 'Content-Type': 'application/json'

throw new Error(err);
})
});
}

@@ -56,0 +56,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc