@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.
- package/dist/clean-arch/application/cache/cache.d.ts +10 -10
- package/dist/clean-arch/application/cache/cache.js +39 -39
- package/dist/clean-arch/application/cache/client.d.ts +8 -8
- package/dist/clean-arch/application/cache/client.js +9 -9
- package/dist/clean-arch/application/orbit-http-client/orbit-http-client-dto.d.ts +18 -18
- package/dist/clean-arch/application/orbit-http-client/orbit-http-client-dto.js +2 -2
- package/dist/clean-arch/application/orbit-http-client/orbit-http-client.d.ts +4 -4
- package/dist/clean-arch/application/orbit-http-client/orbit-http-client.js +4 -3
- package/dist/clean-arch/application/oribit-notification-client/orbit-notification-client.d.ts +1 -5
- package/dist/clean-arch/application/oribit-notification-client/orbit-notification-client.js +4 -3
- package/dist/clean-arch/application/queue/handler.d.ts +3 -3
- package/dist/clean-arch/application/queue/handler.js +8 -8
- package/dist/clean-arch/application/queue/messages-in-memory.d.ts +3 -3
- package/dist/clean-arch/application/queue/messages-in-memory.js +2 -2
- package/dist/clean-arch/application/queue/queue-connection.d.ts +3 -3
- package/dist/clean-arch/application/queue/queue-connection.js +2 -2
- package/dist/clean-arch/application/queue/queue.d.ts +2 -6
- package/dist/clean-arch/application/queue/queue.js +2 -2
- package/dist/clean-arch/domain/entities/aggregate-root.d.ts +5 -7
- package/dist/clean-arch/domain/entities/aggregate-root.js +15 -15
- package/dist/clean-arch/domain/entities/common-dto.d.ts +8 -8
- package/dist/clean-arch/domain/entities/common-dto.js +2 -2
- package/dist/clean-arch/domain/entities/entity.d.ts +6 -6
- package/dist/clean-arch/domain/entities/entity.js +20 -20
- package/dist/clean-arch/domain/entities/unique-entity-id.d.ts +5 -5
- package/dist/clean-arch/domain/entities/unique-entity-id.js +15 -15
- package/dist/clean-arch/domain/entities/value-object.d.ts +2 -2
- package/dist/clean-arch/domain/entities/value-object.js +5 -5
- package/dist/clean-arch/domain/entities/watched-list.d.ts +23 -23
- package/dist/clean-arch/domain/entities/watched-list.js +84 -93
- package/dist/clean-arch/domain/entities/watched-list.spec.js +45 -45
- package/dist/clean-arch/domain/errors/application-error.d.ts +2 -2
- package/dist/clean-arch/domain/errors/application-error.js +6 -6
- package/dist/clean-arch/domain/errors/domain-error.d.ts +2 -2
- package/dist/clean-arch/domain/errors/domain-error.js +6 -6
- package/dist/clean-arch/domain/errors/http-error.d.ts +6 -6
- package/dist/clean-arch/domain/errors/http-error.js +7 -7
- package/dist/clean-arch/domain/errors/invalid-password-algorithm-error.d.ts +1 -1
- package/dist/clean-arch/domain/errors/invalid-password-algorithm-error.js +8 -8
- package/dist/clean-arch/domain/errors/invalid-password-length-error.d.ts +1 -1
- package/dist/clean-arch/domain/errors/invalid-password-length-error.js +8 -11
- package/dist/clean-arch/domain/errors/validation-error.d.ts +5 -5
- package/dist/clean-arch/domain/errors/validation-error.js +8 -8
- package/dist/clean-arch/domain/events/domain-event.d.ts +2 -2
- package/dist/clean-arch/domain/events/domain-event.js +2 -2
- package/dist/clean-arch/domain/factories/create-password-factory.d.ts +4 -6
- package/dist/clean-arch/domain/factories/create-password-factory.js +18 -28
- package/dist/clean-arch/domain/factories/random-password-temporary-factory.d.ts +6 -6
- package/dist/clean-arch/domain/factories/random-password-temporary-factory.js +46 -46
- package/dist/clean-arch/domain/interfaces/address-type.d.ts +4 -0
- package/dist/clean-arch/domain/interfaces/address-type.js +2 -0
- package/dist/clean-arch/domain/interfaces/city.d.ts +8 -0
- package/dist/clean-arch/domain/interfaces/city.js +2 -0
- package/dist/clean-arch/domain/interfaces/country.d.ts +4 -0
- package/dist/clean-arch/domain/interfaces/country.js +2 -0
- package/dist/clean-arch/domain/interfaces/ddd.d.ts +5 -0
- package/dist/clean-arch/domain/interfaces/ddd.js +2 -0
- package/dist/clean-arch/domain/interfaces/state.d.ts +5 -0
- package/dist/clean-arch/domain/interfaces/state.js +2 -0
- package/dist/clean-arch/domain/types/optional.js +2 -2
- package/dist/clean-arch/domain/value-objects/password.d.ts +12 -12
- package/dist/clean-arch/domain/value-objects/password.js +11 -11
- package/dist/clean-arch/domain/value-objects/pbkdf2-password.d.ts +7 -7
- package/dist/clean-arch/domain/value-objects/pbkdf2-password.js +26 -43
- package/dist/clean-arch/domain/value-objects/sha1-password.d.ts +7 -7
- package/dist/clean-arch/domain/value-objects/sha1-password.js +25 -31
- package/dist/clean-arch/infra/adapters/express-adapter.d.ts +7 -7
- package/dist/clean-arch/infra/adapters/express-adapter.js +45 -46
- package/dist/clean-arch/infra/adapters/fastify-adapter.d.ts +6 -6
- package/dist/clean-arch/infra/adapters/fastify-adapter.js +48 -47
- package/dist/clean-arch/infra/authorizations/authorization.d.ts +9 -12
- package/dist/clean-arch/infra/authorizations/authorization.js +24 -24
- package/dist/clean-arch/infra/authorizations/authorizer.d.ts +5 -9
- package/dist/clean-arch/infra/authorizations/authorizer.js +17 -17
- package/dist/clean-arch/infra/authorizations/authorizer.spec.js +132 -151
- package/dist/clean-arch/infra/authorizations/not-allowed.d.ts +1 -1
- package/dist/clean-arch/infra/authorizations/not-allowed.js +6 -6
- package/dist/clean-arch/infra/cache/clients/node-cache.d.ts +9 -9
- package/dist/clean-arch/infra/cache/clients/node-cache.js +41 -38
- package/dist/clean-arch/infra/cache/clients/redis.d.ts +11 -11
- package/dist/clean-arch/infra/cache/clients/redis.js +56 -55
- package/dist/clean-arch/infra/environment/env.d.ts +3 -3
- package/dist/clean-arch/infra/environment/env.js +15 -15
- package/dist/clean-arch/infra/environment/environment.d.ts +5 -5
- package/dist/clean-arch/infra/environment/environment.js +7 -7
- package/dist/clean-arch/infra/errors/infra-error.d.ts +2 -2
- package/dist/clean-arch/infra/errors/infra-error.js +6 -6
- package/dist/clean-arch/infra/http/controller.d.ts +12 -12
- package/dist/clean-arch/infra/http/controller.js +70 -80
- package/dist/clean-arch/infra/http/handle-bool-filter.js +6 -6
- package/dist/clean-arch/infra/http/handle-is-active-query.js +6 -6
- package/dist/clean-arch/infra/http/handle-sort-param-query.d.ts +1 -3
- package/dist/clean-arch/infra/http/handle-sort-param-query.js +12 -12
- package/dist/clean-arch/infra/http/handle-user-headers.d.ts +6 -6
- package/dist/clean-arch/infra/http/handle-user-headers.js +8 -8
- package/dist/clean-arch/infra/http/health-connections.d.ts +6 -6
- package/dist/clean-arch/infra/http/health-connections.js +9 -9
- package/dist/clean-arch/infra/http/http.d.ts +3 -3
- package/dist/clean-arch/infra/http/http.js +2 -2
- package/dist/clean-arch/infra/orbit-http-client/orbit-axios-client/orbit-axios-client.d.ts +6 -10
- package/dist/clean-arch/infra/orbit-http-client/orbit-axios-client/orbit-axios-client.js +48 -48
- package/dist/clean-arch/infra/orbit-notification-client/discord-client.d.ts +7 -13
- package/dist/clean-arch/infra/orbit-notification-client/discord-client.js +26 -25
- package/dist/clean-arch/infra/queue/create-consumers.d.ts +6 -6
- package/dist/clean-arch/infra/queue/create-consumers.js +11 -11
- package/dist/clean-arch/infra/queue/in-memory/in-memory-queue.d.ts +6 -6
- package/dist/clean-arch/infra/queue/in-memory/in-memory-queue.js +14 -14
- package/dist/clean-arch/infra/queue/queue-controller.d.ts +6 -6
- package/dist/clean-arch/infra/queue/queue-controller.js +9 -9
- package/dist/clean-arch/infra/queue/rabbitmq/amqp-lib.d.ts +20 -24
- package/dist/clean-arch/infra/queue/rabbitmq/amqp-lib.js +140 -150
- package/dist/clean-arch/infra/queue/rabbitmq/amqp-lib.spec.js +33 -33
- package/dist/clean-arch/infra/queue/worker.d.ts +6 -6
- package/dist/clean-arch/infra/queue/worker.js +30 -33
- package/dist/clean-arch/shared/pagination/dto-response.d.ts +6 -6
- package/dist/clean-arch/shared/pagination/dto-response.js +2 -2
- package/dist/clean-arch/shared/pagination/get-take-and-skip.d.ts +3 -6
- package/dist/clean-arch/shared/pagination/get-take-and-skip.js +5 -5
- package/dist/clean-arch/shared/pagination/pagination.d.ts +3 -3
- package/dist/clean-arch/shared/pagination/pagination.js +2 -2
- package/dist/frameworks/express/api-gateway/mapping-model.d.ts +12 -12
- package/dist/frameworks/express/api-gateway/mapping-model.js +47 -47
- package/dist/frameworks/express/api-gateway/mapping-model.spec.js +127 -141
- package/dist/frameworks/express/api-gateway/middleware-express.d.ts +1 -5
- package/dist/frameworks/express/api-gateway/middleware-express.js +4 -8
- package/dist/frameworks/express/authorizations/authorization-express.d.ts +8 -13
- package/dist/frameworks/express/authorizations/authorization-express.js +29 -29
- package/dist/frameworks/express/authorizations/authorization-express.spec.js +72 -89
- package/dist/frameworks/express/authorizations/middleware-express.d.ts +1 -3
- package/dist/frameworks/express/authorizations/middleware-express.js +13 -15
- package/dist/frameworks/express/compression/middleware-express.d.ts +1 -7
- package/dist/frameworks/express/compression/middleware-express.js +6 -6
- package/dist/frameworks/express/types.d.ts +3 -3
- package/dist/frameworks/express/types.js +2 -2
- package/dist/frameworks/nest/authorizations/authorization-nest.d.ts +3 -8
- package/dist/frameworks/nest/authorizations/authorization-nest.js +15 -17
- package/dist/frameworks/nest/authorizations/guard-nest.d.ts +3 -3
- package/dist/frameworks/nest/authorizations/guard-nest.js +22 -25
- package/dist/frameworks/nest/authorizations/not-allowed-nest.d.ts +4 -4
- package/dist/frameworks/nest/authorizations/not-allowed-nest.js +13 -13
- package/dist/frameworks/nest/errors/orbit-error.d.ts +2 -1
- package/dist/frameworks/nest/errors/orbit-error.js +5 -4
- package/dist/frameworks/nest/exception-filters/orbit-exception-filter.d.ts +1 -1
- package/dist/frameworks/nest/exception-filters/orbit-exception-filter.js +14 -15
- package/dist/index.js +4 -4
- package/dist/infra/authorizations/auth-matcher.d.ts +7 -10
- package/dist/infra/authorizations/auth-matcher.js +47 -43
- package/dist/infra/authorizations/auth-matcher.spec.js +702 -727
- package/dist/infra/authorizations/validator/api/api-validator.d.ts +11 -11
- package/dist/infra/authorizations/validator/api/api-validator.js +29 -34
- package/dist/infra/authorizations/validator/api/factories/unauthorized-response-factory.d.ts +1 -4
- package/dist/infra/authorizations/validator/api/factories/unauthorized-response-factory.js +37 -38
- package/dist/infra/authorizations/validator/api/factories/unauthorized-response-factory.spec.js +109 -123
- package/dist/infra/authorizations/validator/auth-validator.d.ts +10 -10
- package/dist/infra/authorizations/validator/auth-validator.js +24 -27
- package/dist/infra/authorizations/validator/auth-validator.spec.js +78 -87
- package/dist/infra/http/api-gateway/mapping-model.d.ts +21 -27
- package/dist/infra/http/api-gateway/mapping-model.js +35 -38
- package/dist/infra/http/api-gateway/mapping-model.spec.js +129 -129
- package/dist/infra/http/compression/filter.d.ts +1 -3
- package/dist/infra/http/compression/filter.js +4 -4
- package/dist/infra/http/errors/api-common-error.d.ts +22 -22
- package/dist/infra/http/errors/api-common-error.js +2 -2
- package/dist/infra/http/errors/api-error.d.ts +3 -3
- package/dist/infra/http/errors/api-error.js +7 -7
- package/dist/infra/http/errors/unauthorized-response.d.ts +3 -3
- package/dist/infra/http/errors/unauthorized-response.js +2 -2
- package/dist/static/address-types.d.ts +2 -0
- package/dist/static/address-types.js +8 -0
- package/dist/static/address-types.json +714 -0
- package/dist/static/cities.d.ts +2 -0
- package/dist/static/cities.js +6 -0
- package/dist/static/cities.json +44562 -0
- package/dist/static/countries.d.ts +2 -0
- package/dist/static/countries.js +6 -0
- package/dist/static/countries.json +1002 -0
- package/dist/static/ddd.d.ts +2 -0
- package/dist/static/ddd.js +6 -0
- package/dist/static/ddd.json +28012 -0
- package/dist/static/states.d.ts +2 -0
- package/dist/static/states.js +6 -0
- package/dist/static/states.json +137 -0
- package/package.json +2 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { CacheClient } from './client';
|
|
2
2
|
export declare abstract class Cache {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Cache = void 0;
|
|
4
|
-
const env_1 = require(
|
|
4
|
+
const env_1 = require("../../infra/environment/env");
|
|
5
5
|
class Cache {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CacheClient = void 0;
|
|
4
|
-
const unique_entity_id_1 = require(
|
|
4
|
+
const unique_entity_id_1 = require("../../domain/entities/unique-entity-id");
|
|
5
5
|
class CacheClient {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
body: any;
|
|
3
|
+
endpoint: string;
|
|
4
|
+
config: {
|
|
5
|
+
headers?: Record<string, string>;
|
|
6
|
+
};
|
|
7
7
|
};
|
|
8
8
|
export type PutInput = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
body: any;
|
|
10
|
+
endpoint: string;
|
|
11
|
+
config: {
|
|
12
|
+
headers?: Record<string, string>;
|
|
13
|
+
};
|
|
14
14
|
};
|
|
15
15
|
export type GetInput = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
code: number;
|
|
24
|
+
headers?: Record<string, string>;
|
|
25
|
+
body: any;
|
|
26
26
|
};
|
|
27
27
|
export type ActivateBranchOutput = void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
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;
|
package/dist/clean-arch/application/oribit-notification-client/orbit-notification-client.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
export declare abstract class OrbitNotificationClient {
|
|
2
|
-
|
|
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
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
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,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
class Handler {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
exchangeName: string;
|
|
4
|
+
domainEvent: DomainEvent;
|
|
5
|
+
configs?: Record<string, unknown>;
|
|
6
6
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
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
|
-
|
|
5
|
-
|
|
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
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AggregateRoot = void 0;
|
|
4
|
-
const entity_1 = require(
|
|
4
|
+
const entity_1 = require("./entity");
|
|
5
5
|
class AggregateRoot extends entity_1.Entity {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
3
|
-
|
|
2
|
+
createdAt: Date;
|
|
3
|
+
updatedAt?: Date;
|
|
4
4
|
};
|
|
5
5
|
export type CreateCommonDTO = {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
createdAt?: Date;
|
|
7
|
+
updatedAt?: Date;
|
|
8
8
|
};
|
|
9
9
|
export type UserRequestDTO = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
createdByName: string;
|
|
11
|
+
createdByEmail: string;
|
|
12
|
+
updatedByName: string;
|
|
13
|
+
updatedByEmail: string;
|
|
14
14
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Entity = void 0;
|
|
4
|
-
const unique_entity_id_1 = require(
|
|
4
|
+
const unique_entity_id_1 = require("./unique-entity-id");
|
|
5
5
|
class Entity {
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
21
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UniqueEntityId = void 0;
|
|
4
|
-
const node_crypto_1 = require(
|
|
4
|
+
const node_crypto_1 = require("node:crypto");
|
|
5
5
|
class UniqueEntityId {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ValueObject = void 0;
|
|
4
4
|
class ValueObject {
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
}
|