easywork-common-lib 1.0.256 → 1.0.258
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.
|
@@ -16,13 +16,20 @@ const typeorm_1 = require("typeorm");
|
|
|
16
16
|
const file_entity_1 = require("./file.entity");
|
|
17
17
|
const entity_folder_entity_1 = require("../helpers/entity_folder.entity");
|
|
18
18
|
const swagger_1 = require("@nestjs/swagger");
|
|
19
|
+
const nanoid_1 = require("nanoid");
|
|
19
20
|
let Folder = class Folder extends database_1.BaseEntityWithUser {
|
|
20
21
|
name;
|
|
21
22
|
hidden;
|
|
22
23
|
parent;
|
|
24
|
+
uid;
|
|
23
25
|
files;
|
|
24
26
|
folders;
|
|
25
27
|
owners;
|
|
28
|
+
generateUid() {
|
|
29
|
+
if (!this.uid) {
|
|
30
|
+
this.uid = (0, nanoid_1.nanoid)(11);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
26
33
|
};
|
|
27
34
|
exports.Folder = Folder;
|
|
28
35
|
__decorate([
|
|
@@ -44,6 +51,12 @@ __decorate([
|
|
|
44
51
|
}),
|
|
45
52
|
__metadata("design:type", Folder)
|
|
46
53
|
], Folder.prototype, "parent", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'UID', minLength: 1 }),
|
|
56
|
+
(0, class_validator_1.MinLength)(1),
|
|
57
|
+
(0, typeorm_1.Column)(),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], Folder.prototype, "uid", void 0);
|
|
47
60
|
__decorate([
|
|
48
61
|
(0, swagger_1.ApiProperty)({ type: () => [file_entity_1.File], description: 'Files in the folder' }),
|
|
49
62
|
(0, typeorm_1.OneToMany)(() => file_entity_1.File, (file) => file.folder, {
|
|
@@ -69,8 +82,15 @@ __decorate([
|
|
|
69
82
|
}),
|
|
70
83
|
__metadata("design:type", Array)
|
|
71
84
|
], Folder.prototype, "owners", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, typeorm_1.BeforeInsert)(),
|
|
87
|
+
__metadata("design:type", Function),
|
|
88
|
+
__metadata("design:paramtypes", []),
|
|
89
|
+
__metadata("design:returntype", void 0)
|
|
90
|
+
], Folder.prototype, "generateUid", null);
|
|
72
91
|
exports.Folder = Folder = __decorate([
|
|
73
92
|
(0, typeorm_1.Entity)(),
|
|
93
|
+
(0, typeorm_1.Index)(["uid"], { unique: true }),
|
|
74
94
|
(0, typeorm_1.Index)(["name", "parent"], { unique: true })
|
|
75
95
|
], Folder);
|
|
76
96
|
//# sourceMappingURL=folder.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"folder.entity.js","sourceRoot":"","sources":["../../../src/entities/drive/folder.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2D;AAC3D,qDAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"folder.entity.js","sourceRoot":"","sources":["../../../src/entities/drive/folder.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2D;AAC3D,qDAA4C;AAC5C,qCAAoF;AACpF,+CAAqC;AACrC,0EAA+D;AAC/D,6CAA8C;AAC9C,mCAAgC;AAKzB,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,6BAAkB;IAI5C,IAAI,CAAS;IAIb,MAAM,CAAW;IAQjB,MAAM,CAAS;IAKf,GAAG,CAAS;IAOZ,KAAK,CAAU;IAOf,OAAO,CAAY;IAQnB,MAAM,CAAkB;IAGxB,WAAW;QACT,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YACd,IAAI,CAAC,GAAG,GAAG,IAAA,eAAM,EAAC,EAAE,CAAC,CAAC;QACxB,CAAC;IACH,CAAC;CACF,CAAA;AAnDY,wBAAM;AAIjB;IAHC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,oBAAoB,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IAC9E,I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AC,MAAM,EAAE;QAClD,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;KACpB,CAAC;;uCACiB;AAQnB;IANC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,mCAAY,CAAC,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;IACxF,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,mCAAY,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE;QACpE,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,KAAK,EAAE,IAAI;KACZ,CAAC;;sCACsB;AAGxB;IADC,IAAA,sBAAY,GAAE;;;;yCAKd;iBAlDU,MAAM;IAHlB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAChC,IAAA,eAAK,EAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GAC/B,MAAM,CAmDlB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easywork-common-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.258",
|
|
4
4
|
"description": "Librería común de Easywork",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"@nestjs/typeorm": "^10.0.2",
|
|
28
28
|
"class-transformer": "^0.5.1",
|
|
29
29
|
"class-validator": "^0.14.1",
|
|
30
|
+
"nanoid": "3",
|
|
30
31
|
"rxjs": "^7.8.1",
|
|
31
32
|
"typeorm": "^0.3.20"
|
|
32
33
|
},
|