1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-21 18:16:55 +02:00

chore(server): move services (#8133)

move services
This commit is contained in:
Daniel Dietzler 2024-03-21 00:07:30 +01:00 committed by GitHub
parent 6d9e7694b1
commit ef4a492cb1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
83 changed files with 104 additions and 100 deletions

View File

@ -27,4 +27,8 @@
"cSpell.words": [
"immich"
],
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.patterns": {
"*.ts": "${capture}.spec.ts,${capture}.mock.ts"
}
}

View File

@ -1,12 +1,12 @@
import { api } from 'e2e/client';
import fs from 'node:fs/promises';
import path from 'node:path';
import { LibraryService } from 'src/domain/library/library.service';
import { LoginResponseDto } from 'src/dtos/auth.dto';
import { LibraryResponseDto } from 'src/dtos/library.dto';
import { AssetType } from 'src/entities/asset.entity';
import { LibraryType } from 'src/entities/library.entity';
import { StorageEventType } from 'src/interfaces/storage.repository';
import { LibraryService } from 'src/services/library.service';
import {
IMMICH_TEST_ASSET_PATH,
IMMICH_TEST_ASSET_TEMP_PATH,

View File

@ -3,15 +3,15 @@ import { Cron, CronExpression, Interval } from '@nestjs/schedule';
import { NextFunction, Request, Response } from 'express';
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import { AuthService } from 'src/domain/auth/auth.service';
import { DatabaseService } from 'src/domain/database/database.service';
import { ONE_HOUR, WEB_ROOT } from 'src/domain/domain.constant';
import { JobService } from 'src/domain/job/job.service';
import { ServerInfoService } from 'src/domain/server-info/server-info.service';
import { SharedLinkService } from 'src/domain/shared-link/shared-link.service';
import { StorageService } from 'src/domain/storage/storage.service';
import { SystemConfigService } from 'src/domain/system-config/system-config.service';
import { ImmichLogger } from 'src/infra/logger';
import { AuthService } from 'src/services/auth.service';
import { DatabaseService } from 'src/services/database.service';
import { JobService } from 'src/services/job.service';
import { ServerInfoService } from 'src/services/server-info.service';
import { SharedLinkService } from 'src/services/shared-link.service';
import { StorageService } from 'src/services/storage.service';
import { SystemConfigService } from 'src/services/system-config.service';
import { OpenGraphTags } from 'src/utils';
const render = (index: string, meta: OpenGraphTags) => {

View File

@ -6,30 +6,6 @@ import { ScheduleModule, SchedulerRegistry } from '@nestjs/schedule';
import { TypeOrmModule } from '@nestjs/typeorm';
import { OpenTelemetryModule } from 'nestjs-otel';
import { bullConfig, bullQueues, immichAppConfig } from 'src/config';
import { ActivityService } from 'src/domain/activity/activity.service';
import { AlbumService } from 'src/domain/album/album.service';
import { APIKeyService } from 'src/domain/api-key/api-key.service';
import { AssetService } from 'src/domain/asset/asset.service';
import { AuditService } from 'src/domain/audit/audit.service';
import { AuthService } from 'src/domain/auth/auth.service';
import { DatabaseService } from 'src/domain/database/database.service';
import { DownloadService } from 'src/domain/download/download.service';
import { JobService } from 'src/domain/job/job.service';
import { LibraryService } from 'src/domain/library/library.service';
import { MediaService } from 'src/domain/media/media.service';
import { MetadataService } from 'src/domain/metadata/metadata.service';
import { PartnerService } from 'src/domain/partner/partner.service';
import { PersonService } from 'src/domain/person/person.service';
import { SearchService } from 'src/domain/search/search.service';
import { ServerInfoService } from 'src/domain/server-info/server-info.service';
import { SharedLinkService } from 'src/domain/shared-link/shared-link.service';
import { SmartInfoService } from 'src/domain/smart-info/smart-info.service';
import { StorageTemplateService } from 'src/domain/storage-template/storage-template.service';
import { StorageService } from 'src/domain/storage/storage.service';
import { SystemConfigService } from 'src/domain/system-config/system-config.service';
import { TagService } from 'src/domain/tag/tag.service';
import { TrashService } from 'src/domain/trash/trash.service';
import { UserService } from 'src/domain/user/user.service';
import { databaseEntities } from 'src/entities';
import { databaseConfig } from 'src/infra/database.config';
import { otelConfig } from 'src/infra/instrumentation';
@ -88,6 +64,30 @@ import { SystemMetadataRepository } from 'src/repositories/system-metadata.repos
import { TagRepository } from 'src/repositories/tag.repository';
import { UserTokenRepository } from 'src/repositories/user-token.repository';
import { UserRepository } from 'src/repositories/user.repository';
import { ActivityService } from 'src/services/activity.service';
import { AlbumService } from 'src/services/album.service';
import { APIKeyService } from 'src/services/api-key.service';
import { AssetService } from 'src/services/asset.service';
import { AuditService } from 'src/services/audit.service';
import { AuthService } from 'src/services/auth.service';
import { DatabaseService } from 'src/services/database.service';
import { DownloadService } from 'src/services/download.service';
import { JobService } from 'src/services/job.service';
import { LibraryService } from 'src/services/library.service';
import { MediaService } from 'src/services/media.service';
import { MetadataService } from 'src/services/metadata.service';
import { PartnerService } from 'src/services/partner.service';
import { PersonService } from 'src/services/person.service';
import { SearchService } from 'src/services/search.service';
import { ServerInfoService } from 'src/services/server-info.service';
import { SharedLinkService } from 'src/services/shared-link.service';
import { SmartInfoService } from 'src/services/smart-info.service';
import { StorageTemplateService } from 'src/services/storage-template.service';
import { StorageService } from 'src/services/storage.service';
import { SystemConfigService } from 'src/services/system-config.service';
import { TagService } from 'src/services/tag.service';
import { TrashService } from 'src/services/trash.service';
import { UserService } from 'src/services/user.service';
const services: Provider[] = [
APIKeyService,

View File

@ -1,20 +1,20 @@
import { Injectable } from '@nestjs/common';
import { AssetService } from 'src/domain/asset/asset.service';
import { AuditService } from 'src/domain/audit/audit.service';
import { DatabaseService } from 'src/domain/database/database.service';
import { JobName } from 'src/domain/job/job.constants';
import { IDeleteFilesJob } from 'src/domain/job/job.interface';
import { JobService } from 'src/domain/job/job.service';
import { LibraryService } from 'src/domain/library/library.service';
import { MediaService } from 'src/domain/media/media.service';
import { MetadataService } from 'src/domain/metadata/metadata.service';
import { PersonService } from 'src/domain/person/person.service';
import { SmartInfoService } from 'src/domain/smart-info/smart-info.service';
import { StorageTemplateService } from 'src/domain/storage-template/storage-template.service';
import { StorageService } from 'src/domain/storage/storage.service';
import { SystemConfigService } from 'src/domain/system-config/system-config.service';
import { UserService } from 'src/domain/user/user.service';
import { otelSDK } from 'src/infra/instrumentation';
import { AssetService } from 'src/services/asset.service';
import { AuditService } from 'src/services/audit.service';
import { DatabaseService } from 'src/services/database.service';
import { JobService } from 'src/services/job.service';
import { LibraryService } from 'src/services/library.service';
import { MediaService } from 'src/services/media.service';
import { MetadataService } from 'src/services/metadata.service';
import { PersonService } from 'src/services/person.service';
import { SmartInfoService } from 'src/services/smart-info.service';
import { StorageTemplateService } from 'src/services/storage-template.service';
import { StorageService } from 'src/services/storage.service';
import { SystemConfigService } from 'src/services/system-config.service';
import { UserService } from 'src/services/user.service';
@Injectable()
export class MicroservicesService {

View File

@ -1,6 +1,6 @@
import { Command, CommandRunner } from 'nest-commander';
import { UserService } from 'src/domain/user/user.service';
import { UserEntity } from 'src/entities/user.entity';
import { UserService } from 'src/services/user.service';
@Command({
name: 'list-users',

View File

@ -1,5 +1,5 @@
import { Command, CommandRunner } from 'nest-commander';
import { SystemConfigService } from 'src/domain/system-config/system-config.service';
import { SystemConfigService } from 'src/services/system-config.service';
@Command({
name: 'enable-oauth-login',

View File

@ -1,5 +1,5 @@
import { Command, CommandRunner } from 'nest-commander';
import { SystemConfigService } from 'src/domain/system-config/system-config.service';
import { SystemConfigService } from 'src/services/system-config.service';
@Command({
name: 'enable-password-login',

View File

@ -1,6 +1,6 @@
import { Command, CommandRunner, InquirerService, Question, QuestionSet } from 'nest-commander';
import { UserService } from 'src/domain/user/user.service';
import { UserResponseDto } from 'src/dtos/user.dto';
import { UserService } from 'src/services/user.service';
@Command({
name: 'reset-admin-password',

View File

@ -1,7 +1,6 @@
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Query, Res } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { Response } from 'express';
import { ActivityService } from 'src/domain/activity/activity.service';
import {
ActivityCreateDto,
ActivityDto,
@ -11,6 +10,7 @@ import {
} from 'src/dtos/activity.dto';
import { AuthDto } from 'src/dtos/auth.dto';
import { Auth, Authenticated } from 'src/middleware/auth.guard';
import { ActivityService } from 'src/services/activity.service';
import { UUIDParamDto } from 'src/validation';
@ApiTags('Activity')

View File

@ -1,6 +1,5 @@
import { Body, Controller, Delete, Get, Param, Patch, Post, Put, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { AlbumService } from 'src/domain/album/album.service';
import {
AddUsersDto,
AlbumCountResponseDto,
@ -13,6 +12,7 @@ import {
import { BulkIdResponseDto, BulkIdsDto } from 'src/dtos/asset-ids.response.dto';
import { AuthDto } from 'src/dtos/auth.dto';
import { Auth, Authenticated, SharedLinkRoute } from 'src/middleware/auth.guard';
import { AlbumService } from 'src/services/album.service';
import { ParseMeUUIDPipe, UUIDParamDto } from 'src/validation';
@ApiTags('Album')

View File

@ -1,9 +1,9 @@
import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { APIKeyService } from 'src/domain/api-key/api-key.service';
import { APIKeyCreateDto, APIKeyCreateResponseDto, APIKeyResponseDto, APIKeyUpdateDto } from 'src/dtos/api-key.dto';
import { AuthDto } from 'src/dtos/auth.dto';
import { Auth, Authenticated } from 'src/middleware/auth.guard';
import { APIKeyService } from 'src/services/api-key.service';
import { UUIDParamDto } from 'src/validation';
@ApiTags('API Key')

View File

@ -1,7 +1,7 @@
import { Controller, Get, Header } from '@nestjs/common';
import { ApiExcludeEndpoint } from '@nestjs/swagger';
import { SystemConfigService } from 'src/domain/system-config/system-config.service';
import { PublicRoute } from 'src/middleware/auth.guard';
import { SystemConfigService } from 'src/services/system-config.service';
@Controller()
export class AppController {

View File

@ -1,7 +1,5 @@
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Put, Query } from '@nestjs/common';
import { ApiOperation, ApiTags } from '@nestjs/swagger';
import { AssetService } from 'src/domain/asset/asset.service';
import { SearchService } from 'src/domain/search/search.service';
import { AssetResponseDto, MemoryLaneResponseDto } from 'src/dtos/asset-response.dto';
import {
AssetBulkDeleteDto,
@ -19,6 +17,8 @@ import { UpdateStackParentDto } from 'src/dtos/stack.dto';
import { TimeBucketAssetDto, TimeBucketDto, TimeBucketResponseDto } from 'src/dtos/time-bucket.dto';
import { Auth, Authenticated, SharedLinkRoute } from 'src/middleware/auth.guard';
import { Route } from 'src/middleware/file-upload.interceptor';
import { AssetService } from 'src/services/asset.service';
import { SearchService } from 'src/services/search.service';
import { UUIDParamDto } from 'src/validation';
@ApiTags('Asset')

View File

@ -1,6 +1,5 @@
import { Body, Controller, Get, Post, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { AuditService } from 'src/domain/audit/audit.service';
import {
AuditDeletesDto,
AuditDeletesResponseDto,
@ -11,6 +10,7 @@ import {
} from 'src/dtos/audit.dto';
import { AuthDto } from 'src/dtos/auth.dto';
import { AdminRoute, Auth, Authenticated } from 'src/middleware/auth.guard';
import { AuditService } from 'src/services/audit.service';
@ApiTags('Audit')
@Controller('audit')

View File

@ -2,7 +2,6 @@ import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Req,
import { ApiTags } from '@nestjs/swagger';
import { Request, Response } from 'express';
import { IMMICH_ACCESS_COOKIE, IMMICH_AUTH_TYPE_COOKIE, IMMICH_IS_AUTHENTICATED } from 'src/domain/auth/auth.constant';
import { AuthService, LoginDetails } from 'src/domain/auth/auth.service';
import {
AuthDeviceResponseDto,
AuthDto,
@ -15,6 +14,7 @@ import {
} from 'src/dtos/auth.dto';
import { UserResponseDto, mapUser } from 'src/dtos/user.dto';
import { Auth, Authenticated, GetLoginDetails, PublicRoute } from 'src/middleware/auth.guard';
import { AuthService, LoginDetails } from 'src/services/auth.service';
import { UUIDParamDto } from 'src/validation';
@ApiTags('Authentication')

View File

@ -1,12 +1,12 @@
import { Body, Controller, HttpCode, HttpStatus, Next, Param, Post, Res, StreamableFile } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { NextFunction, Response } from 'express';
import { DownloadService } from 'src/domain/download/download.service';
import { AssetIdsDto } from 'src/dtos/asset.dto';
import { AuthDto } from 'src/dtos/auth.dto';
import { DownloadInfoDto, DownloadResponseDto } from 'src/dtos/download.dto';
import { asStreamableFile, sendFile } from 'src/immich/app.utils';
import { Auth, Authenticated, FileResponse, SharedLinkRoute } from 'src/middleware/auth.guard';
import { DownloadService } from 'src/services/download.service';
import { UUIDParamDto } from 'src/validation';
@ApiTags('Download')

View File

@ -1,9 +1,9 @@
import { Body, Controller, Get, Param, Put, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { PersonService } from 'src/domain/person/person.service';
import { AuthDto } from 'src/dtos/auth.dto';
import { AssetFaceResponseDto, FaceDto, PersonResponseDto } from 'src/dtos/person.dto';
import { Auth, Authenticated } from 'src/middleware/auth.guard';
import { PersonService } from 'src/services/person.service';
import { UUIDParamDto } from 'src/validation';
@ApiTags('Face')

View File

@ -1,8 +1,8 @@
import { Body, Controller, Get, Param, Put } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { JobService } from 'src/domain/job/job.service';
import { AllJobStatusResponseDto, JobCommandDto, JobIdParamDto, JobStatusDto } from 'src/dtos/job.dto';
import { Authenticated } from 'src/middleware/auth.guard';
import { JobService } from 'src/services/job.service';
@ApiTags('Job')
@Controller('jobs')

View File

@ -1,6 +1,5 @@
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Put, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { LibraryService } from 'src/domain/library/library.service';
import {
CreateLibraryDto,
LibraryResponseDto,
@ -12,6 +11,7 @@ import {
ValidateLibraryResponseDto,
} from 'src/dtos/library.dto';
import { AdminRoute, Authenticated } from 'src/middleware/auth.guard';
import { LibraryService } from 'src/services/library.service';
import { UUIDParamDto } from 'src/validation';
@ApiTags('Library')

View File

@ -1,7 +1,6 @@
import { Body, Controller, Get, HttpStatus, Post, Redirect, Req, Res } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { Request, Response } from 'express';
import { AuthService, LoginDetails } from 'src/domain/auth/auth.service';
import {
AuthDto,
LoginResponseDto,
@ -11,6 +10,7 @@ import {
} from 'src/dtos/auth.dto';
import { UserResponseDto } from 'src/dtos/user.dto';
import { Auth, Authenticated, GetLoginDetails, PublicRoute } from 'src/middleware/auth.guard';
import { AuthService, LoginDetails } from 'src/services/auth.service';
@ApiTags('OAuth')
@Controller('oauth')

View File

@ -1,10 +1,10 @@
import { Body, Controller, Delete, Get, Param, Post, Put, Query } from '@nestjs/common';
import { ApiQuery, ApiTags } from '@nestjs/swagger';
import { PartnerService } from 'src/domain/partner/partner.service';
import { AuthDto } from 'src/dtos/auth.dto';
import { PartnerResponseDto, UpdatePartnerDto } from 'src/dtos/partner.dto';
import { PartnerDirection } from 'src/interfaces/partner.repository';
import { Auth, Authenticated } from 'src/middleware/auth.guard';
import { PartnerService } from 'src/services/partner.service';
import { UUIDParamDto } from 'src/validation';
@ApiTags('Partner')

View File

@ -1,7 +1,6 @@
import { Body, Controller, Get, Next, Param, Post, Put, Query, Res } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { NextFunction, Response } from 'express';
import { PersonService } from 'src/domain/person/person.service';
import { BulkIdResponseDto } from 'src/dtos/asset-ids.response.dto';
import { AssetResponseDto } from 'src/dtos/asset-response.dto';
import { AuthDto } from 'src/dtos/auth.dto';
@ -18,6 +17,7 @@ import {
} from 'src/dtos/person.dto';
import { sendFile } from 'src/immich/app.utils';
import { Auth, Authenticated, FileResponse } from 'src/middleware/auth.guard';
import { PersonService } from 'src/services/person.service';
import { UUIDParamDto } from 'src/validation';
@ApiTags('Person')

View File

@ -1,6 +1,5 @@
import { Body, Controller, Get, HttpCode, HttpStatus, Post, Query } from '@nestjs/common';
import { ApiOperation, ApiTags } from '@nestjs/swagger';
import { SearchService } from 'src/domain/search/search.service';
import { AssetResponseDto } from 'src/dtos/asset-response.dto';
import { AuthDto } from 'src/dtos/auth.dto';
import { PersonResponseDto } from 'src/dtos/person.dto';
@ -16,6 +15,7 @@ import {
SmartSearchDto,
} from 'src/dtos/search.dto';
import { Auth, Authenticated } from 'src/middleware/auth.guard';
import { SearchService } from 'src/services/search.service';
@ApiTags('Search')
@Controller('search')

View File

@ -1,6 +1,5 @@
import { Controller, Get, HttpCode, HttpStatus, Post } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { ServerInfoService } from 'src/domain/server-info/server-info.service';
import {
ServerConfigDto,
ServerFeaturesDto,
@ -12,6 +11,7 @@ import {
ServerVersionResponseDto,
} from 'src/dtos/server-info.dto';
import { AdminRoute, Authenticated, PublicRoute } from 'src/middleware/auth.guard';
import { ServerInfoService } from 'src/services/server-info.service';
@ApiTags('Server Info')
@Controller('server-info')

View File

@ -2,7 +2,6 @@ import { Body, Controller, Delete, Get, Param, Patch, Post, Put, Query, Req, Res
import { ApiTags } from '@nestjs/swagger';
import { Request, Response } from 'express';
import { IMMICH_SHARED_LINK_ACCESS_COOKIE } from 'src/domain/auth/auth.constant';
import { SharedLinkService } from 'src/domain/shared-link/shared-link.service';
import { AssetIdsResponseDto } from 'src/dtos/asset-ids.response.dto';
import { AssetIdsDto } from 'src/dtos/asset.dto';
import { AuthDto } from 'src/dtos/auth.dto';
@ -13,6 +12,7 @@ import {
SharedLinkResponseDto,
} from 'src/dtos/shared-link.dto';
import { Auth, Authenticated, SharedLinkRoute } from 'src/middleware/auth.guard';
import { SharedLinkService } from 'src/services/shared-link.service';
import { UUIDParamDto } from 'src/validation';
@ApiTags('Shared Link')

View File

@ -1,10 +1,10 @@
import { Body, Controller, Get, Put, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { MapThemeDto } from 'src/domain/system-config/system-config-map-theme.dto';
import { SystemConfigService } from 'src/domain/system-config/system-config.service';
import { MapThemeDto } from 'src/dtos/system-config-map-theme.dto';
import { SystemConfigTemplateStorageOptionDto } from 'src/dtos/system-config-storage-template.dto';
import { SystemConfigDto } from 'src/dtos/system-config.dto';
import { AdminRoute, Authenticated } from 'src/middleware/auth.guard';
import { SystemConfigService } from 'src/services/system-config.service';
@ApiTags('System Config')
@Controller('system-config')

View File

@ -1,12 +1,12 @@
import { Body, Controller, Delete, Get, Param, Patch, Post, Put } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { TagService } from 'src/domain/tag/tag.service';
import { AssetIdsResponseDto } from 'src/dtos/asset-ids.response.dto';
import { AssetResponseDto } from 'src/dtos/asset-response.dto';
import { AssetIdsDto } from 'src/dtos/asset.dto';
import { AuthDto } from 'src/dtos/auth.dto';
import { CreateTagDto, TagResponseDto, UpdateTagDto } from 'src/dtos/tag.dto';
import { Auth, Authenticated } from 'src/middleware/auth.guard';
import { TagService } from 'src/services/tag.service';
import { UUIDParamDto } from 'src/validation';
@ApiTags('Tag')

View File

@ -1,9 +1,9 @@
import { Body, Controller, HttpCode, HttpStatus, Post } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { TrashService } from 'src/domain/trash/trash.service';
import { BulkIdsDto } from 'src/dtos/asset-ids.response.dto';
import { AuthDto } from 'src/dtos/auth.dto';
import { Auth, Authenticated } from 'src/middleware/auth.guard';
import { TrashService } from 'src/services/trash.service';
@ApiTags('Trash')
@Controller('trash')

View File

@ -16,13 +16,13 @@ import {
} from '@nestjs/common';
import { ApiBody, ApiConsumes, ApiTags } from '@nestjs/swagger';
import { NextFunction, Response } from 'express';
import { UserService } from 'src/domain/user/user.service';
import { AuthDto } from 'src/dtos/auth.dto';
import { CreateProfileImageDto, CreateProfileImageResponseDto } from 'src/dtos/user-profile.dto';
import { CreateUserDto, DeleteUserDto, UpdateUserDto, UserResponseDto } from 'src/dtos/user.dto';
import { sendFile } from 'src/immich/app.utils';
import { AdminRoute, Auth, Authenticated, FileResponse } from 'src/middleware/auth.guard';
import { FileUploadInterceptor, Route } from 'src/middleware/file-upload.interceptor';
import { UserService } from 'src/services/user.service';
import { UUIDParamDto } from 'src/validation';
@ApiTags('User')

View File

@ -6,7 +6,6 @@ import {
NotFoundException,
} from '@nestjs/common';
import { AccessCore, Permission } from 'src/cores/access.core';
import { UploadFile } from 'src/domain/asset/asset.service';
import { mimeTypes } from 'src/domain/domain.constant';
import { JobName } from 'src/domain/job/job.constants';
import { AssetResponseDto, mapAsset } from 'src/dtos/asset-response.dto';
@ -36,6 +35,7 @@ import { IJobRepository } from 'src/interfaces/job.repository';
import { ILibraryRepository } from 'src/interfaces/library.repository';
import { IStorageRepository } from 'src/interfaces/storage.repository';
import { IUserRepository } from 'src/interfaces/user.repository';
import { UploadFile } from 'src/services/asset.service';
import { CacheControl, ImmichFileResponse, getLivePhotoMotionFilename } from 'src/utils';
import { QueryFailedError } from 'typeorm';

View File

@ -10,9 +10,9 @@ import { Reflector } from '@nestjs/core';
import { ApiBearerAuth, ApiCookieAuth, ApiOkResponse, ApiQuery, ApiSecurity } from '@nestjs/swagger';
import { Request } from 'express';
import { IMMICH_API_KEY_NAME } from 'src/domain/auth/auth.constant';
import { AuthService, LoginDetails } from 'src/domain/auth/auth.service';
import { AuthDto } from 'src/dtos/auth.dto';
import { ImmichLogger } from 'src/infra/logger';
import { AuthService, LoginDetails } from 'src/services/auth.service';
import { UAParser } from 'ua-parser-js';
export enum Metadata {

View File

@ -6,10 +6,10 @@ import { NextFunction, RequestHandler } from 'express';
import multer, { StorageEngine, diskStorage } from 'multer';
import { createHash, randomUUID } from 'node:crypto';
import { Observable } from 'rxjs';
import { AssetService, UploadFile } from 'src/domain/asset/asset.service';
import { UploadFieldName } from 'src/dtos/asset.dto';
import { ImmichLogger } from 'src/infra/logger';
import { AuthRequest } from 'src/middleware/auth.guard';
import { AssetService, UploadFile } from 'src/services/asset.service';
export enum Route {
ASSET = 'asset',

View File

@ -7,7 +7,6 @@ import {
WebSocketServer,
} from '@nestjs/websockets';
import { Server, Socket } from 'socket.io';
import { AuthService } from 'src/domain/auth/auth.service';
import { Instrumentation } from 'src/infra/instrumentation';
import { ImmichLogger } from 'src/infra/logger';
import {
@ -18,6 +17,7 @@ import {
OnServerEventCallback,
ServerEvent,
} from 'src/interfaces/communication.repository';
import { AuthService } from 'src/services/auth.service';
@Instrumentation()
@WebSocketGateway({

View File

@ -1,7 +1,7 @@
import { BadRequestException } from '@nestjs/common';
import { ActivityService } from 'src/domain/activity/activity.service';
import { ReactionType } from 'src/dtos/activity.dto';
import { IActivityRepository } from 'src/interfaces/activity.repository';
import { ActivityService } from 'src/services/activity.service';
import { activityStub } from 'test/fixtures/activity.stub';
import { authStub } from 'test/fixtures/auth.stub';
import { IAccessRepositoryMock, newAccessRepositoryMock } from 'test/repositories/access.repository.mock';

View File

@ -1,10 +1,10 @@
import { BadRequestException } from '@nestjs/common';
import _ from 'lodash';
import { AlbumService } from 'src/domain/album/album.service';
import { BulkIdErrorReason } from 'src/dtos/asset-ids.response.dto';
import { IAlbumRepository } from 'src/interfaces/album.repository';
import { IAssetRepository } from 'src/interfaces/asset.repository';
import { IUserRepository } from 'src/interfaces/user.repository';
import { AlbumService } from 'src/services/album.service';
import { albumStub } from 'test/fixtures/album.stub';
import { authStub } from 'test/fixtures/auth.stub';
import { userStub } from 'test/fixtures/user.stub';

View File

@ -1,7 +1,7 @@
import { BadRequestException } from '@nestjs/common';
import { APIKeyService } from 'src/domain/api-key/api-key.service';
import { IKeyRepository } from 'src/interfaces/api-key.repository';
import { ICryptoRepository } from 'src/interfaces/crypto.repository';
import { APIKeyService } from 'src/services/api-key.service';
import { keyStub } from 'test/fixtures/api-key.stub';
import { authStub } from 'test/fixtures/auth.stub';
import { newKeyRepositoryMock } from 'test/repositories/api-key.repository.mock';

View File

@ -1,6 +1,5 @@
import { BadRequestException, UnauthorizedException } from '@nestjs/common';
import { when } from 'jest-when';
import { AssetService } from 'src/domain/asset/asset.service';
import { JobName } from 'src/domain/job/job.constants';
import { mapAsset } from 'src/dtos/asset-response.dto';
import { AssetJobName, AssetStatsResponseDto, UploadFieldName } from 'src/dtos/asset.dto';
@ -13,6 +12,7 @@ import { IPartnerRepository } from 'src/interfaces/partner.repository';
import { IStorageRepository } from 'src/interfaces/storage.repository';
import { ISystemConfigRepository } from 'src/interfaces/system-config.repository';
import { IUserRepository } from 'src/interfaces/user.repository';
import { AssetService } from 'src/services/asset.service';
import { assetStackStub, assetStub } from 'test/fixtures/asset.stub';
import { authStub } from 'test/fixtures/auth.stub';
import { faceStub } from 'test/fixtures/face.stub';

View File

@ -1,4 +1,3 @@
import { AuditService } from 'src/domain/audit/audit.service';
import { DatabaseAction, EntityType } from 'src/entities/audit.entity';
import { IAssetRepository } from 'src/interfaces/asset.repository';
import { IAuditRepository } from 'src/interfaces/audit.repository';
@ -7,6 +6,7 @@ import { JobStatus } from 'src/interfaces/job.repository';
import { IPersonRepository } from 'src/interfaces/person.repository';
import { IStorageRepository } from 'src/interfaces/storage.repository';
import { IUserRepository } from 'src/interfaces/user.repository';
import { AuditService } from 'src/services/audit.service';
import { auditStub } from 'test/fixtures/audit.stub';
import { authStub } from 'test/fixtures/auth.stub';
import { IAccessRepositoryMock, newAccessRepositoryMock } from 'test/repositories/access.repository.mock';

View File

@ -3,7 +3,6 @@ import { IncomingHttpHeaders } from 'node:http';
import { Issuer, generators } from 'openid-client';
import { Socket } from 'socket.io';
import { AuthType } from 'src/domain/auth/auth.constant';
import { AuthService } from 'src/domain/auth/auth.service';
import { AuthDto, SignUpDto } from 'src/dtos/auth.dto';
import { UserEntity } from 'src/entities/user.entity';
import { IKeyRepository } from 'src/interfaces/api-key.repository';
@ -13,6 +12,7 @@ import { ISharedLinkRepository } from 'src/interfaces/shared-link.repository';
import { ISystemConfigRepository } from 'src/interfaces/system-config.repository';
import { IUserTokenRepository } from 'src/interfaces/user-token.repository';
import { IUserRepository } from 'src/interfaces/user.repository';
import { AuthService } from 'src/services/auth.service';
import { keyStub } from 'test/fixtures/api-key.stub';
import { authStub, loginResponseStub } from 'test/fixtures/auth.stub';
import { sharedLinkStub } from 'test/fixtures/shared-link.stub';

View File

@ -1,7 +1,7 @@
import { DatabaseService } from 'src/domain/database/database.service';
import { Version, VersionType } from 'src/domain/domain.constant';
import { ImmichLogger } from 'src/infra/logger';
import { DatabaseExtension, IDatabaseRepository, VectorIndex } from 'src/interfaces/database.repository';
import { DatabaseService } from 'src/services/database.service';
import { newDatabaseRepositoryMock } from 'test/repositories/database.repository.mock';
describe(DatabaseService.name, () => {

View File

@ -1,9 +1,9 @@
import { BadRequestException } from '@nestjs/common';
import { when } from 'jest-when';
import { DownloadService } from 'src/domain/download/download.service';
import { DownloadResponseDto } from 'src/dtos/download.dto';
import { IAssetRepository } from 'src/interfaces/asset.repository';
import { IStorageRepository } from 'src/interfaces/storage.repository';
import { DownloadService } from 'src/services/download.service';
import { CacheControl, ImmichFileResponse } from 'src/utils';
import { assetStub } from 'test/fixtures/asset.stub';
import { authStub } from 'test/fixtures/auth.stub';

View File

@ -1,13 +1,13 @@
import { BadRequestException } from '@nestjs/common';
import { FeatureFlag, SystemConfigCore } from 'src/cores/system-config.core';
import { JobCommand, JobName, QueueName } from 'src/domain/job/job.constants';
import { JobService } from 'src/domain/job/job.service';
import { SystemConfig, SystemConfigKey } from 'src/entities/system-config.entity';
import { IAssetRepository } from 'src/interfaces/asset.repository';
import { ICommunicationRepository } from 'src/interfaces/communication.repository';
import { IJobRepository, JobHandler, JobItem, JobStatus } from 'src/interfaces/job.repository';
import { IPersonRepository } from 'src/interfaces/person.repository';
import { ISystemConfigRepository } from 'src/interfaces/system-config.repository';
import { JobService } from 'src/services/job.service';
import { assetStub } from 'test/fixtures/asset.stub';
import { newAssetRepositoryMock } from 'test/repositories/asset.repository.mock';
import { newCommunicationRepositoryMock } from 'test/repositories/communication.repository.mock';

View File

@ -5,7 +5,6 @@ import { Stats } from 'node:fs';
import { SystemConfigCore } from 'src/cores/system-config.core';
import { JobName } from 'src/domain/job/job.constants';
import { ILibraryFileJob, ILibraryRefreshJob } from 'src/domain/job/job.interface';
import { LibraryService } from 'src/domain/library/library.service';
import { mapLibrary } from 'src/dtos/library.dto';
import { AssetType } from 'src/entities/asset.entity';
import { LibraryType } from 'src/entities/library.entity';
@ -18,6 +17,7 @@ import { IJobRepository, JobStatus } from 'src/interfaces/job.repository';
import { ILibraryRepository } from 'src/interfaces/library.repository';
import { IStorageRepository, StorageEventType } from 'src/interfaces/storage.repository';
import { ISystemConfigRepository } from 'src/interfaces/system-config.repository';
import { LibraryService } from 'src/services/library.service';
import { assetStub } from 'test/fixtures/asset.stub';
import { authStub } from 'test/fixtures/auth.stub';
import { libraryStub } from 'test/fixtures/library.stub';

View File

@ -1,6 +1,5 @@
import { Stats } from 'node:fs';
import { JobName } from 'src/domain/job/job.constants';
import { MediaService } from 'src/domain/media/media.service';
import { AssetType } from 'src/entities/asset.entity';
import { ExifEntity } from 'src/entities/exif.entity';
import {
@ -20,6 +19,7 @@ import { IMoveRepository } from 'src/interfaces/move.repository';
import { IPersonRepository } from 'src/interfaces/person.repository';
import { IStorageRepository } from 'src/interfaces/storage.repository';
import { ISystemConfigRepository } from 'src/interfaces/system-config.repository';
import { MediaService } from 'src/services/media.service';
import { assetStub } from 'test/fixtures/asset.stub';
import { faceStub } from 'test/fixtures/face.stub';
import { probeStub } from 'test/fixtures/media.stub';

View File

@ -4,7 +4,6 @@ import { randomBytes } from 'node:crypto';
import { Stats } from 'node:fs';
import { constants } from 'node:fs/promises';
import { JobName } from 'src/domain/job/job.constants';
import { MetadataService, Orientation } from 'src/domain/metadata/metadata.service';
import { AssetType } from 'src/entities/asset.entity';
import { ExifEntity } from 'src/entities/exif.entity';
import { SystemConfigKey } from 'src/entities/system-config.entity';
@ -20,6 +19,7 @@ import { IMoveRepository } from 'src/interfaces/move.repository';
import { IPersonRepository } from 'src/interfaces/person.repository';
import { IStorageRepository } from 'src/interfaces/storage.repository';
import { ISystemConfigRepository } from 'src/interfaces/system-config.repository';
import { MetadataService, Orientation } from 'src/services/metadata.service';
import { assetStub } from 'test/fixtures/asset.stub';
import { fileStub } from 'test/fixtures/file.stub';
import { probeStub } from 'test/fixtures/media.stub';

View File

@ -1,9 +1,9 @@
import { BadRequestException } from '@nestjs/common';
import { PartnerService } from 'src/domain/partner/partner.service';
import { PartnerResponseDto } from 'src/dtos/partner.dto';
import { UserAvatarColor } from 'src/entities/user.entity';
import { IAccessRepository } from 'src/interfaces/access.repository';
import { IPartnerRepository, PartnerDirection } from 'src/interfaces/partner.repository';
import { PartnerService } from 'src/services/partner.service';
import { authStub } from 'test/fixtures/auth.stub';
import { partnerStub } from 'test/fixtures/partner.stub';
import { newPartnerRepositoryMock } from 'test/repositories/partner.repository.mock';

View File

@ -1,6 +1,5 @@
import { BadRequestException, NotFoundException } from '@nestjs/common';
import { JobName } from 'src/domain/job/job.constants';
import { PersonService } from 'src/domain/person/person.service';
import { BulkIdErrorReason } from 'src/dtos/asset-ids.response.dto';
import { PersonResponseDto, mapFaces, mapPerson } from 'src/dtos/person.dto';
import { AssetFaceEntity } from 'src/entities/asset-face.entity';
@ -15,6 +14,7 @@ import { IPersonRepository } from 'src/interfaces/person.repository';
import { FaceSearchResult, ISearchRepository } from 'src/interfaces/search.repository';
import { IStorageRepository } from 'src/interfaces/storage.repository';
import { ISystemConfigRepository } from 'src/interfaces/system-config.repository';
import { PersonService } from 'src/services/person.service';
import { CacheControl, ImmichFileResponse } from 'src/utils';
import { assetStub } from 'test/fixtures/asset.stub';
import { authStub } from 'test/fixtures/auth.stub';

View File

@ -1,4 +1,3 @@
import { SearchService } from 'src/domain/search/search.service';
import { mapAsset } from 'src/dtos/asset-response.dto';
import { SearchDto } from 'src/dtos/search.dto';
import { SystemConfigKey } from 'src/entities/system-config.entity';
@ -9,6 +8,7 @@ import { IPartnerRepository } from 'src/interfaces/partner.repository';
import { IPersonRepository } from 'src/interfaces/person.repository';
import { ISearchRepository } from 'src/interfaces/search.repository';
import { ISystemConfigRepository } from 'src/interfaces/system-config.repository';
import { SearchService } from 'src/services/search.service';
import { assetStub } from 'test/fixtures/asset.stub';
import { authStub } from 'test/fixtures/auth.stub';
import { personStub } from 'test/fixtures/person.stub';

View File

@ -1,5 +1,4 @@
import { serverVersion } from 'src/domain/domain.constant';
import { ServerInfoService } from 'src/domain/server-info/server-info.service';
import { SystemMetadataKey } from 'src/entities/system-metadata.entity';
import { ICommunicationRepository } from 'src/interfaces/communication.repository';
import { IServerInfoRepository } from 'src/interfaces/server-info.repository';
@ -7,6 +6,7 @@ import { IStorageRepository } from 'src/interfaces/storage.repository';
import { ISystemConfigRepository } from 'src/interfaces/system-config.repository';
import { ISystemMetadataRepository } from 'src/interfaces/system-metadata.repository';
import { IUserRepository } from 'src/interfaces/user.repository';
import { ServerInfoService } from 'src/services/server-info.service';
import { newCommunicationRepositoryMock } from 'test/repositories/communication.repository.mock';
import { newStorageRepositoryMock } from 'test/repositories/storage.repository.mock';
import { newSystemConfigRepositoryMock } from 'test/repositories/system-config.repository.mock';

View File

@ -1,10 +1,10 @@
import { BadRequestException, ForbiddenException, UnauthorizedException } from '@nestjs/common';
import _ from 'lodash';
import { SharedLinkService } from 'src/domain/shared-link/shared-link.service';
import { AssetIdErrorReason } from 'src/dtos/asset-ids.response.dto';
import { SharedLinkType } from 'src/entities/shared-link.entity';
import { ICryptoRepository } from 'src/interfaces/crypto.repository';
import { ISharedLinkRepository } from 'src/interfaces/shared-link.repository';
import { SharedLinkService } from 'src/services/shared-link.service';
import { albumStub } from 'test/fixtures/album.stub';
import { assetStub } from 'test/fixtures/asset.stub';
import { authStub } from 'test/fixtures/auth.stub';

View File

@ -1,6 +1,5 @@
import { JobName } from 'src/domain/job/job.constants';
import { cleanModelName, getCLIPModelInfo } from 'src/domain/smart-info/smart-info.constant';
import { SmartInfoService } from 'src/domain/smart-info/smart-info.service';
import { AssetEntity } from 'src/entities/asset.entity';
import { SystemConfigKey } from 'src/entities/system-config.entity';
import { IAssetRepository, WithoutProperty } from 'src/interfaces/asset.repository';
@ -9,6 +8,7 @@ import { IJobRepository } from 'src/interfaces/job.repository';
import { IMachineLearningRepository } from 'src/interfaces/machine-learning.repository';
import { ISearchRepository } from 'src/interfaces/search.repository';
import { ISystemConfigRepository } from 'src/interfaces/system-config.repository';
import { SmartInfoService } from 'src/services/smart-info.service';
import { assetStub } from 'test/fixtures/asset.stub';
import { newAssetRepositoryMock } from 'test/repositories/asset.repository.mock';
import { newDatabaseRepositoryMock } from 'test/repositories/database.repository.mock';

View File

@ -1,7 +1,6 @@
import { when } from 'jest-when';
import { Stats } from 'node:fs';
import { SystemConfigCore, defaults } from 'src/cores/system-config.core';
import { StorageTemplateService } from 'src/domain/storage-template/storage-template.service';
import { AssetPathType } from 'src/entities/move.entity';
import { SystemConfig, SystemConfigKey } from 'src/entities/system-config.entity';
import { IAlbumRepository } from 'src/interfaces/album.repository';
@ -14,6 +13,7 @@ import { IPersonRepository } from 'src/interfaces/person.repository';
import { IStorageRepository } from 'src/interfaces/storage.repository';
import { ISystemConfigRepository } from 'src/interfaces/system-config.repository';
import { IUserRepository } from 'src/interfaces/user.repository';
import { StorageTemplateService } from 'src/services/storage-template.service';
import { assetStub } from 'test/fixtures/asset.stub';
import { userStub } from 'test/fixtures/user.stub';
import { newAlbumRepositoryMock } from 'test/repositories/album.repository.mock';

View File

@ -1,5 +1,5 @@
import { StorageService } from 'src/domain/storage/storage.service';
import { IStorageRepository } from 'src/interfaces/storage.repository';
import { StorageService } from 'src/services/storage.service';
import { newStorageRepositoryMock } from 'test/repositories/storage.repository.mock';
describe(StorageService.name, () => {

View File

@ -1,7 +1,6 @@
import { BadRequestException } from '@nestjs/common';
import { defaults } from 'src/cores/system-config.core';
import { QueueName } from 'src/domain/job/job.constants';
import { SystemConfigService } from 'src/domain/system-config/system-config.service';
import {
AudioCodec,
CQMode,
@ -19,6 +18,7 @@ import { ImmichLogger } from 'src/infra/logger';
import { ICommunicationRepository, ServerEvent } from 'src/interfaces/communication.repository';
import { ISearchRepository } from 'src/interfaces/search.repository';
import { ISystemConfigRepository } from 'src/interfaces/system-config.repository';
import { SystemConfigService } from 'src/services/system-config.service';
import { newCommunicationRepositoryMock } from 'test/repositories/communication.repository.mock';
import { newSystemConfigRepositoryMock } from 'test/repositories/system-config.repository.mock';

View File

@ -1,9 +1,9 @@
import { BadRequestException } from '@nestjs/common';
import { when } from 'jest-when';
import { TagService } from 'src/domain/tag/tag.service';
import { AssetIdErrorReason } from 'src/dtos/asset-ids.response.dto';
import { TagType } from 'src/entities/tag.entity';
import { ITagRepository } from 'src/interfaces/tag.repository';
import { TagService } from 'src/services/tag.service';
import { assetStub } from 'test/fixtures/asset.stub';
import { authStub } from 'test/fixtures/auth.stub';
import { tagResponseStub, tagStub } from 'test/fixtures/tag.stub';

View File

@ -1,9 +1,9 @@
import { BadRequestException } from '@nestjs/common';
import { JobName } from 'src/domain/job/job.constants';
import { TrashService } from 'src/domain/trash/trash.service';
import { IAssetRepository } from 'src/interfaces/asset.repository';
import { ClientEvent, ICommunicationRepository } from 'src/interfaces/communication.repository';
import { IJobRepository } from 'src/interfaces/job.repository';
import { TrashService } from 'src/services/trash.service';
import { assetStub } from 'test/fixtures/asset.stub';
import { authStub } from 'test/fixtures/auth.stub';
import { IAccessRepositoryMock, newAccessRepositoryMock } from 'test/repositories/access.repository.mock';

View File

@ -6,7 +6,6 @@ import {
} from '@nestjs/common';
import { when } from 'jest-when';
import { JobName } from 'src/domain/job/job.constants';
import { UserService } from 'src/domain/user/user.service';
import { UpdateUserDto, mapUser } from 'src/dtos/user.dto';
import { UserEntity, UserStatus } from 'src/entities/user.entity';
import { IAlbumRepository } from 'src/interfaces/album.repository';
@ -16,6 +15,7 @@ import { ILibraryRepository } from 'src/interfaces/library.repository';
import { IStorageRepository } from 'src/interfaces/storage.repository';
import { ISystemConfigRepository } from 'src/interfaces/system-config.repository';
import { IUserRepository } from 'src/interfaces/user.repository';
import { UserService } from 'src/services/user.service';
import { CacheControl, ImmichFileResponse } from 'src/utils';
import { authStub } from 'test/fixtures/auth.stub';
import { systemConfigStub } from 'test/fixtures/system-config.stub';