Compare commits
	
		
			35 Commits
		
	
	
		
			14863e3357
			...
			kat/follow
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 163c6a4e0c | |||
| b9036001aa | |||
| b16b36588f | |||
| efaaeeaad1 | |||
| 5d93f7166e | |||
| 72ac956758 | |||
| 5cb7df174b | |||
| d15dae23c1 | |||
| c98a65bb6f | |||
| e701c79469 | |||
| 18cd3efe80 | |||
| d71974d385 | |||
| 0defdf0892 | |||
| 8d1f79b8a8 | |||
| 9dc426ea0f | |||
| 19a63b9d19 | |||
| ae97f956b3 | |||
| d619751144 | |||
| e431a1751f | |||
| 209f0aa019 | |||
| 70015a942c | |||
| 91cfcb28e7 | |||
| b2a09c1b8c | |||
| 59aaf47cbe | |||
| c426e753cd | |||
| c8cf97421b | |||
| 9718137ad3 | |||
| af1fb3fee7 | |||
| 025baf257a | |||
| 8239ab6e1b | |||
| 1f018f954e | |||
| fd78ddf641 | |||
| 7662f1f050 | |||
| 890bea2571 | |||
| f57f6dc32d | 
| @@ -1,5 +1,7 @@ | |||||||
| overwrite: true | overwrite: true | ||||||
| schema: "src/schema.gql" | schema: | ||||||
|  |   - "src/schema.gql" | ||||||
|  |   - "src/client-schema.gql" | ||||||
| documents: "src/**/*.gql" | documents: "src/**/*.gql" | ||||||
| generates: | generates: | ||||||
|   src/index.tsx: |   src/index.tsx: | ||||||
|   | |||||||
							
								
								
									
										25
									
								
								src/client-schema.gql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								src/client-schema.gql
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | |||||||
|  | # see: https://www.apollographql.com/docs/react/local-state/managing-state-with-field-policies/ | ||||||
|  | directive @client on FIELD | ||||||
|  |  | ||||||
|  | extend type ShotGQL { | ||||||
|  |   startTime: Float! | ||||||
|  |   endTime: Float! | ||||||
|  | } | ||||||
|  |  | ||||||
|  | extend type UploadStreamGQL { | ||||||
|  |   segmentEndFrames: [Int!]! | ||||||
|  | } | ||||||
|  |  | ||||||
|  | extend type HLSPlaylistGQL { | ||||||
|  |   segmentStartTimes: [Float!]! | ||||||
|  | } | ||||||
|  |  | ||||||
|  | type SegmentEndFramesGQL { | ||||||
|  |   id: Int! | ||||||
|  |   segmentEndFrames: [Int!]! | ||||||
|  | } | ||||||
|  |  | ||||||
|  | type SegmentStartTimesGQL { | ||||||
|  |   id: Int! | ||||||
|  |   segmentStartTimes: [Float!]! | ||||||
|  | } | ||||||
							
								
								
									
										1175
									
								
								src/index.tsx
									
									
									
									
									
								
							
							
						
						
									
										1175
									
								
								src/index.tsx
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -17,6 +17,42 @@ query GetShotAnnotationTypes { | |||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | query GetShotsWithVideoGql($filterInput: FilterInput!, $limit: Int) { | ||||||
|  |   getShotsWithMetadata(filterInput: $filterInput, limit: $limit) { | ||||||
|  |     ids | ||||||
|  |     shots { | ||||||
|  |       id | ||||||
|  |       videoId | ||||||
|  |       video { | ||||||
|  |         screenshotUri | ||||||
|  |         endTime | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | ## Reserved for playlists (which are created from a filter) | ||||||
|  | query GetShotsWithMetadataFilterResult( | ||||||
|  |   $filterInput: FilterInput! | ||||||
|  |   $shotsOrdering: GetShotsOrdering | ||||||
|  |   $limit: Int | ||||||
|  |   $ids: [Int!] | ||||||
|  | ) { | ||||||
|  |   getOrderedShots( | ||||||
|  |     filterInput: $filterInput | ||||||
|  |     shotsOrdering: $shotsOrdering | ||||||
|  |     limit: $limit | ||||||
|  |     ids: $ids | ||||||
|  |   ) { | ||||||
|  |     count | ||||||
|  |     shots { | ||||||
|  |       ...ShotWithAllFeatures | ||||||
|  |     } | ||||||
|  |     ids | ||||||
|  |   } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | # TODO: Delete | ||||||
| query GetShotsWithMetadata( | query GetShotsWithMetadata( | ||||||
|   $filterInput: FilterInput! |   $filterInput: FilterInput! | ||||||
|   $shotsPagination: GetShotsPagination |   $shotsPagination: GetShotsPagination | ||||||
| @@ -48,18 +84,12 @@ fragment ShotWithAllFeatures on ShotGQL { | |||||||
|   videoId |   videoId | ||||||
|   startFrame |   startFrame | ||||||
|   endFrame |   endFrame | ||||||
|  |   startTime @client | ||||||
|  |   endTime @client | ||||||
|   user { |   user { | ||||||
|     id |     id | ||||||
|   } |   } | ||||||
|   falsePositiveScore |   falsePositiveScore | ||||||
|   video { |  | ||||||
|     stream { |  | ||||||
|       resolution { |  | ||||||
|         width |  | ||||||
|         height |  | ||||||
|       } |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
|   createdAt |   createdAt | ||||||
|   updatedAt |   updatedAt | ||||||
|   cueObjectFeatures { |   cueObjectFeatures { | ||||||
| @@ -70,8 +100,11 @@ fragment ShotWithAllFeatures on ShotGQL { | |||||||
|     spinType |     spinType | ||||||
|   } |   } | ||||||
|   pocketingIntentionFeatures { |   pocketingIntentionFeatures { | ||||||
|     targetPocketDistance |  | ||||||
|     make |     make | ||||||
|  |     targetPocketDistance | ||||||
|  |     targetPocketAngle | ||||||
|  |     targetPocketAngleDirection | ||||||
|  |     marginOfErrorInDegrees | ||||||
|     intendedPocketType |     intendedPocketType | ||||||
|   } |   } | ||||||
|   pocketingIntentionInfo { |   pocketingIntentionInfo { | ||||||
|   | |||||||
| @@ -117,6 +117,11 @@ query GetVideoDetails($videoId: Int!) { | |||||||
|  |  | ||||||
| query GetVideos($videoIds: [Int!]!) { | query GetVideos($videoIds: [Int!]!) { | ||||||
|   getVideos(videoIds: $videoIds) { |   getVideos(videoIds: $videoIds) { | ||||||
|  |     ...VideoStreamMetadata | ||||||
|  |   } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | fragment VideoStreamMetadata on VideoGQL { | ||||||
|   id |   id | ||||||
|   framesPerSecond |   framesPerSecond | ||||||
|   stream { |   stream { | ||||||
| @@ -134,6 +139,11 @@ query GetVideos($videoIds: [Int!]!) { | |||||||
|     segmentDurations |     segmentDurations | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | query GetVideoForShotTime($videoId: Int!) { | ||||||
|  |   getVideo(videoId: $videoId) { | ||||||
|  |     ...VideoStreamMetadata | ||||||
|  |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| query GetVideo($videoId: Int!) { | query GetVideo($videoId: Int!) { | ||||||
| @@ -204,12 +214,14 @@ query GetAverageTimePerShotForVideo($videoId: Int!) { | |||||||
|     averageTimeBetweenShots |     averageTimeBetweenShots | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| query GetElapsedTimeForVideo($videoId: Int!) { | query GetElapsedTimeForVideo($videoId: Int!) { | ||||||
|   getVideo(videoId: $videoId) { |   getVideo(videoId: $videoId) { | ||||||
|     id |     id | ||||||
|     elapsedTime |     elapsedTime | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| query GetMedianRunForVideo($videoId: Int!) { | query GetMedianRunForVideo($videoId: Int!) { | ||||||
|   getVideo(videoId: $videoId) { |   getVideo(videoId: $videoId) { | ||||||
|     id |     id | ||||||
| @@ -217,16 +229,14 @@ query GetMedianRunForVideo($videoId: Int!) { | |||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| query GetVideoForClipTimes($videoId: Int!) { | fragment StreamWithEndFrames on UploadStreamGQL { | ||||||
|   getVideo(videoId: $videoId) { |  | ||||||
|     id |  | ||||||
|     framesPerSecond |  | ||||||
|     playlist { |  | ||||||
|       segmentDurations |  | ||||||
|     } |  | ||||||
|     stream { |  | ||||||
|   id |   id | ||||||
|   streamSegmentType |   streamSegmentType | ||||||
|  |   segmentEndFrames @client | ||||||
|  |   resolution { | ||||||
|  |     width | ||||||
|  |     height | ||||||
|  |   } | ||||||
|   segments { |   segments { | ||||||
|     uploaded |     uploaded | ||||||
|     valid |     valid | ||||||
| @@ -235,5 +245,44 @@ query GetVideoForClipTimes($videoId: Int!) { | |||||||
|     framesPerSecond |     framesPerSecond | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | fragment SegmentEndFrames on SegmentEndFramesGQL { | ||||||
|  |   id | ||||||
|  |   segmentEndFrames | ||||||
|  | } | ||||||
|  |  | ||||||
|  | fragment SegmentStartTimes on SegmentStartTimesGQL { | ||||||
|  |   id | ||||||
|  |   segmentStartTimes | ||||||
|  | } | ||||||
|  |  | ||||||
|  | fragment PlaylistWithSegmentStartTimes on HLSPlaylistGQL { | ||||||
|  |   videoId | ||||||
|  |   segmentDurations | ||||||
|  |   segmentStartTimes @client | ||||||
|  | } | ||||||
|  |  | ||||||
|  | fragment VideoDurationData on VideoGQL { | ||||||
|  |   id | ||||||
|  |   framesPerSecond | ||||||
|  |   playlist { | ||||||
|  |     ...PlaylistWithSegmentStartTimes | ||||||
|  |   } | ||||||
|  |   stream { | ||||||
|  |     ...StreamWithEndFrames | ||||||
|  |   } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | query GetVideoForClipTimes($videoId: Int!) { | ||||||
|  |   getVideo(videoId: $videoId) { | ||||||
|  |     ...VideoDurationData | ||||||
|  |   } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | query GetHeaderInfoByVideoId($videoId: Int!) { | ||||||
|  |   getVideo(videoId: $videoId) { | ||||||
|  |     id | ||||||
|  |     name | ||||||
|  |     startTime | ||||||
|   } |   } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -9,6 +9,12 @@ type Query { | |||||||
|     videoId: ID! |     videoId: ID! | ||||||
|     intervalDuration: Int! = 300 |     intervalDuration: Int! = 300 | ||||||
|   ): [MakePercentageIntervalGQL!]! |   ): [MakePercentageIntervalGQL!]! | ||||||
|  |   getOrderedShots( | ||||||
|  |     filterInput: FilterInput! | ||||||
|  |     ids: [Int!] = null | ||||||
|  |     shotsOrdering: GetShotsOrdering = null | ||||||
|  |     limit: Int! = 500 | ||||||
|  |   ): GetShotsResult! | ||||||
|   getShotsWithMetadata( |   getShotsWithMetadata( | ||||||
|     filterInput: FilterInput! |     filterInput: FilterInput! | ||||||
|     ids: [Int!] = null |     ids: [Int!] = null | ||||||
| @@ -39,6 +45,11 @@ type Query { | |||||||
|   getUserTags: [TagGQL!]! |   getUserTags: [TagGQL!]! | ||||||
|   getVideo(videoId: Int!, debuggingJson: JSON = null): VideoGQL! |   getVideo(videoId: Int!, debuggingJson: JSON = null): VideoGQL! | ||||||
|   getVideos(videoIds: [Int!]!): [VideoGQL!]! |   getVideos(videoIds: [Int!]!): [VideoGQL!]! | ||||||
|  |   getFeedVideos( | ||||||
|  |     limit: Int! = 5 | ||||||
|  |     after: String = null | ||||||
|  |     filters: VideoFilterInput = null | ||||||
|  |   ): VideoHistoryGQL! | ||||||
| } | } | ||||||
|  |  | ||||||
| type AggregateResultGQL { | type AggregateResultGQL { | ||||||
| @@ -125,6 +136,7 @@ enum AlignedIntervalEnum { | |||||||
|   MONTH |   MONTH | ||||||
|   YEAR |   YEAR | ||||||
|   WEEK |   WEEK | ||||||
|  |   DAY | ||||||
| } | } | ||||||
|  |  | ||||||
| input FilterInput @oneOf { | input FilterInput @oneOf { | ||||||
| @@ -140,6 +152,8 @@ input FilterInput @oneOf { | |||||||
|   shotDirection: [ShotDirectionEnum!] |   shotDirection: [ShotDirectionEnum!] | ||||||
|   videoId: [Int!] |   videoId: [Int!] | ||||||
|   userId: [Int!] |   userId: [Int!] | ||||||
|  |   username: [String!] | ||||||
|  |   fargoRating: FloatRangeFilter | ||||||
|   make: [Boolean!] |   make: [Boolean!] | ||||||
|   tags: [VideoTagInput!] |   tags: [VideoTagInput!] | ||||||
|   annotations: [ShotAnnotationInput!] |   annotations: [ShotAnnotationInput!] | ||||||
| @@ -162,7 +176,9 @@ input FilterInput @oneOf { | |||||||
|   targetPocketAngleDirection: [ShotDirectionEnum!] |   targetPocketAngleDirection: [ShotDirectionEnum!] | ||||||
|   targetPocketAngle: FloatRangeFilter |   targetPocketAngle: FloatRangeFilter | ||||||
|   missAngleInDegrees: FloatRangeFilter |   missAngleInDegrees: FloatRangeFilter | ||||||
|  |   marginOfErrorInDegrees: FloatRangeFilter | ||||||
|   createdAt: DateRangeFilter |   createdAt: DateRangeFilter | ||||||
|  |   totalDistance: FloatRangeFilter | ||||||
| } | } | ||||||
|  |  | ||||||
| input FloatRangeFilter { | input FloatRangeFilter { | ||||||
| @@ -282,6 +298,7 @@ type PocketingIntentionFeaturesGQL { | |||||||
|   difficulty: Float |   difficulty: Float | ||||||
|   targetPocketAngle: Float |   targetPocketAngle: Float | ||||||
|   targetPocketAngleDirection: ShotDirectionEnum |   targetPocketAngleDirection: ShotDirectionEnum | ||||||
|  |   marginOfErrorInDegrees: Float | ||||||
|   backcut: Boolean |   backcut: Boolean | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -320,10 +337,13 @@ type UserGQL { | |||||||
|   firebaseUid: String! |   firebaseUid: String! | ||||||
|   username: String! |   username: String! | ||||||
|   isAdmin: Boolean! |   isAdmin: Boolean! | ||||||
|  |   fargoRating: Int | ||||||
|   activeVideoId: Int |   activeVideoId: Int | ||||||
|   profileImageUri: String |   profileImageUri: String | ||||||
|   createdAt: DateTime |   createdAt: DateTime | ||||||
|   updatedAt: DateTime |   updatedAt: DateTime | ||||||
|  |   following: [Int!] | ||||||
|  |   followers: [Int!] | ||||||
| } | } | ||||||
|  |  | ||||||
| type ShotAnnotationGQL { | type ShotAnnotationGQL { | ||||||
| @@ -490,6 +510,32 @@ type VideoProcessingStatusGQL { | |||||||
|   updatedAt: DateTime |   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 { | input GetShotsPagination { | ||||||
|   createdAfter: CreatedAfter! |   createdAfter: CreatedAfter! | ||||||
|   startFrameAfter: Int! |   startFrameAfter: Int! | ||||||
| @@ -541,10 +587,17 @@ type Mutation { | |||||||
|     annotationName: String! |     annotationName: String! | ||||||
|     notes: String = null |     notes: String = null | ||||||
|   ): AddShotAnnotationReturn! |   ): AddShotAnnotationReturn! | ||||||
|  |   updateShotAnnotations( | ||||||
|  |     shotId: Int! | ||||||
|  |     annotations: [UpdateAnnotationInputGQL!]! | ||||||
|  |   ): UpdateShotAnnotationReturn! | ||||||
|   getProfileImageUploadLink( |   getProfileImageUploadLink( | ||||||
|     fileExt: String = ".png" |     fileExt: String = ".png" | ||||||
|   ): GetProfileUploadLinkReturn! |   ): GetProfileUploadLinkReturn! | ||||||
|   editProfileImageUri(profileImageUri: String!): UserGQL! |   editProfileImageUri(profileImageUri: String!): UserGQL! | ||||||
|  |   editUser(input: EditUserInputGQL!): UserGQL! | ||||||
|  |   followUser(followedUserId: Int!): UserGQL! | ||||||
|  |   unfollowUser(followedUserId: Int!): UserGQL! | ||||||
|   createUploadStream( |   createUploadStream( | ||||||
|     videoMetadata: VideoMetadataInput! |     videoMetadata: VideoMetadataInput! | ||||||
|   ): CreateUploadStreamReturn! |   ): CreateUploadStreamReturn! | ||||||
| @@ -594,6 +647,27 @@ type OtherErrorNeedsNote { | |||||||
|   msg: String |   msg: String | ||||||
| } | } | ||||||
|  |  | ||||||
|  | type UpdateShotAnnotationReturn { | ||||||
|  |   value: SuccessfulUpdateUpdateShotAnnotationErrors! | ||||||
|  | } | ||||||
|  |  | ||||||
|  | union SuccessfulUpdateUpdateShotAnnotationErrors = | ||||||
|  |     SuccessfulUpdate | ||||||
|  |   | UpdateShotAnnotationErrors | ||||||
|  |  | ||||||
|  | type SuccessfulUpdate { | ||||||
|  |   value: Boolean! | ||||||
|  | } | ||||||
|  |  | ||||||
|  | type UpdateShotAnnotationErrors { | ||||||
|  |   error: DoesNotOwnShotErr | ||||||
|  | } | ||||||
|  |  | ||||||
|  | input UpdateAnnotationInputGQL { | ||||||
|  |   name: String! | ||||||
|  |   notes: String = null | ||||||
|  | } | ||||||
|  |  | ||||||
| type GetProfileUploadLinkReturn { | type GetProfileUploadLinkReturn { | ||||||
|   value: UploadLinkGetProfileUploadLinkErrors! |   value: UploadLinkGetProfileUploadLinkErrors! | ||||||
| } | } | ||||||
| @@ -620,6 +694,11 @@ type TooManyProfileImageUploadsErr { | |||||||
|   linksRequested: Int! |   linksRequested: Int! | ||||||
| } | } | ||||||
|  |  | ||||||
|  | input EditUserInputGQL { | ||||||
|  |   username: String = null | ||||||
|  |   fargoRating: Int = null | ||||||
|  | } | ||||||
|  |  | ||||||
| type CreateUploadStreamReturn { | type CreateUploadStreamReturn { | ||||||
|   videoId: Int! |   videoId: Int! | ||||||
| } | } | ||||||
| @@ -630,7 +709,6 @@ input VideoMetadataInput { | |||||||
|   endTime: DateTime = null |   endTime: DateTime = null | ||||||
|   gameType: String = null |   gameType: String = null | ||||||
|   tableSize: Float = null |   tableSize: Float = null | ||||||
|   uploadStreamMetadataInput: UploadStreamMetadataInput = null |  | ||||||
|   lastIntendedSegmentBound: Int = null |   lastIntendedSegmentBound: Int = null | ||||||
|   streamSegmentType: StreamSegmentTypeEnum = null |   streamSegmentType: StreamSegmentTypeEnum = null | ||||||
|   endStream: Boolean! = false |   endStream: Boolean! = false | ||||||
| @@ -638,24 +716,6 @@ input VideoMetadataInput { | |||||||
|   framesPerSecond: Float = null |   framesPerSecond: Float = null | ||||||
| } | } | ||||||
|  |  | ||||||
| input UploadStreamMetadataInput { |  | ||||||
|   deviceType: DeviceTypeEnum = null |  | ||||||
|   osVersion: String = null |  | ||||||
|   appVersion: String = null |  | ||||||
|   browserName: String = null |  | ||||||
|   browserVersion: String = null |  | ||||||
|   locale: String = null |  | ||||||
|   timezone: String = null |  | ||||||
|   networkType: String = null |  | ||||||
|   ipAddress: String = null |  | ||||||
| } |  | ||||||
|  |  | ||||||
| enum DeviceTypeEnum { |  | ||||||
|   IOS |  | ||||||
|   ANDROID |  | ||||||
|   BROWSER |  | ||||||
| } |  | ||||||
|  |  | ||||||
| input VideoResolution { | input VideoResolution { | ||||||
|   width: Int! |   width: Int! | ||||||
|   height: Int! |   height: Int! | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user