kassza 0.13.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.
Files changed (164) hide show
  1. package/README.en.md +48 -0
  2. package/README.md +152 -22
  3. package/agents/README.md +6 -1
  4. package/agents/api.md +64 -12
  5. package/agents/pitfalls.md +12 -1
  6. package/agents/recipes.md +67 -8
  7. package/agents/skills/kassza/SKILL.md +3 -0
  8. package/agents/skills/migrate-from-szamlazz-js/SKILL.md +39 -0
  9. package/dist/batch/index.cjs +346 -0
  10. package/dist/batch/index.d.cts +91 -0
  11. package/dist/batch/index.d.ts +91 -0
  12. package/dist/batch/index.js +339 -0
  13. package/dist/cli.cjs +105 -14
  14. package/dist/cli.js +104 -13
  15. package/dist/{client-C-PdfL_P.cjs → client-CLFvJCVW.cjs} +358 -181
  16. package/dist/{client-CfaS1-Jx.js → client-Cvf-hTz_.js} +311 -152
  17. package/dist/{client-6MkeuFqD.d.ts → client-DeWWQ-RZ.d.ts} +99 -26
  18. package/dist/{client-B5FryKxJ.d.cts → client-SVZu25MB.d.cts} +99 -26
  19. package/dist/{context-DXNbTPwz.d.cts → context-CFNKzStE.d.cts} +82 -58
  20. package/dist/{context-BxQlIlug.d.ts → context-kb33TgzE.d.ts} +82 -58
  21. package/dist/cookie-stores/index.cjs +21 -150
  22. package/dist/cookie-stores/index.d.cts +4 -63
  23. package/dist/cookie-stores/index.d.ts +4 -63
  24. package/dist/cookie-stores/index.js +3 -144
  25. package/dist/create-CflXrPip.js +204 -0
  26. package/dist/create-CvUvLUaT.cjs +257 -0
  27. package/dist/{create-once-DgMtKKcG.cjs → create-once-9yxR_Er_.cjs} +285 -33
  28. package/dist/create-once-Bh6fOWkW.d.cts +20 -0
  29. package/dist/{create-once-Cz621l8r.js → create-once-Ca2gMk1h.js} +250 -34
  30. package/dist/create-once-VKp0tVow.d.ts +20 -0
  31. package/dist/data-link/index.cjs +4 -4
  32. package/dist/data-link/index.d.cts +2 -52
  33. package/dist/data-link/index.d.ts +2 -52
  34. package/dist/data-link/index.js +4 -4
  35. package/dist/delegation/index.cjs +4 -4
  36. package/dist/delegation/index.d.cts +2 -2
  37. package/dist/delegation/index.d.ts +2 -2
  38. package/dist/delegation/index.js +4 -4
  39. package/dist/{errors-DLrb0g64.js → errors-DtN4g5Z9.js} +9 -1
  40. package/dist/{errors-DxeuTslP.cjs → errors-EE96_6D_.cjs} +20 -0
  41. package/dist/{get-Csm2n0rZ.cjs → get-BdMTseh4.cjs} +9 -183
  42. package/dist/{get-DT3JEgQ6.js → get-CZEShCcj.js} +4 -124
  43. package/dist/index-BhUPY_EH.d.cts +109 -0
  44. package/dist/index-BqGgQ4t3.d.ts +109 -0
  45. package/dist/{index-CYAGCdKJ.d.cts → index-C-7yWV7L.d.cts} +24 -1
  46. package/dist/{index-CYAGCdKJ.d.ts → index-C-7yWV7L.d.ts} +24 -1
  47. package/dist/index.cjs +19 -5
  48. package/dist/index.d.cts +10 -20
  49. package/dist/index.d.ts +10 -20
  50. package/dist/index.js +6 -6
  51. package/dist/ipn/index.cjs +26 -5
  52. package/dist/ipn/index.d.cts +12 -1
  53. package/dist/ipn/index.d.ts +12 -1
  54. package/dist/ipn/index.js +26 -6
  55. package/dist/{issue-AGRohSm7.cjs → issue-Bin4tKD_.cjs} +416 -342
  56. package/dist/{issue-DtSLpVdJ.js → issue-DMA1Nbr1.js} +394 -266
  57. package/dist/journal/index.cjs +454 -0
  58. package/dist/journal/index.d.cts +18 -0
  59. package/dist/journal/index.d.ts +18 -0
  60. package/dist/journal/index.js +445 -0
  61. package/dist/journal-DvI81Kt7.d.cts +114 -0
  62. package/dist/journal-Y9qrIB8G.d.ts +114 -0
  63. package/dist/mcp/index.cjs +1 -1
  64. package/dist/mcp/index.d.cts +1 -1
  65. package/dist/mcp/index.d.ts +1 -1
  66. package/dist/mcp/index.js +1 -1
  67. package/dist/money/index.cjs +2 -1
  68. package/dist/money/index.d.cts +2 -2
  69. package/dist/money/index.d.ts +2 -2
  70. package/dist/money/index.js +2 -2
  71. package/dist/{money-t7uy1n91.js → money-Cw457SD6.js} +95 -3
  72. package/dist/{money-BxytJW6f.cjs → money-K9j0wPit.cjs} +99 -1
  73. package/dist/nav/index.cjs +2 -2
  74. package/dist/nav/index.d.cts +1 -1
  75. package/dist/nav/index.d.ts +1 -1
  76. package/dist/nav/index.js +2 -2
  77. package/dist/{nav-BEwcX7-N.cjs → nav-BNbc8U0R.cjs} +1 -1
  78. package/dist/{nav-CK1WgYo7.js → nav-BcCerwWS.js} +1 -1
  79. package/dist/node/index.cjs +124 -0
  80. package/dist/node/index.d.cts +35 -0
  81. package/dist/node/index.d.ts +35 -0
  82. package/dist/node/index.js +120 -0
  83. package/dist/observe/index.cjs +311 -0
  84. package/dist/observe/index.d.cts +53 -0
  85. package/dist/observe/index.d.ts +53 -0
  86. package/dist/observe/index.js +303 -0
  87. package/dist/once-BN_3B5OF.cjs +103 -0
  88. package/dist/once-CqqZxsXG.js +74 -0
  89. package/dist/{parse-C608ehqM.js → parse-Cr7yQ3_z.js} +2 -2
  90. package/dist/{parse-BJj-aqKy.cjs → parse-DOA2XQ3e.cjs} +2 -2
  91. package/dist/payments/barion.cjs +26 -2
  92. package/dist/payments/barion.d.cts +2 -2
  93. package/dist/payments/barion.d.ts +2 -2
  94. package/dist/payments/barion.js +26 -2
  95. package/dist/payments/index.cjs +7 -2
  96. package/dist/payments/index.d.cts +4 -4
  97. package/dist/payments/index.d.ts +4 -4
  98. package/dist/payments/index.js +3 -3
  99. package/dist/payments/paypal.cjs +16 -2
  100. package/dist/payments/paypal.d.cts +2 -2
  101. package/dist/payments/paypal.d.ts +2 -2
  102. package/dist/payments/paypal.js +16 -2
  103. package/dist/payments/revolut.cjs +16 -2
  104. package/dist/payments/revolut.d.cts +2 -2
  105. package/dist/payments/revolut.d.ts +2 -2
  106. package/dist/payments/revolut.js +16 -2
  107. package/dist/payments/simplepay.cjs +36 -4
  108. package/dist/payments/simplepay.d.cts +2 -2
  109. package/dist/payments/simplepay.d.ts +2 -2
  110. package/dist/payments/simplepay.js +36 -4
  111. package/dist/payments/stripe.cjs +19 -2
  112. package/dist/payments/stripe.d.cts +2 -2
  113. package/dist/payments/stripe.d.ts +2 -2
  114. package/dist/payments/stripe.js +19 -2
  115. package/dist/push-BXj0Sf0Z.d.ts +52 -0
  116. package/dist/push-D4nNbCNV.d.cts +52 -0
  117. package/dist/reference-B5TATqb5.js +124 -0
  118. package/dist/reference-BIdYMK0t.cjs +183 -0
  119. package/dist/reports/index.cjs +1 -1
  120. package/dist/reports/index.d.cts +1 -1
  121. package/dist/reports/index.d.ts +1 -1
  122. package/dist/reports/index.js +1 -1
  123. package/dist/{serialize-DSE_o9RK.js → serialize-B2eFh3D-.js} +5 -1
  124. package/dist/{serialize-BXOww1Uq.cjs → serialize-CquIsxA-.cjs} +5 -1
  125. package/dist/{server-Cd8HB661.js → server-BrJUbXs7.js} +8 -7
  126. package/dist/{server-C6PoNkdD.cjs → server-Dw9j8Mnd.cjs} +17 -16
  127. package/dist/session-Ckl5eJhV.d.ts +7 -0
  128. package/dist/{session-CKOuE6Jc.cjs → session-DeM5vjvC.cjs} +69 -13
  129. package/dist/{session-rMKaJcmq.js → session-SaEEXu2N.js} +58 -14
  130. package/dist/session-YbChChx7.d.cts +7 -0
  131. package/dist/storage/fs.cjs +1 -1
  132. package/dist/storage/fs.js +1 -1
  133. package/dist/storage/index.cjs +1 -1
  134. package/dist/storage/index.js +1 -1
  135. package/dist/store-C1rHd9DB.d.cts +19 -0
  136. package/dist/store-C1rHd9DB.d.ts +19 -0
  137. package/dist/stores/index.cjs +24 -0
  138. package/dist/stores/index.d.cts +4 -0
  139. package/dist/stores/index.d.ts +4 -0
  140. package/dist/stores/index.js +3 -0
  141. package/dist/stores-BNrS0dWl.cjs +506 -0
  142. package/dist/stores-DhjGBrl_.js +441 -0
  143. package/dist/testing/index.cjs +28 -16
  144. package/dist/testing/index.d.cts +6 -3
  145. package/dist/testing/index.d.ts +6 -3
  146. package/dist/testing/index.js +26 -14
  147. package/dist/{types-BVeR7KyU.d.ts → types-B1A8mUIE.d.cts} +13 -1
  148. package/dist/{types-BVeR7KyU.d.cts → types-ByAEvGsZ.d.ts} +13 -1
  149. package/dist/{types-k--zHf4l.d.ts → types-D1zDOH_F.d.ts} +1 -1
  150. package/dist/{types-DH8QoNZK.d.cts → types-lnKkQdot.d.cts} +1 -1
  151. package/dist/warnings-B3DXnveC.d.cts +31 -0
  152. package/dist/warnings-B3DXnveC.d.ts +31 -0
  153. package/dist/warnings-DeIw5RFj.cjs +20 -0
  154. package/dist/warnings-DwTl5J-2.js +15 -0
  155. package/dist/{webhook-CrEGohbg.js → webhook-CQVShAfI.js} +44 -1
  156. package/dist/{webhook-81giRMdQ.cjs → webhook-Ckj-_hPD.cjs} +67 -0
  157. package/dist/webhook-CmdhGiH5.d.cts +11 -0
  158. package/dist/webhook-D6lEejob.d.ts +11 -0
  159. package/llms.txt +4 -3
  160. package/package.json +92 -4
  161. package/dist/session-Dm_45x8K.d.cts +0 -11
  162. package/dist/session-Dm_45x8K.d.ts +0 -11
  163. package/dist/webhook-CpCMHhn2.d.ts +0 -6
  164. package/dist/webhook-CpMJuP6c.d.cts +0 -6
