@h4ad/serverless-adapter 2.3.1 → 2.5.0

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 (288) hide show
  1. package/README.md +22 -243
  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/azure/http-trigger-v4.adapter.d.ts +81 -0
  71. package/lib/adapters/azure/http-trigger-v4.adapter.d.ts.map +1 -0
  72. package/lib/adapters/azure/http-trigger-v4.adapter.js +191 -0
  73. package/lib/adapters/azure/http-trigger-v4.adapter.js.map +1 -0
  74. package/lib/adapters/azure/index.d.ts +2 -0
  75. package/lib/adapters/azure/index.d.ts.map +1 -0
  76. package/lib/adapters/azure/index.js +18 -0
  77. package/lib/adapters/azure/index.js.map +1 -0
  78. package/lib/adapters/dummy/dummy.adapter.d.ts +9 -5
  79. package/lib/adapters/dummy/dummy.adapter.d.ts.map +1 -0
  80. package/lib/adapters/dummy/dummy.adapter.js +9 -5
  81. package/lib/adapters/dummy/dummy.adapter.js.map +1 -0
  82. package/lib/adapters/dummy/index.d.ts +1 -0
  83. package/lib/adapters/dummy/index.d.ts.map +1 -0
  84. package/lib/adapters/dummy/index.js +6 -1
  85. package/lib/adapters/dummy/index.js.map +1 -0
  86. package/lib/adapters/huawei/huawei-api-gateway.adapter.d.ts +19 -12
  87. package/lib/adapters/huawei/huawei-api-gateway.adapter.d.ts.map +1 -0
  88. package/lib/adapters/huawei/huawei-api-gateway.adapter.js +14 -9
  89. package/lib/adapters/huawei/huawei-api-gateway.adapter.js.map +1 -0
  90. package/lib/adapters/huawei/index.d.ts +1 -0
  91. package/lib/adapters/huawei/index.d.ts.map +1 -0
  92. package/lib/adapters/huawei/index.js +6 -1
  93. package/lib/adapters/huawei/index.js.map +1 -0
  94. package/lib/contracts/adapter.contract.d.ts +30 -30
  95. package/lib/contracts/adapter.contract.d.ts.map +1 -0
  96. package/lib/contracts/adapter.contract.js +2 -0
  97. package/lib/contracts/adapter.contract.js.map +1 -0
  98. package/lib/contracts/framework.contract.d.ts +7 -3
  99. package/lib/contracts/framework.contract.d.ts.map +1 -0
  100. package/lib/contracts/framework.contract.js +1 -0
  101. package/lib/contracts/framework.contract.js.map +1 -0
  102. package/lib/contracts/handler.contract.d.ts +7 -0
  103. package/lib/contracts/handler.contract.d.ts.map +1 -0
  104. package/lib/contracts/handler.contract.js +1 -0
  105. package/lib/contracts/handler.contract.js.map +1 -0
  106. package/lib/contracts/index.d.ts +1 -0
  107. package/lib/contracts/index.d.ts.map +1 -0
  108. package/lib/contracts/index.js +6 -1
  109. package/lib/contracts/index.js.map +1 -0
  110. package/lib/contracts/resolver.contract.d.ts +17 -4
  111. package/lib/contracts/resolver.contract.d.ts.map +1 -0
  112. package/lib/contracts/resolver.contract.js +1 -0
  113. package/lib/contracts/resolver.contract.js.map +1 -0
  114. package/lib/core/base-handler.d.ts +9 -5
  115. package/lib/core/base-handler.d.ts.map +1 -0
  116. package/lib/core/base-handler.js +9 -5
  117. package/lib/core/base-handler.js.map +1 -0
  118. package/lib/core/constants.d.ts +27 -0
  119. package/lib/core/constants.d.ts.map +1 -0
  120. package/lib/core/constants.js +21 -0
  121. package/lib/core/constants.js.map +1 -0
  122. package/lib/core/current-invoke.d.ts +17 -6
  123. package/lib/core/current-invoke.d.ts.map +1 -0
  124. package/lib/core/current-invoke.js +12 -4
  125. package/lib/core/current-invoke.js.map +1 -0
  126. package/lib/core/event-body.d.ts +9 -3
  127. package/lib/core/event-body.d.ts.map +1 -0
  128. package/lib/core/event-body.js +9 -3
  129. package/lib/core/event-body.js.map +1 -0
  130. package/lib/core/headers.d.ts +17 -6
  131. package/lib/core/headers.d.ts.map +1 -0
  132. package/lib/core/headers.js +17 -6
  133. package/lib/core/headers.js.map +1 -0
  134. package/lib/core/index.d.ts +1 -0
  135. package/lib/core/index.d.ts.map +1 -0
  136. package/lib/core/index.js +6 -1
  137. package/lib/core/index.js.map +1 -0
  138. package/lib/core/is-binary.d.ts +29 -11
  139. package/lib/core/is-binary.d.ts.map +1 -0
  140. package/lib/core/is-binary.js +29 -11
  141. package/lib/core/is-binary.js.map +1 -0
  142. package/lib/core/logger.d.ts +31 -5
  143. package/lib/core/logger.d.ts.map +1 -0
  144. package/lib/core/logger.js +29 -4
  145. package/lib/core/logger.js.map +1 -0
  146. package/lib/core/no-op.d.ts +4 -0
  147. package/lib/core/no-op.d.ts.map +1 -0
  148. package/lib/core/no-op.js +4 -0
  149. package/lib/core/no-op.js.map +1 -0
  150. package/lib/core/optional.d.ts +8 -3
  151. package/lib/core/optional.d.ts.map +1 -0
  152. package/lib/core/optional.js +8 -3
  153. package/lib/core/optional.js.map +1 -0
  154. package/lib/core/path.d.ts +14 -5
  155. package/lib/core/path.d.ts.map +1 -0
  156. package/lib/core/path.js +14 -5
  157. package/lib/core/path.js.map +1 -0
  158. package/lib/core/stream.d.ts +5 -1
  159. package/lib/core/stream.d.ts.map +1 -0
  160. package/lib/core/stream.js +6 -2
  161. package/lib/core/stream.js.map +1 -0
  162. package/lib/frameworks/express/express.framework.d.ts +5 -1
  163. package/lib/frameworks/express/express.framework.d.ts.map +1 -0
  164. package/lib/frameworks/express/express.framework.js +5 -1
  165. package/lib/frameworks/express/express.framework.js.map +1 -0
  166. package/lib/frameworks/express/index.d.ts +1 -0
  167. package/lib/frameworks/express/index.d.ts.map +1 -0
  168. package/lib/frameworks/express/index.js +6 -1
  169. package/lib/frameworks/express/index.js.map +1 -0
  170. package/lib/frameworks/fastify/fastify.framework.d.ts +5 -1
  171. package/lib/frameworks/fastify/fastify.framework.d.ts.map +1 -0
  172. package/lib/frameworks/fastify/fastify.framework.js +5 -1
  173. package/lib/frameworks/fastify/fastify.framework.js.map +1 -0
  174. package/lib/frameworks/fastify/index.d.ts +1 -0
  175. package/lib/frameworks/fastify/index.d.ts.map +1 -0
  176. package/lib/frameworks/fastify/index.js +6 -1
  177. package/lib/frameworks/fastify/index.js.map +1 -0
  178. package/lib/frameworks/hapi/hapi.framework.d.ts +5 -1
  179. package/lib/frameworks/hapi/hapi.framework.d.ts.map +1 -0
  180. package/lib/frameworks/hapi/hapi.framework.js +5 -1
  181. package/lib/frameworks/hapi/hapi.framework.js.map +1 -0
  182. package/lib/frameworks/hapi/index.d.ts +1 -0
  183. package/lib/frameworks/hapi/index.d.ts.map +1 -0
  184. package/lib/frameworks/hapi/index.js +6 -1
  185. package/lib/frameworks/hapi/index.js.map +1 -0
  186. package/lib/frameworks/koa/index.d.ts +1 -0
  187. package/lib/frameworks/koa/index.d.ts.map +1 -0
  188. package/lib/frameworks/koa/index.js +6 -1
  189. package/lib/frameworks/koa/index.js.map +1 -0
  190. package/lib/frameworks/koa/koa.framework.d.ts +5 -1
  191. package/lib/frameworks/koa/koa.framework.d.ts.map +1 -0
  192. package/lib/frameworks/koa/koa.framework.js +5 -1
  193. package/lib/frameworks/koa/koa.framework.js.map +1 -0
  194. package/lib/frameworks/lazy/index.d.ts +1 -0
  195. package/lib/frameworks/lazy/index.d.ts.map +1 -0
  196. package/lib/frameworks/lazy/index.js +6 -1
  197. package/lib/frameworks/lazy/index.js.map +1 -0
  198. package/lib/frameworks/lazy/lazy.framework.d.ts +7 -2
  199. package/lib/frameworks/lazy/lazy.framework.d.ts.map +1 -0
  200. package/lib/frameworks/lazy/lazy.framework.js +7 -2
  201. package/lib/frameworks/lazy/lazy.framework.js.map +1 -0
  202. package/lib/frameworks/trpc/index.d.ts +2 -0
  203. package/lib/frameworks/trpc/index.d.ts.map +1 -0
  204. package/lib/frameworks/trpc/index.js +18 -0
  205. package/lib/frameworks/trpc/index.js.map +1 -0
  206. package/lib/frameworks/trpc/trpc.framework.d.ts +152 -0
  207. package/lib/frameworks/trpc/trpc.framework.d.ts.map +1 -0
  208. package/lib/frameworks/trpc/trpc.framework.js +137 -0
  209. package/lib/frameworks/trpc/trpc.framework.js.map +1 -0
  210. package/lib/handlers/azure/azure.handler.d.ts +45 -0
  211. package/lib/handlers/azure/azure.handler.d.ts.map +1 -0
  212. package/lib/handlers/azure/azure.handler.js +63 -0
  213. package/lib/handlers/azure/azure.handler.js.map +1 -0
  214. package/lib/handlers/azure/index.d.ts +2 -0
  215. package/lib/handlers/azure/index.d.ts.map +1 -0
  216. package/lib/handlers/azure/index.js +18 -0
  217. package/lib/handlers/azure/index.js.map +1 -0
  218. package/lib/handlers/default/default.handler.d.ts +36 -32
  219. package/lib/handlers/default/default.handler.d.ts.map +1 -0
  220. package/lib/handlers/default/default.handler.js +48 -52
  221. package/lib/handlers/default/default.handler.js.map +1 -0
  222. package/lib/handlers/default/index.d.ts +1 -0
  223. package/lib/handlers/default/index.d.ts.map +1 -0
  224. package/lib/handlers/default/index.js +6 -1
  225. package/lib/handlers/default/index.js.map +1 -0
  226. package/lib/handlers/huawei/http-huawei.handler.d.ts +14 -4
  227. package/lib/handlers/huawei/http-huawei.handler.d.ts.map +1 -0
  228. package/lib/handlers/huawei/http-huawei.handler.js +15 -4
  229. package/lib/handlers/huawei/http-huawei.handler.js.map +1 -0
  230. package/lib/handlers/huawei/index.d.ts +1 -0
  231. package/lib/handlers/huawei/index.d.ts.map +1 -0
  232. package/lib/handlers/huawei/index.js +6 -1
  233. package/lib/handlers/huawei/index.js.map +1 -0
  234. package/lib/index.d.ts +1 -0
  235. package/lib/index.d.ts.map +1 -0
  236. package/lib/index.js +6 -1
  237. package/lib/index.js.map +1 -0
  238. package/lib/network/index.d.ts +1 -0
  239. package/lib/network/index.d.ts.map +1 -0
  240. package/lib/network/index.js +6 -1
  241. package/lib/network/index.js.map +1 -0
  242. package/lib/network/request.d.ts +28 -0
  243. package/lib/network/request.d.ts.map +1 -0
  244. package/lib/network/request.js +7 -0
  245. package/lib/network/request.js.map +1 -0
  246. package/lib/network/response.d.ts +18 -1
  247. package/lib/network/response.d.ts.map +1 -0
  248. package/lib/network/response.js +9 -1
  249. package/lib/network/response.js.map +1 -0
  250. package/lib/resolvers/aws-context/aws-context.resolver.d.ts +7 -9
  251. package/lib/resolvers/aws-context/aws-context.resolver.d.ts.map +1 -0
  252. package/lib/resolvers/aws-context/aws-context.resolver.js +7 -9
  253. package/lib/resolvers/aws-context/aws-context.resolver.js.map +1 -0
  254. package/lib/resolvers/aws-context/index.d.ts +1 -0
  255. package/lib/resolvers/aws-context/index.d.ts.map +1 -0
  256. package/lib/resolvers/aws-context/index.js +6 -1
  257. package/lib/resolvers/aws-context/index.js.map +1 -0
  258. package/lib/resolvers/callback/callback.resolver.d.ts +9 -2
  259. package/lib/resolvers/callback/callback.resolver.d.ts.map +1 -0
  260. package/lib/resolvers/callback/callback.resolver.js +6 -2
  261. package/lib/resolvers/callback/callback.resolver.js.map +1 -0
  262. package/lib/resolvers/callback/index.d.ts +1 -0
  263. package/lib/resolvers/callback/index.d.ts.map +1 -0
  264. package/lib/resolvers/callback/index.js +6 -1
  265. package/lib/resolvers/callback/index.js.map +1 -0
  266. package/lib/resolvers/dummy/dummy.resolver.d.ts +5 -1
  267. package/lib/resolvers/dummy/dummy.resolver.d.ts.map +1 -0
  268. package/lib/resolvers/dummy/dummy.resolver.js +5 -1
  269. package/lib/resolvers/dummy/dummy.resolver.js.map +1 -0
  270. package/lib/resolvers/dummy/index.d.ts +1 -0
  271. package/lib/resolvers/dummy/index.d.ts.map +1 -0
  272. package/lib/resolvers/dummy/index.js +6 -1
  273. package/lib/resolvers/dummy/index.js.map +1 -0
  274. package/lib/resolvers/promise/index.d.ts +1 -0
  275. package/lib/resolvers/promise/index.d.ts.map +1 -0
  276. package/lib/resolvers/promise/index.js +6 -1
  277. package/lib/resolvers/promise/index.js.map +1 -0
  278. package/lib/resolvers/promise/promise.resolver.d.ts +5 -1
  279. package/lib/resolvers/promise/promise.resolver.d.ts.map +1 -0
  280. package/lib/resolvers/promise/promise.resolver.js +5 -1
  281. package/lib/resolvers/promise/promise.resolver.js.map +1 -0
  282. package/lib/serverless-adapter.d.ts +17 -12
  283. package/lib/serverless-adapter.d.ts.map +1 -0
  284. package/lib/serverless-adapter.js +17 -12
  285. package/lib/serverless-adapter.js.map +1 -0
  286. package/package.json +32 -4
  287. package/lib/@types/proxy-params.d.ts +0 -8
  288. package/lib/@types/proxy-params.js +0 -2
