UNPKG

@phasesdk/api-client-for-economic

Version:

e-conomic REST API Library for Node.js is a powerful tool designed to simplify integration with the e-conomic platform for developers building Node.js applications. With this library, developers can effortlessly leverage the full functionality of the e-co

70 lines (69 loc) 2.16 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const RestApi_1 = __importDefault(require("../../modules/RestApi")); class Self extends RestApi_1.default { /** * @constructor */ constructor(props) { super(props); } /** * This endpoint provides you with information about your settings. * @see https://restdocs.e-conomic.com/#get-self * @returns {Promise<HttpResponse<SelfType>>} */ get() { const requestObj = { method: "get", url: `/self`, }; return this._httpRequest(requestObj); } /** * This endpoint allows you to update user settings. * @see https://restdocs.e-conomic.com/#put-self-user * @param {UpdateUserType} updateData * @returns {Promise<HttpResponse<User>>} */ updateUser(updateData) { const requestObj = { method: "put", url: `/self/user`, data: updateData, }; return this._httpRequest(requestObj); } /** * This endpoint allows you to update company settings. * @see https://restdocs.e-conomic.com/#put-self-company * @param {UpdateCompanyType} updateData * @returns {Promise<HttpResponse<Company>>} */ updateCompany(updateData) { const requestObj = { method: "put", url: `/self/company`, data: updateData, }; return this._httpRequest(requestObj); } /** * This endpoint allows you to update bank information. * @see https://restdocs.e-conomic.com/#put-self-company-bankinformation * @param {UpdateBankInformationType} updateData * @returns {Promise<HttpResponse<BankInformation>>} */ updateBankInformation(updateData) { const requestObj = { method: "put", url: `/self/company/bankinformation`, data: updateData, }; return this._httpRequest(requestObj); } } exports.default = Self;