From d5048dda38e062108f6c97ad23645f8c4c562204 Mon Sep 17 00:00:00 2001 From: Shni Date: Sun, 2 Nov 2025 20:53:11 -0600 Subject: [PATCH] =?UTF-8?q?feat:=20Actualizar=20versi=C3=B3n=20del=20paque?= =?UTF-8?q?te=20y=20agregar=20endpoint=20API=20para=20pruebas=20de=20entid?= =?UTF-8?q?ad?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 4 ++-- src/server/handler.ts | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0eeea32..5fdc7aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "amayo", - "version": "2.0.22", + "version": "2.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "amayo", - "version": "2.0.22", + "version": "2.1.2", "license": "MIT", "dependencies": { "@google/genai": "1.20.0", diff --git a/src/server/handler.ts b/src/server/handler.ts index 7e1d87e..904b295 100644 --- a/src/server/handler.ts +++ b/src/server/handler.ts @@ -270,7 +270,8 @@ export const handler = async (req: IncomingMessage, res: ServerResponse) => { // Dashboard routes (require session) — exclude labs which has its own handler if ( url.pathname === "/dashboard" || - (url.pathname.startsWith("/dashboard/") && !url.pathname.startsWith("/dashboard/labs")) + (url.pathname.startsWith("/dashboard/") && + !url.pathname.startsWith("/dashboard/labs")) ) { const cookies = parseCookies(req); const signed = cookies["amayo_sid"]; @@ -325,7 +326,8 @@ export const handler = async (req: IncomingMessage, res: ServerResponse) => { // dashboard should not render the site's navbar hideNavbar: true, selectedGuild: visibleGuilds?.[0] ?? session?.guilds?.[0] ?? null, - selectedGuildId: visibleGuilds?.[0]?.id ?? session?.guilds?.[0]?.id ?? null, + selectedGuildId: + visibleGuilds?.[0]?.id ?? session?.guilds?.[0]?.id ?? null, session, user: session?.user ?? null, guilds: visibleGuilds || [], @@ -447,6 +449,17 @@ export const handler = async (req: IncomingMessage, res: ServerResponse) => { return res.end(); } + // API endpoint for entity test: GET /api/entity.json + if (url.pathname === "/api/entity.json") { + res.writeHead( + 200, + applySecurityHeadersForRequest(req, { + "Content-Type": "application/json; charset=utf-8", + }) + ); + return res.end(JSON.stringify({ conexion: "establecida" })); + } + // API proxy for dashboard roles: GET /api/dashboard/:id/roles if ( url.pathname.startsWith("/api/dashboard/") &&