@@ -1,59 +1,66 @@
1
- import { HuaweiApiGatewayEvent, HuaweiContext } from '../../@types/huawei';
2
- import { HuaweiApiGatewayResponse } from '../../@types/huawei/huawei-api-gateway-response';
1
+ import { HuaweiApiGatewayEvent, HuaweiApiGatewayResponse, HuaweiContext } from '../../@types/huawei';
3
2
  import { AdapterContract, AdapterRequest, GetResponseAdapterProps, OnErrorProps } from '../../contracts';
4
3
  /**
5
4
  * The options to customize the {@link HuaweiApiGatewayAdapter}
5
+ *
6
+ * @breadcrumb Adapters / Huawei / HuaweiApiGatewayAdapter
7
+ * @public
6
8
  */
7
9
  export interface HuaweiApiGatewayOptions {
8
10
  /**
9
11
  * Strip base path for custom domains
10
12
  *
11
- * @default ''
13
+ * @defaultValue ''
12
14
  */
13
15
  stripBasePath?: string;
14
16
  }
15
17
  /**
16
18
  * The adapter to handle requests from Huawei Api Gateway
17
19
  *
18
- * @example```typescript
20
+ * @example
21
+ * ```typescript
19
22
  * const stripBasePath = '/any/custom/base/path'; // default ''
20
23
  * const adapter = new ApiGatewayAdapter({ stripBasePath });
21
24
  * ```
22
25
  *
23
- * {@link https://support.huaweicloud.com/intl/en-us/devg-functiongraph/functiongraph_02_0102.html#functiongraph_02_0102__li5178638110137 Event Reference}
26
+ * @breadcrumb Adapters / Huawei / HuaweiApiGatewayAdapter
27
+ * @public
28
+ *
29
+ * {@link https://support.huaweicloud.com/intl/en-us/devg-functiongraph/functiongraph_02_0102.html#functiongraph_02_0102__li5178638110137 | Event Reference}
24
30
  */
