@studio/lambda
Advanced tools
@@ -16,3 +16,3 @@ name: Build | ||
| matrix: | ||
| node-version: ['12.x', '14.x'] | ||
| node-version: ['16.x', '18.x'] | ||
@@ -19,0 +19,0 @@ steps: |
+23
-0
| # Changes | ||
| ## 4.0.0 | ||
| - 💥 [`8be1398`](https://github.com/javascript-studio/studio-lambda/commit/8be1398865ee2b415d8fd04436068d495ac586ea) | ||
| Require node 16 | ||
| - 💥 [`496cc52`](https://github.com/javascript-studio/studio-lambda/commit/496cc525838552e0284f740d07d9c5620233366e) | ||
| Use dynamic import to support loading es modules | ||
| - 💥 [`d458059`](https://github.com/javascript-studio/studio-lambda/commit/d4580593c68ef845a236c03a7be02a6bffbb181a) | ||
| Change generic destroy error code to `E_FAILED` | ||
| - 🛡 [`8a6a3b3`](https://github.com/javascript-studio/studio-lambda/commit/8a6a3b35a5d28e21502cdbad8140039b8341196f) | ||
| npm audit | ||
| - ✨ [`6814ed2`](https://github.com/javascript-studio/studio-lambda/commit/6814ed26f83fdec1807e14b42d2a5c8a12afe973) | ||
| Update Studio Changes | ||
| - ✨ [`0d942b9`](https://github.com/javascript-studio/studio-lambda/commit/0d942b9a8733808958dfec9d6f2071901dc8b597) | ||
| Upgrade referee-sinon | ||
| - ✨ [`673cc02`](https://github.com/javascript-studio/studio-lambda/commit/673cc0266bdaf961fd8d688d96f0bb6b0221f469) | ||
| Update prettier | ||
| - ✨ [`5c264ff`](https://github.com/javascript-studio/studio-lambda/commit/5c264ff5560fc7eb4b518f8f3dfd455f9438d6da) | ||
| Upgrade mocha | ||
| - ✨ [`bf9897b`](https://github.com/javascript-studio/studio-lambda/commit/bf9897bc9a2317d3224b0cf4a0abff5e82872c0c) | ||
| Upgrade eslint-config and eslint | ||
| _Released by [Maximilian Antoni](https://github.com/mantoni) on 2023-01-19._ | ||
| ## 3.0.2 | ||
@@ -4,0 +27,0 @@ |
+2
-2
@@ -42,3 +42,3 @@ /* | ||
| try { | ||
| // eslint-disable-next-line node/no-sync | ||
| // eslint-disable-next-line n/no-sync | ||
| str = fs.readFileSync(path.join(base_dir, config_file), 'utf8'); | ||
@@ -129,3 +129,3 @@ } catch (e) { | ||
| if (fn) { | ||
| fn(JSON.stringify({ code: 'ERR_FAILED' })); | ||
| fn(JSON.stringify({ code: 'E_FAILED' })); | ||
| } | ||
@@ -132,0 +132,0 @@ }); |
+13
-11
@@ -6,3 +6,3 @@ /* | ||
| const lambda_module = require(`${process.cwd()}/${process.argv[2]}`); | ||
| const lambda_promise = import(`${process.cwd()}/${process.argv[2]}`); | ||
@@ -35,13 +35,15 @@ function setGetRemainingTimeInMillis(context) { | ||
| if (lambda_module.handle.length === 3) { | ||
| lambda_module.handle(m.event, context, handleResponse); | ||
| return; | ||
| } | ||
| lambda_promise.then((lambda_module) => { | ||
| if (lambda_module.handle.length === 3) { | ||
| lambda_module.handle(m.event, context, handleResponse); | ||
| return; | ||
| } | ||
| lambda_module | ||
| .handle(m.event, context) | ||
| .then((data) => { | ||
| handleResponse(null, data); | ||
| }) | ||
| .catch(handleResponse); | ||
| lambda_module | ||
| .handle(m.event, context) | ||
| .then((data) => { | ||
| handleResponse(null, data); | ||
| }) | ||
| .catch(handleResponse); | ||
| }); | ||
| }); |
+8
-10
| { | ||
| "name": "@studio/lambda", | ||
| "version": "3.0.2", | ||
| "version": "4.0.0", | ||
| "description": "JavaScript Studio lambda execution environment", | ||
@@ -9,3 +9,3 @@ "author": "Maximilian Antoni <max@javascript.studio>", | ||
| "engines": { | ||
| "node": ">=12.0.0" | ||
| "node": ">=16.0.0" | ||
| }, | ||
@@ -31,11 +31,9 @@ "scripts": { | ||
| "devDependencies": { | ||
| "@sinonjs/referee-sinon": "^9.0.2", | ||
| "@studio/changes": "^2.1.0", | ||
| "@studio/eslint-config": "^2.0.0", | ||
| "eslint": "^7.24.0", | ||
| "eslint-plugin-mocha": "^8.1.0", | ||
| "eslint-plugin-node": "^11.1.0", | ||
| "mocha": "^8.3.2", | ||
| "prettier": "^2.2.1" | ||
| "@sinonjs/referee-sinon": "^10.1.1", | ||
| "@studio/changes": "^2.2.0", | ||
| "@studio/eslint-config": "^4.0.1", | ||
| "eslint": "^8.32.0", | ||
| "mocha": "^10.2.0", | ||
| "prettier": "^2.8.3" | ||
| } | ||
| } |
@@ -5,5 +5,5 @@ 'use strict'; | ||
| setTimeout(() => { | ||
| // eslint-disable-next-line node/no-callback-literal | ||
| // eslint-disable-next-line n/no-callback-literal | ||
| callback('E_TOO_LATE'); | ||
| }, 200); | ||
| }; |
@@ -5,5 +5,5 @@ 'use strict'; | ||
| setTimeout(() => { | ||
| // eslint-disable-next-line node/no-callback-literal | ||
| // eslint-disable-next-line n/no-callback-literal | ||
| callback('E_TOO_LATE'); | ||
| }, 200); | ||
| }; |
@@ -582,3 +582,3 @@ 'use strict'; | ||
| lambda.invoke('throw', {}, (err) => { | ||
| assert.json(err, { code: 'ERR_FAILED' }); | ||
| assert.json(err, { code: 'E_FAILED' }); | ||
| done(); | ||
@@ -594,3 +594,3 @@ }); | ||
| lambda.invoke('throw-async', {}, (err) => { | ||
| assert.json(err, { code: 'ERR_FAILED' }); | ||
| assert.json(err, { code: 'E_FAILED' }); | ||
| done(); | ||
@@ -614,7 +614,7 @@ }); | ||
| const dir = `${__dirname}/fixture/functions/memory`; | ||
| // eslint-disable-next-line node/no-sync | ||
| // eslint-disable-next-line n/no-sync | ||
| fs.readdirSync(dir) | ||
| .filter((file) => file.startsWith('report.')) | ||
| .forEach((file) => { | ||
| // eslint-disable-next-line node/no-sync | ||
| // eslint-disable-next-line n/no-sync | ||
| fs.unlinkSync(`${dir}/${file}`); | ||
@@ -634,3 +634,3 @@ }); | ||
| lambda.invoke('memory', {}, (err) => { | ||
| assert.json(err, { code: 'ERR_FAILED' }); | ||
| assert.json(err, { code: 'E_FAILED' }); | ||
| done(); | ||
@@ -648,3 +648,3 @@ }); | ||
| lambda.invoke('memory', {}, (err) => { | ||
| assert.json(err, { code: 'ERR_FAILED' }); | ||
| assert.json(err, { code: 'E_FAILED' }); | ||
| done(); | ||
@@ -651,0 +651,0 @@ }); |
@@ -31,3 +31,3 @@ 'use strict'; | ||
| lambda.invoke('hello', { name: 'X' }, (err) => { | ||
| assert.json(err, { code: 'ERR_FAILED' }); | ||
| assert.json(err, { code: 'E_FAILED' }); | ||
@@ -34,0 +34,0 @@ const stats = lambda.stats(); |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 10 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 10 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
52804
2.67%6
-25%1291
0.16%33
-2.94%