Merged in feature/IO-2885-IntelliPay-App-Postback-Support (pull request #2236)

Feature/IO-2885 IntelliPay App Postback Support
This commit is contained in:
Dave Richer
2025-04-02 18:15:07 +00:00
23 changed files with 2333 additions and 1271 deletions

553
client/package-lock.json generated
View File

@@ -9,23 +9,23 @@
"version": "0.2.1",
"hasInstallScript": true,
"dependencies": {
"@ant-design/pro-layout": "^7.22.3",
"@ant-design/pro-layout": "^7.22.4",
"@apollo/client": "^3.13.5",
"@emotion/is-prop-valid": "^1.3.1",
"@fingerprintjs/fingerprintjs": "^4.6.1",
"@firebase/analytics": "^0.10.12",
"@firebase/app": "^0.11.3",
"@firebase/auth": "^1.9.1",
"@firebase/app": "^0.11.4",
"@firebase/auth": "^1.10.0",
"@firebase/firestore": "^4.7.10",
"@firebase/messaging": "^0.12.17",
"@jsreport/browser-client": "^3.1.0",
"@reduxjs/toolkit": "^2.6.1",
"@sentry/cli": "^2.42.4",
"@sentry/react": "^9.9.0",
"@sentry/vite-plugin": "^3.2.2",
"@splitsoftware/splitio-react": "^2.0.1",
"@sentry/cli": "^2.43.0",
"@sentry/react": "^9.10.1",
"@sentry/vite-plugin": "^3.2.4",
"@splitsoftware/splitio-react": "^2.1.0",
"@tanem/react-nprogress": "^5.0.53",
"antd": "^5.24.5",
"antd": "^5.24.6",
"apollo-link-logger": "^2.0.1",
"apollo-link-sentry": "^4.2.0",
"autosize": "^6.0.1",
@@ -70,7 +70,7 @@
"react-resizable": "^3.0.5",
"react-router-dom": "^6.30.0",
"react-sticky": "^6.0.3",
"react-virtuoso": "^4.12.5",
"react-virtuoso": "^4.12.6",
"recharts": "^2.15.0",
"redux": "^5.0.1",
"redux-actions": "^3.0.3",
@@ -78,7 +78,7 @@
"redux-saga": "^1.3.0",
"redux-state-sync": "^3.1.4",
"reselect": "^5.1.1",
"sass": "^1.86.0",
"sass": "^1.86.1",
"socket.io-client": "^4.8.1",
"styled-components": "^6.1.16",
"subscriptions-transport-ws": "^0.11.0",
@@ -95,7 +95,7 @@
"@emotion/react": "^11.14.0",
"@eslint/js": "^9.23.0",
"@playwright/test": "^1.51.1",
"@sentry/webpack-plugin": "^3.2.2",
"@sentry/webpack-plugin": "^3.2.4",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.2.0",
@@ -114,13 +114,13 @@
"react-error-overlay": "^6.1.0",
"redux-logger": "^3.0.6",
"source-map-explorer": "^2.5.3",
"vite": "^6.2.3",
"vite": "^6.2.4",
"vite-plugin-babel": "^1.3.0",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-node-polyfills": "^0.23.0",
"vite-plugin-pwa": "^0.21.2",
"vite-plugin-pwa": "^1.0.0",
"vite-plugin-style-import": "^2.0.0",
"vitest": "^3.0.9",
"vitest": "^3.1.1",
"workbox-window": "^7.3.0"
},
"engines": {
@@ -252,15 +252,15 @@
}
},
"node_modules/@ant-design/pro-layout": {
"version": "7.22.3",
"resolved": "https://registry.npmjs.org/@ant-design/pro-layout/-/pro-layout-7.22.3.tgz",
"integrity": "sha512-di/EOMDuoMDRjBweqesYyCxEYr2LCmO82y6A4bSwmmJ6ehxN7HGC73Wx4RuBkzDR7kHLTOXt7WxI6875ENT8mg==",
"version": "7.22.4",
"resolved": "https://registry.npmjs.org/@ant-design/pro-layout/-/pro-layout-7.22.4.tgz",
"integrity": "sha512-X2WO4L2itXemX4zhS+0NG+8kXQD5SX9sG+zjx/15BmIO3FvsUGqOHgoCg0vhd424EiyPj7WtdMZJ39G1xdgDwA==",
"license": "MIT",
"dependencies": {
"@ant-design/cssinjs": "^1.21.1",
"@ant-design/icons": "^5.0.0",
"@ant-design/pro-provider": "2.15.3",
"@ant-design/pro-utils": "2.16.4",
"@ant-design/pro-provider": "2.15.4",
"@ant-design/pro-utils": "2.17.0",
"@babel/runtime": "^7.18.0",
"@umijs/route-utils": "^4.0.0",
"@umijs/use-params": "^1.0.9",
@@ -300,9 +300,9 @@
}
},
"node_modules/@ant-design/pro-provider": {
"version": "2.15.3",
"resolved": "https://registry.npmjs.org/@ant-design/pro-provider/-/pro-provider-2.15.3.tgz",
"integrity": "sha512-jUBCuRrhAXNMumSZ++704/zEg/7U1k2N3jMVBgtirvVaCAk5O9iZQKK4W3O3LRFc+D8yO16sXjsxhawvdGL4cA==",
"version": "2.15.4",
"resolved": "https://registry.npmjs.org/@ant-design/pro-provider/-/pro-provider-2.15.4.tgz",
"integrity": "sha512-DBX0JNUNOYXAucVqd/zTdqtXckCDqr2Lo85KIku2YzWdhptDPDZRTNqL04JShjGejDl8fzwQ8yREHgVUfzn6Gg==",
"license": "MIT",
"dependencies": {
"@ant-design/cssinjs": "^1.21.1",
@@ -319,13 +319,13 @@
}
},
"node_modules/@ant-design/pro-utils": {
"version": "2.16.4",
"resolved": "https://registry.npmjs.org/@ant-design/pro-utils/-/pro-utils-2.16.4.tgz",
"integrity": "sha512-PFxqF0fsUsLj8ORvJSuMgVv9NDHwAxZaglzPN/u3jZX7rWYcrHD04EMJEXooZaSyT6Q4+j7SqXDx6oBsdb9zNw==",
"version": "2.17.0",
"resolved": "https://registry.npmjs.org/@ant-design/pro-utils/-/pro-utils-2.17.0.tgz",
"integrity": "sha512-hHKUISjMEoS+E5ltJWyvNTrlEA3IimZNxtDrEhorRIbgVYAlmEN5Mj/ESSofzDM3+UlxiI5+A/Y6IHkByTfDEA==",
"license": "MIT",
"dependencies": {
"@ant-design/icons": "^5.0.0",
"@ant-design/pro-provider": "2.15.3",
"@ant-design/pro-provider": "2.15.4",
"@babel/runtime": "^7.18.0",
"classnames": "^2.3.2",
"dayjs": "^1.11.10",
@@ -2926,9 +2926,9 @@
}
},
"node_modules/@firebase/app": {
"version": "0.11.3",
"resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.11.3.tgz",
"integrity": "sha512-QlTZl/RcqPSonYxB87n8KgAUW2L6ZZz0W4D91PVmQ1tJPsKsKPrWAFHL0ii2cQW6FxTxfNjbZ7kucuIcKXk3tw==",
"version": "0.11.4",
"resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.11.4.tgz",
"integrity": "sha512-GPREsZjfSaHzwyC6cI/Cqvzf6zxqMzya+25tSpUstdqC2w0IdfxEfOMjfdW7bDfVEf4Rb4Nb6gfoOAgVSp4c4g==",
"license": "Apache-2.0",
"dependencies": {
"@firebase/component": "0.6.13",
@@ -2942,9 +2942,9 @@
}
},
"node_modules/@firebase/auth": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-1.9.1.tgz",
"integrity": "sha512-9KKo5SNVkyJzftsW+daS+PGDbeJ+MFJWXQFHDqqPPH3acWHtiNnGHH5HGpIJErEELrsm9xMPie5zfZ0XpGU8+w==",
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-1.10.0.tgz",
"integrity": "sha512-S7SqBsN7sIQsftNE3bitLlK+4bWrTHY+Rx2JFlNitgVYu2nK8W8ZQrkG8GCEwiFPq0B2vZ9pO5kVTFfq2sP96A==",
"license": "Apache-2.0",
"dependencies": {
"@firebase/component": "0.6.13",
@@ -4178,88 +4178,88 @@
"license": "MIT"
},
"node_modules/@sentry-internal/browser-utils": {
"version": "9.9.0",
"resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-9.9.0.tgz",
"integrity": "sha512-V/YhKLis98JFkqBGZaEBlDNFpJHJjoCvNb05raAYXdITfDIl37Kxqj0zX+IzyRhqnswkQ+DBTyoEoci09IR2bQ==",
"version": "9.10.1",
"resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-9.10.1.tgz",
"integrity": "sha512-O/ibpHbKfpG+xtZuEzbLNtLcbanRcDYGxT+QbslVItmcS9GjMSwvMpp1jnD9Y7/LIFtv7O1gJZ9Hrz///lLprw==",
"license": "MIT",
"dependencies": {
"@sentry/core": "9.9.0"
"@sentry/core": "9.10.1"
},
"engines": {
"node": ">=18"
}
},
"node_modules/@sentry-internal/feedback": {
"version": "9.9.0",
"resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-9.9.0.tgz",
"integrity": "sha512-hrxuOLm0Xsnx75hTNt3eLgNNjER3egrHZShdRzlMiakfKpA9f2X10z75vlZmT5ZUygDQnp9UVUnu28cDuVb9Zw==",
"version": "9.10.1",
"resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-9.10.1.tgz",
"integrity": "sha512-DM32eAzRvXk36iGBWtlLZA88QzOFBODd+kbz55X4Py+1bDNdRc3Vl6214uuAr7iweHcOQy1rIvmAeO8Xusp7tQ==",
"license": "MIT",
"dependencies": {
"@sentry/core": "9.9.0"
"@sentry/core": "9.10.1"
},
"engines": {
"node": ">=18"
}
},
"node_modules/@sentry-internal/replay": {
"version": "9.9.0",
"resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-9.9.0.tgz",
"integrity": "sha512-EWczKMu3qiZ0SUUWU3zkGod+AWD/VQCLiQw+tw+PEpdHbRZIdYKsEptengZCFKthrwe2QmYpVCTSRxGvujJ/6g==",
"version": "9.10.1",
"resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-9.10.1.tgz",
"integrity": "sha512-nqG33NwojtteL8e3Qg/SOu0BsTJ9R7AjpmQIlOpFGL007nzKgcJHOngewd7FEHyB+F3iOI0MoI9iEWhRFEGRLw==",
"license": "MIT",
"dependencies": {
"@sentry-internal/browser-utils": "9.9.0",
"@sentry/core": "9.9.0"
"@sentry-internal/browser-utils": "9.10.1",
"@sentry/core": "9.10.1"
},
"engines": {
"node": ">=18"
}
},
"node_modules/@sentry-internal/replay-canvas": {
"version": "9.9.0",
"resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-9.9.0.tgz",
"integrity": "sha512-YK0ixGjquahGpNsQskCEVwycdHlwNBLCx9XJr1BmGnlOw6fUCmpyVetaGg/ZyhkzKGNXAGoTa4s7FUFnAG4bKg==",
"version": "9.10.1",
"resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-9.10.1.tgz",
"integrity": "sha512-fxrpqElqdsAQrzVly0V/XaljhAlwwMk+iGyf+wZeK6RwEPVxtoxXVfx7fEEtPn+gortqQR09N/zH179hefjuaw==",
"license": "MIT",
"dependencies": {
"@sentry-internal/replay": "9.9.0",
"@sentry/core": "9.9.0"
"@sentry-internal/replay": "9.10.1",
"@sentry/core": "9.10.1"
},
"engines": {
"node": ">=18"
}
},
"node_modules/@sentry/babel-plugin-component-annotate": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-3.2.2.tgz",
"integrity": "sha512-D+SKQ266ra/wo87s9+UI/rKQi3qhGPCR8eSCDe0VJudhjHsqyNU+JJ5lnIGCgmZaWFTXgdBP/gdr1Iz1zqGs4Q==",
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-3.2.4.tgz",
"integrity": "sha512-yBzRn3GEUSv1RPtE4xB4LnuH74ZxtdoRJ5cmQ9i6mzlmGDxlrnKuvem5++AolZTE9oJqAD3Tx2rd1PqmpWnLoA==",
"license": "MIT",
"engines": {
"node": ">= 14"
}
},
"node_modules/@sentry/browser": {
"version": "9.9.0",
"resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-9.9.0.tgz",
"integrity": "sha512-pIMdkOC+iggZefBs6ck5fL1mBhbLzjdw/8K99iqSeDh+lLvmlHVZajAhPlmw50xfH8CyQ1s22dhcL+zXbg3NKw==",
"version": "9.10.1",
"resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-9.10.1.tgz",
"integrity": "sha512-9RWjcyskhnDK2Q6LntFR90EqZD5+DXcXNqeTlE+mpVf65y7wz+9SIuVjAMP7qiDBwfxNbmTxiVCXeCuQnnATsQ==",
"license": "MIT",
"dependencies": {
"@sentry-internal/browser-utils": "9.9.0",
"@sentry-internal/feedback": "9.9.0",
"@sentry-internal/replay": "9.9.0",
"@sentry-internal/replay-canvas": "9.9.0",
"@sentry/core": "9.9.0"
"@sentry-internal/browser-utils": "9.10.1",
"@sentry-internal/feedback": "9.10.1",
"@sentry-internal/replay": "9.10.1",
"@sentry-internal/replay-canvas": "9.10.1",
"@sentry/core": "9.10.1"
},
"engines": {
"node": ">=18"
}
},
"node_modules/@sentry/bundler-plugin-core": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/@sentry/bundler-plugin-core/-/bundler-plugin-core-3.2.2.tgz",
"integrity": "sha512-YGrtmqQ2jMixccX2slVG/Lw7pCGJL3DGB3clmY9mO8QBEBIN3/gEANiHJVWwRidpUOS/0b7yVVGAdwZ87oPwTg==",
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/@sentry/bundler-plugin-core/-/bundler-plugin-core-3.2.4.tgz",
"integrity": "sha512-YMj9XW5W2JA89EeweE7CPKLDz245LBsI1JhCmqpt/bjSvmsSIAAPsLYnvIJBS3LQFm0OhtG8NB54PTi96dAcMA==",
"license": "MIT",
"dependencies": {
"@babel/core": "^7.18.5",
"@sentry/babel-plugin-component-annotate": "3.2.2",
"@sentry/babel-plugin-component-annotate": "3.2.4",
"@sentry/cli": "2.42.2",
"dotenv": "^16.3.1",
"find-up": "^5.0.0",
@@ -4300,6 +4300,105 @@
"@sentry/cli-win32-x64": "2.42.2"
}
},
"node_modules/@sentry/bundler-plugin-core/node_modules/@sentry/cli-darwin": {
"version": "2.42.2",
"resolved": "https://registry.npmjs.org/@sentry/cli-darwin/-/cli-darwin-2.42.2.tgz",
"integrity": "sha512-GtJSuxER7Vrp1IpxdUyRZzcckzMnb4N5KTW7sbTwUiwqARRo+wxS+gczYrS8tdgtmXs5XYhzhs+t4d52ITHMIg==",
"license": "BSD-3-Clause",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=10"
}
},
"node_modules/@sentry/bundler-plugin-core/node_modules/@sentry/cli-linux-arm": {
"version": "2.42.2",
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm/-/cli-linux-arm-2.42.2.tgz",
"integrity": "sha512-7udCw+YL9lwq+9eL3WLspvnuG+k5Icg92YE7zsteTzWLwgPVzaxeZD2f8hwhsu+wmL+jNqbpCRmktPteh3i2mg==",
"cpu": [
"arm"
],
"license": "BSD-3-Clause",
"optional": true,
"os": [
"linux",
"freebsd"
],
"engines": {
"node": ">=10"
}
},
"node_modules/@sentry/bundler-plugin-core/node_modules/@sentry/cli-linux-arm64": {
"version": "2.42.2",
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.42.2.tgz",
"integrity": "sha512-BOxzI7sgEU5Dhq3o4SblFXdE9zScpz6EXc5Zwr1UDZvzgXZGosUtKVc7d1LmkrHP8Q2o18HcDWtF3WvJRb5Zpw==",
"cpu": [
"arm64"
],
"license": "BSD-3-Clause",
"optional": true,
"os": [
"linux",
"freebsd"
],
"engines": {
"node": ">=10"
}
},
"node_modules/@sentry/bundler-plugin-core/node_modules/@sentry/cli-linux-i686": {
"version": "2.42.2",
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-i686/-/cli-linux-i686-2.42.2.tgz",
"integrity": "sha512-Sw/dQp5ZPvKnq3/y7wIJyxTUJYPGoTX/YeMbDs8BzDlu9to2LWV3K3r7hE7W1Lpbaw4tSquUHiQjP5QHCOS7aQ==",
"cpu": [
"x86",
"ia32"
],
"license": "BSD-3-Clause",
"optional": true,
"os": [
"linux",
"freebsd"
],
"engines": {
"node": ">=10"
}
},
"node_modules/@sentry/bundler-plugin-core/node_modules/@sentry/cli-linux-x64": {
"version": "2.42.2",
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-x64/-/cli-linux-x64-2.42.2.tgz",
"integrity": "sha512-mU4zUspAal6TIwlNLBV5oq6yYqiENnCWSxtSQVzWs0Jyq97wtqGNG9U+QrnwjJZ+ta/hvye9fvL2X25D/RxHQw==",
"cpu": [
"x64"
],
"license": "BSD-3-Clause",
"optional": true,
"os": [
"linux",
"freebsd"
],
"engines": {
"node": ">=10"
}
},
"node_modules/@sentry/bundler-plugin-core/node_modules/@sentry/cli-win32-i686": {
"version": "2.42.2",
"resolved": "https://registry.npmjs.org/@sentry/cli-win32-i686/-/cli-win32-i686-2.42.2.tgz",
"integrity": "sha512-iHvFHPGqgJMNqXJoQpqttfsv2GI3cGodeTq4aoVLU/BT3+hXzbV0x1VpvvEhncJkDgDicJpFLM8sEPHb3b8abw==",
"cpu": [
"x86",
"ia32"
],
"license": "BSD-3-Clause",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=10"
}
},
"node_modules/@sentry/bundler-plugin-core/node_modules/@sentry/cli-win32-x64": {
"version": "2.42.2",
"resolved": "https://registry.npmjs.org/@sentry/cli-win32-x64/-/cli-win32-x64-2.42.2.tgz",
@@ -4338,9 +4437,9 @@
}
},
"node_modules/@sentry/cli": {
"version": "2.42.4",
"resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.42.4.tgz",
"integrity": "sha512-BoSZDAWJiz/40tu6LuMDkSgwk4xTsq6zwqYoUqLU3vKBR/VsaaQGvu6EWxZXORthfZU2/5Agz0+t220cge6VQw==",
"version": "2.43.0",
"resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.43.0.tgz",
"integrity": "sha512-gBE3bkx+PBJxopTrzIJLX4xHe5S0w87q5frIveWKDZ5ulVIU6YWnVumay0y07RIEweUEj3IYva1qH6HG2abfiA==",
"hasInstallScript": true,
"license": "BSD-3-Clause",
"dependencies": {
@@ -4357,19 +4456,135 @@
"node": ">= 10"
},
"optionalDependencies": {
"@sentry/cli-darwin": "2.42.4",
"@sentry/cli-linux-arm": "2.42.4",
"@sentry/cli-linux-arm64": "2.42.4",
"@sentry/cli-linux-i686": "2.42.4",
"@sentry/cli-linux-x64": "2.42.4",
"@sentry/cli-win32-i686": "2.42.4",
"@sentry/cli-win32-x64": "2.42.4"
"@sentry/cli-darwin": "2.43.0",
"@sentry/cli-linux-arm": "2.43.0",
"@sentry/cli-linux-arm64": "2.43.0",
"@sentry/cli-linux-i686": "2.43.0",
"@sentry/cli-linux-x64": "2.43.0",
"@sentry/cli-win32-arm64": "2.43.0",
"@sentry/cli-win32-i686": "2.43.0",
"@sentry/cli-win32-x64": "2.43.0"
}
},
"node_modules/@sentry/cli-darwin": {
"version": "2.43.0",
"resolved": "https://registry.npmjs.org/@sentry/cli-darwin/-/cli-darwin-2.43.0.tgz",
"integrity": "sha512-0MYvRHJowXOMNY5W6XF4p9GQNH3LuQ+IHAQwVbZOsfwnEv8e20rf9BiPPzmJ9sIjZSWYR4yIqm6dBp6ABJFbGQ==",
"license": "BSD-3-Clause",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=10"
}
},
"node_modules/@sentry/cli-linux-arm": {
"version": "2.43.0",
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm/-/cli-linux-arm-2.43.0.tgz",
"integrity": "sha512-c2Fwb6HrFL1nbaGV4uRhHC1wEJPR+wfpKN5y06PgSNNbd10YrECAB3tqBHXC8CEmhuDyFR+ORGZ7VbswfCWEEQ==",
"cpu": [
"arm"
],
"license": "BSD-3-Clause",
"optional": true,
"os": [
"linux",
"freebsd"
],
"engines": {
"node": ">=10"
}
},
"node_modules/@sentry/cli-linux-arm64": {
"version": "2.43.0",
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.43.0.tgz",
"integrity": "sha512-7URSaNjbEJQZyYJ33XK3pVKl6PU2oO9ETF6R/4Cz2FmU3fecACLKVldv7+OuNl9aspLZ62mnPMDvT732/Fp2Ug==",
"cpu": [
"arm64"
],
"license": "BSD-3-Clause",
"optional": true,
"os": [
"linux",
"freebsd"
],
"engines": {
"node": ">=10"
}
},
"node_modules/@sentry/cli-linux-i686": {
"version": "2.43.0",
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-i686/-/cli-linux-i686-2.43.0.tgz",
"integrity": "sha512-bFo/tpMZeMJ275HPGmAENREchnBxhALOOpZAphSyalUu3pGZ+EETEtlSLrKyVNJo26Dye5W7GlrYUV9+rkyCtg==",
"cpu": [
"x86",
"ia32"
],
"license": "BSD-3-Clause",
"optional": true,
"os": [
"linux",
"freebsd"
],
"engines": {
"node": ">=10"
}
},
"node_modules/@sentry/cli-linux-x64": {
"version": "2.43.0",
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-x64/-/cli-linux-x64-2.43.0.tgz",
"integrity": "sha512-EbAmKXUNU/Ii4pNGVRCepU6ks1M43wStMKx3pibrUTllrrCwqYKyPxRRdoFYySHkduwCxnoKZcLEg9vWZ3qS6A==",
"cpu": [
"x64"
],
"license": "BSD-3-Clause",
"optional": true,
"os": [
"linux",
"freebsd"
],
"engines": {
"node": ">=10"
}
},
"node_modules/@sentry/cli-win32-arm64": {
"version": "2.43.0",
"resolved": "https://registry.npmjs.org/@sentry/cli-win32-arm64/-/cli-win32-arm64-2.43.0.tgz",
"integrity": "sha512-KmJRCdQQGLSErJvrcGcN+yWo68m+5OdluhyJHsVYMOQknwu8YMOWLm12EIa+4t4GclDvwg5xcxLccCuiWMJUZw==",
"cpu": [
"arm64"
],
"license": "BSD-3-Clause",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=10"
}
},
"node_modules/@sentry/cli-win32-i686": {
"version": "2.43.0",
"resolved": "https://registry.npmjs.org/@sentry/cli-win32-i686/-/cli-win32-i686-2.43.0.tgz",
"integrity": "sha512-ZWxZdOyZX7NJ/CTskzg+dJ2xTpobFLXVNMOMq0HiwdhqXP2zYYJzKnIt3mHNJYA40zYFODGSgxIamodjpB8BuA==",
"cpu": [
"x86",
"ia32"
],
"license": "BSD-3-Clause",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=10"
}
},
"node_modules/@sentry/cli-win32-x64": {
"version": "2.42.4",
"resolved": "https://registry.npmjs.org/@sentry/cli-win32-x64/-/cli-win32-x64-2.42.4.tgz",
"integrity": "sha512-OIBj3uaQ6nAERSm5Dcf8UIhyElEEwMNsZEEppQpN4IKl0mrwb/57AznM23Dvpu6GR8WGbVQUSolt879YZR5E9g==",
"version": "2.43.0",
"resolved": "https://registry.npmjs.org/@sentry/cli-win32-x64/-/cli-win32-x64-2.43.0.tgz",
"integrity": "sha512-S/IRQYAziEnjpyROhnqzTqShDq3m8jcevXx+q5f49uQnFbfYcTgS1sdrEPqqao/K2boOWbffxYtTkvBiB/piQQ==",
"cpu": [
"x64"
],
@@ -4404,22 +4619,22 @@
}
},
"node_modules/@sentry/core": {
"version": "9.9.0",
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-9.9.0.tgz",
"integrity": "sha512-GxKvx8PSgoWhLLS+/WBGIXy7rsFcnJBPDqFXIfcAGy89k2j06d9IP0kiIc63qBGStSUkh5FFJLPTakZ5RXiFXA==",
"version": "9.10.1",
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-9.10.1.tgz",
"integrity": "sha512-TE2zZV3Od4131mZNgFo2Mv4aKU8FXxL0s96yqRvmV+8AU57mJoycMXBnmNSYfWuDICbPJTVAp+3bYMXwX7N5YA==",
"license": "MIT",
"engines": {
"node": ">=18"
}
},
"node_modules/@sentry/react": {
"version": "9.9.0",
"resolved": "https://registry.npmjs.org/@sentry/react/-/react-9.9.0.tgz",
"integrity": "sha512-7BE2Lx5CNtHtlNSS7Z9HxKquohC0xhdFceO3NlMXlx+dZuVCMoQmLISB8SQEcHw+2VO24MvtP3LPEzdeNbkIfg==",
"version": "9.10.1",
"resolved": "https://registry.npmjs.org/@sentry/react/-/react-9.10.1.tgz",
"integrity": "sha512-DYBs3F+F2elWEhWvp3HmBmORhAlTBbY0KsRj+Lt2mOSEfiz8WWrS3Ibe+9QmErVdjQZy68ic9Yt84MHL/rlmkQ==",
"license": "MIT",
"dependencies": {
"@sentry/browser": "9.9.0",
"@sentry/core": "9.9.0",
"@sentry/browser": "9.10.1",
"@sentry/core": "9.10.1",
"hoist-non-react-statics": "^3.3.2"
},
"engines": {
@@ -4430,12 +4645,12 @@
}
},
"node_modules/@sentry/vite-plugin": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/@sentry/vite-plugin/-/vite-plugin-3.2.2.tgz",
"integrity": "sha512-WSkHOhZszMrIE9zmx2l4JhMnMlZmN/yAoHyf59pwFLIMctuZak6lNPbTbIFkFHDzIJ9Nut5RAVsw1qjmWc1PTA==",
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/@sentry/vite-plugin/-/vite-plugin-3.2.4.tgz",
"integrity": "sha512-ZRn5TLlq5xtwKOqaWP+XqS1PYVfbBCgsbMk7wW2Ly6EgF9wYePvtLqKgYnE3hwPg2LpBnRPR2ti1ohlUkR+wXA==",
"license": "MIT",
"dependencies": {
"@sentry/bundler-plugin-core": "3.2.2",
"@sentry/bundler-plugin-core": "3.2.4",
"unplugin": "1.0.1"
},
"engines": {
@@ -4443,13 +4658,13 @@
}
},
"node_modules/@sentry/webpack-plugin": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/@sentry/webpack-plugin/-/webpack-plugin-3.2.2.tgz",
"integrity": "sha512-6OkVKNOjKk8P9j7oh6svZ+kEP1i9YIHBC2aGWL2XsgeZTIrMBxJAXtOf+qSrfMAxEtibSroGVOMQc/y3WJTQtg==",
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/@sentry/webpack-plugin/-/webpack-plugin-3.2.4.tgz",
"integrity": "sha512-LCuNu5LXPSCq2BNke1zvEW8CXL4SPBsCjYexAx51PZ6Lp87VxWcCxGqXhr37MGpYwY10A1r31/XOe69iXHJjGA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@sentry/bundler-plugin-core": "3.2.2",
"@sentry/bundler-plugin-core": "3.2.4",
"unplugin": "1.0.1",
"uuid": "^9.0.0"
},
@@ -4467,12 +4682,12 @@
"license": "MIT"
},
"node_modules/@splitsoftware/splitio": {
"version": "11.0.3",
"resolved": "https://registry.npmjs.org/@splitsoftware/splitio/-/splitio-11.0.3.tgz",
"integrity": "sha512-UtoixGfICCj52FfaVdI186Czw0qCvvEyCw/OtJVTsgM4Zq0k2mY8yKzQ7tSB/HJtzbUVnuPoxkwEcj0479stmg==",
"version": "11.2.0",
"resolved": "https://registry.npmjs.org/@splitsoftware/splitio/-/splitio-11.2.0.tgz",
"integrity": "sha512-M0TK8jlhLBv4+PchzBvn5R33MZzvRTInauGKGeaTpbxI+zq/g58meaNEiLRJxNw1lAWOjPhPRLIVg+V3Mf+uaA==",
"license": "Apache-2.0",
"dependencies": {
"@splitsoftware/splitio-commons": "2.0.2",
"@splitsoftware/splitio-commons": "2.2.0",
"bloom-filters": "^3.0.4",
"ioredis": "^4.28.0",
"js-yaml": "^3.13.1",
@@ -4485,9 +4700,9 @@
}
},
"node_modules/@splitsoftware/splitio-commons": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.0.2.tgz",
"integrity": "sha512-r2m3kwWnSuROT+7zTzhWBrM0DMRBGJNQcTyvXw8zLPPmBs/PnmAnxCy7uRpfMHOGbP9Q3Iju0bU/H5dG8svyiw==",
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.2.0.tgz",
"integrity": "sha512-ywWDh2fM4/EqJ1AByjXM13gAal+z/WSGiBQ5OZmjpL/iqFLENy3yo/GwsxR/ataOi27XbRQTeQbE/eD7HVnWiA==",
"license": "Apache-2.0",
"dependencies": {
"@types/ioredis": "^4.28.0",
@@ -4503,12 +4718,12 @@
}
},
"node_modules/@splitsoftware/splitio-react": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@splitsoftware/splitio-react/-/splitio-react-2.0.1.tgz",
"integrity": "sha512-Jky3o46w+CO2+x6TN3kzQ4CoASKX4PqtDqSTHY6n5JXBC2CqhlXuvODoMYXKzolOsndku+aL7+Mlavbn7b+2lw==",
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@splitsoftware/splitio-react/-/splitio-react-2.1.0.tgz",
"integrity": "sha512-iAGXl/qadHVFUQA/+asX8UGwDPpNi6WCKhNIzLZ6NSvt38+M8Bpc3CMnkYNEXsNsz1J+C26ICsMZ067YQ96k6g==",
"license": "Apache-2.0",
"dependencies": {
"@splitsoftware/splitio": "11.0.3",
"@splitsoftware/splitio": "11.2.0",
"memoize-one": "^5.1.1",
"shallowequal": "^1.1.0",
"tslib": "^2.3.1"
@@ -5281,14 +5496,14 @@
}
},
"node_modules/@vitest/expect": {
"version": "3.0.9",
"resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.0.9.tgz",
"integrity": "sha512-5eCqRItYgIML7NNVgJj6TVCmdzE7ZVgJhruW0ziSQV4V7PvLkDL1bBkBdcTs/VuIz0IxPb5da1IDSqc1TR9eig==",
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.1.1.tgz",
"integrity": "sha512-q/zjrW9lgynctNbwvFtQkGK9+vvHA5UzVi2V8APrp1C6fG6/MuYYkmlx4FubuqLycCeSdHD5aadWfua/Vr0EUA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@vitest/spy": "3.0.9",
"@vitest/utils": "3.0.9",
"@vitest/spy": "3.1.1",
"@vitest/utils": "3.1.1",
"chai": "^5.2.0",
"tinyrainbow": "^2.0.0"
},
@@ -5297,13 +5512,13 @@
}
},
"node_modules/@vitest/mocker": {
"version": "3.0.9",
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.0.9.tgz",
"integrity": "sha512-ryERPIBOnvevAkTq+L1lD+DTFBRcjueL9lOUfXsLfwP92h4e+Heb+PjiqS3/OURWPtywfafK0kj++yDFjWUmrA==",
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.1.1.tgz",
"integrity": "sha512-bmpJJm7Y7i9BBELlLuuM1J1Q6EQ6K5Ye4wcyOpOMXMcePYKSIYlpcrCm4l/O6ja4VJA5G2aMJiuZkZdnxlC3SA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@vitest/spy": "3.0.9",
"@vitest/spy": "3.1.1",
"estree-walker": "^3.0.3",
"magic-string": "^0.30.17"
},
@@ -5344,9 +5559,9 @@
}
},
"node_modules/@vitest/pretty-format": {
"version": "3.0.9",
"resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.0.9.tgz",
"integrity": "sha512-OW9F8t2J3AwFEwENg3yMyKWweF7oRJlMyHOMIhO5F3n0+cgQAJZBjNgrF8dLwFTEXl5jUqBLXd9QyyKv8zEcmA==",
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.1.1.tgz",
"integrity": "sha512-dg0CIzNx+hMMYfNmSqJlLSXEmnNhMswcn3sXO7Tpldr0LiGmg3eXdLLhwkv2ZqgHb/d5xg5F7ezNFRA1fA13yA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -5357,13 +5572,13 @@
}
},
"node_modules/@vitest/runner": {
"version": "3.0.9",
"resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.0.9.tgz",
"integrity": "sha512-NX9oUXgF9HPfJSwl8tUZCMP1oGx2+Sf+ru6d05QjzQz4OwWg0psEzwY6VexP2tTHWdOkhKHUIZH+fS6nA7jfOw==",
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.1.1.tgz",
"integrity": "sha512-X/d46qzJuEDO8ueyjtKfxffiXraPRfmYasoC4i5+mlLEJ10UvPb0XH5M9C3gWuxd7BAQhpK42cJgJtq53YnWVA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@vitest/utils": "3.0.9",
"@vitest/utils": "3.1.1",
"pathe": "^2.0.3"
},
"funding": {
@@ -5378,13 +5593,13 @@
"license": "MIT"
},
"node_modules/@vitest/snapshot": {
"version": "3.0.9",
"resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.0.9.tgz",
"integrity": "sha512-AiLUiuZ0FuA+/8i19mTYd+re5jqjEc2jZbgJ2up0VY0Ddyyxg/uUtBDpIFAy4uzKaQxOW8gMgBdAJJ2ydhu39A==",
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.1.1.tgz",
"integrity": "sha512-bByMwaVWe/+1WDf9exFxWWgAixelSdiwo2p33tpqIlM14vW7PRV5ppayVXtfycqze4Qhtwag5sVhX400MLBOOw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@vitest/pretty-format": "3.0.9",
"@vitest/pretty-format": "3.1.1",
"magic-string": "^0.30.17",
"pathe": "^2.0.3"
},
@@ -5410,9 +5625,9 @@
"license": "MIT"
},
"node_modules/@vitest/spy": {
"version": "3.0.9",
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.0.9.tgz",
"integrity": "sha512-/CcK2UDl0aQ2wtkp3YVWldrpLRNCfVcIOFGlVGKO4R5eajsH393Z1yiXLVQ7vWsj26JOEjeZI0x5sm5P4OGUNQ==",
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.1.1.tgz",
"integrity": "sha512-+EmrUOOXbKzLkTDwlsc/xrwOlPDXyVk3Z6P6K4oiCndxz7YLpp/0R0UsWVOKT0IXWjjBJuSMk6D27qipaupcvQ==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -5423,13 +5638,13 @@
}
},
"node_modules/@vitest/utils": {
"version": "3.0.9",
"resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.0.9.tgz",
"integrity": "sha512-ilHM5fHhZ89MCp5aAaM9uhfl1c2JdxVxl3McqsdVyVNN6JffnEen8UMCdRTzOhGXNQGo5GNL9QugHrz727Wnng==",
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.1.1.tgz",
"integrity": "sha512-1XIjflyaU2k3HMArJ50bwSh3wKWPD6Q47wz/NUSmRV0zNywPc4w79ARjg/i/aNINHwA+mIALhUVqD9/aUvZNgg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@vitest/pretty-format": "3.0.9",
"@vitest/pretty-format": "3.1.1",
"loupe": "^3.1.3",
"tinyrainbow": "^2.0.0"
},
@@ -5561,9 +5776,9 @@
}
},
"node_modules/antd": {
"version": "5.24.5",
"resolved": "https://registry.npmjs.org/antd/-/antd-5.24.5.tgz",
"integrity": "sha512-1lAv/G+9ewQanyoAo3JumQmIlVxwo5QwWGb6QCHYc40Cq0NxC/EzITcjsgq1PSaTUpLkKq8A2l7Fjtu47vqQBg==",
"version": "5.24.6",
"resolved": "https://registry.npmjs.org/antd/-/antd-5.24.6.tgz",
"integrity": "sha512-xIlTa/1CTbgkZsdU/dOXkYvJXb9VoiMwsaCzpKFH2zAEY3xqOfwQ57/DdG7lAdrWP7QORtSld4UA6suxzuTHXw==",
"license": "MIT",
"dependencies": {
"@ant-design/colors": "^7.2.0",
@@ -14159,9 +14374,9 @@
}
},
"node_modules/react-virtuoso": {
"version": "4.12.5",
"resolved": "https://registry.npmjs.org/react-virtuoso/-/react-virtuoso-4.12.5.tgz",
"integrity": "sha512-YeCbRRsC9CLf0buD0Rct7WsDbzf+yBU1wGbo05/XjbcN2nJuhgh040m3y3+6HVogTZxEqVm45ac9Fpae4/MxRQ==",
"version": "4.12.6",
"resolved": "https://registry.npmjs.org/react-virtuoso/-/react-virtuoso-4.12.6.tgz",
"integrity": "sha512-bfvS6aCL1ehXmq39KRiz/vxznGUbtA27I5I24TYCe1DhMf84O3aVNCIwrSjYQjkJGJGzY46ihdN8WkYlemuhMQ==",
"license": "MIT",
"peerDependencies": {
"react": ">=16 || >=17 || >= 18 || >= 19",
@@ -14855,9 +15070,9 @@
"license": "MIT"
},
"node_modules/sass": {
"version": "1.86.0",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.86.0.tgz",
"integrity": "sha512-zV8vGUld/+mP4KbMLJMX7TyGCuUp7hnkOScgCMsWuHtns8CWBoz+vmEhoGMXsaJrbUP8gj+F1dLvVe79sK8UdA==",
"version": "1.86.1",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.86.1.tgz",
"integrity": "sha512-Yaok4XELL1L9Im/ZUClKu//D2OP1rOljKj0Gf34a+GzLbMveOzL7CfqYo+JUa5Xt1nhTCW+OcKp/FtR7/iqj1w==",
"license": "MIT",
"dependencies": {
"chokidar": "^4.0.0",
@@ -15875,9 +16090,9 @@
}
},
"node_modules/swr": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/swr/-/swr-2.3.2.tgz",
"integrity": "sha512-RosxFpiabojs75IwQ316DGoDRmOqtiAj0tg8wCcbEu4CiLZBs/a9QNtHV7TUfDXmmlgqij/NqzKq/eLelyv9xA==",
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/swr/-/swr-2.3.3.tgz",
"integrity": "sha512-dshNvs3ExOqtZ6kJBaAsabhPdHyeY4P2cKwRCniDVifBMoG/SVI7tfLWqPXriVspf2Rg4tPzXJTnwaihIeFw2A==",
"license": "MIT",
"dependencies": {
"dequal": "^2.0.3",
@@ -16903,9 +17118,9 @@
}
},
"node_modules/vite": {
"version": "6.2.3",
"resolved": "https://registry.npmjs.org/vite/-/vite-6.2.3.tgz",
"integrity": "sha512-IzwM54g4y9JA/xAeBPNaDXiBF8Jsgl3VBQ2YQ/wOY6fyW3xMdSoltIV3Bo59DErdqdE6RxUfv8W69DvUorE4Eg==",
"version": "6.2.4",
"resolved": "https://registry.npmjs.org/vite/-/vite-6.2.4.tgz",
"integrity": "sha512-veHMSew8CcRzhL5o8ONjy8gkfmFJAd5Ac16oxBUjlwgX3Gq2Wqr+qNC3TjPIpy7TPV/KporLga5GT9HqdrCizw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -16975,9 +17190,9 @@
}
},
"node_modules/vite-node": {
"version": "3.0.9",
"resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.0.9.tgz",
"integrity": "sha512-w3Gdx7jDcuT9cNn9jExXgOyKmf5UOTb6WMHz8LGAm54eS1Elf5OuBhCxl6zJxGhEeIkgsE1WbHuoL0mj/UXqXg==",
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.1.1.tgz",
"integrity": "sha512-V+IxPAE2FvXpTCHXyNem0M+gWm6J7eRyWPR6vYoG/Gl+IscNOjXzztUhimQgTxaAoUoj40Qqimaa0NLIOOAH4w==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -17084,9 +17299,9 @@
}
},
"node_modules/vite-plugin-pwa": {
"version": "0.21.2",
"resolved": "https://registry.npmjs.org/vite-plugin-pwa/-/vite-plugin-pwa-0.21.2.tgz",
"integrity": "sha512-vFhH6Waw8itNu37hWUJxL50q+CBbNcMVzsKaYHQVrfxTt3ihk3PeLO22SbiP1UNWzcEPaTQv+YVxe4G0KOjAkg==",
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/vite-plugin-pwa/-/vite-plugin-pwa-1.0.0.tgz",
"integrity": "sha512-X77jo0AOd5OcxmWj3WnVti8n7Kw2tBgV1c8MCXFclrSlDV23ePzv2eTDIALXI2Qo6nJ5pZJeZAuX0AawvRfoeA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -17103,7 +17318,7 @@
"url": "https://github.com/sponsors/antfu"
},
"peerDependencies": {
"@vite-pwa/assets-generator": "^0.2.6",
"@vite-pwa/assets-generator": "^1.0.0",
"vite": "^3.1.0 || ^4.0.0 || ^5.0.0 || ^6.0.0",
"workbox-build": "^7.3.0",
"workbox-window": "^7.3.0"
@@ -17216,31 +17431,31 @@
}
},
"node_modules/vitest": {
"version": "3.0.9",
"resolved": "https://registry.npmjs.org/vitest/-/vitest-3.0.9.tgz",
"integrity": "sha512-BbcFDqNyBlfSpATmTtXOAOj71RNKDDvjBM/uPfnxxVGrG+FSH2RQIwgeEngTaTkuU/h0ScFvf+tRcKfYXzBybQ==",
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/vitest/-/vitest-3.1.1.tgz",
"integrity": "sha512-kiZc/IYmKICeBAZr9DQ5rT7/6bD9G7uqQEki4fxazi1jdVl2mWGzedtBs5s6llz59yQhVb7FFY2MbHzHCnT79Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"@vitest/expect": "3.0.9",
"@vitest/mocker": "3.0.9",
"@vitest/pretty-format": "^3.0.9",
"@vitest/runner": "3.0.9",
"@vitest/snapshot": "3.0.9",
"@vitest/spy": "3.0.9",
"@vitest/utils": "3.0.9",
"@vitest/expect": "3.1.1",
"@vitest/mocker": "3.1.1",
"@vitest/pretty-format": "^3.1.1",
"@vitest/runner": "3.1.1",
"@vitest/snapshot": "3.1.1",
"@vitest/spy": "3.1.1",
"@vitest/utils": "3.1.1",
"chai": "^5.2.0",
"debug": "^4.4.0",
"expect-type": "^1.1.0",
"expect-type": "^1.2.0",
"magic-string": "^0.30.17",
"pathe": "^2.0.3",
"std-env": "^3.8.0",
"std-env": "^3.8.1",
"tinybench": "^2.9.0",
"tinyexec": "^0.3.2",
"tinypool": "^1.0.2",
"tinyrainbow": "^2.0.0",
"vite": "^5.0.0 || ^6.0.0",
"vite-node": "3.0.9",
"vite-node": "3.1.1",
"why-is-node-running": "^2.3.0"
},
"bin": {
@@ -17256,8 +17471,8 @@
"@edge-runtime/vm": "*",
"@types/debug": "^4.1.12",
"@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
"@vitest/browser": "3.0.9",
"@vitest/ui": "3.0.9",
"@vitest/browser": "3.1.1",
"@vitest/ui": "3.1.1",
"happy-dom": "*",
"jsdom": "*"
},

