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

@evervault/sdk

Package Overview
Dependencies
Maintainers
7
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@evervault/sdk - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

cage-lock.json

38

lib/index.js

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

const { Datatypes, errors } = require('./utils');
const { Datatypes, errors, sourceParser, cageLock, deploy, environment } = require('./utils');
const Config = require('./config');

@@ -49,2 +49,38 @@ const { Crypto, Http } = require('./core');

/**
*
* @param {Function} func
* @returns {Function}
*/
cagify(func) {
if (!Datatypes.isFunction(func)) {
throw new errors.EvervaultError('Cagify must be provided with a function to run');
}
const { cageName, functionRequires, functionParameters } = sourceParser.parseSource(func);
if (cageLock.deployCheck(cageName)) {
console.log(`Deploying cage ${cageName}`);
const { deployedBy, deployedTeam } = deploy.runDeployment(cageName, func, functionParameters, functionRequires);
cageLock.addCageToLockfile(cageName, deployedBy, deployedTeam);
}
return async (...parameters) => {
const data = {};
parameters.forEach((param, index) => {
data[functionParameters[index]] = param;
})
const runtimeObject = {
environment: await this.encrypt(environment.getEnvironment(func)),
data
};
const result = await this.run(cageName, runtimeObject);
if (result.statusCode === 404) throw new errors.EvervaultError('API key mismatch: please ensure you have switched to your app\'s team in the CLI');
return result.result;
};
}
/**
*

@@ -51,0 +87,0 @@ * @param {String} cageName

@@ -11,2 +11,3 @@ const isArray = (data) => data.constructor.name === 'Array';

const isBoolean = (data) => typeof data === 'boolean';
const isFunction = (data) => typeof data === 'function';

@@ -64,2 +65,3 @@ const isEncryptable = (data) =>

isString,
isFunction,
isEncryptable,

@@ -66,0 +68,0 @@ getHeaderType,

module.exports = {
Datatypes: require('./datatypes'),
errors: require('./errors'),
sourceParser: require('./source'),
cageLock: require('./cagelock'),
environment: require('./environment'),
deploy: require('./deploy')
};
{
"name": "@evervault/sdk",
"version": "1.1.1",
"version": "1.1.2",
"description": "Node.js SDK for working with evervault cages",

@@ -26,2 +26,7 @@ "main": "lib/index.js",

"dependencies": {
"escodegen": "^1.14.3",
"esprima": "^4.0.1",
"haikunator": "^2.1.2",
"konan": "^2.1.1",
"lodash": "^4.17.19",
"phin": "^3.5.0",

@@ -28,0 +33,0 @@ "uuid": "^8.1.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