railbird-gql/src/schema.gql

675 lines
13 KiB
Plaintext
Raw Normal View History

2024-02-03 03:16:55 -07:00
type Query {
2024-03-09 10:21:43 -07:00
getAggregatedShotMetrics(
aggregateInput: AggregateInputGQL!
): [AggregateResultGQL!]!
2024-02-03 03:16:55 -07:00
getBucketSet(keyName: String!): BucketSetGQL
2024-04-01 20:46:21 -06:00
getDeployedConfig: DeployedConfigGQL!
2024-08-09 00:59:38 -06:00
waitFor(duration: Float!): Float!
getVideoMakePercentageIntervals(
videoId: ID!
intervalDuration: Int! = 300
): [MakePercentageIntervalGQL!]!
2024-09-04 16:12:20 -06:00
getShotsWithMetadata(
filterInput: FilterInput!
shotsPagination: GetShotsPagination = null
limit: Int! = 500
): GetShotsResult!
2024-08-01 19:49:57 -06:00
getShots(
filterInput: FilterInput!
shotsPagination: GetShotsPagination = null
2024-08-05 23:36:26 -06:00
limit: Int! = 500
2024-08-01 19:49:57 -06:00
): [ShotGQL!]!
2024-08-21 14:41:24 -06:00
getShotAnnotationTypes(errorTypes: Boolean = false): [ShotAnnotationTypeGQL!]!
2024-04-01 20:46:21 -06:00
getUser(userId: Int!): UserGQL
getLoggedInUser: UserGQL
2024-07-13 23:42:12 -06:00
getUsernames(
matchString: String = null
limit: Int = null
after: String = null
): [String!]!
2024-04-01 20:46:21 -06:00
getPlayTime(userId: Int!): UserPlayTimeGQL!
2024-04-05 15:46:16 -06:00
getUserVideos(
userId: Int = null
limit: Int! = 5
after: String = null
filters: VideoFilterInput = null
): VideoHistoryGQL!
2024-07-24 12:47:50 -06:00
getUserTags: [TagGQL!]!
2024-08-13 14:28:36 -06:00
getVideo(videoId: Int!, debuggingJson: JSON = null): VideoGQL!
2024-04-22 16:18:06 -06:00
getVideos(videoIds: [Int!]!): [VideoGQL!]!
2024-02-03 03:16:55 -07:00
}
type AggregateResultGQL {
aggregationIdentifiers: [AggregationIdentifierGQL!]!
targetMetrics: TargetMetricsGQL!
2024-02-03 03:16:55 -07:00
}
type AggregationIdentifierGQL {
featureName: String!
groupName: String!
2024-02-03 03:16:55 -07:00
}
type TargetMetricsGQL {
count: Int!
2024-02-03 03:16:55 -07:00
makePercentage: Float
2024-05-01 12:47:50 -06:00
averageDifficulty: Float
2024-09-18 16:58:46 -06:00
spinTypeCounts: SpinTypeCountsGQL
2024-09-19 11:46:20 -06:00
shotDirectionCounts: ShotDirectionCountsGQL
2024-09-18 16:58:46 -06:00
}
type SpinTypeCountsGQL {
follow: Int!
draw: Int!
center: Int!
unknown: Int!
2024-02-03 03:16:55 -07:00
}
2024-09-19 11:46:20 -06:00
type ShotDirectionCountsGQL {
left: Int!
right: Int!
straight: Int!
}
2024-03-09 10:21:43 -07:00
input AggregateInputGQL {
aggregations: [AggregationInput!]!
2024-03-09 10:21:43 -07:00
filterInput: FilterInput
}
2024-05-22 16:41:24 -06:00
input AggregationInput @oneOf {
2024-05-22 15:13:18 -06:00
bucketSet: BucketSetInputGQL
enum: EnumAggregation
2024-09-18 14:48:52 -06:00
datetimeRange: DatetimeRangeAggregationInput
}
2024-02-03 03:16:55 -07:00
input BucketSetInputGQL {
feature: String!
buckets: [BucketInputGQL!]!
}
input BucketInputGQL {
rangeKey: String!
lowerBound: Float!
}
input EnumAggregation {
feature: String!
}
2024-09-18 14:48:52 -06:00
input DatetimeRangeAggregationInput {
startDatetime: DateTime!
endDatetime: DateTime!
interval: TimeInterval!
}
"""
Date with time (isoformat)
"""
scalar DateTime
input TimeInterval {
"""
A second is the base unit and cannot be subdivided
"""
seconds: Int = 0
minutes: Int = 0
hours: Int = 0
days: Int = 0
weeks: Int = 0
"""
Assumes a month is 30 days long
"""
months: Int = 0
"""
Assumes a year is 365 days long
"""
years: Int = 0
}
2024-05-22 16:41:24 -06:00
input FilterInput @oneOf {
2024-05-22 15:13:18 -06:00
andFilters: [FilterInput!]
orFilters: [FilterInput!]
2024-07-10 16:17:25 -06:00
notFilter: FilterInput
2024-05-22 15:13:18 -06:00
cueObjectDistance: RangeFilter
targetPocketDistance: RangeFilter
cueObjectAngle: RangeFilter
cueBallSpeed: RangeFilter
difficulty: RangeFilter
intendedPocketType: [PocketEnum!]
shotDirection: [ShotDirectionEnum!]
videoId: [Int!]
userId: [Int!]
make: [Boolean!]
tags: [VideoTagInput!]
2024-07-08 10:56:05 -06:00
annotations: [ShotAnnotationInput!]
isStraight: [Boolean!]
isRight: [Boolean!]
isLeft: [Boolean!]
isLeftMiss: [Boolean!]
isRightMiss: [Boolean!]
2024-07-12 17:52:06 -06:00
isDirect: [Boolean!]
2024-08-15 20:42:53 -06:00
tableSize: RangeFilter
2024-07-12 17:52:06 -06:00
bankAngle: RangeFilter
bankDistance: RangeFilter
kickAngle: RangeFilter
kickDistance: RangeFilter
2024-07-19 17:18:14 -06:00
cueAngleAfterObject: RangeFilter
2024-08-28 17:27:21 -06:00
spinType: [SpinTypeEnum!]
2024-07-19 17:18:14 -06:00
cueSpeedAfterObject: RangeFilter
2024-07-28 02:06:39 -06:00
falsePositiveScore: RangeFilter
2024-09-19 18:28:18 -06:00
backcut: [Boolean!]
targetPocketAngleDirection: [ShotDirectionEnum!]
targetPocketAngle: RangeFilter
2024-03-09 10:21:43 -07:00
}
input RangeFilter {
lessThan: Float = null
greaterThanEqualTo: Float = null
2024-08-15 20:42:53 -06:00
greaterThan: Float = null
2024-07-29 17:21:09 -06:00
includeOnNone: Boolean! = false
2024-08-15 20:42:53 -06:00
lessThanInclusive: Boolean! = false
greaterThanInclusive: Boolean! = true
2024-03-09 10:21:43 -07:00
}
enum PocketEnum {
CORNER
SIDE
2024-03-17 22:33:52 -06:00
}
enum ShotDirectionEnum {
LEFT
RIGHT
STRAIGHT
2024-03-09 10:21:43 -07:00
}
2024-03-28 15:20:39 -06:00
input VideoTagInput {
2024-04-01 18:04:54 -06:00
tagClasses: [VideoTagClassInput!]! = []
2024-03-28 15:20:39 -06:00
name: String!
}
input VideoTagClassInput {
name: String!
2024-03-19 21:02:49 -06:00
}
2024-07-08 10:56:05 -06:00
input ShotAnnotationInput {
name: String!
}
2024-08-28 17:27:21 -06:00
enum SpinTypeEnum {
DRAW
FOLLOW
CENTER
UNKNOWN
}
2024-04-01 20:46:21 -06:00
type BucketSetGQL {
keyName: String!
feature: String!
buckets: [BucketGQL!]!
2024-02-03 03:16:55 -07:00
}
2024-04-01 20:46:21 -06:00
type BucketGQL {
rangeKey: String!
lowerBound: Float!
}
2024-02-03 03:16:55 -07:00
2024-03-18 16:46:23 -06:00
type DeployedConfigGQL {
allowNewUsers: Boolean!
2024-04-01 20:46:21 -06:00
firebase: Boolean!
devMode: Boolean!
environment: String!
minimumAllowedAppVersion: String!
2024-03-18 16:46:23 -06:00
}
2024-04-01 20:46:21 -06:00
type MakePercentageIntervalGQL {
2024-02-20 19:18:21 -07:00
makePercentage: Float!
2024-04-01 20:46:21 -06:00
elapsedTime: Float!
2024-02-03 03:16:55 -07:00
}
2024-09-04 16:12:20 -06:00
type GetShotsResult {
shots: [ShotGQL!]!
count: Int
}
2024-02-03 03:16:55 -07:00
type ShotGQL {
id: Int!
videoId: Int!
startFrame: Int!
endFrame: Int!
2024-02-03 03:16:55 -07:00
createdAt: DateTime
updatedAt: DateTime
cueObjectFeatures: CueObjectFeaturesGQL
pocketingIntentionFeatures: PocketingIntentionFeaturesGQL
bankFeatures: BankFeaturesGQL
2024-05-22 16:41:24 -06:00
serializedShotPaths: SerializedShotPathsGQL
2024-04-09 22:34:54 -06:00
user: UserGQL
2024-07-15 15:32:21 -06:00
annotations: [ShotAnnotationGQL!]!
2024-07-28 02:06:39 -06:00
falsePositiveScore: Float
2024-08-01 19:49:57 -06:00
video: VideoGQL
2024-02-03 03:16:55 -07:00
}
type CueObjectFeaturesGQL {
2024-02-03 03:16:55 -07:00
cueObjectDistance: Float
cueObjectAngle: Float
2024-02-03 03:16:55 -07:00
cueBallSpeed: Float
shotDirection: ShotDirectionEnum
2024-08-28 17:27:21 -06:00
spinType: SpinTypeEnum
2024-02-03 03:16:55 -07:00
}
type PocketingIntentionFeaturesGQL {
targetPocketDistance: Float
make: Boolean
intendedPocketType: PocketEnum
2024-05-01 12:47:50 -06:00
difficulty: Float
2024-09-19 18:28:18 -06:00
targetPocketAngle: Float
targetPocketAngleDirection: ShotDirectionEnum
backcut: Boolean
2024-02-03 03:16:55 -07:00
}
type BankFeaturesGQL {
wallsHit: [WallTypeEnum!]!
bankAngle: Float!
distance: Float!
}
enum WallTypeEnum {
LONG
SHORT
}
2024-05-22 16:41:24 -06:00
type SerializedShotPathsGQL {
b64EncodedBuffer: String
}
2024-04-01 20:46:21 -06:00
type UserGQL {
id: Int!
firebaseUid: String!
username: String!
2024-07-13 17:40:30 -06:00
isAdmin: Boolean!
activeVideoId: Int
2024-04-01 20:46:21 -06:00
profileImageUri: String
createdAt: DateTime
updatedAt: DateTime
}
2024-07-15 15:32:21 -06:00
type ShotAnnotationGQL {
shotId: Int!
type: ShotAnnotationTypeGQL!
creator: UserGQL!
notes: String!
2024-08-21 14:41:24 -06:00
errorDefault: Boolean!
2024-07-15 15:32:21 -06:00
createdAt: DateTime
updatedAt: DateTime
}
2024-07-08 13:18:11 -06:00
type ShotAnnotationTypeGQL {
id: Int!
name: String!
}
2024-04-01 20:46:21 -06:00
type VideoGQL {
id: Int!
owner: UserGQL
name: String
2024-04-29 14:08:27 -06:00
screenshotUri: String
2024-04-01 20:46:21 -06:00
totalShotsMade: Int!
totalShots: Int!
makePercentage: Float!
medianRun: Float
averageTimeBetweenShots: Float
createdAt: DateTime
updatedAt: DateTime
shots: [ShotGQL!]!
startTime: DateTime
endTime: DateTime
elapsedTime: Float
2024-04-23 20:25:27 -06:00
framesPerSecond: Float!
2024-08-15 19:05:19 -06:00
tableSize: Float!
2024-04-01 20:46:21 -06:00
stream: UploadStreamGQL
2024-04-22 16:18:06 -06:00
playlist: HLSPlaylistGQL
2024-04-01 20:46:21 -06:00
tags: [VideoTag!]!
2024-09-04 17:59:54 -06:00
currentHomography: HomographyInfoGQL
2024-04-01 20:46:21 -06:00
homographyHistory: [HomographyInfoGQL!]!
2024-05-20 23:39:47 -06:00
currentProcessing: VideoProcessingGQL
2024-04-01 20:46:21 -06:00
}
2024-02-03 03:16:55 -07:00
type UploadStreamGQL {
id: ID!
linksRequested: Int!
uploadsCompleted: Int!
segmentProcessingCursor: Int!
2024-05-20 23:39:47 -06:00
lastIntendedSegmentBound: Int
2024-02-03 03:16:55 -07:00
isCompleted: Boolean!
2024-07-16 15:21:45 -06:00
initPlaylistUploadStatus: InitPlaylistUploadStatusEnum
2024-04-16 17:49:50 -06:00
lowestUnuploadedSegmentIndex: Int!
2024-05-01 17:39:52 -06:00
uploadCompletionCursor: Int!
errors: [StreamErrorGQL!]!
2024-02-03 03:16:55 -07:00
createdAt: DateTime!
updatedAt: DateTime!
2024-05-01 17:39:52 -06:00
segments: [UploadSegmentGQL!]!
2024-07-25 18:18:16 -06:00
resolution: VideoResolutionGQL!
2024-07-27 20:51:48 -06:00
streamSegmentType: StreamSegmentTypeEnum!
2024-02-03 03:16:55 -07:00
}
2024-07-16 15:21:45 -06:00
enum InitPlaylistUploadStatusEnum {
NOT_APPLICABLE
NOT_UPLOADED
UPLOADED
}
2024-03-23 17:03:11 -06:00
type StreamErrorGQL {
message: String!
}
2024-04-30 21:55:48 -06:00
type UploadSegmentGQL {
segmentIndex: Int!
uploaded: Boolean!
valid: Boolean!
endFrameIndex: Int
framesPerSecond: Float
2024-07-16 21:48:15 -06:00
durationInSeconds: Float
2024-04-30 21:55:48 -06:00
linksRequested: Int!
}
2024-07-25 18:18:16 -06:00
type VideoResolutionGQL {
width: Int
height: Int
}
2024-07-27 20:51:48 -06:00
enum StreamSegmentTypeEnum {
FRAGMENTED_MP4
RB_CHUNKED_MP4
}
2024-04-22 16:18:06 -06:00
type HLSPlaylistGQL {
videoId: Int!
m3u8Text: String!
segmentDurations: [Float!]!
}
2024-03-23 17:03:11 -06:00
type VideoTag {
tagClasses: [VideoTagClass!]!
name: String!
}
type VideoTagClass {
name: String!
}
type HomographyInfoGQL {
2024-03-23 17:03:11 -06:00
frameIndex: Int!
crop: BoundingBoxGQL!
pockets: [BoundingBoxGQL!]!
sourcePoints: PocketPointsGQL!
destPoints: PocketPointsGQL!
}
type BoundingBoxGQL {
2024-03-23 17:03:11 -06:00
left: Float!
top: Float!
width: Float!
height: Float!
}
type PocketPointsGQL {
topLeft: IntPoint2D!
topSide: IntPoint2D!
topRight: IntPoint2D!
bottomLeft: IntPoint2D!
bottomSide: IntPoint2D!
bottomRight: IntPoint2D!
}
type IntPoint2D {
x: Int!
y: Int!
}
2024-05-20 23:39:47 -06:00
type VideoProcessingGQL {
errors: [VideoProcessingErrorGQL!]!
2024-08-13 12:33:31 -06:00
status: ProcessingStatusEnum!
statuses: [VideoProcessingStatusGQL!]!
2024-05-20 23:39:47 -06:00
}
type VideoProcessingErrorGQL {
message: String!
startSegmentIndex: Int
endSegmentIndex: Int
}
2024-08-13 12:33:31 -06:00
enum ProcessingStatusEnum {
STARTED
FAILED
SUCCEEDED
SUSPENDED
CREATED
QUEUED
RUNNING
REEXTRACTING_FEATURES
}
type VideoProcessingStatusGQL {
status: ProcessingStatusEnum!
appVersion: String!
sequenceId: Int!
createdAt: DateTime
updatedAt: DateTime
}
2024-08-01 19:49:57 -06:00
input GetShotsPagination {
createdAfter: CreatedAfter!
startFrameAfter: Int!
}
input CreatedAfter @oneOf {
videoId: Int
createdAt: DateTime
}
type UserPlayTimeGQL {
totalSeconds: Float!
}
type VideoHistoryGQL {
videos: [VideoGQL!]!
pageInfo: PageInfoGQL!
}
2024-02-20 19:18:21 -07:00
type PageInfoGQL {
hasNextPage: Boolean!
endCursor: String
}
2024-04-05 15:46:16 -06:00
input VideoFilterInput {
isStreamCompleted: Boolean = null
2024-05-02 22:08:57 -06:00
requireCursorCompletion: Boolean! = true
2024-04-05 15:46:16 -06:00
}
2024-07-22 19:22:03 -06:00
type TagGQL {
name: String!
id: Int!
2024-07-23 19:53:39 -06:00
group: String
2024-07-22 19:22:03 -06:00
}
2024-08-13 14:28:36 -06:00
"""
The `JSON` scalar type represents JSON values as specified by [ECMA-404](https://ecma-international.org/wp-content/uploads/ECMA-404_2nd_edition_december_2017.pdf).
"""
scalar JSON
@specifiedBy(
url: "https://ecma-international.org/wp-content/uploads/ECMA-404_2nd_edition_december_2017.pdf"
)
2024-02-03 03:16:55 -07:00
type Mutation {
createBucketSet(params: CreateBucketSetInput!): BucketSetGQL!
2024-04-01 20:46:21 -06:00
setLoggerLevel(path: String!, level: String!): Boolean!
2024-08-21 14:41:24 -06:00
addAnnotationToShot(
shotId: Int!
annotationName: String!
notes: String = null
): AddShotAnnotationReturn!
2024-08-19 15:44:43 -06:00
getProfileImageUploadLink(
fileExt: String = ".png"
): GetProfileUploadLinkReturn!
2024-04-01 20:46:21 -06:00
editProfileImageUri(profileImageUri: String!): UserGQL!
2024-02-22 19:27:29 -07:00
createUploadStream(
2024-03-04 22:22:42 -07:00
videoMetadata: VideoMetadataInput!
2024-02-22 19:27:29 -07:00
): CreateUploadStreamReturn!
2024-02-11 22:42:37 -07:00
getUploadLink(videoId: Int!, segmentIndex: Int!): GetUploadLinkReturn!
getHlsInitUploadLink(videoId: Int!): GetUploadLinkReturn!
setSegmentDuration(
videoId: Int!
segmentIndex: Int!
duration: Float!
): Boolean!
editUploadStream(videoId: Int!, videoMetadata: VideoMetadataInput!): Boolean!
deleteVideo(videoId: Int!): Boolean!
2024-02-03 03:16:55 -07:00
}
input CreateBucketSetInput {
keyName: String!
feature: String!
buckets: [BucketInputGQL!]!
}
2024-08-21 14:41:24 -06:00
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
}
2024-08-19 15:44:43 -06:00
type GetProfileUploadLinkReturn {
value: UploadLinkGetProfileUploadLinkErrors!
}
2024-08-19 15:44:43 -06:00
union UploadLinkGetProfileUploadLinkErrors =
UploadLink
| GetProfileUploadLinkErrors
type UploadLink {
2024-04-01 20:46:21 -06:00
uploadUrl: String!
headers: [Header]!
}
type Header {
key: String!
value: String!
}
2024-08-19 15:44:43 -06:00
type GetProfileUploadLinkErrors {
error: TooManyProfileImageUploadsErr!
}
type TooManyProfileImageUploadsErr {
linksRequested: Int!
}
2024-02-03 03:16:55 -07:00
type CreateUploadStreamReturn {
videoId: Int!
}
input VideoMetadataInput {
videoName: String = null
startTime: DateTime = null
endTime: DateTime = null
gameType: String = null
2024-08-15 16:44:30 -06:00
tableSize: Float = null
uploadStreamMetadataInput: UploadStreamMetadataInput = null
2024-04-25 16:36:32 -06:00
lastIntendedSegmentBound: Int = null
streamSegmentType: StreamSegmentTypeEnum = null
endStream: Boolean! = false
2024-07-18 01:14:18 -06:00
resolution: VideoResolution = null
2024-07-18 17:14:28 -06:00
framesPerSecond: Float = null
}
input UploadStreamMetadataInput {
2024-02-03 03:16:55 -07:00
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
}
2024-07-18 01:14:18 -06:00
input VideoResolution {
width: Int!
height: Int!
}
2024-08-19 15:44:43 -06:00
type GetUploadLinkReturn {
value: UploadLinkGetUploadLinkErrors!
stream: UploadStreamGQL
}
union UploadLinkGetUploadLinkErrors = UploadLink | GetUploadLinkErrors
type GetUploadLinkErrors {
2024-09-03 16:50:02 -06:00
error: MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoInitForChunkedUploadErrTooManyProfileImageUploadsErrInitUploadAlreadyCompletedErrTooManyInitUploadsErr!
2024-08-19 15:44:43 -06:00
}
2024-09-03 16:50:02 -06:00
union MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoInitForChunkedUploadErrTooManyProfileImageUploadsErrInitUploadAlreadyCompletedErrTooManyInitUploadsErr =
2024-08-19 15:44:43 -06:00
MustHaveSetForUploadLinkErr
| SegmentAlreadyUploadedErr
| ProcessingFailedErr
| NoInitForChunkedUploadErr
| TooManyProfileImageUploadsErr
2024-09-03 16:50:02 -06:00
| InitUploadAlreadyCompletedErr
| TooManyInitUploadsErr
2024-08-19 15:44:43 -06:00
type MustHaveSetForUploadLinkErr {
resolution: Boolean
framesPerSecond: Boolean
}
type SegmentAlreadyUploadedErr {
segmentId: Int!
}
type ProcessingFailedErr {
processing: VideoProcessingGQL!
}
type NoInitForChunkedUploadErr {
segmentType: StreamSegmentTypeEnum!
}
2024-09-03 16:50:02 -06:00
type InitUploadAlreadyCompletedErr {
segmentType: StreamSegmentTypeEnum!
}
type TooManyInitUploadsErr {
linksRequested: Int!
}