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
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_errors = require("../errors-B0QJhUW1.cjs");
2
+ const require_errors = require("../errors-DxeuTslP.cjs");
3
3
  const require_shared = require("../shared-CrxlxI8n.cjs");
4
4
  let node_fs_promises = require("node:fs/promises");
5
5
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { n as SzamlazzError } from "../errors-DapdV5DK.js";
1
+ import { n as SzamlazzError } from "../errors-DLrb0g64.js";
2
2
  import { _ as guardStorageCall, d as normalizePrefix, f as resolveKey, h as StorageError, l as joinPublicUrl, m as unsupportedSignedUrl, u as missingPublicBaseUrl } from "../shared-D6DLa4b7.js";
3
3
  import { mkdir, readFile, realpath, rename, rm, writeFile } from "node:fs/promises";
4
4
  import { dirname, isAbsolute, relative, resolve } from "node:path";
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_errors = require("../errors-B0QJhUW1.cjs");
2
+ const require_errors = require("../errors-DxeuTslP.cjs");
3
3
  const require_binary = require("../binary-B89HM03_.cjs");
4
- const require_dates = require("../dates-PPxH0n5H.cjs");
4
+ const require_dates = require("../dates-CPgBodkP.cjs");
5
5
  const require_shared = require("../shared-CrxlxI8n.cjs");
6
6
  //#region src/storage/keys.ts
7
7
  const DEFAULT_INVOICE_KEY_PREFIX = "szamlak";
@@ -1,4 +1,4 @@
1
- import { t as DateInput } from "../dates-DtHzwNU6.cjs";
1
+ import { t as DateInput } from "../dates-9zvESP0i.cjs";
2
2
  import { a as StoredFile, i as StorageUrlOptions, n as StorageAdapter, r as StoragePutOptions, t as CompleteStorageAdapter } from "../types-DVRgwcqg.cjs";
3
3
  //#region src/storage/errors.d.ts
4
4
  type StorageOperation = "put" | "get" | "delete" | "getUrl" | "key";
@@ -1,4 +1,4 @@
1
- import { t as DateInput } from "../dates-DtHzwNU6.js";
1
+ import { t as DateInput } from "../dates-9zvESP0i.js";
2
2
  import { a as StoredFile, i as StorageUrlOptions, n as StorageAdapter, r as StoragePutOptions, t as CompleteStorageAdapter } from "../types-DVRgwcqg.js";
3
3
  //#region src/storage/errors.d.ts
4
4
  type StorageOperation = "put" | "get" | "delete" | "getUrl" | "key";
@@ -1,6 +1,6 @@
1
- import { n as SzamlazzError } from "../errors-DapdV5DK.js";
1
+ import { n as SzamlazzError } from "../errors-DLrb0g64.js";
2
2
  import { a as isPdf } from "../binary-D0M9U2MD.js";
3
- import { i as todayInBudapest, n as toAgentDate } from "../dates-D2XebOIg.js";
3
+ import { a as todayInBudapest, n as toAgentDate } from "../dates-CXyj7Azy.js";
4
4
  import { _ as guardStorageCall, a as assertStorageKey, c as encodeRfc3986, d as normalizePrefix, f as resolveKey, g as describeError, h as StorageError, i as assertExpires, l as joinPublicUrl, m as unsupportedSignedUrl, n as PDF_CONTENT_TYPE, o as basename, p as toArrayBuffer, r as S3_MAX_PRESIGN_SECONDS, s as encodeKeyPath, u as missingPublicBaseUrl, v as isStorageError } from "../shared-D6DLa4b7.js";
5
5
  //#region src/storage/keys.ts
6
6
  const DEFAULT_INVOICE_KEY_PREFIX = "szamlak";
