@forklaunch/core 0.2.37 → 0.3.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 (222) hide show
  1. package/lib/{src/database/mikro/models/entities/base.entity.d.ts → base.entity-DNfmMOgd.d.mts} +3 -2
  2. package/lib/base.entity-DNfmMOgd.d.ts +27 -0
  3. package/lib/{src/cache/redisTtlCache.d.ts → cache/index.d.mts} +67 -4
  4. package/lib/cache/index.d.ts +130 -0
  5. package/lib/cache/index.js +133 -0
  6. package/lib/cache/index.mjs +105 -0
  7. package/lib/controllers/index.d.mts +5 -0
  8. package/lib/controllers/index.d.ts +5 -0
  9. package/lib/controllers/index.js +18 -0
  10. package/lib/controllers/index.mjs +0 -0
  11. package/lib/database/index.d.mts +37 -0
  12. package/lib/{src/database/mikro/models/entities/mongo.base.entity.d.ts → database/index.d.ts} +5 -2
  13. package/lib/database/index.js +78 -0
  14. package/lib/database/index.mjs +53 -0
  15. package/lib/dtoMapper/index.d.mts +215 -0
  16. package/lib/dtoMapper/index.d.ts +215 -0
  17. package/lib/dtoMapper/index.js +235 -0
  18. package/lib/dtoMapper/index.mjs +213 -0
  19. package/lib/http/index.d.mts +910 -0
  20. package/lib/http/index.d.ts +910 -0
  21. package/lib/http/index.js +2189 -0
  22. package/lib/http/index.mjs +2134 -0
  23. package/lib/services/index.d.mts +69 -0
  24. package/lib/services/index.d.ts +69 -0
  25. package/lib/services/index.js +244 -0
  26. package/lib/services/index.mjs +215 -0
  27. package/package.json +68 -55
  28. package/lib/src/cache/index.d.ts +0 -5
  29. package/lib/src/cache/index.d.ts.map +0 -1
  30. package/lib/src/cache/index.js +0 -4
  31. package/lib/src/cache/interfaces/ttlCache.interface.d.ts +0 -48
  32. package/lib/src/cache/interfaces/ttlCache.interface.d.ts.map +0 -1
  33. package/lib/src/cache/interfaces/ttlCache.interface.js +0 -1
  34. package/lib/src/cache/redisTtlCache.d.ts.map +0 -1
  35. package/lib/src/cache/redisTtlCache.js +0 -98
  36. package/lib/src/cache/types/ttlCacheRecord.types.d.ts +0 -14
  37. package/lib/src/cache/types/ttlCacheRecord.types.d.ts.map +0 -1
  38. package/lib/src/cache/types/ttlCacheRecord.types.js +0 -1
  39. package/lib/src/cache/utils/cacheKey.d.ts +0 -2
  40. package/lib/src/cache/utils/cacheKey.d.ts.map +0 -1
  41. package/lib/src/cache/utils/cacheKey.js +0 -3
  42. package/lib/src/controllers/index.d.ts +0 -2
  43. package/lib/src/controllers/index.d.ts.map +0 -1
  44. package/lib/src/controllers/index.js +0 -1
  45. package/lib/src/controllers/interfaces/controller.interface.d.ts +0 -4
  46. package/lib/src/controllers/interfaces/controller.interface.d.ts.map +0 -1
  47. package/lib/src/controllers/interfaces/controller.interface.js +0 -1
  48. package/lib/src/database/index.d.ts +0 -3
  49. package/lib/src/database/index.d.ts.map +0 -1
  50. package/lib/src/database/index.js +0 -2
  51. package/lib/src/database/mikro/models/entities/base.entity.d.ts.map +0 -1
  52. package/lib/src/database/mikro/models/entities/base.entity.js +0 -42
  53. package/lib/src/database/mikro/models/entities/mongo.base.entity.d.ts.map +0 -1
  54. package/lib/src/database/mikro/models/entities/mongo.base.entity.js +0 -51
  55. package/lib/src/dtoMapper/index.d.ts +0 -3
  56. package/lib/src/dtoMapper/index.d.ts.map +0 -1
  57. package/lib/src/dtoMapper/index.js +0 -2
  58. package/lib/src/dtoMapper/interfaces/dtoMapper.interface.d.ts +0 -18
  59. package/lib/src/dtoMapper/interfaces/dtoMapper.interface.d.ts.map +0 -1
  60. package/lib/src/dtoMapper/interfaces/dtoMapper.interface.js +0 -1
  61. package/lib/src/dtoMapper/models/baseDtoMapper.model.d.ts +0 -72
  62. package/lib/src/dtoMapper/models/baseDtoMapper.model.d.ts.map +0 -1
  63. package/lib/src/dtoMapper/models/baseDtoMapper.model.js +0 -76
  64. package/lib/src/dtoMapper/models/requestDtoMapper.model.d.ts +0 -68
  65. package/lib/src/dtoMapper/models/requestDtoMapper.model.d.ts.map +0 -1
  66. package/lib/src/dtoMapper/models/requestDtoMapper.model.js +0 -71
  67. package/lib/src/dtoMapper/models/responseDtoMapper.model.d.ts +0 -67
  68. package/lib/src/dtoMapper/models/responseDtoMapper.model.d.ts.map +0 -1
  69. package/lib/src/dtoMapper/models/responseDtoMapper.model.js +0 -68
  70. package/lib/src/dtoMapper/types/dtoMapper.types.d.ts +0 -9
  71. package/lib/src/dtoMapper/types/dtoMapper.types.d.ts.map +0 -1
  72. package/lib/src/dtoMapper/types/dtoMapper.types.js +0 -1
  73. package/lib/src/http/application/expressLikeApplication.d.ts +0 -21
  74. package/lib/src/http/application/expressLikeApplication.d.ts.map +0 -1
  75. package/lib/src/http/application/expressLikeApplication.js +0 -21
  76. package/lib/src/http/guards/isConstrainedForklaunchRouter.d.ts +0 -4
  77. package/lib/src/http/guards/isConstrainedForklaunchRouter.d.ts.map +0 -1
  78. package/lib/src/http/guards/isConstrainedForklaunchRouter.js +0 -5
  79. package/lib/src/http/guards/isExpressLikeSchemaHandler.d.ts +0 -5
  80. package/lib/src/http/guards/isExpressLikeSchemaHandler.d.ts.map +0 -1
  81. package/lib/src/http/guards/isExpressLikeSchemaHandler.js +0 -6
  82. package/lib/src/http/guards/isForklaunchExpressLikeRouter.d.ts +0 -5
  83. package/lib/src/http/guards/isForklaunchExpressLikeRouter.d.ts.map +0 -1
  84. package/lib/src/http/guards/isForklaunchExpressLikeRouter.js +0 -6
  85. package/lib/src/http/guards/isForklaunchRouter.d.ts +0 -4
  86. package/lib/src/http/guards/isForklaunchRouter.d.ts.map +0 -1
  87. package/lib/src/http/guards/isForklaunchRouter.js +0 -7
  88. package/lib/src/http/guards/isHttpContractDetails.d.ts +0 -7
  89. package/lib/src/http/guards/isHttpContractDetails.d.ts.map +0 -1
  90. package/lib/src/http/guards/isHttpContractDetails.js +0 -9
  91. package/lib/src/http/guards/isPathParamContractDetails.d.ts +0 -4
  92. package/lib/src/http/guards/isPathParamContractDetails.d.ts.map +0 -1
  93. package/lib/src/http/guards/isPathParamContractDetails.js +0 -10
  94. package/lib/src/http/guards/isResponseShape.d.ts +0 -3
  95. package/lib/src/http/guards/isResponseShape.d.ts.map +0 -1
  96. package/lib/src/http/guards/isResponseShape.js +0 -7
  97. package/lib/src/http/guards/isTypedHandler.d.ts +0 -5
  98. package/lib/src/http/guards/isTypedHandler.d.ts.map +0 -1
  99. package/lib/src/http/guards/isTypedHandler.js +0 -6
  100. package/lib/src/http/handlers/delete.d.ts +0 -9
  101. package/lib/src/http/handlers/delete.d.ts.map +0 -1
  102. package/lib/src/http/handlers/delete.js +0 -4
  103. package/lib/src/http/handlers/get.d.ts +0 -9
  104. package/lib/src/http/handlers/get.d.ts.map +0 -1
  105. package/lib/src/http/handlers/get.js +0 -4
  106. package/lib/src/http/handlers/head.d.ts +0 -9
  107. package/lib/src/http/handlers/head.d.ts.map +0 -1
  108. package/lib/src/http/handlers/head.js +0 -4
  109. package/lib/src/http/handlers/middleware.d.ts +0 -9
  110. package/lib/src/http/handlers/middleware.d.ts.map +0 -1
  111. package/lib/src/http/handlers/middleware.js +0 -4
  112. package/lib/src/http/handlers/options.d.ts +0 -9
  113. package/lib/src/http/handlers/options.d.ts.map +0 -1
  114. package/lib/src/http/handlers/options.js +0 -4
  115. package/lib/src/http/handlers/patch.d.ts +0 -9
  116. package/lib/src/http/handlers/patch.d.ts.map +0 -1
  117. package/lib/src/http/handlers/patch.js +0 -4
  118. package/lib/src/http/handlers/post.d.ts +0 -9
  119. package/lib/src/http/handlers/post.d.ts.map +0 -1
  120. package/lib/src/http/handlers/post.js +0 -4
  121. package/lib/src/http/handlers/put.d.ts +0 -9
  122. package/lib/src/http/handlers/put.d.ts.map +0 -1
  123. package/lib/src/http/handlers/put.js +0 -4
  124. package/lib/src/http/handlers/trace.d.ts +0 -9
  125. package/lib/src/http/handlers/trace.d.ts.map +0 -1
  126. package/lib/src/http/handlers/trace.js +0 -4
  127. package/lib/src/http/handlers/typedAuthHandler.d.ts +0 -5
  128. package/lib/src/http/handlers/typedAuthHandler.d.ts.map +0 -1
  129. package/lib/src/http/handlers/typedAuthHandler.js +0 -3
  130. package/lib/src/http/handlers/typedHandler.d.ts +0 -21
  131. package/lib/src/http/handlers/typedHandler.d.ts.map +0 -1
  132. package/lib/src/http/handlers/typedHandler.js +0 -30
  133. package/lib/src/http/index.d.ts +0 -23
  134. package/lib/src/http/index.d.ts.map +0 -1
  135. package/lib/src/http/index.js +0 -22
  136. package/lib/src/http/interfaces/expressLikeRouter.interface.d.ts +0 -24
  137. package/lib/src/http/interfaces/expressLikeRouter.interface.d.ts.map +0 -1
  138. package/lib/src/http/interfaces/expressLikeRouter.interface.js +0 -1
  139. package/lib/src/http/middleware/request/auth.middleware.d.ts +0 -16
  140. package/lib/src/http/middleware/request/auth.middleware.d.ts.map +0 -1
  141. package/lib/src/http/middleware/request/auth.middleware.js +0 -143
  142. package/lib/src/http/middleware/request/cors.middleware.d.ts +0 -13
  143. package/lib/src/http/middleware/request/cors.middleware.d.ts.map +0 -1
  144. package/lib/src/http/middleware/request/cors.middleware.js +0 -15
  145. package/lib/src/http/middleware/request/createContext.middleware.d.ts +0 -15
  146. package/lib/src/http/middleware/request/createContext.middleware.d.ts.map +0 -1
  147. package/lib/src/http/middleware/request/createContext.middleware.js +0 -26
  148. package/lib/src/http/middleware/request/enrichDetails.middleware.d.ts +0 -15
  149. package/lib/src/http/middleware/request/enrichDetails.middleware.d.ts.map +0 -1
  150. package/lib/src/http/middleware/request/enrichDetails.middleware.js +0 -19
  151. package/lib/src/http/middleware/request/parse.middleware.d.ts +0 -17
  152. package/lib/src/http/middleware/request/parse.middleware.d.ts.map +0 -1
  153. package/lib/src/http/middleware/request/parse.middleware.js +0 -43
  154. package/lib/src/http/middleware/response/parse.middleware.d.ts +0 -31
  155. package/lib/src/http/middleware/response/parse.middleware.d.ts.map +0 -1
  156. package/lib/src/http/middleware/response/parse.middleware.js +0 -52
  157. package/lib/src/http/openApiV3Generator/openApiV3Generator.d.ts +0 -14
  158. package/lib/src/http/openApiV3Generator/openApiV3Generator.d.ts.map +0 -1
  159. package/lib/src/http/openApiV3Generator/openApiV3Generator.js +0 -169
  160. package/lib/src/http/router/expressLikeRouter.d.ts +0 -138
  161. package/lib/src/http/router/expressLikeRouter.d.ts.map +0 -1
  162. package/lib/src/http/router/expressLikeRouter.js +0 -483
  163. package/lib/src/http/types/apiDefinition.types.d.ts +0 -260
  164. package/lib/src/http/types/apiDefinition.types.d.ts.map +0 -1
  165. package/lib/src/http/types/apiDefinition.types.js +0 -1
  166. package/lib/src/http/types/contractDetails.types.d.ts +0 -211
  167. package/lib/src/http/types/contractDetails.types.d.ts.map +0 -1
  168. package/lib/src/http/types/contractDetails.types.js +0 -1
  169. package/lib/src/http/types/expressLikeRouter.types.d.ts +0 -51
  170. package/lib/src/http/types/expressLikeRouter.types.d.ts.map +0 -1
  171. package/lib/src/http/types/expressLikeRouter.types.js +0 -1
  172. package/lib/src/http/types/router.types.d.ts +0 -32
  173. package/lib/src/http/types/router.types.d.ts.map +0 -1
  174. package/lib/src/http/types/router.types.js +0 -1
  175. package/lib/src/http/types/typedHandler.types.d.ts +0 -10
  176. package/lib/src/http/types/typedHandler.types.d.ts.map +0 -1
  177. package/lib/src/http/types/typedHandler.types.js +0 -1
  178. package/lib/src/http/utils/enrichExpressLikeSend.d.ts +0 -32
  179. package/lib/src/http/utils/enrichExpressLikeSend.d.ts.map +0 -1
  180. package/lib/src/http/utils/enrichExpressLikeSend.js +0 -50
  181. package/lib/src/http/utils/httpStatusCodes.d.ts +0 -75
  182. package/lib/src/http/utils/httpStatusCodes.d.ts.map +0 -1
  183. package/lib/src/http/utils/httpStatusCodes.js +0 -1039
  184. package/lib/src/services/configInjector.d.ts +0 -21
  185. package/lib/src/services/configInjector.d.ts.map +0 -1
  186. package/lib/src/services/configInjector.js +0 -90
  187. package/lib/src/services/index.d.ts +0 -5
  188. package/lib/src/services/index.d.ts.map +0 -1
  189. package/lib/src/services/index.js +0 -4
  190. package/lib/src/services/interfaces/baseService.d.ts +0 -15
  191. package/lib/src/services/interfaces/baseService.d.ts.map +0 -1
  192. package/lib/src/services/interfaces/baseService.js +0 -1
  193. package/lib/src/services/types/configInjector.types.d.ts +0 -25
  194. package/lib/src/services/types/configInjector.types.d.ts.map +0 -1
  195. package/lib/src/services/types/configInjector.types.js +0 -6
  196. package/lib/src/services/types/entityManager.types.d.ts +0 -4
  197. package/lib/src/services/types/entityManager.types.d.ts.map +0 -1
  198. package/lib/src/services/types/entityManager.types.js +0 -1
  199. package/lib/tests/configInjector.test.d.ts +0 -2
  200. package/lib/tests/configInjector.test.d.ts.map +0 -1
  201. package/lib/tests/configInjector.test.js +0 -105
  202. package/lib/tests/dtoMapper.test.d.ts +0 -2
  203. package/lib/tests/dtoMapper.test.d.ts.map +0 -1
  204. package/lib/tests/dtoMapper.test.js +0 -170
  205. package/lib/tests/expressLikeRouterInstantiation.test.d.ts +0 -2
  206. package/lib/tests/expressLikeRouterInstantiation.test.d.ts.map +0 -1
  207. package/lib/tests/expressLikeRouterInstantiation.test.js +0 -118
  208. package/lib/tests/http.middleware.test.d.ts +0 -2
  209. package/lib/tests/http.middleware.test.d.ts.map +0 -1
  210. package/lib/tests/http.middleware.test.js +0 -102
  211. package/lib/tests/openApiV3Generator.test.d.ts +0 -2
  212. package/lib/tests/openApiV3Generator.test.d.ts.map +0 -1
  213. package/lib/tests/openApiV3Generator.test.js +0 -66
  214. package/lib/tests/redisTtlCache.test.d.ts +0 -2
  215. package/lib/tests/redisTtlCache.test.d.ts.map +0 -1
  216. package/lib/tests/redisTtlCache.test.js +0 -49
  217. package/lib/tests/typedHandler.test.d.ts +0 -2
  218. package/lib/tests/typedHandler.test.d.ts.map +0 -1
  219. package/lib/tests/typedHandler.test.js +0 -3
  220. package/lib/vitest.config.d.ts +0 -3
  221. package/lib/vitest.config.d.ts.map +0 -1
  222. package/lib/vitest.config.js +0 -7
