@tomei/sso 0.34.6 → 0.34.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,6 +10,10 @@ module.exports = {
10
10
  allowNull: false,
11
11
  autoIncrement: true,
12
12
  },
13
+ UserName: {
14
+ type: Sequelize.STRING(50),
15
+ allowNull: true,
16
+ },
13
17
  Email: {
14
18
  type: Sequelize.STRING,
15
19
  allowNull: false,
@@ -19,6 +23,22 @@ module.exports = {
19
23
  type: Sequelize.STRING,
20
24
  allowNull: false,
21
25
  },
26
+ FullName: {
27
+ type: Sequelize.STRING(200),
28
+ allowNull: false,
29
+ },
30
+ IdNo: {
31
+ type: Sequelize.STRING(50),
32
+ allowNull: true,
33
+ },
34
+ IdType: {
35
+ type: Sequelize.STRING(20),
36
+ allowNull: true,
37
+ },
38
+ ContactNo: {
39
+ type: Sequelize.STRING(20),
40
+ allowNull: true,
41
+ },
22
42
  Status: {
23
43
  type: Sequelize.STRING,
24
44
  allowNull: false,
@@ -27,10 +47,6 @@ module.exports = {
27
47
  type: Sequelize.CHAR(1),
28
48
  allowNull: true,
29
49
  },
30
- UserName: {
31
- type: Sequelize.STRING(50),
32
- allowNull: true,
33
- },
34
50
  FirstLoginAt: {
35
51
  type: Sequelize.DATE,
36
52
  allowNull: true,
@@ -84,7 +100,9 @@ module.exports = {
84
100
  },
85
101
  UpdatedAt: {
86
102
  allowNull: false,
87
- defaultValue: Sequelize.literal('CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)'),
103
+ defaultValue: Sequelize.literal(
104
+ 'CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)',
105
+ ),
88
106
  type: Sequelize.DATE,
89
107
  },
90
108
  UpdatedById: {
@@ -97,12 +115,10 @@ module.exports = {
97
115
  onDelete: 'CASCADE',
98
116
  onUpdate: 'CASCADE',
99
117
  },
100
-
101
118
  });
102
119
  },
103
120
 
104
121
  async down(queryInterface, Sequelize) {
105
- await queryInterface.dropTable('sso_User');
106
-
107
- }
122
+ await queryInterface.dropTable('sso_User');
123
+ },
108
124
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomei/sso",
3
- "version": "0.34.6",
3
+ "version": "0.34.8",
4
4
  "description": "Tomei SSO Package",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -4,6 +4,7 @@ import { YN } from '../../../enum/yn.enum';
