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
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { r as SzamlazzError } from "./errors-
|
|
2
|
-
import { i as encodeUtf8 } from "./binary-
|
|
3
|
-
import { a as optionalEl, n as buildXmlDocument, r as el } from "./serialize-
|
|
4
|
-
import { t as emitWarning } from "./warnings-
|
|
5
|
-
import { a as unknownOutcomeError, i as resolveRecoveryDelay, n as isUncertainOutcome, r as recoverAfterFailure } from "./once-
|
|
6
|
-
import { m as guardOnce } from "./issue-
|
|
7
|
-
import { a as todayInBudapest, n as toAgentDate, t as addBudapestDays } from "./dates-
|
|
8
|
-
import { i as isHuf } from "./vat-
|
|
9
|
-
import { n as calculateInvoiceItem } from "./money-
|
|
10
|
-
import { a as optionalText, c as requireText$1, n as agentDate$1, o as parseInvoiceResult, t as AGENT_XSD_BASE_URL, u as validationError } from "./reference-
|
|
11
|
-
|
|
1
|
+
import { r as SzamlazzError } from "./errors-CGGsW0Y5.js";
|
|
2
|
+
import { i as encodeUtf8 } from "./binary-DuKBSfH-.js";
|
|
3
|
+
import { a as optionalEl, n as buildXmlDocument, r as el } from "./serialize-CjymGkJj.js";
|
|
4
|
+
import { t as emitWarning } from "./warnings-DJ0QvZOp.js";
|
|
5
|
+
import { a as unknownOutcomeError, i as resolveRecoveryDelay, n as isUncertainOutcome, r as recoverAfterFailure } from "./once-CMhDPrs7.js";
|
|
6
|
+
import { m as guardOnce } from "./issue-Dy9zvRK1.js";
|
|
7
|
+
import { a as todayInBudapest, n as toAgentDate, t as addBudapestDays } from "./dates-DWsZOdaO.js";
|
|
8
|
+
import { i as isHuf } from "./vat-B4J5Q0tu.js";
|
|
9
|
+
import { n as calculateInvoiceItem } from "./money-f280VT77.js";
|
|
10
|
+
import { a as optionalText, c as requireText$1, n as agentDate$1, o as parseInvoiceResult, t as AGENT_XSD_BASE_URL, u as validationError } from "./reference-Cxz0m2zF.js";
|
|
11
|
+
// src/core/actions.ts
|
|
12
12
|
const SZAMLAZZ_AGENT_URL = "https://www.szamlazz.hu/szamla/";
|
|
13
13
|
const AGENT_ACTIONS = {
|
|
14
14
|
createInvoice: "action-xmlagentxmlfile",
|
|
@@ -25,8 +25,7 @@ const AGENT_ACTIONS = {
|
|
|
25
25
|
connectPrincipal: "action-agent_ceg_mb"
|
|
26
26
|
};
|
|
27
27
|
const MAX_INVOICE_ATTACHMENTS = 5;
|
|
28
|
-
|
|
29
|
-
//#region src/core/document-events.ts
|
|
28
|
+
// src/core/document-events.ts
|
|
30
29
|
var DocumentHookError = class extends Error {
|
|
31
30
|
name = "DocumentHookError";
|
|
32
31
|
event;
|
|
@@ -70,11 +69,9 @@ async function emitDocumentEvent(hook, event, options = {}) {
|
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
71
|
}
|
|
73
|
-
|
|
74
|
-
//#region src/core/aggregator.ts
|
|
72
|
+
// src/core/aggregator.ts
|
|
75
73
|
const KASSZA_AGGREGATOR = "3UMUqqWEJ7bXfJp9KXNWcrddY9sKjDVD";
|
|
76
|
-
|
|
77
|
-
//#region src/invoices/create-types.ts
|
|
74
|
+
// src/invoices/create-types.ts
|
|
78
75
|
const INVOICE_TYPES = [
|
|
79
76
|
"invoice",
|
|
80
77
|
"proforma",
|
|
@@ -402,8 +399,7 @@ async function registerPayment(ctx, input, options = {}) {
|
|
|
402
399
|
async function clearPayments(ctx, input, options = {}) {
|
|
403
400
|
return sendPaymentRequest(ctx, normalizeClearInput(input), options);
|
|
404
401
|
}
|
|
405
|
-
|
|
406
|
-
//#region src/invoices/payment-once.ts
|
|
402
|
+
// src/invoices/payment-once.ts
|
|
407
403
|
const KEY_PATTERN = /^[A-Za-z0-9_.:-]{1,48}$/;
|
|
408
404
|
function validation(message, hint) {
|
|
409
405
|
return new SzamlazzError(message, {
|
|
@@ -497,8 +493,7 @@ async function registerPaymentOnce(api, input, options = {}, guard) {
|
|
|
497
493
|
created: false
|
|
498
494
|
}));
|
|
499
495
|
}
|
|
500
|
-
|
|
501
|
-
//#region src/receipts/create-once.ts
|
|
496
|
+
// src/receipts/create-once.ts
|
|
502
497
|
function requireOrderNumber(input) {
|
|
503
498
|
const orderNumber = input.orderNumber?.trim();
|
|
504
499
|
if (!orderNumber) throw new SzamlazzError("A createOnce-hoz add meg a rendelésszámot (orderNumber), ez azonosítja a nyugtát.", { category: "validation" });
|
|
@@ -546,5 +541,4 @@ async function createReceiptOnce(api, input, options = {}, guard) {
|
|
|
546
541
|
created: false
|
|
547
542
|
}));
|
|
548
543
|
}
|
|
549
|
-
//#endregion
|
|
550
544
|
export { MAX_INVOICE_ATTACHMENTS as _, registerPayment as a, resolveInvoice as c, TAXPAYER_TYPE_CODES as d, KASSZA_AGGREGATOR as f, AGENT_ACTIONS as g, isDocumentHookError as h, clearPayments as i, INVOICE_LANGUAGES as l, emitDocumentEvent as m, paymentMarker as n, optionalAgentDate as o, DocumentHookError as p, registerPaymentOnce as r, presentText as s, createReceiptOnce as t, INVOICE_TEMPLATES as u, SZAMLAZZ_AGENT_URL as v };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { G as InvoiceType, N as CreatedInvoice } from "./context-
|
|
2
|
-
import { r as Receipt } from "./types-
|
|
3
|
-
import { n as InvoiceDetails } from "./get-
|
|
4
|
-
//#region src/invoices/create-once.d.ts
|
|
1
|
+
import { G as InvoiceType, N as CreatedInvoice } from "./context-BuX6Eion.js";
|
|
2
|
+
import { r as Receipt } from "./types-Z6rQoqHn.js";
|
|
3
|
+
import { n as InvoiceDetails } from "./get-BL4Fr8-P.js";
|
|
5
4
|
interface InvoiceOnceResult {
|
|
6
5
|
readonly number: string;
|
|
7
6
|
readonly created: boolean;
|
|
@@ -10,11 +9,8 @@ interface InvoiceOnceResult {
|
|
|
10
9
|
readonly details?: InvoiceDetails | undefined;
|
|
11
10
|
}
|
|
12
11
|
declare function invoiceOnceExternalId(type: InvoiceType, orderNumber: string): string;
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/receipts/create-once.d.ts
|
|
15
12
|
interface ReceiptOnceResult {
|
|
16
13
|
readonly receipt: Receipt;
|
|
17
14
|
readonly created: boolean;
|
|
18
15
|
}
|
|
19
|
-
//#endregion
|
|
20
16
|
export { InvoiceOnceResult as n, invoiceOnceExternalId as r, ReceiptOnceResult as t };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { G as InvoiceType, N as CreatedInvoice } from "./context-
|
|
2
|
-
import { r as Receipt } from "./types-
|
|
3
|
-
import { n as InvoiceDetails } from "./get-
|
|
4
|
-
//#region src/invoices/create-once.d.ts
|
|
1
|
+
import { G as InvoiceType, N as CreatedInvoice } from "./context-PwqY4JOK.cjs";
|
|
2
|
+
import { r as Receipt } from "./types-_HKTOCuQ.cjs";
|
|
3
|
+
import { n as InvoiceDetails } from "./get-BL4Fr8-P.cjs";
|
|
5
4
|
interface InvoiceOnceResult {
|
|
6
5
|
readonly number: string;
|
|
7
6
|
readonly created: boolean;
|
|
@@ -10,11 +9,8 @@ interface InvoiceOnceResult {
|
|
|
10
9
|
readonly details?: InvoiceDetails | undefined;
|
|
11
10
|
}
|
|
12
11
|
declare function invoiceOnceExternalId(type: InvoiceType, orderNumber: string): string;
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/receipts/create-once.d.ts
|
|
15
12
|
interface ReceiptOnceResult {
|
|
16
13
|
readonly receipt: Receipt;
|
|
17
14
|
readonly created: boolean;
|
|
18
15
|
}
|
|
19
|
-
//#endregion
|
|
20
16
|
export { InvoiceOnceResult as n, invoiceOnceExternalId as r, ReceiptOnceResult as t };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const require_errors = require("./errors-
|
|
2
|
-
const require_binary = require("./binary-
|
|
3
|
-
const require_serialize = require("./serialize-
|
|
4
|
-
const require_warnings = require("./warnings-
|
|
5
|
-
const require_once = require("./once-
|
|
6
|
-
const require_issue = require("./issue-
|
|
7
|
-
const require_dates = require("./dates-
|
|
8
|
-
const require_vat = require("./vat-
|
|
9
|
-
const require_money = require("./money-
|
|
10
|
-
const require_reference = require("./reference-
|
|
11
|
-
|
|
1
|
+
const require_errors = require("./errors-Bn6pe6yw.cjs");
|
|
2
|
+
const require_binary = require("./binary-CdpKlNNI.cjs");
|
|
3
|
+
const require_serialize = require("./serialize-DEU7r6Bk.cjs");
|
|
4
|
+
const require_warnings = require("./warnings-ciSzK6Jc.cjs");
|
|
5
|
+
const require_once = require("./once-BmXfrNbQ.cjs");
|
|
6
|
+
const require_issue = require("./issue-DReARZnF.cjs");
|
|
7
|
+
const require_dates = require("./dates-oOp3ypPP.cjs");
|
|
8
|
+
const require_vat = require("./vat-BkoiiKm4.cjs");
|
|
9
|
+
const require_money = require("./money-NtVytaxG.cjs");
|
|
10
|
+
const require_reference = require("./reference-DoY12fc1.cjs");
|
|
11
|
+
// src/core/actions.ts
|
|
12
12
|
const SZAMLAZZ_AGENT_URL = "https://www.szamlazz.hu/szamla/";
|
|
13
13
|
const AGENT_ACTIONS = {
|
|
14
14
|
createInvoice: "action-xmlagentxmlfile",
|
|
@@ -25,8 +25,7 @@ const AGENT_ACTIONS = {
|
|
|
25
25
|
connectPrincipal: "action-agent_ceg_mb"
|
|
26
26
|
};
|
|
27
27
|
const MAX_INVOICE_ATTACHMENTS = 5;
|
|
28
|
-
|
|
29
|
-
//#region src/core/document-events.ts
|
|
28
|
+
// src/core/document-events.ts
|
|
30
29
|
var DocumentHookError = class extends Error {
|
|
31
30
|
name = "DocumentHookError";
|
|
32
31
|
event;
|
|
@@ -70,11 +69,9 @@ async function emitDocumentEvent(hook, event, options = {}) {
|
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
71
|
}
|
|
73
|
-
|
|
74
|
-
//#region src/core/aggregator.ts
|
|
72
|
+
// src/core/aggregator.ts
|
|
75
73
|
const KASSZA_AGGREGATOR = "3UMUqqWEJ7bXfJp9KXNWcrddY9sKjDVD";
|
|
76
|
-
|
|
77
|
-
//#region src/invoices/create-types.ts
|
|
74
|
+
// src/invoices/create-types.ts
|
|
78
75
|
const INVOICE_TYPES = [
|
|
79
76
|
"invoice",
|
|
80
77
|
"proforma",
|
|
@@ -402,8 +399,7 @@ async function registerPayment(ctx, input, options = {}) {
|
|
|
402
399
|
async function clearPayments(ctx, input, options = {}) {
|
|
403
400
|
return sendPaymentRequest(ctx, normalizeClearInput(input), options);
|
|
404
401
|
}
|
|
405
|
-
|
|
406
|
-
//#region src/invoices/payment-once.ts
|
|
402
|
+
// src/invoices/payment-once.ts
|
|
407
403
|
const KEY_PATTERN = /^[A-Za-z0-9_.:-]{1,48}$/;
|
|
408
404
|
function validation(message, hint) {
|
|
409
405
|
return new require_errors.SzamlazzError(message, {
|
|
@@ -497,8 +493,7 @@ async function registerPaymentOnce(api, input, options = {}, guard) {
|
|
|
497
493
|
created: false
|
|
498
494
|
}));
|
|
499
495
|
}
|
|
500
|
-
|
|
501
|
-
//#region src/receipts/create-once.ts
|
|
496
|
+
// src/receipts/create-once.ts
|
|
502
497
|
function requireOrderNumber(input) {
|
|
503
498
|
const orderNumber = input.orderNumber?.trim();
|
|
504
499
|
if (!orderNumber) throw new require_errors.SzamlazzError("A createOnce-hoz add meg a rendelésszámot (orderNumber), ez azonosítja a nyugtát.", { category: "validation" });
|
|
@@ -546,7 +541,6 @@ async function createReceiptOnce(api, input, options = {}, guard) {
|
|
|
546
541
|
created: false
|
|
547
542
|
}));
|
|
548
543
|
}
|
|
549
|
-
//#endregion
|
|
550
544
|
Object.defineProperty(exports, "AGENT_ACTIONS", {
|
|
551
545
|
enumerable: true,
|
|
552
546
|
get: function() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/core/crypto.ts
|
|
2
2
|
const encoder = new TextEncoder();
|
|
3
3
|
function toBytes(data) {
|
|
4
4
|
if (typeof data === "string") return encoder.encode(data);
|
|
@@ -32,7 +32,6 @@ function timingSafeEqual(left, right) {
|
|
|
32
32
|
for (let index = 0; index < length; index++) difference |= (a[index] ?? 0) ^ (b[index] ?? 0);
|
|
33
33
|
return difference === 0;
|
|
34
34
|
}
|
|
35
|
-
//#endregion
|
|
36
35
|
Object.defineProperty(exports, "bytesToHex", {
|
|
37
36
|
enumerable: true,
|
|
38
37
|
get: function() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/core/crypto.ts
|
|
2
2
|
const encoder = new TextEncoder();
|
|
3
3
|
function toBytes(data) {
|
|
4
4
|
if (typeof data === "string") return encoder.encode(data);
|
|
@@ -32,5 +32,4 @@ function timingSafeEqual(left, right) {
|
|
|
32
32
|
for (let index = 0; index < length; index++) difference |= (a[index] ?? 0) ^ (b[index] ?? 0);
|
|
33
33
|
return difference === 0;
|
|
34
34
|
}
|
|
35
|
-
//#endregion
|
|
36
35
|
export { timingSafeEqual as a, hmacHex as i, digestHex as n, hmac as r, bytesToHex as t };
|
package/dist/data-link/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
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_get = require("../get-
|
|
7
|
-
const require_crypto = require("../crypto-
|
|
8
|
-
const require_request_body = require("../request-body-
|
|
9
|
-
|
|
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_get = require("../get-DFhT7kOp.cjs");
|
|
7
|
+
const require_crypto = require("../crypto-B0PAHKJB.cjs");
|
|
8
|
+
const require_request_body = require("../request-body-BhfkJhff.cjs");
|
|
9
|
+
// src/data-link/push.ts
|
|
10
10
|
var DataLinkError = class extends Error {
|
|
11
11
|
name = "DataLinkError";
|
|
12
12
|
reason;
|
|
@@ -115,8 +115,7 @@ function parseDataLinkPush(xml, key) {
|
|
|
115
115
|
default: throw new DataLinkError("unknown_document", `Ismeretlen adatkapcsolati bizonylattípus: <${root.name}>.`);
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
|
|
119
|
-
//#region src/data-link/response.ts
|
|
118
|
+
// src/data-link/response.ts
|
|
120
119
|
const DATA_LINK_RESPONSE_ROOTS = {
|
|
121
120
|
invoice: {
|
|
122
121
|
root: "szamlavalasz",
|
|
@@ -166,8 +165,7 @@ function dataLinkResponse(push, acknowledgement = {}) {
|
|
|
166
165
|
headers: { "content-type": "application/xml; charset=UTF-8" }
|
|
167
166
|
});
|
|
168
167
|
}
|
|
169
|
-
|
|
170
|
-
//#region src/data-link/handler.ts
|
|
168
|
+
// src/data-link/handler.ts
|
|
171
169
|
const DATA_LINK_KEY_HEADER = "x-szamlazzhu-key";
|
|
172
170
|
const DEFAULT_DATA_LINK_MAX_BYTES = 67108864;
|
|
173
171
|
function plain(status, body) {
|
|
@@ -221,7 +219,6 @@ function dataLinkHandler(options) {
|
|
|
221
219
|
}
|
|
222
220
|
};
|
|
223
221
|
}
|
|
224
|
-
//#endregion
|
|
225
222
|
exports.DATA_LINK_KEY_HEADER = DATA_LINK_KEY_HEADER;
|
|
226
223
|
exports.DATA_LINK_RESPONSE_ROOTS = DATA_LINK_RESPONSE_ROOTS;
|
|
227
224
|
exports.DEFAULT_DATA_LINK_MAX_BYTES = DEFAULT_DATA_LINK_MAX_BYTES;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { a as DataLinkError, c as DataLinkPush, d as parseDataLinkPush, i as DataLinkBankTransactionPush, l as DataLinkPushKind, n as DataLinkBankTransaction, o as DataLinkErrorReason, r as DataLinkBankTransactionPartner, s as DataLinkInvoicePush, t as DataLinkArchivedReceipt, u as DataLinkReceiptsPush } from "../push-
|
|
2
|
-
//#region src/data-link/response.d.ts
|
|
1
|
+
import { a as DataLinkError, c as DataLinkPush, d as parseDataLinkPush, i as DataLinkBankTransactionPush, l as DataLinkPushKind, n as DataLinkBankTransaction, o as DataLinkErrorReason, r as DataLinkBankTransactionPartner, s as DataLinkInvoicePush, t as DataLinkArchivedReceipt, u as DataLinkReceiptsPush } from "../push-CTxDD3yJ.cjs";
|
|
3
2
|
type DataLinkKeyError = "KEY_ERR" | "KEY_DEL";
|
|
4
3
|
interface DataLinkAcknowledgement {
|
|
5
4
|
readonly registrationNumber?: string | undefined;
|
|
@@ -11,8 +10,6 @@ export declare const DATA_LINK_RESPONSE_ROOTS: Readonly<Record<DataLinkPushKind,
|
|
|
11
10
|
}>>;
|
|
12
11
|
export declare function dataLinkResponseXml(push: DataLinkPush, acknowledgement?: DataLinkAcknowledgement): string;
|
|
13
12
|
export declare function dataLinkResponse(push: DataLinkPush, acknowledgement?: DataLinkAcknowledgement): Response;
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/data-link/handler.d.ts
|
|
16
13
|
export declare const DATA_LINK_KEY_HEADER = "x-szamlazzhu-key";
|
|
17
14
|
export declare const DEFAULT_DATA_LINK_MAX_BYTES = 67108864;
|
|
18
15
|
type DataLinkKeyCheck = boolean | DataLinkKeyError;
|
|
@@ -25,5 +22,4 @@ interface DataLinkHandlerOptions {
|
|
|
25
22
|
}
|
|
26
23
|
type DataLinkHandler = (request: Request) => Promise<Response>;
|
|
27
24
|
export declare function dataLinkHandler(options: DataLinkHandlerOptions): DataLinkHandler;
|
|
28
|
-
//#endregion
|
|
29
25
|
export { type DataLinkAcknowledgement, type DataLinkArchivedReceipt, type DataLinkBankTransaction, type DataLinkBankTransactionPartner, type DataLinkBankTransactionPush, DataLinkError, type DataLinkErrorReason, type DataLinkHandler, type DataLinkHandlerOptions, type DataLinkInvoicePush, type DataLinkKeyCheck, type DataLinkKeyError, type DataLinkPush, type DataLinkPushKind, type DataLinkReceiptsPush, parseDataLinkPush };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { a as DataLinkError, c as DataLinkPush, d as parseDataLinkPush, i as DataLinkBankTransactionPush, l as DataLinkPushKind, n as DataLinkBankTransaction, o as DataLinkErrorReason, r as DataLinkBankTransactionPartner, s as DataLinkInvoicePush, t as DataLinkArchivedReceipt, u as DataLinkReceiptsPush } from "../push-
|
|
2
|
-
//#region src/data-link/response.d.ts
|
|
1
|
+
import { a as DataLinkError, c as DataLinkPush, d as parseDataLinkPush, i as DataLinkBankTransactionPush, l as DataLinkPushKind, n as DataLinkBankTransaction, o as DataLinkErrorReason, r as DataLinkBankTransactionPartner, s as DataLinkInvoicePush, t as DataLinkArchivedReceipt, u as DataLinkReceiptsPush } from "../push-DJh5YkyV.js";
|
|
3
2
|
type DataLinkKeyError = "KEY_ERR" | "KEY_DEL";
|
|
4
3
|
interface DataLinkAcknowledgement {
|
|
5
4
|
readonly registrationNumber?: string | undefined;
|
|
@@ -11,8 +10,6 @@ export declare const DATA_LINK_RESPONSE_ROOTS: Readonly<Record<DataLinkPushKind,
|
|
|
11
10
|
}>>;
|
|
12
11
|
export declare function dataLinkResponseXml(push: DataLinkPush, acknowledgement?: DataLinkAcknowledgement): string;
|
|
13
12
|
export declare function dataLinkResponse(push: DataLinkPush, acknowledgement?: DataLinkAcknowledgement): Response;
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/data-link/handler.d.ts
|
|
16
13
|
export declare const DATA_LINK_KEY_HEADER = "x-szamlazzhu-key";
|
|
17
14
|
export declare const DEFAULT_DATA_LINK_MAX_BYTES = 67108864;
|
|
18
15
|
type DataLinkKeyCheck = boolean | DataLinkKeyError;
|
|
@@ -25,5 +22,4 @@ interface DataLinkHandlerOptions {
|
|
|
25
22
|
}
|
|
26
23
|
type DataLinkHandler = (request: Request) => Promise<Response>;
|
|
27
24
|
export declare function dataLinkHandler(options: DataLinkHandlerOptions): DataLinkHandler;
|
|
28
|
-
//#endregion
|
|
29
25
|
export { type DataLinkAcknowledgement, type DataLinkArchivedReceipt, type DataLinkBankTransaction, type DataLinkBankTransactionPartner, type DataLinkBankTransactionPush, DataLinkError, type DataLinkErrorReason, type DataLinkHandler, type DataLinkHandlerOptions, type DataLinkInvoicePush, type DataLinkKeyCheck, type DataLinkKeyError, type DataLinkPush, type DataLinkPushKind, type DataLinkReceiptsPush, parseDataLinkPush };
|
package/dist/data-link/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { r as SzamlazzError } from "../errors-
|
|
2
|
-
import { i as encodeUtf8 } from "../binary-
|
|
3
|
-
import { a as optionalEl, c as childNumber, d as findChildren, f as parseXml, l as childText, n as buildXmlDocument, o as XmlParseError, r as el, s as childBoolean, u as findChild } from "../serialize-
|
|
4
|
-
import { r as createAgentResponse, t as parseReceiptElement } from "../parse-
|
|
5
|
-
import { n as parseInvoiceDetailsXml } from "../get-
|
|
6
|
-
import { a as timingSafeEqual } from "../crypto-
|
|
7
|
-
import { t as readRequestText } from "../request-body-
|
|
8
|
-
|
|
1
|
+
import { r as SzamlazzError } from "../errors-CGGsW0Y5.js";
|
|
2
|
+
import { i as encodeUtf8 } from "../binary-DuKBSfH-.js";
|
|
3
|
+
import { a as optionalEl, c as childNumber, d as findChildren, f as parseXml, l as childText, n as buildXmlDocument, o as XmlParseError, r as el, s as childBoolean, u as findChild } from "../serialize-CjymGkJj.js";
|
|
4
|
+
import { r as createAgentResponse, t as parseReceiptElement } from "../parse-1RiSh4vY.js";
|
|
5
|
+
import { n as parseInvoiceDetailsXml } from "../get-HrHwVkVt.js";
|
|
6
|
+
import { a as timingSafeEqual } from "../crypto-BqGn_oGu.js";
|
|
7
|
+
import { t as readRequestText } from "../request-body-BM4sbsHd.js";
|
|
8
|
+
// src/data-link/push.ts
|
|
9
9
|
var DataLinkError = class extends Error {
|
|
10
10
|
name = "DataLinkError";
|
|
11
11
|
reason;
|
|
@@ -114,8 +114,7 @@ function parseDataLinkPush(xml, key) {
|
|
|
114
114
|
default: throw new DataLinkError("unknown_document", `Ismeretlen adatkapcsolati bizonylattípus: <${root.name}>.`);
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
|
|
118
|
-
//#region src/data-link/response.ts
|
|
117
|
+
// src/data-link/response.ts
|
|
119
118
|
const DATA_LINK_RESPONSE_ROOTS = {
|
|
120
119
|
invoice: {
|
|
121
120
|
root: "szamlavalasz",
|
|
@@ -165,8 +164,7 @@ function dataLinkResponse(push, acknowledgement = {}) {
|
|
|
165
164
|
headers: { "content-type": "application/xml; charset=UTF-8" }
|
|
166
165
|
});
|
|
167
166
|
}
|
|
168
|
-
|
|
169
|
-
//#region src/data-link/handler.ts
|
|
167
|
+
// src/data-link/handler.ts
|
|
170
168
|
const DATA_LINK_KEY_HEADER = "x-szamlazzhu-key";
|
|
171
169
|
const DEFAULT_DATA_LINK_MAX_BYTES = 67108864;
|
|
172
170
|
function plain(status, body) {
|
|
@@ -220,5 +218,4 @@ function dataLinkHandler(options) {
|
|
|
220
218
|
}
|
|
221
219
|
};
|
|
222
220
|
}
|
|
223
|
-
//#endregion
|
|
224
221
|
export { DATA_LINK_KEY_HEADER, DATA_LINK_RESPONSE_ROOTS, DEFAULT_DATA_LINK_MAX_BYTES, DataLinkError, dataLinkHandler, dataLinkResponse, dataLinkResponseXml, parseDataLinkPush };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/core/dates.ts
|
|
2
2
|
const BUDAPEST_TIME_ZONE = "Europe/Budapest";
|
|
3
3
|
const budapestDateFormatter = new Intl.DateTimeFormat("en-CA", {
|
|
4
4
|
timeZone: BUDAPEST_TIME_ZONE,
|
|
@@ -67,5 +67,4 @@ function toAgentDate(input) {
|
|
|
67
67
|
function todayInBudapest(now = /* @__PURE__ */ new Date()) {
|
|
68
68
|
return toBudapestDate(now);
|
|
69
69
|
}
|
|
70
|
-
//#endregion
|
|
71
70
|
export { todayInBudapest as a, toBudapestTimestamp as i, toAgentDate as n, toBudapestDate as r, addBudapestDays as t };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
//#region src/core/dates.d.ts
|
|
2
1
|
declare function toBudapestDate(date: Date): string;
|
|
3
2
|
declare function toBudapestTimestamp(date: Date): string;
|
|
4
3
|
declare function addBudapestDays(date: Date, days: number): string;
|
|
5
4
|
type DateInput = Date | string;
|
|
6
5
|
declare function todayInBudapest(now?: Date): string;
|
|
7
|
-
//#endregion
|
|
8
6
|
export { todayInBudapest as a, toBudapestTimestamp as i, addBudapestDays as n, toBudapestDate as r, DateInput as t };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
//#region src/core/dates.d.ts
|
|
2
1
|
declare function toBudapestDate(date: Date): string;
|
|
3
2
|
declare function toBudapestTimestamp(date: Date): string;
|
|
4
3
|
declare function addBudapestDays(date: Date, days: number): string;
|
|
5
4
|
type DateInput = Date | string;
|
|
6
5
|
declare function todayInBudapest(now?: Date): string;
|
|
7
|
-
//#endregion
|
|
8
6
|
export { todayInBudapest as a, toBudapestTimestamp as i, addBudapestDays as n, toBudapestDate as r, DateInput as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/core/dates.ts
|
|
2
2
|
const BUDAPEST_TIME_ZONE = "Europe/Budapest";
|
|
3
3
|
const budapestDateFormatter = new Intl.DateTimeFormat("en-CA", {
|
|
4
4
|
timeZone: BUDAPEST_TIME_ZONE,
|
|
@@ -67,7 +67,6 @@ function toAgentDate(input) {
|
|
|
67
67
|
function todayInBudapest(now = /* @__PURE__ */ new Date()) {
|
|
68
68
|
return toBudapestDate(now);
|
|
69
69
|
}
|
|
70
|
-
//#endregion
|
|
71
70
|
Object.defineProperty(exports, "addBudapestDays", {
|
|
72
71
|
enumerable: true,
|
|
73
72
|
get: function() {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_errors = require("../errors-
|
|
3
|
-
const require_client = require("../client-
|
|
4
|
-
const require_serialize = require("../serialize-
|
|
5
|
-
const require_parse = require("../parse-
|
|
6
|
-
const require_dates = require("../dates-
|
|
7
|
-
const require_tax_number = require("../tax-number-
|
|
8
|
-
|
|
2
|
+
const require_errors = require("../errors-Bn6pe6yw.cjs");
|
|
3
|
+
const require_client = require("../client-I_29IPMh.cjs");
|
|
4
|
+
const require_serialize = require("../serialize-DEU7r6Bk.cjs");
|
|
5
|
+
const require_parse = require("../parse-CmM5va-p.cjs");
|
|
6
|
+
const require_dates = require("../dates-oOp3ypPP.cjs");
|
|
7
|
+
const require_tax_number = require("../tax-number-XLdM5ETv.cjs");
|
|
8
|
+
// src/delegation/connect.ts
|
|
9
9
|
const CONNECT_PRINCIPAL_NAMESPACE = "http://www.szamlazz.hu/xmlcegmb";
|
|
10
10
|
const CONNECT_PRINCIPAL_SCHEMA_LOCATION = "http://www.szamlazz.hu/docs/xsds/agentmb/xmlcegmb.xsd";
|
|
11
11
|
const DELEGATE_PREFIX_PATTERN = /^[A-Z0-9]{1,5}$/;
|
|
@@ -234,8 +234,7 @@ async function connectPrincipal(input, options = {}) {
|
|
|
234
234
|
verifyTaxNumber
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
|
-
|
|
238
|
-
//#region src/delegation/pool.ts
|
|
237
|
+
// src/delegation/pool.ts
|
|
239
238
|
const DEFAULT_POOL_SIZE = 100;
|
|
240
239
|
const RECEIPT_PREFIX_PATTERN = /^[A-Z0-9]+$/;
|
|
241
240
|
function configuration$1(message, hint) {
|
|
@@ -332,8 +331,7 @@ function createKasszaPool(options) {
|
|
|
332
331
|
}
|
|
333
332
|
};
|
|
334
333
|
}
|
|
335
|
-
|
|
336
|
-
//#region src/delegation/probe.ts
|
|
334
|
+
// src/delegation/probe.ts
|
|
337
335
|
const DELEGATION_PROBE_INVOICE_NUMBER = "KASSZA-DELEGATION-PROBE-0";
|
|
338
336
|
const MESSAGES = {
|
|
339
337
|
active: "A megbízotti kapcsolat él: a dedikált felhasználó be tud lépni a megbízó fiókjába.",
|
|
@@ -375,7 +373,6 @@ async function probeDelegation(options) {
|
|
|
375
373
|
};
|
|
376
374
|
}
|
|
377
375
|
}
|
|
378
|
-
//#endregion
|
|
379
376
|
exports.CONNECT_PRINCIPAL_NAMESPACE = CONNECT_PRINCIPAL_NAMESPACE;
|
|
380
377
|
exports.CONNECT_PRINCIPAL_SCHEMA_LOCATION = CONNECT_PRINCIPAL_SCHEMA_LOCATION;
|
|
381
378
|
exports.DEFAULT_POOL_SIZE = DEFAULT_POOL_SIZE;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { t as DateInput } from "../dates-
|
|
2
|
-
import { D as XmlNode, O as AgentResponse, dt as suggestedPrefix, l as SzamlazzOptions, r as AgentContext, s as RequestOptions, st as SzamlazzError } from "../context-
|
|
3
|
-
import { i as KasszaOptions, n as Kassza, r as KasszaDefaults } from "../client-
|
|
4
|
-
//#region src/delegation/connect.d.ts
|
|
1
|
+
import { t as DateInput } from "../dates-nlGEokCf.cjs";
|
|
2
|
+
import { D as XmlNode, O as AgentResponse, dt as suggestedPrefix, l as SzamlazzOptions, r as AgentContext, s as RequestOptions, st as SzamlazzError } from "../context-PwqY4JOK.cjs";
|
|
3
|
+
import { i as KasszaOptions, n as Kassza, r as KasszaDefaults } from "../client-BT2odGYl.cjs";
|
|
5
4
|
export declare const CONNECT_PRINCIPAL_NAMESPACE = "http://www.szamlazz.hu/xmlcegmb";
|
|
6
5
|
export declare const CONNECT_PRINCIPAL_SCHEMA_LOCATION = "http://www.szamlazz.hu/docs/xsds/agentmb/xmlcegmb.xsd";
|
|
7
6
|
export declare const DELEGATE_PREFIX_PATTERN: RegExp;
|
|
@@ -61,8 +60,6 @@ export declare function connectPrincipalWith(ctx: AgentContext, input: ConnectPr
|
|
|
61
60
|
readonly verifyTaxNumber?: boolean | undefined;
|
|
62
61
|
}): Promise<ConnectPrincipalResult>;
|
|
63
62
|
export declare function connectPrincipal(input: ConnectPrincipalInput, options?: ConnectPrincipalOptions): Promise<ConnectPrincipalResult>;
|
|
64
|
-
//#endregion
|
|
65
|
-
//#region src/delegation/pool.d.ts
|
|
66
63
|
export declare const DEFAULT_POOL_SIZE = 100;
|
|
67
64
|
interface DelegateCredentials {
|
|
68
65
|
readonly username: string;
|
|
@@ -85,8 +82,6 @@ interface KasszaPool {
|
|
|
85
82
|
}
|
|
86
83
|
export declare function createDelegateKassza(options: DelegateKasszaOptions): Kassza;
|
|
87
84
|
export declare function createKasszaPool(options: KasszaPoolOptions): KasszaPool;
|
|
88
|
-
//#endregion
|
|
89
|
-
//#region src/delegation/probe.d.ts
|
|
90
85
|
type DelegationState = "active" | "awaiting-approval" | "awaiting-owner-registration" | "multi-account-user";
|
|
91
86
|
interface DelegationProbeResult {
|
|
92
87
|
readonly state: DelegationState;
|
|
@@ -96,5 +91,4 @@ interface DelegationProbeResult {
|
|
|
96
91
|
interface ProbeDelegationOptions extends SzamlazzOptions, RequestOptions {}
|
|
97
92
|
export declare const DELEGATION_PROBE_INVOICE_NUMBER = "KASSZA-DELEGATION-PROBE-0";
|
|
98
93
|
export declare function probeDelegation(options: ProbeDelegationOptions): Promise<DelegationProbeResult>;
|
|
99
|
-
//#endregion
|
|
100
94
|
export { type ConnectPrincipalInput, type ConnectPrincipalOptions, type ConnectPrincipalResponse, type ConnectPrincipalResult, type ConnectPrincipalStatus, type DelegateCredentials, type DelegateKasszaOptions, type DelegateResolver, type DelegateUser, type DelegationProbeResult, type DelegationState, type KasszaPool, type KasszaPoolOptions, type PrincipalAddress, type PrincipalCompany, type ProbeDelegationOptions, suggestedPrefix };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { t as DateInput } from "../dates-
|
|
2
|
-
import { D as XmlNode, O as AgentResponse, dt as suggestedPrefix, l as SzamlazzOptions, r as AgentContext, s as RequestOptions, st as SzamlazzError } from "../context-
|
|
3
|
-
import { i as KasszaOptions, n as Kassza, r as KasszaDefaults } from "../client-
|
|
4
|
-
//#region src/delegation/connect.d.ts
|
|
1
|
+
import { t as DateInput } from "../dates-nlGEokCf.js";
|
|
2
|
+
import { D as XmlNode, O as AgentResponse, dt as suggestedPrefix, l as SzamlazzOptions, r as AgentContext, s as RequestOptions, st as SzamlazzError } from "../context-BuX6Eion.js";
|
|
3
|
+
import { i as KasszaOptions, n as Kassza, r as KasszaDefaults } from "../client-C-SYCiOZ.js";
|
|
5
4
|
export declare const CONNECT_PRINCIPAL_NAMESPACE = "http://www.szamlazz.hu/xmlcegmb";
|
|
6
5
|
export declare const CONNECT_PRINCIPAL_SCHEMA_LOCATION = "http://www.szamlazz.hu/docs/xsds/agentmb/xmlcegmb.xsd";
|
|
7
6
|
export declare const DELEGATE_PREFIX_PATTERN: RegExp;
|
|
@@ -61,8 +60,6 @@ export declare function connectPrincipalWith(ctx: AgentContext, input: ConnectPr
|
|
|
61
60
|
readonly verifyTaxNumber?: boolean | undefined;
|
|
62
61
|
}): Promise<ConnectPrincipalResult>;
|
|
63
62
|
export declare function connectPrincipal(input: ConnectPrincipalInput, options?: ConnectPrincipalOptions): Promise<ConnectPrincipalResult>;
|
|
64
|
-
//#endregion
|
|
65
|
-
//#region src/delegation/pool.d.ts
|
|
66
63
|
export declare const DEFAULT_POOL_SIZE = 100;
|
|
67
64
|
interface DelegateCredentials {
|
|
68
65
|
readonly username: string;
|
|
@@ -85,8 +82,6 @@ interface KasszaPool {
|
|
|
85
82
|
}
|
|
86
83
|
export declare function createDelegateKassza(options: DelegateKasszaOptions): Kassza;
|
|
87
84
|
export declare function createKasszaPool(options: KasszaPoolOptions): KasszaPool;
|
|
88
|
-
//#endregion
|
|
89
|
-
//#region src/delegation/probe.d.ts
|
|
90
85
|
type DelegationState = "active" | "awaiting-approval" | "awaiting-owner-registration" | "multi-account-user";
|
|
91
86
|
interface DelegationProbeResult {
|
|
92
87
|
readonly state: DelegationState;
|
|
@@ -96,5 +91,4 @@ interface DelegationProbeResult {
|
|
|
96
91
|
interface ProbeDelegationOptions extends SzamlazzOptions, RequestOptions {}
|
|
97
92
|
export declare const DELEGATION_PROBE_INVOICE_NUMBER = "KASSZA-DELEGATION-PROBE-0";
|
|
98
93
|
export declare function probeDelegation(options: ProbeDelegationOptions): Promise<DelegationProbeResult>;
|
|
99
|
-
//#endregion
|
|
100
94
|
export { type ConnectPrincipalInput, type ConnectPrincipalOptions, type ConnectPrincipalResponse, type ConnectPrincipalResult, type ConnectPrincipalStatus, type DelegateCredentials, type DelegateKasszaOptions, type DelegateResolver, type DelegateUser, type DelegationProbeResult, type DelegationState, type KasszaPool, type KasszaPoolOptions, type PrincipalAddress, type PrincipalCompany, type ProbeDelegationOptions, suggestedPrefix };
|
package/dist/delegation/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { c as suggestedPrefix, o as isSzamlazzError, r as SzamlazzError } from "../errors-
|
|
2
|
-
import { a as queryTaxpayer, c as createAgentContext, o as getInvoicePdf, t as createKassza } from "../client-
|
|
3
|
-
import { a as optionalEl, n as buildXmlDocument, r as el } from "../serialize-
|
|
4
|
-
import { h as unexpectedResponse, i as decodeHeaderValue, l as readHeader, u as throwIfAnyError } from "../parse-
|
|
5
|
-
import { n as toAgentDate } from "../dates-
|
|
6
|
-
import { o as parseHungarianTaxNumber, s as isValidEmail } from "../tax-number-
|
|
7
|
-
|
|
1
|
+
import { c as suggestedPrefix, o as isSzamlazzError, r as SzamlazzError } from "../errors-CGGsW0Y5.js";
|
|
2
|
+
import { a as queryTaxpayer, c as createAgentContext, o as getInvoicePdf, t as createKassza } from "../client-JZ1M1sZX.js";
|
|
3
|
+
import { a as optionalEl, n as buildXmlDocument, r as el } from "../serialize-CjymGkJj.js";
|
|
4
|
+
import { h as unexpectedResponse, i as decodeHeaderValue, l as readHeader, u as throwIfAnyError } from "../parse-1RiSh4vY.js";
|
|
5
|
+
import { n as toAgentDate } from "../dates-DWsZOdaO.js";
|
|
6
|
+
import { o as parseHungarianTaxNumber, s as isValidEmail } from "../tax-number-C6jySuGR.js";
|
|
7
|
+
// src/delegation/connect.ts
|
|
8
8
|
const CONNECT_PRINCIPAL_NAMESPACE = "http://www.szamlazz.hu/xmlcegmb";
|
|
9
9
|
const CONNECT_PRINCIPAL_SCHEMA_LOCATION = "http://www.szamlazz.hu/docs/xsds/agentmb/xmlcegmb.xsd";
|
|
10
10
|
const DELEGATE_PREFIX_PATTERN = /^[A-Z0-9]{1,5}$/;
|
|
@@ -233,8 +233,7 @@ async function connectPrincipal(input, options = {}) {
|
|
|
233
233
|
verifyTaxNumber
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
|
-
|
|
237
|
-
//#region src/delegation/pool.ts
|
|
236
|
+
// src/delegation/pool.ts
|
|
238
237
|
const DEFAULT_POOL_SIZE = 100;
|
|
239
238
|
const RECEIPT_PREFIX_PATTERN = /^[A-Z0-9]+$/;
|
|
240
239
|
function configuration$1(message, hint) {
|
|
@@ -331,8 +330,7 @@ function createKasszaPool(options) {
|
|
|
331
330
|
}
|
|
332
331
|
};
|
|
333
332
|
}
|
|
334
|
-
|
|
335
|
-
//#region src/delegation/probe.ts
|
|
333
|
+
// src/delegation/probe.ts
|
|
336
334
|
const DELEGATION_PROBE_INVOICE_NUMBER = "KASSZA-DELEGATION-PROBE-0";
|
|
337
335
|
const MESSAGES = {
|
|
338
336
|
active: "A megbízotti kapcsolat él: a dedikált felhasználó be tud lépni a megbízó fiókjába.",
|
|
@@ -374,5 +372,4 @@ async function probeDelegation(options) {
|
|
|
374
372
|
};
|
|
375
373
|
}
|
|
376
374
|
}
|
|
377
|
-
//#endregion
|
|
378
375
|
export { CONNECT_PRINCIPAL_NAMESPACE, CONNECT_PRINCIPAL_SCHEMA_LOCATION, DEFAULT_POOL_SIZE, DELEGATE_PASSWORD_MAX_LENGTH, DELEGATE_PASSWORD_MIN_LENGTH, DELEGATE_PREFIX_PATTERN, DELEGATION_PROBE_INVOICE_NUMBER, assertDelegatePrefix, buildConnectPrincipalXml, connectPrincipal, connectPrincipalStatus, connectPrincipalWith, createDelegateKassza, createKasszaPool, normalizeDelegateTaxNumber, parseConnectPrincipalResponse, probeDelegation, suggestedPrefix };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/core/errors.ts
|
|
2
2
|
const SIMPLE_ITEMS_HINT = "Az egyszerűsített számlakép (simpleItems) szabályait lásd a docs utazásszervezőknek szóló oldalán.";
|
|
3
3
|
const ITEM_AMOUNT_HINT = "Használd a tételeknél a netUnitPrice vagy grossUnitPrice mezőt, és hagyd, hogy a csomag számolja ki az összegeket.";
|
|
4
4
|
const RECEIPT_AMOUNT_HINT = "Forintos nyugtán a bruttó egész szám, a nettó és az áfa legfeljebb 2 tizedes, és a nettó + áfa pontosan a bruttó.";
|
|
@@ -278,6 +278,16 @@ const AGENT_ERROR_CODES = {
|
|
|
278
278
|
category: "validation",
|
|
279
279
|
hint: "A dedikált felhasználó jelszava legfeljebb 128 karakter lehet."
|
|
280
280
|
},
|
|
281
|
+
520: {
|
|
282
|
+
message: "Nincs elegendő törlőkódod, kérlek tölts fel újat.",
|
|
283
|
+
category: "account",
|
|
284
|
+
hint: "Tölts fel új adattörlő kódokat a Számlázz.hu fiókodba. A bizonylat nem jött létre."
|
|
285
|
+
},
|
|
286
|
+
521: {
|
|
287
|
+
message: "Jelenleg csak a Számlázz.hu ajánlott számlaképpel használható a törlőkód.",
|
|
288
|
+
category: "validation",
|
|
289
|
+
hint: "Adattörlő kódot csak az alapértelmezett sablonnal kérj: számlánál az ajánlott számlaképpel (SzlaMost), nyugtánál a normál A4-es sablonnal."
|
|
290
|
+
},
|
|
281
291
|
524: {
|
|
282
292
|
message: "A nyugtaszám-előtag nincs engedélyezve.",
|
|
283
293
|
category: "account",
|
|
@@ -383,7 +393,7 @@ function createAgentError(input) {
|
|
|
383
393
|
rawResponse: input.rawResponse
|
|
384
394
|
});
|
|
385
395
|
}
|
|
386
|
-
const SUGGESTED_PREFIX_PATTERN = /haszn[áa]ld ezt:\s
|
|
396
|
+
const SUGGESTED_PREFIX_PATTERN = /haszn[áa]ld ezt:\s*(?:\(\s*)?([A-Z0-9]+)\s*\)?/i;
|
|
387
397
|
function suggestedPrefix(error) {
|
|
388
398
|
if (!(error instanceof SzamlazzError) || error.code !== 356) return void 0;
|
|
389
399
|
return SUGGESTED_PREFIX_PATTERN.exec(error.message)?.[1]?.toUpperCase();
|
|
@@ -394,7 +404,6 @@ function parseErrorCode(value) {
|
|
|
394
404
|
if (!/^-?\d+$/.test(trimmed)) return void 0;
|
|
395
405
|
return Number(trimmed);
|
|
396
406
|
}
|
|
397
|
-
//#endregion
|
|
398
407
|
Object.defineProperty(exports, "AGENT_ERROR_CODES", {
|
|
399
408
|
enumerable: true,
|
|
400
409
|
get: function() {
|