@@ -1,19 +0,0 @@
1
- /**
2
- * Middleware to enrich the request details with contract details.
3
- *
4
- * @template SV - A type that extends AnySchemaValidator.
5
- * @template Request - A type that extends ForklaunchRequest.
6
- * @template Response - A type that extends ForklaunchResponse.
7
- * @template NextFunction - A type that extends ForklaunchNextFunction.
8
- * @param {PathParamHttpContractDetails<SV> | HttpContractDetails<SV>} contractDetails - The contract details.
9
- * @returns {Function} - Middleware function to enrich request details.
10
- */
11
- export function enrichDetails(contractDetails, requestSchema, responseSchemas) {
12
- return (req, res, next) => {
13
- console.debug('[MIDDLEWARE] enrichRequestDetails started');
14
- req.contractDetails = contractDetails;
15
- req.requestSchema = requestSchema;
16
- res.responseSchemas = responseSchemas;
17
- next?.();
18
- };
19
- }
@@ -1,17 +0,0 @@
1
- import { AnySchemaValidator } from '@forklaunch/validator';
2
- import { ParsedQs } from 'qs';
3
- import { ForklaunchNextFunction, ForklaunchRequest, ForklaunchResponse } from '../../types/apiDefinition.types';
4
- import { ParamsDictionary } from '../../types/contractDetails.types';
5
- /**
6
- * Pre-handler function to parse and validate input.
7
- *
8
- * @template SV - A type that extends AnySchemaValidator.
9
- * @template Request - A type that extends ForklaunchRequest.
10
- * @template Response - A type that extends ForklaunchResponse.
11
- * @template NextFunction - A type that extends ForklaunchNextFunction.
12
- * @param {Request} req - The request object.
13
- * @param {Response} res - The response object.
14
- * @param {NextFunction} [next] - The next middleware function.
15
- */
16
- export declare function parse<SV extends AnySchemaValidator, P extends ParamsDictionary, ResBodyMap extends Record<number, unknown>, ReqBody extends Record<string, unknown>, ReqQuery extends ParsedQs, ReqHeaders extends Record<string, string>, ResHeaders extends Record<string, string>, LocalsObj extends Record<string, unknown>>(req: ForklaunchRequest<SV, P, ReqBody, ReqQuery, ReqHeaders>, _res: ForklaunchResponse<ResBodyMap, ResHeaders, LocalsObj>, next?: ForklaunchNextFunction): void;
17
- //# sourceMappingURL=parse.middleware.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse.middleware.d.ts","sourceRoot":"","sources":["../../../../../src/http/middleware/request/parse.middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAE9B,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE;;;;;;;;;;GAUG;AACH,wBAAgB,KAAK,CACnB,EAAE,SAAS,kBAAkB,EAC7B,CAAC,SAAS,gBAAgB,EAC1B,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1C,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvC,QAAQ,SAAS,QAAQ,EACzB,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACzC,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACzC,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAEzC,GAAG,EAAE,iBAAiB,CAAC,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,EAC5D,IAAI,EAAE,kBAAkB,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC,EAC3D,IAAI,CAAC,EAAE,sBAAsB,QAoC9B"}
@@ -1,43 +0,0 @@
1
- import { isResponseShape } from '../../guards/isResponseShape';
2
- /**
3
- * Pre-handler function to parse and validate input.
4
- *
5
- * @template SV - A type that extends AnySchemaValidator.
6
- * @template Request - A type that extends ForklaunchRequest.
7
- * @template Response - A type that extends ForklaunchResponse.
8
- * @template NextFunction - A type that extends ForklaunchNextFunction.
9
- * @param {Request} req - The request object.
10
- * @param {Response} res - The response object.
11
- * @param {NextFunction} [next] - The next middleware function.
12
- */
13
- export function parse(req, _res, next) {
14
- console.debug('[MIDDLEWARE] parseRequest started');
15
- const request = {
16
- params: req.params,
17
- query: req.query,
18
- headers: req.headers,
19
- body: req.body
20
- };
21
- const parsedRequest = req.schemaValidator.parse(req.requestSchema, request);
22
- if (parsedRequest.ok &&
23
- isResponseShape(parsedRequest.value)) {
24
- req.body = parsedRequest.value.body;
25
- req.params = parsedRequest.value.params;
26
- req.query = parsedRequest.value.query;
27
- req.headers = parsedRequest.value.headers;
28
- }
29
- if (!parsedRequest.ok) {
30
- switch (req.contractDetails.options?.requestValidation) {
31
- default:
32
- case 'error':
33
- next?.(new Error(`Invalid request: ${parsedRequest.error}`));
34
- break;
35
- case 'warning':
36
- console.warn(`Invalid request: ${parsedRequest.error}`);
37
- break;
38
- case 'none':
39
- break;
40
- }
41
- }
42
- next?.();
43
- }
@@ -1,31 +0,0 @@
1
- import { AnySchemaValidator } from '@forklaunch/validator';
2
- import { ParsedQs } from 'qs';
3
- import { ForklaunchNextFunction, ForklaunchRequest, ForklaunchResHeaders, ForklaunchResponse } from '../../types/apiDefinition.types';
4
- import { ParamsDictionary } from '../../types/contractDetails.types';
5
- /**
6
- * Middleware to parse and validate the response according to the provided schema.
7
- *
8
- * This function validates the response against a schema provided by the request's schema validator.
9
- * If the response does not conform to the schema, the behavior is determined by the `responseValidation`
10
- * option in `req.contractDetails.options`:
11
- * - `'error'` (default): Calls `next` with an error.
12
- * - `'warning'`: Logs a warning to the console.
13
- * - `'none'`: Silently continues without action.
14
- *
15
- * @template SV - The type of the schema validator used in the request.
16
- * @template P - The type of the parameters dictionary used in the request.
17
- * @template ResBodyMap - A record type mapping status codes to response body types.
18
- * @template ReqBody - The type of the request body.
19
- * @template ReqQuery - The type of the parsed query string.
20
- * @template ReqHeaders - The type of the request headers.
21
- * @template ResHeaders - The type of the response headers, extended from `ForklaunchResHeaders`.
22
- * @template LocalsObj - The type of the locals object in the response.
23
- *
24
- * @param {ForklaunchRequest<SV, P, ReqBody, ReqQuery, ReqHeaders>} req - The request object, containing the schema validator and other request data.
25
- * @param {ForklaunchResponse<ResBodyMap, ForklaunchResHeaders & ResHeaders, LocalsObj>} res - The response object, including headers and body data.
26
- * @param {ForklaunchNextFunction} [next] - The next middleware function to be called. If not provided, the function will return after processing.
27
- *
28
- * @returns {void} This function does not return a value.
29
- */
30
- export declare function parse<SV extends AnySchemaValidator, P extends ParamsDictionary, ResBodyMap extends Record<number, unknown>, ReqBody extends Record<string, unknown>, ReqQuery extends ParsedQs, ReqHeaders extends Record<string, string>, ResHeaders extends Record<string, string>, LocalsObj extends Record<string, unknown>>(req: ForklaunchRequest<SV, P, ReqBody, ReqQuery, ReqHeaders>, res: ForklaunchResponse<ResBodyMap, ForklaunchResHeaders & ResHeaders, LocalsObj>, next?: ForklaunchNextFunction): void;
31
- //# sourceMappingURL=parse.middleware.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse.middleware.d.ts","sourceRoot":"","sources":["../../../../../src/http/middleware/response/parse.middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAC9B,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,KAAK,CACnB,EAAE,SAAS,kBAAkB,EAC7B,CAAC,SAAS,gBAAgB,EAC1B,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1C,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvC,QAAQ,SAAS,QAAQ,EACzB,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACzC,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACzC,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAEzC,GAAG,EAAE,iBAAiB,CAAC,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,EAC5D,GAAG,EAAE,kBAAkB,CACrB,UAAU,EACV,oBAAoB,GAAG,UAAU,EACjC,SAAS,CACV,EACD,IAAI,CAAC,EAAE,sBAAsB,QAyC9B"}
@@ -1,52 +0,0 @@
1
- /**
2
- * Middleware to parse and validate the response according to the provided schema.
3
- *
4
- * This function validates the response against a schema provided by the request's schema validator.
5
- * If the response does not conform to the schema, the behavior is determined by the `responseValidation`
6
- * option in `req.contractDetails.options`:
7
- * - `'error'` (default): Calls `next` with an error.
8
- * - `'warning'`: Logs a warning to the console.
9
- * - `'none'`: Silently continues without action.
10
- *
11
- * @template SV - The type of the schema validator used in the request.
12
- * @template P - The type of the parameters dictionary used in the request.
13
- * @template ResBodyMap - A record type mapping status codes to response body types.
14
- * @template ReqBody - The type of the request body.
15
- * @template ReqQuery - The type of the parsed query string.
16
- * @template ReqHeaders - The type of the request headers.
17
- * @template ResHeaders - The type of the response headers, extended from `ForklaunchResHeaders`.
18
- * @template LocalsObj - The type of the locals object in the response.
19
- *
20
- * @param {ForklaunchRequest<SV, P, ReqBody, ReqQuery, ReqHeaders>} req - The request object, containing the schema validator and other request data.
21
- * @param {ForklaunchResponse<ResBodyMap, ForklaunchResHeaders & ResHeaders, LocalsObj>} res - The response object, including headers and body data.
22
- * @param {ForklaunchNextFunction} [next] - The next middleware function to be called. If not provided, the function will return after processing.
23
- *
24
- * @returns {void} This function does not return a value.
25
- */
26
- export function parse(req, res, next) {
27
- console.debug('[MIDDLEWARE] parseResponse started');
28
- const { headers, responses } = res.responseSchemas;
29
- const parsedResponse = req.schemaValidator.parse(responses?.[res.statusCode], res.bodyData);
30
- const parsedHeaders = req.schemaValidator.parse(headers ?? req.schemaValidator.unknown, res.getHeaders());
31
- const parseErrors = [];
32
- if (!parsedHeaders.ok) {
33
- parseErrors.push(`${parsedHeaders.error ? `Header ${parsedHeaders.error}` : ''}`);
34
- }
35
- if (!parsedResponse.ok) {
36
- parseErrors.push(`${parsedResponse.error ? `Response ${parsedResponse.error}` : ''}`);
37
- }
38
- if (parseErrors.length > 0) {
39
- switch (req.contractDetails.options?.responseValidation) {
40
- default:
41
- case 'error':
42
- next?.(new Error(`Invalid response:\n${parseErrors.join('\n\n')}`));
43
- break;
44
- case 'warning':
45
- console.warn(`Invalid response:\n${parseErrors.join('\n\n')}`);
46
- break;
47
- case 'none':
48
- break;
49
- }
50
- }
51
- next?.();
52
- }
@@ -1,14 +0,0 @@
1
- import { AnySchemaValidator } from '@forklaunch/validator';
2
- import { OpenAPIObject } from 'openapi3-ts/oas31';
3
- import { ForklaunchRouter } from '../types/router.types';
4
- /**
5
- * Generates a Swagger document from given routers.
6
- *
7
- * @template SV - A type that extends AnySchemaValidator.
8
- * @param {SV} schemaValidator - The schema validator.
9
- * @param {string | number} port - The port on which the server is running.
10
- * @param {ForklaunchRouter<SV>[]} routers - The routers to include in the Swagger document.
11
- * @returns {OpenAPIObject} - The generated Swagger document.
12
- */
13
- export declare function generateSwaggerDocument<SV extends AnySchemaValidator>(schemaValidator: SV, port: string | number, routers: ForklaunchRouter<SV>[]): OpenAPIObject;
14
- //# sourceMappingURL=openApiV3Generator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openApiV3Generator.d.ts","sourceRoot":"","sources":["../../../../src/http/openApiV3Generator/openApiV3Generator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAGnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,aAAa,EAKd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AA0FzD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,SAAS,kBAAkB,EACnE,eAAe,EAAE,EAAE,EACnB,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,OAAO,EAAE,gBAAgB,CAAC,EAAE,CAAC,EAAE,GAC9B,aAAa,CAuGf"}
@@ -1,169 +0,0 @@
1
- import HTTPStatuses from '../utils/httpStatusCodes';
2
- /**
3
- * Capitalizes the first letter of a string.
4
- *
5
- * @param {string} str - The string to transform.
6
- * @returns {string} - The transformed string with the first letter capitalized.
7
- */
8
- function toUpperCase(str) {
9
- return str.charAt(0).toUpperCase() + str.slice(1);
10
- }
11
- /**
12
- * Transforms a base path by ensuring it starts with a slash and capitalizing the first letter.
13
- *
14
- * @param {string} basePath - The base path to transform.
15
- * @returns {string} - The transformed base path.
16
- */
17
- function transformBasePath(basePath) {
18
- if (basePath.startsWith('/')) {
19
- return toUpperCase(basePath.slice(1));
20
- }
21
- return `/${basePath}`;
22
- }
23
- /**
24
- * Creates a Swagger document.
25
- *
26
- * @param {string | number} port - The port on which the server is running.
27
- * @param {TagObject[]} tags - The tags for the Swagger document.
28
- * @param {PathObject} paths - The paths for the Swagger document.
29
- * @returns {OpenAPIObject} - The Swagger document.
30
- */
31
- function swaggerDocument(port, tags, paths) {
32
- return {
33
- openapi: '3.1.0',
34
- info: {
35
- title: process.env.API_TITLE || '',
36
- version: process.env.VERSION || '1.0.0'
37
- },
38
- components: {
39
- securitySchemes: {
40
- bearer: {
41
- type: 'http',
42
- scheme: 'bearer',
43
- bearerFormat: 'JWT'
44
- }
45
- }
46
- },
47
- tags,
48
- servers: [
49
- {
50
- url: `http://localhost:${port}`
51
- }
52
- ],
53
- paths
54
- };
55
- }
56
- /**
57
- * Resolves the content object for a given schema.
58
- *
59
- * @template SV - A type that extends AnySchemaValidator.
60
- * @param {SV} schemaValidator - The schema validator.
61
- * @param {IdiomaticSchema<SV>} body - The schema body.
62
- * @returns {ContentObject} - The resolved content object.
63
- */
64
- function contentResolver(schemaValidator, body) {
65
- const bodySpec = schemaValidator.openapi(body);
66
- return body === schemaValidator.string
67
- ? {
68
- 'plain/text': {
69
- schema: bodySpec
70
- }
71
- }
72
- : {
73
- 'application/json': {
74
- schema: bodySpec
75
- }
76
- };
77
- }
78
- /**
79
- * Generates a Swagger document from given routers.
80
- *
81
- * @template SV - A type that extends AnySchemaValidator.
82
- * @param {SV} schemaValidator - The schema validator.
83
- * @param {string | number} port - The port on which the server is running.
84
- * @param {ForklaunchRouter<SV>[]} routers - The routers to include in the Swagger document.
85
- * @returns {OpenAPIObject} - The generated Swagger document.
86
- */
87
- export function generateSwaggerDocument(schemaValidator, port, routers) {
88
- const tags = [];
89
- const paths = {};
90
- routers.flat(Infinity).forEach((router) => {
91
- const controllerName = transformBasePath(router.basePath);
92
- tags.push({
93
- name: controllerName,
94
- description: `${controllerName} Operations`
95
- });
96
- router.routes.forEach((route) => {
97
- const fullPath = `${router.basePath}${route.path === '/' ? '' : route.path}`.replace(/:(\w+)/g, '{$1}');
98
- if (!paths[fullPath]) {
99
- paths[fullPath] = {};
100
- }
101
- const { name, summary, query, requestHeaders } = route.contractDetails;
102
- const responses = {};
103
- for (const key in route.contractDetails.responses) {
104
- responses[key] = {
105
- description: HTTPStatuses[key],
106
- content: contentResolver(schemaValidator, route.contractDetails.responses[key])
107
- };
108
- }
109
- const pathItemObject = {
110
- tags: [controllerName],
111
- summary: `${name}: ${summary}`,
112
- parameters: [],
113
- responses
114
- };
115
- if (route.contractDetails.params) {
116
- for (const key in route.contractDetails.params) {
117
- pathItemObject.parameters?.push({
118
- name: key,
119
- in: 'path'
120
- });
121
- }
122
- }
123
- const body = route.contractDetails.body;
124
- if (body) {
125
- pathItemObject.requestBody = {
126
- required: true,
127
- content: contentResolver(schemaValidator, body)
128
- };
129
- }
130
- if (requestHeaders) {
131
- for (const key in requestHeaders) {
132
- pathItemObject.parameters?.push({
133
- name: key,
134
- in: 'header'
135
- });
136
- }
137
- }
138
- if (query) {
139
- for (const key in query) {
140
- pathItemObject.parameters?.push({
141
- name: key,
142
- in: 'query'
143
- });
144
- }
145
- }
146
- if (route.contractDetails.auth) {
147
- responses[401] = {
148
- description: HTTPStatuses[401],
149
- content: contentResolver(schemaValidator, schemaValidator.string)
150
- };
151
- responses[403] = {
152
- description: HTTPStatuses[403],
153
- content: contentResolver(schemaValidator, schemaValidator.string)
154
- };
155
- if (route.contractDetails.auth.method === 'jwt') {
156
- pathItemObject.security = [
157
- {
158
- bearer: Array.from(route.contractDetails.auth.allowedPermissions?.values() || [])
159
- }
160
- ];
161
- }
162
- }
163
- if (route.method !== 'middleware') {
164
- paths[fullPath][route.method] = pathItemObject;
165
- }
166
- });
167
- });
168
- return swaggerDocument(port, tags, paths);
169
- }
@@ -1,138 +0,0 @@
1
- import { AnySchemaValidator } from '@forklaunch/validator';
2
- import { ExpressLikeRouter, NestableRouterBasedHandler, PathBasedHandler, PathOrMiddlewareBasedHandler } from '../interfaces/expressLikeRouter.interface';
3
- import { LiveTypeFunction } from '../types/apiDefinition.types';
4
- import { Body, HeadersObject, Method, ParamsObject, QueryObject, ResponsesObject } from '../types/contractDetails.types';
5
- import { ContractDetailsOrMiddlewareOrTypedHandler, LiveTypeRouteDefinition, MiddlewareOrMiddlewareWithTypedHandler, TypedMiddlewareDefinition, TypedNestableMiddlewareDefinition } from '../types/expressLikeRouter.types';
6
- import { ConstrainedForklaunchRouter, ForklaunchRoute, ForklaunchRouter } from '../types/router.types';
7
- /**
8
- * A class that represents an Express-like router.
9
- */
10
- export declare class ForklaunchExpressLikeRouter<SV extends AnySchemaValidator, BasePath extends `/${string}`, RouterHandler, Internal extends ExpressLikeRouter<RouterHandler, Internal>> implements ConstrainedForklaunchRouter<SV, RouterHandler> {
11
- #private;
12
- readonly schemaValidator: SV;
13
- readonly internal: Internal;
14
- requestHandler: RouterHandler;
15
- routers: ForklaunchRouter<SV>[];
16
- readonly routes: ForklaunchRoute<SV>[];
17
- readonly basePath: BasePath;
18
- constructor(basePath: BasePath, schemaValidator: SV, internal: Internal);
19
- registerRoute<ContractMethod extends Method, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>>(method: ContractMethod, path: Path, registrationMethod: PathBasedHandler<RouterHandler>, contractDetailsOrMiddlewareOrTypedHandler: ContractDetailsOrMiddlewareOrTypedHandler<SV, ContractMethod, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj>, ...middlewareOrMiddlewareAndTypedHandler: MiddlewareOrMiddlewareWithTypedHandler<SV, ContractMethod, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj>[]): LiveTypeFunction<SV, `${BasePath}${Path}`, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders>;
20
- registerMiddlewareHandler<Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>>(registrationMethod: PathOrMiddlewareBasedHandler<RouterHandler>, pathOrContractDetailsOrMiddlewareOrTypedHandler: Path | ContractDetailsOrMiddlewareOrTypedHandler<SV, 'middleware', Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj>, contractDetailsOrMiddlewareOrTypedHandler?: ContractDetailsOrMiddlewareOrTypedHandler<SV, 'middleware', Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj>, ...middlewareOrMiddlewareWithTypedHandler: MiddlewareOrMiddlewareWithTypedHandler<SV, 'middleware', Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj>[]): this;
21
- registerNestableMiddlewareHandler<Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>>(registrationMethod: NestableRouterBasedHandler<RouterHandler, Internal>, pathOrContractDetailsOrMiddlewareOrTypedHandler: Path | ContractDetailsOrMiddlewareOrTypedHandler<SV, 'middleware', Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj> | ConstrainedForklaunchRouter<SV, RouterHandler>, contractDetailsOrMiddlewareOrTypedHandler?: ContractDetailsOrMiddlewareOrTypedHandler<SV, 'middleware', Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj> | ConstrainedForklaunchRouter<SV, RouterHandler>, ...middlewareOrMiddlewareWithTypedHandler: (MiddlewareOrMiddlewareWithTypedHandler<SV, 'middleware', Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj> | ConstrainedForklaunchRouter<SV, RouterHandler>)[]): this;
22
- use: TypedNestableMiddlewareDefinition<this, RouterHandler, Internal, SV>;
23
- all: TypedMiddlewareDefinition<this, SV>;
24
- connect: TypedMiddlewareDefinition<this, SV>;
25
- /**
26
- * Registers a GET route with the specified contract details and handler handlers.
27
- *
28
- * @template P - The type of request parameters.
29
- * @template ResBodyMap - The type of response body.
30
- * @template ReqBody - The type of request body.
31
- * @template ReqQuery - The type of request query.
32
- * @template LocalsObj - The type of local variables.
33
- * @param {string} path - The path for the route.
34
- * @param {PathParamHttpContractDetails<SV, P, ResBodyMap, ReqQuery>} contractDetails - The contract details.
35
- * @param {...SchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>[]} handlers - The handler handlers.
36
- * @returns {ExpressRouter} - The Express router.
37
- */
38
- get: LiveTypeRouteDefinition<SV, BasePath, 'get'>;
39
- /**
40
- * Registers a POST route with the specified contract details and handler handlers.
41
- *
42
- * @template P - The type of request parameters.
43
- * @template ResBodyMap - The type of response body.
44
- * @template ReqBody - The type of request body.
45
- * @template ReqQuery - The type of request query.
46
- * @template LocalsObj - The type of local variables.
47
- * @param {string} path - The path for the route.
48
- * @param {HttpContractDetails<SV, P, ResBodyMap, ReqBody, ReqQuery>} contractDetails - The contract details.
49
- * @param {...SchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>[]} handlers - The handler handlers.
50
- * @returns {ExpressRouter} - The Expxwress router.
51
- */
52
- post: LiveTypeRouteDefinition<SV, BasePath, 'post'>;
53
- /**
54
- * Registers a PUT route with the specified contract details and handler handlers.
55
- *
56
- * @template P - The type of request parameters.
57
- * @template ResBodyMap - The type of response body.
58
- * @template ReqBody - The type of request body.
59
- * @template ReqQuery - The type of request query.
60
- * @template LocalsObj - The type of local variables.
61
- * @param {string} path - The path for the route.
62
- * @param {HttpContractDetails<SV, P, ResBodyMap, ReqBody, ReqQuery>} contractDetails - The contract details.
63
- * @param {...SchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>[]} handlers - The handler handlers.
64
- * @returns {ExpressRouter} - The Express router.
65
- */
66
- put: LiveTypeRouteDefinition<SV, BasePath, 'put'>;
67
- /**
68
- * Registers a PATCH route with the specified contract details and handler handlers.
69
- *
70
- * @template P - The type of request parameters.
71
- * @template ResBodyMap - The type of response body.
72
- * @template ReqBody - The type of request body.
73
- * @template ReqQuery - The type of request query.
74
- * @template LocalsObj - The type of local variables.
75
- * @param {string} path - The path for the route.
76
- * @param {HttpContractDetails<SV, P, ResBodyMap, ReqBody, ReqQuery>} contractDetails - The contract details.
77
- * @param {...SchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>[]} handlers - The handler handlers.
78
- * @returns {ExpressRouter} - The Express router.
79
- */
80
- patch: LiveTypeRouteDefinition<SV, BasePath, 'patch'>;
81
- /**
82
- * Registers a DELETE route with the specified contract details and handler handlers.
83
- *
84
- * @template P - The type of request parameters.
85
- * @template ResBodyMap - The type of response body.
86
- * @template ReqBody - The type of request body.
87
- * @template ReqQuery - The type of request query.
88
- * @template LocalsObj - The type of local variables.
89
- * @param {string} path - The path for the route.
90
- * @param {PathParamHttpContractDetails<SV, P, ResBodyMap, ReqQuery>} contractDetails - The contract details.
91
- * @param {...SchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>[]} handlers - The handler handlers.
92
- * @returns {ExpressRouter} - The Express router.
93
- */
94
- delete: LiveTypeRouteDefinition<SV, BasePath, 'delete'>;
95
- /**
96
- * Registers a OPTIONS route with the specified contract details and handler handlers.
97
- *
98
- * @template P - The type of request parameters.
99
- * @template ResBodyMap - The type of response body.
100
- * @template ReqBody - The type of request body.
101
- * @template ReqQuery - The type of request query.
102
- * @template LocalsObj - The type of local variables.
103
- * @param {string} path - The path for the route.
104
- * @param {PathParamHttpContractDetails<SV, P, ResBodyMap, ReqQuery>} contractDetails - The contract details.
105
- * @param {...SchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>[]} handlers - The handler handlers.
106
- * @returns {ExpressRouter} - The Express router.
107
- */
108
- options: LiveTypeRouteDefinition<SV, BasePath, 'options'>;
109
- /**
110
- * Registers a HEAD route with the specified contract details and handler handlers.
111
- *
112
- * @template P - The type of request parameters.
113
- * @template ResBodyMap - The type of response body.
114
- * @template ReqBody - The type of request body.
115
- * @template ReqQuery - The type of request query.
116
- * @template LocalsObj - The type of local variables.
117
- * @param {string} path - The path for the route.
118
- * @param {PathParamHttpContractDetails<SV, P, ResBodyMap, ReqQuery>} contractDetails - The contract details.
119
- * @param {...SchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>[]} handlers - The handler handlers.
120
- * @returns {ExpressRouter} - The Express router.
121
- */
122
- head: LiveTypeRouteDefinition<SV, BasePath, 'head'>;
123
- /**
124
- * Registers a TRACE route with the specified contract details and handler handlers.
125
- *
126
- * @template P - The type of request parameters.
127
- * @template ResBodyMap - The type of response body.
128
- * @template ReqBody - The type of request body.
129
- * @template ReqQuery - The type of request query.
130
- * @template LocalsObj - The type of local variables.
131
- * @param {string} path - The path for the route.
132
- * @param {PathParamHttpContractDetails<SV, P, ResBodyMap, ReqQuery>} contractDetails - The contract details.
133
- * @param {...SchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>[]} handlers - The handler handlers.
134
- * @returns {ExpressRouter} - The Express router.
135
- */
136
- trace: LiveTypeRouteDefinition<SV, BasePath, 'trace'>;
137
- }
138
- //# sourceMappingURL=expressLikeRouter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"expressLikeRouter.d.ts","sourceRoot":"","sources":["../../../../src/http/router/expressLikeRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAmB,MAAM,uBAAuB,CAAC;AAW5E,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,gBAAgB,EAChB,4BAA4B,EAC7B,MAAM,2CAA2C,CAAC;AAMnD,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,IAAI,EAEJ,aAAa,EAEb,MAAM,EAEN,YAAY,EAEZ,WAAW,EAEX,eAAe,EAChB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,yCAAyC,EACzC,uBAAuB,EACvB,sCAAsC,EACtC,yBAAyB,EACzB,iCAAiC,EAClC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAE/B;;GAEG;AACH,qBAAa,2BAA2B,CACtC,EAAE,SAAS,kBAAkB,EAC7B,QAAQ,SAAS,IAAI,MAAM,EAAE,EAC7B,aAAa,EACb,QAAQ,SAAS,iBAAiB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAC3D,YAAW,2BAA2B,CAAC,EAAE,EAAE,aAAa,CAAC;;IASvD,QAAQ,CAAC,eAAe,EAAE,EAAE;IAC5B,QAAQ,CAAC,QAAQ,EAAE,QAAQ;IAR7B,cAAc,EAAG,aAAa,CAAC;IAC/B,OAAO,EAAE,gBAAgB,CAAC,EAAE,CAAC,EAAE,CAAM;IACrC,QAAQ,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