@daocloud-proto/ghippo 0.5.4 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/v1alpha1/group.pb.ts +65 -0
- package/v1alpha1/{loginPage.pb.ts → loginpage.pb.ts} +13 -0
- package/v1alpha1/message.pb.ts +13 -1
- package/v1alpha1/productnav.pb.ts +0 -1
- package/v1alpha1/role.pb.ts +130 -0
- package/v1alpha1/topnav.pb.ts +13 -0
- package/v1alpha1/user.pb.ts +63 -0
- package/v1alpha1/workspace.pb.ts +65 -7
package/package.json
CHANGED
package/v1alpha1/group.pb.ts
CHANGED
|
@@ -11,6 +11,7 @@ export type CreateGroupRequest = {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export type CreateGroupResponse = {
|
|
14
|
+
id?: string
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export type ListGroupsRequest = {
|
|
@@ -82,12 +83,67 @@ export type DeleteUserFromGroupResponse = {
|
|
|
82
83
|
|
|
83
84
|
export type UpdateGroupRequest = {
|
|
84
85
|
id?: string
|
|
86
|
+
name?: string
|
|
85
87
|
description?: string
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
export type UpdateGroupResponse = {
|
|
89
91
|
}
|
|
90
92
|
|
|
93
|
+
export type ListGroupRolesRequest = {
|
|
94
|
+
id?: string
|
|
95
|
+
search?: string
|
|
96
|
+
offset?: number
|
|
97
|
+
size?: number
|
|
98
|
+
type?: string
|
|
99
|
+
authorized?: boolean
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export type ListGroupRolesResponse = {
|
|
103
|
+
total?: number
|
|
104
|
+
authorized_count?: number
|
|
105
|
+
roles?: RoleInfo[]
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export type ListGroupSubjectRequest = {
|
|
109
|
+
id?: string
|
|
110
|
+
search?: string
|
|
111
|
+
offset?: number
|
|
112
|
+
size?: number
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export type ListGroupSubjectResponse = {
|
|
116
|
+
total?: number
|
|
117
|
+
subjects?: GroupSubject[]
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export type GroupSubject = {
|
|
121
|
+
id?: string
|
|
122
|
+
role_id?: string
|
|
123
|
+
type?: string
|
|
124
|
+
name?: string
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export type UpdateGroupRolesRequest = {
|
|
128
|
+
id?: string
|
|
129
|
+
add_roles?: string[]
|
|
130
|
+
remove_roles?: string[]
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export type UpdateGroupRolesResponse = {
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export type RoleInfo = {
|
|
137
|
+
id?: string
|
|
138
|
+
name?: string
|
|
139
|
+
type?: string
|
|
140
|
+
description?: string
|
|
141
|
+
composite?: boolean
|
|
142
|
+
created_at?: string
|
|
143
|
+
updated_at?: string
|
|
144
|
+
authorized?: boolean
|
|
145
|
+
}
|
|
146
|
+
|
|
91
147
|
export class Group {
|
|
92
148
|
static CreateGroup(req: CreateGroupRequest, initReq?: fm.InitReq): Promise<CreateGroupResponse> {
|
|
93
149
|
return fm.fetchReq<CreateGroupRequest, CreateGroupResponse>(`/apis/ghippo.io/v1alpha1/groups`, {...initReq, method: "POST", body: JSON.stringify(req)})
|
|
@@ -113,4 +169,13 @@ export class Group {
|
|
|
113
169
|
static DeleteUserFromGroup(req: DeleteUserFromGroupRequest, initReq?: fm.InitReq): Promise<DeleteUserFromGroupResponse> {
|
|
114
170
|
return fm.fetchReq<DeleteUserFromGroupRequest, DeleteUserFromGroupResponse>(`/apis/ghippo.io/v1alpha1/groups/${req["id"]}/members/${req["user_id"]}`, {...initReq, method: "DELETE"})
|
|
115
171
|
}
|
|
172
|
+
static ListGroupRoles(req: ListGroupRolesRequest, initReq?: fm.InitReq): Promise<ListGroupRolesResponse> {
|
|
173
|
+
return fm.fetchReq<ListGroupRolesRequest, ListGroupRolesResponse>(`/apis/ghippo.io/v1alpha1/groups/${req["id"]}/roles?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
|
|
174
|
+
}
|
|
175
|
+
static ListGroupSubjects(req: ListGroupSubjectRequest, initReq?: fm.InitReq): Promise<ListGroupSubjectResponse> {
|
|
176
|
+
return fm.fetchReq<ListGroupSubjectRequest, ListGroupSubjectResponse>(`/apis/ghippo.io/v1alpha1/groups/${req["id"]}/subjects?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
|
|
177
|
+
}
|
|
178
|
+
static UpdateGroupRoles(req: UpdateGroupRolesRequest, initReq?: fm.InitReq): Promise<UpdateGroupRolesResponse> {
|
|
179
|
+
return fm.fetchReq<UpdateGroupRolesRequest, UpdateGroupRolesResponse>(`/apis/ghippo.io/v1alpha1/groups/${req["id"]}/roles`, {...initReq, method: "PUT", body: JSON.stringify(req)})
|
|
180
|
+
}
|
|
116
181
|
}
|
|
@@ -25,6 +25,16 @@ export type GetLoginPageVersionResponse = {
|
|
|
25
25
|
version?: number
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
export type UpdateLoginPageInfoRequest = {
|
|
29
|
+
platform_name?: string
|
|
30
|
+
copyright?: string
|
|
31
|
+
icon?: Uint8Array
|
|
32
|
+
favicon?: Uint8Array
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type UpdateLoginPageInfoResponse = {
|
|
36
|
+
}
|
|
37
|
+
|
|
28
38
|
export class LoginPage {
|
|
29
39
|
static GetInfo(req: GetLoginPageInfoRequest, initReq?: fm.InitReq): Promise<GetLoginPageInfoResponse> {
|
|
30
40
|
return fm.fetchReq<GetLoginPageInfoRequest, GetLoginPageInfoResponse>(`/apis/ghippo.io/v1alpha1/login-page/info?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
@@ -32,4 +42,7 @@ export class LoginPage {
|
|
|
32
42
|
static GetVersion(req: GetLoginPageVersionRequest, initReq?: fm.InitReq): Promise<GetLoginPageVersionResponse> {
|
|
33
43
|
return fm.fetchReq<GetLoginPageVersionRequest, GetLoginPageVersionResponse>(`/apis/ghippo.io/v1alpha1/login-page/version?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
34
44
|
}
|
|
45
|
+
static UpdateInfo(req: UpdateLoginPageInfoRequest, initReq?: fm.InitReq): Promise<UpdateLoginPageInfoResponse> {
|
|
46
|
+
return fm.fetchReq<UpdateLoginPageInfoRequest, UpdateLoginPageInfoResponse>(`/apis/ghippo.io/v1alpha1/login-page/info`, {...initReq, method: "PUT", body: JSON.stringify(req)})
|
|
47
|
+
}
|
|
35
48
|
}
|
package/v1alpha1/message.pb.ts
CHANGED
|
@@ -21,7 +21,7 @@ export type ListMessagesRequest = {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export type ListMessagesResponse = {
|
|
24
|
-
total?:
|
|
24
|
+
total?: number
|
|
25
25
|
messages?: MessageInfo[]
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -66,6 +66,15 @@ export type SetReadMessagesRequest = {
|
|
|
66
66
|
export type SetReadMessagesResponse = {
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
export type GetMessagesCountRequest = {
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export type GetMessagesCountResponse = {
|
|
73
|
+
total?: number
|
|
74
|
+
readTotal?: number
|
|
75
|
+
unreadTotal?: number
|
|
76
|
+
}
|
|
77
|
+
|
|
69
78
|
export class Message {
|
|
70
79
|
static ListMessages(req: ListMessagesRequest, initReq?: fm.InitReq): Promise<ListMessagesResponse> {
|
|
71
80
|
return fm.fetchReq<ListMessagesRequest, ListMessagesResponse>(`/apis/ghippo.io/v1alpha1/messages?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
@@ -82,4 +91,7 @@ export class Message {
|
|
|
82
91
|
static SetReadMessages(req: SetReadMessagesRequest, initReq?: fm.InitReq): Promise<SetReadMessagesResponse> {
|
|
83
92
|
return fm.fetchReq<SetReadMessagesRequest, SetReadMessagesResponse>(`/apis/ghippo.io/v1alpha1/read-messages`, {...initReq, method: "POST", body: JSON.stringify(req)})
|
|
84
93
|
}
|
|
94
|
+
static GetMessagesCount(req: GetMessagesCountRequest, initReq?: fm.InitReq): Promise<GetMessagesCountResponse> {
|
|
95
|
+
return fm.fetchReq<GetMessagesCountRequest, GetMessagesCountResponse>(`/apis/ghippo.io/v1alpha1/messages/count?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
96
|
+
}
|
|
85
97
|
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/*
|
|
4
|
+
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as fm from "../fetch.pb"
|
|
8
|
+
export type RoleInfo = {
|
|
9
|
+
id?: string
|
|
10
|
+
name?: string
|
|
11
|
+
type?: string
|
|
12
|
+
description?: string
|
|
13
|
+
composite?: boolean
|
|
14
|
+
created_at?: string
|
|
15
|
+
updated_at?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type ListRolesRequest = {
|
|
19
|
+
search?: string
|
|
20
|
+
offset?: number
|
|
21
|
+
size?: number
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type ListRolesResponse = {
|
|
25
|
+
roles?: RoleInfo[]
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type GetRoleRequest = {
|
|
29
|
+
id?: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type GetRoleResponse = {
|
|
33
|
+
role?: RoleInfo
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type CreateRoleRequest = {
|
|
37
|
+
name?: string
|
|
38
|
+
description?: string
|
|
39
|
+
relation_role_id?: string[]
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export type CreateRoleResponse = {
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type UpdateRoleRequest = {
|
|
46
|
+
id?: string
|
|
47
|
+
description?: string
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export type UpdateRoleResponse = {
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type DeleteRoleRequest = {
|
|
54
|
+
id?: string
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type DeleteRoleResponse = {
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type AddRoleCompositeRequest = {
|
|
61
|
+
id?: string
|
|
62
|
+
relation_role_id?: string[]
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type AddRoleCompositeResponse = {
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type RemoveRoleCompositeRequest = {
|
|
69
|
+
id?: string
|
|
70
|
+
relation_role_id?: string[]
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export type RemoveRoleCompositeResponse = {
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export type ListRoleCompositeRequest = {
|
|
77
|
+
id?: string
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export type ListRoleCompositeResponse = {
|
|
81
|
+
roles?: RoleInfo[]
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type ListRoleSubjectsRequest = {
|
|
85
|
+
id?: string
|
|
86
|
+
offset?: number
|
|
87
|
+
size?: number
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export type ListRoleSubjectsResponse = {
|
|
91
|
+
total?: number
|
|
92
|
+
subjects?: Subject[]
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export type Subject = {
|
|
96
|
+
id?: string
|
|
97
|
+
role_id?: string
|
|
98
|
+
type?: string
|
|
99
|
+
name?: string
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export class Role {
|
|
103
|
+
static ListRoles(req: ListRolesRequest, initReq?: fm.InitReq): Promise<ListRolesResponse> {
|
|
104
|
+
return fm.fetchReq<ListRolesRequest, ListRolesResponse>(`/apis/ghippo.io/v1alpha1/roles?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
105
|
+
}
|
|
106
|
+
static GetRole(req: GetRoleRequest, initReq?: fm.InitReq): Promise<GetRoleResponse> {
|
|
107
|
+
return fm.fetchReq<GetRoleRequest, GetRoleResponse>(`/apis/ghippo.io/v1alpha1/roles/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
|
|
108
|
+
}
|
|
109
|
+
static CreateRole(req: CreateRoleRequest, initReq?: fm.InitReq): Promise<CreateRoleResponse> {
|
|
110
|
+
return fm.fetchReq<CreateRoleRequest, CreateRoleResponse>(`/apis/ghippo.io/v1alpha1/roles`, {...initReq, method: "POST", body: JSON.stringify(req)})
|
|
111
|
+
}
|
|
112
|
+
static UpdateRole(req: UpdateRoleRequest, initReq?: fm.InitReq): Promise<UpdateRoleResponse> {
|
|
113
|
+
return fm.fetchReq<UpdateRoleRequest, UpdateRoleResponse>(`/apis/ghippo.io/v1alpha1/roles/${req["id"]}`, {...initReq, method: "PUT", body: JSON.stringify(req)})
|
|
114
|
+
}
|
|
115
|
+
static DeleteRole(req: DeleteRoleRequest, initReq?: fm.InitReq): Promise<DeleteRoleResponse> {
|
|
116
|
+
return fm.fetchReq<DeleteRoleRequest, DeleteRoleResponse>(`/apis/ghippo.io/v1alpha1/roles/${req["id"]}`, {...initReq, method: "DELETE"})
|
|
117
|
+
}
|
|
118
|
+
static AddRoleComposite(req: AddRoleCompositeRequest, initReq?: fm.InitReq): Promise<AddRoleCompositeResponse> {
|
|
119
|
+
return fm.fetchReq<AddRoleCompositeRequest, AddRoleCompositeResponse>(`/apis/ghippo.io/v1alpha1/roles/${req["id"]}/composites`, {...initReq, method: "POST", body: JSON.stringify(req)})
|
|
120
|
+
}
|
|
121
|
+
static RemoveRoleComposite(req: RemoveRoleCompositeRequest, initReq?: fm.InitReq): Promise<RemoveRoleCompositeResponse> {
|
|
122
|
+
return fm.fetchReq<RemoveRoleCompositeRequest, RemoveRoleCompositeResponse>(`/apis/ghippo.io/v1alpha1/roles/${req["id"]}/composites`, {...initReq, method: "PUT", body: JSON.stringify(req)})
|
|
123
|
+
}
|
|
124
|
+
static ListRoleComposite(req: ListRoleCompositeRequest, initReq?: fm.InitReq): Promise<ListRoleCompositeResponse> {
|
|
125
|
+
return fm.fetchReq<ListRoleCompositeRequest, ListRoleCompositeResponse>(`/apis/ghippo.io/v1alpha1/roles/${req["id"]}/composites?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
|
|
126
|
+
}
|
|
127
|
+
static ListRoleSubjects(req: ListRoleSubjectsRequest, initReq?: fm.InitReq): Promise<ListRoleSubjectsResponse> {
|
|
128
|
+
return fm.fetchReq<ListRoleSubjectsRequest, ListRoleSubjectsResponse>(`/apis/ghippo.io/v1alpha1/roles/${req["id"]}/subjects?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
|
|
129
|
+
}
|
|
130
|
+
}
|
package/v1alpha1/topnav.pb.ts
CHANGED
|
@@ -17,8 +17,21 @@ export type TopNavResponse = {
|
|
|
17
17
|
portal_url?: string
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
export type UpdateTopNavRequest = {
|
|
21
|
+
platform_name?: string
|
|
22
|
+
icon?: Uint8Array
|
|
23
|
+
favicon?: Uint8Array
|
|
24
|
+
portal_url?: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type UpdateTopNavResponse = {
|
|
28
|
+
}
|
|
29
|
+
|
|
20
30
|
export class TopNavigator {
|
|
21
31
|
static Info(req: TopNavRequest, initReq?: fm.InitReq): Promise<TopNavResponse> {
|
|
22
32
|
return fm.fetchReq<TopNavRequest, TopNavResponse>(`/apis/ghippo.io/v1alpha1/top-nav/info?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
23
33
|
}
|
|
34
|
+
static UpdateTopNav(req: UpdateTopNavRequest, initReq?: fm.InitReq): Promise<UpdateTopNavResponse> {
|
|
35
|
+
return fm.fetchReq<UpdateTopNavRequest, UpdateTopNavResponse>(`/apis/ghippo.io/v1alpha1/top-nav`, {...initReq, method: "PUT", body: JSON.stringify(req)})
|
|
36
|
+
}
|
|
24
37
|
}
|
package/v1alpha1/user.pb.ts
CHANGED
|
@@ -89,6 +89,60 @@ export type ListUserGroupsResponse = {
|
|
|
89
89
|
data?: Group[]
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
export type ListUserRolesRequest = {
|
|
93
|
+
id?: string
|
|
94
|
+
search?: string
|
|
95
|
+
offset?: number
|
|
96
|
+
size?: number
|
|
97
|
+
type?: string
|
|
98
|
+
authorized?: boolean
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export type ListUserRolesResponse = {
|
|
102
|
+
total?: number
|
|
103
|
+
authorized_count?: number
|
|
104
|
+
roles?: RoleInfo[]
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export type RoleInfo = {
|
|
108
|
+
id?: string
|
|
109
|
+
name?: string
|
|
110
|
+
type?: string
|
|
111
|
+
description?: string
|
|
112
|
+
composite?: boolean
|
|
113
|
+
created_at?: string
|
|
114
|
+
updated_at?: string
|
|
115
|
+
authorized?: boolean
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export type ListUserSubjectRequest = {
|
|
119
|
+
id?: string
|
|
120
|
+
search?: string
|
|
121
|
+
offset?: number
|
|
122
|
+
size?: number
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export type ListUserSubjectResponse = {
|
|
126
|
+
total?: number
|
|
127
|
+
subjects?: UserSubject[]
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export type UserSubject = {
|
|
131
|
+
id?: string
|
|
132
|
+
role_id?: string
|
|
133
|
+
type?: string
|
|
134
|
+
name?: string
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export type UpdateUserRolesRequest = {
|
|
138
|
+
id?: string
|
|
139
|
+
add_roles?: string[]
|
|
140
|
+
remove_roles?: string[]
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export type UpdateUserRolesResponse = {
|
|
144
|
+
}
|
|
145
|
+
|
|
92
146
|
export class Users {
|
|
93
147
|
static ListUsers(req: ListUsersRequest, initReq?: fm.InitReq): Promise<ListUsersResponse> {
|
|
94
148
|
return fm.fetchReq<ListUsersRequest, ListUsersResponse>(`/apis/ghippo.io/v1alpha1/users?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
@@ -111,4 +165,13 @@ export class Users {
|
|
|
111
165
|
static ListUserGroups(req: ListUserGroupsRequest, initReq?: fm.InitReq): Promise<ListUserGroupsResponse> {
|
|
112
166
|
return fm.fetchReq<ListUserGroupsRequest, ListUserGroupsResponse>(`/apis/ghippo.io/v1alpha1/users/${req["id"]}/groups?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
|
|
113
167
|
}
|
|
168
|
+
static ListUserRoles(req: ListUserRolesRequest, initReq?: fm.InitReq): Promise<ListUserRolesResponse> {
|
|
169
|
+
return fm.fetchReq<ListUserRolesRequest, ListUserRolesResponse>(`/apis/ghippo.io/v1alpha1/users/${req["id"]}/roles?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
|
|
170
|
+
}
|
|
171
|
+
static ListUserSubjects(req: ListUserSubjectRequest, initReq?: fm.InitReq): Promise<ListUserSubjectResponse> {
|
|
172
|
+
return fm.fetchReq<ListUserSubjectRequest, ListUserSubjectResponse>(`/apis/ghippo.io/v1alpha1/users/${req["id"]}/subjects?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
|
|
173
|
+
}
|
|
174
|
+
static UpdateUserRoles(req: UpdateUserRolesRequest, initReq?: fm.InitReq): Promise<UpdateUserRolesResponse> {
|
|
175
|
+
return fm.fetchReq<UpdateUserRolesRequest, UpdateUserRolesResponse>(`/apis/ghippo.io/v1alpha1/users/${req["id"]}/roles`, {...initReq, method: "PUT", body: JSON.stringify(req)})
|
|
176
|
+
}
|
|
114
177
|
}
|
package/v1alpha1/workspace.pb.ts
CHANGED
|
@@ -5,17 +5,75 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as fm from "../fetch.pb"
|
|
8
|
-
export type
|
|
9
|
-
id?:
|
|
8
|
+
export type WorkspaceInfo = {
|
|
9
|
+
id?: number
|
|
10
|
+
name?: string
|
|
11
|
+
parent_workspace_id?: number
|
|
10
12
|
}
|
|
11
13
|
|
|
12
|
-
export type
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
export type ResourceInfo = {
|
|
15
|
+
resource_name?: string
|
|
16
|
+
workspace_id?: number
|
|
17
|
+
resource_type?: string
|
|
18
|
+
resource_scope?: string
|
|
19
|
+
gproduct?: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type ListWorkspacesRequest = {
|
|
23
|
+
size?: number
|
|
24
|
+
offset?: number
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type ListWorkspacesResponse = {
|
|
28
|
+
total?: number
|
|
29
|
+
workspaces?: WorkspaceInfo[]
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type ListWorkspaceResourcesRequest = {
|
|
33
|
+
workspace_id?: number
|
|
34
|
+
gproduct?: string
|
|
35
|
+
size?: number
|
|
36
|
+
offset?: number
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type ListWorkspaceResourcesResponse = {
|
|
40
|
+
total?: number
|
|
41
|
+
resources?: ResourceInfo[]
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type AddResourceToWorkspaceRequest = {
|
|
45
|
+
workspace_id?: number
|
|
46
|
+
resource_name?: string
|
|
47
|
+
resource_type?: string
|
|
48
|
+
gproduct?: string
|
|
49
|
+
resource_scope?: string
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type AddResourceToWorkspaceResponse = {
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type DeleteResourceFromWorkspaceRequest = {
|
|
56
|
+
workspace_id?: number
|
|
57
|
+
resource_name?: string
|
|
58
|
+
resource_type?: string
|
|
59
|
+
gproduct?: string
|
|
60
|
+
resource_scope?: string
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export type DeleteResourceFromWorkspaceResponse = {
|
|
15
64
|
}
|
|
16
65
|
|
|
17
66
|
export class Workspace {
|
|
18
|
-
static
|
|
19
|
-
return fm.fetchReq<
|
|
67
|
+
static ListWorkspaces(req: ListWorkspacesRequest, initReq?: fm.InitReq): Promise<ListWorkspacesResponse> {
|
|
68
|
+
return fm.fetchReq<ListWorkspacesRequest, ListWorkspacesResponse>(`/apis/ghippo.io/v1alpha1/workspaces?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
69
|
+
}
|
|
70
|
+
static ListWorkspaceResources(req: ListWorkspaceResourcesRequest, initReq?: fm.InitReq): Promise<ListWorkspaceResourcesResponse> {
|
|
71
|
+
return fm.fetchReq<ListWorkspaceResourcesRequest, ListWorkspaceResourcesResponse>(`/apis/ghippo.io/v1alpha1/workspaces/${req["workspace_id"]}/resources?${fm.renderURLSearchParams(req, ["workspace_id"])}`, {...initReq, method: "GET"})
|
|
72
|
+
}
|
|
73
|
+
static AddResourceToWorkspace(req: AddResourceToWorkspaceRequest, initReq?: fm.InitReq): Promise<AddResourceToWorkspaceResponse> {
|
|
74
|
+
return fm.fetchReq<AddResourceToWorkspaceRequest, AddResourceToWorkspaceResponse>(`/apis/ghippo.io/v1alpha1/workspaces/${req["workspace_id"]}/resources`, {...initReq, method: "POST", body: JSON.stringify(req)})
|
|
75
|
+
}
|
|
76
|
+
static DeleteResourceFromWorkspace(req: DeleteResourceFromWorkspaceRequest, initReq?: fm.InitReq): Promise<DeleteResourceFromWorkspaceResponse> {
|
|
77
|
+
return fm.fetchReq<DeleteResourceFromWorkspaceRequest, DeleteResourceFromWorkspaceResponse>(`/apis/ghippo.io/v1alpha1/workspaces/${req["workspace_id"]}/resources`, {...initReq, method: "PUT", body: JSON.stringify(req)})
|
|
20
78
|
}
|
|
21
79
|
}
|