25
31
  export declare class HuaweiApiGatewayAdapter implements AdapterContract<HuaweiApiGatewayEvent, HuaweiContext, HuaweiApiGatewayResponse> {
26
32
  protected readonly options?: HuaweiApiGatewayOptions | undefined;
27
33
  /**
28
34
  * Default constructor
29
35
  *
30
- * @param options The options to customize the {@link HuaweiApiGatewayAdapter}
36
+ * @param options - The options to customize the {@link HuaweiApiGatewayAdapter}
31
37
  */
32
38
  constructor(options?: HuaweiApiGatewayOptions | undefined);
33
39
  /**
34
- * @inheritDoc
40
+ * {@inheritDoc}
35
41
  */
36
42
  getAdapterName(): string;
37
43
  /**
38
- * @inheritDoc
44
+ * {@inheritDoc}
39
45
  */
40
46
  canHandle(event: unknown): event is HuaweiApiGatewayEvent;
41
47
  /**
42
- * @inheritDoc
48
+ * {@inheritDoc}
43
49
  */
44
50
  getRequest(event: HuaweiApiGatewayEvent): AdapterRequest;
45
51
  /**
46
- * @inheritDoc
52
+ * {@inheritDoc}
47
53
  */
48
54
  getResponse({ headers: responseHeaders, body, isBase64Encoded, statusCode, }: GetResponseAdapterProps<HuaweiApiGatewayEvent>): HuaweiApiGatewayResponse;
49
55
  /**
50
- * @inheritDoc
56
+ * {@inheritDoc}
51
57
  */
52
58
  onErrorWhileForwarding({ error, delegatedResolver, respondWithErrors, event, log, }: OnErrorProps<HuaweiApiGatewayEvent, HuaweiApiGatewayResponse>): void;
53
59
  /**
54
60
  * Get path from event with query strings
55
61
  *
56
- * @param event The event sent by serverless
62
+ * @param event - The event sent by serverless
57
63
  */
58
64
  protected getPathFromEvent(event: HuaweiApiGatewayEvent): string;
59
65
  }
