UNPKG

@montarist/nilvera-api

Version:

An unofficial SDK for integrating with Nilvera e-Invoice, e-Archive services

54 lines (53 loc) 2.64 kB
import { ExportType, OldInvoiceRequest, OldInvoiceResponse, OperationType } from '../constants/types'; import { ApiResponse } from '../types'; import { BaseService } from './base.service'; /** * OldInvoiceService * Service for managing old invoice operations. */ export declare class OldInvoiceService extends BaseService { /** * Lists old invoices. * @param {OldInvoiceRequest} params - Query parameters for listing old invoices * @returns {Promise<ApiResponse<OldInvoiceResponse>>} - Old invoices response with curl command */ listOldInvoices(params?: OldInvoiceRequest): Promise<ApiResponse<OldInvoiceResponse>>; /** * Uploads old invoices. * @param {File} file - File containing old invoices to be uploaded * @returns {Promise<ApiResponse<string>>} - Response message with curl command */ uploadOldInvoices(file: File): Promise<ApiResponse<string>>; /** * Downloads the HTML format of the old invoice. * @param {string} uuid - UUID of the old invoice to get HTML format * @returns {Promise<ApiResponse<string>>} - HTML content of the invoice with curl command */ getOldInvoiceHtml(uuid: string): Promise<ApiResponse<string>>; /** * Downloads the PDF format of the old invoice. * @param {string} uuid - UUID of the old invoice to get PDF format * @returns {Promise<ApiResponse<string>>} - PDF content of the invoice with curl command */ getOldInvoicePdf(uuid: string): Promise<ApiResponse<string>>; /** * Downloads the XML format of the old invoice. * @param {string} uuid - UUID of the old invoice to get XML format * @returns {Promise<ApiResponse<string>>} - XML content of the invoice with curl command */ getOldInvoiceXml(uuid: string): Promise<ApiResponse<string>>; /** * Exports old invoices in bulk. * @param {string[]} uuids - List of UUIDs of invoices to be exported * @param {ExportType} fileType - Export type (Xml, Pdf, OnePagePdf) * @returns {Promise<ApiResponse<string>>} - URL of exported file with curl command */ exportOldInvoices(uuids: string[], fileType: ExportType): Promise<ApiResponse<string>>; /** * Assigns new status to old invoices in bulk. * @param {string[]} uuids - List of UUIDs of invoices to assign status * @param {OperationType} operationType - New operation type (UnPrint, Print) * @returns {Promise<ApiResponse<string[]>>} - List of UUIDs of updated invoices with curl command */ assignNewStatusToOldInvoices(uuids: string[], operationType: OperationType): Promise<ApiResponse<string[]>>; }