Use detail endpoint
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export { getSearch, type Options } from './sdk.gen';
|
||||
export type { ClientOptions, GetSearchData, GetSearchResponse, GetSearchResponses, SearchEntryDto, SearchResponseDto } from './types.gen';
|
||||
export { getDetail, getListKodik, getSearchKodik, type Options } from './sdk.gen';
|
||||
export type { CharacterDto, ClientOptions, ContentDetailEntry, ContentSearchEntry, GetDetailData, GetDetailResponse, GetDetailResponses, GetListKodikData, GetListKodikResponse, GetListKodikResponses, GetSearchKodikData, GetSearchKodikResponse, GetSearchKodikResponses, RelatedDto, SearchEntries, TranslationDto, Uuid } from './types.gen';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import type { Client, Composable, Options as Options2, TDataShape } from './client';
|
||||
import { client } from './client.gen';
|
||||
import type { GetSearchData, GetSearchResponse } from './types.gen';
|
||||
import type { GetDetailData, GetDetailResponse, GetListKodikData, GetListKodikResponse, GetSearchKodikData, GetSearchKodikResponse } from './types.gen';
|
||||
|
||||
export type Options<TComposable extends Composable = '$fetch', TData extends TDataShape = TDataShape, ResT = unknown, DefaultT = undefined> = Options2<TComposable, TData, ResT, DefaultT> & {
|
||||
/**
|
||||
@@ -19,6 +19,16 @@ export type Options<TComposable extends Composable = '$fetch', TData extends TDa
|
||||
};
|
||||
|
||||
/**
|
||||
* Search
|
||||
* Detail
|
||||
*/
|
||||
export const getSearch = <TComposable extends Composable = '$fetch', DefaultT extends GetSearchResponse = GetSearchResponse>(options: Options<TComposable, GetSearchData, GetSearchResponse, DefaultT>) => (options.client ?? client).get<TComposable, GetSearchResponse | DefaultT, unknown, DefaultT>({ url: '/search', ...options });
|
||||
export const getDetail = <TComposable extends Composable = '$fetch', DefaultT extends GetDetailResponse = GetDetailResponse>(options: Options<TComposable, GetDetailData, GetDetailResponse, DefaultT>) => (options.client ?? client).get<TComposable, GetDetailResponse | DefaultT, unknown, DefaultT>({ url: '/detail', ...options });
|
||||
|
||||
/**
|
||||
* List
|
||||
*/
|
||||
export const getListKodik = <TComposable extends Composable = '$fetch', DefaultT extends GetListKodikResponse = GetListKodikResponse>(options: Options<TComposable, GetListKodikData, GetListKodikResponse, DefaultT>) => (options.client ?? client).get<TComposable, GetListKodikResponse | DefaultT, unknown, DefaultT>({ url: '/list/kodik', ...options });
|
||||
|
||||
/**
|
||||
* Search Kodik
|
||||
*/
|
||||
export const getSearchKodik = <TComposable extends Composable = '$fetch', DefaultT extends GetSearchKodikResponse = GetSearchKodikResponse>(options: Options<TComposable, GetSearchKodikData, GetSearchKodikResponse, DefaultT>) => (options.client ?? client).get<TComposable, GetSearchKodikResponse | DefaultT, unknown, DefaultT>({ url: '/search/kodik', ...options });
|
||||
|
||||
@@ -4,7 +4,34 @@ export type ClientOptions = {
|
||||
baseURL: 'http://localhost:8080' | (string & {});
|
||||
};
|
||||
|
||||
export type SearchEntryDto = {
|
||||
export type CharacterDto = {
|
||||
id?: string;
|
||||
type?: string;
|
||||
name?: string;
|
||||
posterUrl?: string;
|
||||
};
|
||||
|
||||
export type ContentDetailEntry = {
|
||||
title?: string;
|
||||
posterUrl?: string;
|
||||
description?: string;
|
||||
kind?: string;
|
||||
episodes?: number;
|
||||
duration?: number;
|
||||
status?: string;
|
||||
releasedOn?: string;
|
||||
translations?: Array<TranslationDto>;
|
||||
genres?: Array<string>;
|
||||
origin?: string;
|
||||
rating?: string;
|
||||
producers?: Array<string>;
|
||||
related?: Array<RelatedDto>;
|
||||
characters?: Array<CharacterDto>;
|
||||
studios?: Array<string>;
|
||||
directors?: Array<string>;
|
||||
};
|
||||
|
||||
export type ContentSearchEntry = {
|
||||
id?: string;
|
||||
posterURLs?: Array<string>;
|
||||
title?: string;
|
||||
@@ -17,24 +44,73 @@ export type SearchEntryDto = {
|
||||
durationMin?: number;
|
||||
};
|
||||
|
||||
export type SearchResponseDto = {
|
||||
result?: Array<SearchEntryDto>;
|
||||
export type RelatedDto = {
|
||||
id?: string;
|
||||
type?: string;
|
||||
name?: string;
|
||||
posterUrl?: string;
|
||||
};
|
||||
|
||||
export type GetSearchData = {
|
||||
export type SearchEntries = {
|
||||
result?: Array<ContentSearchEntry>;
|
||||
};
|
||||
|
||||
export type TranslationDto = {
|
||||
id?: number;
|
||||
title?: string;
|
||||
type?: string;
|
||||
};
|
||||
|
||||
export type Uuid = string;
|
||||
|
||||
export type GetDetailData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
query?: {
|
||||
id?: Uuid;
|
||||
};
|
||||
url: '/detail';
|
||||
};
|
||||
|
||||
export type GetDetailResponses = {
|
||||
/**
|
||||
* OK
|
||||
*/
|
||||
200: ContentDetailEntry;
|
||||
};
|
||||
|
||||
export type GetDetailResponse = GetDetailResponses[keyof GetDetailResponses];
|
||||
|
||||
export type GetListKodikData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
query?: never;
|
||||
url: '/list/kodik';
|
||||
};
|
||||
|
||||
export type GetListKodikResponses = {
|
||||
/**
|
||||
* OK
|
||||
*/
|
||||
200: SearchEntries;
|
||||
};
|
||||
|
||||
export type GetListKodikResponse = GetListKodikResponses[keyof GetListKodikResponses];
|
||||
|
||||
export type GetSearchKodikData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
query?: {
|
||||
title?: string;
|
||||
};
|
||||
url: '/search';
|
||||
url: '/search/kodik';
|
||||
};
|
||||
|
||||
export type GetSearchResponses = {
|
||||
export type GetSearchKodikResponses = {
|
||||
/**
|
||||
* OK
|
||||
*/
|
||||
200: SearchResponseDto;
|
||||
200: SearchEntries;
|
||||
};
|
||||
|
||||
export type GetSearchResponse = GetSearchResponses[keyof GetSearchResponses];
|
||||
export type GetSearchKodikResponse = GetSearchKodikResponses[keyof GetSearchKodikResponses];
|
||||
|
||||
Reference in New Issue
Block a user