diff --git a/src/api/index.ts b/src/api/index.ts index 22e1808268ec1c7b349141ce999d2e4b668cb45c..952a64c78269b8003d0635a30820fdd15932e689 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -12,6 +12,7 @@ export type { ExceptionResponse } from './models/ExceptionResponse'; export type { LeaderboardDTO } from './models/LeaderboardDTO'; export type { LeaderboardEntryDTO } from './models/LeaderboardEntryDTO'; export type { LoginRequest } from './models/LoginRequest'; +export type { PasswordResetDTO } from './models/PasswordResetDTO'; export type { ProfileDTO } from './models/ProfileDTO'; export type { SignUpRequest } from './models/SignUpRequest'; export type { UserDTO } from './models/UserDTO'; @@ -19,4 +20,4 @@ export type { UserUpdateDTO } from './models/UserUpdateDTO'; export { AuthenticationService } from './services/AuthenticationService'; export { LeaderboardService } from './services/LeaderboardService'; -export { UserControllerService } from './services/UserControllerService'; +export { UserService } from './services/UserService'; diff --git a/src/api/services/UserControllerService.ts b/src/api/services/UserService.ts similarity index 53% rename from src/api/services/UserControllerService.ts rename to src/api/services/UserService.ts index 5a1ea3560cb016455a4d2c77c2e34e9b0754a684..d4bec02c95c05faf669d7d0663da47d34ff67771 100644 --- a/src/api/services/UserControllerService.ts +++ b/src/api/services/UserService.ts @@ -2,15 +2,55 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { PasswordResetDTO } from '../models/PasswordResetDTO'; import type { ProfileDTO } from '../models/ProfileDTO'; import type { UserDTO } from '../models/UserDTO'; import type { UserUpdateDTO } from '../models/UserUpdateDTO'; import type { CancelablePromise } from '../core/CancelablePromise'; import { OpenAPI } from '../core/OpenAPI'; import { request as __request } from '../core/request'; -export class UserControllerService { +export class UserService { /** - * Update profile + * Initiate a password reset + * Send a password reset mail to the user with the specified email + * @returns any Successfully initiated a password reset + * @throws ApiError + */ + public static resetPassword({ + requestBody, + }: { + requestBody: string, + }): CancelablePromise<any> { + return __request(OpenAPI, { + method: 'POST', + url: '/api/users/reset-password', + body: requestBody, + mediaType: 'text/plain', + }); + } + /** + * Confirm a password reset + * Confirms a password reset using a token and a new password + * @returns void + * @throws ApiError + */ + public static confirmPasswordReset({ + requestBody, + }: { + requestBody: PasswordResetDTO, + }): CancelablePromise<void> { + return __request(OpenAPI, { + method: 'POST', + url: '/api/users/confirm-password', + body: requestBody, + mediaType: 'application/json', + errors: { + 403: `Invalid token`, + }, + }); + } + /** + * Update a profile * Update the profile of the authenticated user * @returns UserDTO Successfully updated profile * @throws ApiError @@ -28,8 +68,8 @@ export class UserControllerService { }); } /** - * Get profile - * Get user profile + * Get a profile + * Get the profile of a user * @returns ProfileDTO Successfully got profile * @throws ApiError */ @@ -47,8 +87,8 @@ export class UserControllerService { }); } /** - * Get user - * Get user information + * Get the authenticated user + * Get all user information for the authenticated user * @returns UserDTO Successfully got user * @throws ApiError */