From 7a6cc2739f329f6cfa2f0e936332ea5be7d41859 Mon Sep 17 00:00:00 2001 From: Mike Kalange Date: Wed, 21 Aug 2024 13:41:24 -0700 Subject: [PATCH 1/4] Error reporting types and Errors --- src/index.tsx | 42 +++++++++++++++++++++++++++++++++++++++++- src/schema.gql | 38 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 77 insertions(+), 3 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 82c5cd5..3b81a08 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -34,6 +34,16 @@ export type Scalars = { JSON: { input: any; output: any }; }; +export type AddShotAnnotationErrors = { + __typename?: "AddShotAnnotationErrors"; + error: DoesNotOwnShotErrOtherErrorNeedsNote; +}; + +export type AddShotAnnotationReturn = { + __typename?: "AddShotAnnotationReturn"; + value: SuccessfulAddAddShotAnnotationErrors; +}; + export type AggregateInputGql = { aggregations: Array; filterInput?: InputMaybe; @@ -131,6 +141,16 @@ export enum DeviceTypeEnum { Ios = "IOS", } +export type DoesNotOwnShotErr = { + __typename?: "DoesNotOwnShotErr"; + msg?: Maybe; + shotId: Scalars["Int"]["output"]; +}; + +export type DoesNotOwnShotErrOtherErrorNeedsNote = + | DoesNotOwnShotErr + | OtherErrorNeedsNote; + export type EnumAggregation = { feature: Scalars["String"]["input"]; }; @@ -1179,7 +1199,7 @@ export type MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailed export type Mutation = { __typename?: "Mutation"; - addAnnotationToShot: Scalars["Boolean"]["output"]; + addAnnotationToShot: AddShotAnnotationReturn; createBucketSet: BucketSetGql; createUploadStream: CreateUploadStreamReturn; deleteVideo: Scalars["Boolean"]["output"]; @@ -1194,6 +1214,7 @@ export type Mutation = { export type MutationAddAnnotationToShotArgs = { annotationName: Scalars["String"]["input"]; + notes?: InputMaybe; shotId: Scalars["Int"]["input"]; }; @@ -1247,6 +1268,11 @@ export type NoInitForChunkedUploadErr = { segmentType: StreamSegmentTypeEnum; }; +export type OtherErrorNeedsNote = { + __typename?: "OtherErrorNeedsNote"; + msg?: Maybe; +}; + export type PageInfoGql = { __typename?: "PageInfoGQL"; endCursor?: Maybe; @@ -1323,6 +1349,10 @@ export type QueryGetPlayTimeArgs = { userId: Scalars["Int"]["input"]; }; +export type QueryGetShotAnnotationTypesArgs = { + errorTypes?: InputMaybe; +}; + export type QueryGetShotsArgs = { filterInput: FilterInput; limit?: Scalars["Int"]["input"]; @@ -1387,6 +1417,7 @@ export type ShotAnnotationGql = { __typename?: "ShotAnnotationGQL"; createdAt?: Maybe; creator: UserGql; + errorDefault: Scalars["Boolean"]["output"]; notes: Scalars["String"]["output"]; shotId: Scalars["Int"]["output"]; type: ShotAnnotationTypeGql; @@ -1437,6 +1468,15 @@ export enum StreamSegmentTypeEnum { RbChunkedMp4 = "RB_CHUNKED_MP4", } +export type SuccessfulAdd = { + __typename?: "SuccessfulAdd"; + value: Scalars["Boolean"]["output"]; +}; + +export type SuccessfulAddAddShotAnnotationErrors = + | AddShotAnnotationErrors + | SuccessfulAdd; + export type TagGql = { __typename?: "TagGQL"; group?: Maybe; diff --git a/src/schema.gql b/src/schema.gql index 60ee6df..6d2a204 100644 --- a/src/schema.gql +++ b/src/schema.gql @@ -14,7 +14,7 @@ type Query { shotsPagination: GetShotsPagination = null limit: Int! = 500 ): [ShotGQL!]! - getShotAnnotationTypes: [ShotAnnotationTypeGQL!]! + getShotAnnotationTypes(errorTypes: Boolean = false): [ShotAnnotationTypeGQL!]! getUser(userId: Int!): UserGQL getLoggedInUser: UserGQL getUsernames( @@ -231,6 +231,7 @@ type ShotAnnotationGQL { type: ShotAnnotationTypeGQL! creator: UserGQL! notes: String! + errorDefault: Boolean! createdAt: DateTime updatedAt: DateTime } @@ -434,7 +435,11 @@ scalar JSON type Mutation { createBucketSet(params: CreateBucketSetInput!): BucketSetGQL! setLoggerLevel(path: String!, level: String!): Boolean! - addAnnotationToShot(shotId: Int!, annotationName: String!): Boolean! + addAnnotationToShot( + shotId: Int! + annotationName: String! + notes: String = null + ): AddShotAnnotationReturn! getProfileImageUploadLink( fileExt: String = ".png" ): GetProfileUploadLinkReturn! @@ -459,6 +464,35 @@ input CreateBucketSetInput { buckets: [BucketInputGQL!]! } +type AddShotAnnotationReturn { + value: SuccessfulAddAddShotAnnotationErrors! +} + +union SuccessfulAddAddShotAnnotationErrors = + SuccessfulAdd + | AddShotAnnotationErrors + +type SuccessfulAdd { + value: Boolean! +} + +type AddShotAnnotationErrors { + error: DoesNotOwnShotErrOtherErrorNeedsNote! +} + +union DoesNotOwnShotErrOtherErrorNeedsNote = + DoesNotOwnShotErr + | OtherErrorNeedsNote + +type DoesNotOwnShotErr { + shotId: Int! + msg: String +} + +type OtherErrorNeedsNote { + msg: String +} + type GetProfileUploadLinkReturn { value: UploadLinkGetProfileUploadLinkErrors! } From af38fdea6464fb5bca241e52c9130203962f3a08 Mon Sep 17 00:00:00 2001 From: Kat Huang Date: Mon, 26 Aug 2024 06:56:40 -0600 Subject: [PATCH 2/4] Add stream type to get videos --- src/index.tsx | 16 +++++++++------- src/operations/video.gql | 7 ++++--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index cd67860..07c7eb9 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1995,13 +1995,10 @@ export type GetVideosQuery = { getVideos: Array<{ __typename?: "VideoGQL"; id: number; - playlist?: { - __typename?: "HLSPlaylistGQL"; - segmentDurations: Array; - } | null; stream?: { __typename?: "UploadStreamGQL"; id: string; + streamSegmentType: StreamSegmentTypeEnum; segments: Array<{ __typename?: "UploadSegmentGQL"; uploaded: boolean; @@ -2011,6 +2008,10 @@ export type GetVideosQuery = { framesPerSecond?: number | null; }>; } | null; + playlist?: { + __typename?: "HLSPlaylistGQL"; + segmentDurations: Array; + } | null; }>; }; @@ -3548,11 +3549,9 @@ export const GetVideosDocument = gql` query GetVideos($videoIds: [Int!]!) { getVideos(videoIds: $videoIds) { id - playlist { - segmentDurations - } stream { id + streamSegmentType segments { uploaded valid @@ -3561,6 +3560,9 @@ export const GetVideosDocument = gql` framesPerSecond } } + playlist { + segmentDurations + } } } `; diff --git a/src/operations/video.gql b/src/operations/video.gql index 0729041..d47ab35 100644 --- a/src/operations/video.gql +++ b/src/operations/video.gql @@ -118,11 +118,9 @@ query GetVideoDetails($videoId: Int!) { query GetVideos($videoIds: [Int!]!) { getVideos(videoIds: $videoIds) { id - playlist { - segmentDurations - } stream { id + streamSegmentType segments { uploaded valid @@ -131,6 +129,9 @@ query GetVideos($videoIds: [Int!]!) { framesPerSecond } } + playlist { + segmentDurations + } } } From f9b02f65e07a3a9dceceef480e299c5b7f34483f Mon Sep 17 00:00:00 2001 From: Kat Huang Date: Mon, 26 Aug 2024 20:53:16 -0600 Subject: [PATCH 3/4] Expose frames per second in get videos --- src/index.tsx | 2 ++ src/operations/video.gql | 1 + 2 files changed, 3 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index 796f3a8..005d7f4 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2055,6 +2055,7 @@ export type GetVideosQuery = { getVideos: Array<{ __typename?: "VideoGQL"; id: number; + framesPerSecond: number; stream?: { __typename?: "UploadStreamGQL"; id: string; @@ -3621,6 +3622,7 @@ export const GetVideosDocument = gql` query GetVideos($videoIds: [Int!]!) { getVideos(videoIds: $videoIds) { id + framesPerSecond stream { id streamSegmentType diff --git a/src/operations/video.gql b/src/operations/video.gql index d47ab35..3b786ce 100644 --- a/src/operations/video.gql +++ b/src/operations/video.gql @@ -118,6 +118,7 @@ query GetVideoDetails($videoId: Int!) { query GetVideos($videoIds: [Int!]!) { getVideos(videoIds: $videoIds) { id + framesPerSecond stream { id streamSegmentType From 643cdb29e39628310223b971f2aebf6b3b4ff70d Mon Sep 17 00:00:00 2001 From: Mike Kalange Date: Wed, 28 Aug 2024 16:27:21 -0700 Subject: [PATCH 4/4] Add spinType and filter input --- src/index.tsx | 10 +++++++++- src/schema.gql | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 796f3a8..3c6fe88 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -124,6 +124,7 @@ export type CueObjectFeaturesGql = { cueObjectAngle?: Maybe; cueObjectDistance?: Maybe; shotDirection?: Maybe; + spinType?: Maybe; }; export type DeployedConfigGql = { @@ -949,7 +950,7 @@ export type FilterInput = notFilter?: never; orFilters?: never; shotDirection?: never; - spinType: Array; + spinType: Array; tableSize?: never; tags?: never; targetPocketDistance?: never; @@ -1458,6 +1459,13 @@ export type ShotGql = { videoId: Scalars["Int"]["output"]; }; +export enum SpinTypeEnum { + Center = "CENTER", + Draw = "DRAW", + Follow = "FOLLOW", + Unknown = "UNKNOWN", +} + export type StreamErrorGql = { __typename?: "StreamErrorGQL"; message: Scalars["String"]["output"]; diff --git a/src/schema.gql b/src/schema.gql index 6d2a204..0a74bbe 100644 --- a/src/schema.gql +++ b/src/schema.gql @@ -102,8 +102,8 @@ input FilterInput @oneOf { kickAngle: RangeFilter kickDistance: RangeFilter cueAngleAfterObject: RangeFilter + spinType: [SpinTypeEnum!] cueSpeedAfterObject: RangeFilter - spinType: [String!] falsePositiveScore: RangeFilter } @@ -140,6 +140,13 @@ input ShotAnnotationInput { name: String! } +enum SpinTypeEnum { + DRAW + FOLLOW + CENTER + UNKNOWN +} + type BucketSetGQL { keyName: String! feature: String! @@ -191,6 +198,7 @@ type CueObjectFeaturesGQL { cueObjectAngle: Float cueBallSpeed: Float shotDirection: ShotDirectionEnum + spinType: SpinTypeEnum } type PocketingIntentionFeaturesGQL {