UNPKG

@eleva-io/erp-sdk

Version:

SDK oficial para el ERP de Eleva

37 lines 1.34 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TicketingTaskConversationsAPI = void 0; const http_1 = require("../../../../utils/http"); const utils_1 = require("../../../../utils"); class TicketingTaskConversationsAPI { _httpClient; _baseUrl; _crud; constructor(_httpClient, _baseUrl) { this._httpClient = _httpClient; this._baseUrl = _baseUrl; this._crud = new utils_1.CRUD(this._httpClient, { basePath: this._baseUrl, }); } async create(data, opts) { const path = `${this._baseUrl}`; let headers = undefined; if (opts?.createdBy) { headers = headers || {}; headers[http_1.ELEVA_HEADER_IMPERSONATE] = opts.createdBy; } if (data.attachments) { const attachments = data.attachments; const formData = (0, utils_1.deleteKeys)(data, ['attachments']); formData.files = attachments; return this._httpClient.form(path, formData, 'POST', undefined, headers); } return this._httpClient.post(path, data, undefined, headers); } async find(query) { return this._crud.find(query); } } exports.TicketingTaskConversationsAPI = TicketingTaskConversationsAPI; //# sourceMappingURL=conversations.js.map