@campxdev/server-shared 1.4.0-alpha.10 → 1.4.0-alpha.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/domain/entities/image.entity.d.ts +13 -0
- package/dist/domain/entities/image.entity.d.ts.map +1 -0
- package/dist/domain/entities/image.entity.js +64 -0
- package/dist/domain/entities/image.entity.js.map +1 -0
- package/dist/domain/entities/user.entity.d.ts +2 -0
- package/dist/domain/entities/user.entity.d.ts.map +1 -1
- package/dist/domain/entities/user.entity.js +6 -0
- package/dist/domain/entities/user.entity.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class Image {
|
|
2
|
+
id: number;
|
|
3
|
+
key: string;
|
|
4
|
+
thumbnailKey: string;
|
|
5
|
+
type: string;
|
|
6
|
+
typeId: number;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
updatedAt: string;
|
|
9
|
+
url: string;
|
|
10
|
+
thumbUrl: string;
|
|
11
|
+
setUrl(): void;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=image.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.entity.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/image.entity.ts"],"names":[],"mappings":"AAUA,qBACa,KAAK;IAEhB,EAAE,EAAE,MAAM,CAAC;IAGX,GAAG,EAAE,MAAM,CAAC;IAGZ,YAAY,EAAE,MAAM,CAAC;IAGrB,IAAI,EAAE,MAAM,CAAC;IAGb,MAAM,EAAE,MAAM,CAAC;IAGf,SAAS,EAAE,MAAM,CAAC;IAGlB,SAAS,EAAE,MAAM,CAAC;IAElB,GAAG,EAAE,MAAM,CAAC;IAEZ,QAAQ,EAAE,MAAM,CAAC;IAGjB,MAAM;CAUP"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Image = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const request_store_1 = require("../../request-store");
|
|
15
|
+
let Image = class Image {
|
|
16
|
+
setUrl() {
|
|
17
|
+
const baseUrl = (0, request_store_1.getS3BaseUrl)();
|
|
18
|
+
if (baseUrl && this.key) {
|
|
19
|
+
this.url = `${baseUrl}/${this.key}`;
|
|
20
|
+
}
|
|
21
|
+
if (baseUrl && this.thumbnailKey) {
|
|
22
|
+
this.thumbUrl = `${baseUrl}/${this.thumbnailKey}`;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.Image = Image;
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
29
|
+
__metadata("design:type", Number)
|
|
30
|
+
], Image.prototype, "id", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)(),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], Image.prototype, "key", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)(),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], Image.prototype, "thumbnailKey", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)(),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], Image.prototype, "type", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)(),
|
|
45
|
+
__metadata("design:type", Number)
|
|
46
|
+
], Image.prototype, "typeId", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], Image.prototype, "createdAt", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], Image.prototype, "updatedAt", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.AfterLoad)(),
|
|
57
|
+
__metadata("design:type", Function),
|
|
58
|
+
__metadata("design:paramtypes", []),
|
|
59
|
+
__metadata("design:returntype", void 0)
|
|
60
|
+
], Image.prototype, "setUrl", null);
|
|
61
|
+
exports.Image = Image = __decorate([
|
|
62
|
+
(0, typeorm_1.Entity)()
|
|
63
|
+
], Image);
|
|
64
|
+
//# sourceMappingURL=image.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.entity.js","sourceRoot":"","sources":["../../../src/domain/entities/image.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAOiB;AACjB,uDAAmD;AAG5C,IAAM,KAAK,GAAX,MAAM,KAAK;IA2BhB,MAAM;QACJ,MAAM,OAAO,GAAG,IAAA,4BAAY,GAAE,CAAC;QAC/B,IAAI,OAAO,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;YACxB,IAAI,CAAC,GAAG,GAAG,GAAG,OAAO,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;QACtC,CAAC;QAED,IAAI,OAAO,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,GAAG,OAAO,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;QACpD,CAAC;IACH,CAAC;CACF,CAAA;AArCY,sBAAK;AAEhB;IADC,IAAA,gCAAsB,GAAE;;iCACd;AAGX;IADC,IAAA,gBAAM,GAAE;;kCACG;AAGZ;IADC,IAAA,gBAAM,GAAE;;2CACY;AAGrB;IADC,IAAA,gBAAM,GAAE;;mCACI;AAGb;IADC,IAAA,gBAAM,GAAE;;qCACM;AAGf;IADC,IAAA,0BAAgB,GAAE;;wCACD;AAGlB;IADC,IAAA,0BAAgB,GAAE;;wCACD;AAOlB;IADC,IAAA,mBAAS,GAAE;;;;mCAUX;gBApCU,KAAK;IADjB,IAAA,gBAAM,GAAE;GACI,KAAK,CAqCjB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Image } from './image.entity';
|
|
1
2
|
import { Profile } from './profile.entity';
|
|
2
3
|
export declare class User {
|
|
3
4
|
id: number;
|
|
@@ -9,6 +10,7 @@ export declare class User {
|
|
|
9
10
|
password: string;
|
|
10
11
|
isActive: boolean;
|
|
11
12
|
isSuperuser: boolean;
|
|
13
|
+
picture: Image;
|
|
12
14
|
roleId: number;
|
|
13
15
|
departmentId: number;
|
|
14
16
|
pictureId: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.entity.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/user.entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"user.entity.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/user.entity.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,qBACa,IAAI;IAEf,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;IAGb,QAAQ,EAAE,MAAM,CAAC;IAGjB,QAAQ,EAAE,MAAM,CAAC;IAGjB,KAAK,EAAE,MAAM,CAAC;IAGd,MAAM,EAAE,MAAM,CAAC;IAGf,QAAQ,EAAE,MAAM,CAAC;IAGjB,QAAQ,EAAE,OAAO,CAAC;IAGlB,WAAW,EAAE,OAAO,CAAC;IAIrB,OAAO,EAAE,KAAK,CAAC;IAGf,MAAM,EAAE,MAAM,CAAC;IAGf,YAAY,EAAE,MAAM,CAAC;IAGrB,SAAS,EAAE,MAAM,CAAC;IAQlB,QAAQ,EAAE,OAAO,EAAE,CAAC;IAGpB,SAAS,EAAE,MAAM,CAAC;IAGlB,SAAS,EAAE,MAAM,CAAC;IAEZ,cAAc,CAAC,iBAAiB,EAAE,MAAM;IAKxC,YAAY;CAGnB"}
|
|
@@ -35,6 +35,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
35
35
|
exports.User = void 0;
|
|
36
36
|
const bcrypt = __importStar(require("bcrypt"));
|
|
37
37
|
const typeorm_1 = require("typeorm");
|
|
38
|
+
const image_entity_1 = require("./image.entity");
|
|
38
39
|
const profile_entity_1 = require("./profile.entity");
|
|
39
40
|
let User = class User {
|
|
40
41
|
async verifyPassword(plainTextPassword) {
|
|
@@ -81,6 +82,11 @@ __decorate([
|
|
|
81
82
|
(0, typeorm_1.Column)({ default: false }),
|
|
82
83
|
__metadata("design:type", Boolean)
|
|
83
84
|
], User.prototype, "isSuperuser", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, typeorm_1.OneToOne)(() => image_entity_1.Image, { eager: true }),
|
|
87
|
+
(0, typeorm_1.JoinColumn)(),
|
|
88
|
+
__metadata("design:type", image_entity_1.Image)
|
|
89
|
+
], User.prototype, "picture", void 0);
|
|
84
90
|
__decorate([
|
|
85
91
|
(0, typeorm_1.Column)(),
|
|
86
92
|
__metadata("design:type", Number)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../../src/domain/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;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