4
4
  export interface IUserInfo {
5
5
  FullName: string;
6
6
  IDNo: string;
7
+ IDType: string;
7
8
  Email: string;
8
9
  ContactNo: string;
9
10
  UserName: string;
@@ -43,9 +43,10 @@ export class LoginUser extends User implements ILoginUser {
43
43
  const userAttr: IUserAttr = {
44
44
  UserId: user.UserId,
45
45
  UserName: user.UserName,
46
- FullName: user?.Staff?.FullName,
47
- IDNo: user?.Staff?.IdNo,
48
- ContactNo: user?.Staff?.Mobile,
46
+ FullName: user?.FullName || null,
47
+ IDNo: user?.IdNo || null,
48
+ IDType: user?.IdType || null,
49
+ ContactNo: user?.ContactNo || null,
49
50
  Email: user.Email,
50
51
  Password: user.Password,
51
52
  Status: user.Status,
@@ -261,6 +261,7 @@ export class User extends UserBase {
261
261
  this.UserName = userInfo.FullName;
262
262
  this.FullName = userInfo.FullName;
263
263
  this.IDNo = userInfo.IDNo;
264
+ this.IDType = userInfo.IDType;
264
265
  this.Email = userInfo.Email;
265
266
  this.ContactNo = userInfo.ContactNo;
266
267
  this.Password = userInfo.Password;
@@ -313,9 +314,10 @@ export class User extends UserBase {
313
314
  const userAttr: IUserAttr = {
314
315
  UserId: user.UserId,
315
316
  UserName: user.UserName,
316
- FullName: user?.Staff?.FullName,
317
- IDNo: user?.Staff?.IdNo,
318
- ContactNo: user?.Staff?.Mobile,
317
+ FullName: user?.FullName || null,
318
+ IDNo: user?.IdNo || null,
319
+ IDType: user?.IdType || null,
320
+ ContactNo: user?.ContactNo || null,
319
321
  Email: user.Email,
320
322
  Password: user.Password,
321
323
  Status: user.Status,
@@ -405,9 +407,10 @@ export class User extends UserBase {
405
407
  const userAttr: IUserAttr = {
406
408
  UserId: user.UserId,
407
409
  UserName: user.UserName,
408
- FullName: user?.Staff?.FullName || null,
409
- IDNo: user?.Staff?.IdNo || null,
410
- ContactNo: user?.Staff?.Mobile || null,
410
+ FullName: user?.FullName || null,
411
+ IDNo: user?.IdNo || null,
412
+ IDType: user?.IdType || null,
413
+ ContactNo: user?.ContactNo || null,
411
414
  Email: user.Email,
412
415
  Password: user.Password,
413
416
  Status: user.Status,
@@ -1316,6 +1319,7 @@ export class User extends UserBase {
1316
1319
  UserName: user.UserName,
1317
1320
  FullName: user.FullName,
1318
1321
  IDNo: user.IDNo,
1322
+ IDType: user.IDType,
1319
1323
  Email: user.Email,
1320
1324
  ContactNo: user.ContactNo,
1321
1325
  Password: user.Password,
@@ -2316,9 +2320,10 @@ export class User extends UserBase {
2316
2320
  const userAttr: IUserAttr = {
2317
2321
  UserId: user.UserId,
2318
2322
  UserName: user.UserName,
2319
- FullName: user?.Staff?.FullName || null,
2320
- IDNo: user?.Staff?.IdNo || null,
2321
- ContactNo: user?.Staff?.Mobile || null,
2323
+ FullName: user?.FullName || null,
2324
+ IDNo: user?.IdNo || null,
2325
+ IDType: user?.IdType || null,
2326
+ ContactNo: user?.ContactNo || null,
2322
2327
  Email: user.Email,
2323
2328
  Password: user.Password,
2324
2329
  Status: user.Status,
@@ -34,6 +34,12 @@ export default class User extends Model {
34
34
  })
35
35
  UserId: number;
36
36
 
37
+ @Column({
38
+ allowNull: true,
39
+ type: DataType.STRING,
40
+ })
41
+ UserName: string;
42
+
37
43
  @Column({
38
44
  allowNull: false,
39
45
  type: DataType.STRING,
@@ -41,16 +47,34 @@ export default class User extends Model {
41
47
  Email: string;
42
48
 
43
49
  @Column({
44
- allowNull: true,
50
+ allowNull: false,
45
51
  type: DataType.STRING,
46
52
  })
47
- UserName: string;
53
+ Password: string;
48
54
 
49
55
  @Column({
50
56
  allowNull: false,
51
57
  type: DataType.STRING,
52
58
  })
53
- Password: string;
59
+ FullName: string;
60
+
61
+ @Column({
62
+ allowNull: false,
63
+ type: DataType.STRING,
64
+ })
65
+ IdNo: string;
66
+
67
+ @Column({
68
+ allowNull: false,
69
+ type: DataType.STRING,
70
+ })
71
+ IdType: string;
72
+
73
+ @Column({
74
+ allowNull: false,
75
+ type: DataType.STRING,
76
+ })
77
+ ContactNo: string;
54
78
 
55
79
  @Column({
56
80
  allowNull: false,