Compare commits
3 Commits
70015a942c
...
ivan/add-c
| Author | SHA1 | Date | |
|---|---|---|---|
| d619751144 | |||
| e431a1751f | |||
| 209f0aa019 |
@@ -1,5 +1,7 @@
|
|||||||
overwrite: true
|
overwrite: true
|
||||||
schema: "src/schema.gql"
|
schema:
|
||||||
|
- "src/schema.gql"
|
||||||
|
- "src/client-schema.gql"
|
||||||
documents: "src/**/*.gql"
|
documents: "src/**/*.gql"
|
||||||
generates:
|
generates:
|
||||||
src/index.tsx:
|
src/index.tsx:
|
||||||
|
|||||||
7
src/client-schema.gql
Normal file
7
src/client-schema.gql
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# see: https://www.apollographql.com/docs/react/local-state/managing-state-with-field-policies/
|
||||||
|
directive @client on FIELD
|
||||||
|
|
||||||
|
extend type ShotGQL {
|
||||||
|
startTime: Float!
|
||||||
|
endTime: Float!
|
||||||
|
}
|
||||||
177
src/index.tsx
177
src/index.tsx
@@ -2021,12 +2021,14 @@ export type ShotGql = {
|
|||||||
createdAt?: Maybe<Scalars["DateTime"]["output"]>;
|
createdAt?: Maybe<Scalars["DateTime"]["output"]>;
|
||||||
cueObjectFeatures?: Maybe<CueObjectFeaturesGql>;
|
cueObjectFeatures?: Maybe<CueObjectFeaturesGql>;
|
||||||
endFrame: Scalars["Int"]["output"];
|
endFrame: Scalars["Int"]["output"];
|
||||||
|
endTime: Scalars["Float"]["output"];
|
||||||
falsePositiveScore?: Maybe<Scalars["Float"]["output"]>;
|
falsePositiveScore?: Maybe<Scalars["Float"]["output"]>;
|
||||||
id: Scalars["Int"]["output"];
|
id: Scalars["Int"]["output"];
|
||||||
pocketingIntentionFeatures?: Maybe<PocketingIntentionFeaturesGql>;
|
pocketingIntentionFeatures?: Maybe<PocketingIntentionFeaturesGql>;
|
||||||
pocketingIntentionInfo?: Maybe<PocketingIntentionInfoGql>;
|
pocketingIntentionInfo?: Maybe<PocketingIntentionInfoGql>;
|
||||||
serializedShotPaths?: Maybe<SerializedShotPathsGql>;
|
serializedShotPaths?: Maybe<SerializedShotPathsGql>;
|
||||||
startFrame: Scalars["Int"]["output"];
|
startFrame: Scalars["Int"]["output"];
|
||||||
|
startTime: Scalars["Float"]["output"];
|
||||||
updatedAt?: Maybe<Scalars["DateTime"]["output"]>;
|
updatedAt?: Maybe<Scalars["DateTime"]["output"]>;
|
||||||
user?: Maybe<UserGql>;
|
user?: Maybe<UserGql>;
|
||||||
video?: Maybe<VideoGql>;
|
video?: Maybe<VideoGql>;
|
||||||
@@ -2473,6 +2475,8 @@ export type GetShotsWithMetadataFilterResultQuery = {
|
|||||||
videoId: number;
|
videoId: number;
|
||||||
startFrame: number;
|
startFrame: number;
|
||||||
endFrame: number;
|
endFrame: number;
|
||||||
|
startTime: number;
|
||||||
|
endTime: number;
|
||||||
falsePositiveScore?: number | null;
|
falsePositiveScore?: number | null;
|
||||||
createdAt?: any | null;
|
createdAt?: any | null;
|
||||||
updatedAt?: any | null;
|
updatedAt?: any | null;
|
||||||
@@ -2539,6 +2543,8 @@ export type GetShotsWithMetadataQuery = {
|
|||||||
videoId: number;
|
videoId: number;
|
||||||
startFrame: number;
|
startFrame: number;
|
||||||
endFrame: number;
|
endFrame: number;
|
||||||
|
startTime: number;
|
||||||
|
endTime: number;
|
||||||
falsePositiveScore?: number | null;
|
falsePositiveScore?: number | null;
|
||||||
createdAt?: any | null;
|
createdAt?: any | null;
|
||||||
updatedAt?: any | null;
|
updatedAt?: any | null;
|
||||||
@@ -2598,6 +2604,8 @@ export type GetShotsByIdsQuery = {
|
|||||||
videoId: number;
|
videoId: number;
|
||||||
startFrame: number;
|
startFrame: number;
|
||||||
endFrame: number;
|
endFrame: number;
|
||||||
|
startTime: number;
|
||||||
|
endTime: number;
|
||||||
falsePositiveScore?: number | null;
|
falsePositiveScore?: number | null;
|
||||||
createdAt?: any | null;
|
createdAt?: any | null;
|
||||||
updatedAt?: any | null;
|
updatedAt?: any | null;
|
||||||
@@ -2650,6 +2658,8 @@ export type ShotWithAllFeaturesFragment = {
|
|||||||
videoId: number;
|
videoId: number;
|
||||||
startFrame: number;
|
startFrame: number;
|
||||||
endFrame: number;
|
endFrame: number;
|
||||||
|
startTime: number;
|
||||||
|
endTime: number;
|
||||||
falsePositiveScore?: number | null;
|
falsePositiveScore?: number | null;
|
||||||
createdAt?: any | null;
|
createdAt?: any | null;
|
||||||
updatedAt?: any | null;
|
updatedAt?: any | null;
|
||||||
@@ -2943,6 +2953,59 @@ export type GetVideosQuery = {
|
|||||||
}>;
|
}>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type VideoStreamMetadataFragment = {
|
||||||
|
__typename?: "VideoGQL";
|
||||||
|
id: number;
|
||||||
|
framesPerSecond: number;
|
||||||
|
stream?: {
|
||||||
|
__typename?: "UploadStreamGQL";
|
||||||
|
id: string;
|
||||||
|
streamSegmentType: StreamSegmentTypeEnum;
|
||||||
|
segments: Array<{
|
||||||
|
__typename?: "UploadSegmentGQL";
|
||||||
|
uploaded: boolean;
|
||||||
|
valid: boolean;
|
||||||
|
segmentIndex: number;
|
||||||
|
endFrameIndex?: number | null;
|
||||||
|
framesPerSecond?: number | null;
|
||||||
|
}>;
|
||||||
|
} | null;
|
||||||
|
playlist?: {
|
||||||
|
__typename?: "HLSPlaylistGQL";
|
||||||
|
segmentDurations: Array<number>;
|
||||||
|
} | null;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type GetVideoForShotTimeQueryVariables = Exact<{
|
||||||
|
videoId: Scalars["Int"]["input"];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
export type GetVideoForShotTimeQuery = {
|
||||||
|
__typename?: "Query";
|
||||||
|
getVideo: {
|
||||||
|
__typename?: "VideoGQL";
|
||||||
|
id: number;
|
||||||
|
framesPerSecond: number;
|
||||||
|
stream?: {
|
||||||
|
__typename?: "UploadStreamGQL";
|
||||||
|
id: string;
|
||||||
|
streamSegmentType: StreamSegmentTypeEnum;
|
||||||
|
segments: Array<{
|
||||||
|
__typename?: "UploadSegmentGQL";
|
||||||
|
uploaded: boolean;
|
||||||
|
valid: boolean;
|
||||||
|
segmentIndex: number;
|
||||||
|
endFrameIndex?: number | null;
|
||||||
|
framesPerSecond?: number | null;
|
||||||
|
}>;
|
||||||
|
} | null;
|
||||||
|
playlist?: {
|
||||||
|
__typename?: "HLSPlaylistGQL";
|
||||||
|
segmentDurations: Array<number>;
|
||||||
|
} | null;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
export type GetVideoQueryVariables = Exact<{
|
export type GetVideoQueryVariables = Exact<{
|
||||||
videoId: Scalars["Int"]["input"];
|
videoId: Scalars["Int"]["input"];
|
||||||
}>;
|
}>;
|
||||||
@@ -3258,6 +3321,8 @@ export const ShotWithAllFeaturesFragmentDoc = gql`
|
|||||||
videoId
|
videoId
|
||||||
startFrame
|
startFrame
|
||||||
endFrame
|
endFrame
|
||||||
|
startTime @client
|
||||||
|
endTime @client
|
||||||
user {
|
user {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
@@ -3298,6 +3363,26 @@ export const ShotWithAllFeaturesFragmentDoc = gql`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
export const VideoStreamMetadataFragmentDoc = gql`
|
||||||
|
fragment VideoStreamMetadata on VideoGQL {
|
||||||
|
id
|
||||||
|
framesPerSecond
|
||||||
|
stream {
|
||||||
|
id
|
||||||
|
streamSegmentType
|
||||||
|
segments {
|
||||||
|
uploaded
|
||||||
|
valid
|
||||||
|
segmentIndex
|
||||||
|
endFrameIndex
|
||||||
|
framesPerSecond
|
||||||
|
}
|
||||||
|
}
|
||||||
|
playlist {
|
||||||
|
segmentDurations
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
export const GetAggregatedShotMetricsDocument = gql`
|
export const GetAggregatedShotMetricsDocument = gql`
|
||||||
query GetAggregatedShotMetrics($aggregateInput: AggregateInputGQL!) {
|
query GetAggregatedShotMetrics($aggregateInput: AggregateInputGQL!) {
|
||||||
getAggregatedShotMetrics(aggregateInput: $aggregateInput) {
|
getAggregatedShotMetrics(aggregateInput: $aggregateInput) {
|
||||||
@@ -4913,24 +4998,10 @@ export type GetVideoDetailsQueryResult = Apollo.QueryResult<
|
|||||||
export const GetVideosDocument = gql`
|
export const GetVideosDocument = gql`
|
||||||
query GetVideos($videoIds: [Int!]!) {
|
query GetVideos($videoIds: [Int!]!) {
|
||||||
getVideos(videoIds: $videoIds) {
|
getVideos(videoIds: $videoIds) {
|
||||||
id
|
...VideoStreamMetadata
|
||||||
framesPerSecond
|
|
||||||
stream {
|
|
||||||
id
|
|
||||||
streamSegmentType
|
|
||||||
segments {
|
|
||||||
uploaded
|
|
||||||
valid
|
|
||||||
segmentIndex
|
|
||||||
endFrameIndex
|
|
||||||
framesPerSecond
|
|
||||||
}
|
|
||||||
}
|
|
||||||
playlist {
|
|
||||||
segmentDurations
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
${VideoStreamMetadataFragmentDoc}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -4993,6 +5064,80 @@ export type GetVideosQueryResult = Apollo.QueryResult<
|
|||||||
GetVideosQuery,
|
GetVideosQuery,
|
||||||
GetVideosQueryVariables
|
GetVideosQueryVariables
|
||||||
>;
|
>;
|
||||||
|
export const GetVideoForShotTimeDocument = gql`
|
||||||
|
query GetVideoForShotTime($videoId: Int!) {
|
||||||
|
getVideo(videoId: $videoId) {
|
||||||
|
...VideoStreamMetadata
|
||||||
|
}
|
||||||
|
}
|
||||||
|
${VideoStreamMetadataFragmentDoc}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useGetVideoForShotTimeQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useGetVideoForShotTimeQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useGetVideoForShotTimeQuery` 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 } = useGetVideoForShotTimeQuery({
|
||||||
|
* variables: {
|
||||||
|
* videoId: // value for 'videoId'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useGetVideoForShotTimeQuery(
|
||||||
|
baseOptions: Apollo.QueryHookOptions<
|
||||||
|
GetVideoForShotTimeQuery,
|
||||||
|
GetVideoForShotTimeQueryVariables
|
||||||
|
>,
|
||||||
|
) {
|
||||||
|
const options = { ...defaultOptions, ...baseOptions };
|
||||||
|
return Apollo.useQuery<
|
||||||
|
GetVideoForShotTimeQuery,
|
||||||
|
GetVideoForShotTimeQueryVariables
|
||||||
|
>(GetVideoForShotTimeDocument, options);
|
||||||
|
}
|
||||||
|
export function useGetVideoForShotTimeLazyQuery(
|
||||||
|
baseOptions?: Apollo.LazyQueryHookOptions<
|
||||||
|
GetVideoForShotTimeQuery,
|
||||||
|
GetVideoForShotTimeQueryVariables
|
||||||
|
>,
|
||||||
|
) {
|
||||||
|
const options = { ...defaultOptions, ...baseOptions };
|
||||||
|
return Apollo.useLazyQuery<
|
||||||
|
GetVideoForShotTimeQuery,
|
||||||
|
GetVideoForShotTimeQueryVariables
|
||||||
|
>(GetVideoForShotTimeDocument, options);
|
||||||
|
}
|
||||||
|
export function useGetVideoForShotTimeSuspenseQuery(
|
||||||
|
baseOptions?: Apollo.SuspenseQueryHookOptions<
|
||||||
|
GetVideoForShotTimeQuery,
|
||||||
|
GetVideoForShotTimeQueryVariables
|
||||||
|
>,
|
||||||
|
) {
|
||||||
|
const options = { ...defaultOptions, ...baseOptions };
|
||||||
|
return Apollo.useSuspenseQuery<
|
||||||
|
GetVideoForShotTimeQuery,
|
||||||
|
GetVideoForShotTimeQueryVariables
|
||||||
|
>(GetVideoForShotTimeDocument, options);
|
||||||
|
}
|
||||||
|
export type GetVideoForShotTimeQueryHookResult = ReturnType<
|
||||||
|
typeof useGetVideoForShotTimeQuery
|
||||||
|
>;
|
||||||
|
export type GetVideoForShotTimeLazyQueryHookResult = ReturnType<
|
||||||
|
typeof useGetVideoForShotTimeLazyQuery
|
||||||
|
>;
|
||||||
|
export type GetVideoForShotTimeSuspenseQueryHookResult = ReturnType<
|
||||||
|
typeof useGetVideoForShotTimeSuspenseQuery
|
||||||
|
>;
|
||||||
|
export type GetVideoForShotTimeQueryResult = Apollo.QueryResult<
|
||||||
|
GetVideoForShotTimeQuery,
|
||||||
|
GetVideoForShotTimeQueryVariables
|
||||||
|
>;
|
||||||
export const GetVideoDocument = gql`
|
export const GetVideoDocument = gql`
|
||||||
query GetVideo($videoId: Int!) {
|
query GetVideo($videoId: Int!) {
|
||||||
getVideo(videoId: $videoId) {
|
getVideo(videoId: $videoId) {
|
||||||
|
|||||||
@@ -84,6 +84,8 @@ fragment ShotWithAllFeatures on ShotGQL {
|
|||||||
videoId
|
videoId
|
||||||
startFrame
|
startFrame
|
||||||
endFrame
|
endFrame
|
||||||
|
startTime @client
|
||||||
|
endTime @client
|
||||||
user {
|
user {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,25 +117,34 @@ query GetVideoDetails($videoId: Int!) {
|
|||||||
|
|
||||||
query GetVideos($videoIds: [Int!]!) {
|
query GetVideos($videoIds: [Int!]!) {
|
||||||
getVideos(videoIds: $videoIds) {
|
getVideos(videoIds: $videoIds) {
|
||||||
id
|
...VideoStreamMetadata
|
||||||
framesPerSecond
|
|
||||||
stream {
|
|
||||||
id
|
|
||||||
streamSegmentType
|
|
||||||
segments {
|
|
||||||
uploaded
|
|
||||||
valid
|
|
||||||
segmentIndex
|
|
||||||
endFrameIndex
|
|
||||||
framesPerSecond
|
|
||||||
}
|
|
||||||
}
|
|
||||||
playlist {
|
|
||||||
segmentDurations
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fragment VideoStreamMetadata on VideoGQL {
|
||||||
|
id
|
||||||
|
framesPerSecond
|
||||||
|
stream {
|
||||||
|
id
|
||||||
|
streamSegmentType
|
||||||
|
segments {
|
||||||
|
uploaded
|
||||||
|
valid
|
||||||
|
segmentIndex
|
||||||
|
endFrameIndex
|
||||||
|
framesPerSecond
|
||||||
|
}
|
||||||
|
}
|
||||||
|
playlist {
|
||||||
|
segmentDurations
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetVideoForShotTime($videoId: Int!) {
|
||||||
|
getVideo(videoId: $videoId) {
|
||||||
|
...VideoStreamMetadata
|
||||||
|
}
|
||||||
|
}
|
||||||
query GetVideo($videoId: Int!) {
|
query GetVideo($videoId: Int!) {
|
||||||
getVideo(videoId: $videoId) {
|
getVideo(videoId: $videoId) {
|
||||||
id
|
id
|
||||||
|
|||||||
Reference in New Issue
Block a user