120 lines
5.6 KiB
TypeScript
120 lines
5.6 KiB
TypeScript
|
|
// This file is auto-generated by @hey-api/openapi-ts
|
||
|
|
|
||
|
|
import type { Client, Options as Options2, TDataShape } from './client';
|
||
|
|
import { client } from './client.gen';
|
||
|
|
import type { AnalyzePosApiPosPostData, AnalyzePosApiPosPostErrors, AnalyzePosApiPosPostResponses, CreateGenerationJobApiGeneratePostData, CreateGenerationJobApiGeneratePostErrors, CreateGenerationJobApiGeneratePostResponses, GetJobApiJobsJobIdGetData, GetJobApiJobsJobIdGetErrors, GetJobApiJobsJobIdGetResponses, GetJobsApiJobsGetData, GetJobsApiJobsGetResponses, GetMediaFileMediaFilenameGetData, GetMediaFileMediaFilenameGetErrors, GetMediaFileMediaFilenameGetResponses, HealthHealthGetData, HealthHealthGetResponses, LoginAuthLoginPostData, LoginAuthLoginPostErrors, LoginAuthLoginPostResponses, RegenerateAudioApiJobsJobIdRegenerateAudioPostData, RegenerateAudioApiJobsJobIdRegenerateAudioPostErrors, RegenerateAudioApiJobsJobIdRegenerateAudioPostResponses, RegisterAuthRegisterPostData, RegisterAuthRegisterPostErrors, RegisterAuthRegisterPostResponses, TranslateTextApiTranslateGetData, TranslateTextApiTranslateGetErrors, TranslateTextApiTranslateGetResponses } from './types.gen';
|
||
|
|
|
||
|
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
|
||
|
|
/**
|
||
|
|
* You can provide a client instance returned by `createClient()` instead of
|
||
|
|
* individual options. This might be also useful if you want to implement a
|
||
|
|
* custom client.
|
||
|
|
*/
|
||
|
|
client?: Client;
|
||
|
|
/**
|
||
|
|
* You can pass arbitrary values through the `meta` object. This can be
|
||
|
|
* used to access values that aren't defined as part of the SDK function.
|
||
|
|
*/
|
||
|
|
meta?: Record<string, unknown>;
|
||
|
|
};
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Analyze Pos
|
||
|
|
*/
|
||
|
|
export const analyzePosApiPosPost = <ThrowOnError extends boolean = false>(options: Options<AnalyzePosApiPosPostData, ThrowOnError>) => (options.client ?? client).post<AnalyzePosApiPosPostResponses, AnalyzePosApiPosPostErrors, ThrowOnError>({
|
||
|
|
security: [{ scheme: 'bearer', type: 'http' }],
|
||
|
|
url: '/api/pos/',
|
||
|
|
...options,
|
||
|
|
headers: {
|
||
|
|
'Content-Type': 'application/json',
|
||
|
|
...options.headers
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Translate text to a target language
|
||
|
|
*/
|
||
|
|
export const translateTextApiTranslateGet = <ThrowOnError extends boolean = false>(options: Options<TranslateTextApiTranslateGetData, ThrowOnError>) => (options.client ?? client).get<TranslateTextApiTranslateGetResponses, TranslateTextApiTranslateGetErrors, ThrowOnError>({
|
||
|
|
security: [{ scheme: 'bearer', type: 'http' }],
|
||
|
|
url: '/api/translate',
|
||
|
|
...options
|
||
|
|
});
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Create Generation Job
|
||
|
|
*/
|
||
|
|
export const createGenerationJobApiGeneratePost = <ThrowOnError extends boolean = false>(options: Options<CreateGenerationJobApiGeneratePostData, ThrowOnError>) => (options.client ?? client).post<CreateGenerationJobApiGeneratePostResponses, CreateGenerationJobApiGeneratePostErrors, ThrowOnError>({
|
||
|
|
security: [{ scheme: 'bearer', type: 'http' }],
|
||
|
|
url: '/api/generate',
|
||
|
|
...options,
|
||
|
|
headers: {
|
||
|
|
'Content-Type': 'application/json',
|
||
|
|
...options.headers
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get Jobs
|
||
|
|
*/
|
||
|
|
export const getJobsApiJobsGet = <ThrowOnError extends boolean = false>(options?: Options<GetJobsApiJobsGetData, ThrowOnError>) => (options?.client ?? client).get<GetJobsApiJobsGetResponses, unknown, ThrowOnError>({
|
||
|
|
security: [{ scheme: 'bearer', type: 'http' }],
|
||
|
|
url: '/api/jobs/',
|
||
|
|
...options
|
||
|
|
});
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get Job
|
||
|
|
*/
|
||
|
|
export const getJobApiJobsJobIdGet = <ThrowOnError extends boolean = false>(options: Options<GetJobApiJobsJobIdGetData, ThrowOnError>) => (options.client ?? client).get<GetJobApiJobsJobIdGetResponses, GetJobApiJobsJobIdGetErrors, ThrowOnError>({
|
||
|
|
security: [{ scheme: 'bearer', type: 'http' }],
|
||
|
|
url: '/api/jobs/{job_id}',
|
||
|
|
...options
|
||
|
|
});
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Regenerate Audio
|
||
|
|
*/
|
||
|
|
export const regenerateAudioApiJobsJobIdRegenerateAudioPost = <ThrowOnError extends boolean = false>(options: Options<RegenerateAudioApiJobsJobIdRegenerateAudioPostData, ThrowOnError>) => (options.client ?? client).post<RegenerateAudioApiJobsJobIdRegenerateAudioPostResponses, RegenerateAudioApiJobsJobIdRegenerateAudioPostErrors, ThrowOnError>({
|
||
|
|
security: [{ scheme: 'bearer', type: 'http' }],
|
||
|
|
url: '/api/jobs/{job_id}/regenerate-audio',
|
||
|
|
...options
|
||
|
|
});
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Register
|
||
|
|
*/
|
||
|
|
export const registerAuthRegisterPost = <ThrowOnError extends boolean = false>(options: Options<RegisterAuthRegisterPostData, ThrowOnError>) => (options.client ?? client).post<RegisterAuthRegisterPostResponses, RegisterAuthRegisterPostErrors, ThrowOnError>({
|
||
|
|
url: '/auth/register',
|
||
|
|
...options,
|
||
|
|
headers: {
|
||
|
|
'Content-Type': 'application/json',
|
||
|
|
...options.headers
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Login
|
||
|
|
*/
|
||
|
|
export const loginAuthLoginPost = <ThrowOnError extends boolean = false>(options: Options<LoginAuthLoginPostData, ThrowOnError>) => (options.client ?? client).post<LoginAuthLoginPostResponses, LoginAuthLoginPostErrors, ThrowOnError>({
|
||
|
|
url: '/auth/login',
|
||
|
|
...options,
|
||
|
|
headers: {
|
||
|
|
'Content-Type': 'application/json',
|
||
|
|
...options.headers
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get Media File
|
||
|
|
*/
|
||
|
|
export const getMediaFileMediaFilenameGet = <ThrowOnError extends boolean = false>(options: Options<GetMediaFileMediaFilenameGetData, ThrowOnError>) => (options.client ?? client).get<GetMediaFileMediaFilenameGetResponses, GetMediaFileMediaFilenameGetErrors, ThrowOnError>({
|
||
|
|
security: [{ scheme: 'bearer', type: 'http' }],
|
||
|
|
url: '/media/{filename}',
|
||
|
|
...options
|
||
|
|
});
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Health
|
||
|
|
*/
|
||
|
|
export const healthHealthGet = <ThrowOnError extends boolean = false>(options?: Options<HealthHealthGetData, ThrowOnError>) => (options?.client ?? client).get<HealthHealthGetResponses, unknown, ThrowOnError>({ url: '/health', ...options });
|