Rename "doRequestNew" to "doRequest"

This commit is contained in:
schroda
2023-10-15 21:01:46 +02:00
parent b3a432ed2e
commit 5263a1102c

View File

@@ -355,7 +355,7 @@ export class RequestManager {
maxPage: number, maxPage: number,
signal: AbortSignal, signal: AbortSignal,
): Promise<void> { ): Promise<void> {
const { response: revalidationRequest } = this.doRequestNew( const { response: revalidationRequest } = this.doRequest(
GQLMethod.MUTATION, GQLMethod.MUTATION,
GET_SOURCE_MANGAS_FETCH, GET_SOURCE_MANGAS_FETCH,
getVariablesFor(pageToRevalidate), getVariablesFor(pageToRevalidate),
@@ -497,7 +497,7 @@ export class RequestManager {
await revalidate(newPage, abortRequest, signal); await revalidate(newPage, abortRequest, signal);
} }
const { response: request } = this.doRequestNew<Data, Variables>( const { response: request } = this.doRequest<Data, Variables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
documentNode, documentNode,
getVariablesFor(newPage), getVariablesFor(newPage),
@@ -648,42 +648,42 @@ export class RequestManager {
return `${this.getValidUrlFor(imageUrl, apiVersion)}${useCacheQuery}`; return `${this.getValidUrlFor(imageUrl, apiVersion)}${useCacheQuery}`;
} }
private doRequestNew<Data, Variables extends OperationVariables = OperationVariables>( private doRequest<Data, Variables extends OperationVariables = OperationVariables>(
method: GQLMethod.QUERY, method: GQLMethod.QUERY,
operation: DocumentNode | TypedDocumentNode<Data, Variables>, operation: DocumentNode | TypedDocumentNode<Data, Variables>,
variables: Variables | undefined, variables: Variables | undefined,
options?: QueryOptions<Variables, Data>, options?: QueryOptions<Variables, Data>,
): AbortabaleApolloQueryResponse<Data>; ): AbortabaleApolloQueryResponse<Data>;
private doRequestNew<Data, Variables extends OperationVariables = OperationVariables>( private doRequest<Data, Variables extends OperationVariables = OperationVariables>(
method: GQLMethod.USE_QUERY, method: GQLMethod.USE_QUERY,
operation: DocumentNode | TypedDocumentNode<Data, Variables>, operation: DocumentNode | TypedDocumentNode<Data, Variables>,
variables: Variables | undefined, variables: Variables | undefined,
options?: QueryHookOptions<Data, Variables>, options?: QueryHookOptions<Data, Variables>,
): AbortableApolloUseQueryResponse<Data, Variables>; ): AbortableApolloUseQueryResponse<Data, Variables>;
private doRequestNew<Data, Variables extends OperationVariables = OperationVariables>( private doRequest<Data, Variables extends OperationVariables = OperationVariables>(
method: GQLMethod.USE_MUTATION, method: GQLMethod.USE_MUTATION,
operation: DocumentNode | TypedDocumentNode<Data, Variables>, operation: DocumentNode | TypedDocumentNode<Data, Variables>,
variables: Variables | undefined, variables: Variables | undefined,
options?: MutationHookOptions<Data, Variables>, options?: MutationHookOptions<Data, Variables>,
): AbortableApolloUseMutationResponse<Data, Variables>; ): AbortableApolloUseMutationResponse<Data, Variables>;
private doRequestNew<Data, Variables extends OperationVariables = OperationVariables>( private doRequest<Data, Variables extends OperationVariables = OperationVariables>(
method: GQLMethod.MUTATION, method: GQLMethod.MUTATION,
operation: DocumentNode | TypedDocumentNode<Data, Variables>, operation: DocumentNode | TypedDocumentNode<Data, Variables>,
variables: Variables | undefined, variables: Variables | undefined,
options?: MutationOptions<Data, Variables>, options?: MutationOptions<Data, Variables>,
): AbortableApolloMutationResponse<Data>; ): AbortableApolloMutationResponse<Data>;
private doRequestNew<Data, Variables extends OperationVariables = OperationVariables>( private doRequest<Data, Variables extends OperationVariables = OperationVariables>(
method: GQLMethod.USE_SUBSCRIPTION, method: GQLMethod.USE_SUBSCRIPTION,
operation: DocumentNode | TypedDocumentNode<Data, Variables>, operation: DocumentNode | TypedDocumentNode<Data, Variables>,
variables: Variables | undefined, variables: Variables | undefined,
options?: SubscriptionHookOptions<Data, Variables>, options?: SubscriptionHookOptions<Data, Variables>,
): SubscriptionResult<Data, Variables>; ): SubscriptionResult<Data, Variables>;
private doRequestNew<Data, Variables extends OperationVariables = OperationVariables>( private doRequest<Data, Variables extends OperationVariables = OperationVariables>(
method: GQLMethod, method: GQLMethod,
operation: DocumentNode | TypedDocumentNode<Data, Variables>, operation: DocumentNode | TypedDocumentNode<Data, Variables>,
variables: Variables | undefined, variables: Variables | undefined,
@@ -779,7 +779,7 @@ export class RequestManager {
public useGetGlobalMeta( public useGetGlobalMeta(
options?: QueryHookOptions<GetGlobalMetadatasQuery, GetGlobalMetadatasQueryVariables>, options?: QueryHookOptions<GetGlobalMetadatasQuery, GetGlobalMetadatasQueryVariables>,
): AbortableApolloUseQueryResponse<GetGlobalMetadatasQuery, GetGlobalMetadatasQueryVariables> { ): AbortableApolloUseQueryResponse<GetGlobalMetadatasQuery, GetGlobalMetadatasQueryVariables> {
return this.doRequestNew(GQLMethod.USE_QUERY, GET_GLOBAL_METADATAS, {}, options); return this.doRequest(GQLMethod.USE_QUERY, GET_GLOBAL_METADATAS, {}, options);
} }
public setGlobalMetadata( public setGlobalMetadata(
@@ -787,7 +787,7 @@ export class RequestManager {
value: any, value: any,
options?: MutationOptions<SetGlobalMetadataMutation, SetGlobalMetadataMutationVariables>, options?: MutationOptions<SetGlobalMetadataMutation, SetGlobalMetadataMutationVariables>,
): AbortableApolloMutationResponse<SetGlobalMetadataMutation> { ): AbortableApolloMutationResponse<SetGlobalMetadataMutation> {
return this.doRequestNew<SetGlobalMetadataMutation, SetGlobalMetadataMutationVariables>( return this.doRequest<SetGlobalMetadataMutation, SetGlobalMetadataMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
SET_GLOBAL_METADATA, SET_GLOBAL_METADATA,
{ input: { meta: { key, value: `${value}` } } }, { input: { meta: { key, value: `${value}` } } },
@@ -798,32 +798,32 @@ export class RequestManager {
public useGetAbout( public useGetAbout(
options?: QueryHookOptions<GetAboutQuery, GetAboutQueryVariables>, options?: QueryHookOptions<GetAboutQuery, GetAboutQueryVariables>,
): AbortableApolloUseQueryResponse<GetAboutQuery, GetAboutQueryVariables> { ): AbortableApolloUseQueryResponse<GetAboutQuery, GetAboutQueryVariables> {
return this.doRequestNew(GQLMethod.USE_QUERY, GET_ABOUT, {}, options); return this.doRequest(GQLMethod.USE_QUERY, GET_ABOUT, {}, options);
} }
public useCheckForUpdate( public useCheckForUpdate(
options?: QueryHookOptions<CheckForServerUpdatesQuery, CheckForServerUpdatesQueryVariables>, options?: QueryHookOptions<CheckForServerUpdatesQuery, CheckForServerUpdatesQueryVariables>,
): AbortableApolloUseQueryResponse<CheckForServerUpdatesQuery, CheckForServerUpdatesQueryVariables> { ): AbortableApolloUseQueryResponse<CheckForServerUpdatesQuery, CheckForServerUpdatesQueryVariables> {
return this.doRequestNew(GQLMethod.USE_QUERY, CHECK_FOR_SERVER_UPDATES, {}, options); return this.doRequest(GQLMethod.USE_QUERY, CHECK_FOR_SERVER_UPDATES, {}, options);
} }
public useGetExtensionList( public useGetExtensionList(
options?: QueryHookOptions<GetExtensionsQuery, GetExtensionsQueryVariables>, options?: QueryHookOptions<GetExtensionsQuery, GetExtensionsQueryVariables>,
): AbortableApolloUseQueryResponse<GetExtensionsQuery, GetExtensionsQueryVariables> { ): AbortableApolloUseQueryResponse<GetExtensionsQuery, GetExtensionsQueryVariables> {
return this.doRequestNew(GQLMethod.USE_QUERY, GET_EXTENSIONS, {}, options); return this.doRequest(GQLMethod.USE_QUERY, GET_EXTENSIONS, {}, options);
} }
public useExtensionListFetch( public useExtensionListFetch(
options?: MutationHookOptions<GetExtensionsFetchMutation, GetExtensionsFetchMutationVariables>, options?: MutationHookOptions<GetExtensionsFetchMutation, GetExtensionsFetchMutationVariables>,
): AbortableApolloUseMutationResponse<GetExtensionsFetchMutation, GetExtensionsFetchMutationVariables> { ): AbortableApolloUseMutationResponse<GetExtensionsFetchMutation, GetExtensionsFetchMutationVariables> {
return this.doRequestNew(GQLMethod.USE_MUTATION, GET_EXTENSIONS_FETCH, {}, options); return this.doRequest(GQLMethod.USE_MUTATION, GET_EXTENSIONS_FETCH, {}, options);
} }
public installExternalExtension( public installExternalExtension(
extensionFile: File, extensionFile: File,
options?: MutationOptions<InstallExternalExtensionMutation, InstallExternalExtensionMutationVariables>, options?: MutationOptions<InstallExternalExtensionMutation, InstallExternalExtensionMutationVariables>,
): AbortableApolloMutationResponse<InstallExternalExtensionMutation> { ): AbortableApolloMutationResponse<InstallExternalExtensionMutation> {
return this.doRequestNew<InstallExternalExtensionMutation, InstallExternalExtensionMutationVariables>( return this.doRequest<InstallExternalExtensionMutation, InstallExternalExtensionMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
INSTALL_EXTERNAL_EXTENSION, INSTALL_EXTERNAL_EXTENSION,
{ file: extensionFile }, { file: extensionFile },
@@ -836,7 +836,7 @@ export class RequestManager {
patch: UpdateExtensionPatchInput, patch: UpdateExtensionPatchInput,
options?: MutationOptions<UpdateExtensionMutation, UpdateExtensionMutationVariables>, options?: MutationOptions<UpdateExtensionMutation, UpdateExtensionMutationVariables>,
): AbortableApolloMutationResponse<UpdateExtensionMutation> { ): AbortableApolloMutationResponse<UpdateExtensionMutation> {
return this.doRequestNew<UpdateExtensionMutation, UpdateExtensionMutationVariables>( return this.doRequest<UpdateExtensionMutation, UpdateExtensionMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
UPDATE_EXTENSION, UPDATE_EXTENSION,
{ input: { id, patch } }, { input: { id, patch } },
@@ -851,14 +851,14 @@ export class RequestManager {
public useGetSourceList( public useGetSourceList(
options?: QueryHookOptions<GetSourcesQuery, GetSourcesQueryVariables>, options?: QueryHookOptions<GetSourcesQuery, GetSourcesQueryVariables>,
): AbortableApolloUseQueryResponse<GetSourcesQuery, GetSourcesQueryVariables> { ): AbortableApolloUseQueryResponse<GetSourcesQuery, GetSourcesQueryVariables> {
return this.doRequestNew(GQLMethod.USE_QUERY, GET_SOURCES, {}, options); return this.doRequest(GQLMethod.USE_QUERY, GET_SOURCES, {}, options);
} }
public useGetSource( public useGetSource(
id: string, id: string,
options?: QueryHookOptions<GetSourceQuery, GetSourceQueryVariables>, options?: QueryHookOptions<GetSourceQuery, GetSourceQueryVariables>,
): AbortableApolloUseQueryResponse<GetSourceQuery, GetSourceQueryVariables> { ): AbortableApolloUseQueryResponse<GetSourceQuery, GetSourceQueryVariables> {
return this.doRequestNew(GQLMethod.USE_QUERY, GET_SOURCE, { id }, options); return this.doRequest(GQLMethod.USE_QUERY, GET_SOURCE, { id }, options);
} }
public useGetSourceMangas( public useGetSourceMangas(
@@ -1073,7 +1073,7 @@ export class RequestManager {
change: SourcePreferenceChangeInput, change: SourcePreferenceChangeInput,
options?: MutationOptions<UpdateSourcePreferencesMutation, UpdateSourcePreferencesMutationVariables>, options?: MutationOptions<UpdateSourcePreferencesMutation, UpdateSourcePreferencesMutationVariables>,
): AbortableApolloMutationResponse<UpdateSourcePreferencesMutation> { ): AbortableApolloMutationResponse<UpdateSourcePreferencesMutation> {
return this.doRequestNew( return this.doRequest(
GQLMethod.MUTATION, GQLMethod.MUTATION,
UPDATE_SOURCE_PREFERENCES, UPDATE_SOURCE_PREFERENCES,
{ input: { source, change } }, { input: { source, change } },
@@ -1105,14 +1105,14 @@ export class RequestManager {
mangaId: number | string, mangaId: number | string,
options?: QueryHookOptions<GetMangaQuery, GetMangaQueryVariables>, options?: QueryHookOptions<GetMangaQuery, GetMangaQueryVariables>,
): AbortableApolloUseQueryResponse<GetMangaQuery, GetMangaQueryVariables> { ): AbortableApolloUseQueryResponse<GetMangaQuery, GetMangaQueryVariables> {
return this.doRequestNew(GQLMethod.USE_QUERY, GET_MANGA, { id: Number(mangaId) }, options); return this.doRequest(GQLMethod.USE_QUERY, GET_MANGA, { id: Number(mangaId) }, options);
} }
public getMangaFetch( public getMangaFetch(
mangaId: number | string, mangaId: number | string,
options?: MutationOptions<GetMangaFetchMutation, GetMangaFetchMutationVariables>, options?: MutationOptions<GetMangaFetchMutation, GetMangaFetchMutationVariables>,
): AbortableApolloMutationResponse<GetMangaFetchMutation> { ): AbortableApolloMutationResponse<GetMangaFetchMutation> {
return this.doRequestNew<GetMangaFetchMutation, GetMangaFetchMutationVariables>( return this.doRequest<GetMangaFetchMutation, GetMangaFetchMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
GET_MANGA_FETCH, GET_MANGA_FETCH,
{ {
@@ -1134,7 +1134,7 @@ export class RequestManager {
public useUpdateMangaCategories( public useUpdateMangaCategories(
options?: MutationHookOptions<UpdateMangaCategoriesMutation, UpdateMangaCategoriesMutationVariables>, options?: MutationHookOptions<UpdateMangaCategoriesMutation, UpdateMangaCategoriesMutationVariables>,
): AbortableApolloUseMutationResponse<UpdateMangaCategoriesMutation, UpdateMangaCategoriesMutationVariables> { ): AbortableApolloUseMutationResponse<UpdateMangaCategoriesMutation, UpdateMangaCategoriesMutationVariables> {
return this.doRequestNew(GQLMethod.USE_MUTATION, UPDATE_MANGA_CATEGORIES, undefined, { return this.doRequest(GQLMethod.USE_MUTATION, UPDATE_MANGA_CATEGORIES, undefined, {
refetchQueries: [GET_MANGA, GET_MANGAS, GET_CATEGORY, GET_CATEGORIES, GET_CATEGORY_MANGAS], refetchQueries: [GET_MANGA, GET_MANGAS, GET_CATEGORY, GET_CATEGORIES, GET_CATEGORY_MANGAS],
...options, ...options,
}); });
@@ -1145,7 +1145,7 @@ export class RequestManager {
patch: UpdateMangaPatchInput, patch: UpdateMangaPatchInput,
options?: MutationHookOptions<UpdateMangaMutation, UpdateMangaMutationVariables>, options?: MutationHookOptions<UpdateMangaMutation, UpdateMangaMutationVariables>,
): AbortableApolloMutationResponse<UpdateMangaMutation> { ): AbortableApolloMutationResponse<UpdateMangaMutation> {
return this.doRequestNew<UpdateMangaMutation, UpdateMangaMutationVariables>( return this.doRequest<UpdateMangaMutation, UpdateMangaMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
UPDATE_MANGA, UPDATE_MANGA,
{ input: { id, patch } }, { input: { id, patch } },
@@ -1169,7 +1169,7 @@ export class RequestManager {
value: any, value: any,
options?: MutationOptions<SetMangaMetadataMutation, SetMangaMetadataMutationVariables>, options?: MutationOptions<SetMangaMetadataMutation, SetMangaMetadataMutationVariables>,
): AbortableApolloMutationResponse<SetMangaMetadataMutation> { ): AbortableApolloMutationResponse<SetMangaMetadataMutation> {
return this.doRequestNew( return this.doRequest(
GQLMethod.MUTATION, GQLMethod.MUTATION,
SET_MANGA_METADATA, SET_MANGA_METADATA,
{ {
@@ -1183,7 +1183,7 @@ export class RequestManager {
variables: GetChaptersQueryVariables, variables: GetChaptersQueryVariables,
options?: QueryHookOptions<GetChaptersQuery, GetChaptersQueryVariables>, options?: QueryHookOptions<GetChaptersQuery, GetChaptersQueryVariables>,
): AbortableApolloUseQueryResponse<GetChaptersQuery, GetChaptersQueryVariables> { ): AbortableApolloUseQueryResponse<GetChaptersQuery, GetChaptersQueryVariables> {
return this.doRequestNew(GQLMethod.USE_QUERY, GET_CHAPTERS, variables, options); return this.doRequest(GQLMethod.USE_QUERY, GET_CHAPTERS, variables, options);
} }
public useGetMangaChapters( public useGetMangaChapters(
@@ -1204,7 +1204,7 @@ export class RequestManager {
mangaId: number | string, mangaId: number | string,
options?: MutationOptions<GetMangaChaptersFetchMutation, GetMangaChaptersFetchMutationVariables>, options?: MutationOptions<GetMangaChaptersFetchMutation, GetMangaChaptersFetchMutationVariables>,
): AbortableApolloMutationResponse<GetMangaChaptersFetchMutation> { ): AbortableApolloMutationResponse<GetMangaChaptersFetchMutation> {
return this.doRequestNew<GetMangaChaptersFetchMutation, GetMangaChaptersFetchMutationVariables>( return this.doRequest<GetMangaChaptersFetchMutation, GetMangaChaptersFetchMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
GET_MANGA_CHAPTERS_FETCH, GET_MANGA_CHAPTERS_FETCH,
{ input: { mangaId: Number(mangaId) } }, { input: { mangaId: Number(mangaId) } },
@@ -1253,7 +1253,7 @@ export class RequestManager {
chapter: GetChaptersQuery['chapters']['nodes'][number]; chapter: GetChaptersQuery['chapters']['nodes'][number];
}; };
const chapterRequest = this.doRequestNew<GetChaptersQuery, GetChaptersQueryVariables>( const chapterRequest = this.doRequest<GetChaptersQuery, GetChaptersQueryVariables>(
GQLMethod.QUERY, GQLMethod.QUERY,
GET_CHAPTERS, GET_CHAPTERS,
{ {
@@ -1283,7 +1283,7 @@ export class RequestManager {
chapterId: string | number, chapterId: string | number,
options?: MutationHookOptions<GetChapterPagesFetchMutation, GetChapterPagesFetchMutationVariables>, options?: MutationHookOptions<GetChapterPagesFetchMutation, GetChapterPagesFetchMutationVariables>,
): AbortableApolloUseMutationResponse<GetChapterPagesFetchMutation, GetChapterPagesFetchMutationVariables> { ): AbortableApolloUseMutationResponse<GetChapterPagesFetchMutation, GetChapterPagesFetchMutationVariables> {
return this.doRequestNew( return this.doRequest(
GQLMethod.USE_MUTATION, GQLMethod.USE_MUTATION,
GET_CHAPTER_PAGES_FETCH, GET_CHAPTER_PAGES_FETCH,
{ {
@@ -1297,7 +1297,7 @@ export class RequestManager {
id: number, id: number,
options?: MutationOptions<DeleteDownloadedChapterMutation, DeleteDownloadedChapterMutationVariables>, options?: MutationOptions<DeleteDownloadedChapterMutation, DeleteDownloadedChapterMutationVariables>,
): AbortableApolloMutationResponse<DeleteDownloadedChapterMutation> { ): AbortableApolloMutationResponse<DeleteDownloadedChapterMutation> {
return this.doRequestNew<DeleteDownloadedChapterMutation, DeleteDownloadedChapterMutationVariables>( return this.doRequest<DeleteDownloadedChapterMutation, DeleteDownloadedChapterMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
DELETE_DOWNLOADED_CHAPTER, DELETE_DOWNLOADED_CHAPTER,
{ input: { id } }, { input: { id } },
@@ -1309,7 +1309,7 @@ export class RequestManager {
ids: number[], ids: number[],
options?: MutationOptions<DeleteDownloadedChaptersMutation, DeleteDownloadedChaptersMutationVariables>, options?: MutationOptions<DeleteDownloadedChaptersMutation, DeleteDownloadedChaptersMutationVariables>,
): AbortableApolloMutationResponse<DeleteDownloadedChaptersMutation> { ): AbortableApolloMutationResponse<DeleteDownloadedChaptersMutation> {
return this.doRequestNew<DeleteDownloadedChaptersMutation, DeleteDownloadedChaptersMutationVariables>( return this.doRequest<DeleteDownloadedChaptersMutation, DeleteDownloadedChaptersMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
DELETE_DOWNLOADED_CHAPTERS, DELETE_DOWNLOADED_CHAPTERS,
{ input: { ids } }, { input: { ids } },
@@ -1322,7 +1322,7 @@ export class RequestManager {
patch: UpdateChapterPatchInput, patch: UpdateChapterPatchInput,
options?: MutationOptions<UpdateChapterMutation, UpdateChapterMutationVariables>, options?: MutationOptions<UpdateChapterMutation, UpdateChapterMutationVariables>,
): AbortableApolloMutationResponse<UpdateChapterMutation> { ): AbortableApolloMutationResponse<UpdateChapterMutation> {
return this.doRequestNew<UpdateChapterMutation, UpdateChapterMutationVariables>( return this.doRequest<UpdateChapterMutation, UpdateChapterMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
UPDATE_CHAPTER, UPDATE_CHAPTER,
{ input: { id, patch } }, { input: { id, patch } },
@@ -1336,7 +1336,7 @@ export class RequestManager {
value: any, value: any,
options?: MutationOptions<SetChapterMetadataMutation, SetChapterMetadataMutationVariables>, options?: MutationOptions<SetChapterMetadataMutation, SetChapterMetadataMutationVariables>,
): AbortableApolloMutationResponse<SetChapterMetadataMutation> { ): AbortableApolloMutationResponse<SetChapterMetadataMutation> {
return this.doRequestNew<SetChapterMetadataMutation, SetChapterMetadataMutationVariables>( return this.doRequest<SetChapterMetadataMutation, SetChapterMetadataMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
SET_CHAPTER_METADATA, SET_CHAPTER_METADATA,
{ input: { meta: { chapterId, key, value: `${value}` } } }, { input: { meta: { chapterId, key, value: `${value}` } } },
@@ -1356,7 +1356,7 @@ export class RequestManager {
patch: UpdateChapterPatchInput, patch: UpdateChapterPatchInput,
options?: MutationOptions<UpdateChaptersMutation, UpdateChaptersMutationVariables>, options?: MutationOptions<UpdateChaptersMutation, UpdateChaptersMutationVariables>,
): AbortableApolloMutationResponse<UpdateChaptersMutation> { ): AbortableApolloMutationResponse<UpdateChaptersMutation> {
return this.doRequestNew<UpdateChaptersMutation, UpdateChaptersMutationVariables>( return this.doRequest<UpdateChaptersMutation, UpdateChaptersMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
UPDATE_CHAPTERS, UPDATE_CHAPTERS,
{ input: { ids, patch } }, { input: { ids, patch } },
@@ -1367,7 +1367,7 @@ export class RequestManager {
public useGetCategories( public useGetCategories(
options?: QueryHookOptions<GetCategoriesQuery, GetCategoriesQueryVariables>, options?: QueryHookOptions<GetCategoriesQuery, GetCategoriesQueryVariables>,
): AbortableApolloUseQueryResponse<GetCategoriesQuery, GetCategoriesQueryVariables> { ): AbortableApolloUseQueryResponse<GetCategoriesQuery, GetCategoriesQueryVariables> {
return this.doRequestNew<GetCategoriesQuery, GetCategoriesQueryVariables>( return this.doRequest<GetCategoriesQuery, GetCategoriesQueryVariables>(
GQLMethod.USE_QUERY, GQLMethod.USE_QUERY,
GET_CATEGORIES, GET_CATEGORIES,
{ {
@@ -1381,7 +1381,7 @@ export class RequestManager {
input: CreateCategoryInput, input: CreateCategoryInput,
options?: MutationOptions<CreateCategoryMutation, CreateCategoryMutationVariables>, options?: MutationOptions<CreateCategoryMutation, CreateCategoryMutationVariables>,
): AbortableApolloMutationResponse<CreateCategoryMutation> { ): AbortableApolloMutationResponse<CreateCategoryMutation> {
return this.doRequestNew<CreateCategoryMutation, CreateCategoryMutationVariables>( return this.doRequest<CreateCategoryMutation, CreateCategoryMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
CREATE_CATEGORY, CREATE_CATEGORY,
{ input }, { input },
@@ -1394,7 +1394,7 @@ export class RequestManager {
position: number, position: number,
options?: MutationOptions<UpdateCategoryOrderMutation, UpdateCategoryOrderMutationVariables>, options?: MutationOptions<UpdateCategoryOrderMutation, UpdateCategoryOrderMutationVariables>,
): AbortableApolloMutationResponse<UpdateCategoryOrderMutation> { ): AbortableApolloMutationResponse<UpdateCategoryOrderMutation> {
return this.doRequestNew<UpdateCategoryOrderMutation, UpdateCategoryOrderMutationVariables>( return this.doRequest<UpdateCategoryOrderMutation, UpdateCategoryOrderMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
UPDATE_CATEGORY_ORDER, UPDATE_CATEGORY_ORDER,
{ input: { id, position } }, { input: { id, position } },
@@ -1406,14 +1406,14 @@ export class RequestManager {
id: number, id: number,
options?: QueryHookOptions<GetCategoryMangasQuery, GetCategoryMangasQueryVariables>, options?: QueryHookOptions<GetCategoryMangasQuery, GetCategoryMangasQueryVariables>,
): AbortableApolloUseQueryResponse<GetCategoryMangasQuery, GetCategoryMangasQueryVariables> { ): AbortableApolloUseQueryResponse<GetCategoryMangasQuery, GetCategoryMangasQueryVariables> {
return this.doRequestNew(GQLMethod.USE_QUERY, GET_CATEGORY_MANGAS, { id }, options); return this.doRequest(GQLMethod.USE_QUERY, GET_CATEGORY_MANGAS, { id }, options);
} }
public deleteCategory( public deleteCategory(
categoryId: number, categoryId: number,
options?: MutationOptions<DeleteCategoryMutation, DeleteCategoryMutationVariables>, options?: MutationOptions<DeleteCategoryMutation, DeleteCategoryMutationVariables>,
): AbortableApolloMutationResponse<DeleteCategoryMutation> { ): AbortableApolloMutationResponse<DeleteCategoryMutation> {
return this.doRequestNew<DeleteCategoryMutation, DeleteCategoryMutationVariables>( return this.doRequest<DeleteCategoryMutation, DeleteCategoryMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
DELETE_CATEGORY, DELETE_CATEGORY,
{ input: { categoryId } }, { input: { categoryId } },
@@ -1426,7 +1426,7 @@ export class RequestManager {
patch: UpdateCategoryPatchInput, patch: UpdateCategoryPatchInput,
options?: MutationOptions<UpdateCategoryMutation, UpdateCategoryMutationVariables>, options?: MutationOptions<UpdateCategoryMutation, UpdateCategoryMutationVariables>,
): AbortableApolloMutationResponse<UpdateCategoryMutation> { ): AbortableApolloMutationResponse<UpdateCategoryMutation> {
return this.doRequestNew<UpdateCategoryMutation, UpdateCategoryMutationVariables>( return this.doRequest<UpdateCategoryMutation, UpdateCategoryMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
UPDATE_CATEGORY, UPDATE_CATEGORY,
{ input: { id, patch } }, { input: { id, patch } },
@@ -1440,7 +1440,7 @@ export class RequestManager {
value: any, value: any,
options?: MutationOptions<SetCategoryMetadataMutation, SetCategoryMetadataMutationVariables>, options?: MutationOptions<SetCategoryMetadataMutation, SetCategoryMetadataMutationVariables>,
): AbortableApolloMutationResponse<SetCategoryMetadataMutation> { ): AbortableApolloMutationResponse<SetCategoryMetadataMutation> {
return this.doRequestNew<SetCategoryMetadataMutation, SetCategoryMetadataMutationVariables>( return this.doRequest<SetCategoryMetadataMutation, SetCategoryMetadataMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
SET_CATEGORY_METADATA, SET_CATEGORY_METADATA,
{ input: { meta: { categoryId, key, value: `${value}` } } }, { input: { meta: { categoryId, key, value: `${value}` } } },
@@ -1452,7 +1452,7 @@ export class RequestManager {
file: File, file: File,
options?: MutationOptions<RestoreBackupMutation, RestoreBackupMutationVariables>, options?: MutationOptions<RestoreBackupMutation, RestoreBackupMutationVariables>,
): AbortableApolloMutationResponse<RestoreBackupMutation> { ): AbortableApolloMutationResponse<RestoreBackupMutation> {
return this.doRequestNew<RestoreBackupMutation, RestoreBackupMutationVariables>( return this.doRequest<RestoreBackupMutation, RestoreBackupMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
RESTORE_BACKUP, RESTORE_BACKUP,
{ input: { backup: file } }, { input: { backup: file } },
@@ -1464,7 +1464,7 @@ export class RequestManager {
file: File, file: File,
options?: QueryOptions<ValidateBackupQueryVariables, ValidateBackupQuery>, options?: QueryOptions<ValidateBackupQueryVariables, ValidateBackupQuery>,
): AbortabaleApolloQueryResponse<ValidateBackupQuery> { ): AbortabaleApolloQueryResponse<ValidateBackupQuery> {
return this.doRequestNew(GQLMethod.QUERY, VALIDATE_BACKUP, { input: { backup: file } }, options); return this.doRequest(GQLMethod.QUERY, VALIDATE_BACKUP, { input: { backup: file } }, options);
} }
public getExportBackupUrl(): string { public getExportBackupUrl(): string {
@@ -1474,7 +1474,7 @@ export class RequestManager {
public startDownloads( public startDownloads(
options?: MutationOptions<StartDownloaderMutation, StartDownloaderMutationVariables>, options?: MutationOptions<StartDownloaderMutation, StartDownloaderMutationVariables>,
): AbortableApolloMutationResponse<StartDownloaderMutation> { ): AbortableApolloMutationResponse<StartDownloaderMutation> {
return this.doRequestNew<StartDownloaderMutation, StartDownloaderMutationVariables>( return this.doRequest<StartDownloaderMutation, StartDownloaderMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
START_DOWNLOADER, START_DOWNLOADER,
{}, {},
@@ -1485,7 +1485,7 @@ export class RequestManager {
public stopDownloads( public stopDownloads(
options?: MutationOptions<StopDownloaderMutation, StopDownloaderMutationVariables>, options?: MutationOptions<StopDownloaderMutation, StopDownloaderMutationVariables>,
): AbortableApolloMutationResponse<StopDownloaderMutation> { ): AbortableApolloMutationResponse<StopDownloaderMutation> {
return this.doRequestNew<StopDownloaderMutation, StopDownloaderMutationVariables>( return this.doRequest<StopDownloaderMutation, StopDownloaderMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
STOP_DOWNLOADER, STOP_DOWNLOADER,
{}, {},
@@ -1496,7 +1496,7 @@ export class RequestManager {
public clearDownloads( public clearDownloads(
options?: MutationOptions<ClearDownloaderMutation, ClearDownloaderMutationVariables>, options?: MutationOptions<ClearDownloaderMutation, ClearDownloaderMutationVariables>,
): AbortableApolloMutationResponse<ClearDownloaderMutation> { ): AbortableApolloMutationResponse<ClearDownloaderMutation> {
return this.doRequestNew<ClearDownloaderMutation, ClearDownloaderMutationVariables>( return this.doRequest<ClearDownloaderMutation, ClearDownloaderMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
CLEAR_DOWNLOADER, CLEAR_DOWNLOADER,
{}, {},
@@ -1508,7 +1508,7 @@ export class RequestManager {
id: number, id: number,
options?: MutationOptions<EnqueueChapterDownloadMutation, EnqueueChapterDownloadMutationVariables>, options?: MutationOptions<EnqueueChapterDownloadMutation, EnqueueChapterDownloadMutationVariables>,
): AbortableApolloMutationResponse<EnqueueChapterDownloadMutation> { ): AbortableApolloMutationResponse<EnqueueChapterDownloadMutation> {
return this.doRequestNew<EnqueueChapterDownloadMutation, EnqueueChapterDownloadMutationVariables>( return this.doRequest<EnqueueChapterDownloadMutation, EnqueueChapterDownloadMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
ENQUEUE_CHAPTER_DOWNLOAD, ENQUEUE_CHAPTER_DOWNLOAD,
{ input: { id } }, { input: { id } },
@@ -1520,7 +1520,7 @@ export class RequestManager {
id: number, id: number,
options?: MutationOptions<DequeueChapterDownloadMutation, DequeueChapterDownloadMutationVariables>, options?: MutationOptions<DequeueChapterDownloadMutation, DequeueChapterDownloadMutationVariables>,
): AbortableApolloMutationResponse<DequeueChapterDownloadMutation> { ): AbortableApolloMutationResponse<DequeueChapterDownloadMutation> {
return this.doRequestNew<DequeueChapterDownloadMutation, DequeueChapterDownloadMutationVariables>( return this.doRequest<DequeueChapterDownloadMutation, DequeueChapterDownloadMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
DEQUEUE_CHAPTER_DOWNLOAD, DEQUEUE_CHAPTER_DOWNLOAD,
{ input: { id } }, { input: { id } },
@@ -1533,7 +1533,7 @@ export class RequestManager {
position: number, position: number,
options?: MutationOptions<ReorderChapterDownloadMutation, ReorderChapterDownloadMutationVariables>, options?: MutationOptions<ReorderChapterDownloadMutation, ReorderChapterDownloadMutationVariables>,
): AbortableApolloMutationResponse<ReorderChapterDownloadMutation> { ): AbortableApolloMutationResponse<ReorderChapterDownloadMutation> {
return this.doRequestNew<ReorderChapterDownloadMutation, ReorderChapterDownloadMutationVariables>( return this.doRequest<ReorderChapterDownloadMutation, ReorderChapterDownloadMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
REORDER_CHAPTER_DOWNLOAD, REORDER_CHAPTER_DOWNLOAD,
{ input: { chapterId, to: position } }, { input: { chapterId, to: position } },
@@ -1545,7 +1545,7 @@ export class RequestManager {
ids: number[], ids: number[],
options?: MutationOptions<EnqueueChapterDownloadsMutation, EnqueueChapterDownloadsMutationVariables>, options?: MutationOptions<EnqueueChapterDownloadsMutation, EnqueueChapterDownloadsMutationVariables>,
): AbortableApolloMutationResponse<EnqueueChapterDownloadsMutation> { ): AbortableApolloMutationResponse<EnqueueChapterDownloadsMutation> {
return this.doRequestNew<EnqueueChapterDownloadsMutation, EnqueueChapterDownloadsMutationVariables>( return this.doRequest<EnqueueChapterDownloadsMutation, EnqueueChapterDownloadsMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
ENQUEUE_CHAPTER_DOWNLOADS, ENQUEUE_CHAPTER_DOWNLOADS,
{ input: { ids } }, { input: { ids } },
@@ -1557,7 +1557,7 @@ export class RequestManager {
ids: number[], ids: number[],
options?: MutationOptions<DequeueChapterDownloadsMutation, DequeueChapterDownloadsMutationVariables>, options?: MutationOptions<DequeueChapterDownloadsMutation, DequeueChapterDownloadsMutationVariables>,
): AbortableApolloMutationResponse<DequeueChapterDownloadsMutation> { ): AbortableApolloMutationResponse<DequeueChapterDownloadsMutation> {
return this.doRequestNew<DequeueChapterDownloadsMutation, DequeueChapterDownloadsMutationVariables>( return this.doRequest<DequeueChapterDownloadsMutation, DequeueChapterDownloadsMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
DEQUEUE_CHAPTER_DOWNLOADS, DEQUEUE_CHAPTER_DOWNLOADS,
{ input: { ids } }, { input: { ids } },
@@ -1613,7 +1613,7 @@ export class RequestManager {
Variables extends UpdateLibraryMangasMutationVariables | UpdateCategoryMangasMutationVariables, Variables extends UpdateLibraryMangasMutationVariables | UpdateCategoryMangasMutationVariables,
>(categories?: number[], options?: MutationOptions<Data, Variables>): AbortableApolloMutationResponse<Data> { >(categories?: number[], options?: MutationOptions<Data, Variables>): AbortableApolloMutationResponse<Data> {
if (categories?.length) { if (categories?.length) {
return this.doRequestNew<UpdateCategoryMangasMutation, UpdateCategoryMangasMutationVariables>( return this.doRequest<UpdateCategoryMangasMutation, UpdateCategoryMangasMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
UPDATE_CATEGORY_MANGAS, UPDATE_CATEGORY_MANGAS,
{ input: { categories } }, { input: { categories } },
@@ -1621,7 +1621,7 @@ export class RequestManager {
) as AbortableApolloMutationResponse<Data>; ) as AbortableApolloMutationResponse<Data>;
} }
return this.doRequestNew<UpdateLibraryMangasMutation, UpdateLibraryMangasMutationVariables>( return this.doRequest<UpdateLibraryMangasMutation, UpdateLibraryMangasMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
UPDATE_LIBRARY_MANGAS, UPDATE_LIBRARY_MANGAS,
{}, {},
@@ -1632,7 +1632,7 @@ export class RequestManager {
public resetGlobalUpdate( public resetGlobalUpdate(
options?: MutationOptions<StopUpdaterMutation, StopUpdaterMutationVariables>, options?: MutationOptions<StopUpdaterMutation, StopUpdaterMutationVariables>,
): AbortableApolloMutationResponse<StopUpdaterMutation> { ): AbortableApolloMutationResponse<StopUpdaterMutation> {
return this.doRequestNew<StopUpdaterMutation, StopUpdaterMutationVariables>( return this.doRequest<StopUpdaterMutation, StopUpdaterMutationVariables>(
GQLMethod.MUTATION, GQLMethod.MUTATION,
STOP_UPDATER, STOP_UPDATER,
{}, {},
@@ -1643,19 +1643,19 @@ export class RequestManager {
public useGetGlobalUpdateSummary( public useGetGlobalUpdateSummary(
options?: QueryHookOptions<GetUpdateStatusQuery, GetUpdateStatusQueryVariables>, options?: QueryHookOptions<GetUpdateStatusQuery, GetUpdateStatusQueryVariables>,
): AbortableApolloUseQueryResponse<GetUpdateStatusQuery, GetUpdateStatusQueryVariables> { ): AbortableApolloUseQueryResponse<GetUpdateStatusQuery, GetUpdateStatusQueryVariables> {
return this.doRequestNew(GQLMethod.USE_QUERY, GET_UPDATE_STATUS, {}, options); return this.doRequest(GQLMethod.USE_QUERY, GET_UPDATE_STATUS, {}, options);
} }
public useDownloadSubscription( public useDownloadSubscription(
options?: SubscriptionHookOptions<DownloadStatusSubscription, DownloadStatusSubscriptionVariables>, options?: SubscriptionHookOptions<DownloadStatusSubscription, DownloadStatusSubscriptionVariables>,
): SubscriptionResult<DownloadStatusSubscription, DownloadStatusSubscriptionVariables> { ): SubscriptionResult<DownloadStatusSubscription, DownloadStatusSubscriptionVariables> {
return this.doRequestNew(GQLMethod.USE_SUBSCRIPTION, DOWNLOAD_STATUS_SUBSCRIPTION, {}, options); return this.doRequest(GQLMethod.USE_SUBSCRIPTION, DOWNLOAD_STATUS_SUBSCRIPTION, {}, options);
} }
public useUpdaterSubscription( public useUpdaterSubscription(
options?: SubscriptionHookOptions<UpdaterSubscription, UpdaterSubscriptionVariables>, options?: SubscriptionHookOptions<UpdaterSubscription, UpdaterSubscriptionVariables>,
): SubscriptionResult<UpdaterSubscription, UpdaterSubscriptionVariables> { ): SubscriptionResult<UpdaterSubscription, UpdaterSubscriptionVariables> {
return this.doRequestNew(GQLMethod.USE_SUBSCRIPTION, UPDATER_SUBSCRIPTION, {}, options); return this.doRequest(GQLMethod.USE_SUBSCRIPTION, UPDATER_SUBSCRIPTION, {}, options);
} }
} }