kassza 0.18.1 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/batch/index.cjs +5 -7
- package/dist/batch/index.d.cts +5 -9
- package/dist/batch/index.d.ts +5 -9
- package/dist/batch/index.js +5 -7
- package/dist/{binary-B89HM03_.cjs → binary-CdpKlNNI.cjs} +1 -2
- package/dist/{binary-D0M9U2MD.js → binary-DuKBSfH-.js} +1 -2
- package/dist/cli.cjs +14 -21
- package/dist/cli.js +14 -21
- package/dist/{client-DeWWQ-RZ.d.ts → client-BT2odGYl.d.cts} +8 -36
- package/dist/{client-SVZu25MB.d.cts → client-C-SYCiOZ.d.ts} +8 -36
- package/dist/{client-Cvb9yfxU.cjs → client-I_29IPMh.cjs} +25 -37
- package/dist/{client-CdWEA0et.js → client-JZ1M1sZX.js} +25 -37
- package/dist/{context-kb33TgzE.d.ts → context-BuX6Eion.d.ts} +6 -24
- package/dist/{context-CFNKzStE.d.cts → context-PwqY4JOK.d.cts} +6 -24
- package/dist/cookie-stores/index.cjs +2 -2
- package/dist/cookie-stores/index.d.cts +3 -3
- package/dist/cookie-stores/index.d.ts +3 -3
- package/dist/cookie-stores/index.js +2 -2
- package/dist/{create-CflXrPip.js → create-BwRslos0.js} +9 -12
- package/dist/{create-CvUvLUaT.cjs → create-DH5jiZPA.cjs} +9 -12
- package/dist/{create-once-CW0x_yvp.js → create-once-B6cAXyET.js} +16 -22
- package/dist/{create-once-VKp0tVow.d.ts → create-once-CiGUjXut.d.ts} +3 -7
- package/dist/{create-once-Bh6fOWkW.d.cts → create-once-CyaVT36b.d.cts} +3 -7
- package/dist/{create-once-CHhDz0un.cjs → create-once-zeF7GVVP.cjs} +16 -22
- package/dist/{crypto-Dpn4FHQ6.cjs → crypto-B0PAHKJB.cjs} +1 -2
- package/dist/{crypto-usDg8L2K.js → crypto-BqGn_oGu.js} +1 -2
- package/dist/data-link/index.cjs +10 -13
- package/dist/data-link/index.d.cts +1 -5
- package/dist/data-link/index.d.ts +1 -5
- package/dist/data-link/index.js +10 -13
- package/dist/{dates-CXyj7Azy.js → dates-DWsZOdaO.js} +1 -2
- package/dist/{dates-9zvESP0i.d.cts → dates-nlGEokCf.d.cts} +0 -2
- package/dist/{dates-9zvESP0i.d.ts → dates-nlGEokCf.d.ts} +0 -2
- package/dist/{dates-CPgBodkP.cjs → dates-oOp3ypPP.cjs} +1 -2
- package/dist/delegation/index.cjs +9 -12
- package/dist/delegation/index.d.cts +3 -9
- package/dist/delegation/index.d.ts +3 -9
- package/dist/delegation/index.js +9 -12
- package/dist/{errors-EE96_6D_.cjs → errors-Bn6pe6yw.cjs} +12 -3
- package/dist/{errors-DtN4g5Z9.js → errors-CGGsW0Y5.js} +12 -3
- package/dist/{get-Byc9T5WO.d.cts → get-BL4Fr8-P.d.cts} +0 -2
- package/dist/{get-Byc9T5WO.d.ts → get-BL4Fr8-P.d.ts} +0 -2
- package/dist/{get-BdMTseh4.cjs → get-DFhT7kOp.cjs} +4 -5
- package/dist/{get-CZEShCcj.js → get-HrHwVkVt.js} +4 -5
- package/dist/{index-C-7yWV7L.d.cts → index-CinpAhQM.d.cts} +0 -8
- package/dist/{index-C-7yWV7L.d.ts → index-CinpAhQM.d.ts} +0 -8
- package/dist/{index-BqGgQ4t3.d.ts → index-DqoDUw6X.d.ts} +2 -20
- package/dist/{index-BhUPY_EH.d.cts → index-qk62lWr3.d.cts} +2 -20
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +11 -13
- package/dist/index.d.ts +11 -13
- package/dist/index.js +7 -7
- package/dist/ipn/index.cjs +4 -6
- package/dist/ipn/index.d.cts +0 -4
- package/dist/ipn/index.d.ts +0 -4
- package/dist/ipn/index.js +4 -6
- package/dist/{issue-Bin4tKD_.cjs → issue-DReARZnF.cjs} +12 -18
- package/dist/{issue-DMA1Nbr1.js → issue-Dy9zvRK1.js} +12 -18
- package/dist/journal/index.cjs +7 -11
- package/dist/journal/index.d.cts +2 -6
- package/dist/journal/index.d.ts +2 -6
- package/dist/journal/index.js +7 -11
- package/dist/{journal-Y9qrIB8G.d.ts → journal-BNdo07p5.d.ts} +5 -9
- package/dist/{journal-DvI81Kt7.d.cts → journal-DI-hOW6N.d.cts} +5 -9
- package/dist/{json-4y4E2xxS.cjs → json-COC9rDwf.cjs} +1 -2
- package/dist/json-D3Bx7NhF.d.cts +2 -0
- package/dist/json-D3Bx7NhF.d.ts +2 -0
- package/dist/{json-DjnqnaJK.js → json-as-6J7d-.js} +1 -2
- package/dist/mcp/index.cjs +1 -1
- package/dist/mcp/index.d.cts +1 -9
- package/dist/mcp/index.d.ts +1 -9
- package/dist/mcp/index.js +1 -2
- package/dist/money/index.cjs +3 -3
- package/dist/money/index.d.cts +1 -1
- package/dist/money/index.d.ts +1 -1
- package/dist/money/index.js +3 -3
- package/dist/{money-K9j0wPit.cjs → money-NtVytaxG.cjs} +5 -7
- package/dist/{money-Cw457SD6.js → money-f280VT77.js} +5 -7
- package/dist/nav/index.cjs +15 -22
- package/dist/nav/index.d.cts +2 -22
- package/dist/nav/index.d.ts +2 -22
- package/dist/nav/index.js +15 -22
- package/dist/{nav-BcCerwWS.js → nav-NvNgaONz.js} +5 -7
- package/dist/{nav-BNbc8U0R.cjs → nav-VShZkjg8.cjs} +5 -7
- package/dist/node/index.cjs +1 -2
- package/dist/node/index.d.cts +1 -3
- package/dist/node/index.d.ts +1 -3
- package/dist/node/index.js +1 -2
- package/dist/observe/index.cjs +3 -5
- package/dist/observe/index.d.cts +1 -5
- package/dist/observe/index.d.ts +1 -5
- package/dist/observe/index.js +3 -5
- package/dist/{once-BN_3B5OF.cjs → once-BmXfrNbQ.cjs} +2 -3
- package/dist/{once-CqqZxsXG.js → once-CMhDPrs7.js} +2 -3
- package/dist/{parse-Cr7yQ3_z.js → parse-1RiSh4vY.js} +5 -7
- package/dist/{parse-DOA2XQ3e.cjs → parse-CmM5va-p.cjs} +5 -7
- package/dist/payments/barion.cjs +7 -6
- package/dist/payments/barion.d.cts +4 -6
- package/dist/payments/barion.d.ts +4 -6
- package/dist/payments/barion.js +7 -6
- package/dist/payments/index.cjs +2 -2
- package/dist/payments/index.d.cts +3 -9
- package/dist/payments/index.d.ts +3 -9
- package/dist/payments/index.js +2 -2
- package/dist/payments/paypal.cjs +8 -7
- package/dist/payments/paypal.d.cts +4 -6
- package/dist/payments/paypal.d.ts +4 -6
- package/dist/payments/paypal.js +8 -7
- package/dist/payments/revolut.cjs +7 -6
- package/dist/payments/revolut.d.cts +4 -6
- package/dist/payments/revolut.d.ts +4 -6
- package/dist/payments/revolut.js +7 -6
- package/dist/payments/simplepay.cjs +9 -8
- package/dist/payments/simplepay.d.cts +4 -6
- package/dist/payments/simplepay.d.ts +4 -6
- package/dist/payments/simplepay.js +9 -8
- package/dist/payments/stripe.cjs +6 -6
- package/dist/payments/stripe.d.cts +4 -6
- package/dist/payments/stripe.d.ts +4 -6
- package/dist/payments/stripe.js +6 -6
- package/dist/{push-BXj0Sf0Z.d.ts → push-CTxDD3yJ.d.cts} +2 -4
- package/dist/{push-D4nNbCNV.d.cts → push-DJh5YkyV.d.ts} +2 -4
- package/dist/{reference-B5TATqb5.js → reference-Cxz0m2zF.js} +6 -7
- package/dist/{reference-BIdYMK0t.cjs → reference-DoY12fc1.cjs} +6 -7
- package/dist/reports/index.cjs +3 -4
- package/dist/reports/index.d.cts +1 -7
- package/dist/reports/index.d.ts +1 -7
- package/dist/reports/index.js +3 -4
- package/dist/{request-body-uZHMRlQr.js → request-body-BM4sbsHd.js} +2 -3
- package/dist/{request-body-CH6ZGOrq.cjs → request-body-BhfkJhff.cjs} +2 -3
- package/dist/{rounding-TxoWy2ww.cjs → rounding-CHmSK5Z2.cjs} +1 -2
- package/dist/{rounding-BLyHjjI5.js → rounding-CZLj4DbV.js} +1 -2
- package/dist/{serialize-B2eFh3D-.js → serialize-CjymGkJj.js} +2 -4
- package/dist/{serialize-CquIsxA-.cjs → serialize-DEU7r6Bk.cjs} +2 -4
- package/dist/{server-xcEb7ko9.cjs → server-BZ-ySQGx.cjs} +23 -35
- package/dist/{server-Dt6bEeBB.js → server-CDwsjBWk.js} +23 -35
- package/dist/{session-Ckl5eJhV.d.ts → session-BBbSXlx3.d.cts} +1 -3
- package/dist/{session-DeM5vjvC.cjs → session-BYotpR_s.cjs} +2 -4
- package/dist/{session-SaEEXu2N.js → session-DZeE1ryt.js} +2 -4
- package/dist/{session-YbChChx7.d.cts → session-mKtpAeUB.d.ts} +1 -3
- package/dist/{shared-CrxlxI8n.cjs → shared-BOBTXDTo.cjs} +5 -6
- package/dist/{shared-D6DLa4b7.js → shared-Dbcfwr8x.js} +5 -6
- package/dist/storage/fs.cjs +3 -4
- package/dist/storage/fs.d.cts +2 -4
- package/dist/storage/fs.d.ts +2 -4
- package/dist/storage/fs.js +3 -4
- package/dist/storage/index.cjs +16 -25
- package/dist/storage/index.d.cts +2 -26
- package/dist/storage/index.d.ts +2 -26
- package/dist/storage/index.js +16 -25
- package/dist/{store-C1rHd9DB.d.cts → store-BkaZ8qkU.d.cts} +0 -2
- package/dist/{store-C1rHd9DB.d.ts → store-BkaZ8qkU.d.ts} +0 -2
- package/dist/stores/index.cjs +2 -2
- package/dist/stores/index.d.cts +3 -3
- package/dist/stores/index.d.ts +3 -3
- package/dist/stores/index.js +2 -2
- package/dist/{stores-DhjGBrl_.js → stores-BUnPNJQl.js} +12 -22
- package/dist/{stores-BNrS0dWl.cjs → stores-CH4rYKs_.cjs} +12 -22
- package/dist/{tax-number-BdqKsxNR.js → tax-number-C6jySuGR.js} +3 -6
- package/dist/{tax-number-BYFkBp4A.cjs → tax-number-XLdM5ETv.cjs} +3 -6
- package/dist/testing/index.cjs +20 -30
- package/dist/testing/index.d.cts +5 -15
- package/dist/testing/index.d.ts +5 -15
- package/dist/testing/index.js +20 -30
- package/dist/{types-DVRgwcqg.d.cts → types-Bfs08Mrc.d.cts} +0 -2
- package/dist/{types-DVRgwcqg.d.ts → types-Bfs08Mrc.d.ts} +0 -2
- package/dist/{types-ByAEvGsZ.d.ts → types-DeuUqIvU.d.cts} +2 -4
- package/dist/{types-D1zDOH_F.d.ts → types-Z6rQoqHn.d.ts} +1 -3
- package/dist/{types-lnKkQdot.d.cts → types-_HKTOCuQ.d.cts} +1 -3
- package/dist/{types-B1A8mUIE.d.cts → types-oiDulesz.d.ts} +2 -4
- package/dist/url-CRIlLxPE.cjs +23 -0
- package/dist/url-DeCMiKVm.js +12 -0
- package/dist/validators/index.cjs +6 -10
- package/dist/validators/index.d.cts +0 -12
- package/dist/validators/index.d.ts +0 -12
- package/dist/validators/index.js +6 -10
- package/dist/{vat-v_dcWCto.js → vat-B4J5Q0tu.js} +1 -2
- package/dist/{vat-g35srbNG.cjs → vat-BkoiiKm4.cjs} +1 -2
- package/dist/{warnings-DwTl5J-2.js → warnings-DJ0QvZOp.js} +1 -2
- package/dist/{warnings-B3DXnveC.d.cts → warnings-DpuYhn39.d.cts} +0 -4
- package/dist/{warnings-B3DXnveC.d.ts → warnings-DpuYhn39.d.ts} +0 -4
- package/dist/{warnings-DeIw5RFj.cjs → warnings-ciSzK6Jc.cjs} +1 -2
- package/dist/{webhook-Ckj-_hPD.cjs → webhook-BBTebz1x.cjs} +7 -11
- package/dist/{webhook-D6lEejob.d.ts → webhook-C9IBUdeT.d.ts} +1 -3
- package/dist/{webhook-CmdhGiH5.d.cts → webhook-DF2p_m2Q.d.cts} +1 -3
- package/dist/{webhook-CQVShAfI.js → webhook-SFlA_nCf.js} +7 -11
- package/package.json +1 -1
- package/dist/json-B70TwoX1.d.cts +0 -4
- package/dist/json-B70TwoX1.d.ts +0 -4
package/dist/nav/index.cjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_serialize = require("../serialize-
|
|
3
|
-
const require_dates = require("../dates-
|
|
4
|
-
const require_rounding = require("../rounding-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
2
|
+
const require_serialize = require("../serialize-DEU7r6Bk.cjs");
|
|
3
|
+
const require_dates = require("../dates-oOp3ypPP.cjs");
|
|
4
|
+
const require_rounding = require("../rounding-CHmSK5Z2.cjs");
|
|
5
|
+
const require_url = require("../url-CRIlLxPE.cjs");
|
|
6
|
+
const require_crypto = require("../crypto-B0PAHKJB.cjs");
|
|
7
|
+
const require_nav = require("../nav-VShZkjg8.cjs");
|
|
8
|
+
// src/nav/errors.ts
|
|
8
9
|
const NAV_RECEIPT_ERROR_CODES = {
|
|
9
10
|
EPGP0002: {
|
|
10
11
|
name: "NEM_LETEZO_SZOFTVER",
|
|
@@ -100,8 +101,7 @@ var NavReceiptError = class extends Error {
|
|
|
100
101
|
function isNavReceiptError(error) {
|
|
101
102
|
return error instanceof NavReceiptError;
|
|
102
103
|
}
|
|
103
|
-
|
|
104
|
-
//#region src/nav/parse.ts
|
|
104
|
+
// src/nav/parse.ts
|
|
105
105
|
const RAW_PREVIEW_LENGTH = 2e3;
|
|
106
106
|
const UNAUTHORIZED$1 = 401;
|
|
107
107
|
const FORBIDDEN = 403;
|
|
@@ -275,8 +275,7 @@ function parseCurrencyResponse(root) {
|
|
|
275
275
|
name: requiredText(currency, "name", "currencies")
|
|
276
276
|
}));
|
|
277
277
|
}
|
|
278
|
-
|
|
279
|
-
//#region src/nav/sha3.ts
|
|
278
|
+
// src/nav/sha3.ts
|
|
280
279
|
const RATE_BYTES = 72;
|
|
281
280
|
const OUTPUT_BYTES = 64;
|
|
282
281
|
const LANE_BYTES = 8;
|
|
@@ -393,8 +392,7 @@ const encoder = new TextEncoder();
|
|
|
393
392
|
function sha3_512Hex(input) {
|
|
394
393
|
return require_crypto.bytesToHex(sha3_512(typeof input === "string" ? encoder.encode(input) : input));
|
|
395
394
|
}
|
|
396
|
-
|
|
397
|
-
//#region src/nav/validate.ts
|
|
395
|
+
// src/nav/validate.ts
|
|
398
396
|
const NAV_SERIAL_NUMBER_PATTERN = /^[A-Za-zÁÉÍÓÖŐÚÜŰáéíóöőúüű0-9_/\-\\](?:[A-Za-zÁÉÍÓÖŐÚÜŰáéíóöőúüű0-9/_\-\\ ]*[A-Za-zÁÉÍÓÖŐÚÜŰáéíóöőúüű0-9/_\-\\])?$/;
|
|
399
397
|
const NAV_SOFTWARE_NAME_PATTERN = /^[A-ZÁÉÍÓÖŐÚÜŰa-záéíóöőúüű0-9.\s\-@+_]+$/;
|
|
400
398
|
const NAV_VAT_CATEGORY_PATTERN = /^[A-Za-z0-9áéíóöőúüűÁÉÍÓÖŐÚÜŰ% ]+$/;
|
|
@@ -488,8 +486,7 @@ function validateNavReceiptData(data, options = {}) {
|
|
|
488
486
|
assertCount(data.numberOfModifyingDocument, "módosító bizonylatok száma (numberOfModifyingDocument)");
|
|
489
487
|
if (data.numberOfSaleDocument === 0 && data.numberOfModifyingDocument === 0) throw invalid$1("A nyugták és a módosító bizonylatok száma közül legalább az egyik nem lehet 0.");
|
|
490
488
|
}
|
|
491
|
-
|
|
492
|
-
//#region src/nav/xml.ts
|
|
489
|
+
// src/nav/xml.ts
|
|
493
490
|
const NAV_RECEIPT_NAMESPACE = "http://schemas.nav.gov.hu/NTCA/1.0/receipt";
|
|
494
491
|
const NAV_SERVICE_NAMESPACE = "http://schemas.nav.gov.hu/NTCA/2.0/common/service";
|
|
495
492
|
const NAV_AUTH_NAMESPACE = "http://schemas.nav.gov.hu/NTCA/2.0/common/authservice";
|
|
@@ -601,8 +598,7 @@ function buildIssuingSoftwareListXml(context, taxPayerId) {
|
|
|
601
598
|
function buildContextOnlyXml(root, context) {
|
|
602
599
|
return document(root, [contextNode(context)]);
|
|
603
600
|
}
|
|
604
|
-
|
|
605
|
-
//#region src/nav/client.ts
|
|
601
|
+
// src/nav/client.ts
|
|
606
602
|
const NAV_RECEIPT_URLS = {
|
|
607
603
|
test: "https://bv-receipt-if.enyugta.nav.gov.hu/v1",
|
|
608
604
|
production: "https://receipt-if.enyugta.nav.gov.hu/v1"
|
|
@@ -669,7 +665,7 @@ function resolveOptions(options) {
|
|
|
669
665
|
const timeoutMs = options.timeoutMs ?? 15e3;
|
|
670
666
|
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) throw configuration(`A timeoutMs pozitív szám legyen, kapott: ${timeoutMs}`);
|
|
671
667
|
return {
|
|
672
|
-
baseUrl: (options.baseUrl ?? NAV_RECEIPT_URLS[options.environment])
|
|
668
|
+
baseUrl: require_url.trimTrailingSlashes(options.baseUrl ?? NAV_RECEIPT_URLS[options.environment]),
|
|
673
669
|
login,
|
|
674
670
|
password: options.password,
|
|
675
671
|
passwordHash: passwordHash?.toUpperCase(),
|
|
@@ -909,8 +905,7 @@ function createNavReceiptClient(options) {
|
|
|
909
905
|
currencies: (requestOptions = {}) => call("currencies", "CurrencyResponse", (requestContext) => buildContextOnlyXml("CurrencyRequest", requestContext), parseCurrencyResponse, requestOptions)
|
|
910
906
|
};
|
|
911
907
|
}
|
|
912
|
-
|
|
913
|
-
//#region src/nav/paper.ts
|
|
908
|
+
// src/nav/paper.ts
|
|
914
909
|
function invalid(message) {
|
|
915
910
|
return new NavReceiptError(message, { category: "validation" });
|
|
916
911
|
}
|
|
@@ -961,8 +956,7 @@ function paperReceiptReport(day) {
|
|
|
961
956
|
numberOfModifyingDocument: modifying.size
|
|
962
957
|
};
|
|
963
958
|
}
|
|
964
|
-
|
|
965
|
-
//#region src/nav/reconcile.ts
|
|
959
|
+
// src/nav/reconcile.ts
|
|
966
960
|
const AMOUNT_TOLERANCE = .005;
|
|
967
961
|
function keyOf(applicableDate, serialNumber) {
|
|
968
962
|
return JSON.stringify([applicableDate, serialNumber]);
|
|
@@ -1009,7 +1003,6 @@ function reconcileNavReports(local, remote) {
|
|
|
1009
1003
|
unexpected: [...recorded.values()].flat()
|
|
1010
1004
|
};
|
|
1011
1005
|
}
|
|
1012
|
-
//#endregion
|
|
1013
1006
|
exports.NAV_AUTH_NAMESPACE = NAV_AUTH_NAMESPACE;
|
|
1014
1007
|
exports.NAV_DEFAULT_TIMEOUT_MS = NAV_DEFAULT_TIMEOUT_MS;
|
|
1015
1008
|
exports.NAV_MAX_LIST_PAGES = NAV_MAX_LIST_PAGES;
|
package/dist/nav/index.d.cts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { t as DateInput } from "../dates-
|
|
2
|
-
import { s as RequestOptions } from "../context-
|
|
3
|
-
//#region src/core/xml/parse.d.ts
|
|
1
|
+
import { t as DateInput } from "../dates-nlGEokCf.cjs";
|
|
2
|
+
import { s as RequestOptions } from "../context-PwqY4JOK.cjs";
|
|
4
3
|
interface XmlElement {
|
|
5
4
|
readonly name: string;
|
|
6
5
|
readonly attributes: Readonly<Record<string, string>>;
|
|
7
6
|
readonly children: readonly XmlElement[];
|
|
8
7
|
readonly text: string;
|
|
9
8
|
}
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region src/nav/types.d.ts
|
|
12
9
|
interface NavVatCategoryAmounts {
|
|
13
10
|
readonly vat: string;
|
|
14
11
|
readonly saleDocument: number;
|
|
@@ -71,8 +68,6 @@ interface NavReportQuery {
|
|
|
71
68
|
readonly orderBy?: NavReportOrderProperty | undefined;
|
|
72
69
|
readonly direction?: NavOrderDirection | undefined;
|
|
73
70
|
}
|
|
74
|
-
//#endregion
|
|
75
|
-
//#region src/nav/client.d.ts
|
|
76
71
|
export declare const NAV_RECEIPT_URLS: {
|
|
77
72
|
readonly test: "https://bv-receipt-if.enyugta.nav.gov.hu/v1";
|
|
78
73
|
readonly production: "https://receipt-if.enyugta.nav.gov.hu/v1";
|
|
@@ -129,8 +124,6 @@ interface NavReceiptClient {
|
|
|
129
124
|
currencies(options?: RequestOptions): Promise<NavCurrencyInfo[]>;
|
|
130
125
|
}
|
|
131
126
|
export declare function createNavReceiptClient(options: NavReceiptClientOptions): NavReceiptClient;
|
|
132
|
-
//#endregion
|
|
133
|
-
//#region src/nav/errors.d.ts
|
|
134
127
|
type NavOperation = "authToken" | "listReceipts" | "createReceipt" | "receiptDetail" | "modifyReceipt" | "invalidateReceipt" | "createIssuingSoftware" | "listIssuingSoftware" | "vatCategories" | "currencies";
|
|
135
128
|
type NavReceiptErrorCategory = "auth" | "validation" | "business" | "technical" | "network" | "timeout" | "unexpected_response" | "write_blocked" | "conflict" | "configuration";
|
|
136
129
|
interface NavFieldError {
|
|
@@ -169,8 +162,6 @@ export declare class NavReceiptError extends Error {
|
|
|
169
162
|
get retryable(): boolean;
|
|
170
163
|
}
|
|
171
164
|
export declare function isNavReceiptError(error: unknown): error is NavReceiptError;
|
|
172
|
-
//#endregion
|
|
173
|
-
//#region src/nav/paper.d.ts
|
|
174
165
|
interface PaperReceiptEntry {
|
|
175
166
|
readonly number: string;
|
|
176
167
|
readonly vat: string;
|
|
@@ -184,11 +175,7 @@ interface PaperReceiptDay {
|
|
|
184
175
|
readonly entries: readonly PaperReceiptEntry[];
|
|
185
176
|
}
|
|
186
177
|
export declare function paperReceiptReport(day: PaperReceiptDay): NavReceiptData;
|
|
187
|
-
//#endregion
|
|
188
|
-
//#region src/nav/parse.d.ts
|
|
189
178
|
export declare function parseNavResponse(operation: NavOperation, expectedRoot: string, status: number, body: string): XmlElement;
|
|
190
|
-
//#endregion
|
|
191
|
-
//#region src/nav/reconcile.d.ts
|
|
192
179
|
interface NavReconciledPair {
|
|
193
180
|
readonly local: NavReceiptData;
|
|
194
181
|
readonly remote: NavReportListItem;
|
|
@@ -203,12 +190,8 @@ interface NavReconciliation {
|
|
|
203
190
|
readonly unexpected: readonly NavReportListItem[];
|
|
204
191
|
}
|
|
205
192
|
export declare function reconcileNavReports(local: readonly NavReceiptData[], remote: readonly NavReportListItem[]): NavReconciliation;
|
|
206
|
-
//#endregion
|
|
207
|
-
//#region src/nav/sha3.d.ts
|
|
208
193
|
export declare function sha3_512(data: Uint8Array): Uint8Array;
|
|
209
194
|
export declare function sha3_512Hex(input: string | Uint8Array): string;
|
|
210
|
-
//#endregion
|
|
211
|
-
//#region src/nav/validate.d.ts
|
|
212
195
|
export declare const NAV_SERIAL_NUMBER_PATTERN: RegExp;
|
|
213
196
|
export declare const NAV_SOFTWARE_NAME_PATTERN: RegExp;
|
|
214
197
|
export declare const NAV_VAT_CATEGORY_PATTERN: RegExp;
|
|
@@ -218,8 +201,6 @@ interface ValidateNavReceiptOptions {
|
|
|
218
201
|
readonly today?: string | undefined;
|
|
219
202
|
}
|
|
220
203
|
export declare function validateNavReceiptData(data: NavReceiptData, options?: ValidateNavReceiptOptions): void;
|
|
221
|
-
//#endregion
|
|
222
|
-
//#region src/nav/xml.d.ts
|
|
223
204
|
export declare const NAV_RECEIPT_NAMESPACE = "http://schemas.nav.gov.hu/NTCA/1.0/receipt";
|
|
224
205
|
export declare const NAV_SERVICE_NAMESPACE = "http://schemas.nav.gov.hu/NTCA/2.0/common/service";
|
|
225
206
|
export declare const NAV_AUTH_NAMESPACE = "http://schemas.nav.gov.hu/NTCA/2.0/common/authservice";
|
|
@@ -243,5 +224,4 @@ export declare function buildReceiptIdXml(root: "ReceiptDetailRequest" | "Invali
|
|
|
243
224
|
export declare function buildCreateIssuingSoftwareXml(context: NavRequestContext, taxPayerId: string, name: string): string;
|
|
244
225
|
export declare function buildIssuingSoftwareListXml(context: NavRequestContext, taxPayerId: string): string;
|
|
245
226
|
export declare function buildContextOnlyXml(root: "VatCategoryRequest" | "CurrencyRequest", context: NavRequestContext): string;
|
|
246
|
-
//#endregion
|
|
247
227
|
export type { NavAuthFields, NavAuthToken, NavCurrencyInfo, NavEnvironment, NavErrorCodeInfo, NavFieldError, NavListAllQuery, NavMismatch, NavOperation, NavOrderDirection, NavReceiptClient, NavReceiptClientOptions, NavReceiptData, NavReceiptErrorCategory, NavReconciledPair, NavReconciliation, NavReportDetail, NavReportListItem, NavReportOrderProperty, NavReportPage, NavReportQuery, NavReportStatus, NavRequestContext, NavSubmitOptions, NavSubmitResult, NavVatCategoryAmounts, NavVatCategoryInfo, PaperReceiptDay, PaperReceiptEntry, ValidateNavReceiptOptions };
|
package/dist/nav/index.d.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { t as DateInput } from "../dates-
|
|
2
|
-
import { s as RequestOptions } from "../context-
|
|
3
|
-
//#region src/core/xml/parse.d.ts
|
|
1
|
+
import { t as DateInput } from "../dates-nlGEokCf.js";
|
|
2
|
+
import { s as RequestOptions } from "../context-BuX6Eion.js";
|
|
4
3
|
interface XmlElement {
|
|
5
4
|
readonly name: string;
|
|
6
5
|
readonly attributes: Readonly<Record<string, string>>;
|
|
7
6
|
readonly children: readonly XmlElement[];
|
|
8
7
|
readonly text: string;
|
|
9
8
|
}
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region src/nav/types.d.ts
|
|
12
9
|
interface NavVatCategoryAmounts {
|
|
13
10
|
readonly vat: string;
|
|
14
11
|
readonly saleDocument: number;
|
|
@@ -71,8 +68,6 @@ interface NavReportQuery {
|
|
|
71
68
|
readonly orderBy?: NavReportOrderProperty | undefined;
|
|
72
69
|
readonly direction?: NavOrderDirection | undefined;
|
|
73
70
|
}
|
|
74
|
-
//#endregion
|
|
75
|
-
//#region src/nav/client.d.ts
|
|
76
71
|
export declare const NAV_RECEIPT_URLS: {
|
|
77
72
|
readonly test: "https://bv-receipt-if.enyugta.nav.gov.hu/v1";
|
|
78
73
|
readonly production: "https://receipt-if.enyugta.nav.gov.hu/v1";
|
|
@@ -129,8 +124,6 @@ interface NavReceiptClient {
|
|
|
129
124
|
currencies(options?: RequestOptions): Promise<NavCurrencyInfo[]>;
|
|
130
125
|
}
|
|
131
126
|
export declare function createNavReceiptClient(options: NavReceiptClientOptions): NavReceiptClient;
|
|
132
|
-
//#endregion
|
|
133
|
-
//#region src/nav/errors.d.ts
|
|
134
127
|
type NavOperation = "authToken" | "listReceipts" | "createReceipt" | "receiptDetail" | "modifyReceipt" | "invalidateReceipt" | "createIssuingSoftware" | "listIssuingSoftware" | "vatCategories" | "currencies";
|
|
135
128
|
type NavReceiptErrorCategory = "auth" | "validation" | "business" | "technical" | "network" | "timeout" | "unexpected_response" | "write_blocked" | "conflict" | "configuration";
|
|
136
129
|
interface NavFieldError {
|
|
@@ -169,8 +162,6 @@ export declare class NavReceiptError extends Error {
|
|
|
169
162
|
get retryable(): boolean;
|
|
170
163
|
}
|
|
171
164
|
export declare function isNavReceiptError(error: unknown): error is NavReceiptError;
|
|
172
|
-
//#endregion
|
|
173
|
-
//#region src/nav/paper.d.ts
|
|
174
165
|
interface PaperReceiptEntry {
|
|
175
166
|
readonly number: string;
|
|
176
167
|
readonly vat: string;
|
|
@@ -184,11 +175,7 @@ interface PaperReceiptDay {
|
|
|
184
175
|
readonly entries: readonly PaperReceiptEntry[];
|
|
185
176
|
}
|
|
186
177
|
export declare function paperReceiptReport(day: PaperReceiptDay): NavReceiptData;
|
|
187
|
-
//#endregion
|
|
188
|
-
//#region src/nav/parse.d.ts
|
|
189
178
|
export declare function parseNavResponse(operation: NavOperation, expectedRoot: string, status: number, body: string): XmlElement;
|
|
190
|
-
//#endregion
|
|
191
|
-
//#region src/nav/reconcile.d.ts
|
|
192
179
|
interface NavReconciledPair {
|
|
193
180
|
readonly local: NavReceiptData;
|
|
194
181
|
readonly remote: NavReportListItem;
|
|
@@ -203,12 +190,8 @@ interface NavReconciliation {
|
|
|
203
190
|
readonly unexpected: readonly NavReportListItem[];
|
|
204
191
|
}
|
|
205
192
|
export declare function reconcileNavReports(local: readonly NavReceiptData[], remote: readonly NavReportListItem[]): NavReconciliation;
|
|
206
|
-
//#endregion
|
|
207
|
-
//#region src/nav/sha3.d.ts
|
|
208
193
|
export declare function sha3_512(data: Uint8Array): Uint8Array;
|
|
209
194
|
export declare function sha3_512Hex(input: string | Uint8Array): string;
|
|
210
|
-
//#endregion
|
|
211
|
-
//#region src/nav/validate.d.ts
|
|
212
195
|
export declare const NAV_SERIAL_NUMBER_PATTERN: RegExp;
|
|
213
196
|
export declare const NAV_SOFTWARE_NAME_PATTERN: RegExp;
|
|
214
197
|
export declare const NAV_VAT_CATEGORY_PATTERN: RegExp;
|
|
@@ -218,8 +201,6 @@ interface ValidateNavReceiptOptions {
|
|
|
218
201
|
readonly today?: string | undefined;
|
|
219
202
|
}
|
|
220
203
|
export declare function validateNavReceiptData(data: NavReceiptData, options?: ValidateNavReceiptOptions): void;
|
|
221
|
-
//#endregion
|
|
222
|
-
//#region src/nav/xml.d.ts
|
|
223
204
|
export declare const NAV_RECEIPT_NAMESPACE = "http://schemas.nav.gov.hu/NTCA/1.0/receipt";
|
|
224
205
|
export declare const NAV_SERVICE_NAMESPACE = "http://schemas.nav.gov.hu/NTCA/2.0/common/service";
|
|
225
206
|
export declare const NAV_AUTH_NAMESPACE = "http://schemas.nav.gov.hu/NTCA/2.0/common/authservice";
|
|
@@ -243,5 +224,4 @@ export declare function buildReceiptIdXml(root: "ReceiptDetailRequest" | "Invali
|
|
|
243
224
|
export declare function buildCreateIssuingSoftwareXml(context: NavRequestContext, taxPayerId: string, name: string): string;
|
|
244
225
|
export declare function buildIssuingSoftwareListXml(context: NavRequestContext, taxPayerId: string): string;
|
|
245
226
|
export declare function buildContextOnlyXml(root: "VatCategoryRequest" | "CurrencyRequest", context: NavRequestContext): string;
|
|
246
|
-
//#endregion
|
|
247
227
|
export type { NavAuthFields, NavAuthToken, NavCurrencyInfo, NavEnvironment, NavErrorCodeInfo, NavFieldError, NavListAllQuery, NavMismatch, NavOperation, NavOrderDirection, NavReceiptClient, NavReceiptClientOptions, NavReceiptData, NavReceiptErrorCategory, NavReconciledPair, NavReconciliation, NavReportDetail, NavReportListItem, NavReportOrderProperty, NavReportPage, NavReportQuery, NavReportStatus, NavRequestContext, NavSubmitOptions, NavSubmitResult, NavVatCategoryAmounts, NavVatCategoryInfo, PaperReceiptDay, PaperReceiptEntry, ValidateNavReceiptOptions };
|
package/dist/nav/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { a as optionalEl, d as findChildren, f as parseXml, l as childText, n as buildXmlDocument, o as XmlParseError, r as el, t as XSI_NAMESPACE, u as findChild } from "../serialize-
|
|
2
|
-
import { a as todayInBudapest, n as toAgentDate } from "../dates-
|
|
3
|
-
import { n as decimalPlaces, r as roundMoney } from "../rounding-
|
|
4
|
-
import { n as
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { a as optionalEl, d as findChildren, f as parseXml, l as childText, n as buildXmlDocument, o as XmlParseError, r as el, t as XSI_NAMESPACE, u as findChild } from "../serialize-CjymGkJj.js";
|
|
2
|
+
import { a as todayInBudapest, n as toAgentDate } from "../dates-DWsZOdaO.js";
|
|
3
|
+
import { n as decimalPlaces, r as roundMoney } from "../rounding-CZLj4DbV.js";
|
|
4
|
+
import { n as trimTrailingSlashes } from "../url-DeCMiKVm.js";
|
|
5
|
+
import { n as digestHex, t as bytesToHex } from "../crypto-BqGn_oGu.js";
|
|
6
|
+
import { o as NAV_VAT_CATEGORIES, t as compareReceiptNumbers } from "../nav-NvNgaONz.js";
|
|
7
|
+
// src/nav/errors.ts
|
|
7
8
|
const NAV_RECEIPT_ERROR_CODES = {
|
|
8
9
|
EPGP0002: {
|
|
9
10
|
name: "NEM_LETEZO_SZOFTVER",
|
|
@@ -99,8 +100,7 @@ var NavReceiptError = class extends Error {
|
|
|
99
100
|
function isNavReceiptError(error) {
|
|
100
101
|
return error instanceof NavReceiptError;
|
|
101
102
|
}
|
|
102
|
-
|
|
103
|
-
//#region src/nav/parse.ts
|
|
103
|
+
// src/nav/parse.ts
|
|
104
104
|
const RAW_PREVIEW_LENGTH = 2e3;
|
|
105
105
|
const UNAUTHORIZED$1 = 401;
|
|
106
106
|
const FORBIDDEN = 403;
|
|
@@ -274,8 +274,7 @@ function parseCurrencyResponse(root) {
|
|
|
274
274
|
name: requiredText(currency, "name", "currencies")
|
|
275
275
|
}));
|
|
276
276
|
}
|
|
277
|
-
|
|
278
|
-
//#region src/nav/sha3.ts
|
|
277
|
+
// src/nav/sha3.ts
|
|
279
278
|
const RATE_BYTES = 72;
|
|
280
279
|
const OUTPUT_BYTES = 64;
|
|
281
280
|
const LANE_BYTES = 8;
|
|
@@ -392,8 +391,7 @@ const encoder = new TextEncoder();
|
|
|
392
391
|
function sha3_512Hex(input) {
|
|
393
392
|
return bytesToHex(sha3_512(typeof input === "string" ? encoder.encode(input) : input));
|
|
394
393
|
}
|
|
395
|
-
|
|
396
|
-
//#region src/nav/validate.ts
|
|
394
|
+
// src/nav/validate.ts
|
|
397
395
|
const NAV_SERIAL_NUMBER_PATTERN = /^[A-Za-zÁÉÍÓÖŐÚÜŰáéíóöőúüű0-9_/\-\\](?:[A-Za-zÁÉÍÓÖŐÚÜŰáéíóöőúüű0-9/_\-\\ ]*[A-Za-zÁÉÍÓÖŐÚÜŰáéíóöőúüű0-9/_\-\\])?$/;
|
|
398
396
|
const NAV_SOFTWARE_NAME_PATTERN = /^[A-ZÁÉÍÓÖŐÚÜŰa-záéíóöőúüű0-9.\s\-@+_]+$/;
|
|
399
397
|
const NAV_VAT_CATEGORY_PATTERN = /^[A-Za-z0-9áéíóöőúüűÁÉÍÓÖŐÚÜŰ% ]+$/;
|
|
@@ -487,8 +485,7 @@ function validateNavReceiptData(data, options = {}) {
|
|
|
487
485
|
assertCount(data.numberOfModifyingDocument, "módosító bizonylatok száma (numberOfModifyingDocument)");
|
|
488
486
|
if (data.numberOfSaleDocument === 0 && data.numberOfModifyingDocument === 0) throw invalid$1("A nyugták és a módosító bizonylatok száma közül legalább az egyik nem lehet 0.");
|
|
489
487
|
}
|
|
490
|
-
|
|
491
|
-
//#region src/nav/xml.ts
|
|
488
|
+
// src/nav/xml.ts
|
|
492
489
|
const NAV_RECEIPT_NAMESPACE = "http://schemas.nav.gov.hu/NTCA/1.0/receipt";
|
|
493
490
|
const NAV_SERVICE_NAMESPACE = "http://schemas.nav.gov.hu/NTCA/2.0/common/service";
|
|
494
491
|
const NAV_AUTH_NAMESPACE = "http://schemas.nav.gov.hu/NTCA/2.0/common/authservice";
|
|
@@ -600,8 +597,7 @@ function buildIssuingSoftwareListXml(context, taxPayerId) {
|
|
|
600
597
|
function buildContextOnlyXml(root, context) {
|
|
601
598
|
return document(root, [contextNode(context)]);
|
|
602
599
|
}
|
|
603
|
-
|
|
604
|
-
//#region src/nav/client.ts
|
|
600
|
+
// src/nav/client.ts
|
|
605
601
|
const NAV_RECEIPT_URLS = {
|
|
606
602
|
test: "https://bv-receipt-if.enyugta.nav.gov.hu/v1",
|
|
607
603
|
production: "https://receipt-if.enyugta.nav.gov.hu/v1"
|
|
@@ -668,7 +664,7 @@ function resolveOptions(options) {
|
|
|
668
664
|
const timeoutMs = options.timeoutMs ?? 15e3;
|
|
669
665
|
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) throw configuration(`A timeoutMs pozitív szám legyen, kapott: ${timeoutMs}`);
|
|
670
666
|
return {
|
|
671
|
-
baseUrl: (options.baseUrl ?? NAV_RECEIPT_URLS[options.environment])
|
|
667
|
+
baseUrl: trimTrailingSlashes(options.baseUrl ?? NAV_RECEIPT_URLS[options.environment]),
|
|
672
668
|
login,
|
|
673
669
|
password: options.password,
|
|
674
670
|
passwordHash: passwordHash?.toUpperCase(),
|
|
@@ -908,8 +904,7 @@ function createNavReceiptClient(options) {
|
|
|
908
904
|
currencies: (requestOptions = {}) => call("currencies", "CurrencyResponse", (requestContext) => buildContextOnlyXml("CurrencyRequest", requestContext), parseCurrencyResponse, requestOptions)
|
|
909
905
|
};
|
|
910
906
|
}
|
|
911
|
-
|
|
912
|
-
//#region src/nav/paper.ts
|
|
907
|
+
// src/nav/paper.ts
|
|
913
908
|
function invalid(message) {
|
|
914
909
|
return new NavReceiptError(message, { category: "validation" });
|
|
915
910
|
}
|
|
@@ -960,8 +955,7 @@ function paperReceiptReport(day) {
|
|
|
960
955
|
numberOfModifyingDocument: modifying.size
|
|
961
956
|
};
|
|
962
957
|
}
|
|
963
|
-
|
|
964
|
-
//#region src/nav/reconcile.ts
|
|
958
|
+
// src/nav/reconcile.ts
|
|
965
959
|
const AMOUNT_TOLERANCE = .005;
|
|
966
960
|
function keyOf(applicableDate, serialNumber) {
|
|
967
961
|
return JSON.stringify([applicableDate, serialNumber]);
|
|
@@ -1008,5 +1002,4 @@ function reconcileNavReports(local, remote) {
|
|
|
1008
1002
|
unexpected: [...recorded.values()].flat()
|
|
1009
1003
|
};
|
|
1010
1004
|
}
|
|
1011
|
-
//#endregion
|
|
1012
1005
|
export { NAV_AUTH_NAMESPACE, NAV_DEFAULT_TIMEOUT_MS, NAV_MAX_LIST_PAGES, NAV_PAGING_NAMESPACE, NAV_RECEIPT_ERROR_CODES, NAV_RECEIPT_NAMESPACE, NAV_RECEIPT_URLS, NAV_REPORT_ID_PATTERN, NAV_SERIAL_NUMBER_PATTERN, NAV_SERVICE_NAMESPACE, NAV_SOFTWARE_NAME_PATTERN, NAV_VAT_CATEGORY_PATTERN, NavReceiptError, buildAuthTokenXml, buildContextOnlyXml, buildCreateIssuingSoftwareXml, buildCreateReceiptXml, buildIssuingSoftwareListXml, buildModifyReceiptXml, buildReceiptIdXml, buildReceiptListXml, createNavReceiptClient, isNavReceiptError, navLegacyRequestId, navPasswordHash, navRequestSignature, navSignatureTimestamp, navTaxpayerId, paperReceiptReport, parseNavResponse, reconcileNavReports, sha3_512, sha3_512Hex, validateNavReceiptData };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as SzamlazzError } from "./errors-
|
|
2
|
-
import { r as roundMoney } from "./rounding-
|
|
3
|
-
import { i as isHuf } from "./vat-
|
|
4
|
-
|
|
1
|
+
import { r as SzamlazzError } from "./errors-CGGsW0Y5.js";
|
|
2
|
+
import { r as roundMoney } from "./rounding-CZLj4DbV.js";
|
|
3
|
+
import { i as isHuf } from "./vat-B4J5Q0tu.js";
|
|
4
|
+
// src/reports/vat-category.ts
|
|
5
5
|
const NAV_VAT_CATEGORIES = [
|
|
6
6
|
"0%",
|
|
7
7
|
"5%",
|
|
@@ -24,8 +24,7 @@ function navVatCategory(vat) {
|
|
|
24
24
|
function isNavVatCategory(value) {
|
|
25
25
|
return NAV_VAT_CATEGORIES.includes(value);
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
//#region src/reports/nav.ts
|
|
27
|
+
// src/reports/nav.ts
|
|
29
28
|
const SEQUENCE_PATTERN = /^(.*)-(\d+)$/;
|
|
30
29
|
function splitReceiptNumber(receiptNumber) {
|
|
31
30
|
const match = SEQUENCE_PATTERN.exec(receiptNumber.trim());
|
|
@@ -152,5 +151,4 @@ function describeNavReport(report) {
|
|
|
152
151
|
`Nyugták száma: ${report.numberOfSaleDocument}, módosító/érvénytelenítő bizonylatok száma: ${report.numberOfModifyingDocument}`
|
|
153
152
|
].join("\n");
|
|
154
153
|
}
|
|
155
|
-
//#endregion
|
|
156
154
|
export { splitReceiptNumber as a, navVatCategory as c, navDailyReports as i, describeNavReport as n, NAV_VAT_CATEGORIES as o, navCurrencyCode as r, isNavVatCategory as s, compareReceiptNumbers as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_errors = require("./errors-
|
|
2
|
-
const require_rounding = require("./rounding-
|
|
3
|
-
const require_vat = require("./vat-
|
|
4
|
-
|
|
1
|
+
const require_errors = require("./errors-Bn6pe6yw.cjs");
|
|
2
|
+
const require_rounding = require("./rounding-CHmSK5Z2.cjs");
|
|
3
|
+
const require_vat = require("./vat-BkoiiKm4.cjs");
|
|
4
|
+
// src/reports/vat-category.ts
|
|
5
5
|
const NAV_VAT_CATEGORIES = [
|
|
6
6
|
"0%",
|
|
7
7
|
"5%",
|
|
@@ -24,8 +24,7 @@ function navVatCategory(vat) {
|
|
|
24
24
|
function isNavVatCategory(value) {
|
|
25
25
|
return NAV_VAT_CATEGORIES.includes(value);
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
//#region src/reports/nav.ts
|
|
27
|
+
// src/reports/nav.ts
|
|
29
28
|
const SEQUENCE_PATTERN = /^(.*)-(\d+)$/;
|
|
30
29
|
function splitReceiptNumber(receiptNumber) {
|
|
31
30
|
const match = SEQUENCE_PATTERN.exec(receiptNumber.trim());
|
|
@@ -152,7 +151,6 @@ function describeNavReport(report) {
|
|
|
152
151
|
`Nyugták száma: ${report.numberOfSaleDocument}, módosító/érvénytelenítő bizonylatok száma: ${report.numberOfModifyingDocument}`
|
|
153
152
|
].join("\n");
|
|
154
153
|
}
|
|
155
|
-
//#endregion
|
|
156
154
|
Object.defineProperty(exports, "NAV_VAT_CATEGORIES", {
|
|
157
155
|
enumerable: true,
|
|
158
156
|
get: function() {
|
package/dist/node/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/node/index.ts
|
|
3
3
|
const encoder = new TextEncoder();
|
|
4
4
|
var NodeBodyError = class extends Error {
|
|
5
5
|
name = "NodeBodyError";
|
|
@@ -117,7 +117,6 @@ function toNodeHandler(handler, options = {}) {
|
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
//#endregion
|
|
121
120
|
exports.NodeBodyError = NodeBodyError;
|
|
122
121
|
exports.toNodeHandler = toNodeHandler;
|
|
123
122
|
exports.toWebRequest = toWebRequest;
|
package/dist/node/index.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
-
//#region src/node/index.d.ts
|
|
3
2
|
export type WebRequestHandler = (request: Request) => Response | Promise<Response>;
|
|
4
3
|
export interface NodeRequestLike {
|
|
5
4
|
[Symbol.asyncIterator]?(): AsyncIterator<Uint8Array | string>;
|
|
@@ -31,5 +30,4 @@ export declare class NodeBodyError extends Error {
|
|
|
31
30
|
}
|
|
32
31
|
export declare function toWebRequest(request: IncomingMessage | NodeRequestLike, options?: ToNodeHandlerOptions): Request;
|
|
33
32
|
export declare function writeWebResponse(source: Response, target: ServerResponse | NodeResponseLike): Promise<void>;
|
|
34
|
-
export declare function toNodeHandler(handler: WebRequestHandler, options?: ToNodeHandlerOptions): NodeHandler;
|
|
35
|
-
//#endregion
|
|
33
|
+
export declare function toNodeHandler(handler: WebRequestHandler, options?: ToNodeHandlerOptions): NodeHandler;
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
-
//#region src/node/index.d.ts
|
|
3
2
|
export type WebRequestHandler = (request: Request) => Response | Promise<Response>;
|
|
4
3
|
export interface NodeRequestLike {
|
|
5
4
|
[Symbol.asyncIterator]?(): AsyncIterator<Uint8Array | string>;
|
|
@@ -31,5 +30,4 @@ export declare class NodeBodyError extends Error {
|
|
|
31
30
|
}
|
|
32
31
|
export declare function toWebRequest(request: IncomingMessage | NodeRequestLike, options?: ToNodeHandlerOptions): Request;
|
|
33
32
|
export declare function writeWebResponse(source: Response, target: ServerResponse | NodeResponseLike): Promise<void>;
|
|
34
|
-
export declare function toNodeHandler(handler: WebRequestHandler, options?: ToNodeHandlerOptions): NodeHandler;
|
|
35
|
-
//#endregion
|
|
33
|
+
export declare function toNodeHandler(handler: WebRequestHandler, options?: ToNodeHandlerOptions): NodeHandler;
|
package/dist/node/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/node/index.ts
|
|
2
2
|
const encoder = new TextEncoder();
|
|
3
3
|
var NodeBodyError = class extends Error {
|
|
4
4
|
name = "NodeBodyError";
|
|
@@ -116,5 +116,4 @@ function toNodeHandler(handler, options = {}) {
|
|
|
116
116
|
}
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
-
//#endregion
|
|
120
119
|
export { NodeBodyError, toNodeHandler, toWebRequest, writeWebResponse };
|
package/dist/observe/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_crypto = require("../crypto-
|
|
3
|
-
|
|
2
|
+
const require_crypto = require("../crypto-B0PAHKJB.cjs");
|
|
3
|
+
// src/observe/metrics.ts
|
|
4
4
|
const DEFAULT_DURATION_BUCKETS_MS = [
|
|
5
5
|
50,
|
|
6
6
|
100,
|
|
@@ -105,8 +105,7 @@ function createMetricsRegistry(buckets = DEFAULT_DURATION_BUCKETS_MS) {
|
|
|
105
105
|
}
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
-
|
|
109
|
-
//#region src/observe/observe.ts
|
|
108
|
+
// src/observe/observe.ts
|
|
110
109
|
const SPAN_STATUS_OK = 1;
|
|
111
110
|
const SPAN_STATUS_ERROR = 2;
|
|
112
111
|
const MAX_OPEN_SPANS = 1e3;
|
|
@@ -300,7 +299,6 @@ function combineHooks(...hooks) {
|
|
|
300
299
|
if (mode !== void 0) combined.onDocumentError = mode;
|
|
301
300
|
return combined;
|
|
302
301
|
}
|
|
303
|
-
//#endregion
|
|
304
302
|
exports.DEFAULT_DURATION_BUCKETS_MS = DEFAULT_DURATION_BUCKETS_MS;
|
|
305
303
|
exports.MAX_OPEN_SPANS = MAX_OPEN_SPANS;
|
|
306
304
|
exports.METRIC_HELP = METRIC_HELP;
|
package/dist/observe/index.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { c as SzamlazzHooks } from "../context-
|
|
2
|
-
//#region src/observe/metrics.d.ts
|
|
1
|
+
import { c as SzamlazzHooks } from "../context-PwqY4JOK.cjs";
|
|
3
2
|
type MetricLabels = Readonly<Record<string, string>>;
|
|
4
3
|
interface Metrics {
|
|
5
4
|
counter(name: string, labels?: MetricLabels, value?: number): void;
|
|
@@ -12,8 +11,6 @@ interface MetricsRegistry extends Metrics {
|
|
|
12
11
|
export declare const DEFAULT_DURATION_BUCKETS_MS: readonly number[];
|
|
13
12
|
export declare const METRIC_HELP: Readonly<Record<string, string>>;
|
|
14
13
|
export declare function createMetricsRegistry(buckets?: readonly number[]): MetricsRegistry;
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region src/observe/observe.d.ts
|
|
17
14
|
type LogMethod = (data: Readonly<Record<string, unknown>>, message: string) => void;
|
|
18
15
|
interface ObserveLogger {
|
|
19
16
|
readonly debug?: LogMethod | undefined;
|
|
@@ -49,5 +46,4 @@ export declare const SPAN_STATUS_ERROR = 2;
|
|
|
49
46
|
export declare const MAX_OPEN_SPANS = 1e3;
|
|
50
47
|
export declare function observe(options?: ObserveOptions): SzamlazzHooks;
|
|
51
48
|
export declare function combineHooks(...hooks: readonly (SzamlazzHooks | undefined)[]): SzamlazzHooks;
|
|
52
|
-
//#endregion
|
|
53
49
|
export type { LogMethod, MetricLabels, Metrics, MetricsRegistry, ObserveLogger, ObserveOptions, ObserveSpan, ObserveTracer, SpanAttributeValue };
|
package/dist/observe/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { c as SzamlazzHooks } from "../context-
|
|
2
|
-
//#region src/observe/metrics.d.ts
|
|
1
|
+
import { c as SzamlazzHooks } from "../context-BuX6Eion.js";
|
|
3
2
|
type MetricLabels = Readonly<Record<string, string>>;
|
|
4
3
|
interface Metrics {
|
|
5
4
|
counter(name: string, labels?: MetricLabels, value?: number): void;
|
|
@@ -12,8 +11,6 @@ interface MetricsRegistry extends Metrics {
|
|
|
12
11
|
export declare const DEFAULT_DURATION_BUCKETS_MS: readonly number[];
|
|
13
12
|
export declare const METRIC_HELP: Readonly<Record<string, string>>;
|
|
14
13
|
export declare function createMetricsRegistry(buckets?: readonly number[]): MetricsRegistry;
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region src/observe/observe.d.ts
|
|
17
14
|
type LogMethod = (data: Readonly<Record<string, unknown>>, message: string) => void;
|
|
18
15
|
interface ObserveLogger {
|
|
19
16
|
readonly debug?: LogMethod | undefined;
|
|
@@ -49,5 +46,4 @@ export declare const SPAN_STATUS_ERROR = 2;
|
|
|
49
46
|
export declare const MAX_OPEN_SPANS = 1e3;
|
|
50
47
|
export declare function observe(options?: ObserveOptions): SzamlazzHooks;
|
|
51
48
|
export declare function combineHooks(...hooks: readonly (SzamlazzHooks | undefined)[]): SzamlazzHooks;
|
|
52
|
-
//#endregion
|
|
53
49
|
export type { LogMethod, MetricLabels, Metrics, MetricsRegistry, ObserveLogger, ObserveOptions, ObserveSpan, ObserveTracer, SpanAttributeValue };
|
package/dist/observe/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as hmacHex } from "../crypto-
|
|
2
|
-
|
|
1
|
+
import { i as hmacHex } from "../crypto-BqGn_oGu.js";
|
|
2
|
+
// src/observe/metrics.ts
|
|
3
3
|
const DEFAULT_DURATION_BUCKETS_MS = [
|
|
4
4
|
50,
|
|
5
5
|
100,
|
|
@@ -104,8 +104,7 @@ function createMetricsRegistry(buckets = DEFAULT_DURATION_BUCKETS_MS) {
|
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
-
|
|
108
|
-
//#region src/observe/observe.ts
|
|
107
|
+
// src/observe/observe.ts
|
|
109
108
|
const SPAN_STATUS_OK = 1;
|
|
110
109
|
const SPAN_STATUS_ERROR = 2;
|
|
111
110
|
const MAX_OPEN_SPANS = 1e3;
|
|
@@ -299,5 +298,4 @@ function combineHooks(...hooks) {
|
|
|
299
298
|
if (mode !== void 0) combined.onDocumentError = mode;
|
|
300
299
|
return combined;
|
|
301
300
|
}
|
|
302
|
-
//#endregion
|
|
303
301
|
export { DEFAULT_DURATION_BUCKETS_MS, MAX_OPEN_SPANS, METRIC_HELP, SPAN_STATUS_ERROR, SPAN_STATUS_OK, combineHooks, createMetricsRegistry, observe };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_errors = require("./errors-
|
|
2
|
-
|
|
1
|
+
const require_errors = require("./errors-Bn6pe6yw.cjs");
|
|
2
|
+
// src/core/once.ts
|
|
3
3
|
const DEFAULT_RECOVERY_DELAY_MS = 1e3;
|
|
4
4
|
const UNCERTAIN_CATEGORIES = /* @__PURE__ */ new Set([
|
|
5
5
|
"network",
|
|
@@ -70,7 +70,6 @@ function unknownOutcomeError(error, reference, options = {}) {
|
|
|
70
70
|
cause: error
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
//#endregion
|
|
74
73
|
Object.defineProperty(exports, "DEFAULT_RECOVERY_DELAY_MS", {
|
|
75
74
|
enumerable: true,
|
|
76
75
|
get: function() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as SzamlazzError } from "./errors-
|
|
2
|
-
|
|
1
|
+
import { r as SzamlazzError } from "./errors-CGGsW0Y5.js";
|
|
2
|
+
// src/core/once.ts
|
|
3
3
|
const DEFAULT_RECOVERY_DELAY_MS = 1e3;
|
|
4
4
|
const UNCERTAIN_CATEGORIES = /* @__PURE__ */ new Set([
|
|
5
5
|
"network",
|
|
@@ -70,5 +70,4 @@ function unknownOutcomeError(error, reference, options = {}) {
|
|
|
70
70
|
cause: error
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
//#endregion
|
|
74
73
|
export { unknownOutcomeError as a, resolveRecoveryDelay as i, isUncertainOutcome as n, recoverAfterFailure as r, DEFAULT_RECOVERY_DELAY_MS as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as createAgentError, r as SzamlazzError, s as parseErrorCode } from "./errors-
|
|
2
|
-
import { a as isPdf, r as decodeUtf8, t as base64ToBytes } from "./binary-
|
|
3
|
-
import { c as childNumber, d as findChildren, f as parseXml, l as childText, s as childBoolean, u as findChild } from "./serialize-
|
|
4
|
-
|
|
1
|
+
import { i as createAgentError, r as SzamlazzError, s as parseErrorCode } from "./errors-CGGsW0Y5.js";
|
|
2
|
+
import { a as isPdf, r as decodeUtf8, t as base64ToBytes } from "./binary-DuKBSfH-.js";
|
|
3
|
+
import { c as childNumber, d as findChildren, f as parseXml, l as childText, s as childBoolean, u as findChild } from "./serialize-CjymGkJj.js";
|
|
4
|
+
// src/core/response.ts
|
|
5
5
|
function createAgentResponse(action, status, headers, body) {
|
|
6
6
|
let cachedText;
|
|
7
7
|
return {
|
|
@@ -155,8 +155,7 @@ function throwIfAnyError(response) {
|
|
|
155
155
|
throwIfTextError(response);
|
|
156
156
|
throwIfHttpError(response);
|
|
157
157
|
}
|
|
158
|
-
|
|
159
|
-
//#region src/receipts/parse.ts
|
|
158
|
+
// src/receipts/parse.ts
|
|
160
159
|
function requiredText(element, name, response) {
|
|
161
160
|
const value = childText(element, name);
|
|
162
161
|
if (value === void 0) throw unexpectedResponse(response, `Hiányzik a(z) <${name}> elem a nyugta válaszból.`);
|
|
@@ -287,5 +286,4 @@ function parseReceiptResponse(response) {
|
|
|
287
286
|
}
|
|
288
287
|
return parseReceiptXml(root, response);
|
|
289
288
|
}
|
|
290
|
-
//#endregion
|
|
291
289
|
export { looksLikeXml as a, readDocumentHeaders as c, throwIfHeaderError as d, throwIfHttpError as f, unexpectedResponse as h, decodeHeaderValue as i, readHeader as l, throwIfXmlFailure as m, parseReceiptResponse as n, parseDoneText as o, throwIfTextError as p, createAgentResponse as r, parseResponseXml as s, parseReceiptElement as t, throwIfAnyError as u };
|