@seidor-cloud-produtos/orbit-backend-lib 0.0.85 → 0.0.86

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 (183) hide show
  1. package/dist/clean-arch/application/cache/cache.d.ts +10 -10
  2. package/dist/clean-arch/application/cache/cache.js +39 -39
  3. package/dist/clean-arch/application/cache/client.d.ts +8 -8
  4. package/dist/clean-arch/application/cache/client.js +9 -9
  5. package/dist/clean-arch/application/orbit-http-client/orbit-http-client-dto.d.ts +18 -18
  6. package/dist/clean-arch/application/orbit-http-client/orbit-http-client-dto.js +2 -2
  7. package/dist/clean-arch/application/orbit-http-client/orbit-http-client.d.ts +4 -4
  8. package/dist/clean-arch/application/orbit-http-client/orbit-http-client.js +4 -3
  9. package/dist/clean-arch/application/oribit-notification-client/orbit-notification-client.d.ts +1 -5
  10. package/dist/clean-arch/application/oribit-notification-client/orbit-notification-client.js +4 -3
  11. package/dist/clean-arch/application/queue/handler.d.ts +3 -3
  12. package/dist/clean-arch/application/queue/handler.js +8 -8
  13. package/dist/clean-arch/application/queue/messages-in-memory.d.ts +3 -3
  14. package/dist/clean-arch/application/queue/messages-in-memory.js +2 -2
  15. package/dist/clean-arch/application/queue/queue-connection.d.ts +3 -3
  16. package/dist/clean-arch/application/queue/queue-connection.js +2 -2
  17. package/dist/clean-arch/application/queue/queue.d.ts +2 -6
  18. package/dist/clean-arch/application/queue/queue.js +2 -2
  19. package/dist/clean-arch/domain/entities/aggregate-root.d.ts +5 -7
  20. package/dist/clean-arch/domain/entities/aggregate-root.js +15 -15
  21. package/dist/clean-arch/domain/entities/common-dto.d.ts +8 -8
  22. package/dist/clean-arch/domain/entities/common-dto.js +2 -2
  23. package/dist/clean-arch/domain/entities/entity.d.ts +6 -6
  24. package/dist/clean-arch/domain/entities/entity.js +20 -20
  25. package/dist/clean-arch/domain/entities/unique-entity-id.d.ts +5 -5
  26. package/dist/clean-arch/domain/entities/unique-entity-id.js +15 -15
  27. package/dist/clean-arch/domain/entities/value-object.d.ts +2 -2
  28. package/dist/clean-arch/domain/entities/value-object.js +5 -5
  29. package/dist/clean-arch/domain/entities/watched-list.d.ts +23 -23
  30. package/dist/clean-arch/domain/entities/watched-list.js +84 -93
  31. package/dist/clean-arch/domain/entities/watched-list.spec.js +45 -45
  32. package/dist/clean-arch/domain/errors/application-error.d.ts +2 -2
  33. package/dist/clean-arch/domain/errors/application-error.js +6 -6
  34. package/dist/clean-arch/domain/errors/domain-error.d.ts +2 -2
  35. package/dist/clean-arch/domain/errors/domain-error.js +6 -6
  36. package/dist/clean-arch/domain/errors/http-error.d.ts +6 -6
  37. package/dist/clean-arch/domain/errors/http-error.js +7 -7
  38. package/dist/clean-arch/domain/errors/invalid-password-algorithm-error.d.ts +1 -1
  39. package/dist/clean-arch/domain/errors/invalid-password-algorithm-error.js +8 -8
  40. package/dist/clean-arch/domain/errors/invalid-password-length-error.d.ts +1 -1
  41. package/dist/clean-arch/domain/errors/invalid-password-length-error.js +8 -11
  42. package/dist/clean-arch/domain/errors/validation-error.d.ts +5 -5
  43. package/dist/clean-arch/domain/errors/validation-error.js +8 -8
  44. package/dist/clean-arch/domain/events/domain-event.d.ts +2 -2
  45. package/dist/clean-arch/domain/events/domain-event.js +2 -2
  46. package/dist/clean-arch/domain/factories/create-password-factory.d.ts +4 -6
  47. package/dist/clean-arch/domain/factories/create-password-factory.js +18 -28
  48. package/dist/clean-arch/domain/factories/random-password-temporary-factory.d.ts +6 -6
  49. package/dist/clean-arch/domain/factories/random-password-temporary-factory.js +46 -46
  50. package/dist/clean-arch/domain/interfaces/address-type.d.ts +4 -0
  51. package/dist/clean-arch/domain/interfaces/address-type.js +2 -0
  52. package/dist/clean-arch/domain/interfaces/city.d.ts +8 -0
  53. package/dist/clean-arch/domain/interfaces/city.js +2 -0
  54. package/dist/clean-arch/domain/interfaces/country.d.ts +4 -0
  55. package/dist/clean-arch/domain/interfaces/country.js +2 -0
  56. package/dist/clean-arch/domain/interfaces/ddd.d.ts +5 -0
  57. package/dist/clean-arch/domain/interfaces/ddd.js +2 -0
  58. package/dist/clean-arch/domain/interfaces/state.d.ts +5 -0
  59. package/dist/clean-arch/domain/interfaces/state.js +2 -0
  60. package/dist/clean-arch/domain/types/optional.js +2 -2
  61. package/dist/clean-arch/domain/value-objects/password.d.ts +12 -12
  62. package/dist/clean-arch/domain/value-objects/password.js +11 -11
  63. package/dist/clean-arch/domain/value-objects/pbkdf2-password.d.ts +7 -7
  64. package/dist/clean-arch/domain/value-objects/pbkdf2-password.js +26 -43
  65. package/dist/clean-arch/domain/value-objects/sha1-password.d.ts +7 -7
  66. package/dist/clean-arch/domain/value-objects/sha1-password.js +25 -31
  67. package/dist/clean-arch/infra/adapters/express-adapter.d.ts +7 -7
  68. package/dist/clean-arch/infra/adapters/express-adapter.js +45 -46
  69. package/dist/clean-arch/infra/adapters/fastify-adapter.d.ts +6 -6
  70. package/dist/clean-arch/infra/adapters/fastify-adapter.js +48 -47
  71. package/dist/clean-arch/infra/authorizations/authorization.d.ts +9 -12
  72. package/dist/clean-arch/infra/authorizations/authorization.js +24 -24
  73. package/dist/clean-arch/infra/authorizations/authorizer.d.ts +5 -9
  74. package/dist/clean-arch/infra/authorizations/authorizer.js +17 -17
  75. package/dist/clean-arch/infra/authorizations/authorizer.spec.js +132 -151
  76. package/dist/clean-arch/infra/authorizations/not-allowed.d.ts +1 -1
  77. package/dist/clean-arch/infra/authorizations/not-allowed.js +6 -6
  78. package/dist/clean-arch/infra/cache/clients/node-cache.d.ts +9 -9
  79. package/dist/clean-arch/infra/cache/clients/node-cache.js +41 -38
  80. package/dist/clean-arch/infra/cache/clients/redis.d.ts +11 -11
  81. package/dist/clean-arch/infra/cache/clients/redis.js +56 -55
  82. package/dist/clean-arch/infra/environment/env.d.ts +3 -3
  83. package/dist/clean-arch/infra/environment/env.js +15 -15
  84. package/dist/clean-arch/infra/environment/environment.d.ts +5 -5
  85. package/dist/clean-arch/infra/environment/environment.js +7 -7
  86. package/dist/clean-arch/infra/errors/infra-error.d.ts +2 -2
  87. package/dist/clean-arch/infra/errors/infra-error.js +6 -6
  88. package/dist/clean-arch/infra/http/controller.d.ts +12 -12
  89. package/dist/clean-arch/infra/http/controller.js +70 -80
  90. package/dist/clean-arch/infra/http/handle-bool-filter.js +6 -6
  91. package/dist/clean-arch/infra/http/handle-is-active-query.js +6 -6
  92. package/dist/clean-arch/infra/http/handle-sort-param-query.d.ts +1 -3
  93. package/dist/clean-arch/infra/http/handle-sort-param-query.js +12 -12
  94. package/dist/clean-arch/infra/http/handle-user-headers.d.ts +6 -6
  95. package/dist/clean-arch/infra/http/handle-user-headers.js +8 -8
  96. package/dist/clean-arch/infra/http/health-connections.d.ts +6 -6
  97. package/dist/clean-arch/infra/http/health-connections.js +9 -9
  98. package/dist/clean-arch/infra/http/http.d.ts +3 -3
  99. package/dist/clean-arch/infra/http/http.js +2 -2
  100. package/dist/clean-arch/infra/orbit-http-client/orbit-axios-client/orbit-axios-client.d.ts +6 -10
  101. package/dist/clean-arch/infra/orbit-http-client/orbit-axios-client/orbit-axios-client.js +48 -48
  102. package/dist/clean-arch/infra/orbit-notification-client/discord-client.d.ts +7 -13
  103. package/dist/clean-arch/infra/orbit-notification-client/discord-client.js +26 -25
  104. package/dist/clean-arch/infra/queue/create-consumers.d.ts +6 -6
  105. package/dist/clean-arch/infra/queue/create-consumers.js +11 -11
  106. package/dist/clean-arch/infra/queue/in-memory/in-memory-queue.d.ts +6 -6
  107. package/dist/clean-arch/infra/queue/in-memory/in-memory-queue.js +14 -14
  108. package/dist/clean-arch/infra/queue/queue-controller.d.ts +6 -6
  109. package/dist/clean-arch/infra/queue/queue-controller.js +9 -9
  110. package/dist/clean-arch/infra/queue/rabbitmq/amqp-lib.d.ts +20 -24
  111. package/dist/clean-arch/infra/queue/rabbitmq/amqp-lib.js +140 -150
  112. package/dist/clean-arch/infra/queue/rabbitmq/amqp-lib.spec.js +33 -33
  113. package/dist/clean-arch/infra/queue/worker.d.ts +6 -6
  114. package/dist/clean-arch/infra/queue/worker.js +30 -33
  115. package/dist/clean-arch/shared/pagination/dto-response.d.ts +6 -6
  116. package/dist/clean-arch/shared/pagination/dto-response.js +2 -2
  117. package/dist/clean-arch/shared/pagination/get-take-and-skip.d.ts +3 -6
  118. package/dist/clean-arch/shared/pagination/get-take-and-skip.js +5 -5
  119. package/dist/clean-arch/shared/pagination/pagination.d.ts +3 -3
  120. package/dist/clean-arch/shared/pagination/pagination.js +2 -2
  121. package/dist/frameworks/express/api-gateway/mapping-model.d.ts +12 -12
  122. package/dist/frameworks/express/api-gateway/mapping-model.js +47 -47
  123. package/dist/frameworks/express/api-gateway/mapping-model.spec.js +127 -141
  124. package/dist/frameworks/express/api-gateway/middleware-express.d.ts +1 -5
  125. package/dist/frameworks/express/api-gateway/middleware-express.js +4 -8
  126. package/dist/frameworks/express/authorizations/authorization-express.d.ts +8 -13
  127. package/dist/frameworks/express/authorizations/authorization-express.js +29 -29
  128. package/dist/frameworks/express/authorizations/authorization-express.spec.js +72 -89
  129. package/dist/frameworks/express/authorizations/middleware-express.d.ts +1 -3
  130. package/dist/frameworks/express/authorizations/middleware-express.js +13 -15
  131. package/dist/frameworks/express/compression/middleware-express.d.ts +1 -7
  132. package/dist/frameworks/express/compression/middleware-express.js +6 -6
  133. package/dist/frameworks/express/types.d.ts +3 -3
  134. package/dist/frameworks/express/types.js +2 -2
  135. package/dist/frameworks/nest/authorizations/authorization-nest.d.ts +3 -8
  136. package/dist/frameworks/nest/authorizations/authorization-nest.js +15 -17
  137. package/dist/frameworks/nest/authorizations/guard-nest.d.ts +3 -3
  138. package/dist/frameworks/nest/authorizations/guard-nest.js +22 -25
  139. package/dist/frameworks/nest/authorizations/not-allowed-nest.d.ts +4 -4
  140. package/dist/frameworks/nest/authorizations/not-allowed-nest.js +13 -13
  141. package/dist/frameworks/nest/errors/orbit-error.d.ts +2 -1
  142. package/dist/frameworks/nest/errors/orbit-error.js +5 -4
  143. package/dist/frameworks/nest/exception-filters/orbit-exception-filter.d.ts +1 -1
  144. package/dist/frameworks/nest/exception-filters/orbit-exception-filter.js +14 -15
  145. package/dist/index.js +4 -4
  146. package/dist/infra/authorizations/auth-matcher.d.ts +7 -10
  147. package/dist/infra/authorizations/auth-matcher.js +47 -43
  148. package/dist/infra/authorizations/auth-matcher.spec.js +702 -727
  149. package/dist/infra/authorizations/validator/api/api-validator.d.ts +11 -11
  150. package/dist/infra/authorizations/validator/api/api-validator.js +29 -34
  151. package/dist/infra/authorizations/validator/api/factories/unauthorized-response-factory.d.ts +1 -4
  152. package/dist/infra/authorizations/validator/api/factories/unauthorized-response-factory.js +37 -38
  153. package/dist/infra/authorizations/validator/api/factories/unauthorized-response-factory.spec.js +109 -123
  154. package/dist/infra/authorizations/validator/auth-validator.d.ts +10 -10
  155. package/dist/infra/authorizations/validator/auth-validator.js +24 -27
  156. package/dist/infra/authorizations/validator/auth-validator.spec.js +78 -87
  157. package/dist/infra/http/api-gateway/mapping-model.d.ts +21 -27
  158. package/dist/infra/http/api-gateway/mapping-model.js +35 -38
  159. package/dist/infra/http/api-gateway/mapping-model.spec.js +129 -129
  160. package/dist/infra/http/compression/filter.d.ts +1 -3
  161. package/dist/infra/http/compression/filter.js +4 -4
  162. package/dist/infra/http/errors/api-common-error.d.ts +22 -22
  163. package/dist/infra/http/errors/api-common-error.js +2 -2
  164. package/dist/infra/http/errors/api-error.d.ts +3 -3
  165. package/dist/infra/http/errors/api-error.js +7 -7
  166. package/dist/infra/http/errors/unauthorized-response.d.ts +3 -3
  167. package/dist/infra/http/errors/unauthorized-response.js +2 -2
  168. package/dist/static/address-types.d.ts +2 -0
  169. package/dist/static/address-types.js +8 -0
  170. package/dist/static/address-types.json +714 -0
  171. package/dist/static/cities.d.ts +2 -0
  172. package/dist/static/cities.js +6 -0
  173. package/dist/static/cities.json +44562 -0
  174. package/dist/static/countries.d.ts +2 -0
  175. package/dist/static/countries.js +6 -0
  176. package/dist/static/countries.json +1002 -0
  177. package/dist/static/ddd.d.ts +2 -0
  178. package/dist/static/ddd.js +6 -0
  179. package/dist/static/ddd.json +28012 -0
  180. package/dist/static/states.d.ts +2 -0
  181. package/dist/static/states.js +6 -0
  182. package/dist/static/states.json +137 -0
  183. package/package.json +2 -2