View File

@@ -8,23 +8,23 @@
"private": true,
"proxy": "http://localhost:4000",
"dependencies": {
"@ant-design/pro-layout": "^7.22.3",
"@ant-design/pro-layout": "^7.22.4",
"@apollo/client": "^3.13.5",
"@emotion/is-prop-valid": "^1.3.1",
"@fingerprintjs/fingerprintjs": "^4.6.1",
"@firebase/analytics": "^0.10.12",
"@firebase/app": "^0.11.3",
"@firebase/auth": "^1.9.1",
"@firebase/app": "^0.11.4",
"@firebase/auth": "^1.10.0",
"@firebase/firestore": "^4.7.10",
"@firebase/messaging": "^0.12.17",
"@jsreport/browser-client": "^3.1.0",
"@reduxjs/toolkit": "^2.6.1",
"@sentry/cli": "^2.42.4",
"@sentry/react": "^9.9.0",
"@sentry/vite-plugin": "^3.2.2",
"@splitsoftware/splitio-react": "^2.0.1",
"@sentry/cli": "^2.43.0",
"@sentry/react": "^9.10.1",
"@sentry/vite-plugin": "^3.2.4",
"@splitsoftware/splitio-react": "^2.1.0",
"@tanem/react-nprogress": "^5.0.53",
"antd": "^5.24.5",
"antd": "^5.24.6",
"apollo-link-logger": "^2.0.1",
"apollo-link-sentry": "^4.2.0",
"autosize": "^6.0.1",
@@ -69,7 +69,7 @@
"react-resizable": "^3.0.5",
"react-router-dom": "^6.30.0",
"react-sticky": "^6.0.3",
"react-virtuoso": "^4.12.5",
"react-virtuoso": "^4.12.6",
"recharts": "^2.15.0",
"redux": "^5.0.1",
"redux-actions": "^3.0.3",
@@ -77,7 +77,7 @@
"redux-saga": "^1.3.0",
"redux-state-sync": "^3.1.4",
"reselect": "^5.1.1",
"sass": "^1.86.0",
"sass": "^1.86.1",
"socket.io-client": "^4.8.1",
"styled-components": "^6.1.16",
"subscriptions-transport-ws": "^0.11.0",
@@ -135,7 +135,7 @@
"@emotion/react": "^11.14.0",
"@eslint/js": "^9.23.0",
"@playwright/test": "^1.51.1",
"@sentry/webpack-plugin": "^3.2.2",
"@sentry/webpack-plugin": "^3.2.4",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.2.0",
@@ -154,13 +154,13 @@
"react-error-overlay": "^6.1.0",
"redux-logger": "^3.0.6",
"source-map-explorer": "^2.5.3",
"vite": "^6.2.3",
"vite": "^6.2.4",
"vite-plugin-babel": "^1.3.0",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-node-polyfills": "^0.23.0",
"vite-plugin-pwa": "^0.21.2",
"vite-plugin-pwa": "^1.0.0",
"vite-plugin-style-import": "^2.0.0",
"vitest": "^3.0.9",
"vitest": "^3.1.1",
"workbox-window": "^7.3.0"
}
}

