Compare commits

..

10 Commits

Author SHA1 Message Date
adf05e3c28 Add computePotAim query and shot-simulation operations
All checks were successful
Tests / Tests (pull_request) Successful in 10s
Schema: computePotAim(simulationInput, targetBallId, pocket) ->
PotAimGQL, the spin/throw-compensated aim solver (regenerated from
backend strawberry definitions; reuses the existing PocketIdentifier
enum). Operations: GetTableState, SimulateShot, and ComputePotAim
documents so both clients get generated hooks.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 01:44:02 -07:00
5391466e90 Merge pull request 'Add simulateShot query, cue strike and shot projection types' (#277) from shot-simulation-stubs into master
Reviewed-on: #277
2026-07-02 23:35:30 +00:00
4ff2db1ef4 Add simulateShot query, cue strike and shot projection types
All checks were successful
Tests / Tests (pull_request) Successful in 12s
Generated from backend strawberry definitions for the shot simulation
feature (image -> pooltool scenario -> projected outcome). Backend PR:
shot-simulation-stubs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 16:12:11 -07:00
257dcdc31a Merge pull request 'Add DismissVideoExport mutation (soft-hide exports)' (#276) from dean/export-dismiss-gql into master
Reviewed-on: #276
2026-07-02 22:38:02 +00:00
Dean Wenstrand
b41365e99e Add videoName + videoThumbnailUri to VideoExportJobFields
All checks were successful
Tests / Tests (pull_request) Successful in 13s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 14:41:59 -07:00
Dean Wenstrand
0e8233a5d5 Add DismissVideoExport mutation (soft-hide exports)
All checks were successful
Tests / Tests (pull_request) Successful in 17s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 14:18:55 -07:00
b6adae4949 Merge pull request 'Storage limit enforcement schema' (#275) from storage-limit-enforcement-schema into master
Reviewed-on: #275
2026-07-01 22:29:41 +00:00
459e89d8b8 Select storage limit error fields
All checks were successful
Tests / Tests (pull_request) Successful in 11s
2026-07-01 14:50:45 -07:00
fa2ff19572 Add storage limit enforcement schema 2026-07-01 14:41:21 -07:00
428286fa5a Merge pull request 'dean/video-export-gql' (#273) from dean/video-export-gql into master
Reviewed-on: #273
2026-06-30 22:48:02 +00:00
5 changed files with 616 additions and 4 deletions

View File

@@ -88,6 +88,12 @@ export type AppleIapSubscriptionOptionsGql = {
productIds: Array<Scalars["String"]["output"]>; productIds: Array<Scalars["String"]["output"]>;
}; };
export type BallTrajectoryGql = {
__typename?: "BallTrajectoryGQL";
ballId: Scalars["Int"]["output"];
points: Array<TrajectoryPointGql>;
};
export type BankFeaturesGql = { export type BankFeaturesGql = {
__typename?: "BankFeaturesGQL"; __typename?: "BankFeaturesGQL";
bankAngle: Scalars["Float"]["output"]; bankAngle: Scalars["Float"]["output"];
@@ -268,6 +274,14 @@ export type CueObjectFeaturesGql = {
spinType?: Maybe<SpinTypeEnum>; spinType?: Maybe<SpinTypeEnum>;
}; };
export type CueStrikeInputGql = {
a?: Scalars["Float"]["input"];
b?: Scalars["Float"]["input"];
phi: Scalars["Float"]["input"];
theta?: Scalars["Float"]["input"];
v0: Scalars["Float"]["input"];
};
export type DateRangeFilter = { export type DateRangeFilter = {
greaterThan?: InputMaybe<Scalars["Date"]["input"]>; greaterThan?: InputMaybe<Scalars["Date"]["input"]>;
greaterThanEqualTo?: InputMaybe<Scalars["Date"]["input"]>; greaterThanEqualTo?: InputMaybe<Scalars["Date"]["input"]>;
@@ -300,6 +314,7 @@ export type DeployedConfigGql = {
firebase: Scalars["Boolean"]["output"]; firebase: Scalars["Boolean"]["output"];
minimumAllowedAppVersion: Scalars["String"]["output"]; minimumAllowedAppVersion: Scalars["String"]["output"];
quotaEnforcementEnabled: Scalars["Boolean"]["output"]; quotaEnforcementEnabled: Scalars["Boolean"]["output"];
storageLimitEnforcementEnabled: Scalars["Boolean"]["output"];
subscriptionGatingEnabled: Scalars["Boolean"]["output"]; subscriptionGatingEnabled: Scalars["Boolean"]["output"];
}; };
@@ -2287,7 +2302,7 @@ export type GetShotsResult = {
export type GetUploadLinkErrors = { export type GetUploadLinkErrors = {
__typename?: "GetUploadLinkErrors"; __typename?: "GetUploadLinkErrors";
error: MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoInitForChunkedUploadErrTooManyProfileImageUploadsErrInitUploadAlreadyCompletedErrTooManyInitUploadsErr; error: MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoInitForChunkedUploadErrTooManyProfileImageUploadsErrInitUploadAlreadyCompletedErrTooManyInitUploadsErrStorageLimitExceededErr;
}; };
export type GetUploadLinkReturn = { export type GetUploadLinkReturn = {
@@ -2391,13 +2406,14 @@ export type MustHaveSetForUploadLinkErr = {
resolution?: Maybe<Scalars["Boolean"]["output"]>; resolution?: Maybe<Scalars["Boolean"]["output"]>;
}; };
export type MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoInitForChunkedUploadErrTooManyProfileImageUploadsErrInitUploadAlreadyCompletedErrTooManyInitUploadsErr = export type MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoInitForChunkedUploadErrTooManyProfileImageUploadsErrInitUploadAlreadyCompletedErrTooManyInitUploadsErrStorageLimitExceededErr =
| InitUploadAlreadyCompletedErr | InitUploadAlreadyCompletedErr
| MustHaveSetForUploadLinkErr | MustHaveSetForUploadLinkErr
| NoInitForChunkedUploadErr | NoInitForChunkedUploadErr
| ProcessingFailedErr | ProcessingFailedErr
| SegmentAlreadyUploadedErr | SegmentAlreadyUploadedErr
| StorageLimitExceededErr
| TooManyInitUploadsErr | TooManyInitUploadsErr
| TooManyProfileImageUploadsErr; | TooManyProfileImageUploadsErr;
@@ -2828,6 +2844,18 @@ export type PocketingIntentionInfoGql = {
pocketId: PocketIdentifier; pocketId: PocketIdentifier;
}; };
export type PotAimGql = {
__typename?: "PotAimGQL";
converged: Scalars["Boolean"]["output"];
cutAngle: Scalars["Float"]["output"];
feasible: Scalars["Boolean"]["output"];
geometricPhi: Scalars["Float"]["output"];
occludingBallIds: Array<Scalars["Int"]["output"]>;
phi: Scalars["Float"]["output"];
potted: Scalars["Boolean"]["output"];
requiredPrecision: Scalars["Float"]["output"];
};
export type ProcessingFailedErr = { export type ProcessingFailedErr = {
__typename?: "ProcessingFailedErr"; __typename?: "ProcessingFailedErr";
processing: VideoProcessingGql; processing: VideoProcessingGql;
@@ -2849,6 +2877,7 @@ export type Query = {
challenge?: Maybe<Challenge>; challenge?: Maybe<Challenge>;
challengeLeaderboard: Array<ChallengeEntry>; challengeLeaderboard: Array<ChallengeEntry>;
challenges: Array<Challenge>; challenges: Array<Challenge>;
computePotAim: PotAimGql;
doesUsernameExist: Scalars["Boolean"]["output"]; doesUsernameExist: Scalars["Boolean"]["output"];
getAggregatedShotMetrics: Array<AggregateResultGql>; getAggregatedShotMetrics: Array<AggregateResultGql>;
getAppleAppAccountToken: Scalars["String"]["output"]; getAppleAppAccountToken: Scalars["String"]["output"];
@@ -2891,6 +2920,7 @@ export type Query = {
myVideoExports: Array<VideoExportJobGql>; myVideoExports: Array<VideoExportJobGql>;
notifications: NotificationConnection; notifications: NotificationConnection;
ruleSets: Array<RuleSet>; ruleSets: Array<RuleSet>;
simulateShot: ShotProjectionGql;
unreadNotificationCount: Scalars["Int"]["output"]; unreadNotificationCount: Scalars["Int"]["output"];
videoExportJob?: Maybe<VideoExportJobGql>; videoExportJob?: Maybe<VideoExportJobGql>;
videoPlayerClusters: Array<PlayerClusterGql>; videoPlayerClusters: Array<PlayerClusterGql>;
@@ -2910,6 +2940,12 @@ export type QueryChallengesArgs = {
includeDismissed?: Scalars["Boolean"]["input"]; includeDismissed?: Scalars["Boolean"]["input"];
}; };
export type QueryComputePotAimArgs = {
pocket: PocketIdentifier;
simulationInput: SimulateShotInputGql;
targetBallId: Scalars["Int"]["input"];
};
export type QueryDoesUsernameExistArgs = { export type QueryDoesUsernameExistArgs = {
candidateUsername: Scalars["String"]["input"]; candidateUsername: Scalars["String"]["input"];
}; };
@@ -3080,6 +3116,10 @@ export type QueryNotificationsArgs = {
offset?: Scalars["Int"]["input"]; offset?: Scalars["Int"]["input"];
}; };
export type QuerySimulateShotArgs = {
simulationInput: SimulateShotInputGql;
};
export type QueryVideoExportJobArgs = { export type QueryVideoExportJobArgs = {
jobId: Scalars["Int"]["input"]; jobId: Scalars["Int"]["input"];
}; };
@@ -3343,6 +3383,14 @@ export type ShotMoveInput = {
shotId: Scalars["Int"]["input"]; shotId: Scalars["Int"]["input"];
}; };
export type ShotProjectionGql = {
__typename?: "ShotProjectionGQL";
events: Array<SimulationEventGql>;
finalState: Array<SimulationBallStateGql>;
pottedBallIds: Array<Scalars["Int"]["output"]>;
trajectories: Array<BallTrajectoryGql>;
};
export type ShotsOrderingComponent = export type ShotsOrderingComponent =
| { | {
difficulty: FloatOrdering; difficulty: FloatOrdering;
@@ -3393,6 +3441,42 @@ export type ShotsOrderingComponent =
videoId: IntOrdering; videoId: IntOrdering;
}; };
export type SimulateShotInputGql = {
b64Image?: InputMaybe<Scalars["String"]["input"]>;
balls?: InputMaybe<Array<SimulationBallStateInputGql>>;
cueBallId: Scalars["Int"]["input"];
strike: CueStrikeInputGql;
tableSize?: InputMaybe<Scalars["Float"]["input"]>;
useHomography?: InputMaybe<HomographyInputGql>;
};
export type SimulationBallStateGql = {
__typename?: "SimulationBallStateGQL";
ballId: Scalars["Int"]["output"];
position: Array<Scalars["Float"]["output"]>;
};
export type SimulationBallStateInputGql = {
ballId: Scalars["Int"]["input"];
position: Array<Scalars["Float"]["input"]>;
};
export type SimulationEventGql = {
__typename?: "SimulationEventGQL";
ballIds: Array<Scalars["Int"]["output"]>;
eventType: SimulationEventType;
position?: Maybe<Array<Scalars["Float"]["output"]>>;
time: Scalars["Float"]["output"];
};
export enum SimulationEventType {
BallBall = "BALL_BALL",
BallCushion = "BALL_CUSHION",
BallPocket = "BALL_POCKET",
BallStop = "BALL_STOP",
StickBall = "STICK_BALL",
}
export type SpinTypeBreakdownGql = { export type SpinTypeBreakdownGql = {
__typename?: "SpinTypeBreakdownGQL"; __typename?: "SpinTypeBreakdownGQL";
center: Scalars["Int"]["output"]; center: Scalars["Int"]["output"];
@@ -3415,6 +3499,15 @@ export enum SpinTypeEnum {
Unknown = "UNKNOWN", Unknown = "UNKNOWN",
} }
export type StorageLimitExceededErr = {
__typename?: "StorageLimitExceededErr";
reason: Scalars["String"]["output"];
remainingStorageBytes?: Maybe<Scalars["BigInt"]["output"]>;
retainedStorageLimitBytes?: Maybe<Scalars["BigInt"]["output"]>;
retainedStorageUsedBytes: Scalars["BigInt"]["output"];
tierName: Scalars["String"]["output"];
};
export type StorageStatusGql = { export type StorageStatusGql = {
__typename?: "StorageStatusGQL"; __typename?: "StorageStatusGQL";
isNearLimit: Scalars["Boolean"]["output"]; isNearLimit: Scalars["Boolean"]["output"];
@@ -3560,6 +3653,12 @@ export type TooManyProfileImageUploadsErr = {
linksRequested: Scalars["Int"]["output"]; linksRequested: Scalars["Int"]["output"];
}; };
export type TrajectoryPointGql = {
__typename?: "TrajectoryPointGQL";
position: Array<Scalars["Float"]["output"]>;
time: Scalars["Float"]["output"];
};
export type UpdateAnnotationInputGql = { export type UpdateAnnotationInputGql = {
name: Scalars["String"]["input"]; name: Scalars["String"]["input"];
notes?: InputMaybe<Scalars["String"]["input"]>; notes?: InputMaybe<Scalars["String"]["input"]>;
@@ -3689,6 +3788,8 @@ export type VideoExportJobGql = {
shotIds?: Maybe<Array<Scalars["Int"]["output"]>>; shotIds?: Maybe<Array<Scalars["Int"]["output"]>>;
status: VideoExportStatusEnum; status: VideoExportStatusEnum;
videoId: Scalars["Int"]["output"]; videoId: Scalars["Int"]["output"];
videoName?: Maybe<Scalars["String"]["output"]>;
videoThumbnailUri?: Maybe<Scalars["String"]["output"]>;
}; };
export enum VideoExportModeEnum { export enum VideoExportModeEnum {
@@ -5459,6 +5560,74 @@ export type FinalizePlayerAssignmentsMutation = {
}>; }>;
}; };
export type GetTableStateQueryVariables = Exact<{
b64Image: Scalars["String"]["input"];
tableSize?: InputMaybe<Scalars["Float"]["input"]>;
useHomography?: InputMaybe<HomographyInputGql>;
}>;
export type GetTableStateQuery = {
__typename?: "Query";
getTableState: {
__typename?: "TableStateGQL";
identifierToPosition: Array<Array<number>>;
};
};
export type SimulateShotQueryVariables = Exact<{
simulationInput: SimulateShotInputGql;
}>;
export type SimulateShotQuery = {
__typename?: "Query";
simulateShot: {
__typename?: "ShotProjectionGQL";
pottedBallIds: Array<number>;
trajectories: Array<{
__typename?: "BallTrajectoryGQL";
ballId: number;
points: Array<{
__typename?: "TrajectoryPointGQL";
time: number;
position: Array<number>;
}>;
}>;
events: Array<{
__typename?: "SimulationEventGQL";
eventType: SimulationEventType;
time: number;
ballIds: Array<number>;
position?: Array<number> | null;
}>;
finalState: Array<{
__typename?: "SimulationBallStateGQL";
ballId: number;
position: Array<number>;
}>;
};
};
export type ComputePotAimQueryVariables = Exact<{
simulationInput: SimulateShotInputGql;
targetBallId: Scalars["Int"]["input"];
pocket: PocketIdentifier;
}>;
export type ComputePotAimQuery = {
__typename?: "Query";
computePotAim: {
__typename?: "PotAimGQL";
phi: number;
geometricPhi: number;
cutAngle: number;
requiredPrecision: number;
feasible: boolean;
potted: boolean;
converged: boolean;
occludingBallIds: Array<number>;
};
};
export type GetSerializedShotPathsQueryVariables = Exact<{ export type GetSerializedShotPathsQueryVariables = Exact<{
filterInput: FilterInput; filterInput: FilterInput;
}>; }>;
@@ -7079,6 +7248,8 @@ export type VideoExportJobFieldsFragment = {
videoId: number; videoId: number;
mode: VideoExportModeEnum; mode: VideoExportModeEnum;
status: VideoExportStatusEnum; status: VideoExportStatusEnum;
videoName?: string | null;
videoThumbnailUri?: string | null;
shotIds?: Array<number> | null; shotIds?: Array<number> | null;
runId?: number | null; runId?: number | null;
downloadUrl?: string | null; downloadUrl?: string | null;
@@ -7099,6 +7270,8 @@ export type RequestVideoExportMutation = {
videoId: number; videoId: number;
mode: VideoExportModeEnum; mode: VideoExportModeEnum;
status: VideoExportStatusEnum; status: VideoExportStatusEnum;
videoName?: string | null;
videoThumbnailUri?: string | null;
shotIds?: Array<number> | null; shotIds?: Array<number> | null;
runId?: number | null; runId?: number | null;
downloadUrl?: string | null; downloadUrl?: string | null;
@@ -7129,6 +7302,8 @@ export type VideoExportJobQuery = {
videoId: number; videoId: number;
mode: VideoExportModeEnum; mode: VideoExportModeEnum;
status: VideoExportStatusEnum; status: VideoExportStatusEnum;
videoName?: string | null;
videoThumbnailUri?: string | null;
shotIds?: Array<number> | null; shotIds?: Array<number> | null;
runId?: number | null; runId?: number | null;
downloadUrl?: string | null; downloadUrl?: string | null;
@@ -7151,6 +7326,8 @@ export type MyVideoExportsQuery = {
videoId: number; videoId: number;
mode: VideoExportModeEnum; mode: VideoExportModeEnum;
status: VideoExportStatusEnum; status: VideoExportStatusEnum;
videoName?: string | null;
videoThumbnailUri?: string | null;
shotIds?: Array<number> | null; shotIds?: Array<number> | null;
runId?: number | null; runId?: number | null;
downloadUrl?: string | null; downloadUrl?: string | null;
@@ -7205,6 +7382,7 @@ export type GetUploadLinkMutation = {
}; };
} }
| { __typename?: "SegmentAlreadyUploadedErr"; segmentId: number } | { __typename?: "SegmentAlreadyUploadedErr"; segmentId: number }
| { __typename?: "StorageLimitExceededErr" }
| { __typename?: "TooManyInitUploadsErr" } | { __typename?: "TooManyInitUploadsErr" }
| { __typename?: "TooManyProfileImageUploadsErr" }; | { __typename?: "TooManyProfileImageUploadsErr" };
} }
@@ -7247,6 +7425,14 @@ export type GetHlsInitUploadLinkMutation = {
} }
| { __typename?: "ProcessingFailedErr" } | { __typename?: "ProcessingFailedErr" }
| { __typename?: "SegmentAlreadyUploadedErr" } | { __typename?: "SegmentAlreadyUploadedErr" }
| {
__typename?: "StorageLimitExceededErr";
reason: string;
tierName: string;
retainedStorageUsedBytes: any;
retainedStorageLimitBytes?: any | null;
remainingStorageBytes?: any | null;
}
| { __typename?: "TooManyInitUploadsErr"; linksRequested: number } | { __typename?: "TooManyInitUploadsErr"; linksRequested: number }
| { __typename?: "TooManyProfileImageUploadsErr" }; | { __typename?: "TooManyProfileImageUploadsErr" };
} }
@@ -7731,6 +7917,8 @@ export const VideoExportJobFieldsFragmentDoc = gql`
videoId videoId
mode mode
status status
videoName
videoThumbnailUri
shotIds shotIds
runId runId
downloadUrl downloadUrl
@@ -11699,6 +11887,269 @@ export type FinalizePlayerAssignmentsMutationOptions =
FinalizePlayerAssignmentsMutation, FinalizePlayerAssignmentsMutation,
FinalizePlayerAssignmentsMutationVariables FinalizePlayerAssignmentsMutationVariables
>; >;
export const GetTableStateDocument = gql`
query GetTableState(
$b64Image: String!
$tableSize: Float
$useHomography: HomographyInputGQL
) {
getTableState(
b64Image: $b64Image
tableSize: $tableSize
useHomography: $useHomography
) {
identifierToPosition
}
}
`;
/**
* __useGetTableStateQuery__
*
* To run a query within a React component, call `useGetTableStateQuery` and pass it any options that fit your needs.
* When your component renders, `useGetTableStateQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useGetTableStateQuery({
* variables: {
* b64Image: // value for 'b64Image'
* tableSize: // value for 'tableSize'
* useHomography: // value for 'useHomography'
* },
* });
*/
export function useGetTableStateQuery(
baseOptions: Apollo.QueryHookOptions<
GetTableStateQuery,
GetTableStateQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<GetTableStateQuery, GetTableStateQueryVariables>(
GetTableStateDocument,
options,
);
}
export function useGetTableStateLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetTableStateQuery,
GetTableStateQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<GetTableStateQuery, GetTableStateQueryVariables>(
GetTableStateDocument,
options,
);
}
export function useGetTableStateSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetTableStateQuery,
GetTableStateQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<
GetTableStateQuery,
GetTableStateQueryVariables
>(GetTableStateDocument, options);
}
export type GetTableStateQueryHookResult = ReturnType<
typeof useGetTableStateQuery
>;
export type GetTableStateLazyQueryHookResult = ReturnType<
typeof useGetTableStateLazyQuery
>;
export type GetTableStateSuspenseQueryHookResult = ReturnType<
typeof useGetTableStateSuspenseQuery
>;
export type GetTableStateQueryResult = Apollo.QueryResult<
GetTableStateQuery,
GetTableStateQueryVariables
>;
export const SimulateShotDocument = gql`
query SimulateShot($simulationInput: SimulateShotInputGQL!) {
simulateShot(simulationInput: $simulationInput) {
trajectories {
ballId
points {
time
position
}
}
events {
eventType
time
ballIds
position
}
finalState {
ballId
position
}
pottedBallIds
}
}
`;
/**
* __useSimulateShotQuery__
*
* To run a query within a React component, call `useSimulateShotQuery` and pass it any options that fit your needs.
* When your component renders, `useSimulateShotQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useSimulateShotQuery({
* variables: {
* simulationInput: // value for 'simulationInput'
* },
* });
*/
export function useSimulateShotQuery(
baseOptions: Apollo.QueryHookOptions<
SimulateShotQuery,
SimulateShotQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<SimulateShotQuery, SimulateShotQueryVariables>(
SimulateShotDocument,
options,
);
}
export function useSimulateShotLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
SimulateShotQuery,
SimulateShotQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<SimulateShotQuery, SimulateShotQueryVariables>(
SimulateShotDocument,
options,
);
}
export function useSimulateShotSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
SimulateShotQuery,
SimulateShotQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<SimulateShotQuery, SimulateShotQueryVariables>(
SimulateShotDocument,
options,
);
}
export type SimulateShotQueryHookResult = ReturnType<
typeof useSimulateShotQuery
>;
export type SimulateShotLazyQueryHookResult = ReturnType<
typeof useSimulateShotLazyQuery
>;
export type SimulateShotSuspenseQueryHookResult = ReturnType<
typeof useSimulateShotSuspenseQuery
>;
export type SimulateShotQueryResult = Apollo.QueryResult<
SimulateShotQuery,
SimulateShotQueryVariables
>;
export const ComputePotAimDocument = gql`
query ComputePotAim(
$simulationInput: SimulateShotInputGQL!
$targetBallId: Int!
$pocket: PocketIdentifier!
) {
computePotAim(
simulationInput: $simulationInput
targetBallId: $targetBallId
pocket: $pocket
) {
phi
geometricPhi
cutAngle
requiredPrecision
feasible
potted
converged
occludingBallIds
}
}
`;
/**
* __useComputePotAimQuery__
*
* To run a query within a React component, call `useComputePotAimQuery` and pass it any options that fit your needs.
* When your component renders, `useComputePotAimQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useComputePotAimQuery({
* variables: {
* simulationInput: // value for 'simulationInput'
* targetBallId: // value for 'targetBallId'
* pocket: // value for 'pocket'
* },
* });
*/
export function useComputePotAimQuery(
baseOptions: Apollo.QueryHookOptions<
ComputePotAimQuery,
ComputePotAimQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<ComputePotAimQuery, ComputePotAimQueryVariables>(
ComputePotAimDocument,
options,
);
}
export function useComputePotAimLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
ComputePotAimQuery,
ComputePotAimQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<ComputePotAimQuery, ComputePotAimQueryVariables>(
ComputePotAimDocument,
options,
);
}
export function useComputePotAimSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
ComputePotAimQuery,
ComputePotAimQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<
ComputePotAimQuery,
ComputePotAimQueryVariables
>(ComputePotAimDocument, options);
}
export type ComputePotAimQueryHookResult = ReturnType<
typeof useComputePotAimQuery
>;
export type ComputePotAimLazyQueryHookResult = ReturnType<
typeof useComputePotAimLazyQuery
>;
export type ComputePotAimSuspenseQueryHookResult = ReturnType<
typeof useComputePotAimSuspenseQuery
>;
export type ComputePotAimQueryResult = Apollo.QueryResult<
ComputePotAimQuery,
ComputePotAimQueryVariables
>;
export const GetSerializedShotPathsDocument = gql` export const GetSerializedShotPathsDocument = gql`
query GetSerializedShotPaths($filterInput: FilterInput!) { query GetSerializedShotPaths($filterInput: FilterInput!) {
getShots(filterInput: $filterInput) { getShots(filterInput: $filterInput) {
@@ -15558,6 +16009,13 @@ export const GetHlsInitUploadLinkDocument = gql`
... on TooManyInitUploadsErr { ... on TooManyInitUploadsErr {
linksRequested linksRequested
} }
... on StorageLimitExceededErr {
reason
tierName
retainedStorageUsedBytes
retainedStorageLimitBytes
remainingStorageBytes
}
} }
} }
} }

View 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
}
}

View File

@@ -3,6 +3,8 @@ fragment VideoExportJobFields on VideoExportJobGQL {
videoId videoId
mode mode
status status
videoName
videoThumbnailUri
shotIds shotIds
runId runId
downloadUrl downloadUrl

View File

@@ -67,6 +67,13 @@ mutation GetHlsInitUploadLink($videoId: Int!) {
... on TooManyInitUploadsErr { ... on TooManyInitUploadsErr {
linksRequested linksRequested
} }
... on StorageLimitExceededErr {
reason
tierName
retainedStorageUsedBytes
retainedStorageLimitBytes
remainingStorageBytes
}
} }
} }
} }

View File

@@ -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
@@ -714,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!
@@ -969,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
@@ -1172,6 +1249,8 @@ type VideoExportJobGQL {
videoId: Int! videoId: Int!
mode: VideoExportModeEnum! mode: VideoExportModeEnum!
status: VideoExportStatusEnum! status: VideoExportStatusEnum!
videoName: String
videoThumbnailUri: String
shotIds: [Int!] shotIds: [Int!]
runId: Int runId: Int
downloadUrl: String downloadUrl: String
@@ -1526,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
@@ -1537,6 +1616,7 @@ union MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoI
| TooManyProfileImageUploadsErr | TooManyProfileImageUploadsErr
| InitUploadAlreadyCompletedErr | InitUploadAlreadyCompletedErr
| TooManyInitUploadsErr | TooManyInitUploadsErr
| StorageLimitExceededErr
type MustHaveSetForUploadLinkErr { type MustHaveSetForUploadLinkErr {
resolution: Boolean resolution: Boolean
@@ -1562,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
}