From babb111fa687ebfdf195070a6a2a02f7ad795c3d Mon Sep 17 00:00:00 2001 From: Kat Huang Date: Mon, 4 Mar 2024 20:10:49 -0700 Subject: [PATCH] Update upload_stream and terminate_stream gql --- src/index.tsx | 121 ++++++++------------------------ src/operations/video_upload.gql | 39 ++-------- src/schema.gql | 43 +++++------- 3 files changed, 52 insertions(+), 151 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index dd7f108..c08e149 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -155,8 +155,7 @@ export type MutationCreateBucketSetArgs = { }; export type MutationCreateUploadStreamArgs = { - uploadMetadata?: InputMaybe; - videoName?: InputMaybe; + videoMetadata?: InputMaybe; }; export type MutationGetUploadLinkArgs = { @@ -165,10 +164,8 @@ export type MutationGetUploadLinkArgs = { }; export type MutationTerminateUploadStreamArgs = { - gameType?: InputMaybe; - tableSize?: InputMaybe; videoId: Scalars["Int"]["input"]; - videoName?: InputMaybe; + videoMetadata?: InputMaybe; }; export type OrFilter = { @@ -286,7 +283,17 @@ export type TargetPocketDistanceInput = { value: RangeFilter; }; -export type UploadMetadataInput = { +export type UploadStreamGql = { + __typename?: "UploadStreamGQL"; + createdAt: Scalars["DateTime"]["output"]; + id: Scalars["ID"]["output"]; + isCompleted: Scalars["Boolean"]["output"]; + linksRequested: Scalars["Int"]["output"]; + updatedAt: Scalars["DateTime"]["output"]; + uploadsCompleted: Scalars["Int"]["output"]; +}; + +export type UploadStreamMetadataInput = { appVersion?: InputMaybe; browserName?: InputMaybe; browserVersion?: InputMaybe; @@ -298,30 +305,6 @@ export type UploadMetadataInput = { timezone?: InputMaybe; }; -export type UploadStreamGql = { - __typename?: "UploadStreamGQL"; - createdAt: Scalars["DateTime"]["output"]; - id: Scalars["ID"]["output"]; - isCompleted: Scalars["Boolean"]["output"]; - linksRequested: Scalars["Int"]["output"]; - updatedAt: Scalars["DateTime"]["output"]; - uploadMetadata: UploadStreamMetadata; - uploadsCompleted: Scalars["Int"]["output"]; -}; - -export type UploadStreamMetadata = { - __typename?: "UploadStreamMetadata"; - appVersion?: Maybe; - browserName?: Maybe; - browserVersion?: Maybe; - deviceType?: Maybe; - ipAddress?: Maybe; - locale?: Maybe; - networkType?: Maybe; - osVersion?: Maybe; - timezone?: Maybe; -}; - export type UserGql = { __typename?: "UserGQL"; createdAt?: Maybe; @@ -368,6 +351,15 @@ export type VideoGql = { updatedAt?: Maybe; }; +export type VideoMetadataInput = { + endTime?: InputMaybe; + gameType?: InputMaybe; + startTime?: InputMaybe; + tableSize?: InputMaybe; + uploadStreamMetadataInput?: InputMaybe; + videoName?: InputMaybe; +}; + export enum WallTypeEnum { Long = "LONG", Short = "SHORT", @@ -489,16 +481,7 @@ export type GetShotsQuery = { }; export type CreateUploadStreamMutationVariables = Exact<{ - videoName: Scalars["String"]["input"]; - deviceType?: InputMaybe; - osVersion?: InputMaybe; - appVersion?: InputMaybe; - browserName?: InputMaybe; - browserVersion?: InputMaybe; - locale?: InputMaybe; - timezone?: InputMaybe; - networkType?: InputMaybe; - ipAddress?: InputMaybe; + videoMetadataInput: VideoMetadataInput; }>; export type CreateUploadStreamMutation = { @@ -529,9 +512,7 @@ export type GetUploadLinkMutation = { export type TerminateUploadStreamMutationVariables = Exact<{ videoId: Scalars["Int"]["input"]; - videoName?: InputMaybe; - gameType?: InputMaybe; - tableSize?: InputMaybe; + videoMetadataInput: VideoMetadataInput; }>; export type TerminateUploadStreamMutation = { @@ -828,32 +809,8 @@ export type GetShotsQueryResult = Apollo.QueryResult< GetShotsQueryVariables >; export const CreateUploadStreamDocument = gql` - mutation CreateUploadStream( - $videoName: String! - $deviceType: DeviceTypeEnum - $osVersion: String - $appVersion: String - $browserName: String - $browserVersion: String - $locale: String - $timezone: String - $networkType: String - $ipAddress: String - ) { - createUploadStream( - videoName: $videoName - uploadMetadata: { - deviceType: $deviceType - osVersion: $osVersion - appVersion: $appVersion - browserName: $browserName - browserVersion: $browserVersion - locale: $locale - timezone: $timezone - networkType: $networkType - ipAddress: $ipAddress - } - ) { + mutation CreateUploadStream($videoMetadataInput: VideoMetadataInput!) { + createUploadStream(videoMetadata: $videoMetadataInput) { videoId } } @@ -876,16 +833,7 @@ export type CreateUploadStreamMutationFn = Apollo.MutationFunction< * @example * const [createUploadStreamMutation, { data, loading, error }] = useCreateUploadStreamMutation({ * variables: { - * videoName: // value for 'videoName' - * deviceType: // value for 'deviceType' - * osVersion: // value for 'osVersion' - * appVersion: // value for 'appVersion' - * browserName: // value for 'browserName' - * browserVersion: // value for 'browserVersion' - * locale: // value for 'locale' - * timezone: // value for 'timezone' - * networkType: // value for 'networkType' - * ipAddress: // value for 'ipAddress' + * videoMetadataInput: // value for 'videoMetadataInput' * }, * }); */ @@ -968,16 +916,9 @@ export type GetUploadLinkMutationOptions = Apollo.BaseMutationOptions< export const TerminateUploadStreamDocument = gql` mutation TerminateUploadStream( $videoId: Int! - $videoName: String - $gameType: String - $tableSize: String + $videoMetadataInput: VideoMetadataInput! ) { - terminateUploadStream( - videoId: $videoId - videoName: $videoName - gameType: $gameType - tableSize: $tableSize - ) + terminateUploadStream(videoId: $videoId, videoMetadata: $videoMetadataInput) } `; export type TerminateUploadStreamMutationFn = Apollo.MutationFunction< @@ -999,9 +940,7 @@ export type TerminateUploadStreamMutationFn = Apollo.MutationFunction< * const [terminateUploadStreamMutation, { data, loading, error }] = useTerminateUploadStreamMutation({ * variables: { * videoId: // value for 'videoId' - * videoName: // value for 'videoName' - * gameType: // value for 'gameType' - * tableSize: // value for 'tableSize' + * videoMetadataInput: // value for 'videoMetadataInput' * }, * }); */ diff --git a/src/operations/video_upload.gql b/src/operations/video_upload.gql index ab27fd3..72daa5c 100644 --- a/src/operations/video_upload.gql +++ b/src/operations/video_upload.gql @@ -1,29 +1,5 @@ -mutation CreateUploadStream( - $videoName: String! - $deviceType: DeviceTypeEnum - $osVersion: String - $appVersion: String - $browserName: String - $browserVersion: String - $locale: String - $timezone: String - $networkType: String - $ipAddress: String -) { - createUploadStream( - videoName: $videoName - uploadMetadata: { - deviceType: $deviceType - osVersion: $osVersion - appVersion: $appVersion - browserName: $browserName - browserVersion: $browserVersion - locale: $locale - timezone: $timezone - networkType: $networkType - ipAddress: $ipAddress - } - ) { +mutation CreateUploadStream($videoMetadataInput: VideoMetadataInput!) { + createUploadStream(videoMetadata: $videoMetadataInput) { videoId } } @@ -40,14 +16,7 @@ mutation GetUploadLink($videoId: Int!, $segmentIndex: Int!) { mutation TerminateUploadStream( $videoId: Int! - $videoName: String - $gameType: String - $tableSize: String + $videoMetadataInput: VideoMetadataInput! ) { - terminateUploadStream( - videoId: $videoId - videoName: $videoName - gameType: $gameType - tableSize: $tableSize - ) + terminateUploadStream(videoId: $videoId, videoMetadata: $videoMetadataInput) } diff --git a/src/schema.gql b/src/schema.gql index 5299b68..35c06dc 100644 --- a/src/schema.gql +++ b/src/schema.gql @@ -149,29 +149,10 @@ type UploadStreamGQL { linksRequested: Int! uploadsCompleted: Int! isCompleted: Boolean! - uploadMetadata: UploadStreamMetadata! createdAt: DateTime! updatedAt: DateTime! } -type UploadStreamMetadata { - deviceType: DeviceTypeEnum - osVersion: String - appVersion: String - browserName: String - browserVersion: String - locale: String - timezone: String - networkType: String - ipAddress: String -} - -enum DeviceTypeEnum { - IOS - ANDROID - BROWSER -} - input FilterInput { andFilters: AndFilter = null orFilters: OrFilter = null @@ -243,15 +224,12 @@ type PageInfoGQL { type Mutation { createBucketSet(params: CreateBucketSetInput!): BucketSetGQL! createUploadStream( - uploadMetadata: UploadMetadataInput - videoName: String = null + videoMetadata: VideoMetadataInput ): CreateUploadStreamReturn! getUploadLink(videoId: Int!, segmentIndex: Int!): GetUploadLinkReturn! terminateUploadStream( videoId: Int! - videoName: String = null - gameType: String = null - tableSize: String = null + videoMetadata: VideoMetadataInput = null ): Boolean! } @@ -265,7 +243,16 @@ type CreateUploadStreamReturn { videoId: Int! } -input UploadMetadataInput { +input VideoMetadataInput { + videoName: String = null + startTime: DateTime = null + endTime: DateTime = null + gameType: String = null + tableSize: String = null + uploadStreamMetadataInput: UploadStreamMetadataInput = null +} + +input UploadStreamMetadataInput { deviceType: DeviceTypeEnum = null osVersion: String = null appVersion: String = null @@ -277,6 +264,12 @@ input UploadMetadataInput { ipAddress: String = null } +enum DeviceTypeEnum { + IOS + ANDROID + BROWSER +} + type GetUploadLinkReturn { uploadUrl: String! headers: [Header]!