Compare commits

..

6 Commits

Author SHA1 Message Date
dde4cfd99b Merge pull request 'Add subscriptionGatingEnabled prop to deployed config' (#196) from loewy/add-subscription-gating-enabled into master
Reviewed-on: #196
2025-08-08 16:52:30 -06:00
845fb361b9 Merge branch 'master' into loewy/add-subscription-gating-enabled
All checks were successful
Tests / Tests (pull_request) Successful in 10s
2025-08-08 16:49:17 -06:00
9f5fcc066e Merge pull request 'Create subscription operations' (#197) from loewy/create-sub-operations into master
Reviewed-on: #197
2025-08-07 13:06:08 -06:00
dfb0361e12 Merge branch 'master' into loewy/create-sub-operations
All checks were successful
Tests / Tests (pull_request) Successful in 10s
2025-08-07 12:59:54 -06:00
77477d63db add subscriptionGatingEnabled prop to deployed config
All checks were successful
Tests / Tests (pull_request) Successful in 31s
2025-07-29 14:28:36 -07:00
a497abd44d create sub operations
All checks were successful
Tests / Tests (pull_request) Successful in 11s
2025-07-09 11:31:26 -07:00
3 changed files with 207 additions and 20 deletions

View File

@ -217,6 +217,7 @@ export type DeployedConfigGql = {
environment: Scalars["String"]["output"];
firebase: Scalars["Boolean"]["output"];
minimumAllowedAppVersion: Scalars["String"]["output"];
subscriptionGatingEnabled: Scalars["Boolean"]["output"];
};
export type DoesNotOwnShotErr = {
@ -2232,15 +2233,6 @@ export type IntPoint2DInput = {
y: Scalars["Int"]["input"];
};
export type IntRangeFilter = {
greaterThan?: InputMaybe<Scalars["Int"]["input"]>;
greaterThanEqualTo?: InputMaybe<Scalars["Int"]["input"]>;
greaterThanInclusive?: Scalars["Boolean"]["input"];
includeOnNone?: Scalars["Boolean"]["input"];
lessThan?: InputMaybe<Scalars["Int"]["input"]>;
lessThanInclusive?: Scalars["Boolean"]["input"];
};
export type MakePercentageIntervalGql = {
__typename?: "MakePercentageIntervalGQL";
elapsedTime: Scalars["Float"]["output"];
@ -3143,7 +3135,6 @@ export type VideoFilterInput = {
createdAt?: InputMaybe<DateRangeFilter>;
excludeVideosWithNoShots?: InputMaybe<Scalars["Boolean"]["input"]>;
isStreamCompleted?: InputMaybe<Scalars["Boolean"]["input"]>;
reactionCount?: InputMaybe<IntRangeFilter>;
requireCursorCompletion?: Scalars["Boolean"]["input"];
};
@ -3906,6 +3897,47 @@ export type EnsureStripeCustomerExistsMutation = {
};
};
export type CreateSubscriptionMutationVariables = Exact<{
priceId: Scalars["String"]["input"];
}>;
export type CreateSubscriptionMutation = {
__typename?: "Mutation";
createSubscription: {
__typename?: "CreateSubscriptionResultGQL";
checkoutUrl: string;
sessionId: string;
};
};
export type GetAvailableSubscriptionOptionsQueryVariables = Exact<{
[key: string]: never;
}>;
export type GetAvailableSubscriptionOptionsQuery = {
__typename?: "Query";
getAvailableSubscriptionOptions: {
__typename?: "StripeSubscriptionOptionsGQL";
products: Array<{
__typename?: "StripeProductGQL";
id: string;
name: string;
description?: string | null;
active: boolean;
prices: Array<{
__typename?: "StripePriceGQL";
id: string;
currency: string;
unitAmount?: number | null;
recurringInterval?: string | null;
recurringIntervalCount?: number | null;
type: string;
active: boolean;
}>;
}>;
};
};
export type ReactToVideoMutationVariables = Exact<{
videoId: Scalars["Int"]["input"];
reaction?: InputMaybe<ReactionEnum>;
@ -6779,6 +6811,143 @@ export type EnsureStripeCustomerExistsMutationOptions =
EnsureStripeCustomerExistsMutation,
EnsureStripeCustomerExistsMutationVariables
>;
export const CreateSubscriptionDocument = gql`
mutation CreateSubscription($priceId: String!) {
createSubscription(priceId: $priceId) {
checkoutUrl
sessionId
}
}
`;
export type CreateSubscriptionMutationFn = Apollo.MutationFunction<
CreateSubscriptionMutation,
CreateSubscriptionMutationVariables
>;
/**
* __useCreateSubscriptionMutation__
*
* To run a mutation, you first call `useCreateSubscriptionMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useCreateSubscriptionMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation
* - An object with fields that represent the current status of the mutation's execution
*
* @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
*
* @example
* const [createSubscriptionMutation, { data, loading, error }] = useCreateSubscriptionMutation({
* variables: {
* priceId: // value for 'priceId'
* },
* });
*/
export function useCreateSubscriptionMutation(
baseOptions?: Apollo.MutationHookOptions<
CreateSubscriptionMutation,
CreateSubscriptionMutationVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<
CreateSubscriptionMutation,
CreateSubscriptionMutationVariables
>(CreateSubscriptionDocument, options);
}
export type CreateSubscriptionMutationHookResult = ReturnType<
typeof useCreateSubscriptionMutation
>;
export type CreateSubscriptionMutationResult =
Apollo.MutationResult<CreateSubscriptionMutation>;
export type CreateSubscriptionMutationOptions = Apollo.BaseMutationOptions<
CreateSubscriptionMutation,
CreateSubscriptionMutationVariables
>;
export const GetAvailableSubscriptionOptionsDocument = gql`
query GetAvailableSubscriptionOptions {
getAvailableSubscriptionOptions {
products {
id
name
description
active
prices {
id
currency
unitAmount
recurringInterval
recurringIntervalCount
type
active
}
}
}
}
`;
/**
* __useGetAvailableSubscriptionOptionsQuery__
*
* To run a query within a React component, call `useGetAvailableSubscriptionOptionsQuery` and pass it any options that fit your needs.
* When your component renders, `useGetAvailableSubscriptionOptionsQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useGetAvailableSubscriptionOptionsQuery({
* variables: {
* },
* });
*/
export function useGetAvailableSubscriptionOptionsQuery(
baseOptions?: Apollo.QueryHookOptions<
GetAvailableSubscriptionOptionsQuery,
GetAvailableSubscriptionOptionsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<
GetAvailableSubscriptionOptionsQuery,
GetAvailableSubscriptionOptionsQueryVariables
>(GetAvailableSubscriptionOptionsDocument, options);
}
export function useGetAvailableSubscriptionOptionsLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetAvailableSubscriptionOptionsQuery,
GetAvailableSubscriptionOptionsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<
GetAvailableSubscriptionOptionsQuery,
GetAvailableSubscriptionOptionsQueryVariables
>(GetAvailableSubscriptionOptionsDocument, options);
}
export function useGetAvailableSubscriptionOptionsSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetAvailableSubscriptionOptionsQuery,
GetAvailableSubscriptionOptionsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<
GetAvailableSubscriptionOptionsQuery,
GetAvailableSubscriptionOptionsQueryVariables
>(GetAvailableSubscriptionOptionsDocument, options);
}
export type GetAvailableSubscriptionOptionsQueryHookResult = ReturnType<
typeof useGetAvailableSubscriptionOptionsQuery
>;
export type GetAvailableSubscriptionOptionsLazyQueryHookResult = ReturnType<
typeof useGetAvailableSubscriptionOptionsLazyQuery
>;
export type GetAvailableSubscriptionOptionsSuspenseQueryHookResult = ReturnType<
typeof useGetAvailableSubscriptionOptionsSuspenseQuery
>;
export type GetAvailableSubscriptionOptionsQueryResult = Apollo.QueryResult<
GetAvailableSubscriptionOptionsQuery,
GetAvailableSubscriptionOptionsQueryVariables
>;
export const ReactToVideoDocument = gql`
mutation ReactToVideo($videoId: Int!, $reaction: ReactionEnum) {
reactToVideo(videoId: $videoId, reaction: $reaction)

View File

@ -12,3 +12,30 @@ mutation EnsureStripeCustomerExists {
updatedAt
}
}
mutation CreateSubscription($priceId: String!) {
createSubscription(priceId: $priceId) {
checkoutUrl
sessionId
}
}
query GetAvailableSubscriptionOptions {
getAvailableSubscriptionOptions {
products {
id
name
description
active
prices {
id
currency
unitAmount
recurringInterval
recurringIntervalCount
type
active
}
}
}
}

View File

@ -297,6 +297,7 @@ type DeployedConfigGQL {
devMode: Boolean!
environment: String!
minimumAllowedAppVersion: String!
subscriptionGatingEnabled: Boolean!
bannerMessages: [BannerGQL!]!
}
@ -637,16 +638,6 @@ input VideoFilterInput {
requireCursorCompletion: Boolean! = true
createdAt: DateRangeFilter = null
excludeVideosWithNoShots: Boolean = null
reactionCount: IntRangeFilter = null
}
input IntRangeFilter {
lessThan: Int = null
greaterThanEqualTo: Int = null
greaterThan: Int = null
includeOnNone: Boolean! = false
lessThanInclusive: Boolean! = false
greaterThanInclusive: Boolean! = true
}
input VideoFeedInputGQL @oneOf {