lambda-toolkit 2.0.0-dev.0 → 2.0.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +11 -12
- package/dist/index.mjs +11 -12
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -39,7 +39,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
39
39
|
|
|
40
40
|
// EXPORTS
|
|
41
41
|
__webpack_require__.d(__webpack_exports__, {
|
|
42
|
-
LambdaApi: () => (/* reexport */
|
|
42
|
+
LambdaApi: () => (/* reexport */ LambdaApi),
|
|
43
43
|
array: () => (/* reexport */ array_namespaceObject),
|
|
44
44
|
aws: () => (/* reexport */ aws_namespaceObject),
|
|
45
45
|
epoch: () => (/* reexport */ epoch_namespaceObject),
|
|
@@ -50,13 +50,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
50
50
|
utils: () => (/* reexport */ utils_namespaceObject)
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
-
// NAMESPACE OBJECT: ./src/lambda_api/index.js
|
|
54
|
-
var src_lambda_api_namespaceObject = {};
|
|
55
|
-
__webpack_require__.r(src_lambda_api_namespaceObject);
|
|
56
|
-
__webpack_require__.d(src_lambda_api_namespaceObject, {
|
|
57
|
-
LambdaApi: () => (LambdaApi)
|
|
58
|
-
});
|
|
59
|
-
|
|
60
53
|
// NAMESPACE OBJECT: ./src/array/index.js
|
|
61
54
|
var array_namespaceObject = {};
|
|
62
55
|
__webpack_require__.r(array_namespaceObject);
|
|
@@ -564,7 +557,14 @@ class LambdaApi {
|
|
|
564
557
|
/**
|
|
565
558
|
* Creates a new Lambda Api
|
|
566
559
|
*
|
|
567
|
-
* @param {Object}
|
|
560
|
+
* @param {Object} args
|
|
561
|
+
* @param {Object} [args.headers={}] Any headers to be included in all responses. Defaults to none.
|
|
562
|
+
* @param {'camelcase'|'snakecase'} [args.transformRequest=false]
|
|
563
|
+
* Transform the request query string, parameters and body to camelCase or snake_case.
|
|
564
|
+
* Defaults to no transformation.
|
|
565
|
+
* @param {'camelcase'|'snakecase'} [args.transformResponse=false]
|
|
566
|
+
* Transform the response body to camelCase or snake_case
|
|
567
|
+
* Defaults to no transformation.
|
|
568
568
|
*/
|
|
569
569
|
constructor( { headers = {}, transformRequest = false, transformResponse = false } = {} ) {
|
|
570
570
|
Validator.transformRequest( transformRequest );
|
|
@@ -617,10 +617,9 @@ class LambdaApi {
|
|
|
617
617
|
* Register an automatic error code response for given error class (constructor name)
|
|
618
618
|
*
|
|
619
619
|
* @param {Object} args
|
|
620
|
-
* @param {string} args.code The HTTP status code to return
|
|
621
620
|
* @param {class} args.errorType The error class
|
|
621
|
+
* @param {number} args.code The HTTP status code to return
|
|
622
622
|
* @param {string} [args.message=null] Optional message to return for the status code, if not present will default to Error.message
|
|
623
|
-
* @param {message} [args.errorType] And optional message to display
|
|
624
623
|
*/
|
|
625
624
|
addErrorHandler( { errorType, code, message = null } = {} ) {
|
|
626
625
|
Validator.statusCode( code );
|
|
@@ -629,7 +628,7 @@ class LambdaApi {
|
|
|
629
628
|
}
|
|
630
629
|
|
|
631
630
|
/**
|
|
632
|
-
* Init the flow using a given AWS Lambda APIGateway event
|
|
631
|
+
* Init the flow using a given AWS Lambda APIGateway event
|
|
633
632
|
*
|
|
634
633
|
* @param {Object} ApiGatewayPayload The raw API Gateway event
|
|
635
634
|
* @returns {Object} The http response with status, body and headers
|
package/dist/index.mjs
CHANGED
|
@@ -49,13 +49,6 @@ import { unzipSync as __WEBPACK_EXTERNAL_MODULE_node_zlib_38f1fbfb_unzipSync__ }
|
|
|
49
49
|
/************************************************************************/
|
|
50
50
|
var __webpack_exports__ = {};
|
|
51
51
|
|
|
52
|
-
// NAMESPACE OBJECT: ./src/lambda_api/index.js
|
|
53
|
-
var src_lambda_api_namespaceObject = {};
|
|
54
|
-
__webpack_require__.r(src_lambda_api_namespaceObject);
|
|
55
|
-
__webpack_require__.d(src_lambda_api_namespaceObject, {
|
|
56
|
-
LambdaApi: () => (LambdaApi)
|
|
57
|
-
});
|
|
58
|
-
|
|
59
52
|
// NAMESPACE OBJECT: ./src/array/index.js
|
|
60
53
|
var array_namespaceObject = {};
|
|
61
54
|
__webpack_require__.r(array_namespaceObject);
|
|
@@ -563,7 +556,14 @@ class LambdaApi {
|
|
|
563
556
|
/**
|
|
564
557
|
* Creates a new Lambda Api
|
|
565
558
|
*
|
|
566
|
-
* @param {Object}
|
|
559
|
+
* @param {Object} args
|
|
560
|
+
* @param {Object} [args.headers={}] Any headers to be included in all responses. Defaults to none.
|
|
561
|
+
* @param {'camelcase'|'snakecase'} [args.transformRequest=false]
|
|
562
|
+
* Transform the request query string, parameters and body to camelCase or snake_case.
|
|
563
|
+
* Defaults to no transformation.
|
|
564
|
+
* @param {'camelcase'|'snakecase'} [args.transformResponse=false]
|
|
565
|
+
* Transform the response body to camelCase or snake_case
|
|
566
|
+
* Defaults to no transformation.
|
|
567
567
|
*/
|
|
568
568
|
constructor( { headers = {}, transformRequest = false, transformResponse = false } = {} ) {
|
|
569
569
|
Validator.transformRequest( transformRequest );
|
|
@@ -616,10 +616,9 @@ class LambdaApi {
|
|
|
616
616
|
* Register an automatic error code response for given error class (constructor name)
|
|
617
617
|
*
|
|
618
618
|
* @param {Object} args
|
|
619
|
-
* @param {string} args.code The HTTP status code to return
|
|
620
619
|
* @param {class} args.errorType The error class
|
|
620
|
+
* @param {number} args.code The HTTP status code to return
|
|
621
621
|
* @param {string} [args.message=null] Optional message to return for the status code, if not present will default to Error.message
|
|
622
|
-
* @param {message} [args.errorType] And optional message to display
|
|
623
622
|
*/
|
|
624
623
|
addErrorHandler( { errorType, code, message = null } = {} ) {
|
|
625
624
|
Validator.statusCode( code );
|
|
@@ -628,7 +627,7 @@ class LambdaApi {
|
|
|
628
627
|
}
|
|
629
628
|
|
|
630
629
|
/**
|
|
631
|
-
* Init the flow using a given AWS Lambda APIGateway event
|
|
630
|
+
* Init the flow using a given AWS Lambda APIGateway event
|
|
632
631
|
*
|
|
633
632
|
* @param {Object} ApiGatewayPayload The raw API Gateway event
|
|
634
633
|
* @returns {Object} The http response with status, body and headers
|
|
@@ -2258,4 +2257,4 @@ const untarJsonGz = raw =>
|
|
|
2258
2257
|
|
|
2259
2258
|
|
|
2260
2259
|
|
|
2261
|
-
export {
|
|
2260
|
+
export { LambdaApi, array_namespaceObject as array, aws_namespaceObject as aws, epoch_namespaceObject as epoch, math_namespaceObject as math, object_namespaceObject as object, redis_namespaceObject as redis, string_namespaceObject as string, utils_namespaceObject as utils };
|