Fix wrong type

import, make auth and chat work
This commit is contained in:
Wuesteon 2025-12-04 23:25:25 +01:00
parent b8f9bc107c
commit 9c47119535
261 changed files with 24453 additions and 443 deletions

View file

@ -1,8 +1,9 @@
import { Injectable, Inject, NotFoundException } from '@nestjs/common';
import { eq, and } from 'drizzle-orm';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { calendars, type Calendar, type NewCalendar } from '../db/schema/calendars.schema';
import { Database } from '../db/connection';
import { calendars } from '../db/schema/calendars.schema';
import type { Calendar, NewCalendar } from '../db/schema/calendars.schema';
import { CreateCalendarDto, UpdateCalendarDto } from './dto';
@Injectable()

View file

@ -1,6 +1,7 @@
import { Module, Global, OnModuleDestroy } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { getDb, closeConnection, type Database } from './connection';
import { getDb, closeConnection } from './connection';
import type { Database } from './connection';
export const DATABASE_CONNECTION = 'DATABASE_CONNECTION';

View file

@ -1,8 +1,8 @@
import { Injectable, Inject, NotFoundException, ForbiddenException } from '@nestjs/common';
import { eq, and, gte, lte, inArray, or, ilike } from 'drizzle-orm';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { events, type Event, type NewEvent } from '../db/schema/events.schema';
import { Database } from '../db/connection';
import { events, Event, NewEvent } from '../db/schema/events.schema';
import { calendars } from '../db/schema/calendars.schema';
import { CalendarService } from '../calendar/calendar.service';
import { CreateEventDto, UpdateEventDto, QueryEventsDto } from './dto';

View file

@ -2,8 +2,9 @@ import { Injectable, Inject, NotFoundException } from '@nestjs/common';
import { Cron, CronExpression } from '@nestjs/schedule';
import { eq, and, lte } from 'drizzle-orm';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { reminders, type Reminder, type NewReminder } from '../db/schema/reminders.schema';
import { Database } from '../db/connection';
import { reminders } from '../db/schema/reminders.schema';
import type { Reminder, NewReminder } from '../db/schema/reminders.schema';
import { events } from '../db/schema/events.schema';
import { EventService } from '../event/event.service';
import { CreateReminderDto } from './dto';

View file

