@h4ad/serverless-adapter 3.2.0 → 4.0.1

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 (578) hide show
  1. package/lib/adapter.contract-EQE3rlgO.d.ts +278 -0
  2. package/lib/adapter.contract-y5xSjOjo.d.cts +278 -0
  3. package/lib/adapters/apollo-server/index.cjs +4 -0
  4. package/lib/adapters/apollo-server/index.cjs.map +1 -0
  5. package/lib/adapters/apollo-server/{apollo-server-mutation.adapter.d.ts → index.d.cts} +10 -5
  6. package/lib/adapters/apollo-server/index.d.ts +61 -2
  7. package/lib/adapters/apollo-server/index.mjs +2 -0
  8. package/lib/adapters/apollo-server/index.mjs.map +1 -0
  9. package/lib/adapters/aws/index.cjs +4 -0
  10. package/lib/adapters/aws/index.cjs.map +1 -0
  11. package/lib/adapters/aws/index.d.cts +910 -0
  12. package/lib/adapters/aws/index.d.ts +910 -12
  13. package/lib/adapters/aws/index.mjs +2 -0
  14. package/lib/adapters/aws/index.mjs.map +1 -0
  15. package/lib/adapters/azure/index.cjs +4 -0
  16. package/lib/adapters/azure/index.cjs.map +1 -0
  17. package/lib/adapters/azure/{http-trigger-v4.adapter.d.ts → index.d.cts} +11 -6
  18. package/lib/adapters/azure/index.d.ts +86 -2
  19. package/lib/adapters/azure/index.mjs +2 -0
  20. package/lib/adapters/azure/index.mjs.map +1 -0
  21. package/lib/adapters/digital-ocean/index.cjs +4 -0
  22. package/lib/adapters/digital-ocean/index.cjs.map +1 -0
  23. package/lib/adapters/digital-ocean/index.d.cts +126 -0
  24. package/lib/adapters/digital-ocean/index.d.ts +126 -2
  25. package/lib/adapters/digital-ocean/index.mjs +2 -0
  26. package/lib/adapters/digital-ocean/index.mjs.map +1 -0
  27. package/lib/adapters/dummy/index.cjs +4 -0
  28. package/lib/adapters/dummy/index.cjs.map +1 -0
  29. package/lib/adapters/dummy/{dummy.adapter.d.ts → index.d.cts} +10 -4
  30. package/lib/adapters/dummy/index.d.ts +37 -2
  31. package/lib/adapters/dummy/index.mjs +2 -0
  32. package/lib/adapters/dummy/index.mjs.map +1 -0
  33. package/lib/adapters/huawei/index.cjs +4 -0
  34. package/lib/adapters/huawei/index.cjs.map +1 -0
  35. package/lib/adapters/huawei/index.d.cts +365 -0
  36. package/lib/adapters/huawei/index.d.ts +365 -2
  37. package/lib/adapters/huawei/index.mjs +2 -0
  38. package/lib/adapters/huawei/index.mjs.map +1 -0
  39. package/lib/{core/base-handler.d.ts → base-handler-fYEk59Xq.d.ts} +9 -6
  40. package/lib/base-handler-peEBoKtZ.d.cts +35 -0
  41. package/lib/chunk-22SSVZU5.mjs +1 -0
  42. package/lib/chunk-22SSVZU5.mjs.map +1 -0
  43. package/lib/chunk-HU5XBQCP.mjs +10 -0
  44. package/lib/chunk-HU5XBQCP.mjs.map +1 -0
  45. package/lib/chunk-NSO4L3EI.mjs +2 -0
  46. package/lib/chunk-NSO4L3EI.mjs.map +1 -0
  47. package/lib/chunk-OYOJMOFP.mjs +2 -0
  48. package/lib/chunk-OYOJMOFP.mjs.map +1 -0
  49. package/lib/chunk-Y6H576RS.mjs +2 -0
  50. package/lib/chunk-Y6H576RS.mjs.map +1 -0
  51. package/lib/{core/constants.d.ts → constants-0cgQlFSV.d.cts} +6 -5
  52. package/lib/constants-0cgQlFSV.d.ts +32 -0
  53. package/lib/{contracts/framework.contract.d.ts → framework.contract-YnJ-fl1w.d.cts} +4 -3
  54. package/lib/framework.contract-YnJ-fl1w.d.ts +20 -0
  55. package/lib/frameworks/apollo-server/index.cjs +4 -0
  56. package/lib/frameworks/apollo-server/index.cjs.map +1 -0
  57. package/lib/frameworks/apollo-server/{apollo-server.framework.d.ts → index.d.cts} +12 -9
  58. package/lib/frameworks/apollo-server/index.d.ts +72 -2
  59. package/lib/frameworks/apollo-server/index.mjs +2 -0
  60. package/lib/frameworks/apollo-server/index.mjs.map +1 -0
  61. package/lib/frameworks/body-parser/index.cjs +4 -0
  62. package/lib/frameworks/body-parser/index.cjs.map +1 -0
  63. package/lib/frameworks/body-parser/index.d.cts +159 -0
  64. package/lib/frameworks/body-parser/index.d.ts +159 -6
  65. package/lib/frameworks/body-parser/index.mjs +2 -0
  66. package/lib/frameworks/body-parser/index.mjs.map +1 -0
  67. package/lib/frameworks/cors/index.cjs +5 -0
  68. package/lib/frameworks/cors/index.cjs.map +1 -0
  69. package/lib/frameworks/cors/{cors.framework.d.ts → index.d.cts} +6 -5
  70. package/lib/frameworks/cors/index.d.ts +79 -2
  71. package/lib/frameworks/cors/index.mjs +3 -0
  72. package/lib/frameworks/cors/index.mjs.map +1 -0
  73. package/lib/frameworks/deepkit/index.cjs +4 -0
  74. package/lib/frameworks/deepkit/index.cjs.map +1 -0
  75. package/lib/frameworks/deepkit/{http-deepkit.framework.d.ts → index.d.cts} +8 -5
  76. package/lib/frameworks/deepkit/index.d.ts +21 -2
  77. package/lib/frameworks/deepkit/index.mjs +2 -0
  78. package/lib/frameworks/deepkit/index.mjs.map +1 -0
  79. package/lib/frameworks/express/index.cjs +2 -0
  80. package/lib/frameworks/express/index.cjs.map +1 -0
  81. package/lib/frameworks/express/{express.framework.d.ts → index.d.cts} +6 -5
  82. package/lib/frameworks/express/index.d.ts +18 -2
  83. package/lib/frameworks/express/index.mjs +2 -0
  84. package/lib/frameworks/express/index.mjs.map +1 -0
  85. package/lib/frameworks/fastify/index.cjs +2 -0
  86. package/lib/frameworks/fastify/index.cjs.map +1 -0
  87. package/lib/frameworks/fastify/{fastify.framework.d.ts → index.d.cts} +6 -5
  88. package/lib/frameworks/fastify/index.d.ts +18 -2
  89. package/lib/frameworks/fastify/index.mjs +2 -0
  90. package/lib/frameworks/fastify/index.mjs.map +1 -0
  91. package/lib/frameworks/hapi/index.cjs +2 -0
  92. package/lib/frameworks/hapi/index.cjs.map +1 -0
  93. package/lib/frameworks/hapi/{hapi.framework.d.ts → index.d.cts} +6 -5
  94. package/lib/frameworks/hapi/index.d.ts +18 -2
  95. package/lib/frameworks/hapi/index.mjs +2 -0
  96. package/lib/frameworks/hapi/index.mjs.map +1 -0
  97. package/lib/frameworks/koa/index.cjs +2 -0
  98. package/lib/frameworks/koa/index.cjs.map +1 -0
  99. package/lib/frameworks/koa/{koa.framework.d.ts → index.d.cts} +6 -5
  100. package/lib/frameworks/koa/index.d.ts +18 -2
  101. package/lib/frameworks/koa/index.mjs +2 -0
  102. package/lib/frameworks/koa/index.mjs.map +1 -0
  103. package/lib/frameworks/lazy/index.cjs +4 -0
  104. package/lib/frameworks/lazy/index.cjs.map +1 -0
  105. package/lib/frameworks/lazy/{lazy.framework.d.ts → index.d.cts} +7 -6
  106. package/lib/frameworks/lazy/index.d.ts +57 -2
  107. package/lib/frameworks/lazy/index.mjs +2 -0
  108. package/lib/frameworks/lazy/index.mjs.map +1 -0
  109. package/lib/frameworks/trpc/index.cjs +4 -0
  110. package/lib/frameworks/trpc/index.cjs.map +1 -0
  111. package/lib/frameworks/trpc/{trpc.framework.d.ts → index.d.cts} +12 -11
  112. package/lib/frameworks/trpc/index.d.ts +154 -2
  113. package/lib/frameworks/trpc/index.mjs +2 -0
  114. package/lib/frameworks/trpc/index.mjs.map +1 -0
  115. package/lib/handler.contract-8Cb7qLSi.d.ts +66 -0
  116. package/lib/handler.contract-TQk8iM8f.d.cts +66 -0
  117. package/lib/handlers/aws/index.cjs +10 -0
  118. package/lib/handlers/aws/index.cjs.map +1 -0
  119. package/lib/handlers/aws/{aws-stream.handler.d.ts → index.d.cts} +22 -15
  120. package/lib/handlers/aws/index.d.ts +96 -2
  121. package/lib/handlers/aws/index.mjs +2 -0
  122. package/lib/handlers/aws/index.mjs.map +1 -0
  123. package/lib/handlers/azure/index.cjs +4 -0
  124. package/lib/handlers/azure/index.cjs.map +1 -0
  125. package/lib/handlers/azure/{azure.handler.d.ts → index.d.cts} +16 -8
  126. package/lib/handlers/azure/index.d.ts +53 -2
  127. package/lib/handlers/azure/index.mjs +2 -0
  128. package/lib/handlers/azure/index.mjs.map +1 -0
  129. package/lib/handlers/default/index.cjs +4 -0
  130. package/lib/handlers/default/index.cjs.map +1 -0
  131. package/lib/handlers/default/{default.handler.d.ts → index.d.cts} +13 -6
  132. package/lib/handlers/default/index.d.ts +95 -2
  133. package/lib/handlers/default/index.mjs +2 -0
  134. package/lib/handlers/default/index.mjs.map +1 -0
  135. package/lib/handlers/digital-ocean/index.cjs +4 -0
  136. package/lib/handlers/digital-ocean/index.cjs.map +1 -0
  137. package/lib/handlers/digital-ocean/index.d.cts +25 -0
  138. package/lib/handlers/digital-ocean/index.d.ts +25 -2
  139. package/lib/handlers/digital-ocean/index.mjs +2 -0
  140. package/lib/handlers/digital-ocean/index.mjs.map +1 -0
  141. package/lib/handlers/firebase/index.cjs +4 -0
  142. package/lib/handlers/firebase/index.cjs.map +1 -0
  143. package/lib/handlers/firebase/index.d.cts +59 -0
  144. package/lib/handlers/firebase/index.d.ts +59 -3
  145. package/lib/handlers/firebase/index.mjs +2 -0
  146. package/lib/handlers/firebase/index.mjs.map +1 -0
  147. package/lib/handlers/gcp/index.cjs +4 -0
  148. package/lib/handlers/gcp/index.cjs.map +1 -0
  149. package/lib/handlers/gcp/{gcp.handler.d.ts → index.d.cts} +12 -5
  150. package/lib/handlers/gcp/index.d.ts +33 -2
  151. package/lib/handlers/gcp/index.mjs +2 -0
  152. package/lib/handlers/gcp/index.mjs.map +1 -0
  153. package/lib/handlers/huawei/index.cjs +4 -0
  154. package/lib/handlers/huawei/index.cjs.map +1 -0
  155. package/lib/handlers/huawei/{http-huawei.handler.d.ts → index.d.cts} +15 -12
  156. package/lib/handlers/huawei/index.d.ts +62 -2
  157. package/lib/handlers/huawei/index.mjs +2 -0
  158. package/lib/handlers/huawei/index.mjs.map +1 -0
  159. package/lib/{@types/headers.d.ts → headers-K2qbcurv.d.cts} +5 -4
  160. package/lib/headers-K2qbcurv.d.ts +38 -0
  161. package/lib/index.cjs +10 -0
  162. package/lib/index.cjs.map +1 -0
  163. package/lib/index.d.cts +439 -0
  164. package/lib/index.d.ts +439 -6
  165. package/lib/index.mjs +2 -0
  166. package/lib/index.mjs.map +1 -0
  167. package/lib/{core/logger.d.ts → logger-9me5n48P.d.cts} +8 -7
  168. package/lib/logger-9me5n48P.d.ts +65 -0
  169. package/lib/{core/path.d.ts → path-yBwCb8C1.d.cts} +16 -5
  170. package/lib/path-yBwCb8C1.d.ts +64 -0
  171. package/lib/{handlers/base/raw-request.d.ts → raw-request-B2vPjAfE.d.cts} +6 -5
  172. package/lib/raw-request-b6AYnkxd.d.ts +32 -0
  173. package/lib/{network/request.d.ts → request-DNNIV9ub.d.cts} +7 -7
  174. package/lib/request-sVa4pxmx.d.ts +44 -0
  175. package/lib/resolvers/aws-context/index.cjs +2 -0
  176. package/lib/resolvers/aws-context/index.cjs.map +1 -0
  177. package/lib/resolvers/aws-context/{aws-context.resolver.d.ts → index.d.cts} +10 -4
  178. package/lib/resolvers/aws-context/index.d.ts +25 -2
  179. package/lib/resolvers/aws-context/index.mjs +2 -0
  180. package/lib/resolvers/aws-context/index.mjs.map +1 -0
  181. package/lib/resolvers/callback/index.cjs +2 -0
  182. package/lib/resolvers/callback/index.cjs.map +1 -0
  183. package/lib/resolvers/callback/{callback.resolver.d.ts → index.d.cts} +10 -4
  184. package/lib/resolvers/callback/index.d.ts +29 -2
  185. package/lib/resolvers/callback/index.mjs +2 -0
  186. package/lib/resolvers/callback/index.mjs.map +1 -0
  187. package/lib/resolvers/dummy/index.cjs +2 -0
  188. package/lib/resolvers/dummy/index.cjs.map +1 -0
  189. package/lib/resolvers/dummy/index.d.cts +20 -0
  190. package/lib/resolvers/dummy/index.d.ts +20 -2
  191. package/lib/resolvers/dummy/index.mjs +2 -0
  192. package/lib/resolvers/dummy/index.mjs.map +1 -0
  193. package/lib/resolvers/promise/index.cjs +2 -0
  194. package/lib/resolvers/promise/index.cjs.map +1 -0
  195. package/lib/resolvers/promise/index.d.cts +20 -0
  196. package/lib/resolvers/promise/index.d.ts +20 -2
  197. package/lib/resolvers/promise/index.mjs +2 -0
  198. package/lib/resolvers/promise/index.mjs.map +1 -0
  199. package/package.json +565 -7
  200. package/lib/@types/binary-settings.d.ts +0 -41
  201. package/lib/@types/binary-settings.d.ts.map +0 -1
  202. package/lib/@types/binary-settings.js +0 -2
  203. package/lib/@types/binary-settings.js.map +0 -1
  204. package/lib/@types/digital-ocean/digital-ocean-http-event.d.ts +0 -37
  205. package/lib/@types/digital-ocean/digital-ocean-http-event.d.ts.map +0 -1
  206. package/lib/@types/digital-ocean/digital-ocean-http-event.js +0 -2
  207. package/lib/@types/digital-ocean/digital-ocean-http-event.js.map +0 -1
  208. package/lib/@types/digital-ocean/digital-ocean-http-response.d.ts +0 -22
  209. package/lib/@types/digital-ocean/digital-ocean-http-response.d.ts.map +0 -1
  210. package/lib/@types/digital-ocean/digital-ocean-http-response.js +0 -2
  211. package/lib/@types/digital-ocean/digital-ocean-http-response.js.map +0 -1
  212. package/lib/@types/digital-ocean/index.d.ts +0 -2
  213. package/lib/@types/digital-ocean/index.d.ts.map +0 -1
  214. package/lib/@types/digital-ocean/index.js +0 -2
  215. package/lib/@types/digital-ocean/index.js.map +0 -1
  216. package/lib/@types/headers.d.ts.map +0 -1
  217. package/lib/@types/headers.js +0 -2
  218. package/lib/@types/headers.js.map +0 -1
  219. package/lib/@types/helpers.d.ts +0 -10
  220. package/lib/@types/helpers.d.ts.map +0 -1
  221. package/lib/@types/helpers.js +0 -2
  222. package/lib/@types/helpers.js.map +0 -1
  223. package/lib/@types/huawei/huawei-api-gateway-event.d.ts +0 -81
  224. package/lib/@types/huawei/huawei-api-gateway-event.d.ts.map +0 -1
  225. package/lib/@types/huawei/huawei-api-gateway-event.js +0 -2
  226. package/lib/@types/huawei/huawei-api-gateway-event.js.map +0 -1
  227. package/lib/@types/huawei/huawei-api-gateway-response.d.ts +0 -27
  228. package/lib/@types/huawei/huawei-api-gateway-response.d.ts.map +0 -1
  229. package/lib/@types/huawei/huawei-api-gateway-response.js +0 -2
  230. package/lib/@types/huawei/huawei-api-gateway-response.js.map +0 -1
  231. package/lib/@types/huawei/huawei-context.d.ts +0 -188
  232. package/lib/@types/huawei/huawei-context.d.ts.map +0 -1
  233. package/lib/@types/huawei/huawei-context.js +0 -2
  234. package/lib/@types/huawei/huawei-context.js.map +0 -1
  235. package/lib/@types/huawei/index.d.ts +0 -4
  236. package/lib/@types/huawei/index.d.ts.map +0 -1
  237. package/lib/@types/huawei/index.js +0 -2
  238. package/lib/@types/huawei/index.js.map +0 -1
  239. package/lib/@types/index.d.ts +0 -4
  240. package/lib/@types/index.d.ts.map +0 -1
  241. package/lib/@types/index.js +0 -2
  242. package/lib/@types/index.js.map +0 -1
  243. package/lib/adapters/apollo-server/apollo-server-mutation.adapter.d.ts.map +0 -1
  244. package/lib/adapters/apollo-server/apollo-server-mutation.adapter.js +0 -2
  245. package/lib/adapters/apollo-server/apollo-server-mutation.adapter.js.map +0 -1
  246. package/lib/adapters/apollo-server/index.d.ts.map +0 -1
  247. package/lib/adapters/apollo-server/index.js +0 -2
  248. package/lib/adapters/apollo-server/index.js.map +0 -1
  249. package/lib/adapters/aws/alb.adapter.d.ts +0 -71
  250. package/lib/adapters/aws/alb.adapter.d.ts.map +0 -1
  251. package/lib/adapters/aws/alb.adapter.js +0 -2
  252. package/lib/adapters/aws/alb.adapter.js.map +0 -1
  253. package/lib/adapters/aws/api-gateway-v1.adapter.d.ts +0 -76
  254. package/lib/adapters/aws/api-gateway-v1.adapter.d.ts.map +0 -1
  255. package/lib/adapters/aws/api-gateway-v1.adapter.js +0 -2
  256. package/lib/adapters/aws/api-gateway-v1.adapter.js.map +0 -1
  257. package/lib/adapters/aws/api-gateway-v2.adapter.d.ts +0 -75
  258. package/lib/adapters/aws/api-gateway-v2.adapter.d.ts.map +0 -1
  259. package/lib/adapters/aws/api-gateway-v2.adapter.js +0 -2
  260. package/lib/adapters/aws/api-gateway-v2.adapter.js.map +0 -1
  261. package/lib/adapters/aws/base/aws-simple-adapter.d.ts +0 -83
  262. package/lib/adapters/aws/base/aws-simple-adapter.d.ts.map +0 -1
  263. package/lib/adapters/aws/base/aws-simple-adapter.js +0 -2
  264. package/lib/adapters/aws/base/aws-simple-adapter.js.map +0 -1
  265. package/lib/adapters/aws/base/index.d.ts +0 -2
  266. package/lib/adapters/aws/base/index.d.ts.map +0 -1
  267. package/lib/adapters/aws/base/index.js +0 -2
  268. package/lib/adapters/aws/base/index.js.map +0 -1
  269. package/lib/adapters/aws/dynamodb.adapter.d.ts +0 -56
  270. package/lib/adapters/aws/dynamodb.adapter.d.ts.map +0 -1
  271. package/lib/adapters/aws/dynamodb.adapter.js +0 -2
  272. package/lib/adapters/aws/dynamodb.adapter.js.map +0 -1
  273. package/lib/adapters/aws/event-bridge.adapter.d.ts +0 -63
  274. package/lib/adapters/aws/event-bridge.adapter.d.ts.map +0 -1
  275. package/lib/adapters/aws/event-bridge.adapter.js +0 -2
  276. package/lib/adapters/aws/event-bridge.adapter.js.map +0 -1
  277. package/lib/adapters/aws/index.d.ts.map +0 -1
  278. package/lib/adapters/aws/index.js +0 -2
  279. package/lib/adapters/aws/index.js.map +0 -1
  280. package/lib/adapters/aws/lambda-edge.adapter.d.ts +0 -209
  281. package/lib/adapters/aws/lambda-edge.adapter.d.ts.map +0 -1
  282. package/lib/adapters/aws/lambda-edge.adapter.js +0 -2
  283. package/lib/adapters/aws/lambda-edge.adapter.js.map +0 -1
  284. package/lib/adapters/aws/request-lambda-edge.adapter.d.ts +0 -131
  285. package/lib/adapters/aws/request-lambda-edge.adapter.d.ts.map +0 -1
  286. package/lib/adapters/aws/request-lambda-edge.adapter.js +0 -2
  287. package/lib/adapters/aws/request-lambda-edge.adapter.js.map +0 -1
  288. package/lib/adapters/aws/s3.adapter.d.ts +0 -56
  289. package/lib/adapters/aws/s3.adapter.d.ts.map +0 -1
  290. package/lib/adapters/aws/s3.adapter.js +0 -2
  291. package/lib/adapters/aws/s3.adapter.js.map +0 -1
  292. package/lib/adapters/aws/sns.adapter.d.ts +0 -56
  293. package/lib/adapters/aws/sns.adapter.d.ts.map +0 -1
  294. package/lib/adapters/aws/sns.adapter.js +0 -2
  295. package/lib/adapters/aws/sns.adapter.js.map +0 -1
  296. package/lib/adapters/aws/sqs.adapter.d.ts +0 -56
  297. package/lib/adapters/aws/sqs.adapter.d.ts.map +0 -1
  298. package/lib/adapters/aws/sqs.adapter.js +0 -2
  299. package/lib/adapters/aws/sqs.adapter.js.map +0 -1
  300. package/lib/adapters/azure/http-trigger-v4.adapter.d.ts.map +0 -1
  301. package/lib/adapters/azure/http-trigger-v4.adapter.js +0 -2
  302. package/lib/adapters/azure/http-trigger-v4.adapter.js.map +0 -1
  303. package/lib/adapters/azure/index.d.ts.map +0 -1
  304. package/lib/adapters/azure/index.js +0 -2
  305. package/lib/adapters/azure/index.js.map +0 -1
  306. package/lib/adapters/digital-ocean/http-function.adapter.d.ts +0 -65
  307. package/lib/adapters/digital-ocean/http-function.adapter.d.ts.map +0 -1
  308. package/lib/adapters/digital-ocean/http-function.adapter.js +0 -2
  309. package/lib/adapters/digital-ocean/http-function.adapter.js.map +0 -1
  310. package/lib/adapters/digital-ocean/index.d.ts.map +0 -1
  311. package/lib/adapters/digital-ocean/index.js +0 -2
  312. package/lib/adapters/digital-ocean/index.js.map +0 -1
  313. package/lib/adapters/dummy/dummy.adapter.d.ts.map +0 -1
  314. package/lib/adapters/dummy/dummy.adapter.js +0 -2
  315. package/lib/adapters/dummy/dummy.adapter.js.map +0 -1
  316. package/lib/adapters/dummy/index.d.ts.map +0 -1
  317. package/lib/adapters/dummy/index.js +0 -2
  318. package/lib/adapters/dummy/index.js.map +0 -1
  319. package/lib/adapters/huawei/huawei-api-gateway.adapter.d.ts +0 -66
  320. package/lib/adapters/huawei/huawei-api-gateway.adapter.d.ts.map +0 -1
  321. package/lib/adapters/huawei/huawei-api-gateway.adapter.js +0 -2
  322. package/lib/adapters/huawei/huawei-api-gateway.adapter.js.map +0 -1
  323. package/lib/adapters/huawei/index.d.ts.map +0 -1
  324. package/lib/adapters/huawei/index.js +0 -2
  325. package/lib/adapters/huawei/index.js.map +0 -1
  326. package/lib/contracts/adapter.contract.d.ts +0 -152
  327. package/lib/contracts/adapter.contract.d.ts.map +0 -1
  328. package/lib/contracts/adapter.contract.js +0 -2
  329. package/lib/contracts/adapter.contract.js.map +0 -1
  330. package/lib/contracts/framework.contract.d.ts.map +0 -1
  331. package/lib/contracts/framework.contract.js +0 -2
  332. package/lib/contracts/framework.contract.js.map +0 -1
  333. package/lib/contracts/handler.contract.d.ts +0 -25
  334. package/lib/contracts/handler.contract.d.ts.map +0 -1
  335. package/lib/contracts/handler.contract.js +0 -2
  336. package/lib/contracts/handler.contract.js.map +0 -1
  337. package/lib/contracts/index.d.ts +0 -5
  338. package/lib/contracts/index.d.ts.map +0 -1
  339. package/lib/contracts/index.js +0 -2
  340. package/lib/contracts/index.js.map +0 -1
  341. package/lib/contracts/resolver.contract.d.ts +0 -83
  342. package/lib/contracts/resolver.contract.d.ts.map +0 -1
  343. package/lib/contracts/resolver.contract.js +0 -2
  344. package/lib/contracts/resolver.contract.js.map +0 -1
  345. package/lib/core/base-handler.d.ts.map +0 -1
  346. package/lib/core/base-handler.js +0 -2
  347. package/lib/core/base-handler.js.map +0 -1
  348. package/lib/core/constants.d.ts.map +0 -1
  349. package/lib/core/constants.js +0 -2
  350. package/lib/core/constants.js.map +0 -1
  351. package/lib/core/current-invoke.d.ts +0 -48
  352. package/lib/core/current-invoke.d.ts.map +0 -1
  353. package/lib/core/current-invoke.js +0 -2
  354. package/lib/core/current-invoke.js.map +0 -1
  355. package/lib/core/event-body.d.ts +0 -22
  356. package/lib/core/event-body.d.ts.map +0 -1
  357. package/lib/core/event-body.js +0 -2
  358. package/lib/core/event-body.js.map +0 -1
  359. package/lib/core/headers.d.ts +0 -73
  360. package/lib/core/headers.d.ts.map +0 -1
  361. package/lib/core/headers.js +0 -3
  362. package/lib/core/headers.js.map +0 -1
  363. package/lib/core/index.d.ts +0 -12
  364. package/lib/core/index.d.ts.map +0 -1
  365. package/lib/core/index.js +0 -2
  366. package/lib/core/index.js.map +0 -1
  367. package/lib/core/is-binary.d.ts +0 -73
  368. package/lib/core/is-binary.d.ts.map +0 -1
  369. package/lib/core/is-binary.js +0 -2
  370. package/lib/core/is-binary.js.map +0 -1
  371. package/lib/core/logger.d.ts.map +0 -1
  372. package/lib/core/logger.js +0 -2
  373. package/lib/core/logger.js.map +0 -1
  374. package/lib/core/no-op.d.ts +0 -8
  375. package/lib/core/no-op.d.ts.map +0 -1
  376. package/lib/core/no-op.js +0 -2
  377. package/lib/core/no-op.js.map +0 -1
  378. package/lib/core/optional.d.ts +0 -22
  379. package/lib/core/optional.d.ts.map +0 -1
  380. package/lib/core/optional.js +0 -2
  381. package/lib/core/optional.js.map +0 -1
  382. package/lib/core/path.d.ts.map +0 -1
  383. package/lib/core/path.js +0 -2
  384. package/lib/core/path.js.map +0 -1
  385. package/lib/core/stream.d.ts +0 -21
  386. package/lib/core/stream.d.ts.map +0 -1
  387. package/lib/core/stream.js +0 -2
  388. package/lib/core/stream.js.map +0 -1
  389. package/lib/frameworks/apollo-server/apollo-server.framework.d.ts.map +0 -1
  390. package/lib/frameworks/apollo-server/apollo-server.framework.js +0 -2
  391. package/lib/frameworks/apollo-server/apollo-server.framework.js.map +0 -1
  392. package/lib/frameworks/apollo-server/index.d.ts.map +0 -1
  393. package/lib/frameworks/apollo-server/index.js +0 -2
  394. package/lib/frameworks/apollo-server/index.js.map +0 -1
  395. package/lib/frameworks/body-parser/base-body-parser.framework.d.ts +0 -69
  396. package/lib/frameworks/body-parser/base-body-parser.framework.d.ts.map +0 -1
  397. package/lib/frameworks/body-parser/base-body-parser.framework.js +0 -2
  398. package/lib/frameworks/body-parser/base-body-parser.framework.js.map +0 -1
  399. package/lib/frameworks/body-parser/index.d.ts.map +0 -1
  400. package/lib/frameworks/body-parser/index.js +0 -2
  401. package/lib/frameworks/body-parser/index.js.map +0 -1
  402. package/lib/frameworks/body-parser/json-body-parser.framework.d.ts +0 -26
  403. package/lib/frameworks/body-parser/json-body-parser.framework.d.ts.map +0 -1
  404. package/lib/frameworks/body-parser/json-body-parser.framework.js +0 -2
  405. package/lib/frameworks/body-parser/json-body-parser.framework.js.map +0 -1
  406. package/lib/frameworks/body-parser/raw-body-parser.framework.d.ts +0 -26
  407. package/lib/frameworks/body-parser/raw-body-parser.framework.d.ts.map +0 -1
  408. package/lib/frameworks/body-parser/raw-body-parser.framework.js +0 -2
  409. package/lib/frameworks/body-parser/raw-body-parser.framework.js.map +0 -1
  410. package/lib/frameworks/body-parser/text-body-parser.framework.d.ts +0 -26
  411. package/lib/frameworks/body-parser/text-body-parser.framework.d.ts.map +0 -1
  412. package/lib/frameworks/body-parser/text-body-parser.framework.js +0 -2
  413. package/lib/frameworks/body-parser/text-body-parser.framework.js.map +0 -1
  414. package/lib/frameworks/body-parser/urlencoded-body-parser.framework.d.ts +0 -26
  415. package/lib/frameworks/body-parser/urlencoded-body-parser.framework.d.ts.map +0 -1
  416. package/lib/frameworks/body-parser/urlencoded-body-parser.framework.js +0 -2
  417. package/lib/frameworks/body-parser/urlencoded-body-parser.framework.js.map +0 -1
  418. package/lib/frameworks/cors/cors.framework.d.ts.map +0 -1
  419. package/lib/frameworks/cors/cors.framework.js +0 -3
  420. package/lib/frameworks/cors/cors.framework.js.map +0 -1
  421. package/lib/frameworks/cors/index.d.ts.map +0 -1
  422. package/lib/frameworks/cors/index.js +0 -2
  423. package/lib/frameworks/cors/index.js.map +0 -1
  424. package/lib/frameworks/deepkit/http-deepkit.framework.d.ts.map +0 -1
  425. package/lib/frameworks/deepkit/http-deepkit.framework.js +0 -2
  426. package/lib/frameworks/deepkit/http-deepkit.framework.js.map +0 -1
  427. package/lib/frameworks/deepkit/index.d.ts.map +0 -1
  428. package/lib/frameworks/deepkit/index.js +0 -2
  429. package/lib/frameworks/deepkit/index.js.map +0 -1
  430. package/lib/frameworks/express/express.framework.d.ts.map +0 -1
  431. package/lib/frameworks/express/express.framework.js +0 -2
  432. package/lib/frameworks/express/express.framework.js.map +0 -1
  433. package/lib/frameworks/express/index.d.ts.map +0 -1
  434. package/lib/frameworks/express/index.js +0 -2
  435. package/lib/frameworks/express/index.js.map +0 -1
  436. package/lib/frameworks/fastify/fastify.framework.d.ts.map +0 -1
  437. package/lib/frameworks/fastify/fastify.framework.js +0 -2
  438. package/lib/frameworks/fastify/fastify.framework.js.map +0 -1
  439. package/lib/frameworks/fastify/helpers/no-op-content-parser.d.ts +0 -14
  440. package/lib/frameworks/fastify/helpers/no-op-content-parser.d.ts.map +0 -1
  441. package/lib/frameworks/fastify/helpers/no-op-content-parser.js +0 -2
  442. package/lib/frameworks/fastify/helpers/no-op-content-parser.js.map +0 -1
  443. package/lib/frameworks/fastify/index.d.ts.map +0 -1
  444. package/lib/frameworks/fastify/index.js +0 -2
  445. package/lib/frameworks/fastify/index.js.map +0 -1
  446. package/lib/frameworks/hapi/hapi.framework.d.ts.map +0 -1
  447. package/lib/frameworks/hapi/hapi.framework.js +0 -2
  448. package/lib/frameworks/hapi/hapi.framework.js.map +0 -1
  449. package/lib/frameworks/hapi/index.d.ts.map +0 -1
  450. package/lib/frameworks/hapi/index.js +0 -2
  451. package/lib/frameworks/hapi/index.js.map +0 -1
  452. package/lib/frameworks/koa/index.d.ts.map +0 -1
  453. package/lib/frameworks/koa/index.js +0 -2
  454. package/lib/frameworks/koa/index.js.map +0 -1
  455. package/lib/frameworks/koa/koa.framework.d.ts.map +0 -1
  456. package/lib/frameworks/koa/koa.framework.js +0 -2
  457. package/lib/frameworks/koa/koa.framework.js.map +0 -1
  458. package/lib/frameworks/lazy/index.d.ts.map +0 -1
  459. package/lib/frameworks/lazy/index.js +0 -2
  460. package/lib/frameworks/lazy/index.js.map +0 -1
  461. package/lib/frameworks/lazy/lazy.framework.d.ts.map +0 -1
  462. package/lib/frameworks/lazy/lazy.framework.js +0 -2
  463. package/lib/frameworks/lazy/lazy.framework.js.map +0 -1
  464. package/lib/frameworks/trpc/index.d.ts.map +0 -1
  465. package/lib/frameworks/trpc/index.js +0 -2
  466. package/lib/frameworks/trpc/index.js.map +0 -1
  467. package/lib/frameworks/trpc/trpc.framework.d.ts.map +0 -1
  468. package/lib/frameworks/trpc/trpc.framework.js +0 -2
  469. package/lib/frameworks/trpc/trpc.framework.js.map +0 -1
  470. package/lib/handlers/aws/aws-stream.handler.d.ts.map +0 -1
  471. package/lib/handlers/aws/aws-stream.handler.js +0 -2
  472. package/lib/handlers/aws/aws-stream.handler.js.map +0 -1
  473. package/lib/handlers/aws/index.d.ts.map +0 -1
  474. package/lib/handlers/aws/index.js +0 -2
  475. package/lib/handlers/aws/index.js.map +0 -1
  476. package/lib/handlers/azure/azure.handler.d.ts.map +0 -1
  477. package/lib/handlers/azure/azure.handler.js +0 -2
  478. package/lib/handlers/azure/azure.handler.js.map +0 -1
  479. package/lib/handlers/azure/index.d.ts.map +0 -1
  480. package/lib/handlers/azure/index.js +0 -2
  481. package/lib/handlers/azure/index.js.map +0 -1
  482. package/lib/handlers/base/index.d.ts +0 -2
  483. package/lib/handlers/base/index.d.ts.map +0 -1
  484. package/lib/handlers/base/index.js +0 -2
  485. package/lib/handlers/base/index.js.map +0 -1
  486. package/lib/handlers/base/raw-request.d.ts.map +0 -1
  487. package/lib/handlers/base/raw-request.js +0 -2
  488. package/lib/handlers/base/raw-request.js.map +0 -1
  489. package/lib/handlers/default/default.handler.d.ts.map +0 -1
  490. package/lib/handlers/default/default.handler.js +0 -2
  491. package/lib/handlers/default/default.handler.js.map +0 -1
  492. package/lib/handlers/default/index.d.ts.map +0 -1
  493. package/lib/handlers/default/index.js +0 -2
  494. package/lib/handlers/default/index.js.map +0 -1
  495. package/lib/handlers/digital-ocean/digital-ocean.handler.d.ts +0 -17
  496. package/lib/handlers/digital-ocean/digital-ocean.handler.d.ts.map +0 -1
  497. package/lib/handlers/digital-ocean/digital-ocean.handler.js +0 -2
  498. package/lib/handlers/digital-ocean/digital-ocean.handler.js.map +0 -1
  499. package/lib/handlers/digital-ocean/index.d.ts.map +0 -1
  500. package/lib/handlers/digital-ocean/index.js +0 -2
  501. package/lib/handlers/digital-ocean/index.js.map +0 -1
  502. package/lib/handlers/firebase/http-firebase-v2.handler.d.ts +0 -27
  503. package/lib/handlers/firebase/http-firebase-v2.handler.d.ts.map +0 -1
  504. package/lib/handlers/firebase/http-firebase-v2.handler.js +0 -2
  505. package/lib/handlers/firebase/http-firebase-v2.handler.js.map +0 -1
  506. package/lib/handlers/firebase/http-firebase.handler.d.ts +0 -19
  507. package/lib/handlers/firebase/http-firebase.handler.d.ts.map +0 -1
  508. package/lib/handlers/firebase/http-firebase.handler.js +0 -2
  509. package/lib/handlers/firebase/http-firebase.handler.js.map +0 -1
  510. package/lib/handlers/firebase/index.d.ts.map +0 -1
  511. package/lib/handlers/firebase/index.js +0 -2
  512. package/lib/handlers/firebase/index.js.map +0 -1
  513. package/lib/handlers/gcp/gcp.handler.d.ts.map +0 -1
  514. package/lib/handlers/gcp/gcp.handler.js +0 -2
  515. package/lib/handlers/gcp/gcp.handler.js.map +0 -1
  516. package/lib/handlers/gcp/index.d.ts.map +0 -1
  517. package/lib/handlers/gcp/index.js +0 -2
  518. package/lib/handlers/gcp/index.js.map +0 -1
  519. package/lib/handlers/huawei/http-huawei.handler.d.ts.map +0 -1
  520. package/lib/handlers/huawei/http-huawei.handler.js +0 -2
  521. package/lib/handlers/huawei/http-huawei.handler.js.map +0 -1
  522. package/lib/handlers/huawei/index.d.ts.map +0 -1
  523. package/lib/handlers/huawei/index.js +0 -2
  524. package/lib/handlers/huawei/index.js.map +0 -1
  525. package/lib/index.d.ts.map +0 -1
  526. package/lib/index.doc.js +0 -2
  527. package/lib/index.doc.js.map +0 -1
  528. package/lib/index.js +0 -2
  529. package/lib/index.js.map +0 -1
  530. package/lib/network/index.d.ts +0 -5
  531. package/lib/network/index.d.ts.map +0 -1
  532. package/lib/network/index.js +0 -2
  533. package/lib/network/index.js.map +0 -1
  534. package/lib/network/request.d.ts.map +0 -1
  535. package/lib/network/request.js +0 -2
  536. package/lib/network/request.js.map +0 -1
  537. package/lib/network/response-stream.d.ts +0 -41
  538. package/lib/network/response-stream.d.ts.map +0 -1
  539. package/lib/network/response-stream.js +0 -7
  540. package/lib/network/response-stream.js.map +0 -1
  541. package/lib/network/response.d.ts +0 -48
  542. package/lib/network/response.d.ts.map +0 -1
  543. package/lib/network/response.js +0 -4
  544. package/lib/network/response.js.map +0 -1
  545. package/lib/network/utils.d.ts +0 -9
  546. package/lib/network/utils.d.ts.map +0 -1
  547. package/lib/network/utils.js +0 -2
  548. package/lib/network/utils.js.map +0 -1
  549. package/lib/resolvers/aws-context/aws-context.resolver.d.ts.map +0 -1
  550. package/lib/resolvers/aws-context/aws-context.resolver.js +0 -2
  551. package/lib/resolvers/aws-context/aws-context.resolver.js.map +0 -1
  552. package/lib/resolvers/aws-context/index.d.ts.map +0 -1
  553. package/lib/resolvers/aws-context/index.js +0 -2
  554. package/lib/resolvers/aws-context/index.js.map +0 -1
  555. package/lib/resolvers/callback/callback.resolver.d.ts.map +0 -1
  556. package/lib/resolvers/callback/callback.resolver.js +0 -2
  557. package/lib/resolvers/callback/callback.resolver.js.map +0 -1
  558. package/lib/resolvers/callback/index.d.ts.map +0 -1
  559. package/lib/resolvers/callback/index.js +0 -2
  560. package/lib/resolvers/callback/index.js.map +0 -1
  561. package/lib/resolvers/dummy/dummy.resolver.d.ts +0 -14
  562. package/lib/resolvers/dummy/dummy.resolver.d.ts.map +0 -1
  563. package/lib/resolvers/dummy/dummy.resolver.js +0 -2
  564. package/lib/resolvers/dummy/dummy.resolver.js.map +0 -1
  565. package/lib/resolvers/dummy/index.d.ts.map +0 -1
  566. package/lib/resolvers/dummy/index.js +0 -2
  567. package/lib/resolvers/dummy/index.js.map +0 -1
  568. package/lib/resolvers/promise/index.d.ts.map +0 -1
  569. package/lib/resolvers/promise/index.js +0 -2
  570. package/lib/resolvers/promise/index.js.map +0 -1
  571. package/lib/resolvers/promise/promise.resolver.d.ts +0 -14
  572. package/lib/resolvers/promise/promise.resolver.d.ts.map +0 -1
  573. package/lib/resolvers/promise/promise.resolver.js +0 -2
  574. package/lib/resolvers/promise/promise.resolver.js.map +0 -1
  575. package/lib/serverless-adapter.d.ts +0 -119
  576. package/lib/serverless-adapter.d.ts.map +0 -1
  577. package/lib/serverless-adapter.js +0 -2
  578. package/lib/serverless-adapter.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"handler.contract.js","sources":["../../src/contracts/handler.contract.ts"],"sourcesContent":["//#region Imports\n\nimport { BinarySettings } from '../@types';\nimport { ILogger } from '../core';\nimport { AdapterContract } from './adapter.contract';\nimport { FrameworkContract } from './framework.contract';\nimport { ResolverContract } from './resolver.contract';\n\n//#endregion\n\n/**\n * The function used to handle serverless requests\n *\n * @breadcrumb Contracts / HandlerContract\n * @public\n */\nexport type ServerlessHandler<TReturn> = (...args: any[]) => TReturn;\n\n/**\n * The interface that represents the contract between the handler and the real implementation\n *\n * @breadcrumb Contracts / HandlerContract\n * @public\n */\nexport interface HandlerContract<\n TApp,\n TEvent,\n TContext,\n TCallback,\n TResponse,\n TReturn,\n> {\n /**\n * Get the handler that will handle serverless requests\n */\n getHandler(\n app: TApp,\n framework: FrameworkContract<TApp>,\n adapters: AdapterContract<TEvent, TContext, TResponse>[],\n resolverFactory: ResolverContract<\n TEvent,\n TContext,\n TCallback,\n TResponse,\n TReturn\n >,\n binarySettings: BinarySettings,\n respondWithErrors: boolean,\n log: ILogger,\n ): ServerlessHandler<TReturn>;\n}\n"],"names":[],"mappings":"kiBAAA,yBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,wBAAA"}
