@tomei/sso 0.8.0 → 0.8.2
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/Jenkinsfile +2 -2
- package/__tests__/unit/components/login-history/login-history.repository.spec.ts +88 -88
- package/__tests__/unit/components/login-user/login-user.spec.ts +731 -731
- package/__tests__/unit/components/login-user/user.repository.spec.ts +75 -75
- package/__tests__/unit/components/password-hash/password-hash.service.spec.ts +26 -26
- package/__tests__/unit/components/system/system.repository.spec.ts +82 -82
- package/__tests__/unit/components/system-access/system-access.repository.spec.ts +72 -72
- package/dist/__tests__/unit/components/login-history/login-history.repository.spec.d.ts +0 -1
- package/dist/__tests__/unit/components/login-history/login-history.repository.spec.js +0 -98
- package/dist/__tests__/unit/components/login-history/login-history.repository.spec.js.map +1 -1
- package/dist/__tests__/unit/components/login-user/login-user.spec.d.ts +0 -1
- package/dist/__tests__/unit/components/login-user/login-user.spec.js +0 -659
- package/dist/__tests__/unit/components/login-user/login-user.spec.js.map +1 -1
- package/dist/__tests__/unit/components/login-user/user.repository.spec.d.ts +0 -1
- package/dist/__tests__/unit/components/login-user/user.repository.spec.js +0 -77
- package/dist/__tests__/unit/components/login-user/user.repository.spec.js.map +1 -1
- package/dist/__tests__/unit/components/password-hash/password-hash.service.spec.d.ts +0 -1
- package/dist/__tests__/unit/components/password-hash/password-hash.service.spec.js +0 -37
- package/dist/__tests__/unit/components/password-hash/password-hash.service.spec.js.map +1 -1
- package/dist/__tests__/unit/components/system/system.repository.spec.d.ts +0 -1
- package/dist/__tests__/unit/components/system/system.repository.spec.js +0 -84
- package/dist/__tests__/unit/components/system/system.repository.spec.js.map +1 -1
- package/dist/__tests__/unit/components/system-access/system-access.repository.spec.d.ts +0 -1
- package/dist/__tests__/unit/components/system-access/system-access.repository.spec.js +0 -74
- package/dist/__tests__/unit/components/system-access/system-access.repository.spec.js.map +1 -1
- package/dist/src/components/login-history/login-history.repository.d.ts +4 -8
- package/dist/src/components/login-history/login-history.repository.js +5 -43
- package/dist/src/components/login-history/login-history.repository.js.map +1 -1
- package/dist/src/components/login-user/login-user.d.ts +1 -0
- package/dist/src/components/login-user/login-user.js +61 -55
- package/dist/src/components/login-user/login-user.js.map +1 -1
- package/dist/src/components/login-user/user.repository.d.ts +4 -8
- package/dist/src/components/login-user/user.repository.js +5 -43
- package/dist/src/components/login-user/user.repository.js.map +1 -1
- package/dist/src/components/system/system.repository.d.ts +4 -8
- package/dist/src/components/system/system.repository.js +5 -43
- package/dist/src/components/system/system.repository.js.map +1 -1
- package/dist/src/components/system-access/system-access.repository.d.ts +4 -8
- package/dist/src/components/system-access/system-access.repository.js +5 -43
- package/dist/src/components/system-access/system-access.repository.js.map +1 -1
- package/dist/src/components/user-group/user-group.repository.d.ts +4 -8
- package/dist/src/components/user-group/user-group.repository.js +5 -43
- package/dist/src/components/user-group/user-group.repository.js.map +1 -1
- package/dist/src/components/user-user-group/user-user-group.repository.d.ts +4 -8
- package/dist/src/components/user-user-group/user-user-group.repository.js +5 -43
- package/dist/src/components/user-user-group/user-user-group.repository.js.map +1 -1
- package/dist/src/database.d.ts +4 -0
- package/dist/src/database.js +15 -0
- package/dist/src/database.js.map +1 -0
- package/dist/src/models/authorization-code.entity.d.ts +14 -0
- package/dist/src/models/authorization-code.entity.js +86 -0
- package/dist/src/models/authorization-code.entity.js.map +1 -0
- package/dist/src/models/bearer-token.entity.d.ts +11 -0
- package/dist/src/models/bearer-token.entity.js +72 -0
- package/dist/src/models/bearer-token.entity.js.map +1 -0
- package/dist/src/models/building-type.entity.d.ts +7 -0
- package/dist/src/models/building-type.entity.js +50 -0
- package/dist/src/models/building-type.entity.js.map +1 -0
- package/dist/src/models/building.entity.d.ts +28 -0
- package/dist/src/models/building.entity.js +218 -0
- package/dist/src/models/building.entity.js.map +1 -0
- package/dist/src/models/city.entity.d.ts +11 -0
- package/dist/src/models/city.entity.js +72 -0
- package/dist/src/models/city.entity.js.map +1 -0
- package/dist/src/models/company.entity.d.ts +18 -0
- package/dist/src/models/company.entity.js +114 -0
- package/dist/src/models/company.entity.js.map +1 -0
- package/dist/src/models/country.entity.d.ts +15 -0
- package/dist/src/models/country.entity.js +92 -0
- package/dist/src/models/country.entity.js.map +1 -0
- package/dist/src/models/department.entity.d.ts +19 -0
- package/dist/src/models/department.entity.js +112 -0
- package/dist/src/models/department.entity.js.map +1 -0
- package/dist/src/models/group-role-privilege.entity.d.ts +17 -0
- package/dist/src/models/group-role-privilege.entity.js +90 -0
- package/dist/src/models/group-role-privilege.entity.js.map +1 -0
- package/dist/src/models/group-system-access.entity.d.ts +11 -0
- package/dist/src/models/group-system-access.entity.js +62 -0
- package/dist/src/models/group-system-access.entity.js.map +1 -0
- package/dist/src/models/group-system-privilege.entity.d.ts +11 -0
- package/dist/src/models/group-system-privilege.entity.js +62 -0
- package/dist/src/models/group-system-privilege.entity.js.map +1 -0
- package/dist/src/models/group-system-role.entity.d.ts +11 -0
- package/dist/src/models/group-system-role.entity.js +62 -0
- package/dist/src/models/group-system-role.entity.js.map +1 -0
- package/dist/src/models/login-history.entity.d.ts +12 -0
- package/dist/src/models/login-history.entity.js +70 -0
- package/dist/src/models/login-history.entity.js.map +1 -0
- package/dist/src/models/oauth-token.entity.d.ts +14 -0
- package/dist/src/models/oauth-token.entity.js +86 -0
- package/dist/src/models/oauth-token.entity.js.map +1 -0
- package/dist/src/models/role.entity.d.ts +17 -0
- package/dist/src/models/role.entity.js +102 -0
- package/dist/src/models/role.entity.js.map +1 -0
- package/dist/src/models/staff-type.entity.d.ts +7 -0
- package/dist/src/models/staff-type.entity.js +50 -0
- package/dist/src/models/staff-type.entity.js.map +1 -0
- package/dist/src/models/staff.entity.d.ts +39 -0
- package/dist/src/models/staff.entity.js +250 -0
- package/dist/src/models/staff.entity.js.map +1 -0
- package/dist/src/models/state.entity.d.ts +10 -0
- package/dist/src/models/state.entity.js +64 -0
- package/dist/src/models/state.entity.js.map +1 -0
- package/dist/src/models/system-accesss.entity.d.ts +6 -0
- package/dist/src/models/system-accesss.entity.js +51 -0
- package/dist/src/models/system-accesss.entity.js.map +1 -0
- package/dist/src/models/system-privilege.entity.d.ts +16 -0
- package/dist/src/models/system-privilege.entity.js +90 -0
- package/dist/src/models/system-privilege.entity.js.map +1 -0
- package/dist/src/models/system-role-privilege.entity.d.ts +11 -0
- package/dist/src/models/system-role-privilege.entity.js +60 -0
- package/dist/src/models/system-role-privilege.entity.js.map +1 -0
- package/dist/src/models/system-role.entity.d.ts +11 -0
- package/dist/src/models/system-role.entity.js +83 -0
- package/dist/src/models/system-role.entity.js.map +1 -0
- package/dist/src/models/system.entity.d.ts +19 -0
- package/dist/src/models/system.entity.js +146 -0
- package/dist/src/models/system.entity.js.map +1 -0
- package/dist/src/models/user-group.entity.d.ts +23 -0
- package/dist/src/models/user-group.entity.js +140 -0
- package/dist/src/models/user-group.entity.js.map +1 -0
- package/dist/src/models/user-role.entity.d.ts +9 -0
- package/dist/src/models/user-role.entity.js +62 -0
- package/dist/src/models/user-role.entity.js.map +1 -0
- package/dist/src/models/user-system-privileges.entity.d.ts +13 -0
- package/dist/src/models/user-system-privileges.entity.js +80 -0
- package/dist/src/models/user-system-privileges.entity.js.map +1 -0
- package/dist/src/models/user-system-role.entity.d.ts +11 -0
- package/dist/src/models/user-system-role.entity.js +60 -0
- package/dist/src/models/user-system-role.entity.js.map +1 -0
- package/dist/src/models/user-user-group.entity.d.ts +14 -0
- package/dist/src/models/user-user-group.entity.js +73 -0
- package/dist/src/models/user-user-group.entity.js.map +1 -0
- package/dist/src/models/user.entity.d.ts +30 -0
- package/dist/src/models/user.entity.js +131 -0
- package/dist/src/models/user.entity.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/migrations/01-alter-system-privilege-table.js +13 -0
- package/migrations/02-alter-user-group-table.js +78 -0
- package/migrations/03-alter-user-system-privilege-table.js +38 -0
- package/migrations/04-create-user-user-group-table.js +55 -0
- package/migrations/05-create-login-history-table.js +49 -0
- package/package.json +8 -4
- package/src/components/index.ts +1 -0
- package/src/components/login-history/login-history.repository.ts +35 -23
- package/src/components/login-user/login-user.ts +65 -65
- package/src/components/login-user/user.repository.ts +35 -23
- package/src/components/system/system.repository.ts +34 -23
- package/src/components/system-access/system-access.repository.ts +35 -23
- package/src/components/user-group/user-group.repository.ts +35 -23
- package/src/components/user-user-group/user-user-group.repository.ts +35 -23
- package/src/database.ts +15 -0
- package/src/models/authorization-code.entity.ts +71 -0
- package/src/models/bearer-token.entity.ts +59 -0
- package/src/models/building-type.entity.ts +38 -0
- package/src/models/building.entity.ts +185 -0
- package/src/models/city.entity.ts +59 -0
- package/src/models/company.entity.ts +96 -0
- package/src/models/country.entity.ts +75 -0
- package/src/models/department.entity.ts +94 -0
- package/src/models/group-role-privilege.entity.ts +73 -0
- package/src/models/group-system-access.entity.ts +49 -0
- package/src/models/group-system-privilege.entity.ts +49 -0
- package/src/models/group-system-role.entity.ts +49 -0
- package/src/models/login-history.entity.ts +56 -0
- package/src/models/oauth-token.entity.ts +71 -0
- package/src/models/role.entity.ts +85 -0
- package/src/models/staff-type.entity.ts +38 -0
- package/src/models/staff.entity.ts +213 -0
- package/src/models/state.entity.ts +52 -0
- package/src/models/system-accesss.entity.ts +40 -0
- package/src/models/system-privilege.entity.ts +75 -0
- package/src/models/system-role-privilege.entity.ts +48 -0
- package/src/models/system-role.entity.ts +68 -0
- package/src/models/system.entity.ts +122 -0
- package/src/models/user-group.entity.ts +118 -0
- package/src/models/user-role.entity.ts +50 -0
- package/src/models/user-system-privileges.entity.ts +66 -0
- package/src/models/user-system-role.entity.ts +48 -0
- package/src/models/user-user-group.entity.ts +59 -0
- package/src/models/user.entity.ts +110 -0
- package/dist/src/mail/index.d.ts +0 -2
- package/dist/src/mail/index.js +0 -19
- package/dist/src/mail/index.js.map +0 -1
- package/dist/src/mail/interfaces/index.d.ts +0 -2
- package/dist/src/mail/interfaces/index.js +0 -19
- package/dist/src/mail/interfaces/index.js.map +0 -1
- package/dist/src/mail/interfaces/send-mail.interface.d.ts +0 -8
- package/dist/src/mail/interfaces/send-mail.interface.js +0 -3
- package/dist/src/mail/interfaces/send-mail.interface.js.map +0 -1
- package/dist/src/mail/interfaces/send-new-login-alert.interface.d.ts +0 -6
- package/dist/src/mail/interfaces/send-new-login-alert.interface.js +0 -3
- package/dist/src/mail/interfaces/send-new-login-alert.interface.js.map +0 -1
- package/dist/src/mail/mail.d.ts +0 -7
- package/dist/src/mail/mail.js +0 -49
- package/dist/src/mail/mail.js.map +0 -1
- package/dist/src/mail/mail.service.d.ts +0 -7
- package/dist/src/mail/mail.service.js +0 -42
- package/dist/src/mail/mail.service.js.map +0 -1
@@ -0,0 +1,122 @@
|
|
1
|
+
import {
|
2
|
+
Column,
|
3
|
+
CreatedAt,
|
4
|
+
DataType,
|
5
|
+
Model,
|
6
|
+
Table,
|
7
|
+
UpdatedAt,
|
8
|
+
} from 'sequelize-typescript';
|
9
|
+
|
10
|
+
@Table({
|
11
|
+
tableName: 'sso_systems',
|
12
|
+
timestamps: true,
|
13
|
+
createdAt: 'created_at',
|
14
|
+
updatedAt: 'updated_at',
|
15
|
+
underscored: true,
|
16
|
+
})
|
17
|
+
export default class System extends Model {
|
18
|
+
@Column({
|
19
|
+
primaryKey: true,
|
20
|
+
allowNull: false,
|
21
|
+
autoIncrement: true,
|
22
|
+
type: DataType.INTEGER,
|
23
|
+
})
|
24
|
+
id: number;
|
25
|
+
|
26
|
+
@Column({
|
27
|
+
allowNull: false,
|
28
|
+
type: DataType.STRING,
|
29
|
+
field: 'code',
|
30
|
+
})
|
31
|
+
Code: string;
|
32
|
+
|
33
|
+
@Column({
|
34
|
+
allowNull: false,
|
35
|
+
type: DataType.STRING,
|
36
|
+
field: 'name',
|
37
|
+
})
|
38
|
+
Name: string;
|
39
|
+
|
40
|
+
@Column({
|
41
|
+
allowNull: false,
|
42
|
+
type: DataType.STRING,
|
43
|
+
field: 'description',
|
44
|
+
})
|
45
|
+
Description: string;
|
46
|
+
|
47
|
+
@Column({
|
48
|
+
allowNull: false,
|
49
|
+
type: DataType.STRING(2000),
|
50
|
+
field: 'access_url',
|
51
|
+
})
|
52
|
+
AccessUrl: string;
|
53
|
+
|
54
|
+
@Column({
|
55
|
+
allowNull: false,
|
56
|
+
type: DataType.STRING(2000),
|
57
|
+
field: 'google_play_url',
|
58
|
+
})
|
59
|
+
GooglePlayUrl: string;
|
60
|
+
|
61
|
+
@Column({
|
62
|
+
allowNull: false,
|
63
|
+
type: DataType.STRING(2000),
|
64
|
+
field: 'apple_store_url',
|
65
|
+
})
|
66
|
+
AppleStoreUrl: string;
|
67
|
+
|
68
|
+
@Column({
|
69
|
+
allowNull: false,
|
70
|
+
type: DataType.STRING,
|
71
|
+
field: 'api_key',
|
72
|
+
})
|
73
|
+
ApiKey: string;
|
74
|
+
|
75
|
+
@Column({
|
76
|
+
allowNull: false,
|
77
|
+
type: DataType.STRING,
|
78
|
+
field: 'api_secret',
|
79
|
+
})
|
80
|
+
ApiSecret: string;
|
81
|
+
|
82
|
+
@Column({
|
83
|
+
allowNull: false,
|
84
|
+
type: DataType.STRING,
|
85
|
+
field: 'logo',
|
86
|
+
})
|
87
|
+
logo: string;
|
88
|
+
|
89
|
+
@Column({
|
90
|
+
allowNull: false,
|
91
|
+
type: DataType.STRING,
|
92
|
+
field: 'status',
|
93
|
+
})
|
94
|
+
Status: string;
|
95
|
+
|
96
|
+
@Column({
|
97
|
+
allowNull: false,
|
98
|
+
type: DataType.BOOLEAN,
|
99
|
+
field: 'visible',
|
100
|
+
})
|
101
|
+
Visible: boolean;
|
102
|
+
|
103
|
+
@Column({
|
104
|
+
allowNull: false,
|
105
|
+
type: DataType.STRING,
|
106
|
+
field: 'created_by_id',
|
107
|
+
})
|
108
|
+
CreatedById: string;
|
109
|
+
|
110
|
+
@Column({
|
111
|
+
allowNull: false,
|
112
|
+
type: DataType.STRING,
|
113
|
+
field: 'updated_by_id',
|
114
|
+
})
|
115
|
+
UpdatedById: string;
|
116
|
+
|
117
|
+
@CreatedAt
|
118
|
+
CreatedAt: Date;
|
119
|
+
|
120
|
+
@UpdatedAt
|
121
|
+
UpdatedAt: Date;
|
122
|
+
}
|
@@ -0,0 +1,118 @@
|
|
1
|
+
import {
|
2
|
+
BelongsTo,
|
3
|
+
Column,
|
4
|
+
CreatedAt,
|
5
|
+
DataType,
|
6
|
+
ForeignKey,
|
7
|
+
HasMany,
|
8
|
+
Model,
|
9
|
+
Table,
|
10
|
+
UpdatedAt,
|
11
|
+
} from 'sequelize-typescript';
|
12
|
+
import Department from './department.entity';
|
13
|
+
import GroupRolePrivilege from './group-role-privilege.entity';
|
14
|
+
import GroupSystemPrivilege from './group-system-privilege.entity';
|
15
|
+
|
16
|
+
@Table({
|
17
|
+
tableName: 'sso_UserGroup',
|
18
|
+
timestamps: true,
|
19
|
+
createdAt: 'CreatedAt',
|
20
|
+
updatedAt: 'UpdatedAt',
|
21
|
+
})
|
22
|
+
export default class UserGroup extends Model {
|
23
|
+
@Column({
|
24
|
+
primaryKey: true,
|
25
|
+
type: DataType.STRING(10),
|
26
|
+
allowNull: false,
|
27
|
+
})
|
28
|
+
GroupCode: string;
|
29
|
+
|
30
|
+
@Column({
|
31
|
+
type: DataType.STRING(100),
|
32
|
+
field: 'GroupDescription',
|
33
|
+
})
|
34
|
+
GroupDescription: string;
|
35
|
+
|
36
|
+
@ForeignKey(() => Department)
|
37
|
+
@Column({
|
38
|
+
type: DataType.STRING,
|
39
|
+
field: 'password',
|
40
|
+
})
|
41
|
+
DepartmentId: string;
|
42
|
+
|
43
|
+
@Column({
|
44
|
+
type: DataType.STRING,
|
45
|
+
field: 'status',
|
46
|
+
})
|
47
|
+
Status: string;
|
48
|
+
|
49
|
+
@Column({
|
50
|
+
type: DataType.ENUM('Y', 'N'),
|
51
|
+
field: 'AllowInheritFromParentYN',
|
52
|
+
defaultValue: 'N',
|
53
|
+
})
|
54
|
+
AllowInheritFromParentYN: string;
|
55
|
+
|
56
|
+
@Column({
|
57
|
+
type: DataType.STRING(1000),
|
58
|
+
field: 'FullPath',
|
59
|
+
allowNull: true,
|
60
|
+
})
|
61
|
+
FullPath: string;
|
62
|
+
|
63
|
+
@Column({
|
64
|
+
type: DataType.INTEGER,
|
65
|
+
field: 'GroupLevel',
|
66
|
+
defaultValue: 0,
|
67
|
+
allowNull: false,
|
68
|
+
})
|
69
|
+
GroupLevel: number;
|
70
|
+
|
71
|
+
@Column({
|
72
|
+
type: DataType.STRING(10),
|
73
|
+
field: 'GroupType',
|
74
|
+
allowNull: true,
|
75
|
+
})
|
76
|
+
GroupType: string;
|
77
|
+
|
78
|
+
@Column({
|
79
|
+
type: DataType.STRING(10),
|
80
|
+
field: 'ParentGroupCode',
|
81
|
+
allowNull: true,
|
82
|
+
})
|
83
|
+
ParentGroupCode: string;
|
84
|
+
|
85
|
+
@Column({
|
86
|
+
type: DataType.STRING(100),
|
87
|
+
field: 'PersonInCharge',
|
88
|
+
allowNull: true,
|
89
|
+
})
|
90
|
+
PersonInCharge: string;
|
91
|
+
|
92
|
+
@Column({
|
93
|
+
type: DataType.STRING(10),
|
94
|
+
field: 'status',
|
95
|
+
})
|
96
|
+
CreatedById: string;
|
97
|
+
|
98
|
+
@Column({
|
99
|
+
type: DataType.STRING(10),
|
100
|
+
field: 'status',
|
101
|
+
})
|
102
|
+
UpdatedById: string;
|
103
|
+
|
104
|
+
@CreatedAt
|
105
|
+
CreatedAt: Date;
|
106
|
+
|
107
|
+
@UpdatedAt
|
108
|
+
UpdatedAt: Date;
|
109
|
+
|
110
|
+
@BelongsTo(() => Department)
|
111
|
+
Department: Department;
|
112
|
+
|
113
|
+
@HasMany(() => GroupRolePrivilege)
|
114
|
+
GroupRolePrivileges: GroupRolePrivilege[];
|
115
|
+
|
116
|
+
@HasMany(() => GroupSystemPrivilege)
|
117
|
+
GroupSystemPrivileges: GroupSystemPrivilege[];
|
118
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import {
|
2
|
+
BelongsTo,
|
3
|
+
Column,
|
4
|
+
DataType,
|
5
|
+
ForeignKey,
|
6
|
+
Model,
|
7
|
+
Table,
|
8
|
+
UpdatedAt,
|
9
|
+
} from 'sequelize-typescript';
|
10
|
+
import User from './user.entity';
|
11
|
+
|
12
|
+
@Table({
|
13
|
+
tableName: 'sso_user_roles',
|
14
|
+
timestamps: true,
|
15
|
+
createdAt: false,
|
16
|
+
updatedAt: 'updated_at',
|
17
|
+
underscored: true,
|
18
|
+
})
|
19
|
+
export default class UserRole extends Model {
|
20
|
+
@Column({
|
21
|
+
primaryKey: true,
|
22
|
+
type: DataType.INTEGER,
|
23
|
+
allowNull: false,
|
24
|
+
field: 'user_id',
|
25
|
+
})
|
26
|
+
UserId: number;
|
27
|
+
|
28
|
+
@Column({
|
29
|
+
primaryKey: true,
|
30
|
+
type: DataType.INTEGER,
|
31
|
+
allowNull: false,
|
32
|
+
field: 'role_id',
|
33
|
+
})
|
34
|
+
RoleId: number;
|
35
|
+
|
36
|
+
@ForeignKey(() => User)
|
37
|
+
@Column({
|
38
|
+
primaryKey: true,
|
39
|
+
type: DataType.INTEGER,
|
40
|
+
allowNull: false,
|
41
|
+
field: 'updated_by_id',
|
42
|
+
})
|
43
|
+
UpdatedById: number;
|
44
|
+
|
45
|
+
@UpdatedAt
|
46
|
+
UpdatedAt: Date;
|
47
|
+
|
48
|
+
@BelongsTo(() => User)
|
49
|
+
User: User;
|
50
|
+
}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import {
|
2
|
+
BelongsTo,
|
3
|
+
Column,
|
4
|
+
CreatedAt,
|
5
|
+
DataType,
|
6
|
+
ForeignKey,
|
7
|
+
Model,
|
8
|
+
Table,
|
9
|
+
UpdatedAt,
|
10
|
+
} from 'sequelize-typescript';
|
11
|
+
import SystemPrivilege from './system-privilege.entity';
|
12
|
+
import User from './user.entity';
|
13
|
+
|
14
|
+
@Table({
|
15
|
+
tableName: 'sso_UserSystemPrivilege',
|
16
|
+
timestamps: true,
|
17
|
+
createdAt: 'CreatedAt',
|
18
|
+
updatedAt: 'UpdatedAt',
|
19
|
+
underscored: true,
|
20
|
+
})
|
21
|
+
export default class UserSystemPrivileges extends Model {
|
22
|
+
@ForeignKey(() => User)
|
23
|
+
@Column({
|
24
|
+
primaryKey: true,
|
25
|
+
allowNull: false,
|
26
|
+
type: DataType.INTEGER,
|
27
|
+
})
|
28
|
+
UserId: number;
|
29
|
+
|
30
|
+
@ForeignKey(() => SystemPrivilege)
|
31
|
+
@Column({
|
32
|
+
allowNull: false,
|
33
|
+
primaryKey: true,
|
34
|
+
type: DataType.STRING(30),
|
35
|
+
field: 'PrivilegeId',
|
36
|
+
})
|
37
|
+
PrivilegeId: string;
|
38
|
+
|
39
|
+
@Column({
|
40
|
+
allowNull: false,
|
41
|
+
type: DataType.ENUM('Y', 'N'),
|
42
|
+
field: 'IsInheritedYN',
|
43
|
+
defaultValue: 'N',
|
44
|
+
})
|
45
|
+
IsInheritedYN: string;
|
46
|
+
|
47
|
+
@Column({
|
48
|
+
allowNull: false,
|
49
|
+
type: DataType.ENUM('Y', 'N'),
|
50
|
+
field: 'IsRevokedYN',
|
51
|
+
defaultValue: 'N',
|
52
|
+
})
|
53
|
+
IsRevokedYN: string;
|
54
|
+
|
55
|
+
@CreatedAt
|
56
|
+
CreatedAt: Date;
|
57
|
+
|
58
|
+
@UpdatedAt
|
59
|
+
UpdatedAt: Date;
|
60
|
+
|
61
|
+
@BelongsTo(() => User)
|
62
|
+
User: User;
|
63
|
+
|
64
|
+
@BelongsTo(() => SystemPrivilege)
|
65
|
+
SystemPrivilege: SystemPrivilege;
|
66
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import {
|
2
|
+
BelongsTo,
|
3
|
+
Column,
|
4
|
+
CreatedAt,
|
5
|
+
DataType,
|
6
|
+
ForeignKey,
|
7
|
+
Model,
|
8
|
+
Table,
|
9
|
+
UpdatedAt,
|
10
|
+
} from 'sequelize-typescript';
|
11
|
+
import User from './user.entity';
|
12
|
+
import SystemRole from './system-role.entity';
|
13
|
+
|
14
|
+
@Table({
|
15
|
+
tableName: 'sso_UserSystemRole',
|
16
|
+
timestamps: true,
|
17
|
+
createdAt: 'CreatedAt',
|
18
|
+
updatedAt: 'UpdatedAt',
|
19
|
+
})
|
20
|
+
export default class UserSystemRole extends Model {
|
21
|
+
@ForeignKey(() => User)
|
22
|
+
@Column({
|
23
|
+
primaryKey: true,
|
24
|
+
allowNull: false,
|
25
|
+
type: DataType.INTEGER,
|
26
|
+
})
|
27
|
+
UserId: number;
|
28
|
+
|
29
|
+
@ForeignKey(() => SystemRole)
|
30
|
+
@Column({
|
31
|
+
allowNull: false,
|
32
|
+
primaryKey: true,
|
33
|
+
type: DataType.STRING(30),
|
34
|
+
})
|
35
|
+
RoleId: string;
|
36
|
+
|
37
|
+
@CreatedAt
|
38
|
+
CreatedAt: Date;
|
39
|
+
|
40
|
+
@UpdatedAt
|
41
|
+
UpdatedAt: Date;
|
42
|
+
|
43
|
+
@BelongsTo(() => User)
|
44
|
+
User: User;
|
45
|
+
|
46
|
+
@BelongsTo(() => SystemRole)
|
47
|
+
SystemRole: SystemRole;
|
48
|
+
}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import {
|
2
|
+
BelongsTo,
|
3
|
+
Column,
|
4
|
+
CreatedAt,
|
5
|
+
DataType,
|
6
|
+
ForeignKey,
|
7
|
+
Model,
|
8
|
+
Table,
|
9
|
+
UpdatedAt,
|
10
|
+
} from 'sequelize-typescript';
|
11
|
+
import User from './user.entity';
|
12
|
+
import UserGroup from './user-group.entity';
|
13
|
+
import System from './system.entity';
|
14
|
+
|
15
|
+
@Table({
|
16
|
+
tableName: 'sso_UserUserGroup',
|
17
|
+
timestamps: true,
|
18
|
+
createdAt: 'CreatedAt',
|
19
|
+
updatedAt: 'UpdatedAt',
|
20
|
+
})
|
21
|
+
export default class UserUserGroup extends Model {
|
22
|
+
@ForeignKey(() => User)
|
23
|
+
@Column({
|
24
|
+
primaryKey: true,
|
25
|
+
allowNull: false,
|
26
|
+
type: DataType.INTEGER,
|
27
|
+
})
|
28
|
+
UserId: number;
|
29
|
+
|
30
|
+
@ForeignKey(() => UserGroup)
|
31
|
+
@Column({
|
32
|
+
allowNull: false,
|
33
|
+
primaryKey: true,
|
34
|
+
type: DataType.STRING(191),
|
35
|
+
})
|
36
|
+
GroupCode: string;
|
37
|
+
|
38
|
+
@ForeignKey(() => System)
|
39
|
+
@Column({
|
40
|
+
allowNull: true,
|
41
|
+
type: DataType.INTEGER,
|
42
|
+
})
|
43
|
+
SystemId: number;
|
44
|
+
|
45
|
+
@CreatedAt
|
46
|
+
CreatedAt: Date;
|
47
|
+
|
48
|
+
@UpdatedAt
|
49
|
+
UpdatedAt: Date;
|
50
|
+
|
51
|
+
@BelongsTo(() => User)
|
52
|
+
User: User;
|
53
|
+
|
54
|
+
@BelongsTo(() => UserGroup)
|
55
|
+
UserGroup: UserGroup;
|
56
|
+
|
57
|
+
@BelongsTo(() => System)
|
58
|
+
System: System;
|
59
|
+
}
|
@@ -0,0 +1,110 @@
|
|
1
|
+
import {
|
2
|
+
BelongsTo,
|
3
|
+
BelongsToMany,
|
4
|
+
Column,
|
5
|
+
CreatedAt,
|
6
|
+
DataType,
|
7
|
+
ForeignKey,
|
8
|
+
HasMany,
|
9
|
+
HasOne,
|
10
|
+
Model,
|
11
|
+
Table,
|
12
|
+
UpdatedAt,
|
13
|
+
} from 'sequelize-typescript';
|
14
|
+
import UserGroup from './user-group.entity';
|
15
|
+
import Staff from './staff.entity';
|
16
|
+
import BearerToken from './bearer-token.entity';
|
17
|
+
import OAuthToken from './oauth-token.entity';
|
18
|
+
import UserRole from './user-role.entity';
|
19
|
+
import System from './system.entity';
|
20
|
+
import SystemAccess from './system-accesss.entity';
|
21
|
+
import Role from './role.entity';
|
22
|
+
import SystemRole from './system-role.entity';
|
23
|
+
import UserSystemRole from './user-system-role.entity';
|
24
|
+
import SystemPrivilege from './system-privilege.entity';
|
25
|
+
import UserSystemPrivileges from './user-system-privileges.entity';
|
26
|
+
|
27
|
+
@Table({
|
28
|
+
tableName: 'sso_users',
|
29
|
+
timestamps: true,
|
30
|
+
createdAt: 'created_at',
|
31
|
+
updatedAt: 'updated_at',
|
32
|
+
})
|
33
|
+
export default class User extends Model {
|
34
|
+
@Column({
|
35
|
+
primaryKey: true,
|
36
|
+
type: DataType.INTEGER,
|
37
|
+
})
|
38
|
+
id: number;
|
39
|
+
|
40
|
+
@Column({
|
41
|
+
type: DataType.STRING,
|
42
|
+
field: 'email',
|
43
|
+
})
|
44
|
+
Email: string;
|
45
|
+
|
46
|
+
@Column({
|
47
|
+
type: DataType.STRING,
|
48
|
+
field: 'password',
|
49
|
+
})
|
50
|
+
Password: string;
|
51
|
+
|
52
|
+
@Column({
|
53
|
+
type: DataType.STRING,
|
54
|
+
field: 'status',
|
55
|
+
})
|
56
|
+
Status: string;
|
57
|
+
|
58
|
+
@Column({
|
59
|
+
type: DataType.BOOLEAN,
|
60
|
+
field: 'default_password_changed',
|
61
|
+
})
|
62
|
+
DefaultPasswordChanged: boolean;
|
63
|
+
|
64
|
+
@Column({
|
65
|
+
type: DataType.DATE,
|
66
|
+
field: 'first_login_at',
|
67
|
+
})
|
68
|
+
FirstLoginAt: boolean;
|
69
|
+
|
70
|
+
@ForeignKey(() => UserGroup)
|
71
|
+
@Column({
|
72
|
+
allowNull: true,
|
73
|
+
type: DataType.STRING(10),
|
74
|
+
field: 'GroupCode',
|
75
|
+
})
|
76
|
+
GroupCode: boolean;
|
77
|
+
|
78
|
+
@CreatedAt
|
79
|
+
CreatedAt: Date;
|
80
|
+
|
81
|
+
@UpdatedAt
|
82
|
+
UpdatedAt: Date;
|
83
|
+
|
84
|
+
@HasOne(() => Staff)
|
85
|
+
Staff: Staff;
|
86
|
+
|
87
|
+
@HasMany(() => BearerToken)
|
88
|
+
BearerTokens: BearerToken[];
|
89
|
+
|
90
|
+
@HasMany(() => OAuthToken)
|
91
|
+
OAuthTokens: OAuthToken[];
|
92
|
+
|
93
|
+
@HasMany(() => UserRole)
|
94
|
+
UserRoles: UserRole[];
|
95
|
+
|
96
|
+
@BelongsToMany(() => System, () => SystemAccess)
|
97
|
+
Systems: System[];
|
98
|
+
|
99
|
+
@BelongsToMany(() => Role, () => UserRole)
|
100
|
+
Roles: Role[];
|
101
|
+
|
102
|
+
@BelongsToMany(() => SystemRole, () => UserSystemRole)
|
103
|
+
SystemRoles: SystemRole[];
|
104
|
+
|
105
|
+
@BelongsToMany(() => SystemPrivilege, () => UserSystemPrivileges)
|
106
|
+
SystemPrivileges: SystemPrivilege[];
|
107
|
+
|
108
|
+
@BelongsTo(() => UserGroup)
|
109
|
+
UserGroup: UserGroup;
|
110
|
+
}
|
package/dist/src/mail/index.d.ts
DELETED
package/dist/src/mail/index.js
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
-
};
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./mail.service"), exports);
|
18
|
-
__exportStar(require("./mail"), exports);
|
19
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mail/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,yCAAuB"}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
-
};
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./send-mail.interface"), exports);
|
18
|
-
__exportStar(require("./send-new-login-alert.interface"), exports);
|
19
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mail/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,mEAAiD"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"send-mail.interface.js","sourceRoot":"","sources":["../../../../src/mail/interfaces/send-mail.interface.ts"],"names":[],"mappings":""}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"send-new-login-alert.interface.js","sourceRoot":"","sources":["../../../../src/mail/interfaces/send-new-login-alert.interface.ts"],"names":[],"mappings":""}
|
package/dist/src/mail/mail.d.ts
DELETED