mirror of
https://github.com/immich-app/immich.git
synced 2025-12-18 09:13:15 +03:00
* remove external path * open-api * make sql * move library settings to admin panel * Add documentation * show external libraries only * fix library list * make user library settings look good * fix test * fix tests * fix tests * can pick user for library * fix tests * fix e2e * chore: make sql * Use unauth exception * delete user library list * cleanup * fix e2e * fix await lint * chore: remove unused code * chore: cleanup * revert docs * fix: is admin stuff * table alignment --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com> Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
60 lines
1.2 KiB
TypeScript
60 lines
1.2 KiB
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { Transform } from 'class-transformer';
|
|
import { IsBoolean, IsEmail, IsNotEmpty, IsNumber, IsPositive, IsString } from 'class-validator';
|
|
import { Optional, toEmail, toSanitized } from '../../domain.util';
|
|
|
|
export class CreateUserDto {
|
|
@IsEmail({ require_tld: false })
|
|
@Transform(toEmail)
|
|
email!: string;
|
|
|
|
@IsNotEmpty()
|
|
@IsString()
|
|
password!: string;
|
|
|
|
@IsNotEmpty()
|
|
@IsString()
|
|
name!: string;
|
|
|
|
@Optional({ nullable: true })
|
|
@IsString()
|
|
@Transform(toSanitized)
|
|
storageLabel?: string | null;
|
|
|
|
@Optional()
|
|
@IsBoolean()
|
|
memoriesEnabled?: boolean;
|
|
|
|
@Optional({ nullable: true })
|
|
@IsNumber()
|
|
@IsPositive()
|
|
@ApiProperty({ type: 'integer', format: 'int64' })
|
|
quotaSizeInBytes?: number | null;
|
|
}
|
|
|
|
export class CreateAdminDto {
|
|
@IsNotEmpty()
|
|
isAdmin!: true;
|
|
|
|
@IsEmail({ require_tld: false })
|
|
@Transform(({ value }) => value?.toLowerCase())
|
|
email!: string;
|
|
|
|
@IsNotEmpty()
|
|
password!: string;
|
|
|
|
@IsNotEmpty()
|
|
name!: string;
|
|
}
|
|
|
|
export class CreateUserOAuthDto {
|
|
@IsEmail({ require_tld: false })
|
|
@Transform(({ value }) => value?.toLowerCase())
|
|
email!: string;
|
|
|
|
@IsNotEmpty()
|
|
oauthId!: string;
|
|
|
|
name?: string;
|
|
}
|