🚚 Move new-frontend to frontend (#652)
This commit is contained in:
138
frontend/src/client/services/ItemsService.ts
Normal file
138
frontend/src/client/services/ItemsService.ts
Normal file
@@ -0,0 +1,138 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { ItemCreate } from '../models/ItemCreate';
|
||||
import type { ItemOut } from '../models/ItemOut';
|
||||
import type { ItemsOut } from '../models/ItemsOut';
|
||||
import type { ItemUpdate } from '../models/ItemUpdate';
|
||||
import type { Message } from '../models/Message';
|
||||
|
||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||
import { OpenAPI } from '../core/OpenAPI';
|
||||
import { request as __request } from '../core/request';
|
||||
|
||||
export class ItemsService {
|
||||
|
||||
/**
|
||||
* Read Items
|
||||
* Retrieve items.
|
||||
* @returns ItemsOut Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static readItems({
|
||||
skip,
|
||||
limit = 100,
|
||||
}: {
|
||||
skip?: number,
|
||||
limit?: number,
|
||||
}): CancelablePromise<ItemsOut> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/api/v1/items/',
|
||||
query: {
|
||||
'skip': skip,
|
||||
'limit': limit,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Item
|
||||
* Create new item.
|
||||
* @returns ItemOut Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static createItem({
|
||||
requestBody,
|
||||
}: {
|
||||
requestBody: ItemCreate,
|
||||
}): CancelablePromise<ItemOut> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/api/v1/items/',
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Read Item
|
||||
* Get item by ID.
|
||||
* @returns ItemOut Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static readItem({
|
||||
id,
|
||||
}: {
|
||||
id: number,
|
||||
}): CancelablePromise<ItemOut> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/api/v1/items/{id}',
|
||||
path: {
|
||||
'id': id,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Item
|
||||
* Update an item.
|
||||
* @returns ItemOut Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static updateItem({
|
||||
id,
|
||||
requestBody,
|
||||
}: {
|
||||
id: number,
|
||||
requestBody: ItemUpdate,
|
||||
}): CancelablePromise<ItemOut> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'PUT',
|
||||
url: '/api/v1/items/{id}',
|
||||
path: {
|
||||
'id': id,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Item
|
||||
* Delete an item.
|
||||
* @returns Message Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static deleteItem({
|
||||
id,
|
||||
}: {
|
||||
id: number,
|
||||
}): CancelablePromise<Message> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'DELETE',
|
||||
url: '/api/v1/items/{id}',
|
||||
path: {
|
||||
'id': id,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
97
frontend/src/client/services/LoginService.ts
Normal file
97
frontend/src/client/services/LoginService.ts
Normal file
@@ -0,0 +1,97 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { Body_login_login_access_token } from '../models/Body_login_login_access_token';
|
||||
import type { Message } from '../models/Message';
|
||||
import type { NewPassword } from '../models/NewPassword';
|
||||
import type { Token } from '../models/Token';
|
||||
import type { UserOut } from '../models/UserOut';
|
||||
|
||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||
import { OpenAPI } from '../core/OpenAPI';
|
||||
import { request as __request } from '../core/request';
|
||||
|
||||
export class LoginService {
|
||||
|
||||
/**
|
||||
* Login Access Token
|
||||
* OAuth2 compatible token login, get an access token for future requests
|
||||
* @returns Token Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static loginAccessToken({
|
||||
formData,
|
||||
}: {
|
||||
formData: Body_login_login_access_token,
|
||||
}): CancelablePromise<Token> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/api/v1/login/access-token',
|
||||
formData: formData,
|
||||
mediaType: 'application/x-www-form-urlencoded',
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Test Token
|
||||
* Test access token
|
||||
* @returns UserOut Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static testToken(): CancelablePromise<UserOut> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/api/v1/login/test-token',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Recover Password
|
||||
* Password Recovery
|
||||
* @returns Message Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static recoverPassword({
|
||||
email,
|
||||
}: {
|
||||
email: string,
|
||||
}): CancelablePromise<Message> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/api/v1/password-recovery/{email}',
|
||||
path: {
|
||||
'email': email,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset Password
|
||||
* Reset password
|
||||
* @returns Message Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static resetPassword({
|
||||
requestBody,
|
||||
}: {
|
||||
requestBody: NewPassword,
|
||||
}): CancelablePromise<Message> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/api/v1/reset-password/',
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
220
frontend/src/client/services/UsersService.ts
Normal file
220
frontend/src/client/services/UsersService.ts
Normal file
@@ -0,0 +1,220 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { Message } from '../models/Message';
|
||||
import type { UpdatePassword } from '../models/UpdatePassword';
|
||||
import type { UserCreate } from '../models/UserCreate';
|
||||
import type { UserCreateOpen } from '../models/UserCreateOpen';
|
||||
import type { UserOut } from '../models/UserOut';
|
||||
import type { UsersOut } from '../models/UsersOut';
|
||||
import type { UserUpdate } from '../models/UserUpdate';
|
||||
import type { UserUpdateMe } from '../models/UserUpdateMe';
|
||||
|
||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||
import { OpenAPI } from '../core/OpenAPI';
|
||||
import { request as __request } from '../core/request';
|
||||
|
||||
export class UsersService {
|
||||
|
||||
/**
|
||||
* Read Users
|
||||
* Retrieve users.
|
||||
* @returns UsersOut Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static readUsers({
|
||||
skip,
|
||||
limit = 100,
|
||||
}: {
|
||||
skip?: number,
|
||||
limit?: number,
|
||||
}): CancelablePromise<UsersOut> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/api/v1/users/',
|
||||
query: {
|
||||
'skip': skip,
|
||||
'limit': limit,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create User
|
||||
* Create new user.
|
||||
* @returns UserOut Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static createUser({
|
||||
requestBody,
|
||||
}: {
|
||||
requestBody: UserCreate,
|
||||
}): CancelablePromise<UserOut> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/api/v1/users/',
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Read User Me
|
||||
* Get current user.
|
||||
* @returns UserOut Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static readUserMe(): CancelablePromise<UserOut> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/api/v1/users/me',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Update User Me
|
||||
* Update own user.
|
||||
* @returns UserOut Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static updateUserMe({
|
||||
requestBody,
|
||||
}: {
|
||||
requestBody: UserUpdateMe,
|
||||
}): CancelablePromise<UserOut> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'PATCH',
|
||||
url: '/api/v1/users/me',
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Password Me
|
||||
* Update own password.
|
||||
* @returns Message Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static updatePasswordMe({
|
||||
requestBody,
|
||||
}: {
|
||||
requestBody: UpdatePassword,
|
||||
}): CancelablePromise<Message> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'PATCH',
|
||||
url: '/api/v1/users/me/password',
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create User Open
|
||||
* Create new user without the need to be logged in.
|
||||
* @returns UserOut Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static createUserOpen({
|
||||
requestBody,
|
||||
}: {
|
||||
requestBody: UserCreateOpen,
|
||||
}): CancelablePromise<UserOut> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/api/v1/users/open',
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Read User By Id
|
||||
* Get a specific user by id.
|
||||
* @returns UserOut Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static readUserById({
|
||||
userId,
|
||||
}: {
|
||||
userId: number,
|
||||
}): CancelablePromise<UserOut> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/api/v1/users/{user_id}',
|
||||
path: {
|
||||
'user_id': userId,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 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: 'PATCH',
|
||||
url: '/api/v1/users/{user_id}',
|
||||
path: {
|
||||
'user_id': userId,
|
||||
},
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete User
|
||||
* Delete a user.
|
||||
* @returns Message Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static deleteUser({
|
||||
userId,
|
||||
}: {
|
||||
userId: number,
|
||||
}): CancelablePromise<Message> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'DELETE',
|
||||
url: '/api/v1/users/{user_id}',
|
||||
path: {
|
||||
'user_id': userId,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
58
frontend/src/client/services/UtilsService.ts
Normal file
58
frontend/src/client/services/UtilsService.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
/* generated using openapi-typescript-codegen -- do no edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { Message } from '../models/Message';
|
||||
|
||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||
import { OpenAPI } from '../core/OpenAPI';
|
||||
import { request as __request } from '../core/request';
|
||||
|
||||
export class UtilsService {
|
||||
|
||||
/**
|
||||
* Test Celery
|
||||
* Test Celery worker.
|
||||
* @returns Message Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static testCelery({
|
||||
requestBody,
|
||||
}: {
|
||||
requestBody: Message,
|
||||
}): CancelablePromise<Message> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/api/v1/utils/test-celery/',
|
||||
body: requestBody,
|
||||
mediaType: 'application/json',
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Test Email
|
||||
* Test emails.
|
||||
* @returns Message Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static testEmail({
|
||||
emailTo,
|
||||
}: {
|
||||
emailTo: string,
|
||||
}): CancelablePromise<Message> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/api/v1/utils/test-email/',
|
||||
query: {
|
||||
'email_to': emailTo,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user