UNPKG

@montarist/nilvera-api

Version:

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

95 lines (94 loc) 5.31 kB
import { ArchiveInvoiceModelResponse, CreateBulkDraftInvoiceRequest, CreateDraftEArchiveInvoiceRequest, CreateDraftEArchiveInvoiceResponse, CreateInvoiceModelRequest, DraftEArchiveInvoiceRequest, DraftEArchiveInvoiceResponse, ExportType } from '../constants'; import { ApiResponse } from '../types'; import { BaseService } from './base.service'; /** * EArchiveService * Service for managing e-archive invoice operations. */ export declare class EArchiveService extends BaseService { /** * Lists draft invoices. * @param {DraftInvoiceRequest} params - Query parameters for listing draft invoices * @returns {Promise<ApiResponse<DraftEArchiveInvoiceResponse>>} - Draft invoices response with curl command */ listDraftInvoices(params?: DraftEArchiveInvoiceRequest): Promise<ApiResponse<DraftEArchiveInvoiceResponse>>; /** * Deletes draft invoices in bulk. * @param {string[]} uuids - List of UUIDs of draft invoices to be deleted * @returns {Promise<ApiResponse<boolean>>} - Operation result with curl command */ deleteDraftInvoices(uuids: string[]): Promise<ApiResponse<boolean>>; /** * Downloads the HTML format of the draft invoice. * @param {string} uuid - UUID of the draft invoice to get HTML format * @returns {Promise<ApiResponse<string>>} - HTML content of the draft invoice with curl command */ getDraftInvoiceHtml(uuid: string): Promise<ApiResponse<string>>; /** * Downloads the PDF format of the draft invoice. * @param {string} uuid - UUID of the draft invoice to get PDF format * @returns {Promise<ApiResponse<string>>} - PDF content of the draft invoice (Base64 string) with curl command */ getDraftInvoicePdf(uuid: string): Promise<ApiResponse<string>>; /** * Downloads the XML format of the draft invoice. * @param {string} uuid - UUID of the draft invoice to get XML format * @returns {Promise<ApiResponse<string>>} - XML content of the draft invoice with curl command */ getDraftInvoiceXml(uuid: string): Promise<ApiResponse<string>>; /** * Gets the model information of the draft invoice. * @param {string} uuid - UUID of the draft invoice to get model information * @returns {Promise<ApiResponse<ArchiveInvoiceModelResponse>>} - Model of the draft invoice with curl command */ getDraftInvoiceModel(uuid: string): Promise<ApiResponse<ArchiveInvoiceModelResponse>>; /** * Exports draft 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 documents with curl command */ exportDraftInvoices(uuids: string[], fileType: ExportType): Promise<ApiResponse<string>>; /** * Confirms and sends draft invoices. * @param {string[]} uuids - List of UUIDs of draft invoices to be confirmed and sent * @returns {Promise<ApiResponse<string>>} - Response message with curl command */ confirmAndSendDraftInvoices(uuids: string[]): Promise<ApiResponse<string>>; /** * Creates a new draft invoice. * @param {CreateDraftInvoiceRequest} createDraftRequest - Details of the draft invoice to be created * @returns {Promise<ApiResponse<CreateDraftEArchiveInvoiceResponse>>} - UUID and invoice number of created draft invoice with curl command */ createDraftInvoice(createDraftRequest: CreateDraftEArchiveInvoiceRequest): Promise<ApiResponse<CreateDraftEArchiveInvoiceResponse>>; /** * Creates draft invoices in bulk. * @param {CreateBulkDraftInvoiceRequest} createBulkRequest - Request containing details of bulk draft invoices * @returns {Promise<ApiResponse<string[]>>} - List of UUIDs of successfully created invoices with curl command */ createBulkDraftInvoices(createBulkRequest: CreateBulkDraftInvoiceRequest): Promise<ApiResponse<string[]>>; /** * Creates a new invoice model. * @param {CreateDraftEArchiveInvoiceRequest} createDraftRequest - Details of the draft invoice to be created * @returns {Promise<ApiResponse<CreateDraftEArchiveInvoiceResponse>>} - UUID and invoice number of created draft invoice with curl command */ createInvoiceModel(createInvoiceModelRequest: CreateInvoiceModelRequest): Promise<ApiResponse<CreateDraftEArchiveInvoiceResponse>>; /** * Downloads the HTML format of the invoice. * @param {string} uuid - UUID of the invoice to get HTML format * @returns {Promise<ApiResponse<string>>} - HTML content of the invoice with curl command */ getInvoiceHtml(uuid: string): Promise<ApiResponse<string>>; /** * Downloads the PDF format of the invoice. * @param {string} uuid - UUID of the invoice to get PDF format * @returns {Promise<ApiResponse<Buffer>>} - PDF content of the invoice with curl command */ getInvoicePdf(uuid: string): Promise<ApiResponse<Buffer>>; /** * Downloads the XML format of the invoice. * @param {string} uuid - UUID of the invoice to get XML format * @returns {Promise<ApiResponse<string>>} - XML content of the invoice with curl command */ getInvoiceXml(uuid: string): Promise<ApiResponse<string>>; }