UNPKG

@eleva-io/erp-sdk

Version:

SDK oficial para el ERP de Eleva

33 lines 1.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MeetingDocumentsAPI = void 0; class MeetingDocumentsAPI { _httpClient; _basePath; constructor(_httpClient, _basePath) { this._httpClient = _httpClient; this._basePath = _basePath; } async find(query) { return this._httpClient.get(this._basePath, { query, }); } async download(documentId) { return this._httpClient.get(`${this._basePath}/${documentId}/download`, { responseType: 'blob', }); } async createAttachment(file) { const formData = new FormData(); formData.append('file', file); return this._httpClient.post(`${this._basePath.replace('/documents', '/attachments')}`, { body: formData, }); } async deleteAttachment(documentId) { return this._httpClient.delete(`${this._basePath.replace('/documents', '/attachments')}/${documentId}`); } } exports.MeetingDocumentsAPI = MeetingDocumentsAPI; //# sourceMappingURL=documents.js.map