kassza 0.12.0 → 0.13.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.md +283 -18
- package/agents/README.md +20 -5
- package/agents/api.md +165 -2
- package/agents/pitfalls.md +16 -3
- package/agents/recipes.md +215 -45
- package/agents/skills/kassza/SKILL.md +11 -8
- package/dist/cli.cjs +552 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +552 -0
- package/dist/client-6MkeuFqD.d.ts +268 -0
- package/dist/client-B5FryKxJ.d.cts +268 -0
- package/dist/{client-CsmGIFRS.cjs → client-C-PdfL_P.cjs} +235 -597
- package/dist/{client-CL3fuH6A.js → client-CfaS1-Jx.js} +35 -403
- package/dist/context-BxQlIlug.d.ts +425 -0
- package/dist/context-DXNbTPwz.d.cts +425 -0
- package/dist/{create-once-CqdYmQD8.js → create-once-Cz621l8r.js} +3 -3
- package/dist/{create-once-D0pwuenl.cjs → create-once-DgMtKKcG.cjs} +8 -2
- 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 +79 -0
- package/dist/data-link/index.d.ts +79 -0
- package/dist/data-link/index.js +224 -0
- package/dist/delegation/index.cjs +34 -33
- package/dist/delegation/index.d.cts +2 -1
- package/dist/delegation/index.d.ts +2 -1
- package/dist/delegation/index.js +3 -2
- package/dist/get-Byc9T5WO.d.cts +151 -0
- package/dist/get-Byc9T5WO.d.ts +151 -0
- package/dist/get-Csm2n0rZ.cjs +445 -0
- package/dist/get-DT3JEgQ6.js +380 -0
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -3
- package/dist/{issue-BsyYdrIG.cjs → issue-AGRohSm7.cjs} +48 -665
- package/dist/{issue-C6Fcjvln.js → issue-DtSLpVdJ.js} +5 -502
- 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 +1 -1
- package/dist/money/index.js +1 -1
- package/dist/{money-DrhGkWHW.cjs → money-BxytJW6f.cjs} +25 -9
- package/dist/{money-DAA7OwiO.js → money-t7uy1n91.js} +25 -9
- 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-BEwcX7-N.cjs +203 -0
- package/dist/nav-CK1WgYo7.js +156 -0
- package/dist/parse-BJj-aqKy.cjs +380 -0
- package/dist/parse-C608ehqM.js +291 -0
- package/dist/payments/barion.cjs +1 -1
- package/dist/payments/barion.d.cts +2 -2
- package/dist/payments/barion.d.ts +2 -2
- package/dist/payments/barion.js +1 -1
- package/dist/payments/index.cjs +2 -2
- package/dist/payments/index.d.cts +3 -3
- package/dist/payments/index.d.ts +3 -3
- package/dist/payments/index.js +2 -2
- package/dist/payments/paypal.cjs +1 -1
- package/dist/payments/paypal.d.cts +2 -2
- package/dist/payments/paypal.d.ts +2 -2
- package/dist/payments/paypal.js +1 -1
- package/dist/payments/revolut.cjs +2 -2
- package/dist/payments/revolut.d.cts +2 -2
- package/dist/payments/revolut.d.ts +2 -2
- package/dist/payments/revolut.js +2 -2
- package/dist/payments/simplepay.cjs +2 -2
- package/dist/payments/simplepay.d.cts +2 -2
- package/dist/payments/simplepay.d.ts +2 -2
- package/dist/payments/simplepay.js +2 -2
- package/dist/payments/stripe.cjs +2 -2
- package/dist/payments/stripe.d.cts +2 -2
- package/dist/payments/stripe.d.ts +2 -2
- package/dist/payments/stripe.js +2 -2
- package/dist/reports/index.cjs +11 -164
- 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-BXOww1Uq.cjs +286 -0
- package/dist/serialize-DSE_o9RK.js +215 -0
- package/dist/server-C6PoNkdD.cjs +1557 -0
- package/dist/server-Cd8HB661.js +1504 -0
- package/dist/testing/index.cjs +1476 -3
- package/dist/testing/index.d.cts +194 -2
- package/dist/testing/index.d.ts +194 -2
- package/dist/testing/index.js +1477 -6
- package/dist/{types-COf1LAD-.d.cts → types-BVeR7KyU.d.cts} +1 -1
- package/dist/{types-COf1LAD-.d.ts → types-BVeR7KyU.d.ts} +1 -1
- package/dist/{webhook-C76bV-4R.cjs → webhook-81giRMdQ.cjs} +3 -25
- package/dist/{webhook-q2OzNwd7.d.ts → webhook-CpCMHhn2.d.ts} +1 -1
- package/dist/{webhook-CfaDgcL0.d.cts → webhook-CpMJuP6c.d.cts} +1 -1
- package/dist/{webhook-D4lvtex1.js → webhook-CrEGohbg.js} +3 -25
- package/llms.txt +4 -4
- package/package.json +43 -1
- package/dist/client-CickRRFr.d.ts +0 -838
- package/dist/client-DvWZoX_E.d.cts +0 -838
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { E as SzamlazzError, G as InvoiceTemplate, K as InvoiceType, N as CreateInvoiceInput, P as CreatedInvoice, R as InvoiceBuyer, U as InvoicePreview, V as InvoiceLanguage, W as InvoiceSeller, Z as StandardInvoiceInput, _ as ReversedInvoice, b as RegisterPaymentInput, c as SzamlazzOptions, g as ReverseInvoiceInput, o as RequestOptions, v as ClearPaymentsInput, x as RegisteredPayment, z as InvoiceDefaults } from "./context-BxQlIlug.js";
|
|
2
|
+
import { _ as VatRate } from "./index-CYAGCdKJ.js";
|
|
3
|
+
import { h as SendReceiptInput, i as ReceiptDefaults, m as ReverseReceiptInput, n as GetReceiptInput, r as Receipt, s as ReceiptOnlyVatCode, t as CreateReceiptInput } from "./types-k--zHf4l.js";
|
|
4
|
+
import { n as InvoiceDetails, t as GetInvoiceOptions } from "./get-Byc9T5WO.js";
|
|
5
|
+
import { i as PaymentEvent, r as PaymentCustomer, s as PaymentLineItem } from "./types-BVeR7KyU.js";
|
|
6
|
+
//#region src/invoices/reference.d.ts
|
|
7
|
+
type InvoiceReference = string | {
|
|
8
|
+
readonly invoiceNumber: string;
|
|
9
|
+
} | {
|
|
10
|
+
readonly orderNumber: string;
|
|
11
|
+
} | {
|
|
12
|
+
readonly externalId: string;
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/core/once.d.ts
|
|
16
|
+
interface CreateOnceOptions extends RequestOptions {
|
|
17
|
+
readonly lookupFirst?: boolean | undefined;
|
|
18
|
+
readonly matchOrderNumber?: boolean | undefined;
|
|
19
|
+
readonly recoveryDelayMs?: number | undefined;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/invoices/create-once.d.ts
|
|
23
|
+
interface InvoiceOnceResult {
|
|
24
|
+
readonly number: string;
|
|
25
|
+
readonly created: boolean;
|
|
26
|
+
readonly externalId: string;
|
|
27
|
+
readonly invoice?: CreatedInvoice | undefined;
|
|
28
|
+
readonly details?: InvoiceDetails | undefined;
|
|
29
|
+
}
|
|
30
|
+
declare function invoiceOnceExternalId(type: InvoiceType, orderNumber: string): string;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/invoices/pdf.d.ts
|
|
33
|
+
interface InvoicePdf {
|
|
34
|
+
readonly pdf: Uint8Array;
|
|
35
|
+
readonly number?: string | undefined;
|
|
36
|
+
readonly netTotal?: number | undefined;
|
|
37
|
+
readonly grossTotal?: number | undefined;
|
|
38
|
+
readonly outstanding?: number | undefined;
|
|
39
|
+
readonly buyerAccountUrl?: string | undefined;
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/invoices/proforma.d.ts
|
|
43
|
+
type ProformaReference = string | {
|
|
44
|
+
readonly proformaNumber: string;
|
|
45
|
+
} | {
|
|
46
|
+
readonly orderNumber: string;
|
|
47
|
+
};
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/documents/choose.d.ts
|
|
50
|
+
declare const RECEIPT_MAX_GROSS_HUF = 9e5;
|
|
51
|
+
interface ChooseDocumentBuyer {
|
|
52
|
+
readonly taxNumber?: string | undefined;
|
|
53
|
+
readonly euTaxNumber?: string | undefined;
|
|
54
|
+
readonly isBusiness?: boolean | undefined;
|
|
55
|
+
}
|
|
56
|
+
interface ChooseDocumentInput {
|
|
57
|
+
readonly grossTotal: number;
|
|
58
|
+
readonly currency?: string | undefined;
|
|
59
|
+
readonly exchangeRate?: number | undefined;
|
|
60
|
+
readonly buyer?: ChooseDocumentBuyer | undefined;
|
|
61
|
+
readonly paidByFulfillment?: boolean | undefined;
|
|
62
|
+
readonly invoiceRequested?: boolean | undefined;
|
|
63
|
+
readonly cashRegisterRequired?: boolean | undefined;
|
|
64
|
+
}
|
|
65
|
+
type DocumentChoice = "receipt" | "invoice" | "cash-register";
|
|
66
|
+
interface DocumentDecision {
|
|
67
|
+
readonly type: DocumentChoice;
|
|
68
|
+
readonly reasons: readonly string[];
|
|
69
|
+
readonly grossTotalHuf: number;
|
|
70
|
+
}
|
|
71
|
+
declare function chooseDocument(input: ChooseDocumentInput): DocumentDecision;
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/payments/issue.d.ts
|
|
74
|
+
interface PaymentDocumentItem {
|
|
75
|
+
readonly name: string;
|
|
76
|
+
readonly quantity?: number;
|
|
77
|
+
readonly unit?: string | undefined;
|
|
78
|
+
readonly identifier?: string | undefined;
|
|
79
|
+
readonly comment?: string | undefined;
|
|
80
|
+
readonly grossUnitPrice?: number;
|
|
81
|
+
readonly netUnitPrice?: number;
|
|
82
|
+
readonly vat: VatRate;
|
|
83
|
+
}
|
|
84
|
+
interface IssueForPaymentOptions {
|
|
85
|
+
readonly vat?: VatRate | undefined;
|
|
86
|
+
readonly vatFor?: ((item: PaymentLineItem) => VatRate) | undefined;
|
|
87
|
+
readonly items?: readonly PaymentDocumentItem[] | undefined;
|
|
88
|
+
readonly fallbackItemName?: string | undefined;
|
|
89
|
+
readonly document?: "auto" | "receipt" | "invoice" | undefined;
|
|
90
|
+
readonly buyer?: InvoiceBuyer | undefined;
|
|
91
|
+
readonly buyerIsBusiness?: boolean | undefined;
|
|
92
|
+
readonly invoiceRequested?: boolean | undefined;
|
|
93
|
+
readonly cashRegisterRequired?: boolean | undefined;
|
|
94
|
+
readonly orderNumber?: string | undefined;
|
|
95
|
+
readonly currency?: string | undefined;
|
|
96
|
+
readonly exchangeRate?: number | undefined;
|
|
97
|
+
readonly exchangeBank?: string | undefined;
|
|
98
|
+
readonly allowAmountMismatch?: boolean | undefined;
|
|
99
|
+
readonly receipt?: Partial<Omit<CreateReceiptInput, "items" | "orderNumber" | "callId" | "currency" | "exchangeRate" | "exchangeBank">> | undefined;
|
|
100
|
+
readonly invoice?: Partial<Omit<StandardInvoiceInput, "items" | "buyer" | "type" | "orderNumber" | "paid" | "currency" | "exchangeRate" | "exchangeBank" | "externalId">> | undefined;
|
|
101
|
+
readonly recoveryDelayMs?: number | undefined;
|
|
102
|
+
readonly signal?: AbortSignal | undefined;
|
|
103
|
+
}
|
|
104
|
+
interface IssuedReceipt {
|
|
105
|
+
readonly kind: "receipt";
|
|
106
|
+
readonly orderNumber: string;
|
|
107
|
+
readonly number: string;
|
|
108
|
+
readonly created: boolean;
|
|
109
|
+
readonly receipt: Receipt;
|
|
110
|
+
readonly decision: DocumentDecision;
|
|
111
|
+
}
|
|
112
|
+
interface IssuedInvoice {
|
|
113
|
+
readonly kind: "invoice";
|
|
114
|
+
readonly orderNumber: string;
|
|
115
|
+
readonly number: string;
|
|
116
|
+
readonly created: boolean;
|
|
117
|
+
readonly invoice: InvoiceOnceResult;
|
|
118
|
+
readonly decision: DocumentDecision;
|
|
119
|
+
}
|
|
120
|
+
interface IssuedReversal {
|
|
121
|
+
readonly kind: "reversal";
|
|
122
|
+
readonly orderNumber: string;
|
|
123
|
+
readonly document: "receipt" | "invoice";
|
|
124
|
+
readonly reversedNumber: string;
|
|
125
|
+
readonly number?: string | undefined;
|
|
126
|
+
readonly created: boolean;
|
|
127
|
+
}
|
|
128
|
+
interface SkippedPayment {
|
|
129
|
+
readonly kind: "skipped";
|
|
130
|
+
readonly orderNumber: string;
|
|
131
|
+
readonly reason: string;
|
|
132
|
+
}
|
|
133
|
+
type IssuedDocument = IssuedReceipt | IssuedInvoice | IssuedReversal | SkippedPayment;
|
|
134
|
+
interface PaymentDocumentsApi {
|
|
135
|
+
readonly invoices: Pick<InvoicesApi, "createOnce" | "find" | "reverse">;
|
|
136
|
+
readonly receipts: Pick<ReceiptsApi, "createOnce" | "find" | "reverse">;
|
|
137
|
+
}
|
|
138
|
+
declare function paymentOrderNumber(payment: PaymentEvent): string;
|
|
139
|
+
declare function buyerFromCustomer(customer: PaymentCustomer | undefined): InvoiceBuyer | undefined;
|
|
140
|
+
declare function issueForPayment(api: PaymentDocumentsApi, payment: PaymentEvent, options?: IssueForPaymentOptions): Promise<IssuedDocument>;
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region src/receipts/convert.d.ts
|
|
143
|
+
interface ConvertReceiptInput {
|
|
144
|
+
readonly receiptNumber: string;
|
|
145
|
+
readonly buyer: InvoiceBuyer;
|
|
146
|
+
readonly orderNumber?: string | undefined;
|
|
147
|
+
readonly prefix?: string | undefined;
|
|
148
|
+
readonly comment?: string | undefined;
|
|
149
|
+
readonly language?: InvoiceLanguage | undefined;
|
|
150
|
+
readonly template?: InvoiceTemplate | undefined;
|
|
151
|
+
readonly seller?: InvoiceSeller | undefined;
|
|
152
|
+
readonly eInvoice?: boolean | undefined;
|
|
153
|
+
readonly downloadPdf?: boolean | undefined;
|
|
154
|
+
readonly vatMapping?: Readonly<Partial<Record<ReceiptOnlyVatCode, VatRate>>> | undefined;
|
|
155
|
+
readonly allowAlreadyReversed?: boolean | undefined;
|
|
156
|
+
}
|
|
157
|
+
interface ConvertedReceipt {
|
|
158
|
+
readonly receipt: Receipt;
|
|
159
|
+
readonly reversal?: Receipt | undefined;
|
|
160
|
+
readonly invoice: InvoiceOnceResult;
|
|
161
|
+
}
|
|
162
|
+
declare function conversionExternalId(receiptNumber: string): string;
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region src/receipts/create-once.d.ts
|
|
165
|
+
interface ReceiptOnceResult {
|
|
166
|
+
readonly receipt: Receipt;
|
|
167
|
+
readonly created: boolean;
|
|
168
|
+
}
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/taxpayer/address.d.ts
|
|
171
|
+
type TaxpayerAddressType = "HQ" | "SITE" | "BRANCH" | (string & {});
|
|
172
|
+
interface NavDetailedAddress {
|
|
173
|
+
readonly countryCode?: string | undefined;
|
|
174
|
+
readonly region?: string | undefined;
|
|
175
|
+
readonly postalCode?: string | undefined;
|
|
176
|
+
readonly city?: string | undefined;
|
|
177
|
+
readonly streetName?: string | undefined;
|
|
178
|
+
readonly publicPlaceCategory?: string | undefined;
|
|
179
|
+
readonly number?: string | undefined;
|
|
180
|
+
readonly building?: string | undefined;
|
|
181
|
+
readonly staircase?: string | undefined;
|
|
182
|
+
readonly floor?: string | undefined;
|
|
183
|
+
readonly door?: string | undefined;
|
|
184
|
+
readonly lotNumber?: string | undefined;
|
|
185
|
+
}
|
|
186
|
+
interface TaxpayerAddress {
|
|
187
|
+
readonly type: TaxpayerAddressType;
|
|
188
|
+
readonly countryCode: string;
|
|
189
|
+
readonly region?: string | undefined;
|
|
190
|
+
readonly postalCode: string;
|
|
191
|
+
readonly city: string;
|
|
192
|
+
readonly street?: string | undefined;
|
|
193
|
+
readonly publicPlaceCategory?: string | undefined;
|
|
194
|
+
readonly number?: string | undefined;
|
|
195
|
+
readonly building?: string | undefined;
|
|
196
|
+
readonly staircase?: string | undefined;
|
|
197
|
+
readonly floor?: string | undefined;
|
|
198
|
+
readonly door?: string | undefined;
|
|
199
|
+
readonly lotNumber?: string | undefined;
|
|
200
|
+
readonly formatted: string;
|
|
201
|
+
readonly raw: NavDetailedAddress;
|
|
202
|
+
}
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region src/taxpayer/query-taxpayer.d.ts
|
|
205
|
+
type TaxpayerIncorporation = "ORGANIZATION" | "SELF_EMPLOYED" | "TAXABLE_PERSON" | (string & {});
|
|
206
|
+
interface TaxpayerTaxNumber {
|
|
207
|
+
readonly taxpayerId: string;
|
|
208
|
+
readonly vatCode?: string | undefined;
|
|
209
|
+
readonly countyCode?: string | undefined;
|
|
210
|
+
readonly formatted?: string | undefined;
|
|
211
|
+
}
|
|
212
|
+
interface TaxpayerInfo {
|
|
213
|
+
readonly valid: boolean;
|
|
214
|
+
readonly name?: string | undefined;
|
|
215
|
+
readonly shortName?: string | undefined;
|
|
216
|
+
readonly taxNumber?: TaxpayerTaxNumber | undefined;
|
|
217
|
+
readonly address?: TaxpayerAddress | undefined;
|
|
218
|
+
readonly addresses: readonly TaxpayerAddress[];
|
|
219
|
+
readonly incorporation?: TaxpayerIncorporation | undefined;
|
|
220
|
+
readonly vatGroupMembership?: string | undefined;
|
|
221
|
+
readonly infoDate?: string | undefined;
|
|
222
|
+
readonly requestId?: string | undefined;
|
|
223
|
+
}
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region src/client.d.ts
|
|
226
|
+
interface KasszaDefaults {
|
|
227
|
+
readonly invoice?: InvoiceDefaults;
|
|
228
|
+
readonly receipt?: ReceiptDefaults;
|
|
229
|
+
}
|
|
230
|
+
interface KasszaOptions extends SzamlazzOptions {
|
|
231
|
+
readonly defaults?: KasszaDefaults;
|
|
232
|
+
}
|
|
233
|
+
interface InvoicesApi {
|
|
234
|
+
create(input: CreateInvoiceInput, options?: RequestOptions): Promise<CreatedInvoice>;
|
|
235
|
+
createOnce(input: CreateInvoiceInput, options?: CreateOnceOptions): Promise<InvoiceOnceResult>;
|
|
236
|
+
preview(input: CreateInvoiceInput, options?: RequestOptions): Promise<InvoicePreview>;
|
|
237
|
+
reverse(input: ReverseInvoiceInput, options?: RequestOptions): Promise<ReversedInvoice>;
|
|
238
|
+
registerPayment(input: RegisterPaymentInput, options?: RequestOptions): Promise<RegisteredPayment>;
|
|
239
|
+
clearPayments(input: ClearPaymentsInput, options?: RequestOptions): Promise<RegisteredPayment>;
|
|
240
|
+
getPdf(reference: InvoiceReference, options?: RequestOptions): Promise<InvoicePdf>;
|
|
241
|
+
get(reference: InvoiceReference, query?: GetInvoiceOptions, options?: RequestOptions): Promise<InvoiceDetails>;
|
|
242
|
+
find(reference: InvoiceReference, query?: GetInvoiceOptions, options?: RequestOptions): Promise<InvoiceDetails | null>;
|
|
243
|
+
deleteProforma(reference: ProformaReference, options?: RequestOptions): Promise<void>;
|
|
244
|
+
}
|
|
245
|
+
interface ReceiptsApi {
|
|
246
|
+
create(input: CreateReceiptInput, options?: RequestOptions): Promise<Receipt>;
|
|
247
|
+
createOnce(input: CreateReceiptInput, options?: CreateOnceOptions): Promise<ReceiptOnceResult>;
|
|
248
|
+
reverse(input: ReverseReceiptInput | string, options?: RequestOptions): Promise<Receipt>;
|
|
249
|
+
get(input: GetReceiptInput | string, options?: RequestOptions): Promise<Receipt>;
|
|
250
|
+
find(input: GetReceiptInput | string, options?: RequestOptions): Promise<Receipt | null>;
|
|
251
|
+
send(input: SendReceiptInput, options?: RequestOptions): Promise<void>;
|
|
252
|
+
convertToInvoice(input: ConvertReceiptInput, options?: CreateOnceOptions): Promise<ConvertedReceipt>;
|
|
253
|
+
}
|
|
254
|
+
interface TaxpayerApi {
|
|
255
|
+
query(taxNumber: string, options?: RequestOptions): Promise<TaxpayerInfo>;
|
|
256
|
+
}
|
|
257
|
+
interface Kassza {
|
|
258
|
+
readonly invoices: InvoicesApi;
|
|
259
|
+
readonly receipts: ReceiptsApi;
|
|
260
|
+
readonly taxpayer: TaxpayerApi;
|
|
261
|
+
verifyCredentials(options?: RequestOptions): Promise<boolean>;
|
|
262
|
+
resetSession(): Promise<void>;
|
|
263
|
+
resetAttempts(target: SzamlazzError | string): Promise<void>;
|
|
264
|
+
issueForPayment(payment: PaymentEvent, options?: IssueForPaymentOptions): Promise<IssuedDocument>;
|
|
265
|
+
}
|
|
266
|
+
declare function createKassza(options?: KasszaOptions): Kassza;
|
|
267
|
+
//#endregion
|
|
268
|
+
export { RECEIPT_MAX_GROSS_HUF as A, buyerFromCustomer as C, ChooseDocumentInput as D, ChooseDocumentBuyer as E, invoiceOnceExternalId as F, CreateOnceOptions as I, InvoiceReference as L, ProformaReference as M, InvoicePdf as N, DocumentChoice as O, InvoiceOnceResult as P, SkippedPayment as S, paymentOrderNumber as T, IssuedInvoice as _, ReceiptsApi as a, PaymentDocumentItem as b, TaxpayerInfo as c, ReceiptOnceResult as d, ConvertReceiptInput as f, IssuedDocument as g, IssueForPaymentOptions as h, KasszaOptions as i, chooseDocument as j, DocumentDecision as k, TaxpayerTaxNumber as l, conversionExternalId as m, Kassza as n, TaxpayerApi as o, ConvertedReceipt as p, KasszaDefaults as r, createKassza as s, InvoicesApi as t, TaxpayerAddress as u, IssuedReceipt as v, issueForPayment as w, PaymentDocumentsApi as x, IssuedReversal as y };
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { E as SzamlazzError, G as InvoiceTemplate, K as InvoiceType, N as CreateInvoiceInput, P as CreatedInvoice, R as InvoiceBuyer, U as InvoicePreview, V as InvoiceLanguage, W as InvoiceSeller, Z as StandardInvoiceInput, _ as ReversedInvoice, b as RegisterPaymentInput, c as SzamlazzOptions, g as ReverseInvoiceInput, o as RequestOptions, v as ClearPaymentsInput, x as RegisteredPayment, z as InvoiceDefaults } from "./context-DXNbTPwz.cjs";
|
|
2
|
+
import { _ as VatRate } from "./index-CYAGCdKJ.cjs";
|
|
3
|
+
import { h as SendReceiptInput, i as ReceiptDefaults, m as ReverseReceiptInput, n as GetReceiptInput, r as Receipt, s as ReceiptOnlyVatCode, t as CreateReceiptInput } from "./types-DH8QoNZK.cjs";
|
|
4
|
+
import { n as InvoiceDetails, t as GetInvoiceOptions } from "./get-Byc9T5WO.cjs";
|
|
5
|
+
import { i as PaymentEvent, r as PaymentCustomer, s as PaymentLineItem } from "./types-BVeR7KyU.cjs";
|
|
6
|
+
//#region src/invoices/reference.d.ts
|
|
7
|
+
type InvoiceReference = string | {
|
|
8
|
+
readonly invoiceNumber: string;
|
|
9
|
+
} | {
|
|
10
|
+
readonly orderNumber: string;
|
|
11
|
+
} | {
|
|
12
|
+
readonly externalId: string;
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/core/once.d.ts
|
|
16
|
+
interface CreateOnceOptions extends RequestOptions {
|
|
17
|
+
readonly lookupFirst?: boolean | undefined;
|
|
18
|
+
readonly matchOrderNumber?: boolean | undefined;
|
|
19
|
+
readonly recoveryDelayMs?: number | undefined;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/invoices/create-once.d.ts
|
|
23
|
+
interface InvoiceOnceResult {
|
|
24
|
+
readonly number: string;
|
|
25
|
+
readonly created: boolean;
|
|
26
|
+
readonly externalId: string;
|
|
27
|
+
readonly invoice?: CreatedInvoice | undefined;
|
|
28
|
+
readonly details?: InvoiceDetails | undefined;
|
|
29
|
+
}
|
|
30
|
+
declare function invoiceOnceExternalId(type: InvoiceType, orderNumber: string): string;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/invoices/pdf.d.ts
|
|
33
|
+
interface InvoicePdf {
|
|
34
|
+
readonly pdf: Uint8Array;
|
|
35
|
+
readonly number?: string | undefined;
|
|
36
|
+
readonly netTotal?: number | undefined;
|
|
37
|
+
readonly grossTotal?: number | undefined;
|
|
38
|
+
readonly outstanding?: number | undefined;
|
|
39
|
+
readonly buyerAccountUrl?: string | undefined;
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/invoices/proforma.d.ts
|
|
43
|
+
type ProformaReference = string | {
|
|
44
|
+
readonly proformaNumber: string;
|
|
45
|
+
} | {
|
|
46
|
+
readonly orderNumber: string;
|
|
47
|
+
};
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/documents/choose.d.ts
|
|
50
|
+
declare const RECEIPT_MAX_GROSS_HUF = 9e5;
|
|
51
|
+
interface ChooseDocumentBuyer {
|
|
52
|
+
readonly taxNumber?: string | undefined;
|
|
53
|
+
readonly euTaxNumber?: string | undefined;
|
|
54
|
+
readonly isBusiness?: boolean | undefined;
|
|
55
|
+
}
|
|
56
|
+
interface ChooseDocumentInput {
|
|
57
|
+
readonly grossTotal: number;
|
|
58
|
+
readonly currency?: string | undefined;
|
|
59
|
+
readonly exchangeRate?: number | undefined;
|
|
60
|
+
readonly buyer?: ChooseDocumentBuyer | undefined;
|
|
61
|
+
readonly paidByFulfillment?: boolean | undefined;
|
|
62
|
+
readonly invoiceRequested?: boolean | undefined;
|
|
63
|
+
readonly cashRegisterRequired?: boolean | undefined;
|
|
64
|
+
}
|
|
65
|
+
type DocumentChoice = "receipt" | "invoice" | "cash-register";
|
|
66
|
+
interface DocumentDecision {
|
|
67
|
+
readonly type: DocumentChoice;
|
|
68
|
+
readonly reasons: readonly string[];
|
|
69
|
+
readonly grossTotalHuf: number;
|
|
70
|
+
}
|
|
71
|
+
declare function chooseDocument(input: ChooseDocumentInput): DocumentDecision;
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/payments/issue.d.ts
|
|
74
|
+
interface PaymentDocumentItem {
|
|
75
|
+
readonly name: string;
|
|
76
|
+
readonly quantity?: number;
|
|
77
|
+
readonly unit?: string | undefined;
|
|
78
|
+
readonly identifier?: string | undefined;
|
|
79
|
+
readonly comment?: string | undefined;
|
|
80
|
+
readonly grossUnitPrice?: number;
|
|
81
|
+
readonly netUnitPrice?: number;
|
|
82
|
+
readonly vat: VatRate;
|
|
83
|
+
}
|
|
84
|
+
interface IssueForPaymentOptions {
|
|
85
|
+
readonly vat?: VatRate | undefined;
|
|
86
|
+
readonly vatFor?: ((item: PaymentLineItem) => VatRate) | undefined;
|
|
87
|
+
readonly items?: readonly PaymentDocumentItem[] | undefined;
|
|
88
|
+
readonly fallbackItemName?: string | undefined;
|
|
89
|
+
readonly document?: "auto" | "receipt" | "invoice" | undefined;
|
|
90
|
+
readonly buyer?: InvoiceBuyer | undefined;
|
|
91
|
+
readonly buyerIsBusiness?: boolean | undefined;
|
|
92
|
+
readonly invoiceRequested?: boolean | undefined;
|
|
93
|
+
readonly cashRegisterRequired?: boolean | undefined;
|
|
94
|
+
readonly orderNumber?: string | undefined;
|
|
95
|
+
readonly currency?: string | undefined;
|
|
96
|
+
readonly exchangeRate?: number | undefined;
|
|
97
|
+
readonly exchangeBank?: string | undefined;
|
|
98
|
+
readonly allowAmountMismatch?: boolean | undefined;
|
|
99
|
+
readonly receipt?: Partial<Omit<CreateReceiptInput, "items" | "orderNumber" | "callId" | "currency" | "exchangeRate" | "exchangeBank">> | undefined;
|
|
100
|
+
readonly invoice?: Partial<Omit<StandardInvoiceInput, "items" | "buyer" | "type" | "orderNumber" | "paid" | "currency" | "exchangeRate" | "exchangeBank" | "externalId">> | undefined;
|
|
101
|
+
readonly recoveryDelayMs?: number | undefined;
|
|
102
|
+
readonly signal?: AbortSignal | undefined;
|
|
103
|
+
}
|
|
104
|
+
interface IssuedReceipt {
|
|
105
|
+
readonly kind: "receipt";
|
|
106
|
+
readonly orderNumber: string;
|
|
107
|
+
readonly number: string;
|
|
108
|
+
readonly created: boolean;
|
|
109
|
+
readonly receipt: Receipt;
|
|
110
|
+
readonly decision: DocumentDecision;
|
|
111
|
+
}
|
|
112
|
+
interface IssuedInvoice {
|
|
113
|
+
readonly kind: "invoice";
|
|
114
|
+
readonly orderNumber: string;
|
|
115
|
+
readonly number: string;
|
|
116
|
+
readonly created: boolean;
|
|
117
|
+
readonly invoice: InvoiceOnceResult;
|
|
118
|
+
readonly decision: DocumentDecision;
|
|
119
|
+
}
|
|
120
|
+
interface IssuedReversal {
|
|
121
|
+
readonly kind: "reversal";
|
|
122
|
+
readonly orderNumber: string;
|
|
123
|
+
readonly document: "receipt" | "invoice";
|
|
124
|
+
readonly reversedNumber: string;
|
|
125
|
+
readonly number?: string | undefined;
|
|
126
|
+
readonly created: boolean;
|
|
127
|
+
}
|
|
128
|
+
interface SkippedPayment {
|
|
129
|
+
readonly kind: "skipped";
|
|
130
|
+
readonly orderNumber: string;
|
|
131
|
+
readonly reason: string;
|
|
132
|
+
}
|
|
133
|
+
type IssuedDocument = IssuedReceipt | IssuedInvoice | IssuedReversal | SkippedPayment;
|
|
134
|
+
interface PaymentDocumentsApi {
|
|
135
|
+
readonly invoices: Pick<InvoicesApi, "createOnce" | "find" | "reverse">;
|
|
136
|
+
readonly receipts: Pick<ReceiptsApi, "createOnce" | "find" | "reverse">;
|
|
137
|
+
}
|
|
138
|
+
declare function paymentOrderNumber(payment: PaymentEvent): string;
|
|
139
|
+
declare function buyerFromCustomer(customer: PaymentCustomer | undefined): InvoiceBuyer | undefined;
|
|
140
|
+
declare function issueForPayment(api: PaymentDocumentsApi, payment: PaymentEvent, options?: IssueForPaymentOptions): Promise<IssuedDocument>;
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region src/receipts/convert.d.ts
|
|
143
|
+
interface ConvertReceiptInput {
|
|
144
|
+
readonly receiptNumber: string;
|
|
145
|
+
readonly buyer: InvoiceBuyer;
|
|
146
|
+
readonly orderNumber?: string | undefined;
|
|
147
|
+
readonly prefix?: string | undefined;
|
|
148
|
+
readonly comment?: string | undefined;
|
|
149
|
+
readonly language?: InvoiceLanguage | undefined;
|
|
150
|
+
readonly template?: InvoiceTemplate | undefined;
|
|
151
|
+
readonly seller?: InvoiceSeller | undefined;
|
|
152
|
+
readonly eInvoice?: boolean | undefined;
|
|
153
|
+
readonly downloadPdf?: boolean | undefined;
|
|
154
|
+
readonly vatMapping?: Readonly<Partial<Record<ReceiptOnlyVatCode, VatRate>>> | undefined;
|
|
155
|
+
readonly allowAlreadyReversed?: boolean | undefined;
|
|
156
|
+
}
|
|
157
|
+
interface ConvertedReceipt {
|
|
158
|
+
readonly receipt: Receipt;
|
|
159
|
+
readonly reversal?: Receipt | undefined;
|
|
160
|
+
readonly invoice: InvoiceOnceResult;
|
|
161
|
+
}
|
|
162
|
+
declare function conversionExternalId(receiptNumber: string): string;
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region src/receipts/create-once.d.ts
|
|
165
|
+
interface ReceiptOnceResult {
|
|
166
|
+
readonly receipt: Receipt;
|
|
167
|
+
readonly created: boolean;
|
|
168
|
+
}
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/taxpayer/address.d.ts
|
|
171
|
+
type TaxpayerAddressType = "HQ" | "SITE" | "BRANCH" | (string & {});
|
|
172
|
+
interface NavDetailedAddress {
|
|
173
|
+
readonly countryCode?: string | undefined;
|
|
174
|
+
readonly region?: string | undefined;
|
|
175
|
+
readonly postalCode?: string | undefined;
|
|
176
|
+
readonly city?: string | undefined;
|
|
177
|
+
readonly streetName?: string | undefined;
|
|
178
|
+
readonly publicPlaceCategory?: string | undefined;
|
|
179
|
+
readonly number?: string | undefined;
|
|
180
|
+
readonly building?: string | undefined;
|
|
181
|
+
readonly staircase?: string | undefined;
|
|
182
|
+
readonly floor?: string | undefined;
|
|
183
|
+
readonly door?: string | undefined;
|
|
184
|
+
readonly lotNumber?: string | undefined;
|
|
185
|
+
}
|
|
186
|
+
interface TaxpayerAddress {
|
|
187
|
+
readonly type: TaxpayerAddressType;
|
|
188
|
+
readonly countryCode: string;
|
|
189
|
+
readonly region?: string | undefined;
|
|
190
|
+
readonly postalCode: string;
|
|
191
|
+
readonly city: string;
|
|
192
|
+
readonly street?: string | undefined;
|
|
193
|
+
readonly publicPlaceCategory?: string | undefined;
|
|
194
|
+
readonly number?: string | undefined;
|
|
195
|
+
readonly building?: string | undefined;
|
|
196
|
+
readonly staircase?: string | undefined;
|
|
197
|
+
readonly floor?: string | undefined;
|
|
198
|
+
readonly door?: string | undefined;
|
|
199
|
+
readonly lotNumber?: string | undefined;
|
|
200
|
+
readonly formatted: string;
|
|
201
|
+
readonly raw: NavDetailedAddress;
|
|
202
|
+
}
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region src/taxpayer/query-taxpayer.d.ts
|
|
205
|
+
type TaxpayerIncorporation = "ORGANIZATION" | "SELF_EMPLOYED" | "TAXABLE_PERSON" | (string & {});
|
|
206
|
+
interface TaxpayerTaxNumber {
|
|
207
|
+
readonly taxpayerId: string;
|
|
208
|
+
readonly vatCode?: string | undefined;
|
|
209
|
+
readonly countyCode?: string | undefined;
|
|
210
|
+
readonly formatted?: string | undefined;
|
|
211
|
+
}
|
|
212
|
+
interface TaxpayerInfo {
|
|
213
|
+
readonly valid: boolean;
|
|
214
|
+
readonly name?: string | undefined;
|
|
215
|
+
readonly shortName?: string | undefined;
|
|
216
|
+
readonly taxNumber?: TaxpayerTaxNumber | undefined;
|
|
217
|
+
readonly address?: TaxpayerAddress | undefined;
|
|
218
|
+
readonly addresses: readonly TaxpayerAddress[];
|
|
219
|
+
readonly incorporation?: TaxpayerIncorporation | undefined;
|
|
220
|
+
readonly vatGroupMembership?: string | undefined;
|
|
221
|
+
readonly infoDate?: string | undefined;
|
|
222
|
+
readonly requestId?: string | undefined;
|
|
223
|
+
}
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region src/client.d.ts
|
|
226
|
+
interface KasszaDefaults {
|
|
227
|
+
readonly invoice?: InvoiceDefaults;
|
|
228
|
+
readonly receipt?: ReceiptDefaults;
|
|
229
|
+
}
|
|
230
|
+
interface KasszaOptions extends SzamlazzOptions {
|
|
231
|
+
readonly defaults?: KasszaDefaults;
|
|
232
|
+
}
|
|
233
|
+
interface InvoicesApi {
|
|
234
|
+
create(input: CreateInvoiceInput, options?: RequestOptions): Promise<CreatedInvoice>;
|
|
235
|
+
createOnce(input: CreateInvoiceInput, options?: CreateOnceOptions): Promise<InvoiceOnceResult>;
|
|
236
|
+
preview(input: CreateInvoiceInput, options?: RequestOptions): Promise<InvoicePreview>;
|
|
237
|
+
reverse(input: ReverseInvoiceInput, options?: RequestOptions): Promise<ReversedInvoice>;
|
|
238
|
+
registerPayment(input: RegisterPaymentInput, options?: RequestOptions): Promise<RegisteredPayment>;
|
|
239
|
+
clearPayments(input: ClearPaymentsInput, options?: RequestOptions): Promise<RegisteredPayment>;
|
|
240
|
+
getPdf(reference: InvoiceReference, options?: RequestOptions): Promise<InvoicePdf>;
|
|
241
|
+
get(reference: InvoiceReference, query?: GetInvoiceOptions, options?: RequestOptions): Promise<InvoiceDetails>;
|
|
242
|
+
find(reference: InvoiceReference, query?: GetInvoiceOptions, options?: RequestOptions): Promise<InvoiceDetails | null>;
|
|
243
|
+
deleteProforma(reference: ProformaReference, options?: RequestOptions): Promise<void>;
|
|
244
|
+
}
|
|
245
|
+
interface ReceiptsApi {
|
|
246
|
+
create(input: CreateReceiptInput, options?: RequestOptions): Promise<Receipt>;
|
|
247
|
+
createOnce(input: CreateReceiptInput, options?: CreateOnceOptions): Promise<ReceiptOnceResult>;
|
|
248
|
+
reverse(input: ReverseReceiptInput | string, options?: RequestOptions): Promise<Receipt>;
|
|
249
|
+
get(input: GetReceiptInput | string, options?: RequestOptions): Promise<Receipt>;
|
|
250
|
+
find(input: GetReceiptInput | string, options?: RequestOptions): Promise<Receipt | null>;
|
|
251
|
+
send(input: SendReceiptInput, options?: RequestOptions): Promise<void>;
|
|
252
|
+
convertToInvoice(input: ConvertReceiptInput, options?: CreateOnceOptions): Promise<ConvertedReceipt>;
|
|
253
|
+
}
|
|
254
|
+
interface TaxpayerApi {
|
|
255
|
+
query(taxNumber: string, options?: RequestOptions): Promise<TaxpayerInfo>;
|
|
256
|
+
}
|
|
257
|
+
interface Kassza {
|
|
258
|
+
readonly invoices: InvoicesApi;
|
|
259
|
+
readonly receipts: ReceiptsApi;
|
|
260
|
+
readonly taxpayer: TaxpayerApi;
|
|
261
|
+
verifyCredentials(options?: RequestOptions): Promise<boolean>;
|
|
262
|
+
resetSession(): Promise<void>;
|
|
263
|
+
resetAttempts(target: SzamlazzError | string): Promise<void>;
|
|
264
|
+
issueForPayment(payment: PaymentEvent, options?: IssueForPaymentOptions): Promise<IssuedDocument>;
|
|
265
|
+
}
|
|
266
|
+
declare function createKassza(options?: KasszaOptions): Kassza;
|
|
267
|
+
//#endregion
|
|
268
|
+
export { RECEIPT_MAX_GROSS_HUF as A, buyerFromCustomer as C, ChooseDocumentInput as D, ChooseDocumentBuyer as E, invoiceOnceExternalId as F, CreateOnceOptions as I, InvoiceReference as L, ProformaReference as M, InvoicePdf as N, DocumentChoice as O, InvoiceOnceResult as P, SkippedPayment as S, paymentOrderNumber as T, IssuedInvoice as _, ReceiptsApi as a, PaymentDocumentItem as b, TaxpayerInfo as c, ReceiptOnceResult as d, ConvertReceiptInput as f, IssuedDocument as g, IssueForPaymentOptions as h, KasszaOptions as i, chooseDocument as j, DocumentDecision as k, TaxpayerTaxNumber as l, conversionExternalId as m, Kassza as n, TaxpayerApi as o, ConvertedReceipt as p, KasszaDefaults as r, createKassza as s, InvoicesApi as t, TaxpayerAddress as u, IssuedReceipt as v, issueForPayment as w, PaymentDocumentsApi as x, IssuedReversal as y };
|