@vercube/core 0.0.1 → 0.0.2-beta.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/index.cjs CHANGED
@@ -34,8 +34,8 @@ const __vercube_logger = __toESM(require("@vercube/logger"));
34
34
  const c12 = __toESM(require("c12"));
35
35
  const defu = __toESM(require("defu"));
36
36
 
37
- //#region node_modules/.pnpm/@oxc-project+runtime@0.63.0/node_modules/@oxc-project/runtime/src/helpers/decorate.js
38
- var require_decorate = __commonJS({ "node_modules/.pnpm/@oxc-project+runtime@0.63.0/node_modules/@oxc-project/runtime/src/helpers/decorate.js"(exports, module) {
37
+ //#region node_modules/.pnpm/@oxc-project+runtime@0.65.0/node_modules/@oxc-project/runtime/src/helpers/decorate.js
38
+ var require_decorate = __commonJS({ "node_modules/.pnpm/@oxc-project+runtime@0.65.0/node_modules/@oxc-project/runtime/src/helpers/decorate.js"(exports, module) {
39
39
  function __decorate(decorators, target, key, desc) {
40
40
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
41
41
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -86,6 +86,9 @@ var PluginsRegistry = class {
86
86
 
87
87
  //#endregion
88
88
  //#region packages/core/src/Services/Hooks/HooksService.ts
89
+ /**
90
+ * This class is responsible for managing events.
91
+ */
89
92
  var HooksService = class {
90
93
  fLastId = 0;
91
94
  fHandlers = new Map();
@@ -201,6 +204,13 @@ var RouterAfterInitHook = class {};
201
204
 
202
205
  //#endregion
203
206
  //#region packages/core/src/Services/Router/Router.ts
207
+ /**
208
+ * Router service responsible for managing application routes
209
+ *
210
+ * This class provides functionality to initialize the router,
211
+ * register routes, and resolve incoming requests to their
212
+ * appropriate handlers.
213
+ */
204
214
  var Router = class {
205
215
  /**
206
216
  * Service for triggering application hooks
@@ -250,12 +260,27 @@ var Router = class {
250
260
 
251
261
  //#endregion
252
262
  //#region packages/core/src/Resolvers/RouterParam.ts
263
+ /**
264
+ * Resolves a router parameter from the event object
265
+ * @param param - The parameter name to resolve from the router event
266
+ * @param event - The router event object containing parameters
267
+ * @returns The resolved parameter value if it exists, null otherwise
268
+ * @example
269
+ * ```typescript
270
+ * const value = resolveRouterParam('id', routerEvent);
271
+ * // Returns the 'id' parameter value from routerEvent.params or null
272
+ * ```
273
+ */
253
274
  function resolveRouterParam(param, event) {
254
275
  return event.params?.[param] ?? null;
255
276
  }
256
277
 
257
278
  //#endregion
258
279
  //#region packages/core/src/Errors/HttpError.ts
280
+ /**
281
+ * Represents an HTTP error.
282
+ * @extends {Error}
283
+ */
259
284
  var HttpError = class HttpError extends Error {
260
285
  /**
261
286
  * The HTTP status code associated with the error.
@@ -278,6 +303,10 @@ var HttpError = class HttpError extends Error {
278
303
 
279
304
  //#endregion
280
305
  //#region packages/core/src/Errors/Http/BadRequestError.ts
306
+ /**
307
+ * Represents a Bad Request error (HTTP 400).
308
+ * @extends {HttpError}
309
+ */
281
310
  var BadRequestError = class BadRequestError extends HttpError {
282
311
  /**
283
312
  * The name of the error.
@@ -298,6 +327,26 @@ var BadRequestError = class BadRequestError extends HttpError {
298
327
 
299
328
  //#endregion
300
329
  //#region packages/core/src/Resolvers/Body.ts
330
+ /**
331
+ * Resolves and parses the request body from a RouterEvent.
332
+ *
333
+ * @param {RouterTypes.RouterEvent} event - The router event containing the request to process
334
+ * @returns {Promise<unknown>} A promise that resolves to:
335
+ * - The parsed JSON body if the request contains valid JSON
336
+ * - undefined if the request body is empty
337
+ * @throws {BadRequestError} If the request body contains invalid JSON
338
+ *
339
+ * @example
340
+ * const body = await resolveRequestBody(event);
341
+ * if (body) {
342
+ * // Process the parsed body
343
+ * }
344
+ *
345
+ * @remarks
346
+ * - Currently only supports JSON content type
347
+ * - Returns undefined for empty request bodies
348
+ * - Throws BadRequestError for malformed JSON
349
+ */
301
350
  async function resolveRequestBody(event) {
302
351
  const text = await event.request.text();
303
352
  if (!text) return void 0;
@@ -310,10 +359,21 @@ async function resolveRequestBody(event) {
310
359
 
311
360
  //#endregion
312
361
  //#region packages/core/src/Resolvers/Query.ts
362
+ /**
363
+ * Resolves a single query parameter from the URL of a router event
364
+ * @param name - The name of the query parameter to resolve
365
+ * @param event - The router event containing the request URL
366
+ * @returns The value of the query parameter if found, null otherwise
367
+ */
313
368
  function resolveQueryParam(name, event) {
314
369
  const url = new URL(event.request.url);
315
370
  return url.searchParams.get(name);
316
371
  }
372
+ /**
373
+ * Resolves all query parameters from the URL of a router event
374
+ * @param event - The router event containing the request URL
375
+ * @returns An object containing all query parameters as key-value pairs
376
+ */
317
377
  function resolveQueryParams(event) {
318
378
  const url = new URL(event.request.url);
319
379
  const params = {};
@@ -323,15 +383,29 @@ function resolveQueryParams(event) {
323
383
 
324
384
  //#endregion
325
385
  //#region packages/core/src/Resolvers/Headers.ts
386
+ /**
387
+ * Retrieves a specific header value from the request
388
+ * @param {string} header - The name of the header to retrieve
389
+ * @param {RouterTypes.RouterEvent} event - The router event containing the request
390
+ * @returns {string | null} The header value if found, null otherwise
391
+ */
326
392
  function getRequestHeader(header, event) {
327
393
  return event.request.headers.get(header);
328
394
  }
395
+ /**
396
+ * Retrieves all headers from the request
397
+ * @param {RouterTypes.RouterEvent} event - The router event containing the request
398
+ * @returns {Headers} The complete Headers object from the request
399
+ */
329
400
  function getRequestHeaders(event) {
330
401
  return event.request.headers;
331
402
  }
332
403
 
333
404
  //#endregion
334
405
  //#region packages/core/src/Services/Metadata/MetadataResolver.ts
406
+ /**
407
+ * Class responsible for resolving metadata for route handlers.
408
+ */
335
409
  var MetadataResolver = class {
336
410
  /**
337
411
  * Resolves the URL for a given instance and path.
@@ -407,10 +481,24 @@ var MetadataResolver = class {
407
481
 
408
482
  //#endregion
409
483
  //#region packages/core/src/Services/ErrorHandler/ErrorHandlerProvider.ts
484
+ /**
485
+ * Abstract class representing an error handler provider
486
+ * Provides a common interface for different error handler implementations
487
+ *
488
+ * @abstract
489
+ * @class ErrorHandlerProvider
490
+ */
410
491
  var ErrorHandlerProvider = class {};
411
492
 
412
493
  //#endregion
413
494
  //#region packages/core/src/Services/Middleware/GlobalMiddlewareRegistry.ts
495
+ /**
496
+ * Manages global middleware registration and retrieval
497
+ *
498
+ * This class provides functionality to register and retrieve global middleware
499
+ * configurations. It allows for adding middleware with specific options and
500
+ * retrieving them in a standardized format.
501
+ */
414
502
  var GlobalMiddlewareRegistry = class {
415
503
  fMiddlewares = new Set();
416
504
  /**
@@ -442,6 +530,15 @@ var GlobalMiddlewareRegistry = class {
442
530
 
443
531
  //#endregion
444
532
  //#region packages/core/src/Services/Router/RequestHandler.ts
533
+ /**
534
+ * Handles HTTP requests by preparing and executing route handlers with their associated middlewares
535
+ *
536
+ * The RequestHandler is responsible for:
537
+ * - Preparing route handlers with their metadata
538
+ * - Executing middleware chains (before and after)
539
+ * - Processing request/response lifecycle
540
+ * - Error handling during request processing
541
+ */
445
542
  var RequestHandler = class {
446
543
  /** Resolver for extracting metadata from controller classes and methods */
447
544
  gMetadataResolver;
@@ -588,6 +685,15 @@ const mime = { getType(ext) {
588
685
 
589
686
  //#endregion
590
687
  //#region packages/core/src/Services/Router/StaticRequestHandler.ts
688
+ /**
689
+ * Handles serving static files over HTTP
690
+ *
691
+ * The StaticRequestHandler is responsible for:
692
+ * - Serving static files from configured directories
693
+ * - Setting appropriate content types and headers
694
+ * - Handling caching and ETags
695
+ * - Processing GET requests for static assets
696
+ */
591
697
  var StaticRequestHandler = class {
592
698
  /**
593
699
  * The options for the static server
@@ -653,6 +759,14 @@ var StaticRequestHandler = class {
653
759
 
654
760
  //#endregion
655
761
  //#region packages/core/src/Services/HttpServer/HttpServer.ts
762
+ /**
763
+ * HTTP server implementation for handling incoming web requests
764
+ *
765
+ * This class is responsible for:
766
+ * - Initializing and managing the HTTP server
767
+ * - Routing incoming requests to appropriate handlers
768
+ * - Processing HTTP responses
769
+ */
656
770
  var HttpServer = class {
657
771
  /**
658
772
  * Router service for resolving routes
@@ -738,6 +852,9 @@ var HttpServer = class {
738
852
 
739
853
  //#endregion
740
854
  //#region packages/core/src/Common/App.ts
855
+ /**
856
+ * Represents the main application class.
857
+ */
741
858
  var App = class {
742
859
  gRouter;
743
860
  gPluginsRegistry;
@@ -814,6 +931,13 @@ var App = class {
814
931
 
815
932
  //#endregion
816
933
  //#region packages/logger/dist/Providers/index.mjs
934
+ /**
935
+ * Abstract base class for implementing log provider.
936
+ * Providers are responsible for processing and outputting log messages to various destinations.
937
+ * Each appender can be initialized with custom options and handles message processing according to its implementation.
938
+ *
939
+ * @template T - The type of options used to initialize the appender
940
+ */
817
941
  var LoggerProvider = class {};
818
942
  const isColorAllowed = () => !process.env.NO_COLOR;
819
943
  const colorIfAllowed = (colorFn) => {
@@ -836,6 +960,9 @@ const LOG_LEVEL_COLORS = {
836
960
  warn: colors.yellow,
837
961
  error: colors.red
838
962
  };
963
+ /**
964
+ * ConsoleProvider class for logging messages to the console.
965
+ */
839
966
  var ConsoleProvider = class extends LoggerProvider {
840
967
  /**
841
968
  * Initializes the appender with the provided options.
@@ -855,10 +982,23 @@ var ConsoleProvider = class extends LoggerProvider {
855
982
 
856
983
  //#endregion
857
984
  //#region packages/core/src/Services/Validation/ValidationProvider.ts
985
+ /**
986
+ * Abstract class representing a validation provider
987
+ * Provides a common interface for different validation implementations
988
+ *
989
+ * @abstract
990
+ * @class ValidationProvider
991
+ */
858
992
  var ValidationProvider = class {};
859
993
 
860
994
  //#endregion
861
995
  //#region packages/core/src/Services/Validation/StandardSchemaValidationProvider.ts
996
+ /**
997
+ * StandardSchemaValidationProvider implements validation using StandardSchema schema validation
998
+ * @see https://github.com/standard-schema/standard-schema
999
+ * @class
1000
+ * @implements {ValidationProvider}
1001
+ */
862
1002
  var StandardSchemaValidationProvider = class {
863
1003
  /**
864
1004
  * Validates data against a schema
@@ -873,6 +1013,10 @@ var StandardSchemaValidationProvider = class {
873
1013
 
874
1014
  //#endregion
875
1015
  //#region packages/core/src/Services/Config/RuntimeConfig.ts
1016
+ /**
1017
+ * RuntimeConfig class manages the runtime configuration for the Vercube application.
1018
+ * This class provides a centralized way to access and modify runtime configuration settings.
1019
+ */
876
1020
  var RuntimeConfig = class {
877
1021
  /**
878
1022
  * Private field to store the runtime configuration object.
@@ -897,6 +1041,10 @@ var RuntimeConfig = class {
897
1041
 
898
1042
  //#endregion
899
1043
  //#region packages/core/src/Errors/Http/InternalServerError.ts
1044
+ /**
1045
+ * Represents an Internal Server error (HTTP 500).
1046
+ * @extends {HttpError}
1047
+ */
900
1048
  var InternalServerError = class InternalServerError extends HttpError {
901
1049
  /**
902
1050
  * The name of the error.
@@ -916,6 +1064,11 @@ var InternalServerError = class InternalServerError extends HttpError {
916
1064
 
917
1065
  //#endregion
918
1066
  //#region packages/core/src/Services/ErrorHandler/DefaultErrorHandlerProvider.ts
1067
+ /**
1068
+ * Default error handler provider
1069
+ *
1070
+ * @class DefaultErrorHandlerProvider
1071
+ */
919
1072
  var DefaultErrorHandlerProvider = class extends ErrorHandlerProvider {
920
1073
  gLogger;
921
1074
  /**
@@ -936,6 +1089,11 @@ var DefaultErrorHandlerProvider = class extends ErrorHandlerProvider {
936
1089
 
937
1090
  //#endregion
938
1091
  //#region packages/core/src/Common/Container.ts
1092
+ /**
1093
+ * Creates and configures a new dependency injection container for the application.
1094
+ *
1095
+ * @returns {Container} A configured dependency injection container.
1096
+ */
939
1097
  function createContainer(config) {
940
1098
  const container = new __vercube_di.Container();
941
1099
  container.bindInstance(__vercube_di.Container, container);
@@ -963,6 +1121,10 @@ function createContainer(config) {
963
1121
 
964
1122
  //#endregion
965
1123
  //#region packages/core/src/Utils/InternalUtils.ts
1124
+ /**
1125
+ * Generate random hash
1126
+ * @returns string
1127
+ */
966
1128
  function generateRandomHash() {
967
1129
  const hashByPerformance = Math.floor(Date.now() * 1e3).toString(16);
968
1130
  const hashByMath = () => (Math.floor(Math.random() * 16777215) | 1048576).toString(16);
@@ -971,6 +1133,10 @@ function generateRandomHash() {
971
1133
 
972
1134
  //#endregion
973
1135
  //#region packages/core/src/Config/DefaultConfig.ts
1136
+ /**
1137
+ * Default configuration for the Vercube application.
1138
+ * This configuration serves as the base settings and can be overridden by user configuration.
1139
+ */
974
1140
  const defaultConfig = {
975
1141
  logLevel: "debug",
976
1142
  production: false,
@@ -1001,6 +1167,11 @@ const defaultConfig = {
1001
1167
 
1002
1168
  //#endregion
1003
1169
  //#region packages/core/src/Config/Loader.ts
1170
+ /**
1171
+ * Loads the configuration object for the application
1172
+ * @param {ConfigTypes.Config} overrides - The configuration object to load
1173
+ * @returns {ConfigTypes.Config} The loaded configuration object
1174
+ */
1004
1175
  async function loadVercubeConfig(overrides) {
1005
1176
  const config = await (0, c12.loadConfig)({
1006
1177
  name: "vercube",
@@ -1014,6 +1185,11 @@ async function loadVercubeConfig(overrides) {
1014
1185
 
1015
1186
  //#endregion
1016
1187
  //#region packages/core/src/Common/CreateApp.ts
1188
+ /**
1189
+ * Creates and initializes an instance of the App.
1190
+ *
1191
+ * @returns {Promise<App>} A promise that resolves to an instance of the App.
1192
+ */
1017
1193
  async function createApp(cfg) {
1018
1194
  const config = await loadVercubeConfig(cfg);
1019
1195
  const container = createContainer(config);
@@ -1027,12 +1203,26 @@ async function createApp(cfg) {
1027
1203
 
1028
1204
  //#endregion
1029
1205
  //#region packages/core/src/Config/Config.ts
1206
+ /**
1207
+ * Defines a configuration object for the application
1208
+ * @param {ConfigTypes.Config} config - The configuration object to validate
1209
+ * @returns {ConfigTypes.Config} The validated configuration object
1210
+ */
1030
1211
  function defineConfig(config) {
1031
1212
  return config;
1032
1213
  }
1033
1214
 
1034
1215
  //#endregion
1035
1216
  //#region packages/core/src/Middleware/ValidationMiddleware.ts
1217
+ /**
1218
+ * Middleware for validating request data against a schema
1219
+ * @class ValidationMiddleware
1220
+ * @implements {BaseMiddleware}
1221
+ * @description Validates incoming request data against a provided schema
1222
+ * @example
1223
+ * const middleware = new ValidationMiddleware();
1224
+ * await middleware.use(event, { schema: myValidationSchema });
1225
+ */
1036
1226
  var ValidationMiddleware = class {
1037
1227
  gValidationProvider;
1038
1228
  /**
@@ -1059,6 +1249,10 @@ var ValidationMiddleware = class {
1059
1249
 
1060
1250
  //#endregion
1061
1251
  //#region packages/core/src/Utils/Utils.ts
1252
+ /**
1253
+ * Creates a new metadata context.
1254
+ * @returns {MetadataTypes.Ctx} The new metadata context.
1255
+ */
1062
1256
  function createMetadataCtx() {
1063
1257
  return {
1064
1258
  __controller: { path: "" },
@@ -1066,6 +1260,10 @@ function createMetadataCtx() {
1066
1260
  __methods: {}
1067
1261
  };
1068
1262
  }
1263
+ /**
1264
+ * Creates a new metadata method.
1265
+ * @returns {MetadataTypes.Method} The new metadata method.
1266
+ */
1069
1267
  function createMetadataMethod() {
1070
1268
  return {
1071
1269
  req: null,
@@ -1075,10 +1273,19 @@ function createMetadataMethod() {
1075
1273
  actions: []
1076
1274
  };
1077
1275
  }
1276
+ /**
1277
+ * Initializes the metadata for a given target and property name.
1278
+ * @param {any} target - The target to initialize metadata for.
1279
+ * @param {string} propertyName - The name of the property to initialize metadata for.
1280
+ */
1078
1281
  function initializeMetadataMethod(target, propertyName) {
1079
1282
  if (!target.__metadata.__methods[propertyName]) target.__metadata.__methods[propertyName] = createMetadataMethod();
1080
1283
  return target.__metadata.__methods[propertyName];
1081
1284
  }
1285
+ /**
1286
+ * Initializes the metadata for a given target.
1287
+ * @param {any} target - The target to initialize metadata for.
1288
+ */
1082
1289
  function initializeMetadata(target) {
1083
1290
  if (!target.__metadata) target.__metadata = createMetadataCtx();
1084
1291
  if (!target.__metadata.__methods) target.__metadata.__methods = {};
@@ -1088,6 +1295,12 @@ function initializeMetadata(target) {
1088
1295
 
1089
1296
  //#endregion
1090
1297
  //#region packages/core/src/Decorators/Http/Body.ts
1298
+ /**
1299
+ * @class BodyDecorator
1300
+ * @extends BaseDecorator<BodyDecoratorOptions>
1301
+ *
1302
+ * A decorator class that handles the metadata for HTTP request bodies.
1303
+ */
1091
1304
  var BodyDecorator = class extends __vercube_di.BaseDecorator {
1092
1305
  /**
1093
1306
  * @method created
@@ -1111,12 +1324,30 @@ var BodyDecorator = class extends __vercube_di.BaseDecorator {
1111
1324
  });
1112
1325
  }
1113
1326
  };
1327
+ /**
1328
+ * @function Body
1329
+ * @returns {Function} A decorator function that registers the BodyDecorator.
1330
+ *
1331
+ * This function creates and returns a decorator that can be used to annotate
1332
+ * a parameter in a method to indicate that it should be populated with the
1333
+ * body of an HTTP request. The decorator uses the BodyDecorator class to
1334
+ * handle the metadata associated with the parameter.
1335
+ */
1114
1336
  function Body(options) {
1115
1337
  return (0, __vercube_di.createDecorator)(BodyDecorator, options);
1116
1338
  }
1117
1339
 
1118
1340
  //#endregion
1119
1341
  //#region packages/core/src/Decorators/Http/Connect.ts
1342
+ /**
1343
+ * A decorator class for handling HTTP CONNECT requests.
1344
+ *
1345
+ * This class extends the BaseDecorator and is used to register CONNECT routes
1346
+ * with the Router. It also resolves metadata for the route handler
1347
+ * using the MetadataResolver.
1348
+ *
1349
+ * @extends {BaseDecorator<ConnectDecoratorOptions>}
1350
+ */
1120
1351
  var ConnectDecorator = class extends __vercube_di.BaseDecorator {
1121
1352
  gRouter;
1122
1353
  gRequestHandler;
@@ -1146,12 +1377,30 @@ var ConnectDecorator = class extends __vercube_di.BaseDecorator {
1146
1377
  (0, import_decorate.default)([(0, __vercube_di.Inject)(Router)], ConnectDecorator.prototype, "gRouter", void 0);
1147
1378
  (0, import_decorate.default)([(0, __vercube_di.Inject)(RequestHandler)], ConnectDecorator.prototype, "gRequestHandler", void 0);
1148
1379
  (0, import_decorate.default)([(0, __vercube_di.Inject)(MetadataResolver)], ConnectDecorator.prototype, "gMetadataResolver", void 0);
1380
+ /**
1381
+ * A factory function for creating a ConnectDecorator.
1382
+ *
1383
+ * This function returns a decorator function that can be used to annotate
1384
+ * a method with CONNECT route information.
1385
+ *
1386
+ * @param {string} path - The path for the CONNECT route.
1387
+ * @return {Function} The decorator function.
1388
+ */
1149
1389
  function Connect(path) {
1150
1390
  return (0, __vercube_di.createDecorator)(ConnectDecorator, { path });
1151
1391
  }
1152
1392
 
1153
1393
  //#endregion
1154
1394
  //#region packages/core/src/Decorators/Http/Controller.ts
1395
+ /**
1396
+ * A factory function for creating a Controller decorator.
1397
+ *
1398
+ * This function returns a decorator function that can be used to annotate
1399
+ * a class with controller metadata, including the base path for the controller.
1400
+ *
1401
+ * @param {string} path - The base path for the controller.
1402
+ * @return {Function} The decorator function.
1403
+ */
1155
1404
  function Controller(path) {
1156
1405
  return function internalDecorator(target) {
1157
1406
  const meta = initializeMetadata(target.prototype);
@@ -1164,6 +1413,15 @@ function Controller(path) {
1164
1413
 
1165
1414
  //#endregion
1166
1415
  //#region packages/core/src/Decorators/Http/Delete.ts
1416
+ /**
1417
+ * A decorator class for handling HTTP DELETE requests.
1418
+ *
1419
+ * This class extends the BaseDecorator and is used to register DELETE routes
1420
+ * with the Router. It also resolves metadata for the route handler
1421
+ * using the MetadataResolver.
1422
+ *
1423
+ * @extends {BaseDecorator<DeleteDecoratorOptions>}
1424
+ */
1167
1425
  var DeleteDecorator = class extends __vercube_di.BaseDecorator {
1168
1426
  gRouter;
1169
1427
  gRequestHandler;
@@ -1195,12 +1453,30 @@ var DeleteDecorator = class extends __vercube_di.BaseDecorator {
1195
1453
  (0, import_decorate.default)([(0, __vercube_di.Inject)(Router)], DeleteDecorator.prototype, "gRouter", void 0);
1196
1454
  (0, import_decorate.default)([(0, __vercube_di.Inject)(RequestHandler)], DeleteDecorator.prototype, "gRequestHandler", void 0);
1197
1455
  (0, import_decorate.default)([(0, __vercube_di.Inject)(MetadataResolver)], DeleteDecorator.prototype, "gMetadataResolver", void 0);
1456
+ /**
1457
+ * A factory function for creating a DeleteDecorator.
1458
+ *
1459
+ * This function returns a decorator function that can be used to annotate
1460
+ * a method with DELETE route information.
1461
+ *
1462
+ * @param {string} path - The path for the DELETE route.
1463
+ * @return {Function} The decorator function.
1464
+ */
1198
1465
  function Delete(path) {
1199
1466
  return (0, __vercube_di.createDecorator)(DeleteDecorator, { path });
1200
1467
  }
1201
1468
 
1202
1469
  //#endregion
1203
1470
  //#region packages/core/src/Decorators/Http/Get.ts
1471
+ /**
1472
+ * A decorator class for handling HTTP GET requests.
1473
+ *
1474
+ * This class extends the BaseDecorator and is used to register GET routes
1475
+ * with the Router. It also resolves metadata for the route handler
1476
+ * using the MetadataResolver.
1477
+ *
1478
+ * @extends {BaseDecorator<GetDecoratorOptions>}
1479
+ */
1204
1480
  var GetDecorator = class extends __vercube_di.BaseDecorator {
1205
1481
  gRouter;
1206
1482
  gRequestHandler;
@@ -1232,12 +1508,30 @@ var GetDecorator = class extends __vercube_di.BaseDecorator {
1232
1508
  (0, import_decorate.default)([(0, __vercube_di.Inject)(Router)], GetDecorator.prototype, "gRouter", void 0);
1233
1509
  (0, import_decorate.default)([(0, __vercube_di.Inject)(RequestHandler)], GetDecorator.prototype, "gRequestHandler", void 0);
1234
1510
  (0, import_decorate.default)([(0, __vercube_di.Inject)(MetadataResolver)], GetDecorator.prototype, "gMetadataResolver", void 0);
1511
+ /**
1512
+ * A decorator function for handling HTTP GET requests.
1513
+ *
1514
+ * This function creates an instance of the GetDecorator class and registers
1515
+ * the GET route with the specified path.
1516
+ *
1517
+ * @param {string} path - The path for the GET route.
1518
+ * @returns {Function} - The decorator function.
1519
+ */
1235
1520
  function Get(path) {
1236
1521
  return (0, __vercube_di.createDecorator)(GetDecorator, { path });
1237
1522
  }
1238
1523
 
1239
1524
  //#endregion
1240
1525
  //#region packages/core/src/Decorators/Http/Head.ts
1526
+ /**
1527
+ * A decorator class for handling HTTP HEAD requests.
1528
+ *
1529
+ * This class extends the BaseDecorator and is used to register HEAD routes
1530
+ * with the Router. It also resolves metadata for the route handler
1531
+ * using the MetadataResolver.
1532
+ *
1533
+ * @extends {BaseDecorator<HeadDecoratorOptions>}
1534
+ */
1241
1535
  var HeadDecorator = class extends __vercube_di.BaseDecorator {
1242
1536
  gRouter;
1243
1537
  gRequestHandler;
@@ -1269,12 +1563,30 @@ var HeadDecorator = class extends __vercube_di.BaseDecorator {
1269
1563
  (0, import_decorate.default)([(0, __vercube_di.Inject)(Router)], HeadDecorator.prototype, "gRouter", void 0);
1270
1564
  (0, import_decorate.default)([(0, __vercube_di.Inject)(RequestHandler)], HeadDecorator.prototype, "gRequestHandler", void 0);
1271
1565
  (0, import_decorate.default)([(0, __vercube_di.Inject)(MetadataResolver)], HeadDecorator.prototype, "gMetadataResolver", void 0);
1566
+ /**
1567
+ * A factory function for creating a HeadDecorator.
1568
+ *
1569
+ * This function returns a decorator function that can be used to annotate
1570
+ * a method with HEAD route information.
1571
+ *
1572
+ * @param {string} path - The path for the HEAD route.
1573
+ * @return {Function} The decorator function.
1574
+ */
1272
1575
  function Head(path) {
1273
1576
  return (0, __vercube_di.createDecorator)(HeadDecorator, { path });
1274
1577
  }
1275
1578
 
1276
1579
  //#endregion
1277
1580
  //#region packages/core/src/Decorators/Http/Header.ts
1581
+ /**
1582
+ * A decorator class for handling HTTP header parameters.
1583
+ *
1584
+ * This class extends the BaseDecorator and is used to register header parameters
1585
+ * with the MetadataResolver. It ensures that the metadata for the property is created
1586
+ * and adds the header information to the metadata.
1587
+ *
1588
+ * @extends {BaseDecorator<HeaderDecoratorOptions>}
1589
+ */
1278
1590
  var HeaderDecorator = class extends __vercube_di.BaseDecorator {
1279
1591
  /**
1280
1592
  * Called when the decorator is created.
@@ -1292,12 +1604,31 @@ var HeaderDecorator = class extends __vercube_di.BaseDecorator {
1292
1604
  });
1293
1605
  }
1294
1606
  };
1607
+ /**
1608
+ * A decorator function for handling HTTP header parameters.
1609
+ *
1610
+ * This function creates a HeaderDecorator with the specified name and registers it.
1611
+ * It is used to annotate a parameter in a method to indicate that it should be
1612
+ * populated with the value of a specific HTTP header.
1613
+ *
1614
+ * @param {string} name - The name of the HTTP header to bind to the parameter.
1615
+ * @returns {Function} - A decorator function that registers the HeaderDecorator.
1616
+ */
1295
1617
  function Header(name) {
1296
1618
  return (0, __vercube_di.createDecorator)(HeaderDecorator, { name });
1297
1619
  }
1298
1620
 
1299
1621
  //#endregion
1300
1622
  //#region packages/core/src/Decorators/Http/Headers.ts
1623
+ /**
1624
+ * This class is responsible for managing headers decorator.
1625
+ *
1626
+ * This class extends the BaseDecorator and is used to register headers parameters
1627
+ * with the MetadataResolver. It ensures that the metadata for the property is created
1628
+ * and adds the headers information to the metadata.
1629
+ *
1630
+ * @extends {BaseDecorator<{}>}
1631
+ */
1301
1632
  var HeadersDecorator = class extends __vercube_di.BaseDecorator {
1302
1633
  /**
1303
1634
  * Called when the decorator is created.
@@ -1314,12 +1645,29 @@ var HeadersDecorator = class extends __vercube_di.BaseDecorator {
1314
1645
  });
1315
1646
  }
1316
1647
  };
1648
+ /**
1649
+ * A factory function for creating a HeadersDecorator.
1650
+ *
1651
+ * This function returns a decorator function that can be used to annotate
1652
+ * a method parameter with headers information.
1653
+ *
1654
+ * @return {Function} The decorator function.
1655
+ */
1317
1656
  function Headers$1() {
1318
1657
  return (0, __vercube_di.createDecorator)(HeadersDecorator, {});
1319
1658
  }
1320
1659
 
1321
1660
  //#endregion
1322
1661
  //#region packages/core/src/Decorators/Http/Options.ts
1662
+ /**
1663
+ * A decorator class for handling HTTP OPTIONS requests.
1664
+ *
1665
+ * This class extends the BaseDecorator and is used to register OPTIONS routes
1666
+ * with the Router. It also resolves metadata for the route handler
1667
+ * using the MetadataResolver.
1668
+ *
1669
+ * @extends {BaseDecorator<OptionsDecoratorOptions>}
1670
+ */
1323
1671
  var OptionsDecorator = class extends __vercube_di.BaseDecorator {
1324
1672
  gRouter;
1325
1673
  gRequestHandler;
@@ -1351,12 +1699,30 @@ var OptionsDecorator = class extends __vercube_di.BaseDecorator {
1351
1699
  (0, import_decorate.default)([(0, __vercube_di.Inject)(Router)], OptionsDecorator.prototype, "gRouter", void 0);
1352
1700
  (0, import_decorate.default)([(0, __vercube_di.Inject)(RequestHandler)], OptionsDecorator.prototype, "gRequestHandler", void 0);
1353
1701
  (0, import_decorate.default)([(0, __vercube_di.Inject)(MetadataResolver)], OptionsDecorator.prototype, "gMetadataResolver", void 0);
1702
+ /**
1703
+ * A factory function for creating an OptionsDecorator.
1704
+ *
1705
+ * This function returns a decorator function that can be used to annotate
1706
+ * a method with OPTIONS route information.
1707
+ *
1708
+ * @param {string} path - The path for the OPTIONS route.
1709
+ * @return {Function} The decorator function.
1710
+ */
1354
1711
  function Options(path) {
1355
1712
  return (0, __vercube_di.createDecorator)(OptionsDecorator, { path });
1356
1713
  }
1357
1714
 
1358
1715
  //#endregion
1359
1716
  //#region packages/core/src/Decorators/Http/Param.ts
1717
+ /**
1718
+ * This class is responsible for managing parameter decorators.
1719
+ *
1720
+ * This class extends the BaseDecorator and is used to register parameter information
1721
+ * with the MetadataResolver. It ensures that the metadata for the property is created
1722
+ * and adds the parameter information to the metadata.
1723
+ *
1724
+ * @extends {BaseDecorator<ParamDecoratorOptions>}
1725
+ */
1360
1726
  var ParamDecorator = class extends __vercube_di.BaseDecorator {
1361
1727
  gMetadataResolver;
1362
1728
  /**
@@ -1376,12 +1742,32 @@ var ParamDecorator = class extends __vercube_di.BaseDecorator {
1376
1742
  }
1377
1743
  };
1378
1744
  (0, import_decorate.default)([(0, __vercube_di.Inject)(MetadataResolver)], ParamDecorator.prototype, "gMetadataResolver", void 0);
1745
+ /**
1746
+ * A factory function for creating a ParamDecorator.
1747
+ *
1748
+ * This function returns a decorator function that can be used to annotate
1749
+ * a method parameter with parameter information.
1750
+ *
1751
+ * @param {string} name - The name of the parameter.
1752
+ * @param {Object} [opts] - Optional settings for the parameter.
1753
+ * @param {boolean} [opts.decode=false] - Whether to decode the parameter.
1754
+ * @return {Function} The decorator function.
1755
+ */
1379
1756
  function Param(name) {
1380
1757
  return (0, __vercube_di.createDecorator)(ParamDecorator, { name });
1381
1758
  }
1382
1759
 
1383
1760
  //#endregion
1384
1761
  //#region packages/core/src/Decorators/Http/Patch.ts
1762
+ /**
1763
+ * A decorator class for handling HTTP PATCH requests.
1764
+ *
1765
+ * This class extends the BaseDecorator and is used to register PATCH routes
1766
+ * with the Router. It also resolves metadata for the route handler
1767
+ * using the MetadataResolver.
1768
+ *
1769
+ * @extends {BaseDecorator<PatchDecoratorOptions>}
1770
+ */
1385
1771
  var PatchDecorator = class extends __vercube_di.BaseDecorator {
1386
1772
  gRouter;
1387
1773
  gRequestHandler;
@@ -1411,12 +1797,30 @@ var PatchDecorator = class extends __vercube_di.BaseDecorator {
1411
1797
  (0, import_decorate.default)([(0, __vercube_di.Inject)(Router)], PatchDecorator.prototype, "gRouter", void 0);
1412
1798
  (0, import_decorate.default)([(0, __vercube_di.Inject)(RequestHandler)], PatchDecorator.prototype, "gRequestHandler", void 0);
1413
1799
  (0, import_decorate.default)([(0, __vercube_di.Inject)(MetadataResolver)], PatchDecorator.prototype, "gMetadataResolver", void 0);
1800
+ /**
1801
+ * A factory function for creating a PatchDecorator.
1802
+ *
1803
+ * This function returns a decorator function that can be used to annotate
1804
+ * a method with PATCH route information.
1805
+ *
1806
+ * @param {string} path - The path for the PATCH route.
1807
+ * @return {Function} The decorator function.
1808
+ */
1414
1809
  function Patch(path) {
1415
1810
  return (0, __vercube_di.createDecorator)(PatchDecorator, { path });
1416
1811
  }
1417
1812
 
1418
1813
  //#endregion
1419
1814
  //#region packages/core/src/Decorators/Http/Post.ts
1815
+ /**
1816
+ * A decorator class for handling HTTP POST requests.
1817
+ *
1818
+ * This class extends the BaseDecorator and is used to register POST routes
1819
+ * with the Router. It also resolves metadata for the route handler
1820
+ * using the MetadataResolver.
1821
+ *
1822
+ * @extends {BaseDecorator<PostDecoratorOptions>}
1823
+ */
1420
1824
  var PostDecorator = class extends __vercube_di.BaseDecorator {
1421
1825
  gRouter;
1422
1826
  gMetadataResolver;
@@ -1448,12 +1852,30 @@ var PostDecorator = class extends __vercube_di.BaseDecorator {
1448
1852
  (0, import_decorate.default)([(0, __vercube_di.Inject)(Router)], PostDecorator.prototype, "gRouter", void 0);
1449
1853
  (0, import_decorate.default)([(0, __vercube_di.Inject)(MetadataResolver)], PostDecorator.prototype, "gMetadataResolver", void 0);
1450
1854
  (0, import_decorate.default)([(0, __vercube_di.Inject)(RequestHandler)], PostDecorator.prototype, "gRequestHandler", void 0);
1855
+ /**
1856
+ * A factory function for creating a PostDecorator.
1857
+ *
1858
+ * This function returns a decorator function that can be used to annotate
1859
+ * a method with POST route information.
1860
+ *
1861
+ * @param {string} path - The path for the POST route.
1862
+ * @return {Function} The decorator function.
1863
+ */
1451
1864
  function Post(path) {
1452
1865
  return (0, __vercube_di.createDecorator)(PostDecorator, { path });
1453
1866
  }
1454
1867
 
1455
1868
  //#endregion
1456
1869
  //#region packages/core/src/Decorators/Http/Put.ts
1870
+ /**
1871
+ * A decorator class for handling HTTP PUT requests.
1872
+ *
1873
+ * This class extends the BaseDecorator and is used to register PUT routes
1874
+ * with the Router. It also resolves metadata for the route handler
1875
+ * using the MetadataResolver.
1876
+ *
1877
+ * @extends {BaseDecorator<PutDecoratorOptions>}
1878
+ */
1457
1879
  var PutDecorator = class extends __vercube_di.BaseDecorator {
1458
1880
  gRouter;
1459
1881
  gRequestHandler;
@@ -1485,12 +1907,30 @@ var PutDecorator = class extends __vercube_di.BaseDecorator {
1485
1907
  (0, import_decorate.default)([(0, __vercube_di.Inject)(Router)], PutDecorator.prototype, "gRouter", void 0);
1486
1908
  (0, import_decorate.default)([(0, __vercube_di.Inject)(RequestHandler)], PutDecorator.prototype, "gRequestHandler", void 0);
1487
1909
  (0, import_decorate.default)([(0, __vercube_di.Inject)(MetadataResolver)], PutDecorator.prototype, "gMetadataResolver", void 0);
1910
+ /**
1911
+ * A factory function for creating a PutDecorator.
1912
+ *
1913
+ * This function returns a decorator function that can be used to annotate
1914
+ * a method with PUT route information.
1915
+ *
1916
+ * @param {string} path - The path for the PUT route.
1917
+ * @return {Function} The decorator function.
1918
+ */
1488
1919
  function Put(path) {
1489
1920
  return (0, __vercube_di.createDecorator)(PutDecorator, { path });
1490
1921
  }
1491
1922
 
1492
1923
  //#endregion
1493
1924
  //#region packages/core/src/Decorators/Http/QueryParam.ts
1925
+ /**
1926
+ * This class is responsible for managing query parameter decorators.
1927
+ *
1928
+ * This class extends the BaseDecorator and is used to register query parameter information
1929
+ * with the MetadataResolver. It ensures that the metadata for the property is created
1930
+ * and adds the query parameter information to the metadata.
1931
+ *
1932
+ * @extends {BaseDecorator<QueryDecoratorOptions>}
1933
+ */
1494
1934
  var QueryParamDecorator = class extends __vercube_di.BaseDecorator {
1495
1935
  /**
1496
1936
  * Called when the decorator is created.
@@ -1516,12 +1956,30 @@ var QueryParamDecorator = class extends __vercube_di.BaseDecorator {
1516
1956
  });
1517
1957
  }
1518
1958
  };
1959
+ /**
1960
+ * A factory function for creating a QueryDecorator.
1961
+ *
1962
+ * This function returns a decorator function that can be used to annotate
1963
+ * a method parameter with query parameter information.
1964
+ *
1965
+ * @param {QueryParamDecoratorOptions} options - The options for the decorator.
1966
+ * @return {Function} The decorator function.
1967
+ */
1519
1968
  function QueryParam(options) {
1520
1969
  return (0, __vercube_di.createDecorator)(QueryParamDecorator, options);
1521
1970
  }
1522
1971
 
1523
1972
  //#endregion
1524
1973
  //#region packages/core/src/Decorators/Http/QueryParams.ts
1974
+ /**
1975
+ * This class is responsible for managing query parameters decorators.
1976
+ *
1977
+ * This class extends the BaseDecorator and is used to register query parameters information
1978
+ * with the MetadataResolver. It ensures that the metadata for the property is created
1979
+ * and adds the query parameters information to the metadata.
1980
+ *
1981
+ * @extends {BaseDecorator<QueryDecoratorOptions>}
1982
+ */
1525
1983
  var QueryParamsDecorator = class extends __vercube_di.BaseDecorator {
1526
1984
  /**
1527
1985
  * Called when the decorator is created.
@@ -1547,12 +2005,30 @@ var QueryParamsDecorator = class extends __vercube_di.BaseDecorator {
1547
2005
  });
1548
2006
  }
1549
2007
  };
2008
+ /**
2009
+ * A factory function for creating a QueryParamsDecorator.
2010
+ *
2011
+ * This function returns a decorator function that can be used to annotate
2012
+ * a method parameter with query parameter information.
2013
+ *
2014
+ * @param {QueryParamsDecoratorOptions} options - The options for the decorator.
2015
+ * @return {Function} The decorator function.
2016
+ */
1550
2017
  function QueryParams(options) {
1551
2018
  return (0, __vercube_di.createDecorator)(QueryParamsDecorator, options);
1552
2019
  }
1553
2020
 
1554
2021
  //#endregion
1555
2022
  //#region packages/core/src/Decorators/Http/Request.ts
2023
+ /**
2024
+ * This class is responsible for managing request decorators.
2025
+ *
2026
+ * This class extends the BaseDecorator and is used to register request information
2027
+ * with the MetadataResolver. It ensures that the metadata for the property is created
2028
+ * and adds the request information to the metadata.
2029
+ *
2030
+ * @extends {BaseDecorator<{}>}
2031
+ */
1556
2032
  var RequestDecorator = class extends __vercube_di.BaseDecorator {
1557
2033
  /**
1558
2034
  * Called when the decorator is created.
@@ -1569,12 +2045,29 @@ var RequestDecorator = class extends __vercube_di.BaseDecorator {
1569
2045
  });
1570
2046
  }
1571
2047
  };
2048
+ /**
2049
+ * A factory function for creating a RequestDecorator.
2050
+ *
2051
+ * This function returns a decorator function that can be used to annotate
2052
+ * a method parameter with request information.
2053
+ *
2054
+ * @return {Function} The decorator function.
2055
+ */
1572
2056
  function Request() {
1573
2057
  return (0, __vercube_di.createDecorator)(RequestDecorator, {});
1574
2058
  }
1575
2059
 
1576
2060
  //#endregion
1577
2061
  //#region packages/core/src/Decorators/Http/Response.ts
2062
+ /**
2063
+ * This class is responsible for managing response decorators.
2064
+ *
2065
+ * This class extends the BaseDecorator and is used to register response information
2066
+ * with the MetadataResolver. It ensures that the metadata for the property is created
2067
+ * and adds the response information to the metadata.
2068
+ *
2069
+ * @extends {BaseDecorator<{}>}
2070
+ */
1578
2071
  var ResponseDecorator = class extends __vercube_di.BaseDecorator {
1579
2072
  /**
1580
2073
  * Called when the decorator is created.
@@ -1591,12 +2084,29 @@ var ResponseDecorator = class extends __vercube_di.BaseDecorator {
1591
2084
  });
1592
2085
  }
1593
2086
  };
2087
+ /**
2088
+ * A factory function for creating a ResponseDecorator.
2089
+ *
2090
+ * This function returns a decorator function that can be used to annotate
2091
+ * a method parameter with response information.
2092
+ *
2093
+ * @return {Function} The decorator function.
2094
+ */
1594
2095
  function Response$1() {
1595
2096
  return (0, __vercube_di.createDecorator)(ResponseDecorator, {});
1596
2097
  }
1597
2098
 
1598
2099
  //#endregion
1599
2100
  //#region packages/core/src/Decorators/Http/Trace.ts
2101
+ /**
2102
+ * A decorator class for handling HTTP TRACE requests.
2103
+ *
2104
+ * This class extends the BaseDecorator and is used to register TRACE routes
2105
+ * with the Router. It also resolves metadata for the route handler
2106
+ * using the MetadataResolver.
2107
+ *
2108
+ * @extends {BaseDecorator<TraceDecoratorOptions>}
2109
+ */
1600
2110
  var TraceDecorator = class extends __vercube_di.BaseDecorator {
1601
2111
  gRouter;
1602
2112
  gRequestHandler;
@@ -1628,12 +2138,25 @@ var TraceDecorator = class extends __vercube_di.BaseDecorator {
1628
2138
  (0, import_decorate.default)([(0, __vercube_di.Inject)(Router)], TraceDecorator.prototype, "gRouter", void 0);
1629
2139
  (0, import_decorate.default)([(0, __vercube_di.Inject)(RequestHandler)], TraceDecorator.prototype, "gRequestHandler", void 0);
1630
2140
  (0, import_decorate.default)([(0, __vercube_di.Inject)(MetadataResolver)], TraceDecorator.prototype, "gMetadataResolver", void 0);
2141
+ /**
2142
+ * A factory function for creating a TraceDecorator.
2143
+ *
2144
+ * This function returns a decorator function that can be used to annotate
2145
+ * a method with TRACE route information.
2146
+ *
2147
+ * @param {string} path - The path for the TRACE route.
2148
+ * @return {Function} The decorator function.
2149
+ */
1631
2150
  function Trace(path) {
1632
2151
  return (0, __vercube_di.createDecorator)(TraceDecorator, { path });
1633
2152
  }
1634
2153
 
1635
2154
  //#endregion
1636
2155
  //#region packages/core/src/Decorators/Http/SetHeader.ts
2156
+ /**
2157
+ * A decorator that sets a header on the response.
2158
+ * @extends {BaseDecorator<SetHeaderDecoratorOptions>}
2159
+ */
1637
2160
  var SetHeaderDecorator = class extends __vercube_di.BaseDecorator {
1638
2161
  /**
1639
2162
  * Called when the decorator is created.
@@ -1650,6 +2173,12 @@ var SetHeaderDecorator = class extends __vercube_di.BaseDecorator {
1650
2173
  } });
1651
2174
  }
1652
2175
  };
2176
+ /**
2177
+ * Creates a SetHeader decorator.
2178
+ * @param {string} key - The header key.
2179
+ * @param {string} value - The header value.
2180
+ * @returns {Function} The decorator function.
2181
+ */
1653
2182
  function SetHeader(key, value) {
1654
2183
  return (0, __vercube_di.createDecorator)(SetHeaderDecorator, {
1655
2184
  key,
@@ -1659,6 +2188,13 @@ function SetHeader(key, value) {
1659
2188
 
1660
2189
  //#endregion
1661
2190
  //#region packages/core/src/Decorators/Http/Status.ts
2191
+ /**
2192
+
2193
+ * A decorator that sets a status on the response.
2194
+
2195
+ * @extends {BaseDecorator<StatusDecoratorOptions>}
2196
+
2197
+ */
1662
2198
  var StatusDecorator = class extends __vercube_di.BaseDecorator {
1663
2199
  /**
1664
2200
 
@@ -1675,6 +2211,15 @@ var StatusDecorator = class extends __vercube_di.BaseDecorator {
1675
2211
  method.actions.push({ handler: () => ({ status: this.options.code }) });
1676
2212
  }
1677
2213
  };
2214
+ /**
2215
+
2216
+ * Creates a Status decorator.
2217
+
2218
+ * @param {number} code - The status value.
2219
+
2220
+ * @returns {Function} The decorator function.
2221
+
2222
+ */
1678
2223
  function Status(code) {
1679
2224
  return (0, __vercube_di.createDecorator)(StatusDecorator, { code });
1680
2225
  }
@@ -1704,6 +2249,17 @@ var RedirectDecorator = class extends __vercube_di.BaseDecorator {
1704
2249
  } });
1705
2250
  }
1706
2251
  };
2252
+ /**
2253
+
2254
+ * Creates a Redirect decorator.
2255
+
2256
+ * @param {string} location - The location header value.
2257
+
2258
+ * @param {number} [code=301] - The status code.
2259
+
2260
+ * @returns {Function} The decorator function.
2261
+
2262
+ */
1707
2263
  function Redirect(location, code = 301) {
1708
2264
  return (0, __vercube_di.createDecorator)(RedirectDecorator, {
1709
2265
  location,
@@ -1713,6 +2269,28 @@ function Redirect(location, code = 301) {
1713
2269
 
1714
2270
  //#endregion
1715
2271
  //#region packages/core/src/Decorators/Http/Middleware.ts
2272
+ /**
2273
+ * Decorator that applies middleware to a class or method
2274
+ * @param middleware - The middleware class to apply
2275
+ * @param opts - Optional configuration parameters
2276
+ * @param opts.type - The type of middleware ('before' or 'after')
2277
+ * @param opts.priority - Priority order for middleware execution (default: 999)
2278
+ * @returns A decorator function that can be applied to classes or methods
2279
+ *
2280
+ * @example
2281
+ * ```typescript
2282
+ * @Middleware(AuthMiddleware)
2283
+ * class UserController {
2284
+ * // ...
2285
+ * }
2286
+ *
2287
+ * // Or on a specific method:
2288
+ * @Middleware(ValidationMiddleware, { type: 'before', priority: 1 })
2289
+ * public async createUser() {
2290
+ * // ...
2291
+ * }
2292
+ * ```
2293
+ */
1716
2294
  function Middleware(middleware, opts) {
1717
2295
  return function internalDecorator(target, propertyName) {
1718
2296
  const ctx = propertyName ? target : target.prototype;
@@ -1727,6 +2305,12 @@ function Middleware(middleware, opts) {
1727
2305
 
1728
2306
  //#endregion
1729
2307
  //#region packages/core/src/Decorators/Http/MultipartFormData.ts
2308
+ /**
2309
+ * @class MultipartFormDataDecorator
2310
+ * @extends BaseDecorator<MultipartFormDataOptions>
2311
+ *
2312
+ * A decorator class that handles the metadata for HTTP request bodies.
2313
+ */
1730
2314
  var MultipartFormDataDecorator = class extends __vercube_di.BaseDecorator {
1731
2315
  /**
1732
2316
  * @method created
@@ -1742,12 +2326,35 @@ var MultipartFormDataDecorator = class extends __vercube_di.BaseDecorator {
1742
2326
  });
1743
2327
  }
1744
2328
  };
2329
+ /**
2330
+ * Decorator function that marks a parameter as multipart/form-data request body.
2331
+ * This decorator will automatically parse incoming multipart form data
2332
+ *
2333
+ * @decorator
2334
+ * @returns {Function} A decorator function that can be applied to method parameters
2335
+ *
2336
+ * @example
2337
+ * class UserController {
2338
+ * uploadFile(@MultipartFormData() formData: MyData) {
2339
+ * // Handle multipart form data
2340
+ * }
2341
+ * }
2342
+ */
1745
2343
  function MultipartFormData() {
1746
2344
  return (0, __vercube_di.createDecorator)(MultipartFormDataDecorator, {});
1747
2345
  }
1748
2346
 
1749
2347
  //#endregion
1750
2348
  //#region packages/core/src/Decorators/Http/Session.ts
2349
+ /**
2350
+ * This class is responsible for managing session decorators.
2351
+ *
2352
+ * This class extends the BaseDecorator and is used to register session information
2353
+ * with the MetadataResolver. It ensures that the metadata for the property is created
2354
+ * and adds the session information to the metadata.
2355
+ *
2356
+ * @extends {BaseDecorator<{}>}
2357
+ */
1751
2358
  var SessionDecorator = class extends __vercube_di.BaseDecorator {
1752
2359
  gRuntimeConfig;
1753
2360
  /**
@@ -1771,12 +2378,23 @@ var SessionDecorator = class extends __vercube_di.BaseDecorator {
1771
2378
  }
1772
2379
  };
1773
2380
  (0, import_decorate.default)([(0, __vercube_di.Inject)(RuntimeConfig)], SessionDecorator.prototype, "gRuntimeConfig", void 0);
2381
+ /**
2382
+ * A factory function for creating a SessionDecorator.
2383
+ *
2384
+ * This function returns a decorator function that can be used to annotate
2385
+ * a method parameter with session information.
2386
+ *
2387
+ * @return {Function} The decorator function.
2388
+ */
1774
2389
  function Session() {
1775
2390
  return (0, __vercube_di.createDecorator)(SessionDecorator, {});
1776
2391
  }
1777
2392
 
1778
2393
  //#endregion
1779
2394
  //#region packages/core/src/Decorators/Hooks/Listen.ts
2395
+ /**
2396
+ * This class is responsible for managing cache decorator.
2397
+ */
1780
2398
  var ListenDecorator = class extends __vercube_di.BaseDecorator {
1781
2399
  gHooksService;
1782
2400
  fHook;
@@ -1795,12 +2413,22 @@ var ListenDecorator = class extends __vercube_di.BaseDecorator {
1795
2413
  }
1796
2414
  };
1797
2415
  (0, import_decorate.default)([(0, __vercube_di.Inject)(HooksService)], ListenDecorator.prototype, "gHooksService", void 0);
2416
+ /**
2417
+ * This decorator stores metadata about hook listeners. It can be later used along with function
2418
+ * applyEventListeners() to automatically register all listeners.
2419
+ *
2420
+ * @param hookType hook to listen for
2421
+ * @return decorator function
2422
+ */
1798
2423
  function Listen(hookType) {
1799
2424
  return (0, __vercube_di.createDecorator)(ListenDecorator, { hookType });
1800
2425
  }
1801
2426
 
1802
2427
  //#endregion
1803
2428
  //#region packages/core/src/Services/Plugins/BasePlugin.ts
2429
+ /**
2430
+ * Represents a Plugin.
2431
+ */
1804
2432
  var BasePlugin = class {
1805
2433
  /**
1806
2434
  * The name of the plugin.
@@ -1816,10 +2444,17 @@ var BasePlugin = class {
1816
2444
 
1817
2445
  //#endregion
1818
2446
  //#region packages/core/src/Services/Middleware/BaseMiddleware.ts
2447
+ /**
2448
+ * BaseMiddleware class that serves as a base for all middleware implementations.
2449
+ */
1819
2450
  var BaseMiddleware = class {};
1820
2451
 
1821
2452
  //#endregion
1822
2453
  //#region packages/core/src/Errors/Http/ForbiddenError.ts
2454
+ /**
2455
+ * Represents a Forbidden error (HTTP 403).
2456
+ * @extends {HttpError}
2457
+ */
1823
2458
  var ForbiddenError = class ForbiddenError extends HttpError {
1824
2459
  /**
1825
2460
  * The name of the error.
@@ -1839,6 +2474,10 @@ var ForbiddenError = class ForbiddenError extends HttpError {
1839
2474
 
1840
2475
  //#endregion
1841
2476
  //#region packages/core/src/Errors/Http/MethodNotAllowedError.ts
2477
+ /**
2478
+ * Represents a Method Not Allowed error (HTTP 405).
2479
+ * @extends {HttpError}
2480
+ */
1842
2481
  var MethodNotAllowedError = class MethodNotAllowedError extends HttpError {
1843
2482
  /**
1844
2483
  * The name of the error.
@@ -1858,6 +2497,10 @@ var MethodNotAllowedError = class MethodNotAllowedError extends HttpError {
1858
2497
 
1859
2498
  //#endregion
1860
2499
  //#region packages/core/src/Errors/Http/NotAcceptableError.ts
2500
+ /**
2501
+ * Represents a Not Acceptable error (HTTP 406).
2502
+ * @extends {HttpError}
2503
+ */
1861
2504
  var NotAcceptableError = class NotAcceptableError extends HttpError {
1862
2505
  /**
1863
2506
  * The name of the error.
@@ -1877,6 +2520,10 @@ var NotAcceptableError = class NotAcceptableError extends HttpError {
1877
2520
 
1878
2521
  //#endregion
1879
2522
  //#region packages/core/src/Errors/Http/NotFoundError.ts
2523
+ /**
2524
+ * Represents a Not Found error (HTTP 404).
2525
+ * @extends {HttpError}
2526
+ */
1880
2527
  var NotFoundError = class NotFoundError extends HttpError {
1881
2528
  /**
1882
2529
  * The name of the error.
@@ -1896,6 +2543,10 @@ var NotFoundError = class NotFoundError extends HttpError {
1896
2543
 
1897
2544
  //#endregion
1898
2545
  //#region packages/core/src/Errors/Http/UnauthorizedError.ts
2546
+ /**
2547
+ * Represents an Unauthorized error (HTTP 401).
2548
+ * @extends {HttpError}
2549
+ */
1899
2550
  var UnauthorizedError = class UnauthorizedError extends HttpError {
1900
2551
  /**
1901
2552
  * The name of the error.
@@ -1989,6 +2640,7 @@ exports.Body = Body
1989
2640
  exports.Connect = Connect
1990
2641
  exports.Controller = Controller
1991
2642
  exports.Delete = Delete
2643
+ exports.ErrorHandlerProvider = ErrorHandlerProvider
1992
2644
  exports.ForbiddenError = ForbiddenError
1993
2645
  exports.Get = Get
1994
2646
  exports.HTTPStatus = HTTPStatus