@seidor-cloud-produtos/orbit-backend-lib 0.0.96 → 0.0.98

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 (209) hide show
  1. package/README.md +0 -0
  2. package/dist/clean-arch/application/cache/cache.d.ts +0 -0
  3. package/dist/clean-arch/application/cache/cache.js +6 -9
  4. package/dist/clean-arch/application/cache/client.d.ts +0 -0
  5. package/dist/clean-arch/application/cache/client.js +0 -0
  6. package/dist/clean-arch/application/logger/index.d.ts +11 -0
  7. package/dist/clean-arch/application/logger/index.js +25 -0
  8. package/dist/clean-arch/application/orbit-http-client/orbit-http-client-dto.d.ts +0 -0
  9. package/dist/clean-arch/application/orbit-http-client/orbit-http-client-dto.js +0 -0
  10. package/dist/clean-arch/application/orbit-http-client/orbit-http-client.d.ts +0 -0
  11. package/dist/clean-arch/application/orbit-http-client/orbit-http-client.js +0 -0
  12. package/dist/clean-arch/application/oribit-notification-client/orbit-notification-client.d.ts +0 -0
  13. package/dist/clean-arch/application/oribit-notification-client/orbit-notification-client.js +0 -0
  14. package/dist/clean-arch/application/queue/handler.d.ts +0 -0
  15. package/dist/clean-arch/application/queue/handler.js +1 -3
  16. package/dist/clean-arch/application/queue/messages-in-memory.d.ts +0 -0
  17. package/dist/clean-arch/application/queue/messages-in-memory.js +0 -0
  18. package/dist/clean-arch/application/queue/queue-connection.d.ts +0 -0
  19. package/dist/clean-arch/application/queue/queue-connection.js +0 -0
  20. package/dist/clean-arch/application/queue/queue.d.ts +0 -0
  21. package/dist/clean-arch/application/queue/queue.js +0 -0
  22. package/dist/clean-arch/domain/entities/aggregate-root.d.ts +0 -0
  23. package/dist/clean-arch/domain/entities/aggregate-root.js +0 -0
  24. package/dist/clean-arch/domain/entities/common-dto.d.ts +0 -0
  25. package/dist/clean-arch/domain/entities/common-dto.js +0 -0
  26. package/dist/clean-arch/domain/entities/entity.d.ts +0 -0
  27. package/dist/clean-arch/domain/entities/entity.js +2 -0
  28. package/dist/clean-arch/domain/entities/unique-entity-id.d.ts +0 -0
  29. package/dist/clean-arch/domain/entities/unique-entity-id.js +1 -0
  30. package/dist/clean-arch/domain/entities/value-object.d.ts +0 -0
  31. package/dist/clean-arch/domain/entities/value-object.js +1 -0
  32. package/dist/clean-arch/domain/entities/watched-list.d.ts +0 -0
  33. package/dist/clean-arch/domain/entities/watched-list.js +5 -0
  34. package/dist/clean-arch/domain/entities/watched-list.spec.d.ts +0 -0
  35. package/dist/clean-arch/domain/entities/watched-list.spec.js +0 -0
  36. package/dist/clean-arch/domain/errors/application-error.d.ts +0 -0
  37. package/dist/clean-arch/domain/errors/application-error.js +1 -0
  38. package/dist/clean-arch/domain/errors/domain-error.d.ts +0 -0
  39. package/dist/clean-arch/domain/errors/domain-error.js +1 -0
  40. package/dist/clean-arch/domain/errors/http-error.d.ts +0 -0
  41. package/dist/clean-arch/domain/errors/http-error.js +2 -0
  42. package/dist/clean-arch/domain/errors/invalid-password-algorithm-error.d.ts +0 -0
  43. package/dist/clean-arch/domain/errors/invalid-password-algorithm-error.js +0 -0
  44. package/dist/clean-arch/domain/errors/invalid-password-length-error.d.ts +0 -0
  45. package/dist/clean-arch/domain/errors/invalid-password-length-error.js +0 -0
  46. package/dist/clean-arch/domain/errors/validation-error.d.ts +0 -0
  47. package/dist/clean-arch/domain/errors/validation-error.js +2 -0
  48. package/dist/clean-arch/domain/events/domain-event.d.ts +0 -0
  49. package/dist/clean-arch/domain/events/domain-event.js +0 -0
  50. package/dist/clean-arch/domain/factories/create-password-factory.d.ts +0 -0
  51. package/dist/clean-arch/domain/factories/create-password-factory.js +0 -0
  52. package/dist/clean-arch/domain/factories/random-password-temporary-factory.d.ts +0 -0
  53. package/dist/clean-arch/domain/factories/random-password-temporary-factory.js +0 -0
  54. package/dist/clean-arch/domain/interfaces/address-type.d.ts +0 -0
  55. package/dist/clean-arch/domain/interfaces/address-type.js +0 -0
  56. package/dist/clean-arch/domain/interfaces/city.d.ts +0 -0
  57. package/dist/clean-arch/domain/interfaces/city.js +0 -0
  58. package/dist/clean-arch/domain/interfaces/country.d.ts +0 -0
  59. package/dist/clean-arch/domain/interfaces/country.js +0 -0
  60. package/dist/clean-arch/domain/interfaces/ddd.d.ts +0 -0
  61. package/dist/clean-arch/domain/interfaces/ddd.js +0 -0
  62. package/dist/clean-arch/domain/interfaces/state.d.ts +0 -0
  63. package/dist/clean-arch/domain/interfaces/state.js +0 -0
  64. package/dist/clean-arch/domain/types/optional.d.ts +0 -0
  65. package/dist/clean-arch/domain/types/optional.js +0 -0
  66. package/dist/clean-arch/domain/value-objects/password.d.ts +0 -0
  67. package/dist/clean-arch/domain/value-objects/password.js +5 -0
  68. package/dist/clean-arch/domain/value-objects/pbkdf2-password.d.ts +0 -0
  69. package/dist/clean-arch/domain/value-objects/pbkdf2-password.js +3 -0
  70. package/dist/clean-arch/domain/value-objects/sha1-password.d.ts +0 -0
  71. package/dist/clean-arch/domain/value-objects/sha1-password.js +3 -0
  72. package/dist/clean-arch/infra/adapters/express-adapter.d.ts +0 -0
  73. package/dist/clean-arch/infra/adapters/express-adapter.js +3 -0
  74. package/dist/clean-arch/infra/adapters/fastify-adapter.d.ts +0 -0
  75. package/dist/clean-arch/infra/adapters/fastify-adapter.js +2 -0
  76. package/dist/clean-arch/infra/authorizations/authorization.d.ts +2 -2
  77. package/dist/clean-arch/infra/authorizations/authorization.js +0 -0
  78. package/dist/clean-arch/infra/authorizations/authorizer.d.ts +0 -0
  79. package/dist/clean-arch/infra/authorizations/authorizer.js +0 -0
  80. package/dist/clean-arch/infra/authorizations/authorizer.spec.d.ts +0 -0
  81. package/dist/clean-arch/infra/authorizations/authorizer.spec.js +0 -0
  82. package/dist/clean-arch/infra/authorizations/not-allowed.d.ts +2 -2
  83. package/dist/clean-arch/infra/authorizations/not-allowed.js +0 -0
  84. package/dist/clean-arch/infra/cache/clients/node-cache.d.ts +0 -0
  85. package/dist/clean-arch/infra/cache/clients/node-cache.js +1 -0
  86. package/dist/clean-arch/infra/cache/clients/redis.d.ts +0 -0
  87. package/dist/clean-arch/infra/cache/clients/redis.js +2 -0
  88. package/dist/clean-arch/infra/environment/env.d.ts +2 -0
  89. package/dist/clean-arch/infra/environment/env.js +2 -0
  90. package/dist/clean-arch/infra/environment/environment.d.ts +0 -0
  91. package/dist/clean-arch/infra/environment/environment.js +0 -0
  92. package/dist/clean-arch/infra/errors/infra-error.d.ts +0 -0
  93. package/dist/clean-arch/infra/errors/infra-error.js +1 -0
  94. package/dist/clean-arch/infra/http/controller.d.ts +0 -0
  95. package/dist/clean-arch/infra/http/controller.js +0 -0
  96. package/dist/clean-arch/infra/http/handle-bool-filter.d.ts +0 -0
  97. package/dist/clean-arch/infra/http/handle-bool-filter.js +0 -0
  98. package/dist/clean-arch/infra/http/handle-is-active-query.d.ts +0 -0
  99. package/dist/clean-arch/infra/http/handle-is-active-query.js +0 -0
  100. package/dist/clean-arch/infra/http/handle-sort-param-query.d.ts +0 -0
  101. package/dist/clean-arch/infra/http/handle-sort-param-query.js +0 -0
  102. package/dist/clean-arch/infra/http/handle-user-headers.d.ts +0 -0
  103. package/dist/clean-arch/infra/http/handle-user-headers.js +0 -0
  104. package/dist/clean-arch/infra/http/health-connections.d.ts +0 -0
  105. package/dist/clean-arch/infra/http/health-connections.js +1 -0
  106. package/dist/clean-arch/infra/http/http.d.ts +0 -0
  107. package/dist/clean-arch/infra/http/http.js +0 -0
  108. package/dist/clean-arch/infra/orbit-http-client/orbit-axios-client/orbit-axios-client.d.ts +0 -0
  109. package/dist/clean-arch/infra/orbit-http-client/orbit-axios-client/orbit-axios-client.js +6 -9
  110. package/dist/clean-arch/infra/orbit-notification-client/discord-client.d.ts +0 -0
  111. package/dist/clean-arch/infra/orbit-notification-client/discord-client.js +1 -0
  112. package/dist/clean-arch/infra/queue/create-consumers.d.ts +0 -0
  113. package/dist/clean-arch/infra/queue/create-consumers.js +1 -0
  114. package/dist/clean-arch/infra/queue/in-memory/in-memory-queue.d.ts +0 -0
  115. package/dist/clean-arch/infra/queue/in-memory/in-memory-queue.js +1 -0
  116. package/dist/clean-arch/infra/queue/queue-controller.d.ts +0 -0
  117. package/dist/clean-arch/infra/queue/queue-controller.js +1 -0
  118. package/dist/clean-arch/infra/queue/rabbitmq/amqp-lib.d.ts +0 -0
  119. package/dist/clean-arch/infra/queue/rabbitmq/amqp-lib.js +7 -2
  120. package/dist/clean-arch/infra/queue/rabbitmq/amqp-lib.spec.d.ts +0 -0
  121. package/dist/clean-arch/infra/queue/rabbitmq/amqp-lib.spec.js +0 -0
  122. package/dist/clean-arch/infra/queue/worker.d.ts +0 -0
  123. package/dist/clean-arch/infra/queue/worker.js +4 -3
  124. package/dist/clean-arch/infra/validations/validation-http.d.ts +9 -0
  125. package/dist/clean-arch/infra/validations/validation-http.js +2 -0
  126. package/dist/clean-arch/infra/validations/zod/schemas/common-validation.d.ts +30 -0
  127. package/dist/clean-arch/infra/validations/zod/schemas/common-validation.js +19 -0
  128. package/dist/clean-arch/infra/validations/zod/validation-zod-error.d.ts +10 -0
  129. package/dist/clean-arch/infra/validations/zod/validation-zod-error.js +70 -0
  130. package/dist/clean-arch/infra/validations/zod/validation-zod.d.ts +15 -0
  131. package/dist/clean-arch/infra/validations/zod/validation-zod.js +55 -0
  132. package/dist/clean-arch/infra/validations/zod/validation-zod.spec.d.ts +1 -0
  133. package/dist/clean-arch/infra/validations/zod/validation-zod.spec.js +436 -0
  134. package/dist/clean-arch/shared/pagination/dto-response.d.ts +0 -0
  135. package/dist/clean-arch/shared/pagination/dto-response.js +0 -0
  136. package/dist/clean-arch/shared/pagination/get-take-and-skip.d.ts +0 -0
  137. package/dist/clean-arch/shared/pagination/get-take-and-skip.js +0 -0
  138. package/dist/clean-arch/shared/pagination/pagination.d.ts +0 -0
  139. package/dist/clean-arch/shared/pagination/pagination.js +0 -0
  140. package/dist/frameworks/express/api-gateway/mapping-model.d.ts +0 -0
  141. package/dist/frameworks/express/api-gateway/mapping-model.js +0 -0
  142. package/dist/frameworks/express/api-gateway/mapping-model.spec.d.ts +0 -0
  143. package/dist/frameworks/express/api-gateway/mapping-model.spec.js +0 -0
  144. package/dist/frameworks/express/api-gateway/middleware-express.d.ts +0 -0
  145. package/dist/frameworks/express/api-gateway/middleware-express.js +0 -0
  146. package/dist/frameworks/express/authorizations/authorization-express.d.ts +2 -2
  147. package/dist/frameworks/express/authorizations/authorization-express.js +0 -0
  148. package/dist/frameworks/express/authorizations/authorization-express.spec.d.ts +0 -0
  149. package/dist/frameworks/express/authorizations/authorization-express.spec.js +0 -0
  150. package/dist/frameworks/express/authorizations/middleware-express.d.ts +0 -0
  151. package/dist/frameworks/express/authorizations/middleware-express.js +0 -0
  152. package/dist/frameworks/express/compression/middleware-express.d.ts +0 -0
  153. package/dist/frameworks/express/compression/middleware-express.js +0 -0
  154. package/dist/frameworks/express/types.d.ts +0 -0
  155. package/dist/frameworks/express/types.js +0 -0
  156. package/dist/frameworks/nest/authorizations/authorization-nest.d.ts +2 -2
  157. package/dist/frameworks/nest/authorizations/authorization-nest.js +0 -0
  158. package/dist/frameworks/nest/authorizations/guard-nest.d.ts +0 -0
  159. package/dist/frameworks/nest/authorizations/guard-nest.js +1 -0
  160. package/dist/frameworks/nest/authorizations/not-allowed-nest.d.ts +2 -2
  161. package/dist/frameworks/nest/authorizations/not-allowed-nest.js +1 -0
  162. package/dist/frameworks/nest/errors/orbit-error.d.ts +0 -0
  163. package/dist/frameworks/nest/errors/orbit-error.js +0 -0
  164. package/dist/frameworks/nest/exception-filters/orbit-exception-filter.d.ts +0 -0
  165. package/dist/frameworks/nest/exception-filters/orbit-exception-filter.js +0 -0
  166. package/dist/index.d.ts +0 -0
  167. package/dist/index.js +0 -0
  168. package/dist/infra/authorizations/auth-matcher.d.ts +0 -0
  169. package/dist/infra/authorizations/auth-matcher.js +0 -0
  170. package/dist/infra/authorizations/auth-matcher.spec.d.ts +0 -0
  171. package/dist/infra/authorizations/auth-matcher.spec.js +0 -0
  172. package/dist/infra/authorizations/validator/api/api-validator.d.ts +2 -2
  173. package/dist/infra/authorizations/validator/api/api-validator.js +1 -0
  174. package/dist/infra/authorizations/validator/api/factories/unauthorized-response-factory.d.ts +2 -2
  175. package/dist/infra/authorizations/validator/api/factories/unauthorized-response-factory.js +0 -0
  176. package/dist/infra/authorizations/validator/api/factories/unauthorized-response-factory.spec.d.ts +0 -0
  177. package/dist/infra/authorizations/validator/api/factories/unauthorized-response-factory.spec.js +0 -0
  178. package/dist/infra/authorizations/validator/auth-validator.d.ts +0 -0
  179. package/dist/infra/authorizations/validator/auth-validator.js +2 -0
  180. package/dist/infra/authorizations/validator/auth-validator.spec.d.ts +0 -0
  181. package/dist/infra/authorizations/validator/auth-validator.spec.js +0 -0
  182. package/dist/infra/http/api-gateway/mapping-model.d.ts +0 -0
  183. package/dist/infra/http/api-gateway/mapping-model.js +1 -0
  184. package/dist/infra/http/api-gateway/mapping-model.spec.d.ts +0 -0
  185. package/dist/infra/http/api-gateway/mapping-model.spec.js +0 -0
  186. package/dist/infra/http/compression/filter.d.ts +0 -0
  187. package/dist/infra/http/compression/filter.js +0 -0
  188. package/dist/infra/http/errors/api-common-error.d.ts +18 -19
  189. package/dist/infra/http/errors/api-common-error.js +0 -0
  190. package/dist/infra/http/errors/api-error.d.ts +2 -2
  191. package/dist/infra/http/errors/api-error.js +2 -0
  192. package/dist/infra/http/errors/unauthorized-response.d.ts +1 -1
  193. package/dist/infra/http/errors/unauthorized-response.js +0 -0
  194. package/dist/static/address-types.d.ts +0 -0
  195. package/dist/static/address-types.js +0 -0
  196. package/dist/static/address-types.json +0 -0
  197. package/dist/static/cities.d.ts +0 -0
  198. package/dist/static/cities.js +0 -0
  199. package/dist/static/cities.json +0 -0
  200. package/dist/static/countries.d.ts +0 -0
  201. package/dist/static/countries.js +0 -0
  202. package/dist/static/countries.json +0 -0
  203. package/dist/static/ddd.d.ts +0 -0
  204. package/dist/static/ddd.js +0 -0
  205. package/dist/static/ddd.json +0 -0
  206. package/dist/static/states.d.ts +0 -0
  207. package/dist/static/states.js +0 -0
  208. package/dist/static/states.json +0 -0
  209. package/package.json +1 -1
