kassza 0.11.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.
Files changed (132) hide show
  1. package/README.md +376 -111
  2. package/agents/README.md +20 -5
  3. package/agents/api.md +165 -2
  4. package/agents/pitfalls.md +16 -3
  5. package/agents/recipes.md +215 -45
  6. package/agents/skills/kassza/SKILL.md +11 -8
  7. package/dist/cli.cjs +552 -0
  8. package/dist/cli.d.cts +1 -0
  9. package/dist/cli.d.ts +1 -0
  10. package/dist/cli.js +552 -0
  11. package/dist/client-6MkeuFqD.d.ts +268 -0
  12. package/dist/client-B5FryKxJ.d.cts +268 -0
  13. package/dist/client-C-PdfL_P.cjs +1275 -0
  14. package/dist/client-CfaS1-Jx.js +1228 -0
  15. package/dist/context-BxQlIlug.d.ts +425 -0
  16. package/dist/context-DXNbTPwz.d.cts +425 -0
  17. package/dist/create-once-Cz621l8r.js +330 -0
  18. package/dist/create-once-DgMtKKcG.cjs +395 -0
  19. package/dist/crypto-Dpn4FHQ6.cjs +65 -0
  20. package/dist/crypto-usDg8L2K.js +36 -0
  21. package/dist/data-link/index.cjs +232 -0
  22. package/dist/data-link/index.d.cts +79 -0
  23. package/dist/data-link/index.d.ts +79 -0
  24. package/dist/data-link/index.js +224 -0
  25. package/dist/{dates-DtHzwNU6.d.cts → dates-9zvESP0i.d.cts} +2 -1
  26. package/dist/{dates-DtHzwNU6.d.ts → dates-9zvESP0i.d.ts} +2 -1
  27. package/dist/{dates-PPxH0n5H.cjs → dates-CPgBodkP.cjs} +44 -1
  28. package/dist/{dates-D2XebOIg.js → dates-CXyj7Azy.js} +39 -2
  29. package/dist/delegation/index.cjs +396 -0
  30. package/dist/delegation/index.d.cts +100 -0
  31. package/dist/delegation/index.d.ts +100 -0
  32. package/dist/delegation/index.js +378 -0
  33. package/dist/{errors-DapdV5DK.js → errors-DLrb0g64.js} +122 -5
  34. package/dist/{errors-B0QJhUW1.cjs → errors-DxeuTslP.cjs} +127 -4
  35. package/dist/get-Byc9T5WO.d.cts +151 -0
  36. package/dist/get-Byc9T5WO.d.ts +151 -0
  37. package/dist/get-Csm2n0rZ.cjs +445 -0
  38. package/dist/get-DT3JEgQ6.js +380 -0
  39. package/dist/index.cjs +21 -1410
  40. package/dist/index.d.cts +20 -3
  41. package/dist/index.d.ts +20 -3
  42. package/dist/index.js +8 -1409
  43. package/dist/ipn/index.cjs +1 -1
  44. package/dist/ipn/index.js +1 -1
  45. package/dist/issue-AGRohSm7.cjs +914 -0
  46. package/dist/issue-DtSLpVdJ.js +777 -0
  47. package/dist/json-4y4E2xxS.cjs +61 -0
  48. package/dist/json-B70TwoX1.d.cts +4 -0
  49. package/dist/json-B70TwoX1.d.ts +4 -0
  50. package/dist/json-DjnqnaJK.js +32 -0
  51. package/dist/mcp/index.cjs +10 -0
  52. package/dist/mcp/index.d.cts +71 -0
  53. package/dist/mcp/index.d.ts +71 -0
  54. package/dist/mcp/index.js +2 -0
  55. package/dist/money/index.cjs +12 -10
  56. package/dist/money/index.js +3 -1
  57. package/dist/{money-DkiGukAw.cjs → money-BxytJW6f.cjs} +42 -177
  58. package/dist/{money-C9j7nBNP.js → money-t7uy1n91.js} +29 -110
  59. package/dist/nav/index.cjs +1046 -0
  60. package/dist/nav/index.d.cts +247 -0
  61. package/dist/nav/index.d.ts +247 -0
  62. package/dist/nav/index.js +1012 -0
  63. package/dist/nav-BEwcX7-N.cjs +203 -0
  64. package/dist/nav-CK1WgYo7.js +156 -0
  65. package/dist/parse-BJj-aqKy.cjs +380 -0
  66. package/dist/parse-C608ehqM.js +291 -0
  67. package/dist/payments/barion.cjs +208 -0
  68. package/dist/payments/barion.d.cts +28 -0
  69. package/dist/payments/barion.d.ts +28 -0
  70. package/dist/payments/barion.js +199 -0
  71. package/dist/payments/index.cjs +16 -0
  72. package/dist/payments/index.d.cts +31 -0
  73. package/dist/payments/index.d.ts +31 -0
  74. package/dist/payments/index.js +3 -0
  75. package/dist/payments/paypal.cjs +351 -0
  76. package/dist/payments/paypal.d.cts +59 -0
  77. package/dist/payments/paypal.d.ts +59 -0
  78. package/dist/payments/paypal.js +337 -0
  79. package/dist/payments/revolut.cjs +261 -0
  80. package/dist/payments/revolut.d.cts +48 -0
  81. package/dist/payments/revolut.d.ts +48 -0
  82. package/dist/payments/revolut.js +249 -0
  83. package/dist/payments/simplepay.cjs +313 -0
  84. package/dist/payments/simplepay.d.cts +86 -0
  85. package/dist/payments/simplepay.d.ts +86 -0
  86. package/dist/payments/simplepay.js +299 -0
  87. package/dist/payments/stripe.cjs +315 -0
  88. package/dist/payments/stripe.d.cts +49 -0
  89. package/dist/payments/stripe.d.ts +49 -0
  90. package/dist/payments/stripe.js +303 -0
  91. package/dist/reports/index.cjs +103 -0
  92. package/dist/reports/index.d.cts +70 -0
  93. package/dist/reports/index.d.ts +70 -0
  94. package/dist/reports/index.js +94 -0
  95. package/dist/request-body-CH6ZGOrq.cjs +34 -0
  96. package/dist/request-body-uZHMRlQr.js +29 -0
  97. package/dist/rounding-BLyHjjI5.js +20 -0
  98. package/dist/rounding-TxoWy2ww.cjs +37 -0
  99. package/dist/serialize-BXOww1Uq.cjs +286 -0
  100. package/dist/serialize-DSE_o9RK.js +215 -0
  101. package/dist/server-C6PoNkdD.cjs +1557 -0
  102. package/dist/server-Cd8HB661.js +1504 -0
  103. package/dist/storage/fs.cjs +1 -1
  104. package/dist/storage/fs.js +1 -1
  105. package/dist/storage/index.cjs +2 -2
  106. package/dist/storage/index.d.cts +1 -1
  107. package/dist/storage/index.d.ts +1 -1
  108. package/dist/storage/index.js +2 -2
  109. package/dist/tax-number-BYFkBp4A.cjs +141 -0
  110. package/dist/tax-number-BdqKsxNR.js +76 -0
  111. package/dist/testing/index.cjs +1656 -84
  112. package/dist/testing/index.d.cts +203 -3
  113. package/dist/testing/index.d.ts +203 -3
  114. package/dist/testing/index.js +1653 -83
  115. package/dist/types-BVeR7KyU.d.cts +56 -0
  116. package/dist/types-BVeR7KyU.d.ts +56 -0
  117. package/dist/types-DH8QoNZK.d.cts +135 -0
  118. package/dist/types-k--zHf4l.d.ts +135 -0
  119. package/dist/validators/index.cjs +14 -88
  120. package/dist/validators/index.js +1 -75
  121. package/dist/vat-g35srbNG.cjs +116 -0
  122. package/dist/vat-v_dcWCto.js +81 -0
  123. package/dist/webhook-81giRMdQ.cjs +223 -0
  124. package/dist/webhook-CpCMHhn2.d.ts +6 -0
  125. package/dist/webhook-CpMJuP6c.d.cts +6 -0
  126. package/dist/webhook-CrEGohbg.js +152 -0
  127. package/llms.txt +4 -4
  128. package/package.json +148 -2
  129. package/dist/client-B9kbKKBf.d.cts +0 -748
  130. package/dist/client-zv4enyq7.d.ts +0 -748
  131. package/dist/create-5YkUcJSe.js +0 -957
  132. package/dist/create-DZsl3Z4m.cjs +0 -1178
