✨ Migrate to latest openapi-ts (#1430)
This commit is contained in:
523
frontend/src/client/sdk.gen.ts
Normal file
523
frontend/src/client/sdk.gen.ts
Normal file
@@ -0,0 +1,523 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { CancelablePromise } from "./core/CancelablePromise"
|
||||
import { OpenAPI } from "./core/OpenAPI"
|
||||
import { request as __request } from "./core/request"
|
||||
import type {
|
||||
ReadItemsData,
|
||||
ReadItemsResponse,
|
||||
CreateItemData,
|
||||
CreateItemResponse,
|
||||
ReadItemData,
|
||||
ReadItemResponse,
|
||||
UpdateItemData,
|
||||
UpdateItemResponse,
|
||||
DeleteItemData,
|
||||
DeleteItemResponse,
|
||||
LoginAccessTokenData,
|
||||
LoginAccessTokenResponse,
|
||||
TestTokenResponse,
|
||||
RecoverPasswordData,
|
||||
RecoverPasswordResponse,
|
||||
ResetPasswordData,
|
||||
ResetPasswordResponse,
|
||||
RecoverPasswordHtmlContentData,
|
||||
RecoverPasswordHtmlContentResponse,
|
||||
ReadUsersData,
|
||||
ReadUsersResponse,
|
||||
CreateUserData,
|
||||
CreateUserResponse,
|
||||
ReadUserMeResponse,
|
||||
DeleteUserMeResponse,
|
||||
UpdateUserMeData,
|
||||
UpdateUserMeResponse,
|
||||
UpdatePasswordMeData,
|
||||
UpdatePasswordMeResponse,
|
||||
RegisterUserData,
|
||||
RegisterUserResponse,
|
||||
ReadUserByIdData,
|
||||
ReadUserByIdResponse,
|
||||
UpdateUserData,
|
||||
UpdateUserResponse,
|
||||
DeleteUserData,
|
||||
DeleteUserResponse,
|
||||
TestEmailData,
|
||||
TestEmailResponse,
|
||||
HealthCheckResponse,
|
||||
} from "./types.gen"
|
||||
|
||||
export class ItemsService {
|
||||
/**
|
||||
* Read Items
|
||||
* Retrieve items.
|
||||
* @param data The data for the request.
|
||||
* @param data.skip
|
||||
* @param data.limit
|
||||
* @returns ItemsPublic Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static readItems(
|
||||
data: ReadItemsData = {},
|
||||
): CancelablePromise<ReadItemsResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "GET",
|
||||
url: "/api/v1/items/",
|
||||
query: {
|
||||
skip: data.skip,
|
||||
limit: data.limit,
|
||||
},
|
||||
errors: {
|
||||
422: "Validation Error",
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Item
|
||||
* Create new item.
|
||||
* @param data The data for the request.
|
||||
* @param data.requestBody
|
||||
* @returns ItemPublic Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static createItem(
|
||||
data: CreateItemData,
|
||||
): CancelablePromise<CreateItemResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "POST",
|
||||
url: "/api/v1/items/",
|
||||
body: data.requestBody,
|
||||
mediaType: "application/json",
|
||||
errors: {
|
||||
422: "Validation Error",
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Read Item
|
||||
* Get item by ID.
|
||||
* @param data The data for the request.
|
||||
* @param data.id
|
||||
* @returns ItemPublic Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static readItem(
|
||||
data: ReadItemData,
|
||||
): CancelablePromise<ReadItemResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "GET",
|
||||
url: "/api/v1/items/{id}",
|
||||
path: {
|
||||
id: data.id,
|
||||
},
|
||||
errors: {
|
||||
422: "Validation Error",
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Item
|
||||
* Update an item.
|
||||
* @param data The data for the request.
|
||||
* @param data.id
|
||||
* @param data.requestBody
|
||||
* @returns ItemPublic Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static updateItem(
|
||||
data: UpdateItemData,
|
||||
): CancelablePromise<UpdateItemResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "PUT",
|
||||
url: "/api/v1/items/{id}",
|
||||
path: {
|
||||
id: data.id,
|
||||
},
|
||||
body: data.requestBody,
|
||||
mediaType: "application/json",
|
||||
errors: {
|
||||
422: "Validation Error",
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Item
|
||||
* Delete an item.
|
||||
* @param data The data for the request.
|
||||
* @param data.id
|
||||
* @returns Message Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static deleteItem(
|
||||
data: DeleteItemData,
|
||||
): CancelablePromise<DeleteItemResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "DELETE",
|
||||
url: "/api/v1/items/{id}",
|
||||
path: {
|
||||
id: data.id,
|
||||
},
|
||||
errors: {
|
||||
422: "Validation Error",
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class LoginService {
|
||||
/**
|
||||
* Login Access Token
|
||||
* OAuth2 compatible token login, get an access token for future requests
|
||||
* @param data The data for the request.
|
||||
* @param data.formData
|
||||
* @returns Token Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static loginAccessToken(
|
||||
data: LoginAccessTokenData,
|
||||
): CancelablePromise<LoginAccessTokenResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "POST",
|
||||
url: "/api/v1/login/access-token",
|
||||
formData: data.formData,
|
||||
mediaType: "application/x-www-form-urlencoded",
|
||||
errors: {
|
||||
422: "Validation Error",
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Test Token
|
||||
* Test access token
|
||||
* @returns UserPublic Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static testToken(): CancelablePromise<TestTokenResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "POST",
|
||||
url: "/api/v1/login/test-token",
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Recover Password
|
||||
* Password Recovery
|
||||
* @param data The data for the request.
|
||||
* @param data.email
|
||||
* @returns Message Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static recoverPassword(
|
||||
data: RecoverPasswordData,
|
||||
): CancelablePromise<RecoverPasswordResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "POST",
|
||||
url: "/api/v1/password-recovery/{email}",
|
||||
path: {
|
||||
email: data.email,
|
||||
},
|
||||
errors: {
|
||||
422: "Validation Error",
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset Password
|
||||
* Reset password
|
||||
* @param data The data for the request.
|
||||
* @param data.requestBody
|
||||
* @returns Message Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static resetPassword(
|
||||
data: ResetPasswordData,
|
||||
): CancelablePromise<ResetPasswordResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "POST",
|
||||
url: "/api/v1/reset-password/",
|
||||
body: data.requestBody,
|
||||
mediaType: "application/json",
|
||||
errors: {
|
||||
422: "Validation Error",
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Recover Password Html Content
|
||||
* HTML Content for Password Recovery
|
||||
* @param data The data for the request.
|
||||
* @param data.email
|
||||
* @returns string Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static recoverPasswordHtmlContent(
|
||||
data: RecoverPasswordHtmlContentData,
|
||||
): CancelablePromise<RecoverPasswordHtmlContentResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "POST",
|
||||
url: "/api/v1/password-recovery-html-content/{email}",
|
||||
path: {
|
||||
email: data.email,
|
||||
},
|
||||
errors: {
|
||||
422: "Validation Error",
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class UsersService {
|
||||
/**
|
||||
* Read Users
|
||||
* Retrieve users.
|
||||
* @param data The data for the request.
|
||||
* @param data.skip
|
||||
* @param data.limit
|
||||
* @returns UsersPublic Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static readUsers(
|
||||
data: ReadUsersData = {},
|
||||
): CancelablePromise<ReadUsersResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "GET",
|
||||
url: "/api/v1/users/",
|
||||
query: {
|
||||
skip: data.skip,
|
||||
limit: data.limit,
|
||||
},
|
||||
errors: {
|
||||
422: "Validation Error",
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Create User
|
||||
* Create new user.
|
||||
* @param data The data for the request.
|
||||
* @param data.requestBody
|
||||
* @returns UserPublic Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static createUser(
|
||||
data: CreateUserData,
|
||||
): CancelablePromise<CreateUserResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "POST",
|
||||
url: "/api/v1/users/",
|
||||
body: data.requestBody,
|
||||
mediaType: "application/json",
|
||||
errors: {
|
||||
422: "Validation Error",
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Read User Me
|
||||
* Get current user.
|
||||
* @returns UserPublic Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static readUserMe(): CancelablePromise<ReadUserMeResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "GET",
|
||||
url: "/api/v1/users/me",
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete User Me
|
||||
* Delete own user.
|
||||
* @returns Message Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static deleteUserMe(): CancelablePromise<DeleteUserMeResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "DELETE",
|
||||
url: "/api/v1/users/me",
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update User Me
|
||||
* Update own user.
|
||||
* @param data The data for the request.
|
||||
* @param data.requestBody
|
||||
* @returns UserPublic Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static updateUserMe(
|
||||
data: UpdateUserMeData,
|
||||
): CancelablePromise<UpdateUserMeResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "PATCH",
|
||||
url: "/api/v1/users/me",
|
||||
body: data.requestBody,
|
||||
mediaType: "application/json",
|
||||
errors: {
|
||||
422: "Validation Error",
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Password Me
|
||||
* Update own password.
|
||||
* @param data The data for the request.
|
||||
* @param data.requestBody
|
||||
* @returns Message Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static updatePasswordMe(
|
||||
data: UpdatePasswordMeData,
|
||||
): CancelablePromise<UpdatePasswordMeResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "PATCH",
|
||||
url: "/api/v1/users/me/password",
|
||||
body: data.requestBody,
|
||||
mediaType: "application/json",
|
||||
errors: {
|
||||
422: "Validation Error",
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Register User
|
||||
* Create new user without the need to be logged in.
|
||||
* @param data The data for the request.
|
||||
* @param data.requestBody
|
||||
* @returns UserPublic Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static registerUser(
|
||||
data: RegisterUserData,
|
||||
): CancelablePromise<RegisterUserResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "POST",
|
||||
url: "/api/v1/users/signup",
|
||||
body: data.requestBody,
|
||||
mediaType: "application/json",
|
||||
errors: {
|
||||
422: "Validation Error",
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Read User By Id
|
||||
* Get a specific user by id.
|
||||
* @param data The data for the request.
|
||||
* @param data.userId
|
||||
* @returns UserPublic Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static readUserById(
|
||||
data: ReadUserByIdData,
|
||||
): CancelablePromise<ReadUserByIdResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "GET",
|
||||
url: "/api/v1/users/{user_id}",
|
||||
path: {
|
||||
user_id: data.userId,
|
||||
},
|
||||
errors: {
|
||||
422: "Validation Error",
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update User
|
||||
* Update a user.
|
||||
* @param data The data for the request.
|
||||
* @param data.userId
|
||||
* @param data.requestBody
|
||||
* @returns UserPublic Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static updateUser(
|
||||
data: UpdateUserData,
|
||||
): CancelablePromise<UpdateUserResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "PATCH",
|
||||
url: "/api/v1/users/{user_id}",
|
||||
path: {
|
||||
user_id: data.userId,
|
||||
},
|
||||
body: data.requestBody,
|
||||
mediaType: "application/json",
|
||||
errors: {
|
||||
422: "Validation Error",
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete User
|
||||
* Delete a user.
|
||||
* @param data The data for the request.
|
||||
* @param data.userId
|
||||
* @returns Message Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static deleteUser(
|
||||
data: DeleteUserData,
|
||||
): CancelablePromise<DeleteUserResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "DELETE",
|
||||
url: "/api/v1/users/{user_id}",
|
||||
path: {
|
||||
user_id: data.userId,
|
||||
},
|
||||
errors: {
|
||||
422: "Validation Error",
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class UtilsService {
|
||||
/**
|
||||
* Test Email
|
||||
* Test emails.
|
||||
* @param data The data for the request.
|
||||
* @param data.emailTo
|
||||
* @returns Message Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static testEmail(
|
||||
data: TestEmailData,
|
||||
): CancelablePromise<TestEmailResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "POST",
|
||||
url: "/api/v1/utils/test-email/",
|
||||
query: {
|
||||
email_to: data.emailTo,
|
||||
},
|
||||
errors: {
|
||||
422: "Validation Error",
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Health Check
|
||||
* @returns boolean Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static healthCheck(): CancelablePromise<HealthCheckResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: "GET",
|
||||
url: "/api/v1/utils/health-check/",
|
||||
})
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user