@h4ad/serverless-adapter 2.2.0 → 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.
Files changed (264) hide show
  1. package/README.md +4 -253
  2. package/lib/@types/binary-settings.d.ts +24 -6
  3. package/lib/@types/binary-settings.d.ts.map +1 -0
  4. package/lib/@types/binary-settings.js +1 -0
  5. package/lib/@types/binary-settings.js.map +1 -0
  6. package/lib/@types/headers.d.ts +16 -3
  7. package/lib/@types/headers.d.ts.map +1 -0
  8. package/lib/@types/headers.js +1 -0
  9. package/lib/@types/headers.js.map +1 -0
  10. package/lib/@types/helpers.d.ts +4 -0
  11. package/lib/@types/helpers.d.ts.map +1 -0
  12. package/lib/@types/helpers.js +1 -0
  13. package/lib/@types/helpers.js.map +1 -0
  14. package/lib/@types/huawei/huawei-api-gateway-event.d.ts +62 -0
  15. package/lib/@types/huawei/huawei-api-gateway-event.d.ts.map +1 -0
  16. package/lib/@types/huawei/huawei-api-gateway-event.js +2 -0
  17. package/lib/@types/huawei/huawei-api-gateway-event.js.map +1 -0
  18. package/lib/@types/huawei/huawei-api-gateway-response.d.ts +20 -0
  19. package/lib/@types/huawei/huawei-api-gateway-response.d.ts.map +1 -0
  20. package/lib/@types/huawei/huawei-api-gateway-response.js +2 -0
  21. package/lib/@types/huawei/huawei-api-gateway-response.js.map +1 -0
  22. package/lib/@types/huawei/huawei-context.d.ts +157 -0
  23. package/lib/@types/huawei/huawei-context.d.ts.map +1 -0
  24. package/lib/@types/huawei/huawei-context.js +1 -0
  25. package/lib/@types/huawei/huawei-context.js.map +1 -0
  26. package/lib/@types/huawei/index.d.ts +1 -0
  27. package/lib/@types/huawei/index.d.ts.map +1 -0
  28. package/lib/@types/huawei/index.js +6 -1
  29. package/lib/@types/huawei/index.js.map +1 -0
  30. package/lib/@types/index.d.ts +2 -1
  31. package/lib/@types/index.d.ts.map +1 -0
  32. package/lib/@types/index.js +7 -2
  33. package/lib/@types/index.js.map +1 -0
  34. package/lib/adapters/aws/alb.adapter.d.ts +18 -10
  35. package/lib/adapters/aws/alb.adapter.d.ts.map +1 -0
  36. package/lib/adapters/aws/alb.adapter.js +14 -9
  37. package/lib/adapters/aws/alb.adapter.js.map +1 -0
  38. package/lib/adapters/aws/api-gateway-v1.adapter.d.ts +20 -12
  39. package/lib/adapters/aws/api-gateway-v1.adapter.d.ts.map +1 -0
  40. package/lib/adapters/aws/api-gateway-v1.adapter.js +19 -14
  41. package/lib/adapters/aws/api-gateway-v1.adapter.js.map +1 -0
  42. package/lib/adapters/aws/api-gateway-v2.adapter.d.ts +19 -11
  43. package/lib/adapters/aws/api-gateway-v2.adapter.d.ts.map +1 -0
  44. package/lib/adapters/aws/api-gateway-v2.adapter.js +15 -10
  45. package/lib/adapters/aws/api-gateway-v2.adapter.js.map +1 -0
  46. package/lib/adapters/aws/dynamodb.adapter.d.ts +18 -10
  47. package/lib/adapters/aws/dynamodb.adapter.d.ts.map +1 -0
  48. package/lib/adapters/aws/dynamodb.adapter.js +13 -8
  49. package/lib/adapters/aws/dynamodb.adapter.js.map +1 -0
  50. package/lib/adapters/aws/event-bridge.adapter.d.ts +21 -10
  51. package/lib/adapters/aws/event-bridge.adapter.d.ts.map +1 -0
  52. package/lib/adapters/aws/event-bridge.adapter.js +13 -8
  53. package/lib/adapters/aws/event-bridge.adapter.js.map +1 -0
  54. package/lib/adapters/aws/index.d.ts +1 -0
  55. package/lib/adapters/aws/index.d.ts.map +1 -0
  56. package/lib/adapters/aws/index.js +6 -1
  57. package/lib/adapters/aws/index.js.map +1 -0
  58. package/lib/adapters/aws/lambda-edge.adapter.d.ts +76 -46
  59. package/lib/adapters/aws/lambda-edge.adapter.d.ts.map +1 -0
  60. package/lib/adapters/aws/lambda-edge.adapter.js +40 -24
  61. package/lib/adapters/aws/lambda-edge.adapter.js.map +1 -0
  62. package/lib/adapters/aws/sns.adapter.d.ts +18 -10
  63. package/lib/adapters/aws/sns.adapter.d.ts.map +1 -0
  64. package/lib/adapters/aws/sns.adapter.js +13 -8
  65. package/lib/adapters/aws/sns.adapter.js.map +1 -0
  66. package/lib/adapters/aws/sqs.adapter.d.ts +18 -10
  67. package/lib/adapters/aws/sqs.adapter.d.ts.map +1 -0
  68. package/lib/adapters/aws/sqs.adapter.js +13 -8
  69. package/lib/adapters/aws/sqs.adapter.js.map +1 -0
  70. package/lib/adapters/dummy/dummy.adapter.d.ts +9 -5
  71. package/lib/adapters/dummy/dummy.adapter.d.ts.map +1 -0
  72. package/lib/adapters/dummy/dummy.adapter.js +9 -5
  73. package/lib/adapters/dummy/dummy.adapter.js.map +1 -0
  74. package/lib/adapters/dummy/index.d.ts +1 -0
  75. package/lib/adapters/dummy/index.d.ts.map +1 -0
  76. package/lib/adapters/dummy/index.js +6 -1
  77. package/lib/adapters/dummy/index.js.map +1 -0
  78. package/lib/adapters/huawei/huawei-api-gateway.adapter.d.ts +19 -12
  79. package/lib/adapters/huawei/huawei-api-gateway.adapter.d.ts.map +1 -0
  80. package/lib/adapters/huawei/huawei-api-gateway.adapter.js +14 -9
  81. package/lib/adapters/huawei/huawei-api-gateway.adapter.js.map +1 -0
  82. package/lib/adapters/huawei/index.d.ts +1 -0
  83. package/lib/adapters/huawei/index.d.ts.map +1 -0
  84. package/lib/adapters/huawei/index.js +6 -1
  85. package/lib/adapters/huawei/index.js.map +1 -0
  86. package/lib/contracts/adapter.contract.d.ts +30 -30
  87. package/lib/contracts/adapter.contract.d.ts.map +1 -0
  88. package/lib/contracts/adapter.contract.js +2 -0
  89. package/lib/contracts/adapter.contract.js.map +1 -0
  90. package/lib/contracts/framework.contract.d.ts +7 -3
  91. package/lib/contracts/framework.contract.d.ts.map +1 -0
  92. package/lib/contracts/framework.contract.js +1 -0
  93. package/lib/contracts/framework.contract.js.map +1 -0
  94. package/lib/contracts/handler.contract.d.ts +7 -0
  95. package/lib/contracts/handler.contract.d.ts.map +1 -0
  96. package/lib/contracts/handler.contract.js +1 -0
  97. package/lib/contracts/handler.contract.js.map +1 -0
  98. package/lib/contracts/index.d.ts +1 -0
  99. package/lib/contracts/index.d.ts.map +1 -0
  100. package/lib/contracts/index.js +6 -1
  101. package/lib/contracts/index.js.map +1 -0
  102. package/lib/contracts/resolver.contract.d.ts +17 -4
  103. package/lib/contracts/resolver.contract.d.ts.map +1 -0
  104. package/lib/contracts/resolver.contract.js +1 -0
  105. package/lib/contracts/resolver.contract.js.map +1 -0
  106. package/lib/core/base-handler.d.ts +9 -5
  107. package/lib/core/base-handler.d.ts.map +1 -0
  108. package/lib/core/base-handler.js +9 -5
  109. package/lib/core/base-handler.js.map +1 -0
  110. package/lib/core/constants.d.ts +27 -0
  111. package/lib/core/constants.d.ts.map +1 -0
  112. package/lib/core/constants.js +21 -0
  113. package/lib/core/constants.js.map +1 -0
  114. package/lib/core/current-invoke.d.ts +17 -6
  115. package/lib/core/current-invoke.d.ts.map +1 -0
  116. package/lib/core/current-invoke.js +12 -4
  117. package/lib/core/current-invoke.js.map +1 -0
  118. package/lib/core/event-body.d.ts +9 -3
  119. package/lib/core/event-body.d.ts.map +1 -0
  120. package/lib/core/event-body.js +9 -3
  121. package/lib/core/event-body.js.map +1 -0
  122. package/lib/core/headers.d.ts +17 -6
  123. package/lib/core/headers.d.ts.map +1 -0
  124. package/lib/core/headers.js +17 -6
  125. package/lib/core/headers.js.map +1 -0
  126. package/lib/core/index.d.ts +1 -0
  127. package/lib/core/index.d.ts.map +1 -0
  128. package/lib/core/index.js +6 -1
  129. package/lib/core/index.js.map +1 -0
  130. package/lib/core/is-binary.d.ts +29 -11
  131. package/lib/core/is-binary.d.ts.map +1 -0
  132. package/lib/core/is-binary.js +29 -11
  133. package/lib/core/is-binary.js.map +1 -0
  134. package/lib/core/logger.d.ts +22 -5
  135. package/lib/core/logger.d.ts.map +1 -0
  136. package/lib/core/logger.js +8 -3
  137. package/lib/core/logger.js.map +1 -0
  138. package/lib/core/no-op.d.ts +4 -0
  139. package/lib/core/no-op.d.ts.map +1 -0
  140. package/lib/core/no-op.js +4 -0
  141. package/lib/core/no-op.js.map +1 -0
  142. package/lib/core/optional.d.ts +8 -3
  143. package/lib/core/optional.d.ts.map +1 -0
  144. package/lib/core/optional.js +8 -3
  145. package/lib/core/optional.js.map +1 -0
  146. package/lib/core/path.d.ts +14 -5
  147. package/lib/core/path.d.ts.map +1 -0
  148. package/lib/core/path.js +14 -5
  149. package/lib/core/path.js.map +1 -0
  150. package/lib/core/stream.d.ts +5 -1
  151. package/lib/core/stream.d.ts.map +1 -0
  152. package/lib/core/stream.js +6 -2
  153. package/lib/core/stream.js.map +1 -0
  154. package/lib/frameworks/express/express.framework.d.ts +5 -1
  155. package/lib/frameworks/express/express.framework.d.ts.map +1 -0
  156. package/lib/frameworks/express/express.framework.js +5 -1
  157. package/lib/frameworks/express/express.framework.js.map +1 -0
  158. package/lib/frameworks/express/index.d.ts +1 -0
  159. package/lib/frameworks/express/index.d.ts.map +1 -0
  160. package/lib/frameworks/express/index.js +6 -1
  161. package/lib/frameworks/express/index.js.map +1 -0
  162. package/lib/frameworks/fastify/fastify.framework.d.ts +5 -1
  163. package/lib/frameworks/fastify/fastify.framework.d.ts.map +1 -0
  164. package/lib/frameworks/fastify/fastify.framework.js +5 -1
  165. package/lib/frameworks/fastify/fastify.framework.js.map +1 -0
  166. package/lib/frameworks/fastify/index.d.ts +1 -0
  167. package/lib/frameworks/fastify/index.d.ts.map +1 -0
  168. package/lib/frameworks/fastify/index.js +6 -1
  169. package/lib/frameworks/fastify/index.js.map +1 -0
  170. package/lib/frameworks/hapi/hapi.framework.d.ts +5 -1
  171. package/lib/frameworks/hapi/hapi.framework.d.ts.map +1 -0
  172. package/lib/frameworks/hapi/hapi.framework.js +5 -1
  173. package/lib/frameworks/hapi/hapi.framework.js.map +1 -0
  174. package/lib/frameworks/hapi/index.d.ts +1 -0
  175. package/lib/frameworks/hapi/index.d.ts.map +1 -0
  176. package/lib/frameworks/hapi/index.js +6 -1
  177. package/lib/frameworks/hapi/index.js.map +1 -0
  178. package/lib/frameworks/koa/index.d.ts +1 -0
  179. package/lib/frameworks/koa/index.d.ts.map +1 -0
  180. package/lib/frameworks/koa/index.js +6 -1
  181. package/lib/frameworks/koa/index.js.map +1 -0
  182. package/lib/frameworks/koa/koa.framework.d.ts +5 -1
  183. package/lib/frameworks/koa/koa.framework.d.ts.map +1 -0
  184. package/lib/frameworks/koa/koa.framework.js +5 -1
  185. package/lib/frameworks/koa/koa.framework.js.map +1 -0
  186. package/lib/frameworks/lazy/index.d.ts +2 -0
  187. package/lib/frameworks/lazy/index.d.ts.map +1 -0
  188. package/lib/frameworks/lazy/index.js +18 -0
  189. package/lib/frameworks/lazy/index.js.map +1 -0
  190. package/lib/frameworks/lazy/lazy.framework.d.ts +56 -0
  191. package/lib/frameworks/lazy/lazy.framework.d.ts.map +1 -0
  192. package/lib/frameworks/lazy/lazy.framework.js +75 -0
  193. package/lib/frameworks/lazy/lazy.framework.js.map +1 -0
  194. package/lib/handlers/default/default.handler.d.ts +36 -32
  195. package/lib/handlers/default/default.handler.d.ts.map +1 -0
  196. package/lib/handlers/default/default.handler.js +36 -32
  197. package/lib/handlers/default/default.handler.js.map +1 -0
  198. package/lib/handlers/default/index.d.ts +1 -0
  199. package/lib/handlers/default/index.d.ts.map +1 -0
  200. package/lib/handlers/default/index.js +6 -1
  201. package/lib/handlers/default/index.js.map +1 -0
  202. package/lib/handlers/huawei/http-huawei.handler.d.ts +14 -4
  203. package/lib/handlers/huawei/http-huawei.handler.d.ts.map +1 -0
  204. package/lib/handlers/huawei/http-huawei.handler.js +15 -4
  205. package/lib/handlers/huawei/http-huawei.handler.js.map +1 -0
  206. package/lib/handlers/huawei/index.d.ts +1 -0
  207. package/lib/handlers/huawei/index.d.ts.map +1 -0
  208. package/lib/handlers/huawei/index.js +6 -1
  209. package/lib/handlers/huawei/index.js.map +1 -0
  210. package/lib/index.d.ts +1 -0
  211. package/lib/index.d.ts.map +1 -0
  212. package/lib/index.js +6 -1
  213. package/lib/index.js.map +1 -0
  214. package/lib/network/index.d.ts +1 -0
  215. package/lib/network/index.d.ts.map +1 -0
  216. package/lib/network/index.js +6 -1
  217. package/lib/network/index.js.map +1 -0
  218. package/lib/network/request.d.ts +28 -0
  219. package/lib/network/request.d.ts.map +1 -0
  220. package/lib/network/request.js +7 -0
  221. package/lib/network/request.js.map +1 -0
  222. package/lib/network/response.d.ts +18 -1
  223. package/lib/network/response.d.ts.map +1 -0
  224. package/lib/network/response.js +9 -1
  225. package/lib/network/response.js.map +1 -0
  226. package/lib/resolvers/aws-context/aws-context.resolver.d.ts +7 -9
  227. package/lib/resolvers/aws-context/aws-context.resolver.d.ts.map +1 -0
  228. package/lib/resolvers/aws-context/aws-context.resolver.js +7 -9
  229. package/lib/resolvers/aws-context/aws-context.resolver.js.map +1 -0
  230. package/lib/resolvers/aws-context/index.d.ts +1 -0
  231. package/lib/resolvers/aws-context/index.d.ts.map +1 -0
  232. package/lib/resolvers/aws-context/index.js +6 -1
  233. package/lib/resolvers/aws-context/index.js.map +1 -0
  234. package/lib/resolvers/callback/callback.resolver.d.ts +9 -2
  235. package/lib/resolvers/callback/callback.resolver.d.ts.map +1 -0
  236. package/lib/resolvers/callback/callback.resolver.js +6 -2
  237. package/lib/resolvers/callback/callback.resolver.js.map +1 -0
  238. package/lib/resolvers/callback/index.d.ts +1 -0
  239. package/lib/resolvers/callback/index.d.ts.map +1 -0
  240. package/lib/resolvers/callback/index.js +6 -1
  241. package/lib/resolvers/callback/index.js.map +1 -0
  242. package/lib/resolvers/dummy/dummy.resolver.d.ts +5 -1
  243. package/lib/resolvers/dummy/dummy.resolver.d.ts.map +1 -0
  244. package/lib/resolvers/dummy/dummy.resolver.js +5 -1
  245. package/lib/resolvers/dummy/dummy.resolver.js.map +1 -0
  246. package/lib/resolvers/dummy/index.d.ts +1 -0
  247. package/lib/resolvers/dummy/index.d.ts.map +1 -0
  248. package/lib/resolvers/dummy/index.js +6 -1
  249. package/lib/resolvers/dummy/index.js.map +1 -0
  250. package/lib/resolvers/promise/index.d.ts +1 -0
  251. package/lib/resolvers/promise/index.d.ts.map +1 -0
  252. package/lib/resolvers/promise/index.js +6 -1
  253. package/lib/resolvers/promise/index.js.map +1 -0
  254. package/lib/resolvers/promise/promise.resolver.d.ts +5 -1
  255. package/lib/resolvers/promise/promise.resolver.d.ts.map +1 -0
  256. package/lib/resolvers/promise/promise.resolver.js +5 -1
  257. package/lib/resolvers/promise/promise.resolver.js.map +1 -0
  258. package/lib/serverless-adapter.d.ts +17 -12
  259. package/lib/serverless-adapter.d.ts.map +1 -0
  260. package/lib/serverless-adapter.js +17 -12
  261. package/lib/serverless-adapter.js.map +1 -0
  262. package/package.json +22 -2
  263. package/lib/@types/proxy-params.d.ts +0 -8
  264. package/lib/@types/proxy-params.js +0 -2
