refactor(server)*: tsconfigs (#2689)
* refactor(server): tsconfigs * chore: dummy commit * fix: start.sh * chore: restore original entry scripts
This commit is contained in:
parent
a2130aa6c5
commit
8ebac41318
465 changed files with 209 additions and 332 deletions
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
|
@ -167,13 +167,13 @@ jobs:
|
||||||
run: npm --prefix server run typeorm:migrations:run
|
run: npm --prefix server run typeorm:migrations:run
|
||||||
- name: Generate new migrations
|
- name: Generate new migrations
|
||||||
continue-on-error: true
|
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
|
- name: Find file changes
|
||||||
uses: tj-actions/verify-changed-files@v13.1
|
uses: tj-actions/verify-changed-files@v13.1
|
||||||
id: verify-changed-files
|
id: verify-changed-files
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
server/libs/infra/src/migrations/
|
server/src/infra/migrations/
|
||||||
- name: Verify files have not changed
|
- name: Verify files have not changed
|
||||||
if: steps.verify-changed-files.outputs.files_changed == 'true'
|
if: steps.verify-changed-files.outputs.files_changed == 'true'
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -4,7 +4,7 @@ services:
|
||||||
immich-server:
|
immich-server:
|
||||||
container_name: immich_server
|
container_name: immich_server
|
||||||
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
|
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
|
||||||
command: ["start-server.sh"]
|
command: [ "start.sh", "immich" ]
|
||||||
volumes:
|
volumes:
|
||||||
- ${UPLOAD_LOCATION}:/usr/src/app/upload
|
- ${UPLOAD_LOCATION}:/usr/src/app/upload
|
||||||
env_file:
|
env_file:
|
||||||
|
@ -18,7 +18,7 @@ services:
|
||||||
immich-microservices:
|
immich-microservices:
|
||||||
container_name: immich_microservices
|
container_name: immich_microservices
|
||||||
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
|
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
|
||||||
command: ["start-microservices.sh"]
|
command: [ "start.sh", "microservices" ]
|
||||||
volumes:
|
volumes:
|
||||||
- ${UPLOAD_LOCATION}:/usr/src/app/upload
|
- ${UPLOAD_LOCATION}:/usr/src/app/upload
|
||||||
env_file:
|
env_file:
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
# Database Migrations
|
# 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
|
1. Run the command
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run typeorm:migrations:generate ./libs/infra/src/<migration-name>
|
npm run typeorm:migrations:generate ./src/infra/<migration-name>
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Check if the migration file makes sense.
|
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.
|
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.
|
||||||
|
|
|
@ -30,4 +30,4 @@ The Open API client libraries need to be regenerated whenever there are changes
|
||||||
|
|
||||||
## Database Migrations
|
## 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.
|
||||||
|
|
|
@ -10,9 +10,9 @@ sidebar_position: 2
|
||||||
|
|
||||||
This environment includes the following services:
|
This environment includes the following services:
|
||||||
|
|
||||||
- Core server - `/server/apps/immich`
|
- Core server - `/server/src/immich`
|
||||||
- Machine learning - `/machine-learning`
|
- Machine learning - `/machine-learning`
|
||||||
- Microservices - `/server/apps/microservicess`
|
- Microservices - `/server/src/microservicess`
|
||||||
- Web app - `/web`
|
- Web app - `/web`
|
||||||
- Redis
|
- Redis
|
||||||
- PostgreSQL development database with exposed port `5432` so you can use any database client to acess it
|
- PostgreSQL development database with exposed port `5432` so you can use any database client to acess it
|
||||||
|
|
2
server/.gitignore
vendored
2
server/.gitignore
vendored
|
@ -40,3 +40,5 @@ upload/
|
||||||
tmp/
|
tmp/
|
||||||
core
|
core
|
||||||
.reverse-geocoding-dump/
|
.reverse-geocoding-dump/
|
||||||
|
|
||||||
|
**/node_modules/**
|
||||||
|
|
|
@ -32,7 +32,7 @@ COPY --from=prod /usr/src/app/bin ./bin
|
||||||
COPY LICENSE /licenses/LICENSE.txt
|
COPY LICENSE /licenses/LICENSE.txt
|
||||||
COPY LICENSE /LICENSE
|
COPY LICENSE /LICENSE
|
||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
COPY start-server.sh start-microservices.sh ./
|
COPY start*.sh ./
|
||||||
|
|
||||||
RUN npm link && npm cache clean --force
|
RUN npm link && npm cache clean --force
|
||||||
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
## How to run migration
|
|
||||||
|
|
||||||
1. Attached to the container shell
|
|
||||||
2. Run `npm run typeorm -- migration:generate ./libs/database/src/<migration-name> -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.
|
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"extends": "../../tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"declaration": false,
|
|
||||||
"outDir": "../../dist/apps/cli"
|
|
||||||
},
|
|
||||||
"include": ["src/**/*", "../../libs/**/*"],
|
|
||||||
"exclude": ["node_modules", "dist", "test", "**/*spec.ts"]
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
import { ValidateUUID } from '../../../../../../apps/immich/src/decorators/validate-uuid.decorator';
|
|
||||||
|
|
||||||
export class AddUsersDto {
|
|
||||||
@ValidateUUID({ each: true })
|
|
||||||
sharedUserIds!: string[];
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
{
|
|
||||||
"moduleFileExtensions": ["js", "json", "ts"],
|
|
||||||
"modulePaths": ["<rootDir>", "<rootDir>../../../"],
|
|
||||||
"rootDir": ".",
|
|
||||||
"testEnvironment": "node",
|
|
||||||
"testRegex": ".e2e-spec.ts$",
|
|
||||||
"transform": {
|
|
||||||
"^.+\\.(t|j)s$": "ts-jest"
|
|
||||||
},
|
|
||||||
"moduleNameMapper": {
|
|
||||||
"^@app/infra(|/.*)$": "<rootDir>../../../libs/infra/src/$1",
|
|
||||||
"^@app/domain(|/.*)$": "<rootDir>../../../libs/domain/src/$1"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"extends": "../../tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"declaration": false,
|
|
||||||
"outDir": "../../dist/apps/immich"
|
|
||||||
},
|
|
||||||
"include": ["src/**/*", "../../libs/**/*"],
|
|
||||||
"exclude": ["node_modules", "dist", "test", "**/*spec.ts"]
|
|
||||||
}
|
|
|
@ -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!');
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"moduleFileExtensions": ["js", "json", "ts"],
|
|
||||||
"rootDir": ".",
|
|
||||||
"testEnvironment": "node",
|
|
||||||
"testRegex": ".e2e-spec.ts$",
|
|
||||||
"transform": {
|
|
||||||
"^.+\\.(t|j)s$": "ts-jest"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"extends": "../../tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"declaration": false,
|
|
||||||
"outDir": "../../dist/apps/microservices"
|
|
||||||
},
|
|
||||||
"include": ["src/**/*"],
|
|
||||||
"exclude": ["node_modules", "dist", "test", "**/*spec.ts"]
|
|
||||||
}
|
|
|
@ -1 +1 @@
|
||||||
node ./dist/apps/cli/apps/cli/src/immich "$@"
|
node ./dist/main cli "$@"
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import { Test, TestingModule } from '@nestjs/testing';
|
import { Test, TestingModule } from '@nestjs/testing';
|
||||||
import { INestApplication } from '@nestjs/common';
|
import { INestApplication } from '@nestjs/common';
|
||||||
import request from 'supertest';
|
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 { CreateAlbumDto } from '@app/domain';
|
||||||
import { CreateAlbumShareLinkDto } from '../src/api-v1/album/dto/create-album-shared-link.dto';
|
import { CreateAlbumShareLinkDto } from '@app/immich/api-v1/album/dto/create-album-shared-link.dto';
|
||||||
import { AuthUserDto } from '../src/decorators/auth-user.decorator';
|
import { AuthUserDto } from '@app/immich/decorators/auth-user.decorator';
|
||||||
import { AlbumResponseDto, AuthService, SharedLinkResponseDto, UserService } from '@app/domain';
|
import { AlbumResponseDto, AuthService, SharedLinkResponseDto, UserService } from '@app/domain';
|
||||||
import { DataSource } from 'typeorm';
|
import { DataSource } from 'typeorm';
|
||||||
import { AppModule } from '../src/app.module';
|
import { AppModule } from '@app/immich/app.module';
|
||||||
|
|
||||||
async function _createAlbum(app: INestApplication, data: CreateAlbumDto) {
|
async function _createAlbum(app: INestApplication, data: CreateAlbumDto) {
|
||||||
const res = await request(app.getHttpServer()).post('/album').send(data);
|
const res = await request(app.getHttpServer()).post('/album').send(data);
|
|
@ -1,11 +1,11 @@
|
||||||
import { Test, TestingModule } from '@nestjs/testing';
|
import { Test, TestingModule } from '@nestjs/testing';
|
||||||
import { INestApplication } from '@nestjs/common';
|
import { INestApplication } from '@nestjs/common';
|
||||||
import request from 'supertest';
|
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 { CreateUserDto, UserService, AuthUserDto, UserResponseDto } from '@app/domain';
|
||||||
import { DataSource } from 'typeorm';
|
import { DataSource } from 'typeorm';
|
||||||
import { AuthService } from '@app/domain';
|
import { AuthService } from '@app/domain';
|
||||||
import { AppModule } from '../src/app.module';
|
import { AppModule } from '@app/immich/app.module';
|
||||||
|
|
||||||
function _createUser(userService: UserService, data: CreateUserDto) {
|
function _createUser(userService: UserService, data: CreateUserDto) {
|
||||||
return userService.createUser(data);
|
return userService.createUser(data);
|
16
server/jest-e2e.json
Normal file
16
server/jest-e2e.json
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"moduleFileExtensions": ["js", "json", "ts"],
|
||||||
|
"modulePaths": ["<rootDir>"],
|
||||||
|
"rootDir": ".",
|
||||||
|
"testEnvironment": "node",
|
||||||
|
"testRegex": ".e2e-spec.ts$",
|
||||||
|
"transform": {
|
||||||
|
"^.+\\.(t|j)s$": "ts-jest"
|
||||||
|
},
|
||||||
|
"moduleNameMapper": {
|
||||||
|
"^@test(|/.*)$": "<rootDir>/test/$1",
|
||||||
|
"^@app/immich(|/.*)$": "<rootDir>/src/immich/$1",
|
||||||
|
"^@app/infra(|/.*)$": "<rootDir>/src/infra/$1",
|
||||||
|
"^@app/domain(|/.*)$": "<rootDir>/src/domain/$1"
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +0,0 @@
|
||||||
import { ValidateUUID } from '../../../../../apps/immich/src/decorators/validate-uuid.decorator';
|
|
||||||
|
|
||||||
export class AssetIdsDto {
|
|
||||||
@ValidateUUID({ each: true })
|
|
||||||
assetIds!: string[];
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"extends": "../../tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"declaration": true,
|
|
||||||
"outDir": "../../dist/libs/domain"
|
|
||||||
},
|
|
||||||
"include": ["src/**/*"],
|
|
||||||
"exclude": ["node_modules", "dist", "test", "**/*spec.ts"]
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"extends": "../../tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"declaration": true,
|
|
||||||
"outDir": "../../dist/libs/infra"
|
|
||||||
},
|
|
||||||
"include": ["src/**/*"],
|
|
||||||
"exclude": ["node_modules", "dist", "test", "**/*spec.ts"]
|
|
||||||
}
|
|
|
@ -1,11 +1,10 @@
|
||||||
{
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/nest-cli",
|
||||||
"collection": "@nestjs/schematics",
|
"collection": "@nestjs/schematics",
|
||||||
"sourceRoot": "apps/immich/src",
|
"sourceRoot": "src",
|
||||||
"monorepo": true,
|
|
||||||
"root": "apps/immich",
|
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"deleteOutDir": true,
|
||||||
"webpack": false,
|
"webpack": false,
|
||||||
"tsConfigPath": "apps/immich/tsconfig.app.json",
|
|
||||||
"plugins": [
|
"plugins": [
|
||||||
{
|
{
|
||||||
"name": "@nestjs/swagger",
|
"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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,16 +9,14 @@
|
||||||
"immich": "./bin/cli.sh"
|
"immich": "./bin/cli.sh"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prebuild": "rimraf dist",
|
"build": "nest build",
|
||||||
"build": "nest build immich && nest build microservices && nest build cli",
|
|
||||||
"format": "prettier --check .",
|
"format": "prettier --check .",
|
||||||
"format:fix": "prettier --write .",
|
"format:fix": "prettier --write .",
|
||||||
"start": "nest start",
|
"start": "npm run start:dev",
|
||||||
"nest": "nest",
|
"nest": "nest",
|
||||||
"start:dev": "nest start --watch",
|
"start:dev": "nest start --watch --",
|
||||||
"start:debug": "rimraf dist && nest start --debug 0.0.0.0:9230 --watch",
|
"start:debug": "nest start --debug 0.0.0.0:9230 --watch --",
|
||||||
"start:prod": "node dist/main",
|
"lint": "eslint \"src/**/*.ts\" --max-warnings 0",
|
||||||
"lint": "eslint \"{apps,libs}/**/*.ts\" --max-warnings 0",
|
|
||||||
"lint:fix": "npm run lint -- --fix",
|
"lint:fix": "npm run lint -- --fix",
|
||||||
"check": "tsc --noEmit",
|
"check": "tsc --noEmit",
|
||||||
"check:code": "npm run format && npm run lint && npm run check",
|
"check:code": "npm run format && npm run lint && npm run check",
|
||||||
|
@ -27,13 +25,13 @@
|
||||||
"test:watch": "jest --watch",
|
"test:watch": "jest --watch",
|
||||||
"test:cov": "jest --coverage",
|
"test:cov": "jest --coverage",
|
||||||
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
"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": "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: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: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 ./libs/infra/src/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 ./libs/infra/src/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 ./libs/infra/src/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",
|
"typeorm:schema:reset": "npm run typeorm:schema:drop && npm run typeorm:migrations:run",
|
||||||
"api:typescript": "bash ./bin/generate-open-api.sh web",
|
"api:typescript": "bash ./bin/generate-open-api.sh web",
|
||||||
"api:dart": "bash ./bin/generate-open-api.sh mobile",
|
"api:dart": "bash ./bin/generate-open-api.sh mobile",
|
||||||
|
@ -134,11 +132,11 @@
|
||||||
},
|
},
|
||||||
"collectCoverageFrom": [
|
"collectCoverageFrom": [
|
||||||
"**/*.(t|j)s",
|
"**/*.(t|j)s",
|
||||||
"!<rootDir>/libs/infra/**/*"
|
"!<rootDir>/infra/**/*"
|
||||||
],
|
],
|
||||||
"coverageDirectory": "./coverage",
|
"coverageDirectory": "./coverage",
|
||||||
"coverageThreshold": {
|
"coverageThreshold": {
|
||||||
"./libs/domain/": {
|
"./src/domain/": {
|
||||||
"branches": 80,
|
"branches": 80,
|
||||||
"functions": 80,
|
"functions": 80,
|
||||||
"lines": 90,
|
"lines": 90,
|
||||||
|
@ -146,17 +144,15 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"setupFilesAfterEnv": [
|
"setupFilesAfterEnv": [
|
||||||
"<rootDir>/libs/domain/test/setup.ts"
|
"<rootDir>/test/setup.ts"
|
||||||
],
|
],
|
||||||
"testEnvironment": "node",
|
"testEnvironment": "node",
|
||||||
"roots": [
|
|
||||||
"<rootDir>/apps/",
|
|
||||||
"<rootDir>/libs/"
|
|
||||||
],
|
|
||||||
"moduleNameMapper": {
|
"moduleNameMapper": {
|
||||||
"^@app/infra(|/.*)$": "<rootDir>/libs/infra/src/$1",
|
"^@test(|/.*)$": "<rootDir>/test/$1",
|
||||||
"^@app/domain(|/.*)$": "<rootDir>/libs/domain/src/$1"
|
"^@app/immich(|/.*)$": "<rootDir>/src/immich/$1",
|
||||||
|
"^@app/infra(|/.*)$": "<rootDir>/src/infra/$1",
|
||||||
|
"^@app/domain(|/.*)$": "<rootDir>/src/domain/$1"
|
||||||
},
|
},
|
||||||
"globalSetup": "<rootDir>/libs/domain/test/global-setup.js"
|
"globalSetup": "<rootDir>/test/global-setup.js"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ export class ResetAdminPasswordCommand extends CommandRunner {
|
||||||
async run(): Promise<void> {
|
async run(): Promise<void> {
|
||||||
const ask = (admin: UserResponseDto) => {
|
const ask = (admin: UserResponseDto) => {
|
||||||
const { id, oauthId, email, firstName, lastName } = admin;
|
const { id, oauthId, email, firstName, lastName } = admin;
|
||||||
console.log(`Found Admin:
|
console.log(`Found Admin:
|
||||||
- ID=${id}
|
- ID=${id}
|
||||||
- OAuth ID=${oauthId}
|
- OAuth ID=${oauthId}
|
||||||
- Email=${email}
|
- Email=${email}
|
|
@ -1,7 +1,6 @@
|
||||||
import { CommandFactory } from 'nest-commander';
|
import { CommandFactory } from 'nest-commander';
|
||||||
import { AppModule } from './app.module';
|
import { AppModule } from './app.module';
|
||||||
|
|
||||||
async function bootstrap() {
|
export async function bootstrap() {
|
||||||
await CommandFactory.run(AppModule, ['warn', 'error']);
|
await CommandFactory.run(AppModule, ['warn', 'error']);
|
||||||
}
|
}
|
||||||
bootstrap();
|
|
|
@ -8,7 +8,7 @@ import {
|
||||||
newJobRepositoryMock,
|
newJobRepositoryMock,
|
||||||
newUserRepositoryMock,
|
newUserRepositoryMock,
|
||||||
userEntityStub,
|
userEntityStub,
|
||||||
} from '../../test';
|
} from '@test';
|
||||||
import { IAssetRepository } from '../asset';
|
import { IAssetRepository } from '../asset';
|
||||||
import { IJobRepository, JobName } from '../job';
|
import { IJobRepository, JobName } from '../job';
|
||||||
import { IUserRepository } from '../user';
|
import { IUserRepository } from '../user';
|
|
@ -1,5 +1,5 @@
|
||||||
import { ArrayNotEmpty } from 'class-validator';
|
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 {
|
export class AddUsersDto {
|
||||||
@ValidateUUID({ each: true })
|
@ValidateUUID({ each: true })
|
|
@ -1,5 +1,5 @@
|
||||||
import { ApiProperty } from '@nestjs/swagger';
|
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';
|
import { IsNotEmpty, IsString } from 'class-validator';
|
||||||
|
|
||||||
export class CreateAlbumDto {
|
export class CreateAlbumDto {
|
|
@ -1,6 +1,6 @@
|
||||||
import { ApiProperty } from '@nestjs/swagger';
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
import { IsOptional } from 'class-validator';
|
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 {
|
export class UpdateAlbumDto {
|
||||||
@IsOptional()
|
@IsOptional()
|
|
@ -1,8 +1,8 @@
|
||||||
import { ApiProperty } from '@nestjs/swagger';
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
import { Transform } from 'class-transformer';
|
import { Transform } from 'class-transformer';
|
||||||
import { IsBoolean, IsOptional } from 'class-validator';
|
import { IsBoolean, IsOptional } from 'class-validator';
|
||||||
import { ValidateUUID } from '../../../../../apps/immich/src/decorators/validate-uuid.decorator';
|
import { ValidateUUID } from '@app/immich/decorators/validate-uuid.decorator';
|
||||||
import { toBoolean } from '../../../../../apps/immich/src/utils/transform.util';
|
import { toBoolean } from '@app/immich/utils/transform.util';
|
||||||
|
|
||||||
export class GetAlbumsDto {
|
export class GetAlbumsDto {
|
||||||
@IsOptional()
|
@IsOptional()
|
|
@ -1,5 +1,5 @@
|
||||||
import { BadRequestException } from '@nestjs/common';
|
import { BadRequestException } from '@nestjs/common';
|
||||||
import { authStub, keyStub, newCryptoRepositoryMock, newKeyRepositoryMock } from '../../test';
|
import { authStub, keyStub, newCryptoRepositoryMock, newKeyRepositoryMock } from '@test';
|
||||||
import { ICryptoRepository } from '../crypto';
|
import { ICryptoRepository } from '../crypto';
|
||||||
import { IKeyRepository } from './api-key.repository';
|
import { IKeyRepository } from './api-key.repository';
|
||||||
import { APIKeyService } from './api-key.service';
|
import { APIKeyService } from './api-key.service';
|
|
@ -1,5 +1,5 @@
|
||||||
import { assetEntityStub, authStub, newAssetRepositoryMock } from '../../test';
|
import { assetEntityStub, authStub, newAssetRepositoryMock } from '@test';
|
||||||
import { AssetService, IAssetRepository } from '../asset';
|
import { AssetService, IAssetRepository } from '.';
|
||||||
|
|
||||||
describe(AssetService.name, () => {
|
describe(AssetService.name, () => {
|
||||||
let sut: AssetService;
|
let sut: AssetService;
|
6
server/src/domain/asset/dto/asset-ids.dto.ts
Normal file
6
server/src/domain/asset/dto/asset-ids.dto.ts
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import { ValidateUUID } from '@app/immich/decorators/validate-uuid.decorator';
|
||||||
|
|
||||||
|
export class AssetIdsDto {
|
||||||
|
@ValidateUUID({ each: true })
|
||||||
|
assetIds!: string[];
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
import { ApiProperty } from '@nestjs/swagger';
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
import { Transform, Type } from 'class-transformer';
|
import { Transform, Type } from 'class-transformer';
|
||||||
import { IsBoolean, IsDate, IsOptional } from 'class-validator';
|
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 {
|
export class MapMarkerDto {
|
||||||
@ApiProperty()
|
@ApiProperty()
|
|
@ -17,7 +17,7 @@ import {
|
||||||
systemConfigStub,
|
systemConfigStub,
|
||||||
userEntityStub,
|
userEntityStub,
|
||||||
userTokenEntityStub,
|
userTokenEntityStub,
|
||||||
} from '../../test';
|
} from '@test';
|
||||||
import { IKeyRepository } from '../api-key';
|
import { IKeyRepository } from '../api-key';
|
||||||
import { ICryptoRepository } from '../crypto/crypto.repository';
|
import { ICryptoRepository } from '../crypto/crypto.repository';
|
||||||
import { ISharedLinkRepository } from '../shared-link';
|
import { ISharedLinkRepository } from '../shared-link';
|
|
@ -1,5 +1,5 @@
|
||||||
import { BadRequestException } from '@nestjs/common';
|
import { BadRequestException } from '@nestjs/common';
|
||||||
import pkg from '../../../package.json';
|
import pkg from 'src/../../package.json';
|
||||||
|
|
||||||
const [major, minor, patch] = pkg.version.split('.');
|
const [major, minor, patch] = pkg.version.split('.');
|
||||||
|
|
|
@ -10,7 +10,7 @@ import {
|
||||||
newSearchRepositoryMock,
|
newSearchRepositoryMock,
|
||||||
newStorageRepositoryMock,
|
newStorageRepositoryMock,
|
||||||
personStub,
|
personStub,
|
||||||
} from '../../test';
|
} from '@test';
|
||||||
import { IAssetRepository, WithoutProperty } from '../asset';
|
import { IAssetRepository, WithoutProperty } from '../asset';
|
||||||
import { IJobRepository, JobName } from '../job';
|
import { IJobRepository, JobName } from '../job';
|
||||||
import { IMediaRepository } from '../media';
|
import { IMediaRepository } from '../media';
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue