@bool-ts/core 2.2.4 → 2.3.0
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/constants/index.d.ts +3 -0
- package/dist/constants/keys.d.ts +34 -0
- package/dist/constants/objects.d.ts +505 -0
- package/dist/decorators/arguments.d.ts +2 -3
- package/dist/decorators/container.d.ts +5 -1
- package/dist/decorators/controller.d.ts +1 -1
- package/dist/decorators/guard.d.ts +1 -1
- package/dist/decorators/inject.d.ts +1 -1
- package/dist/decorators/injectable.d.ts +1 -1
- package/dist/decorators/interceptor.d.ts +1 -1
- package/dist/decorators/middleware.d.ts +1 -1
- package/dist/decorators/module.d.ts +1 -1
- package/dist/decorators/webSocket.d.ts +1 -1
- package/dist/decorators/webSocketArguments.d.ts +1 -1
- package/dist/entities/application.d.ts +13 -83
- package/dist/entities/httpRoute.d.ts +0 -2
- package/dist/entities/httpRouter.d.ts +29 -3
- package/dist/entities/httpRouterGroup.d.ts +5 -1
- package/dist/entities/injector.d.ts +2 -2
- package/dist/http/clientError.d.ts +5 -35
- package/dist/http/serverError.d.ts +7 -19
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/dist/index.js.map +30 -28
- package/dist/interfaces/@types.d.ts +114 -0
- package/dist/interfaces/guard.d.ts +2 -1
- package/dist/interfaces/index.d.ts +2 -1
- package/dist/producers/factory.d.ts +1 -1
- package/dist/utils/asyncFunction.d.ts +1 -0
- package/dist/utils/colors.d.ts +30 -0
- package/dist/utils/functions.d.ts +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/socket.d.ts +1 -0
- package/package.json +5 -4
- package/src/constants/index.ts +10 -0
- package/src/constants/objects.ts +291 -0
- package/src/decorators/arguments.ts +3 -5
- package/src/decorators/container.ts +40 -20
- package/src/decorators/controller.ts +2 -2
- package/src/decorators/guard.ts +2 -2
- package/src/decorators/http.ts +1 -1
- package/src/decorators/inject.ts +2 -2
- package/src/decorators/injectable.ts +2 -2
- package/src/decorators/interceptor.ts +2 -2
- package/src/decorators/middleware.ts +2 -2
- package/src/decorators/module.ts +2 -2
- package/src/decorators/webSocket.ts +2 -2
- package/src/decorators/webSocketArguments.ts +1 -1
- package/src/decorators/webSocketEvent.ts +1 -1
- package/src/entities/application.ts +1554 -1559
- package/src/entities/httpRoute.ts +1 -4
- package/src/entities/httpRouter.ts +36 -6
- package/src/entities/httpRouterGroup.ts +16 -5
- package/src/entities/injector.ts +3 -3
- package/src/http/clientError.ts +16 -39
- package/src/http/serverError.ts +17 -22
- package/src/index.ts +12 -2
- package/src/interfaces/@types.ts +171 -0
- package/src/interfaces/guard.ts +7 -1
- package/src/interfaces/index.ts +24 -1
- package/src/producers/factory.ts +1 -1
- package/src/utils/constructor.ts +1 -0
- package/src/utils/functions.ts +13 -0
- package/src/{ultils → utils}/index.ts +1 -0
- /package/{src/ultils/constructor.ts → dist/utils/constructor.d.ts} +0 -0
- /package/src/{keys/index.ts → constants/keys.ts} +0 -0
- /package/src/{ultils → utils}/asyncFunction.ts +0 -0
- /package/src/{ultils → utils}/colors.ts +0 -0
- /package/src/{ultils → utils}/socket.ts +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const argumentsKey: unique symbol;
|
|
2
|
+
export declare const webSocketEventArgumentsKey: unique symbol;
|
|
3
|
+
export declare const configKey: unique symbol;
|
|
4
|
+
export declare const controllerKey: unique symbol;
|
|
5
|
+
export declare const interceptorKey: unique symbol;
|
|
6
|
+
export declare const guardKey: unique symbol;
|
|
7
|
+
export declare const controllerHttpKey: unique symbol;
|
|
8
|
+
export declare const injectKey: unique symbol;
|
|
9
|
+
export declare const injectableKey: unique symbol;
|
|
10
|
+
export declare const middlewareKey: unique symbol;
|
|
11
|
+
export declare const moduleKey: unique symbol;
|
|
12
|
+
export declare const containerKey: unique symbol;
|
|
13
|
+
export declare const zodSchemaKey: unique symbol;
|
|
14
|
+
export declare const webSocketKey: unique symbol;
|
|
15
|
+
export declare const webSocketEventKey: unique symbol;
|
|
16
|
+
export declare const webSocketServerArgsKey: unique symbol;
|
|
17
|
+
export declare const webSocketConnectionArgsKey: unique symbol;
|
|
18
|
+
export declare const webSocketMessageArgsKey: unique symbol;
|
|
19
|
+
export declare const webSocketCloseCodeArgsKey: unique symbol;
|
|
20
|
+
export declare const webSocketCloseReasonArgsKey: unique symbol;
|
|
21
|
+
export declare const httpServerArgsKey: unique symbol;
|
|
22
|
+
export declare const requestHeadersArgsKey: unique symbol;
|
|
23
|
+
export declare const requestHeaderArgsKey: unique symbol;
|
|
24
|
+
export declare const requestBodyArgsKey: unique symbol;
|
|
25
|
+
export declare const paramsArgsKey: unique symbol;
|
|
26
|
+
export declare const paramArgsKey: unique symbol;
|
|
27
|
+
export declare const queryArgsKey: unique symbol;
|
|
28
|
+
export declare const requestArgsKey: unique symbol;
|
|
29
|
+
export declare const responseHeadersArgsKey: unique symbol;
|
|
30
|
+
export declare const contextArgsKey: unique symbol;
|
|
31
|
+
export declare const routeModelArgsKey: unique symbol;
|
|
32
|
+
export declare const responseBodyArgsKey: unique symbol;
|
|
33
|
+
export declare const responseStatusArgsKey: unique symbol;
|
|
34
|
+
export declare const responseStatusTextArgsKey: unique symbol;
|
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
export declare const informationalStatuses: Readonly<{
|
|
2
|
+
CONTINUE: Readonly<{
|
|
3
|
+
status: 100;
|
|
4
|
+
statusText: "Continue";
|
|
5
|
+
}>;
|
|
6
|
+
SWITCHING_PROTOCOLS: Readonly<{
|
|
7
|
+
status: 101;
|
|
8
|
+
statusText: "Switching Protocols";
|
|
9
|
+
}>;
|
|
10
|
+
EARLY_HINTS: Readonly<{
|
|
11
|
+
status: 103;
|
|
12
|
+
statusText: "Early Hints";
|
|
13
|
+
}>;
|
|
14
|
+
}>;
|
|
15
|
+
export type TInformationalStatuses = (typeof informationalStatuses)[keyof typeof informationalStatuses]["status"];
|
|
16
|
+
export declare const successfulStatuses: Readonly<{
|
|
17
|
+
OK: Readonly<{
|
|
18
|
+
status: 200;
|
|
19
|
+
statusText: "OK";
|
|
20
|
+
}>;
|
|
21
|
+
CREATED: Readonly<{
|
|
22
|
+
status: 201;
|
|
23
|
+
statusText: "Created";
|
|
24
|
+
}>;
|
|
25
|
+
ACCEPTED: Readonly<{
|
|
26
|
+
status: 202;
|
|
27
|
+
statusText: "Accepted";
|
|
28
|
+
}>;
|
|
29
|
+
NON_AUTHORITATIVE_INFORMATION: Readonly<{
|
|
30
|
+
status: 203;
|
|
31
|
+
statusText: "Non-Authoritative Information";
|
|
32
|
+
}>;
|
|
33
|
+
NO_CONTENT: Readonly<{
|
|
34
|
+
status: 204;
|
|
35
|
+
statusText: "No Content";
|
|
36
|
+
}>;
|
|
37
|
+
RESET_CONTENT: Readonly<{
|
|
38
|
+
status: 205;
|
|
39
|
+
statusText: "Reset Content";
|
|
40
|
+
}>;
|
|
41
|
+
PARTIAL_CONTENT: Readonly<{
|
|
42
|
+
status: 206;
|
|
43
|
+
statusText: "Partial Content";
|
|
44
|
+
}>;
|
|
45
|
+
MULTI_STATUS: Readonly<{
|
|
46
|
+
status: 207;
|
|
47
|
+
statusText: "Multi-Status";
|
|
48
|
+
}>;
|
|
49
|
+
ALREADY_REPORTED: Readonly<{
|
|
50
|
+
status: 208;
|
|
51
|
+
statusText: "Already Reported";
|
|
52
|
+
}>;
|
|
53
|
+
IM_USED: Readonly<{
|
|
54
|
+
status: 226;
|
|
55
|
+
statusText: "IM Used";
|
|
56
|
+
}>;
|
|
57
|
+
}>;
|
|
58
|
+
export type TSuccessfulStatuses = (typeof successfulStatuses)[keyof typeof successfulStatuses]["status"];
|
|
59
|
+
export declare const redirectionStatuses: Readonly<{
|
|
60
|
+
MULTIPLE_CHOICES: Readonly<{
|
|
61
|
+
status: 300;
|
|
62
|
+
statusText: "Multiple Choices";
|
|
63
|
+
}>;
|
|
64
|
+
MOVED_PERMANENTLY: Readonly<{
|
|
65
|
+
status: 301;
|
|
66
|
+
statusText: "Moved Permanently";
|
|
67
|
+
}>;
|
|
68
|
+
FOUND: Readonly<{
|
|
69
|
+
status: 302;
|
|
70
|
+
statusText: "Found";
|
|
71
|
+
}>;
|
|
72
|
+
SEE_OTHER: Readonly<{
|
|
73
|
+
status: 303;
|
|
74
|
+
statusText: "See Other";
|
|
75
|
+
}>;
|
|
76
|
+
NOT_MODIFIED: Readonly<{
|
|
77
|
+
status: 304;
|
|
78
|
+
statusText: "Not Modified";
|
|
79
|
+
}>;
|
|
80
|
+
UNUSED: Readonly<{
|
|
81
|
+
status: 306;
|
|
82
|
+
statusText: "Unused";
|
|
83
|
+
}>;
|
|
84
|
+
TEMPORARY_REDIRECT: Readonly<{
|
|
85
|
+
status: 307;
|
|
86
|
+
statusText: "Temporary Redirect";
|
|
87
|
+
}>;
|
|
88
|
+
PERMANENT_REDIRECT: Readonly<{
|
|
89
|
+
status: 308;
|
|
90
|
+
statusText: "Permanent Redirect";
|
|
91
|
+
}>;
|
|
92
|
+
}>;
|
|
93
|
+
export type TRedirectionStatuses = (typeof redirectionStatuses)[keyof typeof redirectionStatuses]["status"];
|
|
94
|
+
export declare const clientErrorStatuses: Readonly<{
|
|
95
|
+
BAD_REQUEST: Readonly<{
|
|
96
|
+
status: 400;
|
|
97
|
+
statusText: "Bad Request";
|
|
98
|
+
}>;
|
|
99
|
+
UNAUTHORIZED: Readonly<{
|
|
100
|
+
status: 401;
|
|
101
|
+
statusText: "Unauthorized";
|
|
102
|
+
}>;
|
|
103
|
+
PAYMENT_REQUIRED: Readonly<{
|
|
104
|
+
status: 402;
|
|
105
|
+
statusText: "Payment Required";
|
|
106
|
+
}>;
|
|
107
|
+
FORBIDDEN: Readonly<{
|
|
108
|
+
status: 403;
|
|
109
|
+
statusText: "Forbidden";
|
|
110
|
+
}>;
|
|
111
|
+
NOT_FOUND: Readonly<{
|
|
112
|
+
status: 404;
|
|
113
|
+
statusText: "Not Found";
|
|
114
|
+
}>;
|
|
115
|
+
METHOD_NOT_ALLOWED: Readonly<{
|
|
116
|
+
status: 405;
|
|
117
|
+
statusText: "Method Not Allowed";
|
|
118
|
+
}>;
|
|
119
|
+
NOT_ACCEPTABLE: Readonly<{
|
|
120
|
+
status: 406;
|
|
121
|
+
statusText: "Not Acceptable";
|
|
122
|
+
}>;
|
|
123
|
+
PROXY_AUTHENTICATION_REQUIRED: Readonly<{
|
|
124
|
+
status: 407;
|
|
125
|
+
statusText: "Proxy Authentication Required";
|
|
126
|
+
}>;
|
|
127
|
+
REQUEST_TIMEOUT: Readonly<{
|
|
128
|
+
status: 408;
|
|
129
|
+
statusText: "Request Timeout";
|
|
130
|
+
}>;
|
|
131
|
+
CONFLICT: Readonly<{
|
|
132
|
+
status: 409;
|
|
133
|
+
statusText: "Conflict";
|
|
134
|
+
}>;
|
|
135
|
+
GONE: Readonly<{
|
|
136
|
+
status: 410;
|
|
137
|
+
statusText: "Gone";
|
|
138
|
+
}>;
|
|
139
|
+
LENGTH_REQUIRED: Readonly<{
|
|
140
|
+
status: 411;
|
|
141
|
+
statusText: "Length Required";
|
|
142
|
+
}>;
|
|
143
|
+
PRECONDITION_FAILED: Readonly<{
|
|
144
|
+
status: 412;
|
|
145
|
+
statusText: "Precondition Failed";
|
|
146
|
+
}>;
|
|
147
|
+
CONTENT_TOO_LARGE: Readonly<{
|
|
148
|
+
status: 413;
|
|
149
|
+
statusText: "Content Too Large";
|
|
150
|
+
}>;
|
|
151
|
+
URI_TOO_LONG: Readonly<{
|
|
152
|
+
status: 414;
|
|
153
|
+
statusText: "URI Too Long";
|
|
154
|
+
}>;
|
|
155
|
+
UNSUPPORTED_MEDIA_TYPE: Readonly<{
|
|
156
|
+
status: 415;
|
|
157
|
+
statusText: "Unsupported Media Type";
|
|
158
|
+
}>;
|
|
159
|
+
RANGE_NOT_SATISFIABLE: Readonly<{
|
|
160
|
+
status: 416;
|
|
161
|
+
statusText: "Range Not Satisfiable";
|
|
162
|
+
}>;
|
|
163
|
+
EXPECTATION_FAILED: Readonly<{
|
|
164
|
+
status: 417;
|
|
165
|
+
statusText: "Expectation Failed";
|
|
166
|
+
}>;
|
|
167
|
+
I_AM_A_TEAPOT: Readonly<{
|
|
168
|
+
status: 418;
|
|
169
|
+
statusText: "I'm a teapot";
|
|
170
|
+
}>;
|
|
171
|
+
MISDIRECTED_REQUEST: Readonly<{
|
|
172
|
+
status: 421;
|
|
173
|
+
statusText: "Misdirected Request";
|
|
174
|
+
}>;
|
|
175
|
+
UNPROCESSABLE_CONTENT: Readonly<{
|
|
176
|
+
status: 422;
|
|
177
|
+
statusText: "Unprocessable Content";
|
|
178
|
+
}>;
|
|
179
|
+
LOCKED: Readonly<{
|
|
180
|
+
status: 423;
|
|
181
|
+
statusText: "Locked";
|
|
182
|
+
}>;
|
|
183
|
+
FAILED_DEPENDENCY: Readonly<{
|
|
184
|
+
status: 424;
|
|
185
|
+
statusText: "Failed Dependency";
|
|
186
|
+
}>;
|
|
187
|
+
TOO_EARLY: Readonly<{
|
|
188
|
+
status: 425;
|
|
189
|
+
statusText: "Too Early";
|
|
190
|
+
}>;
|
|
191
|
+
UPGRADE_REQUIRED: Readonly<{
|
|
192
|
+
status: 426;
|
|
193
|
+
statusText: "Upgrade Required";
|
|
194
|
+
}>;
|
|
195
|
+
PRECONDITION_REQUIRED: Readonly<{
|
|
196
|
+
status: 428;
|
|
197
|
+
statusText: "Precondition Required";
|
|
198
|
+
}>;
|
|
199
|
+
TOO_MANY_REQUESTS: Readonly<{
|
|
200
|
+
status: 429;
|
|
201
|
+
statusText: "Too Many Requests";
|
|
202
|
+
}>;
|
|
203
|
+
REQUEST_HEADER_FIELDS_TOO_LARGE: Readonly<{
|
|
204
|
+
status: 431;
|
|
205
|
+
statusText: "Request Header Fields Too Large";
|
|
206
|
+
}>;
|
|
207
|
+
UNAVAILABLE_FOR_LEGAL_REASONS: Readonly<{
|
|
208
|
+
status: 451;
|
|
209
|
+
statusText: "Unavailable For Legal Reasons";
|
|
210
|
+
}>;
|
|
211
|
+
}>;
|
|
212
|
+
export type TClientErrorStatuses = (typeof clientErrorStatuses)[keyof typeof clientErrorStatuses]["status"];
|
|
213
|
+
export declare const serverErrorStatuses: Readonly<{
|
|
214
|
+
INTERNAL_SERVER_ERROR: Readonly<{
|
|
215
|
+
status: 500;
|
|
216
|
+
statusText: "Internal Server Error";
|
|
217
|
+
}>;
|
|
218
|
+
NOT_IMPLEMENTED: Readonly<{
|
|
219
|
+
status: 501;
|
|
220
|
+
statusText: "Not Implemented";
|
|
221
|
+
}>;
|
|
222
|
+
BAD_GATEWAY: Readonly<{
|
|
223
|
+
status: 502;
|
|
224
|
+
statusText: "Bad Gateway";
|
|
225
|
+
}>;
|
|
226
|
+
SERVICE_UNAVAILABLE: Readonly<{
|
|
227
|
+
status: 503;
|
|
228
|
+
statusText: "Service Unavailable";
|
|
229
|
+
}>;
|
|
230
|
+
GATEWAY_TIMEOUT: Readonly<{
|
|
231
|
+
status: 504;
|
|
232
|
+
statusText: "Gateway Timeout";
|
|
233
|
+
}>;
|
|
234
|
+
HTTP_VERSION_NOT_SUPPORTED: Readonly<{
|
|
235
|
+
status: 505;
|
|
236
|
+
statusText: "HTTP Version Not Supported";
|
|
237
|
+
}>;
|
|
238
|
+
VARIANT_ALSO_NEGOTIATES: Readonly<{
|
|
239
|
+
status: 506;
|
|
240
|
+
statusText: "Variant Also Negotiates";
|
|
241
|
+
}>;
|
|
242
|
+
INSUFFICIENT_STORAGE: Readonly<{
|
|
243
|
+
status: 507;
|
|
244
|
+
statusText: "Insufficient Storage";
|
|
245
|
+
}>;
|
|
246
|
+
LOOP_DETECTED: Readonly<{
|
|
247
|
+
status: 508;
|
|
248
|
+
statusText: "Loop Detected";
|
|
249
|
+
}>;
|
|
250
|
+
NOT_EXTENDED: Readonly<{
|
|
251
|
+
status: 510;
|
|
252
|
+
statusText: "Not Extended";
|
|
253
|
+
}>;
|
|
254
|
+
NETWORK_AUTHENTICATION_REQUIRED: Readonly<{
|
|
255
|
+
status: 511;
|
|
256
|
+
statusText: "Network Authentication Required";
|
|
257
|
+
}>;
|
|
258
|
+
}>;
|
|
259
|
+
export type TServerErrorStatuses = (typeof serverErrorStatuses)[keyof typeof serverErrorStatuses]["status"];
|
|
260
|
+
export declare const httpStatuses: Readonly<{
|
|
261
|
+
INTERNAL_SERVER_ERROR: Readonly<{
|
|
262
|
+
status: 500;
|
|
263
|
+
statusText: "Internal Server Error";
|
|
264
|
+
}>;
|
|
265
|
+
NOT_IMPLEMENTED: Readonly<{
|
|
266
|
+
status: 501;
|
|
267
|
+
statusText: "Not Implemented";
|
|
268
|
+
}>;
|
|
269
|
+
BAD_GATEWAY: Readonly<{
|
|
270
|
+
status: 502;
|
|
271
|
+
statusText: "Bad Gateway";
|
|
272
|
+
}>;
|
|
273
|
+
SERVICE_UNAVAILABLE: Readonly<{
|
|
274
|
+
status: 503;
|
|
275
|
+
statusText: "Service Unavailable";
|
|
276
|
+
}>;
|
|
277
|
+
GATEWAY_TIMEOUT: Readonly<{
|
|
278
|
+
status: 504;
|
|
279
|
+
statusText: "Gateway Timeout";
|
|
280
|
+
}>;
|
|
281
|
+
HTTP_VERSION_NOT_SUPPORTED: Readonly<{
|
|
282
|
+
status: 505;
|
|
283
|
+
statusText: "HTTP Version Not Supported";
|
|
284
|
+
}>;
|
|
285
|
+
VARIANT_ALSO_NEGOTIATES: Readonly<{
|
|
286
|
+
status: 506;
|
|
287
|
+
statusText: "Variant Also Negotiates";
|
|
288
|
+
}>;
|
|
289
|
+
INSUFFICIENT_STORAGE: Readonly<{
|
|
290
|
+
status: 507;
|
|
291
|
+
statusText: "Insufficient Storage";
|
|
292
|
+
}>;
|
|
293
|
+
LOOP_DETECTED: Readonly<{
|
|
294
|
+
status: 508;
|
|
295
|
+
statusText: "Loop Detected";
|
|
296
|
+
}>;
|
|
297
|
+
NOT_EXTENDED: Readonly<{
|
|
298
|
+
status: 510;
|
|
299
|
+
statusText: "Not Extended";
|
|
300
|
+
}>;
|
|
301
|
+
NETWORK_AUTHENTICATION_REQUIRED: Readonly<{
|
|
302
|
+
status: 511;
|
|
303
|
+
statusText: "Network Authentication Required";
|
|
304
|
+
}>;
|
|
305
|
+
BAD_REQUEST: Readonly<{
|
|
306
|
+
status: 400;
|
|
307
|
+
statusText: "Bad Request";
|
|
308
|
+
}>;
|
|
309
|
+
UNAUTHORIZED: Readonly<{
|
|
310
|
+
status: 401;
|
|
311
|
+
statusText: "Unauthorized";
|
|
312
|
+
}>;
|
|
313
|
+
PAYMENT_REQUIRED: Readonly<{
|
|
314
|
+
status: 402;
|
|
315
|
+
statusText: "Payment Required";
|
|
316
|
+
}>;
|
|
317
|
+
FORBIDDEN: Readonly<{
|
|
318
|
+
status: 403;
|
|
319
|
+
statusText: "Forbidden";
|
|
320
|
+
}>;
|
|
321
|
+
NOT_FOUND: Readonly<{
|
|
322
|
+
status: 404;
|
|
323
|
+
statusText: "Not Found";
|
|
324
|
+
}>;
|
|
325
|
+
METHOD_NOT_ALLOWED: Readonly<{
|
|
326
|
+
status: 405;
|
|
327
|
+
statusText: "Method Not Allowed";
|
|
328
|
+
}>;
|
|
329
|
+
NOT_ACCEPTABLE: Readonly<{
|
|
330
|
+
status: 406;
|
|
331
|
+
statusText: "Not Acceptable";
|
|
332
|
+
}>;
|
|
333
|
+
PROXY_AUTHENTICATION_REQUIRED: Readonly<{
|
|
334
|
+
status: 407;
|
|
335
|
+
statusText: "Proxy Authentication Required";
|
|
336
|
+
}>;
|
|
337
|
+
REQUEST_TIMEOUT: Readonly<{
|
|
338
|
+
status: 408;
|
|
339
|
+
statusText: "Request Timeout";
|
|
340
|
+
}>;
|
|
341
|
+
CONFLICT: Readonly<{
|
|
342
|
+
status: 409;
|
|
343
|
+
statusText: "Conflict";
|
|
344
|
+
}>;
|
|
345
|
+
GONE: Readonly<{
|
|
346
|
+
status: 410;
|
|
347
|
+
statusText: "Gone";
|
|
348
|
+
}>;
|
|
349
|
+
LENGTH_REQUIRED: Readonly<{
|
|
350
|
+
status: 411;
|
|
351
|
+
statusText: "Length Required";
|
|
352
|
+
}>;
|
|
353
|
+
PRECONDITION_FAILED: Readonly<{
|
|
354
|
+
status: 412;
|
|
355
|
+
statusText: "Precondition Failed";
|
|
356
|
+
}>;
|
|
357
|
+
CONTENT_TOO_LARGE: Readonly<{
|
|
358
|
+
status: 413;
|
|
359
|
+
statusText: "Content Too Large";
|
|
360
|
+
}>;
|
|
361
|
+
URI_TOO_LONG: Readonly<{
|
|
362
|
+
status: 414;
|
|
363
|
+
statusText: "URI Too Long";
|
|
364
|
+
}>;
|
|
365
|
+
UNSUPPORTED_MEDIA_TYPE: Readonly<{
|
|
366
|
+
status: 415;
|
|
367
|
+
statusText: "Unsupported Media Type";
|
|
368
|
+
}>;
|
|
369
|
+
RANGE_NOT_SATISFIABLE: Readonly<{
|
|
370
|
+
status: 416;
|
|
371
|
+
statusText: "Range Not Satisfiable";
|
|
372
|
+
}>;
|
|
373
|
+
EXPECTATION_FAILED: Readonly<{
|
|
374
|
+
status: 417;
|
|
375
|
+
statusText: "Expectation Failed";
|
|
376
|
+
}>;
|
|
377
|
+
I_AM_A_TEAPOT: Readonly<{
|
|
378
|
+
status: 418;
|
|
379
|
+
statusText: "I'm a teapot";
|
|
380
|
+
}>;
|
|
381
|
+
MISDIRECTED_REQUEST: Readonly<{
|
|
382
|
+
status: 421;
|
|
383
|
+
statusText: "Misdirected Request";
|
|
384
|
+
}>;
|
|
385
|
+
UNPROCESSABLE_CONTENT: Readonly<{
|
|
386
|
+
status: 422;
|
|
387
|
+
statusText: "Unprocessable Content";
|
|
388
|
+
}>;
|
|
389
|
+
LOCKED: Readonly<{
|
|
390
|
+
status: 423;
|
|
391
|
+
statusText: "Locked";
|
|
392
|
+
}>;
|
|
393
|
+
FAILED_DEPENDENCY: Readonly<{
|
|
394
|
+
status: 424;
|
|
395
|
+
statusText: "Failed Dependency";
|
|
396
|
+
}>;
|
|
397
|
+
TOO_EARLY: Readonly<{
|
|
398
|
+
status: 425;
|
|
399
|
+
statusText: "Too Early";
|
|
400
|
+
}>;
|
|
401
|
+
UPGRADE_REQUIRED: Readonly<{
|
|
402
|
+
status: 426;
|
|
403
|
+
statusText: "Upgrade Required";
|
|
404
|
+
}>;
|
|
405
|
+
PRECONDITION_REQUIRED: Readonly<{
|
|
406
|
+
status: 428;
|
|
407
|
+
statusText: "Precondition Required";
|
|
408
|
+
}>;
|
|
409
|
+
TOO_MANY_REQUESTS: Readonly<{
|
|
410
|
+
status: 429;
|
|
411
|
+
statusText: "Too Many Requests";
|
|
412
|
+
}>;
|
|
413
|
+
REQUEST_HEADER_FIELDS_TOO_LARGE: Readonly<{
|
|
414
|
+
status: 431;
|
|
415
|
+
statusText: "Request Header Fields Too Large";
|
|
416
|
+
}>;
|
|
417
|
+
UNAVAILABLE_FOR_LEGAL_REASONS: Readonly<{
|
|
418
|
+
status: 451;
|
|
419
|
+
statusText: "Unavailable For Legal Reasons";
|
|
420
|
+
}>;
|
|
421
|
+
MULTIPLE_CHOICES: Readonly<{
|
|
422
|
+
status: 300;
|
|
423
|
+
statusText: "Multiple Choices";
|
|
424
|
+
}>;
|
|
425
|
+
MOVED_PERMANENTLY: Readonly<{
|
|
426
|
+
status: 301;
|
|
427
|
+
statusText: "Moved Permanently";
|
|
428
|
+
}>;
|
|
429
|
+
FOUND: Readonly<{
|
|
430
|
+
status: 302;
|
|
431
|
+
statusText: "Found";
|
|
432
|
+
}>;
|
|
433
|
+
SEE_OTHER: Readonly<{
|
|
434
|
+
status: 303;
|
|
435
|
+
statusText: "See Other";
|
|
436
|
+
}>;
|
|
437
|
+
NOT_MODIFIED: Readonly<{
|
|
438
|
+
status: 304;
|
|
439
|
+
statusText: "Not Modified";
|
|
440
|
+
}>;
|
|
441
|
+
UNUSED: Readonly<{
|
|
442
|
+
status: 306;
|
|
443
|
+
statusText: "Unused";
|
|
444
|
+
}>;
|
|
445
|
+
TEMPORARY_REDIRECT: Readonly<{
|
|
446
|
+
status: 307;
|
|
447
|
+
statusText: "Temporary Redirect";
|
|
448
|
+
}>;
|
|
449
|
+
PERMANENT_REDIRECT: Readonly<{
|
|
450
|
+
status: 308;
|
|
451
|
+
statusText: "Permanent Redirect";
|
|
452
|
+
}>;
|
|
453
|
+
OK: Readonly<{
|
|
454
|
+
status: 200;
|
|
455
|
+
statusText: "OK";
|
|
456
|
+
}>;
|
|
457
|
+
CREATED: Readonly<{
|
|
458
|
+
status: 201;
|
|
459
|
+
statusText: "Created";
|
|
460
|
+
}>;
|
|
461
|
+
ACCEPTED: Readonly<{
|
|
462
|
+
status: 202;
|
|
463
|
+
statusText: "Accepted";
|
|
464
|
+
}>;
|
|
465
|
+
NON_AUTHORITATIVE_INFORMATION: Readonly<{
|
|
466
|
+
status: 203;
|
|
467
|
+
statusText: "Non-Authoritative Information";
|
|
468
|
+
}>;
|
|
469
|
+
NO_CONTENT: Readonly<{
|
|
470
|
+
status: 204;
|
|
471
|
+
statusText: "No Content";
|
|
472
|
+
}>;
|
|
473
|
+
RESET_CONTENT: Readonly<{
|
|
474
|
+
status: 205;
|
|
475
|
+
statusText: "Reset Content";
|
|
476
|
+
}>;
|
|
477
|
+
PARTIAL_CONTENT: Readonly<{
|
|
478
|
+
status: 206;
|
|
479
|
+
statusText: "Partial Content";
|
|
480
|
+
}>;
|
|
481
|
+
MULTI_STATUS: Readonly<{
|
|
482
|
+
status: 207;
|
|
483
|
+
statusText: "Multi-Status";
|
|
484
|
+
}>;
|
|
485
|
+
ALREADY_REPORTED: Readonly<{
|
|
486
|
+
status: 208;
|
|
487
|
+
statusText: "Already Reported";
|
|
488
|
+
}>;
|
|
489
|
+
IM_USED: Readonly<{
|
|
490
|
+
status: 226;
|
|
491
|
+
statusText: "IM Used";
|
|
492
|
+
}>;
|
|
493
|
+
CONTINUE: Readonly<{
|
|
494
|
+
status: 100;
|
|
495
|
+
statusText: "Continue";
|
|
496
|
+
}>;
|
|
497
|
+
SWITCHING_PROTOCOLS: Readonly<{
|
|
498
|
+
status: 101;
|
|
499
|
+
statusText: "Switching Protocols";
|
|
500
|
+
}>;
|
|
501
|
+
EARLY_HINTS: Readonly<{
|
|
502
|
+
status: 103;
|
|
503
|
+
statusText: "Early Hints";
|
|
504
|
+
}>;
|
|
505
|
+
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { contextArgsKey, httpServerArgsKey, paramArgsKey, paramsArgsKey, queryArgsKey, requestArgsKey, requestBodyArgsKey, requestHeaderArgsKey, requestHeadersArgsKey, responseHeadersArgsKey, routeModelArgsKey } from "../keys";
|
|
1
|
+
import { contextArgsKey, httpServerArgsKey, paramArgsKey, paramsArgsKey, queryArgsKey, requestArgsKey, requestBodyArgsKey, requestHeaderArgsKey, requestHeadersArgsKey, responseHeadersArgsKey, routeModelArgsKey } from "../constants/keys";
|
|
2
2
|
export type TArgumentsMetadata<TValidationSchema = unknown> = {
|
|
3
3
|
index: number;
|
|
4
4
|
type: typeof requestHeadersArgsKey;
|
|
@@ -29,7 +29,6 @@ export type TArgumentsMetadata<TValidationSchema = unknown> = {
|
|
|
29
29
|
} | {
|
|
30
30
|
index: number;
|
|
31
31
|
type: typeof requestArgsKey;
|
|
32
|
-
validationSchema?: TValidationSchema;
|
|
33
32
|
} | {
|
|
34
33
|
index: number;
|
|
35
34
|
type: typeof responseHeadersArgsKey;
|
|
@@ -51,7 +50,7 @@ export declare const RequestBody: <TTarget extends Object, TValidationSchema = u
|
|
|
51
50
|
export declare const Params: <TTarget extends Object, TValidationSchema = unknown>(validationSchema?: TValidationSchema) => (target: TTarget, methodName: string | symbol | undefined, parameterIndex: number) => void;
|
|
52
51
|
export declare const Param: <TTarget extends Object, TValidationSchema = unknown>(key: string, validationSchema?: TValidationSchema) => (target: TTarget, methodName: string | symbol | undefined, parameterIndex: number) => void;
|
|
53
52
|
export declare const Query: <TTarget extends Object, TValidationSchema = unknown>(validationSchema?: TValidationSchema) => (target: TTarget, methodName: string | symbol | undefined, parameterIndex: number) => void;
|
|
54
|
-
export declare const Request: <TTarget extends Object, TValidationSchema = unknown>(
|
|
53
|
+
export declare const Request: <TTarget extends Object, TValidationSchema = unknown>() => (target: TTarget, methodName: string | symbol | undefined, parameterIndex: number) => void;
|
|
55
54
|
export declare const ResponseHeaders: <TTarget extends Object>() => (target: TTarget, methodName: string | symbol | undefined, parameterIndex: number) => void;
|
|
56
55
|
export declare const Context: <TTarget extends Object>(key?: symbol) => (target: TTarget, methodName: string | symbol | undefined, parameterIndex: number) => void;
|
|
57
56
|
export declare const RouteModel: <TTarget extends Object>() => (target: TTarget, methodName: string | symbol | undefined, parameterIndex: number) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TConstructor } from "../
|
|
1
|
+
import type { TConstructor } from "../utils";
|
|
2
2
|
type TLoaders<TConfig extends {} = {}> = Record<string | symbol, (args: {
|
|
3
3
|
config: TConfig;
|
|
4
4
|
}) => [string | symbol, unknown] | Promise<[string | symbol, unknown]>>;
|
|
@@ -7,20 +7,24 @@ export type TContainerConfig<TConfig> = TConfig | (() => TConfig | Promise<TConf
|
|
|
7
7
|
value: TConfig | (() => TConfig | Promise<TConfig>);
|
|
8
8
|
}>;
|
|
9
9
|
export type TContainerOptions<TConfig extends {} = {}> = Partial<{
|
|
10
|
+
prefix: string;
|
|
10
11
|
loaders: TLoaders<TConfig>;
|
|
11
12
|
config: TContainerConfig<TConfig>;
|
|
12
13
|
modules: Array<TConstructor<unknown>>;
|
|
13
14
|
dependencies: Array<TConstructor<unknown>>;
|
|
14
15
|
middlewares: Array<TConstructor<unknown>>;
|
|
15
16
|
guards: Array<TConstructor<unknown>>;
|
|
17
|
+
interceptors: Array<TConstructor<unknown>>;
|
|
16
18
|
}> | undefined;
|
|
17
19
|
export type TContainerMetadata<TConfig extends {} = {}> = Partial<{
|
|
20
|
+
prefix: string;
|
|
18
21
|
loaders: TLoaders<TConfig>;
|
|
19
22
|
config: TContainerConfig<TConfig>;
|
|
20
23
|
modules: Array<TConstructor<unknown>>;
|
|
21
24
|
dependencies: Array<TConstructor<unknown>>;
|
|
22
25
|
middlewares: Array<TConstructor<unknown>>;
|
|
23
26
|
guards: Array<TConstructor<unknown>>;
|
|
27
|
+
interceptors: Array<TConstructor<unknown>>;
|
|
24
28
|
}> | undefined;
|
|
25
29
|
export declare const Container: <TConfig extends {} = {}, K extends TConstructor<Object> = TConstructor<Object>>(args?: TContainerOptions<TConfig>) => (target: K) => void;
|
|
26
30
|
export default Container;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { TConstructor } from "../
|
|
1
|
+
import type { TConstructor } from "../utils";
|
|
2
2
|
export declare const Inject: <T extends TConstructor<Object>, K extends TConstructor<Object>>(definition: T | string | symbol) => (target: K, _methodName: string | symbol | undefined, parameterIndex: number) => void;
|
|
3
3
|
export default Inject;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TConstructor } from "../
|
|
1
|
+
import type { TConstructor } from "../utils";
|
|
2
2
|
import type { TArgumentsMetadataCollection } from "./arguments";
|
|
3
3
|
import type { TWebSocketEventMetadata } from "./webSocketEvent";
|
|
4
4
|
export type TWebSocketHttpRouteMetadata = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { webSocketCloseCodeArgsKey, webSocketCloseReasonArgsKey, webSocketConnectionArgsKey, webSocketMessageArgsKey, webSocketServerArgsKey } from "../keys";
|
|
1
|
+
import { webSocketCloseCodeArgsKey, webSocketCloseReasonArgsKey, webSocketConnectionArgsKey, webSocketMessageArgsKey, webSocketServerArgsKey } from "../constants/keys";
|
|
2
2
|
export type TWebsocketArgumentsMetadata = {
|
|
3
3
|
index: number;
|
|
4
4
|
type: typeof webSocketConnectionArgsKey;
|