Merge pull request #1339 from OpenSignLabs/validation

This commit is contained in:
Andrew
2024-10-14 16:16:29 +05:30
committed by GitHub
12 changed files with 707 additions and 570 deletions
+139 -180
View File
@@ -9,14 +9,14 @@
"version": "0.1.0",
"dependencies": {
"@formkit/auto-animate": "^0.8.2",
"@lottiefiles/dotlottie-react": "^0.9.0",
"@lottiefiles/dotlottie-react": "^0.9.1",
"@pdf-lib/fontkit": "^1.1.1",
"@radix-ui/themes": "^3.1.4",
"@react-pdf/renderer": "^4.0.0",
"@reduxjs/toolkit": "^2.2.7",
"@reduxjs/toolkit": "^2.2.8",
"axios": "^1.7.7",
"file-saver": "^2.0.5",
"i18next": "^23.15.2",
"i18next": "^23.16.0",
"i18next-browser-languagedetector": "^8.0.0",
"i18next-http-backend": "^2.6.2",
"jszip": "^3.10.1",
@@ -30,7 +30,7 @@
"react": "^18.2.0",
"react-bootstrap": "^2.10.5",
"react-confetti": "^6.1.0",
"react-cookie": "^7.2.0",
"react-cookie": "^7.2.1",
"react-datepicker": "^7.4.0",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
@@ -39,13 +39,13 @@
"react-dom": "^18.2.0",
"react-gtm-module": "^2.0.11",
"react-helmet": "^6.1.0",
"react-i18next": "^15.0.2",
"react-i18next": "^15.0.3",
"react-konva": "^18.2.10",
"react-pdf": "^9.1.1",
"react-quill-new": "^3.3.3",
"react-redux": "^9.1.2",
"react-rnd": "^10.4.13",
"react-router-dom": "^6.26.2",
"react-router-dom": "^6.27.0",
"react-scripts": "5.0.1",
"react-scrollbars-custom": "^4.1.1",
"react-select": "^5.8.1",
@@ -63,8 +63,8 @@
"ws": "^8.18.0"
},
"devDependencies": {
"@babel/core": "^7.25.7",
"@babel/preset-env": "^7.25.7",
"@babel/core": "^7.25.8",
"@babel/preset-env": "^7.25.8",
"@babel/preset-react": "^7.25.7",
"@babel/runtime-corejs2": "^7.25.7",
"autoprefixer": "^10.4.20",
@@ -73,7 +73,7 @@
"commitizen": "^4.3.1",
"concurrently": "^9.0.1",
"css-loader": "^7.1.2",
"daisyui": "^4.12.12",
"daisyui": "^4.12.13",
"dotenv": "^16.4.5",
"dotenv-webpack": "^8.1.0",
"eslint": "^9.12.0",
@@ -144,17 +144,17 @@
}
},
"node_modules/@babel/compat-data": {
"version": "7.25.7",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.7.tgz",
"integrity": "sha512-9ickoLz+hcXCeh7jrcin+/SLWm+GkxE2kTvoYyp38p4WkdFXfQJxDFGWp/YHjiKLPx06z2A7W8XKuqbReXDzsw==",
"version": "7.25.8",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.8.tgz",
"integrity": "sha512-ZsysZyXY4Tlx+Q53XdnOFmqwfB9QDTHYxaZYajWRoBLuLEAwI2UIbtxOjWh/cFaa9IKUlcB+DDuoskLuKu56JA==",
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/core": {
"version": "7.25.7",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.25.7.tgz",
"integrity": "sha512-yJ474Zv3cwiSOO9nXJuqzvwEeM+chDuQ8GJirw+pZ91sCGCyOZ3dJkVE09fTV0VEVzXyLWhh3G/AolYTPX7Mow==",
"version": "7.25.8",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.25.8.tgz",
"integrity": "sha512-Oixnb+DzmRT30qu9d3tJSQkxuygWm32DFykT4bRoORPa9hZ/L4KhVB/XiRm6KG+roIEM7DBQlmg27kw2HZkdZg==",
"dependencies": {
"@ampproject/remapping": "^2.2.0",
"@babel/code-frame": "^7.25.7",
@@ -162,10 +162,10 @@
"@babel/helper-compilation-targets": "^7.25.7",
"@babel/helper-module-transforms": "^7.25.7",
"@babel/helpers": "^7.25.7",
"@babel/parser": "^7.25.7",
"@babel/parser": "^7.25.8",
"@babel/template": "^7.25.7",
"@babel/traverse": "^7.25.7",
"@babel/types": "^7.25.7",
"@babel/types": "^7.25.8",
"convert-source-map": "^2.0.0",
"debug": "^4.1.0",
"gensync": "^1.0.0-beta.2",
@@ -488,11 +488,11 @@
}
},
"node_modules/@babel/parser": {
"version": "7.25.7",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.7.tgz",
"integrity": "sha512-aZn7ETtQsjjGG5HruveUK06cU3Hljuhd9Iojm4M8WWv3wLE6OkE5PWbDUkItmMgegmccaITudyuW5RPYrYlgWw==",
"version": "7.25.8",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.8.tgz",
"integrity": "sha512-HcttkxzdPucv3nNFmfOOMfFf64KgdJVqm1KaCm25dPGMLElo9nsLvXeJECQg8UzPuBGLyTSA0ZzqCtDSzKTEoQ==",
"dependencies": {
"@babel/types": "^7.25.7"
"@babel/types": "^7.25.8"
},
"bin": {
"parser": "bin/babel-parser.js"
@@ -744,28 +744,6 @@
"@babel/core": "^7.0.0-0"
}
},
"node_modules/@babel/plugin-syntax-dynamic-import": {
"version": "7.8.3",
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz",
"integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==",
"dependencies": {
"@babel/helper-plugin-utils": "^7.8.0"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
}
},
"node_modules/@babel/plugin-syntax-export-namespace-from": {
"version": "7.8.3",
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz",
"integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==",
"dependencies": {
"@babel/helper-plugin-utils": "^7.8.3"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
}
},
"node_modules/@babel/plugin-syntax-flow": {
"version": "7.24.7",
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.24.7.tgz",
@@ -982,13 +960,12 @@
}
},
"node_modules/@babel/plugin-transform-async-generator-functions": {
"version": "7.25.7",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.7.tgz",
"integrity": "sha512-4B6OhTrwYKHYYgcwErvZjbmH9X5TxQBsaBHdzEIB4l71gR5jh/tuHGlb9in47udL2+wVUcOz5XXhhfhVJwEpEg==",
"version": "7.25.8",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.8.tgz",
"integrity": "sha512-9ypqkozyzpG+HxlH4o4gdctalFGIjjdufzo7I2XPda0iBnZ6a+FO0rIEQcdSPXp02CkvGsII1exJhmROPQd5oA==",
"dependencies": {
"@babel/helper-plugin-utils": "^7.25.7",
"@babel/helper-remap-async-to-generator": "^7.25.7",
"@babel/plugin-syntax-async-generators": "^7.8.4",
"@babel/traverse": "^7.25.7"
},
"engines": {
@@ -1058,13 +1035,12 @@
}
},
"node_modules/@babel/plugin-transform-class-static-block": {
"version": "7.25.7",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.25.7.tgz",
"integrity": "sha512-rvUUtoVlkDWtDWxGAiiQj0aNktTPn3eFynBcMC2IhsXweehwgdI9ODe+XjWw515kEmv22sSOTp/rxIRuTiB7zg==",
"version": "7.25.8",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.25.8.tgz",
"integrity": "sha512-e82gl3TCorath6YLf9xUwFehVvjvfqFhdOo4+0iVIVju+6XOi5XHkqB3P2AXnSwoeTX0HBoXq5gJFtvotJzFnQ==",
"dependencies": {
"@babel/helper-create-class-features-plugin": "^7.25.7",
"@babel/helper-plugin-utils": "^7.25.7",
"@babel/plugin-syntax-class-static-block": "^7.14.5"
"@babel/helper-plugin-utils": "^7.25.7"
},
"engines": {
"node": ">=6.9.0"
@@ -1166,12 +1142,11 @@
}
},
"node_modules/@babel/plugin-transform-dynamic-import": {
"version": "7.25.7",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.25.7.tgz",
"integrity": "sha512-UvcLuual4h7/GfylKm2IAA3aph9rwvAM2XBA0uPKU3lca+Maai4jBjjEVUS568ld6kJcgbouuumCBhMd/Yz17w==",
"version": "7.25.8",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.25.8.tgz",
"integrity": "sha512-gznWY+mr4ZQL/EWPcbBQUP3BXS5FwZp8RUOw06BaRn8tQLzN4XLIxXejpHN9Qo8x8jjBmAAKp6FoS51AgkSA/A==",
"dependencies": {
"@babel/helper-plugin-utils": "^7.25.7",
"@babel/plugin-syntax-dynamic-import": "^7.8.3"
"@babel/helper-plugin-utils": "^7.25.7"
},
"engines": {
"node": ">=6.9.0"
@@ -1196,12 +1171,11 @@
}
},
"node_modules/@babel/plugin-transform-export-namespace-from": {
"version": "7.25.7",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.25.7.tgz",
"integrity": "sha512-h3MDAP5l34NQkkNulsTNyjdaR+OiB0Im67VU//sFupouP8Q6m9Spy7l66DcaAQxtmCqGdanPByLsnwFttxKISQ==",
"version": "7.25.8",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.25.8.tgz",
"integrity": "sha512-sPtYrduWINTQTW7FtOy99VCTWp4H23UX7vYcut7S4CIMEXU+54zKX9uCoGkLsWXteyaMXzVHgzWbLfQ1w4GZgw==",
"dependencies": {
"@babel/helper-plugin-utils": "^7.25.7",
"@babel/plugin-syntax-export-namespace-from": "^7.8.3"
"@babel/helper-plugin-utils": "^7.25.7"
},
"engines": {
"node": ">=6.9.0"
@@ -1257,12 +1231,11 @@
}
},
"node_modules/@babel/plugin-transform-json-strings": {
"version": "7.25.7",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.25.7.tgz",
"integrity": "sha512-Ot43PrL9TEAiCe8C/2erAjXMeVSnE/BLEx6eyrKLNFCCw5jvhTHKyHxdI1pA0kz5njZRYAnMO2KObGqOCRDYSA==",
"version": "7.25.8",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.25.8.tgz",
"integrity": "sha512-4OMNv7eHTmJ2YXs3tvxAfa/I43di+VcF+M4Wt66c88EAED1RoGaf1D64cL5FkRpNL+Vx9Hds84lksWvd/wMIdA==",
"dependencies": {
"@babel/helper-plugin-utils": "^7.25.7",
"@babel/plugin-syntax-json-strings": "^7.8.3"
"@babel/helper-plugin-utils": "^7.25.7"
},
"engines": {
"node": ">=6.9.0"
@@ -1286,12 +1259,11 @@
}
},
"node_modules/@babel/plugin-transform-logical-assignment-operators": {
"version": "7.25.7",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.25.7.tgz",
"integrity": "sha512-iImzbA55BjiovLyG2bggWS+V+OLkaBorNvc/yJoeeDQGztknRnDdYfp2d/UPmunZYEnZi6Lg8QcTmNMHOB0lGA==",
"version": "7.25.8",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.25.8.tgz",
"integrity": "sha512-f5W0AhSbbI+yY6VakT04jmxdxz+WsID0neG7+kQZbCOjuyJNdL5Nn4WIBm4hRpKnUcO9lP0eipUhFN12JpoH8g==",
"dependencies": {
"@babel/helper-plugin-utils": "^7.25.7",
"@babel/plugin-syntax-logical-assignment-operators": "^7.10.4"
"@babel/helper-plugin-utils": "^7.25.7"
},
"engines": {
"node": ">=6.9.0"
@@ -1407,12 +1379,11 @@
}
},
"node_modules/@babel/plugin-transform-nullish-coalescing-operator": {
"version": "7.25.7",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.25.7.tgz",
"integrity": "sha512-FbuJ63/4LEL32mIxrxwYaqjJxpbzxPVQj5a+Ebrc8JICV6YX8nE53jY+K0RZT3um56GoNWgkS2BQ/uLGTjtwfw==",
"version": "7.25.8",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.25.8.tgz",
"integrity": "sha512-Z7WJJWdQc8yCWgAmjI3hyC+5PXIubH9yRKzkl9ZEG647O9szl9zvmKLzpbItlijBnVhTUf1cpyWBsZ3+2wjWPQ==",
"dependencies": {
"@babel/helper-plugin-utils": "^7.25.7",
"@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3"
"@babel/helper-plugin-utils": "^7.25.7"
},
"engines": {
"node": ">=6.9.0"
@@ -1422,12 +1393,11 @@
}
},
"node_modules/@babel/plugin-transform-numeric-separator": {
"version": "7.25.7",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.25.7.tgz",
"integrity": "sha512-8CbutzSSh4hmD+jJHIA8vdTNk15kAzOnFLVVgBSMGr28rt85ouT01/rezMecks9pkU939wDInImwCKv4ahU4IA==",
"version": "7.25.8",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.25.8.tgz",
"integrity": "sha512-rm9a5iEFPS4iMIy+/A/PiS0QN0UyjPIeVvbU5EMZFKJZHt8vQnasbpo3T3EFcxzCeYO0BHfc4RqooCZc51J86Q==",
"dependencies": {
"@babel/helper-plugin-utils": "^7.25.7",
"@babel/plugin-syntax-numeric-separator": "^7.10.4"
"@babel/helper-plugin-utils": "^7.25.7"
},
"engines": {
"node": ">=6.9.0"
@@ -1437,13 +1407,12 @@
}
},
"node_modules/@babel/plugin-transform-object-rest-spread": {
"version": "7.25.7",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.25.7.tgz",
"integrity": "sha512-1JdVKPhD7Y5PvgfFy0Mv2brdrolzpzSoUq2pr6xsR+m+3viGGeHEokFKsCgOkbeFOQxfB1Vt2F0cPJLRpFI4Zg==",
"version": "7.25.8",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.25.8.tgz",
"integrity": "sha512-LkUu0O2hnUKHKE7/zYOIjByMa4VRaV2CD/cdGz0AxU9we+VA3kDDggKEzI0Oz1IroG+6gUP6UmWEHBMWZU316g==",
"dependencies": {
"@babel/helper-compilation-targets": "^7.25.7",
"@babel/helper-plugin-utils": "^7.25.7",
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
"@babel/plugin-transform-parameters": "^7.25.7"
},
"engines": {
@@ -1469,12 +1438,11 @@
}
},
"node_modules/@babel/plugin-transform-optional-catch-binding": {
"version": "7.25.7",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.25.7.tgz",
"integrity": "sha512-m9obYBA39mDPN7lJzD5WkGGb0GO54PPLXsbcnj1Hyeu8mSRz7Gb4b1A6zxNX32ZuUySDK4G6it8SDFWD1nCnqg==",
"version": "7.25.8",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.25.8.tgz",
"integrity": "sha512-EbQYweoMAHOn7iJ9GgZo14ghhb9tTjgOc88xFgYngifx7Z9u580cENCV159M4xDh3q/irbhSjZVpuhpC2gKBbg==",
"dependencies": {
"@babel/helper-plugin-utils": "^7.25.7",
"@babel/plugin-syntax-optional-catch-binding": "^7.8.3"
"@babel/helper-plugin-utils": "^7.25.7"
},
"engines": {
"node": ">=6.9.0"
@@ -1484,13 +1452,12 @@
}
},
"node_modules/@babel/plugin-transform-optional-chaining": {
"version": "7.25.7",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.25.7.tgz",
"integrity": "sha512-h39agClImgPWg4H8mYVAbD1qP9vClFbEjqoJmt87Zen8pjqK8FTPUwrOXAvqu5soytwxrLMd2fx2KSCp2CHcNg==",
"version": "7.25.8",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.25.8.tgz",
"integrity": "sha512-q05Bk7gXOxpTHoQ8RSzGSh/LHVB9JEIkKnk3myAWwZHnYiTGYtbdrYkIsS8Xyh4ltKf7GNUSgzs/6P2bJtBAQg==",
"dependencies": {
"@babel/helper-plugin-utils": "^7.25.7",
"@babel/helper-skip-transparent-expression-wrappers": "^7.25.7",
"@babel/plugin-syntax-optional-chaining": "^7.8.3"
"@babel/helper-skip-transparent-expression-wrappers": "^7.25.7"
},
"engines": {
"node": ">=6.9.0"
@@ -1529,14 +1496,13 @@
}
},
"node_modules/@babel/plugin-transform-private-property-in-object": {
"version": "7.25.7",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.25.7.tgz",
"integrity": "sha512-LzA5ESzBy7tqj00Yjey9yWfs3FKy4EmJyKOSWld144OxkTji81WWnUT8nkLUn+imN/zHL8ZQlOu/MTUAhHaX3g==",
"version": "7.25.8",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.25.8.tgz",
"integrity": "sha512-8Uh966svuB4V8RHHg0QJOB32QK287NBksJOByoKmHMp1TAobNniNalIkI2i5IPj5+S9NYCG4VIjbEuiSN8r+ow==",
"dependencies": {
"@babel/helper-annotate-as-pure": "^7.25.7",
"@babel/helper-create-class-features-plugin": "^7.25.7",
"@babel/helper-plugin-utils": "^7.25.7",
"@babel/plugin-syntax-private-property-in-object": "^7.14.5"
"@babel/helper-plugin-utils": "^7.25.7"
},
"engines": {
"node": ">=6.9.0"
@@ -1831,11 +1797,11 @@
}
},
"node_modules/@babel/preset-env": {
"version": "7.25.7",
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.25.7.tgz",
"integrity": "sha512-Gibz4OUdyNqqLj+7OAvBZxOD7CklCtMA5/j0JgUEwOnaRULsPDXmic2iKxL2DX2vQduPR5wH2hjZas/Vr/Oc0g==",
"version": "7.25.8",
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.25.8.tgz",
"integrity": "sha512-58T2yulDHMN8YMUxiLq5YmWUnlDCyY1FsHM+v12VMx+1/FlrUj5tY50iDCpofFQEM8fMYOaY9YRvym2jcjn1Dg==",
"dependencies": {
"@babel/compat-data": "^7.25.7",
"@babel/compat-data": "^7.25.8",
"@babel/helper-compilation-targets": "^7.25.7",
"@babel/helper-plugin-utils": "^7.25.7",
"@babel/helper-validator-option": "^7.25.7",
@@ -1845,45 +1811,30 @@
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.25.7",
"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.25.7",
"@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2",
"@babel/plugin-syntax-async-generators": "^7.8.4",
"@babel/plugin-syntax-class-properties": "^7.12.13",
"@babel/plugin-syntax-class-static-block": "^7.14.5",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-syntax-export-namespace-from": "^7.8.3",
"@babel/plugin-syntax-import-assertions": "^7.25.7",
"@babel/plugin-syntax-import-attributes": "^7.25.7",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/plugin-syntax-json-strings": "^7.8.3",
"@babel/plugin-syntax-logical-assignment-operators": "^7.10.4",
"@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3",
"@babel/plugin-syntax-numeric-separator": "^7.10.4",
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
"@babel/plugin-syntax-optional-catch-binding": "^7.8.3",
"@babel/plugin-syntax-optional-chaining": "^7.8.3",
"@babel/plugin-syntax-private-property-in-object": "^7.14.5",
"@babel/plugin-syntax-top-level-await": "^7.14.5",
"@babel/plugin-syntax-unicode-sets-regex": "^7.18.6",
"@babel/plugin-transform-arrow-functions": "^7.25.7",
"@babel/plugin-transform-async-generator-functions": "^7.25.7",
"@babel/plugin-transform-async-generator-functions": "^7.25.8",
"@babel/plugin-transform-async-to-generator": "^7.25.7",
"@babel/plugin-transform-block-scoped-functions": "^7.25.7",
"@babel/plugin-transform-block-scoping": "^7.25.7",
"@babel/plugin-transform-class-properties": "^7.25.7",
"@babel/plugin-transform-class-static-block": "^7.25.7",
"@babel/plugin-transform-class-static-block": "^7.25.8",
"@babel/plugin-transform-classes": "^7.25.7",
"@babel/plugin-transform-computed-properties": "^7.25.7",
"@babel/plugin-transform-destructuring": "^7.25.7",
"@babel/plugin-transform-dotall-regex": "^7.25.7",
"@babel/plugin-transform-duplicate-keys": "^7.25.7",
"@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.25.7",
"@babel/plugin-transform-dynamic-import": "^7.25.7",
"@babel/plugin-transform-dynamic-import": "^7.25.8",
"@babel/plugin-transform-exponentiation-operator": "^7.25.7",
"@babel/plugin-transform-export-namespace-from": "^7.25.7",
"@babel/plugin-transform-export-namespace-from": "^7.25.8",
"@babel/plugin-transform-for-of": "^7.25.7",
"@babel/plugin-transform-function-name": "^7.25.7",
"@babel/plugin-transform-json-strings": "^7.25.7",
"@babel/plugin-transform-json-strings": "^7.25.8",
"@babel/plugin-transform-literals": "^7.25.7",
"@babel/plugin-transform-logical-assignment-operators": "^7.25.7",
"@babel/plugin-transform-logical-assignment-operators": "^7.25.8",
"@babel/plugin-transform-member-expression-literals": "^7.25.7",
"@babel/plugin-transform-modules-amd": "^7.25.7",
"@babel/plugin-transform-modules-commonjs": "^7.25.7",
@@ -1891,15 +1842,15 @@
"@babel/plugin-transform-modules-umd": "^7.25.7",
"@babel/plugin-transform-named-capturing-groups-regex": "^7.25.7",
"@babel/plugin-transform-new-target": "^7.25.7",
"@babel/plugin-transform-nullish-coalescing-operator": "^7.25.7",
"@babel/plugin-transform-numeric-separator": "^7.25.7",
"@babel/plugin-transform-object-rest-spread": "^7.25.7",
"@babel/plugin-transform-nullish-coalescing-operator": "^7.25.8",
"@babel/plugin-transform-numeric-separator": "^7.25.8",
"@babel/plugin-transform-object-rest-spread": "^7.25.8",
"@babel/plugin-transform-object-super": "^7.25.7",
"@babel/plugin-transform-optional-catch-binding": "^7.25.7",
"@babel/plugin-transform-optional-chaining": "^7.25.7",
"@babel/plugin-transform-optional-catch-binding": "^7.25.8",
"@babel/plugin-transform-optional-chaining": "^7.25.8",
"@babel/plugin-transform-parameters": "^7.25.7",
"@babel/plugin-transform-private-methods": "^7.25.7",
"@babel/plugin-transform-private-property-in-object": "^7.25.7",
"@babel/plugin-transform-private-property-in-object": "^7.25.8",
"@babel/plugin-transform-property-literals": "^7.25.7",
"@babel/plugin-transform-regenerator": "^7.25.7",
"@babel/plugin-transform-reserved-words": "^7.25.7",
@@ -2043,9 +1994,9 @@
}
},
"node_modules/@babel/types": {
"version": "7.25.7",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.7.tgz",
"integrity": "sha512-vwIVdXG+j+FOpkwqHRcBgHLYNL7XMkufrlaFvL9o6Ai9sJn9+PdyIL5qa0XzTZw084c+u9LOls53eoZWP/W5WQ==",
"version": "7.25.8",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.8.tgz",
"integrity": "sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==",
"dependencies": {
"@babel/helper-string-parser": "^7.25.7",
"@babel/helper-validator-identifier": "^7.25.7",
@@ -3684,11 +3635,11 @@
"integrity": "sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw=="
},
"node_modules/@lottiefiles/dotlottie-react": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/@lottiefiles/dotlottie-react/-/dotlottie-react-0.9.0.tgz",
"integrity": "sha512-6vR3XA7YWWvv76TkNPKC6Hc4CU0WXJlVydYmEezgi6RZS+Au3IUsCxZBr/3Zt2JPvtS3mttvP4X7tfeTA+414g==",
"version": "0.9.1",
"resolved": "https://registry.npmjs.org/@lottiefiles/dotlottie-react/-/dotlottie-react-0.9.1.tgz",
"integrity": "sha512-2KAbT0sUu3fwbjTk1cfny9tVFg/8FTaitz64Dft+QV/Du6VHxWy3I1H83///UzAAU+rbbEN2Vn9s6GpuokJEAQ==",
"dependencies": {
"@lottiefiles/dotlottie-web": "0.34.0"
"@lottiefiles/dotlottie-web": "0.35.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
@@ -3696,9 +3647,9 @@
}
},
"node_modules/@lottiefiles/dotlottie-web": {
"version": "0.34.0",
"resolved": "https://registry.npmjs.org/@lottiefiles/dotlottie-web/-/dotlottie-web-0.34.0.tgz",
"integrity": "sha512-lKayn0IaqFKcnLGxJKKaDlxwKqKBpHzZ7COMEZ0HYhd3cbI9GFJb9YDUgtdpzTH5uL9Eqnr19myWYmEXHPm9pQ=="
"version": "0.35.0",
"resolved": "https://registry.npmjs.org/@lottiefiles/dotlottie-web/-/dotlottie-web-0.35.0.tgz",
"integrity": "sha512-dXyQzNGaNOovJ23skUaLs0RU1Hpr+e4JKCBW4Wq/HTVnTCqfhV4uYaG1lLloZy50QdPsUB3UyIgd656pcQwTQA=="
},
"node_modules/@mapbox/node-pre-gyp": {
"version": "1.0.11",
@@ -5456,9 +5407,9 @@
"integrity": "sha512-7KrPPCpgRPKR+g+T127PE4bpw9Q84ZiY07EYRwXKVtTEVW9wJ5BZiF9smT9IvH19s+MQaDLmYRgjESsnqlyH0Q=="
},
"node_modules/@reduxjs/toolkit": {
"version": "2.2.7",
"resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-2.2.7.tgz",
"integrity": "sha512-faI3cZbSdFb8yv9dhDTmGwclW0vk0z5o1cia+kf7gCbaCwHI5e+7tP57mJUv22pNcNbeA62GSrPpfrUfdXcQ6g==",
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-2.2.8.tgz",
"integrity": "sha512-eK/ieXftPRQfaBSmzsamXEyDwkntMTY0e9SG5ETsEOv5JIPKhu3mj992t6B8FJjlnSrZBAAqdT8oMkPe4j+P9g==",
"dependencies": {
"immer": "^10.0.3",
"redux": "^5.0.1",
@@ -5479,9 +5430,9 @@
}
},
"node_modules/@remix-run/router": {
"version": "1.19.2",
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz",
"integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==",
"version": "1.20.0",
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.20.0.tgz",
"integrity": "sha512-mUnk8rPJBI9loFDZ+YzPGdeniYK+FTmRD1TMCz7ev2SNIozyKKpnGgsxO34u6Z4z/t0ITuu7voi/AshfsGsgFg==",
"engines": {
"node": ">=14.0.0"
}
@@ -9019,9 +8970,9 @@
"integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="
},
"node_modules/cookie": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz",
"integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==",
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz",
"integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==",
"engines": {
"node": ">= 0.6"
}
@@ -9582,9 +9533,9 @@
}
},
"node_modules/daisyui": {
"version": "4.12.12",
"resolved": "https://registry.npmjs.org/daisyui/-/daisyui-4.12.12.tgz",
"integrity": "sha512-xmCZ4piuWOjhNyB0VDKczB5vKFCipTA7UxaZNOzCz6cT8kvWgv5BDtUo+Hk9gOFufByOlfuBdzLpfhY5GsebTQ==",
"version": "4.12.13",
"resolved": "https://registry.npmjs.org/daisyui/-/daisyui-4.12.13.tgz",
"integrity": "sha512-BnXyQoOByUF/7wSdIKubyhXxbtL8gxwY3u2cNMkxGP39TSVJqMmlItqtpY903fQnLI/NokC+bc+ZV+PEPsppPw==",
"dev": true,
"dependencies": {
"css-selector-tokenizer": "^0.8",
@@ -11189,16 +11140,16 @@
}
},
"node_modules/express": {
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz",
"integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==",
"version": "4.21.1",
"resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz",
"integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==",
"dependencies": {
"accepts": "~1.3.8",
"array-flatten": "1.1.1",
"body-parser": "1.20.3",
"content-disposition": "0.5.4",
"content-type": "~1.0.4",
"cookie": "0.6.0",
"cookie": "0.7.1",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
"depd": "2.0.0",
@@ -12789,9 +12740,9 @@
"integrity": "sha512-fXHXcGFTXOvZTSkPJuGOQf5Lv5T/R2itiiCVPg9LxAje5D00O0pP83yJShFq5V89Ly//Gt6acj7z8pbBr34stw=="
},
"node_modules/i18next": {
"version": "23.15.2",
"resolved": "https://registry.npmjs.org/i18next/-/i18next-23.15.2.tgz",
"integrity": "sha512-zcPSWzCvw6uKnuYHIqs4W7hTuB9e3AFcSdZgvCWoPXIZsBjBd4djN2/2uOHIB+1DFFkQnMBXvhNg7J3WyCuywQ==",
"version": "23.16.0",
"resolved": "https://registry.npmjs.org/i18next/-/i18next-23.16.0.tgz",
"integrity": "sha512-Ni3CG6c14teOogY19YNRl+kYaE/Rb59khy0VyHVn4uOZ97E2E/Yziyi6r3C3s9+wacjdLZiq/LLYyx+Cgd+FCw==",
"funding": [
{
"type": "individual",
@@ -20341,9 +20292,9 @@
}
},
"node_modules/react-cookie": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/react-cookie/-/react-cookie-7.2.0.tgz",
"integrity": "sha512-mqhPERUyfOljq5yJ4woDFI33bjEtigsl8JDJdPPeNhr0eSVZmBc/2Vdf8mFxOUktQxhxTR1T+uF0/FRTZyBEgw==",
"version": "7.2.1",
"resolved": "https://registry.npmjs.org/react-cookie/-/react-cookie-7.2.1.tgz",
"integrity": "sha512-UcE6njAy5UmKzU9RywIvvtbHIQydhh6JP55yVbGwQ8Tp/wSPp2HOYVZdRI55zfbkW6zQv9SEs42mS3a9cIUQ0g==",
"dependencies": {
"@types/hoist-non-react-statics": "^3.3.5",
"hoist-non-react-statics": "^3.3.2",
@@ -20692,9 +20643,9 @@
}
},
"node_modules/react-i18next": {
"version": "15.0.2",
"resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-15.0.2.tgz",
"integrity": "sha512-z0W3/RES9Idv3MmJUcf0mDNeeMOUXe+xoL0kPfQPbDoZHmni/XsIoq5zgT2MCFUiau283GuBUK578uD/mkAbLQ==",
"version": "15.0.3",
"resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-15.0.3.tgz",
"integrity": "sha512-BlO1P+oLKjjIxDBQ0GkAIMacgjfMbnvops+3Y5nZXF7UJ99v4KCWr0Na1azJXC8AMiNWp4kgUcFCJM7U9ZsUDg==",
"dependencies": {
"@babel/runtime": "^7.25.0",
"html-parse-stringify": "^3.0.1"
@@ -20925,11 +20876,11 @@
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
},
"node_modules/react-router": {
"version": "6.26.2",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz",
"integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==",
"version": "6.27.0",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.27.0.tgz",
"integrity": "sha512-YA+HGZXz4jaAkVoYBE98VQl+nVzI+cVI2Oj/06F5ZM+0u3TgedN9Y9kmMRo2mnkSK2nCpNQn0DVob4HCsY/WLw==",
"dependencies": {
"@remix-run/router": "1.19.2"
"@remix-run/router": "1.20.0"
},
"engines": {
"node": ">=14.0.0"
@@ -20939,12 +20890,12 @@
}
},
"node_modules/react-router-dom": {
"version": "6.26.2",
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz",
"integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==",
"version": "6.27.0",
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.27.0.tgz",
"integrity": "sha512-+bvtFWMC0DgAFrfKXKG9Fc+BcXWRUO1aJIihbB79xaeq0v5UzfvnM5houGUm1Y461WVRcgAQ+Clh5rdb1eCx4g==",
"dependencies": {
"@remix-run/router": "1.19.2",
"react-router": "6.26.2"
"@remix-run/router": "1.20.0",
"react-router": "6.27.0"
},
"engines": {
"node": ">=14.0.0"
@@ -24817,12 +24768,20 @@
}
},
"node_modules/universal-cookie": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/universal-cookie/-/universal-cookie-7.2.0.tgz",
"integrity": "sha512-PvcyflJAYACJKr28HABxkGemML5vafHmiL4ICe3e+BEKXRMt0GaFLZhAwgv637kFFnnfiSJ8e6jknrKkMrU+PQ==",
"version": "7.2.1",
"resolved": "https://registry.npmjs.org/universal-cookie/-/universal-cookie-7.2.1.tgz",
"integrity": "sha512-GEKneQ0sz8qbobkYM5s9elAx6l7GQDNVl3Siqmc7bt/YccyyXWDPn+fht3J1qMcaLwPrzkty3i+dNfPGP2/9hA==",
"dependencies": {
"@types/cookie": "^0.6.0",
"cookie": "^0.6.0"
"cookie": "^0.7.2"
}
},
"node_modules/universal-cookie/node_modules/cookie": {
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
"integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/universalify": {
+9 -9
View File
@@ -4,14 +4,14 @@
"private": true,
"dependencies": {
"@formkit/auto-animate": "^0.8.2",
"@lottiefiles/dotlottie-react": "^0.9.0",
"@lottiefiles/dotlottie-react": "^0.9.1",
"@pdf-lib/fontkit": "^1.1.1",
"@radix-ui/themes": "^3.1.4",
"@react-pdf/renderer": "^4.0.0",
"@reduxjs/toolkit": "^2.2.7",
"@reduxjs/toolkit": "^2.2.8",
"axios": "^1.7.7",
"file-saver": "^2.0.5",
"i18next": "^23.15.2",
"i18next": "^23.16.0",
"i18next-browser-languagedetector": "^8.0.0",
"i18next-http-backend": "^2.6.2",
"jszip": "^3.10.1",
@@ -25,7 +25,7 @@
"react": "^18.2.0",
"react-bootstrap": "^2.10.5",
"react-confetti": "^6.1.0",
"react-cookie": "^7.2.0",
"react-cookie": "^7.2.1",
"react-datepicker": "^7.4.0",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
@@ -34,13 +34,13 @@
"react-dom": "^18.2.0",
"react-gtm-module": "^2.0.11",
"react-helmet": "^6.1.0",
"react-i18next": "^15.0.2",
"react-i18next": "^15.0.3",
"react-konva": "^18.2.10",
"react-pdf": "^9.1.1",
"react-quill-new": "^3.3.3",
"react-redux": "^9.1.2",
"react-rnd": "^10.4.13",
"react-router-dom": "^6.26.2",
"react-router-dom": "^6.27.0",
"react-scripts": "5.0.1",
"react-scrollbars-custom": "^4.1.1",
"react-select": "^5.8.1",
@@ -95,8 +95,8 @@
}
},
"devDependencies": {
"@babel/core": "^7.25.7",
"@babel/preset-env": "^7.25.7",
"@babel/core": "^7.25.8",
"@babel/preset-env": "^7.25.8",
"@babel/preset-react": "^7.25.7",
"@babel/runtime-corejs2": "^7.25.7",
"autoprefixer": "^10.4.20",
@@ -105,7 +105,7 @@
"commitizen": "^4.3.1",
"concurrently": "^9.0.1",
"css-loader": "^7.1.2",
"daisyui": "^4.12.12",
"daisyui": "^4.12.13",
"dotenv": "^16.4.5",
"dotenv-webpack": "^8.1.0",
"eslint": "^9.12.0",
+4
View File
@@ -73,6 +73,8 @@ import deactivateMailAdapter from './parsefunction/deactivateMailAdapter.js';
import addFileAdapter from './parsefunction/addFileAdapter.js';
import saveToFileAdapter from './parsefunction/saveToFileAdapter.js';
import getFileAdapter from './parsefunction/getFileAdapter.js';
import addPfxFile from './parsefunction/addPfxFile.js';
import getPfxFile from './parsefunction/getPfxFile.js';
// This afterSave function triggers after an object is added or updated in the specified class, allowing for post-processing logic.
Parse.Cloud.afterSave('contracts_Document', DocumentAftersave);
@@ -158,3 +160,5 @@ Parse.Cloud.define('deactivatemailadapter', deactivateMailAdapter);
Parse.Cloud.define('savetofileadapter', saveToFileAdapter);
Parse.Cloud.define('addfileadapter', addFileAdapter);
Parse.Cloud.define('getfileadapter', getFileAdapter);
Parse.Cloud.define('addpfx', addPfxFile);
Parse.Cloud.define('getpfx', getPfxFile);
@@ -55,6 +55,7 @@ export default async function GetTemplate(request) {
if (res) {
const templateRes = JSON.parse(JSON.stringify(res));
delete templateRes?.ExtUserPtr?.TenantId?.FileAdapters;
delete templateRes?.ExtUserPtr?.TenantId?.PfxFile;
return templateRes;
} else {
return { error: "You don't have access of this document!" };
@@ -77,6 +78,7 @@ export default async function GetTemplate(request) {
if (res) {
const templateRes = JSON.parse(JSON.stringify(res));
delete templateRes?.ExtUserPtr?.TenantId?.FileAdapters;
delete templateRes?.ExtUserPtr?.TenantId?.PfxFile;
return templateRes;
} else {
return { error: "You don't have access of this document!" };
@@ -9,6 +9,49 @@ function generateId(length) {
return result;
}
// `getExtUser` get ext user details
async function getExtUser(request) {
const extUserCls = new Parse.Query('contracts_Users');
extUserCls.equalTo('UserId', request.user);
extUserCls.include('TenantId');
return await extUserCls.first({ useMasterKey: true });
}
// `saveTenant` save file adapter details in tenant class
async function saveTenant(tenantId, fileAdapters, activeAdapter) {
const tenantCls = new Parse.Object('partners_Tenant');
tenantCls.id = tenantId;
if (fileAdapters?.length > 0) {
tenantCls.set('FileAdapters', fileAdapters);
}
if (activeAdapter) {
tenantCls.set('ActiveFileAdapter', activeAdapter);
} else {
tenantCls.unset('ActiveFileAdapter');
}
return await tenantCls.save(null, { useMasterKey: true });
}
// `updateTenantSchema` is used add FileAdapter in protected fields
async function updateTenantSchema() {
const tenantSchema = new Parse.Schema('partners_Tenant');
const currentSchema = await tenantSchema.get();
let clp = currentSchema.classLevelPermissions;
// Public permission ("*")
const role = '*';
if (!clp.protectedFields || Object.keys(clp.protectedFields).length === 0) {
// Initialize protectedFields if it doesn't exist
clp.protectedFields = { [role]: [] };
}
// save FileAdapters field is in protectedFields if not exists
if (!clp.protectedFields[role]?.includes('FileAdapters')) {
clp.protectedFields[role].push('FileAdapters');
// Update the class schema with the modified CLP
tenantSchema.setCLP(clp);
await tenantSchema.update();
}
}
export default async function addFileAdapter(request) {
if (!request?.user) {
throw new Parse.Error(Parse.Error.INVALID_SESSION_TOKEN, 'User is not authenticated.');
@@ -24,24 +67,15 @@ export default async function addFileAdapter(request) {
if (fileAdapterName && accessKeyId && secretAccessKey && adapter) {
try {
const extUserCls = new Parse.Query('contracts_Users');
extUserCls.equalTo('UserId', request.user);
extUserCls.include('TenantId');
const extUser = await extUserCls.first({ useMasterKey: true });
const extUser = await getExtUser(request);
if (extUser) {
const _extUser = JSON.parse(JSON.stringify(extUser));
const tenantCls = new Parse.Object('partners_Tenant');
tenantCls.id = extUser?.get('TenantId')?.id;
const existsFileAdaptes = _extUser?.TenantId?.FileAdapters
? _extUser?.TenantId?.FileAdapters
: [];
const tenantId = extUser?.get('TenantId')?.id;
// assign existing file adapters or empty array
let updatedFileAdapters = existsFileAdaptes;
let fileAdapters = _extUser?.TenantId?.FileAdapters || [];
const uniqueId = generateId(10);
let id = extUser?.get('TenantId')?.id + '_' + uniqueId;
const index = updatedFileAdapters?.findIndex(x => x.fileAdapterName === fileAdapterName);
const index = fileAdapters?.findIndex(x => x.fileAdapterName === fileAdapterName);
if (index !== -1) {
// If an object with the same fileAdapterName exists, update it
if (bucketName || region || endpoint || baseUrl) {
@@ -51,13 +85,13 @@ export default async function addFileAdapter(request) {
);
} else {
const adapterConfig = { accessKeyId: accessKeyId, secretAccessKey: secretAccessKey };
updatedFileAdapters[index] = { ...updatedFileAdapters[index], ...adapterConfig };
id = updatedFileAdapters[index].id;
fileAdapters[index] = { ...fileAdapters[index], ...adapterConfig };
id = fileAdapters[index].id;
}
} else {
if (bucketName && region && endpoint && baseUrl) {
// If the object with the given fileAdapterName doesn't exist, add a new one
updatedFileAdapters.push({
fileAdapters.push({
id: id,
fileAdapterName: fileAdapterName,
fileAdapter: adapter,
@@ -72,25 +106,8 @@ export default async function addFileAdapter(request) {
throw new Parse.Error(Parse.Error.INVALID_QUERY, 'Please provide all parameters.');
}
}
tenantCls.set('FileAdapters', updatedFileAdapters);
if (adapter) {
tenantCls.set('ActiveFileAdapter', id);
} else {
tenantCls.unset('ActiveFileAdapter');
}
const updateTenant = await tenantCls.save(null, { useMasterKey: true });
const tenantSchema = new Parse.Schema('partners_Tenant');
tenantSchema.setCLP({
get: { '*': true },
find: { '*': true },
count: { '*': true },
create: { '*': true },
update: { '*': true },
delete: { '*': true },
addField: { '*': true },
protectedFields: { '*': ['FileAdapters'] },
});
await tenantSchema.update();
const updateTenant = await saveTenant(tenantId, fileAdapters, id);
await updateTenantSchema();
const ActiveFileAdapter = adapter === 'opensign' ? 'opensign' : id;
return { ActiveFileAdapter: ActiveFileAdapter, updateAt: updateTenant.updatedAt };
} else {
@@ -104,27 +121,11 @@ export default async function addFileAdapter(request) {
}
} else if (adapter === 'opensign') {
try {
const extUserCls = new Parse.Query('contracts_Users');
extUserCls.equalTo('UserId', request.user);
extUserCls.include('TenantId');
const extUser = await extUserCls.first({ useMasterKey: true });
const extUser = await getExtUser(request);
if (extUser) {
const tenantCls = new Parse.Object('partners_Tenant');
tenantCls.id = extUser?.get('TenantId')?.id;
tenantCls.unset('ActiveFileAdapter');
const updateTenant = await tenantCls.save(null, { useMasterKey: true });
const tenantSchema = new Parse.Schema('partners_Tenant');
tenantSchema.setCLP({
get: { '*': true },
find: { '*': true },
count: { '*': true },
create: { '*': true },
update: { '*': true },
delete: { '*': true },
addField: { '*': true },
protectedFields: { '*': ['FileAdapters'] },
});
await tenantSchema.update();
const tenantId = extUser?.get('TenantId')?.id;
const updateTenant = await saveTenant(tenantId);
await updateTenantSchema();
return { ActiveFileAdapter: 'opensign', updateAt: updateTenant.updatedAt };
} else {
throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'User not found.');
@@ -0,0 +1,58 @@
// `updateTenantSchema` is used add FileAdapter in protected fields
async function updateTenantSchema() {
const tenantSchema = new Parse.Schema('partners_Tenant');
const currentSchema = await tenantSchema.get();
let clp = currentSchema.classLevelPermissions;
// Public permission ("*")
const role = '*';
if (!clp.protectedFields || Object.keys(clp.protectedFields).length === 0) {
// Initialize protectedFields if it doesn't exist
clp.protectedFields = { [role]: [] };
}
// save PfxFile field is in protectedFields if not exists
if (!clp.protectedFields[role]?.includes('PfxFile')) {
clp.protectedFields[role].push('PfxFile');
// Update the class schema with the modified CLP
tenantSchema.setCLP(clp);
await tenantSchema.update();
}
}
export default async function addPfxFile(request) {
if (!request?.user) {
throw new Parse.Error(Parse.Error.INVALID_SESSION_TOKEN, 'User is not authenticated.');
}
const pfxBase64 = request.params.pfxBase64;
const title = request.params.title;
const password = request.params.password;
const provider = request.params.provider;
if (provider === 'opensign' || (pfxBase64 && password)) {
try {
const extUserCls = new Parse.Query('contracts_Users');
extUserCls.equalTo('UserId', request.user);
extUserCls.include('TenantId');
const extUser = await extUserCls.first({ useMasterKey: true });
if (extUser) {
const tenantCls = new Parse.Object('partners_Tenant');
tenantCls.id = extUser?.get('TenantId')?.id;
if (provider === 'opensign') {
tenantCls.unset('PfxFile');
} else {
tenantCls.set('PfxFile', { title: title, password: password, base64: pfxBase64 });
}
const updateTenant = await tenantCls.save(null, { useMasterKey: true });
await updateTenantSchema();
return { updateAt: updateTenant.updatedAt };
} else {
throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'User not found.');
}
} catch (err) {
console.log('Err in add custom file adapter', err);
const code = err.code || 400;
const msg = err.message || 'Something went wrong.';
throw new Parse.Error(code, msg);
}
} else {
throw new Parse.Error(Parse.Error.INVALID_QUERY, 'Please provide all parameters.');
}
}
@@ -23,6 +23,7 @@ export default async function getDocument(request) {
const IsEnableOTP = res?.get('IsEnableOTP') || false;
const document = JSON.parse(JSON.stringify(res));
delete document.ExtUserPtr.TenantId.FileAdapters;
delete document?.ExtUserPtr?.TenantId?.PfxFile;
if (!IsEnableOTP) {
return document;
} else {
@@ -0,0 +1,25 @@
export default async function getPfxFile(request) {
if (!request?.user) {
throw new Parse.Error(Parse.Error.INVALID_SESSION_TOKEN, 'User is not authenticated.');
}
try {
const extUserCls = new Parse.Query('contracts_Users');
extUserCls.equalTo('UserId', request.user);
extUserCls.include('TenantId');
const extUser = await extUserCls.first({ useMasterKey: true });
if (extUser) {
const _extUser = JSON.parse(JSON.stringify(extUser));
const title = _extUser?.TenantId?.PfxFile?.title || '';
const pfxBase64 = _extUser?.TenantId?.PfxFile?.base64 || '';
const password = _extUser?.TenantId?.PfxFile?.password || '';
return { title: title, password: password, base64: pfxBase64 };
} else {
throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'User not found.');
}
} catch (err) {
console.log('Err in add custom file adapter', err);
const code = err.code || 400;
const msg = err.message || 'Something went wrong.';
throw new Parse.Error(code, msg);
}
}
@@ -16,6 +16,7 @@ async function getUserDetails(request) {
userQuery.exclude('CreatedBy.authData');
userQuery.exclude('TenantId.FileAdapters');
userQuery.exclude('google_refresh_token');
userQuery.exclude('TenantId.PfxFile');
if (userId) {
userQuery.equalTo('CreatedBy', { __type: 'Pointer', className: '_User', objectId: userId });
}
@@ -245,7 +245,11 @@ async function sendDoctoWebhook(doc, Url, event, signUser, certificateUrl) {
async function sendMailsaveCertifcate(doc, P12Buffer, isCustomMail, mailProvider, adapterConfig) {
const certificate = await GenerateCertificate(doc);
const certificatePdf = await PDFDocument.load(certificate);
const p12 = new P12Signer(P12Buffer, { passphrase: process.env.PASS_PHRASE || null });
let passphrase = process.env.PASS_PHRASE;
if (doc?.ExtUserPtr?.TenantId?.PfxFile?.password) {
passphrase = doc?.ExtUserPtr?.TenantId?.PfxFile?.password;
}
const p12 = new P12Signer(P12Buffer, { passphrase: passphrase || null });
// `pdflibAddPlaceholder` is used to add code of only digitial sign in certificate
pdflibAddPlaceholder({
pdfDoc: certificatePdf,
@@ -341,10 +345,15 @@ async function PDF(req) {
// `PdfBuffer` used to create buffer from pdf file
let PdfBuffer = Buffer.from(req.params.pdfFile, 'base64');
// `P12Buffer` used to create buffer from p12 certificate
const pfxFile = process.env.PFX_BASE64;
let pfxFile = process.env.PFX_BASE64;
let passphrase = process.env.PASS_PHRASE;
if (_resDoc?.ExtUserPtr?.TenantId?.PfxFile?.base64) {
pfxFile = _resDoc?.ExtUserPtr?.TenantId?.PfxFile?.base64;
passphrase = _resDoc?.ExtUserPtr?.TenantId?.PfxFile?.password;
}
// const P12Buffer = fs.readFileSync();
const P12Buffer = Buffer.from(pfxFile, 'base64');
const p12Cert = new P12Signer(P12Buffer, { passphrase: process.env.PASS_PHRASE || null });
const p12Cert = new P12Signer(P12Buffer, { passphrase: passphrase || null });
const UserPtr = { __type: 'Pointer', className: className, objectId: signUser.objectId };
const obj = { UserPtr: UserPtr, SignedUrl: '', Activity: 'Signed', ipAddress: userIP };
let updateAuditTrail;
@@ -364,7 +373,8 @@ async function PDF(req) {
isCompleted = true;
}
const randomNumber = Math.floor(Math.random() * 5000);
const name = `exported_file_${randomNumber}.pdf`;
const docName = _resDoc?.Name?.replace(/\s+/g, '_')?.toLowerCase();
const name = `signed_${docName}_${randomNumber}.pdf`;
const filePath = `./exports/${name}`;
let pdfSize = PdfBuffer.length;
if (isCompleted) {
+390 -314
View File
File diff suppressed because it is too large Load Diff
+8 -8
View File
@@ -18,8 +18,8 @@
"watch": "nodemon index.js"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.665.0",
"@aws-sdk/s3-request-presigner": "^3.665.0",
"@aws-sdk/client-s3": "^3.670.0",
"@aws-sdk/s3-request-presigner": "^3.670.0",
"@parse/fs-files-adapter": "^3.0.0",
"@parse/s3-files-adapter": "^2.2.0",
"@pdf-lib/fontkit": "^1.1.1",
@@ -30,12 +30,12 @@
"axios": "^1.7.7",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.21.0",
"form-data": "^4.0.0",
"express": "^4.21.1",
"form-data": "^4.0.1",
"generate-api-key": "^1.0.2",
"googleapis": "^144.0.0",
"mailgun.js": "^10.2.3",
"mongoose": "^8.7.0",
"mongoose": "^8.7.1",
"multer": "^1.4.5-lts.1",
"multer-s3": "^3.0.1",
"node-forge": "^1.3.1",
@@ -45,14 +45,14 @@
"parse-server": "^7.3.0",
"parse-server-api-mail-adapter": "^4.0.0",
"pdf-lib": "^1.17.1",
"posthog-node": "^4.2.0",
"posthog-node": "^4.2.1",
"ws": "^8.18.0"
},
"type": "module",
"devDependencies": {
"@babel/eslint-parser": "^7.25.7",
"@babel/eslint-parser": "^7.25.8",
"eslint": "^9.12.0",
"jasmine": "^5.3.1",
"jasmine": "^5.4.0",
"mongodb-runner": "^5.7.0",
"nodemon": "^3.1.7",
"nyc": "^17.1.0",