diff --git a/package-lock.json b/package-lock.json index 9616259..fba4c77 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "simpay-typescript-api", - "version": "3.0.2", + "version": "3.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "simpay-typescript-api", - "version": "3.0.2", + "version": "3.0.3", "license": "MIT", "dependencies": { "axios": "^1.7.9" @@ -17,7 +17,8 @@ "@changesets/cli": "^2.27.11", "@types/node": "^22.10.5", "ts-node": "^10.9.2", - "typescript": "^5.7.2" + "typescript": "^5.7.2", + "vitest": "^2.1.8" }, "engines": { "node": ">=20.17.0" @@ -528,6 +529,397 @@ "node": ">=12" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", @@ -666,6 +1058,272 @@ "node": ">= 8" } }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.30.0.tgz", + "integrity": "sha512-qFcFto9figFLz2g25DxJ1WWL9+c91fTxnGuwhToCl8BaqDsDYMl/kOnBXAyAqkkzAWimYMSWNPWEjt+ADAHuoQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.30.0.tgz", + "integrity": "sha512-vqrQdusvVl7dthqNjWCL043qelBK+gv9v3ZiqdxgaJvmZyIAAXMjeGVSqZynKq69T7062T5VrVTuikKSAAVP6A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.30.0.tgz", + "integrity": "sha512-617pd92LhdA9+wpixnzsyhVft3szYiN16aNUMzVkf2N+yAk8UXY226Bfp36LvxYTUt7MO/ycqGFjQgJ0wlMaWQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.30.0.tgz", + "integrity": "sha512-Y3b4oDoaEhCypg8ajPqigKDcpi5ZZovemQl9Edpem0uNv6UUjXv7iySBpGIUTSs2ovWOzYpfw9EbFJXF/fJHWw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.30.0.tgz", + "integrity": "sha512-3REQJ4f90sFIBfa0BUokiCdrV/E4uIjhkWe1bMgCkhFXbf4D8YN6C4zwJL881GM818qVYE9BO3dGwjKhpo2ABA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.30.0.tgz", + "integrity": "sha512-ZtY3Y8icbe3Cc+uQicsXG5L+CRGUfLZjW6j2gn5ikpltt3Whqjfo5mkyZ86UiuHF9Q3ZsaQeW7YswlHnN+lAcg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.30.0.tgz", + "integrity": "sha512-bsPGGzfiHXMhQGuFGpmo2PyTwcrh2otL6ycSZAFTESviUoBOuxF7iBbAL5IJXc/69peXl5rAtbewBFeASZ9O0g==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.30.0.tgz", + "integrity": "sha512-kvyIECEhs2DrrdfQf++maCWJIQ974EI4txlz1nNSBaCdtf7i5Xf1AQCEJWOC5rEBisdaMFFnOWNLYt7KpFqy5A==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.30.0.tgz", + "integrity": "sha512-CFE7zDNrokaotXu+shwIrmWrFxllg79vciH4E/zeK7NitVuWEaXRzS0mFfFvyhZfn8WfVOG/1E9u8/DFEgK7WQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.30.0.tgz", + "integrity": "sha512-MctNTBlvMcIBP0t8lV/NXiUwFg9oK5F79CxLU+a3xgrdJjfBLVIEHSAjQ9+ipofN2GKaMLnFFXLltg1HEEPaGQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loongarch64-gnu": { + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.30.0.tgz", + "integrity": "sha512-fBpoYwLEPivL3q368+gwn4qnYnr7GVwM6NnMo8rJ4wb0p/Y5lg88vQRRP077gf+tc25akuqd+1Sxbn9meODhwA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.30.0.tgz", + "integrity": "sha512-1hiHPV6dUaqIMXrIjN+vgJqtfkLpqHS1Xsg0oUfUVD98xGp1wX89PIXgDF2DWra1nxAd8dfE0Dk59MyeKaBVAw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.30.0.tgz", + "integrity": "sha512-U0xcC80SMpEbvvLw92emHrNjlS3OXjAM0aVzlWfar6PR0ODWCTQtKeeB+tlAPGfZQXicv1SpWwRz9Hyzq3Jx3g==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.30.0.tgz", + "integrity": "sha512-VU/P/IODrNPasgZDLIFJmMiLGez+BN11DQWfTVlViJVabyF3JaeaJkP6teI8760f18BMGCQOW9gOmuzFaI1pUw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.30.0.tgz", + "integrity": "sha512-laQVRvdbKmjXuFA3ZiZj7+U24FcmoPlXEi2OyLfbpY2MW1oxLt9Au8q9eHd0x6Pw/Kw4oe9gwVXWwIf2PVqblg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.30.0.tgz", + "integrity": "sha512-3wzKzduS7jzxqcOvy/ocU/gMR3/QrHEFLge5CD7Si9fyHuoXcidyYZ6jyx8OPYmCcGm3uKTUl+9jUSAY74Ln5A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.30.0.tgz", + "integrity": "sha512-jROwnI1+wPyuv696rAFHp5+6RFhXGGwgmgSfzE8e4xfit6oLRg7GyMArVUoM3ChS045OwWr9aTnU+2c1UdBMyw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.30.0.tgz", + "integrity": "sha512-duzweyup5WELhcXx5H1jokpr13i3BV9b48FMiikYAwk/MT1LrMYYk2TzenBd0jj4ivQIt58JWSxc19y4SvLP4g==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.30.0.tgz", + "integrity": "sha512-DYvxS0M07PvgvavMIybCOBYheyrqlui6ZQBHJs6GqduVzHSZ06TPPvlfvnYstjODHQ8UUXFwt5YE+h0jFI8kwg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@sindresorhus/is": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", @@ -707,6 +1365,13 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/node": { "version": "22.10.5", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.5.tgz", @@ -717,6 +1382,119 @@ "undici-types": "~6.20.0" } }, + "node_modules/@vitest/expect": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.8.tgz", + "integrity": "sha512-8ytZ/fFHq2g4PJVAtDX57mayemKgDR6X3Oa2Foro+EygiOJHUXhCqBAAKQYYajZpFoIfvBCF1j6R6IYRSIUFuw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.8", + "@vitest/utils": "2.1.8", + "chai": "^5.1.2", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.8.tgz", + "integrity": "sha512-7guJ/47I6uqfttp33mgo6ga5Gr1VnL58rcqYKyShoRK9ebu8T5Rs6HN3s1NABiBeVTdWNrwUMcHH54uXZBN4zA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.8", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.12" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/pretty-format": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.8.tgz", + "integrity": "sha512-9HiSZ9zpqNLKlbIDRWOnAWqgcA7xu+8YxXSekhr0Ykab7PAYFkhkwoqVArPOtJhPmYeE2YHgKZlj3CP36z2AJQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.8.tgz", + "integrity": "sha512-17ub8vQstRnRlIU5k50bG+QOMLHRhYPAna5tw8tYbj+jzjcspnwnwtPtiOlkuKC4+ixDPTuLZiqiWWQ2PSXHVg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "2.1.8", + "pathe": "^1.1.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.8.tgz", + "integrity": "sha512-20T7xRFbmnkfcmgVEz+z3AU/3b0cEzZOt/zmnvZEctg64/QZbSDJEVm9fLnnlSi74KibmRsO9/Qabi+t0vCRPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.8", + "magic-string": "^0.30.12", + "pathe": "^1.1.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.8.tgz", + "integrity": "sha512-5swjf2q95gXeYPevtW0BLk6H8+bPlMb4Vw/9Em4hFxDcaOxS+e0LOX4yqNxoHzMR2akEB2xfpnWUzkZokmgWDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^3.0.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.8.tgz", + "integrity": "sha512-dwSoui6djdwbfFmIgbIjX2ZhIoG7Ex/+xpxyiEgIGzjliY8xGkcpITKTlp6B4MgtGkF2ilvm97cPM96XZaAgcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.8", + "loupe": "^3.1.2", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, "node_modules/acorn": { "version": "8.12.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", @@ -829,6 +1607,16 @@ "node": ">=8" } }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -872,6 +1660,33 @@ "node": ">=8" } }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/chai": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.2.tgz", + "integrity": "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -906,6 +1721,16 @@ "dev": true, "license": "MIT" }, + "node_modules/check-error": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, "node_modules/ci-info": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", @@ -1043,6 +1868,34 @@ "node": ">= 8" } }, + "node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -1126,6 +1979,52 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/es-module-lexer": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.6.0.tgz", + "integrity": "sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -1150,6 +2049,26 @@ "node": ">=4" } }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/expect-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.1.0.tgz", + "integrity": "sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/extendable-error": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/extendable-error/-/extendable-error-0.1.7.tgz", @@ -1282,6 +2201,21 @@ "node": ">=6 <7 || >=8" } }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -1500,6 +2434,13 @@ "dev": true, "license": "MIT" }, + "node_modules/loupe": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz", + "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==", + "dev": true, + "license": "MIT" + }, "node_modules/lru-cache": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", @@ -1507,6 +2448,16 @@ "dev": true, "license": "ISC" }, + "node_modules/magic-string": { + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -1616,6 +2567,13 @@ "node": ">=4" } }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, "node_modules/mz": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", @@ -1628,6 +2586,25 @@ "thenify-all": "^1.0.0" } }, + "node_modules/nanoid": { + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/node-emoji": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-2.1.3.tgz", @@ -1794,6 +2771,23 @@ "node": ">=8" } }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathval": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", + "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16" + } + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -1824,6 +2818,35 @@ "node": ">=6" } }, + "node_modules/postcss": { + "version": "8.4.49", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", + "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, "node_modules/prettier": { "version": "2.8.8", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", @@ -1921,6 +2944,45 @@ "node": ">=0.10.0" } }, + "node_modules/rollup": { + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.30.0.tgz", + "integrity": "sha512-sDnr1pcjTgUT69qBksNF1N1anwfbyYG6TBQ22b03bII8EdiUQ7J0TlozVaTMjT/eEJAO49e1ndV7t+UZfL1+vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.6" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.30.0", + "@rollup/rollup-android-arm64": "4.30.0", + "@rollup/rollup-darwin-arm64": "4.30.0", + "@rollup/rollup-darwin-x64": "4.30.0", + "@rollup/rollup-freebsd-arm64": "4.30.0", + "@rollup/rollup-freebsd-x64": "4.30.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.30.0", + "@rollup/rollup-linux-arm-musleabihf": "4.30.0", + "@rollup/rollup-linux-arm64-gnu": "4.30.0", + "@rollup/rollup-linux-arm64-musl": "4.30.0", + "@rollup/rollup-linux-loongarch64-gnu": "4.30.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.30.0", + "@rollup/rollup-linux-riscv64-gnu": "4.30.0", + "@rollup/rollup-linux-s390x-gnu": "4.30.0", + "@rollup/rollup-linux-x64-gnu": "4.30.0", + "@rollup/rollup-linux-x64-musl": "4.30.0", + "@rollup/rollup-win32-arm64-msvc": "4.30.0", + "@rollup/rollup-win32-ia32-msvc": "4.30.0", + "@rollup/rollup-win32-x64-msvc": "4.30.0", + "fsevents": "~2.3.2" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -1988,6 +3050,13 @@ "node": ">=8" } }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, "node_modules/signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", @@ -2024,6 +3093,16 @@ "node": ">=8" } }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/spawndamnit": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/spawndamnit/-/spawndamnit-3.0.1.tgz", @@ -2042,6 +3121,20 @@ "dev": true, "license": "BSD-3-Clause" }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.8.0.tgz", + "integrity": "sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==", + "dev": true, + "license": "MIT" + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -2146,6 +3239,50 @@ "node": ">=0.8" } }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinypool": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.2.tgz", + "integrity": "sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz", + "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz", + "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -2274,6 +3411,155 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/vite": { + "version": "5.4.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", + "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.8.tgz", + "integrity": "sha512-uPAwSr57kYjAUux+8E2j0q0Fxpn8M9VoyfGiRI8Kfktz9NcYMCenwY5RnZxnF1WTu3TGiYipirIzacLL3VVGFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.7", + "es-module-lexer": "^1.5.4", + "pathe": "^1.1.2", + "vite": "^5.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.8.tgz", + "integrity": "sha512-1vBKTZskHw/aosXqQUlVWWlGUxSJR8YtiyZDJAFeW2kPAeX6S3Sool0mjspO+kXLuxVWlEDDowBAeqeAQefqLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "2.1.8", + "@vitest/mocker": "2.1.8", + "@vitest/pretty-format": "^2.1.8", + "@vitest/runner": "2.1.8", + "@vitest/snapshot": "2.1.8", + "@vitest/spy": "2.1.8", + "@vitest/utils": "2.1.8", + "chai": "^5.1.2", + "debug": "^4.3.7", + "expect-type": "^1.1.0", + "magic-string": "^0.30.12", + "pathe": "^1.1.2", + "std-env": "^3.8.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.1", + "tinypool": "^1.0.1", + "tinyrainbow": "^1.2.0", + "vite": "^5.0.0", + "vite-node": "2.1.8", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "2.1.8", + "@vitest/ui": "2.1.8", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -2290,6 +3576,23 @@ "node": ">= 8" } }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", diff --git a/package.json b/package.json index 2ab2dcf..43c26b9 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,18 @@ { "name": "simpay-typescript-api", "author": "Rafał Więcek (https://github.com/DarkGL)", - "version": "3.0.3", + "version": "3.1.0", "description": "SimPay.pl API wrapper", "main": "dist/index.js", "types": "dist/index.d.ts", "type": "module", "scripts": { - "ci": "npm run build && npm run check && npm run check-exports", + "ci": "npm run build && npm run check && npm run check-exports && npm run test", "lint": "npx @biomejs/biome lint --write ./src", "format": "npx @biomejs/biome format --write ./src", "check": "npx @biomejs/biome check --write ./src", "build": "tsc --build", - "test": "npm run build && node --loader ts-node/esm ./tests/index.ts", + "test": "npm run build && vitest run", "check-exports": "attw --pack . --ignore-rules=cjs-resolves-to-esm", "local-release": "changeset version && changeset publish", "prepublishOnly": "npm run ci" @@ -50,7 +50,8 @@ "@changesets/cli": "^2.27.11", "@types/node": "^22.10.5", "ts-node": "^10.9.2", - "typescript": "^5.7.2" + "typescript": "^5.7.2", + "vitest": "^2.1.8" }, "repository": { "type": "git", diff --git a/src/index.ts b/src/index.ts index 0d4be3c..ec9b115 100644 --- a/src/index.ts +++ b/src/index.ts @@ -22,7 +22,14 @@ export type { SmsTransaction } from './models/sms/transaction/sms.transaction.js export type { VerificationResponse } from './models/sms/verification.response.js'; export { SMSServiceStatus } from './models/sms/service/sms.service.status.js'; +// Online Payments - Models +export type { TransactionRequest } from './models/payment/transaction/transaction-request.js'; +export type { TransactionNotification } from './models/payment/transaction/transaction-notification.js'; +export type { TransactionDetailsResponse } from './models/payment/transaction/transaction-details-response.js'; +export type { TransactionStatus } from './models/payment/payment.provider.js'; + // Payments export { DirectBilling } from './payments/directbilling.js'; export { Sms } from './payments/sms.js'; export { SmsXml } from './payments/sms.xml.js'; +export { Payment } from './payments/payment.js'; diff --git a/src/lib/hashing.ts b/src/lib/hashing.ts index 081d019..b5f1d56 100644 --- a/src/lib/hashing.ts +++ b/src/lib/hashing.ts @@ -4,14 +4,6 @@ function sha256(text: string) { return hash('sha256', text); } -function sha1(text: string) { - return hash('sha1', text); -} - -function md5(text: string) { - return hash('md5', text); -} - function hash(algorithm: string, text: string) { const hash = createHash(algorithm); @@ -20,4 +12,4 @@ function hash(algorithm: string, text: string) { return hash.digest('hex'); } -export { sha256, sha1, md5 }; +export { sha256 }; diff --git a/src/models/directbilling/service/service-paginated.response.ts b/src/models/directbilling/service/service-paginated.response.ts new file mode 100644 index 0000000..faaf414 --- /dev/null +++ b/src/models/directbilling/service/service-paginated.response.ts @@ -0,0 +1,31 @@ +import type { DBServiceStatus } from './db.service.status.js'; + +interface DirectBillingServicePaginatedResponse { + success: boolean; + data: Datum[]; + pagination: Pagination; +} + +interface Datum { + id: string; + name: string; + suffix: string; + status: DBServiceStatus; + created_at: Date; +} + +interface Pagination { + total: number; + count: number; + per_page: number; + current_page: number; + total_pages: number; + links: Links; +} + +interface Links { + next_page: null; + prev_page: null; +} + +export type { DirectBillingServicePaginatedResponse }; diff --git a/src/models/payment/payment.provider.ts b/src/models/payment/payment.provider.ts new file mode 100644 index 0000000..eaab278 --- /dev/null +++ b/src/models/payment/payment.provider.ts @@ -0,0 +1,12 @@ +enum TransactionStatus { + NEW = 'transaction_new', + CONFIRMED = 'transaction_confirmed', + GENERATED = 'transaction_generated', + PAID = 'transaction_paid', + FAILED = 'transaction_failed', + EXPIRED = 'transaction_expired', + CANCELED = 'transaction_canceled', + REFUNDED = 'transaction_refunded', +} + +export type { TransactionStatus }; diff --git a/src/models/payment/transaction/transaction-details-response.ts b/src/models/payment/transaction/transaction-details-response.ts new file mode 100644 index 0000000..ee44f2c --- /dev/null +++ b/src/models/payment/transaction/transaction-details-response.ts @@ -0,0 +1,51 @@ +export interface TransactionDetailsResponse { + success: boolean; + data: Data; +} + +export interface Data { + id: string; + status: string; + amount: Amount; + channel: string; + control: string; + description: string; + redirects: Redirects; + customer: Customer; + billing: Ing; + shipping: Ing; + cart: null; + paid_at: Date; + expires_at: string; + created_at: string; + updated_at: Date; +} + +export interface Amount { + value: number; + currency: string; + commission: number; +} + +export interface Ing { + name: string; + surname: string; + street: string; + building: string; + flat: string; + city: string; + region: string; + postalCode: string; + country: string; + company: string; +} + +export interface Customer { + name: string; + email: string; +} + +export interface Redirects { + success: string; + failure: string; +} diff --git a/src/models/payment/transaction/transaction-notification.ts b/src/models/payment/transaction/transaction-notification.ts new file mode 100644 index 0000000..30f4ec9 --- /dev/null +++ b/src/models/payment/transaction/transaction-notification.ts @@ -0,0 +1,21 @@ +interface TransactionNotification { + id: string; + service_id: string; + status: string; + amount: { + value: number; + currency: string; + commission: number; + }; + control: string; + channel: string; + environment: string; + originalAmount: { + value: number; + currency: string; + rate: number; + }; + signature: string; +} + +export type { TransactionNotification }; diff --git a/src/models/payment/transaction/transaction-request.ts b/src/models/payment/transaction/transaction-request.ts new file mode 100644 index 0000000..4ccc568 --- /dev/null +++ b/src/models/payment/transaction/transaction-request.ts @@ -0,0 +1,22 @@ +interface TransactionRequest { + amount: number; + currency?: string; + description?: string; + control?: string; + customer?: object; + antifraud?: object; + billing?: object; + shipping?: object; + cart?: object[]; + returns?: { + success: string; + failure: string; + }; + directChannel?: string; + channels?: string[]; + channelTypes?: object; + referer?: string; + signature?: string; +} + +export type { TransactionRequest }; diff --git a/src/payments/directbilling.ts b/src/payments/directbilling.ts index 3744fc9..ed961d4 100644 --- a/src/payments/directbilling.ts +++ b/src/payments/directbilling.ts @@ -3,6 +3,7 @@ import { sha256 } from '../lib/hashing.js'; import type { DbCalculation } from '../models/directbilling/service/db.calculation.js'; import type { DbService } from '../models/directbilling/service/db.service.js'; import type { PartialDbService } from '../models/directbilling/service/partial.db.service.js'; +import type { DirectBillingServicePaginatedResponse } from '../models/directbilling/service/service-paginated.response.js'; import type { DbGenerationResponse } from '../models/directbilling/transaction/db.generation.response.js'; import type { DbNotificationRequest } from '../models/directbilling/transaction/db.notifications.request.js'; import type { DbTransaction } from '../models/directbilling/transaction/db.transaction.js'; @@ -25,7 +26,7 @@ export class DirectBilling { headers: { 'X-SIM-KEY': this.key, 'X-SIM-PASSWORD': this.password, - 'X-SIM-VERSION': '3.0.3', + 'X-SIM-VERSION': '3.1.0', 'X-SIM-PLATFORM': 'TYPESCRIPT', }, }); @@ -60,17 +61,17 @@ export class DirectBilling { page?: number, pageSize?: number, ): Promise> { - const query: any = {}; + const query: Record = {}; if (page) query.page = `${page}`; if (pageSize) query.limit = `${pageSize}`; const url = `/?${new URLSearchParams(query).toString()}`; - const response = (await this.client.get(url)).data; + const response = (await this.client.get(url)).data; - response.data = response.data.map((e: any) => { - e.created_at = new Date(e.created_at.replace(' ', 'T')); + response.data = response.data.map((e) => { + e.created_at = new Date(e.created_at.toString().replace(' ', 'T')); return e; }); @@ -134,7 +135,7 @@ export class DirectBilling { page?: number, pageSize?: number, ): Promise> { - const query: any = {}; + const query: Record = {}; if (page) query.page = `${page}`; if (pageSize) query.limit = `${pageSize}`; @@ -185,12 +186,12 @@ export class DirectBilling { /* https://docs.simpay.pl/shell/?shell#directbilling-generowanie-transakcji */ - checkNotification(key: string, body: any) { + checkNotification(key: string, body: DbNotificationRequest) { const signature = this.generateSignatureNotification(key, body); if (body.signature !== signature) return undefined; - return body; + return body as DbNotificationRequest; } /* diff --git a/src/payments/payment.ts b/src/payments/payment.ts new file mode 100644 index 0000000..ed61193 --- /dev/null +++ b/src/payments/payment.ts @@ -0,0 +1,70 @@ +import axios, { type AxiosInstance } from 'axios'; +import { sha256 } from '../lib/hashing.js'; +import type { TransactionNotification } from '../models/payment/transaction/transaction-notification.js'; +import type { TransactionRequest } from '../models/payment/transaction/transaction-request.js'; + +export { Payment }; + +class Payment { + private readonly client: AxiosInstance; + + constructor( + private readonly key: string, + private readonly password: string, + ) { + this.client = axios.create({ + baseURL: 'https://api.simpay.pl/payment', + headers: { + Authorization: `Bearer ${this.key}`, + }, + }); + } + + // Generating transaction + // https://docs.simpay.pl/#tag/Payment/operation/paymentTransactionCreate + public async createTransaction(serviceId: string, request: TransactionRequest): Promise { + try { + const response = await this.client.post(`/${serviceId}/transactions`, request); + return response.data; + } catch (error) { + console.error('Error creating transaction:', error); + throw error; + } + } + + // Receive transaction details (Webhook) + // https://docs.simpay.pl/#tag/Payment/operation/paymentTransactionNotification + public verifyNotification(key: string, body: TransactionNotification): boolean { + const generatedSignature = this.generateSignatureNotification(key, body); + return body.signature === generatedSignature; + } + + // Generate signature for webhook + private generateSignatureNotification(key: string, request: TransactionNotification): string { + const joinedElements = [ + request.id, + request.service_id, + request.status, + request.amount.value, + request.amount.currency, + request.amount.commission, + request.control, + request.channel, + request.environment, + request.originalAmount.value, + request.originalAmount.currency, + request.originalAmount.rate, + key, + ] + .filter((e) => e !== undefined && e !== null) + .join('|'); + + return sha256(joinedElements); + } + + // Get transaction details + // https://docs.simpay.pl/#tag/Payment/operation/paymentGetTransaction + public getTransactionDetails(serviceId: string, transactionId: string): Promise { + return this.client.get(`/${serviceId}/transactions/${transactionId}`); + } +} diff --git a/src/payments/sms.ts b/src/payments/sms.ts index cdced54..7314e42 100644 --- a/src/payments/sms.ts +++ b/src/payments/sms.ts @@ -17,7 +17,7 @@ export class Sms { headers: { 'X-SIM-KEY': this.key, 'X-SIM-PASSWORD': this.password, - 'X-SIM-VERSION': '3.0.3', + 'X-SIM-VERSION': '3.1.0', 'X-SIM-PLATFORM': 'TYPESCRIPT', }, }); @@ -52,7 +52,7 @@ export class Sms { page?: number, pageSize?: number, ): Promise> { - const query: any = {}; + const query: Record = {}; if (page) query.page = `${page}`; if (pageSize) query.limit = `${pageSize}`; @@ -111,7 +111,7 @@ export class Sms { page?: number, pageSize?: number, ): Promise> { - const query: any = {}; + const query: Record = {}; if (page) query.page = `${page}`; if (pageSize) query.limit = `${pageSize}`; @@ -170,7 +170,7 @@ export class Sms { page?: number, pageSize?: number, ): Promise> { - const query: any = {}; + const query: Record = {}; if (page) query.page = `${page}`; if (pageSize) query.limit = `${pageSize}`; @@ -212,7 +212,7 @@ export class Sms { page?: number, pageSize?: number, ): Promise> { - const query: any = {}; + const query: Record = {}; if (page) query.page = `${page}`; if (pageSize) query.limit = `${pageSize}`; diff --git a/src/payments/sms.xml.ts b/src/payments/sms.xml.ts index 2372b4d..86a7eda 100644 --- a/src/payments/sms.xml.ts +++ b/src/payments/sms.xml.ts @@ -1,7 +1,14 @@ import { sha256 } from '../lib/hashing.js'; const charset = 'ABCDEFGHIJKLMNPQRSTUVWXYZ123456789'; -const params = ['send_number', 'sms_text', 'sms_from', 'sms_id', 'sign']; +const params = ['send_number', 'sms_text', 'sms_from', 'sms_id', 'sign'] as const; + +type ParamsSMS = { + [T in (typeof params)[number]]: string | number; +} & { + send_time?: string; +}; + const codes = { '7055': 0.25, '7136': 0.5, @@ -29,7 +36,7 @@ const codes = { '79908': 4.5, '91998': 9.5, '92598': 12.5, -}; +} as const; type Codes = keyof typeof codes; @@ -39,7 +46,7 @@ export class SmsXml { /* https://docs.simpay.pl/pl/typescript/?typescript#smsxml-odbieranie-informacji-o-sms */ - checkParameters(map: any): boolean { + checkParameters(map: ParamsSMS): boolean { for (const param of params) { if (!map[param]) return false; } @@ -74,7 +81,7 @@ export class SmsXml { return `${text.normalize('NFKD')}`; } - private sign(map: any) { + private sign(map: ParamsSMS) { return sha256( `${map.sms_id}${map.sms_text}${map.sms_from}${map.send_number}${map.send_time}${this.apiKey}`, ); diff --git a/tests/directbilling.test.ts b/tests/directbilling.test.ts new file mode 100644 index 0000000..1363985 --- /dev/null +++ b/tests/directbilling.test.ts @@ -0,0 +1,94 @@ +import { describe, test, expect } from 'vitest'; +import { DirectBilling } from '../src/payments/directbilling.js'; +import { AmountType } from '../src/models/amount.type.js'; +import { DbTransactionStatus } from '../src/models/directbilling/transaction/db.transaction.status.js'; + +describe('DirectBilling Tests', () => { + const db = new DirectBilling('0b4dca15', '3eea38f407073ff0abff956b57d71783'); + + test('Get services', async () => { + const services = await db.getServices(); + expect(services).toBeDefined(); + expect(Array.isArray(services)).toBe(true); + console.log('Services:', services); + }); + + test('Get services paginated', async () => { + const servicesPaginated = await db.getServicesPaginated(1, 100); + expect(servicesPaginated).toBeDefined(); + expect(servicesPaginated.data).toBeDefined(); + console.log('Paginated Services:', servicesPaginated); + }); + + test('Get service information', async () => { + const service = await db.getService('19f3b33c'); + expect(service).toBeDefined(); + console.log('Service Information:', service); + }); + + test('Calculate commission', async () => { + const commission = await db.calculateCommission('19f3b33c', 10.0); + expect(commission).toBeDefined(); + console.log('Commission:', commission); + }); + + test('Get transactions list', async () => { + const transactions = await db.getTransactions('19f3b33c'); + expect(transactions).toBeDefined(); + expect(Array.isArray(transactions)).toBe(true); + console.log('Transactions:', transactions); + }); + + test('Get transactions paginated', async () => { + const transactionsPaginated = await db.getTransactionsPaginated('19f3b33c', 1, 100); + expect(transactionsPaginated).toBeDefined(); + expect(transactionsPaginated.data).toBeDefined(); + console.log('Paginated Transactions:', transactionsPaginated); + }); + + test('Get transaction information', async () => { + const transactions = await db.getTransactions('19f3b33c'); + const transactionId = transactions?.[0]?.id; + + if (!transactionId) { + throw new Error('No transactions found'); + } + + const transaction = await db.getTransaction('19f3b33c', transactionId); + expect(transaction).toBeDefined(); + console.log('Transaction Information:', transaction); + }); + + test('Create transaction', async () => { + const transaction = await db.createTransaction('19f3b33c', 'key', { + amount: 10.0, + amountType: AmountType.GROSS, + control: 'test', + }); + expect(transaction).toBeDefined(); + console.log('Created Transaction:', transaction); + }); + + test('Check notification', () => { + const notification = db.checkNotification('key', { + id: '1', + service_id: '1', + status: DbTransactionStatus.TRANSACTION_DB_CONFIRMED, + values: { + net: 10.0, + gross: 10.0, + partner: 10.0, + }, + returns: { + success: 'success', + complete: 'complete', + failure: 'failure', + }, + control: 'test', + number_from: '1', + provider: 1, + }); + expect(notification).toBeUndefined(); // Assuming no notification is valid with empty input + console.log('Notification Check:', notification); + }); +}); diff --git a/tests/directbilling.ts b/tests/directbilling.ts deleted file mode 100644 index 90481fa..0000000 --- a/tests/directbilling.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { DirectBilling } from '../src/payments/directbilling.js'; -import { AmountType } from '../src/models/amount.type.js'; - -async function directBillingTests() { - const db = new DirectBilling('0b4dca15', '3eea38f407073ff0abff956b57d71783'); - - // https://docs.simpay.pl/pl/typescript/?typescript#directbilling-pobieranie-listy-uslug - console.log(await db.getServices()); - console.log(await db.getServicesPaginated(1, 100)); - - // https://docs.simpay.pl/pl/typescript/?typescript#directbilling-pobieranie-informacji-o-usludze - console.log(await db.getService('19f3b33c')); - - // https://docs.simpay.pl/pl/typescript/?typescript#directbilling-kalkulacja-prowizji - console.log(await db.calculateCommission('19f3b33c', 10.0)); - - // https://docs.simpay.pl/pl/typescript/?typescript#directbilling-pobieranie-listy-transakcji - const transactionsList = await db.getTransactions('19f3b33c'); - - console.log(transactionsList); - - console.log(await db.getTransactionsPaginated('19f3b33c', 1, 100)); - - const transactionId = transactionsList?.[0]?.id; - - if(!transactionId) { - throw new Error('No transactions found'); - } - else { - - // https://docs.simpay.pl/pl/typescript/?typescript#directbilling-pobieranie-informacji-o-transakcji - console.log(await db.getTransaction('19f3b33c', transactionId)); - } - - // https://docs.simpay.pl/pl/typescript/?typescript#directbilling-generowanie-transakcji - console.log( - await db.createTransaction('19f3b33c', 'key', { - amount: 10.0, - amountType: AmountType.GROSS, - control: 'test', - }), - ); - - console.log(db.checkNotification('key', {})); -}; - -export { directBillingTests }; diff --git a/tests/index.ts b/tests/index.ts deleted file mode 100644 index 52a1cf9..0000000 --- a/tests/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { directBillingTests } from './directbilling.js'; -import { smsTests } from './sms.js'; - -async function run() { - await directBillingTests(); - await smsTests(); -} - -run(); \ No newline at end of file diff --git a/tests/sms.test.ts b/tests/sms.test.ts new file mode 100644 index 0000000..f65fd3c --- /dev/null +++ b/tests/sms.test.ts @@ -0,0 +1,98 @@ +import { describe, test, expect } from 'vitest'; +import { Sms } from '../src/payments/sms.js'; + +describe('SMS Tests', () => { + const sms = new Sms('0b4dca15', '3eea38f407073ff0abff956b57d71783'); + + test('Get services', async () => { + const services = await sms.getServices(); + expect(services).toBeDefined(); + expect(Array.isArray(services)).toBe(true); + console.log('Services:', services); + }); + + test('Get services paginated', async () => { + const paginatedServices = await sms.getServicesPaginated(1, 100); + expect(paginatedServices).toBeDefined(); + expect(paginatedServices.data).toBeDefined(); + console.log('Paginated Services:', paginatedServices); + }); + + test('Get service information', async () => { + const service = await sms.getService('d151e4f9'); + expect(service).toBeDefined(); + console.log('Service Information:', service); + }); + + test('Get transactions list', async () => { + const transactions = await sms.getTransactions('d151e4f9'); + expect(transactions).toBeDefined(); + expect(Array.isArray(transactions)).toBe(true); + console.log('Transactions:', transactions); + }); + + test('Get transactions paginated', async () => { + const paginatedTransactions = await sms.getTransactionsPaginated('d151e4f9', 1, 100); + expect(paginatedTransactions).toBeDefined(); + expect(paginatedTransactions.data).toBeDefined(); + console.log('Paginated Transactions:', paginatedTransactions); + }); + + test('Get transaction information', async () => { + const transaction = await sms.getTransaction('d151e4f9', 2216609); + expect(transaction).toBeDefined(); + console.log('Transaction Information:', transaction); + }); + + test('Get service numbers', async () => { + const serviceNumbers = await sms.getServiceNumbers('d151e4f9'); + expect(serviceNumbers).toBeDefined(); + expect(Array.isArray(serviceNumbers)).toBe(true); + console.log('Service Numbers:', serviceNumbers); + }); + + test('Get service numbers paginated', async () => { + const paginatedServiceNumbers = await sms.getServiceNumbersPaginated('d151e4f9', 1, 100); + expect(paginatedServiceNumbers).toBeDefined(); + expect(paginatedServiceNumbers.data).toBeDefined(); + console.log('Paginated Service Numbers:', paginatedServiceNumbers); + }); + + test('Get single service number', async () => { + const serviceNumber = await sms.getServiceNumber('d151e4f9', 7055); + expect(serviceNumber).toBeDefined(); + console.log('Single Service Number:', serviceNumber); + }); + + test('Get all available numbers', async () => { + const numbers = await sms.getNumbers(); + expect(numbers).toBeDefined(); + expect(Array.isArray(numbers)).toBe(true); + console.log('All Available Numbers:', numbers); + }); + + test('Get all available numbers paginated', async () => { + const paginatedNumbers = await sms.getNumbersPaginated(1, 100); + expect(paginatedNumbers).toBeDefined(); + expect(paginatedNumbers.data).toBeDefined(); + console.log('Paginated Numbers:', paginatedNumbers); + }); + + test('Get single number details', async () => { + const number = await sms.getNumber(7055); + expect(number).toBeDefined(); + console.log('Single Number Details:', number); + }); + + test('Verify SMS code with service number', async () => { + const verification = await sms.verifySmsCode('d151e4f9', '81FFC5', 7055); + expect(verification).toBeDefined(); + console.log('SMS Code Verification with Number:', verification); + }); + + test('Verify SMS code without service number', async () => { + const verification = await sms.verifySmsCode('d151e4f9', '81FFC5'); + expect(verification).toBeDefined(); + console.log('SMS Code Verification without Number:', verification); + }); +}); diff --git a/tests/sms.ts b/tests/sms.ts deleted file mode 100644 index f7d7c99..0000000 --- a/tests/sms.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { Sms } from '../src/payments/sms.js'; - -async function smsTests() { - const sms = new Sms('0b4dca15', '3eea38f407073ff0abff956b57d71783'); - - // https://docs.simpay.pl/pl/typescript/?typescript#sms-pobieranie-listy-uslug - console.log(await sms.getServices()); - console.log(await sms.getServicesPaginated(1, 100)); - - // https://docs.simpay.pl/pl/typescript/?typescript#sms-pobieranie-informacji-o-usludze - console.log(await sms.getService('d151e4f9')); - - // https://docs.simpay.pl/pl/typescript/?typescript#sms-pobieranie-listy-transakcji - console.log(await sms.getTransactions('d151e4f9')); - console.log(await sms.getTransactionsPaginated('d151e4f9', 1, 100)); - - // https://docs.simpay.pl/pl/typescript/?typescript#sms-pobieranie-informacji-o-transakcji - console.log(await sms.getTransaction('d151e4f9', 2216609)); - - // https://docs.simpay.pl/pl/typescript/?typescript#sms-pobieranie-dostepnych-numerow-dla-uslugi - console.log(await sms.getServiceNumbers('d151e4f9')); - console.log(await sms.getServiceNumbersPaginated('d151e4f9', 1, 100)); - - // https://docs.simpay.pl/pl/typescript/?typescript#sms-informacji-o-pojedynczym-numerze-uslugi - console.log(await sms.getServiceNumber('d151e4f9', 7055)); - - // https://docs.simpay.pl/pl/typescript/?typescript#sms-pobieranie-wszystkich-dostepnych-numerow - console.log(await sms.getNumbers()); - console.log(await sms.getNumbersPaginated(1, 100)); - - // https://docs.simpay.pl/pl/typescript/?typescript#sms-pobieranie-pojedynczego-numeru-sms - console.log(await sms.getNumber(7055)); - - // https://docs.simpay.pl/pl/typescript/?typescript#sms-weryfikacja-poprawnosci-kodu - console.log(await sms.verifySmsCode('d151e4f9', '81FFC5', 7055)); - console.log(await sms.verifySmsCode('d151e4f9', '81FFC5')); -}; - -export { smsTests }; \ No newline at end of file