@seidor-cloud-produtos/orbit-backend-lib 0.0.67 → 0.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/dist/clean-arch/application/cache/cache.d.ts +2 -1
- package/dist/clean-arch/application/cache/cache.js +17 -3
- package/dist/clean-arch/application/cache/client.d.ts +1 -0
- package/dist/clean-arch/application/cache/client.js +0 -0
- package/dist/clean-arch/application/queue/handler.d.ts +0 -0
- package/dist/clean-arch/application/queue/handler.js +0 -0
- package/dist/clean-arch/application/queue/messages-in-memory.d.ts +0 -0
- package/dist/clean-arch/application/queue/messages-in-memory.js +0 -0
- package/dist/clean-arch/application/queue/queue-connection.d.ts +0 -0
- package/dist/clean-arch/application/queue/queue-connection.js +0 -0
- package/dist/clean-arch/application/queue/queue.d.ts +0 -0
- package/dist/clean-arch/application/queue/queue.js +0 -0
- package/dist/clean-arch/domain/entities/aggregate-root.d.ts +0 -0
- package/dist/clean-arch/domain/entities/aggregate-root.js +0 -0
- package/dist/clean-arch/domain/entities/common-dto.d.ts +0 -0
- package/dist/clean-arch/domain/entities/common-dto.js +0 -0
- package/dist/clean-arch/domain/entities/entity.d.ts +0 -0
- package/dist/clean-arch/domain/entities/entity.js +0 -0
- package/dist/clean-arch/domain/entities/unique-entity-id.d.ts +0 -0
- package/dist/clean-arch/domain/entities/unique-entity-id.js +0 -0
- package/dist/clean-arch/domain/entities/value-object.d.ts +0 -0
- package/dist/clean-arch/domain/entities/value-object.js +0 -0
- package/dist/clean-arch/domain/entities/watched-list.d.ts +0 -0
- package/dist/clean-arch/domain/entities/watched-list.js +0 -0
- package/dist/clean-arch/domain/entities/watched-list.spec.d.ts +0 -0
- package/dist/clean-arch/domain/entities/watched-list.spec.js +0 -0
- package/dist/clean-arch/domain/errors/application-error.d.ts +0 -0
- package/dist/clean-arch/domain/errors/application-error.js +0 -0
- package/dist/clean-arch/domain/errors/domain-error.d.ts +0 -0
- package/dist/clean-arch/domain/errors/domain-error.js +0 -0
- package/dist/clean-arch/domain/errors/invalid-password-algorithm-error.d.ts +0 -0
- package/dist/clean-arch/domain/errors/invalid-password-algorithm-error.js +0 -0
- package/dist/clean-arch/domain/errors/invalid-password-length-error.d.ts +0 -0
- package/dist/clean-arch/domain/errors/invalid-password-length-error.js +0 -0
- package/dist/clean-arch/domain/errors/validation-error.d.ts +0 -0
- package/dist/clean-arch/domain/errors/validation-error.js +0 -0
- package/dist/clean-arch/domain/events/domain-event.d.ts +0 -0
- package/dist/clean-arch/domain/events/domain-event.js +0 -0
- package/dist/clean-arch/domain/factories/create-password-factory.d.ts +0 -0
- package/dist/clean-arch/domain/factories/create-password-factory.js +0 -0
- package/dist/clean-arch/domain/factories/random-password-temporary-factory.d.ts +0 -0
- package/dist/clean-arch/domain/factories/random-password-temporary-factory.js +0 -0
- package/dist/clean-arch/domain/types/optional.d.ts +0 -0
- package/dist/clean-arch/domain/types/optional.js +0 -0
- package/dist/clean-arch/domain/value-objects/password.d.ts +0 -0
- package/dist/clean-arch/domain/value-objects/password.js +0 -0
- package/dist/clean-arch/domain/value-objects/pbkdf2-password.d.ts +0 -0
- package/dist/clean-arch/domain/value-objects/pbkdf2-password.js +0 -0
- package/dist/clean-arch/domain/value-objects/sha1-password.d.ts +0 -0
- package/dist/clean-arch/domain/value-objects/sha1-password.js +0 -0
- package/dist/clean-arch/infra/adapters/express-adapter.d.ts +0 -0
- package/dist/clean-arch/infra/adapters/express-adapter.js +0 -0
- package/dist/clean-arch/infra/adapters/fastify-adapter.d.ts +0 -0
- package/dist/clean-arch/infra/adapters/fastify-adapter.js +0 -0
- package/dist/clean-arch/infra/authorizations/authorization.d.ts +0 -0
- package/dist/clean-arch/infra/authorizations/authorization.js +0 -0
- package/dist/clean-arch/infra/authorizations/authorizer.d.ts +0 -0
- package/dist/clean-arch/infra/authorizations/authorizer.js +0 -0
- package/dist/clean-arch/infra/authorizations/authorizer.spec.d.ts +0 -0
- package/dist/clean-arch/infra/authorizations/authorizer.spec.js +0 -0
- package/dist/clean-arch/infra/authorizations/not-allowed.d.ts +0 -0
- package/dist/clean-arch/infra/authorizations/not-allowed.js +0 -0
- package/dist/clean-arch/infra/cache/clients/node-cache.d.ts +1 -0
- package/dist/clean-arch/infra/cache/clients/node-cache.js +3 -0
- package/dist/clean-arch/infra/cache/clients/redis.d.ts +1 -0
- package/dist/clean-arch/infra/cache/clients/redis.js +3 -0
- package/dist/clean-arch/infra/environment/env.d.ts +0 -0
- package/dist/clean-arch/infra/environment/env.js +0 -0
- package/dist/clean-arch/infra/environment/environment.d.ts +0 -0
- package/dist/clean-arch/infra/environment/environment.js +0 -0
- package/dist/clean-arch/infra/errors/infra-error.d.ts +0 -0
- package/dist/clean-arch/infra/errors/infra-error.js +0 -0
- package/dist/clean-arch/infra/http/controller.d.ts +0 -0
- package/dist/clean-arch/infra/http/controller.js +0 -0
- package/dist/clean-arch/infra/http/handle-bool-filter.d.ts +0 -0
- package/dist/clean-arch/infra/http/handle-bool-filter.js +0 -0
- package/dist/clean-arch/infra/http/handle-is-active-query.d.ts +0 -0
- package/dist/clean-arch/infra/http/handle-is-active-query.js +0 -0
- package/dist/clean-arch/infra/http/handle-sort-param-query.d.ts +0 -0
- package/dist/clean-arch/infra/http/handle-sort-param-query.js +0 -0
- package/dist/clean-arch/infra/http/handle-user-headers.d.ts +0 -0
- package/dist/clean-arch/infra/http/handle-user-headers.js +0 -0
- package/dist/clean-arch/infra/http/health-connections.d.ts +0 -0
- package/dist/clean-arch/infra/http/health-connections.js +0 -0
- package/dist/clean-arch/infra/http/http.d.ts +0 -0
- package/dist/clean-arch/infra/http/http.js +0 -0
- package/dist/clean-arch/infra/queue/create-consumers.d.ts +0 -0
- package/dist/clean-arch/infra/queue/create-consumers.js +0 -0
- package/dist/clean-arch/infra/queue/in-memory/in-memory-queue.d.ts +0 -0
- package/dist/clean-arch/infra/queue/in-memory/in-memory-queue.js +0 -0
- package/dist/clean-arch/infra/queue/queue-controller.d.ts +0 -0
- package/dist/clean-arch/infra/queue/queue-controller.js +0 -0
- package/dist/clean-arch/infra/queue/rabbitmq/amqp-lib.d.ts +0 -0
- package/dist/clean-arch/infra/queue/rabbitmq/amqp-lib.js +0 -0
- package/dist/clean-arch/infra/queue/rabbitmq/amqp-lib.spec.d.ts +0 -0
- package/dist/clean-arch/infra/queue/rabbitmq/amqp-lib.spec.js +0 -0
- package/dist/clean-arch/shared/pagination/dto-response.d.ts +0 -0
- package/dist/clean-arch/shared/pagination/dto-response.js +0 -0
- package/dist/clean-arch/shared/pagination/get-take-and-skip.d.ts +0 -0
- package/dist/clean-arch/shared/pagination/get-take-and-skip.js +0 -0
- package/dist/clean-arch/shared/pagination/pagination.d.ts +0 -0
- package/dist/clean-arch/shared/pagination/pagination.js +0 -0
- package/dist/frameworks/express/api-gateway/mapping-model.d.ts +0 -0
- package/dist/frameworks/express/api-gateway/mapping-model.js +0 -0
- package/dist/frameworks/express/api-gateway/mapping-model.spec.d.ts +0 -0
- package/dist/frameworks/express/api-gateway/mapping-model.spec.js +0 -0
- package/dist/frameworks/express/api-gateway/middleware-express.d.ts +0 -0
- package/dist/frameworks/express/api-gateway/middleware-express.js +0 -0
- package/dist/frameworks/express/authorizations/authorization-express.d.ts +0 -0
- package/dist/frameworks/express/authorizations/authorization-express.js +0 -0
- package/dist/frameworks/express/authorizations/authorization-express.spec.d.ts +0 -0
- package/dist/frameworks/express/authorizations/authorization-express.spec.js +0 -0
- package/dist/frameworks/express/authorizations/middleware-express.d.ts +0 -0
- package/dist/frameworks/express/authorizations/middleware-express.js +0 -0
- package/dist/frameworks/express/compression/middleware-express.d.ts +0 -0
- package/dist/frameworks/express/compression/middleware-express.js +0 -0
- package/dist/frameworks/express/types.d.ts +0 -0
- package/dist/frameworks/express/types.js +0 -0
- package/dist/frameworks/nest/authorizations/authorization-nest.d.ts +0 -0
- package/dist/frameworks/nest/authorizations/authorization-nest.js +0 -0
- package/dist/frameworks/nest/authorizations/guard-nest.d.ts +0 -0
- package/dist/frameworks/nest/authorizations/guard-nest.js +0 -0
- package/dist/frameworks/nest/authorizations/not-allowed-nest.d.ts +0 -0
- package/dist/frameworks/nest/authorizations/not-allowed-nest.js +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -0
- package/dist/infra/authorizations/auth-matcher.d.ts +0 -0
- package/dist/infra/authorizations/auth-matcher.js +0 -0
- package/dist/infra/authorizations/auth-matcher.spec.d.ts +0 -0
- package/dist/infra/authorizations/auth-matcher.spec.js +0 -0
- package/dist/infra/authorizations/validator/api/api-validator.d.ts +0 -0
- package/dist/infra/authorizations/validator/api/api-validator.js +0 -0
- package/dist/infra/authorizations/validator/api/factories/unauthorized-response-factory.d.ts +0 -0
- package/dist/infra/authorizations/validator/api/factories/unauthorized-response-factory.js +0 -0
- package/dist/infra/authorizations/validator/api/factories/unauthorized-response-factory.spec.d.ts +0 -0
- package/dist/infra/authorizations/validator/api/factories/unauthorized-response-factory.spec.js +0 -0
- package/dist/infra/authorizations/validator/auth-validator.d.ts +0 -0
- package/dist/infra/authorizations/validator/auth-validator.js +0 -0
- package/dist/infra/authorizations/validator/auth-validator.spec.d.ts +0 -0
- package/dist/infra/authorizations/validator/auth-validator.spec.js +0 -0
- package/dist/infra/http/api-gateway/mapping-model.d.ts +0 -0
- package/dist/infra/http/api-gateway/mapping-model.js +0 -0
- package/dist/infra/http/api-gateway/mapping-model.spec.d.ts +0 -0
- package/dist/infra/http/api-gateway/mapping-model.spec.js +0 -0
- package/dist/infra/http/compression/filter.d.ts +0 -0
- package/dist/infra/http/compression/filter.js +0 -0
- package/dist/infra/http/errors/api-common-error.d.ts +0 -0
- package/dist/infra/http/errors/api-common-error.js +0 -0
- package/dist/infra/http/errors/api-error.d.ts +0 -0
- package/dist/infra/http/errors/api-error.js +0 -0
- package/dist/infra/http/errors/unauthorized-response.d.ts +0 -0
- package/dist/infra/http/errors/unauthorized-response.js +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
File without changes
|
|
@@ -4,9 +4,10 @@ export declare abstract class Cache {
|
|
|
4
4
|
protected DEFAULT_EXPIRATION_SECONDS: number;
|
|
5
5
|
start(): Promise<void>;
|
|
6
6
|
get(keyCache: string): Promise<any>;
|
|
7
|
-
set(keyCache: string, data: any, expiration
|
|
7
|
+
set(keyCache: string, data: any, expiration: number): Promise<void>;
|
|
8
8
|
del(keyCache: string): Promise<void>;
|
|
9
9
|
getKeys(pattern?: string): Promise<string[]>;
|
|
10
10
|
delBatch(patterns: string[]): Promise<void>;
|
|
11
11
|
isRunning(): Promise<any>;
|
|
12
|
+
close(): Promise<void>;
|
|
12
13
|
}
|
|
@@ -8,14 +8,21 @@ class Cache {
|
|
|
8
8
|
}
|
|
9
9
|
async start() {
|
|
10
10
|
await this.client.start();
|
|
11
|
-
|
|
11
|
+
if (process.env.NODE_ENV !== 'test') {
|
|
12
|
+
console.log('\n');
|
|
13
|
+
console.log('💾 Cache Connected');
|
|
14
|
+
}
|
|
12
15
|
}
|
|
13
16
|
async get(keyCache) {
|
|
14
17
|
const dataFromCache = await this.client.get(keyCache);
|
|
15
18
|
return dataFromCache ? dataFromCache : null;
|
|
16
19
|
}
|
|
17
|
-
async set(keyCache, data, expiration
|
|
18
|
-
return await this.client.set(
|
|
20
|
+
async set(keyCache, data, expiration) {
|
|
21
|
+
return await this.client.set(
|
|
22
|
+
keyCache,
|
|
23
|
+
JSON.stringify(data),
|
|
24
|
+
expiration || this.DEFAULT_EXPIRATION_SECONDS,
|
|
25
|
+
);
|
|
19
26
|
}
|
|
20
27
|
async del(keyCache) {
|
|
21
28
|
return await this.client.del(keyCache);
|
|
@@ -29,5 +36,12 @@ class Cache {
|
|
|
29
36
|
async isRunning() {
|
|
30
37
|
return await this.client.isRunning();
|
|
31
38
|
}
|
|
39
|
+
async close() {
|
|
40
|
+
if (process.env.NODE_ENV !== 'test') {
|
|
41
|
+
console.log('\n');
|
|
42
|
+
console.log('💾 Cache closed');
|
|
43
|
+
}
|
|
44
|
+
return await this.client.close();
|
|
45
|
+
}
|
|
32
46
|
}
|
|
33
47
|
exports.Cache = Cache;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare abstract class CacheClient {
|
|
2
2
|
abstract start(): Promise<void>;
|
|
3
|
+
abstract close(): Promise<void>;
|
|
3
4
|
abstract get(keyCache: string): Promise<any>;
|
|
4
5
|
abstract set(keyCache: string, data: any, expiration: number): Promise<void>;
|
|
5
6
|
abstract del(keyCache: string): Promise<void>;
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -8,6 +8,7 @@ export declare class NodeCache extends CacheClient {
|
|
|
8
8
|
del(keyCache: string): Promise<void>;
|
|
9
9
|
delBatch(keyCache: string[]): Promise<void>;
|
|
10
10
|
getKeys(pattern?: string | undefined): Promise<string[]>;
|
|
11
|
+
close(): Promise<void>;
|
|
11
12
|
}
|
|
12
13
|
declare const _default: NodeCache;
|
|
13
14
|
export default _default;
|
|
@@ -35,6 +35,9 @@ class NodeCache extends client_1.CacheClient {
|
|
|
35
35
|
if (!pattern) return keys;
|
|
36
36
|
return keys.filter(new RegExp(pattern).test);
|
|
37
37
|
}
|
|
38
|
+
async close() {
|
|
39
|
+
this.client.flushAll();
|
|
40
|
+
}
|
|
38
41
|
}
|
|
39
42
|
exports.NodeCache = NodeCache;
|
|
40
43
|
exports.default = new NodeCache();
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/infra/authorizations/validator/api/factories/unauthorized-response-factory.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/infra/authorizations/validator/api/factories/unauthorized-response-factory.spec.d.ts
CHANGED
|
File without changes
|
package/dist/infra/authorizations/validator/api/factories/unauthorized-response-factory.spec.js
CHANGED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|