1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-28 06:31:58 +00:00

fix(server): lint import order (#3974)

* fix: use prettier extension

* chore: format fix
This commit is contained in:
Jason Rasmussen 2023-09-04 15:45:59 -04:00 committed by GitHub
parent 2069293cc1
commit 816d040d81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
58 changed files with 72 additions and 71 deletions

View file

@ -3,5 +3,6 @@
"trailingComma": "all", "trailingComma": "all",
"printWidth": 120, "printWidth": 120,
"semi": true, "semi": true,
"organizeImportsSkipDestructiveCodeActions": true "organizeImportsSkipDestructiveCodeActions": true,
"plugins": ["prettier-plugin-organize-imports"]
} }

View file

@ -1,7 +1,7 @@
import { AlbumEntity } from '@app/infra/entities'; import { AlbumEntity } from '@app/infra/entities';
import { ApiProperty } from '@nestjs/swagger'; import { ApiProperty } from '@nestjs/swagger';
import { AssetResponseDto, mapAsset } from '../asset'; import { AssetResponseDto, mapAsset } from '../asset';
import { mapUser, UserResponseDto } from '../user'; import { UserResponseDto, mapUser } from '../user';
export class AlbumResponseDto { export class AlbumResponseDto {
id!: string; id!: string;

View file

@ -1,5 +1,5 @@
import { IsString } from 'class-validator'; import { IsString } from 'class-validator';
import { ValidateUUID, Optional } from '../../domain.util'; import { Optional, ValidateUUID } from '../../domain.util';
export class UpdateAlbumDto { export class UpdateAlbumDto {
@Optional() @Optional()

View file

@ -1,6 +1,6 @@
import { Transform } from 'class-transformer'; import { Transform } from 'class-transformer';
import { IsBoolean } from 'class-validator'; import { IsBoolean } from 'class-validator';
import { toBoolean, Optional } from '../../domain.util'; import { Optional, toBoolean } from '../../domain.util';
export class AlbumInfoDto { export class AlbumInfoDto {
@Optional() @Optional()

View file

@ -1,7 +1,7 @@
import { ApiProperty } from '@nestjs/swagger'; import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer'; import { Transform } from 'class-transformer';
import { IsBoolean } from 'class-validator'; import { IsBoolean } from 'class-validator';
import { toBoolean, ValidateUUID, Optional } from '../../domain.util'; import { Optional, ValidateUUID, toBoolean } from '../../domain.util';
export class GetAlbumsDto { export class GetAlbumsDto {
@Optional() @Optional()

View file

@ -1,9 +1,9 @@
import { AssetType } from '@app/infra/entities'; import { AssetType } from '@app/infra/entities';
import { BadRequestException, UnauthorizedException } from '@nestjs/common'; import { BadRequestException, UnauthorizedException } from '@nestjs/common';
import { import {
IAccessRepositoryMock,
assetStub, assetStub,
authStub, authStub,
IAccessRepositoryMock,
newAccessRepositoryMock, newAccessRepositoryMock,
newAssetRepositoryMock, newAssetRepositoryMock,
newCryptoRepositoryMock, newCryptoRepositoryMock,

View file

@ -9,7 +9,7 @@ import { ICryptoRepository } from '../crypto';
import { mimeTypes } from '../domain.constant'; import { mimeTypes } from '../domain.constant';
import { HumanReadableSize, usePagination } from '../domain.util'; import { HumanReadableSize, usePagination } from '../domain.util';
import { IJobRepository, JobName } from '../job'; 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 { IAssetRepository } from './asset.repository';
import { import {
AssetBulkUpdateDto, AssetBulkUpdateDto,
@ -21,17 +21,17 @@ import {
DownloadInfoDto, DownloadInfoDto,
DownloadResponseDto, DownloadResponseDto,
MapMarkerDto, MapMarkerDto,
mapStats,
MemoryLaneDto, MemoryLaneDto,
TimeBucketAssetDto, TimeBucketAssetDto,
TimeBucketDto, TimeBucketDto,
mapStats,
} from './dto'; } from './dto';
import { import {
AssetResponseDto, AssetResponseDto,
mapAsset,
MapMarkerResponseDto, MapMarkerResponseDto,
MemoryLaneResponseDto, MemoryLaneResponseDto,
TimeBucketResponseDto, TimeBucketResponseDto,
mapAsset,
} from './response-dto'; } from './response-dto';
export enum UploadFieldName { export enum UploadFieldName {

View file

@ -2,7 +2,7 @@ import { AssetType } from '@app/infra/entities';
import { ApiProperty } from '@nestjs/swagger'; import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer'; import { Transform } from 'class-transformer';
import { IsBoolean } from 'class-validator'; import { IsBoolean } from 'class-validator';
import { toBoolean, Optional } from '../../domain.util'; import { Optional, toBoolean } from '../../domain.util';
import { AssetStats } from '../asset.repository'; import { AssetStats } from '../asset.repository';
export class AssetStatsDto { export class AssetStatsDto {

View file

@ -1,6 +1,6 @@
import { IsBoolean } from 'class-validator'; import { IsBoolean } from 'class-validator';
import { BulkIdsDto } from '../response-dto';
import { Optional } from '../../domain.util'; import { Optional } from '../../domain.util';
import { BulkIdsDto } from '../response-dto';
export class AssetBulkUpdateDto extends BulkIdsDto { export class AssetBulkUpdateDto extends BulkIdsDto {
@Optional() @Optional()

View file

@ -1,7 +1,7 @@
import { ApiProperty } from '@nestjs/swagger'; import { ApiProperty } from '@nestjs/swagger';
import { Transform, Type } from 'class-transformer'; import { Transform, Type } from 'class-transformer';
import { IsBoolean, IsDate } from 'class-validator'; import { IsBoolean, IsDate } from 'class-validator';
import { toBoolean, Optional } from '../../domain.util'; import { Optional, toBoolean } from '../../domain.util';
export class MapMarkerDto { export class MapMarkerDto {
@ApiProperty() @ApiProperty()

View file

@ -1,7 +1,7 @@
import { ApiProperty } from '@nestjs/swagger'; import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer'; import { Transform } from 'class-transformer';
import { IsBoolean, IsEnum, IsNotEmpty, IsString } from 'class-validator'; 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'; import { TimeBucketSize } from '../asset.repository';
export class TimeBucketDto { export class TimeBucketDto {

View file

@ -1,9 +1,9 @@
import { AssetEntity, AssetType } from '@app/infra/entities'; import { AssetEntity, AssetType } from '@app/infra/entities';
import { ApiProperty } from '@nestjs/swagger'; import { ApiProperty } from '@nestjs/swagger';
import { mapFace, PersonResponseDto } from '../../person/person.dto'; import { PersonResponseDto, mapFace } from '../../person/person.dto';
import { mapTag, TagResponseDto } from '../../tag'; import { TagResponseDto, mapTag } from '../../tag';
import { ExifResponseDto, mapExif } from './exif-response.dto'; 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 { export class AssetResponseDto {
id!: string; id!: string;

View file

@ -1,5 +1,5 @@
import { DatabaseAction, EntityType } from '@app/infra/entities'; 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 { IAuditRepository } from './audit.repository';
import { AuditService } from './audit.service'; import { AuditService } from './audit.service';

View file

@ -16,7 +16,7 @@ import {
userTokenStub, userTokenStub,
} from '@test'; } from '@test';
import { IncomingHttpHeaders } from 'http'; import { IncomingHttpHeaders } from 'http';
import { generators, Issuer } from 'openid-client'; import { Issuer, generators } from 'openid-client';
import { Socket } from 'socket.io'; import { Socket } from 'socket.io';
import { IKeyRepository } from '../api-key'; import { IKeyRepository } from '../api-key';
import { ICryptoRepository } from '../crypto/crypto.repository'; import { ICryptoRepository } from '../crypto/crypto.repository';

View file

@ -10,7 +10,7 @@ import {
import cookieParser from 'cookie'; import cookieParser from 'cookie';
import { IncomingHttpHeaders } from 'http'; import { IncomingHttpHeaders } from 'http';
import { DateTime } from 'luxon'; 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 { IKeyRepository } from '../api-key';
import { ICryptoRepository } from '../crypto/crypto.repository'; import { ICryptoRepository } from '../crypto/crypto.repository';
import { ISharedLinkRepository } from '../shared-link'; import { ISharedLinkRepository } from '../shared-link';
@ -31,11 +31,11 @@ import {
AuthDeviceResponseDto, AuthDeviceResponseDto,
LoginResponseDto, LoginResponseDto,
LogoutResponseDto, LogoutResponseDto,
OAuthAuthorizeResponseDto,
OAuthConfigResponseDto,
mapAdminSignupResponse, mapAdminSignupResponse,
mapLoginResponse, mapLoginResponse,
mapUserToken, mapUserToken,
OAuthAuthorizeResponseDto,
OAuthConfigResponseDto,
} from './response-dto'; } from './response-dto';
import { IUserTokenRepository } from './user-token.repository'; import { IUserTokenRepository } from './user-token.repository';

View file

@ -1,6 +1,6 @@
import { applyDecorators } from '@nestjs/common'; import { applyDecorators } from '@nestjs/common';
import { ApiProperty } from '@nestjs/swagger'; 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 { basename, extname } from 'node:path';
import sanitize from 'sanitize-filename'; import sanitize from 'sanitize-filename';

View file

@ -2,7 +2,7 @@ import { Inject, Logger } from '@nestjs/common';
import { join } from 'path'; import { join } from 'path';
import { IAssetRepository, WithoutProperty } from '../asset'; import { IAssetRepository, WithoutProperty } from '../asset';
import { usePagination } from '../domain.util'; 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 { CropOptions, FACE_THUMBNAIL_SIZE, IMediaRepository } from '../media';
import { IPersonRepository } from '../person/person.repository'; import { IPersonRepository } from '../person/person.repository';
import { ISearchRepository } from '../search/search.repository'; import { ISearchRepository } from '../search/search.repository';

View file

@ -1,7 +1,7 @@
import { ApiProperty } from '@nestjs/swagger'; import { ApiProperty } from '@nestjs/swagger';
import { IsBoolean, IsEnum, IsNotEmpty } from 'class-validator'; import { IsBoolean, IsEnum, IsNotEmpty } from 'class-validator';
import { JobCommand, QueueName } from './job.constants';
import { Optional } from '../domain.util'; import { Optional } from '../domain.util';
import { JobCommand, QueueName } from './job.constants';
export class JobIdParamDto { export class JobIdParamDto {
@IsNotEmpty() @IsNotEmpty()

View file

@ -3,7 +3,7 @@ import { Inject, Injectable, Logger, UnsupportedMediaTypeException } from '@nest
import { join } from 'path'; import { join } from 'path';
import { IAssetRepository, WithoutProperty } from '../asset'; import { IAssetRepository, WithoutProperty } from '../asset';
import { usePagination } from '../domain.util'; 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 { IStorageRepository, StorageCore, StorageFolder } from '../storage';
import { ISystemConfigRepository, SystemConfigFFmpegDto } from '../system-config'; import { ISystemConfigRepository, SystemConfigFFmpegDto } from '../system-config';
import { SystemConfigCore } from '../system-config/system-config.core'; import { SystemConfigCore } from '../system-config/system-config.core';

View file

@ -1,6 +1,6 @@
import { assetStub, newAssetRepositoryMock, newJobRepositoryMock, newStorageRepositoryMock } from '@test'; import { assetStub, newAssetRepositoryMock, newJobRepositoryMock, newStorageRepositoryMock } from '@test';
import { constants } from 'fs/promises'; import { constants } from 'fs/promises';
import { IAssetRepository, WithoutProperty, WithProperty } from '../asset'; import { IAssetRepository, WithProperty, WithoutProperty } from '../asset';
import { IJobRepository, JobName } from '../job'; import { IJobRepository, JobName } from '../job';
import { IStorageRepository } from '../storage'; import { IStorageRepository } from '../storage';
import { MetadataService } from './metadata.service'; import { MetadataService } from './metadata.service';

View file

@ -2,7 +2,7 @@ import { PartnerEntity } from '@app/infra/entities';
import { BadRequestException, Inject, Injectable } from '@nestjs/common'; import { BadRequestException, Inject, Injectable } from '@nestjs/common';
import { IPartnerRepository, PartnerDirection, PartnerIds } from '.'; import { IPartnerRepository, PartnerDirection, PartnerIds } from '.';
import { AuthUserDto } from '../auth'; import { AuthUserDto } from '../auth';
import { mapUser, UserResponseDto } from '../user'; import { UserResponseDto, mapUser } from '../user';
@Injectable() @Injectable()
export class PartnerService { export class PartnerService {

View file

@ -2,7 +2,7 @@ import { AssetFaceEntity, PersonEntity } from '@app/infra/entities';
import { ApiProperty } from '@nestjs/swagger'; import { ApiProperty } from '@nestjs/swagger';
import { Transform, Type } from 'class-transformer'; import { Transform, Type } from 'class-transformer';
import { IsArray, IsBoolean, IsDate, IsNotEmpty, IsString, ValidateNested } from 'class-validator'; 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 { export class PersonUpdateDto {
/** /**

View file

@ -3,15 +3,15 @@ import { AssetResponseDto, BulkIdErrorReason, BulkIdResponseDto, mapAsset } from
import { AuthUserDto } from '../auth'; import { AuthUserDto } from '../auth';
import { mimeTypes } from '../domain.constant'; import { mimeTypes } from '../domain.constant';
import { IJobRepository, JobName } from '../job'; import { IJobRepository, JobName } from '../job';
import { ImmichReadStream, IStorageRepository } from '../storage'; import { IStorageRepository, ImmichReadStream } from '../storage';
import { import {
mapPerson,
MergePersonDto, MergePersonDto,
PeopleResponseDto, PeopleResponseDto,
PeopleUpdateDto, PeopleUpdateDto,
PersonResponseDto, PersonResponseDto,
PersonSearchDto, PersonSearchDto,
PersonUpdateDto, PersonUpdateDto,
mapPerson,
} from './person.dto'; } from './person.dto';
import { IPersonRepository, UpdateFacesData } from './person.repository'; import { IPersonRepository, UpdateFacesData } from './person.repository';

View file

@ -1,7 +1,7 @@
import { AssetType } from '@app/infra/entities'; import { AssetType } from '@app/infra/entities';
import { Transform } from 'class-transformer'; import { Transform } from 'class-transformer';
import { IsArray, IsBoolean, IsEnum, IsNotEmpty, IsString } from 'class-validator'; import { IsArray, IsBoolean, IsEnum, IsNotEmpty, IsString } from 'class-validator';
import { toBoolean, Optional } from '../../domain.util'; import { Optional, toBoolean } from '../../domain.util';
export class SearchDto { export class SearchDto {
@IsString() @IsString()

View file

@ -7,7 +7,7 @@ import { IAssetRepository } from '../asset/asset.repository';
import { AuthUserDto } from '../auth'; import { AuthUserDto } from '../auth';
import { usePagination } from '../domain.util'; import { usePagination } from '../domain.util';
import { AssetFaceId, IFaceRepository } from '../facial-recognition'; 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 { IMachineLearningRepository } from '../smart-info';
import { FeatureFlag, ISystemConfigRepository, SystemConfigCore } from '../system-config'; import { FeatureFlag, ISystemConfigRepository, SystemConfigCore } from '../system-config';
import { SearchDto } from './dto'; import { SearchDto } from './dto';

View file

@ -2,7 +2,7 @@ import { SharedLinkType } from '@app/infra/entities';
import { ApiProperty } from '@nestjs/swagger'; import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer'; import { Type } from 'class-transformer';
import { IsBoolean, IsDate, IsEnum, IsString } from 'class-validator'; import { IsBoolean, IsDate, IsEnum, IsString } from 'class-validator';
import { ValidateUUID, Optional } from '../domain.util'; import { Optional, ValidateUUID } from '../domain.util';
export class SharedLinkCreateDto { export class SharedLinkCreateDto {
@IsEnum(SharedLinkType) @IsEnum(SharedLinkType)

View file

@ -1,9 +1,9 @@
import { BadRequestException, ForbiddenException } from '@nestjs/common'; import { BadRequestException, ForbiddenException } from '@nestjs/common';
import { import {
IAccessRepositoryMock,
albumStub, albumStub,
assetStub, assetStub,
authStub, authStub,
IAccessRepositoryMock,
newAccessRepositoryMock, newAccessRepositoryMock,
newCryptoRepositoryMock, newCryptoRepositoryMock,
newSharedLinkRepositoryMock, newSharedLinkRepositoryMock,

View file

@ -4,7 +4,7 @@ import { AccessCore, IAccessRepository, Permission } from '../access';
import { AssetIdErrorReason, AssetIdsDto, AssetIdsResponseDto } from '../asset'; import { AssetIdErrorReason, AssetIdsDto, AssetIdsResponseDto } from '../asset';
import { AuthUserDto } from '../auth'; import { AuthUserDto } from '../auth';
import { ICryptoRepository } from '../crypto'; 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 { SharedLinkCreateDto, SharedLinkEditDto } from './shared-link.dto';
import { ISharedLinkRepository } from './shared-link.repository'; import { ISharedLinkRepository } from './shared-link.repository';

View file

@ -1,8 +1,8 @@
import { ApiProperty } from '@nestjs/swagger'; import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer'; import { Type } from 'class-transformer';
import { IsBoolean, IsEnum, IsNotEmpty, IsNumber, IsString, Max, Min } from 'class-validator'; import { IsBoolean, IsEnum, IsNotEmpty, IsNumber, IsString, Max, Min } from 'class-validator';
import { CLIPMode, ModelType } from '../machine-learning.interface';
import { Optional } from '../../domain.util'; import { Optional } from '../../domain.util';
import { CLIPMode, ModelType } from '../machine-learning.interface';
export class ModelConfig { export class ModelConfig {
@IsBoolean() @IsBoolean()

View file

@ -1,7 +1,7 @@
import { Inject, Injectable } from '@nestjs/common'; import { Inject, Injectable } from '@nestjs/common';
import { IAssetRepository, WithoutProperty } from '../asset'; import { IAssetRepository, WithoutProperty } from '../asset';
import { usePagination } from '../domain.util'; 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 { ISystemConfigRepository, SystemConfigCore } from '../system-config';
import { IMachineLearningRepository } from './machine-learning.interface'; import { IMachineLearningRepository } from './machine-learning.interface';
import { ISmartInfoRepository } from './smart-info.repository'; import { ISmartInfoRepository } from './smart-info.repository';

View file

@ -13,7 +13,7 @@ import {
import { BadRequestException } from '@nestjs/common'; import { BadRequestException } from '@nestjs/common';
import { newJobRepositoryMock, newSystemConfigRepositoryMock } from '@test'; import { newJobRepositoryMock, newSystemConfigRepositoryMock } from '@test';
import { IJobRepository, JobName, QueueName } from '../job'; 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 { ISystemConfigRepository } from './system-config.repository';
import { SystemConfigService } from './system-config.service'; import { SystemConfigService } from './system-config.service';

View file

@ -1,7 +1,7 @@
import { Inject, Injectable } from '@nestjs/common'; import { Inject, Injectable } from '@nestjs/common';
import { ISystemConfigRepository } from '.'; import { ISystemConfigRepository } from '.';
import { IJobRepository, JobName } from '../job'; 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 { SystemConfigTemplateStorageOptionDto } from './response-dto/system-config-template-storage-option.dto';
import { import {
supportedDayTokens, supportedDayTokens,

View file

@ -1,7 +1,7 @@
import { BadRequestException, Inject, Injectable } from '@nestjs/common'; import { BadRequestException, Inject, Injectable } from '@nestjs/common';
import { AssetIdErrorReason, AssetIdsDto, AssetIdsResponseDto, AssetResponseDto, mapAsset } from '../asset'; import { AssetIdErrorReason, AssetIdsDto, AssetIdsResponseDto, AssetResponseDto, mapAsset } from '../asset';
import { AuthUserDto } from '../auth'; 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 { CreateTagDto, UpdateTagDto } from './tag.dto';
import { ITagRepository } from './tag.repository'; import { ITagRepository } from './tag.repository';

View file

@ -1,6 +1,6 @@
import { Transform } from 'class-transformer'; import { Transform } from 'class-transformer';
import { IsBoolean, IsEmail, IsNotEmpty, IsString } from 'class-validator'; 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 { export class CreateUserDto {
@IsEmail({ require_tld: false }) @IsEmail({ require_tld: false })

View file

@ -1,7 +1,7 @@
import { ApiProperty } from '@nestjs/swagger'; import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer'; import { Transform } from 'class-transformer';
import { IsBoolean, IsEmail, IsNotEmpty, IsString, IsUUID } from 'class-validator'; 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 { export class UpdateUserDto {
@Optional() @Optional()

View file

@ -1,6 +1,6 @@
import { Optional } from '../../domain.util';
import { Transform } from 'class-transformer'; import { Transform } from 'class-transformer';
import { IsBoolean } from 'class-validator'; import { IsBoolean } from 'class-validator';
import { Optional } from '../../domain.util';
export class UserCountDto { export class UserCountDto {
@IsBoolean() @IsBoolean()

View file

@ -6,7 +6,7 @@ import {
Logger, Logger,
NotFoundException, NotFoundException,
} from '@nestjs/common'; } from '@nestjs/common';
import { constants, createReadStream, ReadStream } from 'fs'; import { ReadStream, constants, createReadStream } from 'fs';
import fs from 'fs/promises'; import fs from 'fs/promises';
import sanitize from 'sanitize-filename'; import sanitize from 'sanitize-filename';
import { AuthUserDto } from '../auth'; import { AuthUserDto } from '../auth';

View file

@ -12,11 +12,11 @@ import { IStorageRepository } from '../storage/storage.repository';
import { CreateUserDto, UpdateUserDto, UserCountDto } from './dto'; import { CreateUserDto, UpdateUserDto, UserCountDto } from './dto';
import { import {
CreateProfileImageResponseDto, CreateProfileImageResponseDto,
UserCountResponseDto,
UserResponseDto,
mapCreateProfileImageResponse, mapCreateProfileImageResponse,
mapUser, mapUser,
mapUserCountResponse, mapUserCountResponse,
UserCountResponseDto,
UserResponseDto,
} from './response-dto'; } from './response-dto';
import { UserCore } from './user.core'; import { UserCore } from './user.core';
import { IUserRepository } from './user.repository'; import { IUserRepository } from './user.repository';

View file

@ -18,8 +18,8 @@ import {
} from '@nestjs/common'; } from '@nestjs/common';
import { ApiBody, ApiConsumes, ApiHeader, ApiOkResponse, ApiTags } from '@nestjs/swagger'; import { ApiBody, ApiConsumes, ApiHeader, ApiOkResponse, ApiTags } from '@nestjs/swagger';
import { Response as Res } from 'express'; import { Response as Res } from 'express';
import { Authenticated, AuthUser, SharedLinkRoute } from '../../app.guard'; import { AuthUser, Authenticated, SharedLinkRoute } from '../../app.guard';
import { FileUploadInterceptor, ImmichFile, mapToUploadFile, Route } from '../../app.interceptor'; import { FileUploadInterceptor, ImmichFile, Route, mapToUploadFile } from '../../app.interceptor';
import { UUIDParamDto } from '../../controllers/dto/uuid-param.dto'; import { UUIDParamDto } from '../../controllers/dto/uuid-param.dto';
import FileNotEmptyValidator from '../validation/file-not-empty-validator'; import FileNotEmptyValidator from '../validation/file-not-empty-validator';
import { AssetService } from './asset.service'; import { AssetService } from './asset.service';

View file

@ -2,10 +2,10 @@ import { ICryptoRepository, IJobRepository, IStorageRepository, JobName } from '
import { AssetEntity, AssetType, ExifEntity } from '@app/infra/entities'; import { AssetEntity, AssetType, ExifEntity } from '@app/infra/entities';
import { BadRequestException } from '@nestjs/common'; import { BadRequestException } from '@nestjs/common';
import { import {
IAccessRepositoryMock,
assetStub, assetStub,
authStub, authStub,
fileStub, fileStub,
IAccessRepositoryMock,
newAccessRepositoryMock, newAccessRepositoryMock,
newCryptoRepositoryMock, newCryptoRepositoryMock,
newJobRepositoryMock, newJobRepositoryMock,

View file

@ -1,12 +1,12 @@
import { AuthService, AuthUserDto, IMMICH_API_KEY_NAME, LoginDetails } from '@app/domain'; import { AuthService, AuthUserDto, IMMICH_API_KEY_NAME, LoginDetails } from '@app/domain';
import { import {
applyDecorators,
CanActivate, CanActivate,
createParamDecorator,
ExecutionContext, ExecutionContext,
Injectable, Injectable,
Logger, Logger,
SetMetadata, SetMetadata,
applyDecorators,
createParamDecorator,
} from '@nestjs/common'; } from '@nestjs/common';
import { Reflector } from '@nestjs/core'; import { Reflector } from '@nestjs/core';
import { ApiBearerAuth, ApiCookieAuth, ApiQuery, ApiSecurity } from '@nestjs/swagger'; import { ApiBearerAuth, ApiCookieAuth, ApiQuery, ApiSecurity } from '@nestjs/swagger';

View file

@ -5,7 +5,7 @@ import { Reflector } from '@nestjs/core';
import { transformException } from '@nestjs/platform-express/multer/multer/multer.utils'; import { transformException } from '@nestjs/platform-express/multer/multer/multer.utils';
import { createHash } from 'crypto'; import { createHash } from 'crypto';
import { NextFunction, RequestHandler } from 'express'; import { NextFunction, RequestHandler } from 'express';
import multer, { diskStorage, StorageEngine } from 'multer'; import multer, { StorageEngine, diskStorage } from 'multer';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { AuthRequest } from './app.guard'; import { AuthRequest } from './app.guard';

View file

@ -12,8 +12,8 @@ import { AppGuard } from './app.guard';
import { FileUploadInterceptor } from './app.interceptor'; import { FileUploadInterceptor } from './app.interceptor';
import { AppService } from './app.service'; import { AppService } from './app.service';
import { import {
AlbumController,
APIKeyController, APIKeyController,
AlbumController,
AppController, AppController,
AssetController, AssetController,
AuditController, AuditController,

View file

@ -1,8 +1,8 @@
import { import {
ImmichReadStream,
IMMICH_ACCESS_COOKIE, IMMICH_ACCESS_COOKIE,
IMMICH_API_KEY_HEADER, IMMICH_API_KEY_HEADER,
IMMICH_API_KEY_NAME, IMMICH_API_KEY_NAME,
ImmichReadStream,
SERVER_VERSION, SERVER_VERSION,
} from '@app/domain'; } from '@app/domain';
import { INestApplication, StreamableFile } from '@nestjs/common'; import { INestApplication, StreamableFile } from '@nestjs/common';

View file

@ -14,7 +14,7 @@ import {
import { Body, Controller, Delete, Get, Param, Patch, Post, Put, Query } from '@nestjs/common'; import { Body, Controller, Delete, Get, Param, Patch, Post, Put, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger'; import { ApiTags } from '@nestjs/swagger';
import { ParseMeUUIDPipe } from '../api-v1/validation/parse-me-uuid-pipe'; 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 { UseValidation } from '../app.utils';
import { UUIDParamDto } from './dto/uuid-param.dto'; import { UUIDParamDto } from './dto/uuid-param.dto';

View file

@ -8,7 +8,7 @@ import {
} from '@app/domain'; } from '@app/domain';
import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common'; import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger'; import { ApiTags } from '@nestjs/swagger';
import { Authenticated, AuthUser } from '../app.guard'; import { AuthUser, Authenticated } from '../app.guard';
import { UseValidation } from '../app.utils'; import { UseValidation } from '../app.utils';
import { UUIDParamDto } from './dto/uuid-param.dto'; import { UUIDParamDto } from './dto/uuid-param.dto';

View file

@ -19,8 +19,8 @@ import {
} from '@app/domain'; } from '@app/domain';
import { Body, Controller, Get, HttpCode, HttpStatus, Param, Post, Put, Query, StreamableFile } from '@nestjs/common'; import { Body, Controller, Get, HttpCode, HttpStatus, Param, Post, Put, Query, StreamableFile } from '@nestjs/common';
import { ApiOkResponse, ApiTags } from '@nestjs/swagger'; import { ApiOkResponse, ApiTags } from '@nestjs/swagger';
import { Authenticated, AuthUser, SharedLinkRoute } from '../app.guard'; import { AuthUser, Authenticated, SharedLinkRoute } from '../app.guard';
import { asStreamableFile, UseValidation } from '../app.utils'; import { UseValidation, asStreamableFile } from '../app.utils';
import { UUIDParamDto } from './dto/uuid-param.dto'; import { UUIDParamDto } from './dto/uuid-param.dto';
@ApiTags('Asset') @ApiTags('Asset')

View file

@ -1,7 +1,7 @@
import { AuditDeletesDto, AuditDeletesResponseDto, AuditService, AuthUserDto } from '@app/domain'; import { AuditDeletesDto, AuditDeletesResponseDto, AuditService, AuthUserDto } from '@app/domain';
import { Controller, Get, Query } from '@nestjs/common'; import { Controller, Get, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger'; import { ApiTags } from '@nestjs/swagger';
import { Authenticated, AuthUser } from '../app.guard'; import { AuthUser, Authenticated } from '../app.guard';
import { UseValidation } from '../app.utils'; import { UseValidation } from '../app.utils';
@ApiTags('Audit') @ApiTags('Audit')

View file

@ -17,7 +17,7 @@ import {
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Req, Res } from '@nestjs/common'; import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Req, Res } from '@nestjs/common';
import { ApiBadRequestResponse, ApiTags } from '@nestjs/swagger'; import { ApiBadRequestResponse, ApiTags } from '@nestjs/swagger';
import { Request, Response } from 'express'; 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 { UseValidation } from '../app.utils';
import { UUIDParamDto } from './dto/uuid-param.dto'; import { UUIDParamDto } from './dto/uuid-param.dto';

View file

@ -12,7 +12,7 @@ import {
import { Body, Controller, Get, HttpStatus, Post, Redirect, Req, Res } from '@nestjs/common'; import { Body, Controller, Get, HttpStatus, Post, Redirect, Req, Res } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger'; import { ApiTags } from '@nestjs/swagger';
import { Request, Response } from 'express'; 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 { UseValidation } from '../app.utils';
@ApiTags('OAuth') @ApiTags('OAuth')

View file

@ -1,7 +1,7 @@
import { AuthUserDto, PartnerDirection, PartnerService, UserResponseDto } from '@app/domain'; import { AuthUserDto, PartnerDirection, PartnerService, UserResponseDto } from '@app/domain';
import { Controller, Delete, Get, Param, Post, Query } from '@nestjs/common'; import { Controller, Delete, Get, Param, Post, Query } from '@nestjs/common';
import { ApiQuery, ApiTags } from '@nestjs/swagger'; import { ApiQuery, ApiTags } from '@nestjs/swagger';
import { Authenticated, AuthUser } from '../app.guard'; import { AuthUser, Authenticated } from '../app.guard';
import { UseValidation } from '../app.utils'; import { UseValidation } from '../app.utils';
import { UUIDParamDto } from './dto/uuid-param.dto'; import { UUIDParamDto } from './dto/uuid-param.dto';

View file

@ -13,7 +13,7 @@ import {
} from '@app/domain'; } from '@app/domain';
import { Body, Controller, Get, Param, Post, Put, Query, StreamableFile } from '@nestjs/common'; import { Body, Controller, Get, Param, Post, Put, Query, StreamableFile } from '@nestjs/common';
import { ApiOkResponse, ApiTags } from '@nestjs/swagger'; import { ApiOkResponse, ApiTags } from '@nestjs/swagger';
import { Authenticated, AuthUser } from '../app.guard'; import { AuthUser, Authenticated } from '../app.guard';
import { UseValidation } from '../app.utils'; import { UseValidation } from '../app.utils';
import { UUIDParamDto } from './dto/uuid-param.dto'; import { UUIDParamDto } from './dto/uuid-param.dto';

View file

@ -1,7 +1,7 @@
import { AuthUserDto, SearchDto, SearchExploreResponseDto, SearchResponseDto, SearchService } from '@app/domain'; import { AuthUserDto, SearchDto, SearchExploreResponseDto, SearchResponseDto, SearchService } from '@app/domain';
import { Controller, Get, Query } from '@nestjs/common'; import { Controller, Get, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger'; import { ApiTags } from '@nestjs/swagger';
import { Authenticated, AuthUser } from '../app.guard'; import { AuthUser, Authenticated } from '../app.guard';
import { UseValidation } from '../app.utils'; import { UseValidation } from '../app.utils';
@ApiTags('Search') @ApiTags('Search')

View file

@ -9,7 +9,7 @@ import {
} from '@app/domain'; } from '@app/domain';
import { Body, Controller, Delete, Get, Param, Patch, Post, Put } from '@nestjs/common'; import { Body, Controller, Delete, Get, Param, Patch, Post, Put } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger'; 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 { UseValidation } from '../app.utils';
import { UUIDParamDto } from './dto/uuid-param.dto'; import { UUIDParamDto } from './dto/uuid-param.dto';

View file

@ -10,7 +10,7 @@ import {
} from '@app/domain'; } from '@app/domain';
import { Body, Controller, Delete, Get, Param, Patch, Post, Put } from '@nestjs/common'; import { Body, Controller, Delete, Get, Param, Patch, Post, Put } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger'; import { ApiTags } from '@nestjs/swagger';
import { Authenticated, AuthUser } from '../app.guard'; import { AuthUser, Authenticated } from '../app.guard';
import { UseValidation } from '../app.utils'; import { UseValidation } from '../app.utils';
import { UUIDParamDto } from './dto/uuid-param.dto'; import { UUIDParamDto } from './dto/uuid-param.dto';

View file

@ -1,10 +1,10 @@
import { import {
AuthUserDto, AuthUserDto,
UserCountDto as CountDto,
CreateUserDto as CreateDto,
CreateProfileImageDto, CreateProfileImageDto,
CreateProfileImageResponseDto, CreateProfileImageResponseDto,
CreateUserDto as CreateDto,
UpdateUserDto as UpdateDto, UpdateUserDto as UpdateDto,
UserCountDto as CountDto,
UserCountResponseDto, UserCountResponseDto,
UserResponseDto, UserResponseDto,
UserService, UserService,
@ -26,7 +26,7 @@ import {
} from '@nestjs/common'; } from '@nestjs/common';
import { ApiBody, ApiConsumes, ApiTags } from '@nestjs/swagger'; import { ApiBody, ApiConsumes, ApiTags } from '@nestjs/swagger';
import { Response as Res } from 'express'; 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 { FileUploadInterceptor, Route } from '../app.interceptor';
import { UseValidation } from '../app.utils'; import { UseValidation } from '../app.utils';
import { UUIDParamDto } from './dto/uuid-param.dto'; import { UUIDParamDto } from './dto/uuid-param.dto';

View file

@ -3,13 +3,13 @@ import { INestApplication } from '@nestjs/common';
import { Test, TestingModule } from '@nestjs/testing'; import { Test, TestingModule } from '@nestjs/testing';
import request from 'supertest'; import request from 'supertest';
import { import {
adminSignupStub,
changePasswordStub, changePasswordStub,
deviceStub, deviceStub,
errorStub, errorStub,
loginResponseStub, loginResponseStub,
loginStub, loginStub,
signupResponseStub, signupResponseStub,
adminSignupStub,
uuidStub, uuidStub,
} from '../fixtures'; } from '../fixtures';
import { api, db } from '../test-utils'; import { api, db } from '../test-utils';

View file

@ -14,7 +14,7 @@ import {
} from '@app/domain'; } from '@app/domain';
import { dataSource } from '@app/infra'; import { dataSource } from '@app/infra';
import request from 'supertest'; import request from 'supertest';
import { loginResponseStub, loginStub, signupResponseStub, adminSignupStub } from './fixtures'; import { adminSignupStub, loginResponseStub, loginStub, signupResponseStub } from './fixtures';
export const db = { export const db = {
reset: async () => { reset: async () => {