@@ -1,13 +1,13 @@
1
1
  import { CacheClient } from './client';
2
2
  export declare abstract class Cache {
3
- protected abstract client: CacheClient;
4
- protected DEFAULT_EXPIRATION_SECONDS: number;
5
- start(): Promise<void>;
6
- get(keyCache: string): Promise<any>;
7
- set(keyCache: string, data: any, expiration?: number): Promise<void>;
8
- del(keyCache: string): Promise<void>;
9
- getKeys(pattern?: string): Promise<string[] | null>;
10
- delBatch(patterns: string[]): Promise<void>;
11
- isRunning(): Promise<any>;
12
- close(): Promise<void>;
3
+ protected abstract client: CacheClient;
4
+ protected DEFAULT_EXPIRATION_SECONDS: number;
5
+ start(): Promise<void>;
6
+ get(keyCache: string): Promise<any>;
7
+ set(keyCache: string, data: any, expiration?: number): Promise<void>;
8
+ del(keyCache: string): Promise<void>;
9
+ getKeys(pattern?: string): Promise<string[] | null>;
10
+ delBatch(patterns: string[]): Promise<void>;
11
+ isRunning(): Promise<any>;
12
+ close(): Promise<void>;
13
13
  }
@@ -1,43 +1,43 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Cache = void 0;
4
- const env_1 = require('../../infra/environment/env');
4
+ const env_1 = require("../../infra/environment/env");
5
5
  class Cache {
6
- constructor() {
7
- this.DEFAULT_EXPIRATION_SECONDS = env_1.env.DEFAULT_CACHE_EXPIRATION;
8
- }
9
- async start() {
10
- await this.client.start();
11
- if (process.env.NODE_ENV !== 'test') {
12
- console.log('\n');
13
- console.log('💾 Cache Connected');
14
- }
15
- }
16
- async get(keyCache) {
17
- const dataFromCache = await this.client.get(keyCache);
18
- return dataFromCache ? dataFromCache : null;
19
- }
20
- async set(keyCache, data, expiration = this.DEFAULT_EXPIRATION_SECONDS) {
21
- return await this.client.set(keyCache, JSON.stringify(data), expiration);
22
- }
23
- async del(keyCache) {
24
- return await this.client.del(keyCache);
25
- }
26
- async getKeys(pattern) {
27
- return await this.client.getKeys(pattern);
28
- }
29
- async delBatch(patterns) {
30
- return await this.client.delBatch(patterns);
31
- }
32
- async isRunning() {
33
- return await this.client.isRunning();
34
- }
35
- async close() {
36
- if (process.env.NODE_ENV !== 'test') {
37
- console.log('\n');
38
- console.log('💾 Cache closed');
39
- }
40
- return await this.client.close();
41
- }
6
+ constructor() {
7
+ this.DEFAULT_EXPIRATION_SECONDS = env_1.env.DEFAULT_CACHE_EXPIRATION;
8
+ }
9
+ async start() {
10
+ await this.client.start();
11
+ if (process.env.NODE_ENV !== 'test') {
12
+ console.log('\n');
13
+ console.log('💾 Cache Connected');
14
+ }
15
+ }
16
+ async get(keyCache) {
17
+ const dataFromCache = await this.client.get(keyCache);
18
+ return dataFromCache ? dataFromCache : null;
19
+ }
20
+ async set(keyCache, data, expiration = this.DEFAULT_EXPIRATION_SECONDS) {
21
+ return await this.client.set(keyCache, JSON.stringify(data), expiration);
22
+ }
23
+ async del(keyCache) {
24
+ return await this.client.del(keyCache);
25
+ }
26
+ async getKeys(pattern) {
27
+ return await this.client.getKeys(pattern);
28
+ }
29
+ async delBatch(patterns) {
30
+ return await this.client.delBatch(patterns);
31
+ }
32
+ async isRunning() {
33
+ return await this.client.isRunning();
34
+ }
35
+ async close() {
36
+ if (process.env.NODE_ENV !== 'test') {
37
+ console.log('\n');
38
+ console.log('💾 Cache closed');
39
+ }
40
+ return await this.client.close();
41
+ }
42
42
  }
