diff --git a/apps/mana/apps/web/src/app.d.ts b/apps/mana/apps/web/src/app.d.ts index 46d33b216..b6f0df82a 100644 --- a/apps/mana/apps/web/src/app.d.ts +++ b/apps/mana/apps/web/src/app.d.ts @@ -1,6 +1,3 @@ -declare const __BUILD_HASH__: string; -declare const __BUILD_TIME__: string; - /** * App type declarations for Mana web app * @@ -8,6 +5,9 @@ declare const __BUILD_TIME__: string; * No Supabase is needed - all data comes from mana-auth APIs. */ declare global { + const __BUILD_HASH__: string; + const __BUILD_TIME__: string; + namespace App { // eslint-disable-next-line @typescript-eslint/no-empty-object-type interface Locals {} diff --git a/apps/mana/apps/web/src/lib/modules/habits/queries.ts b/apps/mana/apps/web/src/lib/modules/habits/queries.ts index 9f2fc6c5c..75b894525 100644 --- a/apps/mana/apps/web/src/lib/modules/habits/queries.ts +++ b/apps/mana/apps/web/src/lib/modules/habits/queries.ts @@ -16,7 +16,10 @@ export function toHabit(local: LocalHabit): Habit { return { id: local.id, title: local.title, - icon: local.icon ?? EMOJI_TO_ICON_MAP[(local as Record).emoji] ?? 'star', + icon: + local.icon ?? + EMOJI_TO_ICON_MAP[(local as unknown as { emoji?: string }).emoji ?? ''] ?? + 'star', color: local.color, targetPerDay: local.targetPerDay, defaultDuration: local.defaultDuration ?? null, diff --git a/apps/mana/apps/web/src/lib/server/middleware.ts b/apps/mana/apps/web/src/lib/server/middleware.ts deleted file mode 100644 index 513ad89a4..000000000 --- a/apps/mana/apps/web/src/lib/server/middleware.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { MIDDLEWARE_URL } from '$env/static/private'; - -/** - * Server-side only middleware client - * The middleware URL is kept private and not exposed to the browser - */ -export async function callMiddleware( - endpoint: string, - options: { - method?: string; - body?: any; - headers?: Record; - } = {} -) { - const url = `${MIDDLEWARE_URL}${endpoint}`; - - const response = await fetch(url, { - method: options.method || 'GET', - headers: { - 'Content-Type': 'application/json', - ...options.headers, - }, - body: options.body ? JSON.stringify(options.body) : undefined, - }); - - if (!response.ok) { - throw new Error(`Middleware error: ${response.statusText}`); - } - - return response.json(); -} diff --git a/apps/mana/apps/web/src/routes/api/example/+server.ts b/apps/mana/apps/web/src/routes/api/example/+server.ts deleted file mode 100644 index 293320bec..000000000 --- a/apps/mana/apps/web/src/routes/api/example/+server.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { json, error } from '@sveltejs/kit'; -import { callMiddleware } from '$lib/server/middleware'; -import type { RequestHandler } from './$types'; - -/** - * Example API route that proxies to the middleware - * The middleware URL stays hidden on the server - */ -export const GET: RequestHandler = async ({ locals: { session } }) => { - if (!session) { - throw error(401, 'Unauthorized'); - } - - try { - // Call middleware from server-side only - // The middleware URL is never exposed to the client - const data = await callMiddleware('/api/some-endpoint', { - method: 'GET', - headers: { - Authorization: `Bearer ${session.access_token}`, - }, - }); - - return json(data); - } catch (err) { - console.error('Middleware call failed:', err); - throw error(500, 'Failed to fetch data from middleware'); - } -}; diff --git a/packages/shared-branding/src/mana-apps.ts b/packages/shared-branding/src/mana-apps.ts index c5273f43f..7c0af8bb6 100644 --- a/packages/shared-branding/src/mana-apps.ts +++ b/packages/shared-branding/src/mana-apps.ts @@ -750,7 +750,6 @@ export const APP_SLIDER_LABELS = { export const APP_URLS: Record = { // ─── Unified App (internal paths) ───────────────────────── mana: { dev: 'http://localhost:5173', prod: 'https://mana.how' }, - mana: { dev: 'http://localhost:5173', prod: 'https://mana.how' }, todo: { dev: 'http://localhost:5173/todo', prod: 'https://mana.how/todo' }, calendar: { dev: 'http://localhost:5173/calendar', prod: 'https://mana.how/calendar' }, contacts: { dev: 'http://localhost:5173/contacts', prod: 'https://mana.how/contacts' }, @@ -762,8 +761,7 @@ export const APP_URLS: Record = { music: { dev: 'http://localhost:5173/music', prod: 'https://mana.how/music' }, storage: { dev: 'http://localhost:5173/storage', prod: 'https://mana.how/storage' }, presi: { dev: 'http://localhost:5173/presi', prod: 'https://mana.how/presi' }, - inventar: { dev: 'http://localhost:5173/inventar', prod: 'https://mana.how/inventar' }, - inventory: { dev: 'http://localhost:5173/inventar', prod: 'https://mana.how/inventar' }, + inventory: { dev: 'http://localhost:5173/inventory', prod: 'https://mana.how/inventory' }, photos: { dev: 'http://localhost:5173/photos', prod: 'https://mana.how/photos' }, skilltree: { dev: 'http://localhost:5173/skilltree', prod: 'https://mana.how/skilltree' }, citycorners: { dev: 'http://localhost:5173/citycorners', prod: 'https://mana.how/citycorners' }, diff --git a/packages/shared-stores/src/toggle-field.ts b/packages/shared-stores/src/toggle-field.ts index c568eb233..feb81583e 100644 --- a/packages/shared-stores/src/toggle-field.ts +++ b/packages/shared-stores/src/toggle-field.ts @@ -16,7 +16,7 @@ * ``` */ -import type { Table } from 'dexie'; +import type { Table, UpdateSpec } from 'dexie'; /** * Toggle a boolean field on a Dexie record. @@ -36,7 +36,7 @@ export async function toggleField( await table.update(id, { [field]: newValue, updatedAt: new Date().toISOString(), - } as Partial); + } as unknown as UpdateSpec); return newValue; }