@tomei/sso 0.8.10 → 0.8.11
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 -5
- package/Jenkinsfile +57 -57
- package/README.md +23 -23
- package/__tests__/unit/components/login-history/login-history.repository.spec.ts +95 -95
- package/__tests__/unit/components/login-user/login-user.spec.ts +731 -731
- package/__tests__/unit/components/login-user/user.repository.spec.ts +81 -81
- package/__tests__/unit/components/password-hash/password-hash.service.spec.ts +31 -31
- package/__tests__/unit/components/system/system.repository.spec.ts +88 -88
- package/__tests__/unit/components/system-access/system-access.repository.spec.ts +78 -78
- package/__tests__/unit/redis-client/redis.service.spec.ts +23 -23
- package/__tests__/unit/session/session.service.spec.ts +47 -47
- package/create-sso-user.sql +39 -39
- package/dist/__tests__/unit/redis-client/redis.service.spec.d.ts +1 -1
- package/dist/__tests__/unit/redis-client/redis.service.spec.js +31 -31
- package/dist/__tests__/unit/session/session.service.spec.d.ts +1 -1
- package/dist/__tests__/unit/session/session.service.spec.js +54 -54
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -17
- package/dist/src/components/index.d.ts +7 -7
- package/dist/src/components/index.js +23 -23
- package/dist/src/components/login-history/index.d.ts +1 -1
- package/dist/src/components/login-history/index.js +17 -17
- package/dist/src/components/login-history/login-history.repository.d.ts +5 -5
- package/dist/src/components/login-history/login-history.repository.js +11 -11
- package/dist/src/components/login-user/index.d.ts +3 -3
- package/dist/src/components/login-user/index.js +19 -19
- package/dist/src/components/login-user/interfaces/index.d.ts +1 -1
- package/dist/src/components/login-user/interfaces/index.js +17 -17
- package/dist/src/components/login-user/interfaces/user-info.interface.d.ts +9 -9
- package/dist/src/components/login-user/interfaces/user-info.interface.js +2 -2
- package/dist/src/components/login-user/login-user.d.ts +44 -44
- package/dist/src/components/login-user/login-user.js +416 -414
- package/dist/src/components/login-user/login-user.js.map +1 -1
- package/dist/src/components/login-user/user.repository.d.ts +5 -5
- package/dist/src/components/login-user/user.repository.js +11 -11
- package/dist/src/components/password-hash/index.d.ts +2 -2
- package/dist/src/components/password-hash/index.js +18 -18
- package/dist/src/components/password-hash/interfaces/index.d.ts +1 -1
- package/dist/src/components/password-hash/interfaces/index.js +17 -17
- package/dist/src/components/password-hash/interfaces/password-hash-service.interface.d.ts +4 -4
- package/dist/src/components/password-hash/interfaces/password-hash-service.interface.js +2 -2
- package/dist/src/components/password-hash/password-hash.service.d.ts +6 -6
- package/dist/src/components/password-hash/password-hash.service.js +27 -27
- package/dist/src/components/system/index.d.ts +1 -1
- package/dist/src/components/system/index.js +17 -17
- package/dist/src/components/system/system.repository.d.ts +5 -5
- package/dist/src/components/system/system.repository.js +11 -11
- package/dist/src/components/system-access/index.d.ts +1 -1
- package/dist/src/components/system-access/index.js +17 -17
- package/dist/src/components/system-access/system-access.repository.d.ts +5 -5
- package/dist/src/components/system-access/system-access.repository.js +11 -11
- package/dist/src/components/user-group/index.d.ts +1 -1
- package/dist/src/components/user-group/index.js +17 -17
- package/dist/src/components/user-group/user-group.repository.d.ts +5 -5
- package/dist/src/components/user-group/user-group.repository.js +11 -11
- package/dist/src/components/user-user-group/index.d.ts +1 -1
- package/dist/src/components/user-user-group/index.js +17 -17
- package/dist/src/components/user-user-group/user-user-group.repository.d.ts +5 -5
- package/dist/src/components/user-user-group/user-user-group.repository.js +11 -11
- package/dist/src/database.d.ts +4 -4
- package/dist/src/database.js +14 -14
- package/dist/src/index.d.ts +5 -5
- package/dist/src/index.js +23 -23
- package/dist/src/interfaces/index.d.ts +2 -2
- package/dist/src/interfaces/index.js +18 -18
- package/dist/src/interfaces/system-login.interface.d.ts +6 -6
- package/dist/src/interfaces/system-login.interface.js +2 -2
- package/dist/src/interfaces/user-session.interface.d.ts +4 -4
- package/dist/src/interfaces/user-session.interface.js +2 -2
- package/dist/src/models/authorization-code.entity.d.ts +14 -14
- package/dist/src/models/authorization-code.entity.js +85 -85
- package/dist/src/models/bearer-token.entity.d.ts +11 -11
- package/dist/src/models/bearer-token.entity.js +71 -71
- package/dist/src/models/building-type.entity.d.ts +7 -7
- package/dist/src/models/building-type.entity.js +49 -49
- package/dist/src/models/building.entity.d.ts +39 -39
- package/dist/src/models/building.entity.js +250 -250
- package/dist/src/models/city.entity.d.ts +11 -11
- package/dist/src/models/city.entity.js +71 -71
- package/dist/src/models/company.entity.d.ts +18 -18
- package/dist/src/models/company.entity.js +113 -113
- package/dist/src/models/country.entity.d.ts +15 -15
- package/dist/src/models/country.entity.js +91 -91
- package/dist/src/models/department.entity.d.ts +19 -19
- package/dist/src/models/department.entity.js +111 -111
- package/dist/src/models/group-role-privilege.entity.d.ts +17 -17
- package/dist/src/models/group-role-privilege.entity.js +89 -89
- package/dist/src/models/group-system-access.entity.d.ts +11 -11
- package/dist/src/models/group-system-access.entity.js +61 -61
- package/dist/src/models/group-system-privilege.entity.d.ts +11 -11
- package/dist/src/models/group-system-privilege.entity.js +61 -61
- package/dist/src/models/group-system-role.entity.d.ts +11 -11
- package/dist/src/models/group-system-role.entity.js +61 -61
- package/dist/src/models/login-history.entity.d.ts +12 -12
- package/dist/src/models/login-history.entity.js +69 -69
- package/dist/src/models/oauth-token.entity.d.ts +14 -14
- package/dist/src/models/oauth-token.entity.js +85 -85
- package/dist/src/models/role.entity.d.ts +17 -17
- package/dist/src/models/role.entity.js +101 -101
- package/dist/src/models/staff-type.entity.d.ts +7 -7
- package/dist/src/models/staff-type.entity.js +49 -49
- package/dist/src/models/staff.entity.d.ts +39 -39
- package/dist/src/models/staff.entity.js +249 -249
- package/dist/src/models/state.entity.d.ts +10 -10
- package/dist/src/models/state.entity.js +63 -63
- package/dist/src/models/system-accesss.entity.d.ts +6 -6
- package/dist/src/models/system-accesss.entity.js +50 -50
- package/dist/src/models/system-privilege.entity.d.ts +16 -16
- package/dist/src/models/system-privilege.entity.js +89 -89
- package/dist/src/models/system-role-privilege.entity.d.ts +11 -11
- package/dist/src/models/system-role-privilege.entity.js +59 -59
- package/dist/src/models/system-role.entity.d.ts +11 -11
- package/dist/src/models/system-role.entity.js +82 -82
- package/dist/src/models/system.entity.d.ts +19 -19
- package/dist/src/models/system.entity.js +145 -145
- package/dist/src/models/user-group.entity.d.ts +23 -23
- package/dist/src/models/user-group.entity.js +139 -139
- package/dist/src/models/user-role.entity.d.ts +12 -12
- package/dist/src/models/user-role.entity.js +72 -72
- package/dist/src/models/user-system-privileges.entity.d.ts +13 -13
- package/dist/src/models/user-system-privileges.entity.js +88 -88
- package/dist/src/models/user-system-role.entity.d.ts +11 -11
- package/dist/src/models/user-system-role.entity.js +59 -59
- package/dist/src/models/user-user-group.entity.d.ts +14 -14
- package/dist/src/models/user-user-group.entity.js +72 -72
- package/dist/src/models/user.entity.d.ts +30 -30
- package/dist/src/models/user.entity.js +130 -130
- package/dist/src/prisma-client/__mocks__/prisma.d.ts +3 -0
- package/dist/src/prisma-client/__mocks__/prisma.js +14 -0
- package/dist/src/prisma-client/__mocks__/prisma.js.map +1 -0
- package/dist/src/prisma-client/client.d.ts +3 -0
- package/dist/src/prisma-client/client.js +6 -0
- package/dist/src/prisma-client/client.js.map +1 -0
- package/dist/src/prisma-client/index.d.ts +1 -0
- package/dist/src/prisma-client/index.js +18 -0
- package/dist/src/prisma-client/index.js.map +1 -0
- package/dist/src/redis-client/__mocks__/jest-initial-setup.d.ts +1 -1
- package/dist/src/redis-client/__mocks__/jest-initial-setup.js +4 -4
- package/dist/src/redis-client/__mocks__/redis-mock.d.ts +2 -2
- package/dist/src/redis-client/__mocks__/redis-mock.js +22 -22
- package/dist/src/redis-client/index.d.ts +1 -1
- package/dist/src/redis-client/index.js +17 -17
- package/dist/src/redis-client/redis.service.d.ts +7 -7
- package/dist/src/redis-client/redis.service.js +55 -55
- package/dist/src/session/index.d.ts +2 -2
- package/dist/src/session/index.js +18 -18
- package/dist/src/session/interfaces/index.d.ts +1 -1
- package/dist/src/session/interfaces/index.js +17 -17
- package/dist/src/session/interfaces/session-service.interface.d.ts +6 -6
- package/dist/src/session/interfaces/session-service.interface.js +2 -2
- package/dist/src/session/session.service.d.ts +10 -10
- package/dist/src/session/session.service.js +63 -63
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/jest.config.js +14 -14
- package/migrations/01-alter-system-privilege-table.js +13 -13
- package/migrations/02-alter-user-group-table.js +78 -78
- package/migrations/03-alter-user-system-privilege-table.js +38 -38
- package/migrations/04-create-user-user-group-table.js +55 -55
- package/migrations/05-create-login-history-table.js +49 -49
- package/package.json +77 -77
- package/sampledotenv +7 -7
- package/src/components/login-user/login-user.ts +4 -6
- package/tsconfig.build.json +5 -5
- package/tsconfig.json +23 -23
package/sampledotenv
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
DATABASE_URL=
|
2
|
-
SHADOW_DATABASE_URL=
|
3
|
-
REDIS_URL=
|
4
|
-
REDIS_PASSWORD=
|
5
|
-
SMTP_HOST=
|
6
|
-
SMTP_PORT=
|
7
|
-
EMAIL_SENDER=
|
1
|
+
DATABASE_URL=
|
2
|
+
SHADOW_DATABASE_URL=
|
3
|
+
REDIS_URL=
|
4
|
+
REDIS_PASSWORD=
|
5
|
+
SMTP_HOST=
|
6
|
+
SMTP_PORT=
|
7
|
+
EMAIL_SENDER=
|
8
8
|
EMAIL_PASSWORD=
|
@@ -1,7 +1,6 @@
|
|
1
|
-
import {
|
1
|
+
import { IAddress, LoginUserBase } from '@tomei/general';
|
2
2
|
import { ISessionService } from '../../session/interfaces/session-service.interface';
|
3
3
|
import { IUserInfo } from './interfaces/user-info.interface';
|
4
|
-
// import { IPasswordHashService } from '../password-hash/interfaces/password-hash-service.interface';
|
5
4
|
import { UserRepository } from './user.repository';
|
6
5
|
import { SystemRepository } from '../system/system.repository';
|
7
6
|
import { SystemAccessRepository } from '../system-access/system-access.repository';
|
@@ -10,7 +9,6 @@ import { UserUserGroupRepository } from '../user-user-group/user-user-group.repo
|
|
10
9
|
import { PasswordHashService } from '../password-hash/password-hash.service';
|
11
10
|
import { SessionService } from '../../session/session.service';
|
12
11
|
import { UserGroupRepository } from '../user-group/user-group.repository';
|
13
|
-
import * as nodemailer from 'nodemailer';
|
14
12
|
import { SMTPMailer } from '@tomei/mailer';
|
15
13
|
import { ISystemLogin } from '../../../src/interfaces/system-login.interface';
|
16
14
|
import Staff from '../../models/staff.entity';
|
@@ -20,7 +18,7 @@ import GroupSystemPrivilege from '../../models/group-system-privilege.entity';
|
|
20
18
|
import GroupRolePrivilege from '../../models/group-role-privilege.entity';
|
21
19
|
import UserGroup from '../../models/user-group.entity';
|
22
20
|
|
23
|
-
export class LoginUser extends
|
21
|
+
export class LoginUser extends LoginUserBase {
|
24
22
|
FullName: string;
|
25
23
|
IDNo: string;
|
26
24
|
IDType: string;
|
@@ -44,13 +42,13 @@ export class LoginUser extends ObjectBase implements IPerson {
|
|
44
42
|
private static _UserGroupRepository = new UserGroupRepository();
|
45
43
|
private _dbTransaction: any;
|
46
44
|
|
47
|
-
getDetails(): {
|
45
|
+
async getDetails(): Promise<{
|
48
46
|
FullName: string;
|
49
47
|
IDNo: string;
|
50
48
|
IDType: string;
|
51
49
|
Email: string;
|
52
50
|
ContactNo: string;
|
53
|
-
} {
|
51
|
+
}> {
|
54
52
|
return {
|
55
53
|
FullName: this.FullName,
|
56
54
|
IDNo: this.IDNo,
|
package/tsconfig.build.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
{
|
2
|
-
"extends": "./tsconfig.json",
|
3
|
-
"include": ["**/*.ts"],
|
4
|
-
"exclude": ["node_modules", "__test__", "dist", "**/*spec.ts"]
|
5
|
-
}
|
1
|
+
{
|
2
|
+
"extends": "./tsconfig.json",
|
3
|
+
"include": ["**/*.ts"],
|
4
|
+
"exclude": ["node_modules", "__test__", "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
|
+
}
|