@expressots/core 1.5.1 → 1.6.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/lib/CHANGELOG.md +16 -0
- package/lib/cjs/application/application.js +6 -5
- package/lib/cjs/controller/base-controller.js +10 -10
- package/lib/cjs/error/error-handler-middleware.js +3 -1
- package/lib/cjs/error/report.js +2 -2
- package/lib/cjs/logger/general-logger.js +5 -5
- package/lib/cjs/types/application/app-container.d.ts.map +1 -1
- package/lib/cjs/types/application/application.d.ts.map +1 -1
- package/lib/cjs/types/application/index.d.ts +2 -2
- package/lib/cjs/types/common/project-config.provider.d.ts +27 -1
- package/lib/cjs/types/common/project-config.provider.d.ts.map +1 -1
- package/lib/cjs/types/console/console.d.ts.map +1 -1
- package/lib/cjs/types/container-module/container-module.d.ts.map +1 -1
- package/lib/cjs/types/container-module/index.d.ts.map +1 -1
- package/lib/cjs/types/controller/base-controller.d.ts +12 -12
- package/lib/cjs/types/controller/base-controller.d.ts.map +1 -1
- package/lib/cjs/types/controller/index.d.ts +1 -1
- package/lib/cjs/types/environment/env-validator.d.ts.map +1 -1
- package/lib/cjs/types/environment/index.d.ts +1 -1
- package/lib/cjs/types/error/error-handler-middleware.d.ts.map +1 -1
- package/lib/cjs/types/error/index.d.ts +2 -2
- package/lib/cjs/types/error/report.d.ts.map +1 -1
- package/lib/cjs/types/error/status-code.d.ts.map +1 -1
- package/lib/cjs/types/logger/general-logger.d.ts.map +1 -1
- package/lib/cjs/types/logger/index.d.ts +1 -1
- package/lib/cjs/types/render/handlebars.interface.d.ts.map +1 -1
- package/lib/esm/application/app-container.js +1 -1
- package/lib/esm/application/application.js +6 -5
- package/lib/esm/application/index.js +2 -2
- package/lib/esm/controller/base-controller.js +12 -12
- package/lib/esm/controller/index.js +1 -1
- package/lib/esm/environment/env-validator.js +1 -1
- package/lib/esm/environment/index.js +1 -1
- package/lib/esm/error/error-handler-middleware.js +3 -1
- package/lib/esm/error/index.js +2 -2
- package/lib/esm/error/report.js +3 -3
- package/lib/esm/error/status-code.js +7 -1
- package/lib/esm/logger/general-logger.js +6 -6
- package/lib/esm/logger/index.js +1 -1
- package/lib/esm/types/application/app-container.d.ts.map +1 -1
- package/lib/esm/types/application/application.d.ts.map +1 -1
- package/lib/esm/types/application/index.d.ts +2 -2
- package/lib/esm/types/common/project-config.provider.d.ts +27 -1
- package/lib/esm/types/common/project-config.provider.d.ts.map +1 -1
- package/lib/esm/types/console/console.d.ts.map +1 -1
- package/lib/esm/types/container-module/container-module.d.ts.map +1 -1
- package/lib/esm/types/container-module/index.d.ts.map +1 -1
- package/lib/esm/types/controller/base-controller.d.ts +12 -12
- package/lib/esm/types/controller/base-controller.d.ts.map +1 -1
- package/lib/esm/types/controller/index.d.ts +1 -1
- package/lib/esm/types/environment/env-validator.d.ts.map +1 -1
- package/lib/esm/types/environment/index.d.ts +1 -1
- package/lib/esm/types/error/error-handler-middleware.d.ts.map +1 -1
- package/lib/esm/types/error/index.d.ts +2 -2
- package/lib/esm/types/error/report.d.ts.map +1 -1
- package/lib/esm/types/error/status-code.d.ts.map +1 -1
- package/lib/esm/types/logger/general-logger.d.ts.map +1 -1
- package/lib/esm/types/logger/index.d.ts +1 -1
- package/lib/esm/types/render/handlebars.interface.d.ts.map +1 -1
- package/lib/package.json +4 -2
- package/package.json +4 -2
package/lib/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [1.6.0](https://github.com/expressots/expressots/compare/1.5.1...1.6.0) (2023-08-07)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add community ideas form ([#43](https://github.com/expressots/expressots/issues/43)) ([e23c936](https://github.com/expressots/expressots/commit/e23c9360cec22f21a8f44e04b290cf6aa23aef17))
|
|
9
|
+
* add dependabot for fetch new version of dependencies ([#60](https://github.com/expressots/expressots/issues/60)) ([9ea1033](https://github.com/expressots/expressots/commit/9ea1033809eb19f50ae779824e5e428710c4480d))
|
|
10
|
+
* add prisma provider configuration types in ExpressoConfig ([#71](https://github.com/expressots/expressots/issues/71)) ([4a189a2](https://github.com/expressots/expressots/commit/4a189a2d85aed320d97fff4aebc48dcb0e125adf))
|
|
11
|
+
* bump prettier from 3.0.0 to 3.0.1 ([#68](https://github.com/expressots/expressots/issues/68)) ([b555e19](https://github.com/expressots/expressots/commit/b555e19698fd102c681b50a96e99ad37b399bae7))
|
|
12
|
+
* **prettier:** add a prettier config and run it in the core package ([#58](https://github.com/expressots/expressots/issues/58)) ([2ac367b](https://github.com/expressots/expressots/commit/2ac367b3c5911216a1ffb9b542ae4bb418227eba))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* add workflow for auto project and label ([#44](https://github.com/expressots/expressots/issues/44)) ([1306d18](https://github.com/expressots/expressots/commit/1306d181bc904384a3edea0be219bba891b865cf))
|
|
18
|
+
|
|
3
19
|
## [1.5.1](https://github.com/expressots/expressots/compare/1.5.0...1.5.1) (2023-07-16)
|
|
4
20
|
|
|
5
21
|
|
|
@@ -14,12 +14,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
var Application_1;
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.ServerEnvironment = exports.Application = exports.AppInstance = void 0;
|
|
17
|
-
const express_1 = __importDefault(require("express"));
|
|
18
17
|
const process_1 = __importDefault(require("process"));
|
|
19
|
-
const
|
|
18
|
+
const express_1 = __importDefault(require("express"));
|
|
20
19
|
const inversify_binding_decorators_1 = require("inversify-binding-decorators");
|
|
21
20
|
const inversify_express_utils_1 = require("inversify-express-utils");
|
|
22
21
|
const console_1 = require("../console/console");
|
|
22
|
+
const error_handler_middleware_1 = __importDefault(require("../error/error-handler-middleware"));
|
|
23
23
|
/**
|
|
24
24
|
* Enum representing possible server environments.
|
|
25
25
|
*/
|
|
@@ -63,9 +63,10 @@ let Application = Application_1 = class Application {
|
|
|
63
63
|
const expressServer = new inversify_express_utils_1.InversifyExpressServer(container);
|
|
64
64
|
expressServer.setConfig((app) => {
|
|
65
65
|
// Detect if a middleware in the array has a body parser. If so, replace the default body parser.
|
|
66
|
-
const hasCustomBodyParser = middlewares.some(middleware => {
|
|
66
|
+
const hasCustomBodyParser = middlewares.some((middleware) => {
|
|
67
67
|
const middlewareName = middleware.name.toLowerCase();
|
|
68
|
-
return middlewareName.includes("json") ||
|
|
68
|
+
return (middlewareName.includes("json") ||
|
|
69
|
+
middlewareName.includes("urlencoded"));
|
|
69
70
|
});
|
|
70
71
|
if (!hasCustomBodyParser) {
|
|
71
72
|
/* Default body parser application/json */
|
|
@@ -73,7 +74,7 @@ let Application = Application_1 = class Application {
|
|
|
73
74
|
/* Default body parser application/x-www-form-urlencoded */
|
|
74
75
|
app.use(express_1.default.urlencoded({ extended: true }));
|
|
75
76
|
}
|
|
76
|
-
middlewares.forEach(middleware => {
|
|
77
|
+
middlewares.forEach((middleware) => {
|
|
77
78
|
app.use(middleware);
|
|
78
79
|
});
|
|
79
80
|
});
|
|
@@ -56,16 +56,16 @@ let BaseController = BaseController_1 = class BaseController {
|
|
|
56
56
|
return res.status(successStatusCode).json(useCase);
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
59
|
+
* Synchronously renders a template with the given options using the Express `Response` object's render method.
|
|
60
|
+
*
|
|
61
|
+
* @protected
|
|
62
|
+
* @method callUseRender
|
|
63
|
+
*
|
|
64
|
+
* @param {Response} res - The Express `Response` object.
|
|
65
|
+
* @param {string} template - The name of the template to render.
|
|
66
|
+
* @param {Object} [options={}] - An optional object containing data to be passed to the template.
|
|
67
|
+
*
|
|
68
|
+
*/
|
|
69
69
|
callUseRender(res, template, options = {}) {
|
|
70
70
|
return res.render(template, options);
|
|
71
71
|
}
|
|
@@ -10,6 +10,8 @@ const status_code_1 = require("./status-code");
|
|
|
10
10
|
* @param next - The Express next function for passing control to the next middleware function.
|
|
11
11
|
*/
|
|
12
12
|
function errorHandler(error, req, res, next) {
|
|
13
|
-
res
|
|
13
|
+
res
|
|
14
|
+
.status(error.statusCode || status_code_1.StatusCode.InternalServerError)
|
|
15
|
+
.json({ statusCode: error.statusCode, error: error.message });
|
|
14
16
|
}
|
|
15
17
|
exports.default = errorHandler;
|
package/lib/cjs/error/report.js
CHANGED
|
@@ -39,7 +39,7 @@ let Report = Report_1 = class Report {
|
|
|
39
39
|
message: error.message,
|
|
40
40
|
service: service !== null && service !== void 0 ? service : callerName,
|
|
41
41
|
name: error.name,
|
|
42
|
-
stack: error.stack
|
|
42
|
+
stack: error.stack,
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
else {
|
|
@@ -48,7 +48,7 @@ let Report = Report_1 = class Report {
|
|
|
48
48
|
message: error,
|
|
49
49
|
service: service !== null && service !== void 0 ? service : callerName,
|
|
50
50
|
name: this.Error.name,
|
|
51
|
-
stack: this.stack
|
|
51
|
+
stack: this.stack,
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
(0, logger_1.log)(logger_1.LogLevel.Error, appError, appError.service || "service-undefined");
|
|
@@ -14,9 +14,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
var GeneralLogger_1;
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.log = exports.GeneralLogger = exports.LogLevel = void 0;
|
|
17
|
+
const inversify_binding_decorators_1 = require("inversify-binding-decorators");
|
|
17
18
|
const winston_1 = require("winston");
|
|
18
19
|
const winston_daily_rotate_file_1 = __importDefault(require("winston-daily-rotate-file"));
|
|
19
|
-
const inversify_binding_decorators_1 = require("inversify-binding-decorators");
|
|
20
20
|
/**
|
|
21
21
|
* LogLevel enumeration defines the available log levels.
|
|
22
22
|
*/
|
|
@@ -41,7 +41,7 @@ let GeneralLogger = GeneralLogger_1 = class GeneralLogger {
|
|
|
41
41
|
const consoleTransport = new winston_1.transports.Console({
|
|
42
42
|
level: (process.env.ENVIRONMENT !== "Development" && "debug") || "debug",
|
|
43
43
|
handleExceptions: false,
|
|
44
|
-
handleRejections: true
|
|
44
|
+
handleRejections: true,
|
|
45
45
|
});
|
|
46
46
|
return consoleTransport;
|
|
47
47
|
}
|
|
@@ -57,7 +57,7 @@ let GeneralLogger = GeneralLogger_1 = class GeneralLogger {
|
|
|
57
57
|
zippedArchive: true,
|
|
58
58
|
maxSize: "20m",
|
|
59
59
|
maxFiles: "7d",
|
|
60
|
-
silent: false
|
|
60
|
+
silent: false,
|
|
61
61
|
});
|
|
62
62
|
return rotationalFileTransport;
|
|
63
63
|
}
|
|
@@ -69,12 +69,12 @@ let GeneralLogger = GeneralLogger_1 = class GeneralLogger {
|
|
|
69
69
|
const loggerOptions = {
|
|
70
70
|
transports: [
|
|
71
71
|
this.createConsoleTransport(),
|
|
72
|
-
this.createRotationalFileTransport()
|
|
72
|
+
this.createRotationalFileTransport(),
|
|
73
73
|
],
|
|
74
74
|
defaultMeta: { service: "service-unknown" },
|
|
75
75
|
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 }) => {
|
|
76
76
|
return `[${timestamp}] [${label}] [${service}] ${level}: ${message}`;
|
|
77
|
-
}))
|
|
77
|
+
})),
|
|
78
78
|
};
|
|
79
79
|
return loggerOptions;
|
|
80
80
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-container.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/application/app-container.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/application/application.ts"],"names":[],"mappings":"
|
|
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,3 +1,3 @@
|
|
|
1
|
-
export { AppInstance, Application, ServerEnvironment } from
|
|
2
|
-
export { AppContainer } from
|
|
1
|
+
export { AppInstance, Application, ServerEnvironment } from "./application";
|
|
2
|
+
export { AppContainer } from "./app-container";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,22 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing different string patterns.
|
|
3
|
+
*
|
|
4
|
+
* - LOWER_CASE: Represents strings in all lowercase letters. E.g. "hello"
|
|
5
|
+
* - KEBAB_CASE: Represents strings separated by hyphens. E.g. "hello-world"
|
|
6
|
+
* - PASCAL_CASE: Represents strings where the first letter of each word is capitalized. E.g. "HelloWorld"
|
|
7
|
+
* - CAMEL_CASE: Represents strings where the first letter of the first word is lowercase and the first letter of subsequent words are capitalized. E.g. "helloWorld"
|
|
8
|
+
*/
|
|
1
9
|
declare const enum Pattern {
|
|
2
10
|
LOWER_CASE = "lowercase",
|
|
3
11
|
KEBAB_CASE = "kebab-case",
|
|
4
12
|
PASCAL_CASE = "PascalCase",
|
|
5
13
|
CAMEL_CASE = "camelCase"
|
|
6
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Interface describing configuration specific to Prisma provider.
|
|
17
|
+
*
|
|
18
|
+
* @property {string} schemaName - The name of the Prisma schema.
|
|
19
|
+
* @property {string} schemaPath - The path to the Prisma schema file.
|
|
20
|
+
* @property {string} entitiesPath - The path to the directory containing entities.
|
|
21
|
+
* @property {string} entityNamePattern - The naming convention to use for entity names.
|
|
22
|
+
*/
|
|
23
|
+
interface IProviders {
|
|
24
|
+
prisma?: {
|
|
25
|
+
schemaName: string;
|
|
26
|
+
schemaPath: string;
|
|
27
|
+
entitiesPath: string;
|
|
28
|
+
entityNamePattern: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
7
31
|
/**
|
|
8
32
|
* The configuration object for the Expresso CLI.
|
|
9
33
|
*
|
|
10
34
|
* @property {Pattern} scaffoldPattern - The pattern to use when scaffolding files.
|
|
11
35
|
* @property {string} sourceRoot - The root directory for the source files.
|
|
12
36
|
* @property {boolean} opinionated - Whether or not to use the opinionated configuration.
|
|
37
|
+
* @property {IProviders} providers - Specific configuration for each provider added.
|
|
13
38
|
*
|
|
14
|
-
* @see [
|
|
39
|
+
* @see [Doc](https://doc.expresso-ts.com/)
|
|
15
40
|
*/
|
|
16
41
|
interface ExpressoConfig {
|
|
17
42
|
scaffoldPattern: Pattern;
|
|
18
43
|
sourceRoot: string;
|
|
19
44
|
opinionated: boolean;
|
|
45
|
+
providers?: IProviders;
|
|
20
46
|
}
|
|
21
47
|
export { ExpressoConfig, Pattern };
|
|
22
48
|
//# sourceMappingURL=project-config.provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-config.provider.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/common/project-config.provider.ts"],"names":[],"mappings":"AAAA,mBAAW,OAAO;
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/console/console.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,UAAU,4BAA4B;
|
|
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 +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,
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/container-module/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/container-module/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Response } from
|
|
2
|
-
import { interfaces } from
|
|
1
|
+
import { Response } from "express";
|
|
2
|
+
import { interfaces } from "inversify-express-utils";
|
|
3
3
|
/**
|
|
4
4
|
* The BaseController class is an abstract base class for controllers.
|
|
5
5
|
* It provides methods for handling use case calls and sending appropriate responses.
|
|
@@ -27,16 +27,16 @@ declare abstract class BaseController implements interfaces.Controller {
|
|
|
27
27
|
*/
|
|
28
28
|
protected callUseCase(useCase: any, res: any, successStatusCode: number): any;
|
|
29
29
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
* Synchronously renders a template with the given options using the Express `Response` object's render method.
|
|
31
|
+
*
|
|
32
|
+
* @protected
|
|
33
|
+
* @method callUseRender
|
|
34
|
+
*
|
|
35
|
+
* @param {Response} res - The Express `Response` object.
|
|
36
|
+
* @param {string} template - The name of the template to render.
|
|
37
|
+
* @param {Object} [options={}] - An optional object containing data to be passed to the template.
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
40
|
protected callUseRender(res: Response, template: string, options?: {}): void;
|
|
41
41
|
/**
|
|
42
42
|
* Asynchronously renders a template with the given options using the Express `Response` object's render method.
|
|
@@ -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;
|
|
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,2 +1,2 @@
|
|
|
1
|
-
export { BaseController } from
|
|
1
|
+
export { BaseController } from "./base-controller";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-validator.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/environment/env-validator.ts"],"names":[],"mappings":"
|
|
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,2 +1,2 @@
|
|
|
1
|
-
export { Environments } from
|
|
1
|
+
export { Environments } from "./env-validator";
|
|
2
2
|
//# sourceMappingURL=index.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,
|
|
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,3 +1,3 @@
|
|
|
1
|
-
export { StatusCode } from
|
|
2
|
-
export { Report } from
|
|
1
|
+
export { StatusCode } from "./status-code";
|
|
2
|
+
export { Report } from "./report";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/error/report.ts"],"names":[],"mappings":"AAGA,UAAU,SAAS;
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/error/report.ts"],"names":[],"mappings":"AAGA,UAAU,SAAS;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,cACM,MAAM;IACV,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC;IAErB;;;;;;;;;;;OAWG;WACW,KAAK,CACjB,KAAK,EAAE,KAAK,GAAG,MAAM,EACrB,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,MAAM,GACf,IAAI;CA6BR;AAED,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-code.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/error/status-code.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status-code.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/error/status-code.ts"],"names":[],"mappings":"AAQA,aAAK,mBAAmB;IACtB,QAAQ,MAAM;IACd,kBAAkB,MAAM;IACxB,UAAU,MAAM;IAChB,WAAW,MAAM;CAClB;AAED,aAAK,kBAAkB;IACrB,EAAE,MAAM;IACR,OAAO,MAAM;IACb,QAAQ,MAAM;IACd,2BAA2B,MAAM;IACjC,SAAS,MAAM;IACf,YAAY,MAAM;IAClB,cAAc,MAAM;IACpB,WAAW,MAAM;IACjB,eAAe,MAAM;IACrB,MAAM,MAAM;CACb;AAED,aAAK,kBAAkB;IACrB,eAAe,MAAM;IACrB,gBAAgB,MAAM;IACtB,KAAK,MAAM;IACX,QAAQ,MAAM;IACd,WAAW,MAAM;IACjB,iBAAiB,MAAM;IACvB,iBAAiB,MAAM;CACxB;AAED,aAAK,mBAAmB;IACtB,UAAU,MAAM;IAChB,YAAY,MAAM;IAClB,eAAe,MAAM;IACrB,SAAS,MAAM;IACf,QAAQ,MAAM;IACd,gBAAgB,MAAM;IACtB,aAAa,MAAM;IACnB,2BAA2B,MAAM;IACjC,cAAc,MAAM;IACpB,QAAQ,MAAM;IACd,IAAI,MAAM;IACV,cAAc,MAAM;IACpB,kBAAkB,MAAM;IACxB,eAAe,MAAM;IACrB,UAAU,MAAM;IAChB,oBAAoB,MAAM;IAC1B,mBAAmB,MAAM;IACzB,iBAAiB,MAAM;IACvB,SAAS,MAAM;IACf,kBAAkB,MAAM;IACxB,mBAAmB,MAAM;IACzB,MAAM,MAAM;IACZ,gBAAgB,MAAM;IACtB,QAAQ,MAAM;IACd,eAAe,MAAM;IACrB,oBAAoB,MAAM;IAC1B,eAAe,MAAM;IACrB,2BAA2B,MAAM;IACjC,0BAA0B,MAAM;CACjC;AAED,aAAK,mBAAmB;IACtB,mBAAmB,MAAM;IACzB,cAAc,MAAM;IACpB,UAAU,MAAM;IAChB,kBAAkB,MAAM;IACxB,cAAc,MAAM;IACpB,uBAAuB,MAAM;IAC7B,qBAAqB,MAAM;IAC3B,mBAAmB,MAAM;IACzB,YAAY,MAAM;IAClB,WAAW,MAAM;IACjB,6BAA6B,MAAM;CACpC;AASD,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA6B,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general-logger.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/logger/general-logger.ts"],"names":[],"mappings":"
|
|
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,2 +1,2 @@
|
|
|
1
|
-
export { GeneralLogger, LogLevel, log } from
|
|
1
|
+
export { GeneralLogger, LogLevel, log } from "./general-logger";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlebars.interface.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/render/handlebars.interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,UAAU,aAAa;
|
|
1
|
+
{"version":3,"file":"handlebars.interface.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/render/handlebars.interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,UAAU,aAAa;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAChC;AAED;;;;;;GAMG;AACH,UAAU,cAAc;IACtB,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7C;AAED;;;;;;;GAOG;AACH,KAAK,MAAM,GAAG,CACZ,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,aAAa,EACtB,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;AAEV;;GAEG;AACH,UAAU,WAAW;IACnB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
var AppContainer_1;
|
|
8
|
-
import { BindingScopeEnum, Container } from "inversify";
|
|
8
|
+
import { BindingScopeEnum, Container, } from "inversify";
|
|
9
9
|
import { buildProviderModule, provide } from "inversify-binding-decorators";
|
|
10
10
|
/**
|
|
11
11
|
* The AppContainer class provides a container for managing dependency injection.
|
|
@@ -8,12 +8,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
var Application_1;
|
|
11
|
-
import express from "express";
|
|
12
11
|
import process from "process";
|
|
13
|
-
import
|
|
12
|
+
import express from "express";
|
|
14
13
|
import { provide } from "inversify-binding-decorators";
|
|
15
14
|
import { InversifyExpressServer } from "inversify-express-utils";
|
|
16
15
|
import { Console } from "../console/console";
|
|
16
|
+
import errorHandler from "../error/error-handler-middleware";
|
|
17
17
|
/**
|
|
18
18
|
* Enum representing possible server environments.
|
|
19
19
|
*/
|
|
@@ -60,9 +60,10 @@ let Application = Application_1 = class Application {
|
|
|
60
60
|
const expressServer = new InversifyExpressServer(container);
|
|
61
61
|
expressServer.setConfig((app) => {
|
|
62
62
|
// Detect if a middleware in the array has a body parser. If so, replace the default body parser.
|
|
63
|
-
const hasCustomBodyParser = middlewares.some(middleware => {
|
|
63
|
+
const hasCustomBodyParser = middlewares.some((middleware) => {
|
|
64
64
|
const middlewareName = middleware.name.toLowerCase();
|
|
65
|
-
return middlewareName.includes("json") ||
|
|
65
|
+
return (middlewareName.includes("json") ||
|
|
66
|
+
middlewareName.includes("urlencoded"));
|
|
66
67
|
});
|
|
67
68
|
if (!hasCustomBodyParser) {
|
|
68
69
|
/* Default body parser application/json */
|
|
@@ -70,7 +71,7 @@ let Application = Application_1 = class Application {
|
|
|
70
71
|
/* Default body parser application/x-www-form-urlencoded */
|
|
71
72
|
app.use(express.urlencoded({ extended: true }));
|
|
72
73
|
}
|
|
73
|
-
middlewares.forEach(middleware => {
|
|
74
|
+
middlewares.forEach((middleware) => {
|
|
74
75
|
app.use(middleware);
|
|
75
76
|
});
|
|
76
77
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AppInstance, Application, ServerEnvironment } from
|
|
2
|
-
export { AppContainer } from
|
|
1
|
+
export { AppInstance, Application, ServerEnvironment } from "./application";
|
|
2
|
+
export { AppContainer } from "./app-container";
|
|
@@ -8,8 +8,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
var BaseController_1;
|
|
11
|
-
import { provide } from
|
|
12
|
-
import {
|
|
11
|
+
import { provide } from "inversify-binding-decorators";
|
|
12
|
+
import { log, LogLevel } from "../logger";
|
|
13
13
|
/**
|
|
14
14
|
* The BaseController class is an abstract base class for controllers.
|
|
15
15
|
* It provides methods for handling use case calls and sending appropriate responses.
|
|
@@ -43,16 +43,16 @@ let BaseController = BaseController_1 = class BaseController {
|
|
|
43
43
|
return res.status(successStatusCode).json(useCase);
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
46
|
+
* Synchronously renders a template with the given options using the Express `Response` object's render method.
|
|
47
|
+
*
|
|
48
|
+
* @protected
|
|
49
|
+
* @method callUseRender
|
|
50
|
+
*
|
|
51
|
+
* @param {Response} res - The Express `Response` object.
|
|
52
|
+
* @param {string} template - The name of the template to render.
|
|
53
|
+
* @param {Object} [options={}] - An optional object containing data to be passed to the template.
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
56
|
callUseRender(res, template, options = {}) {
|
|
57
57
|
return res.render(template, options);
|
|
58
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { BaseController } from
|
|
1
|
+
export { BaseController } from "./base-controller";
|
|
@@ -9,7 +9,7 @@ import fs from "fs";
|
|
|
9
9
|
import path from "path";
|
|
10
10
|
import dotenv from "dotenv";
|
|
11
11
|
import { provide } from "inversify-binding-decorators";
|
|
12
|
-
import {
|
|
12
|
+
import { log, LogLevel } from "../logger";
|
|
13
13
|
/**
|
|
14
14
|
* The EnvValidatorProvider class provides utility methods for working with environment variables.
|
|
15
15
|
* It validates, loads, and retrieves environment variables from the .env file.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Environments } from
|
|
1
|
+
export { Environments } from "./env-validator";
|
|
@@ -8,6 +8,8 @@ import { StatusCode } from "./status-code";
|
|
|
8
8
|
* @param next - The Express next function for passing control to the next middleware function.
|
|
9
9
|
*/
|
|
10
10
|
function errorHandler(error, req, res, next) {
|
|
11
|
-
res
|
|
11
|
+
res
|
|
12
|
+
.status(error.statusCode || StatusCode.InternalServerError)
|
|
13
|
+
.json({ statusCode: error.statusCode, error: error.message });
|
|
12
14
|
}
|
|
13
15
|
export default errorHandler;
|
package/lib/esm/error/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { StatusCode } from
|
|
2
|
-
export { Report } from
|
|
1
|
+
export { StatusCode } from "./status-code";
|
|
2
|
+
export { Report } from "./report";
|
package/lib/esm/error/report.js
CHANGED
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
var Report_1;
|
|
8
8
|
import { provide } from "inversify-binding-decorators";
|
|
9
|
-
import {
|
|
9
|
+
import { log, LogLevel } from "../logger";
|
|
10
10
|
/**
|
|
11
11
|
* Report class is a utility class to manage and log errors within the application.
|
|
12
12
|
* It is responsible for creating a standardized error object, logging it,
|
|
@@ -37,7 +37,7 @@ let Report = class Report {
|
|
|
37
37
|
message: error.message,
|
|
38
38
|
service: service ?? callerName,
|
|
39
39
|
name: error.name,
|
|
40
|
-
stack: error.stack
|
|
40
|
+
stack: error.stack,
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
@@ -46,7 +46,7 @@ let Report = class Report {
|
|
|
46
46
|
message: error,
|
|
47
47
|
service: service ?? callerName,
|
|
48
48
|
name: this.Error.name,
|
|
49
|
-
stack: this.stack
|
|
49
|
+
stack: this.stack,
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
log(LogLevel.Error, appError, appError.service || "service-undefined");
|
|
@@ -75,6 +75,12 @@ var ServerErrorResponse;
|
|
|
75
75
|
ServerErrorResponse[ServerErrorResponse["NotExtended"] = 510] = "NotExtended";
|
|
76
76
|
ServerErrorResponse[ServerErrorResponse["NetworkAuthenticationRequired"] = 511] = "NetworkAuthenticationRequired";
|
|
77
77
|
})(ServerErrorResponse || (ServerErrorResponse = {}));
|
|
78
|
-
const HttpStatusErrorCode = {
|
|
78
|
+
const HttpStatusErrorCode = {
|
|
79
|
+
...InformationResponse,
|
|
80
|
+
...SuccessfulResponse,
|
|
81
|
+
...RedirectionMessage,
|
|
82
|
+
...ClientErrorResponse,
|
|
83
|
+
...ServerErrorResponse,
|
|
84
|
+
};
|
|
79
85
|
const StatusCode = { ...HttpStatusErrorCode };
|
|
80
86
|
export { StatusCode };
|
|
@@ -8,9 +8,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
var GeneralLogger_1;
|
|
11
|
-
import { format, transports, createLogger } from "winston";
|
|
12
|
-
import DailyRotateFile from "winston-daily-rotate-file";
|
|
13
11
|
import { provide } from "inversify-binding-decorators";
|
|
12
|
+
import { createLogger, format, transports, } from "winston";
|
|
13
|
+
import DailyRotateFile from "winston-daily-rotate-file";
|
|
14
14
|
/**
|
|
15
15
|
* LogLevel enumeration defines the available log levels.
|
|
16
16
|
*/
|
|
@@ -36,7 +36,7 @@ let GeneralLogger = GeneralLogger_1 = class GeneralLogger {
|
|
|
36
36
|
const consoleTransport = new transports.Console({
|
|
37
37
|
level: (process.env.ENVIRONMENT !== "Development" && "debug") || "debug",
|
|
38
38
|
handleExceptions: false,
|
|
39
|
-
handleRejections: true
|
|
39
|
+
handleRejections: true,
|
|
40
40
|
});
|
|
41
41
|
return consoleTransport;
|
|
42
42
|
}
|
|
@@ -52,7 +52,7 @@ let GeneralLogger = GeneralLogger_1 = class GeneralLogger {
|
|
|
52
52
|
zippedArchive: true,
|
|
53
53
|
maxSize: "20m",
|
|
54
54
|
maxFiles: "7d",
|
|
55
|
-
silent: false
|
|
55
|
+
silent: false,
|
|
56
56
|
});
|
|
57
57
|
return rotationalFileTransport;
|
|
58
58
|
}
|
|
@@ -64,12 +64,12 @@ let GeneralLogger = GeneralLogger_1 = class GeneralLogger {
|
|
|
64
64
|
const loggerOptions = {
|
|
65
65
|
transports: [
|
|
66
66
|
this.createConsoleTransport(),
|
|
67
|
-
this.createRotationalFileTransport()
|
|
67
|
+
this.createRotationalFileTransport(),
|
|
68
68
|
],
|
|
69
69
|
defaultMeta: { service: "service-unknown" },
|
|
70
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 }) => {
|
|
71
71
|
return `[${timestamp}] [${label}] [${service}] ${level}: ${message}`;
|
|
72
|
-
}))
|
|
72
|
+
})),
|
|
73
73
|
};
|
|
74
74
|
return loggerOptions;
|
|
75
75
|
}
|
package/lib/esm/logger/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { GeneralLogger, LogLevel, log } from
|
|
1
|
+
export { GeneralLogger, LogLevel, log } from "./general-logger";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-container.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/application/app-container.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/application/application.ts"],"names":[],"mappings":"
|
|
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,3 +1,3 @@
|
|
|
1
|
-
export { AppInstance, Application, ServerEnvironment } from
|
|
2
|
-
export { AppContainer } from
|
|
1
|
+
export { AppInstance, Application, ServerEnvironment } from "./application";
|
|
2
|
+
export { AppContainer } from "./app-container";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,22 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing different string patterns.
|
|
3
|
+
*
|
|
4
|
+
* - LOWER_CASE: Represents strings in all lowercase letters. E.g. "hello"
|
|
5
|
+
* - KEBAB_CASE: Represents strings separated by hyphens. E.g. "hello-world"
|
|
6
|
+
* - PASCAL_CASE: Represents strings where the first letter of each word is capitalized. E.g. "HelloWorld"
|
|
7
|
+
* - CAMEL_CASE: Represents strings where the first letter of the first word is lowercase and the first letter of subsequent words are capitalized. E.g. "helloWorld"
|
|
8
|
+
*/
|
|
1
9
|
declare const enum Pattern {
|
|
2
10
|
LOWER_CASE = "lowercase",
|
|
3
11
|
KEBAB_CASE = "kebab-case",
|
|
4
12
|
PASCAL_CASE = "PascalCase",
|
|
5
13
|
CAMEL_CASE = "camelCase"
|
|
6
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Interface describing configuration specific to Prisma provider.
|
|
17
|
+
*
|
|
18
|
+
* @property {string} schemaName - The name of the Prisma schema.
|
|
19
|
+
* @property {string} schemaPath - The path to the Prisma schema file.
|
|
20
|
+
* @property {string} entitiesPath - The path to the directory containing entities.
|
|
21
|
+
* @property {string} entityNamePattern - The naming convention to use for entity names.
|
|
22
|
+
*/
|
|
23
|
+
interface IProviders {
|
|
24
|
+
prisma?: {
|
|
25
|
+
schemaName: string;
|
|
26
|
+
schemaPath: string;
|
|
27
|
+
entitiesPath: string;
|
|
28
|
+
entityNamePattern: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
7
31
|
/**
|
|
8
32
|
* The configuration object for the Expresso CLI.
|
|
9
33
|
*
|
|
10
34
|
* @property {Pattern} scaffoldPattern - The pattern to use when scaffolding files.
|
|
11
35
|
* @property {string} sourceRoot - The root directory for the source files.
|
|
12
36
|
* @property {boolean} opinionated - Whether or not to use the opinionated configuration.
|
|
37
|
+
* @property {IProviders} providers - Specific configuration for each provider added.
|
|
13
38
|
*
|
|
14
|
-
* @see [
|
|
39
|
+
* @see [Doc](https://doc.expresso-ts.com/)
|
|
15
40
|
*/
|
|
16
41
|
interface ExpressoConfig {
|
|
17
42
|
scaffoldPattern: Pattern;
|
|
18
43
|
sourceRoot: string;
|
|
19
44
|
opinionated: boolean;
|
|
45
|
+
providers?: IProviders;
|
|
20
46
|
}
|
|
21
47
|
export { ExpressoConfig, Pattern };
|
|
22
48
|
//# sourceMappingURL=project-config.provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-config.provider.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/common/project-config.provider.ts"],"names":[],"mappings":"AAAA,mBAAW,OAAO;
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/console/console.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,UAAU,4BAA4B;
|
|
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 +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,
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/container-module/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/container-module/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Response } from
|
|
2
|
-
import { interfaces } from
|
|
1
|
+
import { Response } from "express";
|
|
2
|
+
import { interfaces } from "inversify-express-utils";
|
|
3
3
|
/**
|
|
4
4
|
* The BaseController class is an abstract base class for controllers.
|
|
5
5
|
* It provides methods for handling use case calls and sending appropriate responses.
|
|
@@ -27,16 +27,16 @@ declare abstract class BaseController implements interfaces.Controller {
|
|
|
27
27
|
*/
|
|
28
28
|
protected callUseCase(useCase: any, res: any, successStatusCode: number): any;
|
|
29
29
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
* Synchronously renders a template with the given options using the Express `Response` object's render method.
|
|
31
|
+
*
|
|
32
|
+
* @protected
|
|
33
|
+
* @method callUseRender
|
|
34
|
+
*
|
|
35
|
+
* @param {Response} res - The Express `Response` object.
|
|
36
|
+
* @param {string} template - The name of the template to render.
|
|
37
|
+
* @param {Object} [options={}] - An optional object containing data to be passed to the template.
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
40
|
protected callUseRender(res: Response, template: string, options?: {}): void;
|
|
41
41
|
/**
|
|
42
42
|
* Asynchronously renders a template with the given options using the Express `Response` object's render method.
|
|
@@ -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;
|
|
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,2 +1,2 @@
|
|
|
1
|
-
export { BaseController } from
|
|
1
|
+
export { BaseController } from "./base-controller";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-validator.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/environment/env-validator.ts"],"names":[],"mappings":"
|
|
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,2 +1,2 @@
|
|
|
1
|
-
export { Environments } from
|
|
1
|
+
export { Environments } from "./env-validator";
|
|
2
2
|
//# sourceMappingURL=index.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,
|
|
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,3 +1,3 @@
|
|
|
1
|
-
export { StatusCode } from
|
|
2
|
-
export { Report } from
|
|
1
|
+
export { StatusCode } from "./status-code";
|
|
2
|
+
export { Report } from "./report";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/error/report.ts"],"names":[],"mappings":"AAGA,UAAU,SAAS;
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/error/report.ts"],"names":[],"mappings":"AAGA,UAAU,SAAS;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,cACM,MAAM;IACV,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC;IAErB;;;;;;;;;;;OAWG;WACW,KAAK,CACjB,KAAK,EAAE,KAAK,GAAG,MAAM,EACrB,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,MAAM,GACf,IAAI;CA6BR;AAED,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-code.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/error/status-code.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status-code.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/error/status-code.ts"],"names":[],"mappings":"AAQA,aAAK,mBAAmB;IACtB,QAAQ,MAAM;IACd,kBAAkB,MAAM;IACxB,UAAU,MAAM;IAChB,WAAW,MAAM;CAClB;AAED,aAAK,kBAAkB;IACrB,EAAE,MAAM;IACR,OAAO,MAAM;IACb,QAAQ,MAAM;IACd,2BAA2B,MAAM;IACjC,SAAS,MAAM;IACf,YAAY,MAAM;IAClB,cAAc,MAAM;IACpB,WAAW,MAAM;IACjB,eAAe,MAAM;IACrB,MAAM,MAAM;CACb;AAED,aAAK,kBAAkB;IACrB,eAAe,MAAM;IACrB,gBAAgB,MAAM;IACtB,KAAK,MAAM;IACX,QAAQ,MAAM;IACd,WAAW,MAAM;IACjB,iBAAiB,MAAM;IACvB,iBAAiB,MAAM;CACxB;AAED,aAAK,mBAAmB;IACtB,UAAU,MAAM;IAChB,YAAY,MAAM;IAClB,eAAe,MAAM;IACrB,SAAS,MAAM;IACf,QAAQ,MAAM;IACd,gBAAgB,MAAM;IACtB,aAAa,MAAM;IACnB,2BAA2B,MAAM;IACjC,cAAc,MAAM;IACpB,QAAQ,MAAM;IACd,IAAI,MAAM;IACV,cAAc,MAAM;IACpB,kBAAkB,MAAM;IACxB,eAAe,MAAM;IACrB,UAAU,MAAM;IAChB,oBAAoB,MAAM;IAC1B,mBAAmB,MAAM;IACzB,iBAAiB,MAAM;IACvB,SAAS,MAAM;IACf,kBAAkB,MAAM;IACxB,mBAAmB,MAAM;IACzB,MAAM,MAAM;IACZ,gBAAgB,MAAM;IACtB,QAAQ,MAAM;IACd,eAAe,MAAM;IACrB,oBAAoB,MAAM;IAC1B,eAAe,MAAM;IACrB,2BAA2B,MAAM;IACjC,0BAA0B,MAAM;CACjC;AAED,aAAK,mBAAmB;IACtB,mBAAmB,MAAM;IACzB,cAAc,MAAM;IACpB,UAAU,MAAM;IAChB,kBAAkB,MAAM;IACxB,cAAc,MAAM;IACpB,uBAAuB,MAAM;IAC7B,qBAAqB,MAAM;IAC3B,mBAAmB,MAAM;IACzB,YAAY,MAAM;IAClB,WAAW,MAAM;IACjB,6BAA6B,MAAM;CACpC;AASD,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA6B,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general-logger.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/logger/general-logger.ts"],"names":[],"mappings":"
|
|
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,2 +1,2 @@
|
|
|
1
|
-
export { GeneralLogger, LogLevel, log } from
|
|
1
|
+
export { GeneralLogger, LogLevel, log } from "./general-logger";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlebars.interface.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/render/handlebars.interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,UAAU,aAAa;
|
|
1
|
+
{"version":3,"file":"handlebars.interface.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/render/handlebars.interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,UAAU,aAAa;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAChC;AAED;;;;;;GAMG;AACH,UAAU,cAAc;IACtB,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7C;AAED;;;;;;;GAOG;AACH,KAAK,MAAM,GAAG,CACZ,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,aAAa,EACtB,QAAQ,CAAC,EAAE,cAAc,KACtB,IAAI,CAAC;AAEV;;GAEG;AACH,UAAU,WAAW;IACnB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expressots/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Expressots - modern, fast, lightweight nodejs web framework (@core)",
|
|
5
5
|
"author": "Richard Zampieri",
|
|
6
6
|
"main": "./lib/cjs/index.js",
|
|
@@ -60,7 +60,8 @@
|
|
|
60
60
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
61
61
|
"git": "powershell -Command \"git add .; git commit -m \"%1\"; npm run release\"",
|
|
62
62
|
"release": "release-it",
|
|
63
|
-
"test": "jest"
|
|
63
|
+
"test": "jest",
|
|
64
|
+
"format:write": "prettier --write \"packages/**/*.ts\" --cache"
|
|
64
65
|
},
|
|
65
66
|
"dependencies": {
|
|
66
67
|
"@commitlint/cli": "^17.5.1",
|
|
@@ -83,6 +84,7 @@
|
|
|
83
84
|
"@types/express": "^4.17.17",
|
|
84
85
|
"@types/jest": "^29.5.0",
|
|
85
86
|
"@types/node": "^18.15.11",
|
|
87
|
+
"prettier": "3.0.1",
|
|
86
88
|
"ts-jest": "^29.0.5",
|
|
87
89
|
"typescript": "^5.0.3"
|
|
88
90
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expressots/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Expressots - modern, fast, lightweight nodejs web framework (@core)",
|
|
5
5
|
"author": "Richard Zampieri",
|
|
6
6
|
"main": "./lib/cjs/index.js",
|
|
@@ -60,7 +60,8 @@
|
|
|
60
60
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
61
61
|
"git": "powershell -Command \"git add .; git commit -m \"%1\"; npm run release\"",
|
|
62
62
|
"release": "release-it",
|
|
63
|
-
"test": "jest"
|
|
63
|
+
"test": "jest",
|
|
64
|
+
"format:write": "prettier --write \"packages/**/*.ts\" --cache"
|
|
64
65
|
},
|
|
65
66
|
"dependencies": {
|
|
66
67
|
"@commitlint/cli": "^17.5.1",
|
|
@@ -83,6 +84,7 @@
|
|
|
83
84
|
"@types/express": "^4.17.17",
|
|
84
85
|
"@types/jest": "^29.5.0",
|
|
85
86
|
"@types/node": "^18.15.11",
|
|
87
|
+
"prettier": "3.0.1",
|
|
86
88
|
"ts-jest": "^29.0.5",
|
|
87
89
|
"typescript": "^5.0.3"
|
|
88
90
|
},
|