types-nora-api 0.0.2 → 0.0.3
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/entidades.ts +2 -22
- package/package.json +1 -1
package/entidades.ts
CHANGED
|
@@ -1,22 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
// Caminho absoluto para o diretório de entidades
|
|
5
|
-
const modulesPath = join(__dirname, "../src/modules");
|
|
6
|
-
|
|
7
|
-
// Lê todas as entidades automaticamente
|
|
8
|
-
const entityFiles = readdirSync(modulesPath, { withFileTypes: true })
|
|
9
|
-
.flatMap((dir) =>
|
|
10
|
-
dir.isDirectory()
|
|
11
|
-
? readdirSync(join(modulesPath, dir.name))
|
|
12
|
-
.filter((file) => file.endsWith(".entity.ts"))
|
|
13
|
-
.map((file) => join(modulesPath, dir.name, file))
|
|
14
|
-
: []
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
// Importa dinamicamente todas as entidades
|
|
18
|
-
const entities = entityFiles.map((file) => require(file)[basename(file, extname(file))]);
|
|
19
|
-
|
|
20
|
-
// Exporta todas as entidades encontradas
|
|
21
|
-
export default entities;
|
|
22
|
-
export { entities };
|
|
1
|
+
export { Atributos } from '@modules/atributos/atributos.entity';
|
|
2
|
+
export { Users } from '@modules/users/users.entity';
|