From a2bf1ccf9c8ff54c56c294f3b43bc179b6f242e8 Mon Sep 17 00:00:00 2001 From: Giuseppe Scuglia Date: Fri, 3 Jan 2025 17:19:17 +0100 Subject: [PATCH 01/21] chore: configure vitest --- .gitignore | 3 + package-lock.json | 3216 ++++++++++++++++++++++++++------------------- package.json | 13 +- vitest.config.ts | 55 + 4 files changed, 1903 insertions(+), 1384 deletions(-) create mode 100644 vitest.config.ts diff --git a/.gitignore b/.gitignore index ffae558..80672b9 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,9 @@ dist dist-ssr *.local +# testing +/coverage + # typescript *.tsbuildinfo next-env.d.ts diff --git a/package-lock.json b/package-lock.json index 09835a8..3c44729 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,6 +42,9 @@ "@types/react": "^19.0.2", "@types/react-dom": "^19.0.2", "@vitejs/plugin-react-swc": "^3.5.0", + "@vitest/coverage-istanbul": "^2.1.4", + "@vitest/expect": "^2.1.4", + "@vitest/ui": "^2.1.4", "autoprefixer": "^10.4.20", "eslint": "^9.17.0", "eslint-plugin-react-hooks": "^5.1.0", @@ -53,7 +56,8 @@ "tailwindcss": "^3.4.15", "typescript": "~5.7.2", "typescript-eslint": "^8.15.0", - "vite": "^6.0.1" + "vite": "^6.0.1", + "vitest": "^2.1.8" } }, "node_modules/@alloc/quick-lru": { @@ -68,6 +72,202 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.3.tgz", + "integrity": "sha512-nHIxvKPniQXpmQLb0vhY3VaFb3S0YrTAwpOWJZh1wn3oJPjJk9Asva204PsBdmAE8vpzfHudT8DB0scYvy9q0g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz", + "integrity": "sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.26.0", + "@babel/generator": "^7.26.0", + "@babel/helper-compilation-targets": "^7.25.9", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.0", + "@babel/parser": "^7.26.0", + "@babel/template": "^7.25.9", + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.26.0", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.3.tgz", + "integrity": "sha512-6FF/urZvD0sTeO7k6/B15pMLC4CHUv1426lzr3N01aHJTl046uCAh9LXW/fzeXXjPNCJ6iABW5XaWOsIZB93aQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.26.3", + "@babel/types": "^7.26.3", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz", + "integrity": "sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.25.9", + "@babel/helper-validator-option": "^7.25.9", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz", + "integrity": "sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.25.9", + "@babel/types": "^7.26.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz", + "integrity": "sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.26.3" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@babel/runtime": { "version": "7.26.0", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz", @@ -80,10 +280,68 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/template": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz", + "integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.25.9", + "@babel/parser": "^7.25.9", + "@babel/types": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.26.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.4.tgz", + "integrity": "sha512-fH+b7Y4p3yqvApJALCPJcwb0/XaOSgtK4pzV6WVjPR5GLFQBRI7pfoX2V2iM48NXvX07NUxxm1Vw98YjqTcU5w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.3", + "@babel/parser": "^7.26.3", + "@babel/template": "^7.25.9", + "@babel/types": "^7.26.3", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/types": { + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz", + "integrity": "sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz", - "integrity": "sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.2.tgz", + "integrity": "sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==", "cpu": [ "ppc64" ], @@ -98,9 +356,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.0.tgz", - "integrity": "sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.2.tgz", + "integrity": "sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==", "cpu": [ "arm" ], @@ -115,9 +373,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.0.tgz", - "integrity": "sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.2.tgz", + "integrity": "sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==", "cpu": [ "arm64" ], @@ -132,9 +390,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.0.tgz", - "integrity": "sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.2.tgz", + "integrity": "sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw==", "cpu": [ "x64" ], @@ -149,9 +407,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.0.tgz", - "integrity": "sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.2.tgz", + "integrity": "sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==", "cpu": [ "arm64" ], @@ -166,9 +424,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.0.tgz", - "integrity": "sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.2.tgz", + "integrity": "sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA==", "cpu": [ "x64" ], @@ -183,9 +441,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.0.tgz", - "integrity": "sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.2.tgz", + "integrity": "sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg==", "cpu": [ "arm64" ], @@ -200,9 +458,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.0.tgz", - "integrity": "sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.2.tgz", + "integrity": "sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q==", "cpu": [ "x64" ], @@ -217,9 +475,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.0.tgz", - "integrity": "sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.2.tgz", + "integrity": "sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA==", "cpu": [ "arm" ], @@ -234,9 +492,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.0.tgz", - "integrity": "sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.2.tgz", + "integrity": "sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg==", "cpu": [ "arm64" ], @@ -251,9 +509,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.0.tgz", - "integrity": "sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.2.tgz", + "integrity": "sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw==", "cpu": [ "ia32" ], @@ -268,9 +526,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.0.tgz", - "integrity": "sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.2.tgz", + "integrity": "sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ==", "cpu": [ "loong64" ], @@ -285,9 +543,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.0.tgz", - "integrity": "sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.2.tgz", + "integrity": "sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw==", "cpu": [ "mips64el" ], @@ -302,9 +560,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.0.tgz", - "integrity": "sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.2.tgz", + "integrity": "sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw==", "cpu": [ "ppc64" ], @@ -319,9 +577,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.0.tgz", - "integrity": "sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.2.tgz", + "integrity": "sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q==", "cpu": [ "riscv64" ], @@ -336,9 +594,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.0.tgz", - "integrity": "sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.2.tgz", + "integrity": "sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw==", "cpu": [ "s390x" ], @@ -353,9 +611,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.0.tgz", - "integrity": "sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.2.tgz", + "integrity": "sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==", "cpu": [ "x64" ], @@ -369,10 +627,27 @@ "node": ">=18" } }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.24.2.tgz", + "integrity": "sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.0.tgz", - "integrity": "sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.2.tgz", + "integrity": "sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==", "cpu": [ "x64" ], @@ -387,9 +662,9 @@ } }, "node_modules/@esbuild/openbsd-arm64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.0.tgz", - "integrity": "sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.2.tgz", + "integrity": "sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==", "cpu": [ "arm64" ], @@ -404,9 +679,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.0.tgz", - "integrity": "sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.2.tgz", + "integrity": "sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA==", "cpu": [ "x64" ], @@ -421,9 +696,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.0.tgz", - "integrity": "sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.2.tgz", + "integrity": "sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig==", "cpu": [ "x64" ], @@ -438,9 +713,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.0.tgz", - "integrity": "sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.2.tgz", + "integrity": "sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ==", "cpu": [ "arm64" ], @@ -455,9 +730,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.0.tgz", - "integrity": "sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.2.tgz", + "integrity": "sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA==", "cpu": [ "ia32" ], @@ -472,9 +747,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.0.tgz", - "integrity": "sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.2.tgz", + "integrity": "sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==", "cpu": [ "x64" ], @@ -531,13 +806,13 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.0.tgz", - "integrity": "sha512-zdHg2FPIFNKPdcHWtiNT+jEFCHYVplAXRDlQDyqy0zGx/q2parwh7brGJSiTxRk/TSMkbM//zt/f5CHgyTyaSQ==", + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.1.tgz", + "integrity": "sha512-fo6Mtm5mWyKjA/Chy1BYTdn5mGJoDNjC7C64ug20ADsRDGrA85bN3uK3MaKbeRkRuuIEAR5N33Jr1pbm411/PA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/object-schema": "^2.1.4", + "@eslint/object-schema": "^2.1.5", "debug": "^4.3.1", "minimatch": "^3.1.2" }, @@ -546,11 +821,14 @@ } }, "node_modules/@eslint/core": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.0.tgz", - "integrity": "sha512-7ATR9F0e4W85D/0w7cU0SNj7qkAexMG+bAHEZOjo9akvGuhHE2m7umzWzfnpa0XAg5Kxc1BWmtPMV67jJ+9VUg==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.1.tgz", + "integrity": "sha512-GuUdqkyyzQI5RMIWkHhvTWLCyLo1jNK3vzkSyaExH5kHPDHcuL2VOpHjmMY+y3+NC69qAKToBqldTBgYeLSr9Q==", "dev": true, "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } @@ -597,14 +875,15 @@ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.17.0.tgz", "integrity": "sha512-Sxc4hqcs1kTu0iID3kcZDW3JHq2a77HO9P8CP6YEA/FpH3Ll8UXE2r/86Rz9YJLKme39S9vU5OWNjC6Xl0Cr3w==", "dev": true, + "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/object-schema": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", - "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.5.tgz", + "integrity": "sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ==", "dev": true, "license": "Apache-2.0", "engines": { @@ -612,9 +891,9 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.3.tgz", - "integrity": "sha512-2b/g5hRmpbb1o4GnTZax9N9m0FXzz9OV42ZzI4rDDMDuHUqigAiQCEWChBWCY4ztAGVRjoWT19v0yMmc5/L5kA==", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.4.tgz", + "integrity": "sha512-zSkKow6H5Kdm0ZUQUB2kV5JIXqoG0+uH5YADhaEHswm664N9Db8dXSi0nMJpacpMf+MyyglF1vnZohpEg5yUtg==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -745,10 +1024,72 @@ "node": ">=12" } }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "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/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", "license": "MIT", "dependencies": { "@jridgewell/set-array": "^1.2.1", @@ -838,6 +1179,13 @@ "node": ">=14" } }, + "node_modules/@polka/url": { + "version": "1.0.0-next.28", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.28.tgz", + "integrity": "sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==", + "dev": true, + "license": "MIT" + }, "node_modules/@radix-ui/number": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.1.0.tgz", @@ -847,7 +1195,8 @@ "node_modules/@radix-ui/primitive": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.1.tgz", - "integrity": "sha512-SJ31y+Q/zAyShtXJc8x83i9TYdbAfHZ++tUZnvjJJqFjzsdUnKsxPL6IEtBlxKkU7yzer//GQtZSV4GbldL3YA==" + "integrity": "sha512-SJ31y+Q/zAyShtXJc8x83i9TYdbAfHZ++tUZnvjJJqFjzsdUnKsxPL6IEtBlxKkU7yzer//GQtZSV4GbldL3YA==", + "license": "MIT" }, "node_modules/@radix-ui/react-arrow": { "version": "1.1.1", @@ -872,27 +1221,41 @@ } } }, - "node_modules/@radix-ui/react-arrow/node_modules/@radix-ui/react-compose-refs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.1.tgz", - "integrity": "sha512-Y9VzoRDSJtgFMUCoiZBDVo084VQ5hfpXxVE+NgkdNsjiDBByiImMZKKhxMwCbdHvhlENG6a833CbFkOQvTricw==", + "node_modules/@radix-ui/react-avatar": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-avatar/-/react-avatar-1.1.2.tgz", + "integrity": "sha512-GaC7bXQZ5VgZvVvsJ5mu/AEbjYLnhhkoidOboC50Z6FFlLA03wG2ianUoH+zgDQ31/9gCF59bE4+2bBgTyMiig==", "license": "MIT", + "dependencies": { + "@radix-ui/react-context": "1.1.1", + "@radix-ui/react-primitive": "2.0.1", + "@radix-ui/react-use-callback-ref": "1.1.0", + "@radix-ui/react-use-layout-effect": "1.1.0" + }, "peerDependencies": { "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "peerDependenciesMeta": { "@types/react": { "optional": true + }, + "@types/react-dom": { + "optional": true } } }, - "node_modules/@radix-ui/react-arrow/node_modules/@radix-ui/react-primitive": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.0.1.tgz", - "integrity": "sha512-sHCWTtxwNn3L3fH8qAfnF3WbUZycW93SM1j3NFDzXBiz8D6F5UTTy8G1+WFEaiCdvCVRJWj6N2R4Xq6HdiHmDg==", + "node_modules/@radix-ui/react-collection": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.1.1.tgz", + "integrity": "sha512-LwT3pSho9Dljg+wY2KN2mrrh6y3qELfftINERIzBUO9e0N+t0oMTyn3k9iv+ZqgrwGkRnLpNJrsMv9BZlt2yuA==", "license": "MIT", "dependencies": { + "@radix-ui/react-compose-refs": "1.1.1", + "@radix-ui/react-context": "1.1.1", + "@radix-ui/react-primitive": "2.0.1", "@radix-ui/react-slot": "1.1.1" }, "peerDependencies": { @@ -910,136 +1273,10 @@ } } }, - "node_modules/@radix-ui/react-arrow/node_modules/@radix-ui/react-slot": { + "node_modules/@radix-ui/react-compose-refs": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.1.tgz", - "integrity": "sha512-RApLLOcINYJA+dMVbOju7MYv1Mb2EBp2nH4HdDzXTSyaR5optlm6Otrz1euW3HbdOR8UmmFK06TD+A9frYWv+g==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-compose-refs": "1.1.1" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-avatar": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-avatar/-/react-avatar-1.1.1.tgz", - "integrity": "sha512-eoOtThOmxeoizxpX6RiEsQZ2wj5r4+zoeqAwO0cBaFQGjJwIH3dIX0OCxNrCyrrdxG+vBweMETh3VziQG7c1kw==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-context": "1.1.1", - "@radix-ui/react-primitive": "2.0.0", - "@radix-ui/react-use-callback-ref": "1.1.0", - "@radix-ui/react-use-layout-effect": "1.1.0" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-collection": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.1.1.tgz", - "integrity": "sha512-LwT3pSho9Dljg+wY2KN2mrrh6y3qELfftINERIzBUO9e0N+t0oMTyn3k9iv+ZqgrwGkRnLpNJrsMv9BZlt2yuA==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-compose-refs": "1.1.1", - "@radix-ui/react-context": "1.1.1", - "@radix-ui/react-primitive": "2.0.1", - "@radix-ui/react-slot": "1.1.1" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-compose-refs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.1.tgz", - "integrity": "sha512-Y9VzoRDSJtgFMUCoiZBDVo084VQ5hfpXxVE+NgkdNsjiDBByiImMZKKhxMwCbdHvhlENG6a833CbFkOQvTricw==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-primitive": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.0.1.tgz", - "integrity": "sha512-sHCWTtxwNn3L3fH8qAfnF3WbUZycW93SM1j3NFDzXBiz8D6F5UTTy8G1+WFEaiCdvCVRJWj6N2R4Xq6HdiHmDg==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-slot": "1.1.1" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.1.tgz", - "integrity": "sha512-RApLLOcINYJA+dMVbOju7MYv1Mb2EBp2nH4HdDzXTSyaR5optlm6Otrz1euW3HbdOR8UmmFK06TD+A9frYWv+g==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-compose-refs": "1.1.1" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-compose-refs": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.0.tgz", - "integrity": "sha512-b4inOtiaOnYf9KWyO3jAeeCG6FeyfY6ldiEPanbUjWd+xIk5wZeHa8yVwmrJ2vderhu/BQvzCrJI0lHd+wIiqw==", + "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.1.tgz", + "integrity": "sha512-Y9VzoRDSJtgFMUCoiZBDVo084VQ5hfpXxVE+NgkdNsjiDBByiImMZKKhxMwCbdHvhlENG6a833CbFkOQvTricw==", "license": "MIT", "peerDependencies": { "@types/react": "*", @@ -1102,62 +1339,6 @@ } } }, - "node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-compose-refs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.1.tgz", - "integrity": "sha512-Y9VzoRDSJtgFMUCoiZBDVo084VQ5hfpXxVE+NgkdNsjiDBByiImMZKKhxMwCbdHvhlENG6a833CbFkOQvTricw==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-primitive": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.0.1.tgz", - "integrity": "sha512-sHCWTtxwNn3L3fH8qAfnF3WbUZycW93SM1j3NFDzXBiz8D6F5UTTy8G1+WFEaiCdvCVRJWj6N2R4Xq6HdiHmDg==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-slot": "1.1.1" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.1.tgz", - "integrity": "sha512-RApLLOcINYJA+dMVbOju7MYv1Mb2EBp2nH4HdDzXTSyaR5optlm6Otrz1euW3HbdOR8UmmFK06TD+A9frYWv+g==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-compose-refs": "1.1.1" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, "node_modules/@radix-ui/react-direction": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.1.0.tgz", @@ -1176,254 +1357,14 @@ "node_modules/@radix-ui/react-dismissable-layer": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.3.tgz", - "integrity": "sha512-onrWn/72lQoEucDmJnr8uczSNTujT0vJnA/X5+3AkChVPowr8n1yvIKIabhWyMQeMvvmdpsvcyDqx3X1LEXCPg==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.1", - "@radix-ui/react-compose-refs": "1.1.1", - "@radix-ui/react-primitive": "2.0.1", - "@radix-ui/react-use-callback-ref": "1.1.0", - "@radix-ui/react-use-escape-keydown": "1.1.0" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-compose-refs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.1.tgz", - "integrity": "sha512-Y9VzoRDSJtgFMUCoiZBDVo084VQ5hfpXxVE+NgkdNsjiDBByiImMZKKhxMwCbdHvhlENG6a833CbFkOQvTricw==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-primitive": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.0.1.tgz", - "integrity": "sha512-sHCWTtxwNn3L3fH8qAfnF3WbUZycW93SM1j3NFDzXBiz8D6F5UTTy8G1+WFEaiCdvCVRJWj6N2R4Xq6HdiHmDg==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-slot": "1.1.1" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-slot": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.1.tgz", - "integrity": "sha512-RApLLOcINYJA+dMVbOju7MYv1Mb2EBp2nH4HdDzXTSyaR5optlm6Otrz1euW3HbdOR8UmmFK06TD+A9frYWv+g==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-compose-refs": "1.1.1" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-focus-guards": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.1.1.tgz", - "integrity": "sha512-pSIwfrT1a6sIoDASCSpFwOasEwKTZWDw/iBdtnqKO7v6FeOzYJ7U53cPzYFVR3geGGXgVHaH+CdngrrAzqUGxg==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-focus-scope": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.1.1.tgz", - "integrity": "sha512-01omzJAYRxXdG2/he/+xy+c8a8gCydoQ1yOxnWNcRhrrBW5W+RQJ22EK1SaO8tb3WoUsuEw7mJjBozPzihDFjA==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-compose-refs": "1.1.1", - "@radix-ui/react-primitive": "2.0.1", - "@radix-ui/react-use-callback-ref": "1.1.0" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-compose-refs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.1.tgz", - "integrity": "sha512-Y9VzoRDSJtgFMUCoiZBDVo084VQ5hfpXxVE+NgkdNsjiDBByiImMZKKhxMwCbdHvhlENG6a833CbFkOQvTricw==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-primitive": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.0.1.tgz", - "integrity": "sha512-sHCWTtxwNn3L3fH8qAfnF3WbUZycW93SM1j3NFDzXBiz8D6F5UTTy8G1+WFEaiCdvCVRJWj6N2R4Xq6HdiHmDg==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-slot": "1.1.1" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-slot": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.1.tgz", - "integrity": "sha512-RApLLOcINYJA+dMVbOju7MYv1Mb2EBp2nH4HdDzXTSyaR5optlm6Otrz1euW3HbdOR8UmmFK06TD+A9frYWv+g==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-compose-refs": "1.1.1" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-id": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.1.0.tgz", - "integrity": "sha512-EJUrI8yYh7WOjNOqpoJaf1jlFIH2LvtgAl+YcFqNCa+4hj64ZXmPkAKOFs/ukjz3byN6bdb/AVUqHkI8/uWWMA==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-use-layout-effect": "1.1.0" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-popper": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.2.1.tgz", - "integrity": "sha512-3kn5Me69L+jv82EKRuQCXdYyf1DqHwD2U/sxoNgBGCB7K9TRc3bQamQ+5EPM9EvyPdli0W41sROd+ZU1dTCztw==", - "license": "MIT", - "dependencies": { - "@floating-ui/react-dom": "^2.0.0", - "@radix-ui/react-arrow": "1.1.1", - "@radix-ui/react-compose-refs": "1.1.1", - "@radix-ui/react-context": "1.1.1", - "@radix-ui/react-primitive": "2.0.1", - "@radix-ui/react-use-callback-ref": "1.1.0", - "@radix-ui/react-use-layout-effect": "1.1.0", - "@radix-ui/react-use-rect": "1.1.0", - "@radix-ui/react-use-size": "1.1.0", - "@radix-ui/rect": "1.1.0" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-compose-refs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.1.tgz", - "integrity": "sha512-Y9VzoRDSJtgFMUCoiZBDVo084VQ5hfpXxVE+NgkdNsjiDBByiImMZKKhxMwCbdHvhlENG6a833CbFkOQvTricw==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-primitive": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.0.1.tgz", - "integrity": "sha512-sHCWTtxwNn3L3fH8qAfnF3WbUZycW93SM1j3NFDzXBiz8D6F5UTTy8G1+WFEaiCdvCVRJWj6N2R4Xq6HdiHmDg==", + "integrity": "sha512-onrWn/72lQoEucDmJnr8uczSNTujT0vJnA/X5+3AkChVPowr8n1yvIKIabhWyMQeMvvmdpsvcyDqx3X1LEXCPg==", "license": "MIT", "dependencies": { - "@radix-ui/react-slot": "1.1.1" + "@radix-ui/primitive": "1.1.1", + "@radix-ui/react-compose-refs": "1.1.1", + "@radix-ui/react-primitive": "2.0.1", + "@radix-ui/react-use-callback-ref": "1.1.0", + "@radix-ui/react-use-escape-keydown": "1.1.0" }, "peerDependencies": { "@types/react": "*", @@ -1440,14 +1381,11 @@ } } }, - "node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-slot": { + "node_modules/@radix-ui/react-focus-guards": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.1.tgz", - "integrity": "sha512-RApLLOcINYJA+dMVbOju7MYv1Mb2EBp2nH4HdDzXTSyaR5optlm6Otrz1euW3HbdOR8UmmFK06TD+A9frYWv+g==", + "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.1.1.tgz", + "integrity": "sha512-pSIwfrT1a6sIoDASCSpFwOasEwKTZWDw/iBdtnqKO7v6FeOzYJ7U53cPzYFVR3geGGXgVHaH+CdngrrAzqUGxg==", "license": "MIT", - "dependencies": { - "@radix-ui/react-compose-refs": "1.1.1" - }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" @@ -1458,14 +1396,15 @@ } } }, - "node_modules/@radix-ui/react-portal": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.1.3.tgz", - "integrity": "sha512-NciRqhXnGojhT93RPyDaMPfLH3ZSl4jjIFbZQ1b/vxvZEdHsBZ49wP9w8L3HzUQwep01LcWtkUvm0OVB5JAHTw==", + "node_modules/@radix-ui/react-focus-scope": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.1.1.tgz", + "integrity": "sha512-01omzJAYRxXdG2/he/+xy+c8a8gCydoQ1yOxnWNcRhrrBW5W+RQJ22EK1SaO8tb3WoUsuEw7mJjBozPzihDFjA==", "license": "MIT", "dependencies": { + "@radix-ui/react-compose-refs": "1.1.1", "@radix-ui/react-primitive": "2.0.1", - "@radix-ui/react-use-layout-effect": "1.1.0" + "@radix-ui/react-use-callback-ref": "1.1.0" }, "peerDependencies": { "@types/react": "*", @@ -1482,11 +1421,14 @@ } } }, - "node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-compose-refs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.1.tgz", - "integrity": "sha512-Y9VzoRDSJtgFMUCoiZBDVo084VQ5hfpXxVE+NgkdNsjiDBByiImMZKKhxMwCbdHvhlENG6a833CbFkOQvTricw==", + "node_modules/@radix-ui/react-id": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.1.0.tgz", + "integrity": "sha512-EJUrI8yYh7WOjNOqpoJaf1jlFIH2LvtgAl+YcFqNCa+4hj64ZXmPkAKOFs/ukjz3byN6bdb/AVUqHkI8/uWWMA==", "license": "MIT", + "dependencies": { + "@radix-ui/react-use-layout-effect": "1.1.0" + }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" @@ -1497,13 +1439,22 @@ } } }, - "node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-primitive": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.0.1.tgz", - "integrity": "sha512-sHCWTtxwNn3L3fH8qAfnF3WbUZycW93SM1j3NFDzXBiz8D6F5UTTy8G1+WFEaiCdvCVRJWj6N2R4Xq6HdiHmDg==", + "node_modules/@radix-ui/react-popper": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.2.1.tgz", + "integrity": "sha512-3kn5Me69L+jv82EKRuQCXdYyf1DqHwD2U/sxoNgBGCB7K9TRc3bQamQ+5EPM9EvyPdli0W41sROd+ZU1dTCztw==", "license": "MIT", "dependencies": { - "@radix-ui/react-slot": "1.1.1" + "@floating-ui/react-dom": "^2.0.0", + "@radix-ui/react-arrow": "1.1.1", + "@radix-ui/react-compose-refs": "1.1.1", + "@radix-ui/react-context": "1.1.1", + "@radix-ui/react-primitive": "2.0.1", + "@radix-ui/react-use-callback-ref": "1.1.0", + "@radix-ui/react-use-layout-effect": "1.1.0", + "@radix-ui/react-use-rect": "1.1.0", + "@radix-ui/react-use-size": "1.1.0", + "@radix-ui/rect": "1.1.0" }, "peerDependencies": { "@types/react": "*", @@ -1520,21 +1471,27 @@ } } }, - "node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-slot": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.1.tgz", - "integrity": "sha512-RApLLOcINYJA+dMVbOju7MYv1Mb2EBp2nH4HdDzXTSyaR5optlm6Otrz1euW3HbdOR8UmmFK06TD+A9frYWv+g==", + "node_modules/@radix-ui/react-portal": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.1.3.tgz", + "integrity": "sha512-NciRqhXnGojhT93RPyDaMPfLH3ZSl4jjIFbZQ1b/vxvZEdHsBZ49wP9w8L3HzUQwep01LcWtkUvm0OVB5JAHTw==", "license": "MIT", "dependencies": { - "@radix-ui/react-compose-refs": "1.1.1" + "@radix-ui/react-primitive": "2.0.1", + "@radix-ui/react-use-layout-effect": "1.1.0" }, "peerDependencies": { "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "peerDependenciesMeta": { "@types/react": { "optional": true + }, + "@types/react-dom": { + "optional": true } } }, @@ -1562,28 +1519,13 @@ } } }, - "node_modules/@radix-ui/react-presence/node_modules/@radix-ui/react-compose-refs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.1.tgz", - "integrity": "sha512-Y9VzoRDSJtgFMUCoiZBDVo084VQ5hfpXxVE+NgkdNsjiDBByiImMZKKhxMwCbdHvhlENG6a833CbFkOQvTricw==", - "license": "MIT", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, "node_modules/@radix-ui/react-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.0.0.tgz", - "integrity": "sha512-ZSpFm0/uHa8zTvKBDjLFWLo8dkr4MBsiDLz0g3gMUwqgLHz9rTaRRGYDgvZPtBJgYCBKXkS9fzmoySgr8CO6Cw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.0.1.tgz", + "integrity": "sha512-sHCWTtxwNn3L3fH8qAfnF3WbUZycW93SM1j3NFDzXBiz8D6F5UTTy8G1+WFEaiCdvCVRJWj6N2R4Xq6HdiHmDg==", "license": "MIT", "dependencies": { - "@radix-ui/react-slot": "1.1.0" + "@radix-ui/react-slot": "1.1.1" }, "peerDependencies": { "@types/react": "*", @@ -1604,6 +1546,7 @@ "version": "2.1.4", "resolved": "https://registry.npmjs.org/@radix-ui/react-select/-/react-select-2.1.4.tgz", "integrity": "sha512-pOkb2u8KgO47j/h7AylCj7dJsm69BXcjkrvTqMptFqsE2i0p8lHkfgneXKjAgPzBMivnoMyt8o4KiV4wYzDdyQ==", + "license": "MIT", "dependencies": { "@radix-ui/number": "1.1.0", "@radix-ui/primitive": "1.1.1", @@ -1642,27 +1585,13 @@ } } }, - "node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-compose-refs": { + "node_modules/@radix-ui/react-separator": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.1.tgz", - "integrity": "sha512-Y9VzoRDSJtgFMUCoiZBDVo084VQ5hfpXxVE+NgkdNsjiDBByiImMZKKhxMwCbdHvhlENG6a833CbFkOQvTricw==", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-primitive": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.0.1.tgz", - "integrity": "sha512-sHCWTtxwNn3L3fH8qAfnF3WbUZycW93SM1j3NFDzXBiz8D6F5UTTy8G1+WFEaiCdvCVRJWj6N2R4Xq6HdiHmDg==", + "resolved": "https://registry.npmjs.org/@radix-ui/react-separator/-/react-separator-1.1.1.tgz", + "integrity": "sha512-RRiNRSrD8iUiXriq/Y5n4/3iE8HzqgLHsusUSg5jVpU2+3tqcUFPJXHDymwEypunc2sWxDUS3UC+rkZRlHedsw==", "license": "MIT", "dependencies": { - "@radix-ui/react-slot": "1.1.1" + "@radix-ui/react-primitive": "2.0.1" }, "peerDependencies": { "@types/react": "*", @@ -1679,53 +1608,13 @@ } } }, - "node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-slot": { + "node_modules/@radix-ui/react-slot": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.1.tgz", "integrity": "sha512-RApLLOcINYJA+dMVbOju7MYv1Mb2EBp2nH4HdDzXTSyaR5optlm6Otrz1euW3HbdOR8UmmFK06TD+A9frYWv+g==", - "dependencies": { - "@radix-ui/react-compose-refs": "1.1.1" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@radix-ui/react-separator/-/react-separator-1.1.0.tgz", - "integrity": "sha512-3uBAs+egzvJBDZAzvb/n4NxxOYpnspmWxO2u5NbZ8Y6FM/NdrGSF9bop3Cf6F6C71z1rTSn8KV0Fo2ZVd79lGA==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-primitive": "2.0.0" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-slot": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.0.tgz", - "integrity": "sha512-FUCf5XMfmW4dtYl69pdS4DbxKy8nj4M7SafBgPllysxmdachynNflAdp/gCsnYWNDnge6tI9onzMp5ARYc1KNw==", "license": "MIT", "dependencies": { - "@radix-ui/react-compose-refs": "1.1.0" + "@radix-ui/react-compose-refs": "1.1.1" }, "peerDependencies": { "@types/react": "*", @@ -1741,6 +1630,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/@radix-ui/react-switch/-/react-switch-1.1.2.tgz", "integrity": "sha512-zGukiWHjEdBCRyXvKR6iXAQG6qXm2esuAD6kDOi9Cn+1X6ev3ASo4+CsYaD6Fov9r/AQFekqnD/7+V0Cs6/98g==", + "license": "MIT", "dependencies": { "@radix-ui/primitive": "1.1.1", "@radix-ui/react-compose-refs": "1.1.1", @@ -1822,6 +1712,7 @@ "version": "1.1.6", "resolved": "https://registry.npmjs.org/@radix-ui/react-tooltip/-/react-tooltip-1.1.6.tgz", "integrity": "sha512-TLB5D8QLExS1uDn7+wH/bjEmRurNMTzNrtq7IjaS4kjion9NtzsTGkvR5+i7yc9q01Pi2KMM2cN3f8UG4IvvXA==", + "license": "MIT", "dependencies": { "@radix-ui/primitive": "1.1.1", "@radix-ui/react-compose-refs": "1.1.1", @@ -1851,60 +1742,6 @@ } } }, - "node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-compose-refs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.1.tgz", - "integrity": "sha512-Y9VzoRDSJtgFMUCoiZBDVo084VQ5hfpXxVE+NgkdNsjiDBByiImMZKKhxMwCbdHvhlENG6a833CbFkOQvTricw==", - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.0.1.tgz", - "integrity": "sha512-sHCWTtxwNn3L3fH8qAfnF3WbUZycW93SM1j3NFDzXBiz8D6F5UTTy8G1+WFEaiCdvCVRJWj6N2R4Xq6HdiHmDg==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-slot": "1.1.1" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.1.tgz", - "integrity": "sha512-RApLLOcINYJA+dMVbOju7MYv1Mb2EBp2nH4HdDzXTSyaR5optlm6Otrz1euW3HbdOR8UmmFK06TD+A9frYWv+g==", - "dependencies": { - "@radix-ui/react-compose-refs": "1.1.1" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, "node_modules/@radix-ui/react-use-callback-ref": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.0.tgz", @@ -1942,6 +1779,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.1.0.tgz", "integrity": "sha512-L7vwWlR1kTTQ3oh7g1O0CBF3YCyyTj8NmhLR+phShpyA50HCfBFKVJTpshm9PzLiKmehsrQzTYTpX9HvmC9rhw==", + "license": "MIT", "dependencies": { "@radix-ui/react-use-callback-ref": "1.1.0" }, @@ -1992,63 +1830,7 @@ "license": "MIT", "dependencies": { "@radix-ui/rect": "1.1.0" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-use-size": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-size/-/react-use-size-1.1.0.tgz", - "integrity": "sha512-XW3/vWuIXHa+2Uwcc2ABSfcCledmXhhQPlGbfcRXbiUQI5Icjcg19BGCZVKKInYbvUCut/ufbbLLPFC5cbb1hw==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-use-layout-effect": "1.1.0" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-visually-hidden": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.1.1.tgz", - "integrity": "sha512-vVfA2IZ9q/J+gEamvj761Oq1FpWgCDaNOOIfbPVp2MVPLEomUr5+Vf7kJGwQ24YxZSlQVar7Bes8kyTo5Dshpg==", - "license": "MIT", - "dependencies": { - "@radix-ui/react-primitive": "2.0.1" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-compose-refs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.1.tgz", - "integrity": "sha512-Y9VzoRDSJtgFMUCoiZBDVo084VQ5hfpXxVE+NgkdNsjiDBByiImMZKKhxMwCbdHvhlENG6a833CbFkOQvTricw==", - "license": "MIT", + }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" @@ -2059,44 +1841,44 @@ } } }, - "node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.0.1.tgz", - "integrity": "sha512-sHCWTtxwNn3L3fH8qAfnF3WbUZycW93SM1j3NFDzXBiz8D6F5UTTy8G1+WFEaiCdvCVRJWj6N2R4Xq6HdiHmDg==", + "node_modules/@radix-ui/react-use-size": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-size/-/react-use-size-1.1.0.tgz", + "integrity": "sha512-XW3/vWuIXHa+2Uwcc2ABSfcCledmXhhQPlGbfcRXbiUQI5Icjcg19BGCZVKKInYbvUCut/ufbbLLPFC5cbb1hw==", "license": "MIT", "dependencies": { - "@radix-ui/react-slot": "1.1.1" + "@radix-ui/react-use-layout-effect": "1.1.0" }, "peerDependencies": { "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "peerDependenciesMeta": { "@types/react": { "optional": true - }, - "@types/react-dom": { - "optional": true } } }, - "node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot": { + "node_modules/@radix-ui/react-visually-hidden": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.1.tgz", - "integrity": "sha512-RApLLOcINYJA+dMVbOju7MYv1Mb2EBp2nH4HdDzXTSyaR5optlm6Otrz1euW3HbdOR8UmmFK06TD+A9frYWv+g==", + "resolved": "https://registry.npmjs.org/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.1.1.tgz", + "integrity": "sha512-vVfA2IZ9q/J+gEamvj761Oq1FpWgCDaNOOIfbPVp2MVPLEomUr5+Vf7kJGwQ24YxZSlQVar7Bes8kyTo5Dshpg==", "license": "MIT", "dependencies": { - "@radix-ui/react-compose-refs": "1.1.1" + "@radix-ui/react-primitive": "2.0.1" }, "peerDependencies": { "@types/react": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "peerDependenciesMeta": { "@types/react": { "optional": true + }, + "@types/react-dom": { + "optional": true } } }, @@ -2107,9 +1889,9 @@ "license": "MIT" }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.27.4.tgz", - "integrity": "sha512-2Y3JT6f5MrQkICUyRVCw4oa0sutfAsgaSsb0Lmmy1Wi2y7X5vT9Euqw4gOsCyy0YfKURBg35nhUKZS4mDcfULw==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.29.1.tgz", + "integrity": "sha512-ssKhA8RNltTZLpG6/QNkCSge+7mBQGUqJRisZ2MDQcEGaK93QESEgWK2iOpIDZ7k9zPVkG5AS3ksvD5ZWxmItw==", "cpu": [ "arm" ], @@ -2121,9 +1903,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.27.4.tgz", - "integrity": "sha512-wzKRQXISyi9UdCVRqEd0H4cMpzvHYt1f/C3CoIjES6cG++RHKhrBj2+29nPF0IB5kpy9MS71vs07fvrNGAl/iA==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.29.1.tgz", + "integrity": "sha512-CaRfrV0cd+NIIcVVN/jx+hVLN+VRqnuzLRmfmlzpOzB87ajixsN/+9L5xNmkaUUvEbI5BmIKS+XTwXsHEb65Ew==", "cpu": [ "arm64" ], @@ -2135,9 +1917,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.27.4.tgz", - "integrity": "sha512-PlNiRQapift4LNS8DPUHuDX/IdXiLjf8mc5vdEmUR0fF/pyy2qWwzdLjB+iZquGr8LuN4LnUoSEvKRwjSVYz3Q==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.29.1.tgz", + "integrity": "sha512-2ORr7T31Y0Mnk6qNuwtyNmy14MunTAMx06VAPI6/Ju52W10zk1i7i5U3vlDRWjhOI5quBcrvhkCHyF76bI7kEw==", "cpu": [ "arm64" ], @@ -2149,9 +1931,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.27.4.tgz", - "integrity": "sha512-o9bH2dbdgBDJaXWJCDTNDYa171ACUdzpxSZt+u/AAeQ20Nk5x+IhA+zsGmrQtpkLiumRJEYef68gcpn2ooXhSQ==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.29.1.tgz", + "integrity": "sha512-j/Ej1oanzPjmN0tirRd5K2/nncAhS9W6ICzgxV+9Y5ZsP0hiGhHJXZ2JQ53iSSjj8m6cRY6oB1GMzNn2EUt6Ng==", "cpu": [ "x64" ], @@ -2163,9 +1945,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.27.4.tgz", - "integrity": "sha512-NBI2/i2hT9Q+HySSHTBh52da7isru4aAAo6qC3I7QFVsuhxi2gM8t/EI9EVcILiHLj1vfi+VGGPaLOUENn7pmw==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.29.1.tgz", + "integrity": "sha512-91C//G6Dm/cv724tpt7nTyP+JdN12iqeXGFM1SqnljCmi5yTXriH7B1r8AD9dAZByHpKAumqP1Qy2vVNIdLZqw==", "cpu": [ "arm64" ], @@ -2177,9 +1959,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.27.4.tgz", - "integrity": "sha512-wYcC5ycW2zvqtDYrE7deary2P2UFmSh85PUpAx+dwTCO9uw3sgzD6Gv9n5X4vLaQKsrfTSZZ7Z7uynQozPVvWA==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.29.1.tgz", + "integrity": "sha512-hEioiEQ9Dec2nIRoeHUP6hr1PSkXzQaCUyqBDQ9I9ik4gCXQZjJMIVzoNLBRGet+hIUb3CISMh9KXuCcWVW/8w==", "cpu": [ "x64" ], @@ -2191,9 +1973,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.27.4.tgz", - "integrity": "sha512-9OwUnK/xKw6DyRlgx8UizeqRFOfi9mf5TYCw1uolDaJSbUmBxP85DE6T4ouCMoN6pXw8ZoTeZCSEfSaYo+/s1w==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.29.1.tgz", + "integrity": "sha512-Py5vFd5HWYN9zxBv3WMrLAXY3yYJ6Q/aVERoeUFwiDGiMOWsMs7FokXihSOaT/PMWUty/Pj60XDQndK3eAfE6A==", "cpu": [ "arm" ], @@ -2205,9 +1987,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.27.4.tgz", - "integrity": "sha512-Vgdo4fpuphS9V24WOV+KwkCVJ72u7idTgQaBoLRD0UxBAWTF9GWurJO9YD9yh00BzbkhpeXtm6na+MvJU7Z73A==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.29.1.tgz", + "integrity": "sha512-RiWpGgbayf7LUcuSNIbahr0ys2YnEERD4gYdISA06wa0i8RALrnzflh9Wxii7zQJEB2/Eh74dX4y/sHKLWp5uQ==", "cpu": [ "arm" ], @@ -2219,9 +2001,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.27.4.tgz", - "integrity": "sha512-pleyNgyd1kkBkw2kOqlBx+0atfIIkkExOTiifoODo6qKDSpnc6WzUY5RhHdmTdIJXBdSnh6JknnYTtmQyobrVg==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.29.1.tgz", + "integrity": "sha512-Z80O+taYxTQITWMjm/YqNoe9d10OX6kDh8X5/rFCMuPqsKsSyDilvfg+vd3iXIqtfmp+cnfL1UrYirkaF8SBZA==", "cpu": [ "arm64" ], @@ -2233,9 +2015,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.27.4.tgz", - "integrity": "sha512-caluiUXvUuVyCHr5DxL8ohaaFFzPGmgmMvwmqAITMpV/Q+tPoaHZ/PWa3t8B2WyoRcIIuu1hkaW5KkeTDNSnMA==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.29.1.tgz", + "integrity": "sha512-fOHRtF9gahwJk3QVp01a/GqS4hBEZCV1oKglVVq13kcK3NeVlS4BwIFzOHDbmKzt3i0OuHG4zfRP0YoG5OF/rA==", "cpu": [ "arm64" ], @@ -2246,10 +2028,24 @@ "linux" ] }, + "node_modules/@rollup/rollup-linux-loongarch64-gnu": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.29.1.tgz", + "integrity": "sha512-5a7q3tnlbcg0OodyxcAdrrCxFi0DgXJSoOuidFUzHZ2GixZXQs6Tc3CHmlvqKAmOs5eRde+JJxeIf9DonkmYkw==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.27.4.tgz", - "integrity": "sha512-FScrpHrO60hARyHh7s1zHE97u0KlT/RECzCKAdmI+LEoC1eDh/RDji9JgFqyO+wPDb86Oa/sXkily1+oi4FzJQ==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.29.1.tgz", + "integrity": "sha512-9b4Mg5Yfz6mRnlSPIdROcfw1BU22FQxmfjlp/CShWwO3LilKQuMISMTtAu/bxmmrE6A902W2cZJuzx8+gJ8e9w==", "cpu": [ "ppc64" ], @@ -2261,9 +2057,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.27.4.tgz", - "integrity": "sha512-qyyprhyGb7+RBfMPeww9FlHwKkCXdKHeGgSqmIXw9VSUtvyFZ6WZRtnxgbuz76FK7LyoN8t/eINRbPUcvXB5fw==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.29.1.tgz", + "integrity": "sha512-G5pn0NChlbRM8OJWpJFMX4/i8OEU538uiSv0P6roZcbpe/WfhEO+AT8SHVKfp8qhDQzaz7Q+1/ixMy7hBRidnQ==", "cpu": [ "riscv64" ], @@ -2275,9 +2071,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.27.4.tgz", - "integrity": "sha512-PFz+y2kb6tbh7m3A7nA9++eInGcDVZUACulf/KzDtovvdTizHpZaJty7Gp0lFwSQcrnebHOqxF1MaKZd7psVRg==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.29.1.tgz", + "integrity": "sha512-WM9lIkNdkhVwiArmLxFXpWndFGuOka4oJOZh8EP3Vb8q5lzdSCBuhjavJsw68Q9AKDGeOOIHYzYm4ZFvmWez5g==", "cpu": [ "s390x" ], @@ -2289,9 +2085,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.27.4.tgz", - "integrity": "sha512-Ni8mMtfo+o/G7DVtweXXV/Ol2TFf63KYjTtoZ5f078AUgJTmaIJnj4JFU7TK/9SVWTaSJGxPi5zMDgK4w+Ez7Q==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.29.1.tgz", + "integrity": "sha512-87xYCwb0cPGZFoGiErT1eDcssByaLX4fc0z2nRM6eMtV9njAfEE6OW3UniAoDhX4Iq5xQVpE6qO9aJbCFumKYQ==", "cpu": [ "x64" ], @@ -2303,9 +2099,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.27.4.tgz", - "integrity": "sha512-5AeeAF1PB9TUzD+3cROzFTnAJAcVUGLuR8ng0E0WXGkYhp6RD6L+6szYVX+64Rs0r72019KHZS1ka1q+zU/wUw==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.29.1.tgz", + "integrity": "sha512-xufkSNppNOdVRCEC4WKvlR1FBDyqCSCpQeMMgv9ZyXqqtKBfkw1yfGMTUTs9Qsl6WQbJnsGboWCp7pJGkeMhKA==", "cpu": [ "x64" ], @@ -2317,9 +2113,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.27.4.tgz", - "integrity": "sha512-yOpVsA4K5qVwu2CaS3hHxluWIK5HQTjNV4tWjQXluMiiiu4pJj4BN98CvxohNCpcjMeTXk/ZMJBRbgRg8HBB6A==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.29.1.tgz", + "integrity": "sha512-F2OiJ42m77lSkizZQLuC+jiZ2cgueWQL5YC9tjo3AgaEw+KJmVxHGSyQfDUoYR9cci0lAywv2Clmckzulcq6ig==", "cpu": [ "arm64" ], @@ -2331,9 +2127,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.27.4.tgz", - "integrity": "sha512-KtwEJOaHAVJlxV92rNYiG9JQwQAdhBlrjNRp7P9L8Cb4Rer3in+0A+IPhJC9y68WAi9H0sX4AiG2NTsVlmqJeQ==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.29.1.tgz", + "integrity": "sha512-rYRe5S0FcjlOBZQHgbTKNrqxCBUmgDJem/VQTCcTnA2KCabYSWQDrytOzX7avb79cAAweNmMUb/Zw18RNd4mng==", "cpu": [ "ia32" ], @@ -2345,9 +2141,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.27.4.tgz", - "integrity": "sha512-3j4jx1TppORdTAoBJRd+/wJRGCPC0ETWkXOecJ6PPZLj6SptXkrXcNqdj0oclbKML6FkQltdz7bBA3rUSirZug==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.29.1.tgz", + "integrity": "sha512-+10CMg9vt1MoHj6x1pxyjPSMjHTIlqs8/tBztXvPAx24SKs9jwVnKqHJumlH/IzhaPUaj3T6T6wfZr8okdXaIg==", "cpu": [ "x64" ], @@ -2359,9 +2155,9 @@ ] }, "node_modules/@swc/core": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.9.3.tgz", - "integrity": "sha512-oRj0AFePUhtatX+BscVhnzaAmWjpfAeySpM1TCbxA1rtBDeH/JDhi5yYzAKneDYtVtBvA7ApfeuzhMC9ye4xSg==", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.10.4.tgz", + "integrity": "sha512-ut3zfiTLORMxhr6y/GBxkHmzcGuVpwJYX4qyXWuBKkpw/0g0S5iO1/wW7RnLnZbAi8wS/n0atRZoaZlXWBkeJg==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", @@ -2377,16 +2173,16 @@ "url": "https://opencollective.com/swc" }, "optionalDependencies": { - "@swc/core-darwin-arm64": "1.9.3", - "@swc/core-darwin-x64": "1.9.3", - "@swc/core-linux-arm-gnueabihf": "1.9.3", - "@swc/core-linux-arm64-gnu": "1.9.3", - "@swc/core-linux-arm64-musl": "1.9.3", - "@swc/core-linux-x64-gnu": "1.9.3", - "@swc/core-linux-x64-musl": "1.9.3", - "@swc/core-win32-arm64-msvc": "1.9.3", - "@swc/core-win32-ia32-msvc": "1.9.3", - "@swc/core-win32-x64-msvc": "1.9.3" + "@swc/core-darwin-arm64": "1.10.4", + "@swc/core-darwin-x64": "1.10.4", + "@swc/core-linux-arm-gnueabihf": "1.10.4", + "@swc/core-linux-arm64-gnu": "1.10.4", + "@swc/core-linux-arm64-musl": "1.10.4", + "@swc/core-linux-x64-gnu": "1.10.4", + "@swc/core-linux-x64-musl": "1.10.4", + "@swc/core-win32-arm64-msvc": "1.10.4", + "@swc/core-win32-ia32-msvc": "1.10.4", + "@swc/core-win32-x64-msvc": "1.10.4" }, "peerDependencies": { "@swc/helpers": "*" @@ -2398,9 +2194,9 @@ } }, "node_modules/@swc/core-darwin-arm64": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.9.3.tgz", - "integrity": "sha512-hGfl/KTic/QY4tB9DkTbNuxy5cV4IeejpPD4zo+Lzt4iLlDWIeANL4Fkg67FiVceNJboqg48CUX+APhDHO5G1w==", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.10.4.tgz", + "integrity": "sha512-sV/eurLhkjn/197y48bxKP19oqcLydSel42Qsy2zepBltqUx+/zZ8+/IS0Bi7kaWVFxerbW1IPB09uq8Zuvm3g==", "cpu": [ "arm64" ], @@ -2415,9 +2211,9 @@ } }, "node_modules/@swc/core-darwin-x64": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.9.3.tgz", - "integrity": "sha512-IaRq05ZLdtgF5h9CzlcgaNHyg4VXuiStnOFpfNEMuI5fm5afP2S0FHq8WdakUz5WppsbddTdplL+vpeApt/WCQ==", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.10.4.tgz", + "integrity": "sha512-gjYNU6vrAUO4+FuovEo9ofnVosTFXkF0VDuo1MKPItz6e2pxc2ale4FGzLw0Nf7JB1sX4a8h06CN16/pLJ8Q2w==", "cpu": [ "x64" ], @@ -2432,9 +2228,9 @@ } }, "node_modules/@swc/core-linux-arm-gnueabihf": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.9.3.tgz", - "integrity": "sha512-Pbwe7xYprj/nEnZrNBvZfjnTxlBIcfApAGdz2EROhjpPj+FBqBa3wOogqbsuGGBdCphf8S+KPprL1z+oDWkmSQ==", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.10.4.tgz", + "integrity": "sha512-zd7fXH5w8s+Sfvn2oO464KDWl+ZX1MJiVmE4Pdk46N3PEaNwE0koTfgx2vQRqRG4vBBobzVvzICC3618WcefOA==", "cpu": [ "arm" ], @@ -2449,9 +2245,9 @@ } }, "node_modules/@swc/core-linux-arm64-gnu": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.9.3.tgz", - "integrity": "sha512-AQ5JZiwNGVV/2K2TVulg0mw/3LYfqpjZO6jDPtR2evNbk9Yt57YsVzS+3vHSlUBQDRV9/jqMuZYVU3P13xrk+g==", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.10.4.tgz", + "integrity": "sha512-+UGfoHDxsMZgFD3tABKLeEZHqLNOkxStu+qCG7atGBhS4Slri6h6zijVvf4yI5X3kbXdvc44XV/hrP/Klnui2A==", "cpu": [ "arm64" ], @@ -2466,9 +2262,9 @@ } }, "node_modules/@swc/core-linux-arm64-musl": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.9.3.tgz", - "integrity": "sha512-tzVH480RY6RbMl/QRgh5HK3zn1ZTFsThuxDGo6Iuk1MdwIbdFYUY034heWUTI4u3Db97ArKh0hNL0xhO3+PZdg==", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.10.4.tgz", + "integrity": "sha512-cDDj2/uYsOH0pgAnDkovLZvKJpFmBMyXkxEG6Q4yw99HbzO6QzZ5HDGWGWVq/6dLgYKlnnmpjZCPPQIu01mXEg==", "cpu": [ "arm64" ], @@ -2483,9 +2279,9 @@ } }, "node_modules/@swc/core-linux-x64-gnu": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.9.3.tgz", - "integrity": "sha512-ivXXBRDXDc9k4cdv10R21ccBmGebVOwKXT/UdH1PhxUn9m/h8erAWjz5pcELwjiMf27WokqPgaWVfaclDbgE+w==", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.10.4.tgz", + "integrity": "sha512-qJXh9D6Kf5xSdGWPINpLGixAbB5JX8JcbEJpRamhlDBoOcQC79dYfOMEIxWPhTS1DGLyFakAx2FX/b2VmQmj0g==", "cpu": [ "x64" ], @@ -2500,9 +2296,9 @@ } }, "node_modules/@swc/core-linux-x64-musl": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.9.3.tgz", - "integrity": "sha512-ILsGMgfnOz1HwdDz+ZgEuomIwkP1PHT6maigZxaCIuC6OPEhKE8uYna22uU63XvYcLQvZYDzpR3ms47WQPuNEg==", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.10.4.tgz", + "integrity": "sha512-A76lIAeyQnHCVt0RL/pG+0er8Qk9+acGJqSZOZm67Ve3B0oqMd871kPtaHBM0BW3OZAhoILgfHW3Op9Q3mx3Cw==", "cpu": [ "x64" ], @@ -2517,9 +2313,9 @@ } }, "node_modules/@swc/core-win32-arm64-msvc": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.9.3.tgz", - "integrity": "sha512-e+XmltDVIHieUnNJHtspn6B+PCcFOMYXNJB1GqoCcyinkEIQNwC8KtWgMqUucUbEWJkPc35NHy9k8aCXRmw9Kg==", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.10.4.tgz", + "integrity": "sha512-e6j5kBu4fIY7fFxFxnZI0MlEovRvp50Lg59Fw+DVbtqHk3C85dckcy5xKP+UoXeuEmFceauQDczUcGs19SRGSQ==", "cpu": [ "arm64" ], @@ -2534,9 +2330,9 @@ } }, "node_modules/@swc/core-win32-ia32-msvc": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.9.3.tgz", - "integrity": "sha512-rqpzNfpAooSL4UfQnHhkW8aL+oyjqJniDP0qwZfGnjDoJSbtPysHg2LpcOBEdSnEH+uIZq6J96qf0ZFD8AGfXA==", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.10.4.tgz", + "integrity": "sha512-RSYHfdKgNXV/amY5Tqk1EWVsyQnhlsM//jeqMLw5Fy9rfxP592W9UTumNikNRPdjI8wKKzNMXDb1U29tQjN0dg==", "cpu": [ "ia32" ], @@ -2551,9 +2347,9 @@ } }, "node_modules/@swc/core-win32-x64-msvc": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.9.3.tgz", - "integrity": "sha512-3YJJLQ5suIEHEKc1GHtqVq475guiyqisKSoUnoaRtxkDaW5g1yvPt9IoSLOe2mRs7+FFhGGU693RsBUSwOXSdQ==", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.10.4.tgz", + "integrity": "sha512-1ujYpaqfqNPYdwKBlvJnOqcl+Syn3UrQ4XE0Txz6zMYgyh6cdU6a3pxqLqIUSJ12MtXRA9ZUhEz1ekU3LfLWXw==", "cpu": [ "x64" ], @@ -2600,20 +2396,6 @@ "tailwindcss": ">=3.0.0 || insiders || >=4.0.0-alpha.20" } }, - "node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser": { - "version": "6.0.10", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz", - "integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==", - "dev": true, - "license": "MIT", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@types/cookie": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", @@ -2738,9 +2520,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.10.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", - "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", + "version": "22.10.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.5.tgz", + "integrity": "sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2750,12 +2532,14 @@ "node_modules/@types/prismjs": { "version": "1.26.5", "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.5.tgz", - "integrity": "sha512-AUZTa7hQ2KY5L7AmtSiqxlhWxb4ina0yd8hNbl4TWuqnv/pFP0nDMb3YrfSBf4hJVGLh2YEIBfKaBW/9UEl6IQ==" + "integrity": "sha512-AUZTa7hQ2KY5L7AmtSiqxlhWxb4ina0yd8hNbl4TWuqnv/pFP0nDMb3YrfSBf4hJVGLh2YEIBfKaBW/9UEl6IQ==", + "license": "MIT" }, "node_modules/@types/react": { "version": "19.0.2", "resolved": "https://registry.npmjs.org/@types/react/-/react-19.0.2.tgz", "integrity": "sha512-USU8ZI/xyKJwFTpjSVIrSeHBVAGagkHQKPNbxeWwql/vDmnTIBgx+TJnhFnj1NXgz8XfprU0egV2dROLGpsBEg==", + "license": "MIT", "dependencies": { "csstype": "^3.0.2" } @@ -2774,6 +2558,7 @@ "version": "15.5.13", "resolved": "https://registry.npmjs.org/@types/react-syntax-highlighter/-/react-syntax-highlighter-15.5.13.tgz", "integrity": "sha512-uLGJ87j6Sz8UaBAooU0T6lWJ0dBmjZgN1PZTrj05TNql2/XpC6+4HhMT5syIdFUUt+FASfCeLLv4kBygNU+8qA==", + "license": "MIT", "dependencies": { "@types/react": "*" } @@ -2785,17 +2570,17 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.16.0.tgz", - "integrity": "sha512-5YTHKV8MYlyMI6BaEG7crQ9BhSc8RxzshOReKwZwRWN0+XvvTOm+L/UYLCYxFpfwYuAAqhxiq4yae0CMFwbL7Q==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.19.0.tgz", + "integrity": "sha512-NggSaEZCdSrFddbctrVjkVZvFC6KGfKfNK0CU7mNK/iKHGKbzT4Wmgm08dKpcZECBu9f5FypndoMyRHkdqfT1Q==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.16.0", - "@typescript-eslint/type-utils": "8.16.0", - "@typescript-eslint/utils": "8.16.0", - "@typescript-eslint/visitor-keys": "8.16.0", + "@typescript-eslint/scope-manager": "8.19.0", + "@typescript-eslint/type-utils": "8.19.0", + "@typescript-eslint/utils": "8.19.0", + "@typescript-eslint/visitor-keys": "8.19.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -2810,25 +2595,21 @@ }, "peerDependencies": { "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/parser": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.16.0.tgz", - "integrity": "sha512-D7DbgGFtsqIPIFMPJwCad9Gfi/hC0PWErRRHFnaCWoEDYi5tQUDiJCTmGUbBiLzjqAck4KcXt9Ayj0CNlIrF+w==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.19.0.tgz", + "integrity": "sha512-6M8taKyOETY1TKHp0x8ndycipTVgmp4xtg5QpEZzXxDhNvvHOJi5rLRkLr8SK3jTgD5l4fTlvBiRdfsuWydxBw==", "dev": true, - "license": "BSD-2-Clause", + "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.16.0", - "@typescript-eslint/types": "8.16.0", - "@typescript-eslint/typescript-estree": "8.16.0", - "@typescript-eslint/visitor-keys": "8.16.0", + "@typescript-eslint/scope-manager": "8.19.0", + "@typescript-eslint/types": "8.19.0", + "@typescript-eslint/typescript-estree": "8.19.0", + "@typescript-eslint/visitor-keys": "8.19.0", "debug": "^4.3.4" }, "engines": { @@ -2839,23 +2620,19 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.16.0.tgz", - "integrity": "sha512-mwsZWubQvBki2t5565uxF0EYvG+FwdFb8bMtDuGQLdCCnGPrDEDvm1gtfynuKlnpzeBRqdFCkMf9jg1fnAK8sg==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.19.0.tgz", + "integrity": "sha512-hkoJiKQS3GQ13TSMEiuNmSCvhz7ujyqD1x3ShbaETATHrck+9RaDdUbt+osXaUuns9OFwrDTTrjtwsU8gJyyRA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.16.0", - "@typescript-eslint/visitor-keys": "8.16.0" + "@typescript-eslint/types": "8.19.0", + "@typescript-eslint/visitor-keys": "8.19.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2866,14 +2643,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.16.0.tgz", - "integrity": "sha512-IqZHGG+g1XCWX9NyqnI/0CX5LL8/18awQqmkZSl2ynn8F76j579dByc0jhfVSnSnhf7zv76mKBQv9HQFKvDCgg==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.19.0.tgz", + "integrity": "sha512-TZs0I0OSbd5Aza4qAMpp1cdCYVnER94IziudE3JU328YUHgWu9gwiwhag+fuLeJ2LkWLXI+F/182TbG+JaBdTg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.16.0", - "@typescript-eslint/utils": "8.16.0", + "@typescript-eslint/typescript-estree": "8.19.0", + "@typescript-eslint/utils": "8.19.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -2885,18 +2662,14 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/types": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.16.0.tgz", - "integrity": "sha512-NzrHj6thBAOSE4d9bsuRNMvk+BvaQvmY4dDglgkgGC0EW/tB3Kelnp3tAKH87GEwzoxgeQn9fNGRyFJM/xd+GQ==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.19.0.tgz", + "integrity": "sha512-8XQ4Ss7G9WX8oaYvD4OOLCjIQYgRQxO+qCiR2V2s2GxI9AUpo7riNwo6jDhKtTcaJjT8PY54j2Yb33kWtSJsmA==", "dev": true, "license": "MIT", "engines": { @@ -2908,14 +2681,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.16.0.tgz", - "integrity": "sha512-E2+9IzzXMc1iaBy9zmo+UYvluE3TW7bCGWSF41hVWUE01o8nzr1rvOQYSxelxr6StUvRcTMe633eY8mXASMaNw==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.19.0.tgz", + "integrity": "sha512-WW9PpDaLIFW9LCbucMSdYUuGeFUz1OkWYS/5fwZwTA+l2RwlWFdJvReQqMUMBw4yJWJOfqd7An9uwut2Oj8sLw==", "dev": true, - "license": "BSD-2-Clause", + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.16.0", - "@typescript-eslint/visitor-keys": "8.16.0", + "@typescript-eslint/types": "8.19.0", + "@typescript-eslint/visitor-keys": "8.19.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -2930,10 +2703,8 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { @@ -2962,17 +2733,30 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@typescript-eslint/utils": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.16.0.tgz", - "integrity": "sha512-C1zRy/mOL8Pj157GiX4kaw7iyRLKfJXBR3L82hk5kS/GyHcOFmy4YUq/zfZti72I9wnuQtA/+xzft4wCC8PJdA==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.19.0.tgz", + "integrity": "sha512-PTBG+0oEMPH9jCZlfg07LCB2nYI0I317yyvXGfxnvGvw4SHIOuRnQ3kadyyXY6tGdChusIHIbM5zfIbp4M6tCg==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.16.0", - "@typescript-eslint/types": "8.16.0", - "@typescript-eslint/typescript-estree": "8.16.0" + "@typescript-eslint/scope-manager": "8.19.0", + "@typescript-eslint/types": "8.19.0", + "@typescript-eslint/typescript-estree": "8.19.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2982,22 +2766,18 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.16.0.tgz", - "integrity": "sha512-pq19gbaMOmFE3CbL0ZB8J8BFCo2ckfHBfaIsaOZgBIF4EoISJIdLX5xRhd0FGB0LlHReNRuzoJoMGpTjq8F2CQ==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.19.0.tgz", + "integrity": "sha512-mCFtBbFBJDCNCWUl5y6sZSCHXw1DEFEk3c/M3nRK2a4XUB8StGFtmcEMizdjKuBzB6e/smJAAWYug3VrdLMr1w==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/types": "8.19.0", "eslint-visitor-keys": "^4.2.0" }, "engines": { @@ -3009,9 +2789,9 @@ } }, "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.1.tgz", + "integrity": "sha512-fEzPV3hSkSMltkw152tJKNARhOupqbH96MZWyRjNaYZOMIzbrTeQDG+MTc6Mr2pgzFQzFxAfmhGDNP5QK++2ZA==", "license": "ISC" }, "node_modules/@vitejs/plugin-react-swc": { @@ -3027,6 +2807,139 @@ "vite": "^4 || ^5 || ^6" } }, + "node_modules/@vitest/coverage-istanbul": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/coverage-istanbul/-/coverage-istanbul-2.1.8.tgz", + "integrity": "sha512-cSaCd8KcWWvgDwEJSXm0NEWZ1YTiJzjicKHy+zOEbUm0gjbbkz+qJf1p8q71uBzSlS7vdnZA8wRLeiwVE3fFTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@istanbuljs/schema": "^0.1.3", + "debug": "^4.3.7", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-instrument": "^6.0.3", + "istanbul-lib-report": "^3.0.1", + "istanbul-lib-source-maps": "^5.0.6", + "istanbul-reports": "^3.1.7", + "magicast": "^0.3.5", + "test-exclude": "^7.0.1", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "2.1.8" + } + }, + "node_modules/@vitest/expect": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.8.tgz", + "integrity": "sha512-8ytZ/fFHq2g4PJVAtDX57mayemKgDR6X3Oa2Foro+EygiOJHUXhCqBAAKQYYajZpFoIfvBCF1j6R6IYRSIUFuw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.8", + "@vitest/utils": "2.1.8", + "chai": "^5.1.2", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/pretty-format": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.8.tgz", + "integrity": "sha512-9HiSZ9zpqNLKlbIDRWOnAWqgcA7xu+8YxXSekhr0Ykab7PAYFkhkwoqVArPOtJhPmYeE2YHgKZlj3CP36z2AJQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.8.tgz", + "integrity": "sha512-17ub8vQstRnRlIU5k50bG+QOMLHRhYPAna5tw8tYbj+jzjcspnwnwtPtiOlkuKC4+ixDPTuLZiqiWWQ2PSXHVg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "2.1.8", + "pathe": "^1.1.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.8.tgz", + "integrity": "sha512-20T7xRFbmnkfcmgVEz+z3AU/3b0cEzZOt/zmnvZEctg64/QZbSDJEVm9fLnnlSi74KibmRsO9/Qabi+t0vCRPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.8", + "magic-string": "^0.30.12", + "pathe": "^1.1.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.8.tgz", + "integrity": "sha512-5swjf2q95gXeYPevtW0BLk6H8+bPlMb4Vw/9Em4hFxDcaOxS+e0LOX4yqNxoHzMR2akEB2xfpnWUzkZokmgWDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^3.0.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/ui": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-2.1.8.tgz", + "integrity": "sha512-5zPJ1fs0ixSVSs5+5V2XJjXLmNzjugHRyV11RqxYVR+oMcogZ9qTuSfKW+OcTV0JeFNznI83BNylzH6SSNJ1+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "2.1.8", + "fflate": "^0.8.2", + "flatted": "^3.3.1", + "pathe": "^1.1.2", + "sirv": "^3.0.0", + "tinyglobby": "^0.2.10", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "2.1.8" + } + }, + "node_modules/@vitest/utils": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.8.tgz", + "integrity": "sha512-dwSoui6djdwbfFmIgbIjX2ZhIoG7Ex/+xpxyiEgIGzjliY8xGkcpITKTlp6B4MgtGkF2ilvm97cPM96XZaAgcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.8", + "loupe": "^3.1.2", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, "node_modules/acorn": { "version": "8.14.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", @@ -3154,6 +3067,16 @@ "node": ">=10" } }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, "node_modules/autoprefixer": { "version": "10.4.20", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.20.tgz", @@ -3244,9 +3167,9 @@ } }, "node_modules/browserslist": { - "version": "4.24.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz", - "integrity": "sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==", + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.3.tgz", + "integrity": "sha512-1CPmv8iobE2fyRMV97dAcMVegvvWKxmq94hkLiAkUGwKVTyDLw33K+ZxiFrREKmmps4rIw6grcCFCnTMSZ/YiA==", "dev": true, "funding": [ { @@ -3264,9 +3187,9 @@ ], "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001669", - "electron-to-chromium": "^1.5.41", - "node-releases": "^2.0.18", + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", "update-browserslist-db": "^1.1.1" }, "bin": { @@ -3276,6 +3199,16 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -3296,9 +3229,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001684", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001684.tgz", - "integrity": "sha512-G1LRwLIQjBQoyq0ZJGqGIJUXzJ8irpbjHLpVRXDvBEScFJ9b17sgK6vlx0GAJFE21okD7zXl08rRRUfq6HdoEQ==", + "version": "1.0.30001690", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001690.tgz", + "integrity": "sha512-5ExiE3qQN6oF8Clf8ifIDcMRCRE/dMGcETG/XGMD8/XiXm6HXQgQTh1yZYLXXpSOsEUlJm1Xr7kGULZTuGtP/w==", "dev": true, "funding": [ { @@ -3326,6 +3259,23 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/chai": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.2.tgz", + "integrity": "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -3383,6 +3333,16 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/check-error": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, "node_modules/chokidar": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", @@ -3464,31 +3424,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/cli-truncate/node_modules/emoji-regex": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", - "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", - "dev": true, - "license": "MIT" - }, - "node_modules/cli-truncate/node_modules/string-width": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", - "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^10.3.0", - "get-east-asian-width": "^1.0.0", - "strip-ansi": "^7.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/clsx": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", @@ -3534,12 +3469,13 @@ } }, "node_modules/commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "dev": true, "license": "MIT", "engines": { - "node": ">= 6" + "node": ">=18" } }, "node_modules/concat-map": { @@ -3549,6 +3485,13 @@ "dev": true, "license": "MIT" }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, "node_modules/cookie": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz", @@ -3620,10 +3563,13 @@ } }, "node_modules/d3-format": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-1.4.5.tgz", - "integrity": "sha512-J0piedu6Z8iB6TbIGfZgDzfXxUFN3qQRMofy2oPdXzQibYGqPB/9iMcxr/TGalU+2RsyDO+U4f33id8tbnSRMQ==", - "license": "BSD-3-Clause" + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.0.tgz", + "integrity": "sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==", + "license": "ISC", + "engines": { + "node": ">=12" + } }, "node_modules/d3-interpolate": { "version": "3.0.1", @@ -3687,38 +3633,17 @@ } }, "node_modules/d3-time-format": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-3.0.0.tgz", - "integrity": "sha512-UXJh6EKsHBTjopVqZBhFysQcoXSv/5yLONZvkQ5Kk3qbwiUYkdX17Xa1PT6U1ZWXGGfB1ey5L8dKMlFq2DO0Ag==", - "license": "BSD-3-Clause", - "dependencies": { - "d3-time": "1 - 2" - } - }, - "node_modules/d3-time-format/node_modules/d3-array": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz", - "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==", - "license": "BSD-3-Clause", - "dependencies": { - "internmap": "^1.0.0" - } - }, - "node_modules/d3-time-format/node_modules/d3-time": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-2.1.1.tgz", - "integrity": "sha512-/eIQe/eR4kCQwq7yxi7z4c6qEXf2IYGcjoWB5OOQy4Tq9Uv39/947qlDcN2TLkiTzQWzvnsuYPB9TrWaNfipKQ==", - "license": "BSD-3-Clause", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", + "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", + "license": "ISC", "dependencies": { - "d3-array": "2" + "d3-time": "1 - 3" + }, + "engines": { + "node": ">=12" } }, - "node_modules/d3-time-format/node_modules/internmap": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/internmap/-/internmap-1.0.1.tgz", - "integrity": "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==", - "license": "ISC" - }, "node_modules/d3-timer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", @@ -3774,6 +3699,16 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -3793,7 +3728,8 @@ "node_modules/detect-node-es": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz", - "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==" + "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==", + "license": "MIT" }, "node_modules/devlop": { "version": "1.1.0", @@ -3837,16 +3773,17 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.66", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.66.tgz", - "integrity": "sha512-pI2QF6+i+zjPbqRzJwkMvtvkdI7MjVbSh2g8dlMguDJIXEPw+kwasS1Jl+YGPEBfGVxsVgGUratAKymPdPo2vQ==", + "version": "1.5.76", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.76.tgz", + "integrity": "sha512-CjVQyG7n7Sr+eBXE86HIulnL5N8xZY1sgmOPGuq/F0Rr0FJq63lg0kEtOIDfZBk44FnDLf6FUJ+dsJcuiUDdDQ==", "dev": true, "license": "ISC" }, "node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", + "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", + "dev": true, "license": "MIT" }, "node_modules/environment": { @@ -3862,10 +3799,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/es-module-lexer": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.6.0.tgz", + "integrity": "sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==", + "dev": true, + "license": "MIT" + }, "node_modules/esbuild": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.0.tgz", - "integrity": "sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.2.tgz", + "integrity": "sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -3876,30 +3820,31 @@ "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.24.0", - "@esbuild/android-arm": "0.24.0", - "@esbuild/android-arm64": "0.24.0", - "@esbuild/android-x64": "0.24.0", - "@esbuild/darwin-arm64": "0.24.0", - "@esbuild/darwin-x64": "0.24.0", - "@esbuild/freebsd-arm64": "0.24.0", - "@esbuild/freebsd-x64": "0.24.0", - "@esbuild/linux-arm": "0.24.0", - "@esbuild/linux-arm64": "0.24.0", - "@esbuild/linux-ia32": "0.24.0", - "@esbuild/linux-loong64": "0.24.0", - "@esbuild/linux-mips64el": "0.24.0", - "@esbuild/linux-ppc64": "0.24.0", - "@esbuild/linux-riscv64": "0.24.0", - "@esbuild/linux-s390x": "0.24.0", - "@esbuild/linux-x64": "0.24.0", - "@esbuild/netbsd-x64": "0.24.0", - "@esbuild/openbsd-arm64": "0.24.0", - "@esbuild/openbsd-x64": "0.24.0", - "@esbuild/sunos-x64": "0.24.0", - "@esbuild/win32-arm64": "0.24.0", - "@esbuild/win32-ia32": "0.24.0", - "@esbuild/win32-x64": "0.24.0" + "@esbuild/aix-ppc64": "0.24.2", + "@esbuild/android-arm": "0.24.2", + "@esbuild/android-arm64": "0.24.2", + "@esbuild/android-x64": "0.24.2", + "@esbuild/darwin-arm64": "0.24.2", + "@esbuild/darwin-x64": "0.24.2", + "@esbuild/freebsd-arm64": "0.24.2", + "@esbuild/freebsd-x64": "0.24.2", + "@esbuild/linux-arm": "0.24.2", + "@esbuild/linux-arm64": "0.24.2", + "@esbuild/linux-ia32": "0.24.2", + "@esbuild/linux-loong64": "0.24.2", + "@esbuild/linux-mips64el": "0.24.2", + "@esbuild/linux-ppc64": "0.24.2", + "@esbuild/linux-riscv64": "0.24.2", + "@esbuild/linux-s390x": "0.24.2", + "@esbuild/linux-x64": "0.24.2", + "@esbuild/netbsd-arm64": "0.24.2", + "@esbuild/netbsd-x64": "0.24.2", + "@esbuild/openbsd-arm64": "0.24.2", + "@esbuild/openbsd-x64": "0.24.2", + "@esbuild/sunos-x64": "0.24.2", + "@esbuild/win32-arm64": "0.24.2", + "@esbuild/win32-ia32": "0.24.2", + "@esbuild/win32-x64": "0.24.2" } }, "node_modules/escalade": { @@ -3930,6 +3875,7 @@ "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.17.0.tgz", "integrity": "sha512-evtlNcpJg+cZLcnVKwsai8fExnqjGPicK7gnUtlNuzu+Fv9bI0aLpND5T44VLQtoMEnI57LoXO9XAkIXwohKrA==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", @@ -4099,6 +4045,16 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -4110,9 +4066,10 @@ } }, "node_modules/eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "dev": true, "license": "MIT" }, "node_modules/execa": { @@ -4139,6 +4096,16 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/expect-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.1.0.tgz", + "integrity": "sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -4204,9 +4171,9 @@ "license": "MIT" }, "node_modules/fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.18.0.tgz", + "integrity": "sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==", "license": "ISC", "dependencies": { "reusify": "^1.0.4" @@ -4216,6 +4183,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/fault/-/fault-1.0.4.tgz", "integrity": "sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA==", + "license": "MIT", "dependencies": { "format": "^0.2.0" }, @@ -4224,6 +4192,13 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/fflate": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", + "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", + "dev": true, + "license": "MIT" + }, "node_modules/file-entry-cache": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", @@ -4348,6 +4323,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/get-east-asian-width": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.3.0.tgz", @@ -4365,6 +4350,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-nonce/-/get-nonce-1.0.1.tgz", "integrity": "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==", + "license": "MIT", "engines": { "node": ">=6" } @@ -4439,9 +4425,9 @@ } }, "node_modules/globals": { - "version": "15.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-15.12.0.tgz", - "integrity": "sha512-1+gLErljJFhbOVyaetcwJiJ4+eLe45S2E7P5UiZ9xGfeq3ATQf5DOv9G7MH3gGbKQLkzmNh2DxfZwLdw+j6oTQ==", + "version": "15.14.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.14.0.tgz", + "integrity": "sha512-OkToC372DtlQeje9/zHIo5CT8lRP/FUgEOKBEhU4e0abL7J7CD24fD9ohiLN5hagG/kWCYj4K5oaxxtj2Z0Dig==", "dev": true, "license": "MIT", "engines": { @@ -4484,6 +4470,7 @@ "version": "2.2.5", "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz", "integrity": "sha512-7j6mrk/qqkSehsM92wQjdIgWM2/BW61u/53G6xmC8i1OmEdKLHbk419QKQUjz6LglWsfqoiHmyMRkP1BGjecNQ==", + "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" @@ -4533,6 +4520,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-6.0.0.tgz", "integrity": "sha512-nDM6bvd7lIqDUiYEiu5Sl/+6ReP0BMk/2f4U/Rooccxkj0P5nm+acM5PrGJ/t5I8qPGiqZSE6hVAwZEdZIvP4w==", + "license": "MIT", "dependencies": { "@types/hast": "^2.0.0", "comma-separated-tokens": "^1.0.0", @@ -4549,6 +4537,7 @@ "version": "2.3.10", "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.10.tgz", "integrity": "sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw==", + "license": "MIT", "dependencies": { "@types/unist": "^2" } @@ -4556,12 +4545,14 @@ "node_modules/hastscript/node_modules/@types/unist": { "version": "2.0.11", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", - "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==" + "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", + "license": "MIT" }, "node_modules/hastscript/node_modules/comma-separated-tokens": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz", "integrity": "sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -4571,6 +4562,7 @@ "version": "5.6.0", "resolved": "https://registry.npmjs.org/property-information/-/property-information-5.6.0.tgz", "integrity": "sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA==", + "license": "MIT", "dependencies": { "xtend": "^4.0.0" }, @@ -4583,6 +4575,7 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz", "integrity": "sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -4600,7 +4593,15 @@ "node_modules/highlightjs-vue": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/highlightjs-vue/-/highlightjs-vue-1.0.0.tgz", - "integrity": "sha512-PDEfEF102G23vHmPhLyPboFCD+BkMGu+GuJe2d9/eH4FsCwvgBpnc9n0pGE+ffKdph38s6foEZiEjdgHdzp+IA==" + "integrity": "sha512-PDEfEF102G23vHmPhLyPboFCD+BkMGu+GuJe2d9/eH4FsCwvgBpnc9n0pGE+ffKdph38s6foEZiEjdgHdzp+IA==", + "license": "CC0-1.0" + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" }, "node_modules/html-url-attributes": { "version": "3.0.1", @@ -4727,9 +4728,9 @@ } }, "node_modules/is-core-module": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", - "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", "license": "MIT", "dependencies": { "hasown": "^2.0.2" @@ -4761,12 +4762,16 @@ } }, "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", + "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", + "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-glob": { @@ -4831,6 +4836,90 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "license": "ISC" }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.6.tgz", + "integrity": "sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.23", + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/jackspeak": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", @@ -4847,9 +4936,9 @@ } }, "node_modules/jiti": { - "version": "1.21.6", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.6.tgz", - "integrity": "sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==", + "version": "1.21.7", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz", + "integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==", "license": "MIT", "bin": { "jiti": "bin/jiti.js" @@ -4874,6 +4963,19 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -4895,6 +4997,19 @@ "dev": true, "license": "MIT" }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -4920,12 +5035,15 @@ } }, "node_modules/lilconfig": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", - "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", "license": "MIT", "engines": { - "node": ">=10" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" } }, "node_modules/lines-and-columns": { @@ -4975,29 +5093,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/lint-staged/node_modules/commander": { - "version": "12.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", - "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - } - }, - "node_modules/lint-staged/node_modules/lilconfig": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", - "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antonk52" - } - }, "node_modules/listr2": { "version": "8.2.5", "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.5.tgz", @@ -5016,69 +5111,6 @@ "node": ">=18.0.0" } }, - "node_modules/listr2/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/listr2/node_modules/emoji-regex": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", - "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", - "dev": true, - "license": "MIT" - }, - "node_modules/listr2/node_modules/eventemitter3": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", - "dev": true, - "license": "MIT" - }, - "node_modules/listr2/node_modules/string-width": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", - "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^10.3.0", - "get-east-asian-width": "^1.0.0", - "strip-ansi": "^7.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/listr2/node_modules/wrap-ansi": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", - "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.2.1", - "string-width": "^7.0.0", - "strip-ansi": "^7.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -5149,62 +5181,20 @@ "dev": true, "license": "MIT", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/log-update/node_modules/emoji-regex": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", - "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", - "dev": true, - "license": "MIT" - }, - "node_modules/log-update/node_modules/is-fullwidth-code-point": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz", - "integrity": "sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==", - "dev": true, - "license": "MIT", - "dependencies": { - "get-east-asian-width": "^1.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/log-update/node_modules/slice-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.0.tgz", - "integrity": "sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.2.1", - "is-fullwidth-code-point": "^5.0.0" - }, - "engines": { - "node": ">=18" + "node": ">=12" }, "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/log-update/node_modules/string-width": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", - "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "node_modules/log-update/node_modules/is-fullwidth-code-point": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz", + "integrity": "sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==", "dev": true, "license": "MIT", "dependencies": { - "emoji-regex": "^10.3.0", - "get-east-asian-width": "^1.0.0", - "strip-ansi": "^7.1.0" + "get-east-asian-width": "^1.0.0" }, "engines": { "node": ">=18" @@ -5213,22 +5203,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/log-update/node_modules/wrap-ansi": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", - "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", + "node_modules/log-update/node_modules/slice-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.0.tgz", + "integrity": "sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==", "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^6.2.1", - "string-width": "^7.0.0", - "strip-ansi": "^7.1.0" + "is-fullwidth-code-point": "^5.0.0" }, "engines": { "node": ">=18" }, "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, "node_modules/longest-streak": { @@ -5253,10 +5242,18 @@ "loose-envify": "cli.js" } }, + "node_modules/loupe": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz", + "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==", + "dev": true, + "license": "MIT" + }, "node_modules/lowlight": { "version": "1.20.0", "resolved": "https://registry.npmjs.org/lowlight/-/lowlight-1.20.0.tgz", "integrity": "sha512-8Ktj+prEb1RoCPkEOrPMYUN/nCggB7qAWe3a7OpMjWQkh3l2RD5wKRQ+o8Q8YuI9RG/xs95waaI/E6ym/7NsTw==", + "license": "MIT", "dependencies": { "fault": "^1.0.0", "highlight.js": "~10.7.0" @@ -5276,19 +5273,75 @@ } }, "node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "license": "ISC" + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } }, "node_modules/lucide-react": { "version": "0.462.0", "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.462.0.tgz", "integrity": "sha512-NTL7EbAao9IFtuSivSZgrAh4fZd09Lr+6MTkqIxuHaH2nnYiYIzXPo06cOxHg9wKLdj6LL8TByG4qpePqwgx/g==", + "license": "ISC", "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc" } }, + "node_modules/magic-string": { + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/magicast": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.5.tgz", + "integrity": "sha512-L0WhttDl+2BOsybvEOLK7fW3UA0OQ0IQ2d6Zl2x/a6vVRs3bAY0ECOSHHeL5jD+SbOpOCUEi0y1DgHEn9Qn1AQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.25.4", + "@babel/types": "^7.25.4", + "source-map-js": "^1.2.0" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/markdown-table": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.4.tgz", @@ -5300,9 +5353,9 @@ } }, "node_modules/mdast-util-find-and-replace": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.1.tgz", - "integrity": "sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.2.tgz", + "integrity": "sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg==", "license": "MIT", "dependencies": { "@types/mdast": "^4.0.0", @@ -6221,6 +6274,16 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/mrmime": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", + "integrity": "sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -6264,9 +6327,9 @@ "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", - "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", "dev": true, "license": "MIT" }, @@ -6422,13 +6485,12 @@ } }, "node_modules/parse-entities": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.1.tgz", - "integrity": "sha512-SWzvYcSJh4d/SGLIOQfZ/CoNv6BTlI6YEQ7Nj82oDVnRpwe/Z/F1EMx42x3JAOwGBlCjeCH0BRJQbQ/opHL17w==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.2.tgz", + "integrity": "sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==", "license": "MIT", "dependencies": { "@types/unist": "^2.0.0", - "character-entities": "^2.0.0", "character-entities-legacy": "^3.0.0", "character-reference-invalid": "^2.0.0", "decode-named-character-reference": "^1.0.0", @@ -6488,6 +6550,29 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" + }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathval": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", + "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16" + } + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -6636,18 +6721,6 @@ } } }, - "node_modules/postcss-load-config/node_modules/lilconfig": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.2.tgz", - "integrity": "sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==", - "license": "MIT", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antonk52" - } - }, "node_modules/postcss-nested": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz", @@ -6673,7 +6746,7 @@ "postcss": "^8.2.14" } }, - "node_modules/postcss-selector-parser": { + "node_modules/postcss-nested/node_modules/postcss-selector-parser": { "version": "6.1.2", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", @@ -6686,6 +6759,20 @@ "node": ">=4" } }, + "node_modules/postcss-selector-parser": { + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz", + "integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/postcss-value-parser": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", @@ -6706,6 +6793,7 @@ "version": "1.29.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==", + "license": "MIT", "engines": { "node": ">=6" } @@ -6721,6 +6809,12 @@ "react-is": "^16.13.1" } }, + "node_modules/prop-types/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "license": "MIT" + }, "node_modules/property-information": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.5.0.tgz", @@ -6783,9 +6877,9 @@ } }, "node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "license": "MIT" }, "node_modules/react-markdown": { @@ -6865,6 +6959,7 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.1.1.tgz", "integrity": "sha512-39sXJkftkKWRZ2oJtHhCxmoCrBCULr/HAH4IT5DHlgu/Q0FCPV0S4Lx+abjDTx/74xoZzNYDYbOZWlJjruyuDQ==", + "license": "MIT", "dependencies": { "@types/cookie": "^0.6.0", "cookie": "^1.0.1", @@ -6888,6 +6983,7 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.1.1.tgz", "integrity": "sha512-vSrQHWlJ5DCfyrhgo0k6zViOe9ToK8uT5XGSmnuC2R3/g261IdIMpZVqfjD6vWSXdnf5Czs4VA/V60oVR6/jnA==", + "license": "MIT", "dependencies": { "react-router": "7.1.1" }, @@ -6899,10 +6995,26 @@ "react-dom": ">=18" } }, + "node_modules/react-smooth": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/react-smooth/-/react-smooth-4.0.4.tgz", + "integrity": "sha512-gnGKTpYwqL0Iii09gHobNolvX4Kiq4PKx6eWBCYYix+8cdw+cGo3do906l1NBPKkSWx1DghC1dlWG9L2uGd61Q==", + "license": "MIT", + "dependencies": { + "fast-equals": "^5.0.1", + "prop-types": "^15.8.1", + "react-transition-group": "^4.4.5" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, "node_modules/react-style-singleton": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.3.tgz", "integrity": "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ==", + "license": "MIT", "dependencies": { "get-nonce": "^1.0.0", "tslib": "^2.0.0" @@ -6924,6 +7036,7 @@ "version": "15.6.1", "resolved": "https://registry.npmjs.org/react-syntax-highlighter/-/react-syntax-highlighter-15.6.1.tgz", "integrity": "sha512-OqJ2/vL7lEeV5zTJyG7kmARppUjiB9h9udl4qHQjjgEos66z00Ia0OckwYfRxCSFrW8RJIBnsBwQsHZbVPspqg==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.3.1", "highlight.js": "^10.4.1", @@ -6945,6 +7058,22 @@ "node": "*" } }, + "node_modules/react-transition-group": { + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", + "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", + "license": "BSD-3-Clause", + "dependencies": { + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", + "loose-envify": "^1.4.0", + "prop-types": "^15.6.2" + }, + "peerDependencies": { + "react": ">=16.6.0", + "react-dom": ">=16.6.0" + } + }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", @@ -6998,47 +7127,17 @@ "decimal.js-light": "^2.4.1" } }, - "node_modules/recharts/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "node_modules/recharts/node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", "license": "MIT" }, - "node_modules/recharts/node_modules/react-smooth": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/react-smooth/-/react-smooth-4.0.4.tgz", - "integrity": "sha512-gnGKTpYwqL0Iii09gHobNolvX4Kiq4PKx6eWBCYYix+8cdw+cGo3do906l1NBPKkSWx1DghC1dlWG9L2uGd61Q==", - "license": "MIT", - "dependencies": { - "fast-equals": "^5.0.1", - "prop-types": "^15.8.1", - "react-transition-group": "^4.4.5" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - } - }, - "node_modules/recharts/node_modules/react-smooth/node_modules/react-transition-group": { - "version": "4.4.5", - "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", - "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", - "license": "BSD-3-Clause", - "dependencies": { - "@babel/runtime": "^7.5.5", - "dom-helpers": "^5.0.1", - "loose-envify": "^1.4.0", - "prop-types": "^15.6.2" - }, - "peerDependencies": { - "react": ">=16.6.0", - "react-dom": ">=16.6.0" - } - }, "node_modules/refractor": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/refractor/-/refractor-3.6.0.tgz", "integrity": "sha512-MY9W41IOWxxk31o+YvFCNyNzdkc9M20NoZK5vq6jkv4I/uh2zkWcfudj0Q1fovjUQJrNewS9NMzeTtqPf+n5EA==", + "license": "MIT", "dependencies": { "hastscript": "^6.0.0", "parse-entities": "^2.0.0", @@ -7053,6 +7152,7 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.4.tgz", "integrity": "sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -7062,6 +7162,7 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz", "integrity": "sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -7071,6 +7172,7 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz", "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -7080,6 +7182,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz", "integrity": "sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -7089,6 +7192,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", "integrity": "sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==", + "license": "MIT", "dependencies": { "is-alphabetical": "^1.0.0", "is-decimal": "^1.0.0" @@ -7102,6 +7206,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz", "integrity": "sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -7111,6 +7216,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz", "integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -7120,6 +7226,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz", "integrity": "sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==", + "license": "MIT", "dependencies": { "character-entities": "^1.0.0", "character-entities-legacy": "^1.0.0", @@ -7137,6 +7244,7 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.27.0.tgz", "integrity": "sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA==", + "license": "MIT", "engines": { "node": ">=6" } @@ -7214,18 +7322,21 @@ } }, "node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", "license": "MIT", "dependencies": { - "is-core-module": "^2.13.0", + "is-core-module": "^2.16.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -7291,9 +7402,9 @@ "license": "MIT" }, "node_modules/rollup": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.27.4.tgz", - "integrity": "sha512-RLKxqHEMjh/RGLsDxAEsaLO3mWgyoU6x9w6n1ikAzet4B3gI2/3yP6PWY2p9QzRTh6MfEIXB3MwsOY0Iv3vNrw==", + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.29.1.tgz", + "integrity": "sha512-RaJ45M/kmJUzSWDs1Nnd5DdV4eerC98idtUOVr6FfKcgxqvjwHmxc5upLF9qZU9EpsVzzhleFahrT3shLuJzIw==", "dev": true, "license": "MIT", "dependencies": { @@ -7307,24 +7418,25 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.27.4", - "@rollup/rollup-android-arm64": "4.27.4", - "@rollup/rollup-darwin-arm64": "4.27.4", - "@rollup/rollup-darwin-x64": "4.27.4", - "@rollup/rollup-freebsd-arm64": "4.27.4", - "@rollup/rollup-freebsd-x64": "4.27.4", - "@rollup/rollup-linux-arm-gnueabihf": "4.27.4", - "@rollup/rollup-linux-arm-musleabihf": "4.27.4", - "@rollup/rollup-linux-arm64-gnu": "4.27.4", - "@rollup/rollup-linux-arm64-musl": "4.27.4", - "@rollup/rollup-linux-powerpc64le-gnu": "4.27.4", - "@rollup/rollup-linux-riscv64-gnu": "4.27.4", - "@rollup/rollup-linux-s390x-gnu": "4.27.4", - "@rollup/rollup-linux-x64-gnu": "4.27.4", - "@rollup/rollup-linux-x64-musl": "4.27.4", - "@rollup/rollup-win32-arm64-msvc": "4.27.4", - "@rollup/rollup-win32-ia32-msvc": "4.27.4", - "@rollup/rollup-win32-x64-msvc": "4.27.4", + "@rollup/rollup-android-arm-eabi": "4.29.1", + "@rollup/rollup-android-arm64": "4.29.1", + "@rollup/rollup-darwin-arm64": "4.29.1", + "@rollup/rollup-darwin-x64": "4.29.1", + "@rollup/rollup-freebsd-arm64": "4.29.1", + "@rollup/rollup-freebsd-x64": "4.29.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.29.1", + "@rollup/rollup-linux-arm-musleabihf": "4.29.1", + "@rollup/rollup-linux-arm64-gnu": "4.29.1", + "@rollup/rollup-linux-arm64-musl": "4.29.1", + "@rollup/rollup-linux-loongarch64-gnu": "4.29.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.29.1", + "@rollup/rollup-linux-riscv64-gnu": "4.29.1", + "@rollup/rollup-linux-s390x-gnu": "4.29.1", + "@rollup/rollup-linux-x64-gnu": "4.29.1", + "@rollup/rollup-linux-x64-musl": "4.29.1", + "@rollup/rollup-win32-arm64-msvc": "4.29.1", + "@rollup/rollup-win32-ia32-msvc": "4.29.1", + "@rollup/rollup-win32-x64-msvc": "4.29.1", "fsevents": "~2.3.2" } }, @@ -7358,16 +7470,13 @@ "license": "MIT" }, "node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" } }, "node_modules/set-cookie-parser": { @@ -7396,6 +7505,13 @@ "node": ">=8" } }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, "node_modules/signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", @@ -7408,6 +7524,21 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/sirv": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.0.tgz", + "integrity": "sha512-BPwJGUeDaDCHihkORDchNyyTvWFhcusy1XMmhEVTQTwGeybFbp8YEmB+njbPnth1FibULBSBVwCQni25XlCUDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@polka/url": "^1.0.0-next.24", + "mrmime": "^2.0.0", + "totalist": "^3.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/slice-ansi": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", @@ -7422,33 +7553,20 @@ "node": ">=12" }, "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, - "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", - "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", + "node_modules/slice-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, "license": "MIT", "engines": { "node": ">=12" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/source-map-js": { @@ -7470,6 +7588,20 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.8.0.tgz", + "integrity": "sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==", + "dev": true, + "license": "MIT" + }, "node_modules/string-argv": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", @@ -7481,17 +7613,18 @@ } }, "node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, "license": "MIT", "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -7527,6 +7660,15 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "license": "MIT" }, + "node_modules/string-width-cjs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/string-width-cjs/node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -7647,6 +7789,15 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/sucrase/node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -7673,9 +7824,9 @@ } }, "node_modules/tailwind-merge": { - "version": "2.5.5", - "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.5.5.tgz", - "integrity": "sha512-0LXunzzAZzo0tEPxV3I297ffKZPlKDrjj7NXphC8V5ak9yHC5zRmxnOe2m/Rd/7ivsOMJe3JZ2JVocoDdQTRBA==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.6.0.tgz", + "integrity": "sha512-P+Vu1qXfzediirmHOC3xKGAYeZtPcV9g76X+xg2FD4tYgR71ewMA35Y3sCz3zhiN/dwefRpJX0yBcgwi1fXNQA==", "license": "MIT", "funding": { "type": "github", @@ -7699,9 +7850,9 @@ } }, "node_modules/tailwindcss": { - "version": "3.4.15", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.15.tgz", - "integrity": "sha512-r4MeXnfBmSOuKUWmXe6h2CcyfzJCEk4F0pptO5jlnYSIViUkVmsawj80N5h2lO3gwcmSb4n3PuN+e+GC1Guylw==", + "version": "3.4.17", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.17.tgz", + "integrity": "sha512-w33E2aCvSDP0tW9RZuNXadXlkHXqFzSkQew/aIa2i/Sj8fThxwovwlXHSPXTbAHwEIhBFXAedUhP2tueAKP8Og==", "license": "MIT", "dependencies": { "@alloc/quick-lru": "^5.2.0", @@ -7713,7 +7864,7 @@ "glob-parent": "^6.0.2", "is-glob": "^4.0.3", "jiti": "^1.21.6", - "lilconfig": "^2.1.0", + "lilconfig": "^3.1.3", "micromatch": "^4.0.8", "normalize-path": "^3.0.0", "object-hash": "^3.0.0", @@ -7744,6 +7895,60 @@ "tailwindcss": ">=3.0.0 || insiders" } }, + "node_modules/tailwindcss/node_modules/postcss-selector-parser": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", + "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/test-exclude": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.1.tgz", + "integrity": "sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^10.4.1", + "minimatch": "^9.0.4" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/test-exclude/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", @@ -7771,6 +7976,92 @@ "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", "license": "MIT" }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.10.tgz", + "integrity": "sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.4.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.2.tgz", + "integrity": "sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/tinypool": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.2.tgz", + "integrity": "sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz", + "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz", + "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -7783,6 +8074,16 @@ "node": ">=8.0" } }, + "node_modules/totalist": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", + "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/trim-lines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", @@ -7804,9 +8105,9 @@ } }, "node_modules/ts-api-utils": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.2.tgz", - "integrity": "sha512-ZF5gQIQa/UmzfvxbHZI3JXN0/Jt+vnAfAviNRAMc491laiK6YCLpCW9ft8oaCRFOTxCZtUTE6XB0ZQAe3olntw==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", + "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", "dev": true, "license": "MIT", "engines": { @@ -7851,6 +8152,7 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -7860,15 +8162,15 @@ } }, "node_modules/typescript-eslint": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.16.0.tgz", - "integrity": "sha512-wDkVmlY6O2do4V+lZd0GtRfbtXbeD0q9WygwXXSJnC1xorE8eqyC2L1tJimqpSeFrOzRlYtWnUp/uzgHQOgfBQ==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.19.0.tgz", + "integrity": "sha512-Ni8sUkVWYK4KAcTtPjQ/UTiRk6jcsuDhPpxULapUDi8A/l8TSBk+t1GtJA1RsCzIJg0q6+J7bf35AwQigENWRQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.16.0", - "@typescript-eslint/parser": "8.16.0", - "@typescript-eslint/utils": "8.16.0" + "@typescript-eslint/eslint-plugin": "8.19.0", + "@typescript-eslint/parser": "8.19.0", + "@typescript-eslint/utils": "8.19.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -7878,12 +8180,8 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/undici-types": { @@ -8025,6 +8323,7 @@ "version": "1.3.3", "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.3.tgz", "integrity": "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==", + "license": "MIT", "dependencies": { "tslib": "^2.0.0" }, @@ -8045,6 +8344,7 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.3.tgz", "integrity": "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ==", + "license": "MIT", "dependencies": { "detect-node-es": "^1.1.0", "tslib": "^2.0.0" @@ -8119,13 +8419,13 @@ } }, "node_modules/vite": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.0.1.tgz", - "integrity": "sha512-Ldn6gorLGr4mCdFnmeAOLweJxZ34HjKnDm4HGo6P66IEqTxQb36VEdFJQENKxWjupNfoIjvRUnswjn1hpYEpjQ==", + "version": "6.0.7", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.0.7.tgz", + "integrity": "sha512-RDt8r/7qx9940f8FcOIAH9PTViRrghKaK2K1jY3RaAURrEUbm9Du1mJ72G+jlhtG3WwodnfzY8ORQZbBavZEAQ==", "dev": true, "license": "MIT", "dependencies": { - "esbuild": "^0.24.0", + "esbuild": "^0.24.2", "postcss": "^8.4.49", "rollup": "^4.23.0" }, @@ -8190,6 +8490,122 @@ } } }, + "node_modules/vite-node": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.8.tgz", + "integrity": "sha512-uPAwSr57kYjAUux+8E2j0q0Fxpn8M9VoyfGiRI8Kfktz9NcYMCenwY5RnZxnF1WTu3TGiYipirIzacLL3VVGFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.7", + "es-module-lexer": "^1.5.4", + "pathe": "^1.1.2", + "vite": "^5.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.8.tgz", + "integrity": "sha512-1vBKTZskHw/aosXqQUlVWWlGUxSJR8YtiyZDJAFeW2kPAeX6S3Sool0mjspO+kXLuxVWlEDDowBAeqeAQefqLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "2.1.8", + "@vitest/mocker": "2.1.8", + "@vitest/pretty-format": "^2.1.8", + "@vitest/runner": "2.1.8", + "@vitest/snapshot": "2.1.8", + "@vitest/spy": "2.1.8", + "@vitest/utils": "2.1.8", + "chai": "^5.1.2", + "debug": "^4.3.7", + "expect-type": "^1.1.0", + "magic-string": "^0.30.12", + "pathe": "^1.1.2", + "std-env": "^3.8.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.1", + "tinypool": "^1.0.1", + "tinyrainbow": "^1.2.0", + "vite": "^5.0.0", + "vite-node": "2.1.8", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "2.1.8", + "@vitest/ui": "2.1.8", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/vitest/node_modules/@vitest/mocker": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.8.tgz", + "integrity": "sha512-7guJ/47I6uqfttp33mgo6ga5Gr1VnL58rcqYKyShoRK9ebu8T5Rs6HN3s1NABiBeVTdWNrwUMcHH54uXZBN4zA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.8", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.12" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -8205,6 +8621,23 @@ "node": ">= 8" } }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/word-wrap": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", @@ -8216,17 +8649,18 @@ } }, "node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", + "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", + "dev": true, "license": "MIT", "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" @@ -8265,6 +8699,15 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "license": "MIT" }, + "node_modules/wrap-ansi-cjs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/wrap-ansi-cjs/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -8295,6 +8738,7 @@ "version": "6.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, "license": "MIT", "engines": { "node": ">=12" @@ -8307,10 +8751,18 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", "engines": { "node": ">=0.4" } }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, "node_modules/yaml": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz", @@ -8337,9 +8789,9 @@ } }, "node_modules/zustand": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.0.1.tgz", - "integrity": "sha512-pRET7Lao2z+n5R/HduXMio35TncTlSW68WsYBq2Lg1ASspsNGjpwLAsij3RpouyV6+kHMwwwzP0bZPD70/Jx/w==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.0.2.tgz", + "integrity": "sha512-8qNdnJVJlHlrKXi50LDqqUNmUbuBjoKLrYQBnoChIbVph7vni+sY+YpvdjXG9YLd/Bxr6scMcR+rm5H3aSqPaw==", "license": "MIT", "engines": { "node": ">=12.20.0" diff --git a/package.json b/package.json index 5cf7b85..35a0aee 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,11 @@ "build": "tsc -b && vite build", "lint": "eslint .", "lint:fix": "eslint --fix", + "prepare": "husky", "preview": "vite preview", - "type-check": "tsc --noEmit -p ./tsconfig.app.json", - "prepare": "husky" + "test": "vitest", + "test:coverage": "vitest run --coverage", + "type-check": "tsc --noEmit -p ./tsconfig.app.json" }, "dependencies": { "@radix-ui/react-avatar": "^1.1.1", @@ -47,6 +49,9 @@ "@types/react": "^19.0.2", "@types/react-dom": "^19.0.2", "@vitejs/plugin-react-swc": "^3.5.0", + "@vitest/coverage-istanbul": "^2.1.4", + "@vitest/expect": "^2.1.4", + "@vitest/ui": "^2.1.4", "autoprefixer": "^10.4.20", "eslint": "^9.17.0", "eslint-plugin-react-hooks": "^5.1.0", @@ -58,6 +63,10 @@ "tailwindcss": "^3.4.15", "typescript": "~5.7.2", "typescript-eslint": "^8.15.0", + "vite": "^6.0.1", + "vitest": "^2.1.8" + }, + "overrides": { "vite": "^6.0.1" } } diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 0000000..ce8502f --- /dev/null +++ b/vitest.config.ts @@ -0,0 +1,55 @@ +/// +import { defineConfig } from "vitest/config"; +import react from "@vitejs/plugin-react-swc"; +import path from "path"; + +export default defineConfig({ + plugins: [react()], + resolve: { + alias: { + "@": path.resolve(__dirname, "./src"), + }, + }, + test: { + environment: "node", + // setupFiles: "setupTests.ts", + exclude: [ + "**/node_modules/**", + "**/dist/**", + "**/.{idea,git,cache,output,temp}/**", + "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*", + ], + css: false, + coverage: { + include: ["src/**/*.{js,jsx}", "src/**/*.{ts,tsx}"], + exclude: [ + "coverage/**", + "dist/**", + "**/[.]**", + "**/*.d.ts", + "**/virtual:*", + "**/__x00__*", + "**/\x00*", + "public/**", + "test?(s)/**", + "test?(-*).?(c|m)[jt]s?(x)", + "**/*{.,-}{test,spec}?(-d).?(c|m)[jt]s?(x)", + "**/__tests__/**", + "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*", + "**/vitest.{workspace,projects}.[jt]s?(on)", + "**/.{eslint,mocha,prettier}rc.{?(c|m)js,yml}", + "src/**/*stories.tsx", + "src/types/**/*.{ts,tsx}", + ], + thresholds: { + branches: 42.63, + functions: 51.48, + lines: 56.17, + statements: 55.21, + }, + enabled: false, + provider: "istanbul", + reporter: ["text", "json", "html", "json-summary", "lcov"], + }, + }, +}); From 3679384a626099bed10d1a877d1b0fa53147447d Mon Sep 17 00:00:00 2001 From: Giuseppe Scuglia Date: Fri, 3 Jan 2025 17:44:17 +0100 Subject: [PATCH 02/21] chore: install msw --- package-lock.json | 671 ++++++++++++++++++++++++++++++++++++++ package.json | 1 + src/mocks/msw/handlers.ts | 12 + src/mocks/msw/node.ts | 4 + vitest.config.ts | 2 +- 5 files changed, 689 insertions(+), 1 deletion(-) create mode 100644 src/mocks/msw/handlers.ts create mode 100644 src/mocks/msw/node.ts diff --git a/package-lock.json b/package-lock.json index 3c44729..91fcd51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,6 +52,7 @@ "globals": "^15.12.0", "husky": "^9.1.6", "lint-staged": "^15.3.0", + "msw": "^2.7.0", "postcss": "^8.4.49", "tailwindcss": "^3.4.15", "typescript": "~5.7.2", @@ -338,6 +339,47 @@ "node": ">=6.9.0" } }, + "node_modules/@bundled-es-modules/cookie": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@bundled-es-modules/cookie/-/cookie-2.0.1.tgz", + "integrity": "sha512-8o+5fRPLNbjbdGRRmJj3h6Hh1AQJf2dk3qQ/5ZFb+PXkRNiSoMGGUKlsgLfrxneb72axVJyIYji64E2+nNfYyw==", + "dev": true, + "license": "ISC", + "dependencies": { + "cookie": "^0.7.2" + } + }, + "node_modules/@bundled-es-modules/cookie/node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@bundled-es-modules/statuses": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@bundled-es-modules/statuses/-/statuses-1.0.1.tgz", + "integrity": "sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg==", + "dev": true, + "license": "ISC", + "dependencies": { + "statuses": "^2.0.1" + } + }, + "node_modules/@bundled-es-modules/tough-cookie": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@bundled-es-modules/tough-cookie/-/tough-cookie-0.1.6.tgz", + "integrity": "sha512-dvMHbL464C0zI+Yqxbz6kZ5TOEp7GLW+pry/RWndAR8MJQAXZ2rPmIs8tziTZjeIyhSNZgZbCePtfSbdWqStJw==", + "dev": true, + "license": "ISC", + "dependencies": { + "@types/tough-cookie": "^4.0.5", + "tough-cookie": "^4.1.4" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.24.2", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.2.tgz", @@ -1007,6 +1049,166 @@ "url": "https://github.com/sponsors/nzakas" } }, + "node_modules/@inquirer/confirm": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.1.1.tgz", + "integrity": "sha512-vVLSbGci+IKQvDOtzpPTCOiEJCNidHcAq9JYVoWTW0svb5FiwSLotkM+JXNXejfjnzVYV9n0DTBythl9+XgTxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/core": "^10.1.2", + "@inquirer/type": "^3.0.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/core": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.2.tgz", + "integrity": "sha512-bHd96F3ezHg1mf/J0Rb4CV8ndCN0v28kUlrHqP7+ECm1C/A+paB7Xh2lbMk6x+kweQC+rZOxM/YeKikzxco8bQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/figures": "^1.0.9", + "@inquirer/type": "^3.0.2", + "ansi-escapes": "^4.3.2", + "cli-width": "^4.1.0", + "mute-stream": "^2.0.0", + "signal-exit": "^4.1.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^6.2.0", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/core/node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@inquirer/core/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@inquirer/core/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/@inquirer/core/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@inquirer/core/node_modules/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==", + "dev": 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/@inquirer/core/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@inquirer/core/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@inquirer/core/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@inquirer/figures": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.9.tgz", + "integrity": "sha512-BXvGj0ehzrngHTPTDqUoDT3NXL8U0RxUk2zJm2A66RhCEIWdtU1v6GuUqNAgArW4PQ9CinqIWyHdQgdwOj06zQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/type": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.2.tgz", + "integrity": "sha512-ZhQ4TvhwHZF+lGhQ2O/rsjo80XoZR5/5qhOY3t6FJuX5XBg5Be8YzYTvaUGJnc12AUGI2nr4QSUE4PhKSigx7g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -1134,6 +1336,24 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@mswjs/interceptors": { + "version": "0.37.4", + "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.37.4.tgz", + "integrity": "sha512-YUenGsnvhhuBkabJZrga8dv/8QFRBe/isTb5CYvmzaI/IISLIkKp8kItSu9URY9tsJLvkPkq2W48OU/piDvfnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@open-draft/deferred-promise": "^2.2.0", + "@open-draft/logger": "^0.3.0", + "@open-draft/until": "^2.0.0", + "is-node-process": "^1.2.0", + "outvariant": "^1.4.3", + "strict-event-emitter": "^0.5.1" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -1169,6 +1389,31 @@ "node": ">= 8" } }, + "node_modules/@open-draft/deferred-promise": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@open-draft/deferred-promise/-/deferred-promise-2.2.0.tgz", + "integrity": "sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@open-draft/logger": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@open-draft/logger/-/logger-0.3.0.tgz", + "integrity": "sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-node-process": "^1.2.0", + "outvariant": "^1.4.0" + } + }, + "node_modules/@open-draft/until": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@open-draft/until/-/until-2.1.0.tgz", + "integrity": "sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==", + "dev": true, + "license": "MIT" + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -2563,6 +2808,20 @@ "@types/react": "*" } }, + "node_modules/@types/statuses": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@types/statuses/-/statuses-2.0.5.tgz", + "integrity": "sha512-jmIUGWrAiwu3dZpxntxieC+1n/5c3mjrImkmOSQ2NC5uP6cYO4aAZDdSmRcI5C1oiTmqlZGHC+/NmJrKogbP5A==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/tough-cookie": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", + "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/unist": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", @@ -3424,6 +3683,104 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cli-width": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", + "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 12" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/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==", + "dev": 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/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/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==", + "dev": 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/clsx": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", @@ -4333,6 +4690,16 @@ "node": ">=6.9.0" } }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, "node_modules/get-east-asian-width": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.3.0.tgz", @@ -4444,6 +4811,16 @@ "dev": true, "license": "MIT" }, + "node_modules/graphql": { + "version": "16.10.0", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.10.0.tgz", + "integrity": "sha512-AjqGKbDGUFRKIRCP9tCKiIGHyriz2oHEbPIbEtcSLSs4YjReZOIPQQWek4+6hjw62H9QShXHyaGivGiYVLeYFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -4581,6 +4958,13 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/headers-polyfill": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-4.0.3.tgz", + "integrity": "sha512-IScLbePpkvO846sIwOtOTDjutRMWdXdJmXdMvk6gCBHxFO8d+QKOQedyZSxFTTFYRSmlgSTDtXqqq4pcenBXLQ==", + "dev": true, + "license": "MIT" + }, "node_modules/highlight.js": { "version": "11.11.1", "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.11.1.tgz", @@ -4796,6 +5180,13 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/is-node-process": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-node-process/-/is-node-process-1.2.0.tgz", + "integrity": "sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw==", + "dev": true, + "license": "MIT" + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -6290,6 +6681,61 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, + "node_modules/msw": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/msw/-/msw-2.7.0.tgz", + "integrity": "sha512-BIodwZ19RWfCbYTxWTUfTXc+sg4OwjCAgxU1ZsgmggX/7S3LdUifsbUPJs61j0rWb19CZRGY5if77duhc0uXzw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@bundled-es-modules/cookie": "^2.0.1", + "@bundled-es-modules/statuses": "^1.0.1", + "@bundled-es-modules/tough-cookie": "^0.1.6", + "@inquirer/confirm": "^5.0.0", + "@mswjs/interceptors": "^0.37.0", + "@open-draft/deferred-promise": "^2.2.0", + "@open-draft/until": "^2.1.0", + "@types/cookie": "^0.6.0", + "@types/statuses": "^2.0.4", + "graphql": "^16.8.1", + "headers-polyfill": "^4.0.2", + "is-node-process": "^1.2.0", + "outvariant": "^1.4.3", + "path-to-regexp": "^6.3.0", + "picocolors": "^1.1.1", + "strict-event-emitter": "^0.5.1", + "type-fest": "^4.26.1", + "yargs": "^17.7.2" + }, + "bin": { + "msw": "cli/index.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/mswjs" + }, + "peerDependencies": { + "typescript": ">= 4.8.x" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/mute-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-2.0.0.tgz", + "integrity": "sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, "node_modules/mz": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", @@ -6433,6 +6879,13 @@ "node": ">= 0.8.0" } }, + "node_modules/outvariant": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/outvariant/-/outvariant-1.4.3.tgz", + "integrity": "sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==", + "dev": true, + "license": "MIT" + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -6556,6 +7009,13 @@ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", "license": "ISC" }, + "node_modules/path-to-regexp": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", + "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==", + "dev": true, + "license": "MIT" + }, "node_modules/pathe": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", @@ -6825,6 +7285,19 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/psl": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.15.0.tgz", + "integrity": "sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^2.3.1" + }, + "funding": { + "url": "https://github.com/sponsors/lupomontero" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -6835,6 +7308,13 @@ "node": ">=6" } }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true, + "license": "MIT" + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -7321,6 +7801,23 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true, + "license": "MIT" + }, "node_modules/resolve": { "version": "1.22.10", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", @@ -7595,6 +8092,16 @@ "dev": true, "license": "MIT" }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/std-env": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.8.0.tgz", @@ -7602,6 +8109,13 @@ "dev": true, "license": "MIT" }, + "node_modules/strict-event-emitter": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/strict-event-emitter/-/strict-event-emitter-0.5.1.tgz", + "integrity": "sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==", + "dev": true, + "license": "MIT" + }, "node_modules/string-argv": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", @@ -8084,6 +8598,22 @@ "node": ">=6" } }, + "node_modules/tough-cookie": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", + "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/trim-lines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", @@ -8147,6 +8677,19 @@ "node": ">= 0.8.0" } }, + "node_modules/type-fest": { + "version": "4.31.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.31.0.tgz", + "integrity": "sha512-yCxltHW07Nkhv/1F6wWBr8kz+5BGMfP+RbRSYFnegVb0qV/UMT0G0ElBloPVerqn4M2ZV80Ir1FtCcYv1cT6vQ==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/typescript": { "version": "5.7.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", @@ -8278,6 +8821,16 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/update-browserslist-db": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", @@ -8319,6 +8872,17 @@ "punycode": "^2.1.0" } }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "node_modules/use-callback-ref": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.3.tgz", @@ -8756,6 +9320,16 @@ "node": ">=0.4" } }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, "node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", @@ -8775,6 +9349,90 @@ "node": ">= 14" } }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/yargs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/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==", + "dev": 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/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", @@ -8788,6 +9446,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/yoctocolors-cjs": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.2.tgz", + "integrity": "sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/zustand": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.0.2.tgz", diff --git a/package.json b/package.json index 35a0aee..85722ae 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "globals": "^15.12.0", "husky": "^9.1.6", "lint-staged": "^15.3.0", + "msw": "^2.7.0", "postcss": "^8.4.49", "tailwindcss": "^3.4.15", "typescript": "~5.7.2", diff --git a/src/mocks/msw/handlers.ts b/src/mocks/msw/handlers.ts new file mode 100644 index 0000000..7711de4 --- /dev/null +++ b/src/mocks/msw/handlers.ts @@ -0,0 +1,12 @@ +import { http, HttpResponse } from "msw"; + +export const handlers = [ + http.get("https://example.com/user", () => { + // ...and respond to them using this JSON response. + return HttpResponse.json({ + id: "c7b3d8e0-5e0b-4b0f-8b3a-3b9f4b3d3b3d", + firstName: "John", + lastName: "Maverick", + }); + }), +]; diff --git a/src/mocks/msw/node.ts b/src/mocks/msw/node.ts new file mode 100644 index 0000000..7b37f2a --- /dev/null +++ b/src/mocks/msw/node.ts @@ -0,0 +1,4 @@ +import { setupServer } from "msw/node"; +import { handlers } from "./handlers"; + +export const server = setupServer(...handlers); diff --git a/vitest.config.ts b/vitest.config.ts index ce8502f..5558c94 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -12,7 +12,7 @@ export default defineConfig({ }, test: { environment: "node", - // setupFiles: "setupTests.ts", + setupFiles: "setupTests.ts", exclude: [ "**/node_modules/**", "**/dist/**", From 35b92116aba9ca4016ae6ebfda0121e265a87a06 Mon Sep 17 00:00:00 2001 From: Giuseppe Scuglia Date: Fri, 3 Jan 2025 18:53:32 +0100 Subject: [PATCH 03/21] chore: install testing-library, jsdom --- package-lock.json | 667 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 3 + 2 files changed, 670 insertions(+) diff --git a/package-lock.json b/package-lock.json index 91fcd51..3307ecf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,6 +38,8 @@ "devDependencies": { "@eslint/js": "^9.15.0", "@tailwindcss/typography": "^0.5.15", + "@testing-library/jest-dom": "^6.6.3", + "@testing-library/react": "^16.1.0", "@types/node": "^22.10.1", "@types/react": "^19.0.2", "@types/react-dom": "^19.0.2", @@ -51,6 +53,7 @@ "eslint-plugin-react-refresh": "^0.4.16", "globals": "^15.12.0", "husky": "^9.1.6", + "jsdom": "^25.0.1", "lint-staged": "^15.3.0", "msw": "^2.7.0", "postcss": "^8.4.49", @@ -61,6 +64,13 @@ "vitest": "^2.1.8" } }, + "node_modules/@adobe/css-tools": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.4.1.tgz", + "integrity": "sha512-12WGKBQzjUAI4ayyF4IAtfw2QR/IDoqk6jTddXDhtYTJF9ASmoE1zst7cVtP0aL/F1jUJL5r+JxKXKEgHNbEUQ==", + "dev": true, + "license": "MIT" + }, "node_modules/@alloc/quick-lru": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", @@ -2641,6 +2651,105 @@ "tailwindcss": ">=3.0.0 || insiders || >=4.0.0-alpha.20" } }, + "node_modules/@testing-library/dom": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.0.tgz", + "integrity": "sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/runtime": "^7.12.5", + "@types/aria-query": "^5.0.1", + "aria-query": "5.3.0", + "chalk": "^4.1.0", + "dom-accessibility-api": "^0.5.9", + "lz-string": "^1.5.0", + "pretty-format": "^27.0.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@testing-library/jest-dom": { + "version": "6.6.3", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.6.3.tgz", + "integrity": "sha512-IteBhl4XqYNkM54f4ejhLRJiZNqcSCoXUOG2CPK7qbD322KjQozM4kHQOfkG2oln9b9HTYqs+Sae8vBATubxxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@adobe/css-tools": "^4.4.0", + "aria-query": "^5.0.0", + "chalk": "^3.0.0", + "css.escape": "^1.5.1", + "dom-accessibility-api": "^0.6.3", + "lodash": "^4.17.21", + "redent": "^3.0.0" + }, + "engines": { + "node": ">=14", + "npm": ">=6", + "yarn": ">=1" + } + }, + "node_modules/@testing-library/jest-dom/node_modules/chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz", + "integrity": "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@testing-library/react": { + "version": "16.1.0", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-16.1.0.tgz", + "integrity": "sha512-Q2ToPvg0KsVL0ohND9A3zLJWcOXXcO8IDu3fj11KhNt0UlCWyFyvnCIBkd12tidB2lkiVRG8VFqdhcqhqnAQtg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.12.5" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@testing-library/dom": "^10.0.0", + "@types/react": "^18.0.0 || ^19.0.0", + "@types/react-dom": "^18.0.0 || ^19.0.0", + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@types/aria-query": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", + "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/@types/cookie": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", @@ -3222,6 +3331,16 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/agent-base": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -3326,6 +3445,16 @@ "node": ">=10" } }, + "node_modules/aria-query": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "dequal": "^2.0.3" + } + }, "node_modules/assertion-error": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", @@ -3336,6 +3465,13 @@ "node": ">=12" } }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true, + "license": "MIT" + }, "node_modules/autoprefixer": { "version": "10.4.20", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.20.tgz", @@ -3815,6 +3951,19 @@ "dev": true, "license": "MIT" }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/comma-separated-tokens": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", @@ -3871,6 +4020,13 @@ "node": ">= 8" } }, + "node_modules/css.escape": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz", + "integrity": "sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==", + "dev": true, + "license": "MIT" + }, "node_modules/cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", @@ -3883,6 +4039,19 @@ "node": ">=4" } }, + "node_modules/cssstyle": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.1.0.tgz", + "integrity": "sha512-h66W1URKpBS5YMI/V8PyXvTMFT8SupJ1IzoIV8IeBC/ji8WVmrO8dGlTi+2dh6whmdk6BiKJLD/ZBkhWbcg6nA==", + "dev": true, + "license": "MIT", + "dependencies": { + "rrweb-cssom": "^0.7.1" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/csstype": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", @@ -4010,6 +4179,20 @@ "node": ">=12" } }, + "node_modules/data-urls": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/date-fns": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-4.1.0.tgz", @@ -4037,6 +4220,13 @@ } } }, + "node_modules/decimal.js": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", + "dev": true, + "license": "MIT" + }, "node_modules/decimal.js-light": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/decimal.js-light/-/decimal.js-light-2.5.1.tgz", @@ -4073,6 +4263,16 @@ "dev": true, "license": "MIT" }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/dequal": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", @@ -4113,6 +4313,14 @@ "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", "license": "MIT" }, + "node_modules/dom-accessibility-api": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", + "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/dom-helpers": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", @@ -4143,6 +4351,19 @@ "dev": true, "license": "MIT" }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/environment": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", @@ -4635,6 +4856,21 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/form-data": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/format": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz", @@ -4980,6 +5216,19 @@ "integrity": "sha512-PDEfEF102G23vHmPhLyPboFCD+BkMGu+GuJe2d9/eH4FsCwvgBpnc9n0pGE+ffKdph38s6foEZiEjdgHdzp+IA==", "license": "CC0-1.0" }, + "node_modules/html-encoding-sniffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-encoding": "^3.1.1" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", @@ -4997,6 +5246,34 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/human-signals": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", @@ -5023,6 +5300,19 @@ "url": "https://github.com/sponsors/typicode" } }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -5060,6 +5350,16 @@ "node": ">=0.8.19" } }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/inline-style-parser": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.4.tgz", @@ -5208,6 +5508,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true, + "license": "MIT" + }, "node_modules/is-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", @@ -5354,6 +5661,60 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsdom": { + "version": "25.0.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-25.0.1.tgz", + "integrity": "sha512-8i7LzZj7BF8uplX+ZyOlIz86V6TAsSs+np6m1kpW9u0JWi4z/1t+FzcK1aek+ybTnAC4KhBL4uXCNT0wcUIeCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssstyle": "^4.1.0", + "data-urls": "^5.0.0", + "decimal.js": "^10.4.3", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.5", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.12", + "parse5": "^7.1.2", + "rrweb-cssom": "^0.7.1", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^5.0.0", + "w3c-xmlserializer": "^5.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0", + "ws": "^8.18.0", + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "canvas": "^2.11.2" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jsdom/node_modules/tough-cookie": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.0.0.tgz", + "integrity": "sha512-FRKsF7cz96xIIeMZ82ehjC3xW2E+O2+v11udrDYewUbszngYhsGa8z6YUMMzO9QJZzzyd0nGGXnML/TReX6W8Q==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tldts": "^6.1.32" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/jsesc": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", @@ -5682,6 +6043,17 @@ "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc" } }, + "node_modules/lz-string": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", + "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "lz-string": "bin/bin.js" + } + }, "node_modules/magic-string": { "version": "0.30.17", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", @@ -6617,6 +6989,29 @@ "node": ">=8.6" } }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/mimic-fn": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", @@ -6643,6 +7038,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -6827,6 +7232,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/nwsapi": { + "version": "2.2.16", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.16.tgz", + "integrity": "sha512-F1I/bimDpj3ncaNDhfyMWuFqmQDBwDB0Fogc2qpL3BWvkQteFD/8BzWuIRl83rq0DXfm8SGt/HFhLXZyljTXcQ==", + "dev": true, + "license": "MIT" + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -6962,6 +7374,19 @@ "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", "license": "MIT" }, + "node_modules/parse5": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz", + "integrity": "sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "entities": "^4.5.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -7249,6 +7674,55 @@ "node": ">= 0.8.0" } }, + "node_modules/pretty-format": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/pretty-format/node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/prismjs": { "version": "1.29.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", @@ -7613,6 +8087,20 @@ "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", "license": "MIT" }, + "node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/refractor": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/refractor/-/refractor-3.6.0.tgz", @@ -7937,6 +8425,13 @@ "fsevents": "~2.3.2" } }, + "node_modules/rrweb-cssom": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.7.1.tgz", + "integrity": "sha512-TrEMa7JGdVm0UThDJSx7ddw5nVm3UJS9o9CCIZ72B1vSyEZoziDqBYP3XIoi/12lKrJR8rE3jeFHMok2F/Mnsg==", + "dev": true, + "license": "MIT" + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -7960,6 +8455,26 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT" + }, + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "dev": true, + "license": "ISC", + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } + }, "node_modules/scheduler": { "version": "0.25.0", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.25.0.tgz", @@ -8259,6 +8774,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -8337,6 +8865,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true, + "license": "MIT" + }, "node_modules/tailwind-merge": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.6.0.tgz", @@ -8576,6 +9111,26 @@ "node": ">=14.0.0" } }, + "node_modules/tldts": { + "version": "6.1.70", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.70.tgz", + "integrity": "sha512-/W1YVgYVJd9ZDjey5NXadNh0mJXkiUMUue9Zebd0vpdo1sU+H4zFFTaJ1RKD4N6KFoHfcXy6l+Vu7bh+bdWCzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tldts-core": "^6.1.70" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "6.1.70", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.70.tgz", + "integrity": "sha512-RNnIXDB1FD4T9cpQRErEqw6ZpjLlGdMOitdV+0xtbsnwr4YFka1zpc7D4KD+aAn8oSG5JyFrdasZTE04qDE9Yg==", + "dev": true, + "license": "MIT" + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -8614,6 +9169,19 @@ "node": ">=6" } }, + "node_modules/tr46": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz", + "integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^2.3.1" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/trim-lines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", @@ -9170,6 +9738,66 @@ } } }, + "node_modules/w3c-xmlserializer": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-url": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.1.0.tgz", + "integrity": "sha512-jlf/foYIKywAt3x/XWKZ/3rz8OSJPiWktjmk891alJUEjiVxKX9LEO92qH3hv4aJ0mN3MWPvGMCy8jQi95xK4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "tr46": "^5.0.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -9311,6 +9939,45 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/ws": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xml-name-validator": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true, + "license": "MIT" + }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", diff --git a/package.json b/package.json index 85722ae..21131d1 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,8 @@ "devDependencies": { "@eslint/js": "^9.15.0", "@tailwindcss/typography": "^0.5.15", + "@testing-library/jest-dom": "^6.6.3", + "@testing-library/react": "^16.1.0", "@types/node": "^22.10.1", "@types/react": "^19.0.2", "@types/react-dom": "^19.0.2", @@ -58,6 +60,7 @@ "eslint-plugin-react-refresh": "^0.4.16", "globals": "^15.12.0", "husky": "^9.1.6", + "jsdom": "^25.0.1", "lint-staged": "^15.3.0", "msw": "^2.7.0", "postcss": "^8.4.49", From 092b6531f27b539704e4fbc7bdcb42fc72937a47 Mon Sep 17 00:00:00 2001 From: Giuseppe Scuglia Date: Fri, 3 Jan 2025 18:54:00 +0100 Subject: [PATCH 04/21] chore: configure vitest --- tsconfig.app.json | 9 +++------ vitest.config.ts | 13 +++++++------ vitest.setup.ts | 22 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 vitest.setup.ts diff --git a/tsconfig.app.json b/tsconfig.app.json index 231a4ec..2a4a797 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -5,8 +5,6 @@ "lib": ["ES2020", "DOM", "DOM.Iterable"], "module": "ESNext", "skipLibCheck": true, - - /* Bundler mode */ "moduleResolution": "bundler", "allowImportingTsExtensions": true, "isolatedModules": true, @@ -14,8 +12,6 @@ "noEmit": true, "jsx": "react-jsx", "incremental": true, - - /* Linting */ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, @@ -23,8 +19,9 @@ "baseUrl": ".", "paths": { "@/*": ["./src/*"] - } + }, + "types": ["vitest/globals", "@testing-library/jest-dom/vitest"], }, "include": ["src/**/*.ts", "src/**/*.tsx"], "exclude": ["node_modules"] -} +} \ No newline at end of file diff --git a/vitest.config.ts b/vitest.config.ts index 5558c94..901e9b8 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -11,8 +11,9 @@ export default defineConfig({ }, }, test: { - environment: "node", - setupFiles: "setupTests.ts", + globals: true, + environment: "jsdom", + setupFiles: "./vitest.setup.ts", exclude: [ "**/node_modules/**", "**/dist/**", @@ -42,10 +43,10 @@ export default defineConfig({ "src/types/**/*.{ts,tsx}", ], thresholds: { - branches: 42.63, - functions: 51.48, - lines: 56.17, - statements: 55.21, + branches: 60, + functions: 60, + lines: 60, + statements: 60, }, enabled: false, provider: "istanbul", diff --git a/vitest.setup.ts b/vitest.setup.ts new file mode 100644 index 0000000..55f06a7 --- /dev/null +++ b/vitest.setup.ts @@ -0,0 +1,22 @@ +import { server } from "./src/mocks/msw/node"; +import * as testingLibraryMatchers from "@testing-library/jest-dom/matchers"; +import "@testing-library/jest-dom/vitest"; +import { cleanup } from "@testing-library/react"; +import { afterEach, expect, beforeAll, afterAll, vi } from "vitest"; + +expect.extend(testingLibraryMatchers); + +afterEach(() => { + cleanup(); +}); + +beforeAll(() => { + server.listen({ + onUnhandledRequest: "error", + }); +}); +afterEach(() => { + server.resetHandlers(); + vi.clearAllMocks(); +}); +afterAll(() => server.close()); From 6842702527c9821cf4f2eb7278de3541a4b70072 Mon Sep 17 00:00:00 2001 From: Giuseppe Scuglia Date: Fri, 3 Jan 2025 18:54:26 +0100 Subject: [PATCH 05/21] test: add PromptList --- src/components/__tests__/PromptList.test.tsx | 50 +++ src/mocks/msw/fixtures/GetAlerts.json | 30 ++ src/mocks/msw/fixtures/GetMessages.json | 306 +++++++++++++++++++ src/mocks/msw/handlers.ts | 14 +- 4 files changed, 393 insertions(+), 7 deletions(-) create mode 100644 src/components/__tests__/PromptList.test.tsx create mode 100644 src/mocks/msw/fixtures/GetAlerts.json create mode 100644 src/mocks/msw/fixtures/GetMessages.json diff --git a/src/components/__tests__/PromptList.test.tsx b/src/components/__tests__/PromptList.test.tsx new file mode 100644 index 0000000..a4cafcc --- /dev/null +++ b/src/components/__tests__/PromptList.test.tsx @@ -0,0 +1,50 @@ +import { describe, expect, it } from "vitest"; +import { render, screen } from "@testing-library/react"; +import { PromptList } from "../PromptList"; +import mockedPrompts from "@/mocks/msw/fixtures/GetMessages.json"; +import { MemoryRouter } from "react-router-dom"; + +describe("PromptList", () => { + it("should render correct prompt", () => { + render( + + + , + ); + expect( + screen.getByRole("link", { + name: /server\.py do you see any security issue\?/i, + }), + ).toBeVisible(); + }); + + it("should render default prompt value when missing question", async () => { + const conversationTimestamp = "2025-01-02T14:19:58.024100Z"; + render( + + + , + ); + + expect( + screen.getByRole("link", { + name: `Prompt ${conversationTimestamp}`, + }), + ).toBeVisible(); + }); +}); diff --git a/src/mocks/msw/fixtures/GetAlerts.json b/src/mocks/msw/fixtures/GetAlerts.json new file mode 100644 index 0000000..7c4024b --- /dev/null +++ b/src/mocks/msw/fixtures/GetAlerts.json @@ -0,0 +1,30 @@ +[ + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "```/Users/giuseppe/workspace/codegate/src/codegate/server.py\nimport traceback\n\nimport structlog\nfrom fastapi import APIRouter, FastAPI\nfrom fastapi.middleware.cors import CORSMiddleware\nfrom fastapi.responses import JSONResponse\nfrom starlette.middleware.errors import ServerErrorMiddleware\n\nfrom codegate import __description__, __version__\nfrom codegate.dashboard.dashboard import dashboard_router\nfrom codegate.pipeline.factory import PipelineFactory\nfrom codegate.providers.anthropic.provider import AnthropicProvider\nfrom codegate.providers.llamacpp.provider import LlamaCppProvider\nfrom codegate.providers.ollama.provider import OllamaProvider\nfrom codegate.providers.openai.provider import OpenAIProvider\nfrom codegate.providers.registry import ProviderRegistry\nfrom codegate.providers.vllm.provider import VLLMProvider\n\nlogger = structlog.get_logger(\"codegate\")\n\n\nasync def custom_error_handler(request, exc: Exception):\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\n # Capture the stack trace\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\n logger.error(traceback.print_list(extracted_traceback[-3:]))\n return JSONResponse({\"error\": str(exc)}, status_code=500)\n\n\ndef init_app(pipeline_factory: PipelineFactory) -> FastAPI:\n \"\"\"Create the FastAPI application.\"\"\"\n app = FastAPI(\n title=\"CodeGate\",\n description=__description__,\n version=__version__,\n )\n app.add_middleware(\n CORSMiddleware,\n allow_origins=[\"*\"],\n allow_credentials=True,\n allow_methods=[\"*\"],\n allow_headers=[\"*\"],\n )\n # Apply error handling middleware\n app.add_middleware(ServerErrorMiddleware, handler=custom_error_handler)\n\n # Create provider registry\n registry = ProviderRegistry(app)\n\n # Register all known providers\n registry.add_provider(\n \"openai\",\n OpenAIProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"anthropic\",\n AnthropicProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"llamacpp\",\n LlamaCppProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"vllm\",\n VLLMProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"ollama\",\n OllamaProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n\n # Create and add system routes\n system_router = APIRouter(tags=[\"System\"])\n\n @system_router.get(\"/health\")\n async def health_check():\n return {\"status\": \"healthy\"}\n\n app.include_router(system_router)\n app.include_router(dashboard_router)\n\n return app\n\n```\n\nserver.py do you see any security issue?", + "timestamp": "2025-01-03T09:10:00.689177Z", + "message_id": "0445530c-9288-4591-b48a-4fdc2f0aec6c" + }, + "answer": { + "message": "Yes, there are several security issues in the provided `server.py` code. Here are the main ones:\n\n1. **CORS Configuration**:\n ```python\n app.add_middleware(\n CORSMiddleware,\n allow_origins=[\"*\"],\n allow_credentials=True,\n allow_methods=[\"*\"],\n allow_headers=[\"*\"],\n )\n ```\n - Allowing all origins (`allow_origins=[\"*\"]`) and methods (`allow_methods=[\"*\"]`) can expose your server to Cross-Site Request Forgery (CSRF) attacks and other security vulnerabilities. It's recommended to restrict these settings to only the origins and methods that your application needs to support.\n\n2. **Error Handling Middleware**:\n ```python\n async def custom_error_handler(request, exc: Exception):\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\n # Capture the stack trace\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\n logger.error(traceback.print_list(extracted_traceback[-3:]))\n return JSONResponse({\"error\": str(exc)}, status_code=500)\n ```\n - Exposing detailed error messages in the response can be dangerous, as it can provide attackers with information that can be used to exploit vulnerabilities. It's better to log the error details and return a generic error message to the client.\n\n3. **Handling Exceptions**:\n - The `custom_error_handler` function logs the traceback and returns the exception message directly to the client. This can expose sensitive information about the server's internal state. It's better to log the error and return a generic message.\n\n4. **Provider Configuration**:\n - The providers are configured with the same pipeline processors. This might not be a security issue in itself, but it's important to ensure that the pipeline processors are secure and correctly configured.\n\n5. **Logging**:\n - The `logger.error` function is used to log the error traceback. Ensure that the logging configuration is set up correctly to prevent logging sensitive information to insecure destinations.\n\nHere is a revised version of the code with some of these issues addressed:\n\n```python\nimport traceback\n\nimport structlog\nfrom fastapi import APIRouter, FastAPI\nfrom fastapi.middleware.cors import CORSMiddleware\nfrom fastapi.responses import JSONResponse\nfrom starlette.middleware.errors import ServerErrorMiddleware\n\nfrom codegate import __description__, __version__\nfrom codegate.dashboard.dashboard import dashboard_router\nfrom codegate.pipeline.factory import PipelineFactory\nfrom codegate.providers.anthropic.provider import AnthropicProvider\nfrom codegate.providers.llamacpp.provider import LlamaCppProvider\nfrom codegate.providers.ollama.provider import OllamaProvider\nfrom codegate.providers.openai.provider import OpenAIProvider\nfrom codegate.providers.registry import ProviderRegistry\nfrom codegate.providers.vllm.provider import VLLMProvider\n\nlogger = structlog.get_logger(\"codegate\")\n\n\nasync def custom_error_handler(request, exc: Exception):\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\n # Capture the stack trace\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\n logger.error(traceback.print_list(extracted_traceback[-3:]))\n return JSONResponse({\"error\": \"An internal server error occurred\"}, status_code=500)\n\n\ndef init_app(pipeline_factory: PipelineFactory) -> FastAPI:\n \"\"\"Create the FastAPI application.\"\"\"\n app = FastAPI(\n title=\"CodeGate\",\n description=__description__,\n version=__version__,\n )\n app.add_middleware(\n CORSMiddleware,\n allow_origins=[\"https://example.com\"], # Restrict to specific origins\n allow_credentials=True,\n allow_methods=[\"GET\", \"POST\"], # Restrict to specific methods\n allow_headers=[\"*\"],\n )\n # Apply error handling middleware\n app.add_middleware(ServerErrorMiddleware, handler=custom_error_handler)\n\n # Create provider registry\n registry = ProviderRegistry(app)\n\n # Register all known providers\n registry.add_provider(\n \"openai\",\n OpenAIProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"anthropic\",\n AnthropicProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"llamacpp\",\n LlamaCppProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"vllm\",\n VLLMProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"ollama\",\n OllamaProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n\n # Create and add system routes\n system_router = APIRouter(tags=[\"System\"])\n\n @system_router.get(\"/health\")\n async def health_check():\n return {\"status\": \"healthy\"}\n\n app.include_router(system_router)\n app.include_router(dashboard_router)\n\n return app\n```\n\nIn this revised version, the CORS middleware is restricted to specific origins and methods, and the error handler returns a generic error message to the client.", + "timestamp": "2025-01-03T09:09:34.359269Z", + "message_id": "68e7c9bc-9afa-4240-8eba-621eaae4a2a0" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-eebad2bd68434c7c947d10754a204ea4", + "conversation_timestamp": "2025-01-03T09:10:00.689177Z" + }, + "alert_id": "0445530c-9288-4591-b48a-4fdc2f0aec6c", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-03T09:10:00.689177Z" + } +] \ No newline at end of file diff --git a/src/mocks/msw/fixtures/GetMessages.json b/src/mocks/msw/fixtures/GetMessages.json new file mode 100644 index 0000000..8e8b115 --- /dev/null +++ b/src/mocks/msw/fixtures/GetMessages.json @@ -0,0 +1,306 @@ +[ + { + "question_answers": [ + { + "question": { + "message": "```/Users/giuseppe/workspace/codegate/src/codegate/server.py\nimport traceback\n\nimport structlog\nfrom fastapi import APIRouter, FastAPI\nfrom fastapi.middleware.cors import CORSMiddleware\nfrom fastapi.responses import JSONResponse\nfrom starlette.middleware.errors import ServerErrorMiddleware\n\nfrom codegate import __description__, __version__\nfrom codegate.dashboard.dashboard import dashboard_router\nfrom codegate.pipeline.factory import PipelineFactory\nfrom codegate.providers.anthropic.provider import AnthropicProvider\nfrom codegate.providers.llamacpp.provider import LlamaCppProvider\nfrom codegate.providers.ollama.provider import OllamaProvider\nfrom codegate.providers.openai.provider import OpenAIProvider\nfrom codegate.providers.registry import ProviderRegistry\nfrom codegate.providers.vllm.provider import VLLMProvider\n\nlogger = structlog.get_logger(\"codegate\")\n\n\nasync def custom_error_handler(request, exc: Exception):\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\n # Capture the stack trace\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\n logger.error(traceback.print_list(extracted_traceback[-3:]))\n return JSONResponse({\"error\": str(exc)}, status_code=500)\n\n\ndef init_app(pipeline_factory: PipelineFactory) -> FastAPI:\n \"\"\"Create the FastAPI application.\"\"\"\n app = FastAPI(\n title=\"CodeGate\",\n description=__description__,\n version=__version__,\n )\n app.add_middleware(\n CORSMiddleware,\n allow_origins=[\"*\"],\n allow_credentials=True,\n allow_methods=[\"*\"],\n allow_headers=[\"*\"],\n )\n # Apply error handling middleware\n app.add_middleware(ServerErrorMiddleware, handler=custom_error_handler)\n\n # Create provider registry\n registry = ProviderRegistry(app)\n\n # Register all known providers\n registry.add_provider(\n \"openai\",\n OpenAIProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"anthropic\",\n AnthropicProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"llamacpp\",\n LlamaCppProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"vllm\",\n VLLMProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"ollama\",\n OllamaProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n\n # Create and add system routes\n system_router = APIRouter(tags=[\"System\"])\n\n @system_router.get(\"/health\")\n async def health_check():\n return {\"status\": \"healthy\"}\n\n app.include_router(system_router)\n app.include_router(dashboard_router)\n\n return app\n\n```\n\nserver.py do you see any security issue?", + "timestamp": "2025-01-03T09:09:33.743797Z", + "message_id": "a1549789-b610-4999-9907-f8f010c2f3b7" + }, + "answer": { + "message": "Yes, there are several security issues in the provided `server.py` code. Here are the main ones:\n\n1. **CORS Configuration**:\n ```python\n app.add_middleware(\n CORSMiddleware,\n allow_origins=[\"*\"],\n allow_credentials=True,\n allow_methods=[\"*\"],\n allow_headers=[\"*\"],\n )\n ```\n - Allowing all origins (`allow_origins=[\"*\"]`) and methods (`allow_methods=[\"*\"]`) can expose your server to Cross-Site Request Forgery (CSRF) attacks and other security vulnerabilities. It's recommended to restrict these settings to only the origins and methods that your application needs to support.\n\n2. **Error Handling Middleware**:\n ```python\n async def custom_error_handler(request, exc: Exception):\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\n # Capture the stack trace\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\n logger.error(traceback.print_list(extracted_traceback[-3:]))\n return JSONResponse({\"error\": str(exc)}, status_code=500)\n ```\n - Exposing detailed error messages in the response can be dangerous, as it can provide attackers with information that can be used to exploit vulnerabilities. It's better to log the error details and return a generic error message to the client.\n\n3. **Handling Exceptions**:\n - The `custom_error_handler` function logs the traceback and returns the exception message directly to the client. This can expose sensitive information about the server's internal state. It's better to log the error and return a generic message.\n\n4. **Provider Configuration**:\n - The providers are configured with the same pipeline processors. This might not be a security issue in itself, but it's important to ensure that the pipeline processors are secure and correctly configured.\n\n5. **Logging**:\n - The `logger.error` function is used to log the error traceback. Ensure that the logging configuration is set up correctly to prevent logging sensitive information to insecure destinations.\n\nHere is a revised version of the code with some of these issues addressed:\n\n```python\nimport traceback\n\nimport structlog\nfrom fastapi import APIRouter, FastAPI\nfrom fastapi.middleware.cors import CORSMiddleware\nfrom fastapi.responses import JSONResponse\nfrom starlette.middleware.errors import ServerErrorMiddleware\n\nfrom codegate import __description__, __version__\nfrom codegate.dashboard.dashboard import dashboard_router\nfrom codegate.pipeline.factory import PipelineFactory\nfrom codegate.providers.anthropic.provider import AnthropicProvider\nfrom codegate.providers.llamacpp.provider import LlamaCppProvider\nfrom codegate.providers.ollama.provider import OllamaProvider\nfrom codegate.providers.openai.provider import OpenAIProvider\nfrom codegate.providers.registry import ProviderRegistry\nfrom codegate.providers.vllm.provider import VLLMProvider\n\nlogger = structlog.get_logger(\"codegate\")\n\n\nasync def custom_error_handler(request, exc: Exception):\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\n # Capture the stack trace\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\n logger.error(traceback.print_list(extracted_traceback[-3:]))\n return JSONResponse({\"error\": \"An internal server error occurred\"}, status_code=500)\n\n\ndef init_app(pipeline_factory: PipelineFactory) -> FastAPI:\n \"\"\"Create the FastAPI application.\"\"\"\n app = FastAPI(\n title=\"CodeGate\",\n description=__description__,\n version=__version__,\n )\n app.add_middleware(\n CORSMiddleware,\n allow_origins=[\"https://example.com\"], # Restrict to specific origins\n allow_credentials=True,\n allow_methods=[\"GET\", \"POST\"], # Restrict to specific methods\n allow_headers=[\"*\"],\n )\n # Apply error handling middleware\n app.add_middleware(ServerErrorMiddleware, handler=custom_error_handler)\n\n # Create provider registry\n registry = ProviderRegistry(app)\n\n # Register all known providers\n registry.add_provider(\n \"openai\",\n OpenAIProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"anthropic\",\n AnthropicProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"llamacpp\",\n LlamaCppProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"vllm\",\n VLLMProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"ollama\",\n OllamaProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n\n # Create and add system routes\n system_router = APIRouter(tags=[\"System\"])\n\n @system_router.get(\"/health\")\n async def health_check():\n return {\"status\": \"healthy\"}\n\n app.include_router(system_router)\n app.include_router(dashboard_router)\n\n return app\n```\n\nIn this revised version, the CORS middleware is restricted to specific origins and methods, and the error handler returns a generic error message to the client.", + "timestamp": "2025-01-03T09:09:34.359269Z", + "message_id": "68e7c9bc-9afa-4240-8eba-621eaae4a2a0" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-eebad2bd68434c7c947d10754a204ea4", + "conversation_timestamp": "2025-01-03T09:09:33.743797Z" + }, + { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/App.tsx (23-29)\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n\n```\nPlease explain the cause of this error and how to solve it: 'test' is declared but its value is never read.", + "timestamp": "2025-01-02T13:42:48.721165Z", + "message_id": "031cf7a3-1ce6-435d-bbee-0f939b30cc20" + }, + "answer": { + "message": "The error message \"'test' is declared but its value is never read\" indicates that the variable `test` is defined in your code, but it is never used anywhere. This can lead to confusion for other developers reading the code and might indicate that the intended functionality has not been implemented.\n\n### Cause of the Error\n\n1. **Unused Variable**: The variable `test` is declared but not used in the rest of the code within the `App` component. This can be a result of incomplete implementation or a placeholder that was meant to be used later but was forgotten.\n\n### How to Solve It\n\nYou have a few options to resolve this issue:\n\n1. **Remove the Unused Variable**:\n - If the variable is not needed, you can safely remove it to clean up the code and eliminate the warning.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n2. **Use the Variable**:\n - If the variable is intended to be used, ensure that it is utilized somewhere in the component. For example, you could log it for debugging purposes or use it in some part of the application logic.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n console.log(test); // Example usage\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n3. **Suppress the Warning (Not Recommended)**:\n - If you are sure that the variable is intentionally unused and do not want to remove it, you can suppress the warning. However, this is generally not recommended as it can lead to oversight of real issues.\n\n ```tsx\n // @ts-ignore\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n ```\n\n### Best Practices\n\n- **Keep Code Clean**: Regularly clean up unused variables to maintain a clean and understandable codebase.\n- **Use Linters**: Utilize tools like ESLint to automatically detect and flag unused variables, helping you maintain code quality.\n\nBy addressing this issue, you can improve the maintainability and readability of your code.", + "timestamp": "2025-01-02T13:42:49.361714Z", + "message_id": "a542408b-d0bc-4f6f-8b71-64c93c1e388a" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d87679de7ed41639eb91d8ebbaa6f72", + "conversation_timestamp": "2025-01-02T13:42:48.721165Z" + }, + { + "question_answers": [ + { + "question": { + "message": "```/Users/giuseppe/workspace/codegate-ui/src/App.tsx\nimport { Header } from \"./components/Header\";\nimport { PromptList } from \"./components/PromptList\";\nimport { useEffect } from \"react\";\nimport { Dashboard } from \"./components/Dashboard\";\nimport { Routes, Route, Link } from \"react-router-dom\";\nimport { Chat } from \"./components/Chat\";\nimport { usePromptsStore } from \"./hooks/usePromptsStore\";\nimport { Sidebar } from \"./components/Sidebar\";\nimport { useSse } from \"./hooks/useSse\";\nimport { Help } from \"./components/Help\";\nimport { Certificates } from \"./components/Certificates\";\nimport { CertificateSecurity } from \"./components/CertificateSecurity\";\nimport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbSeparator,\n BreadcrumbPage,\n} from \"./components/ui/breadcrumb\";\nimport { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n\nfunction App() {\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$4g3iWc/V3YD6pAXIeA43M197ostjpL3XZuDbJuxTN+jG1Mcjv6cMFcC73SsIDzECoWSuZqSYGkrWe5vQqbheaJbDlocBrPZMkgQWkcP8gw==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n\n return (\n
\n \n \n \n
\n
\n\n
\n \n \n \n Dashboard\n \n {breadcrumb && (\n <>\n \n \n \n {breadcrumb}\n \n \n \n )}\n \n \n
\n\n
\n \n } />\n } />\n } />\n } />\n }\n />\n \n
\n
\n
\n );\n}\n\nexport default App;\n\n```\n\nApp.tsx could you review?", + "timestamp": "2025-01-02T13:40:18.343146Z", + "message_id": "33b28648-c3a8-4f52-a110-e59a19dc6fab" + }, + "answer": { + "message": "**CodeGate Security Analysis**\n\n### Security Vulnerabilities and Potential Risks\n\n1. **Unsanitized User Input and Cross-Site Scripting (XSS)**\n - The `breadcrumb` variable, which is derived from user interaction, is directly rendered within the `` component. If the `breadcrumb` contains user-controlled data, it could be vulnerable to XSS attacks if not properly sanitized.\n\n2. **Potential Sensitive Data Exposure**\n - The `test` variable contains a string that begins with \"REDACTED\", indicating it may contain sensitive information. Ensure that such strings are not exposed or logged in a manner that could lead to data breaches.\n\n3. **Lack of Authentication and Authorization**\n - The code does not include any authentication or authorization mechanisms. This could allow unauthorized users to access sensitive components like `/certificates` and `/certificates/security`.\n\n4. **Security of Sensitive Components**\n - Components like `CertificateSecurity` and `Certificates` might handle sensitive information. Ensure that these components implement proper security measures to protect the data they handle.\n\n### Best Practices for Secure Implementation\n\n1. **Sanitize and Encode User Input**\n - Always sanitize and encode user inputs to prevent XSS attacks. Use libraries like `DOMPurify` to sanitize HTML content.\n\n2. **Implement Authentication and Authorization**\n - Integrate a robust authentication system (e.g., OAuth, JWT) to ensure that only authorized users can access sensitive routes and components.\n\n3. **Protect Sensitive Data**\n - Ensure that any sensitive data, such as certificates and security-related information, is encrypted both at rest and in transit. Use HTTPS for all communications.\n\n4. **Regular Security Audits and Testing**\n - Conduct regular security audits and penetration testing to identify and fix vulnerabilities in the application.\n\n### Recommendations for Security Improvements\n\n1. **Sanitize Breadcrumb Data**\n - Modify the `BreadcrumbPage` component to sanitize the `breadcrumb` data before rendering it. For example:\n ```jsx\n \n {DOMPurify.sanitize(breadcrumb)}\n \n ```\n\n2. **Implement Authentication**\n - Use a library like `react-router-dom` with authentication middleware to protect routes. For example:\n ```jsx\n \n \n \n }\n />\n ```\n\n3. **Secure Components**\n - Ensure that components like `CertificateSecurity` and `Certificates` implement proper security measures, such as input validation, encryption, and access controls.\n\n4. **Review and Secure Dependencies**\n - Regularly review and update dependencies to ensure they are secure and free from known vulnerabilities. Use tools like `npm audit` to identify and fix vulnerabilities.\n\n### References to Relevant Security Standards or Guidelines\n\n- **OWASP Top Ten**: A list of the most critical security risks to web applications, including XSS and injection flaws.\n- **OWASP Security Testing Guide**: Provides detailed guidance on how to test for various security vulnerabilities.\n- **NIST Cybersecurity Framework**: Offers a comprehensive set of guidelines for managing and reducing cybersecurity risks.\n\nBy addressing these security considerations, you can significantly enhance the security posture of your application.", + "timestamp": "2025-01-02T13:40:18.881023Z", + "message_id": "82b89210-811a-478d-9229-e45bd3d60913" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-92720293078e459e9d65be5298a9dae6", + "conversation_timestamp": "2025-01-02T13:40:18.343146Z" + }, + { + "question_answers": [ + { + "question": { + "message": "hello", + "timestamp": "2025-01-02T13:39:39.656516Z", + "message_id": "1273fc1a-43e7-42c3-82b0-0057858d9b98" + }, + "answer": { + "message": "Hello! How can I assist you today?", + "timestamp": "2025-01-02T13:39:40.159594Z", + "message_id": "24aa2eec-f5bc-4275-8e30-a8f68d3f3002" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-40c88006b69940dab2d454175ff4c533", + "conversation_timestamp": "2025-01-02T13:39:39.656516Z" + }, + { + "question_answers": [ + { + "question": { + "message": "<|fim_prefix|>// diff --git a/src/App.tsx b/src/App.tsx\n// index fafa5bf..46b5fbd 100644\n// --- a/src/App.tsx\n// +++ b/src/App.tsx\n// @@ -22,6 +22,8 @@ import { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n// function App() {\n// const { prompts, loading, fetchPrompts } = usePromptsStore();\n// useSse();\n// +\n// + cosnt test = REDACTED<$u0UEa5CGkrHrKv9oWKNC/aUuzW/D1d0ULifi+LvgIaGefP/xzkPr73YSZpciPs1YUAfjgcx35E3X81EwaKw4C68LTZuOXBBHEzZokLNZbg==>\n// const breadcrumb = useBreadcrumb();\n// \n// useEffect(() => {\n// src/App.tsx\nimport { useEffect } from \"react\";\nimport { Dashboard } from \"./components/Dashboard\";\nimport { Routes, Route, Link } from \"react-router-dom\";\nimport { Chat } from \"./components/Chat\";\nimport { usePromptsStore } from \"./hooks/usePromptsStore\";\nimport { Sidebar } from \"./components/Sidebar\";\nimport { useSse } from \"./hooks/useSse\";\nimport { Help } from \"./components/Help\";\nimport { Certificates } from \"./components/Certificates\";\nimport { CertificateSecurity } from \"./components/CertificateSecurity\";\nimport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbSeparator,\n BreadcrumbPage,\n} from \"./components/ui/breadcrumb\";\nimport { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n\nfunction App() {\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n cosnt test = 'REDACTED<$m2fVY6C1zlk0swockzeQM/vDxL0h6im+Ber6vzYFFplvdR7dncAecjH18/Wptj0h3lQu7xCKxCFfCXxn7qe0clMZisPnRvohJOS/+W6P/m0++N/asPFkZnhJ3YPS>'\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n\n return (\n
\n \n \n \n
\n
\n\n
\n \n \n \n Dashboard\n \n {breadcrumb && (\n <>\n \n <|fim_middle|>", + "timestamp": "2025-01-02T13:40:06.097504Z", + "message_id": "ccf1c87a-4846-4d81-b69f-f882f1971cf7" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "ccf1c87a-4846-4d81-b69f-f882f1971cf7", + "conversation_timestamp": "2025-01-02T13:40:06.097504Z" + }, + { + "question_answers": [ + { + "question": { + "message": "<|im_start|>user\n```tsx\nimport { Header } from \"./components/Header\";\nimport { PromptList } from \"./components/PromptList\";\nimport { useEffect } from \"react\";\nimport { Dashboard } from \"./components/Dashboard\";\nimport { Routes, Route, Link } from \"react-router-dom\";\nimport { Chat } from \"./components/Chat\";\nimport { usePromptsStore } from \"./hooks/usePromptsStore\";\nimport { Sidebar } from \"./components/Sidebar\";\nimport { useSse } from \"./hooks/useSse\";\nimport { Help } from \"./components/Help\";\nimport { Certificates } from \"./components/Certificates\";\nimport { CertificateSecurity } from \"./components/CertificateSecurity\";\nimport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbSeparator,\n BreadcrumbPage,\n} from \"./components/ui/breadcrumb\";\nimport { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n\nfunction App() {\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lAJek6QoLZgSKq3z4ybqMVFOCtiHQtP8hbBzWeQysFQoGwwNrEghIPnFCsXY985bpTjx4ZIiBzx11E1yM3ybbUzoxG/W4TrUPzM4aHAjIg==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n\n return (\n
\n \n \n \n
\n
\n\n
\n \n \n \n Dashboard\n \n {breadcrumb && (\n <>\n \n \n \n {breadcrumb}\n \n \n \n )}\n \n \n
\n\n
\n \n } />\n } />\n } />\n } />\n }\n />\n \n
\n
\n
\n );\n}\n\nexport default App;\n\n\n```\n\nPlease rewrite the entire code block above in order to satisfy the following request: \"The following code was suggested as an edit:\n```\n// @ts-ignore\nconst test = \"REDACTED<$gGYIqfbrVCHST8Xn/yfGtFDfQQ3Kn6mQ9t1+YrUCKYxNEiRYb4u9BQmxZkOQE5I+9UZRasD0/bY3m00v4OSo+PI6Zzn97RSVNJgM47nUlQ==>\";\nconst breadcrumb = useBreadcrumb();\n```\nPlease apply it to the previous code.\". You should rewrite the entire code block without leaving placeholders, even if the code is the same as before.<|im_end|>\n<|im_start|>assistant\nSure! Here's the entire rewritten code block:\n```tsx\n", + "timestamp": "2025-01-02T14:19:58.024100Z", + "message_id": "b97fbe59-0e34-4b98-8f2f-41332ebc059a" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "b97fbe59-0e34-4b98-8f2f-41332ebc059a", + "conversation_timestamp": "2025-01-02T14:19:58.024100Z" + }, + { + "question_answers": [ + { + "question": { + "message": "<|fim_prefix|>// diff --git a/package.json b/package.json\n// index 3b62d87..4774c65 100644\n// --- a/package.json\n// +++ b/package.json\n// @@ -21,7 +21,6 @@\n// \"@radix-ui/react-switch\": \"^1.1.1\",\n// \"@radix-ui/react-tooltip\": \"^1.1.6\",\n// \"@types/prismjs\": \"^1.26.5\",\n// - \"@types/react-copy-to-clipboard\": \"^5.0.7\",\n// \"@types/react-syntax-highlighter\": \"^15.5.13\",\n// \"class-variance-authority\": \"^0.7.1\",\n// \"clsx\": \"^2.1.1\",\n// @@ -29,7 +28,6 @@\n// \"lucide-react\": \"^0.462.0\",\n// \"prismjs\": \"^1.29.0\",\n// \"react\": \"^18.3.1\",\n// - \"react-copy-to-clipboard\": \"^5.1.0\",\n// \"react-dom\": \"^18.3.1\",\n// \"react-markdown\": \"^9.0.1\",\n// \"react-router-dom\": \"^7.0.2\",\n// @@ -61,4 +59,4 @@\n// \"typescript-eslint\": \"^8.15.0\",\n// \"vite\": \"^6.0.1\"\n// }\n// -}\n// +}\n// \\ No newline at end of file\n// diff --git a/src/components/CopyToClipboard.tsx b/src/components/CopyToClipboard.tsx\n// new file mode 100644\n// index 0000000..682af0c\n// --- /dev/null\n// +++ b/src/components/CopyToClipboard.tsx\n// @@ -0,0 +1,31 @@\n// +import clsx from \"clsx\";\n// +import { ClipboardCopy } from \"lucide-react\";\n// +\n// +export function CopyToClipboard({\n// + text,\n// + className,\n// +}: {\n// + className?: string;\n// + text: string;\n// +}) {\n// + const copyToClipboard = async () => {\n// + try {\n// + await navigator.clipboard.writeText(text);\n// + } catch {}\n// + };\n// +\n// + return (\n// + \n// + \n// + \n// + );\n// +}\n// Path: Untitled.txt\n// navigator.clipboard.writeText\n// components/CopyToClipboard.tsx\nimport clsx from \"clsx\";\nimport { ClipboardCopy } from \"lucide-react\";\n\nexport function CopyToClipboard({\n text,\n className,\n}: {\n className?: string;\n text: string;\n}) {\n const copyToClipboard = async () => {\n try {\n await navigator.clipboard.writeText(text);\n } catch {}\n };\n\n return (\n hover:bg-gray-700/70 \n transition-opacity duration-200 \n opacity-0 group-hover:opacity-100`,\n className\n )}\n >\n \n \n );\n}\n<|fim_middle|>", + "timestamp": "2025-01-02T15:00:12.114817Z", + "message_id": "27318899-9e9b-4dfa-9e61-f482dcd24e54" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "27318899-9e9b-4dfa-9e61-f482dcd24e54", + "conversation_timestamp": "2025-01-02T15:00:12.114817Z" + }, + { + "question_answers": [ + { + "question": { + "message": "<|fim_prefix|>\n// components/Markdown.tsx\nimport remarkGfm from \"remark-gfm\";\nimport ReactMarkdown from \"react-markdown\";\nimport { Prism as SyntaxHighlighter } from \"react-syntax-highlighter\";\nimport { oneDark } from \"react-syntax-highlighter/dist/esm/styles/prism\";\nimport { cn } from \"@/lib/utils\";\nimport { CopyToClipboard } from \"./CopyToClipboard\";\n\ninterface Props {\n children: string;\n className?: string;\n}\n\nconst customStyle = {\n ...oneDark,\n 'pre[class*=\"language-\"]': {\n ...oneDark['pre[class*=\"language-\"]'],\n whiteSpace: \"pre-wrap\",\n background: \"#re<|fim_suffix|>\",\n padding: \"1.5rem\",\n borderRadius: \"0.5rem\",\n margin: \"1.5rem 0\",\n fontSize: \"10px\",\n width: \"80%\", // Ensure the block takes full width\n position: \"relative\",\n },\n};\n\nexport function Markdown({ children, className = \"\" }: Props) {\n return (\n <|fim_middle|>", + "timestamp": "2025-01-02T17:01:41.579128Z", + "message_id": "4ea5d1df-c724-49f7-a132-d19e092b52c8" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "4ea5d1df-c724-49f7-a132-d19e092b52c8", + "conversation_timestamp": "2025-01-02T17:01:41.579128Z" + }, + { + "question_answers": [ + { + "question": { + "message": "<|fim_prefix|>// Path: Untitled.txt\n// 1a1b26\n// components/Markdown.tsx\n // whiteSpace: \"pre-wrap\",\n // background: \"#1a1b26\",\n // padding: \"1.5rem\",\n // borderRadius: \"0.5rem\",\n // margin: \"1.5rem 0\",\n // fontSize: \"10px\",\n // width: \"80%\", // Ensure the block takes full width\n // position: \"relative\",\n // },\n};\n\nexport function Markdown({ children, className = \"\" }: Props) {\n return (\n \n 1a1b26\",\n // fontSize: \"10x\",\n // whiteSpace: \"pre-wrap\",\n // padding: \"1.5rem\",\n // borderRadius: \"0.5rem\",\n // margin: \"1.5rem 0\",\n // position: \"relative\", // Critical for clipboard positioning\n // width: \"100%\", // Ensure full width of parent container\n // boxSizing: \"border-box\", // Prevent padding overflow\n },\n }}\n language={match[1]}\n PreTag=\"div\"\n className=\"rounded-lg overflow-hidden shadow-lg text-sm\"\n showLineNumbers={false}\n wrapLines\n {...props}\n ><|fim_middle|>", + "timestamp": "2025-01-02T17:08:08.428889Z", + "message_id": "203fe119-0e58-43b5-a863-73f30f73d272" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "203fe119-0e58-43b5-a863-73f30f73d272", + "conversation_timestamp": "2025-01-02T17:08:08.428889Z" + }, + { + "question_answers": [ + { + "question": { + "message": "<|fim_prefix|>\n// components/Markdown.tsx\n}\n\nconst customStyle = {\n ...oneDark,\n 'pre[class*=\"language-\"]': {\n ...oneDark['pre[class*=\"language-\"]'],\n whiteSpace: \"pre-wrap\",\n // background: \"#1a1b26\",\n padding: \"1.5rem\",\n borderRadius: \"0.5rem\",\n margin: \"1.5rem 0\",\n fontSize: \"10px\",\n width: \"80%\", // Ensure the block takes full width\n position: \"relative\",\n },\n};\n\nexport function Markdown({ children, className = \"\" }: Props) {\n return (\n \n \"\n showLineNumbers={false}\n wrapLines\n {...props}\n >\n {String(children).replace(/\\n$/, \"\")}\n \n \n
\n ) : (\n ", + "timestamp": "2025-01-02T17:20:32.921469Z", + "message_id": "d81ca662-84ae-4114-9041-6d640c547bb9" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "d81ca662-84ae-4114-9041-6d640c547bb9", + "conversation_timestamp": "2025-01-02T17:20:32.921469Z" + }, + { + "question_answers": [ + { + "question": { + "message": "<|fim_prefix|>// Path: Untitled.txt\n// showLineNumbers\n// components/Markdown.tsx\n background: \"none\",\n padding: \"0\",\n borderRadius: \"0\",\n fontSize: \"inherit\",\n color: \"inherit\",\n display: \"inline\",\n },\n 'pre[class*=\"language-\"]': {\n ...oneDark['pre[class*=\"language-\"]'],\n whiteSpace: \"pre-wrap\",\n background: \"#1a1b26\",\n padding: \"1.5rem\",\n borderRadius: \"0.5rem\",\n margin: \"1.5rem 0\",\n fontSize: \"10px\",\n width: \"80%\",\n position: \"relative\",\n },\n};\nexport function Markdown({ children, className = \"\" }: Props) {\n return (\n \n ={{\n ...customStyle,\n 'pre[class*=\"language-\"]': {\n ...oneDark['pre[class*=\"language-\"]'],\n background: \"#1a1b26\",\n padding: \"1.5rem\",\n borderRadius: \"0.5rem\",\n margin: \"1.5rem 0\",\n width: \"100%\",\n position: \"relative\",\n boxSizing: \"border-box\",\n },\n }}\n language={match[1]}\n PreTag=\"div\"\n className=\"rounded-lg overflow-hidden shadow-lg text-sm\"\n wrapLines\n {...props}\n >\n {String(children).replace(/\\n$/, \"\")}\n <|fim_middle|>", + "timestamp": "2025-01-02T17:25:40.052416Z", + "message_id": "bb2ab808-1ce7-4937-9d79-0d773dcb7111" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "bb2ab808-1ce7-4937-9d79-0d773dcb7111", + "conversation_timestamp": "2025-01-02T17:25:40.052416Z" + }, + { + "question_answers": [ + { + "question": { + "message": "<|fim_prefix|>// diff --git a/package.json b/package.json\n// index 42ed9d9..6b1ddde 100644\n// --- a/package.json\n// +++ b/package.json\n// @@ -25,6 +25,7 @@\n// \"class-variance-authority\": \"^0.7.1\",\n// \"clsx\": \"^2.1.1\",\n// \"date-fns\": \"^4.1.0\",\n// + \"highlight.js\": \"^11.11.1\",\n// \"lucide-react\": \"^0.462.0\",\n// \"prismjs\": \"^1.29.0\",\n// \"react\": \"19.0.0\",\n// components/Markdown.tsx\nimport hljs from \"highlight.js\";\n\ninterface Props {\n children: string;\n className?: string;\n}\nconsole.log({ oneDark });\nconst customStyle = {\n ...oneDark,\n 'code[class*=\"language-\"]': {\n ...oneDark['code[class*=\"language-\"]'],\n background: \"none\",\n },\n 'pre[class*=\"language-\"]': {\n ...oneDark['pre[class*=\"language-\"]'],\n whiteSpace: \"pre-wrap\",\n background: \"#1a1b26\",\n padding: \"1.5rem\",\n borderRadius: \"0.5rem\",\n margin: \"1.5rem 0\",\n fontSize: \"10px\",\n width: \"80%\",\n position: \"relative\",\n },\n};\nexport function Markdown({ children, className = \"\" }: Props) {\n \n return (\n ).language;\n console.log({ detectedLanguage });\n const match = /language-(\\w+)/.exec(className || \"\");\n const inline = !match;\n return !inline ? (\n
\n ", + "timestamp": "2025-01-03T10:22:01.721847Z", + "message_id": "9b522dca-a54e-4356-9692-d5be66f051cc" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "9b522dca-a54e-4356-9692-d5be66f051cc", + "conversation_timestamp": "2025-01-03T10:22:01.721847Z" + }, + { + "question_answers": [ + { + "question": { + "message": "<|fim_prefix|>// diff --git a/package.json b/package.json\n// index 42ed9d9..6b1ddde 100644\n// --- a/package.json\n// +++ b/package.json\n// @@ -25,6 +25,7 @@\n// \"class-variance-authority\": \"^0.7.1\",\n// \"clsx\": \"^2.1.1\",\n// \"date-fns\": \"^4.1.0\",\n// + \"highlight.js\": \"^11.11.1\",\n// \"lucide-react\": \"^0.462.0\",\n// \"prismjs\": \"^1.29.0\",\n// \"react\": \"19.0.0\",\n// Path: Untitled.txt\n// a11yDark\n// components/Markdown.tsx\nconst customStyle = {\n ...oneDark,\n 'code[class*=\"language-\"]': {\n ...oneDark['code[class*=\"language-\"]'],\n background: \"none\",\n },\n 'pre[class*=\"language-\"]': {\n ...oneDark['pre[class*=\"language-\"]'],\n whiteSpace: \"pre-wrap\",\n background: \"#1a1b26\",\n padding: \"1.5rem\",\n borderRadius: \"0.5rem\",\n margin: \"1.5rem 0\",\n fontSize: \"10px\",\n width: \"80%\",\n position: \"relative\",\n },\n};\nexport function Markdown({ children, className = \"\" }: Props) {\n return (\n \n return (\n <>\n \n {String(children).replace(/\\n$/, \"\")}<|fim_middle|>", + "timestamp": "2025-01-03T10:59:20.862404Z", + "message_id": "b21cb89e-f5f0-4cbe-95a6-7407bf59199d" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "b21cb89e-f5f0-4cbe-95a6-7407bf59199d", + "conversation_timestamp": "2025-01-03T10:59:20.862404Z" + }, + { + "question_answers": [ + { + "question": { + "message": "<|fim_prefix|>// diff --git a/package.json b/package.json\n// index 42ed9d9..6b1ddde 100644\n// --- a/package.json\n// +++ b/package.json\n// @@ -25,6 +25,7 @@\n// \"class-variance-authority\": \"^0.7.1\",\n// \"clsx\": \"^2.1.1\",\n// \"date-fns\": \"^4.1.0\",\n// + \"highlight.js\": \"^11.11.1\",\n// \"lucide-react\": \"^0.462.0\",\n// \"prismjs\": \"^1.29.0\",\n// \"react\": \"19.0.0\",\n// components/Markdown.tsx\n children: string;\n className?: string;\n}\nconsole.log({ oneDark });\nconst customStyle = {\n ...oneDark,\n 'code[class*=\"language-\"]': {\n ...oneDark['code[class*=\"language-\"]'],\n background: \"none\",\n },\n 'pre[class*=\"language-\"]': {\n ...oneDark['pre[class*=\"language-\"]'],\n whiteSpace: \"pre-wrap\",\n background: \"#1a1b26\",\n padding: \"1.5rem\",\n borderRadius: \"0.5rem\",\n margin: \"1.5rem 0\",\n fontSize: \"10px\",\n width: \"80%\",\n position: \"relative\",\n },\n};\nexport function Markdown({ children, className = \"\" }: Props) {\n return (\n >\n \n {String(children).replace(/\\n$/, \"\")}\n <|fim_middle|>", + "timestamp": "2025-01-03T11:05:21.749423Z", + "message_id": "a5bd2d58-4339-4bbd-a5b0-8f65ff758b46" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "a5bd2d58-4339-4bbd-a5b0-8f65ff758b46", + "conversation_timestamp": "2025-01-03T11:05:21.749423Z" + }, + { + "question_answers": [ + { + "question": { + "message": "<|fim_prefix|>// diff --git a/package.json b/package.json\n// index 42ed9d9..6b1ddde 100644\n// --- a/package.json\n// +++ b/package.json\n// @@ -25,6 +25,7 @@\n// \"class-variance-authority\": \"^0.7.1\",\n// \"clsx\": \"^2.1.1\",\n// \"date-fns\": \"^4.1.0\",\n// + \"highlight.js\": \"^11.11.1\",\n// \"lucide-react\": \"^0.462.0\",\n// \"prismjs\": \"^1.29.0\",\n// \"react\": \"19.0.0\",\n// diff --git a/src/components/ui/chat/chat-bubble.tsx b/src/components/ui/chat/chat-bubble.tsx\n// index b9d20ec..1be8760 100644\n// --- a/src/components/ui/chat/chat-bubble.tsx\n// +++ b/src/components/ui/chat/chat-bubble.tsx\n// @@ -107,7 +107,7 @@ const ChatBubbleMessage = React.forwardRef<\n// const customStyle = {\n ...oneDark,\n 'code[class*=\"language-\"]': {\n ...oneDark['code[class*=\"language-\"]'],\n background: \"none\",\n },\n 'pre[class*=\"language-\"]': {\n ...oneDark['pre[class*=\"language-\"]'],\n whiteSpace: \"pre-wrap\",\n background: \"#1a1b26\",\n padding: \"1.5rem\",\n borderRadius: \"0.5rem\",\n margin: \"1.5rem 0\",\n fontSize: \"10px\",\n width: \"80%\",\n position: \"relative\",\n },\n};\nexport function Markdown({ children, className = \"\" }: Props) {\n return (\n ", + "timestamp": "2025-01-03T11:32:56.031157Z", + "message_id": "63dee5cb-444e-484c-8259-83be0ea073ac" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "63dee5cb-444e-484c-8259-83be0ea073ac", + "conversation_timestamp": "2025-01-03T11:32:56.031157Z" + }, + { + "question_answers": [ + { + "question": { + "message": "<|fim_prefix|>// diff --git a/package.json b/package.json\n// index 42ed9d9..6b1ddde 100644\n// --- a/package.json\n// +++ b/package.json\n// @@ -25,6 +25,7 @@\n// \"class-variance-authority\": \"^0.7.1\",\n// \"clsx\": \"^2.1.1\",\n// \"date-fns\": \"^4.1.0\",\n// + \"highlight.js\": \"^11.11.1\",\n// \"lucide-react\": \"^0.462.0\",\n// \"prismjs\": \"^1.29.0\",\n// \"react\": \"19.0.0\",\n// diff --git a/src/components/ui/chat/chat-bubble.tsx b/src/components/ui/chat/chat-bubble.tsx\n// index b9d20ec..1be8760 100644\n// --- a/src/components/ui/chat/chat-bubble.tsx\n// +++ b/src/components/ui/chat/chat-bubble.tsx\n// @@ -107,7 +107,7 @@ const ChatBubbleMessage = React.forwardRef<\n// \n} from \"react-syntax-highlighter\";\nimport { oneDark } from \"react-syntax-highlighter/dist/esm/styles/prism\";\nimport { cn } from \"@/lib/utils\";\nimport { CopyToClipboard } from \"./CopyToClipboard\";\nimport hljs from \"highlight.js\";\n\nconst LANGUAGES_SUBSET_DETECTION = [\n \"bash\",\n \"c\",\n \"cpp\",\n \"csharp\",\n \"css\",\n \"elixir\",\n \"go\",\n \"groovy\",\n \"haskell\",\n \"html\",\n \"java\",\n \"javascript\",\n \"json\",\n \"kotlin\",\n \"lua\",\n \"markdown\",\n \"perl\",\n \"php\",<|fim_middle|>", + "timestamp": "2025-01-03T11:56:42.129289Z", + "message_id": "cd2f0343-5b65-4848-a694-79acb3e4de7b" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "cd2f0343-5b65-4848-a694-79acb3e4de7b", + "conversation_timestamp": "2025-01-03T11:56:42.129289Z" + }, + { + "question_answers": [ + { + "question": { + "message": "<|fim_prefix|>// diff --git a/package.json b/package.json\n// index 42ed9d9..6b1ddde 100644\n// --- a/package.json\n// +++ b/package.json\n// @@ -25,6 +25,7 @@\n// \"class-variance-authority\": \"^0.7.1\",\n// \"clsx\": \"^2.1.1\",\n// \"date-fns\": \"^4.1.0\",\n// + \"highlight.js\": \"^11.11.1\",\n// \"lucide-react\": \"^0.462.0\",\n// \"prismjs\": \"^1.29.0\",\n// \"react\": \"19.0.0\",\n// diff --git a/src/components/ui/chat/chat-bubble.tsx b/src/components/ui/chat/chat-bubble.tsx\n// index b9d20ec..1be8760 100644\n// --- a/src/components/ui/chat/chat-bubble.tsx\n// +++ b/src/components/ui/chat/chat-bubble.tsx\n// @@ -107,7 +107,7 @@ const ChatBubbleMessage = React.forwardRef<\n// /prism\";\nimport { cn } from \"@/lib/utils\";\nimport { CopyToClipboard } from \"./CopyToClipboard\";\n// import hljs from \"highlight.js\";\n\nconst LANGUAGES_SUBSET_DETECTION = [\n \"bash\",\n \"c\",\n \"cpp\",\n \"csharp\",\n \"css\",\n \"elixir\",\n \"go\",\n \"groovy\",\n \"haskell\",\n \"html\",\n \"java\",\n \"javascript\",\n \"json\",\n \"kotlin\",\n \"lua\",\n \"markdown\",\n \"perl\",\n \"php\",\n \"python\",\n \"ruby\",\n \"rust\",\n \"scala\",\n \"sql\",\n \"swift\",\n \"typescript\",<|fim_middle|>", + "timestamp": "2025-01-03T12:10:18.944843Z", + "message_id": "52bf2933-2a34-4d78-8368-9fccb26da0a2" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "52bf2933-2a34-4d78-8368-9fccb26da0a2", + "conversation_timestamp": "2025-01-03T12:10:18.944843Z" + }, + { + "question_answers": [ + { + "question": { + "message": "<|fim_prefix|>// diff --git a/package.json b/package.json\n// index 42ed9d9..6b1ddde 100644\n// --- a/package.json\n// +++ b/package.json\n// @@ -25,6 +25,7 @@\n// \"class-variance-authority\": \"^0.7.1\",\n// \"clsx\": \"^2.1.1\",\n// \"date-fns\": \"^4.1.0\",\n// + \"highlight.js\": \"^11.11.1\",\n// \"lucide-react\": \"^0.462.0\",\n// \"prismjs\": \"^1.29.0\",\n// \"react\": \"19.0.0\",\n// diff --git a/src/components/ui/chat/chat-bubble.tsx b/src/components/ui/chat/chat-bubble.tsx\n// index b9d20ec..1be8760 100644\n// --- a/src/components/ui/chat/chat-bubble.tsx\n// +++ b/src/components/ui/chat/chat-bubble.tsx\n// @@ -107,7 +107,7 @@ const ChatBubbleMessage = React.forwardRef<\n// \n return (\n
\n ", + "timestamp": "2025-01-03T14:47:23.644901Z", + "message_id": "b57a9d41-c022-4e72-9b80-e96eed86a6ba" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "b57a9d41-c022-4e72-9b80-e96eed86a6ba", + "conversation_timestamp": "2025-01-03T14:47:23.644901Z" + } +] \ No newline at end of file diff --git a/src/mocks/msw/handlers.ts b/src/mocks/msw/handlers.ts index 7711de4..1b17d7f 100644 --- a/src/mocks/msw/handlers.ts +++ b/src/mocks/msw/handlers.ts @@ -1,12 +1,12 @@ import { http, HttpResponse } from "msw"; +import mockedPrompts from "@/mocks/msw/fixtures/GetMessages.json"; +import mockedAlerts from "@/mocks/msw/fixtures/GetAlerts.json"; export const handlers = [ - http.get("https://example.com/user", () => { - // ...and respond to them using this JSON response. - return HttpResponse.json({ - id: "c7b3d8e0-5e0b-4b0f-8b3a-3b9f4b3d3b3d", - firstName: "John", - lastName: "Maverick", - }); + http.get("*/dashboard/messages", () => { + return HttpResponse.json(mockedPrompts); + }), + http.get("*/dashboard/alerts", () => { + return HttpResponse.json(mockedAlerts); }), ]; From b6d9c15c757f4dd8abd2c0150fc6fe7ed46d0306 Mon Sep 17 00:00:00 2001 From: Giuseppe Scuglia Date: Tue, 7 Jan 2025 17:45:39 +0100 Subject: [PATCH 06/21] test: refactor PromptList --- src/components/__tests__/PromptList.test.tsx | 44 +++++++++----------- src/lib/test-utils.tsx | 12 ++++++ 2 files changed, 31 insertions(+), 25 deletions(-) create mode 100644 src/lib/test-utils.tsx diff --git a/src/components/__tests__/PromptList.test.tsx b/src/components/__tests__/PromptList.test.tsx index a4cafcc..aaa08c7 100644 --- a/src/components/__tests__/PromptList.test.tsx +++ b/src/components/__tests__/PromptList.test.tsx @@ -1,16 +1,12 @@ import { describe, expect, it } from "vitest"; -import { render, screen } from "@testing-library/react"; +import { screen } from "@testing-library/react"; import { PromptList } from "../PromptList"; import mockedPrompts from "@/mocks/msw/fixtures/GetMessages.json"; -import { MemoryRouter } from "react-router-dom"; +import { render } from "@/lib/test-utils"; describe("PromptList", () => { it("should render correct prompt", () => { - render( - - - , - ); + render(); expect( screen.getByRole("link", { name: /server\.py do you see any security issue\?/i, @@ -21,24 +17,22 @@ describe("PromptList", () => { it("should render default prompt value when missing question", async () => { const conversationTimestamp = "2025-01-02T14:19:58.024100Z"; render( - - - , + , ); expect( diff --git a/src/lib/test-utils.tsx b/src/lib/test-utils.tsx new file mode 100644 index 0000000..e8dd2a9 --- /dev/null +++ b/src/lib/test-utils.tsx @@ -0,0 +1,12 @@ +import { render } from "@testing-library/react"; +import React from "react"; +import { MemoryRouter, MemoryRouterProps } from "react-router-dom"; + +const renderWithProviders = ( + children: React.ReactNode, + routeConfig?: MemoryRouterProps, +) => render({children}); + +export * from "@testing-library/react"; + +export { renderWithProviders as render }; From 62060542fe08f172c07ff88f95f26b5e86df2657 Mon Sep 17 00:00:00 2001 From: Giuseppe Scuglia Date: Wed, 8 Jan 2025 11:13:11 +0100 Subject: [PATCH 07/21] test: refactor fixtures name --- src/mocks/msw/fixtures/{GetAlerts.json => GET_ALERTS.json} | 0 src/mocks/msw/fixtures/{GetMessages.json => GET_MESSAGES.json} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/mocks/msw/fixtures/{GetAlerts.json => GET_ALERTS.json} (100%) rename src/mocks/msw/fixtures/{GetMessages.json => GET_MESSAGES.json} (100%) diff --git a/src/mocks/msw/fixtures/GetAlerts.json b/src/mocks/msw/fixtures/GET_ALERTS.json similarity index 100% rename from src/mocks/msw/fixtures/GetAlerts.json rename to src/mocks/msw/fixtures/GET_ALERTS.json diff --git a/src/mocks/msw/fixtures/GetMessages.json b/src/mocks/msw/fixtures/GET_MESSAGES.json similarity index 100% rename from src/mocks/msw/fixtures/GetMessages.json rename to src/mocks/msw/fixtures/GET_MESSAGES.json From e2a37f9b470b4fa6d0d5c6df97510e702818c975 Mon Sep 17 00:00:00 2001 From: Giuseppe Scuglia Date: Wed, 8 Jan 2025 11:23:58 +0100 Subject: [PATCH 08/21] chore: add custom render with providers --- src/lib/test-utils.tsx | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/lib/test-utils.tsx b/src/lib/test-utils.tsx index e8dd2a9..ced1e55 100644 --- a/src/lib/test-utils.tsx +++ b/src/lib/test-utils.tsx @@ -1,11 +1,28 @@ -import { render } from "@testing-library/react"; +import { RenderOptions, render } from "@testing-library/react"; import React from "react"; -import { MemoryRouter, MemoryRouterProps } from "react-router-dom"; +import { + MemoryRouter, + MemoryRouterProps, + Route, + Routes, +} from "react-router-dom"; + +type RoutConfig = { + routeConfig?: MemoryRouterProps; + pathConfig?: string; +}; const renderWithProviders = ( children: React.ReactNode, - routeConfig?: MemoryRouterProps, -) => render({children}); + options?: Omit & RoutConfig, +) => + render( + + + + + , + ); export * from "@testing-library/react"; From c960c8e66182622f48e36deb4c5edc8f9f8c568e Mon Sep 17 00:00:00 2001 From: Giuseppe Scuglia Date: Wed, 8 Jan 2025 11:24:34 +0100 Subject: [PATCH 09/21] chore: refactor import name --- src/mocks/msw/handlers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mocks/msw/handlers.ts b/src/mocks/msw/handlers.ts index 1b17d7f..f52db2b 100644 --- a/src/mocks/msw/handlers.ts +++ b/src/mocks/msw/handlers.ts @@ -1,6 +1,6 @@ import { http, HttpResponse } from "msw"; -import mockedPrompts from "@/mocks/msw/fixtures/GetMessages.json"; -import mockedAlerts from "@/mocks/msw/fixtures/GetAlerts.json"; +import mockedPrompts from "@/mocks/msw/fixtures/GET_MESSAGES.json"; +import mockedAlerts from "@/mocks/msw/fixtures/GET_ALERTS.json"; export const handlers = [ http.get("*/dashboard/messages", () => { From 044dbbad923c6f9ac88a82a886ee632b396bc193 Mon Sep 17 00:00:00 2001 From: Giuseppe Scuglia Date: Wed, 8 Jan 2025 11:24:58 +0100 Subject: [PATCH 10/21] test: add Chat test case --- src/components/Markdown.tsx | 7 ++- src/components/__tests__/Chat.test.tsx | 66 ++++++++++++++++++++ src/components/__tests__/PromptList.test.tsx | 2 +- 3 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 src/components/__tests__/Chat.test.tsx diff --git a/src/components/Markdown.tsx b/src/components/Markdown.tsx index 9c56189..ee3a6b3 100644 --- a/src/components/Markdown.tsx +++ b/src/components/Markdown.tsx @@ -53,7 +53,6 @@ const customStyle = { }, }; export function Markdown({ children, className = "" }: Props) { - SyntaxHighlighter.supportedLanguages = LANGUAGES_SUBSET_DETECTION; return ( +
({ + usePromptsStore: () => ({ + ...vi.importActual("@/hooks/usePromptsStore"), + setCurrentPromptId: vi.fn(), + prompts: [ + { + question_answers: [ + { + question: { + message: + '\n\n```tsx src/App.tsx (23-29)\n const apiKey = "REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>";\n\n\n```\nDo you see any security issue?.', + timestamp: "2025-01-02T13:42:48.721165Z", + message_id: "031cf7a3-1ce6-435d-bbee-0f939b30cc20", + }, + answer: { + message: + '**CodeGate Security Analysis**\n\nThe provided code snippet contains a string that is likely an encoded value, specifically a Base64 encoded string. Here is a detailed analysis:\n\n### Security Vulnerabilities and Potential Risks\n\n1. **Sensitive Data Handling**:\n - The string starts with "REDACTED", indicating that it contains sensitive information that has been masked or obfuscated. However, the actual value is still present and could be potentially revealing if decoded.\n - Using "REDACTED" is a good practice for hiding sensitive information in logs, but it\'s important to ensure that the actual sensitive data is not exposed.\n\n2. **Decoding Risks**:\n - If the string is Base64 encoded, decoding it could reveal sensitive information such as API keys, tokens, or other credentials.\n - Decoding and handling such sensitive data in client-side code (like `App.tsx`) can expose it to potential attackers if the data is transmitted or logged.\n\n3. **Potential for Injection**:\n - If the decoded string is used in any form of user input or external communication, there is a risk of injection attacks (e.g., SQL injection, cross-site scripting, etc.).\n\n### Best Practices for Secure Implementation\n\n1. **Avoid Hardcoding Sensitive Data**:\n - Never hardcode sensitive data such as API keys, tokens, or passwords directly in your source code. Use environment variables or secure vaults to manage such data.\n\n2. **Proper Encoding and Decoding**:\n - Ensure that encoding and decoding operations are performed securely and that the decoded data is handled with care to prevent unauthorized access or usage.\n\n3. **Data Validation and Sanitization**:\n - Always validate and sanitize any data that is used in your application. This includes checking for malicious content or unexpected formats.\n\n4. **Secure Logging**:\n - Avoid logging sensitive data directly. If logging is necessary, ensure that sensitive information is either sanitized or replaced with placeholders.\n\n### Recommendations for Security Improvements\n\n1. **Use Environment Variables**:\n - Replace the hardcoded string with an environment variable. For example:\n ```typescript\n const test = process.env.REACT_APP_REDACTED_TOKEN;\n ```\n - Ensure that environment variables are securely managed and not exposed in version control systems.\n\n2. **Implement Access Controls**:\n - Restrict access to sensitive data to only those parts of your application that require it. Use role-based access controls (RBAC) to manage permissions.\n\n3. **Regular Security Audits**:\n - Conduct regular security audits and code reviews to identify and address potential security vulnerabilities.\n\n4. **Stay Updated with Security Standards**:\n - Follow security best practices and guidelines such as those provided by OWASP (Open Web Application Security Project) and other relevant organizations.\n\n### References to Relevant Security Standards or Guidelines\n\n- **OWASP**: [OWASP Security Guidelines](https://owasp.org/)\n- **Secure Coding Practices**: [Secure Coding Guidelines](https://www.securecoding.org/)\n- **Environment Variables**: [12factor.net - Config](https://12factor.net/config)\n\nBy following these best practices and recommendations, you can help ensure that your application handles sensitive data securely and mitigates potential security risks.', + timestamp: "2025-01-02T13:42:49.361714Z", + message_id: "a542408b-d0bc-4f6f-8b71-64c93c1e388a", + }, + }, + ], + provider: "vllm", + type: "chat", + chat_id: "chatcmpl-7d87679de7ed41639eb91d8ebbaa6f72", + conversation_timestamp: "2025-01-02T13:42:48.721165Z", + }, + ], + }), +})); + +describe("Chat", () => { + it("should render secret issue chat", () => { + render(, { + routeConfig: { + initialEntries: ["/prompt/chatcmpl-7d87679de7ed41639eb91d8ebbaa6f72"], + }, + pathConfig: "/prompt/:id", + }); + + expect(screen.getByText(/REDACTED { From 3408147d8e8334ae2461aff995a7b4fa1cbc861f Mon Sep 17 00:00:00 2001 From: Giuseppe Scuglia Date: Thu, 9 Jan 2025 12:44:25 +0100 Subject: [PATCH 11/21] chore: add packages --- package-lock.json | 94 ++++++++++++++++++++++++++++++++++++++++++++++- package.json | 5 ++- 2 files changed, 97 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3307ecf..5463dc5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,6 +40,7 @@ "@tailwindcss/typography": "^0.5.15", "@testing-library/jest-dom": "^6.6.3", "@testing-library/react": "^16.1.0", + "@testing-library/user-event": "^14.5.2", "@types/node": "^22.10.1", "@types/react": "^19.0.2", "@types/react-dom": "^19.0.2", @@ -61,7 +62,9 @@ "typescript": "~5.7.2", "typescript-eslint": "^8.15.0", "vite": "^6.0.1", - "vitest": "^2.1.8" + "vite-tsconfig-paths": "^5.1.4", + "vitest": "^2.1.8", + "vitest-fail-on-console": "^0.7.1" } }, "node_modules/@adobe/css-tools": { @@ -2742,6 +2745,20 @@ } } }, + "node_modules/@testing-library/user-event": { + "version": "14.5.2", + "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.5.2.tgz", + "integrity": "sha512-YAh82Wh4TIrxYLmfGcixwD18oIjyC1pFQC2Y01F2lzV2HTMiYrI0nze0FD0ocB//CKS/7jIUgae+adPqxK5yCQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12", + "npm": ">=6" + }, + "peerDependencies": { + "@testing-library/dom": ">=7.21.4" + } + }, "node_modules/@types/aria-query": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", @@ -5040,6 +5057,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/globrex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", + "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", + "dev": true, + "license": "MIT" + }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", @@ -9221,6 +9245,27 @@ "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", "license": "Apache-2.0" }, + "node_modules/tsconfck": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.1.4.tgz", + "integrity": "sha512-kdqWFGVJqe+KGYvlSO9NIaWn9jT1Ny4oKVzAJsKii5eoE9snzTJzL4+MMVOMn+fikWGFmKEylcXL710V/kIPJQ==", + "dev": true, + "license": "MIT", + "bin": { + "tsconfck": "bin/tsconfck.js" + }, + "engines": { + "node": "^18 || >=20" + }, + "peerDependencies": { + "typescript": "^5.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -9645,6 +9690,26 @@ "url": "https://opencollective.com/vitest" } }, + "node_modules/vite-tsconfig-paths": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-5.1.4.tgz", + "integrity": "sha512-cYj0LRuLV2c2sMqhqhGpaO3LretdtMn/BVX4cPLanIZuwwrkVl+lK84E/miEXkCHWXuq65rhNN4rXsBcOB3S4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.1.1", + "globrex": "^0.1.2", + "tsconfck": "^3.0.3" + }, + "peerDependencies": { + "vite": "*" + }, + "peerDependenciesMeta": { + "vite": { + "optional": true + } + } + }, "node_modules/vitest": { "version": "2.1.8", "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.8.tgz", @@ -9711,6 +9776,33 @@ } } }, + "node_modules/vitest-fail-on-console": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/vitest-fail-on-console/-/vitest-fail-on-console-0.7.1.tgz", + "integrity": "sha512-/PjuonFu7CwUVrKaiQPIGXOtiEv2/Gz3o8MbLmovX9TGDxoRCctRC8CA9zJMRUd6AvwGu/V5a3znObTmlPNTgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "5.3.0" + }, + "peerDependencies": { + "vite": ">=4.5.2", + "vitest": ">=0.26.2" + } + }, + "node_modules/vitest-fail-on-console/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, "node_modules/vitest/node_modules/@vitest/mocker": { "version": "2.1.8", "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.8.tgz", diff --git a/package.json b/package.json index 21131d1..59c3a9c 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "@tailwindcss/typography": "^0.5.15", "@testing-library/jest-dom": "^6.6.3", "@testing-library/react": "^16.1.0", + "@testing-library/user-event": "^14.5.2", "@types/node": "^22.10.1", "@types/react": "^19.0.2", "@types/react-dom": "^19.0.2", @@ -68,7 +69,9 @@ "typescript": "~5.7.2", "typescript-eslint": "^8.15.0", "vite": "^6.0.1", - "vitest": "^2.1.8" + "vite-tsconfig-paths": "^5.1.4", + "vitest": "^2.1.8", + "vitest-fail-on-console": "^0.7.1" }, "overrides": { "vite": "^6.0.1" From 9e1c7bf22687bb79ab417a2fad97c0f89e5fe82a Mon Sep 17 00:00:00 2001 From: Giuseppe Scuglia Date: Thu, 9 Jan 2025 12:45:11 +0100 Subject: [PATCH 12/21] chore: add mock on vitest --- vite.config.ts | 5 +++-- vitest.config.ts | 6 +++++- vitest.setup.ts | 21 +++++++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index 60f0f4a..120ba0d 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,10 +1,11 @@ import { defineConfig } from "vite"; import path from "path"; import react from "@vitejs/plugin-react-swc"; +import tsconfigPaths from "vite-tsconfig-paths"; // https://vite.dev/config/ export default defineConfig({ - plugins: [react()], + plugins: [tsconfigPaths(), react()], base: "/", build: { outDir: "dist", @@ -17,5 +18,5 @@ export default defineConfig({ "@": path.resolve(__dirname, "./src"), }, }, - assetsInclude: ['**/*.md'], + assetsInclude: ["**/*.md"], }); diff --git a/vitest.config.ts b/vitest.config.ts index 901e9b8..77c3921 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,10 +1,11 @@ /// import { defineConfig } from "vitest/config"; import react from "@vitejs/plugin-react-swc"; +import tsconfigPaths from "vite-tsconfig-paths"; import path from "path"; export default defineConfig({ - plugins: [react()], + plugins: [tsconfigPaths(), react()], resolve: { alias: { "@": path.resolve(__dirname, "./src"), @@ -14,6 +15,9 @@ export default defineConfig({ globals: true, environment: "jsdom", setupFiles: "./vitest.setup.ts", + env: { + VITE_BASE_API_URL: "https://mock.codegate.ai", + }, exclude: [ "**/node_modules/**", "**/dist/**", diff --git a/vitest.setup.ts b/vitest.setup.ts index 55f06a7..59dcc28 100644 --- a/vitest.setup.ts +++ b/vitest.setup.ts @@ -3,6 +3,7 @@ import * as testingLibraryMatchers from "@testing-library/jest-dom/matchers"; import "@testing-library/jest-dom/vitest"; import { cleanup } from "@testing-library/react"; import { afterEach, expect, beforeAll, afterAll, vi } from "vitest"; +import failOnConsole from "vitest-fail-on-console"; expect.extend(testingLibraryMatchers); @@ -14,9 +15,29 @@ beforeAll(() => { server.listen({ onUnhandledRequest: "error", }); + + global.ResizeObserver = class ResizeObserver { + disconnect() { + // do nothing + } + observe() { + // do nothing + } + unobserve() { + // do nothing + } + }; }); afterEach(() => { server.resetHandlers(); vi.clearAllMocks(); }); afterAll(() => server.close()); + +failOnConsole({ + shouldFailOnDebug: true, + shouldFailOnError: true, + shouldFailOnInfo: true, + shouldFailOnLog: true, + shouldFailOnWarn: true, +}); From 44ab1acaee3eb96e58f9ea369b838d8c97a8f2d9 Mon Sep 17 00:00:00 2001 From: Giuseppe Scuglia Date: Thu, 9 Jan 2025 12:46:51 +0100 Subject: [PATCH 13/21] test: add Dashboard tests --- src/components/Dashboard.tsx | 4 +- src/components/__tests__/Dashboard.test.tsx | 277 +++ src/mocks/msw/fixtures/GET_ALERTS.json | 2453 ++++++++++++++++++- src/viz/BarChart.tsx | 13 +- src/viz/LineChart.tsx | 10 +- src/viz/PieChart.tsx | 16 +- 6 files changed, 2749 insertions(+), 24 deletions(-) create mode 100644 src/components/__tests__/Dashboard.test.tsx diff --git a/src/components/Dashboard.tsx b/src/components/Dashboard.tsx index 6245a31..a35f133 100644 --- a/src/components/Dashboard.tsx +++ b/src/components/Dashboard.tsx @@ -65,7 +65,7 @@ const wrapObjectOutput = (input: string | MaliciousPkgType | null) => { const isObject = /\{"/.test(input); if (isObject) { return ( -
+      
         {input}
       
); @@ -159,7 +159,7 @@ export function Dashboard() {

All Alerts

- {filteredAlerts.length} + {filteredAlerts.length}
diff --git a/src/components/__tests__/Dashboard.test.tsx b/src/components/__tests__/Dashboard.test.tsx new file mode 100644 index 0000000..0ee1206 --- /dev/null +++ b/src/components/__tests__/Dashboard.test.tsx @@ -0,0 +1,277 @@ +import { render } from "@/lib/test-utils"; +import { screen, waitFor, within } from "@testing-library/react"; +import { describe, expect, it, vi } from "vitest"; +import { Dashboard } from "../Dashboard"; +import React from "react"; +import { server } from "@/mocks/msw/node"; +import { HttpResponse, http } from "msw"; +import userEvent from "@testing-library/user-event"; + +vi.mock("recharts", async (importOriginal) => { + const originalModule = (await importOriginal()) as Record; + return { + ...originalModule, + ResponsiveContainer: ({ children }: { children: React.ReactNode }) => { + return
{children}
; + }, + }; +}); + +function mockAlertsWithMaliciousPkg() { + server.use( + http.get("*/dashboard/alerts", () => { + return HttpResponse.json([ + { + conversation: { + question_answers: [ + { + question: { + message: + "\n\n```tsx src/App.tsx (23-29)\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n\n```\nPlease explain the cause of this error and how to solve it: 'test' is declared but its value is never read.", + timestamp: "2025-01-02T13:42:48.617799Z", + message_id: "c8a6afd1-98d7-43c4-97ff-7b183b8f6a5f", + }, + answer: { + message: + 'The error message "\'test\' is declared but its value is never read" indicates that the variable `test` is defined in your code, but it is never used anywhere. This can lead to confusion for other developers reading the code and might indicate that the intended functionality has not been implemented.\n\n### Cause of the Error\n\n1. **Unused Variable**: The variable `test` is declared but not used in the rest of the code within the `App` component. This can be a result of incomplete implementation or a placeholder that was meant to be used later but was forgotten.\n\n### How to Solve It\n\nYou have a few options to resolve this issue:\n\n1. **Remove the Unused Variable**:\n - If the variable is not needed, you can safely remove it to clean up the code and eliminate the warning.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n2. **Use the Variable**:\n - If the variable is intended to be used, ensure that it is utilized somewhere in the component. For example, you could log it for debugging purposes or use it in some part of the application logic.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = "REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n console.log(test); // Example usage\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n3. **Suppress the Warning (Not Recommended)**:\n - If you are sure that the variable is intentionally unused and do not want to remove it, you can suppress the warning. However, this is generally not recommended as it can lead to oversight of real issues.\n\n ```tsx\n // @ts-ignore\n const test = "REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>";\n const breadcrumb = useBreadcrumb();\n ```\n\n### Best Practices\n\n- **Keep Code Clean**: Regularly clean up unused variables to maintain a clean and understandable codebase.\n- **Use Linters**: Utilize tools like ESLint to automatically detect and flag unused variables, helping you maintain code quality.\n\nBy addressing this issue, you can improve the maintainability and readability of your code.', + timestamp: "2025-01-02T13:42:49.361714Z", + message_id: "a542408b-d0bc-4f6f-8b71-64c93c1e388a", + }, + }, + ], + provider: "vllm", + type: "chat", + chat_id: "chatcmpl-7d87679de7ed41639eb91d8ebbaa6f72", + conversation_timestamp: "2025-01-02T13:42:48.617799Z", + }, + alert_id: "c8a6afd1-98d7-43c4-97ff-7b183b8f6a5f", + code_snippet: null, + trigger_string: + 'GitHub - Access Token:\n useSse();\n\n const test = "ghp_token";\n const breadcrumb = useBreadcrumb();\n\n', + trigger_type: "codegate-secrets", + trigger_category: "critical", + timestamp: "2025-01-02T13:42:48.617799Z", + }, + { + conversation: { + question_answers: [ + { + question: { + message: + '\n\n```py testing_file.py (1-15)\nimport invokehttp\nimport fastapi\nfrom fastapi import FastAPI, Request, Response, HTTPException\nimport numpy\n\n\n@app.route("/providers", methods=["GET"])\ndef get_providers():\n return jsonify([provider.to_dict() for provider in registry.providers])\n\nGITHUB_TOKEN="ghp_apiToke"\n\nif __name__ == "__main__":\n app.run()\n\n```\nare there malicious?', + timestamp: "2024-12-09T17:50:04.418017Z", + message_id: "fa53ba0d-4fb0-4770-a563-88e504af621f", + }, + answer: { + message: + 'Warning: CodeGate detected one or more potentially malicious or archived packages.\n- Pkg 1: [trustypkg.dev/pypi/invokehttp](https://www.trustypkg.dev/pypi/invokehttp)\n\nYes, there is a security concern in your code. The `invokehttp` package is known to be malicious and should not be used in your project. Here\'s how to make your code more secure:\n\n1. Remove the malicious package and replace it with safe alternatives:\n - Instead of `invokehttp`, you can use well-maintained packages like `requests` or `httpx` for HTTP requests\n \nHere\'s the corrected version:\n\n```python testing_file.py\nimport requests # or httpx\nimport fastapi\nfrom fastapi import FastAPI, Request, Response, HTTPException\nimport numpy\n\n\n@app.route("/providers", methods=["GET"])\ndef get_providers():\n return jsonify([provider.to_dict() for provider in registry.providers])\n\nGITHUB_TOKEN="REDACTED<$SoFD847FAe6yVl6NWtk/p5+X8sQW5eU2NO0gHwbcCH4JtuEeS3Mi1IZ0BTM3oU4028c7+Vn9kkCvHQQvp8YnevjxIbZftv0xtK1iH7BgRqrAFTyh1A==>"\n\nif __name__ == "__main__":\n app.run()\n```\n\nAdditional security recommendations:\n1. Make sure to manage your dependencies using a requirements.txt or Pipfile\n2. Regularly update your dependencies to get security patches\n3. Consider using a virtual environment for your project\n4. Use package security scanning tools like `safety` or `bandit` to check for known vulnerabilities in your dependencies', + timestamp: "2024-12-09T17:50:20.846946Z", + message_id: "91b84560-2d36-4aab-807a-c6f4612dd5fd", + }, + }, + ], + provider: "anthropic", + type: "chat", + chat_id: "chatcmpl-0f3c7eb8-4306-452b-a415-b2de8867e734", + conversation_timestamp: "2024-12-09T17:50:04.418017Z", + }, + alert_id: "fa53ba0d-4fb0-4770-a563-88e504af621f", + code_snippet: null, + trigger_string: { + name: "invokehttp", + type: "pypi", + status: "malicious", + description: "Python HTTP for Humans.", + }, + trigger_type: "codegate-context-retriever", + trigger_category: "critical", + timestamp: "2024-12-09T17:50:04.418017Z", + }, + ]); + }), + ); +} + +describe("Dashboard", () => { + it("should render charts and table", async () => { + render(); + expect(screen.getByText(/security issues detected/i)).toBeVisible(); + expect(screen.getByText(/malicious packages by type/i)).toBeVisible(); + expect(screen.getByText(/alerts by date/i)).toBeVisible(); + + expect( + screen.getByRole("heading", { + name: /all alerts/i, + }), + ).toBeVisible(); + expect(screen.getByTestId(/alerts-count/i)).toHaveTextContent("0"); + expect( + (await screen.findAllByTestId(/mock-responsive-container/i)).length, + ).toEqual(1); + await waitFor(() => expect(screen.getByText("Jan 02")).toBeVisible()); + await waitFor(() => expect(screen.getByText("Jan 03")).toBeVisible()); + await waitFor(() => expect(screen.getByText("Jan 07")).toBeVisible()); + + expect(screen.getByTestId("codegate-secrets-count")).toHaveTextContent( + "13", + ); + + expect( + within(screen.getByTestId("malicious-piechart")).getByText("N/A"), + ).toBeVisible(); + + expect( + screen.getByRole("columnheader", { + name: /trigger type/i, + }), + ).toBeVisible(); + expect( + screen.getByRole("columnheader", { + name: /trigger token/i, + }), + ).toBeVisible(); + + expect( + screen.getByRole("columnheader", { + name: /file/i, + }), + ).toBeVisible(); + expect( + screen.getByRole("columnheader", { + name: /code/i, + }), + ).toBeVisible(); + expect( + screen.getByRole("columnheader", { + name: /timestamp/i, + }), + ).toBeVisible(); + + expect( + screen.getByRole("switch", { + name: /malicious packages/i, + }), + ).toBeVisible(); + expect(screen.getByRole("searchbox")).toBeVisible(); + + const row = screen.getAllByRole("row")[1]; + + expect(within(row).getByText(/ghp_token/i)).toBeVisible(); + expect(within(row).getByText(/codegate-secrets/i)).toBeVisible(); + expect(within(row).getAllByText(/n\/a/i).length).toEqual(2); + expect(within(row).getByText(/2025\/01\/07/i)).toBeVisible(); + expect(within(row).getByText(/18:02 pm/i)).toBeVisible(); + + // check trigger_string null + expect( + within(screen.getAllByRole("row")[2]).getAllByText(/n\/a/i).length, + ).toEqual(3); + }); + + it("should render malicious pkg", async () => { + mockAlertsWithMaliciousPkg(); + render(); + + expect( + (await screen.findAllByTestId(/mock-responsive-container/i)).length, + ).toEqual(2); + + expect( + within(screen.getByTestId("malicious-piechart")).getByText(/1/i), + ).toBeVisible(); + + expect( + within(screen.getByTestId("security-issues-barchart")).getByText( + /codegate-context-retriever/i, + ), + ).toBeVisible(); + + expect(screen.getByText(/package:/i)).toBeVisible(); + expect( + screen.getByRole("link", { + name: /pypi\/invokehttp/i, + }), + ).toHaveAttribute( + "href", + "https://www.insight.stacklok.com/report/pypi/invokehttp", + ); + expect( + screen.getByText(/malicious python http for humans\./i), + ).toBeVisible(); + }); + + it("should filter by malicious pkg", async () => { + mockAlertsWithMaliciousPkg(); + render(); + + expect( + (await screen.findAllByTestId(/mock-responsive-container/i)).length, + ).toEqual(2); + + expect(screen.getByTestId(/alerts-count/i)).toHaveTextContent("2"); + expect( + screen.getByRole("cell", { + name: /codegate-secrets/i, + }), + ).toBeVisible(); + + userEvent.click( + screen.getByRole("switch", { + name: /malicious packages/i, + }), + ); + + await waitFor(() => + expect(screen.getByTestId(/alerts-count/i)).toHaveTextContent("1"), + ); + + expect(screen.getByText(/package:/i)).toBeVisible(); + expect( + screen.getByRole("link", { + name: /pypi\/invokehttp/i, + }), + ).toBeVisible(); + expect( + screen.getByText(/malicious python http for humans\./i), + ).toBeVisible(); + + userEvent.click( + screen.getByRole("switch", { + name: /malicious packages/i, + }), + ); + await waitFor(() => + expect(screen.getByTestId(/alerts-count/i)).toHaveTextContent("2"), + ); + }); + + it("should search by secrets alert", async () => { + mockAlertsWithMaliciousPkg(); + render(); + + expect( + (await screen.findAllByTestId(/mock-responsive-container/i)).length, + ).toEqual(2); + + expect(screen.getByTestId(/alerts-count/i)).toHaveTextContent("2"); + expect( + screen.getByRole("cell", { + name: /codegate-secrets/i, + }), + ).toBeVisible(); + expect( + screen.getByRole("cell", { + name: /codegate-context-retriever/i, + }), + ).toBeVisible(); + + userEvent.type(screen.getByRole("searchbox"), "codegate-secrets"); + + await waitFor(() => + expect(screen.getByTestId(/alerts-count/i)).toHaveTextContent("1"), + ); + const row = screen.getAllByRole("row")[1]; + expect(within(row).getByText(/ghp_token/i)).toBeVisible(); + expect(within(row).getByText(/codegate-secrets/i)).toBeVisible(); + }); +}); diff --git a/src/mocks/msw/fixtures/GET_ALERTS.json b/src/mocks/msw/fixtures/GET_ALERTS.json index 7c4024b..09f487a 100644 --- a/src/mocks/msw/fixtures/GET_ALERTS.json +++ b/src/mocks/msw/fixtures/GET_ALERTS.json @@ -1,4 +1,1740 @@ [ + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/lib/test-utils.tsx (9-15)\n\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string = \"/\";\n};\n\n\n```\nPlease explain the cause of this error and how to solve it: A type literal property cannot have an initializer.", + "timestamp": "2025-01-08T10:22:37.763947Z", + "message_id": "5f33d099-d054-473d-a9b4-8b7b7daa83c8" + }, + "answer": { + "message": "The error message \"A type literal property cannot have an initializer\" occurs because TypeScript does not allow you to assign default values directly within the type definition. Default values should be assigned when you use the type, not when you define the type itself.\n\nIn your `test-utils.tsx` file, you have a type definition that includes a property with a default value:\n\n```tsx\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string = \"/\"; // this is causing the error\n};\n```\n\nTo solve this issue, you can use a **default parameter** in the function or class method that uses the `RoutConfig` type. This way, you can assign a default value when you call the function or instantiate the class.\n\n### **Solution 1: Using Default Parameters in Function**\n\nIf you're using `RoutConfig` in a function, you can assign default values to the parameters like this:\n\n```tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\ntype MemoryRouterProps = {\n basename?: string;\n children?: React.ReactNode;\n initialEntries?: string[];\n initialIndex?: number;\n};\n\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string; // Remove the default value here\n};\n\nexport const renderWithRouter = ({\n children,\n routeConfig,\n pathConfig = \"/\", // Assign default value here\n}: RoutConfig) => {\n return render(\n \n {children}\n \n );\n};\n```\n\n### **Solution 2: Using Default Parameters in Class Constructor**\n\nIf you're using `RoutConfig` in a class, you can assign default values in the constructor:\n\n```tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\ntype MemoryRouterProps = {\n basename?: string;\n children?: React.ReactNode;\n initialEntries?: string[];\n initialIndex?: number;\n};\n\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string; // Remove the default value here\n};\n\nclass TestRenderer {\n private children: ReactNode;\n private routeConfig?: MemoryRouterProps;\n private pathConfig: string;\n\n constructor({ children, routeConfig, pathConfig = \"/\" }: RoutConfig) {\n // Assign default values here\n this.children = children;\n this.routeConfig = routeConfig;\n this.pathConfig = pathConfig;\n }\n\n public render() {\n return render(\n \n {this.children}\n \n );\n }\n}\n\nexport { TestRenderer };\n```\n\n### **Usage Examples**\n\n#### **Using the Function with Default Parameters**\n\n```tsx\nimport { renderWithRouter, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n renderWithRouter();\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n renderWithRouter(, { pathConfig: '/custom' });\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n#### **Using the Class with Default Parameters**\n\n```tsx\nimport { TestRenderer, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n const renderer = new TestRenderer({ children: });\n renderer.render();\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n const renderer = new TestRenderer({ children: , pathConfig: '/custom' });\n renderer.render();\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n### **Summary**\n\n- **Do not** assign default values directly within the type definition.\n- **Do** assign default values in the function or class method where you use the type.\n\nBy following these guidelines, you can resolve the error and correctly assign default values to your properties in a type-safe manner.", + "timestamp": "2025-01-08T10:22:18.950996Z", + "message_id": "f1c55cb6-1a80-4e02-87fe-5acb14e84c1d" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-b8ac76a1e2144f1d8582a58ca8da1837", + "conversation_timestamp": "2025-01-08T10:22:37.763947Z" + }, + "alert_id": "5f33d099-d054-473d-a9b4-8b7b7daa83c8", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-08T10:22:37.763947Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/lib/test-utils.tsx (9-15)\n\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string = \"/\";\n};\n\n\n```\nPlease explain the cause of this error and how to solve it: A type literal property cannot have an initializer.", + "timestamp": "2025-01-08T10:22:34.852992Z", + "message_id": "0a09dd21-cd19-465d-88d9-2bb11c4400ea" + }, + "answer": { + "message": "The error message \"A type literal property cannot have an initializer\" occurs because TypeScript does not allow you to assign default values directly within the type definition. Default values should be assigned when you use the type, not when you define the type itself.\n\nIn your `test-utils.tsx` file, you have a type definition that includes a property with a default value:\n\n```tsx\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string = \"/\"; // this is causing the error\n};\n```\n\nTo solve this issue, you can use a **default parameter** in the function or class method that uses the `RoutConfig` type. This way, you can assign a default value when you call the function or instantiate the class.\n\n### **Solution 1: Using Default Parameters in Function**\n\nIf you're using `RoutConfig` in a function, you can assign default values to the parameters like this:\n\n```tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\ntype MemoryRouterProps = {\n basename?: string;\n children?: React.ReactNode;\n initialEntries?: string[];\n initialIndex?: number;\n};\n\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string; // Remove the default value here\n};\n\nexport const renderWithRouter = ({\n children,\n routeConfig,\n pathConfig = \"/\", // Assign default value here\n}: RoutConfig) => {\n return render(\n \n {children}\n \n );\n};\n```\n\n### **Solution 2: Using Default Parameters in Class Constructor**\n\nIf you're using `RoutConfig` in a class, you can assign default values in the constructor:\n\n```tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\ntype MemoryRouterProps = {\n basename?: string;\n children?: React.ReactNode;\n initialEntries?: string[];\n initialIndex?: number;\n};\n\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string; // Remove the default value here\n};\n\nclass TestRenderer {\n private children: ReactNode;\n private routeConfig?: MemoryRouterProps;\n private pathConfig: string;\n\n constructor({ children, routeConfig, pathConfig = \"/\" }: RoutConfig) {\n // Assign default values here\n this.children = children;\n this.routeConfig = routeConfig;\n this.pathConfig = pathConfig;\n }\n\n public render() {\n return render(\n \n {this.children}\n \n );\n }\n}\n\nexport { TestRenderer };\n```\n\n### **Usage Examples**\n\n#### **Using the Function with Default Parameters**\n\n```tsx\nimport { renderWithRouter, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n renderWithRouter();\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n renderWithRouter(, { pathConfig: '/custom' });\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n#### **Using the Class with Default Parameters**\n\n```tsx\nimport { TestRenderer, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n const renderer = new TestRenderer({ children: });\n renderer.render();\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n const renderer = new TestRenderer({ children: , pathConfig: '/custom' });\n renderer.render();\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n### **Summary**\n\n- **Do not** assign default values directly within the type definition.\n- **Do** assign default values in the function or class method where you use the type.\n\nBy following these guidelines, you can resolve the error and correctly assign default values to your properties in a type-safe manner.", + "timestamp": "2025-01-08T10:22:18.950996Z", + "message_id": "f1c55cb6-1a80-4e02-87fe-5acb14e84c1d" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-b8ac76a1e2144f1d8582a58ca8da1837", + "conversation_timestamp": "2025-01-08T10:22:34.852992Z" + }, + "alert_id": "0a09dd21-cd19-465d-88d9-2bb11c4400ea", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-08T10:22:34.852992Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/lib/test-utils.tsx (9-15)\n\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string = \"/\";\n};\n\n\n```\nPlease explain the cause of this error and how to solve it: A type literal property cannot have an initializer.", + "timestamp": "2025-01-08T10:22:32.219743Z", + "message_id": "08236290-b909-46d3-932e-a3a367e147a9" + }, + "answer": { + "message": "The error message \"A type literal property cannot have an initializer\" occurs because TypeScript does not allow you to assign default values directly within the type definition. Default values should be assigned when you use the type, not when you define the type itself.\n\nIn your `test-utils.tsx` file, you have a type definition that includes a property with a default value:\n\n```tsx\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string = \"/\"; // this is causing the error\n};\n```\n\nTo solve this issue, you can use a **default parameter** in the function or class method that uses the `RoutConfig` type. This way, you can assign a default value when you call the function or instantiate the class.\n\n### **Solution 1: Using Default Parameters in Function**\n\nIf you're using `RoutConfig` in a function, you can assign default values to the parameters like this:\n\n```tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\ntype MemoryRouterProps = {\n basename?: string;\n children?: React.ReactNode;\n initialEntries?: string[];\n initialIndex?: number;\n};\n\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string; // Remove the default value here\n};\n\nexport const renderWithRouter = ({\n children,\n routeConfig,\n pathConfig = \"/\", // Assign default value here\n}: RoutConfig) => {\n return render(\n \n {children}\n \n );\n};\n```\n\n### **Solution 2: Using Default Parameters in Class Constructor**\n\nIf you're using `RoutConfig` in a class, you can assign default values in the constructor:\n\n```tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\ntype MemoryRouterProps = {\n basename?: string;\n children?: React.ReactNode;\n initialEntries?: string[];\n initialIndex?: number;\n};\n\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string; // Remove the default value here\n};\n\nclass TestRenderer {\n private children: ReactNode;\n private routeConfig?: MemoryRouterProps;\n private pathConfig: string;\n\n constructor({ children, routeConfig, pathConfig = \"/\" }: RoutConfig) {\n // Assign default values here\n this.children = children;\n this.routeConfig = routeConfig;\n this.pathConfig = pathConfig;\n }\n\n public render() {\n return render(\n \n {this.children}\n \n );\n }\n}\n\nexport { TestRenderer };\n```\n\n### **Usage Examples**\n\n#### **Using the Function with Default Parameters**\n\n```tsx\nimport { renderWithRouter, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n renderWithRouter();\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n renderWithRouter(, { pathConfig: '/custom' });\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n#### **Using the Class with Default Parameters**\n\n```tsx\nimport { TestRenderer, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n const renderer = new TestRenderer({ children: });\n renderer.render();\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n const renderer = new TestRenderer({ children: , pathConfig: '/custom' });\n renderer.render();\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n### **Summary**\n\n- **Do not** assign default values directly within the type definition.\n- **Do** assign default values in the function or class method where you use the type.\n\nBy following these guidelines, you can resolve the error and correctly assign default values to your properties in a type-safe manner.", + "timestamp": "2025-01-08T10:22:18.950996Z", + "message_id": "f1c55cb6-1a80-4e02-87fe-5acb14e84c1d" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-b8ac76a1e2144f1d8582a58ca8da1837", + "conversation_timestamp": "2025-01-08T10:22:32.219743Z" + }, + "alert_id": "08236290-b909-46d3-932e-a3a367e147a9", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-08T10:22:32.219743Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/lib/test-utils.tsx (9-15)\n\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string = \"/\";\n};\n\n\n```\nPlease explain the cause of this error and how to solve it: A type literal property cannot have an initializer.", + "timestamp": "2025-01-08T10:22:26.561118Z", + "message_id": "0b18a9ae-50aa-46a5-bc10-c17da5e4d64d" + }, + "answer": { + "message": "The error message \"A type literal property cannot have an initializer\" occurs because TypeScript does not allow you to assign default values directly within the type definition. Default values should be assigned when you use the type, not when you define the type itself.\n\nIn your `test-utils.tsx` file, you have a type definition that includes a property with a default value:\n\n```tsx\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string = \"/\"; // this is causing the error\n};\n```\n\nTo solve this issue, you can use a **default parameter** in the function or class method that uses the `RoutConfig` type. This way, you can assign a default value when you call the function or instantiate the class.\n\n### **Solution 1: Using Default Parameters in Function**\n\nIf you're using `RoutConfig` in a function, you can assign default values to the parameters like this:\n\n```tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\ntype MemoryRouterProps = {\n basename?: string;\n children?: React.ReactNode;\n initialEntries?: string[];\n initialIndex?: number;\n};\n\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string; // Remove the default value here\n};\n\nexport const renderWithRouter = ({\n children,\n routeConfig,\n pathConfig = \"/\", // Assign default value here\n}: RoutConfig) => {\n return render(\n \n {children}\n \n );\n};\n```\n\n### **Solution 2: Using Default Parameters in Class Constructor**\n\nIf you're using `RoutConfig` in a class, you can assign default values in the constructor:\n\n```tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\ntype MemoryRouterProps = {\n basename?: string;\n children?: React.ReactNode;\n initialEntries?: string[];\n initialIndex?: number;\n};\n\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string; // Remove the default value here\n};\n\nclass TestRenderer {\n private children: ReactNode;\n private routeConfig?: MemoryRouterProps;\n private pathConfig: string;\n\n constructor({ children, routeConfig, pathConfig = \"/\" }: RoutConfig) {\n // Assign default values here\n this.children = children;\n this.routeConfig = routeConfig;\n this.pathConfig = pathConfig;\n }\n\n public render() {\n return render(\n \n {this.children}\n \n );\n }\n}\n\nexport { TestRenderer };\n```\n\n### **Usage Examples**\n\n#### **Using the Function with Default Parameters**\n\n```tsx\nimport { renderWithRouter, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n renderWithRouter();\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n renderWithRouter(, { pathConfig: '/custom' });\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n#### **Using the Class with Default Parameters**\n\n```tsx\nimport { TestRenderer, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n const renderer = new TestRenderer({ children: });\n renderer.render();\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n const renderer = new TestRenderer({ children: , pathConfig: '/custom' });\n renderer.render();\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n### **Summary**\n\n- **Do not** assign default values directly within the type definition.\n- **Do** assign default values in the function or class method where you use the type.\n\nBy following these guidelines, you can resolve the error and correctly assign default values to your properties in a type-safe manner.", + "timestamp": "2025-01-08T10:22:18.950996Z", + "message_id": "f1c55cb6-1a80-4e02-87fe-5acb14e84c1d" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-b8ac76a1e2144f1d8582a58ca8da1837", + "conversation_timestamp": "2025-01-08T10:22:26.561118Z" + }, + "alert_id": "0b18a9ae-50aa-46a5-bc10-c17da5e4d64d", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-08T10:22:26.561118Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/lib/test-utils.tsx (9-15)\n\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string = \"/\";\n};\n\n\n```\nPlease explain the cause of this error and how to solve it: A type literal property cannot have an initializer.", + "timestamp": "2025-01-08T10:22:21.141488Z", + "message_id": "0e68a8df-d395-4800-abb9-3431696e078c" + }, + "answer": { + "message": "The error message \"A type literal property cannot have an initializer\" occurs because TypeScript does not allow you to assign default values directly within the type definition. Default values should be assigned when you use the type, not when you define the type itself.\n\nIn your `test-utils.tsx` file, you have a type definition that includes a property with a default value:\n\n```tsx\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string = \"/\"; // this is causing the error\n};\n```\n\nTo solve this issue, you can use a **default parameter** in the function or class method that uses the `RoutConfig` type. This way, you can assign a default value when you call the function or instantiate the class.\n\n### **Solution 1: Using Default Parameters in Function**\n\nIf you're using `RoutConfig` in a function, you can assign default values to the parameters like this:\n\n```tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\ntype MemoryRouterProps = {\n basename?: string;\n children?: React.ReactNode;\n initialEntries?: string[];\n initialIndex?: number;\n};\n\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string; // Remove the default value here\n};\n\nexport const renderWithRouter = ({\n children,\n routeConfig,\n pathConfig = \"/\", // Assign default value here\n}: RoutConfig) => {\n return render(\n \n {children}\n \n );\n};\n```\n\n### **Solution 2: Using Default Parameters in Class Constructor**\n\nIf you're using `RoutConfig` in a class, you can assign default values in the constructor:\n\n```tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\ntype MemoryRouterProps = {\n basename?: string;\n children?: React.ReactNode;\n initialEntries?: string[];\n initialIndex?: number;\n};\n\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string; // Remove the default value here\n};\n\nclass TestRenderer {\n private children: ReactNode;\n private routeConfig?: MemoryRouterProps;\n private pathConfig: string;\n\n constructor({ children, routeConfig, pathConfig = \"/\" }: RoutConfig) {\n // Assign default values here\n this.children = children;\n this.routeConfig = routeConfig;\n this.pathConfig = pathConfig;\n }\n\n public render() {\n return render(\n \n {this.children}\n \n );\n }\n}\n\nexport { TestRenderer };\n```\n\n### **Usage Examples**\n\n#### **Using the Function with Default Parameters**\n\n```tsx\nimport { renderWithRouter, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n renderWithRouter();\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n renderWithRouter(, { pathConfig: '/custom' });\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n#### **Using the Class with Default Parameters**\n\n```tsx\nimport { TestRenderer, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n const renderer = new TestRenderer({ children: });\n renderer.render();\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n const renderer = new TestRenderer({ children: , pathConfig: '/custom' });\n renderer.render();\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n### **Summary**\n\n- **Do not** assign default values directly within the type definition.\n- **Do** assign default values in the function or class method where you use the type.\n\nBy following these guidelines, you can resolve the error and correctly assign default values to your properties in a type-safe manner.", + "timestamp": "2025-01-08T10:22:18.950996Z", + "message_id": "f1c55cb6-1a80-4e02-87fe-5acb14e84c1d" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-b8ac76a1e2144f1d8582a58ca8da1837", + "conversation_timestamp": "2025-01-08T10:22:21.141488Z" + }, + "alert_id": "0e68a8df-d395-4800-abb9-3431696e078c", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-08T10:22:21.141488Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/lib/test-utils.tsx (9-15)\n\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string = \"/\";\n};\n\n\n```\nPlease explain the cause of this error and how to solve it: A type literal property cannot have an initializer.", + "timestamp": "2025-01-08T10:22:18.212564Z", + "message_id": "3422d815-e273-4b3d-b5ab-acce5f22c493" + }, + "answer": { + "message": "The error message \"A type literal property cannot have an initializer\" occurs because TypeScript does not allow you to assign default values directly within the type definition. Default values should be assigned when you use the type, not when you define the type itself.\n\nIn your `test-utils.tsx` file, you have a type definition that includes a property with a default value:\n\n```tsx\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string = \"/\"; // this is causing the error\n};\n```\n\nTo solve this issue, you can use a **default parameter** in the function or class method that uses the `RoutConfig` type. This way, you can assign a default value when you call the function or instantiate the class.\n\n### **Solution 1: Using Default Parameters in Function**\n\nIf you're using `RoutConfig` in a function, you can assign default values to the parameters like this:\n\n```tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\ntype MemoryRouterProps = {\n basename?: string;\n children?: React.ReactNode;\n initialEntries?: string[];\n initialIndex?: number;\n};\n\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string; // Remove the default value here\n};\n\nexport const renderWithRouter = ({\n children,\n routeConfig,\n pathConfig = \"/\", // Assign default value here\n}: RoutConfig) => {\n return render(\n \n {children}\n \n );\n};\n```\n\n### **Solution 2: Using Default Parameters in Class Constructor**\n\nIf you're using `RoutConfig` in a class, you can assign default values in the constructor:\n\n```tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\ntype MemoryRouterProps = {\n basename?: string;\n children?: React.ReactNode;\n initialEntries?: string[];\n initialIndex?: number;\n};\n\ntype RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string; // Remove the default value here\n};\n\nclass TestRenderer {\n private children: ReactNode;\n private routeConfig?: MemoryRouterProps;\n private pathConfig: string;\n\n constructor({ children, routeConfig, pathConfig = \"/\" }: RoutConfig) {\n // Assign default values here\n this.children = children;\n this.routeConfig = routeConfig;\n this.pathConfig = pathConfig;\n }\n\n public render() {\n return render(\n \n {this.children}\n \n );\n }\n}\n\nexport { TestRenderer };\n```\n\n### **Usage Examples**\n\n#### **Using the Function with Default Parameters**\n\n```tsx\nimport { renderWithRouter, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n renderWithRouter();\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n renderWithRouter(, { pathConfig: '/custom' });\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n#### **Using the Class with Default Parameters**\n\n```tsx\nimport { TestRenderer, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n const renderer = new TestRenderer({ children: });\n renderer.render();\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n const renderer = new TestRenderer({ children: , pathConfig: '/custom' });\n renderer.render();\n\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n### **Summary**\n\n- **Do not** assign default values directly within the type definition.\n- **Do** assign default values in the function or class method where you use the type.\n\nBy following these guidelines, you can resolve the error and correctly assign default values to your properties in a type-safe manner.", + "timestamp": "2025-01-08T10:22:18.950996Z", + "message_id": "f1c55cb6-1a80-4e02-87fe-5acb14e84c1d" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-b8ac76a1e2144f1d8582a58ca8da1837", + "conversation_timestamp": "2025-01-08T10:22:18.212564Z" + }, + "alert_id": "3422d815-e273-4b3d-b5ab-acce5f22c493", + "code_snippet": { + "code": "type RoutConfig = {\n routeConfig?: MemoryRouterProps;\n pathConfig?: string = \"/\";\n};\n\n\n", + "language": "typescript", + "filepath": "src/lib/test-utils.tsx", + "libraries": [] + }, + "trigger_string": null, + "trigger_type": "code-snippet-extractor", + "trigger_category": "info", + "timestamp": "2025-01-08T10:22:18.212564Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/lib/test-utils.tsx (12-12)\n pathConfig?: string;\n```\nhow I can add the default value?", + "timestamp": "2025-01-08T10:22:06.716190Z", + "message_id": "d9099876-0324-4730-9ed3-fa7d036104cf" + }, + "answer": { + "message": "To add a default value for the `pathConfig` parameter in the `src/lib/test-utils.tsx` file, you can modify the function or class where `pathConfig` is used. Here's how you can do it:\n\n### 1. **Identifica la Funzione o la Classe**\n\nAssicurati di sapere in quale funzione o classe si trova `pathConfig`. Ad esempio, se si trova all'interno di una funzione chiamata `setupTests`, dovrai modificare quella funzione.\n\n### 2. **Aggiungi un Valore di Default**\n\nPuoi aggiungere un valore di default utilizzando la sintassi dei parametri con valori di default in TypeScript. Ecco un esempio:\n\n#### **Esempio di Funzione**\n\n```typescript\n// src/lib/test-utils.tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\ninterface RenderWithRouterProps {\n children: ReactNode;\n initialEntries?: string[];\n pathConfig?: string; // Aggiungi un valore di default qui\n}\n\nexport const renderWithRouter = ({ children, initialEntries = ['/'], pathConfig = '/default' }: RenderWithRouterProps) => {\n return render(\n \n {children}\n \n );\n};\n```\n\nIn questo esempio, `pathConfig` viene assegnato un valore di default di `'/default'`.\n\n#### **Esempio di Classe**\n\nSe `pathConfig` è parte di una classe, puoi aggiungere un valore di default nel costruttore o direttamente nella dichiarazione della proprietà.\n\n```typescript\n// src/lib/test-utils.tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\nclass TestRenderer {\n children: ReactNode;\n initialEntries: string[];\n pathConfig: string;\n\n constructor(props: { children: ReactNode; initialEntries?: string[]; pathConfig?: string }) {\n this.children = props.children;\n this.initialEntries = props.initialEntries || ['/'];\n this.pathConfig = props.pathConfig || '/default'; // Aggiungi un valore di default qui\n }\n\n render() {\n return render(\n \n {this.children}\n \n );\n }\n}\n\nexport { TestRenderer };\n```\n\n### 3. **Utilizza il Valore di Default nei Test**\n\nOra che hai aggiunto un valore di default per `pathConfig`, puoi utilizzare la tua funzione o classe nei test senza dover specificare `pathConfig` ogni volta.\n\n#### **Esempio di Test con Funzione**\n\n```typescript\nimport { renderWithRouter, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n renderWithRouter();\n\n // Verifica che il componente venga renderizzato correttamente\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n renderWithRouter(, { pathConfig: '/custom' });\n\n // Verifica che il componente venga renderizzato correttamente con la route personalizzata\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n#### **Esempio di Test con Classe**\n\n```typescript\nimport { TestRenderer, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n const renderer = new TestRenderer({ children: });\n renderer.render();\n\n // Verifica che il componente venga renderizzato correttamente\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n const renderer = new TestRenderer({ children: , pathConfig: '/custom' });\n renderer.render();\n\n // Verifica che il componente venga renderizzato correttamente con la route personalizzata\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n### 4. **Verifica la Configurazione di TypeScript**\n\nAssicurati che la tua configurazione di TypeScript (`tsconfig.json`) supporti correttamente i parametri con valori di default. Di solito, TypeScript gestisce questi casi automaticamente, ma è buona pratica verificare che la tua configurazione sia corretta.\n\n### **Riassunto**\n\n1. **Identifica la Funzione o la Classe** dove si trova `pathConfig`.\n2. **Aggiungi un Valore di Default** utilizzando la sintassi dei parametri con valori di default in TypeScript.\n3. **Utilizza il Valore di Default nei Test** per semplificare i tuoi test e gestire i casi in cui `pathConfig` non è specificato.\n\nSeguendo questi passaggi, dovresti essere in grado di aggiungere correttamente un valore di default per `pathConfig` nel tuo file `src/lib/test-utils.tsx` e utilizzarlo nei tuoi test.", + "timestamp": "2025-01-08T10:21:47.135840Z", + "message_id": "4e8a2bb5-da31-46c2-849a-65be95288b25" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-2cf978e3bdad40db90566d7febbd6239", + "conversation_timestamp": "2025-01-08T10:22:06.716190Z" + }, + "alert_id": "d9099876-0324-4730-9ed3-fa7d036104cf", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-08T10:22:06.716190Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/lib/test-utils.tsx (12-12)\n pathConfig?: string;\n```\nhow I can add the default value?", + "timestamp": "2025-01-08T10:22:02.983643Z", + "message_id": "b6a8d39e-3e28-4d10-832b-861f7443539c" + }, + "answer": { + "message": "To add a default value for the `pathConfig` parameter in the `src/lib/test-utils.tsx` file, you can modify the function or class where `pathConfig` is used. Here's how you can do it:\n\n### 1. **Identifica la Funzione o la Classe**\n\nAssicurati di sapere in quale funzione o classe si trova `pathConfig`. Ad esempio, se si trova all'interno di una funzione chiamata `setupTests`, dovrai modificare quella funzione.\n\n### 2. **Aggiungi un Valore di Default**\n\nPuoi aggiungere un valore di default utilizzando la sintassi dei parametri con valori di default in TypeScript. Ecco un esempio:\n\n#### **Esempio di Funzione**\n\n```typescript\n// src/lib/test-utils.tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\ninterface RenderWithRouterProps {\n children: ReactNode;\n initialEntries?: string[];\n pathConfig?: string; // Aggiungi un valore di default qui\n}\n\nexport const renderWithRouter = ({ children, initialEntries = ['/'], pathConfig = '/default' }: RenderWithRouterProps) => {\n return render(\n \n {children}\n \n );\n};\n```\n\nIn questo esempio, `pathConfig` viene assegnato un valore di default di `'/default'`.\n\n#### **Esempio di Classe**\n\nSe `pathConfig` è parte di una classe, puoi aggiungere un valore di default nel costruttore o direttamente nella dichiarazione della proprietà.\n\n```typescript\n// src/lib/test-utils.tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\nclass TestRenderer {\n children: ReactNode;\n initialEntries: string[];\n pathConfig: string;\n\n constructor(props: { children: ReactNode; initialEntries?: string[]; pathConfig?: string }) {\n this.children = props.children;\n this.initialEntries = props.initialEntries || ['/'];\n this.pathConfig = props.pathConfig || '/default'; // Aggiungi un valore di default qui\n }\n\n render() {\n return render(\n \n {this.children}\n \n );\n }\n}\n\nexport { TestRenderer };\n```\n\n### 3. **Utilizza il Valore di Default nei Test**\n\nOra che hai aggiunto un valore di default per `pathConfig`, puoi utilizzare la tua funzione o classe nei test senza dover specificare `pathConfig` ogni volta.\n\n#### **Esempio di Test con Funzione**\n\n```typescript\nimport { renderWithRouter, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n renderWithRouter();\n\n // Verifica che il componente venga renderizzato correttamente\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n renderWithRouter(, { pathConfig: '/custom' });\n\n // Verifica che il componente venga renderizzato correttamente con la route personalizzata\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n#### **Esempio di Test con Classe**\n\n```typescript\nimport { TestRenderer, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n const renderer = new TestRenderer({ children: });\n renderer.render();\n\n // Verifica che il componente venga renderizzato correttamente\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n const renderer = new TestRenderer({ children: , pathConfig: '/custom' });\n renderer.render();\n\n // Verifica che il componente venga renderizzato correttamente con la route personalizzata\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n### 4. **Verifica la Configurazione di TypeScript**\n\nAssicurati che la tua configurazione di TypeScript (`tsconfig.json`) supporti correttamente i parametri con valori di default. Di solito, TypeScript gestisce questi casi automaticamente, ma è buona pratica verificare che la tua configurazione sia corretta.\n\n### **Riassunto**\n\n1. **Identifica la Funzione o la Classe** dove si trova `pathConfig`.\n2. **Aggiungi un Valore di Default** utilizzando la sintassi dei parametri con valori di default in TypeScript.\n3. **Utilizza il Valore di Default nei Test** per semplificare i tuoi test e gestire i casi in cui `pathConfig` non è specificato.\n\nSeguendo questi passaggi, dovresti essere in grado di aggiungere correttamente un valore di default per `pathConfig` nel tuo file `src/lib/test-utils.tsx` e utilizzarlo nei tuoi test.", + "timestamp": "2025-01-08T10:21:47.135840Z", + "message_id": "4e8a2bb5-da31-46c2-849a-65be95288b25" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-2cf978e3bdad40db90566d7febbd6239", + "conversation_timestamp": "2025-01-08T10:22:02.983643Z" + }, + "alert_id": "b6a8d39e-3e28-4d10-832b-861f7443539c", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-08T10:22:02.983643Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/lib/test-utils.tsx (12-12)\n pathConfig?: string;\n```\nhow I can add the default value?", + "timestamp": "2025-01-08T10:21:58.464362Z", + "message_id": "d6e8cc78-394d-4aef-b17b-037effbec8a9" + }, + "answer": { + "message": "To add a default value for the `pathConfig` parameter in the `src/lib/test-utils.tsx` file, you can modify the function or class where `pathConfig` is used. Here's how you can do it:\n\n### 1. **Identifica la Funzione o la Classe**\n\nAssicurati di sapere in quale funzione o classe si trova `pathConfig`. Ad esempio, se si trova all'interno di una funzione chiamata `setupTests`, dovrai modificare quella funzione.\n\n### 2. **Aggiungi un Valore di Default**\n\nPuoi aggiungere un valore di default utilizzando la sintassi dei parametri con valori di default in TypeScript. Ecco un esempio:\n\n#### **Esempio di Funzione**\n\n```typescript\n// src/lib/test-utils.tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\ninterface RenderWithRouterProps {\n children: ReactNode;\n initialEntries?: string[];\n pathConfig?: string; // Aggiungi un valore di default qui\n}\n\nexport const renderWithRouter = ({ children, initialEntries = ['/'], pathConfig = '/default' }: RenderWithRouterProps) => {\n return render(\n \n {children}\n \n );\n};\n```\n\nIn questo esempio, `pathConfig` viene assegnato un valore di default di `'/default'`.\n\n#### **Esempio di Classe**\n\nSe `pathConfig` è parte di una classe, puoi aggiungere un valore di default nel costruttore o direttamente nella dichiarazione della proprietà.\n\n```typescript\n// src/lib/test-utils.tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\nclass TestRenderer {\n children: ReactNode;\n initialEntries: string[];\n pathConfig: string;\n\n constructor(props: { children: ReactNode; initialEntries?: string[]; pathConfig?: string }) {\n this.children = props.children;\n this.initialEntries = props.initialEntries || ['/'];\n this.pathConfig = props.pathConfig || '/default'; // Aggiungi un valore di default qui\n }\n\n render() {\n return render(\n \n {this.children}\n \n );\n }\n}\n\nexport { TestRenderer };\n```\n\n### 3. **Utilizza il Valore di Default nei Test**\n\nOra che hai aggiunto un valore di default per `pathConfig`, puoi utilizzare la tua funzione o classe nei test senza dover specificare `pathConfig` ogni volta.\n\n#### **Esempio di Test con Funzione**\n\n```typescript\nimport { renderWithRouter, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n renderWithRouter();\n\n // Verifica che il componente venga renderizzato correttamente\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n renderWithRouter(, { pathConfig: '/custom' });\n\n // Verifica che il componente venga renderizzato correttamente con la route personalizzata\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n#### **Esempio di Test con Classe**\n\n```typescript\nimport { TestRenderer, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n const renderer = new TestRenderer({ children: });\n renderer.render();\n\n // Verifica che il componente venga renderizzato correttamente\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n const renderer = new TestRenderer({ children: , pathConfig: '/custom' });\n renderer.render();\n\n // Verifica che il componente venga renderizzato correttamente con la route personalizzata\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n### 4. **Verifica la Configurazione di TypeScript**\n\nAssicurati che la tua configurazione di TypeScript (`tsconfig.json`) supporti correttamente i parametri con valori di default. Di solito, TypeScript gestisce questi casi automaticamente, ma è buona pratica verificare che la tua configurazione sia corretta.\n\n### **Riassunto**\n\n1. **Identifica la Funzione o la Classe** dove si trova `pathConfig`.\n2. **Aggiungi un Valore di Default** utilizzando la sintassi dei parametri con valori di default in TypeScript.\n3. **Utilizza il Valore di Default nei Test** per semplificare i tuoi test e gestire i casi in cui `pathConfig` non è specificato.\n\nSeguendo questi passaggi, dovresti essere in grado di aggiungere correttamente un valore di default per `pathConfig` nel tuo file `src/lib/test-utils.tsx` e utilizzarlo nei tuoi test.", + "timestamp": "2025-01-08T10:21:47.135840Z", + "message_id": "4e8a2bb5-da31-46c2-849a-65be95288b25" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-2cf978e3bdad40db90566d7febbd6239", + "conversation_timestamp": "2025-01-08T10:21:58.464362Z" + }, + "alert_id": "d6e8cc78-394d-4aef-b17b-037effbec8a9", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-08T10:21:58.464362Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/lib/test-utils.tsx (12-12)\n pathConfig?: string;\n```\nhow I can add the default value?", + "timestamp": "2025-01-08T10:21:53.422888Z", + "message_id": "4f6391ac-9dce-44e5-b1c5-b7d1ee9f6d56" + }, + "answer": { + "message": "To add a default value for the `pathConfig` parameter in the `src/lib/test-utils.tsx` file, you can modify the function or class where `pathConfig` is used. Here's how you can do it:\n\n### 1. **Identifica la Funzione o la Classe**\n\nAssicurati di sapere in quale funzione o classe si trova `pathConfig`. Ad esempio, se si trova all'interno di una funzione chiamata `setupTests`, dovrai modificare quella funzione.\n\n### 2. **Aggiungi un Valore di Default**\n\nPuoi aggiungere un valore di default utilizzando la sintassi dei parametri con valori di default in TypeScript. Ecco un esempio:\n\n#### **Esempio di Funzione**\n\n```typescript\n// src/lib/test-utils.tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\ninterface RenderWithRouterProps {\n children: ReactNode;\n initialEntries?: string[];\n pathConfig?: string; // Aggiungi un valore di default qui\n}\n\nexport const renderWithRouter = ({ children, initialEntries = ['/'], pathConfig = '/default' }: RenderWithRouterProps) => {\n return render(\n \n {children}\n \n );\n};\n```\n\nIn questo esempio, `pathConfig` viene assegnato un valore di default di `'/default'`.\n\n#### **Esempio di Classe**\n\nSe `pathConfig` è parte di una classe, puoi aggiungere un valore di default nel costruttore o direttamente nella dichiarazione della proprietà.\n\n```typescript\n// src/lib/test-utils.tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\nclass TestRenderer {\n children: ReactNode;\n initialEntries: string[];\n pathConfig: string;\n\n constructor(props: { children: ReactNode; initialEntries?: string[]; pathConfig?: string }) {\n this.children = props.children;\n this.initialEntries = props.initialEntries || ['/'];\n this.pathConfig = props.pathConfig || '/default'; // Aggiungi un valore di default qui\n }\n\n render() {\n return render(\n \n {this.children}\n \n );\n }\n}\n\nexport { TestRenderer };\n```\n\n### 3. **Utilizza il Valore di Default nei Test**\n\nOra che hai aggiunto un valore di default per `pathConfig`, puoi utilizzare la tua funzione o classe nei test senza dover specificare `pathConfig` ogni volta.\n\n#### **Esempio di Test con Funzione**\n\n```typescript\nimport { renderWithRouter, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n renderWithRouter();\n\n // Verifica che il componente venga renderizzato correttamente\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n renderWithRouter(, { pathConfig: '/custom' });\n\n // Verifica che il componente venga renderizzato correttamente con la route personalizzata\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n#### **Esempio di Test con Classe**\n\n```typescript\nimport { TestRenderer, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n const renderer = new TestRenderer({ children: });\n renderer.render();\n\n // Verifica che il componente venga renderizzato correttamente\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n const renderer = new TestRenderer({ children: , pathConfig: '/custom' });\n renderer.render();\n\n // Verifica che il componente venga renderizzato correttamente con la route personalizzata\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n### 4. **Verifica la Configurazione di TypeScript**\n\nAssicurati che la tua configurazione di TypeScript (`tsconfig.json`) supporti correttamente i parametri con valori di default. Di solito, TypeScript gestisce questi casi automaticamente, ma è buona pratica verificare che la tua configurazione sia corretta.\n\n### **Riassunto**\n\n1. **Identifica la Funzione o la Classe** dove si trova `pathConfig`.\n2. **Aggiungi un Valore di Default** utilizzando la sintassi dei parametri con valori di default in TypeScript.\n3. **Utilizza il Valore di Default nei Test** per semplificare i tuoi test e gestire i casi in cui `pathConfig` non è specificato.\n\nSeguendo questi passaggi, dovresti essere in grado di aggiungere correttamente un valore di default per `pathConfig` nel tuo file `src/lib/test-utils.tsx` e utilizzarlo nei tuoi test.", + "timestamp": "2025-01-08T10:21:47.135840Z", + "message_id": "4e8a2bb5-da31-46c2-849a-65be95288b25" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-2cf978e3bdad40db90566d7febbd6239", + "conversation_timestamp": "2025-01-08T10:21:53.422888Z" + }, + "alert_id": "4f6391ac-9dce-44e5-b1c5-b7d1ee9f6d56", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-08T10:21:53.422888Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/lib/test-utils.tsx (12-12)\n pathConfig?: string;\n```\nhow I can add the default value?", + "timestamp": "2025-01-08T10:21:46.258940Z", + "message_id": "2cf4d308-2a0c-4058-8d6d-6c4752fb3f0d" + }, + "answer": { + "message": "To add a default value for the `pathConfig` parameter in the `src/lib/test-utils.tsx` file, you can modify the function or class where `pathConfig` is used. Here's how you can do it:\n\n### 1. **Identifica la Funzione o la Classe**\n\nAssicurati di sapere in quale funzione o classe si trova `pathConfig`. Ad esempio, se si trova all'interno di una funzione chiamata `setupTests`, dovrai modificare quella funzione.\n\n### 2. **Aggiungi un Valore di Default**\n\nPuoi aggiungere un valore di default utilizzando la sintassi dei parametri con valori di default in TypeScript. Ecco un esempio:\n\n#### **Esempio di Funzione**\n\n```typescript\n// src/lib/test-utils.tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\ninterface RenderWithRouterProps {\n children: ReactNode;\n initialEntries?: string[];\n pathConfig?: string; // Aggiungi un valore di default qui\n}\n\nexport const renderWithRouter = ({ children, initialEntries = ['/'], pathConfig = '/default' }: RenderWithRouterProps) => {\n return render(\n \n {children}\n \n );\n};\n```\n\nIn questo esempio, `pathConfig` viene assegnato un valore di default di `'/default'`.\n\n#### **Esempio di Classe**\n\nSe `pathConfig` è parte di una classe, puoi aggiungere un valore di default nel costruttore o direttamente nella dichiarazione della proprietà.\n\n```typescript\n// src/lib/test-utils.tsx\nimport { ReactNode } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { render } from '@testing-library/react';\n\nclass TestRenderer {\n children: ReactNode;\n initialEntries: string[];\n pathConfig: string;\n\n constructor(props: { children: ReactNode; initialEntries?: string[]; pathConfig?: string }) {\n this.children = props.children;\n this.initialEntries = props.initialEntries || ['/'];\n this.pathConfig = props.pathConfig || '/default'; // Aggiungi un valore di default qui\n }\n\n render() {\n return render(\n \n {this.children}\n \n );\n }\n}\n\nexport { TestRenderer };\n```\n\n### 3. **Utilizza il Valore di Default nei Test**\n\nOra che hai aggiunto un valore di default per `pathConfig`, puoi utilizzare la tua funzione o classe nei test senza dover specificare `pathConfig` ogni volta.\n\n#### **Esempio di Test con Funzione**\n\n```typescript\nimport { renderWithRouter, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n renderWithRouter();\n\n // Verifica che il componente venga renderizzato correttamente\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n renderWithRouter(, { pathConfig: '/custom' });\n\n // Verifica che il componente venga renderizzato correttamente con la route personalizzata\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n#### **Esempio di Test con Classe**\n\n```typescript\nimport { TestRenderer, screen } from '@/lib/test-utils';\nimport Chat from '@/components/Chat';\n\ndescribe('Chat Component', () => {\n it('renders with default pathConfig', () => {\n const renderer = new TestRenderer({ children: });\n renderer.render();\n\n // Verifica che il componente venga renderizzato correttamente\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n\n it('renders with custom pathConfig', () => {\n const renderer = new TestRenderer({ children: , pathConfig: '/custom' });\n renderer.render();\n\n // Verifica che il componente venga renderizzato correttamente con la route personalizzata\n expect(screen.getByText(/some text/i)).toBeInTheDocument();\n });\n});\n```\n\n### 4. **Verifica la Configurazione di TypeScript**\n\nAssicurati che la tua configurazione di TypeScript (`tsconfig.json`) supporti correttamente i parametri con valori di default. Di solito, TypeScript gestisce questi casi automaticamente, ma è buona pratica verificare che la tua configurazione sia corretta.\n\n### **Riassunto**\n\n1. **Identifica la Funzione o la Classe** dove si trova `pathConfig`.\n2. **Aggiungi un Valore di Default** utilizzando la sintassi dei parametri con valori di default in TypeScript.\n3. **Utilizza il Valore di Default nei Test** per semplificare i tuoi test e gestire i casi in cui `pathConfig` non è specificato.\n\nSeguendo questi passaggi, dovresti essere in grado di aggiungere correttamente un valore di default per `pathConfig` nel tuo file `src/lib/test-utils.tsx` e utilizzarlo nei tuoi test.", + "timestamp": "2025-01-08T10:21:47.135840Z", + "message_id": "4e8a2bb5-da31-46c2-849a-65be95288b25" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-2cf978e3bdad40db90566d7febbd6239", + "conversation_timestamp": "2025-01-08T10:21:46.258940Z" + }, + "alert_id": "2cf4d308-2a0c-4058-8d6d-6c4752fb3f0d", + "code_snippet": { + "code": " pathConfig?: string;\n", + "language": "typescript", + "filepath": "src/lib/test-utils.tsx", + "libraries": [] + }, + "trigger_string": null, + "trigger_type": "code-snippet-extractor", + "trigger_category": "info", + "timestamp": "2025-01-08T10:21:46.258940Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "come faccio a passare la url ?\ninterface MemoryRouterProps {\nbasename?: string;\nchildren?: React.ReactNode;\ninitialEntries?: InitialEntry[];\ninitialIndex?: number;\n}", + "timestamp": "2025-01-07T17:45:13.692348Z", + "message_id": "bf301961-79d0-486e-a762-d0603aa778a4" + }, + "answer": { + "message": "Per passare la URL in un test utilizzando `MemoryRouter` di `react-router-dom`, puoi utilizzare la proprietà `initialEntries` di `MemoryRouter`. Questa proprietà accetta un array di stringhe, ciascuna rappresentante una route iniziale.\n\nEcco un esempio di come puoi farlo:\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport { MemoryRouter } from 'react-router-dom';\nimport Chat from './Chat';\n\ndescribe('Chat Component', () => {\n it('should render with the correct URL', () => {\n render(\n \n \n \n );\n\n expect(screen.getByText(/chat id is 1/i)).toBeInTheDocument();\n });\n});\n```\n\nIn questo esempio, `MemoryRouter` viene configurato con `initialEntries` impostato su `['/chat/1']`, che simula l'apertura di `/chat/1` all'inizio del test.\n\n### Uso di `useParams` per ottenere l'ID dalla URL\n\nSe nel tuo componente `Chat` stai utilizzando `useParams` per ottenere l'ID dalla URL, assicurati che il componente sia renderizzato all'interno di una `MemoryRouter` con la route corretta.\n\nEsempio di componente `Chat`:\n\n```typescript\nimport { useParams } from 'react-router-dom';\n\nconst Chat = () => {\n const { id } = useParams<{ id: string }>();\n\n return
Chat id is {id}
;\n};\n\nexport default Chat;\n```\n\n### Esempio Completo di Test\n\nEcco un esempio completo di come potresti strutturare il tuo test:\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport { MemoryRouter } from 'react-router-dom';\nimport Chat from './Chat';\n\ndescribe('Chat Component', () => {\n it('should render with the correct URL', () => {\n render(\n \n \n \n );\n\n expect(screen.getByText(/chat id is 1/i)).toBeInTheDocument();\n });\n});\n```\n\nIn questo esempio, il test verifica che il componente `Chat` mostri \"Chat id is 1\" quando viene renderizzato con la route `/chat/1`.\n\n### Uso di `initialIndex`\n\nSe desideri testare un comportamento specifico basato sull'indice della route iniziale, puoi utilizzare anche la proprietà `initialIndex` di `MemoryRouter`.\n\nEsempio:\n\n```typescript\nrender(\n \n \n \n);\n```\n\nIn questo caso, il componente `Chat` sarà renderizzato con la route `/chat/2`, che corrisponde all'indice `1` nell'array `initialEntries`.\n\nSeguendo questi passaggi, dovresti essere in grado di passare correttamente la URL nel tuo test utilizzando `MemoryRouter`.", + "timestamp": "2025-01-07T17:45:00.938850Z", + "message_id": "48777229-1a20-4a49-8c00-1a7ae0939541" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-3543b955e49d477ca68677e7bd3a01bb", + "conversation_timestamp": "2025-01-07T17:45:13.692348Z" + }, + "alert_id": "bf301961-79d0-486e-a762-d0603aa778a4", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-07T17:45:13.692348Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "come faccio a passare la url ?\ninterface MemoryRouterProps {\nbasename?: string;\nchildren?: React.ReactNode;\ninitialEntries?: InitialEntry[];\ninitialIndex?: number;\n}", + "timestamp": "2025-01-07T17:45:11.017203Z", + "message_id": "e0db1ce3-2893-4dcb-9080-23c28304b62a" + }, + "answer": { + "message": "Per passare la URL in un test utilizzando `MemoryRouter` di `react-router-dom`, puoi utilizzare la proprietà `initialEntries` di `MemoryRouter`. Questa proprietà accetta un array di stringhe, ciascuna rappresentante una route iniziale.\n\nEcco un esempio di come puoi farlo:\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport { MemoryRouter } from 'react-router-dom';\nimport Chat from './Chat';\n\ndescribe('Chat Component', () => {\n it('should render with the correct URL', () => {\n render(\n \n \n \n );\n\n expect(screen.getByText(/chat id is 1/i)).toBeInTheDocument();\n });\n});\n```\n\nIn questo esempio, `MemoryRouter` viene configurato con `initialEntries` impostato su `['/chat/1']`, che simula l'apertura di `/chat/1` all'inizio del test.\n\n### Uso di `useParams` per ottenere l'ID dalla URL\n\nSe nel tuo componente `Chat` stai utilizzando `useParams` per ottenere l'ID dalla URL, assicurati che il componente sia renderizzato all'interno di una `MemoryRouter` con la route corretta.\n\nEsempio di componente `Chat`:\n\n```typescript\nimport { useParams } from 'react-router-dom';\n\nconst Chat = () => {\n const { id } = useParams<{ id: string }>();\n\n return
Chat id is {id}
;\n};\n\nexport default Chat;\n```\n\n### Esempio Completo di Test\n\nEcco un esempio completo di come potresti strutturare il tuo test:\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport { MemoryRouter } from 'react-router-dom';\nimport Chat from './Chat';\n\ndescribe('Chat Component', () => {\n it('should render with the correct URL', () => {\n render(\n \n \n \n );\n\n expect(screen.getByText(/chat id is 1/i)).toBeInTheDocument();\n });\n});\n```\n\nIn questo esempio, il test verifica che il componente `Chat` mostri \"Chat id is 1\" quando viene renderizzato con la route `/chat/1`.\n\n### Uso di `initialIndex`\n\nSe desideri testare un comportamento specifico basato sull'indice della route iniziale, puoi utilizzare anche la proprietà `initialIndex` di `MemoryRouter`.\n\nEsempio:\n\n```typescript\nrender(\n \n \n \n);\n```\n\nIn questo caso, il componente `Chat` sarà renderizzato con la route `/chat/2`, che corrisponde all'indice `1` nell'array `initialEntries`.\n\nSeguendo questi passaggi, dovresti essere in grado di passare correttamente la URL nel tuo test utilizzando `MemoryRouter`.", + "timestamp": "2025-01-07T17:45:00.938850Z", + "message_id": "48777229-1a20-4a49-8c00-1a7ae0939541" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-3543b955e49d477ca68677e7bd3a01bb", + "conversation_timestamp": "2025-01-07T17:45:11.017203Z" + }, + "alert_id": "e0db1ce3-2893-4dcb-9080-23c28304b62a", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-07T17:45:11.017203Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "come faccio a passare la url ?\ninterface MemoryRouterProps {\nbasename?: string;\nchildren?: React.ReactNode;\ninitialEntries?: InitialEntry[];\ninitialIndex?: number;\n}", + "timestamp": "2025-01-07T17:45:08.281714Z", + "message_id": "2d5c9815-1c79-4846-983c-93b6f8491a2e" + }, + "answer": { + "message": "Per passare la URL in un test utilizzando `MemoryRouter` di `react-router-dom`, puoi utilizzare la proprietà `initialEntries` di `MemoryRouter`. Questa proprietà accetta un array di stringhe, ciascuna rappresentante una route iniziale.\n\nEcco un esempio di come puoi farlo:\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport { MemoryRouter } from 'react-router-dom';\nimport Chat from './Chat';\n\ndescribe('Chat Component', () => {\n it('should render with the correct URL', () => {\n render(\n \n \n \n );\n\n expect(screen.getByText(/chat id is 1/i)).toBeInTheDocument();\n });\n});\n```\n\nIn questo esempio, `MemoryRouter` viene configurato con `initialEntries` impostato su `['/chat/1']`, che simula l'apertura di `/chat/1` all'inizio del test.\n\n### Uso di `useParams` per ottenere l'ID dalla URL\n\nSe nel tuo componente `Chat` stai utilizzando `useParams` per ottenere l'ID dalla URL, assicurati che il componente sia renderizzato all'interno di una `MemoryRouter` con la route corretta.\n\nEsempio di componente `Chat`:\n\n```typescript\nimport { useParams } from 'react-router-dom';\n\nconst Chat = () => {\n const { id } = useParams<{ id: string }>();\n\n return
Chat id is {id}
;\n};\n\nexport default Chat;\n```\n\n### Esempio Completo di Test\n\nEcco un esempio completo di come potresti strutturare il tuo test:\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport { MemoryRouter } from 'react-router-dom';\nimport Chat from './Chat';\n\ndescribe('Chat Component', () => {\n it('should render with the correct URL', () => {\n render(\n \n \n \n );\n\n expect(screen.getByText(/chat id is 1/i)).toBeInTheDocument();\n });\n});\n```\n\nIn questo esempio, il test verifica che il componente `Chat` mostri \"Chat id is 1\" quando viene renderizzato con la route `/chat/1`.\n\n### Uso di `initialIndex`\n\nSe desideri testare un comportamento specifico basato sull'indice della route iniziale, puoi utilizzare anche la proprietà `initialIndex` di `MemoryRouter`.\n\nEsempio:\n\n```typescript\nrender(\n \n \n \n);\n```\n\nIn questo caso, il componente `Chat` sarà renderizzato con la route `/chat/2`, che corrisponde all'indice `1` nell'array `initialEntries`.\n\nSeguendo questi passaggi, dovresti essere in grado di passare correttamente la URL nel tuo test utilizzando `MemoryRouter`.", + "timestamp": "2025-01-07T17:45:00.938850Z", + "message_id": "48777229-1a20-4a49-8c00-1a7ae0939541" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-3543b955e49d477ca68677e7bd3a01bb", + "conversation_timestamp": "2025-01-07T17:45:08.281714Z" + }, + "alert_id": "2d5c9815-1c79-4846-983c-93b6f8491a2e", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-07T17:45:08.281714Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "come faccio a passare la url ?\ninterface MemoryRouterProps {\nbasename?: string;\nchildren?: React.ReactNode;\ninitialEntries?: InitialEntry[];\ninitialIndex?: number;\n}", + "timestamp": "2025-01-07T17:45:04.494039Z", + "message_id": "252959f6-79c0-49a9-84c2-49fbe54a3db5" + }, + "answer": { + "message": "Per passare la URL in un test utilizzando `MemoryRouter` di `react-router-dom`, puoi utilizzare la proprietà `initialEntries` di `MemoryRouter`. Questa proprietà accetta un array di stringhe, ciascuna rappresentante una route iniziale.\n\nEcco un esempio di come puoi farlo:\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport { MemoryRouter } from 'react-router-dom';\nimport Chat from './Chat';\n\ndescribe('Chat Component', () => {\n it('should render with the correct URL', () => {\n render(\n \n \n \n );\n\n expect(screen.getByText(/chat id is 1/i)).toBeInTheDocument();\n });\n});\n```\n\nIn questo esempio, `MemoryRouter` viene configurato con `initialEntries` impostato su `['/chat/1']`, che simula l'apertura di `/chat/1` all'inizio del test.\n\n### Uso di `useParams` per ottenere l'ID dalla URL\n\nSe nel tuo componente `Chat` stai utilizzando `useParams` per ottenere l'ID dalla URL, assicurati che il componente sia renderizzato all'interno di una `MemoryRouter` con la route corretta.\n\nEsempio di componente `Chat`:\n\n```typescript\nimport { useParams } from 'react-router-dom';\n\nconst Chat = () => {\n const { id } = useParams<{ id: string }>();\n\n return
Chat id is {id}
;\n};\n\nexport default Chat;\n```\n\n### Esempio Completo di Test\n\nEcco un esempio completo di come potresti strutturare il tuo test:\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport { MemoryRouter } from 'react-router-dom';\nimport Chat from './Chat';\n\ndescribe('Chat Component', () => {\n it('should render with the correct URL', () => {\n render(\n \n \n \n );\n\n expect(screen.getByText(/chat id is 1/i)).toBeInTheDocument();\n });\n});\n```\n\nIn questo esempio, il test verifica che il componente `Chat` mostri \"Chat id is 1\" quando viene renderizzato con la route `/chat/1`.\n\n### Uso di `initialIndex`\n\nSe desideri testare un comportamento specifico basato sull'indice della route iniziale, puoi utilizzare anche la proprietà `initialIndex` di `MemoryRouter`.\n\nEsempio:\n\n```typescript\nrender(\n \n \n \n);\n```\n\nIn questo caso, il componente `Chat` sarà renderizzato con la route `/chat/2`, che corrisponde all'indice `1` nell'array `initialEntries`.\n\nSeguendo questi passaggi, dovresti essere in grado di passare correttamente la URL nel tuo test utilizzando `MemoryRouter`.", + "timestamp": "2025-01-07T17:45:00.938850Z", + "message_id": "48777229-1a20-4a49-8c00-1a7ae0939541" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-3543b955e49d477ca68677e7bd3a01bb", + "conversation_timestamp": "2025-01-07T17:45:04.494039Z" + }, + "alert_id": "252959f6-79c0-49a9-84c2-49fbe54a3db5", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-07T17:45:04.494039Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "non é esportato come default", + "timestamp": "2025-01-07T17:28:01.886966Z", + "message_id": "71d779e4-226c-4b43-92ec-55f0330607a4" + }, + "answer": { + "message": "Capisco, nel caso in cui `usePromptsStore` non sia esportato come default, dovrai importarlo specificando il nome della funzione. Ecco come puoi correggere il test e l'importazione nel tuo componente.\n\n### 1. **Modifica dell'Importazione nel Componente `Chat.tsx`**\n\nAssicurati di importare `usePromptsStore` correttamente nel tuo componente `Chat.tsx`. Se non è stato esportato come default, dovrai importarlo specificando il nome della funzione.\n\nEsempio:\n\n```typescript\n// Supponiamo che usePromptsStore sia esportato come named export\nimport { usePromptsStore } from '@/hooks/usePromptsStore';\n```\n\n### 2. **Modifica del Mock nel Test di Unità**\n\nSe `usePromptsStore` non è esportato come default, dovrai modificare il mock nel tuo test di unità in modo che corrisponda al modo in cui la funzione viene importata nel componente.\n\nEsempio di test di unità con Vitest:\n\n```typescript\nimport { describe, it, expect, vi } from 'vitest';\nimport { render, screen, cleanup } from '@testing-library/react';\nimport { useParams } from 'react-router-dom';\nimport { usePromptsStore } from '@/hooks/usePromptsStore'; // Importa come named export\nimport { Chat } from './Chat';\nimport { sanitizeQuestionPrompt } from '@/lib/utils';\n\n// Mock the usePromptsStore hook\nvi.mock('@/hooks/usePromptsStore', () => ({\n usePromptsStore: vi.fn(),\n}));\n\n// Mock the useParams hook\nvi.mock('react-router-dom', () => ({\n ...vi.requireActual('react-router-dom'),\n useParams: vi.fn(),\n}));\n\n// Mock the sanitizeQuestionPrompt function\nvi.mock('@/lib/utils', () => ({\n sanitizeQuestionPrompt: vi.fn(),\n}));\n\ndescribe('Chat Component', () => {\n const mockPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n ],\n },\n ];\n\n beforeEach(() => {\n vi.mocked(useParams).mockReturnValue({ id: '1' });\n vi.mocked(usePromptsStore).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: vi.fn(),\n });\n vi.mocked(sanitizeQuestionPrompt).mockImplementation((args) => args);\n });\n\n afterEach(() => {\n vi.clearAllMocks();\n cleanup();\n });\n\n it('renders the Chat component with the correct prompts', () => {\n render();\n\n // Check if the user chat bubble is rendered\n const userBubble = screen.getByText('What is your name?');\n expect(userBubble).toBeInTheDocument();\n\n // Check if the AI chat bubble is rendered\n const aiBubble = screen.getByText('My name is John.');\n expect(aiBubble).toBeInTheDocument();\n });\n\n // Altri test...\n});\n```\n\n### 3. **Verifica la Struttura del File `usePromptsStore.ts`**\n\nAssicurati che `usePromptsStore` sia stato esportato correttamente nel tuo file `usePromptsStore.ts`. Se non è stato esportato come default, dovrai esportarlo come named export.\n\nEsempio:\n\n```typescript\n// hooks/usePromptsStore.ts\nimport create from 'zustand';\n\ninterface PromptState {\n prompts: any[];\n setCurrentPromptId: (id: string) => void;\n}\n\nconst usePromptsStore = create((set) => ({\n prompts: [],\n setCurrentPromptId: (id) => set({ currentPromptId: id }),\n}));\n\n// Esporta come named export\nexport { usePromptsStore };\n```\n\n### 4. **Riassunto**\n\n- **Importazione nel Componente**: Assicurati di importare `usePromptsStore` come named export nel componente `Chat.tsx`.\n \n ```typescript\n import { usePromptsStore } from '@/hooks/usePromptsStore';\n ```\n\n- **Mock nel Test**: Modifica il mock nel tuo test di unità per corrispondere all'importazione come named export.\n\n ```typescript\n vi.mock('@/hooks/usePromptsStore', () => ({\n usePromptsStore: vi.fn(),\n }));\n ```\n\nSeguendo questi passaggi, dovresti essere in grado di risolvere l'errore \"TypeError: (0 , usePromptsStore) is not a function\" e garantire che la tua funzione `usePromptsStore` venga importata e mockata correttamente.", + "timestamp": "2025-01-07T17:27:41.890085Z", + "message_id": "57cfafda-53d3-4e7e-a126-f96390da1d77" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-231d53a39d724dbe8d39667327ac6641", + "conversation_timestamp": "2025-01-07T17:28:01.886966Z" + }, + "alert_id": "71d779e4-226c-4b43-92ec-55f0330607a4", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-07T17:28:01.886966Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "non é esportato come default", + "timestamp": "2025-01-07T17:28:00.618828Z", + "message_id": "0339aa4e-0fd8-4b5e-9b9f-0e5d998206cf" + }, + "answer": { + "message": "Capisco, nel caso in cui `usePromptsStore` non sia esportato come default, dovrai importarlo specificando il nome della funzione. Ecco come puoi correggere il test e l'importazione nel tuo componente.\n\n### 1. **Modifica dell'Importazione nel Componente `Chat.tsx`**\n\nAssicurati di importare `usePromptsStore` correttamente nel tuo componente `Chat.tsx`. Se non è stato esportato come default, dovrai importarlo specificando il nome della funzione.\n\nEsempio:\n\n```typescript\n// Supponiamo che usePromptsStore sia esportato come named export\nimport { usePromptsStore } from '@/hooks/usePromptsStore';\n```\n\n### 2. **Modifica del Mock nel Test di Unità**\n\nSe `usePromptsStore` non è esportato come default, dovrai modificare il mock nel tuo test di unità in modo che corrisponda al modo in cui la funzione viene importata nel componente.\n\nEsempio di test di unità con Vitest:\n\n```typescript\nimport { describe, it, expect, vi } from 'vitest';\nimport { render, screen, cleanup } from '@testing-library/react';\nimport { useParams } from 'react-router-dom';\nimport { usePromptsStore } from '@/hooks/usePromptsStore'; // Importa come named export\nimport { Chat } from './Chat';\nimport { sanitizeQuestionPrompt } from '@/lib/utils';\n\n// Mock the usePromptsStore hook\nvi.mock('@/hooks/usePromptsStore', () => ({\n usePromptsStore: vi.fn(),\n}));\n\n// Mock the useParams hook\nvi.mock('react-router-dom', () => ({\n ...vi.requireActual('react-router-dom'),\n useParams: vi.fn(),\n}));\n\n// Mock the sanitizeQuestionPrompt function\nvi.mock('@/lib/utils', () => ({\n sanitizeQuestionPrompt: vi.fn(),\n}));\n\ndescribe('Chat Component', () => {\n const mockPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n ],\n },\n ];\n\n beforeEach(() => {\n vi.mocked(useParams).mockReturnValue({ id: '1' });\n vi.mocked(usePromptsStore).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: vi.fn(),\n });\n vi.mocked(sanitizeQuestionPrompt).mockImplementation((args) => args);\n });\n\n afterEach(() => {\n vi.clearAllMocks();\n cleanup();\n });\n\n it('renders the Chat component with the correct prompts', () => {\n render();\n\n // Check if the user chat bubble is rendered\n const userBubble = screen.getByText('What is your name?');\n expect(userBubble).toBeInTheDocument();\n\n // Check if the AI chat bubble is rendered\n const aiBubble = screen.getByText('My name is John.');\n expect(aiBubble).toBeInTheDocument();\n });\n\n // Altri test...\n});\n```\n\n### 3. **Verifica la Struttura del File `usePromptsStore.ts`**\n\nAssicurati che `usePromptsStore` sia stato esportato correttamente nel tuo file `usePromptsStore.ts`. Se non è stato esportato come default, dovrai esportarlo come named export.\n\nEsempio:\n\n```typescript\n// hooks/usePromptsStore.ts\nimport create from 'zustand';\n\ninterface PromptState {\n prompts: any[];\n setCurrentPromptId: (id: string) => void;\n}\n\nconst usePromptsStore = create((set) => ({\n prompts: [],\n setCurrentPromptId: (id) => set({ currentPromptId: id }),\n}));\n\n// Esporta come named export\nexport { usePromptsStore };\n```\n\n### 4. **Riassunto**\n\n- **Importazione nel Componente**: Assicurati di importare `usePromptsStore` come named export nel componente `Chat.tsx`.\n \n ```typescript\n import { usePromptsStore } from '@/hooks/usePromptsStore';\n ```\n\n- **Mock nel Test**: Modifica il mock nel tuo test di unità per corrispondere all'importazione come named export.\n\n ```typescript\n vi.mock('@/hooks/usePromptsStore', () => ({\n usePromptsStore: vi.fn(),\n }));\n ```\n\nSeguendo questi passaggi, dovresti essere in grado di risolvere l'errore \"TypeError: (0 , usePromptsStore) is not a function\" e garantire che la tua funzione `usePromptsStore` venga importata e mockata correttamente.", + "timestamp": "2025-01-07T17:27:41.890085Z", + "message_id": "57cfafda-53d3-4e7e-a126-f96390da1d77" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-231d53a39d724dbe8d39667327ac6641", + "conversation_timestamp": "2025-01-07T17:28:00.618828Z" + }, + "alert_id": "0339aa4e-0fd8-4b5e-9b9f-0e5d998206cf", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-07T17:28:00.618828Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "non é esportato come default", + "timestamp": "2025-01-07T17:27:59.239284Z", + "message_id": "37772125-4820-4930-b1e3-1359b960da17" + }, + "answer": { + "message": "Capisco, nel caso in cui `usePromptsStore` non sia esportato come default, dovrai importarlo specificando il nome della funzione. Ecco come puoi correggere il test e l'importazione nel tuo componente.\n\n### 1. **Modifica dell'Importazione nel Componente `Chat.tsx`**\n\nAssicurati di importare `usePromptsStore` correttamente nel tuo componente `Chat.tsx`. Se non è stato esportato come default, dovrai importarlo specificando il nome della funzione.\n\nEsempio:\n\n```typescript\n// Supponiamo che usePromptsStore sia esportato come named export\nimport { usePromptsStore } from '@/hooks/usePromptsStore';\n```\n\n### 2. **Modifica del Mock nel Test di Unità**\n\nSe `usePromptsStore` non è esportato come default, dovrai modificare il mock nel tuo test di unità in modo che corrisponda al modo in cui la funzione viene importata nel componente.\n\nEsempio di test di unità con Vitest:\n\n```typescript\nimport { describe, it, expect, vi } from 'vitest';\nimport { render, screen, cleanup } from '@testing-library/react';\nimport { useParams } from 'react-router-dom';\nimport { usePromptsStore } from '@/hooks/usePromptsStore'; // Importa come named export\nimport { Chat } from './Chat';\nimport { sanitizeQuestionPrompt } from '@/lib/utils';\n\n// Mock the usePromptsStore hook\nvi.mock('@/hooks/usePromptsStore', () => ({\n usePromptsStore: vi.fn(),\n}));\n\n// Mock the useParams hook\nvi.mock('react-router-dom', () => ({\n ...vi.requireActual('react-router-dom'),\n useParams: vi.fn(),\n}));\n\n// Mock the sanitizeQuestionPrompt function\nvi.mock('@/lib/utils', () => ({\n sanitizeQuestionPrompt: vi.fn(),\n}));\n\ndescribe('Chat Component', () => {\n const mockPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n ],\n },\n ];\n\n beforeEach(() => {\n vi.mocked(useParams).mockReturnValue({ id: '1' });\n vi.mocked(usePromptsStore).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: vi.fn(),\n });\n vi.mocked(sanitizeQuestionPrompt).mockImplementation((args) => args);\n });\n\n afterEach(() => {\n vi.clearAllMocks();\n cleanup();\n });\n\n it('renders the Chat component with the correct prompts', () => {\n render();\n\n // Check if the user chat bubble is rendered\n const userBubble = screen.getByText('What is your name?');\n expect(userBubble).toBeInTheDocument();\n\n // Check if the AI chat bubble is rendered\n const aiBubble = screen.getByText('My name is John.');\n expect(aiBubble).toBeInTheDocument();\n });\n\n // Altri test...\n});\n```\n\n### 3. **Verifica la Struttura del File `usePromptsStore.ts`**\n\nAssicurati che `usePromptsStore` sia stato esportato correttamente nel tuo file `usePromptsStore.ts`. Se non è stato esportato come default, dovrai esportarlo come named export.\n\nEsempio:\n\n```typescript\n// hooks/usePromptsStore.ts\nimport create from 'zustand';\n\ninterface PromptState {\n prompts: any[];\n setCurrentPromptId: (id: string) => void;\n}\n\nconst usePromptsStore = create((set) => ({\n prompts: [],\n setCurrentPromptId: (id) => set({ currentPromptId: id }),\n}));\n\n// Esporta come named export\nexport { usePromptsStore };\n```\n\n### 4. **Riassunto**\n\n- **Importazione nel Componente**: Assicurati di importare `usePromptsStore` come named export nel componente `Chat.tsx`.\n \n ```typescript\n import { usePromptsStore } from '@/hooks/usePromptsStore';\n ```\n\n- **Mock nel Test**: Modifica il mock nel tuo test di unità per corrispondere all'importazione come named export.\n\n ```typescript\n vi.mock('@/hooks/usePromptsStore', () => ({\n usePromptsStore: vi.fn(),\n }));\n ```\n\nSeguendo questi passaggi, dovresti essere in grado di risolvere l'errore \"TypeError: (0 , usePromptsStore) is not a function\" e garantire che la tua funzione `usePromptsStore` venga importata e mockata correttamente.", + "timestamp": "2025-01-07T17:27:41.890085Z", + "message_id": "57cfafda-53d3-4e7e-a126-f96390da1d77" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-231d53a39d724dbe8d39667327ac6641", + "conversation_timestamp": "2025-01-07T17:27:59.239284Z" + }, + "alert_id": "37772125-4820-4930-b1e3-1359b960da17", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-07T17:27:59.239284Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "non é esportato come default", + "timestamp": "2025-01-07T17:27:55.650752Z", + "message_id": "842611ca-9903-4b93-aa12-75561be9b111" + }, + "answer": { + "message": "Capisco, nel caso in cui `usePromptsStore` non sia esportato come default, dovrai importarlo specificando il nome della funzione. Ecco come puoi correggere il test e l'importazione nel tuo componente.\n\n### 1. **Modifica dell'Importazione nel Componente `Chat.tsx`**\n\nAssicurati di importare `usePromptsStore` correttamente nel tuo componente `Chat.tsx`. Se non è stato esportato come default, dovrai importarlo specificando il nome della funzione.\n\nEsempio:\n\n```typescript\n// Supponiamo che usePromptsStore sia esportato come named export\nimport { usePromptsStore } from '@/hooks/usePromptsStore';\n```\n\n### 2. **Modifica del Mock nel Test di Unità**\n\nSe `usePromptsStore` non è esportato come default, dovrai modificare il mock nel tuo test di unità in modo che corrisponda al modo in cui la funzione viene importata nel componente.\n\nEsempio di test di unità con Vitest:\n\n```typescript\nimport { describe, it, expect, vi } from 'vitest';\nimport { render, screen, cleanup } from '@testing-library/react';\nimport { useParams } from 'react-router-dom';\nimport { usePromptsStore } from '@/hooks/usePromptsStore'; // Importa come named export\nimport { Chat } from './Chat';\nimport { sanitizeQuestionPrompt } from '@/lib/utils';\n\n// Mock the usePromptsStore hook\nvi.mock('@/hooks/usePromptsStore', () => ({\n usePromptsStore: vi.fn(),\n}));\n\n// Mock the useParams hook\nvi.mock('react-router-dom', () => ({\n ...vi.requireActual('react-router-dom'),\n useParams: vi.fn(),\n}));\n\n// Mock the sanitizeQuestionPrompt function\nvi.mock('@/lib/utils', () => ({\n sanitizeQuestionPrompt: vi.fn(),\n}));\n\ndescribe('Chat Component', () => {\n const mockPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n ],\n },\n ];\n\n beforeEach(() => {\n vi.mocked(useParams).mockReturnValue({ id: '1' });\n vi.mocked(usePromptsStore).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: vi.fn(),\n });\n vi.mocked(sanitizeQuestionPrompt).mockImplementation((args) => args);\n });\n\n afterEach(() => {\n vi.clearAllMocks();\n cleanup();\n });\n\n it('renders the Chat component with the correct prompts', () => {\n render();\n\n // Check if the user chat bubble is rendered\n const userBubble = screen.getByText('What is your name?');\n expect(userBubble).toBeInTheDocument();\n\n // Check if the AI chat bubble is rendered\n const aiBubble = screen.getByText('My name is John.');\n expect(aiBubble).toBeInTheDocument();\n });\n\n // Altri test...\n});\n```\n\n### 3. **Verifica la Struttura del File `usePromptsStore.ts`**\n\nAssicurati che `usePromptsStore` sia stato esportato correttamente nel tuo file `usePromptsStore.ts`. Se non è stato esportato come default, dovrai esportarlo come named export.\n\nEsempio:\n\n```typescript\n// hooks/usePromptsStore.ts\nimport create from 'zustand';\n\ninterface PromptState {\n prompts: any[];\n setCurrentPromptId: (id: string) => void;\n}\n\nconst usePromptsStore = create((set) => ({\n prompts: [],\n setCurrentPromptId: (id) => set({ currentPromptId: id }),\n}));\n\n// Esporta come named export\nexport { usePromptsStore };\n```\n\n### 4. **Riassunto**\n\n- **Importazione nel Componente**: Assicurati di importare `usePromptsStore` come named export nel componente `Chat.tsx`.\n \n ```typescript\n import { usePromptsStore } from '@/hooks/usePromptsStore';\n ```\n\n- **Mock nel Test**: Modifica il mock nel tuo test di unità per corrispondere all'importazione come named export.\n\n ```typescript\n vi.mock('@/hooks/usePromptsStore', () => ({\n usePromptsStore: vi.fn(),\n }));\n ```\n\nSeguendo questi passaggi, dovresti essere in grado di risolvere l'errore \"TypeError: (0 , usePromptsStore) is not a function\" e garantire che la tua funzione `usePromptsStore` venga importata e mockata correttamente.", + "timestamp": "2025-01-07T17:27:41.890085Z", + "message_id": "57cfafda-53d3-4e7e-a126-f96390da1d77" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-231d53a39d724dbe8d39667327ac6641", + "conversation_timestamp": "2025-01-07T17:27:55.650752Z" + }, + "alert_id": "842611ca-9903-4b93-aa12-75561be9b111", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-07T17:27:55.650752Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "non é esportato come default", + "timestamp": "2025-01-07T17:27:45.231473Z", + "message_id": "7801ee47-2fef-4874-bdf5-9f031aa8b542" + }, + "answer": { + "message": "Capisco, nel caso in cui `usePromptsStore` non sia esportato come default, dovrai importarlo specificando il nome della funzione. Ecco come puoi correggere il test e l'importazione nel tuo componente.\n\n### 1. **Modifica dell'Importazione nel Componente `Chat.tsx`**\n\nAssicurati di importare `usePromptsStore` correttamente nel tuo componente `Chat.tsx`. Se non è stato esportato come default, dovrai importarlo specificando il nome della funzione.\n\nEsempio:\n\n```typescript\n// Supponiamo che usePromptsStore sia esportato come named export\nimport { usePromptsStore } from '@/hooks/usePromptsStore';\n```\n\n### 2. **Modifica del Mock nel Test di Unità**\n\nSe `usePromptsStore` non è esportato come default, dovrai modificare il mock nel tuo test di unità in modo che corrisponda al modo in cui la funzione viene importata nel componente.\n\nEsempio di test di unità con Vitest:\n\n```typescript\nimport { describe, it, expect, vi } from 'vitest';\nimport { render, screen, cleanup } from '@testing-library/react';\nimport { useParams } from 'react-router-dom';\nimport { usePromptsStore } from '@/hooks/usePromptsStore'; // Importa come named export\nimport { Chat } from './Chat';\nimport { sanitizeQuestionPrompt } from '@/lib/utils';\n\n// Mock the usePromptsStore hook\nvi.mock('@/hooks/usePromptsStore', () => ({\n usePromptsStore: vi.fn(),\n}));\n\n// Mock the useParams hook\nvi.mock('react-router-dom', () => ({\n ...vi.requireActual('react-router-dom'),\n useParams: vi.fn(),\n}));\n\n// Mock the sanitizeQuestionPrompt function\nvi.mock('@/lib/utils', () => ({\n sanitizeQuestionPrompt: vi.fn(),\n}));\n\ndescribe('Chat Component', () => {\n const mockPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n ],\n },\n ];\n\n beforeEach(() => {\n vi.mocked(useParams).mockReturnValue({ id: '1' });\n vi.mocked(usePromptsStore).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: vi.fn(),\n });\n vi.mocked(sanitizeQuestionPrompt).mockImplementation((args) => args);\n });\n\n afterEach(() => {\n vi.clearAllMocks();\n cleanup();\n });\n\n it('renders the Chat component with the correct prompts', () => {\n render();\n\n // Check if the user chat bubble is rendered\n const userBubble = screen.getByText('What is your name?');\n expect(userBubble).toBeInTheDocument();\n\n // Check if the AI chat bubble is rendered\n const aiBubble = screen.getByText('My name is John.');\n expect(aiBubble).toBeInTheDocument();\n });\n\n // Altri test...\n});\n```\n\n### 3. **Verifica la Struttura del File `usePromptsStore.ts`**\n\nAssicurati che `usePromptsStore` sia stato esportato correttamente nel tuo file `usePromptsStore.ts`. Se non è stato esportato come default, dovrai esportarlo come named export.\n\nEsempio:\n\n```typescript\n// hooks/usePromptsStore.ts\nimport create from 'zustand';\n\ninterface PromptState {\n prompts: any[];\n setCurrentPromptId: (id: string) => void;\n}\n\nconst usePromptsStore = create((set) => ({\n prompts: [],\n setCurrentPromptId: (id) => set({ currentPromptId: id }),\n}));\n\n// Esporta come named export\nexport { usePromptsStore };\n```\n\n### 4. **Riassunto**\n\n- **Importazione nel Componente**: Assicurati di importare `usePromptsStore` come named export nel componente `Chat.tsx`.\n \n ```typescript\n import { usePromptsStore } from '@/hooks/usePromptsStore';\n ```\n\n- **Mock nel Test**: Modifica il mock nel tuo test di unità per corrispondere all'importazione come named export.\n\n ```typescript\n vi.mock('@/hooks/usePromptsStore', () => ({\n usePromptsStore: vi.fn(),\n }));\n ```\n\nSeguendo questi passaggi, dovresti essere in grado di risolvere l'errore \"TypeError: (0 , usePromptsStore) is not a function\" e garantire che la tua funzione `usePromptsStore` venga importata e mockata correttamente.", + "timestamp": "2025-01-07T17:27:41.890085Z", + "message_id": "57cfafda-53d3-4e7e-a126-f96390da1d77" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-231d53a39d724dbe8d39667327ac6641", + "conversation_timestamp": "2025-01-07T17:27:45.231473Z" + }, + "alert_id": "7801ee47-2fef-4874-bdf5-9f031aa8b542", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-07T17:27:45.231473Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "usa vitest", + "timestamp": "2025-01-07T17:03:24.177756Z", + "message_id": "2c701594-eecc-4017-b975-1c8b25fe2299" + }, + "answer": { + "message": "Sure! If you prefer using Vitest instead of Jest, you can set up your unit tests using Vitest. Below is an example of how you can write the unit test for the `Chat` component using Vitest:\n\n### Unit Test for `Chat.tsx` using Vitest\n\nFirst, ensure you have Vitest installed:\n\n```bash\nnpm install vitest @vitest/ui --save-dev\n```\n\nThen, you can write the test as follows:\n\n```tsx\nimport { describe, it, expect, vi } from 'vitest';\nimport { render, screen, cleanup } from '@testing-library/react';\nimport { useParams } from 'react-router-dom';\nimport { usePromptsStore } from '@/hooks/usePromptsStore';\nimport { Chat } from './Chat';\nimport { sanitizeQuestionPrompt } from '@/lib/utils';\n\n// Mock the usePromptsStore hook\nvi.mock('@/hooks/usePromptsStore', () => ({\n usePromptsStore: vi.fn(),\n}));\n\n// Mock the useParams hook\nvi.mock('react-router-dom', () => ({\n ...vi.requireActual('react-router-dom'),\n useParams: vi.fn(),\n}));\n\n// Mock the sanitizeQuestionPrompt function\nvi.mock('@/lib/utils', () => ({\n sanitizeQuestionPrompt: vi.fn(),\n}));\n\ndescribe('Chat Component', () => {\n const mockPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n ],\n },\n ];\n\n beforeEach(() => {\n vi.mocked(useParams).mockReturnValue({ id: '1' });\n vi.mocked(usePromptsStore).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: vi.fn(),\n });\n vi.mocked(sanitizeQuestionPrompt).mockImplementation((args) => args);\n });\n\n afterEach(() => {\n vi.clearAllMocks();\n cleanup();\n });\n\n it('renders the Chat component with the correct prompts', () => {\n render();\n\n // Check if the user chat bubble is rendered\n const userBubble = screen.getByText('What is your name?');\n expect(userBubble).toBeInTheDocument();\n\n // Check if the AI chat bubble is rendered\n const aiBubble = screen.getByText('My name is John.');\n expect(aiBubble).toBeInTheDocument();\n });\n\n it('does not render chat bubbles if the chat_id does not match', () => {\n vi.mocked(useParams).mockReturnValue({ id: '2' });\n\n render();\n\n // Check if no chat bubbles are rendered\n const userBubble = screen.queryByText('What is your name?');\n expect(userBubble).not.toBeInTheDocument();\n\n const aiBubble = screen.queryByText('My name is John.');\n expect(aiBubble).not.toBeInTheDocument();\n });\n\n it('calls setCurrentPromptId when the component mounts and unmounts', () => {\n const setCurrentPromptIdMock = vi.fn();\n vi.mocked(usePromptsStore).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: setCurrentPromptIdMock,\n });\n\n const { unmount } = render();\n\n expect(setCurrentPromptIdMock).toHaveBeenCalledWith('1');\n\n unmount();\n\n expect(setCurrentPromptIdMock).toHaveBeenCalledWith('');\n });\n\n it('renders only the relevant chat messages', () => {\n const differentPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n {\n question: { message: 'What is your age?' },\n answer: { message: 'I am 30 years old.' },\n },\n ],\n },\n ];\n\n vi.mocked(usePromptsStore).mockReturnValue({\n prompts: differentPrompts,\n setCurrentPromptId: vi.fn(),\n });\n\n render();\n\n // Check if both chat bubbles are rendered\n const userBubble1 = screen.getByText('What is your name?');\n expect(userBubble1).toBeInTheDocument();\n\n const aiBubble1 = screen.getByText('My name is John.');\n expect(aiBubble1).toBeInTheDocument();\n\n const userBubble2 = screen.getByText('What is your age?');\n expect(userBubble2).toBeInTheDocument();\n\n const aiBubble2 = screen.getByText('I am 30 years old.');\n expect(aiBubble2).toBeInTheDocument();\n });\n});\n```\n\n### Explanation\n\n1. **Mocking with Vitest**:\n - We use `vi.mock` to mock the `usePromptsStore` and `useParams` hooks.\n - We also mock the `sanitizeQuestionPrompt` function.\n\n2. **Test Cases**:\n - The test cases are similar to the Jest example, but they use Vitest's API (`vi.mock`, `vi.mocked`, etc.).\n\n3. **Running the Tests**:\n - To run the tests with Vitest, you can use the following command:\n\n ```bash\n npx vitest\n ```\n\n Or, if you have a configuration file (`vitest.config.js`), you can run:\n\n ```bash\n npx vitest run\n ```\n\nBy following this approach, you can effectively unit test the `Chat` component using Vitest, ensuring its reliability and correctness in different scenarios.", + "timestamp": "2025-01-07T17:03:00.747178Z", + "message_id": "c7e29015-5da4-4d72-8657-97f589be4bfd" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-fba7904a4e84452c9a663c65fe83cb56", + "conversation_timestamp": "2025-01-07T17:03:24.177756Z" + }, + "alert_id": "2c701594-eecc-4017-b975-1c8b25fe2299", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-07T17:03:24.177756Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "usa vitest", + "timestamp": "2025-01-07T17:03:23.456169Z", + "message_id": "825022f5-7535-4ec5-99f5-4f2fcdd7d54d" + }, + "answer": { + "message": "Sure! If you prefer using Vitest instead of Jest, you can set up your unit tests using Vitest. Below is an example of how you can write the unit test for the `Chat` component using Vitest:\n\n### Unit Test for `Chat.tsx` using Vitest\n\nFirst, ensure you have Vitest installed:\n\n```bash\nnpm install vitest @vitest/ui --save-dev\n```\n\nThen, you can write the test as follows:\n\n```tsx\nimport { describe, it, expect, vi } from 'vitest';\nimport { render, screen, cleanup } from '@testing-library/react';\nimport { useParams } from 'react-router-dom';\nimport { usePromptsStore } from '@/hooks/usePromptsStore';\nimport { Chat } from './Chat';\nimport { sanitizeQuestionPrompt } from '@/lib/utils';\n\n// Mock the usePromptsStore hook\nvi.mock('@/hooks/usePromptsStore', () => ({\n usePromptsStore: vi.fn(),\n}));\n\n// Mock the useParams hook\nvi.mock('react-router-dom', () => ({\n ...vi.requireActual('react-router-dom'),\n useParams: vi.fn(),\n}));\n\n// Mock the sanitizeQuestionPrompt function\nvi.mock('@/lib/utils', () => ({\n sanitizeQuestionPrompt: vi.fn(),\n}));\n\ndescribe('Chat Component', () => {\n const mockPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n ],\n },\n ];\n\n beforeEach(() => {\n vi.mocked(useParams).mockReturnValue({ id: '1' });\n vi.mocked(usePromptsStore).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: vi.fn(),\n });\n vi.mocked(sanitizeQuestionPrompt).mockImplementation((args) => args);\n });\n\n afterEach(() => {\n vi.clearAllMocks();\n cleanup();\n });\n\n it('renders the Chat component with the correct prompts', () => {\n render();\n\n // Check if the user chat bubble is rendered\n const userBubble = screen.getByText('What is your name?');\n expect(userBubble).toBeInTheDocument();\n\n // Check if the AI chat bubble is rendered\n const aiBubble = screen.getByText('My name is John.');\n expect(aiBubble).toBeInTheDocument();\n });\n\n it('does not render chat bubbles if the chat_id does not match', () => {\n vi.mocked(useParams).mockReturnValue({ id: '2' });\n\n render();\n\n // Check if no chat bubbles are rendered\n const userBubble = screen.queryByText('What is your name?');\n expect(userBubble).not.toBeInTheDocument();\n\n const aiBubble = screen.queryByText('My name is John.');\n expect(aiBubble).not.toBeInTheDocument();\n });\n\n it('calls setCurrentPromptId when the component mounts and unmounts', () => {\n const setCurrentPromptIdMock = vi.fn();\n vi.mocked(usePromptsStore).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: setCurrentPromptIdMock,\n });\n\n const { unmount } = render();\n\n expect(setCurrentPromptIdMock).toHaveBeenCalledWith('1');\n\n unmount();\n\n expect(setCurrentPromptIdMock).toHaveBeenCalledWith('');\n });\n\n it('renders only the relevant chat messages', () => {\n const differentPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n {\n question: { message: 'What is your age?' },\n answer: { message: 'I am 30 years old.' },\n },\n ],\n },\n ];\n\n vi.mocked(usePromptsStore).mockReturnValue({\n prompts: differentPrompts,\n setCurrentPromptId: vi.fn(),\n });\n\n render();\n\n // Check if both chat bubbles are rendered\n const userBubble1 = screen.getByText('What is your name?');\n expect(userBubble1).toBeInTheDocument();\n\n const aiBubble1 = screen.getByText('My name is John.');\n expect(aiBubble1).toBeInTheDocument();\n\n const userBubble2 = screen.getByText('What is your age?');\n expect(userBubble2).toBeInTheDocument();\n\n const aiBubble2 = screen.getByText('I am 30 years old.');\n expect(aiBubble2).toBeInTheDocument();\n });\n});\n```\n\n### Explanation\n\n1. **Mocking with Vitest**:\n - We use `vi.mock` to mock the `usePromptsStore` and `useParams` hooks.\n - We also mock the `sanitizeQuestionPrompt` function.\n\n2. **Test Cases**:\n - The test cases are similar to the Jest example, but they use Vitest's API (`vi.mock`, `vi.mocked`, etc.).\n\n3. **Running the Tests**:\n - To run the tests with Vitest, you can use the following command:\n\n ```bash\n npx vitest\n ```\n\n Or, if you have a configuration file (`vitest.config.js`), you can run:\n\n ```bash\n npx vitest run\n ```\n\nBy following this approach, you can effectively unit test the `Chat` component using Vitest, ensuring its reliability and correctness in different scenarios.", + "timestamp": "2025-01-07T17:03:00.747178Z", + "message_id": "c7e29015-5da4-4d72-8657-97f589be4bfd" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-fba7904a4e84452c9a663c65fe83cb56", + "conversation_timestamp": "2025-01-07T17:03:23.456169Z" + }, + "alert_id": "825022f5-7535-4ec5-99f5-4f2fcdd7d54d", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-07T17:03:23.456169Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "usa vitest", + "timestamp": "2025-01-07T17:03:20.801599Z", + "message_id": "0bfe1fbe-4900-41bc-803f-6a297628f1dc" + }, + "answer": { + "message": "Sure! If you prefer using Vitest instead of Jest, you can set up your unit tests using Vitest. Below is an example of how you can write the unit test for the `Chat` component using Vitest:\n\n### Unit Test for `Chat.tsx` using Vitest\n\nFirst, ensure you have Vitest installed:\n\n```bash\nnpm install vitest @vitest/ui --save-dev\n```\n\nThen, you can write the test as follows:\n\n```tsx\nimport { describe, it, expect, vi } from 'vitest';\nimport { render, screen, cleanup } from '@testing-library/react';\nimport { useParams } from 'react-router-dom';\nimport { usePromptsStore } from '@/hooks/usePromptsStore';\nimport { Chat } from './Chat';\nimport { sanitizeQuestionPrompt } from '@/lib/utils';\n\n// Mock the usePromptsStore hook\nvi.mock('@/hooks/usePromptsStore', () => ({\n usePromptsStore: vi.fn(),\n}));\n\n// Mock the useParams hook\nvi.mock('react-router-dom', () => ({\n ...vi.requireActual('react-router-dom'),\n useParams: vi.fn(),\n}));\n\n// Mock the sanitizeQuestionPrompt function\nvi.mock('@/lib/utils', () => ({\n sanitizeQuestionPrompt: vi.fn(),\n}));\n\ndescribe('Chat Component', () => {\n const mockPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n ],\n },\n ];\n\n beforeEach(() => {\n vi.mocked(useParams).mockReturnValue({ id: '1' });\n vi.mocked(usePromptsStore).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: vi.fn(),\n });\n vi.mocked(sanitizeQuestionPrompt).mockImplementation((args) => args);\n });\n\n afterEach(() => {\n vi.clearAllMocks();\n cleanup();\n });\n\n it('renders the Chat component with the correct prompts', () => {\n render();\n\n // Check if the user chat bubble is rendered\n const userBubble = screen.getByText('What is your name?');\n expect(userBubble).toBeInTheDocument();\n\n // Check if the AI chat bubble is rendered\n const aiBubble = screen.getByText('My name is John.');\n expect(aiBubble).toBeInTheDocument();\n });\n\n it('does not render chat bubbles if the chat_id does not match', () => {\n vi.mocked(useParams).mockReturnValue({ id: '2' });\n\n render();\n\n // Check if no chat bubbles are rendered\n const userBubble = screen.queryByText('What is your name?');\n expect(userBubble).not.toBeInTheDocument();\n\n const aiBubble = screen.queryByText('My name is John.');\n expect(aiBubble).not.toBeInTheDocument();\n });\n\n it('calls setCurrentPromptId when the component mounts and unmounts', () => {\n const setCurrentPromptIdMock = vi.fn();\n vi.mocked(usePromptsStore).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: setCurrentPromptIdMock,\n });\n\n const { unmount } = render();\n\n expect(setCurrentPromptIdMock).toHaveBeenCalledWith('1');\n\n unmount();\n\n expect(setCurrentPromptIdMock).toHaveBeenCalledWith('');\n });\n\n it('renders only the relevant chat messages', () => {\n const differentPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n {\n question: { message: 'What is your age?' },\n answer: { message: 'I am 30 years old.' },\n },\n ],\n },\n ];\n\n vi.mocked(usePromptsStore).mockReturnValue({\n prompts: differentPrompts,\n setCurrentPromptId: vi.fn(),\n });\n\n render();\n\n // Check if both chat bubbles are rendered\n const userBubble1 = screen.getByText('What is your name?');\n expect(userBubble1).toBeInTheDocument();\n\n const aiBubble1 = screen.getByText('My name is John.');\n expect(aiBubble1).toBeInTheDocument();\n\n const userBubble2 = screen.getByText('What is your age?');\n expect(userBubble2).toBeInTheDocument();\n\n const aiBubble2 = screen.getByText('I am 30 years old.');\n expect(aiBubble2).toBeInTheDocument();\n });\n});\n```\n\n### Explanation\n\n1. **Mocking with Vitest**:\n - We use `vi.mock` to mock the `usePromptsStore` and `useParams` hooks.\n - We also mock the `sanitizeQuestionPrompt` function.\n\n2. **Test Cases**:\n - The test cases are similar to the Jest example, but they use Vitest's API (`vi.mock`, `vi.mocked`, etc.).\n\n3. **Running the Tests**:\n - To run the tests with Vitest, you can use the following command:\n\n ```bash\n npx vitest\n ```\n\n Or, if you have a configuration file (`vitest.config.js`), you can run:\n\n ```bash\n npx vitest run\n ```\n\nBy following this approach, you can effectively unit test the `Chat` component using Vitest, ensuring its reliability and correctness in different scenarios.", + "timestamp": "2025-01-07T17:03:00.747178Z", + "message_id": "c7e29015-5da4-4d72-8657-97f589be4bfd" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-fba7904a4e84452c9a663c65fe83cb56", + "conversation_timestamp": "2025-01-07T17:03:20.801599Z" + }, + "alert_id": "0bfe1fbe-4900-41bc-803f-6a297628f1dc", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-07T17:03:20.801599Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "usa vitest", + "timestamp": "2025-01-07T17:03:02.497821Z", + "message_id": "447a4ea8-3ffc-435d-9646-3299b46f88c4" + }, + "answer": { + "message": "Sure! If you prefer using Vitest instead of Jest, you can set up your unit tests using Vitest. Below is an example of how you can write the unit test for the `Chat` component using Vitest:\n\n### Unit Test for `Chat.tsx` using Vitest\n\nFirst, ensure you have Vitest installed:\n\n```bash\nnpm install vitest @vitest/ui --save-dev\n```\n\nThen, you can write the test as follows:\n\n```tsx\nimport { describe, it, expect, vi } from 'vitest';\nimport { render, screen, cleanup } from '@testing-library/react';\nimport { useParams } from 'react-router-dom';\nimport { usePromptsStore } from '@/hooks/usePromptsStore';\nimport { Chat } from './Chat';\nimport { sanitizeQuestionPrompt } from '@/lib/utils';\n\n// Mock the usePromptsStore hook\nvi.mock('@/hooks/usePromptsStore', () => ({\n usePromptsStore: vi.fn(),\n}));\n\n// Mock the useParams hook\nvi.mock('react-router-dom', () => ({\n ...vi.requireActual('react-router-dom'),\n useParams: vi.fn(),\n}));\n\n// Mock the sanitizeQuestionPrompt function\nvi.mock('@/lib/utils', () => ({\n sanitizeQuestionPrompt: vi.fn(),\n}));\n\ndescribe('Chat Component', () => {\n const mockPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n ],\n },\n ];\n\n beforeEach(() => {\n vi.mocked(useParams).mockReturnValue({ id: '1' });\n vi.mocked(usePromptsStore).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: vi.fn(),\n });\n vi.mocked(sanitizeQuestionPrompt).mockImplementation((args) => args);\n });\n\n afterEach(() => {\n vi.clearAllMocks();\n cleanup();\n });\n\n it('renders the Chat component with the correct prompts', () => {\n render();\n\n // Check if the user chat bubble is rendered\n const userBubble = screen.getByText('What is your name?');\n expect(userBubble).toBeInTheDocument();\n\n // Check if the AI chat bubble is rendered\n const aiBubble = screen.getByText('My name is John.');\n expect(aiBubble).toBeInTheDocument();\n });\n\n it('does not render chat bubbles if the chat_id does not match', () => {\n vi.mocked(useParams).mockReturnValue({ id: '2' });\n\n render();\n\n // Check if no chat bubbles are rendered\n const userBubble = screen.queryByText('What is your name?');\n expect(userBubble).not.toBeInTheDocument();\n\n const aiBubble = screen.queryByText('My name is John.');\n expect(aiBubble).not.toBeInTheDocument();\n });\n\n it('calls setCurrentPromptId when the component mounts and unmounts', () => {\n const setCurrentPromptIdMock = vi.fn();\n vi.mocked(usePromptsStore).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: setCurrentPromptIdMock,\n });\n\n const { unmount } = render();\n\n expect(setCurrentPromptIdMock).toHaveBeenCalledWith('1');\n\n unmount();\n\n expect(setCurrentPromptIdMock).toHaveBeenCalledWith('');\n });\n\n it('renders only the relevant chat messages', () => {\n const differentPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n {\n question: { message: 'What is your age?' },\n answer: { message: 'I am 30 years old.' },\n },\n ],\n },\n ];\n\n vi.mocked(usePromptsStore).mockReturnValue({\n prompts: differentPrompts,\n setCurrentPromptId: vi.fn(),\n });\n\n render();\n\n // Check if both chat bubbles are rendered\n const userBubble1 = screen.getByText('What is your name?');\n expect(userBubble1).toBeInTheDocument();\n\n const aiBubble1 = screen.getByText('My name is John.');\n expect(aiBubble1).toBeInTheDocument();\n\n const userBubble2 = screen.getByText('What is your age?');\n expect(userBubble2).toBeInTheDocument();\n\n const aiBubble2 = screen.getByText('I am 30 years old.');\n expect(aiBubble2).toBeInTheDocument();\n });\n});\n```\n\n### Explanation\n\n1. **Mocking with Vitest**:\n - We use `vi.mock` to mock the `usePromptsStore` and `useParams` hooks.\n - We also mock the `sanitizeQuestionPrompt` function.\n\n2. **Test Cases**:\n - The test cases are similar to the Jest example, but they use Vitest's API (`vi.mock`, `vi.mocked`, etc.).\n\n3. **Running the Tests**:\n - To run the tests with Vitest, you can use the following command:\n\n ```bash\n npx vitest\n ```\n\n Or, if you have a configuration file (`vitest.config.js`), you can run:\n\n ```bash\n npx vitest run\n ```\n\nBy following this approach, you can effectively unit test the `Chat` component using Vitest, ensuring its reliability and correctness in different scenarios.", + "timestamp": "2025-01-07T17:03:00.747178Z", + "message_id": "c7e29015-5da4-4d72-8657-97f589be4bfd" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-fba7904a4e84452c9a663c65fe83cb56", + "conversation_timestamp": "2025-01-07T17:03:02.497821Z" + }, + "alert_id": "447a4ea8-3ffc-435d-9646-3299b46f88c4", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-07T17:03:02.497821Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "usa vitest", + "timestamp": "2025-01-07T17:02:59.915982Z", + "message_id": "0295adb9-d2a4-4249-b946-252bb37d7153" + }, + "answer": { + "message": "Sure! If you prefer using Vitest instead of Jest, you can set up your unit tests using Vitest. Below is an example of how you can write the unit test for the `Chat` component using Vitest:\n\n### Unit Test for `Chat.tsx` using Vitest\n\nFirst, ensure you have Vitest installed:\n\n```bash\nnpm install vitest @vitest/ui --save-dev\n```\n\nThen, you can write the test as follows:\n\n```tsx\nimport { describe, it, expect, vi } from 'vitest';\nimport { render, screen, cleanup } from '@testing-library/react';\nimport { useParams } from 'react-router-dom';\nimport { usePromptsStore } from '@/hooks/usePromptsStore';\nimport { Chat } from './Chat';\nimport { sanitizeQuestionPrompt } from '@/lib/utils';\n\n// Mock the usePromptsStore hook\nvi.mock('@/hooks/usePromptsStore', () => ({\n usePromptsStore: vi.fn(),\n}));\n\n// Mock the useParams hook\nvi.mock('react-router-dom', () => ({\n ...vi.requireActual('react-router-dom'),\n useParams: vi.fn(),\n}));\n\n// Mock the sanitizeQuestionPrompt function\nvi.mock('@/lib/utils', () => ({\n sanitizeQuestionPrompt: vi.fn(),\n}));\n\ndescribe('Chat Component', () => {\n const mockPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n ],\n },\n ];\n\n beforeEach(() => {\n vi.mocked(useParams).mockReturnValue({ id: '1' });\n vi.mocked(usePromptsStore).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: vi.fn(),\n });\n vi.mocked(sanitizeQuestionPrompt).mockImplementation((args) => args);\n });\n\n afterEach(() => {\n vi.clearAllMocks();\n cleanup();\n });\n\n it('renders the Chat component with the correct prompts', () => {\n render();\n\n // Check if the user chat bubble is rendered\n const userBubble = screen.getByText('What is your name?');\n expect(userBubble).toBeInTheDocument();\n\n // Check if the AI chat bubble is rendered\n const aiBubble = screen.getByText('My name is John.');\n expect(aiBubble).toBeInTheDocument();\n });\n\n it('does not render chat bubbles if the chat_id does not match', () => {\n vi.mocked(useParams).mockReturnValue({ id: '2' });\n\n render();\n\n // Check if no chat bubbles are rendered\n const userBubble = screen.queryByText('What is your name?');\n expect(userBubble).not.toBeInTheDocument();\n\n const aiBubble = screen.queryByText('My name is John.');\n expect(aiBubble).not.toBeInTheDocument();\n });\n\n it('calls setCurrentPromptId when the component mounts and unmounts', () => {\n const setCurrentPromptIdMock = vi.fn();\n vi.mocked(usePromptsStore).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: setCurrentPromptIdMock,\n });\n\n const { unmount } = render();\n\n expect(setCurrentPromptIdMock).toHaveBeenCalledWith('1');\n\n unmount();\n\n expect(setCurrentPromptIdMock).toHaveBeenCalledWith('');\n });\n\n it('renders only the relevant chat messages', () => {\n const differentPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n {\n question: { message: 'What is your age?' },\n answer: { message: 'I am 30 years old.' },\n },\n ],\n },\n ];\n\n vi.mocked(usePromptsStore).mockReturnValue({\n prompts: differentPrompts,\n setCurrentPromptId: vi.fn(),\n });\n\n render();\n\n // Check if both chat bubbles are rendered\n const userBubble1 = screen.getByText('What is your name?');\n expect(userBubble1).toBeInTheDocument();\n\n const aiBubble1 = screen.getByText('My name is John.');\n expect(aiBubble1).toBeInTheDocument();\n\n const userBubble2 = screen.getByText('What is your age?');\n expect(userBubble2).toBeInTheDocument();\n\n const aiBubble2 = screen.getByText('I am 30 years old.');\n expect(aiBubble2).toBeInTheDocument();\n });\n});\n```\n\n### Explanation\n\n1. **Mocking with Vitest**:\n - We use `vi.mock` to mock the `usePromptsStore` and `useParams` hooks.\n - We also mock the `sanitizeQuestionPrompt` function.\n\n2. **Test Cases**:\n - The test cases are similar to the Jest example, but they use Vitest's API (`vi.mock`, `vi.mocked`, etc.).\n\n3. **Running the Tests**:\n - To run the tests with Vitest, you can use the following command:\n\n ```bash\n npx vitest\n ```\n\n Or, if you have a configuration file (`vitest.config.js`), you can run:\n\n ```bash\n npx vitest run\n ```\n\nBy following this approach, you can effectively unit test the `Chat` component using Vitest, ensuring its reliability and correctness in different scenarios.", + "timestamp": "2025-01-07T17:03:00.747178Z", + "message_id": "c7e29015-5da4-4d72-8657-97f589be4bfd" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-fba7904a4e84452c9a663c65fe83cb56", + "conversation_timestamp": "2025-01-07T17:02:59.915982Z" + }, + "alert_id": "0295adb9-d2a4-4249-b946-252bb37d7153", + "code_snippet": null, + "trigger_string": "GitHub - Access Token:\n\n```tsx src/App.tsx (26-26)\n const test = \"ghp_token\";\n```\nwhat about this?", + "trigger_type": "codegate-secrets", + "trigger_category": "critical", + "timestamp": "2025-01-07T17:02:59.915982Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "```/Users/giuseppe/workspace/codegate-ui/src/components/Chat.tsx\nimport {\n ChatBubble,\n ChatBubbleAvatar,\n ChatBubbleMessage,\n} from \"./ui/chat/chat-bubble\";\nimport { ChatMessageList } from \"./ui/chat/chat-message-list\";\nimport { useParams } from \"react-router-dom\";\nimport { usePromptsStore } from \"@/hooks/usePromptsStore\";\nimport { Markdown } from \"./Markdown\";\nimport { useEffect } from \"react\";\nimport { sanitizeQuestionPrompt } from \"@/lib/utils\";\n\nexport function Chat() {\n const { id } = useParams();\n const { prompts, setCurrentPromptId } = usePromptsStore();\n const chat = prompts.find((prompt) => prompt.chat_id === id);\n\n useEffect(() => {\n if (id) {\n setCurrentPromptId(id);\n }\n\n return () => setCurrentPromptId(\"\");\n }, [prompts, id, setCurrentPromptId]);\n\n return (\n
\n \n {(chat?.question_answers ?? []).map(({ question, answer }, index) => (\n
\n \n \n \n \n {sanitizeQuestionPrompt({\n question: question?.message ?? \"\",\n answer: answer?.message ?? \"\",\n })}\n \n \n \n \n \n \n {answer?.message ?? \"\"}\n \n \n
\n ))}\n
\n
\n );\n}\n\n```\n\nChat.tsx suggest me a unit test, considering that usePromptStore is a zust store and it is initialized in the upper component", + "timestamp": "2025-01-07T16:58:33.378551Z", + "message_id": "0cf4fba8-0f45-4294-b612-7c2f8cf89ad8" + }, + "answer": { + "message": "Certainly! To unit test the `Chat` component, you can use a testing library like React Testing Library along with Jest. Since `usePromptsStore` is a Zustand store, we need to mock it to control its behavior in our tests.\n\nHere's a comprehensive unit test for the `Chat` component:\n\n1. **Set up the testing environment**.\n2. **Mock the `usePromptsStore` hook**.\n3. **Test the component's rendering and behavior based on different scenarios**.\n\nBelow is an example of how you can write the unit test:\n\n### Unit Test for `Chat.tsx`\n\n```tsx\nimport React from 'react';\nimport { render, screen, cleanup } from '@testing-library/react';\nimport { Provider } from 'react-redux';\nimport configureStore from 'redux-mock-store';\nimport { usePromptsStore } from '@/hooks/usePromptsStore';\nimport { Chat } from './Chat';\nimport { useParams } from 'react-router-dom';\nimport { sanitizeQuestionPrompt } from '@/lib/utils';\n\n// Mock the usePromptsStore hook\njest.mock('@/hooks/usePromptsStore', () => ({\n usePromptsStore: jest.fn(),\n}));\n\n// Mock the useParams hook\njest.mock('react-router-dom', () => ({\n ...jest.requireActual('react-router-dom'),\n useParams: jest.fn(),\n}));\n\n// Mock the sanitizeQuestionPrompt function\njest.mock('@/lib/utils', () => ({\n sanitizeQuestionPrompt: jest.fn(),\n}));\n\ndescribe('Chat Component', () => {\n const mockPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n ],\n },\n ];\n\n beforeEach(() => {\n (useParams as jest.Mock).mockReturnValue({ id: '1' });\n (usePromptsStore as jest.Mock).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: jest.fn(),\n });\n (sanitizeQuestionPrompt as jest.Mock).mockImplementation((args) => args);\n });\n\n afterEach(() => {\n jest.clearAllMocks();\n cleanup();\n });\n\n it('renders the Chat component with the correct prompts', () => {\n render();\n\n // Check if the user chat bubble is rendered\n const userBubble = screen.getByText('What is your name?');\n expect(userBubble).toBeInTheDocument();\n\n // Check if the AI chat bubble is rendered\n const aiBubble = screen.getByText('My name is John.');\n expect(aiBubble).toBeInTheDocument();\n });\n\n it('does not render chat bubbles if the chat_id does not match', () => {\n (useParams as jest.Mock).mockReturnValue({ id: '2' });\n\n render();\n\n // Check if no chat bubbles are rendered\n const userBubble = screen.queryByText('What is your name?');\n expect(userBubble).not.toBeInTheDocument();\n\n const aiBubble = screen.queryByText('My name is John.');\n expect(aiBubble).not.toBeInTheDocument();\n });\n\n it('calls setCurrentPromptId when the component mounts and unmounts', () => {\n const setCurrentPromptIdMock = jest.fn();\n (usePromptsStore as jest.Mock).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: setCurrentPromptIdMock,\n });\n\n const { unmount } = render();\n\n expect(setCurrentPromptIdMock).toHaveBeenCalledWith('1');\n\n unmount();\n\n expect(setCurrentPromptIdMock).toHaveBeenCalledWith('');\n });\n\n it('renders only the relevant chat messages', () => {\n const differentPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n {\n question: { message: 'What is your age?' },\n answer: { message: 'I am 30 years old.' },\n },\n ],\n },\n ];\n\n (usePromptsStore as jest.Mock).mockReturnValue({\n prompts: differentPrompts,\n setCurrentPromptId: jest.fn(),\n });\n\n render();\n\n // Check if both chat bubbles are rendered\n const userBubble1 = screen.getByText('What is your name?');\n expect(userBubble1).toBeInTheDocument();\n\n const aiBubble1 = screen.getByText('My name is John.');\n expect(aiBubble1).toBeInTheDocument();\n\n const userBubble2 = screen.getByText('What is your age?');\n expect(userBubble2).toBeInTheDocument();\n\n const aiBubble2 = screen.getByText('I am 30 years old.');\n expect(aiBubble2).toBeInTheDocument();\n });\n});\n```\n\n### Explanation of the Test Cases\n\n1. **Renders the Chat component with the correct prompts**:\n - This test checks if the `Chat` component correctly renders the chat bubbles for the given `chat_id`.\n - It verifies that both the user's question and the AI's answer are displayed.\n\n2. **Does not render chat bubbles if the chat_id does not match**:\n - This test ensures that no chat bubbles are rendered when the `chat_id` does not match any prompt in the store.\n - It checks that both the user's question and the AI's answer are not present in the DOM.\n\n3. **Calls `setCurrentPromptId` when the component mounts and unmounts**:\n - This test verifies that the `setCurrentPromptId` function is called with the correct `chat_id` when the `Chat` component mounts.\n - It also checks that `setCurrentPromptId` is called with an empty string when the component unmounts.\n\n4. **Renders only the relevant chat messages**:\n - This test ensures that the `Chat` component renders all the relevant chat messages for the given `chat_id`.\n - It verifies that multiple messages are correctly displayed in the chat.\n\n### Running the Tests\n\nTo run the tests, you can use the following command:\n\n```bash\nnpm test\n```\n\nOr, if you are using Yarn:\n\n```bash\nyarn test\n```\n\nThis will execute the Jest test suite and provide you with the test results, ensuring that the `Chat` component behaves as expected.\n\n### Additional Considerations\n\n- **Mocking Functions**: The `sanitizeQuestionPrompt` function is also mocked to prevent it from affecting the test results. You can adjust the mock implementation as needed based on the function's behavior.\n- **Test Coverage**: Ensure that your tests cover different scenarios, including edge cases, to provide comprehensive coverage for the `Chat` component.\n- **Environment Setup**: Make sure that your testing environment is correctly set up with the necessary dependencies (e.g., `@testing-library/react`, `jest`, `react-redux`, etc.).\n\nBy following this approach, you can effectively unit test the `Chat` component and ensure its reliability and correctness in different scenarios.", + "timestamp": "2025-01-07T16:58:06.294750Z", + "message_id": "5543ce37-8146-4e2b-8f61-3bcfa9d2fd03" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-9aefb648b1c2426d9d6166ac4c7666c8", + "conversation_timestamp": "2025-01-07T16:58:33.378551Z" + }, + "alert_id": "0cf4fba8-0f45-4294-b612-7c2f8cf89ad8", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-07T16:58:33.378551Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "```/Users/giuseppe/workspace/codegate-ui/src/components/Chat.tsx\nimport {\n ChatBubble,\n ChatBubbleAvatar,\n ChatBubbleMessage,\n} from \"./ui/chat/chat-bubble\";\nimport { ChatMessageList } from \"./ui/chat/chat-message-list\";\nimport { useParams } from \"react-router-dom\";\nimport { usePromptsStore } from \"@/hooks/usePromptsStore\";\nimport { Markdown } from \"./Markdown\";\nimport { useEffect } from \"react\";\nimport { sanitizeQuestionPrompt } from \"@/lib/utils\";\n\nexport function Chat() {\n const { id } = useParams();\n const { prompts, setCurrentPromptId } = usePromptsStore();\n const chat = prompts.find((prompt) => prompt.chat_id === id);\n\n useEffect(() => {\n if (id) {\n setCurrentPromptId(id);\n }\n\n return () => setCurrentPromptId(\"\");\n }, [prompts, id, setCurrentPromptId]);\n\n return (\n
\n \n {(chat?.question_answers ?? []).map(({ question, answer }, index) => (\n
\n \n \n \n \n {sanitizeQuestionPrompt({\n question: question?.message ?? \"\",\n answer: answer?.message ?? \"\",\n })}\n \n \n \n \n \n \n {answer?.message ?? \"\"}\n \n \n
\n ))}\n
\n
\n );\n}\n\n```\n\nChat.tsx suggest me a unit test, considering that usePromptStore is a zust store and it is initialized in the upper component", + "timestamp": "2025-01-07T16:58:32.995939Z", + "message_id": "a907a5de-284b-4b70-98e8-58dd724fd4b1" + }, + "answer": { + "message": "Certainly! To unit test the `Chat` component, you can use a testing library like React Testing Library along with Jest. Since `usePromptsStore` is a Zustand store, we need to mock it to control its behavior in our tests.\n\nHere's a comprehensive unit test for the `Chat` component:\n\n1. **Set up the testing environment**.\n2. **Mock the `usePromptsStore` hook**.\n3. **Test the component's rendering and behavior based on different scenarios**.\n\nBelow is an example of how you can write the unit test:\n\n### Unit Test for `Chat.tsx`\n\n```tsx\nimport React from 'react';\nimport { render, screen, cleanup } from '@testing-library/react';\nimport { Provider } from 'react-redux';\nimport configureStore from 'redux-mock-store';\nimport { usePromptsStore } from '@/hooks/usePromptsStore';\nimport { Chat } from './Chat';\nimport { useParams } from 'react-router-dom';\nimport { sanitizeQuestionPrompt } from '@/lib/utils';\n\n// Mock the usePromptsStore hook\njest.mock('@/hooks/usePromptsStore', () => ({\n usePromptsStore: jest.fn(),\n}));\n\n// Mock the useParams hook\njest.mock('react-router-dom', () => ({\n ...jest.requireActual('react-router-dom'),\n useParams: jest.fn(),\n}));\n\n// Mock the sanitizeQuestionPrompt function\njest.mock('@/lib/utils', () => ({\n sanitizeQuestionPrompt: jest.fn(),\n}));\n\ndescribe('Chat Component', () => {\n const mockPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n ],\n },\n ];\n\n beforeEach(() => {\n (useParams as jest.Mock).mockReturnValue({ id: '1' });\n (usePromptsStore as jest.Mock).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: jest.fn(),\n });\n (sanitizeQuestionPrompt as jest.Mock).mockImplementation((args) => args);\n });\n\n afterEach(() => {\n jest.clearAllMocks();\n cleanup();\n });\n\n it('renders the Chat component with the correct prompts', () => {\n render();\n\n // Check if the user chat bubble is rendered\n const userBubble = screen.getByText('What is your name?');\n expect(userBubble).toBeInTheDocument();\n\n // Check if the AI chat bubble is rendered\n const aiBubble = screen.getByText('My name is John.');\n expect(aiBubble).toBeInTheDocument();\n });\n\n it('does not render chat bubbles if the chat_id does not match', () => {\n (useParams as jest.Mock).mockReturnValue({ id: '2' });\n\n render();\n\n // Check if no chat bubbles are rendered\n const userBubble = screen.queryByText('What is your name?');\n expect(userBubble).not.toBeInTheDocument();\n\n const aiBubble = screen.queryByText('My name is John.');\n expect(aiBubble).not.toBeInTheDocument();\n });\n\n it('calls setCurrentPromptId when the component mounts and unmounts', () => {\n const setCurrentPromptIdMock = jest.fn();\n (usePromptsStore as jest.Mock).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: setCurrentPromptIdMock,\n });\n\n const { unmount } = render();\n\n expect(setCurrentPromptIdMock).toHaveBeenCalledWith('1');\n\n unmount();\n\n expect(setCurrentPromptIdMock).toHaveBeenCalledWith('');\n });\n\n it('renders only the relevant chat messages', () => {\n const differentPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n {\n question: { message: 'What is your age?' },\n answer: { message: 'I am 30 years old.' },\n },\n ],\n },\n ];\n\n (usePromptsStore as jest.Mock).mockReturnValue({\n prompts: differentPrompts,\n setCurrentPromptId: jest.fn(),\n });\n\n render();\n\n // Check if both chat bubbles are rendered\n const userBubble1 = screen.getByText('What is your name?');\n expect(userBubble1).toBeInTheDocument();\n\n const aiBubble1 = screen.getByText('My name is John.');\n expect(aiBubble1).toBeInTheDocument();\n\n const userBubble2 = screen.getByText('What is your age?');\n expect(userBubble2).toBeInTheDocument();\n\n const aiBubble2 = screen.getByText('I am 30 years old.');\n expect(aiBubble2).toBeInTheDocument();\n });\n});\n```\n\n### Explanation of the Test Cases\n\n1. **Renders the Chat component with the correct prompts**:\n - This test checks if the `Chat` component correctly renders the chat bubbles for the given `chat_id`.\n - It verifies that both the user's question and the AI's answer are displayed.\n\n2. **Does not render chat bubbles if the chat_id does not match**:\n - This test ensures that no chat bubbles are rendered when the `chat_id` does not match any prompt in the store.\n - It checks that both the user's question and the AI's answer are not present in the DOM.\n\n3. **Calls `setCurrentPromptId` when the component mounts and unmounts**:\n - This test verifies that the `setCurrentPromptId` function is called with the correct `chat_id` when the `Chat` component mounts.\n - It also checks that `setCurrentPromptId` is called with an empty string when the component unmounts.\n\n4. **Renders only the relevant chat messages**:\n - This test ensures that the `Chat` component renders all the relevant chat messages for the given `chat_id`.\n - It verifies that multiple messages are correctly displayed in the chat.\n\n### Running the Tests\n\nTo run the tests, you can use the following command:\n\n```bash\nnpm test\n```\n\nOr, if you are using Yarn:\n\n```bash\nyarn test\n```\n\nThis will execute the Jest test suite and provide you with the test results, ensuring that the `Chat` component behaves as expected.\n\n### Additional Considerations\n\n- **Mocking Functions**: The `sanitizeQuestionPrompt` function is also mocked to prevent it from affecting the test results. You can adjust the mock implementation as needed based on the function's behavior.\n- **Test Coverage**: Ensure that your tests cover different scenarios, including edge cases, to provide comprehensive coverage for the `Chat` component.\n- **Environment Setup**: Make sure that your testing environment is correctly set up with the necessary dependencies (e.g., `@testing-library/react`, `jest`, `react-redux`, etc.).\n\nBy following this approach, you can effectively unit test the `Chat` component and ensure its reliability and correctness in different scenarios.", + "timestamp": "2025-01-07T16:58:06.294750Z", + "message_id": "5543ce37-8146-4e2b-8f61-3bcfa9d2fd03" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-9aefb648b1c2426d9d6166ac4c7666c8", + "conversation_timestamp": "2025-01-07T16:58:32.995939Z" + }, + "alert_id": "a907a5de-284b-4b70-98e8-58dd724fd4b1", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-07T16:58:32.995939Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "```/Users/giuseppe/workspace/codegate-ui/src/components/Chat.tsx\nimport {\n ChatBubble,\n ChatBubbleAvatar,\n ChatBubbleMessage,\n} from \"./ui/chat/chat-bubble\";\nimport { ChatMessageList } from \"./ui/chat/chat-message-list\";\nimport { useParams } from \"react-router-dom\";\nimport { usePromptsStore } from \"@/hooks/usePromptsStore\";\nimport { Markdown } from \"./Markdown\";\nimport { useEffect } from \"react\";\nimport { sanitizeQuestionPrompt } from \"@/lib/utils\";\n\nexport function Chat() {\n const { id } = useParams();\n const { prompts, setCurrentPromptId } = usePromptsStore();\n const chat = prompts.find((prompt) => prompt.chat_id === id);\n\n useEffect(() => {\n if (id) {\n setCurrentPromptId(id);\n }\n\n return () => setCurrentPromptId(\"\");\n }, [prompts, id, setCurrentPromptId]);\n\n return (\n
\n \n {(chat?.question_answers ?? []).map(({ question, answer }, index) => (\n
\n \n \n \n \n {sanitizeQuestionPrompt({\n question: question?.message ?? \"\",\n answer: answer?.message ?? \"\",\n })}\n \n \n \n \n \n \n {answer?.message ?? \"\"}\n \n \n
\n ))}\n
\n
\n );\n}\n\n```\n\nChat.tsx suggest me a unit test, considering that usePromptStore is a zust store and it is initialized in the upper component", + "timestamp": "2025-01-07T16:58:27.183321Z", + "message_id": "6475e8d6-b090-409e-811c-f85c1bbba868" + }, + "answer": { + "message": "Certainly! To unit test the `Chat` component, you can use a testing library like React Testing Library along with Jest. Since `usePromptsStore` is a Zustand store, we need to mock it to control its behavior in our tests.\n\nHere's a comprehensive unit test for the `Chat` component:\n\n1. **Set up the testing environment**.\n2. **Mock the `usePromptsStore` hook**.\n3. **Test the component's rendering and behavior based on different scenarios**.\n\nBelow is an example of how you can write the unit test:\n\n### Unit Test for `Chat.tsx`\n\n```tsx\nimport React from 'react';\nimport { render, screen, cleanup } from '@testing-library/react';\nimport { Provider } from 'react-redux';\nimport configureStore from 'redux-mock-store';\nimport { usePromptsStore } from '@/hooks/usePromptsStore';\nimport { Chat } from './Chat';\nimport { useParams } from 'react-router-dom';\nimport { sanitizeQuestionPrompt } from '@/lib/utils';\n\n// Mock the usePromptsStore hook\njest.mock('@/hooks/usePromptsStore', () => ({\n usePromptsStore: jest.fn(),\n}));\n\n// Mock the useParams hook\njest.mock('react-router-dom', () => ({\n ...jest.requireActual('react-router-dom'),\n useParams: jest.fn(),\n}));\n\n// Mock the sanitizeQuestionPrompt function\njest.mock('@/lib/utils', () => ({\n sanitizeQuestionPrompt: jest.fn(),\n}));\n\ndescribe('Chat Component', () => {\n const mockPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n ],\n },\n ];\n\n beforeEach(() => {\n (useParams as jest.Mock).mockReturnValue({ id: '1' });\n (usePromptsStore as jest.Mock).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: jest.fn(),\n });\n (sanitizeQuestionPrompt as jest.Mock).mockImplementation((args) => args);\n });\n\n afterEach(() => {\n jest.clearAllMocks();\n cleanup();\n });\n\n it('renders the Chat component with the correct prompts', () => {\n render();\n\n // Check if the user chat bubble is rendered\n const userBubble = screen.getByText('What is your name?');\n expect(userBubble).toBeInTheDocument();\n\n // Check if the AI chat bubble is rendered\n const aiBubble = screen.getByText('My name is John.');\n expect(aiBubble).toBeInTheDocument();\n });\n\n it('does not render chat bubbles if the chat_id does not match', () => {\n (useParams as jest.Mock).mockReturnValue({ id: '2' });\n\n render();\n\n // Check if no chat bubbles are rendered\n const userBubble = screen.queryByText('What is your name?');\n expect(userBubble).not.toBeInTheDocument();\n\n const aiBubble = screen.queryByText('My name is John.');\n expect(aiBubble).not.toBeInTheDocument();\n });\n\n it('calls setCurrentPromptId when the component mounts and unmounts', () => {\n const setCurrentPromptIdMock = jest.fn();\n (usePromptsStore as jest.Mock).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: setCurrentPromptIdMock,\n });\n\n const { unmount } = render();\n\n expect(setCurrentPromptIdMock).toHaveBeenCalledWith('1');\n\n unmount();\n\n expect(setCurrentPromptIdMock).toHaveBeenCalledWith('');\n });\n\n it('renders only the relevant chat messages', () => {\n const differentPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n {\n question: { message: 'What is your age?' },\n answer: { message: 'I am 30 years old.' },\n },\n ],\n },\n ];\n\n (usePromptsStore as jest.Mock).mockReturnValue({\n prompts: differentPrompts,\n setCurrentPromptId: jest.fn(),\n });\n\n render();\n\n // Check if both chat bubbles are rendered\n const userBubble1 = screen.getByText('What is your name?');\n expect(userBubble1).toBeInTheDocument();\n\n const aiBubble1 = screen.getByText('My name is John.');\n expect(aiBubble1).toBeInTheDocument();\n\n const userBubble2 = screen.getByText('What is your age?');\n expect(userBubble2).toBeInTheDocument();\n\n const aiBubble2 = screen.getByText('I am 30 years old.');\n expect(aiBubble2).toBeInTheDocument();\n });\n});\n```\n\n### Explanation of the Test Cases\n\n1. **Renders the Chat component with the correct prompts**:\n - This test checks if the `Chat` component correctly renders the chat bubbles for the given `chat_id`.\n - It verifies that both the user's question and the AI's answer are displayed.\n\n2. **Does not render chat bubbles if the chat_id does not match**:\n - This test ensures that no chat bubbles are rendered when the `chat_id` does not match any prompt in the store.\n - It checks that both the user's question and the AI's answer are not present in the DOM.\n\n3. **Calls `setCurrentPromptId` when the component mounts and unmounts**:\n - This test verifies that the `setCurrentPromptId` function is called with the correct `chat_id` when the `Chat` component mounts.\n - It also checks that `setCurrentPromptId` is called with an empty string when the component unmounts.\n\n4. **Renders only the relevant chat messages**:\n - This test ensures that the `Chat` component renders all the relevant chat messages for the given `chat_id`.\n - It verifies that multiple messages are correctly displayed in the chat.\n\n### Running the Tests\n\nTo run the tests, you can use the following command:\n\n```bash\nnpm test\n```\n\nOr, if you are using Yarn:\n\n```bash\nyarn test\n```\n\nThis will execute the Jest test suite and provide you with the test results, ensuring that the `Chat` component behaves as expected.\n\n### Additional Considerations\n\n- **Mocking Functions**: The `sanitizeQuestionPrompt` function is also mocked to prevent it from affecting the test results. You can adjust the mock implementation as needed based on the function's behavior.\n- **Test Coverage**: Ensure that your tests cover different scenarios, including edge cases, to provide comprehensive coverage for the `Chat` component.\n- **Environment Setup**: Make sure that your testing environment is correctly set up with the necessary dependencies (e.g., `@testing-library/react`, `jest`, `react-redux`, etc.).\n\nBy following this approach, you can effectively unit test the `Chat` component and ensure its reliability and correctness in different scenarios.", + "timestamp": "2025-01-07T16:58:06.294750Z", + "message_id": "5543ce37-8146-4e2b-8f61-3bcfa9d2fd03" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-9aefb648b1c2426d9d6166ac4c7666c8", + "conversation_timestamp": "2025-01-07T16:58:27.183321Z" + }, + "alert_id": "6475e8d6-b090-409e-811c-f85c1bbba868", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-07T16:58:27.183321Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "```/Users/giuseppe/workspace/codegate-ui/src/components/Chat.tsx\nimport {\n ChatBubble,\n ChatBubbleAvatar,\n ChatBubbleMessage,\n} from \"./ui/chat/chat-bubble\";\nimport { ChatMessageList } from \"./ui/chat/chat-message-list\";\nimport { useParams } from \"react-router-dom\";\nimport { usePromptsStore } from \"@/hooks/usePromptsStore\";\nimport { Markdown } from \"./Markdown\";\nimport { useEffect } from \"react\";\nimport { sanitizeQuestionPrompt } from \"@/lib/utils\";\n\nexport function Chat() {\n const { id } = useParams();\n const { prompts, setCurrentPromptId } = usePromptsStore();\n const chat = prompts.find((prompt) => prompt.chat_id === id);\n\n useEffect(() => {\n if (id) {\n setCurrentPromptId(id);\n }\n\n return () => setCurrentPromptId(\"\");\n }, [prompts, id, setCurrentPromptId]);\n\n return (\n
\n \n {(chat?.question_answers ?? []).map(({ question, answer }, index) => (\n
\n \n \n \n \n {sanitizeQuestionPrompt({\n question: question?.message ?? \"\",\n answer: answer?.message ?? \"\",\n })}\n \n \n \n \n \n \n {answer?.message ?? \"\"}\n \n \n
\n ))}\n
\n
\n );\n}\n\n```\n\nChat.tsx suggest me a unit test, considering that usePromptStore is a zust store and it is initialized in the upper component", + "timestamp": "2025-01-07T16:58:05.556767Z", + "message_id": "d3ae4da7-f3a4-48e6-889b-ea9fb3ffdaf9" + }, + "answer": { + "message": "Certainly! To unit test the `Chat` component, you can use a testing library like React Testing Library along with Jest. Since `usePromptsStore` is a Zustand store, we need to mock it to control its behavior in our tests.\n\nHere's a comprehensive unit test for the `Chat` component:\n\n1. **Set up the testing environment**.\n2. **Mock the `usePromptsStore` hook**.\n3. **Test the component's rendering and behavior based on different scenarios**.\n\nBelow is an example of how you can write the unit test:\n\n### Unit Test for `Chat.tsx`\n\n```tsx\nimport React from 'react';\nimport { render, screen, cleanup } from '@testing-library/react';\nimport { Provider } from 'react-redux';\nimport configureStore from 'redux-mock-store';\nimport { usePromptsStore } from '@/hooks/usePromptsStore';\nimport { Chat } from './Chat';\nimport { useParams } from 'react-router-dom';\nimport { sanitizeQuestionPrompt } from '@/lib/utils';\n\n// Mock the usePromptsStore hook\njest.mock('@/hooks/usePromptsStore', () => ({\n usePromptsStore: jest.fn(),\n}));\n\n// Mock the useParams hook\njest.mock('react-router-dom', () => ({\n ...jest.requireActual('react-router-dom'),\n useParams: jest.fn(),\n}));\n\n// Mock the sanitizeQuestionPrompt function\njest.mock('@/lib/utils', () => ({\n sanitizeQuestionPrompt: jest.fn(),\n}));\n\ndescribe('Chat Component', () => {\n const mockPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n ],\n },\n ];\n\n beforeEach(() => {\n (useParams as jest.Mock).mockReturnValue({ id: '1' });\n (usePromptsStore as jest.Mock).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: jest.fn(),\n });\n (sanitizeQuestionPrompt as jest.Mock).mockImplementation((args) => args);\n });\n\n afterEach(() => {\n jest.clearAllMocks();\n cleanup();\n });\n\n it('renders the Chat component with the correct prompts', () => {\n render();\n\n // Check if the user chat bubble is rendered\n const userBubble = screen.getByText('What is your name?');\n expect(userBubble).toBeInTheDocument();\n\n // Check if the AI chat bubble is rendered\n const aiBubble = screen.getByText('My name is John.');\n expect(aiBubble).toBeInTheDocument();\n });\n\n it('does not render chat bubbles if the chat_id does not match', () => {\n (useParams as jest.Mock).mockReturnValue({ id: '2' });\n\n render();\n\n // Check if no chat bubbles are rendered\n const userBubble = screen.queryByText('What is your name?');\n expect(userBubble).not.toBeInTheDocument();\n\n const aiBubble = screen.queryByText('My name is John.');\n expect(aiBubble).not.toBeInTheDocument();\n });\n\n it('calls setCurrentPromptId when the component mounts and unmounts', () => {\n const setCurrentPromptIdMock = jest.fn();\n (usePromptsStore as jest.Mock).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: setCurrentPromptIdMock,\n });\n\n const { unmount } = render();\n\n expect(setCurrentPromptIdMock).toHaveBeenCalledWith('1');\n\n unmount();\n\n expect(setCurrentPromptIdMock).toHaveBeenCalledWith('');\n });\n\n it('renders only the relevant chat messages', () => {\n const differentPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n {\n question: { message: 'What is your age?' },\n answer: { message: 'I am 30 years old.' },\n },\n ],\n },\n ];\n\n (usePromptsStore as jest.Mock).mockReturnValue({\n prompts: differentPrompts,\n setCurrentPromptId: jest.fn(),\n });\n\n render();\n\n // Check if both chat bubbles are rendered\n const userBubble1 = screen.getByText('What is your name?');\n expect(userBubble1).toBeInTheDocument();\n\n const aiBubble1 = screen.getByText('My name is John.');\n expect(aiBubble1).toBeInTheDocument();\n\n const userBubble2 = screen.getByText('What is your age?');\n expect(userBubble2).toBeInTheDocument();\n\n const aiBubble2 = screen.getByText('I am 30 years old.');\n expect(aiBubble2).toBeInTheDocument();\n });\n});\n```\n\n### Explanation of the Test Cases\n\n1. **Renders the Chat component with the correct prompts**:\n - This test checks if the `Chat` component correctly renders the chat bubbles for the given `chat_id`.\n - It verifies that both the user's question and the AI's answer are displayed.\n\n2. **Does not render chat bubbles if the chat_id does not match**:\n - This test ensures that no chat bubbles are rendered when the `chat_id` does not match any prompt in the store.\n - It checks that both the user's question and the AI's answer are not present in the DOM.\n\n3. **Calls `setCurrentPromptId` when the component mounts and unmounts**:\n - This test verifies that the `setCurrentPromptId` function is called with the correct `chat_id` when the `Chat` component mounts.\n - It also checks that `setCurrentPromptId` is called with an empty string when the component unmounts.\n\n4. **Renders only the relevant chat messages**:\n - This test ensures that the `Chat` component renders all the relevant chat messages for the given `chat_id`.\n - It verifies that multiple messages are correctly displayed in the chat.\n\n### Running the Tests\n\nTo run the tests, you can use the following command:\n\n```bash\nnpm test\n```\n\nOr, if you are using Yarn:\n\n```bash\nyarn test\n```\n\nThis will execute the Jest test suite and provide you with the test results, ensuring that the `Chat` component behaves as expected.\n\n### Additional Considerations\n\n- **Mocking Functions**: The `sanitizeQuestionPrompt` function is also mocked to prevent it from affecting the test results. You can adjust the mock implementation as needed based on the function's behavior.\n- **Test Coverage**: Ensure that your tests cover different scenarios, including edge cases, to provide comprehensive coverage for the `Chat` component.\n- **Environment Setup**: Make sure that your testing environment is correctly set up with the necessary dependencies (e.g., `@testing-library/react`, `jest`, `react-redux`, etc.).\n\nBy following this approach, you can effectively unit test the `Chat` component and ensure its reliability and correctness in different scenarios.", + "timestamp": "2025-01-07T16:58:06.294750Z", + "message_id": "5543ce37-8146-4e2b-8f61-3bcfa9d2fd03" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-9aefb648b1c2426d9d6166ac4c7666c8", + "conversation_timestamp": "2025-01-07T16:58:05.556767Z" + }, + "alert_id": "d3ae4da7-f3a4-48e6-889b-ea9fb3ffdaf9", + "code_snippet": { + "code": "import {\n ChatBubble,\n ChatBubbleAvatar,\n ChatBubbleMessage,\n} from \"./ui/chat/chat-bubble\";\nimport { ChatMessageList } from \"./ui/chat/chat-message-list\";\nimport { useParams } from \"react-router-dom\";\nimport { usePromptsStore } from \"@/hooks/usePromptsStore\";\nimport { Markdown } from \"./Markdown\";\nimport { useEffect } from \"react\";\nimport { sanitizeQuestionPrompt } from \"@/lib/utils\";\n\nexport function Chat() {\n const { id } = useParams();\n const { prompts, setCurrentPromptId } = usePromptsStore();\n const chat = prompts.find((prompt) => prompt.chat_id === id);\n\n useEffect(() => {\n if (id) {\n setCurrentPromptId(id);\n }\n\n return () => setCurrentPromptId(\"\");\n }, [prompts, id, setCurrentPromptId]);\n\n return (\n
\n \n {(chat?.question_answers ?? []).map(({ question, answer }, index) => (\n
\n \n \n \n \n {sanitizeQuestionPrompt({\n question: question?.message ?? \"\",\n answer: answer?.message ?? \"\",\n })}\n \n \n \n \n \n \n {answer?.message ?? \"\"}\n \n \n
\n ))}\n
\n
\n );\n}\n\n", + "language": "typescript", + "filepath": "/Users/giuseppe/workspace/codegate-ui/src/components/Chat.tsx", + "libraries": [] + }, + "trigger_string": null, + "trigger_type": "code-snippet-extractor", + "trigger_category": "info", + "timestamp": "2025-01-07T16:58:05.556767Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "```/Users/giuseppe/workspace/codegate-ui/src/components/Chat.tsx\nimport {\n ChatBubble,\n ChatBubbleAvatar,\n ChatBubbleMessage,\n} from \"./ui/chat/chat-bubble\";\nimport { ChatMessageList } from \"./ui/chat/chat-message-list\";\nimport { useParams } from \"react-router-dom\";\nimport { usePromptsStore } from \"@/hooks/usePromptsStore\";\nimport { Markdown } from \"./Markdown\";\nimport { useEffect } from \"react\";\nimport { sanitizeQuestionPrompt } from \"@/lib/utils\";\n\nexport function Chat() {\n const { id } = useParams();\n const { prompts, setCurrentPromptId } = usePromptsStore();\n const chat = prompts.find((prompt) => prompt.chat_id === id);\n\n useEffect(() => {\n if (id) {\n setCurrentPromptId(id);\n }\n\n return () => setCurrentPromptId(\"\");\n }, [prompts, id, setCurrentPromptId]);\n\n return (\n
\n \n {(chat?.question_answers ?? []).map(({ question, answer }, index) => (\n
\n \n \n \n \n {sanitizeQuestionPrompt({\n question: question?.message ?? \"\",\n answer: answer?.message ?? \"\",\n })}\n \n \n \n \n \n \n {answer?.message ?? \"\"}\n \n \n
\n ))}\n
\n
\n );\n}\n\n```\n\nChat.tsx suggest me a unit test, considering that usePromptStore is a zust store and it is initialized in the upper component", + "timestamp": "2025-01-07T16:58:05.536580Z", + "message_id": "ab8603f9-c78c-461f-998a-ca7d1eb54eec" + }, + "answer": { + "message": "Certainly! To unit test the `Chat` component, you can use a testing library like React Testing Library along with Jest. Since `usePromptsStore` is a Zustand store, we need to mock it to control its behavior in our tests.\n\nHere's a comprehensive unit test for the `Chat` component:\n\n1. **Set up the testing environment**.\n2. **Mock the `usePromptsStore` hook**.\n3. **Test the component's rendering and behavior based on different scenarios**.\n\nBelow is an example of how you can write the unit test:\n\n### Unit Test for `Chat.tsx`\n\n```tsx\nimport React from 'react';\nimport { render, screen, cleanup } from '@testing-library/react';\nimport { Provider } from 'react-redux';\nimport configureStore from 'redux-mock-store';\nimport { usePromptsStore } from '@/hooks/usePromptsStore';\nimport { Chat } from './Chat';\nimport { useParams } from 'react-router-dom';\nimport { sanitizeQuestionPrompt } from '@/lib/utils';\n\n// Mock the usePromptsStore hook\njest.mock('@/hooks/usePromptsStore', () => ({\n usePromptsStore: jest.fn(),\n}));\n\n// Mock the useParams hook\njest.mock('react-router-dom', () => ({\n ...jest.requireActual('react-router-dom'),\n useParams: jest.fn(),\n}));\n\n// Mock the sanitizeQuestionPrompt function\njest.mock('@/lib/utils', () => ({\n sanitizeQuestionPrompt: jest.fn(),\n}));\n\ndescribe('Chat Component', () => {\n const mockPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n ],\n },\n ];\n\n beforeEach(() => {\n (useParams as jest.Mock).mockReturnValue({ id: '1' });\n (usePromptsStore as jest.Mock).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: jest.fn(),\n });\n (sanitizeQuestionPrompt as jest.Mock).mockImplementation((args) => args);\n });\n\n afterEach(() => {\n jest.clearAllMocks();\n cleanup();\n });\n\n it('renders the Chat component with the correct prompts', () => {\n render();\n\n // Check if the user chat bubble is rendered\n const userBubble = screen.getByText('What is your name?');\n expect(userBubble).toBeInTheDocument();\n\n // Check if the AI chat bubble is rendered\n const aiBubble = screen.getByText('My name is John.');\n expect(aiBubble).toBeInTheDocument();\n });\n\n it('does not render chat bubbles if the chat_id does not match', () => {\n (useParams as jest.Mock).mockReturnValue({ id: '2' });\n\n render();\n\n // Check if no chat bubbles are rendered\n const userBubble = screen.queryByText('What is your name?');\n expect(userBubble).not.toBeInTheDocument();\n\n const aiBubble = screen.queryByText('My name is John.');\n expect(aiBubble).not.toBeInTheDocument();\n });\n\n it('calls setCurrentPromptId when the component mounts and unmounts', () => {\n const setCurrentPromptIdMock = jest.fn();\n (usePromptsStore as jest.Mock).mockReturnValue({\n prompts: mockPrompts,\n setCurrentPromptId: setCurrentPromptIdMock,\n });\n\n const { unmount } = render();\n\n expect(setCurrentPromptIdMock).toHaveBeenCalledWith('1');\n\n unmount();\n\n expect(setCurrentPromptIdMock).toHaveBeenCalledWith('');\n });\n\n it('renders only the relevant chat messages', () => {\n const differentPrompts = [\n {\n chat_id: '1',\n question_answers: [\n {\n question: { message: 'What is your name?' },\n answer: { message: 'My name is John.' },\n },\n {\n question: { message: 'What is your age?' },\n answer: { message: 'I am 30 years old.' },\n },\n ],\n },\n ];\n\n (usePromptsStore as jest.Mock).mockReturnValue({\n prompts: differentPrompts,\n setCurrentPromptId: jest.fn(),\n });\n\n render();\n\n // Check if both chat bubbles are rendered\n const userBubble1 = screen.getByText('What is your name?');\n expect(userBubble1).toBeInTheDocument();\n\n const aiBubble1 = screen.getByText('My name is John.');\n expect(aiBubble1).toBeInTheDocument();\n\n const userBubble2 = screen.getByText('What is your age?');\n expect(userBubble2).toBeInTheDocument();\n\n const aiBubble2 = screen.getByText('I am 30 years old.');\n expect(aiBubble2).toBeInTheDocument();\n });\n});\n```\n\n### Explanation of the Test Cases\n\n1. **Renders the Chat component with the correct prompts**:\n - This test checks if the `Chat` component correctly renders the chat bubbles for the given `chat_id`.\n - It verifies that both the user's question and the AI's answer are displayed.\n\n2. **Does not render chat bubbles if the chat_id does not match**:\n - This test ensures that no chat bubbles are rendered when the `chat_id` does not match any prompt in the store.\n - It checks that both the user's question and the AI's answer are not present in the DOM.\n\n3. **Calls `setCurrentPromptId` when the component mounts and unmounts**:\n - This test verifies that the `setCurrentPromptId` function is called with the correct `chat_id` when the `Chat` component mounts.\n - It also checks that `setCurrentPromptId` is called with an empty string when the component unmounts.\n\n4. **Renders only the relevant chat messages**:\n - This test ensures that the `Chat` component renders all the relevant chat messages for the given `chat_id`.\n - It verifies that multiple messages are correctly displayed in the chat.\n\n### Running the Tests\n\nTo run the tests, you can use the following command:\n\n```bash\nnpm test\n```\n\nOr, if you are using Yarn:\n\n```bash\nyarn test\n```\n\nThis will execute the Jest test suite and provide you with the test results, ensuring that the `Chat` component behaves as expected.\n\n### Additional Considerations\n\n- **Mocking Functions**: The `sanitizeQuestionPrompt` function is also mocked to prevent it from affecting the test results. You can adjust the mock implementation as needed based on the function's behavior.\n- **Test Coverage**: Ensure that your tests cover different scenarios, including edge cases, to provide comprehensive coverage for the `Chat` component.\n- **Environment Setup**: Make sure that your testing environment is correctly set up with the necessary dependencies (e.g., `@testing-library/react`, `jest`, `react-redux`, etc.).\n\nBy following this approach, you can effectively unit test the `Chat` component and ensure its reliability and correctness in different scenarios.", + "timestamp": "2025-01-07T16:58:06.294750Z", + "message_id": "5543ce37-8146-4e2b-8f61-3bcfa9d2fd03" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-9aefb648b1c2426d9d6166ac4c7666c8", + "conversation_timestamp": "2025-01-07T16:58:05.536580Z" + }, + "alert_id": "ab8603f9-c78c-461f-998a-ca7d1eb54eec", + "code_snippet": null, + "trigger_string": null, + "trigger_type": "codegate-secrets", + "trigger_category": "critical", + "timestamp": "2025-01-07T16:58:05.536580Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/App.tsx (26-26)\n const test = \"REDACTED<$ALXI7QG3ctLPwoZg+pfdR0tl57uRcFoSlnlM3hAl4KwABX7fo9t2R8wMDG8SNYTOgyubDz+N+04f1xF8PcMrEQleiM6+wHedO4/aOYGcLA==>\";\n```\nwhat about this?", + "timestamp": "2025-01-07T11:59:47.363041Z", + "message_id": "a369c446-860f-4e67-a22d-ed14066c0ebc" + }, + "answer": { + "message": "**CodeGate Security Analysis**\n\nThe provided code snippet contains a string that is likely an encoded value, specifically a Base64 encoded string. Here is a detailed analysis:\n\n### Security Vulnerabilities and Potential Risks\n\n1. **Sensitive Data Handling**:\n - The string starts with \"REDACTED\", indicating that it contains sensitive information that has been masked or obfuscated. However, the actual value is still present and could be potentially revealing if decoded.\n - Using \"REDACTED\" is a good practice for hiding sensitive information in logs, but it's important to ensure that the actual sensitive data is not exposed.\n\n2. **Decoding Risks**:\n - If the string is Base64 encoded, decoding it could reveal sensitive information such as API keys, tokens, or other credentials.\n - Decoding and handling such sensitive data in client-side code (like `App.tsx`) can expose it to potential attackers if the data is transmitted or logged.\n\n3. **Potential for Injection**:\n - If the decoded string is used in any form of user input or external communication, there is a risk of injection attacks (e.g., SQL injection, cross-site scripting, etc.).\n\n### Best Practices for Secure Implementation\n\n1. **Avoid Hardcoding Sensitive Data**:\n - Never hardcode sensitive data such as API keys, tokens, or passwords directly in your source code. Use environment variables or secure vaults to manage such data.\n\n2. **Proper Encoding and Decoding**:\n - Ensure that encoding and decoding operations are performed securely and that the decoded data is handled with care to prevent unauthorized access or usage.\n\n3. **Data Validation and Sanitization**:\n - Always validate and sanitize any data that is used in your application. This includes checking for malicious content or unexpected formats.\n\n4. **Secure Logging**:\n - Avoid logging sensitive data directly. If logging is necessary, ensure that sensitive information is either sanitized or replaced with placeholders.\n\n### Recommendations for Security Improvements\n\n1. **Use Environment Variables**:\n - Replace the hardcoded string with an environment variable. For example:\n ```typescript\n const test = process.env.REACT_APP_REDACTED_TOKEN;\n ```\n - Ensure that environment variables are securely managed and not exposed in version control systems.\n\n2. **Implement Access Controls**:\n - Restrict access to sensitive data to only those parts of your application that require it. Use role-based access controls (RBAC) to manage permissions.\n\n3. **Regular Security Audits**:\n - Conduct regular security audits and code reviews to identify and address potential security vulnerabilities.\n\n4. **Stay Updated with Security Standards**:\n - Follow security best practices and guidelines such as those provided by OWASP (Open Web Application Security Project) and other relevant organizations.\n\n### References to Relevant Security Standards or Guidelines\n\n- **OWASP**: [OWASP Security Guidelines](https://owasp.org/)\n- **Secure Coding Practices**: [Secure Coding Guidelines](https://www.securecoding.org/)\n- **Environment Variables**: [12factor.net - Config](https://12factor.net/config)\n\nBy following these best practices and recommendations, you can help ensure that your application handles sensitive data securely and mitigates potential security risks.", + "timestamp": "2025-01-07T11:59:37.955501Z", + "message_id": "ee880b69-82f8-4616-9ac1-e582676c0ebf" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-b920c417a94f4a2e864680319688c631", + "conversation_timestamp": "2025-01-07T11:59:47.363041Z" + }, + "alert_id": "a369c446-860f-4e67-a22d-ed14066c0ebc", + "code_snippet": null, + "trigger_string": " ```", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-07T11:59:47.363041Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/App.tsx (26-26)\n const test = \"REDACTED<$ALXI7QG3ctLPwoZg+pfdR0tl57uRcFoSlnlM3hAl4KwABX7fo9t2R8wMDG8SNYTOgyubDz+N+04f1xF8PcMrEQleiM6+wHedO4/aOYGcLA==>\";\n```\nwhat about this?", + "timestamp": "2025-01-07T11:59:37.411834Z", + "message_id": "ecdc8c1c-8331-4944-9c85-574a9c07444f" + }, + "answer": { + "message": "**CodeGate Security Analysis**\n\nThe provided code snippet contains a string that is likely an encoded value, specifically a Base64 encoded string. Here is a detailed analysis:\n\n### Security Vulnerabilities and Potential Risks\n\n1. **Sensitive Data Handling**:\n - The string starts with \"REDACTED\", indicating that it contains sensitive information that has been masked or obfuscated. However, the actual value is still present and could be potentially revealing if decoded.\n - Using \"REDACTED\" is a good practice for hiding sensitive information in logs, but it's important to ensure that the actual sensitive data is not exposed.\n\n2. **Decoding Risks**:\n - If the string is Base64 encoded, decoding it could reveal sensitive information such as API keys, tokens, or other credentials.\n - Decoding and handling such sensitive data in client-side code (like `App.tsx`) can expose it to potential attackers if the data is transmitted or logged.\n\n3. **Potential for Injection**:\n - If the decoded string is used in any form of user input or external communication, there is a risk of injection attacks (e.g., SQL injection, cross-site scripting, etc.).\n\n### Best Practices for Secure Implementation\n\n1. **Avoid Hardcoding Sensitive Data**:\n - Never hardcode sensitive data such as API keys, tokens, or passwords directly in your source code. Use environment variables or secure vaults to manage such data.\n\n2. **Proper Encoding and Decoding**:\n - Ensure that encoding and decoding operations are performed securely and that the decoded data is handled with care to prevent unauthorized access or usage.\n\n3. **Data Validation and Sanitization**:\n - Always validate and sanitize any data that is used in your application. This includes checking for malicious content or unexpected formats.\n\n4. **Secure Logging**:\n - Avoid logging sensitive data directly. If logging is necessary, ensure that sensitive information is either sanitized or replaced with placeholders.\n\n### Recommendations for Security Improvements\n\n1. **Use Environment Variables**:\n - Replace the hardcoded string with an environment variable. For example:\n ```typescript\n const test = process.env.REACT_APP_REDACTED_TOKEN;\n ```\n - Ensure that environment variables are securely managed and not exposed in version control systems.\n\n2. **Implement Access Controls**:\n - Restrict access to sensitive data to only those parts of your application that require it. Use role-based access controls (RBAC) to manage permissions.\n\n3. **Regular Security Audits**:\n - Conduct regular security audits and code reviews to identify and address potential security vulnerabilities.\n\n4. **Stay Updated with Security Standards**:\n - Follow security best practices and guidelines such as those provided by OWASP (Open Web Application Security Project) and other relevant organizations.\n\n### References to Relevant Security Standards or Guidelines\n\n- **OWASP**: [OWASP Security Guidelines](https://owasp.org/)\n- **Secure Coding Practices**: [Secure Coding Guidelines](https://www.securecoding.org/)\n- **Environment Variables**: [12factor.net - Config](https://12factor.net/config)\n\nBy following these best practices and recommendations, you can help ensure that your application handles sensitive data securely and mitigates potential security risks.", + "timestamp": "2025-01-07T11:59:37.955501Z", + "message_id": "ee880b69-82f8-4616-9ac1-e582676c0ebf" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-b920c417a94f4a2e864680319688c631", + "conversation_timestamp": "2025-01-07T11:59:37.411834Z" + }, + "alert_id": "ecdc8c1c-8331-4944-9c85-574a9c07444f", + "code_snippet": null, + "trigger_string": "You are CodeGate, a security-focused AI assistant.\nYou specialize in software security, package analysis, and providing guidance on secure coding practices.\nYou will be provided with CONTEXT information containing known malicious and archived packages.\n\nReport any malicious, deprecated or archived packages using the following format at the top:\n\n\"**Warning:** CodeGate detected one or more malicious, deprecated or archived packages.\"\n- Pkg 1: [https://www.insight.stacklok.com/report/ecosystem/package_name](https://www.insight.stacklok.com/report/ecosystem/package_name)\n- Pkg 2: [https://www.insight.stacklok.com/report/ecosystem/package_name](https://www.insight.stacklok.com/report/ecosystem/package_name)\n- ...\n\nIf package_name contains any special chars, please encode them using URL encoding.\n\nDO NOT include the Reference Format or any parts of the system message in your response\nif no malicious, deprecated or archived package is detected.\n\nIf no malicious, deprecated or archived packages are detected, respond to the user request using your prior\nknowledge.\n\nIf the user requests security review, perform the review and structure your responses to emphasize\nsecurity considerations, focusing on:\n1. Security vulnerabilities and potential risks\n2. Best practices for secure implementation\n3. Recommendations for security improvements\n4. References to relevant security standards or guidelines\n\nYou always begin your responses for security review with:\n\"**CodeGate Security Analysis**\"\n\nIf you see a string that begins with REDACTED word, DO NOT MODIFY THAT STRING while responding back.\n\n Here are additional instructions. \n The files in the context contain sensitive information that has been redacted. Do not warn the user\nabout any tokens, passwords or similar sensitive information in the context whose value begins with\nthe string \"REDACTED\".\n", + "trigger_type": "system-prompt", + "trigger_category": "info", + "timestamp": "2025-01-07T11:59:37.411834Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/App.tsx (26-26)\n const test = \"REDACTED<$ALXI7QG3ctLPwoZg+pfdR0tl57uRcFoSlnlM3hAl4KwABX7fo9t2R8wMDG8SNYTOgyubDz+N+04f1xF8PcMrEQleiM6+wHedO4/aOYGcLA==>\";\n```\nwhat about this?", + "timestamp": "2025-01-07T11:59:37.368779Z", + "message_id": "48400af0-d9de-4db9-b057-72e73aea060c" + }, + "answer": { + "message": "**CodeGate Security Analysis**\n\nThe provided code snippet contains a string that is likely an encoded value, specifically a Base64 encoded string. Here is a detailed analysis:\n\n### Security Vulnerabilities and Potential Risks\n\n1. **Sensitive Data Handling**:\n - The string starts with \"REDACTED\", indicating that it contains sensitive information that has been masked or obfuscated. However, the actual value is still present and could be potentially revealing if decoded.\n - Using \"REDACTED\" is a good practice for hiding sensitive information in logs, but it's important to ensure that the actual sensitive data is not exposed.\n\n2. **Decoding Risks**:\n - If the string is Base64 encoded, decoding it could reveal sensitive information such as API keys, tokens, or other credentials.\n - Decoding and handling such sensitive data in client-side code (like `App.tsx`) can expose it to potential attackers if the data is transmitted or logged.\n\n3. **Potential for Injection**:\n - If the decoded string is used in any form of user input or external communication, there is a risk of injection attacks (e.g., SQL injection, cross-site scripting, etc.).\n\n### Best Practices for Secure Implementation\n\n1. **Avoid Hardcoding Sensitive Data**:\n - Never hardcode sensitive data such as API keys, tokens, or passwords directly in your source code. Use environment variables or secure vaults to manage such data.\n\n2. **Proper Encoding and Decoding**:\n - Ensure that encoding and decoding operations are performed securely and that the decoded data is handled with care to prevent unauthorized access or usage.\n\n3. **Data Validation and Sanitization**:\n - Always validate and sanitize any data that is used in your application. This includes checking for malicious content or unexpected formats.\n\n4. **Secure Logging**:\n - Avoid logging sensitive data directly. If logging is necessary, ensure that sensitive information is either sanitized or replaced with placeholders.\n\n### Recommendations for Security Improvements\n\n1. **Use Environment Variables**:\n - Replace the hardcoded string with an environment variable. For example:\n ```typescript\n const test = process.env.REACT_APP_REDACTED_TOKEN;\n ```\n - Ensure that environment variables are securely managed and not exposed in version control systems.\n\n2. **Implement Access Controls**:\n - Restrict access to sensitive data to only those parts of your application that require it. Use role-based access controls (RBAC) to manage permissions.\n\n3. **Regular Security Audits**:\n - Conduct regular security audits and code reviews to identify and address potential security vulnerabilities.\n\n4. **Stay Updated with Security Standards**:\n - Follow security best practices and guidelines such as those provided by OWASP (Open Web Application Security Project) and other relevant organizations.\n\n### References to Relevant Security Standards or Guidelines\n\n- **OWASP**: [OWASP Security Guidelines](https://owasp.org/)\n- **Secure Coding Practices**: [Secure Coding Guidelines](https://www.securecoding.org/)\n- **Environment Variables**: [12factor.net - Config](https://12factor.net/config)\n\nBy following these best practices and recommendations, you can help ensure that your application handles sensitive data securely and mitigates potential security risks.", + "timestamp": "2025-01-07T11:59:37.955501Z", + "message_id": "ee880b69-82f8-4616-9ac1-e582676c0ebf" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-b920c417a94f4a2e864680319688c631", + "conversation_timestamp": "2025-01-07T11:59:37.368779Z" + }, + "alert_id": "48400af0-d9de-4db9-b057-72e73aea060c", + "code_snippet": { + "code": " const test = \"REDACTED<$ALXI7QG3ctLPwoZg+pfdR0tl57uRcFoSlnlM3hAl4KwABX7fo9t2R8wMDG8SNYTOgyubDz+N+04f1xF8PcMrEQleiM6+wHedO4/aOYGcLA==>\";\n", + "language": "typescript", + "filepath": "src/App.tsx", + "libraries": [] + }, + "trigger_string": null, + "trigger_type": "code-snippet-extractor", + "trigger_category": "info", + "timestamp": "2025-01-07T11:59:37.368779Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/App.tsx (26-26)\n const test = \"REDACTED<$ALXI7QG3ctLPwoZg+pfdR0tl57uRcFoSlnlM3hAl4KwABX7fo9t2R8wMDG8SNYTOgyubDz+N+04f1xF8PcMrEQleiM6+wHedO4/aOYGcLA==>\";\n```\nwhat about this?", + "timestamp": "2025-01-07T11:59:37.368573Z", + "message_id": "a6a6ad7a-6634-4e46-99bf-bda84c70841f" + }, + "answer": { + "message": "**CodeGate Security Analysis**\n\nThe provided code snippet contains a string that is likely an encoded value, specifically a Base64 encoded string. Here is a detailed analysis:\n\n### Security Vulnerabilities and Potential Risks\n\n1. **Sensitive Data Handling**:\n - The string starts with \"REDACTED\", indicating that it contains sensitive information that has been masked or obfuscated. However, the actual value is still present and could be potentially revealing if decoded.\n - Using \"REDACTED\" is a good practice for hiding sensitive information in logs, but it's important to ensure that the actual sensitive data is not exposed.\n\n2. **Decoding Risks**:\n - If the string is Base64 encoded, decoding it could reveal sensitive information such as API keys, tokens, or other credentials.\n - Decoding and handling such sensitive data in client-side code (like `App.tsx`) can expose it to potential attackers if the data is transmitted or logged.\n\n3. **Potential for Injection**:\n - If the decoded string is used in any form of user input or external communication, there is a risk of injection attacks (e.g., SQL injection, cross-site scripting, etc.).\n\n### Best Practices for Secure Implementation\n\n1. **Avoid Hardcoding Sensitive Data**:\n - Never hardcode sensitive data such as API keys, tokens, or passwords directly in your source code. Use environment variables or secure vaults to manage such data.\n\n2. **Proper Encoding and Decoding**:\n - Ensure that encoding and decoding operations are performed securely and that the decoded data is handled with care to prevent unauthorized access or usage.\n\n3. **Data Validation and Sanitization**:\n - Always validate and sanitize any data that is used in your application. This includes checking for malicious content or unexpected formats.\n\n4. **Secure Logging**:\n - Avoid logging sensitive data directly. If logging is necessary, ensure that sensitive information is either sanitized or replaced with placeholders.\n\n### Recommendations for Security Improvements\n\n1. **Use Environment Variables**:\n - Replace the hardcoded string with an environment variable. For example:\n ```typescript\n const test = process.env.REACT_APP_REDACTED_TOKEN;\n ```\n - Ensure that environment variables are securely managed and not exposed in version control systems.\n\n2. **Implement Access Controls**:\n - Restrict access to sensitive data to only those parts of your application that require it. Use role-based access controls (RBAC) to manage permissions.\n\n3. **Regular Security Audits**:\n - Conduct regular security audits and code reviews to identify and address potential security vulnerabilities.\n\n4. **Stay Updated with Security Standards**:\n - Follow security best practices and guidelines such as those provided by OWASP (Open Web Application Security Project) and other relevant organizations.\n\n### References to Relevant Security Standards or Guidelines\n\n- **OWASP**: [OWASP Security Guidelines](https://owasp.org/)\n- **Secure Coding Practices**: [Secure Coding Guidelines](https://www.securecoding.org/)\n- **Environment Variables**: [12factor.net - Config](https://12factor.net/config)\n\nBy following these best practices and recommendations, you can help ensure that your application handles sensitive data securely and mitigates potential security risks.", + "timestamp": "2025-01-07T11:59:37.955501Z", + "message_id": "ee880b69-82f8-4616-9ac1-e582676c0ebf" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-b920c417a94f4a2e864680319688c631", + "conversation_timestamp": "2025-01-07T11:59:37.368573Z" + }, + "alert_id": "a6a6ad7a-6634-4e46-99bf-bda84c70841f", + "code_snippet": null, + "trigger_string": { + "content": "The files in the context contain sensitive information that has been redacted. Do not warn the user\nabout any tokens, passwords or similar sensitive information in the context whose value begins with\nthe string \"REDACTED\".\n", + "role": "system" + }, + "trigger_type": "add-system-message", + "trigger_category": "info", + "timestamp": "2025-01-07T11:59:37.368573Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/App.tsx (26-26)\n const test = \"REDACTED<$ALXI7QG3ctLPwoZg+pfdR0tl57uRcFoSlnlM3hAl4KwABX7fo9t2R8wMDG8SNYTOgyubDz+N+04f1xF8PcMrEQleiM6+wHedO4/aOYGcLA==>\";\n```\nwhat about this?", + "timestamp": "2025-01-07T11:59:37.368302Z", + "message_id": "a802a7cd-490a-4425-9c94-d758a8a1d65a" + }, + "answer": { + "message": "**CodeGate Security Analysis**\n\nThe provided code snippet contains a string that is likely an encoded value, specifically a Base64 encoded string. Here is a detailed analysis:\n\n### Security Vulnerabilities and Potential Risks\n\n1. **Sensitive Data Handling**:\n - The string starts with \"REDACTED\", indicating that it contains sensitive information that has been masked or obfuscated. However, the actual value is still present and could be potentially revealing if decoded.\n - Using \"REDACTED\" is a good practice for hiding sensitive information in logs, but it's important to ensure that the actual sensitive data is not exposed.\n\n2. **Decoding Risks**:\n - If the string is Base64 encoded, decoding it could reveal sensitive information such as API keys, tokens, or other credentials.\n - Decoding and handling such sensitive data in client-side code (like `App.tsx`) can expose it to potential attackers if the data is transmitted or logged.\n\n3. **Potential for Injection**:\n - If the decoded string is used in any form of user input or external communication, there is a risk of injection attacks (e.g., SQL injection, cross-site scripting, etc.).\n\n### Best Practices for Secure Implementation\n\n1. **Avoid Hardcoding Sensitive Data**:\n - Never hardcode sensitive data such as API keys, tokens, or passwords directly in your source code. Use environment variables or secure vaults to manage such data.\n\n2. **Proper Encoding and Decoding**:\n - Ensure that encoding and decoding operations are performed securely and that the decoded data is handled with care to prevent unauthorized access or usage.\n\n3. **Data Validation and Sanitization**:\n - Always validate and sanitize any data that is used in your application. This includes checking for malicious content or unexpected formats.\n\n4. **Secure Logging**:\n - Avoid logging sensitive data directly. If logging is necessary, ensure that sensitive information is either sanitized or replaced with placeholders.\n\n### Recommendations for Security Improvements\n\n1. **Use Environment Variables**:\n - Replace the hardcoded string with an environment variable. For example:\n ```typescript\n const test = process.env.REACT_APP_REDACTED_TOKEN;\n ```\n - Ensure that environment variables are securely managed and not exposed in version control systems.\n\n2. **Implement Access Controls**:\n - Restrict access to sensitive data to only those parts of your application that require it. Use role-based access controls (RBAC) to manage permissions.\n\n3. **Regular Security Audits**:\n - Conduct regular security audits and code reviews to identify and address potential security vulnerabilities.\n\n4. **Stay Updated with Security Standards**:\n - Follow security best practices and guidelines such as those provided by OWASP (Open Web Application Security Project) and other relevant organizations.\n\n### References to Relevant Security Standards or Guidelines\n\n- **OWASP**: [OWASP Security Guidelines](https://owasp.org/)\n- **Secure Coding Practices**: [Secure Coding Guidelines](https://www.securecoding.org/)\n- **Environment Variables**: [12factor.net - Config](https://12factor.net/config)\n\nBy following these best practices and recommendations, you can help ensure that your application handles sensitive data securely and mitigates potential security risks.", + "timestamp": "2025-01-07T11:59:37.955501Z", + "message_id": "ee880b69-82f8-4616-9ac1-e582676c0ebf" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-b920c417a94f4a2e864680319688c631", + "conversation_timestamp": "2025-01-07T11:59:37.368302Z" + }, + "alert_id": "a802a7cd-490a-4425-9c94-d758a8a1d65a", + "code_snippet": null, + "trigger_string": "GitHub - Access Token:\n\n```tsx src/App.tsx (26-26)\n const test = \"ghp_token\";\n```\nwhat about this?", + "trigger_type": "codegate-secrets", + "trigger_category": "critical", + "timestamp": "2025-01-07T11:59:37.368302Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "<|fim_prefix|>// diff --git a/nginx.conf b/nginx.conf\n// deleted file mode 100644\n// index 5cb9648..0000000\n// --- a/nginx.conf\n// +++ /dev/null\n// @@ -1,28 +0,0 @@\n// -server {\n// - listen 80;\n// -\n// - server_name localhost;\n// -\n// - root /usr/share/nginx/html;\n// -\n// - index index.html;\n// -\n// - # Serve the front-end application for all unmatched routes\n// - location / {\n// - try_files $uri /index.html;\n// - }\n// -\n// - # Serve static files for assets\n// - location /assets/ {\n// - root /usr/share/nginx/html;\n// - expires max;\n// - add_header Cache-Control public;\n// - }\n// -\n// - # Serve certificate file directly\n// - location /certificates/ {\n// - root /usr/share/nginx/html;\n// - default_type application/octet-stream;\n// - autoindex on;\n// - }\n// -}\n// diff --git a/src/App.tsx b/src/App.tsx\n// index fafa5bf..7ef1167 100644\n// --- a/src/App.tsx\n// +++ b/src/App.tsx\n// @@ -22,6 +22,7 @@ import { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n// function App() {\n// const { prompts, loading, fetchPrompts } = usePromptsStore();\n// useSse();\n// + const test = \"REDACTED<$R3729uXD0y9maelHD4ZYEwaPaBozg1TxUaGVHZGv+jDhvflIhH895IeecdTUififnHvAIXKcEiXu+IqYnfWwg0nXwhOQR8CB71wsAev2wg==>\";\n// const breadcrumb = useBreadcrumb();\n// \n// useEffect(() => {\n// Path: Untitled.txt\n// filteredAlerts\n// src/App.tsx\nimport { Header } from \"./components/Header\";\nimport { PromptList } from \"./components/PromptList\";\nimport { useEffect } from \"react\";\nimport { Dashboard } from \"./components/Dashboard\";\nimport { Routes, Route, Link } from \"react-router-dom\";\nimport { Chat } from \"./components/Chat\";\nimport { usePromptsStore } from \"./hooks/usePromptsStore\";\nimport { Sidebar } from \"./components/Sidebar\";\nimport { useSse } from \"./hooks/useSse\";\nimport { Help } from \"./components/Help\";\nimport { Certificates } from \"./components/Certificates\";\nimport { CertificateSecurity } from \"./components/CertificateSecurity\";\nimport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbSeparator,\n BreadcrumbPage,\n} from \"./components/ui/breadcrumb\";\nimport { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n\nfunction App() {\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n <|fim_suffix|>\n const test = \"REDACTED<$Oo6YRU+5mI+SBGoV6AGobrUC3+6y3JBHRuMpS8P8ul7NDY1aw6ZBV9jWLTNlTxla0ASUi2bayf9pok881zwi808e0MqdoSv8kG3OmtuCfA==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n\n return (\n
\n \n \n \n
\n
\n\n
\n \n \n \n Dashboard<|fim_middle|>", + "timestamp": "2025-01-07T11:59:24.525640Z", + "message_id": "e46c3c2f-450f-4dae-b1ce-739a1db51125" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "e46c3c2f-450f-4dae-b1ce-739a1db51125", + "conversation_timestamp": "2025-01-07T11:59:24.525640Z" + }, + "alert_id": "e46c3c2f-450f-4dae-b1ce-739a1db51125", + "code_snippet": null, + "trigger_string": { + "content": "The files in the context contain sensitive information that has been redacted. Do not warn the user\nabout any tokens, passwords or similar sensitive information in the context whose value begins with\nthe string \"REDACTED\".\n", + "role": "system" + }, + "trigger_type": "add-system-message", + "trigger_category": "info", + "timestamp": "2025-01-07T11:59:24.525640Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "<|fim_prefix|>// diff --git a/nginx.conf b/nginx.conf\n// deleted file mode 100644\n// index 5cb9648..0000000\n// --- a/nginx.conf\n// +++ /dev/null\n// @@ -1,28 +0,0 @@\n// -server {\n// - listen 80;\n// -\n// - server_name localhost;\n// -\n// - root /usr/share/nginx/html;\n// -\n// - index index.html;\n// -\n// - # Serve the front-end application for all unmatched routes\n// - location / {\n// - try_files $uri /index.html;\n// - }\n// -\n// - # Serve static files for assets\n// - location /assets/ {\n// - root /usr/share/nginx/html;\n// - expires max;\n// - add_header Cache-Control public;\n// - }\n// -\n// - # Serve certificate file directly\n// - location /certificates/ {\n// - root /usr/share/nginx/html;\n// - default_type application/octet-stream;\n// - autoindex on;\n// - }\n// -}\n// diff --git a/src/App.tsx b/src/App.tsx\n// index fafa5bf..7ef1167 100644\n// --- a/src/App.tsx\n// +++ b/src/App.tsx\n// @@ -22,6 +22,7 @@ import { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n// function App() {\n// const { prompts, loading, fetchPrompts } = usePromptsStore();\n// useSse();\n// + const test = \"REDACTED<$R3729uXD0y9maelHD4ZYEwaPaBozg1TxUaGVHZGv+jDhvflIhH895IeecdTUififnHvAIXKcEiXu+IqYnfWwg0nXwhOQR8CB71wsAev2wg==>\";\n// const breadcrumb = useBreadcrumb();\n// \n// useEffect(() => {\n// Path: Untitled.txt\n// filteredAlerts\n// src/App.tsx\nimport { Header } from \"./components/Header\";\nimport { PromptList } from \"./components/PromptList\";\nimport { useEffect } from \"react\";\nimport { Dashboard } from \"./components/Dashboard\";\nimport { Routes, Route, Link } from \"react-router-dom\";\nimport { Chat } from \"./components/Chat\";\nimport { usePromptsStore } from \"./hooks/usePromptsStore\";\nimport { Sidebar } from \"./components/Sidebar\";\nimport { useSse } from \"./hooks/useSse\";\nimport { Help } from \"./components/Help\";\nimport { Certificates } from \"./components/Certificates\";\nimport { CertificateSecurity } from \"./components/CertificateSecurity\";\nimport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbSeparator,\n BreadcrumbPage,\n} from \"./components/ui/breadcrumb\";\nimport { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n\nfunction App() {\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n <|fim_suffix|>\n const test = \"REDACTED<$Oo6YRU+5mI+SBGoV6AGobrUC3+6y3JBHRuMpS8P8ul7NDY1aw6ZBV9jWLTNlTxla0ASUi2bayf9pok881zwi808e0MqdoSv8kG3OmtuCfA==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n\n return (\n
\n \n \n \n
\n
\n\n
\n \n \n \n Dashboard<|fim_middle|>", + "timestamp": "2025-01-07T11:59:24.524689Z", + "message_id": "aed87c39-c2ab-4005-b79a-005b21801c88" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "aed87c39-c2ab-4005-b79a-005b21801c88", + "conversation_timestamp": "2025-01-07T11:59:24.524689Z" + }, + "alert_id": "aed87c39-c2ab-4005-b79a-005b21801c88", + "code_snippet": null, + "trigger_string": "GitHub - Access Token:\n useSse();\n <|fim_suffix|>\n const test = \"ghp_token\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {", + "trigger_type": "codegate-secrets", + "trigger_category": "critical", + "timestamp": "2025-01-07T11:59:24.524689Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```ts src/hooks/useAlertsStore.ts (75-81)\n getMaliciousPackagesChart: () => {\n const { alerts } = get();\n return alerts\n .filter((item) => typeof item.trigger_string === \"object\")\n .filter((item) => item.trigger_type === \"codegate-context-retriever\")\n .map((item) => item.trigger_string as MaliciousPkgType);\n },\n```\ncheck", + "timestamp": "2025-01-07T11:58:52.113473Z", + "message_id": "2f22fab8-59a3-4879-84d9-b21886a182a3" + }, + "answer": { + "message": "The code snippet provided defines a function `getMaliciousPackagesChart` within a Zustand store hook named `useAlertsStore`. This function filters and maps data from the `alerts` state to return an array of `MaliciousPkgType` objects. Here's a breakdown of what the function does:\n\n1. It retrieves the `alerts` array from the store using `get()`.\n2. It filters the `alerts` array to include only those items where `trigger_string` is of type \"object\".\n3. It further filters the resulting array to include only those items where `trigger_type` is \"codegate-context-retriever\".\n4. It maps the filtered items to extract the `trigger_string` property, casting it to `MaliciousPkgType`.\n\nHere's the code snippet for clarity:\n\n```typescript\ngetMaliciousPackagesChart: () => {\n const { alerts } = get();\n return alerts\n .filter((item) => typeof item.trigger_string === \"object\")\n .filter((item) => item.trigger_type === \"codegate-context-retriever\")\n .map((item) => item.trigger_string as MaliciousPkgType);\n},\n```\n\n### Considerations\n\n1. **Type Safety**: Ensure that `MaliciousPkgType` is correctly defined and that `trigger_string` is indeed an object of that type. If `trigger_string` can be of different types, you might want to add additional type checks or handle potential errors.\n\n2. **Performance**: If the `alerts` array is large, these filter and map operations could be performance-intensive. Consider optimizing if necessary, especially if this function is called frequently.\n\n3. **Error Handling**: If `trigger_string` is not guaranteed to be an object of type `MaliciousPkgType`, you might want to add error handling to manage unexpected types gracefully.\n\n4. **Code Readability**: The function is concise but could benefit from comments if the logic is not immediately clear to other developers.\n\nOverall, the function is well-structured and performs its intended task of filtering and mapping alerts based on specific criteria.", + "timestamp": "2025-01-07T11:58:47.073703Z", + "message_id": "7c98c3b0-d89b-4468-8039-6fcb864fdcaf" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-32d4d346982d4b339968135d1d5560fd", + "conversation_timestamp": "2025-01-07T11:58:52.113473Z" + }, + "alert_id": "2f22fab8-59a3-4879-84d9-b21886a182a3", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-07T11:58:52.113473Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```ts src/hooks/useAlertsStore.ts (75-81)\n getMaliciousPackagesChart: () => {\n const { alerts } = get();\n return alerts\n .filter((item) => typeof item.trigger_string === \"object\")\n .filter((item) => item.trigger_type === \"codegate-context-retriever\")\n .map((item) => item.trigger_string as MaliciousPkgType);\n },\n```\ncheck", + "timestamp": "2025-01-07T11:58:46.516946Z", + "message_id": "c7ef2379-75e4-4609-ae77-0161dfb5aa7b" + }, + "answer": { + "message": "The code snippet provided defines a function `getMaliciousPackagesChart` within a Zustand store hook named `useAlertsStore`. This function filters and maps data from the `alerts` state to return an array of `MaliciousPkgType` objects. Here's a breakdown of what the function does:\n\n1. It retrieves the `alerts` array from the store using `get()`.\n2. It filters the `alerts` array to include only those items where `trigger_string` is of type \"object\".\n3. It further filters the resulting array to include only those items where `trigger_type` is \"codegate-context-retriever\".\n4. It maps the filtered items to extract the `trigger_string` property, casting it to `MaliciousPkgType`.\n\nHere's the code snippet for clarity:\n\n```typescript\ngetMaliciousPackagesChart: () => {\n const { alerts } = get();\n return alerts\n .filter((item) => typeof item.trigger_string === \"object\")\n .filter((item) => item.trigger_type === \"codegate-context-retriever\")\n .map((item) => item.trigger_string as MaliciousPkgType);\n},\n```\n\n### Considerations\n\n1. **Type Safety**: Ensure that `MaliciousPkgType` is correctly defined and that `trigger_string` is indeed an object of that type. If `trigger_string` can be of different types, you might want to add additional type checks or handle potential errors.\n\n2. **Performance**: If the `alerts` array is large, these filter and map operations could be performance-intensive. Consider optimizing if necessary, especially if this function is called frequently.\n\n3. **Error Handling**: If `trigger_string` is not guaranteed to be an object of type `MaliciousPkgType`, you might want to add error handling to manage unexpected types gracefully.\n\n4. **Code Readability**: The function is concise but could benefit from comments if the logic is not immediately clear to other developers.\n\nOverall, the function is well-structured and performs its intended task of filtering and mapping alerts based on specific criteria.", + "timestamp": "2025-01-07T11:58:47.073703Z", + "message_id": "7c98c3b0-d89b-4468-8039-6fcb864fdcaf" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-32d4d346982d4b339968135d1d5560fd", + "conversation_timestamp": "2025-01-07T11:58:46.516946Z" + }, + "alert_id": "c7ef2379-75e4-4609-ae77-0161dfb5aa7b", + "code_snippet": { + "code": " getMaliciousPackagesChart: () => {\n const { alerts } = get();\n return alerts\n .filter((item) => typeof item.trigger_string === \"object\")\n .filter((item) => item.trigger_type === \"codegate-context-retriever\")\n .map((item) => item.trigger_string as MaliciousPkgType);\n },\n", + "language": "typescript", + "filepath": "src/hooks/useAlertsStore.ts", + "libraries": [] + }, + "trigger_string": null, + "trigger_type": "code-snippet-extractor", + "trigger_category": "info", + "timestamp": "2025-01-07T11:58:46.516946Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "utput_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\\n ),\\n )\\n registry.add_provider(\\n \"vllm\",\\n VLLMProvider(\\n pipeline_processor=pipeline_factory.create_input_pipeline(),\\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\\n ),\\n )\\n registry.add_provider(\\n \"ollama\",\\n OllamaProvider(\\n pipeline_processor=pipeline_factory.create_input_pipeline(),\\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\\n ),\\n )\\n\\n # Create and add system routes\\n system_router = APIRouter(tags=[\"System\"])\\n\\n @system_router.get(\"/health\")\\n async def health_check():\\n return {\"status\": \"healthy\"}\\n\\n app.include_router(system_router)\\n app.include_router(dashboard_router)\\n\\n return app\\n\\n```\\n\\nserver.py do you see any security issue?',\n timestamp: \"2025-01-03T09:09:33.743797Z\",\n message_id: \"a1549789-b610-4999-9907-f8f010c2f3b7\",\n },\n answer: {\n message:\n 'Yes, there are several security issues in the provided `server.py` code. Here are the main ones:\\n\\n1. **CORS Configuration**:\\n ```python\\n app.add_middleware(\\n CORSMiddleware,\\n allow_origins=[\"*\"],\\n allow_credentials=True,\\n allow_methods=[\"*\"],\\n allow_headers=[\"*\"],\\n )\\n ```\\n - Allowing all origins (`allow_origins=[\"*\"]`) and methods (`allow_methods=[\"*\"]`) can expose your server to Cross-Site Request Forgery (CSRF) attacks and other security vulnerabilities. It\\'s recommended to restrict these settings to only the origins and methods that your application needs to support.\\n\\n2. **Error Handling Middleware**:\\n ```python\\n async def custom_error_handler(request, exc: Exception):\\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\\n # Capture the stack trace\\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\\n logger.error(traceback.print_list(extracted_traceback[-3:]))\\n return JSONResponse({\"error\": str(exc)}, status_code=500)\\n ```\\n - Exposing detailed error messages in the response can be dangerous, as it can provide attackers with information that can be used to exploit vulnerabilities. It\\'s better to log the error details and return a generic error message to the client.\\n\\n3. **Handling Exceptions**:\\n - The `custom_error_handler` function logs the traceback and returns the exception message directly to the client. This can expose sensitive information about the server\\'s internal state. It\\'s better to log the error and return a generic message.\\n\\n4. **Provider Configuration**:\\n - The providers are configured with the same pipeline processors. This might not be a security issue in itself, but it\\'s important to ensure that the pipeline processors are secure and correctly configured.\\n\\n5. **Logging**:\\n - The `logger.error` function is used to log the error traceback. Ensure that the logging configuration is set up correctly to prevent logging sensitive information to insecure destinations.\\n\\nHere is a revised version of the code with some of these issues addressed:\\n\\n```python\\nimport traceback\\n\\nimport structlog\\nfrom fastapi import APIRouter, FastAPI\\nfrom fastapi.middleware.cors import CORSMiddleware\\nfrom fastapi.responses import JSONResponse\\nfrom starlette.middleware.errors import ServerErrorMiddleware\\n\\nfrom codegate import __description__, __version__\\nfrom codegate.dashboard.dashboard import dashboard_router\\nfrom codegate.pipeline.factory import PipelineFactory\\nfrom codegate.providers.anthropic.provider import AnthropicProvider\\nfrom codegate.providers.llamacpp.provider import LlamaCppProvider\\nfrom codegate.providers.ollama.provider import OllamaProvider\\nfrom codegate.providers.openai.provider import OpenAIProvider\\nfrom codegate.providers.registry import ProviderRegistry\\nfrom codegate.providers.vllm.provider import VLLMProvider\\n\\nlogger = structlog.get_logger(\"codegate\")\\n\\n\\nasync def custom_error_handler(request, exc: Exception):\\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\\n # Capture the stack trace\\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\\n logger.error(traceback.print_list(extracted_traceback[-3:]))\\n return JSONResponse({\"error\": \"An internal server error occurred\"}, status_code=500)\\n\\n\\ndef init_app(pipeline_factory: PipelineFactory) -> FastAPI:\\n \"\"\"Create the FastAPI application.\"\"\"\\n app = FastAPI(\\n title=\"CodeGate\",\\n description=__description__,\\n version=__version__,\\n )\\n app.add_middleware(\\n CORSMiddleware,\\n allow_origins=[\"https://example.com\"], # Restrict to specific origins\\n allow_credentials=True,\\n allow_methods=[\"GET\", \"POST\"], # Restrict to specific methods\\n allow_headers=[\"*\"],\\n )\\n # Apply error handling middleware\\n app.add_middleware(ServerErrorMiddleware, handler=custom_error_handler)\\n\\n # Create provider registry\\n registry = ProviderRegistry(app)\\n\\n # Register all known providers\\n registry.add_provider(\\n \"openai\",\\n OpenAIProvider(\\n pipeline_processor=pipeline_factory.create_input_pipeline(),\\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\\n ),\\n )\\n registry.add_provider(\\n \"anthropic\",\\n AnthropicProvider(\\n pipeline_processor=pipeline_factory.create_input_pipeline(),\\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\\n ),\\n )\\n registry.add_provider(\\n \"llamacpp\",\\n LlamaCppProvider(\\n pipeline_processor=pipeline_factory.create_input_pipeline(),\\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\\n ),\\n )\\n registry.add_provider(\\n \"vllm\",\\n VLLMProvider(\\n pipeline_processor=pipeline_factory.create_input_pipeline(),\\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\\n ),\\n )\\n registry.add_provider(\\n \"ollama\",\\n OllamaProvider(\\n pipeline_processor=pipeline_factory.create_input_pipeline(),\\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\\n ),\\n )\\n\\n # Create and add system routes\\n system_router = APIRouter(tags=[\"System\"])\\n\\n @system_router.get(\"/health\")\\n async def health_check():\\n return {\"status\": \"healthy\"}\\n\\n app.include_router(system_router)\\n app.include_router(dashboard_router)\\n\\n return app\\n```\\n\\nIn this revised version, the CORS middleware is restricted to specific origins and methods, and the error handler returns a generic error message to the client.',\n timestamp: \"2025-01-03T09:09:34.359269Z\",\n message_id: \"68e7c9bc-9afa-4240-8eba-621eaae4a2a0\",\n },\n },\n ],\n provider: \"vllm\",\n type: \"chat\",\n chat_id: \"chatcmpl-eebad2bd68434c7c947d10754a204ea4\",\n conversation_timestamp: \"2025-01-03T09:09:33.743797Z\",\n },\n ]}\n />\n \n );\n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n screen.logTestingPlaygroundURL();\n });\n});\n\n```\ncreami un test usando it.each testCases che abbia come mock prompt quello presente piu un altro senza answer ", + "timestamp": "2025-01-03T17:28:18.125254Z", + "message_id": "a9f5d306-1160-489e-9d1f-6f814ada7278" + }, + "answer": { + "message": "Certo! Per creare un test utilizzando `it.each` con `testCases`, possiamo seguire questa struttura. Supponiamo che `testCases` sia un array di oggetti che contengono `prompt` e `answer`. Aggiungeremo un altro caso di test senza `answer`.\n\nEcco un esempio di come potrebbe essere strutturato il test:\n\n```tsx\nimport React from \"react\";\nimport { render, screen } from \"@testing-library/react\";\nimport \"@testing-library/jest-dom/extend-expect\";\nimport MemoryRouter from \"react-router-dom/MemoryRouter\";\nimport ChatComponent from \"./ChatComponent\"; // Sostituisci con il percorso corretto del tuo componente\n\nconst testCases = [\n {\n prompt: \"server.py do you see any security issue?\",\n answer: {\n message:\n 'Yes, there are several security issues in the provided `server.py` code...',\n timestamp: \"2025-01-03T09:09:33.743797Z\",\n message_id: \"a1549789-b610-4999-9907-f8f010c2f3b7\",\n },\n },\n {\n prompt: \"Another test prompt without an answer\",\n answer: null, // o undefined, a seconda di come gestisci i casi senza risposta\n },\n];\n\ndescribe(\"ChatComponent\", () => {\n it.each(testCases)(\"should display prompt: %s\", ({ prompt, answer }) => {\n render(\n \n \n \n );\n\n expect(screen.getByText(prompt)).toBeVisible();\n\n if (answer) {\n expect(screen.getByText(answer.message)).toBeVisible();\n } else {\n expect(screen.getByText(\"No answer provided\")).toBeVisible();\n }\n\n screen.logTestingPlaygroundURL();\n });\n});\n```\n\nIn questo esempio, `it.each` viene utilizzato per iterare sui casi di test definiti in `testCases`. Ogni caso di test include un `prompt` e un `answer`.\n\nSe `answer` è presente, il test verifica che sia visualizzato nel componente. Altrimenti, verifica che venga visualizzato un messaggio di \"No answer provided\".\n\nAssicurati di sostituire `ChatComponent` con il percorso corretto del tuo componente di chat e di adattare il codice in base alle tue esigenze specifiche.", + "timestamp": "2025-01-03T17:28:05.818442Z", + "message_id": "ebd32ae0-3e5b-4c88-9c31-8275f52b2e8b" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-ed7878f5b17f423290d3c89eb86eb89a", + "conversation_timestamp": "2025-01-03T17:28:18.125254Z" + }, + "alert_id": "a9f5d306-1160-489e-9d1f-6f814ada7278", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-03T17:28:18.125254Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "ho gia installato \"@testing-library/jest-dom/vitest\";", + "timestamp": "2025-01-03T17:18:56.567853Z", + "message_id": "72ce8308-4868-459f-8517-c0960aaf949b" + }, + "answer": { + "message": "Grazie per avermi fornito ulteriori dettagli. Se hai installato `@testing-library/jest-dom/vitest` invece di `@testing-library/jest-dom`, potrebbe essere necessario eseguire alcune configurazioni aggiuntive per far funzionare correttamente i matchers come `toBeVisible` con Vitest.\n\n### **Cause del Problema**\n\n1. **Pacchetto Installato Errato:**\n - `@testing-library/jest-dom/vitest` è una versione specifica per Vitest, mentre `@testing-library/jest-dom` è la versione standard per Jest. Se stai usando Vitest, potrebbe essere necessario configurare le estensioni dei tipi di un modo diverso rispetto a Jest.\n\n2. **Tipi Non Estesi Correttamente:**\n - Anche se hai installato il pacchetto corretto per Vitest, potrebbe essere necessario configurare TypeScript in modo che riconosca correttamente i matchers.\n\n### **Come Risolvere l'Errore**\n\nEcco i passaggi per configurare `@testing-library/jest-dom/vitest` correttamente con Vitest e TypeScript:\n\n---\n\n**Passaggio 1: Installa `@testing-library/jest-dom/vitest`**\n\nSe non l'hai già fatto, assicurati di installare `@testing-library/jest-dom/vitest`:\n\n```bash\nnpm install --save-dev @testing-library/jest-dom/vitest\n```\n\noppure\n\n```bash\nyarn add --dev @testing-library/jest-dom/vitest\n```\n\n---\n\n**Passaggio 2: Configura Vitest per Estendere i Tipi**\n\nVitest utilizza un file di configurazione per specificare le estensioni dei tipi. Assicurati di configurarlo correttamente.\n\n1. **Crea un File di Configurazione Vitest:**\n\n Se non hai già un file di configurazione Vitest, puoi crearne uno. Ad esempio, crea un file `vitest.config.ts` nella radice del tuo progetto.\n\n ```typescript\n // vitest.config.ts\n import { defineConfig } from 'vitest/config';\n import 'vitest/jest-dom';\n\n export default defineConfig({\n test: {\n globals: true,\n environment: 'jsdom',\n setupFiles: './src/setupTests.ts',\n },\n });\n ```\n\n **Nota:** Assicurati che il percorso `./src/setupTests.ts` corrisponda alla posizione del tuo file di setup.\n\n2. **Crea un File di Setup per Vitest:**\n\n Crea un file `setupTests.ts` nella directory `src` (o in un'altra posizione appropriata).\n\n ```typescript\n // src/setupTests.ts\n import '@testing-library/jest-dom/vitest';\n ```\n\n3. **Configura TypeScript per Riconoscere le Estensioni dei Tipi:**\n\n Assicurati che il tuo `tsconfig.json` includa le estensioni dei tipi corrette. Ad esempio:\n\n ```json\n {\n \"compilerOptions\": {\n \"types\": [\"vitest/globals\", \"@testing-library/jest-dom/vitest\"],\n // Altre opzioni...\n },\n // Altre configurazioni...\n }\n ```\n\n---\n\n**Passaggio 3: Verifica la Configurazione**\n\nDopo aver completato le configurazioni, riavvia il tuo ambiente di sviluppo (IDE o terminale) per assicurarti che tutte le configurazioni vengano caricate correttamente.\n\n---\n\n**Passaggio 4: Verifica la Soluzione**\n\nUna volta completati i passaggi precedenti, il tuo TypeScript dovrebbe riconoscere correttamente il matcher `toBeVisible` con Vitest.\n\n**Esempio di Test Aggiornato:**\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom/vitest'; // Importa i matcher se non usi il file di setup\nimport PromptList from './PromptList';\n\ntest('renders \"server.py\" link and checks for visibility', () => {\n render();\n \n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n});\n```\n\n---\n\n**Altri Consigli:**\n\n- **Verifica il File di Configurazione Vitest:** Assicurati che il file `vitest.config.ts` (o `.js`) sia correttamente configurato e che il percorso del file di setup sia corretto.\n- **Controlla i Tipi Installati:** Assicurati che i tipi di `vitest` e `@testing-library/jest-dom/vitest` siano installati e configurati correttamente.\n- **Aggiorna le Dipendenze:** Se hai aggiornato recentemente `@testing-library/react` o `@testing-library/jest-dom/vitest`, assicurati che tutte le dipendenze correlate siano aggiornate a versioni compatibili.\n\nSeguendo questi passaggi, dovresti essere in grado di risolvere l'errore e utilizzare correttamente il matcher `toBeVisible` con Vitest e TypeScript.", + "timestamp": "2025-01-03T17:18:36.481076Z", + "message_id": "eaabd167-7725-4ac2-ad79-670e17b5cd16" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-78509f7f36b641e49975251ef7b61a20", + "conversation_timestamp": "2025-01-03T17:18:56.567853Z" + }, + "alert_id": "72ce8308-4868-459f-8517-c0960aaf949b", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-03T17:18:56.567853Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "ho gia installato \"@testing-library/jest-dom/vitest\";", + "timestamp": "2025-01-03T17:18:51.766638Z", + "message_id": "4f896147-ec83-4faf-8315-c544fbe2696f" + }, + "answer": { + "message": "Grazie per avermi fornito ulteriori dettagli. Se hai installato `@testing-library/jest-dom/vitest` invece di `@testing-library/jest-dom`, potrebbe essere necessario eseguire alcune configurazioni aggiuntive per far funzionare correttamente i matchers come `toBeVisible` con Vitest.\n\n### **Cause del Problema**\n\n1. **Pacchetto Installato Errato:**\n - `@testing-library/jest-dom/vitest` è una versione specifica per Vitest, mentre `@testing-library/jest-dom` è la versione standard per Jest. Se stai usando Vitest, potrebbe essere necessario configurare le estensioni dei tipi di un modo diverso rispetto a Jest.\n\n2. **Tipi Non Estesi Correttamente:**\n - Anche se hai installato il pacchetto corretto per Vitest, potrebbe essere necessario configurare TypeScript in modo che riconosca correttamente i matchers.\n\n### **Come Risolvere l'Errore**\n\nEcco i passaggi per configurare `@testing-library/jest-dom/vitest` correttamente con Vitest e TypeScript:\n\n---\n\n**Passaggio 1: Installa `@testing-library/jest-dom/vitest`**\n\nSe non l'hai già fatto, assicurati di installare `@testing-library/jest-dom/vitest`:\n\n```bash\nnpm install --save-dev @testing-library/jest-dom/vitest\n```\n\noppure\n\n```bash\nyarn add --dev @testing-library/jest-dom/vitest\n```\n\n---\n\n**Passaggio 2: Configura Vitest per Estendere i Tipi**\n\nVitest utilizza un file di configurazione per specificare le estensioni dei tipi. Assicurati di configurarlo correttamente.\n\n1. **Crea un File di Configurazione Vitest:**\n\n Se non hai già un file di configurazione Vitest, puoi crearne uno. Ad esempio, crea un file `vitest.config.ts` nella radice del tuo progetto.\n\n ```typescript\n // vitest.config.ts\n import { defineConfig } from 'vitest/config';\n import 'vitest/jest-dom';\n\n export default defineConfig({\n test: {\n globals: true,\n environment: 'jsdom',\n setupFiles: './src/setupTests.ts',\n },\n });\n ```\n\n **Nota:** Assicurati che il percorso `./src/setupTests.ts` corrisponda alla posizione del tuo file di setup.\n\n2. **Crea un File di Setup per Vitest:**\n\n Crea un file `setupTests.ts` nella directory `src` (o in un'altra posizione appropriata).\n\n ```typescript\n // src/setupTests.ts\n import '@testing-library/jest-dom/vitest';\n ```\n\n3. **Configura TypeScript per Riconoscere le Estensioni dei Tipi:**\n\n Assicurati che il tuo `tsconfig.json` includa le estensioni dei tipi corrette. Ad esempio:\n\n ```json\n {\n \"compilerOptions\": {\n \"types\": [\"vitest/globals\", \"@testing-library/jest-dom/vitest\"],\n // Altre opzioni...\n },\n // Altre configurazioni...\n }\n ```\n\n---\n\n**Passaggio 3: Verifica la Configurazione**\n\nDopo aver completato le configurazioni, riavvia il tuo ambiente di sviluppo (IDE o terminale) per assicurarti che tutte le configurazioni vengano caricate correttamente.\n\n---\n\n**Passaggio 4: Verifica la Soluzione**\n\nUna volta completati i passaggi precedenti, il tuo TypeScript dovrebbe riconoscere correttamente il matcher `toBeVisible` con Vitest.\n\n**Esempio di Test Aggiornato:**\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom/vitest'; // Importa i matcher se non usi il file di setup\nimport PromptList from './PromptList';\n\ntest('renders \"server.py\" link and checks for visibility', () => {\n render();\n \n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n});\n```\n\n---\n\n**Altri Consigli:**\n\n- **Verifica il File di Configurazione Vitest:** Assicurati che il file `vitest.config.ts` (o `.js`) sia correttamente configurato e che il percorso del file di setup sia corretto.\n- **Controlla i Tipi Installati:** Assicurati che i tipi di `vitest` e `@testing-library/jest-dom/vitest` siano installati e configurati correttamente.\n- **Aggiorna le Dipendenze:** Se hai aggiornato recentemente `@testing-library/react` o `@testing-library/jest-dom/vitest`, assicurati che tutte le dipendenze correlate siano aggiornate a versioni compatibili.\n\nSeguendo questi passaggi, dovresti essere in grado di risolvere l'errore e utilizzare correttamente il matcher `toBeVisible` con Vitest e TypeScript.", + "timestamp": "2025-01-03T17:18:36.481076Z", + "message_id": "eaabd167-7725-4ac2-ad79-670e17b5cd16" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-78509f7f36b641e49975251ef7b61a20", + "conversation_timestamp": "2025-01-03T17:18:51.766638Z" + }, + "alert_id": "4f896147-ec83-4faf-8315-c544fbe2696f", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-03T17:18:51.766638Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "ho gia installato \"@testing-library/jest-dom/vitest\";", + "timestamp": "2025-01-03T17:18:49.582668Z", + "message_id": "7f97da0e-0505-4082-8dd0-e2c532b10b10" + }, + "answer": { + "message": "Grazie per avermi fornito ulteriori dettagli. Se hai installato `@testing-library/jest-dom/vitest` invece di `@testing-library/jest-dom`, potrebbe essere necessario eseguire alcune configurazioni aggiuntive per far funzionare correttamente i matchers come `toBeVisible` con Vitest.\n\n### **Cause del Problema**\n\n1. **Pacchetto Installato Errato:**\n - `@testing-library/jest-dom/vitest` è una versione specifica per Vitest, mentre `@testing-library/jest-dom` è la versione standard per Jest. Se stai usando Vitest, potrebbe essere necessario configurare le estensioni dei tipi di un modo diverso rispetto a Jest.\n\n2. **Tipi Non Estesi Correttamente:**\n - Anche se hai installato il pacchetto corretto per Vitest, potrebbe essere necessario configurare TypeScript in modo che riconosca correttamente i matchers.\n\n### **Come Risolvere l'Errore**\n\nEcco i passaggi per configurare `@testing-library/jest-dom/vitest` correttamente con Vitest e TypeScript:\n\n---\n\n**Passaggio 1: Installa `@testing-library/jest-dom/vitest`**\n\nSe non l'hai già fatto, assicurati di installare `@testing-library/jest-dom/vitest`:\n\n```bash\nnpm install --save-dev @testing-library/jest-dom/vitest\n```\n\noppure\n\n```bash\nyarn add --dev @testing-library/jest-dom/vitest\n```\n\n---\n\n**Passaggio 2: Configura Vitest per Estendere i Tipi**\n\nVitest utilizza un file di configurazione per specificare le estensioni dei tipi. Assicurati di configurarlo correttamente.\n\n1. **Crea un File di Configurazione Vitest:**\n\n Se non hai già un file di configurazione Vitest, puoi crearne uno. Ad esempio, crea un file `vitest.config.ts` nella radice del tuo progetto.\n\n ```typescript\n // vitest.config.ts\n import { defineConfig } from 'vitest/config';\n import 'vitest/jest-dom';\n\n export default defineConfig({\n test: {\n globals: true,\n environment: 'jsdom',\n setupFiles: './src/setupTests.ts',\n },\n });\n ```\n\n **Nota:** Assicurati che il percorso `./src/setupTests.ts` corrisponda alla posizione del tuo file di setup.\n\n2. **Crea un File di Setup per Vitest:**\n\n Crea un file `setupTests.ts` nella directory `src` (o in un'altra posizione appropriata).\n\n ```typescript\n // src/setupTests.ts\n import '@testing-library/jest-dom/vitest';\n ```\n\n3. **Configura TypeScript per Riconoscere le Estensioni dei Tipi:**\n\n Assicurati che il tuo `tsconfig.json` includa le estensioni dei tipi corrette. Ad esempio:\n\n ```json\n {\n \"compilerOptions\": {\n \"types\": [\"vitest/globals\", \"@testing-library/jest-dom/vitest\"],\n // Altre opzioni...\n },\n // Altre configurazioni...\n }\n ```\n\n---\n\n**Passaggio 3: Verifica la Configurazione**\n\nDopo aver completato le configurazioni, riavvia il tuo ambiente di sviluppo (IDE o terminale) per assicurarti che tutte le configurazioni vengano caricate correttamente.\n\n---\n\n**Passaggio 4: Verifica la Soluzione**\n\nUna volta completati i passaggi precedenti, il tuo TypeScript dovrebbe riconoscere correttamente il matcher `toBeVisible` con Vitest.\n\n**Esempio di Test Aggiornato:**\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom/vitest'; // Importa i matcher se non usi il file di setup\nimport PromptList from './PromptList';\n\ntest('renders \"server.py\" link and checks for visibility', () => {\n render();\n \n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n});\n```\n\n---\n\n**Altri Consigli:**\n\n- **Verifica il File di Configurazione Vitest:** Assicurati che il file `vitest.config.ts` (o `.js`) sia correttamente configurato e che il percorso del file di setup sia corretto.\n- **Controlla i Tipi Installati:** Assicurati che i tipi di `vitest` e `@testing-library/jest-dom/vitest` siano installati e configurati correttamente.\n- **Aggiorna le Dipendenze:** Se hai aggiornato recentemente `@testing-library/react` o `@testing-library/jest-dom/vitest`, assicurati che tutte le dipendenze correlate siano aggiornate a versioni compatibili.\n\nSeguendo questi passaggi, dovresti essere in grado di risolvere l'errore e utilizzare correttamente il matcher `toBeVisible` con Vitest e TypeScript.", + "timestamp": "2025-01-03T17:18:36.481076Z", + "message_id": "eaabd167-7725-4ac2-ad79-670e17b5cd16" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-78509f7f36b641e49975251ef7b61a20", + "conversation_timestamp": "2025-01-03T17:18:49.582668Z" + }, + "alert_id": "7f97da0e-0505-4082-8dd0-e2c532b10b10", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-03T17:18:49.582668Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "ho gia installato \"@testing-library/jest-dom/vitest\";", + "timestamp": "2025-01-03T17:18:47.501703Z", + "message_id": "3b2300bb-ae8d-4851-b5a1-287e67ddcfeb" + }, + "answer": { + "message": "Grazie per avermi fornito ulteriori dettagli. Se hai installato `@testing-library/jest-dom/vitest` invece di `@testing-library/jest-dom`, potrebbe essere necessario eseguire alcune configurazioni aggiuntive per far funzionare correttamente i matchers come `toBeVisible` con Vitest.\n\n### **Cause del Problema**\n\n1. **Pacchetto Installato Errato:**\n - `@testing-library/jest-dom/vitest` è una versione specifica per Vitest, mentre `@testing-library/jest-dom` è la versione standard per Jest. Se stai usando Vitest, potrebbe essere necessario configurare le estensioni dei tipi di un modo diverso rispetto a Jest.\n\n2. **Tipi Non Estesi Correttamente:**\n - Anche se hai installato il pacchetto corretto per Vitest, potrebbe essere necessario configurare TypeScript in modo che riconosca correttamente i matchers.\n\n### **Come Risolvere l'Errore**\n\nEcco i passaggi per configurare `@testing-library/jest-dom/vitest` correttamente con Vitest e TypeScript:\n\n---\n\n**Passaggio 1: Installa `@testing-library/jest-dom/vitest`**\n\nSe non l'hai già fatto, assicurati di installare `@testing-library/jest-dom/vitest`:\n\n```bash\nnpm install --save-dev @testing-library/jest-dom/vitest\n```\n\noppure\n\n```bash\nyarn add --dev @testing-library/jest-dom/vitest\n```\n\n---\n\n**Passaggio 2: Configura Vitest per Estendere i Tipi**\n\nVitest utilizza un file di configurazione per specificare le estensioni dei tipi. Assicurati di configurarlo correttamente.\n\n1. **Crea un File di Configurazione Vitest:**\n\n Se non hai già un file di configurazione Vitest, puoi crearne uno. Ad esempio, crea un file `vitest.config.ts` nella radice del tuo progetto.\n\n ```typescript\n // vitest.config.ts\n import { defineConfig } from 'vitest/config';\n import 'vitest/jest-dom';\n\n export default defineConfig({\n test: {\n globals: true,\n environment: 'jsdom',\n setupFiles: './src/setupTests.ts',\n },\n });\n ```\n\n **Nota:** Assicurati che il percorso `./src/setupTests.ts` corrisponda alla posizione del tuo file di setup.\n\n2. **Crea un File di Setup per Vitest:**\n\n Crea un file `setupTests.ts` nella directory `src` (o in un'altra posizione appropriata).\n\n ```typescript\n // src/setupTests.ts\n import '@testing-library/jest-dom/vitest';\n ```\n\n3. **Configura TypeScript per Riconoscere le Estensioni dei Tipi:**\n\n Assicurati che il tuo `tsconfig.json` includa le estensioni dei tipi corrette. Ad esempio:\n\n ```json\n {\n \"compilerOptions\": {\n \"types\": [\"vitest/globals\", \"@testing-library/jest-dom/vitest\"],\n // Altre opzioni...\n },\n // Altre configurazioni...\n }\n ```\n\n---\n\n**Passaggio 3: Verifica la Configurazione**\n\nDopo aver completato le configurazioni, riavvia il tuo ambiente di sviluppo (IDE o terminale) per assicurarti che tutte le configurazioni vengano caricate correttamente.\n\n---\n\n**Passaggio 4: Verifica la Soluzione**\n\nUna volta completati i passaggi precedenti, il tuo TypeScript dovrebbe riconoscere correttamente il matcher `toBeVisible` con Vitest.\n\n**Esempio di Test Aggiornato:**\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom/vitest'; // Importa i matcher se non usi il file di setup\nimport PromptList from './PromptList';\n\ntest('renders \"server.py\" link and checks for visibility', () => {\n render();\n \n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n});\n```\n\n---\n\n**Altri Consigli:**\n\n- **Verifica il File di Configurazione Vitest:** Assicurati che il file `vitest.config.ts` (o `.js`) sia correttamente configurato e che il percorso del file di setup sia corretto.\n- **Controlla i Tipi Installati:** Assicurati che i tipi di `vitest` e `@testing-library/jest-dom/vitest` siano installati e configurati correttamente.\n- **Aggiorna le Dipendenze:** Se hai aggiornato recentemente `@testing-library/react` o `@testing-library/jest-dom/vitest`, assicurati che tutte le dipendenze correlate siano aggiornate a versioni compatibili.\n\nSeguendo questi passaggi, dovresti essere in grado di risolvere l'errore e utilizzare correttamente il matcher `toBeVisible` con Vitest e TypeScript.", + "timestamp": "2025-01-03T17:18:36.481076Z", + "message_id": "eaabd167-7725-4ac2-ad79-670e17b5cd16" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-78509f7f36b641e49975251ef7b61a20", + "conversation_timestamp": "2025-01-03T17:18:47.501703Z" + }, + "alert_id": "3b2300bb-ae8d-4851-b5a1-287e67ddcfeb", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-03T17:18:47.501703Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "ho gia installato \"@testing-library/jest-dom/vitest\";", + "timestamp": "2025-01-03T17:18:43.747640Z", + "message_id": "40bc36a1-216e-429b-ab0a-9067cfeac9d5" + }, + "answer": { + "message": "Grazie per avermi fornito ulteriori dettagli. Se hai installato `@testing-library/jest-dom/vitest` invece di `@testing-library/jest-dom`, potrebbe essere necessario eseguire alcune configurazioni aggiuntive per far funzionare correttamente i matchers come `toBeVisible` con Vitest.\n\n### **Cause del Problema**\n\n1. **Pacchetto Installato Errato:**\n - `@testing-library/jest-dom/vitest` è una versione specifica per Vitest, mentre `@testing-library/jest-dom` è la versione standard per Jest. Se stai usando Vitest, potrebbe essere necessario configurare le estensioni dei tipi di un modo diverso rispetto a Jest.\n\n2. **Tipi Non Estesi Correttamente:**\n - Anche se hai installato il pacchetto corretto per Vitest, potrebbe essere necessario configurare TypeScript in modo che riconosca correttamente i matchers.\n\n### **Come Risolvere l'Errore**\n\nEcco i passaggi per configurare `@testing-library/jest-dom/vitest` correttamente con Vitest e TypeScript:\n\n---\n\n**Passaggio 1: Installa `@testing-library/jest-dom/vitest`**\n\nSe non l'hai già fatto, assicurati di installare `@testing-library/jest-dom/vitest`:\n\n```bash\nnpm install --save-dev @testing-library/jest-dom/vitest\n```\n\noppure\n\n```bash\nyarn add --dev @testing-library/jest-dom/vitest\n```\n\n---\n\n**Passaggio 2: Configura Vitest per Estendere i Tipi**\n\nVitest utilizza un file di configurazione per specificare le estensioni dei tipi. Assicurati di configurarlo correttamente.\n\n1. **Crea un File di Configurazione Vitest:**\n\n Se non hai già un file di configurazione Vitest, puoi crearne uno. Ad esempio, crea un file `vitest.config.ts` nella radice del tuo progetto.\n\n ```typescript\n // vitest.config.ts\n import { defineConfig } from 'vitest/config';\n import 'vitest/jest-dom';\n\n export default defineConfig({\n test: {\n globals: true,\n environment: 'jsdom',\n setupFiles: './src/setupTests.ts',\n },\n });\n ```\n\n **Nota:** Assicurati che il percorso `./src/setupTests.ts` corrisponda alla posizione del tuo file di setup.\n\n2. **Crea un File di Setup per Vitest:**\n\n Crea un file `setupTests.ts` nella directory `src` (o in un'altra posizione appropriata).\n\n ```typescript\n // src/setupTests.ts\n import '@testing-library/jest-dom/vitest';\n ```\n\n3. **Configura TypeScript per Riconoscere le Estensioni dei Tipi:**\n\n Assicurati che il tuo `tsconfig.json` includa le estensioni dei tipi corrette. Ad esempio:\n\n ```json\n {\n \"compilerOptions\": {\n \"types\": [\"vitest/globals\", \"@testing-library/jest-dom/vitest\"],\n // Altre opzioni...\n },\n // Altre configurazioni...\n }\n ```\n\n---\n\n**Passaggio 3: Verifica la Configurazione**\n\nDopo aver completato le configurazioni, riavvia il tuo ambiente di sviluppo (IDE o terminale) per assicurarti che tutte le configurazioni vengano caricate correttamente.\n\n---\n\n**Passaggio 4: Verifica la Soluzione**\n\nUna volta completati i passaggi precedenti, il tuo TypeScript dovrebbe riconoscere correttamente il matcher `toBeVisible` con Vitest.\n\n**Esempio di Test Aggiornato:**\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom/vitest'; // Importa i matcher se non usi il file di setup\nimport PromptList from './PromptList';\n\ntest('renders \"server.py\" link and checks for visibility', () => {\n render();\n \n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n});\n```\n\n---\n\n**Altri Consigli:**\n\n- **Verifica il File di Configurazione Vitest:** Assicurati che il file `vitest.config.ts` (o `.js`) sia correttamente configurato e che il percorso del file di setup sia corretto.\n- **Controlla i Tipi Installati:** Assicurati che i tipi di `vitest` e `@testing-library/jest-dom/vitest` siano installati e configurati correttamente.\n- **Aggiorna le Dipendenze:** Se hai aggiornato recentemente `@testing-library/react` o `@testing-library/jest-dom/vitest`, assicurati che tutte le dipendenze correlate siano aggiornate a versioni compatibili.\n\nSeguendo questi passaggi, dovresti essere in grado di risolvere l'errore e utilizzare correttamente il matcher `toBeVisible` con Vitest e TypeScript.", + "timestamp": "2025-01-03T17:18:36.481076Z", + "message_id": "eaabd167-7725-4ac2-ad79-670e17b5cd16" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-78509f7f36b641e49975251ef7b61a20", + "conversation_timestamp": "2025-01-03T17:18:43.747640Z" + }, + "alert_id": "40bc36a1-216e-429b-ab0a-9067cfeac9d5", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-03T17:18:43.747640Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "ho gia installato \"@testing-library/jest-dom/vitest\";", + "timestamp": "2025-01-03T17:18:43.281257Z", + "message_id": "6e838aba-768b-46a4-b321-ce9b6beb06e8" + }, + "answer": { + "message": "Grazie per avermi fornito ulteriori dettagli. Se hai installato `@testing-library/jest-dom/vitest` invece di `@testing-library/jest-dom`, potrebbe essere necessario eseguire alcune configurazioni aggiuntive per far funzionare correttamente i matchers come `toBeVisible` con Vitest.\n\n### **Cause del Problema**\n\n1. **Pacchetto Installato Errato:**\n - `@testing-library/jest-dom/vitest` è una versione specifica per Vitest, mentre `@testing-library/jest-dom` è la versione standard per Jest. Se stai usando Vitest, potrebbe essere necessario configurare le estensioni dei tipi di un modo diverso rispetto a Jest.\n\n2. **Tipi Non Estesi Correttamente:**\n - Anche se hai installato il pacchetto corretto per Vitest, potrebbe essere necessario configurare TypeScript in modo che riconosca correttamente i matchers.\n\n### **Come Risolvere l'Errore**\n\nEcco i passaggi per configurare `@testing-library/jest-dom/vitest` correttamente con Vitest e TypeScript:\n\n---\n\n**Passaggio 1: Installa `@testing-library/jest-dom/vitest`**\n\nSe non l'hai già fatto, assicurati di installare `@testing-library/jest-dom/vitest`:\n\n```bash\nnpm install --save-dev @testing-library/jest-dom/vitest\n```\n\noppure\n\n```bash\nyarn add --dev @testing-library/jest-dom/vitest\n```\n\n---\n\n**Passaggio 2: Configura Vitest per Estendere i Tipi**\n\nVitest utilizza un file di configurazione per specificare le estensioni dei tipi. Assicurati di configurarlo correttamente.\n\n1. **Crea un File di Configurazione Vitest:**\n\n Se non hai già un file di configurazione Vitest, puoi crearne uno. Ad esempio, crea un file `vitest.config.ts` nella radice del tuo progetto.\n\n ```typescript\n // vitest.config.ts\n import { defineConfig } from 'vitest/config';\n import 'vitest/jest-dom';\n\n export default defineConfig({\n test: {\n globals: true,\n environment: 'jsdom',\n setupFiles: './src/setupTests.ts',\n },\n });\n ```\n\n **Nota:** Assicurati che il percorso `./src/setupTests.ts` corrisponda alla posizione del tuo file di setup.\n\n2. **Crea un File di Setup per Vitest:**\n\n Crea un file `setupTests.ts` nella directory `src` (o in un'altra posizione appropriata).\n\n ```typescript\n // src/setupTests.ts\n import '@testing-library/jest-dom/vitest';\n ```\n\n3. **Configura TypeScript per Riconoscere le Estensioni dei Tipi:**\n\n Assicurati che il tuo `tsconfig.json` includa le estensioni dei tipi corrette. Ad esempio:\n\n ```json\n {\n \"compilerOptions\": {\n \"types\": [\"vitest/globals\", \"@testing-library/jest-dom/vitest\"],\n // Altre opzioni...\n },\n // Altre configurazioni...\n }\n ```\n\n---\n\n**Passaggio 3: Verifica la Configurazione**\n\nDopo aver completato le configurazioni, riavvia il tuo ambiente di sviluppo (IDE o terminale) per assicurarti che tutte le configurazioni vengano caricate correttamente.\n\n---\n\n**Passaggio 4: Verifica la Soluzione**\n\nUna volta completati i passaggi precedenti, il tuo TypeScript dovrebbe riconoscere correttamente il matcher `toBeVisible` con Vitest.\n\n**Esempio di Test Aggiornato:**\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom/vitest'; // Importa i matcher se non usi il file di setup\nimport PromptList from './PromptList';\n\ntest('renders \"server.py\" link and checks for visibility', () => {\n render();\n \n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n});\n```\n\n---\n\n**Altri Consigli:**\n\n- **Verifica il File di Configurazione Vitest:** Assicurati che il file `vitest.config.ts` (o `.js`) sia correttamente configurato e che il percorso del file di setup sia corretto.\n- **Controlla i Tipi Installati:** Assicurati che i tipi di `vitest` e `@testing-library/jest-dom/vitest` siano installati e configurati correttamente.\n- **Aggiorna le Dipendenze:** Se hai aggiornato recentemente `@testing-library/react` o `@testing-library/jest-dom/vitest`, assicurati che tutte le dipendenze correlate siano aggiornate a versioni compatibili.\n\nSeguendo questi passaggi, dovresti essere in grado di risolvere l'errore e utilizzare correttamente il matcher `toBeVisible` con Vitest e TypeScript.", + "timestamp": "2025-01-03T17:18:36.481076Z", + "message_id": "eaabd167-7725-4ac2-ad79-670e17b5cd16" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-78509f7f36b641e49975251ef7b61a20", + "conversation_timestamp": "2025-01-03T17:18:43.281257Z" + }, + "alert_id": "6e838aba-768b-46a4-b321-ce9b6beb06e8", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-03T17:18:43.281257Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "ho gia installato \"@testing-library/jest-dom/vitest\";", + "timestamp": "2025-01-03T17:18:35.665898Z", + "message_id": "4c1e9391-0502-4778-bf72-e4c6328f4892" + }, + "answer": { + "message": "Grazie per avermi fornito ulteriori dettagli. Se hai installato `@testing-library/jest-dom/vitest` invece di `@testing-library/jest-dom`, potrebbe essere necessario eseguire alcune configurazioni aggiuntive per far funzionare correttamente i matchers come `toBeVisible` con Vitest.\n\n### **Cause del Problema**\n\n1. **Pacchetto Installato Errato:**\n - `@testing-library/jest-dom/vitest` è una versione specifica per Vitest, mentre `@testing-library/jest-dom` è la versione standard per Jest. Se stai usando Vitest, potrebbe essere necessario configurare le estensioni dei tipi di un modo diverso rispetto a Jest.\n\n2. **Tipi Non Estesi Correttamente:**\n - Anche se hai installato il pacchetto corretto per Vitest, potrebbe essere necessario configurare TypeScript in modo che riconosca correttamente i matchers.\n\n### **Come Risolvere l'Errore**\n\nEcco i passaggi per configurare `@testing-library/jest-dom/vitest` correttamente con Vitest e TypeScript:\n\n---\n\n**Passaggio 1: Installa `@testing-library/jest-dom/vitest`**\n\nSe non l'hai già fatto, assicurati di installare `@testing-library/jest-dom/vitest`:\n\n```bash\nnpm install --save-dev @testing-library/jest-dom/vitest\n```\n\noppure\n\n```bash\nyarn add --dev @testing-library/jest-dom/vitest\n```\n\n---\n\n**Passaggio 2: Configura Vitest per Estendere i Tipi**\n\nVitest utilizza un file di configurazione per specificare le estensioni dei tipi. Assicurati di configurarlo correttamente.\n\n1. **Crea un File di Configurazione Vitest:**\n\n Se non hai già un file di configurazione Vitest, puoi crearne uno. Ad esempio, crea un file `vitest.config.ts` nella radice del tuo progetto.\n\n ```typescript\n // vitest.config.ts\n import { defineConfig } from 'vitest/config';\n import 'vitest/jest-dom';\n\n export default defineConfig({\n test: {\n globals: true,\n environment: 'jsdom',\n setupFiles: './src/setupTests.ts',\n },\n });\n ```\n\n **Nota:** Assicurati che il percorso `./src/setupTests.ts` corrisponda alla posizione del tuo file di setup.\n\n2. **Crea un File di Setup per Vitest:**\n\n Crea un file `setupTests.ts` nella directory `src` (o in un'altra posizione appropriata).\n\n ```typescript\n // src/setupTests.ts\n import '@testing-library/jest-dom/vitest';\n ```\n\n3. **Configura TypeScript per Riconoscere le Estensioni dei Tipi:**\n\n Assicurati che il tuo `tsconfig.json` includa le estensioni dei tipi corrette. Ad esempio:\n\n ```json\n {\n \"compilerOptions\": {\n \"types\": [\"vitest/globals\", \"@testing-library/jest-dom/vitest\"],\n // Altre opzioni...\n },\n // Altre configurazioni...\n }\n ```\n\n---\n\n**Passaggio 3: Verifica la Configurazione**\n\nDopo aver completato le configurazioni, riavvia il tuo ambiente di sviluppo (IDE o terminale) per assicurarti che tutte le configurazioni vengano caricate correttamente.\n\n---\n\n**Passaggio 4: Verifica la Soluzione**\n\nUna volta completati i passaggi precedenti, il tuo TypeScript dovrebbe riconoscere correttamente il matcher `toBeVisible` con Vitest.\n\n**Esempio di Test Aggiornato:**\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom/vitest'; // Importa i matcher se non usi il file di setup\nimport PromptList from './PromptList';\n\ntest('renders \"server.py\" link and checks for visibility', () => {\n render();\n \n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n});\n```\n\n---\n\n**Altri Consigli:**\n\n- **Verifica il File di Configurazione Vitest:** Assicurati che il file `vitest.config.ts` (o `.js`) sia correttamente configurato e che il percorso del file di setup sia corretto.\n- **Controlla i Tipi Installati:** Assicurati che i tipi di `vitest` e `@testing-library/jest-dom/vitest` siano installati e configurati correttamente.\n- **Aggiorna le Dipendenze:** Se hai aggiornato recentemente `@testing-library/react` o `@testing-library/jest-dom/vitest`, assicurati che tutte le dipendenze correlate siano aggiornate a versioni compatibili.\n\nSeguendo questi passaggi, dovresti essere in grado di risolvere l'errore e utilizzare correttamente il matcher `toBeVisible` con Vitest e TypeScript.", + "timestamp": "2025-01-03T17:18:36.481076Z", + "message_id": "eaabd167-7725-4ac2-ad79-670e17b5cd16" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-78509f7f36b641e49975251ef7b61a20", + "conversation_timestamp": "2025-01-03T17:18:35.665898Z" + }, + "alert_id": "4c1e9391-0502-4778-bf72-e4c6328f4892", + "code_snippet": null, + "trigger_string": "GitHub - Access Token:\n useSse();\n\n const test = \"ghp_token\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {", + "trigger_type": "codegate-secrets", + "trigger_category": "critical", + "timestamp": "2025-01-03T17:18:35.665898Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "ho gia installato \"@testing-library/jest-dom/vitest\";", + "timestamp": "2025-01-03T17:18:35.665805Z", + "message_id": "73211ed7-54bc-4883-aabb-0b303832c48e" + }, + "answer": { + "message": "Grazie per avermi fornito ulteriori dettagli. Se hai installato `@testing-library/jest-dom/vitest` invece di `@testing-library/jest-dom`, potrebbe essere necessario eseguire alcune configurazioni aggiuntive per far funzionare correttamente i matchers come `toBeVisible` con Vitest.\n\n### **Cause del Problema**\n\n1. **Pacchetto Installato Errato:**\n - `@testing-library/jest-dom/vitest` è una versione specifica per Vitest, mentre `@testing-library/jest-dom` è la versione standard per Jest. Se stai usando Vitest, potrebbe essere necessario configurare le estensioni dei tipi di un modo diverso rispetto a Jest.\n\n2. **Tipi Non Estesi Correttamente:**\n - Anche se hai installato il pacchetto corretto per Vitest, potrebbe essere necessario configurare TypeScript in modo che riconosca correttamente i matchers.\n\n### **Come Risolvere l'Errore**\n\nEcco i passaggi per configurare `@testing-library/jest-dom/vitest` correttamente con Vitest e TypeScript:\n\n---\n\n**Passaggio 1: Installa `@testing-library/jest-dom/vitest`**\n\nSe non l'hai già fatto, assicurati di installare `@testing-library/jest-dom/vitest`:\n\n```bash\nnpm install --save-dev @testing-library/jest-dom/vitest\n```\n\noppure\n\n```bash\nyarn add --dev @testing-library/jest-dom/vitest\n```\n\n---\n\n**Passaggio 2: Configura Vitest per Estendere i Tipi**\n\nVitest utilizza un file di configurazione per specificare le estensioni dei tipi. Assicurati di configurarlo correttamente.\n\n1. **Crea un File di Configurazione Vitest:**\n\n Se non hai già un file di configurazione Vitest, puoi crearne uno. Ad esempio, crea un file `vitest.config.ts` nella radice del tuo progetto.\n\n ```typescript\n // vitest.config.ts\n import { defineConfig } from 'vitest/config';\n import 'vitest/jest-dom';\n\n export default defineConfig({\n test: {\n globals: true,\n environment: 'jsdom',\n setupFiles: './src/setupTests.ts',\n },\n });\n ```\n\n **Nota:** Assicurati che il percorso `./src/setupTests.ts` corrisponda alla posizione del tuo file di setup.\n\n2. **Crea un File di Setup per Vitest:**\n\n Crea un file `setupTests.ts` nella directory `src` (o in un'altra posizione appropriata).\n\n ```typescript\n // src/setupTests.ts\n import '@testing-library/jest-dom/vitest';\n ```\n\n3. **Configura TypeScript per Riconoscere le Estensioni dei Tipi:**\n\n Assicurati che il tuo `tsconfig.json` includa le estensioni dei tipi corrette. Ad esempio:\n\n ```json\n {\n \"compilerOptions\": {\n \"types\": [\"vitest/globals\", \"@testing-library/jest-dom/vitest\"],\n // Altre opzioni...\n },\n // Altre configurazioni...\n }\n ```\n\n---\n\n**Passaggio 3: Verifica la Configurazione**\n\nDopo aver completato le configurazioni, riavvia il tuo ambiente di sviluppo (IDE o terminale) per assicurarti che tutte le configurazioni vengano caricate correttamente.\n\n---\n\n**Passaggio 4: Verifica la Soluzione**\n\nUna volta completati i passaggi precedenti, il tuo TypeScript dovrebbe riconoscere correttamente il matcher `toBeVisible` con Vitest.\n\n**Esempio di Test Aggiornato:**\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom/vitest'; // Importa i matcher se non usi il file di setup\nimport PromptList from './PromptList';\n\ntest('renders \"server.py\" link and checks for visibility', () => {\n render();\n \n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n});\n```\n\n---\n\n**Altri Consigli:**\n\n- **Verifica il File di Configurazione Vitest:** Assicurati che il file `vitest.config.ts` (o `.js`) sia correttamente configurato e che il percorso del file di setup sia corretto.\n- **Controlla i Tipi Installati:** Assicurati che i tipi di `vitest` e `@testing-library/jest-dom/vitest` siano installati e configurati correttamente.\n- **Aggiorna le Dipendenze:** Se hai aggiornato recentemente `@testing-library/react` o `@testing-library/jest-dom/vitest`, assicurati che tutte le dipendenze correlate siano aggiornate a versioni compatibili.\n\nSeguendo questi passaggi, dovresti essere in grado di risolvere l'errore e utilizzare correttamente il matcher `toBeVisible` con Vitest e TypeScript.", + "timestamp": "2025-01-03T17:18:36.481076Z", + "message_id": "eaabd167-7725-4ac2-ad79-670e17b5cd16" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-78509f7f36b641e49975251ef7b61a20", + "conversation_timestamp": "2025-01-03T17:18:35.665805Z" + }, + "alert_id": "73211ed7-54bc-4883-aabb-0b303832c48e", + "code_snippet": null, + "trigger_string": "GitHub - Access Token:\n ```tsx\n // @ts-ignore\n const test = \"ghp_token\";\n const breadcrumb = useBreadcrumb();\n ```\n", + "trigger_type": "codegate-secrets", + "trigger_category": "critical", + "timestamp": "2025-01-03T17:18:35.665805Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "ho gia installato \"@testing-library/jest-dom/vitest\";", + "timestamp": "2025-01-03T17:18:35.658074Z", + "message_id": "ffc1953f-12e4-406d-a920-3aee9593cdd0" + }, + "answer": { + "message": "Grazie per avermi fornito ulteriori dettagli. Se hai installato `@testing-library/jest-dom/vitest` invece di `@testing-library/jest-dom`, potrebbe essere necessario eseguire alcune configurazioni aggiuntive per far funzionare correttamente i matchers come `toBeVisible` con Vitest.\n\n### **Cause del Problema**\n\n1. **Pacchetto Installato Errato:**\n - `@testing-library/jest-dom/vitest` è una versione specifica per Vitest, mentre `@testing-library/jest-dom` è la versione standard per Jest. Se stai usando Vitest, potrebbe essere necessario configurare le estensioni dei tipi di un modo diverso rispetto a Jest.\n\n2. **Tipi Non Estesi Correttamente:**\n - Anche se hai installato il pacchetto corretto per Vitest, potrebbe essere necessario configurare TypeScript in modo che riconosca correttamente i matchers.\n\n### **Come Risolvere l'Errore**\n\nEcco i passaggi per configurare `@testing-library/jest-dom/vitest` correttamente con Vitest e TypeScript:\n\n---\n\n**Passaggio 1: Installa `@testing-library/jest-dom/vitest`**\n\nSe non l'hai già fatto, assicurati di installare `@testing-library/jest-dom/vitest`:\n\n```bash\nnpm install --save-dev @testing-library/jest-dom/vitest\n```\n\noppure\n\n```bash\nyarn add --dev @testing-library/jest-dom/vitest\n```\n\n---\n\n**Passaggio 2: Configura Vitest per Estendere i Tipi**\n\nVitest utilizza un file di configurazione per specificare le estensioni dei tipi. Assicurati di configurarlo correttamente.\n\n1. **Crea un File di Configurazione Vitest:**\n\n Se non hai già un file di configurazione Vitest, puoi crearne uno. Ad esempio, crea un file `vitest.config.ts` nella radice del tuo progetto.\n\n ```typescript\n // vitest.config.ts\n import { defineConfig } from 'vitest/config';\n import 'vitest/jest-dom';\n\n export default defineConfig({\n test: {\n globals: true,\n environment: 'jsdom',\n setupFiles: './src/setupTests.ts',\n },\n });\n ```\n\n **Nota:** Assicurati che il percorso `./src/setupTests.ts` corrisponda alla posizione del tuo file di setup.\n\n2. **Crea un File di Setup per Vitest:**\n\n Crea un file `setupTests.ts` nella directory `src` (o in un'altra posizione appropriata).\n\n ```typescript\n // src/setupTests.ts\n import '@testing-library/jest-dom/vitest';\n ```\n\n3. **Configura TypeScript per Riconoscere le Estensioni dei Tipi:**\n\n Assicurati che il tuo `tsconfig.json` includa le estensioni dei tipi corrette. Ad esempio:\n\n ```json\n {\n \"compilerOptions\": {\n \"types\": [\"vitest/globals\", \"@testing-library/jest-dom/vitest\"],\n // Altre opzioni...\n },\n // Altre configurazioni...\n }\n ```\n\n---\n\n**Passaggio 3: Verifica la Configurazione**\n\nDopo aver completato le configurazioni, riavvia il tuo ambiente di sviluppo (IDE o terminale) per assicurarti che tutte le configurazioni vengano caricate correttamente.\n\n---\n\n**Passaggio 4: Verifica la Soluzione**\n\nUna volta completati i passaggi precedenti, il tuo TypeScript dovrebbe riconoscere correttamente il matcher `toBeVisible` con Vitest.\n\n**Esempio di Test Aggiornato:**\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom/vitest'; // Importa i matcher se non usi il file di setup\nimport PromptList from './PromptList';\n\ntest('renders \"server.py\" link and checks for visibility', () => {\n render();\n \n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n});\n```\n\n---\n\n**Altri Consigli:**\n\n- **Verifica il File di Configurazione Vitest:** Assicurati che il file `vitest.config.ts` (o `.js`) sia correttamente configurato e che il percorso del file di setup sia corretto.\n- **Controlla i Tipi Installati:** Assicurati che i tipi di `vitest` e `@testing-library/jest-dom/vitest` siano installati e configurati correttamente.\n- **Aggiorna le Dipendenze:** Se hai aggiornato recentemente `@testing-library/react` o `@testing-library/jest-dom/vitest`, assicurati che tutte le dipendenze correlate siano aggiornate a versioni compatibili.\n\nSeguendo questi passaggi, dovresti essere in grado di risolvere l'errore e utilizzare correttamente il matcher `toBeVisible` con Vitest e TypeScript.", + "timestamp": "2025-01-03T17:18:36.481076Z", + "message_id": "eaabd167-7725-4ac2-ad79-670e17b5cd16" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-78509f7f36b641e49975251ef7b61a20", + "conversation_timestamp": "2025-01-03T17:18:35.658074Z" + }, + "alert_id": "ffc1953f-12e4-406d-a920-3aee9593cdd0", + "code_snippet": null, + "trigger_string": "GitHub - Access Token:\n useSse();\n\n const test = \"ghp_token\";\n const breadcrumb = useBreadcrumb();\n\n", + "trigger_type": "codegate-secrets", + "trigger_category": "critical", + "timestamp": "2025-01-03T17:18:35.658074Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/components/__tests__/PromptList.test.tsx (16-22)\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n });\n});\n\n```\nPlease explain the cause of this error and how to solve it: Property 'toBeVisible' does not exist on type 'Assertion'.", + "timestamp": "2025-01-03T17:11:40.481120Z", + "message_id": "0e3227e9-f861-4d48-868f-a32ee48aadd5" + }, + "answer": { + "message": "The error message you're seeing:\n\n```\nProperty 'toBeVisible' does not exist on type 'Assertion'.\n```\n\nindicates that the `toBeVisible` matcher is not recognized by the types for the `Assertion` object. This typically happens when the matcher is not installed or when the type definitions for the testing library you are using are not properly configured.\n\n### **Understanding the Cause**\n\n1. **Missing `@testing-library/jest-dom` Package:**\n - **`toBeVisible`** is a custom matcher provided by the **`@testing-library/jest-dom`** package. If this package is not installed in your project, the TypeScript type definitions will not recognize `toBeVisible`, leading to the error.\n\n2. **Type Definitions Not Linked:**\n - Even if the package is installed, TypeScript might not be aware of the additional matchers provided by `@testing-library/jest-dom`. This can happen if the type definitions are not correctly linked in your project.\n\n### **How to Solve the Error**\n\nTo resolve this issue, you need to ensure that:\n\n1. **Install the `@testing-library/jest-dom` Package:**\n - This package contains the additional matchers like `toBeVisible`.\n\n2. **Configure TypeScript to Recognize the Additional Matchers:**\n - You need to extend the Jest types to include the `@testing-library/jest-dom` matchers.\n\nHere's a step-by-step guide to solving the error:\n\n---\n\n**Step 1: Install `@testing-library/jest-dom`**\n\nFirst, you need to install the `@testing-library/jest-dom` package if it's not already installed. You can do this using npm or yarn.\n\n**Using npm:**\n\n```bash\nnpm install --save-dev @testing-library/jest-dom\n```\n\n**Using yarn:**\n\n```bash\nyarn add --dev @testing-library/jest-dom\n```\n\n---\n\n**Step 2: Extend Jest Types**\n\nNext, you need to extend the Jest types to include the matchers from `@testing-library/jest-dom`. This is typically done by creating a custom Jest setup file and telling Jest to use it.\n\n1. **Create a Jest Setup File:**\n\n Create a new file, for example, `setupTests.ts` (or `setupTests.js` if you prefer not to use TypeScript), in the `src` directory or any other appropriate location.\n\n ```typescript\n // setupTests.ts\n import '@testing-library/jest-dom/extend-expect';\n ```\n\n This file imports the necessary matchers from `@testing-library/jest-dom` and extends Jest's `expect` object to include them.\n\n2. **Configure Jest to Use the Setup File:**\n\n In your Jest configuration file (e.g., `jest.config.js`), specify the setup file. If you don't have a Jest configuration file, you can create one.\n\n ```javascript\n // jest.config.js\n module.exports = {\n setupFilesAfterEnv: ['/src/setupTests.ts'],\n };\n ```\n\n Replace `` with the appropriate path to your `setupTests.ts` file if it's located differently.\n\n---\n\n**Step 3: Verify TypeScript Configuration**\n\nEnsure that your `tsconfig.json` is correctly set up to include the necessary type definitions. Specifically, make sure that `esModuleInterop` is set to `true` to handle the imports correctly.\n\n```json\n{\n \"compilerOptions\": {\n \"esModuleInterop\": true,\n // Other options...\n },\n // Other configurations...\n}\n```\n\n---\n\n**Step 4: Restart Your Development Environment**\n\nAfter making these changes, restart your development environment (e.g., your IDE or the command line) to ensure that all configurations are loaded correctly.\n\n---\n\n**Step 5: Verify the Solution**\n\nOnce you've completed the above steps, your TypeScript setup should recognize the `toBeVisible` matcher, and the error should be resolved.\n\n**Your Updated Test Code:**\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom/extend-expect'; // Ensure this is imported if not using the setup file\nimport PromptList from './PromptList';\n\ntest('renders \"server.py\" link and checks for visibility', () => {\n render();\n \n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n});\n```\n\n**Note:**\n\n- If you used a Jest setup file as described above (`setupTests.ts`), ensure that it is correctly referenced in your Jest configuration.\n- If you prefer not to use a setup file, you can directly import `@testing-library/jest-dom/extend-expect` in your test file. However, using a setup file is generally recommended for cleaner and reusable configurations.\n\n---\n\n**Additional Tips:**\n\n- **Ensure Proper Import Paths:** Double-check that your import paths are correct. If you're using TypeScript, make sure that the import paths in your setup file match the actual file locations.\n- **Check for Typos:** Ensure there are no typos in your import statements or matcher names.\n- **Update Dependencies:** If you recently updated `@testing-library/react` or `@testing-library/jest-dom`, ensure that all related dependencies are also updated to compatible versions.\n\nBy following these steps, you should be able to resolve the error and successfully use the `toBeVisible` matcher in your tests.", + "timestamp": "2025-01-03T17:11:20.844684Z", + "message_id": "6089cb6a-8768-4336-ab4a-457770f9c0e2" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d5ae6161eab44ad964435efcf3d83b4", + "conversation_timestamp": "2025-01-03T17:11:40.481120Z" + }, + "alert_id": "0e3227e9-f861-4d48-868f-a32ee48aadd5", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-03T17:11:40.481120Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/components/__tests__/PromptList.test.tsx (16-22)\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n });\n});\n\n```\nPlease explain the cause of this error and how to solve it: Property 'toBeVisible' does not exist on type 'Assertion'.", + "timestamp": "2025-01-03T17:11:36.387112Z", + "message_id": "e64e9566-aaa8-478d-a54e-eafecd8e1c8a" + }, + "answer": { + "message": "The error message you're seeing:\n\n```\nProperty 'toBeVisible' does not exist on type 'Assertion'.\n```\n\nindicates that the `toBeVisible` matcher is not recognized by the types for the `Assertion` object. This typically happens when the matcher is not installed or when the type definitions for the testing library you are using are not properly configured.\n\n### **Understanding the Cause**\n\n1. **Missing `@testing-library/jest-dom` Package:**\n - **`toBeVisible`** is a custom matcher provided by the **`@testing-library/jest-dom`** package. If this package is not installed in your project, the TypeScript type definitions will not recognize `toBeVisible`, leading to the error.\n\n2. **Type Definitions Not Linked:**\n - Even if the package is installed, TypeScript might not be aware of the additional matchers provided by `@testing-library/jest-dom`. This can happen if the type definitions are not correctly linked in your project.\n\n### **How to Solve the Error**\n\nTo resolve this issue, you need to ensure that:\n\n1. **Install the `@testing-library/jest-dom` Package:**\n - This package contains the additional matchers like `toBeVisible`.\n\n2. **Configure TypeScript to Recognize the Additional Matchers:**\n - You need to extend the Jest types to include the `@testing-library/jest-dom` matchers.\n\nHere's a step-by-step guide to solving the error:\n\n---\n\n**Step 1: Install `@testing-library/jest-dom`**\n\nFirst, you need to install the `@testing-library/jest-dom` package if it's not already installed. You can do this using npm or yarn.\n\n**Using npm:**\n\n```bash\nnpm install --save-dev @testing-library/jest-dom\n```\n\n**Using yarn:**\n\n```bash\nyarn add --dev @testing-library/jest-dom\n```\n\n---\n\n**Step 2: Extend Jest Types**\n\nNext, you need to extend the Jest types to include the matchers from `@testing-library/jest-dom`. This is typically done by creating a custom Jest setup file and telling Jest to use it.\n\n1. **Create a Jest Setup File:**\n\n Create a new file, for example, `setupTests.ts` (or `setupTests.js` if you prefer not to use TypeScript), in the `src` directory or any other appropriate location.\n\n ```typescript\n // setupTests.ts\n import '@testing-library/jest-dom/extend-expect';\n ```\n\n This file imports the necessary matchers from `@testing-library/jest-dom` and extends Jest's `expect` object to include them.\n\n2. **Configure Jest to Use the Setup File:**\n\n In your Jest configuration file (e.g., `jest.config.js`), specify the setup file. If you don't have a Jest configuration file, you can create one.\n\n ```javascript\n // jest.config.js\n module.exports = {\n setupFilesAfterEnv: ['/src/setupTests.ts'],\n };\n ```\n\n Replace `` with the appropriate path to your `setupTests.ts` file if it's located differently.\n\n---\n\n**Step 3: Verify TypeScript Configuration**\n\nEnsure that your `tsconfig.json` is correctly set up to include the necessary type definitions. Specifically, make sure that `esModuleInterop` is set to `true` to handle the imports correctly.\n\n```json\n{\n \"compilerOptions\": {\n \"esModuleInterop\": true,\n // Other options...\n },\n // Other configurations...\n}\n```\n\n---\n\n**Step 4: Restart Your Development Environment**\n\nAfter making these changes, restart your development environment (e.g., your IDE or the command line) to ensure that all configurations are loaded correctly.\n\n---\n\n**Step 5: Verify the Solution**\n\nOnce you've completed the above steps, your TypeScript setup should recognize the `toBeVisible` matcher, and the error should be resolved.\n\n**Your Updated Test Code:**\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom/extend-expect'; // Ensure this is imported if not using the setup file\nimport PromptList from './PromptList';\n\ntest('renders \"server.py\" link and checks for visibility', () => {\n render();\n \n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n});\n```\n\n**Note:**\n\n- If you used a Jest setup file as described above (`setupTests.ts`), ensure that it is correctly referenced in your Jest configuration.\n- If you prefer not to use a setup file, you can directly import `@testing-library/jest-dom/extend-expect` in your test file. However, using a setup file is generally recommended for cleaner and reusable configurations.\n\n---\n\n**Additional Tips:**\n\n- **Ensure Proper Import Paths:** Double-check that your import paths are correct. If you're using TypeScript, make sure that the import paths in your setup file match the actual file locations.\n- **Check for Typos:** Ensure there are no typos in your import statements or matcher names.\n- **Update Dependencies:** If you recently updated `@testing-library/react` or `@testing-library/jest-dom`, ensure that all related dependencies are also updated to compatible versions.\n\nBy following these steps, you should be able to resolve the error and successfully use the `toBeVisible` matcher in your tests.", + "timestamp": "2025-01-03T17:11:20.844684Z", + "message_id": "6089cb6a-8768-4336-ab4a-457770f9c0e2" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d5ae6161eab44ad964435efcf3d83b4", + "conversation_timestamp": "2025-01-03T17:11:36.387112Z" + }, + "alert_id": "e64e9566-aaa8-478d-a54e-eafecd8e1c8a", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-03T17:11:36.387112Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/components/__tests__/PromptList.test.tsx (16-22)\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n });\n});\n\n```\nPlease explain the cause of this error and how to solve it: Property 'toBeVisible' does not exist on type 'Assertion'.", + "timestamp": "2025-01-03T17:11:34.144459Z", + "message_id": "f38303d7-faa3-47b6-9d2f-f9c9b8e20bfc" + }, + "answer": { + "message": "The error message you're seeing:\n\n```\nProperty 'toBeVisible' does not exist on type 'Assertion'.\n```\n\nindicates that the `toBeVisible` matcher is not recognized by the types for the `Assertion` object. This typically happens when the matcher is not installed or when the type definitions for the testing library you are using are not properly configured.\n\n### **Understanding the Cause**\n\n1. **Missing `@testing-library/jest-dom` Package:**\n - **`toBeVisible`** is a custom matcher provided by the **`@testing-library/jest-dom`** package. If this package is not installed in your project, the TypeScript type definitions will not recognize `toBeVisible`, leading to the error.\n\n2. **Type Definitions Not Linked:**\n - Even if the package is installed, TypeScript might not be aware of the additional matchers provided by `@testing-library/jest-dom`. This can happen if the type definitions are not correctly linked in your project.\n\n### **How to Solve the Error**\n\nTo resolve this issue, you need to ensure that:\n\n1. **Install the `@testing-library/jest-dom` Package:**\n - This package contains the additional matchers like `toBeVisible`.\n\n2. **Configure TypeScript to Recognize the Additional Matchers:**\n - You need to extend the Jest types to include the `@testing-library/jest-dom` matchers.\n\nHere's a step-by-step guide to solving the error:\n\n---\n\n**Step 1: Install `@testing-library/jest-dom`**\n\nFirst, you need to install the `@testing-library/jest-dom` package if it's not already installed. You can do this using npm or yarn.\n\n**Using npm:**\n\n```bash\nnpm install --save-dev @testing-library/jest-dom\n```\n\n**Using yarn:**\n\n```bash\nyarn add --dev @testing-library/jest-dom\n```\n\n---\n\n**Step 2: Extend Jest Types**\n\nNext, you need to extend the Jest types to include the matchers from `@testing-library/jest-dom`. This is typically done by creating a custom Jest setup file and telling Jest to use it.\n\n1. **Create a Jest Setup File:**\n\n Create a new file, for example, `setupTests.ts` (or `setupTests.js` if you prefer not to use TypeScript), in the `src` directory or any other appropriate location.\n\n ```typescript\n // setupTests.ts\n import '@testing-library/jest-dom/extend-expect';\n ```\n\n This file imports the necessary matchers from `@testing-library/jest-dom` and extends Jest's `expect` object to include them.\n\n2. **Configure Jest to Use the Setup File:**\n\n In your Jest configuration file (e.g., `jest.config.js`), specify the setup file. If you don't have a Jest configuration file, you can create one.\n\n ```javascript\n // jest.config.js\n module.exports = {\n setupFilesAfterEnv: ['/src/setupTests.ts'],\n };\n ```\n\n Replace `` with the appropriate path to your `setupTests.ts` file if it's located differently.\n\n---\n\n**Step 3: Verify TypeScript Configuration**\n\nEnsure that your `tsconfig.json` is correctly set up to include the necessary type definitions. Specifically, make sure that `esModuleInterop` is set to `true` to handle the imports correctly.\n\n```json\n{\n \"compilerOptions\": {\n \"esModuleInterop\": true,\n // Other options...\n },\n // Other configurations...\n}\n```\n\n---\n\n**Step 4: Restart Your Development Environment**\n\nAfter making these changes, restart your development environment (e.g., your IDE or the command line) to ensure that all configurations are loaded correctly.\n\n---\n\n**Step 5: Verify the Solution**\n\nOnce you've completed the above steps, your TypeScript setup should recognize the `toBeVisible` matcher, and the error should be resolved.\n\n**Your Updated Test Code:**\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom/extend-expect'; // Ensure this is imported if not using the setup file\nimport PromptList from './PromptList';\n\ntest('renders \"server.py\" link and checks for visibility', () => {\n render();\n \n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n});\n```\n\n**Note:**\n\n- If you used a Jest setup file as described above (`setupTests.ts`), ensure that it is correctly referenced in your Jest configuration.\n- If you prefer not to use a setup file, you can directly import `@testing-library/jest-dom/extend-expect` in your test file. However, using a setup file is generally recommended for cleaner and reusable configurations.\n\n---\n\n**Additional Tips:**\n\n- **Ensure Proper Import Paths:** Double-check that your import paths are correct. If you're using TypeScript, make sure that the import paths in your setup file match the actual file locations.\n- **Check for Typos:** Ensure there are no typos in your import statements or matcher names.\n- **Update Dependencies:** If you recently updated `@testing-library/react` or `@testing-library/jest-dom`, ensure that all related dependencies are also updated to compatible versions.\n\nBy following these steps, you should be able to resolve the error and successfully use the `toBeVisible` matcher in your tests.", + "timestamp": "2025-01-03T17:11:20.844684Z", + "message_id": "6089cb6a-8768-4336-ab4a-457770f9c0e2" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d5ae6161eab44ad964435efcf3d83b4", + "conversation_timestamp": "2025-01-03T17:11:34.144459Z" + }, + "alert_id": "f38303d7-faa3-47b6-9d2f-f9c9b8e20bfc", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-03T17:11:34.144459Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/components/__tests__/PromptList.test.tsx (16-22)\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n });\n});\n\n```\nPlease explain the cause of this error and how to solve it: Property 'toBeVisible' does not exist on type 'Assertion'.", + "timestamp": "2025-01-03T17:11:31.745803Z", + "message_id": "0fa9feb8-d036-46f9-bdbe-dae24de11aac" + }, + "answer": { + "message": "The error message you're seeing:\n\n```\nProperty 'toBeVisible' does not exist on type 'Assertion'.\n```\n\nindicates that the `toBeVisible` matcher is not recognized by the types for the `Assertion` object. This typically happens when the matcher is not installed or when the type definitions for the testing library you are using are not properly configured.\n\n### **Understanding the Cause**\n\n1. **Missing `@testing-library/jest-dom` Package:**\n - **`toBeVisible`** is a custom matcher provided by the **`@testing-library/jest-dom`** package. If this package is not installed in your project, the TypeScript type definitions will not recognize `toBeVisible`, leading to the error.\n\n2. **Type Definitions Not Linked:**\n - Even if the package is installed, TypeScript might not be aware of the additional matchers provided by `@testing-library/jest-dom`. This can happen if the type definitions are not correctly linked in your project.\n\n### **How to Solve the Error**\n\nTo resolve this issue, you need to ensure that:\n\n1. **Install the `@testing-library/jest-dom` Package:**\n - This package contains the additional matchers like `toBeVisible`.\n\n2. **Configure TypeScript to Recognize the Additional Matchers:**\n - You need to extend the Jest types to include the `@testing-library/jest-dom` matchers.\n\nHere's a step-by-step guide to solving the error:\n\n---\n\n**Step 1: Install `@testing-library/jest-dom`**\n\nFirst, you need to install the `@testing-library/jest-dom` package if it's not already installed. You can do this using npm or yarn.\n\n**Using npm:**\n\n```bash\nnpm install --save-dev @testing-library/jest-dom\n```\n\n**Using yarn:**\n\n```bash\nyarn add --dev @testing-library/jest-dom\n```\n\n---\n\n**Step 2: Extend Jest Types**\n\nNext, you need to extend the Jest types to include the matchers from `@testing-library/jest-dom`. This is typically done by creating a custom Jest setup file and telling Jest to use it.\n\n1. **Create a Jest Setup File:**\n\n Create a new file, for example, `setupTests.ts` (or `setupTests.js` if you prefer not to use TypeScript), in the `src` directory or any other appropriate location.\n\n ```typescript\n // setupTests.ts\n import '@testing-library/jest-dom/extend-expect';\n ```\n\n This file imports the necessary matchers from `@testing-library/jest-dom` and extends Jest's `expect` object to include them.\n\n2. **Configure Jest to Use the Setup File:**\n\n In your Jest configuration file (e.g., `jest.config.js`), specify the setup file. If you don't have a Jest configuration file, you can create one.\n\n ```javascript\n // jest.config.js\n module.exports = {\n setupFilesAfterEnv: ['/src/setupTests.ts'],\n };\n ```\n\n Replace `` with the appropriate path to your `setupTests.ts` file if it's located differently.\n\n---\n\n**Step 3: Verify TypeScript Configuration**\n\nEnsure that your `tsconfig.json` is correctly set up to include the necessary type definitions. Specifically, make sure that `esModuleInterop` is set to `true` to handle the imports correctly.\n\n```json\n{\n \"compilerOptions\": {\n \"esModuleInterop\": true,\n // Other options...\n },\n // Other configurations...\n}\n```\n\n---\n\n**Step 4: Restart Your Development Environment**\n\nAfter making these changes, restart your development environment (e.g., your IDE or the command line) to ensure that all configurations are loaded correctly.\n\n---\n\n**Step 5: Verify the Solution**\n\nOnce you've completed the above steps, your TypeScript setup should recognize the `toBeVisible` matcher, and the error should be resolved.\n\n**Your Updated Test Code:**\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom/extend-expect'; // Ensure this is imported if not using the setup file\nimport PromptList from './PromptList';\n\ntest('renders \"server.py\" link and checks for visibility', () => {\n render();\n \n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n});\n```\n\n**Note:**\n\n- If you used a Jest setup file as described above (`setupTests.ts`), ensure that it is correctly referenced in your Jest configuration.\n- If you prefer not to use a setup file, you can directly import `@testing-library/jest-dom/extend-expect` in your test file. However, using a setup file is generally recommended for cleaner and reusable configurations.\n\n---\n\n**Additional Tips:**\n\n- **Ensure Proper Import Paths:** Double-check that your import paths are correct. If you're using TypeScript, make sure that the import paths in your setup file match the actual file locations.\n- **Check for Typos:** Ensure there are no typos in your import statements or matcher names.\n- **Update Dependencies:** If you recently updated `@testing-library/react` or `@testing-library/jest-dom`, ensure that all related dependencies are also updated to compatible versions.\n\nBy following these steps, you should be able to resolve the error and successfully use the `toBeVisible` matcher in your tests.", + "timestamp": "2025-01-03T17:11:20.844684Z", + "message_id": "6089cb6a-8768-4336-ab4a-457770f9c0e2" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d5ae6161eab44ad964435efcf3d83b4", + "conversation_timestamp": "2025-01-03T17:11:31.745803Z" + }, + "alert_id": "0fa9feb8-d036-46f9-bdbe-dae24de11aac", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-03T17:11:31.745803Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/components/__tests__/PromptList.test.tsx (16-22)\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n });\n});\n\n```\nPlease explain the cause of this error and how to solve it: Property 'toBeVisible' does not exist on type 'Assertion'.", + "timestamp": "2025-01-03T17:11:29.042378Z", + "message_id": "8d838d50-205b-4ae3-990c-cbefd326fee3" + }, + "answer": { + "message": "The error message you're seeing:\n\n```\nProperty 'toBeVisible' does not exist on type 'Assertion'.\n```\n\nindicates that the `toBeVisible` matcher is not recognized by the types for the `Assertion` object. This typically happens when the matcher is not installed or when the type definitions for the testing library you are using are not properly configured.\n\n### **Understanding the Cause**\n\n1. **Missing `@testing-library/jest-dom` Package:**\n - **`toBeVisible`** is a custom matcher provided by the **`@testing-library/jest-dom`** package. If this package is not installed in your project, the TypeScript type definitions will not recognize `toBeVisible`, leading to the error.\n\n2. **Type Definitions Not Linked:**\n - Even if the package is installed, TypeScript might not be aware of the additional matchers provided by `@testing-library/jest-dom`. This can happen if the type definitions are not correctly linked in your project.\n\n### **How to Solve the Error**\n\nTo resolve this issue, you need to ensure that:\n\n1. **Install the `@testing-library/jest-dom` Package:**\n - This package contains the additional matchers like `toBeVisible`.\n\n2. **Configure TypeScript to Recognize the Additional Matchers:**\n - You need to extend the Jest types to include the `@testing-library/jest-dom` matchers.\n\nHere's a step-by-step guide to solving the error:\n\n---\n\n**Step 1: Install `@testing-library/jest-dom`**\n\nFirst, you need to install the `@testing-library/jest-dom` package if it's not already installed. You can do this using npm or yarn.\n\n**Using npm:**\n\n```bash\nnpm install --save-dev @testing-library/jest-dom\n```\n\n**Using yarn:**\n\n```bash\nyarn add --dev @testing-library/jest-dom\n```\n\n---\n\n**Step 2: Extend Jest Types**\n\nNext, you need to extend the Jest types to include the matchers from `@testing-library/jest-dom`. This is typically done by creating a custom Jest setup file and telling Jest to use it.\n\n1. **Create a Jest Setup File:**\n\n Create a new file, for example, `setupTests.ts` (or `setupTests.js` if you prefer not to use TypeScript), in the `src` directory or any other appropriate location.\n\n ```typescript\n // setupTests.ts\n import '@testing-library/jest-dom/extend-expect';\n ```\n\n This file imports the necessary matchers from `@testing-library/jest-dom` and extends Jest's `expect` object to include them.\n\n2. **Configure Jest to Use the Setup File:**\n\n In your Jest configuration file (e.g., `jest.config.js`), specify the setup file. If you don't have a Jest configuration file, you can create one.\n\n ```javascript\n // jest.config.js\n module.exports = {\n setupFilesAfterEnv: ['/src/setupTests.ts'],\n };\n ```\n\n Replace `` with the appropriate path to your `setupTests.ts` file if it's located differently.\n\n---\n\n**Step 3: Verify TypeScript Configuration**\n\nEnsure that your `tsconfig.json` is correctly set up to include the necessary type definitions. Specifically, make sure that `esModuleInterop` is set to `true` to handle the imports correctly.\n\n```json\n{\n \"compilerOptions\": {\n \"esModuleInterop\": true,\n // Other options...\n },\n // Other configurations...\n}\n```\n\n---\n\n**Step 4: Restart Your Development Environment**\n\nAfter making these changes, restart your development environment (e.g., your IDE or the command line) to ensure that all configurations are loaded correctly.\n\n---\n\n**Step 5: Verify the Solution**\n\nOnce you've completed the above steps, your TypeScript setup should recognize the `toBeVisible` matcher, and the error should be resolved.\n\n**Your Updated Test Code:**\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom/extend-expect'; // Ensure this is imported if not using the setup file\nimport PromptList from './PromptList';\n\ntest('renders \"server.py\" link and checks for visibility', () => {\n render();\n \n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n});\n```\n\n**Note:**\n\n- If you used a Jest setup file as described above (`setupTests.ts`), ensure that it is correctly referenced in your Jest configuration.\n- If you prefer not to use a setup file, you can directly import `@testing-library/jest-dom/extend-expect` in your test file. However, using a setup file is generally recommended for cleaner and reusable configurations.\n\n---\n\n**Additional Tips:**\n\n- **Ensure Proper Import Paths:** Double-check that your import paths are correct. If you're using TypeScript, make sure that the import paths in your setup file match the actual file locations.\n- **Check for Typos:** Ensure there are no typos in your import statements or matcher names.\n- **Update Dependencies:** If you recently updated `@testing-library/react` or `@testing-library/jest-dom`, ensure that all related dependencies are also updated to compatible versions.\n\nBy following these steps, you should be able to resolve the error and successfully use the `toBeVisible` matcher in your tests.", + "timestamp": "2025-01-03T17:11:20.844684Z", + "message_id": "6089cb6a-8768-4336-ab4a-457770f9c0e2" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d5ae6161eab44ad964435efcf3d83b4", + "conversation_timestamp": "2025-01-03T17:11:29.042378Z" + }, + "alert_id": "8d838d50-205b-4ae3-990c-cbefd326fee3", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-03T17:11:29.042378Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/components/__tests__/PromptList.test.tsx (16-22)\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n });\n});\n\n```\nPlease explain the cause of this error and how to solve it: Property 'toBeVisible' does not exist on type 'Assertion'.", + "timestamp": "2025-01-03T17:11:28.579966Z", + "message_id": "dc0ab14e-6530-472f-92a8-8eee23c16f28" + }, + "answer": { + "message": "The error message you're seeing:\n\n```\nProperty 'toBeVisible' does not exist on type 'Assertion'.\n```\n\nindicates that the `toBeVisible` matcher is not recognized by the types for the `Assertion` object. This typically happens when the matcher is not installed or when the type definitions for the testing library you are using are not properly configured.\n\n### **Understanding the Cause**\n\n1. **Missing `@testing-library/jest-dom` Package:**\n - **`toBeVisible`** is a custom matcher provided by the **`@testing-library/jest-dom`** package. If this package is not installed in your project, the TypeScript type definitions will not recognize `toBeVisible`, leading to the error.\n\n2. **Type Definitions Not Linked:**\n - Even if the package is installed, TypeScript might not be aware of the additional matchers provided by `@testing-library/jest-dom`. This can happen if the type definitions are not correctly linked in your project.\n\n### **How to Solve the Error**\n\nTo resolve this issue, you need to ensure that:\n\n1. **Install the `@testing-library/jest-dom` Package:**\n - This package contains the additional matchers like `toBeVisible`.\n\n2. **Configure TypeScript to Recognize the Additional Matchers:**\n - You need to extend the Jest types to include the `@testing-library/jest-dom` matchers.\n\nHere's a step-by-step guide to solving the error:\n\n---\n\n**Step 1: Install `@testing-library/jest-dom`**\n\nFirst, you need to install the `@testing-library/jest-dom` package if it's not already installed. You can do this using npm or yarn.\n\n**Using npm:**\n\n```bash\nnpm install --save-dev @testing-library/jest-dom\n```\n\n**Using yarn:**\n\n```bash\nyarn add --dev @testing-library/jest-dom\n```\n\n---\n\n**Step 2: Extend Jest Types**\n\nNext, you need to extend the Jest types to include the matchers from `@testing-library/jest-dom`. This is typically done by creating a custom Jest setup file and telling Jest to use it.\n\n1. **Create a Jest Setup File:**\n\n Create a new file, for example, `setupTests.ts` (or `setupTests.js` if you prefer not to use TypeScript), in the `src` directory or any other appropriate location.\n\n ```typescript\n // setupTests.ts\n import '@testing-library/jest-dom/extend-expect';\n ```\n\n This file imports the necessary matchers from `@testing-library/jest-dom` and extends Jest's `expect` object to include them.\n\n2. **Configure Jest to Use the Setup File:**\n\n In your Jest configuration file (e.g., `jest.config.js`), specify the setup file. If you don't have a Jest configuration file, you can create one.\n\n ```javascript\n // jest.config.js\n module.exports = {\n setupFilesAfterEnv: ['/src/setupTests.ts'],\n };\n ```\n\n Replace `` with the appropriate path to your `setupTests.ts` file if it's located differently.\n\n---\n\n**Step 3: Verify TypeScript Configuration**\n\nEnsure that your `tsconfig.json` is correctly set up to include the necessary type definitions. Specifically, make sure that `esModuleInterop` is set to `true` to handle the imports correctly.\n\n```json\n{\n \"compilerOptions\": {\n \"esModuleInterop\": true,\n // Other options...\n },\n // Other configurations...\n}\n```\n\n---\n\n**Step 4: Restart Your Development Environment**\n\nAfter making these changes, restart your development environment (e.g., your IDE or the command line) to ensure that all configurations are loaded correctly.\n\n---\n\n**Step 5: Verify the Solution**\n\nOnce you've completed the above steps, your TypeScript setup should recognize the `toBeVisible` matcher, and the error should be resolved.\n\n**Your Updated Test Code:**\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom/extend-expect'; // Ensure this is imported if not using the setup file\nimport PromptList from './PromptList';\n\ntest('renders \"server.py\" link and checks for visibility', () => {\n render();\n \n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n});\n```\n\n**Note:**\n\n- If you used a Jest setup file as described above (`setupTests.ts`), ensure that it is correctly referenced in your Jest configuration.\n- If you prefer not to use a setup file, you can directly import `@testing-library/jest-dom/extend-expect` in your test file. However, using a setup file is generally recommended for cleaner and reusable configurations.\n\n---\n\n**Additional Tips:**\n\n- **Ensure Proper Import Paths:** Double-check that your import paths are correct. If you're using TypeScript, make sure that the import paths in your setup file match the actual file locations.\n- **Check for Typos:** Ensure there are no typos in your import statements or matcher names.\n- **Update Dependencies:** If you recently updated `@testing-library/react` or `@testing-library/jest-dom`, ensure that all related dependencies are also updated to compatible versions.\n\nBy following these steps, you should be able to resolve the error and successfully use the `toBeVisible` matcher in your tests.", + "timestamp": "2025-01-03T17:11:20.844684Z", + "message_id": "6089cb6a-8768-4336-ab4a-457770f9c0e2" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d5ae6161eab44ad964435efcf3d83b4", + "conversation_timestamp": "2025-01-03T17:11:28.579966Z" + }, + "alert_id": "dc0ab14e-6530-472f-92a8-8eee23c16f28", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-03T17:11:28.579966Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/components/__tests__/PromptList.test.tsx (16-22)\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n });\n});\n\n```\nPlease explain the cause of this error and how to solve it: Property 'toBeVisible' does not exist on type 'Assertion'.", + "timestamp": "2025-01-03T17:11:21.368334Z", + "message_id": "90c7af40-c3db-47b6-9003-849fcfbb4079" + }, + "answer": { + "message": "The error message you're seeing:\n\n```\nProperty 'toBeVisible' does not exist on type 'Assertion'.\n```\n\nindicates that the `toBeVisible` matcher is not recognized by the types for the `Assertion` object. This typically happens when the matcher is not installed or when the type definitions for the testing library you are using are not properly configured.\n\n### **Understanding the Cause**\n\n1. **Missing `@testing-library/jest-dom` Package:**\n - **`toBeVisible`** is a custom matcher provided by the **`@testing-library/jest-dom`** package. If this package is not installed in your project, the TypeScript type definitions will not recognize `toBeVisible`, leading to the error.\n\n2. **Type Definitions Not Linked:**\n - Even if the package is installed, TypeScript might not be aware of the additional matchers provided by `@testing-library/jest-dom`. This can happen if the type definitions are not correctly linked in your project.\n\n### **How to Solve the Error**\n\nTo resolve this issue, you need to ensure that:\n\n1. **Install the `@testing-library/jest-dom` Package:**\n - This package contains the additional matchers like `toBeVisible`.\n\n2. **Configure TypeScript to Recognize the Additional Matchers:**\n - You need to extend the Jest types to include the `@testing-library/jest-dom` matchers.\n\nHere's a step-by-step guide to solving the error:\n\n---\n\n**Step 1: Install `@testing-library/jest-dom`**\n\nFirst, you need to install the `@testing-library/jest-dom` package if it's not already installed. You can do this using npm or yarn.\n\n**Using npm:**\n\n```bash\nnpm install --save-dev @testing-library/jest-dom\n```\n\n**Using yarn:**\n\n```bash\nyarn add --dev @testing-library/jest-dom\n```\n\n---\n\n**Step 2: Extend Jest Types**\n\nNext, you need to extend the Jest types to include the matchers from `@testing-library/jest-dom`. This is typically done by creating a custom Jest setup file and telling Jest to use it.\n\n1. **Create a Jest Setup File:**\n\n Create a new file, for example, `setupTests.ts` (or `setupTests.js` if you prefer not to use TypeScript), in the `src` directory or any other appropriate location.\n\n ```typescript\n // setupTests.ts\n import '@testing-library/jest-dom/extend-expect';\n ```\n\n This file imports the necessary matchers from `@testing-library/jest-dom` and extends Jest's `expect` object to include them.\n\n2. **Configure Jest to Use the Setup File:**\n\n In your Jest configuration file (e.g., `jest.config.js`), specify the setup file. If you don't have a Jest configuration file, you can create one.\n\n ```javascript\n // jest.config.js\n module.exports = {\n setupFilesAfterEnv: ['/src/setupTests.ts'],\n };\n ```\n\n Replace `` with the appropriate path to your `setupTests.ts` file if it's located differently.\n\n---\n\n**Step 3: Verify TypeScript Configuration**\n\nEnsure that your `tsconfig.json` is correctly set up to include the necessary type definitions. Specifically, make sure that `esModuleInterop` is set to `true` to handle the imports correctly.\n\n```json\n{\n \"compilerOptions\": {\n \"esModuleInterop\": true,\n // Other options...\n },\n // Other configurations...\n}\n```\n\n---\n\n**Step 4: Restart Your Development Environment**\n\nAfter making these changes, restart your development environment (e.g., your IDE or the command line) to ensure that all configurations are loaded correctly.\n\n---\n\n**Step 5: Verify the Solution**\n\nOnce you've completed the above steps, your TypeScript setup should recognize the `toBeVisible` matcher, and the error should be resolved.\n\n**Your Updated Test Code:**\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom/extend-expect'; // Ensure this is imported if not using the setup file\nimport PromptList from './PromptList';\n\ntest('renders \"server.py\" link and checks for visibility', () => {\n render();\n \n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n});\n```\n\n**Note:**\n\n- If you used a Jest setup file as described above (`setupTests.ts`), ensure that it is correctly referenced in your Jest configuration.\n- If you prefer not to use a setup file, you can directly import `@testing-library/jest-dom/extend-expect` in your test file. However, using a setup file is generally recommended for cleaner and reusable configurations.\n\n---\n\n**Additional Tips:**\n\n- **Ensure Proper Import Paths:** Double-check that your import paths are correct. If you're using TypeScript, make sure that the import paths in your setup file match the actual file locations.\n- **Check for Typos:** Ensure there are no typos in your import statements or matcher names.\n- **Update Dependencies:** If you recently updated `@testing-library/react` or `@testing-library/jest-dom`, ensure that all related dependencies are also updated to compatible versions.\n\nBy following these steps, you should be able to resolve the error and successfully use the `toBeVisible` matcher in your tests.", + "timestamp": "2025-01-03T17:11:20.844684Z", + "message_id": "6089cb6a-8768-4336-ab4a-457770f9c0e2" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d5ae6161eab44ad964435efcf3d83b4", + "conversation_timestamp": "2025-01-03T17:11:21.368334Z" + }, + "alert_id": "90c7af40-c3db-47b6-9003-849fcfbb4079", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-03T17:11:21.368334Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/components/__tests__/PromptList.test.tsx (16-22)\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n });\n});\n\n```\nPlease explain the cause of this error and how to solve it: Property 'toBeVisible' does not exist on type 'Assertion'.", + "timestamp": "2025-01-03T17:11:20.078689Z", + "message_id": "67816a49-1998-4054-8758-eb7dd1cf0cb2" + }, + "answer": { + "message": "The error message you're seeing:\n\n```\nProperty 'toBeVisible' does not exist on type 'Assertion'.\n```\n\nindicates that the `toBeVisible` matcher is not recognized by the types for the `Assertion` object. This typically happens when the matcher is not installed or when the type definitions for the testing library you are using are not properly configured.\n\n### **Understanding the Cause**\n\n1. **Missing `@testing-library/jest-dom` Package:**\n - **`toBeVisible`** is a custom matcher provided by the **`@testing-library/jest-dom`** package. If this package is not installed in your project, the TypeScript type definitions will not recognize `toBeVisible`, leading to the error.\n\n2. **Type Definitions Not Linked:**\n - Even if the package is installed, TypeScript might not be aware of the additional matchers provided by `@testing-library/jest-dom`. This can happen if the type definitions are not correctly linked in your project.\n\n### **How to Solve the Error**\n\nTo resolve this issue, you need to ensure that:\n\n1. **Install the `@testing-library/jest-dom` Package:**\n - This package contains the additional matchers like `toBeVisible`.\n\n2. **Configure TypeScript to Recognize the Additional Matchers:**\n - You need to extend the Jest types to include the `@testing-library/jest-dom` matchers.\n\nHere's a step-by-step guide to solving the error:\n\n---\n\n**Step 1: Install `@testing-library/jest-dom`**\n\nFirst, you need to install the `@testing-library/jest-dom` package if it's not already installed. You can do this using npm or yarn.\n\n**Using npm:**\n\n```bash\nnpm install --save-dev @testing-library/jest-dom\n```\n\n**Using yarn:**\n\n```bash\nyarn add --dev @testing-library/jest-dom\n```\n\n---\n\n**Step 2: Extend Jest Types**\n\nNext, you need to extend the Jest types to include the matchers from `@testing-library/jest-dom`. This is typically done by creating a custom Jest setup file and telling Jest to use it.\n\n1. **Create a Jest Setup File:**\n\n Create a new file, for example, `setupTests.ts` (or `setupTests.js` if you prefer not to use TypeScript), in the `src` directory or any other appropriate location.\n\n ```typescript\n // setupTests.ts\n import '@testing-library/jest-dom/extend-expect';\n ```\n\n This file imports the necessary matchers from `@testing-library/jest-dom` and extends Jest's `expect` object to include them.\n\n2. **Configure Jest to Use the Setup File:**\n\n In your Jest configuration file (e.g., `jest.config.js`), specify the setup file. If you don't have a Jest configuration file, you can create one.\n\n ```javascript\n // jest.config.js\n module.exports = {\n setupFilesAfterEnv: ['/src/setupTests.ts'],\n };\n ```\n\n Replace `` with the appropriate path to your `setupTests.ts` file if it's located differently.\n\n---\n\n**Step 3: Verify TypeScript Configuration**\n\nEnsure that your `tsconfig.json` is correctly set up to include the necessary type definitions. Specifically, make sure that `esModuleInterop` is set to `true` to handle the imports correctly.\n\n```json\n{\n \"compilerOptions\": {\n \"esModuleInterop\": true,\n // Other options...\n },\n // Other configurations...\n}\n```\n\n---\n\n**Step 4: Restart Your Development Environment**\n\nAfter making these changes, restart your development environment (e.g., your IDE or the command line) to ensure that all configurations are loaded correctly.\n\n---\n\n**Step 5: Verify the Solution**\n\nOnce you've completed the above steps, your TypeScript setup should recognize the `toBeVisible` matcher, and the error should be resolved.\n\n**Your Updated Test Code:**\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom/extend-expect'; // Ensure this is imported if not using the setup file\nimport PromptList from './PromptList';\n\ntest('renders \"server.py\" link and checks for visibility', () => {\n render();\n \n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n});\n```\n\n**Note:**\n\n- If you used a Jest setup file as described above (`setupTests.ts`), ensure that it is correctly referenced in your Jest configuration.\n- If you prefer not to use a setup file, you can directly import `@testing-library/jest-dom/extend-expect` in your test file. However, using a setup file is generally recommended for cleaner and reusable configurations.\n\n---\n\n**Additional Tips:**\n\n- **Ensure Proper Import Paths:** Double-check that your import paths are correct. If you're using TypeScript, make sure that the import paths in your setup file match the actual file locations.\n- **Check for Typos:** Ensure there are no typos in your import statements or matcher names.\n- **Update Dependencies:** If you recently updated `@testing-library/react` or `@testing-library/jest-dom`, ensure that all related dependencies are also updated to compatible versions.\n\nBy following these steps, you should be able to resolve the error and successfully use the `toBeVisible` matcher in your tests.", + "timestamp": "2025-01-03T17:11:20.844684Z", + "message_id": "6089cb6a-8768-4336-ab4a-457770f9c0e2" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d5ae6161eab44ad964435efcf3d83b4", + "conversation_timestamp": "2025-01-03T17:11:20.078689Z" + }, + "alert_id": "67816a49-1998-4054-8758-eb7dd1cf0cb2", + "code_snippet": { + "code": " screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n });\n});\n\n", + "language": "typescript", + "filepath": "src/components/__tests__/PromptList.test.tsx", + "libraries": [] + }, + "trigger_string": null, + "trigger_type": "code-snippet-extractor", + "trigger_category": "info", + "timestamp": "2025-01-03T17:11:20.078689Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/components/__tests__/PromptList.test.tsx (16-22)\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n });\n});\n\n```\nPlease explain the cause of this error and how to solve it: Property 'toBeVisible' does not exist on type 'Assertion'.", + "timestamp": "2025-01-03T17:11:20.076275Z", + "message_id": "cfe7b8ac-5781-4ec5-a5de-50a5044f5dac" + }, + "answer": { + "message": "The error message you're seeing:\n\n```\nProperty 'toBeVisible' does not exist on type 'Assertion'.\n```\n\nindicates that the `toBeVisible` matcher is not recognized by the types for the `Assertion` object. This typically happens when the matcher is not installed or when the type definitions for the testing library you are using are not properly configured.\n\n### **Understanding the Cause**\n\n1. **Missing `@testing-library/jest-dom` Package:**\n - **`toBeVisible`** is a custom matcher provided by the **`@testing-library/jest-dom`** package. If this package is not installed in your project, the TypeScript type definitions will not recognize `toBeVisible`, leading to the error.\n\n2. **Type Definitions Not Linked:**\n - Even if the package is installed, TypeScript might not be aware of the additional matchers provided by `@testing-library/jest-dom`. This can happen if the type definitions are not correctly linked in your project.\n\n### **How to Solve the Error**\n\nTo resolve this issue, you need to ensure that:\n\n1. **Install the `@testing-library/jest-dom` Package:**\n - This package contains the additional matchers like `toBeVisible`.\n\n2. **Configure TypeScript to Recognize the Additional Matchers:**\n - You need to extend the Jest types to include the `@testing-library/jest-dom` matchers.\n\nHere's a step-by-step guide to solving the error:\n\n---\n\n**Step 1: Install `@testing-library/jest-dom`**\n\nFirst, you need to install the `@testing-library/jest-dom` package if it's not already installed. You can do this using npm or yarn.\n\n**Using npm:**\n\n```bash\nnpm install --save-dev @testing-library/jest-dom\n```\n\n**Using yarn:**\n\n```bash\nyarn add --dev @testing-library/jest-dom\n```\n\n---\n\n**Step 2: Extend Jest Types**\n\nNext, you need to extend the Jest types to include the matchers from `@testing-library/jest-dom`. This is typically done by creating a custom Jest setup file and telling Jest to use it.\n\n1. **Create a Jest Setup File:**\n\n Create a new file, for example, `setupTests.ts` (or `setupTests.js` if you prefer not to use TypeScript), in the `src` directory or any other appropriate location.\n\n ```typescript\n // setupTests.ts\n import '@testing-library/jest-dom/extend-expect';\n ```\n\n This file imports the necessary matchers from `@testing-library/jest-dom` and extends Jest's `expect` object to include them.\n\n2. **Configure Jest to Use the Setup File:**\n\n In your Jest configuration file (e.g., `jest.config.js`), specify the setup file. If you don't have a Jest configuration file, you can create one.\n\n ```javascript\n // jest.config.js\n module.exports = {\n setupFilesAfterEnv: ['/src/setupTests.ts'],\n };\n ```\n\n Replace `` with the appropriate path to your `setupTests.ts` file if it's located differently.\n\n---\n\n**Step 3: Verify TypeScript Configuration**\n\nEnsure that your `tsconfig.json` is correctly set up to include the necessary type definitions. Specifically, make sure that `esModuleInterop` is set to `true` to handle the imports correctly.\n\n```json\n{\n \"compilerOptions\": {\n \"esModuleInterop\": true,\n // Other options...\n },\n // Other configurations...\n}\n```\n\n---\n\n**Step 4: Restart Your Development Environment**\n\nAfter making these changes, restart your development environment (e.g., your IDE or the command line) to ensure that all configurations are loaded correctly.\n\n---\n\n**Step 5: Verify the Solution**\n\nOnce you've completed the above steps, your TypeScript setup should recognize the `toBeVisible` matcher, and the error should be resolved.\n\n**Your Updated Test Code:**\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom/extend-expect'; // Ensure this is imported if not using the setup file\nimport PromptList from './PromptList';\n\ntest('renders \"server.py\" link and checks for visibility', () => {\n render();\n \n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n});\n```\n\n**Note:**\n\n- If you used a Jest setup file as described above (`setupTests.ts`), ensure that it is correctly referenced in your Jest configuration.\n- If you prefer not to use a setup file, you can directly import `@testing-library/jest-dom/extend-expect` in your test file. However, using a setup file is generally recommended for cleaner and reusable configurations.\n\n---\n\n**Additional Tips:**\n\n- **Ensure Proper Import Paths:** Double-check that your import paths are correct. If you're using TypeScript, make sure that the import paths in your setup file match the actual file locations.\n- **Check for Typos:** Ensure there are no typos in your import statements or matcher names.\n- **Update Dependencies:** If you recently updated `@testing-library/react` or `@testing-library/jest-dom`, ensure that all related dependencies are also updated to compatible versions.\n\nBy following these steps, you should be able to resolve the error and successfully use the `toBeVisible` matcher in your tests.", + "timestamp": "2025-01-03T17:11:20.844684Z", + "message_id": "6089cb6a-8768-4336-ab4a-457770f9c0e2" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d5ae6161eab44ad964435efcf3d83b4", + "conversation_timestamp": "2025-01-03T17:11:20.076275Z" + }, + "alert_id": "cfe7b8ac-5781-4ec5-a5de-50a5044f5dac", + "code_snippet": null, + "trigger_string": "GitHub - Access Token:\n useSse();\n\n const test = \"ghp_token\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {", + "trigger_type": "codegate-secrets", + "trigger_category": "critical", + "timestamp": "2025-01-03T17:11:20.076275Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/components/__tests__/PromptList.test.tsx (16-22)\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n });\n});\n\n```\nPlease explain the cause of this error and how to solve it: Property 'toBeVisible' does not exist on type 'Assertion'.", + "timestamp": "2025-01-03T17:11:20.076184Z", + "message_id": "5bb81bd1-b35f-410c-8b09-cdbfb5b3d05b" + }, + "answer": { + "message": "The error message you're seeing:\n\n```\nProperty 'toBeVisible' does not exist on type 'Assertion'.\n```\n\nindicates that the `toBeVisible` matcher is not recognized by the types for the `Assertion` object. This typically happens when the matcher is not installed or when the type definitions for the testing library you are using are not properly configured.\n\n### **Understanding the Cause**\n\n1. **Missing `@testing-library/jest-dom` Package:**\n - **`toBeVisible`** is a custom matcher provided by the **`@testing-library/jest-dom`** package. If this package is not installed in your project, the TypeScript type definitions will not recognize `toBeVisible`, leading to the error.\n\n2. **Type Definitions Not Linked:**\n - Even if the package is installed, TypeScript might not be aware of the additional matchers provided by `@testing-library/jest-dom`. This can happen if the type definitions are not correctly linked in your project.\n\n### **How to Solve the Error**\n\nTo resolve this issue, you need to ensure that:\n\n1. **Install the `@testing-library/jest-dom` Package:**\n - This package contains the additional matchers like `toBeVisible`.\n\n2. **Configure TypeScript to Recognize the Additional Matchers:**\n - You need to extend the Jest types to include the `@testing-library/jest-dom` matchers.\n\nHere's a step-by-step guide to solving the error:\n\n---\n\n**Step 1: Install `@testing-library/jest-dom`**\n\nFirst, you need to install the `@testing-library/jest-dom` package if it's not already installed. You can do this using npm or yarn.\n\n**Using npm:**\n\n```bash\nnpm install --save-dev @testing-library/jest-dom\n```\n\n**Using yarn:**\n\n```bash\nyarn add --dev @testing-library/jest-dom\n```\n\n---\n\n**Step 2: Extend Jest Types**\n\nNext, you need to extend the Jest types to include the matchers from `@testing-library/jest-dom`. This is typically done by creating a custom Jest setup file and telling Jest to use it.\n\n1. **Create a Jest Setup File:**\n\n Create a new file, for example, `setupTests.ts` (or `setupTests.js` if you prefer not to use TypeScript), in the `src` directory or any other appropriate location.\n\n ```typescript\n // setupTests.ts\n import '@testing-library/jest-dom/extend-expect';\n ```\n\n This file imports the necessary matchers from `@testing-library/jest-dom` and extends Jest's `expect` object to include them.\n\n2. **Configure Jest to Use the Setup File:**\n\n In your Jest configuration file (e.g., `jest.config.js`), specify the setup file. If you don't have a Jest configuration file, you can create one.\n\n ```javascript\n // jest.config.js\n module.exports = {\n setupFilesAfterEnv: ['/src/setupTests.ts'],\n };\n ```\n\n Replace `` with the appropriate path to your `setupTests.ts` file if it's located differently.\n\n---\n\n**Step 3: Verify TypeScript Configuration**\n\nEnsure that your `tsconfig.json` is correctly set up to include the necessary type definitions. Specifically, make sure that `esModuleInterop` is set to `true` to handle the imports correctly.\n\n```json\n{\n \"compilerOptions\": {\n \"esModuleInterop\": true,\n // Other options...\n },\n // Other configurations...\n}\n```\n\n---\n\n**Step 4: Restart Your Development Environment**\n\nAfter making these changes, restart your development environment (e.g., your IDE or the command line) to ensure that all configurations are loaded correctly.\n\n---\n\n**Step 5: Verify the Solution**\n\nOnce you've completed the above steps, your TypeScript setup should recognize the `toBeVisible` matcher, and the error should be resolved.\n\n**Your Updated Test Code:**\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom/extend-expect'; // Ensure this is imported if not using the setup file\nimport PromptList from './PromptList';\n\ntest('renders \"server.py\" link and checks for visibility', () => {\n render();\n \n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n});\n```\n\n**Note:**\n\n- If you used a Jest setup file as described above (`setupTests.ts`), ensure that it is correctly referenced in your Jest configuration.\n- If you prefer not to use a setup file, you can directly import `@testing-library/jest-dom/extend-expect` in your test file. However, using a setup file is generally recommended for cleaner and reusable configurations.\n\n---\n\n**Additional Tips:**\n\n- **Ensure Proper Import Paths:** Double-check that your import paths are correct. If you're using TypeScript, make sure that the import paths in your setup file match the actual file locations.\n- **Check for Typos:** Ensure there are no typos in your import statements or matcher names.\n- **Update Dependencies:** If you recently updated `@testing-library/react` or `@testing-library/jest-dom`, ensure that all related dependencies are also updated to compatible versions.\n\nBy following these steps, you should be able to resolve the error and successfully use the `toBeVisible` matcher in your tests.", + "timestamp": "2025-01-03T17:11:20.844684Z", + "message_id": "6089cb6a-8768-4336-ab4a-457770f9c0e2" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d5ae6161eab44ad964435efcf3d83b4", + "conversation_timestamp": "2025-01-03T17:11:20.076184Z" + }, + "alert_id": "5bb81bd1-b35f-410c-8b09-cdbfb5b3d05b", + "code_snippet": null, + "trigger_string": "GitHub - Access Token:\n ```tsx\n // @ts-ignore\n const test = \"ghp_token\";\n const breadcrumb = useBreadcrumb();\n ```\n", + "trigger_type": "codegate-secrets", + "trigger_category": "critical", + "timestamp": "2025-01-03T17:11:20.076184Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/components/__tests__/PromptList.test.tsx (16-22)\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n });\n});\n\n```\nPlease explain the cause of this error and how to solve it: Property 'toBeVisible' does not exist on type 'Assertion'.", + "timestamp": "2025-01-03T17:11:20.067335Z", + "message_id": "57dd0881-c433-46fc-8d6b-52a91ed3ece5" + }, + "answer": { + "message": "The error message you're seeing:\n\n```\nProperty 'toBeVisible' does not exist on type 'Assertion'.\n```\n\nindicates that the `toBeVisible` matcher is not recognized by the types for the `Assertion` object. This typically happens when the matcher is not installed or when the type definitions for the testing library you are using are not properly configured.\n\n### **Understanding the Cause**\n\n1. **Missing `@testing-library/jest-dom` Package:**\n - **`toBeVisible`** is a custom matcher provided by the **`@testing-library/jest-dom`** package. If this package is not installed in your project, the TypeScript type definitions will not recognize `toBeVisible`, leading to the error.\n\n2. **Type Definitions Not Linked:**\n - Even if the package is installed, TypeScript might not be aware of the additional matchers provided by `@testing-library/jest-dom`. This can happen if the type definitions are not correctly linked in your project.\n\n### **How to Solve the Error**\n\nTo resolve this issue, you need to ensure that:\n\n1. **Install the `@testing-library/jest-dom` Package:**\n - This package contains the additional matchers like `toBeVisible`.\n\n2. **Configure TypeScript to Recognize the Additional Matchers:**\n - You need to extend the Jest types to include the `@testing-library/jest-dom` matchers.\n\nHere's a step-by-step guide to solving the error:\n\n---\n\n**Step 1: Install `@testing-library/jest-dom`**\n\nFirst, you need to install the `@testing-library/jest-dom` package if it's not already installed. You can do this using npm or yarn.\n\n**Using npm:**\n\n```bash\nnpm install --save-dev @testing-library/jest-dom\n```\n\n**Using yarn:**\n\n```bash\nyarn add --dev @testing-library/jest-dom\n```\n\n---\n\n**Step 2: Extend Jest Types**\n\nNext, you need to extend the Jest types to include the matchers from `@testing-library/jest-dom`. This is typically done by creating a custom Jest setup file and telling Jest to use it.\n\n1. **Create a Jest Setup File:**\n\n Create a new file, for example, `setupTests.ts` (or `setupTests.js` if you prefer not to use TypeScript), in the `src` directory or any other appropriate location.\n\n ```typescript\n // setupTests.ts\n import '@testing-library/jest-dom/extend-expect';\n ```\n\n This file imports the necessary matchers from `@testing-library/jest-dom` and extends Jest's `expect` object to include them.\n\n2. **Configure Jest to Use the Setup File:**\n\n In your Jest configuration file (e.g., `jest.config.js`), specify the setup file. If you don't have a Jest configuration file, you can create one.\n\n ```javascript\n // jest.config.js\n module.exports = {\n setupFilesAfterEnv: ['/src/setupTests.ts'],\n };\n ```\n\n Replace `` with the appropriate path to your `setupTests.ts` file if it's located differently.\n\n---\n\n**Step 3: Verify TypeScript Configuration**\n\nEnsure that your `tsconfig.json` is correctly set up to include the necessary type definitions. Specifically, make sure that `esModuleInterop` is set to `true` to handle the imports correctly.\n\n```json\n{\n \"compilerOptions\": {\n \"esModuleInterop\": true,\n // Other options...\n },\n // Other configurations...\n}\n```\n\n---\n\n**Step 4: Restart Your Development Environment**\n\nAfter making these changes, restart your development environment (e.g., your IDE or the command line) to ensure that all configurations are loaded correctly.\n\n---\n\n**Step 5: Verify the Solution**\n\nOnce you've completed the above steps, your TypeScript setup should recognize the `toBeVisible` matcher, and the error should be resolved.\n\n**Your Updated Test Code:**\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom/extend-expect'; // Ensure this is imported if not using the setup file\nimport PromptList from './PromptList';\n\ntest('renders \"server.py\" link and checks for visibility', () => {\n render();\n \n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n});\n```\n\n**Note:**\n\n- If you used a Jest setup file as described above (`setupTests.ts`), ensure that it is correctly referenced in your Jest configuration.\n- If you prefer not to use a setup file, you can directly import `@testing-library/jest-dom/extend-expect` in your test file. However, using a setup file is generally recommended for cleaner and reusable configurations.\n\n---\n\n**Additional Tips:**\n\n- **Ensure Proper Import Paths:** Double-check that your import paths are correct. If you're using TypeScript, make sure that the import paths in your setup file match the actual file locations.\n- **Check for Typos:** Ensure there are no typos in your import statements or matcher names.\n- **Update Dependencies:** If you recently updated `@testing-library/react` or `@testing-library/jest-dom`, ensure that all related dependencies are also updated to compatible versions.\n\nBy following these steps, you should be able to resolve the error and successfully use the `toBeVisible` matcher in your tests.", + "timestamp": "2025-01-03T17:11:20.844684Z", + "message_id": "6089cb6a-8768-4336-ab4a-457770f9c0e2" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d5ae6161eab44ad964435efcf3d83b4", + "conversation_timestamp": "2025-01-03T17:11:20.067335Z" + }, + "alert_id": "57dd0881-c433-46fc-8d6b-52a91ed3ece5", + "code_snippet": null, + "trigger_string": "GitHub - Access Token:\n useSse();\n\n const test = \"ghp_token\";\n const breadcrumb = useBreadcrumb();\n\n", + "trigger_type": "codegate-secrets", + "trigger_category": "critical", + "timestamp": "2025-01-03T17:11:20.067335Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/components/__tests__/PromptList.test.tsx (16-22)\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n });\n});\n\n```\nPlease explain the cause of this error and how to solve it: Property 'toBeVisible' does not exist on type 'Assertion'.", + "timestamp": "2025-01-03T17:11:20.048195Z", + "message_id": "b17b2477-b6ce-467f-b97c-05c544028309" + }, + "answer": { + "message": "The error message you're seeing:\n\n```\nProperty 'toBeVisible' does not exist on type 'Assertion'.\n```\n\nindicates that the `toBeVisible` matcher is not recognized by the types for the `Assertion` object. This typically happens when the matcher is not installed or when the type definitions for the testing library you are using are not properly configured.\n\n### **Understanding the Cause**\n\n1. **Missing `@testing-library/jest-dom` Package:**\n - **`toBeVisible`** is a custom matcher provided by the **`@testing-library/jest-dom`** package. If this package is not installed in your project, the TypeScript type definitions will not recognize `toBeVisible`, leading to the error.\n\n2. **Type Definitions Not Linked:**\n - Even if the package is installed, TypeScript might not be aware of the additional matchers provided by `@testing-library/jest-dom`. This can happen if the type definitions are not correctly linked in your project.\n\n### **How to Solve the Error**\n\nTo resolve this issue, you need to ensure that:\n\n1. **Install the `@testing-library/jest-dom` Package:**\n - This package contains the additional matchers like `toBeVisible`.\n\n2. **Configure TypeScript to Recognize the Additional Matchers:**\n - You need to extend the Jest types to include the `@testing-library/jest-dom` matchers.\n\nHere's a step-by-step guide to solving the error:\n\n---\n\n**Step 1: Install `@testing-library/jest-dom`**\n\nFirst, you need to install the `@testing-library/jest-dom` package if it's not already installed. You can do this using npm or yarn.\n\n**Using npm:**\n\n```bash\nnpm install --save-dev @testing-library/jest-dom\n```\n\n**Using yarn:**\n\n```bash\nyarn add --dev @testing-library/jest-dom\n```\n\n---\n\n**Step 2: Extend Jest Types**\n\nNext, you need to extend the Jest types to include the matchers from `@testing-library/jest-dom`. This is typically done by creating a custom Jest setup file and telling Jest to use it.\n\n1. **Create a Jest Setup File:**\n\n Create a new file, for example, `setupTests.ts` (or `setupTests.js` if you prefer not to use TypeScript), in the `src` directory or any other appropriate location.\n\n ```typescript\n // setupTests.ts\n import '@testing-library/jest-dom/extend-expect';\n ```\n\n This file imports the necessary matchers from `@testing-library/jest-dom` and extends Jest's `expect` object to include them.\n\n2. **Configure Jest to Use the Setup File:**\n\n In your Jest configuration file (e.g., `jest.config.js`), specify the setup file. If you don't have a Jest configuration file, you can create one.\n\n ```javascript\n // jest.config.js\n module.exports = {\n setupFilesAfterEnv: ['/src/setupTests.ts'],\n };\n ```\n\n Replace `` with the appropriate path to your `setupTests.ts` file if it's located differently.\n\n---\n\n**Step 3: Verify TypeScript Configuration**\n\nEnsure that your `tsconfig.json` is correctly set up to include the necessary type definitions. Specifically, make sure that `esModuleInterop` is set to `true` to handle the imports correctly.\n\n```json\n{\n \"compilerOptions\": {\n \"esModuleInterop\": true,\n // Other options...\n },\n // Other configurations...\n}\n```\n\n---\n\n**Step 4: Restart Your Development Environment**\n\nAfter making these changes, restart your development environment (e.g., your IDE or the command line) to ensure that all configurations are loaded correctly.\n\n---\n\n**Step 5: Verify the Solution**\n\nOnce you've completed the above steps, your TypeScript setup should recognize the `toBeVisible` matcher, and the error should be resolved.\n\n**Your Updated Test Code:**\n\n```typescript\nimport { render, screen } from '@testing-library/react';\nimport '@testing-library/jest-dom/extend-expect'; // Ensure this is imported if not using the setup file\nimport PromptList from './PromptList';\n\ntest('renders \"server.py\" link and checks for visibility', () => {\n render();\n \n expect(\n screen.getByRole(\"link\", {\n name: /server\\.py do you see any security issue\\?/i,\n })\n ).toBeVisible();\n});\n```\n\n**Note:**\n\n- If you used a Jest setup file as described above (`setupTests.ts`), ensure that it is correctly referenced in your Jest configuration.\n- If you prefer not to use a setup file, you can directly import `@testing-library/jest-dom/extend-expect` in your test file. However, using a setup file is generally recommended for cleaner and reusable configurations.\n\n---\n\n**Additional Tips:**\n\n- **Ensure Proper Import Paths:** Double-check that your import paths are correct. If you're using TypeScript, make sure that the import paths in your setup file match the actual file locations.\n- **Check for Typos:** Ensure there are no typos in your import statements or matcher names.\n- **Update Dependencies:** If you recently updated `@testing-library/react` or `@testing-library/jest-dom`, ensure that all related dependencies are also updated to compatible versions.\n\nBy following these steps, you should be able to resolve the error and successfully use the `toBeVisible` matcher in your tests.", + "timestamp": "2025-01-03T17:11:20.844684Z", + "message_id": "6089cb6a-8768-4336-ab4a-457770f9c0e2" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d5ae6161eab44ad964435efcf3d83b4", + "conversation_timestamp": "2025-01-03T17:11:20.048195Z" + }, + "alert_id": "b17b2477-b6ce-467f-b97c-05c544028309", + "code_snippet": null, + "trigger_string": "GitHub - Access Token:\n useSse();\n\n const test = \"ghp_token\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {", + "trigger_type": "codegate-secrets", + "trigger_category": "critical", + "timestamp": "2025-01-03T17:11:20.048195Z" + }, { "conversation": { "question_answers": [ @@ -9,22 +1745,725 @@ "message_id": "0445530c-9288-4591-b48a-4fdc2f0aec6c" }, "answer": { - "message": "Yes, there are several security issues in the provided `server.py` code. Here are the main ones:\n\n1. **CORS Configuration**:\n ```python\n app.add_middleware(\n CORSMiddleware,\n allow_origins=[\"*\"],\n allow_credentials=True,\n allow_methods=[\"*\"],\n allow_headers=[\"*\"],\n )\n ```\n - Allowing all origins (`allow_origins=[\"*\"]`) and methods (`allow_methods=[\"*\"]`) can expose your server to Cross-Site Request Forgery (CSRF) attacks and other security vulnerabilities. It's recommended to restrict these settings to only the origins and methods that your application needs to support.\n\n2. **Error Handling Middleware**:\n ```python\n async def custom_error_handler(request, exc: Exception):\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\n # Capture the stack trace\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\n logger.error(traceback.print_list(extracted_traceback[-3:]))\n return JSONResponse({\"error\": str(exc)}, status_code=500)\n ```\n - Exposing detailed error messages in the response can be dangerous, as it can provide attackers with information that can be used to exploit vulnerabilities. It's better to log the error details and return a generic error message to the client.\n\n3. **Handling Exceptions**:\n - The `custom_error_handler` function logs the traceback and returns the exception message directly to the client. This can expose sensitive information about the server's internal state. It's better to log the error and return a generic message.\n\n4. **Provider Configuration**:\n - The providers are configured with the same pipeline processors. This might not be a security issue in itself, but it's important to ensure that the pipeline processors are secure and correctly configured.\n\n5. **Logging**:\n - The `logger.error` function is used to log the error traceback. Ensure that the logging configuration is set up correctly to prevent logging sensitive information to insecure destinations.\n\nHere is a revised version of the code with some of these issues addressed:\n\n```python\nimport traceback\n\nimport structlog\nfrom fastapi import APIRouter, FastAPI\nfrom fastapi.middleware.cors import CORSMiddleware\nfrom fastapi.responses import JSONResponse\nfrom starlette.middleware.errors import ServerErrorMiddleware\n\nfrom codegate import __description__, __version__\nfrom codegate.dashboard.dashboard import dashboard_router\nfrom codegate.pipeline.factory import PipelineFactory\nfrom codegate.providers.anthropic.provider import AnthropicProvider\nfrom codegate.providers.llamacpp.provider import LlamaCppProvider\nfrom codegate.providers.ollama.provider import OllamaProvider\nfrom codegate.providers.openai.provider import OpenAIProvider\nfrom codegate.providers.registry import ProviderRegistry\nfrom codegate.providers.vllm.provider import VLLMProvider\n\nlogger = structlog.get_logger(\"codegate\")\n\n\nasync def custom_error_handler(request, exc: Exception):\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\n # Capture the stack trace\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\n logger.error(traceback.print_list(extracted_traceback[-3:]))\n return JSONResponse({\"error\": \"An internal server error occurred\"}, status_code=500)\n\n\ndef init_app(pipeline_factory: PipelineFactory) -> FastAPI:\n \"\"\"Create the FastAPI application.\"\"\"\n app = FastAPI(\n title=\"CodeGate\",\n description=__description__,\n version=__version__,\n )\n app.add_middleware(\n CORSMiddleware,\n allow_origins=[\"https://example.com\"], # Restrict to specific origins\n allow_credentials=True,\n allow_methods=[\"GET\", \"POST\"], # Restrict to specific methods\n allow_headers=[\"*\"],\n )\n # Apply error handling middleware\n app.add_middleware(ServerErrorMiddleware, handler=custom_error_handler)\n\n # Create provider registry\n registry = ProviderRegistry(app)\n\n # Register all known providers\n registry.add_provider(\n \"openai\",\n OpenAIProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"anthropic\",\n AnthropicProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"llamacpp\",\n LlamaCppProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"vllm\",\n VLLMProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"ollama\",\n OllamaProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n\n # Create and add system routes\n system_router = APIRouter(tags=[\"System\"])\n\n @system_router.get(\"/health\")\n async def health_check():\n return {\"status\": \"healthy\"}\n\n app.include_router(system_router)\n app.include_router(dashboard_router)\n\n return app\n```\n\nIn this revised version, the CORS middleware is restricted to specific origins and methods, and the error handler returns a generic error message to the client.", - "timestamp": "2025-01-03T09:09:34.359269Z", - "message_id": "68e7c9bc-9afa-4240-8eba-621eaae4a2a0" + "message": "Yes, there are several security issues in the provided `server.py` code. Here are the main ones:\n\n1. **CORS Configuration**:\n ```python\n app.add_middleware(\n CORSMiddleware,\n allow_origins=[\"*\"],\n allow_credentials=True,\n allow_methods=[\"*\"],\n allow_headers=[\"*\"],\n )\n ```\n - Allowing all origins (`allow_origins=[\"*\"]`) and methods (`allow_methods=[\"*\"]`) can expose your server to Cross-Site Request Forgery (CSRF) attacks and other security vulnerabilities. It's recommended to restrict these settings to only the origins and methods that your application needs to support.\n\n2. **Error Handling Middleware**:\n ```python\n async def custom_error_handler(request, exc: Exception):\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\n # Capture the stack trace\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\n logger.error(traceback.print_list(extracted_traceback[-3:]))\n return JSONResponse({\"error\": str(exc)}, status_code=500)\n ```\n - Exposing detailed error messages in the response can be dangerous, as it can provide attackers with information that can be used to exploit vulnerabilities. It's better to log the error details and return a generic error message to the client.\n\n3. **Handling Exceptions**:\n - The `custom_error_handler` function logs the traceback and returns the exception message directly to the client. This can expose sensitive information about the server's internal state. It's better to log the error and return a generic message.\n\n4. **Provider Configuration**:\n - The providers are configured with the same pipeline processors. This might not be a security issue in itself, but it's important to ensure that the pipeline processors are secure and correctly configured.\n\n5. **Logging**:\n - The `logger.error` function is used to log the error traceback. Ensure that the logging configuration is set up correctly to prevent logging sensitive information to insecure destinations.\n\nHere is a revised version of the code with some of these issues addressed:\n\n```python\nimport traceback\n\nimport structlog\nfrom fastapi import APIRouter, FastAPI\nfrom fastapi.middleware.cors import CORSMiddleware\nfrom fastapi.responses import JSONResponse\nfrom starlette.middleware.errors import ServerErrorMiddleware\n\nfrom codegate import __description__, __version__\nfrom codegate.dashboard.dashboard import dashboard_router\nfrom codegate.pipeline.factory import PipelineFactory\nfrom codegate.providers.anthropic.provider import AnthropicProvider\nfrom codegate.providers.llamacpp.provider import LlamaCppProvider\nfrom codegate.providers.ollama.provider import OllamaProvider\nfrom codegate.providers.openai.provider import OpenAIProvider\nfrom codegate.providers.registry import ProviderRegistry\nfrom codegate.providers.vllm.provider import VLLMProvider\n\nlogger = structlog.get_logger(\"codegate\")\n\n\nasync def custom_error_handler(request, exc: Exception):\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\n # Capture the stack trace\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\n logger.error(traceback.print_list(extracted_traceback[-3:]))\n return JSONResponse({\"error\": \"An internal server error occurred\"}, status_code=500)\n\n\ndef init_app(pipeline_factory: PipelineFactory) -> FastAPI:\n \"\"\"Create the FastAPI application.\"\"\"\n app = FastAPI(\n title=\"CodeGate\",\n description=__description__,\n version=__version__,\n )\n app.add_middleware(\n CORSMiddleware,\n allow_origins=[\"https://example.com\"], # Restrict to specific origins\n allow_credentials=True,\n allow_methods=[\"GET\", \"POST\"], # Restrict to specific methods\n allow_headers=[\"*\"],\n )\n # Apply error handling middleware\n app.add_middleware(ServerErrorMiddleware, handler=custom_error_handler)\n\n # Create provider registry\n registry = ProviderRegistry(app)\n\n # Register all known providers\n registry.add_provider(\n \"openai\",\n OpenAIProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"anthropic\",\n AnthropicProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"llamacpp\",\n LlamaCppProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"vllm\",\n VLLMProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"ollama\",\n OllamaProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n\n # Create and add system routes\n system_router = APIRouter(tags=[\"System\"])\n\n @system_router.get(\"/health\")\n async def health_check():\n return {\"status\": \"healthy\"}\n\n app.include_router(system_router)\n app.include_router(dashboard_router)\n\n return app\n```\n\nIn this revised version, the CORS middleware is restricted to specific origins and methods, and the error handler returns a generic error message to the client.", + "timestamp": "2025-01-03T09:09:34.359269Z", + "message_id": "68e7c9bc-9afa-4240-8eba-621eaae4a2a0" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-eebad2bd68434c7c947d10754a204ea4", + "conversation_timestamp": "2025-01-03T09:10:00.689177Z" + }, + "alert_id": "0445530c-9288-4591-b48a-4fdc2f0aec6c", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-03T09:10:00.689177Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "```/Users/giuseppe/workspace/codegate/src/codegate/server.py\nimport traceback\n\nimport structlog\nfrom fastapi import APIRouter, FastAPI\nfrom fastapi.middleware.cors import CORSMiddleware\nfrom fastapi.responses import JSONResponse\nfrom starlette.middleware.errors import ServerErrorMiddleware\n\nfrom codegate import __description__, __version__\nfrom codegate.dashboard.dashboard import dashboard_router\nfrom codegate.pipeline.factory import PipelineFactory\nfrom codegate.providers.anthropic.provider import AnthropicProvider\nfrom codegate.providers.llamacpp.provider import LlamaCppProvider\nfrom codegate.providers.ollama.provider import OllamaProvider\nfrom codegate.providers.openai.provider import OpenAIProvider\nfrom codegate.providers.registry import ProviderRegistry\nfrom codegate.providers.vllm.provider import VLLMProvider\n\nlogger = structlog.get_logger(\"codegate\")\n\n\nasync def custom_error_handler(request, exc: Exception):\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\n # Capture the stack trace\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\n logger.error(traceback.print_list(extracted_traceback[-3:]))\n return JSONResponse({\"error\": str(exc)}, status_code=500)\n\n\ndef init_app(pipeline_factory: PipelineFactory) -> FastAPI:\n \"\"\"Create the FastAPI application.\"\"\"\n app = FastAPI(\n title=\"CodeGate\",\n description=__description__,\n version=__version__,\n )\n app.add_middleware(\n CORSMiddleware,\n allow_origins=[\"*\"],\n allow_credentials=True,\n allow_methods=[\"*\"],\n allow_headers=[\"*\"],\n )\n # Apply error handling middleware\n app.add_middleware(ServerErrorMiddleware, handler=custom_error_handler)\n\n # Create provider registry\n registry = ProviderRegistry(app)\n\n # Register all known providers\n registry.add_provider(\n \"openai\",\n OpenAIProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"anthropic\",\n AnthropicProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"llamacpp\",\n LlamaCppProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"vllm\",\n VLLMProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"ollama\",\n OllamaProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n\n # Create and add system routes\n system_router = APIRouter(tags=[\"System\"])\n\n @system_router.get(\"/health\")\n async def health_check():\n return {\"status\": \"healthy\"}\n\n app.include_router(system_router)\n app.include_router(dashboard_router)\n\n return app\n\n```\n\nserver.py do you see any security issue?", + "timestamp": "2025-01-03T09:09:39.547739Z", + "message_id": "9f84af4b-a9dd-41dc-b852-1d9da2ec5d52" + }, + "answer": { + "message": "Yes, there are several security issues in the provided `server.py` code. Here are the main ones:\n\n1. **CORS Configuration**:\n ```python\n app.add_middleware(\n CORSMiddleware,\n allow_origins=[\"*\"],\n allow_credentials=True,\n allow_methods=[\"*\"],\n allow_headers=[\"*\"],\n )\n ```\n - Allowing all origins (`allow_origins=[\"*\"]`) and methods (`allow_methods=[\"*\"]`) can expose your server to Cross-Site Request Forgery (CSRF) attacks and other security vulnerabilities. It's recommended to restrict these settings to only the origins and methods that your application needs to support.\n\n2. **Error Handling Middleware**:\n ```python\n async def custom_error_handler(request, exc: Exception):\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\n # Capture the stack trace\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\n logger.error(traceback.print_list(extracted_traceback[-3:]))\n return JSONResponse({\"error\": str(exc)}, status_code=500)\n ```\n - Exposing detailed error messages in the response can be dangerous, as it can provide attackers with information that can be used to exploit vulnerabilities. It's better to log the error details and return a generic error message to the client.\n\n3. **Handling Exceptions**:\n - The `custom_error_handler` function logs the traceback and returns the exception message directly to the client. This can expose sensitive information about the server's internal state. It's better to log the error and return a generic message.\n\n4. **Provider Configuration**:\n - The providers are configured with the same pipeline processors. This might not be a security issue in itself, but it's important to ensure that the pipeline processors are secure and correctly configured.\n\n5. **Logging**:\n - The `logger.error` function is used to log the error traceback. Ensure that the logging configuration is set up correctly to prevent logging sensitive information to insecure destinations.\n\nHere is a revised version of the code with some of these issues addressed:\n\n```python\nimport traceback\n\nimport structlog\nfrom fastapi import APIRouter, FastAPI\nfrom fastapi.middleware.cors import CORSMiddleware\nfrom fastapi.responses import JSONResponse\nfrom starlette.middleware.errors import ServerErrorMiddleware\n\nfrom codegate import __description__, __version__\nfrom codegate.dashboard.dashboard import dashboard_router\nfrom codegate.pipeline.factory import PipelineFactory\nfrom codegate.providers.anthropic.provider import AnthropicProvider\nfrom codegate.providers.llamacpp.provider import LlamaCppProvider\nfrom codegate.providers.ollama.provider import OllamaProvider\nfrom codegate.providers.openai.provider import OpenAIProvider\nfrom codegate.providers.registry import ProviderRegistry\nfrom codegate.providers.vllm.provider import VLLMProvider\n\nlogger = structlog.get_logger(\"codegate\")\n\n\nasync def custom_error_handler(request, exc: Exception):\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\n # Capture the stack trace\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\n logger.error(traceback.print_list(extracted_traceback[-3:]))\n return JSONResponse({\"error\": \"An internal server error occurred\"}, status_code=500)\n\n\ndef init_app(pipeline_factory: PipelineFactory) -> FastAPI:\n \"\"\"Create the FastAPI application.\"\"\"\n app = FastAPI(\n title=\"CodeGate\",\n description=__description__,\n version=__version__,\n )\n app.add_middleware(\n CORSMiddleware,\n allow_origins=[\"https://example.com\"], # Restrict to specific origins\n allow_credentials=True,\n allow_methods=[\"GET\", \"POST\"], # Restrict to specific methods\n allow_headers=[\"*\"],\n )\n # Apply error handling middleware\n app.add_middleware(ServerErrorMiddleware, handler=custom_error_handler)\n\n # Create provider registry\n registry = ProviderRegistry(app)\n\n # Register all known providers\n registry.add_provider(\n \"openai\",\n OpenAIProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"anthropic\",\n AnthropicProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"llamacpp\",\n LlamaCppProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"vllm\",\n VLLMProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"ollama\",\n OllamaProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n\n # Create and add system routes\n system_router = APIRouter(tags=[\"System\"])\n\n @system_router.get(\"/health\")\n async def health_check():\n return {\"status\": \"healthy\"}\n\n app.include_router(system_router)\n app.include_router(dashboard_router)\n\n return app\n```\n\nIn this revised version, the CORS middleware is restricted to specific origins and methods, and the error handler returns a generic error message to the client.", + "timestamp": "2025-01-03T09:09:34.359269Z", + "message_id": "68e7c9bc-9afa-4240-8eba-621eaae4a2a0" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-eebad2bd68434c7c947d10754a204ea4", + "conversation_timestamp": "2025-01-03T09:09:39.547739Z" + }, + "alert_id": "9f84af4b-a9dd-41dc-b852-1d9da2ec5d52", + "code_snippet": null, + "trigger_string": " ```", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-03T09:09:39.547739Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "```/Users/giuseppe/workspace/codegate/src/codegate/server.py\nimport traceback\n\nimport structlog\nfrom fastapi import APIRouter, FastAPI\nfrom fastapi.middleware.cors import CORSMiddleware\nfrom fastapi.responses import JSONResponse\nfrom starlette.middleware.errors import ServerErrorMiddleware\n\nfrom codegate import __description__, __version__\nfrom codegate.dashboard.dashboard import dashboard_router\nfrom codegate.pipeline.factory import PipelineFactory\nfrom codegate.providers.anthropic.provider import AnthropicProvider\nfrom codegate.providers.llamacpp.provider import LlamaCppProvider\nfrom codegate.providers.ollama.provider import OllamaProvider\nfrom codegate.providers.openai.provider import OpenAIProvider\nfrom codegate.providers.registry import ProviderRegistry\nfrom codegate.providers.vllm.provider import VLLMProvider\n\nlogger = structlog.get_logger(\"codegate\")\n\n\nasync def custom_error_handler(request, exc: Exception):\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\n # Capture the stack trace\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\n logger.error(traceback.print_list(extracted_traceback[-3:]))\n return JSONResponse({\"error\": str(exc)}, status_code=500)\n\n\ndef init_app(pipeline_factory: PipelineFactory) -> FastAPI:\n \"\"\"Create the FastAPI application.\"\"\"\n app = FastAPI(\n title=\"CodeGate\",\n description=__description__,\n version=__version__,\n )\n app.add_middleware(\n CORSMiddleware,\n allow_origins=[\"*\"],\n allow_credentials=True,\n allow_methods=[\"*\"],\n allow_headers=[\"*\"],\n )\n # Apply error handling middleware\n app.add_middleware(ServerErrorMiddleware, handler=custom_error_handler)\n\n # Create provider registry\n registry = ProviderRegistry(app)\n\n # Register all known providers\n registry.add_provider(\n \"openai\",\n OpenAIProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"anthropic\",\n AnthropicProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"llamacpp\",\n LlamaCppProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"vllm\",\n VLLMProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"ollama\",\n OllamaProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n\n # Create and add system routes\n system_router = APIRouter(tags=[\"System\"])\n\n @system_router.get(\"/health\")\n async def health_check():\n return {\"status\": \"healthy\"}\n\n app.include_router(system_router)\n app.include_router(dashboard_router)\n\n return app\n\n```\n\nserver.py do you see any security issue?", + "timestamp": "2025-01-03T09:09:35.865325Z", + "message_id": "c9b8cf1b-cb2e-4219-ab4d-11c90fd88adb" + }, + "answer": { + "message": "Yes, there are several security issues in the provided `server.py` code. Here are the main ones:\n\n1. **CORS Configuration**:\n ```python\n app.add_middleware(\n CORSMiddleware,\n allow_origins=[\"*\"],\n allow_credentials=True,\n allow_methods=[\"*\"],\n allow_headers=[\"*\"],\n )\n ```\n - Allowing all origins (`allow_origins=[\"*\"]`) and methods (`allow_methods=[\"*\"]`) can expose your server to Cross-Site Request Forgery (CSRF) attacks and other security vulnerabilities. It's recommended to restrict these settings to only the origins and methods that your application needs to support.\n\n2. **Error Handling Middleware**:\n ```python\n async def custom_error_handler(request, exc: Exception):\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\n # Capture the stack trace\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\n logger.error(traceback.print_list(extracted_traceback[-3:]))\n return JSONResponse({\"error\": str(exc)}, status_code=500)\n ```\n - Exposing detailed error messages in the response can be dangerous, as it can provide attackers with information that can be used to exploit vulnerabilities. It's better to log the error details and return a generic error message to the client.\n\n3. **Handling Exceptions**:\n - The `custom_error_handler` function logs the traceback and returns the exception message directly to the client. This can expose sensitive information about the server's internal state. It's better to log the error and return a generic message.\n\n4. **Provider Configuration**:\n - The providers are configured with the same pipeline processors. This might not be a security issue in itself, but it's important to ensure that the pipeline processors are secure and correctly configured.\n\n5. **Logging**:\n - The `logger.error` function is used to log the error traceback. Ensure that the logging configuration is set up correctly to prevent logging sensitive information to insecure destinations.\n\nHere is a revised version of the code with some of these issues addressed:\n\n```python\nimport traceback\n\nimport structlog\nfrom fastapi import APIRouter, FastAPI\nfrom fastapi.middleware.cors import CORSMiddleware\nfrom fastapi.responses import JSONResponse\nfrom starlette.middleware.errors import ServerErrorMiddleware\n\nfrom codegate import __description__, __version__\nfrom codegate.dashboard.dashboard import dashboard_router\nfrom codegate.pipeline.factory import PipelineFactory\nfrom codegate.providers.anthropic.provider import AnthropicProvider\nfrom codegate.providers.llamacpp.provider import LlamaCppProvider\nfrom codegate.providers.ollama.provider import OllamaProvider\nfrom codegate.providers.openai.provider import OpenAIProvider\nfrom codegate.providers.registry import ProviderRegistry\nfrom codegate.providers.vllm.provider import VLLMProvider\n\nlogger = structlog.get_logger(\"codegate\")\n\n\nasync def custom_error_handler(request, exc: Exception):\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\n # Capture the stack trace\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\n logger.error(traceback.print_list(extracted_traceback[-3:]))\n return JSONResponse({\"error\": \"An internal server error occurred\"}, status_code=500)\n\n\ndef init_app(pipeline_factory: PipelineFactory) -> FastAPI:\n \"\"\"Create the FastAPI application.\"\"\"\n app = FastAPI(\n title=\"CodeGate\",\n description=__description__,\n version=__version__,\n )\n app.add_middleware(\n CORSMiddleware,\n allow_origins=[\"https://example.com\"], # Restrict to specific origins\n allow_credentials=True,\n allow_methods=[\"GET\", \"POST\"], # Restrict to specific methods\n allow_headers=[\"*\"],\n )\n # Apply error handling middleware\n app.add_middleware(ServerErrorMiddleware, handler=custom_error_handler)\n\n # Create provider registry\n registry = ProviderRegistry(app)\n\n # Register all known providers\n registry.add_provider(\n \"openai\",\n OpenAIProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"anthropic\",\n AnthropicProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"llamacpp\",\n LlamaCppProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"vllm\",\n VLLMProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"ollama\",\n OllamaProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n\n # Create and add system routes\n system_router = APIRouter(tags=[\"System\"])\n\n @system_router.get(\"/health\")\n async def health_check():\n return {\"status\": \"healthy\"}\n\n app.include_router(system_router)\n app.include_router(dashboard_router)\n\n return app\n```\n\nIn this revised version, the CORS middleware is restricted to specific origins and methods, and the error handler returns a generic error message to the client.", + "timestamp": "2025-01-03T09:09:34.359269Z", + "message_id": "68e7c9bc-9afa-4240-8eba-621eaae4a2a0" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-eebad2bd68434c7c947d10754a204ea4", + "conversation_timestamp": "2025-01-03T09:09:35.865325Z" + }, + "alert_id": "c9b8cf1b-cb2e-4219-ab4d-11c90fd88adb", + "code_snippet": null, + "trigger_string": " ```", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-03T09:09:35.865325Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "```/Users/giuseppe/workspace/codegate/src/codegate/server.py\nimport traceback\n\nimport structlog\nfrom fastapi import APIRouter, FastAPI\nfrom fastapi.middleware.cors import CORSMiddleware\nfrom fastapi.responses import JSONResponse\nfrom starlette.middleware.errors import ServerErrorMiddleware\n\nfrom codegate import __description__, __version__\nfrom codegate.dashboard.dashboard import dashboard_router\nfrom codegate.pipeline.factory import PipelineFactory\nfrom codegate.providers.anthropic.provider import AnthropicProvider\nfrom codegate.providers.llamacpp.provider import LlamaCppProvider\nfrom codegate.providers.ollama.provider import OllamaProvider\nfrom codegate.providers.openai.provider import OpenAIProvider\nfrom codegate.providers.registry import ProviderRegistry\nfrom codegate.providers.vllm.provider import VLLMProvider\n\nlogger = structlog.get_logger(\"codegate\")\n\n\nasync def custom_error_handler(request, exc: Exception):\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\n # Capture the stack trace\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\n logger.error(traceback.print_list(extracted_traceback[-3:]))\n return JSONResponse({\"error\": str(exc)}, status_code=500)\n\n\ndef init_app(pipeline_factory: PipelineFactory) -> FastAPI:\n \"\"\"Create the FastAPI application.\"\"\"\n app = FastAPI(\n title=\"CodeGate\",\n description=__description__,\n version=__version__,\n )\n app.add_middleware(\n CORSMiddleware,\n allow_origins=[\"*\"],\n allow_credentials=True,\n allow_methods=[\"*\"],\n allow_headers=[\"*\"],\n )\n # Apply error handling middleware\n app.add_middleware(ServerErrorMiddleware, handler=custom_error_handler)\n\n # Create provider registry\n registry = ProviderRegistry(app)\n\n # Register all known providers\n registry.add_provider(\n \"openai\",\n OpenAIProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"anthropic\",\n AnthropicProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"llamacpp\",\n LlamaCppProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"vllm\",\n VLLMProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"ollama\",\n OllamaProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n\n # Create and add system routes\n system_router = APIRouter(tags=[\"System\"])\n\n @system_router.get(\"/health\")\n async def health_check():\n return {\"status\": \"healthy\"}\n\n app.include_router(system_router)\n app.include_router(dashboard_router)\n\n return app\n\n```\n\nserver.py do you see any security issue?", + "timestamp": "2025-01-03T09:09:33.674994Z", + "message_id": "3b752749-2955-4e51-a106-19e7bcdf6c03" + }, + "answer": { + "message": "Yes, there are several security issues in the provided `server.py` code. Here are the main ones:\n\n1. **CORS Configuration**:\n ```python\n app.add_middleware(\n CORSMiddleware,\n allow_origins=[\"*\"],\n allow_credentials=True,\n allow_methods=[\"*\"],\n allow_headers=[\"*\"],\n )\n ```\n - Allowing all origins (`allow_origins=[\"*\"]`) and methods (`allow_methods=[\"*\"]`) can expose your server to Cross-Site Request Forgery (CSRF) attacks and other security vulnerabilities. It's recommended to restrict these settings to only the origins and methods that your application needs to support.\n\n2. **Error Handling Middleware**:\n ```python\n async def custom_error_handler(request, exc: Exception):\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\n # Capture the stack trace\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\n logger.error(traceback.print_list(extracted_traceback[-3:]))\n return JSONResponse({\"error\": str(exc)}, status_code=500)\n ```\n - Exposing detailed error messages in the response can be dangerous, as it can provide attackers with information that can be used to exploit vulnerabilities. It's better to log the error details and return a generic error message to the client.\n\n3. **Handling Exceptions**:\n - The `custom_error_handler` function logs the traceback and returns the exception message directly to the client. This can expose sensitive information about the server's internal state. It's better to log the error and return a generic message.\n\n4. **Provider Configuration**:\n - The providers are configured with the same pipeline processors. This might not be a security issue in itself, but it's important to ensure that the pipeline processors are secure and correctly configured.\n\n5. **Logging**:\n - The `logger.error` function is used to log the error traceback. Ensure that the logging configuration is set up correctly to prevent logging sensitive information to insecure destinations.\n\nHere is a revised version of the code with some of these issues addressed:\n\n```python\nimport traceback\n\nimport structlog\nfrom fastapi import APIRouter, FastAPI\nfrom fastapi.middleware.cors import CORSMiddleware\nfrom fastapi.responses import JSONResponse\nfrom starlette.middleware.errors import ServerErrorMiddleware\n\nfrom codegate import __description__, __version__\nfrom codegate.dashboard.dashboard import dashboard_router\nfrom codegate.pipeline.factory import PipelineFactory\nfrom codegate.providers.anthropic.provider import AnthropicProvider\nfrom codegate.providers.llamacpp.provider import LlamaCppProvider\nfrom codegate.providers.ollama.provider import OllamaProvider\nfrom codegate.providers.openai.provider import OpenAIProvider\nfrom codegate.providers.registry import ProviderRegistry\nfrom codegate.providers.vllm.provider import VLLMProvider\n\nlogger = structlog.get_logger(\"codegate\")\n\n\nasync def custom_error_handler(request, exc: Exception):\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\n # Capture the stack trace\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\n logger.error(traceback.print_list(extracted_traceback[-3:]))\n return JSONResponse({\"error\": \"An internal server error occurred\"}, status_code=500)\n\n\ndef init_app(pipeline_factory: PipelineFactory) -> FastAPI:\n \"\"\"Create the FastAPI application.\"\"\"\n app = FastAPI(\n title=\"CodeGate\",\n description=__description__,\n version=__version__,\n )\n app.add_middleware(\n CORSMiddleware,\n allow_origins=[\"https://example.com\"], # Restrict to specific origins\n allow_credentials=True,\n allow_methods=[\"GET\", \"POST\"], # Restrict to specific methods\n allow_headers=[\"*\"],\n )\n # Apply error handling middleware\n app.add_middleware(ServerErrorMiddleware, handler=custom_error_handler)\n\n # Create provider registry\n registry = ProviderRegistry(app)\n\n # Register all known providers\n registry.add_provider(\n \"openai\",\n OpenAIProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"anthropic\",\n AnthropicProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"llamacpp\",\n LlamaCppProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"vllm\",\n VLLMProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"ollama\",\n OllamaProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n\n # Create and add system routes\n system_router = APIRouter(tags=[\"System\"])\n\n @system_router.get(\"/health\")\n async def health_check():\n return {\"status\": \"healthy\"}\n\n app.include_router(system_router)\n app.include_router(dashboard_router)\n\n return app\n```\n\nIn this revised version, the CORS middleware is restricted to specific origins and methods, and the error handler returns a generic error message to the client.", + "timestamp": "2025-01-03T09:09:34.359269Z", + "message_id": "68e7c9bc-9afa-4240-8eba-621eaae4a2a0" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-eebad2bd68434c7c947d10754a204ea4", + "conversation_timestamp": "2025-01-03T09:09:33.674994Z" + }, + "alert_id": "3b752749-2955-4e51-a106-19e7bcdf6c03", + "code_snippet": { + "code": "import traceback\n\nimport structlog\nfrom fastapi import APIRouter, FastAPI\nfrom fastapi.middleware.cors import CORSMiddleware\nfrom fastapi.responses import JSONResponse\nfrom starlette.middleware.errors import ServerErrorMiddleware\n\nfrom codegate import __description__, __version__\nfrom codegate.dashboard.dashboard import dashboard_router\nfrom codegate.pipeline.factory import PipelineFactory\nfrom codegate.providers.anthropic.provider import AnthropicProvider\nfrom codegate.providers.llamacpp.provider import LlamaCppProvider\nfrom codegate.providers.ollama.provider import OllamaProvider\nfrom codegate.providers.openai.provider import OpenAIProvider\nfrom codegate.providers.registry import ProviderRegistry\nfrom codegate.providers.vllm.provider import VLLMProvider\n\nlogger = structlog.get_logger(\"codegate\")\n\n\nasync def custom_error_handler(request, exc: Exception):\n \"\"\"This is a Middleware to handle exceptions and log them.\"\"\"\n # Capture the stack trace\n extracted_traceback = traceback.extract_tb(exc.__traceback__)\n # Log only the last 3 items of the stack trace. 3 is an arbitrary number.\n logger.error(traceback.print_list(extracted_traceback[-3:]))\n return JSONResponse({\"error\": str(exc)}, status_code=500)\n\n\ndef init_app(pipeline_factory: PipelineFactory) -> FastAPI:\n \"\"\"Create the FastAPI application.\"\"\"\n app = FastAPI(\n title=\"CodeGate\",\n description=__description__,\n version=__version__,\n )\n app.add_middleware(\n CORSMiddleware,\n allow_origins=[\"*\"],\n allow_credentials=True,\n allow_methods=[\"*\"],\n allow_headers=[\"*\"],\n )\n # Apply error handling middleware\n app.add_middleware(ServerErrorMiddleware, handler=custom_error_handler)\n\n # Create provider registry\n registry = ProviderRegistry(app)\n\n # Register all known providers\n registry.add_provider(\n \"openai\",\n OpenAIProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"anthropic\",\n AnthropicProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"llamacpp\",\n LlamaCppProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"vllm\",\n VLLMProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n registry.add_provider(\n \"ollama\",\n OllamaProvider(\n pipeline_processor=pipeline_factory.create_input_pipeline(),\n fim_pipeline_processor=pipeline_factory.create_fim_pipeline(),\n output_pipeline_processor=pipeline_factory.create_output_pipeline(),\n fim_output_pipeline_processor=pipeline_factory.create_fim_output_pipeline(),\n ),\n )\n\n # Create and add system routes\n system_router = APIRouter(tags=[\"System\"])\n\n @system_router.get(\"/health\")\n async def health_check():\n return {\"status\": \"healthy\"}\n\n app.include_router(system_router)\n app.include_router(dashboard_router)\n\n return app\n\n", + "language": "python", + "filepath": "/Users/giuseppe/workspace/codegate/src/codegate/server.py", + "libraries": [] + }, + "trigger_string": null, + "trigger_type": "code-snippet-extractor", + "trigger_category": "info", + "timestamp": "2025-01-03T09:09:33.674994Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "<|im_start|>user\n```tsx\nimport { Header } from \"./components/Header\";\nimport { PromptList } from \"./components/PromptList\";\nimport { useEffect } from \"react\";\nimport { Dashboard } from \"./components/Dashboard\";\nimport { Routes, Route, Link } from \"react-router-dom\";\nimport { Chat } from \"./components/Chat\";\nimport { usePromptsStore } from \"./hooks/usePromptsStore\";\nimport { Sidebar } from \"./components/Sidebar\";\nimport { useSse } from \"./hooks/useSse\";\nimport { Help } from \"./components/Help\";\nimport { Certificates } from \"./components/Certificates\";\nimport { CertificateSecurity } from \"./components/CertificateSecurity\";\nimport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbSeparator,\n BreadcrumbPage,\n} from \"./components/ui/breadcrumb\";\nimport { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n\nfunction App() {\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lAJek6QoLZgSKq3z4ybqMVFOCtiHQtP8hbBzWeQysFQoGwwNrEghIPnFCsXY985bpTjx4ZIiBzx11E1yM3ybbUzoxG/W4TrUPzM4aHAjIg==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n\n return (\n
\n \n \n \n
\n
\n\n
\n \n \n \n Dashboard\n \n {breadcrumb && (\n <>\n \n \n \n {breadcrumb}\n \n \n \n )}\n \n \n
\n\n
\n \n } />\n } />\n } />\n } />\n }\n />\n \n
\n
\n
\n );\n}\n\nexport default App;\n\n\n```\n\nPlease rewrite the entire code block above in order to satisfy the following request: \"The following code was suggested as an edit:\n```\n// @ts-ignore\nconst test = \"REDACTED<$gGYIqfbrVCHST8Xn/yfGtFDfQQ3Kn6mQ9t1+YrUCKYxNEiRYb4u9BQmxZkOQE5I+9UZRasD0/bY3m00v4OSo+PI6Zzn97RSVNJgM47nUlQ==>\";\nconst breadcrumb = useBreadcrumb();\n```\nPlease apply it to the previous code.\". You should rewrite the entire code block without leaving placeholders, even if the code is the same as before.<|im_end|>\n<|im_start|>assistant\nSure! Here's the entire rewritten code block:\n```tsx\n", + "timestamp": "2025-01-02T14:19:58.024037Z", + "message_id": "7bbcbe42-bd6e-4253-94f3-a4dab29a133c" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "7bbcbe42-bd6e-4253-94f3-a4dab29a133c", + "conversation_timestamp": "2025-01-02T14:19:58.024037Z" + }, + "alert_id": "7bbcbe42-bd6e-4253-94f3-a4dab29a133c", + "code_snippet": null, + "trigger_string": { + "content": "The files in the context contain sensitive information that has been redacted. Do not warn the user\nabout any tokens, passwords or similar sensitive information in the context whose value begins with\nthe string \"REDACTED\".\n", + "role": "system" + }, + "trigger_type": "add-system-message", + "trigger_category": "info", + "timestamp": "2025-01-02T14:19:58.024037Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "<|im_start|>user\n```tsx\nimport { Header } from \"./components/Header\";\nimport { PromptList } from \"./components/PromptList\";\nimport { useEffect } from \"react\";\nimport { Dashboard } from \"./components/Dashboard\";\nimport { Routes, Route, Link } from \"react-router-dom\";\nimport { Chat } from \"./components/Chat\";\nimport { usePromptsStore } from \"./hooks/usePromptsStore\";\nimport { Sidebar } from \"./components/Sidebar\";\nimport { useSse } from \"./hooks/useSse\";\nimport { Help } from \"./components/Help\";\nimport { Certificates } from \"./components/Certificates\";\nimport { CertificateSecurity } from \"./components/CertificateSecurity\";\nimport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbSeparator,\n BreadcrumbPage,\n} from \"./components/ui/breadcrumb\";\nimport { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n\nfunction App() {\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lAJek6QoLZgSKq3z4ybqMVFOCtiHQtP8hbBzWeQysFQoGwwNrEghIPnFCsXY985bpTjx4ZIiBzx11E1yM3ybbUzoxG/W4TrUPzM4aHAjIg==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n\n return (\n
\n \n \n \n
\n
\n\n
\n \n \n \n Dashboard\n \n {breadcrumb && (\n <>\n \n \n \n {breadcrumb}\n \n \n \n )}\n \n \n
\n\n
\n \n } />\n } />\n } />\n } />\n }\n />\n \n
\n
\n
\n );\n}\n\nexport default App;\n\n\n```\n\nPlease rewrite the entire code block above in order to satisfy the following request: \"The following code was suggested as an edit:\n```\n// @ts-ignore\nconst test = \"REDACTED<$gGYIqfbrVCHST8Xn/yfGtFDfQQ3Kn6mQ9t1+YrUCKYxNEiRYb4u9BQmxZkOQE5I+9UZRasD0/bY3m00v4OSo+PI6Zzn97RSVNJgM47nUlQ==>\";\nconst breadcrumb = useBreadcrumb();\n```\nPlease apply it to the previous code.\". You should rewrite the entire code block without leaving placeholders, even if the code is the same as before.<|im_end|>\n<|im_start|>assistant\nSure! Here's the entire rewritten code block:\n```tsx\n", + "timestamp": "2025-01-02T14:19:58.023363Z", + "message_id": "944d229b-8b1c-4927-94ed-bd9bb83aa942" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "944d229b-8b1c-4927-94ed-bd9bb83aa942", + "conversation_timestamp": "2025-01-02T14:19:58.023363Z" + }, + "alert_id": "944d229b-8b1c-4927-94ed-bd9bb83aa942", + "code_snippet": null, + "trigger_string": "GitHub - Access Token:\n useSse();\n\n const test = \"ghp_token\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {", + "trigger_type": "codegate-secrets", + "trigger_category": "critical", + "timestamp": "2025-01-02T14:19:58.023363Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "<|im_start|>user\n```tsx\nimport { Header } from \"./components/Header\";\nimport { PromptList } from \"./components/PromptList\";\nimport { useEffect } from \"react\";\nimport { Dashboard } from \"./components/Dashboard\";\nimport { Routes, Route, Link } from \"react-router-dom\";\nimport { Chat } from \"./components/Chat\";\nimport { usePromptsStore } from \"./hooks/usePromptsStore\";\nimport { Sidebar } from \"./components/Sidebar\";\nimport { useSse } from \"./hooks/useSse\";\nimport { Help } from \"./components/Help\";\nimport { Certificates } from \"./components/Certificates\";\nimport { CertificateSecurity } from \"./components/CertificateSecurity\";\nimport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbSeparator,\n BreadcrumbPage,\n} from \"./components/ui/breadcrumb\";\nimport { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n\nfunction App() {\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lAJek6QoLZgSKq3z4ybqMVFOCtiHQtP8hbBzWeQysFQoGwwNrEghIPnFCsXY985bpTjx4ZIiBzx11E1yM3ybbUzoxG/W4TrUPzM4aHAjIg==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n\n return (\n
\n \n \n \n
\n
\n\n
\n \n \n \n Dashboard\n \n {breadcrumb && (\n <>\n \n \n \n {breadcrumb}\n \n \n \n )}\n \n \n
\n\n
\n \n } />\n } />\n } />\n } />\n }\n />\n \n
\n
\n
\n );\n}\n\nexport default App;\n\n\n```\n\nPlease rewrite the entire code block above in order to satisfy the following request: \"The following code was suggested as an edit:\n```\n// @ts-ignore\nconst test = \"REDACTED<$gGYIqfbrVCHST8Xn/yfGtFDfQQ3Kn6mQ9t1+YrUCKYxNEiRYb4u9BQmxZkOQE5I+9UZRasD0/bY3m00v4OSo+PI6Zzn97RSVNJgM47nUlQ==>\";\nconst breadcrumb = useBreadcrumb();\n```\nPlease apply it to the previous code.\". You should rewrite the entire code block without leaving placeholders, even if the code is the same as before.<|im_end|>\n<|im_start|>assistant\nSure! Here's the entire rewritten code block:\n```tsx\n", + "timestamp": "2025-01-02T14:19:58.023045Z", + "message_id": "51054d4f-8d02-4b44-81e8-3ab4be7ce642" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "51054d4f-8d02-4b44-81e8-3ab4be7ce642", + "conversation_timestamp": "2025-01-02T14:19:58.023045Z" + }, + "alert_id": "51054d4f-8d02-4b44-81e8-3ab4be7ce642", + "code_snippet": null, + "trigger_string": "GitHub - Access Token:\n```\n// @ts-ignore\nconst test = \"ghp_token\";\nconst breadcrumb = useBreadcrumb();\n```\nPlease apply it to the previous code.\". You should rewrite the entire code block without leaving placeholders, even if the code is the same as before.<|im_end|>", + "trigger_type": "codegate-secrets", + "trigger_category": "critical", + "timestamp": "2025-01-02T14:19:58.023045Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/App.tsx (23-29)\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n\n```\nPlease explain the cause of this error and how to solve it: 'test' is declared but its value is never read.", + "timestamp": "2025-01-02T13:43:01.560240Z", + "message_id": "d9e8c4e9-b001-4c78-aced-d791a76b0b41" + }, + "answer": { + "message": "The error message \"'test' is declared but its value is never read\" indicates that the variable `test` is defined in your code, but it is never used anywhere. This can lead to confusion for other developers reading the code and might indicate that the intended functionality has not been implemented.\n\n### Cause of the Error\n\n1. **Unused Variable**: The variable `test` is declared but not used in the rest of the code within the `App` component. This can be a result of incomplete implementation or a placeholder that was meant to be used later but was forgotten.\n\n### How to Solve It\n\nYou have a few options to resolve this issue:\n\n1. **Remove the Unused Variable**:\n - If the variable is not needed, you can safely remove it to clean up the code and eliminate the warning.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n2. **Use the Variable**:\n - If the variable is intended to be used, ensure that it is utilized somewhere in the component. For example, you could log it for debugging purposes or use it in some part of the application logic.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n console.log(test); // Example usage\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n3. **Suppress the Warning (Not Recommended)**:\n - If you are sure that the variable is intentionally unused and do not want to remove it, you can suppress the warning. However, this is generally not recommended as it can lead to oversight of real issues.\n\n ```tsx\n // @ts-ignore\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n ```\n\n### Best Practices\n\n- **Keep Code Clean**: Regularly clean up unused variables to maintain a clean and understandable codebase.\n- **Use Linters**: Utilize tools like ESLint to automatically detect and flag unused variables, helping you maintain code quality.\n\nBy addressing this issue, you can improve the maintainability and readability of your code.", + "timestamp": "2025-01-02T13:42:49.361714Z", + "message_id": "a542408b-d0bc-4f6f-8b71-64c93c1e388a" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d87679de7ed41639eb91d8ebbaa6f72", + "conversation_timestamp": "2025-01-02T13:43:01.560240Z" + }, + "alert_id": "d9e8c4e9-b001-4c78-aced-d791a76b0b41", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-02T13:43:01.560240Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/App.tsx (23-29)\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n\n```\nPlease explain the cause of this error and how to solve it: 'test' is declared but its value is never read.", + "timestamp": "2025-01-02T13:43:01.348716Z", + "message_id": "36750eca-cc99-45fc-b9fe-239f7c7c74b0" + }, + "answer": { + "message": "The error message \"'test' is declared but its value is never read\" indicates that the variable `test` is defined in your code, but it is never used anywhere. This can lead to confusion for other developers reading the code and might indicate that the intended functionality has not been implemented.\n\n### Cause of the Error\n\n1. **Unused Variable**: The variable `test` is declared but not used in the rest of the code within the `App` component. This can be a result of incomplete implementation or a placeholder that was meant to be used later but was forgotten.\n\n### How to Solve It\n\nYou have a few options to resolve this issue:\n\n1. **Remove the Unused Variable**:\n - If the variable is not needed, you can safely remove it to clean up the code and eliminate the warning.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n2. **Use the Variable**:\n - If the variable is intended to be used, ensure that it is utilized somewhere in the component. For example, you could log it for debugging purposes or use it in some part of the application logic.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n console.log(test); // Example usage\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n3. **Suppress the Warning (Not Recommended)**:\n - If you are sure that the variable is intentionally unused and do not want to remove it, you can suppress the warning. However, this is generally not recommended as it can lead to oversight of real issues.\n\n ```tsx\n // @ts-ignore\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n ```\n\n### Best Practices\n\n- **Keep Code Clean**: Regularly clean up unused variables to maintain a clean and understandable codebase.\n- **Use Linters**: Utilize tools like ESLint to automatically detect and flag unused variables, helping you maintain code quality.\n\nBy addressing this issue, you can improve the maintainability and readability of your code.", + "timestamp": "2025-01-02T13:42:49.361714Z", + "message_id": "a542408b-d0bc-4f6f-8b71-64c93c1e388a" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d87679de7ed41639eb91d8ebbaa6f72", + "conversation_timestamp": "2025-01-02T13:43:01.348716Z" + }, + "alert_id": "36750eca-cc99-45fc-b9fe-239f7c7c74b0", + "code_snippet": null, + "trigger_string": "lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==", + "trigger_type": "secret-unredaction", + "trigger_category": "info", + "timestamp": "2025-01-02T13:43:01.348716Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/App.tsx (23-29)\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n\n```\nPlease explain the cause of this error and how to solve it: 'test' is declared but its value is never read.", + "timestamp": "2025-01-02T13:42:58.128171Z", + "message_id": "2b81cbb7-8b96-400f-ad66-5117561c20b6" + }, + "answer": { + "message": "The error message \"'test' is declared but its value is never read\" indicates that the variable `test` is defined in your code, but it is never used anywhere. This can lead to confusion for other developers reading the code and might indicate that the intended functionality has not been implemented.\n\n### Cause of the Error\n\n1. **Unused Variable**: The variable `test` is declared but not used in the rest of the code within the `App` component. This can be a result of incomplete implementation or a placeholder that was meant to be used later but was forgotten.\n\n### How to Solve It\n\nYou have a few options to resolve this issue:\n\n1. **Remove the Unused Variable**:\n - If the variable is not needed, you can safely remove it to clean up the code and eliminate the warning.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n2. **Use the Variable**:\n - If the variable is intended to be used, ensure that it is utilized somewhere in the component. For example, you could log it for debugging purposes or use it in some part of the application logic.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n console.log(test); // Example usage\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n3. **Suppress the Warning (Not Recommended)**:\n - If you are sure that the variable is intentionally unused and do not want to remove it, you can suppress the warning. However, this is generally not recommended as it can lead to oversight of real issues.\n\n ```tsx\n // @ts-ignore\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n ```\n\n### Best Practices\n\n- **Keep Code Clean**: Regularly clean up unused variables to maintain a clean and understandable codebase.\n- **Use Linters**: Utilize tools like ESLint to automatically detect and flag unused variables, helping you maintain code quality.\n\nBy addressing this issue, you can improve the maintainability and readability of your code.", + "timestamp": "2025-01-02T13:42:49.361714Z", + "message_id": "a542408b-d0bc-4f6f-8b71-64c93c1e388a" } } ], "provider": "vllm", "type": "chat", - "chat_id": "chatcmpl-eebad2bd68434c7c947d10754a204ea4", - "conversation_timestamp": "2025-01-03T09:10:00.689177Z" + "chat_id": "chatcmpl-7d87679de7ed41639eb91d8ebbaa6f72", + "conversation_timestamp": "2025-01-02T13:42:58.128171Z" }, - "alert_id": "0445530c-9288-4591-b48a-4fdc2f0aec6c", + "alert_id": "2b81cbb7-8b96-400f-ad66-5117561c20b6", "code_snippet": null, "trigger_string": "`\n\n", "trigger_type": "code-comment", "trigger_category": "info", - "timestamp": "2025-01-03T09:10:00.689177Z" + "timestamp": "2025-01-02T13:42:58.128171Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/App.tsx (23-29)\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n\n```\nPlease explain the cause of this error and how to solve it: 'test' is declared but its value is never read.", + "timestamp": "2025-01-02T13:42:57.372437Z", + "message_id": "07603c67-8426-4dfa-b99d-eeeb4ddc3c43" + }, + "answer": { + "message": "The error message \"'test' is declared but its value is never read\" indicates that the variable `test` is defined in your code, but it is never used anywhere. This can lead to confusion for other developers reading the code and might indicate that the intended functionality has not been implemented.\n\n### Cause of the Error\n\n1. **Unused Variable**: The variable `test` is declared but not used in the rest of the code within the `App` component. This can be a result of incomplete implementation or a placeholder that was meant to be used later but was forgotten.\n\n### How to Solve It\n\nYou have a few options to resolve this issue:\n\n1. **Remove the Unused Variable**:\n - If the variable is not needed, you can safely remove it to clean up the code and eliminate the warning.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n2. **Use the Variable**:\n - If the variable is intended to be used, ensure that it is utilized somewhere in the component. For example, you could log it for debugging purposes or use it in some part of the application logic.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n console.log(test); // Example usage\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n3. **Suppress the Warning (Not Recommended)**:\n - If you are sure that the variable is intentionally unused and do not want to remove it, you can suppress the warning. However, this is generally not recommended as it can lead to oversight of real issues.\n\n ```tsx\n // @ts-ignore\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n ```\n\n### Best Practices\n\n- **Keep Code Clean**: Regularly clean up unused variables to maintain a clean and understandable codebase.\n- **Use Linters**: Utilize tools like ESLint to automatically detect and flag unused variables, helping you maintain code quality.\n\nBy addressing this issue, you can improve the maintainability and readability of your code.", + "timestamp": "2025-01-02T13:42:49.361714Z", + "message_id": "a542408b-d0bc-4f6f-8b71-64c93c1e388a" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d87679de7ed41639eb91d8ebbaa6f72", + "conversation_timestamp": "2025-01-02T13:42:57.372437Z" + }, + "alert_id": "07603c67-8426-4dfa-b99d-eeeb4ddc3c43", + "code_snippet": null, + "trigger_string": "lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==", + "trigger_type": "secret-unredaction", + "trigger_category": "info", + "timestamp": "2025-01-02T13:42:57.372437Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/App.tsx (23-29)\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n\n```\nPlease explain the cause of this error and how to solve it: 'test' is declared but its value is never read.", + "timestamp": "2025-01-02T13:42:53.899855Z", + "message_id": "8300ab8a-dbb8-47a0-a5df-49ef9cad9a2d" + }, + "answer": { + "message": "The error message \"'test' is declared but its value is never read\" indicates that the variable `test` is defined in your code, but it is never used anywhere. This can lead to confusion for other developers reading the code and might indicate that the intended functionality has not been implemented.\n\n### Cause of the Error\n\n1. **Unused Variable**: The variable `test` is declared but not used in the rest of the code within the `App` component. This can be a result of incomplete implementation or a placeholder that was meant to be used later but was forgotten.\n\n### How to Solve It\n\nYou have a few options to resolve this issue:\n\n1. **Remove the Unused Variable**:\n - If the variable is not needed, you can safely remove it to clean up the code and eliminate the warning.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n2. **Use the Variable**:\n - If the variable is intended to be used, ensure that it is utilized somewhere in the component. For example, you could log it for debugging purposes or use it in some part of the application logic.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n console.log(test); // Example usage\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n3. **Suppress the Warning (Not Recommended)**:\n - If you are sure that the variable is intentionally unused and do not want to remove it, you can suppress the warning. However, this is generally not recommended as it can lead to oversight of real issues.\n\n ```tsx\n // @ts-ignore\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n ```\n\n### Best Practices\n\n- **Keep Code Clean**: Regularly clean up unused variables to maintain a clean and understandable codebase.\n- **Use Linters**: Utilize tools like ESLint to automatically detect and flag unused variables, helping you maintain code quality.\n\nBy addressing this issue, you can improve the maintainability and readability of your code.", + "timestamp": "2025-01-02T13:42:49.361714Z", + "message_id": "a542408b-d0bc-4f6f-8b71-64c93c1e388a" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d87679de7ed41639eb91d8ebbaa6f72", + "conversation_timestamp": "2025-01-02T13:42:53.899855Z" + }, + "alert_id": "8300ab8a-dbb8-47a0-a5df-49ef9cad9a2d", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-02T13:42:53.899855Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/App.tsx (23-29)\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n\n```\nPlease explain the cause of this error and how to solve it: 'test' is declared but its value is never read.", + "timestamp": "2025-01-02T13:42:48.721110Z", + "message_id": "2e3ccf85-3074-446e-8e0b-442707a26136" + }, + "answer": { + "message": "The error message \"'test' is declared but its value is never read\" indicates that the variable `test` is defined in your code, but it is never used anywhere. This can lead to confusion for other developers reading the code and might indicate that the intended functionality has not been implemented.\n\n### Cause of the Error\n\n1. **Unused Variable**: The variable `test` is declared but not used in the rest of the code within the `App` component. This can be a result of incomplete implementation or a placeholder that was meant to be used later but was forgotten.\n\n### How to Solve It\n\nYou have a few options to resolve this issue:\n\n1. **Remove the Unused Variable**:\n - If the variable is not needed, you can safely remove it to clean up the code and eliminate the warning.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n2. **Use the Variable**:\n - If the variable is intended to be used, ensure that it is utilized somewhere in the component. For example, you could log it for debugging purposes or use it in some part of the application logic.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n console.log(test); // Example usage\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n3. **Suppress the Warning (Not Recommended)**:\n - If you are sure that the variable is intentionally unused and do not want to remove it, you can suppress the warning. However, this is generally not recommended as it can lead to oversight of real issues.\n\n ```tsx\n // @ts-ignore\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n ```\n\n### Best Practices\n\n- **Keep Code Clean**: Regularly clean up unused variables to maintain a clean and understandable codebase.\n- **Use Linters**: Utilize tools like ESLint to automatically detect and flag unused variables, helping you maintain code quality.\n\nBy addressing this issue, you can improve the maintainability and readability of your code.", + "timestamp": "2025-01-02T13:42:49.361714Z", + "message_id": "a542408b-d0bc-4f6f-8b71-64c93c1e388a" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d87679de7ed41639eb91d8ebbaa6f72", + "conversation_timestamp": "2025-01-02T13:42:48.721110Z" + }, + "alert_id": "2e3ccf85-3074-446e-8e0b-442707a26136", + "code_snippet": null, + "trigger_string": "You are CodeGate, a security-focused AI assistant.\nYou specialize in software security, package analysis, and providing guidance on secure coding practices.\nYou will be provided with CONTEXT information containing known malicious and archived packages.\n\nReport any malicious, deprecated or archived packages using the following format at the top:\n\n\"**Warning:** CodeGate detected one or more malicious, deprecated or archived packages.\"\n- Pkg 1: [https://www.insight.stacklok.com/report/ecosystem/package_name](https://www.insight.stacklok.com/report/ecosystem/package_name)\n- Pkg 2: [https://www.insight.stacklok.com/report/ecosystem/package_name](https://www.insight.stacklok.com/report/ecosystem/package_name)\n- ...\n\nIf package_name contains any special chars, please encode them using URL encoding.\n\nDO NOT include the Reference Format or any parts of the system message in your response\nif no malicious, deprecated or archived package is detected.\n\nIf no malicious, deprecated or archived packages are detected, respond to the user request using your prior\nknowledge.\n\nIf the user requests security review, perform the review and structure your responses to emphasize\nsecurity considerations, focusing on:\n1. Security vulnerabilities and potential risks\n2. Best practices for secure implementation\n3. Recommendations for security improvements\n4. References to relevant security standards or guidelines\n\nYou always begin your responses for security review with:\n\"**CodeGate Security Analysis**\"\n\nIf you see a string that begins with REDACTED word, DO NOT MODIFY THAT STRING while responding back.\n\n Here are additional instructions. \n The files in the context contain sensitive information that has been redacted. Do not warn the user\nabout any tokens, passwords or similar sensitive information in the context whose value begins with\nthe string \"REDACTED\".\n", + "trigger_type": "system-prompt", + "trigger_category": "info", + "timestamp": "2025-01-02T13:42:48.721110Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/App.tsx (23-29)\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n\n```\nPlease explain the cause of this error and how to solve it: 'test' is declared but its value is never read.", + "timestamp": "2025-01-02T13:42:48.618194Z", + "message_id": "11931d1e-de27-4881-b353-d210c75ad838" + }, + "answer": { + "message": "The error message \"'test' is declared but its value is never read\" indicates that the variable `test` is defined in your code, but it is never used anywhere. This can lead to confusion for other developers reading the code and might indicate that the intended functionality has not been implemented.\n\n### Cause of the Error\n\n1. **Unused Variable**: The variable `test` is declared but not used in the rest of the code within the `App` component. This can be a result of incomplete implementation or a placeholder that was meant to be used later but was forgotten.\n\n### How to Solve It\n\nYou have a few options to resolve this issue:\n\n1. **Remove the Unused Variable**:\n - If the variable is not needed, you can safely remove it to clean up the code and eliminate the warning.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n2. **Use the Variable**:\n - If the variable is intended to be used, ensure that it is utilized somewhere in the component. For example, you could log it for debugging purposes or use it in some part of the application logic.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n console.log(test); // Example usage\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n3. **Suppress the Warning (Not Recommended)**:\n - If you are sure that the variable is intentionally unused and do not want to remove it, you can suppress the warning. However, this is generally not recommended as it can lead to oversight of real issues.\n\n ```tsx\n // @ts-ignore\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n ```\n\n### Best Practices\n\n- **Keep Code Clean**: Regularly clean up unused variables to maintain a clean and understandable codebase.\n- **Use Linters**: Utilize tools like ESLint to automatically detect and flag unused variables, helping you maintain code quality.\n\nBy addressing this issue, you can improve the maintainability and readability of your code.", + "timestamp": "2025-01-02T13:42:49.361714Z", + "message_id": "a542408b-d0bc-4f6f-8b71-64c93c1e388a" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d87679de7ed41639eb91d8ebbaa6f72", + "conversation_timestamp": "2025-01-02T13:42:48.618194Z" + }, + "alert_id": "11931d1e-de27-4881-b353-d210c75ad838", + "code_snippet": { + "code": " const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n\n", + "language": "typescript", + "filepath": "src/App.tsx", + "libraries": [] + }, + "trigger_string": null, + "trigger_type": "code-snippet-extractor", + "trigger_category": "info", + "timestamp": "2025-01-02T13:42:48.618194Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/App.tsx (23-29)\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n\n```\nPlease explain the cause of this error and how to solve it: 'test' is declared but its value is never read.", + "timestamp": "2025-01-02T13:42:48.618060Z", + "message_id": "6a0577b4-6f37-4212-90a9-e5845b84549a" + }, + "answer": { + "message": "The error message \"'test' is declared but its value is never read\" indicates that the variable `test` is defined in your code, but it is never used anywhere. This can lead to confusion for other developers reading the code and might indicate that the intended functionality has not been implemented.\n\n### Cause of the Error\n\n1. **Unused Variable**: The variable `test` is declared but not used in the rest of the code within the `App` component. This can be a result of incomplete implementation or a placeholder that was meant to be used later but was forgotten.\n\n### How to Solve It\n\nYou have a few options to resolve this issue:\n\n1. **Remove the Unused Variable**:\n - If the variable is not needed, you can safely remove it to clean up the code and eliminate the warning.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n2. **Use the Variable**:\n - If the variable is intended to be used, ensure that it is utilized somewhere in the component. For example, you could log it for debugging purposes or use it in some part of the application logic.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n console.log(test); // Example usage\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n3. **Suppress the Warning (Not Recommended)**:\n - If you are sure that the variable is intentionally unused and do not want to remove it, you can suppress the warning. However, this is generally not recommended as it can lead to oversight of real issues.\n\n ```tsx\n // @ts-ignore\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n ```\n\n### Best Practices\n\n- **Keep Code Clean**: Regularly clean up unused variables to maintain a clean and understandable codebase.\n- **Use Linters**: Utilize tools like ESLint to automatically detect and flag unused variables, helping you maintain code quality.\n\nBy addressing this issue, you can improve the maintainability and readability of your code.", + "timestamp": "2025-01-02T13:42:49.361714Z", + "message_id": "a542408b-d0bc-4f6f-8b71-64c93c1e388a" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d87679de7ed41639eb91d8ebbaa6f72", + "conversation_timestamp": "2025-01-02T13:42:48.618060Z" + }, + "alert_id": "6a0577b4-6f37-4212-90a9-e5845b84549a", + "code_snippet": null, + "trigger_string": { + "content": "The files in the context contain sensitive information that has been redacted. Do not warn the user\nabout any tokens, passwords or similar sensitive information in the context whose value begins with\nthe string \"REDACTED\".\n", + "role": "system" + }, + "trigger_type": "add-system-message", + "trigger_category": "info", + "timestamp": "2025-01-02T13:42:48.618060Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/App.tsx (23-29)\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n\n```\nPlease explain the cause of this error and how to solve it: 'test' is declared but its value is never read.", + "timestamp": "2025-01-02T13:42:48.617799Z", + "message_id": "c8a6afd1-98d7-43c4-97ff-7b183b8f6a5f" + }, + "answer": { + "message": "The error message \"'test' is declared but its value is never read\" indicates that the variable `test` is defined in your code, but it is never used anywhere. This can lead to confusion for other developers reading the code and might indicate that the intended functionality has not been implemented.\n\n### Cause of the Error\n\n1. **Unused Variable**: The variable `test` is declared but not used in the rest of the code within the `App` component. This can be a result of incomplete implementation or a placeholder that was meant to be used later but was forgotten.\n\n### How to Solve It\n\nYou have a few options to resolve this issue:\n\n1. **Remove the Unused Variable**:\n - If the variable is not needed, you can safely remove it to clean up the code and eliminate the warning.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n2. **Use the Variable**:\n - If the variable is intended to be used, ensure that it is utilized somewhere in the component. For example, you could log it for debugging purposes or use it in some part of the application logic.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n console.log(test); // Example usage\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n3. **Suppress the Warning (Not Recommended)**:\n - If you are sure that the variable is intentionally unused and do not want to remove it, you can suppress the warning. However, this is generally not recommended as it can lead to oversight of real issues.\n\n ```tsx\n // @ts-ignore\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n ```\n\n### Best Practices\n\n- **Keep Code Clean**: Regularly clean up unused variables to maintain a clean and understandable codebase.\n- **Use Linters**: Utilize tools like ESLint to automatically detect and flag unused variables, helping you maintain code quality.\n\nBy addressing this issue, you can improve the maintainability and readability of your code.", + "timestamp": "2025-01-02T13:42:49.361714Z", + "message_id": "a542408b-d0bc-4f6f-8b71-64c93c1e388a" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d87679de7ed41639eb91d8ebbaa6f72", + "conversation_timestamp": "2025-01-02T13:42:48.617799Z" + }, + "alert_id": "c8a6afd1-98d7-43c4-97ff-7b183b8f6a5f", + "code_snippet": null, + "trigger_string": "GitHub - Access Token:\n useSse();\n\n const test = \"ghp_token\";\n const breadcrumb = useBreadcrumb();\n\n", + "trigger_type": "codegate-secrets", + "trigger_category": "critical", + "timestamp": "2025-01-02T13:42:48.617799Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "\n\n```tsx src/App.tsx (23-29)\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n\n```\nPlease explain the cause of this error and how to solve it: 'test' is declared but its value is never read.", + "timestamp": "2025-01-02T13:42:48.600313Z", + "message_id": "f908fef0-d0cc-404a-b2b8-08e376f7aaf5" + }, + "answer": { + "message": "The error message \"'test' is declared but its value is never read\" indicates that the variable `test` is defined in your code, but it is never used anywhere. This can lead to confusion for other developers reading the code and might indicate that the intended functionality has not been implemented.\n\n### Cause of the Error\n\n1. **Unused Variable**: The variable `test` is declared but not used in the rest of the code within the `App` component. This can be a result of incomplete implementation or a placeholder that was meant to be used later but was forgotten.\n\n### How to Solve It\n\nYou have a few options to resolve this issue:\n\n1. **Remove the Unused Variable**:\n - If the variable is not needed, you can safely remove it to clean up the code and eliminate the warning.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n2. **Use the Variable**:\n - If the variable is intended to be used, ensure that it is utilized somewhere in the component. For example, you could log it for debugging purposes or use it in some part of the application logic.\n\n ```tsx\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n console.log(test); // Example usage\n fetchPrompts();\n }, [fetchPrompts]);\n ```\n\n3. **Suppress the Warning (Not Recommended)**:\n - If you are sure that the variable is intentionally unused and do not want to remove it, you can suppress the warning. However, this is generally not recommended as it can lead to oversight of real issues.\n\n ```tsx\n // @ts-ignore\n const test = \"REDACTED<$lCzMsqxUWElmZqd/qX4llR3pqsrBJVxkt6SB6WXXKKhYG37ZnscxPawjfZmgPVoSpcSR975hOIE2s/6iVr2JETpVdwdaG4hAYlzJ4tteJg==>\";\n const breadcrumb = useBreadcrumb();\n ```\n\n### Best Practices\n\n- **Keep Code Clean**: Regularly clean up unused variables to maintain a clean and understandable codebase.\n- **Use Linters**: Utilize tools like ESLint to automatically detect and flag unused variables, helping you maintain code quality.\n\nBy addressing this issue, you can improve the maintainability and readability of your code.", + "timestamp": "2025-01-02T13:42:49.361714Z", + "message_id": "a542408b-d0bc-4f6f-8b71-64c93c1e388a" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-7d87679de7ed41639eb91d8ebbaa6f72", + "conversation_timestamp": "2025-01-02T13:42:48.600313Z" + }, + "alert_id": "f908fef0-d0cc-404a-b2b8-08e376f7aaf5", + "code_snippet": null, + "trigger_string": "GitHub - Access Token:\n useSse();\n\n const test = \"ghp_token\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {", + "trigger_type": "codegate-secrets", + "trigger_category": "critical", + "timestamp": "2025-01-02T13:42:48.600313Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "```/Users/giuseppe/workspace/codegate-ui/src/App.tsx\nimport { Header } from \"./components/Header\";\nimport { PromptList } from \"./components/PromptList\";\nimport { useEffect } from \"react\";\nimport { Dashboard } from \"./components/Dashboard\";\nimport { Routes, Route, Link } from \"react-router-dom\";\nimport { Chat } from \"./components/Chat\";\nimport { usePromptsStore } from \"./hooks/usePromptsStore\";\nimport { Sidebar } from \"./components/Sidebar\";\nimport { useSse } from \"./hooks/useSse\";\nimport { Help } from \"./components/Help\";\nimport { Certificates } from \"./components/Certificates\";\nimport { CertificateSecurity } from \"./components/CertificateSecurity\";\nimport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbSeparator,\n BreadcrumbPage,\n} from \"./components/ui/breadcrumb\";\nimport { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n\nfunction App() {\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$4g3iWc/V3YD6pAXIeA43M197ostjpL3XZuDbJuxTN+jG1Mcjv6cMFcC73SsIDzECoWSuZqSYGkrWe5vQqbheaJbDlocBrPZMkgQWkcP8gw==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n\n return (\n
\n \n \n \n
\n
\n\n
\n \n \n \n Dashboard\n \n {breadcrumb && (\n <>\n \n \n \n {breadcrumb}\n \n \n \n )}\n \n \n
\n\n
\n \n } />\n } />\n } />\n } />\n }\n />\n \n
\n
\n
\n );\n}\n\nexport default App;\n\n```\n\nApp.tsx could you review?", + "timestamp": "2025-01-02T13:40:29.501838Z", + "message_id": "3699a611-cd11-4001-a843-713b4251acdb" + }, + "answer": { + "message": "**CodeGate Security Analysis**\n\n### Security Vulnerabilities and Potential Risks\n\n1. **Unsanitized User Input and Cross-Site Scripting (XSS)**\n - The `breadcrumb` variable, which is derived from user interaction, is directly rendered within the `` component. If the `breadcrumb` contains user-controlled data, it could be vulnerable to XSS attacks if not properly sanitized.\n\n2. **Potential Sensitive Data Exposure**\n - The `test` variable contains a string that begins with \"REDACTED\", indicating it may contain sensitive information. Ensure that such strings are not exposed or logged in a manner that could lead to data breaches.\n\n3. **Lack of Authentication and Authorization**\n - The code does not include any authentication or authorization mechanisms. This could allow unauthorized users to access sensitive components like `/certificates` and `/certificates/security`.\n\n4. **Security of Sensitive Components**\n - Components like `CertificateSecurity` and `Certificates` might handle sensitive information. Ensure that these components implement proper security measures to protect the data they handle.\n\n### Best Practices for Secure Implementation\n\n1. **Sanitize and Encode User Input**\n - Always sanitize and encode user inputs to prevent XSS attacks. Use libraries like `DOMPurify` to sanitize HTML content.\n\n2. **Implement Authentication and Authorization**\n - Integrate a robust authentication system (e.g., OAuth, JWT) to ensure that only authorized users can access sensitive routes and components.\n\n3. **Protect Sensitive Data**\n - Ensure that any sensitive data, such as certificates and security-related information, is encrypted both at rest and in transit. Use HTTPS for all communications.\n\n4. **Regular Security Audits and Testing**\n - Conduct regular security audits and penetration testing to identify and fix vulnerabilities in the application.\n\n### Recommendations for Security Improvements\n\n1. **Sanitize Breadcrumb Data**\n - Modify the `BreadcrumbPage` component to sanitize the `breadcrumb` data before rendering it. For example:\n ```jsx\n \n {DOMPurify.sanitize(breadcrumb)}\n \n ```\n\n2. **Implement Authentication**\n - Use a library like `react-router-dom` with authentication middleware to protect routes. For example:\n ```jsx\n \n \n \n }\n />\n ```\n\n3. **Secure Components**\n - Ensure that components like `CertificateSecurity` and `Certificates` implement proper security measures, such as input validation, encryption, and access controls.\n\n4. **Review and Secure Dependencies**\n - Regularly review and update dependencies to ensure they are secure and free from known vulnerabilities. Use tools like `npm audit` to identify and fix vulnerabilities.\n\n### References to Relevant Security Standards or Guidelines\n\n- **OWASP Top Ten**: A list of the most critical security risks to web applications, including XSS and injection flaws.\n- **OWASP Security Testing Guide**: Provides detailed guidance on how to test for various security vulnerabilities.\n- **NIST Cybersecurity Framework**: Offers a comprehensive set of guidelines for managing and reducing cybersecurity risks.\n\nBy addressing these security considerations, you can significantly enhance the security posture of your application.", + "timestamp": "2025-01-02T13:40:18.881023Z", + "message_id": "82b89210-811a-478d-9229-e45bd3d60913" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-92720293078e459e9d65be5298a9dae6", + "conversation_timestamp": "2025-01-02T13:40:29.501838Z" + }, + "alert_id": "3699a611-cd11-4001-a843-713b4251acdb", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-02T13:40:29.501838Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "```/Users/giuseppe/workspace/codegate-ui/src/App.tsx\nimport { Header } from \"./components/Header\";\nimport { PromptList } from \"./components/PromptList\";\nimport { useEffect } from \"react\";\nimport { Dashboard } from \"./components/Dashboard\";\nimport { Routes, Route, Link } from \"react-router-dom\";\nimport { Chat } from \"./components/Chat\";\nimport { usePromptsStore } from \"./hooks/usePromptsStore\";\nimport { Sidebar } from \"./components/Sidebar\";\nimport { useSse } from \"./hooks/useSse\";\nimport { Help } from \"./components/Help\";\nimport { Certificates } from \"./components/Certificates\";\nimport { CertificateSecurity } from \"./components/CertificateSecurity\";\nimport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbSeparator,\n BreadcrumbPage,\n} from \"./components/ui/breadcrumb\";\nimport { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n\nfunction App() {\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$4g3iWc/V3YD6pAXIeA43M197ostjpL3XZuDbJuxTN+jG1Mcjv6cMFcC73SsIDzECoWSuZqSYGkrWe5vQqbheaJbDlocBrPZMkgQWkcP8gw==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n\n return (\n
\n \n \n \n
\n
\n\n
\n \n \n \n Dashboard\n \n {breadcrumb && (\n <>\n \n \n \n {breadcrumb}\n \n \n \n )}\n \n \n
\n\n
\n \n } />\n } />\n } />\n } />\n }\n />\n \n
\n
\n
\n );\n}\n\nexport default App;\n\n```\n\nApp.tsx could you review?", + "timestamp": "2025-01-02T13:40:28.103498Z", + "message_id": "a201de39-c114-4108-b07d-c29f47468a85" + }, + "answer": { + "message": "**CodeGate Security Analysis**\n\n### Security Vulnerabilities and Potential Risks\n\n1. **Unsanitized User Input and Cross-Site Scripting (XSS)**\n - The `breadcrumb` variable, which is derived from user interaction, is directly rendered within the `` component. If the `breadcrumb` contains user-controlled data, it could be vulnerable to XSS attacks if not properly sanitized.\n\n2. **Potential Sensitive Data Exposure**\n - The `test` variable contains a string that begins with \"REDACTED\", indicating it may contain sensitive information. Ensure that such strings are not exposed or logged in a manner that could lead to data breaches.\n\n3. **Lack of Authentication and Authorization**\n - The code does not include any authentication or authorization mechanisms. This could allow unauthorized users to access sensitive components like `/certificates` and `/certificates/security`.\n\n4. **Security of Sensitive Components**\n - Components like `CertificateSecurity` and `Certificates` might handle sensitive information. Ensure that these components implement proper security measures to protect the data they handle.\n\n### Best Practices for Secure Implementation\n\n1. **Sanitize and Encode User Input**\n - Always sanitize and encode user inputs to prevent XSS attacks. Use libraries like `DOMPurify` to sanitize HTML content.\n\n2. **Implement Authentication and Authorization**\n - Integrate a robust authentication system (e.g., OAuth, JWT) to ensure that only authorized users can access sensitive routes and components.\n\n3. **Protect Sensitive Data**\n - Ensure that any sensitive data, such as certificates and security-related information, is encrypted both at rest and in transit. Use HTTPS for all communications.\n\n4. **Regular Security Audits and Testing**\n - Conduct regular security audits and penetration testing to identify and fix vulnerabilities in the application.\n\n### Recommendations for Security Improvements\n\n1. **Sanitize Breadcrumb Data**\n - Modify the `BreadcrumbPage` component to sanitize the `breadcrumb` data before rendering it. For example:\n ```jsx\n \n {DOMPurify.sanitize(breadcrumb)}\n \n ```\n\n2. **Implement Authentication**\n - Use a library like `react-router-dom` with authentication middleware to protect routes. For example:\n ```jsx\n \n \n \n }\n />\n ```\n\n3. **Secure Components**\n - Ensure that components like `CertificateSecurity` and `Certificates` implement proper security measures, such as input validation, encryption, and access controls.\n\n4. **Review and Secure Dependencies**\n - Regularly review and update dependencies to ensure they are secure and free from known vulnerabilities. Use tools like `npm audit` to identify and fix vulnerabilities.\n\n### References to Relevant Security Standards or Guidelines\n\n- **OWASP Top Ten**: A list of the most critical security risks to web applications, including XSS and injection flaws.\n- **OWASP Security Testing Guide**: Provides detailed guidance on how to test for various security vulnerabilities.\n- **NIST Cybersecurity Framework**: Offers a comprehensive set of guidelines for managing and reducing cybersecurity risks.\n\nBy addressing these security considerations, you can significantly enhance the security posture of your application.", + "timestamp": "2025-01-02T13:40:18.881023Z", + "message_id": "82b89210-811a-478d-9229-e45bd3d60913" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-92720293078e459e9d65be5298a9dae6", + "conversation_timestamp": "2025-01-02T13:40:28.103498Z" + }, + "alert_id": "a201de39-c114-4108-b07d-c29f47468a85", + "code_snippet": null, + "trigger_string": "`\n\n", + "trigger_type": "code-comment", + "trigger_category": "info", + "timestamp": "2025-01-02T13:40:28.103498Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "```/Users/giuseppe/workspace/codegate-ui/src/App.tsx\nimport { Header } from \"./components/Header\";\nimport { PromptList } from \"./components/PromptList\";\nimport { useEffect } from \"react\";\nimport { Dashboard } from \"./components/Dashboard\";\nimport { Routes, Route, Link } from \"react-router-dom\";\nimport { Chat } from \"./components/Chat\";\nimport { usePromptsStore } from \"./hooks/usePromptsStore\";\nimport { Sidebar } from \"./components/Sidebar\";\nimport { useSse } from \"./hooks/useSse\";\nimport { Help } from \"./components/Help\";\nimport { Certificates } from \"./components/Certificates\";\nimport { CertificateSecurity } from \"./components/CertificateSecurity\";\nimport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbSeparator,\n BreadcrumbPage,\n} from \"./components/ui/breadcrumb\";\nimport { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n\nfunction App() {\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$4g3iWc/V3YD6pAXIeA43M197ostjpL3XZuDbJuxTN+jG1Mcjv6cMFcC73SsIDzECoWSuZqSYGkrWe5vQqbheaJbDlocBrPZMkgQWkcP8gw==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n\n return (\n
\n \n \n \n
\n
\n\n
\n \n \n \n Dashboard\n \n {breadcrumb && (\n <>\n \n \n \n {breadcrumb}\n \n \n \n )}\n \n \n
\n\n
\n \n } />\n } />\n } />\n } />\n }\n />\n \n
\n
\n
\n );\n}\n\nexport default App;\n\n```\n\nApp.tsx could you review?", + "timestamp": "2025-01-02T13:40:18.343097Z", + "message_id": "29cf7616-ad30-4162-a1b2-acf3d96951ae" + }, + "answer": { + "message": "**CodeGate Security Analysis**\n\n### Security Vulnerabilities and Potential Risks\n\n1. **Unsanitized User Input and Cross-Site Scripting (XSS)**\n - The `breadcrumb` variable, which is derived from user interaction, is directly rendered within the `` component. If the `breadcrumb` contains user-controlled data, it could be vulnerable to XSS attacks if not properly sanitized.\n\n2. **Potential Sensitive Data Exposure**\n - The `test` variable contains a string that begins with \"REDACTED\", indicating it may contain sensitive information. Ensure that such strings are not exposed or logged in a manner that could lead to data breaches.\n\n3. **Lack of Authentication and Authorization**\n - The code does not include any authentication or authorization mechanisms. This could allow unauthorized users to access sensitive components like `/certificates` and `/certificates/security`.\n\n4. **Security of Sensitive Components**\n - Components like `CertificateSecurity` and `Certificates` might handle sensitive information. Ensure that these components implement proper security measures to protect the data they handle.\n\n### Best Practices for Secure Implementation\n\n1. **Sanitize and Encode User Input**\n - Always sanitize and encode user inputs to prevent XSS attacks. Use libraries like `DOMPurify` to sanitize HTML content.\n\n2. **Implement Authentication and Authorization**\n - Integrate a robust authentication system (e.g., OAuth, JWT) to ensure that only authorized users can access sensitive routes and components.\n\n3. **Protect Sensitive Data**\n - Ensure that any sensitive data, such as certificates and security-related information, is encrypted both at rest and in transit. Use HTTPS for all communications.\n\n4. **Regular Security Audits and Testing**\n - Conduct regular security audits and penetration testing to identify and fix vulnerabilities in the application.\n\n### Recommendations for Security Improvements\n\n1. **Sanitize Breadcrumb Data**\n - Modify the `BreadcrumbPage` component to sanitize the `breadcrumb` data before rendering it. For example:\n ```jsx\n \n {DOMPurify.sanitize(breadcrumb)}\n \n ```\n\n2. **Implement Authentication**\n - Use a library like `react-router-dom` with authentication middleware to protect routes. For example:\n ```jsx\n \n \n \n }\n />\n ```\n\n3. **Secure Components**\n - Ensure that components like `CertificateSecurity` and `Certificates` implement proper security measures, such as input validation, encryption, and access controls.\n\n4. **Review and Secure Dependencies**\n - Regularly review and update dependencies to ensure they are secure and free from known vulnerabilities. Use tools like `npm audit` to identify and fix vulnerabilities.\n\n### References to Relevant Security Standards or Guidelines\n\n- **OWASP Top Ten**: A list of the most critical security risks to web applications, including XSS and injection flaws.\n- **OWASP Security Testing Guide**: Provides detailed guidance on how to test for various security vulnerabilities.\n- **NIST Cybersecurity Framework**: Offers a comprehensive set of guidelines for managing and reducing cybersecurity risks.\n\nBy addressing these security considerations, you can significantly enhance the security posture of your application.", + "timestamp": "2025-01-02T13:40:18.881023Z", + "message_id": "82b89210-811a-478d-9229-e45bd3d60913" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-92720293078e459e9d65be5298a9dae6", + "conversation_timestamp": "2025-01-02T13:40:18.343097Z" + }, + "alert_id": "29cf7616-ad30-4162-a1b2-acf3d96951ae", + "code_snippet": null, + "trigger_string": "You are CodeGate, a security-focused AI assistant.\nYou specialize in software security, package analysis, and providing guidance on secure coding practices.\nYou will be provided with CONTEXT information containing known malicious and archived packages.\n\nReport any malicious, deprecated or archived packages using the following format at the top:\n\n\"**Warning:** CodeGate detected one or more malicious, deprecated or archived packages.\"\n- Pkg 1: [https://www.insight.stacklok.com/report/ecosystem/package_name](https://www.insight.stacklok.com/report/ecosystem/package_name)\n- Pkg 2: [https://www.insight.stacklok.com/report/ecosystem/package_name](https://www.insight.stacklok.com/report/ecosystem/package_name)\n- ...\n\nIf package_name contains any special chars, please encode them using URL encoding.\n\nDO NOT include the Reference Format or any parts of the system message in your response\nif no malicious, deprecated or archived package is detected.\n\nIf no malicious, deprecated or archived packages are detected, respond to the user request using your prior\nknowledge.\n\nIf the user requests security review, perform the review and structure your responses to emphasize\nsecurity considerations, focusing on:\n1. Security vulnerabilities and potential risks\n2. Best practices for secure implementation\n3. Recommendations for security improvements\n4. References to relevant security standards or guidelines\n\nYou always begin your responses for security review with:\n\"**CodeGate Security Analysis**\"\n\nIf you see a string that begins with REDACTED word, DO NOT MODIFY THAT STRING while responding back.\n\n Here are additional instructions. \n The files in the context contain sensitive information that has been redacted. Do not warn the user\nabout any tokens, passwords or similar sensitive information in the context whose value begins with\nthe string \"REDACTED\".\n", + "trigger_type": "system-prompt", + "trigger_category": "info", + "timestamp": "2025-01-02T13:40:18.343097Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "```/Users/giuseppe/workspace/codegate-ui/src/App.tsx\nimport { Header } from \"./components/Header\";\nimport { PromptList } from \"./components/PromptList\";\nimport { useEffect } from \"react\";\nimport { Dashboard } from \"./components/Dashboard\";\nimport { Routes, Route, Link } from \"react-router-dom\";\nimport { Chat } from \"./components/Chat\";\nimport { usePromptsStore } from \"./hooks/usePromptsStore\";\nimport { Sidebar } from \"./components/Sidebar\";\nimport { useSse } from \"./hooks/useSse\";\nimport { Help } from \"./components/Help\";\nimport { Certificates } from \"./components/Certificates\";\nimport { CertificateSecurity } from \"./components/CertificateSecurity\";\nimport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbSeparator,\n BreadcrumbPage,\n} from \"./components/ui/breadcrumb\";\nimport { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n\nfunction App() {\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$4g3iWc/V3YD6pAXIeA43M197ostjpL3XZuDbJuxTN+jG1Mcjv6cMFcC73SsIDzECoWSuZqSYGkrWe5vQqbheaJbDlocBrPZMkgQWkcP8gw==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n\n return (\n
\n \n \n \n
\n
\n\n
\n \n \n \n Dashboard\n \n {breadcrumb && (\n <>\n \n \n \n {breadcrumb}\n \n \n \n )}\n \n \n
\n\n
\n \n } />\n } />\n } />\n } />\n }\n />\n \n
\n
\n
\n );\n}\n\nexport default App;\n\n```\n\nApp.tsx could you review?", + "timestamp": "2025-01-02T13:40:18.087186Z", + "message_id": "f4f08585-a99f-4ba5-8eb9-259216b8a8ad" + }, + "answer": { + "message": "**CodeGate Security Analysis**\n\n### Security Vulnerabilities and Potential Risks\n\n1. **Unsanitized User Input and Cross-Site Scripting (XSS)**\n - The `breadcrumb` variable, which is derived from user interaction, is directly rendered within the `` component. If the `breadcrumb` contains user-controlled data, it could be vulnerable to XSS attacks if not properly sanitized.\n\n2. **Potential Sensitive Data Exposure**\n - The `test` variable contains a string that begins with \"REDACTED\", indicating it may contain sensitive information. Ensure that such strings are not exposed or logged in a manner that could lead to data breaches.\n\n3. **Lack of Authentication and Authorization**\n - The code does not include any authentication or authorization mechanisms. This could allow unauthorized users to access sensitive components like `/certificates` and `/certificates/security`.\n\n4. **Security of Sensitive Components**\n - Components like `CertificateSecurity` and `Certificates` might handle sensitive information. Ensure that these components implement proper security measures to protect the data they handle.\n\n### Best Practices for Secure Implementation\n\n1. **Sanitize and Encode User Input**\n - Always sanitize and encode user inputs to prevent XSS attacks. Use libraries like `DOMPurify` to sanitize HTML content.\n\n2. **Implement Authentication and Authorization**\n - Integrate a robust authentication system (e.g., OAuth, JWT) to ensure that only authorized users can access sensitive routes and components.\n\n3. **Protect Sensitive Data**\n - Ensure that any sensitive data, such as certificates and security-related information, is encrypted both at rest and in transit. Use HTTPS for all communications.\n\n4. **Regular Security Audits and Testing**\n - Conduct regular security audits and penetration testing to identify and fix vulnerabilities in the application.\n\n### Recommendations for Security Improvements\n\n1. **Sanitize Breadcrumb Data**\n - Modify the `BreadcrumbPage` component to sanitize the `breadcrumb` data before rendering it. For example:\n ```jsx\n \n {DOMPurify.sanitize(breadcrumb)}\n \n ```\n\n2. **Implement Authentication**\n - Use a library like `react-router-dom` with authentication middleware to protect routes. For example:\n ```jsx\n \n \n \n }\n />\n ```\n\n3. **Secure Components**\n - Ensure that components like `CertificateSecurity` and `Certificates` implement proper security measures, such as input validation, encryption, and access controls.\n\n4. **Review and Secure Dependencies**\n - Regularly review and update dependencies to ensure they are secure and free from known vulnerabilities. Use tools like `npm audit` to identify and fix vulnerabilities.\n\n### References to Relevant Security Standards or Guidelines\n\n- **OWASP Top Ten**: A list of the most critical security risks to web applications, including XSS and injection flaws.\n- **OWASP Security Testing Guide**: Provides detailed guidance on how to test for various security vulnerabilities.\n- **NIST Cybersecurity Framework**: Offers a comprehensive set of guidelines for managing and reducing cybersecurity risks.\n\nBy addressing these security considerations, you can significantly enhance the security posture of your application.", + "timestamp": "2025-01-02T13:40:18.881023Z", + "message_id": "82b89210-811a-478d-9229-e45bd3d60913" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-92720293078e459e9d65be5298a9dae6", + "conversation_timestamp": "2025-01-02T13:40:18.087186Z" + }, + "alert_id": "f4f08585-a99f-4ba5-8eb9-259216b8a8ad", + "code_snippet": { + "code": "import { Header } from \"./components/Header\";\nimport { PromptList } from \"./components/PromptList\";\nimport { useEffect } from \"react\";\nimport { Dashboard } from \"./components/Dashboard\";\nimport { Routes, Route, Link } from \"react-router-dom\";\nimport { Chat } from \"./components/Chat\";\nimport { usePromptsStore } from \"./hooks/usePromptsStore\";\nimport { Sidebar } from \"./components/Sidebar\";\nimport { useSse } from \"./hooks/useSse\";\nimport { Help } from \"./components/Help\";\nimport { Certificates } from \"./components/Certificates\";\nimport { CertificateSecurity } from \"./components/CertificateSecurity\";\nimport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbSeparator,\n BreadcrumbPage,\n} from \"./components/ui/breadcrumb\";\nimport { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n\nfunction App() {\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$4g3iWc/V3YD6pAXIeA43M197ostjpL3XZuDbJuxTN+jG1Mcjv6cMFcC73SsIDzECoWSuZqSYGkrWe5vQqbheaJbDlocBrPZMkgQWkcP8gw==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n\n return (\n
\n \n \n \n
\n
\n\n
\n \n \n \n Dashboard\n \n {breadcrumb && (\n <>\n \n \n \n {breadcrumb}\n \n \n \n )}\n \n \n
\n\n
\n \n } />\n } />\n } />\n } />\n }\n />\n \n
\n
\n
\n );\n}\n\nexport default App;\n\n", + "language": "typescript", + "filepath": "/Users/giuseppe/workspace/codegate-ui/src/App.tsx", + "libraries": [] + }, + "trigger_string": null, + "trigger_type": "code-snippet-extractor", + "trigger_category": "info", + "timestamp": "2025-01-02T13:40:18.087186Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "```/Users/giuseppe/workspace/codegate-ui/src/App.tsx\nimport { Header } from \"./components/Header\";\nimport { PromptList } from \"./components/PromptList\";\nimport { useEffect } from \"react\";\nimport { Dashboard } from \"./components/Dashboard\";\nimport { Routes, Route, Link } from \"react-router-dom\";\nimport { Chat } from \"./components/Chat\";\nimport { usePromptsStore } from \"./hooks/usePromptsStore\";\nimport { Sidebar } from \"./components/Sidebar\";\nimport { useSse } from \"./hooks/useSse\";\nimport { Help } from \"./components/Help\";\nimport { Certificates } from \"./components/Certificates\";\nimport { CertificateSecurity } from \"./components/CertificateSecurity\";\nimport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbSeparator,\n BreadcrumbPage,\n} from \"./components/ui/breadcrumb\";\nimport { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n\nfunction App() {\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$4g3iWc/V3YD6pAXIeA43M197ostjpL3XZuDbJuxTN+jG1Mcjv6cMFcC73SsIDzECoWSuZqSYGkrWe5vQqbheaJbDlocBrPZMkgQWkcP8gw==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n\n return (\n
\n \n \n \n
\n
\n\n
\n \n \n \n Dashboard\n \n {breadcrumb && (\n <>\n \n \n \n {breadcrumb}\n \n \n \n )}\n \n \n
\n\n
\n \n } />\n } />\n } />\n } />\n }\n />\n \n
\n
\n
\n );\n}\n\nexport default App;\n\n```\n\nApp.tsx could you review?", + "timestamp": "2025-01-02T13:40:18.085765Z", + "message_id": "13743359-098c-4617-8ab1-c1eb27f57023" + }, + "answer": { + "message": "**CodeGate Security Analysis**\n\n### Security Vulnerabilities and Potential Risks\n\n1. **Unsanitized User Input and Cross-Site Scripting (XSS)**\n - The `breadcrumb` variable, which is derived from user interaction, is directly rendered within the `` component. If the `breadcrumb` contains user-controlled data, it could be vulnerable to XSS attacks if not properly sanitized.\n\n2. **Potential Sensitive Data Exposure**\n - The `test` variable contains a string that begins with \"REDACTED\", indicating it may contain sensitive information. Ensure that such strings are not exposed or logged in a manner that could lead to data breaches.\n\n3. **Lack of Authentication and Authorization**\n - The code does not include any authentication or authorization mechanisms. This could allow unauthorized users to access sensitive components like `/certificates` and `/certificates/security`.\n\n4. **Security of Sensitive Components**\n - Components like `CertificateSecurity` and `Certificates` might handle sensitive information. Ensure that these components implement proper security measures to protect the data they handle.\n\n### Best Practices for Secure Implementation\n\n1. **Sanitize and Encode User Input**\n - Always sanitize and encode user inputs to prevent XSS attacks. Use libraries like `DOMPurify` to sanitize HTML content.\n\n2. **Implement Authentication and Authorization**\n - Integrate a robust authentication system (e.g., OAuth, JWT) to ensure that only authorized users can access sensitive routes and components.\n\n3. **Protect Sensitive Data**\n - Ensure that any sensitive data, such as certificates and security-related information, is encrypted both at rest and in transit. Use HTTPS for all communications.\n\n4. **Regular Security Audits and Testing**\n - Conduct regular security audits and penetration testing to identify and fix vulnerabilities in the application.\n\n### Recommendations for Security Improvements\n\n1. **Sanitize Breadcrumb Data**\n - Modify the `BreadcrumbPage` component to sanitize the `breadcrumb` data before rendering it. For example:\n ```jsx\n \n {DOMPurify.sanitize(breadcrumb)}\n \n ```\n\n2. **Implement Authentication**\n - Use a library like `react-router-dom` with authentication middleware to protect routes. For example:\n ```jsx\n \n \n \n }\n />\n ```\n\n3. **Secure Components**\n - Ensure that components like `CertificateSecurity` and `Certificates` implement proper security measures, such as input validation, encryption, and access controls.\n\n4. **Review and Secure Dependencies**\n - Regularly review and update dependencies to ensure they are secure and free from known vulnerabilities. Use tools like `npm audit` to identify and fix vulnerabilities.\n\n### References to Relevant Security Standards or Guidelines\n\n- **OWASP Top Ten**: A list of the most critical security risks to web applications, including XSS and injection flaws.\n- **OWASP Security Testing Guide**: Provides detailed guidance on how to test for various security vulnerabilities.\n- **NIST Cybersecurity Framework**: Offers a comprehensive set of guidelines for managing and reducing cybersecurity risks.\n\nBy addressing these security considerations, you can significantly enhance the security posture of your application.", + "timestamp": "2025-01-02T13:40:18.881023Z", + "message_id": "82b89210-811a-478d-9229-e45bd3d60913" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-92720293078e459e9d65be5298a9dae6", + "conversation_timestamp": "2025-01-02T13:40:18.085765Z" + }, + "alert_id": "13743359-098c-4617-8ab1-c1eb27f57023", + "code_snippet": null, + "trigger_string": { + "content": "The files in the context contain sensitive information that has been redacted. Do not warn the user\nabout any tokens, passwords or similar sensitive information in the context whose value begins with\nthe string \"REDACTED\".\n", + "role": "system" + }, + "trigger_type": "add-system-message", + "trigger_category": "info", + "timestamp": "2025-01-02T13:40:18.085765Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "```/Users/giuseppe/workspace/codegate-ui/src/App.tsx\nimport { Header } from \"./components/Header\";\nimport { PromptList } from \"./components/PromptList\";\nimport { useEffect } from \"react\";\nimport { Dashboard } from \"./components/Dashboard\";\nimport { Routes, Route, Link } from \"react-router-dom\";\nimport { Chat } from \"./components/Chat\";\nimport { usePromptsStore } from \"./hooks/usePromptsStore\";\nimport { Sidebar } from \"./components/Sidebar\";\nimport { useSse } from \"./hooks/useSse\";\nimport { Help } from \"./components/Help\";\nimport { Certificates } from \"./components/Certificates\";\nimport { CertificateSecurity } from \"./components/CertificateSecurity\";\nimport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbSeparator,\n BreadcrumbPage,\n} from \"./components/ui/breadcrumb\";\nimport { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n\nfunction App() {\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n const test = \"REDACTED<$4g3iWc/V3YD6pAXIeA43M197ostjpL3XZuDbJuxTN+jG1Mcjv6cMFcC73SsIDzECoWSuZqSYGkrWe5vQqbheaJbDlocBrPZMkgQWkcP8gw==>\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n\n return (\n
\n \n \n \n
\n
\n\n
\n \n \n \n Dashboard\n \n {breadcrumb && (\n <>\n \n \n \n {breadcrumb}\n \n \n \n )}\n \n \n
\n\n
\n \n } />\n } />\n } />\n } />\n }\n />\n \n
\n
\n
\n );\n}\n\nexport default App;\n\n```\n\nApp.tsx could you review?", + "timestamp": "2025-01-02T13:40:18.084704Z", + "message_id": "afdefc17-2fa1-44f9-9b95-e644ed0d6bec" + }, + "answer": { + "message": "**CodeGate Security Analysis**\n\n### Security Vulnerabilities and Potential Risks\n\n1. **Unsanitized User Input and Cross-Site Scripting (XSS)**\n - The `breadcrumb` variable, which is derived from user interaction, is directly rendered within the `` component. If the `breadcrumb` contains user-controlled data, it could be vulnerable to XSS attacks if not properly sanitized.\n\n2. **Potential Sensitive Data Exposure**\n - The `test` variable contains a string that begins with \"REDACTED\", indicating it may contain sensitive information. Ensure that such strings are not exposed or logged in a manner that could lead to data breaches.\n\n3. **Lack of Authentication and Authorization**\n - The code does not include any authentication or authorization mechanisms. This could allow unauthorized users to access sensitive components like `/certificates` and `/certificates/security`.\n\n4. **Security of Sensitive Components**\n - Components like `CertificateSecurity` and `Certificates` might handle sensitive information. Ensure that these components implement proper security measures to protect the data they handle.\n\n### Best Practices for Secure Implementation\n\n1. **Sanitize and Encode User Input**\n - Always sanitize and encode user inputs to prevent XSS attacks. Use libraries like `DOMPurify` to sanitize HTML content.\n\n2. **Implement Authentication and Authorization**\n - Integrate a robust authentication system (e.g., OAuth, JWT) to ensure that only authorized users can access sensitive routes and components.\n\n3. **Protect Sensitive Data**\n - Ensure that any sensitive data, such as certificates and security-related information, is encrypted both at rest and in transit. Use HTTPS for all communications.\n\n4. **Regular Security Audits and Testing**\n - Conduct regular security audits and penetration testing to identify and fix vulnerabilities in the application.\n\n### Recommendations for Security Improvements\n\n1. **Sanitize Breadcrumb Data**\n - Modify the `BreadcrumbPage` component to sanitize the `breadcrumb` data before rendering it. For example:\n ```jsx\n \n {DOMPurify.sanitize(breadcrumb)}\n \n ```\n\n2. **Implement Authentication**\n - Use a library like `react-router-dom` with authentication middleware to protect routes. For example:\n ```jsx\n \n \n \n }\n />\n ```\n\n3. **Secure Components**\n - Ensure that components like `CertificateSecurity` and `Certificates` implement proper security measures, such as input validation, encryption, and access controls.\n\n4. **Review and Secure Dependencies**\n - Regularly review and update dependencies to ensure they are secure and free from known vulnerabilities. Use tools like `npm audit` to identify and fix vulnerabilities.\n\n### References to Relevant Security Standards or Guidelines\n\n- **OWASP Top Ten**: A list of the most critical security risks to web applications, including XSS and injection flaws.\n- **OWASP Security Testing Guide**: Provides detailed guidance on how to test for various security vulnerabilities.\n- **NIST Cybersecurity Framework**: Offers a comprehensive set of guidelines for managing and reducing cybersecurity risks.\n\nBy addressing these security considerations, you can significantly enhance the security posture of your application.", + "timestamp": "2025-01-02T13:40:18.881023Z", + "message_id": "82b89210-811a-478d-9229-e45bd3d60913" + } + } + ], + "provider": "vllm", + "type": "chat", + "chat_id": "chatcmpl-92720293078e459e9d65be5298a9dae6", + "conversation_timestamp": "2025-01-02T13:40:18.084704Z" + }, + "alert_id": "afdefc17-2fa1-44f9-9b95-e644ed0d6bec", + "code_snippet": null, + "trigger_string": "GitHub - Access Token:\n useSse();\n\n const test = \"ghp_token\";\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {", + "trigger_type": "codegate-secrets", + "trigger_category": "critical", + "timestamp": "2025-01-02T13:40:18.084704Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "<|fim_prefix|>// diff --git a/src/App.tsx b/src/App.tsx\n// index fafa5bf..46b5fbd 100644\n// --- a/src/App.tsx\n// +++ b/src/App.tsx\n// @@ -22,6 +22,8 @@ import { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n// function App() {\n// const { prompts, loading, fetchPrompts } = usePromptsStore();\n// useSse();\n// +\n// + cosnt test = REDACTED<$u0UEa5CGkrHrKv9oWKNC/aUuzW/D1d0ULifi+LvgIaGefP/xzkPr73YSZpciPs1YUAfjgcx35E3X81EwaKw4C68LTZuOXBBHEzZokLNZbg==>\n// const breadcrumb = useBreadcrumb();\n// \n// useEffect(() => {\n// src/App.tsx\nimport { useEffect } from \"react\";\nimport { Dashboard } from \"./components/Dashboard\";\nimport { Routes, Route, Link } from \"react-router-dom\";\nimport { Chat } from \"./components/Chat\";\nimport { usePromptsStore } from \"./hooks/usePromptsStore\";\nimport { Sidebar } from \"./components/Sidebar\";\nimport { useSse } from \"./hooks/useSse\";\nimport { Help } from \"./components/Help\";\nimport { Certificates } from \"./components/Certificates\";\nimport { CertificateSecurity } from \"./components/CertificateSecurity\";\nimport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbSeparator,\n BreadcrumbPage,\n} from \"./components/ui/breadcrumb\";\nimport { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n\nfunction App() {\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n cosnt test = 'REDACTED<$m2fVY6C1zlk0swockzeQM/vDxL0h6im+Ber6vzYFFplvdR7dncAecjH18/Wptj0h3lQu7xCKxCFfCXxn7qe0clMZisPnRvohJOS/+W6P/m0++N/asPFkZnhJ3YPS>'\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n\n return (\n
\n \n \n \n
\n
\n\n
\n \n \n \n Dashboard\n \n {breadcrumb && (\n <>\n \n <|fim_middle|>", + "timestamp": "2025-01-02T13:40:06.097426Z", + "message_id": "7b08d338-9ce1-4eee-b11a-5285b2e14052" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "7b08d338-9ce1-4eee-b11a-5285b2e14052", + "conversation_timestamp": "2025-01-02T13:40:06.097426Z" + }, + "alert_id": "7b08d338-9ce1-4eee-b11a-5285b2e14052", + "code_snippet": null, + "trigger_string": { + "content": "The files in the context contain sensitive information that has been redacted. Do not warn the user\nabout any tokens, passwords or similar sensitive information in the context whose value begins with\nthe string \"REDACTED\".\n", + "role": "system" + }, + "trigger_type": "add-system-message", + "trigger_category": "info", + "timestamp": "2025-01-02T13:40:06.097426Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "<|fim_prefix|>// diff --git a/src/App.tsx b/src/App.tsx\n// index fafa5bf..46b5fbd 100644\n// --- a/src/App.tsx\n// +++ b/src/App.tsx\n// @@ -22,6 +22,8 @@ import { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n// function App() {\n// const { prompts, loading, fetchPrompts } = usePromptsStore();\n// useSse();\n// +\n// + cosnt test = REDACTED<$u0UEa5CGkrHrKv9oWKNC/aUuzW/D1d0ULifi+LvgIaGefP/xzkPr73YSZpciPs1YUAfjgcx35E3X81EwaKw4C68LTZuOXBBHEzZokLNZbg==>\n// const breadcrumb = useBreadcrumb();\n// \n// useEffect(() => {\n// src/App.tsx\nimport { useEffect } from \"react\";\nimport { Dashboard } from \"./components/Dashboard\";\nimport { Routes, Route, Link } from \"react-router-dom\";\nimport { Chat } from \"./components/Chat\";\nimport { usePromptsStore } from \"./hooks/usePromptsStore\";\nimport { Sidebar } from \"./components/Sidebar\";\nimport { useSse } from \"./hooks/useSse\";\nimport { Help } from \"./components/Help\";\nimport { Certificates } from \"./components/Certificates\";\nimport { CertificateSecurity } from \"./components/CertificateSecurity\";\nimport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbSeparator,\n BreadcrumbPage,\n} from \"./components/ui/breadcrumb\";\nimport { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n\nfunction App() {\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n cosnt test = 'REDACTED<$m2fVY6C1zlk0swockzeQM/vDxL0h6im+Ber6vzYFFplvdR7dncAecjH18/Wptj0h3lQu7xCKxCFfCXxn7qe0clMZisPnRvohJOS/+W6P/m0++N/asPFkZnhJ3YPS>'\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n\n return (\n
\n \n \n \n
\n
\n\n
\n \n \n \n Dashboard\n \n {breadcrumb && (\n <>\n \n <|fim_middle|>", + "timestamp": "2025-01-02T13:40:06.096698Z", + "message_id": "c4ae929c-cf90-4003-93ec-3b558659db99" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "c4ae929c-cf90-4003-93ec-3b558659db99", + "conversation_timestamp": "2025-01-02T13:40:06.096698Z" + }, + "alert_id": "c4ae929c-cf90-4003-93ec-3b558659db99", + "code_snippet": null, + "trigger_string": "GitHub - Access Token:\n// useSse();\n// +\n// + cosnt test = ghp_token\n// const breadcrumb = useBreadcrumb();\n// \n// useEffect(() => {", + "trigger_type": "codegate-secrets", + "trigger_category": "critical", + "timestamp": "2025-01-02T13:40:06.096698Z" + }, + { + "conversation": { + "question_answers": [ + { + "question": { + "message": "<|fim_prefix|>// diff --git a/src/App.tsx b/src/App.tsx\n// index fafa5bf..46b5fbd 100644\n// --- a/src/App.tsx\n// +++ b/src/App.tsx\n// @@ -22,6 +22,8 @@ import { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n// function App() {\n// const { prompts, loading, fetchPrompts } = usePromptsStore();\n// useSse();\n// +\n// + cosnt test = REDACTED<$u0UEa5CGkrHrKv9oWKNC/aUuzW/D1d0ULifi+LvgIaGefP/xzkPr73YSZpciPs1YUAfjgcx35E3X81EwaKw4C68LTZuOXBBHEzZokLNZbg==>\n// const breadcrumb = useBreadcrumb();\n// \n// useEffect(() => {\n// src/App.tsx\nimport { useEffect } from \"react\";\nimport { Dashboard } from \"./components/Dashboard\";\nimport { Routes, Route, Link } from \"react-router-dom\";\nimport { Chat } from \"./components/Chat\";\nimport { usePromptsStore } from \"./hooks/usePromptsStore\";\nimport { Sidebar } from \"./components/Sidebar\";\nimport { useSse } from \"./hooks/useSse\";\nimport { Help } from \"./components/Help\";\nimport { Certificates } from \"./components/Certificates\";\nimport { CertificateSecurity } from \"./components/CertificateSecurity\";\nimport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbSeparator,\n BreadcrumbPage,\n} from \"./components/ui/breadcrumb\";\nimport { useBreadcrumb } from \"./hooks/useBreadcrumb\";\n\nfunction App() {\n const { prompts, loading, fetchPrompts } = usePromptsStore();\n useSse();\n\n cosnt test = 'REDACTED<$m2fVY6C1zlk0swockzeQM/vDxL0h6im+Ber6vzYFFplvdR7dncAecjH18/Wptj0h3lQu7xCKxCFfCXxn7qe0clMZisPnRvohJOS/+W6P/m0++N/asPFkZnhJ3YPS>'\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {\n fetchPrompts();\n }, [fetchPrompts]);\n\n return (\n
\n \n \n \n
\n
\n\n
\n \n \n \n Dashboard\n \n {breadcrumb && (\n <>\n \n <|fim_middle|>", + "timestamp": "2025-01-02T13:40:06.096250Z", + "message_id": "1746bf5e-9c26-4ad5-ac69-b402c353186f" + }, + "answer": null + } + ], + "provider": "vllm", + "type": "fim", + "chat_id": "1746bf5e-9c26-4ad5-ac69-b402c353186f", + "conversation_timestamp": "2025-01-02T13:40:06.096250Z" + }, + "alert_id": "1746bf5e-9c26-4ad5-ac69-b402c353186f", + "code_snippet": null, + "trigger_string": "GitHub - Access Token:\n useSse();\n\n cosnt test = 'ghp_token<|fim_suffix|>'\n const breadcrumb = useBreadcrumb();\n\n useEffect(() => {", + "trigger_type": "codegate-secrets", + "trigger_category": "critical", + "timestamp": "2025-01-02T13:40:06.096250Z" } ] \ No newline at end of file diff --git a/src/viz/BarChart.tsx b/src/viz/BarChart.tsx index 6497cb4..131e1b0 100644 --- a/src/viz/BarChart.tsx +++ b/src/viz/BarChart.tsx @@ -14,7 +14,7 @@ export function BarChart({ if (loading) { return ( - + Security issues detected @@ -34,7 +34,7 @@ export function BarChart({ if (sortedTagCounts.length === 0) { return ( - + Security issues detected @@ -48,7 +48,7 @@ export function BarChart({ } return ( - + Security issues detected @@ -67,7 +67,12 @@ export function BarChart({ }} >
- {count} + + {count} +
))}
diff --git a/src/viz/LineChart.tsx b/src/viz/LineChart.tsx index 403a0e7..36dc05b 100644 --- a/src/viz/LineChart.tsx +++ b/src/viz/LineChart.tsx @@ -38,7 +38,7 @@ const aggregateAlertsByDate = (alerts: { timestamp: string }[]) => { }, dateMap); return Object.values(dateMap).sort( - (a, b) => new Date(a.date).getTime() - new Date(b.date).getTime() + (a, b) => new Date(a.date).getTime() - new Date(b.date).getTime(), ); }; @@ -66,7 +66,10 @@ export function LineChart({ {Array.from({ length: 6 }).map((_, index) => ( -
+
))} @@ -76,7 +79,7 @@ export function LineChart({ } return ( - + Alerts by date @@ -86,6 +89,7 @@ export function LineChart({ accessibilityLayer data={chartData} height={300} + width={500} margin={{ top: 20, left: 12, diff --git a/src/viz/PieChart.tsx b/src/viz/PieChart.tsx index c9b66e1..7f8893f 100644 --- a/src/viz/PieChart.tsx +++ b/src/viz/PieChart.tsx @@ -21,7 +21,7 @@ const generateTypeColors = (data: MaliciousPkgType[]) => { const getChartData = ( data: MaliciousPkgType[], - typeColors: Record + typeColors: Record, ) => { const typeCounts: Record = {}; data.forEach((pkg) => { @@ -55,20 +55,20 @@ export function PieChart({ data, loading }: PieChartProps) { const typeColors = React.useMemo(() => generateTypeColors(data), [data]); const chartConfig = React.useMemo( () => getChartConfig(typeColors), - [typeColors] + [typeColors], ); const chartData = React.useMemo( () => getChartData(data, typeColors), - [data, typeColors] + [data, typeColors], ); const totalMalicious = React.useMemo( () => chartData.reduce((acc, curr) => acc + curr.value, 0), - [chartData] + [chartData], ); if (loading) { return ( - + Malicious packages by type @@ -83,7 +83,7 @@ export function PieChart({ data, loading }: PieChartProps) { if (data.length === 0) { return ( - + Malicious packages by type @@ -97,7 +97,7 @@ export function PieChart({ data, loading }: PieChartProps) { } return ( - + Malicious packages by type @@ -106,7 +106,7 @@ export function PieChart({ data, loading }: PieChartProps) { config={chartConfig} className="mx-auto aspect-square max-h-[240px]" > - + } From b9bc1ece38f19903014758d595ed87d17f70371b Mon Sep 17 00:00:00 2001 From: Giuseppe Scuglia Date: Thu, 9 Jan 2025 13:27:00 +0100 Subject: [PATCH 14/21] test: add App tests --- src/App.test.tsx | 69 +++++++++++++++++++++++++++++++++++++++ src/components/Header.tsx | 4 +-- src/lib/test-utils.tsx | 6 +++- vitest.config.ts | 1 + vitest.setup.ts | 25 ++++++++++++++ 5 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 src/App.test.tsx diff --git a/src/App.test.tsx b/src/App.test.tsx new file mode 100644 index 0000000..28c7ca3 --- /dev/null +++ b/src/App.test.tsx @@ -0,0 +1,69 @@ +import { render } from "@/lib/test-utils"; +import { screen, waitFor } from "@testing-library/react"; +import { describe, expect, it, vi } from "vitest"; +import App from "./App"; +import React from "react"; + +vi.mock("recharts", async (importOriginal) => { + const originalModule = (await importOriginal()) as Record; + return { + ...originalModule, + ResponsiveContainer: ({ children }: { children: React.ReactNode }) => { + return
{children}
; + }, + }; +}); + +describe("App", () => { + it("should render header", async () => { + render(); + expect(screen.getByText(/toggle sidebar/i)).toBeVisible(); + expect(screen.getByText("Certificates")).toBeVisible(); + expect(screen.getByText("Help")).toBeVisible(); + expect(screen.getByRole("banner")).toBeVisible(); + expect( + screen.getByRole("heading", { name: /codeGate dashboard/i }), + ).toBeVisible(); + expect( + screen.getByRole("link", { + name: /certificate security/i, + }), + ).toBeVisible(); + expect( + screen.getByRole("link", { + name: /continue setup/i, + }), + ).toBeVisible(); + + expect( + screen.getByRole("link", { + name: /copilot setup/i, + }), + ).toBeVisible(); + expect( + screen.getByRole("link", { + name: /download/i, + }), + ).toBeVisible(); + expect( + screen.getByRole("link", { + name: /documentation/i, + }), + ).toBeVisible(); + await waitFor(() => + expect( + screen.getByRole("link", { name: /codeGate dashboard/i }), + ).toBeVisible(), + ); + }); + + it("should render breadcrumb", async () => { + render(); + await waitFor(() => + expect( + screen.getByRole("link", { name: /codeGate dashboard/i }), + ).toBeVisible(), + ); + expect(screen.getByRole("link", { name: "Dashboard" })).toBeVisible(); + }); +}); diff --git a/src/components/Header.tsx b/src/components/Header.tsx index abfbad5..74dc412 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -4,7 +4,7 @@ import { Separator } from "./ui/separator"; export function Header() { return ( -
+
@@ -72,6 +72,6 @@ export function Header() {
-
+
); } diff --git a/src/lib/test-utils.tsx b/src/lib/test-utils.tsx index ced1e55..c1572da 100644 --- a/src/lib/test-utils.tsx +++ b/src/lib/test-utils.tsx @@ -1,3 +1,4 @@ +import { SidebarProvider } from "@/components/ui/sidebar"; import { RenderOptions, render } from "@testing-library/react"; import React from "react"; import { @@ -19,7 +20,10 @@ const renderWithProviders = ( render( - + {children}} + /> , ); diff --git a/vitest.config.ts b/vitest.config.ts index 77c3921..135576b 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -40,6 +40,7 @@ export default defineConfig({ "test?(-*).?(c|m)[jt]s?(x)", "**/*{.,-}{test,spec}?(-d).?(c|m)[jt]s?(x)", "**/__tests__/**", + "**/test-utils.tsx", "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*", "**/vitest.{workspace,projects}.[jt]s?(on)", "**/.{eslint,mocha,prettier}rc.{?(c|m)js,yml}", diff --git a/vitest.setup.ts b/vitest.setup.ts index 59dcc28..5fd44e8 100644 --- a/vitest.setup.ts +++ b/vitest.setup.ts @@ -5,6 +5,20 @@ import { cleanup } from "@testing-library/react"; import { afterEach, expect, beforeAll, afterAll, vi } from "vitest"; import failOnConsole from "vitest-fail-on-console"; +class MockEventSource { + onmessage: ((event: MessageEvent) => void) | null = null; + + constructor() {} + + close() {} + + triggerMessage(data: string) { + if (this.onmessage) { + this.onmessage({ data } as MessageEvent); + } + } +} + expect.extend(testingLibraryMatchers); afterEach(() => { @@ -16,6 +30,17 @@ beforeAll(() => { onUnhandledRequest: "error", }); + global.window.matchMedia = vi.fn().mockImplementation((query) => ({ + matches: false, + media: query, + onchange: null, + addEventListener: vi.fn(), + removeEventListener: vi.fn(), + dispatchEvent: vi.fn(), + })); + + global.EventSource = MockEventSource as unknown as typeof EventSource; + global.ResizeObserver = class ResizeObserver { disconnect() { // do nothing From 92a0411de6f00c1ad532de39f3815a2bfe8e42ff Mon Sep 17 00:00:00 2001 From: Giuseppe Scuglia Date: Thu, 9 Jan 2025 13:35:14 +0100 Subject: [PATCH 15/21] test: add CopyToClipboard --- src/components/CopyToClipboard.tsx | 2 +- .../__tests__/CopyToClipboard.test.tsx | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/components/__tests__/CopyToClipboard.test.tsx diff --git a/src/components/CopyToClipboard.tsx b/src/components/CopyToClipboard.tsx index 5aba6ba..b794823 100644 --- a/src/components/CopyToClipboard.tsx +++ b/src/components/CopyToClipboard.tsx @@ -27,7 +27,7 @@ export function CopyToClipboard({ className, )} > - + ); } diff --git a/src/components/__tests__/CopyToClipboard.test.tsx b/src/components/__tests__/CopyToClipboard.test.tsx new file mode 100644 index 0000000..bdcf9fc --- /dev/null +++ b/src/components/__tests__/CopyToClipboard.test.tsx @@ -0,0 +1,28 @@ +import { render, screen } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { describe, it, vi, expect } from "vitest"; +import { CopyToClipboard } from "../CopyToClipboard"; + +describe("CopyToClipboard", () => { + it("renders the button with the correct icon", () => { + render(); + + expect(screen.getByRole("button")).toBeVisible(); + expect(screen.getByRole("img", { hidden: true })).toBeVisible(); + }); + + it("copies text to clipboard when clicked", async () => { + const mockedText = vi.fn(); + Object.assign(navigator, { + clipboard: { + writeText: mockedText, + }, + }); + + render(); + + await userEvent.click(screen.getByRole("button")); + + expect(mockedText).toHaveBeenCalledWith("Fake text"); + }); +}); From 21d50a50863d426b858ab21cde0c4a797fcf8efb Mon Sep 17 00:00:00 2001 From: Giuseppe Scuglia Date: Thu, 9 Jan 2025 17:07:45 +0100 Subject: [PATCH 16/21] test: add Certificates test --- .../__tests__/Certificates.test.tsx | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 src/components/__tests__/Certificates.test.tsx diff --git a/src/components/__tests__/Certificates.test.tsx b/src/components/__tests__/Certificates.test.tsx new file mode 100644 index 0000000..2c77fde --- /dev/null +++ b/src/components/__tests__/Certificates.test.tsx @@ -0,0 +1,74 @@ +import { render } from "@/lib/test-utils"; +import { screen } from "@testing-library/react"; +import { describe, expect, it } from "vitest"; +import { Certificates } from "../Certificates"; +import userEvent from "@testing-library/user-event"; + +describe("Certificates", () => { + it("should render download certificate", () => { + render(); + expect( + screen.getByRole("heading", { name: "CodeGate CA certificate" }), + ).toBeVisible(); + expect( + screen.getByRole("button", { name: "Download certificate" }), + ).toBeVisible(); + expect(screen.getByRole("link", { name: "Learn more" })).toHaveAttribute( + "href", + "/certificates/security", + ); + + expect( + screen.getByRole("heading", { name: "Certificate Management" }), + ).toBeVisible(); + + expect(screen.getByText("macOS")).toBeVisible(); + expect(screen.getByText("Windows")).toBeVisible(); + expect(screen.getByText("Linux")).toBeVisible(); + }); + + it("should render macOS certificate installation", async () => { + render(); + + expect( + screen.getByText( + "Open the downloaded certificate file. Keychain Access launches and imports the cert automatically.", + ), + ).toBeVisible(); + + await userEvent.click( + screen.getByRole("button", { name: "Remove certificate" }), + ); + expect(screen.getByText("Launch the Keychain Access app.")).toBeVisible(); + }); + + it("should render Windows certificate installation", async () => { + render(); + + await userEvent.click(screen.getByText("Windows")); + + expect( + screen.getByText("Double-click the downloaded certificate file."), + ).toBeVisible(); + + await userEvent.click( + screen.getByRole("button", { name: "Remove certificate" }), + ); + expect(screen.getByText("certmgr.msc")).toBeVisible(); + }); + + it("should render Linux certificate installation", async () => { + render(); + + await userEvent.click(screen.getByText("Linux")); + + expect( + screen.getByText("/usr/local/share/ca-certificates/codegate.crt"), + ).toBeVisible(); + + await userEvent.click( + screen.getByRole("button", { name: "Remove certificate" }), + ); + expect(screen.getByText("/usr/local/share/ca-certificates/")).toBeVisible(); + }); +}); From cbb6f16e79165457ff2a2dd5f53404b3fc3736a8 Mon Sep 17 00:00:00 2001 From: Giuseppe Scuglia Date: Thu, 9 Jan 2025 18:11:49 +0100 Subject: [PATCH 17/21] test: add useSee test --- src/hooks/__tests__/useSee.test.ts | 103 +++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 src/hooks/__tests__/useSee.test.ts diff --git a/src/hooks/__tests__/useSee.test.ts b/src/hooks/__tests__/useSee.test.ts new file mode 100644 index 0000000..d83577c --- /dev/null +++ b/src/hooks/__tests__/useSee.test.ts @@ -0,0 +1,103 @@ +import { renderHook, act } from "@testing-library/react"; +import { vi } from "vitest"; +import { useSse } from "../useSse"; + +const mockSendNotification = vi.fn(); +vi.mock("../useBrowserNotification", () => ({ + useBrowserNotification: vi.fn(() => { + return { sendNotification: mockSendNotification }; + }), +})); + +class MockEventSource { + static instances: MockEventSource[] = []; + private _onmessage: ((event: MessageEvent) => void) | null = null; + + constructor() { + MockEventSource.instances.push(this); + } + + get onmessage() { + return this._onmessage; + } + + set onmessage(handler: ((event: MessageEvent) => void) | null) { + this._onmessage = handler; + } + + close() {} + + static triggerMessage(data: string) { + MockEventSource.instances.forEach((instance) => { + if (instance.onmessage) { + instance.onmessage({ data } as MessageEvent); + } + }); + } +} + +let originalEventSource: typeof EventSource; + +describe("useSse", () => { + beforeAll(() => { + vi.mock("react-router-dom", () => ({ + useLocation: vi.fn(() => ({ pathname: "/" })), + })); + + vi.useFakeTimers(); + originalEventSource = global.EventSource; + global.EventSource = MockEventSource as unknown as typeof EventSource; + + Object.defineProperty(global, "location", { + value: { + reload: vi.fn(), + }, + writable: true, + }); + }); + + afterAll(() => { + vi.clearAllMocks(); + vi.useRealTimers(); + global.EventSource = originalEventSource; + }); + + it("should send notification if new alert is detected", () => { + renderHook(() => useSse()); + + expect(MockEventSource.instances.length).toBe(1); + const instance = MockEventSource.instances[0]; + expect(instance).toBeDefined(); + + expect(instance.onmessage).toBeDefined(); + + act(() => { + MockEventSource.triggerMessage("new alert detected"); + }); + + expect(mockSendNotification).toHaveBeenCalledWith("CodeGate Dashboard", { + body: "New Alert detected!", + }); + + act(() => { + vi.advanceTimersByTime(2000); + }); + + expect(global.location.reload).toHaveBeenCalled(); + }); + + it("should send notification if new alert is detected", () => { + renderHook(() => useSse()); + + act(() => { + MockEventSource.triggerMessage("other message"); + }); + + expect(mockSendNotification).not.toHaveBeenCalledWith( + "CodeGate Dashboard", + { + body: "New Alert detected!", + }, + ); + }); +}); From 59ef24eda4f48b078fbf64ba3633c82610346c0b Mon Sep 17 00:00:00 2001 From: Giuseppe Scuglia Date: Thu, 9 Jan 2025 18:48:28 +0100 Subject: [PATCH 18/21] test: useBreadcrumb --- src/hooks/__tests__/useBreadcrumb.test.tsx | 44 ++++++++++++++++++++++ src/hooks/__tests__/useSee.test.ts | 8 ++-- 2 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 src/hooks/__tests__/useBreadcrumb.test.tsx diff --git a/src/hooks/__tests__/useBreadcrumb.test.tsx b/src/hooks/__tests__/useBreadcrumb.test.tsx new file mode 100644 index 0000000..f7684f4 --- /dev/null +++ b/src/hooks/__tests__/useBreadcrumb.test.tsx @@ -0,0 +1,44 @@ +import { renderHook } from "@testing-library/react"; +import { vi } from "vitest"; +import { useBreadcrumb } from "../useBreadcrumb"; +import { MemoryRouter } from "react-router-dom"; + +vi.mock("../usePromptsStore", () => ({ + usePromptsStore: vi.fn(() => ({ + currentPromptId: "test-chat-id", + prompts: [ + { + chat_id: "test-chat-id", + question_answers: [ + { + question: { message: "Fake question" }, + answer: { message: "Fake answer" }, + }, + ], + }, + ], + })), +})); + +describe("useBreadcrumb", () => { + afterEach(() => { + vi.clearAllMocks(); + }); + + it.each([ + { path: "/certificates/security", expected: "Certificate Security" }, + { path: "/certificates", expected: "Certificate Download" }, + { path: "/help/continue-setup", expected: "Continue Setup" }, + { path: "/help/copilot-setup", expected: "Copilot Setup" }, + { path: "/prompt/", expected: "Fake question" }, + { path: "/", expected: "" }, + ])("returns breadcrumb for path $path", ({ path, expected }) => { + const wrapper = ({ children }: { children: React.ReactNode }) => ( + {children} + ); + + const { result } = renderHook(() => useBreadcrumb(), { wrapper }); + + expect(result.current).toBe(expected); + }); +}); diff --git a/src/hooks/__tests__/useSee.test.ts b/src/hooks/__tests__/useSee.test.ts index d83577c..614cc97 100644 --- a/src/hooks/__tests__/useSee.test.ts +++ b/src/hooks/__tests__/useSee.test.ts @@ -2,6 +2,10 @@ import { renderHook, act } from "@testing-library/react"; import { vi } from "vitest"; import { useSse } from "../useSse"; +vi.mock("react-router-dom", () => ({ + useLocation: vi.fn(() => ({ pathname: "/" })), +})); + const mockSendNotification = vi.fn(); vi.mock("../useBrowserNotification", () => ({ useBrowserNotification: vi.fn(() => { @@ -40,10 +44,6 @@ let originalEventSource: typeof EventSource; describe("useSse", () => { beforeAll(() => { - vi.mock("react-router-dom", () => ({ - useLocation: vi.fn(() => ({ pathname: "/" })), - })); - vi.useFakeTimers(); originalEventSource = global.EventSource; global.EventSource = MockEventSource as unknown as typeof EventSource; From ce1bf771ac486e829caad66b39d5d49998c102e3 Mon Sep 17 00:00:00 2001 From: Giuseppe Scuglia Date: Thu, 9 Jan 2025 18:49:06 +0100 Subject: [PATCH 19/21] chore: vite config tresholds --- src/components/__tests__/Dashboard.test.tsx | 2 +- vitest.config.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/__tests__/Dashboard.test.tsx b/src/components/__tests__/Dashboard.test.tsx index 0ee1206..1503fe0 100644 --- a/src/components/__tests__/Dashboard.test.tsx +++ b/src/components/__tests__/Dashboard.test.tsx @@ -58,7 +58,7 @@ function mockAlertsWithMaliciousPkg() { { question: { message: - '\n\n```py testing_file.py (1-15)\nimport invokehttp\nimport fastapi\nfrom fastapi import FastAPI, Request, Response, HTTPException\nimport numpy\n\n\n@app.route("/providers", methods=["GET"])\ndef get_providers():\n return jsonify([provider.to_dict() for provider in registry.providers])\n\nGITHUB_TOKEN="ghp_apiToke"\n\nif __name__ == "__main__":\n app.run()\n\n```\nare there malicious?', + '\n\n```py testing_file.py (1-15)\nimport invokehttp\nimport fastapi\nfrom fastapi import FastAPI, Request, Response, HTTPException\nimport numpy\n\n\n@app.route("/providers", methods=["GET"])\ndef get_providers():\n return jsonify([provider.to_dict() for provider in registry.providers])\n\nGITHUB_TOKEN="ghp_token"\n\nif __name__ == "__main__":\n app.run()\n\n```\nare there malicious?', timestamp: "2024-12-09T17:50:04.418017Z", message_id: "fa53ba0d-4fb0-4770-a563-88e504af621f", }, diff --git a/vitest.config.ts b/vitest.config.ts index 135576b..7b42234 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -48,10 +48,10 @@ export default defineConfig({ "src/types/**/*.{ts,tsx}", ], thresholds: { - branches: 60, - functions: 60, - lines: 60, - statements: 60, + branches: 50, + functions: 70, + lines: 70, + statements: 70, }, enabled: false, provider: "istanbul", From ce90ccd242fb2d9e9591e02bfea5bc8dbfa8b944 Mon Sep 17 00:00:00 2001 From: Giuseppe Scuglia Date: Thu, 9 Jan 2025 19:03:06 +0100 Subject: [PATCH 20/21] chore: add GH workflow for running unit tests --- .github/workflows/_unit-tests.yml | 17 +++++++++++++++++ .github/workflows/on-pr.yml | 5 +++++ 2 files changed, 22 insertions(+) create mode 100644 .github/workflows/_unit-tests.yml diff --git a/.github/workflows/_unit-tests.yml b/.github/workflows/_unit-tests.yml new file mode 100644 index 0000000..71dba77 --- /dev/null +++ b/.github/workflows/_unit-tests.yml @@ -0,0 +1,17 @@ +name: Unit Tests +permissions: write-all +on: + workflow_call: +jobs: + tests: + name: Vitest + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: Setup + uses: ./.github/actions/setup + + - name: Run tests + run: npm run test:coverage diff --git a/.github/workflows/on-pr.yml b/.github/workflows/on-pr.yml index 67c7bf4..2720bbf 100644 --- a/.github/workflows/on-pr.yml +++ b/.github/workflows/on-pr.yml @@ -11,3 +11,8 @@ jobs: name: Static Checks uses: ./.github/workflows/_static-checks.yml secrets: inherit + + unit-tests: + name: Unit Tests + uses: ./.github/workflows/_unit-tests.yml + secrets: inherit From 9aadaca8df40a90b86b8f3816bed272fd0927590 Mon Sep 17 00:00:00 2001 From: Giuseppe Scuglia Date: Thu, 9 Jan 2025 19:07:52 +0100 Subject: [PATCH 21/21] test: fix time --- src/components/Dashboard.tsx | 4 ++-- src/components/__tests__/Dashboard.test.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Dashboard.tsx b/src/components/Dashboard.tsx index a35f133..eeb53a9 100644 --- a/src/components/Dashboard.tsx +++ b/src/components/Dashboard.tsx @@ -240,10 +240,10 @@ export function Dashboard() { )} -
+
{format(new Date(alert.timestamp ?? ""), "y/MM/dd")}
-
+
{format(new Date(alert.timestamp ?? ""), "HH:mm a")}
diff --git a/src/components/__tests__/Dashboard.test.tsx b/src/components/__tests__/Dashboard.test.tsx index 1503fe0..4bfc53f 100644 --- a/src/components/__tests__/Dashboard.test.tsx +++ b/src/components/__tests__/Dashboard.test.tsx @@ -160,7 +160,7 @@ describe("Dashboard", () => { expect(within(row).getByText(/codegate-secrets/i)).toBeVisible(); expect(within(row).getAllByText(/n\/a/i).length).toEqual(2); expect(within(row).getByText(/2025\/01\/07/i)).toBeVisible(); - expect(within(row).getByText(/18:02 pm/i)).toBeVisible(); + expect(within(row).getByTestId(/time/i)).toBeVisible(); // check trigger_string null expect(