fix: add sync subscription webui and check credential web ui
This commit is contained in:
@@ -80,6 +80,14 @@ export const GET_CREDENTIAL_3RD_DETAIL = gql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const CHECK_CREDENTIAL_3RD_AVAILABLE = gql`
|
||||
query CheckCredential3rdAvailable($id: Int!) {
|
||||
credential3rdCheckAvailable(filter: { id: $id }) {
|
||||
available
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const Credential3rdTypedMikanSchema = type({
|
||||
credentialType: `'${Credential3rdTypeEnum.Mikan}'`,
|
||||
username: 'string > 0',
|
||||
|
||||
@@ -121,6 +121,30 @@ query GetSubscriptionDetail ($id: Int!) {
|
||||
}
|
||||
`;
|
||||
|
||||
export const SYNC_SUBSCRIPTION_FEEDS_INCREMENTAL = gql`
|
||||
mutation SyncSubscriptionFeedsIncremental($id: Int!) {
|
||||
subscriptionSyncOneFeedsIncremental(filter: { id: $id }) {
|
||||
taskId
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const SYNC_SUBSCRIPTION_FEEDS_FULL = gql`
|
||||
mutation SyncSubscriptionFeedsFull($id: Int!) {
|
||||
subscriptionSyncOneFeedsFull(filter: { id: $id }) {
|
||||
taskId
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const SYNC_SUBSCRIPTION_SOURCES = gql`
|
||||
mutation SyncSubscriptionSources($id: Int!) {
|
||||
subscriptionSyncOneSources(filter: { id: $id }) {
|
||||
taskId
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const SubscriptionTypedMikanSeasonSchema =
|
||||
MikanSubscriptionSeasonSourceUrlSchema.and(
|
||||
type({
|
||||
|
||||
26
apps/webui/src/infra/errors/apollo.ts
Normal file
26
apps/webui/src/infra/errors/apollo.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { ApolloError, ApolloQueryResult } from '@apollo/client';
|
||||
import type { GraphQLFormattedError } from 'graphql';
|
||||
|
||||
export function getApolloQueryError<T>(
|
||||
response: ApolloQueryResult<T>
|
||||
): ApolloError | readonly GraphQLFormattedError[] | null {
|
||||
if (response.error) {
|
||||
return response.error;
|
||||
}
|
||||
if (response.errors) {
|
||||
return response.errors;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export function apolloErrorToMessage(
|
||||
error: ApolloError | readonly GraphQLFormattedError[]
|
||||
) {
|
||||
if (Array.isArray(error)) {
|
||||
return error.map((e) => e.message).join('\n');
|
||||
}
|
||||
if ('message' in error) {
|
||||
return error.message;
|
||||
}
|
||||
return 'Unknown error';
|
||||
}
|
||||
@@ -19,11 +19,15 @@ type Documents = {
|
||||
"\n mutation UpdateCredential3rd($data: Credential3rdUpdateInput!, $filters: Credential3rdFilterInput!) {\n credential3rdUpdate(data: $data, filter: $filters) {\n id\n cookies\n username\n password\n userAgent\n createdAt\n updatedAt\n credentialType\n }\n }\n": typeof types.UpdateCredential3rdDocument,
|
||||
"\n mutation DeleteCredential3rd($filters: Credential3rdFilterInput!) {\n credential3rdDelete(filter: $filters)\n }\n": typeof types.DeleteCredential3rdDocument,
|
||||
"\n query GetCredential3rdDetail($id: Int!) {\n credential3rd(filters: { id: { eq: $id } }) {\n nodes {\n id\n cookies\n username\n password\n userAgent\n createdAt\n updatedAt\n credentialType\n }\n }\n }\n": typeof types.GetCredential3rdDetailDocument,
|
||||
"\n query CheckCredential3rdAvailable($id: Int!) {\n credential3rdCheckAvailable(filter: { id: $id }) {\n available\n }\n }\n": typeof types.CheckCredential3rdAvailableDocument,
|
||||
"\n query GetSubscriptions($filters: SubscriptionsFilterInput!, $orderBy: SubscriptionsOrderInput!, $pagination: PaginationInput!) {\n subscriptions(\n pagination: $pagination\n filters: $filters\n orderBy: $orderBy\n ) {\n nodes {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n credentialId\n }\n paginationInfo {\n total\n pages\n }\n }\n }\n": typeof types.GetSubscriptionsDocument,
|
||||
"\n mutation InsertSubscription($data: SubscriptionsInsertInput!) {\n subscriptionsCreateOne(data: $data) {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n credentialId\n }\n }\n": typeof types.InsertSubscriptionDocument,
|
||||
"\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 credential3rd {\n id\n username\n }\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 homepage\n }\n }\n }\n }\n}\n": typeof types.GetSubscriptionDetailDocument,
|
||||
"\n mutation SyncSubscriptionFeedsIncremental($id: Int!) {\n subscriptionSyncOneFeedsIncremental(filter: { id: $id }) {\n taskId\n }\n }\n": typeof types.SyncSubscriptionFeedsIncrementalDocument,
|
||||
"\n mutation SyncSubscriptionFeedsFull($id: Int!) {\n subscriptionSyncOneFeedsFull(filter: { id: $id }) {\n taskId\n }\n }\n": typeof types.SyncSubscriptionFeedsFullDocument,
|
||||
"\n mutation SyncSubscriptionSources($id: Int!) {\n subscriptionSyncOneSources(filter: { id: $id }) {\n taskId\n }\n }\n": typeof types.SyncSubscriptionSourcesDocument,
|
||||
};
|
||||
const documents: Documents = {
|
||||
"\n query GetCredential3rd($filters: Credential3rdFilterInput!, $orderBy: Credential3rdOrderInput, $pagination: PaginationInput) {\n credential3rd(filters: $filters, orderBy: $orderBy, pagination: $pagination) {\n nodes {\n id\n cookies\n username\n password\n userAgent\n createdAt\n updatedAt\n credentialType\n }\n paginationInfo {\n total\n pages\n }\n }\n }\n": types.GetCredential3rdDocument,
|
||||
@@ -31,11 +35,15 @@ const documents: Documents = {
|
||||
"\n mutation UpdateCredential3rd($data: Credential3rdUpdateInput!, $filters: Credential3rdFilterInput!) {\n credential3rdUpdate(data: $data, filter: $filters) {\n id\n cookies\n username\n password\n userAgent\n createdAt\n updatedAt\n credentialType\n }\n }\n": types.UpdateCredential3rdDocument,
|
||||
"\n mutation DeleteCredential3rd($filters: Credential3rdFilterInput!) {\n credential3rdDelete(filter: $filters)\n }\n": types.DeleteCredential3rdDocument,
|
||||
"\n query GetCredential3rdDetail($id: Int!) {\n credential3rd(filters: { id: { eq: $id } }) {\n nodes {\n id\n cookies\n username\n password\n userAgent\n createdAt\n updatedAt\n credentialType\n }\n }\n }\n": types.GetCredential3rdDetailDocument,
|
||||
"\n query CheckCredential3rdAvailable($id: Int!) {\n credential3rdCheckAvailable(filter: { id: $id }) {\n available\n }\n }\n": types.CheckCredential3rdAvailableDocument,
|
||||
"\n query GetSubscriptions($filters: SubscriptionsFilterInput!, $orderBy: SubscriptionsOrderInput!, $pagination: PaginationInput!) {\n subscriptions(\n pagination: $pagination\n filters: $filters\n orderBy: $orderBy\n ) {\n nodes {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n credentialId\n }\n paginationInfo {\n total\n pages\n }\n }\n }\n": types.GetSubscriptionsDocument,
|
||||
"\n mutation InsertSubscription($data: SubscriptionsInsertInput!) {\n subscriptionsCreateOne(data: $data) {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n credentialId\n }\n }\n": types.InsertSubscriptionDocument,
|
||||
"\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 credential3rd {\n id\n username\n }\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 homepage\n }\n }\n }\n }\n}\n": types.GetSubscriptionDetailDocument,
|
||||
"\n mutation SyncSubscriptionFeedsIncremental($id: Int!) {\n subscriptionSyncOneFeedsIncremental(filter: { id: $id }) {\n taskId\n }\n }\n": types.SyncSubscriptionFeedsIncrementalDocument,
|
||||
"\n mutation SyncSubscriptionFeedsFull($id: Int!) {\n subscriptionSyncOneFeedsFull(filter: { id: $id }) {\n taskId\n }\n }\n": types.SyncSubscriptionFeedsFullDocument,
|
||||
"\n mutation SyncSubscriptionSources($id: Int!) {\n subscriptionSyncOneSources(filter: { id: $id }) {\n taskId\n }\n }\n": types.SyncSubscriptionSourcesDocument,
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -72,6 +80,10 @@ export function gql(source: "\n mutation DeleteCredential3rd($filters: Credenti
|
||||
* 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 GetCredential3rdDetail($id: Int!) {\n credential3rd(filters: { id: { eq: $id } }) {\n nodes {\n id\n cookies\n username\n password\n userAgent\n createdAt\n updatedAt\n credentialType\n }\n }\n }\n"): (typeof documents)["\n query GetCredential3rdDetail($id: Int!) {\n credential3rd(filters: { id: { eq: $id } }) {\n nodes {\n id\n cookies\n username\n password\n userAgent\n createdAt\n updatedAt\n credentialType\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 CheckCredential3rdAvailable($id: Int!) {\n credential3rdCheckAvailable(filter: { id: $id }) {\n available\n }\n }\n"): (typeof documents)["\n query CheckCredential3rdAvailable($id: Int!) {\n credential3rdCheckAvailable(filter: { id: $id }) {\n available\n }\n }\n"];
|
||||
/**
|
||||
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
@@ -92,6 +104,18 @@ export function gql(source: "\n mutation DeleteSubscriptions($filters: Subscr
|
||||
* 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 credential3rd {\n id\n username\n }\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 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 credential3rd {\n id\n username\n }\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 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 SyncSubscriptionFeedsIncremental($id: Int!) {\n subscriptionSyncOneFeedsIncremental(filter: { id: $id }) {\n taskId\n }\n }\n"): (typeof documents)["\n mutation SyncSubscriptionFeedsIncremental($id: Int!) {\n subscriptionSyncOneFeedsIncremental(filter: { id: $id }) {\n taskId\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 SyncSubscriptionFeedsFull($id: Int!) {\n subscriptionSyncOneFeedsFull(filter: { id: $id }) {\n taskId\n }\n }\n"): (typeof documents)["\n mutation SyncSubscriptionFeedsFull($id: Int!) {\n subscriptionSyncOneFeedsFull(filter: { id: $id }) {\n taskId\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 SyncSubscriptionSources($id: Int!) {\n subscriptionSyncOneSources(filter: { id: $id }) {\n taskId\n }\n }\n"): (typeof documents)["\n mutation SyncSubscriptionSources($id: Int!) {\n subscriptionSyncOneSources(filter: { id: $id }) {\n taskId\n }\n }\n"];
|
||||
|
||||
export function gql(source: string) {
|
||||
return (documents as any)[source] ?? {};
|
||||
|
||||
@@ -216,6 +216,17 @@ export type Credential3rdBasic = {
|
||||
username?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
/** The output of the credential3rdCheckAvailable query */
|
||||
export type Credential3rdCheckAvailableInfo = {
|
||||
__typename?: 'Credential3rdCheckAvailableInfo';
|
||||
available: Scalars['Boolean']['output'];
|
||||
};
|
||||
|
||||
/** The input of the credential3rdCheckAvailable query */
|
||||
export type Credential3rdCheckAvailableInput = {
|
||||
id: Scalars['Int']['input'];
|
||||
};
|
||||
|
||||
export type Credential3rdConnection = {
|
||||
__typename?: 'Credential3rdConnection';
|
||||
edges: Array<Credential3rdEdge>;
|
||||
@@ -805,6 +816,8 @@ export type Mutation = {
|
||||
subscriptionEpisodeCreateOne: SubscriptionEpisodeBasic;
|
||||
subscriptionEpisodeDelete: Scalars['Int']['output'];
|
||||
subscriptionEpisodeUpdate: Array<SubscriptionEpisodeBasic>;
|
||||
subscriptionSyncOneFeedsFull: SyncOneSubscriptionInfo;
|
||||
subscriptionSyncOneFeedsIncremental: SyncOneSubscriptionInfo;
|
||||
subscriptionSyncOneSources: SyncOneSubscriptionInfo;
|
||||
subscriptionsCreateBatch: Array<SubscriptionsBasic>;
|
||||
subscriptionsCreateOne: SubscriptionsBasic;
|
||||
@@ -981,6 +994,16 @@ export type MutationSubscriptionEpisodeUpdateArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriptionSyncOneFeedsFullArgs = {
|
||||
filter: SyncOneSubscriptionFilterInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriptionSyncOneFeedsIncrementalArgs = {
|
||||
filter: SyncOneSubscriptionFilterInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriptionSyncOneSourcesArgs = {
|
||||
filter: SyncOneSubscriptionFilterInput;
|
||||
};
|
||||
@@ -1049,6 +1072,7 @@ export type Query = {
|
||||
_sea_orm_entity_metadata?: Maybe<Scalars['String']['output']>;
|
||||
bangumi: BangumiConnection;
|
||||
credential3rd: Credential3rdConnection;
|
||||
credential3rdCheckAvailable: Credential3rdCheckAvailableInfo;
|
||||
downloaders: DownloadersConnection;
|
||||
downloads: DownloadsConnection;
|
||||
episodes: EpisodesConnection;
|
||||
@@ -1056,8 +1080,6 @@ export type Query = {
|
||||
subscribers: SubscribersConnection;
|
||||
subscriptionBangumi: SubscriptionBangumiConnection;
|
||||
subscriptionEpisode: SubscriptionEpisodeConnection;
|
||||
subscriptionSyncOneFeedsFull: SyncOneSubscriptionInfo;
|
||||
subscriptionSyncOneFeedsIncremental: SyncOneSubscriptionInfo;
|
||||
subscriptions: SubscriptionsConnection;
|
||||
};
|
||||
|
||||
@@ -1081,6 +1103,11 @@ export type QueryCredential3rdArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type QueryCredential3rdCheckAvailableArgs = {
|
||||
filter: Credential3rdCheckAvailableInput;
|
||||
};
|
||||
|
||||
|
||||
export type QueryDownloadersArgs = {
|
||||
filters?: InputMaybe<DownloadersFilterInput>;
|
||||
orderBy?: InputMaybe<DownloadersOrderInput>;
|
||||
@@ -1130,16 +1157,6 @@ export type QuerySubscriptionEpisodeArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type QuerySubscriptionSyncOneFeedsFullArgs = {
|
||||
filter: SyncOneSubscriptionFilterInput;
|
||||
};
|
||||
|
||||
|
||||
export type QuerySubscriptionSyncOneFeedsIncrementalArgs = {
|
||||
filter: SyncOneSubscriptionFilterInput;
|
||||
};
|
||||
|
||||
|
||||
export type QuerySubscriptionsArgs = {
|
||||
filters?: InputMaybe<SubscriptionsFilterInput>;
|
||||
orderBy?: InputMaybe<SubscriptionsOrderInput>;
|
||||
@@ -1616,7 +1633,7 @@ export type SubscriptionsUpdateInput = {
|
||||
|
||||
/** The input of the subscriptionSyncOne series of mutations */
|
||||
export type SyncOneSubscriptionFilterInput = {
|
||||
subscriptionId: Scalars['Int']['input'];
|
||||
id: Scalars['Int']['input'];
|
||||
};
|
||||
|
||||
/** The output of the subscriptionSyncOne series of mutations */
|
||||
@@ -1678,6 +1695,13 @@ export type GetCredential3rdDetailQueryVariables = Exact<{
|
||||
|
||||
export type GetCredential3rdDetailQuery = { __typename?: 'Query', credential3rd: { __typename?: 'Credential3rdConnection', nodes: Array<{ __typename?: 'Credential3rd', id: number, cookies?: string | null, username?: string | null, password?: string | null, userAgent?: string | null, createdAt: string, updatedAt: string, credentialType: Credential3rdTypeEnum }> } };
|
||||
|
||||
export type CheckCredential3rdAvailableQueryVariables = Exact<{
|
||||
id: Scalars['Int']['input'];
|
||||
}>;
|
||||
|
||||
|
||||
export type CheckCredential3rdAvailableQuery = { __typename?: 'Query', credential3rdCheckAvailable: { __typename?: 'Credential3rdCheckAvailableInfo', available: boolean } };
|
||||
|
||||
export type GetSubscriptionsQueryVariables = Exact<{
|
||||
filters: SubscriptionsFilterInput;
|
||||
orderBy: SubscriptionsOrderInput;
|
||||
@@ -1716,14 +1740,39 @@ export type GetSubscriptionDetailQueryVariables = Exact<{
|
||||
|
||||
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, credential3rd?: { __typename?: 'Credential3rd', id: number, username?: string | null } | null, 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, homepage?: string | null }> } }> } };
|
||||
|
||||
export type SyncSubscriptionFeedsIncrementalMutationVariables = Exact<{
|
||||
id: Scalars['Int']['input'];
|
||||
}>;
|
||||
|
||||
|
||||
export type SyncSubscriptionFeedsIncrementalMutation = { __typename?: 'Mutation', subscriptionSyncOneFeedsIncremental: { __typename?: 'SyncOneSubscriptionInfo', taskId: string } };
|
||||
|
||||
export type SyncSubscriptionFeedsFullMutationVariables = Exact<{
|
||||
id: Scalars['Int']['input'];
|
||||
}>;
|
||||
|
||||
|
||||
export type SyncSubscriptionFeedsFullMutation = { __typename?: 'Mutation', subscriptionSyncOneFeedsFull: { __typename?: 'SyncOneSubscriptionInfo', taskId: string } };
|
||||
|
||||
export type SyncSubscriptionSourcesMutationVariables = Exact<{
|
||||
id: Scalars['Int']['input'];
|
||||
}>;
|
||||
|
||||
|
||||
export type SyncSubscriptionSourcesMutation = { __typename?: 'Mutation', subscriptionSyncOneSources: { __typename?: 'SyncOneSubscriptionInfo', taskId: string } };
|
||||
|
||||
|
||||
export const GetCredential3rdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCredential3rd"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Credential3rdFilterInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Credential3rdOrderInput"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pagination"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PaginationInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"credential3rd"},"arguments":[{"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"}}},{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pagination"}}}],"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":"cookies"}},{"kind":"Field","name":{"kind":"Name","value":"username"}},{"kind":"Field","name":{"kind":"Name","value":"password"}},{"kind":"Field","name":{"kind":"Name","value":"userAgent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"credentialType"}}]}},{"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<GetCredential3rdQuery, GetCredential3rdQueryVariables>;
|
||||
export const InsertCredential3rdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"InsertCredential3rd"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"data"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Credential3rdInsertInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"credential3rdCreateOne"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"data"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"cookies"}},{"kind":"Field","name":{"kind":"Name","value":"username"}},{"kind":"Field","name":{"kind":"Name","value":"password"}},{"kind":"Field","name":{"kind":"Name","value":"userAgent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"credentialType"}}]}}]}}]} as unknown as DocumentNode<InsertCredential3rdMutation, InsertCredential3rdMutationVariables>;
|
||||
export const UpdateCredential3rdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateCredential3rd"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"data"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Credential3rdUpdateInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Credential3rdFilterInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"credential3rdUpdate"},"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":"cookies"}},{"kind":"Field","name":{"kind":"Name","value":"username"}},{"kind":"Field","name":{"kind":"Name","value":"password"}},{"kind":"Field","name":{"kind":"Name","value":"userAgent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"credentialType"}}]}}]}}]} as unknown as DocumentNode<UpdateCredential3rdMutation, UpdateCredential3rdMutationVariables>;
|
||||
export const DeleteCredential3rdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteCredential3rd"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Credential3rdFilterInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"credential3rdDelete"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}}]}]}}]} as unknown as DocumentNode<DeleteCredential3rdMutation, DeleteCredential3rdMutationVariables>;
|
||||
export const GetCredential3rdDetailDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCredential3rdDetail"},"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":"credential3rd"},"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":"cookies"}},{"kind":"Field","name":{"kind":"Name","value":"username"}},{"kind":"Field","name":{"kind":"Name","value":"password"}},{"kind":"Field","name":{"kind":"Name","value":"userAgent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"credentialType"}}]}}]}}]}}]} as unknown as DocumentNode<GetCredential3rdDetailQuery, GetCredential3rdDetailQueryVariables>;
|
||||
export const CheckCredential3rdAvailableDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CheckCredential3rdAvailable"},"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":"credential3rdCheckAvailable"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"available"}}]}}]}}]} as unknown as DocumentNode<CheckCredential3rdAvailableQuery, CheckCredential3rdAvailableQueryVariables>;
|
||||
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":"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"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"pagination"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"PaginationInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"Variable","name":{"kind":"Name","value":"pagination"}}},{"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":"credentialId"}}]}},{"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 InsertSubscriptionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"InsertSubscription"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"data"}},"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":"data"}}}],"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":"credentialId"}}]}}]}}]} as unknown as DocumentNode<InsertSubscriptionMutation, InsertSubscriptionMutationVariables>;
|
||||
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":"credential3rd"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"username"}}]}},{"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":"homepage"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<GetSubscriptionDetailQuery, GetSubscriptionDetailQueryVariables>;
|
||||
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":"credential3rd"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"username"}}]}},{"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":"homepage"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<GetSubscriptionDetailQuery, GetSubscriptionDetailQueryVariables>;
|
||||
export const SyncSubscriptionFeedsIncrementalDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SyncSubscriptionFeedsIncremental"},"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":"subscriptionSyncOneFeedsIncremental"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"taskId"}}]}}]}}]} as unknown as DocumentNode<SyncSubscriptionFeedsIncrementalMutation, SyncSubscriptionFeedsIncrementalMutationVariables>;
|
||||
export const SyncSubscriptionFeedsFullDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SyncSubscriptionFeedsFull"},"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":"subscriptionSyncOneFeedsFull"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"taskId"}}]}}]}}]} as unknown as DocumentNode<SyncSubscriptionFeedsFullMutation, SyncSubscriptionFeedsFullMutationVariables>;
|
||||
export const SyncSubscriptionSourcesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SyncSubscriptionSources"},"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":"subscriptionSyncOneSources"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"taskId"}}]}}]}}]} as unknown as DocumentNode<SyncSubscriptionSourcesMutation, SyncSubscriptionSourcesMutationVariables>;
|
||||
@@ -22,6 +22,17 @@ export class GraphQLService {
|
||||
_apollo = new ApolloClient({
|
||||
link: this.authLink.concat(this.apiLink),
|
||||
cache: new InMemoryCache(),
|
||||
defaultOptions: {
|
||||
watchQuery: {
|
||||
fetchPolicy: 'cache-and-network',
|
||||
nextFetchPolicy: 'network-only',
|
||||
errorPolicy: 'all',
|
||||
},
|
||||
query: {
|
||||
fetchPolicy: 'network-only',
|
||||
errorPolicy: 'all',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
query = this._apollo.query;
|
||||
|
||||
@@ -17,12 +17,14 @@ import { Route as AppRouteImport } from './routes/_app/route'
|
||||
import { Route as IndexImport } from './routes/index'
|
||||
import { Route as AuthSignUpImport } from './routes/auth/sign-up'
|
||||
import { Route as AuthSignInImport } from './routes/auth/sign-in'
|
||||
import { Route as AppTasksRouteImport } from './routes/_app/tasks/route'
|
||||
import { Route as AppSubscriptionsRouteImport } from './routes/_app/subscriptions/route'
|
||||
import { Route as AppSettingsRouteImport } from './routes/_app/settings/route'
|
||||
import { Route as AppPlaygroundRouteImport } from './routes/_app/playground/route'
|
||||
import { Route as AppCredential3rdRouteImport } from './routes/_app/credential3rd/route'
|
||||
import { Route as AppBangumiRouteImport } from './routes/_app/bangumi/route'
|
||||
import { Route as AuthOidcCallbackImport } from './routes/auth/oidc/callback'
|
||||
import { Route as AppTasksManageImport } from './routes/_app/tasks/manage'
|
||||
import { Route as AppSubscriptionsManageImport } from './routes/_app/subscriptions/manage'
|
||||
import { Route as AppSubscriptionsCreateImport } from './routes/_app/subscriptions/create'
|
||||
import { Route as AppSettingsDownloaderImport } from './routes/_app/settings/downloader'
|
||||
@@ -32,6 +34,7 @@ import { Route as AppCredential3rdCreateImport } from './routes/_app/credential3
|
||||
import { Route as AppBangumiManageImport } from './routes/_app/bangumi/manage'
|
||||
import { Route as AppExploreFeedImport } from './routes/_app/_explore/feed'
|
||||
import { Route as AppExploreExploreImport } from './routes/_app/_explore/explore'
|
||||
import { Route as AppTasksDetailIdImport } from './routes/_app/tasks/detail.$id'
|
||||
import { Route as AppSubscriptionsEditIdImport } from './routes/_app/subscriptions/edit.$id'
|
||||
import { Route as AppSubscriptionsDetailIdImport } from './routes/_app/subscriptions/detail.$id'
|
||||
import { Route as AppCredential3rdEditIdImport } from './routes/_app/credential3rd/edit.$id'
|
||||
@@ -74,6 +77,12 @@ const AuthSignInRoute = AuthSignInImport.update({
|
||||
getParentRoute: () => rootRoute,
|
||||
} as any)
|
||||
|
||||
const AppTasksRouteRoute = AppTasksRouteImport.update({
|
||||
id: '/tasks',
|
||||
path: '/tasks',
|
||||
getParentRoute: () => AppRouteRoute,
|
||||
} as any)
|
||||
|
||||
const AppSubscriptionsRouteRoute = AppSubscriptionsRouteImport.update({
|
||||
id: '/subscriptions',
|
||||
path: '/subscriptions',
|
||||
@@ -110,6 +119,12 @@ const AuthOidcCallbackRoute = AuthOidcCallbackImport.update({
|
||||
getParentRoute: () => rootRoute,
|
||||
} as any)
|
||||
|
||||
const AppTasksManageRoute = AppTasksManageImport.update({
|
||||
id: '/manage',
|
||||
path: '/manage',
|
||||
getParentRoute: () => AppTasksRouteRoute,
|
||||
} as any)
|
||||
|
||||
const AppSubscriptionsManageRoute = AppSubscriptionsManageImport.update({
|
||||
id: '/manage',
|
||||
path: '/manage',
|
||||
@@ -166,6 +181,12 @@ const AppExploreExploreRoute = AppExploreExploreImport.update({
|
||||
getParentRoute: () => AppRouteRoute,
|
||||
} as any)
|
||||
|
||||
const AppTasksDetailIdRoute = AppTasksDetailIdImport.update({
|
||||
id: '/detail/$id',
|
||||
path: '/detail/$id',
|
||||
getParentRoute: () => AppTasksRouteRoute,
|
||||
} as any)
|
||||
|
||||
const AppSubscriptionsEditIdRoute = AppSubscriptionsEditIdImport.update({
|
||||
id: '/edit/$id',
|
||||
path: '/edit/$id',
|
||||
@@ -257,6 +278,13 @@ declare module '@tanstack/react-router' {
|
||||
preLoaderRoute: typeof AppSubscriptionsRouteImport
|
||||
parentRoute: typeof AppRouteImport
|
||||
}
|
||||
'/_app/tasks': {
|
||||
id: '/_app/tasks'
|
||||
path: '/tasks'
|
||||
fullPath: '/tasks'
|
||||
preLoaderRoute: typeof AppTasksRouteImport
|
||||
parentRoute: typeof AppRouteImport
|
||||
}
|
||||
'/auth/sign-in': {
|
||||
id: '/auth/sign-in'
|
||||
path: '/auth/sign-in'
|
||||
@@ -334,6 +362,13 @@ declare module '@tanstack/react-router' {
|
||||
preLoaderRoute: typeof AppSubscriptionsManageImport
|
||||
parentRoute: typeof AppSubscriptionsRouteImport
|
||||
}
|
||||
'/_app/tasks/manage': {
|
||||
id: '/_app/tasks/manage'
|
||||
path: '/manage'
|
||||
fullPath: '/tasks/manage'
|
||||
preLoaderRoute: typeof AppTasksManageImport
|
||||
parentRoute: typeof AppTasksRouteImport
|
||||
}
|
||||
'/auth/oidc/callback': {
|
||||
id: '/auth/oidc/callback'
|
||||
path: '/auth/oidc/callback'
|
||||
@@ -369,6 +404,13 @@ declare module '@tanstack/react-router' {
|
||||
preLoaderRoute: typeof AppSubscriptionsEditIdImport
|
||||
parentRoute: typeof AppSubscriptionsRouteImport
|
||||
}
|
||||
'/_app/tasks/detail/$id': {
|
||||
id: '/_app/tasks/detail/$id'
|
||||
path: '/detail/$id'
|
||||
fullPath: '/tasks/detail/$id'
|
||||
preLoaderRoute: typeof AppTasksDetailIdImport
|
||||
parentRoute: typeof AppTasksRouteImport
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -446,12 +488,27 @@ const AppSubscriptionsRouteRouteWithChildren =
|
||||
AppSubscriptionsRouteRouteChildren,
|
||||
)
|
||||
|
||||
interface AppTasksRouteRouteChildren {
|
||||
AppTasksManageRoute: typeof AppTasksManageRoute
|
||||
AppTasksDetailIdRoute: typeof AppTasksDetailIdRoute
|
||||
}
|
||||
|
||||
const AppTasksRouteRouteChildren: AppTasksRouteRouteChildren = {
|
||||
AppTasksManageRoute: AppTasksManageRoute,
|
||||
AppTasksDetailIdRoute: AppTasksDetailIdRoute,
|
||||
}
|
||||
|
||||
const AppTasksRouteRouteWithChildren = AppTasksRouteRoute._addFileChildren(
|
||||
AppTasksRouteRouteChildren,
|
||||
)
|
||||
|
||||
interface AppRouteRouteChildren {
|
||||
AppBangumiRouteRoute: typeof AppBangumiRouteRouteWithChildren
|
||||
AppCredential3rdRouteRoute: typeof AppCredential3rdRouteRouteWithChildren
|
||||
AppPlaygroundRouteRoute: typeof AppPlaygroundRouteRouteWithChildren
|
||||
AppSettingsRouteRoute: typeof AppSettingsRouteRouteWithChildren
|
||||
AppSubscriptionsRouteRoute: typeof AppSubscriptionsRouteRouteWithChildren
|
||||
AppTasksRouteRoute: typeof AppTasksRouteRouteWithChildren
|
||||
AppExploreExploreRoute: typeof AppExploreExploreRoute
|
||||
AppExploreFeedRoute: typeof AppExploreFeedRoute
|
||||
}
|
||||
@@ -462,6 +519,7 @@ const AppRouteRouteChildren: AppRouteRouteChildren = {
|
||||
AppPlaygroundRouteRoute: AppPlaygroundRouteRouteWithChildren,
|
||||
AppSettingsRouteRoute: AppSettingsRouteRouteWithChildren,
|
||||
AppSubscriptionsRouteRoute: AppSubscriptionsRouteRouteWithChildren,
|
||||
AppTasksRouteRoute: AppTasksRouteRouteWithChildren,
|
||||
AppExploreExploreRoute: AppExploreExploreRoute,
|
||||
AppExploreFeedRoute: AppExploreFeedRoute,
|
||||
}
|
||||
@@ -480,6 +538,7 @@ export interface FileRoutesByFullPath {
|
||||
'/playground': typeof AppPlaygroundRouteRouteWithChildren
|
||||
'/settings': typeof AppSettingsRouteRouteWithChildren
|
||||
'/subscriptions': typeof AppSubscriptionsRouteRouteWithChildren
|
||||
'/tasks': typeof AppTasksRouteRouteWithChildren
|
||||
'/auth/sign-in': typeof AuthSignInRoute
|
||||
'/auth/sign-up': typeof AuthSignUpRoute
|
||||
'/explore': typeof AppExploreExploreRoute
|
||||
@@ -491,11 +550,13 @@ export interface FileRoutesByFullPath {
|
||||
'/settings/downloader': typeof AppSettingsDownloaderRoute
|
||||
'/subscriptions/create': typeof AppSubscriptionsCreateRoute
|
||||
'/subscriptions/manage': typeof AppSubscriptionsManageRoute
|
||||
'/tasks/manage': typeof AppTasksManageRoute
|
||||
'/auth/oidc/callback': typeof AuthOidcCallbackRoute
|
||||
'/credential3rd/detail/$id': typeof AppCredential3rdDetailIdRoute
|
||||
'/credential3rd/edit/$id': typeof AppCredential3rdEditIdRoute
|
||||
'/subscriptions/detail/$id': typeof AppSubscriptionsDetailIdRoute
|
||||
'/subscriptions/edit/$id': typeof AppSubscriptionsEditIdRoute
|
||||
'/tasks/detail/$id': typeof AppTasksDetailIdRoute
|
||||
}
|
||||
|
||||
export interface FileRoutesByTo {
|
||||
@@ -508,6 +569,7 @@ export interface FileRoutesByTo {
|
||||
'/playground': typeof AppPlaygroundRouteRouteWithChildren
|
||||
'/settings': typeof AppSettingsRouteRouteWithChildren
|
||||
'/subscriptions': typeof AppSubscriptionsRouteRouteWithChildren
|
||||
'/tasks': typeof AppTasksRouteRouteWithChildren
|
||||
'/auth/sign-in': typeof AuthSignInRoute
|
||||
'/auth/sign-up': typeof AuthSignUpRoute
|
||||
'/explore': typeof AppExploreExploreRoute
|
||||
@@ -519,11 +581,13 @@ export interface FileRoutesByTo {
|
||||
'/settings/downloader': typeof AppSettingsDownloaderRoute
|
||||
'/subscriptions/create': typeof AppSubscriptionsCreateRoute
|
||||
'/subscriptions/manage': typeof AppSubscriptionsManageRoute
|
||||
'/tasks/manage': typeof AppTasksManageRoute
|
||||
'/auth/oidc/callback': typeof AuthOidcCallbackRoute
|
||||
'/credential3rd/detail/$id': typeof AppCredential3rdDetailIdRoute
|
||||
'/credential3rd/edit/$id': typeof AppCredential3rdEditIdRoute
|
||||
'/subscriptions/detail/$id': typeof AppSubscriptionsDetailIdRoute
|
||||
'/subscriptions/edit/$id': typeof AppSubscriptionsEditIdRoute
|
||||
'/tasks/detail/$id': typeof AppTasksDetailIdRoute
|
||||
}
|
||||
|
||||
export interface FileRoutesById {
|
||||
@@ -537,6 +601,7 @@ export interface FileRoutesById {
|
||||
'/_app/playground': typeof AppPlaygroundRouteRouteWithChildren
|
||||
'/_app/settings': typeof AppSettingsRouteRouteWithChildren
|
||||
'/_app/subscriptions': typeof AppSubscriptionsRouteRouteWithChildren
|
||||
'/_app/tasks': typeof AppTasksRouteRouteWithChildren
|
||||
'/auth/sign-in': typeof AuthSignInRoute
|
||||
'/auth/sign-up': typeof AuthSignUpRoute
|
||||
'/_app/_explore/explore': typeof AppExploreExploreRoute
|
||||
@@ -548,11 +613,13 @@ export interface FileRoutesById {
|
||||
'/_app/settings/downloader': typeof AppSettingsDownloaderRoute
|
||||
'/_app/subscriptions/create': typeof AppSubscriptionsCreateRoute
|
||||
'/_app/subscriptions/manage': typeof AppSubscriptionsManageRoute
|
||||
'/_app/tasks/manage': typeof AppTasksManageRoute
|
||||
'/auth/oidc/callback': typeof AuthOidcCallbackRoute
|
||||
'/_app/credential3rd/detail/$id': typeof AppCredential3rdDetailIdRoute
|
||||
'/_app/credential3rd/edit/$id': typeof AppCredential3rdEditIdRoute
|
||||
'/_app/subscriptions/detail/$id': typeof AppSubscriptionsDetailIdRoute
|
||||
'/_app/subscriptions/edit/$id': typeof AppSubscriptionsEditIdRoute
|
||||
'/_app/tasks/detail/$id': typeof AppTasksDetailIdRoute
|
||||
}
|
||||
|
||||
export interface FileRouteTypes {
|
||||
@@ -567,6 +634,7 @@ export interface FileRouteTypes {
|
||||
| '/playground'
|
||||
| '/settings'
|
||||
| '/subscriptions'
|
||||
| '/tasks'
|
||||
| '/auth/sign-in'
|
||||
| '/auth/sign-up'
|
||||
| '/explore'
|
||||
@@ -578,11 +646,13 @@ export interface FileRouteTypes {
|
||||
| '/settings/downloader'
|
||||
| '/subscriptions/create'
|
||||
| '/subscriptions/manage'
|
||||
| '/tasks/manage'
|
||||
| '/auth/oidc/callback'
|
||||
| '/credential3rd/detail/$id'
|
||||
| '/credential3rd/edit/$id'
|
||||
| '/subscriptions/detail/$id'
|
||||
| '/subscriptions/edit/$id'
|
||||
| '/tasks/detail/$id'
|
||||
fileRoutesByTo: FileRoutesByTo
|
||||
to:
|
||||
| '/'
|
||||
@@ -594,6 +664,7 @@ export interface FileRouteTypes {
|
||||
| '/playground'
|
||||
| '/settings'
|
||||
| '/subscriptions'
|
||||
| '/tasks'
|
||||
| '/auth/sign-in'
|
||||
| '/auth/sign-up'
|
||||
| '/explore'
|
||||
@@ -605,11 +676,13 @@ export interface FileRouteTypes {
|
||||
| '/settings/downloader'
|
||||
| '/subscriptions/create'
|
||||
| '/subscriptions/manage'
|
||||
| '/tasks/manage'
|
||||
| '/auth/oidc/callback'
|
||||
| '/credential3rd/detail/$id'
|
||||
| '/credential3rd/edit/$id'
|
||||
| '/subscriptions/detail/$id'
|
||||
| '/subscriptions/edit/$id'
|
||||
| '/tasks/detail/$id'
|
||||
id:
|
||||
| '__root__'
|
||||
| '/'
|
||||
@@ -621,6 +694,7 @@ export interface FileRouteTypes {
|
||||
| '/_app/playground'
|
||||
| '/_app/settings'
|
||||
| '/_app/subscriptions'
|
||||
| '/_app/tasks'
|
||||
| '/auth/sign-in'
|
||||
| '/auth/sign-up'
|
||||
| '/_app/_explore/explore'
|
||||
@@ -632,11 +706,13 @@ export interface FileRouteTypes {
|
||||
| '/_app/settings/downloader'
|
||||
| '/_app/subscriptions/create'
|
||||
| '/_app/subscriptions/manage'
|
||||
| '/_app/tasks/manage'
|
||||
| '/auth/oidc/callback'
|
||||
| '/_app/credential3rd/detail/$id'
|
||||
| '/_app/credential3rd/edit/$id'
|
||||
| '/_app/subscriptions/detail/$id'
|
||||
| '/_app/subscriptions/edit/$id'
|
||||
| '/_app/tasks/detail/$id'
|
||||
fileRoutesById: FileRoutesById
|
||||
}
|
||||
|
||||
@@ -690,6 +766,7 @@ export const routeTree = rootRoute
|
||||
"/_app/playground",
|
||||
"/_app/settings",
|
||||
"/_app/subscriptions",
|
||||
"/_app/tasks",
|
||||
"/_app/_explore/explore",
|
||||
"/_app/_explore/feed"
|
||||
]
|
||||
@@ -741,6 +818,14 @@ export const routeTree = rootRoute
|
||||
"/_app/subscriptions/edit/$id"
|
||||
]
|
||||
},
|
||||
"/_app/tasks": {
|
||||
"filePath": "_app/tasks/route.tsx",
|
||||
"parent": "/_app",
|
||||
"children": [
|
||||
"/_app/tasks/manage",
|
||||
"/_app/tasks/detail/$id"
|
||||
]
|
||||
},
|
||||
"/auth/sign-in": {
|
||||
"filePath": "auth/sign-in.tsx"
|
||||
},
|
||||
@@ -783,6 +868,10 @@ export const routeTree = rootRoute
|
||||
"filePath": "_app/subscriptions/manage.tsx",
|
||||
"parent": "/_app/subscriptions"
|
||||
},
|
||||
"/_app/tasks/manage": {
|
||||
"filePath": "_app/tasks/manage.tsx",
|
||||
"parent": "/_app/tasks"
|
||||
},
|
||||
"/auth/oidc/callback": {
|
||||
"filePath": "auth/oidc/callback.tsx"
|
||||
},
|
||||
@@ -801,6 +890,10 @@ export const routeTree = rootRoute
|
||||
"/_app/subscriptions/edit/$id": {
|
||||
"filePath": "_app/subscriptions/edit.$id.tsx",
|
||||
"parent": "/_app/subscriptions"
|
||||
},
|
||||
"/_app/tasks/detail/$id": {
|
||||
"filePath": "_app/tasks/detail.$id.tsx",
|
||||
"parent": "/_app/tasks"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
import { Button } from '@/components/ui/button';
|
||||
import {
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@/components/ui/dialog';
|
||||
import { CHECK_CREDENTIAL_3RD_AVAILABLE } from '@/domains/recorder/schema/credential3rd';
|
||||
import {
|
||||
apolloErrorToMessage,
|
||||
getApolloQueryError,
|
||||
} from '@/infra/errors/apollo';
|
||||
import type { CheckCredential3rdAvailableQuery } from '@/infra/graphql/gql/graphql';
|
||||
import { useLazyQuery } from '@apollo/client';
|
||||
import { CheckIcon, Loader2, XIcon } from 'lucide-react';
|
||||
import { memo, useCallback } from 'react';
|
||||
import { toast } from 'sonner';
|
||||
|
||||
export interface Credential3rdCheckAvailableViewProps {
|
||||
id: number;
|
||||
}
|
||||
|
||||
export const Credential3rdCheckAvailableView = memo(
|
||||
({ id }: Credential3rdCheckAvailableViewProps) => {
|
||||
const [checkAvailable, { data, error, loading }] =
|
||||
useLazyQuery<CheckCredential3rdAvailableQuery>(
|
||||
CHECK_CREDENTIAL_3RD_AVAILABLE,
|
||||
{
|
||||
variables: { id },
|
||||
}
|
||||
);
|
||||
|
||||
const handleCheckAvailable = useCallback(async () => {
|
||||
const checkResult = await checkAvailable();
|
||||
const error = getApolloQueryError(checkResult);
|
||||
console.error('error', error);
|
||||
if (error) {
|
||||
toast.error('Failed to check available', {
|
||||
description: apolloErrorToMessage(error),
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (checkResult.data?.credential3rdCheckAvailable.available) {
|
||||
toast.success('Credential is available');
|
||||
} else {
|
||||
toast.error('Credential is not available');
|
||||
}
|
||||
}, [checkAvailable]);
|
||||
|
||||
const available = data?.credential3rdCheckAvailable?.available;
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-2">
|
||||
<Button
|
||||
variant="outline"
|
||||
size="lg"
|
||||
onClick={handleCheckAvailable}
|
||||
disabled={loading}
|
||||
>
|
||||
<span> Check Available </span>
|
||||
{available === true && (
|
||||
<CheckIcon className="h-4 w-4 text-green-300" />
|
||||
)}
|
||||
{(available === false || !!error) && (
|
||||
<XIcon className="h-4 w-4 text-red-500" />
|
||||
)}
|
||||
{loading && <Loader2 className="h-4 w-4 animate-spin" />}
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
export interface Credential3rdCheckAvailableViewDialogContentProps {
|
||||
id: number;
|
||||
}
|
||||
|
||||
export const Credential3rdCheckAvailableViewDialogContent = memo(
|
||||
({ id }: Credential3rdCheckAvailableViewDialogContentProps) => {
|
||||
return (
|
||||
<DialogContent>
|
||||
<DialogHeader>
|
||||
<DialogTitle>Check Available</DialogTitle>
|
||||
<DialogDescription>
|
||||
Check if the credential is available.
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<Credential3rdCheckAvailableView id={id} />
|
||||
</DialogContent>
|
||||
);
|
||||
}
|
||||
);
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
CardTitle,
|
||||
} from '@/components/ui/card';
|
||||
import { DetailEmptyView } from '@/components/ui/detail-empty-view';
|
||||
import { Dialog, DialogTrigger } from '@/components/ui/dialog';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { QueryErrorView } from '@/components/ui/query-error-view';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
@@ -23,8 +24,9 @@ import {
|
||||
useRouter,
|
||||
} from '@tanstack/react-router';
|
||||
import { format } from 'date-fns/format';
|
||||
import { ArrowLeft, Edit, Eye, EyeOff } from 'lucide-react';
|
||||
import { ArrowLeft, CheckIcon, Edit, Eye, EyeOff } from 'lucide-react';
|
||||
import { useState } from 'react';
|
||||
import { Credential3rdCheckAvailableViewDialogContent } from './-check-available';
|
||||
|
||||
export const Route = createFileRoute('/_app/credential3rd/detail/$id')({
|
||||
component: Credential3rdDetailRouteComponent,
|
||||
@@ -57,7 +59,6 @@ function Credential3rdDetailRouteComponent() {
|
||||
variables: {
|
||||
id: Number.parseInt(id),
|
||||
},
|
||||
fetchPolicy: 'cache-and-network',
|
||||
}
|
||||
);
|
||||
|
||||
@@ -125,7 +126,19 @@ function Credential3rdDetailRouteComponent() {
|
||||
View credential detail
|
||||
</CardDescription>
|
||||
</div>
|
||||
<Badge variant="secondary">{credential.credentialType}</Badge>
|
||||
<div className="flex items-center gap-2">
|
||||
<Dialog>
|
||||
<DialogTrigger asChild>
|
||||
<Button variant="outline" size="sm">
|
||||
<CheckIcon className="h-4 w-4" />
|
||||
Check Available
|
||||
</Button>
|
||||
</DialogTrigger>
|
||||
<Credential3rdCheckAvailableViewDialogContent
|
||||
id={credential.id}
|
||||
/>
|
||||
</Dialog>
|
||||
</div>
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
|
||||
@@ -27,6 +27,10 @@ import {
|
||||
GET_CREDENTIAL_3RD_DETAIL,
|
||||
UPDATE_CREDENTIAL_3RD,
|
||||
} from '@/domains/recorder/schema/credential3rd';
|
||||
import {
|
||||
apolloErrorToMessage,
|
||||
getApolloQueryError,
|
||||
} from '@/infra/errors/apollo';
|
||||
import type {
|
||||
Credential3rdTypeEnum,
|
||||
GetCredential3rdDetailQuery,
|
||||
@@ -260,19 +264,19 @@ function Credential3rdEditRouteComponent() {
|
||||
variables: {
|
||||
id: Number.parseInt(id),
|
||||
},
|
||||
fetchPolicy: 'cache-and-network',
|
||||
});
|
||||
|
||||
const credential = data?.credential3rd?.nodes?.[0];
|
||||
|
||||
const onCompleted = useCallback(async () => {
|
||||
const refetchResult = await refetch();
|
||||
if (refetchResult.errors) {
|
||||
toast('Update credential failed', {
|
||||
description: refetchResult.errors[0].message,
|
||||
const error = getApolloQueryError(refetchResult);
|
||||
if (error) {
|
||||
toast.error('Update credential failed', {
|
||||
description: apolloErrorToMessage(error),
|
||||
});
|
||||
} else {
|
||||
toast('Update credential successfully');
|
||||
toast.success('Update credential successfully');
|
||||
}
|
||||
}, [refetch]);
|
||||
|
||||
|
||||
@@ -18,6 +18,10 @@ import {
|
||||
DELETE_CREDENTIAL_3RD,
|
||||
GET_CREDENTIAL_3RD,
|
||||
} from '@/domains/recorder/schema/credential3rd';
|
||||
import {
|
||||
apolloErrorToMessage,
|
||||
getApolloQueryError,
|
||||
} from '@/infra/errors/apollo';
|
||||
import type { GetCredential3rdQuery } from '@/infra/graphql/gql/graphql';
|
||||
import type { RouteStateDataOption } from '@/infra/routes/traits';
|
||||
import { useDebouncedSkeleton } from '@/presentation/hooks/use-debounded-skeleton';
|
||||
@@ -79,17 +83,16 @@ function CredentialManageRouteComponent() {
|
||||
},
|
||||
},
|
||||
},
|
||||
fetchPolicy: 'cache-and-network',
|
||||
nextFetchPolicy: 'network-only',
|
||||
}
|
||||
);
|
||||
|
||||
const [deleteCredential] = useMutation(DELETE_CREDENTIAL_3RD, {
|
||||
onCompleted: async () => {
|
||||
const refetchResult = await refetch();
|
||||
if (refetchResult.errors) {
|
||||
const error = getApolloQueryError(refetchResult);
|
||||
if (error) {
|
||||
toast.error('Failed to delete credential', {
|
||||
description: refetchResult.errors[0].message,
|
||||
description: apolloErrorToMessage(error),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -28,8 +28,6 @@ export function Credential3rdSelectContent({
|
||||
GetCredential3rdQuery,
|
||||
GetCredential3rdQueryVariables
|
||||
>(GET_CREDENTIAL_3RD, {
|
||||
fetchPolicy: 'cache-and-network',
|
||||
nextFetchPolicy: 'cache-and-network',
|
||||
variables: {
|
||||
filters: {
|
||||
credentialType: {
|
||||
|
||||
160
apps/webui/src/presentation/routes/_app/subscriptions/-sync.tsx
Normal file
160
apps/webui/src/presentation/routes/_app/subscriptions/-sync.tsx
Normal file
@@ -0,0 +1,160 @@
|
||||
import { Button } from '@/components/ui/button';
|
||||
import {
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@/components/ui/dialog';
|
||||
import { Spinner } from '@/components/ui/spinner';
|
||||
import {
|
||||
SYNC_SUBSCRIPTION_FEEDS_FULL,
|
||||
SYNC_SUBSCRIPTION_FEEDS_INCREMENTAL,
|
||||
SYNC_SUBSCRIPTION_SOURCES,
|
||||
} from '@/domains/recorder/schema/subscriptions';
|
||||
import type {
|
||||
SyncSubscriptionFeedsFullMutation,
|
||||
SyncSubscriptionFeedsFullMutationVariables,
|
||||
SyncSubscriptionFeedsIncrementalMutation,
|
||||
SyncSubscriptionFeedsIncrementalMutationVariables,
|
||||
SyncSubscriptionSourcesMutation,
|
||||
SyncSubscriptionSourcesMutationVariables,
|
||||
} from '@/infra/graphql/gql/graphql';
|
||||
import { useMutation } from '@apollo/client';
|
||||
import { useNavigate } from '@tanstack/react-router';
|
||||
import { RefreshCcwIcon } from 'lucide-react';
|
||||
import { memo, useCallback } from 'react';
|
||||
import { toast } from 'sonner';
|
||||
|
||||
export type SubscriptionSyncViewCompletePayload = {
|
||||
taskId: string;
|
||||
};
|
||||
|
||||
export interface SubscriptionSyncViewProps {
|
||||
id: number;
|
||||
onComplete: (payload: SubscriptionSyncViewCompletePayload) => void;
|
||||
}
|
||||
|
||||
export const SubscriptionSyncView = memo(
|
||||
({ id, onComplete }: SubscriptionSyncViewProps) => {
|
||||
const [syncSubscriptionFeedsIncremental, { loading: loadingIncremental }] =
|
||||
useMutation<
|
||||
SyncSubscriptionFeedsIncrementalMutation,
|
||||
SyncSubscriptionFeedsIncrementalMutationVariables
|
||||
>(SYNC_SUBSCRIPTION_FEEDS_INCREMENTAL, {
|
||||
onCompleted: (data) => {
|
||||
toast.success('Sync completed');
|
||||
onComplete(data.subscriptionSyncOneFeedsIncremental);
|
||||
},
|
||||
onError: (error) => {
|
||||
toast.error('Failed to sync subscription', {
|
||||
description: error.message,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
const [syncSubscriptionFeedsFull, { loading: loadingFull }] = useMutation<
|
||||
SyncSubscriptionFeedsFullMutation,
|
||||
SyncSubscriptionFeedsFullMutationVariables
|
||||
>(SYNC_SUBSCRIPTION_FEEDS_FULL, {
|
||||
onCompleted: (data) => {
|
||||
toast.success('Sync completed');
|
||||
onComplete(data.subscriptionSyncOneFeedsFull);
|
||||
},
|
||||
onError: (error) => {
|
||||
toast.error('Failed to sync subscription', {
|
||||
description: error.message,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
const [syncSubscriptionSources, { loading: loadingSources }] = useMutation<
|
||||
SyncSubscriptionSourcesMutation,
|
||||
SyncSubscriptionSourcesMutationVariables
|
||||
>(SYNC_SUBSCRIPTION_SOURCES, {
|
||||
onCompleted: (data) => {
|
||||
toast.success('Sync completed');
|
||||
onComplete(data.subscriptionSyncOneSources);
|
||||
},
|
||||
onError: (error) => {
|
||||
toast.error('Failed to sync subscription', {
|
||||
description: error.message,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
const loading = loadingIncremental || loadingFull || loadingSources;
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-2">
|
||||
<Button
|
||||
size="lg"
|
||||
variant="outline"
|
||||
onClick={() => syncSubscriptionSources({ variables: { id } })}
|
||||
>
|
||||
<RefreshCcwIcon className="h-4 w-4" />
|
||||
<span>Sources</span>
|
||||
</Button>
|
||||
<Button
|
||||
size="lg"
|
||||
variant="outline"
|
||||
onClick={() =>
|
||||
syncSubscriptionFeedsIncremental({ variables: { id } })
|
||||
}
|
||||
>
|
||||
<RefreshCcwIcon className="h-4 w-4" />
|
||||
<span>Incremental Feeds</span>
|
||||
</Button>
|
||||
<Button
|
||||
size="lg"
|
||||
variant="outline"
|
||||
onClick={() => syncSubscriptionFeedsFull({ variables: { id } })}
|
||||
>
|
||||
<RefreshCcwIcon className="h-4 w-4" />
|
||||
<span>Full Feeds</span>
|
||||
</Button>
|
||||
|
||||
{loading && (
|
||||
<div className="absolute inset-0 flex flex-row items-center justify-center gap-2">
|
||||
<Spinner variant="circle-filled" size="16" />
|
||||
<span>Syncing...</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
export interface SubscriptionSyncDialogContentProps {
|
||||
id: number;
|
||||
onCancel: VoidFunction;
|
||||
}
|
||||
|
||||
export const SubscriptionSyncDialogContent = memo(
|
||||
({ id, onCancel }: SubscriptionSyncDialogContentProps) => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
const handleSyncComplete = useCallback(
|
||||
(payload: SubscriptionSyncViewCompletePayload) => {
|
||||
navigate({
|
||||
to: '/tasks/detail/$id',
|
||||
params: {
|
||||
id: `${payload.taskId}`,
|
||||
},
|
||||
});
|
||||
},
|
||||
[navigate]
|
||||
);
|
||||
|
||||
return (
|
||||
<DialogContent onAbort={onCancel}>
|
||||
<DialogHeader>
|
||||
<DialogTitle>Sync Subscription</DialogTitle>
|
||||
<DialogDescription>
|
||||
Sync the subscription with sources and feeds.
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<SubscriptionSyncView id={id} onComplete={handleSyncComplete} />
|
||||
</DialogContent>
|
||||
);
|
||||
}
|
||||
);
|
||||
@@ -9,12 +9,17 @@ import {
|
||||
CardTitle,
|
||||
} from '@/components/ui/card';
|
||||
import { DetailEmptyView } from '@/components/ui/detail-empty-view';
|
||||
import { Dialog, DialogTrigger } from '@/components/ui/dialog';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { QueryErrorView } from '@/components/ui/query-error-view';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
import { GET_SUBSCRIPTION_DETAIL } from '@/domains/recorder/schema/subscriptions';
|
||||
import { SubscriptionService } from '@/domains/recorder/services/subscription.service';
|
||||
import { useInject } from '@/infra/di/inject';
|
||||
import {
|
||||
apolloErrorToMessage,
|
||||
getApolloQueryError,
|
||||
} from '@/infra/errors/apollo';
|
||||
import {
|
||||
type GetSubscriptionDetailQuery,
|
||||
SubscriptionCategoryEnum,
|
||||
@@ -27,8 +32,16 @@ import {
|
||||
useRouter,
|
||||
} from '@tanstack/react-router';
|
||||
import { format } from 'date-fns';
|
||||
import { ArrowLeft, Edit, ExternalLink } from 'lucide-react';
|
||||
import {
|
||||
ArrowLeft,
|
||||
Edit,
|
||||
ExternalLink,
|
||||
ListIcon,
|
||||
RefreshCcwIcon,
|
||||
} from 'lucide-react';
|
||||
import { useMemo } from 'react';
|
||||
import { toast } from 'sonner';
|
||||
import { SubscriptionSyncDialogContent } from './-sync';
|
||||
|
||||
export const Route = createFileRoute('/_app/subscriptions/detail/$id')({
|
||||
component: SubscriptionDetailRouteComponent,
|
||||
@@ -51,15 +64,22 @@ function SubscriptionDetailRouteComponent() {
|
||||
}
|
||||
};
|
||||
|
||||
const { data, loading, error } = useQuery<GetSubscriptionDetailQuery>(
|
||||
GET_SUBSCRIPTION_DETAIL,
|
||||
{
|
||||
const handleReload = async () => {
|
||||
const result = await refetch();
|
||||
const error = getApolloQueryError(result);
|
||||
if (error) {
|
||||
toast.error('Failed to reload subscription', {
|
||||
description: apolloErrorToMessage(error),
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const { data, loading, error, refetch } =
|
||||
useQuery<GetSubscriptionDetailQuery>(GET_SUBSCRIPTION_DETAIL, {
|
||||
variables: {
|
||||
id: Number.parseInt(id),
|
||||
},
|
||||
fetchPolicy: 'cache-and-network',
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
const handleEnterEditMode = () => {
|
||||
navigate({
|
||||
@@ -69,6 +89,7 @@ function SubscriptionDetailRouteComponent() {
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const subscription = data?.subscriptions?.nodes?.[0];
|
||||
|
||||
const sourceUrlMeta = useMemo(
|
||||
@@ -123,7 +144,7 @@ function SubscriptionDetailRouteComponent() {
|
||||
<Button onClick={handleEnterEditMode}>
|
||||
<Edit className="mr-2 h-4 w-4" />
|
||||
Edit
|
||||
</Button>
|
||||
</Button>{' '}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -137,10 +158,30 @@ function SubscriptionDetailRouteComponent() {
|
||||
</CardDescription>
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<Badge variant={subscription.enabled ? 'default' : 'secondary'}>
|
||||
{subscription.enabled ? 'Enabled' : 'Disabled'}
|
||||
</Badge>
|
||||
<Badge variant="outline">{subscription.category}</Badge>
|
||||
<Dialog>
|
||||
<DialogTrigger asChild>
|
||||
<Button variant="outline" size="sm">
|
||||
<RefreshCcwIcon className="h-4 w-4" />
|
||||
Sync
|
||||
</Button>
|
||||
</DialogTrigger>
|
||||
<SubscriptionSyncDialogContent
|
||||
id={subscription.id}
|
||||
onCancel={handleReload}
|
||||
/>
|
||||
</Dialog>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() =>
|
||||
navigate({
|
||||
to: '/tasks/manage',
|
||||
})
|
||||
}
|
||||
>
|
||||
<ListIcon className="h-4 w-4" />
|
||||
Tasks
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</CardHeader>
|
||||
@@ -173,11 +214,9 @@ function SubscriptionDetailRouteComponent() {
|
||||
<div className="space-y-2">
|
||||
<Label className="font-medium text-sm">Enabled</Label>
|
||||
<div className="rounded-md bg-muted p-3">
|
||||
<Badge
|
||||
variant={subscription.enabled ? 'default' : 'secondary'}
|
||||
>
|
||||
<span className="text-sm">
|
||||
{subscription.enabled ? 'Enabled' : 'Disabled'}
|
||||
</Badge>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -31,6 +31,10 @@ import {
|
||||
} from '@/domains/recorder/schema/subscriptions';
|
||||
import { SubscriptionService } from '@/domains/recorder/services/subscription.service';
|
||||
import { useInject } from '@/infra/di/inject';
|
||||
import {
|
||||
apolloErrorToMessage,
|
||||
getApolloQueryError,
|
||||
} from '@/infra/errors/apollo';
|
||||
import {
|
||||
Credential3rdTypeEnum,
|
||||
type GetSubscriptionDetailQuery,
|
||||
@@ -382,16 +386,16 @@ function SubscriptionEditRouteComponent() {
|
||||
variables: {
|
||||
id: Number.parseInt(id),
|
||||
},
|
||||
fetchPolicy: 'cache-and-network',
|
||||
});
|
||||
|
||||
const subscription = data?.subscriptions?.nodes?.[0];
|
||||
|
||||
const onCompleted = useCallback(async () => {
|
||||
const refetchResult = await refetch();
|
||||
if (refetchResult.errors) {
|
||||
const error = getApolloQueryError(refetchResult);
|
||||
if (error) {
|
||||
toast.error('Update subscription failed', {
|
||||
description: refetchResult.errors[0].message,
|
||||
description: apolloErrorToMessage(error),
|
||||
});
|
||||
} else {
|
||||
toast.success('Update subscription successfully');
|
||||
|
||||
@@ -19,6 +19,10 @@ import {
|
||||
type SubscriptionDto,
|
||||
UPDATE_SUBSCRIPTIONS,
|
||||
} from '@/domains/recorder/schema/subscriptions';
|
||||
import {
|
||||
apolloErrorToMessage,
|
||||
getApolloQueryError,
|
||||
} from '@/infra/errors/apollo';
|
||||
import type {
|
||||
GetSubscriptionsQuery,
|
||||
SubscriptionsUpdateInput,
|
||||
@@ -81,15 +85,16 @@ function SubscriptionManageRouteComponent() {
|
||||
updatedAt: 'DESC',
|
||||
},
|
||||
},
|
||||
refetchWritePolicy: 'overwrite',
|
||||
nextFetchPolicy: 'network-only',
|
||||
}
|
||||
);
|
||||
const [updateSubscription] = useMutation(UPDATE_SUBSCRIPTIONS, {
|
||||
onCompleted: async () => {
|
||||
const refetchResult = await refetch();
|
||||
if (refetchResult.errors) {
|
||||
toast.error(refetchResult.errors[0].message);
|
||||
const error = getApolloQueryError(refetchResult);
|
||||
if (error) {
|
||||
toast.error('Failed to update subscription', {
|
||||
description: apolloErrorToMessage(error),
|
||||
});
|
||||
return;
|
||||
}
|
||||
toast.success('Subscription updated');
|
||||
@@ -103,8 +108,11 @@ function SubscriptionManageRouteComponent() {
|
||||
const [deleteSubscription] = useMutation(DELETE_SUBSCRIPTIONS, {
|
||||
onCompleted: async () => {
|
||||
const refetchResult = await refetch();
|
||||
if (refetchResult.errors) {
|
||||
toast.error(refetchResult.errors[0].message);
|
||||
const error = getApolloQueryError(refetchResult);
|
||||
if (error) {
|
||||
toast.error('Failed to delete subscription', {
|
||||
description: apolloErrorToMessage(error),
|
||||
});
|
||||
return;
|
||||
}
|
||||
toast.success('Subscription deleted');
|
||||
|
||||
13
apps/webui/src/presentation/routes/_app/tasks/detail.$id.tsx
Normal file
13
apps/webui/src/presentation/routes/_app/tasks/detail.$id.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { RouteStateDataOption } from '@/infra/routes/traits';
|
||||
import { createFileRoute } from '@tanstack/react-router';
|
||||
|
||||
export const Route = createFileRoute('/_app/tasks/detail/$id')({
|
||||
component: TaskDetailRouteComponent,
|
||||
staticData: {
|
||||
breadcrumb: { label: 'Detail' },
|
||||
} satisfies RouteStateDataOption,
|
||||
});
|
||||
|
||||
function TaskDetailRouteComponent() {
|
||||
return <div>Hello "/_app/tasks/detail/$id"!</div>;
|
||||
}
|
||||
13
apps/webui/src/presentation/routes/_app/tasks/manage.tsx
Normal file
13
apps/webui/src/presentation/routes/_app/tasks/manage.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { RouteStateDataOption } from '@/infra/routes/traits';
|
||||
import { createFileRoute } from '@tanstack/react-router';
|
||||
|
||||
export const Route = createFileRoute('/_app/tasks/manage')({
|
||||
component: TaskManageRouteComponent,
|
||||
staticData: {
|
||||
breadcrumb: { label: 'Manage' },
|
||||
} satisfies RouteStateDataOption,
|
||||
});
|
||||
|
||||
function TaskManageRouteComponent() {
|
||||
return <div>Hello "/_app/tasks/manage"!</div>;
|
||||
}
|
||||
8
apps/webui/src/presentation/routes/_app/tasks/route.tsx
Normal file
8
apps/webui/src/presentation/routes/_app/tasks/route.tsx
Normal file
@@ -0,0 +1,8 @@
|
||||
import { buildVirtualBranchRouteOptions } from '@/infra/routes/utils';
|
||||
import { createFileRoute } from '@tanstack/react-router';
|
||||
|
||||
export const Route = createFileRoute('/_app/tasks')(
|
||||
buildVirtualBranchRouteOptions({
|
||||
title: 'Tasks',
|
||||
})
|
||||
);
|
||||
Reference in New Issue
Block a user