Add getTableState

This commit is contained in:
Ivan Malison 2025-05-15 12:26:18 -07:00
parent 98266c7775
commit ae746ccac0
2 changed files with 280 additions and 201 deletions

View File

@ -94,6 +94,13 @@ export type BoundingBoxGql = {
width: Scalars["Float"]["output"];
};
export type BoundingBoxInputGql = {
height: Scalars["Float"]["input"];
left: Scalars["Float"]["input"];
top: Scalars["Float"]["input"];
width: Scalars["Float"]["input"];
};
export type BucketGql = {
__typename?: "BucketGQL";
lowerBound: Scalars["Float"]["output"];
@ -2162,6 +2169,13 @@ export type HomographyInfoGql = {
sourcePoints: PocketPointsGql;
};
export type HomographyInputGql = {
crop: BoundingBoxInputGql;
destPoints: PocketPointsInputGql;
pockets: Array<BoundingBoxInputGql>;
sourcePoints: PocketPointsInputGql;
};
export enum IncludePrivateEnum {
All = "ALL",
Mine = "MINE",
@ -2190,6 +2204,11 @@ export type IntPoint2D = {
y: Scalars["Int"]["output"];
};
export type IntPoint2DInput = {
x: Scalars["Int"]["input"];
y: Scalars["Int"]["input"];
};
export type MakePercentageIntervalGql = {
__typename?: "MakePercentageIntervalGQL";
elapsedTime: Scalars["Float"]["output"];
@ -2407,6 +2426,15 @@ export type PocketPointsGql = {
topSide: IntPoint2D;
};
export type PocketPointsInputGql = {
bottomLeft: IntPoint2DInput;
bottomRight: IntPoint2DInput;
bottomSide: IntPoint2DInput;
topLeft: IntPoint2DInput;
topRight: IntPoint2DInput;
topSide: IntPoint2DInput;
};
export type PocketingIntentionFeaturesGql = {
__typename?: "PocketingIntentionFeaturesGQL";
backcut?: Maybe<Scalars["Boolean"]["output"]>;
@ -2460,6 +2488,7 @@ export type Query = {
getShots: Array<ShotGql>;
getShotsByIds: Array<ShotGql>;
getShotsWithMetadata: GetShotsResult;
getTableState: TableStateGql;
getUser?: Maybe<UserGql>;
getUserRelationshipsMatching: UserRelationshipsResult;
getUserTags: Array<TagGql>;
@ -2553,6 +2582,12 @@ export type QueryGetShotsWithMetadataArgs = {
shotsPagination?: InputMaybe<GetShotsPagination>;
};
export type QueryGetTableStateArgs = {
b64Image: Scalars["String"]["input"];
tableSize?: InputMaybe<Scalars["Float"]["input"]>;
useHomography?: InputMaybe<HomographyInputGql>;
};
export type QueryGetUserArgs = {
userId: Scalars["Int"]["input"];
};
@ -2866,6 +2901,12 @@ export type SuccessfulAddAddShotAnnotationErrors =
| AddShotAnnotationErrors
| SuccessfulAdd;
export type TableStateGql = {
__typename?: "TableStateGQL";
homography?: Maybe<HomographyInfoGql>;
identifierToPosition: Array<Array<Scalars["Float"]["output"]>>;
};
export type TagClassGql = {
__typename?: "TagClassGQL";
id: Scalars["Int"]["output"];

View File

@ -5,10 +5,28 @@ type Query {
getBucketSet(keyName: String!): BucketSetGQL
getDeployedConfig: DeployedConfigGQL!
waitFor(duration: Float!): Float!
getFeedVideos(
limit: Int! = 5
after: String = null
includePrivate: IncludePrivateEnum! = MINE
includeCallersVideos: Boolean = true
filters: VideoFilterInput = null
feedInput: VideoFeedInputGQL = null
): VideoHistoryGQL!
getVideoMakePercentageIntervals(
videoId: ID!
intervalDuration: Int! = 300
): [MakePercentageIntervalGQL!]!
getLongestRunsLeaderboard(
interval: TimeInterval = null
when: DateTime = null
limit: Int! = 100
requiredTags: [String!] = null
): RunLeaderboardGQL!
getMakesLeaderboard(
interval: TimeInterval = null
when: DateTime = null
): CountLeaderboardGQL!
getMedals(scope: MedalScope!, userId: Int = null): RequestedMedalsGQL!
getRuns(
filterInput: RunFilterInput!
@ -17,6 +35,12 @@ type Query {
limit: Int! = 500
countRespectsLimit: Boolean! = false
): GetRunsResult!
getShotAnnotationTypes(errorTypes: Boolean = false): [ShotAnnotationTypeGQL!]!
getTableState(
b64Image: String!
tableSize: Float = 100
useHomography: HomographyInputGQL = null
): TableStateGQL!
getOrderedShots(
filterInput: FilterInput!
ids: [Int!] = null
@ -38,7 +62,6 @@ type Query {
countRespectsLimit: Boolean! = false
): [ShotGQL!]!
getShotsByIds(ids: [Int!]!): [ShotGQL!]!
getShotAnnotationTypes(errorTypes: Boolean = false): [ShotAnnotationTypeGQL!]!
getUser(userId: Int!): UserGQL
doesUsernameExist(candidateUsername: String!): Boolean!
getLoggedInUser: UserGQL
@ -63,24 +86,6 @@ type Query {
getUserTags(includeRetiredTags: Boolean = false): [TagGQL!]!
getVideo(videoId: Int!, debuggingJson: JSON = null): VideoGQL!
getVideos(videoIds: [Int!]!): [VideoGQL!]!
getFeedVideos(
limit: Int! = 5
after: String = null
includePrivate: IncludePrivateEnum! = MINE
includeCallersVideos: Boolean = true
filters: VideoFilterInput = null
feedInput: VideoFeedInputGQL = null
): VideoHistoryGQL!
getLongestRunsLeaderboard(
interval: TimeInterval = null
when: DateTime = null
limit: Int! = 100
requiredTags: [String!] = null
): RunLeaderboardGQL!
getMakesLeaderboard(
interval: TimeInterval = null
when: DateTime = null
): CountLeaderboardGQL!
}
type AggregateResultGQL {
@ -288,70 +293,54 @@ type DeployedConfigGQL {
minimumAllowedAppVersion: String!
}
type MakePercentageIntervalGQL {
makePercentage: Float!
elapsedTime: Float!
type VideoHistoryGQL {
videos: [VideoGQL!]!
pageInfo: PageInfoGQL!
}
type RequestedMedalsGQL {
distanceOver66: MedalGQL
distanceOver78: MedalGQL
distanceOver90: MedalGQL
runLength3: MedalGQL
runLength5: MedalGQL
runLength8: MedalGQL
runLength10: MedalGQL
runLength15: MedalGQL
runLength20: MedalGQL
runLength25: MedalGQL
runLength30: MedalGQL
runLength40: MedalGQL
runLength50: MedalGQL
totalMakes25: MedalGQL @deprecated(reason: "no longer supported")
totalMakes50: MedalGQL @deprecated(reason: "no longer supported")
totalMakes75: MedalGQL @deprecated(reason: "no longer supported")
totalMakes200: MedalGQL @deprecated(reason: "no longer supported")
totalMakes300: MedalGQL @deprecated(reason: "no longer supported")
totalMakes400: MedalGQL @deprecated(reason: "no longer supported")
totalMakes750: MedalGQL @deprecated(reason: "no longer supported")
totalMakes100: MedalGQL
totalMakes500: MedalGQL
totalMakes1000: MedalGQL
totalMakes5000: MedalGQL
totalMakes10000: MedalGQL
dailyMakes50: MedalGQL
dailyMakes100: MedalGQL
dailyMakes150: MedalGQL
dailyMakes200: MedalGQL
dailyMakes250: MedalGQL
}
type MedalGQL {
count: Int!
nickname: String
}
input MedalScope @oneOf {
videoId: Int
interval: TimeInterval
@deprecated(reason: "NO LONGER SUPPORTED, USE DATETIME_RANGE")
datetimeRange: DatetimeRangeAggregationInput
}
type GetRunsResult {
runs: [RunGQL!]!
count: Int
runIds: [Int!]!
}
type RunGQL {
type VideoGQL {
id: Int!
runLength: Int!
videoId: Int!
userId: Int!
owner: UserGQL
name: String
screenshotUri: String
totalShotsMade: Int!
totalShots: Int!
makePercentage: Float!
medianRun: Float
averageTimeBetweenShots: Float
averageDifficulty: Float
createdAt: DateTime
updatedAt: DateTime
shots: [ShotGQL!]!
video: VideoGQL!
user: UserGQL!
startTime: DateTime
endTime: DateTime
elapsedTime: Float
framesPerSecond: Float!
tableSize: Float!
private: Boolean!
stream: UploadStreamGQL
playlist: HLSPlaylistGQL
tags: [VideoTag!]!
currentHomography: HomographyInfoGQL
homographyHistory: [HomographyInfoGQL!]!
currentProcessing: VideoProcessingGQL
reactions: [ReactionGQL!]!
comments: [CommentGQL!]!
}
type UserGQL {
id: Int!
firebaseUid: String
username: String!
isAdmin: Boolean
fargoRating: Int
activeVideoId: Int
profileImageUri: String
createdAt: DateTime
updatedAt: DateTime
videosPrivateByDefault: Boolean
following: [UserGQL!]
followers: [UserGQL!]
}
type ShotGQL {
@ -423,21 +412,6 @@ type SerializedShotPathsGQL {
b64EncodedBuffer: String
}
type UserGQL {
id: Int!
firebaseUid: String
username: String!
isAdmin: Boolean
fargoRating: Int
activeVideoId: Int
profileImageUri: String
createdAt: DateTime
updatedAt: DateTime
videosPrivateByDefault: Boolean
following: [UserGQL!]
followers: [UserGQL!]
}
type ShotAnnotationGQL {
shotId: Int!
type: ShotAnnotationTypeGQL!
@ -453,34 +427,19 @@ type ShotAnnotationTypeGQL {
name: String!
}
type VideoGQL {
type RunGQL {
id: Int!
owner: UserGQL
name: String
screenshotUri: String
totalShotsMade: Int!
totalShots: Int!
makePercentage: Float!
medianRun: Float
averageTimeBetweenShots: Float
averageDifficulty: Float
createdAt: DateTime
updatedAt: DateTime
runLength: Int!
videoId: Int!
userId: Int!
shots: [ShotGQL!]!
startTime: DateTime
endTime: DateTime
elapsedTime: Float
framesPerSecond: Float!
tableSize: Float!
private: Boolean!
stream: UploadStreamGQL
playlist: HLSPlaylistGQL
tags: [VideoTag!]!
currentHomography: HomographyInfoGQL
homographyHistory: [HomographyInfoGQL!]!
currentProcessing: VideoProcessingGQL
reactions: [ReactionGQL!]!
comments: [CommentGQL!]!
video: VideoGQL!
user: UserGQL!
}
type RunFeaturesGQL {
runId: Int!
indexInRun: Int!
}
type UploadStreamGQL {
@ -636,9 +595,100 @@ type CommentGQL {
replies: [CommentGQL!]!
}
type RunFeaturesGQL {
runId: Int!
indexInRun: Int!
type PageInfoGQL {
hasNextPage: Boolean!
endCursor: String
}
enum IncludePrivateEnum {
ALL
MINE
NONE
}
input VideoFilterInput {
isStreamCompleted: Boolean = null
requireCursorCompletion: Boolean! = true
createdAt: DateRangeFilter = null
excludeVideosWithNoShots: Boolean = null
}
input VideoFeedInputGQL @oneOf {
followedByUserId: Int
userId: Int
allUsers: Boolean
}
type MakePercentageIntervalGQL {
makePercentage: Float!
elapsedTime: Float!
}
type RunLeaderboardGQL {
entries: [RunGQL!]!
}
type CountLeaderboardGQL {
entries: [UserShotCountEntry!]!
}
type UserShotCountEntry {
user: UserGQL!
value: Int!
total: Int!
proportionMade: Float!
videos: Int!
}
type RequestedMedalsGQL {
distanceOver66: MedalGQL
distanceOver78: MedalGQL
distanceOver90: MedalGQL
runLength3: MedalGQL
runLength5: MedalGQL
runLength8: MedalGQL
runLength10: MedalGQL
runLength15: MedalGQL
runLength20: MedalGQL
runLength25: MedalGQL
runLength30: MedalGQL
runLength40: MedalGQL
runLength50: MedalGQL
totalMakes25: MedalGQL @deprecated(reason: "no longer supported")
totalMakes50: MedalGQL @deprecated(reason: "no longer supported")
totalMakes75: MedalGQL @deprecated(reason: "no longer supported")
totalMakes200: MedalGQL @deprecated(reason: "no longer supported")
totalMakes300: MedalGQL @deprecated(reason: "no longer supported")
totalMakes400: MedalGQL @deprecated(reason: "no longer supported")
totalMakes750: MedalGQL @deprecated(reason: "no longer supported")
totalMakes100: MedalGQL
totalMakes500: MedalGQL
totalMakes1000: MedalGQL
totalMakes5000: MedalGQL
totalMakes10000: MedalGQL
dailyMakes50: MedalGQL
dailyMakes100: MedalGQL
dailyMakes150: MedalGQL
dailyMakes200: MedalGQL
dailyMakes250: MedalGQL
}
type MedalGQL {
count: Int!
nickname: String
}
input MedalScope @oneOf {
videoId: Int
interval: TimeInterval
@deprecated(reason: "NO LONGER SUPPORTED, USE DATETIME_RANGE")
datetimeRange: DatetimeRangeAggregationInput
}
type GetRunsResult {
runs: [RunGQL!]!
count: Int
runIds: [Int!]!
}
input RunFilterInput {
@ -673,6 +723,39 @@ input DatetimeOrdering {
startingAt: DateTime = null
}
type TableStateGQL {
identifierToPosition: [[Float!]!]!
homography: HomographyInfoGQL
}
input HomographyInputGQL {
crop: BoundingBoxInputGQL!
pockets: [BoundingBoxInputGQL!]!
sourcePoints: PocketPointsInputGQL!
destPoints: PocketPointsInputGQL!
}
input BoundingBoxInputGQL {
left: Float!
top: Float!
width: Float!
height: Float!
}
input PocketPointsInputGQL {
topLeft: IntPoint2DInput!
topSide: IntPoint2DInput!
topRight: IntPoint2DInput!
bottomLeft: IntPoint2DInput!
bottomSide: IntPoint2DInput!
bottomRight: IntPoint2DInput!
}
input IntPoint2DInput {
x: Int!
y: Int!
}
type GetShotsResult {
shots: [ShotGQL!]!
count: Int
@ -722,23 +805,6 @@ type UserPlayTimeGQL {
totalSeconds: Float!
}
input VideoFilterInput {
isStreamCompleted: Boolean = null
requireCursorCompletion: Boolean! = true
createdAt: DateRangeFilter = null
excludeVideosWithNoShots: Boolean = null
}
type VideoHistoryGQL {
videos: [VideoGQL!]!
pageInfo: PageInfoGQL!
}
type PageInfoGQL {
hasNextPage: Boolean!
endCursor: String
}
type TagGQL {
id: Int!
name: String!
@ -759,41 +825,17 @@ scalar JSON
url: "https://ecma-international.org/wp-content/uploads/ECMA-404_2nd_edition_december_2017.pdf"
)
enum IncludePrivateEnum {
ALL
MINE
NONE
}
input VideoFeedInputGQL @oneOf {
followedByUserId: Int
userId: Int
allUsers: Boolean
}
type RunLeaderboardGQL {
entries: [RunGQL!]!
}
type CountLeaderboardGQL {
entries: [UserShotCountEntry!]!
}
type UserShotCountEntry {
user: UserGQL!
value: Int!
total: Int!
proportionMade: Float!
videos: Int!
}
type Mutation {
createBucketSet(params: CreateBucketSetInput!): BucketSetGQL!
setLoggerLevel(path: String!, level: String!): Boolean!
editShot(
shotId: Int!
fieldsToEdit: EditableShotFieldInputGQL!
): EditShotReturn!
reactToVideo(videoId: Int!, reaction: ReactionEnum): Boolean!
commentOnVideo(
videoId: Int!
message: String!
parentCommentId: Int
): Boolean!
editComment(videoId: Int!, commentId: Int!, newMessage: String!): Boolean!
deleteComment(videoId: Int!, commentId: Int!): Boolean!
addAnnotationToShot(
shotId: Int!
annotationName: String!
@ -803,6 +845,10 @@ type Mutation {
shotId: Int!
annotations: [UpdateAnnotationInputGQL!]!
): UpdateShotAnnotationReturn!
editShot(
shotId: Int!
fieldsToEdit: EditableShotFieldInputGQL!
): EditShotReturn!
getProfileImageUploadLink(
fileExt: String = ".png"
): GetProfileUploadLinkReturn!
@ -825,14 +871,6 @@ type Mutation {
editUploadStream(videoId: Int!, videoMetadata: VideoMetadataInput!): Boolean!
deleteVideo(videoId: Int!): Boolean!
deleteTags(videoId: Int!, tagsToDelete: [VideoTagInput!]!): Boolean!
reactToVideo(videoId: Int!, reaction: ReactionEnum): Boolean!
commentOnVideo(
videoId: Int!
message: String!
parentCommentId: Int
): Boolean!
editComment(videoId: Int!, commentId: Int!, newMessage: String!): Boolean!
deleteComment(videoId: Int!, commentId: Int!): Boolean!
}
input CreateBucketSetInput {
@ -841,27 +879,6 @@ input CreateBucketSetInput {
buckets: [BucketInputGQL!]!
}
type EditShotReturn {
shot: ShotGQL
error: DoesNotOwnShotErr
}
type DoesNotOwnShotErr {
shotId: Int!
msg: String
}
input EditableShotFieldInputGQL {
intendedPocketType: PocketEnum
shotDirection: ShotDirectionEnum
spinType: SpinTypeEnum
targetPocketAngleDirection: ShotDirectionEnum
make: Boolean
backcut: Boolean
excludeFromStats: Boolean
notes: String
}
type AddShotAnnotationReturn {
value: SuccessfulAddAddShotAnnotationErrors!
}
@ -882,6 +899,11 @@ union DoesNotOwnShotErrOtherErrorNeedsNote =
DoesNotOwnShotErr
| OtherErrorNeedsNote
type DoesNotOwnShotErr {
shotId: Int!
msg: String
}
type OtherErrorNeedsNote {
msg: String
}
@ -896,6 +918,22 @@ input UpdateAnnotationInputGQL {
notes: String = null
}
type EditShotReturn {
shot: ShotGQL
error: DoesNotOwnShotErr
}
input EditableShotFieldInputGQL {
intendedPocketType: PocketEnum
shotDirection: ShotDirectionEnum
spinType: SpinTypeEnum
targetPocketAngleDirection: ShotDirectionEnum
make: Boolean
backcut: Boolean
excludeFromStats: Boolean
notes: String
}
type GetProfileUploadLinkReturn {
value: UploadLinkGetProfileUploadLinkErrors!
}