feature: add subscription manage
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
/* eslint-disable */
|
||||
import type {
|
||||
DocumentTypeDecoration,
|
||||
ResultOf,
|
||||
TypedDocumentNode,
|
||||
} from '@graphql-typed-document-node/core';
|
||||
import type { FragmentDefinitionNode } from 'graphql';
|
||||
import type { Incremental } from './graphql';
|
||||
import { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core';
|
||||
import { FragmentDefinitionNode } from 'graphql';
|
||||
import { Incremental } from './graphql';
|
||||
|
||||
export type FragmentType<
|
||||
TDocumentType extends DocumentTypeDecoration<any, any>,
|
||||
> = TDocumentType extends DocumentTypeDecoration<infer TType, any>
|
||||
|
||||
export type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<
|
||||
infer TType,
|
||||
any
|
||||
>
|
||||
? [TType] extends [{ ' $fragmentName'?: infer TKey }]
|
||||
? TKey extends string
|
||||
? { ' $fragmentRefs'?: { [key in TKey]: TType } }
|
||||
@@ -35,10 +33,7 @@ export function useFragment<TType>(
|
||||
// return nullable if `fragmentType` is nullable or undefined
|
||||
export function useFragment<TType>(
|
||||
_documentNode: DocumentTypeDecoration<TType, any>,
|
||||
fragmentType:
|
||||
| FragmentType<DocumentTypeDecoration<TType, any>>
|
||||
| null
|
||||
| undefined
|
||||
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null | undefined
|
||||
): TType | null | undefined;
|
||||
// return array of non-nullable if `fragmentType` is array of non-nullable
|
||||
export function useFragment<TType>(
|
||||
@@ -48,10 +43,7 @@ export function useFragment<TType>(
|
||||
// return array of nullable if `fragmentType` is array of nullable
|
||||
export function useFragment<TType>(
|
||||
_documentNode: DocumentTypeDecoration<TType, any>,
|
||||
fragmentType:
|
||||
| Array<FragmentType<DocumentTypeDecoration<TType, any>>>
|
||||
| null
|
||||
| undefined
|
||||
fragmentType: Array<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
|
||||
): Array<TType> | null | undefined;
|
||||
// return readonly array of non-nullable if `fragmentType` is array of non-nullable
|
||||
export function useFragment<TType>(
|
||||
@@ -61,50 +53,35 @@ export function useFragment<TType>(
|
||||
// return readonly array of nullable if `fragmentType` is array of nullable
|
||||
export function useFragment<TType>(
|
||||
_documentNode: DocumentTypeDecoration<TType, any>,
|
||||
fragmentType:
|
||||
| ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>
|
||||
| null
|
||||
| undefined
|
||||
fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
|
||||
): ReadonlyArray<TType> | null | undefined;
|
||||
export function useFragment<TType>(
|
||||
_documentNode: DocumentTypeDecoration<TType, any>,
|
||||
fragmentType:
|
||||
| FragmentType<DocumentTypeDecoration<TType, any>>
|
||||
| Array<FragmentType<DocumentTypeDecoration<TType, any>>>
|
||||
| ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>
|
||||
| null
|
||||
| undefined
|
||||
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | Array<FragmentType<DocumentTypeDecoration<TType, any>>> | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
|
||||
): TType | Array<TType> | ReadonlyArray<TType> | null | undefined {
|
||||
return fragmentType as any;
|
||||
}
|
||||
|
||||
|
||||
export function makeFragmentData<
|
||||
F extends DocumentTypeDecoration<any, any>,
|
||||
FT extends ResultOf<F>,
|
||||
FT extends ResultOf<F>
|
||||
>(data: FT, _fragment: F): FragmentType<F> {
|
||||
return data as FragmentType<F>;
|
||||
}
|
||||
export function isFragmentReady<TQuery, TFrag>(
|
||||
queryNode: DocumentTypeDecoration<TQuery, any>,
|
||||
fragmentNode: TypedDocumentNode<TFrag>,
|
||||
data:
|
||||
| FragmentType<TypedDocumentNode<Incremental<TFrag>, any>>
|
||||
| null
|
||||
| undefined
|
||||
data: FragmentType<TypedDocumentNode<Incremental<TFrag>, any>> | null | undefined
|
||||
): data is FragmentType<typeof fragmentNode> {
|
||||
const deferredFields = (
|
||||
queryNode as {
|
||||
__meta__?: { deferredFields: Record<string, (keyof TFrag)[]> };
|
||||
}
|
||||
).__meta__?.deferredFields;
|
||||
const deferredFields = (queryNode as { __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> } }).__meta__
|
||||
?.deferredFields;
|
||||
|
||||
if (!deferredFields) return true;
|
||||
|
||||
const fragDef = fragmentNode.definitions[0] as
|
||||
| FragmentDefinitionNode
|
||||
| undefined;
|
||||
const fragDef = fragmentNode.definitions[0] as FragmentDefinitionNode | undefined;
|
||||
const fragName = fragDef?.name?.value;
|
||||
|
||||
const fields = (fragName && deferredFields[fragName]) || [];
|
||||
return fields.length > 0 && fields.every((field) => data && field in data);
|
||||
return fields.length > 0 && fields.every(field => data && field in data);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
|
||||
/* eslint-disable */
|
||||
import * as types from './graphql';
|
||||
import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
|
||||
|
||||
/**
|
||||
* Map of all GraphQL operations in the project.
|
||||
@@ -14,14 +14,18 @@ import * as types from './graphql';
|
||||
* Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size
|
||||
*/
|
||||
type Documents = {
|
||||
'\n mutation CreateSubscription($input: SubscriptionsInsertInput!) {\n subscriptionsCreateOne(data: $input) {\n id\n displayName\n sourceUrl\n enabled\n category\n subscriberId\n }\n }\n': typeof types.CreateSubscriptionDocument;
|
||||
'\n query GetSubscriptions($page: Int!, $pageSize: Int!) {\n subscriptions(\n pagination: {\n page: {\n page: $page,\n limit: $pageSize\n }\n }\n ) {\n nodes {\n id\n displayName\n category\n enabled\n bangumi {\n nodes {\n id\n displayName\n posterLink\n season\n fansub\n homepage\n }\n }\n }\n }\n }\n': typeof types.GetSubscriptionsDocument;
|
||||
"\n query GetSubscriptions(\n $page: PageInput!,\n $filters: SubscriptionsFilterInput!,\n $orderBy: SubscriptionsOrderInput!\n) {\n subscriptions(\n pagination: {\n page: $page\n }\n filters: $filters\n orderBy: $orderBy\n ) {\n nodes {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n }\n paginationInfo {\n total\n pages\n }\n }\n }\n": typeof types.GetSubscriptionsDocument,
|
||||
"\n mutation UpdateSubscriptions(\n $data: SubscriptionsUpdateInput!,\n $filters: SubscriptionsFilterInput!,\n ) {\n subscriptionsUpdate (\n data: $data\n filter: $filters\n ) {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n }\n}\n": typeof types.UpdateSubscriptionsDocument,
|
||||
"\n mutation DeleteSubscriptions($filters: SubscriptionsFilterInput) {\n subscriptionsDelete(filter: $filters)\n }\n": typeof types.DeleteSubscriptionsDocument,
|
||||
"\nquery GetSubscriptionDetail ($id: Int!) {\n subscriptions(filters: { id: {\n eq: $id\n } }) {\n nodes {\n id\n displayName\n createdAt\n updatedAt\n category\n sourceUrl\n enabled\n bangumi {\n nodes {\n createdAt\n updatedAt\n id\n mikanBangumiId\n displayName\n rawName\n season\n seasonRaw\n fansub\n mikanFansubId\n rssLink\n posterLink\n savePath\n deleted\n homepage\n }\n }\n }\n }\n}\n": typeof types.GetSubscriptionDetailDocument,
|
||||
"\n mutation CreateSubscription($input: SubscriptionsInsertInput!) {\n subscriptionsCreateOne(data: $input) {\n id\n displayName\n sourceUrl\n enabled\n category\n }\n }\n": typeof types.CreateSubscriptionDocument,
|
||||
};
|
||||
const documents: Documents = {
|
||||
'\n mutation CreateSubscription($input: SubscriptionsInsertInput!) {\n subscriptionsCreateOne(data: $input) {\n id\n displayName\n sourceUrl\n enabled\n category\n subscriberId\n }\n }\n':
|
||||
types.CreateSubscriptionDocument,
|
||||
'\n query GetSubscriptions($page: Int!, $pageSize: Int!) {\n subscriptions(\n pagination: {\n page: {\n page: $page,\n limit: $pageSize\n }\n }\n ) {\n nodes {\n id\n displayName\n category\n enabled\n bangumi {\n nodes {\n id\n displayName\n posterLink\n season\n fansub\n homepage\n }\n }\n }\n }\n }\n':
|
||||
types.GetSubscriptionsDocument,
|
||||
"\n query GetSubscriptions(\n $page: PageInput!,\n $filters: SubscriptionsFilterInput!,\n $orderBy: SubscriptionsOrderInput!\n) {\n subscriptions(\n pagination: {\n page: $page\n }\n filters: $filters\n orderBy: $orderBy\n ) {\n nodes {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n }\n paginationInfo {\n total\n pages\n }\n }\n }\n": types.GetSubscriptionsDocument,
|
||||
"\n mutation UpdateSubscriptions(\n $data: SubscriptionsUpdateInput!,\n $filters: SubscriptionsFilterInput!,\n ) {\n subscriptionsUpdate (\n data: $data\n filter: $filters\n ) {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n }\n}\n": types.UpdateSubscriptionsDocument,
|
||||
"\n mutation DeleteSubscriptions($filters: SubscriptionsFilterInput) {\n subscriptionsDelete(filter: $filters)\n }\n": types.DeleteSubscriptionsDocument,
|
||||
"\nquery GetSubscriptionDetail ($id: Int!) {\n subscriptions(filters: { id: {\n eq: $id\n } }) {\n nodes {\n id\n displayName\n createdAt\n updatedAt\n category\n sourceUrl\n enabled\n bangumi {\n nodes {\n createdAt\n updatedAt\n id\n mikanBangumiId\n displayName\n rawName\n season\n seasonRaw\n fansub\n mikanFansubId\n rssLink\n posterLink\n savePath\n deleted\n homepage\n }\n }\n }\n }\n}\n": types.GetSubscriptionDetailDocument,
|
||||
"\n mutation CreateSubscription($input: SubscriptionsInsertInput!) {\n subscriptionsCreateOne(data: $input) {\n id\n displayName\n sourceUrl\n enabled\n category\n }\n }\n": types.CreateSubscriptionDocument,
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -41,19 +45,26 @@ export function gql(source: string): unknown;
|
||||
/**
|
||||
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function gql(
|
||||
source: '\n mutation CreateSubscription($input: SubscriptionsInsertInput!) {\n subscriptionsCreateOne(data: $input) {\n id\n displayName\n sourceUrl\n enabled\n category\n subscriberId\n }\n }\n'
|
||||
): (typeof documents)['\n mutation CreateSubscription($input: SubscriptionsInsertInput!) {\n subscriptionsCreateOne(data: $input) {\n id\n displayName\n sourceUrl\n enabled\n category\n subscriberId\n }\n }\n'];
|
||||
export function gql(source: "\n query GetSubscriptions(\n $page: PageInput!,\n $filters: SubscriptionsFilterInput!,\n $orderBy: SubscriptionsOrderInput!\n) {\n subscriptions(\n pagination: {\n page: $page\n }\n filters: $filters\n orderBy: $orderBy\n ) {\n nodes {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n }\n paginationInfo {\n total\n pages\n }\n }\n }\n"): (typeof documents)["\n query GetSubscriptions(\n $page: PageInput!,\n $filters: SubscriptionsFilterInput!,\n $orderBy: SubscriptionsOrderInput!\n) {\n subscriptions(\n pagination: {\n page: $page\n }\n filters: $filters\n orderBy: $orderBy\n ) {\n nodes {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n }\n paginationInfo {\n total\n pages\n }\n }\n }\n"];
|
||||
/**
|
||||
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function gql(
|
||||
source: '\n query GetSubscriptions($page: Int!, $pageSize: Int!) {\n subscriptions(\n pagination: {\n page: {\n page: $page,\n limit: $pageSize\n }\n }\n ) {\n nodes {\n id\n displayName\n category\n enabled\n bangumi {\n nodes {\n id\n displayName\n posterLink\n season\n fansub\n homepage\n }\n }\n }\n }\n }\n'
|
||||
): (typeof documents)['\n query GetSubscriptions($page: Int!, $pageSize: Int!) {\n subscriptions(\n pagination: {\n page: {\n page: $page,\n limit: $pageSize\n }\n }\n ) {\n nodes {\n id\n displayName\n category\n enabled\n bangumi {\n nodes {\n id\n displayName\n posterLink\n season\n fansub\n homepage\n }\n }\n }\n }\n }\n'];
|
||||
export function gql(source: "\n mutation UpdateSubscriptions(\n $data: SubscriptionsUpdateInput!,\n $filters: SubscriptionsFilterInput!,\n ) {\n subscriptionsUpdate (\n data: $data\n filter: $filters\n ) {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n }\n}\n"): (typeof documents)["\n mutation UpdateSubscriptions(\n $data: SubscriptionsUpdateInput!,\n $filters: SubscriptionsFilterInput!,\n ) {\n subscriptionsUpdate (\n data: $data\n filter: $filters\n ) {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n }\n}\n"];
|
||||
/**
|
||||
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function gql(source: "\n mutation DeleteSubscriptions($filters: SubscriptionsFilterInput) {\n subscriptionsDelete(filter: $filters)\n }\n"): (typeof documents)["\n mutation DeleteSubscriptions($filters: SubscriptionsFilterInput) {\n subscriptionsDelete(filter: $filters)\n }\n"];
|
||||
/**
|
||||
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function gql(source: "\nquery GetSubscriptionDetail ($id: Int!) {\n subscriptions(filters: { id: {\n eq: $id\n } }) {\n nodes {\n id\n displayName\n createdAt\n updatedAt\n category\n sourceUrl\n enabled\n bangumi {\n nodes {\n createdAt\n updatedAt\n id\n mikanBangumiId\n displayName\n rawName\n season\n seasonRaw\n fansub\n mikanFansubId\n rssLink\n posterLink\n savePath\n deleted\n homepage\n }\n }\n }\n }\n}\n"): (typeof documents)["\nquery GetSubscriptionDetail ($id: Int!) {\n subscriptions(filters: { id: {\n eq: $id\n } }) {\n nodes {\n id\n displayName\n createdAt\n updatedAt\n category\n sourceUrl\n enabled\n bangumi {\n nodes {\n createdAt\n updatedAt\n id\n mikanBangumiId\n displayName\n rawName\n season\n seasonRaw\n fansub\n mikanFansubId\n rssLink\n posterLink\n savePath\n deleted\n homepage\n }\n }\n }\n }\n}\n"];
|
||||
/**
|
||||
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function gql(source: "\n mutation CreateSubscription($input: SubscriptionsInsertInput!) {\n subscriptionsCreateOne(data: $input) {\n id\n displayName\n sourceUrl\n enabled\n category\n }\n }\n"): (typeof documents)["\n mutation CreateSubscription($input: SubscriptionsInsertInput!) {\n subscriptionsCreateOne(data: $input) {\n id\n displayName\n sourceUrl\n enabled\n category\n }\n }\n"];
|
||||
|
||||
export function gql(source: string) {
|
||||
return (documents as any)[source] ?? {};
|
||||
}
|
||||
|
||||
export type DocumentType<TDocumentNode extends DocumentNode<any, any>> =
|
||||
TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;
|
||||
export type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode< infer TType, any> ? TType : never;
|
||||
@@ -1,32 +1,19 @@
|
||||
/* eslint-disable */
|
||||
import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
|
||||
import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
|
||||
export type Maybe<T> = T | null;
|
||||
export type InputMaybe<T> = Maybe<T>;
|
||||
export type Exact<T extends { [key: string]: unknown }> = {
|
||||
[K in keyof T]: T[K];
|
||||
};
|
||||
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
|
||||
[SubKey in K]?: Maybe<T[SubKey]>;
|
||||
};
|
||||
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
|
||||
[SubKey in K]: Maybe<T[SubKey]>;
|
||||
};
|
||||
export type MakeEmpty<
|
||||
T extends { [key: string]: unknown },
|
||||
K extends keyof T,
|
||||
> = { [_ in K]?: never };
|
||||
export type Incremental<T> =
|
||||
| T
|
||||
| {
|
||||
[P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never;
|
||||
};
|
||||
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
|
||||
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
|
||||
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
|
||||
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
|
||||
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
|
||||
/** All built-in and custom scalars, mapped to their actual values */
|
||||
export type Scalars = {
|
||||
ID: { input: string; output: string };
|
||||
String: { input: string; output: string };
|
||||
Boolean: { input: boolean; output: boolean };
|
||||
Int: { input: number; output: number };
|
||||
Float: { input: number; output: number };
|
||||
ID: { input: string; output: string; }
|
||||
String: { input: string; output: string; }
|
||||
Boolean: { input: boolean; output: boolean; }
|
||||
Int: { input: number; output: number; }
|
||||
Float: { input: number; output: number; }
|
||||
};
|
||||
|
||||
export type Bangumi = {
|
||||
@@ -53,18 +40,21 @@ export type Bangumi = {
|
||||
updatedAt: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
|
||||
export type BangumiEpisodeArgs = {
|
||||
filters?: InputMaybe<EpisodesFilterInput>;
|
||||
orderBy?: InputMaybe<EpisodesOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type BangumiSubscriptionArgs = {
|
||||
filters?: InputMaybe<SubscriptionsFilterInput>;
|
||||
orderBy?: InputMaybe<SubscriptionsOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type BangumiSubscriptionBangumiArgs = {
|
||||
filters?: InputMaybe<SubscriptionBangumiFilterInput>;
|
||||
orderBy?: InputMaybe<SubscriptionBangumiOrderInput>;
|
||||
@@ -203,7 +193,7 @@ export type CursorInput = {
|
||||
|
||||
export enum DownloadMimeEnum {
|
||||
Applicationoctetstream = 'applicationoctetstream',
|
||||
Applicationxbittorrent = 'applicationxbittorrent',
|
||||
Applicationxbittorrent = 'applicationxbittorrent'
|
||||
}
|
||||
|
||||
export type DownloadMimeEnumFilterInput = {
|
||||
@@ -225,7 +215,7 @@ export enum DownloadStatusEnum {
|
||||
Downloading = 'downloading',
|
||||
Failed = 'failed',
|
||||
Paused = 'paused',
|
||||
Pending = 'pending',
|
||||
Pending = 'pending'
|
||||
}
|
||||
|
||||
export type DownloadStatusEnumFilterInput = {
|
||||
@@ -243,7 +233,7 @@ export type DownloadStatusEnumFilterInput = {
|
||||
|
||||
export enum DownloaderCategoryEnum {
|
||||
Dandanplay = 'dandanplay',
|
||||
Qbittorrent = 'qbittorrent',
|
||||
Qbittorrent = 'qbittorrent'
|
||||
}
|
||||
|
||||
export type DownloaderCategoryEnumFilterInput = {
|
||||
@@ -274,6 +264,7 @@ export type Downloaders = {
|
||||
username: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
|
||||
export type DownloadersDownloadArgs = {
|
||||
filters?: InputMaybe<DownloadsFilterInput>;
|
||||
orderBy?: InputMaybe<DownloadsOrderInput>;
|
||||
@@ -510,18 +501,21 @@ export type Episodes = {
|
||||
updatedAt: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
|
||||
export type EpisodesDownloadArgs = {
|
||||
filters?: InputMaybe<SubscriptionsFilterInput>;
|
||||
orderBy?: InputMaybe<SubscriptionsOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type EpisodesSubscriptionArgs = {
|
||||
filters?: InputMaybe<DownloadsFilterInput>;
|
||||
orderBy?: InputMaybe<DownloadsOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type EpisodesSubscriptionEpisodeArgs = {
|
||||
filters?: InputMaybe<SubscriptionEpisodeFilterInput>;
|
||||
orderBy?: InputMaybe<SubscriptionEpisodeOrderInput>;
|
||||
@@ -702,120 +696,148 @@ export type Mutation = {
|
||||
subscriptionsUpdate: Array<SubscriptionsBasic>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationBangumiCreateBatchArgs = {
|
||||
data: Array<BangumiInsertInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationBangumiCreateOneArgs = {
|
||||
data: BangumiInsertInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationBangumiDeleteArgs = {
|
||||
filter?: InputMaybe<BangumiFilterInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationBangumiUpdateArgs = {
|
||||
data: BangumiUpdateInput;
|
||||
filter?: InputMaybe<BangumiFilterInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDownloadersCreateBatchArgs = {
|
||||
data: Array<DownloadersInsertInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDownloadersCreateOneArgs = {
|
||||
data: DownloadersInsertInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDownloadersDeleteArgs = {
|
||||
filter?: InputMaybe<DownloadersFilterInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDownloadersUpdateArgs = {
|
||||
data: DownloadersUpdateInput;
|
||||
filter?: InputMaybe<DownloadersFilterInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDownloadsCreateBatchArgs = {
|
||||
data: Array<DownloadsInsertInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDownloadsCreateOneArgs = {
|
||||
data: DownloadsInsertInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDownloadsDeleteArgs = {
|
||||
filter?: InputMaybe<DownloadsFilterInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationDownloadsUpdateArgs = {
|
||||
data: DownloadsUpdateInput;
|
||||
filter?: InputMaybe<DownloadsFilterInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationEpisodesCreateBatchArgs = {
|
||||
data: Array<EpisodesInsertInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationEpisodesCreateOneArgs = {
|
||||
data: EpisodesInsertInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationEpisodesDeleteArgs = {
|
||||
filter?: InputMaybe<EpisodesFilterInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationEpisodesUpdateArgs = {
|
||||
data: EpisodesUpdateInput;
|
||||
filter?: InputMaybe<EpisodesFilterInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriptionBangumiCreateBatchArgs = {
|
||||
data: Array<SubscriptionBangumiInsertInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriptionBangumiCreateOneArgs = {
|
||||
data: SubscriptionBangumiInsertInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriptionBangumiDeleteArgs = {
|
||||
filter?: InputMaybe<SubscriptionBangumiFilterInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriptionBangumiUpdateArgs = {
|
||||
data: SubscriptionBangumiUpdateInput;
|
||||
filter?: InputMaybe<SubscriptionBangumiFilterInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriptionEpisodeCreateBatchArgs = {
|
||||
data: Array<SubscriptionEpisodeInsertInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriptionEpisodeCreateOneArgs = {
|
||||
data: SubscriptionEpisodeInsertInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriptionEpisodeDeleteArgs = {
|
||||
filter?: InputMaybe<SubscriptionEpisodeFilterInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriptionEpisodeUpdateArgs = {
|
||||
data: SubscriptionEpisodeUpdateInput;
|
||||
filter?: InputMaybe<SubscriptionEpisodeFilterInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriptionsCreateBatchArgs = {
|
||||
data: Array<SubscriptionsInsertInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriptionsCreateOneArgs = {
|
||||
data: SubscriptionsInsertInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriptionsDeleteArgs = {
|
||||
filter?: InputMaybe<SubscriptionsFilterInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriptionsUpdateArgs = {
|
||||
data: SubscriptionsUpdateInput;
|
||||
filter?: InputMaybe<SubscriptionsFilterInput>;
|
||||
@@ -828,7 +850,7 @@ export type OffsetInput = {
|
||||
|
||||
export enum OrderByEnum {
|
||||
Asc = 'ASC',
|
||||
Desc = 'DESC',
|
||||
Desc = 'DESC'
|
||||
}
|
||||
|
||||
export type PageInfo = {
|
||||
@@ -871,52 +893,61 @@ export type Query = {
|
||||
subscriptions: SubscriptionsConnection;
|
||||
};
|
||||
|
||||
|
||||
export type Query_Sea_Orm_Entity_MetadataArgs = {
|
||||
table_name: Scalars['String']['input'];
|
||||
};
|
||||
|
||||
|
||||
export type QueryBangumiArgs = {
|
||||
filters?: InputMaybe<BangumiFilterInput>;
|
||||
orderBy?: InputMaybe<BangumiOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryDownloadersArgs = {
|
||||
filters?: InputMaybe<DownloadersFilterInput>;
|
||||
orderBy?: InputMaybe<DownloadersOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryDownloadsArgs = {
|
||||
filters?: InputMaybe<DownloadsFilterInput>;
|
||||
orderBy?: InputMaybe<DownloadsOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryEpisodesArgs = {
|
||||
filters?: InputMaybe<EpisodesFilterInput>;
|
||||
orderBy?: InputMaybe<EpisodesOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type QuerySubscribersArgs = {
|
||||
filters?: InputMaybe<SubscribersFilterInput>;
|
||||
orderBy?: InputMaybe<SubscribersOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type QuerySubscriptionBangumiArgs = {
|
||||
filters?: InputMaybe<SubscriptionBangumiFilterInput>;
|
||||
orderBy?: InputMaybe<SubscriptionBangumiOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type QuerySubscriptionEpisodeArgs = {
|
||||
filters?: InputMaybe<SubscriptionEpisodeFilterInput>;
|
||||
orderBy?: InputMaybe<SubscriptionEpisodeOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type QuerySubscriptionsArgs = {
|
||||
filters?: InputMaybe<SubscriptionsFilterInput>;
|
||||
orderBy?: InputMaybe<SubscriptionsOrderInput>;
|
||||
@@ -959,24 +990,28 @@ export type Subscribers = {
|
||||
updatedAt: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
|
||||
export type SubscribersBangumiArgs = {
|
||||
filters?: InputMaybe<BangumiFilterInput>;
|
||||
orderBy?: InputMaybe<BangumiOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type SubscribersDownloaderArgs = {
|
||||
filters?: InputMaybe<DownloadersFilterInput>;
|
||||
orderBy?: InputMaybe<DownloadersOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type SubscribersEpisodeArgs = {
|
||||
filters?: InputMaybe<EpisodesFilterInput>;
|
||||
orderBy?: InputMaybe<EpisodesOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type SubscribersSubscriptionArgs = {
|
||||
filters?: InputMaybe<SubscriptionsFilterInput>;
|
||||
orderBy?: InputMaybe<SubscriptionsOrderInput>;
|
||||
@@ -1073,7 +1108,7 @@ export type SubscriptionBangumiUpdateInput = {
|
||||
|
||||
export enum SubscriptionCategoryEnum {
|
||||
Manual = 'manual',
|
||||
Mikan = 'mikan',
|
||||
Mikan = 'mikan'
|
||||
}
|
||||
|
||||
export type SubscriptionCategoryEnumFilterInput = {
|
||||
@@ -1166,24 +1201,28 @@ export type Subscriptions = {
|
||||
updatedAt: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
|
||||
export type SubscriptionsBangumiArgs = {
|
||||
filters?: InputMaybe<BangumiFilterInput>;
|
||||
orderBy?: InputMaybe<BangumiOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type SubscriptionsEpisodeArgs = {
|
||||
filters?: InputMaybe<EpisodesFilterInput>;
|
||||
orderBy?: InputMaybe<EpisodesOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type SubscriptionsSubscriptionBangumiArgs = {
|
||||
filters?: InputMaybe<SubscriptionBangumiFilterInput>;
|
||||
orderBy?: InputMaybe<SubscriptionBangumiOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type SubscriptionsSubscriptionEpisodeArgs = {
|
||||
filters?: InputMaybe<SubscriptionEpisodeFilterInput>;
|
||||
orderBy?: InputMaybe<SubscriptionEpisodeOrderInput>;
|
||||
@@ -1275,264 +1314,47 @@ export type TextFilterInput = {
|
||||
not_between?: InputMaybe<Array<Scalars['String']['input']>>;
|
||||
};
|
||||
|
||||
export type GetSubscriptionsQueryVariables = Exact<{
|
||||
page: PageInput;
|
||||
filters: SubscriptionsFilterInput;
|
||||
orderBy: SubscriptionsOrderInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type GetSubscriptionsQuery = { __typename?: 'Query', subscriptions: { __typename?: 'SubscriptionsConnection', nodes: Array<{ __typename?: 'Subscriptions', id: number, createdAt: string, updatedAt: string, displayName: string, category: SubscriptionCategoryEnum, sourceUrl: string, enabled: boolean }>, paginationInfo?: { __typename?: 'PaginationInfo', total: number, pages: number } | null } };
|
||||
|
||||
export type UpdateSubscriptionsMutationVariables = Exact<{
|
||||
data: SubscriptionsUpdateInput;
|
||||
filters: SubscriptionsFilterInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type UpdateSubscriptionsMutation = { __typename?: 'Mutation', subscriptionsUpdate: Array<{ __typename?: 'SubscriptionsBasic', id: number, createdAt: string, updatedAt: string, displayName: string, category: SubscriptionCategoryEnum, sourceUrl: string, enabled: boolean }> };
|
||||
|
||||
export type DeleteSubscriptionsMutationVariables = Exact<{
|
||||
filters?: InputMaybe<SubscriptionsFilterInput>;
|
||||
}>;
|
||||
|
||||
|
||||
export type DeleteSubscriptionsMutation = { __typename?: 'Mutation', subscriptionsDelete: number };
|
||||
|
||||
export type GetSubscriptionDetailQueryVariables = Exact<{
|
||||
id: Scalars['Int']['input'];
|
||||
}>;
|
||||
|
||||
|
||||
export type GetSubscriptionDetailQuery = { __typename?: 'Query', subscriptions: { __typename?: 'SubscriptionsConnection', nodes: Array<{ __typename?: 'Subscriptions', id: number, displayName: string, createdAt: string, updatedAt: string, category: SubscriptionCategoryEnum, sourceUrl: string, enabled: boolean, bangumi: { __typename?: 'BangumiConnection', nodes: Array<{ __typename?: 'Bangumi', createdAt: string, updatedAt: string, id: number, mikanBangumiId?: string | null, displayName: string, rawName: string, season: number, seasonRaw?: string | null, fansub?: string | null, mikanFansubId?: string | null, rssLink?: string | null, posterLink?: string | null, savePath?: string | null, deleted: boolean, homepage?: string | null }> } }> } };
|
||||
|
||||
export type CreateSubscriptionMutationVariables = Exact<{
|
||||
input: SubscriptionsInsertInput;
|
||||
}>;
|
||||
|
||||
export type CreateSubscriptionMutation = {
|
||||
__typename?: 'Mutation';
|
||||
subscriptionsCreateOne: {
|
||||
__typename?: 'SubscriptionsBasic';
|
||||
id: number;
|
||||
displayName: string;
|
||||
sourceUrl: string;
|
||||
enabled: boolean;
|
||||
category: SubscriptionCategoryEnum;
|
||||
subscriberId: number;
|
||||
};
|
||||
};
|
||||
|
||||
export type GetSubscriptionsQueryVariables = Exact<{
|
||||
page: Scalars['Int']['input'];
|
||||
pageSize: Scalars['Int']['input'];
|
||||
}>;
|
||||
export type CreateSubscriptionMutation = { __typename?: 'Mutation', subscriptionsCreateOne: { __typename?: 'SubscriptionsBasic', id: number, displayName: string, sourceUrl: string, enabled: boolean, category: SubscriptionCategoryEnum } };
|
||||
|
||||
export type GetSubscriptionsQuery = {
|
||||
__typename?: 'Query';
|
||||
subscriptions: {
|
||||
__typename?: 'SubscriptionsConnection';
|
||||
nodes: Array<{
|
||||
__typename?: 'Subscriptions';
|
||||
id: number;
|
||||
displayName: string;
|
||||
category: SubscriptionCategoryEnum;
|
||||
enabled: boolean;
|
||||
bangumi: {
|
||||
__typename?: 'BangumiConnection';
|
||||
nodes: Array<{
|
||||
__typename?: 'Bangumi';
|
||||
id: number;
|
||||
displayName: string;
|
||||
posterLink?: string | null;
|
||||
season: number;
|
||||
fansub?: string | null;
|
||||
homepage?: string | null;
|
||||
}>;
|
||||
};
|
||||
}>;
|
||||
};
|
||||
};
|
||||
|
||||
export const CreateSubscriptionDocument = {
|
||||
kind: 'Document',
|
||||
definitions: [
|
||||
{
|
||||
kind: 'OperationDefinition',
|
||||
operation: 'mutation',
|
||||
name: { kind: 'Name', value: 'CreateSubscription' },
|
||||
variableDefinitions: [
|
||||
{
|
||||
kind: 'VariableDefinition',
|
||||
variable: {
|
||||
kind: 'Variable',
|
||||
name: { kind: 'Name', value: 'input' },
|
||||
},
|
||||
type: {
|
||||
kind: 'NonNullType',
|
||||
type: {
|
||||
kind: 'NamedType',
|
||||
name: { kind: 'Name', value: 'SubscriptionsInsertInput' },
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
selectionSet: {
|
||||
kind: 'SelectionSet',
|
||||
selections: [
|
||||
{
|
||||
kind: 'Field',
|
||||
name: { kind: 'Name', value: 'subscriptionsCreateOne' },
|
||||
arguments: [
|
||||
{
|
||||
kind: 'Argument',
|
||||
name: { kind: 'Name', value: 'data' },
|
||||
value: {
|
||||
kind: 'Variable',
|
||||
name: { kind: 'Name', value: 'input' },
|
||||
},
|
||||
},
|
||||
],
|
||||
selectionSet: {
|
||||
kind: 'SelectionSet',
|
||||
selections: [
|
||||
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
|
||||
{ kind: 'Field', name: { kind: 'Name', value: 'displayName' } },
|
||||
{ kind: 'Field', name: { kind: 'Name', value: 'sourceUrl' } },
|
||||
{ kind: 'Field', name: { kind: 'Name', value: 'enabled' } },
|
||||
{ kind: 'Field', name: { kind: 'Name', value: 'category' } },
|
||||
{
|
||||
kind: 'Field',
|
||||
name: { kind: 'Name', value: 'subscriberId' },
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
} as unknown as DocumentNode<
|
||||
CreateSubscriptionMutation,
|
||||
CreateSubscriptionMutationVariables
|
||||
>;
|
||||
export const GetSubscriptionsDocument = {
|
||||
kind: 'Document',
|
||||
definitions: [
|
||||
{
|
||||
kind: 'OperationDefinition',
|
||||
operation: 'query',
|
||||
name: { kind: 'Name', value: 'GetSubscriptions' },
|
||||
variableDefinitions: [
|
||||
{
|
||||
kind: 'VariableDefinition',
|
||||
variable: { kind: 'Variable', name: { kind: 'Name', value: 'page' } },
|
||||
type: {
|
||||
kind: 'NonNullType',
|
||||
type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } },
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'VariableDefinition',
|
||||
variable: {
|
||||
kind: 'Variable',
|
||||
name: { kind: 'Name', value: 'pageSize' },
|
||||
},
|
||||
type: {
|
||||
kind: 'NonNullType',
|
||||
type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } },
|
||||
},
|
||||
},
|
||||
],
|
||||
selectionSet: {
|
||||
kind: 'SelectionSet',
|
||||
selections: [
|
||||
{
|
||||
kind: 'Field',
|
||||
name: { kind: 'Name', value: 'subscriptions' },
|
||||
arguments: [
|
||||
{
|
||||
kind: 'Argument',
|
||||
name: { kind: 'Name', value: 'pagination' },
|
||||
value: {
|
||||
kind: 'ObjectValue',
|
||||
fields: [
|
||||
{
|
||||
kind: 'ObjectField',
|
||||
name: { kind: 'Name', value: 'page' },
|
||||
value: {
|
||||
kind: 'ObjectValue',
|
||||
fields: [
|
||||
{
|
||||
kind: 'ObjectField',
|
||||
name: { kind: 'Name', value: 'page' },
|
||||
value: {
|
||||
kind: 'Variable',
|
||||
name: { kind: 'Name', value: 'page' },
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'ObjectField',
|
||||
name: { kind: 'Name', value: 'limit' },
|
||||
value: {
|
||||
kind: 'Variable',
|
||||
name: { kind: 'Name', value: 'pageSize' },
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
selectionSet: {
|
||||
kind: 'SelectionSet',
|
||||
selections: [
|
||||
{
|
||||
kind: 'Field',
|
||||
name: { kind: 'Name', value: 'nodes' },
|
||||
selectionSet: {
|
||||
kind: 'SelectionSet',
|
||||
selections: [
|
||||
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
|
||||
{
|
||||
kind: 'Field',
|
||||
name: { kind: 'Name', value: 'displayName' },
|
||||
},
|
||||
{
|
||||
kind: 'Field',
|
||||
name: { kind: 'Name', value: 'category' },
|
||||
},
|
||||
{
|
||||
kind: 'Field',
|
||||
name: { kind: 'Name', value: 'enabled' },
|
||||
},
|
||||
{
|
||||
kind: 'Field',
|
||||
name: { kind: 'Name', value: 'bangumi' },
|
||||
selectionSet: {
|
||||
kind: 'SelectionSet',
|
||||
selections: [
|
||||
{
|
||||
kind: 'Field',
|
||||
name: { kind: 'Name', value: 'nodes' },
|
||||
selectionSet: {
|
||||
kind: 'SelectionSet',
|
||||
selections: [
|
||||
{
|
||||
kind: 'Field',
|
||||
name: { kind: 'Name', value: 'id' },
|
||||
},
|
||||
{
|
||||
kind: 'Field',
|
||||
name: {
|
||||
kind: 'Name',
|
||||
value: 'displayName',
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'Field',
|
||||
name: { kind: 'Name', value: 'posterLink' },
|
||||
},
|
||||
{
|
||||
kind: 'Field',
|
||||
name: { kind: 'Name', value: 'season' },
|
||||
},
|
||||
{
|
||||
kind: 'Field',
|
||||
name: { kind: 'Name', value: 'fansub' },
|
||||
},
|
||||
{
|
||||
kind: 'Field',
|
||||
name: { kind: 'Name', value: 'homepage' },
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
} as unknown as DocumentNode<
|
||||
GetSubscriptionsQuery,
|
||||
GetSubscriptionsQueryVariables
|
||||
>;
|
||||
export const GetSubscriptionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSubscriptions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"page"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"PageInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionsFilterInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionsOrderInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"page"},"value":{"kind":"Variable","name":{"kind":"Name","value":"page"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nodes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"category"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}}]}},{"kind":"Field","name":{"kind":"Name","value":"paginationInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"total"}},{"kind":"Field","name":{"kind":"Name","value":"pages"}}]}}]}}]}}]} as unknown as DocumentNode<GetSubscriptionsQuery, GetSubscriptionsQueryVariables>;
|
||||
export const UpdateSubscriptionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateSubscriptions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"data"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionsUpdateInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionsFilterInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionsUpdate"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"data"}}},{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"category"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}}]}}]}}]} as unknown as DocumentNode<UpdateSubscriptionsMutation, UpdateSubscriptionsMutationVariables>;
|
||||
export const DeleteSubscriptionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteSubscriptions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionsFilterInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionsDelete"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}}]}]}}]} as unknown as DocumentNode<DeleteSubscriptionsMutation, DeleteSubscriptionsMutationVariables>;
|
||||
export const GetSubscriptionDetailDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSubscriptionDetail"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nodes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"category"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"bangumi"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nodes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"mikanBangumiId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"rawName"}},{"kind":"Field","name":{"kind":"Name","value":"season"}},{"kind":"Field","name":{"kind":"Name","value":"seasonRaw"}},{"kind":"Field","name":{"kind":"Name","value":"fansub"}},{"kind":"Field","name":{"kind":"Name","value":"mikanFansubId"}},{"kind":"Field","name":{"kind":"Name","value":"rssLink"}},{"kind":"Field","name":{"kind":"Name","value":"posterLink"}},{"kind":"Field","name":{"kind":"Name","value":"savePath"}},{"kind":"Field","name":{"kind":"Name","value":"deleted"}},{"kind":"Field","name":{"kind":"Name","value":"homepage"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<GetSubscriptionDetailQuery, GetSubscriptionDetailQueryVariables>;
|
||||
export const CreateSubscriptionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateSubscription"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionsInsertInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionsCreateOne"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"category"}}]}}]}}]} as unknown as DocumentNode<CreateSubscriptionMutation, CreateSubscriptionMutationVariables>;
|
||||
@@ -1,2 +1,2 @@
|
||||
export * from './fragment-masking';
|
||||
export * from './gql';
|
||||
export * from "./fragment-masking";
|
||||
export * from "./gql";
|
||||
10
apps/webui/src/infra/intl/context.ts
Normal file
10
apps/webui/src/infra/intl/context.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { Injector } from '@outposts/injection-js';
|
||||
import { IntlService } from './intl.service';
|
||||
|
||||
export function intlContextFromInjector(injector: Injector) {
|
||||
const intlService = injector.get(IntlService);
|
||||
|
||||
return {
|
||||
intlService,
|
||||
};
|
||||
}
|
||||
9
apps/webui/src/infra/intl/hooks.ts
Normal file
9
apps/webui/src/infra/intl/hooks.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { useInjector } from 'oidc-client-rx/adapters/react';
|
||||
import { useMemo } from 'react';
|
||||
import { intlContextFromInjector } from './context';
|
||||
|
||||
export function useIntl() {
|
||||
const injector = useInjector();
|
||||
|
||||
return useMemo(() => intlContextFromInjector(injector), [injector]);
|
||||
}
|
||||
27
apps/webui/src/infra/intl/intl.service.ts
Normal file
27
apps/webui/src/infra/intl/intl.service.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { inject } from '@outposts/injection-js';
|
||||
import { DOCUMENT } from '../platform/injection';
|
||||
|
||||
export class IntlService {
|
||||
document = inject(DOCUMENT);
|
||||
|
||||
formatTimestamp(timestamp: number, options?: Intl.DateTimeFormatOptions) {
|
||||
const defaultOptions: Intl.DateTimeFormatOptions = {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
second: '2-digit',
|
||||
hour12: false,
|
||||
...options,
|
||||
};
|
||||
|
||||
return new Intl.DateTimeFormat(
|
||||
this.document.defaultView?.navigator.language,
|
||||
{
|
||||
...defaultOptions,
|
||||
...options,
|
||||
}
|
||||
).format(new Date(timestamp));
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ProLinkProps } from '@/views/components/ui/pro-link';
|
||||
import type { ProLinkProps } from '@/components/ui/pro-link';
|
||||
import type { Injector } from '@outposts/injection-js';
|
||||
import type { LucideIcon } from 'lucide-react';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { guardRouteIndexAsNotFound } from '@/components/layout/app-not-found';
|
||||
import type { RouteStateDataOption } from '@/infra/routes/traits';
|
||||
import { guardRouteIndexAsNotFound } from '@/views/components/layout/app-not-found';
|
||||
import { Outlet } from '@tanstack/react-router';
|
||||
|
||||
export interface BuildVirtualBranchRouteOptions {
|
||||
|
||||
Reference in New Issue
Block a user