Add "ui login" support
This commit is contained in:
@@ -12,6 +12,7 @@ import calendar from 'dayjs/plugin/calendar';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import isToday from 'dayjs/plugin/isToday';
|
||||
import isYesterday from 'dayjs/plugin/isYesterday';
|
||||
import duration from 'dayjs/plugin/duration';
|
||||
import { importDayJsLocale } from '@/lib/dayjs/LocaleImporter.ts';
|
||||
// import localizedFormat from 'dayjs/plugin/localizedFormat';
|
||||
// import updateLocale from 'dayjs/plugin/updateLocale';
|
||||
@@ -22,6 +23,7 @@ dayjs.extend(calendar);
|
||||
dayjs.extend(relativeTime);
|
||||
dayjs.extend(isToday);
|
||||
dayjs.extend(isYesterday);
|
||||
dayjs.extend(duration);
|
||||
// dayjs.extend(localizedFormat);
|
||||
// dayjs.extend(updateLocale);
|
||||
|
||||
|
||||
@@ -60,6 +60,9 @@ export const SERVER_SETTINGS = gql`
|
||||
authMode
|
||||
authPassword
|
||||
authUsername
|
||||
jwtAudience
|
||||
jwtTokenExpiry
|
||||
jwtRefreshExpiry
|
||||
|
||||
# misc
|
||||
debugLogsEnabled
|
||||
|
||||
@@ -110,10 +110,11 @@ export type CheckBoxFilterFieldPolicy = {
|
||||
default?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
name?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type CheckBoxPreferenceKeySpecifier = ('currentValue' | 'default' | 'key' | 'summary' | 'title' | 'visible' | CheckBoxPreferenceKeySpecifier)[];
|
||||
export type CheckBoxPreferenceKeySpecifier = ('currentValue' | 'default' | 'enabled' | 'key' | 'summary' | 'title' | 'visible' | CheckBoxPreferenceKeySpecifier)[];
|
||||
export type CheckBoxPreferenceFieldPolicy = {
|
||||
currentValue?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
default?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
enabled?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
key?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
summary?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
title?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -245,12 +246,13 @@ export type EdgeFieldPolicy = {
|
||||
cursor?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
node?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type EditTextPreferenceKeySpecifier = ('currentValue' | 'default' | 'dialogMessage' | 'dialogTitle' | 'key' | 'summary' | 'text' | 'title' | 'visible' | EditTextPreferenceKeySpecifier)[];
|
||||
export type EditTextPreferenceKeySpecifier = ('currentValue' | 'default' | 'dialogMessage' | 'dialogTitle' | 'enabled' | 'key' | 'summary' | 'text' | 'title' | 'visible' | EditTextPreferenceKeySpecifier)[];
|
||||
export type EditTextPreferenceFieldPolicy = {
|
||||
currentValue?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
default?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
dialogMessage?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
dialogTitle?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
enabled?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
key?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
summary?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
text?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -295,11 +297,12 @@ export type ExtensionTypeFieldPolicy = {
|
||||
versionCode?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
versionName?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type FetchChapterPagesPayloadKeySpecifier = ('chapter' | 'clientMutationId' | 'pages' | FetchChapterPagesPayloadKeySpecifier)[];
|
||||
export type FetchChapterPagesPayloadKeySpecifier = ('chapter' | 'clientMutationId' | 'pages' | 'syncConflict' | FetchChapterPagesPayloadKeySpecifier)[];
|
||||
export type FetchChapterPagesPayloadFieldPolicy = {
|
||||
chapter?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
pages?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
pages?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
syncConflict?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type FetchChaptersPayloadKeySpecifier = ('chapters' | 'clientMutationId' | FetchChaptersPayloadKeySpecifier)[];
|
||||
export type FetchChaptersPayloadFieldPolicy = {
|
||||
@@ -353,6 +356,19 @@ export type InstallExternalExtensionPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
extension?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type KoSyncConnectPayloadKeySpecifier = ('clientMutationId' | 'message' | 'settings' | 'success' | 'username' | 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>
|
||||
};
|
||||
export type KoSyncStatusPayloadKeySpecifier = ('isLoggedIn' | 'username' | KoSyncStatusPayloadKeySpecifier)[];
|
||||
export type KoSyncStatusPayloadFieldPolicy = {
|
||||
isLoggedIn?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
username?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type LastUpdateTimestampPayloadKeySpecifier = ('timestamp' | LastUpdateTimestampPayloadKeySpecifier)[];
|
||||
export type LastUpdateTimestampPayloadFieldPolicy = {
|
||||
timestamp?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
@@ -363,10 +379,11 @@ export type LibraryUpdateStatusFieldPolicy = {
|
||||
jobsInfo?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
mangaUpdates?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type ListPreferenceKeySpecifier = ('currentValue' | 'default' | 'entries' | 'entryValues' | 'key' | 'summary' | 'title' | 'visible' | ListPreferenceKeySpecifier)[];
|
||||
export type ListPreferenceKeySpecifier = ('currentValue' | 'default' | 'enabled' | 'entries' | 'entryValues' | 'key' | 'summary' | 'title' | 'visible' | ListPreferenceKeySpecifier)[];
|
||||
export type ListPreferenceFieldPolicy = {
|
||||
currentValue?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
default?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
enabled?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
entries?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
entryValues?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
key?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -374,6 +391,12 @@ export type ListPreferenceFieldPolicy = {
|
||||
title?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
visible?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type LoginPayloadKeySpecifier = ('accessToken' | 'clientMutationId' | 'refreshToken' | LoginPayloadKeySpecifier)[];
|
||||
export type LoginPayloadFieldPolicy = {
|
||||
accessToken?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
refreshToken?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type LoginTrackerCredentialsPayloadKeySpecifier = ('clientMutationId' | 'isLoggedIn' | 'tracker' | LoginTrackerCredentialsPayloadKeySpecifier)[];
|
||||
export type LoginTrackerCredentialsPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -386,6 +409,12 @@ export type LoginTrackerOAuthPayloadFieldPolicy = {
|
||||
isLoggedIn?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
tracker?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type LogoutKoSyncAccountPayloadKeySpecifier = ('clientMutationId' | 'settings' | 'success' | LogoutKoSyncAccountPayloadKeySpecifier)[];
|
||||
export type LogoutKoSyncAccountPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
settings?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
success?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type LogoutTrackerPayloadKeySpecifier = ('clientMutationId' | 'isLoggedIn' | 'tracker' | LogoutTrackerPayloadKeySpecifier)[];
|
||||
export type LogoutTrackerPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -464,12 +493,13 @@ export type MetaTypeFieldPolicy = {
|
||||
key?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
value?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type MultiSelectListPreferenceKeySpecifier = ('currentValue' | 'default' | 'dialogMessage' | 'dialogTitle' | 'entries' | 'entryValues' | 'key' | 'summary' | 'title' | 'visible' | MultiSelectListPreferenceKeySpecifier)[];
|
||||
export type MultiSelectListPreferenceKeySpecifier = ('currentValue' | 'default' | 'dialogMessage' | 'dialogTitle' | 'enabled' | 'entries' | 'entryValues' | 'key' | 'summary' | 'title' | 'visible' | MultiSelectListPreferenceKeySpecifier)[];
|
||||
export type MultiSelectListPreferenceFieldPolicy = {
|
||||
currentValue?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
default?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
dialogMessage?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
dialogTitle?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
enabled?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
entries?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
entryValues?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
key?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -477,11 +507,12 @@ export type MultiSelectListPreferenceFieldPolicy = {
|
||||
title?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
visible?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type MutationKeySpecifier = ('bindTrack' | 'clearCachedImages' | 'clearDownloader' | 'createBackup' | 'createCategory' | 'deleteCategory' | 'deleteCategoryMeta' | 'deleteChapterMeta' | 'deleteDownloadedChapter' | 'deleteDownloadedChapters' | 'deleteGlobalMeta' | 'deleteMangaMeta' | 'deleteSourceMeta' | 'dequeueChapterDownload' | 'dequeueChapterDownloads' | 'enqueueChapterDownload' | 'enqueueChapterDownloads' | 'fetchChapterPages' | 'fetchChapters' | 'fetchExtensions' | 'fetchManga' | 'fetchSourceManga' | 'fetchTrack' | 'installExternalExtension' | 'loginTrackerCredentials' | 'loginTrackerOAuth' | 'logoutTracker' | 'reorderChapterDownload' | 'resetSettings' | 'resetWebUIUpdateStatus' | 'restoreBackup' | 'setCategoryMeta' | 'setChapterMeta' | 'setGlobalMeta' | 'setMangaMeta' | 'setSettings' | 'setSourceMeta' | 'startDownloader' | 'stopDownloader' | 'trackProgress' | 'unbindTrack' | 'updateCategories' | 'updateCategory' | 'updateCategoryManga' | 'updateCategoryOrder' | 'updateChapter' | 'updateChapters' | 'updateExtension' | 'updateExtensions' | 'updateLibrary' | 'updateLibraryManga' | 'updateManga' | 'updateMangaCategories' | 'updateMangas' | 'updateMangasCategories' | 'updateSourcePreference' | 'updateStop' | 'updateTrack' | 'updateWebUI' | MutationKeySpecifier)[];
|
||||
export type MutationKeySpecifier = ('bindTrack' | 'clearCachedImages' | 'clearDownloader' | 'connectKoSyncAccount' | 'createBackup' | 'createCategory' | 'deleteCategory' | 'deleteCategoryMeta' | 'deleteChapterMeta' | 'deleteDownloadedChapter' | 'deleteDownloadedChapters' | 'deleteGlobalMeta' | 'deleteMangaMeta' | 'deleteSourceMeta' | 'dequeueChapterDownload' | 'dequeueChapterDownloads' | 'enqueueChapterDownload' | 'enqueueChapterDownloads' | 'fetchChapterPages' | 'fetchChapters' | 'fetchExtensions' | 'fetchManga' | 'fetchSourceManga' | 'fetchTrack' | 'installExternalExtension' | 'login' | 'loginTrackerCredentials' | 'loginTrackerOAuth' | 'logoutKoSyncAccount' | 'logoutTracker' | 'refreshToken' | 'reorderChapterDownload' | 'resetSettings' | 'resetWebUIUpdateStatus' | 'restoreBackup' | 'setCategoryMeta' | 'setChapterMeta' | 'setGlobalMeta' | 'setMangaMeta' | 'setSettings' | 'setSourceMeta' | 'startDownloader' | 'stopDownloader' | 'trackProgress' | 'unbindTrack' | 'updateCategories' | 'updateCategory' | 'updateCategoryManga' | 'updateCategoryOrder' | 'updateChapter' | 'updateChapters' | 'updateExtension' | 'updateExtensions' | 'updateLibrary' | 'updateLibraryManga' | 'updateManga' | 'updateMangaCategories' | 'updateMangas' | 'updateMangasCategories' | 'updateSourcePreference' | 'updateStop' | 'updateTrack' | 'updateWebUI' | MutationKeySpecifier)[];
|
||||
export type MutationFieldPolicy = {
|
||||
bindTrack?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
clearCachedImages?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
clearDownloader?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
connectKoSyncAccount?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
createBackup?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
createCategory?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
deleteCategory?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -503,9 +534,12 @@ export type MutationFieldPolicy = {
|
||||
fetchSourceManga?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
fetchTrack?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
installExternalExtension?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
login?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
loginTrackerCredentials?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
loginTrackerOAuth?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
logoutKoSyncAccount?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
logoutTracker?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
refreshToken?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
reorderChapterDownload?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
resetSettings?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
resetWebUIUpdateStatus?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -553,7 +587,7 @@ 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' | 'debugLogsEnabled' | 'downloadAsCbz' | 'downloadConversions' | 'downloadsPath' | 'electronPath' | 'excludeCompleted' | 'excludeEntryWithUnreadChapters' | 'excludeNotStarted' | 'excludeUnreadChapters' | 'extensionRepos' | 'flareSolverrAsResponseFallback' | 'flareSolverrEnabled' | 'flareSolverrSessionName' | 'flareSolverrSessionTtl' | 'flareSolverrTimeout' | 'flareSolverrUrl' | 'globalUpdateInterval' | 'gqlDebugLogsEnabled' | 'initialOpenInBrowserEnabled' | 'ip' | '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' | 'autoDownloadAheadLimit' | 'autoDownloadIgnoreReUploads' | 'autoDownloadNewChapters' | 'autoDownloadNewChaptersLimit' | 'backupInterval' | 'backupPath' | 'backupTTL' | 'backupTime' | 'basicAuthEnabled' | 'basicAuthPassword' | 'basicAuthUsername' | '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' | '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 PartialSettingsTypeFieldPolicy = {
|
||||
authMode?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
authPassword?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -589,6 +623,16 @@ export type PartialSettingsTypeFieldPolicy = {
|
||||
gqlDebugLogsEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
initialOpenInBrowserEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
ip?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
jwtAudience?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
jwtRefreshExpiry?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
jwtTokenExpiry?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
koreaderSyncChecksumMethod?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
koreaderSyncDeviceId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
koreaderSyncPercentageTolerance?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
koreaderSyncServerUrl?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
koreaderSyncStrategy?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
koreaderSyncUserkey?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
koreaderSyncUsername?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
localSourcePath?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
maxLogFileSize?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
maxLogFiles?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -615,7 +659,7 @@ export type PartialSettingsTypeFieldPolicy = {
|
||||
webUIInterface?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
webUIUpdateCheckInterval?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type QueryKeySpecifier = ('aboutServer' | 'aboutWebUI' | 'categories' | 'category' | 'chapter' | 'chapters' | 'checkForServerUpdates' | 'checkForWebUIUpdate' | 'downloadStatus' | 'extension' | 'extensions' | 'getWebUIUpdateStatus' | 'lastUpdateTimestamp' | 'libraryUpdateStatus' | 'manga' | 'mangas' | 'meta' | 'metas' | 'restoreStatus' | 'searchTracker' | 'settings' | 'source' | 'sources' | 'trackRecord' | 'trackRecords' | 'tracker' | 'trackers' | 'updateStatus' | 'validateBackup' | QueryKeySpecifier)[];
|
||||
export type QueryKeySpecifier = ('aboutServer' | 'aboutWebUI' | 'categories' | 'category' | 'chapter' | 'chapters' | 'checkForServerUpdates' | 'checkForWebUIUpdate' | 'downloadStatus' | 'extension' | 'extensions' | 'getWebUIUpdateStatus' | 'koSyncStatus' | 'lastUpdateTimestamp' | 'libraryUpdateStatus' | 'manga' | 'mangas' | 'meta' | 'metas' | 'restoreStatus' | 'searchTracker' | 'settings' | 'source' | 'sources' | 'trackRecord' | 'trackRecords' | 'tracker' | 'trackers' | 'updateStatus' | 'validateBackup' | QueryKeySpecifier)[];
|
||||
export type QueryFieldPolicy = {
|
||||
aboutServer?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
aboutWebUI?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -629,6 +673,7 @@ export type QueryFieldPolicy = {
|
||||
extension?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
extensions?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
getWebUIUpdateStatus?: FieldPolicy<Reference, Reference, Reference, FieldFunctionOptions<GetWebuiUpdateStatusQueryVariables>> | FieldReadFunction<Reference, Reference, FieldFunctionOptions<GetWebuiUpdateStatusQueryVariables>>,
|
||||
koSyncStatus?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
lastUpdateTimestamp?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
libraryUpdateStatus?: FieldPolicy<Reference, Reference, Reference, FieldFunctionOptions<GetUpdateStatusQueryVariables>> | FieldReadFunction<Reference, Reference, FieldFunctionOptions<GetUpdateStatusQueryVariables>>,
|
||||
manga?: FieldPolicy<Reference, Reference, Reference, FieldFunctionOptions<GetMangaScreenQueryVariables>> | FieldReadFunction<Reference, Reference, FieldFunctionOptions<GetMangaScreenQueryVariables>>,
|
||||
@@ -647,6 +692,11 @@ export type QueryFieldPolicy = {
|
||||
updateStatus?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
validateBackup?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type RefreshTokenPayloadKeySpecifier = ('accessToken' | 'clientMutationId' | RefreshTokenPayloadKeySpecifier)[];
|
||||
export type RefreshTokenPayloadFieldPolicy = {
|
||||
accessToken?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type ReorderChapterDownloadPayloadKeySpecifier = ('clientMutationId' | 'downloadStatus' | ReorderChapterDownloadPayloadKeySpecifier)[];
|
||||
export type ReorderChapterDownloadPayloadFieldPolicy = {
|
||||
clientMutationId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -707,7 +757,7 @@ 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' | 'debugLogsEnabled' | 'downloadAsCbz' | 'downloadConversions' | 'downloadsPath' | 'electronPath' | 'excludeCompleted' | 'excludeEntryWithUnreadChapters' | 'excludeNotStarted' | 'excludeUnreadChapters' | 'extensionRepos' | 'flareSolverrAsResponseFallback' | 'flareSolverrEnabled' | 'flareSolverrSessionName' | 'flareSolverrSessionTtl' | 'flareSolverrTimeout' | 'flareSolverrUrl' | 'globalUpdateInterval' | 'gqlDebugLogsEnabled' | 'initialOpenInBrowserEnabled' | 'ip' | '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' | 'autoDownloadAheadLimit' | 'autoDownloadIgnoreReUploads' | 'autoDownloadNewChapters' | 'autoDownloadNewChaptersLimit' | 'backupInterval' | 'backupPath' | 'backupTTL' | 'backupTime' | 'basicAuthEnabled' | 'basicAuthPassword' | 'basicAuthUsername' | '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' | '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 SettingsFieldPolicy = {
|
||||
authMode?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
authPassword?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -743,6 +793,16 @@ export type SettingsFieldPolicy = {
|
||||
gqlDebugLogsEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
initialOpenInBrowserEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
ip?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
jwtAudience?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
jwtRefreshExpiry?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
jwtTokenExpiry?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
koreaderSyncChecksumMethod?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
koreaderSyncDeviceId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
koreaderSyncPercentageTolerance?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
koreaderSyncServerUrl?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
koreaderSyncStrategy?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
koreaderSyncUserkey?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
koreaderSyncUsername?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
localSourcePath?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
maxLogFileSize?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
maxLogFiles?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -781,7 +841,7 @@ export type SettingsDownloadConversionTypeFieldPolicy = {
|
||||
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' | 'debugLogsEnabled' | 'downloadAsCbz' | 'downloadConversions' | 'downloadsPath' | 'electronPath' | 'excludeCompleted' | 'excludeEntryWithUnreadChapters' | 'excludeNotStarted' | 'excludeUnreadChapters' | 'extensionRepos' | 'flareSolverrAsResponseFallback' | 'flareSolverrEnabled' | 'flareSolverrSessionName' | 'flareSolverrSessionTtl' | 'flareSolverrTimeout' | 'flareSolverrUrl' | 'globalUpdateInterval' | 'gqlDebugLogsEnabled' | 'initialOpenInBrowserEnabled' | 'ip' | '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' | 'autoDownloadAheadLimit' | 'autoDownloadIgnoreReUploads' | 'autoDownloadNewChapters' | 'autoDownloadNewChaptersLimit' | 'backupInterval' | 'backupPath' | 'backupTTL' | 'backupTime' | 'basicAuthEnabled' | 'basicAuthPassword' | 'basicAuthUsername' | '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' | '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 SettingsTypeFieldPolicy = {
|
||||
authMode?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
authPassword?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -817,6 +877,16 @@ export type SettingsTypeFieldPolicy = {
|
||||
gqlDebugLogsEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
initialOpenInBrowserEnabled?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
ip?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
jwtAudience?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
jwtRefreshExpiry?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
jwtTokenExpiry?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
koreaderSyncChecksumMethod?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
koreaderSyncDeviceId?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
koreaderSyncPercentageTolerance?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
koreaderSyncServerUrl?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
koreaderSyncStrategy?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
koreaderSyncUserkey?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
koreaderSyncUsername?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
localSourcePath?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
maxLogFileSize?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
maxLogFiles?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -873,8 +943,9 @@ export type SourceNodeListFieldPolicy = {
|
||||
pageInfo?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
totalCount?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type SourceTypeKeySpecifier = ('displayName' | 'extension' | 'filters' | 'iconUrl' | 'id' | 'isConfigurable' | 'isNsfw' | 'lang' | 'manga' | 'meta' | 'name' | 'preferences' | 'supportsLatest' | SourceTypeKeySpecifier)[];
|
||||
export type SourceTypeKeySpecifier = ('baseUrl' | 'displayName' | 'extension' | 'filters' | 'iconUrl' | 'id' | 'isConfigurable' | 'isNsfw' | 'lang' | 'manga' | 'meta' | 'name' | 'preferences' | 'supportsLatest' | SourceTypeKeySpecifier)[];
|
||||
export type SourceTypeFieldPolicy = {
|
||||
baseUrl?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
displayName?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
extension?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
filters?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -907,15 +978,21 @@ export type SubscriptionFieldPolicy = {
|
||||
updateStatusChanged?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
webUIUpdateStatusChange?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type SwitchPreferenceKeySpecifier = ('currentValue' | 'default' | 'key' | 'summary' | 'title' | 'visible' | SwitchPreferenceKeySpecifier)[];
|
||||
export type SwitchPreferenceKeySpecifier = ('currentValue' | 'default' | 'enabled' | 'key' | 'summary' | 'title' | 'visible' | SwitchPreferenceKeySpecifier)[];
|
||||
export type SwitchPreferenceFieldPolicy = {
|
||||
currentValue?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
default?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
enabled?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
key?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
summary?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
title?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
visible?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type SyncConflictInfoTypeKeySpecifier = ('deviceName' | 'remotePage' | SyncConflictInfoTypeKeySpecifier)[];
|
||||
export type SyncConflictInfoTypeFieldPolicy = {
|
||||
deviceName?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
remotePage?: FieldPolicy<any> | FieldReadFunction<any>
|
||||
};
|
||||
export type TextFilterKeySpecifier = ('default' | 'name' | TextFilterKeySpecifier)[];
|
||||
export type TextFilterFieldPolicy = {
|
||||
default?: FieldPolicy<any> | FieldReadFunction<any>,
|
||||
@@ -1396,6 +1473,14 @@ export type StrictTypedTypePolicies = {
|
||||
keyFields?: false | InstallExternalExtensionPayloadKeySpecifier | (() => undefined | InstallExternalExtensionPayloadKeySpecifier),
|
||||
fields?: InstallExternalExtensionPayloadFieldPolicy,
|
||||
},
|
||||
KoSyncConnectPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | KoSyncConnectPayloadKeySpecifier | (() => undefined | KoSyncConnectPayloadKeySpecifier),
|
||||
fields?: KoSyncConnectPayloadFieldPolicy,
|
||||
},
|
||||
KoSyncStatusPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | KoSyncStatusPayloadKeySpecifier | (() => undefined | KoSyncStatusPayloadKeySpecifier),
|
||||
fields?: KoSyncStatusPayloadFieldPolicy,
|
||||
},
|
||||
LastUpdateTimestampPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | LastUpdateTimestampPayloadKeySpecifier | (() => undefined | LastUpdateTimestampPayloadKeySpecifier),
|
||||
fields?: LastUpdateTimestampPayloadFieldPolicy,
|
||||
@@ -1408,6 +1493,10 @@ export type StrictTypedTypePolicies = {
|
||||
keyFields?: false | ListPreferenceKeySpecifier | (() => undefined | ListPreferenceKeySpecifier),
|
||||
fields?: ListPreferenceFieldPolicy,
|
||||
},
|
||||
LoginPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | LoginPayloadKeySpecifier | (() => undefined | LoginPayloadKeySpecifier),
|
||||
fields?: LoginPayloadFieldPolicy,
|
||||
},
|
||||
LoginTrackerCredentialsPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | LoginTrackerCredentialsPayloadKeySpecifier | (() => undefined | LoginTrackerCredentialsPayloadKeySpecifier),
|
||||
fields?: LoginTrackerCredentialsPayloadFieldPolicy,
|
||||
@@ -1416,6 +1505,10 @@ export type StrictTypedTypePolicies = {
|
||||
keyFields?: false | LoginTrackerOAuthPayloadKeySpecifier | (() => undefined | LoginTrackerOAuthPayloadKeySpecifier),
|
||||
fields?: LoginTrackerOAuthPayloadFieldPolicy,
|
||||
},
|
||||
LogoutKoSyncAccountPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | LogoutKoSyncAccountPayloadKeySpecifier | (() => undefined | LogoutKoSyncAccountPayloadKeySpecifier),
|
||||
fields?: LogoutKoSyncAccountPayloadFieldPolicy,
|
||||
},
|
||||
LogoutTrackerPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | LogoutTrackerPayloadKeySpecifier | (() => undefined | LogoutTrackerPayloadKeySpecifier),
|
||||
fields?: LogoutTrackerPayloadFieldPolicy,
|
||||
@@ -1472,6 +1565,10 @@ export type StrictTypedTypePolicies = {
|
||||
keyFields?: false | QueryKeySpecifier | (() => undefined | QueryKeySpecifier),
|
||||
fields?: QueryFieldPolicy,
|
||||
},
|
||||
RefreshTokenPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | RefreshTokenPayloadKeySpecifier | (() => undefined | RefreshTokenPayloadKeySpecifier),
|
||||
fields?: RefreshTokenPayloadFieldPolicy,
|
||||
},
|
||||
ReorderChapterDownloadPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | ReorderChapterDownloadPayloadKeySpecifier | (() => undefined | ReorderChapterDownloadPayloadKeySpecifier),
|
||||
fields?: ReorderChapterDownloadPayloadFieldPolicy,
|
||||
@@ -1576,6 +1673,10 @@ export type StrictTypedTypePolicies = {
|
||||
keyFields?: false | SwitchPreferenceKeySpecifier | (() => undefined | SwitchPreferenceKeySpecifier),
|
||||
fields?: SwitchPreferenceFieldPolicy,
|
||||
},
|
||||
SyncConflictInfoType?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | SyncConflictInfoTypeKeySpecifier | (() => undefined | SyncConflictInfoTypeKeySpecifier),
|
||||
fields?: SyncConflictInfoTypeFieldPolicy,
|
||||
},
|
||||
TextFilter?: Omit<TypePolicy, "fields" | "keyFields"> & {
|
||||
keyFields?: false | TextFilterKeySpecifier | (() => undefined | TextFilterKeySpecifier),
|
||||
fields?: TextFilterFieldPolicy,
|
||||
|
||||
@@ -13,6 +13,7 @@ export type Scalars = {
|
||||
Int: { input: number; output: number; }
|
||||
Float: { input: number; output: number; }
|
||||
Cursor: { input: string; output: string; }
|
||||
Duration: { input: any; output: any; }
|
||||
LongString: { input: string; output: string; }
|
||||
Upload: { input: any; output: any; }
|
||||
};
|
||||
@@ -38,7 +39,8 @@ export type AboutWebUi = {
|
||||
export enum AuthMode {
|
||||
BasicAuth = 'BASIC_AUTH',
|
||||
None = 'NONE',
|
||||
SimpleLogin = 'SIMPLE_LOGIN'
|
||||
SimpleLogin = 'SIMPLE_LOGIN',
|
||||
UiLogin = 'UI_LOGIN'
|
||||
}
|
||||
|
||||
export enum BackupRestoreState {
|
||||
@@ -287,6 +289,7 @@ export type CheckBoxPreference = {
|
||||
__typename?: 'CheckBoxPreference';
|
||||
currentValue?: Maybe<Scalars['Boolean']['output']>;
|
||||
default: Scalars['Boolean']['output'];
|
||||
enabled: Scalars['Boolean']['output'];
|
||||
key: Scalars['String']['output'];
|
||||
summary?: Maybe<Scalars['String']['output']>;
|
||||
title?: Maybe<Scalars['String']['output']>;
|
||||
@@ -325,6 +328,12 @@ export type ClearDownloaderPayload = {
|
||||
downloadStatus: DownloadStatus;
|
||||
};
|
||||
|
||||
export type ConnectKoSyncAccountInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
password: Scalars['String']['input'];
|
||||
username: Scalars['String']['input'];
|
||||
};
|
||||
|
||||
export type CreateBackupInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
includeCategories?: InputMaybe<Scalars['Boolean']['input']>;
|
||||
@@ -576,6 +585,7 @@ export type EditTextPreference = {
|
||||
default?: Maybe<Scalars['String']['output']>;
|
||||
dialogMessage?: Maybe<Scalars['String']['output']>;
|
||||
dialogTitle?: Maybe<Scalars['String']['output']>;
|
||||
enabled: Scalars['Boolean']['output'];
|
||||
key: Scalars['String']['output'];
|
||||
summary?: Maybe<Scalars['String']['output']>;
|
||||
text?: Maybe<Scalars['String']['output']>;
|
||||
@@ -691,6 +701,7 @@ export type FetchChapterPagesPayload = {
|
||||
chapter: ChapterType;
|
||||
clientMutationId?: Maybe<Scalars['String']['output']>;
|
||||
pages: Array<Scalars['String']['output']>;
|
||||
syncConflict?: Maybe<SyncConflictInfoType>;
|
||||
};
|
||||
|
||||
export type FetchChaptersInput = {
|
||||
@@ -853,6 +864,34 @@ export type IntFilterInput = {
|
||||
notIn?: InputMaybe<Array<Scalars['Int']['input']>>;
|
||||
};
|
||||
|
||||
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']>;
|
||||
};
|
||||
|
||||
export type KoSyncStatusPayload = {
|
||||
__typename?: 'KoSyncStatusPayload';
|
||||
isLoggedIn: Scalars['Boolean']['output'];
|
||||
username?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
export enum KoreaderSyncChecksumMethod {
|
||||
Binary = 'BINARY',
|
||||
Filename = 'FILENAME'
|
||||
}
|
||||
|
||||
export enum KoreaderSyncStrategy {
|
||||
Disabled = 'DISABLED',
|
||||
Prompt = 'PROMPT',
|
||||
Receive = 'RECEIVE',
|
||||
Send = 'SEND',
|
||||
Silent = 'SILENT'
|
||||
}
|
||||
|
||||
export type LastUpdateTimestampPayload = {
|
||||
__typename?: 'LastUpdateTimestampPayload';
|
||||
timestamp: Scalars['LongString']['output'];
|
||||
@@ -874,6 +913,7 @@ export type ListPreference = {
|
||||
__typename?: 'ListPreference';
|
||||
currentValue?: Maybe<Scalars['String']['output']>;
|
||||
default?: Maybe<Scalars['String']['output']>;
|
||||
enabled: Scalars['Boolean']['output'];
|
||||
entries: Array<Scalars['String']['output']>;
|
||||
entryValues: Array<Scalars['String']['output']>;
|
||||
key: Scalars['String']['output'];
|
||||
@@ -882,6 +922,19 @@ export type ListPreference = {
|
||||
visible: Scalars['Boolean']['output'];
|
||||
};
|
||||
|
||||
export type LoginInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
password: Scalars['String']['input'];
|
||||
username: Scalars['String']['input'];
|
||||
};
|
||||
|
||||
export type LoginPayload = {
|
||||
__typename?: 'LoginPayload';
|
||||
accessToken: Scalars['String']['output'];
|
||||
clientMutationId?: Maybe<Scalars['String']['output']>;
|
||||
refreshToken: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
export type LoginTrackerCredentialsInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
password: Scalars['String']['input'];
|
||||
@@ -909,6 +962,17 @@ export type LoginTrackerOAuthPayload = {
|
||||
tracker: TrackerType;
|
||||
};
|
||||
|
||||
export type LogoutKoSyncAccountInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
};
|
||||
|
||||
export type LogoutKoSyncAccountPayload = {
|
||||
__typename?: 'LogoutKoSyncAccountPayload';
|
||||
clientMutationId?: Maybe<Scalars['String']['output']>;
|
||||
settings: SettingsType;
|
||||
success: Scalars['Boolean']['output'];
|
||||
};
|
||||
|
||||
export type LogoutTrackerInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
trackerId: Scalars['Int']['input'];
|
||||
@@ -1143,6 +1207,7 @@ export type MultiSelectListPreference = {
|
||||
default?: Maybe<Array<Scalars['String']['output']>>;
|
||||
dialogMessage?: Maybe<Scalars['String']['output']>;
|
||||
dialogTitle?: Maybe<Scalars['String']['output']>;
|
||||
enabled: Scalars['Boolean']['output'];
|
||||
entries: Array<Scalars['String']['output']>;
|
||||
entryValues: Array<Scalars['String']['output']>;
|
||||
key: Scalars['String']['output'];
|
||||
@@ -1156,6 +1221,7 @@ export type Mutation = {
|
||||
bindTrack: BindTrackPayload;
|
||||
clearCachedImages: ClearCachedImagesPayload;
|
||||
clearDownloader?: Maybe<ClearDownloaderPayload>;
|
||||
connectKoSyncAccount: KoSyncConnectPayload;
|
||||
createBackup: CreateBackupPayload;
|
||||
createCategory?: Maybe<CreateCategoryPayload>;
|
||||
deleteCategory?: Maybe<DeleteCategoryPayload>;
|
||||
@@ -1177,9 +1243,12 @@ export type Mutation = {
|
||||
fetchSourceManga?: Maybe<FetchSourceMangaPayload>;
|
||||
fetchTrack: FetchTrackPayload;
|
||||
installExternalExtension?: Maybe<InstallExternalExtensionPayload>;
|
||||
login: LoginPayload;
|
||||
loginTrackerCredentials: LoginTrackerCredentialsPayload;
|
||||
loginTrackerOAuth: LoginTrackerOAuthPayload;
|
||||
logoutKoSyncAccount: LogoutKoSyncAccountPayload;
|
||||
logoutTracker: LogoutTrackerPayload;
|
||||
refreshToken: RefreshTokenPayload;
|
||||
reorderChapterDownload?: Maybe<ReorderChapterDownloadPayload>;
|
||||
resetSettings: ResetSettingsPayload;
|
||||
resetWebUIUpdateStatus?: Maybe<WebUiUpdateStatus>;
|
||||
@@ -1230,6 +1299,11 @@ export type MutationClearDownloaderArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type MutationConnectKoSyncAccountArgs = {
|
||||
input: ConnectKoSyncAccountInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationCreateBackupArgs = {
|
||||
input?: InputMaybe<CreateBackupInput>;
|
||||
};
|
||||
@@ -1335,6 +1409,11 @@ export type MutationInstallExternalExtensionArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type MutationLoginArgs = {
|
||||
input: LoginInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationLoginTrackerCredentialsArgs = {
|
||||
input: LoginTrackerCredentialsInput;
|
||||
};
|
||||
@@ -1345,11 +1424,21 @@ export type MutationLoginTrackerOAuthArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type MutationLogoutKoSyncAccountArgs = {
|
||||
input: LogoutKoSyncAccountInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationLogoutTrackerArgs = {
|
||||
input: LogoutTrackerInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationRefreshTokenArgs = {
|
||||
input: RefreshTokenInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationReorderChapterDownloadArgs = {
|
||||
input: ReorderChapterDownloadInput;
|
||||
};
|
||||
@@ -1570,6 +1659,16 @@ export type PartialSettingsType = Settings & {
|
||||
gqlDebugLogsEnabled?: Maybe<Scalars['Boolean']['output']>;
|
||||
initialOpenInBrowserEnabled?: Maybe<Scalars['Boolean']['output']>;
|
||||
ip?: Maybe<Scalars['String']['output']>;
|
||||
jwtAudience?: Maybe<Scalars['String']['output']>;
|
||||
jwtRefreshExpiry?: Maybe<Scalars['Duration']['output']>;
|
||||
jwtTokenExpiry?: Maybe<Scalars['Duration']['output']>;
|
||||
koreaderSyncChecksumMethod?: Maybe<KoreaderSyncChecksumMethod>;
|
||||
koreaderSyncDeviceId?: Maybe<Scalars['String']['output']>;
|
||||
koreaderSyncPercentageTolerance?: Maybe<Scalars['Float']['output']>;
|
||||
koreaderSyncServerUrl?: Maybe<Scalars['String']['output']>;
|
||||
koreaderSyncStrategy?: Maybe<KoreaderSyncStrategy>;
|
||||
koreaderSyncUserkey?: Maybe<Scalars['String']['output']>;
|
||||
koreaderSyncUsername?: Maybe<Scalars['String']['output']>;
|
||||
localSourcePath?: Maybe<Scalars['String']['output']>;
|
||||
maxLogFileSize?: Maybe<Scalars['String']['output']>;
|
||||
maxLogFiles?: Maybe<Scalars['Int']['output']>;
|
||||
@@ -1627,6 +1726,16 @@ export type PartialSettingsTypeInput = {
|
||||
globalUpdateInterval?: InputMaybe<Scalars['Float']['input']>;
|
||||
initialOpenInBrowserEnabled?: InputMaybe<Scalars['Boolean']['input']>;
|
||||
ip?: InputMaybe<Scalars['String']['input']>;
|
||||
jwtAudience?: InputMaybe<Scalars['String']['input']>;
|
||||
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']>;
|
||||
koreaderSyncStrategy?: InputMaybe<KoreaderSyncStrategy>;
|
||||
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']>;
|
||||
@@ -1670,6 +1779,7 @@ export type Query = {
|
||||
extension: ExtensionType;
|
||||
extensions: ExtensionNodeList;
|
||||
getWebUIUpdateStatus: WebUiUpdateStatus;
|
||||
koSyncStatus: KoSyncStatusPayload;
|
||||
lastUpdateTimestamp: LastUpdateTimestampPayload;
|
||||
libraryUpdateStatus: LibraryUpdateStatus;
|
||||
manga: MangaType;
|
||||
@@ -1856,6 +1966,17 @@ export type QueryValidateBackupArgs = {
|
||||
input: ValidateBackupInput;
|
||||
};
|
||||
|
||||
export type RefreshTokenInput = {
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
refreshToken: Scalars['String']['input'];
|
||||
};
|
||||
|
||||
export type RefreshTokenPayload = {
|
||||
__typename?: 'RefreshTokenPayload';
|
||||
accessToken: Scalars['String']['output'];
|
||||
clientMutationId?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
export type ReorderChapterDownloadInput = {
|
||||
chapterId: Scalars['Int']['input'];
|
||||
clientMutationId?: InputMaybe<Scalars['String']['input']>;
|
||||
@@ -2018,6 +2139,16 @@ export type Settings = {
|
||||
gqlDebugLogsEnabled?: Maybe<Scalars['Boolean']['output']>;
|
||||
initialOpenInBrowserEnabled?: Maybe<Scalars['Boolean']['output']>;
|
||||
ip?: Maybe<Scalars['String']['output']>;
|
||||
jwtAudience?: Maybe<Scalars['String']['output']>;
|
||||
jwtRefreshExpiry?: Maybe<Scalars['Duration']['output']>;
|
||||
jwtTokenExpiry?: Maybe<Scalars['Duration']['output']>;
|
||||
koreaderSyncChecksumMethod?: Maybe<KoreaderSyncChecksumMethod>;
|
||||
koreaderSyncDeviceId?: Maybe<Scalars['String']['output']>;
|
||||
koreaderSyncPercentageTolerance?: Maybe<Scalars['Float']['output']>;
|
||||
koreaderSyncServerUrl?: Maybe<Scalars['String']['output']>;
|
||||
koreaderSyncStrategy?: Maybe<KoreaderSyncStrategy>;
|
||||
koreaderSyncUserkey?: Maybe<Scalars['String']['output']>;
|
||||
koreaderSyncUsername?: Maybe<Scalars['String']['output']>;
|
||||
localSourcePath?: Maybe<Scalars['String']['output']>;
|
||||
maxLogFileSize?: Maybe<Scalars['String']['output']>;
|
||||
maxLogFiles?: Maybe<Scalars['Int']['output']>;
|
||||
@@ -2105,6 +2236,16 @@ export type SettingsType = Settings & {
|
||||
gqlDebugLogsEnabled: Scalars['Boolean']['output'];
|
||||
initialOpenInBrowserEnabled: Scalars['Boolean']['output'];
|
||||
ip: Scalars['String']['output'];
|
||||
jwtAudience: Scalars['String']['output'];
|
||||
jwtRefreshExpiry: Scalars['Duration']['output'];
|
||||
jwtTokenExpiry: Scalars['Duration']['output'];
|
||||
koreaderSyncChecksumMethod: KoreaderSyncChecksumMethod;
|
||||
koreaderSyncDeviceId: Scalars['String']['output'];
|
||||
koreaderSyncPercentageTolerance: Scalars['Float']['output'];
|
||||
koreaderSyncServerUrl: Scalars['String']['output'];
|
||||
koreaderSyncStrategy: KoreaderSyncStrategy;
|
||||
koreaderSyncUserkey: Scalars['String']['output'];
|
||||
koreaderSyncUsername: Scalars['String']['output'];
|
||||
localSourcePath: Scalars['String']['output'];
|
||||
maxLogFileSize: Scalars['String']['output'];
|
||||
maxLogFiles: Scalars['Int']['output'];
|
||||
@@ -2226,6 +2367,7 @@ export type SourcePreferenceChangeInput = {
|
||||
|
||||
export type SourceType = {
|
||||
__typename?: 'SourceType';
|
||||
baseUrl?: Maybe<Scalars['String']['output']>;
|
||||
displayName: Scalars['String']['output'];
|
||||
extension: ExtensionType;
|
||||
filters: Array<Filter>;
|
||||
@@ -2362,12 +2504,19 @@ export type SwitchPreference = {
|
||||
__typename?: 'SwitchPreference';
|
||||
currentValue?: Maybe<Scalars['Boolean']['output']>;
|
||||
default: Scalars['Boolean']['output'];
|
||||
enabled: Scalars['Boolean']['output'];
|
||||
key: Scalars['String']['output'];
|
||||
summary?: Maybe<Scalars['String']['output']>;
|
||||
title?: Maybe<Scalars['String']['output']>;
|
||||
visible: Scalars['Boolean']['output'];
|
||||
};
|
||||
|
||||
export type SyncConflictInfoType = {
|
||||
__typename?: 'SyncConflictInfoType';
|
||||
deviceName: Scalars['String']['output'];
|
||||
remotePage: Scalars['Int']['output'];
|
||||
};
|
||||
|
||||
export type TextFilter = {
|
||||
__typename?: 'TextFilter';
|
||||
default: Scalars['String']['output'];
|
||||
@@ -2994,7 +3143,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, 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, 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: any, jwtRefreshExpiry: any, 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, downloadConversions: Array<{ __typename?: 'SettingsDownloadConversionType', mimeType: string, target: string, compressionLevel?: number | null }> };
|
||||
|
||||
export type SourceMetaFieldsFragment = { __typename?: 'SourceMetaType', sourceId: string, key: string, value: string };
|
||||
|
||||
@@ -3356,14 +3505,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, 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, 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: any, jwtRefreshExpiry: any, 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, 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, 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, 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: any, jwtRefreshExpiry: any, 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, downloadConversions: Array<{ __typename?: 'SettingsDownloadConversionType', mimeType: string, target: string, compressionLevel?: number | null }> } } };
|
||||
|
||||
export type GetSourceMangasFetchMutationVariables = Exact<{
|
||||
input: FetchSourceMangaInput;
|
||||
@@ -3456,6 +3605,21 @@ export type StopUpdaterMutationVariables = Exact<{
|
||||
|
||||
export type StopUpdaterMutation = { __typename?: 'Mutation', updateStop: { __typename?: 'UpdateStopPayload', clientMutationId?: string | null } };
|
||||
|
||||
export type UserLoginMutationVariables = Exact<{
|
||||
password: Scalars['String']['input'];
|
||||
username: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
|
||||
export type UserLoginMutation = { __typename?: 'Mutation', login: { __typename?: 'LoginPayload', accessToken: string, refreshToken: string } };
|
||||
|
||||
export type UserRefreshMutationVariables = Exact<{
|
||||
refreshToken: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
|
||||
export type UserRefreshMutation = { __typename?: 'Mutation', refreshToken: { __typename?: 'RefreshTokenPayload', accessToken: string } };
|
||||
|
||||
export type ValidateBackupQueryVariables = Exact<{
|
||||
backup: Scalars['Upload']['input'];
|
||||
}>;
|
||||
@@ -3747,7 +3911,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, 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, 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: any, jwtRefreshExpiry: any, 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, downloadConversions: Array<{ __typename?: 'SettingsDownloadConversionType', mimeType: string, target: string, compressionLevel?: number | null }> } };
|
||||
|
||||
export type GetSourceBrowseQueryVariables = Exact<{
|
||||
id: Scalars['LongString']['input'];
|
||||
|
||||
26
src/lib/graphql/mutations/UserMutation.ts
Normal file
26
src/lib/graphql/mutations/UserMutation.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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 USER_LOGIN = gql`
|
||||
mutation USER_LOGIN($password: String!, $username: String!) {
|
||||
login(input: { password: $password, username: $username }) {
|
||||
accessToken
|
||||
refreshToken
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const USER_REFRESH = gql`
|
||||
mutation USER_REFRESH($refreshToken: String!) {
|
||||
refreshToken(input: { refreshToken: $refreshToken }) {
|
||||
accessToken
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -212,6 +212,10 @@ import {
|
||||
GetExtensionQuery,
|
||||
GetExtensionQueryVariables,
|
||||
DownloaderState,
|
||||
UserLoginMutation,
|
||||
UserLoginMutationVariables,
|
||||
UserRefreshMutation,
|
||||
UserRefreshMutationVariables,
|
||||
} 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';
|
||||
@@ -327,6 +331,8 @@ import { CHAPTER_META_FIELDS } from '@/lib/graphql/fragments/ChapterFragments.ts
|
||||
import { MetadataMigrationSettings } from '@/features/migration/Migration.types.ts';
|
||||
import { MangaIdInfo } from '@/features/manga/Manga.types.ts';
|
||||
import { updateMetadataList } from '@/features/metadata/services/MetadataApolloCacheHandler.ts';
|
||||
import { USER_LOGIN, USER_REFRESH } from '@/lib/graphql/mutations/UserMutation.ts';
|
||||
import { AuthManager } from '@/features/authentication/AuthManager.ts';
|
||||
|
||||
enum GQLMethod {
|
||||
QUERY = 'QUERY',
|
||||
@@ -434,9 +440,9 @@ export const SPECIAL_ED_SOURCES = {
|
||||
export class RequestManager {
|
||||
public static readonly API_VERSION = '/api/v1/';
|
||||
|
||||
public readonly graphQLClient = new GraphQLClient();
|
||||
public readonly graphQLClient = new GraphQLClient(this.refreshUser.bind(this));
|
||||
|
||||
private readonly restClient: RestClient = new RestClient();
|
||||
private readonly restClient: RestClient = new RestClient(this.refreshUser.bind(this));
|
||||
|
||||
private readonly cache = new CustomCache();
|
||||
|
||||
@@ -452,6 +458,8 @@ export class RequestManager {
|
||||
}
|
||||
|
||||
public reset(): void {
|
||||
AuthManager.setAuthRequired(null);
|
||||
AuthManager.removeTokens();
|
||||
this.graphQLClient.client.resetStore();
|
||||
this.graphQLClient.terminateSubscriptions();
|
||||
this.cache.clear();
|
||||
@@ -1020,7 +1028,7 @@ export class RequestManager {
|
||||
} = {},
|
||||
): ImageRequest {
|
||||
const finalOptions = {
|
||||
useFetchApi: false,
|
||||
useFetchApi: AuthManager.isAuthRequired(),
|
||||
shouldDecode: false,
|
||||
disableCors: false,
|
||||
...Object.fromEntries(Object.entries(options).filter(([, value]) => value !== undefined)),
|
||||
@@ -3231,6 +3239,24 @@ export class RequestManager {
|
||||
options,
|
||||
);
|
||||
}
|
||||
|
||||
public useLoginUser(
|
||||
options?: MutationHookOptions<UserLoginMutation, UserLoginMutationVariables>,
|
||||
): AbortableApolloUseMutationResponse<UserLoginMutation, UserLoginMutationVariables> {
|
||||
return this.doRequest(GQLMethod.USE_MUTATION, USER_LOGIN, undefined, options);
|
||||
}
|
||||
|
||||
public refreshUser(
|
||||
refreshToken: string,
|
||||
options?: MutationOptions<UserRefreshMutation, UserRefreshMutationVariables>,
|
||||
): AbortableApolloMutationResponse<UserRefreshMutation> {
|
||||
return this.doRequest<UserRefreshMutation, UserRefreshMutationVariables>(
|
||||
GQLMethod.MUTATION,
|
||||
USER_REFRESH,
|
||||
{ refreshToken: refreshToken ?? undefined },
|
||||
options,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export const requestManager = new RequestManager();
|
||||
|
||||
@@ -7,12 +7,60 @@
|
||||
*/
|
||||
|
||||
import { AppStorage } from '@/lib/storage/AppStorage.ts';
|
||||
import { UserRefreshMutation } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { AuthManager } from '@/features/authentication/AuthManager.ts';
|
||||
import { AbortableApolloMutationResponse } from '@/lib/requests/RequestManager.ts';
|
||||
|
||||
export abstract class BaseClient<Client, ClientConfig, Fetcher> {
|
||||
protected abstract client: Client;
|
||||
|
||||
public abstract readonly fetcher: Fetcher;
|
||||
|
||||
private static activeTokenRefreshPromise: Promise<UserRefreshMutation | null | undefined> | null = null;
|
||||
|
||||
protected static async refreshAccessToken(
|
||||
refreshFn: (refreshToken: string) => AbortableApolloMutationResponse<UserRefreshMutation>,
|
||||
): Promise<UserRefreshMutation | null | undefined> {
|
||||
const refreshToken = AuthManager.getRefreshToken();
|
||||
|
||||
if (!AuthManager.isAuthRequired()) {
|
||||
AuthManager.setAuthRequired(true);
|
||||
}
|
||||
|
||||
if (!refreshToken) {
|
||||
throw new Error('No refresh token found');
|
||||
}
|
||||
|
||||
if (this.activeTokenRefreshPromise) {
|
||||
return this.activeTokenRefreshPromise;
|
||||
}
|
||||
|
||||
const refreshRequest = refreshFn(refreshToken).response;
|
||||
this.activeTokenRefreshPromise = refreshRequest.then((result) => result.data);
|
||||
|
||||
try {
|
||||
const result = await refreshRequest;
|
||||
const { data } = result;
|
||||
|
||||
if (!data) {
|
||||
throw new Error('No refreshed access token returned');
|
||||
}
|
||||
|
||||
AuthManager.setAccessToken(data.refreshToken.accessToken);
|
||||
|
||||
return data;
|
||||
} catch (e) {
|
||||
AuthManager.removeTokens();
|
||||
throw e;
|
||||
} finally {
|
||||
this.activeTokenRefreshPromise = null;
|
||||
}
|
||||
}
|
||||
|
||||
protected constructor(
|
||||
protected handleRefreshToken: (refreshToken: string) => AbortableApolloMutationResponse<UserRefreshMutation>,
|
||||
) {}
|
||||
|
||||
public getBaseUrl(): string {
|
||||
const { hostname, port, protocol } = window.location;
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { onError } from '@apollo/client/link/error';
|
||||
import { setContext } from '@apollo/client/link/context';
|
||||
import {
|
||||
ApolloClient,
|
||||
ApolloClientOptions,
|
||||
@@ -14,6 +16,7 @@ import {
|
||||
NormalizedCacheObject,
|
||||
split,
|
||||
from,
|
||||
fromPromise,
|
||||
} from '@apollo/client';
|
||||
import createUploadLink from 'apollo-upload-client/createUploadLink.mjs';
|
||||
import { GraphQLWsLink } from '@apollo/client/link/subscriptions';
|
||||
@@ -23,6 +26,9 @@ import { TypePolicies } from '@apollo/client/cache';
|
||||
import { removeTypenameFromVariables } from '@apollo/client/link/remove-typename';
|
||||
import { BaseClient } from '@/lib/requests/client/BaseClient.ts';
|
||||
import { StrictTypedTypePolicies } from '@/lib/graphql/generated/apollo-helpers.ts';
|
||||
import { AuthManager } from '@/features/authentication/AuthManager.ts';
|
||||
import { UserRefreshMutation } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { AbortableApolloMutationResponse } from '@/lib/requests/RequestManager.ts';
|
||||
|
||||
/* eslint-disable no-underscore-dangle */
|
||||
const typePolicies: StrictTypedTypePolicies = {
|
||||
@@ -187,8 +193,8 @@ export class GraphQLClient extends BaseClient<
|
||||
|
||||
private wsClient!: Client;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
constructor(handleRefreshToken: (refreshToken: string) => AbortableApolloMutationResponse<UserRefreshMutation>) {
|
||||
super(handleRefreshToken);
|
||||
|
||||
this.createClient();
|
||||
}
|
||||
@@ -201,8 +207,44 @@ export class GraphQLClient extends BaseClient<
|
||||
this.wsClient.terminate();
|
||||
}
|
||||
|
||||
private createErrorLink() {
|
||||
return onError(({ graphQLErrors, operation, forward }) => {
|
||||
if (!graphQLErrors) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const isAuthError = graphQLErrors.some((graphQLError) =>
|
||||
graphQLError.message.includes('suwayomi.tachidesk.server.user.UnauthorizedException'),
|
||||
);
|
||||
if (!isAuthError) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return fromPromise(BaseClient.refreshAccessToken(this.handleRefreshToken))
|
||||
.filter(Boolean)
|
||||
.flatMap(() => forward(operation));
|
||||
});
|
||||
}
|
||||
|
||||
private createAuthLink() {
|
||||
return setContext((_, { headers }) => {
|
||||
const isAuthRequired = AuthManager.isAuthRequired();
|
||||
const accessToken = AuthManager.getAccessToken();
|
||||
|
||||
return {
|
||||
headers: {
|
||||
credentials: 'include',
|
||||
...headers,
|
||||
Authorization: isAuthRequired && accessToken ? `Bearer ${accessToken}` : '',
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
private createUploadLink() {
|
||||
return createUploadLink({ uri: () => this.getBaseUrl(), credentials: 'include' });
|
||||
return createUploadLink({
|
||||
uri: () => this.getBaseUrl(),
|
||||
});
|
||||
}
|
||||
|
||||
private createWSLink() {
|
||||
@@ -218,8 +260,13 @@ export class GraphQLClient extends BaseClient<
|
||||
return definition.kind === 'OperationDefinition' && definition.operation === 'subscription';
|
||||
},
|
||||
this.createWSLink(),
|
||||
// apollo-upload-client dependency is outdated (see 134e47763faae9e62db4d4e3a8387a74e32e5568) and thus types are not matching, but they are still correct
|
||||
from([removeTypenameLink, this.createUploadLink() as unknown as ApolloLink]),
|
||||
from([
|
||||
this.createErrorLink(),
|
||||
this.createAuthLink(),
|
||||
removeTypenameLink,
|
||||
// apollo-upload-client dependency is outdated (see 134e47763faae9e62db4d4e3a8387a74e32e5568) and thus types are not matching, but they are still correct
|
||||
this.createUploadLink() as unknown as ApolloLink,
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -230,6 +277,14 @@ export class GraphQLClient extends BaseClient<
|
||||
url: () => this.getBaseUrl().replace(/http(|s)/g, 'ws'),
|
||||
keepAlive: heartbeatInterval,
|
||||
retryAttempts: 10,
|
||||
connectionParams: () => {
|
||||
const isAuthRequired = AuthManager.isAuthRequired();
|
||||
const accessToken = AuthManager.getAccessToken();
|
||||
|
||||
return {
|
||||
Authorization: isAuthRequired && accessToken ? accessToken : undefined,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
let lastHeartbeat: number = 0;
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
*/
|
||||
|
||||
import { BaseClient } from '@/lib/requests/client/BaseClient.ts';
|
||||
import { AuthManager } from '@/features/authentication/AuthManager.ts';
|
||||
import { UserRefreshMutation } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { AbortableApolloMutationResponse } from '@/lib/requests/RequestManager.ts';
|
||||
|
||||
export enum HttpMethod {
|
||||
GET = 'GET',
|
||||
@@ -48,17 +51,28 @@ export class RestClient
|
||||
} = {},
|
||||
): Promise<Response> => {
|
||||
const updatedUrl = url.startsWith('http') ? url : `${this.getBaseUrl()}${url}`;
|
||||
const accessToken = AuthManager.getAccessToken();
|
||||
|
||||
let result: Response;
|
||||
|
||||
switch (httpMethod) {
|
||||
case HttpMethod.GET:
|
||||
result = await this.client(updatedUrl, { ...this.config, ...config, method: httpMethod });
|
||||
result = await this.client(updatedUrl, {
|
||||
...this.config,
|
||||
...config,
|
||||
method: httpMethod,
|
||||
headers: {
|
||||
...(accessToken ? { Authorization: `Bearer ${accessToken}` } : {}),
|
||||
...this.config.headers,
|
||||
...config?.headers,
|
||||
},
|
||||
});
|
||||
break;
|
||||
case HttpMethod.POST:
|
||||
case HttpMethod.PATCH:
|
||||
case HttpMethod.DELETE:
|
||||
result = await this.client(updatedUrl, {
|
||||
...(accessToken ? { Authorization: `Bearer ${accessToken}` } : {}),
|
||||
...this.config,
|
||||
...config,
|
||||
method: httpMethod,
|
||||
@@ -69,6 +83,11 @@ export class RestClient
|
||||
throw new Error(`Unexpected HttpMethod "${httpMethod}"`);
|
||||
}
|
||||
|
||||
if (result.status === 401) {
|
||||
await BaseClient.refreshAccessToken(this.handleRefreshToken);
|
||||
return this.fetcher(url, { data, httpMethod, config, checkResponseIsJson });
|
||||
}
|
||||
|
||||
if (result.status !== 200) {
|
||||
throw new Error(`status ${result.status}: ${result.statusText}`);
|
||||
}
|
||||
@@ -80,8 +99,8 @@ export class RestClient
|
||||
return result;
|
||||
};
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
constructor(handleRefreshToken: (refreshToken: string) => AbortableApolloMutationResponse<UserRefreshMutation>) {
|
||||
super(handleRefreshToken);
|
||||
|
||||
this.createClient();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user