@accounts/graphql-client
Version:
GraphQL client transport for accounts
484 lines (483 loc) • 16 kB
TypeScript
import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends {
[key: string]: unknown;
}> = {
[K in keyof T]: T[K];
};
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
[SubKey in K]?: Maybe<T[SubKey]>;
};
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
[SubKey in K]: Maybe<T[SubKey]>;
};
export type MakeEmpty<T extends {
[key: string]: unknown;
}, K extends keyof T> = {
[_ in K]?: never;
};
export type Incremental<T> = T | {
[P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never;
};
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: {
input: string;
output: string;
};
String: {
input: string;
output: string;
};
Boolean: {
input: boolean;
output: boolean;
};
Int: {
input: number;
output: number;
};
Float: {
input: number;
output: number;
};
};
export type AuthenticateParamsInput = {
access_token?: InputMaybe<Scalars['String']['input']>;
access_token_secret?: InputMaybe<Scalars['String']['input']>;
code?: InputMaybe<Scalars['String']['input']>;
password?: InputMaybe<Scalars['String']['input']>;
provider?: InputMaybe<Scalars['String']['input']>;
token?: InputMaybe<Scalars['String']['input']>;
user?: InputMaybe<UserInput>;
};
export type CreateUserInput = {
email?: InputMaybe<Scalars['String']['input']>;
password?: InputMaybe<Scalars['String']['input']>;
username?: InputMaybe<Scalars['String']['input']>;
};
export type CreateUserResult = {
__typename?: 'CreateUserResult';
loginResult?: Maybe<LoginResult>;
userId?: Maybe<Scalars['ID']['output']>;
};
export type EmailRecord = {
__typename?: 'EmailRecord';
address?: Maybe<Scalars['String']['output']>;
verified?: Maybe<Scalars['Boolean']['output']>;
};
export type ImpersonateReturn = {
__typename?: 'ImpersonateReturn';
authorized?: Maybe<Scalars['Boolean']['output']>;
tokens?: Maybe<Tokens>;
user?: Maybe<User>;
};
export type ImpersonationUserIdentityInput = {
email?: InputMaybe<Scalars['String']['input']>;
userId?: InputMaybe<Scalars['String']['input']>;
username?: InputMaybe<Scalars['String']['input']>;
};
export type LoginResult = {
__typename?: 'LoginResult';
sessionId?: Maybe<Scalars['String']['output']>;
tokens?: Maybe<Tokens>;
user?: Maybe<User>;
};
export type Mutation = {
__typename?: 'Mutation';
addEmail?: Maybe<Scalars['Boolean']['output']>;
authenticate?: Maybe<LoginResult>;
changePassword?: Maybe<Scalars['Boolean']['output']>;
createUser?: Maybe<CreateUserResult>;
impersonate?: Maybe<ImpersonateReturn>;
logout?: Maybe<Scalars['Boolean']['output']>;
refreshTokens?: Maybe<LoginResult>;
requestMagicLinkEmail?: Maybe<Scalars['Boolean']['output']>;
resetPassword?: Maybe<LoginResult>;
sendResetPasswordEmail?: Maybe<Scalars['Boolean']['output']>;
sendVerificationEmail?: Maybe<Scalars['Boolean']['output']>;
twoFactorSet?: Maybe<Scalars['Boolean']['output']>;
twoFactorUnset?: Maybe<Scalars['Boolean']['output']>;
verifyAuthentication?: Maybe<Scalars['Boolean']['output']>;
verifyEmail?: Maybe<Scalars['Boolean']['output']>;
};
export type MutationAddEmailArgs = {
newEmail: Scalars['String']['input'];
};
export type MutationAuthenticateArgs = {
params: AuthenticateParamsInput;
serviceName: Scalars['String']['input'];
};
export type MutationChangePasswordArgs = {
newPassword: Scalars['String']['input'];
oldPassword: Scalars['String']['input'];
};
export type MutationCreateUserArgs = {
user: CreateUserInput;
};
export type MutationImpersonateArgs = {
accessToken: Scalars['String']['input'];
impersonated: ImpersonationUserIdentityInput;
};
export type MutationRefreshTokensArgs = {
accessToken: Scalars['String']['input'];
refreshToken: Scalars['String']['input'];
};
export type MutationRequestMagicLinkEmailArgs = {
email: Scalars['String']['input'];
};
export type MutationResetPasswordArgs = {
newPassword: Scalars['String']['input'];
token: Scalars['String']['input'];
};
export type MutationSendResetPasswordEmailArgs = {
email: Scalars['String']['input'];
};
export type MutationSendVerificationEmailArgs = {
email: Scalars['String']['input'];
};
export type MutationTwoFactorSetArgs = {
code: Scalars['String']['input'];
secret: TwoFactorSecretKeyInput;
};
export type MutationTwoFactorUnsetArgs = {
code: Scalars['String']['input'];
};
export type MutationVerifyAuthenticationArgs = {
params: AuthenticateParamsInput;
serviceName: Scalars['String']['input'];
};
export type MutationVerifyEmailArgs = {
token: Scalars['String']['input'];
};
export type Query = {
__typename?: 'Query';
getUser?: Maybe<User>;
twoFactorSecret?: Maybe<TwoFactorSecretKey>;
};
export type Tokens = {
__typename?: 'Tokens';
accessToken?: Maybe<Scalars['String']['output']>;
refreshToken?: Maybe<Scalars['String']['output']>;
};
export type TwoFactorSecretKey = {
__typename?: 'TwoFactorSecretKey';
ascii?: Maybe<Scalars['String']['output']>;
base32?: Maybe<Scalars['String']['output']>;
google_auth_qr?: Maybe<Scalars['String']['output']>;
hex?: Maybe<Scalars['String']['output']>;
otpauth_url?: Maybe<Scalars['String']['output']>;
qr_code_ascii?: Maybe<Scalars['String']['output']>;
qr_code_base32?: Maybe<Scalars['String']['output']>;
qr_code_hex?: Maybe<Scalars['String']['output']>;
};
export type TwoFactorSecretKeyInput = {
ascii?: InputMaybe<Scalars['String']['input']>;
base32?: InputMaybe<Scalars['String']['input']>;
google_auth_qr?: InputMaybe<Scalars['String']['input']>;
hex?: InputMaybe<Scalars['String']['input']>;
otpauth_url?: InputMaybe<Scalars['String']['input']>;
qr_code_ascii?: InputMaybe<Scalars['String']['input']>;
qr_code_base32?: InputMaybe<Scalars['String']['input']>;
qr_code_hex?: InputMaybe<Scalars['String']['input']>;
};
export type User = {
__typename?: 'User';
emails?: Maybe<Array<EmailRecord>>;
id: Scalars['ID']['output'];
username?: Maybe<Scalars['String']['output']>;
};
export type UserInput = {
email?: InputMaybe<Scalars['String']['input']>;
id?: InputMaybe<Scalars['ID']['input']>;
username?: InputMaybe<Scalars['String']['input']>;
};
export type UserFieldsFragment = {
__typename?: 'User';
id: string;
username?: string | null;
emails?: Array<{
__typename?: 'EmailRecord';
address?: string | null;
verified?: boolean | null;
}> | null;
};
export type AddEmailMutationVariables = Exact<{
newEmail: Scalars['String']['input'];
}>;
export type AddEmailMutation = {
__typename?: 'Mutation';
addEmail?: boolean | null;
};
export type AuthenticateWithServiceMutationVariables = Exact<{
serviceName: Scalars['String']['input'];
params: AuthenticateParamsInput;
}>;
export type AuthenticateWithServiceMutation = {
__typename?: 'Mutation';
verifyAuthentication?: boolean | null;
};
export type ChangePasswordMutationVariables = Exact<{
oldPassword: Scalars['String']['input'];
newPassword: Scalars['String']['input'];
}>;
export type ChangePasswordMutation = {
__typename?: 'Mutation';
changePassword?: boolean | null;
};
export type CreateUserMutationVariables = Exact<{
user: CreateUserInput;
}>;
export type CreateUserMutation = {
__typename?: 'Mutation';
createUser?: {
__typename?: 'CreateUserResult';
userId?: string | null;
loginResult?: {
__typename?: 'LoginResult';
sessionId?: string | null;
tokens?: {
__typename?: 'Tokens';
refreshToken?: string | null;
accessToken?: string | null;
} | null;
user?: {
__typename?: 'User';
id: string;
username?: string | null;
emails?: Array<{
__typename?: 'EmailRecord';
address?: string | null;
verified?: boolean | null;
}> | null;
} | null;
} | null;
} | null;
};
export type ImpersonateMutationVariables = Exact<{
accessToken: Scalars['String']['input'];
impersonated: ImpersonationUserIdentityInput;
}>;
export type ImpersonateMutation = {
__typename?: 'Mutation';
impersonate?: {
__typename?: 'ImpersonateReturn';
authorized?: boolean | null;
tokens?: {
__typename?: 'Tokens';
refreshToken?: string | null;
accessToken?: string | null;
} | null;
user?: {
__typename?: 'User';
id: string;
username?: string | null;
emails?: Array<{
__typename?: 'EmailRecord';
address?: string | null;
verified?: boolean | null;
}> | null;
} | null;
} | null;
};
export type AuthenticateMutationVariables = Exact<{
serviceName: Scalars['String']['input'];
params: AuthenticateParamsInput;
}>;
export type AuthenticateMutation = {
__typename?: 'Mutation';
authenticate?: {
__typename?: 'LoginResult';
sessionId?: string | null;
tokens?: {
__typename?: 'Tokens';
refreshToken?: string | null;
accessToken?: string | null;
} | null;
user?: {
__typename?: 'User';
id: string;
username?: string | null;
emails?: Array<{
__typename?: 'EmailRecord';
address?: string | null;
verified?: boolean | null;
}> | null;
} | null;
} | null;
};
export type LogoutMutationVariables = Exact<{
[key: string]: never;
}>;
export type LogoutMutation = {
__typename?: 'Mutation';
logout?: boolean | null;
};
export type RefreshTokensMutationVariables = Exact<{
accessToken: Scalars['String']['input'];
refreshToken: Scalars['String']['input'];
}>;
export type RefreshTokensMutation = {
__typename?: 'Mutation';
refreshTokens?: {
__typename?: 'LoginResult';
sessionId?: string | null;
tokens?: {
__typename?: 'Tokens';
refreshToken?: string | null;
accessToken?: string | null;
} | null;
} | null;
};
export type RequestMagicLinkEmailMutationVariables = Exact<{
email: Scalars['String']['input'];
}>;
export type RequestMagicLinkEmailMutation = {
__typename?: 'Mutation';
requestMagicLinkEmail?: boolean | null;
};
export type ResetPasswordMutationVariables = Exact<{
token: Scalars['String']['input'];
newPassword: Scalars['String']['input'];
}>;
export type ResetPasswordMutation = {
__typename?: 'Mutation';
resetPassword?: {
__typename?: 'LoginResult';
sessionId?: string | null;
tokens?: {
__typename?: 'Tokens';
refreshToken?: string | null;
accessToken?: string | null;
} | null;
} | null;
};
export type SendResetPasswordEmailMutationVariables = Exact<{
email: Scalars['String']['input'];
}>;
export type SendResetPasswordEmailMutation = {
__typename?: 'Mutation';
sendResetPasswordEmail?: boolean | null;
};
export type SendVerificationEmailMutationVariables = Exact<{
email: Scalars['String']['input'];
}>;
export type SendVerificationEmailMutation = {
__typename?: 'Mutation';
sendVerificationEmail?: boolean | null;
};
export type TwoFactorSetMutationVariables = Exact<{
secret: TwoFactorSecretKeyInput;
code: Scalars['String']['input'];
}>;
export type TwoFactorSetMutation = {
__typename?: 'Mutation';
twoFactorSet?: boolean | null;
};
export type TwoFactorUnsetMutationVariables = Exact<{
code: Scalars['String']['input'];
}>;
export type TwoFactorUnsetMutation = {
__typename?: 'Mutation';
twoFactorUnset?: boolean | null;
};
export type VerifyEmailMutationVariables = Exact<{
token: Scalars['String']['input'];
}>;
export type VerifyEmailMutation = {
__typename?: 'Mutation';
verifyEmail?: boolean | null;
};
export type GetTwoFactorSecretQueryVariables = Exact<{
[key: string]: never;
}>;
export type GetTwoFactorSecretQuery = {
__typename?: 'Query';
twoFactorSecret?: {
__typename?: 'TwoFactorSecretKey';
ascii?: string | null;
base32?: string | null;
hex?: string | null;
qr_code_ascii?: string | null;
qr_code_hex?: string | null;
qr_code_base32?: string | null;
google_auth_qr?: string | null;
otpauth_url?: string | null;
} | null;
};
export type GetUserQueryVariables = Exact<{
[key: string]: never;
}>;
export type GetUserQuery = {
__typename?: 'Query';
getUser?: {
__typename?: 'User';
id: string;
username?: string | null;
emails?: Array<{
__typename?: 'EmailRecord';
address?: string | null;
verified?: boolean | null;
}> | null;
} | null;
};
export declare const UserFieldsFragmentDoc: DocumentNode<UserFieldsFragment, unknown>;
export declare const AddEmailDocument: DocumentNode<AddEmailMutation, Exact<{
newEmail: Scalars['String']['input'];
}>>;
export declare const AuthenticateWithServiceDocument: DocumentNode<AuthenticateWithServiceMutation, Exact<{
serviceName: Scalars['String']['input'];
params: AuthenticateParamsInput;
}>>;
export declare const ChangePasswordDocument: DocumentNode<ChangePasswordMutation, Exact<{
oldPassword: Scalars['String']['input'];
newPassword: Scalars['String']['input'];
}>>;
export declare const CreateUserDocument: DocumentNode<CreateUserMutation, Exact<{
user: CreateUserInput;
}>>;
export declare const ImpersonateDocument: DocumentNode<ImpersonateMutation, Exact<{
accessToken: Scalars['String']['input'];
impersonated: ImpersonationUserIdentityInput;
}>>;
export declare const AuthenticateDocument: DocumentNode<AuthenticateMutation, Exact<{
serviceName: Scalars['String']['input'];
params: AuthenticateParamsInput;
}>>;
export declare const LogoutDocument: DocumentNode<LogoutMutation, Exact<{
[key: string]: never;
}>>;
export declare const RefreshTokensDocument: DocumentNode<RefreshTokensMutation, Exact<{
accessToken: Scalars['String']['input'];
refreshToken: Scalars['String']['input'];
}>>;
export declare const RequestMagicLinkEmailDocument: DocumentNode<RequestMagicLinkEmailMutation, Exact<{
email: Scalars['String']['input'];
}>>;
export declare const ResetPasswordDocument: DocumentNode<ResetPasswordMutation, Exact<{
token: Scalars['String']['input'];
newPassword: Scalars['String']['input'];
}>>;
export declare const SendResetPasswordEmailDocument: DocumentNode<SendResetPasswordEmailMutation, Exact<{
email: Scalars['String']['input'];
}>>;
export declare const SendVerificationEmailDocument: DocumentNode<SendVerificationEmailMutation, Exact<{
email: Scalars['String']['input'];
}>>;
export declare const TwoFactorSetDocument: DocumentNode<TwoFactorSetMutation, Exact<{
secret: TwoFactorSecretKeyInput;
code: Scalars['String']['input'];
}>>;
export declare const TwoFactorUnsetDocument: DocumentNode<TwoFactorUnsetMutation, Exact<{
code: Scalars['String']['input'];
}>>;
export declare const VerifyEmailDocument: DocumentNode<VerifyEmailMutation, Exact<{
token: Scalars['String']['input'];
}>>;
export declare const GetTwoFactorSecretDocument: DocumentNode<GetTwoFactorSecretQuery, Exact<{
[key: string]: never;
}>>;
export declare const GetUserDocument: DocumentNode<GetUserQuery, Exact<{
[key: string]: never;
}>>;