feat(server, web): quotas (#4471)
* feat: quotas * chore: open api * chore: update status box and upload error message --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
2
server/test/fixtures/file.stub.ts
vendored
2
server/test/fixtures/file.stub.ts
vendored
@@ -4,11 +4,13 @@ export const fileStub = {
|
||||
originalPath: 'fake_path/asset_1.jpeg',
|
||||
checksum: Buffer.from('file hash', 'utf8'),
|
||||
originalName: 'asset_1.jpeg',
|
||||
size: 42,
|
||||
}),
|
||||
livePhotoMotion: Object.freeze({
|
||||
uuid: 'random-uuid',
|
||||
originalPath: 'fake_path/asset_1.mp4',
|
||||
checksum: Buffer.from('live photo file hash', 'utf8'),
|
||||
originalName: 'asset_1.mp4',
|
||||
size: 69,
|
||||
}),
|
||||
};
|
||||
|
||||
20
server/test/fixtures/user.stub.ts
vendored
20
server/test/fixtures/user.stub.ts
vendored
@@ -17,6 +17,12 @@ export const userDto = {
|
||||
password: 'Password123',
|
||||
name: 'User 3',
|
||||
},
|
||||
userWithQuota: {
|
||||
email: 'quota-user@immich.app',
|
||||
password: 'Password123',
|
||||
name: 'User with quota',
|
||||
quotaSizeInBytes: 42,
|
||||
},
|
||||
};
|
||||
|
||||
export const userStub = {
|
||||
@@ -36,6 +42,8 @@ export const userStub = {
|
||||
assets: [],
|
||||
memoriesEnabled: true,
|
||||
avatarColor: UserAvatarColor.PRIMARY,
|
||||
quotaSizeInBytes: null,
|
||||
quotaUsageInBytes: 0,
|
||||
}),
|
||||
user1: Object.freeze<UserEntity>({
|
||||
...authStub.user1.user,
|
||||
@@ -53,6 +61,8 @@ export const userStub = {
|
||||
assets: [],
|
||||
memoriesEnabled: true,
|
||||
avatarColor: UserAvatarColor.PRIMARY,
|
||||
quotaSizeInBytes: null,
|
||||
quotaUsageInBytes: 0,
|
||||
}),
|
||||
user2: Object.freeze<UserEntity>({
|
||||
...authStub.user2.user,
|
||||
@@ -70,6 +80,8 @@ export const userStub = {
|
||||
assets: [],
|
||||
memoriesEnabled: true,
|
||||
avatarColor: UserAvatarColor.PRIMARY,
|
||||
quotaSizeInBytes: null,
|
||||
quotaUsageInBytes: 0,
|
||||
}),
|
||||
storageLabel: Object.freeze<UserEntity>({
|
||||
...authStub.user1.user,
|
||||
@@ -87,6 +99,8 @@ export const userStub = {
|
||||
assets: [],
|
||||
memoriesEnabled: true,
|
||||
avatarColor: UserAvatarColor.PRIMARY,
|
||||
quotaSizeInBytes: null,
|
||||
quotaUsageInBytes: 0,
|
||||
}),
|
||||
externalPath1: Object.freeze<UserEntity>({
|
||||
...authStub.user1.user,
|
||||
@@ -104,6 +118,8 @@ export const userStub = {
|
||||
assets: [],
|
||||
memoriesEnabled: true,
|
||||
avatarColor: UserAvatarColor.PRIMARY,
|
||||
quotaSizeInBytes: null,
|
||||
quotaUsageInBytes: 0,
|
||||
}),
|
||||
externalPath2: Object.freeze<UserEntity>({
|
||||
...authStub.user1.user,
|
||||
@@ -121,6 +137,8 @@ export const userStub = {
|
||||
assets: [],
|
||||
memoriesEnabled: true,
|
||||
avatarColor: UserAvatarColor.PRIMARY,
|
||||
quotaSizeInBytes: null,
|
||||
quotaUsageInBytes: 0,
|
||||
}),
|
||||
profilePath: Object.freeze<UserEntity>({
|
||||
...authStub.user1.user,
|
||||
@@ -138,5 +156,7 @@ export const userStub = {
|
||||
assets: [],
|
||||
memoriesEnabled: true,
|
||||
avatarColor: UserAvatarColor.PRIMARY,
|
||||
quotaSizeInBytes: null,
|
||||
quotaUsageInBytes: 0,
|
||||
}),
|
||||
};
|
||||
|
||||
@@ -19,5 +19,7 @@ export const newUserRepositoryMock = (reset = true): jest.Mocked<IUserRepository
|
||||
getDeletedUsers: jest.fn(),
|
||||
restore: jest.fn(),
|
||||
hasAdmin: jest.fn(),
|
||||
updateUsage: jest.fn(),
|
||||
syncUsage: jest.fn(),
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user