UNPKG

@montarist/nilvera-api

Version:

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

103 lines (102 loc) 5.73 kB
import { CreateBulkDraftRequest, CreateDraftRequest, CreateDraftResponse, CreateEInvoiceModelRequest, CreateEInvoiceModelResponse, DraftConfirmRequest, DraftModelResponse, DraftRequest, DraftResponse, EditAndSendDraftRequest, EditAndSendDraftResponse, ExportType, OperationType, TagInfo } from '../constants/types'; import { ApiResponse } from '../types'; import { BaseService } from './base.service'; /** * EInvoiceService * Service for managing draft e-invoice operations. */ export declare class EInvoiceService extends BaseService { /** * Lists draft invoices by sending a request to the API. * @param {DraftRequest} params - Query parameters * @returns {Promise<ApiResponse<DraftResponse>>} - Draft invoice response with curl command */ listDrafts(params?: DraftRequest): Promise<ApiResponse<DraftResponse>>; /** * Sends a request to the API to delete draft invoices. * @param {string[]} uuids - List of UUIDs of draft invoices to be deleted * @returns {Promise<ApiResponse<boolean>>} - Operation result with curl command */ deleteDrafts(uuids: string[]): Promise<ApiResponse<boolean>>; /** * Downloads the HTML format of the draft. * @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 */ getDraftHtml(uuid: string): Promise<ApiResponse<string>>; /** * Downloads the PDF format of the draft. * @param {string} uuid - UUID of the draft invoice to get PDF format * @returns {Promise<ApiResponse<Blob>>} - PDF content of the draft invoice with curl command */ getDraftPdf(uuid: string): Promise<ApiResponse<Blob>>; /** * Downloads the XML format of the draft. * @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 */ getDraftXml(uuid: string): Promise<ApiResponse<string>>; /** * Gets the model information of the draft. * @param {string} uuid - UUID of the draft invoice to get model information * @returns {Promise<ApiResponse<DraftModelResponse>>} - Model of the draft invoice with curl command */ getDraftModel(uuid: string): Promise<ApiResponse<DraftModelResponse>>; /** * Assigns tags to a draft invoice. * @param {string} documentUUID - UUID of the draft invoice to assign tags * @param {string[]} tagUUIDs - List of tag UUIDs to be assigned * @returns {Promise<ApiResponse<boolean>>} - Operation result with curl command */ assignTagToDraft(documentUUID: string, tagUUIDs: string[]): Promise<ApiResponse<boolean>>; /** * Gets the tag information of a draft invoice. * @param {string} documentUUID - UUID of the draft invoice to get tag information * @returns {Promise<ApiResponse<TagInfo[]>>} - List of tag information with curl command */ getDraftTags(documentUUID: string): Promise<ApiResponse<TagInfo[]>>; /** * Exports draft invoices in bulk. * @param {string[]} uuids - List of UUIDs of draft invoices to be exported * @param {ExportType} fileType - Requested file type * @returns {Promise<ApiResponse<string>>} - Exported file URL with curl command */ exportDrafts(uuids: string[], fileType: ExportType): Promise<ApiResponse<string>>; /** * Assigns new status to draft invoices. * @param {string[]} uuids - List of UUIDs of draft invoices to assign status * @param {OperationType} operationType - New operation type * @returns {Promise<ApiResponse<boolean>>} - Operation result with curl command */ assignNewStatusToDrafts(uuids: string[], operationType: OperationType): Promise<ApiResponse<boolean>>; /** * Confirms and sends draft invoices. * @param {DraftConfirmRequest[]} drafts - Information of draft invoices to be sent * @returns {Promise<ApiResponse<string[]>>} - Response in case of success with curl command */ confirmAndSendDrafts(drafts: DraftConfirmRequest[]): Promise<ApiResponse<string[]>>; /** * Edits and sends a draft. * @param {EditAndSendDraftRequest} editAndSendRequest - Request containing draft information to be edited * @returns {Promise<ApiResponse<EditAndSendDraftResponse>>} - Response in case of success with curl command */ editAndSendDraft(editAndSendRequest: EditAndSendDraftRequest): Promise<ApiResponse<EditAndSendDraftResponse>>; /** * Creates a new draft invoice. * @param {CreateDraftRequest} createDraftRequest - Draft invoice creation request * @returns {Promise<ApiResponse<CreateDraftResponse>>} - Information of the created draft invoice with curl command */ createDraft(createDraftRequest: CreateDraftRequest): Promise<ApiResponse<CreateDraftResponse>>; /** * Creates a new invoice model. * @param {CreateDraftEArchiveInvoiceRequest} createDraftRequest - Details of the draft invoice to be created * @returns {Promise<ApiResponse<string>>} - UUID and invoice number of created draft invoice with curl command */ createEInvoiceModel(createEInvoiceModelRequest: CreateEInvoiceModelRequest): Promise<ApiResponse<CreateEInvoiceModelResponse>>; /** * Creates draft invoices in bulk. * @param {CreateBulkDraftRequest} createBulkDraftRequest - Request containing details of bulk draft invoices * @returns {Promise<ApiResponse<string[]>>} - List of UUIDs of successfully created draft invoices with curl command */ createBulkDraft(createBulkDraftRequest: CreateBulkDraftRequest): Promise<ApiResponse<string[]>>; }