import BaseApiService from "@Front/Api/BaseApiService"; export type IMailVerifyParams = { email: string; }; export type IMailVerifyReturn = { partialPhoneNumber: string; }; export type IVerifyTotpCodeParams = { totpCode: string; email: string; }; export type IVerifyTotpCodeReturn = { validCode: boolean; }; export default class Auth extends BaseApiService { private static instance: Auth; protected readonly namespaceUrl = this.getBaseUrl().concat("/customer"); private readonly baseURl = this.namespaceUrl.concat("/auth"); public static getInstance() { return (this.instance ??= new this()); } public async mailVerifySms(body: IMailVerifyParams): Promise { const url = new URL(this.baseURl.concat("/mail/verify-sms")); try { return this.postRequest(url, body); } catch (err) { this.onError(err); return Promise.reject(err); } } public async verifyTotpCode(body: IVerifyTotpCodeParams): Promise { const url = new URL(this.baseURl.concat("/verify-totp-code")); try { return this.postRequest(url, body); } catch (err) { this.onError(err); return Promise.reject(err); } } }