easywork-common-lib 1.0.506 → 1.0.507
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.
|
@@ -41,74 +41,98 @@ let User = class User extends base_entity_1.EntityBase {
|
|
|
41
41
|
menuPermissions;
|
|
42
42
|
cua;
|
|
43
43
|
get name() {
|
|
44
|
-
return `${this.profile?.firstName ??
|
|
44
|
+
return `${this.profile?.firstName ?? ""} ${this.profile?.lastName ?? ""}`.trim();
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
exports.User = User;
|
|
48
48
|
__decorate([
|
|
49
|
-
(0, swagger_1.ApiProperty)({ type: String, description:
|
|
49
|
+
(0, swagger_1.ApiProperty)({ type: String, description: "Unique username" }),
|
|
50
50
|
(0, typeorm_1.Column)({ unique: true }),
|
|
51
51
|
__metadata("design:type", String)
|
|
52
52
|
], User.prototype, "username", void 0);
|
|
53
53
|
__decorate([
|
|
54
|
-
(0, swagger_1.ApiProperty)({ type: String, description:
|
|
54
|
+
(0, swagger_1.ApiProperty)({ type: String, description: "Unique email address" }),
|
|
55
55
|
(0, typeorm_1.Column)({ unique: true }),
|
|
56
56
|
__metadata("design:type", String)
|
|
57
57
|
], User.prototype, "email", void 0);
|
|
58
58
|
__decorate([
|
|
59
|
-
(0, swagger_1.ApiProperty)({ type: String, description:
|
|
60
|
-
(0, typeorm_1.Column)({ type: "text" }),
|
|
59
|
+
(0, swagger_1.ApiProperty)({ type: String, description: "User bio", nullable: true }),
|
|
60
|
+
(0, typeorm_1.Column)({ type: "text", nullable: true }),
|
|
61
61
|
__metadata("design:type", String)
|
|
62
62
|
], User.prototype, "bio", void 0);
|
|
63
63
|
__decorate([
|
|
64
|
-
(0, swagger_1.ApiProperty)({ type: String, description:
|
|
64
|
+
(0, swagger_1.ApiProperty)({ type: String, description: "User avatar URL" }),
|
|
65
65
|
(0, typeorm_1.Column)({ type: "text" }),
|
|
66
66
|
__metadata("design:type", String)
|
|
67
67
|
], User.prototype, "avatar", void 0);
|
|
68
68
|
__decorate([
|
|
69
69
|
(0, class_transformer_1.Exclude)(),
|
|
70
|
-
(0, swagger_1.ApiProperty)({ type: String, description:
|
|
70
|
+
(0, swagger_1.ApiProperty)({ type: String, description: "Password hash", writeOnly: true }),
|
|
71
71
|
(0, typeorm_1.Column)({ type: "text" }),
|
|
72
72
|
__metadata("design:type", String)
|
|
73
73
|
], User.prototype, "hash", void 0);
|
|
74
74
|
__decorate([
|
|
75
75
|
(0, class_transformer_1.Exclude)(),
|
|
76
|
-
(0, swagger_1.ApiProperty)({
|
|
76
|
+
(0, swagger_1.ApiProperty)({
|
|
77
|
+
type: String,
|
|
78
|
+
description: "Two-factor authentication secret",
|
|
79
|
+
required: false,
|
|
80
|
+
writeOnly: true,
|
|
81
|
+
}),
|
|
77
82
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
78
83
|
__metadata("design:type", String)
|
|
79
84
|
], User.prototype, "twoFactorSecret", void 0);
|
|
80
85
|
__decorate([
|
|
81
|
-
(0, swagger_1.ApiProperty)({
|
|
86
|
+
(0, swagger_1.ApiProperty)({
|
|
87
|
+
type: Boolean,
|
|
88
|
+
description: "Is two-factor authentication enabled",
|
|
89
|
+
default: false,
|
|
90
|
+
}),
|
|
82
91
|
(0, typeorm_1.Column)({ default: false }),
|
|
83
92
|
__metadata("design:type", Boolean)
|
|
84
93
|
], User.prototype, "isTwoFactorEnabled", void 0);
|
|
85
94
|
__decorate([
|
|
86
|
-
(0, swagger_1.ApiProperty)({
|
|
95
|
+
(0, swagger_1.ApiProperty)({
|
|
96
|
+
type: String,
|
|
97
|
+
description: "User phone number",
|
|
98
|
+
required: false,
|
|
99
|
+
}),
|
|
87
100
|
(0, typeorm_1.Column)({ unique: true }),
|
|
88
101
|
__metadata("design:type", String)
|
|
89
102
|
], User.prototype, "phone", void 0);
|
|
90
103
|
__decorate([
|
|
91
|
-
(0, swagger_1.ApiProperty)({
|
|
104
|
+
(0, swagger_1.ApiProperty)({
|
|
105
|
+
type: Boolean,
|
|
106
|
+
description: "Is user verified",
|
|
107
|
+
default: false,
|
|
108
|
+
}),
|
|
92
109
|
(0, typeorm_1.Column)({ default: false }),
|
|
93
110
|
__metadata("design:type", Boolean)
|
|
94
111
|
], User.prototype, "isVerified", void 0);
|
|
95
112
|
__decorate([
|
|
96
|
-
(0, swagger_1.ApiProperty)({
|
|
113
|
+
(0, swagger_1.ApiProperty)({
|
|
114
|
+
type: Date,
|
|
115
|
+
description: "Last login timestamp",
|
|
116
|
+
required: false,
|
|
117
|
+
}),
|
|
97
118
|
(0, typeorm_1.Column)({ type: "timestamp", nullable: true }),
|
|
98
119
|
__metadata("design:type", Date)
|
|
99
120
|
], User.prototype, "lastLogin", void 0);
|
|
100
121
|
__decorate([
|
|
101
|
-
(0, swagger_1.ApiProperty)({ type: () => profile_entity_1.Profile, description:
|
|
122
|
+
(0, swagger_1.ApiProperty)({ type: () => profile_entity_1.Profile, description: "User profile" }),
|
|
102
123
|
(0, typeorm_1.OneToOne)(() => profile_entity_1.Profile, {
|
|
103
124
|
onDelete: "CASCADE",
|
|
104
125
|
onUpdate: "CASCADE",
|
|
105
|
-
eager: true
|
|
126
|
+
eager: true,
|
|
106
127
|
}),
|
|
107
128
|
(0, typeorm_1.JoinColumn)(),
|
|
108
129
|
__metadata("design:type", profile_entity_1.Profile)
|
|
109
130
|
], User.prototype, "profile", void 0);
|
|
110
131
|
__decorate([
|
|
111
|
-
(0, swagger_1.ApiProperty)({
|
|
132
|
+
(0, swagger_1.ApiProperty)({
|
|
133
|
+
type: () => [role_entity_1.Role],
|
|
134
|
+
description: "Roles assigned to the user",
|
|
135
|
+
}),
|
|
112
136
|
(0, typeorm_1.ManyToMany)(() => role_entity_1.Role, {
|
|
113
137
|
onDelete: "CASCADE",
|
|
114
138
|
onUpdate: "CASCADE",
|
|
@@ -117,22 +141,34 @@ __decorate([
|
|
|
117
141
|
__metadata("design:type", Array)
|
|
118
142
|
], User.prototype, "roles", void 0);
|
|
119
143
|
__decorate([
|
|
120
|
-
(0, swagger_1.ApiProperty)({
|
|
144
|
+
(0, swagger_1.ApiProperty)({
|
|
145
|
+
type: () => [tag_entity_1.Tag],
|
|
146
|
+
description: "Tags associated with the user",
|
|
147
|
+
}),
|
|
121
148
|
(0, typeorm_1.OneToMany)(() => tag_entity_1.Tag, (tag) => tag.user),
|
|
122
149
|
__metadata("design:type", Array)
|
|
123
150
|
], User.prototype, "tags", void 0);
|
|
124
151
|
__decorate([
|
|
125
|
-
(0, swagger_1.ApiProperty)({
|
|
152
|
+
(0, swagger_1.ApiProperty)({
|
|
153
|
+
type: () => [push_token_entity_1.PushToken],
|
|
154
|
+
description: "Push tokens associated with the user",
|
|
155
|
+
}),
|
|
126
156
|
(0, typeorm_1.OneToMany)(() => push_token_entity_1.PushToken, (pushToken) => pushToken.user),
|
|
127
157
|
__metadata("design:type", Array)
|
|
128
158
|
], User.prototype, "pushTokens", void 0);
|
|
129
159
|
__decorate([
|
|
130
|
-
(0, swagger_1.ApiProperty)({
|
|
160
|
+
(0, swagger_1.ApiProperty)({
|
|
161
|
+
type: () => [user_email_relation_entity_1.UserEmailRelation],
|
|
162
|
+
description: "Email relations associated with the user",
|
|
163
|
+
}),
|
|
131
164
|
(0, typeorm_1.OneToMany)(() => user_email_relation_entity_1.UserEmailRelation, (relation) => relation.user),
|
|
132
165
|
__metadata("design:type", Array)
|
|
133
166
|
], User.prototype, "emailRelations", void 0);
|
|
134
167
|
__decorate([
|
|
135
|
-
(0, swagger_1.ApiProperty)({
|
|
168
|
+
(0, swagger_1.ApiProperty)({
|
|
169
|
+
type: () => [group_entity_1.Group],
|
|
170
|
+
description: "Groups assigned to the user",
|
|
171
|
+
}),
|
|
136
172
|
(0, typeorm_1.ManyToMany)(() => group_entity_1.Group, (group) => group.users, {
|
|
137
173
|
onDelete: "CASCADE",
|
|
138
174
|
onUpdate: "CASCADE",
|
|
@@ -141,22 +177,22 @@ __decorate([
|
|
|
141
177
|
__metadata("design:type", Array)
|
|
142
178
|
], User.prototype, "groups", void 0);
|
|
143
179
|
__decorate([
|
|
144
|
-
(0, swagger_1.ApiProperty)({ type: () => menu_permissions_entity_1.MenuPermissions, description:
|
|
180
|
+
(0, swagger_1.ApiProperty)({ type: () => menu_permissions_entity_1.MenuPermissions, description: "Menu Permissions" }),
|
|
145
181
|
(0, typeorm_1.OneToOne)(() => menu_permissions_entity_1.MenuPermissions, {
|
|
146
182
|
onDelete: "CASCADE",
|
|
147
183
|
onUpdate: "CASCADE",
|
|
148
|
-
eager: true
|
|
184
|
+
eager: true,
|
|
149
185
|
}),
|
|
150
186
|
(0, typeorm_1.JoinColumn)(),
|
|
151
187
|
__metadata("design:type", menu_permissions_entity_1.MenuPermissions)
|
|
152
188
|
], User.prototype, "menuPermissions", void 0);
|
|
153
189
|
__decorate([
|
|
154
|
-
(0, swagger_1.ApiProperty)({ type: String, description:
|
|
190
|
+
(0, swagger_1.ApiProperty)({ type: String, description: "CUA", required: false }),
|
|
155
191
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
156
192
|
__metadata("design:type", String)
|
|
157
193
|
], User.prototype, "cua", void 0);
|
|
158
194
|
__decorate([
|
|
159
|
-
(0, swagger_1.ApiProperty)({ type: String, description:
|
|
195
|
+
(0, swagger_1.ApiProperty)({ type: String, description: "Full name of the user" }),
|
|
160
196
|
__metadata("design:type", String),
|
|
161
197
|
__metadata("design:paramtypes", [])
|
|
162
198
|
], User.prototype, "name", null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gEAA4D;AAC5D,
|
|
1
|
+
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gEAA4D;AAC5D,qCAQiB;AACjB,yDAA4C;AAC5C,qDAA2C;AAC3C,+CAAqC;AACrC,6CAAmC;AACnC,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