kassza 0.18.0 → 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-B9guio75.cjs → server-BZ-ySQGx.cjs} +23 -35
- package/dist/{server-yx9eG_8p.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
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
const require_create_once = require("./create-once-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_binary = require("./binary-
|
|
4
|
-
const require_serialize = require("./serialize-
|
|
5
|
-
const require_parse = require("./parse-
|
|
6
|
-
const require_session = require("./session-
|
|
7
|
-
const require_warnings = require("./warnings-
|
|
8
|
-
const require_issue = require("./issue-
|
|
9
|
-
const require_vat = require("./vat-
|
|
10
|
-
const require_money = require("./money-
|
|
11
|
-
const require_reference = require("./reference-
|
|
12
|
-
const require_get = require("./get-
|
|
13
|
-
const require_create = require("./create-
|
|
14
|
-
|
|
1
|
+
const require_create_once = require("./create-once-zeF7GVVP.cjs");
|
|
2
|
+
const require_errors = require("./errors-Bn6pe6yw.cjs");
|
|
3
|
+
const require_binary = require("./binary-CdpKlNNI.cjs");
|
|
4
|
+
const require_serialize = require("./serialize-DEU7r6Bk.cjs");
|
|
5
|
+
const require_parse = require("./parse-CmM5va-p.cjs");
|
|
6
|
+
const require_session = require("./session-BYotpR_s.cjs");
|
|
7
|
+
const require_warnings = require("./warnings-ciSzK6Jc.cjs");
|
|
8
|
+
const require_issue = require("./issue-DReARZnF.cjs");
|
|
9
|
+
const require_vat = require("./vat-BkoiiKm4.cjs");
|
|
10
|
+
const require_money = require("./money-NtVytaxG.cjs");
|
|
11
|
+
const require_reference = require("./reference-DoY12fc1.cjs");
|
|
12
|
+
const require_get = require("./get-DFhT7kOp.cjs");
|
|
13
|
+
const require_create = require("./create-DH5jiZPA.cjs");
|
|
14
|
+
// src/core/attempt-ledger.ts
|
|
15
15
|
const ATTEMPT_LEDGER_TTL_SECONDS = 86400;
|
|
16
16
|
const ATTEMPT_LEDGER_KEY_PREFIX = "szamlazz:attempts:";
|
|
17
17
|
const COUNTED_CATEGORIES = /* @__PURE__ */ new Set([
|
|
@@ -431,8 +431,7 @@ function createAgentContext(options = {}) {
|
|
|
431
431
|
resetAttempts
|
|
432
432
|
};
|
|
433
433
|
}
|
|
434
|
-
|
|
435
|
-
//#region src/invoices/create-response.ts
|
|
434
|
+
// src/invoices/create-response.ts
|
|
436
435
|
function readRawResponse(response) {
|
|
437
436
|
require_parse.throwIfAnyError(response);
|
|
438
437
|
const headers = require_parse.readDocumentHeaders(response.headers);
|
|
@@ -501,8 +500,7 @@ function parseInvoicePreviewResponse(response, items = []) {
|
|
|
501
500
|
items
|
|
502
501
|
};
|
|
503
502
|
}
|
|
504
|
-
|
|
505
|
-
//#region src/invoices/create-xml.ts
|
|
503
|
+
// src/invoices/create-xml.ts
|
|
506
504
|
const INVOICE_XML_NAMESPACE = "http://www.szamlazz.hu/xmlszamla";
|
|
507
505
|
const INVOICE_XML_SCHEMA_LOCATION = "https://www.szamlazz.hu/szamla/docs/xsds/agent/xmlszamla.xsd";
|
|
508
506
|
const RESPONSE_VERSION_XML = 2;
|
|
@@ -687,8 +685,7 @@ function renderInvoiceXml(credentials, invoice, options = {}) {
|
|
|
687
685
|
function buildCreateInvoiceXml(credentials, defaults, input, now = /* @__PURE__ */ new Date()) {
|
|
688
686
|
return renderInvoiceXml(credentials, require_create_once.resolveInvoice(defaults, input, now));
|
|
689
687
|
}
|
|
690
|
-
|
|
691
|
-
//#region src/invoices/create.ts
|
|
688
|
+
// src/invoices/create.ts
|
|
692
689
|
function buildRequest(ctx, invoice, preview, options) {
|
|
693
690
|
const xml = renderInvoiceXml(ctx.credentials, invoice, { preview });
|
|
694
691
|
const attachments = preview ? [] : invoice.attachments;
|
|
@@ -712,8 +709,7 @@ async function previewInvoice(ctx, defaults, input, options = {}) {
|
|
|
712
709
|
const items = itemsOf(invoice);
|
|
713
710
|
return ctx.execute(buildRequest(ctx, invoice, true, options), (response) => parseInvoicePreviewResponse(response, items));
|
|
714
711
|
}
|
|
715
|
-
|
|
716
|
-
//#region src/invoices/pdf.ts
|
|
712
|
+
// src/invoices/pdf.ts
|
|
717
713
|
function buildInvoicePdfXml(credentials, reference) {
|
|
718
714
|
const resolved = require_reference.resolveInvoiceReference(reference);
|
|
719
715
|
return require_serialize.buildXmlDocument({
|
|
@@ -867,8 +863,7 @@ async function reverseInvoice(ctx, input, options = {}) {
|
|
|
867
863
|
signal: options.signal
|
|
868
864
|
}, (response) => parseReverseInvoiceResponse(response, invoiceNumber));
|
|
869
865
|
}
|
|
870
|
-
|
|
871
|
-
//#region src/receipts/get.ts
|
|
866
|
+
// src/receipts/get.ts
|
|
872
867
|
const GET_RECEIPT_NAMESPACE = "http://www.szamlazz.hu/xmlnyugtaget";
|
|
873
868
|
function normalizeInput$1(input) {
|
|
874
869
|
return typeof input === "string" ? { receiptNumber: input } : input;
|
|
@@ -907,8 +902,7 @@ function getReceipt(ctx, input, options = {}) {
|
|
|
907
902
|
safeToRetry: true
|
|
908
903
|
}, require_parse.parseReceiptResponse);
|
|
909
904
|
}
|
|
910
|
-
|
|
911
|
-
//#region src/receipts/reverse.ts
|
|
905
|
+
// src/receipts/reverse.ts
|
|
912
906
|
const REVERSE_RECEIPT_NAMESPACE = "http://www.szamlazz.hu/xmlnyugtast";
|
|
913
907
|
function normalizeInput(input) {
|
|
914
908
|
return typeof input === "string" ? { receiptNumber: input } : input;
|
|
@@ -936,8 +930,7 @@ function reverseReceipt(ctx, input, options = {}) {
|
|
|
936
930
|
safeToRetry: require_create.optionalText(normalized.callId) !== void 0
|
|
937
931
|
}, require_parse.parseReceiptResponse);
|
|
938
932
|
}
|
|
939
|
-
|
|
940
|
-
//#region src/receipts/send.ts
|
|
933
|
+
// src/receipts/send.ts
|
|
941
934
|
const SEND_RECEIPT_NAMESPACE = "http://www.szamlazz.hu/xmlnyugtasend";
|
|
942
935
|
const EMAIL_PATTERN = /^[^\s@,;<>]+@[^\s@,;<>]+\.[^\s@,;<>]+$/;
|
|
943
936
|
function isValidEmail(value) {
|
|
@@ -996,8 +989,7 @@ function sendReceipt(ctx, input, options = {}) {
|
|
|
996
989
|
signal: options.signal
|
|
997
990
|
}, parseSendReceiptResponse);
|
|
998
991
|
}
|
|
999
|
-
|
|
1000
|
-
//#region src/taxpayer/address.ts
|
|
992
|
+
// src/taxpayer/address.ts
|
|
1001
993
|
const ROMAN_NUMERAL = /^[IVX]{1,5}\.?$/;
|
|
1002
994
|
function isShouting(value) {
|
|
1003
995
|
return value === value.toUpperCase() && value !== value.toLowerCase();
|
|
@@ -1075,8 +1067,7 @@ function parseTaxpayerAddress(item) {
|
|
|
1075
1067
|
raw
|
|
1076
1068
|
};
|
|
1077
1069
|
}
|
|
1078
|
-
|
|
1079
|
-
//#region src/taxpayer/query-taxpayer.ts
|
|
1070
|
+
// src/taxpayer/query-taxpayer.ts
|
|
1080
1071
|
const TAXPAYER_NAMESPACE = "http://www.szamlazz.hu/xmltaxpayer";
|
|
1081
1072
|
const TAXPAYER_SCHEMA_LOCATION = "http://www.szamlazz.hu/docs/xsds/agent/xmltaxpayer.xsd";
|
|
1082
1073
|
function toTaxpayerId(taxNumber) {
|
|
@@ -1169,8 +1160,7 @@ async function queryTaxpayer(ctx, taxNumber, options = {}) {
|
|
|
1169
1160
|
safeToRetry: true
|
|
1170
1161
|
}, parseQueryTaxpayerResponse);
|
|
1171
1162
|
}
|
|
1172
|
-
|
|
1173
|
-
//#region src/taxpayer/cache.ts
|
|
1163
|
+
// src/taxpayer/cache.ts
|
|
1174
1164
|
const TAXPAYER_CACHE_KEY_PREFIX = "szamlazz:taxpayer:";
|
|
1175
1165
|
const DEFAULT_TAXPAYER_TTL_SECONDS = 86400;
|
|
1176
1166
|
const DEFAULT_TAXPAYER_INVALID_TTL_SECONDS = 600;
|
|
@@ -1217,8 +1207,7 @@ function cachedTaxpayerQuery(query, options, warn) {
|
|
|
1217
1207
|
return info;
|
|
1218
1208
|
};
|
|
1219
1209
|
}
|
|
1220
|
-
|
|
1221
|
-
//#region src/client.ts
|
|
1210
|
+
// src/client.ts
|
|
1222
1211
|
const CREDENTIAL_PROBE_INVOICE_NUMBER = "KASSZA-CREDENTIAL-PROBE-0";
|
|
1223
1212
|
async function nullIfNotFound(promise) {
|
|
1224
1213
|
try {
|
|
@@ -1384,7 +1373,6 @@ function createKassza(options = {}) {
|
|
|
1384
1373
|
}, payment, issueOptions)
|
|
1385
1374
|
};
|
|
1386
1375
|
}
|
|
1387
|
-
//#endregion
|
|
1388
1376
|
Object.defineProperty(exports, "ATTEMPT_LEDGER_KEY_PREFIX", {
|
|
1389
1377
|
enumerable: true,
|
|
1390
1378
|
get: function() {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { a as registerPayment, c as resolveInvoice, d as TAXPAYER_TYPE_CODES, f as KASSZA_AGGREGATOR, g as AGENT_ACTIONS, i as clearPayments, m as emitDocumentEvent, o as optionalAgentDate, r as registerPaymentOnce, s as presentText, t as createReceiptOnce, u as INVOICE_TEMPLATES } from "./create-once-
|
|
2
|
-
import { i as createAgentError, o as isSzamlazzError, r as SzamlazzError, s as parseErrorCode } from "./errors-
|
|
3
|
-
import { t as base64ToBytes } from "./binary-
|
|
4
|
-
import { a as optionalEl, c as childNumber, d as findChildren, l as childText, n as buildXmlDocument, r as el, s as childBoolean, u as findChild } from "./serialize-
|
|
5
|
-
import { a as looksLikeXml, c as readDocumentHeaders, d as throwIfHeaderError, f as throwIfHttpError, h as unexpectedResponse, m as throwIfXmlFailure, n as parseReceiptResponse, o as parseDoneText, p as throwIfTextError, r as createAgentResponse, s as parseResponseXml, u as throwIfAnyError } from "./parse-
|
|
6
|
-
import { i as sessionKeyFor, n as memoryCookieStore, r as mergeSetCookies, t as SESSION_TTL_SECONDS } from "./session-
|
|
7
|
-
import { t as emitWarning } from "./warnings-
|
|
8
|
-
import { l as createInvoiceOnce, m as guardOnce, n as issueForPayment, o as convertReceiptToInvoice } from "./issue-
|
|
9
|
-
import { r as formatVatRate } from "./vat-
|
|
10
|
-
import { a as summarizeItems } from "./money-
|
|
11
|
-
import { a as optionalText, c as requireText, i as optionalAgentDate$1, l as resolveInvoiceReference, o as parseInvoiceResult, s as referenceValue, t as AGENT_XSD_BASE_URL, u as validationError } from "./reference-
|
|
12
|
-
import { t as getInvoice } from "./get-
|
|
13
|
-
import { a as optionalText$1, c as validateTemplate$1, i as RECEIPT_XSD_BASE_URL, o as receiptValidationError, r as createReceipt, s as requireReceiptNumber } from "./create-
|
|
14
|
-
|
|
1
|
+
import { a as registerPayment, c as resolveInvoice, d as TAXPAYER_TYPE_CODES, f as KASSZA_AGGREGATOR, g as AGENT_ACTIONS, i as clearPayments, m as emitDocumentEvent, o as optionalAgentDate, r as registerPaymentOnce, s as presentText, t as createReceiptOnce, u as INVOICE_TEMPLATES } from "./create-once-B6cAXyET.js";
|
|
2
|
+
import { i as createAgentError, o as isSzamlazzError, r as SzamlazzError, s as parseErrorCode } from "./errors-CGGsW0Y5.js";
|
|
3
|
+
import { t as base64ToBytes } from "./binary-DuKBSfH-.js";
|
|
4
|
+
import { a as optionalEl, c as childNumber, d as findChildren, l as childText, n as buildXmlDocument, r as el, s as childBoolean, u as findChild } from "./serialize-CjymGkJj.js";
|
|
5
|
+
import { a as looksLikeXml, c as readDocumentHeaders, d as throwIfHeaderError, f as throwIfHttpError, h as unexpectedResponse, m as throwIfXmlFailure, n as parseReceiptResponse, o as parseDoneText, p as throwIfTextError, r as createAgentResponse, s as parseResponseXml, u as throwIfAnyError } from "./parse-1RiSh4vY.js";
|
|
6
|
+
import { i as sessionKeyFor, n as memoryCookieStore, r as mergeSetCookies, t as SESSION_TTL_SECONDS } from "./session-DZeE1ryt.js";
|
|
7
|
+
import { t as emitWarning } from "./warnings-DJ0QvZOp.js";
|
|
8
|
+
import { l as createInvoiceOnce, m as guardOnce, n as issueForPayment, o as convertReceiptToInvoice } from "./issue-Dy9zvRK1.js";
|
|
9
|
+
import { r as formatVatRate } from "./vat-B4J5Q0tu.js";
|
|
10
|
+
import { a as summarizeItems } from "./money-f280VT77.js";
|
|
11
|
+
import { a as optionalText, c as requireText, i as optionalAgentDate$1, l as resolveInvoiceReference, o as parseInvoiceResult, s as referenceValue, t as AGENT_XSD_BASE_URL, u as validationError } from "./reference-Cxz0m2zF.js";
|
|
12
|
+
import { t as getInvoice } from "./get-HrHwVkVt.js";
|
|
13
|
+
import { a as optionalText$1, c as validateTemplate$1, i as RECEIPT_XSD_BASE_URL, o as receiptValidationError, r as createReceipt, s as requireReceiptNumber } from "./create-BwRslos0.js";
|
|
14
|
+
// src/core/attempt-ledger.ts
|
|
15
15
|
const ATTEMPT_LEDGER_TTL_SECONDS = 86400;
|
|
16
16
|
const ATTEMPT_LEDGER_KEY_PREFIX = "szamlazz:attempts:";
|
|
17
17
|
const COUNTED_CATEGORIES = /* @__PURE__ */ new Set([
|
|
@@ -431,8 +431,7 @@ function createAgentContext(options = {}) {
|
|
|
431
431
|
resetAttempts
|
|
432
432
|
};
|
|
433
433
|
}
|
|
434
|
-
|
|
435
|
-
//#region src/invoices/create-response.ts
|
|
434
|
+
// src/invoices/create-response.ts
|
|
436
435
|
function readRawResponse(response) {
|
|
437
436
|
throwIfAnyError(response);
|
|
438
437
|
const headers = readDocumentHeaders(response.headers);
|
|
@@ -501,8 +500,7 @@ function parseInvoicePreviewResponse(response, items = []) {
|
|
|
501
500
|
items
|
|
502
501
|
};
|
|
503
502
|
}
|
|
504
|
-
|
|
505
|
-
//#region src/invoices/create-xml.ts
|
|
503
|
+
// src/invoices/create-xml.ts
|
|
506
504
|
const INVOICE_XML_NAMESPACE = "http://www.szamlazz.hu/xmlszamla";
|
|
507
505
|
const INVOICE_XML_SCHEMA_LOCATION = "https://www.szamlazz.hu/szamla/docs/xsds/agent/xmlszamla.xsd";
|
|
508
506
|
const RESPONSE_VERSION_XML = 2;
|
|
@@ -687,8 +685,7 @@ function renderInvoiceXml(credentials, invoice, options = {}) {
|
|
|
687
685
|
function buildCreateInvoiceXml(credentials, defaults, input, now = /* @__PURE__ */ new Date()) {
|
|
688
686
|
return renderInvoiceXml(credentials, resolveInvoice(defaults, input, now));
|
|
689
687
|
}
|
|
690
|
-
|
|
691
|
-
//#region src/invoices/create.ts
|
|
688
|
+
// src/invoices/create.ts
|
|
692
689
|
function buildRequest(ctx, invoice, preview, options) {
|
|
693
690
|
const xml = renderInvoiceXml(ctx.credentials, invoice, { preview });
|
|
694
691
|
const attachments = preview ? [] : invoice.attachments;
|
|
@@ -712,8 +709,7 @@ async function previewInvoice(ctx, defaults, input, options = {}) {
|
|
|
712
709
|
const items = itemsOf(invoice);
|
|
713
710
|
return ctx.execute(buildRequest(ctx, invoice, true, options), (response) => parseInvoicePreviewResponse(response, items));
|
|
714
711
|
}
|
|
715
|
-
|
|
716
|
-
//#region src/invoices/pdf.ts
|
|
712
|
+
// src/invoices/pdf.ts
|
|
717
713
|
function buildInvoicePdfXml(credentials, reference) {
|
|
718
714
|
const resolved = resolveInvoiceReference(reference);
|
|
719
715
|
return buildXmlDocument({
|
|
@@ -867,8 +863,7 @@ async function reverseInvoice(ctx, input, options = {}) {
|
|
|
867
863
|
signal: options.signal
|
|
868
864
|
}, (response) => parseReverseInvoiceResponse(response, invoiceNumber));
|
|
869
865
|
}
|
|
870
|
-
|
|
871
|
-
//#region src/receipts/get.ts
|
|
866
|
+
// src/receipts/get.ts
|
|
872
867
|
const GET_RECEIPT_NAMESPACE = "http://www.szamlazz.hu/xmlnyugtaget";
|
|
873
868
|
function normalizeInput$1(input) {
|
|
874
869
|
return typeof input === "string" ? { receiptNumber: input } : input;
|
|
@@ -907,8 +902,7 @@ function getReceipt(ctx, input, options = {}) {
|
|
|
907
902
|
safeToRetry: true
|
|
908
903
|
}, parseReceiptResponse);
|
|
909
904
|
}
|
|
910
|
-
|
|
911
|
-
//#region src/receipts/reverse.ts
|
|
905
|
+
// src/receipts/reverse.ts
|
|
912
906
|
const REVERSE_RECEIPT_NAMESPACE = "http://www.szamlazz.hu/xmlnyugtast";
|
|
913
907
|
function normalizeInput(input) {
|
|
914
908
|
return typeof input === "string" ? { receiptNumber: input } : input;
|
|
@@ -936,8 +930,7 @@ function reverseReceipt(ctx, input, options = {}) {
|
|
|
936
930
|
safeToRetry: optionalText$1(normalized.callId) !== void 0
|
|
937
931
|
}, parseReceiptResponse);
|
|
938
932
|
}
|
|
939
|
-
|
|
940
|
-
//#region src/receipts/send.ts
|
|
933
|
+
// src/receipts/send.ts
|
|
941
934
|
const SEND_RECEIPT_NAMESPACE = "http://www.szamlazz.hu/xmlnyugtasend";
|
|
942
935
|
const EMAIL_PATTERN = /^[^\s@,;<>]+@[^\s@,;<>]+\.[^\s@,;<>]+$/;
|
|
943
936
|
function isValidEmail(value) {
|
|
@@ -996,8 +989,7 @@ function sendReceipt(ctx, input, options = {}) {
|
|
|
996
989
|
signal: options.signal
|
|
997
990
|
}, parseSendReceiptResponse);
|
|
998
991
|
}
|
|
999
|
-
|
|
1000
|
-
//#region src/taxpayer/address.ts
|
|
992
|
+
// src/taxpayer/address.ts
|
|
1001
993
|
const ROMAN_NUMERAL = /^[IVX]{1,5}\.?$/;
|
|
1002
994
|
function isShouting(value) {
|
|
1003
995
|
return value === value.toUpperCase() && value !== value.toLowerCase();
|
|
@@ -1075,8 +1067,7 @@ function parseTaxpayerAddress(item) {
|
|
|
1075
1067
|
raw
|
|
1076
1068
|
};
|
|
1077
1069
|
}
|
|
1078
|
-
|
|
1079
|
-
//#region src/taxpayer/query-taxpayer.ts
|
|
1070
|
+
// src/taxpayer/query-taxpayer.ts
|
|
1080
1071
|
const TAXPAYER_NAMESPACE = "http://www.szamlazz.hu/xmltaxpayer";
|
|
1081
1072
|
const TAXPAYER_SCHEMA_LOCATION = "http://www.szamlazz.hu/docs/xsds/agent/xmltaxpayer.xsd";
|
|
1082
1073
|
function toTaxpayerId(taxNumber) {
|
|
@@ -1169,8 +1160,7 @@ async function queryTaxpayer(ctx, taxNumber, options = {}) {
|
|
|
1169
1160
|
safeToRetry: true
|
|
1170
1161
|
}, parseQueryTaxpayerResponse);
|
|
1171
1162
|
}
|
|
1172
|
-
|
|
1173
|
-
//#region src/taxpayer/cache.ts
|
|
1163
|
+
// src/taxpayer/cache.ts
|
|
1174
1164
|
const TAXPAYER_CACHE_KEY_PREFIX = "szamlazz:taxpayer:";
|
|
1175
1165
|
const DEFAULT_TAXPAYER_TTL_SECONDS = 86400;
|
|
1176
1166
|
const DEFAULT_TAXPAYER_INVALID_TTL_SECONDS = 600;
|
|
@@ -1217,8 +1207,7 @@ function cachedTaxpayerQuery(query, options, warn) {
|
|
|
1217
1207
|
return info;
|
|
1218
1208
|
};
|
|
1219
1209
|
}
|
|
1220
|
-
|
|
1221
|
-
//#region src/client.ts
|
|
1210
|
+
// src/client.ts
|
|
1222
1211
|
const CREDENTIAL_PROBE_INVOICE_NUMBER = "KASSZA-CREDENTIAL-PROBE-0";
|
|
1223
1212
|
async function nullIfNotFound(promise) {
|
|
1224
1213
|
try {
|
|
@@ -1384,5 +1373,4 @@ function createKassza(options = {}) {
|
|
|
1384
1373
|
}, payment, issueOptions)
|
|
1385
1374
|
};
|
|
1386
1375
|
}
|
|
1387
|
-
//#endregion
|
|
1388
1376
|
export { queryTaxpayer as a, createAgentContext as c, attemptLedgerKey as d, TAXPAYER_CACHE_KEY_PREFIX as i, ATTEMPT_LEDGER_KEY_PREFIX as l, DEFAULT_TAXPAYER_INVALID_TTL_SECONDS as n, getInvoicePdf as o, DEFAULT_TAXPAYER_TTL_SECONDS as r, buildCreateInvoiceXml as s, createKassza as t, ATTEMPT_LEDGER_TTL_SECONDS as u };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { t as DateInput } from "./dates-
|
|
2
|
-
import { a as AgentAction, r as WarningHook, t as KasszaWarning } from "./warnings-
|
|
3
|
-
import { n as KeyValueStore } from "./store-
|
|
4
|
-
import { d as ItemAmounts, f as ItemPriceInput } from "./index-
|
|
5
|
-
import { r as Receipt } from "./types-
|
|
6
|
-
import { t as CookieStore } from "./session-
|
|
7
|
-
//#region src/core/errors.d.ts
|
|
1
|
+
import { t as DateInput } from "./dates-nlGEokCf.js";
|
|
2
|
+
import { a as AgentAction, r as WarningHook, t as KasszaWarning } from "./warnings-DpuYhn39.js";
|
|
3
|
+
import { n as KeyValueStore } from "./store-BkaZ8qkU.js";
|
|
4
|
+
import { d as ItemAmounts, f as ItemPriceInput } from "./index-CinpAhQM.js";
|
|
5
|
+
import { r as Receipt } from "./types-Z6rQoqHn.js";
|
|
6
|
+
import { t as CookieStore } from "./session-mKtpAeUB.js";
|
|
8
7
|
type SzamlazzErrorCategory = "auth" | "account" | "validation" | "duplicate" | "partial_success" | "not_found" | "maintenance" | "rate_limit" | "attempt_limit" | "in_progress" | "store_unavailable" | "network" | "timeout" | "configuration" | "unexpected_response" | "unknown";
|
|
9
8
|
interface AgentErrorCodeInfo {
|
|
10
9
|
readonly message: string;
|
|
@@ -41,8 +40,6 @@ declare class SzamlazzError extends Error {
|
|
|
41
40
|
}
|
|
42
41
|
declare function isSzamlazzError(error: unknown): error is SzamlazzError;
|
|
43
42
|
declare function suggestedPrefix(error: unknown): string | undefined;
|
|
44
|
-
//#endregion
|
|
45
|
-
//#region src/core/attempt-ledger.d.ts
|
|
46
43
|
declare const ATTEMPT_LEDGER_TTL_SECONDS = 86400;
|
|
47
44
|
declare const ATTEMPT_LEDGER_KEY_PREFIX = "szamlazz:attempts:";
|
|
48
45
|
interface AttemptLedgerRequest {
|
|
@@ -55,8 +52,6 @@ interface AttemptLedgerRequest {
|
|
|
55
52
|
}
|
|
56
53
|
declare function attemptLedgerKey(request: AttemptLedgerRequest): Promise<string>;
|
|
57
54
|
type AttemptLedgerMode = "fail-open" | "fail-closed";
|
|
58
|
-
//#endregion
|
|
59
|
-
//#region src/invoices/create-types.d.ts
|
|
60
55
|
type InvoiceType = "invoice" | "proforma" | "advance" | "final" | "corrective" | "deliveryNote";
|
|
61
56
|
declare const INVOICE_LANGUAGES: readonly ["hu", "en", "de", "it", "ro", "sk", "hr", "fr", "es", "cz", "pl", "bg", "nl", "ru", "si"];
|
|
62
57
|
type InvoiceLanguage = (typeof INVOICE_LANGUAGES)[number];
|
|
@@ -243,8 +238,6 @@ interface InvoicePreview {
|
|
|
243
238
|
readonly grossTotal: number;
|
|
244
239
|
readonly items: readonly CreatedInvoiceItem[];
|
|
245
240
|
}
|
|
246
|
-
//#endregion
|
|
247
|
-
//#region src/core/response.d.ts
|
|
248
241
|
interface AgentResponse {
|
|
249
242
|
readonly action: AgentAction;
|
|
250
243
|
readonly status: number;
|
|
@@ -253,8 +246,6 @@ interface AgentResponse {
|
|
|
253
246
|
readonly isPdf: boolean;
|
|
254
247
|
text(): string;
|
|
255
248
|
}
|
|
256
|
-
//#endregion
|
|
257
|
-
//#region src/core/xml/serialize.d.ts
|
|
258
249
|
type XmlScalar = string | number | boolean;
|
|
259
250
|
type XmlContent = XmlScalar | null | undefined | readonly XmlChild[];
|
|
260
251
|
type XmlChild = XmlNode | false | null | undefined;
|
|
@@ -264,8 +255,6 @@ interface XmlNode {
|
|
|
264
255
|
readonly content: XmlContent;
|
|
265
256
|
readonly attributes?: XmlAttributes | undefined;
|
|
266
257
|
}
|
|
267
|
-
//#endregion
|
|
268
|
-
//#region src/invoices/payment.d.ts
|
|
269
258
|
interface PaymentEntry {
|
|
270
259
|
readonly date?: DateInput | undefined;
|
|
271
260
|
readonly method: string;
|
|
@@ -296,8 +285,6 @@ interface RegisteredPayment {
|
|
|
296
285
|
readonly outstanding?: number | undefined;
|
|
297
286
|
readonly buyerAccountUrl?: string | undefined;
|
|
298
287
|
}
|
|
299
|
-
//#endregion
|
|
300
|
-
//#region src/invoices/reverse.d.ts
|
|
301
288
|
interface ReverseInvoiceEmail {
|
|
302
289
|
readonly replyTo?: string | undefined;
|
|
303
290
|
readonly subject?: string | undefined;
|
|
@@ -329,8 +316,6 @@ interface ReversedInvoice {
|
|
|
329
316
|
readonly buyerAccountUrl?: string | undefined;
|
|
330
317
|
readonly pdf?: Uint8Array | undefined;
|
|
331
318
|
}
|
|
332
|
-
//#endregion
|
|
333
|
-
//#region src/core/document-events.d.ts
|
|
334
319
|
interface InvoiceCreatedEvent {
|
|
335
320
|
readonly kind: "invoice";
|
|
336
321
|
readonly action: "created";
|
|
@@ -376,8 +361,6 @@ declare class DocumentHookError extends Error {
|
|
|
376
361
|
get document(): DocumentEvent["document"];
|
|
377
362
|
}
|
|
378
363
|
declare function isDocumentHookError(error: unknown): error is DocumentHookError;
|
|
379
|
-
//#endregion
|
|
380
|
-
//#region src/core/context.d.ts
|
|
381
364
|
interface AgentAttachment {
|
|
382
365
|
readonly filename: string;
|
|
383
366
|
readonly content: Uint8Array | ArrayBuffer | Blob | string;
|
|
@@ -445,5 +428,4 @@ interface AgentContext {
|
|
|
445
428
|
resetSession(): Promise<void>;
|
|
446
429
|
resetAttempts(key: string): Promise<void>;
|
|
447
430
|
}
|
|
448
|
-
//#endregion
|
|
449
431
|
export { Waybill as $, CorrectiveInvoiceInput as A, InvoiceLanguage as B, ClearPaymentsInput as C, XmlNode as D, RegisteredPayment as E, Currency as F, InvoiceType as G, InvoicePreview as H, FinalInvoiceInput as I, PickPackPointWaybill as J, ItemLedger as K, InvoiceBuyer as L, CreateInvoiceInput as M, CreatedInvoice as N, AgentResponse as O, CreatedInvoiceItem as P, TransOFlexWaybill as Q, InvoiceDefaults as R, ReversedInvoice as S, RegisterPaymentInput as T, InvoiceSeller as U, InvoicePostalAddress as V, InvoiceTemplate as W, StandardInvoiceInput as X, SprinterWaybill as Y, TaxpayerType as Z, InvoiceReversedEvent as _, AgentRequestEvent as a, AgentErrorCodeInfo as at, isDocumentHookError as b, SzamlazzHooks as c, SzamlazzErrorCategory as ct, DocumentErrorMode as d, suggestedPrefix as dt, ATTEMPT_LEDGER_KEY_PREFIX as et, DocumentEvent as f, InvoicePaymentEvent as g, InvoiceCreatedEvent as h, AgentErrorEvent as i, AGENT_ERROR_CODES as it, CourierService as j, BuyerLedger as k, SzamlazzOptions as l, errorCodeDocsUrl as lt, DocumentHookError as m, AgentCompleteEvent as n, AttemptLedgerMode as nt, AgentResponseEvent as o, KASSZA_ERROR_DOCS_URL as ot, DocumentHook as p, MplWaybill as q, AgentContext as r, attemptLedgerKey as rt, RequestOptions as s, SzamlazzError as st, AgentAttachment as t, ATTEMPT_LEDGER_TTL_SECONDS as tt, DocumentErrorHandler as u, isSzamlazzError as ut, ReceiptCreatedEvent as v, PaymentEntry as w, ReverseInvoiceInput as x, ReceiptReversedEvent as y, InvoiceItemInput as z };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { t as DateInput } from "./dates-
|
|
2
|
-
import { a as AgentAction, r as WarningHook, t as KasszaWarning } from "./warnings-
|
|
3
|
-
import { n as KeyValueStore } from "./store-
|
|
4
|
-
import { d as ItemAmounts, f as ItemPriceInput } from "./index-
|
|
5
|
-
import { r as Receipt } from "./types-
|
|
6
|
-
import { t as CookieStore } from "./session-
|
|
7
|
-
//#region src/core/errors.d.ts
|
|
1
|
+
import { t as DateInput } from "./dates-nlGEokCf.cjs";
|
|
2
|
+
import { a as AgentAction, r as WarningHook, t as KasszaWarning } from "./warnings-DpuYhn39.cjs";
|
|
3
|
+
import { n as KeyValueStore } from "./store-BkaZ8qkU.cjs";
|
|
4
|
+
import { d as ItemAmounts, f as ItemPriceInput } from "./index-CinpAhQM.cjs";
|
|
5
|
+
import { r as Receipt } from "./types-_HKTOCuQ.cjs";
|
|
6
|
+
import { t as CookieStore } from "./session-BBbSXlx3.cjs";
|
|
8
7
|
type SzamlazzErrorCategory = "auth" | "account" | "validation" | "duplicate" | "partial_success" | "not_found" | "maintenance" | "rate_limit" | "attempt_limit" | "in_progress" | "store_unavailable" | "network" | "timeout" | "configuration" | "unexpected_response" | "unknown";
|
|
9
8
|
interface AgentErrorCodeInfo {
|
|
10
9
|
readonly message: string;
|
|
@@ -41,8 +40,6 @@ declare class SzamlazzError extends Error {
|
|
|
41
40
|
}
|
|
42
41
|
declare function isSzamlazzError(error: unknown): error is SzamlazzError;
|
|
43
42
|
declare function suggestedPrefix(error: unknown): string | undefined;
|
|
44
|
-
//#endregion
|
|
45
|
-
//#region src/core/attempt-ledger.d.ts
|
|
46
43
|
declare const ATTEMPT_LEDGER_TTL_SECONDS = 86400;
|
|
47
44
|
declare const ATTEMPT_LEDGER_KEY_PREFIX = "szamlazz:attempts:";
|
|
48
45
|
interface AttemptLedgerRequest {
|
|
@@ -55,8 +52,6 @@ interface AttemptLedgerRequest {
|
|
|
55
52
|
}
|
|
56
53
|
declare function attemptLedgerKey(request: AttemptLedgerRequest): Promise<string>;
|
|
57
54
|
type AttemptLedgerMode = "fail-open" | "fail-closed";
|
|
58
|
-
//#endregion
|
|
59
|
-
//#region src/invoices/create-types.d.ts
|
|
60
55
|
type InvoiceType = "invoice" | "proforma" | "advance" | "final" | "corrective" | "deliveryNote";
|
|
61
56
|
declare const INVOICE_LANGUAGES: readonly ["hu", "en", "de", "it", "ro", "sk", "hr", "fr", "es", "cz", "pl", "bg", "nl", "ru", "si"];
|
|
62
57
|
type InvoiceLanguage = (typeof INVOICE_LANGUAGES)[number];
|
|
@@ -243,8 +238,6 @@ interface InvoicePreview {
|
|
|
243
238
|
readonly grossTotal: number;
|
|
244
239
|
readonly items: readonly CreatedInvoiceItem[];
|
|
245
240
|
}
|
|
246
|
-
//#endregion
|
|
247
|
-
//#region src/core/response.d.ts
|
|
248
241
|
interface AgentResponse {
|
|
249
242
|
readonly action: AgentAction;
|
|
250
243
|
readonly status: number;
|
|
@@ -253,8 +246,6 @@ interface AgentResponse {
|
|
|
253
246
|
readonly isPdf: boolean;
|
|
254
247
|
text(): string;
|
|
255
248
|
}
|
|
256
|
-
//#endregion
|
|
257
|
-
//#region src/core/xml/serialize.d.ts
|
|
258
249
|
type XmlScalar = string | number | boolean;
|
|
259
250
|
type XmlContent = XmlScalar | null | undefined | readonly XmlChild[];
|
|
260
251
|
type XmlChild = XmlNode | false | null | undefined;
|
|
@@ -264,8 +255,6 @@ interface XmlNode {
|
|
|
264
255
|
readonly content: XmlContent;
|
|
265
256
|
readonly attributes?: XmlAttributes | undefined;
|
|
266
257
|
}
|
|
267
|
-
//#endregion
|
|
268
|
-
//#region src/invoices/payment.d.ts
|
|
269
258
|
interface PaymentEntry {
|
|
270
259
|
readonly date?: DateInput | undefined;
|
|
271
260
|
readonly method: string;
|
|
@@ -296,8 +285,6 @@ interface RegisteredPayment {
|
|
|
296
285
|
readonly outstanding?: number | undefined;
|
|
297
286
|
readonly buyerAccountUrl?: string | undefined;
|
|
298
287
|
}
|
|
299
|
-
//#endregion
|
|
300
|
-
//#region src/invoices/reverse.d.ts
|
|
301
288
|
interface ReverseInvoiceEmail {
|
|
302
289
|
readonly replyTo?: string | undefined;
|
|
303
290
|
readonly subject?: string | undefined;
|
|
@@ -329,8 +316,6 @@ interface ReversedInvoice {
|
|
|
329
316
|
readonly buyerAccountUrl?: string | undefined;
|
|
330
317
|
readonly pdf?: Uint8Array | undefined;
|
|
331
318
|
}
|
|
332
|
-
//#endregion
|
|
333
|
-
//#region src/core/document-events.d.ts
|
|
334
319
|
interface InvoiceCreatedEvent {
|
|
335
320
|
readonly kind: "invoice";
|
|
336
321
|
readonly action: "created";
|
|
@@ -376,8 +361,6 @@ declare class DocumentHookError extends Error {
|
|
|
376
361
|
get document(): DocumentEvent["document"];
|
|
377
362
|
}
|
|
378
363
|
declare function isDocumentHookError(error: unknown): error is DocumentHookError;
|
|
379
|
-
//#endregion
|
|
380
|
-
//#region src/core/context.d.ts
|
|
381
364
|
interface AgentAttachment {
|
|
382
365
|
readonly filename: string;
|
|
383
366
|
readonly content: Uint8Array | ArrayBuffer | Blob | string;
|
|
@@ -445,5 +428,4 @@ interface AgentContext {
|
|
|
445
428
|
resetSession(): Promise<void>;
|
|
446
429
|
resetAttempts(key: string): Promise<void>;
|
|
447
430
|
}
|
|
448
|
-
//#endregion
|
|
449
431
|
export { Waybill as $, CorrectiveInvoiceInput as A, InvoiceLanguage as B, ClearPaymentsInput as C, XmlNode as D, RegisteredPayment as E, Currency as F, InvoiceType as G, InvoicePreview as H, FinalInvoiceInput as I, PickPackPointWaybill as J, ItemLedger as K, InvoiceBuyer as L, CreateInvoiceInput as M, CreatedInvoice as N, AgentResponse as O, CreatedInvoiceItem as P, TransOFlexWaybill as Q, InvoiceDefaults as R, ReversedInvoice as S, RegisterPaymentInput as T, InvoiceSeller as U, InvoicePostalAddress as V, InvoiceTemplate as W, StandardInvoiceInput as X, SprinterWaybill as Y, TaxpayerType as Z, InvoiceReversedEvent as _, AgentRequestEvent as a, AgentErrorCodeInfo as at, isDocumentHookError as b, SzamlazzHooks as c, SzamlazzErrorCategory as ct, DocumentErrorMode as d, suggestedPrefix as dt, ATTEMPT_LEDGER_KEY_PREFIX as et, DocumentEvent as f, InvoicePaymentEvent as g, InvoiceCreatedEvent as h, AgentErrorEvent as i, AGENT_ERROR_CODES as it, CourierService as j, BuyerLedger as k, SzamlazzOptions as l, errorCodeDocsUrl as lt, DocumentHookError as m, AgentCompleteEvent as n, AttemptLedgerMode as nt, AgentResponseEvent as o, KASSZA_ERROR_DOCS_URL as ot, DocumentHook as p, MplWaybill as q, AgentContext as r, attemptLedgerKey as rt, RequestOptions as s, SzamlazzError as st, AgentAttachment as t, ATTEMPT_LEDGER_TTL_SECONDS as tt, DocumentErrorHandler as u, isSzamlazzError as ut, ReceiptCreatedEvent as v, PaymentEntry as w, ReverseInvoiceInput as x, ReceiptReversedEvent as y, InvoiceItemInput as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_session = require("../session-
|
|
3
|
-
const require_stores = require("../stores-
|
|
2
|
+
const require_session = require("../session-BYotpR_s.cjs");
|
|
3
|
+
const require_stores = require("../stores-CH4rYKs_.cjs");
|
|
4
4
|
exports.CLOUDFLARE_KV_MIN_TTL_SECONDS = require_stores.CLOUDFLARE_KV_MIN_TTL_SECONDS;
|
|
5
5
|
exports.DURABLE_OBJECT_STORE_URL = require_stores.DURABLE_OBJECT_STORE_URL;
|
|
6
6
|
exports.SESSION_TTL_SECONDS = require_session.SESSION_TTL_SECONDS;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as storeCapabilities, i as memoryStore, n as KeyValueStore, r as StoreCapabilities, t as Awaitable } from "../store-
|
|
2
|
-
import { n as SESSION_TTL_SECONDS, r as memoryCookieStore, t as CookieStore } from "../session-
|
|
3
|
-
import { C as CookieStoreErrorEvent, E as resilientCookieStore, S as CookieStoreAdapterOptions, T as ResilientCookieStoreOptions, _ as ioredisCookieStore, a as DurableObjectStubLike, b as CloudflareKvNamespaceLike, c as DiagnoseStoreOptions, d as diagnoseStore, f as UpstashRedisLike, g as IoRedisLike, h as nodeRedisCookieStore, i as DurableObjectStoreOperation, l as StoreDiagnosis, m as NodeRedisLike, n as DurableObjectStorageLike, o as durableObjectStore, p as upstashRedisCookieStore, r as DurableObjectStoreEntry, s as handleDurableObjectStoreRequest, t as DURABLE_OBJECT_STORE_URL, u as StoreSuitability, v as customCookieStore, w as CookieStoreOperation, x as cloudflareKvCookieStore, y as CLOUDFLARE_KV_MIN_TTL_SECONDS } from "../index-
|
|
1
|
+
import { a as storeCapabilities, i as memoryStore, n as KeyValueStore, r as StoreCapabilities, t as Awaitable } from "../store-BkaZ8qkU.cjs";
|
|
2
|
+
import { n as SESSION_TTL_SECONDS, r as memoryCookieStore, t as CookieStore } from "../session-BBbSXlx3.cjs";
|
|
3
|
+
import { C as CookieStoreErrorEvent, E as resilientCookieStore, S as CookieStoreAdapterOptions, T as ResilientCookieStoreOptions, _ as ioredisCookieStore, a as DurableObjectStubLike, b as CloudflareKvNamespaceLike, c as DiagnoseStoreOptions, d as diagnoseStore, f as UpstashRedisLike, g as IoRedisLike, h as nodeRedisCookieStore, i as DurableObjectStoreOperation, l as StoreDiagnosis, m as NodeRedisLike, n as DurableObjectStorageLike, o as durableObjectStore, p as upstashRedisCookieStore, r as DurableObjectStoreEntry, s as handleDurableObjectStoreRequest, t as DURABLE_OBJECT_STORE_URL, u as StoreSuitability, v as customCookieStore, w as CookieStoreOperation, x as cloudflareKvCookieStore, y as CLOUDFLARE_KV_MIN_TTL_SECONDS } from "../index-qk62lWr3.cjs";
|
|
4
4
|
export { type Awaitable, CLOUDFLARE_KV_MIN_TTL_SECONDS, type CloudflareKvNamespaceLike, type CookieStore, type CookieStoreAdapterOptions, type CookieStoreErrorEvent, type CookieStoreOperation, DURABLE_OBJECT_STORE_URL, type DiagnoseStoreOptions, type DurableObjectStorageLike, type DurableObjectStoreEntry, type DurableObjectStoreOperation, type DurableObjectStubLike, type IoRedisLike, type KeyValueStore, type NodeRedisLike, type ResilientCookieStoreOptions, SESSION_TTL_SECONDS, type StoreCapabilities, type StoreDiagnosis, type StoreSuitability, type UpstashRedisLike, cloudflareKvCookieStore, cloudflareKvCookieStore as cloudflareKvStore, customCookieStore, customCookieStore as customStore, diagnoseStore, durableObjectStore, handleDurableObjectStoreRequest, ioredisCookieStore, ioredisCookieStore as ioredisStore, memoryCookieStore, memoryStore, nodeRedisCookieStore, nodeRedisCookieStore as nodeRedisStore, resilientCookieStore, resilientCookieStore as resilientStore, storeCapabilities, upstashRedisCookieStore, upstashRedisCookieStore as upstashRedisStore };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as storeCapabilities, i as memoryStore, n as KeyValueStore, r as StoreCapabilities, t as Awaitable } from "../store-
|
|
2
|
-
import { n as SESSION_TTL_SECONDS, r as memoryCookieStore, t as CookieStore } from "../session-
|
|
3
|
-
import { C as CookieStoreErrorEvent, E as resilientCookieStore, S as CookieStoreAdapterOptions, T as ResilientCookieStoreOptions, _ as ioredisCookieStore, a as DurableObjectStubLike, b as CloudflareKvNamespaceLike, c as DiagnoseStoreOptions, d as diagnoseStore, f as UpstashRedisLike, g as IoRedisLike, h as nodeRedisCookieStore, i as DurableObjectStoreOperation, l as StoreDiagnosis, m as NodeRedisLike, n as DurableObjectStorageLike, o as durableObjectStore, p as upstashRedisCookieStore, r as DurableObjectStoreEntry, s as handleDurableObjectStoreRequest, t as DURABLE_OBJECT_STORE_URL, u as StoreSuitability, v as customCookieStore, w as CookieStoreOperation, x as cloudflareKvCookieStore, y as CLOUDFLARE_KV_MIN_TTL_SECONDS } from "../index-
|
|
1
|
+
import { a as storeCapabilities, i as memoryStore, n as KeyValueStore, r as StoreCapabilities, t as Awaitable } from "../store-BkaZ8qkU.js";
|
|
2
|
+
import { n as SESSION_TTL_SECONDS, r as memoryCookieStore, t as CookieStore } from "../session-mKtpAeUB.js";
|
|
3
|
+
import { C as CookieStoreErrorEvent, E as resilientCookieStore, S as CookieStoreAdapterOptions, T as ResilientCookieStoreOptions, _ as ioredisCookieStore, a as DurableObjectStubLike, b as CloudflareKvNamespaceLike, c as DiagnoseStoreOptions, d as diagnoseStore, f as UpstashRedisLike, g as IoRedisLike, h as nodeRedisCookieStore, i as DurableObjectStoreOperation, l as StoreDiagnosis, m as NodeRedisLike, n as DurableObjectStorageLike, o as durableObjectStore, p as upstashRedisCookieStore, r as DurableObjectStoreEntry, s as handleDurableObjectStoreRequest, t as DURABLE_OBJECT_STORE_URL, u as StoreSuitability, v as customCookieStore, w as CookieStoreOperation, x as cloudflareKvCookieStore, y as CLOUDFLARE_KV_MIN_TTL_SECONDS } from "../index-DqoDUw6X.js";
|
|
4
4
|
export { type Awaitable, CLOUDFLARE_KV_MIN_TTL_SECONDS, type CloudflareKvNamespaceLike, type CookieStore, type CookieStoreAdapterOptions, type CookieStoreErrorEvent, type CookieStoreOperation, DURABLE_OBJECT_STORE_URL, type DiagnoseStoreOptions, type DurableObjectStorageLike, type DurableObjectStoreEntry, type DurableObjectStoreOperation, type DurableObjectStubLike, type IoRedisLike, type KeyValueStore, type NodeRedisLike, type ResilientCookieStoreOptions, SESSION_TTL_SECONDS, type StoreCapabilities, type StoreDiagnosis, type StoreSuitability, type UpstashRedisLike, cloudflareKvCookieStore, cloudflareKvCookieStore as cloudflareKvStore, customCookieStore, customCookieStore as customStore, diagnoseStore, durableObjectStore, handleDurableObjectStoreRequest, ioredisCookieStore, ioredisCookieStore as ioredisStore, memoryCookieStore, memoryStore, nodeRedisCookieStore, nodeRedisCookieStore as nodeRedisStore, resilientCookieStore, resilientCookieStore as resilientStore, storeCapabilities, upstashRedisCookieStore, upstashRedisCookieStore as upstashRedisStore };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as memoryStore, n as memoryCookieStore, o as storeCapabilities, t as SESSION_TTL_SECONDS } from "../session-
|
|
2
|
-
import { a as upstashRedisCookieStore, c as customCookieStore, d as resilientCookieStore, i as diagnoseStore, l as CLOUDFLARE_KV_MIN_TTL_SECONDS, n as durableObjectStore, o as nodeRedisCookieStore, r as handleDurableObjectStoreRequest, s as ioredisCookieStore, t as DURABLE_OBJECT_STORE_URL, u as cloudflareKvCookieStore } from "../stores-
|
|
1
|
+
import { a as memoryStore, n as memoryCookieStore, o as storeCapabilities, t as SESSION_TTL_SECONDS } from "../session-DZeE1ryt.js";
|
|
2
|
+
import { a as upstashRedisCookieStore, c as customCookieStore, d as resilientCookieStore, i as diagnoseStore, l as CLOUDFLARE_KV_MIN_TTL_SECONDS, n as durableObjectStore, o as nodeRedisCookieStore, r as handleDurableObjectStoreRequest, s as ioredisCookieStore, t as DURABLE_OBJECT_STORE_URL, u as cloudflareKvCookieStore } from "../stores-BUnPNJQl.js";
|
|
3
3
|
export { CLOUDFLARE_KV_MIN_TTL_SECONDS, DURABLE_OBJECT_STORE_URL, SESSION_TTL_SECONDS, cloudflareKvCookieStore, cloudflareKvCookieStore as cloudflareKvStore, customCookieStore, customCookieStore as customStore, diagnoseStore, durableObjectStore, handleDurableObjectStoreRequest, ioredisCookieStore, ioredisCookieStore as ioredisStore, memoryCookieStore, memoryStore, nodeRedisCookieStore, nodeRedisCookieStore as nodeRedisStore, resilientCookieStore, resilientCookieStore as resilientStore, storeCapabilities, upstashRedisCookieStore, upstashRedisCookieStore as upstashRedisStore };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { r as SzamlazzError } from "./errors-
|
|
2
|
-
import { a as optionalEl, n as buildXmlDocument, r as el } from "./serialize-
|
|
3
|
-
import { n as parseReceiptResponse } from "./parse-
|
|
4
|
-
import { n as decimalPlaces, r as roundMoney } from "./rounding-
|
|
5
|
-
import { i as isHuf, o as vatPercentage } from "./vat-
|
|
6
|
-
import { i as calculateReceiptItem } from "./money-
|
|
7
|
-
|
|
1
|
+
import { r as SzamlazzError } from "./errors-CGGsW0Y5.js";
|
|
2
|
+
import { a as optionalEl, n as buildXmlDocument, r as el } from "./serialize-CjymGkJj.js";
|
|
3
|
+
import { n as parseReceiptResponse } from "./parse-1RiSh4vY.js";
|
|
4
|
+
import { n as decimalPlaces, r as roundMoney } from "./rounding-CZLj4DbV.js";
|
|
5
|
+
import { i as isHuf, o as vatPercentage } from "./vat-B4J5Q0tu.js";
|
|
6
|
+
import { i as calculateReceiptItem } from "./money-f280VT77.js";
|
|
7
|
+
// src/receipts/types.ts
|
|
8
8
|
const RECEIPT_ONLY_VAT_CODES = [
|
|
9
9
|
"ÁKK",
|
|
10
10
|
"MAA",
|
|
@@ -17,8 +17,7 @@ const RECEIPT_PDF_TEMPLATES = [
|
|
|
17
17
|
"J",
|
|
18
18
|
"L"
|
|
19
19
|
];
|
|
20
|
-
|
|
21
|
-
//#region src/receipts/common.ts
|
|
20
|
+
// src/receipts/common.ts
|
|
22
21
|
const RECEIPT_XSD_BASE_URL = "https://www.szamlazz.hu/szamla/docs/xsds/";
|
|
23
22
|
function receiptValidationError(message) {
|
|
24
23
|
return new SzamlazzError(message, { category: "validation" });
|
|
@@ -41,8 +40,7 @@ function validateTemplate(template) {
|
|
|
41
40
|
function requireReceiptNumber(value) {
|
|
42
41
|
return requireText(value, "Add meg a nyugtaszámot (receiptNumber).");
|
|
43
42
|
}
|
|
44
|
-
|
|
45
|
-
//#region src/receipts/create.ts
|
|
43
|
+
// src/receipts/create.ts
|
|
46
44
|
const CREATE_RECEIPT_NAMESPACE = "http://www.szamlazz.hu/xmlnyugtacreate";
|
|
47
45
|
const DEFAULT_CURRENCY = "HUF";
|
|
48
46
|
const DEFAULT_UNIT = "db";
|
|
@@ -200,5 +198,4 @@ async function createReceipt(ctx, defaults, input, options = {}) {
|
|
|
200
198
|
throw enrichDuplicateError(error, input);
|
|
201
199
|
}
|
|
202
200
|
}
|
|
203
|
-
//#endregion
|
|
204
201
|
export { optionalText as a, validateTemplate as c, RECEIPT_XSD_BASE_URL as i, RECEIPT_ONLY_VAT_CODES as l, calculateReceiptItems as n, receiptValidationError as o, createReceipt as r, requireReceiptNumber as s, buildCreateReceiptXml as t };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const require_errors = require("./errors-
|
|
2
|
-
const require_serialize = require("./serialize-
|
|
3
|
-
const require_parse = require("./parse-
|
|
4
|
-
const require_rounding = require("./rounding-
|
|
5
|
-
const require_vat = require("./vat-
|
|
6
|
-
const require_money = require("./money-
|
|
7
|
-
|
|
1
|
+
const require_errors = require("./errors-Bn6pe6yw.cjs");
|
|
2
|
+
const require_serialize = require("./serialize-DEU7r6Bk.cjs");
|
|
3
|
+
const require_parse = require("./parse-CmM5va-p.cjs");
|
|
4
|
+
const require_rounding = require("./rounding-CHmSK5Z2.cjs");
|
|
5
|
+
const require_vat = require("./vat-BkoiiKm4.cjs");
|
|
6
|
+
const require_money = require("./money-NtVytaxG.cjs");
|
|
7
|
+
// src/receipts/types.ts
|
|
8
8
|
const RECEIPT_ONLY_VAT_CODES = [
|
|
9
9
|
"ÁKK",
|
|
10
10
|
"MAA",
|
|
@@ -17,8 +17,7 @@ const RECEIPT_PDF_TEMPLATES = [
|
|
|
17
17
|
"J",
|
|
18
18
|
"L"
|
|
19
19
|
];
|
|
20
|
-
|
|
21
|
-
//#region src/receipts/common.ts
|
|
20
|
+
// src/receipts/common.ts
|
|
22
21
|
const RECEIPT_XSD_BASE_URL = "https://www.szamlazz.hu/szamla/docs/xsds/";
|
|
23
22
|
function receiptValidationError(message) {
|
|
24
23
|
return new require_errors.SzamlazzError(message, { category: "validation" });
|
|
@@ -41,8 +40,7 @@ function validateTemplate(template) {
|
|
|
41
40
|
function requireReceiptNumber(value) {
|
|
42
41
|
return requireText(value, "Add meg a nyugtaszámot (receiptNumber).");
|
|
43
42
|
}
|
|
44
|
-
|
|
45
|
-
//#region src/receipts/create.ts
|
|
43
|
+
// src/receipts/create.ts
|
|
46
44
|
const CREATE_RECEIPT_NAMESPACE = "http://www.szamlazz.hu/xmlnyugtacreate";
|
|
47
45
|
const DEFAULT_CURRENCY = "HUF";
|
|
48
46
|
const DEFAULT_UNIT = "db";
|
|
@@ -200,7 +198,6 @@ async function createReceipt(ctx, defaults, input, options = {}) {
|
|
|
200
198
|
throw enrichDuplicateError(error, input);
|
|
201
199
|
}
|
|
202
200
|
}
|
|
203
|
-
//#endregion
|
|
204
201
|
Object.defineProperty(exports, "RECEIPT_ONLY_VAT_CODES", {
|
|
205
202
|
enumerable: true,
|
|
206
203
|
get: function() {
|