From b30155a7a55c7ba185d76620826c31288b4592e1 Mon Sep 17 00:00:00 2001 From: Razin Date: Fri, 14 Jun 2024 12:19:03 +0400 Subject: [PATCH 1/2] Implement form builder saving and edit --- drizzle/schema.ts | 27 +- package-lock.json | 1445 +----------------- package.json | 2 - src/actions/FBValidateAction.ts | 58 +- src/app/form/[formId]/edit/page.tsx | 28 + src/app/form/{[id] => [formId]}/loading.tsx | 0 src/app/form/[formId]/page.tsx | 332 ++++ src/app/form/[id]/edit/page.tsx | 11 - src/app/form/[id]/page.tsx | 28 - src/app/form/new/page.tsx | 14 +- src/components/FormBuilderWrapper.tsx | 25 +- src/components/form-display/FormRenderer.tsx | 190 ++- src/components/toolbar/Toolbar.tsx | 97 +- src/functions/FBValidation.ts | 264 ++-- src/helpers/drizzleTurso.ts | 7 +- src/interfaces/FormItemsObject.ts | 4 +- 16 files changed, 843 insertions(+), 1689 deletions(-) create mode 100644 src/app/form/[formId]/edit/page.tsx rename src/app/form/{[id] => [formId]}/loading.tsx (100%) create mode 100644 src/app/form/[formId]/page.tsx delete mode 100644 src/app/form/[id]/edit/page.tsx delete mode 100644 src/app/form/[id]/page.tsx diff --git a/drizzle/schema.ts b/drizzle/schema.ts index 3015ff5..8e0e8df 100644 --- a/drizzle/schema.ts +++ b/drizzle/schema.ts @@ -1,5 +1,24 @@ -import { sqliteTable, text } from "drizzle-orm/sqlite-core"; +import FormItem from "@/interfaces/FormItem"; +import { + index, + integer, + sqliteTable, + text, + uniqueIndex, +} from "drizzle-orm/sqlite-core"; -export const fooTable = sqliteTable("foo", { - bar: text("bar").notNull().default("Hey!"), -}); +export const formsTable = sqliteTable( + "forms", + { + formId: text("formId").primaryKey(), + userId: text("userId").notNull(), + formJson: text("formJson", { mode: "json" }).notNull().$type(), + version: integer("version", { mode: "number" }).notNull(), + }, + (table) => { + return { + formIdInd: uniqueIndex("formId_ind").on(table.formId), + userIdInd: index("userId_ind").on(table.userId), + }; + }, +); diff --git a/package-lock.json b/package-lock.json index 98567f0..24c9805 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,8 +47,6 @@ "clsx": "^2.1.0", "cmdk": "^0.2.1", "date-fns": "^3.3.1", - "dotenv": "^16.4.5", - "drizzle-orm": "^0.31.2", "embla-carousel-react": "^8.0.0-rc22", "firebase": "^10.12.2", "firebase-admin": "^12.1.1", @@ -2284,831 +2282,6 @@ "react": ">=16.8.0" } }, - "node_modules/@esbuild-kit/core-utils": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@esbuild-kit/core-utils/-/core-utils-3.3.2.tgz", - "integrity": "sha512-sPRAnw9CdSsRmEtnsl2WXWdyquogVpB3yZ3dgwJfe8zrOzTsV7cJvmwrKVa+0ma5BoiGJ+BoqkMvawbayKUsqQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild": "~0.18.20", - "source-map-support": "^0.5.21" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/android-arm": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", - "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/android-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", - "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/android-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", - "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/darwin-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", - "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/darwin-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", - "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/freebsd-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", - "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/freebsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", - "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-arm": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", - "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", - "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-ia32": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", - "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-loong64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", - "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-mips64el": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", - "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-ppc64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", - "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-riscv64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", - "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-s390x": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", - "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", - "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/netbsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", - "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/openbsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", - "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/sunos-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", - "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/win32-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", - "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/win32-ia32": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", - "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/win32-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", - "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/esbuild": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", - "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/android-arm": "0.18.20", - "@esbuild/android-arm64": "0.18.20", - "@esbuild/android-x64": "0.18.20", - "@esbuild/darwin-arm64": "0.18.20", - "@esbuild/darwin-x64": "0.18.20", - "@esbuild/freebsd-arm64": "0.18.20", - "@esbuild/freebsd-x64": "0.18.20", - "@esbuild/linux-arm": "0.18.20", - "@esbuild/linux-arm64": "0.18.20", - "@esbuild/linux-ia32": "0.18.20", - "@esbuild/linux-loong64": "0.18.20", - "@esbuild/linux-mips64el": "0.18.20", - "@esbuild/linux-ppc64": "0.18.20", - "@esbuild/linux-riscv64": "0.18.20", - "@esbuild/linux-s390x": "0.18.20", - "@esbuild/linux-x64": "0.18.20", - "@esbuild/netbsd-x64": "0.18.20", - "@esbuild/openbsd-x64": "0.18.20", - "@esbuild/sunos-x64": "0.18.20", - "@esbuild/win32-arm64": "0.18.20", - "@esbuild/win32-ia32": "0.18.20", - "@esbuild/win32-x64": "0.18.20" - } - }, - "node_modules/@esbuild-kit/esm-loader": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/@esbuild-kit/esm-loader/-/esm-loader-2.6.5.tgz", - "integrity": "sha512-FxEMIkJKnodyA1OaCUoEvbYRkoZlLZ4d/eXFu9Fh8CbBBgP5EmZxrfTRyN0qpXZ4vOvqnE5YdRdcrmUUXuU+dA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@esbuild-kit/core-utils": "^3.3.2", - "get-tsconfig": "^4.7.0" - } - }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", - "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", - "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", - "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", - "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", - "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", - "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", - "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", - "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", - "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", - "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", - "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", - "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", - "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", - "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", - "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", - "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", - "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", - "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", - "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", - "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", - "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", - "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", - "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -3843,9 +3016,9 @@ } }, "node_modules/@grpc/grpc-js": { - "version": "1.9.15", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.15.tgz", - "integrity": "sha512-nqE7Hc0AzI+euzUwDAy0aY5hCp10r734gMGRdU+qOPX0XSceI2ULrcXB5U2xSc5VkWwalCj4M7GzCAygZl2KoQ==", + "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", @@ -3972,206 +3145,42 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.22", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz", - "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@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/@libsql/client": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/@libsql/client/-/client-0.6.2.tgz", - "integrity": "sha512-xRNfRLv/dOCbV4qd+M0baQwGmvuZpMd2wG2UAPs8XmcdaPvu5ErkcaeITkxlm3hDEJVabQM1cFhMBxsugWW9fQ==", - "license": "MIT", - "dependencies": { - "@libsql/core": "^0.6.2", - "@libsql/hrana-client": "^0.6.0", - "js-base64": "^3.7.5", - "libsql": "^0.3.10" - } - }, - "node_modules/@libsql/core": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/@libsql/core/-/core-0.6.2.tgz", - "integrity": "sha512-c2P4M+4u/4b2L02A0KjggO3UW51rGkhxr/7fzJO0fEAqsqrWGxuNj2YtRkina/oxfYvAof6xjp8RucNoIV/Odw==", - "license": "MIT", - "dependencies": { - "js-base64": "^3.7.5" - } - }, - "node_modules/@libsql/darwin-arm64": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@libsql/darwin-arm64/-/darwin-arm64-0.3.18.tgz", - "integrity": "sha512-Zt49dt+cwhPCkuoWgvjbQd4ckNfCJR5xzIAyhgHl3CBZqZaEuaXTOGKLNQT7bnFRPuQcdLt5PBT1cenKu2N6pA==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@libsql/darwin-x64": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@libsql/darwin-x64/-/darwin-x64-0.3.18.tgz", - "integrity": "sha512-faq6HUGDaNaueeqPei5cypHaD/hhazUyfHo094CXiEeRZq6ZKtNl5PHdlr8jE/Uw8USNpVVQaLdnvSgKcpRPHw==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@libsql/hrana-client": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/@libsql/hrana-client/-/hrana-client-0.6.2.tgz", - "integrity": "sha512-MWxgD7mXLNf9FXXiM0bc90wCjZSpErWKr5mGza7ERy2FJNNMXd7JIOv+DepBA1FQTIfI8TFO4/QDYgaQC0goNw==", - "license": "MIT", - "dependencies": { - "@libsql/isomorphic-fetch": "^0.2.1", - "@libsql/isomorphic-ws": "^0.1.5", - "js-base64": "^3.7.5", - "node-fetch": "^3.3.2" - } - }, - "node_modules/@libsql/hrana-client/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "license": "MIT", - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, - "node_modules/@libsql/isomorphic-fetch": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@libsql/isomorphic-fetch/-/isomorphic-fetch-0.2.1.tgz", - "integrity": "sha512-Sv07QP1Aw8A5OOrmKgRUBKe2fFhF2hpGJhtHe3d1aRnTESZCGkn//0zDycMKTGamVWb3oLYRroOsCV8Ukes9GA==", - "license": "MIT" - }, - "node_modules/@libsql/isomorphic-ws": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/@libsql/isomorphic-ws/-/isomorphic-ws-0.1.5.tgz", - "integrity": "sha512-DtLWIH29onUYR00i0GlQ3UdcTRC6EP4u9w/h9LxpUZJWRMARk6dQwZ6Jkd+QdwVpuAOrdxt18v0K2uIYR3fwFg==", - "license": "MIT", - "dependencies": { - "@types/ws": "^8.5.4", - "ws": "^8.13.0" - } - }, - "node_modules/@libsql/linux-arm64-gnu": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@libsql/linux-arm64-gnu/-/linux-arm64-gnu-0.3.18.tgz", - "integrity": "sha512-5m9xtDAhoyLSV54tho9uQ2ZIDeJWc0vU3Xpe/VK4+6bpURISs23qNhXiCrZnnq3oV0hFlBfcIgQUIATmb6jD2A==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] + "engines": { + "node": ">=6.0.0" + } }, - "node_modules/@libsql/linux-arm64-musl": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@libsql/linux-arm64-musl/-/linux-arm64-musl-0.3.18.tgz", - "integrity": "sha512-oYD5+oM2gPEalp+EoR5DVQBRtdGjLsocjsRbQs5O2m4WOBJKER7VUfDYZHsifLGZoBSc11Yo6s9IR9rjGWy20w==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "engines": { + "node": ">=6.0.0" + } }, - "node_modules/@libsql/linux-x64-gnu": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@libsql/linux-x64-gnu/-/linux-x64-gnu-0.3.18.tgz", - "integrity": "sha512-QDSSP60nS8KIldGE7H3bpEflQHiL1erwED6huoVJdmDFxsyDJX2CYdWUWW8Za0ZUOvUbnEWAOyMhp6j1dBbZqw==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, - "node_modules/@libsql/linux-x64-musl": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@libsql/linux-x64-musl/-/linux-x64-musl-0.3.18.tgz", - "integrity": "sha512-5SXwTlaLCUPzxYyq+P0c7Ko7tcEjpd1X6RZKe1DuRFmJPg6f7j2+LrPEhMSIbqKcrl5ACUUAyoKmGZqNYwz23w==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.22", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz", + "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } }, - "node_modules/@libsql/win32-x64-msvc": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@libsql/win32-x64-msvc/-/win32-x64-msvc-0.3.18.tgz", - "integrity": "sha512-9EEIHz+e8tTbx9TMkb8ByZnzxc0pYFirK1nSbqC6cFEST95fiY0NCfQ/zAzJxe90KckbjifX6BbO69eWIi3TAg==", - "cpu": [ - "x64" - ], + "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, - "os": [ - "win32" - ] - }, - "node_modules/@neon-rs/load": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/@neon-rs/load/-/load-0.0.4.tgz", - "integrity": "sha512-kTPhdZyTQxB+2wpiRcFWrDcejc4JI6tkPuS7UZCG4l6Zvc5kU/gGQ/ozvHTh1XR5tS+UlfAfGuPajjzQjCiHCw==", - "license": "MIT" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } }, "node_modules/@next/env": { "version": "14.2.3", @@ -6417,15 +5426,6 @@ "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", "dev": true }, - "node_modules/@types/ws": { - "version": "8.5.10", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", - "integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==", - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@typescript-eslint/parser": { "version": "6.19.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.19.1.tgz", @@ -7110,10 +6110,9 @@ } }, "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "license": "MIT", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dependencies": { "fill-range": "^7.1.1" }, @@ -7182,13 +6181,6 @@ "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", "license": "BSD-3-Clause" }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true, - "license": "MIT" - }, "node_modules/busboy": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", @@ -7996,15 +6988,6 @@ "integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==", "dev": true }, - "node_modules/data-uri-to-buffer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", - "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", - "license": "MIT", - "engines": { - "node": ">= 12" - } - }, "node_modules/date-fns": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.3.1.tgz", @@ -8244,147 +7227,6 @@ "tslib": "^2.0.3" } }, - "node_modules/dotenv": { - "version": "16.4.5", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", - "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", - "license": "BSD-2-Clause", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://dotenvx.com" - } - }, - "node_modules/drizzle-kit": { - "version": "0.22.7", - "resolved": "https://registry.npmjs.org/drizzle-kit/-/drizzle-kit-0.22.7.tgz", - "integrity": "sha512-9THPCb2l1GPt7wxhws9LvTR0YG565ZlVgTuqGMwjs590Kch1pXu4GyjEArVijSF5m0OBj3qgdeKmuJXhKXgWFw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@esbuild-kit/esm-loader": "^2.5.5", - "esbuild": "^0.19.7", - "esbuild-register": "^3.5.0" - }, - "bin": { - "drizzle-kit": "bin.cjs" - } - }, - "node_modules/drizzle-orm": { - "version": "0.31.2", - "resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.31.2.tgz", - "integrity": "sha512-QnenevbnnAzmbNzQwbhklvIYrDE8YER8K7kSrAWQSV1YvFCdSQPzj+jzqRdTSsV2cDqSpQ0NXGyL1G9I43LDLg==", - "license": "Apache-2.0", - "peerDependencies": { - "@aws-sdk/client-rds-data": ">=3", - "@cloudflare/workers-types": ">=3", - "@electric-sql/pglite": ">=0.1.1", - "@libsql/client": "*", - "@neondatabase/serverless": ">=0.1", - "@op-engineering/op-sqlite": ">=2", - "@opentelemetry/api": "^1.4.1", - "@planetscale/database": ">=1", - "@tidbcloud/serverless": "*", - "@types/better-sqlite3": "*", - "@types/pg": "*", - "@types/react": ">=18", - "@types/sql.js": "*", - "@vercel/postgres": ">=0.8.0", - "@xata.io/client": "*", - "better-sqlite3": ">=7", - "bun-types": "*", - "expo-sqlite": ">=13.2.0", - "knex": "*", - "kysely": "*", - "mysql2": ">=2", - "pg": ">=8", - "postgres": ">=3", - "react": ">=18", - "sql.js": ">=1", - "sqlite3": ">=5" - }, - "peerDependenciesMeta": { - "@aws-sdk/client-rds-data": { - "optional": true - }, - "@cloudflare/workers-types": { - "optional": true - }, - "@electric-sql/pglite": { - "optional": true - }, - "@libsql/client": { - "optional": true - }, - "@neondatabase/serverless": { - "optional": true - }, - "@op-engineering/op-sqlite": { - "optional": true - }, - "@opentelemetry/api": { - "optional": true - }, - "@planetscale/database": { - "optional": true - }, - "@tidbcloud/serverless": { - "optional": true - }, - "@types/better-sqlite3": { - "optional": true - }, - "@types/pg": { - "optional": true - }, - "@types/react": { - "optional": true - }, - "@types/sql.js": { - "optional": true - }, - "@vercel/postgres": { - "optional": true - }, - "@xata.io/client": { - "optional": true - }, - "better-sqlite3": { - "optional": true - }, - "bun-types": { - "optional": true - }, - "expo-sqlite": { - "optional": true - }, - "knex": { - "optional": true - }, - "kysely": { - "optional": true - }, - "mysql2": { - "optional": true - }, - "pg": { - "optional": true - }, - "postgres": { - "optional": true - }, - "react": { - "optional": true - }, - "sql.js": { - "optional": true - }, - "sqlite3": { - "optional": true - } - } - }, "node_modules/duplexify": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.3.tgz", @@ -8621,58 +7463,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/esbuild": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", - "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.19.12", - "@esbuild/android-arm": "0.19.12", - "@esbuild/android-arm64": "0.19.12", - "@esbuild/android-x64": "0.19.12", - "@esbuild/darwin-arm64": "0.19.12", - "@esbuild/darwin-x64": "0.19.12", - "@esbuild/freebsd-arm64": "0.19.12", - "@esbuild/freebsd-x64": "0.19.12", - "@esbuild/linux-arm": "0.19.12", - "@esbuild/linux-arm64": "0.19.12", - "@esbuild/linux-ia32": "0.19.12", - "@esbuild/linux-loong64": "0.19.12", - "@esbuild/linux-mips64el": "0.19.12", - "@esbuild/linux-ppc64": "0.19.12", - "@esbuild/linux-riscv64": "0.19.12", - "@esbuild/linux-s390x": "0.19.12", - "@esbuild/linux-x64": "0.19.12", - "@esbuild/netbsd-x64": "0.19.12", - "@esbuild/openbsd-x64": "0.19.12", - "@esbuild/sunos-x64": "0.19.12", - "@esbuild/win32-arm64": "0.19.12", - "@esbuild/win32-ia32": "0.19.12", - "@esbuild/win32-x64": "0.19.12" - } - }, - "node_modules/esbuild-register": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/esbuild-register/-/esbuild-register-3.5.0.tgz", - "integrity": "sha512-+4G/XmakeBAsvJuDugJvtyF1x+XJT4FMocynNpxrvEBViirpfUn2PgNpCHedfWhF4WokNsO/OvMKrmJOIJsI5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^4.3.4" - }, - "peerDependencies": { - "esbuild": ">=0.12 <1" - } - }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -9267,29 +8057,6 @@ "node": ">=0.8.0" } }, - "node_modules/fetch-blob": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", - "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "paypal", - "url": "https://paypal.me/jimmywarting" - } - ], - "license": "MIT", - "dependencies": { - "node-domexception": "^1.0.0", - "web-streams-polyfill": "^3.0.3" - }, - "engines": { - "node": "^12.20 || >= 14.13" - } - }, "node_modules/figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", @@ -9357,10 +8124,9 @@ } }, "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "license": "MIT", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -9503,18 +8269,6 @@ "node": ">= 0.12" } }, - "node_modules/formdata-polyfill": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", - "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", - "license": "MIT", - "dependencies": { - "fetch-blob": "^3.1.2" - }, - "engines": { - "node": ">=12.20.0" - } - }, "node_modules/fraction.js": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", @@ -9882,9 +8636,9 @@ } }, "node_modules/google-gax/node_modules/@grpc/grpc-js": { - "version": "1.10.9", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.10.9.tgz", - "integrity": "sha512-5tcgUctCG0qoNyfChZifz2tJqbRbXVO9J7X6duFcOjY3HUNCxg5D0ZCK7EP9vIcZ0zRpLU9bWkyCqVCLZ46IbQ==", + "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": { @@ -10754,12 +9508,6 @@ "url": "https://github.com/sponsors/panva" } }, - "node_modules/js-base64": { - "version": "3.7.7", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.7.tgz", - "integrity": "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==", - "license": "BSD-3-Clause" - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -10985,45 +9733,6 @@ "node": ">= 0.8.0" } }, - "node_modules/libsql": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/libsql/-/libsql-0.3.18.tgz", - "integrity": "sha512-lvhKr7WV3NLWRbXkjn/MeKqXOAqWKU0PX9QYrvDh7fneukapj+iUQ4qgJASrQyxcCrEsClXCQiiK5W6OoYPAlA==", - "cpu": [ - "x64", - "arm64", - "wasm32" - ], - "license": "MIT", - "os": [ - "darwin", - "linux", - "win32" - ], - "dependencies": { - "@neon-rs/load": "^0.0.4", - "detect-libc": "2.0.2", - "libsql": "^0.3.15" - }, - "optionalDependencies": { - "@libsql/darwin-arm64": "0.3.18", - "@libsql/darwin-x64": "0.3.18", - "@libsql/linux-arm64-gnu": "0.3.18", - "@libsql/linux-arm64-musl": "0.3.18", - "@libsql/linux-x64-gnu": "0.3.18", - "@libsql/linux-x64-musl": "0.3.18", - "@libsql/win32-x64-msvc": "0.3.18" - } - }, - "node_modules/libsql/node_modules/detect-libc": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", - "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", - "license": "Apache-2.0", - "engines": { - "node": ">=8" - } - }, "node_modules/lilconfig": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", @@ -11499,25 +10208,6 @@ "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==", "license": "MIT" }, - "node_modules/node-domexception": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "github", - "url": "https://paypal.me/jimmywarting" - } - ], - "license": "MIT", - "engines": { - "node": ">=10.5.0" - } - }, "node_modules/node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", @@ -13093,16 +11783,6 @@ "react-dom": "^18.0.0" } }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", @@ -13111,17 +11791,6 @@ "node": ">=0.10.0" } }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "license": "MIT", - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -14120,15 +12789,6 @@ "defaults": "^1.0.3" } }, - "node_modules/web-streams-polyfill": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", - "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -14390,27 +13050,6 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, - "node_modules/ws": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.0.tgz", - "integrity": "sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==", - "license": "MIT", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index 6f71574..6762eda 100644 --- a/package.json +++ b/package.json @@ -48,8 +48,6 @@ "clsx": "^2.1.0", "cmdk": "^0.2.1", "date-fns": "^3.3.1", - "dotenv": "^16.4.5", - "drizzle-orm": "^0.31.2", "embla-carousel-react": "^8.0.0-rc22", "firebase": "^10.12.2", "firebase-admin": "^12.1.1", diff --git a/src/actions/FBValidateAction.ts b/src/actions/FBValidateAction.ts index 6154bc2..58a32d6 100644 --- a/src/actions/FBValidateAction.ts +++ b/src/actions/FBValidateAction.ts @@ -1,11 +1,57 @@ "use server"; import { FBValidate } from "@/functions/FBValidation"; -import FormItem from "@/interfaces/FormItem"; +import { db, increment } from "@/helpers/drizzleTurso"; +import FBFormObject from "@/interfaces/FormItemsObject"; +import { eq } from "drizzle-orm"; +import { redirect } from "next/navigation"; +import { v4 as uuid } from "uuid"; +import { formsTable } from "../../drizzle/schema"; -export async function FBValidateAction(formItems: FormItem[]) { - return FBValidate(formItems); - // localStorage.setItem("formItemsObject", JSON.stringify(formItems)); - // after saving - // redirect(`/form/${3}/edit`); +export async function FBValidateAction( + formObject: FBFormObject, + type: "edit" | "new", +) { + const errorObj = await FBValidate(formObject); + if (errorObj.message) return errorObj; + + if (type === "edit") { + // store if present and permissions + const res = await db + .update(formsTable) + .set({ + formJson: formObject.formItems, + version: increment(formsTable.version), + }) + .where(eq(formsTable.formId, formObject.formId)) + .returning({ formId: formsTable.formId }); + if (res.length === 0) return { message: "Form not found", id: "0" }; + return errorObj; + + } else if (type === "new") { + // store if not present + while ((await checkFormId(formObject.formId)).length !== 0) { + formObject.formId = uuid(); + } + await db + .insert(formsTable) + .values({ + userId: "TestUserId", + formId: formObject.formId, + formJson: formObject.formItems, + version: 1, + }) + .onConflictDoNothing(); + // in future batch as much requests as possible, including form json for edit + redirect(`/form/${formObject.formId}/edit`); + } + + return errorObj; +} + +async function checkFormId(id: string) { + return db + .select({ formId: formsTable.formId }) + .from(formsTable) + .where(eq(formsTable.formId, id)); } diff --git a/src/app/form/[formId]/edit/page.tsx b/src/app/form/[formId]/edit/page.tsx new file mode 100644 index 0000000..126326b --- /dev/null +++ b/src/app/form/[formId]/edit/page.tsx @@ -0,0 +1,28 @@ +import FormBuilderWrapper from "@/components/FormBuilderWrapper"; +import { db } from "@/helpers/drizzleTurso"; +import FBFormObject from "@/interfaces/FormItemsObject"; +import { and, eq } from "drizzle-orm"; +import { formsTable } from "../../../../../drizzle/schema"; + +async function Page({ params }: { params: { formId: string } }) { + const res = await db + .select() + .from(formsTable) + .where( + and( + eq(formsTable.formId, params.formId), + eq(formsTable.userId, "TestUserId"), + ), + ); + if (res.length === 0) { + return
Form not found
; + } + const formObject: FBFormObject = { + formId: res[0].formId, + formItems: res[0].formJson, + }; + + return ; +} + +export default Page; diff --git a/src/app/form/[id]/loading.tsx b/src/app/form/[formId]/loading.tsx similarity index 100% rename from src/app/form/[id]/loading.tsx rename to src/app/form/[formId]/loading.tsx diff --git a/src/app/form/[formId]/page.tsx b/src/app/form/[formId]/page.tsx new file mode 100644 index 0000000..a63626d --- /dev/null +++ b/src/app/form/[formId]/page.tsx @@ -0,0 +1,332 @@ +import FormRenderer from "@/components/form-display/FormRenderer"; +import { Card } from "@/components/ui/card"; +import FormItem from "@/interfaces/FormItem"; +import FBFormObject from "@/interfaces/FormItemsObject"; +import { FormResponses, Response } from "@/interfaces/FormResponses"; + +const formResponses: FormResponses = {}; + +function sleep(ms = 0) { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + +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: FBFormObject = { + formId: "2e05825d-baaf-4cb1-89a8-a2eec3b66cdc", + formItems: formItems, + }; + + return ( +
+ + + +
+ ); +} diff --git a/src/app/form/[id]/edit/page.tsx b/src/app/form/[id]/edit/page.tsx deleted file mode 100644 index 52a22b3..0000000 --- a/src/app/form/[id]/edit/page.tsx +++ /dev/null @@ -1,11 +0,0 @@ -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/[id]/page.tsx b/src/app/form/[id]/page.tsx deleted file mode 100644 index 0710d4b..0000000 --- a/src/app/form/[id]/page.tsx +++ /dev/null @@ -1,28 +0,0 @@ -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"; - -const formResponses: FormResponses = {} - -function sleep(ms = 0) { - return new Promise(resolve => setTimeout(resolve, ms)); -} - -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: "2e05825d-baaf-4cb1-89a8-a2eec3b66cdc", - formItems: formItems - } - - return ( -
- - - -
- ); -} diff --git a/src/app/form/new/page.tsx b/src/app/form/new/page.tsx index 9253860..e9b501c 100644 --- a/src/app/form/new/page.tsx +++ b/src/app/form/new/page.tsx @@ -1,15 +1,13 @@ import FormBuilderWrapper from "@/components/FormBuilderWrapper"; -import {v4 as uuid} from "uuid"; -import FormItemsObject from "@/interfaces/FormItemsObject"; import { constants } from "@/constants"; +import FBFormObject from "@/interfaces/FormItemsObject"; +import { v4 as uuid } from "uuid"; export default function New() { - let formItemsObject : FormItemsObject = { + let formItemsObject: FBFormObject = { formId: uuid(), formItems: constants.defaultFormItems, - } + }; - return ( - - ) -} \ No newline at end of file + return ; +} diff --git a/src/components/FormBuilderWrapper.tsx b/src/components/FormBuilderWrapper.tsx index 4add88f..13f47ff 100644 --- a/src/components/FormBuilderWrapper.tsx +++ b/src/components/FormBuilderWrapper.tsx @@ -1,15 +1,22 @@ "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 FormItemsObject from "@/interfaces/FormItemsObject"; +import { FormBuilderContext } from "@/contexts/FormBuilderContext"; +import FormItem from "@/interfaces/FormItem"; +import FBFormObject from "@/interfaces/FormItemsObject"; +import { useEffect, useMemo, useRef, useState } from "react"; import { v4 as uuid } from "uuid"; +type FormBuilderWrapperProps = { + formObject: FBFormObject; + type: "edit" | "new"; +}; -export default function FormBuilderWrapper({ formItemsObject } : { formItemsObject: FormItemsObject }) { +export default function FormBuilderWrapper({ + formObject, + type, +}: FormBuilderWrapperProps) { const debounceRefs = useMemo(() => new Map(), []); const firstRenderRef = useRef(false); const focusedItemRef = useRef({ id: "0", blurItem: () => {} }); @@ -18,7 +25,9 @@ export default function FormBuilderWrapper({ formItemsObject } : { formItemsObje const isSavingRef = useRef(false); const keyPrefixRef = useRef(uuid()); - const [formItems, setFormItems] = useState(formItemsObject.formItems); + const [formItems, setFormItems] = useState( + formObject.formItems, + ); useEffect(() => { firstRenderRef.current = false; @@ -41,7 +50,7 @@ export default function FormBuilderWrapper({ formItemsObject } : { formItemsObje
- + ); -} \ No newline at end of file +} diff --git a/src/components/form-display/FormRenderer.tsx b/src/components/form-display/FormRenderer.tsx index 55a276d..5a8e5cc 100644 --- a/src/components/form-display/FormRenderer.tsx +++ b/src/components/form-display/FormRenderer.tsx @@ -1,81 +1,129 @@ "use client"; -import TitleComponent from "@/components/form-display/TitleComponent"; -import TextInputComponent from "@/components/form-display/TextInputComponent"; -import MultipleChoiceComponent from "@/components/form-display/MultipleChoiceComponent"; -import DropdownComponent from "@/components/form-display/DropdownComponent"; -import RangeComponent from "@/components/form-display/RangeComponent"; -import MultipleChoiceGridComponent from "@/components/form-display/MultipleChoiceGridComponent"; +import { serverValidate } from "@/actions/validations"; import DateComponent from "@/components/form-display/DateComponent"; +import DropdownComponent from "@/components/form-display/DropdownComponent"; import MediaComponent from "@/components/form-display/MediaComponent"; +import MultipleChoiceComponent from "@/components/form-display/MultipleChoiceComponent"; +import MultipleChoiceGridComponent from "@/components/form-display/MultipleChoiceGridComponent"; +import RangeComponent from "@/components/form-display/RangeComponent"; +import TextInputComponent from "@/components/form-display/TextInputComponent"; +import TitleComponent from "@/components/form-display/TitleComponent"; +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 FBFormObject from "@/interfaces/FormItemsObject"; +import { FormResponses, Response } from "@/interfaces/FormResponses"; 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 }) { - let formItems = formItemsObject.formItems - return ( -
{ - 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 - } +export default function FormRenderer({ + formItemsObject, + formResponses, +}: { + formItemsObject: FBFormObject; + formResponses: FormResponses; +}) { + let formItems = formItemsObject.formItems; - let name = formItems.filter((item) => item.id === key)[0].props.title - toast.error(name, { - description: errors[key] - }) - }) - } else { - toast.success("Form submitted successfully") - } - }} className={"flex flex-col justify-center "}> - - { - formItems.map((item) => { - switch (item.props.type) { - case "title": - return ; - case "text-input": - return ; - case "multiple-choice": - return ; - case "dropdown": - return ; - case "range": - formResponses[item.id] = formResponses[item.id] ?? {range: item.props.min, type: "range"} - return ; - case "multiple-choice-grid": - return ; - case "date": - return ; - case "media": - return ; - default: - return null; - } - }) - } - - - + return ( +
{ + 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; + } - ) -} \ No newline at end of file + let name = formItems.filter((item) => item.id === key)[0] + .props.title; + toast.error(name, { + description: errors[key], + }); + }); + } else { + toast.success("Form submitted successfully"); + } + }} + className={"flex flex-col justify-center "} + > + + {formItems.map((item) => { + switch (item.props.type) { + case "title": + return ; + case "text-input": + return ( + + ); + case "multiple-choice": + return ( + + ); + case "dropdown": + return ( + + ); + case "range": + formResponses[item.id] = formResponses[item.id] ?? { + range: item.props.min, + type: "range", + }; + return ( + + ); + case "multiple-choice-grid": + return ( + + ); + case "date": + return ( + + ); + case "media": + return ( + + ); + default: + return null; + } + })} + + +
+ ); +} diff --git a/src/components/toolbar/Toolbar.tsx b/src/components/toolbar/Toolbar.tsx index 084525a..2352f46 100644 --- a/src/components/toolbar/Toolbar.tsx +++ b/src/components/toolbar/Toolbar.tsx @@ -4,7 +4,7 @@ import { FBValidateAction } from "@/actions/FBValidateAction"; import { constants } from "@/constants"; import { FormBuilderContext } from "@/contexts/FormBuilderContext"; import { FBValidate } from "@/functions/FBValidation"; -import FormItem from "@/interfaces/FormItem"; +import FBFormObject from "@/interfaces/FormItemsObject"; import { DownloadIcon, FileIcon } from "lucide-react"; import { ChangeEvent, useContext, useEffect, useRef, useState } from "react"; import { toast } from "sonner"; @@ -39,7 +39,12 @@ import { Input } from "../ui/input"; import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover"; import ToolbarButton from "./ToolbarButton"; -const Toolbar = () => { +type ToolbarProps = { + formId: string; + type: "new" | "edit"; +}; + +const Toolbar = ({ formId, type }: ToolbarProps) => { const savingTimeout = 750; const toastDuration = 2000; const { @@ -51,9 +56,10 @@ const Toolbar = () => { keyPrefixRef, setFormItems, } = useContext(FormBuilderContext); + const formObject = { formId: formId, formItems: formItems }; const fileInputRef = useRef(null); - const newFormItemsRef = useRef([]); + const newFormItemsRef = useRef({ formId: "", formItems: [] }); const importJsonRef = useRef(""); const [importOpen, setImportOpen] = useState(false); @@ -277,7 +283,7 @@ const Toolbar = () => { } async function handleCopyClick() { - const errorObj = await FBValidate(formItems); + const errorObj = await FBValidate(formObject); if (errorObj.message) { if (errorObj.id === "0") { toast.error(errorObj.message, { @@ -311,7 +317,7 @@ const Toolbar = () => { } async function handleDownloadClick() { - const errorObj = await FBValidate(formItems); + const errorObj = await FBValidate(formObject); if (errorObj.message) { if (errorObj.id === "0") { toast.error(errorObj.message, { @@ -369,10 +375,14 @@ const Toolbar = () => { fr.readAsText(selectedFile); } - function handleSaveClick() { + async function handleSaveClick() { setIsSavingDialogOpen(true); const timeoutStart = Date.now(); isSavingRef.current = true; + debounceRefs.get(focusedItemRef.current.id)?.forEach((ref) => { + ref.flush(); + }); + const errorElement = formBuilderRef.current?.querySelector( '[data-error="true"]', ); @@ -389,41 +399,37 @@ const Toolbar = () => { return; } - FBValidateAction(formItems).then((errorObj) => { - if (errorObj.message) { - if (errorObj.id === "0") { - setTimeout( - () => { - toast.error(errorObj.message, { - duration: 2500, - }); - setIsSavingDialogOpen(false); - }, - Math.max(savingTimeout - (Date.now() - timeoutStart), 0), - ); - } - const errorElement = formBuilderRef.current?.querySelector( - `#${CSS.escape(errorObj.id)}`, + const errorObj = await FBValidateAction(formObject, type); + if (errorObj.message) { + if (errorObj.id === "0") { + setTimeout( + () => { + toast.error(errorObj.message, { + duration: 2500, + }); + setIsSavingDialogOpen(false); + }, + Math.max(savingTimeout - (Date.now() - timeoutStart), 0), ); - if (errorElement) { - setTimeout( - () => { - focusAndScrollToElement( - errorElement, - setIsSavingDialogOpen, - ); - toast.error(errorObj.message, { - duration: 2500, - }); - }, - Math.max(savingTimeout - (Date.now() - timeoutStart), 0), - ); - } - return; } - debounceRefs.get(focusedItemRef.current.id)?.forEach((ref) => { - ref.flush(); - }); + const errorElement = formBuilderRef.current?.querySelector( + `#${CSS.escape(errorObj.id)}`, + ); + if (errorElement) { + setTimeout( + () => { + focusAndScrollToElement(errorElement, setIsSavingDialogOpen); + toast.error(errorObj.message, { + duration: 2500, + }); + }, + Math.max(savingTimeout - (Date.now() - timeoutStart), 0), + ); + } + return; + } + + if (type === "edit") { isSavingRef.current = false; setTimeout( () => { @@ -434,27 +440,30 @@ const Toolbar = () => { }, Math.max(savingTimeout - (Date.now() - timeoutStart), 0), ); - }); + } } function insertForm() { keyPrefixRef.current = uuid(); - setFormItems([...newFormItemsRef.current]); + setFormItems([...newFormItemsRef.current.formItems]); document.getElementById("0")?.focus(); setImportOpen(false); } async function validateAndInsertForm(jsonString: string) { try { - const newFormItems: FormItem[] = JSON.parse(jsonString); - const errorObj = await FBValidate(newFormItems); + const newFormObject: FBFormObject = { + formId: formId, + formItems: JSON.parse(jsonString), + }; + const errorObj = await FBValidate(newFormObject); if (errorObj.message) { toast.error("Invalid JSON", { duration: toastDuration, }); return; } - newFormItemsRef.current = newFormItems; + newFormItemsRef.current = newFormObject; setInsertDialogOpen(true); } catch (error) { toast.error("Invalid JSON", { diff --git a/src/functions/FBValidation.ts b/src/functions/FBValidation.ts index 13b4e56..936d737 100644 --- a/src/functions/FBValidation.ts +++ b/src/functions/FBValidation.ts @@ -17,14 +17,42 @@ import { MultipleChoiceProps } from "@/interfaces/form-component-interfaces/mult import { RangeProps } from "@/interfaces/form-component-interfaces/RangeProps"; import TextInputProps from "@/interfaces/form-component-interfaces/TextInputProps"; import TitleProps from "@/interfaces/form-component-interfaces/TitleProps"; -import FormItem from "@/interfaces/FormItem"; +import FBFormObject from "@/interfaces/FormItemsObject"; import { z } from "zod"; export type FBValidateError = { id: string; message: string }; export async function FBValidate( - formItems: FormItem[], + formObject: FBFormObject, ): Promise { + const formObjectError = z + .object({ + formId: z + .string({ + invalid_type_error: "The 'formId' prop must be of type 'string'", + required_error: "The 'formId' prop is required", + }) + .uuid({ + message: "formId is not a valid uuid", + }), + formItems: z + .any({ + invalid_type_error: "The 'formItems' prop must be an array", + required_error: "The 'formItems' prop is required", + }) + .array(), + }) + .strict() + .safeParse(formObject); + + if (!formObjectError.success) { + return { + id: "0", + message: formObjectError.error.errors[0].message, + }; + } + + const formItems = formObject.formItems; let titleParsed = false; if (formItems.length < 2) { return { id: "0", message: "Form must have atleast one element" }; @@ -38,7 +66,9 @@ export async function FBValidate( invalid_type_error: `The 'id' prop must be of type 'string'`, required_error: "The 'id' prop is required", }), - props: z.any(), + props: z.any({ + required_error: "The 'props' prop is required", + }), mediaProps: z .object({ mediaAltText: z @@ -229,29 +259,37 @@ function validateDropdown( const parseResult = z .object({ items: z - .object({ - id: z - .string({ - invalid_type_error: "Invalid dropdown item ID", - required_error: "Invalid dropdown item ID", - }) - .uuid({ message: "Invalid dropdown item ID" }), - parentId: z.literal(parentId, { - invalid_type_error: "Invalid dropdown item parent ID", - }), - value: z - .string({ - invalid_type_error: - "Dropdown item value must be of type 'string'", - required_error: "Dropdown item value is required", - }) - .trim() - .min(1, { message: "Dropdown item value must not be empty" }) - .max(dropdownConstants.itemMaxLength, { - message: `Dropdown item value must not exceed ${dropdownConstants.itemMaxLength} characters`, + .object( + { + id: z + .string({ + invalid_type_error: "Invalid dropdown item ID", + required_error: "Invalid dropdown item ID", + }) + .uuid({ message: "Invalid dropdown item ID" }), + parentId: z.literal(parentId, { + invalid_type_error: "Invalid dropdown item parent ID", }), - }) - .strict({ message: "Invalid dropdown item" }) + value: z + .string({ + invalid_type_error: + "Dropdown item value must be of type 'string'", + required_error: "Dropdown item value is required", + }) + .trim() + .min(1, { + message: "Dropdown item value must not be empty", + }) + .max(dropdownConstants.itemMaxLength, { + message: `Dropdown item value must not exceed ${dropdownConstants.itemMaxLength} characters`, + }), + }, + { + invalid_type_error: "Invalid 'items' prop", + required_error: "The 'items' prop is required", + }, + ) + .strict({ message: "Invalid 'items' prop" }) .array() .min(1, { message: "Dropdown must have atleast one item" }) .max(10, { message: "Dropdown can only have upto 10 items" }), @@ -346,31 +384,39 @@ function validateMultipleChoice( required_error: "The 'hasOther' prop is required", }), items: z - .object({ - id: z - .string({ - invalid_type_error: "Invalid multiple choice item ID", - required_error: "Invalid multiple choice item ID", - }) - .uuid({ message: "Invalid multiple choice item ID" }), - parentId: z.literal(parentId, { - invalid_type_error: "Invalid multiple choice item parent ID", - }), - value: z - .string({ + .object( + { + id: z + .string({ + invalid_type_error: "Invalid multiple choice item ID", + required_error: "Invalid multiple choice item ID", + }) + .uuid({ message: "Invalid multiple choice item ID" }), + parentId: z.literal(parentId, { invalid_type_error: - "Multiple choice item value must be of type 'string'", - required_error: "Multiple choice item value is required", - }) - .trim() - .min(1, { - message: "Multiple choice item value must not be empty", - }) - .max(multipleChoiceConstants.itemMaxLength, { - message: `Multiple choice item value must not exceed ${multipleChoiceConstants.itemMaxLength} characters`, + "Invalid multiple choice item parent ID", }), - }) - .strict({ message: "Invalid multiple choice item" }) + value: z + .string({ + invalid_type_error: + "Multiple choice item value must be of type 'string'", + required_error: + "Multiple choice item value is required", + }) + .trim() + .min(1, { + message: "Multiple choice item value must not be empty", + }) + .max(multipleChoiceConstants.itemMaxLength, { + message: `Multiple choice item value must not exceed ${multipleChoiceConstants.itemMaxLength} characters`, + }), + }, + { + invalid_type_error: "Invalid 'items' prop", + required_error: "The 'items' prop is required", + }, + ) + .strict({ message: "Invalid 'items' prop" }) .array() .min(1, { message: "Multiple choice must have atleast one item" }) .max(10, { @@ -413,35 +459,44 @@ function validateMultipleChoiceGrid( required_error: "The 'allowMultiple' prop is required", }), columns: z - .object({ - id: z - .string({ - invalid_type_error: - "Invalid multiple choice grid column ID", - required_error: "Invalid multiple choice grid column ID", - }) - .uuid({ message: "Invalid multiple choice grid column ID" }), - parentId: z.literal(parentId, { - invalid_type_error: - "Invalid multiple choice grid column parent ID", - }), - value: z - .string({ + .object( + { + id: z + .string({ + invalid_type_error: + "Invalid multiple choice grid column ID", + required_error: + "Invalid multiple choice grid column ID", + }) + .uuid({ + message: "Invalid multiple choice grid column ID", + }), + parentId: z.literal(parentId, { invalid_type_error: - "Multiple choice grid column value must be of type 'string'", - required_error: - "Multiple choice grid column value is required", - }) - .trim() - .min(1, { - message: - "Multiple choice grid column value must not be empty", - }) - .max(multipleChoiceConstants.itemMaxLength, { - message: `Multiple choice grid column value must not exceed ${multipleChoiceConstants.itemMaxLength} characters`, + "Invalid multiple choice grid column parent ID", }), - }) - .strict({ message: "Invalid multiple choice grid column" }) + value: z + .string({ + invalid_type_error: + "Multiple choice grid column value must be of type 'string'", + required_error: + "Multiple choice grid column value is required", + }) + .trim() + .min(1, { + message: + "Multiple choice grid column value must not be empty", + }) + .max(multipleChoiceConstants.itemMaxLength, { + message: `Multiple choice grid column value must not exceed ${multipleChoiceConstants.itemMaxLength} characters`, + }), + }, + { + invalid_type_error: "Invalid 'columns' prop", + required_error: "The 'columns' prop is required", + }, + ) + .strict({ message: "Invalid 'columns' prop" }) .array() .min(1, { message: "Multiple choice grid must have atleast one column", @@ -454,34 +509,41 @@ function validateMultipleChoiceGrid( required_error: "The 'required' prop is required", }), rows: z - .object({ - id: z - .string({ - invalid_type_error: "Invalid multiple choice grid row ID", - required_error: "Invalid multiple choice grid row ID", - }) - .uuid({ message: "Invalid multiple choice grid row ID" }), - parentId: z.literal(parentId, { - invalid_type_error: - "Invalid multiple choice grid row parent ID", - }), - value: z - .string({ + .object( + { + id: z + .string({ + invalid_type_error: + "Invalid multiple choice grid row ID", + required_error: "Invalid multiple choice grid row ID", + }) + .uuid({ message: "Invalid multiple choice grid row ID" }), + parentId: z.literal(parentId, { invalid_type_error: - "Multiple choice grid row value must be of type 'string'", - required_error: - "Multiple choice grid row value is required", - }) - .trim() - .min(1, { - message: - "Multiple choice grid row value must not be empty", - }) - .max(multipleChoiceConstants.itemMaxLength, { - message: `Multiple choice grid row value must not exceed ${multipleChoiceConstants.itemMaxLength} characters`, + "Invalid multiple choice grid row parent ID", }), - }) - .strict({ message: "Invalid multiple choice grid row" }) + value: z + .string({ + invalid_type_error: + "Multiple choice grid row value must be of type 'string'", + required_error: + "Multiple choice grid row value is required", + }) + .trim() + .min(1, { + message: + "Multiple choice grid row value must not be empty", + }) + .max(multipleChoiceConstants.itemMaxLength, { + message: `Multiple choice grid row value must not exceed ${multipleChoiceConstants.itemMaxLength} characters`, + }), + }, + { + invalid_type_error: "Invalid 'rows' prop", + required_error: "The 'rows' prop is required", + }, + ) + .strict({ message: "Invalid 'rows' prop" }) .array() .min(1, { message: "Multiple choice grid must have atleast one row", diff --git a/src/helpers/drizzleTurso.ts b/src/helpers/drizzleTurso.ts index eebe8b7..bbc2067 100644 --- a/src/helpers/drizzleTurso.ts +++ b/src/helpers/drizzleTurso.ts @@ -1,5 +1,6 @@ -import { drizzle } from "drizzle-orm/libsql"; import { createClient } from "@libsql/client"; +import { AnyColumn, sql } from "drizzle-orm"; +import { drizzle } from "drizzle-orm/libsql"; const turso = createClient({ url: process.env.TURSO_DB_URL, @@ -7,3 +8,7 @@ const turso = createClient({ }); export const db = drizzle(turso); + +export const increment = (column: AnyColumn, value = 1) => { + return sql`${column} + ${value}`; +}; diff --git a/src/interfaces/FormItemsObject.ts b/src/interfaces/FormItemsObject.ts index 6161e30..f00ed26 100644 --- a/src/interfaces/FormItemsObject.ts +++ b/src/interfaces/FormItemsObject.ts @@ -1,6 +1,6 @@ import FormItem from "@/interfaces/FormItem"; -export default interface FormItemsObject { +export default interface FBFormObject { formId: string; formItems: FormItem[]; -} \ No newline at end of file +} From 82a3cb93baa178f7e44f108ecc3502623ab71e89 Mon Sep 17 00:00:00 2001 From: SteakFisher Date: Fri, 14 Jun 2024 18:26:06 +0400 Subject: [PATCH 2/2] Fixing the build errors --- package-lock.json | 1402 ++++++++++++++++++++++++++++++++++++++++++++- package.json | 2 + src/app/page.tsx | 2 - 3 files changed, 1383 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 24c9805..4287d77 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,6 +47,8 @@ "clsx": "^2.1.0", "cmdk": "^0.2.1", "date-fns": "^3.3.1", + "dotenv": "^16.4.5", + "drizzle-orm": "^0.31.2", "embla-carousel-react": "^8.0.0-rc22", "firebase": "^10.12.2", "firebase-admin": "^12.1.1", @@ -2282,6 +2284,831 @@ "react": ">=16.8.0" } }, + "node_modules/@esbuild-kit/core-utils": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@esbuild-kit/core-utils/-/core-utils-3.3.2.tgz", + "integrity": "sha512-sPRAnw9CdSsRmEtnsl2WXWdyquogVpB3yZ3dgwJfe8zrOzTsV7cJvmwrKVa+0ma5BoiGJ+BoqkMvawbayKUsqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.18.20", + "source-map-support": "^0.5.21" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/android-arm": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", + "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/android-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", + "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/android-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", + "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/darwin-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", + "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/darwin-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", + "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/freebsd-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", + "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/freebsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", + "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-arm": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", + "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", + "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-ia32": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", + "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-loong64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", + "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-mips64el": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", + "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-ppc64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", + "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-riscv64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", + "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-s390x": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", + "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", + "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/netbsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", + "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/openbsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", + "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/sunos-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", + "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/win32-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", + "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/win32-ia32": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", + "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/win32-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", + "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/core-utils/node_modules/esbuild": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", + "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.18.20", + "@esbuild/android-arm64": "0.18.20", + "@esbuild/android-x64": "0.18.20", + "@esbuild/darwin-arm64": "0.18.20", + "@esbuild/darwin-x64": "0.18.20", + "@esbuild/freebsd-arm64": "0.18.20", + "@esbuild/freebsd-x64": "0.18.20", + "@esbuild/linux-arm": "0.18.20", + "@esbuild/linux-arm64": "0.18.20", + "@esbuild/linux-ia32": "0.18.20", + "@esbuild/linux-loong64": "0.18.20", + "@esbuild/linux-mips64el": "0.18.20", + "@esbuild/linux-ppc64": "0.18.20", + "@esbuild/linux-riscv64": "0.18.20", + "@esbuild/linux-s390x": "0.18.20", + "@esbuild/linux-x64": "0.18.20", + "@esbuild/netbsd-x64": "0.18.20", + "@esbuild/openbsd-x64": "0.18.20", + "@esbuild/sunos-x64": "0.18.20", + "@esbuild/win32-arm64": "0.18.20", + "@esbuild/win32-ia32": "0.18.20", + "@esbuild/win32-x64": "0.18.20" + } + }, + "node_modules/@esbuild-kit/esm-loader": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/@esbuild-kit/esm-loader/-/esm-loader-2.6.5.tgz", + "integrity": "sha512-FxEMIkJKnodyA1OaCUoEvbYRkoZlLZ4d/eXFu9Fh8CbBBgP5EmZxrfTRyN0qpXZ4vOvqnE5YdRdcrmUUXuU+dA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@esbuild-kit/core-utils": "^3.3.2", + "get-tsconfig": "^4.7.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", + "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -3157,30 +3984,194 @@ "node": ">=6.0.0" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.22", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz", + "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@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/@libsql/client": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/@libsql/client/-/client-0.6.2.tgz", + "integrity": "sha512-xRNfRLv/dOCbV4qd+M0baQwGmvuZpMd2wG2UAPs8XmcdaPvu5ErkcaeITkxlm3hDEJVabQM1cFhMBxsugWW9fQ==", + "license": "MIT", + "dependencies": { + "@libsql/core": "^0.6.2", + "@libsql/hrana-client": "^0.6.0", + "js-base64": "^3.7.5", + "libsql": "^0.3.10" + } + }, + "node_modules/@libsql/core": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/@libsql/core/-/core-0.6.2.tgz", + "integrity": "sha512-c2P4M+4u/4b2L02A0KjggO3UW51rGkhxr/7fzJO0fEAqsqrWGxuNj2YtRkina/oxfYvAof6xjp8RucNoIV/Odw==", + "license": "MIT", + "dependencies": { + "js-base64": "^3.7.5" + } + }, + "node_modules/@libsql/darwin-arm64": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@libsql/darwin-arm64/-/darwin-arm64-0.3.19.tgz", + "integrity": "sha512-rmOqsLcDI65zzxlUOoEiPJLhqmbFsZF6p4UJQ2kMqB+Kc0Rt5/A1OAdOZ/Wo8fQfJWjR1IbkbpEINFioyKf+nQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@libsql/darwin-x64": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@libsql/darwin-x64/-/darwin-x64-0.3.19.tgz", + "integrity": "sha512-q9O55B646zU+644SMmOQL3FIfpmEvdWpRpzubwFc2trsa+zoBlSkHuzU9v/C+UNoPHQVRMP7KQctJ455I/h/xw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@libsql/hrana-client": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/@libsql/hrana-client/-/hrana-client-0.6.2.tgz", + "integrity": "sha512-MWxgD7mXLNf9FXXiM0bc90wCjZSpErWKr5mGza7ERy2FJNNMXd7JIOv+DepBA1FQTIfI8TFO4/QDYgaQC0goNw==", + "license": "MIT", + "dependencies": { + "@libsql/isomorphic-fetch": "^0.2.1", + "@libsql/isomorphic-ws": "^0.1.5", + "js-base64": "^3.7.5", + "node-fetch": "^3.3.2" + } + }, + "node_modules/@libsql/hrana-client/node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "license": "MIT", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/@libsql/isomorphic-fetch": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@libsql/isomorphic-fetch/-/isomorphic-fetch-0.2.1.tgz", + "integrity": "sha512-Sv07QP1Aw8A5OOrmKgRUBKe2fFhF2hpGJhtHe3d1aRnTESZCGkn//0zDycMKTGamVWb3oLYRroOsCV8Ukes9GA==", + "license": "MIT" }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.22", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz", - "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==", + "node_modules/@libsql/isomorphic-ws": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@libsql/isomorphic-ws/-/isomorphic-ws-0.1.5.tgz", + "integrity": "sha512-DtLWIH29onUYR00i0GlQ3UdcTRC6EP4u9w/h9LxpUZJWRMARk6dQwZ6Jkd+QdwVpuAOrdxt18v0K2uIYR3fwFg==", + "license": "MIT", "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" + "@types/ws": "^8.5.4", + "ws": "^8.13.0" } }, - "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==", + "node_modules/@libsql/linux-arm64-gnu": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@libsql/linux-arm64-gnu/-/linux-arm64-gnu-0.3.19.tgz", + "integrity": "sha512-mgeAUU1oqqh57k7I3cQyU6Trpdsdt607eFyEmH5QO7dv303ti+LjUvh1pp21QWV6WX7wZyjeJV1/VzEImB+jRg==", + "cpu": [ + "arm64" + ], "license": "MIT", "optional": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/js-sdsl" - } + "os": [ + "linux" + ] + }, + "node_modules/@libsql/linux-arm64-musl": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@libsql/linux-arm64-musl/-/linux-arm64-musl-0.3.19.tgz", + "integrity": "sha512-VEZtxghyK6zwGzU9PHohvNxthruSxBEnRrX7BSL5jQ62tN4n2JNepJ6SdzXp70pdzTfwroOj/eMwiPt94gkVRg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@libsql/linux-x64-gnu": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@libsql/linux-x64-gnu/-/linux-x64-gnu-0.3.19.tgz", + "integrity": "sha512-2t/J7LD5w2f63wGihEO+0GxfTyYIyLGEvTFEsMO16XI5o7IS9vcSHrxsvAJs4w2Pf907uDjmc7fUfMg6L82BrQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@libsql/linux-x64-musl": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@libsql/linux-x64-musl/-/linux-x64-musl-0.3.19.tgz", + "integrity": "sha512-BLsXyJaL8gZD8+3W2LU08lDEd9MIgGds0yPy5iNPp8tfhXx3pV/Fge2GErN0FC+nzt4DYQtjL+A9GUMglQefXQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@libsql/win32-x64-msvc": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@libsql/win32-x64-msvc/-/win32-x64-msvc-0.3.19.tgz", + "integrity": "sha512-ay1X9AobE4BpzG0XPw1gplyLZPGHIgJOovvW23gUrukRegiUP62uzhpRbKNogLlUOynyXeq//prHgPXiebUfWg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@neon-rs/load": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@neon-rs/load/-/load-0.0.4.tgz", + "integrity": "sha512-kTPhdZyTQxB+2wpiRcFWrDcejc4JI6tkPuS7UZCG4l6Zvc5kU/gGQ/ozvHTh1XR5tS+UlfAfGuPajjzQjCiHCw==", + "license": "MIT" }, "node_modules/@next/env": { "version": "14.2.3", @@ -5426,6 +6417,15 @@ "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", "dev": true }, + "node_modules/@types/ws": { + "version": "8.5.10", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", + "integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@typescript-eslint/parser": { "version": "6.19.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.19.1.tgz", @@ -6181,6 +7181,13 @@ "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", "license": "BSD-3-Clause" }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "license": "MIT" + }, "node_modules/busboy": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", @@ -6988,6 +7995,15 @@ "integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==", "dev": true }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, "node_modules/date-fns": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.3.1.tgz", @@ -7227,6 +8243,147 @@ "tslib": "^2.0.3" } }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/drizzle-kit": { + "version": "0.22.7", + "resolved": "https://registry.npmjs.org/drizzle-kit/-/drizzle-kit-0.22.7.tgz", + "integrity": "sha512-9THPCb2l1GPt7wxhws9LvTR0YG565ZlVgTuqGMwjs590Kch1pXu4GyjEArVijSF5m0OBj3qgdeKmuJXhKXgWFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@esbuild-kit/esm-loader": "^2.5.5", + "esbuild": "^0.19.7", + "esbuild-register": "^3.5.0" + }, + "bin": { + "drizzle-kit": "bin.cjs" + } + }, + "node_modules/drizzle-orm": { + "version": "0.31.2", + "resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.31.2.tgz", + "integrity": "sha512-QnenevbnnAzmbNzQwbhklvIYrDE8YER8K7kSrAWQSV1YvFCdSQPzj+jzqRdTSsV2cDqSpQ0NXGyL1G9I43LDLg==", + "license": "Apache-2.0", + "peerDependencies": { + "@aws-sdk/client-rds-data": ">=3", + "@cloudflare/workers-types": ">=3", + "@electric-sql/pglite": ">=0.1.1", + "@libsql/client": "*", + "@neondatabase/serverless": ">=0.1", + "@op-engineering/op-sqlite": ">=2", + "@opentelemetry/api": "^1.4.1", + "@planetscale/database": ">=1", + "@tidbcloud/serverless": "*", + "@types/better-sqlite3": "*", + "@types/pg": "*", + "@types/react": ">=18", + "@types/sql.js": "*", + "@vercel/postgres": ">=0.8.0", + "@xata.io/client": "*", + "better-sqlite3": ">=7", + "bun-types": "*", + "expo-sqlite": ">=13.2.0", + "knex": "*", + "kysely": "*", + "mysql2": ">=2", + "pg": ">=8", + "postgres": ">=3", + "react": ">=18", + "sql.js": ">=1", + "sqlite3": ">=5" + }, + "peerDependenciesMeta": { + "@aws-sdk/client-rds-data": { + "optional": true + }, + "@cloudflare/workers-types": { + "optional": true + }, + "@electric-sql/pglite": { + "optional": true + }, + "@libsql/client": { + "optional": true + }, + "@neondatabase/serverless": { + "optional": true + }, + "@op-engineering/op-sqlite": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@planetscale/database": { + "optional": true + }, + "@tidbcloud/serverless": { + "optional": true + }, + "@types/better-sqlite3": { + "optional": true + }, + "@types/pg": { + "optional": true + }, + "@types/react": { + "optional": true + }, + "@types/sql.js": { + "optional": true + }, + "@vercel/postgres": { + "optional": true + }, + "@xata.io/client": { + "optional": true + }, + "better-sqlite3": { + "optional": true + }, + "bun-types": { + "optional": true + }, + "expo-sqlite": { + "optional": true + }, + "knex": { + "optional": true + }, + "kysely": { + "optional": true + }, + "mysql2": { + "optional": true + }, + "pg": { + "optional": true + }, + "postgres": { + "optional": true + }, + "react": { + "optional": true + }, + "sql.js": { + "optional": true + }, + "sqlite3": { + "optional": true + } + } + }, "node_modules/duplexify": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.3.tgz", @@ -7463,6 +8620,58 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/esbuild": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", + "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.19.12", + "@esbuild/android-arm": "0.19.12", + "@esbuild/android-arm64": "0.19.12", + "@esbuild/android-x64": "0.19.12", + "@esbuild/darwin-arm64": "0.19.12", + "@esbuild/darwin-x64": "0.19.12", + "@esbuild/freebsd-arm64": "0.19.12", + "@esbuild/freebsd-x64": "0.19.12", + "@esbuild/linux-arm": "0.19.12", + "@esbuild/linux-arm64": "0.19.12", + "@esbuild/linux-ia32": "0.19.12", + "@esbuild/linux-loong64": "0.19.12", + "@esbuild/linux-mips64el": "0.19.12", + "@esbuild/linux-ppc64": "0.19.12", + "@esbuild/linux-riscv64": "0.19.12", + "@esbuild/linux-s390x": "0.19.12", + "@esbuild/linux-x64": "0.19.12", + "@esbuild/netbsd-x64": "0.19.12", + "@esbuild/openbsd-x64": "0.19.12", + "@esbuild/sunos-x64": "0.19.12", + "@esbuild/win32-arm64": "0.19.12", + "@esbuild/win32-ia32": "0.19.12", + "@esbuild/win32-x64": "0.19.12" + } + }, + "node_modules/esbuild-register": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/esbuild-register/-/esbuild-register-3.5.0.tgz", + "integrity": "sha512-+4G/XmakeBAsvJuDugJvtyF1x+XJT4FMocynNpxrvEBViirpfUn2PgNpCHedfWhF4WokNsO/OvMKrmJOIJsI5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "peerDependencies": { + "esbuild": ">=0.12 <1" + } + }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -8057,6 +9266,29 @@ "node": ">=0.8.0" } }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, "node_modules/figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", @@ -8124,9 +9356,10 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -8269,6 +9502,18 @@ "node": ">= 0.12" } }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "license": "MIT", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, "node_modules/fraction.js": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", @@ -9508,6 +10753,12 @@ "url": "https://github.com/sponsors/panva" } }, + "node_modules/js-base64": { + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.7.tgz", + "integrity": "sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==", + "license": "BSD-3-Clause" + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -9733,6 +10984,45 @@ "node": ">= 0.8.0" } }, + "node_modules/libsql": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/libsql/-/libsql-0.3.19.tgz", + "integrity": "sha512-Aj5cQ5uk/6fHdmeW0TiXK42FqUlwx7ytmMLPSaUQPin5HKKKuUPD62MAbN4OEweGBBI7q1BekoEN4gPUEL6MZA==", + "cpu": [ + "x64", + "arm64", + "wasm32" + ], + "license": "MIT", + "os": [ + "darwin", + "linux", + "win32" + ], + "dependencies": { + "@neon-rs/load": "^0.0.4", + "detect-libc": "2.0.2", + "libsql": "^0.3.15" + }, + "optionalDependencies": { + "@libsql/darwin-arm64": "0.3.19", + "@libsql/darwin-x64": "0.3.19", + "@libsql/linux-arm64-gnu": "0.3.19", + "@libsql/linux-arm64-musl": "0.3.19", + "@libsql/linux-x64-gnu": "0.3.19", + "@libsql/linux-x64-musl": "0.3.19", + "@libsql/win32-x64-msvc": "0.3.19" + } + }, + "node_modules/libsql/node_modules/detect-libc": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", + "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, "node_modules/lilconfig": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", @@ -10208,6 +11498,25 @@ "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==", "license": "MIT" }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" + } + }, "node_modules/node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", @@ -11783,6 +13092,16 @@ "react-dom": "^18.0.0" } }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", @@ -11791,6 +13110,17 @@ "node": ">=0.10.0" } }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -12789,6 +14119,15 @@ "defaults": "^1.0.3" } }, + "node_modules/web-streams-polyfill": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", + "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -13050,6 +14389,27 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, + "node_modules/ws": { + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.0.tgz", + "integrity": "sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index 6762eda..6f71574 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,8 @@ "clsx": "^2.1.0", "cmdk": "^0.2.1", "date-fns": "^3.3.1", + "dotenv": "^16.4.5", + "drizzle-orm": "^0.31.2", "embla-carousel-react": "^8.0.0-rc22", "firebase": "^10.12.2", "firebase-admin": "^12.1.1", diff --git a/src/app/page.tsx b/src/app/page.tsx index 033a311..4f4b4ba 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,6 +1,4 @@ import Link from "next/link"; -import { db } from "@/helpers/drizzleTurso"; -import { fooTable } from "@/../drizzle/schema"; export default async function Home() { // const result = await db.select().from(fooTable).all();