@hugo.ye/common 1.0.103 → 1.0.104
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.
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { AbstractEntity } from
|
|
2
|
-
import { type Relation } from
|
|
3
|
-
import { RoleEntity, UserProfileEntity } from
|
|
1
|
+
import { AbstractEntity } from '../index.js';
|
|
2
|
+
import { type Relation } from 'typeorm';
|
|
3
|
+
import { RoleEntity, UserProfileEntity } from './index.js';
|
|
4
4
|
export declare class UserEntity extends AbstractEntity<UserEntity> {
|
|
5
5
|
email: string;
|
|
6
6
|
password: string;
|
|
7
7
|
username: string;
|
|
8
|
+
status: 'active' | 'inactive' | 'banned';
|
|
8
9
|
isOnline: boolean;
|
|
9
10
|
createdBy: string;
|
|
10
11
|
createdDate: Date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.entity.d.ts","sourceRoot":"","sources":["../../src/models/users.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,
|
|
1
|
+
{"version":3,"file":"users.entity.d.ts","sourceRoot":"","sources":["../../src/models/users.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAQL,KAAK,QAAQ,EACd,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,UAAU,EACV,iBAAiB,EAGlB,MAAM,aAAa,CAAC;AAErB,qBAKa,UAAW,SAAQ,cAAc,CAAC,UAAU,CAAC;IAIxD,KAAK,EAAE,MAAM,CAAC;IAGd,QAAQ,EAAE,MAAM,CAAC;IAKjB,QAAQ,EAAE,MAAM,CAAC;IAIjB,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAC;IAIzC,QAAQ,EAAE,OAAO,CAAC;IAIlB,SAAS,EAAE,MAAM,CAAC;IAIlB,WAAW,EAAE,IAAI,CAAC;IAIlB,SAAS,EAAE,MAAM,CAAC;IAIlB,WAAW,EAAE,IAAI,CAAC;IASlB,KAAK,EAAE,UAAU,EAAE,CAAC;IAoBpB,OAAO,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC;CACtC"}
|
|
@@ -7,14 +7,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { AbstractEntity } from
|
|
11
|
-
import { Directive, Field, ObjectType } from
|
|
12
|
-
import { Column, Entity, Index, JoinTable, ManyToMany, OneToMany, OneToOne } from
|
|
13
|
-
import { RoleEntity, UserProfileEntity, ChatContactsEntity, ChatGroupEntity } from
|
|
10
|
+
import { AbstractEntity } from '../index.js';
|
|
11
|
+
import { Directive, Field, ObjectType } from '@nestjs/graphql';
|
|
12
|
+
import { Column, Entity, Index, JoinTable, ManyToMany, OneToMany, OneToOne, } from 'typeorm';
|
|
13
|
+
import { RoleEntity, UserProfileEntity, ChatContactsEntity, ChatGroupEntity, } from './index.js';
|
|
14
14
|
let UserEntity = class UserEntity extends AbstractEntity {
|
|
15
15
|
email;
|
|
16
16
|
password;
|
|
17
17
|
username;
|
|
18
|
+
status;
|
|
18
19
|
isOnline;
|
|
19
20
|
createdBy;
|
|
20
21
|
createdDate;
|
|
@@ -49,6 +50,11 @@ __decorate([
|
|
|
49
50
|
Index('username-idx'),
|
|
50
51
|
__metadata("design:type", String)
|
|
51
52
|
], UserEntity.prototype, "username", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
Column({ default: 'active' }),
|
|
55
|
+
Field({ defaultValue: 'active' }),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], UserEntity.prototype, "status", void 0);
|
|
52
58
|
__decorate([
|
|
53
59
|
Column({ default: false }),
|
|
54
60
|
Field({ nullable: true }),
|
|
@@ -75,14 +81,20 @@ __decorate([
|
|
|
75
81
|
__metadata("design:type", Date)
|
|
76
82
|
], UserEntity.prototype, "updatedDate", void 0);
|
|
77
83
|
__decorate([
|
|
78
|
-
ManyToMany(() => RoleEntity, role => role.users, {
|
|
84
|
+
ManyToMany(() => RoleEntity, (role) => role.users, {
|
|
85
|
+
cascade: true,
|
|
86
|
+
nullable: true,
|
|
87
|
+
}),
|
|
79
88
|
JoinTable(),
|
|
80
89
|
Directive('@shareable'),
|
|
81
90
|
Field(() => [RoleEntity], { nullable: true }),
|
|
82
91
|
__metadata("design:type", Array)
|
|
83
92
|
], UserEntity.prototype, "roles", void 0);
|
|
84
93
|
__decorate([
|
|
85
|
-
OneToOne(() => UserProfileEntity, (profile) => profile.user, {
|
|
94
|
+
OneToOne(() => UserProfileEntity, (profile) => profile.user, {
|
|
95
|
+
cascade: true,
|
|
96
|
+
nullable: true,
|
|
97
|
+
}),
|
|
86
98
|
Field(() => UserProfileEntity, { nullable: true }),
|
|
87
99
|
Directive('@shareable'),
|
|
88
100
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.entity.js","sourceRoot":"","sources":["../../src/models/users.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"users.entity.js","sourceRoot":"","sources":["../../src/models/users.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EACL,MAAM,EACN,MAAM,EACN,KAAK,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,QAAQ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