Add getUserSubscriptionStatus #198

Merged
loewy merged 2 commits from loewy/subscription-status-resolvers into master 2025-08-14 13:22:34 -06:00
2 changed files with 47 additions and 0 deletions

View File

@ -2277,6 +2277,7 @@ export type MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailed
export type Mutation = { export type Mutation = {
__typename?: "Mutation"; __typename?: "Mutation";
addAnnotationToShot: AddShotAnnotationReturn; addAnnotationToShot: AddShotAnnotationReturn;
cancelSubscription: UserSubscriptionStatusGql;
commentOnVideo: Scalars["Boolean"]["output"]; commentOnVideo: Scalars["Boolean"]["output"];
createBucketSet: BucketSetGql; createBucketSet: BucketSetGql;
createSubscription: CreateSubscriptionResultGql; createSubscription: CreateSubscriptionResultGql;
@ -2523,6 +2524,7 @@ export type Query = {
getTableState: TableStateGql; getTableState: TableStateGql;
getUser?: Maybe<UserGql>; getUser?: Maybe<UserGql>;
getUserRelationshipsMatching: UserRelationshipsResult; getUserRelationshipsMatching: UserRelationshipsResult;
getUserSubscriptionStatus: UserSubscriptionStatusGql;
getUserTags: Array<TagGql>; getUserTags: Array<TagGql>;
getUserVideos: VideoHistoryGql; getUserVideos: VideoHistoryGql;
getUsernames: Array<Scalars["String"]["output"]>; getUsernames: Array<Scalars["String"]["output"]>;
@ -2956,6 +2958,17 @@ export type StripeSubscriptionOptionsGql = {
products: Array<StripeProductGql>; products: Array<StripeProductGql>;
}; };
export enum StripeSubscriptionStatusEnum {
Active = "ACTIVE",
Canceled = "CANCELED",
Incomplete = "INCOMPLETE",
IncompleteExpired = "INCOMPLETE_EXPIRED",
PastDue = "PAST_DUE",
Paused = "PAUSED",
Trialing = "TRIALING",
Unpaid = "UNPAID",
}
export type SuccessfulAdd = { export type SuccessfulAdd = {
__typename?: "SuccessfulAdd"; __typename?: "SuccessfulAdd";
value: Scalars["Boolean"]["output"]; value: Scalars["Boolean"]["output"];
@ -3114,6 +3127,17 @@ export type UserShotCountEntry = {
videos: Scalars["Int"]["output"]; videos: Scalars["Int"]["output"];
}; };
export type UserSubscriptionStatusGql = {
__typename?: "UserSubscriptionStatusGQL";
currentPeriodEnd?: Maybe<Scalars["DateTime"]["output"]>;
currentPeriodStart?: Maybe<Scalars["DateTime"]["output"]>;
hasActiveSubscription: Scalars["Boolean"]["output"];
stripePriceId?: Maybe<Scalars["String"]["output"]>;
stripeSubscriptionId?: Maybe<Scalars["String"]["output"]>;
subscriptionStatus?: Maybe<StripeSubscriptionStatusEnum>;
validUntil?: Maybe<Scalars["DateTime"]["output"]>;
};
export type VideoFeedInputGql = export type VideoFeedInputGql =
| { | {
allUsers: Scalars["Boolean"]["input"]; allUsers: Scalars["Boolean"]["input"];

View File

@ -82,6 +82,7 @@ type Query {
after: String = null after: String = null
): UserRelationshipsResult! ): UserRelationshipsResult!
getAvailableSubscriptionOptions: StripeSubscriptionOptionsGQL! getAvailableSubscriptionOptions: StripeSubscriptionOptionsGQL!
getUserSubscriptionStatus: UserSubscriptionStatusGQL!
getPlayTime(userId: Int!, filters: VideoFilterInput = null): UserPlayTimeGQL! getPlayTime(userId: Int!, filters: VideoFilterInput = null): UserPlayTimeGQL!
getUserVideos( getUserVideos(
userId: Int = null userId: Int = null
@ -850,6 +851,27 @@ type StripePriceGQL {
active: Boolean! active: Boolean!
} }
type UserSubscriptionStatusGQL {
hasActiveSubscription: Boolean!
subscriptionStatus: StripeSubscriptionStatusEnum
currentPeriodStart: DateTime
currentPeriodEnd: DateTime
validUntil: DateTime
stripePriceId: String
stripeSubscriptionId: String
}
enum StripeSubscriptionStatusEnum {
INCOMPLETE
INCOMPLETE_EXPIRED
TRIALING
ACTIVE
PAST_DUE
CANCELED
UNPAID
PAUSED
}
type UserPlayTimeGQL { type UserPlayTimeGQL {
totalSeconds: Float! totalSeconds: Float!
} }
@ -909,6 +931,7 @@ type Mutation {
ensureStripeCustomerExists: UserGQL! ensureStripeCustomerExists: UserGQL!
deleteUser: Boolean! deleteUser: Boolean!
createSubscription(priceId: String!): CreateSubscriptionResultGQL! createSubscription(priceId: String!): CreateSubscriptionResultGQL!
cancelSubscription: UserSubscriptionStatusGQL!
findPrerecordTableLayout(b64Image: String!, videoId: Int!): HomographyInfoGQL findPrerecordTableLayout(b64Image: String!, videoId: Int!): HomographyInfoGQL
createUploadStream( createUploadStream(
videoMetadata: VideoMetadataInput! videoMetadata: VideoMetadataInput!