@atlantjs/backend 5.1.0 → 6.0.0
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 -8
- package/backend/application/databases/database-lite.config.js +7 -9
- package/backend/application/databases/database.config.js +18 -20
- package/backend/application/databases/database.helper.abstract.commit.failure.d.ts +2 -2
- package/backend/application/databases/database.helper.abstract.commit.failure.js +4 -8
- package/backend/application/databases/database.helper.abstract.d.ts +12 -12
- package/backend/application/databases/database.helper.abstract.delete.failure.d.ts +2 -2
- package/backend/application/databases/database.helper.abstract.delete.failure.js +5 -9
- package/backend/application/databases/database.helper.abstract.get-manager.failure.d.ts +2 -2
- package/backend/application/databases/database.helper.abstract.get-manager.failure.js +4 -8
- package/backend/application/databases/database.helper.abstract.js +51 -61
- package/backend/application/databases/database.helper.abstract.rollback.failure.d.ts +2 -2
- package/backend/application/databases/database.helper.abstract.rollback.failure.js +4 -8
- package/backend/application/databases/database.helper.abstract.write.failure.d.ts +2 -2
- package/backend/application/databases/database.helper.abstract.write.failure.js +4 -8
- package/backend/application/env/env-vars.js +19 -22
- package/backend/application/env/load-envs.js +8 -13
- package/backend/application/injections.abstract.js +9 -12
- package/backend/application/injections.abstract.type.js +1 -2
- package/backend/domain/commands/command.abstract.js +1 -5
- package/backend/domain/middlewares/middleware.handler.abstract.js +1 -5
- package/backend/domain/objects/edges/metadata.edge.d.ts +10 -0
- package/backend/domain/objects/edges/metadata.edge.js +21 -0
- package/backend/domain/objects/edges/metadata.polygon.d.ts +4 -0
- package/backend/domain/objects/edges/metadata.polygon.js +1 -0
- package/backend/domain/objects/face.abstract.d.ts +8 -0
- package/backend/domain/objects/face.abstract.js +2 -0
- package/backend/domain/objects/solid.abstract.d.ts +12 -0
- package/backend/domain/objects/solid.abstract.js +9 -0
- package/backend/domain/objects/vertices/vertex.abstract.d.ts +11 -0
- package/backend/domain/objects/vertices/vertex.abstract.js +9 -0
- package/backend/domain/providers/provider.abstract.js +1 -5
- package/backend/domain/repositories/repository.abstract.js +1 -5
- package/backend/domain/services/service.abstract.js +1 -5
- package/backend/infrastructure/controllers/controller.abstract.d.ts +3 -3
- package/backend/infrastructure/controllers/controller.abstract.js +6 -10
- package/backend/infrastructure/controllers/payloads/payload.abstract.js +1 -5
- package/backend/infrastructure/controllers/payloads/validators/validator.abstract.js +1 -5
- package/backend/infrastructure/controllers/responses/response.abstract.d.ts +1 -1
- package/backend/infrastructure/controllers/responses/response.abstract.js +1 -5
- package/backend/infrastructure/controllers/validators/is-time-string.js +4 -7
- package/index.d.ts +2 -2
- package/index.js +34 -137
- package/package.json +3 -5
- package/setup/dependency-injections/di-container.abstract.js +8 -12
- package/setup/dependency-injections/di-container.js +3 -6
- package/setup/dependency-injections/index.js +5 -10
- package/setup/index.js +12 -16
- package/setup/parchment/parchment.error.js +1 -5
- package/setup/parchment/parchment.js +18 -20
- package/setup/parchment/parchment.type.js +1 -2
- package/setup/server/body-parser-middleware.js +7 -16
- package/setup/server/cors-middleware.js +9 -15
- package/setup/server/default-error-handler-middleware.js +11 -18
- package/setup/server/server.js +28 -35
- package/setup/server/unknow.error.d.ts +1 -1
- package/setup/server/unknow.error.js +8 -10
- package/tsconfig.tsbuildinfo +1 -1
- package/backend/domain/entities/entity.abstract.d.ts +0 -9
- package/backend/domain/entities/entity.abstract.js +0 -11
- package/backend/infrastructure/repositories/schemas/schema.abstract.d.ts +0 -8
- package/backend/infrastructure/repositories/schemas/schema.abstract.js +0 -6
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const di_container_1 = require("./di-container");
|
|
6
|
-
const routing_controllers_1 = require("routing-controllers");
|
|
7
|
-
function startContainer() {
|
|
8
|
-
(0, routing_controllers_1.useContainer)(di_container_1.diContainer);
|
|
1
|
+
import { diContainer } from "./di-container";
|
|
2
|
+
import { useContainer } from "routing-controllers";
|
|
3
|
+
export function startContainer() {
|
|
4
|
+
useContainer(diContainer);
|
|
9
5
|
}
|
|
10
|
-
|
|
11
|
-
Object.defineProperty(exports, "diContainer", { enumerable: true, get: function () { return di_container_2.diContainer; } });
|
|
6
|
+
export { diContainer } from "./di-container";
|
package/setup/index.js
CHANGED
|
@@ -1,42 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const env_vars_1 = require("../backend/application/env/env-vars");
|
|
7
|
-
const dependency_injections_1 = require("./dependency-injections");
|
|
8
|
-
const server_1 = require("./server/server");
|
|
9
|
-
function initializeApi(props) {
|
|
1
|
+
import { _ } from "@atlantjs/arch";
|
|
2
|
+
import { LOAD_MODULES } from "../backend/application/env/env-vars";
|
|
3
|
+
import { diContainer, startContainer } from "./dependency-injections";
|
|
4
|
+
import { Server } from "./server/server";
|
|
5
|
+
export function initializeApi(props) {
|
|
10
6
|
try {
|
|
11
7
|
loadModules();
|
|
12
|
-
|
|
13
|
-
if (
|
|
8
|
+
startContainer();
|
|
9
|
+
if (_.isNotUndefined(props.databases)) {
|
|
14
10
|
Promise.all([
|
|
15
11
|
props.databases.map((database) => {
|
|
16
|
-
|
|
12
|
+
diContainer.bind(database.token).toConstantValue(database.target);
|
|
17
13
|
database.target.connect(new database.configs());
|
|
18
14
|
}),
|
|
19
15
|
]);
|
|
20
16
|
}
|
|
21
|
-
|
|
17
|
+
Server.initialize();
|
|
22
18
|
}
|
|
23
19
|
catch (error) {
|
|
24
20
|
console.error(`❌ Error occurred: ${error}`);
|
|
25
21
|
}
|
|
26
22
|
}
|
|
27
|
-
function synthesizePaths() {
|
|
23
|
+
export function synthesizePaths() {
|
|
28
24
|
const moduleAlias = require("module-alias");
|
|
29
25
|
const path = require("node:path");
|
|
30
26
|
moduleAlias.addAlias("#", path.join(__dirname, "../../../../src"));
|
|
31
27
|
moduleAlias.addAlias("!tests", path.join(__dirname, "../../../../tests"));
|
|
32
28
|
}
|
|
33
|
-
function loadModules(modules =
|
|
29
|
+
function loadModules(modules = LOAD_MODULES) {
|
|
34
30
|
let processedModules = modules;
|
|
35
31
|
if (typeof modules === "string") {
|
|
36
32
|
processedModules = modules
|
|
37
33
|
.split(",")
|
|
38
34
|
.map((x) => x.trim())
|
|
39
|
-
.filter((x) =>
|
|
35
|
+
.filter((x) => x.isFilled());
|
|
40
36
|
}
|
|
41
37
|
console.log("\n📦 Loading modules...");
|
|
42
38
|
for (const module of processedModules) {
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PickEnvError = void 0;
|
|
4
|
-
class PickEnvError extends Error {
|
|
1
|
+
export class PickEnvError extends Error {
|
|
5
2
|
constructor(variableName, variableDescription, messageError) {
|
|
6
3
|
super(`\n❯ ${process.env.ENVIRONMENT} - ${messageError}:\n\n - ${variableName}: ${variableDescription}`);
|
|
7
4
|
}
|
|
8
5
|
}
|
|
9
|
-
exports.PickEnvError = PickEnvError;
|
|
@@ -1,56 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const arch_1 = require("@atlantjs/arch");
|
|
5
|
-
const parchment_error_1 = require("./parchment.error");
|
|
6
|
-
class Parchment {
|
|
1
|
+
import { _ } from "@atlantjs/arch";
|
|
2
|
+
import { PickEnvError } from "./parchment.error";
|
|
3
|
+
export class Parchment {
|
|
7
4
|
static verse({ ...verse }) {
|
|
8
5
|
const setValue = process.env[verse.name] || verse.default?.toString();
|
|
9
|
-
if (
|
|
10
|
-
throw new
|
|
6
|
+
if (_.isNullOrUndefined(setValue) && verse.isRequired.truthy()) {
|
|
7
|
+
throw new PickEnvError(verse.name, verse.description, "The environment variable must have its value defined");
|
|
11
8
|
}
|
|
12
9
|
return Parchment.convertSetValue(verse, setValue);
|
|
13
10
|
}
|
|
14
11
|
static convertSetValue(verse, value) {
|
|
15
|
-
if (
|
|
12
|
+
if (_.isUndefined(value)) {
|
|
16
13
|
return undefined;
|
|
17
14
|
}
|
|
18
15
|
if (verse.type === "array") {
|
|
19
16
|
return value.split(",");
|
|
20
17
|
}
|
|
21
18
|
if (verse.type === "boolean") {
|
|
22
|
-
if (
|
|
23
|
-
throw new
|
|
19
|
+
if (_.isAnyOf(value, ["false", "true"]).falsy()) {
|
|
20
|
+
throw new PickEnvError(verse.name, verse.description, `The value of the environment variable ${value} must be "false" or "true"`);
|
|
24
21
|
}
|
|
25
|
-
return
|
|
22
|
+
return _.isEqual(value, "true");
|
|
26
23
|
}
|
|
27
24
|
if (verse.type === "enum") {
|
|
28
|
-
if (
|
|
29
|
-
throw new
|
|
25
|
+
if (_.isUndefined(verse.values)) {
|
|
26
|
+
throw new PickEnvError(verse.name, verse.description, `A definição da variável de ambiente ${verse.name} deve conter os valores de referencia`);
|
|
30
27
|
}
|
|
31
28
|
if (verse.values.includes(value).falsy()) {
|
|
32
|
-
throw new
|
|
29
|
+
throw new PickEnvError(verse.name, verse.description, `A variável ${verse.name} deve conter algum dos seguintes valores: [${verse.values.join(", ")}]`);
|
|
33
30
|
}
|
|
34
31
|
return value;
|
|
35
32
|
}
|
|
36
33
|
if (verse.type === "float") {
|
|
37
34
|
const floatValue = Number.parseFloat(value);
|
|
38
35
|
if (Number.isNaN(floatValue)) {
|
|
39
|
-
throw new
|
|
36
|
+
throw new PickEnvError(verse.name, verse.description, `The value of the environment variable ${verse.name} must be a valid float number`);
|
|
40
37
|
}
|
|
41
38
|
return floatValue;
|
|
42
39
|
}
|
|
43
40
|
if (verse.type === "int") {
|
|
44
41
|
const intValue = Number.parseInt(value, 10);
|
|
45
42
|
if (Number.isNaN(intValue)) {
|
|
46
|
-
throw new
|
|
43
|
+
throw new PickEnvError(verse.name, verse.description, `O valor da variável de ambiente ${verse.name} deve ser um número inteiro válido`);
|
|
47
44
|
}
|
|
48
45
|
return intValue;
|
|
49
46
|
}
|
|
50
47
|
if (verse.type === "port-number") {
|
|
51
48
|
const portNumber = Number.parseInt(value, 10);
|
|
52
49
|
if (Number.isNaN(portNumber) || portNumber < 1 || portNumber > 65535) {
|
|
53
|
-
throw new
|
|
50
|
+
throw new PickEnvError(verse.name, verse.description, `O valor da variável de ambiente ${verse.name} deve ser um número de porta válido entre 1 e 65535`);
|
|
54
51
|
}
|
|
55
52
|
return portNumber;
|
|
56
53
|
}
|
|
@@ -60,10 +57,11 @@ class Parchment {
|
|
|
60
57
|
if (verse.type === "url-https") {
|
|
61
58
|
const urlPattern = /^https?:\/\/[^\s/$.?#].[^\s]*$/i;
|
|
62
59
|
if (!urlPattern.test(value)) {
|
|
63
|
-
throw new
|
|
60
|
+
throw new PickEnvError(verse.name, verse.description, `O valor da variável de ambiente ${verse.name} deve ser uma URL válida começando com http ou https`);
|
|
64
61
|
}
|
|
65
62
|
return value;
|
|
66
63
|
}
|
|
64
|
+
// If none of the types matched, return undefined
|
|
65
|
+
return undefined;
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
|
-
exports.Parchment = Parchment;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class BodyParserMiddleware {
|
|
9
|
-
constructor() {
|
|
10
|
-
this.plainTextEndpoints = ["/encrypted-webhook/notification"];
|
|
11
|
-
this.bodyParserJson = body_parser_1.default.json({ limit: "50mb" });
|
|
12
|
-
this.bodyParserText = body_parser_1.default.text({
|
|
13
|
-
type: () => true,
|
|
14
|
-
});
|
|
15
|
-
}
|
|
1
|
+
import bodyParser from "body-parser";
|
|
2
|
+
export class BodyParserMiddleware {
|
|
3
|
+
plainTextEndpoints = ["/encrypted-webhook/notification"];
|
|
4
|
+
bodyParserJson = bodyParser.json({ limit: "50mb" });
|
|
5
|
+
bodyParserText = bodyParser.text({
|
|
6
|
+
type: () => true,
|
|
7
|
+
});
|
|
16
8
|
static create() {
|
|
17
9
|
const middleware = new BodyParserMiddleware();
|
|
18
10
|
return (request, response, next) => middleware.use(request, response, next);
|
|
@@ -28,4 +20,3 @@ class BodyParserMiddleware {
|
|
|
28
20
|
return this.plainTextEndpoints.some((endpoint) => url.startsWith(endpoint));
|
|
29
21
|
}
|
|
30
22
|
}
|
|
31
|
-
exports.BodyParserMiddleware = BodyParserMiddleware;
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class CorsMiddleware {
|
|
1
|
+
import { CORS_ALLOWED_ORIGINS } from "../../backend/application/env/env-vars";
|
|
2
|
+
import cors from "cors";
|
|
3
|
+
export class CorsMiddleware {
|
|
4
|
+
corsSpecs;
|
|
5
|
+
cors = cors({
|
|
6
|
+
origin: this.parseCorsAllowedOrigins(),
|
|
7
|
+
credentials: true,
|
|
8
|
+
});
|
|
10
9
|
constructor(corsSpecs) {
|
|
11
10
|
this.corsSpecs = corsSpecs;
|
|
12
|
-
this.cors = (0, cors_1.default)({
|
|
13
|
-
origin: this.parseCorsAllowedOrigins(),
|
|
14
|
-
credentials: true,
|
|
15
|
-
});
|
|
16
11
|
}
|
|
17
|
-
static create(corsSpecs =
|
|
12
|
+
static create(corsSpecs = CORS_ALLOWED_ORIGINS) {
|
|
18
13
|
const middleware = new CorsMiddleware(corsSpecs);
|
|
19
14
|
return (request, response, next) => middleware.use(request, response, next);
|
|
20
15
|
}
|
|
@@ -35,4 +30,3 @@ class CorsMiddleware {
|
|
|
35
30
|
return new RegExp(pattern, flags);
|
|
36
31
|
}
|
|
37
32
|
}
|
|
38
|
-
exports.CorsMiddleware = CorsMiddleware;
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
exports.DefaultErrorHandlerMiddleware = void 0;
|
|
7
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
-
const routing_controllers_1 = require("routing-controllers");
|
|
9
|
-
const arch_1 = require("@atlantjs/arch");
|
|
10
|
-
const unknow_error_1 = require("./unknow.error");
|
|
11
|
-
class DefaultErrorHandlerMiddleware {
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import { HttpError } from "routing-controllers";
|
|
3
|
+
import { HttpStatusCodes } from "@atlantjs/arch";
|
|
4
|
+
import { UnknownError } from "./unknow.error";
|
|
5
|
+
export class DefaultErrorHandlerMiddleware {
|
|
12
6
|
static create() {
|
|
13
7
|
const middleware = new DefaultErrorHandlerMiddleware();
|
|
14
8
|
return (error, req, res, next) => middleware.use(error, req, res, next);
|
|
@@ -21,22 +15,22 @@ class DefaultErrorHandlerMiddleware {
|
|
|
21
15
|
this.handleError(error, res);
|
|
22
16
|
}
|
|
23
17
|
handleError(error, res) {
|
|
24
|
-
if (!(error instanceof
|
|
18
|
+
if (!(error instanceof HttpError)) {
|
|
25
19
|
this.handleExceptions(error, res);
|
|
26
20
|
return;
|
|
27
21
|
}
|
|
28
|
-
if (error.httpCode <
|
|
29
|
-
res.status(error.httpCode).send(
|
|
22
|
+
if (error.httpCode < HttpStatusCodes.INTERNAL_SERVER_ERROR) {
|
|
23
|
+
res.status(error.httpCode).send(_.omit(error, "httpCode", "stack"));
|
|
30
24
|
return;
|
|
31
25
|
}
|
|
32
26
|
res.status(error.httpCode).send({
|
|
33
|
-
code:
|
|
34
|
-
message:
|
|
27
|
+
code: HttpStatusCodes[error.httpCode].toLocaleLowerCase(),
|
|
28
|
+
message: HttpStatusCodes[error.httpCode],
|
|
35
29
|
});
|
|
36
30
|
}
|
|
37
31
|
handleExceptions(error, res) {
|
|
38
32
|
this.logUnhandledError(error);
|
|
39
|
-
res.status(
|
|
33
|
+
res.status(HttpStatusCodes.INTERNAL_SERVER_ERROR).send(new UnknownError({
|
|
40
34
|
code: "internal_error",
|
|
41
35
|
message: "Internal server error",
|
|
42
36
|
}));
|
|
@@ -47,4 +41,3 @@ class DefaultErrorHandlerMiddleware {
|
|
|
47
41
|
});
|
|
48
42
|
}
|
|
49
43
|
}
|
|
50
|
-
exports.DefaultErrorHandlerMiddleware = DefaultErrorHandlerMiddleware;
|
package/setup/server/server.js
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const helmet_1 = __importDefault(require("helmet"));
|
|
11
|
-
const routing_controllers_1 = require("routing-controllers");
|
|
12
|
-
const env_vars_1 = require("../../backend/application/env/env-vars");
|
|
13
|
-
const body_parser_middleware_1 = require("./body-parser-middleware");
|
|
14
|
-
const cors_middleware_1 = require("./cors-middleware");
|
|
15
|
-
const default_error_handler_middleware_1 = require("./default-error-handler-middleware");
|
|
1
|
+
import { NodeEnvs, _ } from "@atlantjs/arch";
|
|
2
|
+
import cookieParser from "cookie-parser";
|
|
3
|
+
import express from "express";
|
|
4
|
+
import helmet from "helmet";
|
|
5
|
+
import { useExpressServer, } from "routing-controllers";
|
|
6
|
+
import { APP_PORT, ENVIRONMENT } from "../../backend/application/env/env-vars";
|
|
7
|
+
import { BodyParserMiddleware } from "./body-parser-middleware";
|
|
8
|
+
import { CorsMiddleware } from "./cors-middleware";
|
|
9
|
+
import { DefaultErrorHandlerMiddleware } from "./default-error-handler-middleware";
|
|
16
10
|
var LogMessage;
|
|
17
11
|
(function (LogMessage) {
|
|
18
12
|
LogMessage["$start_server"] = "\n\uD83D\uDDA5\uFE0F Starting server...";
|
|
@@ -21,20 +15,29 @@ var LogMessage;
|
|
|
21
15
|
LogMessage["$line"] = "========================================";
|
|
22
16
|
LogMessage["$development_message"] = "\uD83D\uDE80 You are in the development environment\n Ready to code!";
|
|
23
17
|
})(LogMessage || (LogMessage = {}));
|
|
24
|
-
class Server {
|
|
18
|
+
export class Server {
|
|
19
|
+
static instance = express();
|
|
20
|
+
static routingOptions = {
|
|
21
|
+
validation: true,
|
|
22
|
+
classTransformer: true,
|
|
23
|
+
plainToClassTransformOptions: {
|
|
24
|
+
enableImplicitConversion: false,
|
|
25
|
+
},
|
|
26
|
+
defaultErrorHandler: true,
|
|
27
|
+
};
|
|
25
28
|
static initialize() {
|
|
26
29
|
Server.instance.disable("x-powered-by");
|
|
27
30
|
Server.instance.set("trust proxy", ["uniquelocal", "loopback"]);
|
|
28
|
-
Server.instance.use((
|
|
29
|
-
Server.instance.use(
|
|
30
|
-
Server.instance.use((
|
|
31
|
-
Server.instance.use(
|
|
32
|
-
Server.instance.use(
|
|
33
|
-
|
|
31
|
+
Server.instance.use(helmet());
|
|
32
|
+
Server.instance.use(CorsMiddleware.create());
|
|
33
|
+
Server.instance.use(cookieParser());
|
|
34
|
+
Server.instance.use(BodyParserMiddleware.create());
|
|
35
|
+
Server.instance.use(DefaultErrorHandlerMiddleware.create());
|
|
36
|
+
useExpressServer(Server.instance, Server.routingOptions);
|
|
34
37
|
console.info(LogMessage.$start_server);
|
|
35
|
-
Server.instance.listen(
|
|
36
|
-
console.info(LogMessage.$started_server +
|
|
37
|
-
if (
|
|
38
|
+
Server.instance.listen(APP_PORT, () => {
|
|
39
|
+
console.info(LogMessage.$started_server + APP_PORT);
|
|
40
|
+
if (_.isEqual(ENVIRONMENT, NodeEnvs.development)) {
|
|
38
41
|
Server.logFooterDevelopmentMessage();
|
|
39
42
|
}
|
|
40
43
|
});
|
|
@@ -46,13 +49,3 @@ class Server {
|
|
|
46
49
|
console.info(LogMessage.$line);
|
|
47
50
|
}
|
|
48
51
|
}
|
|
49
|
-
exports.Server = Server;
|
|
50
|
-
Server.instance = (0, express_1.default)();
|
|
51
|
-
Server.routingOptions = {
|
|
52
|
-
validation: true,
|
|
53
|
-
classTransformer: true,
|
|
54
|
-
plainToClassTransformOptions: {
|
|
55
|
-
enableImplicitConversion: false,
|
|
56
|
-
},
|
|
57
|
-
defaultErrorHandler: true,
|
|
58
|
-
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,24 +7,23 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
import { Expose, instanceToPlain } from "class-transformer";
|
|
11
|
+
export class UnknownError {
|
|
12
|
+
unknownCode;
|
|
13
|
+
unknownMessage;
|
|
15
14
|
constructor(error) {
|
|
16
15
|
this.unknownCode = error.code;
|
|
17
16
|
this.unknownMessage = error.message;
|
|
18
17
|
}
|
|
19
|
-
|
|
20
|
-
return
|
|
18
|
+
toPolygon() {
|
|
19
|
+
return instanceToPlain(this);
|
|
21
20
|
}
|
|
22
21
|
}
|
|
23
|
-
exports.UnknownError = UnknownError;
|
|
24
22
|
__decorate([
|
|
25
|
-
|
|
23
|
+
Expose(),
|
|
26
24
|
__metadata("design:type", String)
|
|
27
25
|
], UnknownError.prototype, "unknownCode", void 0);
|
|
28
26
|
__decorate([
|
|
29
|
-
|
|
27
|
+
Expose(),
|
|
30
28
|
__metadata("design:type", String)
|
|
31
29
|
], UnknownError.prototype, "unknownMessage", void 0);
|