From 0c83d8c404375949902944551fc473fa0b53a706 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Mon, 3 Apr 2023 18:16:11 +0300 Subject: [PATCH] 1.2.3 - Added user group and role types after enriching the "user-info" result --- README.md | 3 ++- package-lock.json | 4 ++-- package.json | 2 +- src/types.ts | 18 ++++++++++++++++-- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 17aad25..f6a21bb 100644 --- a/README.md +++ b/README.md @@ -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.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.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 diff --git a/package-lock.json b/package-lock.json index bf43aaa..ab90c20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@flare/tuitio-client", - "version": "1.2.2", + "version": "1.2.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@flare/tuitio-client", - "version": "1.2.2", + "version": "1.2.3", "license": "MIT", "dependencies": { "@flare/js-utils": "^1.1.0", diff --git a/package.json b/package.json index 2e50696..065a473 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "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.", "main": "./lib/index.js", "types": "./lib/index.d.ts", diff --git a/src/types.ts b/src/types.ts index 3630ceb..2fcea16 100644 --- a/src/types.ts +++ b/src/types.ts @@ -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 TuitioState = { token: string | null; validUntil: Date | null; userName: string | null }; -export type TuitioUserContactOption = { +export type UserContactOption = { id: number; contactTypeCode: string; contactTypeName: string; contactValue: string; }; +export type UserGroup = { + id: number; + code: string; + name: string; +}; + +export type UserRole = { + id: number; + code: string; + name: string; +}; + export type TuitioUserInfo = { userId: number; userName: string; @@ -21,7 +33,9 @@ export type TuitioUserInfo = { failedLoginAttempts?: number; lastLoginDate?: Date; claim?: object; - contactOptions?: [TuitioUserContactOption]; + userRoles: [UserRole]; + userGroups: [UserGroup]; + contactOptions?: [UserContactOption]; }; export type TuitioTokenData = {