ksef-client-ts 0.5.2 → 0.6.1
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/README.md +2 -1
- package/dist/cli.js +1198 -158
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +962 -119
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +307 -7
- package/dist/index.d.ts +307 -7
- package/dist/index.js +945 -119
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -845,6 +845,37 @@ interface UpoResult {
|
|
|
845
845
|
hash?: string;
|
|
846
846
|
}
|
|
847
847
|
|
|
848
|
+
/**
|
|
849
|
+
* Serializable state of an online session. All binary data is Base64-encoded.
|
|
850
|
+
*
|
|
851
|
+
* **Security:** contains AES encryption keys in plaintext. Treat serialized
|
|
852
|
+
* state as sensitive data — encrypt at rest or store in a secure vault.
|
|
853
|
+
*/
|
|
854
|
+
interface OnlineSessionState {
|
|
855
|
+
referenceNumber: string;
|
|
856
|
+
/** AES-256 cipher key, Base64-encoded. */
|
|
857
|
+
aesKey: string;
|
|
858
|
+
/** AES-256 initialization vector, Base64-encoded. */
|
|
859
|
+
iv: string;
|
|
860
|
+
accessToken: string;
|
|
861
|
+
formCode: FormCode;
|
|
862
|
+
/** Session expiration time, ISO 8601. */
|
|
863
|
+
validUntil: string;
|
|
864
|
+
/** Whether invoices are validated against XSD before sending. */
|
|
865
|
+
validate?: boolean;
|
|
866
|
+
}
|
|
867
|
+
/** Serializable state of a batch session. */
|
|
868
|
+
interface BatchSessionState {
|
|
869
|
+
referenceNumber: string;
|
|
870
|
+
/** AES-256 cipher key, Base64-encoded. */
|
|
871
|
+
aesKey: string;
|
|
872
|
+
/** AES-256 initialization vector, Base64-encoded. */
|
|
873
|
+
iv: string;
|
|
874
|
+
accessToken: string;
|
|
875
|
+
formCode: FormCode;
|
|
876
|
+
partUploadRequests: PartUploadRequest[];
|
|
877
|
+
}
|
|
878
|
+
|
|
848
879
|
/**
|
|
849
880
|
* Invoice subject type — defines the taxpayer's role in the invoice.
|
|
850
881
|
* - `Subject1` — seller (invoices issued by us)
|
|
@@ -944,6 +975,11 @@ interface QueryInvoicesMetadataResponse {
|
|
|
944
975
|
invoices: InvoiceMetadata[];
|
|
945
976
|
permanentStorageHwmDate?: string;
|
|
946
977
|
}
|
|
978
|
+
interface InvoiceResult {
|
|
979
|
+
xml: string;
|
|
980
|
+
/** SHA-256 base64 hash from the `x-ms-meta-hash` response header, if present. */
|
|
981
|
+
hash?: string;
|
|
982
|
+
}
|
|
947
983
|
interface InvoiceExportRequest {
|
|
948
984
|
encryption: EncryptionInfo;
|
|
949
985
|
filters: InvoiceQueryFilters;
|
|
@@ -1883,13 +1919,13 @@ declare class BatchSessionService {
|
|
|
1883
1919
|
private readonly restClient;
|
|
1884
1920
|
constructor(restClient: RestClient);
|
|
1885
1921
|
openSession(request: OpenBatchSessionRequest, upoVersion?: UpoVersion | string): Promise<OpenBatchSessionResponse>;
|
|
1886
|
-
sendParts(openResponse: OpenBatchSessionResponse, parts: BatchPartSendingInfo[]): Promise<void>;
|
|
1922
|
+
sendParts(openResponse: OpenBatchSessionResponse, parts: BatchPartSendingInfo[], parallelism?: number): Promise<void>;
|
|
1887
1923
|
/**
|
|
1888
|
-
* Upload parts
|
|
1889
|
-
*
|
|
1890
|
-
*
|
|
1924
|
+
* Upload parts using streaming bodies (`duplex: 'half'`).
|
|
1925
|
+
* By default uploads sequentially to avoid backpressure issues.
|
|
1926
|
+
* Pass `parallelism` to enable bounded concurrent uploads.
|
|
1891
1927
|
*/
|
|
1892
|
-
sendPartsWithStream(openResponse: OpenBatchSessionResponse, parts: BatchPartStreamSendingInfo[]): Promise<void>;
|
|
1928
|
+
sendPartsWithStream(openResponse: OpenBatchSessionResponse, parts: BatchPartStreamSendingInfo[], parallelism?: number): Promise<void>;
|
|
1893
1929
|
closeSession(batchRef: string): Promise<void>;
|
|
1894
1930
|
}
|
|
1895
1931
|
|
|
@@ -1909,7 +1945,7 @@ declare class SessionStatusService {
|
|
|
1909
1945
|
declare class InvoiceDownloadService {
|
|
1910
1946
|
private readonly restClient;
|
|
1911
1947
|
constructor(restClient: RestClient);
|
|
1912
|
-
getInvoice(ksefNumber: string): Promise<
|
|
1948
|
+
getInvoice(ksefNumber: string): Promise<InvoiceResult>;
|
|
1913
1949
|
queryInvoiceMetadata(filters: InvoiceQueryFilters, pageOffset?: number, pageSize?: number, sortOrder?: SortOrder): Promise<QueryInvoicesMetadataResponse>;
|
|
1914
1950
|
exportInvoices(request: InvoiceExportRequest): Promise<OperationResponse>;
|
|
1915
1951
|
getInvoiceExportStatus(ref: string): Promise<InvoiceExportStatusResponse>;
|
|
@@ -2344,6 +2380,26 @@ interface KSeFTokenContext {
|
|
|
2344
2380
|
declare function decodeJwtPayload(token: string): Record<string, unknown> | null;
|
|
2345
2381
|
declare function parseKSeFTokenContext(token: string): KSeFTokenContext | null;
|
|
2346
2382
|
|
|
2383
|
+
/** Compute SHA-256 hash of data, returned as base64 string. */
|
|
2384
|
+
declare function sha256Base64(data: Uint8Array): string;
|
|
2385
|
+
/** Returns true if SHA-256 base64 of `data` matches `expectedHash`. */
|
|
2386
|
+
declare function verifyHash(data: Uint8Array, expectedHash: string): boolean;
|
|
2387
|
+
|
|
2388
|
+
/**
|
|
2389
|
+
* Execute async tasks with bounded concurrency using a worker-pool pattern.
|
|
2390
|
+
*
|
|
2391
|
+
* Creates `parallelism` workers that pull from a shared task queue.
|
|
2392
|
+
* Safe in single-threaded JS — index read+increment is atomic between await points.
|
|
2393
|
+
*
|
|
2394
|
+
* On first failure the shared AbortController is triggered so that:
|
|
2395
|
+
* 1. No new tasks are dequeued.
|
|
2396
|
+
* 2. In-flight tasks receive the abort signal (e.g. to cancel fetch requests).
|
|
2397
|
+
*
|
|
2398
|
+
* @param tasks - Array of async thunks that receive an AbortSignal
|
|
2399
|
+
* @param parallelism - Maximum number of concurrent workers (clamped to [1, tasks.length])
|
|
2400
|
+
*/
|
|
2401
|
+
declare function runWithConcurrency(tasks: Array<(signal: AbortSignal) => Promise<void>>, parallelism: number): Promise<void>;
|
|
2402
|
+
|
|
2347
2403
|
type UpoContextId = {
|
|
2348
2404
|
kind: 'Nip';
|
|
2349
2405
|
nip: string;
|
|
@@ -2396,6 +2452,19 @@ interface UpoPotwierdzenie {
|
|
|
2396
2452
|
}
|
|
2397
2453
|
declare function parseUpoXml(xml: string | Buffer): UpoPotwierdzenie;
|
|
2398
2454
|
|
|
2455
|
+
interface InvoiceFields {
|
|
2456
|
+
invoiceNumber: string;
|
|
2457
|
+
invoiceDate: string;
|
|
2458
|
+
}
|
|
2459
|
+
/**
|
|
2460
|
+
* Extracts invoice number and date from KSeF invoice XML.
|
|
2461
|
+
*
|
|
2462
|
+
* Supports:
|
|
2463
|
+
* - FA formats (FA_2, FA_3, FA_3_SELF): `Faktura > Fa > P_2` (number), `P_1` (date)
|
|
2464
|
+
* - FA_RR format: `Faktura > FakturaRR > P_4C` (number), `P_4B` (date)
|
|
2465
|
+
*/
|
|
2466
|
+
declare function extractInvoiceFields(xml: string): InvoiceFields;
|
|
2467
|
+
|
|
2399
2468
|
interface PollOptions {
|
|
2400
2469
|
intervalMs?: number;
|
|
2401
2470
|
maxAttempts?: number;
|
|
@@ -2408,6 +2477,8 @@ interface OnlineSessionHandle {
|
|
|
2408
2477
|
close(): Promise<void>;
|
|
2409
2478
|
waitForUpo(options?: PollOptions): Promise<UpoInfo>;
|
|
2410
2479
|
waitForUpoParsed(options?: PollOptions): Promise<ParsedUpoInfo>;
|
|
2480
|
+
/** Serialize session state for persistence. Restore with `resumeOnlineSession()`. */
|
|
2481
|
+
getState(): OnlineSessionState;
|
|
2411
2482
|
}
|
|
2412
2483
|
interface UpoInfo {
|
|
2413
2484
|
pages: Array<{
|
|
@@ -2435,6 +2506,7 @@ interface ExportResult {
|
|
|
2435
2506
|
url: string;
|
|
2436
2507
|
method: string;
|
|
2437
2508
|
partSize: number;
|
|
2509
|
+
partHash: string;
|
|
2438
2510
|
encryptedPartSize: number;
|
|
2439
2511
|
encryptedPartHash: string;
|
|
2440
2512
|
expirationDate: string;
|
|
@@ -2455,6 +2527,140 @@ declare function pollUntil<T>(action: () => Promise<T>, condition: (result: T) =
|
|
|
2455
2527
|
description?: string;
|
|
2456
2528
|
}): Promise<T>;
|
|
2457
2529
|
|
|
2530
|
+
interface OfflineInvoiceFilter {
|
|
2531
|
+
status?: OfflineInvoiceStatus | OfflineInvoiceStatus[];
|
|
2532
|
+
mode?: OfflineMode;
|
|
2533
|
+
expiringBefore?: Date | string;
|
|
2534
|
+
sellerNip?: string;
|
|
2535
|
+
}
|
|
2536
|
+
type OfflineInvoiceUpdates = Omit<Partial<OfflineInvoiceMetadata>, 'id'>;
|
|
2537
|
+
interface OfflineInvoiceStorage {
|
|
2538
|
+
save(invoice: OfflineInvoiceMetadata): Promise<void>;
|
|
2539
|
+
get(id: string): Promise<OfflineInvoiceMetadata | null>;
|
|
2540
|
+
list(filter?: OfflineInvoiceFilter): Promise<OfflineInvoiceMetadata[]>;
|
|
2541
|
+
update(id: string, updates: OfflineInvoiceUpdates): Promise<void>;
|
|
2542
|
+
delete(id: string): Promise<void>;
|
|
2543
|
+
}
|
|
2544
|
+
declare class InMemoryOfflineInvoiceStorage implements OfflineInvoiceStorage {
|
|
2545
|
+
private readonly store;
|
|
2546
|
+
save(invoice: OfflineInvoiceMetadata): Promise<void>;
|
|
2547
|
+
get(id: string): Promise<OfflineInvoiceMetadata | null>;
|
|
2548
|
+
list(filter?: OfflineInvoiceFilter): Promise<OfflineInvoiceMetadata[]>;
|
|
2549
|
+
update(id: string, updates: OfflineInvoiceUpdates): Promise<void>;
|
|
2550
|
+
delete(id: string): Promise<void>;
|
|
2551
|
+
}
|
|
2552
|
+
|
|
2553
|
+
/** Offline invoice modes per KSeF docs (art. 106nda/106nh/106nf) */
|
|
2554
|
+
type OfflineMode = 'offline24' | 'offline' | 'awaryjny' | 'awaria_calkowita';
|
|
2555
|
+
/** Why this invoice was issued offline */
|
|
2556
|
+
type OfflineReason = 'PLANNED' | 'SYSTEM_UNAVAILABLE' | 'EMERGENCY' | 'TOTAL_FAILURE';
|
|
2557
|
+
/**
|
|
2558
|
+
* Offline invoice lifecycle state machine:
|
|
2559
|
+
* GENERATED → QUEUED → SUBMITTED → ACCEPTED | REJECTED
|
|
2560
|
+
* Any non-terminal → EXPIRED
|
|
2561
|
+
*/
|
|
2562
|
+
type OfflineInvoiceStatus = 'GENERATED' | 'QUEUED' | 'SUBMITTED' | 'ACCEPTED' | 'REJECTED' | 'CORRECTED' | 'EXPIRED';
|
|
2563
|
+
interface OfflineInvoiceInputData {
|
|
2564
|
+
invoiceNumber: string;
|
|
2565
|
+
invoiceDate: string;
|
|
2566
|
+
invoiceXml: string;
|
|
2567
|
+
sellerNip: string;
|
|
2568
|
+
sellerIdentifier: ContextIdentifier;
|
|
2569
|
+
buyerIdentifier?: ContextIdentifier;
|
|
2570
|
+
totalAmount?: number;
|
|
2571
|
+
currency?: string;
|
|
2572
|
+
}
|
|
2573
|
+
interface OfflineCertificate {
|
|
2574
|
+
privateKeyPem: string;
|
|
2575
|
+
certificateSerial: string;
|
|
2576
|
+
password?: string;
|
|
2577
|
+
}
|
|
2578
|
+
interface MaintenanceWindow {
|
|
2579
|
+
id: string;
|
|
2580
|
+
startTime: string;
|
|
2581
|
+
endTime?: string;
|
|
2582
|
+
active: boolean;
|
|
2583
|
+
planned: boolean;
|
|
2584
|
+
reason?: string;
|
|
2585
|
+
}
|
|
2586
|
+
interface OfflineInvoiceMetadata {
|
|
2587
|
+
id: string;
|
|
2588
|
+
mode: OfflineMode;
|
|
2589
|
+
reason: OfflineReason;
|
|
2590
|
+
status: OfflineInvoiceStatus;
|
|
2591
|
+
invoiceNumber: string;
|
|
2592
|
+
invoiceDate: string;
|
|
2593
|
+
invoiceXml: string;
|
|
2594
|
+
sellerNip: string;
|
|
2595
|
+
sellerIdentifier: ContextIdentifier;
|
|
2596
|
+
buyerIdentifier?: ContextIdentifier;
|
|
2597
|
+
totalAmount?: number;
|
|
2598
|
+
currency?: string;
|
|
2599
|
+
kod1Url: string;
|
|
2600
|
+
kod2Url?: string;
|
|
2601
|
+
generatedAt: string;
|
|
2602
|
+
submitBy: string;
|
|
2603
|
+
submittedAt?: string;
|
|
2604
|
+
acceptedAt?: string;
|
|
2605
|
+
ksefReferenceNumber?: string;
|
|
2606
|
+
error?: {
|
|
2607
|
+
code: number;
|
|
2608
|
+
message: string;
|
|
2609
|
+
details?: string[];
|
|
2610
|
+
};
|
|
2611
|
+
maintenanceWindowId?: string;
|
|
2612
|
+
correctedInvoiceId?: string;
|
|
2613
|
+
correctedBy?: string;
|
|
2614
|
+
}
|
|
2615
|
+
interface OfflineInvoiceOptions {
|
|
2616
|
+
mode?: OfflineMode;
|
|
2617
|
+
certificate?: OfflineCertificate;
|
|
2618
|
+
maintenanceWindow?: MaintenanceWindow;
|
|
2619
|
+
customDeadline?: Date | string;
|
|
2620
|
+
storage?: OfflineInvoiceStorage;
|
|
2621
|
+
}
|
|
2622
|
+
interface OfflineBatchResult {
|
|
2623
|
+
total: number;
|
|
2624
|
+
submitted: number;
|
|
2625
|
+
accepted: number;
|
|
2626
|
+
rejected: number;
|
|
2627
|
+
failed: number;
|
|
2628
|
+
expired: number;
|
|
2629
|
+
results: OfflineSubmissionResult[];
|
|
2630
|
+
}
|
|
2631
|
+
interface OfflineSubmissionResult {
|
|
2632
|
+
invoiceId: string;
|
|
2633
|
+
invoiceNumber: string;
|
|
2634
|
+
status: OfflineInvoiceStatus;
|
|
2635
|
+
ksefReferenceNumber?: string;
|
|
2636
|
+
error?: {
|
|
2637
|
+
code: number;
|
|
2638
|
+
message: string;
|
|
2639
|
+
details?: string[];
|
|
2640
|
+
};
|
|
2641
|
+
}
|
|
2642
|
+
|
|
2643
|
+
interface SubmitOfflineInvoicesOptions {
|
|
2644
|
+
storage: OfflineInvoiceStorage;
|
|
2645
|
+
invoiceIds?: string[];
|
|
2646
|
+
checkExpiry?: boolean;
|
|
2647
|
+
formCode?: FormCode;
|
|
2648
|
+
}
|
|
2649
|
+
interface TechnicalCorrectionOptions {
|
|
2650
|
+
rejectedInvoiceId: string;
|
|
2651
|
+
correctedInvoiceXml: string;
|
|
2652
|
+
storage: OfflineInvoiceStorage;
|
|
2653
|
+
formCode?: FormCode;
|
|
2654
|
+
certificate?: OfflineCertificate;
|
|
2655
|
+
}
|
|
2656
|
+
declare class OfflineInvoiceWorkflow {
|
|
2657
|
+
private readonly qrService;
|
|
2658
|
+
constructor(qrService: VerificationLinkService);
|
|
2659
|
+
generate(input: OfflineInvoiceInputData, options?: OfflineInvoiceOptions): Promise<OfflineInvoiceMetadata>;
|
|
2660
|
+
submit(client: KSeFClient, options: SubmitOfflineInvoicesOptions): Promise<OfflineBatchResult>;
|
|
2661
|
+
correct(client: KSeFClient, options: TechnicalCorrectionOptions): Promise<OfflineSubmissionResult>;
|
|
2662
|
+
}
|
|
2663
|
+
|
|
2458
2664
|
declare class KSeFClient {
|
|
2459
2665
|
readonly auth: AuthService;
|
|
2460
2666
|
readonly activeSessions: ActiveSessionsService;
|
|
@@ -2473,7 +2679,12 @@ declare class KSeFClient {
|
|
|
2473
2679
|
readonly qr: VerificationLinkService;
|
|
2474
2680
|
readonly options: ResolvedOptions;
|
|
2475
2681
|
readonly authManager: AuthManager;
|
|
2682
|
+
private readonly _baseRestClientConfig;
|
|
2683
|
+
private _offline?;
|
|
2476
2684
|
constructor(options?: KSeFClientOptions);
|
|
2685
|
+
get offline(): OfflineInvoiceWorkflow;
|
|
2686
|
+
/** @internal Create a RestClient with a different AuthManager, preserving transport/retry/rateLimit config. */
|
|
2687
|
+
createScopedRestClient(authManager: AuthManager): RestClient;
|
|
2477
2688
|
loginWithToken(token: string, nip: string): Promise<void>;
|
|
2478
2689
|
loginWithCertificate(certPem: string, keyPem: string, nip: string, keyPassword?: string): Promise<void>;
|
|
2479
2690
|
loginWithPkcs12(p12: Buffer | Uint8Array, password: string, nip: string): Promise<void>;
|
|
@@ -2491,6 +2702,7 @@ interface SendAndCloseOptions extends OpenOnlineSessionOptions {
|
|
|
2491
2702
|
pollOptions?: PollOptions;
|
|
2492
2703
|
}
|
|
2493
2704
|
declare function openOnlineSession(client: KSeFClient, options?: OpenOnlineSessionOptions): Promise<OnlineSessionHandle>;
|
|
2705
|
+
declare function resumeOnlineSession(client: KSeFClient, state: OnlineSessionState, options?: Pick<OpenOnlineSessionOptions, 'validate'>): OnlineSessionHandle;
|
|
2494
2706
|
declare function openSendAndClose(client: KSeFClient, invoices: Array<string | Uint8Array>, options?: SendAndCloseOptions): Promise<UpoInfo>;
|
|
2495
2707
|
|
|
2496
2708
|
interface BatchUploadOptions {
|
|
@@ -2503,6 +2715,8 @@ interface BatchUploadOptions {
|
|
|
2503
2715
|
offlineMode?: boolean;
|
|
2504
2716
|
/** Validate each invoice XML in the ZIP before uploading. */
|
|
2505
2717
|
validate?: boolean;
|
|
2718
|
+
/** Number of concurrent part uploads. Omit for default behavior (buffer: all parallel, stream: sequential). */
|
|
2719
|
+
parallelism?: number;
|
|
2506
2720
|
}
|
|
2507
2721
|
declare function uploadBatch(client: KSeFClient, zipData: Uint8Array, options?: BatchUploadOptions): Promise<BatchUploadResult>;
|
|
2508
2722
|
|
|
@@ -2521,6 +2735,8 @@ interface ExportAndDownloadOptions extends ExportOptions {
|
|
|
2521
2735
|
extract?: boolean;
|
|
2522
2736
|
/** Options for ZIP extraction safety limits (only used when extract is true). */
|
|
2523
2737
|
unzipOptions?: UnzipOptions;
|
|
2738
|
+
/** Verify SHA-256 hash of encrypted parts after download. Defaults to true. */
|
|
2739
|
+
verifyHash?: boolean;
|
|
2524
2740
|
}
|
|
2525
2741
|
declare function exportInvoices(client: KSeFClient, filters: InvoiceQueryFilters, options?: ExportOptions): Promise<ExportResult>;
|
|
2526
2742
|
declare function exportAndDownload(client: KSeFClient, filters: InvoiceQueryFilters, options: ExportAndDownloadOptions & {
|
|
@@ -2561,6 +2777,8 @@ interface IncrementalExportOptions {
|
|
|
2561
2777
|
pollOptions?: PollOptions;
|
|
2562
2778
|
onlyMetadata?: boolean;
|
|
2563
2779
|
transport?: typeof fetch;
|
|
2780
|
+
/** Verify SHA-256 hash of encrypted parts after download. Defaults to true. */
|
|
2781
|
+
verifyHash?: boolean;
|
|
2564
2782
|
store?: HwmStore;
|
|
2565
2783
|
onIterationComplete?: (iteration: number, result: ExportResult) => void;
|
|
2566
2784
|
}
|
|
@@ -2615,4 +2833,86 @@ interface ExternalSignatureAuthOptions {
|
|
|
2615
2833
|
declare function authenticateWithExternalSignature(client: KSeFClient, options: ExternalSignatureAuthOptions): Promise<AuthResult>;
|
|
2616
2834
|
declare function authenticateWithPkcs12(client: KSeFClient, options: Pkcs12AuthOptions): Promise<AuthResult>;
|
|
2617
2835
|
|
|
2618
|
-
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, 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, 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 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, Nip, NipVatUe, 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 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 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, authenticateWithCertificate, authenticateWithExternalSignature, authenticateWithPkcs12, authenticateWithToken, batchValidationDetails, buildUnsignedAuthTokenRequestXml, calculateBackoff, createZip, decodeJwtPayload, deduplicateByKsefNumber, defaultPresignedUrlPolicy, defaultRateLimitPolicy, defaultRetryPolicy, defaultTransport, exportAndDownload, exportInvoices, getEffectiveStartDate, getFormCode, incrementalExportAndDownload, isRetryableError, isRetryableStatus, isValidBase64, isValidCertificateFingerprint, isValidCertificateName, isValidInternalId, isValidIp4Address, isValidKsefNumber, isValidKsefNumberV35, isValidKsefNumberV36, isValidNip, isValidNipVatUe, isValidPeppolId, isValidPesel, isValidReferenceNumber, isValidSha256Base64, isValidVatUe, openOnlineSession, openSendAndClose, parseFormCode, parseKSeFTokenContext, parseRetryAfter, parseUpoXml, pollUntil, resolveOptions, sleep, unzip, updateContinuationPoint, uploadBatch, uploadBatchParsed, uploadBatchStream, uploadBatchStreamParsed, validate, validateBatch, validateBusinessRules, validateFormCodeForSession, validatePresignedUrl, validateSchema, validateWellFormedness, xmlToObject };
|
|
2836
|
+
/**
|
|
2837
|
+
* Offline invoice deadline calculation.
|
|
2838
|
+
*
|
|
2839
|
+
* All business-day arithmetic uses UTC methods (getUTCDay, setUTCDate).
|
|
2840
|
+
* KSeF deadlines are specified as calendar dates, not wall-clock times,
|
|
2841
|
+
* so UTC produces correct results for date-only calculations regardless
|
|
2842
|
+
* of the caller's timezone. The endOfDay() helper sets 23:59:59.999 UTC
|
|
2843
|
+
* as a conservative cutoff.
|
|
2844
|
+
*/
|
|
2845
|
+
|
|
2846
|
+
declare function getDefaultReason(mode: OfflineMode): OfflineReason;
|
|
2847
|
+
declare function nextBusinessDay(from: Date): Date;
|
|
2848
|
+
declare function addBusinessDays(from: Date, days: number): Date;
|
|
2849
|
+
/**
|
|
2850
|
+
* Calculate submission deadline for offline invoice.
|
|
2851
|
+
*
|
|
2852
|
+
* - offline24: next business day after invoiceDate
|
|
2853
|
+
* - offline: next business day after maintenance window ends
|
|
2854
|
+
* - awaryjny: 7 business days after maintenance window ends
|
|
2855
|
+
* - awaria_calkowita: far-future (obligation suspended)
|
|
2856
|
+
*/
|
|
2857
|
+
declare function calculateOfflineDeadline(mode: OfflineMode, invoiceDate: Date | string, maintenanceWindow?: MaintenanceWindow): Date;
|
|
2858
|
+
/**
|
|
2859
|
+
* Extend deadline when a new maintenance window cascades.
|
|
2860
|
+
* Returns the new deadline if maintenance ends after current deadline, otherwise keeps current.
|
|
2861
|
+
*/
|
|
2862
|
+
declare function extendDeadlineForMaintenance(currentDeadline: Date | string, maintenanceWindow: MaintenanceWindow, mode?: OfflineMode): Date;
|
|
2863
|
+
declare function isExpired(submitBy: Date | string): boolean;
|
|
2864
|
+
declare function getTimeUntilDeadline(submitBy: Date | string): number;
|
|
2865
|
+
|
|
2866
|
+
/**
|
|
2867
|
+
* Get all Polish statutory holidays for a given year.
|
|
2868
|
+
* Returns a Set of ISO date strings ('YYYY-MM-DD').
|
|
2869
|
+
*
|
|
2870
|
+
* Source: Ustawa z dnia 18 stycznia 1951 r. o dniach wolnych od pracy
|
|
2871
|
+
* (Dz.U. z 2025 r., poz. 296)
|
|
2872
|
+
*
|
|
2873
|
+
* Fixed holidays:
|
|
2874
|
+
* Jan 1 — Nowy Rok
|
|
2875
|
+
* Jan 6 — Święto Trzech Króli (Epiphany)
|
|
2876
|
+
* May 1 — Święto Państwowe
|
|
2877
|
+
* May 3 — Święto Narodowe Trzeciego Maja
|
|
2878
|
+
* Aug 15 — Wniebowzięcie NMP
|
|
2879
|
+
* Nov 1 — Wszystkich Świętych
|
|
2880
|
+
* Nov 11 — Narodowe Święto Niepodległości
|
|
2881
|
+
* Dec 24 — Wigilia Bożego Narodzenia (since 2025, Dz.U. 2024 poz. 1965)
|
|
2882
|
+
* Dec 25 — Boże Narodzenie (1st day)
|
|
2883
|
+
* Dec 26 — Boże Narodzenie (2nd day)
|
|
2884
|
+
*
|
|
2885
|
+
* Moveable holidays (Easter-based):
|
|
2886
|
+
* Easter Sunday — Wielkanoc
|
|
2887
|
+
* Easter Monday — Poniedziałek Wielkanocny (Easter + 1)
|
|
2888
|
+
* Pentecost Sunday — Zielone Świątki (Easter + 49, always Sunday)
|
|
2889
|
+
* Corpus Christi — Boże Ciało (Easter + 60)
|
|
2890
|
+
*
|
|
2891
|
+
* Count: 14 (year >= 2025), 13 (year <= 2024)
|
|
2892
|
+
*/
|
|
2893
|
+
declare function getPolishHolidays(year: number): ReadonlySet<string>;
|
|
2894
|
+
/**
|
|
2895
|
+
* Check if a UTC date falls on a Polish statutory holiday.
|
|
2896
|
+
*/
|
|
2897
|
+
declare function isPolishHoliday(date: Date): boolean;
|
|
2898
|
+
|
|
2899
|
+
declare class FileOfflineInvoiceStorage implements OfflineInvoiceStorage {
|
|
2900
|
+
private readonly dir;
|
|
2901
|
+
constructor(directory?: string);
|
|
2902
|
+
private ensureDir;
|
|
2903
|
+
private filePath;
|
|
2904
|
+
save(invoice: OfflineInvoiceMetadata): Promise<void>;
|
|
2905
|
+
get(id: string): Promise<OfflineInvoiceMetadata | null>;
|
|
2906
|
+
list(filter?: OfflineInvoiceFilter): Promise<OfflineInvoiceMetadata[]>;
|
|
2907
|
+
/**
|
|
2908
|
+
* Update invoice metadata (read-modify-write).
|
|
2909
|
+
*
|
|
2910
|
+
* Note: No file locking — concurrent updates to the same ID may cause
|
|
2911
|
+
* lost writes. Acceptable for CLI (single process). Library consumers
|
|
2912
|
+
* running parallel operations should use external locking.
|
|
2913
|
+
*/
|
|
2914
|
+
update(id: string, updates: OfflineInvoiceUpdates): Promise<void>;
|
|
2915
|
+
delete(id: string): Promise<void>;
|
|
2916
|
+
}
|
|
2917
|
+
|
|
2918
|
+
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 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, 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 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 };
|