@atlantjs/backend 4.0.27 → 4.0.29
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/databases/database-lite.config.d.ts +2 -3
- package/backend/application/databases/database-lite.config.js +4 -5
- package/backend/application/databases/database.config.d.ts +4 -5
- package/backend/application/databases/database.config.js +5 -4
- package/backend/application/env/env-vars.d.ts +1 -1
- package/backend/application/env/env-vars.js +8 -4
- package/index.d.ts +1 -1
- package/index.js +3 -2
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -3,9 +3,8 @@ interface DatabaseLiteConfigProps {
|
|
|
3
3
|
type: DatabaseType;
|
|
4
4
|
binaryFilePath: string;
|
|
5
5
|
accessKey: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
migrations?: string[];
|
|
6
|
+
schemas: string[];
|
|
7
|
+
migrations: string[];
|
|
9
8
|
}
|
|
10
9
|
export declare abstract class DatabaseLiteConfigAbstract {
|
|
11
10
|
private readonly props;
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DatabaseLiteConfigAbstract = void 0;
|
|
4
|
-
const env_vars_1 = require("../env/env-vars");
|
|
5
|
-
const arch_1 = require("@atlantjs/arch");
|
|
6
4
|
const typeorm_1 = require("typeorm");
|
|
5
|
+
const env_vars_1 = require("../env/env-vars");
|
|
7
6
|
class DatabaseLiteConfigAbstract {
|
|
8
7
|
constructor(props) {
|
|
9
8
|
this.props = props;
|
|
10
9
|
const baseConfig = {
|
|
11
10
|
type: this.props.type,
|
|
12
11
|
database: this.props.binaryFilePath,
|
|
13
|
-
synchronize:
|
|
12
|
+
synchronize: env_vars_1.DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED,
|
|
14
13
|
extra: {
|
|
15
14
|
cipher: "aes-256-cbc",
|
|
16
15
|
key: props.accessKey,
|
|
17
16
|
},
|
|
18
|
-
entities:
|
|
19
|
-
migrations:
|
|
17
|
+
entities: props.schemas,
|
|
18
|
+
migrations: props.migrations,
|
|
20
19
|
};
|
|
21
20
|
this.configs = new typeorm_1.DataSource(baseConfig);
|
|
22
21
|
}
|
|
@@ -5,11 +5,10 @@ interface DatabaseConfigProps {
|
|
|
5
5
|
port: number;
|
|
6
6
|
username: string;
|
|
7
7
|
password: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
migrations?: string[];
|
|
8
|
+
databaseName: string;
|
|
9
|
+
databaseSchemaName: string;
|
|
10
|
+
schemas: string[];
|
|
11
|
+
migrations: string[];
|
|
13
12
|
region?: string;
|
|
14
13
|
secretArn?: string;
|
|
15
14
|
resourceArn?: string;
|
|
@@ -21,10 +21,11 @@ class DatabaseConfigAbstract {
|
|
|
21
21
|
port: this.props.port,
|
|
22
22
|
username: this.props.username,
|
|
23
23
|
password: this.props.password,
|
|
24
|
-
database: this.props.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
database: this.props.databaseName,
|
|
25
|
+
schema: this.props.databaseSchemaName,
|
|
26
|
+
synchronize: env_vars_1.DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED,
|
|
27
|
+
entities: this.props.schemas,
|
|
28
|
+
migrations: this.props.migrations,
|
|
28
29
|
};
|
|
29
30
|
if (arch_1._.isEqual(this.props.type, "aurora-mysql")) {
|
|
30
31
|
Object.assign(baseConfig, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NodeEnvs } from "@atlantjs/arch";
|
|
2
2
|
export declare const APP_PORT: string;
|
|
3
|
+
export declare const DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED: boolean;
|
|
3
4
|
export declare const DATABASE_SSL_ENABLED: boolean;
|
|
4
5
|
export declare const LOAD_MODULES: string;
|
|
5
6
|
export declare const CORS_ALLOWED_ORIGINS: string;
|
|
6
7
|
export declare const ENVIRONMENT: NodeEnvs;
|
|
7
|
-
export declare const isProdOrHomolog: () => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ENVIRONMENT = exports.CORS_ALLOWED_ORIGINS = exports.LOAD_MODULES = exports.DATABASE_SSL_ENABLED = exports.DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED = exports.APP_PORT = void 0;
|
|
4
4
|
const arch_1 = require("@atlantjs/arch");
|
|
5
5
|
const env_var_1 = require("../../../setup/env-var");
|
|
6
6
|
exports.APP_PORT = env_var_1.EnvVar.get({
|
|
@@ -8,8 +8,14 @@ exports.APP_PORT = env_var_1.EnvVar.get({
|
|
|
8
8
|
type: "port-number",
|
|
9
9
|
description: "The port number on which the application will run",
|
|
10
10
|
});
|
|
11
|
+
exports.DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED = env_var_1.EnvVar.get({
|
|
12
|
+
isRequired: true,
|
|
13
|
+
name: "DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED",
|
|
14
|
+
type: "boolean",
|
|
15
|
+
description: "Flag indicating whether the ORM automatically creates tables in the database based on .schema.ts files",
|
|
16
|
+
});
|
|
11
17
|
exports.DATABASE_SSL_ENABLED = env_var_1.EnvVar.get({
|
|
12
|
-
isRequired:
|
|
18
|
+
isRequired: true,
|
|
13
19
|
name: "DATABASE_SSL_ENABLED",
|
|
14
20
|
type: "boolean",
|
|
15
21
|
description: "Flag indicating whether the database requires an SSL connection",
|
|
@@ -36,5 +42,3 @@ exports.ENVIRONMENT = env_var_1.EnvVar.get({
|
|
|
36
42
|
],
|
|
37
43
|
description: "The current environment in which the application is running",
|
|
38
44
|
});
|
|
39
|
-
const isProdOrHomolog = () => [arch_1.NodeEnvs.homolog, arch_1.NodeEnvs.production].includes(exports.ENVIRONMENT);
|
|
40
|
-
exports.isProdOrHomolog = isProdOrHomolog;
|
package/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { Type as IsPayload } from "class-transformer";
|
|
|
8
8
|
export { IsTimeString } from "./backend/infrastructure/controllers/validators/is-time-string";
|
|
9
9
|
export { DatabaseConfigAbstract } from "./backend/application/databases/database.config";
|
|
10
10
|
export { DatabaseHelperAbstract } from "./backend/application/databases/database.helper.abstract";
|
|
11
|
-
export { APP_PORT, LOAD_MODULES, CORS_ALLOWED_ORIGINS, ENVIRONMENT,
|
|
11
|
+
export { APP_PORT, LOAD_MODULES, CORS_ALLOWED_ORIGINS, ENVIRONMENT, DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED, DATABASE_SSL_ENABLED, } from "./backend/application/env/env-vars";
|
|
12
12
|
export { EnvVar } from "./setup/env-var";
|
|
13
13
|
export { InjectionsAbstract } from "./backend/application/injections.abstract";
|
|
14
14
|
export { PrimaryColumn, Column, Entity, JoinColumn, ManyToOne, OneToMany, OneToOne, ManyToMany, BeforeInsert, BeforeUpdate, } from "typeorm";
|
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DatabaseConfigAbstract = exports.IsTimeString = exports.IsPayload = exports.registerDecorator = exports.IsNotEmptyObject = exports.IsDateString = exports.IsObject = exports.IsArray = exports.IsString = exports.IsInt = exports.IsEnum = exports.IsNumber = exports.IsDate = exports.IsBoolean = exports.IsNumberString = exports.IsUrl = exports.IsUUID = exports.IsJWT = exports.IsJSON = exports.IsPort = exports.IsIP = exports.IsCurrency = exports.IsEmail = exports.IsBase64 = exports.IsDecimal = exports.MaxDate = exports.MinDate = exports.Min = exports.Max = exports.IsNegative = exports.IsPositive = exports.IsNotEmpty = exports.IsEmpty = exports.IsLongitude = exports.IsLatitude = exports.IsLatLong = exports.ValidateInner = exports.IsOptional = 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
|
-
exports.initializeApi = exports.DatabaseLiteConfigAbstract = exports.injectable = exports.inject = exports.Container = exports.Server = exports.DefaultErrorHandlerMiddleware = exports.CorsMiddleware = exports.BodyParserMiddleware = exports.DiContainerAbstract = exports.diContainer = exports.startContainer = exports.SchemaAbstract = exports.ResponseAbstract = exports.ValidatorAbstract = exports.PayloadAbstract = exports.ControllerAbstract = exports.CommandAbstract = exports.ServiceAbstract = exports.RepositoryAbstract = exports.ProviderAbstract = exports.MiddlewareHandlerAbstract = exports.EntityAbstract = exports.BeforeUpdate = exports.BeforeInsert = exports.ManyToMany = exports.OneToOne = exports.OneToMany = exports.ManyToOne = exports.JoinColumn = exports.Entity = exports.Column = exports.PrimaryColumn = exports.InjectionsAbstract = exports.EnvVar = exports.
|
|
4
|
+
exports.initializeApi = exports.DatabaseLiteConfigAbstract = exports.injectable = exports.inject = exports.Container = exports.Server = exports.DefaultErrorHandlerMiddleware = exports.CorsMiddleware = exports.BodyParserMiddleware = exports.DiContainerAbstract = exports.diContainer = exports.startContainer = exports.SchemaAbstract = exports.ResponseAbstract = exports.ValidatorAbstract = exports.PayloadAbstract = exports.ControllerAbstract = exports.CommandAbstract = exports.ServiceAbstract = exports.RepositoryAbstract = exports.ProviderAbstract = exports.MiddlewareHandlerAbstract = exports.EntityAbstract = exports.BeforeUpdate = exports.BeforeInsert = exports.ManyToMany = exports.OneToOne = exports.OneToMany = exports.ManyToOne = exports.JoinColumn = exports.Entity = exports.Column = exports.PrimaryColumn = exports.InjectionsAbstract = exports.EnvVar = exports.DATABASE_SSL_ENABLED = exports.DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED = exports.ENVIRONMENT = exports.CORS_ALLOWED_ORIGINS = exports.LOAD_MODULES = exports.APP_PORT = exports.DatabaseHelperAbstract = void 0;
|
|
5
5
|
require("./backend/application/env/load-envs");
|
|
6
6
|
require("reflect-metadata");
|
|
7
7
|
const setup_1 = require("./setup");
|
|
@@ -68,7 +68,8 @@ Object.defineProperty(exports, "APP_PORT", { enumerable: true, get: function ()
|
|
|
68
68
|
Object.defineProperty(exports, "LOAD_MODULES", { enumerable: true, get: function () { return env_vars_1.LOAD_MODULES; } });
|
|
69
69
|
Object.defineProperty(exports, "CORS_ALLOWED_ORIGINS", { enumerable: true, get: function () { return env_vars_1.CORS_ALLOWED_ORIGINS; } });
|
|
70
70
|
Object.defineProperty(exports, "ENVIRONMENT", { enumerable: true, get: function () { return env_vars_1.ENVIRONMENT; } });
|
|
71
|
-
Object.defineProperty(exports, "
|
|
71
|
+
Object.defineProperty(exports, "DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED", { enumerable: true, get: function () { return env_vars_1.DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED; } });
|
|
72
|
+
Object.defineProperty(exports, "DATABASE_SSL_ENABLED", { enumerable: true, get: function () { return env_vars_1.DATABASE_SSL_ENABLED; } });
|
|
72
73
|
var env_var_1 = require("./setup/env-var");
|
|
73
74
|
Object.defineProperty(exports, "EnvVar", { enumerable: true, get: function () { return env_var_1.EnvVar; } });
|
|
74
75
|
var injections_abstract_1 = require("./backend/application/injections.abstract");
|