2024-03-21 00:53:07 +02:00
|
|
|
import { AuthDto } from 'src/dtos/auth.dto';
|
2024-04-19 12:47:29 +02:00
|
|
|
import { SessionEntity } from 'src/entities/session.entity';
|
2024-03-20 23:02:51 +02:00
|
|
|
import { SharedLinkEntity } from 'src/entities/shared-link.entity';
|
2024-07-01 19:43:16 +02:00
|
|
|
import { UserMetadataEntity } from 'src/entities/user-metadata.entity';
|
2024-03-20 23:02:51 +02:00
|
|
|
import { UserEntity } from 'src/entities/user.entity';
|
2023-08-01 03:28:07 +02:00
|
|
|
|
|
|
|
export const authStub = {
|
2023-12-10 06:34:12 +02:00
|
|
|
admin: Object.freeze<AuthDto>({
|
|
|
|
user: {
|
|
|
|
id: 'admin_id',
|
|
|
|
email: 'admin@test.com',
|
|
|
|
isAdmin: true,
|
2024-07-01 19:43:16 +02:00
|
|
|
metadata: [] as UserMetadataEntity[],
|
2023-12-10 06:34:12 +02:00
|
|
|
} as UserEntity,
|
2023-08-01 03:28:07 +02:00
|
|
|
}),
|
2023-12-10 06:34:12 +02:00
|
|
|
user1: Object.freeze<AuthDto>({
|
|
|
|
user: {
|
|
|
|
id: 'user-id',
|
|
|
|
email: 'immich@test.com',
|
|
|
|
isAdmin: false,
|
2024-07-01 19:43:16 +02:00
|
|
|
metadata: [] as UserMetadataEntity[],
|
2023-12-10 06:34:12 +02:00
|
|
|
} as UserEntity,
|
2024-04-19 12:47:29 +02:00
|
|
|
session: {
|
2023-12-10 06:34:12 +02:00
|
|
|
id: 'token-id',
|
2024-04-19 12:47:29 +02:00
|
|
|
} as SessionEntity,
|
2023-08-01 03:28:07 +02:00
|
|
|
}),
|
2023-12-10 06:34:12 +02:00
|
|
|
user2: Object.freeze<AuthDto>({
|
|
|
|
user: {
|
|
|
|
id: 'user-2',
|
|
|
|
email: 'user2@immich.app',
|
|
|
|
isAdmin: false,
|
2024-07-01 19:43:16 +02:00
|
|
|
metadata: [] as UserMetadataEntity[],
|
2023-12-10 06:34:12 +02:00
|
|
|
} as UserEntity,
|
2024-04-19 12:47:29 +02:00
|
|
|
session: {
|
2023-12-10 06:34:12 +02:00
|
|
|
id: 'token-id',
|
2024-04-19 12:47:29 +02:00
|
|
|
} as SessionEntity,
|
2023-08-01 03:28:07 +02:00
|
|
|
}),
|
2023-12-10 06:34:12 +02:00
|
|
|
adminSharedLink: Object.freeze<AuthDto>({
|
|
|
|
user: {
|
|
|
|
id: 'admin_id',
|
|
|
|
email: 'admin@test.com',
|
|
|
|
isAdmin: true,
|
2024-07-01 19:43:16 +02:00
|
|
|
metadata: [] as UserMetadataEntity[],
|
2023-12-10 06:34:12 +02:00
|
|
|
} as UserEntity,
|
|
|
|
sharedLink: {
|
|
|
|
id: '123',
|
|
|
|
showExif: true,
|
|
|
|
allowDownload: true,
|
|
|
|
allowUpload: true,
|
|
|
|
key: Buffer.from('shared-link-key'),
|
|
|
|
} as SharedLinkEntity,
|
2023-08-01 03:28:07 +02:00
|
|
|
}),
|
2023-12-10 06:34:12 +02:00
|
|
|
adminSharedLinkNoExif: Object.freeze<AuthDto>({
|
|
|
|
user: {
|
|
|
|
id: 'admin_id',
|
|
|
|
email: 'admin@test.com',
|
|
|
|
isAdmin: true,
|
2024-07-01 19:43:16 +02:00
|
|
|
metadata: [] as UserMetadataEntity[],
|
2023-12-10 06:34:12 +02:00
|
|
|
} as UserEntity,
|
|
|
|
sharedLink: {
|
|
|
|
id: '123',
|
|
|
|
showExif: false,
|
|
|
|
allowDownload: true,
|
|
|
|
allowUpload: true,
|
|
|
|
key: Buffer.from('shared-link-key'),
|
|
|
|
} as SharedLinkEntity,
|
2023-08-01 03:28:07 +02:00
|
|
|
}),
|
2023-12-11 21:37:47 +02:00
|
|
|
passwordSharedLink: Object.freeze<AuthDto>({
|
|
|
|
user: {
|
|
|
|
id: 'admin_id',
|
|
|
|
email: 'admin@test.com',
|
|
|
|
isAdmin: true,
|
2024-07-01 19:43:16 +02:00
|
|
|
metadata: [] as UserMetadataEntity[],
|
2023-12-11 21:37:47 +02:00
|
|
|
} as UserEntity,
|
|
|
|
sharedLink: {
|
|
|
|
id: '123',
|
|
|
|
allowUpload: false,
|
|
|
|
allowDownload: false,
|
|
|
|
password: 'password-123',
|
|
|
|
showExif: true,
|
|
|
|
} as SharedLinkEntity,
|
|
|
|
}),
|
2023-08-01 03:28:07 +02:00
|
|
|
};
|