import { AccountsClient, TransportInterface } from '@accounts/client'; import { CreateUser, ImpersonationResult, LoginResult, User, CreateUserResult } from '@accounts/types'; import { DocumentNode } from 'graphql/language'; export interface AuthenticateParams { [key: string]: string | object; } export interface OptionsType { graphQLClient: any; userFieldsFragment?: DocumentNode; } export default class GraphQLClient implements TransportInterface { client: AccountsClient; private options; constructor(options: OptionsType); /** * Create a user with basic user info * * @param {CreateUser} user user object * @returns {Promise} contains user's ID and LoginResult object if autologin is enabled * @memberof GraphQLClient */ createUser(user: CreateUser): Promise; /** * @inheritDoc */ authenticateWithService(service: string, authenticateParams: { [key: string]: string | object; }): Promise; /** * @inheritDoc */ loginWithService(service: string, authenticateParams: AuthenticateParams): Promise; /** * @inheritDoc */ getUser(): Promise; /** * @inheritDoc */ logout(): Promise; /** * @inheritDoc */ refreshTokens(accessToken: string, refreshToken: string): Promise; /** * @inheritDoc */ verifyEmail(token: string): Promise; /** * @inheritDoc */ sendResetPasswordEmail(email: string): Promise; /** * @inheritDoc */ sendVerificationEmail(email: string): Promise; /** * @inheritDoc */ resetPassword(token: string, newPassword: string): Promise; /** * @inheritDoc */ addEmail(newEmail: string): Promise; /** * @inheritDoc */ changePassword(oldPassword: string, newPassword: string): Promise; /** * @inheritDoc */ getTwoFactorSecret(): Promise; /** * @inheritDoc */ twoFactorSet(secret: any, code: string): Promise; /** * @inheritDoc */ twoFactorUnset(code: string): Promise; /** * @inheritDoc */ impersonate(token: string, impersonated: { username?: string; userId?: string; email?: string; }): Promise; private mutate; private query; }