@h4ad/serverless-adapter 2.3.1 → 2.3.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/README.md +4 -260
- package/lib/@types/binary-settings.d.ts +24 -6
- package/lib/@types/binary-settings.d.ts.map +1 -0
- package/lib/@types/binary-settings.js +1 -0
- package/lib/@types/binary-settings.js.map +1 -0
- package/lib/@types/headers.d.ts +16 -3
- package/lib/@types/headers.d.ts.map +1 -0
- package/lib/@types/headers.js +1 -0
- package/lib/@types/headers.js.map +1 -0
- package/lib/@types/helpers.d.ts +4 -0
- package/lib/@types/helpers.d.ts.map +1 -0
- package/lib/@types/helpers.js +1 -0
- package/lib/@types/helpers.js.map +1 -0
- package/lib/@types/huawei/huawei-api-gateway-event.d.ts +62 -0
- package/lib/@types/huawei/huawei-api-gateway-event.d.ts.map +1 -0
- package/lib/@types/huawei/huawei-api-gateway-event.js +2 -0
- package/lib/@types/huawei/huawei-api-gateway-event.js.map +1 -0
- package/lib/@types/huawei/huawei-api-gateway-response.d.ts +20 -0
- package/lib/@types/huawei/huawei-api-gateway-response.d.ts.map +1 -0
- package/lib/@types/huawei/huawei-api-gateway-response.js +2 -0
- package/lib/@types/huawei/huawei-api-gateway-response.js.map +1 -0
- package/lib/@types/huawei/huawei-context.d.ts +157 -0
- package/lib/@types/huawei/huawei-context.d.ts.map +1 -0
- package/lib/@types/huawei/huawei-context.js +1 -0
- package/lib/@types/huawei/huawei-context.js.map +1 -0
- package/lib/@types/huawei/index.d.ts +1 -0
- package/lib/@types/huawei/index.d.ts.map +1 -0
- package/lib/@types/huawei/index.js +6 -1
- package/lib/@types/huawei/index.js.map +1 -0
- package/lib/@types/index.d.ts +2 -1
- package/lib/@types/index.d.ts.map +1 -0
- package/lib/@types/index.js +7 -2
- package/lib/@types/index.js.map +1 -0
- package/lib/adapters/aws/alb.adapter.d.ts +18 -10
- package/lib/adapters/aws/alb.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/alb.adapter.js +14 -9
- package/lib/adapters/aws/alb.adapter.js.map +1 -0
- package/lib/adapters/aws/api-gateway-v1.adapter.d.ts +20 -12
- package/lib/adapters/aws/api-gateway-v1.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/api-gateway-v1.adapter.js +19 -14
- package/lib/adapters/aws/api-gateway-v1.adapter.js.map +1 -0
- package/lib/adapters/aws/api-gateway-v2.adapter.d.ts +19 -11
- package/lib/adapters/aws/api-gateway-v2.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/api-gateway-v2.adapter.js +15 -10
- package/lib/adapters/aws/api-gateway-v2.adapter.js.map +1 -0
- package/lib/adapters/aws/dynamodb.adapter.d.ts +18 -10
- package/lib/adapters/aws/dynamodb.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/dynamodb.adapter.js +13 -8
- package/lib/adapters/aws/dynamodb.adapter.js.map +1 -0
- package/lib/adapters/aws/event-bridge.adapter.d.ts +21 -10
- package/lib/adapters/aws/event-bridge.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/event-bridge.adapter.js +13 -8
- package/lib/adapters/aws/event-bridge.adapter.js.map +1 -0
- package/lib/adapters/aws/index.d.ts +1 -0
- package/lib/adapters/aws/index.d.ts.map +1 -0
- package/lib/adapters/aws/index.js +6 -1
- package/lib/adapters/aws/index.js.map +1 -0
- package/lib/adapters/aws/lambda-edge.adapter.d.ts +76 -46
- package/lib/adapters/aws/lambda-edge.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/lambda-edge.adapter.js +40 -24
- package/lib/adapters/aws/lambda-edge.adapter.js.map +1 -0
- package/lib/adapters/aws/sns.adapter.d.ts +18 -10
- package/lib/adapters/aws/sns.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/sns.adapter.js +13 -8
- package/lib/adapters/aws/sns.adapter.js.map +1 -0
- package/lib/adapters/aws/sqs.adapter.d.ts +18 -10
- package/lib/adapters/aws/sqs.adapter.d.ts.map +1 -0
- package/lib/adapters/aws/sqs.adapter.js +13 -8
- package/lib/adapters/aws/sqs.adapter.js.map +1 -0
- package/lib/adapters/dummy/dummy.adapter.d.ts +9 -5
- package/lib/adapters/dummy/dummy.adapter.d.ts.map +1 -0
- package/lib/adapters/dummy/dummy.adapter.js +9 -5
- package/lib/adapters/dummy/dummy.adapter.js.map +1 -0
- package/lib/adapters/dummy/index.d.ts +1 -0
- package/lib/adapters/dummy/index.d.ts.map +1 -0
- package/lib/adapters/dummy/index.js +6 -1
- package/lib/adapters/dummy/index.js.map +1 -0
- package/lib/adapters/huawei/huawei-api-gateway.adapter.d.ts +19 -12
- package/lib/adapters/huawei/huawei-api-gateway.adapter.d.ts.map +1 -0
- package/lib/adapters/huawei/huawei-api-gateway.adapter.js +14 -9
- package/lib/adapters/huawei/huawei-api-gateway.adapter.js.map +1 -0
- package/lib/adapters/huawei/index.d.ts +1 -0
- package/lib/adapters/huawei/index.d.ts.map +1 -0
- package/lib/adapters/huawei/index.js +6 -1
- package/lib/adapters/huawei/index.js.map +1 -0
- package/lib/contracts/adapter.contract.d.ts +30 -30
- package/lib/contracts/adapter.contract.d.ts.map +1 -0
- package/lib/contracts/adapter.contract.js +2 -0
- package/lib/contracts/adapter.contract.js.map +1 -0
- package/lib/contracts/framework.contract.d.ts +7 -3
- package/lib/contracts/framework.contract.d.ts.map +1 -0
- package/lib/contracts/framework.contract.js +1 -0
- package/lib/contracts/framework.contract.js.map +1 -0
- package/lib/contracts/handler.contract.d.ts +7 -0
- package/lib/contracts/handler.contract.d.ts.map +1 -0
- package/lib/contracts/handler.contract.js +1 -0
- package/lib/contracts/handler.contract.js.map +1 -0
- package/lib/contracts/index.d.ts +1 -0
- package/lib/contracts/index.d.ts.map +1 -0
- package/lib/contracts/index.js +6 -1
- package/lib/contracts/index.js.map +1 -0
- package/lib/contracts/resolver.contract.d.ts +17 -4
- package/lib/contracts/resolver.contract.d.ts.map +1 -0
- package/lib/contracts/resolver.contract.js +1 -0
- package/lib/contracts/resolver.contract.js.map +1 -0
- package/lib/core/base-handler.d.ts +9 -5
- package/lib/core/base-handler.d.ts.map +1 -0
- package/lib/core/base-handler.js +9 -5
- package/lib/core/base-handler.js.map +1 -0
- package/lib/core/constants.d.ts +27 -0
- package/lib/core/constants.d.ts.map +1 -0
- package/lib/core/constants.js +21 -0
- package/lib/core/constants.js.map +1 -0
- package/lib/core/current-invoke.d.ts +17 -6
- package/lib/core/current-invoke.d.ts.map +1 -0
- package/lib/core/current-invoke.js +12 -4
- package/lib/core/current-invoke.js.map +1 -0
- package/lib/core/event-body.d.ts +9 -3
- package/lib/core/event-body.d.ts.map +1 -0
- package/lib/core/event-body.js +9 -3
- package/lib/core/event-body.js.map +1 -0
- package/lib/core/headers.d.ts +17 -6
- package/lib/core/headers.d.ts.map +1 -0
- package/lib/core/headers.js +17 -6
- package/lib/core/headers.js.map +1 -0
- package/lib/core/index.d.ts +1 -0
- package/lib/core/index.d.ts.map +1 -0
- package/lib/core/index.js +6 -1
- package/lib/core/index.js.map +1 -0
- package/lib/core/is-binary.d.ts +29 -11
- package/lib/core/is-binary.d.ts.map +1 -0
- package/lib/core/is-binary.js +29 -11
- package/lib/core/is-binary.js.map +1 -0
- package/lib/core/logger.d.ts +22 -5
- package/lib/core/logger.d.ts.map +1 -0
- package/lib/core/logger.js +8 -3
- package/lib/core/logger.js.map +1 -0
- package/lib/core/no-op.d.ts +4 -0
- package/lib/core/no-op.d.ts.map +1 -0
- package/lib/core/no-op.js +4 -0
- package/lib/core/no-op.js.map +1 -0
- package/lib/core/optional.d.ts +8 -3
- package/lib/core/optional.d.ts.map +1 -0
- package/lib/core/optional.js +8 -3
- package/lib/core/optional.js.map +1 -0
- package/lib/core/path.d.ts +14 -5
- package/lib/core/path.d.ts.map +1 -0
- package/lib/core/path.js +14 -5
- package/lib/core/path.js.map +1 -0
- package/lib/core/stream.d.ts +5 -1
- package/lib/core/stream.d.ts.map +1 -0
- package/lib/core/stream.js +6 -2
- package/lib/core/stream.js.map +1 -0
- package/lib/frameworks/express/express.framework.d.ts +5 -1
- package/lib/frameworks/express/express.framework.d.ts.map +1 -0
- package/lib/frameworks/express/express.framework.js +5 -1
- package/lib/frameworks/express/express.framework.js.map +1 -0
- package/lib/frameworks/express/index.d.ts +1 -0
- package/lib/frameworks/express/index.d.ts.map +1 -0
- package/lib/frameworks/express/index.js +6 -1
- package/lib/frameworks/express/index.js.map +1 -0
- package/lib/frameworks/fastify/fastify.framework.d.ts +5 -1
- package/lib/frameworks/fastify/fastify.framework.d.ts.map +1 -0
- package/lib/frameworks/fastify/fastify.framework.js +5 -1
- package/lib/frameworks/fastify/fastify.framework.js.map +1 -0
- package/lib/frameworks/fastify/index.d.ts +1 -0
- package/lib/frameworks/fastify/index.d.ts.map +1 -0
- package/lib/frameworks/fastify/index.js +6 -1
- package/lib/frameworks/fastify/index.js.map +1 -0
- package/lib/frameworks/hapi/hapi.framework.d.ts +5 -1
- package/lib/frameworks/hapi/hapi.framework.d.ts.map +1 -0
- package/lib/frameworks/hapi/hapi.framework.js +5 -1
- package/lib/frameworks/hapi/hapi.framework.js.map +1 -0
- package/lib/frameworks/hapi/index.d.ts +1 -0
- package/lib/frameworks/hapi/index.d.ts.map +1 -0
- package/lib/frameworks/hapi/index.js +6 -1
- package/lib/frameworks/hapi/index.js.map +1 -0
- package/lib/frameworks/koa/index.d.ts +1 -0
- package/lib/frameworks/koa/index.d.ts.map +1 -0
- package/lib/frameworks/koa/index.js +6 -1
- package/lib/frameworks/koa/index.js.map +1 -0
- package/lib/frameworks/koa/koa.framework.d.ts +5 -1
- package/lib/frameworks/koa/koa.framework.d.ts.map +1 -0
- package/lib/frameworks/koa/koa.framework.js +5 -1
- package/lib/frameworks/koa/koa.framework.js.map +1 -0
- package/lib/frameworks/lazy/index.d.ts +1 -0
- package/lib/frameworks/lazy/index.d.ts.map +1 -0
- package/lib/frameworks/lazy/index.js +6 -1
- package/lib/frameworks/lazy/index.js.map +1 -0
- package/lib/frameworks/lazy/lazy.framework.d.ts +7 -2
- package/lib/frameworks/lazy/lazy.framework.d.ts.map +1 -0
- package/lib/frameworks/lazy/lazy.framework.js +7 -2
- package/lib/frameworks/lazy/lazy.framework.js.map +1 -0
- package/lib/handlers/default/default.handler.d.ts +36 -32
- package/lib/handlers/default/default.handler.d.ts.map +1 -0
- package/lib/handlers/default/default.handler.js +36 -32
- package/lib/handlers/default/default.handler.js.map +1 -0
- package/lib/handlers/default/index.d.ts +1 -0
- package/lib/handlers/default/index.d.ts.map +1 -0
- package/lib/handlers/default/index.js +6 -1
- package/lib/handlers/default/index.js.map +1 -0
- package/lib/handlers/huawei/http-huawei.handler.d.ts +14 -4
- package/lib/handlers/huawei/http-huawei.handler.d.ts.map +1 -0
- package/lib/handlers/huawei/http-huawei.handler.js +15 -4
- package/lib/handlers/huawei/http-huawei.handler.js.map +1 -0
- package/lib/handlers/huawei/index.d.ts +1 -0
- package/lib/handlers/huawei/index.d.ts.map +1 -0
- package/lib/handlers/huawei/index.js +6 -1
- package/lib/handlers/huawei/index.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +6 -1
- package/lib/index.js.map +1 -0
- package/lib/network/index.d.ts +1 -0
- package/lib/network/index.d.ts.map +1 -0
- package/lib/network/index.js +6 -1
- package/lib/network/index.js.map +1 -0
- package/lib/network/request.d.ts +28 -0
- package/lib/network/request.d.ts.map +1 -0
- package/lib/network/request.js +7 -0
- package/lib/network/request.js.map +1 -0
- package/lib/network/response.d.ts +18 -1
- package/lib/network/response.d.ts.map +1 -0
- package/lib/network/response.js +9 -1
- package/lib/network/response.js.map +1 -0
- package/lib/resolvers/aws-context/aws-context.resolver.d.ts +7 -9
- package/lib/resolvers/aws-context/aws-context.resolver.d.ts.map +1 -0
- package/lib/resolvers/aws-context/aws-context.resolver.js +7 -9
- package/lib/resolvers/aws-context/aws-context.resolver.js.map +1 -0
- package/lib/resolvers/aws-context/index.d.ts +1 -0
- package/lib/resolvers/aws-context/index.d.ts.map +1 -0
- package/lib/resolvers/aws-context/index.js +6 -1
- package/lib/resolvers/aws-context/index.js.map +1 -0
- package/lib/resolvers/callback/callback.resolver.d.ts +9 -2
- package/lib/resolvers/callback/callback.resolver.d.ts.map +1 -0
- package/lib/resolvers/callback/callback.resolver.js +6 -2
- package/lib/resolvers/callback/callback.resolver.js.map +1 -0
- package/lib/resolvers/callback/index.d.ts +1 -0
- package/lib/resolvers/callback/index.d.ts.map +1 -0
- package/lib/resolvers/callback/index.js +6 -1
- package/lib/resolvers/callback/index.js.map +1 -0
- package/lib/resolvers/dummy/dummy.resolver.d.ts +5 -1
- package/lib/resolvers/dummy/dummy.resolver.d.ts.map +1 -0
- package/lib/resolvers/dummy/dummy.resolver.js +5 -1
- package/lib/resolvers/dummy/dummy.resolver.js.map +1 -0
- package/lib/resolvers/dummy/index.d.ts +1 -0
- package/lib/resolvers/dummy/index.d.ts.map +1 -0
- package/lib/resolvers/dummy/index.js +6 -1
- package/lib/resolvers/dummy/index.js.map +1 -0
- package/lib/resolvers/promise/index.d.ts +1 -0
- package/lib/resolvers/promise/index.d.ts.map +1 -0
- package/lib/resolvers/promise/index.js +6 -1
- package/lib/resolvers/promise/index.js.map +1 -0
- package/lib/resolvers/promise/promise.resolver.d.ts +5 -1
- package/lib/resolvers/promise/promise.resolver.d.ts.map +1 -0
- package/lib/resolvers/promise/promise.resolver.js +5 -1
- package/lib/resolvers/promise/promise.resolver.js.map +1 -0
- package/lib/serverless-adapter.d.ts +17 -12
- package/lib/serverless-adapter.d.ts.map +1 -0
- package/lib/serverless-adapter.js +17 -12
- package/lib/serverless-adapter.js.map +1 -0
- package/package.json +18 -2
- package/lib/@types/proxy-params.d.ts +0 -8
- package/lib/@types/proxy-params.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/frameworks/fastify/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -11,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
15
|
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
17
|
__exportStar(require("./fastify.framework"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/frameworks/fastify/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC"}
|
|
@@ -4,10 +4,14 @@ import type { Server } from 'hapi';
|
|
|
4
4
|
import { FrameworkContract } from '../../contracts';
|
|
5
5
|
/**
|
|
6
6
|
* The framework that forwards requests to hapi handler
|
|
7
|
+
*
|
|
8
|
+
* @breadcrumb Frameworks / HapiFramework
|
|
9
|
+
* @public
|
|
7
10
|
*/
|
|
8
11
|
export declare class HapiFramework implements FrameworkContract<Server> {
|
|
9
12
|
/**
|
|
10
|
-
* @inheritDoc
|
|
13
|
+
* {@inheritDoc}
|
|
11
14
|
*/
|
|
12
15
|
sendRequest(app: Server, request: IncomingMessage, response: ServerResponse): void;
|
|
13
16
|
}
|
|
17
|
+
//# sourceMappingURL=hapi.framework.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hapi.framework.d.ts","sourceRoot":"","sources":["../../../src/frameworks/hapi/hapi.framework.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAIpD;;;;;GAKG;AACH,qBAAa,aAAc,YAAW,iBAAiB,CAAC,MAAM,CAAC;IAC7D;;OAEG;IACI,WAAW,CAChB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,cAAc,GACvB,IAAI;CAKR"}
|
|
@@ -5,10 +5,13 @@ exports.HapiFramework = void 0;
|
|
|
5
5
|
//#endregion
|
|
6
6
|
/**
|
|
7
7
|
* The framework that forwards requests to hapi handler
|
|
8
|
+
*
|
|
9
|
+
* @breadcrumb Frameworks / HapiFramework
|
|
10
|
+
* @public
|
|
8
11
|
*/
|
|
9
12
|
class HapiFramework {
|
|
10
13
|
/**
|
|
11
|
-
* @inheritDoc
|
|
14
|
+
* {@inheritDoc}
|
|
12
15
|
*/
|
|
13
16
|
sendRequest(app, request, response) {
|
|
14
17
|
const httpServer = app.listener;
|
|
@@ -16,3 +19,4 @@ class HapiFramework {
|
|
|
16
19
|
}
|
|
17
20
|
}
|
|
18
21
|
exports.HapiFramework = HapiFramework;
|
|
22
|
+
//# sourceMappingURL=hapi.framework.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hapi.framework.js","sourceRoot":"","sources":["../../../src/frameworks/hapi/hapi.framework.ts"],"names":[],"mappings":";AAAA,iBAAiB;;;AAMjB,YAAY;AAEZ;;;;;GAKG;AACH,MAAa,aAAa;IACxB;;OAEG;IACI,WAAW,CAChB,GAAW,EACX,OAAwB,EACxB,QAAwB;QAExB,MAAM,UAAU,GAAQ,GAAG,CAAC,QAAQ,CAAC;QAErC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAChD,CAAC;CACF;AAbD,sCAaC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/frameworks/hapi/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -11,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
15
|
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
17
|
__exportStar(require("./hapi.framework"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/frameworks/hapi/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/frameworks/koa/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -11,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
15
|
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
17
|
__exportStar(require("./koa.framework"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/frameworks/koa/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC"}
|
|
@@ -4,10 +4,14 @@ import type Application from 'koa';
|
|
|
4
4
|
import { FrameworkContract } from '../../contracts';
|
|
5
5
|
/**
|
|
6
6
|
* The framework that forwards requests to koa handler
|
|
7
|
+
*
|
|
8
|
+
* @breadcrumb Frameworks / KoaFramework
|
|
9
|
+
* @public
|
|
7
10
|
*/
|
|
8
11
|
export declare class KoaFramework implements FrameworkContract<Application> {
|
|
9
12
|
/**
|
|
10
|
-
* @inheritDoc
|
|
13
|
+
* {@inheritDoc}
|
|
11
14
|
*/
|
|
12
15
|
sendRequest(app: Application, request: IncomingMessage, response: ServerResponse): void;
|
|
13
16
|
}
|
|
17
|
+
//# sourceMappingURL=koa.framework.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"koa.framework.d.ts","sourceRoot":"","sources":["../../../src/frameworks/koa/koa.framework.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACvD,OAAO,KAAK,WAAW,MAAM,KAAK,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAIpD;;;;;GAKG;AACH,qBAAa,YAAa,YAAW,iBAAiB,CAAC,WAAW,CAAC;IACjE;;OAEG;IACI,WAAW,CAChB,GAAG,EAAE,WAAW,EAChB,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,cAAc,GACvB,IAAI;CAGR"}
|
|
@@ -5,13 +5,17 @@ exports.KoaFramework = void 0;
|
|
|
5
5
|
//#endregion
|
|
6
6
|
/**
|
|
7
7
|
* The framework that forwards requests to koa handler
|
|
8
|
+
*
|
|
9
|
+
* @breadcrumb Frameworks / KoaFramework
|
|
10
|
+
* @public
|
|
8
11
|
*/
|
|
9
12
|
class KoaFramework {
|
|
10
13
|
/**
|
|
11
|
-
* @inheritDoc
|
|
14
|
+
* {@inheritDoc}
|
|
12
15
|
*/
|
|
13
16
|
sendRequest(app, request, response) {
|
|
14
17
|
app.callback()(request, response);
|
|
15
18
|
}
|
|
16
19
|
}
|
|
17
20
|
exports.KoaFramework = KoaFramework;
|
|
21
|
+
//# sourceMappingURL=koa.framework.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"koa.framework.js","sourceRoot":"","sources":["../../../src/frameworks/koa/koa.framework.ts"],"names":[],"mappings":";AAAA,iBAAiB;;;AAMjB,YAAY;AAEZ;;;;;GAKG;AACH,MAAa,YAAY;IACvB;;OAEG;IACI,WAAW,CAChB,GAAgB,EAChB,OAAwB,EACxB,QAAwB;QAExB,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACpC,CAAC;CACF;AAXD,oCAWC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/frameworks/lazy/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -11,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
15
|
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
17
|
__exportStar(require("./lazy.framework"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/frameworks/lazy/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC"}
|
|
@@ -5,7 +5,8 @@ import { ILogger } from '../../core';
|
|
|
5
5
|
/**
|
|
6
6
|
* The framework that asynchronously instantiates your application and forwards the request to the framework as quickly as possible.
|
|
7
7
|
*
|
|
8
|
-
* @example
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
9
10
|
* import express from 'express';
|
|
10
11
|
* import { ServerlessAdapter } from '@h4ad/serverless-adapter';
|
|
11
12
|
* import { ExpressFramework } from '@h4ad/serverless-adapter/lib/frameworks/express';
|
|
@@ -27,6 +28,9 @@ import { ILogger } from '../../core';
|
|
|
27
28
|
* // set other configurations and then build
|
|
28
29
|
* .build();
|
|
29
30
|
* ```
|
|
31
|
+
*
|
|
32
|
+
* @breadcrumb Frameworks / LazyFramework
|
|
33
|
+
* @public
|
|
30
34
|
*/
|
|
31
35
|
export declare class LazyFramework<TApp> implements FrameworkContract<null> {
|
|
32
36
|
protected readonly framework: FrameworkContract<TApp>;
|
|
@@ -45,7 +49,8 @@ export declare class LazyFramework<TApp> implements FrameworkContract<null> {
|
|
|
45
49
|
*/
|
|
46
50
|
protected readonly delayedFactory: Promise<void>;
|
|
47
51
|
/**
|
|
48
|
-
* @inheritDoc
|
|
52
|
+
* {@inheritDoc}
|
|
49
53
|
*/
|
|
50
54
|
sendRequest(app: null, request: IncomingMessage, response: ServerResponse): void;
|
|
51
55
|
}
|
|
56
|
+
//# sourceMappingURL=lazy.framework.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy.framework.d.ts","sourceRoot":"","sources":["../../../src/frameworks/lazy/lazy.framework.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAuB,MAAM,YAAY,CAAC;AAI1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBAAa,aAAa,CAAC,IAAI,CAAE,YAAW,iBAAiB,CAAC,IAAI,CAAC;IAO/D,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC,IAAI,CAAC;IACrD,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC;IAC/C,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO;IANpC;;OAEG;gBAEkB,SAAS,EAAE,iBAAiB,CAAC,IAAI,CAAC,EAClC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EAC5B,MAAM,GAAE,OAA+B;IAqB5D;;OAEG;IACH,SAAS,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC;IAE3B;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAMjD;;OAEG;IACI,WAAW,CAChB,GAAG,EAAE,IAAI,EACT,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,cAAc,GACvB,IAAI;CAmBR"}
|
|
@@ -7,7 +7,8 @@ const core_1 = require("../../core");
|
|
|
7
7
|
/**
|
|
8
8
|
* The framework that asynchronously instantiates your application and forwards the request to the framework as quickly as possible.
|
|
9
9
|
*
|
|
10
|
-
* @example
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
11
12
|
* import express from 'express';
|
|
12
13
|
* import { ServerlessAdapter } from '@h4ad/serverless-adapter';
|
|
13
14
|
* import { ExpressFramework } from '@h4ad/serverless-adapter/lib/frameworks/express';
|
|
@@ -29,6 +30,9 @@ const core_1 = require("../../core");
|
|
|
29
30
|
* // set other configurations and then build
|
|
30
31
|
* .build();
|
|
31
32
|
* ```
|
|
33
|
+
*
|
|
34
|
+
* @breadcrumb Frameworks / LazyFramework
|
|
35
|
+
* @public
|
|
32
36
|
*/
|
|
33
37
|
class LazyFramework {
|
|
34
38
|
//#region Constructor
|
|
@@ -54,7 +58,7 @@ class LazyFramework {
|
|
|
54
58
|
//#endregion
|
|
55
59
|
//#region Public Methods
|
|
56
60
|
/**
|
|
57
|
-
* @inheritDoc
|
|
61
|
+
* {@inheritDoc}
|
|
58
62
|
*/
|
|
59
63
|
sendRequest(app, request, response) {
|
|
60
64
|
if (this.cachedApp)
|
|
@@ -68,3 +72,4 @@ class LazyFramework {
|
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
74
|
exports.LazyFramework = LazyFramework;
|
|
75
|
+
//# sourceMappingURL=lazy.framework.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy.framework.js","sourceRoot":"","sources":["../../../src/frameworks/lazy/lazy.framework.ts"],"names":[],"mappings":";AAAA,iBAAiB;;;AAIjB,qCAA0D;AA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CAAC,CAAC;IACL,CAAC;CAGF;AAtED,sCAsEC"}
|
|
@@ -4,81 +4,85 @@ import { BaseHandler, ILogger } from '../../core';
|
|
|
4
4
|
import { ServerlessResponse } from '../../network';
|
|
5
5
|
/**
|
|
6
6
|
* The class that implements a default serverless handler consisting of a function with event, context and callback parameters respectively
|
|
7
|
+
*
|
|
8
|
+
* @breadcrumb Handlers / DefaultHandler
|
|
9
|
+
* @public
|
|
7
10
|
*/
|
|
8
11
|
export declare class DefaultHandler<TApp, TEvent, TContext, TCallback, TResponse, TReturn> extends BaseHandler<TApp, TEvent, TContext, TCallback, TResponse, TReturn> {
|
|
9
12
|
/**
|
|
10
|
-
* @inheritDoc
|
|
13
|
+
* {@inheritDoc}
|
|
11
14
|
*/
|
|
12
15
|
getHandler(app: TApp, framework: FrameworkContract<TApp>, adapters: AdapterContract<TEvent, TContext, TResponse>[], resolverFactory: ResolverContract<TEvent, TContext, TCallback, TResponse, TReturn>, binarySettings: BinarySettings, respondWithErrors: boolean, log: ILogger): ServerlessHandler<TReturn>;
|
|
13
16
|
/**
|
|
14
17
|
* The hook executed on receive a request, before the request is being processed
|
|
15
18
|
*
|
|
16
|
-
* @param log The instance of logger
|
|
17
|
-
* @param event The event sent by serverless
|
|
18
|
-
* @param context The context sent by serverless
|
|
19
|
-
* @param binarySettings The binary settings
|
|
20
|
-
* @param respondWithErrors Indicates whether the error stack should be included in the response or not
|
|
19
|
+
* @param log - The instance of logger
|
|
20
|
+
* @param event - The event sent by serverless
|
|
21
|
+
* @param context - The context sent by serverless
|
|
22
|
+
* @param binarySettings - The binary settings
|
|
23
|
+
* @param respondWithErrors - Indicates whether the error stack should be included in the response or not
|
|
21
24
|
*/
|
|
22
25
|
protected onReceiveRequest(log: ILogger, event: TEvent, context: TContext, binarySettings: BinarySettings, respondWithErrors: boolean): void;
|
|
23
26
|
/**
|
|
24
27
|
* The hook executed after resolve the adapter that will be used to handle the request and response
|
|
25
28
|
*
|
|
26
|
-
* @param log The instance of logger
|
|
27
|
-
* @param adapter The adapter resolved
|
|
29
|
+
* @param log - The instance of logger
|
|
30
|
+
* @param adapter - The adapter resolved
|
|
28
31
|
*/
|
|
29
32
|
protected onResolveAdapter(log: ILogger, adapter: AdapterContract<TEvent, TContext, TResponse>): void;
|
|
30
33
|
/**
|
|
31
34
|
* The hook executed after resolves the request values that will be sent to the framework
|
|
32
35
|
*
|
|
33
|
-
* @param log The instance of logger
|
|
34
|
-
* @param requestValues The request values returned by the adapter
|
|
36
|
+
* @param log - The instance of logger
|
|
37
|
+
* @param requestValues - The request values returned by the adapter
|
|
35
38
|
*/
|
|
36
39
|
protected onResolveRequestValues(log: ILogger, requestValues: AdapterRequest): void;
|
|
37
40
|
/**
|
|
38
41
|
* The hook executed after handling the response sent by the framework
|
|
39
42
|
*
|
|
40
|
-
* @param log The instance of logger
|
|
41
|
-
* @param response The response sent by the framework
|
|
43
|
+
* @param log - The instance of logger
|
|
44
|
+
* @param response - The response sent by the framework
|
|
42
45
|
*/
|
|
43
46
|
protected onResolveForwardedResponseToFramework(log: ILogger, response: ServerlessResponse): void;
|
|
44
47
|
/**
|
|
45
48
|
* The hook executed before sending response to the serverless
|
|
46
49
|
*
|
|
47
|
-
* @param log The instance of logger
|
|
48
|
-
* @param statusCode The status code of the response
|
|
49
|
-
* @param body The body of the response
|
|
50
|
-
* @param headers The headers of the response
|
|
51
|
-
* @param isBase64Encoded Indicates whether the response was encoded as binary or not
|
|
50
|
+
* @param log - The instance of logger
|
|
51
|
+
* @param statusCode - The status code of the response
|
|
52
|
+
* @param body - The body of the response
|
|
53
|
+
* @param headers - The headers of the response
|
|
54
|
+
* @param isBase64Encoded - Indicates whether the response was encoded as binary or not
|
|
52
55
|
*/
|
|
53
56
|
protected onForwardResponse(log: ILogger, statusCode: number, body: string, headers: SingleValueHeaders, isBase64Encoded: boolean): void;
|
|
54
57
|
/**
|
|
55
58
|
* The hook executed before sending response to the serverless with response from adapter
|
|
56
59
|
*
|
|
57
|
-
* @param log The instance of logger
|
|
58
|
-
* @param successResponse The success response resolved by the adapter
|
|
59
|
-
* @param body The body of the response sent by the framework
|
|
60
|
+
* @param log - The instance of logger
|
|
61
|
+
* @param successResponse - The success response resolved by the adapter
|
|
62
|
+
* @param body - The body of the response sent by the framework
|
|
60
63
|
*/
|
|
61
64
|
protected onForwardResponseAdapterResponse(log: ILogger, successResponse: TResponse, body: string): void;
|
|
62
65
|
/**
|
|
63
66
|
* The function to forward the event to the framework
|
|
64
67
|
*
|
|
65
|
-
* @param app The instance of the app (express, hapi, etc...)
|
|
66
|
-
* @param framework The framework that will process requests
|
|
67
|
-
* @param event The event sent by serverless
|
|
68
|
-
* @param context The context sent by serverless
|
|
69
|
-
* @param adapter The adapter resolved to this event
|
|
70
|
-
* @param log The instance of logger
|
|
71
|
-
* @param binarySettings The binary settings
|
|
68
|
+
* @param app - The instance of the app (express, hapi, etc...)
|
|
69
|
+
* @param framework - The framework that will process requests
|
|
70
|
+
* @param event - The event sent by serverless
|
|
71
|
+
* @param context - The context sent by serverless
|
|
72
|
+
* @param adapter - The adapter resolved to this event
|
|
73
|
+
* @param log - The instance of logger
|
|
74
|
+
* @param binarySettings - The binary settings
|
|
72
75
|
*/
|
|
73
76
|
protected forwardRequestToFramework(app: TApp, framework: FrameworkContract<TApp>, event: TEvent, context: TContext, adapter: AdapterContract<TEvent, TContext, TResponse>, binarySettings: BinarySettings, log: ILogger): Promise<TResponse>;
|
|
74
77
|
/**
|
|
75
78
|
* The function to forward the response back to the serverless
|
|
76
79
|
*
|
|
77
|
-
* @param event The event sent by serverless
|
|
78
|
-
* @param response The response of the framework
|
|
79
|
-
* @param adapter The adapter resolved to this event
|
|
80
|
-
* @param binarySettings The binary settings
|
|
81
|
-
* @param log The instance of logger
|
|
80
|
+
* @param event - The event sent by serverless
|
|
81
|
+
* @param response - The response of the framework
|
|
82
|
+
* @param adapter - The adapter resolved to this event
|
|
83
|
+
* @param binarySettings - The binary settings
|
|
84
|
+
* @param log - The instance of logger
|
|
82
85
|
*/
|
|
83
86
|
protected forwardResponse(event: TEvent, response: ServerlessResponse, adapter: AdapterContract<TEvent, TContext, TResponse>, binarySettings: BinarySettings, log: ILogger): TResponse;
|
|
84
87
|
}
|
|
88
|
+
//# sourceMappingURL=default.handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default.handler.d.ts","sourceRoot":"","sources":["../../../src/handlers/default/default.handler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EACL,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,WAAW,EACX,OAAO,EAIR,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAInD;;;;;GAKG;AACH,qBAAa,cAAc,CACzB,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,OAAO,CACP,SAAQ,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC;IAG1E;;OAEG;IACI,UAAU,CACf,GAAG,EAAE,IAAI,EACT,SAAS,EAAE,iBAAiB,CAAC,IAAI,CAAC,EAClC,QAAQ,EAAE,eAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,EACxD,eAAe,EAAE,gBAAgB,CAC/B,MAAM,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,OAAO,CACR,EACD,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,OAAO,EAC1B,GAAG,EAAE,OAAO,GACX,iBAAiB,CAAC,OAAO,CAAC;IAgD7B;;;;;;;;OAQG;IACH,SAAS,CAAC,gBAAgB,CACxB,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,EA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ACX,SAAS;CA0Bb"}
|
|
@@ -20,11 +20,14 @@ const network_1 = require("../../network");
|
|
|
20
20
|
//#endregion
|
|
21
21
|
/**
|
|
22
22
|
* The class that implements a default serverless handler consisting of a function with event, context and callback parameters respectively
|
|
23
|
+
*
|
|
24
|
+
* @breadcrumb Handlers / DefaultHandler
|
|
25
|
+
* @public
|
|
23
26
|
*/
|
|
24
27
|
class DefaultHandler extends core_1.BaseHandler {
|
|
25
28
|
//#region Public Methods
|
|
26
29
|
/**
|
|
27
|
-
* @inheritDoc
|
|
30
|
+
* {@inheritDoc}
|
|
28
31
|
*/
|
|
29
32
|
getHandler(app, framework, adapters, resolverFactory, binarySettings, respondWithErrors, log) {
|
|
30
33
|
return (event, context, callback) => {
|
|
@@ -48,11 +51,11 @@ class DefaultHandler extends core_1.BaseHandler {
|
|
|
48
51
|
/**
|
|
49
52
|
* The hook executed on receive a request, before the request is being processed
|
|
50
53
|
*
|
|
51
|
-
* @param log The instance of logger
|
|
52
|
-
* @param event The event sent by serverless
|
|
53
|
-
* @param context The context sent by serverless
|
|
54
|
-
* @param binarySettings The binary settings
|
|
55
|
-
* @param respondWithErrors Indicates whether the error stack should be included in the response or not
|
|
54
|
+
* @param log - The instance of logger
|
|
55
|
+
* @param event - The event sent by serverless
|
|
56
|
+
* @param context - The context sent by serverless
|
|
57
|
+
* @param binarySettings - The binary settings
|
|
58
|
+
* @param respondWithErrors - Indicates whether the error stack should be included in the response or not
|
|
56
59
|
*/
|
|
57
60
|
onReceiveRequest(log, event, context, binarySettings, respondWithErrors) {
|
|
58
61
|
log.debug('SERVERLESS_ADAPTER:PROXY', {
|
|
@@ -65,8 +68,8 @@ class DefaultHandler extends core_1.BaseHandler {
|
|
|
65
68
|
/**
|
|
66
69
|
* The hook executed after resolve the adapter that will be used to handle the request and response
|
|
67
70
|
*
|
|
68
|
-
* @param log The instance of logger
|
|
69
|
-
* @param adapter The adapter resolved
|
|
71
|
+
* @param log - The instance of logger
|
|
72
|
+
* @param adapter - The adapter resolved
|
|
70
73
|
*/
|
|
71
74
|
onResolveAdapter(log, adapter) {
|
|
72
75
|
log.debug('SERVERLESS_ADAPTER:RESOLVED_ADAPTER_NAME: ', adapter.getAdapterName());
|
|
@@ -74,8 +77,8 @@ class DefaultHandler extends core_1.BaseHandler {
|
|
|
74
77
|
/**
|
|
75
78
|
* The hook executed after resolves the request values that will be sent to the framework
|
|
76
79
|
*
|
|
77
|
-
* @param log The instance of logger
|
|
78
|
-
* @param requestValues The request values returned by the adapter
|
|
80
|
+
* @param log - The instance of logger
|
|
81
|
+
* @param requestValues - The request values returned by the adapter
|
|
79
82
|
*/
|
|
80
83
|
onResolveRequestValues(log, requestValues) {
|
|
81
84
|
var _a;
|
|
@@ -87,8 +90,8 @@ class DefaultHandler extends core_1.BaseHandler {
|
|
|
87
90
|
/**
|
|
88
91
|
* The hook executed after handling the response sent by the framework
|
|
89
92
|
*
|
|
90
|
-
* @param log The instance of logger
|
|
91
|
-
* @param response The response sent by the framework
|
|
93
|
+
* @param log - The instance of logger
|
|
94
|
+
* @param response - The response sent by the framework
|
|
92
95
|
*/
|
|
93
96
|
onResolveForwardedResponseToFramework(log, response) {
|
|
94
97
|
log.debug('SERVERLESS_ADAPTER:FORWARD_REQUEST_TO_FRAMEWORK:RESPONSE', {
|
|
@@ -98,11 +101,11 @@ class DefaultHandler extends core_1.BaseHandler {
|
|
|
98
101
|
/**
|
|
99
102
|
* The hook executed before sending response to the serverless
|
|
100
103
|
*
|
|
101
|
-
* @param log The instance of logger
|
|
102
|
-
* @param statusCode The status code of the response
|
|
103
|
-
* @param body The body of the response
|
|
104
|
-
* @param headers The headers of the response
|
|
105
|
-
* @param isBase64Encoded Indicates whether the response was encoded as binary or not
|
|
104
|
+
* @param log - The instance of logger
|
|
105
|
+
* @param statusCode - The status code of the response
|
|
106
|
+
* @param body - The body of the response
|
|
107
|
+
* @param headers - The headers of the response
|
|
108
|
+
* @param isBase64Encoded - Indicates whether the response was encoded as binary or not
|
|
106
109
|
*/
|
|
107
110
|
onForwardResponse(log, statusCode, body, headers, isBase64Encoded) {
|
|
108
111
|
log.debug('SERVERLESS_ADAPTER:FORWARD_RESPONSE:EVENT_SOURCE_RESPONSE_PARAMS', {
|
|
@@ -115,9 +118,9 @@ class DefaultHandler extends core_1.BaseHandler {
|
|
|
115
118
|
/**
|
|
116
119
|
* The hook executed before sending response to the serverless with response from adapter
|
|
117
120
|
*
|
|
118
|
-
* @param log The instance of logger
|
|
119
|
-
* @param successResponse The success response resolved by the adapter
|
|
120
|
-
* @param body The body of the response sent by the framework
|
|
121
|
+
* @param log - The instance of logger
|
|
122
|
+
* @param successResponse - The success response resolved by the adapter
|
|
123
|
+
* @param body - The body of the response sent by the framework
|
|
121
124
|
*/
|
|
122
125
|
onForwardResponseAdapterResponse(log, successResponse, body) {
|
|
123
126
|
log.debug('SERVERLESS_ADAPTER:FORWARD_RESPONSE:EVENT_SOURCE_RESPONSE', {
|
|
@@ -130,13 +133,13 @@ class DefaultHandler extends core_1.BaseHandler {
|
|
|
130
133
|
/**
|
|
131
134
|
* The function to forward the event to the framework
|
|
132
135
|
*
|
|
133
|
-
* @param app The instance of the app (express, hapi, etc...)
|
|
134
|
-
* @param framework The framework that will process requests
|
|
135
|
-
* @param event The event sent by serverless
|
|
136
|
-
* @param context The context sent by serverless
|
|
137
|
-
* @param adapter The adapter resolved to this event
|
|
138
|
-
* @param log The instance of logger
|
|
139
|
-
* @param binarySettings The binary settings
|
|
136
|
+
* @param app - The instance of the app (express, hapi, etc...)
|
|
137
|
+
* @param framework - The framework that will process requests
|
|
138
|
+
* @param event - The event sent by serverless
|
|
139
|
+
* @param context - The context sent by serverless
|
|
140
|
+
* @param adapter - The adapter resolved to this event
|
|
141
|
+
* @param log - The instance of logger
|
|
142
|
+
* @param binarySettings - The binary settings
|
|
140
143
|
*/
|
|
141
144
|
forwardRequestToFramework(app, framework, event, context, adapter, binarySettings, log) {
|
|
142
145
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -152,11 +155,11 @@ class DefaultHandler extends core_1.BaseHandler {
|
|
|
152
155
|
/**
|
|
153
156
|
* The function to forward the response back to the serverless
|
|
154
157
|
*
|
|
155
|
-
* @param event The event sent by serverless
|
|
156
|
-
* @param response The response of the framework
|
|
157
|
-
* @param adapter The adapter resolved to this event
|
|
158
|
-
* @param binarySettings The binary settings
|
|
159
|
-
* @param log The instance of logger
|
|
158
|
+
* @param event - The event sent by serverless
|
|
159
|
+
* @param response - The response of the framework
|
|
160
|
+
* @param adapter - The adapter resolved to this event
|
|
161
|
+
* @param binarySettings - The binary settings
|
|
162
|
+
* @param log - The instance of logger
|
|
160
163
|
*/
|
|
161
164
|
forwardResponse(event, response, adapter, binarySettings, log) {
|
|
162
165
|
const statusCode = response.statusCode;
|
|
@@ -180,3 +183,4 @@ class DefaultHandler extends core_1.BaseHandler {
|
|
|
180
183
|
}
|
|
181
184
|
}
|
|
182
185
|
exports.DefaultHandler = DefaultHandler;
|
|
186
|
+
//# sourceMappingURL=default.handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default.handler.js","sourceRoot":"","sources":["../../../src/handlers/default/default.handler.ts"],"names":[],"mappings":";AAAA,iBAAiB;;;;;;;;;;;;;;;AAEjB,gDAAwB;AASxB,qCAMoB;AACpB,2CAAmD;AAEnD,YAAY;AAEZ;;;;;GAKG;AACH,MAAa,cAOX,SAAQ,kBAAkE;IAC1E,wBAAwB;IAExB;;OAEG;IACI,UAAU,CACf,GAAS,EACT,SAAkC,EAClC,QAAwD,EACxD,eAMC,EACD,cAA8B,EAC9B,iBAA0B,EAC1B,GAAY;QAEZ,OAAO,CAAC,KAAa,EAAE,OAAiB,EAAE,QAAoB,EAAE,EAAE;YAChE,IAAI,CAAC,gBAAgB,CACnB,GAAG,EACH,KAAK,EACL,OAAO,EACP,cAAc,EACd,iBAAiB,CAClB,CAAC;YAEF,MAAM,OAAO,GAAG,IAAI,CAAC,2BAA2B,CAC9C,KAAK,E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AA,cAAc,mBAAmB,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -11,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
15
|
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
17
|
__exportStar(require("./default.handler"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/handlers/default/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC"}
|