43
43
  exports.Cache = Cache;
@@ -1,10 +1,10 @@
1
1
  export declare abstract class CacheClient {
2
- abstract start(): Promise<void>;
3
- abstract close(): Promise<void>;
4
- abstract get(keyCache: string): Promise<any>;
5
- abstract set(keyCache: string, data: any, expiration: number): Promise<void>;
6
- abstract del(keyCache: string): Promise<void>;
7
- abstract delBatch(keyCache: string[]): Promise<void>;
8
- abstract getKeys(pattern?: string): Promise<string[] | null>;
9
- isRunning(): Promise<any>;
2
+ abstract start(): Promise<void>;
3
+ abstract close(): Promise<void>;
4
+ abstract get(keyCache: string): Promise<any>;
5
+ abstract set(keyCache: string, data: any, expiration: number): Promise<void>;
6
+ abstract del(keyCache: string): Promise<void>;
7
+ abstract delBatch(keyCache: string[]): Promise<void>;
8
+ abstract getKeys(pattern?: string): Promise<string[] | null>;
9
+ isRunning(): Promise<any>;
10
10
  }
@@ -1,13 +1,13 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CacheClient = void 0;
4
- const unique_entity_id_1 = require('../../domain/entities/unique-entity-id');
4
+ const unique_entity_id_1 = require("../../domain/entities/unique-entity-id");
5
5
  class CacheClient {
6
- async isRunning() {
7
- const key = new unique_entity_id_1.UniqueEntityId().toValue();
8
- await this.set(key, JSON.stringify({ ping: true }), 60);
9
- const cachedData = await this.get(key);
10
- return cachedData?.ping || false;
11
- }
6
+ async isRunning() {
7
+ const key = new unique_entity_id_1.UniqueEntityId().toValue();
8
+ await this.set(key, JSON.stringify({ ping: true }), 60);
9
+ const cachedData = await this.get(key);
10
+ return cachedData?.ping || false;
11
+ }
12
12
  }
