@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.
- package/README.md +0 -0
- package/dist/clean-arch/application/cache/cache.d.ts +0 -0
- package/dist/clean-arch/application/cache/cache.js +6 -9
- package/dist/clean-arch/application/cache/client.d.ts +0 -0
- package/dist/clean-arch/application/cache/client.js +0 -0
- package/dist/clean-arch/application/logger/index.d.ts +11 -0
- package/dist/clean-arch/application/logger/index.js +25 -0
- package/dist/clean-arch/application/orbit-http-client/orbit-http-client-dto.d.ts +0 -0
- package/dist/clean-arch/application/orbit-http-client/orbit-http-client-dto.js +0 -0
- package/dist/clean-arch/application/orbit-http-client/orbit-http-client.d.ts +0 -0
- package/dist/clean-arch/application/orbit-http-client/orbit-http-client.js +0 -0
- package/dist/clean-arch/application/oribit-notification-client/orbit-notification-client.d.ts +0 -0
- package/dist/clean-arch/application/oribit-notification-client/orbit-notification-client.js +0 -0
- package/dist/clean-arch/application/queue/handler.d.ts +0 -0
- package/dist/clean-arch/application/queue/handler.js +1 -3
- 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 +2 -0
- package/dist/clean-arch/domain/entities/unique-entity-id.d.ts +0 -0
- package/dist/clean-arch/domain/entities/unique-entity-id.js +1 -0
- package/dist/clean-arch/domain/entities/value-object.d.ts +0 -0
- package/dist/clean-arch/domain/entities/value-object.js +1 -0
- package/dist/clean-arch/domain/entities/watched-list.d.ts +0 -0
- package/dist/clean-arch/domain/entities/watched-list.js +5 -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 +1 -0
- package/dist/clean-arch/domain/errors/domain-error.d.ts +0 -0
- package/dist/clean-arch/domain/errors/domain-error.js +1 -0
- package/dist/clean-arch/domain/errors/http-error.d.ts +0 -0
- package/dist/clean-arch/domain/errors/http-error.js +2 -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 +2 -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/interfaces/address-type.d.ts +0 -0
- package/dist/clean-arch/domain/interfaces/address-type.js +0 -0
- package/dist/clean-arch/domain/interfaces/city.d.ts +0 -0
- package/dist/clean-arch/domain/interfaces/city.js +0 -0
- package/dist/clean-arch/domain/interfaces/country.d.ts +0 -0
- package/dist/clean-arch/domain/interfaces/country.js +0 -0
- package/dist/clean-arch/domain/interfaces/ddd.d.ts +0 -0
- package/dist/clean-arch/domain/interfaces/ddd.js +0 -0
- package/dist/clean-arch/domain/interfaces/state.d.ts +0 -0
- package/dist/clean-arch/domain/interfaces/state.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 +5 -0
- package/dist/clean-arch/domain/value-objects/pbkdf2-password.d.ts +0 -0
- package/dist/clean-arch/domain/value-objects/pbkdf2-password.js +3 -0
- package/dist/clean-arch/domain/value-objects/sha1-password.d.ts +0 -0
- package/dist/clean-arch/domain/value-objects/sha1-password.js +3 -0
- package/dist/clean-arch/infra/adapters/express-adapter.d.ts +0 -0
- package/dist/clean-arch/infra/adapters/express-adapter.js +3 -0
- package/dist/clean-arch/infra/adapters/fastify-adapter.d.ts +0 -0
- package/dist/clean-arch/infra/adapters/fastify-adapter.js +2 -0
- package/dist/clean-arch/infra/authorizations/authorization.d.ts +2 -2
- 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 +2 -2
- package/dist/clean-arch/infra/authorizations/not-allowed.js +0 -0
- package/dist/clean-arch/infra/cache/clients/node-cache.d.ts +0 -0
- package/dist/clean-arch/infra/cache/clients/node-cache.js +1 -0
- package/dist/clean-arch/infra/cache/clients/redis.d.ts +0 -0
- package/dist/clean-arch/infra/cache/clients/redis.js +2 -0
- package/dist/clean-arch/infra/environment/env.d.ts +2 -0
- package/dist/clean-arch/infra/environment/env.js +2 -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 +1 -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 +1 -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/orbit-http-client/orbit-axios-client/orbit-axios-client.d.ts +0 -0
- package/dist/clean-arch/infra/orbit-http-client/orbit-axios-client/orbit-axios-client.js +6 -9
- package/dist/clean-arch/infra/orbit-notification-client/discord-client.d.ts +0 -0
- package/dist/clean-arch/infra/orbit-notification-client/discord-client.js +1 -0
- package/dist/clean-arch/infra/queue/create-consumers.d.ts +0 -0
- package/dist/clean-arch/infra/queue/create-consumers.js +1 -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 +1 -0
- package/dist/clean-arch/infra/queue/queue-controller.d.ts +0 -0
- package/dist/clean-arch/infra/queue/queue-controller.js +1 -0
- package/dist/clean-arch/infra/queue/rabbitmq/amqp-lib.d.ts +0 -0
- package/dist/clean-arch/infra/queue/rabbitmq/amqp-lib.js +7 -2
- 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/infra/queue/worker.d.ts +0 -0
- package/dist/clean-arch/infra/queue/worker.js +4 -3
- package/dist/clean-arch/infra/validations/validation-http.d.ts +9 -0
- package/dist/clean-arch/infra/validations/validation-http.js +2 -0
- package/dist/clean-arch/infra/validations/zod/schemas/common-validation.d.ts +30 -0
- package/dist/clean-arch/infra/validations/zod/schemas/common-validation.js +19 -0
- package/dist/clean-arch/infra/validations/zod/validation-zod-error.d.ts +10 -0
- package/dist/clean-arch/infra/validations/zod/validation-zod-error.js +70 -0
- package/dist/clean-arch/infra/validations/zod/validation-zod.d.ts +15 -0
- package/dist/clean-arch/infra/validations/zod/validation-zod.js +55 -0
- package/dist/clean-arch/infra/validations/zod/validation-zod.spec.d.ts +1 -0
- package/dist/clean-arch/infra/validations/zod/validation-zod.spec.js +436 -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 +2 -2
- 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 +2 -2
- 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 +1 -0
- package/dist/frameworks/nest/authorizations/not-allowed-nest.d.ts +2 -2
- package/dist/frameworks/nest/authorizations/not-allowed-nest.js +1 -0
- package/dist/frameworks/nest/errors/orbit-error.d.ts +0 -0
- package/dist/frameworks/nest/errors/orbit-error.js +0 -0
- package/dist/frameworks/nest/exception-filters/orbit-exception-filter.d.ts +0 -0
- package/dist/frameworks/nest/exception-filters/orbit-exception-filter.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 +2 -2
- package/dist/infra/authorizations/validator/api/api-validator.js +1 -0
- package/dist/infra/authorizations/validator/api/factories/unauthorized-response-factory.d.ts +2 -2
- 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 +2 -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 +1 -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 +18 -19
- package/dist/infra/http/errors/api-common-error.js +0 -0
- package/dist/infra/http/errors/api-error.d.ts +2 -2
- package/dist/infra/http/errors/api-error.js +2 -0
- package/dist/infra/http/errors/unauthorized-response.d.ts +1 -1
- package/dist/infra/http/errors/unauthorized-response.js +0 -0
- package/dist/static/address-types.d.ts +0 -0
- package/dist/static/address-types.js +0 -0
- package/dist/static/address-types.json +0 -0
- package/dist/static/cities.d.ts +0 -0
- package/dist/static/cities.js +0 -0
- package/dist/static/cities.json +0 -0
- package/dist/static/countries.d.ts +0 -0
- package/dist/static/countries.js +0 -0
- package/dist/static/countries.json +0 -0
- package/dist/static/ddd.d.ts +0 -0
- package/dist/static/ddd.js +0 -0
- package/dist/static/ddd.json +0 -0
- package/dist/static/states.d.ts +0 -0
- package/dist/static/states.js +0 -0
- package/dist/static/states.json +0 -0
- 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
|
-
|
|
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
|
-
|
|
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,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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/clean-arch/application/oribit-notification-client/orbit-notification-client.d.ts
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
|
|
@@ -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 || [];
|
|
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
|
|
@@ -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
|
}
|
|
File without changes
|
|
@@ -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;
|
|
File without changes
|
|
@@ -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;
|
|
File without changes
|
|
@@ -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)();
|
|
File without changes
|
|
@@ -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 {
|
|
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:
|
|
13
|
+
protected unauthorize(response: ErrorResponse): void;
|
|
14
14
|
protected getRequestId(): string;
|
|
15
15
|
protected handleAuthorized(): Promise<Response>;
|
|
16
16
|
protected getAuthorizationsHeader(): string;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiError } from '../../../infra/http/errors/api-error';
|
|
2
|
-
import {
|
|
2
|
+
import { ErrorResponse } from '../../../infra/http/errors/unauthorized-response';
|
|
3
3
|
export default class NotAllowedError extends ApiError {
|
|
4
|
-
constructor(input:
|
|
4
|
+
constructor(input: ErrorResponse);
|
|
5
5
|
}
|
|
File without changes
|
|
File without changes
|
|
@@ -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
|
|
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
|
|
@@ -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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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);
|
|
File without changes
|
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|