// This file is auto-generated by @hey-api/openapi-ts import { type Client, type Options as Options2, type TDataShape, urlSearchParamsBodySerializer } from './client'; import { client } from './client.gen'; import type { itemsCreateItemData, itemsCreateItemErrors, itemsCreateItemResponses, itemsDeleteItemData, itemsDeleteItemErrors, itemsDeleteItemResponses, itemsReadItemData, itemsReadItemErrors, itemsReadItemResponses, itemsReadItemsData, itemsReadItemsErrors, itemsReadItemsResponses, itemsUpdateItemData, itemsUpdateItemErrors, itemsUpdateItemResponses, loginLoginAccessTokenData, loginLoginAccessTokenErrors, loginLoginAccessTokenResponses, loginRecoverPasswordData, loginRecoverPasswordErrors, loginRecoverPasswordHtmlContentData, loginRecoverPasswordHtmlContentErrors, loginRecoverPasswordHtmlContentResponses, loginRecoverPasswordResponses, loginResetPasswordData, loginResetPasswordErrors, loginResetPasswordResponses, loginTestTokenData, loginTestTokenResponses, privateCreateUserData, privateCreateUserErrors, privateCreateUserResponses, usersCreateUserData, usersCreateUserErrors, usersCreateUserResponses, usersDeleteUserData, usersDeleteUserErrors, usersDeleteUserMeData, usersDeleteUserMeResponses, usersDeleteUserResponses, usersReadUserByIdData, usersReadUserByIdErrors, usersReadUserByIdResponses, usersReadUserMeData, usersReadUserMeResponses, usersReadUsersData, usersReadUsersErrors, usersReadUsersResponses, usersRegisterUserData, usersRegisterUserErrors, usersRegisterUserResponses, usersUpdatePasswordMeData, usersUpdatePasswordMeErrors, usersUpdatePasswordMeResponses, usersUpdateUserData, usersUpdateUserErrors, usersUpdateUserMeData, usersUpdateUserMeErrors, usersUpdateUserMeResponses, usersUpdateUserResponses, utilsHealthCheckData, utilsHealthCheckResponses, utilsTestEmailData, utilsTestEmailErrors, utilsTestEmailResponses } from './types.gen'; export type Options = Options2 & { /** * You can provide a client instance returned by `createClient()` instead of * individual options. This might be also useful if you want to implement a * custom client. */ client?: Client; /** * You can pass arbitrary values through the `meta` object. This can be * used to access values that aren't defined as part of the SDK function. */ meta?: Record; }; export class LoginService { /** * Login Access Token * * OAuth2 compatible token login, get an access token for future requests */ public static loginAccessToken(options: Options) { return (options.client ?? client).post({ ...urlSearchParamsBodySerializer, responseType: 'json', url: '/api/v1/login/access-token', ...options, headers: { 'Content-Type': 'application/x-www-form-urlencoded', ...options.headers } }); } /** * Test Token * * Test access token */ public static testToken(options?: Options) { return (options?.client ?? client).post({ responseType: 'json', security: [{ scheme: 'bearer', type: 'http' }], url: '/api/v1/login/test-token', ...options }); } /** * Recover Password * * Password Recovery */ public static recoverPassword(options: Options) { return (options.client ?? client).post({ responseType: 'json', url: '/api/v1/password-recovery/{email}', ...options }); } /** * Reset Password * * Reset password */ public static resetPassword(options: Options) { return (options.client ?? client).post({ responseType: 'json', url: '/api/v1/reset-password/', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); } /** * Recover Password Html Content * * HTML Content for Password Recovery */ public static recoverPasswordHtmlContent(options: Options) { return (options.client ?? client).post({ responseType: 'text', security: [{ scheme: 'bearer', type: 'http' }], url: '/api/v1/password-recovery-html-content/{email}', ...options }); } } export class UsersService { /** * Read Users * * Retrieve users. */ public static readUsers(options?: Options) { return (options?.client ?? client).get({ responseType: 'json', security: [{ scheme: 'bearer', type: 'http' }], url: '/api/v1/users/', ...options }); } /** * Create User * * Create new user. */ public static createUser(options: Options) { return (options.client ?? client).post({ responseType: 'json', security: [{ scheme: 'bearer', type: 'http' }], url: '/api/v1/users/', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); } /** * Delete User Me * * Delete own user. */ public static deleteUserMe(options?: Options) { return (options?.client ?? client).delete({ responseType: 'json', security: [{ scheme: 'bearer', type: 'http' }], url: '/api/v1/users/me', ...options }); } /** * Read User Me * * Get current user. */ public static readUserMe(options?: Options) { return (options?.client ?? client).get({ responseType: 'json', security: [{ scheme: 'bearer', type: 'http' }], url: '/api/v1/users/me', ...options }); } /** * Update User Me * * Update own user. */ public static updateUserMe(options: Options) { return (options.client ?? client).patch({ responseType: 'json', security: [{ scheme: 'bearer', type: 'http' }], url: '/api/v1/users/me', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); } /** * Update Password Me * * Update own password. */ public static updatePasswordMe(options: Options) { return (options.client ?? client).patch({ responseType: 'json', security: [{ scheme: 'bearer', type: 'http' }], url: '/api/v1/users/me/password', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); } /** * Register User * * Create new user without the need to be logged in. */ public static registerUser(options: Options) { return (options.client ?? client).post({ responseType: 'json', url: '/api/v1/users/signup', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); } /** * Delete User * * Delete a user. */ public static deleteUser(options: Options) { return (options.client ?? client).delete({ responseType: 'json', security: [{ scheme: 'bearer', type: 'http' }], url: '/api/v1/users/{user_id}', ...options }); } /** * Read User By Id * * Get a specific user by id. */ public static readUserById(options: Options) { return (options.client ?? client).get({ responseType: 'json', security: [{ scheme: 'bearer', type: 'http' }], url: '/api/v1/users/{user_id}', ...options }); } /** * Update User * * Update a user. */ public static updateUser(options: Options) { return (options.client ?? client).patch({ responseType: 'json', security: [{ scheme: 'bearer', type: 'http' }], url: '/api/v1/users/{user_id}', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); } } export class UtilsService { /** * Test Email * * Test emails. */ public static testEmail(options: Options) { return (options.client ?? client).post({ responseType: 'json', security: [{ scheme: 'bearer', type: 'http' }], url: '/api/v1/utils/test-email/', ...options }); } /** * Health Check */ public static healthCheck(options?: Options) { return (options?.client ?? client).get({ responseType: 'json', url: '/api/v1/utils/health-check/', ...options }); } } export class ItemsService { /** * Read Items * * Retrieve items. */ public static readItems(options?: Options) { return (options?.client ?? client).get({ responseType: 'json', security: [{ scheme: 'bearer', type: 'http' }], url: '/api/v1/items/', ...options }); } /** * Create Item * * Create new item. */ public static createItem(options: Options) { return (options.client ?? client).post({ responseType: 'json', security: [{ scheme: 'bearer', type: 'http' }], url: '/api/v1/items/', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); } /** * Delete Item * * Delete an item. */ public static deleteItem(options: Options) { return (options.client ?? client).delete({ responseType: 'json', security: [{ scheme: 'bearer', type: 'http' }], url: '/api/v1/items/{id}', ...options }); } /** * Read Item * * Get item by ID. */ public static readItem(options: Options) { return (options.client ?? client).get({ responseType: 'json', security: [{ scheme: 'bearer', type: 'http' }], url: '/api/v1/items/{id}', ...options }); } /** * Update Item * * Update an item. */ public static updateItem(options: Options) { return (options.client ?? client).put({ responseType: 'json', security: [{ scheme: 'bearer', type: 'http' }], url: '/api/v1/items/{id}', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); } } export class PrivateService { /** * Create User * * Create a new user. */ public static createUser(options: Options) { return (options.client ?? client).post({ responseType: 'json', url: '/api/v1/private/users/', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }); } }