Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

g2-ops-config

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

g2-ops-config - npm Package Compare versions

Comparing version 0.0.25 to 0.0.26

owner.md

23

dist/index.js

@@ -27,2 +27,18 @@ 'use strict';

/**
* Date util for logging
*/
var getDate = function getDate() {
var d = new Date();
var YYYY = d.getFullYear();
var MM = ('' + d.getMonth()).padStart(2, '0');
var DD = ('' + d.getDate()).padStart(2, '0');
var hh = d.getHours();
var mm = d.getMinutes();
var ss = d.getSeconds();
var SSS = ('' + d.getMilliseconds()).padStart(2, '0');
return YYYY + '-' + MM + '-' + DD + ' ' + hh + ':' + mm + ':' + ss + '.' + SSS;
};
/**
* Is the config server params that the config server needs to respond.

@@ -48,3 +64,4 @@ */

if (!configParams.application || !configParams.endpoint || !configParams.profiles) {
throw new Error('process.env[application || endpoint || profiles] are not present');
console.log(getDate() + ' [ERROR] process.env[application || endpoint || profiles] are not present, config url will be empty');
return '';
}

@@ -100,6 +117,6 @@ return 'http://' + configParams.auth.user + ':' + configParams.auth.pass + '@' + configParams.endpoint + '/' + application + '/' + profile;

return Promise.all(yamlPromises).then(function (data) {
console.log(JSON.stringify(data));
console.log(getDate() + ' [INFO] ' + JSON.stringify(data));
return transformYamlResponse(data, profiles);
}).catch(function (err) {
console.log(err);
console.log(getDate() + ' [ERROR] ' + err);
});

@@ -106,0 +123,0 @@ }

4

package.json
{
"name": "g2-ops-config",
"version": "0.0.25",
"description": "To fetch and maintain cloud configs for difference projects",
"version": "0.0.26",
"description": "To fetch and maintain cloud configs for different projects",
"main": "dist/index.js",

@@ -6,0 +6,0 @@ "scripts": {

@@ -15,2 +15,18 @@ // @flow

/**
* Date util for logging
*/
const getDate = () => {
const d = new Date()
const YYYY = d.getFullYear()
const MM = `${d.getMonth()}`.padStart(2, '0')
const DD = `${d.getDate()}`.padStart(2, '0')
const hh = d.getHours()
const mm = d.getMinutes()
const ss = d.getSeconds()
const SSS = `${d.getMilliseconds()}`.padStart(2, '0')
return `${YYYY}-${MM}-${DD} ${hh}:${mm}:${ss}.${SSS}`
}
/**
* Is the config server params that the config server needs to respond.

@@ -20,3 +36,3 @@ */

application: process.env.SPRING_APPLICATION_NAME,
endpoint: (process.env.CONFIGSERVER_NAME).replace(/http.*:\/\//g, ''),
endpoint: process.env.CONFIGSERVER_NAME.replace(/http.*:\/\//g, ''),
profiles: process.env.PROFILES.split(','),

@@ -36,3 +52,6 @@ auth: {

if (!configParams.application || !configParams.endpoint || !configParams.profiles) {
throw new Error('process.env[application || endpoint || profiles] are not present')
console.log(
`${getDate()} [ERROR] process.env[application || endpoint || profiles] are not present, config url will be empty`
)
return ''
}

@@ -95,7 +114,7 @@ return `http://${configParams.auth.user}:${configParams.auth.pass}@${configParams.endpoint}/${application}/${profile}`

.then((data) => {
console.log(JSON.stringify(data))
console.log(`${getDate()} [INFO] ${JSON.stringify(data)}`)
return transformYamlResponse(data, profiles)
})
.catch((err) => {
console.log(err)
console.log(`${getDate()} [ERROR] ${err}`)
})

@@ -102,0 +121,0 @@ }

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