package/dist/index.cjs CHANGED
@@ -1,31 +1,45 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_create_once = require("./create-once-DgMtKKcG.cjs");
3
- const require_errors = require("./errors-DxeuTslP.cjs");
4
- const require_client = require("./client-C-PdfL_P.cjs");
2
+ const require_create_once = require("./create-once-9yxR_Er_.cjs");
3
+ const require_errors = require("./errors-EE96_6D_.cjs");
4
+ const require_client = require("./client-CLFvJCVW.cjs");
5
5
  const require_binary = require("./binary-B89HM03_.cjs");
6
- const require_session = require("./session-CKOuE6Jc.cjs");
6
+ const require_session = require("./session-DeM5vjvC.cjs");
7
+ const require_issue = require("./issue-Bin4tKD_.cjs");
7
8
  const require_dates = require("./dates-CPgBodkP.cjs");
8
- const require_issue = require("./issue-AGRohSm7.cjs");
9
9
  exports.AGENT_ACTIONS = require_create_once.AGENT_ACTIONS;
10
10
  exports.AGENT_ERROR_CODES = require_errors.AGENT_ERROR_CODES;
11
11
  exports.ATTEMPT_LEDGER_KEY_PREFIX = require_client.ATTEMPT_LEDGER_KEY_PREFIX;
12
12
  exports.ATTEMPT_LEDGER_TTL_SECONDS = require_client.ATTEMPT_LEDGER_TTL_SECONDS;
13
+ exports.DEFAULT_LOCK_TTL_SECONDS = require_issue.DEFAULT_LOCK_TTL_SECONDS;
14
+ exports.DEFAULT_LOCK_WAIT_MS = require_issue.DEFAULT_LOCK_WAIT_MS;
15
+ exports.DEFAULT_TAXPAYER_INVALID_TTL_SECONDS = require_client.DEFAULT_TAXPAYER_INVALID_TTL_SECONDS;
16
+ exports.DEFAULT_TAXPAYER_TTL_SECONDS = require_client.DEFAULT_TAXPAYER_TTL_SECONDS;
17
+ exports.DocumentHookError = require_create_once.DocumentHookError;
18
+ exports.KASSZA_ERROR_DOCS_URL = require_errors.KASSZA_ERROR_DOCS_URL;
13
19
  exports.MAX_INVOICE_ATTACHMENTS = require_create_once.MAX_INVOICE_ATTACHMENTS;
20
+ exports.ONCE_LOCK_KEY_PREFIX = require_issue.ONCE_LOCK_KEY_PREFIX;
14
21
  exports.RECEIPT_MAX_GROSS_HUF = require_issue.RECEIPT_MAX_GROSS_HUF;
15
22
  exports.SZAMLAZZ_AGENT_URL = require_create_once.SZAMLAZZ_AGENT_URL;
16
23
  exports.SzamlazzError = require_errors.SzamlazzError;
24
+ exports.TAXPAYER_CACHE_KEY_PREFIX = require_client.TAXPAYER_CACHE_KEY_PREFIX;
17
25
  exports.addBudapestDays = require_dates.addBudapestDays;
18
26
  exports.attemptLedgerKey = require_client.attemptLedgerKey;
19
27
  exports.buyerFromCustomer = require_issue.buyerFromCustomer;
20
28
  exports.bytesToBase64 = require_binary.bytesToBase64;
21
29
  exports.chooseDocument = require_issue.chooseDocument;
22
30
  exports.conversionExternalId = require_issue.conversionExternalId;
31
+ exports.correctionExternalId = require_issue.correctionExternalId;
23
32
  exports.createKassza = require_client.createKassza;
33
+ exports.errorCodeDocsUrl = require_errors.errorCodeDocsUrl;
24
34
  exports.invoiceOnceExternalId = require_issue.invoiceOnceExternalId;
35
+ exports.isDocumentHookError = require_create_once.isDocumentHookError;
25
36
  exports.isSzamlazzError = require_errors.isSzamlazzError;
26
37
  exports.issueForPayment = require_issue.issueForPayment;
27
38
  exports.memoryCookieStore = require_session.memoryCookieStore;
39
+ exports.memoryStore = require_session.memoryStore;
40
+ exports.paymentMarker = require_create_once.paymentMarker;
28
41
  exports.paymentOrderNumber = require_issue.paymentOrderNumber;
42
+ exports.storeCapabilities = require_session.storeCapabilities;
29
43
  exports.suggestedPrefix = require_errors.suggestedPrefix;
30
44
  exports.toBudapestDate = require_dates.toBudapestDate;
31
45
  exports.toBudapestTimestamp = require_dates.toBudapestTimestamp;