@@ -1,5 +0,0 @@
1
- export * from './adapter.contract';
2
- export * from './framework.contract';
3
- export * from './handler.contract';
4
- export * from './resolver.contract';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
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,2 +0,0 @@
1
- "use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__reExport=(target,mod,secondTarget)=>(__copyProps(target,mod,"default"),secondTarget&&__copyProps(secondTarget,mod,"default")),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),contracts_exports={};module.exports=__toCommonJS(contracts_exports);__reExport(contracts_exports,require("./adapter.contract"),module.exports);__reExport(contracts_exports,require("./framework.contract"),module.exports);__reExport(contracts_exports,require("./handler.contract"),module.exports);__reExport(contracts_exports,require("./resolver.contract"),module.exports);
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../src/contracts/index.ts"],"sourcesContent":["export * from './adapter.contract';\nexport * from './framework.contract';\nexport * from './handler.contract';\nexport * from './resolver.contract';\n"],"names":[],"mappings":"kqBAAA,kBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,iBAAA,EAAA,WAAA,kBAAc,QAAd,oBAAA,EAAA,OAAA,OAAA,EACA,WAAA,kBAAc,QADd,sBAAA,EAAA,OAAA,OAAA,EAEA,WAAA,kBAAc,QAFd,oBAAA,EAAA,OAAA,OAAA,EAGA,WAAA,kBAAc,QAHd,qBAAA,EAAA,OAAA,OAAA"}
@@ -1,83 +0,0 @@
1
- import { ILogger } from '../core';
2
- import { AdapterContract } from './adapter.contract';
3
- /**
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
8
- */
9
- export type Resolver<TResponse, TReturn> = {
10
- /**
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
12
- *
13
- * @param task - The task to be executed
14
- */
15
- run(task: () => Promise<TResponse>): TReturn;
16
- };
17
- /**
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
22
- */
23
- export type DelegatedResolver<TResponse> = {
24
- /**
25
- * Send the success response to the client
26
- *
27
- * @param success - The serverless response
28
- */
29
- succeed: (response: TResponse) => void;
30
- /**
31
- * Send the error response to the client
32
- *
33
- * @param error - The error object
34
- */
35
- fail: (error: Error) => void;
36
- };
37
- /**
38
- * The createResolver contract props
39
- *
40
- * @breadcrumb Contracts / ResolverContract
41
- * @public
42
- */
43
- export type ResolverProps<TEvent, TContext, TCallback, TResponse> = {
44
- /**
45
- * The event sent by the serverless environment
46
- */
47
- event: TEvent;
48
- /**
49
- * Indicates whether to forward the (error.stack) or not to the client
50
- */
51
- respondWithErrors: boolean;
52
- /**
53
- * The instance of the logger
54
- */
55
- log: ILogger;
56
- /**
57
- * The instance of the adapter
58
- */
59
- adapter: AdapterContract<TEvent, TContext, TResponse>;
60
- /**
61
- * The context sent by serverless
62
- */
63
- context?: TContext;
64
- /**
65
- * The callback sent by serverless
66
- */
67
- callback?: TCallback;
68
- };
69
- /**
70
- * The interface that represents the contract used to send the response to the client
71
- *
72
- * @breadcrumb Contracts / ResolverContract
73
- * @public
74
- */
75
- export interface ResolverContract<TEvent, TContext, TCallback, TResponse, TReturn> {
76
- /**
77
- * Create the resolver based on the context, callback or promise
78
- *
79
- * @param props - The props used to create the resolver
80
- */
81
- createResolver(props: ResolverProps<TEvent, TContext, TCallback, TResponse>): Resolver<TResponse, TReturn>;
82
- }
83
- //# sourceMappingURL=resolver.contract.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolver.contract.d.ts","sourceRoot":"","sources":["../../src/contracts/resolver.contract.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIrD;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,CAAC,SAAS,EAAE,OAAO,IAAI;IACzC;;;;OAIG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC;CAC9C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,CAAC,SAAS,IAAI;IACzC;;;;OAIG;IACH,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,IAAI,CAAC;IAEvC;;;;OAIG;IACH,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAC9B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,IAAI;IAClE;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,iBAAiB,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,GAAG,EAAE,OAAO,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,eAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IAEtD;;OAEG;IACH,OAAO,CAAC,EAAE,QAAQ,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB,CAC/B,MAAM,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,OAAO;IAEP;;;;OAIG;IACH,cAAc,CACZ,KAAK,EAAE,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,GAC3D,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;CACjC"}
@@ -1,2 +0,0 @@
1
- "use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),resolver_contract_exports={};module.exports=__toCommonJS(resolver_contract_exports);
2
- //# sourceMappingURL=resolver.contract.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolver.contract.js","sources":["../../src/contracts/resolver.contract.ts"],"sourcesContent":["//#region Imports\n\nimport { ILogger } from '../core';\nimport { AdapterContract } from './adapter.contract';\n\n//#endregion\n\n/**\n * The type that represents a resolver used to send the response, error or success, to the client\n *\n * @breadcrumb Contracts / ResolverContract\n * @public\n */\nexport type Resolver<TResponse, TReturn> = {\n /**\n * 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\n *\n * @param task - The task to be executed\n */\n run(task: () => Promise<TResponse>): TReturn;\n};\n\n/**\n * The type that represents a delegate resolver that is passed to the adapter to handle what to do when an error occurs during forwarding.\n *\n * @breadcrumb Contracts / ResolverContract\n * @public\n */\nexport type DelegatedResolver<TResponse> = {\n /**\n * Send the success response to the client\n *\n * @param success - The serverless response\n */\n succeed: (response: TResponse) => void;\n\n /**\n * Send the error response to the client\n *\n * @param error - The error object\n */\n fail: (error: Error) => void;\n};\n\n/**\n * The createResolver contract props\n *\n * @breadcrumb Contracts / ResolverContract\n * @public\n */\nexport type ResolverProps<TEvent, TContext, TCallback, TResponse> = {\n /**\n * The event sent by the serverless environment\n */\n event: TEvent;\n\n /**\n * Indicates whether to forward the (error.stack) or not to the client\n */\n respondWithErrors: boolean;\n\n /**\n * The instance of the logger\n */\n log: ILogger;\n\n /**\n * The instance of the adapter\n */\n adapter: AdapterContract<TEvent, TContext, TResponse>;\n\n /**\n * The context sent by serverless\n */\n context?: TContext;\n\n /**\n * The callback sent by serverless\n */\n callback?: TCallback;\n};\n\n/**\n * The interface that represents the contract used to send the response to the client\n *\n * @breadcrumb Contracts / ResolverContract\n * @public\n */\nexport interface ResolverContract<\n TEvent,\n TContext,\n TCallback,\n TResponse,\n TReturn,\n> {\n /**\n * Create the resolver based on the context, callback or promise\n *\n * @param props - The props used to create the resolver\n */\n createResolver(\n props: ResolverProps<TEvent, TContext, TCallback, TResponse>,\n ): Resolver<TResponse, TReturn>;\n}\n"],"names":[],"mappings":"kiBAAA,0BAAA,CAAA,EAAA,OAAA,QAAA,aAAA,yBAAA"}
@@ -1 +0,0 @@
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,EACL,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAIlC;;;;;GAKG;AACH,8BAAsB,WAAW,CAC/B,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,OAAO,CACP,YACE,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC;IAIxE;;OAEG;aACa,UAAU,CACxB,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;IAM7B;;;;;;;OAOG;IACH,SAAS,CAAC,2BAA2B,CACnC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,QAAQ,EACjB,QAAQ,EAAE,eAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,EACxD,GAAG,EAAE,OAAO,GACX,eAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC;IAsB/C;;;;OAIG;IACH,SAAS,CAAC,8CAA8C,CACtD,aAAa,EAAE,cAAc,GAC5B,CAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,kBAAkB,CAAC;CAiB9D"}
@@ -1,2 +0,0 @@
1
- "use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),base_handler_exports={};__export(base_handler_exports,{BaseHandler:()=>BaseHandler});module.exports=__toCommonJS(base_handler_exports);var import_network=require("../network");class BaseHandler{getAdapterByEventAndContext(event,context,adapters,log){const resolvedAdapters=adapters.filter(adapter=>adapter.canHandle(event,context,log));if(resolvedAdapters.length===0)throw new Error("SERVERLESS_ADAPTER: Couldn't find adapter to handle this event.");if(resolvedAdapters.length>1)throw new Error(`SERVERLESS_ADAPTER: Two or more adapters was resolved by the event, the adapters are: ${adapters.map(adapter=>adapter.getAdapterName()).join(", ")}.`);return resolvedAdapters[0]}getServerlessRequestResponseFromAdapterRequest(requestValues){const request=new import_network.ServerlessRequest({method:requestValues.method,headers:requestValues.headers,body:requestValues.body,remoteAddress:requestValues.remoteAddress,url:requestValues.path}),response=new import_network.ServerlessResponse({method:requestValues.method});return[request,response]}}
2
- //# sourceMappingURL=base-handler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-handler.js","sources":["../../src/core/base-handler.ts"],"sourcesContent":["//#region Imports\n\nimport { BinarySettings } from '../@types';\nimport {\n AdapterContract,\n AdapterRequest,\n FrameworkContract,\n HandlerContract,\n ResolverContract,\n ServerlessHandler,\n} from '../contracts';\nimport { ServerlessRequest, ServerlessResponse } from '../network';\nimport { ILogger } from './index';\n\n//#endregion\n\n/**\n * The abstract class that represents the base class for a handler\n *\n * @breadcrumb Core\n * @public\n */\nexport abstract class BaseHandler<\n TApp,\n TEvent,\n TContext,\n TCallback,\n TResponse,\n TReturn,\n> implements\n HandlerContract<TApp, TEvent, TContext, TCallback, TResponse, TReturn>\n{\n //#region Public Methods\n\n /**\n * Get the handler that will handle serverless requests\n */\n public abstract getHandler(\n app: TApp,\n framework: FrameworkContract<TApp>,\n adapters: AdapterContract<TEvent, TContext, TResponse>[],\n resolverFactory: ResolverContract<\n TEvent,\n TContext,\n TCallback,\n TResponse,\n TReturn\n >,\n binarySettings: BinarySettings,\n respondWithErrors: boolean,\n log: ILogger,\n ): ServerlessHandler<TReturn>;\n\n //#endregion\n\n //#region Protected Methods\n\n /**\n * Get the adapter to handle a specific event and context\n *\n * @param event - The event sent by serverless\n * @param context - The context sent by serverless\n * @param adapters - The list of adapters\n * @param log - The instance of logger\n */\n protected getAdapterByEventAndContext(\n event: TEvent,\n context: TContext,\n adapters: AdapterContract<TEvent, TContext, TResponse>[],\n log: ILogger,\n ): AdapterContract<TEvent, TContext, TResponse> {\n const resolvedAdapters = adapters.filter(adapter =>\n adapter.canHandle(event, context, log),\n );\n\n if (resolvedAdapters.length === 0) {\n throw new Error(\n \"SERVERLESS_ADAPTER: Couldn't find adapter to handle this event.\",\n );\n }\n\n if (resolvedAdapters.length > 1) {\n throw new Error(\n `SERVERLESS_ADAPTER: Two or more adapters was resolved by the event, the adapters are: ${adapters\n .map(adapter => adapter.getAdapterName())\n .join(', ')}.`,\n );\n }\n\n return resolvedAdapters[0];\n }\n\n /**\n * Get serverless request and response frmo the adapter request\n *\n * @param requestValues - The request values from adapter\n */\n protected getServerlessRequestResponseFromAdapterRequest(\n requestValues: AdapterRequest,\n ): [request: ServerlessRequest, response: ServerlessResponse] {\n const request = new ServerlessRequest({\n method: requestValues.method,\n headers: requestValues.headers,\n body: requestValues.body,\n remoteAddress: requestValues.remoteAddress,\n url: requestValues.path,\n });\n\n const response = new ServerlessResponse({\n method: requestValues.method,\n });\n\n return [request, response];\n }\n\n //#endregion\n}\n"],"names":[],"mappings":"ooBAAA,qBAAA,CAAA,EAAA,SAAA,qBAAA,CAAA,YAAA,IAAA,WAAA,CAAA,EAAA,OAAA,QAAA,aAAA,oBAAA,EAWA,IAAsD,eAAA,QAAA,YAAA,EAW/C,MAAe,WAStB,CAkCY,4BACR,MACA,QACA,SACA,IAC8C,CAC9C,MAAM,iBAAmB,SAAS,OAChC,SAAA,QAAQ,UAAU,MAAO,QAAS,GAAG,CAAA,EAGnC,GAAA,iBAAiB,SAAW,EAC9B,MAAM,IAAI,MACR,iEAAA,EAIA,GAAA,iBAAiB,OAAS,EAC5B,MAAM,IAAI,MACR,yFAAyF,SACtF,IAAe,SAAA,QAAQ,gBAAgB,EACvC,KAAK,IAAI,CAAC,GAAA,EAIjB,OAAO,iBAAiB,CAAC,CAC3B,CAOU,+CACR,cAC4D,CACtD,MAAA,QAAU,IAAI,eAAkB,kBAAA,CACpC,OAAQ,cAAc,OACtB,QAAS,cAAc,QACvB,KAAM,cAAc,KACpB,cAAe,cAAc,cAC7B,IAAK,cAAc,IAAA,CACpB,EAEK,SAAW,IAAI,eAAmB,mBAAA,CACtC,OAAQ,cAAc,MAAA,CACvB,EAEM,MAAA,CAAC,QAAS,QAAQ,CAC3B,CAGF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,EAA8B,CAAC;AAE5E;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,EAWhD,CAAC;AAEF;;;;;GAKG;AAEH,MAAM,MAAM,cAAc,GAAG,EAAE,CAAC;AAEhC;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,cAAmB,CAAC"}
@@ -1,2 +0,0 @@
1
- "use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),constants_exports={};__export(constants_exports,{DEFAULT_BINARY_CONTENT_TYPES:()=>DEFAULT_BINARY_CONTENT_TYPES,DEFAULT_BINARY_ENCODINGS:()=>DEFAULT_BINARY_ENCODINGS,EmptyResponse:()=>EmptyResponse});module.exports=__toCommonJS(constants_exports);const DEFAULT_BINARY_ENCODINGS=["gzip","deflate","br"],DEFAULT_BINARY_CONTENT_TYPES=["image/png","image/jpeg","image/jpg","image/avif","image/bmp","image/x-png","image/gif","image/webp","video/mp4","application/pdf"],EmptyResponse={};
2
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sources":["../../src/core/constants.ts"],"sourcesContent":["/**\n * Default encodings that are treated as binary, they are compared with the `Content-Encoding` header.\n *\n * @breadcrumb Core / Constants\n * @defaultValue ['gzip', 'deflate', 'br']\n * @public\n */\nexport const DEFAULT_BINARY_ENCODINGS: string[] = ['gzip', 'deflate', 'br'];\n\n/**\n * Default content types that are treated as binary, they are compared with the `Content-Type` header.\n *\n * @breadcrumb Core / Constants\n * @defaultValue ['image/png', 'image/jpeg', 'image/jpg', 'image/avif', 'image/bmp', 'image/x-png', 'image/gif', 'image/webp', 'video/mp4', 'application/pdf']\n * @public\n */\nexport const DEFAULT_BINARY_CONTENT_TYPES: string[] = [\n 'image/png',\n 'image/jpeg',\n 'image/jpg',\n 'image/avif',\n 'image/bmp',\n 'image/x-png',\n 'image/gif',\n 'image/webp',\n 'video/mp4',\n 'application/pdf',\n];\n\n/**\n * Type alias for empty response and can be used on some adapters when the adapter does not need to return a response.\n *\n * @breadcrumb Core / Constants\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport type IEmptyResponse = {};\n\n/**\n * Constant for empty response and can be used on some adapters when the adapter does not need to return a response.\n *\n * @breadcrumb Core / Constants\n * @public\n */\nexport const EmptyResponse: IEmptyResponse = {};\n"],"names":[],"mappings":"ooBAAA,kBAAA,CAAA,EAAA,SAAA,kBAAA,CAAA,6BAAA,IAAA,6BAAA,yBAAA,IAAA,yBAAA,cAAA,IAAA,aAAA,CAAA,EAAA,OAAA,QAAA,aAAA,iBAAA,EAOO,MAAM,yBAAqC,CAAC,OAAQ,UAAW,IAAI,EAS7D,6BAAyC,CACpD,YACA,aACA,YACA,aACA,YACA,cACA,YACA,aACA,YACA,iBACF,EAiBa,cAAgC,CAAC"}
@@ -1,48 +0,0 @@
1
- /**
2
- * The type that represents the object that handles the references to the event created by the serverless trigger or context created by the serverless environment.
3
- *
4
- * @breadcrumb Core / Current Invoke
5
- * @public
6
- */
7
- export type CurrentInvoke<TEvent, TContext> = {
8
- /**
9
- * The event created by the serverless trigger
10
- *
11
- * @remarks It's only null when you call {@link getCurrentInvoke} outside this library's pipeline.
12
- */
13
- event: TEvent | null;
14
- /**
15
- * The context created by the serverless environment
16
- *
17
- * @remarks It's only null when you call {@link getCurrentInvoke} outside this library's pipeline.
18
- */
19
- context: TContext | null;
20
- };
21
- /**
22
- * Get the reference to the event created by the serverless trigger or context created by the serverless environment.
23
- *
24
- * @example
25
- * ```typescript
26
- * import type { ALBEvent, Context } from 'aws-lambda';
27
- *
28
- * // inside the method that handles the aws alb request.
29
- * const { event, context } = getCurrentInvoke<ALBEvent, Context>();
30
- * ```
31
- *
32
- * @breadcrumb Core / Current Invoke
33
- * @public
34
- */
35
- export declare function getCurrentInvoke<TEvent = any, TContext = any>(): CurrentInvoke<TEvent, TContext>;
36
- /**
37
- * Method that saves to the event created by the serverless trigger or context created by the serverless environment.
38
- *
39
- * @remarks This method MUST NOT be called by you, this method MUST only be used internally in this library.
40
- *
41
- * @param event - The event created by the serverless trigger
42
- * @param context - The context created by the serverless environment
43
- *
44
- * @breadcrumb Core / Current Invoke
45
- * @public
46
- */
47
- export declare function setCurrentInvoke<TEvent = any, TContext = any>({ event, context, }: CurrentInvoke<TEvent, TContext>): void;
48
- //# sourceMappingURL=current-invoke.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"current-invoke.d.ts","sourceRoot":"","sources":["../../src/core/current-invoke.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,aAAa,CAAC,MAAM,EAAE,QAAQ,IAAI;IAC5C;;;;OAIG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB;;;;OAIG;IACH,OAAO,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC1B,CAAC;AAOF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,GAAG,GAAG,EAAE,QAAQ,GAAG,GAAG,KAAK,aAAa,CAC7E,MAAM,EACN,QAAQ,CACT,CAEA;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,GAAG,GAAG,EAAE,QAAQ,GAAG,GAAG,EAAE,EAC7D,KAAK,EACL,OAAO,GACR,EAAE,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,QAGjC"}
@@ -1,2 +0,0 @@
1
- "use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),current_invoke_exports={};__export(current_invoke_exports,{getCurrentInvoke:()=>getCurrentInvoke,setCurrentInvoke:()=>setCurrentInvoke});module.exports=__toCommonJS(current_invoke_exports);const currentInvoke={context:null,event:null};function getCurrentInvoke(){return currentInvoke}function setCurrentInvoke({event,context}){currentInvoke.event=event,currentInvoke.context=context}
2
- //# sourceMappingURL=current-invoke.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"current-invoke.js","sources":["../../src/core/current-invoke.ts"],"sourcesContent":["/**\n * The type that represents the object that handles the references to the event created by the serverless trigger or context created by the serverless environment.\n *\n * @breadcrumb Core / Current Invoke\n * @public\n */\nexport type CurrentInvoke<TEvent, TContext> = {\n /**\n * The event created by the serverless trigger\n *\n * @remarks It's only null when you call {@link getCurrentInvoke} outside this library's pipeline.\n */\n event: TEvent | null;\n\n /**\n * The context created by the serverless environment\n *\n * @remarks It's only null when you call {@link getCurrentInvoke} outside this library's pipeline.\n */\n context: TContext | null;\n};\n\nconst currentInvoke: CurrentInvoke<any, any> = {\n context: null,\n event: null,\n};\n\n/**\n * Get the reference to the event created by the serverless trigger or context created by the serverless environment.\n *\n * @example\n * ```typescript\n * import type { ALBEvent, Context } from 'aws-lambda';\n *\n * // inside the method that handles the aws alb request.\n * const { event, context } = getCurrentInvoke<ALBEvent, Context>();\n * ```\n *\n * @breadcrumb Core / Current Invoke\n * @public\n */\nexport function getCurrentInvoke<TEvent = any, TContext = any>(): CurrentInvoke<\n TEvent,\n TContext\n> {\n return currentInvoke;\n}\n\n/**\n * Method that saves to the event created by the serverless trigger or context created by the serverless environment.\n *\n * @remarks This method MUST NOT be called by you, this method MUST only be used internally in this library.\n *\n * @param event - The event created by the serverless trigger\n * @param context - The context created by the serverless environment\n *\n * @breadcrumb Core / Current Invoke\n * @public\n */\nexport function setCurrentInvoke<TEvent = any, TContext = any>({\n event,\n context,\n}: CurrentInvoke<TEvent, TContext>) {\n currentInvoke.event = event;\n currentInvoke.context = context;\n}\n"],"names":[],"mappings":"ooBAAA,uBAAA,CAAA,EAAA,SAAA,uBAAA,CAAA,iBAAA,IAAA,iBAAA,iBAAA,IAAA,gBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,sBAAA,EAsBA,MAAM,cAAyC,CAC7C,QAAS,KACT,MAAO,IACT,EAgBO,SAAS,kBAGd,CACO,OAAA,aACT,CAaO,SAAS,iBAA+C,CAC7D,MACA,OACF,EAAoC,CAClC,cAAc,MAAQ,MACtB,cAAc,QAAU,OAC1B"}
@@ -1,22 +0,0 @@
1
- /// <reference types="node" />
2
- /**
3
- * Get the event body as buffer from body string with content length
4
- *
5
- * @example
6
- * ```typescript
7
- * const body = '{}';
8
- * const [buffer, contentLength] = getEventBodyAsBuffer(body, false);
9
- * console.log(buffer);
10
- * // <Buffer 7b 7d>
11
- * console.log(contentLength);
12
- * // 2
13
- * ```
14
- *
15
- * @param body - The body string that can be encoded or not
16
- * @param isBase64Encoded - Tells if body string is encoded in base64
17
- *
18
- * @breadcrumb Core
19
- * @public
20
- */
21
- export declare function getEventBodyAsBuffer(body: string, isBase64Encoded: boolean): [body: Buffer, contentLength: number];
22
- //# sourceMappingURL=event-body.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event-body.d.ts","sourceRoot":"","sources":["../../src/core/event-body.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,OAAO,GACvB,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,CAOvC"}
@@ -1,2 +0,0 @@
1
- "use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),event_body_exports={};__export(event_body_exports,{getEventBodyAsBuffer:()=>getEventBodyAsBuffer});module.exports=__toCommonJS(event_body_exports);function getEventBodyAsBuffer(body,isBase64Encoded){const encoding=isBase64Encoded?"base64":"utf8",buffer=Buffer.from(body,encoding),contentLength=Buffer.byteLength(buffer,encoding);return[buffer,contentLength]}
2
- //# sourceMappingURL=event-body.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event-body.js","sources":["../../src/core/event-body.ts"],"sourcesContent":["/**\n * Get the event body as buffer from body string with content length\n *\n * @example\n * ```typescript\n * const body = '{}';\n * const [buffer, contentLength] = getEventBodyAsBuffer(body, false);\n * console.log(buffer);\n * // <Buffer 7b 7d>\n * console.log(contentLength);\n * // 2\n * ```\n *\n * @param body - The body string that can be encoded or not\n * @param isBase64Encoded - Tells if body string is encoded in base64\n *\n * @breadcrumb Core\n * @public\n */\nexport function getEventBodyAsBuffer(\n body: string,\n isBase64Encoded: boolean,\n): [body: Buffer, contentLength: number] {\n const encoding: BufferEncoding = isBase64Encoded ? 'base64' : 'utf8';\n\n const buffer = Buffer.from(body, encoding);\n const contentLength = Buffer.byteLength(buffer, encoding);\n\n return [buffer, contentLength];\n}\n"],"names":[],"mappings":"ooBAAA,mBAAA,CAAA,EAAA,SAAA,mBAAA,CAAA,qBAAA,IAAA,oBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,kBAAA,EAmBO,SAAS,qBACd,KACA,gBACuC,CACjC,MAAA,SAA2B,gBAAkB,SAAW,OAExD,OAAS,OAAO,KAAK,KAAM,QAAQ,EACnC,cAAgB,OAAO,WAAW,OAAQ,QAAQ,EAEjD,MAAA,CAAC,OAAQ,aAAa,CAC/B"}
@@ -1,73 +0,0 @@
1
- import { BothValueHeaders } from '../@types';
2
- /**
3
- * Transform a header map and make sure the value is not an array
4
- *
5
- * @example
6
- * ```typescript
7
- * const headers = { 'accept-encoding': 'gzip', 'accept-language': ['en-US', 'en;q=0.9'] };
8
- * const flattenedHeaders = getFlattenedHeadersMap(headers, ',', true);
9
- * console.log(flattenedHeaders);
10
- * // { 'accept-encoding': 'gzip', 'accept-language': 'en-US,en;q=0.9' }
11
- * ```
12
- *
13
- * @param headersMap - The initial headers
14
- * @param separator - The separator used when we join the array of header's value
15
- * @param lowerCaseKey - Should put all keys in lowercase
16
- *
17
- * @breadcrumb Core / Headers
18
- * @public
19
- */
20
- export declare function getFlattenedHeadersMap(headersMap: BothValueHeaders, separator?: string, lowerCaseKey?: boolean): Record<string, string>;
21
- /**
22
- * Transforms a header map into a multi-value map header.
23
- *
24
- * @example
25
- * ```typescript
26
- * const headers = { 'accept-encoding': 'gzip', 'connection': ['keep-alive'] };
27
- * const multiValueHeaders = getMultiValueHeadersMap(headers);
28
- * console.log(multiValueHeaders);
29
- * // { 'accept-encoding': ['gzip'], 'connection': ['keep-alive'] }
30
- * ```
31
- *
32
- * @param headersMap - The initial headers
33
- *
34
- * @breadcrumb Core / Headers
35
- * @public
36
- */
37
- export declare function getMultiValueHeadersMap(headersMap: BothValueHeaders): Record<string, string[]>;
38
- /**
39
- * The wrapper that holds the information about single value headers and cookies
40
- *
41
- * @breadcrumb Core / Headers
42
- * @public
43
- */
44
- export type FlattenedHeadersAndCookies = {
45
- /**
46
- * Just the single value headers
47
- */
48
- headers: Record<string, string>;
49
- /**
50
- * The list of cookies
51
- */
52
- cookies: string[];
53
- };
54
- /**
55
- * Transforms a header map into a single value headers and cookies
56
- *
57
- * @param headersMap - The initial headers
58
- *
59
- * @breadcrumb Core / Headers
60
- * @public
61
- */
62
- export declare function getFlattenedHeadersMapAndCookies(headersMap: BothValueHeaders): FlattenedHeadersAndCookies;
63
- /**
64
- * Parse HTTP Raw Headers
65
- * Attribution to {@link https://github.com/kesla/parse-headers/blob/master/parse-headers.js}
66
- *
67
- * @param headers - The raw headers
68
- *
69
- * @breadcrumb Core / Headers
70
- * @public
71
- */
72
- export declare function parseHeaders(headers: string): Record<string, string | string[]>;
73
- //# sourceMappingURL=headers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../src/core/headers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAI7C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,gBAAgB,EAC5B,SAAS,GAAE,MAAY,EACvB,YAAY,GAAE,OAAe,GAC5B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUxB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,gBAAgB,GAC3B,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAU1B;AAED;;;;;GAKG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,gCAAgC,CAC9C,UAAU,EAAE,gBAAgB,GAC3B,0BAA0B,CAuB5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,GACd,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAkBnC"}
@@ -1,3 +0,0 @@
1
- "use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),headers_exports={};__export(headers_exports,{getFlattenedHeadersMap:()=>getFlattenedHeadersMap,getFlattenedHeadersMapAndCookies:()=>getFlattenedHeadersMapAndCookies,getMultiValueHeadersMap:()=>getMultiValueHeadersMap,parseHeaders:()=>parseHeaders});module.exports=__toCommonJS(headers_exports);function getFlattenedHeadersMap(headersMap,separator=",",lowerCaseKey=!1){return Object.keys(headersMap).reduce((acc,headerKey)=>{const newKey=lowerCaseKey?headerKey.toLowerCase():headerKey,headerValue=headersMap[headerKey];return Array.isArray(headerValue)?acc[newKey]=headerValue.join(separator):acc[newKey]=(headerValue??"")+"",acc},{})}function getMultiValueHeadersMap(headersMap){return Object.keys(headersMap).reduce((acc,headerKey)=>{const headerValue=headersMap[headerKey];return acc[headerKey.toLowerCase()]=Array.isArray(headerValue)?headerValue.map(String):[String(headerValue)],acc},{})}function getFlattenedHeadersMapAndCookies(headersMap){return Object.keys(headersMap).reduce((acc,headerKey)=>{const headerValue=headersMap[headerKey],lowerHeaderKey=headerKey.toLowerCase();return Array.isArray(headerValue)?lowerHeaderKey!=="set-cookie"?acc.headers[headerKey]=headerValue.join(","):acc.cookies.push(...headerValue):lowerHeaderKey==="set-cookie"&&headerValue!==void 0?acc.cookies.push(headerValue??""):acc.headers[headerKey]=String(headerValue??""),acc},{cookies:[],headers:{}})}function parseHeaders(headers){if(!headers)return{};const result={},headersArr=headers.trim().split(`
2
- `);for(let i=0;i<headersArr.length;i++){const row=headersArr[i],index=row.indexOf(":"),key=row.slice(0,index).trim().toLowerCase(),value=row.slice(index+1).trim();typeof result[key]>"u"?result[key]=value:Array.isArray(result[key])?result[key].push(value):result[key]=[result[key],value]}return result}
3
- //# sourceMappingURL=headers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"headers.js","sources":["../../src/core/headers.ts"],"sourcesContent":["//#region Imports\n\nimport { BothValueHeaders } from '../@types';\n\n//#endregion\n\n/**\n * Transform a header map and make sure the value is not an array\n *\n * @example\n * ```typescript\n * const headers = { 'accept-encoding': 'gzip', 'accept-language': ['en-US', 'en;q=0.9'] };\n * const flattenedHeaders = getFlattenedHeadersMap(headers, ',', true);\n * console.log(flattenedHeaders);\n * // { 'accept-encoding': 'gzip', 'accept-language': 'en-US,en;q=0.9' }\n * ```\n *\n * @param headersMap - The initial headers\n * @param separator - The separator used when we join the array of header's value\n * @param lowerCaseKey - Should put all keys in lowercase\n *\n * @breadcrumb Core / Headers\n * @public\n */\nexport function getFlattenedHeadersMap(\n headersMap: BothValueHeaders,\n separator: string = ',',\n lowerCaseKey: boolean = false,\n): Record<string, string> {\n return Object.keys(headersMap).reduce((acc, headerKey) => {\n const newKey = lowerCaseKey ? headerKey.toLowerCase() : headerKey;\n const headerValue = headersMap[headerKey];\n\n if (Array.isArray(headerValue)) acc[newKey] = headerValue.join(separator);\n else acc[newKey] = (headerValue ?? '') + '';\n\n return acc;\n }, {});\n}\n\n/**\n * Transforms a header map into a multi-value map header.\n *\n * @example\n * ```typescript\n * const headers = { 'accept-encoding': 'gzip', 'connection': ['keep-alive'] };\n * const multiValueHeaders = getMultiValueHeadersMap(headers);\n * console.log(multiValueHeaders);\n * // { 'accept-encoding': ['gzip'], 'connection': ['keep-alive'] }\n * ```\n *\n * @param headersMap - The initial headers\n *\n * @breadcrumb Core / Headers\n * @public\n */\nexport function getMultiValueHeadersMap(\n headersMap: BothValueHeaders,\n): Record<string, string[]> {\n return Object.keys(headersMap).reduce((acc, headerKey) => {\n const headerValue = headersMap[headerKey];\n\n acc[headerKey.toLowerCase()] = Array.isArray(headerValue)\n ? headerValue.map(String)\n : [String(headerValue)];\n\n return acc;\n }, {});\n}\n\n/**\n * The wrapper that holds the information about single value headers and cookies\n *\n * @breadcrumb Core / Headers\n * @public\n */\nexport type FlattenedHeadersAndCookies = {\n /**\n * Just the single value headers\n */\n headers: Record<string, string>;\n\n /**\n * The list of cookies\n */\n cookies: string[];\n};\n\n/**\n * Transforms a header map into a single value headers and cookies\n *\n * @param headersMap - The initial headers\n *\n * @breadcrumb Core / Headers\n * @public\n */\nexport function getFlattenedHeadersMapAndCookies(\n headersMap: BothValueHeaders,\n): FlattenedHeadersAndCookies {\n return Object.keys(headersMap).reduce(\n (acc, headerKey) => {\n const headerValue = headersMap[headerKey];\n const lowerHeaderKey = headerKey.toLowerCase();\n\n if (Array.isArray(headerValue)) {\n if (lowerHeaderKey !== 'set-cookie')\n acc.headers[headerKey] = headerValue.join(',');\n else acc.cookies.push(...headerValue);\n } else {\n if (lowerHeaderKey === 'set-cookie' && headerValue !== undefined)\n acc.cookies.push(headerValue ?? '');\n else acc.headers[headerKey] = String(headerValue ?? '');\n }\n\n return acc;\n },\n {\n cookies: [],\n headers: {},\n } as FlattenedHeadersAndCookies,\n );\n}\n\n/**\n * Parse HTTP Raw Headers\n * Attribution to {@link https://github.com/kesla/parse-headers/blob/master/parse-headers.js}\n *\n * @param headers - The raw headers\n *\n * @breadcrumb Core / Headers\n * @public\n */\nexport function parseHeaders(\n headers: string,\n): Record<string, string | string[]> {\n if (!headers) return {};\n\n const result = {};\n const headersArr = headers.trim().split('\\n');\n\n for (let i = 0; i < headersArr.length; i++) {\n const row = headersArr[i];\n const index = row.indexOf(':');\n const key = row.slice(0, index).trim().toLowerCase();\n const value = row.slice(index + 1).trim();\n\n if (typeof result[key] === 'undefined') result[key] = value;\n else if (Array.isArray(result[key])) result[key].push(value);\n else result[key] = [result[key], value];\n }\n\n return result;\n}\n"],"names":[],"mappings":"ooBAAA,gBAAA,CAAA,EAAA,SAAA,gBAAA,CAAA,uBAAA,IAAA,uBAAA,iCAAA,IAAA,iCAAA,wBAAA,IAAA,wBAAA,aAAA,IAAA,YAAA,CAAA,EAAA,OAAA,QAAA,aAAA,eAAA,EAwBO,SAAS,uBACd,WACA,UAAoB,IACpB,aAAwB,GACA,CACxB,OAAO,OAAO,KAAK,UAAU,EAAE,OAAO,CAAC,IAAK,YAAc,CACxD,MAAM,OAAS,aAAe,UAAU,YAAA,EAAgB,UAClD,YAAc,WAAW,SAAS,EAEpC,OAAA,MAAM,QAAQ,WAAW,EAAG,IAAI,MAAM,EAAI,YAAY,KAAK,SAAS,EAC/D,IAAA,MAAM,GAAK,aAAe,IAAM,GAElC,GACT,EAAG,CAAE,CAAA,CACP,CAkBO,SAAS,wBACd,WAC0B,CAC1B,OAAO,OAAO,KAAK,UAAU,EAAE,OAAO,CAAC,IAAK,YAAc,CAClD,MAAA,YAAc,WAAW,SAAS,EAExC,WAAI,UAAU,YAAA,CAAa,EAAI,MAAM,QAAQ,WAAW,EACpD,YAAY,IAAI,MAAM,EACtB,CAAC,OAAO,WAAW,CAAC,EAEjB,GACT,EAAG,CAAE,CAAA,CACP,CA4BO,SAAS,iCACd,WAC4B,CACrB,OAAA,OAAO,KAAK,UAAU,EAAE,OAC7B,CAAC,IAAK,YAAc,CACZ,MAAA,YAAc,WAAW,SAAS,EAClC,eAAiB,UAAU,cAE7B,OAAA,MAAM,QAAQ,WAAW,EACvB,iBAAmB,aACrB,IAAI,QAAQ,SAAS,EAAI,YAAY,KAAK,GAAG,EACtC,IAAA,QAAQ,KAAK,GAAG,WAAW,EAEhC,iBAAmB,cAAgB,cAAgB,OACjD,IAAA,QAAQ,KAAK,aAAe,EAAE,EAC/B,IAAI,QAAQ,SAAS,EAAI,OAAO,aAAe,EAAE,EAGjD,GACT,EACA,CACE,QAAS,CAAC,EACV,QAAS,CAAC,CACZ,CAAA,CAEJ,CAWO,SAAS,aACd,QACmC,CACnC,GAAI,CAAC,QAAS,MAAO,GAErB,MAAM,OAAS,CAAA,EACT,WAAa,QAAQ,KAAK,EAAE,MAAM;AAAA,CAAI,EAE5C,QAAS,EAAI,EAAG,EAAI,WAAW,OAAQ,IAAK,CACpC,MAAA,IAAM,WAAW,CAAC,EAClB,MAAQ,IAAI,QAAQ,GAAG,EACvB,IAAM,IAAI,MAAM,EAAG,KAAK,EAAE,OAAO,cACjC,MAAQ,IAAI,MAAM,MAAQ,CAAC,EAAE,OAE/B,OAAO,OAAO,GAAG,EAAM,IAAa,OAAO,GAAG,EAAI,MAC7C,MAAM,QAAQ,OAAO,GAAG,CAAC,EAAU,OAAA,GAAG,EAAE,KAAK,KAAK,EACtD,OAAO,GAAG,EAAI,CAAC,OAAO,GAAG,EAAG,KAAK,CACxC,CAEO,OAAA,MACT"}
@@ -1,12 +0,0 @@
1
- export * from './base-handler';
2
- export * from './constants';
3
- export * from './current-invoke';
4
- export * from './event-body';
5
- export * from './headers';
6
- export * from './is-binary';
7
- export * from './logger';
8
- export * from './no-op';
9
- export * from './optional';
10
- export * from './path';
11
- export * from './stream';
12
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
package/lib/core/index.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__reExport=(target,mod,secondTarget)=>(__copyProps(target,mod,"default"),secondTarget&&__copyProps(secondTarget,mod,"default")),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),core_exports={};module.exports=__toCommonJS(core_exports);__reExport(core_exports,require("./base-handler"),module.exports);__reExport(core_exports,require("./constants"),module.exports);__reExport(core_exports,require("./current-invoke"),module.exports);__reExport(core_exports,require("./event-body"),module.exports);__reExport(core_exports,require("./headers"),module.exports);__reExport(core_exports,require("./is-binary"),module.exports);__reExport(core_exports,require("./logger"),module.exports);__reExport(core_exports,require("./no-op"),module.exports);__reExport(core_exports,require("./optional"),module.exports);__reExport(core_exports,require("./path"),module.exports);__reExport(core_exports,require("./stream"),module.exports);
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../src/core/index.ts"],"sourcesContent":["export * from './base-handler';\nexport * from './constants';\nexport * from './current-invoke';\nexport * from './event-body';\nexport * from './headers';\nexport * from './is-binary';\nexport * from './logger';\nexport * from './no-op';\nexport * from './optional';\nexport * from './path';\nexport * from './stream';\n"],"names":[],"mappings":"kqBAAA,aAAA,CAAA,EAAA,OAAA,QAAA,aAAA,YAAA,EAAA,WAAA,aAAc,QAAd,gBAAA,EAAA,OAAA,OAAA,EACA,WAAA,aAAc,QADd,aAAA,EAAA,OAAA,OAAA,EAEA,WAAA,aAAc,QAFd,kBAAA,EAAA,OAAA,OAAA,EAGA,WAAA,aAAc,QAHd,cAAA,EAAA,OAAA,OAAA,EAIA,WAAA,aAAc,QAJd,WAAA,EAAA,OAAA,OAAA,EAKA,WAAA,aAAc,QALd,aAAA,EAAA,OAAA,OAAA,EAMA,WAAA,aAAc,QANd,UAAA,EAAA,OAAA,OAAA,EAOA,WAAA,aAAc,QAPd,SAAA,EAAA,OAAA,OAAA,EAQA,WAAA,aAAc,QARd,YAAA,EAAA,OAAA,OAAA,EASA,WAAA,aAAc,QATd,QAAA,EAAA,OAAA,OAAA,EAUA,WAAA,aAAc,QAVd,UAAA,EAAA,OAAA,OAAA"}
@@ -1,73 +0,0 @@
1
- import { BinarySettings, BothValueHeaders } from '../@types';
2
- /**
3
- * The function that determines by the content encoding whether the response should be treated as binary
4
- *
5
- * @example
6
- * ```typescript
7
- * const headers = { 'content-encoding': 'gzip' };
8
- * const isBinary = isContentEncodingBinary(headers, ['gzip']);
9
- * console.log(isBinary);
10
- * // true
11
- * ```
12
- *
13
- * @param headers - The headers of the response
14
- * @param binaryEncodingTypes - The list of content encodings that will be treated as binary
15
- *
16
- * @breadcrumb Core / isBinary
17
- * @public
18
- */
19
- export declare function isContentEncodingBinary(headers: BothValueHeaders, binaryEncodingTypes: string[]): boolean;
20
- /**
21
- * The function that returns the content type of headers
22
- *
23
- * @example
24
- * ```typescript
25
- * const headers = { 'content-type': 'application/json' };
26
- * const contentType = getContentType(headers);
27
- * console.log(contentType);
28
- * // application/json
29
- * ```
30
- *
31
- * @param headers - The headers of the response
32
- *
33
- * @breadcrumb Core / isBinary
34
- * @public
35
- */
36
- export declare function getContentType(headers: BothValueHeaders): string;
37
- /**
38
- * The function that determines by the content type whether the response should be treated as binary
39
- *
40
- * @example
41
- * ```typescript
42
- * const headers = { 'content-type': 'image/png' };
43
- * const isBinary = isContentTypeBinary(headers, new Map([['image/png', true]]));
44
- * console.log(isBinary);
45
- * // true
46
- * ```
47
- *
48
- * @param headers - The headers of the response
49
- * @param binaryContentTypes - The list of content types that will be treated as binary
50
- *
51
- * @breadcrumb Core / isBinary
52
- * @public
53
- */
54
- export declare function isContentTypeBinary(headers: BothValueHeaders, binaryContentTypes: string[]): boolean;
55
- /**
56
- * The function used to determine from the headers and the binary settings if a response should be encoded or not
57
- *
58
- * @example
59
- * ```typescript
60
- * const headers = { 'content-type': 'image/png', 'content-encoding': 'gzip' };
61
- * const isContentBinary = isBinary(headers, { contentEncodings: ['gzip'], contentTypes: ['image/png'] });
62
- * console.log(isContentBinary);
63
- * // true
64
- * ```
65
- *
66
- * @param headers - The headers of the response
67
- * @param binarySettings - The settings for the validation
68
- *
69
- * @breadcrumb Core / isBinary
70
- * @public
71
- */
72
- export declare function isBinary(headers: BothValueHeaders, binarySettings: BinarySettings): boolean;
73
- //# sourceMappingURL=is-binary.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-binary.d.ts","sourceRoot":"","sources":["../../src/core/is-binary.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAI7D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,gBAAgB,EACzB,mBAAmB,EAAE,MAAM,EAAE,GAC5B,OAAO,CAWT;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAchE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,gBAAgB,EACzB,kBAAkB,EAAE,MAAM,EAAE,WAO7B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CACtB,OAAO,EAAE,gBAAgB,EACzB,cAAc,EAAE,cAAc,GAC7B,OAAO,CAWT"}
@@ -1,2 +0,0 @@
1
- "use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),is_binary_exports={};__export(is_binary_exports,{getContentType:()=>getContentType,isBinary:()=>isBinary,isContentEncodingBinary:()=>isContentEncodingBinary,isContentTypeBinary:()=>isContentTypeBinary});module.exports=__toCommonJS(is_binary_exports);function isContentEncodingBinary(headers,binaryEncodingTypes){let contentEncodings=headers["content-encoding"];return contentEncodings?(Array.isArray(contentEncodings)||(contentEncodings=contentEncodings.split(",")),contentEncodings.some(value=>binaryEncodingTypes.includes(value.trim()))):!1}function getContentType(headers){const contentTypeHeaderRaw=headers["content-type"],contentTypeHeader=Array.isArray(contentTypeHeaderRaw)?contentTypeHeaderRaw[0]||"":contentTypeHeaderRaw||"";if(!contentTypeHeaderRaw)return"";const contentTypeStart=contentTypeHeader.indexOf(";");return contentTypeStart===-1?contentTypeHeader:contentTypeHeader.slice(0,contentTypeStart)}function isContentTypeBinary(headers,binaryContentTypes){const contentType=getContentType(headers);return contentType?binaryContentTypes.includes(contentType.trim()):!1}function isBinary(headers,binarySettings){return"isBinary"in binarySettings?binarySettings.isBinary===!1?!1:binarySettings.isBinary(headers):isContentEncodingBinary(headers,binarySettings.contentEncodings)||isContentTypeBinary(headers,binarySettings.contentTypes)}
2
- //# sourceMappingURL=is-binary.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-binary.js","sources":["../../src/core/is-binary.ts"],"sourcesContent":["// ATTRIBUTION: https://github.com/dougmoscrop/serverless-http\n\n//#region Imports\n\nimport { BinarySettings, BothValueHeaders } from '../@types';\n\n//#endregion\n\n/**\n * The function that determines by the content encoding whether the response should be treated as binary\n *\n * @example\n * ```typescript\n * const headers = { 'content-encoding': 'gzip' };\n * const isBinary = isContentEncodingBinary(headers, ['gzip']);\n * console.log(isBinary);\n * // true\n * ```\n *\n * @param headers - The headers of the response\n * @param binaryEncodingTypes - The list of content encodings that will be treated as binary\n *\n * @breadcrumb Core / isBinary\n * @public\n */\nexport function isContentEncodingBinary(\n headers: BothValueHeaders,\n binaryEncodingTypes: string[],\n): boolean {\n let contentEncodings = headers['content-encoding'];\n\n if (!contentEncodings) return false;\n\n if (!Array.isArray(contentEncodings))\n contentEncodings = contentEncodings.split(',');\n\n return contentEncodings.some(value =>\n binaryEncodingTypes.includes(value.trim()),\n );\n}\n\n/**\n * The function that returns the content type of headers\n *\n * @example\n * ```typescript\n * const headers = { 'content-type': 'application/json' };\n * const contentType = getContentType(headers);\n * console.log(contentType);\n * // application/json\n * ```\n *\n * @param headers - The headers of the response\n *\n * @breadcrumb Core / isBinary\n * @public\n */\nexport function getContentType(headers: BothValueHeaders): string {\n const contentTypeHeaderRaw = headers['content-type'];\n const contentTypeHeader = Array.isArray(contentTypeHeaderRaw)\n ? contentTypeHeaderRaw[0] || ''\n : contentTypeHeaderRaw || '';\n\n if (!contentTypeHeaderRaw) return '';\n\n // only compare mime type; ignore encoding part\n const contentTypeStart = contentTypeHeader.indexOf(';');\n\n if (contentTypeStart === -1) return contentTypeHeader;\n\n return contentTypeHeader.slice(0, contentTypeStart);\n}\n\n/**\n * The function that determines by the content type whether the response should be treated as binary\n *\n * @example\n * ```typescript\n * const headers = { 'content-type': 'image/png' };\n * const isBinary = isContentTypeBinary(headers, new Map([['image/png', true]]));\n * console.log(isBinary);\n * // true\n * ```\n *\n * @param headers - The headers of the response\n * @param binaryContentTypes - The list of content types that will be treated as binary\n *\n * @breadcrumb Core / isBinary\n * @public\n */\nexport function isContentTypeBinary(\n headers: BothValueHeaders,\n binaryContentTypes: string[],\n) {\n const contentType = getContentType(headers);\n\n if (!contentType) return false;\n\n return binaryContentTypes.includes(contentType.trim());\n}\n\n/**\n * The function used to determine from the headers and the binary settings if a response should be encoded or not\n *\n * @example\n * ```typescript\n * const headers = { 'content-type': 'image/png', 'content-encoding': 'gzip' };\n * const isContentBinary = isBinary(headers, { contentEncodings: ['gzip'], contentTypes: ['image/png'] });\n * console.log(isContentBinary);\n * // true\n * ```\n *\n * @param headers - The headers of the response\n * @param binarySettings - The settings for the validation\n *\n * @breadcrumb Core / isBinary\n * @public\n */\nexport function isBinary(\n headers: BothValueHeaders,\n binarySettings: BinarySettings,\n): boolean {\n if ('isBinary' in binarySettings) {\n if (binarySettings.isBinary === false) return false;\n\n return binarySettings.isBinary(headers);\n }\n\n return (\n isContentEncodingBinary(headers, binarySettings.contentEncodings) ||\n isContentTypeBinary(headers, binarySettings.contentTypes)\n );\n}\n"],"names":[],"mappings":"ooBAAA,kBAAA,CAAA,EAAA,SAAA,kBAAA,CAAA,eAAA,IAAA,eAAA,SAAA,IAAA,SAAA,wBAAA,IAAA,wBAAA,oBAAA,IAAA,mBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,iBAAA,EAyBO,SAAS,wBACd,QACA,oBACS,CACL,IAAA,iBAAmB,QAAQ,kBAAkB,EAEjD,OAAK,kBAEA,MAAM,QAAQ,gBAAgB,IACd,iBAAA,iBAAiB,MAAM,GAAG,GAExC,iBAAiB,KACtB,OAAA,oBAAoB,SAAS,MAAM,MAAM,CAAA,GANb,EAQhC,CAkBO,SAAS,eAAe,QAAmC,CAC1D,MAAA,qBAAuB,QAAQ,cAAc,EAC7C,kBAAoB,MAAM,QAAQ,oBAAoB,EACxD,qBAAqB,CAAC,GAAK,GAC3B,sBAAwB,GAE5B,GAAI,CAAC,qBAA6B,MAAA,GAG5B,MAAA,iBAAmB,kBAAkB,QAAQ,GAAG,EAEtD,OAAI,mBAAqB,GAAW,kBAE7B,kBAAkB,MAAM,EAAG,gBAAgB,CACpD,CAmBO,SAAS,oBACd,QACA,mBACA,CACM,MAAA,YAAc,eAAe,OAAO,EAE1C,OAAK,YAEE,mBAAmB,SAAS,YAAY,KAAM,CAAA,EAF5B,EAG3B,CAmBO,SAAS,SACd,QACA,eACS,CACT,MAAI,aAAc,eACZ,eAAe,WAAa,GAAc,GAEvC,eAAe,SAAS,OAAO,EAItC,wBAAwB,QAAS,eAAe,gBAAgB,GAChE,oBAAoB,QAAS,eAAe,YAAY,CAE5D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/core/logger.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GACjB,OAAO,GACP,SAAS,GACT,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,CAAC;AAEX;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;;;OAIG;IACH,KAAK,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC;AAmDnE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CACjC,EAAE,KAAK,EAAE,GAAE,aAAkC,GAC5C,OAAO,CAkBT;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAEzD"}
@@ -1,2 +0,0 @@
1
- "use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),logger_exports={};__export(logger_exports,{createDefaultLogger:()=>createDefaultLogger,isInternalLogger:()=>isInternalLogger});module.exports=__toCommonJS(logger_exports);var import_no_op=require("./no-op");const InternalLoggerSymbol=Symbol("InternalLogger"),logLevels={debug:[["debug","debug"],["verbose","debug"],["info","info"],["error","error"],["warn","warn"]],verbose:[["verbose","debug"],["info","info"],["error","error"],["warn","warn"]],info:[["info","info"],["error","error"],["warn","warn"]],warn:[["warn","warn"],["error","error"]],error:[["error","error"]],none:[]},lazyPrint=value=>typeof value=="function"?value():value,print=fn=>(message,...additional)=>console[fn](message,...additional.map(lazyPrint));function createDefaultLogger({level}={level:"error"}){const levels=logLevels[level];if(!levels)throw new Error("Invalid log level");const logger={[InternalLoggerSymbol]:!0,error:import_no_op.NO_OP,debug:import_no_op.NO_OP,info:import_no_op.NO_OP,verbose:import_no_op.NO_OP,warn:import_no_op.NO_OP};for(const[level2,consoleMethod]of levels)logger[level2]=print(consoleMethod);return logger}function isInternalLogger(logger){return!!logger[InternalLoggerSymbol]}
2
- //# sourceMappingURL=logger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.js","sources":["../../src/core/logger.ts"],"sourcesContent":["import { NO_OP } from './no-op';\n\n/**\n * The type representing the possible log levels to choose from.\n *\n * @breadcrumb Core / Logger\n * @public\n */\nexport type LogLevels =\n | 'debug'\n | 'verbose'\n | 'info'\n | 'warn'\n | 'error'\n | 'none';\n\n/**\n * The options to customize {@link ILogger}\n *\n * @breadcrumb Core / Logger\n * @public\n */\nexport type LoggerOptions = {\n /**\n * Select the log level, {@link LogLevels | see more}.\n *\n * @defaultValue error\n */\n level: LogLevels;\n};\n\n/**\n * The log function used in any level.\n *\n * @breadcrumb Core / Logger\n * @public\n */\nexport type LoggerFN = (message: any, ...additional: any[]) => void;\n\n/**\n * The interface representing the logger, you can provide a custom logger by implementing this interface.\n *\n * @breadcrumb Core / Logger\n * @public\n */\nexport type ILogger = Record<Exclude<LogLevels, 'none'>, LoggerFN>;\n\n/**\n * The symbol used to check against an ILogger instace to verify if that ILogger was created by this library\n *\n * @breadcrumb Core / Logger\n * @public\n */\nconst InternalLoggerSymbol = Symbol('InternalLogger');\n\nconst logLevels: Record<\n LogLevels,\n [level: LogLevels, consoleMethod: keyof Console][]\n> = {\n debug: [\n ['debug', 'debug'],\n ['verbose', 'debug'],\n ['info', 'info'],\n ['error', 'error'],\n ['warn', 'warn'],\n ],\n verbose: [\n ['verbose', 'debug'],\n ['info', 'info'],\n ['error', 'error'],\n ['warn', 'warn'],\n ],\n info: [\n ['info', 'info'],\n ['error', 'error'],\n ['warn', 'warn'],\n ],\n warn: [\n ['warn', 'warn'],\n ['error', 'error'],\n ],\n error: [['error', 'error']],\n none: [],\n};\n\nconst lazyPrint = value => {\n if (typeof value === 'function') return value();\n\n return value;\n};\n\nconst print =\n (fn: string) =>\n (message, ...additional) =>\n console[fn](message, ...additional.map(lazyPrint));\n\n/**\n * The method used to create a simple logger instance to use in this library.\n *\n * @remarks Behind the scenes, this simple logger sends the message to the `console` methods.\n *\n * @example\n * ```typescript\n * const logger = createDefaultLogger();\n *\n * logger.error('An error happens.');\n * // An error happens.\n * ```\n *\n * @param level - Select the level of the log\n *\n * @breadcrumb Core / Logger\n * @public\n */\nexport function createDefaultLogger(\n { level }: LoggerOptions = { level: 'error' },\n): ILogger {\n const levels = logLevels[level];\n\n if (!levels) throw new Error('Invalid log level');\n\n const logger = {\n [InternalLoggerSymbol]: true,\n error: NO_OP,\n debug: NO_OP,\n info: NO_OP,\n verbose: NO_OP,\n warn: NO_OP,\n } as ILogger;\n\n for (const [level, consoleMethod] of levels)\n logger[level] = print(consoleMethod);\n\n return logger;\n}\n\n/**\n * The method used to chck if logger was created by this library, or it was defined by the user.\n *\n * @param logger - The instance of the logger to check\n *\n * @breadcrumb Core / Logger\n * @public\n */\nexport function isInternalLogger(logger: ILogger): boolean {\n return !!logger[InternalLoggerSymbol];\n}\n"],"names":["level"],"mappings":"ooBAAA,eAAA,CAAA,EAAA,SAAA,eAAA,CAAA,oBAAA,IAAA,oBAAA,iBAAA,IAAA,gBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,cAAA,EAAA,IAAsB,aAAA,QAAA,SAAA,EAqDtB,MAAM,qBAAuB,OAAO,gBAAgB,EAE9C,UAGF,CACF,MAAO,CACL,CAAC,QAAS,OAAO,EACjB,CAAC,UAAW,OAAO,EACnB,CAAC,OAAQ,MAAM,EACf,CAAC,QAAS,OAAO,EACjB,CAAC,OAAQ,MAAM,CACjB,EACA,QAAS,CACP,CAAC,UAAW,OAAO,EACnB,CAAC,OAAQ,MAAM,EACf,CAAC,QAAS,OAAO,EACjB,CAAC,OAAQ,MAAM,CACjB,EACA,KAAM,CACJ,CAAC,OAAQ,MAAM,EACf,CAAC,QAAS,OAAO,EACjB,CAAC,OAAQ,MAAM,CACjB,EACA,KAAM,CACJ,CAAC,OAAQ,MAAM,EACf,CAAC,QAAS,OAAO,CACnB,EACA,MAAO,CAAC,CAAC,QAAS,OAAO,CAAC,EAC1B,KAAM,CAAC,CACT,EAEM,UAAqB,OACrB,OAAO,OAAU,WAAmB,MAAM,EAEvC,MAGH,MACH,IACD,CAAC,WAAY,aACX,QAAQ,EAAE,EAAE,QAAS,GAAG,WAAW,IAAI,SAAS,CAAC,EAoB9C,SAAS,oBACd,CAAE,KAAA,EAAyB,CAAE,MAAO,SAC3B,CACH,MAAA,OAAS,UAAU,KAAK,EAE9B,GAAI,CAAC,OAAc,MAAA,IAAI,MAAM,mBAAmB,EAEhD,MAAM,OAAS,CACb,CAAC,oBAAoB,EAAG,GACxB,MAAO,aAAA,MACP,MAAO,aAAA,MACP,KAAM,aAAA,MACN,QAAS,aAAA,MACT,KAAM,aAAA,KAAA,EAGG,SAAA,CAACA,OAAO,aAAa,IAAK,OAC5BA,OAAAA,MAAK,EAAI,MAAM,aAAa,EAE9B,OAAA,MACT,CAUO,SAAS,iBAAiB,OAA0B,CAClD,MAAA,CAAC,CAAC,OAAO,oBAAoB,CACtC"}
@@ -1,8 +0,0 @@
1
- /**
2
- * No operation function is used when we need to pass a function, but we don't want to specify any behavior.
3
- *
4
- * @breadcrumb Core
5
- * @public
6
- */
7
- export declare const NO_OP: (...args: any[]) => any;
8
- //# sourceMappingURL=no-op.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"no-op.d.ts","sourceRoot":"","sources":["../../src/core/no-op.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAkB,CAAC"}
package/lib/core/no-op.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),no_op_exports={};__export(no_op_exports,{NO_OP:()=>NO_OP});module.exports=__toCommonJS(no_op_exports);const NO_OP=()=>{};
2
- //# sourceMappingURL=no-op.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"no-op.js","sources":["../../src/core/no-op.ts"],"sourcesContent":["/**\n * No operation function is used when we need to pass a function, but we don't want to specify any behavior.\n *\n * @breadcrumb Core\n * @public\n */\nexport const NO_OP: (...args: any[]) => any = () => void 0;\n"],"names":[],"mappings":"ooBAAA,cAAA,CAAA,EAAA,SAAA,cAAA,CAAA,MAAA,IAAA,KAAA,CAAA,EAAA,OAAA,QAAA,aAAA,aAAA,EAMO,MAAM,MAAiC,IAAM"}
@@ -1,22 +0,0 @@
1
- /**
2
- * Return the defaultValue whether the value is undefined, otherwise, return the value.
3
- *
4
- * @example
5
- * ```typescript
6
- * const value1 = getDefaultIfUndefined(undefined, true);
7
- * const value2 = getDefaultIfUndefined(false, true);
8
- *
9
- * console.log(value1);
10
- * // true
11
- * console.log(value2);
12
- * // false
13
- * ```
14
- *
15
- * @param value - The value to be checked
16
- * @param defaultValue - The default value when value is undefined
17
- *
18
- * @breadcrumb Core
19
- * @public
20
- */
21
- export declare function getDefaultIfUndefined<T>(value: T | undefined, defaultValue: T): T;
22
- //# sourceMappingURL=optional.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optional.d.ts","sourceRoot":"","sources":["../../src/core/optional.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,KAAK,EAAE,CAAC,GAAG,SAAS,EACpB,YAAY,EAAE,CAAC,GACd,CAAC,CAIH"}
@@ -1,2 +0,0 @@
1
- "use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),optional_exports={};__export(optional_exports,{getDefaultIfUndefined:()=>getDefaultIfUndefined});module.exports=__toCommonJS(optional_exports);function getDefaultIfUndefined(value,defaultValue){return value===void 0?defaultValue:value}
2
- //# sourceMappingURL=optional.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optional.js","sources":["../../src/core/optional.ts"],"sourcesContent":["/**\n * Return the defaultValue whether the value is undefined, otherwise, return the value.\n *\n * @example\n * ```typescript\n * const value1 = getDefaultIfUndefined(undefined, true);\n * const value2 = getDefaultIfUndefined(false, true);\n *\n * console.log(value1);\n * // true\n * console.log(value2);\n * // false\n * ```\n *\n * @param value - The value to be checked\n * @param defaultValue - The default value when value is undefined\n *\n * @breadcrumb Core\n * @public\n */\nexport function getDefaultIfUndefined<T>(\n value: T | undefined,\n defaultValue: T,\n): T {\n if (value === undefined) return defaultValue;\n\n return value;\n}\n"],"names":[],"mappings":"ooBAAA,iBAAA,CAAA,EAAA,SAAA,iBAAA,CAAA,sBAAA,IAAA,qBAAA,CAAA,EAAA,OAAA,QAAA,aAAA,gBAAA,EAoBO,SAAS,sBACd,MACA,aACG,CACH,OAAI,QAAU,OAAkB,aAEzB,KACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/core/path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,EACZ,WAAW,EACP,MAAM,GACN,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GAC7C,SAAS,GACT,IAAI,GACP,MAAM,CAUR;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,8BAA8B,CAC5C,iBAAiB,EACb,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GAC7C,SAAS,GACT,IAAI,GACP,MAAM,CAkBR;AAED;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAIvD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,eAAe,CAWjB"}