@zohocatalyst/catalyst-functions-utils
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "@zohocatalyst/catalyst-functions-utils", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "catalyst function utils", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
const UTIL = require('util'), QUERY_STRING = require('querystring'), URL = require('url'); | ||
const MAX_OUTPUT_SIZE = 1 * 1024; //1mb | ||
const CUSTOM_UTIL = require('./utils'); | ||
@@ -22,4 +23,5 @@ function constructBasicIO(RESPONSE, QUERY_STRING, BODY) { | ||
function constructApplicationContext(RESPONSE) { | ||
function constructApplicationContext(REQUEST, RESPONSE) { | ||
return { | ||
catalystHeaders: CUSTOM_UTIL.getCatalystHeaders(REQUEST), | ||
close: () => RESPONSE.end(), | ||
@@ -45,3 +47,3 @@ log: (...args) => console.log(...args) | ||
resolve([ | ||
constructApplicationContext(RESPONSE), | ||
constructApplicationContext(REQUEST, RESPONSE), | ||
constructBasicIO(RESPONSE, QUERY_STRING.parse(URL.parse(REQUEST.url).query), body) | ||
@@ -48,0 +50,0 @@ ]); |
@@ -1,2 +0,4 @@ | ||
function constructApplicationContext(RESPONSE) { | ||
const CUSTOM_UTIL = require('./utils'); | ||
function constructApplicationContext(REQUEST, RESPONSE) { | ||
const EVENT_FUNCTION_MAX_TIME_MS = process.env.CATALYST_MAX_TIMEOUT; | ||
@@ -8,2 +10,3 @@ const EVENT_FUNCTION_TIMEOUT_BUFFER_MS = 500; | ||
return { | ||
catalystHeaders: CUSTOM_UTIL.getCatalystHeaders(REQUEST), | ||
endWithSuccess: () => { | ||
@@ -61,3 +64,3 @@ RESPONSE.writeHead(200); | ||
constructEventDetails(body), | ||
constructApplicationContext(RESPONSE) | ||
constructApplicationContext(REQUEST, RESPONSE) | ||
]); | ||
@@ -64,0 +67,0 @@ }); |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
7256
8
174
3