easywork-common-lib 1.0.9 → 1.0.10

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.
@@ -31,7 +31,7 @@ __decorate([
31
31
  __metadata("design:type", String)
32
32
  ], File.prototype, "name", void 0);
33
33
  __decorate([
34
- (0, typeorm_1.OneToOne)(() => folder_entity_1.Folder, {
34
+ (0, typeorm_1.OneToMany)(() => folder_entity_1.Folder, (Folder) => Folder.files, {
35
35
  onDelete: "CASCADE",
36
36
  onUpdate: "CASCADE",
37
37
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"file.entity.js","sourceRoot":"","sources":["../../../src/entities/drive/file.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAmD;AACnD,qDAA4C;AAC5C,qCAA0E;AAC1E,mDAAyC;AACzC,sEAA2D;AAGpD,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,qBAAU;IAEhC,IAAI,CAAS;IAOb,MAAM,CAAS;IAGf,GAAG,CAAS;IAGZ,IAAI,CAAS;IAGb,QAAQ,CAAS;IAGjB,KAAK,CAAS;IAGd,SAAS,CAAU;IAOnB,MAAM,CAAgB;CACzB,CAAA;AAhCY,oBAAI;AAEb;IADC,IAAA,2BAAS,EAAC,CAAC,CAAC;;kCACA;AAOb;IALC,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,sBAAM,EAAE;QACpB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;KACtB,CAAC;IACD,IAAA,oBAAU,GAAE;8BACL,sBAAM;oCAAC;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iCACf;AAGZ;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kCACd;AAGb;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sCAC1B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;;kCACd;AAGb;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sCAC1B;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mCACb;AAGd;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;uCACR;AAOnB;IALC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,+BAAU,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE;QAC1D,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,KAAK,EAAE,IAAI;KACd,CAAC;;oCACoB;eA/Bb,IAAI;IADhB,IAAA,gBAAM,GAAE;GACI,IAAI,CAgChB"}
@@ -2,4 +2,5 @@ import { BaseEntity } from "../../common/database";
2
2
  export declare class Folder extends BaseEntity {
3
3
  name: string;
4
4
  parent: Folder;
5
+ files: Folder[];
5
6
  }
@@ -16,6 +16,7 @@ const typeorm_1 = require("typeorm");
16
16
  let Folder = class Folder extends database_1.BaseEntity {
17
17
  name;
18
18
  parent;
19
+ files;
19
20
  };
20
21
  exports.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":[],"m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,MAAM;IADlB,IAAA,gBAAM,GAAE;GACI,MAAM,CAkBlB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easywork-common-lib",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Librería común de Easywork",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  import { BaseEntity } from "../../common/database";
2
2
  import { MinLength } from "class-validator";
3
- import { Column, Entity, JoinColumn, OneToMany, OneToOne } from "typeorm";
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,7 +9,7 @@ export class File extends BaseEntity {
9
9
  @MinLength(1)
10
10
  name: string;
11
11
 
12
- @OneToOne(() => Folder, {
12
+ @OneToMany(() => Folder, (Folder) => Folder.files, {
13
13
  onDelete: "CASCADE",
14
14
  onUpdate: "CASCADE",
15
15
  })
@@ -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
  }