diff --git a/package-lock.json b/package-lock.json index 56b58d11b..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", @@ -1412,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", @@ -1458,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", @@ -2015,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", @@ -4240,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", @@ -6808,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, @@ -6822,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, @@ -9143,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": { @@ -9170,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": { @@ -9354,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": { @@ -10747,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" }, @@ -11813,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", @@ -12419,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" - } } } }, @@ -13348,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": { @@ -13398,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", @@ -13774,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": { @@ -15351,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": { @@ -17013,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" + } + } + } } } }, @@ -18521,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", @@ -18539,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" @@ -18665,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": { @@ -18703,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 @@ -19593,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" }, @@ -20374,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/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..a4d57b30d 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) => { @@ -171,12 +161,9 @@ export const addPasskeyUserDetails = async(payload: AddPassword, email:string) = 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..2c21c6dde 100644 --- a/src/api/Fido.ts +++ b/src/api/Fido.ts @@ -27,7 +27,7 @@ export const generateRegistrationOption = async (payload: RegistrationOptionInte } } -export const verifyRegistration = async (payload:unknown, userEmail:string) => { +export const verifyRegistration = async (payload:verifyRegistrationObjInterface, userEmail:string) => { const token = await getFromLocalStorage(storageKeys.TOKEN) const details = { url: `${apiRoutes.fido.verifyRegistration}${userEmail}`, diff --git a/src/api/invitations.ts b/src/api/invitations.ts index 396ae62ba..ee2af5f76 100644 --- a/src/api/invitations.ts +++ b/src/api/invitations.ts @@ -8,7 +8,11 @@ export const getOrganizationInvitations = async (pageNumber: number, pageSize: n const orgId = await getFromLocalStorage(storageKeys.ORG_ID) - const url = `${apiRoutes.organizations.invitations}/${orgId}?pageNumber=${pageNumber}&pageSize=${pageSize}&search=${search}` + 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) @@ -36,7 +40,7 @@ export const createInvitations = async (invitationList: Array) => { const orgId = await getFromLocalStorage(storageKeys.ORG_ID) - const url = apiRoutes.organizations.invitations + const url = `${apiRoutes.organizations.root}/${orgId}${apiRoutes.organizations.invitations}` const payload = { invitations: invitationList, orgId: Number(orgId) @@ -94,10 +98,9 @@ export const getUserInvitations = async (pageNumber: number, pageSize: number, s // Accept/ Reject Invitations export const acceptRejectInvitations = async (invitationId: number,orgId: number, status: string) => { - const url = apiRoutes.users.invitations + const url = `${apiRoutes.users.invitations}/${invitationId}` const payload = { - invitationId, orgId: Number(orgId), status } diff --git a/src/api/organization.ts b/src/api/organization.ts index 10423df99..2543b8dc7 100644 --- a/src/api/organization.ts +++ b/src/api/organization.ts @@ -1,4 +1,4 @@ -import { axiosGet, axiosPost, axiosPublicUserGet, axiosPut } from "../services/apiRequests" +import { axiosGet, axiosPost, 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, @@ -341,3 +344,4 @@ export const getPublicOrganizations = async (pageNumber: number, pageSize: numbe return err?.message } } + diff --git a/src/components/Authentication/ResetPassword.tsx b/src/components/Authentication/ResetPassword.tsx index 2112dd19f..602eeba43 100644 --- a/src/components/Authentication/ResetPassword.tsx +++ b/src/components/Authentication/ResetPassword.tsx @@ -13,8 +13,8 @@ import FooterBar from './FooterBar.js'; import NavBar from './NavBar.js'; import { addPasskeyUserDetails, passwordEncryption, setToLocalStorage } from '../../api/Auth.js'; import type { AxiosResponse } from 'axios'; -import React from 'react'; import { PassInvisible, PassVisible, SignUpArrow } from './Svg.js'; +import React from 'react'; interface passwordValues { password: string; diff --git a/src/components/Authentication/SignInUserPasskey.tsx b/src/components/Authentication/SignInUserPasskey.tsx index 37286be51..94e1921fb 100644 --- a/src/components/Authentication/SignInUserPasskey.tsx +++ b/src/components/Authentication/SignInUserPasskey.tsx @@ -95,7 +95,6 @@ const SignInUserPasskey = (signInUserProps: signInUserProps) => { ...attResp, challangeId }; - setFidoLoader(false) const verificationResp = await verifyAuthenticationMethod(verifyAuthenticationObj, { userName: email }); const { data } = verificationResp as AxiosResponse if (data?.data.verified) { diff --git a/src/components/Authentication/SignInUserPassword.tsx b/src/components/Authentication/SignInUserPassword.tsx index df06a4ab4..983ea8a10 100644 --- a/src/components/Authentication/SignInUserPassword.tsx +++ b/src/components/Authentication/SignInUserPassword.tsx @@ -8,17 +8,17 @@ import { Form, Formik, } from 'formik'; -import React, { useState } from 'react'; import { apiStatusCodes, storageKeys } from '../../config/CommonConstant'; import { getUserProfile, loginUser, passwordEncryption, setToLocalStorage } from '../../api/Auth'; import { Alert } from 'flowbite-react'; import type { AxiosResponse } from 'axios'; import CustomSpinner from '../CustomSpinner'; -import FooterBar from './FooterBar'; -import NavBar from './NavBar'; import SignInUserPasskey from './SignInUserPasskey'; import { getSupabaseClient } from '../../supabase'; +import NavBar from './NavBar'; +import FooterBar from './FooterBar'; +import React, { useState } from 'react'; interface emailValue { email: string; @@ -47,23 +47,22 @@ const SignInUserPassword = (signInUserProps: SignInUser3Props) => { const getUserDetails = async (access_token: string) => { + const userDetails = await getUserProfile(access_token); const { data } = userDetails as AxiosResponse if (data?.data?.userOrgRoles?.length > 0) { + const permissionArray: number | string[] = [] data?.data?.userOrgRoles?.forEach((element: { orgRole: { name: string } }) => permissionArray.push(element?.orgRole?.name)); - await setToLocalStorage(storageKeys.PERMISSIONS, permissionArray) await setToLocalStorage(storageKeys.USER_PROFILE, data?.data) await setToLocalStorage(storageKeys.USER_EMAIL, data?.data?.email) - window.location.href = '/dashboard' } else { setFailure(userDetails as string) } + setLoading(false) } - - const signInUser = async (values: passwordValue) => { const payload: SignInUser3Props = { email: email, @@ -73,10 +72,8 @@ const SignInUserPassword = (signInUserProps: SignInUser3Props) => { setLoading(true) const loginRsp = await loginUser(payload) const { data } = loginRsp as AxiosResponse - if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) { await setToLocalStorage(storageKeys.TOKEN, data?.data?.access_token) - const response = await fetch('/api/auth/signin', { method: "POST", headers: { @@ -88,7 +85,6 @@ const SignInUserPassword = (signInUserProps: SignInUser3Props) => { if (response.redirected) { getUserDetails(data?.data?.access_token) } - } else { setLoading(false) setFailure(loginRsp as string) diff --git a/src/components/Authentication/SignUpUser.tsx b/src/components/Authentication/SignUpUser.tsx index 8a4949a75..7b481ea4f 100644 --- a/src/components/Authentication/SignUpUser.tsx +++ b/src/components/Authentication/SignUpUser.tsx @@ -48,7 +48,7 @@ const SignUpUser = () => { setVerifyLoader(true) const userRsp = await sendVerificationMail(payload); const { data } = userRsp as AxiosResponse; - if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) { + if (data?.statusCode === apiStatusCodes.API_STATUS_CREATED) { setVerificationSuccess(data?.message) setVerifyLoader(false) @@ -68,12 +68,14 @@ const SignUpUser = () => { const userRsp = await checkUserExist(values?.email) const { data } = userRsp as AxiosResponse setLoading(false) + console.log("data:56576", data) if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) { - if (data.data === 'New User') { + if (data?.data?.isExist === false) { + console.log('email data::', data.data) setEmail(values?.email) await VerifyMail(values?.email) } - else if (data.data.isEmailVerified === true && data?.data?.isKeycloak !== true) { + else if (data.data.isEmailVerified === true && data?.data?.isSupabase!== true) { setEmail(values?.email) await setToLocalStorage(storageKeys.USER_EMAIL, values?.email) setNextFlag(true) diff --git a/src/components/Authentication/SignUpUserPasskey.tsx b/src/components/Authentication/SignUpUserPasskey.tsx index 7abee556e..112199503 100644 --- a/src/components/Authentication/SignUpUserPasskey.tsx +++ b/src/components/Authentication/SignUpUserPasskey.tsx @@ -22,7 +22,7 @@ interface passwordValues { confirmPassword: string } -const SignUpUserPasskey = ({ firstName, lastName }: { firstName: string; lastName: string }) => { +const SignUpUserPasskey = ({ email,firstName, lastName }: { email:string,firstName: string; lastName: string }) => { const [loading, setLoading] = useState(false) const [erroMsg, setErrMsg] = useState(null) @@ -63,17 +63,19 @@ const SignUpUserPasskey = ({ firstName, lastName }: { firstName: string; lastNam const userEmail = await getFromLocalStorage(storageKeys.USER_EMAIL) const password: string = uuidv4(); let payload: AddPasswordDetails = { + email: userEmail, isPasskey: fidoFlag, firstName: firstName, lastName: lastName, password: passwordEncryption(password) }; if (!fidoFlag) { + payload.password = passwordDetails?.password; } setLoading(true) - const userRsp = await addPasswordDetails(payload, userEmail) + const userRsp = await addPasswordDetails(payload) const { data } = userRsp as AxiosResponse setLoading(false) if (data?.statusCode === apiStatusCodes.API_STATUS_CREATED) { @@ -317,6 +319,7 @@ const SignUpUserPasskey = ({ firstName, lastName }: { firstName: string; lastNam { currentComponent === 'password' && ( diff --git a/src/components/Authentication/SignUpUserPassword.tsx b/src/components/Authentication/SignUpUserPassword.tsx index 08d129bf5..d8d5a07d8 100644 --- a/src/components/Authentication/SignUpUserPassword.tsx +++ b/src/components/Authentication/SignUpUserPassword.tsx @@ -24,14 +24,17 @@ import PasswordSuggestionBox from './PasswordSuggestionBox.js'; import { PassInvisible, PassVisible, SignUpArrow } from './Svg.js'; interface passwordValues { + email: string; password: string; confirmPassword: string; } const SignUpUserPassword = ({ + email, firstName, lastName, }: { + email: string, firstName: string; lastName: string; }) => { @@ -44,16 +47,18 @@ const SignUpUserPassword = ({ const [showSuggestion, setShowSuggestion] = useState(false); const submit = async (passwordDetails: passwordValues, fidoFlag: boolean) => { + const userEmail = await getFromLocalStorage(storageKeys.USER_EMAIL); const payload = { + email: userEmail, password: passwordEncryption(passwordDetails?.password), isPasskey: false, firstName, lastName, }; + setLoading(true); - const userEmail = await getFromLocalStorage(storageKeys.USER_EMAIL); - const userRsp = await addPasswordDetails(payload, userEmail); + const userRsp = await addPasswordDetails(payload); const { data } = userRsp as AxiosResponse; setLoading(false); if (data?.statusCode === apiStatusCodes.API_STATUS_CREATED) { @@ -69,6 +74,7 @@ const SignUpUserPassword = ({ }; const initialValues = { + email: email, firstName: '', lastName: '', password: '', @@ -89,7 +95,7 @@ const SignUpUserPassword = ({ return (
{showSignUpUser ? ( - + ) : (
diff --git a/src/components/Profile/AddPasskey.tsx b/src/components/Profile/AddPasskey.tsx index ffa9c9de8..2ff8de60f 100644 --- a/src/components/Profile/AddPasskey.tsx +++ b/src/components/Profile/AddPasskey.tsx @@ -100,7 +100,6 @@ const AddPasskey = () => { ...attResp, challangeId } - console.log("verifyRegistrationObj::::", verifyRegistrationObj) await verifyRegistrationMethod(verifyRegistrationObj, OrgUserEmail); } catch (error) { showFidoError(error) @@ -140,11 +139,8 @@ const AddPasskey = () => { const { data } = deviceDetailsResp as AxiosResponse if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) { setAddSuccess("Device added successfully") - setTimeout(() => { - // userDeviceDetails() // required - setAddSuccess('') - window.location.href = `${apiRoutes.auth.profile}` - }, 4000) + userDeviceDetails() + window.location.href = `${apiRoutes.auth.profile}` } else { setAddFailur(deviceDetailsResp as string) } diff --git a/src/components/Profile/DisplayUserProfile.tsx b/src/components/Profile/DisplayUserProfile.tsx index e40640073..cce777def 100644 --- a/src/components/Profile/DisplayUserProfile.tsx +++ b/src/components/Profile/DisplayUserProfile.tsx @@ -1,5 +1,5 @@ -import CustomAvatar from '../Avatar' import type { UserProfile } from "./interfaces"; +import CustomAvatar from '../Avatar' interface DisplayUserProfileProps { toggleEditProfile: () => void; @@ -76,20 +76,6 @@ interface DisplayUserProfileProps {
-
  • -
    - -
    -

    - Public view -

    -

    - - {userProfileInfo?.publicProfile ? " Public" : "Private"} -

    -
    -
    -
  • diff --git a/src/components/Profile/EditUserProfile.tsx b/src/components/Profile/EditUserProfile.tsx index bc90a1db7..216e829bc 100644 --- a/src/components/Profile/EditUserProfile.tsx +++ b/src/components/Profile/EditUserProfile.tsx @@ -1,22 +1,20 @@ -import * as yup from "yup" - -import { Avatar, Button, Label } from "flowbite-react"; -import { Field, Form, Formik, FormikHelpers } from "formik"; -import { IMG_MAX_HEIGHT, IMG_MAX_WIDTH, apiStatusCodes, imageSizeAccepted, storageKeys } from "../../config/CommonConstant"; -import { SetStateAction, useEffect, useState } from "react"; -import { calculateSize, dataURItoBlob } from "../../utils/CompressImage"; +import { useEffect, useState } from "react"; +import type { UserProfile } from "./interfaces"; import { getFromLocalStorage, getUserProfile, updateUserProfile } from "../../api/Auth"; - +import { IMG_MAX_HEIGHT, IMG_MAX_WIDTH, apiStatusCodes, imageSizeAccepted, storageKeys } from "../../config/CommonConstant"; import type { AxiosResponse } from "axios"; import CustomAvatar from '../Avatar' -import type { UserProfile } from "./interfaces"; +import { calculateSize, dataURItoBlob } from "../../utils/CompressImage"; +import { Avatar, Button, Label } from "flowbite-react"; +import { Field, Form, Formik, FormikHelpers } from "formik"; import { asset } from "../../lib/data"; +import * as yup from "yup" interface Values { profileImg: string; firstName: string; lastName: string; - email: string; + email:string; } interface ILogoImage { @@ -34,22 +32,18 @@ const UpdateUserProfile = ({ toggleEditProfile, userProfileInfo, updateProfile } const [loading, setLoading] = useState(false) const [isImageEmpty, setIsImageEmpty] = useState(true) - - const [isPublic, setIsPublic] = useState(true) - const [initialProfileData, setInitialProfileData] = useState({ profileImg: userProfileInfo?.profileImg || "", firstName: userProfileInfo?.firstName || "", lastName: userProfileInfo?.lastName || "", - email: userProfileInfo?.email || "" + email: userProfileInfo?.email || "", + }) const [logoImage, setLogoImage] = useState({ logoFile: '', imagePreviewUrl: userProfileInfo?.profileImg || "", fileName: '' }) - - useEffect(() => { @@ -58,7 +52,8 @@ const UpdateUserProfile = ({ toggleEditProfile, userProfileInfo, updateProfile } profileImg: userProfileInfo?.profileImg || "", firstName: userProfileInfo.firstName || '', lastName: userProfileInfo.lastName || '', - email: userProfileInfo?.email + email: userProfileInfo?.email, + }); setLogoImage({ @@ -126,7 +121,7 @@ const UpdateUserProfile = ({ toggleEditProfile, userProfileInfo, updateProfile } ...logoImage, imagePreviewUrl: '', }); - + const reader = new FileReader() const file = event?.target?.files @@ -151,37 +146,39 @@ const UpdateUserProfile = ({ toggleEditProfile, userProfileInfo, updateProfile } const updateUserDetails = async (values: Values) => { + console.log(`Image::`, logoImage?.imagePreviewUrl); + + setLoading(true) const userData = { - id: userProfileInfo?.id as number, firstName: values.firstName, lastName: values.lastName, email: values.email, - profileImg: logoImage?.imagePreviewUrl as string || values?.profileImg, - isPublic + profileImg: logoImage?.imagePreviewUrl as string || values?.profileImg + } const resUpdateUserDetails = await updateUserProfile(userData) - setLoading(false) const { data } = resUpdateUserDetails as AxiosResponse - if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) { - updateProfile(userData); - } + updateProfile(userData); + + setLoading(false) + } const validationSchema = yup.object().shape({ firstName: yup.string() - .required("First Name is required") - .min(2, 'First name must be at least 2 characters') - .max(255, 'First name must be at most 255 characters'), + .required("First Name is required") + .min(2, 'First name must be at least 2 characters') + .max(255, 'First name must be at most 255 characters'), lastName: yup.string() - .required("Last Name is required") - .min(2, 'Last name must be at least 2 characters') - .max(255, 'Last name must be at most 255 characters') + .required("Last Name is required") + .min(2, 'Last name must be at least 2 characters') + .max(255, 'Last name must be at most 255 characters') }); @@ -194,18 +191,17 @@ const UpdateUserProfile = ({ toggleEditProfile, userProfileInfo, updateProfile } - ) => { + ) => { if (!values.firstName || !values.lastName) { return; } + updateUserDetails(values); toggleEditProfile(); - }} - + validationSchema={validationSchema}> {(formikHandlers): JSX.Element => (
    ) : ( - )} + )}

    @@ -254,25 +250,25 @@ const UpdateUserProfile = ({ toggleEditProfile, userProfileInfo, updateProfile }

    + type="button" + className="absolute top-0 right-0 w-6 h-6 m-2 " + onClick={toggleEditProfile} + > + + + + + + + + @@ -320,50 +316,6 @@ const UpdateUserProfile = ({ toggleEditProfile, userProfileInfo, updateProfile } } -
    -
    -
    -
    - setIsPublic(false)} - id="private" - name="private" - /> - Private - Only the connected organization can see you organization details - -
    -
    -
    -
    - setIsPublic(true)} - checked={isPublic === true} - id="public" - name="public" - /> - Public - Your profile and organization details can be seen by everyone -
    -
    -
    diff --git a/src/components/Profile/interfaces/index.ts b/src/components/Profile/interfaces/index.ts index f9b37eb6d..72cc41132 100644 --- a/src/components/Profile/interfaces/index.ts +++ b/src/components/Profile/interfaces/index.ts @@ -57,4 +57,4 @@ export interface UserProfile { keycloakUserId?: string publicProfile?: boolean isPublic?:boolean -} \ No newline at end of file +} diff --git a/src/components/Resources/Schema/Create.tsx b/src/components/Resources/Schema/Create.tsx index 5660dbc33..00a57857d 100644 --- a/src/components/Resources/Schema/Create.tsx +++ b/src/components/Resources/Schema/Create.tsx @@ -4,13 +4,8 @@ import * as yup from 'yup'; import { Alert, Button, Card, Label, Table } from 'flowbite-react'; import { Field, FieldArray, Form, Formik } from 'formik'; -import { - apiStatusCodes, - schemaVersionRegex, - storageKeys, -} from '../../../config/CommonConstant'; +import {apiStatusCodes,schemaVersionRegex,storageKeys} from '../../../config/CommonConstant'; import { useEffect, useState } from 'react'; - import type { AxiosResponse } from 'axios'; import BreadCrumbs from '../../BreadCrumbs'; import type { FieldName, Values } from './interfaces'; @@ -19,477 +14,546 @@ import { addSchema } from '../../../api/Schema'; import { getFromLocalStorage } from '../../../api/Auth'; import { pathRoutes } from '../../../config/pathRoutes'; -const options = [ - { value: 'string', label: 'String' }, - { value: 'number', label: 'Number' }, - { value: 'date', label: 'Date' }, -]; - -const CreateSchema = () => { - const [failure, setFailure] = useState(null); - const [orgId, setOrgId] = useState(0); - const [orgDid, setOrgDid] = useState(''); - const [createloader, setCreateLoader] = useState(false); - - useEffect(() => { - const fetchData = async () => { - const organizationId = await getFromLocalStorage(storageKeys.ORG_ID); - setOrgId(Number(organizationId)); - }; - - fetchData(); - }, []); - - const submit = async (values: Values) => { - setCreateLoader(true); - const schemaFieldName: FieldName = { - schemaName: values.schemaName, - schemaVersion: values.schemaVersion, - attributes: values.attribute, - orgId: orgId, - }; - - const createSchema = await addSchema(schemaFieldName); - const { data } = createSchema as AxiosResponse; - if (data?.statusCode === apiStatusCodes.API_STATUS_CREATED) { - if (data?.data) { - setCreateLoader(false); - window.location.href = pathRoutes.organizations.schemas; - } else { - setFailure(createSchema as string); - setCreateLoader(false); - } - } else { - setCreateLoader(false); - setFailure(createSchema as string); - setTimeout(() => { - setFailure(null); - }, 4000); - } - }; - - return ( -
    -
    - -

    - Create Schema -

    -
    -
    - -
    - => { - values.attribute.forEach((element: any) => { - if (!element.schemaDataType) { - element.schemaDataType = 'string'; - } - }); - const updatedAttribute: Array = []; - values.attribute.forEach((element) => { - updatedAttribute.push(Number(element)); - }); - submit(values); - }} - > - {(formikHandlers): JSX.Element => ( - -
    -
    -
    -
    -
    - {' '} - - {formikHandlers.errors && - formikHandlers.touched.schemaName && - formikHandlers.errors.schemaName ? ( - - ) : ( - - )} -
    -
    -
    -
    -
    -
    - {' '} - - {formikHandlers.errors && - formikHandlers.touched.schemaVersion && - formikHandlers.errors.schemaVersion ? ( - - ) : ( - - )} -
    -
    -
    -
    - - {(fieldArrayProps: any): JSX.Element => { - const { form, remove, push } = fieldArrayProps; - const { values } = form; - const { attribute } = values; - - const areFirstInputsSelected = - values.schemaName && values.schemaVersion; - - return ( - <> -
    - Attributes * -
    -
    - {attribute.map((element: any, index: number) => ( -
    - -
    -
    - - {formikHandlers.touched.attribute && - attribute[index] && - formikHandlers?.errors?.attribute && - formikHandlers?.errors?.attribute[ - index - ] && - formikHandlers?.touched?.attribute[index] - ?.attributeName && - formikHandlers?.errors?.attribute[index] - ?.attributeName ? ( - - ) : ( - - )} -
    - -
    - - {options.map((opt) => { - return ( - - ); - })} - - {formikHandlers?.touched?.attribute && - attribute[index] && - formikHandlers?.errors?.attribute && - formikHandlers?.errors?.attribute[ - index - ] && - formikHandlers?.touched?.attribute[index] - ?.schemaDataType && - formikHandlers?.errors?.attribute[index] - ?.schemaDataType ? ( - - ) : ( - - )} -
    -
    - - - {formikHandlers?.touched?.attribute && - attribute[index] && - formikHandlers?.errors?.attribute && - formikHandlers?.errors?.attribute[ - index - ] && - formikHandlers?.touched?.attribute[index] - ?.displayName && - formikHandlers?.errors?.attribute[index] - ?.displayName ? ( - - ) : ( - - )} -
    - {index === 0 && attribute.length === 1 ? ( - '' - ) : ( -
    + const options = [ + { value: 'string', label: 'String' }, + { value: 'number', label: 'Number' }, + { value: 'date', label: 'Date' }, + ]; + + + const CreateSchema = () => { + const [failure, setFailure] = useState(null); + const [orgId, setOrgId] = useState(0); + const [orgDid, setOrgDid] = useState(''); + const [createloader, setCreateLoader] = useState(false); + + useEffect(() => { + const fetchData = async () => { + const organizationId = await getFromLocalStorage( + storageKeys.ORG_ID); + setOrgId(Number(organizationId)); + }; + + fetchData(); + }, []); + + const submit = async (values: Values) => { + setCreateLoader(true); + const schemaFieldName: FieldName = { + schemaName: values.schemaName, + schemaVersion: values.schemaVersion, + attributes: values.attribute, + orgId: orgId, + }; + + const createSchema = await addSchema(schemaFieldName); + const { data } = createSchema as AxiosResponse; + if (data?.statusCode === apiStatusCodes.API_STATUS_CREATED) { + + if (data?.data) { + setCreateLoader(false); + window.location.href = pathRoutes.organizations.schemas; + + } else { + setFailure(createSchema as string); + setCreateLoader(false); + } + } else { + setCreateLoader(false); + setFailure(createSchema as string); + setTimeout(() => { + setFailure(null); + }, 4000); + } + }; + + return ( +
    +
    + +

    + Create Schema +

    +
    +
    + +
    + => { + values.attribute.forEach((element: any) => { + + if (!element.schemaDataType) { + element.schemaDataType = 'string'; + } + }); + const updatedAttribute: Array = []; + values.attribute.forEach((element) => { + updatedAttribute.push(Number(element)); + + }); + submit(values); + }} + > + {(formikHandlers): JSX.Element => ( + + +
    +
    +
    +
    +
    + {' '} + + {formikHandlers.errors && + formikHandlers.touched.schemaName && + formikHandlers.errors.schemaName ? ( + + + ) : ( + + )} +
    +
    +
    +
    +
    +
    + {' '} + + {formikHandlers.errors && + formikHandlers.touched.schemaVersion && + formikHandlers.errors.schemaVersion ? ( + + + ) : ( + + )} +
    +
    +
    +
    + + {(fieldArrayProps: any): JSX.Element => { + const { form, remove, push } = fieldArrayProps; + const { values } = form; + const { attribute } = values; + + const areFirstInputsSelected = + values.schemaName && values.schemaVersion; + + return ( + <> +
    + Attributes * + +
    +
    + {attribute.map((element: any, index: number, schemaDataType:string) => ( + +
    + + +
    +
    + + {formikHandlers.touched.attribute && + attribute[index] && + formikHandlers?.errors?.attribute && + formikHandlers?.errors?.attribute[ + index + ] && + formikHandlers?.touched?.attribute[index] + ?.attributeName && + formikHandlers?.errors?.attribute[index] + + ?.attributeName ? ( + + ) : ( + + )} +
    + +
    + + {options.map((opt) => { + return ( + + ); + })} + + {formikHandlers?.touched?.attribute && + attribute[index] && + formikHandlers?.errors?.attribute && + formikHandlers?.errors?.attribute[ + index + ] && + formikHandlers?.touched?.attribute[index] + ?.schemaDataType && + formikHandlers?.errors?.attribute[index] + + ?.schemaDataType ? ( + + ) : ( + + )} +
    +
    + + + {formikHandlers?.touched?.attribute && + attribute[index] && + formikHandlers?.errors?.attribute && + formikHandlers?.errors?.attribute[ + index + ] && + formikHandlers?.touched?.attribute[index] + ?.displayName && + formikHandlers?.errors?.attribute[index] + + ?.displayName ? ( + + ) : ( + + )} +
    + + + +
    + {index === 0 && attribute.length === 1 ? ( +
    -
    - )} - {index === attribute.length - 1 && ( - - )} -
    -
    - ))} -
    - - ); - }} - -
    - - {failure && ( -
    - setFailure(null)}> - -

    {failure}

    -
    -
    -
    - )} -
    -
    + ) : ( + +
    + +
    + )} + + {index === attribute.length - 1 && ( +
    + + +
    + )} +
    +
    +
    +
    + ))} +
    + + ); + }} + +
    + + {failure && ( +
    + setFailure(null)}> + +

    {failure}

    +
    +
    +
    + )} +
    + -
    - -
    - -
    - -
    - +
    + +
    + +
    + +
    + -
    - - )} - -
    - -
    -
    - ); +
    + + )} +
    +
    +
    +
    +
    + ); }; -export default CreateSchema; +export default CreateSchema; \ No newline at end of file diff --git a/src/components/organization/CreateOrgFormModal.tsx b/src/components/organization/CreateOrgFormModal.tsx index 5883ef79a..8d359e421 100644 --- a/src/components/organization/CreateOrgFormModal.tsx +++ b/src/components/organization/CreateOrgFormModal.tsx @@ -185,8 +185,8 @@ const CreateOrgFormModal = (props: { openModal: boolean; setMessage: (message: s .trim(), description: yup .string() - .min(2, 'Organization name must be at least 2 characters') - .max(255, 'Organization name must be at most 255 characters') + .min(2, 'Description must be at least 2 characters') + .max(600, 'Description must be at most 600 characters') .required('Description is required') })} validateOnBlur diff --git a/src/components/organization/Dashboard.tsx b/src/components/organization/Dashboard.tsx index 51e241501..8aaaae52c 100644 --- a/src/components/organization/Dashboard.tsx +++ b/src/components/organization/Dashboard.tsx @@ -10,7 +10,6 @@ import Credential_Card from '../../assets/Credential_Card.svg'; import CustomAvatar from '../Avatar'; import CustomSpinner from '../CustomSpinner'; import EditOrgdetailsModal from './EditOrgdetailsModal'; -import Invitation_Card from '../../assets/Invitation_Card.svg'; import OrganizationDetails from './OrganizationDetails'; import { Roles } from '../../utils/enums/roles'; import Schema_Card from '../../assets/Schema_Card.svg'; diff --git a/src/components/organization/DedicatedIllustrate.tsx b/src/components/organization/DedicatedIllustrate.tsx index 3686b3e4d..6b4c9ba53 100644 --- a/src/components/organization/DedicatedIllustrate.tsx +++ b/src/components/organization/DedicatedIllustrate.tsx @@ -1,3 +1,4 @@ +import React from 'react'; import DedicatedIcon from '../../assets/dedicated.svg'; const DedicatedIllustrate = () => { diff --git a/src/components/organization/EditOrgdetailsModal.tsx b/src/components/organization/EditOrgdetailsModal.tsx index 3ee77c6cc..90bb8225e 100644 --- a/src/components/organization/EditOrgdetailsModal.tsx +++ b/src/components/organization/EditOrgdetailsModal.tsx @@ -2,21 +2,19 @@ import * as yup from "yup" import { Avatar, Button, Label, Modal } from 'flowbite-react'; import { Field, Form, Formik, FormikHelpers } from 'formik'; -import { IMG_MAX_HEIGHT, IMG_MAX_WIDTH, apiStatusCodes, imageSizeAccepted } from '../../config/CommonConstant' +import { IMG_MAX_HEIGHT, IMG_MAX_WIDTH, apiStatusCodes, imageSizeAccepted, storageKeys } from '../../config/CommonConstant' import { calculateSize, dataURItoBlob } from "../../utils/CompressImage"; import { useEffect, useState } from "react"; import { AlertComponent } from "../AlertComponent"; import type { AxiosResponse } from 'axios'; -import type { Organisation } from "./interfaces"; -import React from "react"; -// import { asset } from '../../lib/data.js'; import { updateOrganization } from "../../api/organization"; +import type { Organisation } from "./interfaces"; interface Values { + website: any; name: string; description: string; - radio1: string | boolean; } interface ILogoImage { @@ -38,20 +36,17 @@ const EditOrgdetailsModal = (props: EditOrgdetailsModalProps) => { const [logoImage, setLogoImage] = useState({ logoFile: "", imagePreviewUrl: props?.orgData?.logoUrl || "", - fileName: '', + fileName: '' , }) - - const [loading, setLoading] = useState(false) - const [isImageEmpty, setIsImageEmpty] = useState(true) const [isPublic, setIsPublic] = useState(true) const [initialOrgData, setOrgData] = useState({ name: props?.orgData?.name || "", description: props?.orgData?.description || "", - radio1: props?.orgData?.publicProfile?.toString() || "" + website: props?.orgData?.website || "", }) useEffect(() => { @@ -60,7 +55,7 @@ const EditOrgdetailsModal = (props: EditOrgdetailsModalProps) => { setOrgData({ name: props.orgData.name || '', description: props.orgData.description || '', - radio1: props?.orgData?.publicProfile.toString() + website: props?.orgData?.website || "", }); setLogoImage({ @@ -81,7 +76,7 @@ const EditOrgdetailsModal = (props: EditOrgdetailsModalProps) => { setOrgData({ name: '', description: '', - radio1: '' + website:'' }) setLogoImage({ @@ -134,7 +129,6 @@ const EditOrgdetailsModal = (props: EditOrgdetailsModalProps) => { } const isEmpty = (object: any): boolean => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars, guard-for-in for (const property in object) { setIsImageEmpty(false) return false @@ -176,11 +170,11 @@ const EditOrgdetailsModal = (props: EditOrgdetailsModalProps) => { name: values.name, description: values.description, logo: logoImage?.imagePreviewUrl as string || props?.orgData?.logoUrl, - website: "", + website: values.website, isPublic: isPublic } - const resUpdateOrg = await updateOrganization(orgData) + const resUpdateOrg = await updateOrganization(orgData, orgData.orgId?.toString() as string) const { data } = resUpdateOrg as AxiosResponse setLoading(false) @@ -230,7 +224,7 @@ const EditOrgdetailsModal = (props: EditOrgdetailsModalProps) => { description: yup .string() .min(2, 'Organization description must be at least 2 characters') - .max(600, 'Organization description must be at most 255 characters') + .max(600, 'Organization description must be at most 600 characters') .required('Description is required') })} validateOnBlur diff --git a/src/components/organization/WalletSpinup.tsx b/src/components/organization/WalletSpinup.tsx index 4f356ae04..101180289 100644 --- a/src/components/organization/WalletSpinup.tsx +++ b/src/components/organization/WalletSpinup.tsx @@ -86,17 +86,16 @@ const WalletSpinup = (props: { }; const submitDedicatedWallet = async (values: Values) => { - const orgId = await getFromLocalStorage(storageKeys.ORG_ID); const payload = { walletName: values.name, seed: seeds, - orgId: Number(orgId), walletPassword: passwordEncryption(values.password), clientSocketId: SOCKET.id, }; setLoading(true); - const spinupRes = await spinupDedicatedAgent(payload); + const orgId = await getFromLocalStorage(storageKeys.ORG_ID); + const spinupRes = await spinupDedicatedAgent(payload, parseInt(orgId)); const { data } = spinupRes as AxiosResponse; if (data?.statusCode === apiStatusCodes.API_STATUS_CREATED) { @@ -113,16 +112,15 @@ const WalletSpinup = (props: { const submitSharedWallet = async (values: ValuesShared) => { setLoading(true); - const orgId = await getFromLocalStorage(storageKeys.ORG_ID); const payload = { label: values.label, seed: seeds, - orgId: Number(orgId), clientSocketId: SOCKET.id, }; + const orgId = await getFromLocalStorage(storageKeys.ORG_ID); - const spinupRes = await spinupSharedAgent(payload); + const spinupRes = await spinupSharedAgent(payload, parseInt(orgId)); const { data } = spinupRes as AxiosResponse; if (data?.statusCode === apiStatusCodes.API_STATUS_CREATED) { diff --git a/src/components/organization/invitations/ReceivedInvitations.tsx b/src/components/organization/invitations/ReceivedInvitations.tsx index 916d0b62c..8cb2984dc 100644 --- a/src/components/organization/invitations/ReceivedInvitations.tsx +++ b/src/components/organization/invitations/ReceivedInvitations.tsx @@ -94,8 +94,7 @@ const ReceivedInvitations = () => { setLoading(true) const response = await acceptRejectInvitations(invite.id, invite.orgId, status); const { data } = response as AxiosResponse - - if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) { + if (data?.statusCode === apiStatusCodes.API_STATUS_CREATED) { setMessage(data?.message) setLoading(false) window.location.href = pathRoutes.organizations.root diff --git a/src/components/publicProfile/ProfileDesign.astro b/src/components/publicProfile/ProfileDesign.astro index a5dc5b966..8951b01cc 100644 --- a/src/components/publicProfile/ProfileDesign.astro +++ b/src/components/publicProfile/ProfileDesign.astro @@ -27,4 +27,3 @@ import CustomAvatar from "../../components/Avatar" - diff --git a/src/components/publicProfile/WalletDetailQRLayout.astro b/src/components/publicProfile/WalletDetailQRLayout.astro index 467cf4dc4..dcda37070 100644 --- a/src/components/publicProfile/WalletDetailQRLayout.astro +++ b/src/components/publicProfile/WalletDetailQRLayout.astro @@ -87,4 +87,3 @@ interface UserObject { - diff --git a/src/config/apiRoutes.ts b/src/config/apiRoutes.ts index 681a6efc0..94b81aad5 100644 --- a/src/config/apiRoutes.ts +++ b/src/config/apiRoutes.ts @@ -2,33 +2,31 @@ import { verifyPresentation } from "../api/verification"; export const apiRoutes = { auth:{ - sendMail: '/users/send-mail', - sinIn: '/users/login', - verifyEmail:'/users/verify', - userProfile: 'users/profile', - checkUser:'/users/check-user/', - addDetails:'/users/add/', + sendMail:'/auth/verification-mail', + sinIn: '/auth/signin', + verifyEmail:'/auth/verify', + addDetails:'/auth/signup', passkeyUserDetails:'/users/password/', - profile:'/profile' + profile:'/profile', }, users:{ - invitations: '/users/invitations', + userProfile: '/users/profile', + checkUser:'/users/', + invitations: '/users/org-invitations', fetchUsers: '/users', update: '/users', recentActivity: '/users/activity', }, organizations: { root: '/orgs', - create: '/organization', - update: '/organization', - getAll: '/organization', - getById: '/organization', - getOrgDashboard: '/organization/dashboard', - agentDedicatedSpinup: '/agent-service/spinup', - agentSharedSpinup: '/agent-service/tenant', - invitations: '/organization/invitations', - orgRoles: '/organization/roles', - editUserROle: '/organization/user-roles' + create: '/orgs', + update: '/orgs', + getAll: '/orgs', + getById: '/orgs', + getOrgDashboard: '/orgs/dashboard', + invitations: '/invitations', + orgRoles: '/orgs/roles', + editUserROle: '/user-roles' }, connection: { create: '/connections', @@ -64,11 +62,12 @@ export const apiRoutes = { proofRequestAttributesVerification: '/proofs' }, Agent:{ - checkAgentHealth: '/agent-service/health', - }, + checkAgentHealth: '/agents/health', + agentDedicatedSpinup: '/agents/spinup', + agentSharedSpinup: '/agents/wallet' + }, public:{ organizations: '/organization/public-profiles', users:'/users/public-profiles', } - } diff --git a/src/config/pathRoutes.ts b/src/config/pathRoutes.ts index 8fdcacada..52bb5ae8f 100644 --- a/src/config/pathRoutes.ts +++ b/src/config/pathRoutes.ts @@ -2,7 +2,7 @@ export const pathRoutes = { auth: { signUp: '/authentication/sign-up', sinIn: '/authentication/sign-in', - verifyEmail: '/users/verify', + verifyEmail: '/auth/verify', }, users: { dashboard: '/dashboard', diff --git a/src/pages/search.astro b/src/pages/explore.astro similarity index 100% rename from src/pages/search.astro rename to src/pages/explore.astro diff --git a/src/pages/index.astro b/src/pages/index.astro index 0e61f2c88..fb5a00bfe 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -25,11 +25,10 @@ import { pathRoutes } from '../config/pathRoutes';
    Explore - { - return users?.user; - }, -); ---- - -
    - - -
    -
    - -
    - -
    - -
    -

    Users

    - -
    -
    -
    -
    diff --git a/src/pages/publicUser/[publicuser].astro b/src/pages/publicUser/[publicuser].astro deleted file mode 100644 index 8e5bcf285..000000000 --- a/src/pages/publicUser/[publicuser].astro +++ /dev/null @@ -1,141 +0,0 @@ ---- -import CustomAvatar from '../../components/Avatar'; -import { pathRoutes } from '../../config/pathRoutes'; - -const { publicuser } = Astro.params; -const baseUrl = process.env.PUBLIC_BASE_URL || import.meta.env.PUBLIC_BASE_URL -const response = await fetch(`${baseUrl}/users/public-profiles/${publicuser}`); -const data = await response.json(); -const userData = data?.data; ---- - -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - { - userData?.logoUrl ? ( - - ) : ( - - ) - } -

    - {userData?.firstName}{' '}{userData?.lastName} -

    -
    - - {userData?.email} -
    -
    -
    -
    - - -
    - -
    - { - userData?.userOrgRoles?.map( - (userOrg: { - organisation: { - name: string; - description: string; - logoUrl: string; - id: number; - orgSlug:string - }; - name: string; - }) => { - return ( - userOrg?.organisation?.name && ( - -
    -
    -
    -
    - {userOrg?.name} -
    -

    - {userOrg?.organisation?.name && - userOrg?.organisation?.name } -

    -
    -
    -

    - {userOrg?.organisation?.description && - userOrg?.organisation?.description} -

    -
    - - {userData?.publicProfile && - View More.. - } -
    -
    - ) - ); - }, - ) - } -
    -
    -
    -
    -
    diff --git a/src/services/apiRequests.ts b/src/services/apiRequests.ts index df89491d6..020da1c86 100644 --- a/src/services/apiRequests.ts +++ b/src/services/apiRequests.ts @@ -18,7 +18,6 @@ export const axiosGet = async ({ url, config }: APIParameters): Promise => { try { const response = await axiosUser.get(url); @@ -43,6 +42,7 @@ export const axiosPublicOrganisationGet = async ({ url }: APIParameters): Promis } } + export const axiosPost = async ({ url, payload, config }: APIParameters): Promise => { try { const response = await axiosUser.post(url, payload, config);