2019-08-30 12:34:51 +01:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
2023-03-30 15:02:45 +01:00
|
|
|
import {
|
|
|
|
SetUserSettingsData,
|
|
|
|
UpdatedUser,
|
|
|
|
User,
|
|
|
|
UsersApi,
|
|
|
|
UserSettings,
|
|
|
|
} from '@/types/users';
|
2019-08-30 12:34:51 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Mock for UsersApi
|
|
|
|
*/
|
|
|
|
export class UsersApiMock implements UsersApi {
|
|
|
|
private mockUser: User;
|
|
|
|
|
|
|
|
public setMockUser(mockUser: User): void {
|
|
|
|
this.mockUser = mockUser;
|
|
|
|
}
|
|
|
|
|
|
|
|
public get(): Promise<User> {
|
|
|
|
return Promise.resolve(this.mockUser);
|
|
|
|
}
|
|
|
|
|
2022-12-19 15:38:18 +00:00
|
|
|
public getFrozenStatus(): Promise<boolean> {
|
|
|
|
return Promise.resolve(true);
|
|
|
|
}
|
|
|
|
|
2023-03-16 15:25:56 +00:00
|
|
|
public getUserSettings(): Promise<UserSettings> {
|
|
|
|
return Promise.resolve(new UserSettings());
|
|
|
|
}
|
|
|
|
|
2023-03-30 15:02:45 +01:00
|
|
|
public updateSettings(status: SetUserSettingsData): Promise<UserSettings> {
|
|
|
|
return Promise.resolve(new UserSettings());
|
2023-03-16 15:25:56 +00:00
|
|
|
}
|
|
|
|
|
2021-08-05 12:07:45 +01:00
|
|
|
public update(_user: UpdatedUser): Promise<void> {
|
2019-08-30 12:34:51 +01:00
|
|
|
throw new Error('not implemented');
|
|
|
|
}
|
2021-07-08 17:43:09 +01:00
|
|
|
|
2021-07-20 12:34:40 +01:00
|
|
|
public enableUserMFA(_: string): Promise<void> {
|
2021-07-08 17:43:09 +01:00
|
|
|
return Promise.resolve();
|
|
|
|
}
|
|
|
|
|
2021-08-16 22:23:06 +01:00
|
|
|
public disableUserMFA(_passcode: string, _recoveryCode: string): Promise<void> {
|
2021-07-08 17:43:09 +01:00
|
|
|
return Promise.resolve();
|
|
|
|
}
|
|
|
|
|
2021-07-16 17:58:26 +01:00
|
|
|
public generateUserMFASecret(): Promise<string> {
|
|
|
|
return Promise.resolve('test');
|
|
|
|
}
|
|
|
|
|
2021-07-08 17:43:09 +01:00
|
|
|
public generateUserMFARecoveryCodes(): Promise<string[]> {
|
|
|
|
return Promise.resolve(['test', 'test1', 'test2']);
|
|
|
|
}
|
2019-08-30 12:34:51 +01:00
|
|
|
}
|