package/dist/index.d.cts CHANGED
@@ -1,25 +1,15 @@
1
- import { r as memoryCookieStore, t as CookieStore } from "./session-Dm_45x8K.cjs";
2
- import { $ as TransOFlexWaybill, A as BuyerLedger, B as InvoiceItemInput, D as SzamlazzErrorCategory, E as SzamlazzError, F as CreatedInvoiceItem, G as InvoiceTemplate, H as InvoicePostalAddress, I as Currency, J as MplWaybill, K as InvoiceType, L as FinalInvoiceInput, M as CourierService, N as CreateInvoiceInput, O as isSzamlazzError, P as CreatedInvoice, Q as TaxpayerType, R as InvoiceBuyer, T as AgentErrorCodeInfo, U as InvoicePreview, V as InvoiceLanguage, W as InvoiceSeller, X as SprinterWaybill, Y as PickPackPointWaybill, Z as StandardInvoiceInput, _ as ReversedInvoice, a as AgentResponseEvent, b as RegisterPaymentInput, c as SzamlazzOptions, d as InvoiceCreatedEvent, et as Waybill, f as InvoicePaymentEvent, g as ReverseInvoiceInput, h as ReceiptReversedEvent, i as AgentRequestEvent, it as SZAMLAZZ_AGENT_URL, j as CorrectiveInvoiceInput, k as suggestedPrefix, l as DocumentEvent, m as ReceiptCreatedEvent, nt as AgentAction, o as RequestOptions, p as InvoiceReversedEvent, q as ItemLedger, r as AgentErrorEvent, rt as MAX_INVOICE_ATTACHMENTS, s as SzamlazzHooks, t as AgentAttachment, tt as AGENT_ACTIONS, u as DocumentHook, v as ClearPaymentsInput, w as AGENT_ERROR_CODES, x as RegisteredPayment, y as PaymentEntry, z as InvoiceDefaults } from "./context-DXNbTPwz.cjs";
3
1
  import { a as todayInBudapest, i as toBudapestTimestamp, n as addBudapestDays, r as toBudapestDate, t as DateInput } from "./dates-9zvESP0i.cjs";
4
- import { _ as VatRate, o as ItemAmounts, s as ItemPriceInput } from "./index-CYAGCdKJ.cjs";
5
- import { a as ReceiptItem, c as ReceiptPayment, d as ReceiptTotals, f as ReceiptType, h as SendReceiptInput, i as ReceiptDefaults, l as ReceiptPaymentInput, m as ReverseReceiptInput, n as GetReceiptInput, o as ReceiptItemInput, p as ReceiptVatRate, r as Receipt, s as ReceiptOnlyVatCode, t as CreateReceiptInput, u as ReceiptPdfTemplate } from "./types-DH8QoNZK.cjs";
6
- import { A as RECEIPT_MAX_GROSS_HUF, C as buyerFromCustomer, D as ChooseDocumentInput, E as ChooseDocumentBuyer, F as invoiceOnceExternalId, I as CreateOnceOptions, L as InvoiceReference, M as ProformaReference, N as InvoicePdf, O as DocumentChoice, P as InvoiceOnceResult, S as SkippedPayment, T as paymentOrderNumber, _ as IssuedInvoice, a as ReceiptsApi, b as PaymentDocumentItem, c as TaxpayerInfo, d as ReceiptOnceResult, f as ConvertReceiptInput, g as IssuedDocument, h as IssueForPaymentOptions, i as KasszaOptions, j as chooseDocument, k as DocumentDecision, l as TaxpayerTaxNumber, m as conversionExternalId, n as Kassza, o as TaxpayerApi, p as ConvertedReceipt, r as KasszaDefaults, s as createKassza, t as InvoicesApi, u as TaxpayerAddress, v as IssuedReceipt, w as issueForPayment, x as PaymentDocumentsApi, y as IssuedReversal } from "./client-B5FryKxJ.cjs";
2
+ import { a as AgentAction, i as AGENT_ACTIONS, n as KasszaWarningKind, o as MAX_INVOICE_ATTACHMENTS, r as WarningHook, s as SZAMLAZZ_AGENT_URL, t as KasszaWarning } from "./warnings-B3DXnveC.cjs";
3
+ import { $ as Waybill, A as CorrectiveInvoiceInput, B as InvoiceLanguage, C as ClearPaymentsInput, E as RegisteredPayment, F as Currency, G as InvoiceType, H as InvoicePreview, I as FinalInvoiceInput, J as PickPackPointWaybill, K as ItemLedger, L as InvoiceBuyer, M as CreateInvoiceInput, N as CreatedInvoice, P as CreatedInvoiceItem, Q as TransOFlexWaybill, R as InvoiceDefaults, S as ReversedInvoice, T as RegisterPaymentInput, U as InvoiceSeller, V as InvoicePostalAddress, W as InvoiceTemplate, X as StandardInvoiceInput, Y as SprinterWaybill, Z as TaxpayerType, _ as InvoiceReversedEvent, a as AgentRequestEvent, at as AgentErrorCodeInfo, b as isDocumentHookError, c as SzamlazzHooks, ct as SzamlazzErrorCategory, d as DocumentErrorMode, dt as suggestedPrefix, et as ATTEMPT_LEDGER_KEY_PREFIX, f as DocumentEvent, g as InvoicePaymentEvent, h as InvoiceCreatedEvent, i as AgentErrorEvent, it as AGENT_ERROR_CODES, j as CourierService, k as BuyerLedger, l as SzamlazzOptions, lt as errorCodeDocsUrl, m as DocumentHookError, n as AgentCompleteEvent, nt as AttemptLedgerMode, o as AgentResponseEvent, ot as KASSZA_ERROR_DOCS_URL, p as DocumentHook, q as MplWaybill, rt as attemptLedgerKey, s as RequestOptions, st as SzamlazzError, t as AgentAttachment, tt as ATTEMPT_LEDGER_TTL_SECONDS, u as DocumentErrorHandler, ut as isSzamlazzError, v as ReceiptCreatedEvent, w as PaymentEntry, x as ReverseInvoiceInput, y as ReceiptReversedEvent, z as InvoiceItemInput } from "./context-CFNKzStE.cjs";
4
+ import { a as storeCapabilities, i as memoryStore, n as KeyValueStore, r as StoreCapabilities, t as Awaitable } from "./store-C1rHd9DB.cjs";
5
+ import { S as VatRate, d as ItemAmounts, f as ItemPriceInput } from "./index-C-7yWV7L.cjs";
6
+ import { a as ReceiptItem, c as ReceiptPayment, d as ReceiptTotals, f as ReceiptType, h as SendReceiptInput, i as ReceiptDefaults, l as ReceiptPaymentInput, m as ReverseReceiptInput, n as GetReceiptInput, o as ReceiptItemInput, p as ReceiptVatRate, r as Receipt, s as ReceiptOnlyVatCode, t as CreateReceiptInput, u as ReceiptPdfTemplate } from "./types-lnKkQdot.cjs";
7
+ import { r as memoryCookieStore, t as CookieStore } from "./session-YbChChx7.cjs";
8
+ import { $ as ONCE_LOCK_KEY_PREFIX, A as IssuedRefundCorrection, B as DocumentDecision, C as PaymentDocumentItem, D as issueForPayment, E as buyerFromCustomer, F as RefundProposalLine, G as RegisterPaymentOnceInput, H as chooseDocument, I as correctionExternalId, J as InvoiceReference, K as RegisteredPaymentOnce, L as ChooseDocumentBuyer, M as PartialRefundMode, N as RefundItemsContext, O as paymentOrderNumber, P as RefundItemsResolver, Q as LockFailureMode, R as ChooseDocumentInput, S as IssuedReversal, T as SkippedPayment, U as ProformaReference, V as RECEIPT_MAX_GROSS_HUF, W as InvoicePdf, X as DEFAULT_LOCK_TTL_SECONDS, Y as CreateOnceOptions, Z as DEFAULT_LOCK_WAIT_MS, _ as conversionExternalId, a as ReceiptsApi, b as IssuedInvoice, c as DEFAULT_TAXPAYER_INVALID_TTL_SECONDS, d as TaxpayerCacheOptions, et as OnceLockOptions, f as TaxpayerInfo, g as ConvertedReceipt, h as ConvertReceiptInput, i as KasszaOptions, j as IssuedRefundProposal, k as IssuedCorrection, l as DEFAULT_TAXPAYER_TTL_SECONDS, m as TaxpayerAddress, n as Kassza, o as TaxpayerApi, p as TaxpayerTaxNumber, q as paymentMarker, r as KasszaDefaults, s as createKassza, t as InvoicesApi, u as TAXPAYER_CACHE_KEY_PREFIX, v as IssueForPaymentOptions, w as PaymentDocumentsApi, x as IssuedReceipt, y as IssuedDocument, z as DocumentChoice } from "./client-SVZu25MB.cjs";
7
9
  import { a as InvoiceDetailsItem, c as InvoiceDetailsTotals, i as InvoiceDetailsHeader, l as InvoiceDocumentType, n as InvoiceDetails, o as InvoiceDetailsPayment, r as InvoiceDetailsBuyer, s as InvoiceDetailsSeller, t as GetInvoiceOptions } from "./get-Byc9T5WO.cjs";
