@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,76 +0,0 @@
1
- /**
2
- * Constructs an instance of a T.
3
- *
4
- * @template T - A type that extends BaseDtoMapper.
5
- * @template SV - A type that extends AnySchemaValidator.
6
- * @param {DtoMapperConstructor<T, SV>} self - The constructor of the T.
7
- * @param {SV} [schemaValidator] - The optional schema validator.
8
- * @returns {T} - An instance of the T.
9
- */
10
- export function construct(self, schemaValidator) {
11
- return new self(schemaValidator || {});
12
- }
13
- /**
14
- * Abstract class representing a base entity mapper.
15
- *
16
- * @template SV - A type that extends AnySchemaValidator.
17
- */
18
- export class BaseDtoMapper {
19
- /**
20
- * The schema validator exact type.
21
- * @type {SV}
22
- * @protected
23
- */
24
- _SV;
25
- /**
26
- * The schema validator as a general type.
27
- * @type {SchemaValidator}
28
- * @protected
29
- */
30
- schemaValidator;
31
- /**
32
- * The Data Transfer Object (DTO).
33
- * @type {Schema<this['schema'], SV>}
34
- */
35
- _dto = {};
36
- /**
37
- * Creates an instance of BaseDtoMapper.
38
- *
39
- * @param {SV} schemaValidator - The schema provider.
40
- */
41
- constructor(schemaValidator) {
42
- this.schemaValidator = schemaValidator;
43
- }
44
- /**
45
- * Validates and sets the Data Transfer Object (DTO).
46
- *
47
- * @param {this['_dto']} dto - The Data Transfer Object (DTO).
48
- * @throws {Error} - Throws an error if the DTO is invalid.
49
- */
50
- set dto(_dto) {
51
- const parsedSchema = this.schemaValidator.parse(this.schemaValidator.schemify(this.schema), _dto);
52
- if (!parsedSchema.ok) {
53
- throw new Error(`Invalid DTO: ${parsedSchema.error}`);
54
- }
55
- this._dto = _dto;
56
- }
57
- /**
58
- * Validates and gets the Data Transfer Object (DTO).
59
- *
60
- * @returns {this['_dto']} - The Data Transfer Object (DTO).
61
- */
62
- get dto() {
63
- return this._dto;
64
- }
65
- /**
66
- * Gets the schema of a T.
67
- *
68
- * @template T - A type that extends BaseDtoMapper.
69
- * @template SV - A type that extends AnySchemaValidator.
70
- * @param {DtoMapperConstructor<T, SV>} this - The constructor of the T.
71
- * @returns {T['schema']} - The schema of the T.
72
- */
73
- static schema() {
74
- return construct(this).schema;
75
- }
76
- }
@@ -1,68 +0,0 @@
1
- import { AnySchemaValidator } from '@forklaunch/validator';
2
- import { BaseEntity } from '../../database/mikro/models/entities/base.entity';
3
- import { DtoMapperConstructor } from '../interfaces/dtoMapper.interface';
4
- import { BaseDtoMapper } from './baseDtoMapper.model';
5
- /**
6
- * Abstract class representing a request entity mapper.
7
- *
8
- * @template Entity - A type that extends BaseEntity.
9
- * @template SV - A type that extends AnySchemaValidator.
10
- * @extends {BaseDtoMapper<SV>}
11
- */
12
- export declare abstract class RequestDtoMapper<Entity extends BaseEntity, SV extends AnySchemaValidator> extends BaseDtoMapper<SV> {
13
- /**
14
- * The entity type.
15
- * @type {Entity}
16
- * @protected
17
- */
18
- _Entity: Entity;
19
- /**
20
- * Converts the underlying DTO to an entity.
21
- *
22
- * @abstract
23
- * @param {...unknown[]} additionalArgs - Additional arguments.
24
- * @returns {Entity} - The entity.
25
- */
26
- abstract toEntity(...additionalArgs: unknown[]): Entity;
27
- /**
28
- * Populates the DTO with data from a JSON object.
29
- *
30
- * @param {this['_dto']} json - The JSON object.
31
- * @returns {this} - The instance of the RequestDtoMapper.
32
- */
33
- fromDto(json: this['_dto']): this;
34
- /**
35
- * Deserializes a JSON object to an entity.
36
- *
37
- * @param {this['_dto']} json - The JSON object.
38
- * @param {...unknown[]} additionalArgs - Additional arguments.
39
- * @returns {Entity} - The entity.
40
- */
41
- deserializeDtoToEntity(json: this['_dto'], ...additionalArgs: Parameters<this['toEntity']>): Entity;
42
- /**
43
- * Creates an instance of a RequestDtoMapper from a JSON object.
44
- *
45
- * @template T - A type that extends RequestDtoMapper.
46
- * @template SV - A type that extends AnySchemaValidator.
47
- * @template JsonType - The type of the JSON object.
48
- * @param {DtoMapperConstructor<T, SV>} this - The constructor of the T.
49
- * @param {SV} schemaValidator - The schema provider.
50
- * @param {JsonType} json - The JSON object.
51
- * @returns {T} - An instance of the T.
52
- */
53
- static fromDto<T extends RequestDtoMapper<BaseEntity, SV>, SV extends AnySchemaValidator, JsonType extends T['_dto']>(this: DtoMapperConstructor<T, SV>, schemaValidator: SV, json: JsonType): T;
54
- /**
55
- * Deserializes a JSON object to an entity.
56
- *
57
- * @template T - A type that extends RequestDtoMapper.
58
- * @template SV - A type that extends AnySchemaValidator.
59
- * @template JsonType - The type of the JSON object.
60
- * @param {DtoMapperConstructor<T, SV>} this - The constructor of the T.
61
- * @param {SV} schemaValidator - The schema provider.
62
- * @param {JsonType} json - The JSON object.
63
- * @param {...unknown[]} additionalArgs - Additional arguments.
64
- * @returns {T['_Entity']} - The entity.
65
- */
66
- static deserializeDtoToEntity<T extends RequestDtoMapper<BaseEntity, SV>, SV extends AnySchemaValidator, JsonType extends T['_dto']>(this: DtoMapperConstructor<T, SV>, schemaValidator: SV, json: JsonType, ...additionalArgs: Parameters<T['toEntity']>): T['_Entity'];
67
- }
68
- //# sourceMappingURL=requestDtoMapper.model.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"requestDtoMapper.model.d.ts","sourceRoot":"","sources":["../../../../src/dtoMapper/models/requestDtoMapper.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,kDAAkD,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAa,MAAM,uBAAuB,CAAC;AAEjE;;;;;;GAMG;AACH,8BAAsB,gBAAgB,CACpC,MAAM,SAAS,UAAU,EACzB,EAAE,SAAS,kBAAkB,CAC7B,SAAQ,aAAa,CAAC,EAAE,CAAC;IACzB;;;;OAIG;IACH,OAAO,EAAG,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,CAAC,GAAG,cAAc,EAAE,OAAO,EAAE,GAAG,MAAM;IAEvD;;;;;OAKG;IACH,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI;IAYjC;;;;;;OAMG;IACH,sBAAsB,CACpB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAClB,GAAG,cAAc,EAAE,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAC9C,MAAM;IAIT;;;;;;;;;;OAUG;IACH,MAAM,CAAC,OAAO,CACZ,CAAC,SAAS,gBAAgB,CAAC,UAAU,EAAE,EAAE,CAAC,EAC1C,EAAE,SAAS,kBAAkB,EAC7B,QAAQ,SAAS,CAAC,CAAC,MAAM,CAAC,EAC1B,IAAI,EAAE,oBAAoB,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,eAAe,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,GAAG,CAAC;IAI5E;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,sBAAsB,CAC3B,CAAC,SAAS,gBAAgB,CAAC,UAAU,EAAE,EAAE,CAAC,EAC1C,EAAE,SAAS,kBAAkB,EAC7B,QAAQ,SAAS,CAAC,CAAC,MAAM,CAAC,EAE1B,IAAI,EAAE,oBAAoB,CAAC,CAAC,EAAE,EAAE,CAAC,EACjC,eAAe,EAAE,EAAE,EACnB,IAAI,EAAE,QAAQ,EACd,GAAG,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,GAC3C,CAAC,CAAC,SAAS,CAAC;CAKhB"}
@@ -1,71 +0,0 @@
1
- import { BaseDtoMapper, construct } from './baseDtoMapper.model';
2
- /**
3
- * Abstract class representing a request entity mapper.
4
- *
5
- * @template Entity - A type that extends BaseEntity.
6
- * @template SV - A type that extends AnySchemaValidator.
7
- * @extends {BaseDtoMapper<SV>}
8
- */
9
- export class RequestDtoMapper extends BaseDtoMapper {
10
- /**
11
- * The entity type.
12
- * @type {Entity}
13
- * @protected
14
- */
15
- _Entity;
16
- /**
17
- * Populates the DTO with data from a JSON object.
18
- *
19
- * @param {this['_dto']} json - The JSON object.
20
- * @returns {this} - The instance of the RequestDtoMapper.
21
- */
22
- fromDto(json) {
23
- const parsedSchema = this.schemaValidator.parse(this.schemaValidator.schemify(this.schema), json);
24
- if (!parsedSchema.ok) {
25
- throw new Error(`Invalid DTO: ${parsedSchema.error}`);
26
- }
27
- this.dto = json;
28
- return this;
29
- }
30
- /**
31
- * Deserializes a JSON object to an entity.
32
- *
33
- * @param {this['_dto']} json - The JSON object.
34
- * @param {...unknown[]} additionalArgs - Additional arguments.
35
- * @returns {Entity} - The entity.
36
- */
37
- deserializeDtoToEntity(json, ...additionalArgs) {
38
- return this.fromDto(json).toEntity(...additionalArgs);
39
- }
40
- /**
41
- * Creates an instance of a RequestDtoMapper from a JSON object.
42
- *
43
- * @template T - A type that extends RequestDtoMapper.
44
- * @template SV - A type that extends AnySchemaValidator.
45
- * @template JsonType - The type of the JSON object.
46
- * @param {DtoMapperConstructor<T, SV>} this - The constructor of the T.
47
- * @param {SV} schemaValidator - The schema provider.
48
- * @param {JsonType} json - The JSON object.
49
- * @returns {T} - An instance of the T.
50
- */
51
- static fromDto(schemaValidator, json) {
52
- return construct(this, schemaValidator).fromDto(json);
53
- }
54
- /**
55
- * Deserializes a JSON object to an entity.
56
- *
57
- * @template T - A type that extends RequestDtoMapper.
58
- * @template SV - A type that extends AnySchemaValidator.
59
- * @template JsonType - The type of the JSON object.
60
- * @param {DtoMapperConstructor<T, SV>} this - The constructor of the T.
61
- * @param {SV} schemaValidator - The schema provider.
62
- * @param {JsonType} json - The JSON object.
63
- * @param {...unknown[]} additionalArgs - Additional arguments.
64
- * @returns {T['_Entity']} - The entity.
65
- */
66
- static deserializeDtoToEntity(schemaValidator, json, ...additionalArgs) {
67
- return construct(this, schemaValidator)
68
- .fromDto(json)
69
- .toEntity(...additionalArgs);
70
- }
71
- }
@@ -1,67 +0,0 @@
1
- import { AnySchemaValidator } from '@forklaunch/validator';
2
- import { BaseEntity } from '../../database/mikro/models/entities/base.entity';
3
- import { DtoMapperConstructor } from '../interfaces/dtoMapper.interface';
4
- import { BaseDtoMapper } from './baseDtoMapper.model';
5
- /**
6
- * Abstract class representing a response entity mapper.
7
- *
8
- * @template Entity - A type that extends BaseEntity.
9
- * @template SV - A type that extends AnySchemaValidator.
10
- * @extends {BaseDtoMapper<SV>}
11
- */
12
- export declare abstract class ResponseDtoMapper<Entity extends BaseEntity, SV extends AnySchemaValidator> extends BaseDtoMapper<SV> {
13
- /**
14
- * The entity type.
15
- * @type {Entity}
16
- * @protected
17
- */
18
- _Entity: Entity;
19
- /**
20
- * Populates entity mapper with DTO from an entity.
21
- *
22
- * @abstract
23
- * @param {Entity} entity - The entity to convert.
24
- * @param {...unknown[]} additionalArgs - Additional arguments.
25
- * @returns {this} - The instance of the ResponseDtoMapper.
26
- */
27
- abstract fromEntity(entity: Entity, ...additionalArgs: unknown[]): this;
28
- /**
29
- * Converts the underlying DTO to a JSON object.
30
- *
31
- * @returns {this['_dto']} - The JSON object.
32
- * @throws {Error} - Throws an error if the DTO is invalid.
33
- */
34
- toDto(): this['_dto'];
35
- /**
36
- * Serializes an entity to a JSON object.
37
- *
38
- * @param {Entity} entity - The entity to serialize.
39
- * @returns {this['_dto']} - The JSON object.
40
- * @throws {Error} - Throws an error if the DTO is invalid.
41
- */
42
- serializeEntityToDto(...[entity, ...additionalArgs]: Parameters<this['fromEntity']>): this['_dto'];
43
- /**
44
- * Populates entity mapper with DTO from an entity.
45
- *
46
- * @template T - A type that extends ResponseDtoMapper.
47
- * @template SV - A type that extends AnySchemaValidator.
48
- * @param {DtoMapperConstructor<T, SV>} this - The constructor of the T.
49
- * @param {SV} schemaValidator - The schema provider.
50
- * @param {T['_Entity']} entity - The entity to convert.
51
- * @returns {T} - An instance of the T.
52
- */
53
- static fromEntity<T extends ResponseDtoMapper<BaseEntity, SV>, SV extends AnySchemaValidator>(this: DtoMapperConstructor<T, SV>, schemaValidator: SV, ...[entity, ...additionalArgs]: Parameters<T['fromEntity']>): T;
54
- /**
55
- * Serializes an entity to a JSON object.
56
- *
57
- * @template T - A type that extends ResponseDtoMapper.
58
- * @template SV - A type that extends AnySchemaValidator.
59
- * @param {DtoMapperConstructor<T, SV>} this - The constructor of the T.
60
- * @param {SV} schemaValidator - The schema provider.
61
- * @param {T['_Entity']} entity - The entity to serialize.
62
- * @returns {T['_dto']} - The JSON object.
63
- * @throws {Error} - Throws an error if the DTO is invalid.
64
- */
65
- static serializeEntityToDto<T extends ResponseDtoMapper<BaseEntity, SV>, SV extends AnySchemaValidator, DtoType extends T['_dto']>(this: DtoMapperConstructor<T, SV>, schemaValidator: SV, ...[entity, ...additionalArgs]: Parameters<T['fromEntity']>): DtoType;
66
- }
67
- //# sourceMappingURL=responseDtoMapper.model.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"responseDtoMapper.model.d.ts","sourceRoot":"","sources":["../../../../src/dtoMapper/models/responseDtoMapper.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,kDAAkD,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAa,MAAM,uBAAuB,CAAC;AAEjE;;;;;;GAMG;AACH,8BAAsB,iBAAiB,CACrC,MAAM,SAAS,UAAU,EACzB,EAAE,SAAS,kBAAkB,CAC7B,SAAQ,aAAa,CAAC,EAAE,CAAC;IACzB;;;;OAIG;IACH,OAAO,EAAG,MAAM,CAAC;IAEjB;;;;;;;OAOG;IACH,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,OAAO,EAAE,GAAG,IAAI;IAEvE;;;;;OAKG;IACH,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC;IAWrB;;;;;;OAMG;IACH,oBAAoB,CAClB,GAAG,CAAC,MAAM,EAAE,GAAG,cAAc,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAC7D,IAAI,CAAC,MAAM,CAAC;IAIf;;;;;;;;;OASG;IACH,MAAM,CAAC,UAAU,CACf,CAAC,SAAS,iBAAiB,CAAC,UAAU,EAAE,EAAE,CAAC,EAC3C,EAAE,SAAS,kBAAkB,EAE7B,IAAI,EAAE,oBAAoB,CAAC,CAAC,EAAE,EAAE,CAAC,EACjC,eAAe,EAAE,EAAE,EACnB,GAAG,CAAC,MAAM,EAAE,GAAG,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,GAC1D,CAAC;IAOJ;;;;;;;;;;OAUG;IACH,MAAM,CAAC,oBAAoB,CACzB,CAAC,SAAS,iBAAiB,CAAC,UAAU,EAAE,EAAE,CAAC,EAC3C,EAAE,SAAS,kBAAkB,EAC7B,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,EAEzB,IAAI,EAAE,oBAAoB,CAAC,CAAC,EAAE,EAAE,CAAC,EACjC,eAAe,EAAE,EAAE,EACnB,GAAG,CAAC,MAAM,EAAE,GAAG,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,GAC1D,OAAO;CAKX"}
@@ -1,68 +0,0 @@
1
- import { BaseDtoMapper, construct } from './baseDtoMapper.model';
2
- /**
3
- * Abstract class representing a response entity mapper.
4
- *
5
- * @template Entity - A type that extends BaseEntity.
6
- * @template SV - A type that extends AnySchemaValidator.
7
- * @extends {BaseDtoMapper<SV>}
8
- */
9
- export class ResponseDtoMapper extends BaseDtoMapper {
10
- /**
11
- * The entity type.
12
- * @type {Entity}
13
- * @protected
14
- */
15
- _Entity;
16
- /**
17
- * Converts the underlying DTO to a JSON object.
18
- *
19
- * @returns {this['_dto']} - The JSON object.
20
- * @throws {Error} - Throws an error if the DTO is invalid.
21
- */
22
- toDto() {
23
- const parsedSchema = this.schemaValidator.parse(this.schemaValidator.schemify(this.schema), this.dto);
24
- if (!parsedSchema.ok) {
25
- throw new Error(`Invalid DTO: ${parsedSchema.error}`);
26
- }
27
- return this.dto;
28
- }
29
- /**
30
- * Serializes an entity to a JSON object.
31
- *
32
- * @param {Entity} entity - The entity to serialize.
33
- * @returns {this['_dto']} - The JSON object.
34
- * @throws {Error} - Throws an error if the DTO is invalid.
35
- */
36
- serializeEntityToDto(...[entity, ...additionalArgs]) {
37
- return this.fromEntity(entity, ...additionalArgs).toDto();
38
- }
39
- /**
40
- * Populates entity mapper with DTO from an entity.
41
- *
42
- * @template T - A type that extends ResponseDtoMapper.
43
- * @template SV - A type that extends AnySchemaValidator.
44
- * @param {DtoMapperConstructor<T, SV>} this - The constructor of the T.
45
- * @param {SV} schemaValidator - The schema provider.
46
- * @param {T['_Entity']} entity - The entity to convert.
47
- * @returns {T} - An instance of the T.
48
- */
49
- static fromEntity(schemaValidator, ...[entity, ...additionalArgs]) {
50
- return construct(this, schemaValidator).fromEntity(entity, ...additionalArgs);
51
- }
52
- /**
53
- * Serializes an entity to a JSON object.
54
- *
55
- * @template T - A type that extends ResponseDtoMapper.
56
- * @template SV - A type that extends AnySchemaValidator.
57
- * @param {DtoMapperConstructor<T, SV>} this - The constructor of the T.
58
- * @param {SV} schemaValidator - The schema provider.
59
- * @param {T['_Entity']} entity - The entity to serialize.
60
- * @returns {T['_dto']} - The JSON object.
61
- * @throws {Error} - Throws an error if the DTO is invalid.
62
- */
63
- static serializeEntityToDto(schemaValidator, ...[entity, ...additionalArgs]) {
64
- return construct(this, schemaValidator)
65
- .fromEntity(entity, ...additionalArgs)
66
- .toDto();
67
- }
68
- }
@@ -1,9 +0,0 @@
1
- import { AnySchemaValidator, UnboxedObjectSchema } from '@forklaunch/validator';
2
- /**
3
- * Type representing a schema validator object for an entity mapper.
4
- *
5
- * @template SV - A type that extends AnySchemaValidator.
6
- * @typedef {SV['_ValidSchemaObject'] | UnboxedObjectSchema<SV>} DtoMapperSchemaValidatorObject
7
- */
8
- export type DtoMapperSchemaValidatorObject<SV extends AnySchemaValidator> = SV['_ValidSchemaObject'] | UnboxedObjectSchema<SV>;
9
- //# sourceMappingURL=dtoMapper.types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dtoMapper.types.d.ts","sourceRoot":"","sources":["../../../../src/dtoMapper/types/dtoMapper.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEhF;;;;;GAKG;AACH,MAAM,MAAM,8BAA8B,CAAC,EAAE,SAAS,kBAAkB,IACpE,EAAE,CAAC,oBAAoB,CAAC,GACxB,mBAAmB,CAAC,EAAE,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,21 +0,0 @@
1
- import { AnySchemaValidator } from '@forklaunch/validator';
2
- import { ExpressLikeRouter } from '../interfaces/expressLikeRouter.interface';
3
- import { ForklaunchExpressLikeRouter } from '../router/expressLikeRouter';
4
- /**
5
- * ForklaunchExpressLikeApplication class that sets up routes and middleware for an Express-like application, for use with controller/routes pattern.
6
- *
7
- * @template SV - A type that extends AnySchemaValidator.
8
- * @template Server - The server type.
9
- */
10
- export declare abstract class ForklaunchExpressLikeApplication<SV extends AnySchemaValidator, Server extends ExpressLikeRouter<RouterHandler, Server>, RouterHandler> extends ForklaunchExpressLikeRouter<SV, '/', RouterHandler, Server> {
11
- readonly schemaValidator: SV;
12
- readonly internal: Server;
13
- /**
14
- * Creates an instance of the Application class.
15
- *
16
- * @param {SV} schemaValidator - The schema validator.
17
- */
18
- constructor(schemaValidator: SV, internal: Server);
19
- abstract listen(...args: unknown[]): void;
20
- }
21
- //# sourceMappingURL=expressLikeApplication.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"expressLikeApplication.d.ts","sourceRoot":"","sources":["../../../../src/http/application/expressLikeApplication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAE1E;;;;;GAKG;AACH,8BAAsB,gCAAgC,CACpD,EAAE,SAAS,kBAAkB,EAC7B,MAAM,SAAS,iBAAiB,CAAC,aAAa,EAAE,MAAM,CAAC,EACvD,aAAa,CACb,SAAQ,2BAA2B,CAAC,EAAE,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,CAAC;IAOjE,QAAQ,CAAC,eAAe,EAAE,EAAE;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM;IAP3B;;;;OAIG;gBAEQ,eAAe,EAAE,EAAE,EACnB,QAAQ,EAAE,MAAM;IAK3B,QAAQ,CAAC,MAAM,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;CAC1C"}
@@ -1,21 +0,0 @@
1
- import { ForklaunchExpressLikeRouter } from '../router/expressLikeRouter';
2
- /**
3
- * ForklaunchExpressLikeApplication class that sets up routes and middleware for an Express-like application, for use with controller/routes pattern.
4
- *
5
- * @template SV - A type that extends AnySchemaValidator.
6
- * @template Server - The server type.
7
- */
8
- export class ForklaunchExpressLikeApplication extends ForklaunchExpressLikeRouter {
9
- schemaValidator;
10
- internal;
11
- /**
12
- * Creates an instance of the Application class.
13
- *
14
- * @param {SV} schemaValidator - The schema validator.
15
- */
16
- constructor(schemaValidator, internal) {
17
- super('/', schemaValidator, internal);
18
- this.schemaValidator = schemaValidator;
19
- this.internal = internal;
20
- }
21
- }
@@ -1,4 +0,0 @@
1
- import { AnySchemaValidator } from '@forklaunch/validator';
2
- import { ConstrainedForklaunchRouter } from '../types/router.types';
3
- export declare function isConstrainedForklaunchRouter<SV extends AnySchemaValidator, RouterHandler>(maybeForklaunchExpressLikeRouter: unknown): maybeForklaunchExpressLikeRouter is ConstrainedForklaunchRouter<SV, RouterHandler>;
4
- //# sourceMappingURL=isConstrainedForklaunchRouter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isConstrainedForklaunchRouter.d.ts","sourceRoot":"","sources":["../../../../src/http/guards/isConstrainedForklaunchRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAGpE,wBAAgB,6BAA6B,CAC3C,EAAE,SAAS,kBAAkB,EAC7B,aAAa,EAEb,gCAAgC,EAAE,OAAO,GACxC,gCAAgC,IAAI,2BAA2B,CAChE,EAAE,EACF,aAAa,CACd,CAKA"}
@@ -1,5 +0,0 @@
1
- import { isForklaunchRouter } from './isForklaunchRouter';
2
- export function isConstrainedForklaunchRouter(maybeForklaunchExpressLikeRouter) {
3
- return (isForklaunchRouter(maybeForklaunchExpressLikeRouter) &&
4
- 'requestHandler' in maybeForklaunchExpressLikeRouter);
5
- }
@@ -1,5 +0,0 @@
1
- import { AnySchemaValidator } from '@forklaunch/validator';
2
- import { ExpressLikeSchemaHandler } from '../types/apiDefinition.types';
3
- import { Body, HeadersObject, ParamsObject, QueryObject, ResponsesObject } from '../types/contractDetails.types';
4
- export declare function isExpressLikeSchemaHandler<SV extends AnySchemaValidator, 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>>(middleware: unknown): middleware is ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj>;
5
- //# sourceMappingURL=isExpressLikeSchemaHandler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isExpressLikeSchemaHandler.d.ts","sourceRoot":"","sources":["../../../../src/http/guards/isExpressLikeSchemaHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EACL,IAAI,EACJ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,eAAe,EAChB,MAAM,gCAAgC,CAAC;AAExC,wBAAgB,0BAA0B,CACxC,EAAE,SAAS,kBAAkB,EAC7B,CAAC,SAAS,YAAY,CAAC,EAAE,CAAC,EAC1B,UAAU,SAAS,eAAe,CAAC,EAAE,CAAC,EACtC,OAAO,SAAS,IAAI,CAAC,EAAE,CAAC,EACxB,QAAQ,SAAS,WAAW,CAAC,EAAE,CAAC,EAChC,UAAU,SAAS,aAAa,CAAC,EAAE,CAAC,EACpC,UAAU,SAAS,aAAa,CAAC,EAAE,CAAC,EACpC,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAEzC,UAAU,EAAE,OAAO,GAClB,UAAU,IAAI,wBAAwB,CACvC,EAAE,EACF,CAAC,EACD,UAAU,EACV,OAAO,EACP,QAAQ,EACR,UAAU,EACV,UAAU,EACV,SAAS,CACV,CASA"}
@@ -1,6 +0,0 @@
1
- import { extractArgumentNames } from '@forklaunch/common';
2
- export function isExpressLikeSchemaHandler(middleware) {
3
- const extractedArgumentNames = typeof middleware === 'function' &&
4
- new Set(extractArgumentNames(middleware).map((argumentName) => argumentName.toLowerCase()));
5
- return extractedArgumentNames && extractedArgumentNames.size <= 3;
6
- }
@@ -1,5 +0,0 @@
1
- import { AnySchemaValidator } from '@forklaunch/validator';
2
- import { ExpressLikeRouter } from '../interfaces/expressLikeRouter.interface';
3
- import { ForklaunchExpressLikeRouter } from '../router/expressLikeRouter';
4
- export declare function isForklaunchExpressLikeRouter<SV extends AnySchemaValidator, Path extends `/${string}`, RouterHandler, Internal extends ExpressLikeRouter<RouterHandler, Internal>>(maybeForklaunchExpressLikeRouter: unknown): maybeForklaunchExpressLikeRouter is ForklaunchExpressLikeRouter<SV, Path, RouterHandler, Internal>;
5
- //# sourceMappingURL=isForklaunchExpressLikeRouter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isForklaunchExpressLikeRouter.d.ts","sourceRoot":"","sources":["../../../../src/http/guards/isForklaunchExpressLikeRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAG1E,wBAAgB,6BAA6B,CAC3C,EAAE,SAAS,kBAAkB,EAC7B,IAAI,SAAS,IAAI,MAAM,EAAE,EACzB,aAAa,EACb,QAAQ,SAAS,iBAAiB,CAAC,aAAa,EAAE,QAAQ,CAAC,EAE3D,gCAAgC,EAAE,OAAO,GACxC,gCAAgC,IAAI,2BAA2B,CAChE,EAAE,EACF,IAAI,EACJ,aAAa,EACb,QAAQ,CACT,CAQA"}
@@ -1,6 +0,0 @@
1
- import { isConstrainedForklaunchRouter } from './isConstrainedForklaunchRouter';
2
- export function isForklaunchExpressLikeRouter(maybeForklaunchExpressLikeRouter) {
3
- return (isConstrainedForklaunchRouter(maybeForklaunchExpressLikeRouter) &&
4
- 'basePath' in maybeForklaunchExpressLikeRouter &&
5
- 'internal' in maybeForklaunchExpressLikeRouter);
6
- }
@@ -1,4 +0,0 @@
1
- import { AnySchemaValidator } from '@forklaunch/validator';
2
- import { ForklaunchRouter } from '../types/router.types';
3
- export declare function isForklaunchRouter<SV extends AnySchemaValidator>(maybeForklaunchRouter: unknown): maybeForklaunchRouter is ForklaunchRouter<SV>;
4
- //# sourceMappingURL=isForklaunchRouter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isForklaunchRouter.d.ts","sourceRoot":"","sources":["../../../../src/http/guards/isForklaunchRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,wBAAgB,kBAAkB,CAAC,EAAE,SAAS,kBAAkB,EAC9D,qBAAqB,EAAE,OAAO,GAC7B,qBAAqB,IAAI,gBAAgB,CAAC,EAAE,CAAC,CAQ/C"}
@@ -1,7 +0,0 @@
1
- export function isForklaunchRouter(maybeForklaunchRouter) {
2
- return (maybeForklaunchRouter != null &&
3
- typeof maybeForklaunchRouter === 'object' &&
4
- 'basePath' in maybeForklaunchRouter &&
5
- 'routes' in maybeForklaunchRouter &&
6
- Array.isArray(maybeForklaunchRouter.routes));
7
- }
@@ -1,7 +0,0 @@
1
- import { AnySchemaValidator } from '@forklaunch/validator';
2
- import { Body, ExtractedParamsObject, HeadersObject, HttpContractDetails, ParamsObject, QueryObject, ResponsesObject } from '../types/contractDetails.types';
3
- /**
4
- * Type guard for HttpContractDetails
5
- */
6
- export declare function isHttpContractDetails<SV extends AnySchemaValidator, Path extends `/${string}`, ParamsSchema extends ExtractedParamsObject<Path> & ParamsObject<SV>, ResponseSchemas extends ResponsesObject<SV>, BodySchema extends Body<SV>, QuerySchema extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>>(maybeContractDetails: unknown): maybeContractDetails is HttpContractDetails<SV, Path, ParamsSchema, ResponseSchemas, BodySchema, QuerySchema, ReqHeaders, ResHeaders>;
7
- //# sourceMappingURL=isHttpContractDetails.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isHttpContractDetails.d.ts","sourceRoot":"","sources":["../../../../src/http/guards/isHttpContractDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,IAAI,EACJ,qBAAqB,EACrB,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,eAAe,EAChB,MAAM,gCAAgC,CAAC;AAGxC;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,SAAS,kBAAkB,EAC7B,IAAI,SAAS,IAAI,MAAM,EAAE,EACzB,YAAY,SAAS,qBAAqB,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,EAAE,CAAC,EACnE,eAAe,SAAS,eAAe,CAAC,EAAE,CAAC,EAC3C,UAAU,SAAS,IAAI,CAAC,EAAE,CAAC,EAC3B,WAAW,SAAS,WAAW,CAAC,EAAE,CAAC,EACnC,UAAU,SAAS,aAAa,CAAC,EAAE,CAAC,EACpC,UAAU,SAAS,aAAa,CAAC,EAAE,CAAC,EAEpC,oBAAoB,EAAE,OAAO,GAC5B,oBAAoB,IAAI,mBAAmB,CAC5C,EAAE,EACF,IAAI,EACJ,YAAY,EACZ,eAAe,EACf,UAAU,EACV,WAAW,EACX,UAAU,EACV,UAAU,CACX,CAMA"}
@@ -1,9 +0,0 @@
1
- import { isPathParamHttpContractDetails } from './isPathParamContractDetails';
2
- /**
3
- * Type guard for HttpContractDetails
4
- */
5
- export function isHttpContractDetails(maybeContractDetails) {
6
- return (isPathParamHttpContractDetails(maybeContractDetails) &&
7
- 'body' in maybeContractDetails &&
8
- maybeContractDetails.body != null);
9
- }
@@ -1,4 +0,0 @@
1
- import { AnySchemaValidator } from '@forklaunch/validator';
2
- import { ExtractedParamsObject, HeadersObject, ParamsObject, PathParamHttpContractDetails, QueryObject, ResponsesObject } from '../types/contractDetails.types';
3
- export declare function isPathParamHttpContractDetails<SV extends AnySchemaValidator, Path extends `/${string}`, ParamsSchema extends ExtractedParamsObject<Path> & ParamsObject<SV>, ResponseSchemas extends ResponsesObject<SV>, QuerySchema extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>>(maybePathParamHttpContractDetails: unknown): maybePathParamHttpContractDetails is PathParamHttpContractDetails<SV, Path, ParamsSchema, ResponseSchemas, QuerySchema, ReqHeaders, ResHeaders>;
4
- //# sourceMappingURL=isPathParamContractDetails.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isPathParamContractDetails.d.ts","sourceRoot":"","sources":["../../../../src/http/guards/isPathParamContractDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,4BAA4B,EAC5B,WAAW,EACX,eAAe,EAChB,MAAM,gCAAgC,CAAC;AAExC,wBAAgB,8BAA8B,CAC5C,EAAE,SAAS,kBAAkB,EAC7B,IAAI,SAAS,IAAI,MAAM,EAAE,EACzB,YAAY,SAAS,qBAAqB,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,EAAE,CAAC,EACnE,eAAe,SAAS,eAAe,CAAC,EAAE,CAAC,EAC3C,WAAW,SAAS,WAAW,CAAC,EAAE,CAAC,EACnC,UAAU,SAAS,aAAa,CAAC,EAAE,CAAC,EACpC,UAAU,SAAS,aAAa,CAAC,EAAE,CAAC,EAEpC,iCAAiC,EAAE,OAAO,GACzC,iCAAiC,IAAI,4BAA4B,CAClE,EAAE,EACF,IAAI,EACJ,YAAY,EACZ,eAAe,EACf,WAAW,EACX,UAAU,EACV,UAAU,CACX,CAWA"}
@@ -1,10 +0,0 @@
1
- export function isPathParamHttpContractDetails(maybePathParamHttpContractDetails) {
2
- return (maybePathParamHttpContractDetails != null &&
3
- typeof maybePathParamHttpContractDetails === 'object' &&
4
- 'name' in maybePathParamHttpContractDetails &&
5
- 'summary' in maybePathParamHttpContractDetails &&
6
- 'responses' in maybePathParamHttpContractDetails &&
7
- maybePathParamHttpContractDetails.name != null &&
8
- maybePathParamHttpContractDetails.summary != null &&
9
- maybePathParamHttpContractDetails.responses != null);
10
- }
@@ -1,3 +0,0 @@
1
- import { ResponseShape } from '../types/apiDefinition.types';
2
- export declare function isResponseShape<Params, Headers, Query, Body>(maybeResponseShape: object | undefined): maybeResponseShape is ResponseShape<Params, Headers, Query, Body>;
3
- //# sourceMappingURL=isResponseShape.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isResponseShape.d.ts","sourceRoot":"","sources":["../../../../src/http/guards/isResponseShape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAC1D,kBAAkB,EAAE,MAAM,GAAG,SAAS,GACrC,kBAAkB,IAAI,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAQnE"}
@@ -1,7 +0,0 @@
1
- export function isResponseShape(maybeResponseShape) {
2
- return (maybeResponseShape != null &&
3
- 'body' in maybeResponseShape &&
4
- 'query' in maybeResponseShape &&
5
- 'params' in maybeResponseShape &&
6
- 'headers' in maybeResponseShape);
7
- }
@@ -1,5 +0,0 @@
1
- import { AnySchemaValidator } from '@forklaunch/validator';
2
- import { Body, HeadersObject, Method, ParamsObject, QueryObject, ResponsesObject } from '../types/contractDetails.types';
3
- import { TypedHandler } from '../types/typedHandler.types';
4
- export declare function isTypedHandler<SV extends AnySchemaValidator, 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>>(maybeTypedHandler: unknown): maybeTypedHandler is TypedHandler<SV, ContractMethod, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj>;
5
- //# sourceMappingURL=isTypedHandler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isTypedHandler.d.ts","sourceRoot":"","sources":["../../../../src/http/guards/isTypedHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EACL,IAAI,EACJ,aAAa,EACb,MAAM,EACN,YAAY,EACZ,WAAW,EACX,eAAe,EAChB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,wBAAgB,cAAc,CAC5B,EAAE,SAAS,kBAAkB,EAC7B,cAAc,SAAS,MAAM,EAC7B,IAAI,SAAS,IAAI,MAAM,EAAE,EACzB,CAAC,SAAS,YAAY,CAAC,EAAE,CAAC,EAC1B,UAAU,SAAS,eAAe,CAAC,EAAE,CAAC,EACtC,OAAO,SAAS,IAAI,CAAC,EAAE,CAAC,EACxB,QAAQ,SAAS,WAAW,CAAC,EAAE,CAAC,EAChC,UAAU,SAAS,aAAa,CAAC,EAAE,CAAC,EACpC,UAAU,SAAS,aAAa,CAAC,EAAE,CAAC,EACpC,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAEzC,iBAAiB,EAAE,OAAO,GACzB,iBAAiB,IAAI,YAAY,CAClC,EAAE,EACF,cAAc,EACd,IAAI,EACJ,CAAC,EACD,UAAU,EACV,OAAO,EACP,QAAQ,EACR,UAAU,EACV,UAAU,EACV,SAAS,CACV,CAOA"}
@@ -1,6 +0,0 @@
1
- export function isTypedHandler(maybeTypedHandler) {
2
- return (maybeTypedHandler != null &&
3
- typeof maybeTypedHandler === 'object' &&
4
- '_typedHandler' in maybeTypedHandler &&
5
- maybeTypedHandler._typedHandler === true);
6
- }
@@ -1,9 +0,0 @@
1
- import { AnySchemaValidator } from '@forklaunch/validator';
2
- import { ExpressLikeSchemaHandler } from '../types/apiDefinition.types';
3
- import { Body, HeadersObject, ParamsObject, PathParamHttpContractDetails, QueryObject, ResponsesObject } from '../types/contractDetails.types';
4
- export declare const delete_: <SV extends AnySchemaValidator, 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>>(_schemaValidator: SV, path: Path, contractDetails: PathParamHttpContractDetails<SV, Path, P, ResBodyMap, ReqQuery, ReqHeaders, ResHeaders>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj>[]) => {
5
- _typedHandler: true;
6
- contractDetails: PathParamHttpContractDetails<SV, Path, P, ResBodyMap, ReqQuery, ReqHeaders, ResHeaders>;
7
- handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj>[];
8
- };
9
- //# sourceMappingURL=delete.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EACL,IAAI,EACJ,aAAa,EACb,YAAY,EACZ,4BAA4B,EAC5B,WAAW,EACX,eAAe,EAChB,MAAM,gCAAgC,CAAC;AAGxC,eAAO,MAAM,OAAO,GAClB,EAAE,SAAS,kBAAkB,EAC7B,IAAI,SAAS,IAAI,MAAM,EAAE,EACzB,CAAC,SAAS,YAAY,CAAC,EAAE,CAAC,EAC1B,UAAU,SAAS,eAAe,CAAC,EAAE,CAAC,EACtC,OAAO,SAAS,IAAI,CAAC,EAAE,CAAC,EACxB,QAAQ,SAAS,WAAW,CAAC,EAAE,CAAC,EAChC,UAAU,SAAS,aAAa,CAAC,EAAE,CAAC,EACpC,UAAU,SAAS,aAAa,CAAC,EAAE,CAAC,EACpC,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,oBAEvB,EAAE,QACd,IAAI,mBACO,4BAA4B,CAC3C,EAAE,EACF,IAAI,EACJ,CAAC,EACD,UAAU,EACV,QAAQ,EACR,UAAU,EACV,UAAU,CACX,eACY,wBAAwB,CACnC,EAAE,EACF,CAAC,EACD,UAAU,EACV,OAAO,EACP,QAAQ,EACR,UAAU,EACV,UAAU,EACV,SAAS,CACV,EAAE;;;;CAcJ,CAAC"}
@@ -1,4 +0,0 @@
1
- import { typedHandler } from './typedHandler';
2
- export const delete_ = (_schemaValidator, path, contractDetails, ...handlers) => {
3
- return typedHandler(_schemaValidator, path, 'delete', contractDetails, ...handlers);
4
- };
@@ -1,9 +0,0 @@
1
- import { AnySchemaValidator } from '@forklaunch/validator';
2
- import { ExpressLikeSchemaHandler } from '../types/apiDefinition.types';
3
- import { Body, HeadersObject, ParamsObject, PathParamHttpContractDetails, QueryObject, ResponsesObject } from '../types/contractDetails.types';
4
- export declare const get: <SV extends AnySchemaValidator, 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>>(_schemaValidator: SV, path: Path, contractDetails: PathParamHttpContractDetails<SV, Path, P, ResBodyMap, ReqQuery, ReqHeaders, ResHeaders>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj>[]) => {
5
- _typedHandler: true;
6
- contractDetails: PathParamHttpContractDetails<SV, Path, P, ResBodyMap, ReqQuery, ReqHeaders, ResHeaders>;
7
- handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj>[];
8
- };
9
- //# sourceMappingURL=get.d.ts.map