@@ -0,0 +1,141 @@
1
+ //#region src/validators/digits.ts
2
+ const SEPARATORS = /[\s-]+/g;
3
+ function stripSeparators(value) {
4
+ return value.replace(SEPARATORS, "");
5
+ }
6
+ function isDigits(value, length) {
7
+ if (!/^\d+$/.test(value)) return false;
8
+ return length === void 0 || value.length === length;
9
+ }
10
+ function weightedDigitSum(digits, weights) {
11
+ return [...digits].reduce((sum, digit, index) => sum + Number(digit) * Number(weights[index % weights.length]), 0);
12
+ }
13
+ //#endregion
14
+ //#region src/validators/email.ts
15
+ const MAX_EMAIL_LENGTH = 254;
16
+ const EMAIL_PATTERN = /^[^\s@]+@[^\s@.]+(?:\.[^\s@.]+)+$/;
17
+ function normalizeEmail(value) {
18
+ return value.trim().toLowerCase();
19
+ }
20
+ function isValidEmail(value) {
21
+ if (typeof value !== "string") return false;
22
+ const email = value.trim();
23
+ return email.length <= MAX_EMAIL_LENGTH && EMAIL_PATTERN.test(email);
24
+ }
25
+ //#endregion
26
+ //#region src/validators/tax-number.ts
27
+ const TAXPAYER_ID_WEIGHTS = [
28
+ 9,
29
+ 7,
30
+ 3,
31
+ 1,
32
+ 9,
33
+ 7,
34
+ 3
35
+ ];
36
+ const HUNGARIAN_TAX_COUNTY_CODES = [
37
+ ...Array.from({ length: 19 }, (_, index) => String(index + 2).padStart(2, "0")),
38
+ ...Array.from({ length: 23 }, (_, index) => String(index + 22)),
39
+ "51"
40
+ ];
41
+ const COUNTY_CODE_SET = new Set(HUNGARIAN_TAX_COUNTY_CODES);
42
+ function isVatCode(value) {
43
+ return value >= "1" && value <= "5" && value.length === 1;
44
+ }
45
+ function isValidHungarianTaxpayerId(value) {
46
+ const digits = stripSeparators(value);
47
+ if (!isDigits(digits, 8)) return false;
48
+ return (10 - weightedDigitSum(digits.slice(0, 7), TAXPAYER_ID_WEIGHTS) % 10) % 10 === Number(digits[7]);
49
+ }
50
+ function parseHungarianTaxNumber(value) {
51
+ if (typeof value !== "string") return void 0;
52
+ const digits = stripSeparators(value);
53
+ if (!isDigits(digits, 11)) return void 0;
54
+ const taxpayerId = digits.slice(0, 8);
55
+ const vatCode = digits.slice(8, 9);
56
+ const countyCode = digits.slice(9, 11);
57
+ if (!isValidHungarianTaxpayerId(taxpayerId)) return void 0;
58
+ if (!isVatCode(vatCode) || !COUNTY_CODE_SET.has(countyCode)) return void 0;
59
+ return {
60
+ taxpayerId,
61
+ vatCode,
62
+ countyCode,
63
+ formatted: `${taxpayerId}-${vatCode}-${countyCode}`
64
+ };
65
+ }
66
+ function isValidHungarianTaxNumber(value) {
67
+ return parseHungarianTaxNumber(value) !== void 0;
68
+ }
69
+ function isValidHungarianGroupTaxNumber(value) {
70
+ return parseHungarianTaxNumber(value)?.vatCode === "5";
71
+ }
72
+ function isHungarianVatGroupMemberTaxNumber(value) {
73
+ return parseHungarianTaxNumber(value)?.vatCode === "4";
74
+ }
75
+ //#endregion
76
+ Object.defineProperty(exports, "HUNGARIAN_TAX_COUNTY_CODES", {
77
+ enumerable: true,
78
+ get: function() {
79
+ return HUNGARIAN_TAX_COUNTY_CODES;
80
+ }
81
+ });
82
+ Object.defineProperty(exports, "isDigits", {
83
+ enumerable: true,
84
+ get: function() {
85
+ return isDigits;
86
+ }
87
+ });
88
+ Object.defineProperty(exports, "isHungarianVatGroupMemberTaxNumber", {
89
+ enumerable: true,
90
+ get: function() {
91
+ return isHungarianVatGroupMemberTaxNumber;
92
+ }
93
+ });
94
+ Object.defineProperty(exports, "isValidEmail", {
95
+ enumerable: true,
96
+ get: function() {
97
+ return isValidEmail;
98
+ }
99
+ });
100
+ Object.defineProperty(exports, "isValidHungarianGroupTaxNumber", {
101
+ enumerable: true,
102
+ get: function() {
103
+ return isValidHungarianGroupTaxNumber;
104
+ }
105
+ });
106
+ Object.defineProperty(exports, "isValidHungarianTaxNumber", {
107
+ enumerable: true,
108
+ get: function() {
109
+ return isValidHungarianTaxNumber;
110
+ }
111
+ });
112
+ Object.defineProperty(exports, "isValidHungarianTaxpayerId", {
113
+ enumerable: true,
114
+ get: function() {
115
+ return isValidHungarianTaxpayerId;
116
+ }
117
+ });
118
+ Object.defineProperty(exports, "normalizeEmail", {
119
+ enumerable: true,
120
+ get: function() {
121
+ return normalizeEmail;
122
+ }
123
+ });
124
+ Object.defineProperty(exports, "parseHungarianTaxNumber", {
125
+ enumerable: true,
126
+ get: function() {
127
+ return parseHungarianTaxNumber;
128
+ }
129
+ });
130
+ Object.defineProperty(exports, "stripSeparators", {
131
+ enumerable: true,
132
+ get: function() {
133
+ return stripSeparators;
134
+ }
135
+ });
136
+ Object.defineProperty(exports, "weightedDigitSum", {
137
+ enumerable: true,
138
+ get: function() {
139
+ return weightedDigitSum;
140
+ }
141
+ });
@@ -0,0 +1,76 @@
1
+ //#region src/validators/digits.ts
2
+ const SEPARATORS = /[\s-]+/g;
3
+ function stripSeparators(value) {
4
+ return value.replace(SEPARATORS, "");
5
+ }
6
+ function isDigits(value, length) {
7
+ if (!/^\d+$/.test(value)) return false;
8
+ return length === void 0 || value.length === length;
9
+ }
10
+ function weightedDigitSum(digits, weights) {
11
+ return [...digits].reduce((sum, digit, index) => sum + Number(digit) * Number(weights[index % weights.length]), 0);
12
+ }
13
+ //#endregion
14
+ //#region src/validators/email.ts
15
+ const MAX_EMAIL_LENGTH = 254;
16
+ const EMAIL_PATTERN = /^[^\s@]+@[^\s@.]+(?:\.[^\s@.]+)+$/;
17
+ function normalizeEmail(value) {
18
+ return value.trim().toLowerCase();
19
+ }
20
+ function isValidEmail(value) {
21
+ if (typeof value !== "string") return false;
22
+ const email = value.trim();
23
+ return email.length <= MAX_EMAIL_LENGTH && EMAIL_PATTERN.test(email);
24
+ }
25
+ //#endregion
26
+ //#region src/validators/tax-number.ts
27
+ const TAXPAYER_ID_WEIGHTS = [
28
+ 9,
29
+ 7,
30
+ 3,
31
+ 1,
32
+ 9,
33
+ 7,
34
+ 3
35
+ ];
36
+ const HUNGARIAN_TAX_COUNTY_CODES = [
37
+ ...Array.from({ length: 19 }, (_, index) => String(index + 2).padStart(2, "0")),
38
+ ...Array.from({ length: 23 }, (_, index) => String(index + 22)),
39
+ "51"
40
+ ];
41
+ const COUNTY_CODE_SET = new Set(HUNGARIAN_TAX_COUNTY_CODES);
42
+ function isVatCode(value) {
43
+ return value >= "1" && value <= "5" && value.length === 1;
44
+ }
45
+ function isValidHungarianTaxpayerId(value) {
46
+ const digits = stripSeparators(value);
47
+ if (!isDigits(digits, 8)) return false;
48
+ return (10 - weightedDigitSum(digits.slice(0, 7), TAXPAYER_ID_WEIGHTS) % 10) % 10 === Number(digits[7]);
49
+ }
50
+ function parseHungarianTaxNumber(value) {
51
+ if (typeof value !== "string") return void 0;
52
+ const digits = stripSeparators(value);
53
+ if (!isDigits(digits, 11)) return void 0;
54
+ const taxpayerId = digits.slice(0, 8);
55
+ const vatCode = digits.slice(8, 9);
56
+ const countyCode = digits.slice(9, 11);
57
+ if (!isValidHungarianTaxpayerId(taxpayerId)) return void 0;
58
+ if (!isVatCode(vatCode) || !COUNTY_CODE_SET.has(countyCode)) return void 0;
59
+ return {
60
+ taxpayerId,
61
+ vatCode,
62
+ countyCode,
63
+ formatted: `${taxpayerId}-${vatCode}-${countyCode}`
64
+ };
65
+ }
66
+ function isValidHungarianTaxNumber(value) {
67
+ return parseHungarianTaxNumber(value) !== void 0;
68
+ }
69
+ function isValidHungarianGroupTaxNumber(value) {
70
+ return parseHungarianTaxNumber(value)?.vatCode === "5";
71
+ }
72
+ function isHungarianVatGroupMemberTaxNumber(value) {
73
+ return parseHungarianTaxNumber(value)?.vatCode === "4";
74
+ }
75
+ //#endregion
76
+ export { isValidHungarianTaxpayerId as a, normalizeEmail as c, weightedDigitSum as d, isValidHungarianTaxNumber as i, isDigits as l, isHungarianVatGroupMemberTaxNumber as n, parseHungarianTaxNumber as o, isValidHungarianGroupTaxNumber as r, isValidEmail as s, HUNGARIAN_TAX_COUNTY_CODES as t, stripSeparators as u };