@@ -0,0 +1,56 @@
1
+ //#region src/payments/types.d.ts
2
+ type PaymentProvider = "stripe" | "simplepay" | "barion" | "revolut" | "paypal" | (string & {});
3
+ type PaymentEventKind = "paid" | "refunded" | "partially-refunded" | "failed" | "other";
4
+ interface PaymentAmount {
5
+ readonly value: number;
6
+ readonly currency: string;
7
+ }
8
+ interface PaymentAddress {
9
+ readonly country?: string | undefined;
10
+ readonly zip?: string | undefined;
11
+ readonly city?: string | undefined;
12
+ readonly line1?: string | undefined;
13
+ readonly line2?: string | undefined;
14
+ }
15
+ interface PaymentCustomer {
16
+ readonly name?: string | undefined;
17
+ readonly email?: string | undefined;
18
+ readonly phone?: string | undefined;
19
+ readonly taxNumber?: string | undefined;
20
+ readonly euTaxNumber?: string | undefined;
21
+ readonly isBusiness?: boolean | undefined;
22
+ readonly address?: PaymentAddress | undefined;
23
+ }
24
+ interface PaymentLineItem {
25
+ readonly name: string;
26
+ readonly quantity: number;
27
+ readonly totalGross: number;
28
+ readonly unit?: string | undefined;
29
+ readonly sku?: string | undefined;
30
+ readonly vatPercent?: number | undefined;
31
+ }
32
+ interface PaymentEvent {
33
+ readonly provider: PaymentProvider;
34
+ readonly kind: PaymentEventKind;
35
+ readonly id: string;
36
+ readonly eventId?: string | undefined;
37
+ readonly eventType?: string | undefined;
38
+ readonly orderRef?: string | undefined;
39
+ readonly amount?: PaymentAmount | undefined;
40
+ readonly refundedAmount?: PaymentAmount | undefined;
41
+ readonly paidAt?: string | undefined;
42
+ readonly method: string;
43
+ readonly customer?: PaymentCustomer | undefined;
44
+ readonly items?: readonly PaymentLineItem[] | undefined;
45
+ readonly raw: unknown;
46
+ }
47
+ type PaymentHandler = (payment: PaymentEvent) => unknown;
48
+ interface PaymentWebhookBaseOptions {
49
+ readonly onPayment: PaymentHandler;
50
+ readonly onError?: ((error: unknown) => void) | undefined;
51
+ readonly maxBodyBytes?: number | undefined;
52
+ readonly method?: string | undefined;
53
+ readonly fetch?: typeof globalThis.fetch | undefined;
54
+ }
55
+ //#endregion
56
+ export { PaymentEventKind as a, PaymentProvider as c, PaymentEvent as i, PaymentWebhookBaseOptions as l, PaymentAmount as n, PaymentHandler as o, PaymentCustomer as r, PaymentLineItem as s, PaymentAddress as t };
@@ -0,0 +1,56 @@
1
+ //#region src/payments/types.d.ts
2
+ type PaymentProvider = "stripe" | "simplepay" | "barion" | "revolut" | "paypal" | (string & {});
3
+ type PaymentEventKind = "paid" | "refunded" | "partially-refunded" | "failed" | "other";
4
+ interface PaymentAmount {
5
+ readonly value: number;
6
+ readonly currency: string;
7
+ }
8
+ interface PaymentAddress {
9
+ readonly country?: string | undefined;
10
+ readonly zip?: string | undefined;
11
+ readonly city?: string | undefined;
12
+ readonly line1?: string | undefined;
13
+ readonly line2?: string | undefined;
14
+ }
15
+ interface PaymentCustomer {
16
+ readonly name?: string | undefined;
17
+ readonly email?: string | undefined;
18
+ readonly phone?: string | undefined;
19
+ readonly taxNumber?: string | undefined;
20
+ readonly euTaxNumber?: string | undefined;
21
+ readonly isBusiness?: boolean | undefined;
22
+ readonly address?: PaymentAddress | undefined;
23
+ }
24
+ interface PaymentLineItem {
25
+ readonly name: string;
26
+ readonly quantity: number;
27
+ readonly totalGross: number;
28
+ readonly unit?: string | undefined;
29
+ readonly sku?: string | undefined;
30
+ readonly vatPercent?: number | undefined;
31
+ }
32
+ interface PaymentEvent {
33
+ readonly provider: PaymentProvider;
34
+ readonly kind: PaymentEventKind;
35
+ readonly id: string;
36
+ readonly eventId?: string | undefined;
37
+ readonly eventType?: string | undefined;
38
+ readonly orderRef?: string | undefined;
39
+ readonly amount?: PaymentAmount | undefined;
40
+ readonly refundedAmount?: PaymentAmount | undefined;
41
+ readonly paidAt?: string | undefined;
42
+ readonly method: string;
43
+ readonly customer?: PaymentCustomer | undefined;
44
+ readonly items?: readonly PaymentLineItem[] | undefined;
45
+ readonly raw: unknown;
46
+ }
47
+ type PaymentHandler = (payment: PaymentEvent) => unknown;
48
+ interface PaymentWebhookBaseOptions {
49
+ readonly onPayment: PaymentHandler;
50
+ readonly onError?: ((error: unknown) => void) | undefined;
51
+ readonly maxBodyBytes?: number | undefined;
52
+ readonly method?: string | undefined;
53
+ readonly fetch?: typeof globalThis.fetch | undefined;
54
+ }
55
+ //#endregion
56
+ export { PaymentEventKind as a, PaymentProvider as c, PaymentEvent as i, PaymentWebhookBaseOptions as l, PaymentAmount as n, PaymentHandler as o, PaymentCustomer as r, PaymentLineItem as s, PaymentAddress as t };
@@ -0,0 +1,135 @@
1
+ import { _ as VatRate, s as ItemPriceInput } from "./index-CYAGCdKJ.cjs";
2
+ //#region src/receipts/types.d.ts
3
+ declare const RECEIPT_ONLY_VAT_CODES: readonly ["ÁKK", "MAA", "EU", "EUK"];
4
+ type ReceiptOnlyVatCode = (typeof RECEIPT_ONLY_VAT_CODES)[number];
5
+ type ReceiptVatRate = VatRate | ReceiptOnlyVatCode;
6
+ declare const RECEIPT_PDF_TEMPLATES: readonly ["A", "N", "J", "L"];
7
+ type ReceiptPdfTemplate = (typeof RECEIPT_PDF_TEMPLATES)[number];
8
+ interface ReceiptLedgerInput {
9
+ readonly revenue?: string | undefined;
10
+ readonly vat?: string | undefined;
11
+ }
12
+ type ReceiptItemInput = Omit<ItemPriceInput, "vat"> & {
13
+ readonly vat: ReceiptVatRate;
14
+ readonly name: string;
15
+ readonly identifier?: string | undefined;
16
+ readonly unit?: string | undefined;
17
+ readonly comment?: string | undefined;
18
+ readonly ledger?: ReceiptLedgerInput | undefined;
19
+ readonly dataDeletionCode?: number | undefined;
20
+ };
21
+ interface ReceiptPaymentInput {
22
+ readonly method: string;
23
+ readonly amount: number;
24
+ readonly description?: string | undefined;
25
+ }
26
+ interface ReceiptDefaults {
27
+ readonly prefix?: string | undefined;
28
+ readonly paymentMethod?: string | undefined;
29
+ readonly currency?: string | undefined;
30
+ readonly exchangeRate?: number | undefined;
31
+ readonly exchangeBank?: string | undefined;
32
+ readonly downloadPdf?: boolean | undefined;
33
+ readonly template?: ReceiptPdfTemplate | undefined;
34
+ readonly unit?: string | undefined;
35
+ readonly customerLedgerId?: string | undefined;
36
+ }
37
+ interface CreateReceiptInput {
38
+ readonly prefix?: string | undefined;
39
+ readonly paymentMethod?: string | undefined;
40
+ readonly currency?: string | undefined;
41
+ readonly exchangeRate?: number | undefined;
42
+ readonly exchangeBank?: string | undefined;
43
+ readonly callId?: string | undefined;
44
+ readonly comment?: string | undefined;
45
+ readonly template?: ReceiptPdfTemplate | undefined;
46
+ readonly customerLedgerId?: string | undefined;
47
+ readonly orderNumber?: string | undefined;
48
+ readonly downloadPdf?: boolean | undefined;
49
+ readonly items: readonly ReceiptItemInput[];
50
+ readonly payments?: readonly ReceiptPaymentInput[] | undefined;
51
+ }
52
+ interface ReverseReceiptInput {
53
+ readonly receiptNumber: string;
54
+ readonly callId?: string | undefined;
55
+ readonly template?: ReceiptPdfTemplate | undefined;
56
+ readonly downloadPdf?: boolean | undefined;
57
+ }
58
+ interface GetReceiptOptions {
59
+ readonly callId?: string | undefined;
60
+ readonly template?: ReceiptPdfTemplate | undefined;
61
+ readonly downloadPdf?: boolean | undefined;
62
+ }
63
+ type GetReceiptInput = GetReceiptOptions & ({
64
+ readonly receiptNumber: string;
65
+ readonly orderNumber?: undefined;
66
+ } | {
67
+ readonly orderNumber: string;
68
+ readonly receiptNumber?: undefined;
69
+ });
70
+ interface SendReceiptInput {
71
+ readonly receiptNumber: string;
72
+ readonly emails: string | readonly string[];
73
+ readonly replyTo?: string | undefined;
74
+ readonly subject?: string | undefined;
75
+ readonly text?: string | undefined;
76
+ }
77
+ type ReceiptType = "receipt" | "reversal";
78
+ interface ReceiptLedger {
79
+ readonly revenue?: string | undefined;
80
+ readonly vat?: string | undefined;
81
+ }
82
+ interface ReceiptItem {
83
+ readonly name: string;
84
+ readonly identifier?: string | undefined;
85
+ readonly quantity: number;
86
+ readonly unit: string;
87
+ readonly netUnitPrice: number;
88
+ readonly vat: ReceiptVatRate;
89
+ readonly vatPercentage: number;
90
+ readonly netAmount: number;
91
+ readonly vatAmount: number;
92
+ readonly grossAmount: number;
93
+ readonly ledger?: ReceiptLedger | undefined;
94
+ }
95
+ interface ReceiptPayment {
96
+ readonly method: string;
97
+ readonly amount: number;
98
+ readonly description?: string | undefined;
99
+ }
100
+ interface ReceiptVatTotal {
101
+ readonly vat: ReceiptVatRate;
102
+ readonly vatPercentage: number;
103
+ readonly netAmount: number;
104
+ readonly vatAmount: number;
105
+ readonly grossAmount: number;
106
+ }
107
+ interface ReceiptTotals {
108
+ readonly netAmount: number;
109
+ readonly vatAmount: number;
110
+ readonly grossAmount: number;
111
+ readonly byVat: readonly ReceiptVatTotal[];
112
+ }
113
+ interface Receipt {
114
+ readonly id: number;
115
+ readonly number: string;
116
+ readonly callId?: string | undefined;
117
+ readonly type: ReceiptType;
118
+ readonly isReversed: boolean;
119
+ readonly reversedReceiptNumber?: string | undefined;
120
+ readonly issueDate: string;
121
+ readonly paymentMethod: string;
122
+ readonly currency: string;
123
+ readonly exchangeBank?: string | undefined;
124
+ readonly exchangeRate?: number | undefined;
125
+ readonly comment?: string | undefined;
126
+ readonly customerLedgerId?: string | undefined;
127
+ readonly isTest: boolean;
128
+ readonly orderNumber?: string | undefined;
129
+ readonly items: readonly ReceiptItem[];
130
+ readonly payments: readonly ReceiptPayment[];
131
+ readonly totals: ReceiptTotals;
132
+ readonly pdf?: Uint8Array | undefined;
133
+ }
134
+ //#endregion
135
+ export { ReceiptItem as a, ReceiptPayment as c, ReceiptTotals as d, ReceiptType as f, SendReceiptInput as h, ReceiptDefaults as i, ReceiptPaymentInput as l, ReverseReceiptInput as m, GetReceiptInput as n, ReceiptItemInput as o, ReceiptVatRate as p, Receipt as r, ReceiptOnlyVatCode as s, CreateReceiptInput as t, ReceiptPdfTemplate as u };
@@ -0,0 +1,135 @@
1
+ import { _ as VatRate, s as ItemPriceInput } from "./index-CYAGCdKJ.js";
2
+ //#region src/receipts/types.d.ts
3
+ declare const RECEIPT_ONLY_VAT_CODES: readonly ["ÁKK", "MAA", "EU", "EUK"];
4
+ type ReceiptOnlyVatCode = (typeof RECEIPT_ONLY_VAT_CODES)[number];
5
+ type ReceiptVatRate = VatRate | ReceiptOnlyVatCode;
6
+ declare const RECEIPT_PDF_TEMPLATES: readonly ["A", "N", "J", "L"];
7
+ type ReceiptPdfTemplate = (typeof RECEIPT_PDF_TEMPLATES)[number];
8
+ interface ReceiptLedgerInput {
9
+ readonly revenue?: string | undefined;
10
+ readonly vat?: string | undefined;
11
+ }
12
+ type ReceiptItemInput = Omit<ItemPriceInput, "vat"> & {
13
+ readonly vat: ReceiptVatRate;
14
+ readonly name: string;
15
+ readonly identifier?: string | undefined;
16
+ readonly unit?: string | undefined;
17
+ readonly comment?: string | undefined;
18
+ readonly ledger?: ReceiptLedgerInput | undefined;
19
+ readonly dataDeletionCode?: number | undefined;
20
+ };
21
+ interface ReceiptPaymentInput {
22
+ readonly method: string;
23
+ readonly amount: number;
24
+ readonly description?: string | undefined;
25
+ }
26
+ interface ReceiptDefaults {
27
+ readonly prefix?: string | undefined;
28
+ readonly paymentMethod?: string | undefined;
29
+ readonly currency?: string | undefined;
30
+ readonly exchangeRate?: number | undefined;
31
+ readonly exchangeBank?: string | undefined;
32
+ readonly downloadPdf?: boolean | undefined;
33
+ readonly template?: ReceiptPdfTemplate | undefined;
34
+ readonly unit?: string | undefined;
35
+ readonly customerLedgerId?: string | undefined;
36
+ }
37
+ interface CreateReceiptInput {
38
+ readonly prefix?: string | undefined;
39
+ readonly paymentMethod?: string | undefined;
40
+ readonly currency?: string | undefined;
41
+ readonly exchangeRate?: number | undefined;
42
+ readonly exchangeBank?: string | undefined;
43
+ readonly callId?: string | undefined;
44
+ readonly comment?: string | undefined;
45
+ readonly template?: ReceiptPdfTemplate | undefined;
46
+ readonly customerLedgerId?: string | undefined;
47
+ readonly orderNumber?: string | undefined;
48
+ readonly downloadPdf?: boolean | undefined;
49
+ readonly items: readonly ReceiptItemInput[];
50
+ readonly payments?: readonly ReceiptPaymentInput[] | undefined;
51
+ }
52
+ interface ReverseReceiptInput {
53
+ readonly receiptNumber: string;
54
+ readonly callId?: string | undefined;
55
+ readonly template?: ReceiptPdfTemplate | undefined;
56
+ readonly downloadPdf?: boolean | undefined;
57
+ }
58
+ interface GetReceiptOptions {
59
+ readonly callId?: string | undefined;
60
+ readonly template?: ReceiptPdfTemplate | undefined;
61
+ readonly downloadPdf?: boolean | undefined;
62
+ }
63
+ type GetReceiptInput = GetReceiptOptions & ({
64
+ readonly receiptNumber: string;
65
+ readonly orderNumber?: undefined;
66
+ } | {
67
+ readonly orderNumber: string;
68
+ readonly receiptNumber?: undefined;
69
+ });
70
+ interface SendReceiptInput {
71
+ readonly receiptNumber: string;
72
+ readonly emails: string | readonly string[];
73
+ readonly replyTo?: string | undefined;
74
+ readonly subject?: string | undefined;
75
+ readonly text?: string | undefined;
76
+ }
77
+ type ReceiptType = "receipt" | "reversal";
78
+ interface ReceiptLedger {
79
+ readonly revenue?: string | undefined;
80
+ readonly vat?: string | undefined;
81
+ }
82
+ interface ReceiptItem {
83
+ readonly name: string;
84
+ readonly identifier?: string | undefined;
85
+ readonly quantity: number;
86
+ readonly unit: string;
87
+ readonly netUnitPrice: number;
88
+ readonly vat: ReceiptVatRate;
89
+ readonly vatPercentage: number;
90
+ readonly netAmount: number;
91
+ readonly vatAmount: number;
92
+ readonly grossAmount: number;
93
+ readonly ledger?: ReceiptLedger | undefined;
94
+ }
95
+ interface ReceiptPayment {
96
+ readonly method: string;
97
+ readonly amount: number;
98
+ readonly description?: string | undefined;
99
+ }
100
+ interface ReceiptVatTotal {
101
+ readonly vat: ReceiptVatRate;
102
+ readonly vatPercentage: number;
103
+ readonly netAmount: number;
104
+ readonly vatAmount: number;
105
+ readonly grossAmount: number;
106
+ }
107
+ interface ReceiptTotals {
108
+ readonly netAmount: number;
109
+ readonly vatAmount: number;
110
+ readonly grossAmount: number;
111
+ readonly byVat: readonly ReceiptVatTotal[];
112
+ }
113
+ interface Receipt {
114
+ readonly id: number;
115
+ readonly number: string;
116
+ readonly callId?: string | undefined;
117
+ readonly type: ReceiptType;
118
+ readonly isReversed: boolean;
119
+ readonly reversedReceiptNumber?: string | undefined;
120
+ readonly issueDate: string;
121
+ readonly paymentMethod: string;
122
+ readonly currency: string;
123
+ readonly exchangeBank?: string | undefined;
124
+ readonly exchangeRate?: number | undefined;
125
+ readonly comment?: string | undefined;
126
+ readonly customerLedgerId?: string | undefined;
127
+ readonly isTest: boolean;
128
+ readonly orderNumber?: string | undefined;
129
+ readonly items: readonly ReceiptItem[];
130
+ readonly payments: readonly ReceiptPayment[];
131
+ readonly totals: ReceiptTotals;
132
+ readonly pdf?: Uint8Array | undefined;
133
+ }
134
+ //#endregion
135
+ export { ReceiptItem as a, ReceiptPayment as c, ReceiptTotals as d, ReceiptType as f, SendReceiptInput as h, ReceiptDefaults as i, ReceiptPaymentInput as l, ReverseReceiptInput as m, GetReceiptInput as n, ReceiptItemInput as o, ReceiptVatRate as p, Receipt as r, ReceiptOnlyVatCode as s, CreateReceiptInput as t, ReceiptPdfTemplate as u };
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_tax_number = require("../tax-number-BYFkBp4A.cjs");
2
3
  //#region src/validators/address.ts
