mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 19:41:09 +02:00
Fix wrong type
import, make auth and chat work
This commit is contained in:
parent
b8f9bc107c
commit
9c47119535
261 changed files with 24453 additions and 443 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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[]>([]);
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 };
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 };
|
||||
|
||||
|
|
|
|||
|
|
@ -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 };
|
||||
|
||||
|
|
|
|||
|
|
@ -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 };
|
||||
|
||||
|
|
|
|||
|
|
@ -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 };
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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[]>([]);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -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', {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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'>;
|
||||
|
||||
|
|
|
|||
|
|
@ -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'>;
|
||||
|
||||
|
|
|
|||
|
|
@ -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'>;
|
||||
|
||||
|
|
|
|||
|
|
@ -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'>;
|
||||
|
|
|
|||
|
|
@ -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'>;
|
||||
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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
Loading…
Add table
Add a link
Reference in a new issue