Use new "metas" mutations
This commit is contained in:
@@ -80,7 +80,7 @@ export const updateCategoryMetadata = async <
|
||||
category: CategoryIdInfo & GqlMetaHolder,
|
||||
metadataKey: MetadataKey,
|
||||
value: ICategoryMetadata[MetadataKey],
|
||||
): Promise<void[]> =>
|
||||
): Promise<void> =>
|
||||
requestUpdateCategoryMetadata(category, [
|
||||
[metadataKey, convertAppMetadataToGqlMetadata({ [metadataKey]: value })[metadataKey]],
|
||||
]);
|
||||
@@ -89,6 +89,6 @@ export const createUpdateCategoryMetadata =
|
||||
<Settings extends CategoryMetadataKeys>(
|
||||
category: CategoryIdInfo & GqlMetaHolder,
|
||||
handleError: (error: any) => void = defaultPromiseErrorHandler('createUpdateCategoryMetadata'),
|
||||
): ((...args: OmitFirst<Parameters<typeof updateCategoryMetadata<Settings>>>) => Promise<void | void[]>) =>
|
||||
): ((...args: OmitFirst<Parameters<typeof updateCategoryMetadata<Settings>>>) => Promise<void>) =>
|
||||
(metadataKey, value) =>
|
||||
updateCategoryMetadata(category, metadataKey, value).catch(handleError);
|
||||
|
||||
@@ -68,7 +68,7 @@ export const updateMangaMetadata = async <
|
||||
manga: MangaIdInfo & GqlMetaHolder,
|
||||
metadataKey: MetadataKey,
|
||||
value: MangaMetadata[MetadataKey],
|
||||
): Promise<void[]> =>
|
||||
): Promise<void> =>
|
||||
requestUpdateMangaMetadata(manga, [
|
||||
[metadataKey, convertAppMetadataToGqlMetadata({ [metadataKey]: value })[metadataKey]],
|
||||
]);
|
||||
@@ -77,6 +77,6 @@ export const createUpdateMangaMetadata =
|
||||
<Settings extends MangaMetadataKeys>(
|
||||
manga: MangaIdInfo & GqlMetaHolder,
|
||||
handleError: (error: any) => void = defaultPromiseErrorHandler('createUpdateMangaMetadata'),
|
||||
): ((...args: OmitFirst<Parameters<typeof updateMangaMetadata<Settings>>>) => Promise<void | void[]>) =>
|
||||
): ((...args: OmitFirst<Parameters<typeof updateMangaMetadata<Settings>>>) => Promise<void>) =>
|
||||
(metadataKey, value) =>
|
||||
updateMangaMetadata(manga, metadataKey, value).catch(handleError);
|
||||
|
||||
@@ -8,26 +8,27 @@
|
||||
|
||||
import { ReadFieldFunction } from '@apollo/client/cache/core/types/common';
|
||||
import { Reference } from '@apollo/client/utilities';
|
||||
import { MetaType } from '@/lib/graphql/generated/graphql.ts';
|
||||
|
||||
export const updateMetadataList = (
|
||||
key: string,
|
||||
meta: MetaType[],
|
||||
existingMetas: Reference[] | undefined,
|
||||
readField: ReadFieldFunction,
|
||||
createMetaRef: () => Reference | undefined,
|
||||
createMetaRef: (meta: MetaType) => Reference | undefined,
|
||||
deleted: boolean = false,
|
||||
): (Reference | undefined)[] | undefined => {
|
||||
) => {
|
||||
if (!existingMetas) {
|
||||
return existingMetas;
|
||||
}
|
||||
|
||||
if (deleted) {
|
||||
return existingMetas.filter((metaRef: Reference) => readField('key', metaRef) !== key);
|
||||
return existingMetas.filter((metaRef: Reference) => meta.some(({ key }) => key === readField('key', metaRef)));
|
||||
}
|
||||
|
||||
const exists = existingMetas.some((metaRef: Reference) => readField('key', metaRef) === key);
|
||||
if (exists) {
|
||||
return existingMetas;
|
||||
}
|
||||
const newMetas = meta.filter(({ key }) =>
|
||||
existingMetas.every((metaRef: Reference) => readField('key', metaRef) !== key),
|
||||
);
|
||||
const newMetaRefs = newMetas.map(createMetaRef);
|
||||
|
||||
return [...existingMetas, createMetaRef()];
|
||||
return [...existingMetas, ...newMetaRefs];
|
||||
};
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { CategoryIdInfo } from '@/features/category/Category.types.ts';
|
||||
import {
|
||||
AllowedMetadataValueTypes,
|
||||
AppMetadataKeys,
|
||||
GqlMetaHolder,
|
||||
MetadataHolder,
|
||||
@@ -22,83 +21,82 @@ import { convertToGqlMeta } from '@/features/metadata/services/MetadataConverter
|
||||
import { SourceIdInfo } from '@/features/source/Source.types.ts';
|
||||
import { ChapterIdInfo } from '@/features/chapter/Chapter.types.ts';
|
||||
|
||||
const requestUpdateMetadataValue = async (
|
||||
metadataHolder: GqlMetaHolder,
|
||||
holderType: MetadataHolderType,
|
||||
key: AppMetadataKeys,
|
||||
value: AllowedMetadataValueTypes,
|
||||
keyPrefixes?: string[],
|
||||
isMetadataKey: boolean = false,
|
||||
): Promise<void> => {
|
||||
const metadataKey = isMetadataKey ? key : getMetadataKey(key, keyPrefixes);
|
||||
|
||||
switch (holderType) {
|
||||
case 'category':
|
||||
await requestManager.setCategoryMeta((metadataHolder as CategoryIdInfo).id, metadataKey, value).response;
|
||||
break;
|
||||
case 'chapter':
|
||||
await requestManager.setChapterMeta((metadataHolder as ChapterIdInfo).id, metadataKey, value).response;
|
||||
break;
|
||||
case 'global':
|
||||
await requestManager.setGlobalMetadata(metadataKey, value).response;
|
||||
break;
|
||||
case 'manga':
|
||||
await requestManager.setMangaMeta((metadataHolder as MangaIdInfo).id, metadataKey, value).response;
|
||||
break;
|
||||
case 'source':
|
||||
await requestManager.setSourceMeta((metadataHolder as SourceIdInfo).id, metadataKey, value).response;
|
||||
break;
|
||||
default:
|
||||
throw new Error(`requestUpdateMetadataValue: unknown holderType "${holderType}"`);
|
||||
}
|
||||
};
|
||||
|
||||
const requestUpdateMetadata = async (
|
||||
const requestUpdateMetadataValues = async (
|
||||
metadataHolder: GqlMetaHolder,
|
||||
holderType: MetadataHolderType,
|
||||
keysToValues: MetadataKeyValuePair[],
|
||||
keyPrefixes?: string[],
|
||||
isMetadataKey?: boolean,
|
||||
): Promise<void[]> =>
|
||||
Promise.all(
|
||||
keysToValues.map(([key, value]) =>
|
||||
requestUpdateMetadataValue(metadataHolder, holderType, key, value, keyPrefixes, isMetadataKey),
|
||||
),
|
||||
);
|
||||
isMetadataKey: boolean = false,
|
||||
): Promise<void> => {
|
||||
const metas = keysToValues.map(([key, value]) => ({
|
||||
key: isMetadataKey ? key : getMetadataKey(key, keyPrefixes),
|
||||
value: `${value}`,
|
||||
}));
|
||||
|
||||
switch (holderType) {
|
||||
case 'category':
|
||||
await requestManager.setCategoryMeta({
|
||||
items: [{ categoryIds: [(metadataHolder as CategoryIdInfo).id], metas }],
|
||||
}).response;
|
||||
break;
|
||||
case 'chapter':
|
||||
await requestManager.setChapterMeta({
|
||||
items: [{ chapterIds: [(metadataHolder as ChapterIdInfo).id], metas }],
|
||||
}).response;
|
||||
break;
|
||||
case 'global':
|
||||
await requestManager.setGlobalMetadata({
|
||||
metas,
|
||||
}).response;
|
||||
break;
|
||||
case 'manga':
|
||||
await requestManager.setMangaMeta({
|
||||
items: [{ mangaIds: [(metadataHolder as MangaIdInfo).id], metas }],
|
||||
}).response;
|
||||
break;
|
||||
case 'source':
|
||||
await requestManager.setSourceMeta({
|
||||
items: [{ sourceIds: [(metadataHolder as SourceIdInfo).id], metas }],
|
||||
}).response;
|
||||
break;
|
||||
default:
|
||||
throw new Error(`requestUpdateMetadataValues: unknown holderType "${holderType}"`);
|
||||
}
|
||||
};
|
||||
|
||||
export const requestUpdateServerMetadata = async (
|
||||
keysToValues: MetadataKeyValuePair[],
|
||||
keyPrefixes?: string[],
|
||||
isMetadataKey?: boolean,
|
||||
): Promise<void[]> => requestUpdateMetadata({}, 'global', keysToValues, keyPrefixes, isMetadataKey);
|
||||
): Promise<void> => requestUpdateMetadataValues({}, 'global', keysToValues, keyPrefixes, isMetadataKey);
|
||||
|
||||
export const requestUpdateMangaMetadata = async (
|
||||
manga: MangaIdInfo & GqlMetaHolder,
|
||||
keysToValues: MetadataKeyValuePair[],
|
||||
keyPrefixes?: string[],
|
||||
isMetadataKey?: boolean,
|
||||
): Promise<void[]> => requestUpdateMetadata(manga, 'manga', keysToValues, keyPrefixes, isMetadataKey);
|
||||
): Promise<void> => requestUpdateMetadataValues(manga, 'manga', keysToValues, keyPrefixes, isMetadataKey);
|
||||
|
||||
export const requestUpdateChapterMetadata = async (
|
||||
chapter: ChapterIdInfo & GqlMetaHolder,
|
||||
keysToValues: MetadataKeyValuePair[],
|
||||
keyPrefixes?: string[],
|
||||
isMetadataKey?: boolean,
|
||||
): Promise<void[]> => requestUpdateMetadata(chapter, 'chapter', keysToValues, keyPrefixes, isMetadataKey);
|
||||
): Promise<void> => requestUpdateMetadataValues(chapter, 'chapter', keysToValues, keyPrefixes, isMetadataKey);
|
||||
|
||||
export const requestUpdateCategoryMetadata = async (
|
||||
category: CategoryIdInfo & GqlMetaHolder,
|
||||
keysToValues: MetadataKeyValuePair[],
|
||||
keyPrefixes?: string[],
|
||||
isMetadataKey?: boolean,
|
||||
): Promise<void[]> => requestUpdateMetadata(category, 'category', keysToValues, keyPrefixes, isMetadataKey);
|
||||
): Promise<void> => requestUpdateMetadataValues(category, 'category', keysToValues, keyPrefixes, isMetadataKey);
|
||||
|
||||
export const requestUpdateSourceMetadata = async (
|
||||
source: SourceIdInfo & GqlMetaHolder,
|
||||
keysToValue: MetadataKeyValuePair[],
|
||||
keyPrefixes?: string[],
|
||||
isMetadataKey?: boolean,
|
||||
): Promise<void[]> => requestUpdateMetadata(source, 'source', keysToValue, keyPrefixes, isMetadataKey);
|
||||
): Promise<void> => requestUpdateMetadataValues(source, 'source', keysToValue, keyPrefixes, isMetadataKey);
|
||||
|
||||
export const getMetadataUpdateFunction = (
|
||||
type: MetadataHolderType,
|
||||
@@ -108,7 +106,7 @@ export const getMetadataUpdateFunction = (
|
||||
| (ChapterIdInfo & MetadataHolder)
|
||||
| (CategoryIdInfo & MetadataHolder)
|
||||
| (SourceIdInfo & MetadataHolder),
|
||||
): ((keyValuePair: MetadataKeyValuePair[], keyPrefixes?: string[], isMetadataKey?: boolean) => Promise<void[]>) => {
|
||||
): ((keyValuePair: MetadataKeyValuePair[], prefixes?: string[], isMetadataKey?: boolean) => Promise<void>) => {
|
||||
switch (type) {
|
||||
case 'global':
|
||||
return (...args) => requestUpdateServerMetadata(...args);
|
||||
@@ -144,81 +142,79 @@ export const getMetadataUpdateFunction = (
|
||||
}
|
||||
};
|
||||
|
||||
export const requestDeleteMetadataValue = async (
|
||||
metadataHolder: GqlMetaHolder,
|
||||
holderType: MetadataHolderType,
|
||||
key: AppMetadataKeys,
|
||||
keyPrefixes?: string[],
|
||||
isMetadataKey: boolean = false,
|
||||
): Promise<void> => {
|
||||
const metadataKey = isMetadataKey ? key : getMetadataKey(key, keyPrefixes);
|
||||
|
||||
switch (holderType) {
|
||||
case 'category':
|
||||
await requestManager.deleteCategoryMeta((metadataHolder as CategoryIdInfo).id, metadataKey).response;
|
||||
break;
|
||||
case 'chapter':
|
||||
await requestManager.deleteChapterMeta((metadataHolder as ChapterIdInfo).id, metadataKey).response;
|
||||
break;
|
||||
case 'global':
|
||||
await requestManager.deleteGlobalMeta(metadataKey).response;
|
||||
break;
|
||||
case 'manga':
|
||||
await requestManager.deleteMangaMeta((metadataHolder as MangaIdInfo).id, metadataKey).response;
|
||||
break;
|
||||
case 'source':
|
||||
await requestManager.deleteSourceMeta((metadataHolder as SourceIdInfo).id, metadataKey).response;
|
||||
break;
|
||||
default:
|
||||
throw new Error(`requestDeleteMetadataValue: unknown holderType "${holderType}"`);
|
||||
}
|
||||
};
|
||||
|
||||
async function requestDeleteMetadata(
|
||||
const requestDeleteMetadataValues = async (
|
||||
metadataHolder: GqlMetaHolder,
|
||||
holderType: MetadataHolderType,
|
||||
keys: AppMetadataKeys[],
|
||||
keyPrefixes?: string[],
|
||||
isMetadataKey?: boolean,
|
||||
): Promise<void[]> {
|
||||
return Promise.all(
|
||||
keys.map((key) => requestDeleteMetadataValue(metadataHolder, holderType, key, keyPrefixes, isMetadataKey)),
|
||||
);
|
||||
}
|
||||
isMetadataKey: boolean = false,
|
||||
): Promise<void> => {
|
||||
const metadataKeys = keys.map((key) => (isMetadataKey ? key : getMetadataKey(key, keyPrefixes)));
|
||||
|
||||
switch (holderType) {
|
||||
case 'category':
|
||||
await requestManager.deleteCategoryMeta({
|
||||
items: [{ categoryIds: [(metadataHolder as CategoryIdInfo).id], keys: metadataKeys }],
|
||||
}).response;
|
||||
break;
|
||||
case 'chapter':
|
||||
await requestManager.deleteChapterMeta({
|
||||
items: [{ chapterIds: [(metadataHolder as ChapterIdInfo).id], keys: metadataKeys }],
|
||||
}).response;
|
||||
break;
|
||||
case 'global':
|
||||
await requestManager.deleteGlobalMeta({
|
||||
keys: metadataKeys,
|
||||
}).response;
|
||||
break;
|
||||
case 'manga':
|
||||
await requestManager.deleteMangaMeta({
|
||||
items: [{ mangaIds: [(metadataHolder as MangaIdInfo).id], keys: metadataKeys }],
|
||||
}).response;
|
||||
break;
|
||||
case 'source':
|
||||
await requestManager.deleteSourceMeta({
|
||||
items: [{ sourceIds: [(metadataHolder as SourceIdInfo).id], keys: metadataKeys }],
|
||||
}).response;
|
||||
break;
|
||||
default:
|
||||
throw new Error(`requestDeleteMetadataValues: unknown holderType "${holderType}"`);
|
||||
}
|
||||
};
|
||||
|
||||
export const requestDeleteServerMetadata = async (
|
||||
keys: AppMetadataKeys[],
|
||||
keyPrefixes?: string[],
|
||||
isMetadataKey?: boolean,
|
||||
): Promise<void[]> => requestDeleteMetadata({}, 'global', keys, keyPrefixes, isMetadataKey);
|
||||
): Promise<void> => requestDeleteMetadataValues({}, 'global', keys, keyPrefixes, isMetadataKey);
|
||||
|
||||
export const requestDeleteMangaMetadata = async (
|
||||
manga: MangaIdInfo & GqlMetaHolder,
|
||||
keys: AppMetadataKeys[],
|
||||
keyPrefixes?: string[],
|
||||
isMetadataKey?: boolean,
|
||||
): Promise<void[]> => requestDeleteMetadata(manga, 'manga', keys, keyPrefixes, isMetadataKey);
|
||||
): Promise<void> => requestDeleteMetadataValues(manga, 'manga', keys, keyPrefixes, isMetadataKey);
|
||||
|
||||
export const requestDeleteChapterMetadata = async (
|
||||
chapter: ChapterIdInfo & GqlMetaHolder,
|
||||
keys: AppMetadataKeys[],
|
||||
keyPrefixes?: string[],
|
||||
isMetadataKey?: boolean,
|
||||
): Promise<void[]> => requestDeleteMetadata(chapter, 'chapter', keys, keyPrefixes, isMetadataKey);
|
||||
): Promise<void> => requestDeleteMetadataValues(chapter, 'chapter', keys, keyPrefixes, isMetadataKey);
|
||||
|
||||
export const requestDeleteCategoryMetadata = async (
|
||||
category: CategoryIdInfo & GqlMetaHolder,
|
||||
keys: AppMetadataKeys[],
|
||||
keyPrefixes?: string[],
|
||||
isMetadataKey?: boolean,
|
||||
): Promise<void[]> => requestDeleteMetadata(category, 'category', keys, keyPrefixes, isMetadataKey);
|
||||
): Promise<void> => requestDeleteMetadataValues(category, 'category', keys, keyPrefixes, isMetadataKey);
|
||||
|
||||
export const requestDeleteSourceMetadata = async (
|
||||
source: SourceIdInfo & GqlMetaHolder,
|
||||
keys: AppMetadataKeys[],
|
||||
keyPrefixes?: string[],
|
||||
isMetadataKey?: boolean,
|
||||
): Promise<void[]> => requestDeleteMetadata(source, 'source', keys, keyPrefixes, isMetadataKey);
|
||||
): Promise<void> => requestDeleteMetadataValues(source, 'source', keys, keyPrefixes, isMetadataKey);
|
||||
|
||||
export const getMetadataDeleteFunction = (
|
||||
type: MetadataHolderType,
|
||||
@@ -228,7 +224,7 @@ export const getMetadataDeleteFunction = (
|
||||
| (ChapterIdInfo & MetadataHolder)
|
||||
| (CategoryIdInfo & MetadataHolder)
|
||||
| (SourceIdInfo & MetadataHolder),
|
||||
): ((metadataToDelete: AppMetadataKeys[], keyPrefixes?: string[], isMetadataKey?: boolean) => Promise<void[]>) => {
|
||||
): ((metadataToDelete: AppMetadataKeys[], keyPrefixes?: string[], isMetadataKey?: boolean) => Promise<void>) => {
|
||||
switch (type) {
|
||||
case 'global':
|
||||
return (...args) => requestDeleteServerMetadata(...args);
|
||||
|
||||
@@ -289,6 +289,7 @@ export class ReaderService {
|
||||
return;
|
||||
}
|
||||
const key = getMetadataKey(setting, profile !== undefined ? [profile?.toString()] : undefined);
|
||||
const metaValue = JSON.stringify(value);
|
||||
|
||||
const { cache } = requestManager.graphQLClient.client;
|
||||
|
||||
@@ -299,7 +300,7 @@ export class ReaderService {
|
||||
data: {
|
||||
__typename: 'GlobalMetaType',
|
||||
key,
|
||||
value: JSON.stringify(value),
|
||||
value: metaValue,
|
||||
},
|
||||
});
|
||||
cache.modify({
|
||||
@@ -307,7 +308,12 @@ export class ReaderService {
|
||||
metas(existingMetas, { readField }) {
|
||||
return {
|
||||
...existingMetas,
|
||||
nodes: updateMetadataList(key, existingMetas?.nodes, readField, () => reference),
|
||||
nodes: updateMetadataList(
|
||||
[{ key, value: metaValue }],
|
||||
existingMetas?.nodes,
|
||||
readField,
|
||||
() => reference,
|
||||
),
|
||||
};
|
||||
},
|
||||
},
|
||||
@@ -319,14 +325,19 @@ export class ReaderService {
|
||||
__typename: 'MangaMetaType',
|
||||
mangaId: manga.id,
|
||||
key,
|
||||
value: JSON.stringify(value),
|
||||
value: metaValue,
|
||||
},
|
||||
});
|
||||
cache.modify({
|
||||
id: cache.identify({ __typename: 'MangaType', id: manga.id }),
|
||||
fields: {
|
||||
meta(existingMetas, { readField }) {
|
||||
return updateMetadataList(key, existingMetas, readField, () => reference);
|
||||
return updateMetadataList(
|
||||
[{ key, value: metaValue }],
|
||||
existingMetas,
|
||||
readField,
|
||||
() => reference,
|
||||
);
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -363,8 +374,8 @@ export class ReaderService {
|
||||
}
|
||||
|
||||
const deleteSetting = isGlobalSetting
|
||||
? () => requestManager.deleteGlobalMeta(key).response
|
||||
: () => requestManager.deleteMangaMeta(manga.id, key).response;
|
||||
? () => requestManager.deleteGlobalMeta({ keys: [key] }).response
|
||||
: () => requestManager.deleteMangaMeta({ items: [{ mangaIds: [manga.id], keys: [key] }] }).response;
|
||||
deleteSetting().catch((e) =>
|
||||
makeToast(t`Could not save the reader settings to the server`, 'error', getErrorMessage(e)),
|
||||
);
|
||||
|
||||
@@ -224,7 +224,7 @@ export const updateReaderSettings = async <Setting extends keyof IReaderSettings
|
||||
value: IReaderSettings[Setting],
|
||||
isGlobal: boolean = false,
|
||||
profile?: ReadingMode,
|
||||
): Promise<void[]> => {
|
||||
): Promise<void> => {
|
||||
const isGlobalSetting = isGlobal || GLOBAL_READER_SETTING_KEYS.includes(setting);
|
||||
if (isGlobalSetting) {
|
||||
return requestUpdateServerMetadata(
|
||||
@@ -244,6 +244,6 @@ export const createUpdateReaderSettings =
|
||||
manga: Pick<MangaType, 'id'> & GqlMetaHolder,
|
||||
handleError: (error: any) => void = defaultPromiseErrorHandler('createUpdateReaderSettings'),
|
||||
profile?: ReadingMode,
|
||||
): ((...args: OmitFirst<Parameters<typeof updateReaderSettings<Settings>>>) => Promise<void | void[]>) =>
|
||||
): ((...args: OmitFirst<Parameters<typeof updateReaderSettings<Settings>>>) => Promise<void>) =>
|
||||
(setting, value, isGlobal) =>
|
||||
updateReaderSettings(manga, setting, value, isGlobal, profile).catch(handleError);
|
||||
|
||||
@@ -64,12 +64,11 @@ export const updateMetadataServerSettings = async <
|
||||
>(
|
||||
setting: Setting,
|
||||
value: MetadataServerSettings[Setting],
|
||||
): Promise<void[]> =>
|
||||
requestUpdateServerMetadata([[setting, convertSettingsToMetadata({ [setting]: value })[setting]]]);
|
||||
): Promise<void> => requestUpdateServerMetadata([[setting, convertSettingsToMetadata({ [setting]: value })[setting]]]);
|
||||
|
||||
export const createUpdateMetadataServerSettings =
|
||||
<Settings extends MetadataServerSettingKeys>(
|
||||
handleError: (error: any) => void = defaultPromiseErrorHandler('createUpdateMetadataServerSettings'),
|
||||
): ((...args: Parameters<typeof updateMetadataServerSettings<Settings>>) => Promise<void | void[]>) =>
|
||||
): ((...args: Parameters<typeof updateMetadataServerSettings<Settings>>) => Promise<void>) =>
|
||||
(setting, value) =>
|
||||
updateMetadataServerSettings(setting, value).catch(handleError);
|
||||
|
||||
@@ -50,7 +50,7 @@ export const updateSourceMetadata = async <
|
||||
source: SourceIdInfo & GqlMetaHolder,
|
||||
metadataKey: MetadataKey,
|
||||
value: ISourceMetadata[MetadataKey],
|
||||
): Promise<void[]> =>
|
||||
): Promise<void> =>
|
||||
requestUpdateSourceMetadata(source, [
|
||||
[metadataKey, convertAppMetadataToGqlMetadata({ [metadataKey]: value })[metadataKey]],
|
||||
]);
|
||||
@@ -59,6 +59,6 @@ export const createUpdateSourceMetadata =
|
||||
<Settings extends SourceMetadataKeys>(
|
||||
source: SourceIdInfo & GqlMetaHolder,
|
||||
handleError: (error: any) => void = defaultPromiseErrorHandler('createUpdateSourceMetadata'),
|
||||
): ((...args: OmitFirst<Parameters<typeof updateSourceMetadata<Settings>>>) => Promise<void | void[]>) =>
|
||||
): ((...args: OmitFirst<Parameters<typeof updateSourceMetadata<Settings>>>) => Promise<void>) =>
|
||||
(metadataKey, value) =>
|
||||
updateSourceMetadata(source, metadataKey, value).catch(handleError);
|
||||
|
||||
@@ -33,9 +33,9 @@ export const DELETE_CATEGORY = gql`
|
||||
export const DELETE_CATEGORY_METADATA = gql`
|
||||
${CATEGORY_META_FIELDS}
|
||||
|
||||
mutation DELETE_CATEGORY_METADATA($input: DeleteCategoryMetaInput!) {
|
||||
deleteCategoryMeta(input: $input) {
|
||||
meta {
|
||||
mutation DELETE_CATEGORY_METADATA($input: DeleteCategoryMetasInput!) {
|
||||
deleteCategoryMetas(input: $input) {
|
||||
metas {
|
||||
...CATEGORY_META_FIELDS
|
||||
}
|
||||
}
|
||||
@@ -45,9 +45,9 @@ export const DELETE_CATEGORY_METADATA = gql`
|
||||
export const SET_CATEGORY_METADATA = gql`
|
||||
${CATEGORY_META_FIELDS}
|
||||
|
||||
mutation SET_CATEGORY_METADATA($input: SetCategoryMetaInput!) {
|
||||
setCategoryMeta(input: $input) {
|
||||
meta {
|
||||
mutation SET_CATEGORY_METADATA($input: SetCategoryMetasInput!) {
|
||||
setCategoryMetas(input: $input) {
|
||||
metas {
|
||||
...CATEGORY_META_FIELDS
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@ import { MANGA_CHAPTER_NODE_FIELDS, MANGA_CHAPTER_STAT_FIELDS } from '@/lib/grap
|
||||
export const DELETE_CHAPTER_METADATA = gql`
|
||||
${CHAPTER_META_FIELDS}
|
||||
|
||||
mutation DELETE_CHAPTER_METADATA($input: DeleteChapterMetaInput!) {
|
||||
deleteChapterMeta(input: $input) {
|
||||
meta {
|
||||
mutation DELETE_CHAPTER_METADATA($input: DeleteChapterMetasInput!) {
|
||||
deleteChapterMetas(input: $input) {
|
||||
metas {
|
||||
...CHAPTER_META_FIELDS
|
||||
}
|
||||
}
|
||||
@@ -59,9 +59,9 @@ export const GET_MANGA_CHAPTERS_FETCH = gql`
|
||||
export const SET_CHAPTER_METADATA = gql`
|
||||
${CHAPTER_META_FIELDS}
|
||||
|
||||
mutation SET_CHAPTER_METADATA($input: SetChapterMetaInput!) {
|
||||
setChapterMeta(input: $input) {
|
||||
meta {
|
||||
mutation SET_CHAPTER_METADATA($input: SetChapterMetasInput!) {
|
||||
setChapterMetas(input: $input) {
|
||||
metas {
|
||||
...CHAPTER_META_FIELDS
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,6 +155,12 @@ export type DeleteCategoryMetaPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
meta?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type DeleteCategoryMetasPayloadKeySpecifier = ('categories' | 'clientMutationId' | 'metas' | DeleteCategoryMetasPayloadKeySpecifier)[];
|
||||
export type DeleteCategoryMetasPayloadFieldPolicy = {
|
||||
categories?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
metas?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type DeleteCategoryPayloadKeySpecifier = ('category' | 'clientMutationId' | 'mangas' | DeleteCategoryPayloadKeySpecifier)[];
|
||||
export type DeleteCategoryPayloadFieldPolicy = {
|
||||
category?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -167,6 +173,12 @@ export type DeleteChapterMetaPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
meta?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type DeleteChapterMetasPayloadKeySpecifier = ('chapters' | 'clientMutationId' | 'metas' | DeleteChapterMetasPayloadKeySpecifier)[];
|
||||
export type DeleteChapterMetasPayloadFieldPolicy = {
|
||||
chapters?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
metas?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type DeleteDownloadedChapterPayloadKeySpecifier = ('chapters' | 'clientMutationId' | DeleteDownloadedChapterPayloadKeySpecifier)[];
|
||||
export type DeleteDownloadedChapterPayloadFieldPolicy = {
|
||||
chapters?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -182,18 +194,35 @@ export type DeleteGlobalMetaPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
meta?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type DeleteGlobalMetasPayloadKeySpecifier = ('clientMutationId' | 'metas' | DeleteGlobalMetasPayloadKeySpecifier)[];
|
||||
export type DeleteGlobalMetasPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
metas?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type DeleteMangaMetaPayloadKeySpecifier = ('clientMutationId' | 'manga' | 'meta' | DeleteMangaMetaPayloadKeySpecifier)[];
|
||||
export type DeleteMangaMetaPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
manga?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
meta?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type DeleteMangaMetasPayloadKeySpecifier = ('clientMutationId' | 'mangas' | 'metas' | DeleteMangaMetasPayloadKeySpecifier)[];
|
||||
export type DeleteMangaMetasPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
mangas?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
metas?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type DeleteSourceMetaPayloadKeySpecifier = ('clientMutationId' | 'meta' | 'source' | DeleteSourceMetaPayloadKeySpecifier)[];
|
||||
export type DeleteSourceMetaPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
meta?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
source?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type DeleteSourceMetasPayloadKeySpecifier = ('clientMutationId' | 'metas' | 'sources' | DeleteSourceMetasPayloadKeySpecifier)[];
|
||||
export type DeleteSourceMetasPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
metas?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
sources?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type DequeueChapterDownloadPayloadKeySpecifier = ('clientMutationId' | 'downloadStatus' | DequeueChapterDownloadPayloadKeySpecifier)[];
|
||||
export type DequeueChapterDownloadPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -506,7 +535,7 @@ export type MultiSelectListPreferenceFieldPolicy = {
|
||||
title?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
visible?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type MutationKeySpecifier = ('bindTrack' | 'clearCachedImages' | 'clearDownloader' | 'connectKoSyncAccount' | 'createBackup' | 'createCategory' | 'deleteCategory' | 'deleteCategoryMeta' | 'deleteChapterMeta' | 'deleteDownloadedChapter' | 'deleteDownloadedChapters' | 'deleteGlobalMeta' | 'deleteMangaMeta' | 'deleteSourceMeta' | 'dequeueChapterDownload' | 'dequeueChapterDownloads' | 'enqueueChapterDownload' | 'enqueueChapterDownloads' | 'fetchChapterPages' | 'fetchChapters' | 'fetchExtensions' | 'fetchManga' | 'fetchSourceManga' | 'fetchTrack' | 'installExternalExtension' | 'login' | 'loginTrackerCredentials' | 'loginTrackerOAuth' | 'logoutKoSyncAccount' | 'logoutTracker' | 'pullKoSyncProgress' | 'pushKoSyncProgress' | 'refreshToken' | 'reorderChapterDownload' | 'resetSettings' | 'resetWebUIUpdateStatus' | 'restoreBackup' | 'setCategoryMeta' | 'setChapterMeta' | 'setGlobalMeta' | 'setMangaMeta' | 'setSettings' | 'setSourceMeta' | 'startDownloader' | 'stopDownloader' | 'trackProgress' | 'unbindTrack' | 'updateCategories' | 'updateCategory' | 'updateCategoryManga' | 'updateCategoryOrder' | 'updateChapter' | 'updateChapters' | 'updateExtension' | 'updateExtensions' | 'updateLibrary' | 'updateLibraryManga' | 'updateManga' | 'updateMangaCategories' | 'updateMangas' | 'updateMangasCategories' | 'updateSourcePreference' | 'updateStop' | 'updateTrack' | 'updateWebUI' | MutationKeySpecifier)[];
|
||||
export type MutationKeySpecifier = ('bindTrack' | 'clearCachedImages' | 'clearDownloader' | 'connectKoSyncAccount' | 'createBackup' | 'createCategory' | 'deleteCategory' | 'deleteCategoryMeta' | 'deleteCategoryMetas' | 'deleteChapterMeta' | 'deleteChapterMetas' | 'deleteDownloadedChapter' | 'deleteDownloadedChapters' | 'deleteGlobalMeta' | 'deleteGlobalMetas' | 'deleteMangaMeta' | 'deleteMangaMetas' | 'deleteSourceMeta' | 'deleteSourceMetas' | 'dequeueChapterDownload' | 'dequeueChapterDownloads' | 'enqueueChapterDownload' | 'enqueueChapterDownloads' | 'fetchChapterPages' | 'fetchChapters' | 'fetchExtensions' | 'fetchManga' | 'fetchSourceManga' | 'fetchTrack' | 'installExternalExtension' | 'login' | 'loginTrackerCredentials' | 'loginTrackerOAuth' | 'logoutKoSyncAccount' | 'logoutTracker' | 'pullKoSyncProgress' | 'pushKoSyncProgress' | 'refreshToken' | 'reorderChapterDownload' | 'resetSettings' | 'resetWebUIUpdateStatus' | 'restoreBackup' | 'setCategoryMeta' | 'setCategoryMetas' | 'setChapterMeta' | 'setChapterMetas' | 'setGlobalMeta' | 'setGlobalMetas' | 'setMangaMeta' | 'setMangaMetas' | 'setSettings' | 'setSourceMeta' | 'setSourceMetas' | 'startDownloader' | 'stopDownloader' | 'trackProgress' | 'unbindTrack' | 'updateCategories' | 'updateCategory' | 'updateCategoryManga' | 'updateCategoryOrder' | 'updateChapter' | 'updateChapters' | 'updateExtension' | 'updateExtensions' | 'updateLibrary' | 'updateLibraryManga' | 'updateManga' | 'updateMangaCategories' | 'updateMangas' | 'updateMangasCategories' | 'updateSourcePreference' | 'updateStop' | 'updateTrack' | 'updateWebUI' | MutationKeySpecifier)[];
|
||||
export type MutationFieldPolicy = {
|
||||
bindTrack?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
clearCachedImages?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -516,12 +545,17 @@ export type MutationFieldPolicy = {
|
||||
createCategory?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
deleteCategory?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
deleteCategoryMeta?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
deleteCategoryMetas?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
deleteChapterMeta?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
deleteChapterMetas?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
deleteDownloadedChapter?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
deleteDownloadedChapters?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
deleteGlobalMeta?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
deleteGlobalMetas?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
deleteMangaMeta?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
deleteMangaMetas?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
deleteSourceMeta?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
deleteSourceMetas?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
dequeueChapterDownload?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
dequeueChapterDownloads?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
enqueueChapterDownload?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -546,11 +580,16 @@ export type MutationFieldPolicy = {
|
||||
resetWebUIUpdateStatus?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
restoreBackup?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
setCategoryMeta?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
setCategoryMetas?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
setChapterMeta?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
setChapterMetas?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
setGlobalMeta?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
setGlobalMetas?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
setMangaMeta?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
setMangaMetas?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
setSettings?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
setSourceMeta?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
setSourceMetas?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
startDownloader?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
stopDownloader?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
trackProgress?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -761,21 +800,44 @@ export type SetCategoryMetaPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
meta?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type SetCategoryMetasPayloadKeySpecifier = ('categories' | 'clientMutationId' | 'metas' | SetCategoryMetasPayloadKeySpecifier)[];
|
||||
export type SetCategoryMetasPayloadFieldPolicy = {
|
||||
categories?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
metas?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type SetChapterMetaPayloadKeySpecifier = ('clientMutationId' | 'meta' | SetChapterMetaPayloadKeySpecifier)[];
|
||||
export type SetChapterMetaPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
meta?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type SetChapterMetasPayloadKeySpecifier = ('chapters' | 'clientMutationId' | 'metas' | SetChapterMetasPayloadKeySpecifier)[];
|
||||
export type SetChapterMetasPayloadFieldPolicy = {
|
||||
chapters?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
metas?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type SetGlobalMetaPayloadKeySpecifier = ('clientMutationId' | 'meta' | SetGlobalMetaPayloadKeySpecifier)[];
|
||||
export type SetGlobalMetaPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
meta?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type SetGlobalMetasPayloadKeySpecifier = ('clientMutationId' | 'metas' | SetGlobalMetasPayloadKeySpecifier)[];
|
||||
export type SetGlobalMetasPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
metas?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type SetMangaMetaPayloadKeySpecifier = ('clientMutationId' | 'meta' | SetMangaMetaPayloadKeySpecifier)[];
|
||||
export type SetMangaMetaPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
meta?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type SetMangaMetasPayloadKeySpecifier = ('clientMutationId' | 'mangas' | 'metas' | SetMangaMetasPayloadKeySpecifier)[];
|
||||
export type SetMangaMetasPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
mangas?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
metas?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type SetSettingsPayloadKeySpecifier = ('clientMutationId' | 'settings' | SetSettingsPayloadKeySpecifier)[];
|
||||
export type SetSettingsPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -786,6 +848,12 @@ export type SetSourceMetaPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
meta?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type SetSourceMetasPayloadKeySpecifier = ('clientMutationId' | 'metas' | 'sources' | SetSourceMetasPayloadKeySpecifier)[];
|
||||
export type SetSourceMetasPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
metas?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
sources?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type SettingsKeySpecifier = ('authMode' | 'authPassword' | 'authUsername' | 'autoBackupIncludeCategories' | 'autoBackupIncludeChapters' | 'autoBackupIncludeClientData' | 'autoBackupIncludeHistory' | 'autoBackupIncludeManga' | 'autoBackupIncludeServerSettings' | 'autoBackupIncludeTracking' | 'autoDownloadAheadLimit' | 'autoDownloadIgnoreReUploads' | 'autoDownloadNewChapters' | 'autoDownloadNewChaptersLimit' | 'backupInterval' | 'backupPath' | 'backupTTL' | 'backupTime' | 'basicAuthEnabled' | 'basicAuthPassword' | 'basicAuthUsername' | 'databasePassword' | 'databaseType' | 'databaseUrl' | 'databaseUsername' | 'debugLogsEnabled' | 'downloadAsCbz' | 'downloadConversions' | 'downloadsPath' | 'electronPath' | 'excludeCompleted' | 'excludeEntryWithUnreadChapters' | 'excludeNotStarted' | 'excludeUnreadChapters' | 'extensionRepos' | 'flareSolverrAsResponseFallback' | 'flareSolverrEnabled' | 'flareSolverrSessionName' | 'flareSolverrSessionTtl' | 'flareSolverrTimeout' | 'flareSolverrUrl' | 'globalUpdateInterval' | 'gqlDebugLogsEnabled' | 'initialOpenInBrowserEnabled' | 'ip' | 'jwtAudience' | 'jwtRefreshExpiry' | 'jwtTokenExpiry' | 'koreaderSyncChecksumMethod' | 'koreaderSyncDeviceId' | 'koreaderSyncPercentageTolerance' | 'koreaderSyncServerUrl' | 'koreaderSyncStrategy' | 'koreaderSyncStrategyBackward' | 'koreaderSyncStrategyForward' | 'koreaderSyncUserkey' | 'koreaderSyncUsername' | 'localSourcePath' | 'maxLogFileSize' | 'maxLogFiles' | 'maxLogFolderSize' | 'maxSourcesInParallel' | 'opdsCbzMimetype' | 'opdsChapterSortOrder' | 'opdsEnablePageReadProgress' | 'opdsItemsPerPage' | 'opdsMarkAsReadOnDownload' | 'opdsShowOnlyDownloadedChapters' | 'opdsShowOnlyUnreadChapters' | 'opdsUseBinaryFileSizes' | 'port' | 'serveConversions' | 'socksProxyEnabled' | 'socksProxyHost' | 'socksProxyPassword' | 'socksProxyPort' | 'socksProxyUsername' | 'socksProxyVersion' | 'systemTrayEnabled' | 'updateMangas' | 'useHikariConnectionPool' | 'webUIChannel' | 'webUIFlavor' | 'webUIInterface' | 'webUIUpdateCheckInterval' | SettingsKeySpecifier)[];
|
||||
export type SettingsFieldPolicy = {
|
||||
authMode?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -1418,6 +1486,10 @@ export type StrictTypedTypePolicies = {
|
||||
keyFields?: false | DeleteCategoryMetaPayloadKeySpecifier | (() => undefined | DeleteCategoryMetaPayloadKeySpecifier),
|
||||
fields?: DeleteCategoryMetaPayloadFieldPolicy,
|
||||
},
|
||||
DeleteCategoryMetasPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | DeleteCategoryMetasPayloadKeySpecifier | (() => undefined | DeleteCategoryMetasPayloadKeySpecifier),
|
||||
fields?: DeleteCategoryMetasPayloadFieldPolicy,
|
||||
},
|
||||
DeleteCategoryPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | DeleteCategoryPayloadKeySpecifier | (() => undefined | DeleteCategoryPayloadKeySpecifier),
|
||||
fields?: DeleteCategoryPayloadFieldPolicy,
|
||||
@@ -1426,6 +1498,10 @@ export type StrictTypedTypePolicies = {
|
||||
keyFields?: false | DeleteChapterMetaPayloadKeySpecifier | (() => undefined | DeleteChapterMetaPayloadKeySpecifier),
|
||||
fields?: DeleteChapterMetaPayloadFieldPolicy,
|
||||
},
|
||||
DeleteChapterMetasPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | DeleteChapterMetasPayloadKeySpecifier | (() => undefined | DeleteChapterMetasPayloadKeySpecifier),
|
||||
fields?: DeleteChapterMetasPayloadFieldPolicy,
|
||||
},
|
||||
DeleteDownloadedChapterPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | DeleteDownloadedChapterPayloadKeySpecifier | (() => undefined | DeleteDownloadedChapterPayloadKeySpecifier),
|
||||
fields?: DeleteDownloadedChapterPayloadFieldPolicy,
|
||||
@@ -1438,14 +1514,26 @@ export type StrictTypedTypePolicies = {
|
||||
keyFields?: false | DeleteGlobalMetaPayloadKeySpecifier | (() => undefined | DeleteGlobalMetaPayloadKeySpecifier),
|
||||
fields?: DeleteGlobalMetaPayloadFieldPolicy,
|
||||
},
|
||||
DeleteGlobalMetasPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | DeleteGlobalMetasPayloadKeySpecifier | (() => undefined | DeleteGlobalMetasPayloadKeySpecifier),
|
||||
fields?: DeleteGlobalMetasPayloadFieldPolicy,
|
||||
},
|
||||
DeleteMangaMetaPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | DeleteMangaMetaPayloadKeySpecifier | (() => undefined | DeleteMangaMetaPayloadKeySpecifier),
|
||||
fields?: DeleteMangaMetaPayloadFieldPolicy,
|
||||
},
|
||||
DeleteMangaMetasPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | DeleteMangaMetasPayloadKeySpecifier | (() => undefined | DeleteMangaMetasPayloadKeySpecifier),
|
||||
fields?: DeleteMangaMetasPayloadFieldPolicy,
|
||||
},
|
||||
DeleteSourceMetaPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | DeleteSourceMetaPayloadKeySpecifier | (() => undefined | DeleteSourceMetaPayloadKeySpecifier),
|
||||
fields?: DeleteSourceMetaPayloadFieldPolicy,
|
||||
},
|
||||
DeleteSourceMetasPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | DeleteSourceMetasPayloadKeySpecifier | (() => undefined | DeleteSourceMetasPayloadKeySpecifier),
|
||||
fields?: DeleteSourceMetasPayloadFieldPolicy,
|
||||
},
|
||||
DequeueChapterDownloadPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | DequeueChapterDownloadPayloadKeySpecifier | (() => undefined | DequeueChapterDownloadPayloadKeySpecifier),
|
||||
fields?: DequeueChapterDownloadPayloadFieldPolicy,
|
||||
@@ -1682,18 +1770,34 @@ export type StrictTypedTypePolicies = {
|
||||
keyFields?: false | SetCategoryMetaPayloadKeySpecifier | (() => undefined | SetCategoryMetaPayloadKeySpecifier),
|
||||
fields?: SetCategoryMetaPayloadFieldPolicy,
|
||||
},
|
||||
SetCategoryMetasPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | SetCategoryMetasPayloadKeySpecifier | (() => undefined | SetCategoryMetasPayloadKeySpecifier),
|
||||
fields?: SetCategoryMetasPayloadFieldPolicy,
|
||||
},
|
||||
SetChapterMetaPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | SetChapterMetaPayloadKeySpecifier | (() => undefined | SetChapterMetaPayloadKeySpecifier),
|
||||
fields?: SetChapterMetaPayloadFieldPolicy,
|
||||
},
|
||||
SetChapterMetasPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | SetChapterMetasPayloadKeySpecifier | (() => undefined | SetChapterMetasPayloadKeySpecifier),
|
||||
fields?: SetChapterMetasPayloadFieldPolicy,
|
||||
},
|
||||
SetGlobalMetaPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | SetGlobalMetaPayloadKeySpecifier | (() => undefined | SetGlobalMetaPayloadKeySpecifier),
|
||||
fields?: SetGlobalMetaPayloadFieldPolicy,
|
||||
},
|
||||
SetGlobalMetasPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | SetGlobalMetasPayloadKeySpecifier | (() => undefined | SetGlobalMetasPayloadKeySpecifier),
|
||||
fields?: SetGlobalMetasPayloadFieldPolicy,
|
||||
},
|
||||
SetMangaMetaPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | SetMangaMetaPayloadKeySpecifier | (() => undefined | SetMangaMetaPayloadKeySpecifier),
|
||||
fields?: SetMangaMetaPayloadFieldPolicy,
|
||||
},
|
||||
SetMangaMetasPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | SetMangaMetasPayloadKeySpecifier | (() => undefined | SetMangaMetasPayloadKeySpecifier),
|
||||
fields?: SetMangaMetasPayloadFieldPolicy,
|
||||
},
|
||||
SetSettingsPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | SetSettingsPayloadKeySpecifier | (() => undefined | SetSettingsPayloadKeySpecifier),
|
||||
fields?: SetSettingsPayloadFieldPolicy,
|
||||
@@ -1702,6 +1806,10 @@ export type StrictTypedTypePolicies = {
|
||||
keyFields?: false | SetSourceMetaPayloadKeySpecifier | (() => undefined | SetSourceMetaPayloadKeySpecifier),
|
||||
fields?: SetSourceMetaPayloadFieldPolicy,
|
||||
},
|
||||
SetSourceMetasPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | SetSourceMetasPayloadKeySpecifier | (() => undefined | SetSourceMetasPayloadKeySpecifier),
|
||||
fields?: SetSourceMetasPayloadFieldPolicy,
|
||||
},
|
||||
Settings?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | SettingsKeySpecifier | (() => undefined | SettingsKeySpecifier),
|
||||
fields?: SettingsFieldPolicy,
|
||||
|
||||
@@ -391,6 +391,24 @@ export type DeleteCategoryMetaPayload = {
|
||||
meta?: Maybe<CategoryMetaType>;
|
||||
};
|
||||
|
||||
export type DeleteCategoryMetasInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
items: Array<DeleteCategoryMetasItemInput>;
|
||||
};
|
||||
|
||||
export type DeleteCategoryMetasItemInput = {
|
||||
categoryIds: Array<Scalars['Int']['input']>;
|
||||
keys?: InputMaybe<Array<Scalars['String']['input']>>;
|
||||
prefixes?: InputMaybe<Array<Scalars['String']['input']>>;
|
||||
};
|
||||
|
||||
export type DeleteCategoryMetasPayload = {
|
||||
__typename?: 'DeleteCategoryMetasPayload';
|
||||
categories: Array<CategoryType>;
|
||||
clientMutationId?: Maybe<Scalars['String']['output']>;
|
||||
metas: Array<CategoryMetaType>;
|
||||
};
|
||||
|
||||
export type DeleteCategoryPayload = {
|
||||
__typename?: 'DeleteCategoryPayload';
|
||||
category?: Maybe<CategoryType>;
|
||||
@@ -411,6 +429,24 @@ export type DeleteChapterMetaPayload = {
|
||||
meta?: Maybe<ChapterMetaType>;
|
||||
};
|
||||
|
||||
export type DeleteChapterMetasInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
items: Array<DeleteChapterMetasItemInput>;
|
||||
};
|
||||
|
||||
export type DeleteChapterMetasItemInput = {
|
||||
chapterIds: Array<Scalars['Int']['input']>;
|
||||
keys?: InputMaybe<Array<Scalars['String']['input']>>;
|
||||
prefixes?: InputMaybe<Array<Scalars['String']['input']>>;
|
||||
};
|
||||
|
||||
export type DeleteChapterMetasPayload = {
|
||||
__typename?: 'DeleteChapterMetasPayload';
|
||||
chapters: Array<ChapterType>;
|
||||
clientMutationId?: Maybe<Scalars['String']['output']>;
|
||||
metas: Array<ChapterMetaType>;
|
||||
};
|
||||
|
||||
export type DeleteDownloadedChapterInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
id: Scalars['Int']['input'];
|
||||
@@ -444,6 +480,18 @@ export type DeleteGlobalMetaPayload = {
|
||||
meta?: Maybe<GlobalMetaType>;
|
||||
};
|
||||
|
||||
export type DeleteGlobalMetasInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
keys?: InputMaybe<Array<Scalars['String']['input']>>;
|
||||
prefixes?: InputMaybe<Array<Scalars['String']['input']>>;
|
||||
};
|
||||
|
||||
export type DeleteGlobalMetasPayload = {
|
||||
__typename?: 'DeleteGlobalMetasPayload';
|
||||
clientMutationId?: Maybe<Scalars['String']['output']>;
|
||||
metas: Array<GlobalMetaType>;
|
||||
};
|
||||
|
||||
export type DeleteMangaMetaInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
key: Scalars['String']['input'];
|
||||
@@ -457,6 +505,24 @@ export type DeleteMangaMetaPayload = {
|
||||
meta?: Maybe<MangaMetaType>;
|
||||
};
|
||||
|
||||
export type DeleteMangaMetasInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
items: Array<DeleteMangaMetasItemInput>;
|
||||
};
|
||||
|
||||
export type DeleteMangaMetasItemInput = {
|
||||
keys?: InputMaybe<Array<Scalars['String']['input']>>;
|
||||
mangaIds: Array<Scalars['Int']['input']>;
|
||||
prefixes?: InputMaybe<Array<Scalars['String']['input']>>;
|
||||
};
|
||||
|
||||
export type DeleteMangaMetasPayload = {
|
||||
__typename?: 'DeleteMangaMetasPayload';
|
||||
clientMutationId?: Maybe<Scalars['String']['output']>;
|
||||
mangas: Array<MangaType>;
|
||||
metas: Array<MangaMetaType>;
|
||||
};
|
||||
|
||||
export type DeleteSourceMetaInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
key: Scalars['String']['input'];
|
||||
@@ -470,6 +536,24 @@ export type DeleteSourceMetaPayload = {
|
||||
source?: Maybe<SourceType>;
|
||||
};
|
||||
|
||||
export type DeleteSourceMetasInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
items: Array<DeleteSourceMetasItemInput>;
|
||||
};
|
||||
|
||||
export type DeleteSourceMetasItemInput = {
|
||||
keys?: InputMaybe<Array<Scalars['String']['input']>>;
|
||||
prefixes?: InputMaybe<Array<Scalars['String']['input']>>;
|
||||
sourceIds: Array<Scalars['LongString']['input']>;
|
||||
};
|
||||
|
||||
export type DeleteSourceMetasPayload = {
|
||||
__typename?: 'DeleteSourceMetasPayload';
|
||||
clientMutationId?: Maybe<Scalars['String']['output']>;
|
||||
metas: Array<SourceMetaType>;
|
||||
sources: Array<SourceType>;
|
||||
};
|
||||
|
||||
export type DequeueChapterDownloadInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
id: Scalars['Int']['input'];
|
||||
@@ -1185,6 +1269,11 @@ export type MetaFilterInput = {
|
||||
value?: InputMaybe<StringFilterInput>;
|
||||
};
|
||||
|
||||
export type MetaInput = {
|
||||
key: Scalars['String']['input'];
|
||||
value: Scalars['String']['input'];
|
||||
};
|
||||
|
||||
export enum MetaOrderBy {
|
||||
Key = 'KEY',
|
||||
Value = 'VALUE'
|
||||
@@ -1225,12 +1314,17 @@ export type Mutation = {
|
||||
createCategory?: Maybe<CreateCategoryPayload>;
|
||||
deleteCategory?: Maybe<DeleteCategoryPayload>;
|
||||
deleteCategoryMeta?: Maybe<DeleteCategoryMetaPayload>;
|
||||
deleteCategoryMetas?: Maybe<DeleteCategoryMetasPayload>;
|
||||
deleteChapterMeta?: Maybe<DeleteChapterMetaPayload>;
|
||||
deleteChapterMetas?: Maybe<DeleteChapterMetasPayload>;
|
||||
deleteDownloadedChapter?: Maybe<DeleteDownloadedChapterPayload>;
|
||||
deleteDownloadedChapters?: Maybe<DeleteDownloadedChaptersPayload>;
|
||||
deleteGlobalMeta?: Maybe<DeleteGlobalMetaPayload>;
|
||||
deleteGlobalMetas?: Maybe<DeleteGlobalMetasPayload>;
|
||||
deleteMangaMeta?: Maybe<DeleteMangaMetaPayload>;
|
||||
deleteMangaMetas?: Maybe<DeleteMangaMetasPayload>;
|
||||
deleteSourceMeta?: Maybe<DeleteSourceMetaPayload>;
|
||||
deleteSourceMetas?: Maybe<DeleteSourceMetasPayload>;
|
||||
dequeueChapterDownload?: Maybe<DequeueChapterDownloadPayload>;
|
||||
dequeueChapterDownloads?: Maybe<DequeueChapterDownloadsPayload>;
|
||||
enqueueChapterDownload?: Maybe<EnqueueChapterDownloadPayload>;
|
||||
@@ -1255,11 +1349,16 @@ export type Mutation = {
|
||||
resetWebUIUpdateStatus?: Maybe<WebUiUpdateStatus>;
|
||||
restoreBackup: RestoreBackupPayload;
|
||||
setCategoryMeta?: Maybe<SetCategoryMetaPayload>;
|
||||
setCategoryMetas?: Maybe<SetCategoryMetasPayload>;
|
||||
setChapterMeta?: Maybe<SetChapterMetaPayload>;
|
||||
setChapterMetas?: Maybe<SetChapterMetasPayload>;
|
||||
setGlobalMeta?: Maybe<SetGlobalMetaPayload>;
|
||||
setGlobalMetas?: Maybe<SetGlobalMetasPayload>;
|
||||
setMangaMeta?: Maybe<SetMangaMetaPayload>;
|
||||
setMangaMetas?: Maybe<SetMangaMetasPayload>;
|
||||
setSettings: SetSettingsPayload;
|
||||
setSourceMeta?: Maybe<SetSourceMetaPayload>;
|
||||
setSourceMetas?: Maybe<SetSourceMetasPayload>;
|
||||
startDownloader?: Maybe<StartDownloaderPayload>;
|
||||
stopDownloader?: Maybe<StopDownloaderPayload>;
|
||||
trackProgress?: Maybe<TrackProgressPayload>;
|
||||
@@ -1325,11 +1424,21 @@ export type MutationDeleteCategoryMetaArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type MutationDeleteCategoryMetasArgs = {
|
||||
input: DeleteCategoryMetasInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDeleteChapterMetaArgs = {
|
||||
input: DeleteChapterMetaInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDeleteChapterMetasArgs = {
|
||||
input: DeleteChapterMetasInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDeleteDownloadedChapterArgs = {
|
||||
input: DeleteDownloadedChapterInput;
|
||||
};
|
||||
@@ -1345,16 +1454,31 @@ export type MutationDeleteGlobalMetaArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type MutationDeleteGlobalMetasArgs = {
|
||||
input: DeleteGlobalMetasInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDeleteMangaMetaArgs = {
|
||||
input: DeleteMangaMetaInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDeleteMangaMetasArgs = {
|
||||
input: DeleteMangaMetasInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDeleteSourceMetaArgs = {
|
||||
input: DeleteSourceMetaInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDeleteSourceMetasArgs = {
|
||||
input: DeleteSourceMetasInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDequeueChapterDownloadArgs = {
|
||||
input: DequeueChapterDownloadInput;
|
||||
};
|
||||
@@ -1470,21 +1594,41 @@ export type MutationSetCategoryMetaArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type MutationSetCategoryMetasArgs = {
|
||||
input: SetCategoryMetasInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSetChapterMetaArgs = {
|
||||
input: SetChapterMetaInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSetChapterMetasArgs = {
|
||||
input: SetChapterMetasInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSetGlobalMetaArgs = {
|
||||
input: SetGlobalMetaInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSetGlobalMetasArgs = {
|
||||
input: SetGlobalMetasInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSetMangaMetaArgs = {
|
||||
input: SetMangaMetaInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSetMangaMetasArgs = {
|
||||
input: SetMangaMetasInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSetSettingsArgs = {
|
||||
input: SetSettingsInput;
|
||||
};
|
||||
@@ -1495,6 +1639,11 @@ export type MutationSetSourceMetaArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type MutationSetSourceMetasArgs = {
|
||||
input: SetSourceMetasInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationStartDownloaderArgs = {
|
||||
input: StartDownloaderInput;
|
||||
};
|
||||
@@ -2122,6 +2271,23 @@ export type SetCategoryMetaPayload = {
|
||||
meta: CategoryMetaType;
|
||||
};
|
||||
|
||||
export type SetCategoryMetasInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
items: Array<SetCategoryMetasItemInput>;
|
||||
};
|
||||
|
||||
export type SetCategoryMetasItemInput = {
|
||||
categoryIds: Array<Scalars['Int']['input']>;
|
||||
metas: Array<MetaInput>;
|
||||
};
|
||||
|
||||
export type SetCategoryMetasPayload = {
|
||||
__typename?: 'SetCategoryMetasPayload';
|
||||
categories: Array<CategoryType>;
|
||||
clientMutationId?: Maybe<Scalars['String']['output']>;
|
||||
metas: Array<CategoryMetaType>;
|
||||
};
|
||||
|
||||
export type SetChapterMetaInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
meta: ChapterMetaTypeInput;
|
||||
@@ -2133,6 +2299,23 @@ export type SetChapterMetaPayload = {
|
||||
meta: ChapterMetaType;
|
||||
};
|
||||
|
||||
export type SetChapterMetasInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
items: Array<SetChapterMetasItemInput>;
|
||||
};
|
||||
|
||||
export type SetChapterMetasItemInput = {
|
||||
chapterIds: Array<Scalars['Int']['input']>;
|
||||
metas: Array<MetaInput>;
|
||||
};
|
||||
|
||||
export type SetChapterMetasPayload = {
|
||||
__typename?: 'SetChapterMetasPayload';
|
||||
chapters: Array<ChapterType>;
|
||||
clientMutationId?: Maybe<Scalars['String']['output']>;
|
||||
metas: Array<ChapterMetaType>;
|
||||
};
|
||||
|
||||
export type SetGlobalMetaInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
meta: GlobalMetaTypeInput;
|
||||
@@ -2144,6 +2327,17 @@ export type SetGlobalMetaPayload = {
|
||||
meta: GlobalMetaType;
|
||||
};
|
||||
|
||||
export type SetGlobalMetasInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
metas: Array<MetaInput>;
|
||||
};
|
||||
|
||||
export type SetGlobalMetasPayload = {
|
||||
__typename?: 'SetGlobalMetasPayload';
|
||||
clientMutationId?: Maybe<Scalars['String']['output']>;
|
||||
metas: Array<GlobalMetaType>;
|
||||
};
|
||||
|
||||
export type SetMangaMetaInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
meta: MangaMetaTypeInput;
|
||||
@@ -2155,6 +2349,23 @@ export type SetMangaMetaPayload = {
|
||||
meta: MangaMetaType;
|
||||
};
|
||||
|
||||
export type SetMangaMetasInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
items: Array<SetMangaMetasItemInput>;
|
||||
};
|
||||
|
||||
export type SetMangaMetasItemInput = {
|
||||
mangaIds: Array<Scalars['Int']['input']>;
|
||||
metas: Array<MetaInput>;
|
||||
};
|
||||
|
||||
export type SetMangaMetasPayload = {
|
||||
__typename?: 'SetMangaMetasPayload';
|
||||
clientMutationId?: Maybe<Scalars['String']['output']>;
|
||||
mangas: Array<MangaType>;
|
||||
metas: Array<MangaMetaType>;
|
||||
};
|
||||
|
||||
export type SetSettingsInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
settings: PartialSettingsTypeInput;
|
||||
@@ -2177,6 +2388,23 @@ export type SetSourceMetaPayload = {
|
||||
meta: SourceMetaType;
|
||||
};
|
||||
|
||||
export type SetSourceMetasInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
items: Array<SetSourceMetasItemInput>;
|
||||
};
|
||||
|
||||
export type SetSourceMetasItemInput = {
|
||||
metas: Array<MetaInput>;
|
||||
sourceIds: Array<Scalars['LongString']['input']>;
|
||||
};
|
||||
|
||||
export type SetSourceMetasPayload = {
|
||||
__typename?: 'SetSourceMetasPayload';
|
||||
clientMutationId?: Maybe<Scalars['String']['output']>;
|
||||
metas: Array<SourceMetaType>;
|
||||
sources: Array<SourceType>;
|
||||
};
|
||||
|
||||
export type Settings = {
|
||||
authMode?: Maybe<AuthMode>;
|
||||
authPassword?: Maybe<Scalars['String']['output']>;
|
||||
@@ -3282,18 +3510,18 @@ export type DeleteCategoryMutationVariables = Exact<{
|
||||
export type DeleteCategoryMutation = { __typename?: 'Mutation', deleteCategory?: { __typename?: 'DeleteCategoryPayload', category?: { __typename?: 'CategoryType', id: number } | null } | null };
|
||||
|
||||
export type DeleteCategoryMetadataMutationVariables = Exact<{
|
||||
input: DeleteCategoryMetaInput;
|
||||
input: DeleteCategoryMetasInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type DeleteCategoryMetadataMutation = { __typename?: 'Mutation', deleteCategoryMeta?: { __typename?: 'DeleteCategoryMetaPayload', meta?: { __typename?: 'CategoryMetaType', categoryId: number, key: string, value: string } | null } | null };
|
||||
export type DeleteCategoryMetadataMutation = { __typename?: 'Mutation', deleteCategoryMetas?: { __typename?: 'DeleteCategoryMetasPayload', metas: Array<{ __typename?: 'CategoryMetaType', categoryId: number, key: string, value: string }> } | null };
|
||||
|
||||
export type SetCategoryMetadataMutationVariables = Exact<{
|
||||
input: SetCategoryMetaInput;
|
||||
input: SetCategoryMetasInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type SetCategoryMetadataMutation = { __typename?: 'Mutation', setCategoryMeta?: { __typename?: 'SetCategoryMetaPayload', meta: { __typename?: 'CategoryMetaType', categoryId: number, key: string, value: string } } | null };
|
||||
export type SetCategoryMetadataMutation = { __typename?: 'Mutation', setCategoryMetas?: { __typename?: 'SetCategoryMetasPayload', metas: Array<{ __typename?: 'CategoryMetaType', categoryId: number, key: string, value: string }> } | null };
|
||||
|
||||
export type UpdateCategoryMutationVariables = Exact<{
|
||||
input: UpdateCategoryInput;
|
||||
@@ -3388,11 +3616,11 @@ export type ChapterUpdateListFieldsFragment = { __typename?: 'ChapterType', fetc
|
||||
export type ChapterHistoryListFieldsFragment = { __typename?: 'ChapterType', fetchedAt: string, uploadDate: string, lastReadAt: string, id: number, name: string, mangaId: number, scanlator?: string | null, realUrl?: string | null, sourceOrder: number, chapterNumber: number, isRead: boolean, isDownloaded: boolean, isBookmarked: boolean, manga: { __typename?: 'MangaType', id: number, title: string, thumbnailUrl?: string | null, thumbnailUrlLastFetched?: string | null, inLibrary: boolean, initialized: boolean, sourceId: string } };
|
||||
|
||||
export type DeleteChapterMetadataMutationVariables = Exact<{
|
||||
input: DeleteChapterMetaInput;
|
||||
input: DeleteChapterMetasInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type DeleteChapterMetadataMutation = { __typename?: 'Mutation', deleteChapterMeta?: { __typename?: 'DeleteChapterMetaPayload', meta?: { __typename?: 'ChapterMetaType', chapterId: number, key: string, value: string } | null } | null };
|
||||
export type DeleteChapterMetadataMutation = { __typename?: 'Mutation', deleteChapterMetas?: { __typename?: 'DeleteChapterMetasPayload', metas: Array<{ __typename?: 'ChapterMetaType', chapterId: number, key: string, value: string }> } | null };
|
||||
|
||||
export type GetChapterPagesFetchMutationVariables = Exact<{
|
||||
input: FetchChapterPagesInput;
|
||||
@@ -3409,11 +3637,11 @@ export type GetMangaChaptersFetchMutationVariables = Exact<{
|
||||
export type GetMangaChaptersFetchMutation = { __typename?: 'Mutation', fetchChapters?: { __typename?: 'FetchChaptersPayload', chapters: Array<{ __typename?: 'ChapterType', fetchedAt: string, uploadDate: string, lastReadAt: string, id: number, name: string, mangaId: number, scanlator?: string | null, realUrl?: string | null, sourceOrder: number, chapterNumber: number, isRead: boolean, isDownloaded: boolean, isBookmarked: boolean, manga: { __typename?: 'MangaType', id: number, unreadCount: number, downloadCount: number, bookmarkCount: number, hasDuplicateChapters: boolean, chapters: { __typename?: 'ChapterNodeList', totalCount: number }, firstUnreadChapter?: { __typename?: 'ChapterType', id: number, sourceOrder: number, isRead: boolean, mangaId: number, chapterNumber: number, name: string, scanlator?: string | null } | null, lastReadChapter?: { __typename?: 'ChapterType', id: number, sourceOrder: number, lastReadAt: string } | null, latestReadChapter?: { __typename?: 'ChapterType', id: number, sourceOrder: number, lastReadAt: string } | null, latestFetchedChapter?: { __typename?: 'ChapterType', id: number, fetchedAt: string } | null, latestUploadedChapter?: { __typename?: 'ChapterType', id: number, uploadDate: string } | null } }> } | null };
|
||||
|
||||
export type SetChapterMetadataMutationVariables = Exact<{
|
||||
input: SetChapterMetaInput;
|
||||
input: SetChapterMetasInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type SetChapterMetadataMutation = { __typename?: 'Mutation', setChapterMeta?: { __typename?: 'SetChapterMetaPayload', meta: { __typename?: 'ChapterMetaType', chapterId: number, key: string, value: string } } | null };
|
||||
export type SetChapterMetadataMutation = { __typename?: 'Mutation', setChapterMetas?: { __typename?: 'SetChapterMetasPayload', metas: Array<{ __typename?: 'ChapterMetaType', chapterId: number, key: string, value: string }> } | null };
|
||||
|
||||
export type UpdateChapterMutationVariables = Exact<{
|
||||
input: UpdateChapterInput;
|
||||
@@ -3697,11 +3925,11 @@ export type MangaScreenFieldsFragment = { __typename?: 'MangaType', artist?: str
|
||||
export type MangaLibraryDuplicateScreenFieldsFragment = { __typename?: 'MangaType', description?: string | null, id: number, title: string, thumbnailUrl?: string | null, thumbnailUrlLastFetched?: string | null, inLibrary: boolean, initialized: boolean, sourceId: string, unreadCount: number, downloadCount: number, bookmarkCount: number, hasDuplicateChapters: boolean, chapters: { __typename?: 'ChapterNodeList', totalCount: number } };
|
||||
|
||||
export type DeleteMangaMetadataMutationVariables = Exact<{
|
||||
input: DeleteMangaMetaInput;
|
||||
input: DeleteMangaMetasInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type DeleteMangaMetadataMutation = { __typename?: 'Mutation', deleteMangaMeta?: { __typename?: 'DeleteMangaMetaPayload', meta?: { __typename?: 'MangaMetaType', mangaId: number, key: string, value: string } | null } | null };
|
||||
export type DeleteMangaMetadataMutation = { __typename?: 'Mutation', deleteMangaMetas?: { __typename?: 'DeleteMangaMetasPayload', metas: Array<{ __typename?: 'MangaMetaType', mangaId: number, key: string, value: string }> } | null };
|
||||
|
||||
export type GetMangaFetchMutationVariables = Exact<{
|
||||
input: FetchMangaInput;
|
||||
@@ -3721,11 +3949,11 @@ export type GetMangaToMigrateToFetchMutationVariables = Exact<{
|
||||
export type GetMangaToMigrateToFetchMutation = { __typename?: 'Mutation', fetchManga?: { __typename?: 'FetchMangaPayload', manga: { __typename?: 'MangaType', id: number, title: string, inLibrary: boolean, categories?: { __typename?: 'CategoryNodeList', nodes: Array<{ __typename?: 'CategoryType', id: number }> }, trackRecords?: { __typename?: 'TrackRecordNodeList', nodes: Array<{ __typename?: 'TrackRecordType', id: number, remoteId: string, trackerId: number }> } } } | null, fetchChapters?: { __typename?: 'FetchChaptersPayload', chapters: Array<{ __typename?: 'ChapterType', id: number, chapterNumber: number, isRead: boolean, isDownloaded: boolean, isBookmarked: boolean, manga: { __typename?: 'MangaType', id: number } }> } | null };
|
||||
|
||||
export type SetMangaMetadataMutationVariables = Exact<{
|
||||
input: SetMangaMetaInput;
|
||||
input: SetMangaMetasInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type SetMangaMetadataMutation = { __typename?: 'Mutation', setMangaMeta?: { __typename?: 'SetMangaMetaPayload', meta: { __typename?: 'MangaMetaType', mangaId: number, key: string, value: string } } | null };
|
||||
export type SetMangaMetadataMutation = { __typename?: 'Mutation', setMangaMetas?: { __typename?: 'SetMangaMetasPayload', metas: Array<{ __typename?: 'MangaMetaType', mangaId: number, key: string, value: string }> } | null };
|
||||
|
||||
export type UpdateMangaMutationVariables = Exact<{
|
||||
input: UpdateMangaInput;
|
||||
@@ -3852,18 +4080,18 @@ export type GetLibraryMangaCountQueryVariables = Exact<{ [key: string]: never; }
|
||||
export type GetLibraryMangaCountQuery = { __typename?: 'Query', mangas: { __typename?: 'MangaNodeList', totalCount: number } };
|
||||
|
||||
export type DeleteGlobalMetadataMutationVariables = Exact<{
|
||||
input: DeleteGlobalMetaInput;
|
||||
input: DeleteGlobalMetasInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type DeleteGlobalMetadataMutation = { __typename?: 'Mutation', deleteGlobalMeta?: { __typename?: 'DeleteGlobalMetaPayload', meta?: { __typename?: 'GlobalMetaType', key: string, value: string } | null } | null };
|
||||
export type DeleteGlobalMetadataMutation = { __typename?: 'Mutation', deleteGlobalMetas?: { __typename?: 'DeleteGlobalMetasPayload', metas: Array<{ __typename?: 'GlobalMetaType', key: string, value: string }> } | null };
|
||||
|
||||
export type SetGlobalMetadataMutationVariables = Exact<{
|
||||
input: SetGlobalMetaInput;
|
||||
input: SetGlobalMetasInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type SetGlobalMetadataMutation = { __typename?: 'Mutation', setGlobalMeta?: { __typename?: 'SetGlobalMetaPayload', meta: { __typename?: 'GlobalMetaType', key: string, value: string } } | null };
|
||||
export type SetGlobalMetadataMutation = { __typename?: 'Mutation', setGlobalMetas?: { __typename?: 'SetGlobalMetasPayload', metas: Array<{ __typename?: 'GlobalMetaType', key: string, value: string }> } | null };
|
||||
|
||||
export type GetGlobalMetadataQueryVariables = Exact<{
|
||||
key: Scalars['String']['input'];
|
||||
@@ -3979,18 +4207,18 @@ export type UpdateSourcePreferencesMutationVariables = Exact<{
|
||||
export type UpdateSourcePreferencesMutation = { __typename?: 'Mutation', updateSourcePreference?: { __typename?: 'UpdateSourcePreferencePayload', source: { __typename?: 'SourceType', id: string, name: string, displayName: string, lang: string, preferences: Array<{ __typename?: 'CheckBoxPreference', summary?: string | null, key?: string | null, type: 'CheckBoxPreference', CheckBoxCheckBoxCurrentValue?: boolean | null, CheckBoxDefault: boolean, CheckBoxTitle?: string | null } | { __typename?: 'EditTextPreference', text?: string | null, summary?: string | null, key?: string | null, dialogTitle?: string | null, dialogMessage?: string | null, type: 'EditTextPreference', EditTextPreferenceCurrentValue?: string | null, EditTextPreferenceDefault?: string | null, EditTextPreferenceTitle?: string | null } | { __typename?: 'ListPreference', summary?: string | null, key?: string | null, entryValues: Array<string>, entries: Array<string>, type: 'ListPreference', ListPreferenceCurrentValue?: string | null, ListPreferenceDefault?: string | null, ListPreferenceTitle?: string | null } | { __typename?: 'MultiSelectListPreference', dialogMessage?: string | null, dialogTitle?: string | null, summary?: string | null, key?: string | null, entryValues: Array<string>, entries: Array<string>, type: 'MultiSelectListPreference', MultiSelectListPreferenceTitle?: string | null, MultiSelectListPreferenceDefault?: Array<string> | null, MultiSelectListPreferenceCurrentValue?: Array<string> | null } | { __typename?: 'SwitchPreference', summary?: string | null, key?: string | null, type: 'SwitchPreference', SwitchPreferenceCurrentValue?: boolean | null, SwitchPreferenceDefault: boolean, SwitchPreferenceTitle?: string | null }> } } | null };
|
||||
|
||||
export type SetSourceMetadataMutationVariables = Exact<{
|
||||
input: SetSourceMetaInput;
|
||||
input: SetSourceMetasInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type SetSourceMetadataMutation = { __typename?: 'Mutation', setSourceMeta?: { __typename?: 'SetSourceMetaPayload', meta: { __typename?: 'SourceMetaType', sourceId: string, key: string, value: string } } | null };
|
||||
export type SetSourceMetadataMutation = { __typename?: 'Mutation', setSourceMetas?: { __typename?: 'SetSourceMetasPayload', metas: Array<{ __typename?: 'SourceMetaType', sourceId: string, key: string, value: string }> } | null };
|
||||
|
||||
export type DeleteSourceMetadataMutationVariables = Exact<{
|
||||
input: DeleteSourceMetaInput;
|
||||
input: DeleteSourceMetasInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type DeleteSourceMetadataMutation = { __typename?: 'Mutation', deleteSourceMeta?: { __typename?: 'DeleteSourceMetaPayload', meta?: { __typename?: 'SourceMetaType', sourceId: string, key: string, value: string } | null } | null };
|
||||
export type DeleteSourceMetadataMutation = { __typename?: 'Mutation', deleteSourceMetas?: { __typename?: 'DeleteSourceMetasPayload', metas: Array<{ __typename?: 'SourceMetaType', sourceId: string, key: string, value: string }> } | null };
|
||||
|
||||
export type GetSourceBrowseQueryVariables = Exact<{
|
||||
id: Scalars['LongString']['input'];
|
||||
|
||||
@@ -12,9 +12,9 @@ import { MANGA_META_FIELDS, MANGA_SCREEN_FIELDS } from '@/lib/graphql/manga/Mang
|
||||
export const DELETE_MANGA_METADATA = gql`
|
||||
${MANGA_META_FIELDS}
|
||||
|
||||
mutation DELETE_MANGA_METADATA($input: DeleteMangaMetaInput!) {
|
||||
deleteMangaMeta(input: $input) {
|
||||
meta {
|
||||
mutation DELETE_MANGA_METADATA($input: DeleteMangaMetasInput!) {
|
||||
deleteMangaMetas(input: $input) {
|
||||
metas {
|
||||
...MANGA_META_FIELDS
|
||||
}
|
||||
}
|
||||
@@ -79,9 +79,9 @@ export const GET_MANGA_TO_MIGRATE_TO_FETCH = gql`
|
||||
export const SET_MANGA_METADATA = gql`
|
||||
${MANGA_META_FIELDS}
|
||||
|
||||
mutation SET_MANGA_METADATA($input: SetMangaMetaInput!) {
|
||||
setMangaMeta(input: $input) {
|
||||
meta {
|
||||
mutation SET_MANGA_METADATA($input: SetMangaMetasInput!) {
|
||||
setMangaMetas(input: $input) {
|
||||
metas {
|
||||
...MANGA_META_FIELDS
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,9 +11,9 @@ import { GLOBAL_METADATA } from '@/lib/graphql/common/Fragments.ts';
|
||||
|
||||
export const DELETE_GLOBAL_METADATA = gql`
|
||||
${GLOBAL_METADATA}
|
||||
mutation DELETE_GLOBAL_METADATA($input: DeleteGlobalMetaInput!) {
|
||||
deleteGlobalMeta(input: $input) {
|
||||
meta {
|
||||
mutation DELETE_GLOBAL_METADATA($input: DeleteGlobalMetasInput!) {
|
||||
deleteGlobalMetas(input: $input) {
|
||||
metas {
|
||||
...GLOBAL_METADATA
|
||||
}
|
||||
}
|
||||
@@ -22,9 +22,9 @@ export const DELETE_GLOBAL_METADATA = gql`
|
||||
|
||||
export const SET_GLOBAL_METADATA = gql`
|
||||
${GLOBAL_METADATA}
|
||||
mutation SET_GLOBAL_METADATA($input: SetGlobalMetaInput!) {
|
||||
setGlobalMeta(input: $input) {
|
||||
meta {
|
||||
mutation SET_GLOBAL_METADATA($input: SetGlobalMetasInput!) {
|
||||
setGlobalMetas(input: $input) {
|
||||
metas {
|
||||
...GLOBAL_METADATA
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,9 +38,9 @@ export const UPDATE_SOURCE_PREFERENCES = gql`
|
||||
export const SET_SOURCE_METADATA = gql`
|
||||
${SOURCE_META_FIELDS}
|
||||
|
||||
mutation SET_SOURCE_METADATA($input: SetSourceMetaInput!) {
|
||||
setSourceMeta(input: $input) {
|
||||
meta {
|
||||
mutation SET_SOURCE_METADATA($input: SetSourceMetasInput!) {
|
||||
setSourceMetas(input: $input) {
|
||||
metas {
|
||||
...SOURCE_META_FIELDS
|
||||
}
|
||||
}
|
||||
@@ -50,9 +50,9 @@ export const SET_SOURCE_METADATA = gql`
|
||||
export const DELETE_SOURCE_METADATA = gql`
|
||||
${SOURCE_META_FIELDS}
|
||||
|
||||
mutation DELETE_SOURCE_METADATA($input: DeleteSourceMetaInput!) {
|
||||
deleteSourceMeta(input: $input) {
|
||||
meta {
|
||||
mutation DELETE_SOURCE_METADATA($input: DeleteSourceMetasInput!) {
|
||||
deleteSourceMetas(input: $input) {
|
||||
metas {
|
||||
...SOURCE_META_FIELDS
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,14 +139,24 @@ import {
|
||||
RestoreBackupMutationVariables,
|
||||
SetCategoryMetadataMutation,
|
||||
SetCategoryMetadataMutationVariables,
|
||||
SetCategoryMetasInput,
|
||||
SetChapterMetadataMutation,
|
||||
SetChapterMetadataMutationVariables,
|
||||
SetChapterMetasInput,
|
||||
SetGlobalMetadataMutation,
|
||||
SetGlobalMetadataMutationVariables,
|
||||
SetGlobalMetasInput,
|
||||
SetMangaMetadataMutation,
|
||||
SetMangaMetadataMutationVariables,
|
||||
SetMangaMetasInput,
|
||||
SetSourceMetadataMutation,
|
||||
SetSourceMetadataMutationVariables,
|
||||
SetSourceMetasInput,
|
||||
DeleteCategoryMetasInput,
|
||||
DeleteChapterMetasInput,
|
||||
DeleteGlobalMetasInput,
|
||||
DeleteMangaMetasInput,
|
||||
DeleteSourceMetasInput,
|
||||
SettingsType,
|
||||
SortOrder,
|
||||
SourcePreferenceChangeInput,
|
||||
@@ -1290,24 +1300,23 @@ export class RequestManager {
|
||||
}
|
||||
|
||||
public setGlobalMetadata(
|
||||
key: string,
|
||||
value: any,
|
||||
input: SetGlobalMetasInput,
|
||||
options?: MutationOptions<SetGlobalMetadataMutation, SetGlobalMetadataMutationVariables>,
|
||||
): AbortableApolloMutationResponse<SetGlobalMetadataMutation> {
|
||||
return this.doRequest<SetGlobalMetadataMutation, SetGlobalMetadataMutationVariables>(
|
||||
GQLMethod.MUTATION,
|
||||
SET_GLOBAL_METADATA,
|
||||
{ input: { meta: { key, value: `${value}` } } },
|
||||
{ input },
|
||||
{
|
||||
optimisticResponse: {
|
||||
__typename: 'Mutation',
|
||||
setGlobalMeta: {
|
||||
__typename: 'SetGlobalMetaPayload',
|
||||
meta: {
|
||||
setGlobalMetas: {
|
||||
__typename: 'SetGlobalMetasPayload',
|
||||
metas: input.metas.map((meta) => ({
|
||||
__typename: 'GlobalMetaType',
|
||||
key,
|
||||
value: `${value}`,
|
||||
},
|
||||
key: meta.key,
|
||||
value: meta.value,
|
||||
})),
|
||||
},
|
||||
},
|
||||
update(cache, { data }) {
|
||||
@@ -1318,25 +1327,25 @@ export class RequestManager {
|
||||
return existingMetas;
|
||||
}
|
||||
|
||||
if (!data?.setGlobalMeta) {
|
||||
if (!data?.setGlobalMetas) {
|
||||
return existingMetas;
|
||||
}
|
||||
|
||||
const exists = existingMetas.nodes.some(
|
||||
(meta: Reference) => readField('key', meta) === key,
|
||||
const newMetas = data.setGlobalMetas.metas.filter((meta) =>
|
||||
existingMetas.nodes.every(
|
||||
(existingMeta: Reference) => readField('key', existingMeta) !== meta.key,
|
||||
),
|
||||
);
|
||||
const newMetaRefs = newMetas.map((meta) =>
|
||||
cache.writeFragment({
|
||||
data: meta,
|
||||
fragment: GLOBAL_METADATA,
|
||||
}),
|
||||
);
|
||||
if (exists) {
|
||||
return existingMetas;
|
||||
}
|
||||
|
||||
const newMetaRef = cache.writeFragment({
|
||||
data: data!.setGlobalMeta.meta,
|
||||
fragment: GLOBAL_METADATA,
|
||||
});
|
||||
|
||||
return {
|
||||
...existingMetas,
|
||||
nodes: [...existingMetas.nodes, newMetaRef],
|
||||
nodes: [...existingMetas.nodes, ...newMetaRefs],
|
||||
};
|
||||
},
|
||||
},
|
||||
@@ -1348,27 +1357,29 @@ export class RequestManager {
|
||||
}
|
||||
|
||||
public deleteGlobalMeta(
|
||||
key: string,
|
||||
input: DeleteGlobalMetasInput,
|
||||
options?: MutationOptions<DeleteGlobalMetadataMutation, DeleteGlobalMetadataMutationVariables>,
|
||||
): AbortableApolloMutationResponse<DeleteGlobalMetadataMutation> {
|
||||
return this.doRequest(
|
||||
GQLMethod.MUTATION,
|
||||
DELETE_GLOBAL_METADATA,
|
||||
{ input: { key } },
|
||||
{ input },
|
||||
{
|
||||
optimisticResponse: {
|
||||
__typename: 'Mutation',
|
||||
deleteGlobalMeta: {
|
||||
__typename: 'DeleteGlobalMetaPayload',
|
||||
meta: {
|
||||
__typename: 'GlobalMetaType',
|
||||
deleteGlobalMetas: {
|
||||
__typename: 'DeleteGlobalMetasPayload',
|
||||
metas: (input.keys ?? []).map((key) => ({
|
||||
__typename: 'GlobalMetaType' as const,
|
||||
key,
|
||||
value: '',
|
||||
},
|
||||
})),
|
||||
},
|
||||
},
|
||||
update(cache) {
|
||||
cache.evict({ id: cache.identify({ __typename: 'GlobalMetaType', key }) });
|
||||
input.keys?.forEach((key) => {
|
||||
cache.evict({ id: cache.identify({ __typename: 'GlobalMetaType', key }) });
|
||||
});
|
||||
},
|
||||
...options,
|
||||
},
|
||||
@@ -1704,44 +1715,56 @@ export class RequestManager {
|
||||
}
|
||||
|
||||
public setSourceMeta(
|
||||
sourceId: string,
|
||||
key: string,
|
||||
value: any,
|
||||
input: SetSourceMetasInput,
|
||||
options?: MutationOptions<SetSourceMetadataMutation, SetSourceMetadataMutationVariables>,
|
||||
): AbortableApolloMutationResponse<SetSourceMetadataMutation> {
|
||||
return this.doRequest(
|
||||
GQLMethod.MUTATION,
|
||||
SET_SOURCE_METADATA,
|
||||
{
|
||||
input: { meta: { sourceId, key, value: `${value}` } },
|
||||
},
|
||||
{ input },
|
||||
{
|
||||
optimisticResponse: {
|
||||
__typename: 'Mutation',
|
||||
setSourceMeta: {
|
||||
__typename: 'SetSourceMetaPayload',
|
||||
meta: {
|
||||
__typename: 'SourceMetaType',
|
||||
sourceId,
|
||||
key,
|
||||
value: `${value}`,
|
||||
},
|
||||
setSourceMetas: {
|
||||
__typename: 'SetSourceMetasPayload',
|
||||
metas: input.items.flatMap((item) =>
|
||||
item.sourceIds.flatMap((sourceId) =>
|
||||
item.metas.map((meta) => ({
|
||||
__typename: 'SourceMetaType' as const,
|
||||
sourceId,
|
||||
key: meta.key,
|
||||
value: meta.value,
|
||||
})),
|
||||
),
|
||||
),
|
||||
},
|
||||
},
|
||||
update(cache, { data }) {
|
||||
cache.modify({
|
||||
id: cache.identify({ __typename: 'SourceType', id: sourceId }),
|
||||
fields: {
|
||||
meta(existingMetas, { readField }) {
|
||||
return updateMetadataList(key, existingMetas, readField, () =>
|
||||
cache.writeFragment({
|
||||
data: data!.setSourceMeta!.meta,
|
||||
fragment: SOURCE_META_FIELDS,
|
||||
}),
|
||||
);
|
||||
},
|
||||
},
|
||||
});
|
||||
input.items.forEach((item) =>
|
||||
item.sourceIds.forEach((sourceId) => {
|
||||
cache.modify({
|
||||
id: cache.identify({ __typename: 'SourceType', id: sourceId }),
|
||||
fields: {
|
||||
meta(existingMetas, { readField }) {
|
||||
if (!data?.setSourceMetas) {
|
||||
return existingMetas;
|
||||
}
|
||||
|
||||
return updateMetadataList(
|
||||
data.setSourceMetas.metas,
|
||||
existingMetas,
|
||||
readField,
|
||||
(meta) =>
|
||||
cache.writeFragment({
|
||||
data: meta,
|
||||
fragment: SOURCE_META_FIELDS,
|
||||
}),
|
||||
);
|
||||
},
|
||||
},
|
||||
});
|
||||
}),
|
||||
);
|
||||
},
|
||||
...options,
|
||||
},
|
||||
@@ -1749,29 +1772,38 @@ export class RequestManager {
|
||||
}
|
||||
|
||||
public deleteSourceMeta(
|
||||
sourceId: string,
|
||||
key: string,
|
||||
input: DeleteSourceMetasInput,
|
||||
options?: MutationOptions<DeleteSourceMetadataMutation, DeleteSourceMetadataMutationVariables>,
|
||||
): AbortableApolloMutationResponse<DeleteSourceMetadataMutation> {
|
||||
return this.doRequest(
|
||||
GQLMethod.MUTATION,
|
||||
DELETE_SOURCE_METADATA,
|
||||
{ input: { sourceId, key } },
|
||||
{ input },
|
||||
{
|
||||
optimisticResponse: {
|
||||
__typename: 'Mutation',
|
||||
deleteSourceMeta: {
|
||||
__typename: 'DeleteSourceMetaPayload',
|
||||
meta: {
|
||||
__typename: 'SourceMetaType',
|
||||
sourceId,
|
||||
key,
|
||||
value: '',
|
||||
},
|
||||
deleteSourceMetas: {
|
||||
__typename: 'DeleteSourceMetasPayload',
|
||||
metas: input.items.flatMap((item) =>
|
||||
item.sourceIds.flatMap((sourceId) =>
|
||||
(item.keys ?? []).map((key) => ({
|
||||
__typename: 'SourceMetaType' as const,
|
||||
sourceId,
|
||||
key,
|
||||
value: '',
|
||||
})),
|
||||
),
|
||||
),
|
||||
},
|
||||
},
|
||||
update(cache) {
|
||||
cache.evict({ id: cache.identify({ __typename: 'SourceMetaType', sourceId, key }) });
|
||||
input.items.forEach((item) =>
|
||||
item.sourceIds.forEach((sourceId) => {
|
||||
item.keys?.forEach((key) => {
|
||||
cache.evict({ id: cache.identify({ __typename: 'SourceMetaType', sourceId, key }) });
|
||||
});
|
||||
}),
|
||||
);
|
||||
},
|
||||
...options,
|
||||
},
|
||||
@@ -2228,44 +2260,56 @@ export class RequestManager {
|
||||
}
|
||||
|
||||
public setMangaMeta(
|
||||
mangaId: number,
|
||||
key: string,
|
||||
value: any,
|
||||
input: SetMangaMetasInput,
|
||||
options?: MutationOptions<SetMangaMetadataMutation, SetMangaMetadataMutationVariables>,
|
||||
): AbortableApolloMutationResponse<SetMangaMetadataMutation> {
|
||||
return this.doRequest(
|
||||
GQLMethod.MUTATION,
|
||||
SET_MANGA_METADATA,
|
||||
{
|
||||
input: { meta: { mangaId, key, value: `${value}` } },
|
||||
},
|
||||
{ input },
|
||||
{
|
||||
optimisticResponse: {
|
||||
__typename: 'Mutation',
|
||||
setMangaMeta: {
|
||||
__typename: 'SetMangaMetaPayload',
|
||||
meta: {
|
||||
__typename: 'MangaMetaType',
|
||||
mangaId,
|
||||
key,
|
||||
value: `${value}`,
|
||||
},
|
||||
setMangaMetas: {
|
||||
__typename: 'SetMangaMetasPayload',
|
||||
metas: input.items.flatMap((item) =>
|
||||
item.mangaIds.flatMap((mangaId) =>
|
||||
item.metas.map((meta) => ({
|
||||
__typename: 'MangaMetaType' as const,
|
||||
mangaId,
|
||||
key: meta.key,
|
||||
value: meta.value,
|
||||
})),
|
||||
),
|
||||
),
|
||||
},
|
||||
},
|
||||
update(cache, { data }) {
|
||||
cache.modify({
|
||||
id: cache.identify({ __typename: 'MangaType', id: mangaId }),
|
||||
fields: {
|
||||
meta(existingMetas, { readField }) {
|
||||
return updateMetadataList(key, existingMetas, readField, () =>
|
||||
cache.writeFragment({
|
||||
data: data!.setMangaMeta!.meta,
|
||||
fragment: MANGA_META_FIELDS,
|
||||
}),
|
||||
);
|
||||
},
|
||||
},
|
||||
});
|
||||
input.items.forEach((item) =>
|
||||
item.mangaIds.forEach((mangaId) => {
|
||||
cache.modify({
|
||||
id: cache.identify({ __typename: 'MangaType', id: mangaId }),
|
||||
fields: {
|
||||
meta(existingMetas, { readField }) {
|
||||
if (!data?.setMangaMetas) {
|
||||
return existingMetas;
|
||||
}
|
||||
|
||||
return updateMetadataList(
|
||||
data.setMangaMetas.metas,
|
||||
existingMetas,
|
||||
readField,
|
||||
(meta) =>
|
||||
cache.writeFragment({
|
||||
data: meta,
|
||||
fragment: MANGA_META_FIELDS,
|
||||
}),
|
||||
);
|
||||
},
|
||||
},
|
||||
});
|
||||
}),
|
||||
);
|
||||
},
|
||||
...options,
|
||||
},
|
||||
@@ -2273,29 +2317,38 @@ export class RequestManager {
|
||||
}
|
||||
|
||||
public deleteMangaMeta(
|
||||
mangaId: number,
|
||||
key: string,
|
||||
input: DeleteMangaMetasInput,
|
||||
options?: MutationOptions<DeleteMangaMetadataMutation, DeleteMangaMetadataMutationVariables>,
|
||||
): AbortableApolloMutationResponse<DeleteMangaMetadataMutation> {
|
||||
return this.doRequest(
|
||||
GQLMethod.MUTATION,
|
||||
DELETE_MANGA_METADATA,
|
||||
{ input: { mangaId, key } },
|
||||
{ input },
|
||||
{
|
||||
optimisticResponse: {
|
||||
__typename: 'Mutation',
|
||||
deleteMangaMeta: {
|
||||
__typename: 'DeleteMangaMetaPayload',
|
||||
meta: {
|
||||
__typename: 'MangaMetaType',
|
||||
mangaId,
|
||||
key,
|
||||
value: '',
|
||||
},
|
||||
deleteMangaMetas: {
|
||||
__typename: 'DeleteMangaMetasPayload',
|
||||
metas: input.items.flatMap((item) =>
|
||||
item.mangaIds.flatMap((mangaId) =>
|
||||
(item.keys ?? []).map((key) => ({
|
||||
__typename: 'MangaMetaType' as const,
|
||||
mangaId,
|
||||
key,
|
||||
value: '',
|
||||
})),
|
||||
),
|
||||
),
|
||||
},
|
||||
},
|
||||
update(cache) {
|
||||
cache.evict({ id: cache.identify({ __typename: 'MangaMetaType', mangaId, key }) });
|
||||
input.items.forEach((item) =>
|
||||
item.mangaIds.forEach((mangaId) => {
|
||||
item.keys?.forEach((key) => {
|
||||
cache.evict({ id: cache.identify({ __typename: 'MangaMetaType', mangaId, key }) });
|
||||
});
|
||||
}),
|
||||
);
|
||||
},
|
||||
...options,
|
||||
},
|
||||
@@ -2458,42 +2511,56 @@ export class RequestManager {
|
||||
}
|
||||
|
||||
public setChapterMeta(
|
||||
chapterId: number,
|
||||
key: string,
|
||||
value: any,
|
||||
input: SetChapterMetasInput,
|
||||
options?: MutationOptions<SetChapterMetadataMutation, SetChapterMetadataMutationVariables>,
|
||||
): AbortableApolloMutationResponse<SetChapterMetadataMutation> {
|
||||
return this.doRequest<SetChapterMetadataMutation, SetChapterMetadataMutationVariables>(
|
||||
GQLMethod.MUTATION,
|
||||
SET_CHAPTER_METADATA,
|
||||
{ input: { meta: { chapterId, key, value: `${value}` } } },
|
||||
{ input },
|
||||
{
|
||||
optimisticResponse: {
|
||||
__typename: 'Mutation',
|
||||
setChapterMeta: {
|
||||
__typename: 'SetChapterMetaPayload',
|
||||
meta: {
|
||||
__typename: 'ChapterMetaType',
|
||||
chapterId,
|
||||
key,
|
||||
value: `${value}`,
|
||||
},
|
||||
setChapterMetas: {
|
||||
__typename: 'SetChapterMetasPayload',
|
||||
metas: input.items.flatMap((item) =>
|
||||
item.chapterIds.flatMap((chapterId) =>
|
||||
item.metas.map((meta) => ({
|
||||
__typename: 'ChapterMetaType' as const,
|
||||
chapterId,
|
||||
key: meta.key,
|
||||
value: meta.value,
|
||||
})),
|
||||
),
|
||||
),
|
||||
},
|
||||
},
|
||||
update(cache, { data }) {
|
||||
cache.modify({
|
||||
id: cache.identify({ __typename: 'ChapterType', id: chapterId }),
|
||||
fields: {
|
||||
meta(existingMetas, { readField }) {
|
||||
return updateMetadataList(key, existingMetas, readField, () =>
|
||||
cache.writeFragment({
|
||||
data: data!.setChapterMeta!.meta,
|
||||
fragment: CHAPTER_META_FIELDS,
|
||||
}),
|
||||
);
|
||||
},
|
||||
},
|
||||
});
|
||||
input.items.forEach((item) =>
|
||||
item.chapterIds.forEach((chapterId) => {
|
||||
cache.modify({
|
||||
id: cache.identify({ __typename: 'ChapterType', id: chapterId }),
|
||||
fields: {
|
||||
meta(existingMetas, { readField }) {
|
||||
if (!data?.setChapterMetas) {
|
||||
return existingMetas;
|
||||
}
|
||||
|
||||
return updateMetadataList(
|
||||
data.setChapterMetas.metas,
|
||||
existingMetas,
|
||||
readField,
|
||||
(meta) =>
|
||||
cache.writeFragment({
|
||||
data: meta,
|
||||
fragment: CHAPTER_META_FIELDS,
|
||||
}),
|
||||
);
|
||||
},
|
||||
},
|
||||
});
|
||||
}),
|
||||
);
|
||||
},
|
||||
...options,
|
||||
},
|
||||
@@ -2501,29 +2568,38 @@ export class RequestManager {
|
||||
}
|
||||
|
||||
public deleteChapterMeta(
|
||||
chapterId: number,
|
||||
key: string,
|
||||
input: DeleteChapterMetasInput,
|
||||
options?: MutationOptions<DeleteChapterMetadataMutation, DeleteChapterMetadataMutationVariables>,
|
||||
): AbortableApolloMutationResponse<DeleteChapterMetadataMutation> {
|
||||
return this.doRequest(
|
||||
GQLMethod.MUTATION,
|
||||
DELETE_CHAPTER_METADATA,
|
||||
{ input: { chapterId, key } },
|
||||
{ input },
|
||||
{
|
||||
optimisticResponse: {
|
||||
__typename: 'Mutation',
|
||||
deleteChapterMeta: {
|
||||
__typename: 'DeleteChapterMetaPayload',
|
||||
meta: {
|
||||
__typename: 'ChapterMetaType',
|
||||
chapterId,
|
||||
key,
|
||||
value: '',
|
||||
},
|
||||
deleteChapterMetas: {
|
||||
__typename: 'DeleteChapterMetasPayload',
|
||||
metas: input.items.flatMap((item) =>
|
||||
item.chapterIds.flatMap((chapterId) =>
|
||||
(item.keys ?? []).map((key) => ({
|
||||
__typename: 'ChapterMetaType' as const,
|
||||
chapterId,
|
||||
key,
|
||||
value: '',
|
||||
})),
|
||||
),
|
||||
),
|
||||
},
|
||||
},
|
||||
update(cache) {
|
||||
cache.evict({ id: cache.identify({ __typename: 'ChapterMetaType', chapterId, key }) });
|
||||
input.items.forEach((item) =>
|
||||
item.chapterIds.forEach((chapterId) => {
|
||||
item.keys?.forEach((key) => {
|
||||
cache.evict({ id: cache.identify({ __typename: 'ChapterMetaType', chapterId, key }) });
|
||||
});
|
||||
}),
|
||||
);
|
||||
},
|
||||
...options,
|
||||
},
|
||||
@@ -2737,42 +2813,56 @@ export class RequestManager {
|
||||
}
|
||||
|
||||
public setCategoryMeta(
|
||||
categoryId: number,
|
||||
key: string,
|
||||
value: any,
|
||||
input: SetCategoryMetasInput,
|
||||
options?: MutationOptions<SetCategoryMetadataMutation, SetCategoryMetadataMutationVariables>,
|
||||
): AbortableApolloMutationResponse<SetCategoryMetadataMutation> {
|
||||
return this.doRequest<SetCategoryMetadataMutation, SetCategoryMetadataMutationVariables>(
|
||||
GQLMethod.MUTATION,
|
||||
SET_CATEGORY_METADATA,
|
||||
{ input: { meta: { categoryId, key, value: `${value}` } } },
|
||||
{ input },
|
||||
{
|
||||
optimisticResponse: {
|
||||
__typename: 'Mutation',
|
||||
setCategoryMeta: {
|
||||
__typename: 'SetCategoryMetaPayload',
|
||||
meta: {
|
||||
__typename: 'CategoryMetaType',
|
||||
categoryId,
|
||||
key,
|
||||
value: `${value}`,
|
||||
},
|
||||
setCategoryMetas: {
|
||||
__typename: 'SetCategoryMetasPayload',
|
||||
metas: input.items.flatMap((item) =>
|
||||
item.categoryIds.flatMap((categoryId) =>
|
||||
item.metas.map((meta) => ({
|
||||
__typename: 'CategoryMetaType' as const,
|
||||
categoryId,
|
||||
key: meta.key,
|
||||
value: meta.value,
|
||||
})),
|
||||
),
|
||||
),
|
||||
},
|
||||
},
|
||||
update(cache, { data }) {
|
||||
cache.modify({
|
||||
id: cache.identify({ __typename: 'CategoryType', id: categoryId }),
|
||||
fields: {
|
||||
meta(existingMetas, { readField }) {
|
||||
return updateMetadataList(key, existingMetas, readField, () =>
|
||||
cache.writeFragment({
|
||||
data: data!.setCategoryMeta!.meta,
|
||||
fragment: CATEGORY_META_FIELDS,
|
||||
}),
|
||||
);
|
||||
},
|
||||
},
|
||||
});
|
||||
input.items.forEach((item) =>
|
||||
item.categoryIds.forEach((categoryId) => {
|
||||
cache.modify({
|
||||
id: cache.identify({ __typename: 'CategoryType', id: categoryId }),
|
||||
fields: {
|
||||
meta(existingMetas, { readField }) {
|
||||
if (!data?.setCategoryMetas) {
|
||||
return existingMetas;
|
||||
}
|
||||
|
||||
return updateMetadataList(
|
||||
data.setCategoryMetas.metas,
|
||||
existingMetas,
|
||||
readField,
|
||||
(meta) =>
|
||||
cache.writeFragment({
|
||||
data: meta,
|
||||
fragment: CATEGORY_META_FIELDS,
|
||||
}),
|
||||
);
|
||||
},
|
||||
},
|
||||
});
|
||||
}),
|
||||
);
|
||||
},
|
||||
...options,
|
||||
},
|
||||
@@ -2780,29 +2870,40 @@ export class RequestManager {
|
||||
}
|
||||
|
||||
public deleteCategoryMeta(
|
||||
categoryId: number,
|
||||
key: string,
|
||||
input: DeleteCategoryMetasInput,
|
||||
options?: MutationOptions<DeleteCategoryMetadataMutation, DeleteCategoryMetadataMutationVariables>,
|
||||
): AbortableApolloMutationResponse<DeleteCategoryMetadataMutation> {
|
||||
return this.doRequest(
|
||||
GQLMethod.MUTATION,
|
||||
DELETE_CATEGORY_METADATA,
|
||||
{ input: { categoryId, key } },
|
||||
{ input },
|
||||
{
|
||||
optimisticResponse: {
|
||||
__typename: 'Mutation',
|
||||
deleteCategoryMeta: {
|
||||
__typename: 'DeleteCategoryMetaPayload',
|
||||
meta: {
|
||||
__typename: 'CategoryMetaType',
|
||||
categoryId,
|
||||
key,
|
||||
value: '',
|
||||
},
|
||||
deleteCategoryMetas: {
|
||||
__typename: 'DeleteCategoryMetasPayload',
|
||||
metas: input.items.flatMap((item) =>
|
||||
item.categoryIds.flatMap((categoryId) =>
|
||||
(item.keys ?? []).map((key) => ({
|
||||
__typename: 'CategoryMetaType' as const,
|
||||
categoryId,
|
||||
key,
|
||||
value: '',
|
||||
})),
|
||||
),
|
||||
),
|
||||
},
|
||||
},
|
||||
update(cache) {
|
||||
cache.evict({ id: cache.identify({ __typename: 'CategoryMetaType', categoryId, key }) });
|
||||
input.items.flatMap((item) =>
|
||||
item.categoryIds.forEach((categoryId) => {
|
||||
item.keys?.forEach((key) => {
|
||||
cache.evict({
|
||||
id: cache.identify({ __typename: 'CategoryMetaType', categoryId, key }),
|
||||
});
|
||||
});
|
||||
}),
|
||||
);
|
||||
},
|
||||
...options,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user