@creator.co/wapi 1.6.1 → 2.0.0-alpha.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.
Files changed (84) hide show
  1. package/.github/workflows/npmpublish.yml +1 -1
  2. package/.github/workflows/prs.yml +1 -1
  3. package/dist/index.js +45 -31
  4. package/dist/index.js.map +1 -1
  5. package/dist/jest.config.js +2 -4
  6. package/dist/jest.config.js.map +1 -1
  7. package/dist/package.json +12 -12
  8. package/dist/src/API/Request.js +53 -59
  9. package/dist/src/API/Request.js.map +1 -1
  10. package/dist/src/API/Response.js +81 -156
  11. package/dist/src/API/Response.js.map +1 -1
  12. package/dist/src/BaseEvent/EventProcessor.js +54 -132
  13. package/dist/src/BaseEvent/EventProcessor.js.map +1 -1
  14. package/dist/src/BaseEvent/Process.js +40 -98
  15. package/dist/src/BaseEvent/Process.js.map +1 -1
  16. package/dist/src/BaseEvent/Transaction.js +122 -310
  17. package/dist/src/BaseEvent/Transaction.js.map +1 -1
  18. package/dist/src/Cache/Redis.js +55 -119
  19. package/dist/src/Cache/Redis.js.map +1 -1
  20. package/dist/src/Cache/types.js +1 -2
  21. package/dist/src/Config/Configuration.js +46 -86
  22. package/dist/src/Config/Configuration.js.map +1 -1
  23. package/dist/src/Config/EnvironmentVar.js +57 -119
  24. package/dist/src/Config/EnvironmentVar.js.map +1 -1
  25. package/dist/src/Crypto/Crypto.js +35 -82
  26. package/dist/src/Crypto/Crypto.js.map +1 -1
  27. package/dist/src/Crypto/JWT.js +12 -27
  28. package/dist/src/Crypto/JWT.js.map +1 -1
  29. package/dist/src/Database/Database.js +3 -8
  30. package/dist/src/Database/Database.js.map +1 -1
  31. package/dist/src/Database/DatabaseManager.js +23 -28
  32. package/dist/src/Database/DatabaseManager.js.map +1 -1
  33. package/dist/src/Database/DatabaseTransaction.js +50 -166
  34. package/dist/src/Database/DatabaseTransaction.js.map +1 -1
  35. package/dist/src/Database/index.js +11 -15
  36. package/dist/src/Database/index.js.map +1 -1
  37. package/dist/src/Database/integrations/knex/KnexDatabase.js +22 -76
  38. package/dist/src/Database/integrations/knex/KnexDatabase.js.map +1 -1
  39. package/dist/src/Database/integrations/knex/KnexTransaction.js +19 -85
  40. package/dist/src/Database/integrations/knex/KnexTransaction.js.map +1 -1
  41. package/dist/src/Database/integrations/kysely/KyselyDatabase.js +37 -88
  42. package/dist/src/Database/integrations/kysely/KyselyDatabase.js.map +1 -1
  43. package/dist/src/Database/integrations/kysely/KyselyTransaction.js +46 -114
  44. package/dist/src/Database/integrations/kysely/KyselyTransaction.js.map +1 -1
  45. package/dist/src/Database/integrations/pgsql/PostgresDatabase.js +20 -71
  46. package/dist/src/Database/integrations/pgsql/PostgresDatabase.js.map +1 -1
  47. package/dist/src/Database/integrations/pgsql/PostgresTransaction.js +19 -85
  48. package/dist/src/Database/integrations/pgsql/PostgresTransaction.js.map +1 -1
  49. package/dist/src/Database/types.js +1 -2
  50. package/dist/src/Globals.js +93 -98
  51. package/dist/src/Globals.js.map +1 -1
  52. package/dist/src/Logger/Logger.js +88 -222
  53. package/dist/src/Logger/Logger.js.map +1 -1
  54. package/dist/src/Mailer/Mailer.js +83 -204
  55. package/dist/src/Mailer/Mailer.js.map +1 -1
  56. package/dist/src/Publisher/Publisher.js +43 -107
  57. package/dist/src/Publisher/Publisher.js.map +1 -1
  58. package/dist/src/Server/RouteResolver.js +22 -49
  59. package/dist/src/Server/RouteResolver.js.map +1 -1
  60. package/dist/src/Server/Router.js +12 -16
  61. package/dist/src/Server/Router.js.map +1 -1
  62. package/dist/src/Server/lib/ContainerServer.js +21 -83
  63. package/dist/src/Server/lib/ContainerServer.js.map +1 -1
  64. package/dist/src/Server/lib/Server.js +50 -99
  65. package/dist/src/Server/lib/Server.js.map +1 -1
  66. package/dist/src/Server/lib/container/GenericHandler.js +32 -107
  67. package/dist/src/Server/lib/container/GenericHandler.js.map +1 -1
  68. package/dist/src/Server/lib/container/GenericHandlerEvent.js +37 -81
  69. package/dist/src/Server/lib/container/GenericHandlerEvent.js.map +1 -1
  70. package/dist/src/Server/lib/container/HealthHandler.js +3 -35
  71. package/dist/src/Server/lib/container/HealthHandler.js.map +1 -1
  72. package/dist/src/Server/lib/container/Proxy.js +64 -127
  73. package/dist/src/Server/lib/container/Proxy.js.map +1 -1
  74. package/dist/src/Server/lib/container/Utils.js +12 -55
  75. package/dist/src/Server/lib/container/Utils.js.map +1 -1
  76. package/dist/src/Util/AsyncSingleton.js +40 -164
  77. package/dist/src/Util/AsyncSingleton.js.map +1 -1
  78. package/dist/src/Util/Utils.js +18 -24
  79. package/dist/src/Util/Utils.js.map +1 -1
  80. package/dist/src/Validation/Validator.js +10 -16
  81. package/dist/src/Validation/Validator.js.map +1 -1
  82. package/package.json +12 -12
  83. package/tests/Logger/Logger.test.ts +5 -3
  84. package/tsconfig.json +3 -1