66
+ //# sourceMappingURL=huawei-api-gateway.adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"huawei-api-gateway.adapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/huawei/huawei-api-gateway.adapter.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,aAAa,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,YAAY,EACb,MAAM,iBAAiB,CAAC;AAWzB;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,uBACX,YACE,eAAe,CACb,qBAAqB,EACrB,aAAa,EACb,wBAAwB,CACzB;IASS,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC;IALvC;;;;OAIG;gBAC4B,OAAO,CAAC,qCAAyB;IAMhE;;OAEG;IACI,cAAc,IAAI,MAAM;IAI/B;;OAEG;IACI,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,qBAAqB;IAehE;;OAEG;IACI,UAAU,CAAC,KAAK,EAAE,qBAAqB,GAAG,cAAc;IA6B/D;;OAEG;IACI,WAAW,CAAC,EACjB,OAAO,EAAE,eAAe,EACxB,IAAI,EACJ,eAAe,EACf,UAAU,GACX,EAAE,uBAAuB,CAAC,qBAAqB,CAAC,GAAG,wBAAwB;IAW5E;;OAEG;IACI,sBAAsB,CAAC,EAC5B,KAAK,EACL,iBAAiB,EACjB,iBAAiB,EACjB,KAAK,EACL,GAAG,GACJ,EAAE,YAAY,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,GAAG,IAAI;IAkBvE;;;;OAIG;IACH,SAAS,CAAC,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM;CAcjE"}
@@ -6,19 +6,23 @@ const core_1 = require("../../core");
6
6
  /**
7
7
  * The adapter to handle requests from Huawei Api Gateway
8
8
  *
9
- * @example```typescript
9
+ * @example
10
+ * ```typescript
10
11
  * const stripBasePath = '/any/custom/base/path'; // default ''
11
12
  * const adapter = new ApiGatewayAdapter({ stripBasePath });
12
13
  * ```
13
14
  *
14
- * {@link https://support.huaweicloud.com/intl/en-us/devg-functiongraph/functiongraph_02_0102.html#functiongraph_02_0102__li5178638110137 Event Reference}
15
+ * @breadcrumb Adapters / Huawei / HuaweiApiGatewayAdapter
16
+ * @public
17
+ *
18
+ * {@link https://support.huaweicloud.com/intl/en-us/devg-functiongraph/functiongraph_02_0102.html#functiongraph_02_0102__li5178638110137 | Event Reference}
15
19
  */
