committed by
GitHub
13 changed files with 1482 additions and 1436 deletions
@ -1,21 +1,25 @@ |
|||||
import type { ApiRequestOptions } from './ApiRequestOptions'; |
import type { ApiRequestOptions } from "./ApiRequestOptions" |
||||
import type { ApiResult } from './ApiResult'; |
import type { ApiResult } from "./ApiResult" |
||||
|
|
||||
export class ApiError extends Error { |
export class ApiError extends Error { |
||||
public readonly url: string; |
public readonly url: string |
||||
public readonly status: number; |
public readonly status: number |
||||
public readonly statusText: string; |
public readonly statusText: string |
||||
public readonly body: unknown; |
public readonly body: unknown |
||||
public readonly request: ApiRequestOptions; |
public readonly request: ApiRequestOptions |
||||
|
|
||||
constructor(request: ApiRequestOptions, response: ApiResult, message: string) { |
constructor( |
||||
super(message); |
request: ApiRequestOptions, |
||||
|
response: ApiResult, |
||||
|
message: string, |
||||
|
) { |
||||
|
super(message) |
||||
|
|
||||
this.name = 'ApiError'; |
this.name = "ApiError" |
||||
this.url = response.url; |
this.url = response.url |
||||
this.status = response.status; |
this.status = response.status |
||||
this.statusText = response.statusText; |
this.statusText = response.statusText |
||||
this.body = response.body; |
this.body = response.body |
||||
this.request = request; |
this.request = request |
||||
} |
} |
||||
} |
} |
||||
|
@ -1,13 +1,20 @@ |
|||||
export type ApiRequestOptions = { |
export type ApiRequestOptions = { |
||||
readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH'; |
readonly method: |
||||
readonly url: string; |
| "GET" |
||||
readonly path?: Record<string, unknown>; |
| "PUT" |
||||
readonly cookies?: Record<string, unknown>; |
| "POST" |
||||
readonly headers?: Record<string, unknown>; |
| "DELETE" |
||||
readonly query?: Record<string, unknown>; |
| "OPTIONS" |
||||
readonly formData?: Record<string, unknown>; |
| "HEAD" |
||||
readonly body?: any; |
| "PATCH" |
||||
readonly mediaType?: string; |
readonly url: string |
||||
readonly responseHeader?: string; |
readonly path?: Record<string, unknown> |
||||
readonly errors?: Record<number, string>; |
readonly cookies?: Record<string, unknown> |
||||
}; |
readonly headers?: Record<string, unknown> |
||||
|
readonly query?: Record<string, unknown> |
||||
|
readonly formData?: Record<string, unknown> |
||||
|
readonly body?: any |
||||
|
readonly mediaType?: string |
||||
|
readonly responseHeader?: string |
||||
|
readonly errors?: Record<number, string> |
||||
|
} |
||||
|
@ -1,7 +1,7 @@ |
|||||
export type ApiResult<TData = any> = { |
export type ApiResult<TData = any> = { |
||||
readonly body: TData; |
readonly body: TData |
||||
readonly ok: boolean; |
readonly ok: boolean |
||||
readonly status: number; |
readonly status: number |
||||
readonly statusText: string; |
readonly statusText: string |
||||
readonly url: string; |
readonly url: string |
||||
}; |
} |
||||
|
@ -1,126 +1,126 @@ |
|||||
export class CancelError extends Error { |
export class CancelError extends Error { |
||||
constructor(message: string) { |
constructor(message: string) { |
||||
super(message); |
super(message) |
||||
this.name = 'CancelError'; |
this.name = "CancelError" |
||||
} |
} |
||||
|
|
||||
public get isCancelled(): boolean { |
public get isCancelled(): boolean { |
||||
return true; |
return true |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
export interface OnCancel { |
export interface OnCancel { |
||||
readonly isResolved: boolean; |
readonly isResolved: boolean |
||||
readonly isRejected: boolean; |
readonly isRejected: boolean |
||||
readonly isCancelled: boolean; |
readonly isCancelled: boolean |
||||
|
|
||||
(cancelHandler: () => void): void; |
(cancelHandler: () => void): void |
||||
} |
} |
||||
|
|
||||
export class CancelablePromise<T> implements Promise<T> { |
export class CancelablePromise<T> implements Promise<T> { |
||||
private _isResolved: boolean; |
private _isResolved: boolean |
||||
private _isRejected: boolean; |
private _isRejected: boolean |
||||
private _isCancelled: boolean; |
private _isCancelled: boolean |
||||
readonly cancelHandlers: (() => void)[]; |
readonly cancelHandlers: (() => void)[] |
||||
readonly promise: Promise<T>; |
readonly promise: Promise<T> |
||||
private _resolve?: (value: T | PromiseLike<T>) => void; |
private _resolve?: (value: T | PromiseLike<T>) => void |
||||
private _reject?: (reason?: unknown) => void; |
private _reject?: (reason?: unknown) => void |
||||
|
|
||||
constructor( |
constructor( |
||||
executor: ( |
executor: ( |
||||
resolve: (value: T | PromiseLike<T>) => void, |
resolve: (value: T | PromiseLike<T>) => void, |
||||
reject: (reason?: unknown) => void, |
reject: (reason?: unknown) => void, |
||||
onCancel: OnCancel |
onCancel: OnCancel, |
||||
) => void |
) => void, |
||||
) { |
) { |
||||
this._isResolved = false; |
this._isResolved = false |
||||
this._isRejected = false; |
this._isRejected = false |
||||
this._isCancelled = false; |
this._isCancelled = false |
||||
this.cancelHandlers = []; |
this.cancelHandlers = [] |
||||
this.promise = new Promise<T>((resolve, reject) => { |
this.promise = new Promise<T>((resolve, reject) => { |
||||
this._resolve = resolve; |
this._resolve = resolve |
||||
this._reject = reject; |
this._reject = reject |
||||
|
|
||||
const onResolve = (value: T | PromiseLike<T>): void => { |
const onResolve = (value: T | PromiseLike<T>): void => { |
||||
if (this._isResolved || this._isRejected || this._isCancelled) { |
if (this._isResolved || this._isRejected || this._isCancelled) { |
||||
return; |
return |
||||
} |
} |
||||
this._isResolved = true; |
this._isResolved = true |
||||
if (this._resolve) this._resolve(value); |
if (this._resolve) this._resolve(value) |
||||
}; |
} |
||||
|
|
||||
const onReject = (reason?: unknown): void => { |
const onReject = (reason?: unknown): void => { |
||||
if (this._isResolved || this._isRejected || this._isCancelled) { |
if (this._isResolved || this._isRejected || this._isCancelled) { |
||||
return; |
return |
||||
} |
} |
||||
this._isRejected = true; |
this._isRejected = true |
||||
if (this._reject) this._reject(reason); |
if (this._reject) this._reject(reason) |
||||
}; |
} |
||||
|
|
||||
const onCancel = (cancelHandler: () => void): void => { |
const onCancel = (cancelHandler: () => void): void => { |
||||
if (this._isResolved || this._isRejected || this._isCancelled) { |
if (this._isResolved || this._isRejected || this._isCancelled) { |
||||
return; |
return |
||||
} |
} |
||||
this.cancelHandlers.push(cancelHandler); |
this.cancelHandlers.push(cancelHandler) |
||||
}; |
} |
||||
|
|
||||
Object.defineProperty(onCancel, 'isResolved', { |
Object.defineProperty(onCancel, "isResolved", { |
||||
get: (): boolean => this._isResolved, |
get: (): boolean => this._isResolved, |
||||
}); |
}) |
||||
|
|
||||
Object.defineProperty(onCancel, 'isRejected', { |
Object.defineProperty(onCancel, "isRejected", { |
||||
get: (): boolean => this._isRejected, |
get: (): boolean => this._isRejected, |
||||
}); |
}) |
||||
|
|
||||
Object.defineProperty(onCancel, 'isCancelled', { |
Object.defineProperty(onCancel, "isCancelled", { |
||||
get: (): boolean => this._isCancelled, |
get: (): boolean => this._isCancelled, |
||||
}); |
}) |
||||
|
|
||||
return executor(onResolve, onReject, onCancel as OnCancel); |
return executor(onResolve, onReject, onCancel as OnCancel) |
||||
}); |
}) |
||||
} |
} |
||||
|
|
||||
get [Symbol.toStringTag]() { |
get [Symbol.toStringTag]() { |
||||
return "Cancellable Promise"; |
return "Cancellable Promise" |
||||
} |
} |
||||
|
|
||||
public then<TResult1 = T, TResult2 = never>( |
public then<TResult1 = T, TResult2 = never>( |
||||
onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, |
onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, |
||||
onRejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null |
onRejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null, |
||||
): Promise<TResult1 | TResult2> { |
): Promise<TResult1 | TResult2> { |
||||
return this.promise.then(onFulfilled, onRejected); |
return this.promise.then(onFulfilled, onRejected) |
||||
} |
} |
||||
|
|
||||
public catch<TResult = never>( |
public catch<TResult = never>( |
||||
onRejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null |
onRejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null, |
||||
): Promise<T | TResult> { |
): Promise<T | TResult> { |
||||
return this.promise.catch(onRejected); |
return this.promise.catch(onRejected) |
||||
} |
} |
||||
|
|
||||
public finally(onFinally?: (() => void) | null): Promise<T> { |
public finally(onFinally?: (() => void) | null): Promise<T> { |
||||
return this.promise.finally(onFinally); |
return this.promise.finally(onFinally) |
||||
} |
} |
||||
|
|
||||
public cancel(): void { |
public cancel(): void { |
||||
if (this._isResolved || this._isRejected || this._isCancelled) { |
if (this._isResolved || this._isRejected || this._isCancelled) { |
||||
return; |
return |
||||
} |
} |
||||
this._isCancelled = true; |
this._isCancelled = true |
||||
if (this.cancelHandlers.length) { |
if (this.cancelHandlers.length) { |
||||
try { |
try { |
||||
for (const cancelHandler of this.cancelHandlers) { |
for (const cancelHandler of this.cancelHandlers) { |
||||
cancelHandler(); |
cancelHandler() |
||||
} |
} |
||||
} catch (error) { |
} catch (error) { |
||||
console.warn('Cancellation threw an error', error); |
console.warn("Cancellation threw an error", error) |
||||
return; |
return |
||||
} |
} |
||||
} |
} |
||||
this.cancelHandlers.length = 0; |
this.cancelHandlers.length = 0 |
||||
if (this._reject) this._reject(new CancelError('Request aborted')); |
if (this._reject) this._reject(new CancelError("Request aborted")) |
||||
} |
} |
||||
|
|
||||
public get isCancelled(): boolean { |
public get isCancelled(): boolean { |
||||
return this._isCancelled; |
return this._isCancelled |
||||
} |
} |
||||
} |
} |
||||
|
@ -1,58 +1,57 @@ |
|||||
import type { AxiosRequestConfig, AxiosResponse } from 'axios';import type { ApiRequestOptions } from './ApiRequestOptions'; |
import type { AxiosRequestConfig, AxiosResponse } from "axios" |
||||
import type { TResult } from './types'; |
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) => Promise<T> |
||||
|
|
||||
export class Interceptors<T> { |
export class Interceptors<T> { |
||||
_fns: Middleware<T>[]; |
_fns: Middleware<T>[] |
||||
|
|
||||
constructor() { |
constructor() { |
||||
this._fns = []; |
this._fns = [] |
||||
} |
} |
||||
|
|
||||
eject(fn: Middleware<T>) { |
eject(fn: Middleware<T>) { |
||||
const index = this._fns.indexOf(fn); |
const index = this._fns.indexOf(fn) |
||||
if (index !== -1) { |
if (index !== -1) { |
||||
this._fns = [ |
this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)] |
||||
...this._fns.slice(0, index), |
|
||||
...this._fns.slice(index + 1), |
|
||||
]; |
|
||||
} |
} |
||||
} |
} |
||||
|
|
||||
use(fn: Middleware<T>) { |
use(fn: Middleware<T>) { |
||||
this._fns = [...this._fns, fn]; |
this._fns = [...this._fns, fn] |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
export type OpenAPIConfig = { |
export type OpenAPIConfig = { |
||||
BASE: string; |
BASE: string |
||||
CREDENTIALS: 'include' | 'omit' | 'same-origin'; |
CREDENTIALS: "include" | "omit" | "same-origin" |
||||
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; |
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 |
||||
WITH_CREDENTIALS: boolean; |
WITH_CREDENTIALS: boolean |
||||
interceptors: {request: Interceptors<AxiosRequestConfig>; |
interceptors: { |
||||
response: Interceptors<AxiosResponse>;}; |
request: Interceptors<AxiosRequestConfig> |
||||
}; |
response: Interceptors<AxiosResponse> |
||||
|
} |
||||
|
} |
||||
|
|
||||
export const OpenAPI: OpenAPIConfig = { |
export const OpenAPI: OpenAPIConfig = { |
||||
BASE: '', |
BASE: "", |
||||
CREDENTIALS: 'include', |
CREDENTIALS: "include", |
||||
ENCODE_PATH: undefined, |
ENCODE_PATH: undefined, |
||||
HEADERS: undefined, |
HEADERS: undefined, |
||||
PASSWORD: undefined, |
PASSWORD: undefined, |
||||
RESULT: 'body', |
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() }, |
||||
}, |
} |
||||
}; |
|
||||
|
@ -1,12 +1,14 @@ |
|||||
import type { ApiResult } from './ApiResult'; |
import type { ApiResult } from "./ApiResult" |
||||
|
|
||||
export type TResult = 'body' | 'raw'; |
export type TResult = "body" | "raw" |
||||
|
|
||||
export type TApiResponse<T extends TResult, TData> = |
export type TApiResponse<T extends TResult, TData> = Exclude< |
||||
Exclude<T, 'raw'> extends never |
T, |
||||
? ApiResult<TData> |
"raw" |
||||
: ApiResult<TData>['body']; |
> extends never |
||||
|
? ApiResult<TData> |
||||
|
: ApiResult<TData>["body"] |
||||
|
|
||||
export type TConfig<T extends TResult> = { |
export type TConfig<T extends TResult> = { |
||||
_result?: T; |
_result?: T |
||||
}; |
} |
||||
|
@ -1,9 +1,8 @@ |
|||||
|
export { ApiError } from "./core/ApiError" |
||||
|
export { CancelablePromise, CancelError } from "./core/CancelablePromise" |
||||
|
export { OpenAPI } from "./core/OpenAPI" |
||||
|
export type { OpenAPIConfig } from "./core/OpenAPI" |
||||
|
|
||||
export { ApiError } from './core/ApiError'; |
export * from "./models" |
||||
export { CancelablePromise, CancelError } from './core/CancelablePromise'; |
export * from "./schemas" |
||||
export { OpenAPI } from './core/OpenAPI'; |
export * from "./services" |
||||
export type { OpenAPIConfig } from './core/OpenAPI'; |
|
||||
|
|
||||
export * from './models' |
|
||||
export * from './schemas' |
|
||||
export * from './services' |
|
||||
|
@ -1,132 +1,99 @@ |
|||||
export type Body_login_login_access_token = { |
export type Body_login_login_access_token = { |
||||
grant_type?: string | null; |
grant_type?: string | null |
||||
username: string; |
username: string |
||||
password: string; |
password: string |
||||
scope?: string; |
scope?: string |
||||
client_id?: string | null; |
client_id?: string | null |
||||
client_secret?: string | null; |
client_secret?: string | null |
||||
}; |
} |
||||
|
|
||||
|
|
||||
|
|
||||
export type HTTPValidationError = { |
export type HTTPValidationError = { |
||||
detail?: Array<ValidationError>; |
detail?: Array<ValidationError> |
||||
}; |
} |
||||
|
|
||||
|
|
||||
|
|
||||
export type ItemCreate = { |
export type ItemCreate = { |
||||
title: string; |
title: string |
||||
description?: string | null; |
description?: string | null |
||||
}; |
} |
||||
|
|
||||
|
|
||||
|
|
||||
export type ItemPublic = { |
export type ItemPublic = { |
||||
title: string; |
title: string |
||||
description?: string | null; |
description?: string | null |
||||
id: number; |
id: number |
||||
owner_id: number; |
owner_id: number |
||||
}; |
} |
||||
|
|
||||
|
|
||||
|
|
||||
export type ItemUpdate = { |
export type ItemUpdate = { |
||||
title?: string | null; |
title?: string | null |
||||
description?: string | null; |
description?: string | null |
||||
}; |
} |
||||
|
|
||||
|
|
||||
|
|
||||
export type ItemsPublic = { |
export type ItemsPublic = { |
||||
data: Array<ItemPublic>; |
data: Array<ItemPublic> |
||||
count: number; |
count: number |
||||
}; |
} |
||||
|
|
||||
|
|
||||
|
|
||||
export type Message = { |
export type Message = { |
||||
message: string; |
message: string |
||||
}; |
} |
||||
|
|
||||
|
|
||||
|
|
||||
export type NewPassword = { |
export type NewPassword = { |
||||
token: string; |
token: string |
||||
new_password: string; |
new_password: string |
||||
}; |
} |
||||
|
|
||||
|
|
||||
|
|
||||
export type Token = { |
export type Token = { |
||||
access_token: string; |
access_token: string |
||||
token_type?: string; |
token_type?: string |
||||
}; |
} |
||||
|
|
||||
|
|
||||
|
|
||||
export type UpdatePassword = { |
export type UpdatePassword = { |
||||
current_password: string; |
current_password: string |
||||
new_password: string; |
new_password: string |
||||
}; |
} |
||||
|
|
||||
|
|
||||
|
|
||||
export type UserCreate = { |
export type UserCreate = { |
||||
email: string; |
email: string |
||||
is_active?: boolean; |
is_active?: boolean |
||||
is_superuser?: boolean; |
is_superuser?: boolean |
||||
full_name?: string | null; |
full_name?: string | null |
||||
password: string; |
password: string |
||||
}; |
} |
||||
|
|
||||
|
|
||||
|
|
||||
export type UserPublic = { |
export type UserPublic = { |
||||
email: string; |
email: string |
||||
is_active?: boolean; |
is_active?: boolean |
||||
is_superuser?: boolean; |
is_superuser?: boolean |
||||
full_name?: string | null; |
full_name?: string | null |
||||
id: number; |
id: number |
||||
}; |
} |
||||
|
|
||||
|
|
||||
|
|
||||
export type UserRegister = { |
export type UserRegister = { |
||||
email: string; |
email: string |
||||
password: string; |
password: string |
||||
full_name?: string | null; |
full_name?: string | null |
||||
}; |
} |
||||
|
|
||||
|
|
||||
|
|
||||
export type UserUpdate = { |
export type UserUpdate = { |
||||
email?: string | null; |
email?: string | null |
||||
is_active?: boolean; |
is_active?: boolean |
||||
is_superuser?: boolean; |
is_superuser?: boolean |
||||
full_name?: string | null; |
full_name?: string | null |
||||
password?: string | null; |
password?: string | null |
||||
}; |
} |
||||
|
|
||||
|
|
||||
|
|
||||
export type UserUpdateMe = { |
export type UserUpdateMe = { |
||||
full_name?: string | null; |
full_name?: string | null |
||||
email?: string | null; |
email?: string | null |
||||
}; |
} |
||||
|
|
||||
|
|
||||
|
|
||||
export type UsersPublic = { |
export type UsersPublic = { |
||||
data: Array<UserPublic>; |
data: Array<UserPublic> |
||||
count: number; |
count: number |
||||
}; |
} |
||||
|
|
||||
|
|
||||
|
|
||||
export type ValidationError = { |
export type ValidationError = { |
||||
loc: Array<string | number>; |
loc: Array<string | number> |
||||
msg: string; |
msg: string |
||||
type: string; |
type: string |
||||
}; |
} |
||||
|
|
||||
|
@ -1,357 +1,405 @@ |
|||||
export const $Body_login_login_access_token = { |
export const $Body_login_login_access_token = { |
||||
properties: { |
properties: { |
||||
grant_type: { |
grant_type: { |
||||
type: 'any-of', |
type: "any-of", |
||||
contains: [{ |
contains: [ |
||||
type: 'string', |
{ |
||||
pattern: 'password', |
type: "string", |
||||
}, { |
pattern: "password", |
||||
type: 'null', |
}, |
||||
}], |
{ |
||||
}, |
type: "null", |
||||
username: { |
}, |
||||
type: 'string', |
], |
||||
isRequired: true, |
}, |
||||
}, |
username: { |
||||
password: { |
type: "string", |
||||
type: 'string', |
isRequired: true, |
||||
isRequired: true, |
}, |
||||
}, |
password: { |
||||
scope: { |
type: "string", |
||||
type: 'string', |
isRequired: true, |
||||
default: '', |
}, |
||||
}, |
scope: { |
||||
client_id: { |
type: "string", |
||||
type: 'any-of', |
default: "", |
||||
contains: [{ |
}, |
||||
type: 'string', |
client_id: { |
||||
}, { |
type: "any-of", |
||||
type: 'null', |
contains: [ |
||||
}], |
{ |
||||
}, |
type: "string", |
||||
client_secret: { |
}, |
||||
type: 'any-of', |
{ |
||||
contains: [{ |
type: "null", |
||||
type: 'string', |
}, |
||||
}, { |
], |
||||
type: 'null', |
}, |
||||
}], |
client_secret: { |
||||
}, |
type: "any-of", |
||||
}, |
contains: [ |
||||
} as const; |
{ |
||||
|
type: "string", |
||||
|
}, |
||||
|
{ |
||||
|
type: "null", |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
}, |
||||
|
} as const |
||||
|
|
||||
export const $HTTPValidationError = { |
export const $HTTPValidationError = { |
||||
properties: { |
properties: { |
||||
detail: { |
detail: { |
||||
type: 'array', |
type: "array", |
||||
contains: { |
contains: { |
||||
type: 'ValidationError', |
type: "ValidationError", |
||||
}, |
}, |
||||
}, |
}, |
||||
}, |
}, |
||||
} as const; |
} as const |
||||
|
|
||||
export const $ItemCreate = { |
export const $ItemCreate = { |
||||
properties: { |
properties: { |
||||
title: { |
title: { |
||||
type: 'string', |
type: "string", |
||||
isRequired: true, |
isRequired: true, |
||||
}, |
}, |
||||
description: { |
description: { |
||||
type: 'any-of', |
type: "any-of", |
||||
contains: [{ |
contains: [ |
||||
type: 'string', |
{ |
||||
}, { |
type: "string", |
||||
type: 'null', |
}, |
||||
}], |
{ |
||||
}, |
type: "null", |
||||
}, |
}, |
||||
} as const; |
], |
||||
|
}, |
||||
|
}, |
||||
|
} as const |
||||
|
|
||||
export const $ItemPublic = { |
export const $ItemPublic = { |
||||
properties: { |
properties: { |
||||
title: { |
title: { |
||||
type: 'string', |
type: "string", |
||||
isRequired: true, |
isRequired: true, |
||||
}, |
}, |
||||
description: { |
description: { |
||||
type: 'any-of', |
type: "any-of", |
||||
contains: [{ |
contains: [ |
||||
type: 'string', |
{ |
||||
}, { |
type: "string", |
||||
type: 'null', |
}, |
||||
}], |
{ |
||||
}, |
type: "null", |
||||
id: { |
}, |
||||
type: 'number', |
], |
||||
isRequired: true, |
}, |
||||
}, |
id: { |
||||
owner_id: { |
type: "number", |
||||
type: 'number', |
isRequired: true, |
||||
isRequired: true, |
}, |
||||
}, |
owner_id: { |
||||
}, |
type: "number", |
||||
} as const; |
isRequired: true, |
||||
|
}, |
||||
|
}, |
||||
|
} as const |
||||
|
|
||||
export const $ItemUpdate = { |
export const $ItemUpdate = { |
||||
properties: { |
properties: { |
||||
title: { |
title: { |
||||
type: 'any-of', |
type: "any-of", |
||||
contains: [{ |
contains: [ |
||||
type: 'string', |
{ |
||||
}, { |
type: "string", |
||||
type: 'null', |
}, |
||||
}], |
{ |
||||
}, |
type: "null", |
||||
description: { |
}, |
||||
type: 'any-of', |
], |
||||
contains: [{ |
}, |
||||
type: 'string', |
description: { |
||||
}, { |
type: "any-of", |
||||
type: 'null', |
contains: [ |
||||
}], |
{ |
||||
}, |
type: "string", |
||||
}, |
}, |
||||
} as const; |
{ |
||||
|
type: "null", |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
}, |
||||
|
} as const |
||||
|
|
||||
export const $ItemsPublic = { |
export const $ItemsPublic = { |
||||
properties: { |
properties: { |
||||
data: { |
data: { |
||||
type: 'array', |
type: "array", |
||||
contains: { |
contains: { |
||||
type: 'ItemPublic', |
type: "ItemPublic", |
||||
}, |
}, |
||||
isRequired: true, |
isRequired: true, |
||||
}, |
}, |
||||
count: { |
count: { |
||||
type: 'number', |
type: "number", |
||||
isRequired: true, |
isRequired: true, |
||||
}, |
}, |
||||
}, |
}, |
||||
} as const; |
} as const |
||||
|
|
||||
export const $Message = { |
export const $Message = { |
||||
properties: { |
properties: { |
||||
message: { |
message: { |
||||
type: 'string', |
type: "string", |
||||
isRequired: true, |
isRequired: true, |
||||
}, |
}, |
||||
}, |
}, |
||||
} as const; |
} as const |
||||
|
|
||||
export const $NewPassword = { |
export const $NewPassword = { |
||||
properties: { |
properties: { |
||||
token: { |
token: { |
||||
type: 'string', |
type: "string", |
||||
isRequired: true, |
isRequired: true, |
||||
}, |
}, |
||||
new_password: { |
new_password: { |
||||
type: 'string', |
type: "string", |
||||
isRequired: true, |
isRequired: true, |
||||
}, |
}, |
||||
}, |
}, |
||||
} as const; |
} as const |
||||
|
|
||||
export const $Token = { |
export const $Token = { |
||||
properties: { |
properties: { |
||||
access_token: { |
access_token: { |
||||
type: 'string', |
type: "string", |
||||
isRequired: true, |
isRequired: true, |
||||
}, |
}, |
||||
token_type: { |
token_type: { |
||||
type: 'string', |
type: "string", |
||||
default: 'bearer', |
default: "bearer", |
||||
}, |
}, |
||||
}, |
}, |
||||
} as const; |
} as const |
||||
|
|
||||
export const $UpdatePassword = { |
export const $UpdatePassword = { |
||||
properties: { |
properties: { |
||||
current_password: { |
current_password: { |
||||
type: 'string', |
type: "string", |
||||
isRequired: true, |
isRequired: true, |
||||
}, |
}, |
||||
new_password: { |
new_password: { |
||||
type: 'string', |
type: "string", |
||||
isRequired: true, |
isRequired: true, |
||||
}, |
}, |
||||
}, |
}, |
||||
} as const; |
} as const |
||||
|
|
||||
export const $UserCreate = { |
export const $UserCreate = { |
||||
properties: { |
properties: { |
||||
email: { |
email: { |
||||
type: 'string', |
type: "string", |
||||
isRequired: true, |
isRequired: true, |
||||
}, |
}, |
||||
is_active: { |
is_active: { |
||||
type: 'boolean', |
type: "boolean", |
||||
default: true, |
default: true, |
||||
}, |
}, |
||||
is_superuser: { |
is_superuser: { |
||||
type: 'boolean', |
type: "boolean", |
||||
default: false, |
default: false, |
||||
}, |
}, |
||||
full_name: { |
full_name: { |
||||
type: 'any-of', |
type: "any-of", |
||||
contains: [{ |
contains: [ |
||||
type: 'string', |
{ |
||||
}, { |
type: "string", |
||||
type: 'null', |
}, |
||||
}], |
{ |
||||
}, |
type: "null", |
||||
password: { |
}, |
||||
type: 'string', |
], |
||||
isRequired: true, |
}, |
||||
}, |
password: { |
||||
}, |
type: "string", |
||||
} as const; |
isRequired: true, |
||||
|
}, |
||||
|
}, |
||||
|
} as const |
||||
|
|
||||
export const $UserPublic = { |
export const $UserPublic = { |
||||
properties: { |
properties: { |
||||
email: { |
email: { |
||||
type: 'string', |
type: "string", |
||||
isRequired: true, |
isRequired: true, |
||||
}, |
}, |
||||
is_active: { |
is_active: { |
||||
type: 'boolean', |
type: "boolean", |
||||
default: true, |
default: true, |
||||
}, |
}, |
||||
is_superuser: { |
is_superuser: { |
||||
type: 'boolean', |
type: "boolean", |
||||
default: false, |
default: false, |
||||
}, |
}, |
||||
full_name: { |
full_name: { |
||||
type: 'any-of', |
type: "any-of", |
||||
contains: [{ |
contains: [ |
||||
type: 'string', |
{ |
||||
}, { |
type: "string", |
||||
type: 'null', |
}, |
||||
}], |
{ |
||||
}, |
type: "null", |
||||
id: { |
}, |
||||
type: 'number', |
], |
||||
isRequired: true, |
}, |
||||
}, |
id: { |
||||
}, |
type: "number", |
||||
} as const; |
isRequired: true, |
||||
|
}, |
||||
|
}, |
||||
|
} as const |
||||
|
|
||||
export const $UserRegister = { |
export const $UserRegister = { |
||||
properties: { |
properties: { |
||||
email: { |
email: { |
||||
type: 'string', |
type: "string", |
||||
isRequired: true, |
isRequired: true, |
||||
}, |
}, |
||||
password: { |
password: { |
||||
type: 'string', |
type: "string", |
||||
isRequired: true, |
isRequired: true, |
||||
}, |
}, |
||||
full_name: { |
full_name: { |
||||
type: 'any-of', |
type: "any-of", |
||||
contains: [{ |
contains: [ |
||||
type: 'string', |
{ |
||||
}, { |
type: "string", |
||||
type: 'null', |
}, |
||||
}], |
{ |
||||
}, |
type: "null", |
||||
}, |
}, |
||||
} as const; |
], |
||||
|
}, |
||||
|
}, |
||||
|
} as const |
||||
|
|
||||
export const $UserUpdate = { |
export const $UserUpdate = { |
||||
properties: { |
properties: { |
||||
email: { |
email: { |
||||
type: 'any-of', |
type: "any-of", |
||||
contains: [{ |
contains: [ |
||||
type: 'string', |
{ |
||||
}, { |
type: "string", |
||||
type: 'null', |
}, |
||||
}], |
{ |
||||
}, |
type: "null", |
||||
is_active: { |
}, |
||||
type: 'boolean', |
], |
||||
default: true, |
}, |
||||
}, |
is_active: { |
||||
is_superuser: { |
type: "boolean", |
||||
type: 'boolean', |
default: true, |
||||
default: false, |
}, |
||||
}, |
is_superuser: { |
||||
full_name: { |
type: "boolean", |
||||
type: 'any-of', |
default: false, |
||||
contains: [{ |
}, |
||||
type: 'string', |
full_name: { |
||||
}, { |
type: "any-of", |
||||
type: 'null', |
contains: [ |
||||
}], |
{ |
||||
}, |
type: "string", |
||||
password: { |
}, |
||||
type: 'any-of', |
{ |
||||
contains: [{ |
type: "null", |
||||
type: 'string', |
}, |
||||
}, { |
], |
||||
type: 'null', |
}, |
||||
}], |
password: { |
||||
}, |
type: "any-of", |
||||
}, |
contains: [ |
||||
} as const; |
{ |
||||
|
type: "string", |
||||
|
}, |
||||
|
{ |
||||
|
type: "null", |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
}, |
||||
|
} as const |
||||
|
|
||||
export const $UserUpdateMe = { |
export const $UserUpdateMe = { |
||||
properties: { |
properties: { |
||||
full_name: { |
full_name: { |
||||
type: 'any-of', |
type: "any-of", |
||||
contains: [{ |
contains: [ |
||||
type: 'string', |
{ |
||||
}, { |
type: "string", |
||||
type: 'null', |
}, |
||||
}], |
{ |
||||
}, |
type: "null", |
||||
email: { |
}, |
||||
type: 'any-of', |
], |
||||
contains: [{ |
}, |
||||
type: 'string', |
email: { |
||||
}, { |
type: "any-of", |
||||
type: 'null', |
contains: [ |
||||
}], |
{ |
||||
}, |
type: "string", |
||||
}, |
}, |
||||
} as const; |
{ |
||||
|
type: "null", |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
}, |
||||
|
} as const |
||||
|
|
||||
export const $UsersPublic = { |
export const $UsersPublic = { |
||||
properties: { |
properties: { |
||||
data: { |
data: { |
||||
type: 'array', |
type: "array", |
||||
contains: { |
contains: { |
||||
type: 'UserPublic', |
type: "UserPublic", |
||||
}, |
}, |
||||
isRequired: true, |
isRequired: true, |
||||
}, |
}, |
||||
count: { |
count: { |
||||
type: 'number', |
type: "number", |
||||
isRequired: true, |
isRequired: true, |
||||
}, |
}, |
||||
}, |
}, |
||||
} as const; |
} as const |
||||
|
|
||||
export const $ValidationError = { |
export const $ValidationError = { |
||||
properties: { |
properties: { |
||||
loc: { |
loc: { |
||||
type: 'array', |
type: "array", |
||||
contains: { |
contains: { |
||||
type: 'any-of', |
type: "any-of", |
||||
contains: [{ |
contains: [ |
||||
type: 'string', |
{ |
||||
}, { |
type: "string", |
||||
type: 'number', |
}, |
||||
}], |
{ |
||||
}, |
type: "number", |
||||
isRequired: true, |
}, |
||||
}, |
], |
||||
msg: { |
}, |
||||
type: 'string', |
isRequired: true, |
||||
isRequired: true, |
}, |
||||
}, |
msg: { |
||||
type: { |
type: "string", |
||||
type: 'string', |
isRequired: true, |
||||
isRequired: true, |
}, |
||||
}, |
type: { |
||||
}, |
type: "string", |
||||
} as const; |
isRequired: true, |
||||
|
}, |
||||
|
}, |
||||
|
} as const |
||||
|
File diff suppressed because it is too large
Loading…
Reference in new issue