@experts_hub/shared 1.0.26 → 1.0.27
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/base.entity.d.ts +11 -0
- package/dist/entities/user.entity.d.ts +27 -8
- package/dist/index.d.mts +39 -9
- package/dist/index.d.ts +39 -9
- package/dist/index.js +116 -33
- package/dist/index.mjs +124 -28
- package/package.json +1 -1
|
@@ -1,14 +1,33 @@
|
|
|
1
|
+
import { BaseEntity } from './base.entity';
|
|
1
2
|
import { RefreshToken } from './refresh-token.entity';
|
|
2
|
-
export declare
|
|
3
|
-
|
|
3
|
+
export declare enum AccountType {
|
|
4
|
+
ADMIN = "ADMIN",
|
|
5
|
+
SUB_ADMIN = "SUB_ADMIN",
|
|
6
|
+
CLIENT = "CLIENT",
|
|
7
|
+
FREELANCER = "FREELANCER"
|
|
8
|
+
}
|
|
9
|
+
export declare enum AccountStatus {
|
|
10
|
+
INACTIVE = "INACTIVE",
|
|
11
|
+
ACTIVE = "ACTIVE",
|
|
12
|
+
SUSPENDED = "SUSPENDED",
|
|
13
|
+
BLOCKED = "BLOCKED"
|
|
14
|
+
}
|
|
15
|
+
export declare class User extends BaseEntity {
|
|
16
|
+
uniqueId: string;
|
|
4
17
|
username: string;
|
|
5
|
-
email: string;
|
|
6
|
-
password: string;
|
|
7
18
|
firstName: string;
|
|
8
19
|
lastName: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
20
|
+
dateOfBirth: Date;
|
|
21
|
+
gender: string;
|
|
22
|
+
profilePictureUrl: string;
|
|
23
|
+
email: string;
|
|
24
|
+
mobile: string;
|
|
25
|
+
password: string;
|
|
26
|
+
accountType: AccountType;
|
|
27
|
+
accountStatus: AccountStatus;
|
|
28
|
+
isEmailVerified: boolean;
|
|
29
|
+
isMobileVerified: boolean;
|
|
30
|
+
lastLoginAt: Date;
|
|
31
|
+
lastLoginIp: string;
|
|
13
32
|
refreshTokens: RefreshToken[];
|
|
14
33
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -14,6 +14,18 @@ declare const UserTCPAdapter: () => MicroserviceOptions;
|
|
|
14
14
|
|
|
15
15
|
declare const UserRMQAdapter: (mode?: string) => MicroserviceOptions;
|
|
16
16
|
|
|
17
|
+
declare abstract class BaseEntity {
|
|
18
|
+
id: number;
|
|
19
|
+
uuid: string;
|
|
20
|
+
createdAt: Date;
|
|
21
|
+
createdBy: number;
|
|
22
|
+
updatedAt: Date;
|
|
23
|
+
updatedBy: number;
|
|
24
|
+
isDeleted: boolean;
|
|
25
|
+
deletedBy: number;
|
|
26
|
+
deletedAt: Date;
|
|
27
|
+
}
|
|
28
|
+
|
|
17
29
|
declare class RefreshToken {
|
|
18
30
|
id: string;
|
|
19
31
|
userId: string;
|
|
@@ -26,18 +38,36 @@ declare class RefreshToken {
|
|
|
26
38
|
user: User;
|
|
27
39
|
}
|
|
28
40
|
|
|
29
|
-
declare
|
|
30
|
-
|
|
41
|
+
declare enum AccountType {
|
|
42
|
+
ADMIN = "ADMIN",
|
|
43
|
+
SUB_ADMIN = "SUB_ADMIN",
|
|
44
|
+
CLIENT = "CLIENT",
|
|
45
|
+
FREELANCER = "FREELANCER"
|
|
46
|
+
}
|
|
47
|
+
declare enum AccountStatus {
|
|
48
|
+
INACTIVE = "INACTIVE",
|
|
49
|
+
ACTIVE = "ACTIVE",
|
|
50
|
+
SUSPENDED = "SUSPENDED",
|
|
51
|
+
BLOCKED = "BLOCKED"
|
|
52
|
+
}
|
|
53
|
+
declare class User extends BaseEntity {
|
|
54
|
+
uniqueId: string;
|
|
31
55
|
username: string;
|
|
32
|
-
email: string;
|
|
33
|
-
password: string;
|
|
34
56
|
firstName: string;
|
|
35
57
|
lastName: string;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
58
|
+
dateOfBirth: Date;
|
|
59
|
+
gender: string;
|
|
60
|
+
profilePictureUrl: string;
|
|
61
|
+
email: string;
|
|
62
|
+
mobile: string;
|
|
63
|
+
password: string;
|
|
64
|
+
accountType: AccountType;
|
|
65
|
+
accountStatus: AccountStatus;
|
|
66
|
+
isEmailVerified: boolean;
|
|
67
|
+
isMobileVerified: boolean;
|
|
68
|
+
lastLoginAt: Date;
|
|
69
|
+
lastLoginIp: string;
|
|
40
70
|
refreshTokens: RefreshToken[];
|
|
41
71
|
}
|
|
42
72
|
|
|
43
|
-
export { AUTHENTICATION_PATTERN, RefreshToken, User, UserRMQAdapter, UserTCPAdapter };
|
|
73
|
+
export { AUTHENTICATION_PATTERN, AccountStatus, AccountType, RefreshToken, User, UserRMQAdapter, UserTCPAdapter };
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,18 @@ declare const UserTCPAdapter: () => MicroserviceOptions;
|
|
|
14
14
|
|
|
15
15
|
declare const UserRMQAdapter: (mode?: string) => MicroserviceOptions;
|
|
16
16
|
|
|
17
|
+
declare abstract class BaseEntity {
|
|
18
|
+
id: number;
|
|
19
|
+
uuid: string;
|
|
20
|
+
createdAt: Date;
|
|
21
|
+
createdBy: number;
|
|
22
|
+
updatedAt: Date;
|
|
23
|
+
updatedBy: number;
|
|
24
|
+
isDeleted: boolean;
|
|
25
|
+
deletedBy: number;
|
|
26
|
+
deletedAt: Date;
|
|
27
|
+
}
|
|
28
|
+
|
|
17
29
|
declare class RefreshToken {
|
|
18
30
|
id: string;
|
|
19
31
|
userId: string;
|
|
@@ -26,18 +38,36 @@ declare class RefreshToken {
|
|
|
26
38
|
user: User;
|
|
27
39
|
}
|
|
28
40
|
|
|
29
|
-
declare
|
|
30
|
-
|
|
41
|
+
declare enum AccountType {
|
|
42
|
+
ADMIN = "ADMIN",
|
|
43
|
+
SUB_ADMIN = "SUB_ADMIN",
|
|
44
|
+
CLIENT = "CLIENT",
|
|
45
|
+
FREELANCER = "FREELANCER"
|
|
46
|
+
}
|
|
47
|
+
declare enum AccountStatus {
|
|
48
|
+
INACTIVE = "INACTIVE",
|
|
49
|
+
ACTIVE = "ACTIVE",
|
|
50
|
+
SUSPENDED = "SUSPENDED",
|
|
51
|
+
BLOCKED = "BLOCKED"
|
|
52
|
+
}
|
|
53
|
+
declare class User extends BaseEntity {
|
|
54
|
+
uniqueId: string;
|
|
31
55
|
username: string;
|
|
32
|
-
email: string;
|
|
33
|
-
password: string;
|
|
34
56
|
firstName: string;
|
|
35
57
|
lastName: string;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
58
|
+
dateOfBirth: Date;
|
|
59
|
+
gender: string;
|
|
60
|
+
profilePictureUrl: string;
|
|
61
|
+
email: string;
|
|
62
|
+
mobile: string;
|
|
63
|
+
password: string;
|
|
64
|
+
accountType: AccountType;
|
|
65
|
+
accountStatus: AccountStatus;
|
|
66
|
+
isEmailVerified: boolean;
|
|
67
|
+
isMobileVerified: boolean;
|
|
68
|
+
lastLoginAt: Date;
|
|
69
|
+
lastLoginIp: string;
|
|
40
70
|
refreshTokens: RefreshToken[];
|
|
41
71
|
}
|
|
42
72
|
|
|
43
|
-
export { AUTHENTICATION_PATTERN, RefreshToken, User, UserRMQAdapter, UserTCPAdapter };
|
|
73
|
+
export { AUTHENTICATION_PATTERN, AccountStatus, AccountType, RefreshToken, User, UserRMQAdapter, UserTCPAdapter };
|
package/dist/index.js
CHANGED
|
@@ -28,6 +28,8 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
28
28
|
var index_exports = {};
|
|
29
29
|
__export(index_exports, {
|
|
30
30
|
AUTHENTICATION_PATTERN: () => AUTHENTICATION_PATTERN,
|
|
31
|
+
AccountStatus: () => AccountStatus,
|
|
32
|
+
AccountType: () => AccountType,
|
|
31
33
|
RefreshToken: () => RefreshToken,
|
|
32
34
|
User: () => User,
|
|
33
35
|
UserRMQAdapter: () => UserRMQAdapter,
|
|
@@ -119,86 +121,167 @@ var UserRMQAdapter = (mode = "microservice") => {
|
|
|
119
121
|
};
|
|
120
122
|
|
|
121
123
|
// src/entities/user.entity.ts
|
|
122
|
-
var
|
|
124
|
+
var import_typeorm3 = require("typeorm");
|
|
123
125
|
|
|
124
|
-
// src/entities/
|
|
126
|
+
// src/entities/base.entity.ts
|
|
125
127
|
var import_typeorm = require("typeorm");
|
|
128
|
+
var BaseEntity = class {
|
|
129
|
+
};
|
|
130
|
+
__decorateClass([
|
|
131
|
+
(0, import_typeorm.PrimaryGeneratedColumn)("increment", { type: "integer" })
|
|
132
|
+
], BaseEntity.prototype, "id", 2);
|
|
133
|
+
__decorateClass([
|
|
134
|
+
(0, import_typeorm.Column)({ type: "uuid" }),
|
|
135
|
+
(0, import_typeorm.Generated)("uuid")
|
|
136
|
+
], BaseEntity.prototype, "uuid", 2);
|
|
137
|
+
__decorateClass([
|
|
138
|
+
(0, import_typeorm.CreateDateColumn)({ name: "created_at", type: "timestamp with time zone" })
|
|
139
|
+
], BaseEntity.prototype, "createdAt", 2);
|
|
140
|
+
__decorateClass([
|
|
141
|
+
(0, import_typeorm.Column)({ name: "created_by", type: "integer", nullable: true })
|
|
142
|
+
], BaseEntity.prototype, "createdBy", 2);
|
|
143
|
+
__decorateClass([
|
|
144
|
+
(0, import_typeorm.UpdateDateColumn)({ name: "updated_at", type: "timestamp with time zone" })
|
|
145
|
+
], BaseEntity.prototype, "updatedAt", 2);
|
|
146
|
+
__decorateClass([
|
|
147
|
+
(0, import_typeorm.Column)({ name: "updated_by", type: "integer", nullable: true })
|
|
148
|
+
], BaseEntity.prototype, "updatedBy", 2);
|
|
149
|
+
__decorateClass([
|
|
150
|
+
(0, import_typeorm.Column)({ name: "is_deleted", type: "boolean", default: false })
|
|
151
|
+
], BaseEntity.prototype, "isDeleted", 2);
|
|
152
|
+
__decorateClass([
|
|
153
|
+
(0, import_typeorm.Column)({ name: "deleted_by", type: "integer", nullable: true })
|
|
154
|
+
], BaseEntity.prototype, "deletedBy", 2);
|
|
155
|
+
__decorateClass([
|
|
156
|
+
(0, import_typeorm.DeleteDateColumn)({
|
|
157
|
+
name: "deleted_at",
|
|
158
|
+
type: "timestamp with time zone",
|
|
159
|
+
nullable: true
|
|
160
|
+
})
|
|
161
|
+
], BaseEntity.prototype, "deletedAt", 2);
|
|
162
|
+
|
|
163
|
+
// src/entities/refresh-token.entity.ts
|
|
164
|
+
var import_typeorm2 = require("typeorm");
|
|
126
165
|
var RefreshToken = class {
|
|
127
166
|
};
|
|
128
167
|
__decorateClass([
|
|
129
|
-
(0,
|
|
168
|
+
(0, import_typeorm2.PrimaryGeneratedColumn)("uuid")
|
|
130
169
|
], RefreshToken.prototype, "id", 2);
|
|
131
170
|
__decorateClass([
|
|
132
|
-
(0,
|
|
171
|
+
(0, import_typeorm2.Column)({ name: "user_id", type: "integer" })
|
|
133
172
|
], RefreshToken.prototype, "userId", 2);
|
|
134
173
|
__decorateClass([
|
|
135
|
-
(0,
|
|
174
|
+
(0, import_typeorm2.Column)({ name: "token_id", type: "varchar" })
|
|
136
175
|
], RefreshToken.prototype, "tokenId", 2);
|
|
137
176
|
__decorateClass([
|
|
138
|
-
(0,
|
|
177
|
+
(0, import_typeorm2.Column)({ name: "device_info", type: "json", nullable: true })
|
|
139
178
|
], RefreshToken.prototype, "deviceInfo", 2);
|
|
140
179
|
__decorateClass([
|
|
141
|
-
(0,
|
|
180
|
+
(0, import_typeorm2.Column)({ name: "is_revoked", type: "boolean", default: false })
|
|
142
181
|
], RefreshToken.prototype, "isRevoked", 2);
|
|
143
182
|
__decorateClass([
|
|
144
|
-
(0,
|
|
183
|
+
(0, import_typeorm2.Column)({ name: "expires_at", type: "timestamp with time zone" })
|
|
145
184
|
], RefreshToken.prototype, "expiresAt", 2);
|
|
146
185
|
__decorateClass([
|
|
147
|
-
(0,
|
|
186
|
+
(0, import_typeorm2.CreateDateColumn)({ name: "created_at", type: "timestamp with time zone" })
|
|
148
187
|
], RefreshToken.prototype, "createdAt", 2);
|
|
149
188
|
__decorateClass([
|
|
150
|
-
(0,
|
|
189
|
+
(0, import_typeorm2.UpdateDateColumn)({ name: "updated_at", type: "timestamp with time zone" })
|
|
151
190
|
], RefreshToken.prototype, "updatedAt", 2);
|
|
152
191
|
__decorateClass([
|
|
153
|
-
(0,
|
|
154
|
-
(0,
|
|
192
|
+
(0, import_typeorm2.ManyToOne)(() => User, (user) => user.refreshTokens),
|
|
193
|
+
(0, import_typeorm2.JoinColumn)({ name: "user_id" })
|
|
155
194
|
], RefreshToken.prototype, "user", 2);
|
|
156
195
|
RefreshToken = __decorateClass([
|
|
157
|
-
(0,
|
|
196
|
+
(0, import_typeorm2.Entity)("refresh_tokens")
|
|
158
197
|
], RefreshToken);
|
|
159
198
|
|
|
160
199
|
// src/entities/user.entity.ts
|
|
161
|
-
var
|
|
200
|
+
var AccountType = /* @__PURE__ */ ((AccountType2) => {
|
|
201
|
+
AccountType2["ADMIN"] = "ADMIN";
|
|
202
|
+
AccountType2["SUB_ADMIN"] = "SUB_ADMIN";
|
|
203
|
+
AccountType2["CLIENT"] = "CLIENT";
|
|
204
|
+
AccountType2["FREELANCER"] = "FREELANCER";
|
|
205
|
+
return AccountType2;
|
|
206
|
+
})(AccountType || {});
|
|
207
|
+
var AccountStatus = /* @__PURE__ */ ((AccountStatus2) => {
|
|
208
|
+
AccountStatus2["INACTIVE"] = "INACTIVE";
|
|
209
|
+
AccountStatus2["ACTIVE"] = "ACTIVE";
|
|
210
|
+
AccountStatus2["SUSPENDED"] = "SUSPENDED";
|
|
211
|
+
AccountStatus2["BLOCKED"] = "BLOCKED";
|
|
212
|
+
return AccountStatus2;
|
|
213
|
+
})(AccountStatus || {});
|
|
214
|
+
var User = class extends BaseEntity {
|
|
162
215
|
};
|
|
163
216
|
__decorateClass([
|
|
164
|
-
(0,
|
|
165
|
-
], User.prototype, "
|
|
217
|
+
(0, import_typeorm3.Column)({ name: "unique_id", type: "varchar", unique: true })
|
|
218
|
+
], User.prototype, "uniqueId", 2);
|
|
166
219
|
__decorateClass([
|
|
167
|
-
(0,
|
|
220
|
+
(0, import_typeorm3.Column)({ name: "username", type: "varchar", unique: true, nullable: true })
|
|
168
221
|
], User.prototype, "username", 2);
|
|
169
222
|
__decorateClass([
|
|
170
|
-
(0,
|
|
223
|
+
(0, import_typeorm3.Column)({ name: "first_name", type: "varchar", length: 100, nullable: true })
|
|
224
|
+
], User.prototype, "firstName", 2);
|
|
225
|
+
__decorateClass([
|
|
226
|
+
(0, import_typeorm3.Column)({ name: "last_name", type: "varchar", length: 100, nullable: true })
|
|
227
|
+
], User.prototype, "lastName", 2);
|
|
228
|
+
__decorateClass([
|
|
229
|
+
(0, import_typeorm3.Column)({ name: "date_of_birth", type: "date", nullable: true })
|
|
230
|
+
], User.prototype, "dateOfBirth", 2);
|
|
231
|
+
__decorateClass([
|
|
232
|
+
(0, import_typeorm3.Column)({ name: "gender", type: "varchar", length: 10, nullable: true })
|
|
233
|
+
], User.prototype, "gender", 2);
|
|
234
|
+
__decorateClass([
|
|
235
|
+
(0, import_typeorm3.Column)({ name: "profile_picture_url", type: "text", nullable: true })
|
|
236
|
+
], User.prototype, "profilePictureUrl", 2);
|
|
237
|
+
__decorateClass([
|
|
238
|
+
(0, import_typeorm3.Column)({ name: "email", type: "varchar", unique: true })
|
|
171
239
|
], User.prototype, "email", 2);
|
|
172
240
|
__decorateClass([
|
|
173
|
-
(0,
|
|
241
|
+
(0, import_typeorm3.Column)({ name: "mobile", type: "varchar", unique: true, nullable: true })
|
|
242
|
+
], User.prototype, "mobile", 2);
|
|
243
|
+
__decorateClass([
|
|
244
|
+
(0, import_typeorm3.Column)({ name: "password", type: "varchar" })
|
|
174
245
|
], User.prototype, "password", 2);
|
|
175
246
|
__decorateClass([
|
|
176
|
-
(0,
|
|
177
|
-
|
|
247
|
+
(0, import_typeorm3.Column)({
|
|
248
|
+
name: "account_type",
|
|
249
|
+
type: "enum",
|
|
250
|
+
enum: AccountType,
|
|
251
|
+
default: "FREELANCER" /* FREELANCER */
|
|
252
|
+
})
|
|
253
|
+
], User.prototype, "accountType", 2);
|
|
178
254
|
__decorateClass([
|
|
179
|
-
(0,
|
|
180
|
-
|
|
255
|
+
(0, import_typeorm3.Column)({
|
|
256
|
+
name: "account_status",
|
|
257
|
+
type: "enum",
|
|
258
|
+
enum: AccountStatus,
|
|
259
|
+
default: "INACTIVE" /* INACTIVE */
|
|
260
|
+
})
|
|
261
|
+
], User.prototype, "accountStatus", 2);
|
|
181
262
|
__decorateClass([
|
|
182
|
-
(0,
|
|
183
|
-
], User.prototype, "
|
|
263
|
+
(0, import_typeorm3.Column)({ name: "is_email_verified", type: "boolean", default: false })
|
|
264
|
+
], User.prototype, "isEmailVerified", 2);
|
|
184
265
|
__decorateClass([
|
|
185
|
-
(0,
|
|
186
|
-
], User.prototype, "
|
|
266
|
+
(0, import_typeorm3.Column)({ name: "is_mobile_verified", type: "boolean", default: false })
|
|
267
|
+
], User.prototype, "isMobileVerified", 2);
|
|
187
268
|
__decorateClass([
|
|
188
|
-
(0,
|
|
189
|
-
], User.prototype, "
|
|
269
|
+
(0, import_typeorm3.Column)({ name: "last_login_at", type: "timestamp with time zone", nullable: true })
|
|
270
|
+
], User.prototype, "lastLoginAt", 2);
|
|
190
271
|
__decorateClass([
|
|
191
|
-
(0,
|
|
192
|
-
], User.prototype, "
|
|
272
|
+
(0, import_typeorm3.Column)({ name: "last_login_ip", type: "varchar", nullable: true })
|
|
273
|
+
], User.prototype, "lastLoginIp", 2);
|
|
193
274
|
__decorateClass([
|
|
194
|
-
(0,
|
|
275
|
+
(0, import_typeorm3.OneToMany)(() => RefreshToken, (token) => token.user)
|
|
195
276
|
], User.prototype, "refreshTokens", 2);
|
|
196
277
|
User = __decorateClass([
|
|
197
|
-
(0,
|
|
278
|
+
(0, import_typeorm3.Entity)("users")
|
|
198
279
|
], User);
|
|
199
280
|
// Annotate the CommonJS export names for ESM import in node:
|
|
200
281
|
0 && (module.exports = {
|
|
201
282
|
AUTHENTICATION_PATTERN,
|
|
283
|
+
AccountStatus,
|
|
284
|
+
AccountType,
|
|
202
285
|
RefreshToken,
|
|
203
286
|
User,
|
|
204
287
|
UserRMQAdapter,
|
package/dist/index.mjs
CHANGED
|
@@ -93,35 +93,87 @@ var UserRMQAdapter = (mode = "microservice") => {
|
|
|
93
93
|
};
|
|
94
94
|
|
|
95
95
|
// src/entities/user.entity.ts
|
|
96
|
-
import { Entity as Entity2,
|
|
96
|
+
import { Entity as Entity2, Column as Column3, OneToMany } from "typeorm";
|
|
97
|
+
|
|
98
|
+
// src/entities/base.entity.ts
|
|
99
|
+
import {
|
|
100
|
+
CreateDateColumn,
|
|
101
|
+
PrimaryGeneratedColumn,
|
|
102
|
+
UpdateDateColumn,
|
|
103
|
+
Column,
|
|
104
|
+
DeleteDateColumn,
|
|
105
|
+
Generated
|
|
106
|
+
} from "typeorm";
|
|
107
|
+
var BaseEntity = class {
|
|
108
|
+
};
|
|
109
|
+
__decorateClass([
|
|
110
|
+
PrimaryGeneratedColumn("increment", { type: "integer" })
|
|
111
|
+
], BaseEntity.prototype, "id", 2);
|
|
112
|
+
__decorateClass([
|
|
113
|
+
Column({ type: "uuid" }),
|
|
114
|
+
Generated("uuid")
|
|
115
|
+
], BaseEntity.prototype, "uuid", 2);
|
|
116
|
+
__decorateClass([
|
|
117
|
+
CreateDateColumn({ name: "created_at", type: "timestamp with time zone" })
|
|
118
|
+
], BaseEntity.prototype, "createdAt", 2);
|
|
119
|
+
__decorateClass([
|
|
120
|
+
Column({ name: "created_by", type: "integer", nullable: true })
|
|
121
|
+
], BaseEntity.prototype, "createdBy", 2);
|
|
122
|
+
__decorateClass([
|
|
123
|
+
UpdateDateColumn({ name: "updated_at", type: "timestamp with time zone" })
|
|
124
|
+
], BaseEntity.prototype, "updatedAt", 2);
|
|
125
|
+
__decorateClass([
|
|
126
|
+
Column({ name: "updated_by", type: "integer", nullable: true })
|
|
127
|
+
], BaseEntity.prototype, "updatedBy", 2);
|
|
128
|
+
__decorateClass([
|
|
129
|
+
Column({ name: "is_deleted", type: "boolean", default: false })
|
|
130
|
+
], BaseEntity.prototype, "isDeleted", 2);
|
|
131
|
+
__decorateClass([
|
|
132
|
+
Column({ name: "deleted_by", type: "integer", nullable: true })
|
|
133
|
+
], BaseEntity.prototype, "deletedBy", 2);
|
|
134
|
+
__decorateClass([
|
|
135
|
+
DeleteDateColumn({
|
|
136
|
+
name: "deleted_at",
|
|
137
|
+
type: "timestamp with time zone",
|
|
138
|
+
nullable: true
|
|
139
|
+
})
|
|
140
|
+
], BaseEntity.prototype, "deletedAt", 2);
|
|
97
141
|
|
|
98
142
|
// src/entities/refresh-token.entity.ts
|
|
99
|
-
import {
|
|
143
|
+
import {
|
|
144
|
+
Entity,
|
|
145
|
+
PrimaryGeneratedColumn as PrimaryGeneratedColumn2,
|
|
146
|
+
Column as Column2,
|
|
147
|
+
ManyToOne,
|
|
148
|
+
JoinColumn,
|
|
149
|
+
CreateDateColumn as CreateDateColumn2,
|
|
150
|
+
UpdateDateColumn as UpdateDateColumn2
|
|
151
|
+
} from "typeorm";
|
|
100
152
|
var RefreshToken = class {
|
|
101
153
|
};
|
|
102
154
|
__decorateClass([
|
|
103
|
-
|
|
155
|
+
PrimaryGeneratedColumn2("uuid")
|
|
104
156
|
], RefreshToken.prototype, "id", 2);
|
|
105
157
|
__decorateClass([
|
|
106
|
-
|
|
158
|
+
Column2({ name: "user_id", type: "integer" })
|
|
107
159
|
], RefreshToken.prototype, "userId", 2);
|
|
108
160
|
__decorateClass([
|
|
109
|
-
|
|
161
|
+
Column2({ name: "token_id", type: "varchar" })
|
|
110
162
|
], RefreshToken.prototype, "tokenId", 2);
|
|
111
163
|
__decorateClass([
|
|
112
|
-
|
|
164
|
+
Column2({ name: "device_info", type: "json", nullable: true })
|
|
113
165
|
], RefreshToken.prototype, "deviceInfo", 2);
|
|
114
166
|
__decorateClass([
|
|
115
|
-
|
|
167
|
+
Column2({ name: "is_revoked", type: "boolean", default: false })
|
|
116
168
|
], RefreshToken.prototype, "isRevoked", 2);
|
|
117
169
|
__decorateClass([
|
|
118
|
-
|
|
170
|
+
Column2({ name: "expires_at", type: "timestamp with time zone" })
|
|
119
171
|
], RefreshToken.prototype, "expiresAt", 2);
|
|
120
172
|
__decorateClass([
|
|
121
|
-
|
|
173
|
+
CreateDateColumn2({ name: "created_at", type: "timestamp with time zone" })
|
|
122
174
|
], RefreshToken.prototype, "createdAt", 2);
|
|
123
175
|
__decorateClass([
|
|
124
|
-
|
|
176
|
+
UpdateDateColumn2({ name: "updated_at", type: "timestamp with time zone" })
|
|
125
177
|
], RefreshToken.prototype, "updatedAt", 2);
|
|
126
178
|
__decorateClass([
|
|
127
179
|
ManyToOne(() => User, (user) => user.refreshTokens),
|
|
@@ -132,38 +184,80 @@ RefreshToken = __decorateClass([
|
|
|
132
184
|
], RefreshToken);
|
|
133
185
|
|
|
134
186
|
// src/entities/user.entity.ts
|
|
135
|
-
var
|
|
187
|
+
var AccountType = /* @__PURE__ */ ((AccountType2) => {
|
|
188
|
+
AccountType2["ADMIN"] = "ADMIN";
|
|
189
|
+
AccountType2["SUB_ADMIN"] = "SUB_ADMIN";
|
|
190
|
+
AccountType2["CLIENT"] = "CLIENT";
|
|
191
|
+
AccountType2["FREELANCER"] = "FREELANCER";
|
|
192
|
+
return AccountType2;
|
|
193
|
+
})(AccountType || {});
|
|
194
|
+
var AccountStatus = /* @__PURE__ */ ((AccountStatus2) => {
|
|
195
|
+
AccountStatus2["INACTIVE"] = "INACTIVE";
|
|
196
|
+
AccountStatus2["ACTIVE"] = "ACTIVE";
|
|
197
|
+
AccountStatus2["SUSPENDED"] = "SUSPENDED";
|
|
198
|
+
AccountStatus2["BLOCKED"] = "BLOCKED";
|
|
199
|
+
return AccountStatus2;
|
|
200
|
+
})(AccountStatus || {});
|
|
201
|
+
var User = class extends BaseEntity {
|
|
136
202
|
};
|
|
137
203
|
__decorateClass([
|
|
138
|
-
|
|
139
|
-
], User.prototype, "
|
|
204
|
+
Column3({ name: "unique_id", type: "varchar", unique: true })
|
|
205
|
+
], User.prototype, "uniqueId", 2);
|
|
140
206
|
__decorateClass([
|
|
141
|
-
|
|
207
|
+
Column3({ name: "username", type: "varchar", unique: true, nullable: true })
|
|
142
208
|
], User.prototype, "username", 2);
|
|
143
209
|
__decorateClass([
|
|
144
|
-
|
|
210
|
+
Column3({ name: "first_name", type: "varchar", length: 100, nullable: true })
|
|
211
|
+
], User.prototype, "firstName", 2);
|
|
212
|
+
__decorateClass([
|
|
213
|
+
Column3({ name: "last_name", type: "varchar", length: 100, nullable: true })
|
|
214
|
+
], User.prototype, "lastName", 2);
|
|
215
|
+
__decorateClass([
|
|
216
|
+
Column3({ name: "date_of_birth", type: "date", nullable: true })
|
|
217
|
+
], User.prototype, "dateOfBirth", 2);
|
|
218
|
+
__decorateClass([
|
|
219
|
+
Column3({ name: "gender", type: "varchar", length: 10, nullable: true })
|
|
220
|
+
], User.prototype, "gender", 2);
|
|
221
|
+
__decorateClass([
|
|
222
|
+
Column3({ name: "profile_picture_url", type: "text", nullable: true })
|
|
223
|
+
], User.prototype, "profilePictureUrl", 2);
|
|
224
|
+
__decorateClass([
|
|
225
|
+
Column3({ name: "email", type: "varchar", unique: true })
|
|
145
226
|
], User.prototype, "email", 2);
|
|
146
227
|
__decorateClass([
|
|
147
|
-
|
|
228
|
+
Column3({ name: "mobile", type: "varchar", unique: true, nullable: true })
|
|
229
|
+
], User.prototype, "mobile", 2);
|
|
230
|
+
__decorateClass([
|
|
231
|
+
Column3({ name: "password", type: "varchar" })
|
|
148
232
|
], User.prototype, "password", 2);
|
|
149
233
|
__decorateClass([
|
|
150
|
-
|
|
151
|
-
|
|
234
|
+
Column3({
|
|
235
|
+
name: "account_type",
|
|
236
|
+
type: "enum",
|
|
237
|
+
enum: AccountType,
|
|
238
|
+
default: "FREELANCER" /* FREELANCER */
|
|
239
|
+
})
|
|
240
|
+
], User.prototype, "accountType", 2);
|
|
152
241
|
__decorateClass([
|
|
153
|
-
|
|
154
|
-
|
|
242
|
+
Column3({
|
|
243
|
+
name: "account_status",
|
|
244
|
+
type: "enum",
|
|
245
|
+
enum: AccountStatus,
|
|
246
|
+
default: "INACTIVE" /* INACTIVE */
|
|
247
|
+
})
|
|
248
|
+
], User.prototype, "accountStatus", 2);
|
|
155
249
|
__decorateClass([
|
|
156
|
-
|
|
157
|
-
], User.prototype, "
|
|
250
|
+
Column3({ name: "is_email_verified", type: "boolean", default: false })
|
|
251
|
+
], User.prototype, "isEmailVerified", 2);
|
|
158
252
|
__decorateClass([
|
|
159
|
-
|
|
160
|
-
], User.prototype, "
|
|
253
|
+
Column3({ name: "is_mobile_verified", type: "boolean", default: false })
|
|
254
|
+
], User.prototype, "isMobileVerified", 2);
|
|
161
255
|
__decorateClass([
|
|
162
|
-
|
|
163
|
-
], User.prototype, "
|
|
256
|
+
Column3({ name: "last_login_at", type: "timestamp with time zone", nullable: true })
|
|
257
|
+
], User.prototype, "lastLoginAt", 2);
|
|
164
258
|
__decorateClass([
|
|
165
|
-
|
|
166
|
-
], User.prototype, "
|
|
259
|
+
Column3({ name: "last_login_ip", type: "varchar", nullable: true })
|
|
260
|
+
], User.prototype, "lastLoginIp", 2);
|
|
167
261
|
__decorateClass([
|
|
168
262
|
OneToMany(() => RefreshToken, (token) => token.user)
|
|
169
263
|
], User.prototype, "refreshTokens", 2);
|
|
@@ -172,6 +266,8 @@ User = __decorateClass([
|
|
|
172
266
|
], User);
|
|
173
267
|
export {
|
|
174
268
|
AUTHENTICATION_PATTERN,
|
|
269
|
+
AccountStatus,
|
|
270
|
+
AccountType,
|
|
175
271
|
RefreshToken,
|
|
176
272
|
User,
|
|
177
273
|
UserRMQAdapter,
|