mirror of
https://github.com/immich-app/immich.git
synced 2025-01-24 04:32:45 +01:00
c0a6b3d5a3
* refactor(server): system config * fix: jest circular import * chore: ignore migrations in coverage report * chore: tests * chore: tests * chore: todo note * chore: remove vite config backup * chore: fix redis hostname
74 lines
1.7 KiB
TypeScript
74 lines
1.7 KiB
TypeScript
import { SystemConfig, UserEntity } from '@app/infra/db/entities';
|
|
import { AuthUserDto } from '../src';
|
|
|
|
export const authStub = {
|
|
admin: Object.freeze<AuthUserDto>({
|
|
id: 'admin_id',
|
|
email: 'admin@test.com',
|
|
isAdmin: true,
|
|
isPublicUser: false,
|
|
isAllowUpload: true,
|
|
}),
|
|
user1: Object.freeze<AuthUserDto>({
|
|
id: 'immich_id',
|
|
email: 'immich@test.com',
|
|
isAdmin: false,
|
|
isPublicUser: false,
|
|
isAllowUpload: true,
|
|
}),
|
|
};
|
|
|
|
export const entityStub = {
|
|
admin: Object.freeze<UserEntity>({
|
|
...authStub.admin,
|
|
password: 'admin_password',
|
|
firstName: 'admin_first_name',
|
|
lastName: 'admin_last_name',
|
|
oauthId: '',
|
|
shouldChangePassword: false,
|
|
profileImagePath: '',
|
|
createdAt: '2021-01-01',
|
|
tags: [],
|
|
}),
|
|
user1: Object.freeze<UserEntity>({
|
|
...authStub.user1,
|
|
password: 'immich_password',
|
|
firstName: 'immich_first_name',
|
|
lastName: 'immich_last_name',
|
|
oauthId: '',
|
|
shouldChangePassword: false,
|
|
profileImagePath: '',
|
|
createdAt: '2021-01-01',
|
|
tags: [],
|
|
}),
|
|
};
|
|
|
|
export const systemConfigStub = {
|
|
defaults: Object.freeze({
|
|
ffmpeg: {
|
|
crf: '23',
|
|
preset: 'ultrafast',
|
|
targetAudioCodec: 'mp3',
|
|
targetScaling: '1280:-2',
|
|
targetVideoCodec: 'libx264',
|
|
},
|
|
oauth: {
|
|
autoLaunch: false,
|
|
autoRegister: true,
|
|
buttonText: 'Login with OAuth',
|
|
clientId: '',
|
|
clientSecret: '',
|
|
enabled: false,
|
|
issuerUrl: '',
|
|
mobileOverrideEnabled: false,
|
|
mobileRedirectUri: '',
|
|
scope: 'openid email profile',
|
|
},
|
|
passwordLogin: {
|
|
enabled: true,
|
|
},
|
|
storageTemplate: {
|
|
template: '{{y}}/{{y}}-{{MM}}-{{dd}}/{{filename}}',
|
|
},
|
|
} as SystemConfig),
|
|
};
|