kassza 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +283 -18
- package/agents/README.md +20 -5
- package/agents/api.md +165 -2
- package/agents/pitfalls.md +16 -3
- package/agents/recipes.md +215 -45
- package/agents/skills/kassza/SKILL.md +11 -8
- package/dist/cli.cjs +552 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +552 -0
- package/dist/client-6MkeuFqD.d.ts +268 -0
- package/dist/client-B5FryKxJ.d.cts +268 -0
- package/dist/{client-CsmGIFRS.cjs → client-C-PdfL_P.cjs} +235 -597
- package/dist/{client-CL3fuH6A.js → client-CfaS1-Jx.js} +35 -403
- package/dist/context-BxQlIlug.d.ts +425 -0
- package/dist/context-DXNbTPwz.d.cts +425 -0
- package/dist/{create-once-CqdYmQD8.js → create-once-Cz621l8r.js} +3 -3
- package/dist/{create-once-D0pwuenl.cjs → create-once-DgMtKKcG.cjs} +8 -2
- package/dist/{crypto-B8lERvR1.cjs → crypto-Dpn4FHQ6.cjs} +9 -0
- package/dist/{crypto-DK_osBVy.js → crypto-usDg8L2K.js} +4 -1
- package/dist/data-link/index.cjs +232 -0
- package/dist/data-link/index.d.cts +79 -0
- package/dist/data-link/index.d.ts +79 -0
- package/dist/data-link/index.js +224 -0
- package/dist/delegation/index.cjs +34 -33
- package/dist/delegation/index.d.cts +2 -1
- package/dist/delegation/index.d.ts +2 -1
- package/dist/delegation/index.js +3 -2
- package/dist/get-Byc9T5WO.d.cts +151 -0
- package/dist/get-Byc9T5WO.d.ts +151 -0
- package/dist/get-Csm2n0rZ.cjs +445 -0
- package/dist/get-DT3JEgQ6.js +380 -0
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -3
- package/dist/{issue-BsyYdrIG.cjs → issue-AGRohSm7.cjs} +48 -665
- package/dist/{issue-C6Fcjvln.js → issue-DtSLpVdJ.js} +5 -502
- package/dist/mcp/index.cjs +10 -0
- package/dist/mcp/index.d.cts +71 -0
- package/dist/mcp/index.d.ts +71 -0
- package/dist/mcp/index.js +2 -0
- package/dist/money/index.cjs +1 -1
- package/dist/money/index.js +1 -1
- package/dist/{money-DrhGkWHW.cjs → money-BxytJW6f.cjs} +25 -9
- package/dist/{money-DAA7OwiO.js → money-t7uy1n91.js} +25 -9
- package/dist/nav/index.cjs +1046 -0
- package/dist/nav/index.d.cts +247 -0
- package/dist/nav/index.d.ts +247 -0
- package/dist/nav/index.js +1012 -0
- package/dist/nav-BEwcX7-N.cjs +203 -0
- package/dist/nav-CK1WgYo7.js +156 -0
- package/dist/parse-BJj-aqKy.cjs +380 -0
- package/dist/parse-C608ehqM.js +291 -0
- package/dist/payments/barion.cjs +1 -1
- package/dist/payments/barion.d.cts +2 -2
- package/dist/payments/barion.d.ts +2 -2
- package/dist/payments/barion.js +1 -1
- package/dist/payments/index.cjs +2 -2
- package/dist/payments/index.d.cts +3 -3
- package/dist/payments/index.d.ts +3 -3
- package/dist/payments/index.js +2 -2
- package/dist/payments/paypal.cjs +1 -1
- package/dist/payments/paypal.d.cts +2 -2
- package/dist/payments/paypal.d.ts +2 -2
- package/dist/payments/paypal.js +1 -1
- package/dist/payments/revolut.cjs +2 -2
- package/dist/payments/revolut.d.cts +2 -2
- package/dist/payments/revolut.d.ts +2 -2
- package/dist/payments/revolut.js +2 -2
- package/dist/payments/simplepay.cjs +2 -2
- package/dist/payments/simplepay.d.cts +2 -2
- package/dist/payments/simplepay.d.ts +2 -2
- package/dist/payments/simplepay.js +2 -2
- package/dist/payments/stripe.cjs +2 -2
- package/dist/payments/stripe.d.cts +2 -2
- package/dist/payments/stripe.d.ts +2 -2
- package/dist/payments/stripe.js +2 -2
- package/dist/reports/index.cjs +11 -164
- package/dist/reports/index.js +1 -154
- package/dist/request-body-CH6ZGOrq.cjs +34 -0
- package/dist/request-body-uZHMRlQr.js +29 -0
- package/dist/serialize-BXOww1Uq.cjs +286 -0
- package/dist/serialize-DSE_o9RK.js +215 -0
- package/dist/server-C6PoNkdD.cjs +1557 -0
- package/dist/server-Cd8HB661.js +1504 -0
- package/dist/testing/index.cjs +1476 -3
- package/dist/testing/index.d.cts +194 -2
- package/dist/testing/index.d.ts +194 -2
- package/dist/testing/index.js +1477 -6
- package/dist/{types-COf1LAD-.d.cts → types-BVeR7KyU.d.cts} +1 -1
- package/dist/{types-COf1LAD-.d.ts → types-BVeR7KyU.d.ts} +1 -1
- package/dist/{webhook-C76bV-4R.cjs → webhook-81giRMdQ.cjs} +3 -25
- package/dist/{webhook-q2OzNwd7.d.ts → webhook-CpCMHhn2.d.ts} +1 -1
- package/dist/{webhook-CfaDgcL0.d.cts → webhook-CpMJuP6c.d.cts} +1 -1
- package/dist/{webhook-D4lvtex1.js → webhook-CrEGohbg.js} +3 -25
- package/llms.txt +4 -4
- package/package.json +43 -1
- package/dist/client-CickRRFr.d.ts +0 -838
- package/dist/client-DvWZoX_E.d.cts +0 -838
package/dist/payments/barion.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as roundMoney } from "../rounding-BLyHjjI5.js";
|
|
2
|
-
import { a as readRawBody, d as normalizeCurrency, i as plainResponse, o as PaymentProviderError, s as WebhookVerificationError, t as respondToWebhook } from "../webhook-
|
|
2
|
+
import { a as readRawBody, d as normalizeCurrency, i as plainResponse, o as PaymentProviderError, s as WebhookVerificationError, t as respondToWebhook } from "../webhook-CrEGohbg.js";
|
|
3
3
|
import { a as text, i as records, r as record, t as numeric } from "../json-DjnqnaJK.js";
|
|
4
4
|
//#region src/payments/barion.ts
|
|
5
5
|
const BARION_LIVE_API_URL = "https://api.barion.com";
|
package/dist/payments/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_issue = require("../issue-
|
|
3
|
-
const require_webhook = require("../webhook-
|
|
2
|
+
const require_issue = require("../issue-AGRohSm7.cjs");
|
|
3
|
+
const require_webhook = require("../webhook-81giRMdQ.cjs");
|
|
4
4
|
exports.DEFAULT_MAX_WEBHOOK_BYTES = require_webhook.DEFAULT_MAX_WEBHOOK_BYTES;
|
|
5
5
|
exports.PaymentProviderError = require_webhook.PaymentProviderError;
|
|
6
6
|
exports.WebhookVerificationError = require_webhook.WebhookVerificationError;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as buyerFromCustomer, S as SkippedPayment, T as paymentOrderNumber, _ as IssuedInvoice, b as PaymentDocumentItem, g as IssuedDocument, h as IssueForPaymentOptions, v as IssuedReceipt, w as issueForPayment, x as PaymentDocumentsApi, y as IssuedReversal } from "../client-
|
|
2
|
-
import { a as PaymentEventKind, c as PaymentProvider, i as PaymentEvent, l as PaymentWebhookBaseOptions, n as PaymentAmount, o as PaymentHandler, r as PaymentCustomer, s as PaymentLineItem, t as PaymentAddress } from "../types-
|
|
3
|
-
import { n as respondToWebhook, t as WebhookHandler } from "../webhook-
|
|
1
|
+
import { C as buyerFromCustomer, S as SkippedPayment, T as paymentOrderNumber, _ as IssuedInvoice, b as PaymentDocumentItem, g as IssuedDocument, h as IssueForPaymentOptions, v as IssuedReceipt, w as issueForPayment, x as PaymentDocumentsApi, y as IssuedReversal } from "../client-B5FryKxJ.cjs";
|
|
2
|
+
import { a as PaymentEventKind, c as PaymentProvider, i as PaymentEvent, l as PaymentWebhookBaseOptions, n as PaymentAmount, o as PaymentHandler, r as PaymentCustomer, s as PaymentLineItem, t as PaymentAddress } from "../types-BVeR7KyU.cjs";
|
|
3
|
+
import { n as respondToWebhook, t as WebhookHandler } from "../webhook-CpMJuP6c.cjs";
|
|
4
4
|
//#region src/payments/amounts.d.ts
|
|
5
5
|
type MinorUnitConvention = "iso4217" | "stripe";
|
|
6
6
|
export declare function currencyExponent(currency: string, convention: MinorUnitConvention): number;
|
package/dist/payments/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as buyerFromCustomer, S as SkippedPayment, T as paymentOrderNumber, _ as IssuedInvoice, b as PaymentDocumentItem, g as IssuedDocument, h as IssueForPaymentOptions, v as IssuedReceipt, w as issueForPayment, x as PaymentDocumentsApi, y as IssuedReversal } from "../client-
|
|
2
|
-
import { a as PaymentEventKind, c as PaymentProvider, i as PaymentEvent, l as PaymentWebhookBaseOptions, n as PaymentAmount, o as PaymentHandler, r as PaymentCustomer, s as PaymentLineItem, t as PaymentAddress } from "../types-
|
|
3
|
-
import { n as respondToWebhook, t as WebhookHandler } from "../webhook-
|
|
1
|
+
import { C as buyerFromCustomer, S as SkippedPayment, T as paymentOrderNumber, _ as IssuedInvoice, b as PaymentDocumentItem, g as IssuedDocument, h as IssueForPaymentOptions, v as IssuedReceipt, w as issueForPayment, x as PaymentDocumentsApi, y as IssuedReversal } from "../client-6MkeuFqD.js";
|
|
2
|
+
import { a as PaymentEventKind, c as PaymentProvider, i as PaymentEvent, l as PaymentWebhookBaseOptions, n as PaymentAmount, o as PaymentHandler, r as PaymentCustomer, s as PaymentLineItem, t as PaymentAddress } from "../types-BVeR7KyU.js";
|
|
3
|
+
import { n as respondToWebhook, t as WebhookHandler } from "../webhook-CpCMHhn2.js";
|
|
4
4
|
//#region src/payments/amounts.d.ts
|
|
5
5
|
type MinorUnitConvention = "iso4217" | "stripe";
|
|
6
6
|
export declare function currencyExponent(currency: string, convention: MinorUnitConvention): number;
|
package/dist/payments/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as issueForPayment, r as paymentOrderNumber, t as buyerFromCustomer } from "../issue-
|
|
2
|
-
import { a as readRawBody, c as isWebhookVerificationError, d as normalizeCurrency, f as parseDecimalAmount, l as currencyExponent, n as DEFAULT_MAX_WEBHOOK_BYTES, o as PaymentProviderError, s as WebhookVerificationError, t as respondToWebhook, u as fromMinorUnits } from "../webhook-
|
|
1
|
+
import { n as issueForPayment, r as paymentOrderNumber, t as buyerFromCustomer } from "../issue-DtSLpVdJ.js";
|
|
2
|
+
import { a as readRawBody, c as isWebhookVerificationError, d as normalizeCurrency, f as parseDecimalAmount, l as currencyExponent, n as DEFAULT_MAX_WEBHOOK_BYTES, o as PaymentProviderError, s as WebhookVerificationError, t as respondToWebhook, u as fromMinorUnits } from "../webhook-CrEGohbg.js";
|
|
3
3
|
export { DEFAULT_MAX_WEBHOOK_BYTES, PaymentProviderError, WebhookVerificationError, buyerFromCustomer, currencyExponent, fromMinorUnits, isWebhookVerificationError, issueForPayment, normalizeCurrency, parseDecimalAmount, paymentOrderNumber, readRawBody, respondToWebhook };
|
package/dist/payments/paypal.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_binary = require("../binary-B89HM03_.cjs");
|
|
3
3
|
const require_rounding = require("../rounding-TxoWy2ww.cjs");
|
|
4
|
-
const require_webhook = require("../webhook-
|
|
4
|
+
const require_webhook = require("../webhook-81giRMdQ.cjs");
|
|
5
5
|
const require_json = require("../json-4y4E2xxS.cjs");
|
|
6
6
|
//#region src/payments/paypal.ts
|
|
7
7
|
const PAYPAL_LIVE_API_URL = "https://api-m.paypal.com";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as PaymentEvent, l as PaymentWebhookBaseOptions } from "../types-
|
|
1
|
+
import { i as PaymentEvent, l as PaymentWebhookBaseOptions } from "../types-BVeR7KyU.cjs";
|
|
2
2
|
import { t as JsonRecord } from "../json-B70TwoX1.cjs";
|
|
3
|
-
import { t as WebhookHandler } from "../webhook-
|
|
3
|
+
import { t as WebhookHandler } from "../webhook-CpMJuP6c.cjs";
|
|
4
4
|
//#region src/payments/paypal.d.ts
|
|
5
5
|
export declare const PAYPAL_LIVE_API_URL = "https://api-m.paypal.com";
|
|
6
6
|
export declare const PAYPAL_SANDBOX_API_URL = "https://api-m.sandbox.paypal.com";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as PaymentEvent, l as PaymentWebhookBaseOptions } from "../types-
|
|
1
|
+
import { i as PaymentEvent, l as PaymentWebhookBaseOptions } from "../types-BVeR7KyU.js";
|
|
2
2
|
import { t as JsonRecord } from "../json-B70TwoX1.js";
|
|
3
|
-
import { t as WebhookHandler } from "../webhook-
|
|
3
|
+
import { t as WebhookHandler } from "../webhook-CpCMHhn2.js";
|
|
4
4
|
//#region src/payments/paypal.d.ts
|
|
5
5
|
export declare const PAYPAL_LIVE_API_URL = "https://api-m.paypal.com";
|
|
6
6
|
export declare const PAYPAL_SANDBOX_API_URL = "https://api-m.sandbox.paypal.com";
|
package/dist/payments/paypal.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as encodeUtf8, n as bytesToBase64 } from "../binary-D0M9U2MD.js";
|
|
2
2
|
import { r as roundMoney } from "../rounding-BLyHjjI5.js";
|
|
3
|
-
import { a as readRawBody, d as normalizeCurrency, f as parseDecimalAmount, i as plainResponse, o as PaymentProviderError, r as parseJsonObject, s as WebhookVerificationError, t as respondToWebhook } from "../webhook-
|
|
3
|
+
import { a as readRawBody, d as normalizeCurrency, f as parseDecimalAmount, i as plainResponse, o as PaymentProviderError, r as parseJsonObject, s as WebhookVerificationError, t as respondToWebhook } from "../webhook-CrEGohbg.js";
|
|
4
4
|
import { a as text, i as records, n as path, r as record, t as numeric } from "../json-DjnqnaJK.js";
|
|
5
5
|
//#region src/payments/paypal.ts
|
|
6
6
|
const PAYPAL_LIVE_API_URL = "https://api-m.paypal.com";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
2
|
+
const require_crypto = require("../crypto-Dpn4FHQ6.cjs");
|
|
3
|
+
const require_webhook = require("../webhook-81giRMdQ.cjs");
|
|
4
4
|
const require_json = require("../json-4y4E2xxS.cjs");
|
|
5
5
|
//#region src/payments/revolut.ts
|
|
6
6
|
const REVOLUT_LIVE_API_URL = "https://merchant.revolut.com";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as PaymentEvent, l as PaymentWebhookBaseOptions } from "../types-
|
|
1
|
+
import { i as PaymentEvent, l as PaymentWebhookBaseOptions } from "../types-BVeR7KyU.cjs";
|
|
2
2
|
import { t as JsonRecord } from "../json-B70TwoX1.cjs";
|
|
3
|
-
import { t as WebhookHandler } from "../webhook-
|
|
3
|
+
import { t as WebhookHandler } from "../webhook-CpMJuP6c.cjs";
|
|
4
4
|
//#region src/payments/revolut.d.ts
|
|
5
5
|
export declare const REVOLUT_LIVE_API_URL = "https://merchant.revolut.com";
|
|
6
6
|
export declare const REVOLUT_SANDBOX_API_URL = "https://sandbox-merchant.revolut.com";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as PaymentEvent, l as PaymentWebhookBaseOptions } from "../types-
|
|
1
|
+
import { i as PaymentEvent, l as PaymentWebhookBaseOptions } from "../types-BVeR7KyU.js";
|
|
2
2
|
import { t as JsonRecord } from "../json-B70TwoX1.js";
|
|
3
|
-
import { t as WebhookHandler } from "../webhook-
|
|
3
|
+
import { t as WebhookHandler } from "../webhook-CpCMHhn2.js";
|
|
4
4
|
//#region src/payments/revolut.d.ts
|
|
5
5
|
export declare const REVOLUT_LIVE_API_URL = "https://merchant.revolut.com";
|
|
6
6
|
export declare const REVOLUT_SANDBOX_API_URL = "https://sandbox-merchant.revolut.com";
|
package/dist/payments/revolut.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import {
|
|
1
|
+
import { a as timingSafeEqual, i as hmacHex } from "../crypto-usDg8L2K.js";
|
|
2
|
+
import { a as readRawBody, d as normalizeCurrency, o as PaymentProviderError, r as parseJsonObject, s as WebhookVerificationError, t as respondToWebhook, u as fromMinorUnits } from "../webhook-CrEGohbg.js";
|
|
3
3
|
import { a as text, i as records, n as path, r as record, t as numeric } from "../json-DjnqnaJK.js";
|
|
4
4
|
//#region src/payments/revolut.ts
|
|
5
5
|
const REVOLUT_LIVE_API_URL = "https://merchant.revolut.com";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_binary = require("../binary-B89HM03_.cjs");
|
|
3
3
|
const require_dates = require("../dates-CPgBodkP.cjs");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const require_crypto = require("../crypto-Dpn4FHQ6.cjs");
|
|
5
|
+
const require_webhook = require("../webhook-81giRMdQ.cjs");
|
|
6
6
|
const require_json = require("../json-4y4E2xxS.cjs");
|
|
7
7
|
//#region src/payments/simplepay.ts
|
|
8
8
|
const SIMPLEPAY_LIVE_API_URL = "https://secure.simplepay.hu/payment/v2";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as PaymentEvent, l as PaymentWebhookBaseOptions, r as PaymentCustomer } from "../types-
|
|
1
|
+
import { i as PaymentEvent, l as PaymentWebhookBaseOptions, r as PaymentCustomer } from "../types-BVeR7KyU.cjs";
|
|
2
2
|
import { t as JsonRecord } from "../json-B70TwoX1.cjs";
|
|
3
|
-
import { t as WebhookHandler } from "../webhook-
|
|
3
|
+
import { t as WebhookHandler } from "../webhook-CpMJuP6c.cjs";
|
|
4
4
|
//#region src/payments/simplepay.d.ts
|
|
5
5
|
export declare const SIMPLEPAY_LIVE_API_URL = "https://secure.simplepay.hu/payment/v2";
|
|
6
6
|
export declare const SIMPLEPAY_SANDBOX_API_URL = "https://sandbox.simplepay.hu/payment/v2";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as PaymentEvent, l as PaymentWebhookBaseOptions, r as PaymentCustomer } from "../types-
|
|
1
|
+
import { i as PaymentEvent, l as PaymentWebhookBaseOptions, r as PaymentCustomer } from "../types-BVeR7KyU.js";
|
|
2
2
|
import { t as JsonRecord } from "../json-B70TwoX1.js";
|
|
3
|
-
import { t as WebhookHandler } from "../webhook-
|
|
3
|
+
import { t as WebhookHandler } from "../webhook-CpCMHhn2.js";
|
|
4
4
|
//#region src/payments/simplepay.d.ts
|
|
5
5
|
export declare const SIMPLEPAY_LIVE_API_URL = "https://secure.simplepay.hu/payment/v2";
|
|
6
6
|
export declare const SIMPLEPAY_SANDBOX_API_URL = "https://sandbox.simplepay.hu/payment/v2";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as bytesToBase64, r as decodeUtf8, t as base64ToBytes } from "../binary-D0M9U2MD.js";
|
|
2
2
|
import { i as toBudapestTimestamp } from "../dates-CXyj7Azy.js";
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
3
|
+
import { a as timingSafeEqual, r as hmac, t as bytesToHex } from "../crypto-usDg8L2K.js";
|
|
4
|
+
import { a as readRawBody, d as normalizeCurrency, o as PaymentProviderError, r as parseJsonObject, s as WebhookVerificationError, t as respondToWebhook } from "../webhook-CrEGohbg.js";
|
|
5
5
|
import { a as text, i as records, r as record, t as numeric } from "../json-DjnqnaJK.js";
|
|
6
6
|
//#region src/payments/simplepay.ts
|
|
7
7
|
const SIMPLEPAY_LIVE_API_URL = "https://secure.simplepay.hu/payment/v2";
|
package/dist/payments/stripe.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
2
|
+
const require_crypto = require("../crypto-Dpn4FHQ6.cjs");
|
|
3
|
+
const require_webhook = require("../webhook-81giRMdQ.cjs");
|
|
4
4
|
const require_json = require("../json-4y4E2xxS.cjs");
|
|
5
5
|
//#region src/payments/stripe.ts
|
|
6
6
|
const STRIPE_DEFAULT_TOLERANCE_SECONDS = 300;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as PaymentEvent, l as PaymentWebhookBaseOptions, s as PaymentLineItem } from "../types-
|
|
1
|
+
import { i as PaymentEvent, l as PaymentWebhookBaseOptions, s as PaymentLineItem } from "../types-BVeR7KyU.cjs";
|
|
2
2
|
import { t as JsonRecord } from "../json-B70TwoX1.cjs";
|
|
3
|
-
import { t as WebhookHandler } from "../webhook-
|
|
3
|
+
import { t as WebhookHandler } from "../webhook-CpMJuP6c.cjs";
|
|
4
4
|
//#region src/payments/stripe.d.ts
|
|
5
5
|
export declare const STRIPE_DEFAULT_TOLERANCE_SECONDS = 300;
|
|
6
6
|
export declare const STRIPE_API_URL = "https://api.stripe.com";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as PaymentEvent, l as PaymentWebhookBaseOptions, s as PaymentLineItem } from "../types-
|
|
1
|
+
import { i as PaymentEvent, l as PaymentWebhookBaseOptions, s as PaymentLineItem } from "../types-BVeR7KyU.js";
|
|
2
2
|
import { t as JsonRecord } from "../json-B70TwoX1.js";
|
|
3
|
-
import { t as WebhookHandler } from "../webhook-
|
|
3
|
+
import { t as WebhookHandler } from "../webhook-CpCMHhn2.js";
|
|
4
4
|
//#region src/payments/stripe.d.ts
|
|
5
5
|
export declare const STRIPE_DEFAULT_TOLERANCE_SECONDS = 300;
|
|
6
6
|
export declare const STRIPE_API_URL = "https://api.stripe.com";
|
package/dist/payments/stripe.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { i as
|
|
1
|
+
import { a as timingSafeEqual, i as hmacHex } from "../crypto-usDg8L2K.js";
|
|
2
|
+
import { a as readRawBody, d as normalizeCurrency, i as plainResponse, o as PaymentProviderError, r as parseJsonObject, s as WebhookVerificationError, t as respondToWebhook, u as fromMinorUnits } from "../webhook-CrEGohbg.js";
|
|
3
3
|
import { a as text, i as records, n as path, r as record, t as numeric } from "../json-DjnqnaJK.js";
|
|
4
4
|
//#region src/payments/stripe.ts
|
|
5
5
|
const STRIPE_DEFAULT_TOLERANCE_SECONDS = 300;
|
package/dist/reports/index.cjs
CHANGED
|
@@ -1,159 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_errors = require("../errors-DxeuTslP.cjs");
|
|
3
2
|
const require_rounding = require("../rounding-TxoWy2ww.cjs");
|
|
4
|
-
const
|
|
5
|
-
//#region src/reports/vat-category.ts
|
|
6
|
-
const NAV_VAT_CATEGORIES = [
|
|
7
|
-
"0%",
|
|
8
|
-
"5%",
|
|
9
|
-
"18%",
|
|
10
|
-
"27%",
|
|
11
|
-
"Alanyi adómentes",
|
|
12
|
-
"Egyéb"
|
|
13
|
-
];
|
|
14
|
-
const NUMERIC_CATEGORIES = /* @__PURE__ */ new Map([
|
|
15
|
-
[0, "0%"],
|
|
16
|
-
[5, "5%"],
|
|
17
|
-
[18, "18%"],
|
|
18
|
-
[27, "27%"]
|
|
19
|
-
]);
|
|
20
|
-
function navVatCategory(vat) {
|
|
21
|
-
if (typeof vat === "number") return NUMERIC_CATEGORIES.get(vat) ?? "Egyéb";
|
|
22
|
-
if (vat === "AAM") return "Alanyi adómentes";
|
|
23
|
-
return "Egyéb";
|
|
24
|
-
}
|
|
25
|
-
function isNavVatCategory(value) {
|
|
26
|
-
return NAV_VAT_CATEGORIES.includes(value);
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region src/reports/nav.ts
|
|
30
|
-
const SEQUENCE_PATTERN = /^(.*)-(\d+)$/;
|
|
31
|
-
function splitReceiptNumber(receiptNumber) {
|
|
32
|
-
const match = SEQUENCE_PATTERN.exec(receiptNumber.trim());
|
|
33
|
-
if (!match?.[1]) return {
|
|
34
|
-
series: receiptNumber.trim(),
|
|
35
|
-
sequence: void 0
|
|
36
|
-
};
|
|
37
|
-
return {
|
|
38
|
-
series: match[1],
|
|
39
|
-
sequence: Number(match[2])
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
function navCurrencyCode(currency) {
|
|
43
|
-
return require_vat.isHuf(currency) ? "HUF" : currency.trim().toUpperCase();
|
|
44
|
-
}
|
|
45
|
-
function compareReceiptNumbers(a, b) {
|
|
46
|
-
const left = splitReceiptNumber(a);
|
|
47
|
-
const right = splitReceiptNumber(b);
|
|
48
|
-
if (left.series === right.series && left.sequence !== void 0 && right.sequence !== void 0) return left.sequence - right.sequence;
|
|
49
|
-
return a.localeCompare(b, "hu");
|
|
50
|
-
}
|
|
51
|
-
function reportError(message) {
|
|
52
|
-
return new require_errors.SzamlazzError(message, { category: "validation" });
|
|
53
|
-
}
|
|
54
|
-
function exchangeRateOf(receipt, currency) {
|
|
55
|
-
if (currency === "HUF") return null;
|
|
56
|
-
const rate = receipt.exchangeRate;
|
|
57
|
-
if (rate === void 0 || !Number.isFinite(rate) || rate <= 0) throw reportError(`A(z) ${receipt.number} devizás (${currency}) nyugtán nincs érvényes árfolyam, ezért nem összesíthető.`);
|
|
58
|
-
return require_rounding.roundMoney(rate, 4);
|
|
59
|
-
}
|
|
60
|
-
function signedGross(item, receipt) {
|
|
61
|
-
return receipt.type === "reversal" ? -Math.abs(item.grossAmount) : item.grossAmount;
|
|
62
|
-
}
|
|
63
|
-
function bucketFor(buckets, receipt, series, currency, exchangeRate) {
|
|
64
|
-
const key = JSON.stringify([
|
|
65
|
-
receipt.issueDate,
|
|
66
|
-
series,
|
|
67
|
-
currency,
|
|
68
|
-
exchangeRate
|
|
69
|
-
]);
|
|
70
|
-
const existing = buckets.get(key);
|
|
71
|
-
if (existing) return existing;
|
|
72
|
-
const created = {
|
|
73
|
-
applicableDate: receipt.issueDate,
|
|
74
|
-
series,
|
|
75
|
-
currency,
|
|
76
|
-
exchangeRate,
|
|
77
|
-
categories: /* @__PURE__ */ new Map(),
|
|
78
|
-
numbers: [],
|
|
79
|
-
sales: 0,
|
|
80
|
-
modifying: 0
|
|
81
|
-
};
|
|
82
|
-
buckets.set(key, created);
|
|
83
|
-
return created;
|
|
84
|
-
}
|
|
85
|
-
function categoryOrder(name) {
|
|
86
|
-
const index = NAV_VAT_CATEGORIES.indexOf(name);
|
|
87
|
-
return index === -1 ? NAV_VAT_CATEGORIES.length : index;
|
|
88
|
-
}
|
|
89
|
-
function toReport(bucket) {
|
|
90
|
-
const vatCategories = [...bucket.categories.entries()].map(([vat, totals]) => ({
|
|
91
|
-
vat,
|
|
92
|
-
saleDocument: require_rounding.roundMoney(totals.sale, 2),
|
|
93
|
-
modifyingDocument: require_rounding.roundMoney(totals.modifying, 2)
|
|
94
|
-
})).sort((a, b) => categoryOrder(a.vat) - categoryOrder(b.vat) || a.vat.localeCompare(b.vat));
|
|
95
|
-
const total = require_rounding.roundMoney(vatCategories.reduce((sum, row) => sum + row.saleDocument + row.modifyingDocument, 0), 2);
|
|
96
|
-
const receiptNumbers = [...bucket.numbers].sort(compareReceiptNumbers);
|
|
97
|
-
return {
|
|
98
|
-
applicableDate: bucket.applicableDate,
|
|
99
|
-
series: bucket.series,
|
|
100
|
-
serialNumber: receiptNumbers[0] ?? "",
|
|
101
|
-
currency: bucket.currency,
|
|
102
|
-
exchangeRate: bucket.exchangeRate,
|
|
103
|
-
vatCategories,
|
|
104
|
-
total,
|
|
105
|
-
numberOfSaleDocument: bucket.sales,
|
|
106
|
-
numberOfModifyingDocument: bucket.modifying,
|
|
107
|
-
receiptNumbers
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
function assertIssueDate(receipt) {
|
|
111
|
-
if (!/^\d{4}-\d{2}-\d{2}$/.test(receipt.issueDate)) throw reportError(`A(z) ${receipt.number} nyugta kelte érvénytelen: "${receipt.issueDate}".`);
|
|
112
|
-
}
|
|
113
|
-
function navDailyReports(receipts, options = {}) {
|
|
114
|
-
const buckets = /* @__PURE__ */ new Map();
|
|
115
|
-
const seen = /* @__PURE__ */ new Set();
|
|
116
|
-
const seriesOf = options.series ?? ((number) => splitReceiptNumber(number).series);
|
|
117
|
-
const categoryOf = options.vatCategory ?? ((item) => navVatCategory(item.vat));
|
|
118
|
-
for (const receipt of receipts) {
|
|
119
|
-
if (receipt.isTest && options.includeTest !== true) continue;
|
|
120
|
-
if (seen.has(receipt.number)) continue;
|
|
121
|
-
seen.add(receipt.number);
|
|
122
|
-
assertIssueDate(receipt);
|
|
123
|
-
const currency = navCurrencyCode(receipt.currency);
|
|
124
|
-
const bucket = bucketFor(buckets, receipt, seriesOf(receipt.number), currency, exchangeRateOf(receipt, currency));
|
|
125
|
-
bucket.numbers.push(receipt.number);
|
|
126
|
-
const isModifying = receipt.type === "reversal";
|
|
127
|
-
if (isModifying) bucket.modifying += 1;
|
|
128
|
-
else bucket.sales += 1;
|
|
129
|
-
for (const item of receipt.items) {
|
|
130
|
-
const name = categoryOf(item, receipt);
|
|
131
|
-
const totals = bucket.categories.get(name) ?? {
|
|
132
|
-
sale: 0,
|
|
133
|
-
modifying: 0
|
|
134
|
-
};
|
|
135
|
-
if (isModifying) totals.modifying += signedGross(item, receipt);
|
|
136
|
-
else totals.sale += signedGross(item, receipt);
|
|
137
|
-
bucket.categories.set(name, totals);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return [...buckets.values()].map(toReport).sort((a, b) => a.applicableDate.localeCompare(b.applicableDate) || a.series.localeCompare(b.series, "hu") || a.currency.localeCompare(b.currency) || (a.exchangeRate ?? 0) - (b.exchangeRate ?? 0));
|
|
141
|
-
}
|
|
142
|
-
const amountFormatter = new Intl.NumberFormat("hu-HU", {
|
|
143
|
-
minimumFractionDigits: 0,
|
|
144
|
-
maximumFractionDigits: 2
|
|
145
|
-
});
|
|
146
|
-
function describeNavReport(report) {
|
|
147
|
-
return [
|
|
148
|
-
`Tárgynap: ${report.applicableDate}`,
|
|
149
|
-
`Kezdő nyugtasorszám: ${report.serialNumber}`,
|
|
150
|
-
`Pénznem: ${report.currency}${report.exchangeRate === null ? "" : ` (árfolyam: ${report.exchangeRate})`}`,
|
|
151
|
-
...report.vatCategories.map((row) => `${row.vat}: értékesítés ${amountFormatter.format(row.saleDocument)}, módosító/érvénytelenítő ${amountFormatter.format(row.modifyingDocument)}`),
|
|
152
|
-
`Végösszeg: ${amountFormatter.format(report.total)}`,
|
|
153
|
-
`Nyugták száma: ${report.numberOfSaleDocument}, módosító/érvénytelenítő bizonylatok száma: ${report.numberOfModifyingDocument}`
|
|
154
|
-
].join("\n");
|
|
155
|
-
}
|
|
156
|
-
//#endregion
|
|
3
|
+
const require_nav = require("../nav-BEwcX7-N.cjs");
|
|
157
4
|
//#region src/reports/close.ts
|
|
158
5
|
function sign(receipt, amount) {
|
|
159
6
|
return receipt.type === "reversal" ? -Math.abs(amount) : amount;
|
|
@@ -207,7 +54,7 @@ function toSummary(bucket) {
|
|
|
207
54
|
vatAmount: require_rounding.roundMoney(totals.vatAmount, 2),
|
|
208
55
|
grossAmount: require_rounding.roundMoney(totals.gross, 2)
|
|
209
56
|
})).sort((a, b) => String(a.vat).localeCompare(String(b.vat), "hu", { numeric: true })),
|
|
210
|
-
receiptNumbers: [...bucket.numbers].sort(compareReceiptNumbers)
|
|
57
|
+
receiptNumbers: [...bucket.numbers].sort(require_nav.compareReceiptNumbers)
|
|
211
58
|
};
|
|
212
59
|
}
|
|
213
60
|
function dailyClose(receipts, options = {}) {
|
|
@@ -217,7 +64,7 @@ function dailyClose(receipts, options = {}) {
|
|
|
217
64
|
if (receipt.isTest && options.includeTest !== true) continue;
|
|
218
65
|
if (seen.has(receipt.number)) continue;
|
|
219
66
|
seen.add(receipt.number);
|
|
220
|
-
const currency = navCurrencyCode(receipt.currency);
|
|
67
|
+
const currency = require_nav.navCurrencyCode(receipt.currency);
|
|
221
68
|
const key = `${receipt.issueDate}|${currency}`;
|
|
222
69
|
const bucket = buckets.get(key) ?? {
|
|
223
70
|
date: receipt.issueDate,
|
|
@@ -245,12 +92,12 @@ function dailyClose(receipts, options = {}) {
|
|
|
245
92
|
return [...buckets.values()].map(toSummary).sort((a, b) => a.date.localeCompare(b.date) || a.currency.localeCompare(b.currency));
|
|
246
93
|
}
|
|
247
94
|
//#endregion
|
|
248
|
-
exports.NAV_VAT_CATEGORIES = NAV_VAT_CATEGORIES;
|
|
249
|
-
exports.compareReceiptNumbers = compareReceiptNumbers;
|
|
95
|
+
exports.NAV_VAT_CATEGORIES = require_nav.NAV_VAT_CATEGORIES;
|
|
96
|
+
exports.compareReceiptNumbers = require_nav.compareReceiptNumbers;
|
|
250
97
|
exports.dailyClose = dailyClose;
|
|
251
|
-
exports.describeNavReport = describeNavReport;
|
|
252
|
-
exports.isNavVatCategory = isNavVatCategory;
|
|
253
|
-
exports.navCurrencyCode = navCurrencyCode;
|
|
254
|
-
exports.navDailyReports = navDailyReports;
|
|
255
|
-
exports.navVatCategory = navVatCategory;
|
|
256
|
-
exports.splitReceiptNumber = splitReceiptNumber;
|
|
98
|
+
exports.describeNavReport = require_nav.describeNavReport;
|
|
99
|
+
exports.isNavVatCategory = require_nav.isNavVatCategory;
|
|
100
|
+
exports.navCurrencyCode = require_nav.navCurrencyCode;
|
|
101
|
+
exports.navDailyReports = require_nav.navDailyReports;
|
|
102
|
+
exports.navVatCategory = require_nav.navVatCategory;
|
|
103
|
+
exports.splitReceiptNumber = require_nav.splitReceiptNumber;
|
package/dist/reports/index.js
CHANGED
|
@@ -1,158 +1,5 @@
|
|
|
1
|
-
import { n as SzamlazzError } from "../errors-DLrb0g64.js";
|
|
2
1
|
import { r as roundMoney } from "../rounding-BLyHjjI5.js";
|
|
3
|
-
import { i as
|
|
4
|
-
//#region src/reports/vat-category.ts
|
|
5
|
-
const NAV_VAT_CATEGORIES = [
|
|
6
|
-
"0%",
|
|
7
|
-
"5%",
|
|
8
|
-
"18%",
|
|
9
|
-
"27%",
|
|
10
|
-
"Alanyi adómentes",
|
|
11
|
-
"Egyéb"
|
|
12
|
-
];
|
|
13
|
-
const NUMERIC_CATEGORIES = /* @__PURE__ */ new Map([
|
|
14
|
-
[0, "0%"],
|
|
15
|
-
[5, "5%"],
|
|
16
|
-
[18, "18%"],
|
|
17
|
-
[27, "27%"]
|
|
18
|
-
]);
|
|
19
|
-
function navVatCategory(vat) {
|
|
20
|
-
if (typeof vat === "number") return NUMERIC_CATEGORIES.get(vat) ?? "Egyéb";
|
|
21
|
-
if (vat === "AAM") return "Alanyi adómentes";
|
|
22
|
-
return "Egyéb";
|
|
23
|
-
}
|
|
24
|
-
function isNavVatCategory(value) {
|
|
25
|
-
return NAV_VAT_CATEGORIES.includes(value);
|
|
26
|
-
}
|
|
27
|
-
//#endregion
|
|
28
|
-
//#region src/reports/nav.ts
|
|
29
|
-
const SEQUENCE_PATTERN = /^(.*)-(\d+)$/;
|
|
30
|
-
function splitReceiptNumber(receiptNumber) {
|
|
31
|
-
const match = SEQUENCE_PATTERN.exec(receiptNumber.trim());
|
|
32
|
-
if (!match?.[1]) return {
|
|
33
|
-
series: receiptNumber.trim(),
|
|
34
|
-
sequence: void 0
|
|
35
|
-
};
|
|
36
|
-
return {
|
|
37
|
-
series: match[1],
|
|
38
|
-
sequence: Number(match[2])
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
function navCurrencyCode(currency) {
|
|
42
|
-
return isHuf(currency) ? "HUF" : currency.trim().toUpperCase();
|
|
43
|
-
}
|
|
44
|
-
function compareReceiptNumbers(a, b) {
|
|
45
|
-
const left = splitReceiptNumber(a);
|
|
46
|
-
const right = splitReceiptNumber(b);
|
|
47
|
-
if (left.series === right.series && left.sequence !== void 0 && right.sequence !== void 0) return left.sequence - right.sequence;
|
|
48
|
-
return a.localeCompare(b, "hu");
|
|
49
|
-
}
|
|
50
|
-
function reportError(message) {
|
|
51
|
-
return new SzamlazzError(message, { category: "validation" });
|
|
52
|
-
}
|
|
53
|
-
function exchangeRateOf(receipt, currency) {
|
|
54
|
-
if (currency === "HUF") return null;
|
|
55
|
-
const rate = receipt.exchangeRate;
|
|
56
|
-
if (rate === void 0 || !Number.isFinite(rate) || rate <= 0) throw reportError(`A(z) ${receipt.number} devizás (${currency}) nyugtán nincs érvényes árfolyam, ezért nem összesíthető.`);
|
|
57
|
-
return roundMoney(rate, 4);
|
|
58
|
-
}
|
|
59
|
-
function signedGross(item, receipt) {
|
|
60
|
-
return receipt.type === "reversal" ? -Math.abs(item.grossAmount) : item.grossAmount;
|
|
61
|
-
}
|
|
62
|
-
function bucketFor(buckets, receipt, series, currency, exchangeRate) {
|
|
63
|
-
const key = JSON.stringify([
|
|
64
|
-
receipt.issueDate,
|
|
65
|
-
series,
|
|
66
|
-
currency,
|
|
67
|
-
exchangeRate
|
|
68
|
-
]);
|
|
69
|
-
const existing = buckets.get(key);
|
|
70
|
-
if (existing) return existing;
|
|
71
|
-
const created = {
|
|
72
|
-
applicableDate: receipt.issueDate,
|
|
73
|
-
series,
|
|
74
|
-
currency,
|
|
75
|
-
exchangeRate,
|
|
76
|
-
categories: /* @__PURE__ */ new Map(),
|
|
77
|
-
numbers: [],
|
|
78
|
-
sales: 0,
|
|
79
|
-
modifying: 0
|
|
80
|
-
};
|
|
81
|
-
buckets.set(key, created);
|
|
82
|
-
return created;
|
|
83
|
-
}
|
|
84
|
-
function categoryOrder(name) {
|
|
85
|
-
const index = NAV_VAT_CATEGORIES.indexOf(name);
|
|
86
|
-
return index === -1 ? NAV_VAT_CATEGORIES.length : index;
|
|
87
|
-
}
|
|
88
|
-
function toReport(bucket) {
|
|
89
|
-
const vatCategories = [...bucket.categories.entries()].map(([vat, totals]) => ({
|
|
90
|
-
vat,
|
|
91
|
-
saleDocument: roundMoney(totals.sale, 2),
|
|
92
|
-
modifyingDocument: roundMoney(totals.modifying, 2)
|
|
93
|
-
})).sort((a, b) => categoryOrder(a.vat) - categoryOrder(b.vat) || a.vat.localeCompare(b.vat));
|
|
94
|
-
const total = roundMoney(vatCategories.reduce((sum, row) => sum + row.saleDocument + row.modifyingDocument, 0), 2);
|
|
95
|
-
const receiptNumbers = [...bucket.numbers].sort(compareReceiptNumbers);
|
|
96
|
-
return {
|
|
97
|
-
applicableDate: bucket.applicableDate,
|
|
98
|
-
series: bucket.series,
|
|
99
|
-
serialNumber: receiptNumbers[0] ?? "",
|
|
100
|
-
currency: bucket.currency,
|
|
101
|
-
exchangeRate: bucket.exchangeRate,
|
|
102
|
-
vatCategories,
|
|
103
|
-
total,
|
|
104
|
-
numberOfSaleDocument: bucket.sales,
|
|
105
|
-
numberOfModifyingDocument: bucket.modifying,
|
|
106
|
-
receiptNumbers
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
function assertIssueDate(receipt) {
|
|
110
|
-
if (!/^\d{4}-\d{2}-\d{2}$/.test(receipt.issueDate)) throw reportError(`A(z) ${receipt.number} nyugta kelte érvénytelen: "${receipt.issueDate}".`);
|
|
111
|
-
}
|
|
112
|
-
function navDailyReports(receipts, options = {}) {
|
|
113
|
-
const buckets = /* @__PURE__ */ new Map();
|
|
114
|
-
const seen = /* @__PURE__ */ new Set();
|
|
115
|
-
const seriesOf = options.series ?? ((number) => splitReceiptNumber(number).series);
|
|
116
|
-
const categoryOf = options.vatCategory ?? ((item) => navVatCategory(item.vat));
|
|
117
|
-
for (const receipt of receipts) {
|
|
118
|
-
if (receipt.isTest && options.includeTest !== true) continue;
|
|
119
|
-
if (seen.has(receipt.number)) continue;
|
|
120
|
-
seen.add(receipt.number);
|
|
121
|
-
assertIssueDate(receipt);
|
|
122
|
-
const currency = navCurrencyCode(receipt.currency);
|
|
123
|
-
const bucket = bucketFor(buckets, receipt, seriesOf(receipt.number), currency, exchangeRateOf(receipt, currency));
|
|
124
|
-
bucket.numbers.push(receipt.number);
|
|
125
|
-
const isModifying = receipt.type === "reversal";
|
|
126
|
-
if (isModifying) bucket.modifying += 1;
|
|
127
|
-
else bucket.sales += 1;
|
|
128
|
-
for (const item of receipt.items) {
|
|
129
|
-
const name = categoryOf(item, receipt);
|
|
130
|
-
const totals = bucket.categories.get(name) ?? {
|
|
131
|
-
sale: 0,
|
|
132
|
-
modifying: 0
|
|
133
|
-
};
|
|
134
|
-
if (isModifying) totals.modifying += signedGross(item, receipt);
|
|
135
|
-
else totals.sale += signedGross(item, receipt);
|
|
136
|
-
bucket.categories.set(name, totals);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
return [...buckets.values()].map(toReport).sort((a, b) => a.applicableDate.localeCompare(b.applicableDate) || a.series.localeCompare(b.series, "hu") || a.currency.localeCompare(b.currency) || (a.exchangeRate ?? 0) - (b.exchangeRate ?? 0));
|
|
140
|
-
}
|
|
141
|
-
const amountFormatter = new Intl.NumberFormat("hu-HU", {
|
|
142
|
-
minimumFractionDigits: 0,
|
|
143
|
-
maximumFractionDigits: 2
|
|
144
|
-
});
|
|
145
|
-
function describeNavReport(report) {
|
|
146
|
-
return [
|
|
147
|
-
`Tárgynap: ${report.applicableDate}`,
|
|
148
|
-
`Kezdő nyugtasorszám: ${report.serialNumber}`,
|
|
149
|
-
`Pénznem: ${report.currency}${report.exchangeRate === null ? "" : ` (árfolyam: ${report.exchangeRate})`}`,
|
|
150
|
-
...report.vatCategories.map((row) => `${row.vat}: értékesítés ${amountFormatter.format(row.saleDocument)}, módosító/érvénytelenítő ${amountFormatter.format(row.modifyingDocument)}`),
|
|
151
|
-
`Végösszeg: ${amountFormatter.format(report.total)}`,
|
|
152
|
-
`Nyugták száma: ${report.numberOfSaleDocument}, módosító/érvénytelenítő bizonylatok száma: ${report.numberOfModifyingDocument}`
|
|
153
|
-
].join("\n");
|
|
154
|
-
}
|
|
155
|
-
//#endregion
|
|
2
|
+
import { a as splitReceiptNumber, c as navVatCategory, i as navDailyReports, n as describeNavReport, o as NAV_VAT_CATEGORIES, r as navCurrencyCode, s as isNavVatCategory, t as compareReceiptNumbers } from "../nav-CK1WgYo7.js";
|
|
156
3
|
//#region src/reports/close.ts
|
|
157
4
|
function sign(receipt, amount) {
|
|
158
5
|
return receipt.type === "reversal" ? -Math.abs(amount) : amount;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const require_binary = require("./binary-B89HM03_.cjs");
|
|
2
|
+
//#region src/core/request-body.ts
|
|
3
|
+
async function readRequestText(request, maxBytes, tooLarge) {
|
|
4
|
+
const declared = Number(request.headers.get("content-length"));
|
|
5
|
+
if (Number.isFinite(declared) && declared > maxBytes) throw tooLarge();
|
|
6
|
+
if (!request.body) return "";
|
|
7
|
+
const reader = request.body.getReader();
|
|
8
|
+
const chunks = [];
|
|
9
|
+
let total = 0;
|
|
10
|
+
for (;;) {
|
|
11
|
+
const chunk = await reader.read();
|
|
12
|
+
if (chunk.done) break;
|
|
13
|
+
total += chunk.value.byteLength;
|
|
14
|
+
if (total > maxBytes) {
|
|
15
|
+
await reader.cancel().catch(() => void 0);
|
|
16
|
+
throw tooLarge();
|
|
17
|
+
}
|
|
18
|
+
chunks.push(chunk.value);
|
|
19
|
+
}
|
|
20
|
+
const bytes = new Uint8Array(total);
|
|
21
|
+
let offset = 0;
|
|
22
|
+
for (const chunk of chunks) {
|
|
23
|
+
bytes.set(chunk, offset);
|
|
24
|
+
offset += chunk.byteLength;
|
|
25
|
+
}
|
|
26
|
+
return require_binary.decodeUtf8(bytes);
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
Object.defineProperty(exports, "readRequestText", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function() {
|
|
32
|
+
return readRequestText;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { r as decodeUtf8 } from "./binary-D0M9U2MD.js";
|
|
2
|
+
//#region src/core/request-body.ts
|
|
3
|
+
async function readRequestText(request, maxBytes, tooLarge) {
|
|
4
|
+
const declared = Number(request.headers.get("content-length"));
|
|
5
|
+
if (Number.isFinite(declared) && declared > maxBytes) throw tooLarge();
|
|
6
|
+
if (!request.body) return "";
|
|
7
|
+
const reader = request.body.getReader();
|
|
8
|
+
const chunks = [];
|
|
9
|
+
let total = 0;
|
|
10
|
+
for (;;) {
|
|
11
|
+
const chunk = await reader.read();
|
|
12
|
+
if (chunk.done) break;
|
|
13
|
+
total += chunk.value.byteLength;
|
|
14
|
+
if (total > maxBytes) {
|
|
15
|
+
await reader.cancel().catch(() => void 0);
|
|
16
|
+
throw tooLarge();
|
|
17
|
+
}
|
|
18
|
+
chunks.push(chunk.value);
|
|
19
|
+
}
|
|
20
|
+
const bytes = new Uint8Array(total);
|
|
21
|
+
let offset = 0;
|
|
22
|
+
for (const chunk of chunks) {
|
|
23
|
+
bytes.set(chunk, offset);
|
|
24
|
+
offset += chunk.byteLength;
|
|
25
|
+
}
|
|
26
|
+
return decodeUtf8(bytes);
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { readRequestText as t };
|