From 72ac9567584e70e11b14147ba2bcb7b92e420abd Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 19 Oct 2024 20:18:23 -0600 Subject: [PATCH] Add get ordered shots --- src/index.tsx | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/schema.gql | 32 ++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index 3a2fcf2..17be9a8 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -157,6 +157,11 @@ export type DatetimeRangeAggregationInput = { startDatetime?: InputMaybe; }; +export type DatetimeShotOrdering = { + descending?: Scalars["Boolean"]["input"]; + startingAt?: InputMaybe; +}; + export type DeployedConfigGql = { __typename?: "DeployedConfigGQL"; allowNewUsers: Scalars["Boolean"]["output"]; @@ -1716,6 +1721,11 @@ export type FloatRangeFilter = { lessThanInclusive?: Scalars["Boolean"]["input"]; }; +export type FloatShotOrdering = { + descending?: Scalars["Boolean"]["input"]; + startingAt?: InputMaybe; +}; + export type GetProfileUploadLinkErrors = { __typename?: "GetProfileUploadLinkErrors"; error: TooManyProfileImageUploadsErr; @@ -1726,6 +1736,10 @@ export type GetProfileUploadLinkReturn = { value: UploadLinkGetProfileUploadLinkErrors; }; +export type GetShotsOrdering = { + orderings: Array; +}; + export type GetShotsPagination = { createdAfter: CreatedAfter; startFrameAfter: Scalars["Int"]["input"]; @@ -1789,6 +1803,11 @@ export type IntPoint2D = { y: Scalars["Int"]["output"]; }; +export type IntShotOrdering = { + descending?: Scalars["Boolean"]["input"]; + startingAt?: InputMaybe; +}; + export type MakePercentageIntervalGql = { __typename?: "MakePercentageIntervalGQL"; elapsedTime: Scalars["Float"]["output"]; @@ -1969,6 +1988,7 @@ export type Query = { getBucketSet?: Maybe; getDeployedConfig: DeployedConfigGql; getLoggedInUser?: Maybe; + getOrderedShots: GetShotsResult; getPlayTime: UserPlayTimeGql; getShotAnnotationTypes: Array; getShots: Array; @@ -1992,6 +2012,13 @@ export type QueryGetBucketSetArgs = { keyName: Scalars["String"]["input"]; }; +export type QueryGetOrderedShotsArgs = { + filterInput: FilterInput; + ids?: InputMaybe>; + limit?: Scalars["Int"]["input"]; + shotsOrdering?: InputMaybe; +}; + export type QueryGetPlayTimeArgs = { userId: Scalars["Int"]["input"]; }; @@ -2129,6 +2156,32 @@ export type ShotGql = { videoId: Scalars["Int"]["output"]; }; +export type ShotsOrderingComponent = + | { + marginOfError: FloatShotOrdering; + startFrame?: never; + videoCreation?: never; + videoId?: never; + } + | { + marginOfError?: never; + startFrame: IntShotOrdering; + videoCreation?: never; + videoId?: never; + } + | { + marginOfError?: never; + startFrame?: never; + videoCreation: DatetimeShotOrdering; + videoId?: never; + } + | { + marginOfError?: never; + startFrame?: never; + videoCreation?: never; + videoId: IntShotOrdering; + }; + export type SpinTypeCountsGql = { __typename?: "SpinTypeCountsGQL"; center: Scalars["Int"]["output"]; diff --git a/src/schema.gql b/src/schema.gql index c6fb85e..620b9ab 100644 --- a/src/schema.gql +++ b/src/schema.gql @@ -9,6 +9,12 @@ type Query { videoId: ID! intervalDuration: Int! = 300 ): [MakePercentageIntervalGQL!]! + getOrderedShots( + filterInput: FilterInput! + ids: [Int!] = null + shotsOrdering: GetShotsOrdering = null + limit: Int! = 500 + ): GetShotsResult! getShotsWithMetadata( filterInput: FilterInput! ids: [Int!] = null @@ -496,6 +502,32 @@ type VideoProcessingStatusGQL { updatedAt: DateTime } +input GetShotsOrdering { + orderings: [ShotsOrderingComponent!]! +} + +input ShotsOrderingComponent @oneOf { + videoCreation: DatetimeShotOrdering + marginOfError: FloatShotOrdering + videoId: IntShotOrdering + startFrame: IntShotOrdering +} + +input DatetimeShotOrdering { + descending: Boolean! = true + startingAt: DateTime = null +} + +input FloatShotOrdering { + descending: Boolean! = true + startingAt: Float = null +} + +input IntShotOrdering { + descending: Boolean! = true + startingAt: Int = null +} + input GetShotsPagination { createdAfter: CreatedAfter! startFrameAfter: Int!