UNPKG

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.

33 lines (32 loc) 1.19 kB
import { BaseService } from "./baseService"; import { Endpoints, ProgramEndpoints } from "../../constant/constant"; import { AxiosHelper } from "../../helper"; import { AuthService } from "./authService"; class ProgramService extends BaseService { endpoint = Endpoints.Program; authService; constructor(data) { super(data); this.authService = new AuthService(data); this.axiosInstance.interceptors.request.use((req) => this.onProgramRequest(req)); } // #region "Interceptors Handlers" async onProgramRequest(req) { await AxiosHelper.injectLimitedToken(req, this.authService, this.cookiesHelper); return req; } //#region "GET" getSystemFeatures() { const url = this.resolveURL(`${ProgramEndpoints.SystemFeatures}/${this.context.getProgramId()}`); return this.GET(url); } getBin() { const url = this.resolveURL(`${ProgramEndpoints.Bin}/${this.context.getProgramId()}`); return this.GET(url); } getSignUp() { const url = this.resolveURL(`${ProgramEndpoints.SignUp}/${this.context.getProgramId()}`); return this.GET(url); } } export { ProgramService };