3
4
  const MIN_ZIP = 1e3;
4
5
  const MAX_ZIP = 9999;
@@ -106,19 +107,6 @@ function isValidAgentKey(value) {
106
107
  return key !== "" && !/\s/.test(key) && key === key.toLowerCase();
107
108
  }
108
109
  //#endregion
109
- //#region src/validators/digits.ts
110
- const SEPARATORS = /[\s-]+/g;
111
- function stripSeparators(value) {
112
- return value.replace(SEPARATORS, "");
113
- }
114
- function isDigits(value, length) {
115
- if (!/^\d+$/.test(value)) return false;
116
- return length === void 0 || value.length === length;
117
- }
118
- function weightedDigitSum(digits, weights) {
119
- return [...digits].reduce((sum, digit, index) => sum + Number(digit) * Number(weights[index % weights.length]), 0);
120
- }
121
- //#endregion
122
110
  //#region src/validators/bank-account.ts
123
111
  const GIRO_WEIGHTS = [
124
112
  9,
@@ -128,15 +116,15 @@ const GIRO_WEIGHTS = [
128
116
  ];
129
117
  const HU_IBAN_LENGTH = 28;
130
118
  function hasValidCheckDigit(block) {
131
- return weightedDigitSum(block, GIRO_WEIGHTS) % 10 === 0;
119
+ return require_tax_number.weightedDigitSum(block, GIRO_WEIGHTS) % 10 === 0;
132
120
  }
133
121
  function groupsOfEight(digits) {
134
122
  return digits.match(/\d{8}/g)?.join("-") ?? digits;
135
123
  }
136
124
  function parseHungarianBankAccount(value) {
137
125
  if (typeof value !== "string") return void 0;
138
- const digits = stripSeparators(value);
139
- if (!isDigits(digits, 16) && !isDigits(digits, 24)) return void 0;
126
+ const digits = require_tax_number.stripSeparators(value);
127
+ if (!require_tax_number.isDigits(digits, 16) && !require_tax_number.isDigits(digits, 24)) return void 0;
140
128
  if (!hasValidCheckDigit(digits.slice(0, 8)) || !hasValidCheckDigit(digits.slice(8))) return;
141
129
  return {
142
130
  digits,
@@ -163,24 +151,12 @@ function ibanMod97(iban) {
163
151
  }
164
152
  function isValidHungarianIban(value) {
165
153
  if (typeof value !== "string") return false;
166
- const iban = stripSeparators(value).toUpperCase();
154
+ const iban = require_tax_number.stripSeparators(value).toUpperCase();
167
155
  if (iban.length !== HU_IBAN_LENGTH || !iban.startsWith("HU")) return false;
168
- if (!isDigits(iban.slice(2), 26)) return false;
156
+ if (!require_tax_number.isDigits(iban.slice(2), 26)) return false;
169
157
  return ibanMod97(iban) === 1;
170
158
  }
171
159
  //#endregion
172
- //#region src/validators/email.ts
173
- const MAX_EMAIL_LENGTH = 254;
174
- const EMAIL_PATTERN = /^[^\s@]+@[^\s@.]+(?:\.[^\s@.]+)+$/;
175
- function normalizeEmail(value) {
176
- return value.trim().toLowerCase();
177
- }
178
- function isValidEmail(value) {
179
- if (typeof value !== "string") return false;
180
- const email = value.trim();
181
- return email.length <= MAX_EMAIL_LENGTH && EMAIL_PATTERN.test(email);
182
- }
183
- //#endregion
184
160
  //#region src/validators/eu-vat.ts
185
161
  const EU_VAT_NUMBER_PATTERNS = {
186
162
  AT: /^U\d{8}$/,
@@ -226,71 +202,21 @@ function isValidEuVatNumber(value) {
226
202
  return EU_VAT_NUMBER_PATTERNS[prefix].test(normalized.slice(2));
227
203
  }
228
204
  //#endregion
229
- //#region src/validators/tax-number.ts
230
- const TAXPAYER_ID_WEIGHTS = [
231
- 9,
232
- 7,
233
- 3,
234
- 1,
235
- 9,
236
- 7,
237
- 3
238
- ];
239
- const HUNGARIAN_TAX_COUNTY_CODES = [
240
- ...Array.from({ length: 19 }, (_, index) => String(index + 2).padStart(2, "0")),
241
- ...Array.from({ length: 23 }, (_, index) => String(index + 22)),
242
- "51"
243
- ];
244
- const COUNTY_CODE_SET = new Set(HUNGARIAN_TAX_COUNTY_CODES);
245
- function isVatCode(value) {
246
- return value >= "1" && value <= "5" && value.length === 1;
247
- }
248
- function isValidHungarianTaxpayerId(value) {
249
- const digits = stripSeparators(value);
250
- if (!isDigits(digits, 8)) return false;
251
- return (10 - weightedDigitSum(digits.slice(0, 7), TAXPAYER_ID_WEIGHTS) % 10) % 10 === Number(digits[7]);
252
- }
253
- function parseHungarianTaxNumber(value) {
254
- if (typeof value !== "string") return void 0;
255
- const digits = stripSeparators(value);
256
- if (!isDigits(digits, 11)) return void 0;
257
- const taxpayerId = digits.slice(0, 8);
258
- const vatCode = digits.slice(8, 9);
259
- const countyCode = digits.slice(9, 11);
260
- if (!isValidHungarianTaxpayerId(taxpayerId)) return void 0;
261
- if (!isVatCode(vatCode) || !COUNTY_CODE_SET.has(countyCode)) return void 0;
262
- return {
263
- taxpayerId,
264
- vatCode,
265
- countyCode,
266
- formatted: `${taxpayerId}-${vatCode}-${countyCode}`
267
- };
268
- }
269
- function isValidHungarianTaxNumber(value) {
270
- return parseHungarianTaxNumber(value) !== void 0;
271
- }
272
- function isValidHungarianGroupTaxNumber(value) {
273
- return parseHungarianTaxNumber(value)?.vatCode === "5";
274
- }
275
- function isHungarianVatGroupMemberTaxNumber(value) {
276
- return parseHungarianTaxNumber(value)?.vatCode === "4";
277
- }
278
- //#endregion
279
205
  exports.EU_VAT_NUMBER_PATTERNS = EU_VAT_NUMBER_PATTERNS;
280
- exports.HUNGARIAN_TAX_COUNTY_CODES = HUNGARIAN_TAX_COUNTY_CODES;
206
+ exports.HUNGARIAN_TAX_COUNTY_CODES = require_tax_number.HUNGARIAN_TAX_COUNTY_CODES;
281
207
  exports.formatHungarianBankAccount = formatHungarianBankAccount;
282
- exports.isHungarianVatGroupMemberTaxNumber = isHungarianVatGroupMemberTaxNumber;
208
+ exports.isHungarianVatGroupMemberTaxNumber = require_tax_number.isHungarianVatGroupMemberTaxNumber;
283
209
  exports.isValidAgentKey = isValidAgentKey;
284
- exports.isValidEmail = isValidEmail;
210
+ exports.isValidEmail = require_tax_number.isValidEmail;
285
211
  exports.isValidEuVatNumber = isValidEuVatNumber;
286
212
  exports.isValidHungarianBankAccount = isValidHungarianBankAccount;
287
- exports.isValidHungarianGroupTaxNumber = isValidHungarianGroupTaxNumber;
213
+ exports.isValidHungarianGroupTaxNumber = require_tax_number.isValidHungarianGroupTaxNumber;
288
214
  exports.isValidHungarianIban = isValidHungarianIban;
289
- exports.isValidHungarianTaxNumber = isValidHungarianTaxNumber;
290
- exports.isValidHungarianTaxpayerId = isValidHungarianTaxpayerId;
215
+ exports.isValidHungarianTaxNumber = require_tax_number.isValidHungarianTaxNumber;
216
+ exports.isValidHungarianTaxpayerId = require_tax_number.isValidHungarianTaxpayerId;
291
217
  exports.isValidHungarianZipCode = isValidHungarianZipCode;
292
- exports.normalizeEmail = normalizeEmail;
218
+ exports.normalizeEmail = require_tax_number.normalizeEmail;
293
219
  exports.normalizeEuVatNumber = normalizeEuVatNumber;
294
220
  exports.parseHungarianAddress = parseHungarianAddress;
295
221
  exports.parseHungarianBankAccount = parseHungarianBankAccount;
296
- exports.parseHungarianTaxNumber = parseHungarianTaxNumber;
222
+ exports.parseHungarianTaxNumber = require_tax_number.parseHungarianTaxNumber;
@@ -1,3 +1,4 @@
1
+ import { a as isValidHungarianTaxpayerId, c as normalizeEmail, d as weightedDigitSum, i as isValidHungarianTaxNumber, l as isDigits, n as isHungarianVatGroupMemberTaxNumber, o as parseHungarianTaxNumber, r as isValidHungarianGroupTaxNumber, s as isValidEmail, t as HUNGARIAN_TAX_COUNTY_CODES, u as stripSeparators } from "../tax-number-BdqKsxNR.js";
1
2
  //#region src/validators/address.ts
2
3
  const MIN_ZIP = 1e3;
3
4
  const MAX_ZIP = 9999;
@@ -105,19 +106,6 @@ function isValidAgentKey(value) {
105
106
  return key !== "" && !/\s/.test(key) && key === key.toLowerCase();
106
107
  }
107
108
  //#endregion
108
- //#region src/validators/digits.ts
109
- const SEPARATORS = /[\s-]+/g;
110
- function stripSeparators(value) {
111
- return value.replace(SEPARATORS, "");
112
- }
113
- function isDigits(value, length) {
114
- if (!/^\d+$/.test(value)) return false;
115
- return length === void 0 || value.length === length;
116
- }
117
- function weightedDigitSum(digits, weights) {
118
- return [...digits].reduce((sum, digit, index) => sum + Number(digit) * Number(weights[index % weights.length]), 0);
119
- }
120
- //#endregion
121
109
  //#region src/validators/bank-account.ts
122
110
  const GIRO_WEIGHTS = [
123
111
  9,
@@ -168,18 +156,6 @@ function isValidHungarianIban(value) {
168
156
  return ibanMod97(iban) === 1;
169
157
  }
170
158
  //#endregion
171
- //#region src/validators/email.ts
172
- const MAX_EMAIL_LENGTH = 254;
173
- const EMAIL_PATTERN = /^[^\s@]+@[^\s@.]+(?:\.[^\s@.]+)+$/;
174
- function normalizeEmail(value) {
175
- return value.trim().toLowerCase();
176
- }
177
- function isValidEmail(value) {
178
- if (typeof value !== "string") return false;
179
- const email = value.trim();
180
- return email.length <= MAX_EMAIL_LENGTH && EMAIL_PATTERN.test(email);
181
- }
182
- //#endregion
183
159
  //#region src/validators/eu-vat.ts
184
160
  const EU_VAT_NUMBER_PATTERNS = {
185
161
  AT: /^U\d{8}$/,
@@ -225,54 +201,4 @@ function isValidEuVatNumber(value) {
225
201
  return EU_VAT_NUMBER_PATTERNS[prefix].test(normalized.slice(2));
226
202
  }
227
203
  //#endregion
228
- //#region src/validators/tax-number.ts
229
- const TAXPAYER_ID_WEIGHTS = [
230
- 9,
231
- 7,
232
- 3,
233
- 1,
234
- 9,
235
- 7,
236
- 3
237
- ];
238
- const HUNGARIAN_TAX_COUNTY_CODES = [
239
- ...Array.from({ length: 19 }, (_, index) => String(index + 2).padStart(2, "0")),
240
- ...Array.from({ length: 23 }, (_, index) => String(index + 22)),
241
- "51"
242
- ];
243
- const COUNTY_CODE_SET = new Set(HUNGARIAN_TAX_COUNTY_CODES);
244
- function isVatCode(value) {
245
- return value >= "1" && value <= "5" && value.length === 1;
246
- }
247
- function isValidHungarianTaxpayerId(value) {
248
- const digits = stripSeparators(value);
249
- if (!isDigits(digits, 8)) return false;
250
- return (10 - weightedDigitSum(digits.slice(0, 7), TAXPAYER_ID_WEIGHTS) % 10) % 10 === Number(digits[7]);
251
- }
252
- function parseHungarianTaxNumber(value) {
253
- if (typeof value !== "string") return void 0;
254
- const digits = stripSeparators(value);
255
- if (!isDigits(digits, 11)) return void 0;
256
- const taxpayerId = digits.slice(0, 8);
257
- const vatCode = digits.slice(8, 9);
258
- const countyCode = digits.slice(9, 11);
259
- if (!isValidHungarianTaxpayerId(taxpayerId)) return void 0;
260
- if (!isVatCode(vatCode) || !COUNTY_CODE_SET.has(countyCode)) return void 0;
261
- return {
262
- taxpayerId,
263
- vatCode,
264
- countyCode,
265
- formatted: `${taxpayerId}-${vatCode}-${countyCode}`
266
- };
267
- }
268
- function isValidHungarianTaxNumber(value) {
269
- return parseHungarianTaxNumber(value) !== void 0;
270
- }
271
- function isValidHungarianGroupTaxNumber(value) {
272
- return parseHungarianTaxNumber(value)?.vatCode === "5";
273
- }
274
- function isHungarianVatGroupMemberTaxNumber(value) {
275
- return parseHungarianTaxNumber(value)?.vatCode === "4";
276
- }
277
- //#endregion
278
204
  export { EU_VAT_NUMBER_PATTERNS, HUNGARIAN_TAX_COUNTY_CODES, formatHungarianBankAccount, isHungarianVatGroupMemberTaxNumber, isValidAgentKey, isValidEmail, isValidEuVatNumber, isValidHungarianBankAccount, isValidHungarianGroupTaxNumber, isValidHungarianIban, isValidHungarianTaxNumber, isValidHungarianTaxpayerId, isValidHungarianZipCode, normalizeEmail, normalizeEuVatNumber, parseHungarianAddress, parseHungarianBankAccount, parseHungarianTaxNumber };