Compare commits
	
		
			56 Commits
		
	
	
		
			bacd9e77f0
			...
			kat/userna
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 3adc301935 | |||
| 9232c673e8 | |||
| c2cb411469 | |||
| 44ddc732a1 | |||
| d6ef3e0487 | |||
| 8c191bdb90 | |||
| 8246699915 | |||
| de9d47c289 | |||
| 39b1808cab | |||
| a78f9e7b9d | |||
| f573026853 | |||
| f98c98ecdd | |||
| 3f6314aab7 | |||
| 3051c155e2 | |||
| e686be5acd | |||
| d49f9b213a | |||
| 8f346d7832 | |||
| 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 | |||
| 14863e3357 | |||
|  | 58f01c567c | ||
| 937368c753 | |||
| d8c11875d4 | 
| @@ -1,5 +1,7 @@ | ||||
| overwrite: true | ||||
| schema: "src/schema.gql" | ||||
| schema: | ||||
|   - "src/schema.gql" | ||||
|   - "src/client-schema.gql" | ||||
| documents: "src/**/*.gql" | ||||
| generates: | ||||
|   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!]! | ||||
| } | ||||
							
								
								
									
										1550
									
								
								src/index.tsx
									
									
									
									
									
								
							
							
						
						
									
										1550
									
								
								src/index.tsx
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -21,6 +21,7 @@ query GetFeed( | ||||
|       elapsedTime | ||||
|       screenshotUri | ||||
|       stream { | ||||
|         id | ||||
|         isCompleted | ||||
|       } | ||||
|       tableSize | ||||
|   | ||||
| @@ -17,20 +17,82 @@ query GetShotAnnotationTypes { | ||||
|   } | ||||
| } | ||||
|  | ||||
| query GetShotsWithMetadata( | ||||
|   $filterInput: FilterInput! | ||||
|   $shotsPagination: GetShotsPagination | ||||
|   $limit: Int | ||||
| mutation UpdateShotAnnotations( | ||||
|   $shotId: Int! | ||||
|   $annotations: [UpdateAnnotationInputGQL!]! | ||||
| ) { | ||||
|   getShotsWithMetadata( | ||||
|   updateShotAnnotations(shotId: $shotId, annotations: $annotations) { | ||||
|     shot { | ||||
|       id | ||||
|       annotations { | ||||
|         shotId | ||||
|         type { | ||||
|           id | ||||
|           name | ||||
|         } | ||||
|         notes | ||||
|       } | ||||
|     } | ||||
|     error { | ||||
|       shotId | ||||
|       msg | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
| 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 | ||||
|     shotsPagination: $shotsPagination | ||||
|     shotsOrdering: $shotsOrdering | ||||
|     limit: $limit | ||||
|     ids: $ids | ||||
|   ) { | ||||
|     count | ||||
|     shots { | ||||
|       ...ShotWithAllFeatures | ||||
|     } | ||||
|     ids | ||||
|   } | ||||
| } | ||||
|  | ||||
| # TODO: Delete | ||||
| query GetShotsWithMetadata( | ||||
|   $filterInput: FilterInput! | ||||
|   $shotsPagination: GetShotsPagination | ||||
|   $limit: Int | ||||
|   $ids: [Int!] | ||||
| ) { | ||||
|   getShotsWithMetadata( | ||||
|     filterInput: $filterInput | ||||
|     shotsPagination: $shotsPagination | ||||
|     limit: $limit | ||||
|     ids: $ids | ||||
|   ) { | ||||
|     count | ||||
|     shots { | ||||
|       ...ShotWithAllFeatures | ||||
|     } | ||||
|     ids | ||||
|   } | ||||
| } | ||||
|  | ||||
| @@ -45,18 +107,12 @@ fragment ShotWithAllFeatures on ShotGQL { | ||||
|   videoId | ||||
|   startFrame | ||||
|   endFrame | ||||
|   startTime @client | ||||
|   endTime @client | ||||
|   user { | ||||
|     id | ||||
|   } | ||||
|   falsePositiveScore | ||||
|   video { | ||||
|     stream { | ||||
|       resolution { | ||||
|         width | ||||
|         height | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|   createdAt | ||||
|   updatedAt | ||||
|   cueObjectFeatures { | ||||
| @@ -67,8 +123,11 @@ fragment ShotWithAllFeatures on ShotGQL { | ||||
|     spinType | ||||
|   } | ||||
|   pocketingIntentionFeatures { | ||||
|     targetPocketDistance | ||||
|     make | ||||
|     targetPocketDistance | ||||
|     targetPocketAngle | ||||
|     targetPocketAngleDirection | ||||
|     marginOfErrorInDegrees | ||||
|     intendedPocketType | ||||
|   } | ||||
|   pocketingIntentionInfo { | ||||
| @@ -79,4 +138,12 @@ fragment ShotWithAllFeatures on ShotGQL { | ||||
|   serializedShotPaths { | ||||
|     b64EncodedBuffer | ||||
|   } | ||||
|   annotations { | ||||
|     shotId | ||||
|     type { | ||||
|       id | ||||
|       name | ||||
|     } | ||||
|     notes | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -57,6 +57,27 @@ query getUsernames( | ||||
|   getUsernames(matchString: $matchString, limit: $limit, after: $after) | ||||
| } | ||||
|  | ||||
| query getUsernamesAndFollowing( | ||||
|   $userId: Int! | ||||
|   $matchString: String! | ||||
|   $limit: Int = null | ||||
|   $after: String = null | ||||
| ) { | ||||
|   getUsernamesAndFollowing( | ||||
|     userId: $userId | ||||
|     matchString: $matchString | ||||
|     limit: $limit | ||||
|     after: $after | ||||
|   ) { | ||||
|     followers | ||||
|     following | ||||
|     usernamesAndIds { | ||||
|       username | ||||
|       id | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
| query GetUserTags { | ||||
|   getUserTags { | ||||
|     id | ||||
|   | ||||
| @@ -45,6 +45,7 @@ query GetStreamMonitoringDetails($videoId: Int!, $debuggingJson: JSON) { | ||||
|       } | ||||
|     } | ||||
|     stream { | ||||
|       id | ||||
|       linksRequested | ||||
|       uploadsCompleted | ||||
|       segmentProcessingCursor | ||||
| @@ -117,23 +118,33 @@ query GetVideoDetails($videoId: Int!) { | ||||
|  | ||||
| query GetVideos($videoIds: [Int!]!) { | ||||
|   getVideos(videoIds: $videoIds) { | ||||
|     ...VideoStreamMetadata | ||||
|   } | ||||
| } | ||||
|  | ||||
| fragment VideoStreamMetadata on VideoGQL { | ||||
|   id | ||||
|   framesPerSecond | ||||
|   stream { | ||||
|     id | ||||
|     framesPerSecond | ||||
|     stream { | ||||
|       id | ||||
|       streamSegmentType | ||||
|       segments { | ||||
|         uploaded | ||||
|         valid | ||||
|         segmentIndex | ||||
|         endFrameIndex | ||||
|         framesPerSecond | ||||
|       } | ||||
|     } | ||||
|     playlist { | ||||
|       segmentDurations | ||||
|     streamSegmentType | ||||
|     segments { | ||||
|       uploaded | ||||
|       valid | ||||
|       segmentIndex | ||||
|       endFrameIndex | ||||
|       framesPerSecond | ||||
|     } | ||||
|   } | ||||
|   playlist { | ||||
|     segmentDurations | ||||
|   } | ||||
| } | ||||
|  | ||||
| query GetVideoForShotTime($videoId: Int!) { | ||||
|   getVideo(videoId: $videoId) { | ||||
|     ...VideoStreamMetadata | ||||
|   } | ||||
| } | ||||
|  | ||||
| query GetVideo($videoId: Int!) { | ||||
| @@ -184,6 +195,7 @@ query GetVideo($videoId: Int!) { | ||||
|       } | ||||
|     } | ||||
|     stream { | ||||
|       id | ||||
|       streamSegmentType | ||||
|       segments { | ||||
|         segmentIndex | ||||
| @@ -204,12 +216,14 @@ query GetAverageTimePerShotForVideo($videoId: Int!) { | ||||
|     averageTimeBetweenShots | ||||
|   } | ||||
| } | ||||
|  | ||||
| query GetElapsedTimeForVideo($videoId: Int!) { | ||||
|   getVideo(videoId: $videoId) { | ||||
|     id | ||||
|     elapsedTime | ||||
|   } | ||||
| } | ||||
|  | ||||
| query GetMedianRunForVideo($videoId: Int!) { | ||||
|   getVideo(videoId: $videoId) { | ||||
|     id | ||||
| @@ -217,23 +231,60 @@ query GetMedianRunForVideo($videoId: Int!) { | ||||
|   } | ||||
| } | ||||
|  | ||||
| query GetVideoForClipTimes($videoId: Int!) { | ||||
|   getVideo(videoId: $videoId) { | ||||
|     id | ||||
| fragment StreamWithEndFrames on UploadStreamGQL { | ||||
|   id | ||||
|   streamSegmentType | ||||
|   segmentEndFrames @client | ||||
|   resolution { | ||||
|     width | ||||
|     height | ||||
|   } | ||||
|   segments { | ||||
|     uploaded | ||||
|     valid | ||||
|     segmentIndex | ||||
|     endFrameIndex | ||||
|     framesPerSecond | ||||
|     playlist { | ||||
|       segmentDurations | ||||
|     } | ||||
|     stream { | ||||
|       id | ||||
|       streamSegmentType | ||||
|       segments { | ||||
|         uploaded | ||||
|         valid | ||||
|         segmentIndex | ||||
|         endFrameIndex | ||||
|         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 | ||||
|   } | ||||
| } | ||||
|   | ||||
							
								
								
									
										101
									
								
								src/schema.gql
									
									
									
									
									
								
							
							
						
						
									
										101
									
								
								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 | ||||
| @@ -29,6 +35,12 @@ type Query { | ||||
|     limit: Int = null | ||||
|     after: String = null | ||||
|   ): [String!]! | ||||
|   getUsernamesAndFollowing( | ||||
|     userId: Int! | ||||
|     matchString: String = null | ||||
|     limit: Int = 100 | ||||
|     after: String = null | ||||
|   ): UsernamesAndFollowingResponse! | ||||
|   getPlayTime(userId: Int!): UserPlayTimeGQL! | ||||
|   getUserVideos( | ||||
|     userId: Int = null | ||||
| @@ -39,6 +51,11 @@ type Query { | ||||
|   getUserTags: [TagGQL!]! | ||||
|   getVideo(videoId: Int!, debuggingJson: JSON = null): VideoGQL! | ||||
|   getVideos(videoIds: [Int!]!): [VideoGQL!]! | ||||
|   getFeedVideos( | ||||
|     limit: Int! = 5 | ||||
|     after: String = null | ||||
|     filters: VideoFilterInput = null | ||||
|   ): VideoHistoryGQL! | ||||
| } | ||||
|  | ||||
| type AggregateResultGQL { | ||||
| @@ -125,6 +142,7 @@ enum AlignedIntervalEnum { | ||||
|   MONTH | ||||
|   YEAR | ||||
|   WEEK | ||||
|   DAY | ||||
| } | ||||
|  | ||||
| input FilterInput @oneOf { | ||||
| @@ -140,6 +158,8 @@ input FilterInput @oneOf { | ||||
|   shotDirection: [ShotDirectionEnum!] | ||||
|   videoId: [Int!] | ||||
|   userId: [Int!] | ||||
|   username: [String!] | ||||
|   fargoRating: FloatRangeFilter | ||||
|   make: [Boolean!] | ||||
|   tags: [VideoTagInput!] | ||||
|   annotations: [ShotAnnotationInput!] | ||||
| @@ -162,7 +182,10 @@ input FilterInput @oneOf { | ||||
|   targetPocketAngleDirection: [ShotDirectionEnum!] | ||||
|   targetPocketAngle: FloatRangeFilter | ||||
|   missAngleInDegrees: FloatRangeFilter | ||||
|   marginOfErrorInDegrees: FloatRangeFilter | ||||
|   createdAt: DateRangeFilter | ||||
|   totalDistance: FloatRangeFilter | ||||
|   runLength: FloatRangeFilter | ||||
| } | ||||
|  | ||||
| input FloatRangeFilter { | ||||
| @@ -282,6 +305,7 @@ type PocketingIntentionFeaturesGQL { | ||||
|   difficulty: Float | ||||
|   targetPocketAngle: Float | ||||
|   targetPocketAngleDirection: ShotDirectionEnum | ||||
|   marginOfErrorInDegrees: Float | ||||
|   backcut: Boolean | ||||
| } | ||||
|  | ||||
| @@ -320,10 +344,13 @@ type UserGQL { | ||||
|   firebaseUid: String! | ||||
|   username: String! | ||||
|   isAdmin: Boolean! | ||||
|   fargoRating: Int | ||||
|   activeVideoId: Int | ||||
|   profileImageUri: String | ||||
|   createdAt: DateTime | ||||
|   updatedAt: DateTime | ||||
|   following: [Int!] | ||||
|   followers: [Int!] | ||||
| } | ||||
|  | ||||
| type ShotAnnotationGQL { | ||||
| @@ -490,6 +517,33 @@ type VideoProcessingStatusGQL { | ||||
|   updatedAt: DateTime | ||||
| } | ||||
|  | ||||
| input GetShotsOrdering { | ||||
|   orderings: [ShotsOrderingComponent!]! | ||||
| } | ||||
|  | ||||
| input ShotsOrderingComponent @oneOf { | ||||
|   videoCreation: DatetimeShotOrdering | ||||
|   marginOfError: FloatShotOrdering | ||||
|   videoId: IntShotOrdering | ||||
|   startFrame: IntShotOrdering | ||||
|   runLength: 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! | ||||
| @@ -500,6 +554,12 @@ input CreatedAfter @oneOf { | ||||
|   createdAt: DateTime | ||||
| } | ||||
|  | ||||
| type UsernamesAndFollowingResponse { | ||||
|   usernames: [String!]! | ||||
|   following: [Int!]! | ||||
|   followers: [Int!]! | ||||
| } | ||||
|  | ||||
| type UserPlayTimeGQL { | ||||
|   totalSeconds: Float! | ||||
| } | ||||
| @@ -541,10 +601,17 @@ type Mutation { | ||||
|     annotationName: String! | ||||
|     notes: String = null | ||||
|   ): AddShotAnnotationReturn! | ||||
|   updateShotAnnotations( | ||||
|     shotId: Int! | ||||
|     annotations: [UpdateAnnotationInputGQL!]! | ||||
|   ): UpdateShotAnnotationReturn! | ||||
|   getProfileImageUploadLink( | ||||
|     fileExt: String = ".png" | ||||
|   ): GetProfileUploadLinkReturn! | ||||
|   editProfileImageUri(profileImageUri: String!): UserGQL! | ||||
|   editUser(input: EditUserInputGQL!): UserGQL! | ||||
|   followUser(followedUserId: Int!): UserGQL! | ||||
|   unfollowUser(followedUserId: Int!): UserGQL! | ||||
|   createUploadStream( | ||||
|     videoMetadata: VideoMetadataInput! | ||||
|   ): CreateUploadStreamReturn! | ||||
| @@ -594,6 +661,16 @@ type OtherErrorNeedsNote { | ||||
|   msg: String | ||||
| } | ||||
|  | ||||
| type UpdateShotAnnotationReturn { | ||||
|   shot: ShotGQL | ||||
|   error: DoesNotOwnShotErr | ||||
| } | ||||
|  | ||||
| input UpdateAnnotationInputGQL { | ||||
|   name: String! | ||||
|   notes: String = null | ||||
| } | ||||
|  | ||||
| type GetProfileUploadLinkReturn { | ||||
|   value: UploadLinkGetProfileUploadLinkErrors! | ||||
| } | ||||
| @@ -620,6 +697,11 @@ type TooManyProfileImageUploadsErr { | ||||
|   linksRequested: Int! | ||||
| } | ||||
|  | ||||
| input EditUserInputGQL { | ||||
|   username: String = null | ||||
|   fargoRating: Int = null | ||||
| } | ||||
|  | ||||
| type CreateUploadStreamReturn { | ||||
|   videoId: Int! | ||||
| } | ||||
| @@ -630,7 +712,6 @@ input VideoMetadataInput { | ||||
|   endTime: DateTime = null | ||||
|   gameType: String = null | ||||
|   tableSize: Float = null | ||||
|   uploadStreamMetadataInput: UploadStreamMetadataInput = null | ||||
|   lastIntendedSegmentBound: Int = null | ||||
|   streamSegmentType: StreamSegmentTypeEnum = null | ||||
|   endStream: Boolean! = false | ||||
| @@ -638,24 +719,6 @@ input VideoMetadataInput { | ||||
|   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 { | ||||
|   width: Int! | ||||
|   height: Int! | ||||
|   | ||||
		Reference in New Issue
	
	Block a user