@atlantjs/backend 6.0.14 → 6.0.16

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.
Files changed (50) hide show
  1. package/backend/application/databases/database-lite.config.js +9 -7
  2. package/backend/application/databases/database.config.js +20 -18
  3. package/backend/application/databases/database.helper.abstract.commit.failure.js +6 -2
  4. package/backend/application/databases/database.helper.abstract.delete.failure.js +6 -2
  5. package/backend/application/databases/database.helper.abstract.get-manager.failure.js +6 -2
  6. package/backend/application/databases/database.helper.abstract.js +39 -33
  7. package/backend/application/databases/database.helper.abstract.rollback.failure.js +6 -2
  8. package/backend/application/databases/database.helper.abstract.write.failure.js +6 -2
  9. package/backend/application/env/env-vars.js +22 -19
  10. package/backend/application/env/load-envs.js +41 -6
  11. package/backend/application/injections.abstract.js +12 -9
  12. package/backend/application/injections.abstract.type.js +2 -1
  13. package/backend/domain/commands/command.abstract.js +5 -1
  14. package/backend/domain/middlewares/middleware.handler.abstract.js +5 -1
  15. package/backend/domain/objects/edges/edge.abstract.js +5 -1
  16. package/backend/domain/objects/edges/metadata.edge.d.ts +2 -1
  17. package/backend/domain/objects/edges/metadata.edge.js +9 -5
  18. package/backend/domain/objects/edges/metadata.polygon.js +2 -1
  19. package/backend/domain/objects/edges/metadata.uv.d.ts +6 -0
  20. package/backend/domain/objects/edges/metadata.uv.js +29 -0
  21. package/backend/domain/objects/face.abstract.js +5 -1
  22. package/backend/domain/objects/solid.abstract.js +7 -5
  23. package/backend/domain/objects/uv.abstract.d.ts +8 -0
  24. package/backend/domain/objects/uv.abstract.js +6 -0
  25. package/backend/domain/objects/vertices/vertex.abstract.js +7 -5
  26. package/backend/domain/providers/provider.abstract.js +5 -1
  27. package/backend/domain/repositories/repository.abstract.js +5 -1
  28. package/backend/domain/services/service.abstract.js +5 -1
  29. package/backend/infrastructure/controllers/controller.abstract.js +8 -4
  30. package/backend/infrastructure/controllers/payloads/payload.abstract.d.ts +0 -1
  31. package/backend/infrastructure/controllers/payloads/payload.abstract.js +5 -1
  32. package/backend/infrastructure/controllers/payloads/validators/validator.abstract.js +5 -1
  33. package/backend/infrastructure/controllers/responses/response.abstract.js +5 -1
  34. package/backend/infrastructure/controllers/validators/is-time-string.js +7 -4
  35. package/index.d.ts +3 -1
  36. package/index.js +148 -37
  37. package/package.json +2 -2
  38. package/setup/dependency-injections/di-container.abstract.js +12 -8
  39. package/setup/dependency-injections/di-container.js +6 -3
  40. package/setup/dependency-injections/index.js +10 -5
  41. package/setup/index.js +15 -11
  42. package/setup/parchment/parchment.error.js +5 -1
  43. package/setup/parchment/parchment.js +20 -16
  44. package/setup/parchment/parchment.type.js +2 -1
  45. package/setup/server/body-parser-middleware.js +16 -7
  46. package/setup/server/cors-middleware.js +15 -9
  47. package/setup/server/default-error-handler-middleware.js +18 -11
  48. package/setup/server/server.js +35 -28
  49. package/setup/server/unknow.error.js +9 -7
  50. package/tsconfig.tsbuildinfo +1 -1
