diff --git a/package-lock.json b/package-lock.json index 61136c553..a8497674c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,7 +49,7 @@ "socket.io-client": "^4.6.2", "tailwind-scrollbar": "^3.0.4", "tailwindcss": "^3.3.3", - "uuidv4": "^6.2.13", + "uuid": "^9.0.1", "yup": "^1.2.0" }, "devDependencies": { @@ -59,6 +59,7 @@ "@types/downloadjs": "^1.4.3", "@types/eslint": "^8.21.1", "@types/secure-random-password": "^0.2.1", + "@types/uuid": "^9.0.3", "@typescript-eslint/eslint-plugin": "^5.54.1", "@typescript-eslint/parser": "^5.54.1", "astro-eslint-parser": "^0.11.0", @@ -222,22 +223,6 @@ "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-1.5.0.tgz", "integrity": "sha512-wIh+gKBI9Nshz2o46B0B3f5k/W+WI9ZAv6y5Dn5WJ5SK1t0TnDimB4WE5rmTD05ZAIn8HALCZVmCsvj0w0v0lw==" }, - "node_modules/@astrojs/markdown-remark/node_modules/jsonc-parser": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", - "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==" - }, - "node_modules/@astrojs/markdown-remark/node_modules/shiki": { - "version": "0.14.3", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.3.tgz", - "integrity": "sha512-U3S/a+b0KS+UkTyMjoNojvTgrBHjgp7L6ovhFVZsXmBGnVdQ4K4U9oK0z63w538S91ATngv1vXigHCSWOwnr+g==", - "dependencies": { - "ansi-sequence-parser": "^1.1.0", - "jsonc-parser": "^3.2.0", - "vscode-oniguruma": "^1.7.0", - "vscode-textmate": "^8.0.0" - } - }, "node_modules/@astrojs/prism": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-2.1.2.tgz", @@ -1353,15 +1338,6 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, - "node_modules/@types/jsonwebtoken": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", - "integrity": "sha512-drE6uz7QBKq1fYqqoFKTDRdFCPHd5TCub75BM+D+cMx7NU9hUz7SESLfC2fSCXVFMO5Yj8sOWHuGqPgjc+fz0Q==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/mdast": { "version": "3.0.12", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", @@ -1421,16 +1397,6 @@ "@types/react": "*" } }, - "node_modules/@types/react-dom/node_modules/@types/react": { - "version": "18.2.14", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.14.tgz", - "integrity": "sha512-A0zjq+QN/O0Kpe30hA1GidzyFjatVvrpIvWLxD+xv67Vt91TWWgco9IvrJBkeyHm1trGaFS/FSGqPlhyeZRm0g==", - "dependencies": { - "@types/prop-types": "*", - "@types/scheduler": "*", - "csstype": "^3.0.2" - } - }, "node_modules/@types/resolve": { "version": "1.20.2", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", @@ -1467,9 +1433,10 @@ "integrity": "sha512-cputDpIbFgLUaGQn6Vqg3/YsJwxUwHLO13v3i5ouxT4lat0khip9AEWxtERujXV9wxIB1EyF97BSJFt6vpdI8g==" }, "node_modules/@types/uuid": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", - "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==" + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.3.tgz", + "integrity": "sha512-taHQQH/3ZyI3zP8M/puluDEIEvtQHVYcC6y3N8ijFtAd28+Ey/G4sg1u2gB01S8MwybLOKAp9/yCMu/uR5l3Ug==", + "dev": true }, "node_modules/@types/websocket": { "version": "1.0.5", @@ -2024,22 +1991,6 @@ "url": "https://github.com/sponsors/ota-meshi" } }, - "node_modules/astro/node_modules/jsonc-parser": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", - "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==" - }, - "node_modules/astro/node_modules/shiki": { - "version": "0.14.3", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.3.tgz", - "integrity": "sha512-U3S/a+b0KS+UkTyMjoNojvTgrBHjgp7L6ovhFVZsXmBGnVdQ4K4U9oK0z63w538S91ATngv1vXigHCSWOwnr+g==", - "dependencies": { - "ansi-sequence-parser": "^1.1.0", - "jsonc-parser": "^3.2.0", - "vscode-oniguruma": "^1.7.0", - "vscode-textmate": "^8.0.0" - } - }, "node_modules/astrojs-compiler-sync": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/astrojs-compiler-sync/-/astrojs-compiler-sync-0.3.3.tgz", @@ -2384,11 +2335,6 @@ "ieee754": "^1.2.1" } }, - "node_modules/buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" - }, "node_modules/bufferutil": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.7.tgz", @@ -3105,14 +3051,6 @@ "resolved": "https://registry.npmjs.org/easy-bem/-/easy-bem-1.1.1.tgz", "integrity": "sha512-GJRqdiy2h+EXy6a8E6R+ubmqUM08BK0FWNq41k24fup6045biQ8NXxoXimiwegMQvFFV3t1emADdGNL1TlS61A==" }, - "node_modules/ecdsa-sig-formatter": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, "node_modules/electron-to-chromium": { "version": "1.4.484", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.484.tgz", @@ -4262,23 +4200,6 @@ "tailwindcss": "^3" } }, - "node_modules/flowbite-react/node_modules/flowbite": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/flowbite/-/flowbite-1.7.0.tgz", - "integrity": "sha512-OTTmnhRgv85Rs+mcMaVU7zB6EvRQs7BaQziyMUsZLRjW9aUpeQyqKjLmxsVMMCdr8isYPCLd6UL7X1IaSVI0WQ==", - "dependencies": { - "@popperjs/core": "^2.9.3", - "mini-svg-data-uri": "^1.4.3" - } - }, - "node_modules/flowbite-react/node_modules/react-icons": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.10.1.tgz", - "integrity": "sha512-/ngzDP/77tlCfqthiiGNZeYFACw85fUjZtLbedmJ5DTlNDIwETxhwBzdOJ21zj4iJdvc0J3y7yOsX3PpxAJzrw==", - "peerDependencies": { - "react": "*" - } - }, "node_modules/flowbite-typography": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/flowbite-typography/-/flowbite-typography-1.0.3.tgz", @@ -5427,46 +5348,6 @@ "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.3.1.tgz", "integrity": "sha512-H8jvkz1O50L3dMZCsLqiuB2tA7muqbSg1AtGEkN0leAqGjsUzDJir3Zwr02BhqdcITPg3ei3mZ+HjMocAknhhg==" }, - "node_modules/jsonwebtoken": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", - "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", - "dependencies": { - "jws": "^3.2.2", - "lodash.includes": "^4.3.0", - "lodash.isboolean": "^3.0.3", - "lodash.isinteger": "^4.0.4", - "lodash.isnumber": "^3.0.3", - "lodash.isplainobject": "^4.0.6", - "lodash.isstring": "^4.0.1", - "lodash.once": "^4.0.0", - "ms": "^2.1.1", - "semver": "^7.5.4" - }, - "engines": { - "node": ">=12", - "npm": ">=6" - } - }, - "node_modules/jwa": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", - "dependencies": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/jws": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", - "dependencies": { - "jwa": "^1.4.1", - "safe-buffer": "^5.0.1" - } - }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -5580,46 +5461,16 @@ "resolved": "https://registry.npmjs.org/lodash.castarray/-/lodash.castarray-4.4.0.tgz", "integrity": "sha512-aVx8ztPv7/2ULbArGJ2Y42bG1mEQ5mGjpdvrbJcJFU3TbYybe+QlLS4pst9zV52ymy2in1KpFPiZnAOATxD4+Q==" }, - "node_modules/lodash.includes": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" - }, - "node_modules/lodash.isboolean": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", - "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" - }, - "node_modules/lodash.isinteger": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", - "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" - }, - "node_modules/lodash.isnumber": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", - "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" - }, "node_modules/lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" }, - "node_modules/lodash.isstring": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, - "node_modules/lodash.once": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" - }, "node_modules/log-symbols": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", @@ -6900,6 +6751,44 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/npm/node_modules/@isaacs/cliui/node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "inBundle": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/@isaacs/cliui/node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/@isaacs/cliui/node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/@isaacs/cliui/node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi": { "version": "7.1.0", "inBundle": true, @@ -6914,6 +6803,80 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, + "node_modules/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "inBundle": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/npm/node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "inBundle": true, + "license": "MIT" + }, + "node_modules/npm/node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "inBundle": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm/node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/npm/node_modules/@isaacs/string-locale-compare": { "version": "1.1.0", "inBundle": true, @@ -9235,20 +9198,8 @@ }, "node_modules/npm/node_modules/string-width": { "version": "4.2.3", - "inBundle": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "inBundle": true, "license": "MIT", "dependencies": { @@ -9262,18 +9213,8 @@ }, "node_modules/npm/node_modules/strip-ansi": { "version": "6.0.1", - "inBundle": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/npm/node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "inBundle": true, "license": "MIT", "dependencies": { @@ -9446,24 +9387,9 @@ } }, "node_modules/npm/node_modules/wrap-ansi": { - "version": "8.1.0", - "inBundle": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/npm/node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "inBundle": true, "license": "MIT", "dependencies": { @@ -10839,9 +10765,9 @@ } }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -11905,22 +11831,17 @@ } }, "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], "bin": { "uuid": "dist/bin/uuid" } }, - "node_modules/uuidv4": { - "version": "6.2.13", - "resolved": "https://registry.npmjs.org/uuidv4/-/uuidv4-6.2.13.tgz", - "integrity": "sha512-AXyzMjazYB3ovL3q051VLH06Ixj//Knx7QnUSi1T//Ie3io6CpsPu9nVMOx5MoLWh6xV0B9J0hIaxungxXUbPQ==", - "dependencies": { - "@types/uuid": "8.3.4", - "uuid": "8.3.2" - } - }, "node_modules/uvu": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.6.tgz", @@ -12511,22 +12432,6 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-1.5.0.tgz", "integrity": "sha512-wIh+gKBI9Nshz2o46B0B3f5k/W+WI9ZAv6y5Dn5WJ5SK1t0TnDimB4WE5rmTD05ZAIn8HALCZVmCsvj0w0v0lw==" - }, - "jsonc-parser": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", - "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==" - }, - "shiki": { - "version": "0.14.3", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.3.tgz", - "integrity": "sha512-U3S/a+b0KS+UkTyMjoNojvTgrBHjgp7L6ovhFVZsXmBGnVdQ4K4U9oK0z63w538S91ATngv1vXigHCSWOwnr+g==", - "requires": { - "ansi-sequence-parser": "^1.1.0", - "jsonc-parser": "^3.2.0", - "vscode-oniguruma": "^1.7.0", - "vscode-textmate": "^8.0.0" - } } } }, @@ -13383,15 +13288,6 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, - "@types/jsonwebtoken": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", - "integrity": "sha512-drE6uz7QBKq1fYqqoFKTDRdFCPHd5TCub75BM+D+cMx7NU9hUz7SESLfC2fSCXVFMO5Yj8sOWHuGqPgjc+fz0Q==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, "@types/mdast": { "version": "3.0.12", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.12.tgz", @@ -13449,18 +13345,6 @@ "integrity": "sha512-2et4PDvg6PVCyS7fuTc4gPoksV58bW0RwSxWKcPRcHZf0PRUGq03TKcD/rUHe3azfV6/5/biUBJw+HhCQjaP0A==", "requires": { "@types/react": "*" - }, - "dependencies": { - "@types/react": { - "version": "18.2.14", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.14.tgz", - "integrity": "sha512-A0zjq+QN/O0Kpe30hA1GidzyFjatVvrpIvWLxD+xv67Vt91TWWgco9IvrJBkeyHm1trGaFS/FSGqPlhyeZRm0g==", - "requires": { - "@types/prop-types": "*", - "@types/scheduler": "*", - "csstype": "^3.0.2" - } - } } }, "@types/resolve": { @@ -13499,9 +13383,10 @@ "integrity": "sha512-cputDpIbFgLUaGQn6Vqg3/YsJwxUwHLO13v3i5ouxT4lat0khip9AEWxtERujXV9wxIB1EyF97BSJFt6vpdI8g==" }, "@types/uuid": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", - "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==" + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.3.tgz", + "integrity": "sha512-taHQQH/3ZyI3zP8M/puluDEIEvtQHVYcC6y3N8ijFtAd28+Ey/G4sg1u2gB01S8MwybLOKAp9/yCMu/uR5l3Ug==", + "dev": true }, "@types/websocket": { "version": "1.0.5", @@ -13875,24 +13760,6 @@ "which-pm": "^2.0.0", "yargs-parser": "^21.1.1", "zod": "^3.20.6" - }, - "dependencies": { - "jsonc-parser": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", - "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==" - }, - "shiki": { - "version": "0.14.3", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.3.tgz", - "integrity": "sha512-U3S/a+b0KS+UkTyMjoNojvTgrBHjgp7L6ovhFVZsXmBGnVdQ4K4U9oK0z63w538S91ATngv1vXigHCSWOwnr+g==", - "requires": { - "ansi-sequence-parser": "^1.1.0", - "jsonc-parser": "^3.2.0", - "vscode-oniguruma": "^1.7.0", - "vscode-textmate": "^8.0.0" - } - } } }, "astro-eslint-parser": { @@ -14120,11 +13987,6 @@ "ieee754": "^1.2.1" } }, - "buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" - }, "bufferutil": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.7.tgz", @@ -14597,14 +14459,6 @@ "resolved": "https://registry.npmjs.org/easy-bem/-/easy-bem-1.1.1.tgz", "integrity": "sha512-GJRqdiy2h+EXy6a8E6R+ubmqUM08BK0FWNq41k24fup6045biQ8NXxoXimiwegMQvFFV3t1emADdGNL1TlS61A==" }, - "ecdsa-sig-formatter": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "requires": { - "safe-buffer": "^5.0.1" - } - }, "electron-to-chromium": { "version": "1.4.484", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.484.tgz", @@ -15465,23 +15319,6 @@ "react-icons": "^4.10.1", "react-indiana-drag-scroll": "^2.2.0", "tailwind-merge": "^1.13.2" - }, - "dependencies": { - "flowbite": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/flowbite/-/flowbite-1.7.0.tgz", - "integrity": "sha512-OTTmnhRgv85Rs+mcMaVU7zB6EvRQs7BaQziyMUsZLRjW9aUpeQyqKjLmxsVMMCdr8isYPCLd6UL7X1IaSVI0WQ==", - "requires": { - "@popperjs/core": "^2.9.3", - "mini-svg-data-uri": "^1.4.3" - } - }, - "react-icons": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.10.1.tgz", - "integrity": "sha512-/ngzDP/77tlCfqthiiGNZeYFACw85fUjZtLbedmJ5DTlNDIwETxhwBzdOJ21zj4iJdvc0J3y7yOsX3PpxAJzrw==", - "requires": {} - } } }, "flowbite-typography": { @@ -16250,42 +16087,6 @@ "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.3.1.tgz", "integrity": "sha512-H8jvkz1O50L3dMZCsLqiuB2tA7muqbSg1AtGEkN0leAqGjsUzDJir3Zwr02BhqdcITPg3ei3mZ+HjMocAknhhg==" }, - "jsonwebtoken": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", - "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", - "requires": { - "jws": "^3.2.2", - "lodash.includes": "^4.3.0", - "lodash.isboolean": "^3.0.3", - "lodash.isinteger": "^4.0.4", - "lodash.isnumber": "^3.0.3", - "lodash.isplainobject": "^4.0.6", - "lodash.isstring": "^4.0.1", - "lodash.once": "^4.0.0", - "ms": "^2.1.1", - "semver": "^7.5.4" - } - }, - "jwa": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", - "requires": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "jws": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", - "requires": { - "jwa": "^1.4.1", - "safe-buffer": "^5.0.1" - } - }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -16374,46 +16175,16 @@ "resolved": "https://registry.npmjs.org/lodash.castarray/-/lodash.castarray-4.4.0.tgz", "integrity": "sha512-aVx8ztPv7/2ULbArGJ2Y42bG1mEQ5mGjpdvrbJcJFU3TbYybe+QlLS4pst9zV52ymy2in1KpFPiZnAOATxD4+Q==" }, - "lodash.includes": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" - }, - "lodash.isboolean": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", - "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" - }, - "lodash.isinteger": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", - "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" - }, - "lodash.isnumber": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", - "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" - }, "lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" }, - "lodash.isstring": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" - }, "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, - "lodash.once": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" - }, "log-symbols": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", @@ -17193,12 +16964,86 @@ "strip-ansi": "^7.0.1" } }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "bundled": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "bundled": true + }, + "emoji-regex": { + "version": "8.0.0", + "bundled": true + }, + "strip-ansi": { + "version": "6.0.1", + "bundled": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, "strip-ansi": { "version": "7.1.0", "bundled": true, "requires": { "ansi-regex": "^6.0.1" } + }, + "strip-ansi-cjs": { + "version": "npm:strip-ansi@6.0.1", + "bundled": true, + "requires": { + "ansi-regex": "^5.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "bundled": true + } + } + }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "bundled": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "bundled": true + }, + "emoji-regex": { + "version": "8.0.0", + "bundled": true + }, + "string-width": { + "version": "4.2.3", + "bundled": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "bundled": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } } } }, @@ -18701,15 +18546,8 @@ }, "string-width": { "version": "4.2.3", - "bundled": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "string-width-cjs": { - "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "bundled": true, "requires": { "emoji-regex": "^8.0.0", @@ -18719,13 +18557,8 @@ }, "strip-ansi": { "version": "6.0.1", - "bundled": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "strip-ansi-cjs": { - "version": "npm:strip-ansi@6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "bundled": true, "requires": { "ansi-regex": "^5.0.1" @@ -18845,12 +18678,13 @@ } }, "wrap-ansi": { - "version": "8.1.0", + "version": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "bundled": true, "requires": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "dependencies": { "ansi-regex": { @@ -18883,15 +18717,6 @@ } } }, - "wrap-ansi-cjs": { - "version": "npm:wrap-ansi@7.0.0", - "bundled": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, "wrappy": { "version": "1.0.2", "bundled": true @@ -19773,9 +19598,9 @@ } }, "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", "requires": { "lru-cache": "^6.0.0" }, @@ -20554,18 +20379,9 @@ } }, "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - }, - "uuidv4": { - "version": "6.2.13", - "resolved": "https://registry.npmjs.org/uuidv4/-/uuidv4-6.2.13.tgz", - "integrity": "sha512-AXyzMjazYB3ovL3q051VLH06Ixj//Knx7QnUSi1T//Ie3io6CpsPu9nVMOx5MoLWh6xV0B9J0hIaxungxXUbPQ==", - "requires": { - "@types/uuid": "8.3.4", - "uuid": "8.3.2" - } + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==" }, "uvu": { "version": "0.5.6", diff --git a/package.json b/package.json index 68e9bae08..5f9723ea7 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "socket.io-client": "^4.6.2", "tailwind-scrollbar": "^3.0.4", "tailwindcss": "^3.3.3", - "uuidv4": "^6.2.13", + "uuid": "^9.0.1", "yup": "^1.2.0" }, "devDependencies": { @@ -75,6 +75,7 @@ "@types/downloadjs": "^1.4.3", "@types/eslint": "^8.21.1", "@types/secure-random-password": "^0.2.1", + "@types/uuid": "^9.0.3", "@typescript-eslint/eslint-plugin": "^5.54.1", "@typescript-eslint/parser": "^5.54.1", "astro-eslint-parser": "^0.11.0", diff --git a/public/images/profile.png b/public/images/profile.png new file mode 100644 index 000000000..7dd8036ea Binary files /dev/null and b/public/images/profile.png differ diff --git a/src/api/Agent.ts b/src/api/Agent.ts index 6e49da913..3e23c0d98 100644 --- a/src/api/Agent.ts +++ b/src/api/Agent.ts @@ -6,7 +6,7 @@ import { storageKeys } from "../config/CommonConstant"; export const getAgentHealth = async (orgId:number) => { const token = await getFromLocalStorage(storageKeys.TOKEN) const details = { - url: `${apiRoutes.Agent.checkAgentHealth}?orgId=${orgId}`, + url: `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Agent.checkAgentHealth}`, config: { headers: { 'Content-type': 'application/json', diff --git a/src/api/Auth.ts b/src/api/Auth.ts index d6dd14c0d..8a9820215 100644 --- a/src/api/Auth.ts +++ b/src/api/Auth.ts @@ -1,7 +1,4 @@ import {axiosGet, axiosPost, axiosPut} from '../services/apiRequests' -import { number, string } from 'yup' - -import type { AxiosError } from 'axios' import CryptoJS from "crypto-js" import { apiRoutes } from '../config/apiRoutes' import { envConfig } from '../config/envConfig' @@ -12,7 +9,8 @@ export interface UserSignUpData { email: string, } export interface AddPasswordDetails { - password?:string + email:string + password:string isPasskey:boolean firstName: string|null lastName: string|null @@ -61,7 +59,7 @@ export const loginUser = async(payload: UserSignInData) => { export const getUserProfile = async(accessToken: string) => { const details = { - url: apiRoutes.auth.userProfile, + url: apiRoutes.users.userProfile, config : { headers: { Authorization: `Bearer ${accessToken}` } } } try{ @@ -98,7 +96,6 @@ export const updateUserProfile = async(data: object ) => { const err = error as Error return err?.message } - } export const verifyUserMail = async(payload: EmailVerifyData ) => { @@ -113,14 +110,12 @@ export const verifyUserMail = async(payload: EmailVerifyData ) => { catch(error){ const err = error as Error return err?.message - } - - + } } export const checkUserExist = async(payload: string) => { const details ={ - url:`${apiRoutes.auth.checkUser}${payload}`, + url:`${apiRoutes.users.checkUser}${payload}`, config: { headers: { "Content-type": "application/json" } } } try{ @@ -130,15 +125,12 @@ export const checkUserExist = async(payload: string) => { catch(error){ const err = error as Error return err?.message - } - - + } } -export const addPasswordDetails = async(payload: AddPasswordDetails, email:string) => { - // Api call to add password +export const addPasswordDetails = async(payload: AddPasswordDetails) => { const details ={ - url: `${apiRoutes.auth.addDetails}${email}`, + url: `${apiRoutes.auth.addDetails}`, payload, config: { headers: { "Content-type": "application/json" } } } @@ -149,9 +141,7 @@ export const addPasswordDetails = async(payload: AddPasswordDetails, email:strin catch(error){ const err = error as Error return err?.message - } - - + } } export const addPasskeyUserDetails = async(payload: AddPassword, email:string) => { @@ -165,18 +155,15 @@ export const addPasskeyUserDetails = async(payload: AddPassword, email:string) = }, } } try{ - const response = await axiosPost(details) + const response = await axiosPut(details) return response } catch(error){ const err = error as Error return err?.message - } - - + } } - export const passwordEncryption = (password: string): string => { const CRYPTO_PRIVATE_KEY: string = `${envConfig.PUBLIC_CRYPTO_PRIVATE_KEY}` const encryptedPassword: string = CryptoJS.AES.encrypt(JSON.stringify(password), CRYPTO_PRIVATE_KEY).toString() diff --git a/src/api/Fido.ts b/src/api/Fido.ts index 51a9a6f1e..6127403e2 100644 --- a/src/api/Fido.ts +++ b/src/api/Fido.ts @@ -1,13 +1,14 @@ -import type { DeviceDetails, IdeviceBody, RegistrationOptionInterface, UserEmail, verifyRegistrationObjInterface } from "../components/Profile/interfaces" +import type { DeviceDetails, IdeviceBody, RegistrationOptionInterface, UserEmail, VerifyRegistrationObjInterface } from "../components/Profile/interfaces" import { storageKeys } from "../config/CommonConstant" import { apiRoutes } from "../config/apiRoutes" import { axiosDelete, axiosGet, axiosPost, axiosPut } from "../services/apiRequests" import { getFromLocalStorage } from "./Auth" export const generateRegistrationOption = async (payload: RegistrationOptionInterface) => { + const email = payload.userName; const token = await getFromLocalStorage(storageKeys.TOKEN) const details = { - url: `${apiRoutes.fido.generateRegistration}`, + url: `${apiRoutes.auth.generateRegistration}/${email}`, payload, config: { headers: { @@ -27,10 +28,10 @@ export const generateRegistrationOption = async (payload: RegistrationOptionInte } } -export const verifyRegistration = async (payload:unknown, userEmail:string) => { +export const verifyRegistration = async (payload:VerifyRegistrationObjInterface, email:string) => { const token = await getFromLocalStorage(storageKeys.TOKEN) const details = { - url: `${apiRoutes.fido.verifyRegistration}${userEmail}`, + url: `${apiRoutes.auth.verifyRegistration}${email}`, payload, config: { headers: { @@ -51,9 +52,10 @@ export const verifyRegistration = async (payload:unknown, userEmail:string) => { } export const addDeviceDetails = async (payload: IdeviceBody) => { + const credentialId = payload.credentialId; const token = await getFromLocalStorage(storageKeys.TOKEN) const details = { - url: `${apiRoutes.fido.userUpdate}`, + url: `${apiRoutes.auth.userUpdate}/${credentialId}`, payload, config: { headers: { @@ -73,10 +75,10 @@ export const addDeviceDetails = async (payload: IdeviceBody) => { } } -export const getUserDeviceDetails = async(userEmail:string) => { +export const getUserDeviceDetails = async(email:string) => { const token = await getFromLocalStorage(storageKeys.TOKEN) const details = { - url: `${apiRoutes.fido.getDeviceList}${userEmail}`, + url: `${apiRoutes.auth.getDeviceList}${email}`, config: { headers: { 'Content-type': 'application/json', @@ -95,10 +97,10 @@ export const getUserDeviceDetails = async(userEmail:string) => { } } -export const deleteDeviceById = async(enCodedUrl:string) => { +export const deleteDeviceById = async(credentialId:string) => { const token = await getFromLocalStorage(storageKeys.TOKEN) const details = { - url: `${apiRoutes.fido.fidoDevice}?credentialId=${enCodedUrl}`, + url: `${apiRoutes.auth.fidoDevice}/${credentialId}`, config: { headers: { 'Content-type': 'application/json', @@ -120,7 +122,7 @@ export const deleteDeviceById = async(enCodedUrl:string) => { export const generateAuthenticationOption = async (payload:UserEmail) => { const token = await getFromLocalStorage(storageKeys.TOKEN) const details = { - url: `${apiRoutes.fido.fidoAuthentication}`, + url: `${apiRoutes.auth.fidoAuthentication}`, payload, config: { headers: { @@ -140,11 +142,10 @@ export const generateAuthenticationOption = async (payload:UserEmail) => { } } -export const verifyAuthentication = async (payload: any, userEmail:UserEmail) => { - console.log("userEmail", userEmail) +export const verifyAuthentication = async (payload: VerifyRegistrationObjInterface, email: { userName: string }) => { const token = await getFromLocalStorage(storageKeys.TOKEN) const details = { - url: `${apiRoutes.fido.fidoVerifyAuthentication}${userEmail?.userName}`, + url: `${apiRoutes.auth.fidoVerifyAuthentication}${email.userName}`, payload, config: { headers: { @@ -167,7 +168,7 @@ export const verifyAuthentication = async (payload: any, userEmail:UserEmail) => export const editDeviceDetails = async (payload:DeviceDetails) => { const token = await getFromLocalStorage(storageKeys.TOKEN) const details = { - url: `${apiRoutes.fido.updateDeviceName}?credentialId=${payload.enCodedUrl}&deviceName=${payload.updatedDeviceName}`, + url: `${apiRoutes.auth.updateDeviceName}/${payload.enCodedUrl}?deviceName=${payload.updatedDeviceName}`, payload, config: { headers: { diff --git a/src/api/Schema.ts b/src/api/Schema.ts index df8595d23..a86d4b49a 100644 --- a/src/api/Schema.ts +++ b/src/api/Schema.ts @@ -1,5 +1,5 @@ import type { GetAllSchemaListParameter, createCredDeffFieldName, createSchema } from "../components/Resources/Schema/interfaces"; -import { axiosDelete, axiosGet, axiosPost } from "../services/apiRequests"; +import { axiosGet, axiosPost } from "../services/apiRequests"; import { apiRoutes } from "../config/apiRoutes"; import { getFromLocalStorage } from "./Auth"; @@ -8,7 +8,7 @@ import { storageKeys } from "../config/CommonConstant"; export const getAllSchemas = async ({itemPerPage, page, allSearch }: GetAllSchemaListParameter) => { const token = await getFromLocalStorage(storageKeys.TOKEN) const details = { - url: `${apiRoutes.schema.getAllSchemaFromPlatform}?pageSize=${itemPerPage}&searchByText=${allSearch}&pageNumber=${page}`, + url: `${apiRoutes.Platform.getAllSchemaFromPlatform}?pageSize=${itemPerPage}&searchByText=${allSearch}&pageNumber=${page}`, config: { headers: { 'Content-type': 'application/json', @@ -30,7 +30,7 @@ export const getAllSchemas = async ({itemPerPage, page, allSearch }: GetAllSchem export const getAllSchemasByOrgId = async ({ search, itemPerPage, page }: GetAllSchemaListParameter, orgId: string) => { const token = await getFromLocalStorage(storageKeys.TOKEN) const details = { - url: `${apiRoutes.schema.getAll}?orgId=${orgId}&pageNumber=${page}&pageSize=${itemPerPage}&searchByText=${search}`, + url: `${apiRoutes.organizations.root}/${orgId}${apiRoutes.schema.getAll}?pageNumber=${page}&pageSize=${itemPerPage}&searchByText=${search}`, config: { headers: { 'Content-type': 'application/json', @@ -49,10 +49,10 @@ export const getAllSchemasByOrgId = async ({ search, itemPerPage, page }: GetAll } } -export const addSchema = async (payload: createSchema) => { +export const addSchema = async (payload: createSchema, orgId: number) => { const token = await getFromLocalStorage(storageKeys.TOKEN) const details = { - url: apiRoutes.schema.create, + url: `${apiRoutes.organizations.root}/${orgId}${apiRoutes.schema.create}`, payload, config: { headers: { @@ -72,10 +72,10 @@ export const addSchema = async (payload: createSchema) => { } } -export const getSchemaById = async (id: string, orgId: number) => { +export const getSchemaById = async (schemaId: string, orgId: number) => { const token = await getFromLocalStorage(storageKeys.TOKEN) const details = { - url: `${apiRoutes.schema.getSchemaById}?schemaId=${id}&orgId=${orgId}`, + url: `${apiRoutes.organizations.root}/${orgId}${apiRoutes.schema.getSchemaById}/${schemaId}`, config: { headers: { 'Content-type': 'application/json', @@ -94,10 +94,10 @@ export const getSchemaById = async (id: string, orgId: number) => { } } -export const createCredentialDefinition = async (payload: createCredDeffFieldName) => { +export const createCredentialDefinition = async (payload: createCredDeffFieldName, orgId:number) => { const token = await getFromLocalStorage(storageKeys.TOKEN) const details = { - url: apiRoutes.schema.createCredentialDefinition, + url: `${apiRoutes.organizations.root}/${orgId}${apiRoutes.schema.createCredentialDefinition}`, payload, config: { headers: { @@ -118,10 +118,10 @@ export const createCredentialDefinition = async (payload: createCredDeffFieldNam } } -export const getCredDeffById = async (id: string, orgId: number) => { +export const getCredDeffById = async (schemaId: string, orgId: number) => { const token = await getFromLocalStorage(storageKeys.TOKEN) const details = { - url: `${apiRoutes.schema.getCredDeffBySchemaId}?schemaId=${id}&orgId=${orgId}`, + url: `${apiRoutes.organizations.root}/${orgId}${apiRoutes.schema.getCredDefBySchemaId}/${schemaId}/cred-defs`, config: { headers: { 'Content-type': 'application/json', @@ -138,4 +138,5 @@ export const getCredDeffById = async (id: string, orgId: number) => { const err = error as Error return err?.message } -} \ No newline at end of file +} + diff --git a/src/api/connection.ts b/src/api/connection.ts index 678cd3046..5b670771b 100644 --- a/src/api/connection.ts +++ b/src/api/connection.ts @@ -6,7 +6,7 @@ import { getFromLocalStorage } from './Auth'; export const getConnectionsByOrg = async () => { const orgId = await getFromLocalStorage(storageKeys.ORG_ID); - const url = `${apiRoutes.Issuance.getAllConnections}?orgId=${orgId}`; + const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Issuance.getAllConnections}`; const axiosPayload = { url, config: await getHeaderConfigs(), diff --git a/src/api/ecosystem.ts b/src/api/ecosystem.ts new file mode 100644 index 000000000..bab35e7ca --- /dev/null +++ b/src/api/ecosystem.ts @@ -0,0 +1,251 @@ +import { axiosGet, axiosPost, axiosPut } from '../services/apiRequests'; + +import { apiRoutes } from '../config/apiRoutes'; +import { getFromLocalStorage } from './Auth'; +import { storageKeys } from '../config/CommonConstant'; +import { getHeaderConfigs } from '../config/GetHeaderConfigs'; + +interface CreateEcosystemPayload { + name: string; + description: string; + logo: string; + tags?: string; + userId: number; +} + +export interface GetEndorsementListParameter { + itemPerPage: number; + page: number; + search: string; + sortBy: string; + type: string; + status: string; +} + +export const createEcosystems = async (dataPayload: CreateEcosystemPayload) => { + const orgId = await getFromLocalStorage(storageKeys.ORG_ID); + + const url = `${apiRoutes.Ecosystem.root}/${orgId}`; + const payload = dataPayload; + const axiosPayload = { + url, + payload, + config: await getHeaderConfigs(), + }; + + try { + return await axiosPost(axiosPayload); + } catch (error) { + const err = error as Error; + return err?.message; + } +}; + +export const updateEcosystem = async (dataPayload: CreateEcosystemPayload) => { + const orgId = await getFromLocalStorage(storageKeys.ORG_ID); + const ecosystemId = await getFromLocalStorage(storageKeys.ECOSYSTEM_ID); + + const url = `${apiRoutes.Ecosystem.root}/${ecosystemId}/${orgId}`; + const payload = dataPayload; + + const axiosPayload = { + url, + payload, + config: await getHeaderConfigs(), + }; + + try { + return await axiosPut(axiosPayload); + } catch (error) { + const err = error as Error; + return err?.message; + } +}; + +export const getEcosystem = async (orgId: string) => { + const url = `${apiRoutes.Ecosystem.root}/${orgId}`; + + const axiosPayload = { + url, + config: await getHeaderConfigs(), + }; + + try { + return await axiosGet(axiosPayload); + } catch (error) { + const err = error as Error; + return err?.message; + } +}; + +export const getEndorsementList = async ( + { search, itemPerPage, page, type, status }: GetEndorsementListParameter, + ecosystemId: string, + orgId: string, +) => { + const url = `${apiRoutes.Ecosystem.root}/${orgId}/${ecosystemId}${ + apiRoutes.Ecosystem.endorsements.list + }?${page ? `pageNumber=${page}` : ''}${search ? `&search=${search}` : ''}${ + itemPerPage ? `&pageSize=${itemPerPage}` : '' + }${type ? `&type=${type}` : ''}${status ? `&search=${status}` : ''}`; + + const axiosPayload = { + url, + config: await getHeaderConfigs(), + }; + + try { + return await axiosGet(axiosPayload); + } catch (error) { + const err = error as Error; + return err?.message; + } +}; + +export const createSchemaRequest = async ( + data: object, + endorsementId: string, + orgId: number, +) => { + const url = `${apiRoutes.Ecosystem.root}/${endorsementId}/${orgId}${apiRoutes.Ecosystem.endorsements.createSchemaRequest}`; + const payload = data; + const axiosPayload = { + url, + payload, + config: await getHeaderConfigs(), + }; + + try { + return await axiosPost(axiosPayload); + } catch (error) { + const err = error as Error; + return err?.message; + } +}; + +export const createCredDefRequest = async ( + data: object, + ecosystemId: string, + orgId: number, +) => { + const url = `${apiRoutes.Ecosystem.root}/${ecosystemId}/${orgId}${apiRoutes.Ecosystem.endorsements.createCredDefRequest}`; + const payload = data; + const axiosPayload = { + url, + payload, + config: await getHeaderConfigs(), + }; + + try { + return await axiosPost(axiosPayload); + } catch (error) { + const err = error as Error; + return err?.message; + } +}; + +export const SignEndorsementRequest = async ( + ecosystemId: string, + orgId: string, + endorsementId: string, +) => { + const url = `${apiRoutes.Ecosystem.root}/${ecosystemId}/${orgId}${apiRoutes.Ecosystem.endorsements.signRequest}${endorsementId}`; + + const axiosPayload = { + url, + config: await getHeaderConfigs(), + }; + try { + return await axiosPost(axiosPayload); + } catch (error) { + const err = error as Error; + return err?.message; + } +}; + +export const SubmitEndorsementRequest = async ( + ecosystemId: string, + orgId: string, + endorsementId: string, +) => { + const url = `${apiRoutes.Ecosystem.root}/${ecosystemId}/${orgId}${apiRoutes.Ecosystem.endorsements.submitRequest}${endorsementId}`; + + const axiosPayload = { + url, + config: await getHeaderConfigs(), + }; + try { + return await axiosPost(axiosPayload); + } catch (error) { + const err = error as Error; + return err?.message; + } +}; + +export const RejectEndorsementRequest = async ( + ecosystemId: string, + orgId: string, + endorsementId: string, +) => { + const url = `${apiRoutes.Ecosystem.root}/${ecosystemId}/${orgId}${apiRoutes.Ecosystem.endorsements.rejectRequest}${endorsementId}`; + + const axiosPayload = { + url, + config: await getHeaderConfigs(), + }; + try { + return await axiosPut(axiosPayload); + } catch (error) { + const err = error as Error; + return err?.message; + } +}; + +export const getEcosystemDashboard = async ( + ecosystemId: string, + orgId: string, +) => { + const url = `${apiRoutes.Ecosystem.root}/${ecosystemId}/${orgId}/dashboard`; + + const token = await getFromLocalStorage(storageKeys.TOKEN); + + const config = { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}`, + }, + }; + const axiosPayload = { + url, + config, + }; + + try { + return await axiosGet(axiosPayload); + } catch (error) { + const err = error as Error; + return err?.message; + } +}; + +export const getEcosystemMemberList = async ( + pageNumber: number, + pageSize: number, + search: string, +) => { + const orgId = await getFromLocalStorage(storageKeys.ORG_ID); + const ecosystemId = await getFromLocalStorage(storageKeys.ECOSYSTEM_ID); + const url = `${apiRoutes.Ecosystem.root}/${ecosystemId}/${orgId}${apiRoutes.Ecosystem.members}?pageNumber=${pageNumber}&pageSize=${pageSize}&search=${search}`; + + const axiosPayload = { + url, + config: await getHeaderConfigs(), + }; + + try { + return await axiosGet(axiosPayload); + } catch (error) { + const err = error as Error; + return err?.message; + } +}; diff --git a/src/api/invitations.ts b/src/api/invitations.ts index 396ae62ba..47bfbd2d5 100644 --- a/src/api/invitations.ts +++ b/src/api/invitations.ts @@ -1,4 +1,4 @@ -import { axiosGet, axiosPost } from "../services/apiRequests" +import { axiosDelete, axiosGet, axiosPost, axiosPut } from "../services/apiRequests" import { apiRoutes } from "../config/apiRoutes"; import { getFromLocalStorage } from "./Auth"; @@ -6,122 +6,320 @@ import { storageKeys } from "../config/CommonConstant"; export const getOrganizationInvitations = async (pageNumber: number, pageSize: number, search = '') => { - const orgId = await getFromLocalStorage(storageKeys.ORG_ID) - - const url = `${apiRoutes.organizations.invitations}/${orgId}?pageNumber=${pageNumber}&pageSize=${pageSize}&search=${search}` - - const token = await getFromLocalStorage(storageKeys.TOKEN) - - const config = { - headers: { - 'Content-Type': 'application/json', - Authorization: `Bearer ${token}` - } - } - const axiosPayload = { - url, - config - } - - try { - return await axiosGet(axiosPayload); - } - catch (error) { - const err = error as Error - return err?.message - } + const orgId = await getFromLocalStorage(storageKeys.ORG_ID) + + if (!orgId) { + return "Organization is required"; + } + + const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.organizations.invitations}?&pageNumber=${pageNumber}&pageSize=${pageSize}&search=${search}` + + const token = await getFromLocalStorage(storageKeys.TOKEN) + + const config = { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}` + } + } + const axiosPayload = { + url, + config + } + + try { + return await axiosGet(axiosPayload); + } + catch (error) { + const err = error as Error + return err?.message + } } export const createInvitations = async (invitationList: Array) => { - const orgId = await getFromLocalStorage(storageKeys.ORG_ID) - - const url = apiRoutes.organizations.invitations - const payload = { - invitations: invitationList, - orgId: Number(orgId) - } - const token = await getFromLocalStorage(storageKeys.TOKEN) - - const config = { - headers: { - 'Content-Type': 'application/json', - Authorization: `Bearer ${token}` - } - } - const axiosPayload = { - url, - payload, - config - } - - try { - return await axiosPost(axiosPayload); - } - catch (error) { - const err = error as Error - return err?.message - } + const orgId = await getFromLocalStorage(storageKeys.ORG_ID) + + const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.organizations.invitations}` + const payload = { + invitations: invitationList, + orgId: Number(orgId) + } + const token = await getFromLocalStorage(storageKeys.TOKEN) + + const config = { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}` + } + } + const axiosPayload = { + url, + payload, + config + } + + try { + return await axiosPost(axiosPayload); + } + catch (error) { + const err = error as Error + return err?.message + } +} + +export const getEcosystemList = async () => { + + const url = `${apiRoutes.Ecosystem.root}` + + const token = await getFromLocalStorage(storageKeys.TOKEN) + + const config = { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}` + } + } + const axiosPayload = { + url, + config + } + + try { + return await axiosGet(axiosPayload); + } + catch (error) { + const err = error as Error + return err?.message + } } +export const createEcoSystemInvitations = async (invitationList: Array, ecosystemId: string) => { + const orgId = await getFromLocalStorage(storageKeys.ORG_ID); + const url = `${apiRoutes.Ecosystem.root}/${ecosystemId}/${orgId}${apiRoutes.Ecosystem.invitations}` + + const payload = { + invitations: invitationList, + } + const token = await getFromLocalStorage(storageKeys.TOKEN) + const config = { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}` + } + } + const axiosPayload = { + url, + payload, + config + } + + try { + return await axiosPost(axiosPayload); + } + catch (error) { + const err = error as Error + return err?.message + } +} // Received Invitations by User export const getUserInvitations = async (pageNumber: number, pageSize: number, search = '') => { - const url = `${apiRoutes.users.invitations}?pageNumber=${pageNumber}&pageSize=${pageSize}&search=${search}` - - const token = await getFromLocalStorage(storageKeys.TOKEN) - - const config = { - headers: { - 'Content-Type': 'application/json', - Authorization: `Bearer ${token}` - } - } - const axiosPayload = { - url, - config - } - - try { - return await axiosGet(axiosPayload); - } - catch (error) { - const err = error as Error - return err?.message - } + const url = `${apiRoutes.users.invitations}?pageNumber=${pageNumber}&pageSize=${pageSize}&search=${search}` + + const token = await getFromLocalStorage(storageKeys.TOKEN) + + const config = { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}` + } + } + const axiosPayload = { + url, + config + } + + try { + return await axiosGet(axiosPayload); + } + catch (error) { + const err = error as Error + return err?.message + } +} + + +export const getUserEcosystemInvitations = async (pageNumber: number, pageSize: number, search: string) => { + const orgId = await getFromLocalStorage(storageKeys.ORG_ID) + + const url = `${apiRoutes.Ecosystem.root}/${orgId}${apiRoutes.Ecosystem.usersInvitation}?pageNumber=${pageNumber}&pageSize=${pageSize}&search=${search}` + + const token = await getFromLocalStorage(storageKeys.TOKEN) + + const config = { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}` + } + } + const axiosPayload = { + url, + config + } + + try { + return await axiosGet(axiosPayload); + } + catch (error) { + const err = error as Error + return err?.message + } +} + +// getEcosytemReceivedInvitations +export const getEcosytemReceivedInvitations = async (pageNumber: number, pageSize: number, search = '') => { + const orgId = await getFromLocalStorage(storageKeys.ORG_ID); + + const url = `${apiRoutes.Ecosystem.root}/${orgId}/?pageNumber=${pageNumber}&pageSize=${pageSize}&search=${search}` + + const token = await getFromLocalStorage(storageKeys.TOKEN) + + const config = { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}` + } + } + const axiosPayload = { + url, + config + } + + try { + return await axiosGet(axiosPayload); + } + catch (error) { + const err = error as Error + return err?.message + } +} +export const getEcosystemInvitations = async (pageNumber: number, pageSize: number, search: string) => { + const ecosystemId = await getFromLocalStorage(storageKeys.ECOSYSTEM_ID); + + const orgId = await getFromLocalStorage(storageKeys.ORG_ID); + const url = `${apiRoutes.Ecosystem.root}/${ecosystemId}/${orgId}${apiRoutes.Ecosystem.invitations}?pageNumber=${pageNumber}&pageSize=${pageSize}&search=${search}` + + const token = await getFromLocalStorage(storageKeys.TOKEN) + + const config = { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}` + } + } + const axiosPayload = { + url, + config + } + + try { + return await axiosGet(axiosPayload); + } + catch (error) { + const err = error as Error + return err?.message + } } // Accept/ Reject Invitations -export const acceptRejectInvitations = async (invitationId: number,orgId: number, status: string) => { - - const url = apiRoutes.users.invitations - - const payload = { - invitationId, - orgId: Number(orgId), - status - } - const token = await getFromLocalStorage(storageKeys.TOKEN) - - const config = { - headers: { - 'Content-Type': 'application/json', - Authorization: `Bearer ${token}` - } - } - const axiosPayload = { - url, - payload, - config - } - - try { - return await axiosPost(axiosPayload); - } - catch (error) { - const err = error as Error - return err?.message - } +export const acceptRejectEcosystemInvitations = async (invitationId: string, orgId: number, status: string, orgName: string, orgDid: string) => { + + const url = `${apiRoutes.Ecosystem.root}/${orgId}${apiRoutes.Ecosystem.invitations}/${invitationId}` + + const payload = { + status, + orgName, + orgDid + } + const token = await getFromLocalStorage(storageKeys.TOKEN) + + const config = { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}` + } + } + const axiosPayload = { + url, + payload, + config + } + + try { + return await axiosPut(axiosPayload); + } + catch (error) { + const err = error as Error + return err?.message + } } +export const acceptRejectInvitations = async (invitationId: number, orgId: number, status: string) => { + + const url = `${apiRoutes.users.invitations}/${invitationId}` + const payload = { + orgId: Number(orgId), + status + } + const token = await getFromLocalStorage(storageKeys.TOKEN) + + const config = { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}` + } + } + const axiosPayload = { + url, + payload, + config + } + + try { + return await axiosPost(axiosPayload); + } + catch (error) { + const err = error as Error + return err?.message + } +} + +export const deleteEcosystemInvitations = async (invitationId: number) => { + + const ecosystemId = await getFromLocalStorage(storageKeys.ECOSYSTEM_ID); + const orgId = await getFromLocalStorage(storageKeys.ORG_ID) + const url = `${apiRoutes.Ecosystem.root}/${ecosystemId}/${orgId}${apiRoutes.Ecosystem.invitations}/${invitationId}` + + const token = await getFromLocalStorage(storageKeys.TOKEN) + + const config = { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}` + } + } + const axiosPayload = { + url, + config + } + + try { + return await axiosDelete(axiosPayload); + } + catch (error) { + const err = error as Error + return err?.message + } +} diff --git a/src/api/issuance.ts b/src/api/issuance.ts index 0706f5b5d..01289f2ff 100644 --- a/src/api/issuance.ts +++ b/src/api/issuance.ts @@ -1,13 +1,12 @@ -import type { IssueCredential } from '../common/enums'; import { apiRoutes } from '../config/apiRoutes'; import { storageKeys } from '../config/CommonConstant'; import { getHeaderConfigs } from '../config/GetHeaderConfigs'; import { axiosGet, axiosPost } from '../services/apiRequests'; import { getFromLocalStorage } from './Auth'; -export const getIssuedCredentials = async (state: IssueCredential) => { +export const getIssuedCredentials = async () => { const orgId = await getFromLocalStorage(storageKeys.ORG_ID); - const url = `${apiRoutes.Issuance.getIssuedCredentials}?orgId=${orgId}`; + const url= `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Issuance.getIssuedCredentials}`; const axiosPayload = { url, @@ -23,8 +22,10 @@ export const getIssuedCredentials = async (state: IssueCredential) => { }; export const getCredentialDefinitions = async (schemaId: string) => { + const orgId = await getFromLocalStorage(storageKeys.ORG_ID); - const url = `${apiRoutes.Issuance.getCredDefBySchemaId}?schemaId=${schemaId}&orgId=${orgId}`; + const url= `${apiRoutes.organizations.root}/${orgId}${apiRoutes.schema.getCredDefBySchemaId}/${schemaId}/cred-defs`; + const axiosPayload = { url, config: await getHeaderConfigs(), @@ -40,8 +41,10 @@ export const getCredentialDefinitions = async (schemaId: string) => { export const issueCredential = async (data: object) => { - const url = apiRoutes.Issuance.issueCredential; + const orgId = await getFromLocalStorage(storageKeys.ORG_ID); + const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Issuance.issueCredential}`; const payload = data; + const axiosPayload = { url, payload, diff --git a/src/api/organization.ts b/src/api/organization.ts index e53dba9d1..56c2948dd 100644 --- a/src/api/organization.ts +++ b/src/api/organization.ts @@ -1,4 +1,4 @@ -import { axiosGet, axiosPost, axiosPut } from "../services/apiRequests" +import { axiosGet, axiosPost, axiosPublicOrganisationGet, axiosPut } from "../services/apiRequests" import { apiRoutes } from "../config/apiRoutes"; import { getFromLocalStorage } from "./Auth"; @@ -32,9 +32,9 @@ export const createOrganization = async (data: object) => { } } -export const updateOrganization = async (data: object) => { +export const updateOrganization = async (data: object, orgId:string) => { - const url = apiRoutes.organizations.update + const url = `${apiRoutes.organizations.update}/${orgId}` const payload = data const token = await getFromLocalStorage(storageKeys.TOKEN) @@ -114,7 +114,7 @@ export const getOrganizationById = async (orgId: string) => { export const getOrgDashboard = async (orgId: string) => { - const url = `${apiRoutes.organizations.getOrgDashboard}?orgId=${Number(orgId)}` + const url = `${apiRoutes.organizations.getOrgDashboard}/${orgId}` const token = await getFromLocalStorage(storageKeys.TOKEN) @@ -138,9 +138,9 @@ export const getOrgDashboard = async (orgId: string) => { } } -export const spinupDedicatedAgent = async (data: object) => { +export const spinupDedicatedAgent = async (data: object, orgId:number) => { - const url = apiRoutes.organizations.agentDedicatedSpinup + const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Agent.agentDedicatedSpinup}` const payload = data const token = await getFromLocalStorage(storageKeys.TOKEN) @@ -166,9 +166,9 @@ export const spinupDedicatedAgent = async (data: object) => { } } -export const spinupSharedAgent = async (data: object) => { +export const spinupSharedAgent = async (data: object, orgId:number) => { - const url = apiRoutes.organizations.agentSharedSpinup + const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Agent.agentSharedSpinup}` const payload = data const token = await getFromLocalStorage(storageKeys.TOKEN) @@ -226,8 +226,11 @@ export const getOrganizationRoles = async () => { export const getOrganizationUsers = async (pageNumber: number, pageSize: number, search = '') => { const orgId = await getFromLocalStorage(storageKeys.ORG_ID) + if (!orgId) { + return "Organization is required"; + } - const url = `${apiRoutes.users.fetchUsers}?orgId=${orgId}&pageNumber=${pageNumber}&pageSize=${pageSize}&search=${search}` + const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.users.fetchUsers}?&pageNumber=${pageNumber}&pageSize=${pageSize}&search=${search}` const axiosPayload = { url, @@ -248,7 +251,7 @@ export const editOrganizationUserRole = async (userId: number, roles: number[]) const orgId = await getFromLocalStorage(storageKeys.ORG_ID) - const url = apiRoutes.organizations.editUserROle + const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.organizations.editUserROle}/${userId}` const payload = { orgId, userId, @@ -274,10 +277,8 @@ export const editOrganizationUserRole = async (userId: number, roles: number[]) export const createConnection = async (orgName: string) => { - - const url = apiRoutes.connection.create - const orgId = await getFromLocalStorage(storageKeys.ORG_ID) + const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.connection.create}` const data = { label: orgName, @@ -302,4 +303,28 @@ export const createConnection = async (orgName: string) => { } } +// public profile + +export const getPublicOrganizations = async (pageNumber: number, pageSize: number, search :string) => { + + const url = `${apiRoutes.Public.organizations}?pageNumber=${pageNumber}&pageSize=${pageSize}&search=${search}` + + const config = { + headers: { + 'Content-Type': 'application/json', + } + } + const axiosPayload = { + url, + config + } + + try { + return await axiosPublicOrganisationGet(axiosPayload); + } + catch (error) { + const err = error as Error + return err?.message + } +} diff --git a/src/api/verification.ts b/src/api/verification.ts index 75aef3370..177185d36 100644 --- a/src/api/verification.ts +++ b/src/api/verification.ts @@ -6,8 +6,8 @@ import { axiosGet, axiosPost } from '../services/apiRequests'; import { getFromLocalStorage } from './Auth'; export const verifyCredential = async (payload: any) => { - const url = apiRoutes.Verification.verifyCredential; - const axiosPayload = { + const orgId = await getFromLocalStorage(storageKeys.ORG_ID); + const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Verification.verifyCredential}`; const axiosPayload = { url, payload, config: await getHeaderConfigs(), @@ -24,7 +24,6 @@ export const verifyCredential = async (payload: any) => { export const getVerificationCredential = async (state: IssueCredential) => { const orgId = await getFromLocalStorage(storageKeys.ORG_ID); const url = `${apiRoutes.Issuance.getIssuedCredentials}?orgId=${orgId}&state=${state}`; - const axiosPayload = { url, config: await getHeaderConfigs(), @@ -40,8 +39,8 @@ export const getVerificationCredential = async (state: IssueCredential) => { export const getVerificationList = async () => { const orgId = await getFromLocalStorage(storageKeys.ORG_ID); - const url = `${apiRoutes.Verification.getAllRequestList}?orgId=${orgId}`; - + const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Verification.verifyCredential}` + const axiosPayload = { url, config: await getHeaderConfigs(), @@ -55,10 +54,9 @@ export const getVerificationList = async () => { } }; -export const verifyPresentation = async (id:string) => { +export const verifyPresentation = async (proofId:string) => { const orgId = await getFromLocalStorage(storageKeys.ORG_ID); - const url = `${apiRoutes.Verification.presentationVerification}?orgId=${orgId}&id=${id}`; - + const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Verification.presentationVerification}/${proofId}/verify`; const axiosPayload = { url, config: await getHeaderConfigs(), @@ -73,10 +71,9 @@ export const verifyPresentation = async (id:string) => { }; -export const getProofAttributes=async (id:string)=>{ +export const getProofAttributes=async (proofId:string)=>{ const orgId = await getFromLocalStorage(storageKeys.ORG_ID); - const url = `${apiRoutes.Verification.proofRequestAttributesVerification}?id=${id}&orgId=${orgId}`; - + const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.Verification.proofRequestAttributesVerification}/${proofId}/form`; const axiosPayload = { url, config: await getHeaderConfigs(), @@ -91,7 +88,9 @@ export const getProofAttributes=async (id:string)=>{ } export const getCredentialDefinitionsForVerification = async (schemaId: string) => { - const url = `${apiRoutes.Issuance.getCredDefBySchemaId}?schemaId=${schemaId}`; + const orgId = await getFromLocalStorage(storageKeys.ORG_ID); + const url= `${apiRoutes.Verification.verificationCredDef}/${schemaId}`; + const axiosPayload = { url, config: await getHeaderConfigs(), diff --git a/src/app/LayoutSidebar.astro b/src/app/LayoutSidebar.astro index 09f728e74..d8a364e12 100644 --- a/src/app/LayoutSidebar.astro +++ b/src/app/LayoutSidebar.astro @@ -1,6 +1,6 @@ --- +import '../common/global.css' import CopyrightNotice from '../components/CopyrightNotice.astro'; -import FooterSidebar from './FooterSidebar.astro'; import LayoutCommon from './LayoutCommon.astro'; import NavBarSidebar from './NavBarSidebar.astro'; import SideBar from './SideBar.astro'; diff --git a/src/app/PublicProfileLayout.astro b/src/app/PublicProfileLayout.astro new file mode 100644 index 000000000..b76adf6a6 --- /dev/null +++ b/src/app/PublicProfileLayout.astro @@ -0,0 +1,16 @@ +--- +import NavBarSidebar from "./NavBarSidebar.astro"; + +--- + + +
+
+ + +
+
diff --git a/src/app/SideBar.astro b/src/app/SideBar.astro index 0a0e7247f..62e3d9e49 100644 --- a/src/app/SideBar.astro +++ b/src/app/SideBar.astro @@ -1,7 +1,7 @@ --- -import { pathRoutes } from "../config/pathRoutes"; +import EcosystemSidebarOption from '../components/Ecosystem/EcosystemSidebarOption'; +import { pathRoutes } from '../config/pathRoutes'; /* eslint max-lines: 'off' */ - --- @@ -22,11 +22,11 @@ import { pathRoutes } from "../config/pathRoutes"; ]} >
- - + + + + Verification + + + + + + - - - -
  • - - -
  • + + --> +
    - - - + + + Support + + - - - + - + sidebarBackdrop?.addEventListener('click', () => { + toggleSidebarMobile( + sidebar, + sidebarBackdrop, + toggleSidebarMobileHamburger, + toggleSidebarMobileClose, + ); + }); + } + + + diff --git a/src/assets/Credential_Card.svg b/src/assets/Credential_Card.svg deleted file mode 100644 index a9a4536dc..000000000 --- a/src/assets/Credential_Card.svg +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/assets/Invitation_Card.svg b/src/assets/Invitation_Card.svg deleted file mode 100644 index 04673e7df..000000000 --- a/src/assets/Invitation_Card.svg +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/assets/Schema_Card.svg b/src/assets/Schema_Card.svg deleted file mode 100644 index ca9322119..000000000 --- a/src/assets/Schema_Card.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/src/assets/User_Card.svg b/src/assets/User_Card.svg deleted file mode 100644 index 0bd383669..000000000 --- a/src/assets/User_Card.svg +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/assets/cred-icon.svg b/src/assets/cred-icon.svg new file mode 100644 index 000000000..ac3261b70 --- /dev/null +++ b/src/assets/cred-icon.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/src/assets/endorser-icon.svg b/src/assets/endorser-icon.svg new file mode 100644 index 000000000..a1c8aefb9 --- /dev/null +++ b/src/assets/endorser-icon.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/member-icon.svg b/src/assets/member-icon.svg new file mode 100644 index 000000000..1a8e09262 --- /dev/null +++ b/src/assets/member-icon.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/assets/schema-icon.svg b/src/assets/schema-icon.svg new file mode 100644 index 000000000..65e0e4b8c --- /dev/null +++ b/src/assets/schema-icon.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/assets/users-icon.svg b/src/assets/users-icon.svg new file mode 100644 index 000000000..c91d565c3 --- /dev/null +++ b/src/assets/users-icon.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/common/enums.ts b/src/common/enums.ts index 5b52d2eb8..d8a16e7d7 100644 --- a/src/common/enums.ts +++ b/src/common/enums.ts @@ -36,3 +36,20 @@ export enum IssueCredentialUserText { done = 'Accepted', abandoned = 'Declined' } + +export enum EndorsementType { + schema = 'schema', + credDef = 'credential-definition' +} + +export enum EndorsementStatus { + signed = "signed", + rejected = "declined", + requested = "requested", + submited = "submited" +} + +export enum EcosystemRoles { + ecosystemMember = "Ecosystem Member", + ecosystemLead = "Ecosystem Lead" +} diff --git a/src/common/global.css b/src/common/global.css new file mode 100644 index 000000000..8d2bbff13 --- /dev/null +++ b/src/common/global.css @@ -0,0 +1,22 @@ +.custom-shadow-blue { + box-shadow: -4px 0px 50px 0px rgba(31, 78, 173, 0.50); +} + +.min-h-content { + display: flex; + flex-direction: column; + justify-content: space-between; + min-height: calc(100vh - 64px); +} + +input[type="radio"] { + @apply !text-primary-700; +} + +ul[role="tablist"] li[role="presentation"] button[aria-selected="true"] { + @apply text-primary-700 border-primary-700; +} + +#schema-cards div[data-testid="flowbite-card"] div { + @apply justify-start; +} \ No newline at end of file diff --git a/src/commonComponents/ConfirmPopup.tsx b/src/commonComponents/ConfirmPopup.tsx new file mode 100644 index 000000000..6385d1bfd --- /dev/null +++ b/src/commonComponents/ConfirmPopup.tsx @@ -0,0 +1,88 @@ +import { Button, Modal } from 'flowbite-react'; + +interface IProps { + openModal: boolean; + closeModal: (flag: boolean) => void; + onSuccess: (flag: boolean) => void; + message: string + isProcessing: boolean +} + +const ConfirmModal = (props: IProps) => { + return ( + +
    +
    + +
    + +

    + {props.message} +

    + + +
    +
    +
    +
    + ); +}; + +export default ConfirmModal; \ No newline at end of file diff --git a/src/commonComponents/CredentialDefinitionCard.tsx b/src/commonComponents/CredentialDefinitionCard.tsx index e20654453..abcab12b8 100644 --- a/src/commonComponents/CredentialDefinitionCard.tsx +++ b/src/commonComponents/CredentialDefinitionCard.tsx @@ -1,44 +1,70 @@ import { Button, Card } from 'flowbite-react'; -const CredDeffCard = (props: { credDeffName: string, credentialDefinitionId: string, schemaId: string, revocable: boolean, onClickCallback: (schemaId: string, credentialDefinitionId: string) => void; }) => { - return ( - { +import { Roles } from '../utils/enums/roles'; + +interface IProps { + credDeffName: string, + userRoles?: string[], + credentialDefinitionId: string + schemaId: string + revocable: boolean + onClickCallback: (schemaId: string, credentialDefinitionId: string) => void; +} + +const CredDeffCard = (props: IProps) => { + + const redirectToIssuance = () => { + if (props?.userRoles?.includes(Roles.OWNER) + || props?.userRoles?.includes(Roles.ADMIN) + || props?.userRoles?.includes(Roles.ISSUER)) { props.onClickCallback(props.schemaId, props.credentialDefinitionId) - }} className=' cursor-pointer overflow-hidden overflow-ellipsis' style={{ maxHeight: '100%', maxWidth: '100%', overflow: 'auto' }}> -
    -
    {/* This will take up 2/3 of the available width on larger screens */} -
    + + } + } + + return ( + +
    +
    {/* This will take up 2/3 of the available width on larger screens */} +
    {props.credDeffName}
    -
    - -
    + style={{ height: '1.5rem', width: '100%', minWidth: '2rem' }} + > +
    +   + +
    + + Issue + +
    + } +
    -
    +

    ID : {props.credentialDefinitionId}

    Schema ID:{props.schemaId}

    -
    +
    Revocable: <> void + classes?: string +} + +const DashboardCard = ({ icon, backgroundColor, label, value, onClickHandler, classes }: IProps) => { + return ( + + ) +} + +export default DashboardCard \ No newline at end of file diff --git a/src/commonComponents/DeletePopup.tsx b/src/commonComponents/DeletePopup.tsx index 5a626310c..92a7328fe 100644 --- a/src/commonComponents/DeletePopup.tsx +++ b/src/commonComponents/DeletePopup.tsx @@ -42,7 +42,7 @@ const DeleteModal = (props: { openModal: boolean; closeModal: (flag: boolean) =>

    Are you sure you want to revoke{' '} - {props.deviceName} device? + {props.deviceName} ?

    -

    +

    {props?.deviceFriendlyName}

    - - {dateConversion(new Date(props.createDateTime).toLocaleDateString('en-GB'))} -

    + {dateConversion(props?.createDateTime)}

    {props.credentialID}

    @@ -109,7 +109,10 @@ const DeviceDetails = (props: { deviceFriendlyName: string, createDateTime: stri diff --git a/src/commonComponents/EditPopup.tsx b/src/commonComponents/EditPopup.tsx index de41c8c29..e1ac97c72 100644 --- a/src/commonComponents/EditPopup.tsx +++ b/src/commonComponents/EditPopup.tsx @@ -4,7 +4,6 @@ import React, { useEffect, useState } from 'react'; import * as yup from 'yup'; const EditModal = (props: { openModal: boolean; closeModal: (flag: boolean) => void; onSucess: (name: string) => void }) => { - const [name, setName] = useState(null) interface nameValue { name: string; } diff --git a/src/commonComponents/PasseyAddDevicePopup.tsx b/src/commonComponents/PasseyAddDevicePopup.tsx index 691796223..d24e4741b 100644 --- a/src/commonComponents/PasseyAddDevicePopup.tsx +++ b/src/commonComponents/PasseyAddDevicePopup.tsx @@ -42,7 +42,7 @@ const PasskeyAddDevice = (props: { } const passkeyUserDetailsResp = await addPasskeyUserDetails(payload, storedEmail) const { data } = passkeyUserDetailsResp as AxiosResponse - if (data?.statusCode === apiStatusCodes.API_STATUS_CREATED) { + if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) { setSuccess('User details updated successfully') setNextFlag(true) } else { diff --git a/src/commonComponents/SchemaCard.tsx b/src/commonComponents/SchemaCard.tsx index e141741de..daf881e7d 100644 --- a/src/commonComponents/SchemaCard.tsx +++ b/src/commonComponents/SchemaCard.tsx @@ -2,14 +2,26 @@ import { Card } from 'flowbite-react'; import { dateConversion } from '../utils/DateConversion'; import DateTooltip from '../components/Tooltip'; -const SchemaCard = (props: {className:string, schemaName: string, version: string, schemaId: string, issuerDid: string, attributes: [], created: string, onClickCallback: (schemaId: string, attributes: string[], issuerDid:string, created:string) => void; }) => { +interface IProps { + className?: string, + schemaName: string, + version: string, + schemaId: string, + issuerDid: string, + attributes: [], + created: string, + onClickCallback: (schemaId: string, attributes: string[], issuerDid: string, created: string) => void; +} +const SchemaCard = (props: IProps) => { return ( { props.onClickCallback(props.schemaId, props.attributes, props.issuerDid, props.created) - }} className='transform transition duration-500 hover:scale-105 hover:bg-gray-50 cursor-pointer' style={{ maxWidth: '100%', maxHeight: '100%', overflow: 'auto' }}> -
    -
    -
    + }} + id="schema-cards" + className='transform transition duration-500 hover:scale-105 hover:bg-gray-50 cursor-pointer h-full w-full overflow-hidden'> +
    +
    +
    {props.schemaName}

    @@ -18,7 +30,7 @@ const SchemaCard = (props: {className:string, schemaName: string, version: strin

    - + Created: {dateConversion(props.created)}

    @@ -31,39 +43,40 @@ const SchemaCard = (props: {className:string, schemaName: string, version: strin Issuer DID: {props.issuerDid}

    - Ledger: {props.issuerDid.split(":")[2]} + Ledger: {props.issuerDid.split(":")[2]}

      -
    • +
    • -
      +
      Attributes: - {props.attributes && props.attributes.length > 0 && ( - <> - {props?.attributes?.slice(0, 4).map((element, index) => ( - - {element?.attributeName} - - ))} - {props?.attributes?.length > 3 && ...} - - )} +
      + + {props.attributes && props.attributes.length > 0 && ( + <> + {props?.attributes?.slice(0, 3).map((element, index) => ( +
      + + {element?.attributeName} + +
      + ))} + {props?.attributes?.length > 3 && ...} + + )} +
      -
    • -
    ) } - - export default SchemaCard \ No newline at end of file diff --git a/src/commonComponents/StatusTabletTag.tsx b/src/commonComponents/StatusTabletTag.tsx new file mode 100644 index 000000000..a29f9196a --- /dev/null +++ b/src/commonComponents/StatusTabletTag.tsx @@ -0,0 +1,47 @@ +import { EndorsementStatus } from "../common/enums" + +interface IStatusTabletTag { + status: string +} + +const StatusTabletTag = ({ status }: IStatusTabletTag) => { + const color = () => { + switch (true) { + case status === EndorsementStatus.signed: + return { + style: `bg-[#fca20033] text-[#FCA200]`, + title: "Accepted" + } + case status === EndorsementStatus.rejected: + return { + style: `bg-[#FFE4E4] text-[#EA5455]`, + title: "Rejected" + } + case status === EndorsementStatus.requested: + return { + style: `bg-[#1f4ead33] text-[#1F4EAD]`, + title: "Requested" + } + case status === EndorsementStatus.submited: + return { + style: `bg-[#70ffa01a] text-[#28C76F]`, + title: "Submitted" + } + default: + return { + style: `bg-[#FFE4E4] text-[#EA5455]`, + title: "NA" + } + } + } + + const { style, title } = color() + + return ( +
    + {title} +
    + ) +} + +export default StatusTabletTag \ No newline at end of file diff --git a/src/commonComponents/backbutton/index.tsx b/src/commonComponents/backbutton/index.tsx new file mode 100644 index 000000000..8a401a20c --- /dev/null +++ b/src/commonComponents/backbutton/index.tsx @@ -0,0 +1,34 @@ +import { Button } from 'flowbite-react'; + +const index = ({ path }: { path: string }) => { + return ( +
    + +
    + ); +}; + +export default index; diff --git a/src/commonComponents/datatable/index.tsx b/src/commonComponents/datatable/index.tsx index ffea60152..e03116289 100644 --- a/src/commonComponents/datatable/index.tsx +++ b/src/commonComponents/datatable/index.tsx @@ -31,6 +31,7 @@ const DataTable: React.FC = ({ header,displaySelect, data, loadi {header && header.length > 0 && header.map(ele => ( @@ -44,10 +45,10 @@ const DataTable: React.FC = ({ header,displaySelect, data, loadi {data.length ? data.map((ele, index) => ( - + - {ele.data.map(subEle => ( - + {ele.data.map((subEle,index) => ( +
    {subEle.data}
    {subEle.subData && subEle.subData} diff --git a/src/components/AlertComponent/index.tsx b/src/components/AlertComponent/index.tsx index 89d2ef8b2..28827512a 100644 --- a/src/components/AlertComponent/index.tsx +++ b/src/components/AlertComponent/index.tsx @@ -1,6 +1,6 @@ import { Alert } from 'flowbite-react'; -export const AlertComponent = ({ message, type, viewButton, onAlertClose }: { message: string | null, type: string, viewButton?: boolean, onAlertClose: () => void }) => { +export const AlertComponent = ({ message, type, viewButton, onAlertClose, path='' }: { message: string | null, type: string, viewButton?: boolean, path?:string, onAlertClose: () => void }) => { return message !== null ? - View more... + View more...

    } @@ -24,4 +24,4 @@ export const AlertComponent = ({ message, type, viewButton, onAlertClose }: { me
    : <> -} \ No newline at end of file +} diff --git a/src/components/Authentication/FooterBar.tsx b/src/components/Authentication/FooterBar.tsx index ebcc9fd27..537b97196 100644 --- a/src/components/Authentication/FooterBar.tsx +++ b/src/components/Authentication/FooterBar.tsx @@ -2,9 +2,9 @@ import React from 'react' const FooterBar = () => { return ( -