@tomei/sso 0.16.2 → 0.16.3
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/.commitlintrc.json +22 -22
- package/.eslintrc +16 -16
- package/.eslintrc.js +35 -35
- package/.husky/commit-msg +15 -15
- package/.husky/pre-commit +7 -7
- package/.prettierrc +4 -4
- package/Jenkinsfile +57 -57
- package/README.md +23 -23
- package/__tests__/unit/components/login-user/login-user.spec.ts +742 -742
- package/__tests__/unit/components/password-hash/password-hash.service.spec.ts +31 -31
- package/__tests__/unit/redis-client/redis.service.spec.ts +23 -23
- package/__tests__/unit/session/session.service.spec.ts +47 -47
- package/__tests__/unit/system-privilege/system-privilage.spec.ts +91 -91
- package/create-sso-user.sql +39 -39
- package/dist/src/components/login-user/interfaces/user-info.interface.d.ts +2 -1
- package/dist/src/components/login-user/login-user.d.ts +2 -1
- package/dist/src/components/login-user/login-user.js.map +1 -1
- package/dist/src/components/staff/staff.js +1 -1
- package/dist/src/components/staff/staff.js.map +1 -1
- package/dist/src/enum/index.d.ts +1 -0
- package/dist/src/enum/index.js +1 -0
- package/dist/src/enum/index.js.map +1 -1
- package/dist/src/enum/user-status.enum.d.ts +7 -0
- package/dist/src/enum/user-status.enum.js +12 -0
- package/dist/src/enum/user-status.enum.js.map +1 -0
- package/dist/src/models/user.entity.d.ts +2 -1
- package/dist/src/models/user.entity.js +1 -0
- package/dist/src/models/user.entity.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/jest.config.js +13 -13
- package/migrations/20240314080603-create-user-table.js +108 -108
- package/migrations/20240314080604-create-user-user-group-table.js +55 -55
- package/migrations/20240314080605-create-login-history-table.js +49 -49
- package/package.json +80 -80
- package/sampledotenv +7 -7
- package/src/components/login-user/interfaces/user-info.interface.ts +2 -1
- package/src/components/login-user/login-user.ts +4 -3
- package/src/components/staff/staff.ts +1 -3
- package/src/enum/index.ts +1 -0
- package/src/enum/user-status.enum.ts +7 -0
- package/src/models/user.entity.ts +2 -2
- package/tsconfig.build.json +5 -5
- package/tsconfig.json +23 -23
- package/migrations/01-alter-system-privilege-table.js +0 -13
- package/migrations/02-alter-user-group-table.js +0 -78
- package/migrations/03-alter-user-system-privilege-table.js +0 -38
@@ -64,9 +64,7 @@ export class Staff extends ObjectBase implements IPerson {
|
|
64
64
|
private constructor(staffInfo) {
|
65
65
|
super();
|
66
66
|
if (staffInfo) {
|
67
|
-
|
68
|
-
this.ObjectId = staffInfo.staff_id;
|
69
|
-
|
67
|
+
this.ObjectId = staffInfo.id;
|
70
68
|
this.UserId = staffInfo.user_id;
|
71
69
|
this.StaffId = staffInfo.staff_id;
|
72
70
|
this.FullName = staffInfo.full_name;
|
package/src/enum/index.ts
CHANGED
@@ -11,7 +11,6 @@ import {
|
|
11
11
|
Table,
|
12
12
|
UpdatedAt,
|
13
13
|
} from 'sequelize-typescript';
|
14
|
-
import UserGroup from './user-group.entity';
|
15
14
|
import Staff from './staff.entity';
|
16
15
|
import BearerToken from './bearer-token.entity';
|
17
16
|
import OAuthToken from './oauth-token.entity';
|
@@ -24,6 +23,7 @@ import UserSystemRole from './user-system-role.entity';
|
|
24
23
|
import SystemPrivilege from './system-privilege.entity';
|
25
24
|
import UserSystemPrivileges from './user-system-privileges.entity';
|
26
25
|
import { YN } from '../enum/yn.enum';
|
26
|
+
import { UserStatus } from '../enum/user-status.enum';
|
27
27
|
|
28
28
|
@Table({
|
29
29
|
tableName: 'sso_User',
|
@@ -55,7 +55,7 @@ export default class User extends Model {
|
|
55
55
|
allowNull: false,
|
56
56
|
type: DataType.STRING,
|
57
57
|
})
|
58
|
-
Status:
|
58
|
+
Status: UserStatus;
|
59
59
|
|
60
60
|
@Column({
|
61
61
|
allowNull: false,
|
package/tsconfig.build.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
{
|
2
|
-
"extends": "./tsconfig.json",
|
3
|
-
"include": ["**/*.ts"],
|
4
|
-
"exclude": ["node_modules", "__tests__", "dist", "**/*spec.ts"]
|
5
|
-
}
|
1
|
+
{
|
2
|
+
"extends": "./tsconfig.json",
|
3
|
+
"include": ["**/*.ts"],
|
4
|
+
"exclude": ["node_modules", "__tests__", "dist", "**/*spec.ts"]
|
5
|
+
}
|
6
6
|
|
package/tsconfig.json
CHANGED
@@ -1,23 +1,23 @@
|
|
1
|
-
{
|
2
|
-
"compilerOptions": {
|
3
|
-
"module": "commonjs",
|
4
|
-
"declaration": true,
|
5
|
-
"removeComments": true,
|
6
|
-
"emitDecoratorMetadata": true,
|
7
|
-
"experimentalDecorators": true,
|
8
|
-
"allowSyntheticDefaultImports": true,
|
9
|
-
"moduleResolution": "node",
|
10
|
-
"target": "es6",
|
11
|
-
"sourceMap": true,
|
12
|
-
"outDir": "./dist",
|
13
|
-
"baseUrl": "./src",
|
14
|
-
"rootDir": "./",
|
15
|
-
"incremental": true,
|
16
|
-
"skipLibCheck": true,
|
17
|
-
"noImplicitAny": false,
|
18
|
-
"strictBindCallApply": false,
|
19
|
-
"forceConsistentCasingInFileNames": false,
|
20
|
-
"noFallthroughCasesInSwitch": false,
|
21
|
-
"strictNullChecks": true,
|
22
|
-
},
|
23
|
-
}
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"module": "commonjs",
|
4
|
+
"declaration": true,
|
5
|
+
"removeComments": true,
|
6
|
+
"emitDecoratorMetadata": true,
|
7
|
+
"experimentalDecorators": true,
|
8
|
+
"allowSyntheticDefaultImports": true,
|
9
|
+
"moduleResolution": "node",
|
10
|
+
"target": "es6",
|
11
|
+
"sourceMap": true,
|
12
|
+
"outDir": "./dist",
|
13
|
+
"baseUrl": "./src",
|
14
|
+
"rootDir": "./",
|
15
|
+
"incremental": true,
|
16
|
+
"skipLibCheck": true,
|
17
|
+
"noImplicitAny": false,
|
18
|
+
"strictBindCallApply": false,
|
19
|
+
"forceConsistentCasingInFileNames": false,
|
20
|
+
"noFallthroughCasesInSwitch": false,
|
21
|
+
"strictNullChecks": true,
|
22
|
+
},
|
23
|
+
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
module.exports = {
|
4
|
-
async up(queryInterface, Sequelize) {
|
5
|
-
await queryInterface.addColumn('sso_systemPrivilege','Module', {
|
6
|
-
type: Sequelize.STRING(200),
|
7
|
-
})
|
8
|
-
},
|
9
|
-
|
10
|
-
async down(queryInterface) {
|
11
|
-
queryInterface.removeColumn('sso_systemPrivilege','Module')
|
12
|
-
},
|
13
|
-
};
|
@@ -1,78 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
module.exports = {
|
4
|
-
up: async (queryInterface, Sequelize) => {
|
5
|
-
return queryInterface.sequelize.transaction(async (t) => {
|
6
|
-
return await Promise.all([
|
7
|
-
queryInterface.addColumn(
|
8
|
-
'sso_usergroup',
|
9
|
-
'AllowInheritFromParentYN',
|
10
|
-
{
|
11
|
-
type: Sequelize.ENUM(['Y', 'N']),
|
12
|
-
defaultValue: 'N',
|
13
|
-
},
|
14
|
-
{ transaction: t },
|
15
|
-
),
|
16
|
-
queryInterface.addColumn(
|
17
|
-
'sso_usergroup',
|
18
|
-
'FullPath',
|
19
|
-
{
|
20
|
-
type: Sequelize.STRING(1000),
|
21
|
-
allowNull: true,
|
22
|
-
},
|
23
|
-
{ transaction: t },
|
24
|
-
),
|
25
|
-
queryInterface.addColumn(
|
26
|
-
'sso_usergroup',
|
27
|
-
'GroupLevel',
|
28
|
-
{
|
29
|
-
type: Sequelize.INTEGER,
|
30
|
-
allowNull: false,
|
31
|
-
defaultValue: 0,
|
32
|
-
},
|
33
|
-
{ transaction: t },
|
34
|
-
),
|
35
|
-
queryInterface.addColumn(
|
36
|
-
'sso_usergroup',
|
37
|
-
'GroupType',
|
38
|
-
{
|
39
|
-
type: Sequelize.STRING(10),
|
40
|
-
allowNull: true,
|
41
|
-
},
|
42
|
-
{ transaction: t },
|
43
|
-
),
|
44
|
-
queryInterface.addColumn(
|
45
|
-
'sso_usergroup',
|
46
|
-
'ParentGroupCode',
|
47
|
-
{
|
48
|
-
type: Sequelize.STRING(10),
|
49
|
-
allowNull: true,
|
50
|
-
},
|
51
|
-
{ transaction: t },
|
52
|
-
),
|
53
|
-
queryInterface.addColumn(
|
54
|
-
'sso_usergroup',
|
55
|
-
'PersonInCharge',
|
56
|
-
{
|
57
|
-
type: Sequelize.STRING(100),
|
58
|
-
allowNull: true,
|
59
|
-
},
|
60
|
-
{ transaction: t },
|
61
|
-
),
|
62
|
-
]);
|
63
|
-
});
|
64
|
-
},
|
65
|
-
|
66
|
-
down: async (queryInterface) => {
|
67
|
-
return queryInterface.sequelize.transaction(async (t) => {
|
68
|
-
return await Promise.all([
|
69
|
-
queryInterface.removeColumn('sso_usergroup', 'AllowInheritFromParentYN', { transaction: t }),
|
70
|
-
queryInterface.removeColumn('sso_usergroup', 'FullPath', { transaction: t }),
|
71
|
-
queryInterface.removeColumn('sso_usergroup', 'GroupLevel', { transaction: t }),
|
72
|
-
queryInterface.removeColumn('sso_usergroup', 'GroupType', { transaction: t }),
|
73
|
-
queryInterface.removeColumn('sso_usergroup', 'ParentGroupCode', { transaction: t }),
|
74
|
-
queryInterface.removeColumn('sso_usergroup', 'PersonInCharge', { transaction: t }),
|
75
|
-
]);
|
76
|
-
});
|
77
|
-
},
|
78
|
-
};
|
@@ -1,38 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
module.exports = {
|
4
|
-
up: async (queryInterface, Sequelize) => {
|
5
|
-
return queryInterface.sequelize.transaction(async (t) => {
|
6
|
-
return await Promise.all([
|
7
|
-
queryInterface.addColumn(
|
8
|
-
'sso_usersystemprivilege',
|
9
|
-
'IsInheritedYN',
|
10
|
-
{
|
11
|
-
type: Sequelize.ENUM(['Y', 'N']),
|
12
|
-
defaultValue: 'N',
|
13
|
-
},
|
14
|
-
{ transaction: t },
|
15
|
-
),
|
16
|
-
queryInterface.addColumn(
|
17
|
-
'sso_usersystemprivilege',
|
18
|
-
'IsRevokedYN',
|
19
|
-
{
|
20
|
-
type: Sequelize.ENUM(['Y', 'N']),
|
21
|
-
defaultValue: 'N',
|
22
|
-
},
|
23
|
-
{ transaction: t },
|
24
|
-
),
|
25
|
-
]);
|
26
|
-
});
|
27
|
-
},
|
28
|
-
|
29
|
-
down: async (queryInterface) => {
|
30
|
-
return queryInterface.sequelize.transaction(async (t) => {
|
31
|
-
return await Promise.all([
|
32
|
-
queryInterface.removeColumn('sso_usersystemprivilege', 'IsInheritedYN', { transaction: t }),
|
33
|
-
queryInterface.removeColumn('sso_usersystemprivilege', 'IsRevokedYN', { transaction: t }),
|
34
|
-
]);
|
35
|
-
});
|
36
|
-
},
|
37
|
-
};
|
38
|
-
'use strict';
|