diff --git a/src/index.tsx b/src/index.tsx index 43595cb..2e4efd5 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -3974,6 +3974,122 @@ export type GetMedalsQuery = { }; }; +export type GetNotificationsQueryVariables = Exact<{ + limit?: Scalars["Int"]["input"]; + offset?: Scalars["Int"]["input"]; + filters?: InputMaybe; +}>; + +export type GetNotificationsQuery = { + __typename?: "Query"; + notifications: { + __typename?: "NotificationConnection"; + totalCount: number; + unreadCount: number; + hasMore: boolean; + notifications: Array<{ + __typename?: "NotificationGQL"; + id: number; + notificationType: NotificationTypeEnum; + videoId?: number | null; + reactionType?: string | null; + isRead: boolean; + createdAt: any; + readAt?: any | null; + actor: { + __typename?: "UserGQL"; + id: number; + username: string; + profileImageUri?: string | null; + }; + comment?: { + __typename?: "CommentGQL"; + id: number; + message: string; + user: { + __typename?: "UserGQL"; + id: number; + username: string; + profileImageUri?: string | null; + }; + } | null; + }>; + }; +}; + +export type GetUnreadNotificationCountQueryVariables = Exact<{ + [key: string]: never; +}>; + +export type GetUnreadNotificationCountQuery = { + __typename?: "Query"; + unreadNotificationCount: number; +}; + +export type MarkNotificationAsReadMutationVariables = Exact<{ + notificationId: Scalars["Int"]["input"]; +}>; + +export type MarkNotificationAsReadMutation = { + __typename?: "Mutation"; + markNotificationAsRead: boolean; +}; + +export type MarkNotificationsAsReadMutationVariables = Exact<{ + notificationIds: Array | Scalars["Int"]["input"]; +}>; + +export type MarkNotificationsAsReadMutation = { + __typename?: "Mutation"; + markNotificationsAsRead: boolean; +}; + +export type MarkAllNotificationsAsReadMutationVariables = Exact<{ + [key: string]: never; +}>; + +export type MarkAllNotificationsAsReadMutation = { + __typename?: "Mutation"; + markAllNotificationsAsRead: boolean; +}; + +export type DeleteNotificationMutationVariables = Exact<{ + notificationId: Scalars["Int"]["input"]; +}>; + +export type DeleteNotificationMutation = { + __typename?: "Mutation"; + deleteNotification: boolean; +}; + +export type NotificationFragment = { + __typename?: "NotificationGQL"; + id: number; + notificationType: NotificationTypeEnum; + videoId?: number | null; + reactionType?: string | null; + isRead: boolean; + createdAt: any; + readAt?: any | null; + actor: { + __typename?: "UserGQL"; + id: number; + username: string; + profileImageUri?: string | null; + }; + comment?: { + __typename?: "CommentGQL"; + id: number; + message: string; + user: { + __typename?: "UserGQL"; + id: number; + username: string; + profileImageUri?: string | null; + }; + } | null; +}; + export type EnsureStripeCustomerExistsMutationVariables = Exact<{ [key: string]: never; }>; @@ -4332,6 +4448,10 @@ export type GetShotsWithMetadataFilterResultQuery = { id: string; streamSegmentType: StreamSegmentTypeEnum; } | null; + playlist?: { + __typename?: "HLSPlaylistGQL"; + segmentDurations: Array; + } | null; } | null; }>; }; @@ -4410,6 +4530,10 @@ export type GetShotsWithMetadataQuery = { id: string; streamSegmentType: StreamSegmentTypeEnum; } | null; + playlist?: { + __typename?: "HLSPlaylistGQL"; + segmentDurations: Array; + } | null; } | null; }>; }; @@ -4477,6 +4601,10 @@ export type GetShotsByIdsQuery = { id: string; streamSegmentType: StreamSegmentTypeEnum; } | null; + playlist?: { + __typename?: "HLSPlaylistGQL"; + segmentDurations: Array; + } | null; } | null; }>; }; @@ -4537,6 +4665,10 @@ export type ShotWithAllFeaturesFragment = { id: string; streamSegmentType: StreamSegmentTypeEnum; } | null; + playlist?: { + __typename?: "HLSPlaylistGQL"; + segmentDurations: Array; + } | null; } | null; }; @@ -4614,6 +4746,10 @@ export type EditShotMutation = { id: string; streamSegmentType: StreamSegmentTypeEnum; } | null; + playlist?: { + __typename?: "HLSPlaylistGQL"; + segmentDurations: Array; + } | null; } | null; } | null; }; @@ -5033,6 +5169,9 @@ export type GetVideoSocialDetailsByIdQuery = { __typename?: "VideoGQL"; id: number; name?: string | null; + screenshotUri?: string | null; + makePercentage: number; + totalShots: number; owner?: { __typename?: "UserGQL"; id: number; @@ -5743,6 +5882,31 @@ export const MedalFieldsFragmentDoc = gql` nickname } `; +export const NotificationFragmentDoc = gql` + fragment Notification on NotificationGQL { + id + notificationType + actor { + id + username + profileImageUri + } + videoId + comment { + id + message + user { + id + username + profileImageUri + } + } + reactionType + isRead + createdAt + readAt + } +`; export const PocketingIntentionFragmentFragmentDoc = gql` fragment PocketingIntentionFragment on PocketingIntentionFeaturesGQL { make @@ -5814,6 +5978,9 @@ export const ShotWithAllFeaturesFragmentDoc = gql` id streamSegmentType } + playlist { + segmentDurations + } } } `; @@ -7003,6 +7170,353 @@ export type GetMedalsQueryResult = Apollo.QueryResult< GetMedalsQuery, GetMedalsQueryVariables >; +export const GetNotificationsDocument = gql` + query GetNotifications( + $limit: Int! = 20 + $offset: Int! = 0 + $filters: NotificationFilters = null + ) { + notifications(limit: $limit, offset: $offset, filters: $filters) { + notifications { + ...Notification + } + totalCount + unreadCount + hasMore + } + } + ${NotificationFragmentDoc} +`; + +/** + * __useGetNotificationsQuery__ + * + * To run a query within a React component, call `useGetNotificationsQuery` and pass it any options that fit your needs. + * When your component renders, `useGetNotificationsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetNotificationsQuery({ + * variables: { + * limit: // value for 'limit' + * offset: // value for 'offset' + * filters: // value for 'filters' + * }, + * }); + */ +export function useGetNotificationsQuery( + baseOptions?: Apollo.QueryHookOptions< + GetNotificationsQuery, + GetNotificationsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery( + GetNotificationsDocument, + options, + ); +} +export function useGetNotificationsLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + GetNotificationsQuery, + GetNotificationsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery< + GetNotificationsQuery, + GetNotificationsQueryVariables + >(GetNotificationsDocument, options); +} +export function useGetNotificationsSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + GetNotificationsQuery, + GetNotificationsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + GetNotificationsQuery, + GetNotificationsQueryVariables + >(GetNotificationsDocument, options); +} +export type GetNotificationsQueryHookResult = ReturnType< + typeof useGetNotificationsQuery +>; +export type GetNotificationsLazyQueryHookResult = ReturnType< + typeof useGetNotificationsLazyQuery +>; +export type GetNotificationsSuspenseQueryHookResult = ReturnType< + typeof useGetNotificationsSuspenseQuery +>; +export type GetNotificationsQueryResult = Apollo.QueryResult< + GetNotificationsQuery, + GetNotificationsQueryVariables +>; +export const GetUnreadNotificationCountDocument = gql` + query GetUnreadNotificationCount { + unreadNotificationCount + } +`; + +/** + * __useGetUnreadNotificationCountQuery__ + * + * To run a query within a React component, call `useGetUnreadNotificationCountQuery` and pass it any options that fit your needs. + * When your component renders, `useGetUnreadNotificationCountQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetUnreadNotificationCountQuery({ + * variables: { + * }, + * }); + */ +export function useGetUnreadNotificationCountQuery( + baseOptions?: Apollo.QueryHookOptions< + GetUnreadNotificationCountQuery, + GetUnreadNotificationCountQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery< + GetUnreadNotificationCountQuery, + GetUnreadNotificationCountQueryVariables + >(GetUnreadNotificationCountDocument, options); +} +export function useGetUnreadNotificationCountLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + GetUnreadNotificationCountQuery, + GetUnreadNotificationCountQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery< + GetUnreadNotificationCountQuery, + GetUnreadNotificationCountQueryVariables + >(GetUnreadNotificationCountDocument, options); +} +export function useGetUnreadNotificationCountSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + GetUnreadNotificationCountQuery, + GetUnreadNotificationCountQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + GetUnreadNotificationCountQuery, + GetUnreadNotificationCountQueryVariables + >(GetUnreadNotificationCountDocument, options); +} +export type GetUnreadNotificationCountQueryHookResult = ReturnType< + typeof useGetUnreadNotificationCountQuery +>; +export type GetUnreadNotificationCountLazyQueryHookResult = ReturnType< + typeof useGetUnreadNotificationCountLazyQuery +>; +export type GetUnreadNotificationCountSuspenseQueryHookResult = ReturnType< + typeof useGetUnreadNotificationCountSuspenseQuery +>; +export type GetUnreadNotificationCountQueryResult = Apollo.QueryResult< + GetUnreadNotificationCountQuery, + GetUnreadNotificationCountQueryVariables +>; +export const MarkNotificationAsReadDocument = gql` + mutation MarkNotificationAsRead($notificationId: Int!) { + markNotificationAsRead(notificationId: $notificationId) + } +`; +export type MarkNotificationAsReadMutationFn = Apollo.MutationFunction< + MarkNotificationAsReadMutation, + MarkNotificationAsReadMutationVariables +>; + +/** + * __useMarkNotificationAsReadMutation__ + * + * To run a mutation, you first call `useMarkNotificationAsReadMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useMarkNotificationAsReadMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [markNotificationAsReadMutation, { data, loading, error }] = useMarkNotificationAsReadMutation({ + * variables: { + * notificationId: // value for 'notificationId' + * }, + * }); + */ +export function useMarkNotificationAsReadMutation( + baseOptions?: Apollo.MutationHookOptions< + MarkNotificationAsReadMutation, + MarkNotificationAsReadMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + MarkNotificationAsReadMutation, + MarkNotificationAsReadMutationVariables + >(MarkNotificationAsReadDocument, options); +} +export type MarkNotificationAsReadMutationHookResult = ReturnType< + typeof useMarkNotificationAsReadMutation +>; +export type MarkNotificationAsReadMutationResult = + Apollo.MutationResult; +export type MarkNotificationAsReadMutationOptions = Apollo.BaseMutationOptions< + MarkNotificationAsReadMutation, + MarkNotificationAsReadMutationVariables +>; +export const MarkNotificationsAsReadDocument = gql` + mutation MarkNotificationsAsRead($notificationIds: [Int!]!) { + markNotificationsAsRead(notificationIds: $notificationIds) + } +`; +export type MarkNotificationsAsReadMutationFn = Apollo.MutationFunction< + MarkNotificationsAsReadMutation, + MarkNotificationsAsReadMutationVariables +>; + +/** + * __useMarkNotificationsAsReadMutation__ + * + * To run a mutation, you first call `useMarkNotificationsAsReadMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useMarkNotificationsAsReadMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [markNotificationsAsReadMutation, { data, loading, error }] = useMarkNotificationsAsReadMutation({ + * variables: { + * notificationIds: // value for 'notificationIds' + * }, + * }); + */ +export function useMarkNotificationsAsReadMutation( + baseOptions?: Apollo.MutationHookOptions< + MarkNotificationsAsReadMutation, + MarkNotificationsAsReadMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + MarkNotificationsAsReadMutation, + MarkNotificationsAsReadMutationVariables + >(MarkNotificationsAsReadDocument, options); +} +export type MarkNotificationsAsReadMutationHookResult = ReturnType< + typeof useMarkNotificationsAsReadMutation +>; +export type MarkNotificationsAsReadMutationResult = + Apollo.MutationResult; +export type MarkNotificationsAsReadMutationOptions = Apollo.BaseMutationOptions< + MarkNotificationsAsReadMutation, + MarkNotificationsAsReadMutationVariables +>; +export const MarkAllNotificationsAsReadDocument = gql` + mutation MarkAllNotificationsAsRead { + markAllNotificationsAsRead + } +`; +export type MarkAllNotificationsAsReadMutationFn = Apollo.MutationFunction< + MarkAllNotificationsAsReadMutation, + MarkAllNotificationsAsReadMutationVariables +>; + +/** + * __useMarkAllNotificationsAsReadMutation__ + * + * To run a mutation, you first call `useMarkAllNotificationsAsReadMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useMarkAllNotificationsAsReadMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [markAllNotificationsAsReadMutation, { data, loading, error }] = useMarkAllNotificationsAsReadMutation({ + * variables: { + * }, + * }); + */ +export function useMarkAllNotificationsAsReadMutation( + baseOptions?: Apollo.MutationHookOptions< + MarkAllNotificationsAsReadMutation, + MarkAllNotificationsAsReadMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + MarkAllNotificationsAsReadMutation, + MarkAllNotificationsAsReadMutationVariables + >(MarkAllNotificationsAsReadDocument, options); +} +export type MarkAllNotificationsAsReadMutationHookResult = ReturnType< + typeof useMarkAllNotificationsAsReadMutation +>; +export type MarkAllNotificationsAsReadMutationResult = + Apollo.MutationResult; +export type MarkAllNotificationsAsReadMutationOptions = + Apollo.BaseMutationOptions< + MarkAllNotificationsAsReadMutation, + MarkAllNotificationsAsReadMutationVariables + >; +export const DeleteNotificationDocument = gql` + mutation DeleteNotification($notificationId: Int!) { + deleteNotification(notificationId: $notificationId) + } +`; +export type DeleteNotificationMutationFn = Apollo.MutationFunction< + DeleteNotificationMutation, + DeleteNotificationMutationVariables +>; + +/** + * __useDeleteNotificationMutation__ + * + * To run a mutation, you first call `useDeleteNotificationMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useDeleteNotificationMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [deleteNotificationMutation, { data, loading, error }] = useDeleteNotificationMutation({ + * variables: { + * notificationId: // value for 'notificationId' + * }, + * }); + */ +export function useDeleteNotificationMutation( + baseOptions?: Apollo.MutationHookOptions< + DeleteNotificationMutation, + DeleteNotificationMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + DeleteNotificationMutation, + DeleteNotificationMutationVariables + >(DeleteNotificationDocument, options); +} +export type DeleteNotificationMutationHookResult = ReturnType< + typeof useDeleteNotificationMutation +>; +export type DeleteNotificationMutationResult = + Apollo.MutationResult; +export type DeleteNotificationMutationOptions = Apollo.BaseMutationOptions< + DeleteNotificationMutation, + DeleteNotificationMutationVariables +>; export const EnsureStripeCustomerExistsDocument = gql` mutation EnsureStripeCustomerExists { ensureStripeCustomerExists { @@ -9675,6 +10189,9 @@ export const GetVideoSocialDetailsByIdDocument = gql` getVideo(videoId: $videoId) { id name + screenshotUri + makePercentage + totalShots owner { id firebaseUid diff --git a/src/operations/notifications.gql b/src/operations/notifications.gql new file mode 100644 index 0000000..fa3747d --- /dev/null +++ b/src/operations/notifications.gql @@ -0,0 +1,58 @@ +query GetNotifications( + $limit: Int! = 20 + $offset: Int! = 0 + $filters: NotificationFilters = null +) { + notifications(limit: $limit, offset: $offset, filters: $filters) { + notifications { + ...Notification + } + totalCount + unreadCount + hasMore + } +} + +query GetUnreadNotificationCount { + unreadNotificationCount +} + +mutation MarkNotificationAsRead($notificationId: Int!) { + markNotificationAsRead(notificationId: $notificationId) +} + +mutation MarkNotificationsAsRead($notificationIds: [Int!]!) { + markNotificationsAsRead(notificationIds: $notificationIds) +} + +mutation MarkAllNotificationsAsRead { + markAllNotificationsAsRead +} + +mutation DeleteNotification($notificationId: Int!) { + deleteNotification(notificationId: $notificationId) +} + +fragment Notification on NotificationGQL { + id + notificationType + actor { + id + username + profileImageUri + } + videoId + comment { + id + message + user { + id + username + profileImageUri + } + } + reactionType + isRead + createdAt + readAt +} diff --git a/src/operations/shots.gql b/src/operations/shots.gql index 0790651..c0efa2e 100644 --- a/src/operations/shots.gql +++ b/src/operations/shots.gql @@ -191,6 +191,9 @@ fragment ShotWithAllFeatures on ShotGQL { id streamSegmentType } + playlist { + segmentDurations + } } } diff --git a/src/operations/video.gql b/src/operations/video.gql index e3392e3..b95df20 100644 --- a/src/operations/video.gql +++ b/src/operations/video.gql @@ -93,6 +93,9 @@ query GetVideoSocialDetailsById($videoId: Int!) { getVideo(videoId: $videoId) { id name + screenshotUri + makePercentage + totalShots owner { id firebaseUid