ggez-banking-sdk
Version:
A Node.js package to handle GGEZ Banking API endpoints, Simplify the process of managing CRUD operations with this efficient and easy-to-use package.
46 lines (45 loc) • 1.67 kB
JavaScript
import { Endpoints, LimitedEndpoints } from "../../constant/constant";
import { AxiosHelper } from "../../helper/api/axiosHelper";
import { AuthService } from "./authService";
import { BaseService } from "./baseService";
class LimitedService extends BaseService {
endpoint = Endpoints.Limited;
authService;
constructor(data) {
super(data);
this.authService = new AuthService(data);
this.axiosInstance.interceptors.request.use((req) => this.onLimitedRequest(req));
}
// #region "Interceptors Handlers"
async onLimitedRequest(req) {
await AxiosHelper.injectLimitedToken(req, this.authService, this.cookiesHelper);
return req;
}
// #endregion
// #region "POST"
validateSecurityData(data) {
const url = this.resolveURL(LimitedEndpoints.SecurityValidate);
return this.POST(url, data);
}
verifySecurityData(data) {
const url = this.resolveURL(LimitedEndpoints.SecurityVerify);
return this.POST(url, data);
}
confirmSecurityData(data) {
const url = this.resolveURL(LimitedEndpoints.SecurityConfirm);
return this.POST(url, data);
}
checkForgetSecurityData(data) {
const url = this.resolveURL(LimitedEndpoints.SecurityForgetCheck);
return this.POST(url, data);
}
validateForgetSecurityData(data) {
const url = this.resolveURL(LimitedEndpoints.SecurityForgetValidate);
return this.POST(url, data);
}
confirmForgetSecurityData(data) {
const url = this.resolveURL(LimitedEndpoints.SecurityForgetConfirm);
return this.POST(url, data);
}
}
export { LimitedService };