package/README.md CHANGED
File without changes
File without changes
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Cache = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  const env_1 = require("../../infra/environment/env");
6
+ const logger_1 = tslib_1.__importDefault(require("../logger"));
5
7
  class Cache {
8
+ DEFAULT_EXPIRATION_SECONDS = env_1.env.DEFAULT_CACHE_EXPIRATION;
9
+ options;
6
10
  constructor(options) {
7
- this.DEFAULT_EXPIRATION_SECONDS = env_1.env.DEFAULT_CACHE_EXPIRATION;
8
11
  if (options)
9
12
  this.setOptions(options);
10
13
  }
@@ -24,10 +27,7 @@ class Cache {
24
27
  }
25
28
  return;
26
29
  }
27
- if (process.env.NODE_ENV !== 'test') {
28
- console.log('\n');
29
- console.log('💾 Cache Connected');
30
- }
30
+ logger_1.default.debug()?.info('💾 Cache Connected');
31
31
  }
32
32
  async get(keyCache, options) {
33
33
  try {
@@ -100,10 +100,7 @@ class Cache {
100
100
  }
101
101
  }
102
102
  async close(options) {
103
- if (process.env.NODE_ENV !== 'test') {
104
- console.log('\n');
105
- console.log('💾 Cache closed');
106
- }
103
+ logger_1.default.debug()?.info('💾 Cache closed');
107
104
  try {
108
105
  return await this.client.close();
109
106
  }
File without changes
File without changes
@@ -0,0 +1,11 @@
1
+ export declare enum LOG_LEVEL {
2
+ debug = "DEBUG",
3
+ info = "INFO"
4
+ }
5
+ export declare class Logger {
6
+ debug(): this | undefined;
7
+ info(info: any): void;
8
+ error(error: any): void;
9
+ }
10
+ declare const logger: Logger;
11
+ export default logger;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Logger = exports.LOG_LEVEL = void 0;
4
+ const env_1 = require("../../infra/environment/env");
5
+ var LOG_LEVEL;
6
+ (function (LOG_LEVEL) {
7
+ LOG_LEVEL["debug"] = "DEBUG";
8
+ LOG_LEVEL["info"] = "INFO";
9
+ })(LOG_LEVEL || (exports.LOG_LEVEL = LOG_LEVEL = {}));
10
+ class Logger {
11
+ debug() {
12
+ if (env_1.env.LOG_LEVEL === LOG_LEVEL.debug)
13
+ return this;
14
+ return undefined;
15
+ }
16
+ info(info) {
17
+ console.info(info);
18
+ }
19
+ error(error) {
20
+ console.error(error);
21
+ }
22
+ }
23
+ exports.Logger = Logger;
24
+ const logger = new Logger();
25
+ exports.default = logger;
File without changes
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class Handler {
4
- constructor() {
5
- this.simultaneity = 1;
6
- }
4
+ simultaneity = 1;
7
5
  getSimultaneity() {
8
6
  return this.simultaneity;
9
7
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Entity = void 0;
4
4
  const unique_entity_id_1 = require("./unique-entity-id");
5
5
  class Entity {
6
+ _id;
7
+ props;
6
8
  get id() {
7
9
  return this._id;
8
10
  }
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UniqueEntityId = void 0;
4
4
  const node_crypto_1 = require("node:crypto");
5
5
  class UniqueEntityId {
6
+ value;
6
7
  constructor(value) {
7
8
  this.value = value ?? (0, node_crypto_1.randomUUID)();
8
9
  }
File without changes
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ValueObject = void 0;
4
4
  class ValueObject {
5
+ props;
5
6
  constructor(props) {
6
7
  this.props = props;
7
8
  }
File without changes
@@ -2,6 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WatchedList = void 0;
4
4
  class WatchedList {
5
+ currentItems;
6
+ initial;
7
+ new;
8
+ removed;
9
+ updated;
5
10
  constructor(initialItems) {
6
11
  this.currentItems = initialItems || [];
7
12
  this.initial = initialItems || [];
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class ApplicationError extends Error {
4
+ code;
4
5
  constructor(message, code = 400) {
5
6
  super(message);
6
7
  this.code = code;
File without changes
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class DomainError extends Error {
4
+ code;
4
5
  constructor(message, code = 400) {
5
6
  super(message);
6
7
  this.code = code;
File without changes
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class HttpError extends Error {
4
+ code;
5
+ response;
4
6
  constructor(response) {
5
7
  super(response?.body?.message || 'Integration error');
6
8
  this.code = response?.code || 400;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class ValidationError extends Error {
4
+ code;
5
+ errors;
4
6
  constructor(errors) {
5
7
  super('Validation Error');
6
8
  this.code = 400;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -7,6 +7,11 @@ var PasswordAlgorithm;
7
7
  PasswordAlgorithm["PBKDF2"] = "pbkdf2";
8
8
  })(PasswordAlgorithm || (exports.PasswordAlgorithm = PasswordAlgorithm = {}));
9
9
  class Password {
10
+ value;
11
+ salt;
12
+ notEncryptedValue;
13
+ algorithm;
14
+ isTemporary;
10
15
  static isValid(password) {
11
16
  return password.length >= 8;
12
17
  }
@@ -5,6 +5,9 @@ const node_crypto_1 = require("node:crypto");
5
5
  const invalid_password_length_error_1 = tslib_1.__importDefault(require("../errors/invalid-password-length-error"));
6
6
  const password_1 = tslib_1.__importStar(require("./password"));
7
7
  class PBKDF2Password extends password_1.default {
8
+ value;
9
+ salt;
10
+ notEncryptedValue;
8
11
  constructor(value, salt, notEncryptedValue) {
9
12
  super({ algorithm: password_1.PasswordAlgorithm.PBKDF2, isTemporary: false });
10
13
  this.value = value;
@@ -5,6 +5,9 @@ const node_crypto_1 = require("node:crypto");
5
5
  const invalid_password_length_error_1 = tslib_1.__importDefault(require("../errors/invalid-password-length-error"));
6
6
  const password_1 = tslib_1.__importStar(require("./password"));
7
7
  class SHA1Password extends password_1.default {
8
+ value;
9
+ salt;
10
+ notEncryptedValue;
8
11
  constructor(value, salt, notEncryptedValue) {
9
12
  super({ algorithm: password_1.PasswordAlgorithm.SHA1, isTemporary: true });
10
13
  this.value = value;
@@ -6,6 +6,9 @@ const cors_1 = tslib_1.__importDefault(require("cors"));
6
6
  const express_1 = tslib_1.__importDefault(require("express"));
7
7
  const middleware_express_1 = require("../../../frameworks/express/api-gateway/middleware-express");
8
8
  class ExpressAdapter {
9
+ envs;
10
+ instance;
11
+ server;
9
12
  constructor(envs) {
10
13
  this.envs = envs;
11
14
  this.instance = (0, express_1.default)();
@@ -5,6 +5,8 @@ const cors_1 = tslib_1.__importDefault(require("@fastify/cors"));
5
5
  const fastify_1 = tslib_1.__importDefault(require("fastify"));
6
6
  const qs_1 = tslib_1.__importDefault(require("qs"));
7
7
  class FastifyAdapter {
8
+ envs;
9
+ instance;
8
10
  constructor(envs) {
9
11
  this.envs = envs;
10
12
  this.instance = (0, fastify_1.default)({
@@ -1,7 +1,7 @@
1
1
  import { AuthParams } from '../../../infra/authorizations/auth-matcher';
2
2
  import { APIAuthValidator } from '../../../infra/authorizations/validator/api/api-validator';
3
3
  import AuthValidator from '../../../infra/authorizations/validator/auth-validator';
4
- import { UnauthorizedResponse } from '../../../infra/http/errors/unauthorized-response';
4
+ import { ErrorResponse } from '../../../infra/http/errors/unauthorized-response';
5
5
  import { Request, Response } from '../http/controller';
6
6
  type AuthorizationMetaData = {
7
7
  handle(input: Request): Promise<Response>;
@@ -10,7 +10,7 @@ type AuthorizationMetaData = {
10
10
  export default class Authorization extends APIAuthValidator {
11
11
  controller: AuthorizationMetaData;
12
12
  static create(query: AuthParams, controllerMetaData: AuthorizationMetaData): Promise<AuthValidator>;
13
- protected unauthorize(response: UnauthorizedResponse): void;
13
+ protected unauthorize(response: ErrorResponse): void;
14
14
  protected getRequestId(): string;
15
15
  protected handleAuthorized(): Promise<Response>;
16
16
  protected getAuthorizationsHeader(): string;
@@ -1,5 +1,5 @@
1
1
  import { ApiError } from '../../../infra/http/errors/api-error';
2
- import { UnauthorizedResponse } from '../../../infra/http/errors/unauthorized-response';
2
+ import { ErrorResponse } from '../../../infra/http/errors/unauthorized-response';
3
3
  export default class NotAllowedError extends ApiError {
4
- constructor(input: UnauthorizedResponse);
4
+ constructor(input: ErrorResponse);
5
5
  }
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const node_cache_1 = tslib_1.__importDefault(require("node-cache"));
6
6
  const client_1 = require("../../../application/cache/client");
7
7
  class NodeCache extends client_1.CacheClient {
8
+ client;
8
9
  async start() {
9
10
  this.client = new node_cache_1.default();
10
11
  }
File without changes
@@ -5,6 +5,8 @@ const tslib_1 = require("tslib");
5
5
  const ioredis_1 = tslib_1.__importDefault(require("ioredis"));
6
6
  const client_1 = require("../../../application/cache/client");
7
7
  class Redis extends client_1.CacheClient {
8
+ connection;
9
+ client;
8
10
  constructor(connection) {
9
11
  super();
10
12
  this.connection = connection;
@@ -1,7 +1,9 @@
1
1
  import 'dotenv/config';
2
2
  import { ENVIRONMENT_TYPES } from './environment';
3
+ import { LOG_LEVEL } from '../../application/logger';
3
4
  export declare const env: {
4
5
  NODE_ENV: "test" | "production";
5
6
  CURRENT_ENVIRONMENT: ENVIRONMENT_TYPES;
7
+ LOG_LEVEL: LOG_LEVEL;
6
8
  DEFAULT_CACHE_EXPIRATION: number;
7
9
  };
@@ -4,6 +4,7 @@ exports.env = void 0;
4
4
  require("dotenv/config");
5
5
  const zod_1 = require("zod");
6
6
  const environment_1 = require("./environment");
7
+ const logger_1 = require("../../application/logger");
7
8
  const envSchema = zod_1.z.object({
8
9
  NODE_ENV: zod_1.z.enum(['test', 'production']).default('production'),
9
10
  CURRENT_ENVIRONMENT: zod_1.z
@@ -15,6 +16,7 @@ const envSchema = zod_1.z.object({
15
16
  environment_1.ENVIRONMENT_TYPES.PRODUCTION,
16
17
  ])
17
18
  .default(environment_1.ENVIRONMENT_TYPES.LOCAL),
19
+ LOG_LEVEL: zod_1.z.enum([logger_1.LOG_LEVEL.debug, logger_1.LOG_LEVEL.info]).default(logger_1.LOG_LEVEL.info),
18
20
  DEFAULT_CACHE_EXPIRATION: zod_1.z.number().default(360),
19
21
  });
20
22
  const _env = envSchema.safeParse(process.env);
File without changes
File without changes
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class InfraError extends Error {
4
+ code;
4
5
  constructor(message, code = 400) {
5
6
  super(message);
6
7
  this.code = code;
File without changes
File without changes
File without changes
File without changes
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class Health {
4
+ checkDB;
4
5
  constructor(checkDB) {
5
6
  this.checkDB = checkDB;
6
7
  }
File without changes
File without changes
@@ -6,15 +6,12 @@ const axios_1 = tslib_1.__importDefault(require("axios"));
6
6
  const orbit_http_client_1 = require("../../../application/orbit-http-client/orbit-http-client");
7
7
  const http_error_1 = tslib_1.__importDefault(require("../../../domain/errors/http-error"));
8
8
  class OrbitAxiosClient extends orbit_http_client_1.OrbitHTTPClient {
9
- constructor() {
10
- super(...arguments);
11
- this.httpClient = axios_1.default.create({
12
- baseURL: this.getBaseUrl(),
13
- headers: {
14
- target: this.getTarget(),
15
- },
16
- });
17
- }
9
+ httpClient = axios_1.default.create({
10
+ baseURL: this.getBaseUrl(),
11
+ headers: {
12
+ target: this.getTarget(),
13
+ },
14
+ });
18
15
  async post({ endpoint, body, config, }) {
19
16
  try {
20
17
  const response = await this.httpClient.post(endpoint, body, config);
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OrbitDiscordNotificationClient = void 0;
4
4
  const discord_js_1 = require("discord.js");
5
5
  class OrbitDiscordNotificationClient {
6
+ discord;
6
7
  constructor() {
7
8
  this.discord = new discord_js_1.WebhookClient({
8
9
  id: this.getId(),
File without changes
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class CreateConsumers {
4
+ queue;
4
5
  constructor(queue) {
5
6
  this.queue = queue;
6
7
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class QueueInMemory {
4
+ queues;
4
5
  constructor() {
5
6
  this.queues = [];
6
7
  }
File without changes
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class QueueController {
4
+ queue;
4
5
  constructor(queue) {
5
6
  this.queue = queue;
6
7
  }