View File

@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."bodyshops" add column "intellipay_merchant_id" text
-- null unique;

View File

@@ -0,0 +1,2 @@
alter table "public"."bodyshops" add column "intellipay_merchant_id" text
null unique;

1685
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -15,14 +15,14 @@
"test:watch": "vitest"
},
"dependencies": {
"@aws-sdk/client-cloudwatch-logs": "^3.772.0",
"@aws-sdk/client-elasticache": "^3.772.0",
"@aws-sdk/client-s3": "^3.772.0",
"@aws-sdk/client-secrets-manager": "^3.772.0",
"@aws-sdk/client-ses": "^3.772.0",
"@aws-sdk/credential-provider-node": "^3.772.0",
"@aws-sdk/lib-storage": "^3.774.0",
"@aws-sdk/s3-request-presigner": "^3.774.0",
"@aws-sdk/client-cloudwatch-logs": "^3.777.0",
"@aws-sdk/client-elasticache": "^3.777.0",
"@aws-sdk/client-s3": "^3.779.0",
"@aws-sdk/client-secrets-manager": "^3.777.0",
"@aws-sdk/client-ses": "^3.777.0",
"@aws-sdk/credential-provider-node": "^3.777.0",
"@aws-sdk/lib-storage": "^3.779.0",
"@aws-sdk/s3-request-presigner": "^3.779.0",
"@opensearch-project/opensearch": "^2.13.0",
"@socket.io/admin-ui": "^0.5.1",
"@socket.io/redis-adapter": "^8.3.0",
@@ -32,8 +32,7 @@
"bee-queue": "^1.7.1",
"better-queue": "^3.8.12",
"bluebird": "^3.7.2",
"body-parser": "^1.20.3",
"bullmq": "^5.44.4",
"bullmq": "^5.45.2",
"chart.js": "^4.4.8",
"cloudinary": "^2.6.0",
"compression": "^1.8.0",
@@ -41,7 +40,7 @@
"cors": "2.8.5",
"crisp-status-reporter": "^1.2.2",
"csrf": "^3.1.0",
"dd-trace": "^5.43.0",
"dd-trace": "^5.45.0",
"dinero.js": "^1.9.1",
"dotenv": "^16.4.5",
"express": "^4.21.1",
@@ -82,10 +81,11 @@
"eslint": "^9.23.0",
"eslint-plugin-react": "^7.37.4",
"globals": "^15.15.0",
"mock-require": "^3.0.3",
"p-limit": "^3.1.0",
"prettier": "^3.5.3",
"source-map-explorer": "^2.5.2",
"supertest": "^7.1.0",
"vitest": "^3.0.9"
"vitest": "^3.1.1"
}
}