13
13
  exports.CacheClient = CacheClient;
@@ -1,27 +1,27 @@
1
1
  export type PostInput = {
2
- body: any;
3
- endpoint: string;
4
- config: {
5
- headers?: Record<string, string>;
6
- };
2
+ body: any;
3
+ endpoint: string;
4
+ config: {
5
+ headers?: Record<string, string>;
6
+ };
7
7
  };
8
8
  export type PutInput = {
9
- body: any;
10
- endpoint: string;
11
- config: {
12
- headers?: Record<string, string>;
13
- };
9
+ body: any;
10
+ endpoint: string;
11
+ config: {
12
+ headers?: Record<string, string>;
13
+ };
14
14
  };
15
15
  export type GetInput = {
16
- endpoint: string;
17
- config: {
18
- headers?: Record<string, string>;
19
- query?: Record<string, string>;
20
- };
16
+ endpoint: string;
17
+ config: {
18
+ headers?: Record<string, string>;
19
+ query?: Record<string, string>;
20
+ };
21
21
  };
22
22
  export type RequestOutput = {
23
- code: number;
24
- headers?: Record<string, string>;
25
- body: any;
23
+ code: number;
24
+ headers?: Record<string, string>;
25
+ body: any;
26
26
  };
27
27
  export type ActivateBranchOutput = void;