@@ -1,14 +1,15 @@
1
- import { DataSource } from "typeorm";
2
- import { DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED } from "../env/env-vars";
3
- export class DatabaseLiteConfigAbstract {
4
- props;
5
- configs;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DatabaseLiteConfigAbstract = void 0;
4
+ const typeorm_1 = require("typeorm");
5
+ const env_vars_1 = require("../env/env-vars");
6
+ class DatabaseLiteConfigAbstract {
6
7
  constructor(props) {
7
8
  this.props = props;
8
9
  const baseConfig = {
9
10
  type: this.props.type,
10
11
  database: this.props.binaryFilePath,
11
- synchronize: DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED,
12
+ synchronize: env_vars_1.DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED,
12
13
  extra: {
13
14
  cipher: "aes-256-cbc",
14
15
  key: props.accessKey,
@@ -16,6 +17,7 @@ export class DatabaseLiteConfigAbstract {
16
17
  entities: props.schemaPaths,
17
18
  migrations: props.migrationPaths,
18
19
  };
19
- this.configs = new DataSource(baseConfig);
20
+ this.configs = new typeorm_1.DataSource(baseConfig);
20
21
  }
21
22
  }
23
+ exports.DatabaseLiteConfigAbstract = DatabaseLiteConfigAbstract;
@@ -1,19 +1,20 @@
1
- import { _ } from "@atlantjs/arch";
2
- import { DataSource } from "typeorm";
3
- import { DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED, DATABASE_SSL_ENABLED, } from "../env/env-vars";
4
- export class DatabaseConfigAbstract {
5
- props;
6
- configs;
7
- sslConfig = {
8
- ssl: true,
9
- extra: {
10
- ssl: {
11
- rejectUnauthorized: false,
12
- },
13
- },
14
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DatabaseConfigAbstract = void 0;
4
+ const arch_1 = require("@atlantjs/arch");
5
+ const typeorm_1 = require("typeorm");
6
+ const env_vars_1 = require("../env/env-vars");
7
+ class DatabaseConfigAbstract {
15
8
  constructor(props) {
16
9
  this.props = props;
10
+ this.sslConfig = {
11
+ ssl: true,
12
+ extra: {
13
+ ssl: {
14
+ rejectUnauthorized: false,
15
+ },
16
+ },
17
+ };
17
18
  const baseConfig = {
18
19
  type: this.props.type,
19
20
  host: this.props.host,
@@ -22,20 +23,21 @@ export class DatabaseConfigAbstract {
22
23
  password: this.props.adminPassword,
23
24
  database: this.props.name,
24
25
  schema: this.props.schemaName,
25
- synchronize: DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED,
26
+ synchronize: env_vars_1.DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED,
26
27
  entities: this.props.schemaPaths,
27
28
  migrations: this.props.migrationPaths,
28
29
  };
29
- if (_.isEqual(this.props.type, "aurora-mysql")) {
30
+ if (arch_1._.isEqual(this.props.type, "aurora-mysql")) {
30
31
  Object.assign(baseConfig, {
31
32
  region: this.props.region ?? "",
32
33
  secretArn: this.props.secretArn ?? "",
33
34
  resourceArn: this.props.resourceArn ?? "",
34
35
  });
35
36
  }
36
- if (DATABASE_SSL_ENABLED) {
37
+ if (env_vars_1.DATABASE_SSL_ENABLED) {
37
38
  Object.assign(baseConfig, this.sslConfig);
38
39
  }
39
- this.configs = new DataSource(baseConfig);
40
+ this.configs = new typeorm_1.DataSource(baseConfig);
40
41
  }
41
42
  }
43
+ exports.DatabaseConfigAbstract = DatabaseConfigAbstract;
@@ -1,5 +1,8 @@
1
- import { FailureAbstract } from "@atlantjs/arch";
2
- export class DatabaseHelperAbstractCommitFailure extends FailureAbstract {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DatabaseHelperAbstractCommitFailure = void 0;
4
+ const arch_1 = require("@atlantjs/arch");
5
+ class DatabaseHelperAbstractCommitFailure extends arch_1.FailureAbstract {
3
6
  constructor(error) {
4
7
  super({
5
8
  failureClass: DatabaseHelperAbstractCommitFailure,
@@ -8,3 +11,4 @@ export class DatabaseHelperAbstractCommitFailure extends FailureAbstract {
8
11
  });
9
12
  }
10
13
  }
14
+ exports.DatabaseHelperAbstractCommitFailure = DatabaseHelperAbstractCommitFailure;
@@ -1,5 +1,8 @@
1
- import { FailureAbstract } from "@atlantjs/arch";
2
- export class DatabaseHelperAbstractDeleteFailure extends FailureAbstract {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DatabaseHelperAbstractDeleteFailure = void 0;
4
+ const arch_1 = require("@atlantjs/arch");
5
+ class DatabaseHelperAbstractDeleteFailure extends arch_1.FailureAbstract {
3
6
  constructor(isSoft, error) {
4
7
  super({
5
8
  failureClass: DatabaseHelperAbstractDeleteFailure,
@@ -8,3 +11,4 @@ export class DatabaseHelperAbstractDeleteFailure extends FailureAbstract {
8
11
  });
9
12
  }
10
13
  }
14
+ exports.DatabaseHelperAbstractDeleteFailure = DatabaseHelperAbstractDeleteFailure;
@@ -1,5 +1,8 @@
1
- import { FailureAbstract } from "@atlantjs/arch";
2
- export class DatabaseHelperAbstractGetManagerFailure extends FailureAbstract {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DatabaseHelperAbstractGetManagerFailure = void 0;
4
+ const arch_1 = require("@atlantjs/arch");
5
+ class DatabaseHelperAbstractGetManagerFailure extends arch_1.FailureAbstract {
3
6
  constructor(error) {
4
7
  super({
5
8
  failureClass: DatabaseHelperAbstractGetManagerFailure,
@@ -8,3 +11,4 @@ export class DatabaseHelperAbstractGetManagerFailure extends FailureAbstract {
8
11
  });
9
12
  }
10
13
  }
14
+ exports.DatabaseHelperAbstractGetManagerFailure = DatabaseHelperAbstractGetManagerFailure;
@@ -1,28 +1,33 @@
1
- import { Failure, Nothing, Optional, Success, _, } from "@atlantjs/arch";
2
- import { DatabaseHelperAbstractCommitFailure } from "./database.helper.abstract.commit.failure";
3
- import { DatabaseHelperAbstractDeleteFailure } from "./database.helper.abstract.delete.failure";
4
- import { DatabaseHelperAbstractGetManagerFailure } from "./database.helper.abstract.get-manager.failure";
5
- import { DatabaseHelperAbstractRollbackFailure } from "./database.helper.abstract.rollback.failure";
6
- import { DatabaseHelperAbstractWriteFailure } from "./database.helper.abstract.write.failure";
7
- export class DatabaseHelperAbstract {
8
- database = Nothing;
9
- queryRunner = Nothing;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DatabaseHelperAbstract = void 0;
4
+ const arch_1 = require("@atlantjs/arch");
5
+ const database_helper_abstract_commit_failure_1 = require("./database.helper.abstract.commit.failure");
6
+ const database_helper_abstract_delete_failure_1 = require("./database.helper.abstract.delete.failure");
7
+ const database_helper_abstract_get_manager_failure_1 = require("./database.helper.abstract.get-manager.failure");
8
+ const database_helper_abstract_rollback_failure_1 = require("./database.helper.abstract.rollback.failure");
9
+ const database_helper_abstract_write_failure_1 = require("./database.helper.abstract.write.failure");
10
+ class DatabaseHelperAbstract {
11
+ constructor() {
12
+ this.database = arch_1.Nothing;
13
+ this.queryRunner = arch_1.Nothing;
14
+ }
10
15
  async connect(db) {
11
- this.database = Optional(db.configs);
16
+ this.database = (0, arch_1.Optional)(db.configs);
12
17
  await this.database.unpack().initialize();
13
18
  return this.database.unpack();
14
19
  }
15
20
  async disconnect() {
16
21
  await this.database.unpack().destroy();
17
- this.database = Nothing;
22
+ this.database = arch_1.Nothing;
18
23
  }
19
24
  async read(face, condition, relations) {
20
25
  const clientWrapped = this.getManager();
21
26
  if (clientWrapped.hasFailure())
22
- return Failure(clientWrapped.unwrapFail());
27
+ return (0, arch_1.Failure)(clientWrapped.unwrapFail());
23
28
  const client = clientWrapped.unwrap();
24
29
  const repository = client.getRepository(face);
25
- const registryPacked = Optional((await repository.find({
30
+ const registryPacked = (0, arch_1.Optional)((await repository.find({
26
31
  where: { ...condition, deleted: false },
27
32
  relations,
28
33
  })));
@@ -44,7 +49,7 @@ export class DatabaseHelperAbstract {
44
49
  filterDeletedRelations(faces, relations);
45
50
  }
46
51
  }
47
- return Success(registryPacked);
52
+ return (0, arch_1.Success)(registryPacked);
48
53
  }
49
54
  async write(faceEntities) {
50
55
  try {
@@ -52,11 +57,11 @@ export class DatabaseHelperAbstract {
52
57
  const ids = [];
53
58
  for (const faceEntity of faceEntities) {
54
59
  const repository = client.getRepository(faceEntity.face);
55
- if (_.isUndefined(faceEntity.entity.toPersist) ||
56
- _.isUndefined(faceEntity.entity.id)) {
57
- return Failure(new DatabaseHelperAbstractWriteFailure());
60
+ if (arch_1._.isUndefined(faceEntity.entity.toPersist) ||
61
+ arch_1._.isUndefined(faceEntity.entity.id)) {
62
+ return (0, arch_1.Failure)(new database_helper_abstract_write_failure_1.DatabaseHelperAbstractWriteFailure());
58
63
  }
59
- const registryFoundedPacked = Optional(await repository.findOne({
64
+ const registryFoundedPacked = (0, arch_1.Optional)(await repository.findOne({
60
65
  where: {
61
66
  id: faceEntity.entity.id.toString(),
62
67
  },
@@ -73,20 +78,20 @@ export class DatabaseHelperAbstract {
73
78
  });
74
79
  }
75
80
  await this.commit();
76
- return Success(ids);
81
+ return (0, arch_1.Success)(ids);
77
82
  }
78
83
  catch (error) {
79
84
  await this.rollback();
80
- return Failure(new DatabaseHelperAbstractWriteFailure(error));
85
+ return (0, arch_1.Failure)(new database_helper_abstract_write_failure_1.DatabaseHelperAbstractWriteFailure(error));
81
86
  }
82
87
  }
83
88
  async delete(schema, condition, isSoft = true) {
84
89
  try {
85
90
  const client = await this.openTransaction();
86
91
  const repository = client.getRepository(schema);
87
- const registriesPacked = Optional(await repository.find({ where: condition }));
92
+ const registriesPacked = (0, arch_1.Optional)(await repository.find({ where: condition }));
88
93
  if (registriesPacked.hasNothing()) {
89
- return Failure(new DatabaseHelperAbstractDeleteFailure(isSoft));
94
+ return (0, arch_1.Failure)(new database_helper_abstract_delete_failure_1.DatabaseHelperAbstractDeleteFailure(isSoft));
90
95
  }
91
96
  if (isSoft.falsy()) {
92
97
  repository.delete(condition);
@@ -99,22 +104,22 @@ export class DatabaseHelperAbstract {
99
104
  }
100
105
  }
101
106
  await this.commit();
102
- return Success();
107
+ return (0, arch_1.Success)();
103
108
  }
104
109
  catch (error) {
105
110
  await this.rollback();
106
- return Failure(new DatabaseHelperAbstractDeleteFailure(isSoft, error));
111
+ return (0, arch_1.Failure)(new database_helper_abstract_delete_failure_1.DatabaseHelperAbstractDeleteFailure(isSoft, error));
107
112
  }
108
113
  }
109
114
  getManager() {
110
115
  if (this.database.hasNothing()) {
111
- return Failure(new DatabaseHelperAbstractGetManagerFailure());
116
+ return (0, arch_1.Failure)(new database_helper_abstract_get_manager_failure_1.DatabaseHelperAbstractGetManagerFailure());
112
117
  }
113
- return Success(this.database.unpack().manager);
118
+ return (0, arch_1.Success)(this.database.unpack().manager);
114
119
  }
115
120
  async openTransaction() {
116
121
  if (this.queryRunner.hasNothing()) {
117
- this.queryRunner = Optional(this.database.unpack().createQueryRunner());
122
+ this.queryRunner = (0, arch_1.Optional)(this.database.unpack().createQueryRunner());
118
123
  await this.queryRunner.unpack().connect();
119
124
  await this.queryRunner.unpack().startTransaction();
120
125
  }
@@ -122,20 +127,21 @@ export class DatabaseHelperAbstract {
122
127
  }
123
128
  async commit() {
124
129
  if (this.queryRunner.hasNothing()) {
125
- return Failure(new DatabaseHelperAbstractCommitFailure());
130
+ return (0, arch_1.Failure)(new database_helper_abstract_commit_failure_1.DatabaseHelperAbstractCommitFailure());
126
131
  }
127
132
  await this.queryRunner.unpack().commitTransaction();
128
133
  await this.queryRunner.unpack().release();
129
- this.queryRunner = Nothing;
130
- return Success();
134
+ this.queryRunner = arch_1.Nothing;
135
+ return (0, arch_1.Success)();
131
136
  }
132
137
  async rollback() {
133
138
  if (this.queryRunner.hasNothing()) {
134
- return Failure(new DatabaseHelperAbstractRollbackFailure());
139
+ return (0, arch_1.Failure)(new database_helper_abstract_rollback_failure_1.DatabaseHelperAbstractRollbackFailure());
135
140
  }
136
141
  await this.queryRunner.unpack().rollbackTransaction();
137
142
  await this.queryRunner.unpack().release();
138
- this.queryRunner = Nothing;
139
- return Success();
143
+ this.queryRunner = arch_1.Nothing;
144
+ return (0, arch_1.Success)();
140
145
  }
141
146
  }
147
+ exports.DatabaseHelperAbstract = DatabaseHelperAbstract;
@@ -1,5 +1,8 @@
1
- import { FailureAbstract } from "@atlantjs/arch";
2
- export class DatabaseHelperAbstractRollbackFailure extends FailureAbstract {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DatabaseHelperAbstractRollbackFailure = void 0;
4
+ const arch_1 = require("@atlantjs/arch");
5
+ class DatabaseHelperAbstractRollbackFailure extends arch_1.FailureAbstract {
3
6
  constructor(error) {
4
7
  super({
5
8
  failureClass: DatabaseHelperAbstractRollbackFailure,
@@ -8,3 +11,4 @@ export class DatabaseHelperAbstractRollbackFailure extends FailureAbstract {
8
11
  });
9
12
  }
10
13
  }
14
+ exports.DatabaseHelperAbstractRollbackFailure = DatabaseHelperAbstractRollbackFailure;
@@ -1,5 +1,8 @@
1
- import { FailureAbstract } from "@atlantjs/arch";
2
- export class DatabaseHelperAbstractWriteFailure extends FailureAbstract {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DatabaseHelperAbstractWriteFailure = void 0;
4
+ const arch_1 = require("@atlantjs/arch");
5
+ class DatabaseHelperAbstractWriteFailure extends arch_1.FailureAbstract {
3
6
  constructor(error) {
4
7
  super({
5
8
  failureClass: DatabaseHelperAbstractWriteFailure,
@@ -8,3 +11,4 @@ export class DatabaseHelperAbstractWriteFailure extends FailureAbstract {
8
11
  });
9
12
  }
10
13
  }
14
+ exports.DatabaseHelperAbstractWriteFailure = DatabaseHelperAbstractWriteFailure;
@@ -1,6 +1,9 @@
1
- import { NodeEnvs } from "@atlantjs/arch";
2
- import { Parchment } from "../../../setup/parchment/parchment";
3
- export const DATABASE_TYPE = Parchment.verse({
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ENVIRONMENT = exports.CORS_ALLOWED_ORIGINS = exports.LOAD_MODULES = exports.APP_PORT = exports.DATABASE_SSL_ENABLED = exports.DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED = exports.DATABASE_ADMIN_USER = exports.DATABASE_PORT = exports.DATABASE_ADMIN_PASSWORD = exports.DATABASE_HOST = exports.DATABASE_DEFAULT_SCHEMA = exports.DATABASE_NAME = exports.DATABASE_TYPE = void 0;
4
+ const arch_1 = require("@atlantjs/arch");
5
+ const parchment_1 = require("../../../setup/parchment/parchment");
6
+ exports.DATABASE_TYPE = parchment_1.Parchment.verse({
4
7
  name: "DATABASE_TYPE",
5
8
  type: "enum",
6
9
  description: "The type of the database",
@@ -8,82 +11,82 @@ export const DATABASE_TYPE = Parchment.verse({
8
11
  values: ["aurora-postgres", "postgres", "sqlite"],
9
12
  isRequired: true,
10
13
  });
11
- export const DATABASE_NAME = Parchment.verse({
14
+ exports.DATABASE_NAME = parchment_1.Parchment.verse({
12
15
  name: "DATABASE_NAME",
13
16
  type: "text",
14
17
  description: "The name of the database",
15
18
  isRequired: true,
16
19
  });
17
- export const DATABASE_DEFAULT_SCHEMA = Parchment.verse({
20
+ exports.DATABASE_DEFAULT_SCHEMA = parchment_1.Parchment.verse({
18
21
  name: "DATABASE_DEFAULT_SCHEMA",
19
22
  type: "text",
20
23
  description: "The name of default schema the database",
21
24
  isRequired: true,
22
25
  });
23
- export const DATABASE_HOST = Parchment.verse({
26
+ exports.DATABASE_HOST = parchment_1.Parchment.verse({
24
27
  name: "DATABASE_HOST",
25
28
  description: "The host address of the database server",
26
29
  type: "text",
27
30
  isRequired: true,
28
31
  });
29
- export const DATABASE_ADMIN_PASSWORD = Parchment.verse({
32
+ exports.DATABASE_ADMIN_PASSWORD = parchment_1.Parchment.verse({
30
33
  name: "DATABASE_ADMIN_PASSWORD",
31
34
  description: "The password for the database user",
32
35
  type: "text",
33
36
  isRequired: true,
34
37
  });
35
- export const DATABASE_PORT = Parchment.verse({
38
+ exports.DATABASE_PORT = parchment_1.Parchment.verse({
36
39
  name: "DATABASE_PORT",
37
40
  type: "port-number",
38
41
  description: "The port number on which the database server is running",
39
42
  isRequired: true,
40
43
  });
41
- export const DATABASE_ADMIN_USER = Parchment.verse({
44
+ exports.DATABASE_ADMIN_USER = parchment_1.Parchment.verse({
42
45
  name: "DATABASE_ADMIN_USER",
43
46
  description: "The username for the database database",
44
47
  type: "text",
45
48
  isRequired: true,
46
49
  });
47
- export const DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED = Parchment.verse({
50
+ exports.DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED = parchment_1.Parchment.verse({
48
51
  name: "DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED",
49
52
  type: "boolean",
50
53
  description: "Flag indicating whether the ORM automatically creates tables in the database based on .schema.ts files",
51
54
  isRequired: true,
52
55
  });
53
- export const DATABASE_SSL_ENABLED = Parchment.verse({
56
+ exports.DATABASE_SSL_ENABLED = parchment_1.Parchment.verse({
54
57
  name: "DATABASE_SSL_ENABLED",
55
58
  type: "boolean",
56
59
  description: "Flag indicating whether the database requires an SSL connection",
57
60
  isRequired: true,
58
61
  });
59
- export const APP_PORT = Parchment.verse({
62
+ exports.APP_PORT = parchment_1.Parchment.verse({
60
63
  name: "APP_PORT",
61
64
  type: "port-number",
62
65
  description: "The port number on which the application will run",
63
66
  isRequired: true,
64
67
  });
65
- export const LOAD_MODULES = Parchment.verse({
68
+ exports.LOAD_MODULES = parchment_1.Parchment.verse({
66
69
  name: "LOAD_MODULES",
67
70
  type: "array",
68
71
  description: "List of modules, separated by commas, to be loaded by the application",
69
72
  isRequired: true,
70
73
  });
71
- export const CORS_ALLOWED_ORIGINS = Parchment.verse({
74
+ exports.CORS_ALLOWED_ORIGINS = parchment_1.Parchment.verse({
72
75
  name: "CORS_ALLOWED_ORIGINS",
73
76
  default: "*",
74
77
  description: "Allowed origins for CORS",
75
78
  type: "text",
76
79
  isRequired: true,
77
80
  });
78
- export const ENVIRONMENT = Parchment.verse({
81
+ exports.ENVIRONMENT = parchment_1.Parchment.verse({
79
82
  name: "ENVIRONMENT",
80
83
  type: "enum",
81
84
  isRequired: true,
82
85
  values: [
83
- NodeEnvs.test,
84
- NodeEnvs.development,
85
- NodeEnvs.production,
86
- NodeEnvs.homolog,
86
+ arch_1.NodeEnvs.test,
87
+ arch_1.NodeEnvs.development,
88
+ arch_1.NodeEnvs.production,
89
+ arch_1.NodeEnvs.homolog,
87
90
  ],
88
91
  description: "The current environment in which the application is running",
89
92
  });
@@ -1,9 +1,44 @@
1
- import * as fs from "node:fs";
2
- import * as path from "node:path";
3
- import { NodeEnvs } from "@atlantjs/arch";
4
- import * as dotenv from "dotenv";
5
- const envFilePath = path.join(__dirname, "..", "..", "..", "..", "..", "..", process.env.ENVIRONMENT === NodeEnvs.test ? ".env.test" : ".env");
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ const fs = __importStar(require("node:fs"));
37
+ const path = __importStar(require("node:path"));
38
+ const arch_1 = require("@atlantjs/arch");
39
+ const dotenv = __importStar(require("dotenv"));
40
+ const envFilePath = path.join(__dirname, "..", "..", "..", "..", "..", "..", process.env.ENVIRONMENT === arch_1.NodeEnvs.test ? ".env.test" : ".env");
6
41
  if (!fs.existsSync(envFilePath)) {
7
- console.error(`The ${process.env.ENVIRONMENT === NodeEnvs.test ? ".env.test" : ".env"} file is missing with the variables and their values`);
42
+ console.error(`The ${process.env.ENVIRONMENT === arch_1.NodeEnvs.test ? ".env.test" : ".env"} file is missing with the variables and their values`);
8
43
  }
9
44
  dotenv.config({ path: envFilePath });
@@ -1,6 +1,8 @@
1
- import { diContainer } from "../../setup/dependency-injections";
2
- export class InjectionsAbstract {
3
- _injections;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InjectionsAbstract = void 0;
4
+ const dependency_injections_1 = require("../../setup/dependency-injections");
5
+ class InjectionsAbstract {
4
6
  constructor(_injections) {
5
7
  this._injections = _injections;
6
8
  this.injectControllers();
@@ -12,32 +14,33 @@ export class InjectionsAbstract {
12
14
  }
13
15
  injectControllers() {
14
16
  this._injections.controllers?.map((controller) => {
15
- diContainer.bind(controller).toSelf();
17
+ dependency_injections_1.diContainer.bind(controller).toSelf();
16
18
  });
17
19
  }
18
20
  injectMiddlewares() {
19
21
  this._injections.middlewares?.map((middleware) => {
20
- diContainer.bind(middleware).toSelf();
22
+ dependency_injections_1.diContainer.bind(middleware).toSelf();
21
23
  });
22
24
  }
23
25
  injectCommands() {
24
26
  this._injections.commands?.map((command) => {
25
- diContainer.bind(command.token).to(command.target);
27
+ dependency_injections_1.diContainer.bind(command.token).to(command.target);
26
28
  });
27
29
  }
28
30
  injectServices() {
29
31
  this._injections.services?.map((service) => {
30
- diContainer.bind(service.token).to(service.target);
32
+ dependency_injections_1.diContainer.bind(service.token).to(service.target);
31
33
  });
32
34
  }
33
35
  injectRepositories() {
34
36
  this._injections.repositories?.map((repository) => {
35
- diContainer.bind(repository.token).to(repository.target);
37
+ dependency_injections_1.diContainer.bind(repository.token).to(repository.target);
36
38
  });
37
39
  }
38
40
  injectProviders() {
39
41
  this._injections.providers?.map((provider) => {
40
- diContainer.bind(provider.token).to(provider.target);
42
+ dependency_injections_1.diContainer.bind(provider.token).to(provider.target);
41
43
  });
42
44
  }
43
45
  }
46
+ exports.InjectionsAbstract = InjectionsAbstract;
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +1,6 @@
1
- export class CommandAbstract {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CommandAbstract = void 0;
4
+ class CommandAbstract {
2
5
  }
6
+ exports.CommandAbstract = CommandAbstract;
@@ -1,2 +1,6 @@
1
- export class MiddlewareHandlerAbstract {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MiddlewareHandlerAbstract = void 0;
4
+ class MiddlewareHandlerAbstract {
2
5
  }
6
+ exports.MiddlewareHandlerAbstract = MiddlewareHandlerAbstract;
@@ -1,2 +1,6 @@
1
- export class EdgeAbstract {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EdgeAbstract = void 0;
4
+ class EdgeAbstract {
2
5
  }
6
+ exports.EdgeAbstract = EdgeAbstract;
@@ -1,6 +1,7 @@
1
1
  import { DatetimeEdge } from "@atlantjs/arch";
2
+ import { EdgeAbstract } from "./edge.abstract";
2
3
  import { MetadataPolygon } from "./metadata.polygon";
3
- export declare class MetadataEdge {
4
+ export declare class MetadataEdge extends EdgeAbstract {
4
5
  protected _createdAt: DatetimeEdge;
5
6
  protected _updatedAt: DatetimeEdge;
6
7
  constructor(_createdAt?: DatetimeEdge, _updatedAt?: DatetimeEdge);
@@ -1,8 +1,11 @@
1
- import { DatetimeEdge } from "@atlantjs/arch";
2
- export class MetadataEdge {
3
- _createdAt;
4
- _updatedAt;
5
- constructor(_createdAt = new DatetimeEdge(), _updatedAt = new DatetimeEdge()) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MetadataEdge = void 0;
4
+ const arch_1 = require("@atlantjs/arch");
5
+ const edge_abstract_1 = require("./edge.abstract");
6
+ class MetadataEdge extends edge_abstract_1.EdgeAbstract {
7
+ constructor(_createdAt = new arch_1.DatetimeEdge(), _updatedAt = new arch_1.DatetimeEdge()) {
8
+ super();
6
9
  this._createdAt = _createdAt;
7
10
  this._updatedAt = _updatedAt;
8
11
  }
@@ -19,3 +22,4 @@ export class MetadataEdge {
19
22
  };
20
23
  }
21
24
  }
25
+ exports.MetadataEdge = MetadataEdge;
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import { MetadataEdge } from "./metadata.edge";
2
+ export declare class MetadataUv {
3
+ createdAt: string;
4
+ updatedAt: string;
5
+ toEntity(): MetadataEdge;
6
+ }