@creator.co/wapi 1.2.5 → 1.2.6
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/README.md +216 -5
- package/dist/index.d.ts +15 -0
- package/dist/index.js.map +1 -1
- package/dist/package.json +6 -1
- package/dist/src/API/Request.d.ts +45 -82
- package/dist/src/API/Request.js +49 -77
- package/dist/src/API/Request.js.map +1 -1
- package/dist/src/API/Response.d.ts +94 -163
- package/dist/src/API/Response.js +101 -161
- package/dist/src/API/Response.js.map +1 -1
- package/dist/src/API/Utils.d.ts +21 -42
- package/dist/src/API/Utils.js +22 -43
- package/dist/src/API/Utils.js.map +1 -1
- package/dist/src/BaseEvent/EventProcessor.d.ts +32 -55
- package/dist/src/BaseEvent/EventProcessor.js +30 -38
- package/dist/src/BaseEvent/EventProcessor.js.map +1 -1
- package/dist/src/BaseEvent/Process.d.ts +20 -43
- package/dist/src/BaseEvent/Process.js +16 -27
- package/dist/src/BaseEvent/Process.js.map +1 -1
- package/dist/src/BaseEvent/Transaction.d.ts +94 -2
- package/dist/src/BaseEvent/Transaction.js +49 -4
- package/dist/src/BaseEvent/Transaction.js.map +1 -1
- package/dist/src/Config/Configuration.d.ts +48 -66
- package/dist/src/Config/Configuration.js +25 -42
- package/dist/src/Config/Configuration.js.map +1 -1
- package/dist/src/Config/EnvironmentVar.d.ts +30 -57
- package/dist/src/Config/EnvironmentVar.js +28 -41
- package/dist/src/Config/EnvironmentVar.js.map +1 -1
- package/dist/src/Crypto/Crypto.d.ts +17 -35
- package/dist/src/Crypto/Crypto.js +12 -21
- package/dist/src/Crypto/Crypto.js.map +1 -1
- package/dist/src/Crypto/JWT.d.ts +21 -32
- package/dist/src/Crypto/JWT.js +14 -22
- package/dist/src/Crypto/JWT.js.map +1 -1
- package/dist/src/Globals.d.ts +26 -94
- package/dist/src/Globals.js +26 -95
- package/dist/src/Globals.js.map +1 -1
- package/dist/src/Logger/Logger.d.ts +82 -105
- package/dist/src/Logger/Logger.js +111 -136
- package/dist/src/Logger/Logger.js.map +1 -1
- package/dist/src/Mailer/Mailer.d.ts +39 -75
- package/dist/src/Mailer/Mailer.js +36 -65
- package/dist/src/Mailer/Mailer.js.map +1 -1
- package/dist/src/Publisher/Publisher.d.ts +17 -25
- package/dist/src/Publisher/Publisher.js +21 -32
- package/dist/src/Publisher/Publisher.js.map +1 -1
- package/dist/src/Server/RouteResolver.d.ts +14 -22
- package/dist/src/Server/RouteResolver.js +21 -34
- package/dist/src/Server/RouteResolver.js.map +1 -1
- package/dist/src/Server/Router.d.ts +72 -51
- package/dist/src/Server/Router.js +8 -17
- package/dist/src/Server/Router.js.map +1 -1
- package/dist/src/Server/lib/ContainerServer.d.ts +15 -31
- package/dist/src/Server/lib/ContainerServer.js +13 -28
- package/dist/src/Server/lib/ContainerServer.js.map +1 -1
- package/dist/src/Server/lib/Server.d.ts +17 -32
- package/dist/src/Server/lib/Server.js +18 -28
- package/dist/src/Server/lib/Server.js.map +1 -1
- package/dist/src/Server/lib/container/GenericHandler.d.ts +5 -0
- package/dist/src/Server/lib/container/GenericHandler.js +16 -3
- package/dist/src/Server/lib/container/GenericHandler.js.map +1 -1
- package/dist/src/Server/lib/container/GenericHandlerEvent.d.ts +22 -37
- package/dist/src/Server/lib/container/GenericHandlerEvent.js +29 -41
- package/dist/src/Server/lib/container/GenericHandlerEvent.js.map +1 -1
- package/dist/src/Server/lib/container/HealthHandler.d.ts +6 -0
- package/dist/src/Server/lib/container/HealthHandler.js +6 -0
- package/dist/src/Server/lib/container/HealthHandler.js.map +1 -1
- package/dist/src/Server/lib/container/Proxy.d.ts +24 -52
- package/dist/src/Server/lib/container/Proxy.js +49 -50
- package/dist/src/Server/lib/container/Proxy.js.map +1 -1
- package/dist/src/Server/lib/container/Utils.d.ts +6 -10
- package/dist/src/Server/lib/container/Utils.js +6 -10
- package/dist/src/Server/lib/container/Utils.js.map +1 -1
- package/dist/src/Validation/Validator.d.ts +9 -13
- package/dist/src/Validation/Validator.js +8 -12
- package/dist/src/Validation/Validator.js.map +1 -1
- package/index.ts +15 -0
- package/package.json +6 -1
- package/src/API/Request.ts +66 -84
- package/src/API/Response.ts +144 -203
- package/src/API/Utils.ts +28 -44
- package/src/BaseEvent/EventProcessor.ts +52 -77
- package/src/BaseEvent/Process.ts +27 -52
- package/src/BaseEvent/Transaction.ts +100 -10
- package/src/Config/Configuration.ts +59 -76
- package/src/Config/EnvironmentVar.ts +39 -62
- package/src/Crypto/Crypto.ts +20 -36
- package/src/Crypto/JWT.ts +31 -35
- package/src/Globals.ts +28 -96
- package/src/Logger/Logger.ts +141 -160
- package/src/Mailer/Mailer.ts +43 -76
- package/src/Publisher/Publisher.ts +31 -40
- package/src/Server/RouteResolver.ts +31 -52
- package/src/Server/Router.ts +75 -54
- package/src/Server/lib/ContainerServer.ts +20 -32
- package/src/Server/lib/Server.ts +19 -34
- package/src/Server/lib/container/GenericHandler.ts +17 -3
- package/src/Server/lib/container/GenericHandlerEvent.ts +44 -54
- package/src/Server/lib/container/HealthHandler.ts +6 -0
- package/src/Server/lib/container/Proxy.ts +37 -57
- package/src/Server/lib/container/Utils.ts +7 -10
- package/src/Validation/Validator.ts +11 -13
- package/tests/API/Response.test.ts +55 -56
- package/tests/BaseEvent/EventProcessor.test.ts +49 -50
- package/tests/BaseEvent/Process.test.ts +2 -2
- package/tests/BaseEvent/Transaction.test.ts +48 -49
- package/tests/Config/Config.test.ts +27 -27
- package/tests/Config/EnvironmentVar.test.ts +54 -18
- package/tests/Publisher/Publisher.test.ts +3 -3
- package/tests/Server/lib/ContainerServer.test.ts +21 -22
- package/tests/Server/lib/container/GenericHandler.test.ts +31 -32
- package/tests/Server/lib/container/GenericHandlerEvent.test.ts +2 -2
- package/tests/Server/lib/container/HealthHandler.test.ts +6 -7
- package/tests/Server/lib/container/Proxy.test.ts +37 -35
- package/tsconfig.json +1 -1
package/dist/src/Globals.js
CHANGED
|
@@ -5,166 +5,97 @@ var Utils_1 = require("./API/Utils");
|
|
|
5
5
|
// important for dev env to load .env file
|
|
6
6
|
dotenv.config();
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* @export
|
|
11
|
-
* @class Globals
|
|
12
|
-
* @typedef {Globals}
|
|
8
|
+
* Class containing global constants and configurations for the application.
|
|
13
9
|
*/
|
|
14
10
|
var Globals = /** @class */ (function () {
|
|
15
11
|
function Globals() {
|
|
16
12
|
}
|
|
17
13
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* @public
|
|
21
|
-
* @static
|
|
22
|
-
* @type {string}
|
|
14
|
+
* A constant string representing an error message for input validation failure.
|
|
23
15
|
*/
|
|
24
16
|
Globals.ErrorResponseValidationFail = 'Input validation failed: '; //400
|
|
25
17
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* @public
|
|
29
|
-
* @static
|
|
30
|
-
* @type {string}
|
|
18
|
+
* A constant string representing an error response for an invalid server response.
|
|
31
19
|
*/
|
|
32
20
|
Globals.ErrorResponseInvalidServerResponse = 'No valid response, this is a system error.'; //400
|
|
33
21
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* @public
|
|
37
|
-
* @static
|
|
38
|
-
* @type {string}
|
|
22
|
+
* The error message for an unhandled error when processing a request.
|
|
39
23
|
*/
|
|
40
24
|
Globals.ErrorResponseUnhandledError = 'Unhandled error when processing request.'; //400
|
|
41
25
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* @public
|
|
45
|
-
* @static
|
|
46
|
-
* @type {string}
|
|
26
|
+
* A static string representing an error response when there are no records to be processed.
|
|
47
27
|
*/
|
|
48
28
|
Globals.ErrorResponseNoRecords = 'No events to be processed.'; //400
|
|
49
29
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* @public
|
|
53
|
-
* @static
|
|
30
|
+
* Represents an error code for a missing parameter.
|
|
54
31
|
* @type {string}
|
|
55
32
|
*/
|
|
56
33
|
Globals.ErrorCode_MissingParam = 'MISSING_PARAM';
|
|
57
34
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* @public
|
|
61
|
-
* @static
|
|
35
|
+
* Represents an error code for invalid input.
|
|
62
36
|
* @type {string}
|
|
63
37
|
*/
|
|
64
38
|
Globals.ErrorCode_InvalidInput = 'INVALID_INPUT';
|
|
65
39
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* @public
|
|
69
|
-
* @static
|
|
40
|
+
* Represents an error code for an API error.
|
|
70
41
|
* @type {string}
|
|
71
42
|
*/
|
|
72
43
|
Globals.ErrorCode_APIError = 'API_ERROR';
|
|
73
44
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* @public
|
|
77
|
-
* @static
|
|
45
|
+
* Represents the error code for when there are no records found.
|
|
78
46
|
* @type {string}
|
|
79
47
|
*/
|
|
80
48
|
Globals.ErrorCode_NoRecords = 'EMPTY_EVENT';
|
|
81
49
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
* @
|
|
86
|
-
* @type {*}
|
|
50
|
+
* Retrieves the default port number for HTTP listeners.
|
|
51
|
+
* The port number is obtained from the environment variable "PORT" and parsed as an integer.
|
|
52
|
+
* If the environment variable is not set or cannot be parsed as an integer, the default port number 9000 is used.
|
|
53
|
+
* @returns {number} - The default port number for HTTP listeners.
|
|
87
54
|
*/
|
|
88
55
|
Globals.Listener_HTTP_DefaultPort = Utils_1.default.parseIntNullIfNaN(process.env.PORT) || 9000;
|
|
89
56
|
/**
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* @public
|
|
93
|
-
* @static
|
|
94
|
-
* @type {string}
|
|
57
|
+
* The default host for the HTTP listener.
|
|
95
58
|
*/
|
|
96
59
|
Globals.Listener_HTTP_DefaultHost = 'localhost';
|
|
97
60
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
* @public
|
|
101
|
-
* @static
|
|
61
|
+
* The HTTP proxy route listener for all routes.
|
|
102
62
|
* @type {string}
|
|
103
63
|
*/
|
|
104
64
|
Globals.Listener_HTTP_ProxyRoute = '*';
|
|
105
65
|
/**
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* @public
|
|
109
|
-
* @static
|
|
110
|
-
* @type {*}
|
|
66
|
+
* Retrieves the default timeout value for HTTP listeners.
|
|
67
|
+
* @returns {number} The default timeout value in milliseconds.
|
|
111
68
|
*/
|
|
112
69
|
Globals.Listener_HTTP_DefaultTimeout = Utils_1.default.parseIntNullIfNaN(process.env.TIMEOUT) || 30000;
|
|
113
70
|
/**
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* @public
|
|
117
|
-
* @static
|
|
118
|
-
* @type {*}
|
|
71
|
+
* The default health check route for the HTTP listener.
|
|
72
|
+
* @type {string}
|
|
119
73
|
*/
|
|
120
74
|
Globals.Listener_HTTP_DefaultHealthCheckRoute = process.env.HEALTH_ROUTE || '/health';
|
|
121
|
-
//Resps
|
|
122
75
|
/**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
* @public
|
|
126
|
-
* @static
|
|
127
|
-
* @type {string}
|
|
76
|
+
* The response message for an exception that occurred during request execution in the Proxy.
|
|
128
77
|
*/
|
|
129
78
|
Globals.Resp_MSG_EXCEPTION = '[Proxy]: Exception during request execution!';
|
|
130
79
|
/**
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
* @public
|
|
134
|
-
* @static
|
|
135
|
-
* @type {string}
|
|
80
|
+
* The response code for an exception that occurred during execution.
|
|
136
81
|
*/
|
|
137
82
|
Globals.Resp_CODE_EXCEPTION = 'EXEC_EXCEPTION';
|
|
138
83
|
/**
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
* @public
|
|
142
|
-
* @static
|
|
143
|
-
* @type {number}
|
|
84
|
+
* The HTTP response status code for an exception scenario.
|
|
144
85
|
*/
|
|
145
86
|
Globals.Resp_STATUSCODE_EXCEPTION = 502;
|
|
146
87
|
/**
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
* @public
|
|
150
|
-
* @static
|
|
151
|
-
* @type {string}
|
|
88
|
+
* The error message for an invalid response from the server.
|
|
152
89
|
*/
|
|
153
90
|
Globals.Resp_MSG_INVALIDRESP = '[Proxy]: Invalid response from server!';
|
|
154
91
|
/**
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
* @public
|
|
158
|
-
* @static
|
|
159
|
-
* @type {string}
|
|
92
|
+
* Represents the response code for an invalid response.
|
|
160
93
|
*/
|
|
161
94
|
Globals.Resp_CODE_INVALIDRESP = 'EMPTY_RESPONSE';
|
|
162
95
|
/**
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
* @public
|
|
166
|
-
* @static
|
|
96
|
+
* The HTTP response status code for an invalid response.
|
|
167
97
|
* @type {number}
|
|
98
|
+
* @default 400
|
|
168
99
|
*/
|
|
169
100
|
Globals.Resp_STATUSCODE_INVALIDRESP = 400;
|
|
170
101
|
return Globals;
|
package/dist/src/Globals.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Globals.js","sourceRoot":"","sources":["../../src/Globals.ts"],"names":[],"mappings":";;AAAA,+BAAgC;AAEhC,qCAA+B;AAE/B,0CAA0C;AAC1C,MAAM,CAAC,MAAM,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"Globals.js","sourceRoot":"","sources":["../../src/Globals.ts"],"names":[],"mappings":";;AAAA,+BAAgC;AAEhC,qCAA+B;AAE/B,0CAA0C;AAC1C,MAAM,CAAC,MAAM,EAAE,CAAA;AAEf;;GAEG;AACH;IAAA;IA4FA,CAAC;IA3FC;;OAEG;IACW,mCAA2B,GAAG,2BAA2B,CAAA,CAAC,KAAK;IAC7E;;OAEG;IACW,0CAAkC,GAAG,4CAA4C,CAAA,CAAC,KAAK;IACrG;;OAEG;IACW,mCAA2B,GAAG,0CAA0C,CAAA,CAAC,KAAK;IAC5F;;OAEG;IACW,8BAAsB,GAAG,4BAA4B,CAAA,CAAC,KAAK;IACzE;;;OAGG;IACW,8BAAsB,GAAG,eAAe,CAAA;IACtD;;;OAGG;IACW,8BAAsB,GAAG,eAAe,CAAA;IACtD;;;OAGG;IACW,0BAAkB,GAAG,WAAW,CAAA;IAC9C;;;OAGG;IACW,2BAAmB,GAAG,aAAa,CAAA;IAEjD;;;;;OAKG;IACW,iCAAyB,GAAG,eAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAA;IAC3F;;OAEG;IACW,iCAAyB,GAAG,WAAW,CAAA;IACrD;;;OAGG;IACW,gCAAwB,GAAG,GAAG,CAAA;IAC5C;;;OAGG;IACW,oCAA4B,GAAG,eAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,CAAA;IAClG;;;OAGG;IACW,6CAAqC,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,SAAS,CAAA;IAE3F;;OAEG;IACW,0BAAkB,GAAG,8CAA8C,CAAA;IACjF;;OAEG;IACW,2BAAmB,GAAG,gBAAgB,CAAA;IACpD;;OAEG;IACW,iCAAyB,GAAG,GAAG,CAAA;IAE7C;;OAEG;IACW,4BAAoB,GAAG,wCAAwC,CAAA;IAC7E;;OAEG;IACW,6BAAqB,GAAG,gBAAgB,CAAA;IACtD;;;;OAIG;IACW,mCAA2B,GAAG,GAAG,CAAA;IACjD,cAAC;CAAA,AA5FD,IA4FC;kBA5FoB,OAAO"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @
|
|
5
|
-
* @
|
|
2
|
+
* Enumeration of log levels.
|
|
3
|
+
* @enum {string}
|
|
4
|
+
* @property {string} DEBUG - Debug log level.
|
|
5
|
+
* @property {string} INFO - Info log level.
|
|
6
|
+
* @property {string} WARN - Warning log level.
|
|
7
|
+
* @property {string} ERROR - Error log level.
|
|
6
8
|
*/
|
|
7
9
|
export declare enum LOG_LEVELS {
|
|
8
10
|
DEBUG = "DEBUG",
|
|
@@ -11,170 +13,145 @@ export declare enum LOG_LEVELS {
|
|
|
11
13
|
ERROR = "ERROR"
|
|
12
14
|
}
|
|
13
15
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* @
|
|
17
|
-
* @
|
|
16
|
+
* Configuration options for the logger.
|
|
17
|
+
* @typedef {Object} LoggerConfig
|
|
18
|
+
* @property {boolean | Array<string>} [sensitiveFilteringKeywords] - Specifies whether to filter sensitive keywords in log messages. Can be a boolean value or an array of strings.
|
|
19
|
+
* @property {LOG_LEVELS | string} [logLevel] - The log level to use for logging. Can be one of the predefined log levels or a custom string value.
|
|
18
20
|
*/
|
|
19
21
|
export type LoggerConfig = {
|
|
20
22
|
sensitiveFilteringKeywords?: boolean | Array<string>;
|
|
21
23
|
logLevel?: LOG_LEVELS | string;
|
|
22
24
|
};
|
|
23
25
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* @export
|
|
27
|
-
* @class Logger
|
|
28
|
-
* @typedef {Logger}
|
|
26
|
+
* Logger class for logging messages with different log levels.
|
|
29
27
|
*/
|
|
30
28
|
export default class Logger {
|
|
31
29
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* @private
|
|
35
|
-
* @type {?LoggerConfig}
|
|
30
|
+
* The optional configuration object for the logger.
|
|
36
31
|
*/
|
|
37
|
-
private
|
|
32
|
+
private config?;
|
|
38
33
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* @private
|
|
34
|
+
* Private property representing the transaction ID.
|
|
42
35
|
* @type {string}
|
|
36
|
+
* @private
|
|
43
37
|
*/
|
|
44
|
-
private
|
|
38
|
+
private transactionID;
|
|
45
39
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* @private
|
|
49
|
-
* @type {(Array<string> | false)}
|
|
40
|
+
* An array of strings representing a blacklist of filters, or false if no blacklist is set.
|
|
50
41
|
*/
|
|
51
|
-
private
|
|
42
|
+
private filterBlacklist;
|
|
52
43
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
44
|
+
* The current log level for the application.
|
|
55
45
|
* @private
|
|
56
46
|
* @type {LOG_LEVELS}
|
|
57
47
|
*/
|
|
58
48
|
private _LOG_LEVEL;
|
|
59
49
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
50
|
+
* The origin of the object.
|
|
62
51
|
* @private
|
|
63
|
-
* @type {
|
|
52
|
+
* @type {any}
|
|
64
53
|
*/
|
|
65
54
|
private origin;
|
|
66
55
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* @
|
|
70
|
-
* @
|
|
71
|
-
* @param {string} transactionID
|
|
56
|
+
* Constructs a Logger object with the given configuration and transaction ID.
|
|
57
|
+
* @param {config} config - The configuration object for the logger. Can be undefined.
|
|
58
|
+
* @param {string} transactionID - The ID of the transaction associated with the logger.
|
|
59
|
+
* @returns None
|
|
72
60
|
*/
|
|
73
|
-
constructor(
|
|
61
|
+
constructor(config: LoggerConfig | undefined, transactionID: string);
|
|
74
62
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* @public
|
|
78
|
-
* @returns {boolean}
|
|
63
|
+
* Returns a boolean value indicating whether the notGlobalLogger function is executed successfully.
|
|
64
|
+
* @returns {boolean} - true if the function is executed successfully, false otherwise.
|
|
79
65
|
*/
|
|
80
66
|
notGlobalLogger(): boolean;
|
|
81
67
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* @
|
|
68
|
+
* Logs the given arguments with the debug log level.
|
|
69
|
+
* @param {...any} args - The arguments to be logged.
|
|
70
|
+
* @returns None
|
|
85
71
|
*/
|
|
86
72
|
debug(...args: any[]): void;
|
|
87
73
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* @
|
|
74
|
+
* Logs the given arguments with the INFO log level.
|
|
75
|
+
* @param {...any} args - The arguments to be logged.
|
|
76
|
+
* @returns None
|
|
91
77
|
*/
|
|
92
78
|
log(...args: any[]): void;
|
|
93
79
|
/**
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* @
|
|
80
|
+
* Logs an informational message.
|
|
81
|
+
* @param {...any} args - The message(s) to log.
|
|
82
|
+
* @returns None
|
|
97
83
|
*/
|
|
98
84
|
info(...args: any[]): void;
|
|
99
85
|
/**
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
* @
|
|
86
|
+
* Logs a warning message with the provided arguments.
|
|
87
|
+
* @param {...any} args - The arguments to be logged as a warning message.
|
|
88
|
+
* @returns None
|
|
103
89
|
*/
|
|
104
90
|
warning(...args: any[]): void;
|
|
105
91
|
/**
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* @
|
|
92
|
+
* Logs a warning message to the console.
|
|
93
|
+
* @param {...any} args - The arguments to be logged.
|
|
94
|
+
* @returns None
|
|
109
95
|
*/
|
|
110
96
|
warn(...args: any[]): void;
|
|
111
97
|
/**
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
* @
|
|
98
|
+
* Logs an error message with the given arguments.
|
|
99
|
+
* @param {...any} args - The arguments to log as an error message.
|
|
100
|
+
* @returns None
|
|
115
101
|
*/
|
|
116
102
|
error(...args: any[]): void;
|
|
117
103
|
/**
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* @param {
|
|
121
|
-
* @
|
|
104
|
+
* Logs an exception with optional additional arguments.
|
|
105
|
+
* @param {any} exception - The exception to log.
|
|
106
|
+
* @param {...any} args - Additional arguments to include in the log.
|
|
107
|
+
* @returns None
|
|
122
108
|
*/
|
|
123
109
|
exception(exception: any, ...args: any[]): void;
|
|
124
110
|
/**
|
|
125
|
-
*
|
|
126
|
-
*
|
|
111
|
+
* Sets up the console bindings for logging purposes.
|
|
127
112
|
* @private
|
|
113
|
+
* @returns None
|
|
128
114
|
*/
|
|
129
|
-
private
|
|
115
|
+
private setupBindings;
|
|
130
116
|
/**
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
* @
|
|
134
|
-
* @param {
|
|
135
|
-
* @
|
|
136
|
-
* @param {string} caller
|
|
137
|
-
* @returns {string}
|
|
117
|
+
* Formats a log message with the specified log level, message, and caller.
|
|
118
|
+
* @param {LOG_LEVELS} level - The log level of the message.
|
|
119
|
+
* @param {Array<string>} msg - An array of strings representing the message.
|
|
120
|
+
* @param {string} caller - The name of the caller function.
|
|
121
|
+
* @returns {string} - The formatted log message.
|
|
138
122
|
*/
|
|
139
|
-
private
|
|
123
|
+
private formattedLog;
|
|
140
124
|
/**
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
* @
|
|
144
|
-
* @param {number} index
|
|
145
|
-
* @returns {string}
|
|
125
|
+
* Returns the name of the caller at the specified index in the call stack.
|
|
126
|
+
* @param {number} index - The index of the caller in the call stack.
|
|
127
|
+
* @returns {string} The name of the caller, including the file name and line number.
|
|
146
128
|
*/
|
|
147
|
-
private
|
|
129
|
+
private callerName;
|
|
148
130
|
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
* @
|
|
152
|
-
* @
|
|
153
|
-
* @param {*} args
|
|
131
|
+
* Processes a log message based on the specified log level and arguments.
|
|
132
|
+
* @param {LOG_LEVELS} level - The log level of the message.
|
|
133
|
+
* @param {any[]} args - The arguments to be logged.
|
|
134
|
+
* @returns None
|
|
154
135
|
*/
|
|
155
|
-
private
|
|
136
|
+
private processLog;
|
|
156
137
|
/**
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
* @
|
|
160
|
-
* @
|
|
161
|
-
* @param {...{}\} args
|
|
138
|
+
* Logs an exception along with additional arguments and the stack trace.
|
|
139
|
+
* @param {Error} exception - The exception object to log.
|
|
140
|
+
* @param {...any} args - Additional arguments to include in the log.
|
|
141
|
+
* @returns None
|
|
162
142
|
*/
|
|
163
|
-
private
|
|
143
|
+
private iexception;
|
|
164
144
|
/**
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
* @
|
|
168
|
-
* @
|
|
169
|
-
* @param {string} fMsg
|
|
145
|
+
* Pushes a log message to the console with the specified log level.
|
|
146
|
+
* @param {LOG_LEVELS} level - The log level of the message.
|
|
147
|
+
* @param {string} fMsg - The formatted log message.
|
|
148
|
+
* @returns None
|
|
170
149
|
*/
|
|
171
|
-
private
|
|
150
|
+
private pushLog;
|
|
172
151
|
/**
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
* @
|
|
176
|
-
* @param {*} value
|
|
177
|
-
* @returns {string}
|
|
152
|
+
* Suppresses sensitive information in the given value based on the filter blacklist.
|
|
153
|
+
* @param {any} value - The value to suppress sensitive information from.
|
|
154
|
+
* @returns {string} - The value with sensitive information suppressed.
|
|
178
155
|
*/
|
|
179
|
-
private
|
|
156
|
+
private suppressSensitiveInfo;
|
|
180
157
|
}
|