Adds proper error return to stuff involving upload links #39

Merged
countablecloud merged 2 commits from mk/add-error-return-to-upload-links into master 2024-08-16 19:02:33 -06:00
4 changed files with 289 additions and 46 deletions

View File

@ -1102,11 +1102,15 @@ export type GetShotsPagination = {
startFrameAfter: Scalars["Int"]["input"];
};
export type GetUploadLinkErrors = {
__typename?: "GetUploadLinkErrors";
error: MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoInitForChunkedUploadErrTooManyProfileImageUploadsErr;
};
export type GetUploadLinkReturn = {
__typename?: "GetUploadLinkReturn";
headers: Array<Maybe<Header>>;
uploadCompletionCursor?: Maybe<Scalars["Int"]["output"]>;
uploadUrl: Scalars["String"]["output"];
stream?: Maybe<UploadStreamGql>;
value: UploadLinkGetUploadLinkErrors;
};
export type HlsPlaylistGql = {
@ -1149,6 +1153,20 @@ export type MakePercentageIntervalGql = {
makePercentage: Scalars["Float"]["output"];
};
export type MustHaveSetForUploadLinkErr = {
__typename?: "MustHaveSetForUploadLinkErr";
framesPerSecond?: Maybe<Scalars["Boolean"]["output"]>;
resolution?: Maybe<Scalars["Boolean"]["output"]>;
};
export type MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailedErrNoInitForChunkedUploadErrTooManyProfileImageUploadsErr =
| MustHaveSetForUploadLinkErr
| NoInitForChunkedUploadErr
| ProcessingFailedErr
| SegmentAlreadyUploadedErr
| TooManyProfileImageUploadsErr;
export type Mutation = {
__typename?: "Mutation";
addAnnotationToShot: Scalars["Boolean"]["output"];
@ -1214,6 +1232,11 @@ export type MutationSetSegmentDurationArgs = {
videoId: Scalars["Int"]["input"];
};
export type NoInitForChunkedUploadErr = {
__typename?: "NoInitForChunkedUploadErr";
segmentType: StreamSegmentTypeEnum;
};
export type PageInfoGql = {
__typename?: "PageInfoGQL";
endCursor?: Maybe<Scalars["String"]["output"]>;
@ -1243,6 +1266,11 @@ export type PocketingIntentionFeaturesGql = {
targetPocketDistance?: Maybe<Scalars["Float"]["output"]>;
};
export type ProcessingFailedErr = {
__typename?: "ProcessingFailedErr";
processing: VideoProcessingGql;
};
export enum ProcessingStatusEnum {
Created = "CREATED",
Failed = "FAILED",
@ -1335,6 +1363,11 @@ export type RangeFilter = {
lessThanInclusive?: Scalars["Boolean"]["input"];
};
export type SegmentAlreadyUploadedErr = {
__typename?: "SegmentAlreadyUploadedErr";
segmentId: Scalars["Int"]["output"];
};
export type SerializedShotPathsGql = {
__typename?: "SerializedShotPathsGQL";
b64EncodedBuffer?: Maybe<Scalars["String"]["output"]>;
@ -1408,6 +1441,19 @@ export type TargetMetricsGql = {
makePercentage?: Maybe<Scalars["Float"]["output"]>;
};
export type TooManyProfileImageUploadsErr = {
__typename?: "TooManyProfileImageUploadsErr";
linksRequested: Scalars["Int"]["output"];
};
export type UploadLink = {
__typename?: "UploadLink";
headers: Array<Maybe<Header>>;
uploadUrl: Scalars["String"]["output"];
};
export type UploadLinkGetUploadLinkErrors = GetUploadLinkErrors | UploadLink;
export type UploadSegmentGql = {
__typename?: "UploadSegmentGQL";
durationInSeconds?: Maybe<Scalars["Float"]["output"]>;
@ -1732,12 +1778,28 @@ export type GetProfileImageUploadLinkMutation = {
__typename?: "Mutation";
getProfileImageUploadLink: {
__typename?: "GetUploadLinkReturn";
uploadUrl: string;
headers: Array<{
__typename?: "Header";
key: string;
value: string;
} | null>;
value:
| {
__typename?: "GetUploadLinkErrors";
error:
| { __typename?: "MustHaveSetForUploadLinkErr" }
| { __typename?: "NoInitForChunkedUploadErr" }
| { __typename?: "ProcessingFailedErr" }
| { __typename?: "SegmentAlreadyUploadedErr" }
| {
__typename?: "TooManyProfileImageUploadsErr";
linksRequested: number;
};
}
| {
__typename?: "UploadLink";
uploadUrl: string;
headers: Array<{
__typename?: "Header";
key: string;
value: string;
} | null>;
};
};
};
@ -2096,12 +2158,43 @@ export type GetUploadLinkMutation = {
__typename?: "Mutation";
getUploadLink: {
__typename?: "GetUploadLinkReturn";
uploadUrl: string;
headers: Array<{
__typename?: "Header";
key: string;
value: string;
} | null>;
value:
| {
__typename?: "GetUploadLinkErrors";
error:
| {
__typename?: "MustHaveSetForUploadLinkErr";
resolution?: boolean | null;
framesPerSecond?: boolean | null;
}
| { __typename?: "NoInitForChunkedUploadErr" }
| {
__typename?: "ProcessingFailedErr";
processing: {
__typename?: "VideoProcessingGQL";
status: ProcessingStatusEnum;
errors: Array<{
__typename?: "VideoProcessingErrorGQL";
message: string;
}>;
};
}
| { __typename?: "SegmentAlreadyUploadedErr"; segmentId: number }
| { __typename?: "TooManyProfileImageUploadsErr" };
}
| {
__typename?: "UploadLink";
uploadUrl: string;
headers: Array<{
__typename?: "Header";
key: string;
value: string;
} | null>;
};
stream?: {
__typename?: "UploadStreamGQL";
uploadCompletionCursor: number;
} | null;
};
};
@ -2113,12 +2206,28 @@ export type GetHlsInitUploadLinkMutation = {
__typename?: "Mutation";
getHlsInitUploadLink: {
__typename?: "GetUploadLinkReturn";
uploadUrl: string;
headers: Array<{
__typename?: "Header";
key: string;
value: string;
} | null>;
value:
| {
__typename?: "GetUploadLinkErrors";
error:
| { __typename?: "MustHaveSetForUploadLinkErr" }
| {
__typename?: "NoInitForChunkedUploadErr";
segmentType: StreamSegmentTypeEnum;
}
| { __typename?: "ProcessingFailedErr" }
| { __typename?: "SegmentAlreadyUploadedErr" }
| { __typename?: "TooManyProfileImageUploadsErr" };
}
| {
__typename?: "UploadLink";
uploadUrl: string;
headers: Array<{
__typename?: "Header";
key: string;
value: string;
} | null>;
};
};
};
@ -2729,10 +2838,21 @@ export type GetShotAnnotationTypesQueryResult = Apollo.QueryResult<
export const GetProfileImageUploadLinkDocument = gql`
mutation getProfileImageUploadLink($fileExt: String = ".png") {
getProfileImageUploadLink(fileExt: $fileExt) {
uploadUrl
headers {
key
value
value {
... on UploadLink {
uploadUrl
headers {
key
value
}
}
... on GetUploadLinkErrors {
error {
... on TooManyProfileImageUploadsErr {
linksRequested
}
}
}
}
}
}
@ -3996,10 +4116,36 @@ export type CreateUploadStreamMutationOptions = Apollo.BaseMutationOptions<
export const GetUploadLinkDocument = gql`
mutation GetUploadLink($videoId: Int!, $segmentIndex: Int!) {
getUploadLink(videoId: $videoId, segmentIndex: $segmentIndex) {
uploadUrl
headers {
key
value
value {
... on UploadLink {
uploadUrl
headers {
key
value
}
}
... on GetUploadLinkErrors {
error {
... on MustHaveSetForUploadLinkErr {
resolution
framesPerSecond
}
... on SegmentAlreadyUploadedErr {
segmentId
}
... on ProcessingFailedErr {
processing {
status
errors {
message
}
}
}
}
}
}
stream {
uploadCompletionCursor
}
}
}
@ -4051,10 +4197,21 @@ export type GetUploadLinkMutationOptions = Apollo.BaseMutationOptions<
export const GetHlsInitUploadLinkDocument = gql`
mutation GetHlsInitUploadLink($videoId: Int!) {
getHlsInitUploadLink(videoId: $videoId) {
uploadUrl
headers {
key
value
value {
... on UploadLink {
uploadUrl
headers {
key
value
}
}
... on GetUploadLinkErrors {
error {
... on NoInitForChunkedUploadErr {
segmentType
}
}
}
}
}
}

View File

@ -1,9 +1,20 @@
mutation getProfileImageUploadLink($fileExt: String = ".png") {
getProfileImageUploadLink(fileExt: $fileExt) {
uploadUrl
headers {
key
value
value {
... on UploadLink {
uploadUrl
headers {
key
value
}
}
... on GetUploadLinkErrors {
error {
... on TooManyProfileImageUploadsErr {
linksRequested
}
}
}
}
}
}

View File

@ -6,20 +6,57 @@ mutation CreateUploadStream($videoMetadataInput: VideoMetadataInput!) {
mutation GetUploadLink($videoId: Int!, $segmentIndex: Int!) {
getUploadLink(videoId: $videoId, segmentIndex: $segmentIndex) {
uploadUrl
headers {
key
value
value {
... on UploadLink {
uploadUrl
headers {
key
value
}
}
... on GetUploadLinkErrors {
error {
... on MustHaveSetForUploadLinkErr {
resolution
framesPerSecond
}
... on SegmentAlreadyUploadedErr {
segmentId
}
... on ProcessingFailedErr {
processing {
status
errors {
message
}
}
}
}
}
}
stream {
uploadCompletionCursor
}
}
}
mutation GetHlsInitUploadLink($videoId: Int!) {
getHlsInitUploadLink(videoId: $videoId) {
uploadUrl
headers {
key
value
value {
... on UploadLink {
uploadUrl
headers {
key
value
}
}
... on GetUploadLinkErrors {
error {
... on NoInitForChunkedUploadErr {
segmentType
}
}
}
}
}
}

View File

@ -458,9 +458,15 @@ input CreateBucketSetInput {
}
type GetUploadLinkReturn {
value: UploadLinkGetUploadLinkErrors!
stream: UploadStreamGQL
}
union UploadLinkGetUploadLinkErrors = UploadLink | GetUploadLinkErrors
type UploadLink {
uploadUrl: String!
headers: [Header]!
uploadCompletionCursor: Int
}
type Header {
@ -468,6 +474,38 @@ 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 TooManyProfileImageUploadsErr {
linksRequested: Int!
}
type CreateUploadStreamReturn {
videoId: Int!
}