From 4ffd9f972dea3f7f2192aa566b2fa34c8ef0672a Mon Sep 17 00:00:00 2001 From: Loewy Date: Fri, 14 Aug 2026 18:19:47 -0700 Subject: [PATCH] Add explicit auth client operations --- src/index.tsx | 174 ++++++++++++++++++++++++++++++++++++++ src/operations/auth.gql | 25 ++++++ src/operations/config.gql | 5 ++ 3 files changed, 204 insertions(+) create mode 100644 src/operations/auth.gql diff --git a/src/index.tsx b/src/index.tsx index 3ab519f..e8a2310 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -4709,6 +4709,31 @@ export type GetAggregatedShotMetricsQuery = { }>; }; +export type GetAuthBootstrapQueryVariables = Exact<{ [key: string]: never }>; + +export type GetAuthBootstrapQuery = { + __typename?: "Query"; + getAuthBootstrap: { + __typename?: "AuthBootstrapGQL"; + status: AuthBootstrapStatusEnum; + user?: { __typename?: "UserGQL"; id: number; username: string } | null; + }; +}; + +export type CompleteAuthRegistrationMutationVariables = Exact<{ + username: Scalars["String"]["input"]; + agreesToMarketing: Scalars["Boolean"]["input"]; +}>; + +export type CompleteAuthRegistrationMutation = { + __typename?: "Mutation"; + completeAuthRegistration: { + __typename?: "CompleteAuthRegistrationGQL"; + errorCode?: AuthRegistrationErrorEnum | null; + user?: { __typename?: "UserGQL"; id: number; username: string } | null; + }; +}; + export type GetChallengesQueryVariables = Exact<{ [key: string]: never }>; export type GetChallengesQuery = { @@ -5136,6 +5161,12 @@ export type GetDeployedConfigQuery = { message: string; priority: number; }>; + socialAuthProviderAvailability: Array<{ + __typename?: "SocialAuthProviderAvailabilityGQL"; + provider: SocialAuthProviderEnum; + platform: SocialAuthPlatformEnum; + enabled: boolean; + }>; }; }; @@ -10720,6 +10751,144 @@ export type GetAggregatedShotMetricsQueryResult = Apollo.QueryResult< GetAggregatedShotMetricsQuery, GetAggregatedShotMetricsQueryVariables >; +export const GetAuthBootstrapDocument = gql` + query getAuthBootstrap { + getAuthBootstrap { + status + user { + id + username + } + } + } +`; + +/** + * __useGetAuthBootstrapQuery__ + * + * To run a query within a React component, call `useGetAuthBootstrapQuery` and pass it any options that fit your needs. + * When your component renders, `useGetAuthBootstrapQuery` 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 } = useGetAuthBootstrapQuery({ + * variables: { + * }, + * }); + */ +export function useGetAuthBootstrapQuery( + baseOptions?: Apollo.QueryHookOptions< + GetAuthBootstrapQuery, + GetAuthBootstrapQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery( + GetAuthBootstrapDocument, + options, + ); +} +export function useGetAuthBootstrapLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + GetAuthBootstrapQuery, + GetAuthBootstrapQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery< + GetAuthBootstrapQuery, + GetAuthBootstrapQueryVariables + >(GetAuthBootstrapDocument, options); +} +export function useGetAuthBootstrapSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + GetAuthBootstrapQuery, + GetAuthBootstrapQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + GetAuthBootstrapQuery, + GetAuthBootstrapQueryVariables + >(GetAuthBootstrapDocument, options); +} +export type GetAuthBootstrapQueryHookResult = ReturnType< + typeof useGetAuthBootstrapQuery +>; +export type GetAuthBootstrapLazyQueryHookResult = ReturnType< + typeof useGetAuthBootstrapLazyQuery +>; +export type GetAuthBootstrapSuspenseQueryHookResult = ReturnType< + typeof useGetAuthBootstrapSuspenseQuery +>; +export type GetAuthBootstrapQueryResult = Apollo.QueryResult< + GetAuthBootstrapQuery, + GetAuthBootstrapQueryVariables +>; +export const CompleteAuthRegistrationDocument = gql` + mutation completeAuthRegistration( + $username: String! + $agreesToMarketing: Boolean! + ) { + completeAuthRegistration( + username: $username + agreesToMarketing: $agreesToMarketing + ) { + errorCode + user { + id + username + } + } + } +`; +export type CompleteAuthRegistrationMutationFn = Apollo.MutationFunction< + CompleteAuthRegistrationMutation, + CompleteAuthRegistrationMutationVariables +>; + +/** + * __useCompleteAuthRegistrationMutation__ + * + * To run a mutation, you first call `useCompleteAuthRegistrationMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useCompleteAuthRegistrationMutation` 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 [completeAuthRegistrationMutation, { data, loading, error }] = useCompleteAuthRegistrationMutation({ + * variables: { + * username: // value for 'username' + * agreesToMarketing: // value for 'agreesToMarketing' + * }, + * }); + */ +export function useCompleteAuthRegistrationMutation( + baseOptions?: Apollo.MutationHookOptions< + CompleteAuthRegistrationMutation, + CompleteAuthRegistrationMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + CompleteAuthRegistrationMutation, + CompleteAuthRegistrationMutationVariables + >(CompleteAuthRegistrationDocument, options); +} +export type CompleteAuthRegistrationMutationHookResult = ReturnType< + typeof useCompleteAuthRegistrationMutation +>; +export type CompleteAuthRegistrationMutationResult = + Apollo.MutationResult; +export type CompleteAuthRegistrationMutationOptions = + Apollo.BaseMutationOptions< + CompleteAuthRegistrationMutation, + CompleteAuthRegistrationMutationVariables + >; export const GetChallengesDocument = gql` query GetChallenges { challenges { @@ -12127,6 +12296,11 @@ export const GetDeployedConfigDocument = gql` } defaultAndroidRecordingFormat bucketUrl + socialAuthProviderAvailability { + provider + platform + enabled + } } } `; diff --git a/src/operations/auth.gql b/src/operations/auth.gql new file mode 100644 index 0000000..9cdf3ea --- /dev/null +++ b/src/operations/auth.gql @@ -0,0 +1,25 @@ +query getAuthBootstrap { + getAuthBootstrap { + status + user { + id + username + } + } +} + +mutation completeAuthRegistration( + $username: String! + $agreesToMarketing: Boolean! +) { + completeAuthRegistration( + username: $username + agreesToMarketing: $agreesToMarketing + ) { + errorCode + user { + id + username + } + } +} diff --git a/src/operations/config.gql b/src/operations/config.gql index 596d3c6..267fd26 100644 --- a/src/operations/config.gql +++ b/src/operations/config.gql @@ -19,5 +19,10 @@ query getDeployedConfig { } defaultAndroidRecordingFormat bucketUrl + socialAuthProviderAvailability { + provider + platform + enabled + } } }