8
- import { a as PaymentEventKind, c as PaymentProvider, i as PaymentEvent, n as PaymentAmount, r as PaymentCustomer, s as PaymentLineItem, t as PaymentAddress } from "./types-BVeR7KyU.cjs";
9
- //#region src/core/attempt-ledger.d.ts
10
- export declare const ATTEMPT_LEDGER_TTL_SECONDS = 86400;
11
- export declare const ATTEMPT_LEDGER_KEY_PREFIX = "szamlazz:attempts:";
12
- interface AttemptLedgerRequest {
13
- readonly action: AgentAction;
14
- readonly xml: string;
15
- readonly attachments?: readonly {
16
- readonly filename: string;
17
- readonly size: number;
18
- }[];
19
- }
20
- export declare function attemptLedgerKey(request: AttemptLedgerRequest): Promise<string>;
21
- //#endregion
10
+ import { n as InvoiceOnceResult, r as invoiceOnceExternalId, t as ReceiptOnceResult } from "./create-once-Bh6fOWkW.cjs";
11
+ import { a as PaymentEventKind, c as PaymentProvider, i as PaymentEvent, l as PaymentRefund, n as PaymentAmount, r as PaymentCustomer, s as PaymentLineItem, t as PaymentAddress } from "./types-B1A8mUIE.cjs";
22
12
  //#region src/core/binary.d.ts
23
13
  export declare function bytesToBase64(bytes: Uint8Array): string;
24
14
  //#endregion
25
- export { AGENT_ACTIONS, AGENT_ERROR_CODES, type AgentAction, type AgentAttachment, type AgentErrorCodeInfo, type AgentErrorEvent, type AgentRequestEvent, type AgentResponseEvent, type BuyerLedger, type ChooseDocumentBuyer, type ChooseDocumentInput, type ClearPaymentsInput, type ConvertReceiptInput, type ConvertedReceipt, type CookieStore, type CorrectiveInvoiceInput, type CourierService, type CreateInvoiceInput, type CreateOnceOptions, type CreateReceiptInput, type CreatedInvoice, type CreatedInvoiceItem, type Currency, type DateInput, type DocumentChoice, type DocumentDecision, type DocumentEvent, type DocumentHook, type FinalInvoiceInput, type GetInvoiceOptions, type GetReceiptInput, type InvoiceBuyer, type InvoiceCreatedEvent, type InvoiceDefaults, type InvoiceDetails, type InvoiceDetailsBuyer, type InvoiceDetailsHeader, type InvoiceDetailsItem, type InvoiceDetailsPayment, type InvoiceDetailsSeller, type InvoiceDetailsTotals, type InvoiceDocumentType, type InvoiceItemInput, type InvoiceLanguage, type InvoiceOnceResult, type InvoicePaymentEvent, type InvoicePdf, type InvoicePostalAddress, type InvoicePreview, type InvoiceReference, type InvoiceReversedEvent, type InvoiceSeller, type InvoiceTemplate, type InvoiceType, type InvoicesApi, type IssueForPaymentOptions, type IssuedDocument, type IssuedInvoice, type IssuedReceipt, type IssuedReversal, type ItemAmounts, type ItemLedger, type ItemPriceInput, type Kassza, type KasszaDefaults, type KasszaOptions, MAX_INVOICE_ATTACHMENTS, type MplWaybill, type PaymentAddress, type PaymentAmount, type PaymentCustomer, type PaymentDocumentItem, type PaymentDocumentsApi, type PaymentEntry, type PaymentEvent, type PaymentEventKind, type PaymentLineItem, type PaymentProvider, type PickPackPointWaybill, type ProformaReference, RECEIPT_MAX_GROSS_HUF, type Receipt, type ReceiptCreatedEvent, type ReceiptDefaults, type ReceiptItem, type ReceiptItemInput, type ReceiptOnceResult, type ReceiptOnlyVatCode, type ReceiptPayment, type ReceiptPaymentInput, type ReceiptPdfTemplate, type ReceiptReversedEvent, type ReceiptTotals, type ReceiptType, type ReceiptVatRate, type ReceiptsApi, type RegisterPaymentInput, type RegisteredPayment, type RequestOptions, type ReverseInvoiceInput, type ReverseReceiptInput, type ReversedInvoice, SZAMLAZZ_AGENT_URL, type SendReceiptInput, type SkippedPayment, type SprinterWaybill, type StandardInvoiceInput, SzamlazzError, type SzamlazzErrorCategory, type SzamlazzHooks, type SzamlazzOptions, type TaxpayerAddress, type TaxpayerApi, type TaxpayerInfo, type TaxpayerTaxNumber, type TaxpayerType, type TransOFlexWaybill, type VatRate, type Waybill, addBudapestDays, buyerFromCustomer, chooseDocument, conversionExternalId, createKassza, invoiceOnceExternalId, isSzamlazzError, issueForPayment, memoryCookieStore, paymentOrderNumber, suggestedPrefix, toBudapestDate, toBudapestTimestamp, todayInBudapest };
15
+ export { AGENT_ACTIONS, AGENT_ERROR_CODES, ATTEMPT_LEDGER_KEY_PREFIX, ATTEMPT_LEDGER_TTL_SECONDS, type AgentAction, type AgentAttachment, type AgentCompleteEvent, type AgentErrorCodeInfo, type AgentErrorEvent, type AgentRequestEvent, type AgentResponseEvent, type AttemptLedgerMode, type Awaitable, type BuyerLedger, type ChooseDocumentBuyer, type ChooseDocumentInput, type ClearPaymentsInput, type ConvertReceiptInput, type ConvertedReceipt, type CookieStore, type CorrectiveInvoiceInput, type CourierService, type CreateInvoiceInput, type CreateOnceOptions, type CreateReceiptInput, type CreatedInvoice, type CreatedInvoiceItem, type Currency, DEFAULT_LOCK_TTL_SECONDS, DEFAULT_LOCK_WAIT_MS, DEFAULT_TAXPAYER_INVALID_TTL_SECONDS, DEFAULT_TAXPAYER_TTL_SECONDS, type DateInput, type DocumentChoice, type DocumentDecision, type DocumentErrorHandler, type DocumentErrorMode, type DocumentEvent, type DocumentHook, DocumentHookError, type FinalInvoiceInput, type GetInvoiceOptions, type GetReceiptInput, type InvoiceBuyer, type InvoiceCreatedEvent, type InvoiceDefaults, type InvoiceDetails, type InvoiceDetailsBuyer, type InvoiceDetailsHeader, type InvoiceDetailsItem, type InvoiceDetailsPayment, type InvoiceDetailsSeller, type InvoiceDetailsTotals, type InvoiceDocumentType, type InvoiceItemInput, type InvoiceLanguage, type InvoiceOnceResult, type InvoicePaymentEvent, type InvoicePdf, type InvoicePostalAddress, type InvoicePreview, type InvoiceReference, type InvoiceReversedEvent, type InvoiceSeller, type InvoiceTemplate, type InvoiceType, type InvoicesApi, type IssueForPaymentOptions, type IssuedCorrection, type IssuedDocument, type IssuedInvoice, type IssuedReceipt, type IssuedRefundCorrection, type IssuedRefundProposal, type IssuedReversal, type ItemAmounts, type ItemLedger, type ItemPriceInput, KASSZA_ERROR_DOCS_URL, type Kassza, type KasszaDefaults, type KasszaOptions, type KasszaWarning, type KasszaWarningKind, type KeyValueStore, type LockFailureMode, MAX_INVOICE_ATTACHMENTS, type MplWaybill, ONCE_LOCK_KEY_PREFIX, type OnceLockOptions, type PartialRefundMode, type PaymentAddress, type PaymentAmount, type PaymentCustomer, type PaymentDocumentItem, type PaymentDocumentsApi, type PaymentEntry, type PaymentEvent, type PaymentEventKind, type PaymentLineItem, type PaymentProvider, type PaymentRefund, type PickPackPointWaybill, type ProformaReference, RECEIPT_MAX_GROSS_HUF, type Receipt, type ReceiptCreatedEvent, type ReceiptDefaults, type ReceiptItem, type ReceiptItemInput, type ReceiptOnceResult, type ReceiptOnlyVatCode, type ReceiptPayment, type ReceiptPaymentInput, type ReceiptPdfTemplate, type ReceiptReversedEvent, type ReceiptTotals, type ReceiptType, type ReceiptVatRate, type ReceiptsApi, type RefundItemsContext, type RefundItemsResolver, type RefundProposalLine, type RegisterPaymentInput, type RegisterPaymentOnceInput, type RegisteredPayment, type RegisteredPaymentOnce, type RequestOptions, type ReverseInvoiceInput, type ReverseReceiptInput, type ReversedInvoice, SZAMLAZZ_AGENT_URL, type SendReceiptInput, type SkippedPayment, type SprinterWaybill, type StandardInvoiceInput, type StoreCapabilities, SzamlazzError, type SzamlazzErrorCategory, type SzamlazzHooks, type SzamlazzOptions, TAXPAYER_CACHE_KEY_PREFIX, type TaxpayerAddress, type TaxpayerApi, type TaxpayerCacheOptions, type TaxpayerInfo, type TaxpayerTaxNumber, type TaxpayerType, type TransOFlexWaybill, type VatRate, type WarningHook, type Waybill, addBudapestDays, attemptLedgerKey, buyerFromCustomer, chooseDocument, conversionExternalId, correctionExternalId, createKassza, errorCodeDocsUrl, invoiceOnceExternalId, isDocumentHookError, isSzamlazzError, issueForPayment, memoryCookieStore, memoryStore, paymentMarker, paymentOrderNumber, storeCapabilities, suggestedPrefix, toBudapestDate, toBudapestTimestamp, todayInBudapest };
package/dist/index.d.ts CHANGED
@@ -1,25 +1,15 @@
1
- import { r as memoryCookieStore, t as CookieStore } from "./session-Dm_45x8K.js";
2
- import { $ as TransOFlexWaybill, A as BuyerLedger, B as InvoiceItemInput, D as SzamlazzErrorCategory, E as SzamlazzError, F as CreatedInvoiceItem, G as InvoiceTemplate, H as InvoicePostalAddress, I as Currency, J as MplWaybill, K as InvoiceType, L as FinalInvoiceInput, M as CourierService, N as CreateInvoiceInput, O as isSzamlazzError, P as CreatedInvoice, Q as TaxpayerType, R as InvoiceBuyer, T as AgentErrorCodeInfo, U as InvoicePreview, V as InvoiceLanguage, W as InvoiceSeller, X as SprinterWaybill, Y as PickPackPointWaybill, Z as StandardInvoiceInput, _ as ReversedInvoice, a as AgentResponseEvent, b as RegisterPaymentInput, c as SzamlazzOptions, d as InvoiceCreatedEvent, et as Waybill, f as InvoicePaymentEvent, g as ReverseInvoiceInput, h as ReceiptReversedEvent, i as AgentRequestEvent, it as SZAMLAZZ_AGENT_URL, j as CorrectiveInvoiceInput, k as suggestedPrefix, l as DocumentEvent, m as ReceiptCreatedEvent, nt as AgentAction, o as RequestOptions, p as InvoiceReversedEvent, q as ItemLedger, r as AgentErrorEvent, rt as MAX_INVOICE_ATTACHMENTS, s as SzamlazzHooks, t as AgentAttachment, tt as AGENT_ACTIONS, u as DocumentHook, v as ClearPaymentsInput, w as AGENT_ERROR_CODES, x as RegisteredPayment, y as PaymentEntry, z as InvoiceDefaults } from "./context-BxQlIlug.js";
3
1
  import { a as todayInBudapest, i as toBudapestTimestamp, n as addBudapestDays, r as toBudapestDate, t as DateInput } from "./dates-9zvESP0i.js";
