2019-08-30 12:34:51 +01:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
2021-12-07 14:41:39 +00:00
|
|
|
import {
|
|
|
|
Project,
|
|
|
|
ProjectFields,
|
2023-06-01 20:06:50 +01:00
|
|
|
ProjectInvitation,
|
|
|
|
ProjectInvitationResponse,
|
2021-12-07 14:41:39 +00:00
|
|
|
ProjectLimits,
|
|
|
|
ProjectsApi,
|
|
|
|
ProjectsCursor,
|
|
|
|
ProjectsPage,
|
2022-09-08 15:11:09 +01:00
|
|
|
ProjectsStorageBandwidthDaily,
|
2021-12-07 14:41:39 +00:00
|
|
|
} from '@/types/projects';
|
2019-08-30 12:34:51 +01:00
|
|
|
|
|
|
|
/**
|
2019-09-27 15:41:04 +01:00
|
|
|
* Mock for ProjectsApi
|
2019-08-30 12:34:51 +01:00
|
|
|
*/
|
|
|
|
export class ProjectsApiMock implements ProjectsApi {
|
2021-06-09 16:13:19 +01:00
|
|
|
private mockProjects: Project[] = [];
|
2019-12-12 16:25:38 +00:00
|
|
|
private mockLimits: ProjectLimits;
|
2021-02-05 20:57:03 +00:00
|
|
|
private mockProjectsPage: ProjectsPage;
|
2019-08-30 12:34:51 +01:00
|
|
|
|
2019-09-27 15:41:04 +01:00
|
|
|
public setMockProjects(mockProjects: Project[]): void {
|
|
|
|
this.mockProjects = mockProjects;
|
2019-08-30 12:34:51 +01:00
|
|
|
}
|
|
|
|
|
2019-12-12 16:25:38 +00:00
|
|
|
public setMockLimits(mockLimits: ProjectLimits): void {
|
|
|
|
this.mockLimits = mockLimits;
|
|
|
|
}
|
|
|
|
|
2021-08-05 12:07:45 +01:00
|
|
|
create(_createProjectFields: ProjectFields): Promise<Project> {
|
2019-08-30 12:34:51 +01:00
|
|
|
throw new Error('not implemented');
|
|
|
|
}
|
|
|
|
|
2021-08-05 12:07:45 +01:00
|
|
|
delete(_projectId: string): Promise<void> {
|
2019-08-30 12:34:51 +01:00
|
|
|
throw new Error('not implemented');
|
|
|
|
}
|
|
|
|
|
|
|
|
get(): Promise<Project[]> {
|
2019-09-27 15:41:04 +01:00
|
|
|
return Promise.resolve(this.mockProjects);
|
2019-08-30 12:34:51 +01:00
|
|
|
}
|
|
|
|
|
2021-08-05 12:07:45 +01:00
|
|
|
getOwnedProjects(_cursor: ProjectsCursor): Promise<ProjectsPage> {
|
2021-02-05 20:57:03 +00:00
|
|
|
return Promise.resolve(this.mockProjectsPage);
|
|
|
|
}
|
|
|
|
|
2021-08-02 23:06:15 +01:00
|
|
|
update(_projectId: string, _projectFields: ProjectFields, _projectLimits: ProjectLimits): Promise<void> {
|
2020-03-18 17:07:29 +00:00
|
|
|
return Promise.resolve();
|
2019-08-30 12:34:51 +01:00
|
|
|
}
|
2019-12-12 16:25:38 +00:00
|
|
|
|
2021-08-05 12:07:45 +01:00
|
|
|
getLimits(_projectId: string): Promise<ProjectLimits> {
|
2020-03-18 17:07:29 +00:00
|
|
|
return Promise.resolve(this.mockLimits);
|
2019-12-12 16:25:38 +00:00
|
|
|
}
|
2021-06-24 16:49:15 +01:00
|
|
|
|
|
|
|
getTotalLimits(): Promise<ProjectLimits> {
|
|
|
|
return Promise.resolve(this.mockLimits);
|
|
|
|
}
|
2021-12-07 14:41:39 +00:00
|
|
|
|
2022-09-13 14:12:14 +01:00
|
|
|
getSalt(): Promise<string> {
|
|
|
|
throw new Error('not implemented');
|
|
|
|
}
|
|
|
|
|
2021-12-07 14:41:39 +00:00
|
|
|
getDailyUsage(_projectId: string, _start: Date, _end: Date): Promise<ProjectsStorageBandwidthDaily> {
|
|
|
|
throw new Error('not implemented');
|
|
|
|
}
|
2023-06-01 20:06:50 +01:00
|
|
|
|
|
|
|
getUserInvitations(): Promise<ProjectInvitation[]> {
|
|
|
|
throw new Error('not implemented');
|
|
|
|
}
|
|
|
|
|
|
|
|
respondToInvitation(_projectID: string, _response: ProjectInvitationResponse): Promise<void> {
|
|
|
|
throw new Error('not implemented');
|
|
|
|
}
|
2019-08-30 12:34:51 +01:00
|
|
|
}
|