Update KOReader Sync settings (#1030)

* feat(settings): refactor and implement KOReader Sync settings page

Refactors the KOReader Sync settings section into its own dedicated page and implements the full connection and configuration flow.

The previous implementation in the main server settings was outdated and incomplete. This change aligns the frontend with the latest backend logic and provides a complete user experience.

Key changes include:
- Separated the UI into two states: a login form for initial connection and a configuration panel for existing connections.
- Implemented `connectKoSyncAccount` and `logoutKoSyncAccount` mutations to handle authentication with the KOReader Sync server.
- Updated the `SERVER_SETTINGS` GraphQL fragment to use the new `koreaderSyncStrategyForward` and `koreaderSyncStrategyBackward` fields, removing the deprecated `koreaderSyncStrategy`.
- Moved all KOReader Sync settings from the generic Server Settings page to a dedicated route at `/settings/koreader-sync`.
- Restructured and improved i18n keys for better clarity and consistency.

Ran `yarn gql:codegen` to regenerate GraphQL types and helpers.

* Extract credentials login into component

* Update to server changes and cleanup

---------

Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>
This commit is contained in:
Zeedif
2025-12-06 12:59:39 -06:00
committed by GitHub
parent 36248e17f0
commit 84cfa6bea5
16 changed files with 829 additions and 284 deletions

View File

@@ -0,0 +1,111 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import Dialog from '@mui/material/Dialog';
import { AwaitableComponent, AwaitableComponentProps } from 'awaitable-component';
import DialogTitle from '@mui/material/DialogTitle';
import { useTranslation } from 'react-i18next';
import DialogContent from '@mui/material/DialogContent';
import TextField from '@mui/material/TextField';
import { useState } from 'react';
import DialogActions from '@mui/material/DialogActions';
import Button from '@mui/material/Button';
import Typography from '@mui/material/Typography';
import { PasswordTextField } from '@/base/components/inputs/PasswordTextField.tsx';
export const LoginDialog = ({
isVisible,
onExitComplete,
onSubmit,
title,
description,
isLoggedIn,
isLoading,
loginLogout,
username: initialUsername = '',
password: initialPassword = '',
serverAddress: initialServerAddress = '',
withServerAddress = false,
}: AwaitableComponentProps<void> & {
title: string;
description?: string;
isLoggedIn: boolean;
isLoading: boolean;
loginLogout: (username: string, password: string, serverAddress?: string) => void;
username?: string;
password?: string;
serverAddress?: string;
withServerAddress?: boolean;
}) => {
const { t } = useTranslation();
const [serverAddress, setServerAddress] = useState(initialServerAddress);
const [username, setUsername] = useState(initialUsername);
const [password, setPassword] = useState(initialPassword);
return (
<Dialog open={isVisible} onTransitionExited={onExitComplete} onClose={() => onSubmit()} disableRestoreFocus>
<DialogTitle>{title}</DialogTitle>
<DialogContent hidden={!description && isLoggedIn}>
{description && <Typography>{description}</Typography>}
{!isLoggedIn && (
<>
{withServerAddress && (
<TextField
margin="dense"
id="serverAddress"
name="serverAddress"
label={t('settings.about.server.label.address')}
type="text"
fullWidth
variant="standard"
value={serverAddress}
onChange={(e) => setServerAddress(e.target.value)}
/>
)}
<TextField
autoFocus
margin="dense"
id="username"
name="username"
label={t('global.label.username')}
type="text"
fullWidth
variant="standard"
onChange={(e) => setUsername(e.target.value)}
/>
<PasswordTextField
margin="dense"
fullWidth
variant="standard"
onChange={(e) => setPassword(e.target.value)}
/>
</>
)}
</DialogContent>
<DialogActions>
<Button onClick={() => onSubmit()}>{t('global.button.cancel')}</Button>
<Button
variant="contained"
disabled={
!isLoggedIn &&
(isLoading ||
!username.length ||
!password.length ||
(withServerAddress && !serverAddress?.length))
}
onClick={() => loginLogout(username, password, serverAddress)}
>
{t(isLoggedIn ? 'global.button.log_out' : 'global.button.log_in')}
</Button>
</DialogActions>
</Dialog>
);
};
export const CredentialsLogin = AwaitableComponent.create(LoginDialog);

View File

@@ -13,7 +13,14 @@ import { GlobalUpdateSkipEntriesSettings, MetadataServerSettings } from '@/featu
import { GridLayout, TranslationKey } from '@/base/Base.types.ts';
import { getDefaultLanguages } from '@/base/utils/Languages.ts';
import { SelectSettingValue, SelectSettingValueDisplayInfo } from '@/base/components/settings/SelectSetting.tsx';
import { AuthMode, WebUiChannel, WebUiFlavor, WebUiInterface } from '@/lib/graphql/generated/graphql.ts';
import {
AuthMode,
KoreaderSyncChecksumMethod,
KoreaderSyncConflictStrategy,
WebUiChannel,
WebUiFlavor,
WebUiInterface,
} from '@/lib/graphql/generated/graphql.ts';
import { ThemeMode } from '@/features/theme/AppTheme.types.ts';
export const MANGA_GRID_WIDTH = {
@@ -207,3 +214,45 @@ export const KOREADER_SYNC_PERCENTAGE_TOLERANCE = {
max: 1,
step: 0.05,
};
export const KOREADER_SYNC_CONFLICT_STRATEGIES = Object.values(KoreaderSyncConflictStrategy);
export const KOREADER_SYNC_CONFLICT_STRATEGY_TO_TRANSLATION_KEYS: Record<
KoreaderSyncConflictStrategy,
SelectSettingValueDisplayInfo
> = {
[KoreaderSyncConflictStrategy.Disabled]: {
text: 'settings.server.koreader.sync.strategy.option.disabled',
},
[KoreaderSyncConflictStrategy.KeepLocal]: {
text: 'settings.server.koreader.sync.strategy.option.keep_local',
},
[KoreaderSyncConflictStrategy.KeepRemote]: {
text: 'settings.server.koreader.sync.strategy.option.keep_remote',
},
[KoreaderSyncConflictStrategy.Prompt]: {
text: 'settings.server.koreader.sync.strategy.option.prompt',
},
};
export const KOREADER_SYNC_CONFLICT_STRATEGY_SELECT_VALUES: SelectSettingValue<KoreaderSyncConflictStrategy>[] =
KOREADER_SYNC_CONFLICT_STRATEGIES.map((strategy) => [
strategy,
KOREADER_SYNC_CONFLICT_STRATEGY_TO_TRANSLATION_KEYS[strategy],
]);
export const KOREADER_SYNC_CHECKSUM_METHODES = Object.values(KoreaderSyncChecksumMethod);
export const KOREADER_SYNC_CHECKSUM_METHOD_TO_TRANSLATION_KEYS: Record<
KoreaderSyncChecksumMethod,
SelectSettingValueDisplayInfo
> = {
[KoreaderSyncChecksumMethod.Binary]: {
text: 'settings.server.koreader.sync.check_sum_method.binary',
},
[KoreaderSyncChecksumMethod.Filename]: {
text: 'settings.server.koreader.sync.check_sum_method.filename',
},
};
export const KOREADER_SYNC_CHECKSUM_METHOD_SELECT_VALUES: SelectSettingValue<KoreaderSyncChecksumMethod>[] =
KOREADER_SYNC_CHECKSUM_METHODES.map((method) => [
method,
KOREADER_SYNC_CHECKSUM_METHOD_TO_TRANSLATION_KEYS[method],
]);

View File

@@ -0,0 +1,203 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { useTranslation } from 'react-i18next';
import List from '@mui/material/List';
import ListSubheader from '@mui/material/ListSubheader';
import ListItemText from '@mui/material/ListItemText';
import ListItemButton from '@mui/material/ListItemButton';
import { requestManager } from '@/lib/requests/RequestManager.ts';
import { SelectSetting } from '@/base/components/settings/SelectSetting.tsx';
import { NumberSetting } from '@/base/components/settings/NumberSetting.tsx';
import { makeToast } from '@/base/utils/Toast.ts';
import { getErrorMessage, noOp } from '@/lib/HelperFunctions.ts';
import {
KoreaderSyncChecksumMethod,
KoreaderSyncConflictStrategy,
KoSyncStatusPayload,
} from '@/lib/graphql/generated/graphql.ts';
import {
KOREADER_SYNC_CHECKSUM_METHOD_SELECT_VALUES,
KOREADER_SYNC_CONFLICT_STRATEGY_SELECT_VALUES,
KOREADER_SYNC_PERCENTAGE_TOLERANCE,
} from '@/features/settings/Settings.constants.ts';
import { CredentialsLogin } from '@/base/components/modals/LoginDialog.tsx';
import { ServerSettings as ServerSettingsType, ServerSettings } from '@/features/settings/Settings.types.ts';
import { assertIsDefined } from '@/base/Asserts.ts';
export const KoreaderSyncSettings = ({
settings: {
koreaderSyncPercentageTolerance,
koreaderSyncStrategyBackward,
koreaderSyncStrategyForward,
koreaderSyncChecksumMethod,
},
serverAddress: currentServerAddress,
username: currentUsername,
isLoggedIn,
updateSetting,
}: {
settings: ServerSettings;
updateSetting: <Setting extends keyof ServerSettingsType>(
setting: Setting,
value: ServerSettingsType[Setting],
onCompletion?: (success: boolean) => void,
) => Promise<void>;
} & Omit<KoSyncStatusPayload, '__typename'>) => {
const { t } = useTranslation();
const handleLogout = async () => {
const { data } = await requestManager.koSyncLogout().response;
if (data?.logoutKoSyncAccount.status.isLoggedIn) {
throw new Error(
t('tracking.action.logout.label.failure', { name: t('settings.server.koreader.sync.title') }),
);
}
};
const handleLogin = async (serverAddress: string, username: string, password: string) => {
const { data } = await requestManager.koSyncLogin(serverAddress, username, password).response;
if (!data?.connectKoSyncAccount.status.isLoggedIn) {
throw new Error(data?.connectKoSyncAccount.message ?? t('global.label.unknown'));
}
};
const handleLoginLogout = async (
initialServerAddress: string = 'https://sync.koreader.rocks/',
initialUsername?: string,
initialPassword?: string,
) => {
const controlled = CredentialsLogin.showControlled(
{
title: t(
isLoggedIn
? 'settings.server.koreader.sync.connection.disconnect'
: 'settings.server.koreader.sync.connection.connect',
{
name: t('settings.server.koreader.sync.title'),
},
),
description: isLoggedIn
? t('settings.server.koreader.sync.connection.connected', {
username: initialUsername,
serverAddress: initialServerAddress,
})
: undefined,
isLoading: false,
isLoggedIn,
withServerAddress: true,
username: initialUsername,
password: initialPassword,
serverAddress: initialServerAddress,
loginLogout: async (username, password, serverAddress) => {
controlled.update({ isLoading: true, loginLogout: noOp });
if (isLoggedIn) {
try {
await handleLogout();
controlled.submit();
} catch (e) {
makeToast(
t('settings.server.koreader.sync.connection.message.disconnect_error'),
'error',
getErrorMessage(e),
);
}
return;
}
try {
assertIsDefined(serverAddress);
await handleLogin(serverAddress, username, password);
controlled.submit();
} catch (e) {
makeToast(
t('settings.server.koreader.sync.connection.message.connect_error'),
'error',
getErrorMessage(e),
);
const RETRY_KEY = '__retry__';
const retry = await Promise.race([controlled.promise, Promise.resolve(RETRY_KEY)]);
if (retry === RETRY_KEY) {
handleLoginLogout(serverAddress, username, password);
}
}
},
},
{ id: 'koreader-sync-login-logout' },
);
};
return (
<List
subheader={
<ListSubheader component="div" id="koreader-sync-settings">
{t('settings.server.koreader.sync.title')}
</ListSubheader>
}
>
<ListItemButton
onClick={() => handleLoginLogout(currentServerAddress ?? undefined, currentUsername ?? undefined)}
>
<ListItemText
primary={t('settings.server.koreader.sync.connection.status')}
secondary={
isLoggedIn
? t('settings.server.koreader.sync.connection.connected', {
username: currentUsername,
serverAddress: currentServerAddress,
})
: t('settings.server.koreader.sync.connection.disconnected')
}
/>
</ListItemButton>
<SelectSetting<KoreaderSyncConflictStrategy>
settingName={t('settings.server.koreader.sync.strategy.forward_title')}
value={koreaderSyncStrategyForward}
values={KOREADER_SYNC_CONFLICT_STRATEGY_SELECT_VALUES}
handleChange={(value) => updateSetting('koreaderSyncStrategyForward', value)}
/>
<SelectSetting<KoreaderSyncConflictStrategy>
settingName={t('settings.server.koreader.sync.strategy.backward_title')}
value={koreaderSyncStrategyBackward}
values={KOREADER_SYNC_CONFLICT_STRATEGY_SELECT_VALUES}
handleChange={(value) => updateSetting('koreaderSyncStrategyBackward', value)}
/>
<SelectSetting<KoreaderSyncChecksumMethod>
settingName={t('settings.server.koreader.sync.check_sum_method.title')}
value={koreaderSyncChecksumMethod}
values={KOREADER_SYNC_CHECKSUM_METHOD_SELECT_VALUES}
handleChange={(value) => updateSetting('koreaderSyncChecksumMethod', value)}
/>
<NumberSetting
settingTitle={t('settings.server.koreader.sync.tolerance.title')}
dialogDescription={t('settings.server.koreader.sync.tolerance.description')}
settingValue={koreaderSyncPercentageTolerance.toString()}
value={koreaderSyncPercentageTolerance}
defaultValue={KOREADER_SYNC_PERCENTAGE_TOLERANCE.default}
minValue={KOREADER_SYNC_PERCENTAGE_TOLERANCE.min}
maxValue={KOREADER_SYNC_PERCENTAGE_TOLERANCE.max}
stepSize={KOREADER_SYNC_PERCENTAGE_TOLERANCE.step}
valueUnit=""
handleUpdate={(value) => updateSetting('koreaderSyncPercentageTolerance', value)}
/>
</List>
);
};

View File

@@ -31,22 +31,16 @@ import { makeToast } from '@/base/utils/Toast.ts';
import { 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,
DatabaseType,
KoreaderSyncChecksumMethod,
KoreaderSyncLegacyStrategy,
SortOrder,
} from '@/lib/graphql/generated/graphql';
import { AuthMode, DatabaseType, SortOrder } from '@/lib/graphql/generated/graphql';
import {
AUTH_MODES_SELECT_VALUES,
JWT_ACCESS_TOKEN_EXPIRY,
JWT_REFRESH_TOKEN_EXPIRY,
KOREADER_SYNC_PERCENTAGE_TOLERANCE,
} from '@/features/settings/Settings.constants.ts';
import { ServerAddressSetting } from '@/features/settings/components/ServerAddressSetting.tsx';
import { AuthManager } from '@/features/authentication/AuthManager.ts';
import { ServerSettings as ServerSettingsType } from '@/features/settings/Settings.types.ts';
import { KoreaderSyncSettings } from '@/features/settings/components/koreaderSync/KoreaderSyncSettings.tsx';
const getLogFilesCleanupDisplayValue = (ttl: number): string => {
if (ttl === 0) {
@@ -80,6 +74,8 @@ export const ServerSettings = () => {
});
const [mutateSettings] = requestManager.useUpdateServerSettings();
const koSyncStatus = requestManager.useKoSyncStatus();
const updateSetting = async <Setting extends keyof ServerSettingsType>(
setting: Setting,
value: ServerSettingsType[Setting],
@@ -120,7 +116,7 @@ export const ServerSettings = () => {
[serverInformAvailableUpdate],
);
const loading = areMetadataServerSettingsLoading || areServerSettingsLoading;
const loading = areMetadataServerSettingsLoading || areServerSettingsLoading || koSyncStatus.loading;
if (loading) {
return (
<>
@@ -130,7 +126,7 @@ export const ServerSettings = () => {
);
}
const error = metadataServerSettingsError ?? serverSettingsError;
const error = metadataServerSettingsError ?? serverSettingsError ?? koSyncStatus.error;
if (error) {
return (
<>
@@ -150,6 +146,12 @@ export const ServerSettings = () => {
defaultPromiseErrorHandler('ServerSettings::refetchServerSettings'),
);
}
if (koSyncStatus.error) {
koSyncStatus
.refetch()
.catch(defaultPromiseErrorHandler('ServerSettings::koSyncStatus.refetch'));
}
}}
/>
</>
@@ -157,6 +159,7 @@ export const ServerSettings = () => {
}
const serverSettings = data!.settings;
const koreaderSyncStatus = koSyncStatus.data!.koSyncStatus;
const authModeDisabled = !serverSettings.authUsername?.trim() || !serverSettings.authPassword?.trim();
const isH2Database = serverSettings.databaseType === DatabaseType.H2;
@@ -467,87 +470,13 @@ export const ServerSettings = () => {
handleChange={(value) => updateSetting('opdsChapterSortOrder', value)}
/>
</List>
<List
subheader={
<ListSubheader component="div" id="server-settings-koreader-sync">
{t('settings.server.koreader.sync.title')}
</ListSubheader>
}
>
<TextSetting
settingName={t('settings.server.koreader.sync.server_address')}
handleChange={(url) => updateSetting('koreaderSyncServerUrl', url)}
value={serverSettings.koreaderSyncServerUrl}
placeholder="http://localhost:17200"
/>
<TextSetting
settingName={t('settings.server.koreader.sync.username')}
value={serverSettings.koreaderSyncUsername}
handleChange={(username) => updateSetting('koreaderSyncUsername', username)}
/>
<TextSetting
settingName={t('settings.server.koreader.sync.user_key')}
value={serverSettings.koreaderSyncUserkey}
handleChange={(userkey) => updateSetting('koreaderSyncUserkey', userkey)}
isPassword
/>
<TextSetting
settingName={t('settings.server.koreader.sync.device_id')}
value={serverSettings.koreaderSyncDeviceId}
handleChange={(deviceId) => updateSetting('koreaderSyncDeviceId', deviceId)}
/>
<SelectSetting<KoreaderSyncChecksumMethod>
settingName={t('settings.server.koreader.sync.check_sum_method.title')}
value={serverSettings.koreaderSyncChecksumMethod}
values={[
[
KoreaderSyncChecksumMethod.Binary,
{ text: t('settings.server.koreader.sync.check_sum_method.binary') },
],
[
KoreaderSyncChecksumMethod.Filename,
{ text: t('settings.server.koreader.sync.check_sum_method.filename') },
],
]}
handleChange={(value) => updateSetting('koreaderSyncChecksumMethod', value)}
/>
<SelectSetting<KoreaderSyncLegacyStrategy>
settingName={t('settings.server.koreader.sync.strategy.title')}
value={serverSettings.koreaderSyncStrategy}
values={[
[
KoreaderSyncLegacyStrategy.Disabled,
{ text: t('settings.server.koreader.sync.strategy.disabled') },
],
[
KoreaderSyncLegacyStrategy.Prompt,
{ text: t('settings.server.koreader.sync.strategy.prompt') },
],
[
KoreaderSyncLegacyStrategy.Silent,
{ text: t('settings.server.koreader.sync.strategy.silent') },
],
[KoreaderSyncLegacyStrategy.Send, { text: t('settings.server.koreader.sync.strategy.send') }],
[
KoreaderSyncLegacyStrategy.Receive,
{ text: t('settings.server.koreader.sync.strategy.receive') },
],
]}
handleChange={(value) => updateSetting('koreaderSyncStrategy', value)}
/>
<NumberSetting
settingTitle={t('settings.server.koreader.sync.tolerance.title')}
dialogDescription={t('settings.server.koreader.sync.tolerance.description')}
settingValue={serverSettings.koreaderSyncPercentageTolerance.toString()}
value={serverSettings.koreaderSyncPercentageTolerance}
defaultValue={KOREADER_SYNC_PERCENTAGE_TOLERANCE.default}
minValue={KOREADER_SYNC_PERCENTAGE_TOLERANCE.min}
maxValue={KOREADER_SYNC_PERCENTAGE_TOLERANCE.max}
stepSize={KOREADER_SYNC_PERCENTAGE_TOLERANCE.step}
valueUnit=""
handleUpdate={(tolerance) => updateSetting('koreaderSyncPercentageTolerance', tolerance)}
/>
</List>
<KoreaderSyncSettings
settings={serverSettings}
serverAddress={koreaderSyncStatus.serverAddress}
username={koreaderSyncStatus.username}
isLoggedIn={koreaderSyncStatus.isLoggedIn}
updateSetting={updateSetting}
/>
<List
subheader={
<ListSubheader component="div" id="server-settings-database">

View File

@@ -7,48 +7,33 @@
*/
import { useTranslation } from 'react-i18next';
import { useState } from 'react';
import PopupState, { bindDialog, bindTrigger } from 'material-ui-popup-state';
import ListItemButton from '@mui/material/ListItemButton';
import Chip from '@mui/material/Chip';
import ListItemAvatar from '@mui/material/ListItemAvatar';
import ListItemSecondaryAction from '@mui/material/ListItemSecondaryAction';
import ListItemText from '@mui/material/ListItemText';
import Dialog from '@mui/material/Dialog';
import DialogTitle from '@mui/material/DialogTitle';
import DialogContent from '@mui/material/DialogContent';
import TextField from '@mui/material/TextField';
import DialogActions from '@mui/material/DialogActions';
import Button from '@mui/material/Button';
import { PasswordTextField } from '@/base/components/inputs/PasswordTextField.tsx';
import { makeToast } from '@/base/utils/Toast.ts';
import { requestManager } from '@/lib/requests/RequestManager.ts';
import { Trackers } from '@/features/tracker/services/Trackers.ts';
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
import { getErrorMessage, noOp } from '@/lib/HelperFunctions.ts';
import { TTrackerSearch } from '@/features/tracker/Tracker.types.ts';
import { AvatarSpinner } from '@/base/components/AvatarSpinner.tsx';
import { CredentialsLogin } from '@/base/components/modals/LoginDialog.tsx';
export const SettingsTrackerCard = ({ tracker }: { tracker: TTrackerSearch }) => {
const { t } = useTranslation();
const [loginTrackerCredentials, { loading: isCredentialLoginInProgress }] =
requestManager.useLoginToTrackerCredentials();
const [logoutFromTracker] = requestManager.useLogoutFromTracker();
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');
const isOAuthLogin = !tracker.isLoggedIn && !!tracker.authUrl;
const handleLogout = async () => {
try {
await logoutFromTracker({ variables: { trackerId: tracker.id } });
await requestManager.logoutFromTracker(tracker.id).response;
} catch (e) {
makeToast(t('tracking.action.logout.label.failure', { name: tracker.name }), 'error', getErrorMessage(e));
}
};
const handleLogin = async () => {
const handleLogin = async (username: string, password: string) => {
if (isOAuthLogin) {
const state = {
redirectUrl: `${window.location.origin}/tracker/login/oauth`,
@@ -62,99 +47,107 @@ export const SettingsTrackerCard = ({ tracker }: { tracker: TTrackerSearch }) =>
}
try {
await loginTrackerCredentials({ variables: { input: { trackerId: tracker.id, username, password } } });
await requestManager.loginTrackerCredentials(tracker.id, username, password).response;
} catch (e) {
makeToast(t('tracking.action.login.label.failure', { name: tracker.name }), 'error', getErrorMessage(e));
}
};
const onClick = (openPopup: () => void) => {
if (!isOAuthLogin) {
openPopup();
const login = async (initialUsername?: string, initialPassword?: string) => {
if (isOAuthLogin) {
const state = {
redirectUrl: `${window.location.origin}/tracker/login/oauth`,
clientName: 'Suwayomi-WebUI',
trackerId: tracker.id,
trackerName: tracker.name,
};
window.open(`${tracker.authUrl}&state=${JSON.stringify(state)}`, '_self');
return;
}
handleLogin();
const controlled = CredentialsLogin.showControlled(
{
title: t(
Trackers.isLoggedIn(tracker)
? 'tracking.settings.dialog.title.log_out'
: 'tracking.settings.dialog.title.log_in',
{ name: tracker.name },
),
isLoading: false,
isLoggedIn: Trackers.isLoggedIn(tracker),
username: initialUsername,
password: initialPassword,
loginLogout: async (username, password) => {
controlled.update({
isLoading: true,
loginLogout: noOp,
});
if (Trackers.isLoggedIn(tracker)) {
try {
await handleLogout();
controlled.submit();
} catch (e) {
makeToast(
t('tracking.action.logout.label.failure', { name: tracker.name }),
'error',
getErrorMessage(e),
);
}
return;
}
try {
await handleLogin(username, password);
controlled.submit();
} catch (e) {
makeToast(
t('tracking.action.login.label.failure', { name: tracker.name }),
'error',
getErrorMessage(e),
);
const RETRY_KEY = '__retry__';
const retry = await Promise.race([controlled.promise, Promise.resolve(RETRY_KEY)]);
if (retry === RETRY_KEY) {
login(username, password);
}
}
},
},
{ id: 'tracker-login-dialog' },
);
await controlled.promise;
};
return (
<PopupState variant="popover" popupId="tracker-dialog">
{(popupState) => (
<>
<ListItemButton {...bindTrigger(popupState)} onClick={() => onClick(popupState.open)}>
<ListItemAvatar sx={{ paddingRight: '20px' }}>
<AvatarSpinner
alt={`${tracker.name}`}
iconUrl={requestManager.getValidImgUrlFor(tracker.icon)}
slots={{
avatarProps: {
variant: 'rounded',
sx: { width: 64, height: 64 },
},
spinnerImageProps: {
ignoreQueue: true,
},
}}
/>
</ListItemAvatar>
<ListItemText primary={tracker.name} />
{Trackers.isLoggedIn(tracker) && (
<ListItemSecondaryAction>
<Chip label={t('global.label.logged_in')} color="success" />
</ListItemSecondaryAction>
)}
</ListItemButton>
<Dialog
{...bindDialog(popupState)}
open={(Trackers.isLoggedIn(tracker) || !tracker.authUrl) && popupState.isOpen}
disableRestoreFocus
>
<DialogTitle>
{t(
Trackers.isLoggedIn(tracker)
? 'tracking.settings.dialog.title.log_out'
: 'tracking.settings.dialog.title.log_in',
{ name: tracker.name },
)}
</DialogTitle>
{!isOAuthLogin && !tracker.isLoggedIn && (
<DialogContent>
<TextField
autoFocus
margin="dense"
id="username"
name="username"
label={t('global.label.username')}
type="text"
fullWidth
variant="standard"
onChange={(e) => setUsername(e.target.value)}
/>
<PasswordTextField
margin="dense"
fullWidth
variant="standard"
onChange={(e) => setPassword(e.target.value)}
/>
</DialogContent>
)}
<DialogActions>
<Button onClick={popupState.close}>{t('global.button.cancel')}</Button>
<Button
variant="contained"
disabled={
!isOAuthLogin &&
!tracker.isLoggedIn &&
(isCredentialLoginInProgress || !username.length || !password.length)
}
onClick={() => (Trackers.isLoggedIn(tracker) ? handleLogout() : handleLogin())}
>
{t(Trackers.isLoggedIn(tracker) ? 'global.button.log_out' : 'global.button.log_in')}
</Button>
</DialogActions>
</Dialog>
</>
<ListItemButton onClick={() => login()}>
<ListItemAvatar sx={{ paddingRight: '20px' }}>
<AvatarSpinner
alt={`${tracker.name}`}
iconUrl={requestManager.getValidImgUrlFor(tracker.icon)}
slots={{
avatarProps: {
variant: 'rounded',
sx: { width: 64, height: 64 },
},
spinnerImageProps: {
ignoreQueue: true,
},
}}
/>
</ListItemAvatar>
<ListItemText primary={tracker.name} />
{Trackers.isLoggedIn(tracker) && (
<ListItemSecondaryAction>
<Chip label={t('global.label.logged_in')} color="success" />
</ListItemSecondaryAction>
)}
</PopupState>
</ListItemButton>
);
};

View File

@@ -23,19 +23,10 @@ export const TrackerOAuthLogin = () => {
url.searchParams.get('state') ?? '{}',
);
const [loginTrackerOAuth, { loading: isLoginInProgress }] = requestManager.useLoginToTrackerOauth();
useEffect(() => {
const login = async () => {
try {
await loginTrackerOAuth({
variables: {
input: {
callbackUrl: window.location.href,
trackerId,
},
},
});
await requestManager.loginToTrackerOauth(trackerId, window.location.href).response;
} catch (e) {
makeToast(t('tracking.action.login.label.failure', { name: trackerName }), 'error', getErrorMessage(e));
}
@@ -46,9 +37,5 @@ export const TrackerOAuthLogin = () => {
login();
}, [trackerId]);
if (isLoginInProgress) {
return t('tracking.action.login.label.progress', { name: trackerName });
}
return null;
return t('tracking.action.login.label.progress', { name: trackerName });
};

View File

@@ -0,0 +1,17 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
export const KO_SYNC_STATUS = gql`
fragment KO_SYNC_STATUS on KoSyncStatusPayload {
isLoggedIn
serverAddress
username
}
`;

View File

@@ -98,12 +98,9 @@ export const SERVER_SETTINGS = gql`
opdsChapterSortOrder
# KOReader sync
koreaderSyncServerUrl
koreaderSyncUsername
koreaderSyncUserkey
koreaderSyncDeviceId
koreaderSyncChecksumMethod
koreaderSyncStrategy
koreaderSyncStrategyBackward
koreaderSyncStrategyForward
koreaderSyncPercentageTolerance
# Database

View File

@@ -356,17 +356,16 @@ export type InstallExternalExtensionPayloadFieldPolicy = {
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
extension?: FieldPolicy<any> | FieldReadFunction<any>
};
export type KoSyncConnectPayloadKeySpecifier = ('clientMutationId' | 'message' | 'settings' | 'success' | 'username' | KoSyncConnectPayloadKeySpecifier)[];
export type KoSyncConnectPayloadKeySpecifier = ('clientMutationId' | 'message' | 'status' | KoSyncConnectPayloadKeySpecifier)[];
export type KoSyncConnectPayloadFieldPolicy = {
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
message?: FieldPolicy<any> | FieldReadFunction<any>,
settings?: FieldPolicy<any> | FieldReadFunction<any>,
success?: FieldPolicy<any> | FieldReadFunction<any>,
username?: FieldPolicy<any> | FieldReadFunction<any>
status?: FieldPolicy<any> | FieldReadFunction<any>
};
export type KoSyncStatusPayloadKeySpecifier = ('isLoggedIn' | 'username' | KoSyncStatusPayloadKeySpecifier)[];
export type KoSyncStatusPayloadKeySpecifier = ('isLoggedIn' | 'serverAddress' | 'username' | KoSyncStatusPayloadKeySpecifier)[];
export type KoSyncStatusPayloadFieldPolicy = {
isLoggedIn?: FieldPolicy<any> | FieldReadFunction<any>,
serverAddress?: FieldPolicy<any> | FieldReadFunction<any>,
username?: FieldPolicy<any> | FieldReadFunction<any>
};
export type LastUpdateTimestampPayloadKeySpecifier = ('timestamp' | LastUpdateTimestampPayloadKeySpecifier)[];
@@ -409,11 +408,10 @@ export type LoginTrackerOAuthPayloadFieldPolicy = {
isLoggedIn?: FieldPolicy<any> | FieldReadFunction<any>,
tracker?: FieldPolicy<any> | FieldReadFunction<any>
};
export type LogoutKoSyncAccountPayloadKeySpecifier = ('clientMutationId' | 'settings' | 'success' | LogoutKoSyncAccountPayloadKeySpecifier)[];
export type LogoutKoSyncAccountPayloadKeySpecifier = ('clientMutationId' | 'status' | LogoutKoSyncAccountPayloadKeySpecifier)[];
export type LogoutKoSyncAccountPayloadFieldPolicy = {
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
settings?: FieldPolicy<any> | FieldReadFunction<any>,
success?: FieldPolicy<any> | FieldReadFunction<any>
status?: FieldPolicy<any> | FieldReadFunction<any>
};
export type LogoutTrackerPayloadKeySpecifier = ('clientMutationId' | 'isLoggedIn' | 'tracker' | LogoutTrackerPayloadKeySpecifier)[];
export type LogoutTrackerPayloadFieldPolicy = {
@@ -589,11 +587,18 @@ export type PageInfoFieldPolicy = {
hasPreviousPage?: FieldPolicy<any> | FieldReadFunction<any>,
startCursor?: FieldPolicy<any> | FieldReadFunction<any>
};
export type PartialSettingsTypeKeySpecifier = ('authMode' | 'authPassword' | 'authUsername' | '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' | 'opdsChapterSortOrder' | 'opdsEnablePageReadProgress' | 'opdsItemsPerPage' | 'opdsMarkAsReadOnDownload' | 'opdsShowOnlyDownloadedChapters' | 'opdsShowOnlyUnreadChapters' | 'opdsUseBinaryFileSizes' | 'port' | 'socksProxyEnabled' | 'socksProxyHost' | 'socksProxyPassword' | 'socksProxyPort' | 'socksProxyUsername' | 'socksProxyVersion' | 'systemTrayEnabled' | 'updateMangas' | 'webUIChannel' | 'webUIFlavor' | 'webUIInterface' | 'webUIUpdateCheckInterval' | PartialSettingsTypeKeySpecifier)[];
export type PartialSettingsTypeKeySpecifier = ('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' | PartialSettingsTypeKeySpecifier)[];
export type PartialSettingsTypeFieldPolicy = {
authMode?: FieldPolicy<any> | FieldReadFunction<any>,
authPassword?: FieldPolicy<any> | FieldReadFunction<any>,
authUsername?: FieldPolicy<any> | FieldReadFunction<any>,
autoBackupIncludeCategories?: FieldPolicy<any> | FieldReadFunction<any>,
autoBackupIncludeChapters?: FieldPolicy<any> | FieldReadFunction<any>,
autoBackupIncludeClientData?: FieldPolicy<any> | FieldReadFunction<any>,
autoBackupIncludeHistory?: FieldPolicy<any> | FieldReadFunction<any>,
autoBackupIncludeManga?: FieldPolicy<any> | FieldReadFunction<any>,
autoBackupIncludeServerSettings?: FieldPolicy<any> | FieldReadFunction<any>,
autoBackupIncludeTracking?: FieldPolicy<any> | FieldReadFunction<any>,
autoDownloadAheadLimit?: FieldPolicy<any> | FieldReadFunction<any>,
autoDownloadIgnoreReUploads?: FieldPolicy<any> | FieldReadFunction<any>,
autoDownloadNewChapters?: FieldPolicy<any> | FieldReadFunction<any>,
@@ -646,6 +651,7 @@ export type PartialSettingsTypeFieldPolicy = {
maxLogFiles?: FieldPolicy<any> | FieldReadFunction<any>,
maxLogFolderSize?: FieldPolicy<any> | FieldReadFunction<any>,
maxSourcesInParallel?: FieldPolicy<any> | FieldReadFunction<any>,
opdsCbzMimetype?: FieldPolicy<any> | FieldReadFunction<any>,
opdsChapterSortOrder?: FieldPolicy<any> | FieldReadFunction<any>,
opdsEnablePageReadProgress?: FieldPolicy<any> | FieldReadFunction<any>,
opdsItemsPerPage?: FieldPolicy<any> | FieldReadFunction<any>,
@@ -654,6 +660,7 @@ export type PartialSettingsTypeFieldPolicy = {
opdsShowOnlyUnreadChapters?: FieldPolicy<any> | FieldReadFunction<any>,
opdsUseBinaryFileSizes?: FieldPolicy<any> | FieldReadFunction<any>,
port?: FieldPolicy<any> | FieldReadFunction<any>,
serveConversions?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyHost?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyPassword?: FieldPolicy<any> | FieldReadFunction<any>,
@@ -662,6 +669,7 @@ export type PartialSettingsTypeFieldPolicy = {
socksProxyVersion?: FieldPolicy<any> | FieldReadFunction<any>,
systemTrayEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
updateMangas?: FieldPolicy<any> | FieldReadFunction<any>,
useHikariConnectionPool?: FieldPolicy<any> | FieldReadFunction<any>,
webUIChannel?: FieldPolicy<any> | FieldReadFunction<any>,
webUIFlavor?: FieldPolicy<any> | FieldReadFunction<any>,
webUIInterface?: FieldPolicy<any> | FieldReadFunction<any>,
@@ -777,11 +785,18 @@ export type SetSourceMetaPayloadFieldPolicy = {
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
meta?: FieldPolicy<any> | FieldReadFunction<any>
};
export type SettingsKeySpecifier = ('authMode' | 'authPassword' | 'authUsername' | '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' | 'opdsChapterSortOrder' | 'opdsEnablePageReadProgress' | 'opdsItemsPerPage' | 'opdsMarkAsReadOnDownload' | 'opdsShowOnlyDownloadedChapters' | 'opdsShowOnlyUnreadChapters' | 'opdsUseBinaryFileSizes' | 'port' | 'socksProxyEnabled' | 'socksProxyHost' | 'socksProxyPassword' | 'socksProxyPort' | 'socksProxyUsername' | 'socksProxyVersion' | 'systemTrayEnabled' | 'updateMangas' | 'webUIChannel' | 'webUIFlavor' | 'webUIInterface' | 'webUIUpdateCheckInterval' | SettingsKeySpecifier)[];
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>,
authPassword?: FieldPolicy<any> | FieldReadFunction<any>,
authUsername?: FieldPolicy<any> | FieldReadFunction<any>,
autoBackupIncludeCategories?: FieldPolicy<any> | FieldReadFunction<any>,
autoBackupIncludeChapters?: FieldPolicy<any> | FieldReadFunction<any>,
autoBackupIncludeClientData?: FieldPolicy<any> | FieldReadFunction<any>,
autoBackupIncludeHistory?: FieldPolicy<any> | FieldReadFunction<any>,
autoBackupIncludeManga?: FieldPolicy<any> | FieldReadFunction<any>,
autoBackupIncludeServerSettings?: FieldPolicy<any> | FieldReadFunction<any>,
autoBackupIncludeTracking?: FieldPolicy<any> | FieldReadFunction<any>,
autoDownloadAheadLimit?: FieldPolicy<any> | FieldReadFunction<any>,
autoDownloadIgnoreReUploads?: FieldPolicy<any> | FieldReadFunction<any>,
autoDownloadNewChapters?: FieldPolicy<any> | FieldReadFunction<any>,
@@ -834,6 +849,7 @@ export type SettingsFieldPolicy = {
maxLogFiles?: FieldPolicy<any> | FieldReadFunction<any>,
maxLogFolderSize?: FieldPolicy<any> | FieldReadFunction<any>,
maxSourcesInParallel?: FieldPolicy<any> | FieldReadFunction<any>,
opdsCbzMimetype?: FieldPolicy<any> | FieldReadFunction<any>,
opdsChapterSortOrder?: FieldPolicy<any> | FieldReadFunction<any>,
opdsEnablePageReadProgress?: FieldPolicy<any> | FieldReadFunction<any>,
opdsItemsPerPage?: FieldPolicy<any> | FieldReadFunction<any>,
@@ -842,6 +858,7 @@ export type SettingsFieldPolicy = {
opdsShowOnlyUnreadChapters?: FieldPolicy<any> | FieldReadFunction<any>,
opdsUseBinaryFileSizes?: FieldPolicy<any> | FieldReadFunction<any>,
port?: FieldPolicy<any> | FieldReadFunction<any>,
serveConversions?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyHost?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyPassword?: FieldPolicy<any> | FieldReadFunction<any>,
@@ -850,28 +867,52 @@ export type SettingsFieldPolicy = {
socksProxyVersion?: FieldPolicy<any> | FieldReadFunction<any>,
systemTrayEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
updateMangas?: FieldPolicy<any> | FieldReadFunction<any>,
useHikariConnectionPool?: FieldPolicy<any> | FieldReadFunction<any>,
webUIChannel?: FieldPolicy<any> | FieldReadFunction<any>,
webUIFlavor?: FieldPolicy<any> | FieldReadFunction<any>,
webUIInterface?: FieldPolicy<any> | FieldReadFunction<any>,
webUIUpdateCheckInterval?: FieldPolicy<any> | FieldReadFunction<any>
};
export type SettingsDownloadConversionKeySpecifier = ('compressionLevel' | 'mimeType' | 'target' | SettingsDownloadConversionKeySpecifier)[];
export type SettingsDownloadConversionKeySpecifier = ('callTimeout' | 'compressionLevel' | 'connectTimeout' | 'headers' | 'mimeType' | 'target' | SettingsDownloadConversionKeySpecifier)[];
export type SettingsDownloadConversionFieldPolicy = {
callTimeout?: FieldPolicy<any> | FieldReadFunction<any>,
compressionLevel?: FieldPolicy<any> | FieldReadFunction<any>,
connectTimeout?: FieldPolicy<any> | FieldReadFunction<any>,
headers?: FieldPolicy<any> | FieldReadFunction<any>,
mimeType?: FieldPolicy<any> | FieldReadFunction<any>,
target?: FieldPolicy<any> | FieldReadFunction<any>
};
export type SettingsDownloadConversionTypeKeySpecifier = ('compressionLevel' | 'mimeType' | 'target' | SettingsDownloadConversionTypeKeySpecifier)[];
export type SettingsDownloadConversionHeaderKeySpecifier = ('name' | 'value' | SettingsDownloadConversionHeaderKeySpecifier)[];
export type SettingsDownloadConversionHeaderFieldPolicy = {
name?: FieldPolicy<any> | FieldReadFunction<any>,
value?: FieldPolicy<any> | FieldReadFunction<any>
};
export type SettingsDownloadConversionHeaderTypeKeySpecifier = ('name' | 'value' | SettingsDownloadConversionHeaderTypeKeySpecifier)[];
export type SettingsDownloadConversionHeaderTypeFieldPolicy = {
name?: FieldPolicy<any> | FieldReadFunction<any>,
value?: FieldPolicy<any> | FieldReadFunction<any>
};
export type SettingsDownloadConversionTypeKeySpecifier = ('callTimeout' | 'compressionLevel' | 'connectTimeout' | 'headers' | 'mimeType' | 'target' | SettingsDownloadConversionTypeKeySpecifier)[];
export type SettingsDownloadConversionTypeFieldPolicy = {
callTimeout?: FieldPolicy<any> | FieldReadFunction<any>,
compressionLevel?: FieldPolicy<any> | FieldReadFunction<any>,
connectTimeout?: FieldPolicy<any> | FieldReadFunction<any>,
headers?: FieldPolicy<any> | FieldReadFunction<any>,
mimeType?: FieldPolicy<any> | FieldReadFunction<any>,
target?: FieldPolicy<any> | FieldReadFunction<any>
};
export type SettingsTypeKeySpecifier = ('authMode' | 'authPassword' | 'authUsername' | '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' | 'opdsChapterSortOrder' | 'opdsEnablePageReadProgress' | 'opdsItemsPerPage' | 'opdsMarkAsReadOnDownload' | 'opdsShowOnlyDownloadedChapters' | 'opdsShowOnlyUnreadChapters' | 'opdsUseBinaryFileSizes' | 'port' | 'socksProxyEnabled' | 'socksProxyHost' | 'socksProxyPassword' | 'socksProxyPort' | 'socksProxyUsername' | 'socksProxyVersion' | 'systemTrayEnabled' | 'updateMangas' | 'webUIChannel' | 'webUIFlavor' | 'webUIInterface' | 'webUIUpdateCheckInterval' | SettingsTypeKeySpecifier)[];
export type SettingsTypeKeySpecifier = ('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' | SettingsTypeKeySpecifier)[];
export type SettingsTypeFieldPolicy = {
authMode?: FieldPolicy<any> | FieldReadFunction<any>,
authPassword?: FieldPolicy<any> | FieldReadFunction<any>,
authUsername?: FieldPolicy<any> | FieldReadFunction<any>,
autoBackupIncludeCategories?: FieldPolicy<any> | FieldReadFunction<any>,
autoBackupIncludeChapters?: FieldPolicy<any> | FieldReadFunction<any>,
autoBackupIncludeClientData?: FieldPolicy<any> | FieldReadFunction<any>,
autoBackupIncludeHistory?: FieldPolicy<any> | FieldReadFunction<any>,
autoBackupIncludeManga?: FieldPolicy<any> | FieldReadFunction<any>,
autoBackupIncludeServerSettings?: FieldPolicy<any> | FieldReadFunction<any>,
autoBackupIncludeTracking?: FieldPolicy<any> | FieldReadFunction<any>,
autoDownloadAheadLimit?: FieldPolicy<any> | FieldReadFunction<any>,
autoDownloadIgnoreReUploads?: FieldPolicy<any> | FieldReadFunction<any>,
autoDownloadNewChapters?: FieldPolicy<any> | FieldReadFunction<any>,
@@ -924,6 +965,7 @@ export type SettingsTypeFieldPolicy = {
maxLogFiles?: FieldPolicy<any> | FieldReadFunction<any>,
maxLogFolderSize?: FieldPolicy<any> | FieldReadFunction<any>,
maxSourcesInParallel?: FieldPolicy<any> | FieldReadFunction<any>,
opdsCbzMimetype?: FieldPolicy<any> | FieldReadFunction<any>,
opdsChapterSortOrder?: FieldPolicy<any> | FieldReadFunction<any>,
opdsEnablePageReadProgress?: FieldPolicy<any> | FieldReadFunction<any>,
opdsItemsPerPage?: FieldPolicy<any> | FieldReadFunction<any>,
@@ -932,6 +974,7 @@ export type SettingsTypeFieldPolicy = {
opdsShowOnlyUnreadChapters?: FieldPolicy<any> | FieldReadFunction<any>,
opdsUseBinaryFileSizes?: FieldPolicy<any> | FieldReadFunction<any>,
port?: FieldPolicy<any> | FieldReadFunction<any>,
serveConversions?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyHost?: FieldPolicy<any> | FieldReadFunction<any>,
socksProxyPassword?: FieldPolicy<any> | FieldReadFunction<any>,
@@ -940,6 +983,7 @@ export type SettingsTypeFieldPolicy = {
socksProxyVersion?: FieldPolicy<any> | FieldReadFunction<any>,
systemTrayEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
updateMangas?: FieldPolicy<any> | FieldReadFunction<any>,
useHikariConnectionPool?: FieldPolicy<any> | FieldReadFunction<any>,
webUIChannel?: FieldPolicy<any> | FieldReadFunction<any>,
webUIFlavor?: FieldPolicy<any> | FieldReadFunction<any>,
webUIInterface?: FieldPolicy<any> | FieldReadFunction<any>,
@@ -1665,6 +1709,14 @@ export type StrictTypedTypePolicies = {
keyFields?: false | SettingsDownloadConversionKeySpecifier | (() => undefined | SettingsDownloadConversionKeySpecifier),
fields?: SettingsDownloadConversionFieldPolicy,
},
SettingsDownloadConversionHeader?: Omit<TypePolicy, "fields" | "keyFields"> & {
keyFields?: false | SettingsDownloadConversionHeaderKeySpecifier | (() => undefined | SettingsDownloadConversionHeaderKeySpecifier),
fields?: SettingsDownloadConversionHeaderFieldPolicy,
},
SettingsDownloadConversionHeaderType?: Omit<TypePolicy, "fields" | "keyFields"> & {
keyFields?: false | SettingsDownloadConversionHeaderTypeKeySpecifier | (() => undefined | SettingsDownloadConversionHeaderTypeKeySpecifier),
fields?: SettingsDownloadConversionHeaderTypeFieldPolicy,
},
SettingsDownloadConversionType?: Omit<TypePolicy, "fields" | "keyFields"> & {
keyFields?: false | SettingsDownloadConversionTypeKeySpecifier | (() => undefined | SettingsDownloadConversionTypeKeySpecifier),
fields?: SettingsDownloadConversionTypeFieldPolicy,

View File

@@ -172,6 +172,12 @@ export type CategoryUpdateType = {
status: CategoryJobStatus;
};
export enum CbzMediaType {
Compatible = 'COMPATIBLE',
Legacy = 'LEGACY',
Modern = 'MODERN'
}
export type ChapterConditionInput = {
chapterNumber?: InputMaybe<Scalars['Float']['input']>;
fetchedAt?: InputMaybe<Scalars['LongString']['input']>;
@@ -199,7 +205,7 @@ export type ChapterEdge = Edge & {
export type ChapterFilterInput = {
and?: InputMaybe<Array<ChapterFilterInput>>;
chapterNumber?: InputMaybe<FloatFilterInput>;
chapterNumber?: InputMaybe<DoubleFilterInput>;
fetchedAt?: InputMaybe<LongFilterInput>;
id?: InputMaybe<IntFilterInput>;
inLibrary?: InputMaybe<BooleanFilterInput>;
@@ -331,6 +337,7 @@ export type ClearDownloaderPayload = {
export type ConnectKoSyncAccountInput = {
clientMutationId?: InputMaybe<Scalars['String']['input']>;
password: Scalars['String']['input'];
serverAddress: Scalars['String']['input'];
username: Scalars['String']['input'];
};
@@ -785,24 +792,6 @@ export type FilterChangeInput = {
triState?: InputMaybe<TriState>;
};
export type FloatFilterInput = {
distinctFrom?: InputMaybe<Scalars['Float']['input']>;
distinctFromAll?: InputMaybe<Array<Scalars['Float']['input']>>;
distinctFromAny?: InputMaybe<Array<Scalars['Float']['input']>>;
equalTo?: InputMaybe<Scalars['Float']['input']>;
greaterThan?: InputMaybe<Scalars['Float']['input']>;
greaterThanOrEqualTo?: InputMaybe<Scalars['Float']['input']>;
in?: InputMaybe<Array<Scalars['Float']['input']>>;
isNull?: InputMaybe<Scalars['Boolean']['input']>;
lessThan?: InputMaybe<Scalars['Float']['input']>;
lessThanOrEqualTo?: InputMaybe<Scalars['Float']['input']>;
notDistinctFrom?: InputMaybe<Scalars['Float']['input']>;
notEqualTo?: InputMaybe<Scalars['Float']['input']>;
notEqualToAll?: InputMaybe<Array<Scalars['Float']['input']>>;
notEqualToAny?: InputMaybe<Array<Scalars['Float']['input']>>;
notIn?: InputMaybe<Array<Scalars['Float']['input']>>;
};
export type GlobalMetaNodeList = NodeList & {
__typename?: 'GlobalMetaNodeList';
edges: Array<MetaEdge>;
@@ -872,14 +861,13 @@ export type KoSyncConnectPayload = {
__typename?: 'KoSyncConnectPayload';
clientMutationId?: Maybe<Scalars['String']['output']>;
message?: Maybe<Scalars['String']['output']>;
settings: SettingsType;
success: Scalars['Boolean']['output'];
username?: Maybe<Scalars['String']['output']>;
status: KoSyncStatusPayload;
};
export type KoSyncStatusPayload = {
__typename?: 'KoSyncStatusPayload';
isLoggedIn: Scalars['Boolean']['output'];
serverAddress?: Maybe<Scalars['String']['output']>;
username?: Maybe<Scalars['String']['output']>;
};
@@ -980,8 +968,7 @@ export type LogoutKoSyncAccountInput = {
export type LogoutKoSyncAccountPayload = {
__typename?: 'LogoutKoSyncAccountPayload';
clientMutationId?: Maybe<Scalars['String']['output']>;
settings: SettingsType;
success: Scalars['Boolean']['output'];
status: KoSyncStatusPayload;
};
export type LogoutTrackerInput = {
@@ -1656,6 +1643,13 @@ export type PartialSettingsType = Settings & {
authMode?: Maybe<AuthMode>;
authPassword?: Maybe<Scalars['String']['output']>;
authUsername?: Maybe<Scalars['String']['output']>;
autoBackupIncludeCategories?: Maybe<Scalars['Boolean']['output']>;
autoBackupIncludeChapters?: Maybe<Scalars['Boolean']['output']>;
autoBackupIncludeClientData?: Maybe<Scalars['Boolean']['output']>;
autoBackupIncludeHistory?: Maybe<Scalars['Boolean']['output']>;
autoBackupIncludeManga?: Maybe<Scalars['Boolean']['output']>;
autoBackupIncludeServerSettings?: Maybe<Scalars['Boolean']['output']>;
autoBackupIncludeTracking?: Maybe<Scalars['Boolean']['output']>;
/** @deprecated Replaced with autoDownloadNewChaptersLimit, replace with autoDownloadNewChaptersLimit */
autoDownloadAheadLimit?: Maybe<Scalars['Int']['output']>;
autoDownloadIgnoreReUploads?: Maybe<Scalars['Boolean']['output']>;
@@ -1700,20 +1694,25 @@ export type PartialSettingsType = Settings & {
jwtRefreshExpiry?: Maybe<Scalars['Duration']['output']>;
jwtTokenExpiry?: Maybe<Scalars['Duration']['output']>;
koreaderSyncChecksumMethod?: Maybe<KoreaderSyncChecksumMethod>;
/** @deprecated Moved to preference store. Is supposed to be random and gets auto generated, replace with MOVE TO PREFERENCES */
koreaderSyncDeviceId?: Maybe<Scalars['String']['output']>;
koreaderSyncPercentageTolerance?: Maybe<Scalars['Float']['output']>;
/** @deprecated Moved to preference store. User is supposed to use a login/logout mutation, replace with MOVE TO PREFERENCES */
koreaderSyncServerUrl?: Maybe<Scalars['String']['output']>;
/** @deprecated Replaced with koreaderSyncStrategyForward and koreaderSyncStrategyBackward, replace with koreaderSyncStrategyForward, koreaderSyncStrategyBackward */
koreaderSyncStrategy?: Maybe<KoreaderSyncLegacyStrategy>;
koreaderSyncStrategyBackward?: Maybe<KoreaderSyncConflictStrategy>;
koreaderSyncStrategyForward?: Maybe<KoreaderSyncConflictStrategy>;
/** @deprecated Moved to preference store. User is supposed to use a login/logout mutation, replace with MOVE TO PREFERENCES */
koreaderSyncUserkey?: Maybe<Scalars['String']['output']>;
/** @deprecated Moved to preference store. User is supposed to use a login/logout mutation, replace with MOVE TO PREFERENCES */
koreaderSyncUsername?: Maybe<Scalars['String']['output']>;
localSourcePath?: Maybe<Scalars['String']['output']>;
maxLogFileSize?: Maybe<Scalars['String']['output']>;
maxLogFiles?: Maybe<Scalars['Int']['output']>;
maxLogFolderSize?: Maybe<Scalars['String']['output']>;
maxSourcesInParallel?: Maybe<Scalars['Int']['output']>;
opdsCbzMimetype?: Maybe<CbzMediaType>;
opdsChapterSortOrder?: Maybe<SortOrder>;
opdsEnablePageReadProgress?: Maybe<Scalars['Boolean']['output']>;
opdsItemsPerPage?: Maybe<Scalars['Int']['output']>;
@@ -1722,6 +1721,7 @@ export type PartialSettingsType = Settings & {
opdsShowOnlyUnreadChapters?: Maybe<Scalars['Boolean']['output']>;
opdsUseBinaryFileSizes?: Maybe<Scalars['Boolean']['output']>;
port?: Maybe<Scalars['Int']['output']>;
serveConversions?: Maybe<Array<SettingsDownloadConversionType>>;
socksProxyEnabled?: Maybe<Scalars['Boolean']['output']>;
socksProxyHost?: Maybe<Scalars['String']['output']>;
socksProxyPassword?: Maybe<Scalars['String']['output']>;
@@ -1730,6 +1730,7 @@ export type PartialSettingsType = Settings & {
socksProxyVersion?: Maybe<Scalars['Int']['output']>;
systemTrayEnabled?: Maybe<Scalars['Boolean']['output']>;
updateMangas?: Maybe<Scalars['Boolean']['output']>;
useHikariConnectionPool?: Maybe<Scalars['Boolean']['output']>;
webUIChannel?: Maybe<WebUiChannel>;
webUIFlavor?: Maybe<WebUiFlavor>;
webUIInterface?: Maybe<WebUiInterface>;
@@ -1740,6 +1741,13 @@ export type PartialSettingsTypeInput = {
authMode?: InputMaybe<AuthMode>;
authPassword?: InputMaybe<Scalars['String']['input']>;
authUsername?: InputMaybe<Scalars['String']['input']>;
autoBackupIncludeCategories?: InputMaybe<Scalars['Boolean']['input']>;
autoBackupIncludeChapters?: InputMaybe<Scalars['Boolean']['input']>;
autoBackupIncludeClientData?: InputMaybe<Scalars['Boolean']['input']>;
autoBackupIncludeHistory?: InputMaybe<Scalars['Boolean']['input']>;
autoBackupIncludeManga?: InputMaybe<Scalars['Boolean']['input']>;
autoBackupIncludeServerSettings?: InputMaybe<Scalars['Boolean']['input']>;
autoBackupIncludeTracking?: InputMaybe<Scalars['Boolean']['input']>;
autoDownloadIgnoreReUploads?: InputMaybe<Scalars['Boolean']['input']>;
autoDownloadNewChapters?: InputMaybe<Scalars['Boolean']['input']>;
autoDownloadNewChaptersLimit?: InputMaybe<Scalars['Int']['input']>;
@@ -1774,18 +1782,15 @@ export type PartialSettingsTypeInput = {
jwtRefreshExpiry?: InputMaybe<Scalars['Duration']['input']>;
jwtTokenExpiry?: InputMaybe<Scalars['Duration']['input']>;
koreaderSyncChecksumMethod?: InputMaybe<KoreaderSyncChecksumMethod>;
koreaderSyncDeviceId?: InputMaybe<Scalars['String']['input']>;
koreaderSyncPercentageTolerance?: InputMaybe<Scalars['Float']['input']>;
koreaderSyncServerUrl?: InputMaybe<Scalars['String']['input']>;
koreaderSyncStrategyBackward?: InputMaybe<KoreaderSyncConflictStrategy>;
koreaderSyncStrategyForward?: InputMaybe<KoreaderSyncConflictStrategy>;
koreaderSyncUserkey?: InputMaybe<Scalars['String']['input']>;
koreaderSyncUsername?: InputMaybe<Scalars['String']['input']>;
localSourcePath?: InputMaybe<Scalars['String']['input']>;
maxLogFileSize?: InputMaybe<Scalars['String']['input']>;
maxLogFiles?: InputMaybe<Scalars['Int']['input']>;
maxLogFolderSize?: InputMaybe<Scalars['String']['input']>;
maxSourcesInParallel?: InputMaybe<Scalars['Int']['input']>;
opdsCbzMimetype?: InputMaybe<CbzMediaType>;
opdsChapterSortOrder?: InputMaybe<SortOrder>;
opdsEnablePageReadProgress?: InputMaybe<Scalars['Boolean']['input']>;
opdsItemsPerPage?: InputMaybe<Scalars['Int']['input']>;
@@ -1794,6 +1799,7 @@ export type PartialSettingsTypeInput = {
opdsShowOnlyUnreadChapters?: InputMaybe<Scalars['Boolean']['input']>;
opdsUseBinaryFileSizes?: InputMaybe<Scalars['Boolean']['input']>;
port?: InputMaybe<Scalars['Int']['input']>;
serveConversions?: InputMaybe<Array<SettingsDownloadConversionTypeInput>>;
socksProxyEnabled?: InputMaybe<Scalars['Boolean']['input']>;
socksProxyHost?: InputMaybe<Scalars['String']['input']>;
socksProxyPassword?: InputMaybe<Scalars['String']['input']>;
@@ -1802,6 +1808,7 @@ export type PartialSettingsTypeInput = {
socksProxyVersion?: InputMaybe<Scalars['Int']['input']>;
systemTrayEnabled?: InputMaybe<Scalars['Boolean']['input']>;
updateMangas?: InputMaybe<Scalars['Boolean']['input']>;
useHikariConnectionPool?: InputMaybe<Scalars['Boolean']['input']>;
webUIChannel?: InputMaybe<WebUiChannel>;
webUIFlavor?: InputMaybe<WebUiFlavor>;
webUIInterface?: InputMaybe<WebUiInterface>;
@@ -2173,6 +2180,13 @@ export type Settings = {
authMode?: Maybe<AuthMode>;
authPassword?: Maybe<Scalars['String']['output']>;
authUsername?: Maybe<Scalars['String']['output']>;
autoBackupIncludeCategories?: Maybe<Scalars['Boolean']['output']>;
autoBackupIncludeChapters?: Maybe<Scalars['Boolean']['output']>;
autoBackupIncludeClientData?: Maybe<Scalars['Boolean']['output']>;
autoBackupIncludeHistory?: Maybe<Scalars['Boolean']['output']>;
autoBackupIncludeManga?: Maybe<Scalars['Boolean']['output']>;
autoBackupIncludeServerSettings?: Maybe<Scalars['Boolean']['output']>;
autoBackupIncludeTracking?: Maybe<Scalars['Boolean']['output']>;
/** @deprecated Replaced with autoDownloadNewChaptersLimit, replace with autoDownloadNewChaptersLimit */
autoDownloadAheadLimit?: Maybe<Scalars['Int']['output']>;
autoDownloadIgnoreReUploads?: Maybe<Scalars['Boolean']['output']>;
@@ -2217,20 +2231,25 @@ export type Settings = {
jwtRefreshExpiry?: Maybe<Scalars['Duration']['output']>;
jwtTokenExpiry?: Maybe<Scalars['Duration']['output']>;
koreaderSyncChecksumMethod?: Maybe<KoreaderSyncChecksumMethod>;
/** @deprecated Moved to preference store. Is supposed to be random and gets auto generated, replace with MOVE TO PREFERENCES */
koreaderSyncDeviceId?: Maybe<Scalars['String']['output']>;
koreaderSyncPercentageTolerance?: Maybe<Scalars['Float']['output']>;
/** @deprecated Moved to preference store. User is supposed to use a login/logout mutation, replace with MOVE TO PREFERENCES */
koreaderSyncServerUrl?: Maybe<Scalars['String']['output']>;
/** @deprecated Replaced with koreaderSyncStrategyForward and koreaderSyncStrategyBackward, replace with koreaderSyncStrategyForward, koreaderSyncStrategyBackward */
koreaderSyncStrategy?: Maybe<KoreaderSyncLegacyStrategy>;
koreaderSyncStrategyBackward?: Maybe<KoreaderSyncConflictStrategy>;
koreaderSyncStrategyForward?: Maybe<KoreaderSyncConflictStrategy>;
/** @deprecated Moved to preference store. User is supposed to use a login/logout mutation, replace with MOVE TO PREFERENCES */
koreaderSyncUserkey?: Maybe<Scalars['String']['output']>;
/** @deprecated Moved to preference store. User is supposed to use a login/logout mutation, replace with MOVE TO PREFERENCES */
koreaderSyncUsername?: Maybe<Scalars['String']['output']>;
localSourcePath?: Maybe<Scalars['String']['output']>;
maxLogFileSize?: Maybe<Scalars['String']['output']>;
maxLogFiles?: Maybe<Scalars['Int']['output']>;
maxLogFolderSize?: Maybe<Scalars['String']['output']>;
maxSourcesInParallel?: Maybe<Scalars['Int']['output']>;
opdsCbzMimetype?: Maybe<CbzMediaType>;
opdsChapterSortOrder?: Maybe<SortOrder>;
opdsEnablePageReadProgress?: Maybe<Scalars['Boolean']['output']>;
opdsItemsPerPage?: Maybe<Scalars['Int']['output']>;
@@ -2239,6 +2258,7 @@ export type Settings = {
opdsShowOnlyUnreadChapters?: Maybe<Scalars['Boolean']['output']>;
opdsUseBinaryFileSizes?: Maybe<Scalars['Boolean']['output']>;
port?: Maybe<Scalars['Int']['output']>;
serveConversions?: Maybe<Array<SettingsDownloadConversion>>;
socksProxyEnabled?: Maybe<Scalars['Boolean']['output']>;
socksProxyHost?: Maybe<Scalars['String']['output']>;
socksProxyPassword?: Maybe<Scalars['String']['output']>;
@@ -2247,6 +2267,7 @@ export type Settings = {
socksProxyVersion?: Maybe<Scalars['Int']['output']>;
systemTrayEnabled?: Maybe<Scalars['Boolean']['output']>;
updateMangas?: Maybe<Scalars['Boolean']['output']>;
useHikariConnectionPool?: Maybe<Scalars['Boolean']['output']>;
webUIChannel?: Maybe<WebUiChannel>;
webUIFlavor?: Maybe<WebUiFlavor>;
webUIInterface?: Maybe<WebUiInterface>;
@@ -2254,20 +2275,45 @@ export type Settings = {
};
export type SettingsDownloadConversion = {
callTimeout?: Maybe<Scalars['Duration']['output']>;
compressionLevel?: Maybe<Scalars['Float']['output']>;
connectTimeout?: Maybe<Scalars['Duration']['output']>;
headers?: Maybe<Array<SettingsDownloadConversionHeader>>;
mimeType: Scalars['String']['output'];
target: Scalars['String']['output'];
};
export type SettingsDownloadConversionHeader = {
name: Scalars['String']['output'];
value: Scalars['String']['output'];
};
export type SettingsDownloadConversionHeaderType = SettingsDownloadConversionHeader & {
__typename?: 'SettingsDownloadConversionHeaderType';
name: Scalars['String']['output'];
value: Scalars['String']['output'];
};
export type SettingsDownloadConversionHeaderTypeInput = {
name: Scalars['String']['input'];
value: Scalars['String']['input'];
};
export type SettingsDownloadConversionType = SettingsDownloadConversion & {
__typename?: 'SettingsDownloadConversionType';
callTimeout?: Maybe<Scalars['Duration']['output']>;
compressionLevel?: Maybe<Scalars['Float']['output']>;
connectTimeout?: Maybe<Scalars['Duration']['output']>;
headers?: Maybe<Array<SettingsDownloadConversionHeaderType>>;
mimeType: Scalars['String']['output'];
target: Scalars['String']['output'];
};
export type SettingsDownloadConversionTypeInput = {
callTimeout?: InputMaybe<Scalars['Duration']['input']>;
compressionLevel?: InputMaybe<Scalars['Float']['input']>;
connectTimeout?: InputMaybe<Scalars['Duration']['input']>;
headers?: InputMaybe<Array<SettingsDownloadConversionHeaderTypeInput>>;
mimeType: Scalars['String']['input'];
target: Scalars['String']['input'];
};
@@ -2277,6 +2323,13 @@ export type SettingsType = Settings & {
authMode: AuthMode;
authPassword: Scalars['String']['output'];
authUsername: Scalars['String']['output'];
autoBackupIncludeCategories: Scalars['Boolean']['output'];
autoBackupIncludeChapters: Scalars['Boolean']['output'];
autoBackupIncludeClientData: Scalars['Boolean']['output'];
autoBackupIncludeHistory: Scalars['Boolean']['output'];
autoBackupIncludeManga: Scalars['Boolean']['output'];
autoBackupIncludeServerSettings: Scalars['Boolean']['output'];
autoBackupIncludeTracking: Scalars['Boolean']['output'];
/** @deprecated Replaced with autoDownloadNewChaptersLimit, replace with autoDownloadNewChaptersLimit */
autoDownloadAheadLimit: Scalars['Int']['output'];
autoDownloadIgnoreReUploads: Scalars['Boolean']['output'];
@@ -2321,20 +2374,25 @@ export type SettingsType = Settings & {
jwtRefreshExpiry: Scalars['Duration']['output'];
jwtTokenExpiry: Scalars['Duration']['output'];
koreaderSyncChecksumMethod: KoreaderSyncChecksumMethod;
/** @deprecated Moved to preference store. Is supposed to be random and gets auto generated, replace with MOVE TO PREFERENCES */
koreaderSyncDeviceId: Scalars['String']['output'];
koreaderSyncPercentageTolerance: Scalars['Float']['output'];
/** @deprecated Moved to preference store. User is supposed to use a login/logout mutation, replace with MOVE TO PREFERENCES */
koreaderSyncServerUrl: Scalars['String']['output'];
/** @deprecated Replaced with koreaderSyncStrategyForward and koreaderSyncStrategyBackward, replace with koreaderSyncStrategyForward, koreaderSyncStrategyBackward */
koreaderSyncStrategy: KoreaderSyncLegacyStrategy;
koreaderSyncStrategyBackward: KoreaderSyncConflictStrategy;
koreaderSyncStrategyForward: KoreaderSyncConflictStrategy;
/** @deprecated Moved to preference store. User is supposed to use a login/logout mutation, replace with MOVE TO PREFERENCES */
koreaderSyncUserkey: Scalars['String']['output'];
/** @deprecated Moved to preference store. User is supposed to use a login/logout mutation, replace with MOVE TO PREFERENCES */
koreaderSyncUsername: Scalars['String']['output'];
localSourcePath: Scalars['String']['output'];
maxLogFileSize: Scalars['String']['output'];
maxLogFiles: Scalars['Int']['output'];
maxLogFolderSize: Scalars['String']['output'];
maxSourcesInParallel: Scalars['Int']['output'];
opdsCbzMimetype: CbzMediaType;
opdsChapterSortOrder: SortOrder;
opdsEnablePageReadProgress: Scalars['Boolean']['output'];
opdsItemsPerPage: Scalars['Int']['output'];
@@ -2343,6 +2401,7 @@ export type SettingsType = Settings & {
opdsShowOnlyUnreadChapters: Scalars['Boolean']['output'];
opdsUseBinaryFileSizes: Scalars['Boolean']['output'];
port: Scalars['Int']['output'];
serveConversions: Array<SettingsDownloadConversionType>;
socksProxyEnabled: Scalars['Boolean']['output'];
socksProxyHost: Scalars['String']['output'];
socksProxyPassword: Scalars['String']['output'];
@@ -2351,6 +2410,7 @@ export type SettingsType = Settings & {
socksProxyVersion: Scalars['Int']['output'];
systemTrayEnabled: Scalars['Boolean']['output'];
updateMangas: Scalars['Boolean']['output'];
useHikariConnectionPool: Scalars['Boolean']['output'];
webUIChannel: WebUiChannel;
webUIFlavor: WebUiFlavor;
webUIInterface: WebUiInterface;
@@ -3211,6 +3271,8 @@ export type WebuiUpdateInfoFragment = { __typename?: 'WebUIUpdateInfo', channel:
export type WebuiUpdateStatusFragment = { __typename?: 'WebUIUpdateStatus', progress: number, state: UpdateState, info: { __typename?: 'WebUIUpdateInfo', channel: WebUiChannel, tag: string } };
export type KoSyncStatusFragment = { __typename?: 'KoSyncStatusPayload', isLoggedIn: boolean, serverAddress?: string | null, username?: string | null };
export type MangaMetaFieldsFragment = { __typename?: 'MangaMetaType', mangaId: number, key: string, value: string };
export type MangaBaseFieldsFragment = { __typename?: 'MangaType', id: number, title: string, thumbnailUrl?: string | null, thumbnailUrlLastFetched?: string | null, inLibrary: boolean, initialized: boolean, sourceId: string };
@@ -3227,7 +3289,7 @@ 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 ServerSettingsFragment = { __typename?: 'SettingsType', ip: string, port: number, socksProxyEnabled: boolean, socksProxyVersion: number, socksProxyHost: string, socksProxyPort: string, socksProxyUsername: string, socksProxyPassword: string, webUIFlavor: WebUiFlavor, initialOpenInBrowserEnabled: boolean, webUIInterface: WebUiInterface, electronPath: string, webUIChannel: WebUiChannel, webUIUpdateCheckInterval: number, downloadAsCbz: boolean, downloadsPath: string, autoDownloadNewChapters: boolean, excludeEntryWithUnreadChapters: boolean, autoDownloadNewChaptersLimit: number, autoDownloadIgnoreReUploads: boolean, extensionRepos: Array<string>, maxSourcesInParallel: number, excludeUnreadChapters: boolean, excludeNotStarted: boolean, excludeCompleted: boolean, globalUpdateInterval: number, updateMangas: boolean, authMode: AuthMode, authPassword: string, authUsername: string, jwtAudience: string, jwtTokenExpiry: string, jwtRefreshExpiry: string, debugLogsEnabled: boolean, systemTrayEnabled: boolean, maxLogFileSize: string, maxLogFiles: number, maxLogFolderSize: string, backupPath: string, backupTime: string, backupInterval: number, backupTTL: number, localSourcePath: string, flareSolverrEnabled: boolean, flareSolverrUrl: string, flareSolverrTimeout: number, flareSolverrSessionName: string, flareSolverrSessionTtl: number, flareSolverrAsResponseFallback: boolean, opdsUseBinaryFileSizes: boolean, opdsItemsPerPage: number, opdsEnablePageReadProgress: boolean, opdsMarkAsReadOnDownload: boolean, opdsShowOnlyUnreadChapters: boolean, opdsShowOnlyDownloadedChapters: boolean, opdsChapterSortOrder: SortOrder, koreaderSyncServerUrl: string, koreaderSyncUsername: string, koreaderSyncUserkey: string, koreaderSyncDeviceId: string, koreaderSyncChecksumMethod: KoreaderSyncChecksumMethod, koreaderSyncStrategy: KoreaderSyncLegacyStrategy, koreaderSyncPercentageTolerance: number, databaseType: DatabaseType, databaseUrl: string, databaseUsername: string, databasePassword: string, downloadConversions: Array<{ __typename?: 'SettingsDownloadConversionType', mimeType: string, target: string, compressionLevel?: number | null }> };
export type ServerSettingsFragment = { __typename?: 'SettingsType', ip: string, port: number, socksProxyEnabled: boolean, socksProxyVersion: number, socksProxyHost: string, socksProxyPort: string, socksProxyUsername: string, socksProxyPassword: string, webUIFlavor: WebUiFlavor, initialOpenInBrowserEnabled: boolean, webUIInterface: WebUiInterface, electronPath: string, webUIChannel: WebUiChannel, webUIUpdateCheckInterval: number, downloadAsCbz: boolean, downloadsPath: string, autoDownloadNewChapters: boolean, excludeEntryWithUnreadChapters: boolean, autoDownloadNewChaptersLimit: number, autoDownloadIgnoreReUploads: boolean, extensionRepos: Array<string>, maxSourcesInParallel: number, excludeUnreadChapters: boolean, excludeNotStarted: boolean, excludeCompleted: boolean, globalUpdateInterval: number, updateMangas: boolean, authMode: AuthMode, authPassword: string, authUsername: string, jwtAudience: string, jwtTokenExpiry: string, jwtRefreshExpiry: string, debugLogsEnabled: boolean, systemTrayEnabled: boolean, maxLogFileSize: string, maxLogFiles: number, maxLogFolderSize: string, backupPath: string, backupTime: string, backupInterval: number, backupTTL: number, localSourcePath: string, flareSolverrEnabled: boolean, flareSolverrUrl: string, flareSolverrTimeout: number, flareSolverrSessionName: string, flareSolverrSessionTtl: number, flareSolverrAsResponseFallback: boolean, opdsUseBinaryFileSizes: boolean, opdsItemsPerPage: number, opdsEnablePageReadProgress: boolean, opdsMarkAsReadOnDownload: boolean, opdsShowOnlyUnreadChapters: boolean, opdsShowOnlyDownloadedChapters: boolean, opdsChapterSortOrder: SortOrder, koreaderSyncChecksumMethod: KoreaderSyncChecksumMethod, koreaderSyncStrategyBackward: KoreaderSyncConflictStrategy, koreaderSyncStrategyForward: KoreaderSyncConflictStrategy, koreaderSyncPercentageTolerance: number, databaseType: DatabaseType, databaseUrl: string, databaseUsername: string, databasePassword: string, downloadConversions: Array<{ __typename?: 'SettingsDownloadConversionType', mimeType: string, target: string, compressionLevel?: number | null }> };
export type SourceMetaFieldsFragment = { __typename?: 'SourceMetaType', sourceId: string, key: string, value: string };
@@ -3510,6 +3572,20 @@ export type ClearServerCacheMutationVariables = Exact<{
export type ClearServerCacheMutation = { __typename?: 'Mutation', clearCachedImages: { __typename?: 'ClearCachedImagesPayload', cachedPages?: boolean | null, cachedThumbnails?: boolean | null, downloadedThumbnails?: boolean | null } };
export type KoSyncLoginMutationVariables = Exact<{
serverAddress: Scalars['String']['input'];
username: Scalars['String']['input'];
password: Scalars['String']['input'];
}>;
export type KoSyncLoginMutation = { __typename?: 'Mutation', connectKoSyncAccount: { __typename?: 'KoSyncConnectPayload', message?: string | null, status: { __typename?: 'KoSyncStatusPayload', isLoggedIn: boolean, serverAddress?: string | null, username?: string | null } } };
export type KoSyncLogoutMutationVariables = Exact<{ [key: string]: never; }>;
export type KoSyncLogoutMutation = { __typename?: 'Mutation', logoutKoSyncAccount: { __typename?: 'LogoutKoSyncAccountPayload', status: { __typename?: 'KoSyncStatusPayload', isLoggedIn: boolean, serverAddress?: string | null, username?: string | null } } };
export type DeleteMangaMetadataMutationVariables = Exact<{
input: DeleteMangaMetaInput;
}>;
@@ -3590,14 +3666,14 @@ export type ResetServerSettingsMutationVariables = Exact<{
}>;
export type ResetServerSettingsMutation = { __typename?: 'Mutation', resetSettings: { __typename?: 'ResetSettingsPayload', settings: { __typename?: 'SettingsType', ip: string, port: number, socksProxyEnabled: boolean, socksProxyVersion: number, socksProxyHost: string, socksProxyPort: string, socksProxyUsername: string, socksProxyPassword: string, webUIFlavor: WebUiFlavor, initialOpenInBrowserEnabled: boolean, webUIInterface: WebUiInterface, electronPath: string, webUIChannel: WebUiChannel, webUIUpdateCheckInterval: number, downloadAsCbz: boolean, downloadsPath: string, autoDownloadNewChapters: boolean, excludeEntryWithUnreadChapters: boolean, autoDownloadNewChaptersLimit: number, autoDownloadIgnoreReUploads: boolean, extensionRepos: Array<string>, maxSourcesInParallel: number, excludeUnreadChapters: boolean, excludeNotStarted: boolean, excludeCompleted: boolean, globalUpdateInterval: number, updateMangas: boolean, authMode: AuthMode, authPassword: string, authUsername: string, jwtAudience: string, jwtTokenExpiry: string, jwtRefreshExpiry: string, debugLogsEnabled: boolean, systemTrayEnabled: boolean, maxLogFileSize: string, maxLogFiles: number, maxLogFolderSize: string, backupPath: string, backupTime: string, backupInterval: number, backupTTL: number, localSourcePath: string, flareSolverrEnabled: boolean, flareSolverrUrl: string, flareSolverrTimeout: number, flareSolverrSessionName: string, flareSolverrSessionTtl: number, flareSolverrAsResponseFallback: boolean, opdsUseBinaryFileSizes: boolean, opdsItemsPerPage: number, opdsEnablePageReadProgress: boolean, opdsMarkAsReadOnDownload: boolean, opdsShowOnlyUnreadChapters: boolean, opdsShowOnlyDownloadedChapters: boolean, opdsChapterSortOrder: SortOrder, koreaderSyncServerUrl: string, koreaderSyncUsername: string, koreaderSyncUserkey: string, koreaderSyncDeviceId: string, koreaderSyncChecksumMethod: KoreaderSyncChecksumMethod, koreaderSyncStrategy: KoreaderSyncLegacyStrategy, koreaderSyncPercentageTolerance: number, databaseType: DatabaseType, databaseUrl: string, databaseUsername: string, databasePassword: string, downloadConversions: Array<{ __typename?: 'SettingsDownloadConversionType', mimeType: string, target: string, compressionLevel?: number | null }> } } };
export type ResetServerSettingsMutation = { __typename?: 'Mutation', resetSettings: { __typename?: 'ResetSettingsPayload', settings: { __typename?: 'SettingsType', ip: string, port: number, socksProxyEnabled: boolean, socksProxyVersion: number, socksProxyHost: string, socksProxyPort: string, socksProxyUsername: string, socksProxyPassword: string, webUIFlavor: WebUiFlavor, initialOpenInBrowserEnabled: boolean, webUIInterface: WebUiInterface, electronPath: string, webUIChannel: WebUiChannel, webUIUpdateCheckInterval: number, downloadAsCbz: boolean, downloadsPath: string, autoDownloadNewChapters: boolean, excludeEntryWithUnreadChapters: boolean, autoDownloadNewChaptersLimit: number, autoDownloadIgnoreReUploads: boolean, extensionRepos: Array<string>, maxSourcesInParallel: number, excludeUnreadChapters: boolean, excludeNotStarted: boolean, excludeCompleted: boolean, globalUpdateInterval: number, updateMangas: boolean, authMode: AuthMode, authPassword: string, authUsername: string, jwtAudience: string, jwtTokenExpiry: string, jwtRefreshExpiry: string, debugLogsEnabled: boolean, systemTrayEnabled: boolean, maxLogFileSize: string, maxLogFiles: number, maxLogFolderSize: string, backupPath: string, backupTime: string, backupInterval: number, backupTTL: number, localSourcePath: string, flareSolverrEnabled: boolean, flareSolverrUrl: string, flareSolverrTimeout: number, flareSolverrSessionName: string, flareSolverrSessionTtl: number, flareSolverrAsResponseFallback: boolean, opdsUseBinaryFileSizes: boolean, opdsItemsPerPage: number, opdsEnablePageReadProgress: boolean, opdsMarkAsReadOnDownload: boolean, opdsShowOnlyUnreadChapters: boolean, opdsShowOnlyDownloadedChapters: boolean, opdsChapterSortOrder: SortOrder, koreaderSyncChecksumMethod: KoreaderSyncChecksumMethod, koreaderSyncStrategyBackward: KoreaderSyncConflictStrategy, koreaderSyncStrategyForward: KoreaderSyncConflictStrategy, koreaderSyncPercentageTolerance: number, databaseType: DatabaseType, databaseUrl: string, databaseUsername: string, databasePassword: string, downloadConversions: Array<{ __typename?: 'SettingsDownloadConversionType', mimeType: string, target: string, compressionLevel?: number | null }> } } };
export type UpdateServerSettingsMutationVariables = Exact<{
input: SetSettingsInput;
}>;
export type UpdateServerSettingsMutation = { __typename?: 'Mutation', setSettings: { __typename?: 'SetSettingsPayload', settings: { __typename?: 'SettingsType', ip: string, port: number, socksProxyEnabled: boolean, socksProxyVersion: number, socksProxyHost: string, socksProxyPort: string, socksProxyUsername: string, socksProxyPassword: string, webUIFlavor: WebUiFlavor, initialOpenInBrowserEnabled: boolean, webUIInterface: WebUiInterface, electronPath: string, webUIChannel: WebUiChannel, webUIUpdateCheckInterval: number, downloadAsCbz: boolean, downloadsPath: string, autoDownloadNewChapters: boolean, excludeEntryWithUnreadChapters: boolean, autoDownloadNewChaptersLimit: number, autoDownloadIgnoreReUploads: boolean, extensionRepos: Array<string>, maxSourcesInParallel: number, excludeUnreadChapters: boolean, excludeNotStarted: boolean, excludeCompleted: boolean, globalUpdateInterval: number, updateMangas: boolean, authMode: AuthMode, authPassword: string, authUsername: string, jwtAudience: string, jwtTokenExpiry: string, jwtRefreshExpiry: string, debugLogsEnabled: boolean, systemTrayEnabled: boolean, maxLogFileSize: string, maxLogFiles: number, maxLogFolderSize: string, backupPath: string, backupTime: string, backupInterval: number, backupTTL: number, localSourcePath: string, flareSolverrEnabled: boolean, flareSolverrUrl: string, flareSolverrTimeout: number, flareSolverrSessionName: string, flareSolverrSessionTtl: number, flareSolverrAsResponseFallback: boolean, opdsUseBinaryFileSizes: boolean, opdsItemsPerPage: number, opdsEnablePageReadProgress: boolean, opdsMarkAsReadOnDownload: boolean, opdsShowOnlyUnreadChapters: boolean, opdsShowOnlyDownloadedChapters: boolean, opdsChapterSortOrder: SortOrder, koreaderSyncServerUrl: string, koreaderSyncUsername: string, koreaderSyncUserkey: string, koreaderSyncDeviceId: string, koreaderSyncChecksumMethod: KoreaderSyncChecksumMethod, koreaderSyncStrategy: KoreaderSyncLegacyStrategy, koreaderSyncPercentageTolerance: number, databaseType: DatabaseType, databaseUrl: string, databaseUsername: string, databasePassword: string, downloadConversions: Array<{ __typename?: 'SettingsDownloadConversionType', mimeType: string, target: string, compressionLevel?: number | null }> } } };
export type UpdateServerSettingsMutation = { __typename?: 'Mutation', setSettings: { __typename?: 'SetSettingsPayload', settings: { __typename?: 'SettingsType', ip: string, port: number, socksProxyEnabled: boolean, socksProxyVersion: number, socksProxyHost: string, socksProxyPort: string, socksProxyUsername: string, socksProxyPassword: string, webUIFlavor: WebUiFlavor, initialOpenInBrowserEnabled: boolean, webUIInterface: WebUiInterface, electronPath: string, webUIChannel: WebUiChannel, webUIUpdateCheckInterval: number, downloadAsCbz: boolean, downloadsPath: string, autoDownloadNewChapters: boolean, excludeEntryWithUnreadChapters: boolean, autoDownloadNewChaptersLimit: number, autoDownloadIgnoreReUploads: boolean, extensionRepos: Array<string>, maxSourcesInParallel: number, excludeUnreadChapters: boolean, excludeNotStarted: boolean, excludeCompleted: boolean, globalUpdateInterval: number, updateMangas: boolean, authMode: AuthMode, authPassword: string, authUsername: string, jwtAudience: string, jwtTokenExpiry: string, jwtRefreshExpiry: string, debugLogsEnabled: boolean, systemTrayEnabled: boolean, maxLogFileSize: string, maxLogFiles: number, maxLogFolderSize: string, backupPath: string, backupTime: string, backupInterval: number, backupTTL: number, localSourcePath: string, flareSolverrEnabled: boolean, flareSolverrUrl: string, flareSolverrTimeout: number, flareSolverrSessionName: string, flareSolverrSessionTtl: number, flareSolverrAsResponseFallback: boolean, opdsUseBinaryFileSizes: boolean, opdsItemsPerPage: number, opdsEnablePageReadProgress: boolean, opdsMarkAsReadOnDownload: boolean, opdsShowOnlyUnreadChapters: boolean, opdsShowOnlyDownloadedChapters: boolean, opdsChapterSortOrder: SortOrder, koreaderSyncChecksumMethod: KoreaderSyncChecksumMethod, koreaderSyncStrategyBackward: KoreaderSyncConflictStrategy, koreaderSyncStrategyForward: KoreaderSyncConflictStrategy, koreaderSyncPercentageTolerance: number, databaseType: DatabaseType, databaseUrl: string, databaseUsername: string, databasePassword: string, downloadConversions: Array<{ __typename?: 'SettingsDownloadConversionType', mimeType: string, target: string, compressionLevel?: number | null }> } } };
export type GetSourceMangasFetchMutationVariables = Exact<{
input: FetchSourceMangaInput;
@@ -3881,6 +3957,11 @@ export type GetGlobalMetadatasQueryVariables = Exact<{
export type GetGlobalMetadatasQuery = { __typename?: 'Query', metas: { __typename?: 'GlobalMetaNodeList', totalCount: number, nodes: Array<{ __typename?: 'GlobalMetaType', key: string, value: string }>, pageInfo: { __typename?: 'PageInfo', endCursor?: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor?: string | null } } };
export type GetKoSyncStatusQueryVariables = Exact<{ [key: string]: never; }>;
export type GetKoSyncStatusQuery = { __typename?: 'Query', koSyncStatus: { __typename?: 'KoSyncStatusPayload', isLoggedIn: boolean, serverAddress?: string | null, username?: string | null } };
export type GetMangaScreenQueryVariables = Exact<{
id: Scalars['Int']['input'];
}>;
@@ -3996,7 +4077,7 @@ export type GetWebuiUpdateStatusQuery = { __typename?: 'Query', getWebUIUpdateSt
export type GetServerSettingsQueryVariables = Exact<{ [key: string]: never; }>;
export type GetServerSettingsQuery = { __typename?: 'Query', settings: { __typename?: 'SettingsType', ip: string, port: number, socksProxyEnabled: boolean, socksProxyVersion: number, socksProxyHost: string, socksProxyPort: string, socksProxyUsername: string, socksProxyPassword: string, webUIFlavor: WebUiFlavor, initialOpenInBrowserEnabled: boolean, webUIInterface: WebUiInterface, electronPath: string, webUIChannel: WebUiChannel, webUIUpdateCheckInterval: number, downloadAsCbz: boolean, downloadsPath: string, autoDownloadNewChapters: boolean, excludeEntryWithUnreadChapters: boolean, autoDownloadNewChaptersLimit: number, autoDownloadIgnoreReUploads: boolean, extensionRepos: Array<string>, maxSourcesInParallel: number, excludeUnreadChapters: boolean, excludeNotStarted: boolean, excludeCompleted: boolean, globalUpdateInterval: number, updateMangas: boolean, authMode: AuthMode, authPassword: string, authUsername: string, jwtAudience: string, jwtTokenExpiry: string, jwtRefreshExpiry: string, debugLogsEnabled: boolean, systemTrayEnabled: boolean, maxLogFileSize: string, maxLogFiles: number, maxLogFolderSize: string, backupPath: string, backupTime: string, backupInterval: number, backupTTL: number, localSourcePath: string, flareSolverrEnabled: boolean, flareSolverrUrl: string, flareSolverrTimeout: number, flareSolverrSessionName: string, flareSolverrSessionTtl: number, flareSolverrAsResponseFallback: boolean, opdsUseBinaryFileSizes: boolean, opdsItemsPerPage: number, opdsEnablePageReadProgress: boolean, opdsMarkAsReadOnDownload: boolean, opdsShowOnlyUnreadChapters: boolean, opdsShowOnlyDownloadedChapters: boolean, opdsChapterSortOrder: SortOrder, koreaderSyncServerUrl: string, koreaderSyncUsername: string, koreaderSyncUserkey: string, koreaderSyncDeviceId: string, koreaderSyncChecksumMethod: KoreaderSyncChecksumMethod, koreaderSyncStrategy: KoreaderSyncLegacyStrategy, koreaderSyncPercentageTolerance: number, databaseType: DatabaseType, databaseUrl: string, databaseUsername: string, databasePassword: string, downloadConversions: Array<{ __typename?: 'SettingsDownloadConversionType', mimeType: string, target: string, compressionLevel?: number | null }> } };
export type GetServerSettingsQuery = { __typename?: 'Query', settings: { __typename?: 'SettingsType', ip: string, port: number, socksProxyEnabled: boolean, socksProxyVersion: number, socksProxyHost: string, socksProxyPort: string, socksProxyUsername: string, socksProxyPassword: string, webUIFlavor: WebUiFlavor, initialOpenInBrowserEnabled: boolean, webUIInterface: WebUiInterface, electronPath: string, webUIChannel: WebUiChannel, webUIUpdateCheckInterval: number, downloadAsCbz: boolean, downloadsPath: string, autoDownloadNewChapters: boolean, excludeEntryWithUnreadChapters: boolean, autoDownloadNewChaptersLimit: number, autoDownloadIgnoreReUploads: boolean, extensionRepos: Array<string>, maxSourcesInParallel: number, excludeUnreadChapters: boolean, excludeNotStarted: boolean, excludeCompleted: boolean, globalUpdateInterval: number, updateMangas: boolean, authMode: AuthMode, authPassword: string, authUsername: string, jwtAudience: string, jwtTokenExpiry: string, jwtRefreshExpiry: string, debugLogsEnabled: boolean, systemTrayEnabled: boolean, maxLogFileSize: string, maxLogFiles: number, maxLogFolderSize: string, backupPath: string, backupTime: string, backupInterval: number, backupTTL: number, localSourcePath: string, flareSolverrEnabled: boolean, flareSolverrUrl: string, flareSolverrTimeout: number, flareSolverrSessionName: string, flareSolverrSessionTtl: number, flareSolverrAsResponseFallback: boolean, opdsUseBinaryFileSizes: boolean, opdsItemsPerPage: number, opdsEnablePageReadProgress: boolean, opdsMarkAsReadOnDownload: boolean, opdsShowOnlyUnreadChapters: boolean, opdsShowOnlyDownloadedChapters: boolean, opdsChapterSortOrder: SortOrder, koreaderSyncChecksumMethod: KoreaderSyncChecksumMethod, koreaderSyncStrategyBackward: KoreaderSyncConflictStrategy, koreaderSyncStrategyForward: KoreaderSyncConflictStrategy, koreaderSyncPercentageTolerance: number, databaseType: DatabaseType, databaseUrl: string, databaseUsername: string, databasePassword: string, downloadConversions: Array<{ __typename?: 'SettingsDownloadConversionType', mimeType: string, target: string, compressionLevel?: number | null }> } };
export type GetSourceBrowseQueryVariables = Exact<{
id: Scalars['LongString']['input'];

View File

@@ -0,0 +1,35 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { KO_SYNC_STATUS } from '@/lib/graphql/fragments/KoreaderSyncFragments.ts';
export const KO_SYNC_LOGIN = gql`
${KO_SYNC_STATUS}
mutation KO_SYNC_LOGIN($serverAddress: String!, $username: String!, $password: String!) {
connectKoSyncAccount(input: { serverAddress: $serverAddress, username: $username, password: $password }) {
message
status {
...KO_SYNC_STATUS
}
}
}
`;
export const KO_SYNC_LOGOUT = gql`
${KO_SYNC_STATUS}
mutation KO_SYNC_LOGOUT {
logoutKoSyncAccount(input: {}) {
status {
...KO_SYNC_STATUS
}
}
}
`;

View File

@@ -0,0 +1,20 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import gql from 'graphql-tag';
import { KO_SYNC_STATUS } from '@/lib/graphql/fragments/KoreaderSyncFragments.ts';
export const GET_KO_SYNC_STATUS = gql`
${KO_SYNC_STATUS}
query GET_KO_SYNC_STATUS {
koSyncStatus {
...KO_SYNC_STATUS
}
}
`;

View File

@@ -222,6 +222,12 @@ import {
CreateBackupMutation,
CreateBackupMutationVariables,
RestoreBackupInput,
KoSyncLoginMutation,
KoSyncLoginMutationVariables,
KoSyncLogoutMutation,
KoSyncLogoutMutationVariables,
GetKoSyncStatusQuery,
GetKoSyncStatusQueryVariables,
} from '@/lib/graphql/generated/graphql.ts';
import { GET_GLOBAL_METADATAS } from '@/lib/graphql/queries/GlobalMetadataQuery.ts';
import { DELETE_GLOBAL_METADATA, SET_GLOBAL_METADATA } from '@/lib/graphql/mutations/GlobalMetadataMutation.ts';
@@ -341,6 +347,8 @@ import { updateMetadataList } from '@/features/metadata/services/MetadataApolloC
import { USER_LOGIN, USER_REFRESH } from '@/lib/graphql/mutations/UserMutation.ts';
import { AuthManager } from '@/features/authentication/AuthManager.ts';
import { useLocalStorage } from '@/base/hooks/useStorage.tsx';
import { KO_SYNC_LOGIN, KO_SYNC_LOGOUT } from '@/lib/graphql/mutations/KoreaderSyncMutation.ts';
import { GET_KO_SYNC_STATUS } from '@/lib/graphql/queries/KoreaderSyncQuery.ts';
import { ImageCache } from '@/lib/service-worker/ImageCache.ts';
enum GQLMethod {
@@ -3262,22 +3270,33 @@ export class RequestManager {
return this.doRequest(GQLMethod.USE_QUERY, document, undefined, options);
}
public useLogoutFromTracker(
options?: MutationHookOptions<TrackerLogoutMutation, TrackerLogoutMutationVariables>,
): AbortableApolloUseMutationResponse<TrackerLogoutMutation, TrackerLogoutMutationVariables> {
return this.doRequest(GQLMethod.USE_MUTATION, TRACKER_LOGOUT, undefined, options);
public logoutFromTracker(
trackerId: TrackerLogoutMutationVariables['trackerId'],
options?: MutationOptions<TrackerLogoutMutation, TrackerLogoutMutationVariables>,
): AbortableApolloMutationResponse<TrackerLogoutMutation> {
return this.doRequest(GQLMethod.MUTATION, TRACKER_LOGOUT, { trackerId }, options);
}
public useLoginToTrackerOauth(
options?: MutationHookOptions<TrackerLoginOauthMutation, TrackerLoginOauthMutationVariables>,
): AbortableApolloUseMutationResponse<TrackerLoginOauthMutation, TrackerLoginOauthMutationVariables> {
return this.doRequest(GQLMethod.USE_MUTATION, TRACKER_LOGIN_OAUTH, undefined, options);
public loginToTrackerOauth(
trackerId: number,
callbackUrl: string,
options?: MutationOptions<TrackerLoginOauthMutation, TrackerLoginOauthMutationVariables>,
): AbortableApolloMutationResponse<TrackerLoginOauthMutation> {
return this.doRequest(GQLMethod.MUTATION, TRACKER_LOGIN_OAUTH, { input: { trackerId, callbackUrl } }, options);
}
public useLoginToTrackerCredentials(
options?: MutationHookOptions<TrackerLoginCredentialsMutation, TrackerLoginCredentialsMutationVariables>,
): AbortableApolloUseMutationResponse<TrackerLoginCredentialsMutation, TrackerLoginCredentialsMutationVariables> {
return this.doRequest(GQLMethod.USE_MUTATION, TRACKER_LOGIN_CREDENTIALS, undefined, options);
public loginTrackerCredentials(
trackerId: number,
username: string,
password: string,
options?: MutationOptions<TrackerLoginCredentialsMutation, TrackerLoginCredentialsMutationVariables>,
): AbortableApolloMutationResponse<TrackerLoginCredentialsMutation> {
return this.doRequest(
GQLMethod.MUTATION,
TRACKER_LOGIN_CREDENTIALS,
{ input: { trackerId, username, password } },
options,
);
}
public useTrackerSearch(
@@ -3348,6 +3367,36 @@ export class RequestManager {
return this.doRequest(GQLMethod.USE_MUTATION, USER_LOGIN, undefined, options);
}
public useKoSyncStatus(
options?: QueryHookOptions<GetKoSyncStatusQuery, GetKoSyncStatusQueryVariables>,
): AbortableApolloUseQueryResponse<GetKoSyncStatusQuery, GetKoSyncStatusQueryVariables> {
return this.doRequest(GQLMethod.USE_QUERY, GET_KO_SYNC_STATUS, undefined, options);
}
public koSyncLogin(
serverAddress: string,
username: string,
password: string,
options?: MutationOptions<KoSyncLoginMutation, KoSyncLoginMutationVariables>,
): AbortableApolloMutationResponse<KoSyncLoginMutation> {
return this.doRequest(
GQLMethod.MUTATION,
KO_SYNC_LOGIN,
{
serverAddress,
username,
password,
},
options,
);
}
public koSyncLogout(
options?: MutationOptions<KoSyncLogoutMutation, KoSyncLogoutMutationVariables>,
): AbortableApolloMutationResponse<KoSyncLogoutMutation> {
return this.doRequest(GQLMethod.MUTATION, KO_SYNC_LOGOUT, undefined, options);
}
public refreshUser(
refreshToken: string,
options?: MutationOptions<UserRefreshMutation, UserRefreshMutationVariables>,

View File

@@ -80,6 +80,7 @@ const typePolicies: StrictTypedTypePolicies = {
UpdaterJobsInfoType: { keyFields: [] },
WebUIUpdateStatus: { keyFields: [] },
UpdateStatus: { keyFields: [] },
KoSyncStatusPayload: { keyFields: [] },
Query: {
fields: {
manga(_, { args, toReference }) {