From 567cbc549cbb1961476b8dfc4d52275cd592caed Mon Sep 17 00:00:00 2001 From: Loewy Date: Tue, 8 Jul 2025 16:20:14 -0700 Subject: [PATCH 1/2] add createSubscription --- src/index.tsx | 11 +++++++++++ src/schema.gql | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index b6e53cb..750efc9 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -164,6 +164,12 @@ export type CreateBucketSetInput = { keyName: Scalars["String"]["input"]; }; +export type CreateSubscriptionResultGql = { + __typename?: "CreateSubscriptionResultGQL"; + checkoutUrl: Scalars["String"]["output"]; + sessionId: Scalars["String"]["output"]; +}; + export type CreateUploadStreamReturn = { __typename?: "CreateUploadStreamReturn"; videoId: Scalars["Int"]["output"]; @@ -2272,6 +2278,7 @@ export type Mutation = { addAnnotationToShot: AddShotAnnotationReturn; commentOnVideo: Scalars["Boolean"]["output"]; createBucketSet: BucketSetGql; + createSubscription: CreateSubscriptionResultGql; createUploadStream: CreateUploadStreamReturn; deleteComment: Scalars["Boolean"]["output"]; deleteTags: Scalars["Boolean"]["output"]; @@ -2311,6 +2318,10 @@ export type MutationCreateBucketSetArgs = { params: CreateBucketSetInput; }; +export type MutationCreateSubscriptionArgs = { + priceId: Scalars["String"]["input"]; +}; + export type MutationCreateUploadStreamArgs = { videoMetadata: VideoMetadataInput; }; diff --git a/src/schema.gql b/src/schema.gql index 278bafb..988ff54 100644 --- a/src/schema.gql +++ b/src/schema.gql @@ -883,6 +883,7 @@ type Mutation { unfollowUser(followedUserId: Int!): UserGQL! retireTags(tagIds: [Int!]!): Boolean! ensureStripeCustomerExists: UserGQL! + createSubscription(priceId: String!): CreateSubscriptionResultGQL! findPrerecordTableLayout(b64Image: String!, videoId: Int!): HomographyInfoGQL createUploadStream( videoMetadata: VideoMetadataInput! @@ -992,6 +993,11 @@ input EditUserInputGQL { videosPrivateByDefault: Boolean = null } +type CreateSubscriptionResultGQL { + checkoutUrl: String! + sessionId: String! +} + type CreateUploadStreamReturn { videoId: Int! } From 6685849cc2c46d3f13d0edf9e18078f2a85c2a47 Mon Sep 17 00:00:00 2001 From: Loewy Date: Tue, 8 Jul 2025 16:40:12 -0700 Subject: [PATCH 2/2] add available subscription --- src/index.tsx | 29 ++++++++++++++++++++++++++--- src/schema.gql | 26 +++++++++++++++++++++++--- 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 750efc9..f75c7a6 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2503,6 +2503,7 @@ export type Query = { __typename?: "Query"; doesUsernameExist: Scalars["Boolean"]["output"]; getAggregatedShotMetrics: Array; + getAvailableSubscriptionOptions: StripeSubscriptionOptionsGql; getBucketSet?: Maybe; getDeployedConfig: DeployedConfigGql; getFeedVideos: VideoHistoryGql; @@ -2928,6 +2929,31 @@ export enum StreamSegmentTypeEnum { RbChunkedMp4 = "RB_CHUNKED_MP4", } +export type StripePriceGql = { + __typename?: "StripePriceGQL"; + active: Scalars["Boolean"]["output"]; + currency: Scalars["String"]["output"]; + id: Scalars["String"]["output"]; + recurringInterval?: Maybe; + recurringIntervalCount?: Maybe; + type: Scalars["String"]["output"]; + unitAmount?: Maybe; +}; + +export type StripeProductGql = { + __typename?: "StripeProductGQL"; + active: Scalars["Boolean"]["output"]; + description?: Maybe; + id: Scalars["String"]["output"]; + name: Scalars["String"]["output"]; + prices: Array; +}; + +export type StripeSubscriptionOptionsGql = { + __typename?: "StripeSubscriptionOptionsGQL"; + products: Array; +}; + export type SuccessfulAdd = { __typename?: "SuccessfulAdd"; value: Scalars["Boolean"]["output"]; @@ -3174,11 +3200,8 @@ export type VideoProcessingErrorGql = { export type VideoProcessingGql = { __typename?: "VideoProcessingGQL"; - currentSegment?: Maybe; errors: Array; - framesProcessed?: Maybe; id: Scalars["Int"]["output"]; - progressPercentage?: Maybe; status: ProcessingStatusEnum; statuses: Array; }; diff --git a/src/schema.gql b/src/schema.gql index 988ff54..a63e08f 100644 --- a/src/schema.gql +++ b/src/schema.gql @@ -81,6 +81,7 @@ type Query { limit: Int = 100 after: String = null ): UserRelationshipsResult! + getAvailableSubscriptionOptions: StripeSubscriptionOptionsGQL! getPlayTime(userId: Int!, filters: VideoFilterInput = null): UserPlayTimeGQL! getUserVideos( userId: Int = null @@ -568,9 +569,6 @@ type VideoProcessingGQL { errors: [VideoProcessingErrorGQL!]! status: ProcessingStatusEnum! statuses: [VideoProcessingStatusGQL!]! - framesProcessed: Int - currentSegment: Int - progressPercentage: Float } type VideoProcessingErrorGQL { @@ -826,6 +824,28 @@ type UserRelationship { toUserIsFollowedBy: Boolean! } +type StripeSubscriptionOptionsGQL { + products: [StripeProductGQL!]! +} + +type StripeProductGQL { + id: String! + name: String! + description: String + active: Boolean! + prices: [StripePriceGQL!]! +} + +type StripePriceGQL { + id: String! + currency: String! + unitAmount: Int + recurringInterval: String + recurringIntervalCount: Int + type: String! + active: Boolean! +} + type UserPlayTimeGQL { totalSeconds: Float! }