4
- import { _ as VatRate, o as ItemAmounts, s as ItemPriceInput } from "./index-CYAGCdKJ.js";
5
- import { a as ReceiptItem, c as ReceiptPayment, d as ReceiptTotals, f as ReceiptType, h as SendReceiptInput, i as ReceiptDefaults, l as ReceiptPaymentInput, m as ReverseReceiptInput, n as GetReceiptInput, o as ReceiptItemInput, p as ReceiptVatRate, r as Receipt, s as ReceiptOnlyVatCode, t as CreateReceiptInput, u as ReceiptPdfTemplate } from "./types-k--zHf4l.js";
6
- import { A as RECEIPT_MAX_GROSS_HUF, C as buyerFromCustomer, D as ChooseDocumentInput, E as ChooseDocumentBuyer, F as invoiceOnceExternalId, I as CreateOnceOptions, L as InvoiceReference, M as ProformaReference, N as InvoicePdf, O as DocumentChoice, P as InvoiceOnceResult, S as SkippedPayment, T as paymentOrderNumber, _ as IssuedInvoice, a as ReceiptsApi, b as PaymentDocumentItem, c as TaxpayerInfo, d as ReceiptOnceResult, f as ConvertReceiptInput, g as IssuedDocument, h as IssueForPaymentOptions, i as KasszaOptions, j as chooseDocument, k as DocumentDecision, l as TaxpayerTaxNumber, m as conversionExternalId, n as Kassza, o as TaxpayerApi, p as ConvertedReceipt, r as KasszaDefaults, s as createKassza, t as InvoicesApi, u as TaxpayerAddress, v as IssuedReceipt, w as issueForPayment, x as PaymentDocumentsApi, y as IssuedReversal } from "./client-6MkeuFqD.js";
2
+ import { a as AgentAction, i as AGENT_ACTIONS, n as KasszaWarningKind, o as MAX_INVOICE_ATTACHMENTS, r as WarningHook, s as SZAMLAZZ_AGENT_URL, t as KasszaWarning } from "./warnings-B3DXnveC.js";
3
+ import { $ as Waybill, A as CorrectiveInvoiceInput, B as InvoiceLanguage, C as ClearPaymentsInput, E as RegisteredPayment, F as Currency, G as InvoiceType, H as InvoicePreview, I as FinalInvoiceInput, J as PickPackPointWaybill, K as ItemLedger, L as InvoiceBuyer, M as CreateInvoiceInput, N as CreatedInvoice, P as CreatedInvoiceItem, Q as TransOFlexWaybill, R as InvoiceDefaults, S as ReversedInvoice, T as RegisterPaymentInput, U as InvoiceSeller, V as InvoicePostalAddress, W as InvoiceTemplate, X as StandardInvoiceInput, Y as SprinterWaybill, Z as TaxpayerType, _ as InvoiceReversedEvent, a as AgentRequestEvent, at as AgentErrorCodeInfo, b as isDocumentHookError, c as SzamlazzHooks, ct as SzamlazzErrorCategory, d as DocumentErrorMode, dt as suggestedPrefix, et as ATTEMPT_LEDGER_KEY_PREFIX, f as DocumentEvent, g as InvoicePaymentEvent, h as InvoiceCreatedEvent, i as AgentErrorEvent, it as AGENT_ERROR_CODES, j as CourierService, k as BuyerLedger, l as SzamlazzOptions, lt as errorCodeDocsUrl, m as DocumentHookError, n as AgentCompleteEvent, nt as AttemptLedgerMode, o as AgentResponseEvent, ot as KASSZA_ERROR_DOCS_URL, p as DocumentHook, q as MplWaybill, rt as attemptLedgerKey, s as RequestOptions, st as SzamlazzError, t as AgentAttachment, tt as ATTEMPT_LEDGER_TTL_SECONDS, u as DocumentErrorHandler, ut as isSzamlazzError, v as ReceiptCreatedEvent, w as PaymentEntry, x as ReverseInvoiceInput, y as ReceiptReversedEvent, z as InvoiceItemInput } from "./context-kb33TgzE.js";
4
+ import { a as storeCapabilities, i as memoryStore, n as KeyValueStore, r as StoreCapabilities, t as Awaitable } from "./store-C1rHd9DB.js";
5
+ import { S as VatRate, d as ItemAmounts, f as ItemPriceInput } from "./index-C-7yWV7L.js";
6
+ import { a as ReceiptItem, c as ReceiptPayment, d as ReceiptTotals, f as ReceiptType, h as SendReceiptInput, i as ReceiptDefaults, l as ReceiptPaymentInput, m as ReverseReceiptInput, n as GetReceiptInput, o as ReceiptItemInput, p as ReceiptVatRate, r as Receipt, s as ReceiptOnlyVatCode, t as CreateReceiptInput, u as ReceiptPdfTemplate } from "./types-D1zDOH_F.js";
7
+ import { r as memoryCookieStore, t as CookieStore } from "./session-Ckl5eJhV.js";
8
+ import { $ as ONCE_LOCK_KEY_PREFIX, A as IssuedRefundCorrection, B as DocumentDecision, C as PaymentDocumentItem, D as issueForPayment, E as buyerFromCustomer, F as RefundProposalLine, G as RegisterPaymentOnceInput, H as chooseDocument, I as correctionExternalId, J as InvoiceReference, K as RegisteredPaymentOnce, L as ChooseDocumentBuyer, M as PartialRefundMode, N as RefundItemsContext, O as paymentOrderNumber, P as RefundItemsResolver, Q as LockFailureMode, R as ChooseDocumentInput, S as IssuedReversal, T as SkippedPayment, U as ProformaReference, V as RECEIPT_MAX_GROSS_HUF, W as InvoicePdf, X as DEFAULT_LOCK_TTL_SECONDS, Y as CreateOnceOptions, Z as DEFAULT_LOCK_WAIT_MS, _ as conversionExternalId, a as ReceiptsApi, b as IssuedInvoice, c as DEFAULT_TAXPAYER_INVALID_TTL_SECONDS, d as TaxpayerCacheOptions, et as OnceLockOptions, f as TaxpayerInfo, g as ConvertedReceipt, h as ConvertReceiptInput, i as KasszaOptions, j as IssuedRefundProposal, k as IssuedCorrection, l as DEFAULT_TAXPAYER_TTL_SECONDS, m as TaxpayerAddress, n as Kassza, o as TaxpayerApi, p as TaxpayerTaxNumber, q as paymentMarker, r as KasszaDefaults, s as createKassza, t as InvoicesApi, u as TAXPAYER_CACHE_KEY_PREFIX, v as IssueForPaymentOptions, w as PaymentDocumentsApi, x as IssuedReceipt, y as IssuedDocument, z as DocumentChoice } from "./client-DeWWQ-RZ.js";
7
9
  import { a as InvoiceDetailsItem, c as InvoiceDetailsTotals, i as InvoiceDetailsHeader, l as InvoiceDocumentType, n as InvoiceDetails, o as InvoiceDetailsPayment, r as InvoiceDetailsBuyer, s as InvoiceDetailsSeller, t as GetInvoiceOptions } from "./get-Byc9T5WO.js";
