kassza 0.12.0 → 0.14.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.en.md +48 -0
- package/README.md +427 -32
- package/agents/README.md +26 -6
- package/agents/api.md +218 -3
- package/agents/pitfalls.md +27 -3
- package/agents/recipes.md +280 -51
- package/agents/skills/kassza/SKILL.md +14 -8
- package/agents/skills/migrate-from-szamlazz-js/SKILL.md +39 -0
- package/dist/batch/index.cjs +346 -0
- package/dist/batch/index.d.cts +91 -0
- package/dist/batch/index.d.ts +91 -0
- package/dist/batch/index.js +339 -0
- package/dist/cli.cjs +643 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +643 -0
- package/dist/client-CLFvJCVW.cjs +1452 -0
- package/dist/{client-CL3fuH6A.js → client-Cvf-hTz_.js} +306 -515
- package/dist/client-DeWWQ-RZ.d.ts +341 -0
- package/dist/client-SVZu25MB.d.cts +341 -0
- package/dist/context-CFNKzStE.d.cts +449 -0
- package/dist/context-kb33TgzE.d.ts +449 -0
- package/dist/cookie-stores/index.cjs +21 -150
- package/dist/cookie-stores/index.d.cts +4 -63
- package/dist/cookie-stores/index.d.ts +4 -63
- package/dist/cookie-stores/index.js +3 -144
- package/dist/create-CflXrPip.js +204 -0
- package/dist/create-CvUvLUaT.cjs +257 -0
- package/dist/{create-once-D0pwuenl.cjs → create-once-9yxR_Er_.cjs} +291 -33
- package/dist/create-once-Bh6fOWkW.d.cts +20 -0
- package/dist/{create-once-CqdYmQD8.js → create-once-Ca2gMk1h.js} +250 -34
- package/dist/create-once-VKp0tVow.d.ts +20 -0
- 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 +29 -0
- package/dist/data-link/index.d.ts +29 -0
- package/dist/data-link/index.js +224 -0
- package/dist/delegation/index.cjs +35 -34
- package/dist/delegation/index.d.cts +2 -1
- package/dist/delegation/index.d.ts +2 -1
- package/dist/delegation/index.js +4 -3
- package/dist/{errors-DLrb0g64.js → errors-DtN4g5Z9.js} +9 -1
- package/dist/{errors-DxeuTslP.cjs → errors-EE96_6D_.cjs} +20 -0
- package/dist/get-BdMTseh4.cjs +271 -0
- package/dist/get-Byc9T5WO.d.cts +151 -0
- package/dist/get-Byc9T5WO.d.ts +151 -0
- package/dist/get-CZEShCcj.js +260 -0
- package/dist/index-BhUPY_EH.d.cts +109 -0
- package/dist/index-BqGgQ4t3.d.ts +109 -0
- package/dist/{index-CYAGCdKJ.d.cts → index-C-7yWV7L.d.cts} +24 -1
- package/dist/{index-CYAGCdKJ.d.ts → index-C-7yWV7L.d.ts} +24 -1
- package/dist/index.cjs +19 -5
- package/dist/index.d.cts +11 -19
- package/dist/index.d.ts +11 -19
- package/dist/index.js +6 -6
- package/dist/ipn/index.cjs +26 -5
- package/dist/ipn/index.d.cts +12 -1
- package/dist/ipn/index.d.ts +12 -1
- package/dist/ipn/index.js +26 -6
- package/dist/issue-Bin4tKD_.cjs +988 -0
- package/dist/issue-DMA1Nbr1.js +905 -0
- package/dist/journal/index.cjs +454 -0
- package/dist/journal/index.d.cts +18 -0
- package/dist/journal/index.d.ts +18 -0
- package/dist/journal/index.js +445 -0
- package/dist/journal-DvI81Kt7.d.cts +114 -0
- package/dist/journal-Y9qrIB8G.d.ts +114 -0
- 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 +2 -1
- package/dist/money/index.d.cts +2 -2
- package/dist/money/index.d.ts +2 -2
- package/dist/money/index.js +2 -2
- package/dist/{money-DAA7OwiO.js → money-Cw457SD6.js} +120 -12
- package/dist/{money-DrhGkWHW.cjs → money-K9j0wPit.cjs} +124 -10
- 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-BNbc8U0R.cjs +203 -0
- package/dist/nav-BcCerwWS.js +156 -0
- package/dist/node/index.cjs +124 -0
- package/dist/node/index.d.cts +35 -0
- package/dist/node/index.d.ts +35 -0
- package/dist/node/index.js +120 -0
- package/dist/observe/index.cjs +311 -0
- package/dist/observe/index.d.cts +53 -0
- package/dist/observe/index.d.ts +53 -0
- package/dist/observe/index.js +303 -0
- package/dist/once-BN_3B5OF.cjs +103 -0
- package/dist/once-CqqZxsXG.js +74 -0
- package/dist/parse-Cr7yQ3_z.js +291 -0
- package/dist/parse-DOA2XQ3e.cjs +380 -0
- package/dist/payments/barion.cjs +26 -2
- package/dist/payments/barion.d.cts +2 -2
- package/dist/payments/barion.d.ts +2 -2
- package/dist/payments/barion.js +26 -2
- package/dist/payments/index.cjs +7 -2
- package/dist/payments/index.d.cts +4 -4
- package/dist/payments/index.d.ts +4 -4
- package/dist/payments/index.js +3 -3
- package/dist/payments/paypal.cjs +16 -2
- package/dist/payments/paypal.d.cts +2 -2
- package/dist/payments/paypal.d.ts +2 -2
- package/dist/payments/paypal.js +16 -2
- package/dist/payments/revolut.cjs +17 -3
- package/dist/payments/revolut.d.cts +2 -2
- package/dist/payments/revolut.d.ts +2 -2
- package/dist/payments/revolut.js +17 -3
- package/dist/payments/simplepay.cjs +37 -5
- package/dist/payments/simplepay.d.cts +2 -2
- package/dist/payments/simplepay.d.ts +2 -2
- package/dist/payments/simplepay.js +37 -5
- package/dist/payments/stripe.cjs +20 -3
- package/dist/payments/stripe.d.cts +2 -2
- package/dist/payments/stripe.d.ts +2 -2
- package/dist/payments/stripe.js +20 -3
- package/dist/push-BXj0Sf0Z.d.ts +52 -0
- package/dist/push-D4nNbCNV.d.cts +52 -0
- package/dist/reference-B5TATqb5.js +124 -0
- package/dist/reference-BIdYMK0t.cjs +183 -0
- package/dist/reports/index.cjs +11 -164
- package/dist/reports/index.d.cts +1 -1
- package/dist/reports/index.d.ts +1 -1
- 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-B2eFh3D-.js +219 -0
- package/dist/serialize-CquIsxA-.cjs +290 -0
- package/dist/server-BrJUbXs7.js +1505 -0
- package/dist/server-Dw9j8Mnd.cjs +1558 -0
- package/dist/session-Ckl5eJhV.d.ts +7 -0
- package/dist/{session-CKOuE6Jc.cjs → session-DeM5vjvC.cjs} +69 -13
- package/dist/{session-rMKaJcmq.js → session-SaEEXu2N.js} +58 -14
- package/dist/session-YbChChx7.d.cts +7 -0
- package/dist/storage/fs.cjs +1 -1
- package/dist/storage/fs.js +1 -1
- package/dist/storage/index.cjs +1 -1
- package/dist/storage/index.js +1 -1
- package/dist/store-C1rHd9DB.d.cts +19 -0
- package/dist/store-C1rHd9DB.d.ts +19 -0
- package/dist/stores/index.cjs +24 -0
- package/dist/stores/index.d.cts +4 -0
- package/dist/stores/index.d.ts +4 -0
- package/dist/stores/index.js +3 -0
- package/dist/stores-BNrS0dWl.cjs +506 -0
- package/dist/stores-DhjGBrl_.js +441 -0
- package/dist/testing/index.cjs +1500 -15
- package/dist/testing/index.d.cts +198 -3
- package/dist/testing/index.d.ts +198 -3
- package/dist/testing/index.js +1498 -15
- package/dist/{types-COf1LAD-.d.ts → types-B1A8mUIE.d.cts} +14 -2
- package/dist/{types-COf1LAD-.d.cts → types-ByAEvGsZ.d.ts} +14 -2
- package/dist/{types-k--zHf4l.d.ts → types-D1zDOH_F.d.ts} +1 -1
- package/dist/{types-DH8QoNZK.d.cts → types-lnKkQdot.d.cts} +1 -1
- package/dist/warnings-B3DXnveC.d.cts +31 -0
- package/dist/warnings-B3DXnveC.d.ts +31 -0
- package/dist/warnings-DeIw5RFj.cjs +20 -0
- package/dist/warnings-DwTl5J-2.js +15 -0
- package/dist/{webhook-D4lvtex1.js → webhook-CQVShAfI.js} +47 -26
- package/dist/{webhook-C76bV-4R.cjs → webhook-Ckj-_hPD.cjs} +70 -25
- package/dist/webhook-CmdhGiH5.d.cts +11 -0
- package/dist/webhook-D6lEejob.d.ts +11 -0
- package/llms.txt +6 -5
- package/package.json +134 -4
- package/dist/client-CickRRFr.d.ts +0 -838
- package/dist/client-CsmGIFRS.cjs +0 -1637
- package/dist/client-DvWZoX_E.d.cts +0 -838
- package/dist/issue-BsyYdrIG.cjs +0 -1531
- package/dist/issue-C6Fcjvln.js +0 -1274
- package/dist/session-Dm_45x8K.d.cts +0 -11
- package/dist/session-Dm_45x8K.d.ts +0 -11
- package/dist/webhook-CfaDgcL0.d.cts +0 -6
- package/dist/webhook-q2OzNwd7.d.ts +0 -6
|
@@ -1,63 +1,4 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
readonly operation: CookieStoreOperation;
|
|
6
|
-
readonly key: string;
|
|
7
|
-
readonly error: unknown;
|
|
8
|
-
}
|
|
9
|
-
interface ResilientCookieStoreOptions {
|
|
10
|
-
readonly onError?: ((event: CookieStoreErrorEvent) => void) | undefined;
|
|
11
|
-
readonly timeoutMs?: number | undefined;
|
|
12
|
-
}
|
|
13
|
-
export declare function resilientCookieStore(store: CookieStore, options?: ResilientCookieStoreOptions): CookieStore;
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/cookie-stores/shared.d.ts
|
|
16
|
-
interface CookieStoreAdapterOptions extends ResilientCookieStoreOptions {
|
|
17
|
-
readonly prefix?: string | undefined;
|
|
18
|
-
readonly resilient?: boolean | undefined;
|
|
19
|
-
}
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region src/cookie-stores/cloudflare-kv.d.ts
|
|
22
|
-
export declare const CLOUDFLARE_KV_MIN_TTL_SECONDS = 60;
|
|
23
|
-
interface CloudflareKvNamespaceLike {
|
|
24
|
-
get(key: string): Promise<string | null>;
|
|
25
|
-
put(key: string, value: string, options: {
|
|
26
|
-
expirationTtl: number;
|
|
27
|
-
}): Promise<void>;
|
|
28
|
-
delete(key: string): Promise<void>;
|
|
29
|
-
}
|
|
30
|
-
export declare function cloudflareKvCookieStore(namespace: CloudflareKvNamespaceLike, options?: CookieStoreAdapterOptions): CookieStore;
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region src/cookie-stores/custom.d.ts
|
|
33
|
-
export declare function customCookieStore(store: CookieStore, options?: CookieStoreAdapterOptions): CookieStore;
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region src/cookie-stores/ioredis.d.ts
|
|
36
|
-
interface IoRedisLike {
|
|
37
|
-
get(key: string): Promise<unknown>;
|
|
38
|
-
set(key: string, value: string, expiryMode: "EX", seconds: number): Promise<unknown>;
|
|
39
|
-
del(key: string): Promise<unknown>;
|
|
40
|
-
}
|
|
41
|
-
export declare function ioredisCookieStore(redis: IoRedisLike, options?: CookieStoreAdapterOptions): CookieStore;
|
|
42
|
-
//#endregion
|
|
43
|
-
//#region src/cookie-stores/node-redis.d.ts
|
|
44
|
-
interface NodeRedisLike {
|
|
45
|
-
get(key: string): Promise<unknown>;
|
|
46
|
-
set(key: string, value: string, options: {
|
|
47
|
-
EX: number;
|
|
48
|
-
}): Promise<unknown>;
|
|
49
|
-
del(key: string): Promise<unknown>;
|
|
50
|
-
}
|
|
51
|
-
export declare function nodeRedisCookieStore(client: NodeRedisLike, options?: CookieStoreAdapterOptions): CookieStore;
|
|
52
|
-
//#endregion
|
|
53
|
-
//#region src/cookie-stores/upstash.d.ts
|
|
54
|
-
interface UpstashRedisLike {
|
|
55
|
-
get(key: string): Promise<unknown>;
|
|
56
|
-
set(key: string, value: string, options: {
|
|
57
|
-
ex: number;
|
|
58
|
-
}): Promise<unknown>;
|
|
59
|
-
del(key: string): Promise<unknown>;
|
|
60
|
-
}
|
|
61
|
-
export declare function upstashRedisCookieStore(redis: UpstashRedisLike, options?: CookieStoreAdapterOptions): CookieStore;
|
|
62
|
-
//#endregion
|
|
63
|
-
export { type CloudflareKvNamespaceLike, type CookieStore, type CookieStoreAdapterOptions, type CookieStoreErrorEvent, type CookieStoreOperation, type IoRedisLike, type NodeRedisLike, type ResilientCookieStoreOptions, SESSION_TTL_SECONDS, type UpstashRedisLike, memoryCookieStore };
|
|
1
|
+
import { a as storeCapabilities, i as memoryStore, n as KeyValueStore, r as StoreCapabilities, t as Awaitable } from "../store-C1rHd9DB.cjs";
|
|
2
|
+
import { n as SESSION_TTL_SECONDS, r as memoryCookieStore, t as CookieStore } from "../session-YbChChx7.cjs";
|
|
3
|
+
import { C as CookieStoreErrorEvent, E as resilientCookieStore, S as CookieStoreAdapterOptions, T as ResilientCookieStoreOptions, _ as ioredisCookieStore, a as DurableObjectStubLike, b as CloudflareKvNamespaceLike, c as DiagnoseStoreOptions, d as diagnoseStore, f as UpstashRedisLike, g as IoRedisLike, h as nodeRedisCookieStore, i as DurableObjectStoreOperation, l as StoreDiagnosis, m as NodeRedisLike, n as DurableObjectStorageLike, o as durableObjectStore, p as upstashRedisCookieStore, r as DurableObjectStoreEntry, s as handleDurableObjectStoreRequest, t as DURABLE_OBJECT_STORE_URL, u as StoreSuitability, v as customCookieStore, w as CookieStoreOperation, x as cloudflareKvCookieStore, y as CLOUDFLARE_KV_MIN_TTL_SECONDS } from "../index-BhUPY_EH.cjs";
|
|
4
|
+
export { type Awaitable, CLOUDFLARE_KV_MIN_TTL_SECONDS, type CloudflareKvNamespaceLike, type CookieStore, type CookieStoreAdapterOptions, type CookieStoreErrorEvent, type CookieStoreOperation, DURABLE_OBJECT_STORE_URL, type DiagnoseStoreOptions, type DurableObjectStorageLike, type DurableObjectStoreEntry, type DurableObjectStoreOperation, type DurableObjectStubLike, type IoRedisLike, type KeyValueStore, type NodeRedisLike, type ResilientCookieStoreOptions, SESSION_TTL_SECONDS, type StoreCapabilities, type StoreDiagnosis, type StoreSuitability, type UpstashRedisLike, cloudflareKvCookieStore, cloudflareKvCookieStore as cloudflareKvStore, customCookieStore, customCookieStore as customStore, diagnoseStore, durableObjectStore, handleDurableObjectStoreRequest, ioredisCookieStore, ioredisCookieStore as ioredisStore, memoryCookieStore, memoryStore, nodeRedisCookieStore, nodeRedisCookieStore as nodeRedisStore, resilientCookieStore, resilientCookieStore as resilientStore, storeCapabilities, upstashRedisCookieStore, upstashRedisCookieStore as upstashRedisStore };
|
|
@@ -1,63 +1,4 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
readonly operation: CookieStoreOperation;
|
|
6
|
-
readonly key: string;
|
|
7
|
-
readonly error: unknown;
|
|
8
|
-
}
|
|
9
|
-
interface ResilientCookieStoreOptions {
|
|
10
|
-
readonly onError?: ((event: CookieStoreErrorEvent) => void) | undefined;
|
|
11
|
-
readonly timeoutMs?: number | undefined;
|
|
12
|
-
}
|
|
13
|
-
export declare function resilientCookieStore(store: CookieStore, options?: ResilientCookieStoreOptions): CookieStore;
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/cookie-stores/shared.d.ts
|
|
16
|
-
interface CookieStoreAdapterOptions extends ResilientCookieStoreOptions {
|
|
17
|
-
readonly prefix?: string | undefined;
|
|
18
|
-
readonly resilient?: boolean | undefined;
|
|
19
|
-
}
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region src/cookie-stores/cloudflare-kv.d.ts
|
|
22
|
-
export declare const CLOUDFLARE_KV_MIN_TTL_SECONDS = 60;
|
|
23
|
-
interface CloudflareKvNamespaceLike {
|
|
24
|
-
get(key: string): Promise<string | null>;
|
|
25
|
-
put(key: string, value: string, options: {
|
|
26
|
-
expirationTtl: number;
|
|
27
|
-
}): Promise<void>;
|
|
28
|
-
delete(key: string): Promise<void>;
|
|
29
|
-
}
|
|
30
|
-
export declare function cloudflareKvCookieStore(namespace: CloudflareKvNamespaceLike, options?: CookieStoreAdapterOptions): CookieStore;
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region src/cookie-stores/custom.d.ts
|
|
33
|
-
export declare function customCookieStore(store: CookieStore, options?: CookieStoreAdapterOptions): CookieStore;
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region src/cookie-stores/ioredis.d.ts
|
|
36
|
-
interface IoRedisLike {
|
|
37
|
-
get(key: string): Promise<unknown>;
|
|
38
|
-
set(key: string, value: string, expiryMode: "EX", seconds: number): Promise<unknown>;
|
|
39
|
-
del(key: string): Promise<unknown>;
|
|
40
|
-
}
|
|
41
|
-
export declare function ioredisCookieStore(redis: IoRedisLike, options?: CookieStoreAdapterOptions): CookieStore;
|
|
42
|
-
//#endregion
|
|
43
|
-
//#region src/cookie-stores/node-redis.d.ts
|
|
44
|
-
interface NodeRedisLike {
|
|
45
|
-
get(key: string): Promise<unknown>;
|
|
46
|
-
set(key: string, value: string, options: {
|
|
47
|
-
EX: number;
|
|
48
|
-
}): Promise<unknown>;
|
|
49
|
-
del(key: string): Promise<unknown>;
|
|
50
|
-
}
|
|
51
|
-
export declare function nodeRedisCookieStore(client: NodeRedisLike, options?: CookieStoreAdapterOptions): CookieStore;
|
|
52
|
-
//#endregion
|
|
53
|
-
//#region src/cookie-stores/upstash.d.ts
|
|
54
|
-
interface UpstashRedisLike {
|
|
55
|
-
get(key: string): Promise<unknown>;
|
|
56
|
-
set(key: string, value: string, options: {
|
|
57
|
-
ex: number;
|
|
58
|
-
}): Promise<unknown>;
|
|
59
|
-
del(key: string): Promise<unknown>;
|
|
60
|
-
}
|
|
61
|
-
export declare function upstashRedisCookieStore(redis: UpstashRedisLike, options?: CookieStoreAdapterOptions): CookieStore;
|
|
62
|
-
//#endregion
|
|
63
|
-
export { type CloudflareKvNamespaceLike, type CookieStore, type CookieStoreAdapterOptions, type CookieStoreErrorEvent, type CookieStoreOperation, type IoRedisLike, type NodeRedisLike, type ResilientCookieStoreOptions, SESSION_TTL_SECONDS, type UpstashRedisLike, memoryCookieStore };
|
|
1
|
+
import { a as storeCapabilities, i as memoryStore, n as KeyValueStore, r as StoreCapabilities, t as Awaitable } from "../store-C1rHd9DB.js";
|
|
2
|
+
import { n as SESSION_TTL_SECONDS, r as memoryCookieStore, t as CookieStore } from "../session-Ckl5eJhV.js";
|
|
3
|
+
import { C as CookieStoreErrorEvent, E as resilientCookieStore, S as CookieStoreAdapterOptions, T as ResilientCookieStoreOptions, _ as ioredisCookieStore, a as DurableObjectStubLike, b as CloudflareKvNamespaceLike, c as DiagnoseStoreOptions, d as diagnoseStore, f as UpstashRedisLike, g as IoRedisLike, h as nodeRedisCookieStore, i as DurableObjectStoreOperation, l as StoreDiagnosis, m as NodeRedisLike, n as DurableObjectStorageLike, o as durableObjectStore, p as upstashRedisCookieStore, r as DurableObjectStoreEntry, s as handleDurableObjectStoreRequest, t as DURABLE_OBJECT_STORE_URL, u as StoreSuitability, v as customCookieStore, w as CookieStoreOperation, x as cloudflareKvCookieStore, y as CLOUDFLARE_KV_MIN_TTL_SECONDS } from "../index-BqGgQ4t3.js";
|
|
4
|
+
export { type Awaitable, CLOUDFLARE_KV_MIN_TTL_SECONDS, type CloudflareKvNamespaceLike, type CookieStore, type CookieStoreAdapterOptions, type CookieStoreErrorEvent, type CookieStoreOperation, DURABLE_OBJECT_STORE_URL, type DiagnoseStoreOptions, type DurableObjectStorageLike, type DurableObjectStoreEntry, type DurableObjectStoreOperation, type DurableObjectStubLike, type IoRedisLike, type KeyValueStore, type NodeRedisLike, type ResilientCookieStoreOptions, SESSION_TTL_SECONDS, type StoreCapabilities, type StoreDiagnosis, type StoreSuitability, type UpstashRedisLike, cloudflareKvCookieStore, cloudflareKvCookieStore as cloudflareKvStore, customCookieStore, customCookieStore as customStore, diagnoseStore, durableObjectStore, handleDurableObjectStoreRequest, ioredisCookieStore, ioredisCookieStore as ioredisStore, memoryCookieStore, memoryStore, nodeRedisCookieStore, nodeRedisCookieStore as nodeRedisStore, resilientCookieStore, resilientCookieStore as resilientStore, storeCapabilities, upstashRedisCookieStore, upstashRedisCookieStore as upstashRedisStore };
|
|
@@ -1,144 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
|
|
4
|
-
function warnCookieStoreError(event) {
|
|
5
|
-
console.warn(`[szamlazz] A session cookie store "${event.operation}" művelete sikertelen, a kérés session nélkül folytatódik.`, event.error);
|
|
6
|
-
}
|
|
7
|
-
function withTimeout(promise, timeoutMs, operation) {
|
|
8
|
-
if (timeoutMs === void 0) return promise;
|
|
9
|
-
let timer;
|
|
10
|
-
const timeout = new Promise((_, reject) => {
|
|
11
|
-
timer = setTimeout(() => {
|
|
12
|
-
reject(/* @__PURE__ */ new Error(`A session cookie store "${operation}" művelete nem fejeződött be ${timeoutMs} ms alatt.`));
|
|
13
|
-
}, timeoutMs);
|
|
14
|
-
});
|
|
15
|
-
return Promise.race([promise, timeout]).finally(() => clearTimeout(timer));
|
|
16
|
-
}
|
|
17
|
-
function resilientCookieStore(store, options = {}) {
|
|
18
|
-
const onError = options.onError ?? warnCookieStoreError;
|
|
19
|
-
if (options.timeoutMs !== void 0 && !(options.timeoutMs > 0)) throw new RangeError(`A timeoutMs pozitív szám legyen, kapott: ${options.timeoutMs}`);
|
|
20
|
-
function report(operation, key, error) {
|
|
21
|
-
try {
|
|
22
|
-
onError({
|
|
23
|
-
operation,
|
|
24
|
-
key,
|
|
25
|
-
error
|
|
26
|
-
});
|
|
27
|
-
} catch {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
async function run(operation, key, call) {
|
|
32
|
-
try {
|
|
33
|
-
return await withTimeout(Promise.resolve().then(call), options.timeoutMs, operation);
|
|
34
|
-
} catch (error) {
|
|
35
|
-
report(operation, key, error);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
async get(key) {
|
|
41
|
-
return await run("get", key, () => store.get(key)) ?? void 0;
|
|
42
|
-
},
|
|
43
|
-
async set(key, value, ttlSeconds) {
|
|
44
|
-
await run("set", key, () => store.set(key, value, ttlSeconds));
|
|
45
|
-
},
|
|
46
|
-
async delete(key) {
|
|
47
|
-
await run("delete", key, () => store.delete(key));
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region src/cookie-stores/shared.ts
|
|
53
|
-
function prefixKey(options, key) {
|
|
54
|
-
const prefix = options?.prefix;
|
|
55
|
-
return prefix ? `${prefix}${key}` : key;
|
|
56
|
-
}
|
|
57
|
-
function finalizeCookieStore(store, options) {
|
|
58
|
-
if (options?.resilient === false) return store;
|
|
59
|
-
return resilientCookieStore(store, {
|
|
60
|
-
onError: options?.onError,
|
|
61
|
-
timeoutMs: options?.timeoutMs
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
function readCookieValue(value) {
|
|
65
|
-
if (typeof value === "string") return value === "" ? void 0 : value;
|
|
66
|
-
if (value instanceof Uint8Array) return readCookieValue(decodeUtf8(value));
|
|
67
|
-
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
68
|
-
}
|
|
69
|
-
function wholeSeconds(ttlSeconds, minimum) {
|
|
70
|
-
if (!Number.isFinite(ttlSeconds)) return minimum;
|
|
71
|
-
return Math.max(minimum, Math.ceil(ttlSeconds));
|
|
72
|
-
}
|
|
73
|
-
//#endregion
|
|
74
|
-
//#region src/cookie-stores/cloudflare-kv.ts
|
|
75
|
-
const CLOUDFLARE_KV_MIN_TTL_SECONDS = 60;
|
|
76
|
-
function cloudflareKvCookieStore(namespace, options) {
|
|
77
|
-
return finalizeCookieStore({
|
|
78
|
-
async get(key) {
|
|
79
|
-
return readCookieValue(await namespace.get(prefixKey(options, key)));
|
|
80
|
-
},
|
|
81
|
-
async set(key, value, ttlSeconds) {
|
|
82
|
-
await namespace.put(prefixKey(options, key), value, { expirationTtl: wholeSeconds(ttlSeconds, 60) });
|
|
83
|
-
},
|
|
84
|
-
async delete(key) {
|
|
85
|
-
await namespace.delete(prefixKey(options, key));
|
|
86
|
-
}
|
|
87
|
-
}, options);
|
|
88
|
-
}
|
|
89
|
-
//#endregion
|
|
90
|
-
//#region src/cookie-stores/custom.ts
|
|
91
|
-
function customCookieStore(store, options) {
|
|
92
|
-
return finalizeCookieStore({
|
|
93
|
-
get: (key) => store.get(prefixKey(options, key)),
|
|
94
|
-
set: (key, value, ttlSeconds) => store.set(prefixKey(options, key), value, ttlSeconds),
|
|
95
|
-
delete: (key) => store.delete(prefixKey(options, key))
|
|
96
|
-
}, options);
|
|
97
|
-
}
|
|
98
|
-
//#endregion
|
|
99
|
-
//#region src/cookie-stores/ioredis.ts
|
|
100
|
-
function ioredisCookieStore(redis, options) {
|
|
101
|
-
return finalizeCookieStore({
|
|
102
|
-
async get(key) {
|
|
103
|
-
return readCookieValue(await redis.get(prefixKey(options, key)));
|
|
104
|
-
},
|
|
105
|
-
async set(key, value, ttlSeconds) {
|
|
106
|
-
await redis.set(prefixKey(options, key), value, "EX", wholeSeconds(ttlSeconds, 1));
|
|
107
|
-
},
|
|
108
|
-
async delete(key) {
|
|
109
|
-
await redis.del(prefixKey(options, key));
|
|
110
|
-
}
|
|
111
|
-
}, options);
|
|
112
|
-
}
|
|
113
|
-
//#endregion
|
|
114
|
-
//#region src/cookie-stores/node-redis.ts
|
|
115
|
-
function nodeRedisCookieStore(client, options) {
|
|
116
|
-
return finalizeCookieStore({
|
|
117
|
-
async get(key) {
|
|
118
|
-
return readCookieValue(await client.get(prefixKey(options, key)));
|
|
119
|
-
},
|
|
120
|
-
async set(key, value, ttlSeconds) {
|
|
121
|
-
await client.set(prefixKey(options, key), value, { EX: wholeSeconds(ttlSeconds, 1) });
|
|
122
|
-
},
|
|
123
|
-
async delete(key) {
|
|
124
|
-
await client.del(prefixKey(options, key));
|
|
125
|
-
}
|
|
126
|
-
}, options);
|
|
127
|
-
}
|
|
128
|
-
//#endregion
|
|
129
|
-
//#region src/cookie-stores/upstash.ts
|
|
130
|
-
function upstashRedisCookieStore(redis, options) {
|
|
131
|
-
return finalizeCookieStore({
|
|
132
|
-
async get(key) {
|
|
133
|
-
return readCookieValue(await redis.get(prefixKey(options, key)));
|
|
134
|
-
},
|
|
135
|
-
async set(key, value, ttlSeconds) {
|
|
136
|
-
await redis.set(prefixKey(options, key), value, { ex: wholeSeconds(ttlSeconds, 1) });
|
|
137
|
-
},
|
|
138
|
-
async delete(key) {
|
|
139
|
-
await redis.del(prefixKey(options, key));
|
|
140
|
-
}
|
|
141
|
-
}, options);
|
|
142
|
-
}
|
|
143
|
-
//#endregion
|
|
144
|
-
export { CLOUDFLARE_KV_MIN_TTL_SECONDS, SESSION_TTL_SECONDS, cloudflareKvCookieStore, customCookieStore, ioredisCookieStore, memoryCookieStore, nodeRedisCookieStore, resilientCookieStore, upstashRedisCookieStore };
|
|
1
|
+
import { a as memoryStore, n as memoryCookieStore, o as storeCapabilities, t as SESSION_TTL_SECONDS } from "../session-SaEEXu2N.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-DhjGBrl_.js";
|
|
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 };
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { r as SzamlazzError } from "./errors-DtN4g5Z9.js";
|
|
2
|
+
import { a as optionalEl, n as buildXmlDocument, r as el } from "./serialize-B2eFh3D-.js";
|
|
3
|
+
import { n as parseReceiptResponse } from "./parse-Cr7yQ3_z.js";
|
|
4
|
+
import { n as decimalPlaces, r as roundMoney } from "./rounding-BLyHjjI5.js";
|
|
5
|
+
import { i as isHuf, o as vatPercentage } from "./vat-v_dcWCto.js";
|
|
6
|
+
import { i as calculateReceiptItem } from "./money-Cw457SD6.js";
|
|
7
|
+
//#region src/receipts/types.ts
|
|
8
|
+
const RECEIPT_ONLY_VAT_CODES = [
|
|
9
|
+
"ÁKK",
|
|
10
|
+
"MAA",
|
|
11
|
+
"EU",
|
|
12
|
+
"EUK"
|
|
13
|
+
];
|
|
14
|
+
const RECEIPT_PDF_TEMPLATES = [
|
|
15
|
+
"A",
|
|
16
|
+
"N",
|
|
17
|
+
"J",
|
|
18
|
+
"L"
|
|
19
|
+
];
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/receipts/common.ts
|
|
22
|
+
const RECEIPT_XSD_BASE_URL = "https://www.szamlazz.hu/szamla/docs/xsds/";
|
|
23
|
+
function receiptValidationError(message) {
|
|
24
|
+
return new SzamlazzError(message, { category: "validation" });
|
|
25
|
+
}
|
|
26
|
+
function requireText(value, message) {
|
|
27
|
+
const trimmed = value?.trim();
|
|
28
|
+
if (!trimmed) throw receiptValidationError(message);
|
|
29
|
+
return trimmed;
|
|
30
|
+
}
|
|
31
|
+
function optionalText(value) {
|
|
32
|
+
const trimmed = value?.trim();
|
|
33
|
+
return trimmed ? trimmed : void 0;
|
|
34
|
+
}
|
|
35
|
+
const templates = new Set(RECEIPT_PDF_TEMPLATES);
|
|
36
|
+
function validateTemplate(template) {
|
|
37
|
+
if (template === void 0) return void 0;
|
|
38
|
+
if (!templates.has(template)) throw receiptValidationError(`Ismeretlen nyugta PDF sablon: ${String(template)}. Lehetséges értékek: A (normál A4), N (80 mm), J (jegy), L (jegy logóval).`);
|
|
39
|
+
return template;
|
|
40
|
+
}
|
|
41
|
+
function requireReceiptNumber(value) {
|
|
42
|
+
return requireText(value, "Add meg a nyugtaszámot (receiptNumber).");
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/receipts/create.ts
|
|
46
|
+
const CREATE_RECEIPT_NAMESPACE = "http://www.szamlazz.hu/xmlnyugtacreate";
|
|
47
|
+
const DEFAULT_CURRENCY = "HUF";
|
|
48
|
+
const DEFAULT_UNIT = "db";
|
|
49
|
+
const PREFIX_PATTERN = /^[A-Z0-9]+$/;
|
|
50
|
+
const AMOUNT_TOLERANCE = 2;
|
|
51
|
+
const MONEY_DECIMALS = 2;
|
|
52
|
+
const receiptOnlyVatCodes = new Set(RECEIPT_ONLY_VAT_CODES);
|
|
53
|
+
function calculateItem(item, currency, index) {
|
|
54
|
+
const vat = typeof item.vat === "string" && receiptOnlyVatCodes.has(item.vat) ? 0 : item.vat;
|
|
55
|
+
try {
|
|
56
|
+
return calculateReceiptItem({
|
|
57
|
+
...item,
|
|
58
|
+
vat
|
|
59
|
+
}, currency);
|
|
60
|
+
} catch (error) {
|
|
61
|
+
if (!(error instanceof SzamlazzError)) throw error;
|
|
62
|
+
throw receiptValidationError(`${index + 1}. tétel (${item.name}): ${error.message}`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function assertHufAmounts(amounts, label, vat) {
|
|
66
|
+
if (!Number.isInteger(amounts.grossAmount)) throw receiptValidationError(`${label}: forintos nyugtán a bruttó összegnek egész számnak kell lennie (363).`);
|
|
67
|
+
if (decimalPlaces(amounts.netAmount) > MONEY_DECIMALS) throw receiptValidationError(`${label}: forintos nyugtán a nettó összeg legfeljebb 2 tizedesjegyet tartalmazhat (364).`);
|
|
68
|
+
if (decimalPlaces(amounts.vatAmount) > MONEY_DECIMALS) throw receiptValidationError(`${label}: forintos nyugtán az áfa összeg legfeljebb 2 tizedesjegyet tartalmazhat (365).`);
|
|
69
|
+
if (roundMoney(amounts.netAmount + amounts.vatAmount, MONEY_DECIMALS) !== amounts.grossAmount) throw receiptValidationError(`${label}: a nettó és az áfa összegének pontosan ki kell adnia a bruttót (261).`);
|
|
70
|
+
if (Math.abs(amounts.netUnitPrice * amounts.quantity - amounts.netAmount) > AMOUNT_TOLERANCE) throw receiptValidationError(`${label}: a nettó egységár és a mennyiség szorzata nem egyezik a nettó összeggel (259).`);
|
|
71
|
+
const expectedVat = amounts.netAmount * vatPercentage(vat) / 100;
|
|
72
|
+
if (Math.abs(expectedVat - amounts.vatAmount) > AMOUNT_TOLERANCE) throw receiptValidationError(`${label}: az áfa összeg nem egyezik a nettó összeg és az áfakulcs szorzatával (260).`);
|
|
73
|
+
}
|
|
74
|
+
function calculateReceiptItems(items, currency) {
|
|
75
|
+
if (items.length === 0) throw receiptValidationError("A nyugtán legalább egy tételnek szerepelnie kell.");
|
|
76
|
+
return items.map((input, index) => {
|
|
77
|
+
requireText(input.name, `A(z) ${index + 1}. tétel megnevezése (name) kötelező.`);
|
|
78
|
+
const amounts = calculateItem(input, currency, index);
|
|
79
|
+
if (isHuf(currency)) assertHufAmounts(amounts, `${index + 1}. tétel (${input.name})`, input.vat);
|
|
80
|
+
if (input.dataDeletionCode !== void 0) {
|
|
81
|
+
if (!Number.isInteger(input.dataDeletionCode) || input.dataDeletionCode < 0) throw receiptValidationError(`A(z) ${index + 1}. tétel adattörlő kódja (dataDeletionCode) nemnegatív egész szám legyen.`);
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
input,
|
|
85
|
+
amounts,
|
|
86
|
+
vat: input.vat
|
|
87
|
+
};
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function formatAmount(value, currency, decimals) {
|
|
91
|
+
return isHuf(currency) ? value.toFixed(decimals) : value;
|
|
92
|
+
}
|
|
93
|
+
function itemNode(item, currency, unit) {
|
|
94
|
+
const { input, amounts } = item;
|
|
95
|
+
const ledger = input.ledger;
|
|
96
|
+
return el("tetel", [
|
|
97
|
+
el("megnevezes", input.name.trim()),
|
|
98
|
+
optionalEl("azonosito", optionalText(input.identifier)),
|
|
99
|
+
el("mennyiseg", amounts.quantity),
|
|
100
|
+
el("mennyisegiEgyseg", optionalText(input.unit) ?? unit),
|
|
101
|
+
el("nettoEgysegar", amounts.netUnitPrice),
|
|
102
|
+
el("afakulcs", String(item.vat)),
|
|
103
|
+
el("netto", formatAmount(amounts.netAmount, currency, MONEY_DECIMALS)),
|
|
104
|
+
el("afa", formatAmount(amounts.vatAmount, currency, MONEY_DECIMALS)),
|
|
105
|
+
el("brutto", formatAmount(amounts.grossAmount, currency, 0)),
|
|
106
|
+
ledger && optionalEl("fokonyv", [optionalEl("arbevetel", optionalText(ledger.revenue)), optionalEl("afa", optionalText(ledger.vat))]),
|
|
107
|
+
optionalEl("megjegyzes", optionalText(input.comment)),
|
|
108
|
+
optionalEl("torloKod", input.dataDeletionCode)
|
|
109
|
+
]);
|
|
110
|
+
}
|
|
111
|
+
function paymentNodes(payments, items) {
|
|
112
|
+
if (payments === void 0 || payments.length === 0) return void 0;
|
|
113
|
+
const nodes = payments.map((payment, index) => {
|
|
114
|
+
const method = requireText(payment.method, `A(z) ${index + 1}. kifizetés fizetési eszköze (method) kötelező.`);
|
|
115
|
+
if (!Number.isFinite(payment.amount)) throw receiptValidationError(`A(z) ${index + 1}. kifizetés összege nem érvényes szám.`);
|
|
116
|
+
return el("kifizetes", [
|
|
117
|
+
el("fizetoeszkoz", method),
|
|
118
|
+
el("osszeg", payment.amount),
|
|
119
|
+
optionalEl("leiras", optionalText(payment.description))
|
|
120
|
+
]);
|
|
121
|
+
});
|
|
122
|
+
const paid = roundMoney(payments.reduce((sum, payment) => sum + payment.amount, 0), MONEY_DECIMALS);
|
|
123
|
+
const gross = roundMoney(items.reduce((sum, item) => sum + item.amounts.grossAmount, 0), MONEY_DECIMALS);
|
|
124
|
+
if (paid !== gross) throw receiptValidationError(`A kifizetések összege (${paid}) eltér a nyugta bruttó végösszegétől (${gross}) (340).`);
|
|
125
|
+
return el("kifizetesek", nodes);
|
|
126
|
+
}
|
|
127
|
+
function resolvePrefix(value) {
|
|
128
|
+
const prefix = requireText(value, "Add meg a nyugta előtagját (prefix) a hívásban vagy a receipts alapbeállításaiban.");
|
|
129
|
+
if (!PREFIX_PATTERN.test(prefix)) throw receiptValidationError(`A nyugta előtag csak nagybetűt és számot tartalmazhat, kapott: ${prefix} (337).`);
|
|
130
|
+
return prefix;
|
|
131
|
+
}
|
|
132
|
+
function resolveExchange(currency, rate, bank) {
|
|
133
|
+
if (isHuf(currency)) return {
|
|
134
|
+
rate: void 0,
|
|
135
|
+
bank: void 0
|
|
136
|
+
};
|
|
137
|
+
if (rate === void 0 || !Number.isFinite(rate) || rate <= 0) throw receiptValidationError(`Devizás nyugtánál (${currency}) add meg az árfolyamot (exchangeRate) pozitív számként.`);
|
|
138
|
+
return {
|
|
139
|
+
rate,
|
|
140
|
+
bank: requireText(bank, `Devizás nyugtánál (${currency}) add meg az árfolyamot jegyző bankot (exchangeBank).`)
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
function buildCreateReceiptXml(credentials, defaults, input) {
|
|
144
|
+
const prefix = resolvePrefix(input.prefix ?? defaults.prefix);
|
|
145
|
+
const paymentMethod = requireText(input.paymentMethod ?? defaults.paymentMethod, "Add meg a fizetési módot (paymentMethod) a hívásban vagy a receipts alapbeállításaiban.");
|
|
146
|
+
const currency = optionalText(input.currency ?? defaults.currency) ?? DEFAULT_CURRENCY;
|
|
147
|
+
const exchange = resolveExchange(currency, input.exchangeRate ?? defaults.exchangeRate, input.exchangeBank ?? defaults.exchangeBank);
|
|
148
|
+
const template = validateTemplate(input.template ?? defaults.template);
|
|
149
|
+
const items = calculateReceiptItems(input.items ?? [], currency);
|
|
150
|
+
const unit = optionalText(defaults.unit) ?? DEFAULT_UNIT;
|
|
151
|
+
const payments = paymentNodes(input.payments, items);
|
|
152
|
+
const downloadPdf = input.downloadPdf ?? defaults.downloadPdf ?? true;
|
|
153
|
+
return buildXmlDocument({
|
|
154
|
+
root: "xmlnyugtacreate",
|
|
155
|
+
namespace: CREATE_RECEIPT_NAMESPACE,
|
|
156
|
+
schemaLocation: `${RECEIPT_XSD_BASE_URL}nyugtacreate/xmlnyugtacreate.xsd`,
|
|
157
|
+
children: [
|
|
158
|
+
el("beallitasok", [...credentials, el("pdfLetoltes", downloadPdf)]),
|
|
159
|
+
el("fejlec", [
|
|
160
|
+
optionalEl("hivasAzonosito", optionalText(input.callId)),
|
|
161
|
+
el("elotag", prefix),
|
|
162
|
+
el("fizmod", paymentMethod),
|
|
163
|
+
el("penznem", currency),
|
|
164
|
+
optionalEl("devizaarf", exchange.rate),
|
|
165
|
+
optionalEl("devizabank", exchange.bank),
|
|
166
|
+
optionalEl("megjegyzes", optionalText(input.comment)),
|
|
167
|
+
optionalEl("pdfSablon", template),
|
|
168
|
+
optionalEl("fokonyvVevo", optionalText(input.customerLedgerId ?? defaults.customerLedgerId)),
|
|
169
|
+
optionalEl("rendelesSzam", optionalText(input.orderNumber))
|
|
170
|
+
]),
|
|
171
|
+
el("tetelek", items.map((item) => itemNode(item, currency, unit))),
|
|
172
|
+
payments
|
|
173
|
+
]
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
const DUPLICATE_CALL_ID_CODE = 338;
|
|
177
|
+
function enrichDuplicateError(error, input) {
|
|
178
|
+
if (!(error instanceof SzamlazzError) || error.code !== DUPLICATE_CALL_ID_CODE) return error;
|
|
179
|
+
const lookup = input.orderNumber ? ` A meglévő nyugtát a getReceipt({ orderNumber: '${input.orderNumber}' }) hívással kérdezheted le, ha a fiókban tiltva van a rendelésszám ismétlődése.` : " A Számla Agent hívásazonosító alapján nem ad lekérdezési lehetőséget, ezért a meglévő nyugtát a Számlázz.hu felületén keresd meg, vagy adj meg rendelésszámot (orderNumber) is.";
|
|
180
|
+
return new SzamlazzError(error.message, {
|
|
181
|
+
category: "duplicate",
|
|
182
|
+
code: error.code,
|
|
183
|
+
hint: `Ezzel a hívásazonosítóval (callId: ${input.callId ?? ""}) már készült nyugta, a nyugta nem jött létre újra.${lookup}`,
|
|
184
|
+
action: error.action,
|
|
185
|
+
httpStatus: error.httpStatus,
|
|
186
|
+
rawResponse: error.rawResponse,
|
|
187
|
+
cause: error
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
async function createReceipt(ctx, defaults, input, options = {}) {
|
|
191
|
+
const xml = buildCreateReceiptXml(ctx.credentials, defaults, input);
|
|
192
|
+
try {
|
|
193
|
+
return await ctx.execute({
|
|
194
|
+
action: "createReceipt",
|
|
195
|
+
xml,
|
|
196
|
+
signal: options.signal,
|
|
197
|
+
safeToRetry: optionalText(input.callId) !== void 0
|
|
198
|
+
}, parseReceiptResponse);
|
|
199
|
+
} catch (error) {
|
|
200
|
+
throw enrichDuplicateError(error, input);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
//#endregion
|
|
204
|
+
export { optionalText as a, validateTemplate as c, RECEIPT_XSD_BASE_URL as i, RECEIPT_ONLY_VAT_CODES as l, calculateReceiptItems as n, receiptValidationError as o, createReceipt as r, requireReceiptNumber as s, buildCreateReceiptXml as t };
|