easywork-common-lib 1.0.9 → 1.0.11
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/dist/entities/drive/file.entity.js +2 -1
- package/dist/entities/drive/file.entity.js.map +1 -1
- package/dist/entities/drive/folder.entity.d.ts +1 -0
- package/dist/entities/drive/folder.entity.js +9 -0
- package/dist/entities/drive/folder.entity.js.map +1 -1
- package/dist/eslint.config.d.ts +1 -1
- package/package.json +3 -11
- package/src/entities/drive/file.entity.ts +3 -2
- package/src/entities/drive/folder.entity.ts +8 -1
- package/webpack-hmr.js +0 -26
- package/webpack.config.js +0 -27
|
@@ -31,9 +31,10 @@ __decorate([
|
|
|
31
31
|
__metadata("design:type", String)
|
|
32
32
|
], File.prototype, "name", void 0);
|
|
33
33
|
__decorate([
|
|
34
|
-
(0, typeorm_1.
|
|
34
|
+
(0, typeorm_1.OneToMany)(() => folder_entity_1.Folder, (Folder) => Folder.files, {
|
|
35
35
|
onDelete: "CASCADE",
|
|
36
36
|
onUpdate: "CASCADE",
|
|
37
|
+
eager: true
|
|
37
38
|
}),
|
|
38
39
|
(0, typeorm_1.JoinColumn)(),
|
|
39
40
|
__metadata("design:type", folder_entity_1.Folder)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.entity.js","sourceRoot":"","sources":["../../../src/entities/drive/file.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAmD;AACnD,qDAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"file.entity.js","sourceRoot":"","sources":["../../../src/entities/drive/file.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAmD;AACnD,qDAA4C;AAC5C,qCAAgE;AAChE,mDAAyC;AACzC,sEAA2D;AAGpD,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,qBAAU;IAEhC,IAAI,CAAS;IAQb,MAAM,CAAS;IAGf,GAAG,CAAS;IAGZ,IAAI,CAAS;IAGb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Folder = Folder;
|
|
21
22
|
__decorate([
|
|
@@ -31,6 +32,14 @@ __decorate([
|
|
|
31
32
|
(0, typeorm_1.JoinColumn)(),
|
|
32
33
|
__metadata("design:type", Folder)
|
|
33
34
|
], Folder.prototype, "parent", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.ManyToOne)(() => Folder, {
|
|
37
|
+
onDelete: "CASCADE",
|
|
38
|
+
onUpdate: "CASCADE",
|
|
39
|
+
}),
|
|
40
|
+
(0, typeorm_1.JoinColumn)(),
|
|
41
|
+
__metadata("design:type", Array)
|
|
42
|
+
], Folder.prototype, "files", void 0);
|
|
34
43
|
exports.Folder = Folder = __decorate([
|
|
35
44
|
(0, typeorm_1.Entity)()
|
|
36
45
|
], Folder);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"folder.entity.js","sourceRoot":"","sources":["../../../src/entities/drive/folder.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAmD;AACnD,qDAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"folder.entity.js","sourceRoot":"","sources":["../../../src/entities/drive/folder.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAmD;AACnD,qDAA4C;AAC5C,qCAA0E;AAGnE,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,qBAAU;IAGlC,IAAI,CAAS;IAOb,MAAM,CAAS;IAOf,KAAK,CAAW;CACnB,CAAA;AAlBY,wBAAM;AAGf;IAFC,IAAA,2BAAS,EAAC,CAAC,CAAC;IACZ,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;oCACZ;AAOb;IALC,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE;QACpB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;KACtB,CAAC;IACD,IAAA,oBAAU,GAAE;8BACL,MAAM;sCAAC;AAOf;IALC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE;QACrB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;KACtB,CAAC;IACD,IAAA,oBAAU,GAAE;;qCACG;iBAjBP,MAAM;IADlB,IAAA,gBAAM,GAAE;GACI,MAAM,CAkBlB"}
|
package/dist/eslint.config.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _exports:
|
|
1
|
+
declare const _exports: any;
|
|
2
2
|
export = _exports;
|
package/package.json
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easywork-common-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "Librería común de Easywork",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "tsc"
|
|
8
|
-
"postbuild": "node -r tsconfig-paths/register dist/index.js",
|
|
9
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
7
|
+
"build": "tsc"
|
|
10
8
|
},
|
|
11
9
|
"repository": {
|
|
12
10
|
"type": "git",
|
|
@@ -26,17 +24,11 @@
|
|
|
26
24
|
"@nestjs/typeorm": "^10.0.2",
|
|
27
25
|
"class-transformer": "^0.5.1",
|
|
28
26
|
"class-validator": "^0.14.1",
|
|
29
|
-
"pg": "^8.11.5",
|
|
30
|
-
"tspath": "^2.6.8",
|
|
31
27
|
"typeorm": "^0.3.20"
|
|
32
28
|
},
|
|
33
29
|
"devDependencies": {
|
|
34
|
-
"@antfu/eslint-config": "^2.15.0",
|
|
35
30
|
"@rubiin/tsconfig": "^1.1.2",
|
|
36
31
|
"ts-loader": "^9.5.1",
|
|
37
|
-
"
|
|
38
|
-
"typescript": "^5.4.5",
|
|
39
|
-
"webpack": "^5.91.0",
|
|
40
|
-
"webpack-cli": "^5.1.4"
|
|
32
|
+
"typescript": "^5.4.5"
|
|
41
33
|
}
|
|
42
34
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseEntity } from "../../common/database";
|
|
2
2
|
import { MinLength } from "class-validator";
|
|
3
|
-
import { Column, Entity, JoinColumn, OneToMany
|
|
3
|
+
import { Column, Entity, JoinColumn, OneToMany } from "typeorm";
|
|
4
4
|
import { Folder } from "./folder.entity";
|
|
5
5
|
import { EntityFile } from "../helpers/entity_file.entity";
|
|
6
6
|
|
|
@@ -9,9 +9,10 @@ export class File extends BaseEntity {
|
|
|
9
9
|
@MinLength(1)
|
|
10
10
|
name: string;
|
|
11
11
|
|
|
12
|
-
@
|
|
12
|
+
@OneToMany(() => Folder, (Folder) => Folder.files, {
|
|
13
13
|
onDelete: "CASCADE",
|
|
14
14
|
onUpdate: "CASCADE",
|
|
15
|
+
eager: true
|
|
15
16
|
})
|
|
16
17
|
@JoinColumn()
|
|
17
18
|
folder: Folder;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseEntity } from "../../common/database";
|
|
2
2
|
import { MinLength } from "class-validator";
|
|
3
|
-
import { Column, Entity, JoinColumn, OneToOne } from "typeorm";
|
|
3
|
+
import { Column, Entity, JoinColumn, ManyToOne, OneToOne } from "typeorm";
|
|
4
4
|
|
|
5
5
|
@Entity()
|
|
6
6
|
export class Folder extends BaseEntity {
|
|
@@ -14,4 +14,11 @@ export class Folder extends BaseEntity {
|
|
|
14
14
|
})
|
|
15
15
|
@JoinColumn()
|
|
16
16
|
parent: Folder;
|
|
17
|
+
|
|
18
|
+
@ManyToOne(() => Folder, {
|
|
19
|
+
onDelete: "CASCADE",
|
|
20
|
+
onUpdate: "CASCADE",
|
|
21
|
+
})
|
|
22
|
+
@JoinColumn()
|
|
23
|
+
files: Folder[];
|
|
17
24
|
}
|
package/webpack-hmr.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
const nodeExternals = require('webpack-node-externals');
|
|
2
|
-
const {RunScriptWebpackPlugin} = require('run-script-webpack-plugin');
|
|
3
|
-
|
|
4
|
-
module.exports = function (options, {HotModuleReplacementPlugin, WatchIgnorePlugin}) {
|
|
5
|
-
return {
|
|
6
|
-
...options,
|
|
7
|
-
entry: ['webpack/hot/poll?100', options.entry],
|
|
8
|
-
externals: [
|
|
9
|
-
nodeExternals({
|
|
10
|
-
allowlist: ['webpack/hot/poll?100'],
|
|
11
|
-
}),
|
|
12
|
-
],
|
|
13
|
-
node: {
|
|
14
|
-
__dirname: true,
|
|
15
|
-
__filename: true,
|
|
16
|
-
},
|
|
17
|
-
plugins: [
|
|
18
|
-
...options.plugins,
|
|
19
|
-
new HotModuleReplacementPlugin(),
|
|
20
|
-
new WatchIgnorePlugin({
|
|
21
|
-
paths: [/\.js$/, /\.d\.ts$/],
|
|
22
|
-
}),
|
|
23
|
-
new RunScriptWebpackPlugin({name: options.output.filename, autoRestart: false}),
|
|
24
|
-
],
|
|
25
|
-
};
|
|
26
|
-
};
|
package/webpack.config.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const path = require("path");
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
mode: "production", // Puedes cambiar a 'development' para mejor depuración
|
|
5
|
-
entry: "./src/index.ts", // Punto de entrada de tu librería
|
|
6
|
-
output: {
|
|
7
|
-
path: path.resolve(__dirname, "dist"),
|
|
8
|
-
filename: "index.js", // Nombre del archivo de salida
|
|
9
|
-
libraryTarget: "commonjs2", // Formato del módulo de salida
|
|
10
|
-
},
|
|
11
|
-
resolve: {
|
|
12
|
-
extensions: [".ts", ".js"],
|
|
13
|
-
alias: {
|
|
14
|
-
"@common": path.resolve(__dirname, "src/common"), // Ajusta según tus necesidades de alias
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
module: {
|
|
18
|
-
rules: [
|
|
19
|
-
{
|
|
20
|
-
test: /\.ts$/,
|
|
21
|
-
use: "ts-loader",
|
|
22
|
-
exclude: /node_modules/,
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
},
|
|
26
|
-
target: "node", // Asegura que Webpack compila para un entorno Node.js
|
|
27
|
-
};
|