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

@packt/ssm-helper

Package Overview
Dependencies
Maintainers
6
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@packt/ssm-helper - npm Package Compare versions

Comparing version 0.0.1 to 0.0.4

.nyc_output/41f4c2d9-07f5-486c-959a-3d62a1ce1fb5.json

3

bin/export.bin.js

@@ -19,2 +19,3 @@ #!/usr/bin/env node

const SSMhelper = require('../dist').default;
const path = require('path');

@@ -45,3 +46,3 @@ // Debug

const availableEnvs = Fs.existsSync(commander.envVariables)
? require(commander.envVariables)
? require(path.resolve(commander.envVariables))
: commander.envVariables.split(',');

@@ -48,0 +49,0 @@

@@ -1,21 +0,5 @@

'use strict';
"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _debug = _interopRequireDefault(require("debug"));
var _awsSdk = _interopRequireDefault(require("aws-sdk"));
var _joi = _interopRequireDefault(require("joi"));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
Object.defineProperty(exports, "__esModule", {
value: true
});
var _debug = require('debug');
var _debug2 = _interopRequireDefault(_debug);
var _awsSdk = require('aws-sdk');
var _awsSdk2 = _interopRequireDefault(_awsSdk);
var _joi = require('joi');
var _joi2 = _interopRequireDefault(_joi);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
class SSMHelper {

@@ -25,10 +9,10 @@ constructor(params) {

this.logger = {
error: (0, _debug2.default)('ssm-helper:error'),
info: (0, _debug2.default)('ssm-helper:info')
};
const joiValidation = _joi2.default.validate(config, {
OFFLINE: _joi2.default.boolean(),
stage: _joi2.default.string(),
region: _joi2.default.string()
});
error: (0, _debug.default)('ssm-helper:error'),
info: (0, _debug.default)('ssm-helper:info') };
const joiValidation = _joi.default.validate(config, {
OFFLINE: _joi.default.boolean(),
stage: _joi.default.string(),
region: _joi.default.string() });
if (joiValidation.error) {

@@ -45,6 +29,6 @@ this.logger.error('Invalid Config Object');

this.region = config.region || 'eu-west-1';
this.ssm = new _awsSdk2.default.SSM({
this.ssm = new _awsSdk.default.SSM({
apiVersion: '2014-11-06',
region: this.region
});
region: this.region });
}

@@ -57,8 +41,10 @@

Name: stageKey,
WithDecryption: true
}).promise().then(result => {
WithDecryption: true }).
promise().
then(result => {
this.logger.info(`Response for ${stageKey}`);
this.logger.info(result);
return result.Parameter.Value;
}).catch(error => {
}).
catch(error => {
this.logger.error(error);

@@ -84,4 +70,5 @@ return Promise.reject(error);

Value: keyValue, /* required */
Overwrite: true
}).promise().catch(error => {
Overwrite: true }).
promise().
catch(error => {
this.logger.error(error);

@@ -95,4 +82,3 @@ return Promise.reject(error);

return Promise.resolve(process.env[keyName]);
}
}
exports.default = SSMHelper;
}}exports.default = SSMHelper;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJTU01IZWxwZXIiLCJjb25zdHJ1Y3RvciIsInBhcmFtcyIsImNvbmZpZyIsImxvZ2dlciIsImVycm9yIiwiaW5mbyIsImpvaVZhbGlkYXRpb24iLCJKb2kiLCJ2YWxpZGF0ZSIsIk9GRkxJTkUiLCJib29sZWFuIiwic3RhZ2UiLCJzdHJpbmciLCJyZWdpb24iLCJ2YWx1ZSIsIkVycm9yIiwic3NtIiwiQVdTIiwiU1NNIiwiYXBpVmVyc2lvbiIsImdldCIsImtleU5hbWUiLCJzdGFnZUtleSIsInRvVXBwZXJDYXNlIiwiZ2V0UGFyYW1ldGVyIiwiTmFtZSIsIldpdGhEZWNyeXB0aW9uIiwicHJvbWlzZSIsInRoZW4iLCJyZXN1bHQiLCJQYXJhbWV0ZXIiLCJWYWx1ZSIsImNhdGNoIiwiUHJvbWlzZSIsInJlamVjdCIsInByb2Nlc3MiLCJlbnYiLCJyZXNvbHZlIiwic2V0Iiwia2V5VmFsdWUiL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2NhbCBFTlY6ICR7a2V5TmFtZX0gPSAke3Byb2Nlc3MuZW52W2tleU5hbWVdfWApO1xuICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUocHJvY2Vzcy5lbnZba2V5TmFtZV0pO1xuICB9XG59XG4iXX0=
{
"name": "@packt/ssm-helper",
"version": "0.0.1",
"version": "0.0.4",
"description": "Module and CLI tool to help handle SSM variables",

@@ -13,4 +13,4 @@ "main": "dist/index.js",

"lint": "eslint ./src",
"coverage": "babel-node ./node_modules/babel-istanbul/lib/cli.js check-coverage --statements 95 --functions 95 --branches 95 --lines 95",
"unit": "babel-node ./node_modules/babel-istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha -- test/*.js",
"coverage": "nyc npm run unit",
"unit": "./node_modules/.bin/mocha --require @babel/register --timeout 5s",
"prepublishOnly": "npm run test && npm run build"

@@ -20,3 +20,3 @@ },

"type": "git",
"url": "git@bitbucket.org:packt-internal/ssm-helper.git"
"url": "git@github.com:PacktDev/ssm-helper.git"
},

@@ -34,31 +34,33 @@ "author": {

"license": "Apache-2.0",
"homepage": "https://bitbucket.org/packt-internal/ssm-helper",
"homepage": "https://github.com/PacktDev/ssm-helper",
"devDependencies": {
"aws-sdk-mock": "4.1.0",
"babel-cli": "6.26.0",
"babel-core": "6.26.3",
"babel-istanbul": "0.12.2",
"babel-loader": "7.1.4",
"@babel/cli": "7.4.4",
"@babel/core": "7.4.5",
"@babel/node": "7.4.5",
"@babel/preset-env": "7.4.5",
"@babel/register": "7.4.4",
"aws-sdk-mock": "4.5.0",
"babel-loader": "8.0.6",
"babel-preset-env": "1.7.0",
"chai": "4.1.2",
"chai": "4.2.0",
"chai-as-promised": "7.1.1",
"chai-bytes": "0.1.1",
"eslint": "4.19.1",
"eslint-config-airbnb-base": "12.1.0",
"eslint-plugin-import": "2.12.0",
"istanbul": "0.4.5",
"mocha": "5.1.1",
"mocha-bamboo-reporter": "1.1.1",
"sinon": "4.5.0",
"chai-bytes": "0.1.2",
"eslint": "6.0.1",
"eslint-config-airbnb-base": "13.1.0",
"eslint-plugin-import": "2.18.0",
"mocha": "6.1.4",
"mocha-bamboo-reporter": "1.1.2",
"nyc": "14.1.1",
"sinon": "7.3.2",
"uuid": "3.3.2",
"webpack": "4.12.0",
"webpack-cli": "3.0.8"
"webpack": "4.35.0",
"webpack-cli": "3.3.5"
},
"dependencies": {
"@packt/error-custom": "0.1.2",
"aws-sdk": "2.318.0",
"commander": "2.18.0",
"debug": "4.0.1",
"joi": "13.6.0"
"@packt/error-custom": "0.1.3",
"aws-sdk": "^2.484.0",
"commander": "2.20.0",
"debug": "4.1.1",
"joi": "14.3.1"
}
}

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