8
- import { a as PaymentEventKind, c as PaymentProvider, i as PaymentEvent, n as PaymentAmount, r as PaymentCustomer, s as PaymentLineItem, t as PaymentAddress } from "./types-BVeR7KyU.js";
9
- //#region src/core/attempt-ledger.d.ts
10
- export declare const ATTEMPT_LEDGER_TTL_SECONDS = 86400;
11
- export declare const ATTEMPT_LEDGER_KEY_PREFIX = "szamlazz:attempts:";
12
- interface AttemptLedgerRequest {
13
- readonly action: AgentAction;
14
- readonly xml: string;
15
- readonly attachments?: readonly {
16
- readonly filename: string;
17
- readonly size: number;
18
- }[];
19
- }
20
- export declare function attemptLedgerKey(request: AttemptLedgerRequest): Promise<string>;
21
- //#endregion
10
+ import { n as InvoiceOnceResult, r as invoiceOnceExternalId, t as ReceiptOnceResult } from "./create-once-VKp0tVow.js";
11
+ import { a as PaymentEventKind, c as PaymentProvider, i as PaymentEvent, l as PaymentRefund, n as PaymentAmount, r as PaymentCustomer, s as PaymentLineItem, t as PaymentAddress } from "./types-ByAEvGsZ.js";
22
12
  //#region src/core/binary.d.ts
23
13
  export declare function bytesToBase64(bytes: Uint8Array): string;
24
14
  //#endregion
25
- export { AGENT_ACTIONS, AGENT_ERROR_CODES, type AgentAction, type AgentAttachment, type AgentErrorCodeInfo, type AgentErrorEvent, type AgentRequestEvent, type AgentResponseEvent, type BuyerLedger, type ChooseDocumentBuyer, type ChooseDocumentInput, type ClearPaymentsInput, type ConvertReceiptInput, type ConvertedReceipt, type CookieStore, type CorrectiveInvoiceInput, type CourierService, type CreateInvoiceInput, type CreateOnceOptions, type CreateReceiptInput, type CreatedInvoice, type CreatedInvoiceItem, type Currency, type DateInput, type DocumentChoice, type DocumentDecision, type DocumentEvent, type DocumentHook, type FinalInvoiceInput, type GetInvoiceOptions, type GetReceiptInput, type InvoiceBuyer, type InvoiceCreatedEvent, type InvoiceDefaults, type InvoiceDetails, type InvoiceDetailsBuyer, type InvoiceDetailsHeader, type InvoiceDetailsItem, type InvoiceDetailsPayment, type InvoiceDetailsSeller, type InvoiceDetailsTotals, type InvoiceDocumentType, type InvoiceItemInput, type InvoiceLanguage, type InvoiceOnceResult, type InvoicePaymentEvent, type InvoicePdf, type InvoicePostalAddress, type InvoicePreview, type InvoiceReference, type InvoiceReversedEvent, type InvoiceSeller, type InvoiceTemplate, type InvoiceType, type InvoicesApi, type IssueForPaymentOptions, type IssuedDocument, type IssuedInvoice, type IssuedReceipt, type IssuedReversal, type ItemAmounts, type ItemLedger, type ItemPriceInput, type Kassza, type KasszaDefaults, type KasszaOptions, MAX_INVOICE_ATTACHMENTS, type MplWaybill, type PaymentAddress, type PaymentAmount, type PaymentCustomer, type PaymentDocumentItem, type PaymentDocumentsApi, type PaymentEntry, type PaymentEvent, type PaymentEventKind, type PaymentLineItem, type PaymentProvider, type PickPackPointWaybill, type ProformaReference, RECEIPT_MAX_GROSS_HUF, type Receipt, type ReceiptCreatedEvent, type ReceiptDefaults, type ReceiptItem, type ReceiptItemInput, type ReceiptOnceResult, type ReceiptOnlyVatCode, type ReceiptPayment, type ReceiptPaymentInput, type ReceiptPdfTemplate, type ReceiptReversedEvent, type ReceiptTotals, type ReceiptType, type ReceiptVatRate, type ReceiptsApi, type RegisterPaymentInput, type RegisteredPayment, type RequestOptions, type ReverseInvoiceInput, type ReverseReceiptInput, type ReversedInvoice, SZAMLAZZ_AGENT_URL, type SendReceiptInput, type SkippedPayment, type SprinterWaybill, type StandardInvoiceInput, SzamlazzError, type SzamlazzErrorCategory, type SzamlazzHooks, type SzamlazzOptions, type TaxpayerAddress, type TaxpayerApi, type TaxpayerInfo, type TaxpayerTaxNumber, type TaxpayerType, type TransOFlexWaybill, type VatRate, type Waybill, addBudapestDays, buyerFromCustomer, chooseDocument, conversionExternalId, createKassza, invoiceOnceExternalId, isSzamlazzError, issueForPayment, memoryCookieStore, paymentOrderNumber, suggestedPrefix, toBudapestDate, toBudapestTimestamp, todayInBudapest };
15
+ export { AGENT_ACTIONS, AGENT_ERROR_CODES, ATTEMPT_LEDGER_KEY_PREFIX, ATTEMPT_LEDGER_TTL_SECONDS, type AgentAction, type AgentAttachment, type AgentCompleteEvent, type AgentErrorCodeInfo, type AgentErrorEvent, type AgentRequestEvent, type AgentResponseEvent, type AttemptLedgerMode, type Awaitable, type BuyerLedger, type ChooseDocumentBuyer, type ChooseDocumentInput, type ClearPaymentsInput, type ConvertReceiptInput, type ConvertedReceipt, type CookieStore, type CorrectiveInvoiceInput, type CourierService, type CreateInvoiceInput, type CreateOnceOptions, type CreateReceiptInput, type CreatedInvoice, type CreatedInvoiceItem, type Currency, DEFAULT_LOCK_TTL_SECONDS, DEFAULT_LOCK_WAIT_MS, DEFAULT_TAXPAYER_INVALID_TTL_SECONDS, DEFAULT_TAXPAYER_TTL_SECONDS, type DateInput, type DocumentChoice, type DocumentDecision, type DocumentErrorHandler, type DocumentErrorMode, type DocumentEvent, type DocumentHook, DocumentHookError, type FinalInvoiceInput, type GetInvoiceOptions, type GetReceiptInput, type InvoiceBuyer, type InvoiceCreatedEvent, type InvoiceDefaults, type InvoiceDetails, type InvoiceDetailsBuyer, type InvoiceDetailsHeader, type InvoiceDetailsItem, type InvoiceDetailsPayment, type InvoiceDetailsSeller, type InvoiceDetailsTotals, type InvoiceDocumentType, type InvoiceItemInput, type InvoiceLanguage, type InvoiceOnceResult, type InvoicePaymentEvent, type InvoicePdf, type InvoicePostalAddress, type InvoicePreview, type InvoiceReference, type InvoiceReversedEvent, type InvoiceSeller, type InvoiceTemplate, type InvoiceType, type InvoicesApi, type IssueForPaymentOptions, type IssuedCorrection, type IssuedDocument, type IssuedInvoice, type IssuedReceipt, type IssuedRefundCorrection, type IssuedRefundProposal, type IssuedReversal, type ItemAmounts, type ItemLedger, type ItemPriceInput, KASSZA_ERROR_DOCS_URL, type Kassza, type KasszaDefaults, type KasszaOptions, type KasszaWarning, type KasszaWarningKind, type KeyValueStore, type LockFailureMode, MAX_INVOICE_ATTACHMENTS, type MplWaybill, ONCE_LOCK_KEY_PREFIX, type OnceLockOptions, type PartialRefundMode, type PaymentAddress, type PaymentAmount, type PaymentCustomer, type PaymentDocumentItem, type PaymentDocumentsApi, type PaymentEntry, type PaymentEvent, type PaymentEventKind, type PaymentLineItem, type PaymentProvider, type PaymentRefund, type PickPackPointWaybill, type ProformaReference, RECEIPT_MAX_GROSS_HUF, type Receipt, type ReceiptCreatedEvent, type ReceiptDefaults, type ReceiptItem, type ReceiptItemInput, type ReceiptOnceResult, type ReceiptOnlyVatCode, type ReceiptPayment, type ReceiptPaymentInput, type ReceiptPdfTemplate, type ReceiptReversedEvent, type ReceiptTotals, type ReceiptType, type ReceiptVatRate, type ReceiptsApi, type RefundItemsContext, type RefundItemsResolver, type RefundProposalLine, type RegisterPaymentInput, type RegisterPaymentOnceInput, type RegisteredPayment, type RegisteredPaymentOnce, type RequestOptions, type ReverseInvoiceInput, type ReverseReceiptInput, type ReversedInvoice, SZAMLAZZ_AGENT_URL, type SendReceiptInput, type SkippedPayment, type SprinterWaybill, type StandardInvoiceInput, type StoreCapabilities, SzamlazzError, type SzamlazzErrorCategory, type SzamlazzHooks, type SzamlazzOptions, TAXPAYER_CACHE_KEY_PREFIX, type TaxpayerAddress, type TaxpayerApi, type TaxpayerCacheOptions, type TaxpayerInfo, type TaxpayerTaxNumber, type TaxpayerType, type TransOFlexWaybill, type VatRate, type WarningHook, type Waybill, addBudapestDays, attemptLedgerKey, buyerFromCustomer, chooseDocument, conversionExternalId, correctionExternalId, createKassza, errorCodeDocsUrl, invoiceOnceExternalId, isDocumentHookError, isSzamlazzError, issueForPayment, memoryCookieStore, memoryStore, paymentMarker, paymentOrderNumber, storeCapabilities, suggestedPrefix, toBudapestDate, toBudapestTimestamp, todayInBudapest };
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { d as SZAMLAZZ_AGENT_URL, l as AGENT_ACTIONS, u as MAX_INVOICE_ATTACHMENTS } from "./create-once-Cz621l8r.js";
2
- import { i as isSzamlazzError, n as SzamlazzError, o as suggestedPrefix, t as AGENT_ERROR_CODES } from "./errors-DLrb0g64.js";
3
- import { c as attemptLedgerKey, o as ATTEMPT_LEDGER_KEY_PREFIX, s as ATTEMPT_LEDGER_TTL_SECONDS, t as createKassza } from "./client-CfaS1-Jx.js";
1
+ import { _ as SZAMLAZZ_AGENT_URL, f as DocumentHookError, g as MAX_INVOICE_ATTACHMENTS, h as AGENT_ACTIONS, m as isDocumentHookError, n as paymentMarker } from "./create-once-Ca2gMk1h.js";
2
+ import { a as errorCodeDocsUrl, c as suggestedPrefix, n as KASSZA_ERROR_DOCS_URL, o as isSzamlazzError, r as SzamlazzError, t as AGENT_ERROR_CODES } from "./errors-DtN4g5Z9.js";
3
+ import { d as attemptLedgerKey, i as TAXPAYER_CACHE_KEY_PREFIX, l as ATTEMPT_LEDGER_KEY_PREFIX, n as DEFAULT_TAXPAYER_INVALID_TTL_SECONDS, r as DEFAULT_TAXPAYER_TTL_SECONDS, t as createKassza, u as ATTEMPT_LEDGER_TTL_SECONDS } from "./client-Cvf-hTz_.js";
4
4
  import { n as bytesToBase64 } from "./binary-D0M9U2MD.js";
