exisjs 0.7.6 → 0.7.8
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/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +12 -0
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/clean.d.ts +5 -0
- package/dist/cli/commands/clean.d.ts.map +1 -0
- package/dist/cli/commands/clean.js +30 -0
- package/dist/cli/commands/clean.js.map +1 -0
- package/dist/cli/commands/dev.d.ts.map +1 -1
- package/dist/cli/commands/dev.js +15 -1
- package/dist/cli/commands/dev.js.map +1 -1
- package/dist/cli/commands/generate.d.ts +6 -1
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +57 -2
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/index.js +16 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/manifest.d.ts +1 -0
- package/dist/cli/manifest.d.ts.map +1 -1
- package/dist/cli/manifest.js +161 -23
- package/dist/cli/manifest.js.map +1 -1
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +9 -0
- package/dist/config/config.js.map +1 -1
- package/dist/config/types.d.ts +4 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/cron/expressions.d.ts +45 -0
- package/dist/cron/expressions.d.ts.map +1 -0
- package/dist/cron/expressions.js +87 -0
- package/dist/cron/expressions.js.map +1 -0
- package/dist/cron/index.d.ts +6 -0
- package/dist/cron/index.d.ts.map +1 -0
- package/dist/cron/index.js +22 -0
- package/dist/cron/index.js.map +1 -0
- package/dist/cron/job.d.ts +50 -0
- package/dist/cron/job.d.ts.map +1 -0
- package/dist/cron/job.js +247 -0
- package/dist/cron/job.js.map +1 -0
- package/dist/cron/manager.d.ts +105 -0
- package/dist/cron/manager.d.ts.map +1 -0
- package/dist/cron/manager.js +245 -0
- package/dist/cron/manager.js.map +1 -0
- package/dist/cron/parser.d.ts +22 -0
- package/dist/cron/parser.d.ts.map +1 -0
- package/dist/cron/parser.js +269 -0
- package/dist/cron/parser.js.map +1 -0
- package/dist/cron/types.d.ts +76 -0
- package/dist/cron/types.d.ts.map +1 -0
- package/dist/cron/types.js +3 -0
- package/dist/cron/types.js.map +1 -0
- package/dist/decorators/constants.d.ts +2 -0
- package/dist/decorators/constants.d.ts.map +1 -1
- package/dist/decorators/constants.js +3 -1
- package/dist/decorators/constants.js.map +1 -1
- package/dist/decorators/core.d.ts +29 -11
- package/dist/decorators/core.d.ts.map +1 -1
- package/dist/decorators/core.js +49 -11
- package/dist/decorators/core.js.map +1 -1
- package/dist/decorators/cron.d.ts +57 -0
- package/dist/decorators/cron.d.ts.map +1 -0
- package/dist/decorators/cron.js +143 -0
- package/dist/decorators/cron.js.map +1 -0
- package/dist/decorators/index.d.ts +2 -0
- package/dist/decorators/index.d.ts.map +1 -1
- package/dist/decorators/index.js +2 -0
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/params.d.ts +97 -2
- package/dist/decorators/params.d.ts.map +1 -1
- package/dist/decorators/params.js +94 -2
- package/dist/decorators/params.js.map +1 -1
- package/dist/decorators/routing.d.ts +81 -16
- package/dist/decorators/routing.d.ts.map +1 -1
- package/dist/decorators/routing.js +81 -16
- package/dist/decorators/routing.js.map +1 -1
- package/dist/docs/content/cron.mdx +196 -0
- package/dist/docs/content/errors.mdx +58 -9
- package/dist/docs/content/structure.mdx +1 -1
- package/dist/docs/content/swagger.mdx +289 -0
- package/dist/docs/reference/cron.mdx +300 -0
- package/dist/docs/reference/decorators.mdx +8 -0
- package/dist/docs/reference/error.mdx +44 -0
- package/dist/docs/reference/swagger.mdx +226 -0
- package/dist/docs/reference/validator.mdx +1 -1
- package/dist/router/boundary.d.ts +24 -2
- package/dist/router/boundary.d.ts.map +1 -1
- package/dist/router/boundary.js +24 -2
- package/dist/router/boundary.js.map +1 -1
- package/dist/router/controller-registrar.d.ts.map +1 -1
- package/dist/router/controller-registrar.js +52 -3
- package/dist/router/controller-registrar.js.map +1 -1
- package/dist/router/route-builder.d.ts +196 -33
- package/dist/router/route-builder.d.ts.map +1 -1
- package/dist/router/route-builder.js +171 -11
- package/dist/router/route-builder.js.map +1 -1
- package/dist/router/route-scanner.d.ts +6 -0
- package/dist/router/route-scanner.d.ts.map +1 -1
- package/dist/router/route-scanner.js +69 -812
- package/dist/router/route-scanner.js.map +1 -1
- package/dist/router/router.d.ts.map +1 -1
- package/dist/router/router.js +27 -0
- package/dist/router/router.js.map +1 -1
- package/dist/router/scanner/boundary-loader.d.ts +18 -0
- package/dist/router/scanner/boundary-loader.d.ts.map +1 -0
- package/dist/router/scanner/boundary-loader.js +539 -0
- package/dist/router/scanner/boundary-loader.js.map +1 -0
- package/dist/router/scanner/cron-mounter.d.ts +15 -0
- package/dist/router/scanner/cron-mounter.d.ts.map +1 -0
- package/dist/router/scanner/cron-mounter.js +216 -0
- package/dist/router/scanner/cron-mounter.js.map +1 -0
- package/dist/router/scanner/error-mounter.d.ts +14 -0
- package/dist/router/scanner/error-mounter.d.ts.map +1 -0
- package/dist/router/scanner/error-mounter.js +200 -0
- package/dist/router/scanner/error-mounter.js.map +1 -0
- package/dist/router/scanner/fs-scanner.d.ts +25 -0
- package/dist/router/scanner/fs-scanner.d.ts.map +1 -0
- package/dist/router/scanner/fs-scanner.js +115 -0
- package/dist/router/scanner/fs-scanner.js.map +1 -0
- package/dist/router/scanner/functional-compiler.d.ts +9 -0
- package/dist/router/scanner/functional-compiler.d.ts.map +1 -0
- package/dist/router/scanner/functional-compiler.js +233 -0
- package/dist/router/scanner/functional-compiler.js.map +1 -0
- package/dist/router/scanner/index.d.ts +9 -0
- package/dist/router/scanner/index.d.ts.map +1 -0
- package/dist/router/scanner/index.js +19 -0
- package/dist/router/scanner/index.js.map +1 -0
- package/dist/router/types.d.ts +15 -0
- package/dist/router/types.d.ts.map +1 -1
- package/dist/server/app.d.ts +2 -0
- package/dist/server/app.d.ts.map +1 -1
- package/dist/server/app.js +3 -0
- package/dist/server/app.js.map +1 -1
- package/dist/server/helpers/body-parser.d.ts +18 -0
- package/dist/server/helpers/body-parser.d.ts.map +1 -0
- package/dist/server/helpers/body-parser.js +246 -0
- package/dist/server/helpers/body-parser.js.map +1 -0
- package/dist/server/helpers/cookie.d.ts +4 -0
- package/dist/server/helpers/cookie.d.ts.map +1 -0
- package/dist/server/helpers/cookie.js +61 -0
- package/dist/server/helpers/cookie.js.map +1 -0
- package/dist/server/helpers/etag.d.ts +3 -0
- package/dist/server/helpers/etag.d.ts.map +1 -0
- package/dist/server/helpers/etag.js +25 -0
- package/dist/server/helpers/etag.js.map +1 -0
- package/dist/server/helpers/index.d.ts +6 -0
- package/dist/server/helpers/index.d.ts.map +1 -0
- package/dist/server/helpers/index.js +21 -0
- package/dist/server/helpers/index.js.map +1 -0
- package/dist/server/helpers/ip.d.ts +9 -0
- package/dist/server/helpers/ip.d.ts.map +1 -0
- package/dist/server/helpers/ip.js +62 -0
- package/dist/server/helpers/ip.js.map +1 -0
- package/dist/server/helpers/stream.d.ts +4 -0
- package/dist/server/helpers/stream.d.ts.map +1 -0
- package/dist/server/helpers/stream.js +193 -0
- package/dist/server/helpers/stream.js.map +1 -0
- package/dist/server/request.d.ts +1 -139
- package/dist/server/request.d.ts.map +1 -1
- package/dist/server/request.js +19 -433
- package/dist/server/request.js.map +1 -1
- package/dist/server/response.d.ts +105 -158
- package/dist/server/response.d.ts.map +1 -1
- package/dist/server/response.js +121 -423
- package/dist/server/response.js.map +1 -1
- package/dist/swagger/decorators.d.ts +81 -0
- package/dist/swagger/decorators.d.ts.map +1 -0
- package/dist/swagger/decorators.js +172 -0
- package/dist/swagger/decorators.js.map +1 -0
- package/dist/swagger/generator.d.ts +19 -0
- package/dist/swagger/generator.d.ts.map +1 -0
- package/dist/swagger/generator.js +344 -0
- package/dist/swagger/generator.js.map +1 -0
- package/dist/swagger/index.d.ts +31 -0
- package/dist/swagger/index.d.ts.map +1 -0
- package/dist/swagger/index.js +53 -0
- package/dist/swagger/index.js.map +1 -0
- package/dist/swagger/mounter.d.ts +7 -0
- package/dist/swagger/mounter.d.ts.map +1 -0
- package/dist/swagger/mounter.js +56 -0
- package/dist/swagger/mounter.js.map +1 -0
- package/dist/swagger/types.d.ts +190 -0
- package/dist/swagger/types.d.ts.map +1 -0
- package/dist/swagger/types.js +3 -0
- package/dist/swagger/types.js.map +1 -0
- package/dist/swagger/ui.d.ts +6 -0
- package/dist/swagger/ui.d.ts.map +1 -0
- package/dist/swagger/ui.js +118 -0
- package/dist/swagger/ui.js.map +1 -0
- package/dist/validator/builder.d.ts +223 -0
- package/dist/validator/builder.d.ts.map +1 -0
- package/dist/validator/builder.js +517 -0
- package/dist/validator/builder.js.map +1 -0
- package/dist/validator/engine.d.ts +19 -0
- package/dist/validator/engine.d.ts.map +1 -0
- package/dist/validator/engine.js +568 -0
- package/dist/validator/engine.js.map +1 -0
- package/dist/validator/error.d.ts +12 -0
- package/dist/validator/error.d.ts.map +1 -0
- package/dist/validator/error.js +63 -0
- package/dist/validator/error.js.map +1 -0
- package/dist/validator/pagination.d.ts +40 -0
- package/dist/validator/pagination.d.ts.map +1 -0
- package/dist/validator/pagination.js +60 -0
- package/dist/validator/pagination.js.map +1 -0
- package/dist/validator/tex.d.ts +6 -158
- package/dist/validator/tex.d.ts.map +1 -1
- package/dist/validator/tex.js +14 -971
- package/dist/validator/tex.js.map +1 -1
- package/dist/validator/types.d.ts +83 -0
- package/dist/validator/types.d.ts.map +1 -0
- package/dist/validator/types.js +3 -0
- package/dist/validator/types.js.map +1 -0
- package/package.json +9 -1
|
@@ -3,22 +3,43 @@ import type { App } from '../server/app';
|
|
|
3
3
|
/**
|
|
4
4
|
* Creates a strongly typed middleware that injects context into downstream routes or boundaries.
|
|
5
5
|
*
|
|
6
|
+
* @template TContext The custom request context type produced by this middleware
|
|
7
|
+
* @param fn Middleware function receiving `(req, res, next)`
|
|
8
|
+
* @returns Strongly typed middleware handler
|
|
9
|
+
*
|
|
6
10
|
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* interface AuthContext {
|
|
13
|
+
* user: { id: string; role: string }
|
|
14
|
+
* }
|
|
15
|
+
*
|
|
7
16
|
* const authenticate = defineMiddleware<AuthContext>(async (req, res, next) => {
|
|
8
17
|
* req.user = { id: '123', role: 'admin' }
|
|
9
18
|
* next()
|
|
10
19
|
* })
|
|
20
|
+
* ```
|
|
11
21
|
*/
|
|
12
22
|
export declare function defineMiddleware<TContext = Record<string, any>>(fn: (req: Request<any, any, any, TContext>, res: Response, next: import('../types').NextFunction) => any | Promise<any>): Handler<any, any, any, any, TContext>;
|
|
13
23
|
/**
|
|
14
24
|
* The execution context passed to every route handler.
|
|
15
25
|
* It provides fully-typed, structured access to the request's properties and the ExisJS app.
|
|
16
26
|
*
|
|
27
|
+
* @template B Parsed request body type
|
|
28
|
+
* @template Q Parsed query string type
|
|
29
|
+
* @template P Parsed route params type
|
|
30
|
+
* @template TContext Custom injected context type
|
|
31
|
+
*
|
|
17
32
|
* @example
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* }
|
|
33
|
+
* ```ts
|
|
34
|
+
* export default controller({
|
|
35
|
+
* getUser: route.get('/:id', {
|
|
36
|
+
* async handle({ params, req, res, resolve }) {
|
|
37
|
+
* const userService = resolve(UserService)
|
|
38
|
+
* return userService.findById(params.id)
|
|
39
|
+
* }
|
|
40
|
+
* })
|
|
41
|
+
* })
|
|
42
|
+
* ```
|
|
22
43
|
*/
|
|
23
44
|
export type SuperContext<B = any, Q = any, P = any, TContext = Record<string, any>> = {
|
|
24
45
|
body: B;
|
|
@@ -35,22 +56,6 @@ export type SuperContext<B = any, Q = any, P = any, TContext = Record<string, an
|
|
|
35
56
|
fields?: Record<string, any>;
|
|
36
57
|
[key: string]: any;
|
|
37
58
|
} & TContext;
|
|
38
|
-
/**
|
|
39
|
-
* Configuration options for an individual route.
|
|
40
|
-
* You can define expected schemas (body, query, params, response),
|
|
41
|
-
* apply route-specific middleware, and write your business logic in `handle`.
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* export default controller({
|
|
45
|
-
* createUser: route.post('/users', {
|
|
46
|
-
* body: tex.object({ email: tex.string(), password: tex.string() }),
|
|
47
|
-
* middleware: [rateLimiter],
|
|
48
|
-
* async handle({ body }) {
|
|
49
|
-
* return { token: '...' }
|
|
50
|
-
* }
|
|
51
|
-
* })
|
|
52
|
-
* })
|
|
53
|
-
*/
|
|
54
59
|
/**
|
|
55
60
|
* Extracts route parameter names from a path string literal (e.g. '/users/:id/posts/:postId' -> { id: string; postId: string }).
|
|
56
61
|
*/
|
|
@@ -85,52 +90,183 @@ export type RouteDefinition<B = any, Q = any, P = any, TContext = Record<string,
|
|
|
85
90
|
};
|
|
86
91
|
};
|
|
87
92
|
/**
|
|
88
|
-
*
|
|
93
|
+
* Declarative route builder with schema validation, typed parameters, and supercharged context.
|
|
89
94
|
*/
|
|
90
95
|
export declare const route: {
|
|
91
96
|
/**
|
|
92
|
-
* Defines
|
|
97
|
+
* Defines an HTTP GET route definition.
|
|
98
|
+
*
|
|
99
|
+
* @param path The route URL path (e.g. `'/'` or `'/:id'`)
|
|
100
|
+
* @param config Route configuration with query/params schemas, middleware, and handler
|
|
101
|
+
* @returns Strongly typed `RouteDefinition`
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* import { controller, route } from 'exisjs/router'
|
|
106
|
+
* import { tex } from 'exisjs/validator'
|
|
107
|
+
*
|
|
108
|
+
* export default controller({
|
|
109
|
+
* getUser: route.get('/:id', {
|
|
110
|
+
* params: { id: tex.string() },
|
|
111
|
+
* async handle({ params }) {
|
|
112
|
+
* return { id: params.id, name: 'Alice' }
|
|
113
|
+
* }
|
|
114
|
+
* })
|
|
115
|
+
* })
|
|
116
|
+
* ```
|
|
93
117
|
*/
|
|
94
118
|
get: <TPath extends string = string, B = unknown, Q = Record<string, string>, P = ExtractRouteParams<TPath>, TMid = undefined, TContext = TMid extends undefined ? Record<string, any> : ExtractContextFromMiddlewares<TMid>, TReturn = any>(path: TPath, config: RouteConfig<B, Q, P, TContext, TReturn> & {
|
|
95
119
|
middleware?: TMid;
|
|
96
120
|
middlewares?: TMid;
|
|
97
121
|
}) => RouteDefinition<B, Q, P, TContext, TReturn>;
|
|
122
|
+
/**
|
|
123
|
+
* Defines an HTTP POST route definition.
|
|
124
|
+
*
|
|
125
|
+
* @param path The route URL path (e.g. `'/'` or `'/submit'`)
|
|
126
|
+
* @param config Route configuration with body schema, middleware, and handler
|
|
127
|
+
* @returns Strongly typed `RouteDefinition`
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```ts
|
|
131
|
+
* import { controller, route } from 'exisjs/router'
|
|
132
|
+
* import { tex } from 'exisjs/validator'
|
|
133
|
+
*
|
|
134
|
+
* export default controller({
|
|
135
|
+
* createUser: route.post('/', {
|
|
136
|
+
* body: tex.object({
|
|
137
|
+
* email: tex.email(),
|
|
138
|
+
* password: tex.password({ min: 8 })
|
|
139
|
+
* }),
|
|
140
|
+
* async handle({ body, res }) {
|
|
141
|
+
* res.status(201)
|
|
142
|
+
* return { email: body.email, created: true }
|
|
143
|
+
* }
|
|
144
|
+
* })
|
|
145
|
+
* })
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
98
148
|
post: <TPath extends string = string, B = unknown, Q = Record<string, string>, P = ExtractRouteParams<TPath>, TMid = undefined, TContext = TMid extends undefined ? Record<string, any> : ExtractContextFromMiddlewares<TMid>, TReturn = any>(path: TPath, config: RouteConfig<B, Q, P, TContext, TReturn> & {
|
|
99
149
|
middleware?: TMid;
|
|
100
150
|
middlewares?: TMid;
|
|
101
151
|
}) => RouteDefinition<B, Q, P, TContext, TReturn>;
|
|
152
|
+
/**
|
|
153
|
+
* Defines an HTTP PUT route definition.
|
|
154
|
+
*
|
|
155
|
+
* @param path The route URL path (e.g. `'/:id'`)
|
|
156
|
+
* @param config Route configuration with body/params schemas and handler
|
|
157
|
+
* @returns Strongly typed `RouteDefinition`
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```ts
|
|
161
|
+
* import { controller, route } from 'exisjs/router'
|
|
162
|
+
* import { tex } from 'exisjs/validator'
|
|
163
|
+
*
|
|
164
|
+
* export default controller({
|
|
165
|
+
* updateUser: route.put('/:id', {
|
|
166
|
+
* body: tex.object({ name: tex.string() }),
|
|
167
|
+
* async handle({ params, body }) {
|
|
168
|
+
* return { id: params.id, name: body.name }
|
|
169
|
+
* }
|
|
170
|
+
* })
|
|
171
|
+
* })
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
102
174
|
put: <TPath extends string = string, B = unknown, Q = Record<string, string>, P = ExtractRouteParams<TPath>, TMid = undefined, TContext = TMid extends undefined ? Record<string, any> : ExtractContextFromMiddlewares<TMid>, TReturn = any>(path: TPath, config: RouteConfig<B, Q, P, TContext, TReturn> & {
|
|
103
175
|
middleware?: TMid;
|
|
104
176
|
middlewares?: TMid;
|
|
105
177
|
}) => RouteDefinition<B, Q, P, TContext, TReturn>;
|
|
178
|
+
/**
|
|
179
|
+
* Defines an HTTP DELETE route definition.
|
|
180
|
+
*
|
|
181
|
+
* @param path The route URL path (e.g. `'/:id'`)
|
|
182
|
+
* @param config Route configuration with params schema and handler
|
|
183
|
+
* @returns Strongly typed `RouteDefinition`
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```ts
|
|
187
|
+
* import { controller, route } from 'exisjs/router'
|
|
188
|
+
*
|
|
189
|
+
* export default controller({
|
|
190
|
+
* deleteUser: route.delete('/:id', {
|
|
191
|
+
* async handle({ params }) {
|
|
192
|
+
* return { deleted: params.id }
|
|
193
|
+
* }
|
|
194
|
+
* })
|
|
195
|
+
* })
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
106
198
|
delete: <TPath extends string = string, B = unknown, Q = Record<string, string>, P = ExtractRouteParams<TPath>, TMid = undefined, TContext = TMid extends undefined ? Record<string, any> : ExtractContextFromMiddlewares<TMid>, TReturn = any>(path: TPath, config: RouteConfig<B, Q, P, TContext, TReturn> & {
|
|
107
199
|
middleware?: TMid;
|
|
108
200
|
middlewares?: TMid;
|
|
109
201
|
}) => RouteDefinition<B, Q, P, TContext, TReturn>;
|
|
202
|
+
/**
|
|
203
|
+
* Defines an HTTP PATCH route definition.
|
|
204
|
+
*
|
|
205
|
+
* @param path The route URL path (e.g. `'/:id'`)
|
|
206
|
+
* @param config Route configuration with partial body schema and handler
|
|
207
|
+
* @returns Strongly typed `RouteDefinition`
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* ```ts
|
|
211
|
+
* import { controller, route } from 'exisjs/router'
|
|
212
|
+
* import { tex } from 'exisjs/validator'
|
|
213
|
+
*
|
|
214
|
+
* export default controller({
|
|
215
|
+
* patchUser: route.patch('/:id', {
|
|
216
|
+
* body: tex.object({ status: tex.enum(['active', 'disabled']) }),
|
|
217
|
+
* async handle({ params, body }) {
|
|
218
|
+
* return { id: params.id, status: body.status }
|
|
219
|
+
* }
|
|
220
|
+
* })
|
|
221
|
+
* })
|
|
222
|
+
* ```
|
|
223
|
+
*/
|
|
110
224
|
patch: <TPath extends string = string, B = unknown, Q = Record<string, string>, P = ExtractRouteParams<TPath>, TMid = undefined, TContext = TMid extends undefined ? Record<string, any> : ExtractContextFromMiddlewares<TMid>, TReturn = any>(path: TPath, config: RouteConfig<B, Q, P, TContext, TReturn> & {
|
|
111
225
|
middleware?: TMid;
|
|
112
226
|
middlewares?: TMid;
|
|
113
227
|
}) => RouteDefinition<B, Q, P, TContext, TReturn>;
|
|
228
|
+
/**
|
|
229
|
+
* Defines an HTTP OPTIONS route definition.
|
|
230
|
+
*/
|
|
114
231
|
options: <TPath extends string = string, B = unknown, Q = Record<string, string>, P = ExtractRouteParams<TPath>, TMid = undefined, TContext = TMid extends undefined ? Record<string, any> : ExtractContextFromMiddlewares<TMid>, TReturn = any>(path: TPath, config: RouteConfig<B, Q, P, TContext, TReturn> & {
|
|
115
232
|
middleware?: TMid;
|
|
116
233
|
middlewares?: TMid;
|
|
117
234
|
}) => RouteDefinition<B, Q, P, TContext, TReturn>;
|
|
235
|
+
/**
|
|
236
|
+
* Defines an HTTP HEAD route definition.
|
|
237
|
+
*/
|
|
118
238
|
head: <TPath extends string = string, B = unknown, Q = Record<string, string>, P = ExtractRouteParams<TPath>, TMid = undefined, TContext = TMid extends undefined ? Record<string, any> : ExtractContextFromMiddlewares<TMid>, TReturn = any>(path: TPath, config: RouteConfig<B, Q, P, TContext, TReturn> & {
|
|
119
239
|
middleware?: TMid;
|
|
120
240
|
middlewares?: TMid;
|
|
121
241
|
}) => RouteDefinition<B, Q, P, TContext, TReturn>;
|
|
242
|
+
/**
|
|
243
|
+
* Defines an HTTP CONNECT route definition.
|
|
244
|
+
*/
|
|
122
245
|
connect: <TPath extends string = string, B = unknown, Q = Record<string, string>, P = ExtractRouteParams<TPath>, TMid = undefined, TContext = TMid extends undefined ? Record<string, any> : ExtractContextFromMiddlewares<TMid>, TReturn = any>(path: TPath, config: RouteConfig<B, Q, P, TContext, TReturn> & {
|
|
123
246
|
middleware?: TMid;
|
|
124
247
|
middlewares?: TMid;
|
|
125
248
|
}) => RouteDefinition<B, Q, P, TContext, TReturn>;
|
|
249
|
+
/**
|
|
250
|
+
* Defines an HTTP TRACE route definition.
|
|
251
|
+
*/
|
|
126
252
|
trace: <TPath extends string = string, B = unknown, Q = Record<string, string>, P = ExtractRouteParams<TPath>, TMid = undefined, TContext = TMid extends undefined ? Record<string, any> : ExtractContextFromMiddlewares<TMid>, TReturn = any>(path: TPath, config: RouteConfig<B, Q, P, TContext, TReturn> & {
|
|
127
253
|
middleware?: TMid;
|
|
128
254
|
middlewares?: TMid;
|
|
129
255
|
}) => RouteDefinition<B, Q, P, TContext, TReturn>;
|
|
256
|
+
/**
|
|
257
|
+
* Defines a QUERY route definition.
|
|
258
|
+
*/
|
|
130
259
|
query: <TPath extends string = string, B = unknown, Q = Record<string, string>, P = ExtractRouteParams<TPath>, TMid = undefined, TContext = TMid extends undefined ? Record<string, any> : ExtractContextFromMiddlewares<TMid>, TReturn = any>(path: TPath, config: RouteConfig<B, Q, P, TContext, TReturn> & {
|
|
131
260
|
middleware?: TMid;
|
|
132
261
|
middlewares?: TMid;
|
|
133
262
|
}) => RouteDefinition<B, Q, P, TContext, TReturn>;
|
|
263
|
+
/**
|
|
264
|
+
* Defines a route matching any HTTP method (GET, POST, PUT, DELETE, PATCH, etc.).
|
|
265
|
+
*
|
|
266
|
+
* @param path The route URL path (e.g. `'*'` or `'/api/*'`)
|
|
267
|
+
* @param config Route configuration and handler
|
|
268
|
+
* @returns Strongly typed `RouteDefinition`
|
|
269
|
+
*/
|
|
134
270
|
all: <TPath extends string = string, B = unknown, Q = Record<string, string>, P = ExtractRouteParams<TPath>, TMid = undefined, TContext = TMid extends undefined ? Record<string, any> : ExtractContextFromMiddlewares<TMid>, TReturn = any>(path: TPath, config: RouteConfig<B, Q, P, TContext, TReturn> & {
|
|
135
271
|
middleware?: TMid;
|
|
136
272
|
middlewares?: TMid;
|
|
@@ -141,13 +277,21 @@ export declare const route: {
|
|
|
141
277
|
* Any middleware or CORS settings defined here will automatically wrap all routes in the file.
|
|
142
278
|
*
|
|
143
279
|
* @example
|
|
280
|
+
* ```ts
|
|
281
|
+
* import { controller, route } from 'exisjs/router'
|
|
282
|
+
*
|
|
144
283
|
* export default controller({
|
|
145
284
|
* cors: true,
|
|
146
285
|
* middleware: [authGuard],
|
|
147
|
-
* onError: (err, req, res) => { console.
|
|
286
|
+
* onError: (err, req, res) => { console.error(err) },
|
|
148
287
|
*
|
|
149
|
-
* myRoute: route.get('/secret', {
|
|
288
|
+
* myRoute: route.get('/secret', {
|
|
289
|
+
* async handle() {
|
|
290
|
+
* return { secret: 'data' }
|
|
291
|
+
* }
|
|
292
|
+
* })
|
|
150
293
|
* })
|
|
294
|
+
* ```
|
|
151
295
|
*/
|
|
152
296
|
export interface ControllerConfig {
|
|
153
297
|
cors?: any;
|
|
@@ -159,32 +303,51 @@ export interface ControllerConfig {
|
|
|
159
303
|
[key: string]: any;
|
|
160
304
|
}
|
|
161
305
|
/**
|
|
162
|
-
* Creates a route controller.
|
|
163
|
-
*
|
|
306
|
+
* Creates a route controller in a `route.ts` file. Binds multiple routes together, sharing middleware,
|
|
307
|
+
* lifecycle hooks, and error handling with zero boilerplate.
|
|
308
|
+
*
|
|
309
|
+
* @param config Controller configuration containing route definitions and shared settings
|
|
310
|
+
* @returns Fully compiled functional controller
|
|
164
311
|
*
|
|
165
312
|
* @example
|
|
313
|
+
* ```ts
|
|
314
|
+
* // src/http/users/route.ts
|
|
315
|
+
* import { controller, route } from 'exisjs/router'
|
|
316
|
+
* import { tex } from 'exisjs/validator'
|
|
317
|
+
*
|
|
166
318
|
* export default controller({
|
|
167
319
|
* cors: true,
|
|
168
|
-
*
|
|
169
|
-
* handle(
|
|
320
|
+
* listUsers: route.get('/', {
|
|
321
|
+
* async handle() {
|
|
170
322
|
* return { users: [] }
|
|
171
323
|
* }
|
|
324
|
+
* }),
|
|
325
|
+
* createUser: route.post('/', {
|
|
326
|
+
* body: tex.object({ name: tex.string() }),
|
|
327
|
+
* async handle({ body }) {
|
|
328
|
+
* return { created: body.name }
|
|
329
|
+
* }
|
|
172
330
|
* })
|
|
173
331
|
* })
|
|
332
|
+
* ```
|
|
174
333
|
*/
|
|
175
334
|
export declare function controller<T extends ControllerConfig>(config: T): T & {
|
|
176
335
|
__isController: true;
|
|
177
336
|
};
|
|
178
337
|
/**
|
|
179
|
-
* Creates a strongly-typed router and controller factory.
|
|
180
|
-
*
|
|
338
|
+
* Creates a strongly-typed router and controller factory with pre-bound context.
|
|
339
|
+
*
|
|
340
|
+
* @template TContext Global request context type for the router instance
|
|
341
|
+
* @returns Object with typed `route` and `controller` factories
|
|
181
342
|
*
|
|
182
343
|
* @example
|
|
344
|
+
* ```ts
|
|
183
345
|
* interface MyContext {
|
|
184
|
-
* user:
|
|
185
|
-
* workspace: Workspace;
|
|
346
|
+
* user: { id: string; role: string }
|
|
186
347
|
* }
|
|
187
|
-
*
|
|
348
|
+
*
|
|
349
|
+
* export const { route, controller } = createRouter<MyContext>()
|
|
350
|
+
* ```
|
|
188
351
|
*/
|
|
189
352
|
export declare function createRouter<TContext = Record<string, any>>(): {
|
|
190
353
|
route: typeof route & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-builder.d.ts","sourceRoot":"","sources":["../../src/router/route-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,OAAO,EACP,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,6BAA6B,EAC9B,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAGxC
|
|
1
|
+
{"version":3,"file":"route-builder.d.ts","sourceRoot":"","sources":["../../src/router/route-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,OAAO,EACP,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,6BAA6B,EAC9B,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAGxC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7D,EAAE,EAAE,CACF,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,EACrC,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,OAAO,UAAU,EAAE,YAAY,KAClC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,GACtB,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,CAEvC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,YA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,CAAC,GAAG,GAAG,EACP,CAAC,GAAG,GAAG,EACP,CAAC,GAAG,kBAAkB,CAAC,KAAK,CAAC,EAC7B,OAAO,GAAG,GAAG,EAEb,IAAI,EAAE,KAAK,EACX,MAAM,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,KAC5C,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;KACjD;iBACY,CAAC,SAAS,gBAAgB,UAC7B,CAAC,KACR,CAAC,GAAG;QAAE,cAAc,EAAE,IAAI,CAAA;KAAE;EAElC"}
|
|
@@ -8,21 +8,50 @@ const logger_1 = require("../logger");
|
|
|
8
8
|
/**
|
|
9
9
|
* Creates a strongly typed middleware that injects context into downstream routes or boundaries.
|
|
10
10
|
*
|
|
11
|
+
* @template TContext The custom request context type produced by this middleware
|
|
12
|
+
* @param fn Middleware function receiving `(req, res, next)`
|
|
13
|
+
* @returns Strongly typed middleware handler
|
|
14
|
+
*
|
|
11
15
|
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* interface AuthContext {
|
|
18
|
+
* user: { id: string; role: string }
|
|
19
|
+
* }
|
|
20
|
+
*
|
|
12
21
|
* const authenticate = defineMiddleware<AuthContext>(async (req, res, next) => {
|
|
13
22
|
* req.user = { id: '123', role: 'admin' }
|
|
14
23
|
* next()
|
|
15
24
|
* })
|
|
25
|
+
* ```
|
|
16
26
|
*/
|
|
17
27
|
function defineMiddleware(fn) {
|
|
18
28
|
return fn;
|
|
19
29
|
}
|
|
20
30
|
/**
|
|
21
|
-
*
|
|
31
|
+
* Declarative route builder with schema validation, typed parameters, and supercharged context.
|
|
22
32
|
*/
|
|
23
33
|
exports.route = {
|
|
24
34
|
/**
|
|
25
|
-
* Defines
|
|
35
|
+
* Defines an HTTP GET route definition.
|
|
36
|
+
*
|
|
37
|
+
* @param path The route URL path (e.g. `'/'` or `'/:id'`)
|
|
38
|
+
* @param config Route configuration with query/params schemas, middleware, and handler
|
|
39
|
+
* @returns Strongly typed `RouteDefinition`
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* import { controller, route } from 'exisjs/router'
|
|
44
|
+
* import { tex } from 'exisjs/validator'
|
|
45
|
+
*
|
|
46
|
+
* export default controller({
|
|
47
|
+
* getUser: route.get('/:id', {
|
|
48
|
+
* params: { id: tex.string() },
|
|
49
|
+
* async handle({ params }) {
|
|
50
|
+
* return { id: params.id, name: 'Alice' }
|
|
51
|
+
* }
|
|
52
|
+
* })
|
|
53
|
+
* })
|
|
54
|
+
* ```
|
|
26
55
|
*/
|
|
27
56
|
get: (path, config) => {
|
|
28
57
|
if ('body' in config && config.body) {
|
|
@@ -30,30 +59,157 @@ exports.route = {
|
|
|
30
59
|
}
|
|
31
60
|
return { method: 'get', path, ...config };
|
|
32
61
|
},
|
|
62
|
+
/**
|
|
63
|
+
* Defines an HTTP POST route definition.
|
|
64
|
+
*
|
|
65
|
+
* @param path The route URL path (e.g. `'/'` or `'/submit'`)
|
|
66
|
+
* @param config Route configuration with body schema, middleware, and handler
|
|
67
|
+
* @returns Strongly typed `RouteDefinition`
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* import { controller, route } from 'exisjs/router'
|
|
72
|
+
* import { tex } from 'exisjs/validator'
|
|
73
|
+
*
|
|
74
|
+
* export default controller({
|
|
75
|
+
* createUser: route.post('/', {
|
|
76
|
+
* body: tex.object({
|
|
77
|
+
* email: tex.email(),
|
|
78
|
+
* password: tex.password({ min: 8 })
|
|
79
|
+
* }),
|
|
80
|
+
* async handle({ body, res }) {
|
|
81
|
+
* res.status(201)
|
|
82
|
+
* return { email: body.email, created: true }
|
|
83
|
+
* }
|
|
84
|
+
* })
|
|
85
|
+
* })
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
33
88
|
post: (path, config) => ({ method: 'post', path, ...config }),
|
|
89
|
+
/**
|
|
90
|
+
* Defines an HTTP PUT route definition.
|
|
91
|
+
*
|
|
92
|
+
* @param path The route URL path (e.g. `'/:id'`)
|
|
93
|
+
* @param config Route configuration with body/params schemas and handler
|
|
94
|
+
* @returns Strongly typed `RouteDefinition`
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```ts
|
|
98
|
+
* import { controller, route } from 'exisjs/router'
|
|
99
|
+
* import { tex } from 'exisjs/validator'
|
|
100
|
+
*
|
|
101
|
+
* export default controller({
|
|
102
|
+
* updateUser: route.put('/:id', {
|
|
103
|
+
* body: tex.object({ name: tex.string() }),
|
|
104
|
+
* async handle({ params, body }) {
|
|
105
|
+
* return { id: params.id, name: body.name }
|
|
106
|
+
* }
|
|
107
|
+
* })
|
|
108
|
+
* })
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
34
111
|
put: (path, config) => ({ method: 'put', path, ...config }),
|
|
112
|
+
/**
|
|
113
|
+
* Defines an HTTP DELETE route definition.
|
|
114
|
+
*
|
|
115
|
+
* @param path The route URL path (e.g. `'/:id'`)
|
|
116
|
+
* @param config Route configuration with params schema and handler
|
|
117
|
+
* @returns Strongly typed `RouteDefinition`
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* import { controller, route } from 'exisjs/router'
|
|
122
|
+
*
|
|
123
|
+
* export default controller({
|
|
124
|
+
* deleteUser: route.delete('/:id', {
|
|
125
|
+
* async handle({ params }) {
|
|
126
|
+
* return { deleted: params.id }
|
|
127
|
+
* }
|
|
128
|
+
* })
|
|
129
|
+
* })
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
35
132
|
delete: (path, config) => ({ method: 'delete', path, ...config }),
|
|
133
|
+
/**
|
|
134
|
+
* Defines an HTTP PATCH route definition.
|
|
135
|
+
*
|
|
136
|
+
* @param path The route URL path (e.g. `'/:id'`)
|
|
137
|
+
* @param config Route configuration with partial body schema and handler
|
|
138
|
+
* @returns Strongly typed `RouteDefinition`
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```ts
|
|
142
|
+
* import { controller, route } from 'exisjs/router'
|
|
143
|
+
* import { tex } from 'exisjs/validator'
|
|
144
|
+
*
|
|
145
|
+
* export default controller({
|
|
146
|
+
* patchUser: route.patch('/:id', {
|
|
147
|
+
* body: tex.object({ status: tex.enum(['active', 'disabled']) }),
|
|
148
|
+
* async handle({ params, body }) {
|
|
149
|
+
* return { id: params.id, status: body.status }
|
|
150
|
+
* }
|
|
151
|
+
* })
|
|
152
|
+
* })
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
36
155
|
patch: (path, config) => ({ method: 'patch', path, ...config }),
|
|
156
|
+
/**
|
|
157
|
+
* Defines an HTTP OPTIONS route definition.
|
|
158
|
+
*/
|
|
37
159
|
options: (path, config) => ({ method: 'options', path, ...config }),
|
|
160
|
+
/**
|
|
161
|
+
* Defines an HTTP HEAD route definition.
|
|
162
|
+
*/
|
|
38
163
|
head: (path, config) => ({ method: 'head', path, ...config }),
|
|
164
|
+
/**
|
|
165
|
+
* Defines an HTTP CONNECT route definition.
|
|
166
|
+
*/
|
|
39
167
|
connect: (path, config) => ({ method: 'connect', path, ...config }),
|
|
168
|
+
/**
|
|
169
|
+
* Defines an HTTP TRACE route definition.
|
|
170
|
+
*/
|
|
40
171
|
trace: (path, config) => ({ method: 'trace', path, ...config }),
|
|
172
|
+
/**
|
|
173
|
+
* Defines a QUERY route definition.
|
|
174
|
+
*/
|
|
41
175
|
query: (path, config) => ({ method: 'query', path, ...config }),
|
|
176
|
+
/**
|
|
177
|
+
* Defines a route matching any HTTP method (GET, POST, PUT, DELETE, PATCH, etc.).
|
|
178
|
+
*
|
|
179
|
+
* @param path The route URL path (e.g. `'*'` or `'/api/*'`)
|
|
180
|
+
* @param config Route configuration and handler
|
|
181
|
+
* @returns Strongly typed `RouteDefinition`
|
|
182
|
+
*/
|
|
42
183
|
all: (path, config) => ({ method: 'all', path, ...config }),
|
|
43
184
|
};
|
|
44
185
|
/**
|
|
45
|
-
* Creates a route controller.
|
|
46
|
-
*
|
|
186
|
+
* Creates a route controller in a `route.ts` file. Binds multiple routes together, sharing middleware,
|
|
187
|
+
* lifecycle hooks, and error handling with zero boilerplate.
|
|
188
|
+
*
|
|
189
|
+
* @param config Controller configuration containing route definitions and shared settings
|
|
190
|
+
* @returns Fully compiled functional controller
|
|
47
191
|
*
|
|
48
192
|
* @example
|
|
193
|
+
* ```ts
|
|
194
|
+
* // src/http/users/route.ts
|
|
195
|
+
* import { controller, route } from 'exisjs/router'
|
|
196
|
+
* import { tex } from 'exisjs/validator'
|
|
197
|
+
*
|
|
49
198
|
* export default controller({
|
|
50
199
|
* cors: true,
|
|
51
|
-
*
|
|
52
|
-
* handle(
|
|
200
|
+
* listUsers: route.get('/', {
|
|
201
|
+
* async handle() {
|
|
53
202
|
* return { users: [] }
|
|
54
203
|
* }
|
|
204
|
+
* }),
|
|
205
|
+
* createUser: route.post('/', {
|
|
206
|
+
* body: tex.object({ name: tex.string() }),
|
|
207
|
+
* async handle({ body }) {
|
|
208
|
+
* return { created: body.name }
|
|
209
|
+
* }
|
|
55
210
|
* })
|
|
56
211
|
* })
|
|
212
|
+
* ```
|
|
57
213
|
*/
|
|
58
214
|
function controller(config) {
|
|
59
215
|
return Object.defineProperty(config, '__isController', {
|
|
@@ -62,15 +218,19 @@ function controller(config) {
|
|
|
62
218
|
});
|
|
63
219
|
}
|
|
64
220
|
/**
|
|
65
|
-
* Creates a strongly-typed router and controller factory.
|
|
66
|
-
*
|
|
221
|
+
* Creates a strongly-typed router and controller factory with pre-bound context.
|
|
222
|
+
*
|
|
223
|
+
* @template TContext Global request context type for the router instance
|
|
224
|
+
* @returns Object with typed `route` and `controller` factories
|
|
67
225
|
*
|
|
68
226
|
* @example
|
|
227
|
+
* ```ts
|
|
69
228
|
* interface MyContext {
|
|
70
|
-
* user:
|
|
71
|
-
* workspace: Workspace;
|
|
229
|
+
* user: { id: string; role: string }
|
|
72
230
|
* }
|
|
73
|
-
*
|
|
231
|
+
*
|
|
232
|
+
* export const { route, controller } = createRouter<MyContext>()
|
|
233
|
+
* ```
|
|
74
234
|
*/
|
|
75
235
|
function createRouter() {
|
|
76
236
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-builder.js","sourceRoot":"","sources":["../../src/router/route-builder.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"route-builder.js","sourceRoot":"","sources":["../../src/router/route-builder.ts"],"names":[],"mappings":";;;AAgCA,4CAQC;AAkgBD,gCAOC;AAiBD,oCAoEC;AA3nBD,sCAAkC;AAElC;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,gBAAgB,CAC9B,EAIuB;IAEvB,OAAO,EAA2C,CAAA;AACpD,CAAC;AAoGD;;GAEG;AACU,QAAA,KAAK,GAAG;IACnB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,GAAG,EAAE,CAWH,IAAW,EACX,MAGC,EAC4C,EAAE;QAC/C,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YACpC,eAAM,CAAC,IAAI,CACT,cAAc,IAAI,+DAA+D,CAClF,CAAA;QACH,CAAC;QACD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,EAAS,CAAA;IAClD,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,IAAI,EAAE,CAWJ,IAAW,EACX,MAGC,EAC4C,EAAE,CAC/C,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAQ;IAE9C;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,GAAG,EAAE,CAWH,IAAW,EACX,MAGC,EAC4C,EAAE,CAC/C,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAQ;IAE7C;;;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C,CAAA;AAiCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,SAAgB,UAAU,CACxB,MAAS;IAET,OAAO,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,gBAAgB,EAAE;QACrD,KAAK,EAAE,IAAI;QACX,UAAU,EAAE,KAAK,EAAE,sBAAsB;KAC1C,CAAiC,CAAA;AACpC,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAgB,YAAY;IAC1B,OAAO;QACL,KAAK,EAAE,aA6DN;QACD,UAAU,EAAE,CACV,MAAS,EACqB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;KACtD,CAAA;AACH,CAAC"}
|
|
@@ -16,7 +16,13 @@ export declare class RouteScanner {
|
|
|
16
16
|
mountRouteFile(filePath: string, routePath: string): Promise<void>;
|
|
17
17
|
private compileFunctionalController;
|
|
18
18
|
private mountRouteWithSource;
|
|
19
|
+
mountErrorHandlerFromModule(mod: any, errorFile?: string): void;
|
|
19
20
|
private mountErrorHandler;
|
|
20
21
|
private scanDirectory;
|
|
22
|
+
mountCronJobs(root: string): Promise<void>;
|
|
23
|
+
mountCronJobsFromEntries(entries: {
|
|
24
|
+
filePath: string;
|
|
25
|
+
module: any;
|
|
26
|
+
}[]): void;
|
|
21
27
|
}
|
|
22
28
|
//# sourceMappingURL=route-scanner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-scanner.d.ts","sourceRoot":"","sources":["../../src/router/route-scanner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"route-scanner.d.ts","sourceRoot":"","sources":["../../src/router/route-scanner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAmBxC,qBAAa,YAAY;IAQJ,GAAG,EAAE,GAAG;IAPpB,UAAU;kBAA+B,MAAM;gBAAU,OAAO;OAAK;IACrE,QAAQ,sBAA4B;IACpC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAO;IAC5B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,aAAa,UAAQ;IACrB,cAAc,EAAE,KAAK,GAAG,YAAY,GAAG,IAAI,CAAO;gBAEtC,GAAG,EAAE,GAAG;IAErB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAoBvB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoTnD,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoOxE,OAAO,CAAC,2BAA2B;IAInC,OAAO,CAAC,oBAAoB;IA2BrB,2BAA2B,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,SAAa,GAAG,IAAI;YAI5D,iBAAiB;YAIjB,aAAa;IAOd,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhD,wBAAwB,CAC7B,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,GAAG,CAAA;KAAE,EAAE,GAC3C,IAAI;CAGR"}
|