import type { GeeTestValidatePayload } from '../geetest'; export declare enum ActionType { ONBOARDING = 0, LOGIN = 1 } export interface User { id: string; isActive: boolean | null; email: string | null; phoneNumber: string | null; authIDAccountNumber: string | null; incodeId: string | null; clearId: string | null; sumsubId: string | null; veriffId: string | null; yotiId: string | null; idmeId: string | null; age: number | null | undefined; birthDate: string | null | undefined; fullName: string | null | undefined; } /** Single credential (DB: id PK, userId, credentialID longblob, credentialPublicKey longblob, counter) */ export interface Credential { id: string; userId: string; /** longblob; API typically returns base64 string */ credentialID: string; /** longblob; API typically returns base64 string */ credentialPublicKey: string; counter: number; } export type UserWithCredentials = User & { credentials: Credential[] | undefined; }; export type UserWithAgeAndFullName = User; export interface CreatingUser { id: string; shortId: string; verify: boolean; email: string | null; phoneNumber: string | null; } export interface Device { id: string; userId: string; deviceId: string; createdAt: Date; expires: Date; } interface BerifymeApiConfig { backendDomain: string; } export declare function initializeBerifymeApi(userConfig: BerifymeApiConfig): void; declare function getAuthIDToken(): Promise<{ token: string; }>; declare function getIdDocumentTypes({ token }: { token: string; }): Promise<{ idTypes: { Name: string; Description: string; }[]; error: undefined; } | { idTypes: undefined; error: string; }>; declare function createAccount({ token, userId }: { token: string; userId: string; }): Promise<{ success: "ok"; error: undefined; isAllSet: undefined; details: undefined; } | { success: undefined; error: undefined; isAllSet: boolean; details: { userId: string; fullName: string; phoneNumber: string; }; }>; declare function checkBiometricExist({ token, userId }: { token: string; userId: string; }): Promise<{ isExist: boolean; error?: string; }>; declare function proofUser({ token, userId, idType }: { token: string; userId: string; idType: string; }): Promise<{ OperationId: string; OneTimeSecret: string; }>; declare function getProofTransactionTempId({ token, operationId, userId }: { token: string; operationId: string; userId: string; }): Promise<{ TempId: string | null; error: undefined; } | { TempId: undefined; error: string; }>; declare function createBiometricFromProof({ token, tempId, userId }: { token: string; tempId: string; userId: string; }): Promise<{ success: "ok"; error: undefined; } | { error: string; }>; declare function getAccount({ token, phone }: { token: string; phone: string; }): Promise<{ fullName: string; dateOfBirth: string; documentType: string; issuingCountry: string; gender: string; dateOfExpiry: string; error: undefined; } | { fullName: undefined; dateOfBirth: undefined; documentType: undefined; issuingCountry: undefined; gender: undefined; dateOfExpiry: undefined; error: string; }>; declare function createLoginTransaction({ token, phone }: { token: string; phone: string; }): Promise<{ TransactionId: string; OneTimeSecret: string; error: undefined; }>; declare function getTransactionStatus({ token, phone, transactionId }: { token: string; phone: string; transactionId: string; }): Promise<{ userId: string; operationId: string; error?: string; }>; declare function getOperationStatus({ token, operationId }: { token: string; operationId: string; }): Promise<{ success: string; error?: string; }>; declare function searchUser({ token, operationId }: { token: string; operationId: string; }): Promise<{ userId: string; operationId: string; error: undefined; }>; declare function getDocumentDetails({ token, operationId, userId }: { token: string; operationId: string; userId: string; }): Promise<{ details: { Key: string; Value: string; }[]; phone: string; error: undefined; } | { details: undefined; phone: undefined; error: string; }>; declare function updateAccount(token: string, data: { phone: string; fullName: string; dateOfBirth: string; documentType: string; issuingCountry: string; gender: string; dateOfExpiry: string; }): Promise<{ success: "ok"; }>; declare function getIncodeStart(uniqueId?: string): Promise<{ token: string; uniqueId: string; }>; declare function getIncodeFinish({ token }: { token: string; }): Promise<{ token: string; uniqueId: string; }>; declare function getIncodeApprove({ id, token, uniqueId, }: { id: string; token: string; uniqueId: string; }): Promise<{ incodeId?: string; error?: string; }>; declare function getAppIncodeApprove({ id, incodeId, }: { id: string; incodeId: string; }): Promise<{ incodeId?: string; error?: string; }>; declare function createVerificationSession({ redirectUrl, token }: { redirectUrl: string; token?: string; }): Promise<{ sessionId: string; token: string; }>; declare function getClearApprove({ id, sessionId, token, }: { id: string; sessionId: string; token?: string; }): Promise<{ clearId?: string; error?: string; }>; /** checkToken 的 configuration(與後端 ConfigPayload 對齊) */ export type CompanyConfiguration = { enabledIdvVendors?: string[]; useDefaultSuccessPage?: boolean; useDefaultErrorPage?: boolean; successRedirectUrl?: string | null; errorRedirectUrl?: string | null; useDefaultSuccessPageApp?: boolean; useDefaultErrorPageApp?: boolean; successRedirectUrlApp?: string | null; errorRedirectUrlApp?: string | null; /** ISO 3166-1 alpha-2 lowercase;與 Web 共用 Dashboard 設定 */ defaultPhoneCountryCode?: string | null; } | null; declare function checkThirdPartyVerificationToken(token: string): Promise<{ success: boolean; companyLogo?: string | null; configuration?: CompanyConfiguration; error?: string; }>; export declare function getHumanVerificationUrl(): string; declare function sendPhoneNumberCode({ phoneNumber, token, geetest }: { phoneNumber: string; token?: string; geetest: GeeTestValidatePayload; }): Promise<{ success: boolean; error?: string; }>; export declare enum VerificationStatus { PENDING = "PENDING", ONBOARDING = "ONBOARDING", LOGIN = "LOGIN" } declare function getUserBySessionId({ sessionId, verificationStatus, token }: { sessionId: string; verificationStatus: VerificationStatus; token?: string; }): Promise<{ user?: UserWithAgeAndFullName; error?: string; }>; declare function getUserByIncodeId(incodeId: string): Promise<{ user?: UserWithAgeAndFullName; error?: string; }>; declare function getUserByClearId({ clearId, token }: { clearId: string; token?: string; }): Promise<{ user?: UserWithAgeAndFullName; error?: string; }>; declare function getUserVenderByPhone({ phoneNumber, token }: { phoneNumber: string; token?: string; }): Promise<{ vender?: string | null; fullName?: string | null; error?: string; }>; declare function getUserByPhoneNumberAndVerifyCode({ phoneNumber, code }: { phoneNumber: string; code: string; }): Promise<{ user?: UserWithCredentials; error?: string; }>; declare function uploadDeviceId({ id, deviceId, token }: { id: string; deviceId: string; token?: string; }): Promise<{ device: Device; error?: string; }>; declare function checkDeviceId({ phoneNumber, deviceId, token }: { phoneNumber: string; deviceId: string; token: string; }): Promise<{ user?: User; error?: string; }>; declare function createUserByVerifiedExternalPhoneNumber({ phoneNumber, token }: { phoneNumber: string; token?: string; }): Promise<{ user?: User; error?: string; }>; declare function getRedirectUrl({ userId, token, client }: { userId: string; token: string; client?: 'app'; }): Promise<{ redirectUrl?: string; error?: string; }>; declare function getGeneralVerificationToken({ userId, token }: { userId: string; token: string; }): Promise<{ generalVerificationToken?: string; error?: string; }>; declare function initUpdateAdminTokenSchedule(): Promise<{ status: number; }>; declare function deleteUpdateAdminTokenSchedule(): Promise<{ status: number; }>; declare function generateAppleWalletPass({ id, fullName, birthDate }: { id: string; fullName: string; birthDate: string; }): Promise<{ serialNumber: string; }>; declare function createSessionToken({ apiKeyId, secretKey, redirectUrl }: { apiKeyId: string; secretKey: string; redirectUrl: string; }): Promise; interface CreateSessionTokenResponse { sessionToken?: string; companyLogo?: string; error?: string; } declare function createSessionTokenWithoutRedirectUrl({ apiKeyId, secretKey, }: { apiKeyId: string; secretKey: string; }): Promise; declare function checkBiometricsStatus({ phoneNumber, publicKey }: { phoneNumber: string; publicKey: string | null; }): Promise; declare function createBiometrics({ phoneNumber, publicKey, signature }: { phoneNumber: string; publicKey: string | null; signature: string; }): Promise; declare function deleteBiometrics({ phoneNumber }: { phoneNumber: string; }): Promise; declare function createAuthenticationLogs({ actionType, token, userId, vender, os, browser, device, transactionId, incodeSessionId, clearSessionId, isPass, }: { actionType: ActionType; token: string; userId: string; vender: string; os: string; browser: string; device: string; transactionId?: string; incodeSessionId?: string; clearSessionId?: string; isPass?: boolean; }): Promise; declare function updateAuthenticationLogs({ isPass, token, transactionId, incodeSessionId, clearSessionId, }: { isPass: boolean; token?: string; transactionId?: string; incodeSessionId?: string; clearSessionId?: string; }): Promise; declare function checkAndIssueToken({ userId }: { userId: string; }): Promise; declare function getWallet({ phoneNumber }: { phoneNumber: string; }): Promise; declare function getOrderByCountry({ countryCode }: { countryCode: string; }): Promise<{ order?: []; error?: string; }>; declare const berifymeApi: { authID: { getAuthIDToken: typeof getAuthIDToken; getIdDocumentTypes: typeof getIdDocumentTypes; createAccount: typeof createAccount; checkBiometricExist: typeof checkBiometricExist; proofUser: typeof proofUser; getProofTransactionTempId: typeof getProofTransactionTempId; createBiometricFromProof: typeof createBiometricFromProof; getAccount: typeof getAccount; createLoginTransaction: typeof createLoginTransaction; getTransactionStatus: typeof getTransactionStatus; getOperationStatus: typeof getOperationStatus; searchUser: typeof searchUser; getDocumentDetails: typeof getDocumentDetails; updateAccount: typeof updateAccount; }; incode: { getIncodeStart: typeof getIncodeStart; getIncodeFinish: typeof getIncodeFinish; getIncodeApprove: typeof getIncodeApprove; getAppIncodeApprove: typeof getAppIncodeApprove; }; clear: { createVerificationSession: typeof createVerificationSession; getClearApprove: typeof getClearApprove; }; auth: { sendPhoneNumberCode: typeof sendPhoneNumberCode; }; user: { getUserBySessionId: typeof getUserBySessionId; getUserByIncodeId: typeof getUserByIncodeId; getUserByClearId: typeof getUserByClearId; getUserVenderByPhone: typeof getUserVenderByPhone; getUserByPhoneNumberAndVerifyCode: typeof getUserByPhoneNumberAndVerifyCode; uploadDeviceId: typeof uploadDeviceId; checkDeviceId: typeof checkDeviceId; createUserByVerifiedExternalPhoneNumber: typeof createUserByVerifiedExternalPhoneNumber; }; thirdParty: { getRedirectUrl: typeof getRedirectUrl; checkThirdPartyVerificationToken: typeof checkThirdPartyVerificationToken; getGeneralVerificationToken: typeof getGeneralVerificationToken; }; scheduld: { initUpdateAdminTokenSchedule: typeof initUpdateAdminTokenSchedule; deleteUpdateAdminTokenSchedule: typeof deleteUpdateAdminTokenSchedule; }; pass: { generateAppleWalletPass: typeof generateAppleWalletPass; }; tools: { createSessionToken: typeof createSessionToken; createSessionTokenWithoutRedirectUrl: typeof createSessionTokenWithoutRedirectUrl; }; biometrics: { checkBiometricsStatus: typeof checkBiometricsStatus; createBiometrics: typeof createBiometrics; deleteBiometrics: typeof deleteBiometrics; }; AuthenticationLogs: { createAuthenticationLogs: typeof createAuthenticationLogs; updateAuthenticationLogs: typeof updateAuthenticationLogs; }; blockchain: { checkAndIssueToken: typeof checkAndIssueToken; }; wallet: { getWallet: typeof getWallet; }; getOrderByCountry: typeof getOrderByCountry; }; export default berifymeApi; //# sourceMappingURL=api.d.ts.map