mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-24 00:36:42 +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,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';
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,8 @@ import {
|
|||
} from '@nestjs/common';
|
||||
import { FileInterceptor, FilesInterceptor } from '@nestjs/platform-express';
|
||||
import { Response } from 'express';
|
||||
import { JwtAuthGuard, CurrentUser, type CurrentUserData } from '@manacore/shared-nestjs-auth';
|
||||
import { JwtAuthGuard, CurrentUser } from '@manacore/shared-nestjs-auth';
|
||||
import type { CurrentUserData } from '@manacore/shared-nestjs-auth';
|
||||
import { FileService } from './file.service';
|
||||
import { CreateFileDto, UpdateFileDto, MoveFileDto } from './dto/create-file.dto';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
import { Injectable, Inject, NotFoundException, BadRequestException } from '@nestjs/common';
|
||||
import { eq, and, isNull } from 'drizzle-orm';
|
||||
import { DATABASE_CONNECTION } from '../db/database.module';
|
||||
import { type Database } from '../db/connection';
|
||||
import { files, fileVersions, type File, type NewFile, type NewFileVersion } from '../db/schema';
|
||||
import { Database } from '../db/connection';
|
||||
import { files, fileVersions } from '../db/schema';
|
||||
import type { File, NewFile, NewFileVersion } from '../db/schema';
|
||||
import { StorageService } from '../storage/storage.service';
|
||||
import { CreateFileDto, UpdateFileDto, MoveFileDto } from './dto/create-file.dto';
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@ import {
|
|||
Query,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { JwtAuthGuard, CurrentUser, type CurrentUserData } from '@manacore/shared-nestjs-auth';
|
||||
import { JwtAuthGuard, CurrentUser } from '@manacore/shared-nestjs-auth';
|
||||
import type { CurrentUserData } from '@manacore/shared-nestjs-auth';
|
||||
import { FolderService } from './folder.service';
|
||||
import { CreateFolderDto } from './dto/create-folder.dto';
|
||||
import { UpdateFolderDto, MoveFolderDto } from './dto/update-folder.dto';
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
import { Injectable, Inject, NotFoundException } from '@nestjs/common';
|
||||
import { eq, and, isNull } from 'drizzle-orm';
|
||||
import { DATABASE_CONNECTION } from '../db/database.module';
|
||||
import { type Database } from '../db/connection';
|
||||
import { folders, type Folder, type NewFolder } from '../db/schema';
|
||||
import { Database } from '../db/connection';
|
||||
import { folders } from '../db/schema';
|
||||
import type { Folder, NewFolder } from '../db/schema';
|
||||
import { CreateFolderDto } from './dto/create-folder.dto';
|
||||
import { UpdateFolderDto, MoveFolderDto } from './dto/update-folder.dto';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { Controller, Get, Query, UseGuards } from '@nestjs/common';
|
||||
import { JwtAuthGuard, CurrentUser, type CurrentUserData } from '@manacore/shared-nestjs-auth';
|
||||
import { JwtAuthGuard, CurrentUser } from '@manacore/shared-nestjs-auth';
|
||||
import type { CurrentUserData } from '@manacore/shared-nestjs-auth';
|
||||
import { SearchService } from './search.service';
|
||||
|
||||
@Controller('api/v1')
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
import { Injectable, Inject } from '@nestjs/common';
|
||||
import { eq, and, ilike, or } from 'drizzle-orm';
|
||||
import { DATABASE_CONNECTION } from '../db/database.module';
|
||||
import { type Database } from '../db/connection';
|
||||
import { files, folders, type File, type Folder } from '../db/schema';
|
||||
import { Database } from '../db/connection';
|
||||
import { files, folders } from '../db/schema';
|
||||
import type { File, Folder } from '../db/schema';
|
||||
|
||||
@Injectable()
|
||||
export class SearchService {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { Controller, Get, Post, Delete, Body, Param, UseGuards } from '@nestjs/common';
|
||||
import { JwtAuthGuard, CurrentUser, type CurrentUserData } from '@manacore/shared-nestjs-auth';
|
||||
import { JwtAuthGuard, CurrentUser } from '@manacore/shared-nestjs-auth';
|
||||
import type { CurrentUserData } from '@manacore/shared-nestjs-auth';
|
||||
import { ShareService } from './share.service';
|
||||
|
||||
@Controller('api/v1/shares')
|
||||
|
|
|
|||
|
|
@ -2,8 +2,9 @@ import { Injectable, Inject, NotFoundException } from '@nestjs/common';
|
|||
import { eq, and } from 'drizzle-orm';
|
||||
import { randomBytes } from 'crypto';
|
||||
import { DATABASE_CONNECTION } from '../db/database.module';
|
||||
import { type Database } from '../db/connection';
|
||||
import { shares, type Share, type NewShare } from '../db/schema';
|
||||
import { Database } from '../db/connection';
|
||||
import { shares } from '../db/schema';
|
||||
import type { Share, NewShare } from '../db/schema';
|
||||
|
||||
@Injectable()
|
||||
export class ShareService {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { Controller, Get, Post, Patch, Delete, Body, Param, UseGuards } from '@nestjs/common';
|
||||
import { JwtAuthGuard, CurrentUser, type CurrentUserData } from '@manacore/shared-nestjs-auth';
|
||||
import { JwtAuthGuard, CurrentUser } from '@manacore/shared-nestjs-auth';
|
||||
import type { CurrentUserData } from '@manacore/shared-nestjs-auth';
|
||||
import { TagService } from './tag.service';
|
||||
|
||||
@Controller('api/v1/tags')
|
||||
|
|
|
|||
|
|
@ -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 { tags, fileTags, type Tag, type NewTag } from '../db/schema';
|
||||
import { Database } from '../db/connection';
|
||||
import { tags, fileTags } from '../db/schema';
|
||||
import type { Tag, NewTag } from '../db/schema';
|
||||
|
||||
@Injectable()
|
||||
export class TagService {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { Controller, Get, Post, Delete, Param, Query, UseGuards } from '@nestjs/common';
|
||||
import { JwtAuthGuard, CurrentUser, type CurrentUserData } from '@manacore/shared-nestjs-auth';
|
||||
import { JwtAuthGuard, CurrentUser } from '@manacore/shared-nestjs-auth';
|
||||
import type { CurrentUserData } from '@manacore/shared-nestjs-auth';
|
||||
import { TrashService } from './trash.service';
|
||||
|
||||
@Controller('api/v1/trash')
|
||||
|
|
|
|||
|
|
@ -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 { files, folders, type File, type Folder } from '../db/schema';
|
||||
import { Database } from '../db/connection';
|
||||
import { files, folders } from '../db/schema';
|
||||
import type { File, Folder } from '../db/schema';
|
||||
import { StorageService } from '../storage/storage.service';
|
||||
|
||||
@Injectable()
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
const MANA_AUTH_URL = 'http://localhost:3001';
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
* Files Store - Manages files and folders state
|
||||
*/
|
||||
|
||||
import { filesApi, foldersApi, type StorageFile, type StorageFolder } from '$lib/api/client';
|
||||
import { filesApi, foldersApi } from '$lib/api/client';
|
||||
import type { StorageFile, StorageFolder } from '$lib/api/client';
|
||||
|
||||
let files = $state<StorageFile[]>([]);
|
||||
let folders = $state<StorageFolder[]>([]);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
import { goto } from '$app/navigation';
|
||||
import { onMount } from 'svelte';
|
||||
import { Heart, Grid, List } from 'lucide-svelte';
|
||||
import { searchApi, type StorageFile, type StorageFolder } from '$lib/api/client';
|
||||
import { searchApi } from '$lib/api/client';
|
||||
import type { StorageFile, StorageFolder } from '$lib/api/client';
|
||||
import { filesStore } from '$lib/stores/files.svelte';
|
||||
import { toast } from '$lib/stores/toast';
|
||||
import FileGrid from '$lib/components/files/FileGrid.svelte';
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
import { page } from '$app/stores';
|
||||
import { onMount } from 'svelte';
|
||||
import { Search, Grid, List } from 'lucide-svelte';
|
||||
import { searchApi, type StorageFile, type StorageFolder } from '$lib/api/client';
|
||||
import { searchApi } from '$lib/api/client';
|
||||
import type { StorageFile, StorageFolder } from '$lib/api/client';
|
||||
import { filesStore } from '$lib/stores/files.svelte';
|
||||
import FileGrid from '$lib/components/files/FileGrid.svelte';
|
||||
import FileList from '$lib/components/files/FileList.svelte';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import { Share2, Link, Copy, Trash2 } from 'lucide-svelte';
|
||||
import { sharesApi, type Share } from '$lib/api/client';
|
||||
import { sharesApi } from '$lib/api/client';
|
||||
import type { Share } from '$lib/api/client';
|
||||
import { toast } from '$lib/stores/toast';
|
||||
|
||||
let shares = $state<Share[]>([]);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<script lang="ts">
|
||||
import { Palette, Check } from 'lucide-svelte';
|
||||
import { theme } from '$lib/stores/theme.svelte';
|
||||
import { THEME_DEFINITIONS, THEME_VARIANTS, type ThemeVariant } from '@manacore/shared-theme';
|
||||
import { THEME_DEFINITIONS, THEME_VARIANTS } from '@manacore/shared-theme';
|
||||
import type { ThemeVariant } from '@manacore/shared-theme';
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import { Trash2, RotateCcw, AlertTriangle } from 'lucide-svelte';
|
||||
import { trashApi, type StorageFile, type StorageFolder } from '$lib/api/client';
|
||||
import { trashApi } from '$lib/api/client';
|
||||
import type { StorageFile, StorageFolder } from '$lib/api/client';
|
||||
import { toast } from '$lib/stores/toast';
|
||||
|
||||
let files = $state<StorageFile[]>([]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue