ksef-client-ts 0.6.0 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -134,6 +134,7 @@ interface UnauthorizedProblemDetails {
134
134
  detail: string;
135
135
  instance?: string;
136
136
  traceId?: string;
137
+ timestamp?: string;
137
138
  }
138
139
  type ForbiddenReasonCode = 'missing-permissions' | 'ip-not-allowed' | 'insufficient-resource-access' | 'auth-method-not-allowed' | 'security-service-blocked' | 'context-type-not-allowed' | (string & {});
139
140
  interface ForbiddenProblemDetails {
@@ -144,6 +145,15 @@ interface ForbiddenProblemDetails {
144
145
  reasonCode: ForbiddenReasonCode;
145
146
  security?: Record<string, unknown>;
146
147
  traceId?: string;
148
+ timestamp?: string;
149
+ }
150
+ interface GoneProblemDetails {
151
+ title: string;
152
+ status: number;
153
+ detail: string;
154
+ instance?: string;
155
+ traceId?: string;
156
+ timestamp?: string;
147
157
  }
148
158
 
149
159
  declare class KSeFError extends Error {
@@ -181,6 +191,7 @@ declare class KSeFUnauthorizedError extends KSeFError {
181
191
  readonly detail: string;
182
192
  readonly traceId?: string;
183
193
  readonly instance?: string;
194
+ readonly timestamp?: string;
184
195
  constructor(problemDetails: UnauthorizedProblemDetails);
185
196
  }
186
197
 
@@ -191,9 +202,19 @@ declare class KSeFForbiddenError extends KSeFError {
191
202
  readonly instance?: string;
192
203
  readonly security?: Record<string, unknown>;
193
204
  readonly traceId?: string;
205
+ readonly timestamp?: string;
194
206
  constructor(problemDetails: ForbiddenProblemDetails);
195
207
  }
196
208
 
209
+ declare class KSeFGoneError extends KSeFError {
210
+ readonly statusCode = 410;
211
+ readonly detail: string;
212
+ readonly instance?: string;
213
+ readonly traceId?: string;
214
+ readonly timestamp?: string;
215
+ constructor(problemDetails: GoneProblemDetails);
216
+ }
217
+
197
218
  declare class KSeFAuthStatusError extends KSeFError {
198
219
  readonly referenceNumber?: string;
199
220
  readonly statusDescription?: string;
@@ -204,6 +225,18 @@ declare class KSeFSessionExpiredError extends KSeFError {
204
225
  constructor(message?: string);
205
226
  }
206
227
 
228
+ declare class KSeFBatchTimeoutError extends KSeFApiError {
229
+ readonly errorCode: 21208;
230
+ constructor(message: string, statusCode: number, errorResponse?: ApiErrorResponse);
231
+ static fromResponse(statusCode: number, body?: ApiErrorResponse): KSeFBatchTimeoutError;
232
+ }
233
+
234
+ declare const KSeFErrorCode: {
235
+ readonly BatchTimeout: 21208;
236
+ readonly DuplicateInvoice: 440;
237
+ };
238
+ type KSeFErrorCode = (typeof KSeFErrorCode)[keyof typeof KSeFErrorCode];
239
+
207
240
  declare class RouteBuilder {
208
241
  private readonly apiVersion;
209
242
  constructor(apiVersion: string);
@@ -642,6 +675,10 @@ interface AuthChallengeResponse {
642
675
  timestampMs: number;
643
676
  clientIp: string;
644
677
  }
678
+ interface LoginResult {
679
+ /** Client IP as seen by KSeF during the challenge — use to configure AuthorizationPolicy.allowedIps. */
680
+ clientIp: string;
681
+ }
645
682
  interface AuthenticationInitResponse {
646
683
  referenceNumber: string;
647
684
  authenticationToken: TokenInfo;
@@ -845,6 +882,37 @@ interface UpoResult {
845
882
  hash?: string;
846
883
  }
847
884
 
885
+ /**
886
+ * Serializable state of an online session. All binary data is Base64-encoded.
887
+ *
888
+ * **Security:** contains AES encryption keys in plaintext. Treat serialized
889
+ * state as sensitive data — encrypt at rest or store in a secure vault.
890
+ */
891
+ interface OnlineSessionState {
892
+ referenceNumber: string;
893
+ /** AES-256 cipher key, Base64-encoded. */
894
+ aesKey: string;
895
+ /** AES-256 initialization vector, Base64-encoded. */
896
+ iv: string;
897
+ accessToken: string;
898
+ formCode: FormCode;
899
+ /** Session expiration time, ISO 8601. */
900
+ validUntil: string;
901
+ /** Whether invoices are validated against XSD before sending. */
902
+ validate?: boolean;
903
+ }
904
+ /** Serializable state of a batch session. */
905
+ interface BatchSessionState {
906
+ referenceNumber: string;
907
+ /** AES-256 cipher key, Base64-encoded. */
908
+ aesKey: string;
909
+ /** AES-256 initialization vector, Base64-encoded. */
910
+ iv: string;
911
+ accessToken: string;
912
+ formCode: FormCode;
913
+ partUploadRequests: PartUploadRequest[];
914
+ }
915
+
848
916
  /**
849
917
  * Invoice subject type — defines the taxpayer's role in the invoice.
850
918
  * - `Subject1` — seller (invoices issued by us)
@@ -944,6 +1012,11 @@ interface QueryInvoicesMetadataResponse {
944
1012
  invoices: InvoiceMetadata[];
945
1013
  permanentStorageHwmDate?: string;
946
1014
  }
1015
+ interface InvoiceResult {
1016
+ xml: string;
1017
+ /** SHA-256 base64 hash from the `x-ms-meta-hash` response header, if present. */
1018
+ hash?: string;
1019
+ }
947
1020
  interface InvoiceExportRequest {
948
1021
  encryption: EncryptionInfo;
949
1022
  filters: InvoiceQueryFilters;
@@ -1883,13 +1956,13 @@ declare class BatchSessionService {
1883
1956
  private readonly restClient;
1884
1957
  constructor(restClient: RestClient);
1885
1958
  openSession(request: OpenBatchSessionRequest, upoVersion?: UpoVersion | string): Promise<OpenBatchSessionResponse>;
1886
- sendParts(openResponse: OpenBatchSessionResponse, parts: BatchPartSendingInfo[]): Promise<void>;
1959
+ sendParts(openResponse: OpenBatchSessionResponse, parts: BatchPartSendingInfo[], parallelism?: number): Promise<void>;
1887
1960
  /**
1888
- * Upload parts sequentially (not in parallel) because each part uses a
1889
- * streaming body (`duplex: 'half'`). Parallel streaming uploads can cause
1890
- * backpressure issues and exceed memory limits for large payloads.
1961
+ * Upload parts using streaming bodies (`duplex: 'half'`).
1962
+ * By default uploads sequentially to avoid backpressure issues.
1963
+ * Pass `parallelism` to enable bounded concurrent uploads.
1891
1964
  */
1892
- sendPartsWithStream(openResponse: OpenBatchSessionResponse, parts: BatchPartStreamSendingInfo[]): Promise<void>;
1965
+ sendPartsWithStream(openResponse: OpenBatchSessionResponse, parts: BatchPartStreamSendingInfo[], parallelism?: number): Promise<void>;
1893
1966
  closeSession(batchRef: string): Promise<void>;
1894
1967
  }
1895
1968
 
@@ -1909,7 +1982,7 @@ declare class SessionStatusService {
1909
1982
  declare class InvoiceDownloadService {
1910
1983
  private readonly restClient;
1911
1984
  constructor(restClient: RestClient);
1912
- getInvoice(ksefNumber: string): Promise<string>;
1985
+ getInvoice(ksefNumber: string): Promise<InvoiceResult>;
1913
1986
  queryInvoiceMetadata(filters: InvoiceQueryFilters, pageOffset?: number, pageSize?: number, sortOrder?: SortOrder): Promise<QueryInvoicesMetadataResponse>;
1914
1987
  exportInvoices(request: InvoiceExportRequest): Promise<OperationResponse>;
1915
1988
  getInvoiceExportStatus(ref: string): Promise<InvoiceExportStatusResponse>;
@@ -2344,6 +2417,26 @@ interface KSeFTokenContext {
2344
2417
  declare function decodeJwtPayload(token: string): Record<string, unknown> | null;
2345
2418
  declare function parseKSeFTokenContext(token: string): KSeFTokenContext | null;
2346
2419
 
2420
+ /** Compute SHA-256 hash of data, returned as base64 string. */
2421
+ declare function sha256Base64(data: Uint8Array): string;
2422
+ /** Returns true if SHA-256 base64 of `data` matches `expectedHash`. */
2423
+ declare function verifyHash(data: Uint8Array, expectedHash: string): boolean;
2424
+
2425
+ /**
2426
+ * Execute async tasks with bounded concurrency using a worker-pool pattern.
2427
+ *
2428
+ * Creates `parallelism` workers that pull from a shared task queue.
2429
+ * Safe in single-threaded JS — index read+increment is atomic between await points.
2430
+ *
2431
+ * On first failure the shared AbortController is triggered so that:
2432
+ * 1. No new tasks are dequeued.
2433
+ * 2. In-flight tasks receive the abort signal (e.g. to cancel fetch requests).
2434
+ *
2435
+ * @param tasks - Array of async thunks that receive an AbortSignal
2436
+ * @param parallelism - Maximum number of concurrent workers (clamped to [1, tasks.length])
2437
+ */
2438
+ declare function runWithConcurrency(tasks: Array<(signal: AbortSignal) => Promise<void>>, parallelism: number): Promise<void>;
2439
+
2347
2440
  type UpoContextId = {
2348
2441
  kind: 'Nip';
2349
2442
  nip: string;
@@ -2421,6 +2514,8 @@ interface OnlineSessionHandle {
2421
2514
  close(): Promise<void>;
2422
2515
  waitForUpo(options?: PollOptions): Promise<UpoInfo>;
2423
2516
  waitForUpoParsed(options?: PollOptions): Promise<ParsedUpoInfo>;
2517
+ /** Serialize session state for persistence. Restore with `resumeOnlineSession()`. */
2518
+ getState(): OnlineSessionState;
2424
2519
  }
2425
2520
  interface UpoInfo {
2426
2521
  pages: Array<{
@@ -2448,6 +2543,7 @@ interface ExportResult {
2448
2543
  url: string;
2449
2544
  method: string;
2450
2545
  partSize: number;
2546
+ partHash: string;
2451
2547
  encryptedPartSize: number;
2452
2548
  encryptedPartHash: string;
2453
2549
  expirationDate: string;
@@ -2620,12 +2716,15 @@ declare class KSeFClient {
2620
2716
  readonly qr: VerificationLinkService;
2621
2717
  readonly options: ResolvedOptions;
2622
2718
  readonly authManager: AuthManager;
2719
+ private readonly _baseRestClientConfig;
2623
2720
  private _offline?;
2624
2721
  constructor(options?: KSeFClientOptions);
2625
2722
  get offline(): OfflineInvoiceWorkflow;
2626
- loginWithToken(token: string, nip: string): Promise<void>;
2627
- loginWithCertificate(certPem: string, keyPem: string, nip: string, keyPassword?: string): Promise<void>;
2628
- loginWithPkcs12(p12: Buffer | Uint8Array, password: string, nip: string): Promise<void>;
2723
+ /** @internal Create a RestClient with a different AuthManager, preserving transport/retry/rateLimit config. */
2724
+ createScopedRestClient(authManager: AuthManager): RestClient;
2725
+ loginWithToken(token: string, nip: string): Promise<LoginResult>;
2726
+ loginWithCertificate(certPem: string, keyPem: string, nip: string, keyPassword?: string): Promise<LoginResult>;
2727
+ loginWithPkcs12(p12: Buffer | Uint8Array, password: string, nip: string): Promise<LoginResult>;
2629
2728
  private awaitAuthReady;
2630
2729
  logout(): Promise<void>;
2631
2730
  }
@@ -2640,6 +2739,7 @@ interface SendAndCloseOptions extends OpenOnlineSessionOptions {
2640
2739
  pollOptions?: PollOptions;
2641
2740
  }
2642
2741
  declare function openOnlineSession(client: KSeFClient, options?: OpenOnlineSessionOptions): Promise<OnlineSessionHandle>;
2742
+ declare function resumeOnlineSession(client: KSeFClient, state: OnlineSessionState, options?: Pick<OpenOnlineSessionOptions, 'validate'>): OnlineSessionHandle;
2643
2743
  declare function openSendAndClose(client: KSeFClient, invoices: Array<string | Uint8Array>, options?: SendAndCloseOptions): Promise<UpoInfo>;
2644
2744
 
2645
2745
  interface BatchUploadOptions {
@@ -2652,6 +2752,8 @@ interface BatchUploadOptions {
2652
2752
  offlineMode?: boolean;
2653
2753
  /** Validate each invoice XML in the ZIP before uploading. */
2654
2754
  validate?: boolean;
2755
+ /** Number of concurrent part uploads. Omit for default behavior (buffer: all parallel, stream: sequential). */
2756
+ parallelism?: number;
2655
2757
  }
2656
2758
  declare function uploadBatch(client: KSeFClient, zipData: Uint8Array, options?: BatchUploadOptions): Promise<BatchUploadResult>;
2657
2759
 
@@ -2670,6 +2772,8 @@ interface ExportAndDownloadOptions extends ExportOptions {
2670
2772
  extract?: boolean;
2671
2773
  /** Options for ZIP extraction safety limits (only used when extract is true). */
2672
2774
  unzipOptions?: UnzipOptions;
2775
+ /** Verify SHA-256 hash of encrypted parts after download. Defaults to true. */
2776
+ verifyHash?: boolean;
2673
2777
  }
2674
2778
  declare function exportInvoices(client: KSeFClient, filters: InvoiceQueryFilters, options?: ExportOptions): Promise<ExportResult>;
2675
2779
  declare function exportAndDownload(client: KSeFClient, filters: InvoiceQueryFilters, options: ExportAndDownloadOptions & {
@@ -2710,6 +2814,8 @@ interface IncrementalExportOptions {
2710
2814
  pollOptions?: PollOptions;
2711
2815
  onlyMetadata?: boolean;
2712
2816
  transport?: typeof fetch;
2817
+ /** Verify SHA-256 hash of encrypted parts after download. Defaults to true. */
2818
+ verifyHash?: boolean;
2713
2819
  store?: HwmStore;
2714
2820
  onIterationComplete?: (iteration: number, result: ExportResult) => void;
2715
2821
  }
@@ -2794,6 +2900,39 @@ declare function extendDeadlineForMaintenance(currentDeadline: Date | string, ma
2794
2900
  declare function isExpired(submitBy: Date | string): boolean;
2795
2901
  declare function getTimeUntilDeadline(submitBy: Date | string): number;
2796
2902
 
2903
+ /**
2904
+ * Get all Polish statutory holidays for a given year.
2905
+ * Returns a Set of ISO date strings ('YYYY-MM-DD').
2906
+ *
2907
+ * Source: Ustawa z dnia 18 stycznia 1951 r. o dniach wolnych od pracy
2908
+ * (Dz.U. z 2025 r., poz. 296)
2909
+ *
2910
+ * Fixed holidays:
2911
+ * Jan 1 — Nowy Rok
2912
+ * Jan 6 — Święto Trzech Króli (Epiphany)
2913
+ * May 1 — Święto Państwowe
2914
+ * May 3 — Święto Narodowe Trzeciego Maja
2915
+ * Aug 15 — Wniebowzięcie NMP
2916
+ * Nov 1 — Wszystkich Świętych
2917
+ * Nov 11 — Narodowe Święto Niepodległości
2918
+ * Dec 24 — Wigilia Bożego Narodzenia (since 2025, Dz.U. 2024 poz. 1965)
2919
+ * Dec 25 — Boże Narodzenie (1st day)
2920
+ * Dec 26 — Boże Narodzenie (2nd day)
2921
+ *
2922
+ * Moveable holidays (Easter-based):
2923
+ * Easter Sunday — Wielkanoc
2924
+ * Easter Monday — Poniedziałek Wielkanocny (Easter + 1)
2925
+ * Pentecost Sunday — Zielone Świątki (Easter + 49, always Sunday)
2926
+ * Corpus Christi — Boże Ciało (Easter + 60)
2927
+ *
2928
+ * Count: 14 (year >= 2025), 13 (year <= 2024)
2929
+ */
2930
+ declare function getPolishHolidays(year: number): ReadonlySet<string>;
2931
+ /**
2932
+ * Check if a UTC date falls on a Polish statutory holiday.
2933
+ */
2934
+ declare function isPolishHoliday(date: Date): boolean;
2935
+
2797
2936
  declare class FileOfflineInvoiceStorage implements OfflineInvoiceStorage {
2798
2937
  private readonly dir;
2799
2938
  constructor(directory?: string);
@@ -2813,4 +2952,4 @@ declare class FileOfflineInvoiceStorage implements OfflineInvoiceStorage {
2813
2952
  delete(id: string): Promise<void>;
2814
2953
  }
2815
2954
 
2816
- export { ActiveSessionsService, type AllowedIps, type AmountType, type ApiErrorResponse, type ApiRateLimitValuesOverride, type ApiRateLimitsOverride, type AttachmentPermissionGrantRequest, type AttachmentPermissionRevokeRequest, type AuthChallengeResponse, type AuthKsefTokenRequest, AuthKsefTokenRequestBuilder, type AuthManager, type AuthResult, AuthService, type AuthSessionInfo, type AuthTokenRequest, AuthTokenRequestBuilder, type AuthTokenRequestXmlOptions, type AuthenticationInitResponse, type AuthenticationKsefToken, type AuthenticationListResponse, type AuthenticationMethod, type AuthenticationMethodInfo, type AuthenticationMethodInfoCategory, type AuthenticationOperationStatusResponse, type AuthenticationTokenRefreshResponse, type AuthenticationTokensResponse, type AuthorizationGrant, AuthorizationPermissionGrantBuilder, type AuthorizationPolicy, BATCH_MAX_PARTS, BATCH_MAX_PART_SIZE, BATCH_MAX_TOTAL_SIZE, Base64String, type BatchFileBuildOptions, type BatchFileBuildResult, BatchFileBuilder, type BatchFileInfo, type BatchFilePartInfo, type BatchPartSendingInfo, type BatchPartStreamSendingInfo, type BatchSessionContextLimitsOverride, type BatchSessionEffectiveContextLimits, type BatchSessionFormCode, BatchSessionService, type BatchStreamBuildResult, type BatchUploadOptions, type BatchUploadResult, type BatchValidationResult, type BlockContextAuthenticationRequest, type BuyerIdentifierType, CERTIFICATE_NAME_MAX_LENGTH, CERTIFICATE_NAME_MIN_LENGTH, CertificateApiService, type CertificateAuthOptions, type CertificateEffectiveSubjectLimits, type CertificateEnrollmentDataResponse, type CertificateEnrollmentStatusResponse, CertificateFetcher, CertificateFingerprint, type CertificateLimit, type CertificateLimitsResponse, type CertificateListItem, CertificateName, type CertificateRevocationReason, CertificateService, type CertificateStatus, type CertificateSubjectIdentifier, type CertificateSubjectIdentifierType, type CertificateSubjectLimitsOverride, type CertificateType, type ContextIdentifier, type ContextIdentifierType, type ContinuationPoints, type CryptoEncryptionMethod, CryptographyService, type CsrResult, DEFAULT_FORM_CODE, DefaultAuthManager, ENFORCE_XADES_COMPLIANCE, type EffectiveApiRateLimitValues, type EffectiveApiRateLimits, type EffectiveContextLimits, type EffectiveSubjectLimits, type EncryptionData, type EncryptionInfo, type EnrollCertificateRequest, type EnrollCertificateResponse, type EnrollmentEffectiveSubjectLimits, type EnrollmentSubjectLimitsOverride, type EntityAuthorizationGrant, type EntityAuthorizationPermissionType, type EntityAuthorizationPermissionsSubjectIdentifierType, type EntityAuthorizationSubjectIdentifier, type EntityAuthorizationsAuthorIdentifier, type EntityAuthorizationsAuthorIdentifierType, type EntityAuthorizationsAuthorizedEntityIdentifier, type EntityAuthorizationsAuthorizedEntityIdentifierType, type EntityAuthorizationsAuthorizingEntityIdentifier, type EntityAuthorizationsAuthorizingEntityIdentifierType, type EntityAuthorizationsQueryType, type EntityByFingerprintDetails, type EntityDetails, type EntityPermission, EntityPermissionGrantBuilder, type EntityPermissionItem, type EntityPermissionItemType, type EntityPermissionsContextIdentifier, type EntityPermissionsContextIdentifierType, type EntityRole, type EntityRoleType, type EntityRolesParentEntityIdentifier, type EntityRolesParentEntityIdentifierType, type EntitySubjectByFingerprintDetailsType, type EntitySubjectByIdentifierDetailsType, type EntitySubjectDetailsType, type EntitySubjectIdentifier, Environment, type EnvironmentConfig, type EnvironmentName, type EuEntityAdministrationContextIdentifier, type EuEntityAdministrationPermissionsContextIdentifierType, type EuEntityAdministrationPermissionsSubjectIdentifierType, type EuEntityAdministrationSubjectIdentifier, type EuEntityDetails, type EuEntityPermission, type EuEntityPermissionSubjectDetails, type EuEntityPermissionSubjectDetailsType, type EuEntityPermissionType, type EuEntityPermissionsAuthorIdentifier, type EuEntityPermissionsAuthorIdentifierType, type EuEntityPermissionsQueryPermissionType, type EuEntityPermissionsSubjectIdentifier, type EuEntityPermissionsSubjectIdentifierType, type ExceptionDetails, type ExportAndDownloadOptions, type ExportDownloadResult, type ExportExtractedResult, type ExportOptions, type ExportResult, type ExternalSignatureAuthOptions, FORM_CODES, FORM_CODE_KEYS, FileHwmStore, type FileMetadata, FileOfflineInvoiceStorage, type ForbiddenProblemDetails, type ForbiddenReasonCode, type FormCode, type FormType, type GrantPermissionsAuthorizationRequest, type GrantPermissionsEntityRequest, type GrantPermissionsEuEntityAdminRequest, type GrantPermissionsEuEntityRepresentativeRequest, type GrantPermissionsEuEntityRequest, type GrantPermissionsIndirectRequest, type GrantPermissionsPersonRequest, type GrantPermissionsSubunitRequest, type HttpMethod, type HwmStore, INVOICE_TYPES_BY_SYSTEM_CODE, type IdDocument, InMemoryHwmStore, InMemoryOfflineInvoiceStorage, type IncrementalExportOptions, type IncrementalExportResult, type IndirectPermissionType, type IndirectPermissionsSubjectIdentifier, type IndirectPermissionsSubjectIdentifierType, type IndirectPermissionsTargetIdentifier, type IndirectPermissionsTargetIdentifierType, InternalId, InvoiceDownloadService, type InvoiceExportPackage, type InvoiceExportPackagePart, type InvoiceExportRequest, type InvoiceExportStatusResponse, type InvoiceFields, type InvoiceMetadata, type InvoiceMetadataAuthorizedSubject, type InvoiceMetadataBuyer, type InvoiceMetadataBuyerIdentifier, type InvoiceMetadataSeller, type InvoiceMetadataThirdSubject, type InvoiceMetadataThirdSubjectIdentifier, type InvoicePermissionType, type InvoiceQueryAmount, type InvoiceQueryBuyerIdentifier, type InvoiceQueryDateRange, type InvoiceQueryDateType, InvoiceQueryFilterBuilder, type InvoiceQueryFilters, type InvoiceStatusInfo, type InvoiceSubjectType, type InvoiceType, type InvoiceValidationError, type InvoiceValidationErrorCode, type InvoiceValidationResult, type InvoicingMode, Ip4Address, Ip4Mask, Ip4Range, KSEF_FEATURE_HEADER, KSeFApiError, KSeFAuthStatusError, KSeFClient, type KSeFClientOptions, KSeFError, KSeFForbiddenError, KSeFRateLimitError, KSeFSessionExpiredError, type KSeFTokenContext, KSeFUnauthorizedError, KSeFValidationError, type KsefMessagesResponse, KsefNumber, KsefNumberV35, KsefNumberV36, type KsefStatusResponse, type KsefSystemStatus, type KsefTokenPermissionType, type KsefTokenRequest, type KsefTokenResponse, type KsefTokenStatus, type LighthouseMessage, LighthouseService, LimitsService, type MaintenanceWindow, Nip, NipVatUe, type OfflineBatchResult, type OfflineCertificate, type OfflineInvoiceFilter, type OfflineInvoiceInputData, type OfflineInvoiceMetadata, type OfflineInvoiceOptions, type OfflineInvoiceStatus, type OfflineInvoiceStorage, type OfflineInvoiceUpdates, OfflineInvoiceWorkflow, type OfflineMode, type OfflineReason, type OfflineSubmissionResult, type OnlineSessionContextLimitsOverride, type OnlineSessionEffectiveContextLimits, type OnlineSessionFormCode, type OnlineSessionHandle, OnlineSessionService, type OpenBatchSessionRequest, type OpenBatchSessionResponse, type OpenOnlineSessionOptions, type OpenOnlineSessionRequest, type OpenOnlineSessionResponse, type OperationResponse, type OperationStatusInfo, PERMISSION_DESCRIPTION_MAX_LENGTH, PERMISSION_DESCRIPTION_MIN_LENGTH, type PagedAuthorizationsResponse, type PagedPermissionsResponse, type PagedRolesResponse, type ParsedBatchUploadResult, type ParsedUpoInfo, type PartUploadRequest, PeppolId, type PeppolProvider, PeppolService, type PermissionState, type PermissionSubjectIdentifierType, type PermissionWithDelegate, type PermissionsAttachmentAllowedResponse, type PermissionsEuEntityDetails, type PermissionsOperationStatusResponse, PermissionsService, type PermissionsSubjectEntityByFingerprintDetails, type PermissionsSubjectEntityByIdentifierDetails, type PermissionsSubjectEntityDetails, type PermissionsSubjectPersonByFingerprintDetails, type PermissionsSubjectPersonDetails, type PersonByFingerprintWithIdentifierDetails, type PersonByFingerprintWithoutIdentifierDetails, type PersonByIdentifierDetails, type PersonCreateRequest, type PersonIdentifier, type PersonIdentifierType, type PersonPermission, PersonPermissionGrantBuilder, type PersonPermissionSubjectDetails, type PersonPermissionType, type PersonPermissionsAuthorIdentifier, type PersonPermissionsAuthorIdentifierType, type PersonPermissionsAuthorizedIdentifier, type PersonPermissionsAuthorizedIdentifierType, type PersonPermissionsContextIdentifier, type PersonPermissionsContextIdentifierType, type PersonPermissionsQueryType, type PersonPermissionsTargetIdentifier, type PersonPermissionsTargetIdentifierType, type PersonRemoveRequest, type PersonSubjectByFingerprintDetailsType, type PersonSubjectDetailsType, type PersonSubjectIdentifier, type PersonalPermission, type PersonalPermissionScopeType, type PersonalPermissionsAuthorizedIdentifier, type PersonalPermissionsAuthorizedIdentifierType, type PersonalPermissionsContextIdentifier, type PersonalPermissionsContextIdentifierType, type PersonalPermissionsTargetIdentifier, type PersonalPermissionsTargetIdentifierType, Pesel, type Pkcs12AuthOptions, Pkcs12Loader, type Pkcs12Result, type PollOptions, type PresignedUrlPolicy, type PublicKeyCertificate, type PublicKeyCertificateUsage, type QRCodeContextIdentifierType, type QrCodeOptions, type QrCodeResult, QrCodeService, type QueryAuthorizationsGrantsRequest, type QueryCertificatesRequest, type QueryCertificatesResponse, type QueryEntitiesGrantsRequest, type QueryEntitiesRolesRequest, type QueryEuEntitiesGrantsRequest, type QueryInvoicesMetadataResponse, type QueryKsefTokensOptions, type QueryKsefTokensResponse, type QueryPeppolProvidersResponse, type QueryPersonalGrantsRequest, type QueryPersonsGrantsRequest, type QuerySubordinateEntitiesRolesRequest, type QuerySubunitsGrantsRequest, type QueryTokensResponseItem, REQUIRED_CHALLENGE_LENGTH, type RateLimitConfig, RateLimitPolicy, ReferenceNumber, type ResolvedOptions, RestClient, RestRequest, type RestResponse, type RetrieveCertificatesListItem, type RetrieveCertificatesRequest, type RetrieveCertificatesResponse, type RetryPolicy, type RevokeCertificateRequest, RouteBuilder, Routes, SUBUNIT_NAME_MAX_LENGTH, SUBUNIT_NAME_MIN_LENGTH, SchemaRegistry, type SelfSignedCertificateResult, type SendAndCloseOptions, type SendInvoiceRequest, type SendInvoiceResponse, type SessionInvoiceStatusResponse, type SessionInvoicesResponse, type SessionStatus, type SessionStatusResponse, SessionStatusService, type SessionType, type SessionsFilter, type SessionsQueryResponse, type SessionsQueryResponseItem, type SetRateLimitsRequest, type SetSessionLimitsRequest, type SetSubjectLimitsRequest, Sha256Base64, SignatureService, type SortOrder, type StatusInfo, type SubjectCreateRequest, type SubjectRemoveRequest, type SubjectType, type SubmitOfflineInvoicesOptions, type SubordinateEntityRole, type SubordinateEntityRoleType, type SubordinateRoleSubordinateEntityIdentifier, type SubordinateRoleSubordinateEntityIdentifierType, type Subunit, type SubunitPermission, type SubunitPermissionScope, type SubunitPermissionsAuthorIdentifier, type SubunitPermissionsAuthorIdentifierType, type SubunitPermissionsAuthorizedIdentifier, type SubunitPermissionsContextIdentifier, type SubunitPermissionsContextIdentifierType, type SubunitPermissionsSubjectIdentifier, type SubunitPermissionsSubjectIdentifierType, type SubunitPermissionsSubunitIdentifier, type SubunitPermissionsSubunitIdentifierType, SystemCode, type TechnicalCorrectionOptions, type TestDataAuthenticationContextIdentifier, type TestDataAuthenticationContextIdentifierType, type TestDataAuthorizedIdentifier, type TestDataAuthorizedIdentifierType, type TestDataContextIdentifier, type TestDataContextIdentifierType, type TestDataPermission, type TestDataPermissionType, type TestDataPermissionsGrantRequest, type TestDataPermissionsRevokeRequest, TestDataService, type ThirdSubjectIdentifierType, type TokenAuthOptions, type TokenAuthorIdentifier, type TokenAuthorIdentifierType, type TokenContextIdentifier, type TokenContextIdentifierType, type TokenInfo, TokenService, type TokenStatusResponse, type TransportFn, type UnauthorizedProblemDetails, type UnblockContextAuthenticationRequest, type UnzipOptions, type UpoAuthProof, type UpoContextId, type UpoDokument, type UpoInfo, type UpoOpisPotwierdzenia, type UpoPage, type UpoPotwierdzenie, type UpoResponse, type UpoResult, type UpoUwierzytelnienie, UpoVersion, UpoVersion as UpoVersionType, type ValidateOptions, type ValidationDetail, VatUe, VerificationLinkService, type X500NameFields, type XadesSubjectIdentifierType, type XmlConversionResult, type ZipEntryInput, addBusinessDays, authenticateWithCertificate, authenticateWithExternalSignature, authenticateWithPkcs12, authenticateWithToken, batchValidationDetails, buildUnsignedAuthTokenRequestXml, calculateBackoff, calculateOfflineDeadline, createZip, decodeJwtPayload, deduplicateByKsefNumber, defaultPresignedUrlPolicy, defaultRateLimitPolicy, defaultRetryPolicy, defaultTransport, exportAndDownload, exportInvoices, extendDeadlineForMaintenance, extractInvoiceFields, getDefaultReason, getEffectiveStartDate, getFormCode, getTimeUntilDeadline, incrementalExportAndDownload, isExpired, isRetryableError, isRetryableStatus, isValidBase64, isValidCertificateFingerprint, isValidCertificateName, isValidInternalId, isValidIp4Address, isValidKsefNumber, isValidKsefNumberV35, isValidKsefNumberV36, isValidNip, isValidNipVatUe, isValidPeppolId, isValidPesel, isValidReferenceNumber, isValidSha256Base64, isValidVatUe, nextBusinessDay, openOnlineSession, openSendAndClose, parseFormCode, parseKSeFTokenContext, parseRetryAfter, parseUpoXml, pollUntil, resolveOptions, sleep, unzip, updateContinuationPoint, uploadBatch, uploadBatchParsed, uploadBatchStream, uploadBatchStreamParsed, validate, validateBatch, validateBusinessRules, validateFormCodeForSession, validatePresignedUrl, validateSchema, validateWellFormedness, xmlToObject };
2955
+ export { ActiveSessionsService, type AllowedIps, type AmountType, type ApiErrorResponse, type ApiRateLimitValuesOverride, type ApiRateLimitsOverride, type AttachmentPermissionGrantRequest, type AttachmentPermissionRevokeRequest, type AuthChallengeResponse, type AuthKsefTokenRequest, AuthKsefTokenRequestBuilder, type AuthManager, type AuthResult, AuthService, type AuthSessionInfo, type AuthTokenRequest, AuthTokenRequestBuilder, type AuthTokenRequestXmlOptions, type AuthenticationInitResponse, type AuthenticationKsefToken, type AuthenticationListResponse, type AuthenticationMethod, type AuthenticationMethodInfo, type AuthenticationMethodInfoCategory, type AuthenticationOperationStatusResponse, type AuthenticationTokenRefreshResponse, type AuthenticationTokensResponse, type AuthorizationGrant, AuthorizationPermissionGrantBuilder, type AuthorizationPolicy, BATCH_MAX_PARTS, BATCH_MAX_PART_SIZE, BATCH_MAX_TOTAL_SIZE, Base64String, type BatchFileBuildOptions, type BatchFileBuildResult, BatchFileBuilder, type BatchFileInfo, type BatchFilePartInfo, type BatchPartSendingInfo, type BatchPartStreamSendingInfo, type BatchSessionContextLimitsOverride, type BatchSessionEffectiveContextLimits, type BatchSessionFormCode, BatchSessionService, type BatchSessionState, type BatchStreamBuildResult, type BatchUploadOptions, type BatchUploadResult, type BatchValidationResult, type BlockContextAuthenticationRequest, type BuyerIdentifierType, CERTIFICATE_NAME_MAX_LENGTH, CERTIFICATE_NAME_MIN_LENGTH, CertificateApiService, type CertificateAuthOptions, type CertificateEffectiveSubjectLimits, type CertificateEnrollmentDataResponse, type CertificateEnrollmentStatusResponse, CertificateFetcher, CertificateFingerprint, type CertificateLimit, type CertificateLimitsResponse, type CertificateListItem, CertificateName, type CertificateRevocationReason, CertificateService, type CertificateStatus, type CertificateSubjectIdentifier, type CertificateSubjectIdentifierType, type CertificateSubjectLimitsOverride, type CertificateType, type ContextIdentifier, type ContextIdentifierType, type ContinuationPoints, type CryptoEncryptionMethod, CryptographyService, type CsrResult, DEFAULT_FORM_CODE, DefaultAuthManager, ENFORCE_XADES_COMPLIANCE, type EffectiveApiRateLimitValues, type EffectiveApiRateLimits, type EffectiveContextLimits, type EffectiveSubjectLimits, type EncryptionData, type EncryptionInfo, type EnrollCertificateRequest, type EnrollCertificateResponse, type EnrollmentEffectiveSubjectLimits, type EnrollmentSubjectLimitsOverride, type EntityAuthorizationGrant, type EntityAuthorizationPermissionType, type EntityAuthorizationPermissionsSubjectIdentifierType, type EntityAuthorizationSubjectIdentifier, type EntityAuthorizationsAuthorIdentifier, type EntityAuthorizationsAuthorIdentifierType, type EntityAuthorizationsAuthorizedEntityIdentifier, type EntityAuthorizationsAuthorizedEntityIdentifierType, type EntityAuthorizationsAuthorizingEntityIdentifier, type EntityAuthorizationsAuthorizingEntityIdentifierType, type EntityAuthorizationsQueryType, type EntityByFingerprintDetails, type EntityDetails, type EntityPermission, EntityPermissionGrantBuilder, type EntityPermissionItem, type EntityPermissionItemType, type EntityPermissionsContextIdentifier, type EntityPermissionsContextIdentifierType, type EntityRole, type EntityRoleType, type EntityRolesParentEntityIdentifier, type EntityRolesParentEntityIdentifierType, type EntitySubjectByFingerprintDetailsType, type EntitySubjectByIdentifierDetailsType, type EntitySubjectDetailsType, type EntitySubjectIdentifier, Environment, type EnvironmentConfig, type EnvironmentName, type EuEntityAdministrationContextIdentifier, type EuEntityAdministrationPermissionsContextIdentifierType, type EuEntityAdministrationPermissionsSubjectIdentifierType, type EuEntityAdministrationSubjectIdentifier, type EuEntityDetails, type EuEntityPermission, type EuEntityPermissionSubjectDetails, type EuEntityPermissionSubjectDetailsType, type EuEntityPermissionType, type EuEntityPermissionsAuthorIdentifier, type EuEntityPermissionsAuthorIdentifierType, type EuEntityPermissionsQueryPermissionType, type EuEntityPermissionsSubjectIdentifier, type EuEntityPermissionsSubjectIdentifierType, type ExceptionDetails, type ExportAndDownloadOptions, type ExportDownloadResult, type ExportExtractedResult, type ExportOptions, type ExportResult, type ExternalSignatureAuthOptions, FORM_CODES, FORM_CODE_KEYS, FileHwmStore, type FileMetadata, FileOfflineInvoiceStorage, type ForbiddenProblemDetails, type ForbiddenReasonCode, type FormCode, type FormType, type GoneProblemDetails, type GrantPermissionsAuthorizationRequest, type GrantPermissionsEntityRequest, type GrantPermissionsEuEntityAdminRequest, type GrantPermissionsEuEntityRepresentativeRequest, type GrantPermissionsEuEntityRequest, type GrantPermissionsIndirectRequest, type GrantPermissionsPersonRequest, type GrantPermissionsSubunitRequest, type HttpMethod, type HwmStore, INVOICE_TYPES_BY_SYSTEM_CODE, type IdDocument, InMemoryHwmStore, InMemoryOfflineInvoiceStorage, type IncrementalExportOptions, type IncrementalExportResult, type IndirectPermissionType, type IndirectPermissionsSubjectIdentifier, type IndirectPermissionsSubjectIdentifierType, type IndirectPermissionsTargetIdentifier, type IndirectPermissionsTargetIdentifierType, InternalId, InvoiceDownloadService, type InvoiceExportPackage, type InvoiceExportPackagePart, type InvoiceExportRequest, type InvoiceExportStatusResponse, type InvoiceFields, type InvoiceMetadata, type InvoiceMetadataAuthorizedSubject, type InvoiceMetadataBuyer, type InvoiceMetadataBuyerIdentifier, type InvoiceMetadataSeller, type InvoiceMetadataThirdSubject, type InvoiceMetadataThirdSubjectIdentifier, type InvoicePermissionType, type InvoiceQueryAmount, type InvoiceQueryBuyerIdentifier, type InvoiceQueryDateRange, type InvoiceQueryDateType, InvoiceQueryFilterBuilder, type InvoiceQueryFilters, type InvoiceResult, type InvoiceStatusInfo, type InvoiceSubjectType, type InvoiceType, type InvoiceValidationError, type InvoiceValidationErrorCode, type InvoiceValidationResult, type InvoicingMode, Ip4Address, Ip4Mask, Ip4Range, KSEF_FEATURE_HEADER, KSeFApiError, KSeFAuthStatusError, KSeFBatchTimeoutError, KSeFClient, type KSeFClientOptions, KSeFError, KSeFErrorCode, KSeFForbiddenError, KSeFGoneError, KSeFRateLimitError, KSeFSessionExpiredError, type KSeFTokenContext, KSeFUnauthorizedError, KSeFValidationError, type KsefMessagesResponse, KsefNumber, KsefNumberV35, KsefNumberV36, type KsefStatusResponse, type KsefSystemStatus, type KsefTokenPermissionType, type KsefTokenRequest, type KsefTokenResponse, type KsefTokenStatus, type LighthouseMessage, LighthouseService, LimitsService, type LoginResult, type MaintenanceWindow, Nip, NipVatUe, type OfflineBatchResult, type OfflineCertificate, type OfflineInvoiceFilter, type OfflineInvoiceInputData, type OfflineInvoiceMetadata, type OfflineInvoiceOptions, type OfflineInvoiceStatus, type OfflineInvoiceStorage, type OfflineInvoiceUpdates, OfflineInvoiceWorkflow, type OfflineMode, type OfflineReason, type OfflineSubmissionResult, type OnlineSessionContextLimitsOverride, type OnlineSessionEffectiveContextLimits, type OnlineSessionFormCode, type OnlineSessionHandle, OnlineSessionService, type OnlineSessionState, type OpenBatchSessionRequest, type OpenBatchSessionResponse, type OpenOnlineSessionOptions, type OpenOnlineSessionRequest, type OpenOnlineSessionResponse, type OperationResponse, type OperationStatusInfo, PERMISSION_DESCRIPTION_MAX_LENGTH, PERMISSION_DESCRIPTION_MIN_LENGTH, type PagedAuthorizationsResponse, type PagedPermissionsResponse, type PagedRolesResponse, type ParsedBatchUploadResult, type ParsedUpoInfo, type PartUploadRequest, PeppolId, type PeppolProvider, PeppolService, type PermissionState, type PermissionSubjectIdentifierType, type PermissionWithDelegate, type PermissionsAttachmentAllowedResponse, type PermissionsEuEntityDetails, type PermissionsOperationStatusResponse, PermissionsService, type PermissionsSubjectEntityByFingerprintDetails, type PermissionsSubjectEntityByIdentifierDetails, type PermissionsSubjectEntityDetails, type PermissionsSubjectPersonByFingerprintDetails, type PermissionsSubjectPersonDetails, type PersonByFingerprintWithIdentifierDetails, type PersonByFingerprintWithoutIdentifierDetails, type PersonByIdentifierDetails, type PersonCreateRequest, type PersonIdentifier, type PersonIdentifierType, type PersonPermission, PersonPermissionGrantBuilder, type PersonPermissionSubjectDetails, type PersonPermissionType, type PersonPermissionsAuthorIdentifier, type PersonPermissionsAuthorIdentifierType, type PersonPermissionsAuthorizedIdentifier, type PersonPermissionsAuthorizedIdentifierType, type PersonPermissionsContextIdentifier, type PersonPermissionsContextIdentifierType, type PersonPermissionsQueryType, type PersonPermissionsTargetIdentifier, type PersonPermissionsTargetIdentifierType, type PersonRemoveRequest, type PersonSubjectByFingerprintDetailsType, type PersonSubjectDetailsType, type PersonSubjectIdentifier, type PersonalPermission, type PersonalPermissionScopeType, type PersonalPermissionsAuthorizedIdentifier, type PersonalPermissionsAuthorizedIdentifierType, type PersonalPermissionsContextIdentifier, type PersonalPermissionsContextIdentifierType, type PersonalPermissionsTargetIdentifier, type PersonalPermissionsTargetIdentifierType, Pesel, type Pkcs12AuthOptions, Pkcs12Loader, type Pkcs12Result, type PollOptions, type PresignedUrlPolicy, type PublicKeyCertificate, type PublicKeyCertificateUsage, type QRCodeContextIdentifierType, type QrCodeOptions, type QrCodeResult, QrCodeService, type QueryAuthorizationsGrantsRequest, type QueryCertificatesRequest, type QueryCertificatesResponse, type QueryEntitiesGrantsRequest, type QueryEntitiesRolesRequest, type QueryEuEntitiesGrantsRequest, type QueryInvoicesMetadataResponse, type QueryKsefTokensOptions, type QueryKsefTokensResponse, type QueryPeppolProvidersResponse, type QueryPersonalGrantsRequest, type QueryPersonsGrantsRequest, type QuerySubordinateEntitiesRolesRequest, type QuerySubunitsGrantsRequest, type QueryTokensResponseItem, REQUIRED_CHALLENGE_LENGTH, type RateLimitConfig, RateLimitPolicy, ReferenceNumber, type ResolvedOptions, RestClient, RestRequest, type RestResponse, type RetrieveCertificatesListItem, type RetrieveCertificatesRequest, type RetrieveCertificatesResponse, type RetryPolicy, type RevokeCertificateRequest, RouteBuilder, Routes, SUBUNIT_NAME_MAX_LENGTH, SUBUNIT_NAME_MIN_LENGTH, SchemaRegistry, type SelfSignedCertificateResult, type SendAndCloseOptions, type SendInvoiceRequest, type SendInvoiceResponse, type SessionInvoiceStatusResponse, type SessionInvoicesResponse, type SessionStatus, type SessionStatusResponse, SessionStatusService, type SessionType, type SessionsFilter, type SessionsQueryResponse, type SessionsQueryResponseItem, type SetRateLimitsRequest, type SetSessionLimitsRequest, type SetSubjectLimitsRequest, Sha256Base64, SignatureService, type SortOrder, type StatusInfo, type SubjectCreateRequest, type SubjectRemoveRequest, type SubjectType, type SubmitOfflineInvoicesOptions, type SubordinateEntityRole, type SubordinateEntityRoleType, type SubordinateRoleSubordinateEntityIdentifier, type SubordinateRoleSubordinateEntityIdentifierType, type Subunit, type SubunitPermission, type SubunitPermissionScope, type SubunitPermissionsAuthorIdentifier, type SubunitPermissionsAuthorIdentifierType, type SubunitPermissionsAuthorizedIdentifier, type SubunitPermissionsContextIdentifier, type SubunitPermissionsContextIdentifierType, type SubunitPermissionsSubjectIdentifier, type SubunitPermissionsSubjectIdentifierType, type SubunitPermissionsSubunitIdentifier, type SubunitPermissionsSubunitIdentifierType, SystemCode, type TechnicalCorrectionOptions, type TestDataAuthenticationContextIdentifier, type TestDataAuthenticationContextIdentifierType, type TestDataAuthorizedIdentifier, type TestDataAuthorizedIdentifierType, type TestDataContextIdentifier, type TestDataContextIdentifierType, type TestDataPermission, type TestDataPermissionType, type TestDataPermissionsGrantRequest, type TestDataPermissionsRevokeRequest, TestDataService, type ThirdSubjectIdentifierType, type TokenAuthOptions, type TokenAuthorIdentifier, type TokenAuthorIdentifierType, type TokenContextIdentifier, type TokenContextIdentifierType, type TokenInfo, TokenService, type TokenStatusResponse, type TransportFn, type UnauthorizedProblemDetails, type UnblockContextAuthenticationRequest, type UnzipOptions, type UpoAuthProof, type UpoContextId, type UpoDokument, type UpoInfo, type UpoOpisPotwierdzenia, type UpoPage, type UpoPotwierdzenie, type UpoResponse, type UpoResult, type UpoUwierzytelnienie, UpoVersion, UpoVersion as UpoVersionType, type ValidateOptions, type ValidationDetail, VatUe, VerificationLinkService, type X500NameFields, type XadesSubjectIdentifierType, type XmlConversionResult, type ZipEntryInput, addBusinessDays, authenticateWithCertificate, authenticateWithExternalSignature, authenticateWithPkcs12, authenticateWithToken, batchValidationDetails, buildUnsignedAuthTokenRequestXml, calculateBackoff, calculateOfflineDeadline, createZip, decodeJwtPayload, deduplicateByKsefNumber, defaultPresignedUrlPolicy, defaultRateLimitPolicy, defaultRetryPolicy, defaultTransport, exportAndDownload, exportInvoices, extendDeadlineForMaintenance, extractInvoiceFields, getDefaultReason, getEffectiveStartDate, getFormCode, getPolishHolidays, getTimeUntilDeadline, incrementalExportAndDownload, isExpired, isPolishHoliday, isRetryableError, isRetryableStatus, isValidBase64, isValidCertificateFingerprint, isValidCertificateName, isValidInternalId, isValidIp4Address, isValidKsefNumber, isValidKsefNumberV35, isValidKsefNumberV36, isValidNip, isValidNipVatUe, isValidPeppolId, isValidPesel, isValidReferenceNumber, isValidSha256Base64, isValidVatUe, nextBusinessDay, openOnlineSession, openSendAndClose, parseFormCode, parseKSeFTokenContext, parseRetryAfter, parseUpoXml, pollUntil, resolveOptions, resumeOnlineSession, runWithConcurrency, sha256Base64, sleep, unzip, updateContinuationPoint, uploadBatch, uploadBatchParsed, uploadBatchStream, uploadBatchStreamParsed, validate, validateBatch, validateBusinessRules, validateFormCodeForSession, validatePresignedUrl, validateSchema, validateWellFormedness, verifyHash, xmlToObject };