From 1929259257a7c2e9693e861e5022cc1c89b29ce9 Mon Sep 17 00:00:00 2001 From: SteakFisher Date: Sun, 9 Jun 2024 06:45:02 +0400 Subject: [PATCH 1/7] Firebase and firestore setup done --- environment.d.ts | 18 + next.config.mjs | 10 + package-lock.json | 2238 +++++++++++++++++++++++++++++++++++- package.json | 6 +- src/actions/validations.ts | 17 +- src/helpers/firebase.ts | 30 + 6 files changed, 2275 insertions(+), 44 deletions(-) create mode 100644 environment.d.ts create mode 100644 src/helpers/firebase.ts diff --git a/environment.d.ts b/environment.d.ts new file mode 100644 index 0000000..1807677 --- /dev/null +++ b/environment.d.ts @@ -0,0 +1,18 @@ +declare global { + namespace NodeJS { + interface ProcessEnv { + API_KEY: string; + AUTH_DOMAIN: string; + PROJECT_ID: string; + STORAGE_BUCKET: string; + MESSAGING_SENDER_ID: string; + APP_ID: string; + + FIREBASE_SERVICE_ACCOUNT_KEY: string; + } + } +} + +// If this file has no import/export statements (i.e. is a script) +// convert it into a module by adding an empty export statement. +export {} \ No newline at end of file diff --git a/next.config.mjs b/next.config.mjs index 5af1b3b..f23b7e5 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,5 +1,15 @@ /** @type {import('next').NextConfig} */ const nextConfig = { + experimental: { + turbo: { + rules: { + '*.svg': { + loaders: ['@svgr/webpack'], + as: '*.js', + }, + }, + }, + }, webpack(config) { // Grab the existing rule that handles SVG imports const fileLoaderRule = config.module.rules.find((rule) => diff --git a/package-lock.json b/package-lock.json index 5e17ff0..7fe19f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,6 +46,8 @@ "cmdk": "^0.2.1", "date-fns": "^3.3.1", "embla-carousel-react": "^8.0.0-rc22", + "firebase": "^10.12.2", + "firebase-admin": "^12.1.1", "get-video-id": "^4.1.5", "lucide-react": "^0.364.0", "next": "^14.2.3", @@ -66,7 +68,7 @@ "devDependencies": { "@svgr/webpack": "^8.1.0", "@types/autosize": "^4.0.3", - "@types/node": "^20", + "@types/node": "^20.14.2", "@types/react": "^18", "@types/react-dom": "^18", "@types/uuid": "^9.0.8", @@ -2284,6 +2286,562 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/@firebase/analytics": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.10.4.tgz", + "integrity": "sha512-OJEl/8Oye/k+vJ1zV/1L6eGpc1XzAj+WG2TPznJ7PszL7sOFLBXkL9IjHfOCGDGpXeO3btozy/cYUqv4zgNeHg==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.6.7", + "@firebase/installations": "0.6.7", + "@firebase/logger": "0.4.2", + "@firebase/util": "1.9.6", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app": "0.x" + } + }, + "node_modules/@firebase/analytics-compat": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/@firebase/analytics-compat/-/analytics-compat-0.2.10.tgz", + "integrity": "sha512-ia68RcLQLLMFWrM10JfmFod7eJGwqr4/uyrtzHpTDnxGX/6gNCBTOuxdAbyWIqXI5XmcMQdz9hDijGKOHgDfPw==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/analytics": "0.10.4", + "@firebase/analytics-types": "0.8.2", + "@firebase/component": "0.6.7", + "@firebase/util": "1.9.6", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app-compat": "0.x" + } + }, + "node_modules/@firebase/analytics-types": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.8.2.tgz", + "integrity": "sha512-EnzNNLh+9/sJsimsA/FGqzakmrAUKLeJvjRHlg8df1f97NLUlFidk9600y0ZgWOp3CAxn6Hjtk+08tixlUOWyw==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/app": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.10.5.tgz", + "integrity": "sha512-iY/fNot+hWPk9sTX8aHMqlcX9ynRvpGkskWAdUZ2eQQdLo8d1hSFYcYNwPv0Q/frGMasw8udKWMcFOEpC9fG8g==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.6.7", + "@firebase/logger": "0.4.2", + "@firebase/util": "1.9.6", + "idb": "7.1.1", + "tslib": "^2.1.0" + } + }, + "node_modules/@firebase/app-check": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/@firebase/app-check/-/app-check-0.8.4.tgz", + "integrity": "sha512-2tjRDaxcM5G7BEpytiDcIl+NovV99q8yEqRMKDbn4J4i/XjjuThuB4S+4PkmTnZiCbdLXQiBhkVxNlUDcfog5Q==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.6.7", + "@firebase/logger": "0.4.2", + "@firebase/util": "1.9.6", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app": "0.x" + } + }, + "node_modules/@firebase/app-check-compat": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@firebase/app-check-compat/-/app-check-compat-0.3.11.tgz", + "integrity": "sha512-t01zaH3RJpKEey0nGduz3Is+uSz7Sj4U5nwOV6lWb+86s5xtxpIvBJzu/lKxJfYyfZ29eJwpdjEgT1/lm4iQyA==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/app-check": "0.8.4", + "@firebase/app-check-types": "0.5.2", + "@firebase/component": "0.6.7", + "@firebase/logger": "0.4.2", + "@firebase/util": "1.9.6", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app-compat": "0.x" + } + }, + "node_modules/@firebase/app-check-interop-types": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@firebase/app-check-interop-types/-/app-check-interop-types-0.3.2.tgz", + "integrity": "sha512-LMs47Vinv2HBMZi49C09dJxp0QT5LwDzFaVGf/+ITHe3BlIhUiLNttkATSXplc89A2lAaeTqjgqVkiRfUGyQiQ==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/app-check-types": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@firebase/app-check-types/-/app-check-types-0.5.2.tgz", + "integrity": "sha512-FSOEzTzL5bLUbD2co3Zut46iyPWML6xc4x+78TeaXMSuJap5QObfb+rVvZJtla3asN4RwU7elaQaduP+HFizDA==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/app-compat": { + "version": "0.2.35", + "resolved": "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.2.35.tgz", + "integrity": "sha512-vgay/WRjeH0r97/Q6L6df2CMx7oyNFDsE5yPQ9oR1G+zx2eT0s8vNNh0WlKqQxUEWaOLRnXhQ8gy7uu0cBgTRg==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/app": "0.10.5", + "@firebase/component": "0.6.7", + "@firebase/logger": "0.4.2", + "@firebase/util": "1.9.6", + "tslib": "^2.1.0" + } + }, + "node_modules/@firebase/app-types": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.2.tgz", + "integrity": "sha512-oMEZ1TDlBz479lmABwWsWjzHwheQKiAgnuKxE0pz0IXCVx7/rtlkx1fQ6GfgK24WCrxDKMplZrT50Kh04iMbXQ==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/auth": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-1.7.4.tgz", + "integrity": "sha512-d2Fw17s5QesojwebrA903el20Li9/YGgkoOGJjagM4I1qAT36APa/FcZ+OX86KxbYKCtQKTMqraU8pxG7C2JWA==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.6.7", + "@firebase/logger": "0.4.2", + "@firebase/util": "1.9.6", + "tslib": "^2.1.0", + "undici": "5.28.4" + }, + "peerDependencies": { + "@firebase/app": "0.x", + "@react-native-async-storage/async-storage": "^1.18.1" + }, + "peerDependenciesMeta": { + "@react-native-async-storage/async-storage": { + "optional": true + } + } + }, + "node_modules/@firebase/auth-compat": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.5.9.tgz", + "integrity": "sha512-RX8Zh/3zz2CsVbmYfgHkfUm4fAEPCl+KHVIImNygV5jTGDF6oKOhBIpf4Yigclyu8ESQKZ4elyN0MBYm9/7zGw==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/auth": "1.7.4", + "@firebase/auth-types": "0.12.2", + "@firebase/component": "0.6.7", + "@firebase/util": "1.9.6", + "tslib": "^2.1.0", + "undici": "5.28.4" + }, + "peerDependencies": { + "@firebase/app-compat": "0.x" + } + }, + "node_modules/@firebase/auth-interop-types": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.2.3.tgz", + "integrity": "sha512-Fc9wuJGgxoxQeavybiuwgyi+0rssr76b+nHpj+eGhXFYAdudMWyfBHvFL/I5fEHniUM/UQdFzi9VXJK2iZF7FQ==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/auth-types": { + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.12.2.tgz", + "integrity": "sha512-qsEBaRMoGvHO10unlDJhaKSuPn4pyoTtlQuP1ghZfzB6rNQPuhp/N/DcFZxm9i4v0SogjCbf9reWupwIvfmH6w==", + "license": "Apache-2.0", + "peerDependencies": { + "@firebase/app-types": "0.x", + "@firebase/util": "1.x" + } + }, + "node_modules/@firebase/component": { + "version": "0.6.7", + "resolved": "https://registry.npmjs.org/@firebase/component/-/component-0.6.7.tgz", + "integrity": "sha512-baH1AA5zxfaz4O8w0vDwETByrKTQqB5CDjRls79Sa4eAGAoERw4Tnung7XbMl3jbJ4B/dmmtsMrdki0KikwDYA==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/util": "1.9.6", + "tslib": "^2.1.0" + } + }, + "node_modules/@firebase/database": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@firebase/database/-/database-1.0.5.tgz", + "integrity": "sha512-cAfwBqMQuW6HbhwI3Cb/gDqZg7aR0OmaJ85WUxlnoYW2Tm4eR0hFl5FEijI3/gYPUiUcUPQvTkGV222VkT7KPw==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/app-check-interop-types": "0.3.2", + "@firebase/auth-interop-types": "0.2.3", + "@firebase/component": "0.6.7", + "@firebase/logger": "0.4.2", + "@firebase/util": "1.9.6", + "faye-websocket": "0.11.4", + "tslib": "^2.1.0" + } + }, + "node_modules/@firebase/database-compat": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-1.0.5.tgz", + "integrity": "sha512-NDSMaDjQ+TZEMDMmzJwlTL05kh1+0Y84C+kVMaOmNOzRGRM7VHi29I6YUhCetXH+/b1Wh4ZZRyp1CuWkd8s6hg==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.6.7", + "@firebase/database": "1.0.5", + "@firebase/database-types": "1.0.3", + "@firebase/logger": "0.4.2", + "@firebase/util": "1.9.6", + "tslib": "^2.1.0" + } + }, + "node_modules/@firebase/database-types": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-1.0.3.tgz", + "integrity": "sha512-39V/Riv2R3O/aUjYKh0xypj7NTNXNAK1bcgY5Kx+hdQPRS/aPTS8/5c0CGFYKgVuFbYlnlnhrCTYsh2uNhGwzA==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/app-types": "0.9.2", + "@firebase/util": "1.9.6" + } + }, + "node_modules/@firebase/firestore": { + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-4.6.3.tgz", + "integrity": "sha512-d/+N2iUsiJ/Dc7fApdpdmmTXzwuTCromsdA1lKwYfZtMIOd1fI881NSLwK2wV4I38wkLnvfKJUV6WpU1f3/ONg==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.6.7", + "@firebase/logger": "0.4.2", + "@firebase/util": "1.9.6", + "@firebase/webchannel-wrapper": "1.0.0", + "@grpc/grpc-js": "~1.9.0", + "@grpc/proto-loader": "^0.7.8", + "tslib": "^2.1.0", + "undici": "5.28.4" + }, + "engines": { + "node": ">=10.10.0" + }, + "peerDependencies": { + "@firebase/app": "0.x" + } + }, + "node_modules/@firebase/firestore-compat": { + "version": "0.3.32", + "resolved": "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.3.32.tgz", + "integrity": "sha512-at71mwK7a/mUXH0OgyY0+gUzedm/EUydDFYSFsBoO8DYowZ23Mgd6P4Rzq/Ll3zI/3xJN7LGe7Qp4iE/V/3Arg==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.6.7", + "@firebase/firestore": "4.6.3", + "@firebase/firestore-types": "3.0.2", + "@firebase/util": "1.9.6", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app-compat": "0.x" + } + }, + "node_modules/@firebase/firestore-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-3.0.2.tgz", + "integrity": "sha512-wp1A+t5rI2Qc/2q7r2ZpjUXkRVPtGMd6zCLsiWurjsQpqPgFin3AhNibKcIzoF2rnToNa/XYtyWXuifjOOwDgg==", + "license": "Apache-2.0", + "peerDependencies": { + "@firebase/app-types": "0.x", + "@firebase/util": "1.x" + } + }, + "node_modules/@firebase/functions": { + "version": "0.11.5", + "resolved": "https://registry.npmjs.org/@firebase/functions/-/functions-0.11.5.tgz", + "integrity": "sha512-qrHJ+l62mZiU5UZiVi84t/iLXZlhRuSvBQsa2qvNLgPsEWR7wdpWhRmVdB7AU8ndkSHJjGlMICqrVnz47sgU7Q==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/app-check-interop-types": "0.3.2", + "@firebase/auth-interop-types": "0.2.3", + "@firebase/component": "0.6.7", + "@firebase/messaging-interop-types": "0.2.2", + "@firebase/util": "1.9.6", + "tslib": "^2.1.0", + "undici": "5.28.4" + }, + "peerDependencies": { + "@firebase/app": "0.x" + } + }, + "node_modules/@firebase/functions-compat": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@firebase/functions-compat/-/functions-compat-0.3.11.tgz", + "integrity": "sha512-Qn+ts/M6Lj2/6i1cp5V5TRR+Hi9kyXyHbo+w9GguINJ87zxrCe6ulx3TI5AGQkoQa8YFHUhT3DMGmLFiJjWTSQ==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.6.7", + "@firebase/functions": "0.11.5", + "@firebase/functions-types": "0.6.2", + "@firebase/util": "1.9.6", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app-compat": "0.x" + } + }, + "node_modules/@firebase/functions-types": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.6.2.tgz", + "integrity": "sha512-0KiJ9lZ28nS2iJJvimpY4nNccV21rkQyor5Iheu/nq8aKXJqtJdeSlZDspjPSBBiHRzo7/GMUttegnsEITqR+w==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/installations": { + "version": "0.6.7", + "resolved": "https://registry.npmjs.org/@firebase/installations/-/installations-0.6.7.tgz", + "integrity": "sha512-i6iGoXRu5mX4rTsiMSSKrgh9pSEzD4hwBEzRh5kEhOTr8xN/wvQcCPZDSMVYKwM2XyCPBLVq0JzjyerwL0Rihg==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.6.7", + "@firebase/util": "1.9.6", + "idb": "7.1.1", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app": "0.x" + } + }, + "node_modules/@firebase/installations-compat": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@firebase/installations-compat/-/installations-compat-0.2.7.tgz", + "integrity": "sha512-RPcbD+3nqHbnhVjIOpWK2H5qzZ8pAAAScceiWph0VNTqpKyPQ5tDcp4V5fS0ELpfgsHYvroMLDKfeHxpfvm8cw==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.6.7", + "@firebase/installations": "0.6.7", + "@firebase/installations-types": "0.5.2", + "@firebase/util": "1.9.6", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app-compat": "0.x" + } + }, + "node_modules/@firebase/installations-types": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@firebase/installations-types/-/installations-types-0.5.2.tgz", + "integrity": "sha512-que84TqGRZJpJKHBlF2pkvc1YcXrtEDOVGiDjovP/a3s6W4nlbohGXEsBJo0JCeeg/UG9A+DEZVDUV9GpklUzA==", + "license": "Apache-2.0", + "peerDependencies": { + "@firebase/app-types": "0.x" + } + }, + "node_modules/@firebase/logger": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.4.2.tgz", + "integrity": "sha512-Q1VuA5M1Gjqrwom6I6NUU4lQXdo9IAQieXlujeHZWvRt1b7qQ0KwBaNAjgxG27jgF9/mUwsNmO8ptBCGVYhB0A==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/@firebase/messaging": { + "version": "0.12.9", + "resolved": "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.12.9.tgz", + "integrity": "sha512-IH+JJmzbFGZXV3+TDyKdqqKPVfKRqBBg2BfYYOy7cm7J+SwV+uJMe8EnDKYeQLEQhtpwciPfJ3qQXJs2lbxDTw==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.6.7", + "@firebase/installations": "0.6.7", + "@firebase/messaging-interop-types": "0.2.2", + "@firebase/util": "1.9.6", + "idb": "7.1.1", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app": "0.x" + } + }, + "node_modules/@firebase/messaging-compat": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@firebase/messaging-compat/-/messaging-compat-0.2.9.tgz", + "integrity": "sha512-5jN6wyhwPgBH02zOtmmoOeyfsmoD7ty48D1m0vVPsFg55RqN2Z3Q9gkZ5GmPklFPjTPLcxB1ObcHOZvThTkm7g==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.6.7", + "@firebase/messaging": "0.12.9", + "@firebase/util": "1.9.6", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app-compat": "0.x" + } + }, + "node_modules/@firebase/messaging-interop-types": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@firebase/messaging-interop-types/-/messaging-interop-types-0.2.2.tgz", + "integrity": "sha512-l68HXbuD2PPzDUOFb3aG+nZj5KA3INcPwlocwLZOzPp9rFM9yeuI9YLl6DQfguTX5eAGxO0doTR+rDLDvQb5tA==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/performance": { + "version": "0.6.7", + "resolved": "https://registry.npmjs.org/@firebase/performance/-/performance-0.6.7.tgz", + "integrity": "sha512-d+Q4ltjdJZqjzcdms5i0UC9KLYX7vKGcygZ+7zHA/Xk+bAbMD2CPU0nWTnlNFWifZWIcXZ/2mAMvaGMW3lypUA==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.6.7", + "@firebase/installations": "0.6.7", + "@firebase/logger": "0.4.2", + "@firebase/util": "1.9.6", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app": "0.x" + } + }, + "node_modules/@firebase/performance-compat": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@firebase/performance-compat/-/performance-compat-0.2.7.tgz", + "integrity": "sha512-cb8ge/5iTstxfIGW+iiY+7l3FtN8gobNh9JSQNZgLC9xmcfBYWEs8IeEWMI6S8T+At0oHc3lv+b2kpRMUWr8zQ==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.6.7", + "@firebase/logger": "0.4.2", + "@firebase/performance": "0.6.7", + "@firebase/performance-types": "0.2.2", + "@firebase/util": "1.9.6", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app-compat": "0.x" + } + }, + "node_modules/@firebase/performance-types": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@firebase/performance-types/-/performance-types-0.2.2.tgz", + "integrity": "sha512-gVq0/lAClVH5STrIdKnHnCo2UcPLjJlDUoEB/tB4KM+hAeHUxWKnpT0nemUPvxZ5nbdY/pybeyMe8Cs29gEcHA==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/remote-config": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.4.7.tgz", + "integrity": "sha512-5oPNrPFLsbsjpq0lUEIXoDF2eJK7vAbyXe/DEuZQxnwJlfR7aQbtUlEkRgQWcicXpyDmAmDLo7q7lDbCYa6CpA==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.6.7", + "@firebase/installations": "0.6.7", + "@firebase/logger": "0.4.2", + "@firebase/util": "1.9.6", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app": "0.x" + } + }, + "node_modules/@firebase/remote-config-compat": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@firebase/remote-config-compat/-/remote-config-compat-0.2.7.tgz", + "integrity": "sha512-Fq0oneQ4SluLnfr5/HfzRS1TZf1ANj1rWbCCW3+oC98An3nE+sCdp+FSuHsEVNwgMg4Tkwx9Oom2lkKeU+Vn+w==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.6.7", + "@firebase/logger": "0.4.2", + "@firebase/remote-config": "0.4.7", + "@firebase/remote-config-types": "0.3.2", + "@firebase/util": "1.9.6", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app-compat": "0.x" + } + }, + "node_modules/@firebase/remote-config-types": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.3.2.tgz", + "integrity": "sha512-0BC4+Ud7y2aPTyhXJTMTFfrGGLqdYXrUB9sJVAB8NiqJswDTc4/2qrE/yfUbnQJhbSi6ZaTTBKyG3n1nplssaA==", + "license": "Apache-2.0" + }, + "node_modules/@firebase/storage": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/@firebase/storage/-/storage-0.12.5.tgz", + "integrity": "sha512-nGWBOGFNr10j0LA4NJ3/Yh3us/lb0Q1xSIKZ38N6FcS+vY54nqJ7k3zE3PENregHC8+8txRow++A568G3v8hOA==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.6.7", + "@firebase/util": "1.9.6", + "tslib": "^2.1.0", + "undici": "5.28.4" + }, + "peerDependencies": { + "@firebase/app": "0.x" + } + }, + "node_modules/@firebase/storage-compat": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@firebase/storage-compat/-/storage-compat-0.3.8.tgz", + "integrity": "sha512-qDfY9kMb6Ch2hZb40sBjDQ8YPxbjGOxuT+gU1Z0iIVSSpSX0f4YpGJCypUXiA0T11n6InCXB+T/Dknh2yxVTkg==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/component": "0.6.7", + "@firebase/storage": "0.12.5", + "@firebase/storage-types": "0.8.2", + "@firebase/util": "1.9.6", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app-compat": "0.x" + } + }, + "node_modules/@firebase/storage-types": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.8.2.tgz", + "integrity": "sha512-0vWu99rdey0g53lA7IShoA2Lol1jfnPovzLDUBuon65K7uKG9G+L5uO05brD9pMw+l4HRFw23ah3GwTGpEav6g==", + "license": "Apache-2.0", + "peerDependencies": { + "@firebase/app-types": "0.x", + "@firebase/util": "1.x" + } + }, + "node_modules/@firebase/util": { + "version": "1.9.6", + "resolved": "https://registry.npmjs.org/@firebase/util/-/util-1.9.6.tgz", + "integrity": "sha512-IBr1MZbp4d5MjBCXL3TW1dK/PDXX4yOGbiwRNh1oAbE/+ci5Uuvy9KIrsFYY80as1I0iOaD5oOMA9Q8j4TJWcw==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/@firebase/vertexai-preview": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@firebase/vertexai-preview/-/vertexai-preview-0.0.2.tgz", + "integrity": "sha512-NOOL63kFQRq45ioi5P+hlqj/4LNmvn1URhGjQdvyV54c1Irvoq26aW861PRRLjrSMIeNeiLtCLD5pe+ediepAg==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/app-check-interop-types": "0.3.2", + "@firebase/component": "0.6.7", + "@firebase/logger": "0.4.2", + "@firebase/util": "1.9.6", + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@firebase/app": "0.x", + "@firebase/app-types": "0.x" + } + }, + "node_modules/@firebase/webchannel-wrapper": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-1.0.0.tgz", + "integrity": "sha512-zuWxyfXNbsKbm96HhXzainONPFqRcoZblQ++e9cAIGUuHfl2cFSBzW01jtesqWG/lqaUyX3H8O1y9oWboGNQBA==", + "license": "Apache-2.0" + }, "node_modules/@floating-ui/core": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.0.tgz", @@ -2318,6 +2876,124 @@ "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.1.tgz", "integrity": "sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==" }, + "node_modules/@google-cloud/firestore": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@google-cloud/firestore/-/firestore-7.8.0.tgz", + "integrity": "sha512-m21BWVZLz7H7NF8HZ5hCGUSCEJKNwYB5yzQqDTuE9YUzNDRMDei3BwVDht5k4xF636sGlnobyBL+dcbthSGONg==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "functional-red-black-tree": "^1.0.1", + "google-gax": "^4.3.3", + "protobufjs": "^7.2.6" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@google-cloud/paginator": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-5.0.2.tgz", + "integrity": "sha512-DJS3s0OVH4zFDB1PzjxAsHqJT6sKVbRwwML0ZBP9PbU7Yebtu/7SWMRzvO2J3nUi9pRNITCfu4LJeooM2w4pjg==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "arrify": "^2.0.0", + "extend": "^3.0.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@google-cloud/projectify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-4.0.0.tgz", + "integrity": "sha512-MmaX6HeSvyPbWGwFq7mXdo0uQZLGBYCwziiLIGq5JVX+/bdI3SAq6bP98trV5eTWfLuvsMcIC1YJOF2vfteLFA==", + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@google-cloud/promisify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-4.0.0.tgz", + "integrity": "sha512-Orxzlfb9c67A15cq2JQEyVc7wEsmFBmHjZWZYQMUyJ1qivXyMwdyNOs9odi79hze+2zqdTtu1E19IM/FtqZ10g==", + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@google-cloud/storage": { + "version": "7.11.2", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-7.11.2.tgz", + "integrity": "sha512-jJOrKyOdujfrSF8EJODW9yY6hqO4jSTk6eVITEj2gsD43BSXuDlnMlLOaBUQhXL29VGnSkxDgYl5tlFhA6LKSA==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@google-cloud/paginator": "^5.0.0", + "@google-cloud/projectify": "^4.0.0", + "@google-cloud/promisify": "^4.0.0", + "abort-controller": "^3.0.0", + "async-retry": "^1.3.3", + "duplexify": "^4.1.3", + "fast-xml-parser": "^4.3.0", + "gaxios": "^6.0.2", + "google-auth-library": "^9.6.3", + "html-entities": "^2.5.2", + "mime": "^3.0.0", + "p-limit": "^3.0.1", + "retry-request": "^7.0.0", + "teeny-request": "^9.0.0", + "uuid": "^8.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@google-cloud/storage/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "license": "MIT", + "optional": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/@grpc/grpc-js": { + "version": "1.9.14", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.14.tgz", + "integrity": "sha512-nOpuzZ2G3IuMFN+UPPpKrC6NsLmWsTqSsm66IRfnBt1D4pwTqE27lmbpcPM+l2Ua4gE7PfjRHI6uedAy7hoXUw==", + "license": "Apache-2.0", + "dependencies": { + "@grpc/proto-loader": "^0.7.8", + "@types/node": ">=12.12.47" + }, + "engines": { + "node": "^8.13.0 || >=10.10.0" + } + }, + "node_modules/@grpc/proto-loader": { + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz", + "integrity": "sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==", + "license": "Apache-2.0", + "dependencies": { + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.2.5", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/@hookform/resolvers": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/@hookform/resolvers/-/resolvers-3.3.4.tgz", @@ -2443,6 +3119,17 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@js-sdsl/ordered-map": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", + "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", + "license": "MIT", + "optional": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, "node_modules/@next/env": { "version": "14.2.3", "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.3.tgz", @@ -2770,6 +3457,70 @@ "node": ">=14" } }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "license": "BSD-3-Clause" + }, "node_modules/@radix-ui/number": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.0.1.tgz", @@ -4390,6 +5141,16 @@ "tslib": "^2.4.0" } }, + "node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 10" + } + }, "node_modules/@trysound/sax": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", @@ -4405,6 +5166,23 @@ "integrity": "sha512-o0ZyU3ePp3+KRbhHsY4ogjc+ZQWgVN5h6j8BHW5RII4cFKi6PEKK9QPAcphJVkD0dGpyFnD3VRR0WMvHVjCv9w==", "dev": true }, + "node_modules/@types/body-parser": { + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", + "license": "MIT", + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/caseless": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.5.tgz", + "integrity": "sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg==", + "license": "MIT", + "optional": true + }, "node_modules/@types/cli-progress": { "version": "3.11.5", "resolved": "https://registry.npmjs.org/@types/cli-progress/-/cli-progress-3.11.5.tgz", @@ -4414,17 +5192,78 @@ "@types/node": "*" } }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/express": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", + "license": "MIT", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.19.3", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.3.tgz", + "integrity": "sha512-KOzM7MhcBFlmnlr/fzISFF5vGWVSvN6fTd4T+ExOt08bA/dA5kpSzY52nMsI1KDFmUREpJelPYyuslLRSjjgCg==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/http-errors": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", + "license": "MIT" + }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "node_modules/@types/jsonwebtoken": { + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.6.tgz", + "integrity": "sha512-/5hndP5dCjloafCXns6SZyESp3Ldq7YjH3zwzwczYnjxIT0Fqzk5ROSYVGfFyczIue7IUEj8hkvLbPoLQ18vQw==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", + "license": "MIT", + "optional": true + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "license": "MIT" + }, "node_modules/@types/node": { - "version": "20.11.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.7.tgz", - "integrity": "sha512-GPmeN1C3XAyV5uybAf4cMLWT9fDWcmQhZVtMFu7OR32WjrqGG+Wnk2V1d0bmtUyE/Zy1QJ9BxyiTih9z8Oks8A==", - "dev": true, + "version": "20.14.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz", + "integrity": "sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==", + "license": "MIT", "dependencies": { "undici-types": "~5.26.4" } @@ -4435,6 +5274,18 @@ "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==", "devOptional": true }, + "node_modules/@types/qs": { + "version": "6.9.15", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", + "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==", + "license": "MIT" + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "license": "MIT" + }, "node_modules/@types/react": { "version": "18.2.48", "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.48.tgz", @@ -4455,12 +5306,53 @@ "@types/react": "*" } }, + "node_modules/@types/request": { + "version": "2.48.12", + "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.12.tgz", + "integrity": "sha512-G3sY+NpsA9jnwm0ixhAFQSJ3Q9JkpLZpJbI3GMv0mIAT0y3mRabYeINzal5WOChIiaTEGQYlHOKgkaM9EisWHw==", + "license": "MIT", + "optional": true, + "dependencies": { + "@types/caseless": "*", + "@types/node": "*", + "@types/tough-cookie": "*", + "form-data": "^2.5.0" + } + }, "node_modules/@types/scheduler": { "version": "0.16.8", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", "integrity": "sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==", "devOptional": true }, + "node_modules/@types/send": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "license": "MIT", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.7", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", + "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", + "license": "MIT", + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "*" + } + }, + "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==", + "license": "MIT", + "optional": true + }, "node_modules/@types/uuid": { "version": "9.0.8", "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz", @@ -4609,6 +5501,19 @@ "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", "dev": true }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "license": "MIT", + "optional": true, + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, "node_modules/acorn": { "version": "8.11.3", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", @@ -4630,6 +5535,19 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "license": "MIT", + "optional": true, + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -4879,6 +5797,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, "node_modules/ast-types-flow": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz", @@ -4900,6 +5828,16 @@ "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", "dev": true }, + "node_modules/async-retry": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", + "integrity": "sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==", + "license": "MIT", + "optional": true, + "dependencies": { + "retry": "0.13.1" + } + }, "node_modules/asynciterator.prototype": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/asynciterator.prototype/-/asynciterator.prototype-1.0.0.tgz", @@ -4909,6 +5847,13 @@ "has-symbols": "^1.0.3" } }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT", + "optional": true + }, "node_modules/autoprefixer": { "version": "10.4.17", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.17.tgz", @@ -5038,7 +5983,6 @@ "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, "funding": [ { "type": "github", @@ -5054,6 +5998,16 @@ } ] }, + "node_modules/bignumber.js": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", + "license": "MIT", + "optional": true, + "engines": { + "node": "*" + } + }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -5066,7 +6020,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dev": true, "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -5136,7 +6089,6 @@ "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, "funding": [ { "type": "github", @@ -5156,6 +6108,12 @@ "ieee754": "^1.1.13" } }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "license": "BSD-3-Clause" + }, "node_modules/busboy": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", @@ -5310,6 +6268,12 @@ "node": ">= 6" } }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "license": "ISC" + }, "node_modules/class-variance-authority": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/class-variance-authority/-/class-variance-authority-0.7.0.tgz", @@ -5414,6 +6378,57 @@ "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==" }, + "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==", + "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/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==", + "license": "MIT" + }, + "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==", + "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/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==", + "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/clone": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", @@ -5715,6 +6730,19 @@ "simple-swizzle": "^0.2.2" } }, + "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==", + "license": "MIT", + "optional": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/commander": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", @@ -5897,7 +6925,6 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -5910,6 +6937,30 @@ } } }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "license": "MIT", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -5968,6 +7019,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/dequal": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", @@ -5977,6 +7038,15 @@ "node": ">=6" } }, + "node_modules/detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "license": "Apache-2.0", + "engines": { + "node": ">=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", @@ -6081,11 +7151,33 @@ "tslib": "^2.0.3" } }, + "node_modules/duplexify": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.3.tgz", + "integrity": "sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA==", + "license": "MIT", + "optional": true, + "dependencies": { + "end-of-stream": "^1.4.1", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1", + "stream-shift": "^1.0.2" + } + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, "node_modules/ejs": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", @@ -6137,6 +7229,15 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, "node_modules/enhanced-resolve": { "version": "5.15.0", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", @@ -6290,7 +7391,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true, "engines": { "node": ">=6" } @@ -6740,6 +7840,32 @@ "node": ">=0.10.0" } }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "license": "(MIT OR WTFPL)", + "engines": { + "node": ">=6" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "license": "MIT", + "optional": true + }, "node_modules/external-editor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", @@ -6754,11 +7880,25 @@ "node": ">=4" } }, + "node_modules/farmhash": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/farmhash/-/farmhash-3.3.1.tgz", + "integrity": "sha512-XUizHanzlr/v7suBr/o85HSakOoWh6HKXZjFYl5C2+Gj0f0rkw+XTUZzrd9odDsgI9G5tRUcF4wSbKaX04T0DQ==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "node-addon-api": "^5.1.0", + "prebuild-install": "^7.1.2" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "devOptional": true }, "node_modules/fast-glob": { "version": "3.3.2", @@ -6798,6 +7938,29 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, + "node_modules/fast-xml-parser": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.0.tgz", + "integrity": "sha512-kLY3jFlwIYwBNDojclKsNAC12sfD6NwW74QB2CoNGPvtVxjliYehVunB3HYyNi+n4Tt1dAcgwYvmKF/Z18flqg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "license": "MIT", + "optional": true, + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, "node_modules/fastq": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.0.tgz", @@ -6806,6 +7969,18 @@ "reusify": "^1.0.4" } }, + "node_modules/faye-websocket": { + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", + "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", + "license": "Apache-2.0", + "dependencies": { + "websocket-driver": ">=0.5.1" + }, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", @@ -6899,6 +8074,66 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/firebase": { + "version": "10.12.2", + "resolved": "https://registry.npmjs.org/firebase/-/firebase-10.12.2.tgz", + "integrity": "sha512-ZxEdtSvP1I9su1yf32D8TIdgxtPgxwr6z3jYAR1TXS/t+fVfpoPc/N1/N2bxOco9mNjUoc+od34v5Fn4GeKs6Q==", + "license": "Apache-2.0", + "dependencies": { + "@firebase/analytics": "0.10.4", + "@firebase/analytics-compat": "0.2.10", + "@firebase/app": "0.10.5", + "@firebase/app-check": "0.8.4", + "@firebase/app-check-compat": "0.3.11", + "@firebase/app-compat": "0.2.35", + "@firebase/app-types": "0.9.2", + "@firebase/auth": "1.7.4", + "@firebase/auth-compat": "0.5.9", + "@firebase/database": "1.0.5", + "@firebase/database-compat": "1.0.5", + "@firebase/firestore": "4.6.3", + "@firebase/firestore-compat": "0.3.32", + "@firebase/functions": "0.11.5", + "@firebase/functions-compat": "0.3.11", + "@firebase/installations": "0.6.7", + "@firebase/installations-compat": "0.2.7", + "@firebase/messaging": "0.12.9", + "@firebase/messaging-compat": "0.2.9", + "@firebase/performance": "0.6.7", + "@firebase/performance-compat": "0.2.7", + "@firebase/remote-config": "0.4.7", + "@firebase/remote-config-compat": "0.2.7", + "@firebase/storage": "0.12.5", + "@firebase/storage-compat": "0.3.8", + "@firebase/util": "1.9.6", + "@firebase/vertexai-preview": "0.0.2" + } + }, + "node_modules/firebase-admin": { + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/firebase-admin/-/firebase-admin-12.1.1.tgz", + "integrity": "sha512-Nuoxk//gaYrspS7TvwBINdGvFhh2QeiaWpRW6+PJ+tWyn2/CugBc7jKa1NaBg0AvhGSOXFOCIsXhzCzHA47Rew==", + "license": "Apache-2.0", + "dependencies": { + "@fastify/busboy": "^2.1.0", + "@firebase/database-compat": "^1.0.2", + "@firebase/database-types": "^1.0.0", + "@types/node": "^20.10.3", + "farmhash": "^3.3.1", + "jsonwebtoken": "^9.0.0", + "jwks-rsa": "^3.1.0", + "long": "^5.2.3", + "node-forge": "^1.3.1", + "uuid": "^9.0.0" + }, + "engines": { + "node": ">=14" + }, + "optionalDependencies": { + "@google-cloud/firestore": "^7.7.0", + "@google-cloud/storage": "^7.7.0" + } + }, "node_modules/flat-cache": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", @@ -6943,6 +8178,21 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/form-data": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", + "license": "MIT", + "optional": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, "node_modules/fraction.js": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", @@ -6956,6 +8206,12 @@ "url": "https://github.com/sponsors/rawify" } }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "license": "MIT" + }, "node_modules/fs-extra": { "version": "11.2.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", @@ -7015,6 +8271,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "license": "MIT", + "optional": true + }, "node_modules/functions-have-names": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", @@ -7024,6 +8287,37 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/gaxios": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-6.6.0.tgz", + "integrity": "sha512-bpOZVQV5gthH/jVCSuYuokRo2bTKOcuBiVWpjmTn6C5Agl5zclGfTljuGsQZxwwDBkli+YhZhP4TdlqTnhOezQ==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "extend": "^3.0.2", + "https-proxy-agent": "^7.0.1", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.9", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/gcp-metadata": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.0.tgz", + "integrity": "sha512-Jh/AIwwgaxan+7ZUUmRLCjtchyDiqh4KjBJ5tW3plBZb5iL/BPcso8A5DlzeD9qlw0duCamnNdpFjxwaT0KyKg==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "gaxios": "^6.0.0", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -7033,6 +8327,15 @@ "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==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, "node_modules/get-intrinsic": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", @@ -7104,6 +8407,12 @@ "node": ">=16" } }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "license": "MIT" + }, "node_modules/glob": { "version": "10.3.10", "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", @@ -7208,6 +8517,62 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/google-auth-library": { + "version": "9.10.0", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.10.0.tgz", + "integrity": "sha512-ol+oSa5NbcGdDqA+gZ3G3mev59OHBZksBTxY/tYwjtcp1H/scAFwJfSQU9/1RALoyZ7FslNbke8j4i3ipwlyuQ==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "gaxios": "^6.1.1", + "gcp-metadata": "^6.1.0", + "gtoken": "^7.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/google-gax": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-4.3.6.tgz", + "integrity": "sha512-z3MR+pE6WqU+tnKtkJl4c723EYY7Il4fcSNgEbehzUJpcNWkca9AyoC2pdBWmEa0cda21VRpUBb4s6VSATiUKg==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@grpc/grpc-js": "~1.10.3", + "@grpc/proto-loader": "^0.7.13", + "@types/long": "^4.0.0", + "abort-controller": "^3.0.0", + "duplexify": "^4.0.0", + "google-auth-library": "^9.3.0", + "node-fetch": "^2.6.1", + "object-hash": "^3.0.0", + "proto3-json-serializer": "^2.0.0", + "protobufjs": "7.3.0", + "retry-request": "^7.0.0", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/google-gax/node_modules/@grpc/grpc-js": { + "version": "1.10.8", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.10.8.tgz", + "integrity": "sha512-vYVqYzHicDqyKB+NQhAc54I1QWCBLCrYG6unqOIcBTHx+7x8C9lcoLj3KVJXs2VB4lUbpWY+Kk9NipcbXYWmvg==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@grpc/proto-loader": "^0.7.13", + "@js-sdsl/ordered-map": "^4.4.2" + }, + "engines": { + "node": ">=12.10.0" + } + }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -7231,6 +8596,20 @@ "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true }, + "node_modules/gtoken": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-7.1.0.tgz", + "integrity": "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==", + "license": "MIT", + "optional": true, + "dependencies": { + "gaxios": "^6.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", @@ -7311,6 +8690,71 @@ "node": ">= 0.4" } }, + "node_modules/html-entities": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.5.2.tgz", + "integrity": "sha512-K//PSRMQk4FZ78Kyau+mZurHn3FH0Vwr+H36eE0rPbeYkRRi9YxceYPhuN60UwWorxyKHhqoAJl2OFKa4BVtaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/mdevils" + }, + { + "type": "patreon", + "url": "https://patreon.com/mdevils" + } + ], + "license": "MIT", + "optional": true + }, + "node_modules/http-parser-js": { + "version": "0.5.8", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.8.tgz", + "integrity": "sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==", + "license": "MIT" + }, + "node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "license": "MIT", + "optional": true, + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/http-proxy-agent/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "license": "MIT", + "optional": true, + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/hyperlinker": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/hyperlinker/-/hyperlinker-1.0.0.tgz", @@ -7332,11 +8776,16 @@ "node": ">=0.10.0" } }, + "node_modules/idb": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz", + "integrity": "sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ==", + "license": "ISC" + }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, "funding": [ { "type": "github", @@ -7408,8 +8857,13 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "license": "ISC" }, "node_modules/inquirer": { "version": "8.2.6", @@ -7785,6 +9239,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-string": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", @@ -7955,6 +9422,15 @@ "jiti": "bin/jiti.js" } }, + "node_modules/jose": { + "version": "4.15.5", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.5.tgz", + "integrity": "sha512-jc7BFxgKPKi94uOvEmzlSWFFe2+vASyXaKUpdQKatWAESU2MWjDfFf0fdfc83CDKcA5QecabZeNLyfhe3yKNkg==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -7984,6 +9460,16 @@ "node": ">=4" } }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -8032,6 +9518,49 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/jsonwebtoken": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "license": "MIT", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jsonwebtoken/node_modules/jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "license": "MIT", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jsonwebtoken/node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "license": "MIT", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, "node_modules/jsx-ast-utils": { "version": "3.3.5", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", @@ -8047,6 +9576,46 @@ "node": ">=4.0" } }, + "node_modules/jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "license": "MIT", + "optional": true, + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jwks-rsa": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jwks-rsa/-/jwks-rsa-3.1.0.tgz", + "integrity": "sha512-v7nqlfezb9YfHHzYII3ef2a2j1XnGeSE/bK3WfumaYCqONAIstJbrEGapz4kadScZzEt7zYCN7bucj8C0Mv/Rg==", + "license": "MIT", + "dependencies": { + "@types/express": "^4.17.17", + "@types/jsonwebtoken": "^9.0.2", + "debug": "^4.3.4", + "jose": "^4.14.6", + "limiter": "^1.1.5", + "lru-memoizer": "^2.2.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/jws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "license": "MIT", + "optional": true, + "dependencies": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -8095,6 +9664,11 @@ "node": ">=10" } }, + "node_modules/limiter": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.5.tgz", + "integrity": "sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==" + }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -8121,18 +9695,72 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "license": "MIT" + }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", + "license": "MIT" + }, "node_modules/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", "dev": true }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", + "license": "MIT" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", + "license": "MIT" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", + "license": "MIT" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", + "license": "MIT" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "license": "MIT" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "license": "MIT" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "license": "MIT" + }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -8149,6 +9777,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", + "license": "Apache-2.0" + }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -8177,6 +9811,28 @@ "node": "14 || >=16.14" } }, + "node_modules/lru-memoizer": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/lru-memoizer/-/lru-memoizer-2.3.0.tgz", + "integrity": "sha512-GXn7gyHAMhO13WSKrIiNfztwxodVsP8IoZ3XfrJV4yH2x0/OeTO/FIaAHTY5YekdGgW94njfuKmyyt1E0mR6Ug==", + "license": "MIT", + "dependencies": { + "lodash.clonedeep": "^4.5.0", + "lru-cache": "6.0.0" + } + }, + "node_modules/lru-memoizer/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/lucide-react": { "version": "0.364.0", "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.364.0.tgz", @@ -8196,19 +9852,55 @@ "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "engines": { - "node": ">= 8" + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "license": "MIT", + "optional": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "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==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 0.6" } }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "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==", + "license": "MIT", + "optional": true, "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" + "mime-db": "1.52.0" }, "engines": { - "node": ">=8.6" + "node": ">= 0.6" } }, "node_modules/mimic-fn": { @@ -8220,6 +9912,18 @@ "node": ">=6" } }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -8236,7 +9940,6 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -8249,11 +9952,16 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "license": "MIT" + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/mute-stream": { "version": "0.0.8", @@ -8288,6 +9996,12 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", + "license": "MIT" + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -8399,6 +10113,54 @@ "tslib": "^2.0.3" } }, + "node_modules/node-abi": { + "version": "3.63.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.63.0.tgz", + "integrity": "sha512-vAszCsOUrUxjGAmdnM/pq7gUgie0IRteCQMX6d4A534fQCR93EJU5qgzBvU6EkFfK27s0T3HEV3BOyJIr7OMYw==", + "license": "MIT", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-addon-api": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", + "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==", + "license": "MIT" + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "optional": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-forge": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", + "license": "(BSD-3-Clause OR GPL-2.0)", + "engines": { + "node": ">= 6.13.0" + } + }, "node_modules/node-releases": { "version": "2.0.14", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", @@ -8578,7 +10340,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, "dependencies": { "wrappy": "1" } @@ -8651,7 +10412,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, + "devOptional": true, "dependencies": { "yocto-queue": "^0.1.0" }, @@ -8942,6 +10703,32 @@ "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" }, + "node_modules/prebuild-install": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz", + "integrity": "sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==", + "license": "MIT", + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -9046,6 +10833,53 @@ "react-is": "^16.13.1" } }, + "node_modules/proto3-json-serializer": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-2.0.2.tgz", + "integrity": "sha512-SAzp/O4Yh02jGdRc+uIrGoe87dkN/XtwxfZ4ZyafJHymd79ozp5VG5nyZ7ygqPM5+cpLDjjGnYFUkngonyDPOQ==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "protobufjs": "^7.2.5" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/protobufjs": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.0.tgz", + "integrity": "sha512-YWD03n3shzV9ImZRX3ccbjqLxj7NokGN0V/ESiBV5xWqrommYHYiihuIyavq03pWSGqlyvYUFmfoMKd+1rPA/g==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -9074,6 +10908,30 @@ } ] }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/rc/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/react": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", @@ -9232,7 +11090,6 @@ "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -9369,6 +11226,15 @@ "jsesc": "bin/jsesc" } }, + "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==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/resolve": { "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", @@ -9422,6 +11288,31 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, + "node_modules/retry": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", + "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/retry-request": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-7.0.2.tgz", + "integrity": "sha512-dUOvLMJ0/JJYEn8NrpOaGNE7X3vpI5XlZS/u0ANjqtcZVKnIxP7IgCFwrKTxENw29emmwug53awKtaMm4i9g5w==", + "license": "MIT", + "optional": true, + "dependencies": { + "@types/request": "^2.48.8", + "extend": "^3.0.2", + "teeny-request": "^9.0.0" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -9528,7 +11419,6 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, "funding": [ { "type": "github", @@ -9579,7 +11469,6 @@ "version": "7.5.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -9594,7 +11483,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -9676,6 +11564,51 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "node_modules/simple-swizzle": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", @@ -9750,6 +11683,23 @@ "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "dev": true }, + "node_modules/stream-events": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.5.tgz", + "integrity": "sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg==", + "license": "MIT", + "optional": true, + "dependencies": { + "stubs": "^3.0.0" + } + }, + "node_modules/stream-shift": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", + "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==", + "license": "MIT", + "optional": true + }, "node_modules/streamsearch": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", @@ -9762,7 +11712,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, "dependencies": { "safe-buffer": "~5.2.0" } @@ -9936,6 +11885,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strnum": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==", + "license": "MIT", + "optional": true + }, + "node_modules/stubs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz", + "integrity": "sha512-PdHt7hHUJKxvTCgbKX9C1V/ftOcjJQgz8BZwNfV5c4B6dcGqlpelTbJ999jBGZ2jYiPAwcX5dP6oBwVlBlUbxw==", + "license": "MIT", + "optional": true + }, "node_modules/styled-jsx": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz", @@ -10120,6 +12083,78 @@ "node": ">=6" } }, + "node_modules/tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "license": "MIT", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "license": "MIT", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/teeny-request": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-9.0.0.tgz", + "integrity": "sha512-resvxdc6Mgb7YEThw6G6bExlXKkv6+YbuzGg9xuXxSgxJF7Ozs+o8Y9+2R3sArdWdW8nOokoQb1yrpFB0pQK2g==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "node-fetch": "^2.6.9", + "stream-events": "^1.0.5", + "uuid": "^9.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/teeny-request/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/teeny-request/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "optional": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -10211,6 +12246,13 @@ "node": ">=8.0" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT", + "optional": true + }, "node_modules/ts-api-utils": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", @@ -10308,6 +12350,18 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -10425,11 +12479,22 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici": { + "version": "5.28.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", + "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", + "license": "MIT", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", @@ -10609,6 +12674,47 @@ "defaults": "^1.0.3" } }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause", + "optional": true + }, + "node_modules/websocket-driver": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", + "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==", + "license": "Apache-2.0", + "dependencies": { + "http-parser-js": ">=0.5.1", + "safe-buffer": ">=5.1.0", + "websocket-extensions": ">=0.1.1" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/websocket-extensions": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz", + "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "optional": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -10827,14 +12933,21 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", + "engines": { + "node": ">=10" + } }, "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/yaml": { "version": "2.3.4", @@ -10844,11 +12957,58 @@ "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==", + "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==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "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==", + "license": "MIT" + }, + "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==", + "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/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, + "devOptional": true, "engines": { "node": ">=10" }, diff --git a/package.json b/package.json index bd10f4e..d52b869 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "next dev", + "dev": "next dev --turbo", "build": "next build", "start": "next start", "lint": "next lint" @@ -47,6 +47,8 @@ "cmdk": "^0.2.1", "date-fns": "^3.3.1", "embla-carousel-react": "^8.0.0-rc22", + "firebase": "^10.12.2", + "firebase-admin": "^12.1.1", "get-video-id": "^4.1.5", "lucide-react": "^0.364.0", "next": "^14.2.3", @@ -67,7 +69,7 @@ "devDependencies": { "@svgr/webpack": "^8.1.0", "@types/autosize": "^4.0.3", - "@types/node": "^20", + "@types/node": "^20.14.2", "@types/react": "^18", "@types/react-dom": "^18", "@types/uuid": "^9.0.8", diff --git a/src/actions/validations.ts b/src/actions/validations.ts index 6ad34ac..5175e9b 100644 --- a/src/actions/validations.ts +++ b/src/actions/validations.ts @@ -3,16 +3,27 @@ import {FormResponse, Response} from "@/interfaces/FormResponse"; import FormItem from "@/interfaces/FormItem"; import {validateJSON} from "@/functions/validations"; +import Firebase from "@/helpers/firebase"; +import { getFirestore } from "firebase-admin/firestore"; -type Errors = { - [id: string]: string -} export async function serverValidate(formItems: FormItem[], formResponses: FormResponse) { let errors = validateJSON(formItems, formResponses) if (Object.keys(errors).length > 0) { return errors } else { + // Save the data + const app = Firebase() + + if (!app) { + errors["General"] = "Error initializing Firebase" + return errors + } + + const db = getFirestore(app); + let document = await db.doc("Responses/FormID/ComponentID/ResponseID").get() + console.log(document.data()) + return {} }// Otherwise save the data } diff --git a/src/helpers/firebase.ts b/src/helpers/firebase.ts new file mode 100644 index 0000000..4be42b7 --- /dev/null +++ b/src/helpers/firebase.ts @@ -0,0 +1,30 @@ +// Import the functions you need from the SDKs you need +import * as admin from "firebase-admin"; +import { credential } from "firebase-admin"; +// TODO: Add SDKs for Firebase products that you want to use +// https://firebase.google.com/docs/web/setup#available-libraries + +const serviceAccount = JSON.parse( + process.env.FIREBASE_SERVICE_ACCOUNT_KEY as string +); + +export default function Firebase() { + // Your web app's Firebase configuration + // const firebaseConfig = { + // apiKey: process.env.API_KEY, + // authDomain: process.env.AUTH_DOMAIN, + // projectId: process.env.PROJECT_ID, + // storageBucket: process.env.STORAGE_BUCKET, + // messagingSenderId: process.env.MESSAGING_SENDER_ID, + // appId: process.env.APP_ID + // }; + + if (admin.apps.length === 0) { + return admin.initializeApp({ + credential: admin.credential.cert(serviceAccount), + databaseURL: process.env.NEXT_PUBLIC_FIREBASE_DATABASE_URL, + }); + } else { + return admin.apps[0] + } +} \ No newline at end of file From 5b37912b2aeee0040413f7f4a67484176105cb44 Mon Sep 17 00:00:00 2001 From: SteakFisher Date: Mon, 10 Jun 2024 02:55:45 +0400 Subject: [PATCH 2/7] Wrapped FormResponses with FormResponseObject --- src/actions/validations.ts | 30 +++++++++---------- src/app/form/page.tsx | 4 +-- src/components/form-display/FormRenderer.tsx | 9 ++++-- src/contexts/FormRendererContext.tsx | 6 ++-- src/functions/validations.ts | 24 ++++++++------- .../{firebase.ts => firebaseServer.ts} | 2 +- src/helpers/firestoreServer.ts | 12 ++++++++ src/interfaces/FormResponseObject.ts | 6 ++++ .../{FormResponse.ts => FormResponses.ts} | 2 +- 9 files changed, 59 insertions(+), 36 deletions(-) rename src/helpers/{firebase.ts => firebaseServer.ts} (95%) create mode 100644 src/helpers/firestoreServer.ts create mode 100644 src/interfaces/FormResponseObject.ts rename src/interfaces/{FormResponse.ts => FormResponses.ts} (93%) diff --git a/src/actions/validations.ts b/src/actions/validations.ts index 5175e9b..177b7c2 100644 --- a/src/actions/validations.ts +++ b/src/actions/validations.ts @@ -1,27 +1,25 @@ -"use server" +"use server"; -import {FormResponse, Response} from "@/interfaces/FormResponse"; +import { FormResponses, Response } from "@/interfaces/FormResponses"; import FormItem from "@/interfaces/FormItem"; -import {validateJSON} from "@/functions/validations"; -import Firebase from "@/helpers/firebase"; -import { getFirestore } from "firebase-admin/firestore"; +import { validateJSON } from "@/functions/validations"; +import firestoreServer from "@/helpers/firestoreServer"; +import FormResponseObject from "@/interfaces/FormResponseObject"; +import { v4 as uuidv4 } from "uuid"; -export async function serverValidate(formItems: FormItem[], formResponses: FormResponse) { - let errors = validateJSON(formItems, formResponses) +export async function serverValidate(formItems: FormItem[], formResponses: FormResponses) { + let formResponseObject : FormResponseObject = { + responseId: uuidv4(), + formResponse: formResponses + } + let { finalResponse, errors } = validateJSON(formItems, formResponseObject) if (Object.keys(errors).length > 0) { return errors } else { // Save the data - const app = Firebase() - - if (!app) { - errors["General"] = "Error initializing Firebase" - return errors - } - - const db = getFirestore(app); - let document = await db.doc("Responses/FormID/ComponentID/ResponseID").get() + const db = firestoreServer() + let document = await db.doc(`Responses/FormID/ComponentID/ResponseID`).get() console.log(document.data()) return {} diff --git a/src/app/form/page.tsx b/src/app/form/page.tsx index c66a184..7f119aa 100644 --- a/src/app/form/page.tsx +++ b/src/app/form/page.tsx @@ -1,9 +1,9 @@ import FormItem from "@/interfaces/FormItem"; import {Card} from "@/components/ui/card"; -import {FormResponse, Response} from "@/interfaces/FormResponse"; +import {FormResponses, Response} from "@/interfaces/FormResponses"; import FormRenderer from "@/components/form-display/FormRenderer"; -const formResponses: FormResponse = {} +const formResponses: FormResponses = {} function sleep(ms = 0) { return new Promise(resolve => setTimeout(resolve, ms)); diff --git a/src/components/form-display/FormRenderer.tsx b/src/components/form-display/FormRenderer.tsx index f253efe..92828ca 100644 --- a/src/components/form-display/FormRenderer.tsx +++ b/src/components/form-display/FormRenderer.tsx @@ -9,17 +9,20 @@ import MultipleChoiceGridComponent from "@/components/form-display/MultipleChoic import DateComponent from "@/components/form-display/DateComponent"; import MediaComponent from "@/components/form-display/MediaComponent"; import {FormRendererContext} from "@/contexts/FormRendererContext"; -import {FormResponse, Response} from "@/interfaces/FormResponse"; +import {FormResponses, Response} from "@/interfaces/FormResponses"; import FormItem from "@/interfaces/FormItem"; import {validateJSON} from "@/functions/validations"; import {serverValidate} from "@/actions/validations"; import {toast} from "sonner"; import {Button} from "@/components/ui/button"; -export default function FormRenderer({ formItems, formResponses } : { formItems: FormItem[], formResponses: FormResponse }) { +export default function FormRenderer({ formItems, formResponses } : { formItems: FormItem[], formResponses: FormResponses }) { return (
{ - let errors = validateJSON(formItems, formResponses) + let { errors } = validateJSON(formItems, { + responseId: "placeholderValue", + formResponse: formResponses + }) if (Object.keys(errors).length == 0) { errors = await serverValidate(formItems, formResponses) } diff --git a/src/contexts/FormRendererContext.tsx b/src/contexts/FormRendererContext.tsx index 49e2b68..b6d9fe8 100644 --- a/src/contexts/FormRendererContext.tsx +++ b/src/contexts/FormRendererContext.tsx @@ -1,9 +1,9 @@ import {createContext} from "react"; -import {FormResponse} from "@/interfaces/FormResponse"; -import {Response} from "@/interfaces/FormResponse"; +import {FormResponses} from "@/interfaces/FormResponses"; +import {Response} from "@/interfaces/FormResponses"; interface FormRendererContextInterface { - formResponses: FormResponse + formResponses: FormResponses } export const FormRendererContext = createContext({ diff --git a/src/functions/validations.ts b/src/functions/validations.ts index 3b32191..b14b677 100644 --- a/src/functions/validations.ts +++ b/src/functions/validations.ts @@ -1,5 +1,5 @@ import FormItem from "@/interfaces/FormItem"; -import {FormResponse, Response} from "@/interfaces/FormResponse"; +import {FormResponses, Response} from "@/interfaces/FormResponses"; import zod, {z, ZodError} from "zod"; import TextInputResponse from "@/interfaces/form-component-response-interfaces/TextInputResponse"; import DropdownResponse from "@/interfaces/form-component-response-interfaces/DropdownResponse"; @@ -7,6 +7,7 @@ import DateResponse from "@/interfaces/form-component-response-interfaces/DateRe import RangeResponse from "@/interfaces/form-component-response-interfaces/RangeResponse"; import {MultipleChoiceResponse} from "@/interfaces/form-component-response-interfaces/MultipleChoiceResponse"; import MultipleChoiceGridResponse from "@/interfaces/form-component-response-interfaces/MultipleChoiceGridResponse"; +import FormResponseObject from "@/interfaces/FormResponseObject"; type Errors = { [id: string]: string @@ -14,9 +15,10 @@ type Errors = { -export function validateJSON(formItems: FormItem[], formResponses: FormResponse) { +export function validateJSON(formItems: FormItem[], formResponseObject: FormResponseObject) { let errors : Errors = {} - let finalResponse = {} as FormResponse + let formResponses = formResponseObject.formResponse; + let finalResponse = {} as FormResponses formItems.map((item) => { let response = formResponses[item.id] @@ -86,10 +88,12 @@ export function validateJSON(formItems: FormItem[], formResponses: FormResponse< } }) - return errors + if (Object.keys(errors).length === 0) finalResponse = {} + + return { finalResponse, errors } } -function validateTextInput(item: FormItem, response: TextInputResponse, errors: Errors, finalResponse: FormResponse){ +function validateTextInput(item: FormItem, response: TextInputResponse, errors: Errors, finalResponse: FormResponses){ if (item.props.type !== "text-input") return; if (!response.input && !item.props.required) return; @@ -134,7 +138,7 @@ function validateTextInput(item: FormItem, response: TextInputResponse, errors: } } -function validateDropdownInput(item: FormItem, response: DropdownResponse, errors: Errors, finalResponse: FormResponse){ +function validateDropdownInput(item: FormItem, response: DropdownResponse, errors: Errors, finalResponse: FormResponses){ if (item.props.type !== "dropdown") return; if (!response.selected && !item.props.required) return; @@ -168,7 +172,7 @@ function validateDropdownInput(item: FormItem, response: DropdownResponse, error } } -function validateDateInput(item: FormItem, response: DateResponse, errors: Errors, finalResponse: FormResponse) { +function validateDateInput(item: FormItem, response: DateResponse, errors: Errors, finalResponse: FormResponses) { if (item.props.type !== "date") return; if (!response.date && !item.props.required) return; @@ -198,7 +202,7 @@ function validateDateInput(item: FormItem, response: DateResponse, errors: Error } } -function validateRangeInput(item: FormItem, response: RangeResponse, errors: Errors, finalResponse: FormResponse) { +function validateRangeInput(item: FormItem, response: RangeResponse, errors: Errors, finalResponse: FormResponses) { if (item.props.type !== "range") return; if (!response.range && !item.props.required) return; @@ -225,7 +229,7 @@ function validateRangeInput(item: FormItem, response: RangeResponse, errors: Err } } -function validateMultipleChoiceInput(item: FormItem, response: MultipleChoiceResponse, errors: Errors, finalResponse: FormResponse){ +function validateMultipleChoiceInput(item: FormItem, response: MultipleChoiceResponse, errors: Errors, finalResponse: FormResponses){ if (item.props.type !== "multiple-choice") return; if ((!response.selected || Object.keys(response.selected).length == 0) && !item.props.required) return; @@ -269,7 +273,7 @@ function validateMultipleChoiceInput(item: FormItem, response: MultipleChoiceRes } } -function validateMultipleChoiceGridInput(item: FormItem, response: MultipleChoiceGridResponse, errors: Errors, finalResponse: FormResponse){ +function validateMultipleChoiceGridInput(item: FormItem, response: MultipleChoiceGridResponse, errors: Errors, finalResponse: FormResponses){ if (item.props.type !== "multiple-choice-grid") return; if ((!response.selected || Object.keys(response.selected).length == 0) && !item.props.required) return; diff --git a/src/helpers/firebase.ts b/src/helpers/firebaseServer.ts similarity index 95% rename from src/helpers/firebase.ts rename to src/helpers/firebaseServer.ts index 4be42b7..ff7157b 100644 --- a/src/helpers/firebase.ts +++ b/src/helpers/firebaseServer.ts @@ -8,7 +8,7 @@ const serviceAccount = JSON.parse( process.env.FIREBASE_SERVICE_ACCOUNT_KEY as string ); -export default function Firebase() { +export default function FirebaseServer() { // Your web app's Firebase configuration // const firebaseConfig = { // apiKey: process.env.API_KEY, diff --git a/src/helpers/firestoreServer.ts b/src/helpers/firestoreServer.ts new file mode 100644 index 0000000..6ff225b --- /dev/null +++ b/src/helpers/firestoreServer.ts @@ -0,0 +1,12 @@ +import FirebaseServer from "@/helpers/firebaseServer"; +import { getFirestore } from "firebase-admin/firestore"; + +export default function firestoreServer() { + const app = FirebaseServer() + + if (!app) { + throw new Error ("Firebase app not initialized") + } + + return getFirestore(app); +} \ No newline at end of file diff --git a/src/interfaces/FormResponseObject.ts b/src/interfaces/FormResponseObject.ts new file mode 100644 index 0000000..f2ffe1e --- /dev/null +++ b/src/interfaces/FormResponseObject.ts @@ -0,0 +1,6 @@ +import { FormResponses, Response } from "@/interfaces/FormResponses"; + +export default interface FormResponseObject{ + responseId: string; + formResponse: FormResponses; +} \ No newline at end of file diff --git a/src/interfaces/FormResponse.ts b/src/interfaces/FormResponses.ts similarity index 93% rename from src/interfaces/FormResponse.ts rename to src/interfaces/FormResponses.ts index 758a2a2..c2f74b7 100644 --- a/src/interfaces/FormResponse.ts +++ b/src/interfaces/FormResponses.ts @@ -13,6 +13,6 @@ TextInputResponse | MultipleChoiceGridResponse | RangeResponse; -export interface FormResponse { +export interface FormResponses { [id: string] : T; } \ No newline at end of file From 115f680291936f19a241b325e0476aa8dd5fadb9 Mon Sep 17 00:00:00 2001 From: SteakFisher Date: Mon, 10 Jun 2024 02:58:48 +0400 Subject: [PATCH 3/7] Stopped jetbrains from crying --- src/actions/validations.ts | 2 +- src/app/form/page.tsx | 2 +- src/functions/validations.ts | 6 +++--- src/helpers/firebaseServer.ts | 1 - 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/actions/validations.ts b/src/actions/validations.ts index 177b7c2..4e40c42 100644 --- a/src/actions/validations.ts +++ b/src/actions/validations.ts @@ -13,7 +13,7 @@ export async function serverValidate(formItems: FormItem[], formResponses: FormR responseId: uuidv4(), formResponse: formResponses } - let { finalResponse, errors } = validateJSON(formItems, formResponseObject) + let { errors } = validateJSON(formItems, formResponseObject) if (Object.keys(errors).length > 0) { return errors } else { diff --git a/src/app/form/page.tsx b/src/app/form/page.tsx index 7f119aa..b4dd3ba 100644 --- a/src/app/form/page.tsx +++ b/src/app/form/page.tsx @@ -11,7 +11,7 @@ function sleep(ms = 0) { export default async function Form() { let formItems : FormItem[] = [{"id":"0","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"description":"Here's a description cuz y not","required":false,"title":"HUGE form for testing validation and implementing","type":"title"}},{"id":"f5633610-ccd5-42c7-9d5d-47ef889190b6","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":"https://avatars.githubusercontent.com/u/54469796?s=48&v=4"},"props":{"lengthType":"characters","maxLength":2,"minLength":0,"multiline":false,"regexPattern":"","regexFlags":"","required":true,"title":"Title of a required input component","type":"text-input"}},{"id":"f38f1931-49b7-4d07-bab1-6d513ec53361","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"lengthType":"characters","maxLength":0,"minLength":0,"multiline":false,"regexPattern":"","regexFlags":"","required":false,"title":"Title fo a not required input component","type":"text-input"}},{"id":"4f109a8d-67ef-45fe-bbee-47e521246286","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"allowMultiple":true,"hasOther":true,"items":[{"id":"9eba0d70-969f-48e0-b4f1-f75a54044334","parentId":"4f109a8d-67ef-45fe-bbee-47e521246286","value":"1"},{"id":"93658c30-9fb0-44be-8602-ad4cd54bb6f7","parentId":"4f109a8d-67ef-45fe-bbee-47e521246286","value":"2"}],"required":true,"title":"Title of a required multiple choice component","type":"multiple-choice"}},{"id":"3d31162e-b230-4b4d-80ad-3162539e626d","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"allowMultiple":false,"hasOther":true,"items":[{"id":"f9283db1-882b-49ea-bda5-60c5296456bf","parentId":"3d31162e-b230-4b4d-80ad-3162539e626d","value":"1"},{"id":"abb2efeb-7d1d-4d3e-9539-167e85aea842","parentId":"3d31162e-b230-4b4d-80ad-3162539e626d","value":"2"}],"required":false,"title":"Title of a not required single choice component..?","type":"multiple-choice"}},{"id":"d44bf619-9ccf-4b5e-ba68-f8af944340fd","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"items":[{"id":"edd7fdf2-e61e-45a7-a0ee-a325c7ef589f","parentId":"d44bf619-9ccf-4b5e-ba68-f8af944340fd","value":"1"},{"id":"69422c78-eb17-4b77-9d42-95c4381fc24f","parentId":"d44bf619-9ccf-4b5e-ba68-f8af944340fd","value":"2"},{"id":"b45df36b-8c79-427a-beef-b56bd2a56bb6","parentId":"d44bf619-9ccf-4b5e-ba68-f8af944340fd","value":"3"}],"required":true,"title":"Title of a weird required dropdown component","type":"dropdown"}},{"id":"6786792e-4273-440c-9db8-f87b5f01daaf","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"items":[{"id":"03225a20-181a-4bd5-90a7-3d032dd3a281","parentId":"6786792e-4273-440c-9db8-f87b5f01daaf","value":"1"},{"id":"42491439-3414-4f31-aff9-1e06348694dc","parentId":"6786792e-4273-440c-9db8-f87b5f01daaf","value":"2"}],"required":false,"title":"Title fo a not required dropdown component","type":"dropdown"}},{"id":"6a26c77c-0519-4006-a044-55e89033ba17","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"min":0,"max":100,"step":2,"required":true,"title":"Title of a required range component","type":"range"}},{"id":"78addaa8-3c39-4fc7-bacd-76087782b077","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"min":0,"max":30,"step":1,"required":false,"title":"Actually not required range","type":"range"}},{"id":"77a6519f-d145-49cf-8077-a49720869550","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"allowMultiple":true,"columns":[{"id":"6fe345ea-adea-4e0d-ac6a-8dd3bc90a6f8","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"1"},{"id":"7f7bea8c-c8e0-4188-a9a9-d5adc440c3c9","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"2"},{"id":"27ffbf04-9045-493a-819e-9ff965f53606","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"3"},{"id":"be4585a3-93e9-49a1-902c-0e64cf698761","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"4"},{"id":"22f17ce6-fd42-4e9f-b02d-1bd22bf48b1a","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"5"}],"required":true,"rows":[{"id":"178cad73-e90e-4176-aa03-abc15af8323d","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"1"},{"id":"748d3d77-4aa9-4afb-8c32-369af872fef0","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"2"},{"id":"2ada54a2-1053-42d1-a214-b51f3252722a","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"3"}],"title":"Title of a required multiple selection table component","type":"multiple-choice-grid"}},{"id":"c95f1c52-9d99-4415-97a3-8d3816877b65","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"allowMultiple":false,"columns":[{"id":"332036cb-0863-47b5-ad4e-85647bf7a544","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"1"},{"id":"b4fdeef0-ff1c-488e-8e05-870bb2767fd3","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"2"},{"id":"bf1de695-907f-4ab3-a0a2-e01aff3e394d","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"3"},{"id":"c5b495ac-017c-4b02-9094-57bcbfa797fe","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"4"},{"id":"e36cb259-5883-4229-b9ac-1b6748a77703","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"5"}],"required":false,"rows":[{"id":"47905881-be86-4ed2-9b00-fe7dcf2fa394","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"1"},{"id":"baf3070f-a036-44f4-9229-b7ac742fc957","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"2"},{"id":"1d2de4e0-88aa-48f7-aa21-fe40878e45dd","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"3"}],"title":"Title of a not required not multiple choicce weird grid","type":"multiple-choice-grid"}},{"id":"caffd65a-e334-49b0-a479-89158d6d8e3c","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"required":true,"title":"Weird required date BUT LETS MAKE IT SUPERRRRRRRRR LONG JUST TO FUCK WITH JAYADEEP AND WHATEVER LITTLE REMAINING BRAINCELLS HE POSSIBLY COULD HAVE HOLY SHIT SO MUCH FUN","type":"date"}},{"id":"aacc8721-3bdf-4971-b5b0-38d123c232ca","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"required":false,"title":"Not required date tho","type":"date"}},{"id":"81159efb-7367-409e-915a-4a14cab3b2dd","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"altText":"","mediaType":"video","required":false,"title":"insert media here","type":"media","url":"https://www.youtube.com/watch?v=yxAxvFhf8ro"}}] - + await sleep(0) return (
diff --git a/src/functions/validations.ts b/src/functions/validations.ts index b14b677..d10f092 100644 --- a/src/functions/validations.ts +++ b/src/functions/validations.ts @@ -1,11 +1,11 @@ import FormItem from "@/interfaces/FormItem"; -import {FormResponses, Response} from "@/interfaces/FormResponses"; -import zod, {z, ZodError} from "zod"; +import { FormResponses, Response } from "@/interfaces/FormResponses"; +import { z, ZodError } from "zod"; import TextInputResponse from "@/interfaces/form-component-response-interfaces/TextInputResponse"; import DropdownResponse from "@/interfaces/form-component-response-interfaces/DropdownResponse"; import DateResponse from "@/interfaces/form-component-response-interfaces/DateResponse"; import RangeResponse from "@/interfaces/form-component-response-interfaces/RangeResponse"; -import {MultipleChoiceResponse} from "@/interfaces/form-component-response-interfaces/MultipleChoiceResponse"; +import { MultipleChoiceResponse } from "@/interfaces/form-component-response-interfaces/MultipleChoiceResponse"; import MultipleChoiceGridResponse from "@/interfaces/form-component-response-interfaces/MultipleChoiceGridResponse"; import FormResponseObject from "@/interfaces/FormResponseObject"; diff --git a/src/helpers/firebaseServer.ts b/src/helpers/firebaseServer.ts index ff7157b..8f7ecb0 100644 --- a/src/helpers/firebaseServer.ts +++ b/src/helpers/firebaseServer.ts @@ -1,6 +1,5 @@ // Import the functions you need from the SDKs you need import * as admin from "firebase-admin"; -import { credential } from "firebase-admin"; // TODO: Add SDKs for Firebase products that you want to use // https://firebase.google.com/docs/web/setup#available-libraries From 1a527de406c3229a36052457d2a038402e3f3ab5 Mon Sep 17 00:00:00 2001 From: SteakFisher Date: Mon, 10 Jun 2024 03:12:27 +0400 Subject: [PATCH 4/7] Wrapped FormItem with FormItemsObject --- src/actions/validations.ts | 5 ++++- src/app/form/page.tsx | 12 ++++++++++-- src/components/form-display/FormRenderer.tsx | 9 ++++++--- src/interfaces/FormItemsObject.ts | 6 ++++++ 4 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 src/interfaces/FormItemsObject.ts diff --git a/src/actions/validations.ts b/src/actions/validations.ts index 4e40c42..ca070b4 100644 --- a/src/actions/validations.ts +++ b/src/actions/validations.ts @@ -6,13 +6,16 @@ import { validateJSON } from "@/functions/validations"; import firestoreServer from "@/helpers/firestoreServer"; import FormResponseObject from "@/interfaces/FormResponseObject"; import { v4 as uuidv4 } from "uuid"; +import FormItemsObject from "@/interfaces/FormItemsObject"; -export async function serverValidate(formItems: FormItem[], formResponses: FormResponses) { +export async function serverValidate(formItemsObject: FormItemsObject, formResponses: FormResponses) { let formResponseObject : FormResponseObject = { responseId: uuidv4(), formResponse: formResponses } + let formItems = formItemsObject.formItems + let { errors } = validateJSON(formItems, formResponseObject) if (Object.keys(errors).length > 0) { return errors diff --git a/src/app/form/page.tsx b/src/app/form/page.tsx index b4dd3ba..7a2b5c6 100644 --- a/src/app/form/page.tsx +++ b/src/app/form/page.tsx @@ -2,6 +2,9 @@ import FormItem from "@/interfaces/FormItem"; import {Card} from "@/components/ui/card"; import {FormResponses, Response} from "@/interfaces/FormResponses"; import FormRenderer from "@/components/form-display/FormRenderer"; +import FormItemsObject from "@/interfaces/FormItemsObject"; +import { v4 as uuidv4 } from "uuid"; +import formItem from "@/interfaces/FormItem"; const formResponses: FormResponses = {} @@ -10,12 +13,17 @@ function sleep(ms = 0) { } export default async function Form() { - let formItems : FormItem[] = [{"id":"0","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"description":"Here's a description cuz y not","required":false,"title":"HUGE form for testing validation and implementing","type":"title"}},{"id":"f5633610-ccd5-42c7-9d5d-47ef889190b6","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":"https://avatars.githubusercontent.com/u/54469796?s=48&v=4"},"props":{"lengthType":"characters","maxLength":2,"minLength":0,"multiline":false,"regexPattern":"","regexFlags":"","required":true,"title":"Title of a required input component","type":"text-input"}},{"id":"f38f1931-49b7-4d07-bab1-6d513ec53361","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"lengthType":"characters","maxLength":0,"minLength":0,"multiline":false,"regexPattern":"","regexFlags":"","required":false,"title":"Title fo a not required input component","type":"text-input"}},{"id":"4f109a8d-67ef-45fe-bbee-47e521246286","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"allowMultiple":true,"hasOther":true,"items":[{"id":"9eba0d70-969f-48e0-b4f1-f75a54044334","parentId":"4f109a8d-67ef-45fe-bbee-47e521246286","value":"1"},{"id":"93658c30-9fb0-44be-8602-ad4cd54bb6f7","parentId":"4f109a8d-67ef-45fe-bbee-47e521246286","value":"2"}],"required":true,"title":"Title of a required multiple choice component","type":"multiple-choice"}},{"id":"3d31162e-b230-4b4d-80ad-3162539e626d","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"allowMultiple":false,"hasOther":true,"items":[{"id":"f9283db1-882b-49ea-bda5-60c5296456bf","parentId":"3d31162e-b230-4b4d-80ad-3162539e626d","value":"1"},{"id":"abb2efeb-7d1d-4d3e-9539-167e85aea842","parentId":"3d31162e-b230-4b4d-80ad-3162539e626d","value":"2"}],"required":false,"title":"Title of a not required single choice component..?","type":"multiple-choice"}},{"id":"d44bf619-9ccf-4b5e-ba68-f8af944340fd","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"items":[{"id":"edd7fdf2-e61e-45a7-a0ee-a325c7ef589f","parentId":"d44bf619-9ccf-4b5e-ba68-f8af944340fd","value":"1"},{"id":"69422c78-eb17-4b77-9d42-95c4381fc24f","parentId":"d44bf619-9ccf-4b5e-ba68-f8af944340fd","value":"2"},{"id":"b45df36b-8c79-427a-beef-b56bd2a56bb6","parentId":"d44bf619-9ccf-4b5e-ba68-f8af944340fd","value":"3"}],"required":true,"title":"Title of a weird required dropdown component","type":"dropdown"}},{"id":"6786792e-4273-440c-9db8-f87b5f01daaf","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"items":[{"id":"03225a20-181a-4bd5-90a7-3d032dd3a281","parentId":"6786792e-4273-440c-9db8-f87b5f01daaf","value":"1"},{"id":"42491439-3414-4f31-aff9-1e06348694dc","parentId":"6786792e-4273-440c-9db8-f87b5f01daaf","value":"2"}],"required":false,"title":"Title fo a not required dropdown component","type":"dropdown"}},{"id":"6a26c77c-0519-4006-a044-55e89033ba17","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"min":0,"max":100,"step":2,"required":true,"title":"Title of a required range component","type":"range"}},{"id":"78addaa8-3c39-4fc7-bacd-76087782b077","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"min":0,"max":30,"step":1,"required":false,"title":"Actually not required range","type":"range"}},{"id":"77a6519f-d145-49cf-8077-a49720869550","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"allowMultiple":true,"columns":[{"id":"6fe345ea-adea-4e0d-ac6a-8dd3bc90a6f8","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"1"},{"id":"7f7bea8c-c8e0-4188-a9a9-d5adc440c3c9","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"2"},{"id":"27ffbf04-9045-493a-819e-9ff965f53606","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"3"},{"id":"be4585a3-93e9-49a1-902c-0e64cf698761","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"4"},{"id":"22f17ce6-fd42-4e9f-b02d-1bd22bf48b1a","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"5"}],"required":true,"rows":[{"id":"178cad73-e90e-4176-aa03-abc15af8323d","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"1"},{"id":"748d3d77-4aa9-4afb-8c32-369af872fef0","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"2"},{"id":"2ada54a2-1053-42d1-a214-b51f3252722a","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"3"}],"title":"Title of a required multiple selection table component","type":"multiple-choice-grid"}},{"id":"c95f1c52-9d99-4415-97a3-8d3816877b65","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"allowMultiple":false,"columns":[{"id":"332036cb-0863-47b5-ad4e-85647bf7a544","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"1"},{"id":"b4fdeef0-ff1c-488e-8e05-870bb2767fd3","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"2"},{"id":"bf1de695-907f-4ab3-a0a2-e01aff3e394d","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"3"},{"id":"c5b495ac-017c-4b02-9094-57bcbfa797fe","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"4"},{"id":"e36cb259-5883-4229-b9ac-1b6748a77703","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"5"}],"required":false,"rows":[{"id":"47905881-be86-4ed2-9b00-fe7dcf2fa394","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"1"},{"id":"baf3070f-a036-44f4-9229-b7ac742fc957","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"2"},{"id":"1d2de4e0-88aa-48f7-aa21-fe40878e45dd","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"3"}],"title":"Title of a not required not multiple choicce weird grid","type":"multiple-choice-grid"}},{"id":"caffd65a-e334-49b0-a479-89158d6d8e3c","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"required":true,"title":"Weird required date BUT LETS MAKE IT SUPERRRRRRRRR LONG JUST TO FUCK WITH JAYADEEP AND WHATEVER LITTLE REMAINING BRAINCELLS HE POSSIBLY COULD HAVE HOLY SHIT SO MUCH FUN","type":"date"}},{"id":"aacc8721-3bdf-4971-b5b0-38d123c232ca","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"required":false,"title":"Not required date tho","type":"date"}},{"id":"81159efb-7367-409e-915a-4a14cab3b2dd","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"altText":"","mediaType":"video","required":false,"title":"insert media here","type":"media","url":"https://www.youtube.com/watch?v=yxAxvFhf8ro"}}] + let formItems : FormItem[] = [{"id":"0","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"description":"Here's a description cuz y not","required":false,"title":"HUGE form for testing validation and implementing","type":"title"}},{"id":"f5633610-ccd5-42c7-9d5d-47ef889190b6","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":"https://avatars.githubusercontent.com/u/54469796?s=48&v=4"},"props":{"lengthType":"characters","maxLength":2,"minLength":0,"multiline":false,"regexPattern":"","regexFlags":"","required":true,"title":"Title of a required input component","type":"text-input"}},{"id":"f38f1931-49b7-4d07-bab1-6d513ec53361","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"lengthType":"characters","maxLength":0,"minLength":0,"multiline":false,"regexPattern":"","regexFlags":"","required":false,"title":"Title fo a not required input component","type":"text-input"}},{"id":"4f109a8d-67ef-45fe-bbee-47e521246286","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"allowMultiple":true,"hasOther":true,"items":[{"id":"9eba0d70-969f-48e0-b4f1-f75a54044334","parentId":"4f109a8d-67ef-45fe-bbee-47e521246286","value":"1"},{"id":"93658c30-9fb0-44be-8602-ad4cd54bb6f7","parentId":"4f109a8d-67ef-45fe-bbee-47e521246286","value":"2"}],"required":true,"title":"Title of a required multiple choice component","type":"multiple-choice"}},{"id":"3d31162e-b230-4b4d-80ad-3162539e626d","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"allowMultiple":false,"hasOther":true,"items":[{"id":"f9283db1-882b-49ea-bda5-60c5296456bf","parentId":"3d31162e-b230-4b4d-80ad-3162539e626d","value":"1"},{"id":"abb2efeb-7d1d-4d3e-9539-167e85aea842","parentId":"3d31162e-b230-4b4d-80ad-3162539e626d","value":"2"}],"required":false,"title":"Title of a not required single choice component..?","type":"multiple-choice"}},{"id":"d44bf619-9ccf-4b5e-ba68-f8af944340fd","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"items":[{"id":"edd7fdf2-e61e-45a7-a0ee-a325c7ef589f","parentId":"d44bf619-9ccf-4b5e-ba68-f8af944340fd","value":"1"},{"id":"69422c78-eb17-4b77-9d42-95c4381fc24f","parentId":"d44bf619-9ccf-4b5e-ba68-f8af944340fd","value":"2"},{"id":"b45df36b-8c79-427a-beef-b56bd2a56bb6","parentId":"d44bf619-9ccf-4b5e-ba68-f8af944340fd","value":"3"}],"required":true,"title":"Title of a weird required dropdown component","type":"dropdown"}},{"id":"6786792e-4273-440c-9db8-f87b5f01daaf","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"items":[{"id":"03225a20-181a-4bd5-90a7-3d032dd3a281","parentId":"6786792e-4273-440c-9db8-f87b5f01daaf","value":"1"},{"id":"42491439-3414-4f31-aff9-1e06348694dc","parentId":"6786792e-4273-440c-9db8-f87b5f01daaf","value":"2"}],"required":false,"title":"Title fo a not required dropdown component","type":"dropdown"}},{"id":"6a26c77c-0519-4006-a044-55e89033ba17","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"min":0,"max":100,"step":2,"required":true,"title":"Title of a required range component","type":"range"}},{"id":"78addaa8-3c39-4fc7-bacd-76087782b077","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"min":0,"max":30,"step":1,"required":false,"title":"Actually not required range","type":"range"}},{"id":"77a6519f-d145-49cf-8077-a49720869550","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"allowMultiple":true,"columns":[{"id":"6fe345ea-adea-4e0d-ac6a-8dd3bc90a6f8","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"1"},{"id":"7f7bea8c-c8e0-4188-a9a9-d5adc440c3c9","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"2"},{"id":"27ffbf04-9045-493a-819e-9ff965f53606","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"3"},{"id":"be4585a3-93e9-49a1-902c-0e64cf698761","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"4"},{"id":"22f17ce6-fd42-4e9f-b02d-1bd22bf48b1a","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"5"}],"required":true,"rows":[{"id":"178cad73-e90e-4176-aa03-abc15af8323d","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"1"},{"id":"748d3d77-4aa9-4afb-8c32-369af872fef0","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"2"},{"id":"2ada54a2-1053-42d1-a214-b51f3252722a","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"3"}],"title":"Title of a required multiple selection table component","type":"multiple-choice-grid"}},{"id":"c95f1c52-9d99-4415-97a3-8d3816877b65","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"allowMultiple":false,"columns":[{"id":"332036cb-0863-47b5-ad4e-85647bf7a544","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"1"},{"id":"b4fdeef0-ff1c-488e-8e05-870bb2767fd3","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"2"},{"id":"bf1de695-907f-4ab3-a0a2-e01aff3e394d","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"3"},{"id":"c5b495ac-017c-4b02-9094-57bcbfa797fe","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"4"},{"id":"e36cb259-5883-4229-b9ac-1b6748a77703","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"5"}],"required":false,"rows":[{"id":"47905881-be86-4ed2-9b00-fe7dcf2fa394","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"1"},{"id":"baf3070f-a036-44f4-9229-b7ac742fc957","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"2"},{"id":"1d2de4e0-88aa-48f7-aa21-fe40878e45dd","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"3"}],"title":"Title of a not required not multiple choicce weird grid","type":"multiple-choice-grid"}},{"id":"caffd65a-e334-49b0-a479-89158d6d8e3c","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"required":true,"title":"Weird required date BUT LETS MAKE IT SUPERRRRRRRRR LONG JUST TO FUCK WITH JAYADEEP AND WHATEVER LITTLE REMAINING BRAINCELLS HE POSSIBLY COULD HAVE HOLY SHIT SO MUCH FUN","type":"date"}},{"id":"aacc8721-3bdf-4971-b5b0-38d123c232ca","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"required":false,"title":"Not required date tho","type":"date"}},{"id":"81159efb-7367-409e-915a-4a14cab3b2dd","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"altText":"","mediaType":"video","required":false,"title":"insert media here","type":"media","url":"https://www.youtube.com/watch?v=yxAxvFhf8ro"}}] await sleep(0) + let formItemsObject : FormItemsObject = { + formId: uuidv4(), + formItems: formItems + } + return (
- +
); diff --git a/src/components/form-display/FormRenderer.tsx b/src/components/form-display/FormRenderer.tsx index 92828ca..2ff42ad 100644 --- a/src/components/form-display/FormRenderer.tsx +++ b/src/components/form-display/FormRenderer.tsx @@ -15,16 +15,19 @@ import {validateJSON} from "@/functions/validations"; import {serverValidate} from "@/actions/validations"; import {toast} from "sonner"; import {Button} from "@/components/ui/button"; +import FormItemsObject from "@/interfaces/FormItemsObject"; -export default function FormRenderer({ formItems, formResponses } : { formItems: FormItem[], formResponses: FormResponses }) { - return ( +export default function FormRenderer({ formItemsObject, formResponses } : { formItemsObject: FormItemsObject, formResponses: FormResponses }) { + let formItems = formItemsObject.formItems + + return ( { let { errors } = validateJSON(formItems, { responseId: "placeholderValue", formResponse: formResponses }) if (Object.keys(errors).length == 0) { - errors = await serverValidate(formItems, formResponses) + errors = await serverValidate(formItemsObject, formResponses) } if (Object.keys(errors).length > 0) { Object.keys(errors).map((key) => { diff --git a/src/interfaces/FormItemsObject.ts b/src/interfaces/FormItemsObject.ts new file mode 100644 index 0000000..6161e30 --- /dev/null +++ b/src/interfaces/FormItemsObject.ts @@ -0,0 +1,6 @@ +import FormItem from "@/interfaces/FormItem"; + +export default interface FormItemsObject { + formId: string; + formItems: FormItem[]; +} \ No newline at end of file From 10de8cf895dafe642f61cae444e2ca9317a6f04b Mon Sep 17 00:00:00 2001 From: SteakFisher Date: Mon, 10 Jun 2024 04:46:05 +0400 Subject: [PATCH 5/7] DATA SAVING DONEEE --- src/actions/validations.ts | 55 +++++++++++++++++--- src/app/form/page.tsx | 4 +- src/components/form-display/FormRenderer.tsx | 10 ++-- src/functions/validations.ts | 6 +-- 4 files changed, 59 insertions(+), 16 deletions(-) diff --git a/src/actions/validations.ts b/src/actions/validations.ts index ca070b4..b84357f 100644 --- a/src/actions/validations.ts +++ b/src/actions/validations.ts @@ -7,6 +7,13 @@ import firestoreServer from "@/helpers/firestoreServer"; import FormResponseObject from "@/interfaces/FormResponseObject"; import { v4 as uuidv4 } from "uuid"; import FormItemsObject from "@/interfaces/FormItemsObject"; +import formItem from "@/interfaces/FormItem"; +import DropdownResponse from "@/interfaces/form-component-response-interfaces/DropdownResponse"; +import MultipleChoiceGridResponse from "@/interfaces/form-component-response-interfaces/MultipleChoiceGridResponse"; + +type SelectedJSONGridResponse = { + [key: string]: Array +} export async function serverValidate(formItemsObject: FormItemsObject, formResponses: FormResponses) { @@ -16,16 +23,52 @@ export async function serverValidate(formItemsObject: FormItemsObject, formRespo } let formItems = formItemsObject.formItems - let { errors } = validateJSON(formItems, formResponseObject) + let { finalResponse, errors } = validateJSON(formItems, formResponses) if (Object.keys(errors).length > 0) { return errors } else { - // Save the data - const db = firestoreServer() - let document = await db.doc(`Responses/FormID/ComponentID/ResponseID`).get() - console.log(document.data()) + try { + // Save the data + const db = firestoreServer() + const formCollection = db.doc(`Responses/${formItemsObject.formId}`) + let writeBatch = db.batch(); + + let writeCount = 0 + + formItems.map(async (item) => { + let responseId = formResponseObject.responseId + let responseCollection = formCollection.collection(`${item.id}`).doc(responseId) + + if (finalResponse[item.id] == undefined) return + + if (finalResponse[item.id].type === "multiple-choice-grid") { + let multipleChoiceGridResponse = finalResponse[item.id] as MultipleChoiceGridResponse + let selected : SelectedJSONGridResponse = {} + Object.keys(multipleChoiceGridResponse.selected).map((key) => { + selected[key] = Array.from(multipleChoiceGridResponse.selected[key]) + }) + writeCount++ + writeBatch.set(responseCollection, { ...finalResponse[item.id], selected: selected }) + return + } + + writeCount++ + writeBatch.set(responseCollection, finalResponse[item.id]) + }) + + let result = await writeBatch.commit() + + console.log(result) + + if (result.length < writeCount) return { "error": "An error occurred while saving the data"} + + // let document = await db.doc(`Responses/FormID/ComponentID/ResponseID`).get() + // console.log(document.data()) - return {} + return {} + } catch (e) { + return { "error": "An error occurred while saving the data"} + } }// Otherwise save the data } diff --git a/src/app/form/page.tsx b/src/app/form/page.tsx index 7a2b5c6..0710d4b 100644 --- a/src/app/form/page.tsx +++ b/src/app/form/page.tsx @@ -3,8 +3,6 @@ import {Card} from "@/components/ui/card"; import {FormResponses, Response} from "@/interfaces/FormResponses"; import FormRenderer from "@/components/form-display/FormRenderer"; import FormItemsObject from "@/interfaces/FormItemsObject"; -import { v4 as uuidv4 } from "uuid"; -import formItem from "@/interfaces/FormItem"; const formResponses: FormResponses = {} @@ -16,7 +14,7 @@ export default async function Form() { let formItems : FormItem[] = [{"id":"0","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"description":"Here's a description cuz y not","required":false,"title":"HUGE form for testing validation and implementing","type":"title"}},{"id":"f5633610-ccd5-42c7-9d5d-47ef889190b6","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":"https://avatars.githubusercontent.com/u/54469796?s=48&v=4"},"props":{"lengthType":"characters","maxLength":2,"minLength":0,"multiline":false,"regexPattern":"","regexFlags":"","required":true,"title":"Title of a required input component","type":"text-input"}},{"id":"f38f1931-49b7-4d07-bab1-6d513ec53361","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"lengthType":"characters","maxLength":0,"minLength":0,"multiline":false,"regexPattern":"","regexFlags":"","required":false,"title":"Title fo a not required input component","type":"text-input"}},{"id":"4f109a8d-67ef-45fe-bbee-47e521246286","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"allowMultiple":true,"hasOther":true,"items":[{"id":"9eba0d70-969f-48e0-b4f1-f75a54044334","parentId":"4f109a8d-67ef-45fe-bbee-47e521246286","value":"1"},{"id":"93658c30-9fb0-44be-8602-ad4cd54bb6f7","parentId":"4f109a8d-67ef-45fe-bbee-47e521246286","value":"2"}],"required":true,"title":"Title of a required multiple choice component","type":"multiple-choice"}},{"id":"3d31162e-b230-4b4d-80ad-3162539e626d","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"allowMultiple":false,"hasOther":true,"items":[{"id":"f9283db1-882b-49ea-bda5-60c5296456bf","parentId":"3d31162e-b230-4b4d-80ad-3162539e626d","value":"1"},{"id":"abb2efeb-7d1d-4d3e-9539-167e85aea842","parentId":"3d31162e-b230-4b4d-80ad-3162539e626d","value":"2"}],"required":false,"title":"Title of a not required single choice component..?","type":"multiple-choice"}},{"id":"d44bf619-9ccf-4b5e-ba68-f8af944340fd","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"items":[{"id":"edd7fdf2-e61e-45a7-a0ee-a325c7ef589f","parentId":"d44bf619-9ccf-4b5e-ba68-f8af944340fd","value":"1"},{"id":"69422c78-eb17-4b77-9d42-95c4381fc24f","parentId":"d44bf619-9ccf-4b5e-ba68-f8af944340fd","value":"2"},{"id":"b45df36b-8c79-427a-beef-b56bd2a56bb6","parentId":"d44bf619-9ccf-4b5e-ba68-f8af944340fd","value":"3"}],"required":true,"title":"Title of a weird required dropdown component","type":"dropdown"}},{"id":"6786792e-4273-440c-9db8-f87b5f01daaf","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"items":[{"id":"03225a20-181a-4bd5-90a7-3d032dd3a281","parentId":"6786792e-4273-440c-9db8-f87b5f01daaf","value":"1"},{"id":"42491439-3414-4f31-aff9-1e06348694dc","parentId":"6786792e-4273-440c-9db8-f87b5f01daaf","value":"2"}],"required":false,"title":"Title fo a not required dropdown component","type":"dropdown"}},{"id":"6a26c77c-0519-4006-a044-55e89033ba17","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"min":0,"max":100,"step":2,"required":true,"title":"Title of a required range component","type":"range"}},{"id":"78addaa8-3c39-4fc7-bacd-76087782b077","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"min":0,"max":30,"step":1,"required":false,"title":"Actually not required range","type":"range"}},{"id":"77a6519f-d145-49cf-8077-a49720869550","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"allowMultiple":true,"columns":[{"id":"6fe345ea-adea-4e0d-ac6a-8dd3bc90a6f8","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"1"},{"id":"7f7bea8c-c8e0-4188-a9a9-d5adc440c3c9","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"2"},{"id":"27ffbf04-9045-493a-819e-9ff965f53606","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"3"},{"id":"be4585a3-93e9-49a1-902c-0e64cf698761","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"4"},{"id":"22f17ce6-fd42-4e9f-b02d-1bd22bf48b1a","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"5"}],"required":true,"rows":[{"id":"178cad73-e90e-4176-aa03-abc15af8323d","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"1"},{"id":"748d3d77-4aa9-4afb-8c32-369af872fef0","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"2"},{"id":"2ada54a2-1053-42d1-a214-b51f3252722a","parentId":"77a6519f-d145-49cf-8077-a49720869550","value":"3"}],"title":"Title of a required multiple selection table component","type":"multiple-choice-grid"}},{"id":"c95f1c52-9d99-4415-97a3-8d3816877b65","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"allowMultiple":false,"columns":[{"id":"332036cb-0863-47b5-ad4e-85647bf7a544","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"1"},{"id":"b4fdeef0-ff1c-488e-8e05-870bb2767fd3","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"2"},{"id":"bf1de695-907f-4ab3-a0a2-e01aff3e394d","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"3"},{"id":"c5b495ac-017c-4b02-9094-57bcbfa797fe","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"4"},{"id":"e36cb259-5883-4229-b9ac-1b6748a77703","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"5"}],"required":false,"rows":[{"id":"47905881-be86-4ed2-9b00-fe7dcf2fa394","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"1"},{"id":"baf3070f-a036-44f4-9229-b7ac742fc957","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"2"},{"id":"1d2de4e0-88aa-48f7-aa21-fe40878e45dd","parentId":"c95f1c52-9d99-4415-97a3-8d3816877b65","value":"3"}],"title":"Title of a not required not multiple choicce weird grid","type":"multiple-choice-grid"}},{"id":"caffd65a-e334-49b0-a479-89158d6d8e3c","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"required":true,"title":"Weird required date BUT LETS MAKE IT SUPERRRRRRRRR LONG JUST TO FUCK WITH JAYADEEP AND WHATEVER LITTLE REMAINING BRAINCELLS HE POSSIBLY COULD HAVE HOLY SHIT SO MUCH FUN","type":"date"}},{"id":"aacc8721-3bdf-4971-b5b0-38d123c232ca","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"required":false,"title":"Not required date tho","type":"date"}},{"id":"81159efb-7367-409e-915a-4a14cab3b2dd","mediaProps":{"mediaAltText":"","mediaType":"image","mediaUrl":""},"props":{"altText":"","mediaType":"video","required":false,"title":"insert media here","type":"media","url":"https://www.youtube.com/watch?v=yxAxvFhf8ro"}}] await sleep(0) let formItemsObject : FormItemsObject = { - formId: uuidv4(), + formId: "2e05825d-baaf-4cb1-89a8-a2eec3b66cdc", formItems: formItems } diff --git a/src/components/form-display/FormRenderer.tsx b/src/components/form-display/FormRenderer.tsx index 2ff42ad..c43be8f 100644 --- a/src/components/form-display/FormRenderer.tsx +++ b/src/components/form-display/FormRenderer.tsx @@ -22,15 +22,17 @@ export default function FormRenderer({ formItemsObject, formResponses } : { form return ( { - let { errors } = validateJSON(formItems, { - responseId: "placeholderValue", - formResponse: formResponses - }) + let { errors } = validateJSON(formItems, formResponses) if (Object.keys(errors).length == 0) { errors = await serverValidate(formItemsObject, formResponses) } if (Object.keys(errors).length > 0) { Object.keys(errors).map((key) => { + if (key === "error") { + toast.error(errors[key]) + return + } + let name = formItems.filter((item) => item.id === key)[0].props.title toast.error(name, { description: errors[key] diff --git a/src/functions/validations.ts b/src/functions/validations.ts index d10f092..c80aaae 100644 --- a/src/functions/validations.ts +++ b/src/functions/validations.ts @@ -15,9 +15,8 @@ type Errors = { -export function validateJSON(formItems: FormItem[], formResponseObject: FormResponseObject) { +export function validateJSON(formItems: FormItem[], formResponses: FormResponses) { let errors : Errors = {} - let formResponses = formResponseObject.formResponse; let finalResponse = {} as FormResponses formItems.map((item) => { @@ -88,7 +87,8 @@ export function validateJSON(formItems: FormItem[], formResponseObject: FormResp } }) - if (Object.keys(errors).length === 0) finalResponse = {} + if (Object.keys(errors).length != 0) finalResponse = {} + return { finalResponse, errors } } From 401ab86dce191b5316eb866649f8781314520696 Mon Sep 17 00:00:00 2001 From: SteakFisher Date: Mon, 10 Jun 2024 04:51:44 +0400 Subject: [PATCH 6/7] removed unused imports --- src/actions/validations.ts | 3 --- src/components/form-display/FormRenderer.tsx | 15 +++++++-------- src/functions/validations.ts | 1 - 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/actions/validations.ts b/src/actions/validations.ts index b84357f..d479dfe 100644 --- a/src/actions/validations.ts +++ b/src/actions/validations.ts @@ -1,14 +1,11 @@ "use server"; import { FormResponses, Response } from "@/interfaces/FormResponses"; -import FormItem from "@/interfaces/FormItem"; import { validateJSON } from "@/functions/validations"; import firestoreServer from "@/helpers/firestoreServer"; import FormResponseObject from "@/interfaces/FormResponseObject"; import { v4 as uuidv4 } from "uuid"; import FormItemsObject from "@/interfaces/FormItemsObject"; -import formItem from "@/interfaces/FormItem"; -import DropdownResponse from "@/interfaces/form-component-response-interfaces/DropdownResponse"; import MultipleChoiceGridResponse from "@/interfaces/form-component-response-interfaces/MultipleChoiceGridResponse"; type SelectedJSONGridResponse = { diff --git a/src/components/form-display/FormRenderer.tsx b/src/components/form-display/FormRenderer.tsx index c43be8f..55a276d 100644 --- a/src/components/form-display/FormRenderer.tsx +++ b/src/components/form-display/FormRenderer.tsx @@ -1,4 +1,4 @@ -"use client" +"use client"; import TitleComponent from "@/components/form-display/TitleComponent"; import TextInputComponent from "@/components/form-display/TextInputComponent"; @@ -8,13 +8,12 @@ import RangeComponent from "@/components/form-display/RangeComponent"; import MultipleChoiceGridComponent from "@/components/form-display/MultipleChoiceGridComponent"; import DateComponent from "@/components/form-display/DateComponent"; import MediaComponent from "@/components/form-display/MediaComponent"; -import {FormRendererContext} from "@/contexts/FormRendererContext"; -import {FormResponses, Response} from "@/interfaces/FormResponses"; -import FormItem from "@/interfaces/FormItem"; -import {validateJSON} from "@/functions/validations"; -import {serverValidate} from "@/actions/validations"; -import {toast} from "sonner"; -import {Button} from "@/components/ui/button"; +import { FormRendererContext } from "@/contexts/FormRendererContext"; +import { FormResponses, Response } from "@/interfaces/FormResponses"; +import { validateJSON } from "@/functions/validations"; +import { serverValidate } from "@/actions/validations"; +import { toast } from "sonner"; +import { Button } from "@/components/ui/button"; import FormItemsObject from "@/interfaces/FormItemsObject"; export default function FormRenderer({ formItemsObject, formResponses } : { formItemsObject: FormItemsObject, formResponses: FormResponses }) { diff --git a/src/functions/validations.ts b/src/functions/validations.ts index c80aaae..edc3e4b 100644 --- a/src/functions/validations.ts +++ b/src/functions/validations.ts @@ -7,7 +7,6 @@ import DateResponse from "@/interfaces/form-component-response-interfaces/DateRe import RangeResponse from "@/interfaces/form-component-response-interfaces/RangeResponse"; import { MultipleChoiceResponse } from "@/interfaces/form-component-response-interfaces/MultipleChoiceResponse"; import MultipleChoiceGridResponse from "@/interfaces/form-component-response-interfaces/MultipleChoiceGridResponse"; -import FormResponseObject from "@/interfaces/FormResponseObject"; type Errors = { [id: string]: string From 9d5e992907ef6066e7b3c8e72eb001a9f6c3d7fb Mon Sep 17 00:00:00 2001 From: SteakFisher Date: Tue, 11 Jun 2024 01:58:50 +0400 Subject: [PATCH 7/7] Razin added his imports --- src/actions/FBValidation.ts | 4 +++ src/actions/validations.ts | 9 +++--- src/app/form/[id]/edit/page.tsx | 11 +++++++ src/app/form/{ => [id]}/loading.tsx | 0 src/app/form/{ => [id]}/page.tsx | 0 src/app/form/new/page.tsx | 15 ++++++++++ src/app/new-form/save/page.tsx | 30 ------------------- src/app/page.tsx | 2 +- .../FormBuilderWrapper.tsx} | 19 +++++------- src/components/toolbar/Toolbar.tsx | 2 -- 10 files changed, 44 insertions(+), 48 deletions(-) create mode 100644 src/app/form/[id]/edit/page.tsx rename src/app/form/{ => [id]}/loading.tsx (100%) rename src/app/form/{ => [id]}/page.tsx (100%) create mode 100644 src/app/form/new/page.tsx delete mode 100644 src/app/new-form/save/page.tsx rename src/{app/new-form/page.tsx => components/FormBuilderWrapper.tsx} (80%) diff --git a/src/actions/FBValidation.ts b/src/actions/FBValidation.ts index be8964b..da4c90b 100644 --- a/src/actions/FBValidation.ts +++ b/src/actions/FBValidation.ts @@ -21,6 +21,7 @@ import TextInputProps from "@/interfaces/form-component-interfaces/TextInputProp import TitleProps from "@/interfaces/form-component-interfaces/TitleProps"; import FormItem from "@/interfaces/FormItem"; import { z } from "zod"; +import { redirect } from "next/navigation"; export type FBValidateError = { id: string; message: string }; @@ -176,6 +177,9 @@ export async function FBValidateForm( } } + localStorage.setItem("formItemsObject", JSON.stringify(formItems)); + // after saving + redirect(`/form/${3}/edit`); return { id: "", message: "" }; } diff --git a/src/actions/validations.ts b/src/actions/validations.ts index d479dfe..b68c03b 100644 --- a/src/actions/validations.ts +++ b/src/actions/validations.ts @@ -14,10 +14,6 @@ type SelectedJSONGridResponse = { export async function serverValidate(formItemsObject: FormItemsObject, formResponses: FormResponses) { - let formResponseObject : FormResponseObject = { - responseId: uuidv4(), - formResponse: formResponses - } let formItems = formItemsObject.formItems let { finalResponse, errors } = validateJSON(formItems, formResponses) @@ -25,6 +21,11 @@ export async function serverValidate(formItemsObject: FormItemsObject, formRespo return errors } else { try { + let formResponseObject : FormResponseObject = { + responseId: uuidv4(), + formResponse: formResponses + } + // Save the data const db = firestoreServer() const formCollection = db.doc(`Responses/${formItemsObject.formId}`) diff --git a/src/app/form/[id]/edit/page.tsx b/src/app/form/[id]/edit/page.tsx new file mode 100644 index 0000000..52a22b3 --- /dev/null +++ b/src/app/form/[id]/edit/page.tsx @@ -0,0 +1,11 @@ +import FormItem from "@/interfaces/FormItem"; +import FormBuilderWrapper from "@/components/FormBuilderWrapper"; +import FormItemsObject from "@/interfaces/FormItemsObject"; + +const Page = () => { + const formItemsObject: FormItemsObject = JSON.parse(localStorage.getItem("formItemsObject") ?? '{}'); + + return +}; + +export default Page; diff --git a/src/app/form/loading.tsx b/src/app/form/[id]/loading.tsx similarity index 100% rename from src/app/form/loading.tsx rename to src/app/form/[id]/loading.tsx diff --git a/src/app/form/page.tsx b/src/app/form/[id]/page.tsx similarity index 100% rename from src/app/form/page.tsx rename to src/app/form/[id]/page.tsx diff --git a/src/app/form/new/page.tsx b/src/app/form/new/page.tsx new file mode 100644 index 0000000..9253860 --- /dev/null +++ b/src/app/form/new/page.tsx @@ -0,0 +1,15 @@ +import FormBuilderWrapper from "@/components/FormBuilderWrapper"; +import {v4 as uuid} from "uuid"; +import FormItemsObject from "@/interfaces/FormItemsObject"; +import { constants } from "@/constants"; + +export default function New() { + let formItemsObject : FormItemsObject = { + formId: uuid(), + formItems: constants.defaultFormItems, + } + + return ( + + ) +} \ No newline at end of file diff --git a/src/app/new-form/save/page.tsx b/src/app/new-form/save/page.tsx deleted file mode 100644 index a89b3df..0000000 --- a/src/app/new-form/save/page.tsx +++ /dev/null @@ -1,30 +0,0 @@ -"use client"; - -import { FormBuilderContext } from "@/contexts/FormBuilderContext"; -import {useContext, useEffect, useState} from "react"; -import FormItem from "@/interfaces/FormItem"; - -export default function SavePage() { - const [formItems, setFormItems] = useState([] as FormItem[]); - - useEffect(() => { - const formItems : FormItem[] = JSON.parse(localStorage.getItem("formItems") ?? "[]"); - setFormItems(formItems) - }, []) - - return ( -
- {JSON.stringify(formItems)} - {/* {formItems.map((formItem) => { - return ( -
-
{formItem.id}
-
{formItem.props.type}
-
{JSON.stringify(formItem.props)}
-

-
- ); - })} */} -
- ); -} diff --git a/src/app/page.tsx b/src/app/page.tsx index d366e7c..3bf9148 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -3,7 +3,7 @@ import Link from "next/link"; export default function Home() { return (
- Create New Form + Create New Form
); } diff --git a/src/app/new-form/page.tsx b/src/components/FormBuilderWrapper.tsx similarity index 80% rename from src/app/new-form/page.tsx rename to src/components/FormBuilderWrapper.tsx index 1ba55b9..986f1d0 100644 --- a/src/app/new-form/page.tsx +++ b/src/components/FormBuilderWrapper.tsx @@ -1,13 +1,14 @@ "use client"; +import { useEffect, useMemo, useRef, useState } from "react"; +import FormItem from "@/interfaces/FormItem"; +import { FormBuilderContext } from "@/contexts/FormBuilderContext"; import FormBuilder from "@/components/FormBuilder"; import Toolbar from "@/components/toolbar/Toolbar"; -import { constants } from "@/constants"; -import { FormBuilderContext } from "@/contexts/FormBuilderContext"; -import FormItem from "@/interfaces/FormItem"; -import { useEffect, useMemo, useRef, useState } from "react"; +import FormItemsObject from "@/interfaces/FormItemsObject"; + -const NewFormPage = () => { +export default function FormBuilderWrapper({ formItemsObject } : { formItemsObject: FormItemsObject }) { const debounceRefs = useMemo(() => new Map(), []); const firstRenderRef = useRef(false); const focusedItemRef = useRef({ id: "0", blurItem: () => {} }); @@ -15,9 +16,7 @@ const NewFormPage = () => { const heightDiffRef = useRef({ heightDiff: 0, shouldScroll: false }); const isSavingRef = useRef(false); - const [formItems, setFormItems] = useState( - constants.defaultFormItems, - ); + const [formItems, setFormItems] = useState(formItemsObject.formItems); useEffect(() => { firstRenderRef.current = false; @@ -42,6 +41,4 @@ const NewFormPage = () => { ); -}; - -export default NewFormPage; +} \ No newline at end of file diff --git a/src/components/toolbar/Toolbar.tsx b/src/components/toolbar/Toolbar.tsx index c0f565f..9ad1612 100644 --- a/src/components/toolbar/Toolbar.tsx +++ b/src/components/toolbar/Toolbar.tsx @@ -163,8 +163,6 @@ const Toolbar = () => { }, Math.max(savingTimeout - (Date.now() - timeoutStart), 0), ); - // localStorage.setItem("formItems", JSON.stringify(formItems)); - // router.push("../../new-form/save"); }); } };