UNPKG

gohl

Version:

Go Highlevel Node Js ease of use library implementation to their API

57 lines 2.56 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.OpportunitiesFollowers = void 0; const axios_1 = require("axios"); class OpportunitiesFollowers { /** * Endpoints For Opportunities Followers * https://highlevel.stoplight.io/docs/integrations/a4853ad9d0a48-add-followers */ constructor(authData) { this.authData = authData; } /** * Add Followers * Documentation - https://highlevel.stoplight.io/docs/integrations/a4853ad9d0a48-add-followers * @param opportunityId * @param data * @returns */ add(opportunityId, data) { return __awaiter(this, void 0, void 0, function* () { var _a, _b; const headers = (_a = this.authData) === null || _a === void 0 ? void 0 : _a.headers; const response = yield axios_1.default.post(`${(_b = this.authData) === null || _b === void 0 ? void 0 : _b.baseurl}/opportunities/${opportunityId}/followers`, data, { headers }); return response.data; }); } /** * Remove Followers * Documentation - https://highlevel.stoplight.io/docs/integrations/0412c261ca64b-remove-followers * @param opportunityId * @param data * @returns */ remove(opportunityId, data) { return __awaiter(this, void 0, void 0, function* () { var _a, _b; const headers = (_a = this.authData) === null || _a === void 0 ? void 0 : _a.headers; const response = yield axios_1.default.delete(`${(_b = this.authData) === null || _b === void 0 ? void 0 : _b.baseurl}/opportunities/${opportunityId}/followers`, { headers, data }); return response.data; }); } } exports.OpportunitiesFollowers = OpportunitiesFollowers; //# sourceMappingURL=opportunities.followers.js.map