@expressots/core 1.6.0 → 1.8.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.
Files changed (66) hide show
  1. package/README.md +87 -41
  2. package/lib/CHANGELOG.md +29 -0
  3. package/lib/README.md +87 -41
  4. package/lib/cjs/application/app-container.js +24 -7
  5. package/lib/cjs/application/application.js +15 -2
  6. package/lib/cjs/console/console.js +3 -1
  7. package/lib/cjs/container-module/container-module.js +2 -0
  8. package/lib/cjs/decorator/scope-binding.js +2 -0
  9. package/lib/cjs/environment/env-validator.js +1 -0
  10. package/lib/cjs/error/error-handler-middleware.js +1 -1
  11. package/lib/cjs/logger/general-logger.js +2 -2
  12. package/lib/cjs/types/application/app-container.d.ts +96 -2
  13. package/lib/cjs/types/application/app-container.d.ts.map +1 -1
  14. package/lib/cjs/types/application/application.d.ts +5 -1
  15. package/lib/cjs/types/application/application.d.ts.map +1 -1
  16. package/lib/cjs/types/common/project-config.provider.d.ts.map +1 -1
  17. package/lib/cjs/types/console/console.d.ts.map +1 -1
  18. package/lib/cjs/types/container-module/container-module.d.ts +1 -1
  19. package/lib/cjs/types/container-module/container-module.d.ts.map +1 -1
  20. package/lib/cjs/types/controller/base-controller.d.ts.map +1 -1
  21. package/lib/cjs/types/decorator/scope-binding.d.ts.map +1 -1
  22. package/lib/cjs/types/environment/env-validator.d.ts.map +1 -1
  23. package/lib/cjs/types/error/error-handler-middleware.d.ts +2 -2
  24. package/lib/cjs/types/error/error-handler-middleware.d.ts.map +1 -1
  25. package/lib/cjs/types/logger/general-logger.d.ts.map +1 -1
  26. package/lib/esm/application/app-container.js +38 -11
  27. package/lib/esm/application/application.js +38 -18
  28. package/lib/esm/application/index.js +9 -2
  29. package/lib/esm/common/index.js +2 -1
  30. package/lib/esm/common/project-config.provider.js +2 -1
  31. package/lib/esm/console/console.js +18 -10
  32. package/lib/esm/console/index.js +5 -1
  33. package/lib/esm/container-module/container-module.js +23 -17
  34. package/lib/esm/container-module/index.js +6 -1
  35. package/lib/esm/controller/base-controller.js +9 -6
  36. package/lib/esm/controller/index.js +5 -1
  37. package/lib/esm/decorator/index.js +17 -1
  38. package/lib/esm/decorator/scope-binding.js +10 -4
  39. package/lib/esm/environment/env-validator.js +20 -13
  40. package/lib/esm/environment/index.js +5 -1
  41. package/lib/esm/error/error-handler-middleware.js +6 -4
  42. package/lib/esm/error/index.js +7 -2
  43. package/lib/esm/error/report.js +9 -6
  44. package/lib/esm/error/status-code.js +4 -1
  45. package/lib/esm/index.mjs +26 -10
  46. package/lib/esm/logger/general-logger.js +20 -13
  47. package/lib/esm/logger/index.js +7 -1
  48. package/lib/esm/render/handlebars.interface.js +2 -1
  49. package/lib/esm/render/index.js +2 -1
  50. package/lib/esm/render/render.type.js +2 -1
  51. package/lib/esm/types/application/app-container.d.ts +96 -2
  52. package/lib/esm/types/application/app-container.d.ts.map +1 -1
  53. package/lib/esm/types/application/application.d.ts +5 -1
  54. package/lib/esm/types/application/application.d.ts.map +1 -1
  55. package/lib/esm/types/common/project-config.provider.d.ts.map +1 -1
  56. package/lib/esm/types/console/console.d.ts.map +1 -1
  57. package/lib/esm/types/container-module/container-module.d.ts +1 -1
  58. package/lib/esm/types/container-module/container-module.d.ts.map +1 -1
  59. package/lib/esm/types/controller/base-controller.d.ts.map +1 -1
  60. package/lib/esm/types/decorator/scope-binding.d.ts.map +1 -1
  61. package/lib/esm/types/environment/env-validator.d.ts.map +1 -1
  62. package/lib/esm/types/error/error-handler-middleware.d.ts +2 -2
  63. package/lib/esm/types/error/error-handler-middleware.d.ts.map +1 -1
  64. package/lib/esm/types/logger/general-logger.d.ts.map +1 -1
  65. package/lib/package.json +16 -10
  66. package/package.json +16 -10
@@ -1,15 +1,21 @@
1
+ "use strict";
1
2
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
3
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
4
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
5
  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;
5
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
7
  };
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
7
11
  var EnvValidatorProvider_1;
