@vercube/core 0.0.3 → 0.0.4
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/index.d.mts +1193 -0
- package/dist/index.mjs +175 -174
- package/package.json +8 -23
- package/dist/Common/App.d.ts +0 -65
- package/dist/Common/Container.d.ts +0 -8
- package/dist/Common/CreateApp.d.ts +0 -8
- package/dist/Config/Config.d.ts +0 -7
- package/dist/Config/DefaultConfig.d.ts +0 -6
- package/dist/Config/Loader.d.ts +0 -7
- package/dist/Decorators/Hooks/Listen.d.ts +0 -9
- package/dist/Decorators/Http/Body.d.ts +0 -15
- package/dist/Decorators/Http/Connect.d.ts +0 -10
- package/dist/Decorators/Http/Controller.d.ts +0 -10
- package/dist/Decorators/Http/Delete.d.ts +0 -10
- package/dist/Decorators/Http/Get.d.ts +0 -10
- package/dist/Decorators/Http/Head.d.ts +0 -10
- package/dist/Decorators/Http/Header.d.ts +0 -11
- package/dist/Decorators/Http/Headers.d.ts +0 -9
- package/dist/Decorators/Http/Middleware.d.ts +0 -27
- package/dist/Decorators/Http/MultipartFormData.d.ts +0 -15
- package/dist/Decorators/Http/Options.d.ts +0 -10
- package/dist/Decorators/Http/Param.d.ts +0 -12
- package/dist/Decorators/Http/Patch.d.ts +0 -10
- package/dist/Decorators/Http/Post.d.ts +0 -10
- package/dist/Decorators/Http/Put.d.ts +0 -10
- package/dist/Decorators/Http/QueryParam.d.ts +0 -16
- package/dist/Decorators/Http/QueryParams.d.ts +0 -15
- package/dist/Decorators/Http/Redirect.d.ts +0 -13
- package/dist/Decorators/Http/Request.d.ts +0 -9
- package/dist/Decorators/Http/Response.d.ts +0 -9
- package/dist/Decorators/Http/Session.d.ts +0 -9
- package/dist/Decorators/Http/SetHeader.d.ts +0 -7
- package/dist/Decorators/Http/Status.d.ts +0 -11
- package/dist/Decorators/Http/Trace.d.ts +0 -10
- package/dist/Errors/Http/BadRequestError.d.ts +0 -17
- package/dist/Errors/Http/ForbiddenError.d.ts +0 -17
- package/dist/Errors/Http/InternalServerError.d.ts +0 -17
- package/dist/Errors/Http/MethodNotAllowedError.d.ts +0 -17
- package/dist/Errors/Http/NotAcceptableError.d.ts +0 -17
- package/dist/Errors/Http/NotFoundError.d.ts +0 -17
- package/dist/Errors/Http/UnauthorizedError.d.ts +0 -17
- package/dist/Errors/HttpError.d.ts +0 -17
- package/dist/Hooks/Router/RouterAfterInitHook.d.ts +0 -1
- package/dist/Hooks/Router/RouterBeforeInitHook.d.ts +0 -1
- package/dist/Middleware/ValidationMiddleware.d.ts +0 -23
- package/dist/Resolvers/Body.d.ts +0 -22
- package/dist/Resolvers/Headers.d.ts +0 -14
- package/dist/Resolvers/Query.d.ts +0 -14
- package/dist/Resolvers/RouterParam.d.ts +0 -13
- package/dist/Services/Config/RuntimeConfig.d.ts +0 -22
- package/dist/Services/ErrorHandler/DefaultErrorHandlerProvider.d.ts +0 -16
- package/dist/Services/ErrorHandler/ErrorHandlerProvider.d.ts +0 -16
- package/dist/Services/Hooks/HooksService.d.ts +0 -76
- package/dist/Services/HttpServer/HttpServer.d.ts +0 -57
- package/dist/Services/Metadata/MetadataResolver.d.ts +0 -42
- package/dist/Services/Middleware/BaseMiddleware.d.ts +0 -31
- package/dist/Services/Middleware/GlobalMiddlewareRegistry.d.ts +0 -31
- package/dist/Services/Plugins/BasePlugin.d.ts +0 -16
- package/dist/Services/Plugins/PluginsRegistry.d.ts +0 -26
- package/dist/Services/Router/RequestHandler.d.ts +0 -63
- package/dist/Services/Router/Router.d.ts +0 -40
- package/dist/Services/Router/StaticRequestHandler.d.ts +0 -38
- package/dist/Services/Validation/StandardSchemaValidationProvider.d.ts +0 -17
- package/dist/Services/Validation/ValidationProvider.d.ts +0 -17
- package/dist/Types/CommonTypes.d.ts +0 -7
- package/dist/Types/ConfigTypes.d.ts +0 -124
- package/dist/Types/HooksTypes.d.ts +0 -17
- package/dist/Types/HttpTypes.d.ts +0 -63
- package/dist/Types/MetadataTypes.d.ts +0 -56
- package/dist/Types/RouterTypes.d.ts +0 -37
- package/dist/Types/ValidationTypes.d.ts +0 -6
- package/dist/Utils/InternalUtils.d.ts +0 -1
- package/dist/Utils/Mine.d.ts +0 -3
- package/dist/Utils/Utils.d.ts +0 -22
- package/dist/index.cjs +0 -2704
- package/dist/index.d.ts +0 -52
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "node:module";
|
|
1
2
|
import { BaseDecorator, Container, Inject, InjectOptional, createDecorator, initializeContainer } from "@vercube/di";
|
|
2
3
|
import { FastResponse, serve } from "srvx";
|
|
3
4
|
import { addRoute, createRouter, findRoute } from "rou3";
|
|
@@ -5,23 +6,54 @@ import { createReadStream } from "node:fs";
|
|
|
5
6
|
import { extname, join, normalize } from "node:path";
|
|
6
7
|
import { stat } from "node:fs/promises";
|
|
7
8
|
import { BaseLogger, Logger, colors } from "@vercube/logger";
|
|
9
|
+
import { ConsoleProvider } from "@vercube/logger/providers";
|
|
8
10
|
import { loadConfig } from "c12";
|
|
9
11
|
import { defu } from "defu";
|
|
10
12
|
|
|
11
|
-
//#region
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
//#region rolldown:runtime
|
|
14
|
+
var __create = Object.create;
|
|
15
|
+
var __defProp = Object.defineProperty;
|
|
16
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
17
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
18
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
19
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
20
|
+
var __commonJS = (cb, mod) => function() {
|
|
21
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
22
|
+
};
|
|
23
|
+
var __copyProps = (to, from, except, desc) => {
|
|
24
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
25
|
+
key = keys[i];
|
|
26
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
27
|
+
get: ((k) => from[k]).bind(null, key),
|
|
28
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return to;
|
|
32
|
+
};
|
|
33
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
34
|
+
value: mod,
|
|
35
|
+
enumerable: true
|
|
36
|
+
}) : target, mod));
|
|
18
37
|
|
|
19
38
|
//#endregion
|
|
20
|
-
//#region
|
|
39
|
+
//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.1/node_modules/@oxc-project/runtime/src/helpers/decorate.js
|
|
40
|
+
var require_decorate = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.1/node_modules/@oxc-project/runtime/src/helpers/decorate.js"(exports, module) {
|
|
41
|
+
function __decorate(decorators, target, key, desc) {
|
|
42
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
43
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
44
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
45
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
46
|
+
}
|
|
47
|
+
module.exports = __decorate, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
48
|
+
} });
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/Services/Plugins/PluginsRegistry.ts
|
|
52
|
+
var import_decorate$18 = __toESM(require_decorate());
|
|
21
53
|
var PluginsRegistry = class {
|
|
22
54
|
gContainer;
|
|
23
55
|
/** Holds the list of plugins */
|
|
24
|
-
fPlugins = new Map();
|
|
56
|
+
fPlugins = /* @__PURE__ */ new Map();
|
|
25
57
|
/**
|
|
26
58
|
* Registers a plugin.
|
|
27
59
|
*
|
|
@@ -52,16 +84,16 @@ var PluginsRegistry = class {
|
|
|
52
84
|
for (const { instance, options } of this.fPlugins.values()) await instance.use(app, options);
|
|
53
85
|
}
|
|
54
86
|
};
|
|
55
|
-
|
|
87
|
+
(0, import_decorate$18.default)([Inject(Container)], PluginsRegistry.prototype, "gContainer", void 0);
|
|
56
88
|
|
|
57
89
|
//#endregion
|
|
58
|
-
//#region
|
|
90
|
+
//#region src/Services/Hooks/HooksService.ts
|
|
59
91
|
/**
|
|
60
92
|
* This class is responsible for managing events.
|
|
61
93
|
*/
|
|
62
94
|
var HooksService = class {
|
|
63
95
|
fLastId = 0;
|
|
64
|
-
fHandlers = new Map();
|
|
96
|
+
fHandlers = /* @__PURE__ */ new Map();
|
|
65
97
|
/**
|
|
66
98
|
* Registers listener for event of particular type. Everytime event is called, the listener
|
|
67
99
|
* will be executed.
|
|
@@ -165,15 +197,16 @@ var HooksService = class {
|
|
|
165
197
|
};
|
|
166
198
|
|
|
167
199
|
//#endregion
|
|
168
|
-
//#region
|
|
200
|
+
//#region src/Hooks/Router/RouterBeforeInitHook.ts
|
|
169
201
|
var RouterBeforeInitHook = class {};
|
|
170
202
|
|
|
171
203
|
//#endregion
|
|
172
|
-
//#region
|
|
204
|
+
//#region src/Hooks/Router/RouterAfterInitHook.ts
|
|
173
205
|
var RouterAfterInitHook = class {};
|
|
174
206
|
|
|
175
207
|
//#endregion
|
|
176
|
-
//#region
|
|
208
|
+
//#region src/Services/Router/Router.ts
|
|
209
|
+
var import_decorate$17 = __toESM(require_decorate());
|
|
177
210
|
/**
|
|
178
211
|
* Router service responsible for managing application routes
|
|
179
212
|
*
|
|
@@ -226,10 +259,10 @@ var Router = class {
|
|
|
226
259
|
return findRoute(this.fRouterContext, route.method.toUpperCase(), url);
|
|
227
260
|
}
|
|
228
261
|
};
|
|
229
|
-
|
|
262
|
+
(0, import_decorate$17.default)([Inject(HooksService)], Router.prototype, "gHooksService", void 0);
|
|
230
263
|
|
|
231
264
|
//#endregion
|
|
232
|
-
//#region
|
|
265
|
+
//#region src/Resolvers/RouterParam.ts
|
|
233
266
|
/**
|
|
234
267
|
* Resolves a router parameter from the event object
|
|
235
268
|
* @param param - The parameter name to resolve from the router event
|
|
@@ -246,7 +279,7 @@ function resolveRouterParam(param, event) {
|
|
|
246
279
|
}
|
|
247
280
|
|
|
248
281
|
//#endregion
|
|
249
|
-
//#region
|
|
282
|
+
//#region src/Errors/HttpError.ts
|
|
250
283
|
/**
|
|
251
284
|
* Represents an HTTP error.
|
|
252
285
|
* @extends {Error}
|
|
@@ -272,7 +305,7 @@ var HttpError = class HttpError extends Error {
|
|
|
272
305
|
};
|
|
273
306
|
|
|
274
307
|
//#endregion
|
|
275
|
-
//#region
|
|
308
|
+
//#region src/Errors/Http/BadRequestError.ts
|
|
276
309
|
/**
|
|
277
310
|
* Represents a Bad Request error (HTTP 400).
|
|
278
311
|
* @extends {HttpError}
|
|
@@ -296,7 +329,7 @@ var BadRequestError = class BadRequestError extends HttpError {
|
|
|
296
329
|
};
|
|
297
330
|
|
|
298
331
|
//#endregion
|
|
299
|
-
//#region
|
|
332
|
+
//#region src/Resolvers/Body.ts
|
|
300
333
|
/**
|
|
301
334
|
* Resolves and parses the request body from a RouterEvent.
|
|
302
335
|
*
|
|
@@ -328,7 +361,7 @@ async function resolveRequestBody(event) {
|
|
|
328
361
|
}
|
|
329
362
|
|
|
330
363
|
//#endregion
|
|
331
|
-
//#region
|
|
364
|
+
//#region src/Resolvers/Query.ts
|
|
332
365
|
/**
|
|
333
366
|
* Resolves a single query parameter from the URL of a router event
|
|
334
367
|
* @param name - The name of the query parameter to resolve
|
|
@@ -352,7 +385,7 @@ function resolveQueryParams(event) {
|
|
|
352
385
|
}
|
|
353
386
|
|
|
354
387
|
//#endregion
|
|
355
|
-
//#region
|
|
388
|
+
//#region src/Resolvers/Headers.ts
|
|
356
389
|
/**
|
|
357
390
|
* Retrieves a specific header value from the request
|
|
358
391
|
* @param {string} header - The name of the header to retrieve
|
|
@@ -372,7 +405,7 @@ function getRequestHeaders(event) {
|
|
|
372
405
|
}
|
|
373
406
|
|
|
374
407
|
//#endregion
|
|
375
|
-
//#region
|
|
408
|
+
//#region src/Services/Metadata/MetadataResolver.ts
|
|
376
409
|
/**
|
|
377
410
|
* Class responsible for resolving metadata for route handlers.
|
|
378
411
|
*/
|
|
@@ -450,7 +483,7 @@ var MetadataResolver = class {
|
|
|
450
483
|
};
|
|
451
484
|
|
|
452
485
|
//#endregion
|
|
453
|
-
//#region
|
|
486
|
+
//#region src/Services/ErrorHandler/ErrorHandlerProvider.ts
|
|
454
487
|
/**
|
|
455
488
|
* Abstract class representing an error handler provider
|
|
456
489
|
* Provides a common interface for different error handler implementations
|
|
@@ -461,7 +494,7 @@ var MetadataResolver = class {
|
|
|
461
494
|
var ErrorHandlerProvider = class {};
|
|
462
495
|
|
|
463
496
|
//#endregion
|
|
464
|
-
//#region
|
|
497
|
+
//#region src/Services/Middleware/GlobalMiddlewareRegistry.ts
|
|
465
498
|
/**
|
|
466
499
|
* Manages global middleware registration and retrieval
|
|
467
500
|
*
|
|
@@ -470,7 +503,7 @@ var ErrorHandlerProvider = class {};
|
|
|
470
503
|
* retrieving them in a standardized format.
|
|
471
504
|
*/
|
|
472
505
|
var GlobalMiddlewareRegistry = class {
|
|
473
|
-
fMiddlewares = new Set();
|
|
506
|
+
fMiddlewares = /* @__PURE__ */ new Set();
|
|
474
507
|
/**
|
|
475
508
|
* Retrieves all registered global middleware configurations
|
|
476
509
|
*
|
|
@@ -499,7 +532,8 @@ var GlobalMiddlewareRegistry = class {
|
|
|
499
532
|
};
|
|
500
533
|
|
|
501
534
|
//#endregion
|
|
502
|
-
//#region
|
|
535
|
+
//#region src/Services/Router/RequestHandler.ts
|
|
536
|
+
var import_decorate$16 = __toESM(require_decorate());
|
|
503
537
|
/**
|
|
504
538
|
* Handles HTTP requests by preparing and executing route handlers with their associated middlewares
|
|
505
539
|
*
|
|
@@ -576,7 +610,8 @@ var RequestHandler = class {
|
|
|
576
610
|
});
|
|
577
611
|
if (hookResponse instanceof Response) return hookResponse;
|
|
578
612
|
} catch (error_) {
|
|
579
|
-
this.gContainer.get(ErrorHandlerProvider).handleError(error_);
|
|
613
|
+
const error = this.gContainer.get(ErrorHandlerProvider).handleError(error_);
|
|
614
|
+
if (error instanceof Response) return error;
|
|
580
615
|
}
|
|
581
616
|
for (const action of actions) {
|
|
582
617
|
const actionResponse = action.handler(request, fakeResponse);
|
|
@@ -593,7 +628,8 @@ var RequestHandler = class {
|
|
|
593
628
|
const hookResponse = await hook.middleware.onResponse?.(request, fakeResponse, handlerResponse);
|
|
594
629
|
if (hookResponse !== null) fakeResponse = this.processOverrideResponse(hookResponse, fakeResponse);
|
|
595
630
|
} catch (error_) {
|
|
596
|
-
this.gContainer.get(ErrorHandlerProvider).handleError(error_);
|
|
631
|
+
const error = this.gContainer.get(ErrorHandlerProvider).handleError(error_);
|
|
632
|
+
if (error instanceof Response) return error;
|
|
597
633
|
}
|
|
598
634
|
const body = fakeResponse?.body ?? JSON.stringify(handlerResponse);
|
|
599
635
|
const response = new Response(body, {
|
|
@@ -632,12 +668,12 @@ var RequestHandler = class {
|
|
|
632
668
|
return fakeResponse;
|
|
633
669
|
}
|
|
634
670
|
};
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
671
|
+
(0, import_decorate$16.default)([Inject(MetadataResolver)], RequestHandler.prototype, "gMetadataResolver", void 0);
|
|
672
|
+
(0, import_decorate$16.default)([Inject(Container)], RequestHandler.prototype, "gContainer", void 0);
|
|
673
|
+
(0, import_decorate$16.default)([Inject(GlobalMiddlewareRegistry)], RequestHandler.prototype, "gGlobalMiddlewareRegistry", void 0);
|
|
638
674
|
|
|
639
675
|
//#endregion
|
|
640
|
-
//#region
|
|
676
|
+
//#region src/Utils/Mine.ts
|
|
641
677
|
const mime = { getType(ext) {
|
|
642
678
|
const types = {
|
|
643
679
|
".html": "text/html",
|
|
@@ -655,7 +691,7 @@ const mime = { getType(ext) {
|
|
|
655
691
|
} };
|
|
656
692
|
|
|
657
693
|
//#endregion
|
|
658
|
-
//#region
|
|
694
|
+
//#region src/Services/Router/StaticRequestHandler.ts
|
|
659
695
|
/**
|
|
660
696
|
* Handles serving static files over HTTP
|
|
661
697
|
*
|
|
@@ -729,7 +765,8 @@ var StaticRequestHandler = class {
|
|
|
729
765
|
};
|
|
730
766
|
|
|
731
767
|
//#endregion
|
|
732
|
-
//#region
|
|
768
|
+
//#region src/Services/HttpServer/HttpServer.ts
|
|
769
|
+
var import_decorate$15 = __toESM(require_decorate());
|
|
733
770
|
/**
|
|
734
771
|
* HTTP server implementation for handling incoming web requests
|
|
735
772
|
*
|
|
@@ -816,13 +853,14 @@ var HttpServer = class {
|
|
|
816
853
|
}
|
|
817
854
|
}
|
|
818
855
|
};
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
856
|
+
(0, import_decorate$15.default)([Inject(Container)], HttpServer.prototype, "gContainer", void 0);
|
|
857
|
+
(0, import_decorate$15.default)([Inject(Router)], HttpServer.prototype, "gRouter", void 0);
|
|
858
|
+
(0, import_decorate$15.default)([Inject(RequestHandler)], HttpServer.prototype, "gRequestHandler", void 0);
|
|
859
|
+
(0, import_decorate$15.default)([Inject(StaticRequestHandler)], HttpServer.prototype, "gStaticRequestHandler", void 0);
|
|
823
860
|
|
|
824
861
|
//#endregion
|
|
825
|
-
//#region
|
|
862
|
+
//#region src/Common/App.ts
|
|
863
|
+
var import_decorate$14 = __toESM(require_decorate());
|
|
826
864
|
/**
|
|
827
865
|
* Represents the main application class.
|
|
828
866
|
*/
|
|
@@ -907,65 +945,14 @@ var App = class {
|
|
|
907
945
|
await this.gPluginsRegistry.init(this);
|
|
908
946
|
}
|
|
909
947
|
};
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
//#endregion
|
|
917
|
-
//#region packages/logger/dist/Providers/index.mjs
|
|
918
|
-
/**
|
|
919
|
-
* Abstract base class for implementing log provider.
|
|
920
|
-
* Providers are responsible for processing and outputting log messages to various destinations.
|
|
921
|
-
* Each appender can be initialized with custom options and handles message processing according to its implementation.
|
|
922
|
-
*
|
|
923
|
-
* @template T - The type of options used to initialize the appender
|
|
924
|
-
*/
|
|
925
|
-
var LoggerProvider = class {};
|
|
926
|
-
const isColorAllowed = () => !process.env.NO_COLOR;
|
|
927
|
-
const colorIfAllowed = (colorFn) => {
|
|
928
|
-
const wrappedFn = (text) => {
|
|
929
|
-
return isColorAllowed() ? colorFn(text) : text;
|
|
930
|
-
};
|
|
931
|
-
return wrappedFn;
|
|
932
|
-
};
|
|
933
|
-
const colors$1 = {
|
|
934
|
-
bold: colorIfAllowed((text) => `\x1B[1m${text}\x1B[0m`),
|
|
935
|
-
green: colorIfAllowed((text) => `\x1B[32m${text}\x1B[39m`),
|
|
936
|
-
yellow: colorIfAllowed((text) => `\x1B[33m${text}\x1B[39m`),
|
|
937
|
-
red: colorIfAllowed((text) => `\x1B[31m${text}\x1B[39m`),
|
|
938
|
-
magentaBright: colorIfAllowed((text) => `\x1B[95m${text}\x1B[39m`),
|
|
939
|
-
cyanBright: colorIfAllowed((text) => `\x1B[96m${text}\x1B[39m`)
|
|
940
|
-
};
|
|
941
|
-
const LOG_LEVEL_COLORS = {
|
|
942
|
-
debug: colors$1.green,
|
|
943
|
-
info: colors$1.bold,
|
|
944
|
-
warn: colors$1.yellow,
|
|
945
|
-
error: colors$1.red
|
|
946
|
-
};
|
|
947
|
-
/**
|
|
948
|
-
* ConsoleProvider class for logging messages to the console.
|
|
949
|
-
*/
|
|
950
|
-
var ConsoleProvider = class extends LoggerProvider {
|
|
951
|
-
/**
|
|
952
|
-
* Initializes the appender with the provided options.
|
|
953
|
-
* This method should be called before using the appender to process messages.
|
|
954
|
-
*/
|
|
955
|
-
initialize() {}
|
|
956
|
-
/**
|
|
957
|
-
* Prints a log message according to the specified format and level.
|
|
958
|
-
* @param message - The log message object containing level, tag, and arguments
|
|
959
|
-
* @protected
|
|
960
|
-
*/
|
|
961
|
-
processMessage(message) {
|
|
962
|
-
const date = message.timestamp ? new Date(message.timestamp) : new Date();
|
|
963
|
-
console[message.level](`%s%s${message?.tag ? "%s" : ""} %s`, LOG_LEVEL_COLORS[message.level](`[${date.toISOString().split("T")[1]?.replace("Z", "")}]`), LOG_LEVEL_COLORS[message.level](`[${message.level.toUpperCase().padEnd(5, " ")}]`), message?.tag ? LOG_LEVEL_COLORS[message.level](`[${message.tag}]`) : "", ...message.args);
|
|
964
|
-
}
|
|
965
|
-
};
|
|
948
|
+
(0, import_decorate$14.default)([Inject(Router)], App.prototype, "gRouter", void 0);
|
|
949
|
+
(0, import_decorate$14.default)([Inject(PluginsRegistry)], App.prototype, "gPluginsRegistry", void 0);
|
|
950
|
+
(0, import_decorate$14.default)([Inject(HttpServer)], App.prototype, "gHttpServer", void 0);
|
|
951
|
+
(0, import_decorate$14.default)([Inject(StaticRequestHandler)], App.prototype, "gStaticRequestHandler", void 0);
|
|
952
|
+
(0, import_decorate$14.default)([InjectOptional(Logger)], App.prototype, "gLogger", void 0);
|
|
966
953
|
|
|
967
954
|
//#endregion
|
|
968
|
-
//#region
|
|
955
|
+
//#region src/Services/Validation/ValidationProvider.ts
|
|
969
956
|
/**
|
|
970
957
|
* Abstract class representing a validation provider
|
|
971
958
|
* Provides a common interface for different validation implementations
|
|
@@ -976,7 +963,7 @@ var ConsoleProvider = class extends LoggerProvider {
|
|
|
976
963
|
var ValidationProvider = class {};
|
|
977
964
|
|
|
978
965
|
//#endregion
|
|
979
|
-
//#region
|
|
966
|
+
//#region src/Services/Validation/StandardSchemaValidationProvider.ts
|
|
980
967
|
/**
|
|
981
968
|
* StandardSchemaValidationProvider implements validation using StandardSchema schema validation
|
|
982
969
|
* @see https://github.com/standard-schema/standard-schema
|
|
@@ -996,7 +983,7 @@ var StandardSchemaValidationProvider = class {
|
|
|
996
983
|
};
|
|
997
984
|
|
|
998
985
|
//#endregion
|
|
999
|
-
//#region
|
|
986
|
+
//#region src/Services/Config/RuntimeConfig.ts
|
|
1000
987
|
/**
|
|
1001
988
|
* RuntimeConfig class manages the runtime configuration for the Vercube application.
|
|
1002
989
|
* This class provides a centralized way to access and modify runtime configuration settings.
|
|
@@ -1024,7 +1011,7 @@ var RuntimeConfig = class {
|
|
|
1024
1011
|
};
|
|
1025
1012
|
|
|
1026
1013
|
//#endregion
|
|
1027
|
-
//#region
|
|
1014
|
+
//#region src/Errors/Http/InternalServerError.ts
|
|
1028
1015
|
/**
|
|
1029
1016
|
* Represents an Internal Server error (HTTP 500).
|
|
1030
1017
|
* @extends {HttpError}
|
|
@@ -1047,7 +1034,8 @@ var InternalServerError = class InternalServerError extends HttpError {
|
|
|
1047
1034
|
};
|
|
1048
1035
|
|
|
1049
1036
|
//#endregion
|
|
1050
|
-
//#region
|
|
1037
|
+
//#region src/Services/ErrorHandler/DefaultErrorHandlerProvider.ts
|
|
1038
|
+
var import_decorate$13 = __toESM(require_decorate());
|
|
1051
1039
|
/**
|
|
1052
1040
|
* Default error handler provider
|
|
1053
1041
|
*
|
|
@@ -1069,10 +1057,10 @@ var DefaultErrorHandlerProvider = class extends ErrorHandlerProvider {
|
|
|
1069
1057
|
return new FastResponse(JSON.stringify({ ...error?.cause ?? _internalError }, void 0, 2), { status });
|
|
1070
1058
|
}
|
|
1071
1059
|
};
|
|
1072
|
-
|
|
1060
|
+
(0, import_decorate$13.default)([Inject(Logger)], DefaultErrorHandlerProvider.prototype, "gLogger", void 0);
|
|
1073
1061
|
|
|
1074
1062
|
//#endregion
|
|
1075
|
-
//#region
|
|
1063
|
+
//#region src/Common/Container.ts
|
|
1076
1064
|
/**
|
|
1077
1065
|
* Creates and configures a new dependency injection container for the application.
|
|
1078
1066
|
*
|
|
@@ -1104,7 +1092,7 @@ function createContainer(config) {
|
|
|
1104
1092
|
}
|
|
1105
1093
|
|
|
1106
1094
|
//#endregion
|
|
1107
|
-
//#region
|
|
1095
|
+
//#region src/Utils/InternalUtils.ts
|
|
1108
1096
|
/**
|
|
1109
1097
|
* Generate random hash
|
|
1110
1098
|
* @returns string
|
|
@@ -1116,7 +1104,7 @@ function generateRandomHash() {
|
|
|
1116
1104
|
}
|
|
1117
1105
|
|
|
1118
1106
|
//#endregion
|
|
1119
|
-
//#region
|
|
1107
|
+
//#region src/Config/DefaultConfig.ts
|
|
1120
1108
|
/**
|
|
1121
1109
|
* Default configuration for the Vercube application.
|
|
1122
1110
|
* This configuration serves as the base settings and can be overridden by user configuration.
|
|
@@ -1150,7 +1138,7 @@ const defaultConfig = {
|
|
|
1150
1138
|
};
|
|
1151
1139
|
|
|
1152
1140
|
//#endregion
|
|
1153
|
-
//#region
|
|
1141
|
+
//#region src/Config/Loader.ts
|
|
1154
1142
|
/**
|
|
1155
1143
|
* Loads the configuration object for the application
|
|
1156
1144
|
* @param {ConfigTypes.Config} overrides - The configuration object to load
|
|
@@ -1168,7 +1156,7 @@ async function loadVercubeConfig(overrides) {
|
|
|
1168
1156
|
}
|
|
1169
1157
|
|
|
1170
1158
|
//#endregion
|
|
1171
|
-
//#region
|
|
1159
|
+
//#region src/Common/CreateApp.ts
|
|
1172
1160
|
/**
|
|
1173
1161
|
* Creates and initializes an instance of the App.
|
|
1174
1162
|
*
|
|
@@ -1186,7 +1174,7 @@ async function createApp(cfg) {
|
|
|
1186
1174
|
}
|
|
1187
1175
|
|
|
1188
1176
|
//#endregion
|
|
1189
|
-
//#region
|
|
1177
|
+
//#region src/Config/Config.ts
|
|
1190
1178
|
/**
|
|
1191
1179
|
* Defines a configuration object for the application
|
|
1192
1180
|
* @param {ConfigTypes.Config} config - The configuration object to validate
|
|
@@ -1197,7 +1185,8 @@ function defineConfig(config) {
|
|
|
1197
1185
|
}
|
|
1198
1186
|
|
|
1199
1187
|
//#endregion
|
|
1200
|
-
//#region
|
|
1188
|
+
//#region src/Middleware/ValidationMiddleware.ts
|
|
1189
|
+
var import_decorate$12 = __toESM(require_decorate());
|
|
1201
1190
|
/**
|
|
1202
1191
|
* Middleware for validating request data against a schema
|
|
1203
1192
|
* @class ValidationMiddleware
|
|
@@ -1229,10 +1218,10 @@ var ValidationMiddleware = class {
|
|
|
1229
1218
|
}
|
|
1230
1219
|
}
|
|
1231
1220
|
};
|
|
1232
|
-
|
|
1221
|
+
(0, import_decorate$12.default)([InjectOptional(ValidationProvider)], ValidationMiddleware.prototype, "gValidationProvider", void 0);
|
|
1233
1222
|
|
|
1234
1223
|
//#endregion
|
|
1235
|
-
//#region
|
|
1224
|
+
//#region src/Utils/Utils.ts
|
|
1236
1225
|
/**
|
|
1237
1226
|
* Creates a new metadata context.
|
|
1238
1227
|
* @returns {MetadataTypes.Ctx} The new metadata context.
|
|
@@ -1278,7 +1267,7 @@ function initializeMetadata(target) {
|
|
|
1278
1267
|
}
|
|
1279
1268
|
|
|
1280
1269
|
//#endregion
|
|
1281
|
-
//#region
|
|
1270
|
+
//#region src/Decorators/Http/Body.ts
|
|
1282
1271
|
/**
|
|
1283
1272
|
* @class BodyDecorator
|
|
1284
1273
|
* @extends BaseDecorator<BodyDecoratorOptions>
|
|
@@ -1322,7 +1311,8 @@ function Body(options) {
|
|
|
1322
1311
|
}
|
|
1323
1312
|
|
|
1324
1313
|
//#endregion
|
|
1325
|
-
//#region
|
|
1314
|
+
//#region src/Decorators/Http/Connect.ts
|
|
1315
|
+
var import_decorate$11 = __toESM(require_decorate());
|
|
1326
1316
|
/**
|
|
1327
1317
|
* A decorator class for handling HTTP CONNECT requests.
|
|
1328
1318
|
*
|
|
@@ -1358,9 +1348,9 @@ var ConnectDecorator = class extends BaseDecorator {
|
|
|
1358
1348
|
});
|
|
1359
1349
|
}
|
|
1360
1350
|
};
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1351
|
+
(0, import_decorate$11.default)([Inject(Router)], ConnectDecorator.prototype, "gRouter", void 0);
|
|
1352
|
+
(0, import_decorate$11.default)([Inject(RequestHandler)], ConnectDecorator.prototype, "gRequestHandler", void 0);
|
|
1353
|
+
(0, import_decorate$11.default)([Inject(MetadataResolver)], ConnectDecorator.prototype, "gMetadataResolver", void 0);
|
|
1364
1354
|
/**
|
|
1365
1355
|
* A factory function for creating a ConnectDecorator.
|
|
1366
1356
|
*
|
|
@@ -1375,7 +1365,7 @@ function Connect(path) {
|
|
|
1375
1365
|
}
|
|
1376
1366
|
|
|
1377
1367
|
//#endregion
|
|
1378
|
-
//#region
|
|
1368
|
+
//#region src/Decorators/Http/Controller.ts
|
|
1379
1369
|
/**
|
|
1380
1370
|
* A factory function for creating a Controller decorator.
|
|
1381
1371
|
*
|
|
@@ -1396,7 +1386,8 @@ function Controller(path) {
|
|
|
1396
1386
|
}
|
|
1397
1387
|
|
|
1398
1388
|
//#endregion
|
|
1399
|
-
//#region
|
|
1389
|
+
//#region src/Decorators/Http/Delete.ts
|
|
1390
|
+
var import_decorate$10 = __toESM(require_decorate());
|
|
1400
1391
|
/**
|
|
1401
1392
|
* A decorator class for handling HTTP DELETE requests.
|
|
1402
1393
|
*
|
|
@@ -1434,9 +1425,9 @@ var DeleteDecorator = class extends BaseDecorator {
|
|
|
1434
1425
|
});
|
|
1435
1426
|
}
|
|
1436
1427
|
};
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1428
|
+
(0, import_decorate$10.default)([Inject(Router)], DeleteDecorator.prototype, "gRouter", void 0);
|
|
1429
|
+
(0, import_decorate$10.default)([Inject(RequestHandler)], DeleteDecorator.prototype, "gRequestHandler", void 0);
|
|
1430
|
+
(0, import_decorate$10.default)([Inject(MetadataResolver)], DeleteDecorator.prototype, "gMetadataResolver", void 0);
|
|
1440
1431
|
/**
|
|
1441
1432
|
* A factory function for creating a DeleteDecorator.
|
|
1442
1433
|
*
|
|
@@ -1451,7 +1442,8 @@ function Delete(path) {
|
|
|
1451
1442
|
}
|
|
1452
1443
|
|
|
1453
1444
|
//#endregion
|
|
1454
|
-
//#region
|
|
1445
|
+
//#region src/Decorators/Http/Get.ts
|
|
1446
|
+
var import_decorate$9 = __toESM(require_decorate());
|
|
1455
1447
|
/**
|
|
1456
1448
|
* A decorator class for handling HTTP GET requests.
|
|
1457
1449
|
*
|
|
@@ -1489,9 +1481,9 @@ var GetDecorator = class extends BaseDecorator {
|
|
|
1489
1481
|
});
|
|
1490
1482
|
}
|
|
1491
1483
|
};
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1484
|
+
(0, import_decorate$9.default)([Inject(Router)], GetDecorator.prototype, "gRouter", void 0);
|
|
1485
|
+
(0, import_decorate$9.default)([Inject(RequestHandler)], GetDecorator.prototype, "gRequestHandler", void 0);
|
|
1486
|
+
(0, import_decorate$9.default)([Inject(MetadataResolver)], GetDecorator.prototype, "gMetadataResolver", void 0);
|
|
1495
1487
|
/**
|
|
1496
1488
|
* A decorator function for handling HTTP GET requests.
|
|
1497
1489
|
*
|
|
@@ -1506,7 +1498,8 @@ function Get(path) {
|
|
|
1506
1498
|
}
|
|
1507
1499
|
|
|
1508
1500
|
//#endregion
|
|
1509
|
-
//#region
|
|
1501
|
+
//#region src/Decorators/Http/Head.ts
|
|
1502
|
+
var import_decorate$8 = __toESM(require_decorate());
|
|
1510
1503
|
/**
|
|
1511
1504
|
* A decorator class for handling HTTP HEAD requests.
|
|
1512
1505
|
*
|
|
@@ -1544,9 +1537,9 @@ var HeadDecorator = class extends BaseDecorator {
|
|
|
1544
1537
|
});
|
|
1545
1538
|
}
|
|
1546
1539
|
};
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1540
|
+
(0, import_decorate$8.default)([Inject(Router)], HeadDecorator.prototype, "gRouter", void 0);
|
|
1541
|
+
(0, import_decorate$8.default)([Inject(RequestHandler)], HeadDecorator.prototype, "gRequestHandler", void 0);
|
|
1542
|
+
(0, import_decorate$8.default)([Inject(MetadataResolver)], HeadDecorator.prototype, "gMetadataResolver", void 0);
|
|
1550
1543
|
/**
|
|
1551
1544
|
* A factory function for creating a HeadDecorator.
|
|
1552
1545
|
*
|
|
@@ -1561,7 +1554,7 @@ function Head(path) {
|
|
|
1561
1554
|
}
|
|
1562
1555
|
|
|
1563
1556
|
//#endregion
|
|
1564
|
-
//#region
|
|
1557
|
+
//#region src/Decorators/Http/Header.ts
|
|
1565
1558
|
/**
|
|
1566
1559
|
* A decorator class for handling HTTP header parameters.
|
|
1567
1560
|
*
|
|
@@ -1603,7 +1596,7 @@ function Header(name) {
|
|
|
1603
1596
|
}
|
|
1604
1597
|
|
|
1605
1598
|
//#endregion
|
|
1606
|
-
//#region
|
|
1599
|
+
//#region src/Decorators/Http/Headers.ts
|
|
1607
1600
|
/**
|
|
1608
1601
|
* This class is responsible for managing headers decorator.
|
|
1609
1602
|
*
|
|
@@ -1642,7 +1635,8 @@ function Headers$1() {
|
|
|
1642
1635
|
}
|
|
1643
1636
|
|
|
1644
1637
|
//#endregion
|
|
1645
|
-
//#region
|
|
1638
|
+
//#region src/Decorators/Http/Options.ts
|
|
1639
|
+
var import_decorate$7 = __toESM(require_decorate());
|
|
1646
1640
|
/**
|
|
1647
1641
|
* A decorator class for handling HTTP OPTIONS requests.
|
|
1648
1642
|
*
|
|
@@ -1680,9 +1674,9 @@ var OptionsDecorator = class extends BaseDecorator {
|
|
|
1680
1674
|
});
|
|
1681
1675
|
}
|
|
1682
1676
|
};
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1677
|
+
(0, import_decorate$7.default)([Inject(Router)], OptionsDecorator.prototype, "gRouter", void 0);
|
|
1678
|
+
(0, import_decorate$7.default)([Inject(RequestHandler)], OptionsDecorator.prototype, "gRequestHandler", void 0);
|
|
1679
|
+
(0, import_decorate$7.default)([Inject(MetadataResolver)], OptionsDecorator.prototype, "gMetadataResolver", void 0);
|
|
1686
1680
|
/**
|
|
1687
1681
|
* A factory function for creating an OptionsDecorator.
|
|
1688
1682
|
*
|
|
@@ -1697,7 +1691,8 @@ function Options(path) {
|
|
|
1697
1691
|
}
|
|
1698
1692
|
|
|
1699
1693
|
//#endregion
|
|
1700
|
-
//#region
|
|
1694
|
+
//#region src/Decorators/Http/Param.ts
|
|
1695
|
+
var import_decorate$6 = __toESM(require_decorate());
|
|
1701
1696
|
/**
|
|
1702
1697
|
* This class is responsible for managing parameter decorators.
|
|
1703
1698
|
*
|
|
@@ -1725,7 +1720,7 @@ var ParamDecorator = class extends BaseDecorator {
|
|
|
1725
1720
|
});
|
|
1726
1721
|
}
|
|
1727
1722
|
};
|
|
1728
|
-
|
|
1723
|
+
(0, import_decorate$6.default)([Inject(MetadataResolver)], ParamDecorator.prototype, "gMetadataResolver", void 0);
|
|
1729
1724
|
/**
|
|
1730
1725
|
* A factory function for creating a ParamDecorator.
|
|
1731
1726
|
*
|
|
@@ -1742,7 +1737,8 @@ function Param(name) {
|
|
|
1742
1737
|
}
|
|
1743
1738
|
|
|
1744
1739
|
//#endregion
|
|
1745
|
-
//#region
|
|
1740
|
+
//#region src/Decorators/Http/Patch.ts
|
|
1741
|
+
var import_decorate$5 = __toESM(require_decorate());
|
|
1746
1742
|
/**
|
|
1747
1743
|
* A decorator class for handling HTTP PATCH requests.
|
|
1748
1744
|
*
|
|
@@ -1778,9 +1774,9 @@ var PatchDecorator = class extends BaseDecorator {
|
|
|
1778
1774
|
});
|
|
1779
1775
|
}
|
|
1780
1776
|
};
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1777
|
+
(0, import_decorate$5.default)([Inject(Router)], PatchDecorator.prototype, "gRouter", void 0);
|
|
1778
|
+
(0, import_decorate$5.default)([Inject(RequestHandler)], PatchDecorator.prototype, "gRequestHandler", void 0);
|
|
1779
|
+
(0, import_decorate$5.default)([Inject(MetadataResolver)], PatchDecorator.prototype, "gMetadataResolver", void 0);
|
|
1784
1780
|
/**
|
|
1785
1781
|
* A factory function for creating a PatchDecorator.
|
|
1786
1782
|
*
|
|
@@ -1795,7 +1791,8 @@ function Patch(path) {
|
|
|
1795
1791
|
}
|
|
1796
1792
|
|
|
1797
1793
|
//#endregion
|
|
1798
|
-
//#region
|
|
1794
|
+
//#region src/Decorators/Http/Post.ts
|
|
1795
|
+
var import_decorate$4 = __toESM(require_decorate());
|
|
1799
1796
|
/**
|
|
1800
1797
|
* A decorator class for handling HTTP POST requests.
|
|
1801
1798
|
*
|
|
@@ -1833,9 +1830,9 @@ var PostDecorator = class extends BaseDecorator {
|
|
|
1833
1830
|
});
|
|
1834
1831
|
}
|
|
1835
1832
|
};
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1833
|
+
(0, import_decorate$4.default)([Inject(Router)], PostDecorator.prototype, "gRouter", void 0);
|
|
1834
|
+
(0, import_decorate$4.default)([Inject(MetadataResolver)], PostDecorator.prototype, "gMetadataResolver", void 0);
|
|
1835
|
+
(0, import_decorate$4.default)([Inject(RequestHandler)], PostDecorator.prototype, "gRequestHandler", void 0);
|
|
1839
1836
|
/**
|
|
1840
1837
|
* A factory function for creating a PostDecorator.
|
|
1841
1838
|
*
|
|
@@ -1850,7 +1847,8 @@ function Post(path) {
|
|
|
1850
1847
|
}
|
|
1851
1848
|
|
|
1852
1849
|
//#endregion
|
|
1853
|
-
//#region
|
|
1850
|
+
//#region src/Decorators/Http/Put.ts
|
|
1851
|
+
var import_decorate$3 = __toESM(require_decorate());
|
|
1854
1852
|
/**
|
|
1855
1853
|
* A decorator class for handling HTTP PUT requests.
|
|
1856
1854
|
*
|
|
@@ -1888,9 +1886,9 @@ var PutDecorator = class extends BaseDecorator {
|
|
|
1888
1886
|
});
|
|
1889
1887
|
}
|
|
1890
1888
|
};
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1889
|
+
(0, import_decorate$3.default)([Inject(Router)], PutDecorator.prototype, "gRouter", void 0);
|
|
1890
|
+
(0, import_decorate$3.default)([Inject(RequestHandler)], PutDecorator.prototype, "gRequestHandler", void 0);
|
|
1891
|
+
(0, import_decorate$3.default)([Inject(MetadataResolver)], PutDecorator.prototype, "gMetadataResolver", void 0);
|
|
1894
1892
|
/**
|
|
1895
1893
|
* A factory function for creating a PutDecorator.
|
|
1896
1894
|
*
|
|
@@ -1905,7 +1903,7 @@ function Put(path) {
|
|
|
1905
1903
|
}
|
|
1906
1904
|
|
|
1907
1905
|
//#endregion
|
|
1908
|
-
//#region
|
|
1906
|
+
//#region src/Decorators/Http/QueryParam.ts
|
|
1909
1907
|
/**
|
|
1910
1908
|
* This class is responsible for managing query parameter decorators.
|
|
1911
1909
|
*
|
|
@@ -1954,7 +1952,7 @@ function QueryParam(options) {
|
|
|
1954
1952
|
}
|
|
1955
1953
|
|
|
1956
1954
|
//#endregion
|
|
1957
|
-
//#region
|
|
1955
|
+
//#region src/Decorators/Http/QueryParams.ts
|
|
1958
1956
|
/**
|
|
1959
1957
|
* This class is responsible for managing query parameters decorators.
|
|
1960
1958
|
*
|
|
@@ -2003,7 +2001,7 @@ function QueryParams(options) {
|
|
|
2003
2001
|
}
|
|
2004
2002
|
|
|
2005
2003
|
//#endregion
|
|
2006
|
-
//#region
|
|
2004
|
+
//#region src/Decorators/Http/Request.ts
|
|
2007
2005
|
/**
|
|
2008
2006
|
* This class is responsible for managing request decorators.
|
|
2009
2007
|
*
|
|
@@ -2042,7 +2040,7 @@ function Request() {
|
|
|
2042
2040
|
}
|
|
2043
2041
|
|
|
2044
2042
|
//#endregion
|
|
2045
|
-
//#region
|
|
2043
|
+
//#region src/Decorators/Http/Response.ts
|
|
2046
2044
|
/**
|
|
2047
2045
|
* This class is responsible for managing response decorators.
|
|
2048
2046
|
*
|
|
@@ -2081,7 +2079,8 @@ function Response$1() {
|
|
|
2081
2079
|
}
|
|
2082
2080
|
|
|
2083
2081
|
//#endregion
|
|
2084
|
-
//#region
|
|
2082
|
+
//#region src/Decorators/Http/Trace.ts
|
|
2083
|
+
var import_decorate$2 = __toESM(require_decorate());
|
|
2085
2084
|
/**
|
|
2086
2085
|
* A decorator class for handling HTTP TRACE requests.
|
|
2087
2086
|
*
|
|
@@ -2119,9 +2118,9 @@ var TraceDecorator = class extends BaseDecorator {
|
|
|
2119
2118
|
});
|
|
2120
2119
|
}
|
|
2121
2120
|
};
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2121
|
+
(0, import_decorate$2.default)([Inject(Router)], TraceDecorator.prototype, "gRouter", void 0);
|
|
2122
|
+
(0, import_decorate$2.default)([Inject(RequestHandler)], TraceDecorator.prototype, "gRequestHandler", void 0);
|
|
2123
|
+
(0, import_decorate$2.default)([Inject(MetadataResolver)], TraceDecorator.prototype, "gMetadataResolver", void 0);
|
|
2125
2124
|
/**
|
|
2126
2125
|
* A factory function for creating a TraceDecorator.
|
|
2127
2126
|
*
|
|
@@ -2136,7 +2135,7 @@ function Trace(path) {
|
|
|
2136
2135
|
}
|
|
2137
2136
|
|
|
2138
2137
|
//#endregion
|
|
2139
|
-
//#region
|
|
2138
|
+
//#region src/Decorators/Http/SetHeader.ts
|
|
2140
2139
|
/**
|
|
2141
2140
|
* A decorator that sets a header on the response.
|
|
2142
2141
|
* @extends {BaseDecorator<SetHeaderDecoratorOptions>}
|
|
@@ -2171,7 +2170,7 @@ function SetHeader(key, value) {
|
|
|
2171
2170
|
}
|
|
2172
2171
|
|
|
2173
2172
|
//#endregion
|
|
2174
|
-
//#region
|
|
2173
|
+
//#region src/Decorators/Http/Status.ts
|
|
2175
2174
|
/**
|
|
2176
2175
|
|
|
2177
2176
|
* A decorator that sets a status on the response.
|
|
@@ -2209,7 +2208,7 @@ function Status(code) {
|
|
|
2209
2208
|
}
|
|
2210
2209
|
|
|
2211
2210
|
//#endregion
|
|
2212
|
-
//#region
|
|
2211
|
+
//#region src/Decorators/Http/Redirect.ts
|
|
2213
2212
|
var RedirectDecorator = class extends BaseDecorator {
|
|
2214
2213
|
/**
|
|
2215
2214
|
|
|
@@ -2252,7 +2251,7 @@ function Redirect(location, code = 301) {
|
|
|
2252
2251
|
}
|
|
2253
2252
|
|
|
2254
2253
|
//#endregion
|
|
2255
|
-
//#region
|
|
2254
|
+
//#region src/Decorators/Http/Middleware.ts
|
|
2256
2255
|
/**
|
|
2257
2256
|
* Decorator that applies middleware to a class or method
|
|
2258
2257
|
* @param middleware - The middleware class to apply
|
|
@@ -2288,7 +2287,7 @@ function Middleware(middleware, opts) {
|
|
|
2288
2287
|
}
|
|
2289
2288
|
|
|
2290
2289
|
//#endregion
|
|
2291
|
-
//#region
|
|
2290
|
+
//#region src/Decorators/Http/MultipartFormData.ts
|
|
2292
2291
|
/**
|
|
2293
2292
|
* @class MultipartFormDataDecorator
|
|
2294
2293
|
* @extends BaseDecorator<MultipartFormDataOptions>
|
|
@@ -2329,7 +2328,8 @@ function MultipartFormData() {
|
|
|
2329
2328
|
}
|
|
2330
2329
|
|
|
2331
2330
|
//#endregion
|
|
2332
|
-
//#region
|
|
2331
|
+
//#region src/Decorators/Http/Session.ts
|
|
2332
|
+
var import_decorate$1 = __toESM(require_decorate());
|
|
2333
2333
|
/**
|
|
2334
2334
|
* This class is responsible for managing session decorators.
|
|
2335
2335
|
*
|
|
@@ -2361,7 +2361,7 @@ var SessionDecorator = class extends BaseDecorator {
|
|
|
2361
2361
|
});
|
|
2362
2362
|
}
|
|
2363
2363
|
};
|
|
2364
|
-
|
|
2364
|
+
(0, import_decorate$1.default)([Inject(RuntimeConfig)], SessionDecorator.prototype, "gRuntimeConfig", void 0);
|
|
2365
2365
|
/**
|
|
2366
2366
|
* A factory function for creating a SessionDecorator.
|
|
2367
2367
|
*
|
|
@@ -2375,7 +2375,8 @@ function Session() {
|
|
|
2375
2375
|
}
|
|
2376
2376
|
|
|
2377
2377
|
//#endregion
|
|
2378
|
-
//#region
|
|
2378
|
+
//#region src/Decorators/Hooks/Listen.ts
|
|
2379
|
+
var import_decorate = __toESM(require_decorate());
|
|
2379
2380
|
/**
|
|
2380
2381
|
* This class is responsible for managing cache decorator.
|
|
2381
2382
|
*/
|
|
@@ -2396,7 +2397,7 @@ var ListenDecorator = class extends BaseDecorator {
|
|
|
2396
2397
|
this.gHooksService.off(this.fHook);
|
|
2397
2398
|
}
|
|
2398
2399
|
};
|
|
2399
|
-
|
|
2400
|
+
(0, import_decorate.default)([Inject(HooksService)], ListenDecorator.prototype, "gHooksService", void 0);
|
|
2400
2401
|
/**
|
|
2401
2402
|
* This decorator stores metadata about hook listeners. It can be later used along with function
|
|
2402
2403
|
* applyEventListeners() to automatically register all listeners.
|
|
@@ -2409,7 +2410,7 @@ function Listen(hookType) {
|
|
|
2409
2410
|
}
|
|
2410
2411
|
|
|
2411
2412
|
//#endregion
|
|
2412
|
-
//#region
|
|
2413
|
+
//#region src/Services/Plugins/BasePlugin.ts
|
|
2413
2414
|
/**
|
|
2414
2415
|
* Represents a Plugin.
|
|
2415
2416
|
*/
|
|
@@ -2427,14 +2428,14 @@ var BasePlugin = class {
|
|
|
2427
2428
|
};
|
|
2428
2429
|
|
|
2429
2430
|
//#endregion
|
|
2430
|
-
//#region
|
|
2431
|
+
//#region src/Services/Middleware/BaseMiddleware.ts
|
|
2431
2432
|
/**
|
|
2432
2433
|
* BaseMiddleware class that serves as a base for all middleware implementations.
|
|
2433
2434
|
*/
|
|
2434
2435
|
var BaseMiddleware = class {};
|
|
2435
2436
|
|
|
2436
2437
|
//#endregion
|
|
2437
|
-
//#region
|
|
2438
|
+
//#region src/Errors/Http/ForbiddenError.ts
|
|
2438
2439
|
/**
|
|
2439
2440
|
* Represents a Forbidden error (HTTP 403).
|
|
2440
2441
|
* @extends {HttpError}
|
|
@@ -2457,7 +2458,7 @@ var ForbiddenError = class ForbiddenError extends HttpError {
|
|
|
2457
2458
|
};
|
|
2458
2459
|
|
|
2459
2460
|
//#endregion
|
|
2460
|
-
//#region
|
|
2461
|
+
//#region src/Errors/Http/MethodNotAllowedError.ts
|
|
2461
2462
|
/**
|
|
2462
2463
|
* Represents a Method Not Allowed error (HTTP 405).
|
|
2463
2464
|
* @extends {HttpError}
|
|
@@ -2480,7 +2481,7 @@ var MethodNotAllowedError = class MethodNotAllowedError extends HttpError {
|
|
|
2480
2481
|
};
|
|
2481
2482
|
|
|
2482
2483
|
//#endregion
|
|
2483
|
-
//#region
|
|
2484
|
+
//#region src/Errors/Http/NotAcceptableError.ts
|
|
2484
2485
|
/**
|
|
2485
2486
|
* Represents a Not Acceptable error (HTTP 406).
|
|
2486
2487
|
* @extends {HttpError}
|
|
@@ -2503,7 +2504,7 @@ var NotAcceptableError = class NotAcceptableError extends HttpError {
|
|
|
2503
2504
|
};
|
|
2504
2505
|
|
|
2505
2506
|
//#endregion
|
|
2506
|
-
//#region
|
|
2507
|
+
//#region src/Errors/Http/NotFoundError.ts
|
|
2507
2508
|
/**
|
|
2508
2509
|
* Represents a Not Found error (HTTP 404).
|
|
2509
2510
|
* @extends {HttpError}
|
|
@@ -2526,7 +2527,7 @@ var NotFoundError = class NotFoundError extends HttpError {
|
|
|
2526
2527
|
};
|
|
2527
2528
|
|
|
2528
2529
|
//#endregion
|
|
2529
|
-
//#region
|
|
2530
|
+
//#region src/Errors/Http/UnauthorizedError.ts
|
|
2530
2531
|
/**
|
|
2531
2532
|
* Represents an Unauthorized error (HTTP 401).
|
|
2532
2533
|
* @extends {HttpError}
|
|
@@ -2549,7 +2550,7 @@ var UnauthorizedError = class UnauthorizedError extends HttpError {
|
|
|
2549
2550
|
};
|
|
2550
2551
|
|
|
2551
2552
|
//#endregion
|
|
2552
|
-
//#region
|
|
2553
|
+
//#region src/Types/HttpTypes.ts
|
|
2553
2554
|
let HTTPStatus = /* @__PURE__ */ function(HTTPStatus$1) {
|
|
2554
2555
|
HTTPStatus$1[HTTPStatus$1["CONTINUE"] = 100] = "CONTINUE";
|
|
2555
2556
|
HTTPStatus$1[HTTPStatus$1["SWITCHING_PROTOCOLS"] = 101] = "SWITCHING_PROTOCOLS";
|