From f401e1879b4a7b2a808c7114ef6c4bd4aa33e392 Mon Sep 17 00:00:00 2001 From: Mike Kalange Date: Mon, 19 Aug 2024 14:44:43 -0700 Subject: [PATCH] Add separate return to profile image --- src/index.tsx | 35 ++++++++++++------- src/operations/user.gql | 2 +- src/schema.gql | 76 ++++++++++++++++++++++++----------------- 3 files changed, 68 insertions(+), 45 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index cd67860..0b8241c 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1097,6 +1097,16 @@ export type FilterInput = videoId: Array; }; +export type GetProfileUploadLinkErrors = { + __typename?: "GetProfileUploadLinkErrors"; + error: TooManyProfileImageUploadsErr; +}; + +export type GetProfileUploadLinkReturn = { + __typename?: "GetProfileUploadLinkReturn"; + value: UploadLinkGetProfileUploadLinkErrors; +}; + export type GetShotsPagination = { createdAfter: CreatedAfter; startFrameAfter: Scalars["Int"]["input"]; @@ -1176,7 +1186,7 @@ export type Mutation = { editProfileImageUri: UserGql; editUploadStream: Scalars["Boolean"]["output"]; getHlsInitUploadLink: GetUploadLinkReturn; - getProfileImageUploadLink: GetUploadLinkReturn; + getProfileImageUploadLink: GetProfileUploadLinkReturn; getUploadLink: GetUploadLinkReturn; setLoggerLevel: Scalars["Boolean"]["output"]; setSegmentDuration: Scalars["Boolean"]["output"]; @@ -1452,6 +1462,10 @@ export type UploadLink = { uploadUrl: Scalars["String"]["output"]; }; +export type UploadLinkGetProfileUploadLinkErrors = + | GetProfileUploadLinkErrors + | UploadLink; + export type UploadLinkGetUploadLinkErrors = GetUploadLinkErrors | UploadLink; export type UploadSegmentGql = { @@ -1777,19 +1791,14 @@ export type GetProfileImageUploadLinkMutationVariables = Exact<{ export type GetProfileImageUploadLinkMutation = { __typename?: "Mutation"; getProfileImageUploadLink: { - __typename?: "GetUploadLinkReturn"; + __typename?: "GetProfileUploadLinkReturn"; value: | { - __typename?: "GetUploadLinkErrors"; - error: - | { __typename?: "MustHaveSetForUploadLinkErr" } - | { __typename?: "NoInitForChunkedUploadErr" } - | { __typename?: "ProcessingFailedErr" } - | { __typename?: "SegmentAlreadyUploadedErr" } - | { - __typename?: "TooManyProfileImageUploadsErr"; - linksRequested: number; - }; + __typename?: "GetProfileUploadLinkErrors"; + error: { + __typename?: "TooManyProfileImageUploadsErr"; + linksRequested: number; + }; } | { __typename?: "UploadLink"; @@ -2842,7 +2851,7 @@ export const GetProfileImageUploadLinkDocument = gql` value } } - ... on GetUploadLinkErrors { + ... on GetProfileUploadLinkErrors { error { ... on TooManyProfileImageUploadsErr { linksRequested diff --git a/src/operations/user.gql b/src/operations/user.gql index 2d0bca7..3f5088a 100644 --- a/src/operations/user.gql +++ b/src/operations/user.gql @@ -8,7 +8,7 @@ mutation getProfileImageUploadLink($fileExt: String = ".png") { value } } - ... on GetUploadLinkErrors { + ... on GetProfileUploadLinkErrors { error { ... on TooManyProfileImageUploadsErr { linksRequested diff --git a/src/schema.gql b/src/schema.gql index 1630d77..60ee6df 100644 --- a/src/schema.gql +++ b/src/schema.gql @@ -435,7 +435,9 @@ type Mutation { createBucketSet(params: CreateBucketSetInput!): BucketSetGQL! setLoggerLevel(path: String!, level: String!): Boolean! addAnnotationToShot(shotId: Int!, annotationName: String!): Boolean! - getProfileImageUploadLink(fileExt: String = ".png"): GetUploadLinkReturn! + getProfileImageUploadLink( + fileExt: String = ".png" + ): GetProfileUploadLinkReturn! editProfileImageUri(profileImageUri: String!): UserGQL! createUploadStream( videoMetadata: VideoMetadataInput! @@ -457,12 +459,13 @@ input CreateBucketSetInput { buckets: [BucketInputGQL!]! } -type GetUploadLinkReturn { - value: UploadLinkGetUploadLinkErrors! - stream: UploadStreamGQL +type GetProfileUploadLinkReturn { + value: UploadLinkGetProfileUploadLinkErrors! } -union UploadLinkGetUploadLinkErrors = UploadLink | GetUploadLinkErrors +union UploadLinkGetProfileUploadLinkErrors = + UploadLink + | GetProfileUploadLinkErrors type UploadLink { uploadUrl: String! @@ -474,32 +477,8 @@ type Header { value: String! } -type GetUploadLinkErrors { - error: MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoInitForChunkedUploadErrTooManyProfileImageUploadsErr! -} - -union MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoInitForChunkedUploadErrTooManyProfileImageUploadsErr = - MustHaveSetForUploadLinkErr - | SegmentAlreadyUploadedErr - | ProcessingFailedErr - | NoInitForChunkedUploadErr - | TooManyProfileImageUploadsErr - -type MustHaveSetForUploadLinkErr { - resolution: Boolean - framesPerSecond: Boolean -} - -type SegmentAlreadyUploadedErr { - segmentId: Int! -} - -type ProcessingFailedErr { - processing: VideoProcessingGQL! -} - -type NoInitForChunkedUploadErr { - segmentType: StreamSegmentTypeEnum! +type GetProfileUploadLinkErrors { + error: TooManyProfileImageUploadsErr! } type TooManyProfileImageUploadsErr { @@ -546,3 +525,38 @@ input VideoResolution { width: Int! height: Int! } + +type GetUploadLinkReturn { + value: UploadLinkGetUploadLinkErrors! + stream: UploadStreamGQL +} + +union UploadLinkGetUploadLinkErrors = UploadLink | GetUploadLinkErrors + +type GetUploadLinkErrors { + error: MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoInitForChunkedUploadErrTooManyProfileImageUploadsErr! +} + +union MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoInitForChunkedUploadErrTooManyProfileImageUploadsErr = + MustHaveSetForUploadLinkErr + | SegmentAlreadyUploadedErr + | ProcessingFailedErr + | NoInitForChunkedUploadErr + | TooManyProfileImageUploadsErr + +type MustHaveSetForUploadLinkErr { + resolution: Boolean + framesPerSecond: Boolean +} + +type SegmentAlreadyUploadedErr { + segmentId: Int! +} + +type ProcessingFailedErr { + processing: VideoProcessingGQL! +} + +type NoInitForChunkedUploadErr { + segmentType: StreamSegmentTypeEnum! +}