@@ -1,2 +1,2 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
1
  import { GetInput, PostInput, RequestOutput } from './orbit-http-client-dto';
2
2
  export declare abstract class OrbitHTTPClient {
3
- protected abstract getTarget(): string;
4
- protected abstract getBaseUrl(): string;
5
- protected abstract post(input: PostInput): Promise<RequestOutput>;
6
- protected abstract get(input: GetInput): Promise<RequestOutput>;
3
+ protected abstract getTarget(): string;
4
+ protected abstract getBaseUrl(): string;
5
+ protected abstract post(input: PostInput): Promise<RequestOutput>;
6
+ protected abstract get(input: GetInput): Promise<RequestOutput>;
7
7
  }
@@ -1,5 +1,6 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OrbitHTTPClient = void 0;
4
- class OrbitHTTPClient {}
4
+ class OrbitHTTPClient {
5
+ }
5
6
  exports.OrbitHTTPClient = OrbitHTTPClient;
@@ -1,7 +1,3 @@
1
1
  export declare abstract class OrbitNotificationClient {
2
- abstract sendErrorNotification(
3
- author: string,
4
- title: string,
5
- description: string,
6
- ): Promise<void>;
2
+ abstract sendErrorNotification(author: string, title: string, description: string): Promise<void>;
7
3
  }
