@forklaunch/core 0.1.9 → 0.1.11
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.
- package/dist/cache/index.d.ts +1 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +3 -20
- package/dist/cache/interfaces/ttlCache.interface.d.ts +1 -0
- package/dist/cache/interfaces/ttlCache.interface.d.ts.map +1 -0
- package/dist/cache/interfaces/ttlCache.interface.js +1 -3
- package/dist/cache/redisTtlCache.d.ts +1 -0
- package/dist/cache/redisTtlCache.d.ts.map +1 -0
- package/dist/cache/redisTtlCache.js +3 -8
- package/dist/cache/types/ttlCacheRecord.types.d.ts +1 -0
- package/dist/cache/types/ttlCacheRecord.types.d.ts.map +1 -0
- package/dist/cache/types/ttlCacheRecord.types.js +1 -3
- package/dist/controllers/index.d.ts +1 -0
- package/dist/controllers/index.d.ts.map +1 -0
- package/dist/controllers/index.js +1 -18
- package/dist/controllers/interfaces/controller.interface.d.ts +1 -0
- package/dist/controllers/interfaces/controller.interface.d.ts.map +1 -0
- package/dist/controllers/interfaces/controller.interface.js +1 -3
- package/dist/database/index.d.ts +1 -0
- package/dist/database/index.d.ts.map +1 -0
- package/dist/database/index.js +1 -18
- package/dist/database/mikro/models/entities/base.entity.d.ts +1 -0
- package/dist/database/mikro/models/entities/base.entity.d.ts.map +1 -0
- package/dist/database/mikro/models/entities/base.entity.js +7 -18
- package/dist/entityMapper/index.d.ts +1 -0
- package/dist/entityMapper/index.d.ts.map +1 -0
- package/dist/entityMapper/index.js +2 -19
- package/dist/entityMapper/interfaces/entityMapper.interface.d.ts +1 -0
- package/dist/entityMapper/interfaces/entityMapper.interface.d.ts.map +1 -0
- package/dist/entityMapper/interfaces/entityMapper.interface.js +1 -3
- package/dist/entityMapper/models/baseEntityMapper.model.d.ts +1 -0
- package/dist/entityMapper/models/baseEntityMapper.model.d.ts.map +1 -0
- package/dist/entityMapper/models/baseEntityMapper.model.js +2 -8
- package/dist/entityMapper/models/requestEntityMapper.model.d.ts +1 -0
- package/dist/entityMapper/models/requestEntityMapper.model.d.ts.map +1 -0
- package/dist/entityMapper/models/requestEntityMapper.model.js +4 -9
- package/dist/entityMapper/models/responseEntityMapper.model.d.ts +1 -0
- package/dist/entityMapper/models/responseEntityMapper.model.d.ts.map +1 -0
- package/dist/entityMapper/models/responseEntityMapper.model.js +4 -9
- package/dist/entityMapper/types/entityMapper.types.d.ts +1 -0
- package/dist/entityMapper/types/entityMapper.types.d.ts.map +1 -0
- package/dist/entityMapper/types/entityMapper.types.js +1 -3
- package/dist/eslint.config.d.mts +3 -0
- package/dist/eslint.config.d.mts.map +1 -0
- package/dist/eslint.config.mjs +10 -0
- package/dist/http/httpStatusCodes.d.ts +1 -0
- package/dist/http/httpStatusCodes.d.ts.map +1 -0
- package/dist/http/httpStatusCodes.js +10 -21
- package/dist/http/index.d.ts +2 -0
- package/dist/http/index.d.ts.map +1 -0
- package/dist/http/index.js +6 -22
- package/dist/http/interfaces/forklaunchExpress.abstractClass.d.ts +157 -0
- package/dist/http/interfaces/forklaunchExpress.abstractClass.d.ts.map +1 -0
- package/dist/http/interfaces/forklaunchExpress.abstractClass.js +330 -0
- package/dist/http/interfaces/index.d.ts +2 -0
- package/dist/http/interfaces/index.d.ts.map +1 -0
- package/dist/http/interfaces/index.js +1 -0
- package/dist/http/middleware/index.d.ts +1 -0
- package/dist/http/middleware/index.d.ts.map +1 -0
- package/dist/http/middleware/index.js +2 -19
- package/dist/http/middleware/request.middleware.d.ts +11 -9
- package/dist/http/middleware/request.middleware.d.ts.map +1 -0
- package/dist/http/middleware/request.middleware.js +11 -45
- package/dist/http/middleware/response.middleware.d.ts +5 -2
- package/dist/http/middleware/response.middleware.d.ts.map +1 -0
- package/dist/http/middleware/response.middleware.js +1 -5
- package/dist/http/openApiV3Generator.d.ts +1 -0
- package/dist/http/openApiV3Generator.d.ts.map +1 -0
- package/dist/http/openApiV3Generator.js +28 -13
- package/dist/http/regex.d.ts +1 -0
- package/dist/http/regex.d.ts.map +1 -0
- package/dist/http/regex.js +1 -5
- package/dist/http/types/api.types.d.ts +128 -50
- package/dist/http/types/api.types.d.ts.map +1 -0
- package/dist/http/types/api.types.js +1 -3
- package/dist/http/types/forklaunch.types.d.ts +2 -3
- package/dist/http/types/forklaunch.types.d.ts.map +1 -0
- package/dist/http/types/forklaunch.types.js +1 -3
- package/dist/http/types/index.d.ts +1 -0
- package/dist/http/types/index.d.ts.map +1 -0
- package/dist/http/types/index.js +3 -20
- package/dist/http/types/primitive.types.d.ts +5 -4
- package/dist/http/types/primitive.types.d.ts.map +1 -0
- package/dist/http/types/primitive.types.js +1 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -23
- package/dist/jest.config.d.ts +1 -0
- package/dist/jest.config.d.ts.map +1 -0
- package/dist/jest.config.js +1 -4
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +1 -18
- package/dist/services/interfaces/baseService.d.ts +1 -0
- package/dist/services/interfaces/baseService.d.ts.map +1 -0
- package/dist/services/interfaces/baseService.js +1 -3
- package/dist/tests/entityMapper.test.d.ts +1 -0
- package/dist/tests/entityMapper.test.d.ts.map +1 -0
- package/dist/tests/entityMapper.test.js +34 -24
- package/dist/tests/http.middleware.test.d.ts +1 -0
- package/dist/tests/http.middleware.test.d.ts.map +1 -0
- package/dist/tests/http.middleware.test.js +16 -17
- package/dist/tests/openApiV3Generator.test.d.ts +1 -0
- package/dist/tests/openApiV3Generator.test.d.ts.map +1 -0
- package/dist/tests/openApiV3Generator.test.js +5 -9
- package/dist/tests/redisTtlCache.test.d.ts +1 -0
- package/dist/tests/redisTtlCache.test.d.ts.map +1 -0
- package/dist/tests/redisTtlCache.test.js +4 -7
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +13 -10
- package/LICENSE +0 -21
- package/dist/cache/index.js.map +0 -1
- package/dist/cache/interfaces/ttlCache.interface.js.map +0 -1
- package/dist/cache/redisTtlCache.js.map +0 -1
- package/dist/cache/types/ttlCacheRecord.types.js.map +0 -1
- package/dist/controllers/index.js.map +0 -1
- package/dist/controllers/interfaces/controller.interface.js.map +0 -1
- package/dist/database/index.js.map +0 -1
- package/dist/database/mikro/models/entities/base.entity.js.map +0 -1
- package/dist/entityMapper/index.js.map +0 -1
- package/dist/entityMapper/interfaces/entityMapper.interface.js.map +0 -1
- package/dist/entityMapper/models/baseEntityMapper.model.js.map +0 -1
- package/dist/entityMapper/models/requestEntityMapper.model.js.map +0 -1
- package/dist/entityMapper/models/responseEntityMapper.model.js.map +0 -1
- package/dist/entityMapper/types/entityMapper.types.js.map +0 -1
- package/dist/http/httpStatusCodes.js.map +0 -1
- package/dist/http/index.js.map +0 -1
- package/dist/http/middleware/index.js.map +0 -1
- package/dist/http/middleware/request.middleware.js.map +0 -1
- package/dist/http/middleware/response.middleware.js.map +0 -1
- package/dist/http/openApiV3Generator.js.map +0 -1
- package/dist/http/regex.js.map +0 -1
- package/dist/http/types/api.types.js.map +0 -1
- package/dist/http/types/forklaunch.types.js.map +0 -1
- package/dist/http/types/index.js.map +0 -1
- package/dist/http/types/primitive.types.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/jest.config.js.map +0 -1
- package/dist/services/index.js.map +0 -1
- package/dist/services/interfaces/baseService.js.map +0 -1
- package/dist/tests/entityMapper.test.js.map +0 -1
- package/dist/tests/http.middleware.test.js.map +0 -1
- package/dist/tests/openApiV3Generator.test.js.map +0 -1
- package/dist/tests/redisTtlCache.test.js.map +0 -1
@@ -0,0 +1,157 @@
|
|
1
|
+
import { AnySchemaValidator } from '@forklaunch/validator';
|
2
|
+
import { Body, ForklaunchSchemaMiddlewareHandler, HeadersObject, HttpContractDetails, LiveTypeFunction, ParamsObject, PathParamHttpContractDetails, QueryObject, ResponsesObject } from '../types';
|
3
|
+
export declare abstract class ExpressLikeApplication<SV extends AnySchemaValidator, Server, RouterFunction> {
|
4
|
+
private schemaValidator;
|
5
|
+
private internal;
|
6
|
+
private routers;
|
7
|
+
/**
|
8
|
+
* Creates an instance of the Application class.
|
9
|
+
*
|
10
|
+
* @param {SV} schemaValidator - The schema validator.
|
11
|
+
*/
|
12
|
+
constructor(schemaValidator: SV, internal: Server);
|
13
|
+
}
|
14
|
+
interface ExpressLikeRouter<RouterFunction> {
|
15
|
+
use: (...args: unknown[]) => void;
|
16
|
+
get(path: string, ...handlers: RouterFunction[]): void;
|
17
|
+
post(path: string, ...handlers: RouterFunction[]): void;
|
18
|
+
put(path: string, ...handlers: RouterFunction[]): void;
|
19
|
+
patch(path: string, ...handlers: RouterFunction[]): void;
|
20
|
+
delete(path: string, ...handlers: RouterFunction[]): void;
|
21
|
+
}
|
22
|
+
export declare abstract class ForklaunchExpressRouter<SV extends AnySchemaValidator, BasePath extends `/${string}`, RouterFunction> {
|
23
|
+
basePath: BasePath;
|
24
|
+
readonly internal: ExpressLikeRouter<RouterFunction>;
|
25
|
+
private routes;
|
26
|
+
constructor(basePath: BasePath, internal: ExpressLikeRouter<RouterFunction>);
|
27
|
+
/**
|
28
|
+
* Resolves middlewares based on the contract details.
|
29
|
+
*
|
30
|
+
* @param {PathParamHttpContractDetails<SV> | HttpContractDetails<SV>} contractDetails - The contract details.
|
31
|
+
* @returns {MiddlewareHandler<SV>[]} - The resolved middlewares.
|
32
|
+
*/
|
33
|
+
private resolveMiddlewares;
|
34
|
+
/**
|
35
|
+
* Parses and runs the controller function with error handling.
|
36
|
+
*
|
37
|
+
* @template P - The type of request parameters.
|
38
|
+
* @template ResBodyMap - The type of response body.
|
39
|
+
* @template ReqBody - The type of request body.
|
40
|
+
* @template ReqQuery - The type of request query.
|
41
|
+
* @template LocalsObj - The type of local variables.
|
42
|
+
* @template StatusCode - The type of status code.
|
43
|
+
* @param {MiddlewareHandler<SV, P, ResBodyMap | string, ReqBody, ReqQuery, LocalsObj, StatusCode>} requestHandler - The request handler.
|
44
|
+
* @returns {ExpressMiddlewareHandler} - The Express request handler.
|
45
|
+
*/
|
46
|
+
private parseAndRunControllerFunction;
|
47
|
+
/**
|
48
|
+
* Extracts the controller function from the provided functions.
|
49
|
+
*
|
50
|
+
* @template P - The type of request parameters.
|
51
|
+
* @template ResBodyMap - The type of response body.
|
52
|
+
* @template ReqBody - The type of request body.
|
53
|
+
* @template ReqQuery - The type of request query.
|
54
|
+
* @template LocalsObj - The type of local variables.
|
55
|
+
* @param {MiddlewareHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>[]} functions - The provided functions.
|
56
|
+
* @returns {MiddlewareHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>} - The extracted controller function.
|
57
|
+
* @throws {Error} - Throws an error if the last argument is not a function.
|
58
|
+
*/
|
59
|
+
private extractControllerFunction;
|
60
|
+
/**
|
61
|
+
* Registers middleware to the router.
|
62
|
+
*
|
63
|
+
* @param {...unknown[]} args - The middleware to register.
|
64
|
+
* @returns {this} - The router instance.
|
65
|
+
*/
|
66
|
+
use(...args: unknown[]): this;
|
67
|
+
/**
|
68
|
+
* Executes request locally, applying parameters
|
69
|
+
*
|
70
|
+
* @param functions {ForklaunchMiddlewareHandler<SV>}
|
71
|
+
* @param controllerFunction
|
72
|
+
* @returns
|
73
|
+
*/
|
74
|
+
private localParamRequest;
|
75
|
+
/**
|
76
|
+
* Registers a GET route with the specified contract details and handler functions.
|
77
|
+
*
|
78
|
+
* @template P - The type of request parameters.
|
79
|
+
* @template ResBodyMap - The type of response body.
|
80
|
+
* @template ReqBody - The type of request body.
|
81
|
+
* @template ReqQuery - The type of request query.
|
82
|
+
* @template LocalsObj - The type of local variables.
|
83
|
+
* @param {string} path - The path for the route.
|
84
|
+
* @param {PathParamHttpContractDetails<SV, P, ResBodyMap, ReqQuery>} contractDetails - The contract details.
|
85
|
+
* @param {...SchemaMiddlewareHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>[]} functions - The handler functions.
|
86
|
+
* @returns {ExpressRouter} - The Express router.
|
87
|
+
*/
|
88
|
+
get<Path extends `/${string}`, P extends ParamsObject<SV> = ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV> = ResponsesObject<SV>, ReqBody extends Body<SV> = Body<SV>, ReqQuery extends QueryObject<SV> = QueryObject<SV>, ReqHeaders extends HeadersObject<SV> = HeadersObject<SV>, ResHeaders extends HeadersObject<SV> = HeadersObject<SV>, LocalsObj extends Record<string, unknown> = Record<string, unknown>>(path: Path, contractDetails: PathParamHttpContractDetails<SV, P, ResBodyMap, ReqQuery, ReqHeaders, ResHeaders>, ...functions: ForklaunchSchemaMiddlewareHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj>[]): {
|
89
|
+
get: LiveTypeFunction<SV, `${BasePath}/${string}`, import("../types").MapSchema<SV, P> extends infer Params ? unknown extends Params ? never : Params : never, import("../types").MapSchema<SV, ResBodyMap> extends infer ResponseBodyMap ? unknown extends ResponseBodyMap ? import("../types").ForklaunchResErrors<string, string, string, string> : ResponseBodyMap : never, import("../types").MapSchema<SV, ReqBody> extends infer Body ? unknown extends Body ? never : Body : never, import("../types").MapSchema<SV, ReqQuery> extends infer Query ? unknown extends Query ? never : Query : never, import("../types").MapSchema<SV, ReqHeaders> extends infer RequestHeaders ? unknown extends RequestHeaders ? import("../types").ForklaunchResHeaders : ReqHeaders : never, import("../types").MapSchema<SV, ResHeaders> extends infer ResponseHeaders ? unknown extends ResponseHeaders ? never : ResHeaders : never>;
|
90
|
+
};
|
91
|
+
/**
|
92
|
+
* Registers a POST route with the specified contract details and handler functions.
|
93
|
+
*
|
94
|
+
* @template P - The type of request parameters.
|
95
|
+
* @template ResBodyMap - The type of response body.
|
96
|
+
* @template ReqBody - The type of request body.
|
97
|
+
* @template ReqQuery - The type of request query.
|
98
|
+
* @template LocalsObj - The type of local variables.
|
99
|
+
* @param {string} path - The path for the route.
|
100
|
+
* @param {HttpContractDetails<SV, P, ResBodyMap, ReqBody, ReqQuery>} contractDetails - The contract details.
|
101
|
+
* @param {...SchemaMiddlewareHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>[]} functions - The handler functions.
|
102
|
+
* @returns {ExpressRouter} - The Express router.
|
103
|
+
*/
|
104
|
+
post<Path extends `/${string}`, P extends ParamsObject<SV> = ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV> = ResponsesObject<SV>, ReqBody extends Body<SV> = Body<SV>, ReqQuery extends QueryObject<SV> = QueryObject<SV>, ReqHeaders extends HeadersObject<SV> = HeadersObject<SV>, ResHeaders extends HeadersObject<SV> = HeadersObject<SV>, LocalsObj extends Record<string, unknown> = Record<string, unknown>>(path: Path, contractDetails: HttpContractDetails<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders>, ...functions: ForklaunchSchemaMiddlewareHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj>[]): {
|
105
|
+
post: LiveTypeFunction<SV, `${BasePath}/${string}`, import("../types").MapSchema<SV, P> extends infer Params ? unknown extends Params ? never : Params : never, import("../types").MapSchema<SV, ResBodyMap> extends infer ResponseBodyMap ? unknown extends ResponseBodyMap ? import("../types").ForklaunchResErrors<string, string, string, string> : ResponseBodyMap : never, import("../types").MapSchema<SV, ReqBody> extends infer Body ? unknown extends Body ? never : Body : never, import("../types").MapSchema<SV, ReqQuery> extends infer Query ? unknown extends Query ? never : Query : never, import("../types").MapSchema<SV, ReqHeaders> extends infer RequestHeaders ? unknown extends RequestHeaders ? import("../types").ForklaunchResHeaders : ReqHeaders : never, import("../types").MapSchema<SV, ResHeaders> extends infer ResponseHeaders ? unknown extends ResponseHeaders ? never : ResHeaders : never>;
|
106
|
+
};
|
107
|
+
/**
|
108
|
+
* Registers a PUT route with the specified contract details and handler functions.
|
109
|
+
*
|
110
|
+
* @template P - The type of request parameters.
|
111
|
+
* @template ResBodyMap - The type of response body.
|
112
|
+
* @template ReqBody - The type of request body.
|
113
|
+
* @template ReqQuery - The type of request query.
|
114
|
+
* @template LocalsObj - The type of local variables.
|
115
|
+
* @param {string} path - The path for the route.
|
116
|
+
* @param {HttpContractDetails<SV, P, ResBodyMap, ReqBody, ReqQuery>} contractDetails - The contract details.
|
117
|
+
* @param {...SchemaMiddlewareHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>[]} functions - The handler functions.
|
118
|
+
* @returns {ExpressRouter} - The Express router.
|
119
|
+
*/
|
120
|
+
put<Path extends `/${string}`, P extends ParamsObject<SV> = ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV> = ResponsesObject<SV>, ReqBody extends Body<SV> = Body<SV>, ReqQuery extends QueryObject<SV> = QueryObject<SV>, ReqHeaders extends HeadersObject<SV> = HeadersObject<SV>, ResHeaders extends HeadersObject<SV> = HeadersObject<SV>, LocalsObj extends Record<string, unknown> = Record<string, unknown>>(path: Path, contractDetails: HttpContractDetails<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders>, ...functions: ForklaunchSchemaMiddlewareHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj>[]): {
|
121
|
+
put: LiveTypeFunction<SV, `${BasePath}/${string}`, import("../types").MapSchema<SV, P> extends infer Params ? unknown extends Params ? never : Params : never, import("../types").MapSchema<SV, ResBodyMap> extends infer ResponseBodyMap ? unknown extends ResponseBodyMap ? import("../types").ForklaunchResErrors<string, string, string, string> : ResponseBodyMap : never, import("../types").MapSchema<SV, ReqBody> extends infer Body ? unknown extends Body ? never : Body : never, import("../types").MapSchema<SV, ReqQuery> extends infer Query ? unknown extends Query ? never : Query : never, import("../types").MapSchema<SV, ReqHeaders> extends infer RequestHeaders ? unknown extends RequestHeaders ? import("../types").ForklaunchResHeaders : ReqHeaders : never, import("../types").MapSchema<SV, ResHeaders> extends infer ResponseHeaders ? unknown extends ResponseHeaders ? never : ResHeaders : never>;
|
122
|
+
};
|
123
|
+
/**
|
124
|
+
* Registers a PATCH route with the specified contract details and handler functions.
|
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 {HttpContractDetails<SV, P, ResBodyMap, ReqBody, ReqQuery>} contractDetails - The contract details.
|
133
|
+
* @param {...SchemaMiddlewareHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>[]} functions - The handler functions.
|
134
|
+
* @returns {ExpressRouter} - The Express router.
|
135
|
+
*/
|
136
|
+
patch<Path extends `/${string}`, P extends ParamsObject<SV> = ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV> = ResponsesObject<SV>, ReqBody extends Body<SV> = Body<SV>, ReqQuery extends QueryObject<SV> = QueryObject<SV>, ReqHeaders extends HeadersObject<SV> = HeadersObject<SV>, ResHeaders extends HeadersObject<SV> = HeadersObject<SV>, LocalsObj extends Record<string, unknown> = Record<string, unknown>>(path: Path, contractDetails: HttpContractDetails<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders>, ...functions: ForklaunchSchemaMiddlewareHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj>[]): {
|
137
|
+
patch: LiveTypeFunction<SV, `${BasePath}/${string}`, import("../types").MapSchema<SV, P> extends infer Params ? unknown extends Params ? never : Params : never, import("../types").MapSchema<SV, ResBodyMap> extends infer ResponseBodyMap ? unknown extends ResponseBodyMap ? import("../types").ForklaunchResErrors<string, string, string, string> : ResponseBodyMap : never, import("../types").MapSchema<SV, ReqBody> extends infer Body ? unknown extends Body ? never : Body : never, import("../types").MapSchema<SV, ReqQuery> extends infer Query ? unknown extends Query ? never : Query : never, import("../types").MapSchema<SV, ReqHeaders> extends infer RequestHeaders ? unknown extends RequestHeaders ? import("../types").ForklaunchResHeaders : ReqHeaders : never, import("../types").MapSchema<SV, ResHeaders> extends infer ResponseHeaders ? unknown extends ResponseHeaders ? never : ResHeaders : never>;
|
138
|
+
};
|
139
|
+
/**
|
140
|
+
* Registers a DELETE route with the specified contract details and handler functions.
|
141
|
+
*
|
142
|
+
* @template P - The type of request parameters.
|
143
|
+
* @template ResBodyMap - The type of response body.
|
144
|
+
* @template ReqBody - The type of request body.
|
145
|
+
* @template ReqQuery - The type of request query.
|
146
|
+
* @template LocalsObj - The type of local variables.
|
147
|
+
* @param {string} path - The path for the route.
|
148
|
+
* @param {PathParamHttpContractDetails<SV, P, ResBodyMap, ReqQuery>} contractDetails - The contract details.
|
149
|
+
* @param {...SchemaMiddlewareHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>[]} functions - The handler functions.
|
150
|
+
* @returns {ExpressRouter} - The Express router.
|
151
|
+
*/
|
152
|
+
delete<Path extends `/${string}`, P extends ParamsObject<SV> = ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV> = ResponsesObject<SV>, ReqBody extends Body<SV> = Body<SV>, ReqQuery extends QueryObject<SV> = QueryObject<SV>, ReqHeaders extends HeadersObject<SV> = HeadersObject<SV>, ResHeaders extends HeadersObject<SV> = HeadersObject<SV>, LocalsObj extends Record<string, unknown> = Record<string, unknown>>(path: Path, contractDetails: PathParamHttpContractDetails<SV, P, ResBodyMap, ReqQuery, ReqHeaders, ResHeaders>, ...functions: ForklaunchSchemaMiddlewareHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj>[]): {
|
153
|
+
delete: LiveTypeFunction<SV, `${BasePath}/${string}`, import("../types").MapSchema<SV, P> extends infer Params ? unknown extends Params ? never : Params : never, import("../types").MapSchema<SV, ResBodyMap> extends infer ResponseBodyMap ? unknown extends ResponseBodyMap ? import("../types").ForklaunchResErrors<string, string, string, string> : ResponseBodyMap : never, import("../types").MapSchema<SV, ReqBody> extends infer Body ? unknown extends Body ? never : Body : never, import("../types").MapSchema<SV, ReqQuery> extends infer Query ? unknown extends Query ? never : Query : never, import("../types").MapSchema<SV, ReqHeaders> extends infer RequestHeaders ? unknown extends RequestHeaders ? import("../types").ForklaunchResHeaders : ReqHeaders : never, import("../types").MapSchema<SV, ResHeaders> extends infer ResponseHeaders ? unknown extends ResponseHeaders ? never : ResHeaders : never>;
|
154
|
+
};
|
155
|
+
}
|
156
|
+
export {};
|
157
|
+
//# sourceMappingURL=forklaunchExpress.abstractClass.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"forklaunchExpress.abstractClass.d.ts","sourceRoot":"","sources":["../../../http/interfaces/forklaunchExpress.abstractClass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAU3D,OAAO,EACL,IAAI,EAGJ,iCAAiC,EACjC,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAEhB,YAAY,EACZ,4BAA4B,EAC5B,WAAW,EACX,eAAe,EAChB,MAAM,UAAU,CAAC;AAElB,8BAAsB,sBAAsB,CAC1C,EAAE,SAAS,kBAAkB,EAC7B,MAAM,EACN,cAAc;IAWZ,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,QAAQ;IAVlB,OAAO,CAAC,OAAO,CACV;IAEL;;;;OAIG;gBAEO,eAAe,EAAE,EAAE,EACnB,QAAQ,EAAE,MAAM;CAE3B;AAED,UAAU,iBAAiB,CAAC,cAAc;IACxC,GAAG,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IAClC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IACvD,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IACxD,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,cAAc,EAAE,G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AAU,EACV,QAAQ,EACR,UAAU,EACV,UAAU,CACX,EACD,GAAG,SAAS,EAAE,iCAAiC,CAC7C,EAAE,EACF,CAAC,EACD,UAAU,EACV,OAAO,EACP,QAAQ,EACR,UAAU,EACV,UAAU,EACV,SAAS,CACV,EAAE;;;CA8BN"}
|
@@ -0,0 +1,330 @@
|
|
1
|
+
import { enrichRequestDetails, parseReqHeaders, parseRequestAuth, parseRequestBody, parseRequestParams, parseRequestQuery } from '../middleware';
|
2
|
+
export class ExpressLikeApplication {
|
3
|
+
schemaValidator;
|
4
|
+
internal;
|
5
|
+
routers = [];
|
6
|
+
/**
|
7
|
+
* Creates an instance of the Application class.
|
8
|
+
*
|
9
|
+
* @param {SV} schemaValidator - The schema validator.
|
10
|
+
*/
|
11
|
+
constructor(schemaValidator, internal) {
|
12
|
+
this.schemaValidator = schemaValidator;
|
13
|
+
this.internal = internal;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
export class ForklaunchExpressRouter {
|
17
|
+
basePath;
|
18
|
+
internal;
|
19
|
+
routes = [];
|
20
|
+
constructor(basePath, internal) {
|
21
|
+
this.basePath = basePath;
|
22
|
+
this.internal = internal;
|
23
|
+
}
|
24
|
+
/**
|
25
|
+
* Resolves middlewares based on the contract details.
|
26
|
+
*
|
27
|
+
* @param {PathParamHttpContractDetails<SV> | HttpContractDetails<SV>} contractDetails - The contract details.
|
28
|
+
* @returns {MiddlewareHandler<SV>[]} - The resolved middlewares.
|
29
|
+
*/
|
30
|
+
resolveMiddlewares(contractDetails) {
|
31
|
+
const middlewares = [
|
32
|
+
enrichRequestDetails(contractDetails)
|
33
|
+
];
|
34
|
+
if (contractDetails.params) {
|
35
|
+
middlewares.push(parseRequestParams);
|
36
|
+
}
|
37
|
+
if (contractDetails.body) {
|
38
|
+
middlewares.push(parseRequestBody);
|
39
|
+
}
|
40
|
+
if (contractDetails.requestHeaders) {
|
41
|
+
middlewares.push(parseReqHeaders);
|
42
|
+
}
|
43
|
+
if (contractDetails.query) {
|
44
|
+
middlewares.push(parseRequestQuery);
|
45
|
+
}
|
46
|
+
if (contractDetails.auth) {
|
47
|
+
middlewares.push(parseRequestAuth);
|
48
|
+
}
|
49
|
+
return middlewares;
|
50
|
+
}
|
51
|
+
/**
|
52
|
+
* Parses and runs the controller function with error handling.
|
53
|
+
*
|
54
|
+
* @template P - The type of request parameters.
|
55
|
+
* @template ResBodyMap - The type of response body.
|
56
|
+
* @template ReqBody - The type of request body.
|
57
|
+
* @template ReqQuery - The type of request query.
|
58
|
+
* @template LocalsObj - The type of local variables.
|
59
|
+
* @template StatusCode - The type of status code.
|
60
|
+
* @param {MiddlewareHandler<SV, P, ResBodyMap | string, ReqBody, ReqQuery, LocalsObj, StatusCode>} requestHandler - The request handler.
|
61
|
+
* @returns {ExpressMiddlewareHandler} - The Express request handler.
|
62
|
+
*/
|
63
|
+
parseAndRunControllerFunction(requestHandler) {
|
64
|
+
return (async (req, res, next) => {
|
65
|
+
if (!requestHandler) {
|
66
|
+
throw new Error('Controller function is not defined');
|
67
|
+
}
|
68
|
+
try {
|
69
|
+
await requestHandler(req, res, next);
|
70
|
+
}
|
71
|
+
catch (error) {
|
72
|
+
if (next) {
|
73
|
+
next(error);
|
74
|
+
}
|
75
|
+
console.error(error);
|
76
|
+
if (!res.headersSent) {
|
77
|
+
res.status(500).send('Internal Server Error');
|
78
|
+
}
|
79
|
+
}
|
80
|
+
});
|
81
|
+
}
|
82
|
+
/**
|
83
|
+
* Extracts the controller function from the provided functions.
|
84
|
+
*
|
85
|
+
* @template P - The type of request parameters.
|
86
|
+
* @template ResBodyMap - The type of response body.
|
87
|
+
* @template ReqBody - The type of request body.
|
88
|
+
* @template ReqQuery - The type of request query.
|
89
|
+
* @template LocalsObj - The type of local variables.
|
90
|
+
* @param {MiddlewareHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>[]} functions - The provided functions.
|
91
|
+
* @returns {MiddlewareHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>} - The extracted controller function.
|
92
|
+
* @throws {Error} - Throws an error if the last argument is not a function.
|
93
|
+
*/
|
94
|
+
extractControllerFunction(functions) {
|
95
|
+
const controllerFunction = functions.pop();
|
96
|
+
if (typeof controllerFunction !== 'function') {
|
97
|
+
throw new Error('Last argument must be a function');
|
98
|
+
}
|
99
|
+
return controllerFunction;
|
100
|
+
}
|
101
|
+
// TODO: Move to UniversalSDK
|
102
|
+
// /**
|
103
|
+
// * Extracts the SDK path from the given path.
|
104
|
+
// *
|
105
|
+
// * @param {string | RegExp | (string | RegExp)[]} path - The provided path.
|
106
|
+
// * @returns {string} - The extracted SDK path.
|
107
|
+
// * @throws {Error} - Throws an error if the path is not defined.
|
108
|
+
// */
|
109
|
+
// private extractSdkPath(path: string | RegExp | (string | RegExp)[]): string {
|
110
|
+
// let sdkPath = path;
|
111
|
+
// if (Array.isArray(path)) {
|
112
|
+
// sdkPath = path.pop() || path[0];
|
113
|
+
// }
|
114
|
+
// if (!sdkPath) {
|
115
|
+
// throw new Error('Path is not defined');
|
116
|
+
// }
|
117
|
+
// if (sdkPath instanceof RegExp) {
|
118
|
+
// sdkPath = generateStringFromRegex(sdkPath);
|
119
|
+
// }
|
120
|
+
// return sdkPath as string;
|
121
|
+
// }
|
122
|
+
/**
|
123
|
+
* Registers middleware to the router.
|
124
|
+
*
|
125
|
+
* @param {...unknown[]} args - The middleware to register.
|
126
|
+
* @returns {this} - The router instance.
|
127
|
+
*/
|
128
|
+
use(...args) {
|
129
|
+
this.internal.use(...args);
|
130
|
+
return this;
|
131
|
+
}
|
132
|
+
/**
|
133
|
+
* Executes request locally, applying parameters
|
134
|
+
*
|
135
|
+
* @param functions {ForklaunchMiddlewareHandler<SV>}
|
136
|
+
* @param controllerFunction
|
137
|
+
* @returns
|
138
|
+
*/
|
139
|
+
localParamRequest(functions, controllerFunction) {
|
140
|
+
return (async (route, request) => {
|
141
|
+
let statusCode;
|
142
|
+
let responseMessage;
|
143
|
+
const responseHeaders = {};
|
144
|
+
const req = {
|
145
|
+
params: request?.params ?? {},
|
146
|
+
query: request?.query ?? {},
|
147
|
+
headers: request?.headers ?? {},
|
148
|
+
body: request?.body ?? {},
|
149
|
+
path: route
|
150
|
+
};
|
151
|
+
const res = {
|
152
|
+
status: (code) => {
|
153
|
+
statusCode = code;
|
154
|
+
return res;
|
155
|
+
},
|
156
|
+
send: (message) => {
|
157
|
+
responseMessage = message;
|
158
|
+
},
|
159
|
+
json: (body) => {
|
160
|
+
responseMessage = body;
|
161
|
+
},
|
162
|
+
jsonp: (body) => {
|
163
|
+
responseMessage = body;
|
164
|
+
},
|
165
|
+
setHeader: (key, value) => {
|
166
|
+
responseHeaders[key] = value;
|
167
|
+
}
|
168
|
+
};
|
169
|
+
// let cursor = functions.shift() as unknown as (req_: typeof req, resp_: typeof res, next: MiddlewareNext) => void;
|
170
|
+
let cursor = functions.shift();
|
171
|
+
if (cursor) {
|
172
|
+
for (const fn of functions) {
|
173
|
+
await cursor(req, res, (err) => {
|
174
|
+
if (err) {
|
175
|
+
throw err;
|
176
|
+
}
|
177
|
+
cursor = fn;
|
178
|
+
});
|
179
|
+
}
|
180
|
+
await cursor(req, res, async (err) => {
|
181
|
+
if (err) {
|
182
|
+
throw err;
|
183
|
+
}
|
184
|
+
});
|
185
|
+
}
|
186
|
+
const cFunction = controllerFunction;
|
187
|
+
await cFunction(req, res, (err) => {
|
188
|
+
if (err) {
|
189
|
+
throw err;
|
190
|
+
}
|
191
|
+
});
|
192
|
+
return {
|
193
|
+
code: statusCode,
|
194
|
+
response: responseMessage,
|
195
|
+
headers: responseHeaders
|
196
|
+
};
|
197
|
+
});
|
198
|
+
}
|
199
|
+
/**
|
200
|
+
* Registers a GET route with the specified contract details and handler functions.
|
201
|
+
*
|
202
|
+
* @template P - The type of request parameters.
|
203
|
+
* @template ResBodyMap - The type of response body.
|
204
|
+
* @template ReqBody - The type of request body.
|
205
|
+
* @template ReqQuery - The type of request query.
|
206
|
+
* @template LocalsObj - The type of local variables.
|
207
|
+
* @param {string} path - The path for the route.
|
208
|
+
* @param {PathParamHttpContractDetails<SV, P, ResBodyMap, ReqQuery>} contractDetails - The contract details.
|
209
|
+
* @param {...SchemaMiddlewareHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>[]} functions - The handler functions.
|
210
|
+
* @returns {ExpressRouter} - The Express router.
|
211
|
+
*/
|
212
|
+
get(path, contractDetails, ...functions) {
|
213
|
+
const controllerFunction = this.extractControllerFunction(functions);
|
214
|
+
this.routes.push({
|
215
|
+
basePath: this.basePath,
|
216
|
+
path,
|
217
|
+
method: 'GET',
|
218
|
+
contractDetails
|
219
|
+
});
|
220
|
+
this.internal.get(path, ...this.resolveMiddlewares(contractDetails).concat(functions), this.parseAndRunControllerFunction(controllerFunction));
|
221
|
+
return {
|
222
|
+
get: this.localParamRequest(functions, controllerFunction)
|
223
|
+
};
|
224
|
+
}
|
225
|
+
/**
|
226
|
+
* Registers a POST route with the specified contract details and handler functions.
|
227
|
+
*
|
228
|
+
* @template P - The type of request parameters.
|
229
|
+
* @template ResBodyMap - The type of response body.
|
230
|
+
* @template ReqBody - The type of request body.
|
231
|
+
* @template ReqQuery - The type of request query.
|
232
|
+
* @template LocalsObj - The type of local variables.
|
233
|
+
* @param {string} path - The path for the route.
|
234
|
+
* @param {HttpContractDetails<SV, P, ResBodyMap, ReqBody, ReqQuery>} contractDetails - The contract details.
|
235
|
+
* @param {...SchemaMiddlewareHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>[]} functions - The handler functions.
|
236
|
+
* @returns {ExpressRouter} - The Express router.
|
237
|
+
*/
|
238
|
+
post(path, contractDetails, ...functions) {
|
239
|
+
// : LiveType<SV, P, ResBodyMap, ReqBody, ReqQuery> {
|
240
|
+
const controllerFunction = this.extractControllerFunction(functions);
|
241
|
+
this.routes.push({
|
242
|
+
basePath: this.basePath,
|
243
|
+
path,
|
244
|
+
method: 'POST',
|
245
|
+
contractDetails
|
246
|
+
});
|
247
|
+
this.internal.post(path, ...this.resolveMiddlewares(contractDetails).concat(functions), this.parseAndRunControllerFunction(controllerFunction));
|
248
|
+
return {
|
249
|
+
post: this.localParamRequest(functions, controllerFunction)
|
250
|
+
};
|
251
|
+
}
|
252
|
+
/**
|
253
|
+
* Registers a PUT route with the specified contract details and handler functions.
|
254
|
+
*
|
255
|
+
* @template P - The type of request parameters.
|
256
|
+
* @template ResBodyMap - The type of response body.
|
257
|
+
* @template ReqBody - The type of request body.
|
258
|
+
* @template ReqQuery - The type of request query.
|
259
|
+
* @template LocalsObj - The type of local variables.
|
260
|
+
* @param {string} path - The path for the route.
|
261
|
+
* @param {HttpContractDetails<SV, P, ResBodyMap, ReqBody, ReqQuery>} contractDetails - The contract details.
|
262
|
+
* @param {...SchemaMiddlewareHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>[]} functions - The handler functions.
|
263
|
+
* @returns {ExpressRouter} - The Express router.
|
264
|
+
*/
|
265
|
+
put(path, contractDetails, ...functions) {
|
266
|
+
const controllerFunction = this.extractControllerFunction(functions);
|
267
|
+
this.routes.push({
|
268
|
+
basePath: this.basePath,
|
269
|
+
path,
|
270
|
+
method: 'PUT',
|
271
|
+
contractDetails
|
272
|
+
});
|
273
|
+
this.internal.put(path, ...this.resolveMiddlewares(contractDetails).concat(functions), this.parseAndRunControllerFunction(controllerFunction));
|
274
|
+
return {
|
275
|
+
put: this.localParamRequest(functions, controllerFunction)
|
276
|
+
};
|
277
|
+
}
|
278
|
+
/**
|
279
|
+
* Registers a PATCH route with the specified contract details and handler functions.
|
280
|
+
*
|
281
|
+
* @template P - The type of request parameters.
|
282
|
+
* @template ResBodyMap - The type of response body.
|
283
|
+
* @template ReqBody - The type of request body.
|
284
|
+
* @template ReqQuery - The type of request query.
|
285
|
+
* @template LocalsObj - The type of local variables.
|
286
|
+
* @param {string} path - The path for the route.
|
287
|
+
* @param {HttpContractDetails<SV, P, ResBodyMap, ReqBody, ReqQuery>} contractDetails - The contract details.
|
288
|
+
* @param {...SchemaMiddlewareHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>[]} functions - The handler functions.
|
289
|
+
* @returns {ExpressRouter} - The Express router.
|
290
|
+
*/
|
291
|
+
patch(path, contractDetails, ...functions) {
|
292
|
+
const controllerFunction = this.extractControllerFunction(functions);
|
293
|
+
this.routes.push({
|
294
|
+
basePath: this.basePath,
|
295
|
+
path,
|
296
|
+
method: 'PATCH',
|
297
|
+
contractDetails
|
298
|
+
});
|
299
|
+
this.internal.patch(path, ...this.resolveMiddlewares(contractDetails).concat(functions), this.parseAndRunControllerFunction(controllerFunction));
|
300
|
+
return {
|
301
|
+
patch: this.localParamRequest(functions, controllerFunction)
|
302
|
+
};
|
303
|
+
}
|
304
|
+
/**
|
305
|
+
* Registers a DELETE route with the specified contract details and handler functions.
|
306
|
+
*
|
307
|
+
* @template P - The type of request parameters.
|
308
|
+
* @template ResBodyMap - The type of response body.
|
309
|
+
* @template ReqBody - The type of request body.
|
310
|
+
* @template ReqQuery - The type of request query.
|
311
|
+
* @template LocalsObj - The type of local variables.
|
312
|
+
* @param {string} path - The path for the route.
|
313
|
+
* @param {PathParamHttpContractDetails<SV, P, ResBodyMap, ReqQuery>} contractDetails - The contract details.
|
314
|
+
* @param {...SchemaMiddlewareHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, LocalsObj>[]} functions - The handler functions.
|
315
|
+
* @returns {ExpressRouter} - The Express router.
|
316
|
+
*/
|
317
|
+
delete(path, contractDetails, ...functions) {
|
318
|
+
const controllerFunction = this.extractControllerFunction(functions);
|
319
|
+
this.routes.push({
|
320
|
+
basePath: this.basePath,
|
321
|
+
path,
|
322
|
+
method: 'DELETE',
|
323
|
+
contractDetails
|
324
|
+
});
|
325
|
+
this.internal.delete(path, ...this.resolveMiddlewares(contractDetails).concat(functions), this.parseAndRunControllerFunction(controllerFunction));
|
326
|
+
return {
|
327
|
+
delete: this.localParamRequest(functions, controllerFunction)
|
328
|
+
};
|
329
|
+
}
|
330
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../http/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './forklaunchExpress.abstractClass';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../http/middleware/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
|
@@ -1,19 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
-
};
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./request.middleware"), exports);
|
18
|
-
__exportStar(require("./response.middleware"), exports);
|
19
|
-
//# sourceMappingURL=index.js.map
|
1
|
+
export * from './request.middleware';
|
2
|
+
export * from './response.middleware';
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { AnySchemaValidator, SchemaValidator } from '@forklaunch/validator';
|
2
|
-
import {
|
3
|
-
import {
|
2
|
+
import { ParsedQs } from 'qs';
|
3
|
+
import { ForklaunchNextFunction, ForklaunchRequest, ForklaunchResponse, ForklaunchSchemaMiddlewareHandler } from '../types/api.types';
|
4
|
+
import { Body, HeadersObject, HttpContractDetails, ParamsDictionary, ParamsObject, PathParamHttpContractDetails, QueryObject, ResponsesObject, StringOnlyObject } from '../types/primitive.types';
|
4
5
|
/**
|
5
6
|
* Middleware to create and add a request context.
|
6
7
|
*
|
@@ -11,7 +12,7 @@ import { HttpContractDetails, PathParamHttpContractDetails, StringOnlyObject } f
|
|
11
12
|
* @param {SV} schemaValidator - The schema validator.
|
12
13
|
* @returns {Function} - Middleware function to create request context.
|
13
14
|
*/
|
14
|
-
export declare function createRequestContext<SV extends AnySchemaValidator,
|
15
|
+
export declare function createRequestContext<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>>(schemaValidator: SV): ForklaunchSchemaMiddlewareHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj>;
|
15
16
|
/**
|
16
17
|
* Middleware to enrich the request details with contract details.
|
17
18
|
*
|
@@ -22,7 +23,7 @@ export declare function createRequestContext<SV extends AnySchemaValidator, Requ
|
|
22
23
|
* @param {PathParamHttpContractDetails<SV> | HttpContractDetails<SV>} contractDetails - The contract details.
|
23
24
|
* @returns {Function} - Middleware function to enrich request details.
|
24
25
|
*/
|
25
|
-
export declare function enrichRequestDetails<SV extends AnySchemaValidator,
|
26
|
+
export declare function enrichRequestDetails<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>>(contractDetails: PathParamHttpContractDetails<SV, P, ResBodyMap, ReqQuery, ReqHeaders, ResHeaders> | HttpContractDetails<SV, P, ResBodyMap, ReqQuery, ReqHeaders, ResHeaders>): ForklaunchSchemaMiddlewareHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj>;
|
26
27
|
/**
|
27
28
|
* Pre-handler function to parse and validate input.
|
28
29
|
*
|
@@ -44,7 +45,7 @@ export declare function preHandlerParse<SV extends AnySchemaValidator>(schemaVal
|
|
44
45
|
* @param {Response} res - The response object.
|
45
46
|
* @param {NextFunction} [next] - The next middleware function.
|
46
47
|
*/
|
47
|
-
export declare function parseRequestParams<SV extends AnySchemaValidator,
|
48
|
+
export declare function parseRequestParams<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;
|
48
49
|
/**
|
49
50
|
* Middleware to parse request body.
|
50
51
|
*
|
@@ -56,7 +57,7 @@ export declare function parseRequestParams<SV extends AnySchemaValidator, Reques
|
|
56
57
|
* @param {Response} res - The response object.
|
57
58
|
* @param {NextFunction} [next] - The next middleware function.
|
58
59
|
*/
|
59
|
-
export declare function parseRequestBody<SV extends AnySchemaValidator,
|
60
|
+
export declare function parseRequestBody<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;
|
60
61
|
/**
|
61
62
|
* Middleware to parse request headers.
|
62
63
|
*
|
@@ -68,7 +69,7 @@ export declare function parseRequestBody<SV extends AnySchemaValidator, Request
|
|
68
69
|
* @param {Response} res - The response object.
|
69
70
|
* @param {NextFunction} [next] - The next middleware function.
|
70
71
|
*/
|
71
|
-
export declare function
|
72
|
+
export declare function parseReqHeaders<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;
|
72
73
|
/**
|
73
74
|
* Middleware to parse request query.
|
74
75
|
*
|
@@ -80,7 +81,7 @@ export declare function parseRequestHeaders<SV extends AnySchemaValidator, Reque
|
|
80
81
|
* @param {Response} res - The response object.
|
81
82
|
* @param {NextFunction} [next] - The next middleware function.
|
82
83
|
*/
|
83
|
-
export declare function parseRequestQuery<SV extends AnySchemaValidator,
|
84
|
+
export declare function parseRequestQuery<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;
|
84
85
|
/**
|
85
86
|
* Maps roles from authorization.
|
86
87
|
*
|
@@ -106,4 +107,5 @@ export declare function parseRequestQuery<SV extends AnySchemaValidator, Request
|
|
106
107
|
* @param {Response} res - The response object.
|
107
108
|
* @param {NextFunction} [next] - The next middleware function.
|
108
109
|
*/
|
109
|
-
export declare function parseRequestAuth<SV extends AnySchemaValidator,
|
110
|
+
export declare function parseRequestAuth<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): Promise<void>;
|
111
|
+
//# sourceMappingURL=request.middleware.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"request.middleware.d.ts","sourceRoot":"","sources":["../../../http/middleware/request.middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAE9B,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,iCAAiC,EAClC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,IAAI,EACJ,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,4BAA4B,EAC5B,WAAW,EACX,eAAe,EACf,gBAAgB,EACjB,MAAM,0BAA0B,CAAC;AAElC;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,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,eAAe,EAAE,EAAE,GAClB,iCAAiC,CAClC,EAAE,EACF,CAAC,EACD,UAAU,EACV,OAAO,EACP,QAAQ,EACR,UAAU,EACV,UAAU,EACV,SAAS,CACV,CAoBA;AAED;;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