import { G as GenerateCollectiveIdentifierRequest, a as GenerateCollectiveIdentifierResponse, C as CollectiveIdentifiersQueryRequest, b as CollectiveIdentifiersQueryResponse, c as CollectiveIdentifiersQueryResponseItem, d as CollectiveIdentifierInvoicesQueryResponse, e as CollectiveIdentifierInvoicesQueryResponseItem, f as CollectiveIdentifiersByKsefNumberQueryResponse, g as CollectiveIdentifiersByKsefNumberQueryResponseItem, I as InvoiceXmlInput, h as CurrencyCode, i as CollectiveIdentifierInvoice } from './index-CpPv0jyW.cjs'; export { b7 as AdditionalDescription, aV as Address, aO as AdvanceCorrectionInvoiceBuilder, aM as AdvanceInvoiceBuilder, bd as AdvancePayment, S as Annotation, b6 as AnnotationSet, T as Attachment, V as AttachmentBlock, W as AttachmentTable, aY as AuthorizedPartyRole, Y as BankAccount, aT as BaseFA3Builder, aJ as BasicInvoiceBuilder, bY as CollectiveIdentifierInvoicesQueryRequest, aW as Contact, Z as Contract, bb as CorrectedAdvanceState, aL as CorrectionInvoiceBuilder, _ as CorrectionReference, bf as CorrectionType, bM as CoverageStatus, bN as CoverageStatusValue, b2 as Discount, bn as EnumValue, bc as ExciseRefund, aB as FA3AdditionalDescriptionSection, ai as FA3Address, ap as FA3AdvancePayment, ao as FA3AdvanceReference, aD as FA3AttachmentBlockSection, aE as FA3AttachmentSection, aC as FA3AttachmentTableSection, at as FA3BankAccount, aR as FA3BatchDraft, aj as FA3Contact, aw as FA3ContractSection, ae as FA3CorrectionType, an as FA3Discount, aG as FA3Draft, aF as FA3DraftInput, bF as FA3ImportError, bE as FA3ImportResult, bG as FA3Importer, bD as FA3InvalidRow, aQ as FA3Invoice, aI as FA3InvoiceBuilder, $ as FA3InvoiceKind, a0 as FA3Line, af as FA3MarginProcedure, ax as FA3OrderLineSection, ay as FA3OrderSection, as as FA3PartialPayment, a1 as FA3Party, al as FA3PartyIdentifier, ak as FA3PartyIdentifierKind, au as FA3PaymentDueDescription, ad as FA3PaymentMethod, av as FA3PaymentTerms, ar as FA3Settlement, aq as FA3SettlementAdjustment, am as FA3TaxCategory, bI as FA3Template, ah as FA3ThirdPartyRole, aA as FA3TransactionTermsSection, ag as FA3TransportKind, az as FA3TransportSection, a2 as FA3ValidationIssue, aU as FA3ValidationResult, bu as FA3XmlValidationError, be as FA3_FORM_VARIANT, bo as FaVatBucketKey, x as FakturaInput, F as FakturaSchema, w as FakturaXmlOptions, b9 as Footer, bk as GTUCode, bB as ImportMode, bC as ImportModeValue, b3 as InvoiceLine, a_ as InvoiceParty, l as KsefApiError, K as KsefApiProblem, n as KsefAuthStatusError, j as KsefError, k as KsefHttpError, m as KsefRateLimitError, p as KsefSessionExpiredError, q as KsefValidationError, bV as Libxml, a3 as LineIdentifiers, bi as LineProcedure, bm as MarginProcedure, a4 as NewTransportMeans, o as OpenApiModels, a5 as Order, a6 as OrderLine, bj as OrderLineProcedure, b4 as PartialPayment, a$ as Party, aZ as PartyIdentifier, L as PartyIdentifierKind, Q as PartyIdentifierKindValue, ba as PaymentDue, bg as PaymentMethod, a7 as PaymentTerms, P as PefSchema, B as PefUblCreditNoteInput, D as PefUblDocumentInput, A as PefUblInvoiceInput, a8 as RawXmlExtension, b8 as Registry, R as ResolvedPartyIdentifier, a9 as Settlement, b5 as SettlementAdjustment, aP as SettlementCorrectionInvoiceBuilder, aN as SettlementInvoiceBuilder, aK as SimplifiedInvoiceBuilder, b0 as TaxCategory, bs as TaxSummary, bp as TaxSummaryRow, aX as ThirdPartyRole, aa as TransactionTerms, ab as Transport, bl as TransportKind, U as UnknownApiProblem, ac as ValidationContext, b1 as VatClass, bh as VatRateCode, X as XmlDocument, s as XmlObject, r as XmlValue, bO as XsdCoverageEntry, bP as XsdCoverageReport, bJ as XsdElement, bQ as auditFa3XsdCoverage, bR as audit_fa3_xsd_coverage, z as buildFakturaXml, H as buildPefXml, u as buildXml, v as buildXmlFromObject, J as fa3, bq as faVatBucketForCode, by as invoiceToXml, bz as invoice_to_xml, E as isPefUblDocumentInput, bT as loadFa3SchemaWithLocalImports, bW as loadLibxml, N as mapPartyIdentityToXml, bK as parseFa3XsdElements, t as parseXml, bL as parse_fa3_xsd_elements, bS as resolveFa3SchemaEntryPath, O as resolvePartyIdentifier, br as resolveVatRateCode, aS as sanitizeFileName, y as serializeInvoiceXml, bt as taxSummaryToFaFields, bH as toBatchDraft, bv as toFa3XmlValidationMessage, aH as validateAndReturnXml, bx as validateFa3Xml, bU as validateFa3XmlWithParser, bw as validateFa3XmlWithValidator, bX as validateFa3XmlXsd, M as validatePartyIdentifier, bA as validate_fa3_xml_xsd } from './index-CpPv0jyW.cjs'; import crypto from 'node:crypto'; type JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue; }; type JsonObject = { [key: string]: JsonValue; }; type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; type KsefEnvironment = "TEST" | "DEMO" | "PRD"; type KsefLighthouseEnvironment = "TEST" | "PROD" | "PRD"; declare const KSEF_ENV_URLS: Record; declare const KSEF_LIGHTHOUSE_URLS: Record; declare const KSEF_LIGHTHOUSE_ENV_BY_KSEF_ENV: Record; declare const KSEF_QR_URLS: Record; type ContextIdentifierType = "Nip" | "InternalId" | "NipVatUe" | "PeppolId"; interface ContextIdentifier { type: ContextIdentifierType; value: string; } interface StatusInfo { code: number; description: string; details?: string[]; } interface TokenInfo { token: string; validUntil: string; } interface AuthenticationTokensResponse { accessToken: TokenInfo; refreshToken: TokenInfo; } interface AuthenticationInitResponse { referenceNumber: string; authenticationToken: TokenInfo; } type AuthenticationMethodCategory = "XadesSignature" | "NationalNode" | "Token" | "Other"; type AuthenticationMethod = "Token" | "TrustedProfile" | "InternalCertificate" | "QualifiedSignature" | "QualifiedSeal" | "PersonalSignature" | "PeppolSignature"; interface AuthenticationMethodInfo { category: AuthenticationMethodCategory; code: string; displayName: string; } interface AuthenticationListItem { startDate: string; /** * @deprecated Use `authenticationMethodInfo` instead. */ authenticationMethod: AuthenticationMethod; authenticationMethodInfo: AuthenticationMethodInfo; status: StatusInfo; isTokenRedeemed?: boolean; lastTokenRefreshDate?: string | null; refreshTokenValidUntil?: string | null; referenceNumber: string; isCurrent?: boolean; } interface AuthenticationListResponse { continuationToken?: string; items: AuthenticationListItem[]; } interface AuthenticationOperationStatusResponse { startDate: string; authenticationMethodInfo: AuthenticationMethodInfo; /** * @deprecated Use `authenticationMethodInfo` instead. */ authenticationMethod: AuthenticationMethod; status: StatusInfo; isTokenRedeemed?: boolean; lastTokenRefreshDate?: string | null; refreshTokenValidUntil?: string | null; } interface EncryptionInfo { encryptedSymmetricKey: string; initializationVector: string; } interface FileMetadata { hashSha256Base64: string; fileSize: number; } interface FormCode { systemCode: string; schemaVersion: string; value: string; } interface Fa2FormCode extends FormCode { systemCode: "FA (2)"; schemaVersion: "1-0E"; value: "FA"; } interface Fa3FormCode extends FormCode { systemCode: "FA (3)"; schemaVersion: "1-0E"; value: "FA"; } interface Pef3FormCode extends FormCode { systemCode: "PEF (3)"; schemaVersion: "2-1"; value: "PEF"; } interface PefKor3FormCode extends FormCode { systemCode: "PEF_KOR (3)"; schemaVersion: "2-1"; value: "PEF"; } interface FaRr1LegacyFormCode extends FormCode { systemCode: "FA_RR (1)"; schemaVersion: "1-0E"; value: "RR"; } interface FaRr1TransitionFormCode extends FormCode { systemCode: "FA_RR (1)"; schemaVersion: "1-1E"; value: "RR"; } interface FaRr1FormCode extends FormCode { systemCode: "FA_RR (1)"; schemaVersion: "1-1E"; value: "FA_RR"; } type AnyFaRr1FormCode = FaRr1LegacyFormCode | FaRr1TransitionFormCode | FaRr1FormCode; type OnlineSessionFormCode = Fa2FormCode | Fa3FormCode | Pef3FormCode | PefKor3FormCode | AnyFaRr1FormCode; type BatchSessionFormCode = Fa2FormCode | Fa3FormCode | AnyFaRr1FormCode; interface AuthorizationPolicy { allowedIps?: { ip4Addresses?: string[]; ip4Masks?: string[]; ip4Ranges?: string[]; }; } interface HttpClientOptions { baseUrl: string; appendV2?: boolean; timeoutMs?: number; defaultHeaders?: Record; proxy?: string; noProxy?: string; retryOn429?: boolean; retryOn5xx?: boolean; retryOnTimeout?: boolean; maxRetryAttempts?: number; maxRetryDelayMs?: number; strictPresignedUrlValidation?: boolean; allowedPresignedHosts?: string[]; allowPrivateNetworkPresignedUrls?: boolean; systemWarningHandler?: (warning: string) => void; } interface RetryOptions { retryOn429?: boolean; retryOn5xx?: boolean; retryOnTimeout?: boolean; maxAttempts?: number; } interface HttpRequestOptions { method: HttpMethod; path: string; query?: Record | undefined | null>; headers?: Record; body?: JsonObject | Record | object | string | Buffer | Uint8Array; responseType?: "json" | "text" | "buffer"; authToken?: string; skipAuth?: boolean; retry?: RetryOptions; } declare class HttpClient { private readonly baseUrl; private readonly timeoutMs; private readonly defaultHeaders; private readonly proxy; private readonly noProxy; private readonly retryOn429; private readonly retryOn5xx; private readonly retryOnTimeout; private readonly maxRetryAttempts; private readonly maxRetryDelayMs; private readonly strictPresignedUrlValidation; private readonly allowedPresignedHosts; private readonly allowPrivateNetworkPresignedUrls; private readonly systemWarningHandler; constructor(options: HttpClientOptions); request(options: HttpRequestOptions): Promise; private resolveRetryPolicy; private validateSkipAuthOptions; private buildUrl; private getDispatcher; private handleResponse; private throwForError; private notifySystemWarning; } declare class BaseClient { protected readonly http: HttpClient; protected readonly accessTokenProvider: (() => Promise) | undefined; constructor(http: HttpClient, accessTokenProvider?: () => Promise); protected getAccessToken(): Promise; } declare class ActiveSessionsClient extends BaseClient { listActiveSessions(pageSize?: number, continuationToken?: string): Promise; revokeCurrentSession(): Promise; revokeSession(referenceNumber: string): Promise; } interface AuthChallengeResponse { challenge: string; clientIp: string; timestamp: string; timestampMs: number; } interface InitTokenAuthenticationRequest { challenge: string; contextIdentifier: ContextIdentifier; encryptedToken: string; authorizationPolicy?: AuthorizationPolicy | null; } interface InitXadesAuthenticationRequest { signedXml: string; } interface RefreshTokenResponse { accessToken: TokenInfo; } interface AuthTokenRequestContextIdentifier { type: string; value: string; } interface AuthTokenRequest { challenge: string; contextIdentifier: AuthTokenRequestContextIdentifier; encryptedToken: string; authorizationPolicy?: AuthorizationPolicy | null; } interface AuthXadesRequest { signedXml: string; } interface AuthTokenRedeemResponse { accessToken: TokenInfo; refreshToken: TokenInfo; } type AuthAnyResponse = JsonObject; declare class AuthClient extends BaseClient { getChallenge(): Promise; authenticateWithKsefToken(request: InitTokenAuthenticationRequest): Promise; authenticateWithXadesSignature(signedXml: string, verifyCertificateChain?: boolean, enforceXadesCompliance?: boolean): Promise; getAuthStatus(referenceNumber: string, authenticationToken: string): Promise; redeemToken(authenticationToken: string): Promise; refreshAccessToken(refreshToken: string): Promise; } type CertificateEnrollmentRequest = JsonObject; type CertificateEnrollmentResponse = JsonObject; type CertificateEnrollmentStatusResponse = JsonObject; type CertificateLimitsResponse = JsonObject; type CertificatesQueryRequest = JsonObject; type CertificatesQueryResponse = JsonObject; type CertificatesRetrieveRequest = JsonObject; type CertificatesRetrieveResponse = JsonObject; type CertificateRevokeRequest = JsonObject; declare class CertificatesClient extends BaseClient { getCertificateLimits(): Promise; getEnrollmentData(): Promise>; createEnrollment(request: CertificateEnrollmentRequest): Promise; getEnrollmentStatus(referenceNumber: string): Promise; queryCertificates(request: CertificatesQueryRequest, pageOffset?: number, pageSize?: number): Promise; retrieveCertificates(request: CertificatesRetrieveRequest): Promise; revokeCertificate(certificateSerialNumber: string, request?: CertificateRevokeRequest): Promise; } interface CollectiveIdentifiersPagingOptions { pageSize?: number; continuationToken?: string; } interface CollectiveIdentifiersQueryByCreatedRangeOptions extends CollectiveIdentifiersPagingOptions { collectiveIdentifierNumber?: string; createdInCurrentContext?: boolean; invoiceCountFrom?: number; invoiceCountTo?: number; } interface CollectiveIdentifiersGenerateForNumbersOptions { descriptions?: Array; } interface CollectiveIdentifiersIterateOptions { pageSize?: number; } declare class CollectiveIdentifiersClient extends BaseClient { generate(request: GenerateCollectiveIdentifierRequest): Promise; generateForKsefNumbers(ksefNumbers: readonly string[], options?: CollectiveIdentifiersGenerateForNumbersOptions): Promise; query(request: CollectiveIdentifiersQueryRequest, options?: CollectiveIdentifiersPagingOptions): Promise; queryByCreatedRange(dateFrom: string, dateTo: string, options?: CollectiveIdentifiersQueryByCreatedRangeOptions): Promise; iterQuery(request: CollectiveIdentifiersQueryRequest, options?: CollectiveIdentifiersIterateOptions): AsyncGenerator; listInvoices(collectiveIdentifierNumbers: string | readonly string[], options?: CollectiveIdentifiersPagingOptions): Promise; iterInvoices(collectiveIdentifierNumbers: string | readonly string[], options?: CollectiveIdentifiersIterateOptions): AsyncGenerator; listByKsefNumber(ksefNumber: string, options?: CollectiveIdentifiersPagingOptions): Promise; iterByKsefNumber(ksefNumber: string, options?: CollectiveIdentifiersIterateOptions): AsyncGenerator; } type IsoDateString = `${number}-${number}-${number}`; type IsoDateTimeString = `${number}-${number}-${number}T${string}`; type IsoDateInput = IsoDateString | IsoDateTimeString; interface InvoiceDateRangeFilter extends JsonObject { dateType: string; from: IsoDateInput; to?: IsoDateInput | null; restrictToPermanentStorageHwmDate?: boolean | null; } interface InvoiceQueryFilters extends JsonObject { subjectType: string; dateRange: InvoiceDateRangeFilter; } interface InvoiceExportRequest { encryption: EncryptionInfo; filters: InvoiceQueryFilters; onlyMetadata?: boolean; compressionType?: "Zip" | "TarGz" | null; /** * @deprecated Use `onlyMetadata` instead. */ includeMetadata?: boolean; } interface InvoiceExportInitResponse { referenceNumber: string; } interface InvoiceExportStatusResponse { status: StatusInfo; completedDate?: string | null; packageExpirationDate?: string | null; package?: InvoicePackage | null; } interface InvoicePackage { invoiceCount: number; size: number; parts: InvoicePackagePart[]; isTruncated: boolean; compressionType?: "Zip" | "TarGz" | null; lastIssueDate?: string | null; lastInvoicingDate?: string | null; lastPermanentStorageDate?: string | null; permanentStorageHwmDate?: string | null; } interface InvoicePackagePart { ordinalNumber: number; partName: string; method: string; url: string; partSize: number; partHash: string; encryptedPartSize: number; encryptedPartHash: string; expirationDate: string; } type InvoiceMetadataResponse = JsonObject; declare const INVOICE_QUERY_MAX_RANGE_DAYS = 100; declare function normalizeInvoiceQueryFilters(filters: InvoiceQueryFilters): InvoiceQueryFilters; declare function validateInvoiceQueryFilters(filters: InvoiceQueryFilters): void; declare class InvoicesClient extends BaseClient { getInvoice(ksefNumber: string): Promise; queryInvoiceMetadata(filters: InvoiceQueryFilters, pageOffset?: number, pageSize?: number, sortOrder?: "Asc" | "Desc"): Promise; exportInvoices(request: InvoiceExportRequest): Promise; getInvoiceExportStatus(referenceNumber: string): Promise; } type LighthouseMessageCategory = "FAILURE" | "TOTAL_FAILURE" | "MAINTENANCE"; type LighthouseMessageType = "FAILURE_START" | "FAILURE_END" | "MAINTENANCE_ANNOUNCEMENT"; type LighthouseStatusCode = "AVAILABLE" | "MAINTENANCE" | "FAILURE" | "TOTAL_FAILURE"; interface LighthouseMessage { id: string; eventId: number; category: LighthouseMessageCategory; type: LighthouseMessageType; title: string; text: string; start: string; end?: string; version: number; published: string; } interface LighthouseStatusResponse { status: LighthouseStatusCode; messages?: LighthouseMessage[] | null; } declare class LighthouseClient extends BaseClient { private readonly baseUrl; constructor(http: HttpClient, baseUrl: string); getStatus(): Promise; getMessages(): Promise; private requireBaseUrl; } type LimitsContextResponse = JsonObject; type LimitsSubjectResponse = JsonObject; type RateLimitsResponse = JsonObject; type LimitsChangeRequest = JsonObject; declare class LimitsClient extends BaseClient { getContextLimits(): Promise; getSubjectLimits(): Promise; getRateLimits(): Promise; changeContextSessionLimits(request: LimitsChangeRequest): Promise; restoreContextSessionLimits(): Promise; changeSubjectCertificateLimits(request: LimitsChangeRequest): Promise; restoreSubjectCertificateLimits(): Promise; changeRateLimits(request: LimitsChangeRequest): Promise; restoreRateLimits(): Promise; setRateLimitsProduction(request: LimitsChangeRequest): Promise; } type PeppolProvidersResponse = JsonObject; declare class PeppolClient extends BaseClient { queryProviders(pageOffset?: number, pageSize?: number): Promise; } type EntityPermissionsContextIdentifierType = "Nip" | "InternalId"; interface EntityPermissionsContextIdentifier { type: EntityPermissionsContextIdentifierType; value: string; } type EntityPermissionItemScope = "InvoiceWrite" | "InvoiceRead"; interface EntityPermissionItem { id: string; contextIdentifier: EntityPermissionsContextIdentifier; permissionScope: EntityPermissionItemScope; description: string; startDate: string; canDelegate: boolean; } interface EntityPermissionsQueryRequest { contextIdentifier?: EntityPermissionsContextIdentifier | null; } interface QueryEntityPermissionsResponse { permissions: EntityPermissionItem[]; hasMore: boolean; } type PermissionsGrantRequest = JsonObject; type PermissionsQueryRequest = JsonObject; type PermissionsOperationResponse = JsonObject; type PermissionsListResponse = JsonObject; interface PermissionsQueryPaging { pageOffset?: number | undefined; pageSize?: number | undefined; } declare class PermissionsClient extends BaseClient { grantAuthorizations(request: PermissionsGrantRequest): Promise; grantEntities(request: PermissionsGrantRequest): Promise; grantEuEntitiesAdministration(request: PermissionsGrantRequest): Promise; grantEuEntities(request: PermissionsGrantRequest): Promise; grantIndirect(request: PermissionsGrantRequest): Promise; grantPersons(request: PermissionsGrantRequest): Promise; grantSubunits(request: PermissionsGrantRequest): Promise; revokeAuthorizationGrant(permissionId: string): Promise; revokeCommonGrant(permissionId: string): Promise; queryAuthorizations(request: PermissionsQueryRequest, pageOffset?: number, pageSize?: number): Promise; queryEntitiesRoles(pageOffset?: number, pageSize?: number): Promise; queryEntitiesGrants(request: EntityPermissionsQueryRequest, pageOffset?: number, pageSize?: number): Promise; queryEuEntitiesGrants(request: PermissionsQueryRequest, pageOffset?: number, pageSize?: number): Promise; queryPersonalGrants(request: PermissionsQueryRequest, pageOffset?: number, pageSize?: number): Promise; queryPersonsGrants(request: PermissionsQueryRequest, pageOffset?: number, pageSize?: number): Promise; querySubordinateEntitiesRoles(request: PermissionsQueryRequest, pageOffset?: number, pageSize?: number): Promise; querySubunitsGrants(request: PermissionsQueryRequest, pageOffset?: number, pageSize?: number): Promise; getAttachmentPermissionStatus(): Promise; getOperationStatus(referenceNumber: string): Promise; private postOperation; private deleteOperation; private postQuery; private getQuery; } interface PublicKeyCertificate { certificate: string; validFrom: string; validTo: string; usage: Array<"KsefTokenEncryption" | "SymmetricKeyEncryption">; } declare class SecurityClient extends BaseClient { getPublicKeyCertificates(): Promise; } interface OpenOnlineSessionRequest { formCode: OnlineSessionFormCode; encryption: EncryptionInfo; } interface OpenOnlineSessionResponse { referenceNumber: string; validUntil: string; } interface SendInvoiceRequest { invoiceHash: string; invoiceSize: number; encryptedInvoiceHash: string; encryptedInvoiceSize: number; encryptedInvoiceContent: string; offlineMode?: boolean; hashOfCorrectedInvoice?: string | null; } interface SendInvoiceResponse { referenceNumber: string; } interface OpenBatchSessionRequest { formCode: BatchSessionFormCode; batchFile: { fileSize: number; fileHash: string; fileParts: Array<{ ordinalNumber: number; fileSize: number; fileHash: string; }>; }; encryption: EncryptionInfo; offlineMode?: boolean; } interface PartUploadRequest { ordinalNumber: number; method: string; url: string; headers: Record; } interface OpenBatchSessionResponse { referenceNumber: string; partUploadRequests: PartUploadRequest[]; } interface SessionStatusResponse { status: StatusInfo; invoiceCount: number; successfulInvoiceCount: number; failedInvoiceCount: number; upo?: { pages: Array<{ referenceNumber: string; downloadUrl: string; }>; }; } type SessionType = "Online" | "Batch"; type SessionStatus = "Succeeded" | "InProgress" | "Failed" | "Cancelled"; interface GetSessionsQueryParams { sessionType: SessionType; referenceNumber?: string; dateCreatedFrom?: string; dateCreatedTo?: string; dateClosedFrom?: string; dateClosedTo?: string; dateModifiedFrom?: string; dateModifiedTo?: string; statuses?: SessionStatus[]; pageSize?: number; } type SessionsListResponse = JsonObject; type SessionInvoicesResponse = JsonObject; type SessionInvoiceStatusResponse = JsonObject; type SessionFailedInvoicesResponse = JsonObject; declare class SessionsClient extends BaseClient { getSessions(query: GetSessionsQueryParams, continuationToken?: string): Promise; getSessionStatus(referenceNumber: string): Promise; getSessionInvoices(referenceNumber: string, pageOffset?: number, pageSize?: number, continuationToken?: string): Promise; getSessionInvoiceStatus(referenceNumber: string, invoiceReferenceNumber: string): Promise; getSessionInvoiceUpoByReferenceNumber(referenceNumber: string, invoiceReferenceNumber: string): Promise; getSessionInvoiceUpoByKsefNumber(referenceNumber: string, ksefNumber: string): Promise; getSessionUpo(referenceNumber: string, upoReferenceNumber: string): Promise; getSessionFailedInvoices(referenceNumber: string, pageSize?: number, continuationToken?: string): Promise; openOnlineSession(request: OpenOnlineSessionRequest, upoV43?: boolean): Promise; sendOnlineInvoice(referenceNumber: string, request: SendInvoiceRequest): Promise; closeOnlineSession(referenceNumber: string): Promise; openBatchSession(request: OpenBatchSessionRequest, upoV43?: boolean): Promise; closeBatchSession(referenceNumber: string): Promise; } type TestdataRequest = JsonObject; type TestdataResponse = JsonObject; type TestDataAuthenticationContextIdentifierType = "Nip" | "InternalId" | "NipVatUe" | "PeppolId"; interface TestDataAuthenticationContextIdentifier { type: TestDataAuthenticationContextIdentifierType; value: string; } interface TestDataContextBlockRequest { contextIdentifier?: TestDataAuthenticationContextIdentifier | null; } type TestDataContextBlockResponse = JsonObject; interface TestDataContextUnblockRequest { contextIdentifier?: TestDataAuthenticationContextIdentifier | null; } type TestDataContextUnblockResponse = JsonObject; interface TestDataUpdateCertificateRequest { validTo: string; } declare class TestdataClient extends BaseClient { enableAttachments(request: TestdataRequest): Promise; revokeAttachments(request: TestdataRequest): Promise; grantPermissions(request: TestdataRequest): Promise; revokePermissions(request: TestdataRequest): Promise; blockContext(request: TestDataContextBlockRequest): Promise; unblockContext(request: TestDataContextUnblockRequest): Promise; createPerson(request: TestdataRequest): Promise; removePerson(request: TestdataRequest): Promise; createSubject(request: TestdataRequest): Promise; removeSubject(request: TestdataRequest): Promise; updateCertificate(serialNumber: string, request: TestDataUpdateCertificateRequest): Promise; private post; } type TokenPermissionType = "CollectiveIdentifierManage" | "InvoiceRead" | "InvoiceWrite" | "CredentialsRead" | "CredentialsManage" | "SubunitManage" | "EnforcementOperations" | "Introspection"; type KsefTokenStatus = "Pending" | "Active" | "Revoking" | "Revoked" | "Failed"; type KsefTokenAuthorIdentifierType = "Nip" | "Pesel" | "Fingerprint"; type KsefTokenContextIdentifierType = "Nip" | "InternalId" | "NipVatUe" | "PeppolId"; interface TokenAuthorIdentifier { type: KsefTokenAuthorIdentifierType; value: string; } interface TokenContextIdentifier { type: KsefTokenContextIdentifierType; value: string; } interface GenerateTokenRequest { description: string; permissions: TokenPermissionType[]; } interface GenerateTokenResponse { referenceNumber: string; token: string; } interface TokenStatusResponse { referenceNumber: string; authorIdentifier: TokenAuthorIdentifier; contextIdentifier: TokenContextIdentifier; description: string; requestedPermissions: TokenPermissionType[]; dateCreated: string; lastUseDate?: string | null; status: KsefTokenStatus; statusDetails?: string[] | null; } interface QueryTokensResponseItem { referenceNumber: string; authorIdentifier: TokenAuthorIdentifier; contextIdentifier: TokenContextIdentifier; description: string; requestedPermissions: TokenPermissionType[]; dateCreated: string; lastUseDate?: string | null; status: KsefTokenStatus; statusDetails?: string[] | null; } interface QueryTokensResponse { continuationToken?: string | null; tokens: QueryTokensResponseItem[]; } type KsefTokenRequest = GenerateTokenRequest; type KsefTokenResponse = GenerateTokenResponse | TokenStatusResponse; type KsefTokensListResponse = QueryTokensResponse; interface KsefTokensListQueryParams { status?: KsefTokenStatus[]; description?: string; authorIdentifier?: string; authorIdentifierType?: KsefTokenAuthorIdentifierType; pageSize?: number; } declare class TokensClient extends BaseClient { listTokens(params?: KsefTokensListQueryParams, continuationToken?: string): Promise; generateToken(request: GenerateTokenRequest): Promise; getToken(referenceNumber: string): Promise; revokeToken(referenceNumber: string): Promise; } interface XadesPemKeyPairOptions { certificatePem: string; privateKeyPem: string; privateKeyPassword?: string; } interface XadesPemKeyPairFilesOptions { certificatePath: string; privateKeyPath: string; privateKeyPassword?: string; } interface XadesPkcs12KeyPairOptions { pkcs12Bytes: Uint8Array; pkcs12Password?: string; } interface XadesPkcs12KeyPairFileOptions { pkcs12Path: string; pkcs12Password?: string; } declare class XadesKeyPair { readonly certificatePem: string; readonly privateKey: crypto.KeyObject; readonly certificateChainPem: readonly string[]; private constructor(); static fromPem(options: XadesPemKeyPairOptions): XadesKeyPair; static fromPemFiles(options: XadesPemKeyPairFilesOptions): XadesKeyPair; static fromPkcs12(options: XadesPkcs12KeyPairOptions): Promise; static fromPkcs12File(options: XadesPkcs12KeyPairFileOptions): Promise; } interface SignXadesEnvelopedOptions { xml: string; keyPair: XadesKeyPair; signatureId?: string; signedPropertiesId?: string; signingTime?: Date; signingTimeSkewMs?: number; } declare class XadesSignatureService { signXadesEnveloped(options: SignXadesEnvelopedOptions): string; signXadesEnveloping(options: SignXadesEnvelopedOptions): string; } interface AuthenticateWithKsefTokenOptions { token: string; context: ContextIdentifier; authorizationPolicy?: AuthorizationPolicy; publicCertificateBase64Der?: string; encryptionMethod?: "rsa" | "ec"; ecOutputFormat?: "java" | "csharp"; pollIntervalMs?: number; maxAttempts?: number; } interface AuthenticateWithXadesOptions { signedXml: string; verifyCertificateChain?: boolean; enforceXadesCompliance?: boolean; pollIntervalMs?: number; maxAttempts?: number; } interface AuthenticateWithCertificateOptions { keyPair: XadesKeyPair; context: ContextIdentifier; subjectIdentifierType?: "certificateSubject" | "certificateFingerprint"; authorizationPolicyXml?: string | null; signaturePackaging?: "enveloped" | "enveloping"; verifyCertificateChain?: boolean; enforceXadesCompliance?: boolean; pollIntervalMs?: number; maxAttempts?: number; } declare class AuthCoordinator { private readonly authClient; private readonly securityClient; private readonly xadesSignatureService; constructor(authClient: AuthClient, securityClient: SecurityClient); authenticateWithKsefToken(options: AuthenticateWithKsefTokenOptions): Promise; authenticateWithXadesSignature(options: AuthenticateWithXadesOptions): Promise; authenticateWithCertificate(options: AuthenticateWithCertificateOptions): Promise; private pollAuthStatus; private getCertificateByUsage; } interface EncryptionData { cipherKey: Buffer; cipherIv: Buffer; encryptionInfo: EncryptionInfo; } interface PreparedInvoicePayload { invoiceHash: string; invoiceSize: number; encryptedInvoiceHash: string; encryptedInvoiceSize: number; encryptedInvoiceContent: string; } declare class CryptographyService { static generateAesKey(): Buffer; static generateIv(): Buffer; static sha256Base64(data: Buffer | string): string; static sha256Base64Url(data: Buffer | string): string; static encryptAes256Cbc(data: Buffer, key: Buffer, iv: Buffer): Buffer; static decryptAes256Cbc(data: Buffer, key: Buffer, iv: Buffer): Buffer; static encryptRsaOaepSha256(data: Buffer, publicKeyPem: string): Buffer; static encryptKsefTokenRsa(token: string, timestampMs: number, publicCertificate: string): Buffer; static encryptKsefTokenEc(token: string, timestampMs: number, publicCertificate: string, outputFormat?: "java" | "csharp"): Buffer; static encryptKsefToken(token: string, timestampMs: number, publicCertificate: string, method?: "rsa" | "ec", ecOutputFormat?: "java" | "csharp"): string; static toPemFromBase64Der(base64Der: string, label?: string): string; static normalizeCertificatePem(certificate: string): string; static getMetaData(data: Buffer | Uint8Array): FileMetadata; static getEncryptionData(publicCertBase64Der: string): EncryptionData; static prepareInvoicePayload(invoiceXml: Buffer, cipherKey: Buffer, cipherIv: Buffer): PreparedInvoicePayload; } type UpoContextId = { kind: "Nip"; nip: string; } | { kind: "IdWewnetrzny"; idWewnetrzny: string; } | { kind: "IdZlozonyVatUE"; idZlozonyVatUE: string; } | { kind: "IdDostawcyUslugPeppol"; idDostawcyUslugPeppol: string; }; type UpoAuthProof = { kind: "NumerReferencyjnyTokenaKSeF"; numerReferencyjnyTokenaKSeF: string; } | { kind: "SkrotDokumentuUwierzytelniajacego"; skrotDokumentuUwierzytelniajacego: string; }; interface UpoUwierzytelnienie { idKontekstu: UpoContextId; proof: UpoAuthProof; } interface UpoOpisPotwierdzenia { strona: number; liczbaStron: number; zakresDokumentowOd: number; zakresDokumentowDo: number; calkowitaLiczbaDokumentow: number; } interface UpoDokument { nipSprzedawcy: string; numerKSeFDokumentu: string; numerFaktury: string; dataWystawieniaFaktury: string; dataPrzeslaniaDokumentu: string; dataNadaniaNumeruKSeF: string; skrotDokumentu: string; trybWysylki: string; } interface UpoPotwierdzenie { nazwaPodmiotuPrzyjmujacego: string; numerReferencyjnySesji: string; uwierzytelnienie: UpoUwierzytelnienie; opisPotwierdzenia?: UpoOpisPotwierdzenia; nazwaStrukturyLogicznej: string; kodFormularza: string; dokumenty: UpoDokument[]; } declare function parseUpoXml(xml: string | Buffer): UpoPotwierdzenie; interface WaitForUpoOptions { pollIntervalMs?: number; maxAttempts?: number; } declare const MAX_BATCH_PART_SIZE_BYTES: number; interface BatchInvoiceInput { fileName: string; invoice: InvoiceXmlInput; } interface BatchSessionOpenOptions { formCode: BatchSessionFormCode; invoices?: BatchInvoiceInput[]; zipBytes?: Buffer; publicCertificateBase64Der?: string; offlineMode?: boolean; upoV43?: boolean; parallelism?: number; maxPartSizeBytes?: number; } interface BatchSessionState { referenceNumber: string; encryptionData: EncryptionData; batchFile: { fileSize: number; fileHash: string; fileParts: Array<{ ordinalNumber: number; fileSize: number; fileHash: string; }>; }; partUploadRequests: PartUploadRequest[]; encryptedPartsBase64: string[]; upoV43?: boolean; offlineMode?: boolean; } interface BatchUploadOptions { parallelism?: number; skipOrdinals?: number[]; progressCallback?: (ordinalNumber: number) => void | Promise; } declare class BatchSessionHandle { readonly referenceNumber: string; readonly encryptionData: EncryptionData; readonly upoV43: boolean; readonly offlineMode: boolean | undefined; readonly batchFile: { fileSize: number; fileHash: string; fileParts: Array<{ ordinalNumber: number; fileSize: number; fileHash: string; }>; }; private readonly sessionsClient; private readonly http; private readonly partUploadRequests; private readonly encryptedParts; constructor(referenceNumber: string, encryptionData: EncryptionData, sessionsClient: SessionsClient, http: HttpClient, batchFile?: { fileSize: number; fileHash: string; fileParts: Array<{ ordinalNumber: number; fileSize: number; fileHash: string; }>; }, partUploadRequests?: PartUploadRequest[], encryptedParts?: Buffer[], upoV43?: boolean, offlineMode?: boolean); getState(): BatchSessionState; status(): Promise; uploadParts(parallelismOrOptions?: number | BatchUploadOptions): Promise; close(): Promise; waitForUpo(options?: WaitForUpoOptions): Promise; waitForUpoParsed(options?: WaitForUpoOptions): Promise; listFailedInvoices(pageSize?: number, continuationToken?: string): Promise>; } declare class BatchSessionWorkflow { private readonly sessionsClient; private readonly securityClient; private readonly http; constructor(sessionsClient: SessionsClient, securityClient: SecurityClient, http: HttpClient); open(options: BatchSessionOpenOptions): Promise; openUploadAndClose(options: BatchSessionOpenOptions): Promise; resume(state: BatchSessionState, options: { zipBytes: Buffer; }): Promise; private resolveZipBytes; private getCertificateByUsage; } interface ExportStartOptions { filters: InvoiceQueryFilters; encryptionData?: EncryptionData; publicCertificateBase64Der?: string; onlyMetadata?: boolean; compressionType?: "Zip" | "TarGz"; /** * @deprecated Use `onlyMetadata` instead. */ includeMetadata?: boolean; } interface ExportResult { referenceNumber: string; encryptionData: EncryptionData; } interface PackageProcessingResult { metadataSummaries: Array>; invoiceXmlFiles: Record; } interface WaitForExportOptions { pollIntervalMs?: number; maxAttempts?: number; } interface DownloadPackageOptions { /** * @deprecated Use requireExportPartHash instead. */ verifyHashes?: boolean; requireExportPartHash?: boolean; } interface InvoiceExportWorkflowOptions { requireExportPartHash?: boolean; } declare class InvoiceExportWorkflow { private readonly invoicesClient; private readonly securityClient; private readonly http; private readonly requireExportPartHash; constructor(invoicesClient: InvoicesClient, securityClient: SecurityClient, http: HttpClient, options?: InvoiceExportWorkflowOptions); startExport(options: ExportStartOptions): Promise; waitForExport(referenceNumber: string, options?: WaitForExportOptions): Promise; downloadAndProcessPackage(status: InvoiceExportStatusResponse, encryptionData: EncryptionData, options?: DownloadPackageOptions): Promise; private downloadParts; private buildEncryptionData; private getCertificateByUsage; } interface ContinuationPoints { [subjectType: string]: string | undefined; } declare function updateContinuationPoint(continuationPoints: ContinuationPoints, subjectType: string, packageInfo: { isTruncated?: boolean; lastPermanentStorageDate?: string | null; permanentStorageHwmDate?: string | null; }, options?: { dateType?: string; }): void; declare function getEffectiveStartDate(continuationPoints: ContinuationPoints, subjectType: string, windowFrom: string): string; declare function dedupeByKsefNumber(metadataSummaries: Array>): Record>; interface IncrementalExportOptions { subjectType: string; windowFrom: string; windowTo: string; continuationPoints: ContinuationPoints; maxIterations?: number; /** * @deprecated Use requireExportPartHash instead. */ verifyHashes?: boolean; requireExportPartHash?: boolean; pollIntervalMs?: number; maxAttempts?: number; filtersFactory?: (from: string, to: string) => InvoiceQueryFilters; } interface IncrementalExportResult { referenceNumbers: string[]; metadataSummaries: Array>; invoiceXmlFiles: Record; continuationPoints: ContinuationPoints; } declare class IncrementalExportWorkflow { private readonly exports; constructor(exportsWorkflow: InvoiceExportWorkflow); run(options: IncrementalExportOptions): Promise; } interface OnlineSessionOpenOptions { formCode: OnlineSessionFormCode; publicCertificateBase64Der?: string; upoV43?: boolean; } interface OnlineInvoiceSendOptions { invoice: InvoiceXmlInput; offlineMode?: boolean; hashOfCorrectedInvoice?: string; } interface OnlineSessionState { referenceNumber: string; encryptionData: EncryptionData; upoV43?: boolean; } declare class OnlineSessionHandle { readonly referenceNumber: string; readonly encryptionData: EncryptionData; readonly upoV43: boolean; private readonly sessionsClient; private readonly http; constructor(referenceNumber: string, encryptionData: EncryptionData, sessionsClient: SessionsClient, http: HttpClient, upoV43?: boolean); getState(): OnlineSessionState; sendInvoice(options: OnlineInvoiceSendOptions): Promise; close(): Promise; status(): Promise; getInvoiceStatus(invoiceReferenceNumber: string): Promise>; listInvoices(pageOffset?: number, pageSize?: number, continuationToken?: string): Promise>; listFailedInvoices(pageSize?: number, continuationToken?: string): Promise>; getInvoiceUpoByReference(invoiceReferenceNumber: string): Promise; getInvoiceUpoByKsefNumber(ksefNumber: string): Promise; getSessionUpo(upoReferenceNumber: string): Promise; waitForUpo(options?: WaitForUpoOptions): Promise; waitForUpoParsed(options?: WaitForUpoOptions): Promise; } declare class OnlineSessionWorkflow { private readonly sessionsClient; private readonly securityClient; private readonly http; constructor(sessionsClient: SessionsClient, securityClient: SecurityClient, http: HttpClient); open(options: OnlineSessionOpenOptions): Promise; resume(state: OnlineSessionState): OnlineSessionHandle; private getCertificateByUsage; } type OfflineInvoiceMode = "offline24" | "offline" | "awaryjny"; interface OfflineProcedureInstructions { mode: OfflineInvoiceMode; responsibility: string; sendDeadline: string; legalBasis: string; operationalSteps: string[]; } interface OfflineInvoiceSendOptions extends OnlineSessionOpenOptions { invoice: InvoiceXmlInput; waitForUpo?: boolean; waitForUpoOptions?: WaitForUpoOptions; } interface OfflineTechnicalCorrectionOptions extends OfflineInvoiceSendOptions { hashOfCorrectedInvoice: string; } interface OfflineInvoiceSubmissionResult { sessionReferenceNumber: string; invoiceReferenceNumber: string; upoXml: string | null; upo: UpoPotwierdzenie | null; } declare class OfflineInvoiceWorkflow { private readonly onlineWorkflow; constructor(onlineWorkflow: OnlineSessionWorkflow); sendOfflineInvoice(options: OfflineInvoiceSendOptions): Promise; sendOfflineTechnicalCorrection(options: OfflineTechnicalCorrectionOptions): Promise; getProcedureInstructions(mode: OfflineInvoiceMode): OfflineProcedureInstructions; listProcedureInstructions(): OfflineProcedureInstructions[]; private sendOffline; private closeSilently; } interface PersonToken { issuer: string | null; audiences: string[]; issuedAt: Date | null; expiresAt: Date | null; roles: string[]; tokenType: string | null; contextIdType: string | null; contextIdValue: string | null; authMethod: string | null; authRequestNumber: string | null; subjectDetails: Record | null; permissions: string[]; permissionsExcluded: string[]; rolesRaw: string[]; permissionsEffective: string[]; ipPolicy: Record | null; } declare class PersonTokenService { parse(jwtToken: string): PersonToken; } interface QrCodeRenderOptions { errorCorrectionLevel?: "L" | "M" | "Q" | "H"; margin?: number; width?: number; } declare class QrCodeService { toPngBuffer(value: string, options?: QrCodeRenderOptions): Promise; toSvgString(value: string, options?: QrCodeRenderOptions): Promise; toDataUrl(value: string, options?: QrCodeRenderOptions): Promise; } interface VerificationLinkServiceOptions { baseQrUrl: string; } declare class VerificationLinkService { private readonly baseQrUrl; constructor(options: VerificationLinkServiceOptions); buildInvoiceVerificationUrl(nip: string, issueDate: Date | string, invoiceHash: string): string; buildCertificateVerificationUrl(options: { sellerNip: string; contextIdentifierType: string; contextIdentifierValue: string; certificateSerial: string; invoiceHash: string; privateKeyPem: string; privateKeyPassword?: string; signatureFormat?: "p1363" | "der"; }): string; } interface AuthManagerOptions { refreshLeewayMs?: number; } declare class AuthManager { private accessToken; private refreshToken; private accessTokenExpiryMs; private refreshInFlight; private readonly refreshLeewayMs; private readonly authClient; constructor(authClient: AuthClient, options?: AuthManagerOptions); setTokens(tokens: AuthenticationTokensResponse): void; setAccessToken(token: string, validUntil?: string): void; getAccessToken(): Promise; private refreshAccessToken; } interface KsefClientOptions { baseUrl?: string; environment?: KsefEnvironment; timeoutMs?: number; appendV2?: boolean; proxy?: string; noProxy?: string; headers?: Record; baseQrUrl?: string; baseLighthouseUrl?: string; lighthouseEnvironment?: KsefLighthouseEnvironment; retryOn429?: boolean; retryOn5xx?: boolean; retryOnTimeout?: boolean; maxRetryAttempts?: number; maxRetryDelayMs?: number; strictPresignedUrlValidation?: boolean; allowedPresignedHosts?: string[]; allowPrivateNetworkPresignedUrls?: boolean; requireExportPartHash?: boolean; systemWarningHandler?: (warning: string) => void; } interface KsefConnectOptions extends KsefClientOptions { token: string; context: ContextIdentifier; authorizationPolicy?: AuthorizationPolicy; maxAttempts?: number; pollIntervalMs?: number; publicCertificateBase64Der?: string; } declare class KsefClient { readonly auth: AuthClient; readonly security: SecurityClient; readonly sessions: SessionsClient; readonly invoices: InvoicesClient; readonly permissions: PermissionsClient; readonly certificates: CertificatesClient; readonly tokens: TokensClient; readonly limits: LimitsClient; readonly testdata: TestdataClient; readonly collectiveIdentifiers: CollectiveIdentifiersClient; readonly peppol: PeppolClient; readonly lighthouse: LighthouseClient; readonly activeSessions: ActiveSessionsClient; readonly authManager: AuthManager; readonly baseQrUrl: string; readonly workflows: { auth: AuthCoordinator; sessions: { online: OnlineSessionWorkflow; batch: BatchSessionWorkflow; }; offline: OfflineInvoiceWorkflow; exports: InvoiceExportWorkflow; exportsIncremental: IncrementalExportWorkflow; }; readonly verificationLinks: VerificationLinkService; readonly qr: QrCodeService; readonly personToken: PersonTokenService; private readonly http; constructor(options?: KsefClientOptions); static connect(options: KsefConnectOptions): Promise; } interface AuthTokenRequestXmlOptions { challenge: string; contextIdentifierType: string; contextIdentifierValue: string; subjectIdentifierType?: string; authorizationPolicyXml?: string | null; } declare function buildAuthTokenRequestXml(options: AuthTokenRequestXmlOptions): string; declare function normalizeContextIdentifierType(value: string): string; declare function toBase64Url(input: Buffer): string; declare function fromBase64Url(input: string): Buffer; declare function splitBuffer(buffer: Buffer, maxPartSize: number): Buffer[]; interface CertificateSerialValidationResult { isValid: boolean; message?: string; } declare function validateCertificateSerialNumber(serialNumber: string): CertificateSerialValidationResult; declare function isValidCertificateSerialNumber(serialNumber: string): boolean; declare function requireCertificateSerialNumber(serialNumber: string): string; declare const COLLECTIVE_IDENTIFIER_LENGTH = 35; declare const MAX_INVOICES_PER_IDENTIFIER = 500; declare const MIN_INVOICES_PER_IDENTIFIER = 2; declare const MAX_IDENTIFIERS_PER_INVOICE = 132; declare const MAX_IDENTIFIERS_PER_INVOICES_QUERY = 10; declare const MAX_QUERY_RANGE_DAYS = 100; declare const MAX_INVOICE_DESCRIPTION_LENGTH = 512; declare const PAGE_SIZE_MIN = 10; declare const PAGE_SIZE_MAX = 200; declare const PAGE_SIZE_INVOICES_MAX = 500; declare const COLLECTIVE_IDENTIFIER_EXCEPTION_CODES: Record; interface CollectiveIdentifierValidationResult { isValid: boolean; message?: string; } declare function validateCollectiveIdentifierNumber(collectiveIdentifierNumber: string): CollectiveIdentifierValidationResult; declare function isValidCollectiveIdentifierNumber(collectiveIdentifierNumber: string): boolean; declare function requireCollectiveIdentifierNumber(collectiveIdentifierNumber: string): string; declare function requirePageSize(value: number, maximum?: number): number; declare function requireInvoicesQueryIdentifiers(collectiveIdentifierNumbers: string | readonly string[]): string[]; declare function requireQueryDateRange(dateFrom: string, dateTo: string): [string, string]; declare function expandQueryDateBound(value: string, endOfDay: boolean): string; declare function makeCollectiveIdentifierInvoice(ksefNumber: string, options?: { description?: string | null; amount?: number | string | null; currency?: CurrencyCode | string | null; }): CollectiveIdentifierInvoice; declare function requireGenerateInvoices(invoices: readonly CollectiveIdentifierInvoice[], options?: { minInvoices?: number; }): CollectiveIdentifierInvoice[]; declare function crc8(input: string): number; declare function crc8Hex(input: string): string; interface KsefNumberValidationResult { isValid: boolean; message?: string; } declare function validateKsefNumber(ksefNumber: string): KsefNumberValidationResult; declare function isValidKsefNumber(ksefNumber: string): boolean; declare function requireKsefNumber(ksefNumber: string): string; interface ZipEntryInput { fileName: string; content: Buffer | Uint8Array; } interface UnzipOptions { maxFiles?: number; maxTotalUncompressedSize?: number; maxFileUncompressedSize?: number; maxCompressionRatio?: number | null; } declare function createZip(entries: ZipEntryInput[]): Promise; declare function unzip(buffer: Buffer, options?: UnzipOptions): Promise>; declare function untarGz(buffer: Buffer, options?: UnzipOptions): Promise>; interface JwtPayload { exp?: number; } declare function decodeJwtPayload(token: string): JwtPayload | null; declare function getJwtExpiryMs(token: string): number | null; export { ActiveSessionsClient, type AnyFaRr1FormCode, type AuthAnyResponse, type AuthChallengeResponse, AuthClient, AuthCoordinator, type AuthTokenRedeemResponse, type AuthTokenRequest, type AuthTokenRequestContextIdentifier, type AuthTokenRequestXmlOptions, type AuthXadesRequest, type AuthenticateWithCertificateOptions, type AuthenticateWithKsefTokenOptions, type AuthenticateWithXadesOptions, type AuthenticationInitResponse, type AuthenticationListItem, type AuthenticationListResponse, type AuthenticationMethod, type AuthenticationMethodCategory, type AuthenticationMethodInfo, type AuthenticationOperationStatusResponse, type AuthenticationTokensResponse, type AuthorizationPolicy, type BatchInvoiceInput, type BatchSessionFormCode, BatchSessionHandle, type BatchSessionOpenOptions, type BatchSessionState, BatchSessionWorkflow, type BatchUploadOptions, COLLECTIVE_IDENTIFIER_EXCEPTION_CODES, COLLECTIVE_IDENTIFIER_LENGTH, type CertificateEnrollmentRequest, type CertificateEnrollmentResponse, type CertificateEnrollmentStatusResponse, type CertificateLimitsResponse, type CertificateRevokeRequest, type CertificateSerialValidationResult, CertificatesClient, type CertificatesQueryRequest, type CertificatesQueryResponse, type CertificatesRetrieveRequest, type CertificatesRetrieveResponse, CollectiveIdentifierInvoice, CollectiveIdentifierInvoicesQueryResponse, CollectiveIdentifierInvoicesQueryResponseItem, type CollectiveIdentifierValidationResult, CollectiveIdentifiersByKsefNumberQueryResponse, CollectiveIdentifiersByKsefNumberQueryResponseItem, CollectiveIdentifiersClient, type CollectiveIdentifiersGenerateForNumbersOptions, type CollectiveIdentifiersIterateOptions, type CollectiveIdentifiersPagingOptions, type CollectiveIdentifiersQueryByCreatedRangeOptions, CollectiveIdentifiersQueryRequest, CollectiveIdentifiersQueryResponse, CollectiveIdentifiersQueryResponseItem, type ContextIdentifier, type ContextIdentifierType, type ContinuationPoints, CryptographyService, type DownloadPackageOptions, type EncryptionData, type EncryptionInfo, type EntityPermissionItem, type EntityPermissionItemScope, type EntityPermissionsContextIdentifier, type EntityPermissionsContextIdentifierType, type EntityPermissionsQueryRequest, type ExportResult, type ExportStartOptions, type Fa2FormCode, type Fa3FormCode, type FaRr1FormCode, type FaRr1LegacyFormCode, type FaRr1TransitionFormCode, type FileMetadata, type FormCode, GenerateCollectiveIdentifierRequest, GenerateCollectiveIdentifierResponse, type GenerateTokenRequest, type GenerateTokenResponse, type GetSessionsQueryParams, type HttpMethod, INVOICE_QUERY_MAX_RANGE_DAYS, type IncrementalExportOptions, type IncrementalExportResult, IncrementalExportWorkflow, type InitTokenAuthenticationRequest, type InitXadesAuthenticationRequest, type InvoiceDateRangeFilter, type InvoiceExportInitResponse, type InvoiceExportRequest, type InvoiceExportStatusResponse, InvoiceExportWorkflow, type InvoiceExportWorkflowOptions, type InvoiceMetadataResponse, type InvoicePackage, type InvoicePackagePart, type InvoiceQueryFilters, InvoiceXmlInput, InvoicesClient, type IsoDateInput, type IsoDateString, type IsoDateTimeString, type JsonObject, type JsonValue, type JwtPayload, KSEF_ENV_URLS, KSEF_LIGHTHOUSE_ENV_BY_KSEF_ENV, KSEF_LIGHTHOUSE_URLS, KSEF_QR_URLS, KsefClient, type KsefClientOptions, type KsefConnectOptions, type KsefEnvironment, type KsefLighthouseEnvironment, type KsefNumberValidationResult, type KsefTokenAuthorIdentifierType, type KsefTokenContextIdentifierType, type KsefTokenRequest, type KsefTokenResponse, type KsefTokenStatus, type KsefTokensListQueryParams, type KsefTokensListResponse, LighthouseClient, type LighthouseMessage, type LighthouseMessageCategory, type LighthouseMessageType, type LighthouseStatusCode, type LighthouseStatusResponse, type LimitsChangeRequest, LimitsClient, type LimitsContextResponse, type LimitsSubjectResponse, MAX_BATCH_PART_SIZE_BYTES, MAX_IDENTIFIERS_PER_INVOICE, MAX_IDENTIFIERS_PER_INVOICES_QUERY, MAX_INVOICES_PER_IDENTIFIER, MAX_INVOICE_DESCRIPTION_LENGTH, MAX_QUERY_RANGE_DAYS, MIN_INVOICES_PER_IDENTIFIER, type OfflineInvoiceMode, type OfflineInvoiceSendOptions, type OfflineInvoiceSubmissionResult, OfflineInvoiceWorkflow, type OfflineProcedureInstructions, type OfflineTechnicalCorrectionOptions, type OnlineInvoiceSendOptions, type OnlineSessionFormCode, OnlineSessionHandle, type OnlineSessionOpenOptions, type OnlineSessionState, OnlineSessionWorkflow, type OpenBatchSessionRequest, type OpenBatchSessionResponse, type OpenOnlineSessionRequest, type OpenOnlineSessionResponse, PAGE_SIZE_INVOICES_MAX, PAGE_SIZE_MAX, PAGE_SIZE_MIN, type PackageProcessingResult, type PartUploadRequest, type Pef3FormCode, type PefKor3FormCode, PeppolClient, type PeppolProvidersResponse, PermissionsClient, type PermissionsGrantRequest, type PermissionsListResponse, type PermissionsOperationResponse, type PermissionsQueryPaging, type PermissionsQueryRequest, type PersonToken, PersonTokenService, type PreparedInvoicePayload, type PublicKeyCertificate, type QrCodeRenderOptions, QrCodeService, type QueryEntityPermissionsResponse, type QueryTokensResponse, type QueryTokensResponseItem, type RateLimitsResponse, type RefreshTokenResponse, SecurityClient, type SendInvoiceRequest, type SendInvoiceResponse, type SessionFailedInvoicesResponse, type SessionInvoiceStatusResponse, type SessionInvoicesResponse, type SessionStatus, type SessionStatusResponse, type SessionType, SessionsClient, type SessionsListResponse, type SignXadesEnvelopedOptions, type StatusInfo, type TestDataAuthenticationContextIdentifier, type TestDataAuthenticationContextIdentifierType, type TestDataContextBlockRequest, type TestDataContextBlockResponse, type TestDataContextUnblockRequest, type TestDataContextUnblockResponse, type TestDataUpdateCertificateRequest, TestdataClient, type TestdataRequest, type TestdataResponse, type TokenAuthorIdentifier, type TokenContextIdentifier, type TokenInfo, type TokenPermissionType, type TokenStatusResponse, TokensClient, type UnzipOptions, type UpoAuthProof, type UpoContextId, type UpoDokument, type UpoOpisPotwierdzenia, type UpoPotwierdzenie, type UpoUwierzytelnienie, VerificationLinkService, type VerificationLinkServiceOptions, type WaitForExportOptions, type WaitForUpoOptions, XadesKeyPair, type XadesPemKeyPairFilesOptions, type XadesPemKeyPairOptions, type XadesPkcs12KeyPairFileOptions, type XadesPkcs12KeyPairOptions, XadesSignatureService, type ZipEntryInput, buildAuthTokenRequestXml, crc8, crc8Hex, createZip, decodeJwtPayload, dedupeByKsefNumber, expandQueryDateBound, fromBase64Url, getEffectiveStartDate, getJwtExpiryMs, isValidCertificateSerialNumber, isValidCollectiveIdentifierNumber, isValidKsefNumber, makeCollectiveIdentifierInvoice, normalizeContextIdentifierType, normalizeInvoiceQueryFilters, parseUpoXml, requireCertificateSerialNumber, requireCollectiveIdentifierNumber, requireGenerateInvoices, requireInvoicesQueryIdentifiers, requireKsefNumber, requirePageSize, requireQueryDateRange, splitBuffer, toBase64Url, untarGz, unzip, updateContinuationPoint, validateCertificateSerialNumber, validateCollectiveIdentifierNumber, validateInvoiceQueryFilters, validateKsefNumber };