Compare commits
24 Commits
dean/add-d
...
compute-po
| Author | SHA1 | Date | |
|---|---|---|---|
| adf05e3c28 | |||
| 5391466e90 | |||
| 4ff2db1ef4 | |||
| 257dcdc31a | |||
|
|
b41365e99e | ||
|
|
0e8233a5d5 | ||
| b6adae4949 | |||
| 459e89d8b8 | |||
| fa2ff19572 | |||
| 428286fa5a | |||
|
|
8771350115 | ||
|
|
f1594b8492 | ||
|
|
3ec3e3d081 | ||
|
|
d2c697e4cb | ||
| 3484af9dde | |||
| bc62cb5e39 | |||
| bc52145a9e | |||
| 5c286f2bcf | |||
| d636c298f8 | |||
| 681320c62d | |||
| 49f409f60b | |||
| e7fc6c147d | |||
| 10c3f6de53 | |||
| b477590137 |
902
src/index.tsx
902
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 {
|
... on TooManyInitUploadsErr {
|
||||||
linksRequested
|
linksRequested
|
||||||
}
|
}
|
||||||
|
... on StorageLimitExceededErr {
|
||||||
|
reason
|
||||||
|
tierName
|
||||||
|
retainedStorageUsedBytes
|
||||||
|
retainedStorageLimitBytes
|
||||||
|
remainingStorageBytes
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
166
src/schema.gql
166
src/schema.gql
@@ -66,6 +66,12 @@ type Query {
|
|||||||
tableSize: Float = 100
|
tableSize: Float = 100
|
||||||
useHomography: HomographyInputGQL = null
|
useHomography: HomographyInputGQL = null
|
||||||
): TableStateGQL!
|
): TableStateGQL!
|
||||||
|
simulateShot(simulationInput: SimulateShotInputGQL!): ShotProjectionGQL!
|
||||||
|
computePotAim(
|
||||||
|
simulationInput: SimulateShotInputGQL!
|
||||||
|
targetBallId: Int!
|
||||||
|
pocket: PocketIdentifier!
|
||||||
|
): PotAimGQL!
|
||||||
getOrderedShots(
|
getOrderedShots(
|
||||||
filterInput: FilterInput!
|
filterInput: FilterInput!
|
||||||
ids: [Int!] = null
|
ids: [Int!] = null
|
||||||
@@ -108,8 +114,10 @@ type Query {
|
|||||||
): UserRelationshipsResult!
|
): UserRelationshipsResult!
|
||||||
getAvailableSubscriptionOptions: StripeSubscriptionOptionsGQL!
|
getAvailableSubscriptionOptions: StripeSubscriptionOptionsGQL!
|
||||||
getUserSubscriptionStatus: UserSubscriptionStatusGQL!
|
getUserSubscriptionStatus: UserSubscriptionStatusGQL!
|
||||||
|
getResolvedTier: ResolvedTierGQL!
|
||||||
getAppleAppAccountToken: String!
|
getAppleAppAccountToken: String!
|
||||||
getQuotaStatus: QuotaStatusGQL!
|
getQuotaStatus: QuotaStatusGQL!
|
||||||
|
getStorageStatus: StorageStatusGQL
|
||||||
getPlayTime(userId: Int!, filters: VideoFilterInput = null): UserPlayTimeGQL!
|
getPlayTime(userId: Int!, filters: VideoFilterInput = null): UserPlayTimeGQL!
|
||||||
getUserVideos(
|
getUserVideos(
|
||||||
userId: Int = null
|
userId: Int = null
|
||||||
@@ -119,6 +127,8 @@ type Query {
|
|||||||
): VideoHistoryGQL!
|
): VideoHistoryGQL!
|
||||||
getUserTags(includeRetiredTags: Boolean = false): [TagGQL!]!
|
getUserTags(includeRetiredTags: Boolean = false): [TagGQL!]!
|
||||||
getGameTypeTagMetrics(input: GameTypeTagMetricsInput!): [GameTypeTagMetric!]!
|
getGameTypeTagMetrics(input: GameTypeTagMetricsInput!): [GameTypeTagMetric!]!
|
||||||
|
videoExportJob(jobId: Int!): VideoExportJobGQL
|
||||||
|
myVideoExports(limit: Int! = 30, offset: Int! = 0): [VideoExportJobGQL!]!
|
||||||
getVideo(videoId: Int!, debuggingJson: JSON = null): VideoGQL!
|
getVideo(videoId: Int!, debuggingJson: JSON = null): VideoGQL!
|
||||||
getVideos(videoIds: [Int!]!): [VideoGQL!]!
|
getVideos(videoIds: [Int!]!): [VideoGQL!]!
|
||||||
}
|
}
|
||||||
@@ -710,6 +720,7 @@ type DeployedConfigGQL {
|
|||||||
minimumAllowedAppVersion: String!
|
minimumAllowedAppVersion: String!
|
||||||
subscriptionGatingEnabled: Boolean!
|
subscriptionGatingEnabled: Boolean!
|
||||||
quotaEnforcementEnabled: Boolean!
|
quotaEnforcementEnabled: Boolean!
|
||||||
|
storageLimitEnforcementEnabled: Boolean!
|
||||||
bannerMessages: [BannerGQL!]!
|
bannerMessages: [BannerGQL!]!
|
||||||
defaultAndroidRecordingFormat: StreamSegmentTypeEnum!
|
defaultAndroidRecordingFormat: StreamSegmentTypeEnum!
|
||||||
bucketUrl: String!
|
bucketUrl: String!
|
||||||
@@ -862,6 +873,7 @@ enum NotificationTypeEnum {
|
|||||||
REACTION
|
REACTION
|
||||||
FOLLOW
|
FOLLOW
|
||||||
CHALLENGE_INVITE
|
CHALLENGE_INVITE
|
||||||
|
EXPORT_READY
|
||||||
}
|
}
|
||||||
|
|
||||||
input NotificationFilters {
|
input NotificationFilters {
|
||||||
@@ -964,6 +976,76 @@ input IntPoint2DInput {
|
|||||||
y: Int!
|
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 {
|
type GetShotsResult {
|
||||||
shots: [ShotGQL!]!
|
shots: [ShotGQL!]!
|
||||||
count: Int
|
count: Int
|
||||||
@@ -1071,6 +1153,17 @@ enum StripeSubscriptionStatusEnum {
|
|||||||
PAUSED
|
PAUSED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ResolvedTierGQL {
|
||||||
|
tierName: String!
|
||||||
|
tierDisplayName: String!
|
||||||
|
hasActiveSubscription: Boolean!
|
||||||
|
entitlementSource: EntitlementSourceTypeEnum
|
||||||
|
entitlementStatus: String
|
||||||
|
entitlementStartsAt: DateTime
|
||||||
|
entitlementEndsAt: DateTime
|
||||||
|
capabilities: [String!]!
|
||||||
|
}
|
||||||
|
|
||||||
type QuotaStatusGQL {
|
type QuotaStatusGQL {
|
||||||
tierName: String!
|
tierName: String!
|
||||||
periodStart: DateTime!
|
periodStart: DateTime!
|
||||||
@@ -1095,6 +1188,27 @@ type QuotaBucketStatusGQL {
|
|||||||
canUpload: Boolean!
|
canUpload: Boolean!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type StorageStatusGQL {
|
||||||
|
userId: Int!
|
||||||
|
tierName: String!
|
||||||
|
retainedStorageUsedBytes: BigInt!
|
||||||
|
retainedStorageLimitBytes: BigInt
|
||||||
|
isUnlimited: Boolean!
|
||||||
|
policyConfigured: Boolean!
|
||||||
|
remainingStorageBytes: BigInt
|
||||||
|
storageUsageRatio: Float
|
||||||
|
isNearLimit: Boolean!
|
||||||
|
isOverLimit: Boolean!
|
||||||
|
usageCalculated: Boolean!
|
||||||
|
usageSource: String
|
||||||
|
lastCalculatedAt: DateTime
|
||||||
|
}
|
||||||
|
|
||||||
|
"""
|
||||||
|
Integer value that can exceed GraphQL Int's 32-bit range.
|
||||||
|
"""
|
||||||
|
scalar BigInt
|
||||||
|
|
||||||
type UserPlayTimeGQL {
|
type UserPlayTimeGQL {
|
||||||
totalSeconds: Float!
|
totalSeconds: Float!
|
||||||
}
|
}
|
||||||
@@ -1130,6 +1244,36 @@ input GameTypeTagMetricsInput {
|
|||||||
includePrivate: IncludePrivateEnum! = MINE
|
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).
|
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).
|
||||||
"""
|
"""
|
||||||
@@ -1231,6 +1375,8 @@ type Mutation {
|
|||||||
feedback: String = null
|
feedback: String = null
|
||||||
metadata: CancellationFeedbackMetadataInput = null
|
metadata: CancellationFeedbackMetadataInput = null
|
||||||
): Boolean!
|
): Boolean!
|
||||||
|
requestVideoExport(input: RequestVideoExportInput!): VideoExportJobGQL!
|
||||||
|
dismissVideoExport(jobId: Int!): Boolean!
|
||||||
findPrerecordTableLayout(b64Image: String!, videoId: Int!): HomographyInfoGQL
|
findPrerecordTableLayout(b64Image: String!, videoId: Int!): HomographyInfoGQL
|
||||||
createUploadStream(
|
createUploadStream(
|
||||||
videoMetadata: VideoMetadataInput!
|
videoMetadata: VideoMetadataInput!
|
||||||
@@ -1413,6 +1559,13 @@ input CancellationFeedbackMetadataInput {
|
|||||||
platform: String = null
|
platform: String = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input RequestVideoExportInput {
|
||||||
|
videoId: Int!
|
||||||
|
mode: VideoExportModeEnum!
|
||||||
|
shotIds: [Int!] = null
|
||||||
|
runId: Int = null
|
||||||
|
}
|
||||||
|
|
||||||
type CreateUploadStreamReturn {
|
type CreateUploadStreamReturn {
|
||||||
videoId: Int!
|
videoId: Int!
|
||||||
}
|
}
|
||||||
@@ -1452,10 +1605,10 @@ type GetUploadLinkReturn {
|
|||||||
union UploadLinkGetUploadLinkErrors = UploadLink | GetUploadLinkErrors
|
union UploadLinkGetUploadLinkErrors = UploadLink | GetUploadLinkErrors
|
||||||
|
|
||||||
type GetUploadLinkErrors {
|
type GetUploadLinkErrors {
|
||||||
error: MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoInitForChunkedUploadErrTooManyProfileImageUploadsErrInitUploadAlreadyCompletedErrTooManyInitUploadsErr!
|
error: MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoInitForChunkedUploadErrTooManyProfileImageUploadsErrInitUploadAlreadyCompletedErrTooManyInitUploadsErrStorageLimitExceededErr!
|
||||||
}
|
}
|
||||||
|
|
||||||
union MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoInitForChunkedUploadErrTooManyProfileImageUploadsErrInitUploadAlreadyCompletedErrTooManyInitUploadsErr =
|
union MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoInitForChunkedUploadErrTooManyProfileImageUploadsErrInitUploadAlreadyCompletedErrTooManyInitUploadsErrStorageLimitExceededErr =
|
||||||
MustHaveSetForUploadLinkErr
|
MustHaveSetForUploadLinkErr
|
||||||
| SegmentAlreadyUploadedErr
|
| SegmentAlreadyUploadedErr
|
||||||
| ProcessingFailedErr
|
| ProcessingFailedErr
|
||||||
@@ -1463,6 +1616,7 @@ union MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoI
|
|||||||
| TooManyProfileImageUploadsErr
|
| TooManyProfileImageUploadsErr
|
||||||
| InitUploadAlreadyCompletedErr
|
| InitUploadAlreadyCompletedErr
|
||||||
| TooManyInitUploadsErr
|
| TooManyInitUploadsErr
|
||||||
|
| StorageLimitExceededErr
|
||||||
|
|
||||||
type MustHaveSetForUploadLinkErr {
|
type MustHaveSetForUploadLinkErr {
|
||||||
resolution: Boolean
|
resolution: Boolean
|
||||||
@@ -1488,3 +1642,11 @@ type InitUploadAlreadyCompletedErr {
|
|||||||
type TooManyInitUploadsErr {
|
type TooManyInitUploadsErr {
|
||||||
linksRequested: Int!
|
linksRequested: Int!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type StorageLimitExceededErr {
|
||||||
|
reason: String!
|
||||||
|
tierName: String!
|
||||||
|
retainedStorageUsedBytes: BigInt!
|
||||||
|
retainedStorageLimitBytes: BigInt
|
||||||
|
remainingStorageBytes: BigInt
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user