kassza 0.18.1 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/batch/index.cjs +5 -7
- package/dist/batch/index.d.cts +5 -9
- package/dist/batch/index.d.ts +5 -9
- package/dist/batch/index.js +5 -7
- package/dist/{binary-B89HM03_.cjs → binary-CdpKlNNI.cjs} +1 -2
- package/dist/{binary-D0M9U2MD.js → binary-DuKBSfH-.js} +1 -2
- package/dist/cli.cjs +14 -21
- package/dist/cli.js +14 -21
- package/dist/{client-DeWWQ-RZ.d.ts → client-BT2odGYl.d.cts} +8 -36
- package/dist/{client-SVZu25MB.d.cts → client-C-SYCiOZ.d.ts} +8 -36
- package/dist/{client-Cvb9yfxU.cjs → client-I_29IPMh.cjs} +25 -37
- package/dist/{client-CdWEA0et.js → client-JZ1M1sZX.js} +25 -37
- package/dist/{context-kb33TgzE.d.ts → context-BuX6Eion.d.ts} +6 -24
- package/dist/{context-CFNKzStE.d.cts → context-PwqY4JOK.d.cts} +6 -24
- package/dist/cookie-stores/index.cjs +2 -2
- package/dist/cookie-stores/index.d.cts +3 -3
- package/dist/cookie-stores/index.d.ts +3 -3
- package/dist/cookie-stores/index.js +2 -2
- package/dist/{create-CflXrPip.js → create-BwRslos0.js} +9 -12
- package/dist/{create-CvUvLUaT.cjs → create-DH5jiZPA.cjs} +9 -12
- package/dist/{create-once-CW0x_yvp.js → create-once-B6cAXyET.js} +16 -22
- package/dist/{create-once-VKp0tVow.d.ts → create-once-CiGUjXut.d.ts} +3 -7
- package/dist/{create-once-Bh6fOWkW.d.cts → create-once-CyaVT36b.d.cts} +3 -7
- package/dist/{create-once-CHhDz0un.cjs → create-once-zeF7GVVP.cjs} +16 -22
- package/dist/{crypto-Dpn4FHQ6.cjs → crypto-B0PAHKJB.cjs} +1 -2
- package/dist/{crypto-usDg8L2K.js → crypto-BqGn_oGu.js} +1 -2
- package/dist/data-link/index.cjs +10 -13
- package/dist/data-link/index.d.cts +1 -5
- package/dist/data-link/index.d.ts +1 -5
- package/dist/data-link/index.js +10 -13
- package/dist/{dates-CXyj7Azy.js → dates-DWsZOdaO.js} +1 -2
- package/dist/{dates-9zvESP0i.d.cts → dates-nlGEokCf.d.cts} +0 -2
- package/dist/{dates-9zvESP0i.d.ts → dates-nlGEokCf.d.ts} +0 -2
- package/dist/{dates-CPgBodkP.cjs → dates-oOp3ypPP.cjs} +1 -2
- package/dist/delegation/index.cjs +9 -12
- package/dist/delegation/index.d.cts +3 -9
- package/dist/delegation/index.d.ts +3 -9
- package/dist/delegation/index.js +9 -12
- package/dist/{errors-EE96_6D_.cjs → errors-Bn6pe6yw.cjs} +12 -3
- package/dist/{errors-DtN4g5Z9.js → errors-CGGsW0Y5.js} +12 -3
- package/dist/{get-Byc9T5WO.d.cts → get-BL4Fr8-P.d.cts} +0 -2
- package/dist/{get-Byc9T5WO.d.ts → get-BL4Fr8-P.d.ts} +0 -2
- package/dist/{get-BdMTseh4.cjs → get-DFhT7kOp.cjs} +4 -5
- package/dist/{get-CZEShCcj.js → get-HrHwVkVt.js} +4 -5
- package/dist/{index-C-7yWV7L.d.cts → index-CinpAhQM.d.cts} +0 -8
- package/dist/{index-C-7yWV7L.d.ts → index-CinpAhQM.d.ts} +0 -8
- package/dist/{index-BqGgQ4t3.d.ts → index-DqoDUw6X.d.ts} +2 -20
- package/dist/{index-BhUPY_EH.d.cts → index-qk62lWr3.d.cts} +2 -20
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +11 -13
- package/dist/index.d.ts +11 -13
- package/dist/index.js +7 -7
- package/dist/ipn/index.cjs +4 -6
- package/dist/ipn/index.d.cts +0 -4
- package/dist/ipn/index.d.ts +0 -4
- package/dist/ipn/index.js +4 -6
- package/dist/{issue-Bin4tKD_.cjs → issue-DReARZnF.cjs} +12 -18
- package/dist/{issue-DMA1Nbr1.js → issue-Dy9zvRK1.js} +12 -18
- package/dist/journal/index.cjs +7 -11
- package/dist/journal/index.d.cts +2 -6
- package/dist/journal/index.d.ts +2 -6
- package/dist/journal/index.js +7 -11
- package/dist/{journal-Y9qrIB8G.d.ts → journal-BNdo07p5.d.ts} +5 -9
- package/dist/{journal-DvI81Kt7.d.cts → journal-DI-hOW6N.d.cts} +5 -9
- package/dist/{json-4y4E2xxS.cjs → json-COC9rDwf.cjs} +1 -2
- package/dist/json-D3Bx7NhF.d.cts +2 -0
- package/dist/json-D3Bx7NhF.d.ts +2 -0
- package/dist/{json-DjnqnaJK.js → json-as-6J7d-.js} +1 -2
- package/dist/mcp/index.cjs +1 -1
- package/dist/mcp/index.d.cts +1 -9
- package/dist/mcp/index.d.ts +1 -9
- package/dist/mcp/index.js +1 -2
- package/dist/money/index.cjs +3 -3
- package/dist/money/index.d.cts +1 -1
- package/dist/money/index.d.ts +1 -1
- package/dist/money/index.js +3 -3
- package/dist/{money-K9j0wPit.cjs → money-NtVytaxG.cjs} +5 -7
- package/dist/{money-Cw457SD6.js → money-f280VT77.js} +5 -7
- package/dist/nav/index.cjs +15 -22
- package/dist/nav/index.d.cts +2 -22
- package/dist/nav/index.d.ts +2 -22
- package/dist/nav/index.js +15 -22
- package/dist/{nav-BcCerwWS.js → nav-NvNgaONz.js} +5 -7
- package/dist/{nav-BNbc8U0R.cjs → nav-VShZkjg8.cjs} +5 -7
- package/dist/node/index.cjs +1 -2
- package/dist/node/index.d.cts +1 -3
- package/dist/node/index.d.ts +1 -3
- package/dist/node/index.js +1 -2
- package/dist/observe/index.cjs +3 -5
- package/dist/observe/index.d.cts +1 -5
- package/dist/observe/index.d.ts +1 -5
- package/dist/observe/index.js +3 -5
- package/dist/{once-BN_3B5OF.cjs → once-BmXfrNbQ.cjs} +2 -3
- package/dist/{once-CqqZxsXG.js → once-CMhDPrs7.js} +2 -3
- package/dist/{parse-Cr7yQ3_z.js → parse-1RiSh4vY.js} +5 -7
- package/dist/{parse-DOA2XQ3e.cjs → parse-CmM5va-p.cjs} +5 -7
- package/dist/payments/barion.cjs +7 -6
- package/dist/payments/barion.d.cts +4 -6
- package/dist/payments/barion.d.ts +4 -6
- package/dist/payments/barion.js +7 -6
- package/dist/payments/index.cjs +2 -2
- package/dist/payments/index.d.cts +3 -9
- package/dist/payments/index.d.ts +3 -9
- package/dist/payments/index.js +2 -2
- package/dist/payments/paypal.cjs +8 -7
- package/dist/payments/paypal.d.cts +4 -6
- package/dist/payments/paypal.d.ts +4 -6
- package/dist/payments/paypal.js +8 -7
- package/dist/payments/revolut.cjs +7 -6
- package/dist/payments/revolut.d.cts +4 -6
- package/dist/payments/revolut.d.ts +4 -6
- package/dist/payments/revolut.js +7 -6
- package/dist/payments/simplepay.cjs +9 -8
- package/dist/payments/simplepay.d.cts +4 -6
- package/dist/payments/simplepay.d.ts +4 -6
- package/dist/payments/simplepay.js +9 -8
- package/dist/payments/stripe.cjs +6 -6
- package/dist/payments/stripe.d.cts +4 -6
- package/dist/payments/stripe.d.ts +4 -6
- package/dist/payments/stripe.js +6 -6
- package/dist/{push-BXj0Sf0Z.d.ts → push-CTxDD3yJ.d.cts} +2 -4
- package/dist/{push-D4nNbCNV.d.cts → push-DJh5YkyV.d.ts} +2 -4
- package/dist/{reference-B5TATqb5.js → reference-Cxz0m2zF.js} +6 -7
- package/dist/{reference-BIdYMK0t.cjs → reference-DoY12fc1.cjs} +6 -7
- package/dist/reports/index.cjs +3 -4
- package/dist/reports/index.d.cts +1 -7
- package/dist/reports/index.d.ts +1 -7
- package/dist/reports/index.js +3 -4
- package/dist/{request-body-uZHMRlQr.js → request-body-BM4sbsHd.js} +2 -3
- package/dist/{request-body-CH6ZGOrq.cjs → request-body-BhfkJhff.cjs} +2 -3
- package/dist/{rounding-TxoWy2ww.cjs → rounding-CHmSK5Z2.cjs} +1 -2
- package/dist/{rounding-BLyHjjI5.js → rounding-CZLj4DbV.js} +1 -2
- package/dist/{serialize-B2eFh3D-.js → serialize-CjymGkJj.js} +2 -4
- package/dist/{serialize-CquIsxA-.cjs → serialize-DEU7r6Bk.cjs} +2 -4
- package/dist/{server-xcEb7ko9.cjs → server-BZ-ySQGx.cjs} +23 -35
- package/dist/{server-Dt6bEeBB.js → server-CDwsjBWk.js} +23 -35
- package/dist/{session-Ckl5eJhV.d.ts → session-BBbSXlx3.d.cts} +1 -3
- package/dist/{session-DeM5vjvC.cjs → session-BYotpR_s.cjs} +2 -4
- package/dist/{session-SaEEXu2N.js → session-DZeE1ryt.js} +2 -4
- package/dist/{session-YbChChx7.d.cts → session-mKtpAeUB.d.ts} +1 -3
- package/dist/{shared-CrxlxI8n.cjs → shared-BOBTXDTo.cjs} +5 -6
- package/dist/{shared-D6DLa4b7.js → shared-Dbcfwr8x.js} +5 -6
- package/dist/storage/fs.cjs +3 -4
- package/dist/storage/fs.d.cts +2 -4
- package/dist/storage/fs.d.ts +2 -4
- package/dist/storage/fs.js +3 -4
- package/dist/storage/index.cjs +16 -25
- package/dist/storage/index.d.cts +2 -26
- package/dist/storage/index.d.ts +2 -26
- package/dist/storage/index.js +16 -25
- package/dist/{store-C1rHd9DB.d.cts → store-BkaZ8qkU.d.cts} +0 -2
- package/dist/{store-C1rHd9DB.d.ts → store-BkaZ8qkU.d.ts} +0 -2
- package/dist/stores/index.cjs +2 -2
- package/dist/stores/index.d.cts +3 -3
- package/dist/stores/index.d.ts +3 -3
- package/dist/stores/index.js +2 -2
- package/dist/{stores-DhjGBrl_.js → stores-BUnPNJQl.js} +12 -22
- package/dist/{stores-BNrS0dWl.cjs → stores-CH4rYKs_.cjs} +12 -22
- package/dist/{tax-number-BdqKsxNR.js → tax-number-C6jySuGR.js} +3 -6
- package/dist/{tax-number-BYFkBp4A.cjs → tax-number-XLdM5ETv.cjs} +3 -6
- package/dist/testing/index.cjs +20 -30
- package/dist/testing/index.d.cts +5 -15
- package/dist/testing/index.d.ts +5 -15
- package/dist/testing/index.js +20 -30
- package/dist/{types-DVRgwcqg.d.cts → types-Bfs08Mrc.d.cts} +0 -2
- package/dist/{types-DVRgwcqg.d.ts → types-Bfs08Mrc.d.ts} +0 -2
- package/dist/{types-ByAEvGsZ.d.ts → types-DeuUqIvU.d.cts} +2 -4
- package/dist/{types-D1zDOH_F.d.ts → types-Z6rQoqHn.d.ts} +1 -3
- package/dist/{types-lnKkQdot.d.cts → types-_HKTOCuQ.d.cts} +1 -3
- package/dist/{types-B1A8mUIE.d.cts → types-oiDulesz.d.ts} +2 -4
- package/dist/url-CRIlLxPE.cjs +23 -0
- package/dist/url-DeCMiKVm.js +12 -0
- package/dist/validators/index.cjs +6 -10
- package/dist/validators/index.d.cts +0 -12
- package/dist/validators/index.d.ts +0 -12
- package/dist/validators/index.js +6 -10
- package/dist/{vat-v_dcWCto.js → vat-B4J5Q0tu.js} +1 -2
- package/dist/{vat-g35srbNG.cjs → vat-BkoiiKm4.cjs} +1 -2
- package/dist/{warnings-DwTl5J-2.js → warnings-DJ0QvZOp.js} +1 -2
- package/dist/{warnings-B3DXnveC.d.cts → warnings-DpuYhn39.d.cts} +0 -4
- package/dist/{warnings-B3DXnveC.d.ts → warnings-DpuYhn39.d.ts} +0 -4
- package/dist/{warnings-DeIw5RFj.cjs → warnings-ciSzK6Jc.cjs} +1 -2
- package/dist/{webhook-Ckj-_hPD.cjs → webhook-BBTebz1x.cjs} +7 -11
- package/dist/{webhook-D6lEejob.d.ts → webhook-C9IBUdeT.d.ts} +1 -3
- package/dist/{webhook-CmdhGiH5.d.cts → webhook-DF2p_m2Q.d.cts} +1 -3
- package/dist/{webhook-CQVShAfI.js → webhook-SFlA_nCf.js} +7 -11
- package/package.json +1 -1
- package/dist/json-B70TwoX1.d.cts +0 -4
- package/dist/json-B70TwoX1.d.ts +0 -4
package/dist/stores/index.js
CHANGED
|
@@ -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,6 +1,6 @@
|
|
|
1
|
-
import { r as decodeUtf8 } from "./binary-
|
|
2
|
-
import { o as storeCapabilities } from "./session-
|
|
3
|
-
|
|
1
|
+
import { r as decodeUtf8 } from "./binary-DuKBSfH-.js";
|
|
2
|
+
import { o as storeCapabilities } from "./session-DZeE1ryt.js";
|
|
3
|
+
// src/cookie-stores/resilient.ts
|
|
4
4
|
function warnCookieStoreError(event) {
|
|
5
5
|
const continuation = ATOMIC_OPERATIONS.has(event.operation) ? "a hibát a kassza kapja meg és kezeli." : "a kérés session nélkül folytatódik.";
|
|
6
6
|
console.warn(`[szamlazz] A tároló "${event.operation}" művelete sikertelen, ${continuation}`, event.error);
|
|
@@ -68,8 +68,7 @@ function resilientCookieStore(store, options = {}) {
|
|
|
68
68
|
...deleteIfEquals && { deleteIfEquals: (key, value) => strict("deleteIfEquals", key, () => deleteIfEquals(key, value)) }
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
|
|
72
|
-
//#region src/cookie-stores/shared.ts
|
|
71
|
+
// src/cookie-stores/shared.ts
|
|
73
72
|
function prefixKey(options, key) {
|
|
74
73
|
const prefix = options?.prefix;
|
|
75
74
|
return prefix ? `${prefix}${key}` : key;
|
|
@@ -90,8 +89,7 @@ function wholeSeconds(ttlSeconds, minimum) {
|
|
|
90
89
|
if (!Number.isFinite(ttlSeconds)) return minimum;
|
|
91
90
|
return Math.max(minimum, Math.ceil(ttlSeconds));
|
|
92
91
|
}
|
|
93
|
-
|
|
94
|
-
//#region src/cookie-stores/cloudflare-kv.ts
|
|
92
|
+
// src/cookie-stores/cloudflare-kv.ts
|
|
95
93
|
const CLOUDFLARE_KV_MIN_TTL_SECONDS = 60;
|
|
96
94
|
function cloudflareKvCookieStore(namespace, options) {
|
|
97
95
|
return finalizeCookieStore({
|
|
@@ -106,8 +104,7 @@ function cloudflareKvCookieStore(namespace, options) {
|
|
|
106
104
|
}
|
|
107
105
|
}, options);
|
|
108
106
|
}
|
|
109
|
-
|
|
110
|
-
//#region src/cookie-stores/custom.ts
|
|
107
|
+
// src/cookie-stores/custom.ts
|
|
111
108
|
function customCookieStore(store, options) {
|
|
112
109
|
const prefixed = (key) => prefixKey(options, key);
|
|
113
110
|
const wrapped = {
|
|
@@ -125,8 +122,7 @@ function customCookieStore(store, options) {
|
|
|
125
122
|
...deleteIfEquals && { deleteIfEquals: (key, value) => deleteIfEquals(prefixed(key), value) }
|
|
126
123
|
}, options);
|
|
127
124
|
}
|
|
128
|
-
|
|
129
|
-
//#region src/cookie-stores/scripts.ts
|
|
125
|
+
// src/cookie-stores/scripts.ts
|
|
130
126
|
const SET_IF_ABSENT_SCRIPT = "if redis.call('SET', KEYS[1], ARGV[1], 'NX', 'EX', ARGV[2]) then return 1 else return 0 end";
|
|
131
127
|
const INCREMENT_SCRIPT = "local value = redis.call('INCR', KEYS[1]) redis.call('EXPIRE', KEYS[1], ARGV[1]) return value";
|
|
132
128
|
const DELETE_IF_EQUALS_SCRIPT = "if redis.call('GET', KEYS[1]) == ARGV[1] then return redis.call('DEL', KEYS[1]) else return 0 end";
|
|
@@ -148,8 +144,7 @@ function atomicOperations(run, prefixed, seconds) {
|
|
|
148
144
|
}
|
|
149
145
|
};
|
|
150
146
|
}
|
|
151
|
-
|
|
152
|
-
//#region src/cookie-stores/ioredis.ts
|
|
147
|
+
// src/cookie-stores/ioredis.ts
|
|
153
148
|
function ioredisCookieStore(redis, options) {
|
|
154
149
|
const base = {
|
|
155
150
|
async get(key) {
|
|
@@ -170,8 +165,7 @@ function ioredisCookieStore(redis, options) {
|
|
|
170
165
|
...atomic
|
|
171
166
|
}, options);
|
|
172
167
|
}
|
|
173
|
-
|
|
174
|
-
//#region src/cookie-stores/node-redis.ts
|
|
168
|
+
// src/cookie-stores/node-redis.ts
|
|
175
169
|
function nodeRedisCookieStore(client, options) {
|
|
176
170
|
const base = {
|
|
177
171
|
async get(key) {
|
|
@@ -195,8 +189,7 @@ function nodeRedisCookieStore(client, options) {
|
|
|
195
189
|
...atomic
|
|
196
190
|
}, options);
|
|
197
191
|
}
|
|
198
|
-
|
|
199
|
-
//#region src/cookie-stores/upstash.ts
|
|
192
|
+
// src/cookie-stores/upstash.ts
|
|
200
193
|
function upstashRedisCookieStore(redis, options) {
|
|
201
194
|
const base = {
|
|
202
195
|
async get(key) {
|
|
@@ -217,8 +210,7 @@ function upstashRedisCookieStore(redis, options) {
|
|
|
217
210
|
...atomic
|
|
218
211
|
}, options);
|
|
219
212
|
}
|
|
220
|
-
|
|
221
|
-
//#region src/stores/diagnose.ts
|
|
213
|
+
// src/stores/diagnose.ts
|
|
222
214
|
function randomSuffix() {
|
|
223
215
|
return Array.from(crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(8)), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
224
216
|
}
|
|
@@ -279,8 +271,7 @@ async function diagnoseStore(store, options = {}) {
|
|
|
279
271
|
problems
|
|
280
272
|
};
|
|
281
273
|
}
|
|
282
|
-
|
|
283
|
-
//#region src/stores/durable-object.ts
|
|
274
|
+
// src/stores/durable-object.ts
|
|
284
275
|
const OPERATIONS = /* @__PURE__ */ new Set([
|
|
285
276
|
"get",
|
|
286
277
|
"set",
|
|
@@ -437,5 +428,4 @@ function durableObjectStore(stub) {
|
|
|
437
428
|
}
|
|
438
429
|
};
|
|
439
430
|
}
|
|
440
|
-
//#endregion
|
|
441
431
|
export { upstashRedisCookieStore as a, customCookieStore as c, resilientCookieStore as d, diagnoseStore as i, CLOUDFLARE_KV_MIN_TTL_SECONDS as l, durableObjectStore as n, nodeRedisCookieStore as o, handleDurableObjectStoreRequest as r, ioredisCookieStore as s, DURABLE_OBJECT_STORE_URL as t, cloudflareKvCookieStore as u };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_binary = require("./binary-
|
|
2
|
-
const require_session = require("./session-
|
|
3
|
-
|
|
1
|
+
const require_binary = require("./binary-CdpKlNNI.cjs");
|
|
2
|
+
const require_session = require("./session-BYotpR_s.cjs");
|
|
3
|
+
// src/cookie-stores/resilient.ts
|
|
4
4
|
function warnCookieStoreError(event) {
|
|
5
5
|
const continuation = ATOMIC_OPERATIONS.has(event.operation) ? "a hibát a kassza kapja meg és kezeli." : "a kérés session nélkül folytatódik.";
|
|
6
6
|
console.warn(`[szamlazz] A tároló "${event.operation}" művelete sikertelen, ${continuation}`, event.error);
|
|
@@ -68,8 +68,7 @@ function resilientCookieStore(store, options = {}) {
|
|
|
68
68
|
...deleteIfEquals && { deleteIfEquals: (key, value) => strict("deleteIfEquals", key, () => deleteIfEquals(key, value)) }
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
|
|
72
|
-
//#region src/cookie-stores/shared.ts
|
|
71
|
+
// src/cookie-stores/shared.ts
|
|
73
72
|
function prefixKey(options, key) {
|
|
74
73
|
const prefix = options?.prefix;
|
|
75
74
|
return prefix ? `${prefix}${key}` : key;
|
|
@@ -90,8 +89,7 @@ function wholeSeconds(ttlSeconds, minimum) {
|
|
|
90
89
|
if (!Number.isFinite(ttlSeconds)) return minimum;
|
|
91
90
|
return Math.max(minimum, Math.ceil(ttlSeconds));
|
|
92
91
|
}
|
|
93
|
-
|
|
94
|
-
//#region src/cookie-stores/cloudflare-kv.ts
|
|
92
|
+
// src/cookie-stores/cloudflare-kv.ts
|
|
95
93
|
const CLOUDFLARE_KV_MIN_TTL_SECONDS = 60;
|
|
96
94
|
function cloudflareKvCookieStore(namespace, options) {
|
|
97
95
|
return finalizeCookieStore({
|
|
@@ -106,8 +104,7 @@ function cloudflareKvCookieStore(namespace, options) {
|
|
|
106
104
|
}
|
|
107
105
|
}, options);
|
|
108
106
|
}
|
|
109
|
-
|
|
110
|
-
//#region src/cookie-stores/custom.ts
|
|
107
|
+
// src/cookie-stores/custom.ts
|
|
111
108
|
function customCookieStore(store, options) {
|
|
112
109
|
const prefixed = (key) => prefixKey(options, key);
|
|
113
110
|
const wrapped = {
|
|
@@ -125,8 +122,7 @@ function customCookieStore(store, options) {
|
|
|
125
122
|
...deleteIfEquals && { deleteIfEquals: (key, value) => deleteIfEquals(prefixed(key), value) }
|
|
126
123
|
}, options);
|
|
127
124
|
}
|
|
128
|
-
|
|
129
|
-
//#region src/cookie-stores/scripts.ts
|
|
125
|
+
// src/cookie-stores/scripts.ts
|
|
130
126
|
const SET_IF_ABSENT_SCRIPT = "if redis.call('SET', KEYS[1], ARGV[1], 'NX', 'EX', ARGV[2]) then return 1 else return 0 end";
|
|
131
127
|
const INCREMENT_SCRIPT = "local value = redis.call('INCR', KEYS[1]) redis.call('EXPIRE', KEYS[1], ARGV[1]) return value";
|
|
132
128
|
const DELETE_IF_EQUALS_SCRIPT = "if redis.call('GET', KEYS[1]) == ARGV[1] then return redis.call('DEL', KEYS[1]) else return 0 end";
|
|
@@ -148,8 +144,7 @@ function atomicOperations(run, prefixed, seconds) {
|
|
|
148
144
|
}
|
|
149
145
|
};
|
|
150
146
|
}
|
|
151
|
-
|
|
152
|
-
//#region src/cookie-stores/ioredis.ts
|
|
147
|
+
// src/cookie-stores/ioredis.ts
|
|
153
148
|
function ioredisCookieStore(redis, options) {
|
|
154
149
|
const base = {
|
|
155
150
|
async get(key) {
|
|
@@ -170,8 +165,7 @@ function ioredisCookieStore(redis, options) {
|
|
|
170
165
|
...atomic
|
|
171
166
|
}, options);
|
|
172
167
|
}
|
|
173
|
-
|
|
174
|
-
//#region src/cookie-stores/node-redis.ts
|
|
168
|
+
// src/cookie-stores/node-redis.ts
|
|
175
169
|
function nodeRedisCookieStore(client, options) {
|
|
176
170
|
const base = {
|
|
177
171
|
async get(key) {
|
|
@@ -195,8 +189,7 @@ function nodeRedisCookieStore(client, options) {
|
|
|
195
189
|
...atomic
|
|
196
190
|
}, options);
|
|
197
191
|
}
|
|
198
|
-
|
|
199
|
-
//#region src/cookie-stores/upstash.ts
|
|
192
|
+
// src/cookie-stores/upstash.ts
|
|
200
193
|
function upstashRedisCookieStore(redis, options) {
|
|
201
194
|
const base = {
|
|
202
195
|
async get(key) {
|
|
@@ -217,8 +210,7 @@ function upstashRedisCookieStore(redis, options) {
|
|
|
217
210
|
...atomic
|
|
218
211
|
}, options);
|
|
219
212
|
}
|
|
220
|
-
|
|
221
|
-
//#region src/stores/diagnose.ts
|
|
213
|
+
// src/stores/diagnose.ts
|
|
222
214
|
function randomSuffix() {
|
|
223
215
|
return Array.from(crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(8)), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
224
216
|
}
|
|
@@ -279,8 +271,7 @@ async function diagnoseStore(store, options = {}) {
|
|
|
279
271
|
problems
|
|
280
272
|
};
|
|
281
273
|
}
|
|
282
|
-
|
|
283
|
-
//#region src/stores/durable-object.ts
|
|
274
|
+
// src/stores/durable-object.ts
|
|
284
275
|
const OPERATIONS = /* @__PURE__ */ new Set([
|
|
285
276
|
"get",
|
|
286
277
|
"set",
|
|
@@ -437,7 +428,6 @@ function durableObjectStore(stub) {
|
|
|
437
428
|
}
|
|
438
429
|
};
|
|
439
430
|
}
|
|
440
|
-
//#endregion
|
|
441
431
|
Object.defineProperty(exports, "CLOUDFLARE_KV_MIN_TTL_SECONDS", {
|
|
442
432
|
enumerable: true,
|
|
443
433
|
get: function() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/validators/digits.ts
|
|
2
2
|
const SEPARATORS = /[\s-]+/g;
|
|
3
3
|
function stripSeparators(value) {
|
|
4
4
|
return value.replace(SEPARATORS, "");
|
|
@@ -10,8 +10,7 @@ function isDigits(value, length) {
|
|
|
10
10
|
function weightedDigitSum(digits, weights) {
|
|
11
11
|
return [...digits].reduce((sum, digit, index) => sum + Number(digit) * Number(weights[index % weights.length]), 0);
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
//#region src/validators/email.ts
|
|
13
|
+
// src/validators/email.ts
|
|
15
14
|
const MAX_EMAIL_LENGTH = 254;
|
|
16
15
|
const EMAIL_PATTERN = /^[^\s@]+@[^\s@.]+(?:\.[^\s@.]+)+$/;
|
|
17
16
|
function normalizeEmail(value) {
|
|
@@ -22,8 +21,7 @@ function isValidEmail(value) {
|
|
|
22
21
|
const email = value.trim();
|
|
23
22
|
return email.length <= MAX_EMAIL_LENGTH && EMAIL_PATTERN.test(email);
|
|
24
23
|
}
|
|
25
|
-
|
|
26
|
-
//#region src/validators/tax-number.ts
|
|
24
|
+
// src/validators/tax-number.ts
|
|
27
25
|
const TAXPAYER_ID_WEIGHTS = [
|
|
28
26
|
9,
|
|
29
27
|
7,
|
|
@@ -72,5 +70,4 @@ function isValidHungarianGroupTaxNumber(value) {
|
|
|
72
70
|
function isHungarianVatGroupMemberTaxNumber(value) {
|
|
73
71
|
return parseHungarianTaxNumber(value)?.vatCode === "4";
|
|
74
72
|
}
|
|
75
|
-
//#endregion
|
|
76
73
|
export { isValidHungarianTaxpayerId as a, normalizeEmail as c, weightedDigitSum as d, isValidHungarianTaxNumber as i, isDigits as l, isHungarianVatGroupMemberTaxNumber as n, parseHungarianTaxNumber as o, isValidHungarianGroupTaxNumber as r, isValidEmail as s, HUNGARIAN_TAX_COUNTY_CODES as t, stripSeparators as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/validators/digits.ts
|
|
2
2
|
const SEPARATORS = /[\s-]+/g;
|
|
3
3
|
function stripSeparators(value) {
|
|
4
4
|
return value.replace(SEPARATORS, "");
|
|
@@ -10,8 +10,7 @@ function isDigits(value, length) {
|
|
|
10
10
|
function weightedDigitSum(digits, weights) {
|
|
11
11
|
return [...digits].reduce((sum, digit, index) => sum + Number(digit) * Number(weights[index % weights.length]), 0);
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
//#region src/validators/email.ts
|
|
13
|
+
// src/validators/email.ts
|
|
15
14
|
const MAX_EMAIL_LENGTH = 254;
|
|
16
15
|
const EMAIL_PATTERN = /^[^\s@]+@[^\s@.]+(?:\.[^\s@.]+)+$/;
|
|
17
16
|
function normalizeEmail(value) {
|
|
@@ -22,8 +21,7 @@ function isValidEmail(value) {
|
|
|
22
21
|
const email = value.trim();
|
|
23
22
|
return email.length <= MAX_EMAIL_LENGTH && EMAIL_PATTERN.test(email);
|
|
24
23
|
}
|
|
25
|
-
|
|
26
|
-
//#region src/validators/tax-number.ts
|
|
24
|
+
// src/validators/tax-number.ts
|
|
27
25
|
const TAXPAYER_ID_WEIGHTS = [
|
|
28
26
|
9,
|
|
29
27
|
7,
|
|
@@ -72,7 +70,6 @@ function isValidHungarianGroupTaxNumber(value) {
|
|
|
72
70
|
function isHungarianVatGroupMemberTaxNumber(value) {
|
|
73
71
|
return parseHungarianTaxNumber(value)?.vatCode === "4";
|
|
74
72
|
}
|
|
75
|
-
//#endregion
|
|
76
73
|
Object.defineProperty(exports, "HUNGARIAN_TAX_COUNTY_CODES", {
|
|
77
74
|
enumerable: true,
|
|
78
75
|
get: function() {
|
package/dist/testing/index.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_create_once = require("../create-once-
|
|
3
|
-
const require_errors = require("../errors-
|
|
4
|
-
const require_binary = require("../binary-
|
|
5
|
-
const require_serialize = require("../serialize-
|
|
6
|
-
const require_issue = require("../issue-
|
|
7
|
-
const require_dates = require("../dates-
|
|
8
|
-
const require_rounding = require("../rounding-
|
|
9
|
-
const require_vat = require("../vat-
|
|
10
|
-
const require_money = require("../money-
|
|
11
|
-
const require_create = require("../create-
|
|
12
|
-
|
|
2
|
+
const require_create_once = require("../create-once-zeF7GVVP.cjs");
|
|
3
|
+
const require_errors = require("../errors-Bn6pe6yw.cjs");
|
|
4
|
+
const require_binary = require("../binary-CdpKlNNI.cjs");
|
|
5
|
+
const require_serialize = require("../serialize-DEU7r6Bk.cjs");
|
|
6
|
+
const require_issue = require("../issue-DReARZnF.cjs");
|
|
7
|
+
const require_dates = require("../dates-oOp3ypPP.cjs");
|
|
8
|
+
const require_rounding = require("../rounding-CHmSK5Z2.cjs");
|
|
9
|
+
const require_vat = require("../vat-BkoiiKm4.cjs");
|
|
10
|
+
const require_money = require("../money-NtVytaxG.cjs");
|
|
11
|
+
const require_create = require("../create-DH5jiZPA.cjs");
|
|
12
|
+
// src/testing/fake-agent-http.ts
|
|
13
13
|
const XML_CONTENT_TYPE = "application/xml; charset=UTF-8";
|
|
14
14
|
const TEXT_CONTENT_TYPE = "text/plain; charset=UTF-8";
|
|
15
15
|
const PDF_CONTENT_TYPE = "application/pdf";
|
|
@@ -115,8 +115,7 @@ function toFetchResponse(response) {
|
|
|
115
115
|
headers: response.headers
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
|
-
|
|
119
|
-
//#region src/testing/fake-agent-state.ts
|
|
118
|
+
// src/testing/fake-agent-state.ts
|
|
120
119
|
var FakeAgentFailure = class extends Error {
|
|
121
120
|
name = "FakeAgentFailure";
|
|
122
121
|
code;
|
|
@@ -149,8 +148,7 @@ function fakePdf(label) {
|
|
|
149
148
|
function taxpayerKey(value) {
|
|
150
149
|
return value.replace(/\D/g, "").slice(0, 8);
|
|
151
150
|
}
|
|
152
|
-
|
|
153
|
-
//#region src/testing/fake-agent-items.ts
|
|
151
|
+
// src/testing/fake-agent-items.ts
|
|
154
152
|
const SERVER_VAT_CODES = /* @__PURE__ */ new Set([
|
|
155
153
|
"TAM",
|
|
156
154
|
"AAM",
|
|
@@ -332,8 +330,7 @@ function negateTotals(totals) {
|
|
|
332
330
|
function outstandingOf(gross, paid) {
|
|
333
331
|
return gross > 0 ? Math.max(0, sum([gross, -paid])) : 0;
|
|
334
332
|
}
|
|
335
|
-
|
|
336
|
-
//#region src/testing/fake-agent-account.ts
|
|
333
|
+
// src/testing/fake-agent-account.ts
|
|
337
334
|
const NAV_API_NAMESPACE = "http://schemas.nav.gov.hu/OSA/3.0/api";
|
|
338
335
|
const TAXPAYER_ID_PATTERN = /^\d{8}$/;
|
|
339
336
|
const CONNECT_PRINCIPAL_MESSAGES = {
|
|
@@ -459,8 +456,7 @@ function handleConnectPrincipal(state, request) {
|
|
|
459
456
|
});
|
|
460
457
|
return connectResponse(principal.joinRequests === 0 ? CONNECT_PRINCIPAL_MESSAGES.joinRequestSent : CONNECT_PRINCIPAL_MESSAGES.joinRequestResent);
|
|
461
458
|
}
|
|
462
|
-
|
|
463
|
-
//#region src/testing/fake-agent-invoice-xml.ts
|
|
459
|
+
// src/testing/fake-agent-invoice-xml.ts
|
|
464
460
|
const UNIFIED_PAYMENT_METHODS = [
|
|
465
461
|
"átutalás",
|
|
466
462
|
"készpénz",
|
|
@@ -613,8 +609,7 @@ function renderInvoiceXml(invoice, testAccount, includePdf) {
|
|
|
613
609
|
]
|
|
614
610
|
});
|
|
615
611
|
}
|
|
616
|
-
|
|
617
|
-
//#region src/testing/fake-agent-request.ts
|
|
612
|
+
// src/testing/fake-agent-request.ts
|
|
618
613
|
const REQUEST_ROOTS = {
|
|
619
614
|
createInvoice: "xmlszamla",
|
|
620
615
|
reverseInvoice: "xmlszamlast",
|
|
@@ -726,8 +721,7 @@ function errorStyleFor(action, root) {
|
|
|
726
721
|
case "connectPrincipal": return "text";
|
|
727
722
|
}
|
|
728
723
|
}
|
|
729
|
-
|
|
730
|
-
//#region src/testing/fake-agent-invoices.ts
|
|
724
|
+
// src/testing/fake-agent-invoices.ts
|
|
731
725
|
const LANGUAGES = /* @__PURE__ */ new Set([
|
|
732
726
|
"hu",
|
|
733
727
|
"en",
|
|
@@ -1031,8 +1025,7 @@ function handleDeleteProforma(state, request) {
|
|
|
1031
1025
|
});
|
|
1032
1026
|
return xmlResponse(xmlDocument("xmlszamladbkdelvalasz", [require_serialize.el("sikeres", true)]));
|
|
1033
1027
|
}
|
|
1034
|
-
|
|
1035
|
-
//#region src/testing/fake-agent-receipts.ts
|
|
1028
|
+
// src/testing/fake-agent-receipts.ts
|
|
1036
1029
|
const PREFIX_PATTERN = /^[A-Z0-9]+$/;
|
|
1037
1030
|
const MONEY_DECIMALS = 2;
|
|
1038
1031
|
function requiredText(parent, name, path) {
|
|
@@ -1243,8 +1236,7 @@ function handleSendReceipt(state, request) {
|
|
|
1243
1236
|
});
|
|
1244
1237
|
return xmlResponse(xmlDocument("xmlnyugtasendvalasz", [require_serialize.el("sikeres", true)]));
|
|
1245
1238
|
}
|
|
1246
|
-
|
|
1247
|
-
//#region src/testing/fake-agent.ts
|
|
1239
|
+
// src/testing/fake-agent.ts
|
|
1248
1240
|
const HANDLERS = {
|
|
1249
1241
|
createInvoice: handleCreateInvoice,
|
|
1250
1242
|
reverseInvoice: handleReverseInvoice,
|
|
@@ -1475,8 +1467,7 @@ function createFakeAgentFetch(options = {}) {
|
|
|
1475
1467
|
}
|
|
1476
1468
|
};
|
|
1477
1469
|
}
|
|
1478
|
-
|
|
1479
|
-
//#region src/testing/index.ts
|
|
1470
|
+
// src/testing/index.ts
|
|
1480
1471
|
const MOCK_PDF = new TextEncoder().encode("%PDF-1.4\n1 0 obj << /Type /Catalog >> endobj\ntrailer << /Root 1 0 R >>\n%%EOF\n");
|
|
1481
1472
|
function notFound(code, message) {
|
|
1482
1473
|
return new require_errors.SzamlazzError(`[${code}] ${message}`, {
|
|
@@ -1986,7 +1977,6 @@ function createMockKassza(options = {}) {
|
|
|
1986
1977
|
}))
|
|
1987
1978
|
};
|
|
1988
1979
|
}
|
|
1989
|
-
//#endregion
|
|
1990
1980
|
exports.CONNECT_PRINCIPAL_MESSAGES = CONNECT_PRINCIPAL_MESSAGES;
|
|
1991
1981
|
exports.MOCK_PDF = MOCK_PDF;
|
|
1992
1982
|
exports.createFakeAgentFetch = createFakeAgentFetch;
|
package/dist/testing/index.d.cts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { a as AgentAction, t as KasszaWarning } from "../warnings-
|
|
2
|
-
import { G as InvoiceType, M as CreateInvoiceInput, d as DocumentErrorMode, p as DocumentHook, st as SzamlazzError } from "../context-
|
|
3
|
-
import { r as Receipt } from "../types-
|
|
4
|
-
import { f as TaxpayerInfo, n as Kassza, r as KasszaDefaults } from "../client-
|
|
5
|
-
import { n as InvoiceDetails, o as InvoiceDetailsPayment } from "../get-
|
|
6
|
-
//#region src/testing/fake-agent-state.d.ts
|
|
1
|
+
import { a as AgentAction, t as KasszaWarning } from "../warnings-DpuYhn39.cjs";
|
|
2
|
+
import { G as InvoiceType, M as CreateInvoiceInput, d as DocumentErrorMode, p as DocumentHook, st as SzamlazzError } from "../context-PwqY4JOK.cjs";
|
|
3
|
+
import { r as Receipt } from "../types-_HKTOCuQ.cjs";
|
|
4
|
+
import { f as TaxpayerInfo, n as Kassza, r as KasszaDefaults } from "../client-BT2odGYl.cjs";
|
|
5
|
+
import { n as InvoiceDetails, o as InvoiceDetailsPayment } from "../get-BL4Fr8-P.cjs";
|
|
7
6
|
type FakeInvoiceTypeCode = "SZ" | "D" | "ES" | "VS" | "HS" | "SS" | "SL";
|
|
8
7
|
interface FakeAgentSeller {
|
|
9
8
|
readonly name: string;
|
|
@@ -128,8 +127,6 @@ interface FakeAgentTaxpayer {
|
|
|
128
127
|
readonly address?: FakeAgentTaxpayerAddress | undefined;
|
|
129
128
|
}
|
|
130
129
|
type FakeAgentPrincipalState = "owned" | "unowned";
|
|
131
|
-
//#endregion
|
|
132
|
-
//#region src/testing/fake-agent-request.d.ts
|
|
133
130
|
interface FakeAgentAttachment {
|
|
134
131
|
readonly filename: string;
|
|
135
132
|
readonly size: number;
|
|
@@ -139,8 +136,6 @@ interface FakeAgentRequestRecord {
|
|
|
139
136
|
readonly xml: string | undefined;
|
|
140
137
|
readonly attachments: readonly FakeAgentAttachment[];
|
|
141
138
|
}
|
|
142
|
-
//#endregion
|
|
143
|
-
//#region src/testing/fake-agent.d.ts
|
|
144
139
|
type FakeAgentFaultName = "ghostSuccess" | "timeout" | "networkError" | "serverError" | "maintenance" | "partialSuccess" | "testAccountLimit" | "duplicateCallId" | "duplicateOrderNumber";
|
|
145
140
|
interface FakeAgentCodeFault {
|
|
146
141
|
readonly code: number;
|
|
@@ -183,16 +178,12 @@ interface FakeAgent {
|
|
|
183
178
|
reset(): void;
|
|
184
179
|
}
|
|
185
180
|
export declare function createFakeAgentFetch(options?: FakeAgentOptions): FakeAgent;
|
|
186
|
-
//#endregion
|
|
187
|
-
//#region src/testing/fake-agent-account.d.ts
|
|
188
181
|
export declare const CONNECT_PRINCIPAL_MESSAGES: {
|
|
189
182
|
readonly created: "DONE";
|
|
190
183
|
readonly ownerInviteResent: "Már létező fiók, nincs fiókgazdája. Fiókgazdai meghívó (megbízott számlakibocsátás) email újraküldve.";
|
|
191
184
|
readonly joinRequestSent: "Már létező fiók fiókgazdával. Csatlakozási kérelmet küldtünk a fiókgazdának.";
|
|
192
185
|
readonly joinRequestResent: "Már létező fiók fiókgazdával. A csatlakozási kérelem emailt újraküldtük a fiókgazdának.";
|
|
193
186
|
};
|
|
194
|
-
//#endregion
|
|
195
|
-
//#region src/testing/index.d.ts
|
|
196
187
|
export declare const MOCK_PDF: Uint8Array;
|
|
197
188
|
export interface MockInvoiceRecord {
|
|
198
189
|
readonly number: string;
|
|
@@ -234,5 +225,4 @@ export interface MockKassza extends Kassza {
|
|
|
234
225
|
reset(): void;
|
|
235
226
|
}
|
|
236
227
|
export declare function createMockKassza(options?: MockKasszaOptions): MockKassza;
|
|
237
|
-
//#endregion
|
|
238
228
|
export type { FakeAgent, FakeAgentAttachment, FakeAgentBuyer, FakeAgentCodeFault, FakeAgentDuplicateOrderNumbers, FakeAgentFault, FakeAgentFaultName, FakeAgentFaultOptions, FakeAgentInvoice, FakeAgentInvoicePayment, FakeAgentItem, FakeAgentItemLedger, FakeAgentOptions, FakeAgentPrincipalState, FakeAgentReceipt, FakeAgentReceiptPayment, FakeAgentRequestRecord, FakeAgentScheduledFault, FakeAgentSeller, FakeAgentTaxpayer, FakeAgentTaxpayerAddress, FakeAgentTotals, FakeInvoiceTypeCode };
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { a as AgentAction, t as KasszaWarning } from "../warnings-
|
|
2
|
-
import { G as InvoiceType, M as CreateInvoiceInput, d as DocumentErrorMode, p as DocumentHook, st as SzamlazzError } from "../context-
|
|
3
|
-
import { r as Receipt } from "../types-
|
|
4
|
-
import { f as TaxpayerInfo, n as Kassza, r as KasszaDefaults } from "../client-
|
|
5
|
-
import { n as InvoiceDetails, o as InvoiceDetailsPayment } from "../get-
|
|
6
|
-
//#region src/testing/fake-agent-state.d.ts
|
|
1
|
+
import { a as AgentAction, t as KasszaWarning } from "../warnings-DpuYhn39.js";
|
|
2
|
+
import { G as InvoiceType, M as CreateInvoiceInput, d as DocumentErrorMode, p as DocumentHook, st as SzamlazzError } from "../context-BuX6Eion.js";
|
|
3
|
+
import { r as Receipt } from "../types-Z6rQoqHn.js";
|
|
4
|
+
import { f as TaxpayerInfo, n as Kassza, r as KasszaDefaults } from "../client-C-SYCiOZ.js";
|
|
5
|
+
import { n as InvoiceDetails, o as InvoiceDetailsPayment } from "../get-BL4Fr8-P.js";
|
|
7
6
|
type FakeInvoiceTypeCode = "SZ" | "D" | "ES" | "VS" | "HS" | "SS" | "SL";
|
|
8
7
|
interface FakeAgentSeller {
|
|
9
8
|
readonly name: string;
|
|
@@ -128,8 +127,6 @@ interface FakeAgentTaxpayer {
|
|
|
128
127
|
readonly address?: FakeAgentTaxpayerAddress | undefined;
|
|
129
128
|
}
|
|
130
129
|
type FakeAgentPrincipalState = "owned" | "unowned";
|
|
131
|
-
//#endregion
|
|
132
|
-
//#region src/testing/fake-agent-request.d.ts
|
|
133
130
|
interface FakeAgentAttachment {
|
|
134
131
|
readonly filename: string;
|
|
135
132
|
readonly size: number;
|
|
@@ -139,8 +136,6 @@ interface FakeAgentRequestRecord {
|
|
|
139
136
|
readonly xml: string | undefined;
|
|
140
137
|
readonly attachments: readonly FakeAgentAttachment[];
|
|
141
138
|
}
|
|
142
|
-
//#endregion
|
|
143
|
-
//#region src/testing/fake-agent.d.ts
|
|
144
139
|
type FakeAgentFaultName = "ghostSuccess" | "timeout" | "networkError" | "serverError" | "maintenance" | "partialSuccess" | "testAccountLimit" | "duplicateCallId" | "duplicateOrderNumber";
|
|
145
140
|
interface FakeAgentCodeFault {
|
|
146
141
|
readonly code: number;
|
|
@@ -183,16 +178,12 @@ interface FakeAgent {
|
|
|
183
178
|
reset(): void;
|
|
184
179
|
}
|
|
185
180
|
export declare function createFakeAgentFetch(options?: FakeAgentOptions): FakeAgent;
|
|
186
|
-
//#endregion
|
|
187
|
-
//#region src/testing/fake-agent-account.d.ts
|
|
188
181
|
export declare const CONNECT_PRINCIPAL_MESSAGES: {
|
|
189
182
|
readonly created: "DONE";
|
|
190
183
|
readonly ownerInviteResent: "Már létező fiók, nincs fiókgazdája. Fiókgazdai meghívó (megbízott számlakibocsátás) email újraküldve.";
|
|
191
184
|
readonly joinRequestSent: "Már létező fiók fiókgazdával. Csatlakozási kérelmet küldtünk a fiókgazdának.";
|
|
192
185
|
readonly joinRequestResent: "Már létező fiók fiókgazdával. A csatlakozási kérelem emailt újraküldtük a fiókgazdának.";
|
|
193
186
|
};
|
|
194
|
-
//#endregion
|
|
195
|
-
//#region src/testing/index.d.ts
|
|
196
187
|
export declare const MOCK_PDF: Uint8Array;
|
|
197
188
|
export interface MockInvoiceRecord {
|
|
198
189
|
readonly number: string;
|
|
@@ -234,5 +225,4 @@ export interface MockKassza extends Kassza {
|
|
|
234
225
|
reset(): void;
|
|
235
226
|
}
|
|
236
227
|
export declare function createMockKassza(options?: MockKasszaOptions): MockKassza;
|
|
237
|
-
//#endregion
|
|
238
228
|
export type { FakeAgent, FakeAgentAttachment, FakeAgentBuyer, FakeAgentCodeFault, FakeAgentDuplicateOrderNumbers, FakeAgentFault, FakeAgentFaultName, FakeAgentFaultOptions, FakeAgentInvoice, FakeAgentInvoicePayment, FakeAgentItem, FakeAgentItemLedger, FakeAgentOptions, FakeAgentPrincipalState, FakeAgentReceipt, FakeAgentReceiptPayment, FakeAgentRequestRecord, FakeAgentScheduledFault, FakeAgentSeller, FakeAgentTaxpayer, FakeAgentTaxpayerAddress, FakeAgentTotals, FakeInvoiceTypeCode };
|
package/dist/testing/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { c as resolveInvoice, g as AGENT_ACTIONS, m as emitDocumentEvent, r as registerPaymentOnce, t as createReceiptOnce } from "../create-once-
|
|
2
|
-
import { r as SzamlazzError, t as AGENT_ERROR_CODES } from "../errors-
|
|
3
|
-
import { i as encodeUtf8, n as bytesToBase64 } from "../binary-
|
|
4
|
-
import { a as optionalEl, c as childNumber, d as findChildren, f as parseXml, i as formatXmlNumber, l as childText, n as buildXmlDocument, r as el, s as childBoolean, u as findChild } from "../serialize-
|
|
5
|
-
import { l as createInvoiceOnce, n as issueForPayment, o as convertReceiptToInvoice } from "../issue-
|
|
6
|
-
import { n as toAgentDate, r as toBudapestDate } from "../dates-
|
|
7
|
-
import { n as decimalPlaces, r as roundMoney } from "../rounding-
|
|
8
|
-
import { i as isHuf, t as NUMERIC_VAT_RATES } from "../vat-
|
|
9
|
-
import { a as summarizeItems } from "../money-
|
|
10
|
-
import { n as calculateReceiptItems, t as buildCreateReceiptXml } from "../create-
|
|
11
|
-
|
|
1
|
+
import { c as resolveInvoice, g as AGENT_ACTIONS, m as emitDocumentEvent, r as registerPaymentOnce, t as createReceiptOnce } from "../create-once-B6cAXyET.js";
|
|
2
|
+
import { r as SzamlazzError, t as AGENT_ERROR_CODES } from "../errors-CGGsW0Y5.js";
|
|
3
|
+
import { i as encodeUtf8, n as bytesToBase64 } from "../binary-DuKBSfH-.js";
|
|
4
|
+
import { a as optionalEl, c as childNumber, d as findChildren, f as parseXml, i as formatXmlNumber, l as childText, n as buildXmlDocument, r as el, s as childBoolean, u as findChild } from "../serialize-CjymGkJj.js";
|
|
5
|
+
import { l as createInvoiceOnce, n as issueForPayment, o as convertReceiptToInvoice } from "../issue-Dy9zvRK1.js";
|
|
6
|
+
import { n as toAgentDate, r as toBudapestDate } from "../dates-DWsZOdaO.js";
|
|
7
|
+
import { n as decimalPlaces, r as roundMoney } from "../rounding-CZLj4DbV.js";
|
|
8
|
+
import { i as isHuf, t as NUMERIC_VAT_RATES } from "../vat-B4J5Q0tu.js";
|
|
9
|
+
import { a as summarizeItems } from "../money-f280VT77.js";
|
|
10
|
+
import { n as calculateReceiptItems, t as buildCreateReceiptXml } from "../create-BwRslos0.js";
|
|
11
|
+
// src/testing/fake-agent-http.ts
|
|
12
12
|
const XML_CONTENT_TYPE = "application/xml; charset=UTF-8";
|
|
13
13
|
const TEXT_CONTENT_TYPE = "text/plain; charset=UTF-8";
|
|
14
14
|
const PDF_CONTENT_TYPE = "application/pdf";
|
|
@@ -114,8 +114,7 @@ function toFetchResponse(response) {
|
|
|
114
114
|
headers: response.headers
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
|
|
118
|
-
//#region src/testing/fake-agent-state.ts
|
|
117
|
+
// src/testing/fake-agent-state.ts
|
|
119
118
|
var FakeAgentFailure = class extends Error {
|
|
120
119
|
name = "FakeAgentFailure";
|
|
121
120
|
code;
|
|
@@ -148,8 +147,7 @@ function fakePdf(label) {
|
|
|
148
147
|
function taxpayerKey(value) {
|
|
149
148
|
return value.replace(/\D/g, "").slice(0, 8);
|
|
150
149
|
}
|
|
151
|
-
|
|
152
|
-
//#region src/testing/fake-agent-items.ts
|
|
150
|
+
// src/testing/fake-agent-items.ts
|
|
153
151
|
const SERVER_VAT_CODES = /* @__PURE__ */ new Set([
|
|
154
152
|
"TAM",
|
|
155
153
|
"AAM",
|
|
@@ -331,8 +329,7 @@ function negateTotals(totals) {
|
|
|
331
329
|
function outstandingOf(gross, paid) {
|
|
332
330
|
return gross > 0 ? Math.max(0, sum([gross, -paid])) : 0;
|
|
333
331
|
}
|
|
334
|
-
|
|
335
|
-
//#region src/testing/fake-agent-account.ts
|
|
332
|
+
// src/testing/fake-agent-account.ts
|
|
336
333
|
const NAV_API_NAMESPACE = "http://schemas.nav.gov.hu/OSA/3.0/api";
|
|
337
334
|
const TAXPAYER_ID_PATTERN = /^\d{8}$/;
|
|
338
335
|
const CONNECT_PRINCIPAL_MESSAGES = {
|
|
@@ -458,8 +455,7 @@ function handleConnectPrincipal(state, request) {
|
|
|
458
455
|
});
|
|
459
456
|
return connectResponse(principal.joinRequests === 0 ? CONNECT_PRINCIPAL_MESSAGES.joinRequestSent : CONNECT_PRINCIPAL_MESSAGES.joinRequestResent);
|
|
460
457
|
}
|
|
461
|
-
|
|
462
|
-
//#region src/testing/fake-agent-invoice-xml.ts
|
|
458
|
+
// src/testing/fake-agent-invoice-xml.ts
|
|
463
459
|
const UNIFIED_PAYMENT_METHODS = [
|
|
464
460
|
"átutalás",
|
|
465
461
|
"készpénz",
|
|
@@ -612,8 +608,7 @@ function renderInvoiceXml(invoice, testAccount, includePdf) {
|
|
|
612
608
|
]
|
|
613
609
|
});
|
|
614
610
|
}
|
|
615
|
-
|
|
616
|
-
//#region src/testing/fake-agent-request.ts
|
|
611
|
+
// src/testing/fake-agent-request.ts
|
|
617
612
|
const REQUEST_ROOTS = {
|
|
618
613
|
createInvoice: "xmlszamla",
|
|
619
614
|
reverseInvoice: "xmlszamlast",
|
|
@@ -725,8 +720,7 @@ function errorStyleFor(action, root) {
|
|
|
725
720
|
case "connectPrincipal": return "text";
|
|
726
721
|
}
|
|
727
722
|
}
|
|
728
|
-
|
|
729
|
-
//#region src/testing/fake-agent-invoices.ts
|
|
723
|
+
// src/testing/fake-agent-invoices.ts
|
|
730
724
|
const LANGUAGES = /* @__PURE__ */ new Set([
|
|
731
725
|
"hu",
|
|
732
726
|
"en",
|
|
@@ -1030,8 +1024,7 @@ function handleDeleteProforma(state, request) {
|
|
|
1030
1024
|
});
|
|
1031
1025
|
return xmlResponse(xmlDocument("xmlszamladbkdelvalasz", [el("sikeres", true)]));
|
|
1032
1026
|
}
|
|
1033
|
-
|
|
1034
|
-
//#region src/testing/fake-agent-receipts.ts
|
|
1027
|
+
// src/testing/fake-agent-receipts.ts
|
|
1035
1028
|
const PREFIX_PATTERN = /^[A-Z0-9]+$/;
|
|
1036
1029
|
const MONEY_DECIMALS = 2;
|
|
1037
1030
|
function requiredText(parent, name, path) {
|
|
@@ -1242,8 +1235,7 @@ function handleSendReceipt(state, request) {
|
|
|
1242
1235
|
});
|
|
1243
1236
|
return xmlResponse(xmlDocument("xmlnyugtasendvalasz", [el("sikeres", true)]));
|
|
1244
1237
|
}
|
|
1245
|
-
|
|
1246
|
-
//#region src/testing/fake-agent.ts
|
|
1238
|
+
// src/testing/fake-agent.ts
|
|
1247
1239
|
const HANDLERS = {
|
|
1248
1240
|
createInvoice: handleCreateInvoice,
|
|
1249
1241
|
reverseInvoice: handleReverseInvoice,
|
|
@@ -1474,8 +1466,7 @@ function createFakeAgentFetch(options = {}) {
|
|
|
1474
1466
|
}
|
|
1475
1467
|
};
|
|
1476
1468
|
}
|
|
1477
|
-
|
|
1478
|
-
//#region src/testing/index.ts
|
|
1469
|
+
// src/testing/index.ts
|
|
1479
1470
|
const MOCK_PDF = new TextEncoder().encode("%PDF-1.4\n1 0 obj << /Type /Catalog >> endobj\ntrailer << /Root 1 0 R >>\n%%EOF\n");
|
|
1480
1471
|
function notFound(code, message) {
|
|
1481
1472
|
return new SzamlazzError(`[${code}] ${message}`, {
|
|
@@ -1985,5 +1976,4 @@ function createMockKassza(options = {}) {
|
|
|
1985
1976
|
}))
|
|
1986
1977
|
};
|
|
1987
1978
|
}
|
|
1988
|
-
//#endregion
|
|
1989
1979
|
export { CONNECT_PRINCIPAL_MESSAGES, MOCK_PDF, createFakeAgentFetch, createMockKassza };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/storage/types.d.ts
|
|
2
1
|
interface StoredFile {
|
|
3
2
|
readonly key: string;
|
|
4
3
|
readonly url?: string | undefined;
|
|
@@ -22,5 +21,4 @@ interface CompleteStorageAdapter extends StorageAdapter {
|
|
|
22
21
|
delete(key: string): Promise<void>;
|
|
23
22
|
getUrl(key: string, options?: StorageUrlOptions): Promise<string>;
|
|
24
23
|
}
|
|
25
|
-
//#endregion
|
|
26
24
|
export { StoredFile as a, StorageUrlOptions as i, StorageAdapter as n, StoragePutOptions as r, CompleteStorageAdapter as t };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/storage/types.d.ts
|
|
2
1
|
interface StoredFile {
|
|
3
2
|
readonly key: string;
|
|
4
3
|
readonly url?: string | undefined;
|
|
@@ -22,5 +21,4 @@ interface CompleteStorageAdapter extends StorageAdapter {
|
|
|
22
21
|
delete(key: string): Promise<void>;
|
|
23
22
|
getUrl(key: string, options?: StorageUrlOptions): Promise<string>;
|
|
24
23
|
}
|
|
25
|
-
//#endregion
|
|
26
24
|
export { StoredFile as a, StorageUrlOptions as i, StorageAdapter as n, StoragePutOptions as r, CompleteStorageAdapter as t };
|