@atlantjs/backend 7.1.5 → 7.1.7
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/backend/application/envs/env-vars.d.ts +2 -2
- package/backend/application/envs/env-vars.js +4 -4
- package/backend/application/envs/load-envs.js +2 -2
- package/backend/infrastructure/controllers/controller-response.abstract.d.ts +3 -4
- package/index.d.ts +0 -2
- package/index.js +1 -5
- package/package.json +4 -4
- package/setup/server/server.js +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/backend/infrastructure/controllers/payloads/payload.abstract.d.ts +0 -2
- package/backend/infrastructure/controllers/payloads/payload.abstract.js +0 -6
- package/backend/infrastructure/controllers/responses/response.abstract.d.ts +0 -2
- package/backend/infrastructure/controllers/responses/response.abstract.js +0 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EnvironmentPoint } from "@atlantjs/arch";
|
|
2
2
|
export declare const APP_PORT: number;
|
|
3
3
|
export declare const LOAD_MODULES: string[];
|
|
4
4
|
export declare const CORS_ALLOWED_ORIGINS: string;
|
|
5
|
-
export declare const ENVIRONMENT:
|
|
5
|
+
export declare const ENVIRONMENT: EnvironmentPoint;
|
|
@@ -27,10 +27,10 @@ exports.ENVIRONMENT = parchment_1.Parchment.verse({
|
|
|
27
27
|
type: "enum",
|
|
28
28
|
isRequired: true,
|
|
29
29
|
values: [
|
|
30
|
-
arch_1.
|
|
31
|
-
arch_1.
|
|
32
|
-
arch_1.
|
|
33
|
-
arch_1.
|
|
30
|
+
arch_1.EnvironmentPoint.test,
|
|
31
|
+
arch_1.EnvironmentPoint.development,
|
|
32
|
+
arch_1.EnvironmentPoint.production,
|
|
33
|
+
arch_1.EnvironmentPoint.homolog,
|
|
34
34
|
],
|
|
35
35
|
description: "The current environment in which the application is running",
|
|
36
36
|
});
|
|
@@ -37,8 +37,8 @@ const fs = __importStar(require("node:fs"));
|
|
|
37
37
|
const path = __importStar(require("node:path"));
|
|
38
38
|
const arch_1 = require("@atlantjs/arch");
|
|
39
39
|
const dotenv = __importStar(require("dotenv"));
|
|
40
|
-
const envFilePath = path.join(__dirname, "..", "..", "..", "..", "..", "..", process.env.ENVIRONMENT === arch_1.
|
|
40
|
+
const envFilePath = path.join(__dirname, "..", "..", "..", "..", "..", "..", process.env.ENVIRONMENT === arch_1.EnvironmentPoint.test ? ".env.test" : ".env");
|
|
41
41
|
if (!fs.existsSync(envFilePath)) {
|
|
42
|
-
console.error(`The ${process.env.ENVIRONMENT === arch_1.
|
|
42
|
+
console.error(`The ${process.env.ENVIRONMENT === arch_1.EnvironmentPoint.test ? ".env.test" : ".env"} file is missing with the variables and their values`);
|
|
43
43
|
}
|
|
44
44
|
dotenv.config({ path: envFilePath });
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { HttpStatusCodes } from "@atlantjs/arch";
|
|
2
|
-
import { ResponseAbstract } from "./responses/response.abstract";
|
|
1
|
+
import { HttpStatusCodes, ResponseAbstract } from "@atlantjs/arch";
|
|
3
2
|
type InstanceOf<T> = T extends new (...args: any[]) => infer I ? I : T;
|
|
4
3
|
type Primitive = string | number | boolean | bigint | symbol | null | undefined;
|
|
5
|
-
type Plainify<T> = T extends Primitive ? T : T extends Date ? string : T extends Array<infer U> ? Plainify<U>[] : T extends (...args: any[]) => any ?
|
|
6
|
-
[K in keyof T]: Plainify<T[K]>;
|
|
4
|
+
type Plainify<T> = T extends Primitive ? T : T extends Date ? string : T extends Array<infer U> ? Plainify<U>[] : T extends (...args: any[]) => any ? never : T extends object ? {
|
|
5
|
+
[K in keyof T as T[K] extends (...args: any[]) => any ? never : K]: Plainify<T[K]>;
|
|
7
6
|
} : T;
|
|
8
7
|
export declare class ControllerResponse<T extends ResponseAbstract | (new (...args: any[]) => ResponseAbstract) = ResponseAbstract> {
|
|
9
8
|
protected _statusCode: HttpStatusCodes;
|
package/index.d.ts
CHANGED
|
@@ -10,9 +10,7 @@ export { RepositoryAbstract } from "./backend/domain/repositories/repository.abs
|
|
|
10
10
|
export { ServiceAbstract } from "./backend/domain/services/service.abstract";
|
|
11
11
|
export { CommandAbstract } from "./backend/domain/commands/command.abstract";
|
|
12
12
|
export { ControllerAbstract } from "./backend/infrastructure/controllers/controller.abstract";
|
|
13
|
-
export { PayloadAbstract } from "./backend/infrastructure/controllers/payloads/payload.abstract";
|
|
14
13
|
export { ValidatorAbstract } from "./backend/infrastructure/controllers/payloads/validators/validator.abstract";
|
|
15
|
-
export { ResponseAbstract } from "./backend/infrastructure/controllers/responses/response.abstract";
|
|
16
14
|
export { startContainer, diContainer } from "./setup/dependency-injections";
|
|
17
15
|
export { DiContainerAbstract } from "./setup/dependency-injections/di-container.abstract";
|
|
18
16
|
export { BodyParserMiddleware } from "./setup/server/body-parser-middleware";
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ControllerResponse = exports.InjectionsAbstract = exports.initializeApi = exports.injectable = exports.inject = exports.Container = exports.Server = exports.DefaultErrorHandlerMiddleware = exports.CorsMiddleware = exports.BodyParserMiddleware = exports.DiContainerAbstract = exports.diContainer = exports.startContainer = exports.
|
|
3
|
+
exports.ControllerResponse = exports.InjectionsAbstract = exports.initializeApi = exports.injectable = exports.inject = exports.Container = exports.Server = exports.DefaultErrorHandlerMiddleware = exports.CorsMiddleware = exports.BodyParserMiddleware = exports.DiContainerAbstract = exports.diContainer = exports.startContainer = exports.ValidatorAbstract = exports.ControllerAbstract = exports.CommandAbstract = exports.ServiceAbstract = exports.RepositoryAbstract = exports.ProviderAbstract = exports.MiddlewareHandlerAbstract = exports.BeforeUpdate = exports.BeforeInsert = exports.ManyToMany = exports.OneToOne = exports.OneToMany = exports.ManyToOne = exports.JoinColumn = exports.Entity = exports.Column = exports.PrimaryColumn = exports.ENVIRONMENT = exports.CORS_ALLOWED_ORIGINS = exports.LOAD_MODULES = exports.APP_PORT = exports.Params = exports.Param = exports.Req = exports.Body = exports.Res = exports.JsonController = exports.UseBefore = exports.Patch = exports.Delete = exports.Post = exports.Get = exports.getFromContainer = void 0;
|
|
4
4
|
require("./backend/application/envs/load-envs");
|
|
5
5
|
require("reflect-metadata");
|
|
6
6
|
const setup_1 = require("./setup");
|
|
@@ -46,12 +46,8 @@ var command_abstract_1 = require("./backend/domain/commands/command.abstract");
|
|
|
46
46
|
Object.defineProperty(exports, "CommandAbstract", { enumerable: true, get: function () { return command_abstract_1.CommandAbstract; } });
|
|
47
47
|
var controller_abstract_1 = require("./backend/infrastructure/controllers/controller.abstract");
|
|
48
48
|
Object.defineProperty(exports, "ControllerAbstract", { enumerable: true, get: function () { return controller_abstract_1.ControllerAbstract; } });
|
|
49
|
-
var payload_abstract_1 = require("./backend/infrastructure/controllers/payloads/payload.abstract");
|
|
50
|
-
Object.defineProperty(exports, "PayloadAbstract", { enumerable: true, get: function () { return payload_abstract_1.PayloadAbstract; } });
|
|
51
49
|
var validator_abstract_1 = require("./backend/infrastructure/controllers/payloads/validators/validator.abstract");
|
|
52
50
|
Object.defineProperty(exports, "ValidatorAbstract", { enumerable: true, get: function () { return validator_abstract_1.ValidatorAbstract; } });
|
|
53
|
-
var response_abstract_1 = require("./backend/infrastructure/controllers/responses/response.abstract");
|
|
54
|
-
Object.defineProperty(exports, "ResponseAbstract", { enumerable: true, get: function () { return response_abstract_1.ResponseAbstract; } });
|
|
55
51
|
var dependency_injections_1 = require("./setup/dependency-injections");
|
|
56
52
|
Object.defineProperty(exports, "startContainer", { enumerable: true, get: function () { return dependency_injections_1.startContainer; } });
|
|
57
53
|
Object.defineProperty(exports, "diContainer", { enumerable: true, get: function () { return dependency_injections_1.diContainer; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlantjs/backend",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.7",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"publishConfig": {
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"test:unit:cov": "yarn test:unit --coverage --runInBand"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@atlantjs/arch": "11.
|
|
32
|
-
"@atlantjs/database": "1.0.
|
|
33
|
-
"@atlantjs/parchment": "1.0.
|
|
31
|
+
"@atlantjs/arch": "11.2.0",
|
|
32
|
+
"@atlantjs/database": "1.0.15",
|
|
33
|
+
"@atlantjs/parchment": "1.0.8",
|
|
34
34
|
"body-parser": "1.20.2",
|
|
35
35
|
"class-transformer": "0.5.1",
|
|
36
36
|
"class-validator": "0.14.1",
|
package/setup/server/server.js
CHANGED
|
@@ -34,7 +34,7 @@ class Server {
|
|
|
34
34
|
console.info(LogMessage.$start_server);
|
|
35
35
|
Server.instance.listen(env_vars_1.APP_PORT, () => {
|
|
36
36
|
console.info(LogMessage.$started_server + env_vars_1.APP_PORT);
|
|
37
|
-
if (arch_1._.isEqual(env_vars_1.ENVIRONMENT, arch_1.
|
|
37
|
+
if (arch_1._.isEqual(env_vars_1.ENVIRONMENT, arch_1.EnvironmentPoint.development)) {
|
|
38
38
|
Server.logFooterDevelopmentMessage();
|
|
39
39
|
}
|
|
40
40
|
});
|