Skip to content

Commit

Permalink
Added endpoint call to obtain user data from drive-server-wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramon Candel authored and Ramon Candel committed Jun 13, 2024
1 parent 2788f60 commit 731c8bb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
17 changes: 13 additions & 4 deletions src/drive/users/index.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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';

Expand Down Expand Up @@ -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',
{
Expand Down

0 comments on commit 731c8bb

Please sign in to comment.