From 77d2e2c32e38d10eab14e30f5a6c4368d6cbaadf Mon Sep 17 00:00:00 2001 From: Antony David Date: Wed, 8 May 2024 14:47:17 +0200 Subject: [PATCH] refactor: get votes routes (#115) --- apps/api/package.json | 6 +- apps/api/src/handlers/votes.ts | 102 +++------------- apps/api/src/routes/votes.ts | 29 +---- pnpm-lock.yaml | 205 ++++++++++++--------------------- 4 files changed, 96 insertions(+), 246 deletions(-) diff --git a/apps/api/package.json b/apps/api/package.json index 9a29ea92..27a8e201 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -21,14 +21,14 @@ "@hono/zod-validator": "^0.2.1", "@repo/types": "workspace:*", "@supabase/supabase-js": "^2.43.1", - "hono": "^4.3.2", - "zod": "^3.23.6", + "hono": "^4.3.3", + "zod": "^3.23.7", "zod-validation-error": "^3.2.0" }, "devDependencies": { "@repo/biome-config": "workspace:*", "@repo/typescript-config": "workspace:*", - "@types/node": "^20.12.10", + "@types/node": "^20.12.11", "@types/swagger-ui-dist": "^3.30.4", "supabase": "^1.165.0", "tsx": "^4.9.3", diff --git a/apps/api/src/handlers/votes.ts b/apps/api/src/handlers/votes.ts index 0e491407..276f467a 100644 --- a/apps/api/src/handlers/votes.ts +++ b/apps/api/src/handlers/votes.ts @@ -1,17 +1,8 @@ -import { randomInt } from 'node:crypto'; import crypto from 'node:crypto'; import { OpenAPIHono } from '@hono/zod-openapi'; import { supabase } from '../libs/supabase.js'; import { zodErrorHook } from '../libs/zodError.js'; -import { - createPoll, - deletePoll, - getAllPolls, - getOnePoll, - getPollResults, - updatePoll, - voteToPoll, -} from '../routes/votes.js'; +import { createPoll, deletePoll, getAllPolls, getOnePoll, updatePoll, voteToPoll } from '../routes/votes.js'; import { checkRole } from '../utils/context.js'; import { getPagination } from '../utils/pagnination.js'; import { Role, type Variables } from '../validators/general.js'; @@ -24,29 +15,23 @@ polls.openapi(getAllPolls, async (c) => { const user = c.get('user'); const roles = user.roles; await checkRole(roles, true); - const { skip, take } = c.req.valid('query'); - const { from, to } = getPagination(skip, take - 1); + const { all, search, skip, take } = c.req.valid('query'); - const { data, error } = await supabase + const query = supabase .from('POLLS') - .select( - ` - id, - title, - description, - start_at, - end_at, - max_choices, - id_user, - results: POLLS_OPTIONS ( - id, - content, - votes: POLLS_VOTES (id_option) - ) - `, - { count: 'exact' }, - ) - .range(from, to); + .select('*, results:POLLS_OPTIONS (id, content, votes:POLLS_VOTES (id_option))', { count: 'exact' }) + .order('id', { ascending: true }); + + if (search) { + query.ilike('title', `%${search}%`); + } + + if (!all) { + const { from, to } = getPagination(skip, take - 1); + query.range(from, to); + } + + const { data, error } = await query; if (error) { return c.json({ error: error.message }, 500); @@ -68,23 +53,7 @@ polls.openapi(getOnePoll, async (c) => { const { data, error } = await supabase .from('POLLS') - .select( - ` - id, - title, - description, - start_at, - end_at, - max_choices, - id_user, - results: POLLS_OPTIONS ( - id, - content, - votes: POLLS_VOTES (id_option) - ) - `, - { count: 'exact' }, - ) + .select('*, results:POLLS_OPTIONS (id, content, votes:POLLS_VOTES (id_option))', { count: 'exact' }) .eq('id', id) .single(); @@ -218,9 +187,6 @@ polls.openapi(voteToPoll, async (c) => { return c.json({ error: 'Failed to vote' }, 400); } - const randomDelay = randomInt(10, 5000); - setTimeout(async () => {}, randomDelay); - const { data: pollData, error: pollError } = await supabase .from('USERS_VOTES') .insert({ id_poll: id, user: hash }) @@ -232,37 +198,3 @@ polls.openapi(voteToPoll, async (c) => { return c.json({ message: 'Vote registered' }, 201); }); - -type Results = { - id: number; - title: string; - results: { id: number; content: string; votes: number }[]; -}; - -polls.openapi(getPollResults, async (c) => { - const user = c.get('user'); - const roles = user.roles; - await checkRole(roles, true); - const { id } = c.req.valid('param'); - const { data, error } = await supabase - .from('POLLS') - .select('*, results:POLLS_VOTES(*), options:POLLS_OPTIONS(*)') - .eq('id', id) - .single(); - - if (error || !data) { - return c.json({ error: 'Poll not found' }, 404); - } - - const results: Results = { - id: data.id, - title: data.title, - results: data.options.map((option: { id: number; content: string }) => ({ - id: option.id, - content: option.content, - votes: data.results.filter((vote: { id_option: number }) => vote.id_option === option.id).length, - })), - }; - - return c.json(results, 200); -}); diff --git a/apps/api/src/routes/votes.ts b/apps/api/src/routes/votes.ts index 8c2c7ffd..5bef5f62 100644 --- a/apps/api/src/routes/votes.ts +++ b/apps/api/src/routes/votes.ts @@ -81,7 +81,7 @@ export const getAllPolls = createRoute({ security: [{ Bearer: [] }], middleware: authMiddleware, request: { - query: queryAllSchema.omit({ search: true, all: true }), + query: queryAllSchema, }, responses: { 200: { @@ -212,30 +212,3 @@ export const voteToPoll = createRoute({ }, tags: ['poll'], }); - -export const getPollResults = createRoute({ - method: 'get', - path: '/polls/{id}/results', - summary: 'Get poll results', - description: 'Get poll results', - security: [{ Bearer: [] }], - middleware: authMiddleware, - request: { - params: idParamValidator, - }, - responses: { - 200: { - description: 'Successful response', - content: { - 'application/json': { - schema: { - data: pollResultSchema, - }, - }, - }, - }, - 500: serverErrorSchema, - 404: notFoundSchema, - }, - tags: ['poll'], -}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1218b65a..8d3a9ddf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -55,7 +55,7 @@ importers: version: 0.33.3 zod: specifier: ^3.23.6 - version: 3.23.6 + version: 3.23.7 devDependencies: '@repo/biome-config': specifier: workspace:* @@ -65,7 +65,7 @@ importers: version: link:../../packages/typescript-config '@types/node': specifier: ^20.12.10 - version: 20.12.10 + version: 20.12.11 '@types/react': specifier: ^18.3.1 version: 18.3.1 @@ -80,7 +80,7 @@ importers: version: 8.4.38 tailwindcss: specifier: ^3.4.3 - version: 3.4.3(ts-node@10.9.2(@types/node@20.12.10)(typescript@5.4.5)) + version: 3.4.3(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5)) typescript: specifier: ^5.4.5 version: 5.4.5 @@ -92,13 +92,13 @@ importers: version: 1.11.1 '@hono/swagger-ui': specifier: ^0.2.2 - version: 0.2.2(hono@4.3.2) + version: 0.2.2(hono@4.3.3) '@hono/zod-openapi': specifier: ^0.11.0 - version: 0.11.0(hono@4.3.2)(zod@3.23.6) + version: 0.11.0(hono@4.3.3)(zod@3.23.7) '@hono/zod-validator': specifier: ^0.2.1 - version: 0.2.1(hono@4.3.2)(zod@3.23.6) + version: 0.2.1(hono@4.3.3)(zod@3.23.7) '@repo/types': specifier: workspace:* version: link:../../packages/types @@ -106,14 +106,14 @@ importers: specifier: ^2.43.1 version: 2.43.1 hono: - specifier: ^4.3.2 - version: 4.3.2 + specifier: ^4.3.3 + version: 4.3.3 zod: - specifier: ^3.23.6 - version: 3.23.6 + specifier: ^3.23.7 + version: 3.23.7 zod-validation-error: specifier: ^3.2.0 - version: 3.2.0(zod@3.23.6) + version: 3.2.0(zod@3.23.7) devDependencies: '@repo/biome-config': specifier: workspace:* @@ -122,8 +122,8 @@ importers: specifier: workspace:* version: link:../../packages/typescript-config '@types/node': - specifier: ^20.12.10 - version: 20.12.10 + specifier: ^20.12.11 + version: 20.12.11 '@types/swagger-ui-dist': specifier: ^3.30.4 version: 3.30.4 @@ -138,7 +138,7 @@ importers: version: 5.4.5 vitest: specifier: ^1.6.0 - version: 1.6.0(@types/node@20.12.10) + version: 1.6.0(@types/node@20.12.11) apps/client: dependencies: @@ -165,7 +165,7 @@ importers: version: 0.33.3 zod: specifier: ^3.23.6 - version: 3.23.6 + version: 3.23.7 devDependencies: '@repo/biome-config': specifier: workspace:* @@ -175,7 +175,7 @@ importers: version: link:../../packages/typescript-config '@types/node': specifier: ^20.12.10 - version: 20.12.10 + version: 20.12.11 '@types/react': specifier: ^18.3.1 version: 18.3.1 @@ -190,7 +190,7 @@ importers: version: 8.4.38 tailwindcss: specifier: ^3.4.3 - version: 3.4.3(ts-node@10.9.2(@types/node@20.12.10)(typescript@5.4.5)) + version: 3.4.3(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5)) typescript: specifier: ^5.4.5 version: 5.4.5 @@ -276,10 +276,10 @@ importers: version: 2.3.0 tailwindcss-animate: specifier: ^1.0.7 - version: 1.0.7(tailwindcss@3.4.3(ts-node@10.9.2(@types/node@20.12.10)(typescript@5.4.5))) + version: 1.0.7(tailwindcss@3.4.3(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5))) zod: specifier: ^3.23.6 - version: 3.23.6 + version: 3.23.7 devDependencies: '@repo/biome-config': specifier: workspace:* @@ -289,10 +289,10 @@ importers: version: link:../typescript-config '@turbo/gen': specifier: ^1.13.3 - version: 1.13.3(@types/node@20.12.10)(typescript@5.4.5) + version: 1.13.3(@types/node@20.12.11)(typescript@5.4.5) '@types/node': specifier: ^20.12.10 - version: 20.12.10 + version: 20.12.11 '@types/react': specifier: ^18.3.1 version: 18.3.1 @@ -310,7 +310,7 @@ importers: version: 18.3.1 tailwindcss: specifier: ^3.4.3 - version: 3.4.3(ts-node@10.9.2(@types/node@20.12.10)(typescript@5.4.5)) + version: 3.4.3(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5)) typescript: specifier: ^5.4.5 version: 5.4.5 @@ -349,7 +349,6 @@ packages: '@biomejs/biome@1.7.3': resolution: {integrity: sha512-ogFQI+fpXftr+tiahA6bIXwZ7CSikygASdqMtH07J2cUzrpjyTMVc9Y97v23c7/tL1xCZhM+W9k4hYIBm7Q6cQ==} engines: {node: '>=14.21.3'} - hasBin: true '@biomejs/cli-darwin-arm64@1.7.3': resolution: {integrity: sha512-eDvLQWmGRqrPIRY7AIrkPHkQ3visEItJKkPYSHCscSDdGvKzYjmBJwG1Gu8+QC5ed6R7eiU63LEC0APFBobmfQ==} @@ -1858,11 +1857,9 @@ packages: '@turbo/gen@1.13.3': resolution: {integrity: sha512-l+EM1gGzckFMaaVQyj3BVRa0QJ+tpp8HfiHOhGpBWW3Vc0Hfj92AY87Di/7HGABa+HVY7ueatMi7DJG+zkJBYg==} - hasBin: true '@turbo/workspaces@1.13.3': resolution: {integrity: sha512-QYZ8g3IVQebqNM8IsBlWYOWmOKjBZY55e6lx4EDOLuch1iWmyk+U8CLAI9UomMrSaKTs1Sx+PDkt63EgakvhUw==} - hasBin: true '@types/estree@1.0.5': resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} @@ -1876,8 +1873,8 @@ packages: '@types/minimatch@5.1.2': resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} - '@types/node@20.12.10': - resolution: {integrity: sha512-Eem5pH9pmWBHoGAT8Dr5fdc5rYA+4NAovdM4EktRPVAAiJhmWWfQrA0cFhAbOsQdSfIHjAud6YdkbL69+zSKjw==} + '@types/node@20.12.11': + resolution: {integrity: sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==} '@types/phoenix@1.6.4': resolution: {integrity: sha512-B34A7uot1Cv0XtaHRYDATltAdKx0BvVKNgYNqE4WjtPUa4VQJM7kxeXcVKaH+KS+kCmZ+6w+QaUdcljiheiBJA==} @@ -1925,7 +1922,6 @@ packages: acorn@8.11.3: resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} engines: {node: '>=0.4.0'} - hasBin: true agent-base@7.1.1: resolution: {integrity: sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==} @@ -1997,7 +1993,6 @@ packages: autoprefixer@10.4.19: resolution: {integrity: sha512-BaENR2+zBZ8xXhM4pUaKUxlVdxZ0EZhjvbopwnXmxRUfqDmwSpC2lAi/QXvx7NRdPCo1WKEcEF6mV64si1z4Ew==} engines: {node: ^10 || ^12 || >=14} - hasBin: true peerDependencies: postcss: ^8.1.0 @@ -2035,7 +2030,6 @@ packages: browserslist@4.23.0: resolution: {integrity: sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - hasBin: true buffer@5.7.1: resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} @@ -2179,7 +2173,6 @@ packages: cssesc@3.0.0: resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} engines: {node: '>=4'} - hasBin: true csstype@3.1.3: resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} @@ -2254,8 +2247,8 @@ packages: eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - electron-to-chromium@1.4.757: - resolution: {integrity: sha512-jftDaCknYSSt/+KKeXzH3LX5E2CvRLm75P3Hj+J/dv3CL0qUYcOt13d5FN1NiL5IJbbhzHrb3BomeG2tkSlZmw==} + electron-to-chromium@1.4.758: + resolution: {integrity: sha512-/o9x6TCdrYZBMdGeTifAP3wlF/gVT+TtWJe3BSmtNh92Mw81U9hrYwW9OAGUh+sEOX/yz5e34sksqRruZbjYrw==} emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -2266,7 +2259,6 @@ packages: esbuild@0.20.2: resolution: {integrity: sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==} engines: {node: '>=12'} - hasBin: true escalade@3.1.2: resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} @@ -2279,12 +2271,10 @@ packages: escodegen@2.1.0: resolution: {integrity: sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==} engines: {node: '>=6.0'} - hasBin: true esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} - hasBin: true estraverse@5.3.0: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} @@ -2391,7 +2381,6 @@ packages: glob@10.3.12: resolution: {integrity: sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg==} engines: {node: '>=16 || 14 >=14.17'} - hasBin: true glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} @@ -2410,7 +2399,6 @@ packages: handlebars@4.7.8: resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} engines: {node: '>=0.4.7'} - hasBin: true has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} @@ -2427,8 +2415,8 @@ packages: header-case@1.0.1: resolution: {integrity: sha512-i0q9mkOeSuhXw6bGgiQCCBgY/jlZuV/7dZXyZ9c6LcBrqwvT8eT719E9uxE5LiZftdl+z81Ugbg/VvXV4OJOeQ==} - hono@4.3.2: - resolution: {integrity: sha512-wiZcF5N06tc232U11DnqW6hP8DNoypjsrxslKXfvOqOAkTdh7K1HLZJH/92Mf+urxUTGi96f1w4xx/1Qozoqiw==} + hono@4.3.3: + resolution: {integrity: sha512-LDa1n/aLYK4CsZQyjQpFiaQgxiXCZp0WfcfliinQOH1Lqt4mIOvyw4qjmHihpKXsuXhkQHfHU2Erysp6oEdnVA==} engines: {node: '>=16.0.0'} http-proxy-agent@7.0.2: @@ -2562,7 +2550,6 @@ packages: jiti@1.21.0: resolution: {integrity: sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==} - hasBin: true js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -2572,7 +2559,6 @@ packages: js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true jsbn@1.1.0: resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==} @@ -2611,7 +2597,6 @@ packages: loose-envify@1.4.0: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true loupe@2.3.7: resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} @@ -2626,10 +2611,6 @@ packages: resolution: {integrity: sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==} engines: {node: 14 || >=16.14} - lru-cache@6.0.0: - resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} - engines: {node: '>=10'} - lru-cache@7.18.3: resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} engines: {node: '>=12'} @@ -2688,12 +2669,10 @@ packages: mkdirp@0.5.6: resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} - hasBin: true mkdirp@3.0.1: resolution: {integrity: sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==} engines: {node: '>=10'} - hasBin: true mlly@1.7.0: resolution: {integrity: sha512-U9SDaXGEREBYQgfejV97coK0UL1r+qnF2SyO9A3qcI8MzKnsIFKHNVEkrDyNncQTKQQumsasmeq84eNMdBfsNQ==} @@ -2710,7 +2689,6 @@ packages: nanoid@3.3.7: resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} @@ -2722,7 +2700,6 @@ packages: next@14.2.3: resolution: {integrity: sha512-dowFkFTR8v79NPJO4QsBUtxv0g9BrS/phluVpMAt2ku7H+cbcBJlopXjkWlwxrk/xGqMemr7JkGPGemPrLLX7A==} engines: {node: '>=18.17.0'} - hasBin: true peerDependencies: '@opentelemetry/api': ^1.1.0 '@playwright/test': ^1.41.2 @@ -2942,7 +2919,6 @@ packages: rc@1.2.8: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} - hasBin: true react-aria@3.33.0: resolution: {integrity: sha512-aKn9SQn5TMlmpUsIjfRMtse2v3okGcSo+gWLGrj9JVjxs4PL4FSU4mclj4Bg2JUXZTGgfLSq6PWUBzQ4gIP2zg==} @@ -3034,7 +3010,6 @@ packages: resolve@1.22.8: resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} - hasBin: true restore-cursor@3.1.0: resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} @@ -3046,17 +3021,14 @@ packages: rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - hasBin: true rimraf@5.0.5: resolution: {integrity: sha512-CqDakW+hMe/Bz202FPEymy68P+G50RfMQK+Qo5YUqc9SPipvbGjCGKd0RSKEelbsfQuw3g5NZDSrlZZAJurH1A==} engines: {node: '>=14'} - hasBin: true rollup@4.17.2: resolution: {integrity: sha512-/9ClTJPByC0U4zNLowV1tMBe8yMEAxewtR3cUNX5BoEpGH3dQEWpJLr6CLp0fPdYRF/fzVOgvDb1zXuakwF5kQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} - hasBin: true run-async@2.4.1: resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} @@ -3081,10 +3053,9 @@ packages: scheduler@0.23.2: resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - semver@7.6.0: - resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} + semver@7.6.1: + resolution: {integrity: sha512-f/vbBsu+fOiYt+lmwZV0rVwJScl46HppnOA1ZvIuBWKOTlllpyJ3bfVax76/OrhCH38dyxoDIA8K7uB963IYgA==} engines: {node: '>=10'} - hasBin: true sentence-case@2.1.1: resolution: {integrity: sha512-ENl7cYHaK/Ktwk5OTD+aDbQ3uC8IByu/6Bkg+HDv8Mm+XnBnppVNalcfJTNsp1ibstKh030/JKQQWglDvtKwEQ==} @@ -3204,12 +3175,10 @@ packages: sucrase@3.35.0: resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} engines: {node: '>=16 || 14 >=14.17'} - hasBin: true supabase@1.165.0: resolution: {integrity: sha512-bN1TSR6p4POxCQqb3OsO6vo2H9yKIUB2HW44SiLAV9leBIjdm4AsrJJ1hmc/YecqjtuBooAr7RXz/uGKQEQbEQ==} engines: {npm: '>=8'} - hasBin: true supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} @@ -3237,7 +3206,6 @@ packages: tailwindcss@3.4.3: resolution: {integrity: sha512-U7sxQk/n397Bmx4JHbJx/iSOOv5G+II3f1kpLpY2QeUv5DcPdcTsYLlusZfq1NthHS1c1cZoyFmmkex1rzke0A==} engines: {node: '>=14.0.0'} - hasBin: true tar@7.0.1: resolution: {integrity: sha512-IjMhdQMZFpKsHEQT3woZVxBtCQY+0wk3CVxdRkGXEgyGa0dNS/ehPvOMr2nmfC7x5Zj2N+l6yZUpmICjLGS35w==} @@ -3289,7 +3257,6 @@ packages: ts-node@10.9.2: resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} - hasBin: true peerDependencies: '@swc/core': '>=1.2.50' '@swc/wasm': '>=1.2.50' @@ -3310,7 +3277,6 @@ packages: tsx@4.9.3: resolution: {integrity: sha512-czVbetlILiyJZI5zGlj2kw9vFiSeyra9liPD4nG+Thh4pKTi0AmMEQ8zdV/L2xbIVKrIqif4sUNrsMAOksx9Zg==} engines: {node: '>=18.0.0'} - hasBin: true turbo-darwin-64@1.13.3: resolution: {integrity: sha512-glup8Qx1qEFB5jerAnXbS8WrL92OKyMmg5Hnd4PleLljAeYmx+cmmnsmLT7tpaVZIN58EAAwu8wHC6kIIqhbWA==} @@ -3344,7 +3310,6 @@ packages: turbo@1.13.3: resolution: {integrity: sha512-n17HJv4F4CpsYTvKzUJhLbyewbXjq1oLCi90i5tW1TiWDz16ML1eDG7wi5dHaKxzh5efIM56SITnuVbMq5dk4g==} - hasBin: true type-detect@4.0.8: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} @@ -3357,7 +3322,6 @@ packages: typescript@5.4.5: resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} engines: {node: '>=14.17'} - hasBin: true ufo@1.5.3: resolution: {integrity: sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==} @@ -3365,7 +3329,6 @@ packages: uglify-js@3.17.4: resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} engines: {node: '>=0.8.0'} - hasBin: true undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} @@ -3376,7 +3339,6 @@ packages: update-browserslist-db@1.0.15: resolution: {integrity: sha512-K9HWH62x3/EalU1U6sjSZiylm9C8tgq2mSvshZpqc7QE69RaA2qjhkW2HlNA0tFpEbtyFz7HTqbSdN4MSwUodA==} - hasBin: true peerDependencies: browserslist: '>= 4.21.0' @@ -3422,12 +3384,10 @@ packages: vite-node@1.6.0: resolution: {integrity: sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==} engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true vite@5.2.11: resolution: {integrity: sha512-HndV31LWW05i1BLPMUCE1B9E9GFbOu1MbenhS58FuK6owSO5qHm7GiCotrNY1YE5rMeQSFBGmT5ZaLEjFizgiQ==} engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true peerDependencies: '@types/node': ^18.0.0 || >=20.0.0 less: '*' @@ -3455,7 +3415,6 @@ packages: vitest@1.6.0: resolution: {integrity: sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==} engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@types/node': ^18.0.0 || >=20.0.0 @@ -3493,12 +3452,10 @@ packages: which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} - hasBin: true why-is-node-running@2.2.2: resolution: {integrity: sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==} engines: {node: '>=8'} - hasBin: true wordwrap@1.0.0: resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} @@ -3534,9 +3491,6 @@ packages: utf-8-validate: optional: true - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - yallist@5.0.0: resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} engines: {node: '>=18'} @@ -3544,7 +3498,6 @@ packages: yaml@2.4.2: resolution: {integrity: sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==} engines: {node: '>= 14'} - hasBin: true yn@3.1.1: resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} @@ -3560,17 +3513,17 @@ packages: peerDependencies: zod: ^3.18.0 - zod@3.23.6: - resolution: {integrity: sha512-RTHJlZhsRbuA8Hmp/iNL7jnfc4nZishjsanDAfEY1QpDQZCahUp3xDzl+zfweE9BklxMUcgBgS1b7Lvie/ZVwA==} + zod@3.23.7: + resolution: {integrity: sha512-NBeIoqbtOiUMomACV/y+V3Qfs9+Okr18vR5c/5pHClPpufWOrsx8TENboDPe265lFdfewX2yBtNTLPvnmCxwog==} snapshots: '@alloc/quick-lru@5.2.0': {} - '@asteasolutions/zod-to-openapi@7.0.0(zod@3.23.6)': + '@asteasolutions/zod-to-openapi@7.0.0(zod@3.23.7)': dependencies: openapi3-ts: 4.3.1 - zod: 3.23.6 + zod: 3.23.7 '@babel/runtime-corejs3@7.24.5': dependencies: @@ -3737,21 +3690,21 @@ snapshots: '@hono/node-server@1.11.1': {} - '@hono/swagger-ui@0.2.2(hono@4.3.2)': + '@hono/swagger-ui@0.2.2(hono@4.3.3)': dependencies: - hono: 4.3.2 + hono: 4.3.3 - '@hono/zod-openapi@0.11.0(hono@4.3.2)(zod@3.23.6)': + '@hono/zod-openapi@0.11.0(hono@4.3.3)(zod@3.23.7)': dependencies: - '@asteasolutions/zod-to-openapi': 7.0.0(zod@3.23.6) - '@hono/zod-validator': 0.2.1(hono@4.3.2)(zod@3.23.6) - hono: 4.3.2 - zod: 3.23.6 + '@asteasolutions/zod-to-openapi': 7.0.0(zod@3.23.7) + '@hono/zod-validator': 0.2.1(hono@4.3.3)(zod@3.23.7) + hono: 4.3.3 + zod: 3.23.7 - '@hono/zod-validator@0.2.1(hono@4.3.2)(zod@3.23.6)': + '@hono/zod-validator@0.2.1(hono@4.3.3)(zod@3.23.7)': dependencies: - hono: 4.3.2 - zod: 3.23.6 + hono: 4.3.3 + zod: 3.23.7 '@hookform/resolvers@3.3.4(react-hook-form@7.51.4(react@18.3.1))': dependencies: @@ -5384,7 +5337,7 @@ snapshots: '@tsconfig/node16@1.0.4': {} - '@turbo/gen@1.13.3(@types/node@20.12.10)(typescript@5.4.5)': + '@turbo/gen@1.13.3(@types/node@20.12.11)(typescript@5.4.5)': dependencies: '@turbo/workspaces': 1.13.3 chalk: 2.4.2 @@ -5394,7 +5347,7 @@ snapshots: minimatch: 9.0.4 node-plop: 0.26.3 proxy-agent: 6.4.0 - ts-node: 10.9.2(@types/node@20.12.10)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@20.12.11)(typescript@5.4.5) update-check: 1.5.4 validate-npm-package-name: 5.0.1 transitivePeerDependencies: @@ -5416,7 +5369,7 @@ snapshots: js-yaml: 4.1.0 ora: 4.1.1 rimraf: 3.0.2 - semver: 7.6.0 + semver: 7.6.1 update-check: 1.5.4 '@types/estree@1.0.5': {} @@ -5424,7 +5377,7 @@ snapshots: '@types/glob@7.2.0': dependencies: '@types/minimatch': 5.1.2 - '@types/node': 20.12.10 + '@types/node': 20.12.11 '@types/inquirer@6.5.0': dependencies: @@ -5433,7 +5386,7 @@ snapshots: '@types/minimatch@5.1.2': {} - '@types/node@20.12.10': + '@types/node@20.12.11': dependencies: undici-types: 5.26.5 @@ -5454,13 +5407,13 @@ snapshots: '@types/through@0.0.33': dependencies: - '@types/node': 20.12.10 + '@types/node': 20.12.11 '@types/tinycolor2@1.4.6': {} '@types/ws@8.5.10': dependencies: - '@types/node': 20.12.10 + '@types/node': 20.12.11 '@vitest/expect@1.6.0': dependencies: @@ -5598,7 +5551,7 @@ snapshots: browserslist@4.23.0: dependencies: caniuse-lite: 1.0.30001616 - electron-to-chromium: 1.4.757 + electron-to-chromium: 1.4.758 node-releases: 2.0.14 update-browserslist-db: 1.0.15(browserslist@4.23.0) @@ -5821,7 +5774,7 @@ snapshots: eastasianwidth@0.2.0: {} - electron-to-chromium@1.4.757: {} + electron-to-chromium@1.4.758: {} emoji-regex@8.0.0: {} @@ -6046,7 +5999,7 @@ snapshots: no-case: 2.3.2 upper-case: 1.1.3 - hono@4.3.2: {} + hono@4.3.3: {} http-proxy-agent@7.0.2: dependencies: @@ -6245,10 +6198,6 @@ snapshots: lru-cache@10.2.2: {} - lru-cache@6.0.0: - dependencies: - yallist: 4.0.0 - lru-cache@7.18.3: {} lucide-react@0.378.0(react@18.3.1): @@ -6518,13 +6467,13 @@ snapshots: camelcase-css: 2.0.1 postcss: 8.4.38 - postcss-load-config@4.0.2(postcss@8.4.38)(ts-node@10.9.2(@types/node@20.12.10)(typescript@5.4.5)): + postcss-load-config@4.0.2(postcss@8.4.38)(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5)): dependencies: lilconfig: 3.1.1 yaml: 2.4.2 optionalDependencies: postcss: 8.4.38 - ts-node: 10.9.2(@types/node@20.12.10)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@20.12.11)(typescript@5.4.5) postcss-nested@6.0.1(postcss@8.4.38): dependencies: @@ -6765,9 +6714,7 @@ snapshots: dependencies: loose-envify: 1.4.0 - semver@7.6.0: - dependencies: - lru-cache: 6.0.0 + semver@7.6.1: {} sentence-case@2.1.1: dependencies: @@ -6778,7 +6725,7 @@ snapshots: dependencies: color: 4.2.3 detect-libc: 2.0.3 - semver: 7.6.0 + semver: 7.6.1 optionalDependencies: '@img/sharp-darwin-arm64': 0.33.3 '@img/sharp-darwin-x64': 0.33.3 @@ -6926,11 +6873,11 @@ snapshots: dependencies: '@babel/runtime': 7.24.5 - tailwindcss-animate@1.0.7(tailwindcss@3.4.3(ts-node@10.9.2(@types/node@20.12.10)(typescript@5.4.5))): + tailwindcss-animate@1.0.7(tailwindcss@3.4.3(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5))): dependencies: - tailwindcss: 3.4.3(ts-node@10.9.2(@types/node@20.12.10)(typescript@5.4.5)) + tailwindcss: 3.4.3(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5)) - tailwindcss@3.4.3(ts-node@10.9.2(@types/node@20.12.10)(typescript@5.4.5)): + tailwindcss@3.4.3(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5)): dependencies: '@alloc/quick-lru': 5.2.0 arg: 5.0.2 @@ -6949,7 +6896,7 @@ snapshots: postcss: 8.4.38 postcss-import: 15.1.0(postcss@8.4.38) postcss-js: 4.0.1(postcss@8.4.38) - postcss-load-config: 4.0.2(postcss@8.4.38)(ts-node@10.9.2(@types/node@20.12.10)(typescript@5.4.5)) + postcss-load-config: 4.0.2(postcss@8.4.38)(ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5)) postcss-nested: 6.0.1(postcss@8.4.38) postcss-selector-parser: 6.0.16 resolve: 1.22.8 @@ -7006,14 +6953,14 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-node@10.9.2(@types/node@20.12.10)(typescript@5.4.5): + ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.12.10 + '@types/node': 20.12.11 acorn: 8.11.3 acorn-walk: 8.3.2 arg: 4.1.3 @@ -7115,13 +7062,13 @@ snapshots: validate-npm-package-name@5.0.1: {} - vite-node@1.6.0(@types/node@20.12.10): + vite-node@1.6.0(@types/node@20.12.11): dependencies: cac: 6.7.14 debug: 4.3.4 pathe: 1.1.2 picocolors: 1.0.0 - vite: 5.2.11(@types/node@20.12.10) + vite: 5.2.11(@types/node@20.12.11) transitivePeerDependencies: - '@types/node' - less @@ -7132,16 +7079,16 @@ snapshots: - supports-color - terser - vite@5.2.11(@types/node@20.12.10): + vite@5.2.11(@types/node@20.12.11): dependencies: esbuild: 0.20.2 postcss: 8.4.38 rollup: 4.17.2 optionalDependencies: - '@types/node': 20.12.10 + '@types/node': 20.12.11 fsevents: 2.3.3 - vitest@1.6.0(@types/node@20.12.10): + vitest@1.6.0(@types/node@20.12.11): dependencies: '@vitest/expect': 1.6.0 '@vitest/runner': 1.6.0 @@ -7160,11 +7107,11 @@ snapshots: strip-literal: 2.1.0 tinybench: 2.8.0 tinypool: 0.8.4 - vite: 5.2.11(@types/node@20.12.10) - vite-node: 1.6.0(@types/node@20.12.10) + vite: 5.2.11(@types/node@20.12.11) + vite-node: 1.6.0(@types/node@20.12.11) why-is-node-running: 2.2.2 optionalDependencies: - '@types/node': 20.12.10 + '@types/node': 20.12.11 transitivePeerDependencies: - less - lightningcss @@ -7225,8 +7172,6 @@ snapshots: ws@8.17.0: {} - yallist@4.0.0: {} - yallist@5.0.0: {} yaml@2.4.2: {} @@ -7235,8 +7180,8 @@ snapshots: yocto-queue@1.0.0: {} - zod-validation-error@3.2.0(zod@3.23.6): + zod-validation-error@3.2.0(zod@3.23.7): dependencies: - zod: 3.23.6 + zod: 3.23.7 - zod@3.23.6: {} + zod@3.23.7: {}