@daocloud-proto/ghippo 0.5.5 → 0.5.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/ghippo",
3
- "version":"0.5.5",
3
+ "version":"0.5.6",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -88,6 +88,60 @@ export type UpdateGroupRequest = {
88
88
  export type UpdateGroupResponse = {
89
89
  }
90
90
 
91
+ export type ListGroupRolesRequest = {
92
+ id?: string
93
+ search?: string
94
+ offset?: number
95
+ size?: number
96
+ type?: string
97
+ authorized?: boolean
98
+ }
99
+
100
+ export type ListGroupRolesResponse = {
101
+ total?: number
102
+ authorized_count?: number
103
+ roles?: RoleInfo[]
104
+ }
105
+
106
+ export type ListGroupSubjectRequest = {
107
+ id?: string
108
+ search?: string
109
+ offset?: number
110
+ size?: number
111
+ }
112
+
113
+ export type ListGroupSubjectResponse = {
114
+ total?: number
115
+ subjects?: GroupSubject[]
116
+ }
117
+
118
+ export type GroupSubject = {
119
+ id?: string
120
+ role_id?: string
121
+ type?: string
122
+ name?: string
123
+ }
124
+
125
+ export type UpdateGroupRolesRequest = {
126
+ id?: string
127
+ add_roles?: string[]
128
+ remove_roles?: string[]
129
+ }
130
+
131
+ export type UpdateGroupRolesResponse = {
132
+ }
133
+
134
+ export type RoleInfo = {
135
+ id?: string
136
+ name?: string
137
+ type?: string
138
+ description?: string
139
+ composite?: boolean
140
+ created_at?: string
141
+ updated_at?: string
142
+ authorized?: boolean
143
+ }
144
+
91
145
  export class Group {
92
146
  static CreateGroup(req: CreateGroupRequest, initReq?: fm.InitReq): Promise<CreateGroupResponse> {
93
147
  return fm.fetchReq<CreateGroupRequest, CreateGroupResponse>(`/apis/ghippo.io/v1alpha1/groups`, {...initReq, method: "POST", body: JSON.stringify(req)})
@@ -113,4 +167,13 @@ export class Group {
113
167
  static DeleteUserFromGroup(req: DeleteUserFromGroupRequest, initReq?: fm.InitReq): Promise<DeleteUserFromGroupResponse> {
114
168
  return fm.fetchReq<DeleteUserFromGroupRequest, DeleteUserFromGroupResponse>(`/apis/ghippo.io/v1alpha1/groups/${req["id"]}/members/${req["user_id"]}`, {...initReq, method: "DELETE"})
115
169
  }
170
+ static ListGroupRoles(req: ListGroupRolesRequest, initReq?: fm.InitReq): Promise<ListGroupRolesResponse> {
171
+ return fm.fetchReq<ListGroupRolesRequest, ListGroupRolesResponse>(`/apis/ghippo.io/v1alpha1/groups/${req["id"]}/roles?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
172
+ }
173
+ static ListGroupSubjects(req: ListGroupSubjectRequest, initReq?: fm.InitReq): Promise<ListGroupSubjectResponse> {
174
+ return fm.fetchReq<ListGroupSubjectRequest, ListGroupSubjectResponse>(`/apis/ghippo.io/v1alpha1/groups/${req["id"]}/subjects?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
175
+ }
176
+ static UpdateGroupRoles(req: UpdateGroupRolesRequest, initReq?: fm.InitReq): Promise<UpdateGroupRolesResponse> {
177
+ return fm.fetchReq<UpdateGroupRolesRequest, UpdateGroupRolesResponse>(`/apis/ghippo.io/v1alpha1/groups/${req["id"]}/roles`, {...initReq, method: "PUT", body: JSON.stringify(req)})
178
+ }
116
179
  }
@@ -81,6 +81,24 @@ export type ListRoleCompositeResponse = {
81
81
  roles?: RoleInfo[]
82
82
  }
83
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
+
84
102
  export class Role {
85
103
  static ListRoles(req: ListRolesRequest, initReq?: fm.InitReq): Promise<ListRolesResponse> {
86
104
  return fm.fetchReq<ListRolesRequest, ListRolesResponse>(`/apis/ghippo.io/v1alpha1/roles?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
@@ -106,4 +124,7 @@ export class Role {
106
124
  static ListRoleComposite(req: ListRoleCompositeRequest, initReq?: fm.InitReq): Promise<ListRoleCompositeResponse> {
107
125
  return fm.fetchReq<ListRoleCompositeRequest, ListRoleCompositeResponse>(`/apis/ghippo.io/v1alpha1/roles/${req["id"]}/composites?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
108
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
+ }
109
130
  }
@@ -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: "PATCH", body: JSON.stringify(req)})
36
+ }
24
37
  }
@@ -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
  }