@@ -29,9 +29,7 @@ const createBody = (body: string | null, isBase64Encoded: boolean) => {
29
29
* @param event - The API Gateway proxy event
30
30
* @returns A Web API Request object
31
31
*/
32
- export const proxyEventToWebRequest = (
33
- event : APIGatewayProxyEvent
34
- ) : Request => {
32
+ const proxyEventToWebRequest = ( event : APIGatewayProxyEvent ) : Request => {
35
33
const { httpMethod, path } = event ;
36
34
const { domainName } = event . requestContext ;
37
35
@@ -79,7 +77,7 @@ export const proxyEventToWebRequest = (
79
77
* @param response - The Web API Response object
80
78
* @returns An API Gateway proxy result
81
79
*/
82
- export const webResponseToProxyResult = async (
80
+ const webResponseToProxyResult = async (
83
81
response : Response
84
82
) : Promise < APIGatewayProxyResult > => {
85
83
const headers : Record < string , string > = { } ;
@@ -136,10 +134,9 @@ export const webResponseToProxyResult = async (
136
134
* Handles APIGatewayProxyResult, Response objects, and plain objects.
137
135
*
138
136
* @param response - The handler response (APIGatewayProxyResult, Response, or plain object)
139
- * @param headers - Optional headers to be included in the response
140
- * @returns A Web API Response object
137
+ * @param resHeaders - Optional headers to be included in the response
141
138
*/
142
- export const handlerResultToWebResponse = (
139
+ const handlerResultToWebResponse = (
143
140
response : HandlerResponse ,
144
141
resHeaders ?: Headers
145
142
) : Response => {
@@ -188,7 +185,7 @@ export const handlerResultToWebResponse = (
188
185
* @param statusCode - The response status code to return
189
186
* @returns An API Gateway proxy result
190
187
*/
191
- export const handlerResultToProxyResult = async (
188
+ const handlerResultToProxyResult = async (
192
189
response : HandlerResponse ,
193
190
statusCode : HttpStatusCode = HttpStatusCodes . OK
194
191
) : Promise < APIGatewayProxyResult > => {
@@ -205,3 +202,10 @@ export const handlerResultToProxyResult = async (
205
202
isBase64Encoded : false ,
206
203
} ;
207
204
} ;
205
+
206
+ export {
207
+ proxyEventToWebRequest ,
208
+ webResponseToProxyResult ,
209
+ handlerResultToWebResponse ,
210
+ handlerResultToProxyResult ,
211
+ } ;
0 commit comments