@@ -1,5 +1,6 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OrbitNotificationClient = void 0;
4
- class OrbitNotificationClient {}
4
+ class OrbitNotificationClient {
5
+ }
5
6
  exports.OrbitNotificationClient = OrbitNotificationClient;
@@ -1,5 +1,5 @@
1
1
  export default abstract class Handler {
2
- protected simultaneity: number;
3
- getSimultaneity(): number;
4
- abstract handle(message: any): Promise<void>;
2
+ protected simultaneity: number;
3
+ getSimultaneity(): number;
4
+ abstract handle(message: any): Promise<void>;
5
5
  }
@@ -1,11 +1,11 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class Handler {
4
- constructor() {
5
- this.simultaneity = 1;
6
- }
7
- getSimultaneity() {
8
- return this.simultaneity;
9
- }
4
+ constructor() {
5
+ this.simultaneity = 1;
6
+ }
7
+ getSimultaneity() {
8
+ return this.simultaneity;
9
+ }
10
10
  }
11
11
  exports.default = Handler;
@@ -1,6 +1,6 @@
1
1
  import DomainEvent from '../../domain/events/domain-event';
2
2
  export type MessagesInMemory = {
3
- exchangeName: string;
4
- domainEvent: DomainEvent;
5
- configs?: Record<string, unknown>;
3
+ exchangeName: string;
4
+ domainEvent: DomainEvent;
5
+ configs?: Record<string, unknown>;
6
6
  };
@@ -1,2 +1,2 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,6 @@
1
1
  import Queue from './queue';
2
2
  export default interface QueueConnection extends Queue {
3
- connect(props: unknown): Promise<any>;
4
- close(): Promise<void>;
5
- createConsumers?<T>(queueName: string, configs: T | any): Promise<void>;
3
+ connect(props: unknown): Promise<any>;
4
+ close(): Promise<void>;
5
+ createConsumers?<T>(queueName: string, configs: T | any): Promise<void>;
6
6
  }
