mirror of
https://github.com/immich-app/immich.git
synced 2025-01-02 12:48:35 +02:00
chore: migrate database files (#8126)
This commit is contained in:
parent
84f7ca855a
commit
c1402eee8e
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@ -329,14 +329,14 @@ jobs:
|
||||
|
||||
- name: Generate new migrations
|
||||
continue-on-error: true
|
||||
run: npm run typeorm:migrations:generate ./src/infra/migrations/TestMigration
|
||||
run: npm run typeorm:migrations:generate ./src/migrations/TestMigration
|
||||
|
||||
- name: Find file changes
|
||||
uses: tj-actions/verify-changed-files@v19
|
||||
id: verify-changed-files
|
||||
with:
|
||||
files: |
|
||||
server/src/infra/migrations/
|
||||
server/src/migrations/
|
||||
- name: Verify migration files have not changed
|
||||
if: steps.verify-changed-files.outputs.files_changed == 'true'
|
||||
run: |
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Database Migrations
|
||||
|
||||
After making any changes in the `server/src/infra/entities`, a database migration need to run in order to register the changes in the database. Follow the steps below to create a new migration.
|
||||
After making any changes in the `server/src/entities`, a database migration need to run in order to register the changes in the database. Follow the steps below to create a new migration.
|
||||
|
||||
1. Run the command
|
||||
|
||||
@ -9,6 +9,6 @@ npm run typeorm:migrations:generate ./src/infra/<migration-name>
|
||||
```
|
||||
|
||||
2. Check if the migration file makes sense.
|
||||
3. Move the migration file to folder `./server/src/infra/migrations` in your code editor.
|
||||
3. Move the migration file to folder `./server/src/migrations` in your code editor.
|
||||
|
||||
The server will automatically detect `*.ts` file changes and restart. Part of the server start-up process includes running any new migrations, so it will be applied immediately.
|
||||
|
@ -12,11 +12,11 @@
|
||||
"collectCoverageFrom": [
|
||||
"<rootDir>/src/**/*.(t|j)s",
|
||||
"!<rootDir>/src/**/*.spec.(t|s)s",
|
||||
"!<rootDir>/src/infra/migrations/**"
|
||||
"!<rootDir>/src/migrations/**"
|
||||
],
|
||||
"coverageDirectory": "./coverage",
|
||||
"moduleNameMapper": {
|
||||
"^test(|/.*)$": "<rootDir>/test/$1",
|
||||
"^src(|/.*)$": "<rootDir>/src/$1"
|
||||
"^test(|/.*)$": "<rootDir>/test/$1",
|
||||
"^src(|/.*)$": "<rootDir>/src/$1"
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ import path from 'node:path';
|
||||
import { LoginResponseDto } from 'src/domain/auth/auth.dto';
|
||||
import { LibraryResponseDto } from 'src/domain/library/library.dto';
|
||||
import { LibraryService } from 'src/domain/library/library.service';
|
||||
import { AssetType } from 'src/infra/entities/asset.entity';
|
||||
import { LibraryType } from 'src/infra/entities/library.entity';
|
||||
import { AssetType } from 'src/entities/asset.entity';
|
||||
import { LibraryType } from 'src/entities/library.entity';
|
||||
import { StorageEventType } from 'src/interfaces/storage.repository';
|
||||
import {
|
||||
IMMICH_TEST_ASSET_PATH,
|
||||
|
@ -2,7 +2,7 @@ import { api } from 'e2e/client';
|
||||
import fs from 'node:fs';
|
||||
import { LibraryController } from 'src/controllers/library.controller';
|
||||
import { LoginResponseDto } from 'src/domain/auth/auth.dto';
|
||||
import { LibraryType } from 'src/infra/entities/library.entity';
|
||||
import { LibraryType } from 'src/entities/library.entity';
|
||||
import { IMMICH_TEST_ASSET_PATH, IMMICH_TEST_ASSET_TEMP_PATH, restoreTempFolder, testApp } from 'src/test-utils/utils';
|
||||
import request from 'supertest';
|
||||
import { errorStub } from 'test/fixtures/error.stub';
|
||||
|
@ -148,6 +148,8 @@
|
||||
"collectCoverageFrom": [
|
||||
"<rootDir>/src/**/*.(t|j)s",
|
||||
"!<rootDir>/src/infra/**/*",
|
||||
"!<rootDir>/src/migrations/**/*",
|
||||
"!<rootDir>/src/subscribers/**/*",
|
||||
"!<rootDir>/src/immich/controllers/**/*"
|
||||
],
|
||||
"coverageDirectory": "./coverage",
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Command, CommandRunner } from 'nest-commander';
|
||||
import { UserService } from 'src/domain/user/user.service';
|
||||
import { UserEntity } from 'src/infra/entities/user.entity';
|
||||
import { UserEntity } from 'src/entities/user.entity';
|
||||
|
||||
@Command({
|
||||
name: 'list-users',
|
||||
|
@ -4,7 +4,7 @@ import { QueueOptions } from 'bullmq';
|
||||
import { RedisOptions } from 'ioredis';
|
||||
import Joi from 'joi';
|
||||
import { QueueName } from 'src/domain/job/job.constants';
|
||||
import { LogLevel } from 'src/infra/entities/system-config.entity';
|
||||
import { LogLevel } from 'src/entities/system-config.entity';
|
||||
|
||||
const WHEN_DB_URL_SET = Joi.when('DB_URL', {
|
||||
is: Joi.exist(),
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { BadRequestException, UnauthorizedException } from '@nestjs/common';
|
||||
import { AuthDto } from 'src/domain/auth/auth.dto';
|
||||
import { SharedLinkEntity } from 'src/infra/entities/shared-link.entity';
|
||||
import { SharedLinkEntity } from 'src/entities/shared-link.entity';
|
||||
import { IAccessRepository } from 'src/interfaces/access.repository';
|
||||
import { setDifference, setIsEqual, setUnion } from 'src/utils';
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { dirname, join, resolve } from 'node:path';
|
||||
import { SystemConfigCore } from 'src/cores/system-config.core';
|
||||
import { APP_MEDIA_LOCATION } from 'src/domain/domain.constant';
|
||||
import { AssetEntity } from 'src/infra/entities/asset.entity';
|
||||
import { AssetPathType, PathType, PersonPathType } from 'src/infra/entities/move.entity';
|
||||
import { PersonEntity } from 'src/infra/entities/person.entity';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { AssetPathType, PathType, PersonPathType } from 'src/entities/move.entity';
|
||||
import { PersonEntity } from 'src/entities/person.entity';
|
||||
import { ImmichLogger } from 'src/infra/logger';
|
||||
import { IAssetRepository } from 'src/interfaces/asset.repository';
|
||||
import { ICryptoRepository } from 'src/interfaces/crypto.repository';
|
||||
|
@ -20,7 +20,7 @@ import {
|
||||
TranscodeHWAccel,
|
||||
TranscodePolicy,
|
||||
VideoCodec,
|
||||
} from 'src/infra/entities/system-config.entity';
|
||||
} from 'src/entities/system-config.entity';
|
||||
import { ImmichLogger } from 'src/infra/logger';
|
||||
import { ISystemConfigRepository } from 'src/interfaces/system-config.repository';
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { BadRequestException, ForbiddenException } from '@nestjs/common';
|
||||
import sanitize from 'sanitize-filename';
|
||||
import { UserResponseDto } from 'src/domain/user/response-dto/user-response.dto';
|
||||
import { LibraryType } from 'src/infra/entities/library.entity';
|
||||
import { UserEntity } from 'src/infra/entities/user.entity';
|
||||
import { LibraryType } from 'src/entities/library.entity';
|
||||
import { UserEntity } from 'src/entities/user.entity';
|
||||
import { ICryptoRepository } from 'src/interfaces/crypto.repository';
|
||||
import { ILibraryRepository } from 'src/interfaces/library.repository';
|
||||
import { IUserRepository } from 'src/interfaces/user.repository';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsEnum, IsNotEmpty, IsString, ValidateIf } from 'class-validator';
|
||||
import { UserDto, mapSimpleUser } from 'src/domain/user/response-dto/user-response.dto';
|
||||
import { ActivityEntity } from 'src/infra/entities/activity.entity';
|
||||
import { ActivityEntity } from 'src/entities/activity.entity';
|
||||
import { Optional, ValidateUUID } from 'src/validation';
|
||||
|
||||
export enum ReactionType {
|
||||
|
@ -12,7 +12,7 @@ import {
|
||||
mapActivity,
|
||||
} from 'src/domain/activity/activity.dto';
|
||||
import { AuthDto } from 'src/domain/auth/auth.dto';
|
||||
import { ActivityEntity } from 'src/infra/entities/activity.entity';
|
||||
import { ActivityEntity } from 'src/entities/activity.entity';
|
||||
import { IAccessRepository } from 'src/interfaces/access.repository';
|
||||
import { IActivityRepository } from 'src/interfaces/activity.repository';
|
||||
|
||||
|
@ -2,7 +2,7 @@ import { ApiProperty } from '@nestjs/swagger';
|
||||
import { AssetResponseDto, mapAsset } from 'src/domain/asset/response-dto/asset-response.dto';
|
||||
import { AuthDto } from 'src/domain/auth/auth.dto';
|
||||
import { UserResponseDto, mapUser } from 'src/domain/user/response-dto/user-response.dto';
|
||||
import { AlbumEntity, AssetOrder } from 'src/infra/entities/album.entity';
|
||||
import { AlbumEntity, AssetOrder } from 'src/entities/album.entity';
|
||||
import { Optional } from 'src/validation';
|
||||
|
||||
export class AlbumResponseDto {
|
||||
|
@ -14,9 +14,9 @@ import { AlbumInfoDto } from 'src/domain/album/dto/album.dto';
|
||||
import { GetAlbumsDto } from 'src/domain/album/dto/get-albums.dto';
|
||||
import { BulkIdErrorReason, BulkIdResponseDto, BulkIdsDto } from 'src/domain/asset/response-dto/asset-ids-response.dto';
|
||||
import { AuthDto } from 'src/domain/auth/auth.dto';
|
||||
import { AlbumEntity } from 'src/infra/entities/album.entity';
|
||||
import { AssetEntity } from 'src/infra/entities/asset.entity';
|
||||
import { UserEntity } from 'src/infra/entities/user.entity';
|
||||
import { AlbumEntity } from 'src/entities/album.entity';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { UserEntity } from 'src/entities/user.entity';
|
||||
import { IAccessRepository } from 'src/interfaces/access.repository';
|
||||
import { AlbumAssetCount, AlbumInfoOptions, IAlbumRepository } from 'src/interfaces/album.repository';
|
||||
import { IAssetRepository } from 'src/interfaces/asset.repository';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsEnum, IsString } from 'class-validator';
|
||||
import { AssetOrder } from 'src/infra/entities/album.entity';
|
||||
import { AssetOrder } from 'src/entities/album.entity';
|
||||
import { Optional, ValidateBoolean, ValidateUUID } from 'src/validation';
|
||||
|
||||
export class UpdateAlbumDto {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { BadRequestException, Inject, Injectable } from '@nestjs/common';
|
||||
import { APIKeyCreateDto, APIKeyCreateResponseDto, APIKeyResponseDto } from 'src/domain/api-key/api-key.dto';
|
||||
import { AuthDto } from 'src/domain/auth/auth.dto';
|
||||
import { APIKeyEntity } from 'src/infra/entities/api-key.entity';
|
||||
import { APIKeyEntity } from 'src/entities/api-key.entity';
|
||||
import { IKeyRepository } from 'src/interfaces/api-key.repository';
|
||||
import { ICryptoRepository } from 'src/interfaces/crypto.repository';
|
||||
|
||||
|
@ -5,7 +5,7 @@ import { AssetJobName } from 'src/domain/asset/dto/asset-ids.dto';
|
||||
import { AssetStatsResponseDto } from 'src/domain/asset/dto/asset-statistics.dto';
|
||||
import { mapAsset } from 'src/domain/asset/response-dto/asset-response.dto';
|
||||
import { JobName } from 'src/domain/job/job.constants';
|
||||
import { AssetEntity, AssetType } from 'src/infra/entities/asset.entity';
|
||||
import { AssetEntity, AssetType } from 'src/entities/asset.entity';
|
||||
import { IAssetStackRepository } from 'src/interfaces/asset-stack.repository';
|
||||
import { AssetStats, IAssetRepository, TimeBucketSize } from 'src/interfaces/asset.repository';
|
||||
import { ClientEvent, ICommunicationRepository } from 'src/interfaces/communication.repository';
|
||||
|
@ -25,8 +25,8 @@ import { AuthDto } from 'src/domain/auth/auth.dto';
|
||||
import { mimeTypes } from 'src/domain/domain.constant';
|
||||
import { JOBS_ASSET_PAGINATION_SIZE, JobName } from 'src/domain/job/job.constants';
|
||||
import { IAssetDeletionJob, ISidecarWriteJob } from 'src/domain/job/job.interface';
|
||||
import { AssetEntity } from 'src/infra/entities/asset.entity';
|
||||
import { LibraryType } from 'src/infra/entities/library.entity';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { LibraryType } from 'src/entities/library.entity';
|
||||
import { ImmichLogger } from 'src/infra/logger';
|
||||
import { IAccessRepository } from 'src/interfaces/access.repository';
|
||||
import { IAssetStackRepository } from 'src/interfaces/asset-stack.repository';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { AssetType } from 'src/infra/entities/asset.entity';
|
||||
import { AssetType } from 'src/entities/asset.entity';
|
||||
import { AssetStats } from 'src/interfaces/asset.repository';
|
||||
import { ValidateBoolean } from 'src/validation';
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsEnum, IsNotEmpty, IsString } from 'class-validator';
|
||||
import { AssetOrder } from 'src/infra/entities/album.entity';
|
||||
import { AssetOrder } from 'src/entities/album.entity';
|
||||
import { TimeBucketSize } from 'src/interfaces/asset.repository';
|
||||
import { Optional, ValidateBoolean, ValidateUUID } from 'src/validation';
|
||||
|
||||
|
@ -5,8 +5,8 @@ import { AuthDto } from 'src/domain/auth/auth.dto';
|
||||
import { PersonWithFacesResponseDto, mapFacesWithoutPerson, mapPerson } from 'src/domain/person/person.dto';
|
||||
import { TagResponseDto, mapTag } from 'src/domain/tag/tag-response.dto';
|
||||
import { UserResponseDto, mapUser } from 'src/domain/user/response-dto/user-response.dto';
|
||||
import { AssetFaceEntity } from 'src/infra/entities/asset-face.entity';
|
||||
import { AssetEntity, AssetType } from 'src/infra/entities/asset.entity';
|
||||
import { AssetFaceEntity } from 'src/entities/asset-face.entity';
|
||||
import { AssetEntity, AssetType } from 'src/entities/asset.entity';
|
||||
|
||||
export class SanitizedAssetResponseDto {
|
||||
id!: string;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { ExifEntity } from 'src/infra/entities/exif.entity';
|
||||
import { ExifEntity } from 'src/entities/exif.entity';
|
||||
|
||||
export class ExifResponseDto {
|
||||
make?: string | null = null;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { SmartInfoEntity } from 'src/infra/entities/smart-info.entity';
|
||||
import { SmartInfoEntity } from 'src/entities/smart-info.entity';
|
||||
|
||||
export class SmartInfoResponseDto {
|
||||
tags?: string[] | null;
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsArray, IsEnum, IsString, IsUUID, ValidateNested } from 'class-validator';
|
||||
import { EntityType } from 'src/infra/entities/audit.entity';
|
||||
import { AssetPathType, PathType, PersonPathType, UserPathType } from 'src/infra/entities/move.entity';
|
||||
import { EntityType } from 'src/entities/audit.entity';
|
||||
import { AssetPathType, PathType, PersonPathType, UserPathType } from 'src/entities/move.entity';
|
||||
import { Optional, ValidateDate, ValidateUUID } from 'src/validation';
|
||||
|
||||
const PathEnum = Object.values({ ...AssetPathType, ...PersonPathType, ...UserPathType });
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { AuditService } from 'src/domain/audit/audit.service';
|
||||
import { DatabaseAction, EntityType } from 'src/infra/entities/audit.entity';
|
||||
import { DatabaseAction, EntityType } from 'src/entities/audit.entity';
|
||||
import { IAssetRepository } from 'src/interfaces/asset.repository';
|
||||
import { IAuditRepository } from 'src/interfaces/audit.repository';
|
||||
import { ICryptoRepository } from 'src/interfaces/crypto.repository';
|
||||
|
@ -14,8 +14,8 @@ import {
|
||||
import { AuthDto } from 'src/domain/auth/auth.dto';
|
||||
import { AUDIT_LOG_MAX_DURATION } from 'src/domain/domain.constant';
|
||||
import { JOBS_ASSET_PAGINATION_SIZE } from 'src/domain/job/job.constants';
|
||||
import { DatabaseAction } from 'src/infra/entities/audit.entity';
|
||||
import { AssetPathType, PersonPathType, UserPathType } from 'src/infra/entities/move.entity';
|
||||
import { DatabaseAction } from 'src/entities/audit.entity';
|
||||
import { AssetPathType, PersonPathType, UserPathType } from 'src/entities/move.entity';
|
||||
import { ImmichLogger } from 'src/infra/logger';
|
||||
import { IAccessRepository } from 'src/interfaces/access.repository';
|
||||
import { IAssetRepository } from 'src/interfaces/asset.repository';
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Transform } from 'class-transformer';
|
||||
import { IsEmail, IsNotEmpty, IsString, MinLength } from 'class-validator';
|
||||
import { APIKeyEntity } from 'src/infra/entities/api-key.entity';
|
||||
import { SharedLinkEntity } from 'src/infra/entities/shared-link.entity';
|
||||
import { UserTokenEntity } from 'src/infra/entities/user-token.entity';
|
||||
import { UserEntity } from 'src/infra/entities/user.entity';
|
||||
import { APIKeyEntity } from 'src/entities/api-key.entity';
|
||||
import { SharedLinkEntity } from 'src/entities/shared-link.entity';
|
||||
import { UserTokenEntity } from 'src/entities/user-token.entity';
|
||||
import { UserEntity } from 'src/entities/user.entity';
|
||||
|
||||
export class AuthDto {
|
||||
user!: UserEntity;
|
||||
|
@ -5,7 +5,7 @@ import { Socket } from 'socket.io';
|
||||
import { AuthType } from 'src/domain/auth/auth.constant';
|
||||
import { AuthDto, SignUpDto } from 'src/domain/auth/auth.dto';
|
||||
import { AuthService } from 'src/domain/auth/auth.service';
|
||||
import { UserEntity } from 'src/infra/entities/user.entity';
|
||||
import { UserEntity } from 'src/entities/user.entity';
|
||||
import { IKeyRepository } from 'src/interfaces/api-key.repository';
|
||||
import { ICryptoRepository } from 'src/interfaces/crypto.repository';
|
||||
import { ILibraryRepository } from 'src/interfaces/library.repository';
|
||||
|
@ -37,8 +37,8 @@ import {
|
||||
mapUserToken,
|
||||
} from 'src/domain/auth/auth.dto';
|
||||
import { UserResponseDto, mapUser } from 'src/domain/user/response-dto/user-response.dto';
|
||||
import { SystemConfig } from 'src/infra/entities/system-config.entity';
|
||||
import { UserEntity } from 'src/infra/entities/user.entity';
|
||||
import { SystemConfig } from 'src/entities/system-config.entity';
|
||||
import { UserEntity } from 'src/entities/user.entity';
|
||||
import { ImmichLogger } from 'src/infra/logger';
|
||||
import { IAccessRepository } from 'src/interfaces/access.repository';
|
||||
import { IKeyRepository } from 'src/interfaces/api-key.repository';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Duration } from 'luxon';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { extname, join } from 'node:path';
|
||||
import { AssetType } from 'src/infra/entities/asset.entity';
|
||||
import { AssetType } from 'src/entities/asset.entity';
|
||||
|
||||
export const AUDIT_LOG_MAX_DURATION = Duration.fromObject({ days: 100 });
|
||||
export const ONE_HOUR = Duration.fromObject({ hours: 1 });
|
||||
|
@ -5,7 +5,7 @@ import { AssetIdsDto } from 'src/domain/asset/dto/asset-ids.dto';
|
||||
import { AuthDto } from 'src/domain/auth/auth.dto';
|
||||
import { mimeTypes } from 'src/domain/domain.constant';
|
||||
import { DownloadArchiveInfo, DownloadInfoDto, DownloadResponseDto } from 'src/domain/download/download.dto';
|
||||
import { AssetEntity } from 'src/infra/entities/asset.entity';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { IAccessRepository } from 'src/interfaces/access.repository';
|
||||
import { IAssetRepository } from 'src/interfaces/asset.repository';
|
||||
import { IStorageRepository, ImmichReadStream } from 'src/interfaces/storage.repository';
|
||||
|
@ -2,7 +2,7 @@ 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/infra/entities/system-config.entity';
|
||||
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';
|
||||
|
@ -3,7 +3,7 @@ import { FeatureFlag, SystemConfigCore } from 'src/cores/system-config.core';
|
||||
import { mapAsset } from 'src/domain/asset/response-dto/asset-response.dto';
|
||||
import { ConcurrentQueueName, JobCommand, JobName, QueueName } from 'src/domain/job/job.constants';
|
||||
import { AllJobStatusResponseDto, JobCommandDto, JobStatusDto } from 'src/domain/job/job.dto';
|
||||
import { AssetType } from 'src/infra/entities/asset.entity';
|
||||
import { AssetType } from 'src/entities/asset.entity';
|
||||
import { ImmichLogger } from 'src/infra/logger';
|
||||
import { IAssetRepository } from 'src/interfaces/asset.repository';
|
||||
import { ClientEvent, ICommunicationRepository } from 'src/interfaces/communication.repository';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { ArrayMaxSize, ArrayUnique, IsEnum, IsNotEmpty, IsString } from 'class-validator';
|
||||
import { LibraryEntity, LibraryType } from 'src/infra/entities/library.entity';
|
||||
import { LibraryEntity, LibraryType } from 'src/entities/library.entity';
|
||||
import { Optional, ValidateBoolean, ValidateUUID } from 'src/validation';
|
||||
|
||||
export class CreateLibraryDto {
|
||||
|
@ -7,10 +7,10 @@ import { JobName } from 'src/domain/job/job.constants';
|
||||
import { ILibraryFileJob, ILibraryRefreshJob } from 'src/domain/job/job.interface';
|
||||
import { mapLibrary } from 'src/domain/library/library.dto';
|
||||
import { LibraryService } from 'src/domain/library/library.service';
|
||||
import { AssetType } from 'src/infra/entities/asset.entity';
|
||||
import { LibraryType } from 'src/infra/entities/library.entity';
|
||||
import { SystemConfig, SystemConfigKey } from 'src/infra/entities/system-config.entity';
|
||||
import { UserEntity } from 'src/infra/entities/user.entity';
|
||||
import { AssetType } from 'src/entities/asset.entity';
|
||||
import { LibraryType } from 'src/entities/library.entity';
|
||||
import { SystemConfig, SystemConfigKey } from 'src/entities/system-config.entity';
|
||||
import { UserEntity } from 'src/entities/user.entity';
|
||||
import { IAssetRepository } from 'src/interfaces/asset.repository';
|
||||
import { ICryptoRepository } from 'src/interfaces/crypto.repository';
|
||||
import { IDatabaseRepository } from 'src/interfaces/database.repository';
|
||||
|
@ -23,8 +23,8 @@ import {
|
||||
ValidateLibraryResponseDto,
|
||||
mapLibrary,
|
||||
} from 'src/domain/library/library.dto';
|
||||
import { AssetType } from 'src/infra/entities/asset.entity';
|
||||
import { LibraryEntity, LibraryType } from 'src/infra/entities/library.entity';
|
||||
import { AssetType } from 'src/entities/asset.entity';
|
||||
import { LibraryEntity, LibraryType } from 'src/entities/library.entity';
|
||||
import { ImmichLogger } from 'src/infra/logger';
|
||||
import { IAssetRepository, WithProperty } from 'src/interfaces/asset.repository';
|
||||
import { InternalEvent, InternalEventMap } from 'src/interfaces/communication.repository';
|
||||
|
@ -1,8 +1,8 @@
|
||||
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/infra/entities/asset.entity';
|
||||
import { ExifEntity } from 'src/infra/entities/exif.entity';
|
||||
import { AssetType } from 'src/entities/asset.entity';
|
||||
import { ExifEntity } from 'src/entities/exif.entity';
|
||||
import {
|
||||
AudioCodec,
|
||||
Colorspace,
|
||||
@ -11,7 +11,7 @@ import {
|
||||
TranscodeHWAccel,
|
||||
TranscodePolicy,
|
||||
VideoCodec,
|
||||
} from 'src/infra/entities/system-config.entity';
|
||||
} from 'src/entities/system-config.entity';
|
||||
import { IAssetRepository, WithoutProperty } from 'src/interfaces/asset.repository';
|
||||
import { ICryptoRepository } from 'src/interfaces/crypto.repository';
|
||||
import { IJobRepository, JobStatus } from 'src/interfaces/job.repository';
|
||||
|
@ -14,8 +14,8 @@ import {
|
||||
VP9Config,
|
||||
} from 'src/domain/media/media.util';
|
||||
import { SystemConfigFFmpegDto } from 'src/domain/system-config/dto/system-config-ffmpeg.dto';
|
||||
import { AssetEntity, AssetType } from 'src/infra/entities/asset.entity';
|
||||
import { AssetPathType } from 'src/infra/entities/move.entity';
|
||||
import { AssetEntity, AssetType } from 'src/entities/asset.entity';
|
||||
import { AssetPathType } from 'src/entities/move.entity';
|
||||
import {
|
||||
AudioCodec,
|
||||
Colorspace,
|
||||
@ -23,7 +23,7 @@ import {
|
||||
TranscodePolicy,
|
||||
TranscodeTarget,
|
||||
VideoCodec,
|
||||
} from 'src/infra/entities/system-config.entity';
|
||||
} from 'src/entities/system-config.entity';
|
||||
import { ImmichLogger } from 'src/infra/logger';
|
||||
import { IAssetRepository, WithoutProperty } from 'src/interfaces/asset.repository';
|
||||
import { ICryptoRepository } from 'src/interfaces/crypto.repository';
|
||||
|
@ -1,11 +1,5 @@
|
||||
import { SystemConfigFFmpegDto } from 'src/domain/system-config/dto/system-config-ffmpeg.dto';
|
||||
import {
|
||||
CQMode,
|
||||
ToneMapping,
|
||||
TranscodeHWAccel,
|
||||
TranscodeTarget,
|
||||
VideoCodec,
|
||||
} from 'src/infra/entities/system-config.entity';
|
||||
import { CQMode, ToneMapping, TranscodeHWAccel, TranscodeTarget, VideoCodec } from 'src/entities/system-config.entity';
|
||||
import {
|
||||
AudioStreamInfo,
|
||||
BitrateDistribution,
|
||||
|
@ -5,9 +5,9 @@ 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/infra/entities/asset.entity';
|
||||
import { ExifEntity } from 'src/infra/entities/exif.entity';
|
||||
import { SystemConfigKey } from 'src/infra/entities/system-config.entity';
|
||||
import { AssetType } from 'src/entities/asset.entity';
|
||||
import { ExifEntity } from 'src/entities/exif.entity';
|
||||
import { SystemConfigKey } from 'src/entities/system-config.entity';
|
||||
import { IAlbumRepository } from 'src/interfaces/album.repository';
|
||||
import { IAssetRepository, WithoutProperty } from 'src/interfaces/asset.repository';
|
||||
import { ClientEvent, ICommunicationRepository } from 'src/interfaces/communication.repository';
|
||||
|
@ -10,8 +10,8 @@ import { StorageCore } from 'src/cores/storage.core';
|
||||
import { FeatureFlag, SystemConfigCore } from 'src/cores/system-config.core';
|
||||
import { JOBS_ASSET_PAGINATION_SIZE, JobName, QueueName } from 'src/domain/job/job.constants';
|
||||
import { IBaseJob, IEntityJob, ISidecarWriteJob } from 'src/domain/job/job.interface';
|
||||
import { AssetEntity, AssetType } from 'src/infra/entities/asset.entity';
|
||||
import { ExifEntity } from 'src/infra/entities/exif.entity';
|
||||
import { AssetEntity, AssetType } from 'src/entities/asset.entity';
|
||||
import { ExifEntity } from 'src/entities/exif.entity';
|
||||
import { ImmichLogger } from 'src/infra/logger';
|
||||
import { IAlbumRepository } from 'src/interfaces/album.repository';
|
||||
import { IAssetRepository, WithoutProperty } from 'src/interfaces/asset.repository';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { BadRequestException } from '@nestjs/common';
|
||||
import { PartnerResponseDto } from 'src/domain/partner/partner.dto';
|
||||
import { PartnerService } from 'src/domain/partner/partner.service';
|
||||
import { UserAvatarColor } from 'src/infra/entities/user.entity';
|
||||
import { UserAvatarColor } from 'src/entities/user.entity';
|
||||
import { IAccessRepository } from 'src/interfaces/access.repository';
|
||||
import { IPartnerRepository, PartnerDirection } from 'src/interfaces/partner.repository';
|
||||
import { authStub } from 'test/fixtures/auth.stub';
|
||||
|
@ -3,7 +3,7 @@ import { AccessCore, Permission } from 'src/cores/access.core';
|
||||
import { AuthDto } from 'src/domain/auth/auth.dto';
|
||||
import { PartnerResponseDto, UpdatePartnerDto } from 'src/domain/partner/partner.dto';
|
||||
import { mapUser } from 'src/domain/user/response-dto/user-response.dto';
|
||||
import { PartnerEntity } from 'src/infra/entities/partner.entity';
|
||||
import { PartnerEntity } from 'src/entities/partner.entity';
|
||||
import { IAccessRepository } from 'src/interfaces/access.repository';
|
||||
import { IPartnerRepository, PartnerDirection, PartnerIds } from 'src/interfaces/partner.repository';
|
||||
|
||||
|
@ -2,8 +2,8 @@ import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsArray, IsNotEmpty, IsString, MaxDate, ValidateNested } from 'class-validator';
|
||||
import { AuthDto } from 'src/domain/auth/auth.dto';
|
||||
import { AssetFaceEntity } from 'src/infra/entities/asset-face.entity';
|
||||
import { PersonEntity } from 'src/infra/entities/person.entity';
|
||||
import { AssetFaceEntity } from 'src/entities/asset-face.entity';
|
||||
import { PersonEntity } from 'src/entities/person.entity';
|
||||
import { Optional, ValidateBoolean, ValidateDate, ValidateUUID } from 'src/validation';
|
||||
|
||||
export class PersonCreateDto {
|
||||
|
@ -3,8 +3,8 @@ import { BulkIdErrorReason } from 'src/domain/asset/response-dto/asset-ids-respo
|
||||
import { JobName } from 'src/domain/job/job.constants';
|
||||
import { PersonResponseDto, mapFaces, mapPerson } from 'src/domain/person/person.dto';
|
||||
import { PersonService } from 'src/domain/person/person.service';
|
||||
import { AssetFaceEntity } from 'src/infra/entities/asset-face.entity';
|
||||
import { Colorspace, SystemConfigKey } from 'src/infra/entities/system-config.entity';
|
||||
import { AssetFaceEntity } from 'src/entities/asset-face.entity';
|
||||
import { Colorspace, SystemConfigKey } from 'src/entities/system-config.entity';
|
||||
import { IAssetRepository, WithoutProperty } from 'src/interfaces/asset.repository';
|
||||
import { ICryptoRepository } from 'src/interfaces/crypto.repository';
|
||||
import { IJobRepository, JobStatus } from 'src/interfaces/job.repository';
|
||||
|
@ -24,8 +24,8 @@ import {
|
||||
mapFaces,
|
||||
mapPerson,
|
||||
} from 'src/domain/person/person.dto';
|
||||
import { PersonPathType } from 'src/infra/entities/move.entity';
|
||||
import { PersonEntity } from 'src/infra/entities/person.entity';
|
||||
import { PersonPathType } from 'src/entities/move.entity';
|
||||
import { PersonEntity } from 'src/entities/person.entity';
|
||||
import { ImmichLogger } from 'src/infra/logger';
|
||||
import { IAccessRepository } from 'src/interfaces/access.repository';
|
||||
import { IAssetRepository, WithoutProperty } from 'src/interfaces/asset.repository';
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsEnum, IsInt, IsNotEmpty, IsString, Max, Min } from 'class-validator';
|
||||
import { AssetOrder } from 'src/infra/entities/album.entity';
|
||||
import { AssetType } from 'src/infra/entities/asset.entity';
|
||||
import { GeodataPlacesEntity } from 'src/infra/entities/geodata-places.entity';
|
||||
import { AssetOrder } from 'src/entities/album.entity';
|
||||
import { AssetType } from 'src/entities/asset.entity';
|
||||
import { GeodataPlacesEntity } from 'src/entities/geodata-places.entity';
|
||||
import { Optional, ValidateBoolean, ValidateDate, ValidateUUID } from 'src/validation';
|
||||
|
||||
class BaseSearchDto {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { mapAsset } from 'src/domain/asset/response-dto/asset-response.dto';
|
||||
import { SearchDto } from 'src/domain/search/dto/search.dto';
|
||||
import { SearchService } from 'src/domain/search/search.service';
|
||||
import { SystemConfigKey } from 'src/infra/entities/system-config.entity';
|
||||
import { SystemConfigKey } from 'src/entities/system-config.entity';
|
||||
import { IAssetRepository } from 'src/interfaces/asset.repository';
|
||||
import { IMachineLearningRepository } from 'src/interfaces/machine-learning.repository';
|
||||
import { IMetadataRepository } from 'src/interfaces/metadata.repository';
|
||||
|
@ -14,8 +14,8 @@ import {
|
||||
mapPlaces,
|
||||
} from 'src/domain/search/dto/search.dto';
|
||||
import { SearchResponseDto } from 'src/domain/search/response-dto/search-response.dto';
|
||||
import { AssetOrder } from 'src/infra/entities/album.entity';
|
||||
import { AssetEntity } from 'src/infra/entities/asset.entity';
|
||||
import { AssetOrder } from 'src/entities/album.entity';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { IAssetRepository } from 'src/interfaces/asset.repository';
|
||||
import { IMachineLearningRepository } from 'src/interfaces/machine-learning.repository';
|
||||
import { IMetadataRepository } from 'src/interfaces/metadata.repository';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { serverVersion } from 'src/domain/domain.constant';
|
||||
import { ServerInfoService } from 'src/domain/server-info/server-info.service';
|
||||
import { SystemMetadataKey } from 'src/infra/entities/system-metadata.entity';
|
||||
import { SystemMetadataKey } from 'src/entities/system-metadata.entity';
|
||||
import { ICommunicationRepository } from 'src/interfaces/communication.repository';
|
||||
import { IServerInfoRepository } from 'src/interfaces/server-info.repository';
|
||||
import { IStorageRepository } from 'src/interfaces/storage.repository';
|
||||
|
@ -12,7 +12,7 @@ import {
|
||||
ServerStatsResponseDto,
|
||||
UsageByUserDto,
|
||||
} from 'src/domain/server-info/server-info.dto';
|
||||
import { SystemMetadataKey } from 'src/infra/entities/system-metadata.entity';
|
||||
import { SystemMetadataKey } from 'src/entities/system-metadata.entity';
|
||||
import { ImmichLogger } from 'src/infra/logger';
|
||||
import { ClientEvent, ICommunicationRepository } from 'src/interfaces/communication.repository';
|
||||
import { IServerInfoRepository } from 'src/interfaces/server-info.repository';
|
||||
|
@ -2,7 +2,7 @@ import { ApiProperty } from '@nestjs/swagger';
|
||||
import _ from 'lodash';
|
||||
import { AlbumResponseDto, mapAlbumWithoutAssets } from 'src/domain/album/album-response.dto';
|
||||
import { AssetResponseDto, mapAsset } from 'src/domain/asset/response-dto/asset-response.dto';
|
||||
import { SharedLinkEntity, SharedLinkType } from 'src/infra/entities/shared-link.entity';
|
||||
import { SharedLinkEntity, SharedLinkType } from 'src/entities/shared-link.entity';
|
||||
|
||||
export class SharedLinkResponseDto {
|
||||
id!: string;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsEnum, IsString } from 'class-validator';
|
||||
import { SharedLinkType } from 'src/infra/entities/shared-link.entity';
|
||||
import { SharedLinkType } from 'src/entities/shared-link.entity';
|
||||
import { Optional, ValidateBoolean, ValidateDate, ValidateUUID } from 'src/validation';
|
||||
|
||||
export class SharedLinkCreateDto {
|
||||
|
@ -2,7 +2,7 @@ import { BadRequestException, ForbiddenException, UnauthorizedException } from '
|
||||
import _ from 'lodash';
|
||||
import { AssetIdErrorReason } from 'src/domain/asset/response-dto/asset-ids-response.dto';
|
||||
import { SharedLinkService } from 'src/domain/shared-link/shared-link.service';
|
||||
import { SharedLinkType } from 'src/infra/entities/shared-link.entity';
|
||||
import { SharedLinkType } from 'src/entities/shared-link.entity';
|
||||
import { ICryptoRepository } from 'src/interfaces/crypto.repository';
|
||||
import { ISharedLinkRepository } from 'src/interfaces/shared-link.repository';
|
||||
import { albumStub } from 'test/fixtures/album.stub';
|
||||
|
@ -9,8 +9,8 @@ import {
|
||||
mapSharedLinkWithoutMetadata,
|
||||
} from 'src/domain/shared-link/shared-link-response.dto';
|
||||
import { SharedLinkCreateDto, SharedLinkEditDto, SharedLinkPasswordDto } from 'src/domain/shared-link/shared-link.dto';
|
||||
import { AssetEntity } from 'src/infra/entities/asset.entity';
|
||||
import { SharedLinkEntity, SharedLinkType } from 'src/infra/entities/shared-link.entity';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { SharedLinkEntity, SharedLinkType } from 'src/entities/shared-link.entity';
|
||||
import { IAccessRepository } from 'src/interfaces/access.repository';
|
||||
import { ICryptoRepository } from 'src/interfaces/crypto.repository';
|
||||
import { ISharedLinkRepository } from 'src/interfaces/shared-link.repository';
|
||||
|
@ -1,8 +1,8 @@
|
||||
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/infra/entities/asset.entity';
|
||||
import { SystemConfigKey } from 'src/infra/entities/system-config.entity';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { SystemConfigKey } from 'src/entities/system-config.entity';
|
||||
import { IAssetRepository, WithoutProperty } from 'src/interfaces/asset.repository';
|
||||
import { IDatabaseRepository } from 'src/interfaces/database.repository';
|
||||
import { IJobRepository } from 'src/interfaces/job.repository';
|
||||
|
@ -2,8 +2,8 @@ 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/infra/entities/move.entity';
|
||||
import { SystemConfig, SystemConfigKey } from 'src/infra/entities/system-config.entity';
|
||||
import { AssetPathType } from 'src/entities/move.entity';
|
||||
import { SystemConfig, SystemConfigKey } from 'src/entities/system-config.entity';
|
||||
import { IAlbumRepository } from 'src/interfaces/album.repository';
|
||||
import { IAssetRepository } from 'src/interfaces/asset.repository';
|
||||
import { ICryptoRepository } from 'src/interfaces/crypto.repository';
|
||||
|
@ -17,9 +17,9 @@ import {
|
||||
supportedWeekTokens,
|
||||
supportedYearTokens,
|
||||
} from 'src/domain/system-config/system-config.constants';
|
||||
import { AssetEntity, AssetType } from 'src/infra/entities/asset.entity';
|
||||
import { AssetPathType } from 'src/infra/entities/move.entity';
|
||||
import { SystemConfig } from 'src/infra/entities/system-config.entity';
|
||||
import { AssetEntity, AssetType } from 'src/entities/asset.entity';
|
||||
import { AssetPathType } from 'src/entities/move.entity';
|
||||
import { SystemConfig } from 'src/entities/system-config.entity';
|
||||
import { ImmichLogger } from 'src/infra/logger';
|
||||
import { IAlbumRepository } from 'src/interfaces/album.repository';
|
||||
import { IAssetRepository } from 'src/interfaces/asset.repository';
|
||||
|
@ -8,7 +8,7 @@ import {
|
||||
TranscodeHWAccel,
|
||||
TranscodePolicy,
|
||||
VideoCodec,
|
||||
} from 'src/infra/entities/system-config.entity';
|
||||
} from 'src/entities/system-config.entity';
|
||||
import { ValidateBoolean } from 'src/validation';
|
||||
|
||||
export class SystemConfigFFmpegDto {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsEnum } from 'class-validator';
|
||||
import { LogLevel } from 'src/infra/entities/system-config.entity';
|
||||
import { LogLevel } from 'src/entities/system-config.entity';
|
||||
import { ValidateBoolean } from 'src/validation';
|
||||
|
||||
export class SystemConfigLoggingDto {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsEnum, IsInt, Max, Min } from 'class-validator';
|
||||
import { Colorspace } from 'src/infra/entities/system-config.entity';
|
||||
import { Colorspace } from 'src/entities/system-config.entity';
|
||||
|
||||
export class SystemConfigThumbnailDto {
|
||||
@IsInt()
|
||||
|
@ -16,7 +16,7 @@ import { SystemConfigThemeDto } from 'src/domain/system-config/dto/system-config
|
||||
import { SystemConfigThumbnailDto } from 'src/domain/system-config/dto/system-config-thumbnail.dto';
|
||||
import { SystemConfigTrashDto } from 'src/domain/system-config/dto/system-config-trash.dto';
|
||||
import { SystemConfigUserDto } from 'src/domain/system-config/dto/system-config-user.dto';
|
||||
import { SystemConfig } from 'src/infra/entities/system-config.entity';
|
||||
import { SystemConfig } from 'src/entities/system-config.entity';
|
||||
|
||||
export class SystemConfigDto implements SystemConfig {
|
||||
@Type(() => SystemConfigFFmpegDto)
|
||||
|
@ -14,7 +14,7 @@ import {
|
||||
TranscodeHWAccel,
|
||||
TranscodePolicy,
|
||||
VideoCodec,
|
||||
} from 'src/infra/entities/system-config.entity';
|
||||
} from 'src/entities/system-config.entity';
|
||||
import { ImmichLogger } from 'src/infra/logger';
|
||||
import { ICommunicationRepository, ServerEvent } from 'src/interfaces/communication.repository';
|
||||
import { ISearchRepository } from 'src/interfaces/search.repository';
|
||||
|
@ -15,7 +15,7 @@ import {
|
||||
supportedWeekTokens,
|
||||
supportedYearTokens,
|
||||
} from 'src/domain/system-config/system-config.constants';
|
||||
import { LogLevel, SystemConfig } from 'src/infra/entities/system-config.entity';
|
||||
import { LogLevel, SystemConfig } from 'src/entities/system-config.entity';
|
||||
import { ImmichLogger } from 'src/infra/logger';
|
||||
import {
|
||||
ClientEvent,
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { TagEntity, TagType } from 'src/infra/entities/tag.entity';
|
||||
import { TagEntity, TagType } from 'src/entities/tag.entity';
|
||||
|
||||
export class TagResponseDto {
|
||||
id!: string;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsEnum, IsNotEmpty, IsString } from 'class-validator';
|
||||
import { TagType } from 'src/infra/entities/tag.entity';
|
||||
import { TagType } from 'src/entities/tag.entity';
|
||||
import { Optional } from 'src/validation';
|
||||
|
||||
export class CreateTagDto {
|
||||
|
@ -2,7 +2,7 @@ import { BadRequestException } from '@nestjs/common';
|
||||
import { when } from 'jest-when';
|
||||
import { AssetIdErrorReason } from 'src/domain/asset/response-dto/asset-ids-response.dto';
|
||||
import { TagService } from 'src/domain/tag/tag.service';
|
||||
import { TagType } from 'src/infra/entities/tag.entity';
|
||||
import { TagType } from 'src/entities/tag.entity';
|
||||
import { ITagRepository } from 'src/interfaces/tag.repository';
|
||||
import { assetStub } from 'test/fixtures/asset.stub';
|
||||
import { authStub } from 'test/fixtures/auth.stub';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Transform } from 'class-transformer';
|
||||
import { IsEmail, IsEnum, IsNotEmpty, IsNumber, IsPositive, IsString, IsUUID } from 'class-validator';
|
||||
import { UserAvatarColor } from 'src/infra/entities/user.entity';
|
||||
import { UserAvatarColor } from 'src/entities/user.entity';
|
||||
import { Optional, ValidateBoolean, toEmail, toSanitized } from 'src/validation';
|
||||
|
||||
export class UpdateUserDto {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsEnum } from 'class-validator';
|
||||
import { UserAvatarColor, UserEntity, UserStatus } from 'src/infra/entities/user.entity';
|
||||
import { UserAvatarColor, UserEntity, UserStatus } from 'src/entities/user.entity';
|
||||
|
||||
export const getRandomAvatarColor = (user: UserEntity): UserAvatarColor => {
|
||||
const values = Object.values(UserAvatarColor);
|
||||
|
@ -9,7 +9,7 @@ import { JobName } from 'src/domain/job/job.constants';
|
||||
import { UpdateUserDto } from 'src/domain/user/dto/update-user.dto';
|
||||
import { mapUser } from 'src/domain/user/response-dto/user-response.dto';
|
||||
import { UserService } from 'src/domain/user/user.service';
|
||||
import { UserEntity, UserStatus } from 'src/infra/entities/user.entity';
|
||||
import { UserEntity, UserStatus } from 'src/entities/user.entity';
|
||||
import { IAlbumRepository } from 'src/interfaces/album.repository';
|
||||
import { ICryptoRepository } from 'src/interfaces/crypto.repository';
|
||||
import { IJobRepository } from 'src/interfaces/job.repository';
|
||||
|
@ -15,7 +15,7 @@ import {
|
||||
mapCreateProfileImageResponse,
|
||||
} from 'src/domain/user/response-dto/create-profile-image-response.dto';
|
||||
import { UserResponseDto, mapUser } from 'src/domain/user/response-dto/user-response.dto';
|
||||
import { UserEntity, UserStatus } from 'src/infra/entities/user.entity';
|
||||
import { UserEntity, UserStatus } from 'src/entities/user.entity';
|
||||
import { ImmichLogger } from 'src/infra/logger';
|
||||
import { IAlbumRepository } from 'src/interfaces/album.repository';
|
||||
import { ICryptoRepository } from 'src/interfaces/crypto.repository';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { AlbumEntity } from 'src/infra/entities/album.entity';
|
||||
import { AssetEntity } from 'src/infra/entities/asset.entity';
|
||||
import { UserEntity } from 'src/infra/entities/user.entity';
|
||||
import { AlbumEntity } from 'src/entities/album.entity';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { UserEntity } from 'src/entities/user.entity';
|
||||
import {
|
||||
Check,
|
||||
Column,
|
@ -1,6 +1,6 @@
|
||||
import { AssetEntity } from 'src/infra/entities/asset.entity';
|
||||
import { SharedLinkEntity } from 'src/infra/entities/shared-link.entity';
|
||||
import { UserEntity } from 'src/infra/entities/user.entity';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { SharedLinkEntity } from 'src/entities/shared-link.entity';
|
||||
import { UserEntity } from 'src/entities/user.entity';
|
||||
import {
|
||||
Column,
|
||||
CreateDateColumn,
|
@ -1,4 +1,4 @@
|
||||
import { UserEntity } from 'src/infra/entities/user.entity';
|
||||
import { UserEntity } from 'src/entities/user.entity';
|
||||
import { Column, CreateDateColumn, Entity, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
|
||||
|
||||
@Entity('api_keys')
|
@ -1,5 +1,5 @@
|
||||
import { AssetEntity } from 'src/infra/entities/asset.entity';
|
||||
import { PersonEntity } from 'src/infra/entities/person.entity';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { PersonEntity } from 'src/entities/person.entity';
|
||||
import { Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
@Entity('asset_faces', { synchronize: false })
|
@ -1,4 +1,4 @@
|
||||
import { AssetEntity } from 'src/infra/entities/asset.entity';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { Column, Entity, JoinColumn, OneToOne, PrimaryColumn } from 'typeorm';
|
||||
|
||||
@Entity('asset_job_status')
|
@ -1,4 +1,4 @@
|
||||
import { AssetEntity } from 'src/infra/entities/asset.entity';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { Column, Entity, JoinColumn, OneToMany, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
@Entity('asset_stack')
|
@ -1,14 +1,14 @@
|
||||
import { AlbumEntity } from 'src/infra/entities/album.entity';
|
||||
import { AssetFaceEntity } from 'src/infra/entities/asset-face.entity';
|
||||
import { AssetJobStatusEntity } from 'src/infra/entities/asset-job-status.entity';
|
||||
import { AssetStackEntity } from 'src/infra/entities/asset-stack.entity';
|
||||
import { ExifEntity } from 'src/infra/entities/exif.entity';
|
||||
import { LibraryEntity } from 'src/infra/entities/library.entity';
|
||||
import { SharedLinkEntity } from 'src/infra/entities/shared-link.entity';
|
||||
import { SmartInfoEntity } from 'src/infra/entities/smart-info.entity';
|
||||
import { SmartSearchEntity } from 'src/infra/entities/smart-search.entity';
|
||||
import { TagEntity } from 'src/infra/entities/tag.entity';
|
||||
import { UserEntity } from 'src/infra/entities/user.entity';
|
||||
import { AlbumEntity } from 'src/entities/album.entity';
|
||||
import { AssetFaceEntity } from 'src/entities/asset-face.entity';
|
||||
import { AssetJobStatusEntity } from 'src/entities/asset-job-status.entity';
|
||||
import { AssetStackEntity } from 'src/entities/asset-stack.entity';
|
||||
import { ExifEntity } from 'src/entities/exif.entity';
|
||||
import { LibraryEntity } from 'src/entities/library.entity';
|
||||
import { SharedLinkEntity } from 'src/entities/shared-link.entity';
|
||||
import { SmartInfoEntity } from 'src/entities/smart-info.entity';
|
||||
import { SmartSearchEntity } from 'src/entities/smart-search.entity';
|
||||
import { TagEntity } from 'src/entities/tag.entity';
|
||||
import { UserEntity } from 'src/entities/user.entity';
|
||||
import {
|
||||
Column,
|
||||
CreateDateColumn,
|
@ -1,4 +1,4 @@
|
||||
import { AssetEntity } from 'src/infra/entities/asset.entity';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { Index, JoinColumn, OneToOne, PrimaryColumn } from 'typeorm';
|
||||
import { Column } from 'typeorm/decorator/columns/Column.js';
|
||||
import { Entity } from 'typeorm/decorator/entity/Entity.js';
|
47
server/src/entities/index.ts
Normal file
47
server/src/entities/index.ts
Normal file
@ -0,0 +1,47 @@
|
||||
import { ActivityEntity } from 'src/entities/activity.entity';
|
||||
import { AlbumEntity } from 'src/entities/album.entity';
|
||||
import { APIKeyEntity } from 'src/entities/api-key.entity';
|
||||
import { AssetFaceEntity } from 'src/entities/asset-face.entity';
|
||||
import { AssetJobStatusEntity } from 'src/entities/asset-job-status.entity';
|
||||
import { AssetStackEntity } from 'src/entities/asset-stack.entity';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { AuditEntity } from 'src/entities/audit.entity';
|
||||
import { ExifEntity } from 'src/entities/exif.entity';
|
||||
import { GeodataPlacesEntity } from 'src/entities/geodata-places.entity';
|
||||
import { LibraryEntity } from 'src/entities/library.entity';
|
||||
import { MoveEntity } from 'src/entities/move.entity';
|
||||
import { PartnerEntity } from 'src/entities/partner.entity';
|
||||
import { PersonEntity } from 'src/entities/person.entity';
|
||||
import { SharedLinkEntity } from 'src/entities/shared-link.entity';
|
||||
import { SmartInfoEntity } from 'src/entities/smart-info.entity';
|
||||
import { SmartSearchEntity } from 'src/entities/smart-search.entity';
|
||||
import { SystemConfigEntity } from 'src/entities/system-config.entity';
|
||||
import { SystemMetadataEntity } from 'src/entities/system-metadata.entity';
|
||||
import { TagEntity } from 'src/entities/tag.entity';
|
||||
import { UserTokenEntity } from 'src/entities/user-token.entity';
|
||||
import { UserEntity } from 'src/entities/user.entity';
|
||||
|
||||
export const databaseEntities = [
|
||||
ActivityEntity,
|
||||
AlbumEntity,
|
||||
APIKeyEntity,
|
||||
AssetEntity,
|
||||
AssetStackEntity,
|
||||
AssetFaceEntity,
|
||||
AssetJobStatusEntity,
|
||||
AuditEntity,
|
||||
ExifEntity,
|
||||
GeodataPlacesEntity,
|
||||
MoveEntity,
|
||||
PartnerEntity,
|
||||
PersonEntity,
|
||||
SharedLinkEntity,
|
||||
SmartInfoEntity,
|
||||
SmartSearchEntity,
|
||||
SystemConfigEntity,
|
||||
SystemMetadataEntity,
|
||||
TagEntity,
|
||||
UserEntity,
|
||||
UserTokenEntity,
|
||||
LibraryEntity,
|
||||
];
|
@ -1,5 +1,5 @@
|
||||
import { AssetEntity } from 'src/infra/entities/asset.entity';
|
||||
import { UserEntity } from 'src/infra/entities/user.entity';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { UserEntity } from 'src/entities/user.entity';
|
||||
import {
|
||||
Column,
|
||||
CreateDateColumn,
|
@ -1,4 +1,4 @@
|
||||
import { UserEntity } from 'src/infra/entities/user.entity';
|
||||
import { UserEntity } from 'src/entities/user.entity';
|
||||
import { Column, CreateDateColumn, Entity, JoinColumn, ManyToOne, PrimaryColumn, UpdateDateColumn } from 'typeorm';
|
||||
|
||||
@Entity('partners')
|
@ -1,5 +1,5 @@
|
||||
import { AssetFaceEntity } from 'src/infra/entities/asset-face.entity';
|
||||
import { UserEntity } from 'src/infra/entities/user.entity';
|
||||
import { AssetFaceEntity } from 'src/entities/asset-face.entity';
|
||||
import { UserEntity } from 'src/entities/user.entity';
|
||||
import {
|
||||
Check,
|
||||
Column,
|
@ -1,6 +1,6 @@
|
||||
import { AlbumEntity } from 'src/infra/entities/album.entity';
|
||||
import { AssetEntity } from 'src/infra/entities/asset.entity';
|
||||
import { UserEntity } from 'src/infra/entities/user.entity';
|
||||
import { AlbumEntity } from 'src/entities/album.entity';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { UserEntity } from 'src/entities/user.entity';
|
||||
import {
|
||||
Column,
|
||||
CreateDateColumn,
|
@ -1,4 +1,4 @@
|
||||
import { AssetEntity } from 'src/infra/entities/asset.entity';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { Column, Entity, JoinColumn, OneToOne, PrimaryColumn } from 'typeorm';
|
||||
|
||||
@Entity('smart_info', { synchronize: false })
|
@ -1,4 +1,4 @@
|
||||
import { AssetEntity } from 'src/infra/entities/asset.entity';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { Column, Entity, Index, JoinColumn, OneToOne, PrimaryColumn } from 'typeorm';
|
||||
|
||||
@Entity('smart_search', { synchronize: false })
|
@ -1,5 +1,5 @@
|
||||
import { AssetEntity } from 'src/infra/entities/asset.entity';
|
||||
import { UserEntity } from 'src/infra/entities/user.entity';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { UserEntity } from 'src/entities/user.entity';
|
||||
import { Column, Entity, ManyToMany, ManyToOne, PrimaryGeneratedColumn, Unique } from 'typeorm';
|
||||
|
||||
@Entity('tags')
|
@ -1,4 +1,4 @@
|
||||
import { UserEntity } from 'src/infra/entities/user.entity';
|
||||
import { UserEntity } from 'src/entities/user.entity';
|
||||
import { Column, CreateDateColumn, Entity, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
|
||||
|
||||
@Entity('user_token')
|
@ -1,5 +1,5 @@
|
||||
import { AssetEntity } from 'src/infra/entities/asset.entity';
|
||||
import { TagEntity } from 'src/infra/entities/tag.entity';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { TagEntity } from 'src/entities/tag.entity';
|
||||
import {
|
||||
Column,
|
||||
CreateDateColumn,
|
@ -1,6 +1,6 @@
|
||||
import { CommandFactory } from 'nest-commander';
|
||||
import { LogLevel } from 'src/entities/system-config.entity';
|
||||
import { AppModule } from 'src/immich-admin/app.module';
|
||||
import { LogLevel } from 'src/infra/entities/system-config.entity';
|
||||
|
||||
export async function bootstrap() {
|
||||
process.env.LOG_LEVEL = LogLevel.WARN;
|
||||
|
@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { AssetEntity } from 'src/entities/asset.entity';
|
||||
import { ExifEntity } from 'src/entities/exif.entity';
|
||||
import { AssetSearchDto } from 'src/immich/api-v1/asset/dto/asset-search.dto';
|
||||
import { CheckExistingAssetsDto } from 'src/immich/api-v1/asset/dto/check-existing-assets.dto';
|
||||
import { SearchPropertiesDto } from 'src/immich/api-v1/asset/dto/search-properties.dto';
|
||||
import { CuratedLocationsResponseDto } from 'src/immich/api-v1/asset/response-dto/curated-locations-response.dto';
|
||||
import { CuratedObjectsResponseDto } from 'src/immich/api-v1/asset/response-dto/curated-objects-response.dto';
|
||||
import { AssetEntity } from 'src/infra/entities/asset.entity';
|
||||
import { ExifEntity } from 'src/infra/entities/exif.entity';
|
||||
import { OptionalBetween } from 'src/infra/infra.utils';
|
||||
import { In } from 'typeorm/find-options/operator/In.js';
|
||||
import { Repository } from 'typeorm/repository/Repository.js';
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { when } from 'jest-when';
|
||||
import { JobName } from 'src/domain/job/job.constants';
|
||||
import { ASSET_CHECKSUM_CONSTRAINT, AssetEntity, AssetType } from 'src/entities/asset.entity';
|
||||
import { ExifEntity } from 'src/entities/exif.entity';
|
||||
import { IAssetRepositoryV1 } from 'src/immich/api-v1/asset/asset-repository';
|
||||
import { AssetService } from 'src/immich/api-v1/asset/asset.service';
|
||||
import { CreateAssetDto } from 'src/immich/api-v1/asset/dto/create-asset.dto';
|
||||
import { AssetRejectReason, AssetUploadAction } from 'src/immich/api-v1/asset/response-dto/asset-check-response.dto';
|
||||
import { ASSET_CHECKSUM_CONSTRAINT, AssetEntity, AssetType } from 'src/infra/entities/asset.entity';
|
||||
import { ExifEntity } from 'src/infra/entities/exif.entity';
|
||||
import { IAssetRepository } from 'src/interfaces/asset.repository';
|
||||
import { IJobRepository } from 'src/interfaces/job.repository';
|
||||
import { ILibraryRepository } from 'src/interfaces/library.repository';
|
||||
|
@ -11,6 +11,8 @@ import { AssetResponseDto, mapAsset } from 'src/domain/asset/response-dto/asset-
|
||||
import { AuthDto } from 'src/domain/auth/auth.dto';
|
||||
import { mimeTypes } from 'src/domain/domain.constant';
|
||||
import { JobName } from 'src/domain/job/job.constants';
|
||||
import { ASSET_CHECKSUM_CONSTRAINT, AssetEntity, AssetType } from 'src/entities/asset.entity';
|
||||
import { LibraryType } from 'src/entities/library.entity';
|
||||
import { IAssetRepositoryV1 } from 'src/immich/api-v1/asset/asset-repository';
|
||||
import { AssetBulkUploadCheckDto } from 'src/immich/api-v1/asset/dto/asset-check.dto';
|
||||
import { AssetSearchDto } from 'src/immich/api-v1/asset/dto/asset-search.dto';
|
||||
@ -27,8 +29,6 @@ import { AssetFileUploadResponseDto } from 'src/immich/api-v1/asset/response-dto
|
||||
import { CheckExistingAssetsResponseDto } from 'src/immich/api-v1/asset/response-dto/check-existing-assets-response.dto';
|
||||
import { CuratedLocationsResponseDto } from 'src/immich/api-v1/asset/response-dto/curated-locations-response.dto';
|
||||
import { CuratedObjectsResponseDto } from 'src/immich/api-v1/asset/response-dto/curated-objects-response.dto';
|
||||
import { ASSET_CHECKSUM_CONSTRAINT, AssetEntity, AssetType } from 'src/infra/entities/asset.entity';
|
||||
import { LibraryType } from 'src/infra/entities/library.entity';
|
||||
import { ImmichLogger } from 'src/infra/logger';
|
||||
import { IAccessRepository } from 'src/interfaces/access.repository';
|
||||
import { IAssetRepository } from 'src/interfaces/asset.repository';
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user