@ -2,7 +2,7 @@ import { Injectable, Inject, NotFoundException, ForbiddenException } from '@nest
import { eq, and, or } from 'drizzle-orm';
import { randomBytes } from 'crypto';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { Database } from '../db/connection';
import {
calendarShares,
type CalendarShare,

View file

@ -1,5 +1,6 @@
<script lang="ts">
import { AppSlider, type AppItem } from '@manacore/shared-ui';
import { AppSlider } from '@manacore/shared-ui';
import type { AppItem } from '@manacore/shared-ui';
import { MANA_APPS, APP_STATUS_LABELS, APP_SLIDER_LABELS } from '@manacore/shared-branding';
// Convert MANA_APPS to AppItem format (German)

View file

@ -1,5 +1,6 @@
<script lang="ts">
import { toast, type Toast } from '$lib/stores/toast';
import { toast } from '$lib/stores/toast';
import type { Toast } from '$lib/stores/toast';
import { fly } from 'svelte/transition';
let toasts = $state<Toast[]>([]);

View file

@ -4,7 +4,8 @@
*/
import { browser } from '$app/environment';
import { initializeWebAuth, type UserData } from '@manacore/shared-auth';
import { initializeWebAuth } from '@manacore/shared-auth';
import type { UserData } from '@manacore/shared-auth';
// Initialize Mana Core Auth only on the client side
const MANA_AUTH_URL = 'http://localhost:3001';

View file

@ -5,15 +5,12 @@
import { authStore } from '$lib/stores/auth.svelte';
import { theme } from '$lib/stores/theme';
import { userSettings } from '$lib/stores/user-settings.svelte';
import {
settingsStore,
type WeekStartDay,
type TimeFormat,
type AllDayDisplayMode,
} from '$lib/stores/settings.svelte';
import { settingsStore } from '$lib/stores/settings.svelte';
import type { WeekStartDay, TimeFormat, AllDayDisplayMode } from '$lib/stores/settings.svelte';
import { calendarsStore } from '$lib/stores/calendars.svelte';
import { toast } from '$lib/stores/toast';
import { setLocale, supportedLocales, type SupportedLocale } from '$lib/i18n';
import { setLocale, supportedLocales } from '$lib/i18n';
import type { SupportedLocale } from '$lib/i18n';
import { THEME_DEFINITIONS } from '@manacore/shared-theme';
import { GlobalSettingsSection } from '@manacore/shared-ui';
import type { CalendarViewType, Calendar } from '@calendar/shared';

View file

@ -1,8 +1,10 @@
import { Body, Controller, Get, Post, UseGuards } from '@nestjs/common';
import { isOk } from '@manacore/shared-errors';
import { type ChatService } from './chat.service';
import { type ChatCompletionDto, type ChatCompletionResponseDto } from './dto/chat-completion.dto';
import { JwtAuthGuard, CurrentUser, type CurrentUserData } from '@manacore/shared-nestjs-auth';
import { ChatService } from './chat.service';
import { ChatCompletionDto } from './dto/chat-completion.dto';
import type { ChatCompletionResponseDto } from './dto/chat-completion.dto';
import { JwtAuthGuard, CurrentUser } from '@manacore/shared-nestjs-auth';
import type { CurrentUserData } from '@manacore/shared-nestjs-auth';
@Controller('chat')
@UseGuards(JwtAuthGuard)

View file

@ -1,12 +1,14 @@
import { Injectable, Inject, Logger } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { eq } from 'drizzle-orm';
import { type AsyncResult, ok, err, ValidationError, ServiceError } from '@manacore/shared-errors';
import { AsyncResult, ok, err, ValidationError, ServiceError } from '@manacore/shared-errors';
import { GoogleGenerativeAI } from '@google/generative-ai';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { models, type Model } from '../db/schema/models.schema';
import { type ChatCompletionDto, type ChatCompletionResponseDto } from './dto/chat-completion.dto';
import { Database } from '../db/connection';
import { models } from '../db/schema/models.schema';
import type { Model } from '../db/schema/models.schema';
import { ChatCompletionDto } from './dto/chat-completion.dto';
import type { ChatCompletionResponseDto } from './dto/chat-completion.dto';
@Injectable()
export class ChatService {

View file

@ -10,10 +10,11 @@ import {
UseGuards,
} from '@nestjs/common';
import { isOk } from '@manacore/shared-errors';
import { type ConversationService } from './conversation.service';
import { type Conversation } from '../db/schema/conversations.schema';
import { type Message } from '../db/schema/messages.schema';
import { JwtAuthGuard, CurrentUser, type CurrentUserData } from '@manacore/shared-nestjs-auth';
import { ConversationService } from './conversation.service';
import { Conversation } from '../db/schema/conversations.schema';
import { Message } from '../db/schema/messages.schema';
import { JwtAuthGuard, CurrentUser } from '@manacore/shared-nestjs-auth';
import type { CurrentUserData } from '@manacore/shared-nestjs-auth';
@Controller('conversations')
@UseGuards(JwtAuthGuard)

View file

@ -1,14 +1,12 @@
import { Injectable, Inject, Logger } from '@nestjs/common';
import { eq, and, desc, asc, sql } from 'drizzle-orm';
import { type AsyncResult, ok, err, DatabaseError, NotFoundError } from '@manacore/shared-errors';
import { AsyncResult, ok, err, DatabaseError, NotFoundError } from '@manacore/shared-errors';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import {
conversations,
type Conversation,
type NewConversation,
} from '../db/schema/conversations.schema';
import { messages, type Message, type NewMessage } from '../db/schema/messages.schema';
import { Database } from '../db/connection';
import { conversations } from '../db/schema/conversations.schema';
import type { Conversation, NewConversation } from '../db/schema/conversations.schema';
import { messages } from '../db/schema/messages.schema';
import type { Message, NewMessage } from '../db/schema/messages.schema';
@Injectable()
export class ConversationService {

View file

@ -1,6 +1,8 @@
import { Module, Global, type OnModuleDestroy } from '@nestjs/common';
import { Module, Global } from '@nestjs/common';
import type { OnModuleDestroy } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { getDb, closeConnection, type Database } from './connection';
import { getDb, closeConnection } from './connection';
import type { Database } from './connection';
export const DATABASE_CONNECTION = 'DATABASE_CONNECTION';

View file

@ -1,8 +1,9 @@
import { Body, Controller, Delete, Get, Param, Post, UseGuards } from '@nestjs/common';
import { isOk } from '@manacore/shared-errors';
import { type DocumentService } from './document.service';
import { type Document } from '../db/schema/documents.schema';
import { JwtAuthGuard, CurrentUser, type CurrentUserData } from '@manacore/shared-nestjs-auth';
import { DocumentService } from './document.service';
import { Document } from '../db/schema/documents.schema';
import { JwtAuthGuard, CurrentUser } from '@manacore/shared-nestjs-auth';
import type { CurrentUserData } from '@manacore/shared-nestjs-auth';
@Controller('documents')
@UseGuards(JwtAuthGuard)

View file

@ -1,9 +1,9 @@
import { Injectable, Inject, Logger } from '@nestjs/common';
import { eq, and, desc, sql } from 'drizzle-orm';
import { type AsyncResult, ok, err, DatabaseError, NotFoundError } from '@manacore/shared-errors';
import { AsyncResult, ok, err, DatabaseError, NotFoundError } from '@manacore/shared-errors';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { documents, type Document, type NewDocument } from '../db/schema/documents.schema';
import { Database } from '../db/connection';
import { documents, Document, NewDocument } from '../db/schema/documents.schema';
import { conversations } from '../db/schema/conversations.schema';
@Injectable()

View file

@ -1,7 +1,7 @@
import { Controller, Get, Param } from '@nestjs/common';
import { isOk } from '@manacore/shared-errors';
import { type ModelService } from './model.service';
import { type Model } from '../db/schema/models.schema';
import { ModelService } from './model.service';
import { Model } from '../db/schema/models.schema';
// Models are publicly accessible - no auth required to list available models
@Controller('models')

View file

@ -1,9 +1,10 @@
import { Injectable, Inject, Logger } from '@nestjs/common';
import { eq, asc } from 'drizzle-orm';
import { type AsyncResult, ok, err, DatabaseError, NotFoundError } from '@manacore/shared-errors';
import { AsyncResult, ok, err, DatabaseError, NotFoundError } from '@manacore/shared-errors';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { models, type Model } from '../db/schema/models.schema';
import { Database } from '../db/connection';
import { models } from '../db/schema/models.schema';
import type { Model } from '../db/schema/models.schema';
@Injectable()
export class ModelService {

View file

@ -1,8 +1,10 @@
import { Body, Controller, Delete, Get, Param, Patch, Post, UseGuards } from '@nestjs/common';
import { isOk } from '@manacore/shared-errors';
import { type SpaceService } from './space.service';
import { type Space, type SpaceMember } from '../db/schema/spaces.schema';
import { JwtAuthGuard, CurrentUser, type CurrentUserData } from '@manacore/shared-nestjs-auth';
import { SpaceService } from './space.service';
import { Space } from '../db/schema/spaces.schema';
import type { SpaceMember } from '../db/schema/spaces.schema';
import { JwtAuthGuard, CurrentUser } from '@manacore/shared-nestjs-auth';
import type { CurrentUserData } from '@manacore/shared-nestjs-auth';
@Controller('spaces')
@UseGuards(JwtAuthGuard)

View file

@ -1,8 +1,8 @@
import { Injectable, Inject, Logger } from '@nestjs/common';
import { eq, and, desc, inArray } from 'drizzle-orm';
import { type AsyncResult, ok, err, DatabaseError, NotFoundError } from '@manacore/shared-errors';
import { AsyncResult, ok, err, DatabaseError, NotFoundError } from '@manacore/shared-errors';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { Database } from '../db/connection';
import {
spaces,
spaceMembers,

View file

@ -1,8 +1,9 @@
import { Body, Controller, Delete, Get, Param, Patch, Post, UseGuards } from '@nestjs/common';
import { isOk } from '@manacore/shared-errors';
import { type TemplateService } from './template.service';
import { type Template } from '../db/schema/templates.schema';
import { JwtAuthGuard, CurrentUser, type CurrentUserData } from '@manacore/shared-nestjs-auth';
import { TemplateService } from './template.service';
import { Template } from '../db/schema/templates.schema';
import { JwtAuthGuard, CurrentUser } from '@manacore/shared-nestjs-auth';
import type { CurrentUserData } from '@manacore/shared-nestjs-auth';
@Controller('templates')
@UseGuards(JwtAuthGuard)

View file

@ -1,9 +1,10 @@
import { Injectable, Inject, Logger } from '@nestjs/common';
import { eq, and, asc } from 'drizzle-orm';
import { type AsyncResult, ok, err, DatabaseError, NotFoundError } from '@manacore/shared-errors';
import { AsyncResult, ok, err, DatabaseError, NotFoundError } from '@manacore/shared-errors';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { templates, type Template, type NewTemplate } from '../db/schema/templates.schema';
import { Database } from '../db/connection';
import { templates } from '../db/schema/templates.schema';
import type { Template, NewTemplate } from '../db/schema/templates.schema';
@Injectable()
export class TemplateService {

View file

@ -1,7 +1,8 @@
/**
* Document Service - CRUD operations via Backend API
*/
import { documentApi, type Document as ApiDocument } from './api';
import { documentApi } from './api';
import type { Document as ApiDocument } from './api';
// Re-export type with backwards-compatible naming (snake_case for mobile)
export interface Document {

View file

@ -3,7 +3,8 @@
* This service wraps the backend API for AI completions
*/
import { availableModels } from '../config/azure';
import { chatApi, modelApi, usageApi, type ChatMessage, type TokenUsage } from './api';
import { chatApi, modelApi, usageApi } from './api';
import type { ChatMessage, TokenUsage } from './api';
// Re-export types for backward compatibility
export type { ChatMessage };

View file

@ -1,7 +1,8 @@
/**
* Space Service - CRUD operations via Backend API
*/
import { spaceApi, type Space as ApiSpace, type SpaceMember as ApiSpaceMember } from './api';
import { spaceApi } from './api';
import type { Space as ApiSpace, SpaceMember as ApiSpaceMember } from './api';
// Re-export types with backwards-compatible naming (snake_case for mobile)
export type Space = {

View file

@ -1,7 +1,8 @@
/**
* Template Service - CRUD operations via Backend API
*/
import { templateApi, type Template as ApiTemplate } from './api';
import { templateApi } from './api';
import type { Template as ApiTemplate } from './api';
// Re-export type with backwards-compatible naming (snake_case for mobile)
export interface Template {

View file

@ -1,5 +1,6 @@
<script lang="ts">
import { AppSlider, type AppItem } from '@manacore/shared-ui';
import { AppSlider } from '@manacore/shared-ui';
import type { AppItem } from '@manacore/shared-ui';
import { MANA_APPS, APP_STATUS_LABELS, APP_SLIDER_LABELS } from '@manacore/shared-branding';
// Convert MANA_APPS to AppItem format (German)

View file

@ -1,5 +1,6 @@
<script lang="ts">
import { toastStore, type Toast } from '$lib/stores/toast.svelte';
import { toastStore } from '$lib/stores/toast.svelte';
import type { Toast } from '$lib/stores/toast.svelte';
import { X, CheckCircle, XCircle, Warning, Info } from '@manacore/shared-icons';
let toasts = $derived(toastStore.toasts);

View file

@ -5,7 +5,8 @@
* so we don't need to pass it from the frontend.
*/
import { conversationApi, chatApi, type Conversation, type Message, type ChatMessage } from './api';
import { conversationApi, chatApi } from './api';
import type { Conversation, Message, ChatMessage } from './api';
export type { Conversation, Message };

View file

@ -2,7 +2,8 @@
* Document Service - CRUD operations via Backend API
*/
import { documentApi, conversationApi, type Document } from './api';
import { documentApi, conversationApi } from './api';
import type { Document } from './api';
export type { Document };

View file

@ -2,7 +2,8 @@
* Space Service - CRUD operations via Backend API
*/
import { spaceApi, type Space, type SpaceMember } from './api';
import { spaceApi } from './api';
import type { Space, SpaceMember } from './api';
export type { Space, SpaceMember };

View file

@ -2,7 +2,8 @@
* Template Service - CRUD operations via Backend API
*/
import { templateApi, type Template } from './api';
import { templateApi } from './api';
import type { Template } from './api';
export type { Template };

View file

@ -4,7 +4,8 @@
*/
import { browser } from '$app/environment';
import { initializeWebAuth, type UserData } from '@manacore/shared-auth';
import { initializeWebAuth } from '@manacore/shared-auth';
import type { UserData } from '@manacore/shared-auth';
import { PUBLIC_MANA_CORE_AUTH_URL } from '$env/static/public';
// Initialize Mana Core Auth only on the client side

View file

@ -2,7 +2,8 @@
* Chat Store - Manages current chat state using Svelte 5 runes
*/
import { chatService, type ChatCompletionRequest } from '$lib/services/chat';
import { chatService } from '$lib/services/chat';
import type { ChatCompletionRequest } from '$lib/services/chat';
import type { Message, AIModel, ChatMessage } from '@chat/types';
// State

View file

@ -2,7 +2,8 @@
import { onMount } from 'svelte';
import { theme } from '$lib/stores/theme';
import { userSettings } from '$lib/stores/user-settings.svelte';
import { THEME_DEFINITIONS, type ThemeVariant } from '@manacore/shared-theme';
import { THEME_DEFINITIONS } from '@manacore/shared-theme';
import type { ThemeVariant } from '@manacore/shared-theme';
import {
SettingsPage,
SettingsSection,

View file

@ -1,8 +1,9 @@
import { Injectable, Inject } from '@nestjs/common';
import { eq, and, desc } from 'drizzle-orm';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { contactActivities, type ContactActivity, type NewContactActivity } from '../db/schema';
import { Database } from '../db/connection';
import { contactActivities } from '../db/schema';
import type { ContactActivity, NewContactActivity } from '../db/schema';
export type ActivityType = 'created' | 'updated' | 'called' | 'emailed' | 'met' | 'note_added';

View file

@ -1,8 +1,9 @@
import { Injectable, Inject, NotFoundException } from '@nestjs/common';
import { eq, and, or, ilike, desc, sql } from 'drizzle-orm';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { contacts, type Contact, type NewContact } from '../db/schema';
import { Database } from '../db/connection';
import { contacts } from '../db/schema';
import type { Contact, NewContact } from '../db/schema';
export interface ContactFilters {
search?: string;

View file

@ -1,6 +1,7 @@
import { Module, Global, OnModuleDestroy } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { getDb, closeConnection, type Database } from './connection';
import { getDb, closeConnection } from './connection';
import type { Database } from './connection';
export const DATABASE_CONNECTION = 'DATABASE_CONNECTION';

View file

@ -1,7 +1,7 @@
import { Injectable, Inject, NotFoundException } from '@nestjs/common';
import { eq, and } from 'drizzle-orm';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { Database } from '../db/connection';
import {
contactGroups,
contactToGroups,

View file

@ -1,8 +1,9 @@
import { Injectable, Inject, NotFoundException } from '@nestjs/common';
import { eq, and, desc } from 'drizzle-orm';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { contactNotes, type ContactNote, type NewContactNote } from '../db/schema';
import { Database } from '../db/connection';
import { contactNotes } from '../db/schema';
import type { ContactNote, NewContactNote } from '../db/schema';
@Injectable()
export class NoteService {

View file

@ -1,8 +1,9 @@
import { Injectable, Inject, NotFoundException } from '@nestjs/common';
import { eq, and } from 'drizzle-orm';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { contactTags, contactToTags, type ContactTag, type NewContactTag } from '../db/schema';
import { Database } from '../db/connection';
import { contactTags, contactToTags } from '../db/schema';
import type { ContactTag, NewContactTag } from '../db/schema';
@Injectable()
export class TagService {

View file

@ -1,5 +1,6 @@
<script lang="ts">
import { AppSlider, type AppItem } from '@manacore/shared-ui';
import { AppSlider } from '@manacore/shared-ui';
import type { AppItem } from '@manacore/shared-ui';
import { MANA_APPS, APP_STATUS_LABELS, APP_SLIDER_LABELS } from '@manacore/shared-branding';
// Convert MANA_APPS to AppItem format (German)

View file

@ -1,6 +1,7 @@
<script lang="ts">
import { locale } from 'svelte-i18n';
import { setLocale, supportedLocales, type SupportedLocale } from '$lib/i18n';
import { setLocale, supportedLocales } from '$lib/i18n';
import type { SupportedLocale } from '$lib/i18n';
const languageLabels: Record<SupportedLocale, string> = {
de: 'Deutsch',

View file

@ -1,5 +1,6 @@
<script lang="ts">
import { toasts, type Toast } from '$lib/stores/toast';
import { toasts } from '$lib/stores/toast';
import type { Toast } from '$lib/stores/toast';
function getIcon(type: Toast['type']) {
switch (type) {

View file

@ -4,7 +4,8 @@
*/
import { browser } from '$app/environment';
import { initializeWebAuth, type UserData } from '@manacore/shared-auth';
import { initializeWebAuth } from '@manacore/shared-auth';
import type { UserData } from '@manacore/shared-auth';
// Initialize Mana Core Auth only on the client side
// TODO: Use PUBLIC_MANA_CORE_AUTH_URL from env when available

View file

@ -2,7 +2,8 @@
* Contacts Store - Manages contacts state using Svelte 5 runes
*/
import { contactsApi, type Contact, type ContactFilters } from '$lib/api/contacts';
import { contactsApi } from '$lib/api/contacts';
import type { Contact, ContactFilters } from '$lib/api/contacts';
// State
let contacts = $state<Contact[]>([]);

View file

@ -1,7 +1,8 @@
<script lang="ts">
import { onMount } from 'svelte';
import { goto } from '$app/navigation';
import { contactsApi, type Contact } from '$lib/api/contacts';
import { contactsApi } from '$lib/api/contacts';
import type { Contact } from '$lib/api/contacts';
import '$lib/i18n';
let loading = $state(true);

View file

@ -2,7 +2,8 @@
import { page } from '$app/stores';
import { goto } from '$app/navigation';
import { onMount } from 'svelte';
import { contactsApi, type Contact } from '$lib/api/contacts';
import { contactsApi } from '$lib/api/contacts';
import type { Contact } from '$lib/api/contacts';
import '$lib/i18n';
let contact = $state<Contact | null>(null);

View file

@ -1,7 +1,8 @@
<script lang="ts">
import { onMount } from 'svelte';
import { goto } from '$app/navigation';
import { contactsApi, type Contact } from '$lib/api/contacts';
import { contactsApi } from '$lib/api/contacts';
import type { Contact } from '$lib/api/contacts';
import '$lib/i18n';
let loading = $state(true);

View file

@ -1,7 +1,8 @@
<script lang="ts">
import { onMount } from 'svelte';
import { goto } from '$app/navigation';
import { groupsApi, type ContactGroup } from '$lib/api/contacts';
import { groupsApi } from '$lib/api/contacts';
import type { ContactGroup } from '$lib/api/contacts';
import '$lib/i18n';
let loading = $state(true);

View file

@ -2,7 +2,8 @@
import { onMount } from 'svelte';
import { page } from '$app/stores';
import { goto } from '$app/navigation';
import { groupsApi, contactsApi, type ContactGroup, type Contact } from '$lib/api/contacts';
import { groupsApi, contactsApi } from '$lib/api/contacts';
import type { ContactGroup, Contact } from '$lib/api/contacts';
import '$lib/i18n';
let loading = $state(true);

View file

@ -1,6 +1,7 @@
---
import { Icon } from 'astro-icon/components';
import { languages, type Language } from '../../lib/i18n/config';
import { languages } from '../../lib/i18n/config';
import type { Language } from '../../lib/i18n/config';
import { getRouteFromUrl, getLocalizedRoute } from '../../lib/i18n/utils';
export interface Props {

View file

@ -11,9 +11,10 @@ import {
import { Stack } from 'expo-router';
import { FontAwesome5 } from '@expo/vector-icons';
import { Container } from '~/components/Container';
import { useTheme, type ThemeMode } from '~/utils/themeContext';
import { useTheme } from '~/utils/themeContext';
import type { ThemeMode } from '~/utils/themeContext';
import { supabase } from '../../utils/supabase';
import { type Session } from '@supabase/supabase-js';
import { Session } from '@supabase/supabase-js';
interface Profile {
id: string;

View file

@ -5,7 +5,7 @@ import { Stack, useRouter, useSegments } from 'expo-router';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { ThemeProvider } from '~/utils/themeContext';
import { supabase } from '../utils/supabase';
import { type Session } from '@supabase/supabase-js';
import { Session } from '@supabase/supabase-js';
export const unstable_settings = {
// Ensure that reloading on `/modal` keeps a back button present.

View file

@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react';
import { View, Text, TextInput, TouchableOpacity, StyleSheet, Alert } from 'react-native';
import { supabase } from '../utils/supabase';
import { type Session } from '@supabase/supabase-js';
import { Session } from '@supabase/supabase-js';
interface Profile {
id: string;

View file

@ -1,5 +1,6 @@
import { forwardRef } from 'react';
import { Text, TouchableOpacity, type TouchableOpacityProps, type View } from 'react-native';
import { Text, TouchableOpacity } from 'react-native';
import type { TouchableOpacityProps, View } from 'react-native';
type ButtonProps = {
title: string;

View file

@ -9,7 +9,7 @@ import {
ScrollView,
} from 'react-native';
import { supabase } from '../utils/supabase';
import { type Session } from '@supabase/supabase-js';
import { Session } from '@supabase/supabase-js';
import { useTheme } from '../utils/themeContext';
interface UserRole {

View file

@ -9,7 +9,7 @@ import {
ScrollView,
} from 'react-native';
import { supabase } from '../utils/supabase';
import { type Session } from '@supabase/supabase-js';
import { Session } from '@supabase/supabase-js';
import { useTheme } from '../utils/themeContext';
import { useRouter } from 'expo-router';

View file

@ -3,7 +3,7 @@ import { View, Text, TouchableOpacity, ActivityIndicator } from 'react-native';
import { FontAwesome5 } from '@expo/vector-icons';
import { useRouter } from 'expo-router';
import { supabase } from '../utils/supabase';
import { type Session } from '@supabase/supabase-js';
import { Session } from '@supabase/supabase-js';
import { useTheme, lightColors, darkColors } from '../utils/themeContext';
export default function DashboardStats() {

View file

@ -2,7 +2,7 @@ import React, { useState, useEffect, forwardRef, useImperativeHandle } from 'rea
import { View, Text, FlatList, TouchableOpacity, ActivityIndicator, Alert } from 'react-native';
import { FontAwesome5 } from '@expo/vector-icons';
import { supabase } from '../utils/supabase';
import { type Session } from '@supabase/supabase-js';
import { Session } from '@supabase/supabase-js';
import { useTheme } from '../utils/themeContext';
import { useRouter } from 'expo-router';

View file

@ -9,7 +9,7 @@ import {
ActivityIndicator,
} from 'react-native';
import { supabase } from '../utils/supabase';
import { type Session } from '@supabase/supabase-js';
import { Session } from '@supabase/supabase-js';
import { useTheme } from '../utils/themeContext';
interface User {

View file

@ -10,7 +10,7 @@ import {
} from 'react-native';
import { FontAwesome5 } from '@expo/vector-icons';
import { supabase } from '../utils/supabase';
import { type Session } from '@supabase/supabase-js';
import { Session } from '@supabase/supabase-js';
import { useRouter } from 'expo-router';
import { useTheme } from '../utils/themeContext';

View file

@ -10,7 +10,7 @@ import {
} from 'react-native';
import { FontAwesome5 } from '@expo/vector-icons';
import { supabase } from '../utils/supabase';
import { type Session } from '@supabase/supabase-js';
import { Session } from '@supabase/supabase-js';
import { useTheme } from '../utils/themeContext';
interface TeamMember {

View file

@ -1,5 +1,6 @@
<script lang="ts">
import { AppSlider, type AppItem } from '@manacore/shared-ui';
import { AppSlider } from '@manacore/shared-ui';
import type { AppItem } from '@manacore/shared-ui';
import {
getActiveManaApps,
APP_STATUS_LABELS,

View file

@ -4,7 +4,8 @@
*/
import { browser } from '$app/environment';
import { initializeWebAuth, type UserData } from '@manacore/shared-auth';
import { initializeWebAuth } from '@manacore/shared-auth';
import type { UserData } from '@manacore/shared-auth';
// Initialize Mana Core Auth only on the client side
// TODO: Use PUBLIC_MANA_CORE_AUTH_URL from env when available

View file

@ -1,7 +1,8 @@
<script lang="ts">
import { onMount } from 'svelte';
import { Card, PageHeader } from '@manacore/shared-ui';
import { creditsService, type CreditBalance, type CreditTransaction } from '$lib/api/credits';
import { creditsService } from '$lib/api/credits';
import type { CreditBalance, CreditTransaction } from '$lib/api/credits';
import { authStore } from '$lib/stores/authStore.svelte';
let { data } = $props();

View file

@ -2,7 +2,8 @@
import { onMount } from 'svelte';
import { Button, Input, Card, PageHeader } from '@manacore/shared-ui';
import { authStore } from '$lib/stores/authStore.svelte';
import { creditsService, type CreditBalance } from '$lib/api/credits';
import { creditsService } from '$lib/api/credits';
import type { CreditBalance } from '$lib/api/credits';
import { userSettings } from '$lib/stores/user-settings.svelte';
import type { NavPosition, ThemeMode } from '@manacore/shared-theme';

View file

@ -1,5 +1,6 @@
import { Module, Global, OnModuleDestroy, Logger } from '@nestjs/common';
import { getDb, closeDb, type Database } from '@manacore/manadeck-database/client';
import { getDb, closeDb } from '@manacore/manadeck-database/client';
import type { Database } from '@manacore/manadeck-database/client';
export const DATABASE_TOKEN = 'DATABASE';

View file

@ -1,15 +1,8 @@
import { Injectable, Inject, Logger } from '@nestjs/common';
import { DATABASE_TOKEN, type Database } from '../database.module';
import {
cardProgress,
cards,
type CardProgress,
type NewCardProgress,
eq,
and,
lte,
sql,
} from '@manacore/manadeck-database';
import { DATABASE_TOKEN } from '../database.module';
import type { Database } from '../database.module';
import { cardProgress, cards, eq, and, lte, sql } from '@manacore/manadeck-database';
import type { CardProgress, NewCardProgress } from '@manacore/manadeck-database';
@Injectable()
export class CardProgressRepository {

View file

@ -1,15 +1,8 @@
import { Injectable, Inject, Logger } from '@nestjs/common';
import { DATABASE_TOKEN, type Database } from '../database.module';
import {
cards,
decks,
type Card,
type NewCard,
eq,
and,
asc,
sql,
} from '@manacore/manadeck-database';
import { DATABASE_TOKEN } from '../database.module';
import type { Database } from '../database.module';
import { cards, decks, eq, and, asc, sql } from '@manacore/manadeck-database';
import type { Card, NewCard } from '@manacore/manadeck-database';
@Injectable()
export class CardRepository {

View file

@ -1,14 +1,8 @@
import { Injectable, Inject, Logger } from '@nestjs/common';
import { DATABASE_TOKEN, type Database } from '../database.module';
import {
deckTemplates,
type DeckTemplate,
type NewDeckTemplate,
eq,
and,
desc,
sql,
} from '@manacore/manadeck-database';
import { DATABASE_TOKEN } from '../database.module';
import type { Database } from '../database.module';
import { deckTemplates, eq, and, desc, sql } from '@manacore/manadeck-database';
import type { DeckTemplate, NewDeckTemplate } from '@manacore/manadeck-database';
@Injectable()
export class DeckTemplateRepository {

View file

@ -1,6 +1,8 @@
import { Injectable, Inject, Logger } from '@nestjs/common';
import { DATABASE_TOKEN, type Database } from '../database.module';
import { decks, type Deck, type NewDeck, eq, and, desc, sql } from '@manacore/manadeck-database';
import { DATABASE_TOKEN } from '../database.module';
import type { Database } from '../database.module';
import { decks, eq, and, desc, sql } from '@manacore/manadeck-database';
import type { Deck, NewDeck } from '@manacore/manadeck-database';
@Injectable()
export class DeckRepository {

View file

@ -1,16 +1,8 @@
import { Injectable, Inject, Logger } from '@nestjs/common';
import { DATABASE_TOKEN, type Database } from '../database.module';
import {
studySessions,
type StudySession,
type NewStudySession,
eq,
and,
desc,
gte,
lte,
sql,
} from '@manacore/manadeck-database';
import { DATABASE_TOKEN } from '../database.module';
import type { Database } from '../database.module';
import { studySessions, eq, and, desc, gte, lte, sql } from '@manacore/manadeck-database';
import type { StudySession, NewStudySession } from '@manacore/manadeck-database';
@Injectable()
export class StudySessionRepository {

View file

@ -1,13 +1,8 @@
import { Injectable, Inject, Logger } from '@nestjs/common';
import { DATABASE_TOKEN, type Database } from '../database.module';
import {
userStats,
type UserStats,
type NewUserStats,
eq,
desc,
sql,
} from '@manacore/manadeck-database';
import { DATABASE_TOKEN } from '../database.module';
import type { Database } from '../database.module';
import { userStats, eq, desc, sql } from '@manacore/manadeck-database';
import type { UserStats, NewUserStats } from '@manacore/manadeck-database';
@Injectable()
export class UserStatsRepository {

View file

@ -1,7 +1,7 @@
import { Injectable, Logger } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { GoogleGenAI, Type } from '@google/genai';
import { type AsyncResult, ok, err, ServiceError } from '@manacore/shared-errors';
import { AsyncResult, ok, err, ServiceError } from '@manacore/shared-errors';
export type CardType = 'text' | 'flashcard' | 'quiz' | 'mixed';

View file

@ -10,7 +10,8 @@ import {
TextStyle,
} from 'react-native';
import { Text } from './Text';
import { cva, type VariantProps } from 'class-variance-authority';
import { cva } from 'class-variance-authority';
import type { VariantProps } from 'class-variance-authority';
import { useThemeColors } from '~/utils/themeUtils';
const buttonVariants = cva('flex-row items-center justify-center rounded-lg transition-all', {

View file

@ -1,5 +1,6 @@
import { useState } from 'react';
import { extractCreditError, type InsufficientCreditsError } from '../types/credits';
import { extractCreditError } from '../types/credits';
import type { InsufficientCreditsError } from '../types/credits';
interface InsufficientCreditsState {
visible: boolean;

View file

@ -1,5 +1,6 @@
<script lang="ts">
import { AppSlider, type AppItem } from '@manacore/shared-ui';
import { AppSlider } from '@manacore/shared-ui';
import type { AppItem } from '@manacore/shared-ui';
import {
getActiveManaApps,
APP_STATUS_LABELS,

View file

@ -1,5 +1,6 @@
import type { ManaUser } from '$lib/types/auth';
import { authService, type UserData } from '$lib/auth';
import { authService } from '$lib/auth';
import type { UserData } from '$lib/auth';
// Svelte 5 runes-based auth store
let user = $state<ManaUser | null>(null);

View file

@ -1,7 +1,7 @@
import { Injectable, Inject, NotFoundException, ForbiddenException, Logger } from '@nestjs/common';
import { eq, and, desc, sql } from 'drizzle-orm';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { Database } from '../db/connection';
import {
batchGenerations,
imageGenerations,

View file

@ -1,8 +1,9 @@
import { Injectable, Inject, NotFoundException, ForbiddenException, Logger } from '@nestjs/common';
import { eq, and, max, inArray, gt, lt, sql } from 'drizzle-orm';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { boards, boardItems, images, type BoardItem } from '../db/schema';
import { Database } from '../db/connection';
import { boards, boardItems, images } from '../db/schema';
import type { BoardItem } from '../db/schema';
import { AddImageToBoardDto, AddTextToBoardDto, UpdateBoardItemDto } from './dto/board-item.dto';
export interface BoardItemWithImage extends BoardItem {

View file

@ -1,8 +1,9 @@
import { Injectable, Inject, NotFoundException, ForbiddenException, Logger } from '@nestjs/common';
import { eq, and, or, desc, sql } from 'drizzle-orm';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { boards, boardItems, type Board } from '../db/schema';
import { Database } from '../db/connection';
import { boards, boardItems } from '../db/schema';
import type { Board } from '../db/schema';
import { CreateBoardDto, UpdateBoardDto, GetBoardsQueryDto } from './dto/board.dto';
import { StorageService } from '../upload/storage.service';

View file

@ -1,6 +1,7 @@
import { Module, Global, OnModuleDestroy } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { getDb, closeConnection, type Database } from './connection';
import { getDb, closeConnection } from './connection';
import type { Database } from './connection';
export const DATABASE_CONNECTION = 'DATABASE_CONNECTION';

View file

@ -1,8 +1,9 @@
import { Injectable, Inject, Logger } from '@nestjs/common';
import { eq, and, isNull, desc, ilike } from 'drizzle-orm';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { images, type Image } from '../db/schema';
import { Database } from '../db/connection';
import { images } from '../db/schema';
import type { Image } from '../db/schema';
import { GetPublicImagesDto, SearchPublicImagesDto } from './dto/explore.dto';
@Injectable()

View file

@ -2,8 +2,9 @@ import { Injectable, Inject, NotFoundException, ForbiddenException, Logger } fro
import { ConfigService } from '@nestjs/config';
import { eq } from 'drizzle-orm';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { imageGenerations, images, models, type ImageGeneration, type Image } from '../db/schema';
import { Database } from '../db/connection';
import { imageGenerations, images, models } from '../db/schema';
import type { ImageGeneration, Image } from '../db/schema';
import { ReplicateService, GenerationParams } from './replicate.service';
import { StorageService } from '../upload/storage.service';
import { GenerateImageDto } from './dto/generate.dto';

View file

@ -1,7 +1,7 @@
import { Injectable, Inject, NotFoundException, ForbiddenException, Logger } from '@nestjs/common';
import { eq, and, isNull, isNotNull, desc, inArray, sql } from 'drizzle-orm';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { Database } from '../db/connection';
import {
images,
imageTags,

View file

@ -1,8 +1,9 @@
import { Injectable, Inject, NotFoundException, Logger } from '@nestjs/common';
import { eq, desc } from 'drizzle-orm';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { models, type Model } from '../db/schema';
import { Database } from '../db/connection';
import { models } from '../db/schema';
import type { Model } from '../db/schema';
@Injectable()
export class ModelService {

View file

@ -1,8 +1,9 @@
import { Injectable, Inject, NotFoundException, Logger } from '@nestjs/common';
import { eq, and, isNull, isNotNull, sql, gte, inArray } from 'drizzle-orm';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { profiles, images, imageGenerations, type Profile } from '../db/schema';
import { Database } from '../db/connection';
import { profiles, images, imageGenerations } from '../db/schema';
import type { Profile } from '../db/schema';
import {
UpdateProfileDto,
ProfileResponse,

View file

@ -1,8 +1,9 @@
import { Injectable, Inject, NotFoundException, Logger } from '@nestjs/common';
import { eq, and } from 'drizzle-orm';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { tags, imageTags, images, type Tag } from '../db/schema';
import { Database } from '../db/connection';
import { tags, imageTags, images } from '../db/schema';
import type { Tag } from '../db/schema';
import { CreateTagDto, UpdateTagDto } from './dto/tag.dto';
@Injectable()

View file

@ -1,8 +1,9 @@
import { Injectable, Inject, NotFoundException, ForbiddenException, Logger } from '@nestjs/common';
import { eq } from 'drizzle-orm';
import { DATABASE_CONNECTION } from '../db/database.module';
import { type Database } from '../db/connection';
import { images, imageTags, type Image } from '../db/schema';
import { Database } from '../db/connection';
import { images, imageTags } from '../db/schema';
import type { Image } from '../db/schema';
import { StorageService } from './storage.service';
@Injectable()

View file

@ -1,5 +1,6 @@
---
import { getCollection, type CollectionEntry } from 'astro:content';
import { getCollection } from 'astro:content';
import type { CollectionEntry } from 'astro:content';
import Layout from '../../layouts/Layout.astro';
import ComparisonCard from '../../components/comparisons/ComparisonCard.astro';
import ComparisonSchema from '../../components/comparisons/ComparisonSchema.astro';

View file

@ -1,4 +1,5 @@
import { getCollection, type CollectionEntry } from 'astro:content';
import { getCollection } from 'astro:content';
import type { CollectionEntry } from 'astro:content';
export type ComparisonEntry = CollectionEntry<'comparisons'>;

View file

@ -1,4 +1,5 @@
import { getCollection, type CollectionEntry } from 'astro:content';
import { getCollection } from 'astro:content';
import type { CollectionEntry } from 'astro:content';
export type FAQEntry = CollectionEntry<'faq'>;

View file

@ -1,4 +1,5 @@
import { getCollection, type CollectionEntry } from 'astro:content';
import { getCollection } from 'astro:content';
import type { CollectionEntry } from 'astro:content';
export type PromptTemplateEntry = CollectionEntry<'promptTemplates'>;

View file

@ -1,4 +1,5 @@
import { getCollection, type CollectionEntry } from 'astro:content';
import { getCollection } from 'astro:content';
import type { CollectionEntry } from 'astro:content';
import i18next from '../i18n';
export type TestimonialEntry = CollectionEntry<'testimonials'>;

View file

@ -1,4 +1,5 @@
import { getCollection, type CollectionEntry } from 'astro:content';
import { getCollection } from 'astro:content';
import type { CollectionEntry } from 'astro:content';
export type UseCaseEntry = CollectionEntry<'useCases'>;

View file

@ -2,7 +2,8 @@ import React, { useEffect, useState } from 'react';
import { View, Pressable } from 'react-native';
import { Icon } from './Icon';
import { Text } from './Text';
import { getRateLimits, type RateLimits } from '~/services/api/profiles';
import { getRateLimits } from '~/services/api/profiles';
import type { RateLimits } from '~/services/api/profiles';
import { useAuth } from '~/contexts/AuthContext';
import { useTheme } from '~/contexts/ThemeContext';

View file

@ -1,6 +1,7 @@
import { View, Text, Pressable, ScrollView } from 'react-native';
import { useTheme } from '~/contexts/ThemeContext';
import { themes, type ThemeVariant, type ColorMode } from '@picture/design-tokens';
import { themes } from '@picture/design-tokens';
import type { ThemeVariant, ColorMode } from '@picture/design-tokens';
import { Ionicons } from '@expo/vector-icons';
// ThemeMode includes 'system' for automatic light/dark switching

View file

@ -1,7 +1,8 @@
import { useState, useEffect } from 'react';
import { Alert } from 'react-native';
import { router } from 'expo-router';
import { generateAndWait, type GenerationStatus } from '~/services/api/generate';
import { generateAndWait } from '~/services/api/generate';
import type { GenerationStatus } from '~/services/api/generate';
import { useAuth } from '~/contexts/AuthContext';
import { useModelSelection } from '~/store/modelStore';
import { useTagStore, Tag } from '~/store/tagStore';

View file

@ -1,5 +1,6 @@
<script lang="ts">
import { AppSlider, type AppItem } from '@manacore/shared-ui';
import { AppSlider } from '@manacore/shared-ui';
import type { AppItem } from '@manacore/shared-ui';
import {
getActiveManaApps,
APP_STATUS_LABELS,

Some files were not shown because too many files have changed in this diff Show more