UNPKG

e-invoice-api

Version:

The official TypeScript library for the e-invoice API

38 lines 1.64 kB
"use strict"; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. Object.defineProperty(exports, "__esModule", { value: true }); exports.Attachments = void 0; const resource_1 = require("../../core/resource.js"); const uploads_1 = require("../../internal/uploads.js"); const path_1 = require("../../internal/utils/path.js"); class Attachments extends resource_1.APIResource { /** * Get attachment details with for an invoice or credit note with link to download * file (signed URL, valid for 1 hour) */ retrieve(attachmentID, params, options) { const { document_id } = params; return this._client.get((0, path_1.path) `/api/documents/${document_id}/attachments/${attachmentID}`, options); } /** * Get all attachments for an invoice or credit note */ list(documentID, options) { return this._client.get((0, path_1.path) `/api/documents/${documentID}/attachments`, options); } /** * Delete an attachment from an invoice or credit note */ delete(attachmentID, params, options) { const { document_id } = params; return this._client.delete((0, path_1.path) `/api/documents/${document_id}/attachments/${attachmentID}`, options); } /** * Add a new attachment to an invoice or credit note */ add(documentID, body, options) { return this._client.post((0, path_1.path) `/api/documents/${documentID}/attachments`, (0, uploads_1.multipartFormRequestOptions)({ body, ...options }, this._client)); } } exports.Attachments = Attachments; //# sourceMappingURL=attachments.js.map