@evervault/sdk
Advanced tools
Comparing version 3.12.2 to 3.12.3
@@ -9,5 +9,3 @@ const crypto = require('crypto'); | ||
errors, | ||
sourceParser, | ||
cageLock, | ||
deploy, | ||
environment, | ||
@@ -307,66 +305,2 @@ validationHelper, | ||
/** | ||
* @param {String} cageName | ||
* @param {Function} func | ||
* @returns {Function} | ||
*/ | ||
cagify(cageName, func) { | ||
console.warn( | ||
'\x1b[43m\x1b[30mWARN\x1b[0m The `cagify` method is deprecated and slated for removal.' | ||
); | ||
if (!Datatypes.isFunction(func)) { | ||
throw new errors.EvervaultError( | ||
'Cagify must be provided with a function to run' | ||
); | ||
} | ||
if (!Datatypes.isString(cageName) || cageName.length === 0) { | ||
throw new errors.EvervaultError( | ||
'Cagify must be provided with a cage name to run' | ||
); | ||
} | ||
const { cageHash, functionRequires, functionParameters } = | ||
sourceParser.parseSource(func); | ||
if (cageLock.deployCheck(cageName, cageHash)) { | ||
const { deployedBy, deployedTeam, deployedVersion } = | ||
deploy.runDeployment( | ||
cageName, | ||
func, | ||
functionParameters, | ||
functionRequires | ||
); | ||
cageLock.addCageToLockfile( | ||
cageName, | ||
cageHash, | ||
deployedBy, | ||
deployedTeam, | ||
deployedVersion | ||
); | ||
} | ||
const cageVersion = cageLock.getLatestVersion(cageName); | ||
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, { | ||
'x-cage-version': cageVersion, | ||
}); | ||
if (result.statusCode === 404 || result.statusCode === 401) | ||
throw new errors.EvervaultError( | ||
"API key mismatch: please ensure you have switched to your app's team in the CLI" | ||
); | ||
return result.result; | ||
}; | ||
} | ||
/** | ||
* @param {String} functionName | ||
@@ -373,0 +307,0 @@ * @param {Object} data |
module.exports = { | ||
Datatypes: require('./datatypes'), | ||
errors: require('./errors'), | ||
sourceParser: require('./source'), | ||
cageLock: require('./cagelock'), | ||
environment: require('./environment'), | ||
deploy: require('./deploy'), | ||
certHelper: require('./certHelper'), | ||
@@ -9,0 +7,0 @@ validationHelper: require('./validationHelper'), |
{ | ||
"name": "@evervault/sdk", | ||
"version": "3.12.2", | ||
"version": "3.12.3", | ||
"description": "Node.js SDK for Evervault", | ||
@@ -36,7 +36,2 @@ "main": "lib/index.js", | ||
"crc-32": "^1.2.2", | ||
"escodegen": "^1.14.3", | ||
"esprima": "^4.0.1", | ||
"haikunator": "^2.1.2", | ||
"konan": "^2.1.1", | ||
"lodash": "^4.17.21", | ||
"phin": "^3.5.0", | ||
@@ -43,0 +38,0 @@ "uasn1": "^0.7.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
7
10
8
61697
28
1716
- Removedescodegen@^1.14.3
- Removedesprima@^4.0.1
- Removedhaikunator@^2.1.2
- Removedkonan@^2.1.1
- Removedlodash@^4.17.21
- Removed@babel/code-frame@7.26.2(transitive)
- Removed@babel/generator@7.26.2(transitive)
- Removed@babel/helper-string-parser@7.25.9(transitive)
- Removed@babel/helper-validator-identifier@7.25.9(transitive)
- Removed@babel/parser@7.26.2(transitive)
- Removed@babel/template@7.25.9(transitive)
- Removed@babel/traverse@7.25.9(transitive)
- Removed@babel/types@7.26.0(transitive)
- Removed@jridgewell/gen-mapping@0.3.5(transitive)
- Removed@jridgewell/resolve-uri@3.1.2(transitive)
- Removed@jridgewell/set-array@1.2.1(transitive)
- Removed@jridgewell/sourcemap-codec@1.5.0(transitive)
- Removed@jridgewell/trace-mapping@0.3.25(transitive)
- Removed@types/random-seed@0.3.5(transitive)
- Removeddeep-is@0.1.4(transitive)
- Removedescodegen@1.14.3(transitive)
- Removedesprima@4.0.1(transitive)
- Removedestraverse@4.3.0(transitive)
- Removedesutils@2.0.3(transitive)
- Removedfast-levenshtein@2.0.6(transitive)
- Removedglobals@11.12.0(transitive)
- Removedhaikunator@2.1.2(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedjsesc@3.0.2(transitive)
- Removedjson-stringify-safe@5.0.1(transitive)
- Removedkonan@2.1.1(transitive)
- Removedlevn@0.3.0(transitive)
- Removedlodash@4.17.21(transitive)
- Removedlodash.defaults@4.2.0(transitive)
- Removedoptionator@0.8.3(transitive)
- Removedpicocolors@1.1.1(transitive)
- Removedprelude-ls@1.1.2(transitive)
- Removedrandom-seed@0.3.0(transitive)
- Removedsource-map@0.6.1(transitive)
- Removedtype-check@0.3.2(transitive)
- Removedword-wrap@1.2.5(transitive)