Compare commits
16 Commits
loewy/mobi
...
compute-po
| Author | SHA1 | Date | |
|---|---|---|---|
| adf05e3c28 | |||
| 5391466e90 | |||
| 4ff2db1ef4 | |||
| 257dcdc31a | |||
|
|
b41365e99e | ||
|
|
0e8233a5d5 | ||
| b6adae4949 | |||
| 459e89d8b8 | |||
| fa2ff19572 | |||
| 428286fa5a | |||
|
|
8771350115 | ||
|
|
f1594b8492 | ||
|
|
3ec3e3d081 | ||
|
|
d2c697e4cb | ||
| 3484af9dde | |||
| bc62cb5e39 |
872
src/index.tsx
872
src/index.tsx
File diff suppressed because it is too large
Load Diff
57
src/operations/shot_simulation.gql
Normal file
57
src/operations/shot_simulation.gql
Normal file
@@ -0,0 +1,57 @@
|
||||
query GetTableState(
|
||||
$b64Image: String!
|
||||
$tableSize: Float
|
||||
$useHomography: HomographyInputGQL
|
||||
) {
|
||||
getTableState(
|
||||
b64Image: $b64Image
|
||||
tableSize: $tableSize
|
||||
useHomography: $useHomography
|
||||
) {
|
||||
identifierToPosition
|
||||
}
|
||||
}
|
||||
|
||||
query SimulateShot($simulationInput: SimulateShotInputGQL!) {
|
||||
simulateShot(simulationInput: $simulationInput) {
|
||||
trajectories {
|
||||
ballId
|
||||
points {
|
||||
time
|
||||
position
|
||||
}
|
||||
}
|
||||
events {
|
||||
eventType
|
||||
time
|
||||
ballIds
|
||||
position
|
||||
}
|
||||
finalState {
|
||||
ballId
|
||||
position
|
||||
}
|
||||
pottedBallIds
|
||||
}
|
||||
}
|
||||
|
||||
query ComputePotAim(
|
||||
$simulationInput: SimulateShotInputGQL!
|
||||
$targetBallId: Int!
|
||||
$pocket: PocketIdentifier!
|
||||
) {
|
||||
computePotAim(
|
||||
simulationInput: $simulationInput
|
||||
targetBallId: $targetBallId
|
||||
pocket: $pocket
|
||||
) {
|
||||
phi
|
||||
geometricPhi
|
||||
cutAngle
|
||||
requiredPrecision
|
||||
feasible
|
||||
potted
|
||||
converged
|
||||
occludingBallIds
|
||||
}
|
||||
}
|
||||
36
src/operations/video_export.gql
Normal file
36
src/operations/video_export.gql
Normal file
@@ -0,0 +1,36 @@
|
||||
fragment VideoExportJobFields on VideoExportJobGQL {
|
||||
id
|
||||
videoId
|
||||
mode
|
||||
status
|
||||
videoName
|
||||
videoThumbnailUri
|
||||
shotIds
|
||||
runId
|
||||
downloadUrl
|
||||
fileSizeBytes
|
||||
expiresAt
|
||||
createdAt
|
||||
}
|
||||
|
||||
mutation RequestVideoExport($input: RequestVideoExportInput!) {
|
||||
requestVideoExport(input: $input) {
|
||||
...VideoExportJobFields
|
||||
}
|
||||
}
|
||||
|
||||
mutation DismissVideoExport($jobId: Int!) {
|
||||
dismissVideoExport(jobId: $jobId)
|
||||
}
|
||||
|
||||
query VideoExportJob($jobId: Int!) {
|
||||
videoExportJob(jobId: $jobId) {
|
||||
...VideoExportJobFields
|
||||
}
|
||||
}
|
||||
|
||||
query MyVideoExports($limit: Int = 30, $offset: Int = 0) {
|
||||
myVideoExports(limit: $limit, offset: $offset) {
|
||||
...VideoExportJobFields
|
||||
}
|
||||
}
|
||||
@@ -67,6 +67,13 @@ mutation GetHlsInitUploadLink($videoId: Int!) {
|
||||
... on TooManyInitUploadsErr {
|
||||
linksRequested
|
||||
}
|
||||
... on StorageLimitExceededErr {
|
||||
reason
|
||||
tierName
|
||||
retainedStorageUsedBytes
|
||||
retainedStorageLimitBytes
|
||||
remainingStorageBytes
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
135
src/schema.gql
135
src/schema.gql
@@ -66,6 +66,12 @@ type Query {
|
||||
tableSize: Float = 100
|
||||
useHomography: HomographyInputGQL = null
|
||||
): TableStateGQL!
|
||||
simulateShot(simulationInput: SimulateShotInputGQL!): ShotProjectionGQL!
|
||||
computePotAim(
|
||||
simulationInput: SimulateShotInputGQL!
|
||||
targetBallId: Int!
|
||||
pocket: PocketIdentifier!
|
||||
): PotAimGQL!
|
||||
getOrderedShots(
|
||||
filterInput: FilterInput!
|
||||
ids: [Int!] = null
|
||||
@@ -121,6 +127,8 @@ type Query {
|
||||
): VideoHistoryGQL!
|
||||
getUserTags(includeRetiredTags: Boolean = false): [TagGQL!]!
|
||||
getGameTypeTagMetrics(input: GameTypeTagMetricsInput!): [GameTypeTagMetric!]!
|
||||
videoExportJob(jobId: Int!): VideoExportJobGQL
|
||||
myVideoExports(limit: Int! = 30, offset: Int! = 0): [VideoExportJobGQL!]!
|
||||
getVideo(videoId: Int!, debuggingJson: JSON = null): VideoGQL!
|
||||
getVideos(videoIds: [Int!]!): [VideoGQL!]!
|
||||
}
|
||||
@@ -712,6 +720,7 @@ type DeployedConfigGQL {
|
||||
minimumAllowedAppVersion: String!
|
||||
subscriptionGatingEnabled: Boolean!
|
||||
quotaEnforcementEnabled: Boolean!
|
||||
storageLimitEnforcementEnabled: Boolean!
|
||||
bannerMessages: [BannerGQL!]!
|
||||
defaultAndroidRecordingFormat: StreamSegmentTypeEnum!
|
||||
bucketUrl: String!
|
||||
@@ -864,6 +873,7 @@ enum NotificationTypeEnum {
|
||||
REACTION
|
||||
FOLLOW
|
||||
CHALLENGE_INVITE
|
||||
EXPORT_READY
|
||||
}
|
||||
|
||||
input NotificationFilters {
|
||||
@@ -966,6 +976,76 @@ input IntPoint2DInput {
|
||||
y: Int!
|
||||
}
|
||||
|
||||
type ShotProjectionGQL {
|
||||
trajectories: [BallTrajectoryGQL!]!
|
||||
events: [SimulationEventGQL!]!
|
||||
finalState: [SimulationBallStateGQL!]!
|
||||
pottedBallIds: [Int!]!
|
||||
}
|
||||
|
||||
type BallTrajectoryGQL {
|
||||
ballId: Int!
|
||||
points: [TrajectoryPointGQL!]!
|
||||
}
|
||||
|
||||
type TrajectoryPointGQL {
|
||||
time: Float!
|
||||
position: [Float!]!
|
||||
}
|
||||
|
||||
type SimulationEventGQL {
|
||||
eventType: SimulationEventType!
|
||||
time: Float!
|
||||
ballIds: [Int!]!
|
||||
position: [Float!]
|
||||
}
|
||||
|
||||
enum SimulationEventType {
|
||||
STICK_BALL
|
||||
BALL_BALL
|
||||
BALL_CUSHION
|
||||
BALL_POCKET
|
||||
BALL_STOP
|
||||
}
|
||||
|
||||
type SimulationBallStateGQL {
|
||||
ballId: Int!
|
||||
position: [Float!]!
|
||||
}
|
||||
|
||||
input SimulateShotInputGQL {
|
||||
cueBallId: Int!
|
||||
strike: CueStrikeInputGQL!
|
||||
balls: [SimulationBallStateInputGQL!] = null
|
||||
b64Image: String = null
|
||||
useHomography: HomographyInputGQL = null
|
||||
tableSize: Float = null
|
||||
}
|
||||
|
||||
input CueStrikeInputGQL {
|
||||
v0: Float!
|
||||
phi: Float!
|
||||
theta: Float! = 0
|
||||
a: Float! = 0
|
||||
b: Float! = 0
|
||||
}
|
||||
|
||||
input SimulationBallStateInputGQL {
|
||||
ballId: Int!
|
||||
position: [Float!]!
|
||||
}
|
||||
|
||||
type PotAimGQL {
|
||||
phi: Float!
|
||||
geometricPhi: Float!
|
||||
cutAngle: Float!
|
||||
requiredPrecision: Float!
|
||||
feasible: Boolean!
|
||||
potted: Boolean!
|
||||
converged: Boolean!
|
||||
occludingBallIds: [Int!]!
|
||||
}
|
||||
|
||||
type GetShotsResult {
|
||||
shots: [ShotGQL!]!
|
||||
count: Int
|
||||
@@ -1119,6 +1199,9 @@ type StorageStatusGQL {
|
||||
storageUsageRatio: Float
|
||||
isNearLimit: Boolean!
|
||||
isOverLimit: Boolean!
|
||||
usageCalculated: Boolean!
|
||||
usageSource: String
|
||||
lastCalculatedAt: DateTime
|
||||
}
|
||||
|
||||
"""
|
||||
@@ -1161,6 +1244,36 @@ input GameTypeTagMetricsInput {
|
||||
includePrivate: IncludePrivateEnum! = MINE
|
||||
}
|
||||
|
||||
type VideoExportJobGQL {
|
||||
id: Int!
|
||||
videoId: Int!
|
||||
mode: VideoExportModeEnum!
|
||||
status: VideoExportStatusEnum!
|
||||
videoName: String
|
||||
videoThumbnailUri: String
|
||||
shotIds: [Int!]
|
||||
runId: Int
|
||||
downloadUrl: String
|
||||
fileSizeBytes: Int
|
||||
expiresAt: DateTime
|
||||
createdAt: DateTime
|
||||
}
|
||||
|
||||
enum VideoExportModeEnum {
|
||||
FULL_SESSION
|
||||
SHOTS
|
||||
RUN
|
||||
}
|
||||
|
||||
enum VideoExportStatusEnum {
|
||||
CREATED
|
||||
QUEUED
|
||||
RUNNING
|
||||
SUCCEEDED
|
||||
FAILED
|
||||
EXPIRED
|
||||
}
|
||||
|
||||
"""
|
||||
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).
|
||||
"""
|
||||
@@ -1262,6 +1375,8 @@ type Mutation {
|
||||
feedback: String = null
|
||||
metadata: CancellationFeedbackMetadataInput = null
|
||||
): Boolean!
|
||||
requestVideoExport(input: RequestVideoExportInput!): VideoExportJobGQL!
|
||||
dismissVideoExport(jobId: Int!): Boolean!
|
||||
findPrerecordTableLayout(b64Image: String!, videoId: Int!): HomographyInfoGQL
|
||||
createUploadStream(
|
||||
videoMetadata: VideoMetadataInput!
|
||||
@@ -1444,6 +1559,13 @@ input CancellationFeedbackMetadataInput {
|
||||
platform: String = null
|
||||
}
|
||||
|
||||
input RequestVideoExportInput {
|
||||
videoId: Int!
|
||||
mode: VideoExportModeEnum!
|
||||
shotIds: [Int!] = null
|
||||
runId: Int = null
|
||||
}
|
||||
|
||||
type CreateUploadStreamReturn {
|
||||
videoId: Int!
|
||||
}
|
||||
@@ -1483,10 +1605,10 @@ type GetUploadLinkReturn {
|
||||
union UploadLinkGetUploadLinkErrors = UploadLink | GetUploadLinkErrors
|
||||
|
||||
type GetUploadLinkErrors {
|
||||
error: MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoInitForChunkedUploadErrTooManyProfileImageUploadsErrInitUploadAlreadyCompletedErrTooManyInitUploadsErr!
|
||||
error: MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoInitForChunkedUploadErrTooManyProfileImageUploadsErrInitUploadAlreadyCompletedErrTooManyInitUploadsErrStorageLimitExceededErr!
|
||||
}
|
||||
|
||||
union MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoInitForChunkedUploadErrTooManyProfileImageUploadsErrInitUploadAlreadyCompletedErrTooManyInitUploadsErr =
|
||||
union MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoInitForChunkedUploadErrTooManyProfileImageUploadsErrInitUploadAlreadyCompletedErrTooManyInitUploadsErrStorageLimitExceededErr =
|
||||
MustHaveSetForUploadLinkErr
|
||||
| SegmentAlreadyUploadedErr
|
||||
| ProcessingFailedErr
|
||||
@@ -1494,6 +1616,7 @@ union MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoI
|
||||
| TooManyProfileImageUploadsErr
|
||||
| InitUploadAlreadyCompletedErr
|
||||
| TooManyInitUploadsErr
|
||||
| StorageLimitExceededErr
|
||||
|
||||
type MustHaveSetForUploadLinkErr {
|
||||
resolution: Boolean
|
||||
@@ -1519,3 +1642,11 @@ type InitUploadAlreadyCompletedErr {
|
||||
type TooManyInitUploadsErr {
|
||||
linksRequested: Int!
|
||||
}
|
||||
|
||||
type StorageLimitExceededErr {
|
||||
reason: String!
|
||||
tierName: String!
|
||||
retainedStorageUsedBytes: BigInt!
|
||||
retainedStorageLimitBytes: BigInt
|
||||
remainingStorageBytes: BigInt
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user