View File

@@ -84,8 +84,8 @@ const SOCKETIO_CORS_ORIGIN_DEV = ["http://localhost:3333", "https://localhost:33
const applyMiddleware = ({ app }) => {
app.use(compression());
app.use(cookieParser());
app.use(bodyParser.json({ limit: "50mb" }));
app.use(bodyParser.urlencoded({ limit: "50mb", extended: true }));
app.use(express.json({ limit: "50mb" }));
app.use(express.urlencoded({ limit: "50mb", extended: true }));
app.use(cors({ credentials: true, exposedHeaders: ["set-cookie"] }));
// Helper middleware

View File

@@ -2832,3 +2832,15 @@ exports.GET_DOCUMENTS_BY_IDS = `
takenat
}
}`;
exports.GET_JOBID_BY_MERCHANTID_RONUMBER = `
query GET_JOBID_BY_MERCHANTID_RONUMBER($merchantID: String!, $roNumber: String!) {
jobs(where: {ro_number: {_eq: $roNumber}, bodyshop: {intellipay_merchant_id: {_eq: $merchantID}}}) {
id
shopid
bodyshop {
id
intellipay_config
}
}
}`;

View File

@@ -1,64 +1,22 @@
const path = require("path");
require("dotenv").config({
path: path.resolve(process.cwd(), `.env.${process.env.NODE_ENV || "development"}`)
});
const queries = require("../graphql-client/queries");
const Dinero = require("dinero.js");
const qs = require("query-string");
const axios = require("axios");
const moment = require("moment");
const logger = require("../utils/logger");
const { sendTaskEmail } = require("../email/sendemail");
const generateEmailTemplate = require("../email/generateTemplate");
const { isEmpty, isNumber } = require("lodash");
const handleCommentBasedPayment = require("./lib/handleCommentBasedPayment");
const handleInvoiceBasedPayment = require("./lib/handleInvoiceBasedPayment");
const logValidationError = require("./lib/handlePaymentValidationError");
const getCptellerUrl = require("./lib/getCptellerUrl");
const getShopCredentials = require("./lib/getShopCredentials");
const decodeComment = require("./lib/decodeComment");
const domain = process.env.NODE_ENV ? "secure" : "test";
const { SecretsManagerClient, GetSecretValueCommand } = require("@aws-sdk/client-secrets-manager");
const { InstanceRegion, InstanceEndpoints } = require("../utils/instanceMgr");
const client = new SecretsManagerClient({
region: InstanceRegion()
});
const gqlClient = require("../graphql-client/graphql-client").client;
const getShopCredentials = async (bodyshop) => {
// Development only
if (process.env.NODE_ENV === undefined) {
return {
merchantkey: process.env.INTELLIPAY_MERCHANTKEY,
apikey: process.env.INTELLIPAY_APIKEY
};
}
// Production code
if (bodyshop?.imexshopid) {
try {
const secret = await client.send(
new GetSecretValueCommand({
SecretId: `intellipay-credentials-${bodyshop.imexshopid}`,
VersionStage: "AWSCURRENT" // VersionStage defaults to AWSCURRENT if unspecified
})
);
return JSON.parse(secret.SecretString);
} catch (error) {
return {
error: error.message
};
}
}
};
const decodeComment = (comment) => {
try {
return comment ? JSON.parse(Buffer.from(comment, "base64").toString()) : null;
// eslint-disable-next-line no-unused-vars
} catch (error) {
return null; // Handle malformed base64 string gracefully
}
};
exports.lightbox_credentials = async (req, res) => {
/**
* @description Get lightbox credentials for the shop
* @param req
* @param res
* @returns {Promise<void>}
*/
const lightboxCredentials = async (req, res) => {
const decodedComment = decodeComment(req.body?.comment);
const logMeta = {
iPayData: req.body?.iPayData,
@@ -74,17 +32,17 @@ exports.lightbox_credentials = async (req, res) => {
const shopCredentials = await getShopCredentials(req.body.bodyshop);
if (shopCredentials.error) {
if (shopCredentials?.error) {
logger.log("intellipay-credentials-error", "ERROR", req.user?.email, null, {
message: shopCredentials.error?.message,
...logMeta
});
res.json({
return res.json({
message: shopCredentials.error?.message,
type: "intellipay-credentials-error",
...logMeta
});
return;
}
try {
@@ -95,7 +53,10 @@ exports.lightbox_credentials = async (req, res) => {
...shopCredentials,
operatingenv: "businessattended"
}),
url: `https://${domain}.cpteller.com/api/custapi.cfc?method=autoterminal${req.body.refresh ? "_refresh" : ""}` //autoterminal_refresh
url: getCptellerUrl({
apiType: "custapi",
params: { method: `autoterminal${req.body.refresh ? "_refresh" : ""}` }
})
};
const response = await axios(options);
@@ -105,13 +66,14 @@ exports.lightbox_credentials = async (req, res) => {
...logMeta
});
res.send(response.data);
return res.send(response.data);
} catch (error) {
logger.log("intellipay-lightbox-error", "ERROR", req.user?.email, null, {
message: error?.message,
...logMeta
});
res.json({
return res.json({
message: error?.message,
type: "intellipay-lightbox-error",
...logMeta
@@ -119,7 +81,13 @@ exports.lightbox_credentials = async (req, res) => {
}
};
exports.payment_refund = async (req, res) => {
/**
* @description Process payment refund
* @param req
* @param res
* @returns {Promise<void>}
*/
const paymentRefund = async (req, res) => {
const decodedComment = decodeComment(req.body.iPayData?.comment);
const logResponseMeta = {
iPayData: req.body?.iPayData,
@@ -137,18 +105,17 @@ exports.payment_refund = async (req, res) => {
const shopCredentials = await getShopCredentials(req.body.bodyshop);
if (shopCredentials.error) {
if (shopCredentials?.error) {
logger.log("intellipay-refund-credentials-error", "ERROR", req.user?.email, null, {
credentialsError: shopCredentials.error,
...logResponseMeta
});
res.status(400).json({
return res.status(400).json({
credentialsError: shopCredentials.error,
type: "intellipay-refund-credentials-error",
...logResponseMeta
});
return;
}
try {
@@ -161,7 +128,11 @@ exports.payment_refund = async (req, res) => {
paymentid: req.body.paymentid,
amount: req.body.amount
}),
url: `https://${domain}.cpteller.com/api/26/webapi.cfc?method=payment_refund`
url: getCptellerUrl({
apiType: "webapi",
version: "26",
params: { method: "payment_refund" }
})
};
logger.log("intellipay-refund-options-prepared", "DEBUG", req.user?.email, null, {
@@ -176,13 +147,14 @@ exports.payment_refund = async (req, res) => {
...logResponseMeta
});
res.send(response.data);
return res.send(response.data);
} catch (error) {
logger.log("intellipay-refund-error", "ERROR", req.user?.email, null, {
message: error?.message,
...logResponseMeta
});
res.status(500).json({
return res.status(500).json({
message: error?.message,
type: "intellipay-refund-error",
...logResponseMeta
@@ -190,7 +162,13 @@ exports.payment_refund = async (req, res) => {
}
};
exports.generate_payment_url = async (req, res) => {
/**
* @description Generate payment URL for the shop
* @param req
* @param res
* @returns {Promise<void>}
*/
const generatePaymentUrl = async (req, res) => {
const decodedComment = decodeComment(req.body.comment);
const logResponseMeta = {
iPayData: req.body?.iPayData,
@@ -210,17 +188,17 @@ exports.generate_payment_url = async (req, res) => {
const shopCredentials = await getShopCredentials(req.body.bodyshop);
if (shopCredentials.error) {
if (shopCredentials?.error) {
logger.log("intellipay-generate-payment-url-credentials-error", "ERROR", req.user?.email, null, {
message: shopCredentials.error?.message,
...logResponseMeta
});
res.status(400).json({
return res.status(400).json({
message: shopCredentials.error?.message,
type: "intellipay-generate-payment-url-credentials-error",
...logResponseMeta
});
return;
}
try {
@@ -235,7 +213,10 @@ exports.generate_payment_url = async (req, res) => {
invoice: req.body.invoice,
createshorturl: true
}),
url: `https://${domain}.cpteller.com/api/custapi.cfc?method=generate_lightbox_url`
url: getCptellerUrl({
apiType: "custapi",
params: { method: "generate_lightbox_url" }
})
};
logger.log("intellipay-generate-payment-url-options-prepared", "DEBUG", req.user?.email, null, {
@@ -251,18 +232,25 @@ exports.generate_payment_url = async (req, res) => {
...logResponseMeta
});
res.send(response.data);
return res.send(response.data);
} catch (error) {
logger.log("intellipay-generate-payment-url-error", "ERROR", req.user?.email, null, {
message: error?.message,
...logResponseMeta
});
res.status(500).json({ message: error?.message, ...logResponseMeta });
return res.status(500).json({ message: error?.message, ...logResponseMeta });
}
};
//Reference: https://intellipay.com/dist/webapi26.html#operation/fee
exports.checkfee = async (req, res) => {
/**
* @description Check the fee for a given amount
* Reference: https://intellipay.com/dist/webapi26.html#operation/fee
* @param req
* @param res
* @returns {Promise<void>}
*/
const checkFee = async (req, res) => {
const logResponseMeta = {
bodyshop: {
id: req.body?.bodyshop?.id,
@@ -275,24 +263,24 @@ exports.checkfee = async (req, res) => {
logger.log("intellipay-checkfee-request-received", "DEBUG", req.user?.email, null, logResponseMeta);
if (!req.body.amount || req.body.amount <= 0) {
if (!isNumber(req.body?.amount) || req.body?.amount <= 0) {
logger.log("intellipay-checkfee-skip", "DEBUG", req.user?.email, null, {
message: "Amount is zero or undefined, skipping fee check.",
...logResponseMeta
});
res.json({ fee: 0 });
return;
return res.json({ fee: 0 });
}
const shopCredentials = await getShopCredentials(req.body.bodyshop);
if (shopCredentials.error) {
if (shopCredentials?.error) {
logger.log("intellipay-checkfee-credentials-error", "ERROR", req.user?.email, null, {
message: shopCredentials.error?.message,
...logResponseMeta
});
res.status(400).json({ error: shopCredentials.error?.message, ...logResponseMeta });
return;
return res.status(400).json({ error: shopCredentials.error?.message, ...logResponseMeta });
}
try {
@@ -313,7 +301,7 @@ exports.checkfee = async (req, res) => {
},
{ sort: false } // Ensure query string order is preserved
),
url: `https://${domain}.cpteller.com/api/26/webapi.cfc`
url: getCptellerUrl({ apiType: "webapi", version: "26" })
};
logger.log("intellipay-checkfee-options-prepared", "DEBUG", req.user?.email, null, {
@@ -328,200 +316,92 @@ exports.checkfee = async (req, res) => {
message: response.data?.error,
...logResponseMeta
});
res.status(400).json({
return res.status(400).json({
error: response.data?.error,
type: "intellipay-checkfee-api-error",
...logResponseMeta
});
} else if (response.data < 0) {
}
if (response.data < 0) {
logger.log("intellipay-checkfee-negative-fee", "ERROR", req.user?.email, null, {
message: "Fee amount returned is negative.",
...logResponseMeta
});
res.json({
return res.json({
error: "Fee amount negative. Check API credentials & account configuration.",
...logResponseMeta,
type: "intellipay-checkfee-negative-fee"
});
} else {
logger.log("intellipay-checkfee-success", "DEBUG", req.user?.email, null, {
fee: response.data,
...logResponseMeta
});
res.json({ fee: response.data, ...logResponseMeta });
}
logger.log("intellipay-checkfee-success", "DEBUG", req.user?.email, null, {
fee: response.data,
...logResponseMeta
});
return res.json({ fee: response.data, ...logResponseMeta });
} catch (error) {
logger.log("intellipay-checkfee-error", "ERROR", req.user?.email, null, {
message: error?.message,
...logResponseMeta
});
res.status(500).json({ error: error?.message, logResponseMeta });
return res.status(500).json({ error: error?.message, logResponseMeta });
}
};
exports.postback = async (req, res) => {
/**
* @description Handle the postback from Intellipay
* @param req
* @param res
* @returns {Promise<void>}
*/
/**
* Handle the postback from Intellipay payment system
*/
const postBack = async (req, res) => {
const { body: values } = req;
const decodedComment = decodeComment(values?.comment);
const logMeta = { iprequest: values, decodedComment };
const logResponseMeta = {
iprequest: values,
decodedComment
};
logger.log("intellipay-postback-received", "DEBUG", "api", null, logResponseMeta);
logger.log("intellipay-postback-received", "DEBUG", "api", null, logMeta);
try {
if ((!values.invoice || values.invoice === "") && !decodedComment) {
//invoice is specified through the pay link. Comment by IO.
// Handle empty/invalid requests
if (isEmpty(values?.invoice) && !decodedComment) {
logger.log("intellipay-postback-ignored", "DEBUG", "api", null, {
message: "No invoice or comment provided",
...logResponseMeta
...logMeta
});
res.sendStatus(200);
return;
return res.sendStatus(200);
}
// Process payment based on data type
if (decodedComment) {
//Shifted the order to have this first to retain backwards compatibility for the old style of short link.
//This has been triggered by IO and may have multiple jobs.
const parsedComment = decodedComment;
logger.log("intellipay-postback-parsed-comment", "DEBUG", "api", null, {
parsedComment,
...logResponseMeta
});
//Adding in the user email to the short pay email.
//Need to check this to ensure backwards compatibility for clients that don't update.
const partialPayments = Array.isArray(parsedComment) ? parsedComment : parsedComment.payments;
// Fetch jobs by job IDs
const jobs = await gqlClient.request(queries.GET_JOBS_BY_PKS, {
ids: partialPayments.map((p) => p.jobid)
});
const bodyshop = await gqlClient.request(queries.GET_BODYSHOP_BY_ID, {
id: jobs.jobs[0].shopid
});
const ipMapping = bodyshop.bodyshops_by_pk.intellipay_config?.payment_map;
logger.log("intellipay-postback-jobs-fetched", "DEBUG", "api", null, {
jobs,
parsedComment,
...logResponseMeta
});
// Insert new payments
const paymentResult = await gqlClient.request(queries.INSERT_NEW_PAYMENT, {
paymentInput: partialPayments.map((p) => ({
amount: p.amount,
transactionid: values.authcode,
payer: "Customer",
type: ipMapping ? ipMapping[(values.cardtype || "").toLowerCase()] || values.cardtype : values.cardtype,
jobid: p.jobid,
date: moment(Date.now()),
payment_responses: {
data: {
amount: values.total,
bodyshopid: bodyshop.bodyshops_by_pk.id,
jobid: p.jobid,
declinereason: "Approved",
ext_paymentid: values.paymentid,
successful: true,
response: values
}
}
}))
});
logger.log("intellipay-postback-payment-success", "DEBUG", "api", null, {
paymentResult,
jobs,
parsedComment,
...logResponseMeta
});
if (values.origin === "OneLink" && parsedComment.userEmail) {
sendTaskEmail({
to: parsedComment.userEmail,
subject: `New Payment(s) Received - RO ${jobs.jobs.map((j) => j.ro_number).join(", ")}`,
type: "html",
html: generateEmailTemplate({
header: "New Payment(s) Received",
subHeader: "",
body: jobs.jobs
.map(
(job) =>
`Reference: <a href="${InstanceEndpoints()}/manage/jobs/${job.id}">${job.ro_number || "N/A"}</a> | ${job.ownr_co_nm ? job.ownr_co_nm : `${job.ownr_fn || ""} ${job.ownr_ln || ""}`.trim()} | ${`${job.v_model_yr || ""} ${job.v_make_desc || ""} ${job.v_model_desc || ""}`.trim()} | $${partialPayments.find((p) => p.jobid === job.id).amount}`
)
.join("<br/>")
})
}).catch((error) => {
logger.log("intellipay-postback-email-error", "ERROR", "api", null, {
message: error.message,
jobs,
paymentResult,
...logResponseMeta
});
});
}
res.sendStatus(200);
} else if (values.invoice) {
const job = await gqlClient.request(queries.GET_JOB_BY_PK, {
id: values.invoice
});
const bodyshop = await gqlClient.request(queries.GET_BODYSHOP_BY_ID, {
id: job.jobs_by_pk.shopid
});
const ipMapping = bodyshop.bodyshops_by_pk.intellipay_config?.payment_map;
logger.log("intellipay-postback-invoice-job-fetched", "DEBUG", "api", null, {
job,
bodyshop,
...logResponseMeta
});
const paymentResult = await gqlClient.request(queries.INSERT_NEW_PAYMENT, {
paymentInput: {
amount: values.total,
transactionid: values.authcode,
payer: "Customer",
type: ipMapping ? ipMapping[(values.cardtype || "").toLowerCase()] || values.cardtype : values.cardtype,
jobid: values.invoice,
date: moment(Date.now())
}
});
logger.log("intellipay-postback-invoice-payment-success", "DEBUG", "api", null, {
paymentResult,
...logResponseMeta
});
const responseResults = await gqlClient.request(queries.INSERT_PAYMENT_RESPONSE, {
paymentResponse: {
amount: values.total,
bodyshopid: bodyshop.bodyshops_by_pk.id,
paymentid: paymentResult.id,
jobid: values.invoice,
declinereason: "Approved",
ext_paymentid: values.paymentid,
successful: true,
response: values
}
});
logger.log("intellipay-postback-invoice-response-success", "DEBUG", "api", null, {
responseResults,
...logResponseMeta
});
res.sendStatus(200);
return await handleCommentBasedPayment(values, decodedComment, logger, logMeta, res);
} else if (values?.invoice) {
return await handleInvoiceBasedPayment(values, logger, logMeta, res);
} else {
// This should be caught by first validation, but as a safeguard
logValidationError("intellipay-postback-invalid", "No valid invoice or comment provided", logMeta);
return res.status(400).send("Bad Request: No valid invoice or comment provided");
}
} catch (error) {
logger.log("intellipay-postback-error", "ERROR", "api", null, {
message: error?.message,
...logResponseMeta
...logMeta
});
res.status(400).json({ successful: false, error: error.message, ...logResponseMeta });
return res.status(400).json({ successful: false, error: error.message, ...logMeta });
}
};
module.exports = {
lightboxCredentials,
paymentRefund,
generatePaymentUrl,
checkFee,
postBack
};

View File

@@ -0,0 +1,14 @@
/**
* @description Decode the comment from base64
* @param comment
* @returns {any|null}
*/
const decodeComment = (comment) => {
try {
return comment ? JSON.parse(Buffer.from(comment, "base64").toString()) : null;
} catch (error) {
return null; // Handle malformed base64 string gracefully
}
};
module.exports = decodeComment;

View File

@@ -0,0 +1,34 @@
/**
* Generates a properly formatted Cpteller API URL
* @param {Object} options - URL configuration options
* @param {string} options.apiType - 'webapi' or 'custapi'
* @param {string} [options.version] - API version (e.g., '26' for webapi)
* @param {Object} [options.params] - URL query parameters
* @returns {string} - The formatted Cpteller URL
*/
const getCptellerUrl = (options) => {
const domain = process.env?.NODE_ENV === "production" ? "secure" : "test";
const { apiType = "webapi", version, params = {} } = options;
// Base URL construction
let url = `https://${domain}.cpteller.com/api/`;
// Add version if specified for webapi
if (apiType === "webapi" && version) {
url += `${version}/`;
}
// Add the API endpoint
url += `${apiType}.cfc`;
// Add query parameters if any exist
const queryParams = new URLSearchParams(params).toString();
if (queryParams) {
url += `?${queryParams}`;
}
return url;
};
module.exports = getCptellerUrl;

View File

@@ -0,0 +1,12 @@
/**
* @description Get payment type based on IP mapping
* @param ipMapping
* @param cardType
* @returns {*}
*/
const getPaymentType = (ipMapping, cardType) => {
const normalizedCardType = (cardType || "").toLowerCase();
return ipMapping ? ipMapping[normalizedCardType] || cardType : cardType;
};
module.exports = getPaymentType;

View File

@@ -0,0 +1,40 @@
const { SecretsManagerClient, GetSecretValueCommand } = require("@aws-sdk/client-secrets-manager");
const { InstanceRegion } = require("../../utils/instanceMgr");
const client = new SecretsManagerClient({
region: InstanceRegion()
});
/**
* @description Get shop credentials from AWS Secrets Manager
* @param bodyshop
* @returns {Promise<{error}|{merchantkey: *, apikey: *}|any>}
*/
const getShopCredentials = async (bodyshop) => {
// In Dev/Testing we will use the environment variables
if (process.env?.NODE_ENV !== "production") {
return {
merchantkey: process.env.INTELLIPAY_MERCHANTKEY,
apikey: process.env.INTELLIPAY_APIKEY
};
}
// In Production, we will use the AWS Secrets Manager
if (bodyshop?.imexshopid) {
try {
const secret = await client.send(
new GetSecretValueCommand({
SecretId: `intellipay-credentials-${bodyshop.imexshopid}`,
VersionStage: "AWSCURRENT" // VersionStage defaults to AWSCURRENT if unspecified
})
);
return JSON.parse(secret.SecretString);
} catch (error) {
return {
error: error.message
};
}
}
};
module.exports = getShopCredentials;

View File

@@ -0,0 +1,81 @@
const sendPaymentNotificationEmail = require("./sendPaymentNotificationEmail");
const { INSERT_NEW_PAYMENT, GET_BODYSHOP_BY_ID, GET_JOBS_BY_PKS } = require("../../graphql-client/queries");
const getPaymentType = require("./getPaymentType");
const moment = require("moment");
const gqlClient = require("../../graphql-client/graphql-client").client;
/**
* @description Handle comment-based payment processing
* @param values
* @param decodedComment
* @param logger
* @param logMeta
* @param res
* @returns {Promise<*>}
*/
const handleCommentBasedPayment = async (values, decodedComment, logger, logMeta, res) => {
logger.log("intellipay-postback-parsed-comment", "DEBUG", "api", null, {
parsedComment: decodedComment,
...logMeta
});
const partialPayments = Array.isArray(decodedComment) ? decodedComment : decodedComment.payments;
// Fetch job data
const jobs = await gqlClient.request(GET_JOBS_BY_PKS, {
ids: partialPayments.map((p) => p.jobid)
});
// Fetch bodyshop data
const bodyshop = await gqlClient.request(GET_BODYSHOP_BY_ID, {
id: jobs.jobs[0].shopid
});
const ipMapping = bodyshop.bodyshops_by_pk.intellipay_config?.payment_map;
logger.log("intellipay-postback-jobs-fetched", "DEBUG", "api", null, {
jobs,
parsedComment: decodedComment,
...logMeta
});
// Create payment records
const paymentResult = await gqlClient.request(INSERT_NEW_PAYMENT, {
paymentInput: partialPayments.map((p) => ({
amount: p.amount,
transactionid: values.authcode,
payer: "Customer",
type: getPaymentType(ipMapping, values.cardtype),
jobid: p.jobid,
date: moment(Date.now()),
payment_responses: {
data: {
amount: values.total,
bodyshopid: bodyshop.bodyshops_by_pk.id,
jobid: p.jobid,
declinereason: "Approved",
ext_paymentid: values.paymentid,
successful: true,
response: values
}
}
}))
});
logger.log("intellipay-postback-payment-success", "DEBUG", "api", null, {
paymentResult,
jobs,
parsedComment: decodedComment,
...logMeta
});
// Send notification email if needed
if (values?.origin === "OneLink" && decodedComment?.userEmail) {
await sendPaymentNotificationEmail(decodedComment.userEmail, jobs, partialPayments, logger, logMeta);
}
return res.sendStatus(200);
};
module.exports = handleCommentBasedPayment;

View File

@@ -0,0 +1,101 @@
const handlePaymentValidationError = require("./handlePaymentValidationError");
const {
GET_JOBID_BY_MERCHANTID_RONUMBER,
INSERT_PAYMENT_RESPONSE,
INSERT_NEW_PAYMENT
} = require("../../graphql-client/queries");
const getPaymentType = require("./getPaymentType");
const moment = require("moment");
const gqlClient = require("../../graphql-client/graphql-client").client;
/**
* @description Handle invoice-based payment processing
* @param values
* @param logger
* @param logMeta
* @param res
* @returns {Promise<*>}
*/
const handleInvoiceBasedPayment = async (values, logger, logMeta, res) => {
// Validate required fields
if (!values.merchantid) {
return handlePaymentValidationError(
res,
logger,
"intellipay-postback-no-merchantid",
"Merchant ID is missing",
logMeta
);
}
// Fetch job data
const result = await gqlClient.request(GET_JOBID_BY_MERCHANTID_RONUMBER, {
merchantID: values.merchantid,
roNumber: values.invoice
});
if (!result?.jobs?.length) {
return handlePaymentValidationError(res, logger, "intellipay-postback-job-not-found", "Job not found", logMeta);
}
const job = result.jobs[0];
const bodyshop = job?.bodyshop;
if (!bodyshop) {
return handlePaymentValidationError(
res,
logger,
"intellipay-postback-bodyshop-not-found",
"Bodyshop not found",
logMeta
);
}
const ipMapping = bodyshop.intellipay_config?.payment_map;
logger.log("intellipay-postback-invoice-job-fetched", "DEBUG", "api", null, {
job,
...logMeta
});
// Create payment record
const paymentResult = await gqlClient.request(INSERT_NEW_PAYMENT, {
paymentInput: {
amount: values.total,
transactionid: values.authcode,
payer: "Customer",
type: getPaymentType(ipMapping, values.cardtype),
jobid: job.id,
date: moment(Date.now())
}
});
logger.log("intellipay-postback-invoice-payment-success", "DEBUG", "api", null, {
paymentResult,
...logMeta
});
// Create payment response record
const responseResults = await gqlClient.request(INSERT_PAYMENT_RESPONSE, {
paymentResponse: {
amount: values.total,
bodyshopid: bodyshop.id,
paymentid: paymentResult.id,
jobid: job.id,
declinereason: "Approved",
ext_paymentid: values.paymentid,
successful: true,
response: values
}
});
logger.log("intellipay-postback-invoice-response-success", "DEBUG", "api", null, {
responseResults,
...logMeta
});
return res.sendStatus(200);
};
module.exports = handleInvoiceBasedPayment;

View File

@@ -0,0 +1,18 @@
/**
* @description Log validation error and send response
* @param res
* @param logger
* @param logCode
* @param message
* @param logMeta
* @returns {*}
*/
const handlePaymentValidationError = (res, logger, logCode, message, logMeta) => {
logger.log(logCode, "ERROR", "api", null, {
message,
...logMeta
});
return res.status(400).send(`Bad Request: ${message}`);
};
module.exports = handlePaymentValidationError;

View File

@@ -0,0 +1,41 @@
const { sendTaskEmail } = require("../../email/sendemail");
const generateEmailTemplate = require("../../email/generateTemplate");
/**
* @description Send notification email to the user
* @param userEmail
* @param jobs
* @param partialPayments
* @param logger
* @param logMeta
* @returns {Promise<void>}
*/
const sendPaymentNotificationEmail = async (userEmail, jobs, partialPayments, logger, logMeta) => {
try {
await sendTaskEmail({
to: userEmail,
subject: `New Payment(s) Received - RO ${jobs.jobs.map((j) => j.ro_number).join(", ")}`,
type: "html",
html: generateEmailTemplate({
header: "New Payment(s) Received",
subHeader: "",
body: jobs.jobs
.map(
(job) =>
`Reference: <a href="${InstanceEndpoints()}/manage/jobs/${job.id}">${job.ro_number || "N/A"}</a> | ${
job.ownr_co_nm ? job.ownr_co_nm : `${job.ownr_fn || ""} ${job.ownr_ln || ""}`.trim()
} | ${`${job.v_model_yr || ""} ${job.v_make_desc || ""} ${job.v_model_desc || ""}`.trim()} | $${partialPayments.find((p) => p.jobid === job.id).amount}`
)
.join("<br/>")
})
});
} catch (error) {
logger.log("intellipay-postback-email-error", "ERROR", "api", null, {
message: error.message,
jobs,
...logMeta
});
}
};
module.exports = sendPaymentNotificationEmail;

View File

@@ -0,0 +1,152 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import mockRequire from "mock-require";
const gqlRequestMock = { request: vi.fn() };
const getPaymentTypeMock = vi.fn(() => "American Express");
const sendPaymentNotificationEmailMock = vi.fn();
let handleCommentBasedPayment;
beforeEach(() => {
vi.resetModules();
vi.clearAllMocks();
// Mock dependencies using mock-require BEFORE requiring the target module
mockRequire("../../../graphql-client/graphql-client", {
client: gqlRequestMock
});
mockRequire("../getPaymentType", getPaymentTypeMock);
mockRequire("../sendPaymentNotificationEmail", sendPaymentNotificationEmailMock);
// Now require the module under test
handleCommentBasedPayment = require("../handleCommentBasedPayment");
// Chain your GraphQL mocks
gqlRequestMock.request
.mockResolvedValueOnce({
jobs: [
{
id: "c1ffe09c-e7d4-46b3-aac5-f23e39563181",
shopid: "bfec8c8c-b7f1-49e0-be4c-524455f4e582"
}
]
})
.mockResolvedValueOnce({
bodyshops_by_pk: {
id: "bfec8c8c-b7f1-49e0-be4c-524455f4e582",
intellipay_config: {
payment_map: {
amex: "American Express"
}
}
}
})
.mockResolvedValueOnce({
insert_payments: {
returning: [{ id: "5dfda3c4-c0a6-4b09-a73d-176ed0ac6499" }]
}
});
});
describe("handleCommentBasedPayment", () => {
const mockLogger = { log: vi.fn() };
const mockRes = { sendStatus: vi.fn() };
const values = {
authcode: "5557301",
total: "0.01",
origin: "Dejavoo",
paymentid: "24294378",
cardtype: "Amex"
};
const decodedComment = {
payments: [{ jobid: "c1ffe09c-e7d4-46b3-aac5-f23e39563181", amount: 0.01 }],
userEmail: "test@example.com"
};
const logMeta = { op: "xyz123" };
it("processes comment-based payment and returns 200", async () => {
await handleCommentBasedPayment(values, decodedComment, mockLogger, logMeta, mockRes);
expect(gqlRequestMock.request).toHaveBeenCalledTimes(3);
expect(getPaymentTypeMock).toHaveBeenCalledWith({ amex: "American Express" }, "Amex");
expect(sendPaymentNotificationEmailMock).not.toHaveBeenCalled();
expect(mockRes.sendStatus).toHaveBeenCalledWith(200);
});
it("sends notification if origin is OneLink and userEmail exists", async () => {
const oneLinkValues = { ...values, origin: "OneLink" };
await handleCommentBasedPayment(oneLinkValues, decodedComment, mockLogger, logMeta, mockRes);
expect(sendPaymentNotificationEmailMock).toHaveBeenCalledWith(
"test@example.com",
expect.anything(),
expect.anything(),
mockLogger,
logMeta
);
expect(mockRes.sendStatus).toHaveBeenCalledWith(200);
});
it("handles decodedComment as a direct array", async () => {
const arrayComment = [{ jobid: "c1ffe09c-e7d4-46b3-aac5-f23e39563181", amount: 0.01 }];
await handleCommentBasedPayment(values, arrayComment, mockLogger, logMeta, mockRes);
expect(gqlRequestMock.request).toHaveBeenCalledTimes(3);
expect(mockRes.sendStatus).toHaveBeenCalledWith(200);
});
it("does not send email if origin is OneLink but userEmail is missing", async () => {
const commentWithoutEmail = {
payments: decodedComment.payments
// no userEmail
};
const oneLinkValues = { ...values, origin: "OneLink" };
await handleCommentBasedPayment(oneLinkValues, commentWithoutEmail, mockLogger, logMeta, mockRes);
expect(sendPaymentNotificationEmailMock).not.toHaveBeenCalled();
expect(mockRes.sendStatus).toHaveBeenCalledWith(200);
});
it("logs important stages of the process", async () => {
await handleCommentBasedPayment(values, decodedComment, mockLogger, logMeta, mockRes);
const logCalls = mockLogger.log.mock.calls.map(([tag]) => tag);
expect(logCalls).toContain("intellipay-postback-parsed-comment");
expect(logCalls).toContain("intellipay-postback-payment-success");
});
it("handles missing payment_map safely", async () => {
gqlRequestMock.request.mockReset(); // 🧹 Clear previous .mockResolvedValueOnce calls
gqlRequestMock.request
.mockResolvedValueOnce({
jobs: [{ id: "job1", shopid: "shop1" }]
})
.mockResolvedValueOnce({
bodyshops_by_pk: {
id: "shop1",
intellipay_config: null
}
})
.mockResolvedValueOnce({
insert_payments: {
returning: [{ id: "payment1" }]
}
});
await handleCommentBasedPayment(values, decodedComment, mockLogger, logMeta, mockRes);
expect(getPaymentTypeMock).toHaveBeenCalledWith(undefined, "Amex");
expect(mockRes.sendStatus).toHaveBeenCalledWith(200);
});
});

View File

@@ -0,0 +1,129 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import mockRequire from "mock-require";
const gqlRequestMock = { request: vi.fn() };
const getPaymentTypeMock = vi.fn(() => "Visa");
const handlePaymentValidationErrorMock = vi.fn();
let handleInvoiceBasedPayment;
beforeEach(() => {
vi.resetModules();
vi.clearAllMocks();
mockRequire("../../../graphql-client/graphql-client", {
client: gqlRequestMock
});
mockRequire("../getPaymentType", getPaymentTypeMock);
mockRequire("../handlePaymentValidationError", handlePaymentValidationErrorMock);
handleInvoiceBasedPayment = require("../handleInvoiceBasedPayment");
gqlRequestMock.request
.mockResolvedValueOnce({
jobs: [
{
id: "job123",
bodyshop: {
id: "shop123",
intellipay_config: {
payment_map: {
visa: "Visa"
}
}
}
}
]
})
.mockResolvedValueOnce({
id: "payment123"
})
.mockResolvedValueOnce({
insert_payment_response: {
returning: [{ id: "response123" }]
}
});
});
describe("handleInvoiceBasedPayment", () => {
const mockLogger = { log: vi.fn() };
const mockRes = { sendStatus: vi.fn() };
const values = {
merchantid: "m123",
invoice: "INV-001",
total: 100.0,
authcode: "AUTH123",
cardtype: "visa",
paymentid: "P789"
};
const logMeta = { op: "abc123" };
it("processes a valid invoice-based payment", async () => {
await handleInvoiceBasedPayment(values, mockLogger, logMeta, mockRes);
expect(gqlRequestMock.request).toHaveBeenCalledTimes(3);
expect(getPaymentTypeMock).toHaveBeenCalledWith({ visa: "Visa" }, "visa");
expect(mockRes.sendStatus).toHaveBeenCalledWith(200);
expect(handlePaymentValidationErrorMock).not.toHaveBeenCalled();
});
it("handles missing merchantid with validation error", async () => {
const invalidValues = { ...values, merchantid: undefined };
await handleInvoiceBasedPayment(invalidValues, mockLogger, logMeta, mockRes);
expect(handlePaymentValidationErrorMock).toHaveBeenCalledWith(
mockRes,
mockLogger,
"intellipay-postback-no-merchantid",
"Merchant ID is missing",
logMeta
);
expect(gqlRequestMock.request).not.toHaveBeenCalled();
});
it("handles job not found with validation error", async () => {
gqlRequestMock.request.mockReset();
gqlRequestMock.request.mockResolvedValueOnce({ jobs: [] });
await handleInvoiceBasedPayment(values, mockLogger, logMeta, mockRes);
expect(handlePaymentValidationErrorMock).toHaveBeenCalledWith(
mockRes,
mockLogger,
"intellipay-postback-job-not-found",
"Job not found",
logMeta
);
});
it("handles missing bodyshop with validation error", async () => {
gqlRequestMock.request.mockReset();
gqlRequestMock.request.mockResolvedValueOnce({
jobs: [{ id: "job123", bodyshop: null }]
});
await handleInvoiceBasedPayment(values, mockLogger, logMeta, mockRes);
expect(handlePaymentValidationErrorMock).toHaveBeenCalledWith(
mockRes,
mockLogger,
"intellipay-postback-bodyshop-not-found",
"Bodyshop not found",
logMeta
);
});
it("logs all expected stages of the process", async () => {
await handleInvoiceBasedPayment(values, mockLogger, logMeta, mockRes);
const logTags = mockLogger.log.mock.calls.map(([tag]) => tag);
expect(logTags).toContain("intellipay-postback-invoice-job-fetched");
expect(logTags).toContain("intellipay-postback-invoice-payment-success");
expect(logTags).toContain("intellipay-postback-invoice-response-success");
});
});

View File

@@ -0,0 +1,277 @@
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
const getPaymentType = require("../getPaymentType");
const decodeComment = require("../decodeComment");
const getCptellerUrl = require("../getCptellerUrl");
const handlePaymentValidationError = require("../handlePaymentValidationError");
const getShopCredentials = require("../getShopCredentials");
describe("Payment Processing Functions", () => {
// DecodeComment Tests
describe("decodeComment", () => {
it("decodes a valid base64-encoded JSON comment", () => {
const encoded = "eyJ0ZXN0IjoiZGF0YSJ9";
const expected = { test: "data" };
expect(decodeComment(encoded)).toEqual(expected);
});
it("decodes a complex base64-encoded JSON with payments", () => {
const encoded = "eyJwYXltZW50cyI6W3siam9iaWQiOiIxMjMifV19";
const expected = { payments: [{ jobid: "123" }] };
expect(decodeComment(encoded)).toEqual(expected);
});
it("returns null when comment is null", () => {
expect(decodeComment(null)).toBeNull();
});
it("returns null when comment is undefined", () => {
expect(decodeComment(undefined)).toBeNull();
});
it("returns null when comment is an empty string", () => {
expect(decodeComment("")).toBeNull();
});
it("returns null when comment is malformed base64", () => {
expect(decodeComment("!@#$%")).toBeNull();
});
it("returns null when comment is valid base64 but not valid JSON", () => {
expect(decodeComment("aW52YWxpZA==")).toBeNull();
});
});
// GetPaymentType Tests
describe("getPaymentType", () => {
it("returns mapped value when card type exists in mapping", () => {
const ipMapping = { visa: "Visa Card", amex: "American Express" };
expect(getPaymentType(ipMapping, "visa")).toBe("Visa Card");
});
it("returns original value when card type not in mapping", () => {
const ipMapping = { visa: "Visa Card" };
expect(getPaymentType(ipMapping, "mastercard")).toBe("mastercard");
});
it("handles lowercase conversion", () => {
const ipMapping = { visa: "Visa Card" };
expect(getPaymentType(ipMapping, "VISA")).toBe("Visa Card");
});
it("handles null mapping", () => {
expect(getPaymentType(null, "visa")).toBe("visa");
});
it("handles undefined mapping", () => {
expect(getPaymentType(undefined, "visa")).toBe("visa");
});
it("handles empty string card type", () => {
const ipMapping = { visa: "Visa Card" };
expect(getPaymentType(ipMapping, "")).toBe("");
});
it("handles undefined card type", () => {
const ipMapping = { visa: "Visa Card" };
expect(getPaymentType(ipMapping, undefined)).toBe(undefined);
});
});
// GetCptellerUrl Tests
describe("getCptellerUrl", () => {
const originalEnv = process.env.NODE_ENV;
afterEach(() => {
process.env.NODE_ENV = originalEnv;
});
it("uses test domain in non-production environment", () => {
process.env.NODE_ENV = "";
const url = getCptellerUrl({ apiType: "webapi" });
expect(url).toEqual("https://test.cpteller.com/api/webapi.cfc");
});
it("uses secure domain in production environment", () => {
process.env.NODE_ENV = "production";
const url = getCptellerUrl({ apiType: "webapi" });
expect(url).toEqual("https://secure.cpteller.com/api/webapi.cfc");
});
it("adds version number for webapi type", () => {
process.env.NODE_ENV = "";
const url = getCptellerUrl({ apiType: "webapi", version: "26" });
expect(url).toEqual("https://test.cpteller.com/api/26/webapi.cfc");
});
it("constructs custapi URL without version number", () => {
process.env.NODE_ENV = "";
const url = getCptellerUrl({ apiType: "custapi", version: "26" });
expect(url).toEqual("https://test.cpteller.com/api/custapi.cfc");
});
it("adds query parameters to the URL", () => {
process.env.NODE_ENV = "";
const url = getCptellerUrl({
apiType: "webapi",
params: { method: "payment_refund", test: "value" }
});
expect(url).toEqual("https://test.cpteller.com/api/webapi.cfc?method=payment_refund&test=value");
});
it("handles empty params object", () => {
process.env.NODE_ENV = "";
const url = getCptellerUrl({ apiType: "webapi", params: {} });
expect(url).toEqual("https://test.cpteller.com/api/webapi.cfc");
});
it("defaults to webapi when no apiType is provided", () => {
process.env.NODE_ENV = "";
const url = getCptellerUrl({});
expect(url).toEqual("https://test.cpteller.com/api/webapi.cfc");
});
it("combines version and query parameters correctly", () => {
process.env.NODE_ENV = "";
const url = getCptellerUrl({
apiType: "webapi",
version: "26",
params: { method: "fee" }
});
expect(url).toEqual("https://test.cpteller.com/api/26/webapi.cfc?method=fee");
});
});
// GetShopCredentials Tests
describe("getShopCredentials", () => {
const originalEnv = { ...process.env };
let mockSend;
beforeEach(() => {
mockSend = vi.fn();
vi.mock("@aws-sdk/client-secrets-manager", () => {
return {
SecretsManagerClient: vi.fn(() => ({
send: mockSend
})),
GetSecretValueCommand: vi.fn((input) => input)
};
});
process.env.INTELLIPAY_MERCHANTKEY = "test-merchant-key";
process.env.INTELLIPAY_APIKEY = "test-api-key";
vi.resetModules();
});
afterEach(() => {
process.env = { ...originalEnv };
vi.restoreAllMocks();
vi.unmock("@aws-sdk/client-secrets-manager");
});
it("returns environment variables in non-production environment", async () => {
process.env.NODE_ENV = "development";
const result = await getShopCredentials({ imexshopid: "12345" });
expect(result).toEqual({
merchantkey: "test-merchant-key",
apikey: "test-api-key"
});
expect(mockSend).not.toHaveBeenCalled();
});
it("returns undefined when imexshopid is missing in production", async () => {
process.env.NODE_ENV = "production";
const result = await getShopCredentials({ name: "Test Shop" });
expect(result).toBeUndefined();
expect(mockSend).not.toHaveBeenCalled();
});
it("returns undefined for null bodyshop in production", async () => {
process.env.NODE_ENV = "production";
const result = await getShopCredentials(null);
expect(result).toBeUndefined();
expect(mockSend).not.toHaveBeenCalled();
});
it("returns undefined for undefined bodyshop in production", async () => {
process.env.NODE_ENV = "production";
const result = await getShopCredentials(undefined);
expect(result).toBeUndefined();
expect(mockSend).not.toHaveBeenCalled();
});
});
// HandlePaymentValidationError Tests
describe("handlePaymentValidationError", () => {
it("logs error and sends 400 response", () => {
const mockLog = vi.fn();
const mockLogger = { log: mockLog };
const mockRes = {
status: vi.fn().mockReturnThis(),
send: vi.fn().mockReturnThis()
};
const logCode = "test-validation-error";
const message = "Invalid data";
const logMeta = { field: "test", value: 123 };
const result = handlePaymentValidationError(mockRes, mockLogger, logCode, message, logMeta);
expect(mockLog).toHaveBeenCalledWith(logCode, "ERROR", "api", null, {
message,
...logMeta
});
expect(mockRes.status).toHaveBeenCalledWith(400);
expect(mockRes.send).toHaveBeenCalledWith(`Bad Request: ${message}`);
expect(result).toBe(mockRes);
});
it("formats different error messages correctly", () => {
const mockLog = vi.fn();
const mockLogger = { log: mockLog };
const mockRes = {
status: vi.fn().mockReturnThis(),
send: vi.fn().mockReturnThis()
};
handlePaymentValidationError(mockRes, mockLogger, "error-code", "Custom error");
expect(mockRes.send).toHaveBeenCalledWith("Bad Request: Custom error");
});
it("passes different logCodes to logger", () => {
const mockLog = vi.fn();
const mockLogger = { log: mockLog };
const mockRes = {
status: vi.fn().mockReturnThis(),
send: vi.fn().mockReturnThis()
};
handlePaymentValidationError(mockRes, mockLogger, "custom-log-code", "Error message");
expect(mockLog).toHaveBeenCalledWith("custom-log-code", "ERROR", "api", null, { message: "Error message" });
});
it("works with minimal logMeta", () => {
const mockLog = vi.fn();
const mockLogger = { log: mockLog };
const mockRes = {
status: vi.fn().mockReturnThis(),
send: vi.fn().mockReturnThis()
};
handlePaymentValidationError(mockRes, mockLogger, "error-code", "Error message", {});
expect(mockLog).toHaveBeenCalledWith("error-code", "ERROR", "api", null, { message: "Error message" });
});
it("works with undefined logMeta", () => {
const mockLog = vi.fn();
const mockLogger = { log: mockLog };
const mockRes = {
status: vi.fn().mockReturnThis(),
send: vi.fn().mockReturnThis()
};
handlePaymentValidationError(mockRes, mockLogger, "error-code", "Error message");
expect(mockLog).toHaveBeenCalledWith("error-code", "ERROR", "api", null, { message: "Error message" });
});
});
});

View File

@@ -1,12 +1,18 @@
const express = require("express");
const router = express.Router();
const validateFirebaseIdTokenMiddleware = require("../middleware/validateFirebaseIdTokenMiddleware");
const { lightbox_credentials, payment_refund, generate_payment_url, postback, checkfee } = require("../intellipay/intellipay");
const {
lightboxCredentials,
paymentRefund,
generatePaymentUrl,
postBack,
checkFee
} = require("../intellipay/intellipay");
router.post("/lightbox_credentials", validateFirebaseIdTokenMiddleware, lightbox_credentials);
router.post("/payment_refund", validateFirebaseIdTokenMiddleware, payment_refund);
router.post("/generate_payment_url", validateFirebaseIdTokenMiddleware, generate_payment_url);
router.post("/checkfee", validateFirebaseIdTokenMiddleware, checkfee);
router.post("/postback", postback);
router.post("/lightbox_credentials", validateFirebaseIdTokenMiddleware, lightboxCredentials);
router.post("/payment_refund", validateFirebaseIdTokenMiddleware, paymentRefund);
router.post("/generate_payment_url", validateFirebaseIdTokenMiddleware, generatePaymentUrl);
router.post("/checkfee", validateFirebaseIdTokenMiddleware, checkFee);
router.post("/postback", postBack);
module.exports = router;

View File

@@ -1,10 +1,13 @@
import { defineConfig } from "vitest/config";
const { defineConfig } = require("vitest/config");
export default defineConfig({
module.exports = defineConfig({
test: {
environment: "node",
globals: true,
include: ["./server/tests/**/*.{test,spec}.[jt]s"], // Only search /tests in root
include: [
"./server/tests/**/*.{test,spec}.[jt]s", // Existing pattern for /server/tests
"./server/**/*.test.js" // New pattern for test.js in server and subfolders
],
exclude: ["**/client/**", "**/node_modules/**", "**/dist/**"] // Explicitly exclude /client
}
});