fix: console build (#194)

* grpc gen, headers

* add auth headers

* resolve build errors

* lint

* project grant changes

* project detail

* owned projects

* fix undefined
This commit is contained in:
Max Peintner
2020-06-09 17:12:35 +02:00
committed by GitHub
parent 25b97b1bcc
commit ef9b03cc84
34 changed files with 8916 additions and 3729 deletions
+33 -19
View File
@@ -10,7 +10,9 @@ import {
ApplicationSearchRequest,
ApplicationSearchResponse,
ApplicationUpdate,
GrantedGrantID,
GrantedProjectSearchQuery,
GrantedProjectSearchRequest,
GrantedProjectSearchResponse,
OIDCApplicationCreate,
OIDCConfig,
OIDCConfigUpdate,
@@ -38,9 +40,6 @@ import {
ProjectRoleSearchQuery,
ProjectRoleSearchRequest,
ProjectRoleSearchResponse,
ProjectSearchQuery,
ProjectSearchRequest,
ProjectSearchResponse,
ProjectUpdateRequest,
ProjectUserGrantSearchRequest,
UserGrant,
@@ -72,21 +71,36 @@ export class ProjectService {
return responseMapper(response);
}
public async SearchProjects(
limit: number, offset: number, queryList?: ProjectSearchQuery[]): Promise<ProjectSearchResponse> {
const req = new ProjectSearchRequest();
public async SearchGrantedProjects(
limit: number, offset: number, queryList?: GrantedProjectSearchQuery[]): Promise<GrantedProjectSearchResponse> {
const req = new GrantedProjectSearchRequest();
req.setLimit(limit);
req.setOffset(offset);
if (queryList) {
req.setQueriesList(queryList);
}
return await this.request(
c => c.searchProjects,
c => c.searchGrantedProjects,
req,
f => f,
);
}
// public async SearchGrantedProjects(
// limit: number, offset: number, queryList?: GrantedProjectSearchQuery[]): Promise<GrantedProjectSearchResponse> {
// const req = new GrantedProjectSearchRequest();
// req.setLimit(limit);
// req.setOffset(offset);
// if (queryList) {
// req.setQueriesList(queryList);
// }
// return await this.request(
// c => c.search,
// req,
// f => f,
// );
// }
public async GetProjectById(projectId: string): Promise<Project> {
const req = new ProjectID();
req.setId(projectId);
@@ -97,6 +111,17 @@ export class ProjectService {
);
}
public async GetGrantedProjectGrantByID(projectId: string, id: string): Promise<ProjectGrant> {
const req = new ProjectGrantID();
req.setId(id);
req.setProjectId(projectId);
return await this.request(
c => c.getGrantedProjectGrantByID,
req,
f => f,
);
}
public async CreateProject(project: ProjectCreateRequest.AsObject): Promise<Project> {
const req = new ProjectCreateRequest();
req.setName(project.name);
@@ -368,17 +393,6 @@ export class ProjectService {
);
}
// NEW
public async GetGrantedProjectGrantByID(id: string): Promise<ProjectGrant> {
const req = new GrantedGrantID();
req.setId(id);
return await this.request(
c => c.getGrantedProjectGrantByID,
req,
f => f,
);
}
public async GetProjectMemberRoles(): Promise<ProjectMemberRoles> {
const req = new Empty();
return await this.request(