Skip to content

Commit

Permalink
✨ Regenerate frontend client with recent changes (#575)
Browse files Browse the repository at this point in the history
  • Loading branch information
alejsdev authored Dec 27, 2023
1 parent 5a4b0ed commit 7966d3f
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 25 deletions.
7 changes: 4 additions & 3 deletions src/new-frontend/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ export { OpenAPI } from './core/OpenAPI';
export type { OpenAPIConfig } from './core/OpenAPI';

export type { Body_login_login_access_token } from './models/Body_login_login_access_token';
export type { Body_login_reset_password } from './models/Body_login_reset_password';
export type { HTTPValidationError } from './models/HTTPValidationError';
export type { ItemCreate } from './models/ItemCreate';
export type { ItemOut } from './models/ItemOut';
export type { ItemUpdate } from './models/ItemUpdate';
export type { Msg } from './models/Msg';
export type { Message } from './models/Message';
export type { NewPassword } from './models/NewPassword';
export type { Token } from './models/Token';
export type { User } from './models/User';
export type { UserCreate } from './models/UserCreate';
export type { UserCreateOpen } from './models/UserCreateOpen';
export type { UserOut } from './models/UserOut';
export type { UserUpdate } from './models/UserUpdate';
export type { UserUpdateMe } from './models/UserUpdateMe';
export type { ValidationError } from './models/ValidationError';

export { ItemsService } from './services/ItemsService';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
/* tslint:disable */
/* eslint-disable */

export type Msg = {
msg: string;
export type Message = {
message: string;
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* tslint:disable */
/* eslint-disable */

export type Body_login_reset_password = {
export type NewPassword = {
token: string;
new_password: string;
};
2 changes: 1 addition & 1 deletion src/new-frontend/src/client/models/Token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

export type Token = {
access_token: string;
token_type: string;
token_type?: string;
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
/* tslint:disable */
/* eslint-disable */

export type User = {
export type UserUpdate = {
email?: string;
is_active?: boolean;
is_superuser?: boolean;
full_name?: string;
id?: number;
password?: string;
};
10 changes: 10 additions & 0 deletions src/new-frontend/src/client/models/UserUpdateMe.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type UserUpdateMe = {
password?: string;
full_name?: string;
email?: string;
};
20 changes: 10 additions & 10 deletions src/new-frontend/src/client/services/LoginService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
/* tslint:disable */
/* eslint-disable */
import type { Body_login_login_access_token } from '../models/Body_login_login_access_token';
import type { Body_login_reset_password } from '../models/Body_login_reset_password';
import type { Msg } from '../models/Msg';
import type { Message } from '../models/Message';
import type { NewPassword } from '../models/NewPassword';
import type { Token } from '../models/Token';
import type { User } from '../models/User';
import type { UserOut } from '../models/UserOut';

import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
Expand Down Expand Up @@ -39,10 +39,10 @@ formData: Body_login_login_access_token,
/**
* Test Token
* Test access token
* @returns User Successful Response
* @returns UserOut Successful Response
* @throws ApiError
*/
public static testToken(): CancelablePromise<User> {
public static testToken(): CancelablePromise<UserOut> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/login/test-token',
Expand All @@ -52,14 +52,14 @@ formData: Body_login_login_access_token,
/**
* Recover Password
* Password Recovery
* @returns Msg Successful Response
* @returns Message Successful Response
* @throws ApiError
*/
public static recoverPassword({
email,
}: {
email: string,
}): CancelablePromise<Msg> {
}): CancelablePromise<Message> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/password-recovery/{email}',
Expand All @@ -75,14 +75,14 @@ email: string,
/**
* Reset Password
* Reset password
* @returns Msg Successful Response
* @returns Message Successful Response
* @throws ApiError
*/
public static resetPassword({
requestBody,
}: {
requestBody: Body_login_reset_password,
}): CancelablePromise<Msg> {
requestBody: NewPassword,
}): CancelablePromise<Message> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/reset-password/',
Expand Down
51 changes: 51 additions & 0 deletions src/new-frontend/src/client/services/UsersService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import type { UserCreate } from '../models/UserCreate';
import type { UserCreateOpen } from '../models/UserCreateOpen';
import type { UserOut } from '../models/UserOut';
import type { UserUpdate } from '../models/UserUpdate';
import type { UserUpdateMe } from '../models/UserUpdateMe';

import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
Expand Down Expand Up @@ -73,6 +75,28 @@ requestBody: UserCreate,
});
}

/**
* Update User Me
* Update own user.
* @returns UserOut Successful Response
* @throws ApiError
*/
public static updateUserMe({
requestBody,
}: {
requestBody: UserUpdateMe,
}): CancelablePromise<UserOut> {
return __request(OpenAPI, {
method: 'PUT',
url: '/api/v1/users/me',
body: requestBody,
mediaType: 'application/json',
errors: {
422: `Validation Error`,
},
});
}

/**
* Create User Open
* Create new user without the need to be logged in.
Expand Down Expand Up @@ -118,4 +142,31 @@ userId: number,
});
}

/**
* Update User
* Update a user.
* @returns UserOut Successful Response
* @throws ApiError
*/
public static updateUser({
userId,
requestBody,
}: {
userId: number,
requestBody: UserUpdate,
}): CancelablePromise<UserOut> {
return __request(OpenAPI, {
method: 'PUT',
url: '/api/v1/users/{user_id}',
path: {
'user_id': userId,
},
body: requestBody,
mediaType: 'application/json',
errors: {
422: `Validation Error`,
},
});
}

}
12 changes: 6 additions & 6 deletions src/new-frontend/src/client/services/UtilsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { Msg } from '../models/Msg';
import type { Message } from '../models/Message';

import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
Expand All @@ -13,14 +13,14 @@ export class UtilsService {
/**
* Test Celery
* Test Celery worker.
* @returns Msg Successful Response
* @returns Message Successful Response
* @throws ApiError
*/
public static testCelery({
requestBody,
}: {
requestBody: Msg,
}): CancelablePromise<Msg> {
requestBody: Message,
}): CancelablePromise<Message> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/utils/test-celery/',
Expand All @@ -35,14 +35,14 @@ requestBody: Msg,
/**
* Test Email
* Test emails.
* @returns Msg Successful Response
* @returns Message Successful Response
* @throws ApiError
*/
public static testEmail({
emailTo,
}: {
emailTo: string,
}): CancelablePromise<Msg> {
}): CancelablePromise<Message> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/utils/test-email/',
Expand Down

0 comments on commit 7966d3f

Please sign in to comment.