kassza 0.12.0 → 0.14.0
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.en.md +48 -0
- package/README.md +427 -32
- package/agents/README.md +26 -6
- package/agents/api.md +218 -3
- package/agents/pitfalls.md +27 -3
- package/agents/recipes.md +280 -51
- package/agents/skills/kassza/SKILL.md +14 -8
- package/agents/skills/migrate-from-szamlazz-js/SKILL.md +39 -0
- package/dist/batch/index.cjs +346 -0
- package/dist/batch/index.d.cts +91 -0
- package/dist/batch/index.d.ts +91 -0
- package/dist/batch/index.js +339 -0
- package/dist/cli.cjs +643 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +643 -0
- package/dist/client-CLFvJCVW.cjs +1452 -0
- package/dist/{client-CL3fuH6A.js → client-Cvf-hTz_.js} +306 -515
- package/dist/client-DeWWQ-RZ.d.ts +341 -0
- package/dist/client-SVZu25MB.d.cts +341 -0
- package/dist/context-CFNKzStE.d.cts +449 -0
- package/dist/context-kb33TgzE.d.ts +449 -0
- package/dist/cookie-stores/index.cjs +21 -150
- package/dist/cookie-stores/index.d.cts +4 -63
- package/dist/cookie-stores/index.d.ts +4 -63
- package/dist/cookie-stores/index.js +3 -144
- package/dist/create-CflXrPip.js +204 -0
- package/dist/create-CvUvLUaT.cjs +257 -0
- package/dist/{create-once-D0pwuenl.cjs → create-once-9yxR_Er_.cjs} +291 -33
- package/dist/create-once-Bh6fOWkW.d.cts +20 -0
- package/dist/{create-once-CqdYmQD8.js → create-once-Ca2gMk1h.js} +250 -34
- package/dist/create-once-VKp0tVow.d.ts +20 -0
- package/dist/{crypto-B8lERvR1.cjs → crypto-Dpn4FHQ6.cjs} +9 -0
- package/dist/{crypto-DK_osBVy.js → crypto-usDg8L2K.js} +4 -1
- package/dist/data-link/index.cjs +232 -0
- package/dist/data-link/index.d.cts +29 -0
- package/dist/data-link/index.d.ts +29 -0
- package/dist/data-link/index.js +224 -0
- package/dist/delegation/index.cjs +35 -34
- package/dist/delegation/index.d.cts +2 -1
- package/dist/delegation/index.d.ts +2 -1
- package/dist/delegation/index.js +4 -3
- package/dist/{errors-DLrb0g64.js → errors-DtN4g5Z9.js} +9 -1
- package/dist/{errors-DxeuTslP.cjs → errors-EE96_6D_.cjs} +20 -0
- package/dist/get-BdMTseh4.cjs +271 -0
- package/dist/get-Byc9T5WO.d.cts +151 -0
- package/dist/get-Byc9T5WO.d.ts +151 -0
- package/dist/get-CZEShCcj.js +260 -0
- package/dist/index-BhUPY_EH.d.cts +109 -0
- package/dist/index-BqGgQ4t3.d.ts +109 -0
- package/dist/{index-CYAGCdKJ.d.cts → index-C-7yWV7L.d.cts} +24 -1
- package/dist/{index-CYAGCdKJ.d.ts → index-C-7yWV7L.d.ts} +24 -1
- package/dist/index.cjs +19 -5
- package/dist/index.d.cts +11 -19
- package/dist/index.d.ts +11 -19
- package/dist/index.js +6 -6
- package/dist/ipn/index.cjs +26 -5
- package/dist/ipn/index.d.cts +12 -1
- package/dist/ipn/index.d.ts +12 -1
- package/dist/ipn/index.js +26 -6
- package/dist/issue-Bin4tKD_.cjs +988 -0
- package/dist/issue-DMA1Nbr1.js +905 -0
- package/dist/journal/index.cjs +454 -0
- package/dist/journal/index.d.cts +18 -0
- package/dist/journal/index.d.ts +18 -0
- package/dist/journal/index.js +445 -0
- package/dist/journal-DvI81Kt7.d.cts +114 -0
- package/dist/journal-Y9qrIB8G.d.ts +114 -0
- package/dist/mcp/index.cjs +10 -0
- package/dist/mcp/index.d.cts +71 -0
- package/dist/mcp/index.d.ts +71 -0
- package/dist/mcp/index.js +2 -0
- package/dist/money/index.cjs +2 -1
- package/dist/money/index.d.cts +2 -2
- package/dist/money/index.d.ts +2 -2
- package/dist/money/index.js +2 -2
- package/dist/{money-DAA7OwiO.js → money-Cw457SD6.js} +120 -12
- package/dist/{money-DrhGkWHW.cjs → money-K9j0wPit.cjs} +124 -10
- package/dist/nav/index.cjs +1046 -0
- package/dist/nav/index.d.cts +247 -0
- package/dist/nav/index.d.ts +247 -0
- package/dist/nav/index.js +1012 -0
- package/dist/nav-BNbc8U0R.cjs +203 -0
- package/dist/nav-BcCerwWS.js +156 -0
- package/dist/node/index.cjs +124 -0
- package/dist/node/index.d.cts +35 -0
- package/dist/node/index.d.ts +35 -0
- package/dist/node/index.js +120 -0
- package/dist/observe/index.cjs +311 -0
- package/dist/observe/index.d.cts +53 -0
- package/dist/observe/index.d.ts +53 -0
- package/dist/observe/index.js +303 -0
- package/dist/once-BN_3B5OF.cjs +103 -0
- package/dist/once-CqqZxsXG.js +74 -0
- package/dist/parse-Cr7yQ3_z.js +291 -0
- package/dist/parse-DOA2XQ3e.cjs +380 -0
- package/dist/payments/barion.cjs +26 -2
- package/dist/payments/barion.d.cts +2 -2
- package/dist/payments/barion.d.ts +2 -2
- package/dist/payments/barion.js +26 -2
- package/dist/payments/index.cjs +7 -2
- package/dist/payments/index.d.cts +4 -4
- package/dist/payments/index.d.ts +4 -4
- package/dist/payments/index.js +3 -3
- package/dist/payments/paypal.cjs +16 -2
- package/dist/payments/paypal.d.cts +2 -2
- package/dist/payments/paypal.d.ts +2 -2
- package/dist/payments/paypal.js +16 -2
- package/dist/payments/revolut.cjs +17 -3
- package/dist/payments/revolut.d.cts +2 -2
- package/dist/payments/revolut.d.ts +2 -2
- package/dist/payments/revolut.js +17 -3
- package/dist/payments/simplepay.cjs +37 -5
- package/dist/payments/simplepay.d.cts +2 -2
- package/dist/payments/simplepay.d.ts +2 -2
- package/dist/payments/simplepay.js +37 -5
- package/dist/payments/stripe.cjs +20 -3
- package/dist/payments/stripe.d.cts +2 -2
- package/dist/payments/stripe.d.ts +2 -2
- package/dist/payments/stripe.js +20 -3
- package/dist/push-BXj0Sf0Z.d.ts +52 -0
- package/dist/push-D4nNbCNV.d.cts +52 -0
- package/dist/reference-B5TATqb5.js +124 -0
- package/dist/reference-BIdYMK0t.cjs +183 -0
- package/dist/reports/index.cjs +11 -164
- package/dist/reports/index.d.cts +1 -1
- package/dist/reports/index.d.ts +1 -1
- package/dist/reports/index.js +1 -154
- package/dist/request-body-CH6ZGOrq.cjs +34 -0
- package/dist/request-body-uZHMRlQr.js +29 -0
- package/dist/serialize-B2eFh3D-.js +219 -0
- package/dist/serialize-CquIsxA-.cjs +290 -0
- package/dist/server-BrJUbXs7.js +1505 -0
- package/dist/server-Dw9j8Mnd.cjs +1558 -0
- package/dist/session-Ckl5eJhV.d.ts +7 -0
- package/dist/{session-CKOuE6Jc.cjs → session-DeM5vjvC.cjs} +69 -13
- package/dist/{session-rMKaJcmq.js → session-SaEEXu2N.js} +58 -14
- package/dist/session-YbChChx7.d.cts +7 -0
- package/dist/storage/fs.cjs +1 -1
- package/dist/storage/fs.js +1 -1
- package/dist/storage/index.cjs +1 -1
- package/dist/storage/index.js +1 -1
- package/dist/store-C1rHd9DB.d.cts +19 -0
- package/dist/store-C1rHd9DB.d.ts +19 -0
- package/dist/stores/index.cjs +24 -0
- package/dist/stores/index.d.cts +4 -0
- package/dist/stores/index.d.ts +4 -0
- package/dist/stores/index.js +3 -0
- package/dist/stores-BNrS0dWl.cjs +506 -0
- package/dist/stores-DhjGBrl_.js +441 -0
- package/dist/testing/index.cjs +1500 -15
- package/dist/testing/index.d.cts +198 -3
- package/dist/testing/index.d.ts +198 -3
- package/dist/testing/index.js +1498 -15
- package/dist/{types-COf1LAD-.d.ts → types-B1A8mUIE.d.cts} +14 -2
- package/dist/{types-COf1LAD-.d.cts → types-ByAEvGsZ.d.ts} +14 -2
- package/dist/{types-k--zHf4l.d.ts → types-D1zDOH_F.d.ts} +1 -1
- package/dist/{types-DH8QoNZK.d.cts → types-lnKkQdot.d.cts} +1 -1
- package/dist/warnings-B3DXnveC.d.cts +31 -0
- package/dist/warnings-B3DXnveC.d.ts +31 -0
- package/dist/warnings-DeIw5RFj.cjs +20 -0
- package/dist/warnings-DwTl5J-2.js +15 -0
- package/dist/{webhook-D4lvtex1.js → webhook-CQVShAfI.js} +47 -26
- package/dist/{webhook-C76bV-4R.cjs → webhook-Ckj-_hPD.cjs} +70 -25
- package/dist/webhook-CmdhGiH5.d.cts +11 -0
- package/dist/webhook-D6lEejob.d.ts +11 -0
- package/llms.txt +6 -5
- package/package.json +134 -4
- package/dist/client-CickRRFr.d.ts +0 -838
- package/dist/client-CsmGIFRS.cjs +0 -1637
- package/dist/client-DvWZoX_E.d.cts +0 -838
- package/dist/issue-BsyYdrIG.cjs +0 -1531
- package/dist/issue-C6Fcjvln.js +0 -1274
- package/dist/session-Dm_45x8K.d.cts +0 -11
- package/dist/session-Dm_45x8K.d.ts +0 -11
- package/dist/webhook-CfaDgcL0.d.cts +0 -6
- package/dist/webhook-q2OzNwd7.d.ts +0 -6
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { t as DateInput } from "./dates-9zvESP0i.js";
|
|
2
|
+
import { B as InvoiceLanguage, C as ClearPaymentsInput, E as RegisteredPayment, H as InvoicePreview, L as InvoiceBuyer, M as CreateInvoiceInput, N as CreatedInvoice, R as InvoiceDefaults, S as ReversedInvoice, T as RegisterPaymentInput, U as InvoiceSeller, W as InvoiceTemplate, X as StandardInvoiceInput, l as SzamlazzOptions, s as RequestOptions, st as SzamlazzError, x as ReverseInvoiceInput } from "./context-kb33TgzE.js";
|
|
3
|
+
import { n as KeyValueStore } from "./store-C1rHd9DB.js";
|
|
4
|
+
import { S as VatRate, a as RefundAllocation, s as RefundableItem } from "./index-C-7yWV7L.js";
|
|
5
|
+
import { h as SendReceiptInput, i as ReceiptDefaults, m as ReverseReceiptInput, n as GetReceiptInput, p as ReceiptVatRate, r as Receipt, s as ReceiptOnlyVatCode, t as CreateReceiptInput } from "./types-D1zDOH_F.js";
|
|
6
|
+
import { n as InvoiceDetails, o as InvoiceDetailsPayment, t as GetInvoiceOptions } from "./get-Byc9T5WO.js";
|
|
7
|
+
import { n as InvoiceOnceResult, t as ReceiptOnceResult } from "./create-once-VKp0tVow.js";
|
|
8
|
+
import { i as PaymentEvent, l as PaymentRefund, r as PaymentCustomer, s as PaymentLineItem } from "./types-ByAEvGsZ.js";
|
|
9
|
+
//#region src/core/once-guard.d.ts
|
|
10
|
+
declare const ONCE_LOCK_KEY_PREFIX = "szamlazz:once:";
|
|
11
|
+
declare const DEFAULT_LOCK_TTL_SECONDS = 600;
|
|
12
|
+
declare const DEFAULT_LOCK_WAIT_MS = 1e4;
|
|
13
|
+
type LockFailureMode = "throw" | "proceed";
|
|
14
|
+
interface OnceLockOptions {
|
|
15
|
+
readonly lock?: KeyValueStore | false | undefined;
|
|
16
|
+
readonly lockTtlSeconds?: number | undefined;
|
|
17
|
+
readonly lockWaitMs?: number | undefined;
|
|
18
|
+
readonly lockFailure?: LockFailureMode | undefined;
|
|
19
|
+
readonly signal?: AbortSignal | undefined;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/core/once.d.ts
|
|
23
|
+
interface CreateOnceOptions extends RequestOptions, OnceLockOptions {
|
|
24
|
+
readonly lookupFirst?: boolean | undefined;
|
|
25
|
+
readonly matchOrderNumber?: boolean | undefined;
|
|
26
|
+
readonly recoveryDelayMs?: number | undefined;
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/invoices/reference.d.ts
|
|
30
|
+
type InvoiceReference = string | {
|
|
31
|
+
readonly invoiceNumber: string;
|
|
32
|
+
} | {
|
|
33
|
+
readonly orderNumber: string;
|
|
34
|
+
} | {
|
|
35
|
+
readonly externalId: string;
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/invoices/payment-once.d.ts
|
|
39
|
+
interface RegisterPaymentOnceInput {
|
|
40
|
+
readonly invoiceNumber: string;
|
|
41
|
+
readonly key: string;
|
|
42
|
+
readonly amount: number;
|
|
43
|
+
readonly method?: string | undefined;
|
|
44
|
+
readonly date?: DateInput | undefined;
|
|
45
|
+
readonly description?: string | undefined;
|
|
46
|
+
readonly taxNumber?: string | undefined;
|
|
47
|
+
}
|
|
48
|
+
interface RegisteredPaymentOnce {
|
|
49
|
+
readonly invoiceNumber: string;
|
|
50
|
+
readonly key: string;
|
|
51
|
+
readonly marker: string;
|
|
52
|
+
readonly created: boolean;
|
|
53
|
+
readonly payment?: RegisteredPayment | undefined;
|
|
54
|
+
readonly existing?: InvoiceDetailsPayment | undefined;
|
|
55
|
+
}
|
|
56
|
+
declare function paymentMarker(key: string): string;
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/invoices/pdf.d.ts
|
|
59
|
+
interface InvoicePdf {
|
|
60
|
+
readonly pdf: Uint8Array;
|
|
61
|
+
readonly number?: string | undefined;
|
|
62
|
+
readonly netTotal?: number | undefined;
|
|
63
|
+
readonly grossTotal?: number | undefined;
|
|
64
|
+
readonly outstanding?: number | undefined;
|
|
65
|
+
readonly buyerAccountUrl?: string | undefined;
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/invoices/proforma.d.ts
|
|
69
|
+
type ProformaReference = string | {
|
|
70
|
+
readonly proformaNumber: string;
|
|
71
|
+
} | {
|
|
72
|
+
readonly orderNumber: string;
|
|
73
|
+
};
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/documents/choose.d.ts
|
|
76
|
+
declare const RECEIPT_MAX_GROSS_HUF = 9e5;
|
|
77
|
+
interface ChooseDocumentBuyer {
|
|
78
|
+
readonly taxNumber?: string | undefined;
|
|
79
|
+
readonly euTaxNumber?: string | undefined;
|
|
80
|
+
readonly isBusiness?: boolean | undefined;
|
|
81
|
+
}
|
|
82
|
+
interface ChooseDocumentInput {
|
|
83
|
+
readonly grossTotal: number;
|
|
84
|
+
readonly currency?: string | undefined;
|
|
85
|
+
readonly exchangeRate?: number | undefined;
|
|
86
|
+
readonly buyer?: ChooseDocumentBuyer | undefined;
|
|
87
|
+
readonly paidByFulfillment?: boolean | undefined;
|
|
88
|
+
readonly invoiceRequested?: boolean | undefined;
|
|
89
|
+
readonly cashRegisterRequired?: boolean | undefined;
|
|
90
|
+
}
|
|
91
|
+
type DocumentChoice = "receipt" | "invoice" | "cash-register";
|
|
92
|
+
interface DocumentDecision {
|
|
93
|
+
readonly type: DocumentChoice;
|
|
94
|
+
readonly reasons: readonly string[];
|
|
95
|
+
readonly grossTotalHuf: number;
|
|
96
|
+
}
|
|
97
|
+
declare function chooseDocument(input: ChooseDocumentInput): DocumentDecision;
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/payments/partial-refund.d.ts
|
|
100
|
+
type PartialRefundMode = "auto" | "proportional" | "skip";
|
|
101
|
+
interface RefundItemsContext {
|
|
102
|
+
readonly refund: PaymentRefund;
|
|
103
|
+
readonly invoiceNumber: string;
|
|
104
|
+
readonly items: readonly RefundableItem[];
|
|
105
|
+
}
|
|
106
|
+
type RefundItemsResolver = (context: RefundItemsContext) => readonly PaymentDocumentItem[] | undefined | Promise<readonly PaymentDocumentItem[] | undefined>;
|
|
107
|
+
interface IssuedRefundCorrection {
|
|
108
|
+
readonly refundId: string;
|
|
109
|
+
readonly externalId: string;
|
|
110
|
+
readonly number: string;
|
|
111
|
+
readonly created: boolean;
|
|
112
|
+
readonly grossTotal: number;
|
|
113
|
+
readonly invoice: InvoiceOnceResult;
|
|
114
|
+
}
|
|
115
|
+
interface IssuedCorrection {
|
|
116
|
+
readonly kind: "correction";
|
|
117
|
+
readonly orderNumber: string;
|
|
118
|
+
readonly correctedNumber: string;
|
|
119
|
+
readonly created: boolean;
|
|
120
|
+
readonly corrections: readonly IssuedRefundCorrection[];
|
|
121
|
+
}
|
|
122
|
+
interface RefundProposalLine {
|
|
123
|
+
readonly refundId: string;
|
|
124
|
+
readonly grossTotal: number;
|
|
125
|
+
readonly items: readonly RefundAllocation<ReceiptVatRate>[];
|
|
126
|
+
}
|
|
127
|
+
interface IssuedRefundProposal {
|
|
128
|
+
readonly kind: "refund-proposal";
|
|
129
|
+
readonly orderNumber: string;
|
|
130
|
+
readonly document: "receipt" | "invoice";
|
|
131
|
+
readonly documentNumber: string;
|
|
132
|
+
readonly refunds: readonly RefundProposalLine[];
|
|
133
|
+
readonly reason: string;
|
|
134
|
+
}
|
|
135
|
+
declare function correctionExternalId(orderNumber: string, refundId: string): Promise<string>;
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/payments/issue.d.ts
|
|
138
|
+
interface PaymentDocumentItem {
|
|
139
|
+
readonly name: string;
|
|
140
|
+
readonly quantity?: number;
|
|
141
|
+
readonly unit?: string | undefined;
|
|
142
|
+
readonly identifier?: string | undefined;
|
|
143
|
+
readonly comment?: string | undefined;
|
|
144
|
+
readonly grossUnitPrice?: number;
|
|
145
|
+
readonly netUnitPrice?: number;
|
|
146
|
+
readonly vat: VatRate;
|
|
147
|
+
}
|
|
148
|
+
interface IssueForPaymentOptions {
|
|
149
|
+
readonly vat?: VatRate | undefined;
|
|
150
|
+
readonly vatFor?: ((item: PaymentLineItem) => VatRate) | undefined;
|
|
151
|
+
readonly items?: readonly PaymentDocumentItem[] | undefined;
|
|
152
|
+
readonly fallbackItemName?: string | undefined;
|
|
153
|
+
readonly document?: "auto" | "receipt" | "invoice" | undefined;
|
|
154
|
+
readonly buyer?: InvoiceBuyer | undefined;
|
|
155
|
+
readonly buyerIsBusiness?: boolean | undefined;
|
|
156
|
+
readonly invoiceRequested?: boolean | undefined;
|
|
157
|
+
readonly cashRegisterRequired?: boolean | undefined;
|
|
158
|
+
readonly orderNumber?: string | undefined;
|
|
159
|
+
readonly currency?: string | undefined;
|
|
160
|
+
readonly exchangeRate?: number | undefined;
|
|
161
|
+
readonly exchangeBank?: string | undefined;
|
|
162
|
+
readonly allowAmountMismatch?: boolean | undefined;
|
|
163
|
+
readonly partialRefund?: PartialRefundMode | undefined;
|
|
164
|
+
readonly refundItems?: RefundItemsResolver | undefined;
|
|
165
|
+
readonly receipt?: Partial<Omit<CreateReceiptInput, "items" | "orderNumber" | "callId" | "currency" | "exchangeRate" | "exchangeBank">> | undefined;
|
|
166
|
+
readonly invoice?: Partial<Omit<StandardInvoiceInput, "items" | "buyer" | "type" | "orderNumber" | "paid" | "currency" | "exchangeRate" | "exchangeBank" | "externalId">> | undefined;
|
|
167
|
+
readonly recoveryDelayMs?: number | undefined;
|
|
168
|
+
readonly signal?: AbortSignal | undefined;
|
|
169
|
+
}
|
|
170
|
+
interface IssuedReceipt {
|
|
171
|
+
readonly kind: "receipt";
|
|
172
|
+
readonly orderNumber: string;
|
|
173
|
+
readonly number: string;
|
|
174
|
+
readonly created: boolean;
|
|
175
|
+
readonly receipt: Receipt;
|
|
176
|
+
readonly decision: DocumentDecision;
|
|
177
|
+
}
|
|
178
|
+
interface IssuedInvoice {
|
|
179
|
+
readonly kind: "invoice";
|
|
180
|
+
readonly orderNumber: string;
|
|
181
|
+
readonly number: string;
|
|
182
|
+
readonly created: boolean;
|
|
183
|
+
readonly invoice: InvoiceOnceResult;
|
|
184
|
+
readonly decision: DocumentDecision;
|
|
185
|
+
}
|
|
186
|
+
interface IssuedReversal {
|
|
187
|
+
readonly kind: "reversal";
|
|
188
|
+
readonly orderNumber: string;
|
|
189
|
+
readonly document: "receipt" | "invoice";
|
|
190
|
+
readonly reversedNumber: string;
|
|
191
|
+
readonly number?: string | undefined;
|
|
192
|
+
readonly created: boolean;
|
|
193
|
+
}
|
|
194
|
+
interface SkippedPayment {
|
|
195
|
+
readonly kind: "skipped";
|
|
196
|
+
readonly orderNumber: string;
|
|
197
|
+
readonly reason: string;
|
|
198
|
+
}
|
|
199
|
+
type IssuedDocument = IssuedReceipt | IssuedInvoice | IssuedReversal | IssuedCorrection | IssuedRefundProposal | SkippedPayment;
|
|
200
|
+
interface PaymentDocumentsApi {
|
|
201
|
+
readonly invoices: Pick<InvoicesApi, "createOnce" | "find" | "reverse">;
|
|
202
|
+
readonly receipts: Pick<ReceiptsApi, "createOnce" | "find" | "reverse">;
|
|
203
|
+
}
|
|
204
|
+
declare function paymentOrderNumber(payment: PaymentEvent): string;
|
|
205
|
+
declare function buyerFromCustomer(customer: PaymentCustomer | undefined): InvoiceBuyer | undefined;
|
|
206
|
+
declare function issueForPayment(api: PaymentDocumentsApi, payment: PaymentEvent, options?: IssueForPaymentOptions): Promise<IssuedDocument>;
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region src/receipts/convert.d.ts
|
|
209
|
+
interface ConvertReceiptInput {
|
|
210
|
+
readonly receiptNumber: string;
|
|
211
|
+
readonly buyer: InvoiceBuyer;
|
|
212
|
+
readonly orderNumber?: string | undefined;
|
|
213
|
+
readonly prefix?: string | undefined;
|
|
214
|
+
readonly comment?: string | undefined;
|
|
215
|
+
readonly language?: InvoiceLanguage | undefined;
|
|
216
|
+
readonly template?: InvoiceTemplate | undefined;
|
|
217
|
+
readonly seller?: InvoiceSeller | undefined;
|
|
218
|
+
readonly eInvoice?: boolean | undefined;
|
|
219
|
+
readonly downloadPdf?: boolean | undefined;
|
|
220
|
+
readonly vatMapping?: Readonly<Partial<Record<ReceiptOnlyVatCode, VatRate>>> | undefined;
|
|
221
|
+
readonly allowAlreadyReversed?: boolean | undefined;
|
|
222
|
+
}
|
|
223
|
+
interface ConvertedReceipt {
|
|
224
|
+
readonly receipt: Receipt;
|
|
225
|
+
readonly reversal?: Receipt | undefined;
|
|
226
|
+
readonly invoice: InvoiceOnceResult;
|
|
227
|
+
}
|
|
228
|
+
declare function conversionExternalId(receiptNumber: string): string;
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region src/taxpayer/address.d.ts
|
|
231
|
+
type TaxpayerAddressType = "HQ" | "SITE" | "BRANCH" | (string & {});
|
|
232
|
+
interface NavDetailedAddress {
|
|
233
|
+
readonly countryCode?: string | undefined;
|
|
234
|
+
readonly region?: string | undefined;
|
|
235
|
+
readonly postalCode?: string | undefined;
|
|
236
|
+
readonly city?: string | undefined;
|
|
237
|
+
readonly streetName?: string | undefined;
|
|
238
|
+
readonly publicPlaceCategory?: string | undefined;
|
|
239
|
+
readonly number?: string | undefined;
|
|
240
|
+
readonly building?: string | undefined;
|
|
241
|
+
readonly staircase?: string | undefined;
|
|
242
|
+
readonly floor?: string | undefined;
|
|
243
|
+
readonly door?: string | undefined;
|
|
244
|
+
readonly lotNumber?: string | undefined;
|
|
245
|
+
}
|
|
246
|
+
interface TaxpayerAddress {
|
|
247
|
+
readonly type: TaxpayerAddressType;
|
|
248
|
+
readonly countryCode: string;
|
|
249
|
+
readonly region?: string | undefined;
|
|
250
|
+
readonly postalCode: string;
|
|
251
|
+
readonly city: string;
|
|
252
|
+
readonly street?: string | undefined;
|
|
253
|
+
readonly publicPlaceCategory?: string | undefined;
|
|
254
|
+
readonly number?: string | undefined;
|
|
255
|
+
readonly building?: string | undefined;
|
|
256
|
+
readonly staircase?: string | undefined;
|
|
257
|
+
readonly floor?: string | undefined;
|
|
258
|
+
readonly door?: string | undefined;
|
|
259
|
+
readonly lotNumber?: string | undefined;
|
|
260
|
+
readonly formatted: string;
|
|
261
|
+
readonly raw: NavDetailedAddress;
|
|
262
|
+
}
|
|
263
|
+
//#endregion
|
|
264
|
+
//#region src/taxpayer/query-taxpayer.d.ts
|
|
265
|
+
type TaxpayerIncorporation = "ORGANIZATION" | "SELF_EMPLOYED" | "TAXABLE_PERSON" | (string & {});
|
|
266
|
+
interface TaxpayerTaxNumber {
|
|
267
|
+
readonly taxpayerId: string;
|
|
268
|
+
readonly vatCode?: string | undefined;
|
|
269
|
+
readonly countyCode?: string | undefined;
|
|
270
|
+
readonly formatted?: string | undefined;
|
|
271
|
+
}
|
|
272
|
+
interface TaxpayerInfo {
|
|
273
|
+
readonly valid: boolean;
|
|
274
|
+
readonly name?: string | undefined;
|
|
275
|
+
readonly shortName?: string | undefined;
|
|
276
|
+
readonly taxNumber?: TaxpayerTaxNumber | undefined;
|
|
277
|
+
readonly address?: TaxpayerAddress | undefined;
|
|
278
|
+
readonly addresses: readonly TaxpayerAddress[];
|
|
279
|
+
readonly incorporation?: TaxpayerIncorporation | undefined;
|
|
280
|
+
readonly vatGroupMembership?: string | undefined;
|
|
281
|
+
readonly infoDate?: string | undefined;
|
|
282
|
+
readonly requestId?: string | undefined;
|
|
283
|
+
}
|
|
284
|
+
//#endregion
|
|
285
|
+
//#region src/taxpayer/cache.d.ts
|
|
286
|
+
declare const TAXPAYER_CACHE_KEY_PREFIX = "szamlazz:taxpayer:";
|
|
287
|
+
declare const DEFAULT_TAXPAYER_TTL_SECONDS = 86400;
|
|
288
|
+
declare const DEFAULT_TAXPAYER_INVALID_TTL_SECONDS = 600;
|
|
289
|
+
interface TaxpayerCacheOptions {
|
|
290
|
+
readonly store: KeyValueStore;
|
|
291
|
+
readonly ttlSeconds?: number | undefined;
|
|
292
|
+
readonly invalidTtlSeconds?: number | undefined;
|
|
293
|
+
}
|
|
294
|
+
//#endregion
|
|
295
|
+
//#region src/client.d.ts
|
|
296
|
+
interface KasszaDefaults {
|
|
297
|
+
readonly invoice?: InvoiceDefaults;
|
|
298
|
+
readonly receipt?: ReceiptDefaults;
|
|
299
|
+
}
|
|
300
|
+
interface KasszaOptions extends SzamlazzOptions {
|
|
301
|
+
readonly defaults?: KasszaDefaults;
|
|
302
|
+
readonly createOnceLock?: KeyValueStore | undefined;
|
|
303
|
+
readonly taxpayerCache?: TaxpayerCacheOptions | undefined;
|
|
304
|
+
}
|
|
305
|
+
interface InvoicesApi {
|
|
306
|
+
create(input: CreateInvoiceInput, options?: RequestOptions): Promise<CreatedInvoice>;
|
|
307
|
+
createOnce(input: CreateInvoiceInput, options?: CreateOnceOptions): Promise<InvoiceOnceResult>;
|
|
308
|
+
preview(input: CreateInvoiceInput, options?: RequestOptions): Promise<InvoicePreview>;
|
|
309
|
+
reverse(input: ReverseInvoiceInput, options?: RequestOptions): Promise<ReversedInvoice>;
|
|
310
|
+
registerPayment(input: RegisterPaymentInput, options?: RequestOptions): Promise<RegisteredPayment>;
|
|
311
|
+
registerPaymentOnce(input: RegisterPaymentOnceInput, options?: CreateOnceOptions): Promise<RegisteredPaymentOnce>;
|
|
312
|
+
clearPayments(input: ClearPaymentsInput, options?: RequestOptions): Promise<RegisteredPayment>;
|
|
313
|
+
getPdf(reference: InvoiceReference, options?: RequestOptions): Promise<InvoicePdf>;
|
|
314
|
+
get(reference: InvoiceReference, query?: GetInvoiceOptions, options?: RequestOptions): Promise<InvoiceDetails>;
|
|
315
|
+
find(reference: InvoiceReference, query?: GetInvoiceOptions, options?: RequestOptions): Promise<InvoiceDetails | null>;
|
|
316
|
+
deleteProforma(reference: ProformaReference, options?: RequestOptions): Promise<void>;
|
|
317
|
+
}
|
|
318
|
+
interface ReceiptsApi {
|
|
319
|
+
create(input: CreateReceiptInput, options?: RequestOptions): Promise<Receipt>;
|
|
320
|
+
createOnce(input: CreateReceiptInput, options?: CreateOnceOptions): Promise<ReceiptOnceResult>;
|
|
321
|
+
reverse(input: ReverseReceiptInput | string, options?: RequestOptions): Promise<Receipt>;
|
|
322
|
+
get(input: GetReceiptInput | string, options?: RequestOptions): Promise<Receipt>;
|
|
323
|
+
find(input: GetReceiptInput | string, options?: RequestOptions): Promise<Receipt | null>;
|
|
324
|
+
send(input: SendReceiptInput, options?: RequestOptions): Promise<void>;
|
|
325
|
+
convertToInvoice(input: ConvertReceiptInput, options?: CreateOnceOptions): Promise<ConvertedReceipt>;
|
|
326
|
+
}
|
|
327
|
+
interface TaxpayerApi {
|
|
328
|
+
query(taxNumber: string, options?: RequestOptions): Promise<TaxpayerInfo>;
|
|
329
|
+
}
|
|
330
|
+
interface Kassza {
|
|
331
|
+
readonly invoices: InvoicesApi;
|
|
332
|
+
readonly receipts: ReceiptsApi;
|
|
333
|
+
readonly taxpayer: TaxpayerApi;
|
|
334
|
+
verifyCredentials(options?: RequestOptions): Promise<boolean>;
|
|
335
|
+
resetSession(): Promise<void>;
|
|
336
|
+
resetAttempts(target: SzamlazzError | string): Promise<void>;
|
|
337
|
+
issueForPayment(payment: PaymentEvent, options?: IssueForPaymentOptions): Promise<IssuedDocument>;
|
|
338
|
+
}
|
|
339
|
+
declare function createKassza(options?: KasszaOptions): Kassza;
|
|
340
|
+
//#endregion
|
|
341
|
+
export { ONCE_LOCK_KEY_PREFIX as $, IssuedRefundCorrection as A, DocumentDecision as B, PaymentDocumentItem as C, issueForPayment as D, buyerFromCustomer as E, RefundProposalLine as F, RegisterPaymentOnceInput as G, chooseDocument as H, correctionExternalId as I, InvoiceReference as J, RegisteredPaymentOnce as K, ChooseDocumentBuyer as L, PartialRefundMode as M, RefundItemsContext as N, paymentOrderNumber as O, RefundItemsResolver as P, LockFailureMode as Q, ChooseDocumentInput as R, IssuedReversal as S, SkippedPayment as T, ProformaReference as U, RECEIPT_MAX_GROSS_HUF as V, InvoicePdf as W, DEFAULT_LOCK_TTL_SECONDS as X, CreateOnceOptions as Y, DEFAULT_LOCK_WAIT_MS as Z, conversionExternalId as _, ReceiptsApi as a, IssuedInvoice as b, DEFAULT_TAXPAYER_INVALID_TTL_SECONDS as c, TaxpayerCacheOptions as d, OnceLockOptions as et, TaxpayerInfo as f, ConvertedReceipt as g, ConvertReceiptInput as h, KasszaOptions as i, IssuedRefundProposal as j, IssuedCorrection as k, DEFAULT_TAXPAYER_TTL_SECONDS as l, TaxpayerAddress as m, Kassza as n, TaxpayerApi as o, TaxpayerTaxNumber as p, paymentMarker as q, KasszaDefaults as r, createKassza as s, InvoicesApi as t, TAXPAYER_CACHE_KEY_PREFIX as u, IssueForPaymentOptions as v, PaymentDocumentsApi as w, IssuedReceipt as x, IssuedDocument as y, DocumentChoice as z };
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { t as DateInput } from "./dates-9zvESP0i.cjs";
|
|
2
|
+
import { B as InvoiceLanguage, C as ClearPaymentsInput, E as RegisteredPayment, H as InvoicePreview, L as InvoiceBuyer, M as CreateInvoiceInput, N as CreatedInvoice, R as InvoiceDefaults, S as ReversedInvoice, T as RegisterPaymentInput, U as InvoiceSeller, W as InvoiceTemplate, X as StandardInvoiceInput, l as SzamlazzOptions, s as RequestOptions, st as SzamlazzError, x as ReverseInvoiceInput } from "./context-CFNKzStE.cjs";
|
|
3
|
+
import { n as KeyValueStore } from "./store-C1rHd9DB.cjs";
|
|
4
|
+
import { S as VatRate, a as RefundAllocation, s as RefundableItem } from "./index-C-7yWV7L.cjs";
|
|
5
|
+
import { h as SendReceiptInput, i as ReceiptDefaults, m as ReverseReceiptInput, n as GetReceiptInput, p as ReceiptVatRate, r as Receipt, s as ReceiptOnlyVatCode, t as CreateReceiptInput } from "./types-lnKkQdot.cjs";
|
|
6
|
+
import { n as InvoiceDetails, o as InvoiceDetailsPayment, t as GetInvoiceOptions } from "./get-Byc9T5WO.cjs";
|
|
7
|
+
import { n as InvoiceOnceResult, t as ReceiptOnceResult } from "./create-once-Bh6fOWkW.cjs";
|
|
8
|
+
import { i as PaymentEvent, l as PaymentRefund, r as PaymentCustomer, s as PaymentLineItem } from "./types-B1A8mUIE.cjs";
|
|
9
|
+
//#region src/core/once-guard.d.ts
|
|
10
|
+
declare const ONCE_LOCK_KEY_PREFIX = "szamlazz:once:";
|
|
11
|
+
declare const DEFAULT_LOCK_TTL_SECONDS = 600;
|
|
12
|
+
declare const DEFAULT_LOCK_WAIT_MS = 1e4;
|
|
13
|
+
type LockFailureMode = "throw" | "proceed";
|
|
14
|
+
interface OnceLockOptions {
|
|
15
|
+
readonly lock?: KeyValueStore | false | undefined;
|
|
16
|
+
readonly lockTtlSeconds?: number | undefined;
|
|
17
|
+
readonly lockWaitMs?: number | undefined;
|
|
18
|
+
readonly lockFailure?: LockFailureMode | undefined;
|
|
19
|
+
readonly signal?: AbortSignal | undefined;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/core/once.d.ts
|
|
23
|
+
interface CreateOnceOptions extends RequestOptions, OnceLockOptions {
|
|
24
|
+
readonly lookupFirst?: boolean | undefined;
|
|
25
|
+
readonly matchOrderNumber?: boolean | undefined;
|
|
26
|
+
readonly recoveryDelayMs?: number | undefined;
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/invoices/reference.d.ts
|
|
30
|
+
type InvoiceReference = string | {
|
|
31
|
+
readonly invoiceNumber: string;
|
|
32
|
+
} | {
|
|
33
|
+
readonly orderNumber: string;
|
|
34
|
+
} | {
|
|
35
|
+
readonly externalId: string;
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/invoices/payment-once.d.ts
|
|
39
|
+
interface RegisterPaymentOnceInput {
|
|
40
|
+
readonly invoiceNumber: string;
|
|
41
|
+
readonly key: string;
|
|
42
|
+
readonly amount: number;
|
|
43
|
+
readonly method?: string | undefined;
|
|
44
|
+
readonly date?: DateInput | undefined;
|
|
45
|
+
readonly description?: string | undefined;
|
|
46
|
+
readonly taxNumber?: string | undefined;
|
|
47
|
+
}
|
|
48
|
+
interface RegisteredPaymentOnce {
|
|
49
|
+
readonly invoiceNumber: string;
|
|
50
|
+
readonly key: string;
|
|
51
|
+
readonly marker: string;
|
|
52
|
+
readonly created: boolean;
|
|
53
|
+
readonly payment?: RegisteredPayment | undefined;
|
|
54
|
+
readonly existing?: InvoiceDetailsPayment | undefined;
|
|
55
|
+
}
|
|
56
|
+
declare function paymentMarker(key: string): string;
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/invoices/pdf.d.ts
|
|
59
|
+
interface InvoicePdf {
|
|
60
|
+
readonly pdf: Uint8Array;
|
|
61
|
+
readonly number?: string | undefined;
|
|
62
|
+
readonly netTotal?: number | undefined;
|
|
63
|
+
readonly grossTotal?: number | undefined;
|
|
64
|
+
readonly outstanding?: number | undefined;
|
|
65
|
+
readonly buyerAccountUrl?: string | undefined;
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/invoices/proforma.d.ts
|
|
69
|
+
type ProformaReference = string | {
|
|
70
|
+
readonly proformaNumber: string;
|
|
71
|
+
} | {
|
|
72
|
+
readonly orderNumber: string;
|
|
73
|
+
};
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/documents/choose.d.ts
|
|
76
|
+
declare const RECEIPT_MAX_GROSS_HUF = 9e5;
|
|
77
|
+
interface ChooseDocumentBuyer {
|
|
78
|
+
readonly taxNumber?: string | undefined;
|
|
79
|
+
readonly euTaxNumber?: string | undefined;
|
|
80
|
+
readonly isBusiness?: boolean | undefined;
|
|
81
|
+
}
|
|
82
|
+
interface ChooseDocumentInput {
|
|
83
|
+
readonly grossTotal: number;
|
|
84
|
+
readonly currency?: string | undefined;
|
|
85
|
+
readonly exchangeRate?: number | undefined;
|
|
86
|
+
readonly buyer?: ChooseDocumentBuyer | undefined;
|
|
87
|
+
readonly paidByFulfillment?: boolean | undefined;
|
|
88
|
+
readonly invoiceRequested?: boolean | undefined;
|
|
89
|
+
readonly cashRegisterRequired?: boolean | undefined;
|
|
90
|
+
}
|
|
91
|
+
type DocumentChoice = "receipt" | "invoice" | "cash-register";
|
|
92
|
+
interface DocumentDecision {
|
|
93
|
+
readonly type: DocumentChoice;
|
|
94
|
+
readonly reasons: readonly string[];
|
|
95
|
+
readonly grossTotalHuf: number;
|
|
96
|
+
}
|
|
97
|
+
declare function chooseDocument(input: ChooseDocumentInput): DocumentDecision;
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/payments/partial-refund.d.ts
|
|
100
|
+
type PartialRefundMode = "auto" | "proportional" | "skip";
|
|
101
|
+
interface RefundItemsContext {
|
|
102
|
+
readonly refund: PaymentRefund;
|
|
103
|
+
readonly invoiceNumber: string;
|
|
104
|
+
readonly items: readonly RefundableItem[];
|
|
105
|
+
}
|
|
106
|
+
type RefundItemsResolver = (context: RefundItemsContext) => readonly PaymentDocumentItem[] | undefined | Promise<readonly PaymentDocumentItem[] | undefined>;
|
|
107
|
+
interface IssuedRefundCorrection {
|
|
108
|
+
readonly refundId: string;
|
|
109
|
+
readonly externalId: string;
|
|
110
|
+
readonly number: string;
|
|
111
|
+
readonly created: boolean;
|
|
112
|
+
readonly grossTotal: number;
|
|
113
|
+
readonly invoice: InvoiceOnceResult;
|
|
114
|
+
}
|
|
115
|
+
interface IssuedCorrection {
|
|
116
|
+
readonly kind: "correction";
|
|
117
|
+
readonly orderNumber: string;
|
|
118
|
+
readonly correctedNumber: string;
|
|
119
|
+
readonly created: boolean;
|
|
120
|
+
readonly corrections: readonly IssuedRefundCorrection[];
|
|
121
|
+
}
|
|
122
|
+
interface RefundProposalLine {
|
|
123
|
+
readonly refundId: string;
|
|
124
|
+
readonly grossTotal: number;
|
|
125
|
+
readonly items: readonly RefundAllocation<ReceiptVatRate>[];
|
|
126
|
+
}
|
|
127
|
+
interface IssuedRefundProposal {
|
|
128
|
+
readonly kind: "refund-proposal";
|
|
129
|
+
readonly orderNumber: string;
|
|
130
|
+
readonly document: "receipt" | "invoice";
|
|
131
|
+
readonly documentNumber: string;
|
|
132
|
+
readonly refunds: readonly RefundProposalLine[];
|
|
133
|
+
readonly reason: string;
|
|
134
|
+
}
|
|
135
|
+
declare function correctionExternalId(orderNumber: string, refundId: string): Promise<string>;
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/payments/issue.d.ts
|
|
138
|
+
interface PaymentDocumentItem {
|
|
139
|
+
readonly name: string;
|
|
140
|
+
readonly quantity?: number;
|
|
141
|
+
readonly unit?: string | undefined;
|
|
142
|
+
readonly identifier?: string | undefined;
|
|
143
|
+
readonly comment?: string | undefined;
|
|
144
|
+
readonly grossUnitPrice?: number;
|
|
145
|
+
readonly netUnitPrice?: number;
|
|
146
|
+
readonly vat: VatRate;
|
|
147
|
+
}
|
|
148
|
+
interface IssueForPaymentOptions {
|
|
149
|
+
readonly vat?: VatRate | undefined;
|
|
150
|
+
readonly vatFor?: ((item: PaymentLineItem) => VatRate) | undefined;
|
|
151
|
+
readonly items?: readonly PaymentDocumentItem[] | undefined;
|
|
152
|
+
readonly fallbackItemName?: string | undefined;
|
|
153
|
+
readonly document?: "auto" | "receipt" | "invoice" | undefined;
|
|
154
|
+
readonly buyer?: InvoiceBuyer | undefined;
|
|
155
|
+
readonly buyerIsBusiness?: boolean | undefined;
|
|
156
|
+
readonly invoiceRequested?: boolean | undefined;
|
|
157
|
+
readonly cashRegisterRequired?: boolean | undefined;
|
|
158
|
+
readonly orderNumber?: string | undefined;
|
|
159
|
+
readonly currency?: string | undefined;
|
|
160
|
+
readonly exchangeRate?: number | undefined;
|
|
161
|
+
readonly exchangeBank?: string | undefined;
|
|
162
|
+
readonly allowAmountMismatch?: boolean | undefined;
|
|
163
|
+
readonly partialRefund?: PartialRefundMode | undefined;
|
|
164
|
+
readonly refundItems?: RefundItemsResolver | undefined;
|
|
165
|
+
readonly receipt?: Partial<Omit<CreateReceiptInput, "items" | "orderNumber" | "callId" | "currency" | "exchangeRate" | "exchangeBank">> | undefined;
|
|
166
|
+
readonly invoice?: Partial<Omit<StandardInvoiceInput, "items" | "buyer" | "type" | "orderNumber" | "paid" | "currency" | "exchangeRate" | "exchangeBank" | "externalId">> | undefined;
|
|
167
|
+
readonly recoveryDelayMs?: number | undefined;
|
|
168
|
+
readonly signal?: AbortSignal | undefined;
|
|
169
|
+
}
|
|
170
|
+
interface IssuedReceipt {
|
|
171
|
+
readonly kind: "receipt";
|
|
172
|
+
readonly orderNumber: string;
|
|
173
|
+
readonly number: string;
|
|
174
|
+
readonly created: boolean;
|
|
175
|
+
readonly receipt: Receipt;
|
|
176
|
+
readonly decision: DocumentDecision;
|
|
177
|
+
}
|
|
178
|
+
interface IssuedInvoice {
|
|
179
|
+
readonly kind: "invoice";
|
|
180
|
+
readonly orderNumber: string;
|
|
181
|
+
readonly number: string;
|
|
182
|
+
readonly created: boolean;
|
|
183
|
+
readonly invoice: InvoiceOnceResult;
|
|
184
|
+
readonly decision: DocumentDecision;
|
|
185
|
+
}
|
|
186
|
+
interface IssuedReversal {
|
|
187
|
+
readonly kind: "reversal";
|
|
188
|
+
readonly orderNumber: string;
|
|
189
|
+
readonly document: "receipt" | "invoice";
|
|
190
|
+
readonly reversedNumber: string;
|
|
191
|
+
readonly number?: string | undefined;
|
|
192
|
+
readonly created: boolean;
|
|
193
|
+
}
|
|
194
|
+
interface SkippedPayment {
|
|
195
|
+
readonly kind: "skipped";
|
|
196
|
+
readonly orderNumber: string;
|
|
197
|
+
readonly reason: string;
|
|
198
|
+
}
|
|
199
|
+
type IssuedDocument = IssuedReceipt | IssuedInvoice | IssuedReversal | IssuedCorrection | IssuedRefundProposal | SkippedPayment;
|
|
200
|
+
interface PaymentDocumentsApi {
|
|
201
|
+
readonly invoices: Pick<InvoicesApi, "createOnce" | "find" | "reverse">;
|
|
202
|
+
readonly receipts: Pick<ReceiptsApi, "createOnce" | "find" | "reverse">;
|
|
203
|
+
}
|
|
204
|
+
declare function paymentOrderNumber(payment: PaymentEvent): string;
|
|
205
|
+
declare function buyerFromCustomer(customer: PaymentCustomer | undefined): InvoiceBuyer | undefined;
|
|
206
|
+
declare function issueForPayment(api: PaymentDocumentsApi, payment: PaymentEvent, options?: IssueForPaymentOptions): Promise<IssuedDocument>;
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region src/receipts/convert.d.ts
|
|
209
|
+
interface ConvertReceiptInput {
|
|
210
|
+
readonly receiptNumber: string;
|
|
211
|
+
readonly buyer: InvoiceBuyer;
|
|
212
|
+
readonly orderNumber?: string | undefined;
|
|
213
|
+
readonly prefix?: string | undefined;
|
|
214
|
+
readonly comment?: string | undefined;
|
|
215
|
+
readonly language?: InvoiceLanguage | undefined;
|
|
216
|
+
readonly template?: InvoiceTemplate | undefined;
|
|
217
|
+
readonly seller?: InvoiceSeller | undefined;
|
|
218
|
+
readonly eInvoice?: boolean | undefined;
|
|
219
|
+
readonly downloadPdf?: boolean | undefined;
|
|
220
|
+
readonly vatMapping?: Readonly<Partial<Record<ReceiptOnlyVatCode, VatRate>>> | undefined;
|
|
221
|
+
readonly allowAlreadyReversed?: boolean | undefined;
|
|
222
|
+
}
|
|
223
|
+
interface ConvertedReceipt {
|
|
224
|
+
readonly receipt: Receipt;
|
|
225
|
+
readonly reversal?: Receipt | undefined;
|
|
226
|
+
readonly invoice: InvoiceOnceResult;
|
|
227
|
+
}
|
|
228
|
+
declare function conversionExternalId(receiptNumber: string): string;
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region src/taxpayer/address.d.ts
|
|
231
|
+
type TaxpayerAddressType = "HQ" | "SITE" | "BRANCH" | (string & {});
|
|
232
|
+
interface NavDetailedAddress {
|
|
233
|
+
readonly countryCode?: string | undefined;
|
|
234
|
+
readonly region?: string | undefined;
|
|
235
|
+
readonly postalCode?: string | undefined;
|
|
236
|
+
readonly city?: string | undefined;
|
|
237
|
+
readonly streetName?: string | undefined;
|
|
238
|
+
readonly publicPlaceCategory?: string | undefined;
|
|
239
|
+
readonly number?: string | undefined;
|
|
240
|
+
readonly building?: string | undefined;
|
|
241
|
+
readonly staircase?: string | undefined;
|
|
242
|
+
readonly floor?: string | undefined;
|
|
243
|
+
readonly door?: string | undefined;
|
|
244
|
+
readonly lotNumber?: string | undefined;
|
|
245
|
+
}
|
|
246
|
+
interface TaxpayerAddress {
|
|
247
|
+
readonly type: TaxpayerAddressType;
|
|
248
|
+
readonly countryCode: string;
|
|
249
|
+
readonly region?: string | undefined;
|
|
250
|
+
readonly postalCode: string;
|
|
251
|
+
readonly city: string;
|
|
252
|
+
readonly street?: string | undefined;
|
|
253
|
+
readonly publicPlaceCategory?: string | undefined;
|
|
254
|
+
readonly number?: string | undefined;
|
|
255
|
+
readonly building?: string | undefined;
|
|
256
|
+
readonly staircase?: string | undefined;
|
|
257
|
+
readonly floor?: string | undefined;
|
|
258
|
+
readonly door?: string | undefined;
|
|
259
|
+
readonly lotNumber?: string | undefined;
|
|
260
|
+
readonly formatted: string;
|
|
261
|
+
readonly raw: NavDetailedAddress;
|
|
262
|
+
}
|
|
263
|
+
//#endregion
|
|
264
|
+
//#region src/taxpayer/query-taxpayer.d.ts
|
|
265
|
+
type TaxpayerIncorporation = "ORGANIZATION" | "SELF_EMPLOYED" | "TAXABLE_PERSON" | (string & {});
|
|
266
|
+
interface TaxpayerTaxNumber {
|
|
267
|
+
readonly taxpayerId: string;
|
|
268
|
+
readonly vatCode?: string | undefined;
|
|
269
|
+
readonly countyCode?: string | undefined;
|
|
270
|
+
readonly formatted?: string | undefined;
|
|
271
|
+
}
|
|
272
|
+
interface TaxpayerInfo {
|
|
273
|
+
readonly valid: boolean;
|
|
274
|
+
readonly name?: string | undefined;
|
|
275
|
+
readonly shortName?: string | undefined;
|
|
276
|
+
readonly taxNumber?: TaxpayerTaxNumber | undefined;
|
|
277
|
+
readonly address?: TaxpayerAddress | undefined;
|
|
278
|
+
readonly addresses: readonly TaxpayerAddress[];
|
|
279
|
+
readonly incorporation?: TaxpayerIncorporation | undefined;
|
|
280
|
+
readonly vatGroupMembership?: string | undefined;
|
|
281
|
+
readonly infoDate?: string | undefined;
|
|
282
|
+
readonly requestId?: string | undefined;
|
|
283
|
+
}
|
|
284
|
+
//#endregion
|
|
285
|
+
//#region src/taxpayer/cache.d.ts
|
|
286
|
+
declare const TAXPAYER_CACHE_KEY_PREFIX = "szamlazz:taxpayer:";
|
|
287
|
+
declare const DEFAULT_TAXPAYER_TTL_SECONDS = 86400;
|
|
288
|
+
declare const DEFAULT_TAXPAYER_INVALID_TTL_SECONDS = 600;
|
|
289
|
+
interface TaxpayerCacheOptions {
|
|
290
|
+
readonly store: KeyValueStore;
|
|
291
|
+
readonly ttlSeconds?: number | undefined;
|
|
292
|
+
readonly invalidTtlSeconds?: number | undefined;
|
|
293
|
+
}
|
|
294
|
+
//#endregion
|
|
295
|
+
//#region src/client.d.ts
|
|
296
|
+
interface KasszaDefaults {
|
|
297
|
+
readonly invoice?: InvoiceDefaults;
|
|
298
|
+
readonly receipt?: ReceiptDefaults;
|
|
299
|
+
}
|
|
300
|
+
interface KasszaOptions extends SzamlazzOptions {
|
|
301
|
+
readonly defaults?: KasszaDefaults;
|
|
302
|
+
readonly createOnceLock?: KeyValueStore | undefined;
|
|
303
|
+
readonly taxpayerCache?: TaxpayerCacheOptions | undefined;
|
|
304
|
+
}
|
|
305
|
+
interface InvoicesApi {
|
|
306
|
+
create(input: CreateInvoiceInput, options?: RequestOptions): Promise<CreatedInvoice>;
|
|
307
|
+
createOnce(input: CreateInvoiceInput, options?: CreateOnceOptions): Promise<InvoiceOnceResult>;
|
|
308
|
+
preview(input: CreateInvoiceInput, options?: RequestOptions): Promise<InvoicePreview>;
|
|
309
|
+
reverse(input: ReverseInvoiceInput, options?: RequestOptions): Promise<ReversedInvoice>;
|
|
310
|
+
registerPayment(input: RegisterPaymentInput, options?: RequestOptions): Promise<RegisteredPayment>;
|
|
311
|
+
registerPaymentOnce(input: RegisterPaymentOnceInput, options?: CreateOnceOptions): Promise<RegisteredPaymentOnce>;
|
|
312
|
+
clearPayments(input: ClearPaymentsInput, options?: RequestOptions): Promise<RegisteredPayment>;
|
|
313
|
+
getPdf(reference: InvoiceReference, options?: RequestOptions): Promise<InvoicePdf>;
|
|
314
|
+
get(reference: InvoiceReference, query?: GetInvoiceOptions, options?: RequestOptions): Promise<InvoiceDetails>;
|
|
315
|
+
find(reference: InvoiceReference, query?: GetInvoiceOptions, options?: RequestOptions): Promise<InvoiceDetails | null>;
|
|
316
|
+
deleteProforma(reference: ProformaReference, options?: RequestOptions): Promise<void>;
|
|
317
|
+
}
|
|
318
|
+
interface ReceiptsApi {
|
|
319
|
+
create(input: CreateReceiptInput, options?: RequestOptions): Promise<Receipt>;
|
|
320
|
+
createOnce(input: CreateReceiptInput, options?: CreateOnceOptions): Promise<ReceiptOnceResult>;
|
|
321
|
+
reverse(input: ReverseReceiptInput | string, options?: RequestOptions): Promise<Receipt>;
|
|
322
|
+
get(input: GetReceiptInput | string, options?: RequestOptions): Promise<Receipt>;
|
|
323
|
+
find(input: GetReceiptInput | string, options?: RequestOptions): Promise<Receipt | null>;
|
|
324
|
+
send(input: SendReceiptInput, options?: RequestOptions): Promise<void>;
|
|
325
|
+
convertToInvoice(input: ConvertReceiptInput, options?: CreateOnceOptions): Promise<ConvertedReceipt>;
|
|
326
|
+
}
|
|
327
|
+
interface TaxpayerApi {
|
|
328
|
+
query(taxNumber: string, options?: RequestOptions): Promise<TaxpayerInfo>;
|
|
329
|
+
}
|
|
330
|
+
interface Kassza {
|
|
331
|
+
readonly invoices: InvoicesApi;
|
|
332
|
+
readonly receipts: ReceiptsApi;
|
|
333
|
+
readonly taxpayer: TaxpayerApi;
|
|
334
|
+
verifyCredentials(options?: RequestOptions): Promise<boolean>;
|
|
335
|
+
resetSession(): Promise<void>;
|
|
336
|
+
resetAttempts(target: SzamlazzError | string): Promise<void>;
|
|
337
|
+
issueForPayment(payment: PaymentEvent, options?: IssueForPaymentOptions): Promise<IssuedDocument>;
|
|
338
|
+
}
|
|
339
|
+
declare function createKassza(options?: KasszaOptions): Kassza;
|
|
340
|
+
//#endregion
|
|
341
|
+
export { ONCE_LOCK_KEY_PREFIX as $, IssuedRefundCorrection as A, DocumentDecision as B, PaymentDocumentItem as C, issueForPayment as D, buyerFromCustomer as E, RefundProposalLine as F, RegisterPaymentOnceInput as G, chooseDocument as H, correctionExternalId as I, InvoiceReference as J, RegisteredPaymentOnce as K, ChooseDocumentBuyer as L, PartialRefundMode as M, RefundItemsContext as N, paymentOrderNumber as O, RefundItemsResolver as P, LockFailureMode as Q, ChooseDocumentInput as R, IssuedReversal as S, SkippedPayment as T, ProformaReference as U, RECEIPT_MAX_GROSS_HUF as V, InvoicePdf as W, DEFAULT_LOCK_TTL_SECONDS as X, CreateOnceOptions as Y, DEFAULT_LOCK_WAIT_MS as Z, conversionExternalId as _, ReceiptsApi as a, IssuedInvoice as b, DEFAULT_TAXPAYER_INVALID_TTL_SECONDS as c, TaxpayerCacheOptions as d, OnceLockOptions as et, TaxpayerInfo as f, ConvertedReceipt as g, ConvertReceiptInput as h, KasszaOptions as i, IssuedRefundProposal as j, IssuedCorrection as k, DEFAULT_TAXPAYER_TTL_SECONDS as l, TaxpayerAddress as m, Kassza as n, TaxpayerApi as o, TaxpayerTaxNumber as p, paymentMarker as q, KasszaDefaults as r, createKassza as s, InvoicesApi as t, TAXPAYER_CACHE_KEY_PREFIX as u, IssueForPaymentOptions as v, PaymentDocumentsApi as w, IssuedReceipt as x, IssuedDocument as y, DocumentChoice as z };
|