@@ -1,2 +1,2 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +1,6 @@
1
1
  import DomainEvent from '../../domain/events/domain-event';
2
2
  import Handler from './handler';
3
3
  export default interface Queue {
4
- on(queueName: string, callback: Handler): Promise<void>;
5
- publish(
6
- exchangeName: string,
7
- domainEvent: DomainEvent,
8
- configs?: Record<string, any>,
9
- ): Promise<void>;
4
+ on(queueName: string, callback: Handler): Promise<void>;
5
+ publish(exchangeName: string, domainEvent: DomainEvent, configs?: Record<string, any>): Promise<void>;
10
6
  }
@@ -1,2 +1,2 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +1,8 @@
1
1
  import { CommonDTO } from './common-dto';
2
2
  import { Entity } from './entity';
3
- export declare abstract class AggregateRoot<
4
- Props extends CommonDTO,
5
- > extends Entity<Props> {
6
- get createdAt(): Date;
7
- set createdAt(date: Date);
8
- get updatedAt(): Date | undefined;
9
- touch(): void;
3
+ export declare abstract class AggregateRoot<Props extends CommonDTO> extends Entity<Props> {
4
+ get createdAt(): Date;
5
+ set createdAt(date: Date);
6
+ get updatedAt(): Date | undefined;
7
+ touch(): void;
10
8
  }
@@ -1,19 +1,19 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AggregateRoot = void 0;
4
- const entity_1 = require('./entity');
4
+ const entity_1 = require("./entity");
5
5
  class AggregateRoot extends entity_1.Entity {
6
- get createdAt() {
7
- return this.props.createdAt;
8
- }
9
- set createdAt(date) {
10
- this.props.createdAt = date;
11
- }
12
- get updatedAt() {
13
- return this.props.updatedAt;
14
- }
15
- touch() {
16
- this.props.updatedAt = new Date();
17
- }
6
+ get createdAt() {
7
+ return this.props.createdAt;
8
+ }
9
+ set createdAt(date) {
10
+ this.props.createdAt = date;
11
+ }
12
+ get updatedAt() {
13
+ return this.props.updatedAt;
14
+ }
15
+ touch() {
16
+ this.props.updatedAt = new Date();
17
+ }
18
18
  }
19
19
  exports.AggregateRoot = AggregateRoot;
@@ -1,14 +1,14 @@
1
1
  export type CommonDTO = {
2
- createdAt: Date;
3
- updatedAt?: Date;
2
+ createdAt: Date;
3
+ updatedAt?: Date;
4
4
  };
5
5
  export type CreateCommonDTO = {
6
- createdAt?: Date;
7
- updatedAt?: Date;
6
+ createdAt?: Date;
7
+ updatedAt?: Date;
8
8
  };
9
9
  export type UserRequestDTO = {
10
- createdByName: string;
11
- createdByEmail: string;
12
- updatedByName: string;
13
- updatedByEmail: string;
10
+ createdByName: string;
11
+ createdByEmail: string;
12
+ updatedByName: string;
13
+ updatedByEmail: string;
14
14
  };
@@ -1,2 +1,2 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +1,9 @@
1
1
  import { UniqueEntityId } from './unique-entity-id';
2
2
  export declare abstract class Entity<Props> {
3
- private _id;
4
- protected props: Props;
5
- get id(): UniqueEntityId;
6
- set id(id: UniqueEntityId);
7
- protected constructor(props: Props, id?: UniqueEntityId);
8
- equals(entity: Entity<any>): boolean;
3
+ private _id;
4
+ protected props: Props;
5
+ get id(): UniqueEntityId;
6
+ set id(id: UniqueEntityId);
7
+ protected constructor(props: Props, id?: UniqueEntityId);
8
+ equals(entity: Entity<any>): boolean;
9
9
  }
@@ -1,26 +1,26 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Entity = void 0;
4
- const unique_entity_id_1 = require('./unique-entity-id');
4
+ const unique_entity_id_1 = require("./unique-entity-id");
5
5
  class Entity {
6
- get id() {
7
- return this._id;
8
- }
9
- set id(id) {
10
- this._id = id;
11
- }
12
- constructor(props, id) {
13
- this._id = id ?? new unique_entity_id_1.UniqueEntityId(id);
14
- this.props = props;
15
- }
16
- equals(entity) {
17
- if (entity === this) {
18
- return true;
6
+ get id() {
7
+ return this._id;
19
8
  }
20
- if (entity.id === this._id) {
21
- return true;
9
+ set id(id) {
10
+ this._id = id;
11
+ }
12
+ constructor(props, id) {
13
+ this._id = id ?? new unique_entity_id_1.UniqueEntityId(id);
14
+ this.props = props;
15
+ }
16
+ equals(entity) {
17
+ if (entity === this) {
18
+ return true;
19
+ }
20
+ if (entity.id === this._id) {
21
+ return true;
22
+ }
23
+ return false;
22
24
  }
23
- return false;
24
- }
25
25
  }
26
26
  exports.Entity = Entity;
@@ -1,7 +1,7 @@
1
1
  export declare class UniqueEntityId {
2
- private value;
3
- constructor(value?: string);
4
- toString(): string;
5
- toValue(): string;
6
- equals(id: UniqueEntityId): boolean;
2
+ private value;
3
+ constructor(value?: string);
4
+ toString(): string;
5
+ toValue(): string;
6
+ equals(id: UniqueEntityId): boolean;
7
7
  }
@@ -1,19 +1,19 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UniqueEntityId = void 0;
4
- const node_crypto_1 = require('node:crypto');
4
+ const node_crypto_1 = require("node:crypto");
5
5
  class UniqueEntityId {
6
- constructor(value) {
7
- this.value = value ?? (0, node_crypto_1.randomUUID)();
8
- }
9
- toString() {
10
- return this.value;
11
- }
12
- toValue() {
13
- return this.value;
14
- }
15
- equals(id) {
16
- return id.toValue() === this.toValue();
17
- }
6
+ constructor(value) {
7
+ this.value = value ?? (0, node_crypto_1.randomUUID)();
8
+ }
9
+ toString() {
10
+ return this.value;
11
+ }
12
+ toValue() {
13
+ return this.value;
14
+ }
15
+ equals(id) {
16
+ return id.toValue() === this.toValue();
17
+ }
18
18
  }
19
19
  exports.UniqueEntityId = UniqueEntityId;
@@ -1,4 +1,4 @@
1
1
  export declare abstract class ValueObject<Props> {
2
- protected props: Props;
3
- protected constructor(props: Props);
2
+ protected props: Props;
3
+ protected constructor(props: Props);
4
4
  }
@@ -1,9 +1,9 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ValueObject = void 0;
4
4
  class ValueObject {
5
- constructor(props) {
6
- this.props = props;
7
- }
5
+ constructor(props) {
6
+ this.props = props;
7
+ }
8
8
  }
9
9
  exports.ValueObject = ValueObject;
@@ -1,25 +1,25 @@
1
1
  export declare abstract class WatchedList<T> {
2
- currentItems: T[];
3
- private initial;
4
- private new;
5
- private removed;
6
- private updated;
7
- constructor(initialItems?: T[]);
8
- abstract compareItems(a: T, b: T): boolean;
9
- getItems(): T[];
10
- getNewItems(): T[];
11
- getRemovedItems(): T[];
12
- getUpdatedItems(): T[];
13
- addUpdatedItem(item: T): number;
14
- private isCurrentItem;
15
- private isNewItem;
16
- private isRemovedItem;
17
- private removeFromNew;
18
- private removeFromCurrent;
19
- private removeFromRemoved;
20
- private wasAddedInitially;
21
- exists(item: T): boolean;
22
- add(item: T): void;
23
- remove(item: T): void;
24
- update(items: T[]): void;
2
+ currentItems: T[];
3
+ private initial;
4
+ private new;
5
+ private removed;
6
+ private updated;
7
+ constructor(initialItems?: T[]);
8
+ abstract compareItems(a: T, b: T): boolean;
9
+ getItems(): T[];
10
+ getNewItems(): T[];
11
+ getRemovedItems(): T[];
12
+ getUpdatedItems(): T[];
13
+ addUpdatedItem(item: T): number;
14
+ private isCurrentItem;
15
+ private isNewItem;
16
+ private isRemovedItem;
17
+ private removeFromNew;
18
+ private removeFromCurrent;
19
+ private removeFromRemoved;
20
+ private wasAddedInitially;
21
+ exists(item: T): boolean;
22
+ add(item: T): void;
23
+ remove(item: T): void;
24
+ update(items: T[]): void;
25
25
  }