gemcap-be-common 1.4.9 → 1.4.10
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.
|
@@ -22,10 +22,13 @@ export interface IUser extends IUserBasic, IUserAccess {
|
|
|
22
22
|
isEnabled?: boolean;
|
|
23
23
|
lastLogin?: Date | null;
|
|
24
24
|
}
|
|
25
|
-
export interface
|
|
25
|
+
export interface IUserRole {
|
|
26
26
|
id: string;
|
|
27
27
|
name: string;
|
|
28
28
|
representation: string;
|
|
29
29
|
createdAt?: Date;
|
|
30
30
|
updatedAt?: Date;
|
|
31
31
|
}
|
|
32
|
+
export interface IGroupedUserRoles {
|
|
33
|
+
[module: string]: IUserRole[];
|
|
34
|
+
}
|
|
@@ -25,7 +25,7 @@ export interface IUser extends IUserBasic, IUserAccess {
|
|
|
25
25
|
lastLogin?: Date | null;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
export interface
|
|
28
|
+
export interface IUserRole {
|
|
29
29
|
id: string;
|
|
30
30
|
name: string;
|
|
31
31
|
representation: string;
|
|
@@ -33,3 +33,6 @@ export interface IRole {
|
|
|
33
33
|
updatedAt?: Date;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
export interface IGroupedUserRoles {
|
|
37
|
+
[module: string]: IUserRole[];
|
|
38
|
+
}
|
package/package.json
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
import express from 'express';
|
|
27
|
-
import {
|
|
27
|
+
import { IUserRole, IUser, IUserAccess } from '../interfaces/auth-user.interface';
|
|
28
28
|
interface IKeycloakConfig {
|
|
29
29
|
keycloakHost: string;
|
|
30
30
|
realm: string;
|
|
@@ -41,7 +41,7 @@ export declare class UsersService {
|
|
|
41
41
|
getUserByToken(req: express.Request): Promise<IUser>;
|
|
42
42
|
getUserIdByToken(req: express.Request): Promise<string>;
|
|
43
43
|
getUserList(): Promise<IUser[]>;
|
|
44
|
-
getAllRoles(): Promise<
|
|
44
|
+
getAllRoles(): Promise<IUserRole[]>;
|
|
45
45
|
getUserRoles(userId: string): Promise<string[]>;
|
|
46
46
|
updateMobileUser(userId: string, keyValue: {
|
|
47
47
|
[key: string]: string | number | boolean;
|
|
@@ -5,7 +5,7 @@ import axios from 'axios';
|
|
|
5
5
|
import { BorrowerCompliance } from '../models/BorrowerCompliance.model';
|
|
6
6
|
import { UserMobileAccess } from '../models/UserMobileAccess.model';
|
|
7
7
|
import { UserLog } from '../models/UserLog.model';
|
|
8
|
-
import {
|
|
8
|
+
import { IUserRole, IUser, IUserAccess } from '../interfaces/auth-user.interface';
|
|
9
9
|
|
|
10
10
|
interface IKeycloakConfig {
|
|
11
11
|
keycloakHost: string;
|
|
@@ -68,7 +68,7 @@ export class UsersService {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
async getAllRoles() {
|
|
71
|
-
const { data } = await axios.get<
|
|
71
|
+
const { data } = await axios.get<IUserRole[]>(`${this.config.baseUrl}/users/roles`);
|
|
72
72
|
return data ?? null;
|
|
73
73
|
}
|
|
74
74
|
|