8
- import fs from "fs";
9
- import path from "path";
10
- import dotenv from "dotenv";
11
- import { provide } from "inversify-binding-decorators";
12
- import { log, LogLevel } from "../logger";
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.Environments = void 0;
14
+ const fs_1 = __importDefault(require("fs"));
15
+ const path_1 = __importDefault(require("path"));
16
+ const dotenv_1 = __importDefault(require("dotenv"));
17
+ const inversify_binding_decorators_1 = require("inversify-binding-decorators");
18
+ const logger_1 = require("../logger");
13
19
  /**
14
20
  * The EnvValidatorProvider class provides utility methods for working with environment variables.
15
21
  * It validates, loads, and retrieves environment variables from the .env file.
@@ -22,6 +28,7 @@ let EnvValidatorProvider = EnvValidatorProvider_1 = class EnvValidatorProvider {
22
28
  * @param defaultValue - The default value to return if the environment variable is not set.
23
29
  * @returns The value of the environment variable, or the default value if not set.
24
30
  */
31
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
32
  static get(key, defaultValue = undefined) {
26
33
  return process.env[key] ?? defaultValue;
27
34
  }
@@ -31,14 +38,14 @@ let EnvValidatorProvider = EnvValidatorProvider_1 = class EnvValidatorProvider {
31
38
  */
32
39
  static checkAll() {
33
40
  // Get the full path of the .env file
34
- const envFilePath = path.join(process.cwd(), ".", ".env");
41
+ const envFilePath = path_1.default.join(process.cwd(), ".", ".env");
35
42
  // Check if the .env file exists
36
- if (!fs.existsSync(envFilePath)) {
37
- log(LogLevel.Info, "Environment file .env is not defined.", "env-validator-provider");
43
+ if (!fs_1.default.existsSync(envFilePath)) {
44
+ (0, logger_1.log)(logger_1.LogLevel.Info, "Environment file .env is not defined.", "env-validator-provider");
38
45
  process.exit(1);
39
46
  }
40
47
  // Load the environment variables from the .env file
41
- const dotenvConfigOutput = dotenv.config({ path: envFilePath });
48
+ const dotenvConfigOutput = dotenv_1.default.config({ path: envFilePath });
42
49
  const dotEnvParsed = dotenvConfigOutput.parsed;
43
50
  /* Verify if all environment variables are defined */
44
51
  let hasError = false;
@@ -46,7 +53,7 @@ let EnvValidatorProvider = EnvValidatorProvider_1 = class EnvValidatorProvider {
46
53
  for (const key of Object.keys(dotEnvParsed)) {
47
54
  // Check if the environment variable is not defined or is an empty string
48
55
  if (!process.env[key] || process.env[key] === "") {
49
- log(LogLevel.Info, `Environment variable ${key} is not defined.`, "env-validator-provider");
56
+ (0, logger_1.log)(logger_1.LogLevel.Info, `Environment variable ${key} is not defined.`, "env-validator-provider");
50
57
  hasError = true;
51
58
  }
52
59
  }
@@ -56,8 +63,9 @@ let EnvValidatorProvider = EnvValidatorProvider_1 = class EnvValidatorProvider {
56
63
  }
57
64
  }
58
65
  };
59
- EnvValidatorProvider = EnvValidatorProvider_1 = __decorate([
60
- provide(EnvValidatorProvider_1)
66
+ exports.Environments = EnvValidatorProvider;
67
+ exports.Environments = EnvValidatorProvider = EnvValidatorProvider_1 = __decorate([
68
+ (0, inversify_binding_decorators_1.provide)(EnvValidatorProvider_1)
61
69
  ], EnvValidatorProvider);
62
70
  String.prototype.AsBoolean = function () {
63
71
  switch (this.toLowerCase().trim()) {
@@ -79,4 +87,3 @@ String.prototype.AsNumber = function () {
79
87
  String.prototype.AsString = function () {
80
88
  return String(this);
81
89
  };
82
- export { EnvValidatorProvider as Environments };
@@ -1 +1,5 @@
1
- export { Environments } from "./env-validator";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Environments = void 0;
4
+ var env_validator_1 = require("./env-validator");
5
+ Object.defineProperty(exports, "Environments", { enumerable: true, get: function () { return env_validator_1.Environments; } });
@@ -1,4 +1,6 @@
1
- import { StatusCode } from "./status-code";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const status_code_1 = require("./status-code");
2
4
  /**
3
5
  * errorHandler is a custom Express error-handling middleware function.
4
6
  * It logs the error, sets the status code, and sends a JSON response containing the status code and error message.
@@ -7,9 +9,9 @@ import { StatusCode } from "./status-code";
7
9
  * @param res - The Express response object.
8
10
  * @param next - The Express next function for passing control to the next middleware function.
9
11
  */
10
- function errorHandler(error, req, res, next) {
12
+ function errorHandler(error, req, res) {
11
13
  res
12
- .status(error.statusCode || StatusCode.InternalServerError)
14
+ .status(error.statusCode || status_code_1.StatusCode.InternalServerError)
13
15
  .json({ statusCode: error.statusCode, error: error.message });
14
16
  }
15
- export default errorHandler;
17
+ exports.default = errorHandler;
@@ -1,2 +1,7 @@
1
- export { StatusCode } from "./status-code";
2
- export { Report } from "./report";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Report = exports.StatusCode = void 0;
4
+ var status_code_1 = require("./status-code");
5
+ Object.defineProperty(exports, "StatusCode", { enumerable: true, get: function () { return status_code_1.StatusCode; } });
6
+ var report_1 = require("./report");
7
+ Object.defineProperty(exports, "Report", { enumerable: true, get: function () { return report_1.Report; } });
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
3
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
4
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -5,8 +6,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
7
  };
7
8
  var Report_1;
8
- import { provide } from "inversify-binding-decorators";
9
- import { log, LogLevel } from "../logger";
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.Report = void 0;
11
+ const inversify_binding_decorators_1 = require("inversify-binding-decorators");
12
+ const logger_1 = require("../logger");
10
13
  /**
11
14
  * Report class is a utility class to manage and log errors within the application.
12
15
  * It is responsible for creating a standardized error object, logging it,
@@ -49,11 +52,11 @@ let Report = class Report {
49
52
  stack: this.stack,
50
53
  };
51
54
  }
52
- log(LogLevel.Error, appError, appError.service || "service-undefined");
55
+ (0, logger_1.log)(logger_1.LogLevel.Error, appError, appError.service || "service-undefined");
53
56
  throw appError;
54
57
  }
55
58
  };
56
- Report = Report_1 = __decorate([
57
- provide(Report_1)
59
+ exports.Report = Report;
60
+ exports.Report = Report = Report_1 = __decorate([
61
+ (0, inversify_binding_decorators_1.provide)(Report_1)
58
62
  ], Report);
59
- export { Report };
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StatusCode = void 0;
1
4
  /* Http Error Code Response */
2
5
  var InformationResponse;
3
6
  (function (InformationResponse) {
@@ -83,4 +86,4 @@ const HttpStatusErrorCode = {
83
86
  ...ServerErrorResponse,
84
87
  };
85
88
  const StatusCode = { ...HttpStatusErrorCode };
86
- export { StatusCode };
89
+ exports.StatusCode = StatusCode;
package/lib/esm/index.mjs CHANGED
@@ -1,10 +1,26 @@
1
- export * from "./application";
2
- export * from "./common";
3
- export * from "./console";
4
- export * from "./container-module";
5
- export * from "./controller";
6
- export * from "./decorator";
7
- export * from "./environment";
8
- export * from "./error";
9
- export * from "./logger";
10
- export * from "./render";
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./application"), exports);
18
+ __exportStar(require("./common"), exports);
19
+ __exportStar(require("./console"), exports);
20
+ __exportStar(require("./container-module"), exports);
21
+ __exportStar(require("./controller"), exports);
22
+ __exportStar(require("./decorator"), exports);
23
+ __exportStar(require("./environment"), exports);
24
+ __exportStar(require("./error"), exports);
25
+ __exportStar(require("./logger"), exports);
26
+ __exportStar(require("./render"), exports);
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
3
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
4
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -7,10 +8,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
8
  var __metadata = (this && this.__metadata) || function (k, v) {
8
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
10
14
  var GeneralLogger_1;
11
- import { provide } from "inversify-binding-decorators";
12
- import { createLogger, format, transports, } from "winston";
13
- import DailyRotateFile from "winston-daily-rotate-file";
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.log = exports.GeneralLogger = exports.LogLevel = void 0;
17
+ const inversify_binding_decorators_1 = require("inversify-binding-decorators");
18
+ const winston_1 = require("winston");
19
+ const winston_daily_rotate_file_1 = __importDefault(require("winston-daily-rotate-file"));
14
20
  /**
15
21
  * LogLevel enumeration defines the available log levels.
16
22
  */
@@ -19,21 +25,21 @@ var LogLevel;
19
25
  LogLevel[LogLevel["Debug"] = 0] = "Debug";
20
26
  LogLevel[LogLevel["Error"] = 1] = "Error";
21
27
  LogLevel[LogLevel["Info"] = 2] = "Info";
22
- })(LogLevel || (LogLevel = {}));
28
+ })(LogLevel || (exports.LogLevel = LogLevel = {}));
23
29
  /**
24
30
  * GeneralLogger class is a utility class to manage logging within the application.
25
31
  */
26
32
  let GeneralLogger = GeneralLogger_1 = class GeneralLogger {
27
33
  logger;
28
34
  constructor() {
29
- this.logger = createLogger(this.createLoggerOptions());
35
+ this.logger = (0, winston_1.createLogger)(this.createLoggerOptions());
30
36
  }
31
37
  /**
32
38
  * Creates a console transport for logging.
33
39
  * @returns {transports.ConsoleTransportInstance} A Winston console transport instance.
34
40
  */
35
41
  createConsoleTransport() {
36
- const consoleTransport = new transports.Console({
42
+ const consoleTransport = new winston_1.transports.Console({
37
43
  level: (process.env.ENVIRONMENT !== "Development" && "debug") || "debug",
38
44
  handleExceptions: false,
39
45
  handleRejections: true,
@@ -45,7 +51,7 @@ let GeneralLogger = GeneralLogger_1 = class GeneralLogger {
45
51
  * @returns {DailyRotateFile} A Winston daily rotate file transport instance.
46
52
  */
47
53
  createRotationalFileTransport() {
48
- const rotationalFileTransport = new DailyRotateFile({
54
+ const rotationalFileTransport = new winston_daily_rotate_file_1.default({
49
55
  level: "error",
50
56
  filename: "logs/general-%DATE%.log",
51
57
  datePattern: "YYYY-MM-DD",
@@ -67,7 +73,7 @@ let GeneralLogger = GeneralLogger_1 = class GeneralLogger {
67
73
  this.createRotationalFileTransport(),
68
74
  ],
69
75
  defaultMeta: { service: "service-unknown" },
70
- format: format.combine(format.splat(), format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }), format.label({ label: "core-api" }), format.printf(({ timestamp, level, message, service, label }) => {
76
+ format: winston_1.format.combine(winston_1.format.splat(), winston_1.format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }), winston_1.format.label({ label: "core-api" }), winston_1.format.printf(({ timestamp, level, message, service, label }) => {
71
77
  return `[${timestamp}] [${label}] [${service}] ${level}: ${message}`;
72
78
  })),
73
79
  };
@@ -81,8 +87,8 @@ let GeneralLogger = GeneralLogger_1 = class GeneralLogger {
81
87
  getPathAndLine(error) {
82
88
  let pathLine = "";
83
89
  if (error.stack) {
84
- let callerLine = error.stack.split("\n")[1];
85
- let index = callerLine.indexOf("at ");
90
+ const callerLine = error.stack.split("\n")[1];
91
+ const index = callerLine.indexOf("at ");
86
92
  pathLine = callerLine.substring(index + +2, callerLine.length);
87
93
  }
88
94
  return pathLine;
@@ -116,10 +122,11 @@ let GeneralLogger = GeneralLogger_1 = class GeneralLogger {
116
122
  }
117
123
  }
118
124
  };
119
- GeneralLogger = GeneralLogger_1 = __decorate([
120
- provide(GeneralLogger_1),
125
+ exports.GeneralLogger = GeneralLogger;
126
+ exports.GeneralLogger = GeneralLogger = GeneralLogger_1 = __decorate([
127
+ (0, inversify_binding_decorators_1.provide)(GeneralLogger_1),
121
128
  __metadata("design:paramtypes", [])
122
129
  ], GeneralLogger);
123
130
  const Log = new GeneralLogger();
124
131
  const log = Log.log.bind(Log);
125
- export { LogLevel, GeneralLogger, log };
132
+ exports.log = log;
@@ -1 +1,7 @@
1
- export { GeneralLogger, LogLevel, log } from "./general-logger";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.log = exports.LogLevel = exports.GeneralLogger = void 0;
4
+ var general_logger_1 = require("./general-logger");
5
+ Object.defineProperty(exports, "GeneralLogger", { enumerable: true, get: function () { return general_logger_1.GeneralLogger; } });
6
+ Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return general_logger_1.LogLevel; } });
7
+ Object.defineProperty(exports, "log", { enumerable: true, get: function () { return general_logger_1.log; } });
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,22 +1,116 @@
1
1
  import { Container, ContainerModule, interfaces } from "inversify";
2
+ /**
3
+ * Represents a single binding in the dependency injection container.
4
+ */
5
+ interface Binding {
6
+ /**
7
+ * Unique identifier for this binding.
8
+ */
9
+ id: number;
10
+ /**
11
+ * Indicates whether this binding is activated.
12
+ */
13
+ activated: boolean;
14
+ /**
15
+ * Symbol used to identify the service.
16
+ */
17
+ serviceIdentifier: symbol;
18
+ /**
19
+ * Scope of the binding (e.g., 'Singleton', 'Transient', 'Request').
20
+ */
21
+ scope: string;
22
+ /**
23
+ * Type of the binding (e.g., 'Instance', 'Factory', 'Provider').
24
+ */
25
+ type: string;
26
+ /**
27
+ * Object used to match or constrain the binding.
28
+ */
29
+ constraint: object;
30
+ /**
31
+ * The actual implementation type of the service.
32
+ */
33
+ implementationType: object;
34
+ /**
35
+ * Cached instance, used if the binding's scope allows it.
36
+ */
37
+ cache: object | null;
38
+ /**
39
+ * Optional factory to create the service instance.
40
+ */
41
+ factory: object | null;
42
+ /**
43
+ * Optional provider to create the service instance.
44
+ */
45
+ provider: object | null;
46
+ /**
47
+ * Function to run when activating a new instance.
48
+ */
49
+ onActivation: object | null;
50
+ /**
51
+ * Function to run when deactivating an instance.
52
+ */
53
+ onDeactivation: object | null;
54
+ /**
55
+ * Optional dynamic value that can be used to resolve the service.
56
+ */
57
+ dynamicValue: object | null;
58
+ /**
59
+ * Module ID where the binding is defined, useful for debugging.
60
+ */
61
+ moduleId: number;
62
+ }
63
+ /**
64
+ * Type alias for ServiceIdentifier, used to specify a unique identifier for a service.
65
+ * It's usually a symbol, but can be other types as well.
66
+ */
67
+ type ServiceIdentifier = typeof Symbol;
68
+ /**
69
+ * Interface for container options that can be passed to the AppContainer class.
70
+ */
71
+ interface ContainerOptions {
72
+ /**
73
+ * The default scope for bindings in the container.
74
+ * It can be set to Request (default), Singleton, or Transient.
75
+ */
76
+ defaultScope?: interfaces.BindingScope;
77
+ /**
78
+ * Allows skipping of base class checks when working with derived classes.
79
+ */
80
+ skipBaseClassChecks?: boolean;
81
+ }
2
82
  /**
3
83
  * The AppContainer class provides a container for managing dependency injection.
84
+ * It allows the creation of a container with custom options, including default binding scope
85
+ * and the ability to skip base class checks. The container can be loaded with multiple
86
+ * ContainerModule instances, facilitating modular and organized code.
87
+ *
88
+ * Usage:
89
+ * const appContainer = new AppContainer(options);
90
+ * const container = appContainer.create(modules);
91
+ *
4
92
  * @provide AppContainer
5
93
  */
6
94
  declare class AppContainer {
7
95
  private container;
96
+ private options;
97
+ /**
98
+ * Constructs the AppContainer instance.
99
+ * @param options - The options for creating the container. Can include custom default scope and skip base class checks setting.
100
+ */
101
+ constructor(options?: ContainerOptions);
8
102
  /**
9
103
  * Creates and configures a new dependency injection container.
10
104
  * @param modules - An array of ContainerModule instances to load into the container.
11
105
  * @param defaultScope - The default scope to use for bindings. Scoped (Request) by default, but offers Singleton and Transient as well.
12
106
  * @returns The configured dependency injection container.
13
107
  */
14
- create(modules: ContainerModule[], defaultScope?: interfaces.BindingScope): Container;
108
+ create(modules: Array<ContainerModule>): Container;
15
109
  /**
16
110
  * Retrieves the binding dictionary of the container.
17
111
  * @returns The binding dictionary of the container.
18
112
  */
19
- getBindingDictionary(): Map<any, any>;
113
+ getBindingDictionary(): Map<ServiceIdentifier, Array<Binding>>;
20
114
  /**
21
115
  * Retrieves the container options.
22
116
  * @returns The container options.
@@ -1 +1 @@
1
- {"version":3,"file":"app-container.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/application/app-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,eAAe,EACf,UAAU,EACX,MAAM,WAAW,CAAC;AAGnB;;;GAGG;AACH,cACM,YAAY;IAChB,OAAO,CAAC,SAAS,CAAa;IAC9B;;;;;OAKG;IACI,MAAM,CACX,OAAO,EAAE,eAAe,EAAE,EAC1B,YAAY,GAAE,UAAU,CAAC,YAAuC,GAC/D,SAAS;IAWZ;;;OAGG;IACI,oBAAoB,IAAI,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC;IAI5C;;;OAGG;IACI,mBAAmB,IAAI,UAAU,CAAC,gBAAgB;IAIzD;;;OAGG;IACH,IAAW,SAAS,IAAI,SAAS,CAEhC;CACF;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"app-container.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/application/app-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,eAAe,EACf,UAAU,EACX,MAAM,WAAW,CAAC;AAGnB;;GAEG;AACH,UAAU,OAAO;IACf;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB;;OAEG;IACH,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;OAEG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B;;OAEG;IACH,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,KAAK,iBAAiB,GAAG,OAAO,MAAM,CAAC;AAEvC;;GAEG;AACH,UAAU,gBAAgB;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC;IAEvC;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;;;;;;;GAWG;AACH,cACM,YAAY;IAChB,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,OAAO,CAAmB;IAElC;;;OAGG;gBACS,OAAO,CAAC,EAAE,gBAAgB;IAOtC;;;;;OAKG;IACI,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,eAAe,CAAC,GAAG,SAAS;IAYzD;;;OAGG;IACI,oBAAoB,IAAI,GAAG,CAAC,iBAAiB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAIrE;;;OAGG;IACI,mBAAmB,IAAI,UAAU,CAAC,gBAAgB;IAIzD;;;OAGG;IACH,IAAW,SAAS,IAAI,SAAS,CAEhC;CACF;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -34,13 +34,17 @@ declare class Application {
34
34
  * Perform actions or cleanup after the server is shutdown.
35
35
  */
36
36
  protected serverShutdown(): void;
37
+ /**
38
+ * Handles process exit by calling serverShutdown and then exiting the process.
39
+ */
40
+ private handleExit;
37
41
  /**
38
42
  * Create and configure the Express application.
39
43
  * @param container - The InversifyJS container.
40
44
  * @param middlewares - An array of Express middlewares to be applied.
41
45
  * @returns The configured Application instance.
42
46
  */
43
- create(container: Container, middlewares?: express.RequestHandler[]): Application;
47
+ create(container: Container, middlewares?: Array<express.RequestHandler>): Application;
44
48
  /**
45
49
  * Start listening on the given port and environment.
46
50
  * @param port - The port number to listen on.
@@ -1 +1 @@
1
- {"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/application/application.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,OAAO,EAAW,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAE3E,OAAO,EAAe,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAE/D;;GAEG;AACH,aAAK,iBAAiB;IACpB,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,UAAU,eAAe;CAC1B;AAED;;;GAGG;AACH,cACM,WAAW;IACf,OAAO,CAAC,GAAG,CAAsB;IACjC,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,WAAW,CAAoB;IAEvC;;OAEG;;IAGH;;OAEG;IACH,SAAS,CAAC,iBAAiB,IAAI,IAAI;IAEnC;;OAEG;IACH,SAAS,CAAC,wBAAwB,IAAI,IAAI;IAE1C;;OAEG;IACH,SAAS,CAAC,cAAc,IAAI,IAAI;IAIhC;;;;;OAKG;IACI,MAAM,CACX,SAAS,EAAE,SAAS,EACpB,WAAW,GAAE,OAAO,CAAC,cAAc,EAAO,GACzC,WAAW;IAoCd;;;;;OAKG;IACI,MAAM,CACX,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,iBAAiB,EAC9B,cAAc,CAAC,EAAE,4BAA4B,GAC5C,IAAI;IAaP;;;;;;;;;;OAUG;IACI,SAAS,CAAC,CAAC,SAAS,qBAAqB,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI;CAQpE;AAED,QAAA,MAAM,iBAAiB,EAAE,WAA+B,CAAC;AAEzD,OAAO,EAAE,iBAAiB,IAAI,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/application/application.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,OAAO,EAAW,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAE3E,OAAO,EAAe,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAE/D;;GAEG;AACH,aAAK,iBAAiB;IACpB,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,UAAU,eAAe;CAC1B;AAED;;;GAGG;AACH,cACM,WAAW;IACf,OAAO,CAAC,GAAG,CAAsB;IACjC,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,WAAW,CAAoB;IAEvC;;OAEG;;IAGH;;OAEG;IACH,SAAS,CAAC,iBAAiB,IAAI,IAAI;IAEnC;;OAEG;IACH,SAAS,CAAC,wBAAwB,IAAI,IAAI;IAE1C;;OAEG;IACH,SAAS,CAAC,cAAc,IAAI,IAAI;IAEhC;;OAEG;IACH,OAAO,CAAC,UAAU;IAKlB;;;;;OAKG;IACI,MAAM,CACX,SAAS,EAAE,SAAS,EACpB,WAAW,GAAE,KAAK,CAAC,OAAO,CAAC,cAAc,CAAM,GAC9C,WAAW;IAoCd;;;;;OAKG;IACI,MAAM,CACX,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,iBAAiB,EAC9B,cAAc,CAAC,EAAE,4BAA4B,GAC5C,IAAI;IAuBP;;;;;;;;;;OAUG;IACI,SAAS,CAAC,CAAC,SAAS,qBAAqB,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI;CAQpE;AAED,QAAA,MAAM,iBAAiB,EAAE,WAA+B,CAAC;AAEzD,OAAO,EAAE,iBAAiB,IAAI,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"project-config.provider.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/common/project-config.provider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,mBAAW,OAAO;IAChB,UAAU,cAAc;IACxB,UAAU,eAAe;IACzB,WAAW,eAAe;IAC1B,UAAU,cAAc;CACzB;AAED;;;;;;;GAOG;AACH,UAAU,UAAU;IACnB,MAAM,CAAC,EAAE;QACR,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,iBAAiB,EAAE,MAAM,CAAC;KAC1B,CAAA;CACD;AAED;;;;;;;;;GASG;AACH,UAAU,cAAc;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,UAAU,CAAC;CACvB;AAED,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"project-config.provider.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/common/project-config.provider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,mBAAW,OAAO;IAChB,UAAU,cAAc;IACxB,UAAU,eAAe;IACzB,WAAW,eAAe;IAC1B,UAAU,cAAc;CACzB;AAED;;;;;;;GAOG;AACH,UAAU,UAAU;IAClB,MAAM,CAAC,EAAE;QACP,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH;AAED;;;;;;;;;GASG;AACH,UAAU,cAAc;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,UAAU,CAAC;CACxB;AAED,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/console/console.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,UAAU,4BAA4B;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,cACM,OAAO;IACX;;;;OAIG;YACW,UAAU;IAgBxB;;;;;OAKG;IACU,aAAa,CACxB,IAAI,EAAE,GAAG,EACT,WAAW,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE,4BAA4B,GAC5C,OAAO,CAAC,IAAI,CAAC;CA6BjB;AAED,OAAO,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC"}
1
+ {"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/console/console.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,UAAU,4BAA4B;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,cACM,OAAO;IACX;;;;OAIG;YACW,UAAU;IAgBxB;;;;;OAKG;IACU,aAAa,CAExB,IAAI,EAAE,GAAG,EACT,WAAW,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE,4BAA4B,GAC5C,OAAO,CAAC,IAAI,CAAC;CA6BjB;AAED,OAAO,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC"}
@@ -22,7 +22,7 @@ declare class BaseModule {
22
22
  * @param scope - An optional binding scope to be used for all controllers.
23
23
  * @returns A ContainerModule with the controller bindings.
24
24
  */
25
- static createContainerModule(controllers: any[], scope?: interfaces.BindingScope): ContainerModule;
25
+ static createContainerModule(controllers: Array<any>, scope?: interfaces.BindingScope): ContainerModule;
26
26
  }
27
27
  declare const CreateModule: typeof BaseModule.createContainerModule;
28
28
  export { CreateModule, scope };
@@ -1 +1 @@
1
- {"version":3,"file":"container-module.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/container-module/container-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,eAAe,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAS1E;;;;GAIG;AACH,QAAA,MAAM,KAAK,YAAa,WAAW,YAAY,cACpB,GAAG,SAiB7B,CAAC;AAOF;;;GAGG;AACH,cACM,UAAU;IACd;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAY5B;;;;;OAKG;WACW,qBAAqB,CACjC,WAAW,EAAE,GAAG,EAAE,EAClB,KAAK,CAAC,EAAE,UAAU,CAAC,YAAY,GAC9B,eAAe;CAyCnB;AAED,QAAA,MAAM,YAAY,yCAAmC,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"container-module.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/container-module/container-module.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,eAAe,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAS1E;;;;GAIG;AACH,QAAA,MAAM,KAAK,YAAa,WAAW,YAAY,cACpB,GAAG,SAiB7B,CAAC;AAOF;;;GAGG;AACH,cACM,UAAU;IACd;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAY5B;;;;;OAKG;WACW,qBAAqB,CACjC,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,EACvB,KAAK,CAAC,EAAE,UAAU,CAAC,YAAY,GAC9B,eAAe;CAyCnB;AAED,QAAA,MAAM,YAAY,yCAAmC,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"base-controller.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/controller/base-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGrD;;;;GAIG;AACH,uBACe,cAAe,YAAW,UAAU,CAAC,UAAU;IAC5D,OAAO,CAAC,WAAW,CAAS;IAE5B;;;OAGG;gBACS,WAAW,GAAE,MAAW;IAIpC;;;;;OAKG;cACa,gBAAgB,CAC9B,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EACrB,GAAG,EAAE,GAAG,EACR,iBAAiB,EAAE,MAAM;IAK3B;;;;;OAKG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM;IAIvE;;;;;;;;;;OAUG;IACH,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,KAAK,GAAG,IAAI;IAI5E;;;;;;;;;;OAUG;IACH,SAAS,CAAC,kBAAkB,CAC1B,GAAG,EAAE,QAAQ,EACb,QAAQ,EAAE,MAAM,EAChB,OAAO,KAAK,GACX,OAAO,CAAC,MAAM,CAAC;CAWnB;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"base-controller.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/controller/base-controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGrD;;;;GAIG;AACH,uBACe,cAAe,YAAW,UAAU,CAAC,UAAU;IAC5D,OAAO,CAAC,WAAW,CAAS;IAE5B;;;OAGG;gBACS,WAAW,GAAE,MAAW;IAIpC;;;;;OAKG;cACa,gBAAgB,CAC9B,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EACrB,GAAG,EAAE,GAAG,EACR,iBAAiB,EAAE,MAAM;IAK3B;;;;;OAKG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM;IAIvE;;;;;;;;;;OAUG;IACH,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,KAAK,GAAG,IAAI;IAI5E;;;;;;;;;;OAUG;IACH,SAAS,CAAC,kBAAkB,CAC1B,GAAG,EAAE,QAAQ,EACb,QAAQ,EAAE,MAAM,EAChB,OAAO,KAAK,GACX,OAAO,CAAC,MAAM,CAAC;CAWnB;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"scope-binding.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/decorator/scope-binding.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,gBAAgB,eAAgB,GAAG,yBAExC,CAAC;AAEF,QAAA,MAAM,gBAAgB,eAAgB,GAAG,yBAExC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"scope-binding.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/decorator/scope-binding.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,gBAAgB,eAAgB,GAAG,yBAExC,CAAC;AAEF,QAAA,MAAM,gBAAgB,eAAgB,GAAG,yBAExC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"env-validator.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/environment/env-validator.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,cACM,oBAAoB;IACxB;;;;;OAKG;WACW,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,GAAE,GAAe,GAAG,GAAG;IAIlE;;;OAGG;WACW,QAAQ,IAAI,IAAI;CAsC/B;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,SAAS,IAAI,OAAO,GAAG,SAAS,CAAC;QACjC,QAAQ,IAAI,MAAM,GAAG,SAAS,CAAC;QAC/B,QAAQ,IAAI,MAAM,GAAG,SAAS,CAAC;KAChC;CACF;AAyBD,OAAO,EAAE,oBAAoB,IAAI,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"env-validator.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/environment/env-validator.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,cACM,oBAAoB;IACxB;;;;;OAKG;WAEW,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,GAAE,GAAe,GAAG,GAAG;IAIlE;;;OAGG;WACW,QAAQ,IAAI,IAAI;CAsC/B;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,SAAS,IAAI,OAAO,GAAG,SAAS,CAAC;QACjC,QAAQ,IAAI,MAAM,GAAG,SAAS,CAAC;QAC/B,QAAQ,IAAI,MAAM,GAAG,SAAS,CAAC;KAChC;CACF;AAyBD,OAAO,EAAE,oBAAoB,IAAI,YAAY,EAAE,CAAC"}
@@ -1,4 +1,4 @@
1
- import { NextFunction, Request, Response } from "express";
1
+ import { Request, Response } from "express";
2
2
  import { IAppError } from "./report";
3
3
  /**
4
4
  * errorHandler is a custom Express error-handling middleware function.
@@ -8,6 +8,6 @@ import { IAppError } from "./report";
8
8
  * @param res - The Express response object.
9
9
  * @param next - The Express next function for passing control to the next middleware function.
10
10
  */
11
- declare function errorHandler(error: IAppError, req: Request, res: Response, next: NextFunction): void;
11
+ declare function errorHandler(error: IAppError, req: Request, res: Response): void;
12
12
  export default errorHandler;
13
13
  //# sourceMappingURL=error-handler-middleware.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-handler-middleware.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/error/error-handler-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC;;;;;;;GAOG;AACH,iBAAS,YAAY,CACnB,KAAK,EAAE,SAAS,EAChB,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,YAAY,GACjB,IAAI,CAIN;AAED,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"error-handler-middleware.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/error/error-handler-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC;;;;;;;GAOG;AACH,iBAAS,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI,CAIzE;AAED,eAAe,YAAY,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"general-logger.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/logger/general-logger.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,aAAK,QAAQ;IACX,KAAK,IAAA;IACL,KAAK,IAAA;IACL,IAAI,IAAA;CACL;AAED;;GAEG;AACH,cACM,aAAa;IACjB,OAAO,CAAC,MAAM,CAAS;;IAMvB;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAY9B;;;OAGG;IACH,OAAO,CAAC,6BAA6B;IAcrC;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAoB3B;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAYtB;;;;;OAKG;IACI,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,GAAG,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;CAyBzE;AAGD,QAAA,MAAM,GAAG,aA5Bc,QAAQ,WAAW,KAAK,GAAG,MAAM,YAAY,MAAM,SA4B7C,CAAC;AAE9B,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"general-logger.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/logger/general-logger.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,aAAK,QAAQ;IACX,KAAK,IAAA;IACL,KAAK,IAAA;IACL,IAAI,IAAA;CACL;AAED;;GAEG;AACH,cACM,aAAa;IACjB,OAAO,CAAC,MAAM,CAAS;;IAMvB;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAY9B;;;OAGG;IACH,OAAO,CAAC,6BAA6B;IAcrC;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAoB3B;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAYtB;;;;;OAKG;IACI,GAAG,CACR,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,KAAK,GAAG,MAAM,EACvB,OAAO,CAAC,EAAE,MAAM,GACf,IAAI;CAyBR;AAGD,QAAA,MAAM,GAAG,aA/BK,QAAQ,WACT,KAAK,GAAG,MAAM,YACb,MAAM,KACf,IA4BwB,CAAC;AAE9B,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,EAAE,CAAC"}
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expressots/core",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "description": "Expressots - modern, fast, lightweight nodejs web framework (@core)",
5
5
  "author": "Richard Zampieri",
6
6
  "main": "./lib/cjs/index.js",
@@ -50,6 +50,7 @@
50
50
  "node": ">=18.10.0"
51
51
  },
52
52
  "scripts": {
53
+ "prepare": "husky install",
53
54
  "win-clean": "if exist lib (del /q lib\\*)",
54
55
  "linux-clean": "rm -rf lib/*",
55
56
  "win-cpy": "xcopy package.json lib\\ && xcopy README.md lib\\ && xcopy CHANGELOG.md lib\\ /Y",
@@ -58,33 +59,38 @@
58
59
  "build:linux": "npm run linux-clean && npm run build:esm && npm run build:cjs && npm run linux-cpy",
59
60
  "build:esm": "tsc -p tsconfig.esm.json && mv lib/esm/index.js lib/esm/index.mjs ",
60
61
  "build:cjs": "tsc -p tsconfig.cjs.json",
61
- "git": "powershell -Command \"git add .; git commit -m \"%1\"; npm run release\"",
62
62
  "release": "release-it",
63
63
  "test": "jest",
64
- "format:write": "prettier --write \"packages/**/*.ts\" --cache"
64
+ "format:write": "prettier --write \"packages/**/*.ts\" --cache",
65
+ "lint": "eslint \"packages/**/*.ts\"",
66
+ "lint:fix": "eslint \"packages/**/*.ts\" --fix"
65
67
  },
66
68
  "dependencies": {
67
- "@commitlint/cli": "^17.5.1",
68
- "@commitlint/config-conventional": "^17.4.4",
69
- "@release-it/conventional-changelog": "^5.1.1",
70
69
  "chalk": "^4.1.2",
71
70
  "dotenv": "^16.0.3",
72
71
  "express": "^4.18.2",
73
- "husky": "^8.0.3",
74
72
  "inversify": "^6.0.1",
75
73
  "inversify-binding-decorators": "^4.0.0",
76
74
  "inversify-express-utils": "^6.4.3",
77
75
  "jest": "^29.5.0",
78
76
  "reflect-metadata": "^0.1.13",
79
- "release-it": "^15.9.3",
80
77
  "winston": "^3.8.2",
81
78
  "winston-daily-rotate-file": "^4.7.1"
82
79
  },
83
80
  "devDependencies": {
81
+ "@commitlint/cli": "^17.7.1",
82
+ "@commitlint/config-conventional": "^17.7.0",
83
+ "@release-it/conventional-changelog": "^7.0.1",
84
84
  "@types/express": "^4.17.17",
85
85
  "@types/jest": "^29.5.0",
86
- "@types/node": "^18.15.11",
87
- "prettier": "3.0.1",
86
+ "@types/node": "^20.4.9",
87
+ "@typescript-eslint/eslint-plugin": "^6.6.0",
88
+ "@typescript-eslint/parser": "^6.6.0",
89
+ "eslint": "^8.48.0",
90
+ "eslint-config-prettier": "^9.0.0",
91
+ "husky": "^8.0.3",
92
+ "prettier": "3.0.3",
93
+ "release-it": "^16.1.5",
88
94
  "ts-jest": "^29.0.5",
89
95
  "typescript": "^5.0.3"
90
96
  },