diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 98da1a783a..2db37ae852 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -167,13 +167,13 @@ jobs: run: npm --prefix server run typeorm:migrations:run - name: Generate new migrations continue-on-error: true - run: npm --prefix server run typeorm:migrations:generate ./libs/infra/src/migrations/TestMigration + run: npm --prefix server run typeorm:migrations:generate ./src/infra/migrations/TestMigration - name: Find file changes uses: tj-actions/verify-changed-files@v13.1 id: verify-changed-files with: files: | - server/libs/infra/src/migrations/ + server/src/infra/migrations/ - name: Verify files have not changed if: steps.verify-changed-files.outputs.files_changed == 'true' run: | diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 17f766e82c..188c458449 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -4,7 +4,7 @@ services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} - command: ["start-server.sh"] + command: [ "start.sh", "immich" ] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload env_file: @@ -18,7 +18,7 @@ services: immich-microservices: container_name: immich_microservices image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} - command: ["start-microservices.sh"] + command: [ "start.sh", "microservices" ] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload env_file: diff --git a/docs/docs/developer/database-migrations.md b/docs/docs/developer/database-migrations.md index 5b69c3ec3d..f94e2ca4f2 100644 --- a/docs/docs/developer/database-migrations.md +++ b/docs/docs/developer/database-migrations.md @@ -1,14 +1,14 @@ # Database Migrations -After making any changes in the `server/libs/database/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. +After making any changes in the `server/src/infra/database/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 ```bash -npm run typeorm:migrations:generate ./libs/infra/src/ +npm run typeorm:migrations:generate ./src/infra/ ``` 2. Check if the migration file makes sense. -3. Move the migration file to folder `server/libs/database/src/migrations` in your code editor. +3. Move the migration file to folder `./src/infra/database/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. diff --git a/docs/docs/developer/pr-checklist.md b/docs/docs/developer/pr-checklist.md index 8eab7da42e..efaa8f041f 100644 --- a/docs/docs/developer/pr-checklist.md +++ b/docs/docs/developer/pr-checklist.md @@ -30,4 +30,4 @@ The Open API client libraries need to be regenerated whenever there are changes ## Database Migrations -A database migration needs to be generated whenever there are changes to `server/libs/infra/src/entities`. See [Database Migration](/docs/developer/database-migrations.md) for more details. +A database migration needs to be generated whenever there are changes to `server/src/infra/src/entities`. See [Database Migration](/docs/developer/database-migrations.md) for more details. diff --git a/docs/docs/developer/setup.md b/docs/docs/developer/setup.md index 59e4177504..e712426ff0 100644 --- a/docs/docs/developer/setup.md +++ b/docs/docs/developer/setup.md @@ -10,9 +10,9 @@ sidebar_position: 2 This environment includes the following services: -- Core server - `/server/apps/immich` +- Core server - `/server/src/immich` - Machine learning - `/machine-learning` -- Microservices - `/server/apps/microservicess` +- Microservices - `/server/src/microservicess` - Web app - `/web` - Redis - PostgreSQL development database with exposed port `5432` so you can use any database client to acess it diff --git a/server/.gitignore b/server/.gitignore index 673d09abbe..4f2bbcf8a9 100644 --- a/server/.gitignore +++ b/server/.gitignore @@ -40,3 +40,5 @@ upload/ tmp/ core .reverse-geocoding-dump/ + +**/node_modules/** diff --git a/server/Dockerfile b/server/Dockerfile index c0d6725c96..22906c5022 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -32,7 +32,7 @@ COPY --from=prod /usr/src/app/bin ./bin COPY LICENSE /licenses/LICENSE.txt COPY LICENSE /LICENSE COPY package.json package-lock.json ./ -COPY start-server.sh start-microservices.sh ./ +COPY start*.sh ./ RUN npm link && npm cache clean --force diff --git a/server/README.md b/server/README.md deleted file mode 100644 index c889a52394..0000000000 --- a/server/README.md +++ /dev/null @@ -1,6 +0,0 @@ -## How to run migration - -1. Attached to the container shell -2. Run `npm run typeorm -- migration:generate ./libs/database/src/ -d libs/database/src/config/database.config.ts` -3. Check if the migration file makes sense -4. Move the migration file to folder `server/libs/database/src/migrations` in your code editor. \ No newline at end of file diff --git a/server/apps/cli/tsconfig.app.json b/server/apps/cli/tsconfig.app.json deleted file mode 100644 index 7c519aac42..0000000000 --- a/server/apps/cli/tsconfig.app.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "declaration": false, - "outDir": "../../dist/apps/cli" - }, - "include": ["src/**/*", "../../libs/**/*"], - "exclude": ["node_modules", "dist", "test", "**/*spec.ts"] -} diff --git a/server/apps/immich/src/api-v1/album/dto/add-users.dto.ts b/server/apps/immich/src/api-v1/album/dto/add-users.dto.ts deleted file mode 100644 index 0f73e43eae..0000000000 --- a/server/apps/immich/src/api-v1/album/dto/add-users.dto.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ValidateUUID } from '../../../../../../apps/immich/src/decorators/validate-uuid.decorator'; - -export class AddUsersDto { - @ValidateUUID({ each: true }) - sharedUserIds!: string[]; -} diff --git a/server/apps/immich/test/jest-e2e.json b/server/apps/immich/test/jest-e2e.json deleted file mode 100644 index d3095fe6e2..0000000000 --- a/server/apps/immich/test/jest-e2e.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "moduleFileExtensions": ["js", "json", "ts"], - "modulePaths": ["", "../../../"], - "rootDir": ".", - "testEnvironment": "node", - "testRegex": ".e2e-spec.ts$", - "transform": { - "^.+\\.(t|j)s$": "ts-jest" - }, - "moduleNameMapper": { - "^@app/infra(|/.*)$": "../../../libs/infra/src/$1", - "^@app/domain(|/.*)$": "../../../libs/domain/src/$1" - } -} diff --git a/server/apps/immich/tsconfig.app.json b/server/apps/immich/tsconfig.app.json deleted file mode 100644 index 8cbae8bbf7..0000000000 --- a/server/apps/immich/tsconfig.app.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "declaration": false, - "outDir": "../../dist/apps/immich" - }, - "include": ["src/**/*", "../../libs/**/*"], - "exclude": ["node_modules", "dist", "test", "**/*spec.ts"] -} diff --git a/server/apps/microservices/test/app.e2e-spec.ts b/server/apps/microservices/test/app.e2e-spec.ts deleted file mode 100644 index 36cf0affb9..0000000000 --- a/server/apps/microservices/test/app.e2e-spec.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Test, TestingModule } from '@nestjs/testing'; -import { INestApplication } from '@nestjs/common'; -import request from 'supertest'; -import { MicroservicesModule } from './../src/microservices.module'; - -describe('MicroservicesController (e2e)', () => { - let app: INestApplication; - - beforeEach(async () => { - const moduleFixture: TestingModule = await Test.createTestingModule({ - imports: [MicroservicesModule], - }).compile(); - - app = moduleFixture.createNestApplication(); - await app.init(); - }); - - it('/ (GET)', () => { - return request(app.getHttpServer()).get('/').expect(200).expect('Hello World!'); - }); -}); diff --git a/server/apps/microservices/test/jest-e2e.json b/server/apps/microservices/test/jest-e2e.json deleted file mode 100644 index e9d912f3e3..0000000000 --- a/server/apps/microservices/test/jest-e2e.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "moduleFileExtensions": ["js", "json", "ts"], - "rootDir": ".", - "testEnvironment": "node", - "testRegex": ".e2e-spec.ts$", - "transform": { - "^.+\\.(t|j)s$": "ts-jest" - } -} diff --git a/server/apps/microservices/tsconfig.app.json b/server/apps/microservices/tsconfig.app.json deleted file mode 100644 index a24a8136bb..0000000000 --- a/server/apps/microservices/tsconfig.app.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "declaration": false, - "outDir": "../../dist/apps/microservices" - }, - "include": ["src/**/*"], - "exclude": ["node_modules", "dist", "test", "**/*spec.ts"] -} diff --git a/server/bin/cli.sh b/server/bin/cli.sh index f95ca6e227..90db9957ed 100755 --- a/server/bin/cli.sh +++ b/server/bin/cli.sh @@ -1 +1 @@ -node ./dist/apps/cli/apps/cli/src/immich "$@" +node ./dist/main cli "$@" diff --git a/server/apps/immich/test/album.e2e-spec.ts b/server/e2e/album.e2e-spec.ts similarity index 96% rename from server/apps/immich/test/album.e2e-spec.ts rename to server/e2e/album.e2e-spec.ts index 36bce93d28..e75a680469 100644 --- a/server/apps/immich/test/album.e2e-spec.ts +++ b/server/e2e/album.e2e-spec.ts @@ -1,13 +1,13 @@ import { Test, TestingModule } from '@nestjs/testing'; import { INestApplication } from '@nestjs/common'; import request from 'supertest'; -import { clearDb, getAuthUser, authCustom } from './test-utils'; +import { clearDb, getAuthUser, authCustom } from '../test/test-utils'; import { CreateAlbumDto } from '@app/domain'; -import { CreateAlbumShareLinkDto } from '../src/api-v1/album/dto/create-album-shared-link.dto'; -import { AuthUserDto } from '../src/decorators/auth-user.decorator'; +import { CreateAlbumShareLinkDto } from '@app/immich/api-v1/album/dto/create-album-shared-link.dto'; +import { AuthUserDto } from '@app/immich/decorators/auth-user.decorator'; import { AlbumResponseDto, AuthService, SharedLinkResponseDto, UserService } from '@app/domain'; import { DataSource } from 'typeorm'; -import { AppModule } from '../src/app.module'; +import { AppModule } from '@app/immich/app.module'; async function _createAlbum(app: INestApplication, data: CreateAlbumDto) { const res = await request(app.getHttpServer()).post('/album').send(data); diff --git a/server/apps/immich/test/user.e2e-spec.ts b/server/e2e/user.e2e-spec.ts similarity index 98% rename from server/apps/immich/test/user.e2e-spec.ts rename to server/e2e/user.e2e-spec.ts index 83d3577d7b..6c72d9091c 100644 --- a/server/apps/immich/test/user.e2e-spec.ts +++ b/server/e2e/user.e2e-spec.ts @@ -1,11 +1,11 @@ import { Test, TestingModule } from '@nestjs/testing'; import { INestApplication } from '@nestjs/common'; import request from 'supertest'; -import { clearDb, authCustom } from './test-utils'; +import { clearDb, authCustom } from '../test/test-utils'; import { CreateUserDto, UserService, AuthUserDto, UserResponseDto } from '@app/domain'; import { DataSource } from 'typeorm'; import { AuthService } from '@app/domain'; -import { AppModule } from '../src/app.module'; +import { AppModule } from '@app/immich/app.module'; function _createUser(userService: UserService, data: CreateUserDto) { return userService.createUser(data); diff --git a/server/jest-e2e.json b/server/jest-e2e.json new file mode 100644 index 0000000000..cc9806560a --- /dev/null +++ b/server/jest-e2e.json @@ -0,0 +1,16 @@ +{ + "moduleFileExtensions": ["js", "json", "ts"], + "modulePaths": [""], + "rootDir": ".", + "testEnvironment": "node", + "testRegex": ".e2e-spec.ts$", + "transform": { + "^.+\\.(t|j)s$": "ts-jest" + }, + "moduleNameMapper": { + "^@test(|/.*)$": "/test/$1", + "^@app/immich(|/.*)$": "/src/immich/$1", + "^@app/infra(|/.*)$": "/src/infra/$1", + "^@app/domain(|/.*)$": "/src/domain/$1" + } +} diff --git a/server/libs/domain/src/asset/dto/asset-ids.dto.ts b/server/libs/domain/src/asset/dto/asset-ids.dto.ts deleted file mode 100644 index 8c9b60b3d7..0000000000 --- a/server/libs/domain/src/asset/dto/asset-ids.dto.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ValidateUUID } from '../../../../../apps/immich/src/decorators/validate-uuid.decorator'; - -export class AssetIdsDto { - @ValidateUUID({ each: true }) - assetIds!: string[]; -} diff --git a/server/libs/domain/tsconfig.lib.json b/server/libs/domain/tsconfig.lib.json deleted file mode 100644 index 4e050b3d9e..0000000000 --- a/server/libs/domain/tsconfig.lib.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "declaration": true, - "outDir": "../../dist/libs/domain" - }, - "include": ["src/**/*"], - "exclude": ["node_modules", "dist", "test", "**/*spec.ts"] -} diff --git a/server/libs/infra/tsconfig.lib.json b/server/libs/infra/tsconfig.lib.json deleted file mode 100644 index 02f54211fb..0000000000 --- a/server/libs/infra/tsconfig.lib.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "declaration": true, - "outDir": "../../dist/libs/infra" - }, - "include": ["src/**/*"], - "exclude": ["node_modules", "dist", "test", "**/*spec.ts"] -} diff --git a/server/nest-cli.json b/server/nest-cli.json index b59076ddae..b295cd0f83 100644 --- a/server/nest-cli.json +++ b/server/nest-cli.json @@ -1,11 +1,10 @@ { + "$schema": "https://json.schemastore.org/nest-cli", "collection": "@nestjs/schematics", - "sourceRoot": "apps/immich/src", - "monorepo": true, - "root": "apps/immich", + "sourceRoot": "src", "compilerOptions": { + "deleteOutDir": true, "webpack": false, - "tsConfigPath": "apps/immich/tsconfig.app.json", "plugins": [ { "name": "@nestjs/swagger", @@ -15,52 +14,5 @@ } } ] - }, - "projects": { - "immich": { - "type": "application", - "root": "apps/immich", - "entryFile": "main", - "sourceRoot": "apps/immich/src", - "compilerOptions": { - "tsConfigPath": "apps/immich/tsconfig.app.json" - } - }, - "microservices": { - "type": "application", - "root": "apps/microservices", - "entryFile": "main", - "sourceRoot": "apps/microservices/src", - "compilerOptions": { - "tsConfigPath": "apps/microservices/tsconfig.app.json" - } - }, - "cli": { - "type": "application", - "root": "apps/cli", - "entryFile": "immich", - "sourceRoot": "apps/cli/src", - "compilerOptions": { - "tsConfigPath": "apps/cli/tsconfig.app.json" - } - }, - "infra": { - "type": "library", - "root": "libs/infra", - "entryFile": "index", - "sourceRoot": "libs/infra/src", - "compilerOptions": { - "tsConfigPath": "libs/infra/tsconfig.lib.json" - } - }, - "domain": { - "type": "library", - "root": "libs/domain", - "entryFile": "index", - "sourceRoot": "libs/domain/src", - "compilerOptions": { - "tsConfigPath": "libs/domain/tsconfig.lib.json" - } - } } } diff --git a/server/package.json b/server/package.json index a49eddc740..3edf01c4e5 100644 --- a/server/package.json +++ b/server/package.json @@ -9,16 +9,14 @@ "immich": "./bin/cli.sh" }, "scripts": { - "prebuild": "rimraf dist", - "build": "nest build immich && nest build microservices && nest build cli", + "build": "nest build", "format": "prettier --check .", "format:fix": "prettier --write .", - "start": "nest start", + "start": "npm run start:dev", "nest": "nest", - "start:dev": "nest start --watch", - "start:debug": "rimraf dist && nest start --debug 0.0.0.0:9230 --watch", - "start:prod": "node dist/main", - "lint": "eslint \"{apps,libs}/**/*.ts\" --max-warnings 0", + "start:dev": "nest start --watch --", + "start:debug": "nest start --debug 0.0.0.0:9230 --watch --", + "lint": "eslint \"src/**/*.ts\" --max-warnings 0", "lint:fix": "npm run lint -- --fix", "check": "tsc --noEmit", "check:code": "npm run format && npm run lint && npm run check", @@ -27,13 +25,13 @@ "test:watch": "jest --watch", "test:cov": "jest --coverage", "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", - "test:e2e": "jest --config ./apps/immich/test/jest-e2e.json --runInBand", + "test:e2e": "jest --config jest-e2e.json --runInBand", "typeorm": "node --require ts-node/register ./node_modules/typeorm/cli.js", "typeorm:migrations:create": "node --require ts-node/register ./node_modules/typeorm/cli.js migration:create", - "typeorm:migrations:generate": "node --require ts-node/register ./node_modules/typeorm/cli.js migration:generate -d ./libs/infra/src/database.config.ts", - "typeorm:migrations:run": "node --require ts-node/register ./node_modules/typeorm/cli.js migration:run -d ./libs/infra/src/database.config.ts", - "typeorm:migrations:revert": "node --require ts-node/register ./node_modules/typeorm/cli.js migration:revert -d ./libs/infra/src/database.config.ts", - "typeorm:schema:drop": "node --require ts-node/register ./node_modules/typeorm/cli.js schema:drop -d ./libs/infra/src/database.config.ts", + "typeorm:migrations:generate": "node --require ts-node/register ./node_modules/typeorm/cli.js migration:generate -d ./src/infra/database.config.ts", + "typeorm:migrations:run": "node --require ts-node/register ./node_modules/typeorm/cli.js migration:run -d ./src/infra/database.config.ts", + "typeorm:migrations:revert": "node --require ts-node/register ./node_modules/typeorm/cli.js migration:revert -d ./src/infra/database.config.ts", + "typeorm:schema:drop": "node --require ts-node/register ./node_modules/typeorm/cli.js schema:drop -d ./src/infra/database.config.ts", "typeorm:schema:reset": "npm run typeorm:schema:drop && npm run typeorm:migrations:run", "api:typescript": "bash ./bin/generate-open-api.sh web", "api:dart": "bash ./bin/generate-open-api.sh mobile", @@ -134,11 +132,11 @@ }, "collectCoverageFrom": [ "**/*.(t|j)s", - "!/libs/infra/**/*" + "!/infra/**/*" ], "coverageDirectory": "./coverage", "coverageThreshold": { - "./libs/domain/": { + "./src/domain/": { "branches": 80, "functions": 80, "lines": 90, @@ -146,17 +144,15 @@ } }, "setupFilesAfterEnv": [ - "/libs/domain/test/setup.ts" + "/test/setup.ts" ], "testEnvironment": "node", - "roots": [ - "/apps/", - "/libs/" - ], "moduleNameMapper": { - "^@app/infra(|/.*)$": "/libs/infra/src/$1", - "^@app/domain(|/.*)$": "/libs/domain/src/$1" + "^@test(|/.*)$": "/test/$1", + "^@app/immich(|/.*)$": "/src/immich/$1", + "^@app/infra(|/.*)$": "/src/infra/$1", + "^@app/domain(|/.*)$": "/src/domain/$1" }, - "globalSetup": "/libs/domain/test/global-setup.js" + "globalSetup": "/test/global-setup.js" } } diff --git a/server/apps/cli/src/app.module.ts b/server/src/cli/app.module.ts similarity index 100% rename from server/apps/cli/src/app.module.ts rename to server/src/cli/app.module.ts diff --git a/server/apps/cli/src/commands/list-users.command.ts b/server/src/cli/commands/list-users.command.ts similarity index 100% rename from server/apps/cli/src/commands/list-users.command.ts rename to server/src/cli/commands/list-users.command.ts diff --git a/server/apps/cli/src/commands/password-login.ts b/server/src/cli/commands/password-login.ts similarity index 100% rename from server/apps/cli/src/commands/password-login.ts rename to server/src/cli/commands/password-login.ts diff --git a/server/apps/cli/src/commands/reset-admin-password.command.ts b/server/src/cli/commands/reset-admin-password.command.ts similarity index 97% rename from server/apps/cli/src/commands/reset-admin-password.command.ts rename to server/src/cli/commands/reset-admin-password.command.ts index b12a549963..1482091679 100644 --- a/server/apps/cli/src/commands/reset-admin-password.command.ts +++ b/server/src/cli/commands/reset-admin-password.command.ts @@ -13,7 +13,7 @@ export class ResetAdminPasswordCommand extends CommandRunner { async run(): Promise { const ask = (admin: UserResponseDto) => { const { id, oauthId, email, firstName, lastName } = admin; - console.log(`Found Admin: + console.log(`Found Admin: - ID=${id} - OAuth ID=${oauthId} - Email=${email} diff --git a/server/apps/cli/src/constants.ts b/server/src/cli/constants.ts similarity index 100% rename from server/apps/cli/src/constants.ts rename to server/src/cli/constants.ts diff --git a/server/apps/cli/src/immich.ts b/server/src/cli/immich.ts similarity index 78% rename from server/apps/cli/src/immich.ts rename to server/src/cli/immich.ts index 95c2a76e5b..5dc0d5b61e 100755 --- a/server/apps/cli/src/immich.ts +++ b/server/src/cli/immich.ts @@ -1,7 +1,6 @@ import { CommandFactory } from 'nest-commander'; import { AppModule } from './app.module'; -async function bootstrap() { +export async function bootstrap() { await CommandFactory.run(AppModule, ['warn', 'error']); } -bootstrap(); diff --git a/server/libs/domain/src/access/access.repository.ts b/server/src/domain/access/access.repository.ts similarity index 100% rename from server/libs/domain/src/access/access.repository.ts rename to server/src/domain/access/access.repository.ts diff --git a/server/libs/domain/src/access/index.ts b/server/src/domain/access/index.ts similarity index 100% rename from server/libs/domain/src/access/index.ts rename to server/src/domain/access/index.ts diff --git a/server/libs/domain/src/album/album.repository.ts b/server/src/domain/album/album.repository.ts similarity index 100% rename from server/libs/domain/src/album/album.repository.ts rename to server/src/domain/album/album.repository.ts diff --git a/server/libs/domain/src/album/album.service.spec.ts b/server/src/domain/album/album.service.spec.ts similarity index 99% rename from server/libs/domain/src/album/album.service.spec.ts rename to server/src/domain/album/album.service.spec.ts index e15ad31b3b..43e5b0fc96 100644 --- a/server/libs/domain/src/album/album.service.spec.ts +++ b/server/src/domain/album/album.service.spec.ts @@ -8,7 +8,7 @@ import { newJobRepositoryMock, newUserRepositoryMock, userEntityStub, -} from '../../test'; +} from '@test'; import { IAssetRepository } from '../asset'; import { IJobRepository, JobName } from '../job'; import { IUserRepository } from '../user'; diff --git a/server/libs/domain/src/album/album.service.ts b/server/src/domain/album/album.service.ts similarity index 100% rename from server/libs/domain/src/album/album.service.ts rename to server/src/domain/album/album.service.ts diff --git a/server/libs/domain/src/album/dto/album-add-users.dto.ts b/server/src/domain/album/dto/album-add-users.dto.ts similarity index 61% rename from server/libs/domain/src/album/dto/album-add-users.dto.ts rename to server/src/domain/album/dto/album-add-users.dto.ts index 32b8770aaa..7546cdc3be 100644 --- a/server/libs/domain/src/album/dto/album-add-users.dto.ts +++ b/server/src/domain/album/dto/album-add-users.dto.ts @@ -1,5 +1,5 @@ import { ArrayNotEmpty } from 'class-validator'; -import { ValidateUUID } from '../../../../../apps/immich/src/decorators/validate-uuid.decorator'; +import { ValidateUUID } from '@app/immich/decorators/validate-uuid.decorator'; export class AddUsersDto { @ValidateUUID({ each: true }) diff --git a/server/libs/domain/src/album/dto/album-create.dto.ts b/server/src/domain/album/dto/album-create.dto.ts similarity index 78% rename from server/libs/domain/src/album/dto/album-create.dto.ts rename to server/src/domain/album/dto/album-create.dto.ts index 45e5faa446..c41d9120d8 100644 --- a/server/libs/domain/src/album/dto/album-create.dto.ts +++ b/server/src/domain/album/dto/album-create.dto.ts @@ -1,5 +1,5 @@ import { ApiProperty } from '@nestjs/swagger'; -import { ValidateUUID } from '../../../../../apps/immich/src/decorators/validate-uuid.decorator'; +import { ValidateUUID } from '@app/immich/decorators/validate-uuid.decorator'; import { IsNotEmpty, IsString } from 'class-validator'; export class CreateAlbumDto { diff --git a/server/libs/domain/src/album/dto/album-update.dto.ts b/server/src/domain/album/dto/album-update.dto.ts similarity index 72% rename from server/libs/domain/src/album/dto/album-update.dto.ts rename to server/src/domain/album/dto/album-update.dto.ts index e71722b74f..fb1e793364 100644 --- a/server/libs/domain/src/album/dto/album-update.dto.ts +++ b/server/src/domain/album/dto/album-update.dto.ts @@ -1,6 +1,6 @@ import { ApiProperty } from '@nestjs/swagger'; import { IsOptional } from 'class-validator'; -import { ValidateUUID } from '../../../../../apps/immich/src/decorators/validate-uuid.decorator'; +import { ValidateUUID } from '@app/immich/decorators/validate-uuid.decorator'; export class UpdateAlbumDto { @IsOptional() diff --git a/server/libs/domain/src/album/dto/get-albums.dto.ts b/server/src/domain/album/dto/get-albums.dto.ts similarity index 76% rename from server/libs/domain/src/album/dto/get-albums.dto.ts rename to server/src/domain/album/dto/get-albums.dto.ts index ccf5098b01..9b22d61162 100644 --- a/server/libs/domain/src/album/dto/get-albums.dto.ts +++ b/server/src/domain/album/dto/get-albums.dto.ts @@ -1,8 +1,8 @@ import { ApiProperty } from '@nestjs/swagger'; import { Transform } from 'class-transformer'; import { IsBoolean, IsOptional } from 'class-validator'; -import { ValidateUUID } from '../../../../../apps/immich/src/decorators/validate-uuid.decorator'; -import { toBoolean } from '../../../../../apps/immich/src/utils/transform.util'; +import { ValidateUUID } from '@app/immich/decorators/validate-uuid.decorator'; +import { toBoolean } from '@app/immich/utils/transform.util'; export class GetAlbumsDto { @IsOptional() diff --git a/server/libs/domain/src/album/dto/index.ts b/server/src/domain/album/dto/index.ts similarity index 100% rename from server/libs/domain/src/album/dto/index.ts rename to server/src/domain/album/dto/index.ts diff --git a/server/libs/domain/src/album/index.ts b/server/src/domain/album/index.ts similarity index 100% rename from server/libs/domain/src/album/index.ts rename to server/src/domain/album/index.ts diff --git a/server/libs/domain/src/album/response-dto/album-response.dto.ts b/server/src/domain/album/response-dto/album-response.dto.ts similarity index 100% rename from server/libs/domain/src/album/response-dto/album-response.dto.ts rename to server/src/domain/album/response-dto/album-response.dto.ts diff --git a/server/libs/domain/src/album/response-dto/index.ts b/server/src/domain/album/response-dto/index.ts similarity index 100% rename from server/libs/domain/src/album/response-dto/index.ts rename to server/src/domain/album/response-dto/index.ts diff --git a/server/libs/domain/src/api-key/api-key-response.dto.ts b/server/src/domain/api-key/api-key-response.dto.ts similarity index 100% rename from server/libs/domain/src/api-key/api-key-response.dto.ts rename to server/src/domain/api-key/api-key-response.dto.ts diff --git a/server/libs/domain/src/api-key/api-key.core.ts b/server/src/domain/api-key/api-key.core.ts similarity index 100% rename from server/libs/domain/src/api-key/api-key.core.ts rename to server/src/domain/api-key/api-key.core.ts diff --git a/server/libs/domain/src/api-key/api-key.dto.ts b/server/src/domain/api-key/api-key.dto.ts similarity index 100% rename from server/libs/domain/src/api-key/api-key.dto.ts rename to server/src/domain/api-key/api-key.dto.ts diff --git a/server/libs/domain/src/api-key/api-key.repository.ts b/server/src/domain/api-key/api-key.repository.ts similarity index 100% rename from server/libs/domain/src/api-key/api-key.repository.ts rename to server/src/domain/api-key/api-key.repository.ts diff --git a/server/libs/domain/src/api-key/api-key.service.spec.ts b/server/src/domain/api-key/api-key.service.spec.ts similarity index 99% rename from server/libs/domain/src/api-key/api-key.service.spec.ts rename to server/src/domain/api-key/api-key.service.spec.ts index cfae7c2cc9..1e33d9a6b2 100644 --- a/server/libs/domain/src/api-key/api-key.service.spec.ts +++ b/server/src/domain/api-key/api-key.service.spec.ts @@ -1,5 +1,5 @@ import { BadRequestException } from '@nestjs/common'; -import { authStub, keyStub, newCryptoRepositoryMock, newKeyRepositoryMock } from '../../test'; +import { authStub, keyStub, newCryptoRepositoryMock, newKeyRepositoryMock } from '@test'; import { ICryptoRepository } from '../crypto'; import { IKeyRepository } from './api-key.repository'; import { APIKeyService } from './api-key.service'; diff --git a/server/libs/domain/src/api-key/api-key.service.ts b/server/src/domain/api-key/api-key.service.ts similarity index 100% rename from server/libs/domain/src/api-key/api-key.service.ts rename to server/src/domain/api-key/api-key.service.ts diff --git a/server/libs/domain/src/api-key/index.ts b/server/src/domain/api-key/index.ts similarity index 100% rename from server/libs/domain/src/api-key/index.ts rename to server/src/domain/api-key/index.ts diff --git a/server/libs/domain/src/asset/asset.repository.ts b/server/src/domain/asset/asset.repository.ts similarity index 100% rename from server/libs/domain/src/asset/asset.repository.ts rename to server/src/domain/asset/asset.repository.ts diff --git a/server/libs/domain/src/asset/asset.service.spec.ts b/server/src/domain/asset/asset.service.spec.ts similarity index 93% rename from server/libs/domain/src/asset/asset.service.spec.ts rename to server/src/domain/asset/asset.service.spec.ts index 832b8d0531..b3ffd76680 100644 --- a/server/libs/domain/src/asset/asset.service.spec.ts +++ b/server/src/domain/asset/asset.service.spec.ts @@ -1,5 +1,5 @@ -import { assetEntityStub, authStub, newAssetRepositoryMock } from '../../test'; -import { AssetService, IAssetRepository } from '../asset'; +import { assetEntityStub, authStub, newAssetRepositoryMock } from '@test'; +import { AssetService, IAssetRepository } from '.'; describe(AssetService.name, () => { let sut: AssetService; diff --git a/server/libs/domain/src/asset/asset.service.ts b/server/src/domain/asset/asset.service.ts similarity index 100% rename from server/libs/domain/src/asset/asset.service.ts rename to server/src/domain/asset/asset.service.ts diff --git a/server/src/domain/asset/dto/asset-ids.dto.ts b/server/src/domain/asset/dto/asset-ids.dto.ts new file mode 100644 index 0000000000..5438e7a63d --- /dev/null +++ b/server/src/domain/asset/dto/asset-ids.dto.ts @@ -0,0 +1,6 @@ +import { ValidateUUID } from '@app/immich/decorators/validate-uuid.decorator'; + +export class AssetIdsDto { + @ValidateUUID({ each: true }) + assetIds!: string[]; +} diff --git a/server/libs/domain/src/asset/dto/index.ts b/server/src/domain/asset/dto/index.ts similarity index 100% rename from server/libs/domain/src/asset/dto/index.ts rename to server/src/domain/asset/dto/index.ts diff --git a/server/libs/domain/src/asset/dto/map-marker.dto.ts b/server/src/domain/asset/dto/map-marker.dto.ts similarity index 84% rename from server/libs/domain/src/asset/dto/map-marker.dto.ts rename to server/src/domain/asset/dto/map-marker.dto.ts index af39a4980b..95db3067e6 100644 --- a/server/libs/domain/src/asset/dto/map-marker.dto.ts +++ b/server/src/domain/asset/dto/map-marker.dto.ts @@ -1,7 +1,7 @@ import { ApiProperty } from '@nestjs/swagger'; import { Transform, Type } from 'class-transformer'; import { IsBoolean, IsDate, IsOptional } from 'class-validator'; -import { toBoolean } from '../../../../../apps/immich/src/utils/transform.util'; +import { toBoolean } from '@app/immich/utils/transform.util'; export class MapMarkerDto { @ApiProperty() diff --git a/server/libs/domain/src/asset/index.ts b/server/src/domain/asset/index.ts similarity index 100% rename from server/libs/domain/src/asset/index.ts rename to server/src/domain/asset/index.ts diff --git a/server/libs/domain/src/asset/response-dto/asset-ids-response.dto.ts b/server/src/domain/asset/response-dto/asset-ids-response.dto.ts similarity index 100% rename from server/libs/domain/src/asset/response-dto/asset-ids-response.dto.ts rename to server/src/domain/asset/response-dto/asset-ids-response.dto.ts diff --git a/server/libs/domain/src/asset/response-dto/asset-response.dto.ts b/server/src/domain/asset/response-dto/asset-response.dto.ts similarity index 100% rename from server/libs/domain/src/asset/response-dto/asset-response.dto.ts rename to server/src/domain/asset/response-dto/asset-response.dto.ts diff --git a/server/libs/domain/src/asset/response-dto/exif-response.dto.ts b/server/src/domain/asset/response-dto/exif-response.dto.ts similarity index 100% rename from server/libs/domain/src/asset/response-dto/exif-response.dto.ts rename to server/src/domain/asset/response-dto/exif-response.dto.ts diff --git a/server/libs/domain/src/asset/response-dto/index.ts b/server/src/domain/asset/response-dto/index.ts similarity index 100% rename from server/libs/domain/src/asset/response-dto/index.ts rename to server/src/domain/asset/response-dto/index.ts diff --git a/server/libs/domain/src/asset/response-dto/map-marker-response.dto.ts b/server/src/domain/asset/response-dto/map-marker-response.dto.ts similarity index 100% rename from server/libs/domain/src/asset/response-dto/map-marker-response.dto.ts rename to server/src/domain/asset/response-dto/map-marker-response.dto.ts diff --git a/server/libs/domain/src/asset/response-dto/smart-info-response.dto.ts b/server/src/domain/asset/response-dto/smart-info-response.dto.ts similarity index 100% rename from server/libs/domain/src/asset/response-dto/smart-info-response.dto.ts rename to server/src/domain/asset/response-dto/smart-info-response.dto.ts diff --git a/server/libs/domain/src/auth/auth.constant.ts b/server/src/domain/auth/auth.constant.ts similarity index 100% rename from server/libs/domain/src/auth/auth.constant.ts rename to server/src/domain/auth/auth.constant.ts diff --git a/server/libs/domain/src/auth/auth.core.ts b/server/src/domain/auth/auth.core.ts similarity index 100% rename from server/libs/domain/src/auth/auth.core.ts rename to server/src/domain/auth/auth.core.ts diff --git a/server/libs/domain/src/auth/auth.service.spec.ts b/server/src/domain/auth/auth.service.spec.ts similarity index 99% rename from server/libs/domain/src/auth/auth.service.spec.ts rename to server/src/domain/auth/auth.service.spec.ts index 80e8a6d6e8..08d131ba3e 100644 --- a/server/libs/domain/src/auth/auth.service.spec.ts +++ b/server/src/domain/auth/auth.service.spec.ts @@ -17,7 +17,7 @@ import { systemConfigStub, userEntityStub, userTokenEntityStub, -} from '../../test'; +} from '@test'; import { IKeyRepository } from '../api-key'; import { ICryptoRepository } from '../crypto/crypto.repository'; import { ISharedLinkRepository } from '../shared-link'; diff --git a/server/libs/domain/src/auth/auth.service.ts b/server/src/domain/auth/auth.service.ts similarity index 100% rename from server/libs/domain/src/auth/auth.service.ts rename to server/src/domain/auth/auth.service.ts diff --git a/server/libs/domain/src/auth/dto/auth-user.dto.ts b/server/src/domain/auth/dto/auth-user.dto.ts similarity index 100% rename from server/libs/domain/src/auth/dto/auth-user.dto.ts rename to server/src/domain/auth/dto/auth-user.dto.ts diff --git a/server/libs/domain/src/auth/dto/change-password.dto.ts b/server/src/domain/auth/dto/change-password.dto.ts similarity index 100% rename from server/libs/domain/src/auth/dto/change-password.dto.ts rename to server/src/domain/auth/dto/change-password.dto.ts diff --git a/server/libs/domain/src/auth/dto/index.ts b/server/src/domain/auth/dto/index.ts similarity index 100% rename from server/libs/domain/src/auth/dto/index.ts rename to server/src/domain/auth/dto/index.ts diff --git a/server/libs/domain/src/auth/dto/login-credential.dto.spec.ts b/server/src/domain/auth/dto/login-credential.dto.spec.ts similarity index 100% rename from server/libs/domain/src/auth/dto/login-credential.dto.spec.ts rename to server/src/domain/auth/dto/login-credential.dto.spec.ts diff --git a/server/libs/domain/src/auth/dto/login-credential.dto.ts b/server/src/domain/auth/dto/login-credential.dto.ts similarity index 100% rename from server/libs/domain/src/auth/dto/login-credential.dto.ts rename to server/src/domain/auth/dto/login-credential.dto.ts diff --git a/server/libs/domain/src/auth/dto/sign-up.dto.spec.ts b/server/src/domain/auth/dto/sign-up.dto.spec.ts similarity index 100% rename from server/libs/domain/src/auth/dto/sign-up.dto.spec.ts rename to server/src/domain/auth/dto/sign-up.dto.spec.ts diff --git a/server/libs/domain/src/auth/dto/sign-up.dto.ts b/server/src/domain/auth/dto/sign-up.dto.ts similarity index 100% rename from server/libs/domain/src/auth/dto/sign-up.dto.ts rename to server/src/domain/auth/dto/sign-up.dto.ts diff --git a/server/libs/domain/src/auth/index.ts b/server/src/domain/auth/index.ts similarity index 100% rename from server/libs/domain/src/auth/index.ts rename to server/src/domain/auth/index.ts diff --git a/server/libs/domain/src/auth/response-dto/admin-signup-response.dto.ts b/server/src/domain/auth/response-dto/admin-signup-response.dto.ts similarity index 100% rename from server/libs/domain/src/auth/response-dto/admin-signup-response.dto.ts rename to server/src/domain/auth/response-dto/admin-signup-response.dto.ts diff --git a/server/libs/domain/src/auth/response-dto/auth-device-response.dto.ts b/server/src/domain/auth/response-dto/auth-device-response.dto.ts similarity index 100% rename from server/libs/domain/src/auth/response-dto/auth-device-response.dto.ts rename to server/src/domain/auth/response-dto/auth-device-response.dto.ts diff --git a/server/libs/domain/src/auth/response-dto/index.ts b/server/src/domain/auth/response-dto/index.ts similarity index 100% rename from server/libs/domain/src/auth/response-dto/index.ts rename to server/src/domain/auth/response-dto/index.ts diff --git a/server/libs/domain/src/auth/response-dto/login-response.dto.ts b/server/src/domain/auth/response-dto/login-response.dto.ts similarity index 100% rename from server/libs/domain/src/auth/response-dto/login-response.dto.ts rename to server/src/domain/auth/response-dto/login-response.dto.ts diff --git a/server/libs/domain/src/auth/response-dto/logout-response.dto.ts b/server/src/domain/auth/response-dto/logout-response.dto.ts similarity index 100% rename from server/libs/domain/src/auth/response-dto/logout-response.dto.ts rename to server/src/domain/auth/response-dto/logout-response.dto.ts diff --git a/server/libs/domain/src/auth/response-dto/validate-asset-token-response.dto.ts b/server/src/domain/auth/response-dto/validate-asset-token-response.dto.ts similarity index 100% rename from server/libs/domain/src/auth/response-dto/validate-asset-token-response.dto.ts rename to server/src/domain/auth/response-dto/validate-asset-token-response.dto.ts diff --git a/server/libs/domain/src/communication/communication.repository.ts b/server/src/domain/communication/communication.repository.ts similarity index 100% rename from server/libs/domain/src/communication/communication.repository.ts rename to server/src/domain/communication/communication.repository.ts diff --git a/server/libs/domain/src/communication/index.ts b/server/src/domain/communication/index.ts similarity index 100% rename from server/libs/domain/src/communication/index.ts rename to server/src/domain/communication/index.ts diff --git a/server/libs/domain/src/crypto/crypto.repository.ts b/server/src/domain/crypto/crypto.repository.ts similarity index 100% rename from server/libs/domain/src/crypto/crypto.repository.ts rename to server/src/domain/crypto/crypto.repository.ts diff --git a/server/libs/domain/src/crypto/index.ts b/server/src/domain/crypto/index.ts similarity index 100% rename from server/libs/domain/src/crypto/index.ts rename to server/src/domain/crypto/index.ts diff --git a/server/libs/domain/src/domain.config.ts b/server/src/domain/domain.config.ts similarity index 100% rename from server/libs/domain/src/domain.config.ts rename to server/src/domain/domain.config.ts diff --git a/server/libs/domain/src/domain.constant.ts b/server/src/domain/domain.constant.ts similarity index 95% rename from server/libs/domain/src/domain.constant.ts rename to server/src/domain/domain.constant.ts index b0e0759773..3aec785d7e 100644 --- a/server/libs/domain/src/domain.constant.ts +++ b/server/src/domain/domain.constant.ts @@ -1,5 +1,5 @@ import { BadRequestException } from '@nestjs/common'; -import pkg from '../../../package.json'; +import pkg from 'src/../../package.json'; const [major, minor, patch] = pkg.version.split('.'); diff --git a/server/libs/domain/src/domain.module.ts b/server/src/domain/domain.module.ts similarity index 100% rename from server/libs/domain/src/domain.module.ts rename to server/src/domain/domain.module.ts diff --git a/server/libs/domain/src/domain.util.ts b/server/src/domain/domain.util.ts similarity index 100% rename from server/libs/domain/src/domain.util.ts rename to server/src/domain/domain.util.ts diff --git a/server/libs/domain/src/facial-recognition/face.repository.ts b/server/src/domain/facial-recognition/face.repository.ts similarity index 100% rename from server/libs/domain/src/facial-recognition/face.repository.ts rename to server/src/domain/facial-recognition/face.repository.ts diff --git a/server/libs/domain/src/facial-recognition/facial-recognition.service.spec.ts b/server/src/domain/facial-recognition/facial-recognition.service.spec.ts similarity index 99% rename from server/libs/domain/src/facial-recognition/facial-recognition.service.spec.ts rename to server/src/domain/facial-recognition/facial-recognition.service.spec.ts index 6c4adbd373..87418b2c23 100644 --- a/server/libs/domain/src/facial-recognition/facial-recognition.service.spec.ts +++ b/server/src/domain/facial-recognition/facial-recognition.service.spec.ts @@ -10,7 +10,7 @@ import { newSearchRepositoryMock, newStorageRepositoryMock, personStub, -} from '../../test'; +} from '@test'; import { IAssetRepository, WithoutProperty } from '../asset'; import { IJobRepository, JobName } from '../job'; import { IMediaRepository } from '../media'; diff --git a/server/libs/domain/src/facial-recognition/facial-recognition.services.ts b/server/src/domain/facial-recognition/facial-recognition.services.ts similarity index 100% rename from server/libs/domain/src/facial-recognition/facial-recognition.services.ts rename to server/src/domain/facial-recognition/facial-recognition.services.ts diff --git a/server/libs/domain/src/facial-recognition/index.ts b/server/src/domain/facial-recognition/index.ts similarity index 100% rename from server/libs/domain/src/facial-recognition/index.ts rename to server/src/domain/facial-recognition/index.ts diff --git a/server/libs/domain/src/index.ts b/server/src/domain/index.ts similarity index 100% rename from server/libs/domain/src/index.ts rename to server/src/domain/index.ts diff --git a/server/libs/domain/src/job/dto/index.ts b/server/src/domain/job/dto/index.ts similarity index 100% rename from server/libs/domain/src/job/dto/index.ts rename to server/src/domain/job/dto/index.ts diff --git a/server/libs/domain/src/job/dto/job-command.dto.ts b/server/src/domain/job/dto/job-command.dto.ts similarity index 100% rename from server/libs/domain/src/job/dto/job-command.dto.ts rename to server/src/domain/job/dto/job-command.dto.ts diff --git a/server/libs/domain/src/job/dto/job-id.dto.ts b/server/src/domain/job/dto/job-id.dto.ts similarity index 100% rename from server/libs/domain/src/job/dto/job-id.dto.ts rename to server/src/domain/job/dto/job-id.dto.ts diff --git a/server/libs/domain/src/job/index.ts b/server/src/domain/job/index.ts similarity index 100% rename from server/libs/domain/src/job/index.ts rename to server/src/domain/job/index.ts diff --git a/server/libs/domain/src/job/job.constants.ts b/server/src/domain/job/job.constants.ts similarity index 100% rename from server/libs/domain/src/job/job.constants.ts rename to server/src/domain/job/job.constants.ts diff --git a/server/libs/domain/src/job/job.interface.ts b/server/src/domain/job/job.interface.ts similarity index 100% rename from server/libs/domain/src/job/job.interface.ts rename to server/src/domain/job/job.interface.ts diff --git a/server/libs/domain/src/job/job.repository.ts b/server/src/domain/job/job.repository.ts similarity index 100% rename from server/libs/domain/src/job/job.repository.ts rename to server/src/domain/job/job.repository.ts diff --git a/server/libs/domain/src/job/job.service.spec.ts b/server/src/domain/job/job.service.spec.ts similarity index 99% rename from server/libs/domain/src/job/job.service.spec.ts rename to server/src/domain/job/job.service.spec.ts index 303661edb6..23999d5d3b 100644 --- a/server/libs/domain/src/job/job.service.spec.ts +++ b/server/src/domain/job/job.service.spec.ts @@ -6,10 +6,10 @@ import { newCommunicationRepositoryMock, newJobRepositoryMock, newSystemConfigRepositoryMock, -} from '../../test'; +} from '@test'; import { IAssetRepository } from '../asset'; import { ICommunicationRepository } from '../communication'; -import { IJobRepository, JobCommand, JobHandler, JobItem, JobName, JobService, QueueName } from '../job'; +import { IJobRepository, JobCommand, JobHandler, JobItem, JobName, JobService, QueueName } from '.'; import { ISystemConfigRepository } from '../system-config'; import { SystemConfigCore } from '../system-config/system-config.core'; diff --git a/server/libs/domain/src/job/job.service.ts b/server/src/domain/job/job.service.ts similarity index 100% rename from server/libs/domain/src/job/job.service.ts rename to server/src/domain/job/job.service.ts diff --git a/server/libs/domain/src/job/response-dto/all-job-status-response.dto.ts b/server/src/domain/job/response-dto/all-job-status-response.dto.ts similarity index 100% rename from server/libs/domain/src/job/response-dto/all-job-status-response.dto.ts rename to server/src/domain/job/response-dto/all-job-status-response.dto.ts diff --git a/server/libs/domain/src/job/response-dto/index.ts b/server/src/domain/job/response-dto/index.ts similarity index 100% rename from server/libs/domain/src/job/response-dto/index.ts rename to server/src/domain/job/response-dto/index.ts diff --git a/server/libs/domain/src/media/index.ts b/server/src/domain/media/index.ts similarity index 100% rename from server/libs/domain/src/media/index.ts rename to server/src/domain/media/index.ts diff --git a/server/libs/domain/src/media/media.constant.ts b/server/src/domain/media/media.constant.ts similarity index 100% rename from server/libs/domain/src/media/media.constant.ts rename to server/src/domain/media/media.constant.ts diff --git a/server/libs/domain/src/media/media.repository.ts b/server/src/domain/media/media.repository.ts similarity index 100% rename from server/libs/domain/src/media/media.repository.ts rename to server/src/domain/media/media.repository.ts diff --git a/server/libs/domain/src/media/media.service.spec.ts b/server/src/domain/media/media.service.spec.ts similarity index 99% rename from server/libs/domain/src/media/media.service.spec.ts rename to server/src/domain/media/media.service.spec.ts index 17b683d469..99c51a1c03 100644 --- a/server/libs/domain/src/media/media.service.spec.ts +++ b/server/src/domain/media/media.service.spec.ts @@ -7,7 +7,7 @@ import { newStorageRepositoryMock, newSystemConfigRepositoryMock, probeStub, -} from '../../test'; +} from '@test'; import { IAssetRepository, WithoutProperty } from '../asset'; import { IJobRepository, JobName } from '../job'; import { IStorageRepository } from '../storage'; diff --git a/server/libs/domain/src/media/media.service.ts b/server/src/domain/media/media.service.ts similarity index 100% rename from server/libs/domain/src/media/media.service.ts rename to server/src/domain/media/media.service.ts diff --git a/server/libs/domain/src/metadata/geocoding.repository.ts b/server/src/domain/metadata/geocoding.repository.ts similarity index 100% rename from server/libs/domain/src/metadata/geocoding.repository.ts rename to server/src/domain/metadata/geocoding.repository.ts diff --git a/server/libs/domain/src/metadata/index.ts b/server/src/domain/metadata/index.ts similarity index 100% rename from server/libs/domain/src/metadata/index.ts rename to server/src/domain/metadata/index.ts diff --git a/server/libs/domain/src/metadata/metadata.service.spec.ts b/server/src/domain/metadata/metadata.service.spec.ts similarity index 98% rename from server/libs/domain/src/metadata/metadata.service.spec.ts rename to server/src/domain/metadata/metadata.service.spec.ts index d889a9ce81..cc47b2abf9 100644 --- a/server/libs/domain/src/metadata/metadata.service.spec.ts +++ b/server/src/domain/metadata/metadata.service.spec.ts @@ -1,5 +1,5 @@ import { constants } from 'fs/promises'; -import { assetEntityStub, newAssetRepositoryMock, newJobRepositoryMock, newStorageRepositoryMock } from '../../test'; +import { assetEntityStub, newAssetRepositoryMock, newJobRepositoryMock, newStorageRepositoryMock } from '@test'; import { IAssetRepository, WithoutProperty, WithProperty } from '../asset'; import { IJobRepository, JobName } from '../job'; import { IStorageRepository } from '../storage'; diff --git a/server/libs/domain/src/metadata/metadata.service.ts b/server/src/domain/metadata/metadata.service.ts similarity index 100% rename from server/libs/domain/src/metadata/metadata.service.ts rename to server/src/domain/metadata/metadata.service.ts diff --git a/server/libs/domain/src/oauth/dto/index.ts b/server/src/domain/oauth/dto/index.ts similarity index 100% rename from server/libs/domain/src/oauth/dto/index.ts rename to server/src/domain/oauth/dto/index.ts diff --git a/server/libs/domain/src/oauth/dto/oauth-auth-code.dto.ts b/server/src/domain/oauth/dto/oauth-auth-code.dto.ts similarity index 100% rename from server/libs/domain/src/oauth/dto/oauth-auth-code.dto.ts rename to server/src/domain/oauth/dto/oauth-auth-code.dto.ts diff --git a/server/libs/domain/src/oauth/dto/oauth-config.dto.ts b/server/src/domain/oauth/dto/oauth-config.dto.ts similarity index 100% rename from server/libs/domain/src/oauth/dto/oauth-config.dto.ts rename to server/src/domain/oauth/dto/oauth-config.dto.ts diff --git a/server/libs/domain/src/oauth/index.ts b/server/src/domain/oauth/index.ts similarity index 100% rename from server/libs/domain/src/oauth/index.ts rename to server/src/domain/oauth/index.ts diff --git a/server/libs/domain/src/oauth/oauth.constants.ts b/server/src/domain/oauth/oauth.constants.ts similarity index 100% rename from server/libs/domain/src/oauth/oauth.constants.ts rename to server/src/domain/oauth/oauth.constants.ts diff --git a/server/libs/domain/src/oauth/oauth.core.ts b/server/src/domain/oauth/oauth.core.ts similarity index 100% rename from server/libs/domain/src/oauth/oauth.core.ts rename to server/src/domain/oauth/oauth.core.ts diff --git a/server/libs/domain/src/oauth/oauth.service.spec.ts b/server/src/domain/oauth/oauth.service.spec.ts similarity index 98% rename from server/libs/domain/src/oauth/oauth.service.spec.ts rename to server/src/domain/oauth/oauth.service.spec.ts index c79e09e7ec..74dac63f50 100644 --- a/server/libs/domain/src/oauth/oauth.service.spec.ts +++ b/server/src/domain/oauth/oauth.service.spec.ts @@ -3,21 +3,21 @@ import { BadRequestException } from '@nestjs/common'; import { generators, Issuer } from 'openid-client'; import { authStub, - userEntityStub, loginResponseStub, newCryptoRepositoryMock, newSystemConfigRepositoryMock, newUserRepositoryMock, + newUserTokenRepositoryMock, systemConfigStub, + userEntityStub, userTokenEntityStub, -} from '../../test'; +} from '@test'; +import { OAuthService } from '.'; +import { LoginDetails } from '../auth'; import { ICryptoRepository } from '../crypto'; -import { OAuthService } from '../oauth'; import { ISystemConfigRepository } from '../system-config'; import { IUserRepository } from '../user'; import { IUserTokenRepository } from '../user-token'; -import { newUserTokenRepositoryMock } from '../../test/user-token.repository.mock'; -import { LoginDetails } from '../auth'; const email = 'user@immich.com'; const sub = 'my-auth-user-sub'; diff --git a/server/libs/domain/src/oauth/oauth.service.ts b/server/src/domain/oauth/oauth.service.ts similarity index 100% rename from server/libs/domain/src/oauth/oauth.service.ts rename to server/src/domain/oauth/oauth.service.ts diff --git a/server/libs/domain/src/oauth/response-dto/index.ts b/server/src/domain/oauth/response-dto/index.ts similarity index 100% rename from server/libs/domain/src/oauth/response-dto/index.ts rename to server/src/domain/oauth/response-dto/index.ts diff --git a/server/libs/domain/src/oauth/response-dto/oauth-config-response.dto.ts b/server/src/domain/oauth/response-dto/oauth-config-response.dto.ts similarity index 100% rename from server/libs/domain/src/oauth/response-dto/oauth-config-response.dto.ts rename to server/src/domain/oauth/response-dto/oauth-config-response.dto.ts diff --git a/server/libs/domain/src/partner/index.ts b/server/src/domain/partner/index.ts similarity index 100% rename from server/libs/domain/src/partner/index.ts rename to server/src/domain/partner/index.ts diff --git a/server/libs/domain/src/partner/partner.repository.ts b/server/src/domain/partner/partner.repository.ts similarity index 100% rename from server/libs/domain/src/partner/partner.repository.ts rename to server/src/domain/partner/partner.repository.ts diff --git a/server/libs/domain/src/partner/partner.service.spec.ts b/server/src/domain/partner/partner.service.spec.ts similarity index 99% rename from server/libs/domain/src/partner/partner.service.spec.ts rename to server/src/domain/partner/partner.service.spec.ts index 7a3c0490f7..2422d20ce8 100644 --- a/server/libs/domain/src/partner/partner.service.spec.ts +++ b/server/src/domain/partner/partner.service.spec.ts @@ -1,5 +1,5 @@ import { BadRequestException } from '@nestjs/common'; -import { authStub, newPartnerRepositoryMock, partnerStub } from '../../test'; +import { authStub, newPartnerRepositoryMock, partnerStub } from '@test'; import { IPartnerRepository, PartnerDirection } from './partner.repository'; import { PartnerService } from './partner.service'; diff --git a/server/libs/domain/src/partner/partner.service.ts b/server/src/domain/partner/partner.service.ts similarity index 99% rename from server/libs/domain/src/partner/partner.service.ts rename to server/src/domain/partner/partner.service.ts index 2759f37cba..6486df7426 100644 --- a/server/libs/domain/src/partner/partner.service.ts +++ b/server/src/domain/partner/partner.service.ts @@ -1,7 +1,7 @@ import { PartnerEntity } from '@app/infra/entities'; import { BadRequestException, Inject, Injectable } from '@nestjs/common'; import { AuthUserDto } from '../auth'; -import { IPartnerRepository, PartnerDirection, PartnerIds } from '../partner'; +import { IPartnerRepository, PartnerDirection, PartnerIds } from '.'; import { mapUser, UserResponseDto } from '../user'; @Injectable() diff --git a/server/libs/domain/src/person/dto/index.ts b/server/src/domain/person/dto/index.ts similarity index 100% rename from server/libs/domain/src/person/dto/index.ts rename to server/src/domain/person/dto/index.ts diff --git a/server/libs/domain/src/person/dto/person-update.dto.ts b/server/src/domain/person/dto/person-update.dto.ts similarity index 100% rename from server/libs/domain/src/person/dto/person-update.dto.ts rename to server/src/domain/person/dto/person-update.dto.ts diff --git a/server/libs/domain/src/person/index.ts b/server/src/domain/person/index.ts similarity index 100% rename from server/libs/domain/src/person/index.ts rename to server/src/domain/person/index.ts diff --git a/server/libs/domain/src/person/person.repository.ts b/server/src/domain/person/person.repository.ts similarity index 100% rename from server/libs/domain/src/person/person.repository.ts rename to server/src/domain/person/person.repository.ts diff --git a/server/libs/domain/src/person/person.service.spec.ts b/server/src/domain/person/person.service.spec.ts similarity index 99% rename from server/libs/domain/src/person/person.service.spec.ts rename to server/src/domain/person/person.service.spec.ts index 78ff32f1a0..9a9f3107d8 100644 --- a/server/libs/domain/src/person/person.service.spec.ts +++ b/server/src/domain/person/person.service.spec.ts @@ -7,7 +7,7 @@ import { newPersonRepositoryMock, newStorageRepositoryMock, personStub, -} from '../../test'; +} from '@test'; import { IStorageRepository } from '../storage'; import { IPersonRepository } from './person.repository'; import { PersonService } from './person.service'; diff --git a/server/libs/domain/src/person/person.service.ts b/server/src/domain/person/person.service.ts similarity index 100% rename from server/libs/domain/src/person/person.service.ts rename to server/src/domain/person/person.service.ts diff --git a/server/libs/domain/src/person/response-dto/index.ts b/server/src/domain/person/response-dto/index.ts similarity index 100% rename from server/libs/domain/src/person/response-dto/index.ts rename to server/src/domain/person/response-dto/index.ts diff --git a/server/libs/domain/src/person/response-dto/person-response.dto.ts b/server/src/domain/person/response-dto/person-response.dto.ts similarity index 100% rename from server/libs/domain/src/person/response-dto/person-response.dto.ts rename to server/src/domain/person/response-dto/person-response.dto.ts diff --git a/server/libs/domain/src/search/dto/index.ts b/server/src/domain/search/dto/index.ts similarity index 100% rename from server/libs/domain/src/search/dto/index.ts rename to server/src/domain/search/dto/index.ts diff --git a/server/libs/domain/src/search/dto/search.dto.ts b/server/src/domain/search/dto/search.dto.ts similarity index 94% rename from server/libs/domain/src/search/dto/search.dto.ts rename to server/src/domain/search/dto/search.dto.ts index 1d65c7bfb2..9c442260b9 100644 --- a/server/libs/domain/src/search/dto/search.dto.ts +++ b/server/src/domain/search/dto/search.dto.ts @@ -1,7 +1,7 @@ import { AssetType } from '@app/infra/entities'; import { Transform } from 'class-transformer'; import { IsArray, IsBoolean, IsEnum, IsNotEmpty, IsOptional, IsString } from 'class-validator'; -import { toBoolean } from '../../../../../apps/immich/src/utils/transform.util'; +import { toBoolean } from '@app/immich/utils/transform.util'; export class SearchDto { @IsString() diff --git a/server/libs/domain/src/search/index.ts b/server/src/domain/search/index.ts similarity index 100% rename from server/libs/domain/src/search/index.ts rename to server/src/domain/search/index.ts diff --git a/server/libs/domain/src/search/response-dto/index.ts b/server/src/domain/search/response-dto/index.ts similarity index 100% rename from server/libs/domain/src/search/response-dto/index.ts rename to server/src/domain/search/response-dto/index.ts diff --git a/server/libs/domain/src/search/response-dto/search-config-response.dto.ts b/server/src/domain/search/response-dto/search-config-response.dto.ts similarity index 100% rename from server/libs/domain/src/search/response-dto/search-config-response.dto.ts rename to server/src/domain/search/response-dto/search-config-response.dto.ts diff --git a/server/libs/domain/src/search/response-dto/search-explore.response.dto.ts b/server/src/domain/search/response-dto/search-explore.response.dto.ts similarity index 100% rename from server/libs/domain/src/search/response-dto/search-explore.response.dto.ts rename to server/src/domain/search/response-dto/search-explore.response.dto.ts diff --git a/server/libs/domain/src/search/response-dto/search-response.dto.ts b/server/src/domain/search/response-dto/search-response.dto.ts similarity index 100% rename from server/libs/domain/src/search/response-dto/search-response.dto.ts rename to server/src/domain/search/response-dto/search-response.dto.ts diff --git a/server/libs/domain/src/search/search.repository.ts b/server/src/domain/search/search.repository.ts similarity index 100% rename from server/libs/domain/src/search/search.repository.ts rename to server/src/domain/search/search.repository.ts diff --git a/server/libs/domain/src/search/search.service.spec.ts b/server/src/domain/search/search.service.spec.ts similarity index 99% rename from server/libs/domain/src/search/search.service.spec.ts rename to server/src/domain/search/search.service.spec.ts index ebd614e5b1..e1ff835d06 100644 --- a/server/libs/domain/src/search/search.service.spec.ts +++ b/server/src/domain/search/search.service.spec.ts @@ -14,7 +14,7 @@ import { newMachineLearningRepositoryMock, newSearchRepositoryMock, searchStub, -} from '../../test'; +} from '@test'; import { IAlbumRepository } from '../album/album.repository'; import { IAssetRepository } from '../asset/asset.repository'; import { IFaceRepository } from '../facial-recognition'; diff --git a/server/libs/domain/src/search/search.service.ts b/server/src/domain/search/search.service.ts similarity index 100% rename from server/libs/domain/src/search/search.service.ts rename to server/src/domain/search/search.service.ts diff --git a/server/libs/domain/src/server-info/index.ts b/server/src/domain/server-info/index.ts similarity index 100% rename from server/libs/domain/src/server-info/index.ts rename to server/src/domain/server-info/index.ts diff --git a/server/libs/domain/src/server-info/response-dto/index.ts b/server/src/domain/server-info/response-dto/index.ts similarity index 100% rename from server/libs/domain/src/server-info/response-dto/index.ts rename to server/src/domain/server-info/response-dto/index.ts diff --git a/server/libs/domain/src/server-info/response-dto/server-info-response.dto.ts b/server/src/domain/server-info/response-dto/server-info-response.dto.ts similarity index 100% rename from server/libs/domain/src/server-info/response-dto/server-info-response.dto.ts rename to server/src/domain/server-info/response-dto/server-info-response.dto.ts diff --git a/server/libs/domain/src/server-info/response-dto/server-ping-response.dto.ts b/server/src/domain/server-info/response-dto/server-ping-response.dto.ts similarity index 100% rename from server/libs/domain/src/server-info/response-dto/server-ping-response.dto.ts rename to server/src/domain/server-info/response-dto/server-ping-response.dto.ts diff --git a/server/libs/domain/src/server-info/response-dto/server-stats-response.dto.ts b/server/src/domain/server-info/response-dto/server-stats-response.dto.ts similarity index 100% rename from server/libs/domain/src/server-info/response-dto/server-stats-response.dto.ts rename to server/src/domain/server-info/response-dto/server-stats-response.dto.ts diff --git a/server/libs/domain/src/server-info/response-dto/server-version-response.dto.ts b/server/src/domain/server-info/response-dto/server-version-response.dto.ts similarity index 100% rename from server/libs/domain/src/server-info/response-dto/server-version-response.dto.ts rename to server/src/domain/server-info/response-dto/server-version-response.dto.ts diff --git a/server/libs/domain/src/server-info/response-dto/usage-by-user-response.dto.ts b/server/src/domain/server-info/response-dto/usage-by-user-response.dto.ts similarity index 100% rename from server/libs/domain/src/server-info/response-dto/usage-by-user-response.dto.ts rename to server/src/domain/server-info/response-dto/usage-by-user-response.dto.ts diff --git a/server/libs/domain/src/server-info/server-info.service.spec.ts b/server/src/domain/server-info/server-info.service.spec.ts similarity index 99% rename from server/libs/domain/src/server-info/server-info.service.spec.ts rename to server/src/domain/server-info/server-info.service.spec.ts index f030a63a13..ebb0d800fb 100644 --- a/server/libs/domain/src/server-info/server-info.service.spec.ts +++ b/server/src/domain/server-info/server-info.service.spec.ts @@ -1,4 +1,4 @@ -import { newStorageRepositoryMock, newUserRepositoryMock } from '../../test'; +import { newStorageRepositoryMock, newUserRepositoryMock } from '@test'; import { serverVersion } from '../domain.constant'; import { IStorageRepository } from '../storage'; import { IUserRepository } from '../user'; diff --git a/server/libs/domain/src/server-info/server-info.service.ts b/server/src/domain/server-info/server-info.service.ts similarity index 100% rename from server/libs/domain/src/server-info/server-info.service.ts rename to server/src/domain/server-info/server-info.service.ts diff --git a/server/libs/domain/src/shared-link/dto/create-shared-link.dto.ts b/server/src/domain/shared-link/dto/create-shared-link.dto.ts similarity index 100% rename from server/libs/domain/src/shared-link/dto/create-shared-link.dto.ts rename to server/src/domain/shared-link/dto/create-shared-link.dto.ts diff --git a/server/libs/domain/src/shared-link/dto/edit-shared-link.dto.ts b/server/src/domain/shared-link/dto/edit-shared-link.dto.ts similarity index 100% rename from server/libs/domain/src/shared-link/dto/edit-shared-link.dto.ts rename to server/src/domain/shared-link/dto/edit-shared-link.dto.ts diff --git a/server/libs/domain/src/shared-link/dto/index.ts b/server/src/domain/shared-link/dto/index.ts similarity index 100% rename from server/libs/domain/src/shared-link/dto/index.ts rename to server/src/domain/shared-link/dto/index.ts diff --git a/server/libs/domain/src/shared-link/index.ts b/server/src/domain/shared-link/index.ts similarity index 100% rename from server/libs/domain/src/shared-link/index.ts rename to server/src/domain/shared-link/index.ts diff --git a/server/libs/domain/src/shared-link/response-dto/index.ts b/server/src/domain/shared-link/response-dto/index.ts similarity index 100% rename from server/libs/domain/src/shared-link/response-dto/index.ts rename to server/src/domain/shared-link/response-dto/index.ts diff --git a/server/libs/domain/src/shared-link/response-dto/shared-link-response.dto.ts b/server/src/domain/shared-link/response-dto/shared-link-response.dto.ts similarity index 100% rename from server/libs/domain/src/shared-link/response-dto/shared-link-response.dto.ts rename to server/src/domain/shared-link/response-dto/shared-link-response.dto.ts diff --git a/server/libs/domain/src/shared-link/shared-link.core.ts b/server/src/domain/shared-link/shared-link.core.ts similarity index 100% rename from server/libs/domain/src/shared-link/shared-link.core.ts rename to server/src/domain/shared-link/shared-link.core.ts diff --git a/server/libs/domain/src/shared-link/shared-link.repository.ts b/server/src/domain/shared-link/shared-link.repository.ts similarity index 100% rename from server/libs/domain/src/shared-link/shared-link.repository.ts rename to server/src/domain/shared-link/shared-link.repository.ts diff --git a/server/libs/domain/src/shared-link/shared-link.service.spec.ts b/server/src/domain/shared-link/shared-link.service.spec.ts similarity index 99% rename from server/libs/domain/src/shared-link/shared-link.service.spec.ts rename to server/src/domain/shared-link/shared-link.service.spec.ts index 09a0f1e636..52cf7469b3 100644 --- a/server/libs/domain/src/shared-link/shared-link.service.spec.ts +++ b/server/src/domain/shared-link/shared-link.service.spec.ts @@ -1,5 +1,5 @@ import { BadRequestException, ForbiddenException } from '@nestjs/common'; -import { authStub, newSharedLinkRepositoryMock, sharedLinkResponseStub, sharedLinkStub } from '../../test'; +import { authStub, newSharedLinkRepositoryMock, sharedLinkResponseStub, sharedLinkStub } from '@test'; import { SharedLinkService } from './shared-link.service'; import { ISharedLinkRepository } from './shared-link.repository'; diff --git a/server/libs/domain/src/shared-link/shared-link.service.ts b/server/src/domain/shared-link/shared-link.service.ts similarity index 100% rename from server/libs/domain/src/shared-link/shared-link.service.ts rename to server/src/domain/shared-link/shared-link.service.ts diff --git a/server/libs/domain/src/smart-info/index.ts b/server/src/domain/smart-info/index.ts similarity index 100% rename from server/libs/domain/src/smart-info/index.ts rename to server/src/domain/smart-info/index.ts diff --git a/server/libs/domain/src/smart-info/machine-learning.interface.ts b/server/src/domain/smart-info/machine-learning.interface.ts similarity index 100% rename from server/libs/domain/src/smart-info/machine-learning.interface.ts rename to server/src/domain/smart-info/machine-learning.interface.ts diff --git a/server/libs/domain/src/smart-info/smart-info.repository.ts b/server/src/domain/smart-info/smart-info.repository.ts similarity index 100% rename from server/libs/domain/src/smart-info/smart-info.repository.ts rename to server/src/domain/smart-info/smart-info.repository.ts diff --git a/server/libs/domain/src/smart-info/smart-info.service.spec.ts b/server/src/domain/smart-info/smart-info.service.spec.ts similarity index 99% rename from server/libs/domain/src/smart-info/smart-info.service.spec.ts rename to server/src/domain/smart-info/smart-info.service.spec.ts index 404059c0b0..3a31366372 100644 --- a/server/libs/domain/src/smart-info/smart-info.service.spec.ts +++ b/server/src/domain/smart-info/smart-info.service.spec.ts @@ -5,7 +5,7 @@ import { newJobRepositoryMock, newMachineLearningRepositoryMock, newSmartInfoRepositoryMock, -} from '../../test'; +} from '@test'; import { IAssetRepository, WithoutProperty } from '../asset'; import { IJobRepository, JobName } from '../job'; import { IMachineLearningRepository } from './machine-learning.interface'; diff --git a/server/libs/domain/src/smart-info/smart-info.service.ts b/server/src/domain/smart-info/smart-info.service.ts similarity index 100% rename from server/libs/domain/src/smart-info/smart-info.service.ts rename to server/src/domain/smart-info/smart-info.service.ts diff --git a/server/libs/domain/src/storage-template/index.ts b/server/src/domain/storage-template/index.ts similarity index 100% rename from server/libs/domain/src/storage-template/index.ts rename to server/src/domain/storage-template/index.ts diff --git a/server/libs/domain/src/storage-template/storage-template.core.ts b/server/src/domain/storage-template/storage-template.core.ts similarity index 100% rename from server/libs/domain/src/storage-template/storage-template.core.ts rename to server/src/domain/storage-template/storage-template.core.ts diff --git a/server/libs/domain/src/storage-template/storage-template.service.spec.ts b/server/src/domain/storage-template/storage-template.service.spec.ts similarity index 98% rename from server/libs/domain/src/storage-template/storage-template.service.spec.ts rename to server/src/domain/storage-template/storage-template.service.spec.ts index f39f0ec2c7..166ba4695c 100644 --- a/server/libs/domain/src/storage-template/storage-template.service.spec.ts +++ b/server/src/domain/storage-template/storage-template.service.spec.ts @@ -7,9 +7,9 @@ import { newUserRepositoryMock, systemConfigStub, userEntityStub, -} from '../../test'; +} from '@test'; import { IAssetRepository } from '../asset'; -import { StorageTemplateService } from '../storage-template'; +import { StorageTemplateService } from '.'; import { IStorageRepository } from '../storage/storage.repository'; import { ISystemConfigRepository } from '../system-config'; import { IUserRepository } from '../user'; diff --git a/server/libs/domain/src/storage-template/storage-template.service.ts b/server/src/domain/storage-template/storage-template.service.ts similarity index 100% rename from server/libs/domain/src/storage-template/storage-template.service.ts rename to server/src/domain/storage-template/storage-template.service.ts diff --git a/server/libs/domain/src/storage/index.ts b/server/src/domain/storage/index.ts similarity index 100% rename from server/libs/domain/src/storage/index.ts rename to server/src/domain/storage/index.ts diff --git a/server/libs/domain/src/storage/storage.core.ts b/server/src/domain/storage/storage.core.ts similarity index 100% rename from server/libs/domain/src/storage/storage.core.ts rename to server/src/domain/storage/storage.core.ts diff --git a/server/libs/domain/src/storage/storage.repository.ts b/server/src/domain/storage/storage.repository.ts similarity index 100% rename from server/libs/domain/src/storage/storage.repository.ts rename to server/src/domain/storage/storage.repository.ts diff --git a/server/libs/domain/src/storage/storage.service.spec.ts b/server/src/domain/storage/storage.service.spec.ts similarity index 92% rename from server/libs/domain/src/storage/storage.service.spec.ts rename to server/src/domain/storage/storage.service.spec.ts index 9b180cafc9..e2a114b769 100644 --- a/server/libs/domain/src/storage/storage.service.spec.ts +++ b/server/src/domain/storage/storage.service.spec.ts @@ -1,5 +1,5 @@ -import { newStorageRepositoryMock } from '../../test'; -import { IStorageRepository } from '../storage'; +import { newStorageRepositoryMock } from '@test'; +import { IStorageRepository } from '.'; import { StorageService } from './storage.service'; describe(StorageService.name, () => { diff --git a/server/libs/domain/src/storage/storage.service.ts b/server/src/domain/storage/storage.service.ts similarity index 100% rename from server/libs/domain/src/storage/storage.service.ts rename to server/src/domain/storage/storage.service.ts diff --git a/server/libs/domain/src/system-config/dto/index.ts b/server/src/domain/system-config/dto/index.ts similarity index 100% rename from server/libs/domain/src/system-config/dto/index.ts rename to server/src/domain/system-config/dto/index.ts diff --git a/server/libs/domain/src/system-config/dto/system-config-ffmpeg.dto.ts b/server/src/domain/system-config/dto/system-config-ffmpeg.dto.ts similarity index 100% rename from server/libs/domain/src/system-config/dto/system-config-ffmpeg.dto.ts rename to server/src/domain/system-config/dto/system-config-ffmpeg.dto.ts diff --git a/server/libs/domain/src/system-config/dto/system-config-job.dto.ts b/server/src/domain/system-config/dto/system-config-job.dto.ts similarity index 100% rename from server/libs/domain/src/system-config/dto/system-config-job.dto.ts rename to server/src/domain/system-config/dto/system-config-job.dto.ts diff --git a/server/libs/domain/src/system-config/dto/system-config-oauth.dto.ts b/server/src/domain/system-config/dto/system-config-oauth.dto.ts similarity index 100% rename from server/libs/domain/src/system-config/dto/system-config-oauth.dto.ts rename to server/src/domain/system-config/dto/system-config-oauth.dto.ts diff --git a/server/libs/domain/src/system-config/dto/system-config-password-login.dto.ts b/server/src/domain/system-config/dto/system-config-password-login.dto.ts similarity index 100% rename from server/libs/domain/src/system-config/dto/system-config-password-login.dto.ts rename to server/src/domain/system-config/dto/system-config-password-login.dto.ts diff --git a/server/libs/domain/src/system-config/dto/system-config-storage-template.dto.ts b/server/src/domain/system-config/dto/system-config-storage-template.dto.ts similarity index 100% rename from server/libs/domain/src/system-config/dto/system-config-storage-template.dto.ts rename to server/src/domain/system-config/dto/system-config-storage-template.dto.ts diff --git a/server/libs/domain/src/system-config/dto/system-config.dto.ts b/server/src/domain/system-config/dto/system-config.dto.ts similarity index 100% rename from server/libs/domain/src/system-config/dto/system-config.dto.ts rename to server/src/domain/system-config/dto/system-config.dto.ts diff --git a/server/libs/domain/src/system-config/index.ts b/server/src/domain/system-config/index.ts similarity index 100% rename from server/libs/domain/src/system-config/index.ts rename to server/src/domain/system-config/index.ts diff --git a/server/libs/domain/src/system-config/response-dto/index.ts b/server/src/domain/system-config/response-dto/index.ts similarity index 100% rename from server/libs/domain/src/system-config/response-dto/index.ts rename to server/src/domain/system-config/response-dto/index.ts diff --git a/server/libs/domain/src/system-config/response-dto/system-config-template-storage-option.dto.ts b/server/src/domain/system-config/response-dto/system-config-template-storage-option.dto.ts similarity index 100% rename from server/libs/domain/src/system-config/response-dto/system-config-template-storage-option.dto.ts rename to server/src/domain/system-config/response-dto/system-config-template-storage-option.dto.ts diff --git a/server/libs/domain/src/system-config/system-config.constants.ts b/server/src/domain/system-config/system-config.constants.ts similarity index 100% rename from server/libs/domain/src/system-config/system-config.constants.ts rename to server/src/domain/system-config/system-config.constants.ts diff --git a/server/libs/domain/src/system-config/system-config.core.ts b/server/src/domain/system-config/system-config.core.ts similarity index 100% rename from server/libs/domain/src/system-config/system-config.core.ts rename to server/src/domain/system-config/system-config.core.ts diff --git a/server/libs/domain/src/system-config/system-config.repository.ts b/server/src/domain/system-config/system-config.repository.ts similarity index 100% rename from server/libs/domain/src/system-config/system-config.repository.ts rename to server/src/domain/system-config/system-config.repository.ts diff --git a/server/libs/domain/src/system-config/system-config.service.spec.ts b/server/src/domain/system-config/system-config.service.spec.ts similarity index 99% rename from server/libs/domain/src/system-config/system-config.service.spec.ts rename to server/src/domain/system-config/system-config.service.spec.ts index 4038506dd2..e18eb296e9 100644 --- a/server/libs/domain/src/system-config/system-config.service.spec.ts +++ b/server/src/domain/system-config/system-config.service.spec.ts @@ -1,6 +1,6 @@ import { SystemConfig, SystemConfigEntity, SystemConfigKey, TranscodePreset } from '@app/infra/entities'; import { BadRequestException } from '@nestjs/common'; -import { newJobRepositoryMock, newSystemConfigRepositoryMock, systemConfigStub } from '../../test'; +import { newJobRepositoryMock, newSystemConfigRepositoryMock, systemConfigStub } from '@test'; import { IJobRepository, JobName, QueueName } from '../job'; import { SystemConfigValidator } from './system-config.core'; import { ISystemConfigRepository } from './system-config.repository'; diff --git a/server/libs/domain/src/system-config/system-config.service.ts b/server/src/domain/system-config/system-config.service.ts similarity index 97% rename from server/libs/domain/src/system-config/system-config.service.ts rename to server/src/domain/system-config/system-config.service.ts index 4dc5cd6eba..426f5725f2 100644 --- a/server/libs/domain/src/system-config/system-config.service.ts +++ b/server/src/domain/system-config/system-config.service.ts @@ -1,4 +1,4 @@ -import { ISystemConfigRepository } from '../system-config'; +import { ISystemConfigRepository } from '.'; import { supportedDayTokens, supportedHourTokens, diff --git a/server/libs/domain/src/tag/index.ts b/server/src/domain/tag/index.ts similarity index 100% rename from server/libs/domain/src/tag/index.ts rename to server/src/domain/tag/index.ts diff --git a/server/libs/domain/src/tag/tag-response.dto.ts b/server/src/domain/tag/tag-response.dto.ts similarity index 100% rename from server/libs/domain/src/tag/tag-response.dto.ts rename to server/src/domain/tag/tag-response.dto.ts diff --git a/server/libs/domain/src/tag/tag.dto.ts b/server/src/domain/tag/tag.dto.ts similarity index 100% rename from server/libs/domain/src/tag/tag.dto.ts rename to server/src/domain/tag/tag.dto.ts diff --git a/server/libs/domain/src/tag/tag.repository.ts b/server/src/domain/tag/tag.repository.ts similarity index 100% rename from server/libs/domain/src/tag/tag.repository.ts rename to server/src/domain/tag/tag.repository.ts diff --git a/server/libs/domain/src/tag/tag.service.spec.ts b/server/src/domain/tag/tag.service.spec.ts similarity index 99% rename from server/libs/domain/src/tag/tag.service.spec.ts rename to server/src/domain/tag/tag.service.spec.ts index 62c145080f..8bed512d21 100644 --- a/server/libs/domain/src/tag/tag.service.spec.ts +++ b/server/src/domain/tag/tag.service.spec.ts @@ -1,7 +1,7 @@ import { TagType } from '@app/infra/entities'; import { BadRequestException } from '@nestjs/common'; import { when } from 'jest-when'; -import { assetEntityStub, authStub, newTagRepositoryMock, tagResponseStub, tagStub } from '../../test'; +import { assetEntityStub, authStub, newTagRepositoryMock, tagResponseStub, tagStub } from '@test'; import { AssetIdErrorReason } from '../asset'; import { ITagRepository } from './tag.repository'; import { TagService } from './tag.service'; diff --git a/server/libs/domain/src/tag/tag.service.ts b/server/src/domain/tag/tag.service.ts similarity index 100% rename from server/libs/domain/src/tag/tag.service.ts rename to server/src/domain/tag/tag.service.ts diff --git a/server/libs/domain/src/user-token/index.ts b/server/src/domain/user-token/index.ts similarity index 100% rename from server/libs/domain/src/user-token/index.ts rename to server/src/domain/user-token/index.ts diff --git a/server/libs/domain/src/user-token/user-token.core.ts b/server/src/domain/user-token/user-token.core.ts similarity index 100% rename from server/libs/domain/src/user-token/user-token.core.ts rename to server/src/domain/user-token/user-token.core.ts diff --git a/server/libs/domain/src/user-token/user-token.repository.ts b/server/src/domain/user-token/user-token.repository.ts similarity index 100% rename from server/libs/domain/src/user-token/user-token.repository.ts rename to server/src/domain/user-token/user-token.repository.ts diff --git a/server/libs/domain/src/user/dto/create-profile-image.dto.ts b/server/src/domain/user/dto/create-profile-image.dto.ts similarity index 100% rename from server/libs/domain/src/user/dto/create-profile-image.dto.ts rename to server/src/domain/user/dto/create-profile-image.dto.ts diff --git a/server/libs/domain/src/user/dto/create-user.dto.spec.ts b/server/src/domain/user/dto/create-user.dto.spec.ts similarity index 100% rename from server/libs/domain/src/user/dto/create-user.dto.spec.ts rename to server/src/domain/user/dto/create-user.dto.spec.ts diff --git a/server/libs/domain/src/user/dto/create-user.dto.ts b/server/src/domain/user/dto/create-user.dto.ts similarity index 90% rename from server/libs/domain/src/user/dto/create-user.dto.ts rename to server/src/domain/user/dto/create-user.dto.ts index a99811b04b..4fea6eddc6 100644 --- a/server/libs/domain/src/user/dto/create-user.dto.ts +++ b/server/src/domain/user/dto/create-user.dto.ts @@ -1,6 +1,6 @@ import { Transform } from 'class-transformer'; import { IsEmail, IsNotEmpty, IsOptional, IsString } from 'class-validator'; -import { toEmail, toSanitized } from '../../../../../apps/immich/src/utils/transform.util'; +import { toEmail, toSanitized } from '@app/immich/utils/transform.util'; export class CreateUserDto { @IsEmail() diff --git a/server/libs/domain/src/user/dto/index.ts b/server/src/domain/user/dto/index.ts similarity index 100% rename from server/libs/domain/src/user/dto/index.ts rename to server/src/domain/user/dto/index.ts diff --git a/server/libs/domain/src/user/dto/update-user.dto.ts b/server/src/domain/user/dto/update-user.dto.ts similarity index 89% rename from server/libs/domain/src/user/dto/update-user.dto.ts rename to server/src/domain/user/dto/update-user.dto.ts index db8ecba7fb..0c23ad7d3c 100644 --- a/server/libs/domain/src/user/dto/update-user.dto.ts +++ b/server/src/domain/user/dto/update-user.dto.ts @@ -1,7 +1,7 @@ import { ApiProperty } from '@nestjs/swagger'; import { Transform } from 'class-transformer'; import { IsBoolean, IsEmail, IsNotEmpty, IsOptional, IsString, IsUUID } from 'class-validator'; -import { toEmail, toSanitized } from '../../../../../apps/immich/src/utils/transform.util'; +import { toEmail, toSanitized } from '@app/immich/utils/transform.util'; export class UpdateUserDto { @IsOptional() diff --git a/server/libs/domain/src/user/dto/user-count.dto.ts b/server/src/domain/user/dto/user-count.dto.ts similarity index 100% rename from server/libs/domain/src/user/dto/user-count.dto.ts rename to server/src/domain/user/dto/user-count.dto.ts diff --git a/server/libs/domain/src/user/dto/user-id.dto.ts b/server/src/domain/user/dto/user-id.dto.ts similarity index 100% rename from server/libs/domain/src/user/dto/user-id.dto.ts rename to server/src/domain/user/dto/user-id.dto.ts diff --git a/server/libs/domain/src/user/index.ts b/server/src/domain/user/index.ts similarity index 100% rename from server/libs/domain/src/user/index.ts rename to server/src/domain/user/index.ts diff --git a/server/libs/domain/src/user/response-dto/create-profile-image-response.dto.ts b/server/src/domain/user/response-dto/create-profile-image-response.dto.ts similarity index 100% rename from server/libs/domain/src/user/response-dto/create-profile-image-response.dto.ts rename to server/src/domain/user/response-dto/create-profile-image-response.dto.ts diff --git a/server/libs/domain/src/user/response-dto/index.ts b/server/src/domain/user/response-dto/index.ts similarity index 100% rename from server/libs/domain/src/user/response-dto/index.ts rename to server/src/domain/user/response-dto/index.ts diff --git a/server/libs/domain/src/user/response-dto/user-count-response.dto.ts b/server/src/domain/user/response-dto/user-count-response.dto.ts similarity index 100% rename from server/libs/domain/src/user/response-dto/user-count-response.dto.ts rename to server/src/domain/user/response-dto/user-count-response.dto.ts diff --git a/server/libs/domain/src/user/response-dto/user-response.dto.ts b/server/src/domain/user/response-dto/user-response.dto.ts similarity index 100% rename from server/libs/domain/src/user/response-dto/user-response.dto.ts rename to server/src/domain/user/response-dto/user-response.dto.ts diff --git a/server/libs/domain/src/user/user.core.ts b/server/src/domain/user/user.core.ts similarity index 100% rename from server/libs/domain/src/user/user.core.ts rename to server/src/domain/user/user.core.ts diff --git a/server/libs/domain/src/user/user.repository.ts b/server/src/domain/user/user.repository.ts similarity index 100% rename from server/libs/domain/src/user/user.repository.ts rename to server/src/domain/user/user.repository.ts diff --git a/server/libs/domain/src/user/user.service.spec.ts b/server/src/domain/user/user.service.spec.ts similarity index 99% rename from server/libs/domain/src/user/user.service.spec.ts rename to server/src/domain/user/user.service.spec.ts index 1fbe5cccbb..518873286d 100644 --- a/server/libs/domain/src/user/user.service.spec.ts +++ b/server/src/domain/user/user.service.spec.ts @@ -8,7 +8,7 @@ import { newJobRepositoryMock, newStorageRepositoryMock, newUserRepositoryMock, -} from '../../test'; +} from '@test'; import { IAlbumRepository } from '../album'; import { IAssetRepository } from '../asset'; import { AuthUserDto } from '../auth'; diff --git a/server/libs/domain/src/user/user.service.ts b/server/src/domain/user/user.service.ts similarity index 99% rename from server/libs/domain/src/user/user.service.ts rename to server/src/domain/user/user.service.ts index f8c852de6f..dfc818204c 100644 --- a/server/libs/domain/src/user/user.service.ts +++ b/server/src/domain/user/user.service.ts @@ -9,7 +9,7 @@ import { ICryptoRepository } from '../crypto/crypto.repository'; import { IEntityJob, IJobRepository, JobName } from '../job'; import { StorageCore, StorageFolder } from '../storage'; import { IStorageRepository } from '../storage/storage.repository'; -import { IUserRepository } from '../user/user.repository'; +import { IUserRepository } from './user.repository'; import { CreateUserDto, UpdateUserDto, UserCountDto } from './dto'; import { CreateProfileImageResponseDto, diff --git a/server/apps/immich/src/api-v1/album/album-repository.ts b/server/src/immich/api-v1/album/album-repository.ts similarity index 100% rename from server/apps/immich/src/api-v1/album/album-repository.ts rename to server/src/immich/api-v1/album/album-repository.ts diff --git a/server/apps/immich/src/api-v1/album/album.controller.ts b/server/src/immich/api-v1/album/album.controller.ts similarity index 100% rename from server/apps/immich/src/api-v1/album/album.controller.ts rename to server/src/immich/api-v1/album/album.controller.ts diff --git a/server/apps/immich/src/api-v1/album/album.module.ts b/server/src/immich/api-v1/album/album.module.ts similarity index 100% rename from server/apps/immich/src/api-v1/album/album.module.ts rename to server/src/immich/api-v1/album/album.module.ts diff --git a/server/apps/immich/src/api-v1/album/album.service.spec.ts b/server/src/immich/api-v1/album/album.service.spec.ts similarity index 99% rename from server/apps/immich/src/api-v1/album/album.service.spec.ts rename to server/src/immich/api-v1/album/album.service.spec.ts index d621e60356..c864d767ac 100644 --- a/server/apps/immich/src/api-v1/album/album.service.spec.ts +++ b/server/src/immich/api-v1/album/album.service.spec.ts @@ -7,7 +7,7 @@ import { AddAssetsResponseDto } from './response-dto/add-assets-response.dto'; import { IAlbumRepository } from './album-repository'; import { DownloadService } from '../../modules/download/download.service'; import { ISharedLinkRepository } from '@app/domain'; -import { newCryptoRepositoryMock, newSharedLinkRepositoryMock, userEntityStub } from '@app/domain/../test'; +import { newCryptoRepositoryMock, newSharedLinkRepositoryMock, userEntityStub } from '@test'; describe('Album service', () => { let sut: AlbumService; diff --git a/server/apps/immich/src/api-v1/album/album.service.ts b/server/src/immich/api-v1/album/album.service.ts similarity index 100% rename from server/apps/immich/src/api-v1/album/album.service.ts rename to server/src/immich/api-v1/album/album.service.ts diff --git a/server/apps/immich/src/api-v1/album/dto/add-assets.dto.ts b/server/src/immich/api-v1/album/dto/add-assets.dto.ts similarity index 50% rename from server/apps/immich/src/api-v1/album/dto/add-assets.dto.ts rename to server/src/immich/api-v1/album/dto/add-assets.dto.ts index bf0d531358..f5c13d677b 100644 --- a/server/apps/immich/src/api-v1/album/dto/add-assets.dto.ts +++ b/server/src/immich/api-v1/album/dto/add-assets.dto.ts @@ -1,4 +1,4 @@ -import { ValidateUUID } from 'apps/immich/src/decorators/validate-uuid.decorator'; +import { ValidateUUID } from '@app/immich/decorators/validate-uuid.decorator'; export class AddAssetsDto { @ValidateUUID({ each: true }) diff --git a/server/src/immich/api-v1/album/dto/add-users.dto.ts b/server/src/immich/api-v1/album/dto/add-users.dto.ts new file mode 100644 index 0000000000..921dac7eff --- /dev/null +++ b/server/src/immich/api-v1/album/dto/add-users.dto.ts @@ -0,0 +1,6 @@ +import { ValidateUUID } from '@app/immich/decorators/validate-uuid.decorator'; + +export class AddUsersDto { + @ValidateUUID({ each: true }) + sharedUserIds!: string[]; +} diff --git a/server/apps/immich/src/api-v1/album/dto/create-album-shared-link.dto.ts b/server/src/immich/api-v1/album/dto/create-album-shared-link.dto.ts similarity index 88% rename from server/apps/immich/src/api-v1/album/dto/create-album-shared-link.dto.ts rename to server/src/immich/api-v1/album/dto/create-album-shared-link.dto.ts index bda8439814..284b6f741d 100644 --- a/server/apps/immich/src/api-v1/album/dto/create-album-shared-link.dto.ts +++ b/server/src/immich/api-v1/album/dto/create-album-shared-link.dto.ts @@ -1,5 +1,5 @@ import { ApiProperty } from '@nestjs/swagger'; -import { ValidateUUID } from 'apps/immich/src/decorators/validate-uuid.decorator'; +import { ValidateUUID } from '@app/immich/decorators/validate-uuid.decorator'; import { Type } from 'class-transformer'; import { IsBoolean, IsDate, IsOptional, IsString } from 'class-validator'; diff --git a/server/apps/immich/src/api-v1/album/dto/remove-assets.dto.ts b/server/src/immich/api-v1/album/dto/remove-assets.dto.ts similarity index 51% rename from server/apps/immich/src/api-v1/album/dto/remove-assets.dto.ts rename to server/src/immich/api-v1/album/dto/remove-assets.dto.ts index d1b2651ece..2782154bbc 100644 --- a/server/apps/immich/src/api-v1/album/dto/remove-assets.dto.ts +++ b/server/src/immich/api-v1/album/dto/remove-assets.dto.ts @@ -1,4 +1,4 @@ -import { ValidateUUID } from 'apps/immich/src/decorators/validate-uuid.decorator'; +import { ValidateUUID } from '@app/immich/decorators/validate-uuid.decorator'; export class RemoveAssetsDto { @ValidateUUID({ each: true }) diff --git a/server/apps/immich/src/api-v1/album/response-dto/add-assets-response.dto.ts b/server/src/immich/api-v1/album/response-dto/add-assets-response.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/album/response-dto/add-assets-response.dto.ts rename to server/src/immich/api-v1/album/response-dto/add-assets-response.dto.ts diff --git a/server/apps/immich/src/api-v1/album/response-dto/album-count-response.dto.ts b/server/src/immich/api-v1/album/response-dto/album-count-response.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/album/response-dto/album-count-response.dto.ts rename to server/src/immich/api-v1/album/response-dto/album-count-response.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/asset-repository.ts b/server/src/immich/api-v1/asset/asset-repository.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/asset-repository.ts rename to server/src/immich/api-v1/asset/asset-repository.ts diff --git a/server/apps/immich/src/api-v1/asset/asset.controller.ts b/server/src/immich/api-v1/asset/asset.controller.ts similarity index 99% rename from server/apps/immich/src/api-v1/asset/asset.controller.ts rename to server/src/immich/api-v1/asset/asset.controller.ts index 5fc837e68d..b678086af3 100644 --- a/server/apps/immich/src/api-v1/asset/asset.controller.ts +++ b/server/src/immich/api-v1/asset/asset.controller.ts @@ -1,4 +1,4 @@ -import { AddAssetsDto } from './../album/dto/add-assets.dto'; +import { AddAssetsDto } from '../album/dto/add-assets.dto'; import { Controller, Post, diff --git a/server/apps/immich/src/api-v1/asset/asset.core.ts b/server/src/immich/api-v1/asset/asset.core.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/asset.core.ts rename to server/src/immich/api-v1/asset/asset.core.ts diff --git a/server/apps/immich/src/api-v1/asset/asset.module.ts b/server/src/immich/api-v1/asset/asset.module.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/asset.module.ts rename to server/src/immich/api-v1/asset/asset.module.ts diff --git a/server/apps/immich/src/api-v1/asset/asset.service.spec.ts b/server/src/immich/api-v1/asset/asset.service.spec.ts similarity index 99% rename from server/apps/immich/src/api-v1/asset/asset.service.spec.ts rename to server/src/immich/api-v1/asset/asset.service.spec.ts index b9210d6996..f49eb1c92b 100644 --- a/server/apps/immich/src/api-v1/asset/asset.service.spec.ts +++ b/server/src/immich/api-v1/asset/asset.service.spec.ts @@ -27,7 +27,7 @@ import { newStorageRepositoryMock, sharedLinkResponseStub, sharedLinkStub, -} from '@app/domain/../test'; +} from '@test'; import { CreateAssetsShareLinkDto } from './dto/create-asset-shared-link.dto'; import { BadRequestException } from '@nestjs/common'; import { when } from 'jest-when'; diff --git a/server/apps/immich/src/api-v1/asset/asset.service.ts b/server/src/immich/api-v1/asset/asset.service.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/asset.service.ts rename to server/src/immich/api-v1/asset/asset.service.ts diff --git a/server/apps/immich/src/api-v1/asset/dto/asset-check.dto.ts b/server/src/immich/api-v1/asset/dto/asset-check.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/dto/asset-check.dto.ts rename to server/src/immich/api-v1/asset/dto/asset-check.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/dto/asset-search.dto.ts b/server/src/immich/api-v1/asset/dto/asset-search.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/dto/asset-search.dto.ts rename to server/src/immich/api-v1/asset/dto/asset-search.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/dto/check-duplicate-asset.dto.ts b/server/src/immich/api-v1/asset/dto/check-duplicate-asset.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/dto/check-duplicate-asset.dto.ts rename to server/src/immich/api-v1/asset/dto/check-duplicate-asset.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/dto/check-existing-assets.dto.spec.ts b/server/src/immich/api-v1/asset/dto/check-existing-assets.dto.spec.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/dto/check-existing-assets.dto.spec.ts rename to server/src/immich/api-v1/asset/dto/check-existing-assets.dto.spec.ts diff --git a/server/apps/immich/src/api-v1/asset/dto/check-existing-assets.dto.ts b/server/src/immich/api-v1/asset/dto/check-existing-assets.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/dto/check-existing-assets.dto.ts rename to server/src/immich/api-v1/asset/dto/check-existing-assets.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/dto/create-asset-shared-link.dto.ts b/server/src/immich/api-v1/asset/dto/create-asset-shared-link.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/dto/create-asset-shared-link.dto.ts rename to server/src/immich/api-v1/asset/dto/create-asset-shared-link.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/dto/create-asset.dto.ts b/server/src/immich/api-v1/asset/dto/create-asset.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/dto/create-asset.dto.ts rename to server/src/immich/api-v1/asset/dto/create-asset.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/dto/create-exif.dto.ts b/server/src/immich/api-v1/asset/dto/create-exif.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/dto/create-exif.dto.ts rename to server/src/immich/api-v1/asset/dto/create-exif.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/dto/delete-asset.dto.ts b/server/src/immich/api-v1/asset/dto/delete-asset.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/dto/delete-asset.dto.ts rename to server/src/immich/api-v1/asset/dto/delete-asset.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/dto/device-id.dto.ts b/server/src/immich/api-v1/asset/dto/device-id.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/dto/device-id.dto.ts rename to server/src/immich/api-v1/asset/dto/device-id.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/dto/download-files.dto.ts b/server/src/immich/api-v1/asset/dto/download-files.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/dto/download-files.dto.ts rename to server/src/immich/api-v1/asset/dto/download-files.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/dto/download-library.dto.ts b/server/src/immich/api-v1/asset/dto/download-library.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/dto/download-library.dto.ts rename to server/src/immich/api-v1/asset/dto/download-library.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/dto/get-asset-by-time-bucket.dto.ts b/server/src/immich/api-v1/asset/dto/get-asset-by-time-bucket.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/dto/get-asset-by-time-bucket.dto.ts rename to server/src/immich/api-v1/asset/dto/get-asset-by-time-bucket.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/dto/get-asset-count-by-time-bucket.dto.ts b/server/src/immich/api-v1/asset/dto/get-asset-count-by-time-bucket.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/dto/get-asset-count-by-time-bucket.dto.ts rename to server/src/immich/api-v1/asset/dto/get-asset-count-by-time-bucket.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/dto/get-asset-thumbnail.dto.ts b/server/src/immich/api-v1/asset/dto/get-asset-thumbnail.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/dto/get-asset-thumbnail.dto.ts rename to server/src/immich/api-v1/asset/dto/get-asset-thumbnail.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/dto/search-asset.dto.ts b/server/src/immich/api-v1/asset/dto/search-asset.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/dto/search-asset.dto.ts rename to server/src/immich/api-v1/asset/dto/search-asset.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/dto/search-properties.dto.ts b/server/src/immich/api-v1/asset/dto/search-properties.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/dto/search-properties.dto.ts rename to server/src/immich/api-v1/asset/dto/search-properties.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/dto/serve-file.dto.ts b/server/src/immich/api-v1/asset/dto/serve-file.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/dto/serve-file.dto.ts rename to server/src/immich/api-v1/asset/dto/serve-file.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/dto/update-asset.dto.ts b/server/src/immich/api-v1/asset/dto/update-asset.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/dto/update-asset.dto.ts rename to server/src/immich/api-v1/asset/dto/update-asset.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/response-dto/asset-check-response.dto.ts b/server/src/immich/api-v1/asset/response-dto/asset-check-response.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/response-dto/asset-check-response.dto.ts rename to server/src/immich/api-v1/asset/response-dto/asset-check-response.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/response-dto/asset-count-by-time-group-response.dto.ts b/server/src/immich/api-v1/asset/response-dto/asset-count-by-time-group-response.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/response-dto/asset-count-by-time-group-response.dto.ts rename to server/src/immich/api-v1/asset/response-dto/asset-count-by-time-group-response.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/response-dto/asset-count-by-user-id-response.dto.ts b/server/src/immich/api-v1/asset/response-dto/asset-count-by-user-id-response.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/response-dto/asset-count-by-user-id-response.dto.ts rename to server/src/immich/api-v1/asset/response-dto/asset-count-by-user-id-response.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/response-dto/asset-file-upload-response.dto.ts b/server/src/immich/api-v1/asset/response-dto/asset-file-upload-response.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/response-dto/asset-file-upload-response.dto.ts rename to server/src/immich/api-v1/asset/response-dto/asset-file-upload-response.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/response-dto/check-duplicate-asset-response.dto.ts b/server/src/immich/api-v1/asset/response-dto/check-duplicate-asset-response.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/response-dto/check-duplicate-asset-response.dto.ts rename to server/src/immich/api-v1/asset/response-dto/check-duplicate-asset-response.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/response-dto/check-existing-assets-response.dto.ts b/server/src/immich/api-v1/asset/response-dto/check-existing-assets-response.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/response-dto/check-existing-assets-response.dto.ts rename to server/src/immich/api-v1/asset/response-dto/check-existing-assets-response.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/response-dto/curated-locations-response.dto.ts b/server/src/immich/api-v1/asset/response-dto/curated-locations-response.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/response-dto/curated-locations-response.dto.ts rename to server/src/immich/api-v1/asset/response-dto/curated-locations-response.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/response-dto/curated-objects-response.dto.ts b/server/src/immich/api-v1/asset/response-dto/curated-objects-response.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/response-dto/curated-objects-response.dto.ts rename to server/src/immich/api-v1/asset/response-dto/curated-objects-response.dto.ts diff --git a/server/apps/immich/src/api-v1/asset/response-dto/delete-asset-response.dto.ts b/server/src/immich/api-v1/asset/response-dto/delete-asset-response.dto.ts similarity index 100% rename from server/apps/immich/src/api-v1/asset/response-dto/delete-asset-response.dto.ts rename to server/src/immich/api-v1/asset/response-dto/delete-asset-response.dto.ts diff --git a/server/apps/immich/src/api-v1/validation/file-not-empty-validator.ts b/server/src/immich/api-v1/validation/file-not-empty-validator.ts similarity index 100% rename from server/apps/immich/src/api-v1/validation/file-not-empty-validator.ts rename to server/src/immich/api-v1/validation/file-not-empty-validator.ts diff --git a/server/apps/immich/src/api-v1/validation/parse-me-uuid-pipe.ts b/server/src/immich/api-v1/validation/parse-me-uuid-pipe.ts similarity index 100% rename from server/apps/immich/src/api-v1/validation/parse-me-uuid-pipe.ts rename to server/src/immich/api-v1/validation/parse-me-uuid-pipe.ts diff --git a/server/apps/immich/src/app.module.ts b/server/src/immich/app.module.ts similarity index 100% rename from server/apps/immich/src/app.module.ts rename to server/src/immich/app.module.ts diff --git a/server/apps/immich/src/app.service.ts b/server/src/immich/app.service.ts similarity index 100% rename from server/apps/immich/src/app.service.ts rename to server/src/immich/app.service.ts diff --git a/server/apps/immich/src/app.utils.ts b/server/src/immich/app.utils.ts similarity index 100% rename from server/apps/immich/src/app.utils.ts rename to server/src/immich/app.utils.ts diff --git a/server/apps/immich/src/config/asset-upload.config.spec.ts b/server/src/immich/config/asset-upload.config.spec.ts similarity index 100% rename from server/apps/immich/src/config/asset-upload.config.spec.ts rename to server/src/immich/config/asset-upload.config.spec.ts diff --git a/server/apps/immich/src/config/asset-upload.config.ts b/server/src/immich/config/asset-upload.config.ts similarity index 100% rename from server/apps/immich/src/config/asset-upload.config.ts rename to server/src/immich/config/asset-upload.config.ts diff --git a/server/apps/immich/src/config/profile-image-upload.config.spec.ts b/server/src/immich/config/profile-image-upload.config.spec.ts similarity index 100% rename from server/apps/immich/src/config/profile-image-upload.config.spec.ts rename to server/src/immich/config/profile-image-upload.config.spec.ts diff --git a/server/apps/immich/src/config/profile-image-upload.config.ts b/server/src/immich/config/profile-image-upload.config.ts similarity index 100% rename from server/apps/immich/src/config/profile-image-upload.config.ts rename to server/src/immich/config/profile-image-upload.config.ts diff --git a/server/apps/immich/src/controllers/album.controller.ts b/server/src/immich/controllers/album.controller.ts similarity index 100% rename from server/apps/immich/src/controllers/album.controller.ts rename to server/src/immich/controllers/album.controller.ts diff --git a/server/apps/immich/src/controllers/api-key.controller.ts b/server/src/immich/controllers/api-key.controller.ts similarity index 100% rename from server/apps/immich/src/controllers/api-key.controller.ts rename to server/src/immich/controllers/api-key.controller.ts diff --git a/server/apps/immich/src/controllers/app.controller.ts b/server/src/immich/controllers/app.controller.ts similarity index 100% rename from server/apps/immich/src/controllers/app.controller.ts rename to server/src/immich/controllers/app.controller.ts diff --git a/server/apps/immich/src/controllers/asset.controller.ts b/server/src/immich/controllers/asset.controller.ts similarity index 100% rename from server/apps/immich/src/controllers/asset.controller.ts rename to server/src/immich/controllers/asset.controller.ts diff --git a/server/apps/immich/src/controllers/auth.controller.ts b/server/src/immich/controllers/auth.controller.ts similarity index 100% rename from server/apps/immich/src/controllers/auth.controller.ts rename to server/src/immich/controllers/auth.controller.ts diff --git a/server/apps/immich/src/controllers/dto/uuid-param.dto.ts b/server/src/immich/controllers/dto/uuid-param.dto.ts similarity index 100% rename from server/apps/immich/src/controllers/dto/uuid-param.dto.ts rename to server/src/immich/controllers/dto/uuid-param.dto.ts diff --git a/server/apps/immich/src/controllers/index.ts b/server/src/immich/controllers/index.ts similarity index 100% rename from server/apps/immich/src/controllers/index.ts rename to server/src/immich/controllers/index.ts diff --git a/server/apps/immich/src/controllers/job.controller.ts b/server/src/immich/controllers/job.controller.ts similarity index 100% rename from server/apps/immich/src/controllers/job.controller.ts rename to server/src/immich/controllers/job.controller.ts diff --git a/server/apps/immich/src/controllers/oauth.controller.ts b/server/src/immich/controllers/oauth.controller.ts similarity index 100% rename from server/apps/immich/src/controllers/oauth.controller.ts rename to server/src/immich/controllers/oauth.controller.ts diff --git a/server/apps/immich/src/controllers/partner.controller.ts b/server/src/immich/controllers/partner.controller.ts similarity index 100% rename from server/apps/immich/src/controllers/partner.controller.ts rename to server/src/immich/controllers/partner.controller.ts diff --git a/server/apps/immich/src/controllers/person.controller.ts b/server/src/immich/controllers/person.controller.ts similarity index 100% rename from server/apps/immich/src/controllers/person.controller.ts rename to server/src/immich/controllers/person.controller.ts diff --git a/server/apps/immich/src/controllers/search.controller.ts b/server/src/immich/controllers/search.controller.ts similarity index 100% rename from server/apps/immich/src/controllers/search.controller.ts rename to server/src/immich/controllers/search.controller.ts diff --git a/server/apps/immich/src/controllers/server-info.controller.ts b/server/src/immich/controllers/server-info.controller.ts similarity index 100% rename from server/apps/immich/src/controllers/server-info.controller.ts rename to server/src/immich/controllers/server-info.controller.ts diff --git a/server/apps/immich/src/controllers/shared-link.controller.ts b/server/src/immich/controllers/shared-link.controller.ts similarity index 100% rename from server/apps/immich/src/controllers/shared-link.controller.ts rename to server/src/immich/controllers/shared-link.controller.ts diff --git a/server/apps/immich/src/controllers/system-config.controller.ts b/server/src/immich/controllers/system-config.controller.ts similarity index 100% rename from server/apps/immich/src/controllers/system-config.controller.ts rename to server/src/immich/controllers/system-config.controller.ts diff --git a/server/apps/immich/src/controllers/tag.controller.ts b/server/src/immich/controllers/tag.controller.ts similarity index 100% rename from server/apps/immich/src/controllers/tag.controller.ts rename to server/src/immich/controllers/tag.controller.ts diff --git a/server/apps/immich/src/controllers/user.controller.ts b/server/src/immich/controllers/user.controller.ts similarity index 100% rename from server/apps/immich/src/controllers/user.controller.ts rename to server/src/immich/controllers/user.controller.ts diff --git a/server/apps/immich/src/decorators/auth-user.decorator.ts b/server/src/immich/decorators/auth-user.decorator.ts similarity index 100% rename from server/apps/immich/src/decorators/auth-user.decorator.ts rename to server/src/immich/decorators/auth-user.decorator.ts diff --git a/server/apps/immich/src/decorators/authenticated.decorator.ts b/server/src/immich/decorators/authenticated.decorator.ts similarity index 100% rename from server/apps/immich/src/decorators/authenticated.decorator.ts rename to server/src/immich/decorators/authenticated.decorator.ts diff --git a/server/apps/immich/src/decorators/use-validation.decorator.ts b/server/src/immich/decorators/use-validation.decorator.ts similarity index 100% rename from server/apps/immich/src/decorators/use-validation.decorator.ts rename to server/src/immich/decorators/use-validation.decorator.ts diff --git a/server/apps/immich/src/decorators/validate-uuid.decorator.ts b/server/src/immich/decorators/validate-uuid.decorator.ts similarity index 100% rename from server/apps/immich/src/decorators/validate-uuid.decorator.ts rename to server/src/immich/decorators/validate-uuid.decorator.ts diff --git a/server/apps/immich/src/main.ts b/server/src/immich/main.ts similarity index 96% rename from server/apps/immich/src/main.ts rename to server/src/immich/main.ts index 015e51b766..80bd976ddd 100644 --- a/server/apps/immich/src/main.ts +++ b/server/src/immich/main.ts @@ -14,7 +14,7 @@ const envName = (process.env.NODE_ENV || 'development').toUpperCase(); const port = Number(process.env.SERVER_PORT) || 3001; const isDev = process.env.NODE_ENV === 'development'; -async function bootstrap() { +export async function bootstrap() { const app = await NestFactory.create(AppModule, { logger: getLogLevels() }); app.set('trust proxy', ['loopback', 'linklocal', 'uniquelocal']); @@ -32,4 +32,3 @@ async function bootstrap() { logger.log(`Immich Server is listening on ${port} [v${SERVER_VERSION}] [${envName}] `); } -bootstrap(); diff --git a/server/apps/immich/src/middlewares/auth.guard.ts b/server/src/immich/middlewares/auth.guard.ts similarity index 100% rename from server/apps/immich/src/middlewares/auth.guard.ts rename to server/src/immich/middlewares/auth.guard.ts diff --git a/server/apps/immich/src/modules/download/download.module.ts b/server/src/immich/modules/download/download.module.ts similarity index 100% rename from server/apps/immich/src/modules/download/download.module.ts rename to server/src/immich/modules/download/download.module.ts diff --git a/server/apps/immich/src/modules/download/download.service.ts b/server/src/immich/modules/download/download.service.ts similarity index 100% rename from server/apps/immich/src/modules/download/download.service.ts rename to server/src/immich/modules/download/download.service.ts diff --git a/server/apps/immich/src/utils/path-form-data.util.ts b/server/src/immich/utils/path-form-data.util.ts similarity index 100% rename from server/apps/immich/src/utils/path-form-data.util.ts rename to server/src/immich/utils/path-form-data.util.ts diff --git a/server/apps/immich/src/utils/transform.util.ts b/server/src/immich/utils/transform.util.ts similarity index 100% rename from server/apps/immich/src/utils/transform.util.ts rename to server/src/immich/utils/transform.util.ts diff --git a/server/libs/infra/src/communication.gateway.ts b/server/src/infra/communication.gateway.ts similarity index 100% rename from server/libs/infra/src/communication.gateway.ts rename to server/src/infra/communication.gateway.ts diff --git a/server/libs/infra/src/database.config.ts b/server/src/infra/database.config.ts similarity index 100% rename from server/libs/infra/src/database.config.ts rename to server/src/infra/database.config.ts diff --git a/server/libs/infra/src/entities/album.entity.ts b/server/src/infra/entities/album.entity.ts similarity index 100% rename from server/libs/infra/src/entities/album.entity.ts rename to server/src/infra/entities/album.entity.ts diff --git a/server/libs/infra/src/entities/api-key.entity.ts b/server/src/infra/entities/api-key.entity.ts similarity index 100% rename from server/libs/infra/src/entities/api-key.entity.ts rename to server/src/infra/entities/api-key.entity.ts diff --git a/server/libs/infra/src/entities/asset-face.entity.ts b/server/src/infra/entities/asset-face.entity.ts similarity index 100% rename from server/libs/infra/src/entities/asset-face.entity.ts rename to server/src/infra/entities/asset-face.entity.ts diff --git a/server/libs/infra/src/entities/asset.entity.ts b/server/src/infra/entities/asset.entity.ts similarity index 100% rename from server/libs/infra/src/entities/asset.entity.ts rename to server/src/infra/entities/asset.entity.ts diff --git a/server/libs/infra/src/entities/exif.entity.ts b/server/src/infra/entities/exif.entity.ts similarity index 100% rename from server/libs/infra/src/entities/exif.entity.ts rename to server/src/infra/entities/exif.entity.ts diff --git a/server/libs/infra/src/entities/index.ts b/server/src/infra/entities/index.ts similarity index 100% rename from server/libs/infra/src/entities/index.ts rename to server/src/infra/entities/index.ts diff --git a/server/libs/infra/src/entities/partner.entity.ts b/server/src/infra/entities/partner.entity.ts similarity index 100% rename from server/libs/infra/src/entities/partner.entity.ts rename to server/src/infra/entities/partner.entity.ts diff --git a/server/libs/infra/src/entities/person.entity.ts b/server/src/infra/entities/person.entity.ts similarity index 100% rename from server/libs/infra/src/entities/person.entity.ts rename to server/src/infra/entities/person.entity.ts diff --git a/server/libs/infra/src/entities/shared-link.entity.ts b/server/src/infra/entities/shared-link.entity.ts similarity index 100% rename from server/libs/infra/src/entities/shared-link.entity.ts rename to server/src/infra/entities/shared-link.entity.ts diff --git a/server/libs/infra/src/entities/smart-info.entity.ts b/server/src/infra/entities/smart-info.entity.ts similarity index 100% rename from server/libs/infra/src/entities/smart-info.entity.ts rename to server/src/infra/entities/smart-info.entity.ts diff --git a/server/libs/infra/src/entities/system-config.entity.ts b/server/src/infra/entities/system-config.entity.ts similarity index 98% rename from server/libs/infra/src/entities/system-config.entity.ts rename to server/src/infra/entities/system-config.entity.ts index 81c7df1802..0bcb4cf4e5 100644 --- a/server/libs/infra/src/entities/system-config.entity.ts +++ b/server/src/infra/entities/system-config.entity.ts @@ -1,5 +1,5 @@ import { Column, Entity, PrimaryColumn } from 'typeorm'; -import { QueueName } from '../../../domain/src'; +import { QueueName } from '@app/domain/job/job.constants'; @Entity('system_config') export class SystemConfigEntity { diff --git a/server/libs/infra/src/entities/tag.entity.ts b/server/src/infra/entities/tag.entity.ts similarity index 100% rename from server/libs/infra/src/entities/tag.entity.ts rename to server/src/infra/entities/tag.entity.ts diff --git a/server/libs/infra/src/entities/user-token.entity.ts b/server/src/infra/entities/user-token.entity.ts similarity index 100% rename from server/libs/infra/src/entities/user-token.entity.ts rename to server/src/infra/entities/user-token.entity.ts diff --git a/server/libs/infra/src/entities/user.entity.ts b/server/src/infra/entities/user.entity.ts similarity index 100% rename from server/libs/infra/src/entities/user.entity.ts rename to server/src/infra/entities/user.entity.ts diff --git a/server/libs/infra/src/index.ts b/server/src/infra/index.ts similarity index 100% rename from server/libs/infra/src/index.ts rename to server/src/infra/index.ts diff --git a/server/libs/infra/src/infra.config.ts b/server/src/infra/infra.config.ts similarity index 100% rename from server/libs/infra/src/infra.config.ts rename to server/src/infra/infra.config.ts diff --git a/server/libs/infra/src/infra.module.ts b/server/src/infra/infra.module.ts similarity index 100% rename from server/libs/infra/src/infra.module.ts rename to server/src/infra/infra.module.ts diff --git a/server/libs/infra/src/migrations/1645130759468-CreateUserTable.ts b/server/src/infra/migrations/1645130759468-CreateUserTable.ts similarity index 100% rename from server/libs/infra/src/migrations/1645130759468-CreateUserTable.ts rename to server/src/infra/migrations/1645130759468-CreateUserTable.ts diff --git a/server/libs/infra/src/migrations/1645130777674-CreateDeviceInfoTable.ts b/server/src/infra/migrations/1645130777674-CreateDeviceInfoTable.ts similarity index 100% rename from server/libs/infra/src/migrations/1645130777674-CreateDeviceInfoTable.ts rename to server/src/infra/migrations/1645130777674-CreateDeviceInfoTable.ts diff --git a/server/libs/infra/src/migrations/1645130805273-CreateAssetsTable.ts b/server/src/infra/migrations/1645130805273-CreateAssetsTable.ts similarity index 100% rename from server/libs/infra/src/migrations/1645130805273-CreateAssetsTable.ts rename to server/src/infra/migrations/1645130805273-CreateAssetsTable.ts diff --git a/server/libs/infra/src/migrations/1645130817965-CreateExifTable.ts b/server/src/infra/migrations/1645130817965-CreateExifTable.ts similarity index 100% rename from server/libs/infra/src/migrations/1645130817965-CreateExifTable.ts rename to server/src/infra/migrations/1645130817965-CreateExifTable.ts diff --git a/server/libs/infra/src/migrations/1645130870184-CreateSmartInfoTable.ts b/server/src/infra/migrations/1645130870184-CreateSmartInfoTable.ts similarity index 100% rename from server/libs/infra/src/migrations/1645130870184-CreateSmartInfoTable.ts rename to server/src/infra/migrations/1645130870184-CreateSmartInfoTable.ts diff --git a/server/libs/infra/src/migrations/1646249209023-AddExifTextSearchColumn.ts b/server/src/infra/migrations/1646249209023-AddExifTextSearchColumn.ts similarity index 100% rename from server/libs/infra/src/migrations/1646249209023-AddExifTextSearchColumn.ts rename to server/src/infra/migrations/1646249209023-AddExifTextSearchColumn.ts diff --git a/server/libs/infra/src/migrations/1646249734844-CreateExifTextSearchIndex.ts b/server/src/infra/migrations/1646249734844-CreateExifTextSearchIndex.ts similarity index 100% rename from server/libs/infra/src/migrations/1646249734844-CreateExifTextSearchIndex.ts rename to server/src/infra/migrations/1646249734844-CreateExifTextSearchIndex.ts diff --git a/server/libs/infra/src/migrations/1646709533213-AddRegionCityToExIf.ts b/server/src/infra/migrations/1646709533213-AddRegionCityToExIf.ts similarity index 100% rename from server/libs/infra/src/migrations/1646709533213-AddRegionCityToExIf.ts rename to server/src/infra/migrations/1646709533213-AddRegionCityToExIf.ts diff --git a/server/libs/infra/src/migrations/1646710459852-AddLocationToExifTextSearch.ts b/server/src/infra/migrations/1646710459852-AddLocationToExifTextSearch.ts similarity index 100% rename from server/libs/infra/src/migrations/1646710459852-AddLocationToExifTextSearch.ts rename to server/src/infra/migrations/1646710459852-AddLocationToExifTextSearch.ts diff --git a/server/libs/infra/src/migrations/1648317474768-AddObjectColumnToSmartInfo.ts b/server/src/infra/migrations/1648317474768-AddObjectColumnToSmartInfo.ts similarity index 100% rename from server/libs/infra/src/migrations/1648317474768-AddObjectColumnToSmartInfo.ts rename to server/src/infra/migrations/1648317474768-AddObjectColumnToSmartInfo.ts diff --git a/server/libs/infra/src/migrations/1649643216111-CreateSharedAlbumAndRelatedTables.ts b/server/src/infra/migrations/1649643216111-CreateSharedAlbumAndRelatedTables.ts similarity index 100% rename from server/libs/infra/src/migrations/1649643216111-CreateSharedAlbumAndRelatedTables.ts rename to server/src/infra/migrations/1649643216111-CreateSharedAlbumAndRelatedTables.ts diff --git a/server/libs/infra/src/migrations/1652633525943-UpdateUserTableWithAdminAndName.ts b/server/src/infra/migrations/1652633525943-UpdateUserTableWithAdminAndName.ts similarity index 100% rename from server/libs/infra/src/migrations/1652633525943-UpdateUserTableWithAdminAndName.ts rename to server/src/infra/migrations/1652633525943-UpdateUserTableWithAdminAndName.ts diff --git a/server/libs/infra/src/migrations/1653214255670-UpdateAssetTableWithWebpPath.ts b/server/src/infra/migrations/1653214255670-UpdateAssetTableWithWebpPath.ts similarity index 100% rename from server/libs/infra/src/migrations/1653214255670-UpdateAssetTableWithWebpPath.ts rename to server/src/infra/migrations/1653214255670-UpdateAssetTableWithWebpPath.ts diff --git a/server/libs/infra/src/migrations/1654299904583-UpdateAssetTableWithEncodeVideoPath.ts b/server/src/infra/migrations/1654299904583-UpdateAssetTableWithEncodeVideoPath.ts similarity index 100% rename from server/libs/infra/src/migrations/1654299904583-UpdateAssetTableWithEncodeVideoPath.ts rename to server/src/infra/migrations/1654299904583-UpdateAssetTableWithEncodeVideoPath.ts diff --git a/server/libs/infra/src/migrations/1655401127251-RenameSharedAlbums.ts b/server/src/infra/migrations/1655401127251-RenameSharedAlbums.ts similarity index 100% rename from server/libs/infra/src/migrations/1655401127251-RenameSharedAlbums.ts rename to server/src/infra/migrations/1655401127251-RenameSharedAlbums.ts diff --git a/server/libs/infra/src/migrations/1656338626260-RenameIsFirstLoggedInColumn.ts b/server/src/infra/migrations/1656338626260-RenameIsFirstLoggedInColumn.ts similarity index 100% rename from server/libs/infra/src/migrations/1656338626260-RenameIsFirstLoggedInColumn.ts rename to server/src/infra/migrations/1656338626260-RenameIsFirstLoggedInColumn.ts diff --git a/server/libs/infra/src/migrations/1656888591977-RenameAssetAlbumIdSequence.ts b/server/src/infra/migrations/1656888591977-RenameAssetAlbumIdSequence.ts similarity index 100% rename from server/libs/infra/src/migrations/1656888591977-RenameAssetAlbumIdSequence.ts rename to server/src/infra/migrations/1656888591977-RenameAssetAlbumIdSequence.ts diff --git a/server/libs/infra/src/migrations/1656888918620-DropExifTextSearchableColumn.ts b/server/src/infra/migrations/1656888918620-DropExifTextSearchableColumn.ts similarity index 100% rename from server/libs/infra/src/migrations/1656888918620-DropExifTextSearchableColumn.ts rename to server/src/infra/migrations/1656888918620-DropExifTextSearchableColumn.ts diff --git a/server/libs/infra/src/migrations/1656889061566-MatchMigrationsWithTypeORMEntities.ts b/server/src/infra/migrations/1656889061566-MatchMigrationsWithTypeORMEntities.ts similarity index 100% rename from server/libs/infra/src/migrations/1656889061566-MatchMigrationsWithTypeORMEntities.ts rename to server/src/infra/migrations/1656889061566-MatchMigrationsWithTypeORMEntities.ts diff --git a/server/libs/infra/src/migrations/1658860470248-AddExifImageNameAsSearchableText.ts b/server/src/infra/migrations/1658860470248-AddExifImageNameAsSearchableText.ts similarity index 100% rename from server/libs/infra/src/migrations/1658860470248-AddExifImageNameAsSearchableText.ts rename to server/src/infra/migrations/1658860470248-AddExifImageNameAsSearchableText.ts diff --git a/server/libs/infra/src/migrations/1661011331242-AddCaption.ts b/server/src/infra/migrations/1661011331242-AddCaption.ts similarity index 100% rename from server/libs/infra/src/migrations/1661011331242-AddCaption.ts rename to server/src/infra/migrations/1661011331242-AddCaption.ts diff --git a/server/libs/infra/src/migrations/1661528919411-ChangeExifFileSizeInByteToBigInt.ts b/server/src/infra/migrations/1661528919411-ChangeExifFileSizeInByteToBigInt.ts similarity index 100% rename from server/libs/infra/src/migrations/1661528919411-ChangeExifFileSizeInByteToBigInt.ts rename to server/src/infra/migrations/1661528919411-ChangeExifFileSizeInByteToBigInt.ts diff --git a/server/libs/infra/src/migrations/1661881837496-AddAssetChecksum.ts b/server/src/infra/migrations/1661881837496-AddAssetChecksum.ts similarity index 100% rename from server/libs/infra/src/migrations/1661881837496-AddAssetChecksum.ts rename to server/src/infra/migrations/1661881837496-AddAssetChecksum.ts diff --git a/server/libs/infra/src/migrations/1661971370662-UpdateAssetTableWithNewUniqueConstraint.ts b/server/src/infra/migrations/1661971370662-UpdateAssetTableWithNewUniqueConstraint.ts similarity index 100% rename from server/libs/infra/src/migrations/1661971370662-UpdateAssetTableWithNewUniqueConstraint.ts rename to server/src/infra/migrations/1661971370662-UpdateAssetTableWithNewUniqueConstraint.ts diff --git a/server/libs/infra/src/migrations/1662427365521-FixTimestampDataTypeInAssetTable.ts b/server/src/infra/migrations/1662427365521-FixTimestampDataTypeInAssetTable.ts similarity index 100% rename from server/libs/infra/src/migrations/1662427365521-FixTimestampDataTypeInAssetTable.ts rename to server/src/infra/migrations/1662427365521-FixTimestampDataTypeInAssetTable.ts diff --git a/server/libs/infra/src/migrations/1665540663419-CreateSystemConfigTable.ts b/server/src/infra/migrations/1665540663419-CreateSystemConfigTable.ts similarity index 100% rename from server/libs/infra/src/migrations/1665540663419-CreateSystemConfigTable.ts rename to server/src/infra/migrations/1665540663419-CreateSystemConfigTable.ts diff --git a/server/libs/infra/src/migrations/1667762360744-AddingDeletedAtColumnInUserEntity.ts b/server/src/infra/migrations/1667762360744-AddingDeletedAtColumnInUserEntity.ts similarity index 100% rename from server/libs/infra/src/migrations/1667762360744-AddingDeletedAtColumnInUserEntity.ts rename to server/src/infra/migrations/1667762360744-AddingDeletedAtColumnInUserEntity.ts diff --git a/server/libs/infra/src/migrations/1668383120461-AddLivePhotosRelatedColumnToAssetTable.ts b/server/src/infra/migrations/1668383120461-AddLivePhotosRelatedColumnToAssetTable.ts similarity index 100% rename from server/libs/infra/src/migrations/1668383120461-AddLivePhotosRelatedColumnToAssetTable.ts rename to server/src/infra/migrations/1668383120461-AddLivePhotosRelatedColumnToAssetTable.ts diff --git a/server/libs/infra/src/migrations/1668835311083-UpdateUserTableForOIDC.ts b/server/src/infra/migrations/1668835311083-UpdateUserTableForOIDC.ts similarity index 100% rename from server/libs/infra/src/migrations/1668835311083-UpdateUserTableForOIDC.ts rename to server/src/infra/migrations/1668835311083-UpdateUserTableForOIDC.ts diff --git a/server/libs/infra/src/migrations/1670104716264-OAuthId.ts b/server/src/infra/migrations/1670104716264-OAuthId.ts similarity index 100% rename from server/libs/infra/src/migrations/1670104716264-OAuthId.ts rename to server/src/infra/migrations/1670104716264-OAuthId.ts diff --git a/server/libs/infra/src/migrations/1670257571385-CreateTagsTable.ts b/server/src/infra/migrations/1670257571385-CreateTagsTable.ts similarity index 100% rename from server/libs/infra/src/migrations/1670257571385-CreateTagsTable.ts rename to server/src/infra/migrations/1670257571385-CreateTagsTable.ts diff --git a/server/libs/infra/src/migrations/1670607437008-TruncateOldConfigItems.ts b/server/src/infra/migrations/1670607437008-TruncateOldConfigItems.ts similarity index 100% rename from server/libs/infra/src/migrations/1670607437008-TruncateOldConfigItems.ts rename to server/src/infra/migrations/1670607437008-TruncateOldConfigItems.ts diff --git a/server/libs/infra/src/migrations/1670633210032-AddUserEmailUniqueConstraint.ts b/server/src/infra/migrations/1670633210032-AddUserEmailUniqueConstraint.ts similarity index 100% rename from server/libs/infra/src/migrations/1670633210032-AddUserEmailUniqueConstraint.ts rename to server/src/infra/migrations/1670633210032-AddUserEmailUniqueConstraint.ts diff --git a/server/libs/infra/src/migrations/1672109862870-DropSaltColumn.ts b/server/src/infra/migrations/1672109862870-DropSaltColumn.ts similarity index 100% rename from server/libs/infra/src/migrations/1672109862870-DropSaltColumn.ts rename to server/src/infra/migrations/1672109862870-DropSaltColumn.ts diff --git a/server/libs/infra/src/migrations/1672502270115-AddAPIKeys.ts b/server/src/infra/migrations/1672502270115-AddAPIKeys.ts similarity index 100% rename from server/libs/infra/src/migrations/1672502270115-AddAPIKeys.ts rename to server/src/infra/migrations/1672502270115-AddAPIKeys.ts diff --git a/server/libs/infra/src/migrations/1673150490490-AddSharedLinkTable.ts b/server/src/infra/migrations/1673150490490-AddSharedLinkTable.ts similarity index 100% rename from server/libs/infra/src/migrations/1673150490490-AddSharedLinkTable.ts rename to server/src/infra/migrations/1673150490490-AddSharedLinkTable.ts diff --git a/server/libs/infra/src/migrations/1673907194740-AddMorePermissionToSharedLink.ts b/server/src/infra/migrations/1673907194740-AddMorePermissionToSharedLink.ts similarity index 100% rename from server/libs/infra/src/migrations/1673907194740-AddMorePermissionToSharedLink.ts rename to server/src/infra/migrations/1673907194740-AddMorePermissionToSharedLink.ts diff --git a/server/libs/infra/src/migrations/1674263302005-RemoveVideoCodecConfigOption.ts b/server/src/infra/migrations/1674263302005-RemoveVideoCodecConfigOption.ts similarity index 100% rename from server/libs/infra/src/migrations/1674263302005-RemoveVideoCodecConfigOption.ts rename to server/src/infra/migrations/1674263302005-RemoveVideoCodecConfigOption.ts diff --git a/server/libs/infra/src/migrations/1674342044239-CreateUserTokenEntity.ts b/server/src/infra/migrations/1674342044239-CreateUserTokenEntity.ts similarity index 100% rename from server/libs/infra/src/migrations/1674342044239-CreateUserTokenEntity.ts rename to server/src/infra/migrations/1674342044239-CreateUserTokenEntity.ts diff --git a/server/libs/infra/src/migrations/1674757936889-AlterExifExposureTimeToString.ts b/server/src/infra/migrations/1674757936889-AlterExifExposureTimeToString.ts similarity index 100% rename from server/libs/infra/src/migrations/1674757936889-AlterExifExposureTimeToString.ts rename to server/src/infra/migrations/1674757936889-AlterExifExposureTimeToString.ts diff --git a/server/libs/infra/src/migrations/1674774248319-TruncateAPIKeys.ts b/server/src/infra/migrations/1674774248319-TruncateAPIKeys.ts similarity index 100% rename from server/libs/infra/src/migrations/1674774248319-TruncateAPIKeys.ts rename to server/src/infra/migrations/1674774248319-TruncateAPIKeys.ts diff --git a/server/libs/infra/src/migrations/1674939383309-AddSharedLinkUserForeignKeyConstraint.ts b/server/src/infra/migrations/1674939383309-AddSharedLinkUserForeignKeyConstraint.ts similarity index 100% rename from server/libs/infra/src/migrations/1674939383309-AddSharedLinkUserForeignKeyConstraint.ts rename to server/src/infra/migrations/1674939383309-AddSharedLinkUserForeignKeyConstraint.ts diff --git a/server/libs/infra/src/migrations/1675667878312-AddUpdatedAtColumnToAlbumsUsersAssets.ts b/server/src/infra/migrations/1675667878312-AddUpdatedAtColumnToAlbumsUsersAssets.ts similarity index 100% rename from server/libs/infra/src/migrations/1675667878312-AddUpdatedAtColumnToAlbumsUsersAssets.ts rename to server/src/infra/migrations/1675667878312-AddUpdatedAtColumnToAlbumsUsersAssets.ts diff --git a/server/libs/infra/src/migrations/1675701909594-AddAlbumUserForeignKeyConstraint.ts b/server/src/infra/migrations/1675701909594-AddAlbumUserForeignKeyConstraint.ts similarity index 100% rename from server/libs/infra/src/migrations/1675701909594-AddAlbumUserForeignKeyConstraint.ts rename to server/src/infra/migrations/1675701909594-AddAlbumUserForeignKeyConstraint.ts diff --git a/server/libs/infra/src/migrations/1675808874445-APIKeyUUIDPrimaryKey.ts b/server/src/infra/migrations/1675808874445-APIKeyUUIDPrimaryKey.ts similarity index 100% rename from server/libs/infra/src/migrations/1675808874445-APIKeyUUIDPrimaryKey.ts rename to server/src/infra/migrations/1675808874445-APIKeyUUIDPrimaryKey.ts diff --git a/server/libs/infra/src/migrations/1675812532822-FixAlbumEntityTypeORM.ts b/server/src/infra/migrations/1675812532822-FixAlbumEntityTypeORM.ts similarity index 100% rename from server/libs/infra/src/migrations/1675812532822-FixAlbumEntityTypeORM.ts rename to server/src/infra/migrations/1675812532822-FixAlbumEntityTypeORM.ts diff --git a/server/libs/infra/src/migrations/1676437878377-AppleContentIdentifier.ts b/server/src/infra/migrations/1676437878377-AppleContentIdentifier.ts similarity index 100% rename from server/libs/infra/src/migrations/1676437878377-AppleContentIdentifier.ts rename to server/src/infra/migrations/1676437878377-AppleContentIdentifier.ts diff --git a/server/libs/infra/src/migrations/1676680127415-FixAssetRelations.ts b/server/src/infra/migrations/1676680127415-FixAssetRelations.ts similarity index 100% rename from server/libs/infra/src/migrations/1676680127415-FixAssetRelations.ts rename to server/src/infra/migrations/1676680127415-FixAssetRelations.ts diff --git a/server/libs/infra/src/migrations/1676721296440-AssetCreatedAtField.ts b/server/src/infra/migrations/1676721296440-AssetCreatedAtField.ts similarity index 100% rename from server/libs/infra/src/migrations/1676721296440-AssetCreatedAtField.ts rename to server/src/infra/migrations/1676721296440-AssetCreatedAtField.ts diff --git a/server/libs/infra/src/migrations/1676848629119-ExifEntityDefinitionFixes.ts b/server/src/infra/migrations/1676848629119-ExifEntityDefinitionFixes.ts similarity index 100% rename from server/libs/infra/src/migrations/1676848629119-ExifEntityDefinitionFixes.ts rename to server/src/infra/migrations/1676848629119-ExifEntityDefinitionFixes.ts diff --git a/server/libs/infra/src/migrations/1676848694786-SharedLinkEntityDefinitionFixes.ts b/server/src/infra/migrations/1676848694786-SharedLinkEntityDefinitionFixes.ts similarity index 100% rename from server/libs/infra/src/migrations/1676848694786-SharedLinkEntityDefinitionFixes.ts rename to server/src/infra/migrations/1676848694786-SharedLinkEntityDefinitionFixes.ts diff --git a/server/libs/infra/src/migrations/1676852143506-SmartInfoEntityDefinitionFixes.ts b/server/src/infra/migrations/1676852143506-SmartInfoEntityDefinitionFixes.ts similarity index 100% rename from server/libs/infra/src/migrations/1676852143506-SmartInfoEntityDefinitionFixes.ts rename to server/src/infra/migrations/1676852143506-SmartInfoEntityDefinitionFixes.ts diff --git a/server/libs/infra/src/migrations/1677497925328-AddExifTimeZone.ts b/server/src/infra/migrations/1677497925328-AddExifTimeZone.ts similarity index 100% rename from server/libs/infra/src/migrations/1677497925328-AddExifTimeZone.ts rename to server/src/infra/migrations/1677497925328-AddExifTimeZone.ts diff --git a/server/libs/infra/src/migrations/1677535643119-AddIndexForAlbumInSharedLinkTable.ts b/server/src/infra/migrations/1677535643119-AddIndexForAlbumInSharedLinkTable.ts similarity index 100% rename from server/libs/infra/src/migrations/1677535643119-AddIndexForAlbumInSharedLinkTable.ts rename to server/src/infra/migrations/1677535643119-AddIndexForAlbumInSharedLinkTable.ts diff --git a/server/libs/infra/src/migrations/1677613712565-AlbumThumbnailRelation.ts b/server/src/infra/migrations/1677613712565-AlbumThumbnailRelation.ts similarity index 100% rename from server/libs/infra/src/migrations/1677613712565-AlbumThumbnailRelation.ts rename to server/src/infra/migrations/1677613712565-AlbumThumbnailRelation.ts diff --git a/server/libs/infra/src/migrations/1677971458822-AddCLIPEncodeDataColumn.ts b/server/src/infra/migrations/1677971458822-AddCLIPEncodeDataColumn.ts similarity index 100% rename from server/libs/infra/src/migrations/1677971458822-AddCLIPEncodeDataColumn.ts rename to server/src/infra/migrations/1677971458822-AddCLIPEncodeDataColumn.ts diff --git a/server/libs/infra/src/migrations/1679751316282-UpdateTranscodeOption.ts b/server/src/infra/migrations/1679751316282-UpdateTranscodeOption.ts similarity index 100% rename from server/libs/infra/src/migrations/1679751316282-UpdateTranscodeOption.ts rename to server/src/infra/migrations/1679751316282-UpdateTranscodeOption.ts diff --git a/server/libs/infra/src/migrations/1679901204458-ClipEmbeddingFloat4.ts b/server/src/infra/migrations/1679901204458-ClipEmbeddingFloat4.ts similarity index 100% rename from server/libs/infra/src/migrations/1679901204458-ClipEmbeddingFloat4.ts rename to server/src/infra/migrations/1679901204458-ClipEmbeddingFloat4.ts diff --git a/server/libs/infra/src/migrations/1680632845740-AddIsArchivedColumn.ts b/server/src/infra/migrations/1680632845740-AddIsArchivedColumn.ts similarity index 100% rename from server/libs/infra/src/migrations/1680632845740-AddIsArchivedColumn.ts rename to server/src/infra/migrations/1680632845740-AddIsArchivedColumn.ts diff --git a/server/libs/infra/src/migrations/1680694465853-RemoveRedundantConstraints.ts b/server/src/infra/migrations/1680694465853-RemoveRedundantConstraints.ts similarity index 100% rename from server/libs/infra/src/migrations/1680694465853-RemoveRedundantConstraints.ts rename to server/src/infra/migrations/1680694465853-RemoveRedundantConstraints.ts diff --git a/server/libs/infra/src/migrations/1681144628393-AddOriginalFileNameToAssetTable.ts b/server/src/infra/migrations/1681144628393-AddOriginalFileNameToAssetTable.ts similarity index 100% rename from server/libs/infra/src/migrations/1681144628393-AddOriginalFileNameToAssetTable.ts rename to server/src/infra/migrations/1681144628393-AddOriginalFileNameToAssetTable.ts diff --git a/server/libs/infra/src/migrations/1681159594469-RemoveImageNameFromEXIFTable.ts b/server/src/infra/migrations/1681159594469-RemoveImageNameFromEXIFTable.ts similarity index 100% rename from server/libs/infra/src/migrations/1681159594469-RemoveImageNameFromEXIFTable.ts rename to server/src/infra/migrations/1681159594469-RemoveImageNameFromEXIFTable.ts diff --git a/server/libs/infra/src/migrations/1682371561743-FixNullableRelations.ts b/server/src/infra/migrations/1682371561743-FixNullableRelations.ts similarity index 100% rename from server/libs/infra/src/migrations/1682371561743-FixNullableRelations.ts rename to server/src/infra/migrations/1682371561743-FixNullableRelations.ts diff --git a/server/libs/infra/src/migrations/1682371791038-AddDeviceInfoToUserToken.ts b/server/src/infra/migrations/1682371791038-AddDeviceInfoToUserToken.ts similarity index 100% rename from server/libs/infra/src/migrations/1682371791038-AddDeviceInfoToUserToken.ts rename to server/src/infra/migrations/1682371791038-AddDeviceInfoToUserToken.ts diff --git a/server/libs/infra/src/migrations/1682710252424-DropDeviceInfoTable.ts b/server/src/infra/migrations/1682710252424-DropDeviceInfoTable.ts similarity index 100% rename from server/libs/infra/src/migrations/1682710252424-DropDeviceInfoTable.ts rename to server/src/infra/migrations/1682710252424-DropDeviceInfoTable.ts diff --git a/server/libs/infra/src/migrations/1683808254676-AddPartnersTable.ts b/server/src/infra/migrations/1683808254676-AddPartnersTable.ts similarity index 100% rename from server/libs/infra/src/migrations/1683808254676-AddPartnersTable.ts rename to server/src/infra/migrations/1683808254676-AddPartnersTable.ts diff --git a/server/libs/infra/src/migrations/1684255168091-AddFacialTables.ts b/server/src/infra/migrations/1684255168091-AddFacialTables.ts similarity index 100% rename from server/libs/infra/src/migrations/1684255168091-AddFacialTables.ts rename to server/src/infra/migrations/1684255168091-AddFacialTables.ts diff --git a/server/libs/infra/src/migrations/1684273840676-AddSidecarFile.ts b/server/src/infra/migrations/1684273840676-AddSidecarFile.ts similarity index 100% rename from server/libs/infra/src/migrations/1684273840676-AddSidecarFile.ts rename to server/src/infra/migrations/1684273840676-AddSidecarFile.ts diff --git a/server/libs/infra/src/migrations/1684328185099-RequireChecksumNotNull.ts b/server/src/infra/migrations/1684328185099-RequireChecksumNotNull.ts similarity index 100% rename from server/libs/infra/src/migrations/1684328185099-RequireChecksumNotNull.ts rename to server/src/infra/migrations/1684328185099-RequireChecksumNotNull.ts diff --git a/server/libs/infra/src/migrations/1684410565398-AddStorageLabel.ts b/server/src/infra/migrations/1684410565398-AddStorageLabel.ts similarity index 100% rename from server/libs/infra/src/migrations/1684410565398-AddStorageLabel.ts rename to server/src/infra/migrations/1684410565398-AddStorageLabel.ts diff --git a/server/libs/infra/src/migrations/1684867360825-AddUserTokenAndAPIKeyCascades.ts b/server/src/infra/migrations/1684867360825-AddUserTokenAndAPIKeyCascades.ts similarity index 100% rename from server/libs/infra/src/migrations/1684867360825-AddUserTokenAndAPIKeyCascades.ts rename to server/src/infra/migrations/1684867360825-AddUserTokenAndAPIKeyCascades.ts diff --git a/server/libs/infra/src/migrations/1685044328272-AddSharedLinkCascade.ts b/server/src/infra/migrations/1685044328272-AddSharedLinkCascade.ts similarity index 100% rename from server/libs/infra/src/migrations/1685044328272-AddSharedLinkCascade.ts rename to server/src/infra/migrations/1685044328272-AddSharedLinkCascade.ts diff --git a/server/libs/infra/src/migrations/1685370430343-UserDatesTimestamptz.ts b/server/src/infra/migrations/1685370430343-UserDatesTimestamptz.ts similarity index 100% rename from server/libs/infra/src/migrations/1685370430343-UserDatesTimestamptz.ts rename to server/src/infra/migrations/1685370430343-UserDatesTimestamptz.ts diff --git a/server/libs/infra/src/migrations/1685731372040-RemoveInvalidCoordinates.ts b/server/src/infra/migrations/1685731372040-RemoveInvalidCoordinates.ts similarity index 100% rename from server/libs/infra/src/migrations/1685731372040-RemoveInvalidCoordinates.ts rename to server/src/infra/migrations/1685731372040-RemoveInvalidCoordinates.ts diff --git a/server/libs/infra/src/redis-io.adapter.ts b/server/src/infra/redis-io.adapter.ts similarity index 100% rename from server/libs/infra/src/redis-io.adapter.ts rename to server/src/infra/redis-io.adapter.ts diff --git a/server/libs/infra/src/repositories/access.repository.ts b/server/src/infra/repositories/access.repository.ts similarity index 100% rename from server/libs/infra/src/repositories/access.repository.ts rename to server/src/infra/repositories/access.repository.ts diff --git a/server/libs/infra/src/repositories/album.repository.ts b/server/src/infra/repositories/album.repository.ts similarity index 100% rename from server/libs/infra/src/repositories/album.repository.ts rename to server/src/infra/repositories/album.repository.ts diff --git a/server/libs/infra/src/repositories/api-key.repository.ts b/server/src/infra/repositories/api-key.repository.ts similarity index 100% rename from server/libs/infra/src/repositories/api-key.repository.ts rename to server/src/infra/repositories/api-key.repository.ts diff --git a/server/libs/infra/src/repositories/asset.repository.ts b/server/src/infra/repositories/asset.repository.ts similarity index 100% rename from server/libs/infra/src/repositories/asset.repository.ts rename to server/src/infra/repositories/asset.repository.ts diff --git a/server/libs/infra/src/repositories/communication.repository.ts b/server/src/infra/repositories/communication.repository.ts similarity index 100% rename from server/libs/infra/src/repositories/communication.repository.ts rename to server/src/infra/repositories/communication.repository.ts diff --git a/server/libs/infra/src/repositories/crypto.repository.ts b/server/src/infra/repositories/crypto.repository.ts similarity index 100% rename from server/libs/infra/src/repositories/crypto.repository.ts rename to server/src/infra/repositories/crypto.repository.ts diff --git a/server/libs/infra/src/repositories/face.repository.ts b/server/src/infra/repositories/face.repository.ts similarity index 100% rename from server/libs/infra/src/repositories/face.repository.ts rename to server/src/infra/repositories/face.repository.ts diff --git a/server/libs/infra/src/repositories/filesystem.provider.ts b/server/src/infra/repositories/filesystem.provider.ts similarity index 100% rename from server/libs/infra/src/repositories/filesystem.provider.ts rename to server/src/infra/repositories/filesystem.provider.ts diff --git a/server/libs/infra/src/repositories/geocoding.repository.ts b/server/src/infra/repositories/geocoding.repository.ts similarity index 100% rename from server/libs/infra/src/repositories/geocoding.repository.ts rename to server/src/infra/repositories/geocoding.repository.ts diff --git a/server/libs/infra/src/repositories/index.ts b/server/src/infra/repositories/index.ts similarity index 100% rename from server/libs/infra/src/repositories/index.ts rename to server/src/infra/repositories/index.ts diff --git a/server/libs/infra/src/repositories/job.repository.ts b/server/src/infra/repositories/job.repository.ts similarity index 100% rename from server/libs/infra/src/repositories/job.repository.ts rename to server/src/infra/repositories/job.repository.ts diff --git a/server/libs/infra/src/repositories/machine-learning.repository.ts b/server/src/infra/repositories/machine-learning.repository.ts similarity index 100% rename from server/libs/infra/src/repositories/machine-learning.repository.ts rename to server/src/infra/repositories/machine-learning.repository.ts diff --git a/server/libs/infra/src/repositories/media.repository.ts b/server/src/infra/repositories/media.repository.ts similarity index 100% rename from server/libs/infra/src/repositories/media.repository.ts rename to server/src/infra/repositories/media.repository.ts diff --git a/server/libs/infra/src/repositories/partner.repository.ts b/server/src/infra/repositories/partner.repository.ts similarity index 100% rename from server/libs/infra/src/repositories/partner.repository.ts rename to server/src/infra/repositories/partner.repository.ts diff --git a/server/libs/infra/src/repositories/person.repository.ts b/server/src/infra/repositories/person.repository.ts similarity index 100% rename from server/libs/infra/src/repositories/person.repository.ts rename to server/src/infra/repositories/person.repository.ts diff --git a/server/libs/infra/src/repositories/shared-link.repository.ts b/server/src/infra/repositories/shared-link.repository.ts similarity index 100% rename from server/libs/infra/src/repositories/shared-link.repository.ts rename to server/src/infra/repositories/shared-link.repository.ts diff --git a/server/libs/infra/src/repositories/smart-info.repository.ts b/server/src/infra/repositories/smart-info.repository.ts similarity index 100% rename from server/libs/infra/src/repositories/smart-info.repository.ts rename to server/src/infra/repositories/smart-info.repository.ts diff --git a/server/libs/infra/src/repositories/system-config.repository.ts b/server/src/infra/repositories/system-config.repository.ts similarity index 100% rename from server/libs/infra/src/repositories/system-config.repository.ts rename to server/src/infra/repositories/system-config.repository.ts diff --git a/server/libs/infra/src/repositories/tag.repository.ts b/server/src/infra/repositories/tag.repository.ts similarity index 100% rename from server/libs/infra/src/repositories/tag.repository.ts rename to server/src/infra/repositories/tag.repository.ts diff --git a/server/libs/infra/src/repositories/typesense.repository.ts b/server/src/infra/repositories/typesense.repository.ts similarity index 100% rename from server/libs/infra/src/repositories/typesense.repository.ts rename to server/src/infra/repositories/typesense.repository.ts diff --git a/server/libs/infra/src/repositories/user-token.repository.ts b/server/src/infra/repositories/user-token.repository.ts similarity index 100% rename from server/libs/infra/src/repositories/user-token.repository.ts rename to server/src/infra/repositories/user-token.repository.ts diff --git a/server/libs/infra/src/repositories/user.repository.ts b/server/src/infra/repositories/user.repository.ts similarity index 100% rename from server/libs/infra/src/repositories/user.repository.ts rename to server/src/infra/repositories/user.repository.ts diff --git a/server/libs/infra/src/typesense-schemas/album.schema.ts b/server/src/infra/typesense-schemas/album.schema.ts similarity index 100% rename from server/libs/infra/src/typesense-schemas/album.schema.ts rename to server/src/infra/typesense-schemas/album.schema.ts diff --git a/server/libs/infra/src/typesense-schemas/asset.schema.ts b/server/src/infra/typesense-schemas/asset.schema.ts similarity index 100% rename from server/libs/infra/src/typesense-schemas/asset.schema.ts rename to server/src/infra/typesense-schemas/asset.schema.ts diff --git a/server/libs/infra/src/typesense-schemas/face.schema.ts b/server/src/infra/typesense-schemas/face.schema.ts similarity index 100% rename from server/libs/infra/src/typesense-schemas/face.schema.ts rename to server/src/infra/typesense-schemas/face.schema.ts diff --git a/server/libs/infra/src/typesense-schemas/index.ts b/server/src/infra/typesense-schemas/index.ts similarity index 100% rename from server/libs/infra/src/typesense-schemas/index.ts rename to server/src/infra/typesense-schemas/index.ts diff --git a/server/libs/infra/src/utils/optional-between.util.ts b/server/src/infra/utils/optional-between.util.ts similarity index 100% rename from server/libs/infra/src/utils/optional-between.util.ts rename to server/src/infra/utils/optional-between.util.ts diff --git a/server/libs/infra/src/utils/pagination.util.ts b/server/src/infra/utils/pagination.util.ts similarity index 100% rename from server/libs/infra/src/utils/pagination.util.ts rename to server/src/infra/utils/pagination.util.ts diff --git a/server/src/main.ts b/server/src/main.ts new file mode 100644 index 0000000000..f5e83aacff --- /dev/null +++ b/server/src/main.ts @@ -0,0 +1,24 @@ +import { bootstrap as immich } from './immich/main'; +import { bootstrap as microservices } from './microservices/main'; +import { bootstrap as cli } from './cli/immich'; + +const immichApp = process.argv[2] || process.env.IMMICH_APP; + +if (process.argv[2] === immichApp) { + process.argv.splice(2, 1); +} + +function bootstrap() { + switch (immichApp) { + case 'immich': + return immich(); + case 'microservices': + return microservices(); + case 'cli': + return cli(); + default: + console.log(`Invalid app name: ${immichApp}. Expected one of immich|microservices|cli`); + process.exit(1); + } +} +bootstrap(); diff --git a/server/apps/microservices/src/app.service.ts b/server/src/microservices/app.service.ts similarity index 100% rename from server/apps/microservices/src/app.service.ts rename to server/src/microservices/app.service.ts diff --git a/server/apps/microservices/src/main.ts b/server/src/microservices/main.ts similarity index 94% rename from server/apps/microservices/src/main.ts rename to server/src/microservices/main.ts index 1a68181868..1f170786b1 100644 --- a/server/apps/microservices/src/main.ts +++ b/server/src/microservices/main.ts @@ -9,7 +9,7 @@ const logger = new Logger('ImmichMicroservice'); const port = Number(process.env.MICROSERVICES_PORT) || 3002; const envName = (process.env.NODE_ENV || 'development').toUpperCase(); -async function bootstrap() { +export async function bootstrap() { const app = await NestFactory.create(MicroservicesModule, { logger: getLogLevels() }); app.useWebSocketAdapter(new RedisIoAdapter(app)); @@ -19,5 +19,3 @@ async function bootstrap() { logger.log(`Immich Microservices is listening on ${port} [v${SERVER_VERSION}] [${envName}] `); } - -bootstrap(); diff --git a/server/apps/microservices/src/microservices.module.ts b/server/src/microservices/microservices.module.ts similarity index 100% rename from server/apps/microservices/src/microservices.module.ts rename to server/src/microservices/microservices.module.ts diff --git a/server/apps/microservices/src/processors/metadata-extraction.processor.ts b/server/src/microservices/processors/metadata-extraction.processor.ts similarity index 100% rename from server/apps/microservices/src/processors/metadata-extraction.processor.ts rename to server/src/microservices/processors/metadata-extraction.processor.ts diff --git a/server/apps/microservices/src/utils/exif/coordinates.spec.ts b/server/src/microservices/utils/exif/coordinates.spec.ts similarity index 100% rename from server/apps/microservices/src/utils/exif/coordinates.spec.ts rename to server/src/microservices/utils/exif/coordinates.spec.ts diff --git a/server/apps/microservices/src/utils/exif/coordinates.ts b/server/src/microservices/utils/exif/coordinates.ts similarity index 100% rename from server/apps/microservices/src/utils/exif/coordinates.ts rename to server/src/microservices/utils/exif/coordinates.ts diff --git a/server/apps/microservices/src/utils/exif/date-time.spec.ts b/server/src/microservices/utils/exif/date-time.spec.ts similarity index 100% rename from server/apps/microservices/src/utils/exif/date-time.spec.ts rename to server/src/microservices/utils/exif/date-time.spec.ts diff --git a/server/apps/microservices/src/utils/exif/date-time.ts b/server/src/microservices/utils/exif/date-time.ts similarity index 100% rename from server/apps/microservices/src/utils/exif/date-time.ts rename to server/src/microservices/utils/exif/date-time.ts diff --git a/server/apps/microservices/src/utils/exif/iso.spec.ts b/server/src/microservices/utils/exif/iso.spec.ts similarity index 100% rename from server/apps/microservices/src/utils/exif/iso.spec.ts rename to server/src/microservices/utils/exif/iso.spec.ts diff --git a/server/apps/microservices/src/utils/exif/iso.ts b/server/src/microservices/utils/exif/iso.ts similarity index 100% rename from server/apps/microservices/src/utils/exif/iso.ts rename to server/src/microservices/utils/exif/iso.ts diff --git a/server/apps/microservices/src/utils/numbers.spec.ts b/server/src/microservices/utils/numbers.spec.ts similarity index 100% rename from server/apps/microservices/src/utils/numbers.spec.ts rename to server/src/microservices/utils/numbers.spec.ts diff --git a/server/apps/microservices/src/utils/numbers.ts b/server/src/microservices/utils/numbers.ts similarity index 100% rename from server/apps/microservices/src/utils/numbers.ts rename to server/src/microservices/utils/numbers.ts diff --git a/server/start-microservices.sh b/server/start-microservices.sh index 845b1cd7df..f81e6381aa 100755 --- a/server/start-microservices.sh +++ b/server/start-microservices.sh @@ -1,23 +1,2 @@ #!/bin/sh - -if [ "$DB_HOSTNAME_FILE" ]; then - export DB_HOSTNAME=$(cat $DB_HOSTNAME_FILE) - unset DB_HOSTNAME_FILE -fi - -if [ "$DB_DATABASE_NAME_FILE" ]; then - export DB_DATABASE_NAME=$(cat $DB_DATABASE_NAME_FILE) - unset DB_DATABASE_NAME_FILE -fi - -if [ "$DB_USERNAME_FILE" ]; then - export DB_USERNAME=$(cat $DB_USERNAME_FILE) - unset DB_USERNAME_FILE -fi - -if [ "$DB_PASSWORD_FILE" ]; then - export DB_PASSWORD=$(cat $DB_PASSWORD_FILE) - unset DB_PASSWORD_FILE -fi - -exec node dist/apps/microservices/apps/microservices/src/main +./start.sh microservices diff --git a/server/start-server.sh b/server/start-server.sh index 012dfd817d..c3262af83c 100755 --- a/server/start-server.sh +++ b/server/start-server.sh @@ -1,23 +1,2 @@ #!/bin/sh - -if [ "$DB_HOSTNAME_FILE" ]; then - export DB_HOSTNAME=$(cat $DB_HOSTNAME_FILE) - unset DB_HOSTNAME_FILE -fi - -if [ "$DB_DATABASE_NAME_FILE" ]; then - export DB_DATABASE_NAME=$(cat $DB_DATABASE_NAME_FILE) - unset DB_DATABASE_NAME_FILE -fi - -if [ "$DB_USERNAME_FILE" ]; then - export DB_USERNAME=$(cat $DB_USERNAME_FILE) - unset DB_USERNAME_FILE -fi - -if [ "$DB_PASSWORD_FILE" ]; then - export DB_PASSWORD=$(cat $DB_PASSWORD_FILE) - unset DB_PASSWORD_FILE -fi - -exec node dist/apps/immich/apps/immich/src/main +./start.sh immich diff --git a/server/start.sh b/server/start.sh new file mode 100755 index 0000000000..c0825dd519 --- /dev/null +++ b/server/start.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +if [ "$DB_HOSTNAME_FILE" ]; then + export DB_HOSTNAME=$(cat $DB_HOSTNAME_FILE) + unset DB_HOSTNAME_FILE +fi + +if [ "$DB_DATABASE_NAME_FILE" ]; then + export DB_DATABASE_NAME=$(cat $DB_DATABASE_NAME_FILE) + unset DB_DATABASE_NAME_FILE +fi + +if [ "$DB_USERNAME_FILE" ]; then + export DB_USERNAME=$(cat $DB_USERNAME_FILE) + unset DB_USERNAME_FILE +fi + +if [ "$DB_PASSWORD_FILE" ]; then + export DB_PASSWORD=$(cat $DB_PASSWORD_FILE) + unset DB_PASSWORD_FILE +fi + +exec node dist/main $1 diff --git a/server/libs/domain/test/fixtures.ts b/server/test/fixtures.ts similarity index 99% rename from server/libs/domain/test/fixtures.ts rename to server/test/fixtures.ts index 9bf05c0246..0fa4cfd8af 100644 --- a/server/libs/domain/test/fixtures.ts +++ b/server/test/fixtures.ts @@ -30,7 +30,7 @@ import { VideoFormat, VideoInfo, VideoStreamInfo, -} from '../src'; +} from '@app/domain'; const today = new Date(); const tomorrow = new Date(); diff --git a/server/libs/domain/test/global-setup.js b/server/test/global-setup.js similarity index 100% rename from server/libs/domain/test/global-setup.js rename to server/test/global-setup.js diff --git a/server/test/index.ts b/server/test/index.ts new file mode 100644 index 0000000000..176dc87cab --- /dev/null +++ b/server/test/index.ts @@ -0,0 +1,8 @@ +export * from './repositories'; +export * from './fixtures'; + +export async function asyncTick(steps: number) { + for (let i = 0; i < steps; i++) { + await Promise.resolve(); + } +} diff --git a/server/libs/domain/test/access.repository.mock.ts b/server/test/repositories/access.repository.mock.ts similarity index 81% rename from server/libs/domain/test/access.repository.mock.ts rename to server/test/repositories/access.repository.mock.ts index 75a91fc3cb..da00474db0 100644 --- a/server/libs/domain/test/access.repository.mock.ts +++ b/server/test/repositories/access.repository.mock.ts @@ -1,4 +1,4 @@ -import { IAccessRepository } from '../src'; +import { IAccessRepository } from '@app/domain'; export const newAccessRepositoryMock = (): jest.Mocked => { return { diff --git a/server/libs/domain/test/album.repository.mock.ts b/server/test/repositories/album.repository.mock.ts similarity index 90% rename from server/libs/domain/test/album.repository.mock.ts rename to server/test/repositories/album.repository.mock.ts index 593ae61d26..662b183d31 100644 --- a/server/libs/domain/test/album.repository.mock.ts +++ b/server/test/repositories/album.repository.mock.ts @@ -1,4 +1,4 @@ -import { IAlbumRepository } from '../src'; +import { IAlbumRepository } from '@app/domain'; export const newAlbumRepositoryMock = (): jest.Mocked => { return { diff --git a/server/libs/domain/test/api-key.repository.mock.ts b/server/test/repositories/api-key.repository.mock.ts similarity index 83% rename from server/libs/domain/test/api-key.repository.mock.ts rename to server/test/repositories/api-key.repository.mock.ts index dbf8405fc1..5688978e75 100644 --- a/server/libs/domain/test/api-key.repository.mock.ts +++ b/server/test/repositories/api-key.repository.mock.ts @@ -1,4 +1,4 @@ -import { IKeyRepository } from '../src'; +import { IKeyRepository } from '@app/domain'; export const newKeyRepositoryMock = (): jest.Mocked => { return { diff --git a/server/libs/domain/test/asset.repository.mock.ts b/server/test/repositories/asset.repository.mock.ts similarity index 90% rename from server/libs/domain/test/asset.repository.mock.ts rename to server/test/repositories/asset.repository.mock.ts index 993b987ef0..d05a5c1728 100644 --- a/server/libs/domain/test/asset.repository.mock.ts +++ b/server/test/repositories/asset.repository.mock.ts @@ -1,4 +1,4 @@ -import { IAssetRepository } from '../src'; +import { IAssetRepository } from '@app/domain'; export const newAssetRepositoryMock = (): jest.Mocked => { return { diff --git a/server/libs/domain/test/communication.repository.mock.ts b/server/test/repositories/communication.repository.mock.ts similarity index 70% rename from server/libs/domain/test/communication.repository.mock.ts rename to server/test/repositories/communication.repository.mock.ts index 083da97c39..d4c2f8c8fa 100644 --- a/server/libs/domain/test/communication.repository.mock.ts +++ b/server/test/repositories/communication.repository.mock.ts @@ -1,4 +1,4 @@ -import { ICommunicationRepository } from '../src'; +import { ICommunicationRepository } from '@app/domain'; export const newCommunicationRepositoryMock = (): jest.Mocked => { return { diff --git a/server/libs/domain/test/crypto.repository.mock.ts b/server/test/repositories/crypto.repository.mock.ts similarity index 89% rename from server/libs/domain/test/crypto.repository.mock.ts rename to server/test/repositories/crypto.repository.mock.ts index 1e37222e44..bbf3154448 100644 --- a/server/libs/domain/test/crypto.repository.mock.ts +++ b/server/test/repositories/crypto.repository.mock.ts @@ -1,4 +1,4 @@ -import { ICryptoRepository } from '../src'; +import { ICryptoRepository } from '@app/domain'; export const newCryptoRepositoryMock = (): jest.Mocked => { return { diff --git a/server/libs/domain/test/face.repository.mock.ts b/server/test/repositories/face.repository.mock.ts similarity index 77% rename from server/libs/domain/test/face.repository.mock.ts rename to server/test/repositories/face.repository.mock.ts index 7e56de4475..505a556241 100644 --- a/server/libs/domain/test/face.repository.mock.ts +++ b/server/test/repositories/face.repository.mock.ts @@ -1,4 +1,4 @@ -import { IFaceRepository } from '../src'; +import { IFaceRepository } from '@app/domain'; export const newFaceRepositoryMock = (): jest.Mocked => { return { diff --git a/server/libs/domain/test/index.ts b/server/test/repositories/index.ts similarity index 85% rename from server/libs/domain/test/index.ts rename to server/test/repositories/index.ts index a868009f49..aa62a5f01a 100644 --- a/server/libs/domain/test/index.ts +++ b/server/test/repositories/index.ts @@ -5,7 +5,6 @@ export * from './asset.repository.mock'; export * from './communication.repository.mock'; export * from './crypto.repository.mock'; export * from './face.repository.mock'; -export * from './fixtures'; export * from './job.repository.mock'; export * from './machine-learning.repository.mock'; export * from './media.repository.mock'; @@ -19,9 +18,3 @@ export * from './system-config.repository.mock'; export * from './tag.repository.mock'; export * from './user-token.repository.mock'; export * from './user.repository.mock'; - -export async function asyncTick(steps: number) { - for (let i = 0; i < steps; i++) { - await Promise.resolve(); - } -} diff --git a/server/libs/domain/test/job.repository.mock.ts b/server/test/repositories/job.repository.mock.ts similarity index 88% rename from server/libs/domain/test/job.repository.mock.ts rename to server/test/repositories/job.repository.mock.ts index 073478e3be..16db4ca692 100644 --- a/server/libs/domain/test/job.repository.mock.ts +++ b/server/test/repositories/job.repository.mock.ts @@ -1,4 +1,4 @@ -import { IJobRepository } from '../src'; +import { IJobRepository } from '@app/domain'; export const newJobRepositoryMock = (): jest.Mocked => { return { diff --git a/server/libs/domain/test/machine-learning.repository.mock.ts b/server/test/repositories/machine-learning.repository.mock.ts similarity index 79% rename from server/libs/domain/test/machine-learning.repository.mock.ts rename to server/test/repositories/machine-learning.repository.mock.ts index 13e335e697..02af972218 100644 --- a/server/libs/domain/test/machine-learning.repository.mock.ts +++ b/server/test/repositories/machine-learning.repository.mock.ts @@ -1,4 +1,4 @@ -import { IMachineLearningRepository } from '../src'; +import { IMachineLearningRepository } from '@app/domain'; export const newMachineLearningRepositoryMock = (): jest.Mocked => { return { diff --git a/server/libs/domain/test/media.repository.mock.ts b/server/test/repositories/media.repository.mock.ts similarity index 84% rename from server/libs/domain/test/media.repository.mock.ts rename to server/test/repositories/media.repository.mock.ts index a819e9e5d1..3d7cf7bfc1 100644 --- a/server/libs/domain/test/media.repository.mock.ts +++ b/server/test/repositories/media.repository.mock.ts @@ -1,4 +1,4 @@ -import { IMediaRepository } from '../src'; +import { IMediaRepository } from '@app/domain'; export const newMediaRepositoryMock = (): jest.Mocked => { return { diff --git a/server/libs/domain/test/partner.repository.mock.ts b/server/test/repositories/partner.repository.mock.ts similarity index 79% rename from server/libs/domain/test/partner.repository.mock.ts rename to server/test/repositories/partner.repository.mock.ts index 396b334785..a283325d29 100644 --- a/server/libs/domain/test/partner.repository.mock.ts +++ b/server/test/repositories/partner.repository.mock.ts @@ -1,4 +1,4 @@ -import { IPartnerRepository } from '../src'; +import { IPartnerRepository } from '@app/domain'; export const newPartnerRepositoryMock = (): jest.Mocked => { return { diff --git a/server/libs/domain/test/person.repository.mock.ts b/server/test/repositories/person.repository.mock.ts similarity index 86% rename from server/libs/domain/test/person.repository.mock.ts rename to server/test/repositories/person.repository.mock.ts index 6a1b5e8c58..0d02195772 100644 --- a/server/libs/domain/test/person.repository.mock.ts +++ b/server/test/repositories/person.repository.mock.ts @@ -1,4 +1,4 @@ -import { IPersonRepository } from '../src'; +import { IPersonRepository } from '@app/domain'; export const newPersonRepositoryMock = (): jest.Mocked => { return { diff --git a/server/libs/domain/test/search.repository.mock.ts b/server/test/repositories/search.repository.mock.ts similarity index 91% rename from server/libs/domain/test/search.repository.mock.ts rename to server/test/repositories/search.repository.mock.ts index b845e30f90..5bf8f63397 100644 --- a/server/libs/domain/test/search.repository.mock.ts +++ b/server/test/repositories/search.repository.mock.ts @@ -1,4 +1,4 @@ -import { ISearchRepository } from '../src'; +import { ISearchRepository } from '@app/domain'; export const newSearchRepositoryMock = (): jest.Mocked => { return { diff --git a/server/libs/domain/test/shared-link.repository.mock.ts b/server/test/repositories/shared-link.repository.mock.ts similarity index 82% rename from server/libs/domain/test/shared-link.repository.mock.ts rename to server/test/repositories/shared-link.repository.mock.ts index dae72d9c68..fb34b0ad76 100644 --- a/server/libs/domain/test/shared-link.repository.mock.ts +++ b/server/test/repositories/shared-link.repository.mock.ts @@ -1,4 +1,4 @@ -import { ISharedLinkRepository } from '../src'; +import { ISharedLinkRepository } from '@app/domain'; export const newSharedLinkRepositoryMock = (): jest.Mocked => { return { diff --git a/server/libs/domain/test/smart-info.repository.mock.ts b/server/test/repositories/smart-info.repository.mock.ts similarity index 71% rename from server/libs/domain/test/smart-info.repository.mock.ts rename to server/test/repositories/smart-info.repository.mock.ts index 9eb5bc9986..1b89fc393b 100644 --- a/server/libs/domain/test/smart-info.repository.mock.ts +++ b/server/test/repositories/smart-info.repository.mock.ts @@ -1,4 +1,4 @@ -import { ISmartInfoRepository } from '../src'; +import { ISmartInfoRepository } from '@app/domain'; export const newSmartInfoRepositoryMock = (): jest.Mocked => { return { diff --git a/server/libs/domain/test/storage.repository.mock.ts b/server/test/repositories/storage.repository.mock.ts similarity index 87% rename from server/libs/domain/test/storage.repository.mock.ts rename to server/test/repositories/storage.repository.mock.ts index 758babd75c..21b289f938 100644 --- a/server/libs/domain/test/storage.repository.mock.ts +++ b/server/test/repositories/storage.repository.mock.ts @@ -1,4 +1,4 @@ -import { IStorageRepository } from '../src'; +import { IStorageRepository } from '@app/domain'; export const newStorageRepositoryMock = (): jest.Mocked => { return { diff --git a/server/libs/domain/test/system-config.repository.mock.ts b/server/test/repositories/system-config.repository.mock.ts similarity index 80% rename from server/libs/domain/test/system-config.repository.mock.ts rename to server/test/repositories/system-config.repository.mock.ts index 23d69f99b7..258ded0a76 100644 --- a/server/libs/domain/test/system-config.repository.mock.ts +++ b/server/test/repositories/system-config.repository.mock.ts @@ -1,4 +1,4 @@ -import { ISystemConfigRepository } from '../src'; +import { ISystemConfigRepository } from '@app/domain'; export const newSystemConfigRepositoryMock = (): jest.Mocked => { return { diff --git a/server/libs/domain/test/tag.repository.mock.ts b/server/test/repositories/tag.repository.mock.ts similarity index 88% rename from server/libs/domain/test/tag.repository.mock.ts rename to server/test/repositories/tag.repository.mock.ts index d42d97e280..cb1e05a096 100644 --- a/server/libs/domain/test/tag.repository.mock.ts +++ b/server/test/repositories/tag.repository.mock.ts @@ -1,4 +1,4 @@ -import { ITagRepository } from '../src'; +import { ITagRepository } from '@app/domain'; export const newTagRepositoryMock = (): jest.Mocked => { return { diff --git a/server/libs/domain/test/user-token.repository.mock.ts b/server/test/repositories/user-token.repository.mock.ts similarity index 81% rename from server/libs/domain/test/user-token.repository.mock.ts rename to server/test/repositories/user-token.repository.mock.ts index bebebb09f9..9d1bacf1c2 100644 --- a/server/libs/domain/test/user-token.repository.mock.ts +++ b/server/test/repositories/user-token.repository.mock.ts @@ -1,4 +1,4 @@ -import { IUserTokenRepository } from '../src'; +import { IUserTokenRepository } from '@app/domain'; export const newUserTokenRepositoryMock = (): jest.Mocked => { return { diff --git a/server/libs/domain/test/user.repository.mock.ts b/server/test/repositories/user.repository.mock.ts similarity index 89% rename from server/libs/domain/test/user.repository.mock.ts rename to server/test/repositories/user.repository.mock.ts index 011273dc2b..09e2ef7bf1 100644 --- a/server/libs/domain/test/user.repository.mock.ts +++ b/server/test/repositories/user.repository.mock.ts @@ -1,4 +1,4 @@ -import { IUserRepository } from '../src'; +import { IUserRepository } from '@app/domain'; export const newUserRepositoryMock = (): jest.Mocked => { return { diff --git a/server/libs/domain/test/setup.ts b/server/test/setup.ts similarity index 100% rename from server/libs/domain/test/setup.ts rename to server/test/setup.ts diff --git a/server/apps/immich/test/test-utils.ts b/server/test/test-utils.ts similarity index 89% rename from server/apps/immich/test/test-utils.ts rename to server/test/test-utils.ts index 12de38a646..708c4eedee 100644 --- a/server/apps/immich/test/test-utils.ts +++ b/server/test/test-utils.ts @@ -1,8 +1,8 @@ import { CanActivate, ExecutionContext } from '@nestjs/common'; import { TestingModuleBuilder } from '@nestjs/testing'; import { DataSource } from 'typeorm'; -import { AuthUserDto } from '../src/decorators/auth-user.decorator'; -import { AuthGuard } from '../src/middlewares/auth.guard'; +import { AuthUserDto } from '@app/immich/decorators/auth-user.decorator'; +import { AuthGuard } from '@app/immich/middlewares/auth.guard'; type CustomAuthCallback = () => AuthUserDto; diff --git a/server/tsconfig.json b/server/tsconfig.json index ede4fd120e..743d4a2415 100644 --- a/server/tsconfig.json +++ b/server/tsconfig.json @@ -16,10 +16,14 @@ "esModuleInterop": true, "baseUrl": "./", "paths": { - "@app/infra": ["libs/infra/src"], - "@app/infra/*": ["libs/infra/src/*"], - "@app/domain": ["libs/domain/src"], - "@app/domain/*": ["libs/domain/src/*"] + "@test": ["test"], + "@test/*": ["test/*"], + "@app/immich": ["src/immich"], + "@app/immich/*": ["src/immich/*"], + "@app/infra": ["src/infra"], + "@app/infra/*": ["src/infra/*"], + "@app/domain": ["src/domain"], + "@app/domain/*": ["src/domain/*"] } }, "exclude": ["dist", "node_modules", "upload"]