@expressots/core 1.1.0 → 1.2.1
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/LICENSE.md +21 -0
- package/README.md +2 -1
- package/lib/CHANGELOG.md +19 -0
- package/lib/README.md +2 -1
- package/lib/cjs/application/app-container.js +40 -28
- package/lib/cjs/application/application.js +108 -73
- package/lib/cjs/application/index.js +9 -9
- package/lib/cjs/common/index.js +2 -0
- package/lib/cjs/common/project-config.provider.js +2 -0
- package/lib/cjs/console/console.js +95 -77
- package/lib/cjs/console/index.js +5 -5
- package/lib/cjs/container-module/container-module.js +56 -42
- package/lib/cjs/container-module/index.js +5 -5
- package/lib/cjs/controller/base-controller.js +77 -56
- package/lib/cjs/controller/index.js +5 -5
- package/lib/cjs/environment/env-validator.js +87 -72
- package/lib/cjs/environment/index.js +5 -5
- package/lib/cjs/error/application-error.js +37 -26
- package/lib/cjs/error/error-handler-middleware.js +17 -9
- package/lib/cjs/error/index.js +9 -9
- package/lib/cjs/error/report.js +27 -20
- package/lib/cjs/error/status-code.js +83 -83
- package/lib/cjs/index.js +24 -23
- package/lib/cjs/logger/general-logger.js +132 -103
- package/lib/cjs/logger/index.js +7 -7
- package/lib/cjs/types/application/app-container.d.ts +19 -7
- package/lib/cjs/types/application/app-container.d.ts.map +1 -1
- package/lib/cjs/types/application/application.d.ts +52 -21
- 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/index.d.ts +2 -0
- package/lib/cjs/types/common/index.d.ts.map +1 -0
- package/lib/cjs/types/common/project-config.provider.d.ts +22 -0
- package/lib/cjs/types/common/project-config.provider.d.ts.map +1 -0
- package/lib/cjs/types/console/console.d.ts +27 -9
- package/lib/cjs/types/console/console.d.ts.map +1 -1
- package/lib/cjs/types/console/index.d.ts +1 -1
- package/lib/cjs/types/container-module/container-module.d.ts +22 -8
- package/lib/cjs/types/container-module/container-module.d.ts.map +1 -1
- package/lib/cjs/types/container-module/index.d.ts +1 -1
- package/lib/cjs/types/controller/base-controller.d.ts +29 -8
- 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 +27 -12
- 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/application-error.d.ts +17 -6
- package/lib/cjs/types/error/application-error.d.ts.map +1 -1
- package/lib/cjs/types/error/error-handler-middleware.d.ts +12 -4
- package/lib/cjs/types/error/error-handler-middleware.d.ts.map +1 -1
- package/lib/cjs/types/error/index.d.ts +3 -3
- package/lib/cjs/types/error/report.d.ts +12 -5
- package/lib/cjs/types/error/report.d.ts.map +1 -1
- package/lib/cjs/types/error/status-code.d.ts +136 -136
- package/lib/cjs/types/index.d.ts +8 -7
- package/lib/cjs/types/index.d.ts.map +1 -1
- package/lib/cjs/types/logger/general-logger.d.ts +45 -16
- package/lib/cjs/types/logger/general-logger.d.ts.map +1 -1
- package/lib/cjs/types/logger/index.d.ts +1 -1
- package/lib/esm/application/app-container.js +38 -26
- package/lib/esm/application/application.js +103 -68
- package/lib/esm/application/index.js +2 -2
- package/lib/esm/common/index.js +1 -0
- package/lib/esm/common/project-config.provider.js +1 -0
- package/lib/esm/console/console.js +76 -58
- package/lib/esm/console/index.js +1 -1
- package/lib/esm/container-module/container-module.js +53 -39
- package/lib/esm/container-module/index.js +1 -1
- package/lib/esm/controller/base-controller.js +64 -43
- package/lib/esm/controller/index.js +1 -1
- package/lib/esm/environment/env-validator.js +80 -65
- package/lib/esm/environment/index.js +1 -1
- package/lib/esm/error/application-error.js +36 -25
- package/lib/esm/error/error-handler-middleware.js +15 -7
- package/lib/esm/error/index.js +3 -3
- package/lib/esm/error/report.js +24 -17
- package/lib/esm/error/status-code.js +80 -80
- package/lib/esm/index.mjs +8 -7
- package/lib/esm/logger/general-logger.js +125 -96
- package/lib/esm/logger/index.js +1 -1
- package/lib/esm/types/application/app-container.d.ts +19 -7
- package/lib/esm/types/application/app-container.d.ts.map +1 -1
- package/lib/esm/types/application/application.d.ts +52 -21
- 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/index.d.ts +2 -0
- package/lib/esm/types/common/index.d.ts.map +1 -0
- package/lib/esm/types/common/project-config.provider.d.ts +22 -0
- package/lib/esm/types/common/project-config.provider.d.ts.map +1 -0
- package/lib/esm/types/console/console.d.ts +27 -9
- package/lib/esm/types/console/console.d.ts.map +1 -1
- package/lib/esm/types/console/index.d.ts +1 -1
- package/lib/esm/types/container-module/container-module.d.ts +22 -8
- package/lib/esm/types/container-module/container-module.d.ts.map +1 -1
- package/lib/esm/types/container-module/index.d.ts +1 -1
- package/lib/esm/types/controller/base-controller.d.ts +29 -8
- 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 +27 -12
- 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/application-error.d.ts +17 -6
- package/lib/esm/types/error/application-error.d.ts.map +1 -1
- package/lib/esm/types/error/error-handler-middleware.d.ts +12 -4
- package/lib/esm/types/error/error-handler-middleware.d.ts.map +1 -1
- package/lib/esm/types/error/index.d.ts +3 -3
- package/lib/esm/types/error/report.d.ts +12 -5
- package/lib/esm/types/error/report.d.ts.map +1 -1
- package/lib/esm/types/error/status-code.d.ts +136 -136
- package/lib/esm/types/index.d.ts +8 -7
- package/lib/esm/types/index.d.ts.map +1 -1
- package/lib/esm/types/logger/general-logger.d.ts +45 -16
- package/lib/esm/types/logger/general-logger.d.ts.map +1 -1
- package/lib/esm/types/logger/index.d.ts +1 -1
- package/lib/package.json +2 -2
- package/package.json +2 -2
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import { NextFunction, Request, Response } from "express";
|
|
2
|
-
import { AppError } from "./application-error";
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { NextFunction, Request, Response } from "express";
|
|
2
|
+
import { AppError } from "./application-error";
|
|
3
|
+
/**
|
|
4
|
+
* errorHandler is a custom Express error-handling middleware function.
|
|
5
|
+
* It logs the error, sets the status code, and sends a JSON response containing the status code and error message.
|
|
6
|
+
* @param error - An instance of AppError containing error details.
|
|
7
|
+
* @param req - The Express request object.
|
|
8
|
+
* @param res - The Express response object.
|
|
9
|
+
* @param next - The Express next function for passing control to the next middleware function.
|
|
10
|
+
*/
|
|
11
|
+
declare function errorHandler(error: AppError, req: Request, res: Response, next: NextFunction): void;
|
|
12
|
+
export default errorHandler;
|
|
5
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,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAI/C,iBAAS,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAI5F;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,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAI/C;;;;;;;GAOG;AACH,iBAAS,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAI5F;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { StatusCode } from './status-code';
|
|
2
|
-
export { AppError } from './application-error';
|
|
3
|
-
export { Report } from './report';
|
|
1
|
+
export { StatusCode } from './status-code';
|
|
2
|
+
export { AppError } from './application-error';
|
|
3
|
+
export { Report } from './report';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import { AppError } from "./application-error";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { AppError } from "./application-error";
|
|
2
|
+
/**
|
|
3
|
+
* Report class is a utility class to manage and throw application-specific errors.
|
|
4
|
+
*/
|
|
5
|
+
declare class Report {
|
|
6
|
+
/**
|
|
7
|
+
* Error method takes an instance of AppError and throws it.
|
|
8
|
+
* @param error - An instance of AppError containing error details.
|
|
9
|
+
*/
|
|
10
|
+
static Error(error: AppError): void;
|
|
11
|
+
}
|
|
12
|
+
export { Report };
|
|
6
13
|
//# sourceMappingURL=report.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/error/report.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,cACM,MAAM;
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/error/report.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C;;GAEG;AACH,cACM,MAAM;IAER;;;OAGG;WACW,KAAK,CAAC,KAAK,EAAE,QAAQ;CAItC;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -1,137 +1,137 @@
|
|
|
1
|
-
declare enum InformationResponse {
|
|
2
|
-
Continue = 100,
|
|
3
|
-
SwitchingProtocols = 101,
|
|
4
|
-
Processing = 102,
|
|
5
|
-
eEarlyHints = 103
|
|
6
|
-
}
|
|
7
|
-
declare enum SuccessfulResponse {
|
|
8
|
-
OK = 200,
|
|
9
|
-
Created = 201,
|
|
10
|
-
Accepted = 202,
|
|
11
|
-
NonAuthoritativeInformation = 203,
|
|
12
|
-
NoContent = 204,
|
|
13
|
-
ResetContent = 205,
|
|
14
|
-
PartialContent = 206,
|
|
15
|
-
MultiStatus = 207,
|
|
16
|
-
AlreadyReported = 208,
|
|
17
|
-
IMUsed = 226
|
|
18
|
-
}
|
|
19
|
-
declare enum RedirectionMessage {
|
|
20
|
-
MultipleChoices = 300,
|
|
21
|
-
MovedPermanently = 301,
|
|
22
|
-
Found = 302,
|
|
23
|
-
SeeOther = 303,
|
|
24
|
-
NotModified = 304,
|
|
25
|
-
TemporaryRedirect = 307,
|
|
26
|
-
PermanentRedirect = 308
|
|
27
|
-
}
|
|
28
|
-
declare enum ClientErrorResponse {
|
|
29
|
-
BadRequest = 400,
|
|
30
|
-
Unauthorized = 401,
|
|
31
|
-
PaymentRequired = 402,
|
|
32
|
-
Forbidden = 403,
|
|
33
|
-
NotFound = 404,
|
|
34
|
-
MethodNotAllowed = 405,
|
|
35
|
-
NotAcceptable = 406,
|
|
36
|
-
ProxyAuthenticationRequired = 407,
|
|
37
|
-
RequestTimeout = 408,
|
|
38
|
-
Conflict = 409,
|
|
39
|
-
Gone = 410,
|
|
40
|
-
LengthRequired = 411,
|
|
41
|
-
PreconditionFailed = 412,
|
|
42
|
-
PayloadTooLarge = 413,
|
|
43
|
-
URITooLong = 414,
|
|
44
|
-
UnsupportedMediaType = 415,
|
|
45
|
-
RangeNotSatisfiable = 416,
|
|
46
|
-
ExpectationFailed = 417,
|
|
47
|
-
ImATeapot = 418,
|
|
48
|
-
MisdirectedRequest = 421,
|
|
49
|
-
UnprocessableEntity = 422,
|
|
50
|
-
Locked = 423,
|
|
51
|
-
FailedDependency = 424,
|
|
52
|
-
TooEarly = 425,
|
|
53
|
-
UpgradeRequired = 426,
|
|
54
|
-
PreconditionRequired = 428,
|
|
55
|
-
TooManyRequests = 429,
|
|
56
|
-
RequestHeaderFieldsTooLarge = 431,
|
|
57
|
-
UnavailableForLegalReasons = 451
|
|
58
|
-
}
|
|
59
|
-
declare enum ServerErrorResponse {
|
|
60
|
-
InternalServerError = 500,
|
|
61
|
-
NotImplemented = 501,
|
|
62
|
-
BadGateway = 502,
|
|
63
|
-
ServiceUnavailable = 503,
|
|
64
|
-
GatewayTimeout = 504,
|
|
65
|
-
HTTPVersionNotSupported = 505,
|
|
66
|
-
VariantAlsoNegotiates = 506,
|
|
67
|
-
InsufficientStorage = 507,
|
|
68
|
-
LoopDetected = 508,
|
|
69
|
-
NotExtended = 510,
|
|
70
|
-
NetworkAuthenticationRequired = 511
|
|
71
|
-
}
|
|
72
|
-
declare const StatusCode: {
|
|
73
|
-
[x: number]: string;
|
|
74
|
-
InternalServerError: ServerErrorResponse.InternalServerError;
|
|
75
|
-
NotImplemented: ServerErrorResponse.NotImplemented;
|
|
76
|
-
BadGateway: ServerErrorResponse.BadGateway;
|
|
77
|
-
ServiceUnavailable: ServerErrorResponse.ServiceUnavailable;
|
|
78
|
-
GatewayTimeout: ServerErrorResponse.GatewayTimeout;
|
|
79
|
-
HTTPVersionNotSupported: ServerErrorResponse.HTTPVersionNotSupported;
|
|
80
|
-
VariantAlsoNegotiates: ServerErrorResponse.VariantAlsoNegotiates;
|
|
81
|
-
InsufficientStorage: ServerErrorResponse.InsufficientStorage;
|
|
82
|
-
LoopDetected: ServerErrorResponse.LoopDetected;
|
|
83
|
-
NotExtended: ServerErrorResponse.NotExtended;
|
|
84
|
-
NetworkAuthenticationRequired: ServerErrorResponse.NetworkAuthenticationRequired;
|
|
85
|
-
BadRequest: ClientErrorResponse.BadRequest;
|
|
86
|
-
Unauthorized: ClientErrorResponse.Unauthorized;
|
|
87
|
-
PaymentRequired: ClientErrorResponse.PaymentRequired;
|
|
88
|
-
Forbidden: ClientErrorResponse.Forbidden;
|
|
89
|
-
NotFound: ClientErrorResponse.NotFound;
|
|
90
|
-
MethodNotAllowed: ClientErrorResponse.MethodNotAllowed;
|
|
91
|
-
NotAcceptable: ClientErrorResponse.NotAcceptable;
|
|
92
|
-
ProxyAuthenticationRequired: ClientErrorResponse.ProxyAuthenticationRequired;
|
|
93
|
-
RequestTimeout: ClientErrorResponse.RequestTimeout;
|
|
94
|
-
Conflict: ClientErrorResponse.Conflict;
|
|
95
|
-
Gone: ClientErrorResponse.Gone;
|
|
96
|
-
LengthRequired: ClientErrorResponse.LengthRequired;
|
|
97
|
-
PreconditionFailed: ClientErrorResponse.PreconditionFailed;
|
|
98
|
-
PayloadTooLarge: ClientErrorResponse.PayloadTooLarge;
|
|
99
|
-
URITooLong: ClientErrorResponse.URITooLong;
|
|
100
|
-
UnsupportedMediaType: ClientErrorResponse.UnsupportedMediaType;
|
|
101
|
-
RangeNotSatisfiable: ClientErrorResponse.RangeNotSatisfiable;
|
|
102
|
-
ExpectationFailed: ClientErrorResponse.ExpectationFailed;
|
|
103
|
-
ImATeapot: ClientErrorResponse.ImATeapot;
|
|
104
|
-
MisdirectedRequest: ClientErrorResponse.MisdirectedRequest;
|
|
105
|
-
UnprocessableEntity: ClientErrorResponse.UnprocessableEntity;
|
|
106
|
-
Locked: ClientErrorResponse.Locked;
|
|
107
|
-
FailedDependency: ClientErrorResponse.FailedDependency;
|
|
108
|
-
TooEarly: ClientErrorResponse.TooEarly;
|
|
109
|
-
UpgradeRequired: ClientErrorResponse.UpgradeRequired;
|
|
110
|
-
PreconditionRequired: ClientErrorResponse.PreconditionRequired;
|
|
111
|
-
TooManyRequests: ClientErrorResponse.TooManyRequests;
|
|
112
|
-
RequestHeaderFieldsTooLarge: ClientErrorResponse.RequestHeaderFieldsTooLarge;
|
|
113
|
-
UnavailableForLegalReasons: ClientErrorResponse.UnavailableForLegalReasons;
|
|
114
|
-
MultipleChoices: RedirectionMessage.MultipleChoices;
|
|
115
|
-
MovedPermanently: RedirectionMessage.MovedPermanently;
|
|
116
|
-
Found: RedirectionMessage.Found;
|
|
117
|
-
SeeOther: RedirectionMessage.SeeOther;
|
|
118
|
-
NotModified: RedirectionMessage.NotModified;
|
|
119
|
-
TemporaryRedirect: RedirectionMessage.TemporaryRedirect;
|
|
120
|
-
PermanentRedirect: RedirectionMessage.PermanentRedirect;
|
|
121
|
-
OK: SuccessfulResponse.OK;
|
|
122
|
-
Created: SuccessfulResponse.Created;
|
|
123
|
-
Accepted: SuccessfulResponse.Accepted;
|
|
124
|
-
NonAuthoritativeInformation: SuccessfulResponse.NonAuthoritativeInformation;
|
|
125
|
-
NoContent: SuccessfulResponse.NoContent;
|
|
126
|
-
ResetContent: SuccessfulResponse.ResetContent;
|
|
127
|
-
PartialContent: SuccessfulResponse.PartialContent;
|
|
128
|
-
MultiStatus: SuccessfulResponse.MultiStatus;
|
|
129
|
-
AlreadyReported: SuccessfulResponse.AlreadyReported;
|
|
130
|
-
IMUsed: SuccessfulResponse.IMUsed;
|
|
131
|
-
Continue: InformationResponse.Continue;
|
|
132
|
-
SwitchingProtocols: InformationResponse.SwitchingProtocols;
|
|
133
|
-
Processing: InformationResponse.Processing;
|
|
134
|
-
eEarlyHints: InformationResponse.eEarlyHints;
|
|
135
|
-
};
|
|
136
|
-
export { StatusCode };
|
|
1
|
+
declare enum InformationResponse {
|
|
2
|
+
Continue = 100,
|
|
3
|
+
SwitchingProtocols = 101,
|
|
4
|
+
Processing = 102,
|
|
5
|
+
eEarlyHints = 103
|
|
6
|
+
}
|
|
7
|
+
declare enum SuccessfulResponse {
|
|
8
|
+
OK = 200,
|
|
9
|
+
Created = 201,
|
|
10
|
+
Accepted = 202,
|
|
11
|
+
NonAuthoritativeInformation = 203,
|
|
12
|
+
NoContent = 204,
|
|
13
|
+
ResetContent = 205,
|
|
14
|
+
PartialContent = 206,
|
|
15
|
+
MultiStatus = 207,
|
|
16
|
+
AlreadyReported = 208,
|
|
17
|
+
IMUsed = 226
|
|
18
|
+
}
|
|
19
|
+
declare enum RedirectionMessage {
|
|
20
|
+
MultipleChoices = 300,
|
|
21
|
+
MovedPermanently = 301,
|
|
22
|
+
Found = 302,
|
|
23
|
+
SeeOther = 303,
|
|
24
|
+
NotModified = 304,
|
|
25
|
+
TemporaryRedirect = 307,
|
|
26
|
+
PermanentRedirect = 308
|
|
27
|
+
}
|
|
28
|
+
declare enum ClientErrorResponse {
|
|
29
|
+
BadRequest = 400,
|
|
30
|
+
Unauthorized = 401,
|
|
31
|
+
PaymentRequired = 402,
|
|
32
|
+
Forbidden = 403,
|
|
33
|
+
NotFound = 404,
|
|
34
|
+
MethodNotAllowed = 405,
|
|
35
|
+
NotAcceptable = 406,
|
|
36
|
+
ProxyAuthenticationRequired = 407,
|
|
37
|
+
RequestTimeout = 408,
|
|
38
|
+
Conflict = 409,
|
|
39
|
+
Gone = 410,
|
|
40
|
+
LengthRequired = 411,
|
|
41
|
+
PreconditionFailed = 412,
|
|
42
|
+
PayloadTooLarge = 413,
|
|
43
|
+
URITooLong = 414,
|
|
44
|
+
UnsupportedMediaType = 415,
|
|
45
|
+
RangeNotSatisfiable = 416,
|
|
46
|
+
ExpectationFailed = 417,
|
|
47
|
+
ImATeapot = 418,
|
|
48
|
+
MisdirectedRequest = 421,
|
|
49
|
+
UnprocessableEntity = 422,
|
|
50
|
+
Locked = 423,
|
|
51
|
+
FailedDependency = 424,
|
|
52
|
+
TooEarly = 425,
|
|
53
|
+
UpgradeRequired = 426,
|
|
54
|
+
PreconditionRequired = 428,
|
|
55
|
+
TooManyRequests = 429,
|
|
56
|
+
RequestHeaderFieldsTooLarge = 431,
|
|
57
|
+
UnavailableForLegalReasons = 451
|
|
58
|
+
}
|
|
59
|
+
declare enum ServerErrorResponse {
|
|
60
|
+
InternalServerError = 500,
|
|
61
|
+
NotImplemented = 501,
|
|
62
|
+
BadGateway = 502,
|
|
63
|
+
ServiceUnavailable = 503,
|
|
64
|
+
GatewayTimeout = 504,
|
|
65
|
+
HTTPVersionNotSupported = 505,
|
|
66
|
+
VariantAlsoNegotiates = 506,
|
|
67
|
+
InsufficientStorage = 507,
|
|
68
|
+
LoopDetected = 508,
|
|
69
|
+
NotExtended = 510,
|
|
70
|
+
NetworkAuthenticationRequired = 511
|
|
71
|
+
}
|
|
72
|
+
declare const StatusCode: {
|
|
73
|
+
[x: number]: string;
|
|
74
|
+
InternalServerError: ServerErrorResponse.InternalServerError;
|
|
75
|
+
NotImplemented: ServerErrorResponse.NotImplemented;
|
|
76
|
+
BadGateway: ServerErrorResponse.BadGateway;
|
|
77
|
+
ServiceUnavailable: ServerErrorResponse.ServiceUnavailable;
|
|
78
|
+
GatewayTimeout: ServerErrorResponse.GatewayTimeout;
|
|
79
|
+
HTTPVersionNotSupported: ServerErrorResponse.HTTPVersionNotSupported;
|
|
80
|
+
VariantAlsoNegotiates: ServerErrorResponse.VariantAlsoNegotiates;
|
|
81
|
+
InsufficientStorage: ServerErrorResponse.InsufficientStorage;
|
|
82
|
+
LoopDetected: ServerErrorResponse.LoopDetected;
|
|
83
|
+
NotExtended: ServerErrorResponse.NotExtended;
|
|
84
|
+
NetworkAuthenticationRequired: ServerErrorResponse.NetworkAuthenticationRequired;
|
|
85
|
+
BadRequest: ClientErrorResponse.BadRequest;
|
|
86
|
+
Unauthorized: ClientErrorResponse.Unauthorized;
|
|
87
|
+
PaymentRequired: ClientErrorResponse.PaymentRequired;
|
|
88
|
+
Forbidden: ClientErrorResponse.Forbidden;
|
|
89
|
+
NotFound: ClientErrorResponse.NotFound;
|
|
90
|
+
MethodNotAllowed: ClientErrorResponse.MethodNotAllowed;
|
|
91
|
+
NotAcceptable: ClientErrorResponse.NotAcceptable;
|
|
92
|
+
ProxyAuthenticationRequired: ClientErrorResponse.ProxyAuthenticationRequired;
|
|
93
|
+
RequestTimeout: ClientErrorResponse.RequestTimeout;
|
|
94
|
+
Conflict: ClientErrorResponse.Conflict;
|
|
95
|
+
Gone: ClientErrorResponse.Gone;
|
|
96
|
+
LengthRequired: ClientErrorResponse.LengthRequired;
|
|
97
|
+
PreconditionFailed: ClientErrorResponse.PreconditionFailed;
|
|
98
|
+
PayloadTooLarge: ClientErrorResponse.PayloadTooLarge;
|
|
99
|
+
URITooLong: ClientErrorResponse.URITooLong;
|
|
100
|
+
UnsupportedMediaType: ClientErrorResponse.UnsupportedMediaType;
|
|
101
|
+
RangeNotSatisfiable: ClientErrorResponse.RangeNotSatisfiable;
|
|
102
|
+
ExpectationFailed: ClientErrorResponse.ExpectationFailed;
|
|
103
|
+
ImATeapot: ClientErrorResponse.ImATeapot;
|
|
104
|
+
MisdirectedRequest: ClientErrorResponse.MisdirectedRequest;
|
|
105
|
+
UnprocessableEntity: ClientErrorResponse.UnprocessableEntity;
|
|
106
|
+
Locked: ClientErrorResponse.Locked;
|
|
107
|
+
FailedDependency: ClientErrorResponse.FailedDependency;
|
|
108
|
+
TooEarly: ClientErrorResponse.TooEarly;
|
|
109
|
+
UpgradeRequired: ClientErrorResponse.UpgradeRequired;
|
|
110
|
+
PreconditionRequired: ClientErrorResponse.PreconditionRequired;
|
|
111
|
+
TooManyRequests: ClientErrorResponse.TooManyRequests;
|
|
112
|
+
RequestHeaderFieldsTooLarge: ClientErrorResponse.RequestHeaderFieldsTooLarge;
|
|
113
|
+
UnavailableForLegalReasons: ClientErrorResponse.UnavailableForLegalReasons;
|
|
114
|
+
MultipleChoices: RedirectionMessage.MultipleChoices;
|
|
115
|
+
MovedPermanently: RedirectionMessage.MovedPermanently;
|
|
116
|
+
Found: RedirectionMessage.Found;
|
|
117
|
+
SeeOther: RedirectionMessage.SeeOther;
|
|
118
|
+
NotModified: RedirectionMessage.NotModified;
|
|
119
|
+
TemporaryRedirect: RedirectionMessage.TemporaryRedirect;
|
|
120
|
+
PermanentRedirect: RedirectionMessage.PermanentRedirect;
|
|
121
|
+
OK: SuccessfulResponse.OK;
|
|
122
|
+
Created: SuccessfulResponse.Created;
|
|
123
|
+
Accepted: SuccessfulResponse.Accepted;
|
|
124
|
+
NonAuthoritativeInformation: SuccessfulResponse.NonAuthoritativeInformation;
|
|
125
|
+
NoContent: SuccessfulResponse.NoContent;
|
|
126
|
+
ResetContent: SuccessfulResponse.ResetContent;
|
|
127
|
+
PartialContent: SuccessfulResponse.PartialContent;
|
|
128
|
+
MultiStatus: SuccessfulResponse.MultiStatus;
|
|
129
|
+
AlreadyReported: SuccessfulResponse.AlreadyReported;
|
|
130
|
+
IMUsed: SuccessfulResponse.IMUsed;
|
|
131
|
+
Continue: InformationResponse.Continue;
|
|
132
|
+
SwitchingProtocols: InformationResponse.SwitchingProtocols;
|
|
133
|
+
Processing: InformationResponse.Processing;
|
|
134
|
+
eEarlyHints: InformationResponse.eEarlyHints;
|
|
135
|
+
};
|
|
136
|
+
export { StatusCode };
|
|
137
137
|
//# sourceMappingURL=status-code.d.ts.map
|
package/lib/esm/types/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export * from "./application";
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
7
|
-
export * from "./
|
|
1
|
+
export * from "./application";
|
|
2
|
+
export * from "./common";
|
|
3
|
+
export * from "./console";
|
|
4
|
+
export * from "./container-module";
|
|
5
|
+
export * from "./controller";
|
|
6
|
+
export * from "./environment";
|
|
7
|
+
export * from "./error";
|
|
8
|
+
export * from "./logger";
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/core/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/core/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
|
|
@@ -1,17 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
/**
|
|
2
|
+
* LogLevel enumeration defines the available log levels.
|
|
3
|
+
*/
|
|
4
|
+
declare enum LogLevel {
|
|
5
|
+
Debug = 0,
|
|
6
|
+
Error = 1,
|
|
7
|
+
Info = 2
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* GeneralLogger class is a utility class to manage logging within the application.
|
|
11
|
+
*/
|
|
12
|
+
declare class GeneralLogger {
|
|
13
|
+
private logger;
|
|
14
|
+
constructor();
|
|
15
|
+
/**
|
|
16
|
+
* Creates a console transport for logging.
|
|
17
|
+
* @returns {transports.ConsoleTransportInstance} A Winston console transport instance.
|
|
18
|
+
*/
|
|
19
|
+
private createConsoleTransport;
|
|
20
|
+
/**
|
|
21
|
+
* Creates a rotational file transport for logging.
|
|
22
|
+
* @returns {DailyRotateFile} A Winston daily rotate file transport instance.
|
|
23
|
+
*/
|
|
24
|
+
private createRotationalFileTransport;
|
|
25
|
+
/**
|
|
26
|
+
* Creates a logger options object for Winston.
|
|
27
|
+
* @returns {LoggerOptions} A Winston logger options object.
|
|
28
|
+
*/
|
|
29
|
+
private createLoggerOptions;
|
|
30
|
+
/**
|
|
31
|
+
* Retrieves the path and line number of the error.
|
|
32
|
+
* @param error - An Error object containing error details.
|
|
33
|
+
* @returns {string} A string containing the path and line number of the error.
|
|
34
|
+
*/
|
|
35
|
+
private getPathAndLine;
|
|
36
|
+
/**
|
|
37
|
+
* Logs a message or error with the specified log level and service.
|
|
38
|
+
* @param logLevel - The log level to use (Debug, Error, or Info).
|
|
39
|
+
* @param content - The message or Error object to log.
|
|
40
|
+
* @param service - The service name (optional) associated with the log.
|
|
41
|
+
*/
|
|
42
|
+
log(logLevel: LogLevel, content: Error | string, service?: string): void;
|
|
43
|
+
}
|
|
44
|
+
declare const log: (logLevel: LogLevel, content: Error | string, service?: string) => void;
|
|
45
|
+
export { LogLevel, GeneralLogger, log };
|
|
17
46
|
//# sourceMappingURL=general-logger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general-logger.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/logger/general-logger.ts"],"names":[],"mappings":"AAIA,aAAK,QAAQ;IACT,KAAK,IAAA;IACL,KAAK,IAAA;IACL,IAAI,IAAA;CACP;AAED,cACM,aAAa;IAEf,OAAO,CAAC,MAAM,CAAS;;IAMvB,OAAO,CAAC,sBAAsB;IAW9B,OAAO,CAAC,6BAA6B;IAerC,OAAO,CAAC,mBAAmB;IAqB3B,OAAO,CAAC,cAAc;
|
|
1
|
+
{"version":3,"file":"general-logger.d.ts","sourceRoot":"","sources":["../../../../packages/core/src/logger/general-logger.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,aAAK,QAAQ;IACT,KAAK,IAAA;IACL,KAAK,IAAA;IACL,IAAI,IAAA;CACP;AAED;;GAEG;AACH,cACM,aAAa;IAEf,OAAO,CAAC,MAAM,CAAS;;IAMvB;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAW9B;;;OAGG;IACH,OAAO,CAAC,6BAA6B;IAerC;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAqB3B;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAYtB;;;;;OAKG;IACI,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,GAAG,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;CAwB3E;AAGD,QAAA,MAAM,GAAG,aA3BgB,QAAQ,WAAW,KAAK,GAAG,MAAM,YAAY,MAAM,SA2B9C,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { GeneralLogger, LogLevel, log } from './general-logger';
|
|
1
|
+
export { GeneralLogger, LogLevel, log } from './general-logger';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expressots/core",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Expressots - modern, fast, lightweight nodejs web framework (@core)",
|
|
5
5
|
"author": "Richard Zampieri",
|
|
6
6
|
"main": "./lib/cjs/index.js",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"@types/jest": "^29.5.0",
|
|
85
85
|
"@types/node": "^18.15.11",
|
|
86
86
|
"ts-jest": "^29.0.5",
|
|
87
|
-
"typescript": "^
|
|
87
|
+
"typescript": "^5.0.3"
|
|
88
88
|
},
|
|
89
89
|
"release-it": {
|
|
90
90
|
"git": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expressots/core",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Expressots - modern, fast, lightweight nodejs web framework (@core)",
|
|
5
5
|
"author": "Richard Zampieri",
|
|
6
6
|
"main": "./lib/cjs/index.js",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"@types/jest": "^29.5.0",
|
|
85
85
|
"@types/node": "^18.15.11",
|
|
86
86
|
"ts-jest": "^29.0.5",
|
|
87
|
-
"typescript": "^
|
|
87
|
+
"typescript": "^5.0.3"
|
|
88
88
|
},
|
|
89
89
|
"release-it": {
|
|
90
90
|
"git": {
|