1.2.3 - Added user group and role types after enriching the "user-info" result

master
Tudor Stanciu 2023-04-03 18:16:11 +03:00
parent ddb2b4449e
commit 0c83d8c404
4 changed files with 21 additions and 6 deletions

View File

@ -41,4 +41,5 @@ All tests in the package can be executed by running: `npm test`.
1.1.0 - In this version, the account logout method and the latest changes published by Tuitio were implemented. 1.1.0 - In this version, the account logout method and the latest changes published by Tuitio were implemented.
1.2.0 - Has been implemented the "user-info" method exposed by the Tuitio API. 1.2.0 - Has been implemented the "user-info" method exposed by the Tuitio API.
1.2.1 - Added decodeToken function. The token is obtained directly by the function from local storage. If the token is missing, the function returns null. 1.2.1 - Added decodeToken function. The token is obtained directly by the function from local storage. If the token is missing, the function returns null.
1.2.2 - Upgraded @flare/js-utils package. 1.2.2 - Upgraded @flare/js-utils package.
1.2.3 - Added user group and role types after enriching the "user-info" result

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@flare/tuitio-client", "name": "@flare/tuitio-client",
"version": "1.2.2", "version": "1.2.3",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@flare/tuitio-client", "name": "@flare/tuitio-client",
"version": "1.2.2", "version": "1.2.3",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@flare/js-utils": "^1.1.0", "@flare/js-utils": "^1.1.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "@flare/tuitio-client", "name": "@flare/tuitio-client",
"version": "1.2.2", "version": "1.2.3",
"description": "Tuitio client is an npm package written in typescript that facilitates the integration of a javascript application with Tuitio.", "description": "Tuitio client is an npm package written in typescript that facilitates the integration of a javascript application with Tuitio.",
"main": "./lib/index.js", "main": "./lib/index.js",
"types": "./lib/index.d.ts", "types": "./lib/index.d.ts",

View File

@ -2,13 +2,25 @@ export type TuitioLoginResponse = { result: { token: string; expiresIn: number;
export type TuitioLogoutResponse = { result: { userId: number; userName: string; logoutDate: Date } | null; error: string }; export type TuitioLogoutResponse = { result: { userId: number; userName: string; logoutDate: Date } | null; error: string };
export type TuitioState = { token: string | null; validUntil: Date | null; userName: string | null }; export type TuitioState = { token: string | null; validUntil: Date | null; userName: string | null };
export type TuitioUserContactOption = { export type UserContactOption = {
id: number; id: number;
contactTypeCode: string; contactTypeCode: string;
contactTypeName: string; contactTypeName: string;
contactValue: string; contactValue: string;
}; };
export type UserGroup = {
id: number;
code: string;
name: string;
};
export type UserRole = {
id: number;
code: string;
name: string;
};
export type TuitioUserInfo = { export type TuitioUserInfo = {
userId: number; userId: number;
userName: string; userName: string;
@ -21,7 +33,9 @@ export type TuitioUserInfo = {
failedLoginAttempts?: number; failedLoginAttempts?: number;
lastLoginDate?: Date; lastLoginDate?: Date;
claim?: object; claim?: object;
contactOptions?: [TuitioUserContactOption]; userRoles: [UserRole];
userGroups: [UserGroup];
contactOptions?: [UserContactOption];
}; };
export type TuitioTokenData = { export type TuitioTokenData = {