queue-run-lambda
Advanced tools
Comparing version
{ | ||
"name": "queue-run-lambda", | ||
"version": "0.3.0", | ||
"main": "dist/index.js", | ||
"directories": { | ||
"lib": "dist" | ||
"version": "0.4.0", | ||
"module": "dist/index.mjs", | ||
"exports": { | ||
".": "./dist/index.mjs" | ||
}, | ||
"type": "module", | ||
"scripts": { | ||
"build": "rm -rf dist && yarn build:bundle", | ||
"build:bundle": "yarn esbuild src/index.ts --bundle --platform=node --target=node14 --outfile=dist/index.js --external:queue-run", | ||
"build:bundle": "yarn esbuild src/index.ts --bundle --platform=node --target=node14 --outfile=dist/index.mjs --format=esm --inject:./src/require_shim.js --sourcemap --external:queue-run", | ||
"lint": "yarn eslint src/**/*.ts", | ||
"prepare": "yarn build", | ||
"watch": "yarn build:bundle --watch" | ||
"watch": "rm -rf dist && yarn build:bundle --watch" | ||
}, | ||
@@ -19,5 +20,5 @@ "files": [ | ||
], | ||
"dependencies": { | ||
"@aws-sdk/client-sqs": "^3.45.0", | ||
"queue-run": "^0.3.0", | ||
"devDependencies": { | ||
"@aws-sdk/client-sqs": "^3.46.0", | ||
"queue-run": "^0.4.0", | ||
"tiny-invariant": "^1.2.0" | ||
@@ -28,3 +29,3 @@ }, | ||
}, | ||
"gitHead": "b8f105c221b1723761dc0054cfb9c676ca8773c1" | ||
"gitHead": "b13af8e75d525406ba60cef32d56e8e85d3a1202" | ||
} |
@@ -6,3 +6,1 @@ # Severless Runtime using AWS Lambda | ||
It uses Lambda for all backends, SQS for queues, API Gateway for HTTP and WebSockets, and DynamoDB for WS sessions. | ||
When you use `npx queue-run setup` it deploys this runtime as a Lambda Layer "qr-runtime". |
@@ -100,7 +100,6 @@ import { | ||
const hasBody = method !== "GET" && method !== "HEAD"; | ||
const body = hasBody | ||
? event.body && event.isBase64Encoded | ||
const body = | ||
hasBody && event.body && event.isBase64Encoded | ||
? Buffer.from(event.body, "base64") | ||
: event.body | ||
: undefined; | ||
: event.body ?? null; | ||
return new Request(url, { body, headers, method }); | ||
@@ -111,3 +110,3 @@ } else { | ||
const body = | ||
hasBody && event.body ? Buffer.from(event.body, "base64") : undefined; | ||
hasBody && event.body ? Buffer.from(event.body, "base64") : null; | ||
return new Request(url, { body, headers, method }); | ||
@@ -159,3 +158,3 @@ } | ||
? "" | ||
: (await response.buffer()).toString("base64"), | ||
: Buffer.from(await response.arrayBuffer()).toString("base64"), | ||
isBase64Encoded: true, | ||
@@ -162,0 +161,0 @@ headers: Object.fromEntries(Array.from(response.headers.entries())), |
@@ -8,2 +8,4 @@ import { LocalStorage } from "queue-run"; | ||
): Promise<APIGatewayResponse> { | ||
console.log(event); | ||
newLocalStorage(); | ||
return { | ||
@@ -10,0 +12,0 @@ statusCode: 200, |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 3 instances 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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
1726883
130.22%0
-100%11
22.22%16615
1.56%1
-83.33%Yes
NaN3
Infinity%6
-25%41
2.5%- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed