diff --git a/server/.prettierrc b/server/.prettierrc index a095d3a516..b0daf15ef7 100644 --- a/server/.prettierrc +++ b/server/.prettierrc @@ -3,5 +3,6 @@ "trailingComma": "all", "printWidth": 120, "semi": true, - "organizeImportsSkipDestructiveCodeActions": true + "organizeImportsSkipDestructiveCodeActions": true, + "plugins": ["prettier-plugin-organize-imports"] } diff --git a/server/src/domain/album/album-response.dto.ts b/server/src/domain/album/album-response.dto.ts index 78842b6cbf..9f0e134c74 100644 --- a/server/src/domain/album/album-response.dto.ts +++ b/server/src/domain/album/album-response.dto.ts @@ -1,7 +1,7 @@ import { AlbumEntity } from '@app/infra/entities'; import { ApiProperty } from '@nestjs/swagger'; import { AssetResponseDto, mapAsset } from '../asset'; -import { mapUser, UserResponseDto } from '../user'; +import { UserResponseDto, mapUser } from '../user'; export class AlbumResponseDto { id!: string; diff --git a/server/src/domain/album/dto/album-update.dto.ts b/server/src/domain/album/dto/album-update.dto.ts index a03f06e8d6..f574f2c23c 100644 --- a/server/src/domain/album/dto/album-update.dto.ts +++ b/server/src/domain/album/dto/album-update.dto.ts @@ -1,5 +1,5 @@ import { IsString } from 'class-validator'; -import { ValidateUUID, Optional } from '../../domain.util'; +import { Optional, ValidateUUID } from '../../domain.util'; export class UpdateAlbumDto { @Optional() diff --git a/server/src/domain/album/dto/album.dto.ts b/server/src/domain/album/dto/album.dto.ts index 1d69a03eb2..d1fc701a0e 100644 --- a/server/src/domain/album/dto/album.dto.ts +++ b/server/src/domain/album/dto/album.dto.ts @@ -1,6 +1,6 @@ import { Transform } from 'class-transformer'; import { IsBoolean } from 'class-validator'; -import { toBoolean, Optional } from '../../domain.util'; +import { Optional, toBoolean } from '../../domain.util'; export class AlbumInfoDto { @Optional() diff --git a/server/src/domain/album/dto/get-albums.dto.ts b/server/src/domain/album/dto/get-albums.dto.ts index c36428eb37..680bae5fc6 100644 --- a/server/src/domain/album/dto/get-albums.dto.ts +++ b/server/src/domain/album/dto/get-albums.dto.ts @@ -1,7 +1,7 @@ import { ApiProperty } from '@nestjs/swagger'; import { Transform } from 'class-transformer'; import { IsBoolean } from 'class-validator'; -import { toBoolean, ValidateUUID, Optional } from '../../domain.util'; +import { Optional, ValidateUUID, toBoolean } from '../../domain.util'; export class GetAlbumsDto { @Optional() diff --git a/server/src/domain/asset/asset.service.spec.ts b/server/src/domain/asset/asset.service.spec.ts index 9de81a4f07..cdb1f23e6b 100644 --- a/server/src/domain/asset/asset.service.spec.ts +++ b/server/src/domain/asset/asset.service.spec.ts @@ -1,9 +1,9 @@ import { AssetType } from '@app/infra/entities'; import { BadRequestException, UnauthorizedException } from '@nestjs/common'; import { + IAccessRepositoryMock, assetStub, authStub, - IAccessRepositoryMock, newAccessRepositoryMock, newAssetRepositoryMock, newCryptoRepositoryMock, diff --git a/server/src/domain/asset/asset.service.ts b/server/src/domain/asset/asset.service.ts index 8f681d9bdb..fcba677b45 100644 --- a/server/src/domain/asset/asset.service.ts +++ b/server/src/domain/asset/asset.service.ts @@ -9,7 +9,7 @@ import { ICryptoRepository } from '../crypto'; import { mimeTypes } from '../domain.constant'; import { HumanReadableSize, usePagination } from '../domain.util'; import { IJobRepository, JobName } from '../job'; -import { ImmichReadStream, IStorageRepository, StorageCore, StorageFolder } from '../storage'; +import { IStorageRepository, ImmichReadStream, StorageCore, StorageFolder } from '../storage'; import { IAssetRepository } from './asset.repository'; import { AssetBulkUpdateDto, @@ -21,17 +21,17 @@ import { DownloadInfoDto, DownloadResponseDto, MapMarkerDto, - mapStats, MemoryLaneDto, TimeBucketAssetDto, TimeBucketDto, + mapStats, } from './dto'; import { AssetResponseDto, - mapAsset, MapMarkerResponseDto, MemoryLaneResponseDto, TimeBucketResponseDto, + mapAsset, } from './response-dto'; export enum UploadFieldName { diff --git a/server/src/domain/asset/dto/asset-statistics.dto.ts b/server/src/domain/asset/dto/asset-statistics.dto.ts index 1ef18385d1..428799b37a 100644 --- a/server/src/domain/asset/dto/asset-statistics.dto.ts +++ b/server/src/domain/asset/dto/asset-statistics.dto.ts @@ -2,7 +2,7 @@ import { AssetType } from '@app/infra/entities'; import { ApiProperty } from '@nestjs/swagger'; import { Transform } from 'class-transformer'; import { IsBoolean } from 'class-validator'; -import { toBoolean, Optional } from '../../domain.util'; +import { Optional, toBoolean } from '../../domain.util'; import { AssetStats } from '../asset.repository'; export class AssetStatsDto { diff --git a/server/src/domain/asset/dto/asset.dto.ts b/server/src/domain/asset/dto/asset.dto.ts index 3609dcb6e2..7bab8ffb24 100644 --- a/server/src/domain/asset/dto/asset.dto.ts +++ b/server/src/domain/asset/dto/asset.dto.ts @@ -1,6 +1,6 @@ import { IsBoolean } from 'class-validator'; -import { BulkIdsDto } from '../response-dto'; import { Optional } from '../../domain.util'; +import { BulkIdsDto } from '../response-dto'; export class AssetBulkUpdateDto extends BulkIdsDto { @Optional() diff --git a/server/src/domain/asset/dto/map-marker.dto.ts b/server/src/domain/asset/dto/map-marker.dto.ts index 72aed2886a..a93287a166 100644 --- a/server/src/domain/asset/dto/map-marker.dto.ts +++ b/server/src/domain/asset/dto/map-marker.dto.ts @@ -1,7 +1,7 @@ import { ApiProperty } from '@nestjs/swagger'; import { Transform, Type } from 'class-transformer'; import { IsBoolean, IsDate } from 'class-validator'; -import { toBoolean, Optional } from '../../domain.util'; +import { Optional, toBoolean } from '../../domain.util'; export class MapMarkerDto { @ApiProperty() diff --git a/server/src/domain/asset/dto/time-bucket.dto.ts b/server/src/domain/asset/dto/time-bucket.dto.ts index a818fbb84c..7b1100d3ab 100644 --- a/server/src/domain/asset/dto/time-bucket.dto.ts +++ b/server/src/domain/asset/dto/time-bucket.dto.ts @@ -1,7 +1,7 @@ import { ApiProperty } from '@nestjs/swagger'; import { Transform } from 'class-transformer'; import { IsBoolean, IsEnum, IsNotEmpty, IsString } from 'class-validator'; -import { toBoolean, ValidateUUID, Optional } from '../../domain.util'; +import { Optional, ValidateUUID, toBoolean } from '../../domain.util'; import { TimeBucketSize } from '../asset.repository'; export class TimeBucketDto { diff --git a/server/src/domain/asset/response-dto/asset-response.dto.ts b/server/src/domain/asset/response-dto/asset-response.dto.ts index 1a018c233a..8079d9fd18 100644 --- a/server/src/domain/asset/response-dto/asset-response.dto.ts +++ b/server/src/domain/asset/response-dto/asset-response.dto.ts @@ -1,9 +1,9 @@ import { AssetEntity, AssetType } from '@app/infra/entities'; import { ApiProperty } from '@nestjs/swagger'; -import { mapFace, PersonResponseDto } from '../../person/person.dto'; -import { mapTag, TagResponseDto } from '../../tag'; +import { PersonResponseDto, mapFace } from '../../person/person.dto'; +import { TagResponseDto, mapTag } from '../../tag'; import { ExifResponseDto, mapExif } from './exif-response.dto'; -import { mapSmartInfo, SmartInfoResponseDto } from './smart-info-response.dto'; +import { SmartInfoResponseDto, mapSmartInfo } from './smart-info-response.dto'; export class AssetResponseDto { id!: string; diff --git a/server/src/domain/audit/audi.service.spec.ts b/server/src/domain/audit/audi.service.spec.ts index 32601caf07..8ca5cfed15 100644 --- a/server/src/domain/audit/audi.service.spec.ts +++ b/server/src/domain/audit/audi.service.spec.ts @@ -1,5 +1,5 @@ import { DatabaseAction, EntityType } from '@app/infra/entities'; -import { auditStub, authStub, IAccessRepositoryMock, newAccessRepositoryMock, newAuditRepositoryMock } from '@test'; +import { IAccessRepositoryMock, auditStub, authStub, newAccessRepositoryMock, newAuditRepositoryMock } from '@test'; import { IAuditRepository } from './audit.repository'; import { AuditService } from './audit.service'; diff --git a/server/src/domain/auth/auth.service.spec.ts b/server/src/domain/auth/auth.service.spec.ts index ab325bf230..e0fefabd28 100644 --- a/server/src/domain/auth/auth.service.spec.ts +++ b/server/src/domain/auth/auth.service.spec.ts @@ -16,7 +16,7 @@ import { userTokenStub, } from '@test'; import { IncomingHttpHeaders } from 'http'; -import { generators, Issuer } from 'openid-client'; +import { Issuer, generators } from 'openid-client'; import { Socket } from 'socket.io'; import { IKeyRepository } from '../api-key'; import { ICryptoRepository } from '../crypto/crypto.repository'; diff --git a/server/src/domain/auth/auth.service.ts b/server/src/domain/auth/auth.service.ts index bf7891ed0e..b1cfb1834b 100644 --- a/server/src/domain/auth/auth.service.ts +++ b/server/src/domain/auth/auth.service.ts @@ -10,7 +10,7 @@ import { import cookieParser from 'cookie'; import { IncomingHttpHeaders } from 'http'; import { DateTime } from 'luxon'; -import { ClientMetadata, custom, generators, Issuer, UserinfoResponse } from 'openid-client'; +import { ClientMetadata, Issuer, UserinfoResponse, custom, generators } from 'openid-client'; import { IKeyRepository } from '../api-key'; import { ICryptoRepository } from '../crypto/crypto.repository'; import { ISharedLinkRepository } from '../shared-link'; @@ -31,11 +31,11 @@ import { AuthDeviceResponseDto, LoginResponseDto, LogoutResponseDto, + OAuthAuthorizeResponseDto, + OAuthConfigResponseDto, mapAdminSignupResponse, mapLoginResponse, mapUserToken, - OAuthAuthorizeResponseDto, - OAuthConfigResponseDto, } from './response-dto'; import { IUserTokenRepository } from './user-token.repository'; diff --git a/server/src/domain/domain.util.ts b/server/src/domain/domain.util.ts index 8f5951e6b8..9b7ee75219 100644 --- a/server/src/domain/domain.util.ts +++ b/server/src/domain/domain.util.ts @@ -1,6 +1,6 @@ import { applyDecorators } from '@nestjs/common'; import { ApiProperty } from '@nestjs/swagger'; -import { IsArray, IsNotEmpty, IsOptional, IsString, IsUUID, ValidationOptions, ValidateIf } from 'class-validator'; +import { IsArray, IsNotEmpty, IsOptional, IsString, IsUUID, ValidateIf, ValidationOptions } from 'class-validator'; import { basename, extname } from 'node:path'; import sanitize from 'sanitize-filename'; diff --git a/server/src/domain/facial-recognition/facial-recognition.services.ts b/server/src/domain/facial-recognition/facial-recognition.services.ts index 471d21ba4f..60d3503928 100644 --- a/server/src/domain/facial-recognition/facial-recognition.services.ts +++ b/server/src/domain/facial-recognition/facial-recognition.services.ts @@ -2,7 +2,7 @@ import { Inject, Logger } from '@nestjs/common'; import { join } from 'path'; import { IAssetRepository, WithoutProperty } from '../asset'; import { usePagination } from '../domain.util'; -import { IBaseJob, IEntityJob, IFaceThumbnailJob, IJobRepository, JobName, JOBS_ASSET_PAGINATION_SIZE } from '../job'; +import { IBaseJob, IEntityJob, IFaceThumbnailJob, IJobRepository, JOBS_ASSET_PAGINATION_SIZE, JobName } from '../job'; import { CropOptions, FACE_THUMBNAIL_SIZE, IMediaRepository } from '../media'; import { IPersonRepository } from '../person/person.repository'; import { ISearchRepository } from '../search/search.repository'; diff --git a/server/src/domain/job/job.dto.ts b/server/src/domain/job/job.dto.ts index 588a09a393..9e44dfd9d3 100644 --- a/server/src/domain/job/job.dto.ts +++ b/server/src/domain/job/job.dto.ts @@ -1,7 +1,7 @@ import { ApiProperty } from '@nestjs/swagger'; import { IsBoolean, IsEnum, IsNotEmpty } from 'class-validator'; -import { JobCommand, QueueName } from './job.constants'; import { Optional } from '../domain.util'; +import { JobCommand, QueueName } from './job.constants'; export class JobIdParamDto { @IsNotEmpty() diff --git a/server/src/domain/media/media.service.ts b/server/src/domain/media/media.service.ts index a09b77cbc7..2d0c5755d3 100644 --- a/server/src/domain/media/media.service.ts +++ b/server/src/domain/media/media.service.ts @@ -3,7 +3,7 @@ import { Inject, Injectable, Logger, UnsupportedMediaTypeException } from '@nest import { join } from 'path'; import { IAssetRepository, WithoutProperty } from '../asset'; import { usePagination } from '../domain.util'; -import { IBaseJob, IEntityJob, IJobRepository, JobName, JOBS_ASSET_PAGINATION_SIZE } from '../job'; +import { IBaseJob, IEntityJob, IJobRepository, JOBS_ASSET_PAGINATION_SIZE, JobName } from '../job'; import { IStorageRepository, StorageCore, StorageFolder } from '../storage'; import { ISystemConfigRepository, SystemConfigFFmpegDto } from '../system-config'; import { SystemConfigCore } from '../system-config/system-config.core'; diff --git a/server/src/domain/metadata/metadata.service.spec.ts b/server/src/domain/metadata/metadata.service.spec.ts index 04fecbdfaa..0266e33473 100644 --- a/server/src/domain/metadata/metadata.service.spec.ts +++ b/server/src/domain/metadata/metadata.service.spec.ts @@ -1,6 +1,6 @@ import { assetStub, newAssetRepositoryMock, newJobRepositoryMock, newStorageRepositoryMock } from '@test'; import { constants } from 'fs/promises'; -import { IAssetRepository, WithoutProperty, WithProperty } from '../asset'; +import { IAssetRepository, WithProperty, WithoutProperty } from '../asset'; import { IJobRepository, JobName } from '../job'; import { IStorageRepository } from '../storage'; import { MetadataService } from './metadata.service'; diff --git a/server/src/domain/partner/partner.service.ts b/server/src/domain/partner/partner.service.ts index 3cf92d3e54..d7f75b5193 100644 --- a/server/src/domain/partner/partner.service.ts +++ b/server/src/domain/partner/partner.service.ts @@ -2,7 +2,7 @@ import { PartnerEntity } from '@app/infra/entities'; import { BadRequestException, Inject, Injectable } from '@nestjs/common'; import { IPartnerRepository, PartnerDirection, PartnerIds } from '.'; import { AuthUserDto } from '../auth'; -import { mapUser, UserResponseDto } from '../user'; +import { UserResponseDto, mapUser } from '../user'; @Injectable() export class PartnerService { diff --git a/server/src/domain/person/person.dto.ts b/server/src/domain/person/person.dto.ts index e90587a26d..ac62d13128 100644 --- a/server/src/domain/person/person.dto.ts +++ b/server/src/domain/person/person.dto.ts @@ -2,7 +2,7 @@ import { AssetFaceEntity, PersonEntity } from '@app/infra/entities'; import { ApiProperty } from '@nestjs/swagger'; import { Transform, Type } from 'class-transformer'; import { IsArray, IsBoolean, IsDate, IsNotEmpty, IsString, ValidateNested } from 'class-validator'; -import { Optional, toBoolean, ValidateUUID } from '../domain.util'; +import { Optional, ValidateUUID, toBoolean } from '../domain.util'; export class PersonUpdateDto { /** diff --git a/server/src/domain/person/person.service.ts b/server/src/domain/person/person.service.ts index 07a41400b3..69442a1110 100644 --- a/server/src/domain/person/person.service.ts +++ b/server/src/domain/person/person.service.ts @@ -3,15 +3,15 @@ import { AssetResponseDto, BulkIdErrorReason, BulkIdResponseDto, mapAsset } from import { AuthUserDto } from '../auth'; import { mimeTypes } from '../domain.constant'; import { IJobRepository, JobName } from '../job'; -import { ImmichReadStream, IStorageRepository } from '../storage'; +import { IStorageRepository, ImmichReadStream } from '../storage'; import { - mapPerson, MergePersonDto, PeopleResponseDto, PeopleUpdateDto, PersonResponseDto, PersonSearchDto, PersonUpdateDto, + mapPerson, } from './person.dto'; import { IPersonRepository, UpdateFacesData } from './person.repository'; diff --git a/server/src/domain/search/dto/search.dto.ts b/server/src/domain/search/dto/search.dto.ts index 05d6909ef8..44d54f7a71 100644 --- a/server/src/domain/search/dto/search.dto.ts +++ b/server/src/domain/search/dto/search.dto.ts @@ -1,7 +1,7 @@ import { AssetType } from '@app/infra/entities'; import { Transform } from 'class-transformer'; import { IsArray, IsBoolean, IsEnum, IsNotEmpty, IsString } from 'class-validator'; -import { toBoolean, Optional } from '../../domain.util'; +import { Optional, toBoolean } from '../../domain.util'; export class SearchDto { @IsString() diff --git a/server/src/domain/search/search.service.ts b/server/src/domain/search/search.service.ts index 8084b4f6b9..cc04016eba 100644 --- a/server/src/domain/search/search.service.ts +++ b/server/src/domain/search/search.service.ts @@ -7,7 +7,7 @@ import { IAssetRepository } from '../asset/asset.repository'; import { AuthUserDto } from '../auth'; import { usePagination } from '../domain.util'; import { AssetFaceId, IFaceRepository } from '../facial-recognition'; -import { IAssetFaceJob, IBulkEntityJob, IJobRepository, JobName, JOBS_ASSET_PAGINATION_SIZE } from '../job'; +import { IAssetFaceJob, IBulkEntityJob, IJobRepository, JOBS_ASSET_PAGINATION_SIZE, JobName } from '../job'; import { IMachineLearningRepository } from '../smart-info'; import { FeatureFlag, ISystemConfigRepository, SystemConfigCore } from '../system-config'; import { SearchDto } from './dto'; diff --git a/server/src/domain/shared-link/shared-link.dto.ts b/server/src/domain/shared-link/shared-link.dto.ts index a51d354baa..0ea5b70c64 100644 --- a/server/src/domain/shared-link/shared-link.dto.ts +++ b/server/src/domain/shared-link/shared-link.dto.ts @@ -2,7 +2,7 @@ import { SharedLinkType } from '@app/infra/entities'; import { ApiProperty } from '@nestjs/swagger'; import { Type } from 'class-transformer'; import { IsBoolean, IsDate, IsEnum, IsString } from 'class-validator'; -import { ValidateUUID, Optional } from '../domain.util'; +import { Optional, ValidateUUID } from '../domain.util'; export class SharedLinkCreateDto { @IsEnum(SharedLinkType) diff --git a/server/src/domain/shared-link/shared-link.service.spec.ts b/server/src/domain/shared-link/shared-link.service.spec.ts index b244c559b3..3be71f919d 100644 --- a/server/src/domain/shared-link/shared-link.service.spec.ts +++ b/server/src/domain/shared-link/shared-link.service.spec.ts @@ -1,9 +1,9 @@ import { BadRequestException, ForbiddenException } from '@nestjs/common'; import { + IAccessRepositoryMock, albumStub, assetStub, authStub, - IAccessRepositoryMock, newAccessRepositoryMock, newCryptoRepositoryMock, newSharedLinkRepositoryMock, diff --git a/server/src/domain/shared-link/shared-link.service.ts b/server/src/domain/shared-link/shared-link.service.ts index eeceb77953..cdfcf01ccc 100644 --- a/server/src/domain/shared-link/shared-link.service.ts +++ b/server/src/domain/shared-link/shared-link.service.ts @@ -4,7 +4,7 @@ import { AccessCore, IAccessRepository, Permission } from '../access'; import { AssetIdErrorReason, AssetIdsDto, AssetIdsResponseDto } from '../asset'; import { AuthUserDto } from '../auth'; import { ICryptoRepository } from '../crypto'; -import { mapSharedLink, mapSharedLinkWithNoExif, SharedLinkResponseDto } from './shared-link-response.dto'; +import { SharedLinkResponseDto, mapSharedLink, mapSharedLinkWithNoExif } from './shared-link-response.dto'; import { SharedLinkCreateDto, SharedLinkEditDto } from './shared-link.dto'; import { ISharedLinkRepository } from './shared-link.repository'; diff --git a/server/src/domain/smart-info/dto/model-config.dto.ts b/server/src/domain/smart-info/dto/model-config.dto.ts index 7df9d29773..1fc2ef5d8f 100644 --- a/server/src/domain/smart-info/dto/model-config.dto.ts +++ b/server/src/domain/smart-info/dto/model-config.dto.ts @@ -1,8 +1,8 @@ import { ApiProperty } from '@nestjs/swagger'; import { Type } from 'class-transformer'; import { IsBoolean, IsEnum, IsNotEmpty, IsNumber, IsString, Max, Min } from 'class-validator'; -import { CLIPMode, ModelType } from '../machine-learning.interface'; import { Optional } from '../../domain.util'; +import { CLIPMode, ModelType } from '../machine-learning.interface'; export class ModelConfig { @IsBoolean() diff --git a/server/src/domain/smart-info/smart-info.service.ts b/server/src/domain/smart-info/smart-info.service.ts index 319324b2a8..d057d20154 100644 --- a/server/src/domain/smart-info/smart-info.service.ts +++ b/server/src/domain/smart-info/smart-info.service.ts @@ -1,7 +1,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { IAssetRepository, WithoutProperty } from '../asset'; import { usePagination } from '../domain.util'; -import { IBaseJob, IEntityJob, IJobRepository, JobName, JOBS_ASSET_PAGINATION_SIZE } from '../job'; +import { IBaseJob, IEntityJob, IJobRepository, JOBS_ASSET_PAGINATION_SIZE, JobName } from '../job'; import { ISystemConfigRepository, SystemConfigCore } from '../system-config'; import { IMachineLearningRepository } from './machine-learning.interface'; import { ISmartInfoRepository } from './smart-info.repository'; diff --git a/server/src/domain/system-config/system-config.service.spec.ts b/server/src/domain/system-config/system-config.service.spec.ts index 6b9ef2d9d4..7e28d041c1 100644 --- a/server/src/domain/system-config/system-config.service.spec.ts +++ b/server/src/domain/system-config/system-config.service.spec.ts @@ -13,7 +13,7 @@ import { import { BadRequestException } from '@nestjs/common'; import { newJobRepositoryMock, newSystemConfigRepositoryMock } from '@test'; import { IJobRepository, JobName, QueueName } from '../job'; -import { defaults, SystemConfigValidator } from './system-config.core'; +import { SystemConfigValidator, defaults } from './system-config.core'; import { ISystemConfigRepository } from './system-config.repository'; import { SystemConfigService } from './system-config.service'; diff --git a/server/src/domain/system-config/system-config.service.ts b/server/src/domain/system-config/system-config.service.ts index dcc3728ba5..cf289b7f97 100644 --- a/server/src/domain/system-config/system-config.service.ts +++ b/server/src/domain/system-config/system-config.service.ts @@ -1,7 +1,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { ISystemConfigRepository } from '.'; import { IJobRepository, JobName } from '../job'; -import { mapConfig, SystemConfigDto } from './dto/system-config.dto'; +import { SystemConfigDto, mapConfig } from './dto/system-config.dto'; import { SystemConfigTemplateStorageOptionDto } from './response-dto/system-config-template-storage-option.dto'; import { supportedDayTokens, diff --git a/server/src/domain/tag/tag.service.ts b/server/src/domain/tag/tag.service.ts index 25075bd4e0..585fa4fa83 100644 --- a/server/src/domain/tag/tag.service.ts +++ b/server/src/domain/tag/tag.service.ts @@ -1,7 +1,7 @@ import { BadRequestException, Inject, Injectable } from '@nestjs/common'; import { AssetIdErrorReason, AssetIdsDto, AssetIdsResponseDto, AssetResponseDto, mapAsset } from '../asset'; import { AuthUserDto } from '../auth'; -import { mapTag, TagResponseDto } from './tag-response.dto'; +import { TagResponseDto, mapTag } from './tag-response.dto'; import { CreateTagDto, UpdateTagDto } from './tag.dto'; import { ITagRepository } from './tag.repository'; diff --git a/server/src/domain/user/dto/create-user.dto.ts b/server/src/domain/user/dto/create-user.dto.ts index 94294371d1..2a5f659efb 100644 --- a/server/src/domain/user/dto/create-user.dto.ts +++ b/server/src/domain/user/dto/create-user.dto.ts @@ -1,6 +1,6 @@ import { Transform } from 'class-transformer'; import { IsBoolean, IsEmail, IsNotEmpty, IsString } from 'class-validator'; -import { toEmail, toSanitized, Optional } from '../../domain.util'; +import { Optional, toEmail, toSanitized } from '../../domain.util'; export class CreateUserDto { @IsEmail({ require_tld: false }) diff --git a/server/src/domain/user/dto/update-user.dto.ts b/server/src/domain/user/dto/update-user.dto.ts index 46d89c6b7b..e993ae80ff 100644 --- a/server/src/domain/user/dto/update-user.dto.ts +++ b/server/src/domain/user/dto/update-user.dto.ts @@ -1,7 +1,7 @@ import { ApiProperty } from '@nestjs/swagger'; import { Transform } from 'class-transformer'; import { IsBoolean, IsEmail, IsNotEmpty, IsString, IsUUID } from 'class-validator'; -import { toEmail, toSanitized, Optional } from '../../domain.util'; +import { Optional, toEmail, toSanitized } from '../../domain.util'; export class UpdateUserDto { @Optional() diff --git a/server/src/domain/user/dto/user-count.dto.ts b/server/src/domain/user/dto/user-count.dto.ts index 8b4bd6eda2..c07fc2f20f 100644 --- a/server/src/domain/user/dto/user-count.dto.ts +++ b/server/src/domain/user/dto/user-count.dto.ts @@ -1,6 +1,6 @@ -import { Optional } from '../../domain.util'; import { Transform } from 'class-transformer'; import { IsBoolean } from 'class-validator'; +import { Optional } from '../../domain.util'; export class UserCountDto { @IsBoolean() diff --git a/server/src/domain/user/user.core.ts b/server/src/domain/user/user.core.ts index 39a72e670c..6d0054aa9e 100644 --- a/server/src/domain/user/user.core.ts +++ b/server/src/domain/user/user.core.ts @@ -6,7 +6,7 @@ import { Logger, NotFoundException, } from '@nestjs/common'; -import { constants, createReadStream, ReadStream } from 'fs'; +import { ReadStream, constants, createReadStream } from 'fs'; import fs from 'fs/promises'; import sanitize from 'sanitize-filename'; import { AuthUserDto } from '../auth'; diff --git a/server/src/domain/user/user.service.ts b/server/src/domain/user/user.service.ts index 2568db1859..1deab516fb 100644 --- a/server/src/domain/user/user.service.ts +++ b/server/src/domain/user/user.service.ts @@ -12,11 +12,11 @@ import { IStorageRepository } from '../storage/storage.repository'; import { CreateUserDto, UpdateUserDto, UserCountDto } from './dto'; import { CreateProfileImageResponseDto, + UserCountResponseDto, + UserResponseDto, mapCreateProfileImageResponse, mapUser, mapUserCountResponse, - UserCountResponseDto, - UserResponseDto, } from './response-dto'; import { UserCore } from './user.core'; import { IUserRepository } from './user.repository'; diff --git a/server/src/immich/api-v1/asset/asset.controller.ts b/server/src/immich/api-v1/asset/asset.controller.ts index 44973a7af3..5ce5ff8cbd 100644 --- a/server/src/immich/api-v1/asset/asset.controller.ts +++ b/server/src/immich/api-v1/asset/asset.controller.ts @@ -18,8 +18,8 @@ import { } from '@nestjs/common'; import { ApiBody, ApiConsumes, ApiHeader, ApiOkResponse, ApiTags } from '@nestjs/swagger'; import { Response as Res } from 'express'; -import { Authenticated, AuthUser, SharedLinkRoute } from '../../app.guard'; -import { FileUploadInterceptor, ImmichFile, mapToUploadFile, Route } from '../../app.interceptor'; +import { AuthUser, Authenticated, SharedLinkRoute } from '../../app.guard'; +import { FileUploadInterceptor, ImmichFile, Route, mapToUploadFile } from '../../app.interceptor'; import { UUIDParamDto } from '../../controllers/dto/uuid-param.dto'; import FileNotEmptyValidator from '../validation/file-not-empty-validator'; import { AssetService } from './asset.service'; diff --git a/server/src/immich/api-v1/asset/asset.service.spec.ts b/server/src/immich/api-v1/asset/asset.service.spec.ts index 3b8f9a1b9d..ef57cf6a9c 100644 --- a/server/src/immich/api-v1/asset/asset.service.spec.ts +++ b/server/src/immich/api-v1/asset/asset.service.spec.ts @@ -2,10 +2,10 @@ import { ICryptoRepository, IJobRepository, IStorageRepository, JobName } from ' import { AssetEntity, AssetType, ExifEntity } from '@app/infra/entities'; import { BadRequestException } from '@nestjs/common'; import { + IAccessRepositoryMock, assetStub, authStub, fileStub, - IAccessRepositoryMock, newAccessRepositoryMock, newCryptoRepositoryMock, newJobRepositoryMock, diff --git a/server/src/immich/app.guard.ts b/server/src/immich/app.guard.ts index feaf9aba03..66e0d0dd10 100644 --- a/server/src/immich/app.guard.ts +++ b/server/src/immich/app.guard.ts @@ -1,12 +1,12 @@ import { AuthService, AuthUserDto, IMMICH_API_KEY_NAME, LoginDetails } from '@app/domain'; import { - applyDecorators, CanActivate, - createParamDecorator, ExecutionContext, Injectable, Logger, SetMetadata, + applyDecorators, + createParamDecorator, } from '@nestjs/common'; import { Reflector } from '@nestjs/core'; import { ApiBearerAuth, ApiCookieAuth, ApiQuery, ApiSecurity } from '@nestjs/swagger'; diff --git a/server/src/immich/app.interceptor.ts b/server/src/immich/app.interceptor.ts index ffdbf3562e..67a09ca73b 100644 --- a/server/src/immich/app.interceptor.ts +++ b/server/src/immich/app.interceptor.ts @@ -5,7 +5,7 @@ import { Reflector } from '@nestjs/core'; import { transformException } from '@nestjs/platform-express/multer/multer/multer.utils'; import { createHash } from 'crypto'; import { NextFunction, RequestHandler } from 'express'; -import multer, { diskStorage, StorageEngine } from 'multer'; +import multer, { StorageEngine, diskStorage } from 'multer'; import { Observable } from 'rxjs'; import { AuthRequest } from './app.guard'; diff --git a/server/src/immich/app.module.ts b/server/src/immich/app.module.ts index 809732ba9c..e82de2bce1 100644 --- a/server/src/immich/app.module.ts +++ b/server/src/immich/app.module.ts @@ -12,8 +12,8 @@ import { AppGuard } from './app.guard'; import { FileUploadInterceptor } from './app.interceptor'; import { AppService } from './app.service'; import { - AlbumController, APIKeyController, + AlbumController, AppController, AssetController, AuditController, diff --git a/server/src/immich/app.utils.ts b/server/src/immich/app.utils.ts index 285854fbc0..61ee81c624 100644 --- a/server/src/immich/app.utils.ts +++ b/server/src/immich/app.utils.ts @@ -1,8 +1,8 @@ import { - ImmichReadStream, IMMICH_ACCESS_COOKIE, IMMICH_API_KEY_HEADER, IMMICH_API_KEY_NAME, + ImmichReadStream, SERVER_VERSION, } from '@app/domain'; import { INestApplication, StreamableFile } from '@nestjs/common'; diff --git a/server/src/immich/controllers/album.controller.ts b/server/src/immich/controllers/album.controller.ts index a12d047d64..7c2b399439 100644 --- a/server/src/immich/controllers/album.controller.ts +++ b/server/src/immich/controllers/album.controller.ts @@ -14,7 +14,7 @@ import { import { Body, Controller, Delete, Get, Param, Patch, Post, Put, Query } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; import { ParseMeUUIDPipe } from '../api-v1/validation/parse-me-uuid-pipe'; -import { Authenticated, AuthUser, SharedLinkRoute } from '../app.guard'; +import { AuthUser, Authenticated, SharedLinkRoute } from '../app.guard'; import { UseValidation } from '../app.utils'; import { UUIDParamDto } from './dto/uuid-param.dto'; diff --git a/server/src/immich/controllers/api-key.controller.ts b/server/src/immich/controllers/api-key.controller.ts index b5814769e5..dc995ddf77 100644 --- a/server/src/immich/controllers/api-key.controller.ts +++ b/server/src/immich/controllers/api-key.controller.ts @@ -8,7 +8,7 @@ import { } from '@app/domain'; import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; -import { Authenticated, AuthUser } from '../app.guard'; +import { AuthUser, Authenticated } from '../app.guard'; import { UseValidation } from '../app.utils'; import { UUIDParamDto } from './dto/uuid-param.dto'; diff --git a/server/src/immich/controllers/asset.controller.ts b/server/src/immich/controllers/asset.controller.ts index 7a69c34e85..258b485eff 100644 --- a/server/src/immich/controllers/asset.controller.ts +++ b/server/src/immich/controllers/asset.controller.ts @@ -19,8 +19,8 @@ import { } from '@app/domain'; import { Body, Controller, Get, HttpCode, HttpStatus, Param, Post, Put, Query, StreamableFile } from '@nestjs/common'; import { ApiOkResponse, ApiTags } from '@nestjs/swagger'; -import { Authenticated, AuthUser, SharedLinkRoute } from '../app.guard'; -import { asStreamableFile, UseValidation } from '../app.utils'; +import { AuthUser, Authenticated, SharedLinkRoute } from '../app.guard'; +import { UseValidation, asStreamableFile } from '../app.utils'; import { UUIDParamDto } from './dto/uuid-param.dto'; @ApiTags('Asset') diff --git a/server/src/immich/controllers/audit.controller.ts b/server/src/immich/controllers/audit.controller.ts index 8b28f6e9f3..bb720323fd 100644 --- a/server/src/immich/controllers/audit.controller.ts +++ b/server/src/immich/controllers/audit.controller.ts @@ -1,7 +1,7 @@ import { AuditDeletesDto, AuditDeletesResponseDto, AuditService, AuthUserDto } from '@app/domain'; import { Controller, Get, Query } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; -import { Authenticated, AuthUser } from '../app.guard'; +import { AuthUser, Authenticated } from '../app.guard'; import { UseValidation } from '../app.utils'; @ApiTags('Audit') diff --git a/server/src/immich/controllers/auth.controller.ts b/server/src/immich/controllers/auth.controller.ts index e885aab7ca..2124cc8b80 100644 --- a/server/src/immich/controllers/auth.controller.ts +++ b/server/src/immich/controllers/auth.controller.ts @@ -17,7 +17,7 @@ import { import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Req, Res } from '@nestjs/common'; import { ApiBadRequestResponse, ApiTags } from '@nestjs/swagger'; import { Request, Response } from 'express'; -import { Authenticated, AuthUser, GetLoginDetails, PublicRoute } from '../app.guard'; +import { AuthUser, Authenticated, GetLoginDetails, PublicRoute } from '../app.guard'; import { UseValidation } from '../app.utils'; import { UUIDParamDto } from './dto/uuid-param.dto'; diff --git a/server/src/immich/controllers/oauth.controller.ts b/server/src/immich/controllers/oauth.controller.ts index eec8627199..176ce62bc6 100644 --- a/server/src/immich/controllers/oauth.controller.ts +++ b/server/src/immich/controllers/oauth.controller.ts @@ -12,7 +12,7 @@ import { import { Body, Controller, Get, HttpStatus, Post, Redirect, Req, Res } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; import { Request, Response } from 'express'; -import { Authenticated, AuthUser, GetLoginDetails, PublicRoute } from '../app.guard'; +import { AuthUser, Authenticated, GetLoginDetails, PublicRoute } from '../app.guard'; import { UseValidation } from '../app.utils'; @ApiTags('OAuth') diff --git a/server/src/immich/controllers/partner.controller.ts b/server/src/immich/controllers/partner.controller.ts index 21fa0deba9..0ecec54cd5 100644 --- a/server/src/immich/controllers/partner.controller.ts +++ b/server/src/immich/controllers/partner.controller.ts @@ -1,7 +1,7 @@ import { AuthUserDto, PartnerDirection, PartnerService, UserResponseDto } from '@app/domain'; import { Controller, Delete, Get, Param, Post, Query } from '@nestjs/common'; import { ApiQuery, ApiTags } from '@nestjs/swagger'; -import { Authenticated, AuthUser } from '../app.guard'; +import { AuthUser, Authenticated } from '../app.guard'; import { UseValidation } from '../app.utils'; import { UUIDParamDto } from './dto/uuid-param.dto'; diff --git a/server/src/immich/controllers/person.controller.ts b/server/src/immich/controllers/person.controller.ts index d0dcd84413..db4d378f31 100644 --- a/server/src/immich/controllers/person.controller.ts +++ b/server/src/immich/controllers/person.controller.ts @@ -13,7 +13,7 @@ import { } from '@app/domain'; import { Body, Controller, Get, Param, Post, Put, Query, StreamableFile } from '@nestjs/common'; import { ApiOkResponse, ApiTags } from '@nestjs/swagger'; -import { Authenticated, AuthUser } from '../app.guard'; +import { AuthUser, Authenticated } from '../app.guard'; import { UseValidation } from '../app.utils'; import { UUIDParamDto } from './dto/uuid-param.dto'; diff --git a/server/src/immich/controllers/search.controller.ts b/server/src/immich/controllers/search.controller.ts index a36d1b3053..9351669251 100644 --- a/server/src/immich/controllers/search.controller.ts +++ b/server/src/immich/controllers/search.controller.ts @@ -1,7 +1,7 @@ import { AuthUserDto, SearchDto, SearchExploreResponseDto, SearchResponseDto, SearchService } from '@app/domain'; import { Controller, Get, Query } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; -import { Authenticated, AuthUser } from '../app.guard'; +import { AuthUser, Authenticated } from '../app.guard'; import { UseValidation } from '../app.utils'; @ApiTags('Search') diff --git a/server/src/immich/controllers/shared-link.controller.ts b/server/src/immich/controllers/shared-link.controller.ts index 68a4a1b786..afd8c81ea3 100644 --- a/server/src/immich/controllers/shared-link.controller.ts +++ b/server/src/immich/controllers/shared-link.controller.ts @@ -9,7 +9,7 @@ import { } from '@app/domain'; import { Body, Controller, Delete, Get, Param, Patch, Post, Put } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; -import { Authenticated, AuthUser, SharedLinkRoute } from '../app.guard'; +import { AuthUser, Authenticated, SharedLinkRoute } from '../app.guard'; import { UseValidation } from '../app.utils'; import { UUIDParamDto } from './dto/uuid-param.dto'; diff --git a/server/src/immich/controllers/tag.controller.ts b/server/src/immich/controllers/tag.controller.ts index d949a42745..8558601315 100644 --- a/server/src/immich/controllers/tag.controller.ts +++ b/server/src/immich/controllers/tag.controller.ts @@ -10,7 +10,7 @@ import { } from '@app/domain'; import { Body, Controller, Delete, Get, Param, Patch, Post, Put } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; -import { Authenticated, AuthUser } from '../app.guard'; +import { AuthUser, Authenticated } from '../app.guard'; import { UseValidation } from '../app.utils'; import { UUIDParamDto } from './dto/uuid-param.dto'; diff --git a/server/src/immich/controllers/user.controller.ts b/server/src/immich/controllers/user.controller.ts index 7816e61987..925fcf2e2f 100644 --- a/server/src/immich/controllers/user.controller.ts +++ b/server/src/immich/controllers/user.controller.ts @@ -1,10 +1,10 @@ import { AuthUserDto, + UserCountDto as CountDto, + CreateUserDto as CreateDto, CreateProfileImageDto, CreateProfileImageResponseDto, - CreateUserDto as CreateDto, UpdateUserDto as UpdateDto, - UserCountDto as CountDto, UserCountResponseDto, UserResponseDto, UserService, @@ -26,7 +26,7 @@ import { } from '@nestjs/common'; import { ApiBody, ApiConsumes, ApiTags } from '@nestjs/swagger'; import { Response as Res } from 'express'; -import { AdminRoute, Authenticated, AuthUser, PublicRoute } from '../app.guard'; +import { AdminRoute, AuthUser, Authenticated, PublicRoute } from '../app.guard'; import { FileUploadInterceptor, Route } from '../app.interceptor'; import { UseValidation } from '../app.utils'; import { UUIDParamDto } from './dto/uuid-param.dto'; diff --git a/server/test/e2e/auth.e2e-spec.ts b/server/test/e2e/auth.e2e-spec.ts index 04595a6055..d0b1388769 100644 --- a/server/test/e2e/auth.e2e-spec.ts +++ b/server/test/e2e/auth.e2e-spec.ts @@ -3,13 +3,13 @@ import { INestApplication } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import request from 'supertest'; import { + adminSignupStub, changePasswordStub, deviceStub, errorStub, loginResponseStub, loginStub, signupResponseStub, - adminSignupStub, uuidStub, } from '../fixtures'; import { api, db } from '../test-utils'; diff --git a/server/test/test-utils.ts b/server/test/test-utils.ts index 4137f2b81e..3028fa07a7 100644 --- a/server/test/test-utils.ts +++ b/server/test/test-utils.ts @@ -14,7 +14,7 @@ import { } from '@app/domain'; import { dataSource } from '@app/infra'; import request from 'supertest'; -import { loginResponseStub, loginStub, signupResponseStub, adminSignupStub } from './fixtures'; +import { adminSignupStub, loginResponseStub, loginStub, signupResponseStub } from './fixtures'; export const db = { reset: async () => {