diff --git a/package.json b/package.json index 830e34bf..2ea50d73 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@internxt/sdk", - "version": "1.4.83", + "version": "1.4.84", "description": "An sdk for interacting with Internxt's services", "repository": { "type": "git", diff --git a/src/drive/users/index.ts b/src/drive/users/index.ts index a5da7529..779f0a51 100644 --- a/src/drive/users/index.ts +++ b/src/drive/users/index.ts @@ -1,5 +1,7 @@ import { ApiSecurity, ApiUrl, AppDetails } from '../../shared'; import { headersWithToken } from '../../shared/headers'; +import { HttpClient } from '../../shared/http/client'; +import { UserSettings } from '../../shared/types/userSettings'; import { ChangePasswordPayload, CheckChangeEmailExpirationResponse, @@ -10,8 +12,6 @@ import { UserPublicKeyResponse, VerifyEmailChangeResponse, } from './types'; -import { UserSettings } from '../../shared/types/userSettings'; -import { HttpClient } from '../../shared/http/client'; export * as UserTypes from './types'; @@ -76,13 +76,22 @@ export class Users { return this.client.get('/user/refresh', this.headers()); } + /** + * Returns user data + */ + public getUserData({ userUuid }: { userUuid: string }): Promise<{ + user: UserSettings; + }> { + return this.client.get(`/users/c/${userUuid}`, this.headers()); + } + /** * Updates the authentication credentials and invalidates previous tokens * @param payload - * + * * @returns {Promise<{token: string, newToken: string}>} A promise that returns new tokens for this user. */ - public changePassword(payload: ChangePasswordPayload): Promise<{token: string, newToken: string}> { + public changePassword(payload: ChangePasswordPayload): Promise<{ token: string; newToken: string }> { return this.client.patch( '/user/password', {