5
- import { n as memoryCookieStore } from "./session-rMKaJcmq.js";
5
+ import { a as memoryStore, n as memoryCookieStore, o as storeCapabilities } from "./session-SaEEXu2N.js";
6
+ import { a as conversionExternalId, c as chooseDocument, d as DEFAULT_LOCK_TTL_SECONDS, f as DEFAULT_LOCK_WAIT_MS, i as correctionExternalId, n as issueForPayment, p as ONCE_LOCK_KEY_PREFIX, r as paymentOrderNumber, s as RECEIPT_MAX_GROSS_HUF, t as buyerFromCustomer, u as invoiceOnceExternalId } from "./issue-DMA1Nbr1.js";
6
7
  import { a as todayInBudapest, i as toBudapestTimestamp, r as toBudapestDate, t as addBudapestDays } from "./dates-CXyj7Azy.js";
7
- import { f as conversionExternalId, g as chooseDocument, h as RECEIPT_MAX_GROSS_HUF, n as issueForPayment, r as paymentOrderNumber, t as buyerFromCustomer, v as invoiceOnceExternalId } from "./issue-DtSLpVdJ.js";
8
- export { AGENT_ACTIONS, AGENT_ERROR_CODES, ATTEMPT_LEDGER_KEY_PREFIX, ATTEMPT_LEDGER_TTL_SECONDS, MAX_INVOICE_ATTACHMENTS, RECEIPT_MAX_GROSS_HUF, SZAMLAZZ_AGENT_URL, SzamlazzError, addBudapestDays, attemptLedgerKey, buyerFromCustomer, bytesToBase64, chooseDocument, conversionExternalId, createKassza, invoiceOnceExternalId, isSzamlazzError, issueForPayment, memoryCookieStore, paymentOrderNumber, suggestedPrefix, toBudapestDate, toBudapestTimestamp, todayInBudapest };
8
+ export { AGENT_ACTIONS, AGENT_ERROR_CODES, ATTEMPT_LEDGER_KEY_PREFIX, ATTEMPT_LEDGER_TTL_SECONDS, DEFAULT_LOCK_TTL_SECONDS, DEFAULT_LOCK_WAIT_MS, DEFAULT_TAXPAYER_INVALID_TTL_SECONDS, DEFAULT_TAXPAYER_TTL_SECONDS, DocumentHookError, KASSZA_ERROR_DOCS_URL, MAX_INVOICE_ATTACHMENTS, ONCE_LOCK_KEY_PREFIX, RECEIPT_MAX_GROSS_HUF, SZAMLAZZ_AGENT_URL, SzamlazzError, TAXPAYER_CACHE_KEY_PREFIX, addBudapestDays, attemptLedgerKey, buyerFromCustomer, bytesToBase64, chooseDocument, conversionExternalId, correctionExternalId, createKassza, errorCodeDocsUrl, invoiceOnceExternalId, isDocumentHookError, isSzamlazzError, issueForPayment, memoryCookieStore, memoryStore, paymentMarker, paymentOrderNumber, storeCapabilities, suggestedPrefix, toBudapestDate, toBudapestTimestamp, todayInBudapest };
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_errors = require("../errors-DxeuTslP.cjs");
2
+ const require_errors = require("../errors-EE96_6D_.cjs");
3
3
  const require_binary = require("../binary-B89HM03_.cjs");
4
4
  //#region src/ipn/ip.ts