@@ -1,19 +1,3 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -23,81 +7,41 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
23
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
24
8
  });
25
9
  };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
- }
52
- };
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.PostgresTransactionImpl = void 0;
55
- var DatabaseTransaction_1 = require("../../DatabaseTransaction");
10
+ import { DatabaseTransaction } from '../../DatabaseTransaction';
56
11
  /**
57
12
  * Represents a transaction in a Postgres database.
58
13
  */
59
- var PostgresTransactionImpl = /** @class */ (function (_super) {
60
- __extends(PostgresTransactionImpl, _super);
14
+ export class PostgresTransactionImpl extends DatabaseTransaction {
61
15
  /**
62
16
  * Constructs a new instance of the class with the provided writer, database, and optional reader.
63
17
  * @param {Pool} writer - The writer pool for database operations.
64
18
  * @param {PostgresDatabase} database - The Postgres database instance.
65
19
  * @param {Pool} [reader] - The reader pool for database operations (optional).
66
20
  */
67
- function PostgresTransactionImpl(writer, database, reader) {
68
- var _this = _super.call(this, writer, database, reader) || this;
21
+ constructor(writer, database, reader) {
22
+ super(writer, database, reader);
69
23
  /**
70
24
  * Initiates a transaction by connecting to the writer and executing a 'BEGIN' query.
71
25
  * @returns {Promise<void>} A promise that resolves when the transaction is successfully initiated.
72
26
  */
73
- _this.doBegin = function () { return __awaiter(_this, void 0, void 0, function () {
74
- var _a;
75
- return __generator(this, function (_b) {
76
- switch (_b.label) {
77
- case 0:
78
- _a = this;
79
- return [4 /*yield*/, this.writer.connect()];
80
- case 1:
81
- _a.transaction = _b.sent();
82
- return [2 /*return*/, this.transaction.query('BEGIN')];
83
- }
84
- });
85
- }); };
27
+ this.doBegin = () => __awaiter(this, void 0, void 0, function* () {
28
+ this.transaction = yield this.writer.connect();
29
+ return this.transaction.query('BEGIN');
30
+ });
86
31
  /**
87
32
  * Executes a COMMIT query to commit the current transaction.
88
33
  * @returns A Promise that resolves when the COMMIT query is successfully executed.
89
34
  */
90
- _this.doCommit = function () {
91
- return _this.transaction.query('COMMIT');
35
+ this.doCommit = () => {
36
+ return this.transaction.query('COMMIT');
92
37
  };
93
38
  /**
94
39
  * Rolls back the current transaction by executing a 'ROLLBACK' query.
95
40
  * @returns A Promise that resolves when the rollback is successful.
96
41
  */
97
- _this.doRollback = function () {
98
- return _this.transaction.query('ROLLBACK');
42
+ this.doRollback = () => {
43
+ return this.transaction.query('ROLLBACK');
99
44
  };
100
- return _this;
101
45
  }
102
46
  /**
103
47
  * Creates a new database transaction using the provided writer and database instances.
@@ -106,22 +50,12 @@ var PostgresTransactionImpl = /** @class */ (function (_super) {
106
50
  * @param {Pool} [reader] - Optional reader instance for the transaction.
107
51
  * @returns {Promise<PostgresTransaction>} A promise that resolves to a new PostgresTransaction instance.
108
52
  */
109
- PostgresTransactionImpl.newTransaction = function (writer, database, reader) {
110
- return __awaiter(this, void 0, void 0, function () {
111
- var tx;
112
- return __generator(this, function (_a) {
113
- switch (_a.label) {
114
- case 0:
115
- tx = new PostgresTransactionImpl(writer, database, reader);
116
- return [4 /*yield*/, tx.begin()]; // defaults to opened
117
- case 1:
118
- _a.sent(); // defaults to opened
119
- return [2 /*return*/, DatabaseTransaction_1.DatabaseTransaction.proxyInstance(tx)];
120
- }
121
- });
53
+ static newTransaction(writer, database, reader) {
54
+ return __awaiter(this, void 0, void 0, function* () {
55
+ const tx = new PostgresTransactionImpl(writer, database, reader);
56
+ yield tx.begin(); // defaults to opened
57
+ return DatabaseTransaction.proxyInstance(tx);
122
58
  });
123
- };
124
- return PostgresTransactionImpl;
125
- }(DatabaseTransaction_1.DatabaseTransaction));
126
- exports.PostgresTransactionImpl = PostgresTransactionImpl;
59
+ }
60
+ }
127
61
  //# sourceMappingURL=PostgresTransaction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PostgresTransaction.js","sourceRoot":"","sources":["../../../../../src/Database/integrations/pgsql/PostgresTransaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,iEAA+D;AAQ/D;;GAEG;AACH;IAA6C,2CAAmB;IAoB9D;;;;;OAKG;IACH,iCAAoB,MAAY,EAAE,QAA0B,EAAE,MAAa;QACzE,YAAA,MAAK,YAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,SAAA;QAoBjC;;;WAGG;QACO,aAAO,GAAG;;;;;wBAClB,KAAA,IAAI,CAAA;wBAAe,qBAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,EAAA;;wBAA9C,GAAK,WAAW,GAAG,SAA2B,CAAA;wBAC9C,sBAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,EAAA;;;aACvC,CAAA;QAED;;;WAGG;QACO,cAAQ,GAAG;YACnB,OAAO,KAAI,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;QACzC,CAAC,CAAA;QAED;;;WAGG;QACO,gBAAU,GAAG;YACrB,OAAO,KAAI,CAAC,WAAW,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;QAC3C,CAAC,CAAA;;IA1CD,CAAC;IAED;;;;;;OAMG;IACiB,sCAAc,GAAlC,UACE,MAAY,EACZ,QAA0B,EAC1B,MAAa;;;;;;wBAEP,EAAE,GAAG,IAAI,uBAAuB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;wBAChE,qBAAM,EAAE,CAAC,KAAK,EAAE,EAAA,CAAC,qBAAqB;;wBAAtC,SAAgB,CAAA,CAAC,qBAAqB;wBACtC,sBAAO,yCAAmB,CAAC,aAAa,CAAC,EAAE,CAAQ,EAAA;;;;KACpD;IA0BH,8BAAC;AAAD,CAAC,AAvED,CAA6C,yCAAmB,GAuE/D;AAvEY,0DAAuB"}
1
+ {"version":3,"file":"PostgresTransaction.js","sourceRoot":"","sources":["../../../../../src/Database/integrations/pgsql/PostgresTransaction.ts"],"names":[],"mappings":";;;;;;;;;AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAQ/D;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,mBAAmB;IAoB9D;;;;;OAKG;IACH,YAAoB,MAAY,EAAE,QAA0B,EAAE,MAAa;QACzE,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;QAoBjC;;;WAGG;QACO,YAAO,GAAG,GAAS,EAAE;YAC7B,IAAI,CAAC,WAAW,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAA;YAC9C,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QACxC,CAAC,CAAA,CAAA;QAED;;;WAGG;QACO,aAAQ,GAAG,GAAG,EAAE;YACxB,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;QACzC,CAAC,CAAA;QAED;;;WAGG;QACO,eAAU,GAAG,GAAG,EAAE;YAC1B,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;QAC3C,CAAC,CAAA;IA1CD,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAO,cAAc,CAChC,MAAY,EACZ,QAA0B,EAC1B,MAAa;;YAEb,MAAM,EAAE,GAAG,IAAI,uBAAuB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;YAChE,MAAM,EAAE,CAAC,KAAK,EAAE,CAAA,CAAC,qBAAqB;YACtC,OAAO,mBAAmB,CAAC,aAAa,CAAC,EAAE,CAAQ,CAAA;QACrD,CAAC;KAAA;CA0BF"}
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=types.js.map
@@ -1,104 +1,99 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var dotenv = require("dotenv");
4
- var Utils_1 = require("./Util/Utils");
1
+ import * as dotenv from 'dotenv';
2
+ import Utils from './Util/Utils';
5
3
  // important for dev env to load .env file
6
4
  dotenv.config();
7
5
  /**
8
6
  * Class containing global constants and configurations for the application.
9
7
  */
10
- var Globals = /** @class */ (function () {
11
- function Globals() {
12
- }
13
- /**
14
- * A constant string representing an error message for input validation failure.
15
- */
16
- Globals.ErrorResponseValidationFail = 'Input validation failed: '; //400
17
- /**
18
- * A constant string representing an error response for an invalid server response.
19
- */
20
- Globals.ErrorResponseInvalidServerResponse = 'No valid response, this is a system error.'; //400
21
- /**
22
- * The error message for an unhandled error when processing a request.
23
- */
24
- Globals.ErrorResponseUnhandledError = 'Unhandled error when processing request.'; //400
25
- /**
26
- * A static string representing an error response when there are no records to be processed.
27
- */
28
- Globals.ErrorResponseNoRecords = 'No events to be processed.'; //400
29
- /**
30
- * Represents an error code for a missing parameter.
31
- * @type {string}
32
- */
33
- Globals.ErrorCode_MissingParam = 'MISSING_PARAM';
34
- /**
35
- * Represents an error code for invalid input.
36
- * @type {string}
37
- */
38
- Globals.ErrorCode_InvalidInput = 'INVALID_INPUT';
39
- /**
40
- * Represents an error code for an API error.
41
- * @type {string}
42
- */
43
- Globals.ErrorCode_APIError = 'API_ERROR';
44
- /**
45
- * Represents the error code for when there are no records found.
46
- * @type {string}
47
- */
48
- Globals.ErrorCode_NoRecords = 'EMPTY_EVENT';
49
- /**
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.
54
- */
55
- Globals.Listener_HTTP_DefaultPort = Utils_1.default.parseIntNullIfNaN(process.env.PORT) || 9000;
56
- /**
57
- * The default host for the HTTP listener.
58
- */
59
- Globals.Listener_HTTP_DefaultHost = 'localhost';
60
- /**
61
- * The HTTP proxy route listener for all routes.
62
- * @type {string}
63
- */
64
- Globals.Listener_HTTP_ProxyRoute = '*';
65
- /**
66
- * Retrieves the default timeout value for HTTP listeners.
67
- * @returns {number} The default timeout value in milliseconds.
68
- */
69
- Globals.Listener_HTTP_DefaultTimeout = Utils_1.default.parseIntNullIfNaN(process.env.TIMEOUT) || 30000;
70
- /**
71
- * The default health check route for the HTTP listener.
72
- * @type {string}
73
- */
74
- Globals.Listener_HTTP_DefaultHealthCheckRoute = process.env.HEALTH_ROUTE || '/health';
75
- /**
76
- * The response message for an exception that occurred during request execution in the Proxy.
77
- */
78
- Globals.Resp_MSG_EXCEPTION = '[Proxy]: Exception during request execution!';
79
- /**
80
- * The response code for an exception that occurred during execution.
81
- */
82
- Globals.Resp_CODE_EXCEPTION = 'EXEC_EXCEPTION';
83
- /**
84
- * The HTTP response status code for an exception scenario.
85
- */
86
- Globals.Resp_STATUSCODE_EXCEPTION = 502;
87
- /**
88
- * The error message for an invalid response from the server.
89
- */
90
- Globals.Resp_MSG_INVALIDRESP = '[Proxy]: Invalid response from server!';
91
- /**
92
- * Represents the response code for an invalid response.
93
- */
94
- Globals.Resp_CODE_INVALIDRESP = 'EMPTY_RESPONSE';
95
- /**
96
- * The HTTP response status code for an invalid response.
97
- * @type {number}
98
- * @default 400
99
- */
100
- Globals.Resp_STATUSCODE_INVALIDRESP = 400;
101
- return Globals;
102
- }());
103
- exports.default = Globals;
8
+ class Globals {
9
+ }
10
+ /**
11
+ * A constant string representing an error message for input validation failure.
12
+ */
13
+ Globals.ErrorResponseValidationFail = 'Input validation failed: '; //400
14
+ /**
15
+ * A constant string representing an error response for an invalid server response.
16
+ */
17
+ Globals.ErrorResponseInvalidServerResponse = 'No valid response, this is a system error.'; //400
18
+ /**
19
+ * The error message for an unhandled error when processing a request.
20
+ */
21
+ Globals.ErrorResponseUnhandledError = 'Unhandled error when processing request.'; //400
22
+ /**
23
+ * A static string representing an error response when there are no records to be processed.
24
+ */
25
+ Globals.ErrorResponseNoRecords = 'No events to be processed.'; //400
26
+ /**
27
+ * Represents an error code for a missing parameter.
28
+ * @type {string}
29
+ */
30
+ Globals.ErrorCode_MissingParam = 'MISSING_PARAM';
31
+ /**
32
+ * Represents an error code for invalid input.
33
+ * @type {string}
34
+ */
35
+ Globals.ErrorCode_InvalidInput = 'INVALID_INPUT';
36
+ /**
37
+ * Represents an error code for an API error.
38
+ * @type {string}
39
+ */
40
+ Globals.ErrorCode_APIError = 'API_ERROR';
41
+ /**
42
+ * Represents the error code for when there are no records found.
43
+ * @type {string}
44
+ */
45
+ Globals.ErrorCode_NoRecords = 'EMPTY_EVENT';
46
+ /**
47
+ * Retrieves the default port number for HTTP listeners.
48
+ * The port number is obtained from the environment variable "PORT" and parsed as an integer.
49
+ * If the environment variable is not set or cannot be parsed as an integer, the default port number 9000 is used.
50
+ * @returns {number} - The default port number for HTTP listeners.
51
+ */
52
+ Globals.Listener_HTTP_DefaultPort = Utils.parseIntNullIfNaN(process.env.PORT) || 9000;
53
+ /**
54
+ * The default host for the HTTP listener.
55
+ */
56
+ Globals.Listener_HTTP_DefaultHost = 'localhost';
57
+ /**
58
+ * The HTTP proxy route listener for all routes.
59
+ * @type {string}
60
+ */
61
+ Globals.Listener_HTTP_ProxyRoute = '*';
62
+ /**
63
+ * Retrieves the default timeout value for HTTP listeners.
64
+ * @returns {number} The default timeout value in milliseconds.
65
+ */
66
+ Globals.Listener_HTTP_DefaultTimeout = Utils.parseIntNullIfNaN(process.env.TIMEOUT) || 30000;
67
+ /**
68
+ * The default health check route for the HTTP listener.
69
+ * @type {string}
70
+ */
71
+ Globals.Listener_HTTP_DefaultHealthCheckRoute = process.env.HEALTH_ROUTE || '/health';
72
+ /**
73
+ * The response message for an exception that occurred during request execution in the Proxy.
74
+ */
75
+ Globals.Resp_MSG_EXCEPTION = '[Proxy]: Exception during request execution!';
76
+ /**
77
+ * The response code for an exception that occurred during execution.
78
+ */
79
+ Globals.Resp_CODE_EXCEPTION = 'EXEC_EXCEPTION';
80
+ /**
81
+ * The HTTP response status code for an exception scenario.
82
+ */
83
+ Globals.Resp_STATUSCODE_EXCEPTION = 502;
84
+ /**
85
+ * The error message for an invalid response from the server.
86
+ */
87
+ Globals.Resp_MSG_INVALIDRESP = '[Proxy]: Invalid response from server!';
88
+ /**
89
+ * Represents the response code for an invalid response.
90
+ */
91
+ Globals.Resp_CODE_INVALIDRESP = 'EMPTY_RESPONSE';
92
+ /**
93
+ * The HTTP response status code for an invalid response.
94
+ * @type {number}
95
+ * @default 400
96
+ */
97
+ Globals.Resp_STATUSCODE_INVALIDRESP = 400;
98
+ export default Globals;
104
99
  //# sourceMappingURL=Globals.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Globals.js","sourceRoot":"","sources":["../../src/Globals.ts"],"names":[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