Compare commits

..

6 Commits

Author SHA1 Message Date
71116165bc Add getLiveTableState query and live-stream operations
- schema: getLiveTableState(videoId) returning LiveTableStateGQL
  (videoId, frameIndex, tableState)
- operations: GetLiveTableState in shot_simulation.gql, lightweight
  GetLiveStreams listing in live_streams.gql
- regenerated TS client outputs

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 00:54:37 -07:00
0b6ac787d8 Merge pull request 'Camera claim flow: lease end/extend, claim preferences, inUse' (#282) from dean/camera-claim-flow into master
Reviewed-on: #282
2026-07-05 18:55:01 +00:00
Dean Wenstrand
ac479dc7e4 Camera claim flow: lease end/extend, claim preferences, inUse
All checks were successful
Tests / Tests (pull_request) Successful in 25s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 18:44:01 -07:00
c6a754cc2d Merge pull request 'Add tableSize/pocketSize to pool hall camera schema' (#281) from dean/camera-table-dimensions into master
Reviewed-on: #281
2026-07-05 00:23:56 +00:00
Dean Wenstrand
2c047292f0 Add tableSize/pocketSize to pool hall camera schema
All checks were successful
Tests / Tests (pull_request) Successful in 11s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-04 17:13:23 -07:00
9267cd8180 Merge pull request 'dean/pool-hall-gql' (#280) from dean/pool-hall-gql into master
Reviewed-on: #280
2026-07-04 16:35:00 +00:00
5 changed files with 663 additions and 5 deletions

View File

@@ -285,9 +285,11 @@ export type CreateCustomerPortalSessionResultGql = {
export type CreatePoolHallCameraInput = { export type CreatePoolHallCameraInput = {
name: Scalars["String"]["input"]; name: Scalars["String"]["input"];
pocketSize?: InputMaybe<Scalars["Float"]["input"]>;
poolHallId: Scalars["ID"]["input"]; poolHallId: Scalars["ID"]["input"];
streamPath?: InputMaybe<Scalars["String"]["input"]>; streamPath?: InputMaybe<Scalars["String"]["input"]>;
tableLabel?: InputMaybe<Scalars["String"]["input"]>; tableLabel?: InputMaybe<Scalars["String"]["input"]>;
tableSize?: InputMaybe<Scalars["Float"]["input"]>;
}; };
export type CreatePoolHallInput = { export type CreatePoolHallInput = {
@@ -2424,6 +2426,13 @@ export type IntPoint2DInput = {
y: Scalars["Int"]["input"]; y: Scalars["Int"]["input"];
}; };
export type LiveTableStateGql = {
__typename?: "LiveTableStateGQL";
frameIndex: Scalars["Int"]["output"];
tableState: TableStateGql;
videoId: Scalars["Int"]["output"];
};
export type MakePercentageIntervalGql = { export type MakePercentageIntervalGql = {
__typename?: "MakePercentageIntervalGQL"; __typename?: "MakePercentageIntervalGQL";
elapsedTime: Scalars["Float"]["output"]; elapsedTime: Scalars["Float"]["output"];
@@ -2495,7 +2504,9 @@ export type Mutation = {
editShot: EditShotReturn; editShot: EditShotReturn;
editUploadStream: Scalars["Boolean"]["output"]; editUploadStream: Scalars["Boolean"]["output"];
editUser: UserGql; editUser: UserGql;
endCameraLease: CameraLease;
ensureStripeCustomerExists: UserGql; ensureStripeCustomerExists: UserGql;
extendCameraLease: CameraLease;
finalizePlayerAssignments: Array<PlayerClusterGql>; finalizePlayerAssignments: Array<PlayerClusterGql>;
findPrerecordTableLayout?: Maybe<HomographyInfoGql>; findPrerecordTableLayout?: Maybe<HomographyInfoGql>;
followUser: UserGql; followUser: UserGql;
@@ -2558,6 +2569,9 @@ export type MutationCreateBucketSetArgs = {
export type MutationCreateCameraClaimSessionArgs = { export type MutationCreateCameraClaimSessionArgs = {
cameraId: Scalars["ID"]["input"]; cameraId: Scalars["ID"]["input"];
durationMinutes?: InputMaybe<Scalars["Int"]["input"]>;
videoName?: InputMaybe<Scalars["String"]["input"]>;
videoPrivate?: InputMaybe<Scalars["Boolean"]["input"]>;
}; };
export type MutationCreateChallengeArgs = { export type MutationCreateChallengeArgs = {
@@ -2645,6 +2659,15 @@ export type MutationEditUserArgs = {
input: EditUserInputGql; input: EditUserInputGql;
}; };
export type MutationEndCameraLeaseArgs = {
leaseId: Scalars["ID"]["input"];
};
export type MutationExtendCameraLeaseArgs = {
additionalMinutes?: Scalars["Int"]["input"];
leaseId: Scalars["ID"]["input"];
};
export type MutationFinalizePlayerAssignmentsArgs = { export type MutationFinalizePlayerAssignmentsArgs = {
input: FinalizePlayerAssignmentsInput; input: FinalizePlayerAssignmentsInput;
}; };
@@ -2945,14 +2968,17 @@ export type PoolHallCamera = {
__typename?: "PoolHallCamera"; __typename?: "PoolHallCamera";
createdAt: Scalars["DateTime"]["output"]; createdAt: Scalars["DateTime"]["output"];
id: Scalars["ID"]["output"]; id: Scalars["ID"]["output"];
inUse: Scalars["Boolean"]["output"];
lastPublishedAt?: Maybe<Scalars["DateTime"]["output"]>; lastPublishedAt?: Maybe<Scalars["DateTime"]["output"]>;
lastUnpublishedAt?: Maybe<Scalars["DateTime"]["output"]>; lastUnpublishedAt?: Maybe<Scalars["DateTime"]["output"]>;
name: Scalars["String"]["output"]; name: Scalars["String"]["output"];
pocketSize?: Maybe<Scalars["Float"]["output"]>;
poolHall: PoolHall; poolHall: PoolHall;
poolHallId: Scalars["ID"]["output"]; poolHallId: Scalars["ID"]["output"];
status: Scalars["String"]["output"]; status: Scalars["String"]["output"];
streamPath: Scalars["String"]["output"]; streamPath: Scalars["String"]["output"];
tableLabel?: Maybe<Scalars["String"]["output"]>; tableLabel?: Maybe<Scalars["String"]["output"]>;
tableSize?: Maybe<Scalars["Float"]["output"]>;
updatedAt: Scalars["DateTime"]["output"]; updatedAt: Scalars["DateTime"]["output"];
}; };
@@ -3010,6 +3036,7 @@ export type Query = {
getDrillRunLeaderboard: DrillRunLeaderboardGql; getDrillRunLeaderboard: DrillRunLeaderboardGql;
getFeedVideos: VideoHistoryGql; getFeedVideos: VideoHistoryGql;
getGameTypeTagMetrics: Array<GameTypeTagMetric>; getGameTypeTagMetrics: Array<GameTypeTagMetric>;
getLiveTableState: LiveTableStateGql;
getLoggedInUser?: Maybe<UserGql>; getLoggedInUser?: Maybe<UserGql>;
getLongestRunsLeaderboard: RunLeaderboardGql; getLongestRunsLeaderboard: RunLeaderboardGql;
getMakesLeaderboard: CountLeaderboardGql; getMakesLeaderboard: CountLeaderboardGql;
@@ -3114,6 +3141,10 @@ export type QueryGetGameTypeTagMetricsArgs = {
input: GameTypeTagMetricsInput; input: GameTypeTagMetricsInput;
}; };
export type QueryGetLiveTableStateArgs = {
videoId: Scalars["Int"]["input"];
};
export type QueryGetLongestRunsLeaderboardArgs = { export type QueryGetLongestRunsLeaderboardArgs = {
interval?: InputMaybe<TimeInterval>; interval?: InputMaybe<TimeInterval>;
limit?: Scalars["Int"]["input"]; limit?: Scalars["Int"]["input"];
@@ -3804,8 +3835,10 @@ export type UpdateAnnotationInputGql = {
export type UpdatePoolHallCameraInput = { export type UpdatePoolHallCameraInput = {
id: Scalars["ID"]["input"]; id: Scalars["ID"]["input"];
name?: InputMaybe<Scalars["String"]["input"]>; name?: InputMaybe<Scalars["String"]["input"]>;
pocketSize?: InputMaybe<Scalars["Float"]["input"]>;
status?: InputMaybe<Scalars["String"]["input"]>; status?: InputMaybe<Scalars["String"]["input"]>;
tableLabel?: InputMaybe<Scalars["String"]["input"]>; tableLabel?: InputMaybe<Scalars["String"]["input"]>;
tableSize?: InputMaybe<Scalars["Float"]["input"]>;
}; };
export type UpdatePoolHallInput = { export type UpdatePoolHallInput = {
@@ -5080,6 +5113,43 @@ export type GetMyDrillRunsQuery = {
}>; }>;
}; };
export type GetLiveStreamsQueryVariables = Exact<{
limit?: Scalars["Int"]["input"];
}>;
export type GetLiveStreamsQuery = {
__typename?: "Query";
getFeedVideos: {
__typename?: "VideoHistoryGQL";
videos: Array<{
__typename?: "VideoGQL";
id: number;
name?: string | null;
startTime?: any | null;
createdAt?: any | null;
screenshotUri?: string | null;
elapsedTime?: number | null;
owner?: {
__typename?: "UserGQL";
id: number;
username: string;
profileImageUri?: string | null;
} | null;
stream?: {
__typename?: "UploadStreamGQL";
id: string;
isCompleted: boolean;
lastSegmentUploadedAt?: any | null;
} | null;
}>;
pageInfo: {
__typename?: "PageInfoGQL";
hasNextPage: boolean;
endCursor?: string | null;
};
};
};
export type GetVideoMakePercentageIntervalsQueryVariables = Exact<{ export type GetVideoMakePercentageIntervalsQueryVariables = Exact<{
videoId: Scalars["ID"]["input"]; videoId: Scalars["ID"]["input"];
intervalDuration: Scalars["Int"]["input"]; intervalDuration: Scalars["Int"]["input"];
@@ -5529,6 +5599,9 @@ export type PoolHallCameraFieldsFragment = {
tableLabel?: string | null; tableLabel?: string | null;
streamPath: string; streamPath: string;
status: string; status: string;
tableSize?: number | null;
pocketSize?: number | null;
inUse: boolean;
lastPublishedAt?: any | null; lastPublishedAt?: any | null;
lastUnpublishedAt?: any | null; lastUnpublishedAt?: any | null;
createdAt: any; createdAt: any;
@@ -5543,6 +5616,9 @@ export type PoolHallCameraWithHallFieldsFragment = {
tableLabel?: string | null; tableLabel?: string | null;
streamPath: string; streamPath: string;
status: string; status: string;
tableSize?: number | null;
pocketSize?: number | null;
inUse: boolean;
lastPublishedAt?: any | null; lastPublishedAt?: any | null;
lastUnpublishedAt?: any | null; lastUnpublishedAt?: any | null;
createdAt: any; createdAt: any;
@@ -5573,6 +5649,9 @@ export type PoolHallCameraStreamCredentialsFieldsFragment = {
tableLabel?: string | null; tableLabel?: string | null;
streamPath: string; streamPath: string;
status: string; status: string;
tableSize?: number | null;
pocketSize?: number | null;
inUse: boolean;
lastPublishedAt?: any | null; lastPublishedAt?: any | null;
lastUnpublishedAt?: any | null; lastUnpublishedAt?: any | null;
createdAt: any; createdAt: any;
@@ -5613,6 +5692,9 @@ export type CameraClaimSessionFieldsFragment = {
tableLabel?: string | null; tableLabel?: string | null;
streamPath: string; streamPath: string;
status: string; status: string;
tableSize?: number | null;
pocketSize?: number | null;
inUse: boolean;
lastPublishedAt?: any | null; lastPublishedAt?: any | null;
lastUnpublishedAt?: any | null; lastUnpublishedAt?: any | null;
createdAt: any; createdAt: any;
@@ -5654,6 +5736,9 @@ export type CameraLeaseFieldsFragment = {
tableLabel?: string | null; tableLabel?: string | null;
streamPath: string; streamPath: string;
status: string; status: string;
tableSize?: number | null;
pocketSize?: number | null;
inUse: boolean;
lastPublishedAt?: any | null; lastPublishedAt?: any | null;
lastUnpublishedAt?: any | null; lastUnpublishedAt?: any | null;
createdAt: any; createdAt: any;
@@ -5725,6 +5810,9 @@ export type GetPoolHallCamerasQuery = {
tableLabel?: string | null; tableLabel?: string | null;
streamPath: string; streamPath: string;
status: string; status: string;
tableSize?: number | null;
pocketSize?: number | null;
inUse: boolean;
lastPublishedAt?: any | null; lastPublishedAt?: any | null;
lastUnpublishedAt?: any | null; lastUnpublishedAt?: any | null;
createdAt: any; createdAt: any;
@@ -5758,6 +5846,9 @@ export type GetClaimableCamerasQuery = {
tableLabel?: string | null; tableLabel?: string | null;
streamPath: string; streamPath: string;
status: string; status: string;
tableSize?: number | null;
pocketSize?: number | null;
inUse: boolean;
lastPublishedAt?: any | null; lastPublishedAt?: any | null;
lastUnpublishedAt?: any | null; lastUnpublishedAt?: any | null;
createdAt: any; createdAt: any;
@@ -5804,6 +5895,9 @@ export type GetCameraClaimSessionQuery = {
tableLabel?: string | null; tableLabel?: string | null;
streamPath: string; streamPath: string;
status: string; status: string;
tableSize?: number | null;
pocketSize?: number | null;
inUse: boolean;
lastPublishedAt?: any | null; lastPublishedAt?: any | null;
lastUnpublishedAt?: any | null; lastUnpublishedAt?: any | null;
createdAt: any; createdAt: any;
@@ -5852,6 +5946,9 @@ export type GetActiveCameraLeaseQuery = {
tableLabel?: string | null; tableLabel?: string | null;
streamPath: string; streamPath: string;
status: string; status: string;
tableSize?: number | null;
pocketSize?: number | null;
inUse: boolean;
lastPublishedAt?: any | null; lastPublishedAt?: any | null;
lastUnpublishedAt?: any | null; lastUnpublishedAt?: any | null;
createdAt: any; createdAt: any;
@@ -5930,6 +6027,9 @@ export type CreatePoolHallCameraMutation = {
tableLabel?: string | null; tableLabel?: string | null;
streamPath: string; streamPath: string;
status: string; status: string;
tableSize?: number | null;
pocketSize?: number | null;
inUse: boolean;
lastPublishedAt?: any | null; lastPublishedAt?: any | null;
lastUnpublishedAt?: any | null; lastUnpublishedAt?: any | null;
createdAt: any; createdAt: any;
@@ -5964,6 +6064,9 @@ export type UpdatePoolHallCameraMutation = {
tableLabel?: string | null; tableLabel?: string | null;
streamPath: string; streamPath: string;
status: string; status: string;
tableSize?: number | null;
pocketSize?: number | null;
inUse: boolean;
lastPublishedAt?: any | null; lastPublishedAt?: any | null;
lastUnpublishedAt?: any | null; lastUnpublishedAt?: any | null;
createdAt: any; createdAt: any;
@@ -6001,6 +6104,9 @@ export type RotatePoolHallCameraStreamKeyMutation = {
tableLabel?: string | null; tableLabel?: string | null;
streamPath: string; streamPath: string;
status: string; status: string;
tableSize?: number | null;
pocketSize?: number | null;
inUse: boolean;
lastPublishedAt?: any | null; lastPublishedAt?: any | null;
lastUnpublishedAt?: any | null; lastUnpublishedAt?: any | null;
createdAt: any; createdAt: any;
@@ -6023,6 +6129,9 @@ export type RotatePoolHallCameraStreamKeyMutation = {
export type CreateCameraClaimSessionMutationVariables = Exact<{ export type CreateCameraClaimSessionMutationVariables = Exact<{
cameraId: Scalars["ID"]["input"]; cameraId: Scalars["ID"]["input"];
durationMinutes?: InputMaybe<Scalars["Int"]["input"]>;
videoName?: InputMaybe<Scalars["String"]["input"]>;
videoPrivate?: InputMaybe<Scalars["Boolean"]["input"]>;
}>; }>;
export type CreateCameraClaimSessionMutation = { export type CreateCameraClaimSessionMutation = {
@@ -6048,6 +6157,9 @@ export type CreateCameraClaimSessionMutation = {
tableLabel?: string | null; tableLabel?: string | null;
streamPath: string; streamPath: string;
status: string; status: string;
tableSize?: number | null;
pocketSize?: number | null;
inUse: boolean;
lastPublishedAt?: any | null; lastPublishedAt?: any | null;
lastUnpublishedAt?: any | null; lastUnpublishedAt?: any | null;
createdAt: any; createdAt: any;
@@ -6095,6 +6207,112 @@ export type CancelCameraClaimSessionMutation = {
tableLabel?: string | null; tableLabel?: string | null;
streamPath: string; streamPath: string;
status: string; status: string;
tableSize?: number | null;
pocketSize?: number | null;
inUse: boolean;
lastPublishedAt?: any | null;
lastUnpublishedAt?: any | null;
createdAt: any;
updatedAt: any;
poolHall: {
__typename?: "PoolHall";
id: string;
name: string;
address?: string | null;
latitude?: number | null;
longitude?: number | null;
timezone?: string | null;
status: string;
createdAt: any;
updatedAt: any;
};
};
};
};
export type EndCameraLeaseMutationVariables = Exact<{
leaseId: Scalars["ID"]["input"];
}>;
export type EndCameraLeaseMutation = {
__typename?: "Mutation";
endCameraLease: {
__typename?: "CameraLease";
id: string;
cameraId: string;
claimSessionId?: string | null;
userId: string;
videoId?: string | null;
status: string;
startedAt: any;
endedAt?: any | null;
expiresAt?: any | null;
endReason?: string | null;
createdAt: any;
updatedAt: any;
camera: {
__typename?: "PoolHallCamera";
id: string;
poolHallId: string;
name: string;
tableLabel?: string | null;
streamPath: string;
status: string;
tableSize?: number | null;
pocketSize?: number | null;
inUse: boolean;
lastPublishedAt?: any | null;
lastUnpublishedAt?: any | null;
createdAt: any;
updatedAt: any;
poolHall: {
__typename?: "PoolHall";
id: string;
name: string;
address?: string | null;
latitude?: number | null;
longitude?: number | null;
timezone?: string | null;
status: string;
createdAt: any;
updatedAt: any;
};
};
};
};
export type ExtendCameraLeaseMutationVariables = Exact<{
leaseId: Scalars["ID"]["input"];
additionalMinutes?: Scalars["Int"]["input"];
}>;
export type ExtendCameraLeaseMutation = {
__typename?: "Mutation";
extendCameraLease: {
__typename?: "CameraLease";
id: string;
cameraId: string;
claimSessionId?: string | null;
userId: string;
videoId?: string | null;
status: string;
startedAt: any;
endedAt?: any | null;
expiresAt?: any | null;
endReason?: string | null;
createdAt: any;
updatedAt: any;
camera: {
__typename?: "PoolHallCamera";
id: string;
poolHallId: string;
name: string;
tableLabel?: string | null;
streamPath: string;
status: string;
tableSize?: number | null;
pocketSize?: number | null;
inUse: boolean;
lastPublishedAt?: any | null; lastPublishedAt?: any | null;
lastUnpublishedAt?: any | null; lastUnpublishedAt?: any | null;
createdAt: any; createdAt: any;
@@ -6335,6 +6553,51 @@ export type GetTableStateQuery = {
}; };
}; };
export type GetLiveTableStateQueryVariables = Exact<{
videoId: Scalars["Int"]["input"];
}>;
export type GetLiveTableStateQuery = {
__typename?: "Query";
getLiveTableState: {
__typename?: "LiveTableStateGQL";
videoId: number;
frameIndex: number;
tableState: {
__typename?: "TableStateGQL";
identifierToPosition: Array<Array<number>>;
homography?: {
__typename?: "HomographyInfoGQL";
id: number;
frameIndex: number;
crop: {
__typename?: "BoundingBoxGQL";
left: number;
top: number;
width: number;
height: number;
};
pockets: Array<{
__typename?: "BoundingBoxGQL";
left: number;
top: number;
width: number;
height: number;
}>;
sourcePoints: {
__typename?: "PocketPointsGQL";
topLeft: { __typename?: "IntPoint2D"; x: number; y: number };
topSide: { __typename?: "IntPoint2D"; x: number; y: number };
topRight: { __typename?: "IntPoint2D"; x: number; y: number };
bottomLeft: { __typename?: "IntPoint2D"; x: number; y: number };
bottomSide: { __typename?: "IntPoint2D"; x: number; y: number };
bottomRight: { __typename?: "IntPoint2D"; x: number; y: number };
};
} | null;
};
};
};
export type SimulateShotQueryVariables = Exact<{ export type SimulateShotQueryVariables = Exact<{
simulationInput: SimulateShotInputGql; simulationInput: SimulateShotInputGql;
}>; }>;
@@ -8432,6 +8695,9 @@ export const PoolHallCameraFieldsFragmentDoc = gql`
tableLabel tableLabel
streamPath streamPath
status status
tableSize
pocketSize
inUse
lastPublishedAt lastPublishedAt
lastUnpublishedAt lastUnpublishedAt
createdAt createdAt
@@ -11214,6 +11480,105 @@ export type GetMyDrillRunsQueryResult = Apollo.QueryResult<
GetMyDrillRunsQuery, GetMyDrillRunsQuery,
GetMyDrillRunsQueryVariables GetMyDrillRunsQueryVariables
>; >;
export const GetLiveStreamsDocument = gql`
query GetLiveStreams($limit: Int! = 25) {
getFeedVideos(
limit: $limit
filters: { isStreamCompleted: false, requireCursorCompletion: false }
includePrivate: MINE
feedInput: { allUsers: true }
) {
videos {
id
name
startTime
createdAt
screenshotUri
elapsedTime
owner {
id
username
profileImageUri
}
stream {
id
isCompleted
lastSegmentUploadedAt
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
`;
/**
* __useGetLiveStreamsQuery__
*
* To run a query within a React component, call `useGetLiveStreamsQuery` and pass it any options that fit your needs.
* When your component renders, `useGetLiveStreamsQuery` 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 } = useGetLiveStreamsQuery({
* variables: {
* limit: // value for 'limit'
* },
* });
*/
export function useGetLiveStreamsQuery(
baseOptions?: Apollo.QueryHookOptions<
GetLiveStreamsQuery,
GetLiveStreamsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<GetLiveStreamsQuery, GetLiveStreamsQueryVariables>(
GetLiveStreamsDocument,
options,
);
}
export function useGetLiveStreamsLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetLiveStreamsQuery,
GetLiveStreamsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<GetLiveStreamsQuery, GetLiveStreamsQueryVariables>(
GetLiveStreamsDocument,
options,
);
}
export function useGetLiveStreamsSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetLiveStreamsQuery,
GetLiveStreamsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<
GetLiveStreamsQuery,
GetLiveStreamsQueryVariables
>(GetLiveStreamsDocument, options);
}
export type GetLiveStreamsQueryHookResult = ReturnType<
typeof useGetLiveStreamsQuery
>;
export type GetLiveStreamsLazyQueryHookResult = ReturnType<
typeof useGetLiveStreamsLazyQuery
>;
export type GetLiveStreamsSuspenseQueryHookResult = ReturnType<
typeof useGetLiveStreamsSuspenseQuery
>;
export type GetLiveStreamsQueryResult = Apollo.QueryResult<
GetLiveStreamsQuery,
GetLiveStreamsQueryVariables
>;
export const GetVideoMakePercentageIntervalsDocument = gql` export const GetVideoMakePercentageIntervalsDocument = gql`
query GetVideoMakePercentageIntervals( query GetVideoMakePercentageIntervals(
$videoId: ID! $videoId: ID!
@@ -13058,8 +13423,18 @@ export type RotatePoolHallCameraStreamKeyMutationOptions =
RotatePoolHallCameraStreamKeyMutationVariables RotatePoolHallCameraStreamKeyMutationVariables
>; >;
export const CreateCameraClaimSessionDocument = gql` export const CreateCameraClaimSessionDocument = gql`
mutation CreateCameraClaimSession($cameraId: ID!) { mutation CreateCameraClaimSession(
createCameraClaimSession(cameraId: $cameraId) { $cameraId: ID!
$durationMinutes: Int
$videoName: String
$videoPrivate: Boolean
) {
createCameraClaimSession(
cameraId: $cameraId
durationMinutes: $durationMinutes
videoName: $videoName
videoPrivate: $videoPrivate
) {
...CameraClaimSessionFields ...CameraClaimSessionFields
} }
} }
@@ -13084,6 +13459,9 @@ export type CreateCameraClaimSessionMutationFn = Apollo.MutationFunction<
* const [createCameraClaimSessionMutation, { data, loading, error }] = useCreateCameraClaimSessionMutation({ * const [createCameraClaimSessionMutation, { data, loading, error }] = useCreateCameraClaimSessionMutation({
* variables: { * variables: {
* cameraId: // value for 'cameraId' * cameraId: // value for 'cameraId'
* durationMinutes: // value for 'durationMinutes'
* videoName: // value for 'videoName'
* videoPrivate: // value for 'videoPrivate'
* }, * },
* }); * });
*/ */
@@ -13161,6 +13539,112 @@ export type CancelCameraClaimSessionMutationOptions =
CancelCameraClaimSessionMutation, CancelCameraClaimSessionMutation,
CancelCameraClaimSessionMutationVariables CancelCameraClaimSessionMutationVariables
>; >;
export const EndCameraLeaseDocument = gql`
mutation EndCameraLease($leaseId: ID!) {
endCameraLease(leaseId: $leaseId) {
...CameraLeaseFields
}
}
${CameraLeaseFieldsFragmentDoc}
`;
export type EndCameraLeaseMutationFn = Apollo.MutationFunction<
EndCameraLeaseMutation,
EndCameraLeaseMutationVariables
>;
/**
* __useEndCameraLeaseMutation__
*
* To run a mutation, you first call `useEndCameraLeaseMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useEndCameraLeaseMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation
* - An object with fields that represent the current status of the mutation's execution
*
* @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
*
* @example
* const [endCameraLeaseMutation, { data, loading, error }] = useEndCameraLeaseMutation({
* variables: {
* leaseId: // value for 'leaseId'
* },
* });
*/
export function useEndCameraLeaseMutation(
baseOptions?: Apollo.MutationHookOptions<
EndCameraLeaseMutation,
EndCameraLeaseMutationVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<
EndCameraLeaseMutation,
EndCameraLeaseMutationVariables
>(EndCameraLeaseDocument, options);
}
export type EndCameraLeaseMutationHookResult = ReturnType<
typeof useEndCameraLeaseMutation
>;
export type EndCameraLeaseMutationResult =
Apollo.MutationResult<EndCameraLeaseMutation>;
export type EndCameraLeaseMutationOptions = Apollo.BaseMutationOptions<
EndCameraLeaseMutation,
EndCameraLeaseMutationVariables
>;
export const ExtendCameraLeaseDocument = gql`
mutation ExtendCameraLease($leaseId: ID!, $additionalMinutes: Int! = 60) {
extendCameraLease(
leaseId: $leaseId
additionalMinutes: $additionalMinutes
) {
...CameraLeaseFields
}
}
${CameraLeaseFieldsFragmentDoc}
`;
export type ExtendCameraLeaseMutationFn = Apollo.MutationFunction<
ExtendCameraLeaseMutation,
ExtendCameraLeaseMutationVariables
>;
/**
* __useExtendCameraLeaseMutation__
*
* To run a mutation, you first call `useExtendCameraLeaseMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useExtendCameraLeaseMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation
* - An object with fields that represent the current status of the mutation's execution
*
* @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
*
* @example
* const [extendCameraLeaseMutation, { data, loading, error }] = useExtendCameraLeaseMutation({
* variables: {
* leaseId: // value for 'leaseId'
* additionalMinutes: // value for 'additionalMinutes'
* },
* });
*/
export function useExtendCameraLeaseMutation(
baseOptions?: Apollo.MutationHookOptions<
ExtendCameraLeaseMutation,
ExtendCameraLeaseMutationVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<
ExtendCameraLeaseMutation,
ExtendCameraLeaseMutationVariables
>(ExtendCameraLeaseDocument, options);
}
export type ExtendCameraLeaseMutationHookResult = ReturnType<
typeof useExtendCameraLeaseMutation
>;
export type ExtendCameraLeaseMutationResult =
Apollo.MutationResult<ExtendCameraLeaseMutation>;
export type ExtendCameraLeaseMutationOptions = Apollo.BaseMutationOptions<
ExtendCameraLeaseMutation,
ExtendCameraLeaseMutationVariables
>;
export const ReactToVideoDocument = gql` export const ReactToVideoDocument = gql`
mutation ReactToVideo($videoId: Int!, $reaction: ReactionEnum) { mutation ReactToVideo($videoId: Int!, $reaction: ReactionEnum) {
reactToVideo(videoId: $videoId, reaction: $reaction) reactToVideo(videoId: $videoId, reaction: $reaction)
@@ -13618,6 +14102,87 @@ export type GetTableStateQueryResult = Apollo.QueryResult<
GetTableStateQuery, GetTableStateQuery,
GetTableStateQueryVariables GetTableStateQueryVariables
>; >;
export const GetLiveTableStateDocument = gql`
query GetLiveTableState($videoId: Int!) {
getLiveTableState(videoId: $videoId) {
videoId
frameIndex
tableState {
identifierToPosition
homography {
...HomographyInfo
}
}
}
}
${HomographyInfoFragmentDoc}
`;
/**
* __useGetLiveTableStateQuery__
*
* To run a query within a React component, call `useGetLiveTableStateQuery` and pass it any options that fit your needs.
* When your component renders, `useGetLiveTableStateQuery` 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 } = useGetLiveTableStateQuery({
* variables: {
* videoId: // value for 'videoId'
* },
* });
*/
export function useGetLiveTableStateQuery(
baseOptions: Apollo.QueryHookOptions<
GetLiveTableStateQuery,
GetLiveTableStateQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<
GetLiveTableStateQuery,
GetLiveTableStateQueryVariables
>(GetLiveTableStateDocument, options);
}
export function useGetLiveTableStateLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetLiveTableStateQuery,
GetLiveTableStateQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<
GetLiveTableStateQuery,
GetLiveTableStateQueryVariables
>(GetLiveTableStateDocument, options);
}
export function useGetLiveTableStateSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetLiveTableStateQuery,
GetLiveTableStateQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<
GetLiveTableStateQuery,
GetLiveTableStateQueryVariables
>(GetLiveTableStateDocument, options);
}
export type GetLiveTableStateQueryHookResult = ReturnType<
typeof useGetLiveTableStateQuery
>;
export type GetLiveTableStateLazyQueryHookResult = ReturnType<
typeof useGetLiveTableStateLazyQuery
>;
export type GetLiveTableStateSuspenseQueryHookResult = ReturnType<
typeof useGetLiveTableStateSuspenseQuery
>;
export type GetLiveTableStateQueryResult = Apollo.QueryResult<
GetLiveTableStateQuery,
GetLiveTableStateQueryVariables
>;
export const SimulateShotDocument = gql` export const SimulateShotDocument = gql`
query SimulateShot($simulationInput: SimulateShotInputGQL!) { query SimulateShot($simulationInput: SimulateShotInputGQL!) {
simulateShot(simulationInput: $simulationInput) { simulateShot(simulationInput: $simulationInput) {

View File

@@ -0,0 +1,34 @@
# Lightweight listing of live (in-progress) streams for pickers like the
# Shot Lab "follow a live stream" flow. Selects only what a picker card
# needs; intentionally avoids the heavy VideoCardFields fragment.
query GetLiveStreams($limit: Int! = 25) {
getFeedVideos(
limit: $limit
filters: { isStreamCompleted: false, requireCursorCompletion: false }
includePrivate: MINE
feedInput: { allUsers: true }
) {
videos {
id
name
startTime
createdAt
screenshotUri
elapsedTime
owner {
id
username
profileImageUri
}
stream {
id
isCompleted
lastSegmentUploadedAt
}
}
pageInfo {
hasNextPage
endCursor
}
}
}

View File

@@ -17,6 +17,9 @@ fragment PoolHallCameraFields on PoolHallCamera {
tableLabel tableLabel
streamPath streamPath
status status
tableSize
pocketSize
inUse
lastPublishedAt lastPublishedAt
lastUnpublishedAt lastUnpublishedAt
createdAt createdAt
@@ -139,8 +142,18 @@ mutation RotatePoolHallCameraStreamKey($cameraId: ID!) {
} }
} }
mutation CreateCameraClaimSession($cameraId: ID!) { mutation CreateCameraClaimSession(
createCameraClaimSession(cameraId: $cameraId) { $cameraId: ID!
$durationMinutes: Int
$videoName: String
$videoPrivate: Boolean
) {
createCameraClaimSession(
cameraId: $cameraId
durationMinutes: $durationMinutes
videoName: $videoName
videoPrivate: $videoPrivate
) {
...CameraClaimSessionFields ...CameraClaimSessionFields
} }
} }
@@ -150,3 +163,15 @@ mutation CancelCameraClaimSession($claimSessionId: ID!) {
...CameraClaimSessionFields ...CameraClaimSessionFields
} }
} }
mutation EndCameraLease($leaseId: ID!) {
endCameraLease(leaseId: $leaseId) {
...CameraLeaseFields
}
}
mutation ExtendCameraLease($leaseId: ID!, $additionalMinutes: Int! = 60) {
extendCameraLease(leaseId: $leaseId, additionalMinutes: $additionalMinutes) {
...CameraLeaseFields
}
}

View File

@@ -12,6 +12,19 @@ query GetTableState(
} }
} }
query GetLiveTableState($videoId: Int!) {
getLiveTableState(videoId: $videoId) {
videoId
frameIndex
tableState {
identifierToPosition
homography {
...HomographyInfo
}
}
}
}
query SimulateShot($simulationInput: SimulateShotInputGQL!) { query SimulateShot($simulationInput: SimulateShotInputGQL!) {
simulateShot(simulationInput: $simulationInput) { simulateShot(simulationInput: $simulationInput) {
trajectories { trajectories {

View File

@@ -72,6 +72,7 @@ type Query {
tableSize: Float = 100 tableSize: Float = 100
useHomography: HomographyInputGQL = null useHomography: HomographyInputGQL = null
): TableStateGQL! ): TableStateGQL!
getLiveTableState(videoId: Int!): LiveTableStateGQL!
simulateShot(simulationInput: SimulateShotInputGQL!): ShotProjectionGQL! simulateShot(simulationInput: SimulateShotInputGQL!): ShotProjectionGQL!
computePotAim( computePotAim(
simulationInput: SimulateShotInputGQL! simulationInput: SimulateShotInputGQL!
@@ -907,10 +908,13 @@ type PoolHallCamera {
tableLabel: String tableLabel: String
streamPath: String! streamPath: String!
status: String! status: String!
tableSize: Float
pocketSize: Float
lastPublishedAt: DateTime lastPublishedAt: DateTime
lastUnpublishedAt: DateTime lastUnpublishedAt: DateTime
createdAt: DateTime! createdAt: DateTime!
updatedAt: DateTime! updatedAt: DateTime!
inUse: Boolean!
poolHall: PoolHall! poolHall: PoolHall!
} }
@@ -1040,6 +1044,12 @@ input IntPoint2DInput {
y: Int! y: Int!
} }
type LiveTableStateGQL {
videoId: Int!
frameIndex: Int!
tableState: TableStateGQL!
}
type ShotProjectionGQL { type ShotProjectionGQL {
trajectories: [BallTrajectoryGQL!]! trajectories: [BallTrajectoryGQL!]!
events: [SimulationEventGQL!]! events: [SimulationEventGQL!]!
@@ -1401,8 +1411,15 @@ type Mutation {
): PoolHallCameraStreamCredentials! ): PoolHallCameraStreamCredentials!
updatePoolHallCamera(input: UpdatePoolHallCameraInput!): PoolHallCamera! updatePoolHallCamera(input: UpdatePoolHallCameraInput!): PoolHallCamera!
rotatePoolHallCameraStreamKey(cameraId: ID!): PoolHallCameraStreamCredentials! rotatePoolHallCameraStreamKey(cameraId: ID!): PoolHallCameraStreamCredentials!
createCameraClaimSession(cameraId: ID!): CameraClaimSession! createCameraClaimSession(
cameraId: ID!
durationMinutes: Int = null
videoName: String = null
videoPrivate: Boolean = null
): CameraClaimSession!
cancelCameraClaimSession(claimSessionId: ID!): CameraClaimSession! cancelCameraClaimSession(claimSessionId: ID!): CameraClaimSession!
endCameraLease(leaseId: ID!): CameraLease!
extendCameraLease(leaseId: ID!, additionalMinutes: Int! = 60): CameraLease!
finalizePlayerAssignments( finalizePlayerAssignments(
input: FinalizePlayerAssignmentsInput! input: FinalizePlayerAssignmentsInput!
): [PlayerClusterGQL!]! ): [PlayerClusterGQL!]!
@@ -1511,6 +1528,8 @@ input CreatePoolHallCameraInput {
name: String! name: String!
tableLabel: String = null tableLabel: String = null
streamPath: String = null streamPath: String = null
tableSize: Float = null
pocketSize: Float = null
} }
input UpdatePoolHallCameraInput { input UpdatePoolHallCameraInput {
@@ -1518,6 +1537,8 @@ input UpdatePoolHallCameraInput {
name: String = null name: String = null
tableLabel: String = null tableLabel: String = null
status: String = null status: String = null
tableSize: Float = null
pocketSize: Float = null
} }
input FinalizePlayerAssignmentsInput { input FinalizePlayerAssignmentsInput {