5
5
  const SZAMLAZZ_OUTBOUND_IPS = [
@@ -24,12 +24,32 @@ function clientAddress(header, trustedProxies) {
24
24
  const entries = header.split(",").map((entry) => entry.trim()).filter((entry) => entry !== "");
25
25
  return entries[entries.length - 1 - trustedProxies];
26
26
  }
27
- function isSzamlazzIp(ip, options = {}) {
27
+ function rejection(reason, message, client) {
28
+ return client === void 0 ? {
29
+ allowed: false,
30
+ reason,
31
+ message
32
+ } : {
33
+ allowed: false,
34
+ reason,
35
+ client,
36
+ message
37
+ };
38
+ }
39
+ function checkSzamlazzIp(ip, options = {}) {
28
40
  const trustedProxies = resolveTrustedProxies(options.trustedProxies);
29
- if (typeof ip !== "string") return false;
41
+ if (typeof ip !== "string" || ip.trim() === "") return rejection("missing_header", "Nincs forrás IP-cím: a proxy nem adta át az x-forwarded-for fejlécet.");
30
42
  const client = clientAddress(ip, trustedProxies);
31
- if (client === void 0) return false;
32
- return new Set((options.allowedIps ?? SZAMLAZZ_OUTBOUND_IPS).map(normalizeIp)).has(normalizeIp(client));
43
+ if (client === void 0) return rejection("no_client_entry", `Az x-forwarded-for fejlécben kevesebb cím van, mint a trustedProxies (${trustedProxies}) + 1.`);
44
+ const normalized = normalizeIp(client);
45
+ if (new Set((options.allowedIps ?? SZAMLAZZ_OUTBOUND_IPS).map(normalizeIp)).has(normalized)) return {
46
+ allowed: true,
47
+ client: normalized
48
+ };
49
+ return rejection("not_allowed", `A(z) ${normalized} cím nem szerepel a Számlázz.hu kimenő IP-címei között. Ha a Számlázz.hu új címet kapott, add meg az allowedIps opcióban, és jelezd a kassza hibajegyében.`, normalized);
50
+ }
51
+ function isSzamlazzIp(ip, options = {}) {
52
+ return checkSzamlazzIp(ip, options).allowed;
33
53
  }
34
54
  //#endregion
35
55
  //#region src/ipn/notification.ts
@@ -148,6 +168,7 @@ function ipnOkResponse() {
148
168
  exports.IPN_FIELDS = IPN_FIELDS;
149
169
  exports.MAX_IPN_BODY_BYTES = MAX_IPN_BODY_BYTES;
150
170
  exports.SZAMLAZZ_OUTBOUND_IPS = SZAMLAZZ_OUTBOUND_IPS;
171
+ exports.checkSzamlazzIp = checkSzamlazzIp;
151
172
  exports.ipnOkResponse = ipnOkResponse;
152
173
  exports.isSzamlazzIp = isSzamlazzIp;
153
174
  exports.parseIpnAmount = parseIpnAmount;
@@ -4,6 +4,17 @@ interface SzamlazzIpOptions {
4
4
  readonly trustedProxies?: number | undefined;
5
5
  readonly allowedIps?: readonly string[] | undefined;
6
6
  }
7
+ type SzamlazzIpRejection = "missing_header" | "no_client_entry" | "not_allowed";
8
+ type SzamlazzIpCheck = {
9
+ readonly allowed: true;
10
+ readonly client: string;
11
+ } | {
12
+ readonly allowed: false;
13
+ readonly reason: SzamlazzIpRejection;
14
+ readonly client?: string | undefined;
15
+ readonly message: string;
16
+ };
17
+ export declare function checkSzamlazzIp(ip: string | null | undefined, options?: SzamlazzIpOptions): SzamlazzIpCheck;
7
18
  export declare function isSzamlazzIp(ip: string | null | undefined, options?: SzamlazzIpOptions): boolean;
8
19
  //#endregion
9
20
  //#region src/ipn/notification.d.ts
@@ -34,4 +45,4 @@ export declare function parseIpnNotification(input: IpnInput): IpnNotification;
34
45
  export declare function readIpnNotification(request: Request): Promise<IpnNotification>;
35
46
  export declare function ipnOkResponse(): Response;
36
47
  //#endregion
37
- export type { IpnInput, IpnNotification, SzamlazzIpOptions };
48
+ export type { IpnInput, IpnNotification, SzamlazzIpCheck, SzamlazzIpOptions, SzamlazzIpRejection };
@@ -4,6 +4,17 @@ interface SzamlazzIpOptions {
4
4
  readonly trustedProxies?: number | undefined;
5
5
  readonly allowedIps?: readonly string[] | undefined;
6
6
  }
7
+ type SzamlazzIpRejection = "missing_header" | "no_client_entry" | "not_allowed";
8
+ type SzamlazzIpCheck = {
9
+ readonly allowed: true;
10
+ readonly client: string;
11
+ } | {
12
+ readonly allowed: false;
13
+ readonly reason: SzamlazzIpRejection;
14
+ readonly client?: string | undefined;
15
+ readonly message: string;
16
+ };
17
+ export declare function checkSzamlazzIp(ip: string | null | undefined, options?: SzamlazzIpOptions): SzamlazzIpCheck;
7
18
  export declare function isSzamlazzIp(ip: string | null | undefined, options?: SzamlazzIpOptions): boolean;
8
19
  //#endregion
9
20
  //#region src/ipn/notification.d.ts
@@ -34,4 +45,4 @@ export declare function parseIpnNotification(input: IpnInput): IpnNotification;
34
45
  export declare function readIpnNotification(request: Request): Promise<IpnNotification>;
35
46
  export declare function ipnOkResponse(): Response;
36
47
  //#endregion
37
- export type { IpnInput, IpnNotification, SzamlazzIpOptions };
48
+ export type { IpnInput, IpnNotification, SzamlazzIpCheck, SzamlazzIpOptions, SzamlazzIpRejection };
package/dist/ipn/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as SzamlazzError } from "../errors-DLrb0g64.js";
1
+ import { r as SzamlazzError } from "../errors-DtN4g5Z9.js";
2
2
  import { r as decodeUtf8 } from "../binary-D0M9U2MD.js";
3
3
  //#region src/ipn/ip.ts
4
4
  const SZAMLAZZ_OUTBOUND_IPS = [
@@ -23,12 +23,32 @@ function clientAddress(header, trustedProxies) {
23
23
  const entries = header.split(",").map((entry) => entry.trim()).filter((entry) => entry !== "");
24
24
  return entries[entries.length - 1 - trustedProxies];
25
25
  }
26
- function isSzamlazzIp(ip, options = {}) {
26
+ function rejection(reason, message, client) {
27
+ return client === void 0 ? {
28
+ allowed: false,
29
+ reason,
30
+ message
31
+ } : {
32
+ allowed: false,
33
+ reason,
34
+ client,
35
+ message
36
+ };
37
+ }
38
+ function checkSzamlazzIp(ip, options = {}) {
27
39
  const trustedProxies = resolveTrustedProxies(options.trustedProxies);
28
- if (typeof ip !== "string") return false;
40
+ if (typeof ip !== "string" || ip.trim() === "") return rejection("missing_header", "Nincs forrás IP-cím: a proxy nem adta át az x-forwarded-for fejlécet.");
29
41
  const client = clientAddress(ip, trustedProxies);
30
- if (client === void 0) return false;
31
- return new Set((options.allowedIps ?? SZAMLAZZ_OUTBOUND_IPS).map(normalizeIp)).has(normalizeIp(client));
42
+ if (client === void 0) return rejection("no_client_entry", `Az x-forwarded-for fejlécben kevesebb cím van, mint a trustedProxies (${trustedProxies}) + 1.`);
43
+ const normalized = normalizeIp(client);
44
+ if (new Set((options.allowedIps ?? SZAMLAZZ_OUTBOUND_IPS).map(normalizeIp)).has(normalized)) return {
45
+ allowed: true,
46
+ client: normalized
47
+ };
48
+ return rejection("not_allowed", `A(z) ${normalized} cím nem szerepel a Számlázz.hu kimenő IP-címei között. Ha a Számlázz.hu új címet kapott, add meg az allowedIps opcióban, és jelezd a kassza hibajegyében.`, normalized);
49
+ }
50
+ function isSzamlazzIp(ip, options = {}) {
51
+ return checkSzamlazzIp(ip, options).allowed;
32
52
  }
33
53
  //#endregion
34
54
  //#region src/ipn/notification.ts
@@ -144,4 +164,4 @@ function ipnOkResponse() {
144
164
  });
145
165
  }
146
166
  //#endregion
147
- export { IPN_FIELDS, MAX_IPN_BODY_BYTES, SZAMLAZZ_OUTBOUND_IPS, ipnOkResponse, isSzamlazzIp, parseIpnAmount, parseIpnNotification, readIpnNotification };
167
+ export { IPN_FIELDS, MAX_IPN_BODY_BYTES, SZAMLAZZ_OUTBOUND_IPS, checkSzamlazzIp, ipnOkResponse, isSzamlazzIp, parseIpnAmount, parseIpnNotification, readIpnNotification };