@tomei/sso 0.61.0 → 0.62.0
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/.gitlab-ci.yml +16 -16
- 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/group/group.spec.ts +79 -79
- package/__tests__/unit/components/group-object-privilege/group-object-privilege.spec.ts +88 -88
- package/__tests__/unit/components/group-privilege/group-privilege.spec.ts +68 -68
- package/__tests__/unit/components/group-reporting-user/group-reporting-user.spec.ts +66 -66
- package/__tests__/unit/components/group-system-access/group-system-access.spec.ts +83 -83
- package/__tests__/unit/components/login-user/l.spec.ts +746 -746
- package/__tests__/unit/components/login-user/login.spec.ts +1164 -1164
- package/__tests__/unit/components/password-hash/password-hash.service.spec.ts +31 -31
- package/__tests__/unit/components/system/system.spec.ts +254 -254
- package/__tests__/unit/components/system-privilege/system-privilege.spec.ts +83 -83
- package/__tests__/unit/components/user-group/user-group.spec.ts +86 -86
- package/__tests__/unit/components/user-object-privilege/user-object-privilege.spec.ts +78 -78
- package/__tests__/unit/components/user-privilege/user-privilege.spec.ts +72 -72
- package/__tests__/unit/components/user-system-access/user-system-access.spec.ts +89 -89
- 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/coverage/clover.xml +1452 -1452
- package/coverage/coverage-final.json +47 -47
- package/coverage/lcov-report/base.css +224 -224
- package/coverage/lcov-report/block-navigation.js +87 -87
- package/coverage/lcov-report/components/group/group.repository.ts.html +117 -117
- package/coverage/lcov-report/components/group/group.ts.html +327 -327
- package/coverage/lcov-report/components/group/index.html +130 -130
- package/coverage/lcov-report/components/group-object-privilege/group-object-privilege.repository.ts.html +117 -117
- package/coverage/lcov-report/components/group-object-privilege/group-object-privilege.ts.html +321 -321
- package/coverage/lcov-report/components/group-object-privilege/index.html +130 -130
- package/coverage/lcov-report/components/group-privilege/group-privilege.repository.ts.html +117 -117
- package/coverage/lcov-report/components/group-privilege/group-privilege.ts.html +303 -303
- package/coverage/lcov-report/components/group-privilege/index.html +130 -130
- package/coverage/lcov-report/components/group-reporting-user/group-reporting-user.repository.ts.html +117 -117
- package/coverage/lcov-report/components/group-reporting-user/group-reporting-user.ts.html +327 -327
- package/coverage/lcov-report/components/group-reporting-user/index.html +130 -130
- package/coverage/lcov-report/components/group-system-access/group-system-access.repository.ts.html +117 -117
- package/coverage/lcov-report/components/group-system-access/group-system-access.ts.html +309 -309
- package/coverage/lcov-report/components/group-system-access/index.html +130 -130
- package/coverage/lcov-report/components/login-history/index.html +115 -115
- package/coverage/lcov-report/components/login-history/login-history.repository.ts.html +117 -117
- package/coverage/lcov-report/components/login-user/index.html +130 -130
- package/coverage/lcov-report/components/login-user/login-user.ts.html +5007 -5007
- package/coverage/lcov-report/components/login-user/user.repository.ts.html +117 -117
- package/coverage/lcov-report/components/password-hash/index.html +115 -115
- package/coverage/lcov-report/components/password-hash/password-hash.service.ts.html +126 -126
- package/coverage/lcov-report/components/system/index.html +130 -130
- package/coverage/lcov-report/components/system/system.repository.ts.html +117 -117
- package/coverage/lcov-report/components/system/system.ts.html +909 -909
- package/coverage/lcov-report/components/system-privilege/index.html +130 -130
- package/coverage/lcov-report/components/system-privilege/system-privilege.repository.ts.html +120 -120
- package/coverage/lcov-report/components/system-privilege/system-privilege.ts.html +390 -390
- package/coverage/lcov-report/components/user-group/index.html +130 -130
- package/coverage/lcov-report/components/user-group/user-group.repository.ts.html +117 -117
- package/coverage/lcov-report/components/user-group/user-group.ts.html +354 -354
- package/coverage/lcov-report/components/user-object-privilege/index.html +130 -130
- package/coverage/lcov-report/components/user-object-privilege/user-object-privilege.repository.ts.html +117 -117
- package/coverage/lcov-report/components/user-object-privilege/user-object-privilege.ts.html +312 -312
- package/coverage/lcov-report/components/user-privilege/index.html +130 -130
- package/coverage/lcov-report/components/user-privilege/user-privilege.repository.ts.html +117 -117
- package/coverage/lcov-report/components/user-privilege/user-privilege.ts.html +306 -306
- package/coverage/lcov-report/components/user-system-access/index.html +130 -130
- package/coverage/lcov-report/components/user-system-access/user-system-access.repository.ts.html +117 -117
- package/coverage/lcov-report/components/user-system-access/user-system-access.ts.html +312 -312
- package/coverage/lcov-report/enum/group-type.enum.ts.html +108 -108
- package/coverage/lcov-report/enum/index.html +160 -160
- package/coverage/lcov-report/enum/index.ts.html +93 -93
- package/coverage/lcov-report/enum/user-status.enum.ts.html +105 -105
- package/coverage/lcov-report/enum/yn.enum.ts.html +96 -96
- package/coverage/lcov-report/index.html +370 -370
- package/coverage/lcov-report/models/group-object-privilege.entity.ts.html +333 -333
- package/coverage/lcov-report/models/group-privilege.entity.ts.html +315 -315
- package/coverage/lcov-report/models/group-reporting-user.entity.ts.html +339 -339
- package/coverage/lcov-report/models/group-system-access.entity.ts.html +324 -324
- package/coverage/lcov-report/models/group.entity.ts.html +435 -435
- package/coverage/lcov-report/models/index.html +310 -310
- package/coverage/lcov-report/models/login-history.entity.ts.html +252 -252
- package/coverage/lcov-report/models/staff.entity.ts.html +411 -411
- package/coverage/lcov-report/models/system-privilege.entity.ts.html +354 -354
- package/coverage/lcov-report/models/system.entity.ts.html +423 -423
- package/coverage/lcov-report/models/user-group.entity.ts.html +354 -354
- package/coverage/lcov-report/models/user-object-privilege.entity.ts.html +330 -330
- package/coverage/lcov-report/models/user-privilege.entity.ts.html +315 -315
- package/coverage/lcov-report/models/user-system-access.entity.ts.html +315 -315
- package/coverage/lcov-report/models/user.entity.ts.html +522 -522
- package/coverage/lcov-report/prettify.css +1 -1
- package/coverage/lcov-report/prettify.js +2 -2
- package/coverage/lcov-report/redis-client/index.html +115 -115
- package/coverage/lcov-report/redis-client/redis.service.ts.html +240 -240
- package/coverage/lcov-report/session/index.html +115 -115
- package/coverage/lcov-report/session/session.service.ts.html +246 -246
- package/coverage/lcov-report/sorter.js +196 -196
- package/coverage/lcov.info +2490 -2490
- package/coverage/test-report.xml +128 -128
- package/create-sso-user.sql +39 -39
- package/dist/src/components/login-history/login-history.d.ts +23 -0
- package/dist/src/components/login-history/login-history.js +88 -0
- package/dist/src/components/login-history/login-history.js.map +1 -0
- package/dist/src/components/login-user/user.js +4 -3
- package/dist/src/components/login-user/user.js.map +1 -1
- package/dist/src/interfaces/login-history-search-attr.interface.d.ts +8 -0
- package/dist/src/interfaces/login-history-search-attr.interface.js +3 -0
- package/dist/src/interfaces/login-history-search-attr.interface.js.map +1 -0
- package/dist/src/interfaces/login-history.interface.d.ts +11 -0
- package/dist/src/interfaces/login-history.interface.js +3 -0
- package/dist/src/interfaces/login-history.interface.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/eslint.config.mjs +58 -58
- package/jest.config.js +14 -14
- package/migrations/20240314080602-create-user-table.js +124 -124
- package/migrations/20240314080603-create-user-group-table.js +85 -85
- package/migrations/20240314080604-create-user-user-group-table.js +55 -55
- package/migrations/20240314080605-create-login-history-table.js +53 -53
- package/migrations/20240527064925-create-system-table.js +78 -78
- package/migrations/20240527064926-create-system-privilege-table.js +71 -71
- package/migrations/20240527065342-create-group-table.js +93 -93
- package/migrations/20240527065633-create-group-reporting-user-table.js +76 -76
- package/migrations/20240528011551-create-group-system-access-table.js +72 -72
- package/migrations/20240528023018-user-system-access-table.js +75 -75
- package/migrations/20240528032229-user-privilege-table.js +76 -76
- package/migrations/20240528063003-create-group-privilege-table.js +76 -76
- package/migrations/20240528063051-create-group-object-privilege-table.js +84 -84
- package/migrations/20240528063107-create-user-object-privilege-table.js +84 -84
- package/migrations/20240528063108-create-api-key-table.js +85 -85
- package/migrations/20241104104802-create-building-table.js +95 -95
- package/migrations/20250108091132-add-area-manager-user-id-to-building-table.js +14 -14
- package/migrations/20250108091133-add-passcode-to-user-table.js +36 -36
- package/migrations/20250210115636-create-user-reporting-hierarchy.js +76 -76
- package/migrations/20250326043818-crate-user-password-history.js +42 -42
- package/package.json +90 -90
- package/sampledotenv +7 -7
- package/sonar-project.properties +22 -22
- package/src/components/api-key/api-key.repository.ts +15 -15
- package/src/components/api-key/api-key.ts +448 -448
- package/src/components/api-key/index.ts +4 -4
- package/src/components/building/building.repository.ts +27 -27
- package/src/components/building/index.ts +2 -2
- package/src/components/group/group.repository.ts +26 -26
- package/src/components/group/group.ts +2284 -2284
- package/src/components/group/index.ts +3 -3
- package/src/components/group-object-privilege/group-object-privilege.repository.ts +25 -25
- package/src/components/group-object-privilege/group-object-privilege.ts +278 -278
- package/src/components/group-object-privilege/index.ts +2 -2
- package/src/components/group-privilege/group-privilege.repository.ts +29 -29
- package/src/components/group-privilege/group-privilege.ts +84 -84
- package/src/components/group-privilege/index.ts +2 -2
- package/src/components/group-reporting-user/group-reporting-user.repository.ts +23 -23
- package/src/components/group-reporting-user/group-reporting-user.ts +506 -506
- package/src/components/group-reporting-user/index.ts +3 -3
- package/src/components/group-system-access/group-system-access.repository.ts +43 -43
- package/src/components/group-system-access/group-system-access.ts +90 -90
- package/src/components/group-system-access/index.ts +2 -2
- package/src/components/index.ts +20 -20
- package/src/components/login-history/index.ts +1 -1
- package/src/components/login-history/login-history.repository.ts +11 -11
- package/src/components/login-user/index.ts +5 -5
- package/src/components/login-user/interfaces/check-user-info-duplicated.interface.ts +7 -7
- package/src/components/login-user/interfaces/index.ts +1 -1
- package/src/components/login-user/interfaces/system-access.interface.ts +13 -13
- package/src/components/login-user/interfaces/user-info.interface.ts +34 -34
- package/src/components/login-user/login-user.ts +362 -362
- package/src/components/login-user/user.repository.ts +11 -11
- package/src/components/login-user/user.ts +3143 -3142
- package/src/components/password-hash/index.ts +2 -2
- package/src/components/password-hash/interfaces/index.ts +1 -1
- package/src/components/password-hash/interfaces/password-hash-service.interface.ts +4 -4
- package/src/components/password-hash/password-hash.service.ts +14 -14
- package/src/components/staff/index.ts +2 -2
- package/src/components/staff/staff.repository.ts +27 -27
- package/src/components/system/index.ts +3 -3
- package/src/components/system/system.repository.ts +11 -11
- package/src/components/system/system.ts +456 -456
- package/src/components/system-privilege/index.ts +4 -4
- package/src/components/system-privilege/system-privilege.repository.ts +18 -18
- package/src/components/system-privilege/system-privilege.ts +541 -541
- package/src/components/user-group/index.ts +2 -2
- package/src/components/user-group/user-group.repository.ts +19 -19
- package/src/components/user-group/user-group.ts +764 -764
- package/src/components/user-object-privilege/index.ts +2 -2
- package/src/components/user-object-privilege/user-object-privilege.repository.ts +11 -11
- package/src/components/user-object-privilege/user-object-privilege.ts +79 -79
- package/src/components/user-password-history/index.ts +2 -2
- package/src/components/user-password-history/user-password-history.repository.ts +39 -39
- package/src/components/user-password-history/user-password-history.ts +187 -187
- package/src/components/user-privilege/index.ts +2 -2
- package/src/components/user-privilege/user-privilege.repository.ts +25 -25
- package/src/components/user-privilege/user-privilege.ts +662 -662
- package/src/components/user-reporting-hierarchy/index.ts +2 -2
- package/src/components/user-reporting-hierarchy/user-reporting-hierarchy.repository.ts +30 -30
- package/src/components/user-reporting-hierarchy/user-reporting-hierarchy.ts +505 -505
- package/src/components/user-system-access/index.ts +2 -2
- package/src/components/user-system-access/user-system-access.repository.ts +41 -41
- package/src/components/user-system-access/user-system-access.ts +717 -717
- package/src/database.ts +15 -15
- package/src/enum/api-key.enum.ts +5 -5
- package/src/enum/building-type.enum.ts +6 -6
- package/src/enum/group-type.enum.ts +8 -8
- package/src/enum/index.ts +6 -6
- package/src/enum/login-status.enum.ts +4 -4
- package/src/enum/object-status.enum.ts +4 -4
- package/src/enum/user-status.enum.ts +7 -7
- package/src/enum/yn.enum.ts +4 -4
- package/src/index.ts +8 -8
- package/src/interfaces/api-key-attr.interface.ts +16 -16
- package/src/interfaces/group-object-privilege.interface.ts +14 -14
- package/src/interfaces/group-privilege.interface.ts +10 -10
- package/src/interfaces/group-reporting-user.interface.ts +11 -11
- package/src/interfaces/group-search-attr.interface.ts +9 -9
- package/src/interfaces/group-system-access.interface.ts +10 -10
- package/src/interfaces/group.interface.ts +17 -17
- package/src/interfaces/index.ts +13 -13
- package/src/interfaces/system-login.interface.ts +6 -6
- package/src/interfaces/system-privilege-search.interface.ts +5 -5
- package/src/interfaces/system-privilege.interface.ts +11 -11
- package/src/interfaces/system-search-attr.interface.ts +5 -5
- package/src/interfaces/system.interface.ts +15 -15
- package/src/interfaces/user-group.interface.ts +12 -12
- package/src/interfaces/user-object-privilege.interface.ts +14 -14
- package/src/interfaces/user-password-history.interface.ts +6 -6
- package/src/interfaces/user-privilege.interface.ts +10 -10
- package/src/interfaces/user-reporting-hierarchy.interface.ts +11 -11
- package/src/interfaces/user-session.interface.ts +5 -5
- package/src/interfaces/user-system-access.interface.ts +10 -10
- package/src/models/api-key-entity.ts +101 -101
- package/src/models/building.entity.ts +103 -103
- package/src/models/group-object-privilege.entity.ts +91 -91
- package/src/models/group-privilege.entity.ts +78 -78
- package/src/models/group-reporting-user.entity.ts +95 -95
- package/src/models/group-system-access.entity.ts +81 -81
- package/src/models/group.entity.ts +127 -127
- package/src/models/login-history.entity.ts +63 -63
- package/src/models/staff.entity.ts +91 -91
- package/src/models/system-privilege.entity.ts +90 -90
- package/src/models/system.entity.ts +113 -113
- package/src/models/user-group.entity.ts +91 -91
- package/src/models/user-object-privilege.entity.ts +90 -90
- package/src/models/user-password-history.ts +51 -51
- package/src/models/user-privilege.entity.ts +78 -78
- package/src/models/user-reporting-hierarchy.entity.ts +102 -102
- package/src/models/user-system-access.entity.ts +87 -87
- package/src/models/user.entity.ts +193 -193
- package/src/redis-client/__mocks__/jest-initial-setup.ts +2 -2
- package/src/redis-client/__mocks__/redis-mock.ts +28 -28
- package/src/redis-client/index.ts +1 -1
- package/src/redis-client/redis.service.ts +75 -75
- package/src/session/index.ts +2 -2
- package/src/session/interfaces/index.ts +1 -1
- package/src/session/interfaces/session-service.interface.ts +26 -26
- package/src/session/session.service.ts +96 -96
- package/src/types/auth-context.ts +10 -10
- package/src/types/index.ts +1 -1
- package/tsconfig.build.json +5 -5
- package/tsconfig.json +23 -23
@@ -1,3 +1,3 @@
|
|
1
|
-
//export all files inside this folder
|
2
|
-
export * from './group-reporting-user';
|
3
|
-
export * from './group-reporting-user.repository';
|
1
|
+
//export all files inside this folder
|
2
|
+
export * from './group-reporting-user';
|
3
|
+
export * from './group-reporting-user.repository';
|
@@ -1,43 +1,43 @@
|
|
1
|
-
import GroupSystemAccessModel from '../../models/group-system-access.entity';
|
2
|
-
import { RepositoryBase, IRepositoryBase } from '@tomei/general';
|
3
|
-
|
4
|
-
export class GroupSystemAccessRepository
|
5
|
-
extends RepositoryBase<GroupSystemAccessModel>
|
6
|
-
implements IRepositoryBase<GroupSystemAccessModel>
|
7
|
-
{
|
8
|
-
constructor() {
|
9
|
-
super(GroupSystemAccessModel);
|
10
|
-
}
|
11
|
-
|
12
|
-
async findAndCountAll(options?: any) {
|
13
|
-
try {
|
14
|
-
let GroupSystemAccess: any;
|
15
|
-
if (options) {
|
16
|
-
GroupSystemAccess =
|
17
|
-
await GroupSystemAccessModel.findAndCountAll(options);
|
18
|
-
} else {
|
19
|
-
GroupSystemAccess = await GroupSystemAccessModel.findAndCountAll();
|
20
|
-
}
|
21
|
-
return GroupSystemAccess;
|
22
|
-
} catch (error) {
|
23
|
-
throw new Error(
|
24
|
-
`An Error occured when retriving GroupSystemAccess: ${error.message}`,
|
25
|
-
);
|
26
|
-
}
|
27
|
-
}
|
28
|
-
|
29
|
-
async delete(GroupCode: string, SystemCode: string, dbTransaction?: any) {
|
30
|
-
try {
|
31
|
-
const options = {
|
32
|
-
where: {
|
33
|
-
GroupCode: GroupCode,
|
34
|
-
SystemCode: SystemCode,
|
35
|
-
},
|
36
|
-
transaction: dbTransaction,
|
37
|
-
};
|
38
|
-
await GroupSystemAccessModel.destroy(options);
|
39
|
-
} catch (error) {
|
40
|
-
throw new Error(`An Error occured when delete : ${error.message}`);
|
41
|
-
}
|
42
|
-
}
|
43
|
-
}
|
1
|
+
import GroupSystemAccessModel from '../../models/group-system-access.entity';
|
2
|
+
import { RepositoryBase, IRepositoryBase } from '@tomei/general';
|
3
|
+
|
4
|
+
export class GroupSystemAccessRepository
|
5
|
+
extends RepositoryBase<GroupSystemAccessModel>
|
6
|
+
implements IRepositoryBase<GroupSystemAccessModel>
|
7
|
+
{
|
8
|
+
constructor() {
|
9
|
+
super(GroupSystemAccessModel);
|
10
|
+
}
|
11
|
+
|
12
|
+
async findAndCountAll(options?: any) {
|
13
|
+
try {
|
14
|
+
let GroupSystemAccess: any;
|
15
|
+
if (options) {
|
16
|
+
GroupSystemAccess =
|
17
|
+
await GroupSystemAccessModel.findAndCountAll(options);
|
18
|
+
} else {
|
19
|
+
GroupSystemAccess = await GroupSystemAccessModel.findAndCountAll();
|
20
|
+
}
|
21
|
+
return GroupSystemAccess;
|
22
|
+
} catch (error) {
|
23
|
+
throw new Error(
|
24
|
+
`An Error occured when retriving GroupSystemAccess: ${error.message}`,
|
25
|
+
);
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
async delete(GroupCode: string, SystemCode: string, dbTransaction?: any) {
|
30
|
+
try {
|
31
|
+
const options = {
|
32
|
+
where: {
|
33
|
+
GroupCode: GroupCode,
|
34
|
+
SystemCode: SystemCode,
|
35
|
+
},
|
36
|
+
transaction: dbTransaction,
|
37
|
+
};
|
38
|
+
await GroupSystemAccessModel.destroy(options);
|
39
|
+
} catch (error) {
|
40
|
+
throw new Error(`An Error occured when delete : ${error.message}`);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
@@ -1,90 +1,90 @@
|
|
1
|
-
import { ClassError, ObjectBase } from '@tomei/general';
|
2
|
-
import { GroupSystemAccessRepository } from './group-system-access.repository';
|
3
|
-
import { IGroupSystemAccessAttr } from '../../interfaces/group-system-access.interface';
|
4
|
-
|
5
|
-
export class GroupSystemAccess extends ObjectBase {
|
6
|
-
ObjectType = 'GroupSystemAccess';
|
7
|
-
TableName = 'sso_GroupSystemAccess';
|
8
|
-
ObjectName: string;
|
9
|
-
ObjectId: string;
|
10
|
-
|
11
|
-
GroupSystemAccessId: number;
|
12
|
-
GroupCode: string;
|
13
|
-
SystemCode: string;
|
14
|
-
Status: string;
|
15
|
-
private _CreatedAt: Date;
|
16
|
-
private _UpdatedAt: Date;
|
17
|
-
private _CreatedById: number;
|
18
|
-
private _UpdatedById: number;
|
19
|
-
|
20
|
-
get CreatedAt() {
|
21
|
-
return this._CreatedAt;
|
22
|
-
}
|
23
|
-
set CreatedAt(CreatedAt: Date) {
|
24
|
-
this._CreatedAt = CreatedAt;
|
25
|
-
}
|
26
|
-
|
27
|
-
get UpdatedAt() {
|
28
|
-
return this._UpdatedAt;
|
29
|
-
}
|
30
|
-
|
31
|
-
set UpdatedAt(UpdatedAt: Date) {
|
32
|
-
this._UpdatedAt = UpdatedAt;
|
33
|
-
}
|
34
|
-
|
35
|
-
get CreatedById() {
|
36
|
-
return this._CreatedById;
|
37
|
-
}
|
38
|
-
|
39
|
-
set CreatedById(CreatedById: number) {
|
40
|
-
this._CreatedById = CreatedById;
|
41
|
-
}
|
42
|
-
|
43
|
-
get UpdatedById() {
|
44
|
-
return this._UpdatedById;
|
45
|
-
}
|
46
|
-
|
47
|
-
set UpdatedById(UpdatedById: number) {
|
48
|
-
this._UpdatedById = UpdatedById;
|
49
|
-
}
|
50
|
-
|
51
|
-
private static _Repository = new GroupSystemAccessRepository();
|
52
|
-
|
53
|
-
constructor(groupSystemAccessAttr?: IGroupSystemAccessAttr) {
|
54
|
-
super();
|
55
|
-
if (groupSystemAccessAttr) {
|
56
|
-
this.GroupSystemAccessId = groupSystemAccessAttr.GroupSystemAccessId;
|
57
|
-
this.GroupCode = groupSystemAccessAttr.GroupCode;
|
58
|
-
this.SystemCode = groupSystemAccessAttr.SystemCode;
|
59
|
-
this.Status = groupSystemAccessAttr.Status;
|
60
|
-
this._CreatedById = groupSystemAccessAttr.CreatedById;
|
61
|
-
this._CreatedAt = groupSystemAccessAttr.CreatedAt;
|
62
|
-
this._UpdatedById = groupSystemAccessAttr.UpdatedById;
|
63
|
-
this._UpdatedAt = groupSystemAccessAttr.UpdatedAt;
|
64
|
-
}
|
65
|
-
}
|
66
|
-
|
67
|
-
static async init(dbTransaction: any, GroupSystemAccessId?: number) {
|
68
|
-
try {
|
69
|
-
const groupSystemAccess = new GroupSystemAccess();
|
70
|
-
if (GroupSystemAccessId) {
|
71
|
-
const groupSystemAccess = await this._Repository.findOne({
|
72
|
-
where: { GroupSystemAccessId },
|
73
|
-
transaction: dbTransaction,
|
74
|
-
});
|
75
|
-
if (groupSystemAccess) {
|
76
|
-
return new GroupSystemAccess(groupSystemAccess.get({ plain: true }));
|
77
|
-
} else {
|
78
|
-
throw new ClassError(
|
79
|
-
'groupSystemAccess',
|
80
|
-
'groupSystemAccessErrMsg00',
|
81
|
-
'groupSystemAccess not found',
|
82
|
-
);
|
83
|
-
}
|
84
|
-
}
|
85
|
-
return groupSystemAccess;
|
86
|
-
} catch (error) {
|
87
|
-
throw error;
|
88
|
-
}
|
89
|
-
}
|
90
|
-
}
|
1
|
+
import { ClassError, ObjectBase } from '@tomei/general';
|
2
|
+
import { GroupSystemAccessRepository } from './group-system-access.repository';
|
3
|
+
import { IGroupSystemAccessAttr } from '../../interfaces/group-system-access.interface';
|
4
|
+
|
5
|
+
export class GroupSystemAccess extends ObjectBase {
|
6
|
+
ObjectType = 'GroupSystemAccess';
|
7
|
+
TableName = 'sso_GroupSystemAccess';
|
8
|
+
ObjectName: string;
|
9
|
+
ObjectId: string;
|
10
|
+
|
11
|
+
GroupSystemAccessId: number;
|
12
|
+
GroupCode: string;
|
13
|
+
SystemCode: string;
|
14
|
+
Status: string;
|
15
|
+
private _CreatedAt: Date;
|
16
|
+
private _UpdatedAt: Date;
|
17
|
+
private _CreatedById: number;
|
18
|
+
private _UpdatedById: number;
|
19
|
+
|
20
|
+
get CreatedAt() {
|
21
|
+
return this._CreatedAt;
|
22
|
+
}
|
23
|
+
set CreatedAt(CreatedAt: Date) {
|
24
|
+
this._CreatedAt = CreatedAt;
|
25
|
+
}
|
26
|
+
|
27
|
+
get UpdatedAt() {
|
28
|
+
return this._UpdatedAt;
|
29
|
+
}
|
30
|
+
|
31
|
+
set UpdatedAt(UpdatedAt: Date) {
|
32
|
+
this._UpdatedAt = UpdatedAt;
|
33
|
+
}
|
34
|
+
|
35
|
+
get CreatedById() {
|
36
|
+
return this._CreatedById;
|
37
|
+
}
|
38
|
+
|
39
|
+
set CreatedById(CreatedById: number) {
|
40
|
+
this._CreatedById = CreatedById;
|
41
|
+
}
|
42
|
+
|
43
|
+
get UpdatedById() {
|
44
|
+
return this._UpdatedById;
|
45
|
+
}
|
46
|
+
|
47
|
+
set UpdatedById(UpdatedById: number) {
|
48
|
+
this._UpdatedById = UpdatedById;
|
49
|
+
}
|
50
|
+
|
51
|
+
private static _Repository = new GroupSystemAccessRepository();
|
52
|
+
|
53
|
+
constructor(groupSystemAccessAttr?: IGroupSystemAccessAttr) {
|
54
|
+
super();
|
55
|
+
if (groupSystemAccessAttr) {
|
56
|
+
this.GroupSystemAccessId = groupSystemAccessAttr.GroupSystemAccessId;
|
57
|
+
this.GroupCode = groupSystemAccessAttr.GroupCode;
|
58
|
+
this.SystemCode = groupSystemAccessAttr.SystemCode;
|
59
|
+
this.Status = groupSystemAccessAttr.Status;
|
60
|
+
this._CreatedById = groupSystemAccessAttr.CreatedById;
|
61
|
+
this._CreatedAt = groupSystemAccessAttr.CreatedAt;
|
62
|
+
this._UpdatedById = groupSystemAccessAttr.UpdatedById;
|
63
|
+
this._UpdatedAt = groupSystemAccessAttr.UpdatedAt;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
static async init(dbTransaction: any, GroupSystemAccessId?: number) {
|
68
|
+
try {
|
69
|
+
const groupSystemAccess = new GroupSystemAccess();
|
70
|
+
if (GroupSystemAccessId) {
|
71
|
+
const groupSystemAccess = await this._Repository.findOne({
|
72
|
+
where: { GroupSystemAccessId },
|
73
|
+
transaction: dbTransaction,
|
74
|
+
});
|
75
|
+
if (groupSystemAccess) {
|
76
|
+
return new GroupSystemAccess(groupSystemAccess.get({ plain: true }));
|
77
|
+
} else {
|
78
|
+
throw new ClassError(
|
79
|
+
'groupSystemAccess',
|
80
|
+
'groupSystemAccessErrMsg00',
|
81
|
+
'groupSystemAccess not found',
|
82
|
+
);
|
83
|
+
}
|
84
|
+
}
|
85
|
+
return groupSystemAccess;
|
86
|
+
} catch (error) {
|
87
|
+
throw error;
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from './group-system-access';
|
2
|
-
export * from './group-system-access.repository';
|
1
|
+
export * from './group-system-access';
|
2
|
+
export * from './group-system-access.repository';
|
package/src/components/index.ts
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
export * from './login-history';
|
2
|
-
export * from './login-user';
|
3
|
-
export * from './password-hash';
|
4
|
-
export * from './system';
|
5
|
-
export * from './user-group';
|
6
|
-
export * from './building';
|
7
|
-
export * from './staff';
|
8
|
-
export * from './user-system-access';
|
9
|
-
export * from './user-privilege';
|
10
|
-
export * from './group-system-access';
|
11
|
-
export * from './user-object-privilege';
|
12
|
-
export * from './group-privilege';
|
13
|
-
export * from './group-object-privilege';
|
14
|
-
export * from './system-privilege';
|
15
|
-
export * from './group';
|
16
|
-
export * from './api-key';
|
17
|
-
export * from './group-reporting-user';
|
18
|
-
export * from './user-reporting-hierarchy';
|
19
|
-
|
20
|
-
//test ci
|
1
|
+
export * from './login-history';
|
2
|
+
export * from './login-user';
|
3
|
+
export * from './password-hash';
|
4
|
+
export * from './system';
|
5
|
+
export * from './user-group';
|
6
|
+
export * from './building';
|
7
|
+
export * from './staff';
|
8
|
+
export * from './user-system-access';
|
9
|
+
export * from './user-privilege';
|
10
|
+
export * from './group-system-access';
|
11
|
+
export * from './user-object-privilege';
|
12
|
+
export * from './group-privilege';
|
13
|
+
export * from './group-object-privilege';
|
14
|
+
export * from './system-privilege';
|
15
|
+
export * from './group';
|
16
|
+
export * from './api-key';
|
17
|
+
export * from './group-reporting-user';
|
18
|
+
export * from './user-reporting-hierarchy';
|
19
|
+
|
20
|
+
//test ci
|
@@ -1 +1 @@
|
|
1
|
-
export * from './login-history.repository';
|
1
|
+
export * from './login-history.repository';
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import LoginHistory from '../../models/login-history.entity';
|
2
|
-
import { RepositoryBase, IRepositoryBase } from '@tomei/general';
|
3
|
-
|
4
|
-
export class LoginHistoryRepository
|
5
|
-
extends RepositoryBase<LoginHistory>
|
6
|
-
implements IRepositoryBase<LoginHistory>
|
7
|
-
{
|
8
|
-
constructor() {
|
9
|
-
super(LoginHistory);
|
10
|
-
}
|
11
|
-
}
|
1
|
+
import LoginHistory from '../../models/login-history.entity';
|
2
|
+
import { RepositoryBase, IRepositoryBase } from '@tomei/general';
|
3
|
+
|
4
|
+
export class LoginHistoryRepository
|
5
|
+
extends RepositoryBase<LoginHistory>
|
6
|
+
implements IRepositoryBase<LoginHistory>
|
7
|
+
{
|
8
|
+
constructor() {
|
9
|
+
super(LoginHistory);
|
10
|
+
}
|
11
|
+
}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
//export all files inside this folder
|
2
|
-
export * from './interfaces';
|
3
|
-
export * from './login-user';
|
4
|
-
export * from './user';
|
5
|
-
export * from './user.repository';
|
1
|
+
//export all files inside this folder
|
2
|
+
export * from './interfaces';
|
3
|
+
export * from './login-user';
|
4
|
+
export * from './user';
|
5
|
+
export * from './user.repository';
|
@@ -1,7 +1,7 @@
|
|
1
|
-
export interface ICheckUserInfoDuplicatedQuery {
|
2
|
-
Email?: string;
|
3
|
-
UserName?: string;
|
4
|
-
IdType?: string;
|
5
|
-
IdNo?: string;
|
6
|
-
ContactNo?: string;
|
7
|
-
}
|
1
|
+
export interface ICheckUserInfoDuplicatedQuery {
|
2
|
+
Email?: string;
|
3
|
+
UserName?: string;
|
4
|
+
IdType?: string;
|
5
|
+
IdNo?: string;
|
6
|
+
ContactNo?: string;
|
7
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
export * from './user-info.interface';
|
1
|
+
export * from './user-info.interface';
|
@@ -1,13 +1,13 @@
|
|
1
|
-
export interface ISystemAccess {
|
2
|
-
UserSystemAccessId?: number;
|
3
|
-
GroupSystemAccessId?: number;
|
4
|
-
UserId?: number;
|
5
|
-
SystemCode?: string;
|
6
|
-
GroupCode?: string;
|
7
|
-
Status?: string;
|
8
|
-
CreatedById?: number;
|
9
|
-
UpdatedById?: number;
|
10
|
-
System?: any;
|
11
|
-
CreatedAt?: Date;
|
12
|
-
UpdatedAt?: Date;
|
13
|
-
}
|
1
|
+
export interface ISystemAccess {
|
2
|
+
UserSystemAccessId?: number;
|
3
|
+
GroupSystemAccessId?: number;
|
4
|
+
UserId?: number;
|
5
|
+
SystemCode?: string;
|
6
|
+
GroupCode?: string;
|
7
|
+
Status?: string;
|
8
|
+
CreatedById?: number;
|
9
|
+
UpdatedById?: number;
|
10
|
+
System?: any;
|
11
|
+
CreatedAt?: Date;
|
12
|
+
UpdatedAt?: Date;
|
13
|
+
}
|
@@ -1,34 +1,34 @@
|
|
1
|
-
import { UserStatus } from '../../../enum/user-status.enum';
|
2
|
-
import { YN } from '../../../enum/yn.enum';
|
3
|
-
|
4
|
-
export interface IUserInfo {
|
5
|
-
FullName: string;
|
6
|
-
IDNo: string;
|
7
|
-
IDType: string;
|
8
|
-
Email: string;
|
9
|
-
ContactNo: string;
|
10
|
-
UserName: string;
|
11
|
-
UserId?: number;
|
12
|
-
Password: string;
|
13
|
-
staffs?: any;
|
14
|
-
}
|
15
|
-
|
16
|
-
export interface IUserAttr extends IUserInfo {
|
17
|
-
Status: UserStatus;
|
18
|
-
DefaultPasswordChangedYN: YN;
|
19
|
-
FirstLoginAt: Date;
|
20
|
-
LastLoginAt: Date;
|
21
|
-
MFAEnabled: number;
|
22
|
-
MFAConfig: string;
|
23
|
-
RecoveryEmail: string;
|
24
|
-
FailedLoginAttemptCount: number;
|
25
|
-
LastFailedLoginAt: Date;
|
26
|
-
LastPasswordChangedAt: Date;
|
27
|
-
NeedToChangePasswordYN: YN;
|
28
|
-
PasscodeHash: string;
|
29
|
-
PasscodeUpdatedAt: Date;
|
30
|
-
CreatedById: number;
|
31
|
-
CreatedAt: Date;
|
32
|
-
UpdatedById: number;
|
33
|
-
UpdatedAt: Date;
|
34
|
-
}
|
1
|
+
import { UserStatus } from '../../../enum/user-status.enum';
|
2
|
+
import { YN } from '../../../enum/yn.enum';
|
3
|
+
|
4
|
+
export interface IUserInfo {
|
5
|
+
FullName: string;
|
6
|
+
IDNo: string;
|
7
|
+
IDType: string;
|
8
|
+
Email: string;
|
9
|
+
ContactNo: string;
|
10
|
+
UserName: string;
|
11
|
+
UserId?: number;
|
12
|
+
Password: string;
|
13
|
+
staffs?: any;
|
14
|
+
}
|
15
|
+
|
16
|
+
export interface IUserAttr extends IUserInfo {
|
17
|
+
Status: UserStatus;
|
18
|
+
DefaultPasswordChangedYN: YN;
|
19
|
+
FirstLoginAt: Date;
|
20
|
+
LastLoginAt: Date;
|
21
|
+
MFAEnabled: number;
|
22
|
+
MFAConfig: string;
|
23
|
+
RecoveryEmail: string;
|
24
|
+
FailedLoginAttemptCount: number;
|
25
|
+
LastFailedLoginAt: Date;
|
26
|
+
LastPasswordChangedAt: Date;
|
27
|
+
NeedToChangePasswordYN: YN;
|
28
|
+
PasscodeHash: string;
|
29
|
+
PasscodeUpdatedAt: Date;
|
30
|
+
CreatedById: number;
|
31
|
+
CreatedAt: Date;
|
32
|
+
UpdatedById: number;
|
33
|
+
UpdatedAt: Date;
|
34
|
+
}
|