Update dependency "@graphql-codegen"

This commit is contained in:
schroda
2026-05-15 20:40:31 +02:00
parent 32b22bbf3c
commit 60b6a39bdc
72 changed files with 4417 additions and 4388 deletions

View File

@@ -15,7 +15,7 @@ import DownloadIcon from '@mui/icons-material/Download';
import OpenInNewIcon from '@mui/icons-material/OpenInNew';
import DownloadingIcon from '@mui/icons-material/Downloading';
import { t } from '@lingui/core/macro';
import { UpdateState } from '@/lib/graphql/generated/graphql.ts';
import { UpdateState } from '@/lib/graphql/generated/graphql-base.types.ts';
export type BaseVersionInfoProps = {
version: string;

View File

@@ -15,8 +15,8 @@ import DialogActions from '@mui/material/DialogActions';
import Button from '@mui/material/Button';
import { useLingui } from '@lingui/react/macro';
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
import type { WebUiUpdateStatus } from '@/lib/graphql/generated/graphql.ts';
import { UpdateState, WebUiChannel } from '@/lib/graphql/generated/graphql.ts';
import type { WebUiUpdateStatus } from '@/lib/graphql/generated/graphql-base.types.ts';
import { UpdateState, WebUiChannel } from '@/lib/graphql/generated/graphql-base.types.ts';
import { useLocalStorage, useSessionStorage } from '@/base/hooks/useStorage.tsx';
import { requestManager } from '@/lib/requests/RequestManager.ts';
import { makeToast } from '@/base/utils/Toast.ts';

View File

@@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import type { PartialBackupFlagsInput } from '@/lib/graphql/generated/graphql.ts';
import type { PartialBackupFlagsInput } from '@/lib/graphql/generated/graphql-base.types.ts';
import type { ServerSettings } from '@/features/settings/Settings.types.ts';
export enum BackupFlagGroup {

View File

@@ -19,7 +19,7 @@ import type { AwaitableComponentProps } from 'awaitable-component';
import { useLingui } from '@lingui/react/macro';
import { BrowseTab } from '@/features/browse/Browse.types.ts';
import { AppRoutes } from '@/base/AppRoute.constants.ts';
import type { ValidateBackupResult } from '@/lib/graphql/generated/graphql.ts';
import type { ValidateBackupResult } from '@/lib/graphql/generated/graphql-base.types.ts';
export const BackupValidationDialog = ({
validationResult,

View File

@@ -19,7 +19,7 @@ import { useLingui } from '@lingui/react/macro';
import { plural } from '@lingui/core/macro';
import { requestManager } from '@/lib/requests/RequestManager.ts';
import { makeToast } from '@/base/utils/Toast.ts';
import { BackupRestoreState } from '@/lib/graphql/generated/graphql.ts';
import { BackupRestoreState } from '@/lib/graphql/generated/graphql-base.types.ts';
import { Progress } from '@/base/components/feedback/Progress.tsx';
import { TextSetting } from '@/base/components/settings/text/TextSetting.tsx';
import { NumberSetting } from '@/base/components/settings/NumberSetting.tsx';

View File

@@ -7,7 +7,7 @@
*/
import type { LibraryOptions } from '@/features/library/Library.types.ts';
import type { CategoryMetaType, CategoryType } from '@/lib/graphql/generated/graphql.ts';
import type { CategoryMetaType, CategoryType } from '@/lib/graphql/generated/graphql-base.types.ts';
export type ICategoryMetadata = LibraryOptions;

View File

@@ -19,7 +19,7 @@ import { useLingui } from '@lingui/react/macro';
import { t as translate } from '@lingui/core/macro';
import { ThreeStateCheckboxInput } from '@/base/components/inputs/ThreeStateCheckboxInput.tsx';
import { makeToast } from '@/base/utils/Toast.ts';
import { IncludeOrExclude } from '@/lib/graphql/generated/graphql.ts';
import { IncludeOrExclude } from '@/lib/graphql/generated/graphql-base.types.ts';
import { requestManager } from '@/lib/requests/RequestManager.ts';
import { CheckboxContainer } from '@/base/components/inputs/CheckboxContainer.ts';
import type {

View File

@@ -17,14 +17,14 @@ import Typography from '@mui/material/Typography';
import { useLingui } from '@lingui/react/macro';
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
import { requestManager } from '@/lib/requests/RequestManager.ts';
import type { CategoryType } from '@/lib/graphql/generated/graphql.ts';
import { ListCardContent } from '@/base/components/lists/cards/ListCardContent.tsx';
import type { CategoryIdInfo, CategoryNameInfo } from '@/features/category/Category.types.ts';
export const CategorySettingsCard = ({
category,
onEdit,
}: {
category: Pick<CategoryType, 'id' | 'name'>;
category: CategoryIdInfo & CategoryNameInfo;
onEdit: () => void;
}) => {
const { t } = useLingui();

View File

@@ -6,11 +6,8 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import type {
ChapterReaderFieldsFragment,
ChapterType,
DownloadStatusFieldsFragment,
} from '@/lib/graphql/generated/graphql.ts';
import type { ChapterType } from '@/lib/graphql/generated/graphql-base.types';
import type { ChapterReaderFieldsFragment, DownloadStatusFieldsFragment } from '@/lib/graphql/generated/graphql.ts';
export type ChapterSortMode = 'fetchedAt' | 'source' | 'chapterNumber' | 'uploadedAt';

View File

@@ -11,9 +11,9 @@ import MenuItem from '@mui/material/MenuItem';
import { msg } from '@lingui/core/macro';
import { useMetadataServerSettings } from '@/features/settings/services/ServerSettingsMetadata.ts';
import { Mangas } from '@/features/manga/services/Mangas.ts';
import type { MangaType } from '@/lib/graphql/generated/graphql.ts';
import { i18n } from '@/i18n';
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
import type { MangaIdInfo } from '@/features/manga/Manga.types.ts';
const DOWNLOAD_OPTIONS: {
title: MessageDescriptor;
@@ -59,7 +59,7 @@ export const ChaptersDownloadActionMenuItems = ({
mangaIds,
closeMenu,
}: {
mangaIds: MangaType['id'][];
mangaIds: MangaIdInfo['id'][];
closeMenu: () => void;
}) => {
const {

View File

@@ -9,7 +9,7 @@
import Refresh from '@mui/icons-material/Refresh';
import IconButton from '@mui/material/IconButton';
import { useLingui } from '@lingui/react/macro';
import { DownloadState } from '@/lib/graphql/generated/graphql.ts';
import { DownloadState } from '@/lib/graphql/generated/graphql-base.types.ts';
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
import { Chapters } from '@/features/chapter/services/Chapters.ts';
import { requestManager } from '@/lib/requests/RequestManager.ts';

View File

@@ -23,7 +23,6 @@ import { useLingui } from '@lingui/react/macro';
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
import { getDateString } from '@/base/utils/DateHelper.ts';
import { DownloadStateIndicator } from '@/base/components/downloads/DownloadStateIndicator.tsx';
import type { ChapterType } from '@/lib/graphql/generated/graphql.ts';
import { ChapterActionMenuItems } from '@/features/chapter/components/actions/ChapterActionMenuItems.tsx';
import { Menu } from '@/base/components/menu/Menu.tsx';
import { Chapters } from '@/features/chapter/services/Chapters.ts';
@@ -36,11 +35,14 @@ import type {
ChapterDownloadInfo,
ChapterIdInfo,
ChapterMangaInfo,
ChapterNameInfo,
ChapterNumberInfo,
ChapterReadInfo,
ChapterScanlatorInfo,
ChapterSourceOrderInfo,
} from '@/features/chapter/Chapter.types.ts';
import { MediaQuery } from '@/base/utils/MediaQuery.tsx';
import type { ChapterType } from '@/lib/graphql/generated/graphql-base.types.ts';
type TChapter = ChapterIdInfo &
ChapterMangaInfo &
@@ -49,7 +51,9 @@ type TChapter = ChapterIdInfo &
ChapterBookmarkInfo &
ChapterNumberInfo &
ChapterScanlatorInfo &
Pick<ChapterType, 'name' | 'sourceOrder' | 'uploadDate'>;
ChapterNameInfo &
ChapterSourceOrderInfo &
Pick<ChapterType, 'uploadDate'>;
interface IProps {
mode?: 'manga.page' | 'reader';

View File

@@ -9,8 +9,7 @@
import { Link } from 'react-router-dom';
import { AppRoutes } from '@/base/AppRoute.constants.ts';
import { Mangas } from '@/features/manga/services/Mangas.ts';
import type { MangaIdInfo, MangaThumbnailInfo } from '@/features/manga/Manga.types.ts';
import type { MangaType } from '@/lib/graphql/generated/graphql.ts';
import type { MangaIdInfo, MangaThumbnailInfo, MangaTitleInfo } from '@/features/manga/Manga.types.ts';
import { ListCardAvatar } from '@/base/components/lists/cards/ListCardAvatar.tsx';
export const ChapterCardThumbnail = ({
@@ -20,7 +19,7 @@ export const ChapterCardThumbnail = ({
thumbnailUrlLastFetched,
}: MangaThumbnailInfo & {
mangaId: MangaIdInfo['id'];
mangaTitle: MangaType['title'];
mangaTitle: MangaTitleInfo['title'];
}) => (
<Link to={AppRoutes.manga.path(mangaId)} style={{ textDecoration: 'none' }}>
<ListCardAvatar

View File

@@ -12,12 +12,9 @@ import { t } from '@lingui/core/macro';
import { makeToast } from '@/base/utils/Toast.ts';
import { requestManager } from '@/lib/requests/RequestManager.ts';
import { getMetadataServerSettings } from '@/features/settings/services/ServerSettingsMetadata.ts';
import type {
ChapterListFieldsFragment,
ChapterType,
DownloadTypeFieldsFragment,
} from '@/lib/graphql/generated/graphql.ts';
import { DownloadState } from '@/lib/graphql/generated/graphql.ts';
import type { ChapterListFieldsFragment, DownloadTypeFieldsFragment } from '@/lib/graphql/generated/graphql.ts';
import type { ChapterType } from '@/lib/graphql/generated/graphql-base.types.ts';
import { DownloadState } from '@/lib/graphql/generated/graphql-base.types.ts';
import { CHAPTER_LIST_FIELDS } from '@/lib/graphql/chapter/ChapterFragments.ts';
import type { MangaIdInfo } from '@/features/manga/Manga.types.ts';

View File

@@ -7,13 +7,15 @@
*/
import { useMemo } from 'react';
import type { ChapterType } from '@/lib/graphql/generated/graphql.ts';
import type { ChapterType } from '@/lib/graphql/generated/graphql-base.types.ts';
import type {
ChapterBookmarkInfo,
ChapterDownloadInfo,
ChapterListOptions,
ChapterNumberInfo,
ChapterReadInfo,
ChapterScanlatorInfo,
ChapterSourceOrderInfo,
} from '@/features/chapter/Chapter.types.ts';
import type { MangaIdInfo } from '@/features/manga/Manga.types.ts';
import type { GqlMetaHolder } from '@/features/metadata/Metadata.types.ts';
@@ -60,7 +62,7 @@ function scanlatorFilter(excludedScanlators: string[], { scanlator }: ChapterSca
return !scanlator || !excludedScanlators.includes(scanlator);
}
type TChapterSort = Pick<ChapterType, 'sourceOrder' | 'fetchedAt' | 'chapterNumber' | 'uploadDate'>;
type TChapterSort = ChapterSourceOrderInfo & ChapterNumberInfo & Pick<ChapterType, 'fetchedAt' | 'uploadDate'>;
const sortChapters = <T extends TChapterSort>(
chapters: T[],
{ sortBy, reverse }: Pick<ChapterListOptions, 'sortBy' | 'reverse'>,

View File

@@ -26,7 +26,7 @@ import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts'
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
import { makeToast } from '@/base/utils/Toast.ts';
import { requestManager } from '@/lib/requests/RequestManager.ts';
import { DownloaderState } from '@/lib/graphql/generated/graphql.ts';
import { DownloaderState } from '@/lib/graphql/generated/graphql-base.types.ts';
import type { ChapterDownloadStatus, ChapterIdInfo } from '@/features/chapter/Chapter.types.ts';
import { MediaQuery } from '@/base/utils/MediaQuery.tsx';

View File

@@ -23,7 +23,7 @@ import { makeToast } from '@/base/utils/Toast.ts';
import { EmptyViewAbsoluteCentered } from '@/base/components/feedback/EmptyViewAbsoluteCentered.tsx';
import { LoadingPlaceholder } from '@/base/components/feedback/LoadingPlaceholder.tsx';
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
import { DownloaderState } from '@/lib/graphql/generated/graphql.ts';
import { DownloaderState } from '@/lib/graphql/generated/graphql-base.types.ts';
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
import { DndSortableItem } from '@/lib/dnd-kit/DndSortableItem.tsx';
import { DndKitUtil } from '@/lib/dnd-kit/DndKitUtil.ts';

View File

@@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import type { ExtensionType } from '@/lib/graphql/generated/graphql.ts';
import type { ExtensionType } from '@/lib/graphql/generated/graphql-base.types.ts';
export enum ExtensionAction {
UPDATE = 'UPDATE',

View File

@@ -6,8 +6,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import type { MangaStatus, MangaType, TrackerType } from '@/lib/graphql/generated/graphql.ts';
import type { MangaStatus } from '@/lib/graphql/generated/graphql-base.types.ts';
import type { GridLayout } from '@/base/Base.types.ts';
import type { MangaDescriptionInfo, MangaIdInfo, MangaTitleInfo } from '@/features/manga/Manga.types.ts';
import type { TrackerIdInfo } from '@/features/tracker/Tracker.types.ts';
export type MetadataLibrarySettings = {
showAddToLibraryCategorySelectDialog: boolean;
@@ -39,11 +41,11 @@ export interface LibraryOptions {
hasUnreadChapters: NullAndUndefined<boolean>;
hasReadChapters: NullAndUndefined<boolean>;
hasDuplicateChapters: NullAndUndefined<boolean>;
hasTrackerBinding: Record<TrackerType['id'], NullAndUndefined<boolean>>;
hasTrackerBinding: Record<TrackerIdInfo['id'], NullAndUndefined<boolean>>;
hasStatus: Record<MangaStatus, NullAndUndefined<boolean>>;
}
export type TMangaDuplicate = Pick<MangaType, 'id' | 'title' | 'description'>;
export type TMangaDuplicate = MangaIdInfo & MangaTitleInfo & MangaDescriptionInfo;
export type TMangaDuplicates<Manga> = Record<string, Manga[]>;

View File

@@ -19,7 +19,7 @@ import { OptionsTabs } from '@/base/components/modals/OptionsTabs.tsx';
import { requestManager } from '@/lib/requests/RequestManager.ts';
import { Trackers } from '@/features/tracker/services/Trackers.ts';
import type { GetTrackersSettingsQuery } from '@/lib/graphql/generated/graphql.ts';
import { MangaStatus } from '@/lib/graphql/generated/graphql.ts';
import { MangaStatus } from '@/lib/graphql/generated/graphql-base.types.ts';
import { GET_TRACKERS_SETTINGS } from '@/lib/graphql/tracker/TrackerQuery.ts';
import { STABLE_EMPTY_ARRAY } from '@/base/Base.constants.ts';
import { createUpdateCategoryMetadata, useGetCategoryMetadata } from '@/features/category/services/CategoryMetadata.ts';

View File

@@ -9,19 +9,26 @@
import { StringParam, useQueryParam } from 'use-query-params';
import { useMemo } from 'react';
import { useMetadataServerSettings } from '@/features/settings/services/ServerSettingsMetadata.ts';
import type { ChapterType, MangaType, TrackRecordType } from '@/lib/graphql/generated/graphql.ts';
import type { ChapterType, MangaType, TrackRecordType } from '@/lib/graphql/generated/graphql-base.types.ts';
import { enhancedCleanup } from '@/base/utils/Strings.ts';
import { useGetCategoryMetadata } from '@/features/category/services/CategoryMetadata.ts';
import type { LibraryOptions, LibrarySortMode } from '@/features/library/Library.types.ts';
import type { CategoryIdInfo, CategoryMetadataInfo } from '@/features/category/Category.types.ts';
import type {
MangaArtistInfo,
MangaAuthorInfo,
MangaChapterCountInfo,
MangaDescriptionInfo,
MangaDownloadInfo,
MangaGenreInfo,
MangaIdInfo,
MangaInLibraryInfo,
MangaSourceIdInfo,
MangaSourceNameInfo,
MangaStatusInfo,
MangaTitleInfo,
MangaUnreadInfo,
} from '@/features/manga/Manga.types.ts';
import type { SourceDisplayNameInfo } from '@/features/source/Source.types.ts';
import { SearchParam } from '@/base/Base.types.ts';
const triStateFilter = (
@@ -70,9 +77,13 @@ const performSearch = (
return cleanedUpQueries.every((query) => cleanedUpStrings.includes(query));
};
type TMangaQueryFilter = Pick<MangaType, 'title' | 'genre' | 'description' | 'artist' | 'author' | 'sourceId'> & {
source?: NullAndUndefined<SourceDisplayNameInfo>;
};
type TMangaQueryFilter = MangaTitleInfo &
MangaGenreInfo &
MangaDescriptionInfo &
MangaArtistInfo &
MangaAuthorInfo &
MangaSourceIdInfo &
MangaSourceNameInfo;
const querySearchManga = (
query: NullAndUndefined<string>,
{ title, genre: genres, description, artist, author, source, sourceId }: TMangaQueryFilter,
@@ -162,7 +173,9 @@ const sortByNumber = (a: number | string = 0, b: number | string = 0) => Number(
const sortByString = (a: string, b: string): number => a.localeCompare(b, undefined, { sensitivity: 'base' });
type TMangaSort = Pick<MangaType, 'title' | 'inLibraryAt' | 'unreadCount'> &
type TMangaSort = MangaTitleInfo &
MangaInLibraryInfo &
MangaUnreadInfo &
MangaChapterCountInfo & {
lastReadChapter?: Pick<ChapterType, 'lastReadAt'> | null;
latestUploadedChapter?: Pick<ChapterType, 'uploadDate'> | null;

View File

@@ -39,7 +39,6 @@ import type {
GetLibraryMangaCountQuery,
GetLibraryMangaCountQueryVariables,
MangaChapterStatFieldsFragment,
MangaType,
} from '@/lib/graphql/generated/graphql.ts';
import { GET_CATEGORIES_LIBRARY } from '@/lib/graphql/category/CategoryQuery.ts';
import { Mangas } from '@/features/manga/services/Mangas.ts';
@@ -51,6 +50,7 @@ import { useAppAction } from '@/features/navigation-bar/hooks/useAppAction.ts';
import { AppRoutes } from '@/base/AppRoute.constants.ts';
import { SearchParam } from '@/base/Base.types.ts';
import { STABLE_EMPTY_ARRAY } from '@/base/Base.constants.ts';
import type { MangaIdInfo } from '@/features/manga/Manga.types.ts';
const TitleWithSizeTag = styled('span')({
display: 'flex',
@@ -122,7 +122,7 @@ export function Library() {
handleSelectAll,
handleSelection,
clearSelection,
} = useSelectableCollection<MangaType['id'], string>(mangas.length, {
} = useSelectableCollection<MangaIdInfo['id'], string>(mangas.length, {
itemIds: mangaIds,
currentKey: activeTab?.id.toString(),
initialState: undefined,

View File

@@ -6,11 +6,11 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import type { MangaType } from '@/lib/graphql/generated/graphql.ts';
import { enhancedCleanup } from '@/base/utils/Strings.ts';
import type { TMangaDuplicate, TMangaDuplicateResult, TMangaDuplicates } from '@/features/library/Library.types.ts';
import type { MangaTitleInfo } from '@/features/manga/Manga.types.ts';
export const findDuplicatesByTitle = <Manga extends Pick<MangaType, 'title'>>(
export const findDuplicatesByTitle = <Manga extends MangaTitleInfo>(
libraryMangas: Manga[],
): TMangaDuplicates<Manga> => {
const titleToMangas = Object.groupBy(libraryMangas, ({ title }) => enhancedCleanup(title));

View File

@@ -8,7 +8,7 @@
import type { MessageDescriptor } from '@lingui/core';
import { msg } from '@lingui/core/macro';
import { MangaStatus } from '@/lib/graphql/generated/graphql.ts';
import { MangaStatus } from '@/lib/graphql/generated/graphql-base.types.ts';
import type { MangaAction, MangaIdInfo } from '@/features/manga/Manga.types.ts';
import { MangaType } from '@/features/manga/Manga.types.ts';
import {

View File

@@ -11,31 +11,39 @@ import type { PopupState } from 'material-ui-popup-state/hooks';
import type { JSX } from 'react';
import type { SelectableCollectionReturnType } from '@/base/collection/hooks/useSelectableCollection.ts';
import type { useManageMangaLibraryState } from '@/features/manga/hooks/useManageMangaLibraryState.tsx';
import type { MangaReaderFieldsFragment } from '@/lib/graphql/generated/graphql.ts';
import type { SingleModeProps } from '@/features/manga/components/MangaActionMenuItems.tsx';
import type { GridLayout } from '@/base/Base.types.ts';
import type {
ChapterIdInfo,
ChapterListOptions,
ChapterNameInfo,
ChapterNumberInfo,
ChapterReadInfo,
ChapterSourceOrderInfo,
} from '@/features/chapter/Chapter.types.ts';
import type { MigrationMatch } from '@/features/migration/Migration.types.ts';
import type {
ChapterType,
MangaReaderFieldsFragment,
MangaType as MangaTypeGql,
Maybe,
SourceType,
TrackRecordType,
} from '@/lib/graphql/generated/graphql.ts';
import type { SingleModeProps } from '@/features/manga/components/MangaActionMenuItems.tsx';
import type { GridLayout } from '@/base/Base.types.ts';
import type { ChapterListOptions } from '@/features/chapter/Chapter.types.ts';
import type { MigrationMatch } from '@/features/migration/Migration.types.ts';
} from '@/lib/graphql/generated/graphql-base.types.ts';
export type MangaCardMode = 'default' | 'source' | 'migrate.search' | 'migrate.select' | 'duplicate';
type MangaCardBaseProps = Pick<MangaTypeGql, 'id' | 'title' | 'sourceId'> &
Omit<SingleModeProps['manga'], 'downloadCount' | 'unreadCount' | 'chapters'> &
Partial<Pick<MangaTypeGql, 'inLibrary' | 'downloadCount' | 'unreadCount'>> & {
firstUnreadChapter?: Pick<ChapterType, 'id' | 'sourceOrder' | 'isRead' | 'chapterNumber' | 'name'> | null;
firstUnreadChapter?:
| (ChapterIdInfo & ChapterSourceOrderInfo & ChapterReadInfo & ChapterNumberInfo & ChapterNameInfo)
| null;
};
export type MangaIdInfo = Pick<MangaTypeGql, 'id'>;
export type MangaChapterCountInfo = { chapters: Pick<MangaTypeGql['chapters'], 'totalCount'> };
export type MangaHighestChapterNumberInfo = { highestNumberedChapter?: Pick<ChapterType, 'id' | 'chapterNumber'> };
export type MangaInLibraryInfo = Pick<MangaTypeGql, 'inLibrary'>;
export type MangaHighestChapterNumberInfo = { highestNumberedChapter?: (ChapterIdInfo & ChapterNumberInfo) | null };
export type MangaInLibraryInfo = Pick<MangaTypeGql, 'inLibrary' | 'inLibraryAt'>;
export type MangaDownloadInfo = Pick<MangaTypeGql, 'downloadCount'> & MangaChapterCountInfo;
export type MangaUnreadInfo = Pick<MangaTypeGql, 'unreadCount'> & MangaChapterCountInfo;
export type MangaThumbnailInfo = Pick<MangaTypeGql, 'thumbnailUrl' | 'thumbnailUrlLastFetched' | 'sourceId'>;

View File

@@ -31,8 +31,15 @@ import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts'
import { TrackManga } from '@/features/tracker/components/TrackManga.tsx';
import { ChaptersDownloadActionMenuItems } from '@/features/chapter/components/actions/ChaptersDownloadActionMenuItems.tsx';
import { NestedMenuItem } from '@/base/components/menu/NestedMenuItem.tsx';
import type { MangaChapterStatFieldsFragment, MangaType } from '@/lib/graphql/generated/graphql.ts';
import type { MangaAction, MangaDownloadInfo, MangaIdInfo, MangaUnreadInfo } from '@/features/manga/Manga.types.ts';
import type { MangaChapterStatFieldsFragment } from '@/lib/graphql/generated/graphql.ts';
import type {
MangaAction,
MangaDownloadInfo,
MangaIdInfo,
MangaSourceIdInfo,
MangaTitleInfo,
MangaUnreadInfo,
} from '@/features/manga/Manga.types.ts';
import { MANGA_ACTION_TO_TRANSLATION } from '@/features/manga/Manga.constants.ts';
import { CategorySelect } from '@/features/category/components/CategorySelect.tsx';
import { STABLE_EMPTY_ARRAY } from '@/base/Base.constants.ts';
@@ -40,8 +47,8 @@ import { STABLE_EMPTY_ARRAY } from '@/base/Base.constants.ts';
type BaseProps = { onClose: () => void; setHideMenu: (hide: boolean) => void };
export type SingleModeProps = {
manga: Pick<MangaType, 'id' | 'title' | 'sourceId'> & MangaDownloadInfo & MangaUnreadInfo;
handleSelection?: SelectableCollectionReturnType<MangaType['id']>['handleSelection'];
manga: MangaIdInfo & MangaTitleInfo & MangaSourceIdInfo & MangaDownloadInfo & MangaUnreadInfo;
handleSelection?: SelectableCollectionReturnType<MangaIdInfo['id']>['handleSelection'];
};
type SelectModeProps = {

View File

@@ -26,8 +26,7 @@ import { EmptyViewAbsoluteCentered } from '@/base/components/feedback/EmptyViewA
import { LoadingPlaceholder } from '@/base/components/feedback/LoadingPlaceholder.tsx';
import { MangaCard } from '@/features/manga/components/cards/MangaCard.tsx';
import { DEFAULT_FULL_FAB_HEIGHT } from '@/base/components/buttons/StyledFab.tsx';
import type { MangaCardProps } from '@/features/manga/Manga.types.ts';
import type { MangaType } from '@/lib/graphql/generated/graphql.ts';
import type { MangaCardProps, MangaIdInfo } from '@/features/manga/Manga.types.ts';
import { useResizeObserver } from '@/base/hooks/useResizeObserver.tsx';
import { useNavBarContext } from '@/features/navigation-bar/NavbarContext.tsx';
import { GridLayout } from '@/base/Base.types.ts';
@@ -64,7 +63,7 @@ const createMangaCard = (
gridLayout?: GridLayout,
inLibraryIndicator?: boolean,
isSelectModeActive: boolean = false,
selectedMangaIds?: MangaType['id'][],
selectedMangaIds?: MangaIdInfo['id'][],
handleSelection?: DefaultGridProps['handleSelection'],
mode?: MangaCardProps['mode'],
onMigrateSelect?: DefaultGridProps['onMigrateSelect'],
@@ -87,7 +86,7 @@ type DefaultGridProps = Omit<MangaCardProps, 'manga' | 'selected'> & {
GridItemContainer: (props: GridTypeMap['props'] & Partial<GridItemProps>) => JSX.Element;
gridLayout?: GridLayout;
isSelectModeActive?: boolean;
selectedMangaIds?: Required<MangaType['id']>[];
selectedMangaIds?: MangaIdInfo['id'][];
ref?: ForwardedRef<HTMLDivElement | null>;
};

View File

@@ -17,8 +17,8 @@ import { bindTrigger } from 'material-ui-popup-state';
import { useLingui } from '@lingui/react/macro';
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
import type { SelectableCollectionReturnType } from '@/base/collection/hooks/useSelectableCollection.ts';
import type { MangaType } from '@/lib/graphql/generated/graphql.ts';
import { MUIUtil } from '@/lib/mui/MUI.util.ts';
import type { MangaIdInfo } from '@/features/manga/Manga.types.ts';
const preventDefaultAction = (e: BaseSyntheticEvent) => {
e.stopPropagation();
@@ -35,7 +35,7 @@ export const MangaOptionButton = ({
}: {
id: number;
selected?: boolean | null;
handleSelection?: SelectableCollectionReturnType<MangaType['id']>['handleSelection'];
handleSelection?: SelectableCollectionReturnType<MangaIdInfo['id']>['handleSelection'];
asCheckbox?: boolean;
popupState: PopupState;
ref?: ForwardedRef<HTMLButtonElement | null>;

View File

@@ -23,14 +23,19 @@ import { AwaitableComponent } from 'awaitable-component';
import ColorLensIcon from '@mui/icons-material/ColorLens';
import { useLingui } from '@lingui/react/macro';
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
import type { MangaType } from '@/lib/graphql/generated/graphql.ts';
import { AppRoutes } from '@/base/AppRoute.constants.ts';
import { CategorySelect } from '@/features/category/components/CategorySelect.tsx';
import { useMetadataServerSettings } from '@/features/settings/services/ServerSettingsMetadata.ts';
import { ThemeCreationDialog } from '@/features/theme/components/CreateThemeDialog.tsx';
import type {
MangaIdInfo,
MangaInLibraryInfo,
MangaSourceIdInfo,
MangaTitleInfo,
} from '@/features/manga/Manga.types.ts';
interface IProps {
manga: Pick<MangaType, 'id' | 'inLibrary' | 'sourceId' | 'title'>;
manga: MangaIdInfo & MangaInLibraryInfo & MangaSourceIdInfo & MangaTitleInfo;
onRefresh: () => any;
refreshing: boolean;
}

View File

@@ -18,14 +18,14 @@ import { makeToast } from '@/base/utils/Toast.ts';
import { TrackManga } from '@/features/tracker/components/TrackManga.tsx';
import { Trackers } from '@/features/tracker/services/Trackers.ts';
import { CustomButton } from '@/base/components/buttons/CustomButton.tsx';
import type { GetTrackersSettingsQuery, MangaType } from '@/lib/graphql/generated/graphql.ts';
import type { GetTrackersSettingsQuery } from '@/lib/graphql/generated/graphql.ts';
import { GET_TRACKERS_SETTINGS } from '@/lib/graphql/tracker/TrackerQuery.ts';
import type { MangaTrackRecordInfo } from '@/features/manga/Manga.types.ts';
import type { MangaTitleInfo, MangaTrackRecordInfo } from '@/features/manga/Manga.types.ts';
import { AppRoutes } from '@/base/AppRoute.constants.ts';
import { MediaQuery } from '@/base/utils/MediaQuery.tsx';
import { STABLE_EMPTY_ARRAY } from '@/base/Base.constants.ts';
export const TrackMangaButton = ({ manga }: { manga: MangaTrackRecordInfo & Pick<MangaType, 'title'> }) => {
export const TrackMangaButton = ({ manga }: { manga: MangaTrackRecordInfo & MangaTitleInfo }) => {
const { t } = useLingui();
const navigate = useNavigate();
const isMobileWidth = MediaQuery.useIsMobileWidth();

View File

@@ -28,7 +28,7 @@ import { TrackMangaButton } from '@/features/manga/components/TrackMangaButton.t
import { useManageMangaLibraryState } from '@/features/manga/hooks/useManageMangaLibraryState.tsx';
import { Metadata as BaseMetadata } from '@/base/components/texts/Metadata.tsx';
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
import type { MangaType, SourceType } from '@/lib/graphql/generated/graphql.ts';
import type { MangaType, SourceType } from '@/lib/graphql/generated/graphql-base.types.ts';
import { useMetadataServerSettings } from '@/features/settings/services/ServerSettingsMetadata.ts';
import { MANGA_STATUS_TO_TRANSLATION } from '@/features/manga/Manga.constants.ts';
import type {

View File

@@ -16,19 +16,16 @@ import { getMetadataServerSettings } from '@/features/settings/services/ServerSe
import { Categories } from '@/features/category/services/Categories.ts';
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
import { Mangas } from '@/features/manga/services/Mangas.ts';
import type {
GetCategoriesBaseQuery,
GetCategoriesBaseQueryVariables,
MangaType,
} from '@/lib/graphql/generated/graphql.ts';
import type { GetCategoriesBaseQuery, GetCategoriesBaseQueryVariables } from '@/lib/graphql/generated/graphql.ts';
import { GET_CATEGORIES_BASE } from '@/lib/graphql/category/CategoryQuery.ts';
import { AppRoutes } from '@/base/AppRoute.constants.ts';
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
import { CategorySelect } from '@/features/category/components/CategorySelect';
import { Confirmation } from '@/base/AppAwaitableComponent.ts';
import type { MangaIdInfo, MangaInLibraryInfo, MangaTitleInfo } from '@/features/manga/Manga.types.ts';
export const useManageMangaLibraryState = (
manga: Pick<MangaType, 'id' | 'title'> & Partial<Pick<MangaType, 'inLibrary'>>,
manga: MangaIdInfo & MangaTitleInfo & Partial<MangaInLibraryInfo>,
confirmRemoval: boolean = false,
) => {
const { t } = useLingui();

View File

@@ -11,12 +11,10 @@ import { t } from '@lingui/core/macro';
import { i18n } from '@/i18n';
import { requestManager } from '@/lib/requests/RequestManager.ts';
import type {
ChapterConditionInput,
GetMangasBaseQuery,
GetMangasBaseQueryVariables,
GetMangasChapterIdsWithStateQuery,
MangaBaseFieldsFragment,
UpdateMangaCategoriesPatchInput,
} from '@/lib/graphql/generated/graphql.ts';
import { Chapters } from '@/features/chapter/services/Chapters.ts';
import { makeToast } from '@/base/utils/Toast.ts';
@@ -52,6 +50,10 @@ import { MigrationManager } from '@/features/migration/MigrationManager.ts';
import uniq from 'lodash/fp/uniq';
import { ReactRouter } from '@/lib/react-router/ReactRouter.ts';
import { AppRoutes } from '@/base/AppRoute.constants.ts';
import type {
ChapterConditionInput,
UpdateMangaCategoriesPatchInput,
} from '@/lib/graphql/generated/graphql-base.types.ts';
type DownloadChaptersOptions = {
size?: number;

View File

@@ -10,7 +10,7 @@ import type { MetadataServerSettingKeys, SearchMetadataKeys } from '@/features/s
import type { MangaMetadataKeys } from '@/features/manga/Manga.types.ts';
import type { SourceMetadataKeys } from '@/features/source/Source.types.ts';
import type { CategoryMetadataKeys } from '@/features/category/Category.types.ts';
import type { MetaType } from '@/lib/graphql/generated/graphql.ts';
import type { MetaType } from '@/lib/graphql/generated/graphql-base.types.ts';
import type { IReaderSettings } from '@/features/reader/Reader.types.ts';
export interface IMetadataMigration {

View File

@@ -8,7 +8,7 @@
import type { FieldFunctionOptions } from '@apollo/client/cache';
import type { Reference } from '@apollo/client/utilities';
import type { MetaType } from '@/lib/graphql/generated/graphql.ts';
import type { MetaType } from '@/lib/graphql/generated/graphql-base.types.ts';
type ReadFieldFunction = FieldFunctionOptions['readField'];

View File

@@ -10,12 +10,9 @@ import type { GqlMetaHolder, Metadata, MetadataHolderType } from '@/features/met
import { convertFromGqlMeta } from '@/features/metadata/services/MetadataConverter.ts';
import { requestManager } from '@/lib/requests/RequestManager.ts';
import { GET_GLOBAL_METADATAS } from '@/lib/graphql/metadata/GlobalMetadataQuery.ts';
import type {
GetGlobalMetadatasQuery,
GetGlobalMetadatasQueryVariables,
MetaInput,
} from '@/lib/graphql/generated/graphql.ts';
import type { GetGlobalMetadatasQuery, GetGlobalMetadatasQueryVariables } from '@/lib/graphql/generated/graphql.ts';
import { doesMetadataKeyExistIn } from '@/features/metadata/Metadata.utils.ts';
import type { MetaInput } from '@/lib/graphql/generated/graphql-base.types.ts';
export class MetadataChunker {
static readonly MAX_METADATA_VALUE_LENGTH = 4000;

View File

@@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import type { MetaType } from '@/lib/graphql/generated/graphql.ts';
import type { MetaType } from '@/lib/graphql/generated/graphql-base.types.ts';
import type { AllowedMetadataValueTypes, AppMetadataKeys, Metadata } from '@/features/metadata/Metadata.types.ts';
import { APP_METADATA } from '@/features/metadata/Metadata.constants.ts';

View File

@@ -21,7 +21,7 @@ import { convertToGqlMeta } from '@/features/metadata/services/MetadataConverter
import { MetadataChunker } from '@/features/metadata/services/MetadataChunker.ts';
import type { SourceIdInfo } from '@/features/source/Source.types.ts';
import type { ChapterIdInfo } from '@/features/chapter/Chapter.types.ts';
import type { MetaInput } from '@/lib/graphql/generated/graphql.ts';
import type { MetaInput } from '@/lib/graphql/generated/graphql-base.types.ts';
type MetadataUpdateOptions = {
update?: MetadataKeyValuePair[];

View File

@@ -7,7 +7,7 @@
*/
import { requestManager } from '@/lib/requests/RequestManager.ts';
import type { SetChapterMetasItemInput } from '@/lib/graphql/generated/graphql.ts';
import type { SetChapterMetasItemInput } from '@/lib/graphql/generated/graphql-base.types.ts';
import type { MangaIdInfo } from '@/features/manga/Manga.types.ts';
import { Chapters } from '@/features/chapter/services/Chapters.ts';
import { ALL_APP_METADATA_KEY_PREFIXES } from '@/features/metadata/Metadata.constants.ts';

View File

@@ -38,10 +38,19 @@ import type {
GetServerSettingsQueryVariables,
MangaMigrationFieldsFragment,
} from '@/lib/graphql/generated/graphql.ts';
import { FetchSourceMangaType } from '@/lib/graphql/generated/graphql.ts';
import { FetchSourceMangaType } from '@/lib/graphql/generated/graphql-base.types.ts';
import { GET_SERVER_SETTINGS } from '@/lib/graphql/settings/SettingsQuery.ts';
import { MangaMigration } from '@/features/migration/MangaMigration.ts';
import type { MangaIdInfo } from '@/features/manga/Manga.types.ts';
import type {
MangaArtistInfo,
MangaAuthorInfo,
MangaHighestChapterNumberInfo,
MangaIdInfo,
MangaSourceIdInfo,
MangaSourceNameInfo,
MangaThumbnailInfo,
MangaTitleInfo,
} from '@/features/manga/Manga.types.ts';
import type { SourceIdInfo } from '@/features/source/Source.types.ts';
import { assertIsDefined } from '@/base/Asserts.ts';
import { ReactRouter } from '@/lib/react-router/ReactRouter.ts';
@@ -286,7 +295,16 @@ export class MigrationManager {
});
}
static selectMangas(mangas: MangaMigrationFieldsFragment[]): void {
static selectMangas(
mangas: (MangaIdInfo &
MangaTitleInfo &
MangaArtistInfo &
MangaAuthorInfo &
MangaHighestChapterNumberInfo &
MangaThumbnailInfo &
MangaSourceIdInfo &
MangaSourceNameInfo)[],
): void {
MigrationManager.ensureIsInValidPhase([MigrationPhase.SELECT_MANGAS]);
const isSingleManga = mangas.length === 1;

View File

@@ -26,7 +26,7 @@ import { NavBarItemMoreGroup } from '@/features/navigation-bar/NavigationBar.typ
import { AppRoutes } from '@/base/AppRoute.constants.ts';
import { requestManager } from '@/lib/requests/RequestManager.ts';
import { STABLE_EMPTY_ARRAY } from '@/base/Base.constants.ts';
import { DownloaderState } from '@/lib/graphql/generated/graphql.ts';
import { DownloaderState } from '@/lib/graphql/generated/graphql-base.types.ts';
type RestrictedNavBarItem<Show extends NavbarItem['show']> = Omit<NavbarItem, 'show'> & { show: Show };

View File

@@ -8,7 +8,7 @@
import type { ReaderPageSpreadState, ReaderStateChapters, ReaderStatePages } from '@/features/reader/Reader.types.ts';
import { ReaderResumeMode, ReadingMode } from '@/features/reader/Reader.types.ts';
import type { UpdateChapterPatchInput } from '@/lib/graphql/generated/graphql.ts';
import type { UpdateChapterPatchInput } from '@/lib/graphql/generated/graphql-base.types.ts';
import type { ChapterIdInfo, TChapterReader } from '@/features/chapter/Chapter.types.ts';
import { Chapters } from '@/features/chapter/services/Chapters.ts';
import { CHAPTER_READER_FIELDS } from '@/lib/graphql/chapter/ChapterFragments.ts';

View File

@@ -21,7 +21,7 @@ import { makeToast } from '@/base/utils/Toast.ts';
import { MediaQuery } from '@/base/utils/MediaQuery.tsx';
import { useBackButton } from '@/base/hooks/useBackButton.ts';
import { GLOBAL_READER_SETTING_KEYS } from '@/features/reader/settings/ReaderSettings.constants.tsx';
import type { UpdateChapterPatchInput } from '@/lib/graphql/generated/graphql.ts';
import type { UpdateChapterPatchInput } from '@/lib/graphql/generated/graphql-base.types.ts';
import { useMetadataServerSettings } from '@/features/settings/services/ServerSettingsMetadata.ts';
import {
getChapterIdsForDownloadAhead,

View File

@@ -13,7 +13,6 @@ import {
requestMangaMetadataUpdate,
requestServerMetadataUpdate,
} from '@/features/metadata/services/MetadataUpdater.ts';
import type { MangaType } from '@/lib/graphql/generated/graphql.ts';
import type { IReaderSettings, IReaderSettingsWithDefaultFlag, ReadingMode } from '@/features/reader/Reader.types.ts';
import { convertFromGqlMeta } from '@/features/metadata/services/MetadataConverter.ts';
import { getMetadataFrom } from '@/features/metadata/services/MetadataReader.ts';
@@ -220,7 +219,7 @@ export const useDefaultReaderSettingsWithDefaultFlag = (
};
export const updateReaderSettings = async <Setting extends keyof IReaderSettings = keyof IReaderSettings>(
manga: Pick<MangaType, 'id'> & GqlMetaHolder,
manga: MangaIdInfo & GqlMetaHolder,
setting: Setting,
value: IReaderSettings[Setting],
isGlobal: boolean = false,
@@ -241,7 +240,7 @@ export const updateReaderSettings = async <Setting extends keyof IReaderSettings
};
export const createUpdateReaderSettings =
<Settings extends keyof IReaderSettings>(
manga: Pick<MangaType, 'id'> & GqlMetaHolder,
manga: MangaIdInfo & GqlMetaHolder,
handleError: (error: any) => void = defaultPromiseErrorHandler('createUpdateReaderSettings'),
profile?: ReadingMode,
): ((...args: OmitFirst<Parameters<typeof updateReaderSettings<Settings>>>) => Promise<void>) =>

View File

@@ -29,8 +29,7 @@ import type { NavbarContextType } from '@/features/navigation-bar/NavigationBar.
import { withPropsFrom } from '@/base/hoc/withPropsFrom.tsx';
import { getValueFromObject, noOp } from '@/lib/HelperFunctions.ts';
import { READER_BACKGROUND_TO_COLOR } from '@/features/reader/settings/ReaderSettings.constants.tsx';
import type { ChapterType } from '@/lib/graphql/generated/graphql.ts';
import type { ChapterIdInfo } from '@/features/chapter/Chapter.types.ts';
import type { ChapterIdInfo, ChapterNameInfo, ChapterScanlatorInfo } from '@/features/chapter/Chapter.types.ts';
import {
useReaderChaptersStore,
useReaderPagesStore,
@@ -46,8 +45,8 @@ const ChapterInfo = ({
backgroundColor,
}: {
title: string;
name?: ChapterType['name'];
scanlator?: ChapterType['scanlator'];
name?: ChapterNameInfo['name'];
scanlator?: ChapterScanlatorInfo['scanlator'];
backgroundColor: IReaderSettings['backgroundColor'];
}) => {
const theme = useTheme();
@@ -89,12 +88,12 @@ const BaseReaderTransitionPage = ({
}: Pick<NavbarContextType, 'readerNavBarWidth'> & {
// gets used in the "source props creators" of the "withPropsFrom" call
chapterId: ChapterIdInfo['id'];
currentChapterName?: ChapterType['name'];
currentChapterScanlator?: ChapterType['scanlator'];
previousChapterName?: ChapterType['name'];
previousChapterScanlator?: ChapterType['scanlator'];
nextChapterName?: ChapterType['name'];
nextChapterScanlator?: ChapterType['scanlator'];
currentChapterName?: ChapterNameInfo['name'];
currentChapterScanlator?: ChapterScanlatorInfo['scanlator'];
previousChapterName?: ChapterNameInfo['name'];
previousChapterScanlator?: ChapterScanlatorInfo['scanlator'];
nextChapterName?: ChapterNameInfo['name'];
nextChapterScanlator?: ChapterScanlatorInfo['scanlator'];
type: Exclude<ReaderTransitionPageMode, ReaderTransitionPageMode.NONE | ReaderTransitionPageMode.BOTH>;
handleBack: () => void;
}) => {

View File

@@ -25,7 +25,7 @@ import type {
SettingsDownloadConversion,
SettingsDownloadConversionHeader,
SettingsDownloadConversionType,
} from '@/lib/graphql/generated/graphql.ts';
} from '@/lib/graphql/generated/graphql-base.types.ts';
import { UrlUtil } from '@/lib/UrlUtil.ts';
import { jsonSaveParse } from '@/lib/HelperFunctions.ts';

View File

@@ -27,7 +27,7 @@ import {
WebUiChannel,
WebUiFlavor,
WebUiInterface,
} from '@/lib/graphql/generated/graphql.ts';
} from '@/lib/graphql/generated/graphql-base.types.ts';
import { ThemeMode } from '@/features/theme/AppTheme.types.ts';
import { getPreferredISOLanguageCodes } from '@/lib/ISOLanguageUtil.ts';

View File

@@ -15,12 +15,12 @@ import type { MetadataTrackingSettings } from '@/features/tracker/Tracker.types.
import type { MetadataUpdateSettings } from '@/features/app-updates/AppUpdateChecker.types.ts';
import type { MetadataThemeSettings } from '@/features/theme/AppTheme.types.ts';
import type {
GetServerSettingsQuery,
Maybe,
SettingsDownloadConversion,
SettingsDownloadConversionHeader,
} from '@/lib/graphql/generated/graphql.ts';
} from '@/lib/graphql/generated/graphql-base.types.ts';
import type { MetadataHistorySettings } from '@/features/history/History.types.ts';
import type { GetServerSettingsQuery } from '@/lib/graphql/generated/graphql.ts';
export type MetadataServerSettingKeys = keyof MetadataServerSettings;

View File

@@ -11,7 +11,7 @@ import Typography from '@mui/material/Typography';
import Button from '@mui/material/Button';
import Collapse from '@mui/material/Collapse';
import { useLingui } from '@lingui/react/macro';
import type { Maybe } from '@/lib/graphql/generated/graphql.ts';
import type { Maybe } from '@/lib/graphql/generated/graphql-base.types.ts';
import { addStableIdToKeyValueItems, isDuplicateKeyValueItem } from '@/features/settings/ImageProcessing.utils.ts';
import { KeyValueItem } from '@/features/settings/components/images/KeyValueItem.tsx';
import type { TSettingsDownloadConversionKeyValueItem } from '@/features/settings/Settings.types.ts';

View File

@@ -21,7 +21,7 @@ import type {
KoreaderSyncChecksumMethod,
KoreaderSyncConflictStrategy,
KoSyncStatusPayload,
} from '@/lib/graphql/generated/graphql.ts';
} from '@/lib/graphql/generated/graphql-base.types.ts';
import {
KOREADER_SYNC_CHECKSUM_METHOD_SELECT_VALUES,
KOREADER_SYNC_CONFLICT_STRATEGY_SELECT_VALUES,

View File

@@ -15,7 +15,7 @@ import { useLingui } from '@lingui/react/macro';
import { requestManager } from '@/lib/requests/RequestManager.ts';
import { ListItemLink } from '@/base/components/lists/ListItemLink.tsx';
import { LoadingPlaceholder } from '@/base/components/feedback/LoadingPlaceholder.tsx';
import { UpdateState } from '@/lib/graphql/generated/graphql.ts';
import { UpdateState } from '@/lib/graphql/generated/graphql-base.types.ts';
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
import { EmptyViewAbsoluteCentered } from '@/base/components/feedback/EmptyViewAbsoluteCentered.tsx';
import { VersionInfo } from '@/features/app-updates/components/VersionInfo.tsx';

View File

@@ -16,7 +16,7 @@ import {
IMAGE_PROCESSING_TYPE_TO_TRANSLATION,
} from '@/features/settings/Settings.constants.ts';
import { requestManager } from '@/lib/requests/RequestManager.ts';
import type { ImageProcessingType, ServerSettings } from '@/features/settings/Settings.types.ts';
import type { ImageProcessingType } from '@/features/settings/Settings.types.ts';
import { makeToast } from '@/base/utils/Toast.ts';
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
import { LoadingPlaceholder } from '@/base/components/feedback/LoadingPlaceholder.tsx';
@@ -34,6 +34,7 @@ import {
} from '@/features/settings/ImageProcessing.utils.ts';
import { Processing } from '@/features/settings/components/images/Processing.tsx';
import { STABLE_EMPTY_ARRAY } from '@/base/Base.constants.ts';
import type { PartialSettingsType } from '@/lib/graphql/generated/graphql-base.types.ts';
export const ImageProcessingSetting = ({ type }: { type: ImageProcessingType }) => {
const { t } = useLingui();
@@ -57,7 +58,7 @@ export const ImageProcessingSetting = ({ type }: { type: ImageProcessingType })
tmpConversions,
);
const updateSetting = (value: ServerSettings[typeof settingKey]): Promise<any> => {
const updateSetting = (value: PartialSettingsType[typeof settingKey]): Promise<any> => {
const mutation = mutateSettings({ variables: { input: { settings: { [settingKey]: value } } } });
mutation.catch((e) => makeToast(t`Failed to save changes`, 'error', getErrorMessage(e)));

View File

@@ -31,7 +31,7 @@ import { makeToast } from '@/base/utils/Toast.ts';
import type { MetadataUpdateSettings } from '@/features/app-updates/AppUpdateChecker.types.ts';
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
import { useAppTitle } from '@/features/navigation-bar/hooks/useAppTitle.ts';
import { AuthMode, CbzMediaType, DatabaseType, SortOrder } from '@/lib/graphql/generated/graphql';
import { AuthMode, CbzMediaType, DatabaseType, SortOrder } from '@/lib/graphql/generated/graphql-base.types.ts';
import {
AUTH_MODES_SELECT_VALUES,
JWT_ACCESS_TOKEN_EXPIRY,

View File

@@ -15,8 +15,8 @@ import { requestManager } from '@/lib/requests/RequestManager.ts';
import { WebUIUpdateIntervalSetting } from '@/features/settings/components/webUI/WebUIUpdateIntervalSetting.tsx';
import { TextSetting } from '@/base/components/settings/text/TextSetting.tsx';
import { SelectSetting } from '@/base/components/settings/SelectSetting.tsx';
import type { WebUiChannel, WebUiInterface } from '@/lib/graphql/generated/graphql.ts';
import { WebUiFlavor } from '@/lib/graphql/generated/graphql.ts';
import type { WebUiChannel, WebUiInterface } from '@/lib/graphql/generated/graphql-base.types.ts';
import { WebUiFlavor } from '@/lib/graphql/generated/graphql-base.types.ts';
import { LoadingPlaceholder } from '@/base/components/feedback/LoadingPlaceholder.tsx';
import { EmptyViewAbsoluteCentered } from '@/base/components/feedback/EmptyViewAbsoluteCentered.tsx';
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';

View File

@@ -7,13 +7,15 @@
*/
import type {
ExtensionType,
GetSourceBrowseQuery,
GetSourceSettingsQuery,
SourceMetaFieldsFragment,
} from '@/lib/graphql/generated/graphql.ts';
import type {
ExtensionType,
SourcePreferenceChangeInput,
SourceType,
} from '@/lib/graphql/generated/graphql.ts';
} from '@/lib/graphql/generated/graphql-base.types.ts';
export interface IPos {
type: 'selectState' | 'textState' | 'checkBoxState' | 'triState' | 'sortState';
@@ -44,10 +46,10 @@ export interface PreferenceProps {
}
export type CheckBoxPreferenceProps = PreferenceProps &
ExtractByKeyValue<SourcePreferences, '__typename', 'CheckBoxPreference'>;
ExtractByKeyValue<SourcePreferences, 'type', 'CheckBoxPreference'>;
export type SwitchPreferenceCompatProps = PreferenceProps &
ExtractByKeyValue<SourcePreferences, '__typename', 'SwitchPreference'>;
ExtractByKeyValue<SourcePreferences, 'type', 'SwitchPreference'>;
export type TwoStatePreferenceProps = (CheckBoxPreferenceProps | SwitchPreferenceCompatProps) & {
// intetnal props
@@ -55,13 +57,13 @@ export type TwoStatePreferenceProps = (CheckBoxPreferenceProps | SwitchPreferenc
};
export type ListPreferenceProps = PreferenceProps &
ExtractByKeyValue<SourcePreferences, '__typename', 'ListPreference'>;
Omit<ExtractByKeyValue<SourcePreferences, 'type', 'ListPreference'>, '__typename'>;
export type MultiSelectListPreferenceProps = PreferenceProps &
ExtractByKeyValue<SourcePreferences, '__typename', 'MultiSelectListPreference'>;
Omit<ExtractByKeyValue<SourcePreferences, 'type', 'MultiSelectListPreference'>, '__typename'>;
export type EditTextPreferenceProps = PreferenceProps &
ExtractByKeyValue<SourcePreferences, '__typename', 'EditTextPreference'>;
Omit<ExtractByKeyValue<SourcePreferences, 'type', 'EditTextPreference'>, '__typename'>;
export type SourceIdInfo = Pick<SourceType, 'id'>;
export type SourceLanguageInfo = Pick<SourceType, 'lang'>;

View File

@@ -19,7 +19,7 @@ import { Options } from '@/features/source/browse/components/SourceOptions.tsx';
import type { IPos, SourceFilters } from '@/features/source/Source.types.ts';
interface Props {
state: ExtractByKeyValue<SourceFilters, '__typename', 'GroupFilter'>['filters'];
state: ExtractByKeyValue<SourceFilters, 'type', 'GroupFilter'>['filters'];
name: string;
position: number;
updateFilterValue: (value: IPos[]) => void;

View File

@@ -15,7 +15,7 @@ import Stack from '@mui/material/Stack';
import Box from '@mui/material/Box';
import React from 'react';
import { SortRadioInput } from '@/base/components/inputs/SortRadioInput.tsx';
import type { SortSelectionInput } from '@/lib/graphql/generated/graphql.ts';
import type { SortSelectionInput } from '@/lib/graphql/generated/graphql-base.types.ts';
import type { IPos } from '@/features/source/Source.types.ts';
interface Props {

View File

@@ -8,7 +8,7 @@
import React from 'react';
import { ThreeStateCheckboxInput } from '@/base/components/inputs/ThreeStateCheckboxInput.tsx';
import { TriState } from '@/lib/graphql/generated/graphql.ts';
import { TriState } from '@/lib/graphql/generated/graphql-base.types.ts';
import type { IPos } from '@/features/source/Source.types.ts';
interface Props {

View File

@@ -191,8 +191,10 @@ const useSourceManga = (
{
...pages[pages.length - 1],
data: {
__typename: 'Mutation',
...lastLoadedPage!.data,
fetchSourceManga: {
__typename: 'FetchSourceMangaPayload',
...lastLoadedPage!.data!.fetchSourceManga,
hasNextPage:
pages.length > lastLoadedPageIndex + 1

View File

@@ -6,12 +6,8 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import type {
TrackerType,
TrackRecordSearchFieldsFragment,
TrackRecordType,
TrackSearchType,
} from '@/lib/graphql/generated/graphql.ts';
import type { TrackerType, TrackRecordType, TrackSearchType } from '@/lib/graphql/generated/graphql-base.types.ts';
import type { TrackRecordSearchFieldsFragment } from '@/lib/graphql/generated/graphql.ts';
export type MetadataTrackingSettings = {
updateProgressAfterReading: boolean;

View File

@@ -17,10 +17,10 @@ import { Trackers } from '@/features/tracker/services/Trackers.ts';
import { TrackerCard, TrackerMode } from '@/features/tracker/components/cards/TrackerCard.tsx';
import { makeToast } from '@/base/utils/Toast.ts';
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
import type { GetMangaTrackRecordsQuery, GetTrackersBindQuery, MangaType } from '@/lib/graphql/generated/graphql.ts';
import type { GetMangaTrackRecordsQuery, GetTrackersBindQuery } from '@/lib/graphql/generated/graphql.ts';
import { GET_TRACKERS_BIND } from '@/lib/graphql/tracker/TrackerQuery.ts';
import { GET_MANGA_TRACK_RECORDS } from '@/lib/graphql/manga/MangaQuery.ts';
import type { MangaIdInfo } from '@/features/manga/Manga.types.ts';
import type { MangaIdInfo, MangaTitleInfo } from '@/features/manga/Manga.types.ts';
import { AppRoutes } from '@/base/AppRoute.constants.ts';
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
import { EmptyView } from '@/base/components/feedback/EmptyView.tsx';
@@ -38,7 +38,7 @@ const getTrackerMode = (id: number, trackersInUse: number[], searchModeForTracke
return TrackerMode.UNTRACKED;
};
export const TrackManga = ({ manga }: { manga: MangaIdInfo & Pick<MangaType, 'title'> }) => {
export const TrackManga = ({ manga }: { manga: MangaIdInfo & MangaTitleInfo }) => {
const { t } = useLingui();
const navigate = useNavigate();

View File

@@ -31,8 +31,7 @@ import { TrackerMangaCard } from '@/features/tracker/components/cards/TrackerMan
import { DIALOG_PADDING } from '@/features/tracker/Tracker.constants.ts';
import { useGetOptionForDirection } from '@/features/theme/services/ThemeCreator.ts';
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
import type { MangaType } from '@/lib/graphql/generated/graphql.ts';
import type { MangaIdInfo } from '@/features/manga/Manga.types.ts';
import type { MangaIdInfo, MangaTitleInfo } from '@/features/manga/Manga.types.ts';
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
import { applyStyles } from '@/base/utils/ApplyStyles.ts';
@@ -119,7 +118,7 @@ export const TrackerSearch = ({
trackedId,
trackedTitle,
}: {
manga: MangaIdInfo & Pick<MangaType, 'title'>;
manga: MangaIdInfo & MangaTitleInfo;
tracker: TTrackerBind;
closeSearchMode: () => void;
trackedId?: string;

View File

@@ -41,7 +41,7 @@ import { TypographyMaxLines } from '@/base/components/texts/TypographyMaxLines.t
import type { SelectSettingValue } from '@/base/components/settings/SelectSetting.tsx';
import { SelectSetting } from '@/base/components/settings/SelectSetting.tsx';
import { CheckboxInput } from '@/base/components/inputs/CheckboxInput.tsx';
import type { TrackRecordType } from '@/lib/graphql/generated/graphql.ts';
import type { TrackRecordType } from '@/lib/graphql/generated/graphql-base.types.ts';
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
import type { TTrackerBind, TTrackRecordBind } from '@/features/tracker/Tracker.types.ts';
import { AvatarSpinner } from '@/base/components/AvatarSpinner.tsx';
@@ -317,6 +317,7 @@ export const TrackerActiveCard = ({
type="ListPreference"
entryValues={tracker.statuses.map((status) => `${status.value}`)}
ListPreferenceCurrentValue={`${trackRecord.status}`}
ListPreferenceDefault={null}
updateValue={(_, status) => updateTrackerBind({ status: Number(status) })}
summary="%s"
/>

View File

@@ -9,9 +9,8 @@
import { TrackerUntrackedCard } from '@/features/tracker/components/cards/TrackerUntrackedCard.tsx';
import { TrackerSearch } from '@/features/tracker/components/TrackerSearch.tsx';
import { TrackerActiveCard } from '@/features/tracker/components/cards/TrackerActiveCard.tsx';
import type { MangaType } from '@/lib/graphql/generated/graphql.ts';
import type { MangaIdInfo } from '@/features/manga/Manga.types.ts';
import type { MangaIdInfo, MangaTitleInfo } from '@/features/manga/Manga.types.ts';
import type { TTrackerBind, TTrackRecordBind } from '@/features/tracker/Tracker.types.ts';
export enum TrackerMode {
@@ -28,7 +27,7 @@ export const TrackerCard = ({
setSearchMode,
}: {
tracker: TTrackerBind;
manga: MangaIdInfo & Pick<MangaType, 'title'>;
manga: MangaIdInfo & MangaTitleInfo;
trackRecord?: TTrackRecordBind;
mode: TrackerMode;
setSearchMode: (id?: number) => void;