@@ -1 +1,2 @@
1
1
  export * from './fastify.framework';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
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"}
@@ -1 +1,2 @@
1
1
  export * from './hapi.framework';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
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"}
@@ -1 +1,2 @@
1
1
  export * from './koa.framework';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
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,2 @@
1
+ export * from './lazy.framework';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/frameworks/lazy/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
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);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
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"}
@@ -0,0 +1,56 @@
1
+ /// <reference types="node" />
2
+ import { IncomingMessage, ServerResponse } from 'http';
3
+ import { FrameworkContract } from '../../contracts';
4
+ import { ILogger } from '../../core';
5
+ /**
6
+ * The framework that asynchronously instantiates your application and forwards the request to the framework as quickly as possible.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import express from 'express';
11
+ * import { ServerlessAdapter } from '@h4ad/serverless-adapter';
12
+ * import { ExpressFramework } from '@h4ad/serverless-adapter/lib/frameworks/express';
13
+ * import { LazyFramework } from '@h4ad/serverless-adapter/lib/frameworks/lazy';
14
+ *
15
+ * const expressFramework = new ExpressFramework();
16
+ * const factory = async () => {
17
+ * const app = express();
18
+ *
19
+ * // do some asynchronous stuffs like create the database;
20
+ * await new Promise(resolve => setTimeout(resolve, 100);
21
+ *
22
+ * return app;
23
+ * };
24
+ * const framework = new LazyFramework(expressFramework, factory);
25
+ *
26
+ * export const handler = ServerlessAdapter.new(null)
27
+ * .setFramework(framework)
28
+ * // set other configurations and then build
29
+ * .build();
30
+ * ```
31
+ *
32
+ * @breadcrumb Frameworks / LazyFramework
33
+ * @public
34
+ */
35
+ export declare class LazyFramework<TApp> implements FrameworkContract<null> {
36
+ protected readonly framework: FrameworkContract<TApp>;
37
+ protected readonly factory: () => Promise<TApp>;
38
+ protected readonly logger: ILogger;
39
+ /**
40
+ * Default Constructor
41
+ */
42
+ constructor(framework: FrameworkContract<TApp>, factory: () => Promise<TApp>, logger?: ILogger);
43
+ /**
44
+ * The cached version of the app
45
+ */
46
+ protected cachedApp?: TApp;
47
+ /**
48
+ * The delayed factory to create an instance of the app
49
+ */
50
+ protected readonly delayedFactory: Promise<void>;
51
+ /**
52
+ * {@inheritDoc}
53
+ */
54
+ sendRequest(app: null, request: IncomingMessage, response: ServerResponse): void;
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"}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ //#region Imports
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.LazyFramework = void 0;
5
+ const core_1 = require("../../core");
6
+ //#endregion
7
+ /**
8
+ * The framework that asynchronously instantiates your application and forwards the request to the framework as quickly as possible.
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * import express from 'express';
13
+ * import { ServerlessAdapter } from '@h4ad/serverless-adapter';
14
+ * import { ExpressFramework } from '@h4ad/serverless-adapter/lib/frameworks/express';
15
+ * import { LazyFramework } from '@h4ad/serverless-adapter/lib/frameworks/lazy';
16
+ *
17
+ * const expressFramework = new ExpressFramework();
18
+ * const factory = async () => {
19
+ * const app = express();
20
+ *
21
+ * // do some asynchronous stuffs like create the database;
22
+ * await new Promise(resolve => setTimeout(resolve, 100);
23
+ *
24
+ * return app;
25
+ * };
26
+ * const framework = new LazyFramework(expressFramework, factory);
27
+ *
28
+ * export const handler = ServerlessAdapter.new(null)
29
+ * .setFramework(framework)
30
+ * // set other configurations and then build
31
+ * .build();
32
+ * ```
33
+ *
34
+ * @breadcrumb Frameworks / LazyFramework
35
+ * @public
36
+ */
37
+ class LazyFramework {
38
+ //#region Constructor
39
+ /**
40
+ * Default Constructor
41
+ */
42
+ constructor(framework, factory, logger = (0, core_1.createDefaultLogger)()) {
43
+ this.framework = framework;
44
+ this.factory = factory;
45
+ this.logger = logger;
46
+ this.delayedFactory = Promise.resolve()
47
+ .then(() => factory())
48
+ .then(app => {
49
+ this.cachedApp = app;
50
+ })
51
+ .catch((error) => {
52
+ // deal with the error only when receive some request
53
+ // to be able to return some message to user
54
+ this.logger.error('SERVERLESS_ADAPTER:LAZY_FRAMEWORK: An error occours during the creation of your app.');
55
+ this.logger.error(error);
56
+ });
57
+ }
58
+ //#endregion
59
+ //#region Public Methods
60
+ /**
61
+ * {@inheritDoc}
62
+ */
63
+ sendRequest(app, request, response) {
64
+ if (this.cachedApp)
65
+ return this.framework.sendRequest(this.cachedApp, request, response);
66
+ this.delayedFactory.then(() => {
67
+ if (!this.cachedApp) {
68
+ return response.emit('error', new Error('SERVERLESS_ADAPTER:LAZY_FRAMEWORK: The instance of the app returned by the factory is not valid, see the logs to learn more.'));
69
+ }
70
+ return this.framework.sendRequest(this.cachedApp, request, response);
71
+ });
72
+ }
73
+ }
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;AAE1D,YAAY;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAa,aAAa;IACxB,qBAAqB;IAErB;;OAEG;IACH,YACqB,SAAkC,EAClC,OAA4B,EAC5B,SAAkB,IAAA,0BAAmB,GAAE;QAFvC,cAAS,GAAT,SAAS,CAAyB;QAClC,YAAO,GAAP,OAAO,CAAqB;QAC5B,WAAM,GAAN,MAAM,CAAiC;QAE1D,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,OAAO,EAAE;aACpC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;aACrB,IAAI,CAAC,GAAG,CAAC,EAAE;YACV,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC;QACvB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAY,EAAE,EAAE;YACtB,qDAAqD;YACrD,4CAA4C;YAC5C,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,sFAAsF,CACvF,CAAC;YACF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACP,CAAC;IAgBD,YAAY;IAEZ,wBAAwB;IAExB;;OAEG;IACI,WAAW,CAChB,GAAS,EACT,OAAwB,EACxB,QAAwB;QAExB,IAAI,IAAI,CAAC,SAAS;YAChB,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;QAEvE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE;YAC5B,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;gBACnB,OAAO,QAAQ,CAAC,IAAI,CAClB,OAAO,EACP,IAAI,KAAK,CACP,8HAA8H,CAC/H,CACF,CAAC;aACH;YAED,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;QACvE,CAAC,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,EAAE,QAAQ,EACjB,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,OAAO,GACzB,IA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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,E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ErE,OAAO,eAAe,CAAC;IACzB,CAAC;CAGF;AAvRD,wCAuRC"}
@@ -1 +1,2 @@
1
1
  export * from './default.handler';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/handlers/default/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}