✨ Migrate to latest openapi-ts (#1430)
This commit is contained in:
15
frontend/openapi-ts.config.ts
Normal file
15
frontend/openapi-ts.config.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import { defineConfig } from "@hey-api/openapi-ts"
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
client: "legacy/axios",
|
||||||
|
input: "./openapi.json",
|
||||||
|
output: "./src/client",
|
||||||
|
// exportSchemas: true,
|
||||||
|
plugins: [
|
||||||
|
{
|
||||||
|
name: "@hey-api/sdk",
|
||||||
|
// NOTE: this doesn't allow tree-shaking
|
||||||
|
asClass: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
})
|
||||||
1099
frontend/package-lock.json
generated
1099
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@
|
|||||||
"build": "tsc && vite build",
|
"build": "tsc && vite build",
|
||||||
"lint": "biome check --apply-unsafe --no-errors-on-unmatched --files-ignore-unknown=true ./",
|
"lint": "biome check --apply-unsafe --no-errors-on-unmatched --files-ignore-unknown=true ./",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"generate-client": "openapi-ts --input ./openapi.json --output ./src/client --client axios --exportSchemas true"
|
"generate-client": "openapi-ts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@chakra-ui/icons": "2.1.1",
|
"@chakra-ui/icons": "2.1.1",
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "1.6.1",
|
"@biomejs/biome": "1.6.1",
|
||||||
"@hey-api/openapi-ts": "^0.34.1",
|
"@hey-api/openapi-ts": "^0.57.0",
|
||||||
"@playwright/test": "^1.45.2",
|
"@playwright/test": "^1.45.2",
|
||||||
"@tanstack/router-devtools": "1.19.1",
|
"@tanstack/router-devtools": "1.19.1",
|
||||||
"@tanstack/router-vite-plugin": "1.19.0",
|
"@tanstack/router-vite-plugin": "1.19.0",
|
||||||
|
|||||||
@@ -1,20 +1,21 @@
|
|||||||
export type ApiRequestOptions = {
|
export type ApiRequestOptions<T = unknown> = {
|
||||||
readonly method:
|
|
||||||
| "GET"
|
|
||||||
| "PUT"
|
|
||||||
| "POST"
|
|
||||||
| "DELETE"
|
|
||||||
| "OPTIONS"
|
|
||||||
| "HEAD"
|
|
||||||
| "PATCH"
|
|
||||||
readonly url: string
|
|
||||||
readonly path?: Record<string, unknown>
|
|
||||||
readonly cookies?: Record<string, unknown>
|
|
||||||
readonly headers?: Record<string, unknown>
|
|
||||||
readonly query?: Record<string, unknown>
|
|
||||||
readonly formData?: Record<string, unknown>
|
|
||||||
readonly body?: any
|
readonly body?: any
|
||||||
|
readonly cookies?: Record<string, unknown>
|
||||||
|
readonly errors?: Record<number | string, string>
|
||||||
|
readonly formData?: Record<string, unknown> | any[] | Blob | File
|
||||||
|
readonly headers?: Record<string, unknown>
|
||||||
readonly mediaType?: string
|
readonly mediaType?: string
|
||||||
|
readonly method:
|
||||||
|
| "DELETE"
|
||||||
|
| "GET"
|
||||||
|
| "HEAD"
|
||||||
|
| "OPTIONS"
|
||||||
|
| "PATCH"
|
||||||
|
| "POST"
|
||||||
|
| "PUT"
|
||||||
|
readonly path?: Record<string, unknown>
|
||||||
|
readonly query?: Record<string, unknown>
|
||||||
readonly responseHeader?: string
|
readonly responseHeader?: string
|
||||||
readonly errors?: Record<number, string>
|
readonly responseTransformer?: (data: unknown) => Promise<T>
|
||||||
|
readonly url: string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import type { AxiosRequestConfig, AxiosResponse } from "axios"
|
import type { AxiosRequestConfig, AxiosResponse } from "axios"
|
||||||
import type { ApiRequestOptions } from "./ApiRequestOptions"
|
import type { ApiRequestOptions } from "./ApiRequestOptions"
|
||||||
import type { TResult } from "./types"
|
|
||||||
|
|
||||||
type Headers = Record<string, string>
|
type Headers = Record<string, string>
|
||||||
type Middleware<T> = (value: T) => T | Promise<T>
|
type Middleware<T> = (value: T) => T | Promise<T>
|
||||||
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>
|
type Resolver<T> = (options: ApiRequestOptions<T>) => Promise<T>
|
||||||
|
|
||||||
export class Interceptors<T> {
|
export class Interceptors<T> {
|
||||||
_fns: Middleware<T>[]
|
_fns: Middleware<T>[]
|
||||||
@@ -13,14 +12,14 @@ export class Interceptors<T> {
|
|||||||
this._fns = []
|
this._fns = []
|
||||||
}
|
}
|
||||||
|
|
||||||
eject(fn: Middleware<T>) {
|
eject(fn: Middleware<T>): void {
|
||||||
const index = this._fns.indexOf(fn)
|
const index = this._fns.indexOf(fn)
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]
|
this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
use(fn: Middleware<T>) {
|
use(fn: Middleware<T>): void {
|
||||||
this._fns = [...this._fns, fn]
|
this._fns = [...this._fns, fn]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -31,7 +30,6 @@ export type OpenAPIConfig = {
|
|||||||
ENCODE_PATH?: ((path: string) => string) | undefined
|
ENCODE_PATH?: ((path: string) => string) | undefined
|
||||||
HEADERS?: Headers | Resolver<Headers> | undefined
|
HEADERS?: Headers | Resolver<Headers> | undefined
|
||||||
PASSWORD?: string | Resolver<string> | undefined
|
PASSWORD?: string | Resolver<string> | undefined
|
||||||
RESULT?: TResult
|
|
||||||
TOKEN?: string | Resolver<string> | undefined
|
TOKEN?: string | Resolver<string> | undefined
|
||||||
USERNAME?: string | Resolver<string> | undefined
|
USERNAME?: string | Resolver<string> | undefined
|
||||||
VERSION: string
|
VERSION: string
|
||||||
@@ -48,10 +46,12 @@ export const OpenAPI: OpenAPIConfig = {
|
|||||||
ENCODE_PATH: undefined,
|
ENCODE_PATH: undefined,
|
||||||
HEADERS: undefined,
|
HEADERS: undefined,
|
||||||
PASSWORD: undefined,
|
PASSWORD: undefined,
|
||||||
RESULT: "body",
|
|
||||||
TOKEN: undefined,
|
TOKEN: undefined,
|
||||||
USERNAME: undefined,
|
USERNAME: undefined,
|
||||||
VERSION: "0.1.0",
|
VERSION: "0.1.0",
|
||||||
WITH_CREDENTIALS: false,
|
WITH_CREDENTIALS: false,
|
||||||
interceptors: { request: new Interceptors(), response: new Interceptors() },
|
interceptors: {
|
||||||
|
request: new Interceptors(),
|
||||||
|
response: new Interceptors(),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,9 @@ export const getQueryString = (params: Record<string, unknown>): string => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Array.isArray(value)) {
|
if (value instanceof Date) {
|
||||||
|
append(key, value.toISOString())
|
||||||
|
} else if (Array.isArray(value)) {
|
||||||
value.forEach((v) => encodePair(key, v))
|
value.forEach((v) => encodePair(key, v))
|
||||||
} else if (typeof value === "object") {
|
} else if (typeof value === "object") {
|
||||||
Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v))
|
Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v))
|
||||||
@@ -113,10 +115,10 @@ export const getFormData = (
|
|||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>
|
type Resolver<T> = (options: ApiRequestOptions<T>) => Promise<T>
|
||||||
|
|
||||||
export const resolve = async <T>(
|
export const resolve = async <T>(
|
||||||
options: ApiRequestOptions,
|
options: ApiRequestOptions<T>,
|
||||||
resolver?: T | Resolver<T>,
|
resolver?: T | Resolver<T>,
|
||||||
): Promise<T | undefined> => {
|
): Promise<T | undefined> => {
|
||||||
if (typeof resolver === "function") {
|
if (typeof resolver === "function") {
|
||||||
@@ -125,14 +127,18 @@ export const resolve = async <T>(
|
|||||||
return resolver
|
return resolver
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getHeaders = async (
|
export const getHeaders = async <T>(
|
||||||
config: OpenAPIConfig,
|
config: OpenAPIConfig,
|
||||||
options: ApiRequestOptions,
|
options: ApiRequestOptions<T>,
|
||||||
): Promise<Record<string, string>> => {
|
): Promise<Record<string, string>> => {
|
||||||
const [token, username, password, additionalHeaders] = await Promise.all([
|
const [token, username, password, additionalHeaders] = await Promise.all([
|
||||||
|
// @ts-ignore
|
||||||
resolve(options, config.TOKEN),
|
resolve(options, config.TOKEN),
|
||||||
|
// @ts-ignore
|
||||||
resolve(options, config.USERNAME),
|
resolve(options, config.USERNAME),
|
||||||
|
// @ts-ignore
|
||||||
resolve(options, config.PASSWORD),
|
resolve(options, config.PASSWORD),
|
||||||
|
// @ts-ignore
|
||||||
resolve(options, config.HEADERS),
|
resolve(options, config.HEADERS),
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -187,7 +193,7 @@ export const getRequestBody = (options: ApiRequestOptions): unknown => {
|
|||||||
|
|
||||||
export const sendRequest = async <T>(
|
export const sendRequest = async <T>(
|
||||||
config: OpenAPIConfig,
|
config: OpenAPIConfig,
|
||||||
options: ApiRequestOptions,
|
options: ApiRequestOptions<T>,
|
||||||
url: string,
|
url: string,
|
||||||
body: unknown,
|
body: unknown,
|
||||||
formData: FormData | undefined,
|
formData: FormData | undefined,
|
||||||
@@ -325,7 +331,7 @@ export const catchErrorCodes = (
|
|||||||
*/
|
*/
|
||||||
export const request = <T>(
|
export const request = <T>(
|
||||||
config: OpenAPIConfig,
|
config: OpenAPIConfig,
|
||||||
options: ApiRequestOptions,
|
options: ApiRequestOptions<T>,
|
||||||
axiosClient: AxiosInstance = axios,
|
axiosClient: AxiosInstance = axios,
|
||||||
): CancelablePromise<T> => {
|
): CancelablePromise<T> => {
|
||||||
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
||||||
@@ -357,12 +363,17 @@ export const request = <T>(
|
|||||||
options.responseHeader,
|
options.responseHeader,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
let transformedBody = responseBody
|
||||||
|
if (options.responseTransformer && isSuccess(response.status)) {
|
||||||
|
transformedBody = await options.responseTransformer(responseBody)
|
||||||
|
}
|
||||||
|
|
||||||
const result: ApiResult = {
|
const result: ApiResult = {
|
||||||
url,
|
url,
|
||||||
ok: isSuccess(response.status),
|
ok: isSuccess(response.status),
|
||||||
status: response.status,
|
status: response.status,
|
||||||
statusText: response.statusText,
|
statusText: response.statusText,
|
||||||
body: responseHeader ?? responseBody,
|
body: responseHeader ?? transformedBody,
|
||||||
}
|
}
|
||||||
|
|
||||||
catchErrorCodes(options, result)
|
catchErrorCodes(options, result)
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
import type { ApiResult } from "./ApiResult"
|
|
||||||
|
|
||||||
export type TResult = "body" | "raw"
|
|
||||||
|
|
||||||
export type TApiResponse<T extends TResult, TData> = Exclude<
|
|
||||||
T,
|
|
||||||
"raw"
|
|
||||||
> extends never
|
|
||||||
? ApiResult<TData>
|
|
||||||
: ApiResult<TData>["body"]
|
|
||||||
|
|
||||||
export type TConfig<T extends TResult> = {
|
|
||||||
_result?: T
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
|
// This file is auto-generated by @hey-api/openapi-ts
|
||||||
export { ApiError } from "./core/ApiError"
|
export { ApiError } from "./core/ApiError"
|
||||||
export { CancelablePromise, CancelError } from "./core/CancelablePromise"
|
export { CancelablePromise, CancelError } from "./core/CancelablePromise"
|
||||||
export { OpenAPI } from "./core/OpenAPI"
|
export { OpenAPI, type OpenAPIConfig } from "./core/OpenAPI"
|
||||||
export type { OpenAPIConfig } from "./core/OpenAPI"
|
export * from "./sdk.gen"
|
||||||
|
export * from "./types.gen"
|
||||||
export * from "./models"
|
|
||||||
export * from "./schemas"
|
|
||||||
export * from "./services"
|
|
||||||
|
|||||||
@@ -1,99 +0,0 @@
|
|||||||
export type Body_login_login_access_token = {
|
|
||||||
grant_type?: string | null
|
|
||||||
username: string
|
|
||||||
password: string
|
|
||||||
scope?: string
|
|
||||||
client_id?: string | null
|
|
||||||
client_secret?: string | null
|
|
||||||
}
|
|
||||||
|
|
||||||
export type HTTPValidationError = {
|
|
||||||
detail?: Array<ValidationError>
|
|
||||||
}
|
|
||||||
|
|
||||||
export type ItemCreate = {
|
|
||||||
title: string
|
|
||||||
description?: string | null
|
|
||||||
}
|
|
||||||
|
|
||||||
export type ItemPublic = {
|
|
||||||
title: string
|
|
||||||
description?: string | null
|
|
||||||
id: string
|
|
||||||
owner_id: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export type ItemUpdate = {
|
|
||||||
title?: string | null
|
|
||||||
description?: string | null
|
|
||||||
}
|
|
||||||
|
|
||||||
export type ItemsPublic = {
|
|
||||||
data: Array<ItemPublic>
|
|
||||||
count: number
|
|
||||||
}
|
|
||||||
|
|
||||||
export type Message = {
|
|
||||||
message: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export type NewPassword = {
|
|
||||||
token: string
|
|
||||||
new_password: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export type Token = {
|
|
||||||
access_token: string
|
|
||||||
token_type?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export type UpdatePassword = {
|
|
||||||
current_password: string
|
|
||||||
new_password: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export type UserCreate = {
|
|
||||||
email: string
|
|
||||||
is_active?: boolean
|
|
||||||
is_superuser?: boolean
|
|
||||||
full_name?: string | null
|
|
||||||
password: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export type UserPublic = {
|
|
||||||
email: string
|
|
||||||
is_active?: boolean
|
|
||||||
is_superuser?: boolean
|
|
||||||
full_name?: string | null
|
|
||||||
id: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export type UserRegister = {
|
|
||||||
email: string
|
|
||||||
password: string
|
|
||||||
full_name?: string | null
|
|
||||||
}
|
|
||||||
|
|
||||||
export type UserUpdate = {
|
|
||||||
email?: string | null
|
|
||||||
is_active?: boolean
|
|
||||||
is_superuser?: boolean
|
|
||||||
full_name?: string | null
|
|
||||||
password?: string | null
|
|
||||||
}
|
|
||||||
|
|
||||||
export type UserUpdateMe = {
|
|
||||||
full_name?: string | null
|
|
||||||
email?: string | null
|
|
||||||
}
|
|
||||||
|
|
||||||
export type UsersPublic = {
|
|
||||||
data: Array<UserPublic>
|
|
||||||
count: number
|
|
||||||
}
|
|
||||||
|
|
||||||
export type ValidationError = {
|
|
||||||
loc: Array<string | number>
|
|
||||||
msg: string
|
|
||||||
type: string
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
export const $Body_login_login_access_token = {
|
// This file is auto-generated by @hey-api/openapi-ts
|
||||||
|
|
||||||
|
export const Body_login_login_access_tokenSchema = {
|
||||||
properties: {
|
properties: {
|
||||||
grant_type: {
|
grant_type: {
|
||||||
type: "any-of",
|
anyOf: [
|
||||||
contains: [
|
|
||||||
{
|
{
|
||||||
type: "string",
|
type: "string",
|
||||||
pattern: "password",
|
pattern: "password",
|
||||||
@@ -11,22 +12,23 @@ export const $Body_login_login_access_token = {
|
|||||||
type: "null",
|
type: "null",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
title: "Grant Type",
|
||||||
},
|
},
|
||||||
username: {
|
username: {
|
||||||
type: "string",
|
type: "string",
|
||||||
isRequired: true,
|
title: "Username",
|
||||||
},
|
},
|
||||||
password: {
|
password: {
|
||||||
type: "string",
|
type: "string",
|
||||||
isRequired: true,
|
title: "Password",
|
||||||
},
|
},
|
||||||
scope: {
|
scope: {
|
||||||
type: "string",
|
type: "string",
|
||||||
|
title: "Scope",
|
||||||
default: "",
|
default: "",
|
||||||
},
|
},
|
||||||
client_id: {
|
client_id: {
|
||||||
type: "any-of",
|
anyOf: [
|
||||||
contains: [
|
|
||||||
{
|
{
|
||||||
type: "string",
|
type: "string",
|
||||||
},
|
},
|
||||||
@@ -34,10 +36,10 @@ export const $Body_login_login_access_token = {
|
|||||||
type: "null",
|
type: "null",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
title: "Client Id",
|
||||||
},
|
},
|
||||||
client_secret: {
|
client_secret: {
|
||||||
type: "any-of",
|
anyOf: [
|
||||||
contains: [
|
|
||||||
{
|
{
|
||||||
type: "string",
|
type: "string",
|
||||||
},
|
},
|
||||||
@@ -45,32 +47,38 @@ export const $Body_login_login_access_token = {
|
|||||||
type: "null",
|
type: "null",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
title: "Client Secret",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
type: "object",
|
||||||
|
required: ["username", "password"],
|
||||||
|
title: "Body_login-login_access_token",
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export const $HTTPValidationError = {
|
export const HTTPValidationErrorSchema = {
|
||||||
properties: {
|
properties: {
|
||||||
detail: {
|
detail: {
|
||||||
|
items: {
|
||||||
|
$ref: "#/components/schemas/ValidationError",
|
||||||
|
},
|
||||||
type: "array",
|
type: "array",
|
||||||
contains: {
|
title: "Detail",
|
||||||
type: "ValidationError",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
type: "object",
|
||||||
|
title: "HTTPValidationError",
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export const $ItemCreate = {
|
export const ItemCreateSchema = {
|
||||||
properties: {
|
properties: {
|
||||||
title: {
|
title: {
|
||||||
type: "string",
|
type: "string",
|
||||||
isRequired: true,
|
|
||||||
maxLength: 255,
|
maxLength: 255,
|
||||||
minLength: 1,
|
minLength: 1,
|
||||||
|
title: "Title",
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
type: "any-of",
|
anyOf: [
|
||||||
contains: [
|
|
||||||
{
|
{
|
||||||
type: "string",
|
type: "string",
|
||||||
maxLength: 255,
|
maxLength: 255,
|
||||||
@@ -79,21 +87,24 @@ export const $ItemCreate = {
|
|||||||
type: "null",
|
type: "null",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
title: "Description",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
type: "object",
|
||||||
|
required: ["title"],
|
||||||
|
title: "ItemCreate",
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export const $ItemPublic = {
|
export const ItemPublicSchema = {
|
||||||
properties: {
|
properties: {
|
||||||
title: {
|
title: {
|
||||||
type: "string",
|
type: "string",
|
||||||
isRequired: true,
|
|
||||||
maxLength: 255,
|
maxLength: 255,
|
||||||
minLength: 1,
|
minLength: 1,
|
||||||
|
title: "Title",
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
type: "any-of",
|
anyOf: [
|
||||||
contains: [
|
|
||||||
{
|
{
|
||||||
type: "string",
|
type: "string",
|
||||||
maxLength: 255,
|
maxLength: 255,
|
||||||
@@ -102,25 +113,28 @@ export const $ItemPublic = {
|
|||||||
type: "null",
|
type: "null",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
title: "Description",
|
||||||
},
|
},
|
||||||
id: {
|
id: {
|
||||||
type: "string",
|
type: "string",
|
||||||
isRequired: true,
|
|
||||||
format: "uuid",
|
format: "uuid",
|
||||||
|
title: "Id",
|
||||||
},
|
},
|
||||||
owner_id: {
|
owner_id: {
|
||||||
type: "string",
|
type: "string",
|
||||||
isRequired: true,
|
|
||||||
format: "uuid",
|
format: "uuid",
|
||||||
|
title: "Owner Id",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
type: "object",
|
||||||
|
required: ["title", "id", "owner_id"],
|
||||||
|
title: "ItemPublic",
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export const $ItemUpdate = {
|
export const ItemUpdateSchema = {
|
||||||
properties: {
|
properties: {
|
||||||
title: {
|
title: {
|
||||||
type: "any-of",
|
anyOf: [
|
||||||
contains: [
|
|
||||||
{
|
{
|
||||||
type: "string",
|
type: "string",
|
||||||
maxLength: 255,
|
maxLength: 255,
|
||||||
@@ -130,10 +144,10 @@ export const $ItemUpdate = {
|
|||||||
type: "null",
|
type: "null",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
title: "Title",
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
type: "any-of",
|
anyOf: [
|
||||||
contains: [
|
|
||||||
{
|
{
|
||||||
type: "string",
|
type: "string",
|
||||||
maxLength: 255,
|
maxLength: 255,
|
||||||
@@ -142,99 +156,119 @@ export const $ItemUpdate = {
|
|||||||
type: "null",
|
type: "null",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
title: "Description",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
type: "object",
|
||||||
|
title: "ItemUpdate",
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export const $ItemsPublic = {
|
export const ItemsPublicSchema = {
|
||||||
properties: {
|
properties: {
|
||||||
data: {
|
data: {
|
||||||
type: "array",
|
items: {
|
||||||
contains: {
|
$ref: "#/components/schemas/ItemPublic",
|
||||||
type: "ItemPublic",
|
|
||||||
},
|
},
|
||||||
isRequired: true,
|
type: "array",
|
||||||
|
title: "Data",
|
||||||
},
|
},
|
||||||
count: {
|
count: {
|
||||||
type: "number",
|
type: "integer",
|
||||||
isRequired: true,
|
title: "Count",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
type: "object",
|
||||||
|
required: ["data", "count"],
|
||||||
|
title: "ItemsPublic",
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export const $Message = {
|
export const MessageSchema = {
|
||||||
properties: {
|
properties: {
|
||||||
message: {
|
message: {
|
||||||
type: "string",
|
type: "string",
|
||||||
isRequired: true,
|
title: "Message",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
type: "object",
|
||||||
|
required: ["message"],
|
||||||
|
title: "Message",
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export const $NewPassword = {
|
export const NewPasswordSchema = {
|
||||||
properties: {
|
properties: {
|
||||||
token: {
|
token: {
|
||||||
type: "string",
|
type: "string",
|
||||||
isRequired: true,
|
title: "Token",
|
||||||
},
|
},
|
||||||
new_password: {
|
new_password: {
|
||||||
type: "string",
|
type: "string",
|
||||||
isRequired: true,
|
|
||||||
maxLength: 40,
|
maxLength: 40,
|
||||||
minLength: 8,
|
minLength: 8,
|
||||||
|
title: "New Password",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
type: "object",
|
||||||
|
required: ["token", "new_password"],
|
||||||
|
title: "NewPassword",
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export const $Token = {
|
export const TokenSchema = {
|
||||||
properties: {
|
properties: {
|
||||||
access_token: {
|
access_token: {
|
||||||
type: "string",
|
type: "string",
|
||||||
isRequired: true,
|
title: "Access Token",
|
||||||
},
|
},
|
||||||
token_type: {
|
token_type: {
|
||||||
type: "string",
|
type: "string",
|
||||||
|
title: "Token Type",
|
||||||
default: "bearer",
|
default: "bearer",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
type: "object",
|
||||||
|
required: ["access_token"],
|
||||||
|
title: "Token",
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export const $UpdatePassword = {
|
export const UpdatePasswordSchema = {
|
||||||
properties: {
|
properties: {
|
||||||
current_password: {
|
current_password: {
|
||||||
type: "string",
|
type: "string",
|
||||||
isRequired: true,
|
|
||||||
maxLength: 40,
|
maxLength: 40,
|
||||||
minLength: 8,
|
minLength: 8,
|
||||||
|
title: "Current Password",
|
||||||
},
|
},
|
||||||
new_password: {
|
new_password: {
|
||||||
type: "string",
|
type: "string",
|
||||||
isRequired: true,
|
|
||||||
maxLength: 40,
|
maxLength: 40,
|
||||||
minLength: 8,
|
minLength: 8,
|
||||||
|
title: "New Password",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
type: "object",
|
||||||
|
required: ["current_password", "new_password"],
|
||||||
|
title: "UpdatePassword",
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export const $UserCreate = {
|
export const UserCreateSchema = {
|
||||||
properties: {
|
properties: {
|
||||||
email: {
|
email: {
|
||||||
type: "string",
|
type: "string",
|
||||||
isRequired: true,
|
|
||||||
format: "email",
|
|
||||||
maxLength: 255,
|
maxLength: 255,
|
||||||
|
format: "email",
|
||||||
|
title: "Email",
|
||||||
},
|
},
|
||||||
is_active: {
|
is_active: {
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
|
title: "Is Active",
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
is_superuser: {
|
is_superuser: {
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
|
title: "Is Superuser",
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
full_name: {
|
full_name: {
|
||||||
type: "any-of",
|
anyOf: [
|
||||||
contains: [
|
|
||||||
{
|
{
|
||||||
type: "string",
|
type: "string",
|
||||||
maxLength: 255,
|
maxLength: 255,
|
||||||
@@ -243,35 +277,40 @@ export const $UserCreate = {
|
|||||||
type: "null",
|
type: "null",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
title: "Full Name",
|
||||||
},
|
},
|
||||||
password: {
|
password: {
|
||||||
type: "string",
|
type: "string",
|
||||||
isRequired: true,
|
|
||||||
maxLength: 40,
|
maxLength: 40,
|
||||||
minLength: 8,
|
minLength: 8,
|
||||||
|
title: "Password",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
type: "object",
|
||||||
|
required: ["email", "password"],
|
||||||
|
title: "UserCreate",
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export const $UserPublic = {
|
export const UserPublicSchema = {
|
||||||
properties: {
|
properties: {
|
||||||
email: {
|
email: {
|
||||||
type: "string",
|
type: "string",
|
||||||
isRequired: true,
|
|
||||||
format: "email",
|
|
||||||
maxLength: 255,
|
maxLength: 255,
|
||||||
|
format: "email",
|
||||||
|
title: "Email",
|
||||||
},
|
},
|
||||||
is_active: {
|
is_active: {
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
|
title: "Is Active",
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
is_superuser: {
|
is_superuser: {
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
|
title: "Is Superuser",
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
full_name: {
|
full_name: {
|
||||||
type: "any-of",
|
anyOf: [
|
||||||
contains: [
|
|
||||||
{
|
{
|
||||||
type: "string",
|
type: "string",
|
||||||
maxLength: 255,
|
maxLength: 255,
|
||||||
@@ -280,32 +319,35 @@ export const $UserPublic = {
|
|||||||
type: "null",
|
type: "null",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
title: "Full Name",
|
||||||
},
|
},
|
||||||
id: {
|
id: {
|
||||||
type: "string",
|
type: "string",
|
||||||
isRequired: true,
|
|
||||||
format: "uuid",
|
format: "uuid",
|
||||||
|
title: "Id",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
type: "object",
|
||||||
|
required: ["email", "id"],
|
||||||
|
title: "UserPublic",
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export const $UserRegister = {
|
export const UserRegisterSchema = {
|
||||||
properties: {
|
properties: {
|
||||||
email: {
|
email: {
|
||||||
type: "string",
|
type: "string",
|
||||||
isRequired: true,
|
|
||||||
format: "email",
|
|
||||||
maxLength: 255,
|
maxLength: 255,
|
||||||
|
format: "email",
|
||||||
|
title: "Email",
|
||||||
},
|
},
|
||||||
password: {
|
password: {
|
||||||
type: "string",
|
type: "string",
|
||||||
isRequired: true,
|
|
||||||
maxLength: 40,
|
maxLength: 40,
|
||||||
minLength: 8,
|
minLength: 8,
|
||||||
|
title: "Password",
|
||||||
},
|
},
|
||||||
full_name: {
|
full_name: {
|
||||||
type: "any-of",
|
anyOf: [
|
||||||
contains: [
|
|
||||||
{
|
{
|
||||||
type: "string",
|
type: "string",
|
||||||
maxLength: 255,
|
maxLength: 255,
|
||||||
@@ -314,36 +356,41 @@ export const $UserRegister = {
|
|||||||
type: "null",
|
type: "null",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
title: "Full Name",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
type: "object",
|
||||||
|
required: ["email", "password"],
|
||||||
|
title: "UserRegister",
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export const $UserUpdate = {
|
export const UserUpdateSchema = {
|
||||||
properties: {
|
properties: {
|
||||||
email: {
|
email: {
|
||||||
type: "any-of",
|
anyOf: [
|
||||||
contains: [
|
|
||||||
{
|
{
|
||||||
type: "string",
|
type: "string",
|
||||||
format: "email",
|
|
||||||
maxLength: 255,
|
maxLength: 255,
|
||||||
|
format: "email",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "null",
|
type: "null",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
title: "Email",
|
||||||
},
|
},
|
||||||
is_active: {
|
is_active: {
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
|
title: "Is Active",
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
is_superuser: {
|
is_superuser: {
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
|
title: "Is Superuser",
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
full_name: {
|
full_name: {
|
||||||
type: "any-of",
|
anyOf: [
|
||||||
contains: [
|
|
||||||
{
|
{
|
||||||
type: "string",
|
type: "string",
|
||||||
maxLength: 255,
|
maxLength: 255,
|
||||||
@@ -352,10 +399,10 @@ export const $UserUpdate = {
|
|||||||
type: "null",
|
type: "null",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
title: "Full Name",
|
||||||
},
|
},
|
||||||
password: {
|
password: {
|
||||||
type: "any-of",
|
anyOf: [
|
||||||
contains: [
|
|
||||||
{
|
{
|
||||||
type: "string",
|
type: "string",
|
||||||
maxLength: 40,
|
maxLength: 40,
|
||||||
@@ -365,15 +412,17 @@ export const $UserUpdate = {
|
|||||||
type: "null",
|
type: "null",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
title: "Password",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
type: "object",
|
||||||
|
title: "UserUpdate",
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export const $UserUpdateMe = {
|
export const UserUpdateMeSchema = {
|
||||||
properties: {
|
properties: {
|
||||||
full_name: {
|
full_name: {
|
||||||
type: "any-of",
|
anyOf: [
|
||||||
contains: [
|
|
||||||
{
|
{
|
||||||
type: "string",
|
type: "string",
|
||||||
maxLength: 255,
|
maxLength: 255,
|
||||||
@@ -382,63 +431,71 @@ export const $UserUpdateMe = {
|
|||||||
type: "null",
|
type: "null",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
title: "Full Name",
|
||||||
},
|
},
|
||||||
email: {
|
email: {
|
||||||
type: "any-of",
|
anyOf: [
|
||||||
contains: [
|
|
||||||
{
|
{
|
||||||
type: "string",
|
type: "string",
|
||||||
format: "email",
|
|
||||||
maxLength: 255,
|
maxLength: 255,
|
||||||
|
format: "email",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "null",
|
type: "null",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
title: "Email",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
type: "object",
|
||||||
|
title: "UserUpdateMe",
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export const $UsersPublic = {
|
export const UsersPublicSchema = {
|
||||||
properties: {
|
properties: {
|
||||||
data: {
|
data: {
|
||||||
type: "array",
|
items: {
|
||||||
contains: {
|
$ref: "#/components/schemas/UserPublic",
|
||||||
type: "UserPublic",
|
|
||||||
},
|
},
|
||||||
isRequired: true,
|
type: "array",
|
||||||
|
title: "Data",
|
||||||
},
|
},
|
||||||
count: {
|
count: {
|
||||||
type: "number",
|
type: "integer",
|
||||||
isRequired: true,
|
title: "Count",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
type: "object",
|
||||||
|
required: ["data", "count"],
|
||||||
|
title: "UsersPublic",
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export const $ValidationError = {
|
export const ValidationErrorSchema = {
|
||||||
properties: {
|
properties: {
|
||||||
loc: {
|
loc: {
|
||||||
type: "array",
|
items: {
|
||||||
contains: {
|
anyOf: [
|
||||||
type: "any-of",
|
|
||||||
contains: [
|
|
||||||
{
|
{
|
||||||
type: "string",
|
type: "string",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "number",
|
type: "integer",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
isRequired: true,
|
type: "array",
|
||||||
|
title: "Location",
|
||||||
},
|
},
|
||||||
msg: {
|
msg: {
|
||||||
type: "string",
|
type: "string",
|
||||||
isRequired: true,
|
title: "Message",
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
type: "string",
|
type: "string",
|
||||||
isRequired: true,
|
title: "Error Type",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
type: "object",
|
||||||
|
required: ["loc", "msg", "type"],
|
||||||
|
title: "ValidationError",
|
||||||
} as const
|
} as const
|
||||||
@@ -1,56 +1,191 @@
|
|||||||
|
// This file is auto-generated by @hey-api/openapi-ts
|
||||||
|
|
||||||
import type { CancelablePromise } from "./core/CancelablePromise"
|
import type { CancelablePromise } from "./core/CancelablePromise"
|
||||||
import { OpenAPI } from "./core/OpenAPI"
|
import { OpenAPI } from "./core/OpenAPI"
|
||||||
import { request as __request } from "./core/request"
|
import { request as __request } from "./core/request"
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
Body_login_login_access_token,
|
ReadItemsData,
|
||||||
Message,
|
ReadItemsResponse,
|
||||||
NewPassword,
|
CreateItemData,
|
||||||
Token,
|
CreateItemResponse,
|
||||||
UserPublic,
|
ReadItemData,
|
||||||
UpdatePassword,
|
ReadItemResponse,
|
||||||
UserCreate,
|
UpdateItemData,
|
||||||
UserRegister,
|
UpdateItemResponse,
|
||||||
UsersPublic,
|
DeleteItemData,
|
||||||
UserUpdate,
|
DeleteItemResponse,
|
||||||
UserUpdateMe,
|
LoginAccessTokenData,
|
||||||
ItemCreate,
|
LoginAccessTokenResponse,
|
||||||
ItemPublic,
|
TestTokenResponse,
|
||||||
ItemsPublic,
|
RecoverPasswordData,
|
||||||
ItemUpdate,
|
RecoverPasswordResponse,
|
||||||
} from "./models"
|
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 type TDataLoginAccessToken = {
|
export class ItemsService {
|
||||||
formData: Body_login_login_access_token
|
/**
|
||||||
|
* 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",
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
export type TDataRecoverPassword = {
|
|
||||||
email: string
|
/**
|
||||||
|
* 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",
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
export type TDataResetPassword = {
|
|
||||||
requestBody: NewPassword
|
/**
|
||||||
|
* 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 type TDataRecoverPasswordHtmlContent = {
|
|
||||||
email: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class LoginService {
|
export class LoginService {
|
||||||
/**
|
/**
|
||||||
* Login Access Token
|
* Login Access Token
|
||||||
* OAuth2 compatible token login, get an access token for future requests
|
* 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
|
* @returns Token Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public static loginAccessToken(
|
public static loginAccessToken(
|
||||||
data: TDataLoginAccessToken,
|
data: LoginAccessTokenData,
|
||||||
): CancelablePromise<Token> {
|
): CancelablePromise<LoginAccessTokenResponse> {
|
||||||
const { formData } = data
|
|
||||||
return __request(OpenAPI, {
|
return __request(OpenAPI, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "/api/v1/login/access-token",
|
url: "/api/v1/login/access-token",
|
||||||
formData: formData,
|
formData: data.formData,
|
||||||
mediaType: "application/x-www-form-urlencoded",
|
mediaType: "application/x-www-form-urlencoded",
|
||||||
errors: {
|
errors: {
|
||||||
422: `Validation Error`,
|
422: "Validation Error",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -61,7 +196,7 @@ export class LoginService {
|
|||||||
* @returns UserPublic Successful Response
|
* @returns UserPublic Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public static testToken(): CancelablePromise<UserPublic> {
|
public static testToken(): CancelablePromise<TestTokenResponse> {
|
||||||
return __request(OpenAPI, {
|
return __request(OpenAPI, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "/api/v1/login/test-token",
|
url: "/api/v1/login/test-token",
|
||||||
@@ -71,21 +206,22 @@ export class LoginService {
|
|||||||
/**
|
/**
|
||||||
* Recover Password
|
* Recover Password
|
||||||
* Password Recovery
|
* Password Recovery
|
||||||
|
* @param data The data for the request.
|
||||||
|
* @param data.email
|
||||||
* @returns Message Successful Response
|
* @returns Message Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public static recoverPassword(
|
public static recoverPassword(
|
||||||
data: TDataRecoverPassword,
|
data: RecoverPasswordData,
|
||||||
): CancelablePromise<Message> {
|
): CancelablePromise<RecoverPasswordResponse> {
|
||||||
const { email } = data
|
|
||||||
return __request(OpenAPI, {
|
return __request(OpenAPI, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "/api/v1/password-recovery/{email}",
|
url: "/api/v1/password-recovery/{email}",
|
||||||
path: {
|
path: {
|
||||||
email,
|
email: data.email,
|
||||||
},
|
},
|
||||||
errors: {
|
errors: {
|
||||||
422: `Validation Error`,
|
422: "Validation Error",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -93,20 +229,21 @@ export class LoginService {
|
|||||||
/**
|
/**
|
||||||
* Reset Password
|
* Reset Password
|
||||||
* Reset password
|
* Reset password
|
||||||
|
* @param data The data for the request.
|
||||||
|
* @param data.requestBody
|
||||||
* @returns Message Successful Response
|
* @returns Message Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public static resetPassword(
|
public static resetPassword(
|
||||||
data: TDataResetPassword,
|
data: ResetPasswordData,
|
||||||
): CancelablePromise<Message> {
|
): CancelablePromise<ResetPasswordResponse> {
|
||||||
const { requestBody } = data
|
|
||||||
return __request(OpenAPI, {
|
return __request(OpenAPI, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "/api/v1/reset-password/",
|
url: "/api/v1/reset-password/",
|
||||||
body: requestBody,
|
body: data.requestBody,
|
||||||
mediaType: "application/json",
|
mediaType: "application/json",
|
||||||
errors: {
|
errors: {
|
||||||
422: `Validation Error`,
|
422: "Validation Error",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -114,73 +251,49 @@ export class LoginService {
|
|||||||
/**
|
/**
|
||||||
* Recover Password Html Content
|
* Recover Password Html Content
|
||||||
* HTML Content for Password Recovery
|
* HTML Content for Password Recovery
|
||||||
|
* @param data The data for the request.
|
||||||
|
* @param data.email
|
||||||
* @returns string Successful Response
|
* @returns string Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public static recoverPasswordHtmlContent(
|
public static recoverPasswordHtmlContent(
|
||||||
data: TDataRecoverPasswordHtmlContent,
|
data: RecoverPasswordHtmlContentData,
|
||||||
): CancelablePromise<string> {
|
): CancelablePromise<RecoverPasswordHtmlContentResponse> {
|
||||||
const { email } = data
|
|
||||||
return __request(OpenAPI, {
|
return __request(OpenAPI, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "/api/v1/password-recovery-html-content/{email}",
|
url: "/api/v1/password-recovery-html-content/{email}",
|
||||||
path: {
|
path: {
|
||||||
email,
|
email: data.email,
|
||||||
},
|
},
|
||||||
errors: {
|
errors: {
|
||||||
422: `Validation Error`,
|
422: "Validation Error",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TDataReadUsers = {
|
|
||||||
limit?: number
|
|
||||||
skip?: number
|
|
||||||
}
|
|
||||||
export type TDataCreateUser = {
|
|
||||||
requestBody: UserCreate
|
|
||||||
}
|
|
||||||
export type TDataUpdateUserMe = {
|
|
||||||
requestBody: UserUpdateMe
|
|
||||||
}
|
|
||||||
export type TDataUpdatePasswordMe = {
|
|
||||||
requestBody: UpdatePassword
|
|
||||||
}
|
|
||||||
export type TDataRegisterUser = {
|
|
||||||
requestBody: UserRegister
|
|
||||||
}
|
|
||||||
export type TDataReadUserById = {
|
|
||||||
userId: string
|
|
||||||
}
|
|
||||||
export type TDataUpdateUser = {
|
|
||||||
requestBody: UserUpdate
|
|
||||||
userId: string
|
|
||||||
}
|
|
||||||
export type TDataDeleteUser = {
|
|
||||||
userId: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export class UsersService {
|
export class UsersService {
|
||||||
/**
|
/**
|
||||||
* Read Users
|
* Read Users
|
||||||
* Retrieve users.
|
* Retrieve users.
|
||||||
|
* @param data The data for the request.
|
||||||
|
* @param data.skip
|
||||||
|
* @param data.limit
|
||||||
* @returns UsersPublic Successful Response
|
* @returns UsersPublic Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public static readUsers(
|
public static readUsers(
|
||||||
data: TDataReadUsers = {},
|
data: ReadUsersData = {},
|
||||||
): CancelablePromise<UsersPublic> {
|
): CancelablePromise<ReadUsersResponse> {
|
||||||
const { limit = 100, skip = 0 } = data
|
|
||||||
return __request(OpenAPI, {
|
return __request(OpenAPI, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: "/api/v1/users/",
|
url: "/api/v1/users/",
|
||||||
query: {
|
query: {
|
||||||
skip,
|
skip: data.skip,
|
||||||
limit,
|
limit: data.limit,
|
||||||
},
|
},
|
||||||
errors: {
|
errors: {
|
||||||
422: `Validation Error`,
|
422: "Validation Error",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -188,20 +301,21 @@ export class UsersService {
|
|||||||
/**
|
/**
|
||||||
* Create User
|
* Create User
|
||||||
* Create new user.
|
* Create new user.
|
||||||
|
* @param data The data for the request.
|
||||||
|
* @param data.requestBody
|
||||||
* @returns UserPublic Successful Response
|
* @returns UserPublic Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public static createUser(
|
public static createUser(
|
||||||
data: TDataCreateUser,
|
data: CreateUserData,
|
||||||
): CancelablePromise<UserPublic> {
|
): CancelablePromise<CreateUserResponse> {
|
||||||
const { requestBody } = data
|
|
||||||
return __request(OpenAPI, {
|
return __request(OpenAPI, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "/api/v1/users/",
|
url: "/api/v1/users/",
|
||||||
body: requestBody,
|
body: data.requestBody,
|
||||||
mediaType: "application/json",
|
mediaType: "application/json",
|
||||||
errors: {
|
errors: {
|
||||||
422: `Validation Error`,
|
422: "Validation Error",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -212,7 +326,7 @@ export class UsersService {
|
|||||||
* @returns UserPublic Successful Response
|
* @returns UserPublic Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public static readUserMe(): CancelablePromise<UserPublic> {
|
public static readUserMe(): CancelablePromise<ReadUserMeResponse> {
|
||||||
return __request(OpenAPI, {
|
return __request(OpenAPI, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: "/api/v1/users/me",
|
url: "/api/v1/users/me",
|
||||||
@@ -225,7 +339,7 @@ export class UsersService {
|
|||||||
* @returns Message Successful Response
|
* @returns Message Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public static deleteUserMe(): CancelablePromise<Message> {
|
public static deleteUserMe(): CancelablePromise<DeleteUserMeResponse> {
|
||||||
return __request(OpenAPI, {
|
return __request(OpenAPI, {
|
||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
url: "/api/v1/users/me",
|
url: "/api/v1/users/me",
|
||||||
@@ -235,20 +349,21 @@ export class UsersService {
|
|||||||
/**
|
/**
|
||||||
* Update User Me
|
* Update User Me
|
||||||
* Update own user.
|
* Update own user.
|
||||||
|
* @param data The data for the request.
|
||||||
|
* @param data.requestBody
|
||||||
* @returns UserPublic Successful Response
|
* @returns UserPublic Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public static updateUserMe(
|
public static updateUserMe(
|
||||||
data: TDataUpdateUserMe,
|
data: UpdateUserMeData,
|
||||||
): CancelablePromise<UserPublic> {
|
): CancelablePromise<UpdateUserMeResponse> {
|
||||||
const { requestBody } = data
|
|
||||||
return __request(OpenAPI, {
|
return __request(OpenAPI, {
|
||||||
method: "PATCH",
|
method: "PATCH",
|
||||||
url: "/api/v1/users/me",
|
url: "/api/v1/users/me",
|
||||||
body: requestBody,
|
body: data.requestBody,
|
||||||
mediaType: "application/json",
|
mediaType: "application/json",
|
||||||
errors: {
|
errors: {
|
||||||
422: `Validation Error`,
|
422: "Validation Error",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -256,20 +371,21 @@ export class UsersService {
|
|||||||
/**
|
/**
|
||||||
* Update Password Me
|
* Update Password Me
|
||||||
* Update own password.
|
* Update own password.
|
||||||
|
* @param data The data for the request.
|
||||||
|
* @param data.requestBody
|
||||||
* @returns Message Successful Response
|
* @returns Message Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public static updatePasswordMe(
|
public static updatePasswordMe(
|
||||||
data: TDataUpdatePasswordMe,
|
data: UpdatePasswordMeData,
|
||||||
): CancelablePromise<Message> {
|
): CancelablePromise<UpdatePasswordMeResponse> {
|
||||||
const { requestBody } = data
|
|
||||||
return __request(OpenAPI, {
|
return __request(OpenAPI, {
|
||||||
method: "PATCH",
|
method: "PATCH",
|
||||||
url: "/api/v1/users/me/password",
|
url: "/api/v1/users/me/password",
|
||||||
body: requestBody,
|
body: data.requestBody,
|
||||||
mediaType: "application/json",
|
mediaType: "application/json",
|
||||||
errors: {
|
errors: {
|
||||||
422: `Validation Error`,
|
422: "Validation Error",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -277,20 +393,21 @@ export class UsersService {
|
|||||||
/**
|
/**
|
||||||
* Register User
|
* Register User
|
||||||
* Create new user without the need to be logged in.
|
* Create new user without the need to be logged in.
|
||||||
|
* @param data The data for the request.
|
||||||
|
* @param data.requestBody
|
||||||
* @returns UserPublic Successful Response
|
* @returns UserPublic Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public static registerUser(
|
public static registerUser(
|
||||||
data: TDataRegisterUser,
|
data: RegisterUserData,
|
||||||
): CancelablePromise<UserPublic> {
|
): CancelablePromise<RegisterUserResponse> {
|
||||||
const { requestBody } = data
|
|
||||||
return __request(OpenAPI, {
|
return __request(OpenAPI, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "/api/v1/users/signup",
|
url: "/api/v1/users/signup",
|
||||||
body: requestBody,
|
body: data.requestBody,
|
||||||
mediaType: "application/json",
|
mediaType: "application/json",
|
||||||
errors: {
|
errors: {
|
||||||
422: `Validation Error`,
|
422: "Validation Error",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -298,21 +415,22 @@ export class UsersService {
|
|||||||
/**
|
/**
|
||||||
* Read User By Id
|
* Read User By Id
|
||||||
* Get a specific user by id.
|
* Get a specific user by id.
|
||||||
|
* @param data The data for the request.
|
||||||
|
* @param data.userId
|
||||||
* @returns UserPublic Successful Response
|
* @returns UserPublic Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public static readUserById(
|
public static readUserById(
|
||||||
data: TDataReadUserById,
|
data: ReadUserByIdData,
|
||||||
): CancelablePromise<UserPublic> {
|
): CancelablePromise<ReadUserByIdResponse> {
|
||||||
const { userId } = data
|
|
||||||
return __request(OpenAPI, {
|
return __request(OpenAPI, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: "/api/v1/users/{user_id}",
|
url: "/api/v1/users/{user_id}",
|
||||||
path: {
|
path: {
|
||||||
user_id: userId,
|
user_id: data.userId,
|
||||||
},
|
},
|
||||||
errors: {
|
errors: {
|
||||||
422: `Validation Error`,
|
422: "Validation Error",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -320,23 +438,25 @@ export class UsersService {
|
|||||||
/**
|
/**
|
||||||
* Update User
|
* Update User
|
||||||
* Update a user.
|
* Update a user.
|
||||||
|
* @param data The data for the request.
|
||||||
|
* @param data.userId
|
||||||
|
* @param data.requestBody
|
||||||
* @returns UserPublic Successful Response
|
* @returns UserPublic Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public static updateUser(
|
public static updateUser(
|
||||||
data: TDataUpdateUser,
|
data: UpdateUserData,
|
||||||
): CancelablePromise<UserPublic> {
|
): CancelablePromise<UpdateUserResponse> {
|
||||||
const { requestBody, userId } = data
|
|
||||||
return __request(OpenAPI, {
|
return __request(OpenAPI, {
|
||||||
method: "PATCH",
|
method: "PATCH",
|
||||||
url: "/api/v1/users/{user_id}",
|
url: "/api/v1/users/{user_id}",
|
||||||
path: {
|
path: {
|
||||||
user_id: userId,
|
user_id: data.userId,
|
||||||
},
|
},
|
||||||
body: requestBody,
|
body: data.requestBody,
|
||||||
mediaType: "application/json",
|
mediaType: "application/json",
|
||||||
errors: {
|
errors: {
|
||||||
422: `Validation Error`,
|
422: "Validation Error",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -344,45 +464,47 @@ export class UsersService {
|
|||||||
/**
|
/**
|
||||||
* Delete User
|
* Delete User
|
||||||
* Delete a user.
|
* Delete a user.
|
||||||
|
* @param data The data for the request.
|
||||||
|
* @param data.userId
|
||||||
* @returns Message Successful Response
|
* @returns Message Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public static deleteUser(data: TDataDeleteUser): CancelablePromise<Message> {
|
public static deleteUser(
|
||||||
const { userId } = data
|
data: DeleteUserData,
|
||||||
|
): CancelablePromise<DeleteUserResponse> {
|
||||||
return __request(OpenAPI, {
|
return __request(OpenAPI, {
|
||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
url: "/api/v1/users/{user_id}",
|
url: "/api/v1/users/{user_id}",
|
||||||
path: {
|
path: {
|
||||||
user_id: userId,
|
user_id: data.userId,
|
||||||
},
|
},
|
||||||
errors: {
|
errors: {
|
||||||
422: `Validation Error`,
|
422: "Validation Error",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TDataTestEmail = {
|
|
||||||
emailTo: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export class UtilsService {
|
export class UtilsService {
|
||||||
/**
|
/**
|
||||||
* Test Email
|
* Test Email
|
||||||
* Test emails.
|
* Test emails.
|
||||||
|
* @param data The data for the request.
|
||||||
|
* @param data.emailTo
|
||||||
* @returns Message Successful Response
|
* @returns Message Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public static testEmail(data: TDataTestEmail): CancelablePromise<Message> {
|
public static testEmail(
|
||||||
const { emailTo } = data
|
data: TestEmailData,
|
||||||
|
): CancelablePromise<TestEmailResponse> {
|
||||||
return __request(OpenAPI, {
|
return __request(OpenAPI, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "/api/v1/utils/test-email/",
|
url: "/api/v1/utils/test-email/",
|
||||||
query: {
|
query: {
|
||||||
email_to: emailTo,
|
email_to: data.emailTo,
|
||||||
},
|
},
|
||||||
errors: {
|
errors: {
|
||||||
422: `Validation Error`,
|
422: "Validation Error",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -392,138 +514,10 @@ export class UtilsService {
|
|||||||
* @returns boolean Successful Response
|
* @returns boolean Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public static healthCheck(): CancelablePromise<boolean> {
|
public static healthCheck(): CancelablePromise<HealthCheckResponse> {
|
||||||
return __request(OpenAPI, {
|
return __request(OpenAPI, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: "/api/v1/utils/health-check/",
|
url: "/api/v1/utils/health-check/",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TDataReadItems = {
|
|
||||||
limit?: number
|
|
||||||
skip?: number
|
|
||||||
}
|
|
||||||
export type TDataCreateItem = {
|
|
||||||
requestBody: ItemCreate
|
|
||||||
}
|
|
||||||
export type TDataReadItem = {
|
|
||||||
id: string
|
|
||||||
}
|
|
||||||
export type TDataUpdateItem = {
|
|
||||||
id: string
|
|
||||||
requestBody: ItemUpdate
|
|
||||||
}
|
|
||||||
export type TDataDeleteItem = {
|
|
||||||
id: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ItemsService {
|
|
||||||
/**
|
|
||||||
* Read Items
|
|
||||||
* Retrieve items.
|
|
||||||
* @returns ItemsPublic Successful Response
|
|
||||||
* @throws ApiError
|
|
||||||
*/
|
|
||||||
public static readItems(
|
|
||||||
data: TDataReadItems = {},
|
|
||||||
): CancelablePromise<ItemsPublic> {
|
|
||||||
const { limit = 100, skip = 0 } = data
|
|
||||||
return __request(OpenAPI, {
|
|
||||||
method: "GET",
|
|
||||||
url: "/api/v1/items/",
|
|
||||||
query: {
|
|
||||||
skip,
|
|
||||||
limit,
|
|
||||||
},
|
|
||||||
errors: {
|
|
||||||
422: `Validation Error`,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create Item
|
|
||||||
* Create new item.
|
|
||||||
* @returns ItemPublic Successful Response
|
|
||||||
* @throws ApiError
|
|
||||||
*/
|
|
||||||
public static createItem(
|
|
||||||
data: TDataCreateItem,
|
|
||||||
): CancelablePromise<ItemPublic> {
|
|
||||||
const { requestBody } = data
|
|
||||||
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 ItemPublic Successful Response
|
|
||||||
* @throws ApiError
|
|
||||||
*/
|
|
||||||
public static readItem(data: TDataReadItem): CancelablePromise<ItemPublic> {
|
|
||||||
const { id } = data
|
|
||||||
return __request(OpenAPI, {
|
|
||||||
method: "GET",
|
|
||||||
url: "/api/v1/items/{id}",
|
|
||||||
path: {
|
|
||||||
id,
|
|
||||||
},
|
|
||||||
errors: {
|
|
||||||
422: `Validation Error`,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update Item
|
|
||||||
* Update an item.
|
|
||||||
* @returns ItemPublic Successful Response
|
|
||||||
* @throws ApiError
|
|
||||||
*/
|
|
||||||
public static updateItem(
|
|
||||||
data: TDataUpdateItem,
|
|
||||||
): CancelablePromise<ItemPublic> {
|
|
||||||
const { id, requestBody } = data
|
|
||||||
return __request(OpenAPI, {
|
|
||||||
method: "PUT",
|
|
||||||
url: "/api/v1/items/{id}",
|
|
||||||
path: {
|
|
||||||
id,
|
|
||||||
},
|
|
||||||
body: requestBody,
|
|
||||||
mediaType: "application/json",
|
|
||||||
errors: {
|
|
||||||
422: `Validation Error`,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete Item
|
|
||||||
* Delete an item.
|
|
||||||
* @returns Message Successful Response
|
|
||||||
* @throws ApiError
|
|
||||||
*/
|
|
||||||
public static deleteItem(data: TDataDeleteItem): CancelablePromise<Message> {
|
|
||||||
const { id } = data
|
|
||||||
return __request(OpenAPI, {
|
|
||||||
method: "DELETE",
|
|
||||||
url: "/api/v1/items/{id}",
|
|
||||||
path: {
|
|
||||||
id,
|
|
||||||
},
|
|
||||||
errors: {
|
|
||||||
422: `Validation Error`,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
221
frontend/src/client/types.gen.ts
Normal file
221
frontend/src/client/types.gen.ts
Normal file
@@ -0,0 +1,221 @@
|
|||||||
|
// This file is auto-generated by @hey-api/openapi-ts
|
||||||
|
|
||||||
|
export type Body_login_login_access_token = {
|
||||||
|
grant_type?: string | null
|
||||||
|
username: string
|
||||||
|
password: string
|
||||||
|
scope?: string
|
||||||
|
client_id?: string | null
|
||||||
|
client_secret?: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export type HTTPValidationError = {
|
||||||
|
detail?: Array<ValidationError>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ItemCreate = {
|
||||||
|
title: string
|
||||||
|
description?: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ItemPublic = {
|
||||||
|
title: string
|
||||||
|
description?: string | null
|
||||||
|
id: string
|
||||||
|
owner_id: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ItemsPublic = {
|
||||||
|
data: Array<ItemPublic>
|
||||||
|
count: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ItemUpdate = {
|
||||||
|
title?: string | null
|
||||||
|
description?: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Message = {
|
||||||
|
message: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type NewPassword = {
|
||||||
|
token: string
|
||||||
|
new_password: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Token = {
|
||||||
|
access_token: string
|
||||||
|
token_type?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UpdatePassword = {
|
||||||
|
current_password: string
|
||||||
|
new_password: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UserCreate = {
|
||||||
|
email: string
|
||||||
|
is_active?: boolean
|
||||||
|
is_superuser?: boolean
|
||||||
|
full_name?: string | null
|
||||||
|
password: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UserPublic = {
|
||||||
|
email: string
|
||||||
|
is_active?: boolean
|
||||||
|
is_superuser?: boolean
|
||||||
|
full_name?: string | null
|
||||||
|
id: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UserRegister = {
|
||||||
|
email: string
|
||||||
|
password: string
|
||||||
|
full_name?: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UsersPublic = {
|
||||||
|
data: Array<UserPublic>
|
||||||
|
count: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UserUpdate = {
|
||||||
|
email?: string | null
|
||||||
|
is_active?: boolean
|
||||||
|
is_superuser?: boolean
|
||||||
|
full_name?: string | null
|
||||||
|
password?: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UserUpdateMe = {
|
||||||
|
full_name?: string | null
|
||||||
|
email?: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ValidationError = {
|
||||||
|
loc: Array<string | number>
|
||||||
|
msg: string
|
||||||
|
type: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ReadItemsData = {
|
||||||
|
limit?: number
|
||||||
|
skip?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ReadItemsResponse = ItemsPublic
|
||||||
|
|
||||||
|
export type CreateItemData = {
|
||||||
|
requestBody: ItemCreate
|
||||||
|
}
|
||||||
|
|
||||||
|
export type CreateItemResponse = ItemPublic
|
||||||
|
|
||||||
|
export type ReadItemData = {
|
||||||
|
id: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ReadItemResponse = ItemPublic
|
||||||
|
|
||||||
|
export type UpdateItemData = {
|
||||||
|
id: string
|
||||||
|
requestBody: ItemUpdate
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UpdateItemResponse = ItemPublic
|
||||||
|
|
||||||
|
export type DeleteItemData = {
|
||||||
|
id: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type DeleteItemResponse = Message
|
||||||
|
|
||||||
|
export type LoginAccessTokenData = {
|
||||||
|
formData: Body_login_login_access_token
|
||||||
|
}
|
||||||
|
|
||||||
|
export type LoginAccessTokenResponse = Token
|
||||||
|
|
||||||
|
export type TestTokenResponse = UserPublic
|
||||||
|
|
||||||
|
export type RecoverPasswordData = {
|
||||||
|
email: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type RecoverPasswordResponse = Message
|
||||||
|
|
||||||
|
export type ResetPasswordData = {
|
||||||
|
requestBody: NewPassword
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ResetPasswordResponse = Message
|
||||||
|
|
||||||
|
export type RecoverPasswordHtmlContentData = {
|
||||||
|
email: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type RecoverPasswordHtmlContentResponse = string
|
||||||
|
|
||||||
|
export type ReadUsersData = {
|
||||||
|
limit?: number
|
||||||
|
skip?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ReadUsersResponse = UsersPublic
|
||||||
|
|
||||||
|
export type CreateUserData = {
|
||||||
|
requestBody: UserCreate
|
||||||
|
}
|
||||||
|
|
||||||
|
export type CreateUserResponse = UserPublic
|
||||||
|
|
||||||
|
export type ReadUserMeResponse = UserPublic
|
||||||
|
|
||||||
|
export type DeleteUserMeResponse = Message
|
||||||
|
|
||||||
|
export type UpdateUserMeData = {
|
||||||
|
requestBody: UserUpdateMe
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UpdateUserMeResponse = UserPublic
|
||||||
|
|
||||||
|
export type UpdatePasswordMeData = {
|
||||||
|
requestBody: UpdatePassword
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UpdatePasswordMeResponse = Message
|
||||||
|
|
||||||
|
export type RegisterUserData = {
|
||||||
|
requestBody: UserRegister
|
||||||
|
}
|
||||||
|
|
||||||
|
export type RegisterUserResponse = UserPublic
|
||||||
|
|
||||||
|
export type ReadUserByIdData = {
|
||||||
|
userId: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ReadUserByIdResponse = UserPublic
|
||||||
|
|
||||||
|
export type UpdateUserData = {
|
||||||
|
requestBody: UserUpdate
|
||||||
|
userId: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UpdateUserResponse = UserPublic
|
||||||
|
|
||||||
|
export type DeleteUserData = {
|
||||||
|
userId: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type DeleteUserResponse = Message
|
||||||
|
|
||||||
|
export type TestEmailData = {
|
||||||
|
emailTo: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type TestEmailResponse = Message
|
||||||
|
|
||||||
|
export type HealthCheckResponse = boolean
|
||||||
Reference in New Issue
Block a user