UNPKG

pratik-auth-sdk-test

Version:

Arvasit Authentication SDK for Node.js

294 lines (257 loc) 5.93 kB
export type AuthHeaders = Record<string, string>; export interface CheckCredentialResponse { isValid: boolean; type: 'email' | 'phone' | 'unknown'; } export interface SignupResponse { firstName?: string; lastName?: string; email?: string; username?: string; isTwoFactorAuthenticationEnabled?: boolean; avatarUrl?: string | null; authId: string; role?: string | null; defaultClient?: boolean; recoveryEmail?: string; clientId?: string; createdAt?: string; updatedAt?: string; phoneNumber?: string; alternatePhoneNumber?: []; alternateEmail?: []; } export interface LoginResponse { type: string; message: string; accessToken: string; refreshToken: string; deviceId: string; userResponse: { authId: string; email: string; firstName: string; lastName: string; username: string; role: string; avatarUrl: string; createdAt: string; updatedAt: string; }; } export interface CheckCredentialRequest { credential: string; } export interface CredentialForForgotPasswordRequest { credential: string; } export interface LoginRequest { credential: string; password: string; expireSessionAt?: string; tokenMetadata?: JSON; deviceRegistry?: { deviceId?: string | null; deviceName?: string | null; os?: string | null; browserName?: string | null; deviceType?: string | null; deviceIp?: string | null; rememberThisDevice?: boolean; }; } export interface OtpLoginRequest { credential: string; otp: string; deviceRegistry?: { deviceId?: string | null; deviceName?: string | null; os?: string | null; browserName?: string | null; deviceType?: string | null; deviceIp?: string | null; rememberThisDevice?: boolean; }; } export interface TwoFALoginRequest { credential: string; totp: string; deviceRegistry?: { deviceId?: string | null; deviceName?: string | null; os?: string | null; browserName?: string | null; deviceType?: string | null; deviceIp?: string | null; rememberThisDevice?: boolean; }; } export interface RecoveryCodeLoginRequest { credential: string; recoveryCode: string; deviceRegistry?: { deviceId?: string | null; deviceName?: string | null; os?: string | null; browserName?: string | null; deviceType?: string | null; deviceIp?: string | null; rememberThisDevice?: boolean; }; } export interface GenerateRecoveryCodesRequest { accessToken: string; } export interface SignupRequest { firstName?: string; lastName?: string; username?: string; phoneNumber?: string; email?: string; avatarUrl?: string; password: string; alternatePhoneNumber: string[]; alternateEmail: string[]; role?: string; recoveryEmail?: string; } export interface SuggestUsernameRequest { firstName: string; lastName: string; } export interface CheckUserNameRequest { username: string; } export interface ForgotPasswordSendOTPRequest { credential: string; type: 'EMAIL' | 'PHONE'; } export interface ValidateForgetPasswordTokenRequest { token: string; } export interface VerifyTokenSetupPasswordRequest { token: string; password: string; } export interface VerifyForgotPasswordOTPRequest { credential: string; otp: string; } export interface GenerateRecoveryCodeRequest { authId: string; } export interface RefreshAccessTokenRequest { token: string; } export interface EnterCredentialForForgotPasswordResponse { maskedEmail?: string | null; maskedPhone?: string | null; email?: string | null; phone?: string | null; } export interface UpdatePasswordRequest { credential: string; oldPassword: string; newPassword: string; } export interface GenerateQRCodeAndSecretFor2FARequest { accessToken: string; } export interface GenerateQrCodeAndSecretFor2FAResponse { secret: string; qrCode: string; } export interface VerifyQRCodeAndSecretFor2FARequest { accessToken: string; totp: string; secretKey: string; } export interface ListOfSecretKeysRequest { accessToken: string; } export interface ListOfRecoveryCodeRequest { accessToken: string; } export interface RemoveTwoFADeviceRequest { accessToken: string; key: string; } export interface DisableTwoFARequest { accessToken: string; } export interface LogoutRequest { token: string; } export interface RefreshTokenResponse { accessToken: string; refreshToken: string; } export interface ListOfSecretKeysResponse { isTwoFactorEnabled: boolean; listOfSecret: { secretKey: string; createdAt: string; }[]; } export interface ListOfRecoveryCodeResponse { createdOn: string; listOfRecoveryCode: { code: string; isUsed: boolean; usedAt: string | null; }[]; } export interface LoginActivityCountsRequest { accessToken: string; startDate: string; endDate: string; page?: number; limit?: number; sortBy?: string; sortOrder?: string; searchField?: string; searchValue?: string; } export interface LoginActivityDetailsRequest { authId?: string; accessToken: string; startDate: string; endDate: string; page?: number; limit?: number; sortBy?: string; sortOrder?: string; searchField?: string; searchValue?: string; } export interface EnterCredentialForForgotPasswordResponse { maskedEmail?: string | null; maskedPhone?: string | null; email?: string | null; phone?: string | null; } export interface LoginActivityCountResponse { totalCount: number; data: { authId: string; email: string; username: string; phoneNumber: string; loginCount: string; lastAccess: string; }[]; } export interface LoginActivityDetailsResponse { totalCount: number; data: { authId: string; email: string; username: string; phoneNumber: string; sessionId: string; loginAt: string; lastAccessTime: string; expiresAt: string; status: string; }[]; }