16
20
  class HuaweiApiGatewayAdapter {
17
21
  //#region Constructor
18
22
  /**
19
23
  * Default constructor
20
24
  *
21
- * @param options The options to customize the {@link HuaweiApiGatewayAdapter}
25
+ * @param options - The options to customize the {@link HuaweiApiGatewayAdapter}
22
26
  */
23
27
  constructor(options) {
24
28
  this.options = options;
@@ -26,13 +30,13 @@ class HuaweiApiGatewayAdapter {
26
30
  //#endregion
27
31
  //#region Public Methods
28
32
  /**
29
- * @inheritDoc
33
+ * {@inheritDoc}
30
34
  */
31
35
  getAdapterName() {
32
36
  return HuaweiApiGatewayAdapter.name;
33
37
  }
34
38
  /**
35
- * @inheritDoc
39
+ * {@inheritDoc}
36
40
  */
37
41
  canHandle(event) {
38
42
  const apiGatewayEvent = event;
@@ -46,7 +50,7 @@ class HuaweiApiGatewayAdapter {
46
50
  !('multiValueQueryStringParameters' in apiGatewayEvent));
47
51
  }
48
52
  /**
49
- * @inheritDoc
53
+ * {@inheritDoc}
50
54
  */
51
55
  getRequest(event) {
52
56
  const method = event.httpMethod;
@@ -68,7 +72,7 @@ class HuaweiApiGatewayAdapter {
68
72
  };
69
73
  }
70
74
  /**
71
- * @inheritDoc
75
+ * {@inheritDoc}
72
76
  */
73
77
  getResponse({ headers: responseHeaders, body, isBase64Encoded, statusCode, }) {
74
78
  const headers = (0, core_1.getMultiValueHeadersMap)(responseHeaders);
@@ -80,7 +84,7 @@ class HuaweiApiGatewayAdapter {
80
84
  };
81
85
  }
82
86
  /**
83
- * @inheritDoc
87
+ * {@inheritDoc}
84
88
  */
85
89
  onErrorWhileForwarding({ error, delegatedResolver, respondWithErrors, event, log, }) {
86
90
  const body = respondWithErrors ? error.stack : '';
@@ -99,7 +103,7 @@ class HuaweiApiGatewayAdapter {
99
103
  /**
100
104
  * Get path from event with query strings
101
105
  *
102
- * @param event The event sent by serverless
106
+ * @param event - The event sent by serverless
103
107
  */
104
108
  getPathFromEvent(event) {
105
109
  var _a;
@@ -111,3 +115,4 @@ class HuaweiApiGatewayAdapter {
111
115
  }
112
116
  }
113
117
  exports.HuaweiApiGatewayAdapter = HuaweiApiGatewayAdapter;
118
+ //# sourceMappingURL=huawei-api-gateway.adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"huawei-api-gateway.adapter.js","sourceRoot":"","sources":["../../../src/adapters/huawei/huawei-api-gateway.adapter.ts"],"names":[],"mappings":";AAAA,iBAAiB;;;AAajB,qCAMoB;AAmBpB;;;;;;;;;;;;;GAaG;AACH,MAAa,uBAAuB;IAQlC,qBAAqB;IAErB;;;;OAIG;IACH,YAA+B,OAAiC;QAAjC,YAAO,GAAP,OAAO,CAA0B;IAAG,CAAC;IAEpE,YAAY;IAEZ,wBAAwB;IAExB;;OAEG;IACI,cAAc;QACnB,OAAO,uBAAuB,CAAC,IAAI,CAAC;IACtC,CAAC;IAED;;OAEG;IACI,SAAS,CAAC,KAAc;QAC7B,MAAM,eAAe,GAAG,KAAuC,CAAC;QAEhE,OAAO,CAAC,CAAC,CACP,eAAe;YACf,eAAe,CAAC,UAAU;YAC1B,eAAe,CAAC,cAAc;YAC9B,eAAe,CAAC,cAAc,CAAC,KAAK;YACpC,eAAe,CAAC,cAAc,CAAC,KAAK;YACpC,eAAe,CAAC,cAAc,CAAC,SAAS;YACxC,+CAA+C;YAC/C,CAAC,CAAC,iCAAiC,IAAI,eAAe,CAAC,CACxD,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,UAAU,CAAC,KAA4B;QAC5C,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC;QAChC,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAE1C,MAAM,OAAO,GAAG,IAAA,6BAAsB,EAAC,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QAEjE,IAAI,IAAwB,CAAC;QAE7B,IAAI,KAAK,CAAC,IAAI,EAAE;YACd,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAA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AAC,IAAI,aAAa,EAAE,CAAC,CAAC;QACrD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;QAElD,MAAM,WAAW,GAAG,KAAK,CAAC,qBAAqB,CAAC;QAEhD,OAAO,IAAA,mCAA4B,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACzD,CAAC;CAGF;AA/ID,0DA+IC"}
@@ -1 +1,2 @@
1
1
  export * from './huawei-api-gateway.adapter';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/huawei/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,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("./huawei-api-gateway.adapter"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/huawei/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C"}
@@ -3,25 +3,11 @@ import { BothValueHeaders, SingleValueHeaders } from '../@types';
3
3
  import { ILogger } from '../core';
4
4
  import { ServerlessResponse } from '../network';
5
5
  import { DelegatedResolver } from './resolver.contract';
6
- /**
7
- * The props of the method that verify if this handler should handle the event.
8
- */
9
- export interface CanHandleProps<TEvent, TContext> {
10
- /**
11
- * The event sent by the serverless
12
- */
13
- event: TEvent | unknown;
14
- /**
15
- * The context sent by the serverless
16
- */
17
- context: TContext | unknown;
18
- /**
19
- * The instance of the logger.
20
- */
21
- log: ILogger;
22
- }
23
6
  /**
24
7
  * The request interface used to bridge any event source to the framework.
8
+ *
9
+ * @breadcrumb Contracts / AdapterContract
10
+ * @public
25
11
  */
26
12
  export interface AdapterRequest {
27
13
  /**
@@ -39,22 +25,29 @@ export interface AdapterRequest {
39
25
  /**
40
26
  * The body as buffer to use to create the request to the framework
41
27
  */
42
- body: Buffer | undefined;
28
+ body?: Buffer;
43
29
  /**
44
30
  * The remote address (client ip) to use to create the request to the framework
45
31
  */
46
32
  remoteAddress?: string;
47
33
  /**
48
- * The address of the event source (used in Lambda@edge)
34
+ * The address of the event source (used in Lambda\@edge)
35
+ *
36
+ * @deprecated It is no longer used in the library and will be removed in the next major release.
49
37
  */
50
38
  host?: string;
51
39
  /**
52
- * The address of the event source (used in Lambda@edge)
40
+ * The address of the event source (used in Lambda\@edge)
41
+ *
42
+ * @deprecated It is no longer used in the library and will be removed in the next major release.
53
43
  */
54
44
  hostname?: string;
55
45
  }
56
46
  /**
57
47
  * The props of the method that get the response from the framework and transform it into a format that the event source can handle
48
+ *
49
+ * @breadcrumb Contracts / AdapterContract
50
+ * @public
58
51
  */
59
52
  export interface GetResponseAdapterProps<TEvent> {
60
53
  /**
@@ -62,9 +55,9 @@ export interface GetResponseAdapterProps<TEvent> {
62
55
  */
63
56
  event: TEvent;
64
57
  /**
65
- * The framework {@link ServerlessResponse response}.
58
+ * The framework {@link ServerlessResponse | response}.
66
59
  *
67
- * @note It can be optional, as this method can be used when an error occurs during the handling of the request by the framework.
60
+ * @remarks It can be optional, as this method can be used when an error occurs during the handling of the request by the framework.
68
61
  */
69
62
  response?: ServerlessResponse;
70
63
  /**
@@ -90,6 +83,9 @@ export interface GetResponseAdapterProps<TEvent> {
90
83
  }
91
84
  /**
92
85
  * The props of the method that handle the response when an error occurs while forwarding the request to the framework
86
+ *
87
+ * @breadcrumb Contracts / AdapterContract
88
+ * @public
93
89
  */
94
90
  export interface OnErrorProps<TEvent, TResponse> {
95
91
  /**
@@ -115,6 +111,9 @@ export interface OnErrorProps<TEvent, TResponse> {
115
111
  }
116
112
  /**
117
113
  * The interface that represents a contract between the adapter and the actual implementation of the adapter.
114
+ *
115
+ * @breadcrumb Contracts / AdapterContract
116
+ * @public
118
117
  */
119
118
  export interface AdapterContract<TEvent, TContext, TResponse> {
120
119
  /**
@@ -124,29 +123,30 @@ export interface AdapterContract<TEvent, TContext, TResponse> {
124
123
  /**
125
124
  * Decide if this adapter can handle a request based in the event payload
126
125
  *
127
- * @param event The event sent by serverless
128
- * @param context The context sent by the serverless
129
- * @param log The instance of logger
126
+ * @param event - The event sent by serverless
127
+ * @param context - The context sent by the serverless
128
+ * @param log - The instance of logger
130
129
  */
131
130
  canHandle(event: unknown, context: TContext, log: ILogger): boolean;
132
131
  /**
133
132
  * Maps the serverless payload to an actual request that a framework can handle
134
133
  *
135
- * @param event The event sent by serverless
136
- * @param context The context sent by the serverless
137
- * @param log The instance of logger
134
+ * @param event - The event sent by serverless
135
+ * @param context - The context sent by the serverless
136
+ * @param log - The instance of logger
138
137
  */
139
138
  getRequest(event: TEvent, context: TContext, log: ILogger): AdapterRequest;
140
139
  /**
141
140
  * Maps the response of the framework to a payload that serverless can handle
142
141
  *
143
- * @param props The props sent by serverless
142
+ * @param props - The props sent by serverless
144
143
  */
145
144
  getResponse(props: GetResponseAdapterProps<TEvent>): TResponse;
146
145
  /**
147
146
  * When an error occurs while forwarding the request to the framework
148
147
  *
149
- * @note You must call resolver.fail or resolver.succeed when implementing this method.
148
+ * @remarks You must call resolver.fail or resolver.succeed when implementing this method.
150
149
  */
151
150
  onErrorWhileForwarding(props: OnErrorProps<TEvent, TResponse>): void;
152
151
  }
152
+ //# sourceMappingURL=adapter.contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.contract.d.ts","sourceRoot":"","sources":["../../src/contracts/adapter.contract.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAIxD;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,kBAAkB,CAAC;IAE5B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB,CAAC,MAAM;IAC7C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAE9B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,gBAAgB,CAAC;IAE1B;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,GAAG,EAAE,OAAO,CAAC;CACd;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY,CAAC,MAAM,EAAE,SAAS;IAC7C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;IAEb;;OAEG;IACH,iBAAiB,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAEhD;;OAEG;IACH,iBAAiB,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,GAAG,EAAE,OAAO,CAAC;CACd;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS;IAC1D;;OAEG;IACH,cAAc,IAAI,MAAM,CAAC;IAEzB;;;;;;OAMG;IACH,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC;IAEpE;;;;;;OAMG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,GAAG,cAAc,CAAC;IAE3E;;;;OAIG;IACH,WAAW,CAAC,KAAK,EAAE,uBAAuB,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IAE/D;;;;OAIG;IACH,sBAAsB,CAAC,KAAK,EAAE,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAI,CAAC;CACtE"}
@@ -1,2 +1,4 @@
1
1
  "use strict";
2
+ //#region Imports
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=adapter.contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.contract.js","sourceRoot":"","sources":["../../src/contracts/adapter.contract.ts"],"names":[],"mappings":";AAAA,iBAAiB"}
@@ -2,14 +2,18 @@
2
2
  import { IncomingMessage, ServerResponse } from 'http';
3
3
  /**
4
4
  * The interface that represents a contract between the framework and the framework implementation
5
+ *
6
+ * @breadcrumb Contracts
7
+ * @public
5
8
  */
6
9
  export interface FrameworkContract<TApp> {
7
10
  /**
8
11
  * Send the request and response objects to the framework
9
12
  *
10
- * @param app
11
- * @param request
12
- * @param response
13
+ * @param app - The instance of your app (Express, Fastify, Koa, etc...)
14
+ * @param request - The request object that will be forward to your app
15
+ * @param response - The response object that will be forward to your app to output the response
13
16
  */
14
17
  sendRequest(app: TApp, request: IncomingMessage, response: ServerResponse): void;
15
18
  }
19
+ //# sourceMappingURL=framework.contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framework.contract.d.ts","sourceRoot":"","sources":["../../src/contracts/framework.contract.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAIvD;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB,CAAC,IAAI;IACrC;;;;;;OAMG;IACH,WAAW,CACT,GAAG,EAAE,IAAI,EACT,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,cAAc,GACvB,IAAI,CAAC;CACT"}
@@ -1,3 +1,4 @@
1
1
  "use strict";
2
2
  //#region Imports
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=framework.contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framework.contract.js","sourceRoot":"","sources":["../../src/contracts/framework.contract.ts"],"names":[],"mappings":";AAAA,iBAAiB"}
@@ -5,10 +5,16 @@ import { FrameworkContract } from './framework.contract';
5
5
  import { ResolverContract } from './resolver.contract';
6
6
  /**
7
7
  * The function used to handle serverless requests
8
+ *
9
+ * @breadcrumb Contracts / HandlerContract
10
+ * @public
8
11
  */
9
12
  export declare type ServerlessHandler<TReturn> = (...args: any[]) => TReturn;
10
13
  /**
11
14
  * The interface that represents the contract between the handler and the real implementation
15
+ *
16
+ * @breadcrumb Contracts / HandlerContract
17
+ * @public
12
18
  */
13
19
  export interface HandlerContract<TApp, TEvent, TContext, TCallback, TResponse, TReturn> {
14
20
  /**
@@ -16,3 +22,4 @@ export interface HandlerContract<TApp, TEvent, TContext, TCallback, TResponse, T
16
22
  */
17
23
  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>;
18
24
  }
25
+ //# sourceMappingURL=handler.contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler.contract.d.ts","sourceRoot":"","sources":["../../src/contracts/handler.contract.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIvD;;;;;GAKG;AACH,oBAAY,iBAAiB,CAAC,OAAO,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC;AAErE;;;;;GAKG;AACH,MAAM,WAAW,eAAe,CAC9B,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,OAAO;IAEP;;OAEG;IACH,UAAU,CACR,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,CAAC;CAC/B"}
@@ -1,3 +1,4 @@
1
1
  "use strict";
2
2
  //#region Imports
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=handler.contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler.contract.js","sourceRoot":"","sources":["../../src/contracts/handler.contract.ts"],"names":[],"mappings":";AAAA,iBAAiB"}
@@ -2,3 +2,4 @@ export * from './adapter.contract';
2
2
  export * from './framework.contract';
3
3
  export * from './handler.contract';
4
4
  export * from './resolver.contract';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,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];
@@ -14,3 +18,4 @@ __exportStar(require("./adapter.contract"), exports);
14
18
  __exportStar(require("./framework.contract"), exports);
15
19
  __exportStar(require("./handler.contract"), exports);
16
20
  __exportStar(require("./resolver.contract"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,uDAAqC;AACrC,qDAAmC;AACnC,sDAAoC"}
@@ -2,34 +2,43 @@ import { ILogger } from '../core';
2
2
  import { AdapterContract } from './adapter.contract';
3
3
  /**
4
4
  * The type that represents a resolver used to send the response, error or success, to the client
5
+ *
6
+ * @breadcrumb Contracts / ResolverContract
7
+ * @public
5
8
  */
6
9
  export declare type Resolver<TResponse, TReturn> = {
7
10
  /**
8
11
  * The method that will perform the task of forwarding the request to the framework and waiting for the promise to be resolved with the response
9
12
  *
10
- * @param task The task to be executed
13
+ * @param task - The task to be executed
11
14
  */
12
15
  run(task: () => Promise<TResponse>): TReturn;
13
16
  };
14
17
  /**
15
18
  * The type that represents a delegate resolver that is passed to the adapter to handle what to do when an error occurs during forwarding.
19
+ *
20
+ * @breadcrumb Contracts / ResolverContract
21
+ * @public
16
22
  */
17
23
  export declare type DelegatedResolver<TResponse> = {
18
24
  /**
19
25
  * Send the success response to the client
20
26
  *
21
- * @param success The serverless response
27
+ * @param success - The serverless response
22
28
  */
23
29
  succeed: (response: TResponse) => void;
24
30
  /**
25
31
  * Send the error response to the client
26
32
  *
27
- * @param error The error object
33
+ * @param error - The error object
28
34
  */
29
35
  fail: (error: Error) => void;
30
36
  };
31
37
  /**
32
38
  * The createResolver contract props
39
+ *
40
+ * @breadcrumb Contracts / ResolverContract
41
+ * @public
33
42
  */
34
43
  export declare type ResolverProps<TEvent, TContext, TCallback, TResponse> = {
35
44
  /**
@@ -59,12 +68,16 @@ export declare type ResolverProps<TEvent, TContext, TCallback, TResponse> = {
59
68
  };
60
69
  /**
61
70
  * The interface that represents the contract used to send the response to the client
71
+ *
72
+ * @breadcrumb Contracts / ResolverContract
73
+ * @public
62
74
  */
63
75
  export interface ResolverContract<TEvent, TContext, TCallback, TResponse, TReturn> {
64
76
  /**
65
77
  * Create the resolver based on the context, callback or promise
66
78
  *
67
- * @param props The props used to create the resolver
79
+ * @param props - The props used to create the resolver
68
80
  */
69
81
  createResolver(props: ResolverProps<TEvent, TContext, TCallback, TResponse>): Resolver<TResponse, TReturn>;
70
82
  }
83
+ //# sourceMappingURL=resolver.contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolver.contract.d.ts","sourceRoot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,4 @@
1
1
  "use strict";
2
2
  //#region Imports
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=resolver.contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolver.contract.js","sourceRoot":"","sources":["../../src/contracts/resolver.contract.ts"],"names":[],"mappings":";AAAA,iBAAiB"}
@@ -4,6 +4,9 @@ import { ServerlessRequest, ServerlessResponse } from '../network';
4
4
  import { ILogger } from './index';
5
5
  /**
6
6
  * The abstract class that represents the base class for a handler
7
+ *
8
+ * @breadcrumb Core
9
+ * @public
7
10
  */
8
11
  export declare abstract class BaseHandler<TApp, TEvent, TContext, TCallback, TResponse, TReturn> implements HandlerContract<TApp, TEvent, TContext, TCallback, TResponse, TReturn> {
9
12
  /**
@@ -13,16 +16,17 @@ export declare abstract class BaseHandler<TApp, TEvent, TContext, TCallback, TRe
13
16
  /**
14
17
  * Get the adapter to handle a specific event and context
15
18
  *
16
- * @param event The event sent by serverless
17
- * @param context The context sent by serverless
18
- * @param adapters The list of adapters
19
- * @param log The instance of logger
19
+ * @param event - The event sent by serverless
20
+ * @param context - The context sent by serverless
21
+ * @param adapters - The list of adapters
22
+ * @param log - The instance of logger
20
23
  */
21
24
  protected getAdapterByEventAndContext(event: TEvent, context: TContext, adapters: AdapterContract<TEvent, TContext, TResponse>[], log: ILogger): AdapterContract<TEvent, TContext, TResponse>;
22
25
  /**
23
26
  * Get serverless request and response frmo the adapter request
24
27
  *
25
- * @param requestValues The request values from adapter
28
+ * @param requestValues - The request values from adapter
26
29
  */
27
30
  protected getServerlessRequestResponseFromAdapterRequest(requestValues: AdapterRequest): [request: ServerlessRequest, response: ServerlessResponse];
28
31
  }
32
+ //# sourceMappingURL=base-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-handler.d.ts","sourceRoot":"","sources":["../../src/core/base-handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO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  * The abstract class that represents the base class for a handler
9
+ *
10
+ * @breadcrumb Core
11
+ * @public
9
12
  */
10
13
  class BaseHandler {
11
14
  //#endregion
@@ -13,10 +16,10 @@ class BaseHandler {
13
16
  /**
14
17
  * Get the adapter to handle a specific event and context
15
18
  *
16
- * @param event The event sent by serverless
17
- * @param context The context sent by serverless
18
- * @param adapters The list of adapters
19
- * @param log The instance of logger
19
+ * @param event - The event sent by serverless
20
+ * @param context - The context sent by serverless
21
+ * @param adapters - The list of adapters
22
+ * @param log - The instance of logger
20
23
  */
21
24
  getAdapterByEventAndContext(event, context, adapters, log) {
22
25
  const resolvedAdapters = adapters.filter(adapter => adapter.canHandle(event, context, log));
@@ -33,7 +36,7 @@ class BaseHandler {
33
36
  /**
34
37
  * Get serverless request and response frmo the adapter request
35
38
  *
36
- * @param requestValues The request values from adapter
39
+ * @param requestValues - The request values from adapter
37
40
  */
38
41
  getServerlessRequestResponseFromAdapterRequest(requestValues) {
39
42
  const request = new network_1.ServerlessRequest({
@@ -50,3 +53,4 @@ class BaseHandler {
50
53
  }
51
54
  }
52
55
  exports.BaseHandler = BaseHandler;
56
+ //# sourceMappingURL=base-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-handler.js","sourceRoot":"","sources":["../../src/core/base-handler.ts"],"names":[],"mappings":";AAAA,iBAAiB;;;AAWjB,wCAAmE;AAGnE,YAAY;AAEZ;;;;;GAKG;AACH,MAAsB,WAAW;IA+B/B,YAAY;IAEZ,2BAA2B;IAE3B;;;;;;;OAOG;IACO,2BAA2B,CACnC,KAAa,EACb,OAAiB,EACjB,QAAwD,EACxD,GAAY;QAEZ,MAAM,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CACjD,OAAO,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,CACvC,CAAC;QAEF,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE;YACjC,MAAM,IAAI,KAAK,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