@daocloud-proto/ghippo 0.2.3 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
- "name": "@daocloud-proto/ghippo",
3
- "version": "v0.2.3",
4
- "description": "",
5
- "author": "",
6
- "license": "ISC"
7
- }
2
+ "name": "@daocloud-proto/ghippo",
3
+ "version": "v0.3.0",
4
+ "description": "",
5
+ "author": "",
6
+ "license": "ISC"
7
+ }
@@ -0,0 +1,39 @@
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 UpdateEmailRequest = {
9
+ email?: string
10
+ }
11
+
12
+ export type UpdateEmailResponse = {
13
+ }
14
+
15
+ export type UpdatePasswordRequest = {
16
+ password?: string
17
+ }
18
+
19
+ export type UpdatePasswordResponse = {
20
+ }
21
+
22
+ export type UpdateLanguageRequest = {
23
+ locale?: string
24
+ }
25
+
26
+ export type UpdateLanguageResponse = {
27
+ }
28
+
29
+ export class Account {
30
+ static UpdateEmail(req: UpdateEmailRequest, initReq?: fm.InitReq): Promise<UpdateEmailResponse> {
31
+ return fm.fetchReq<UpdateEmailRequest, UpdateEmailResponse>(`/apis/ghippo.io/v1alpha1/account/email`, {...initReq, method: "PUT", body: JSON.stringify(req)})
32
+ }
33
+ static UpdatePassword(req: UpdatePasswordRequest, initReq?: fm.InitReq): Promise<UpdatePasswordResponse> {
34
+ return fm.fetchReq<UpdatePasswordRequest, UpdatePasswordResponse>(`/apis/ghippo.io/v1alpha1/account/password`, {...initReq, method: "PUT", body: JSON.stringify(req)})
35
+ }
36
+ static UpdateLanguage(req: UpdateLanguageRequest, initReq?: fm.InitReq): Promise<UpdateLanguageResponse> {
37
+ return fm.fetchReq<UpdateLanguageRequest, UpdateLanguageResponse>(`/apis/ghippo.io/v1alpha1/account/language`, {...initReq, method: "PUT", body: JSON.stringify(req)})
38
+ }
39
+ }
@@ -0,0 +1,116 @@
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 CreateGroupRequest = {
9
+ name?: string
10
+ description?: string
11
+ }
12
+
13
+ export type CreateGroupResponse = {
14
+ }
15
+
16
+ export type ListGroupsRequest = {
17
+ search?: string
18
+ offset?: number
19
+ size?: number
20
+ }
21
+
22
+ export type ListGroupsResponse = {
23
+ total?: string
24
+ groups?: GroupInfo[]
25
+ }
26
+
27
+ export type GroupInfo = {
28
+ id?: string
29
+ name?: string
30
+ user_count?: string
31
+ description?: string
32
+ created_at?: string
33
+ }
34
+
35
+ export type GroupRequest = {
36
+ id?: string
37
+ }
38
+
39
+ export type GetGroupResponse = {
40
+ group?: GroupInfo
41
+ }
42
+
43
+ export type DeleteGroupResponse = {
44
+ }
45
+
46
+ export type GroupMembersRequest = {
47
+ id?: string
48
+ search?: string
49
+ offset?: number
50
+ size?: number
51
+ }
52
+
53
+ export type GroupMembersResponse = {
54
+ total?: string
55
+ user?: User[]
56
+ }
57
+
58
+ export type User = {
59
+ id?: string
60
+ name?: string
61
+ email?: string
62
+ description?: string
63
+ created_at?: string
64
+ updated_at?: string
65
+ }
66
+
67
+ export type AddUserToGroupRequest = {
68
+ id?: string
69
+ user_id?: string
70
+ }
71
+
72
+ export type AddUserToGroupResponse = {
73
+ }
74
+
75
+ export type DeleteUserFromGroupRequest = {
76
+ id?: string
77
+ user_id?: string
78
+ }
79
+
80
+ export type DeleteUserFromGroupResponse = {
81
+ }
82
+
83
+ export type UpdateGroupRequest = {
84
+ id?: string
85
+ description?: string
86
+ }
87
+
88
+ export type UpdateGroupResponse = {
89
+ }
90
+
91
+ export class Group {
92
+ static CreateGroup(req: CreateGroupRequest, initReq?: fm.InitReq): Promise<CreateGroupResponse> {
93
+ return fm.fetchReq<CreateGroupRequest, CreateGroupResponse>(`/apis/ghippo.io/v1alpha1/groups`, {...initReq, method: "POST", body: JSON.stringify(req)})
94
+ }
95
+ static ListGroups(req: ListGroupsRequest, initReq?: fm.InitReq): Promise<ListGroupsResponse> {
96
+ return fm.fetchReq<ListGroupsRequest, ListGroupsResponse>(`/apis/ghippo.io/v1alpha1/groups?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
97
+ }
98
+ static GetGroup(req: GroupRequest, initReq?: fm.InitReq): Promise<GetGroupResponse> {
99
+ return fm.fetchReq<GroupRequest, GetGroupResponse>(`/apis/ghippo.io/v1alpha1/groups/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
100
+ }
101
+ static DeleteGroup(req: GroupRequest, initReq?: fm.InitReq): Promise<DeleteGroupResponse> {
102
+ return fm.fetchReq<GroupRequest, DeleteGroupResponse>(`/apis/ghippo.io/v1alpha1/groups/${req["id"]}`, {...initReq, method: "DELETE"})
103
+ }
104
+ static UpdateGroup(req: UpdateGroupRequest, initReq?: fm.InitReq): Promise<UpdateGroupResponse> {
105
+ return fm.fetchReq<UpdateGroupRequest, UpdateGroupResponse>(`/apis/ghippo.io/v1alpha1/groups/${req["id"]}`, {...initReq, method: "PUT", body: JSON.stringify(req)})
106
+ }
107
+ static GroupMembers(req: GroupMembersRequest, initReq?: fm.InitReq): Promise<GroupMembersResponse> {
108
+ return fm.fetchReq<GroupMembersRequest, GroupMembersResponse>(`/apis/ghippo.io/v1alpha1/groups/${req["id"]}/members?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
109
+ }
110
+ static AddUserToGroup(req: AddUserToGroupRequest, initReq?: fm.InitReq): Promise<AddUserToGroupResponse> {
111
+ return fm.fetchReq<AddUserToGroupRequest, AddUserToGroupResponse>(`/apis/ghippo.io/v1alpha1/groups/${req["id"]}/members/${req["user_id"]}`, {...initReq, method: "POST"})
112
+ }
113
+ static DeleteUserFromGroup(req: DeleteUserFromGroupRequest, initReq?: fm.InitReq): Promise<DeleteUserFromGroupResponse> {
114
+ return fm.fetchReq<DeleteUserFromGroupRequest, DeleteUserFromGroupResponse>(`/apis/ghippo.io/v1alpha1/groups/${req["id"]}/members/${req["user_id"]}`, {...initReq, method: "DELETE"})
115
+ }
116
+ }
@@ -5,33 +5,103 @@
5
5
  */
6
6
 
7
7
  import * as fm from "../fetch.pb"
8
- export type GetUsersRequest = {
8
+ export type ListUsersRequest = {
9
9
  search?: string
10
- page_size?: number
11
- page_no?: number
10
+ size?: number
11
+ offset?: number
12
12
  }
13
13
 
14
- export type GetUsersResponse = {
14
+ export type ListUsersResponse = {
15
15
  total?: string
16
- data?: User[]
16
+ data?: GetUserResponse[]
17
17
  }
18
18
 
19
- export type User = {
19
+ export type GetUserRequest = {
20
+ id?: string
21
+ }
22
+
23
+ export type GetUserResponse = {
20
24
  id?: string
21
25
  name?: string
26
+ email?: string
27
+ description?: string
28
+ enabled?: boolean
22
29
  created_at?: string
23
30
  updated_at?: string
24
31
  }
25
32
 
26
- export type GetUserRequest = {
33
+ export type CreateUserRequest = {
34
+ name?: string
35
+ password?: string
36
+ description?: string
37
+ }
38
+
39
+ export type CreateUserResponse = {
40
+ id?: string
41
+ }
42
+
43
+ export type DeleteUserRequest = {
44
+ id?: string
45
+ }
46
+
47
+ export type DeleteUserResponse = {
48
+ }
49
+
50
+ export type UpdateUserRequest = {
27
51
  id?: string
52
+ enabled?: boolean
53
+ email?: string
54
+ description?: string
55
+ }
56
+
57
+ export type UpdateUserResponse = {
58
+ }
59
+
60
+ export type SetUserPasswordRequest = {
61
+ id?: string
62
+ password?: string
63
+ }
64
+
65
+ export type SetUserPasswordResponse = {
66
+ }
67
+
68
+ export type Group = {
69
+ id?: string
70
+ name?: string
71
+ }
72
+
73
+ export type ListUserGroupsRequest = {
74
+ id?: string
75
+ search?: string
76
+ offset?: number
77
+ size?: number
78
+ }
79
+
80
+ export type ListUserGroupsResponse = {
81
+ total?: string
82
+ data?: Group[]
28
83
  }
29
84
 
30
85
  export class Users {
31
- static GetUsers(req: GetUsersRequest, initReq?: fm.InitReq): Promise<GetUsersResponse> {
32
- return fm.fetchReq<GetUsersRequest, GetUsersResponse>(`/apis/ghippo.io/v1alpha1/users?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
86
+ static ListUsers(req: ListUsersRequest, initReq?: fm.InitReq): Promise<ListUsersResponse> {
87
+ return fm.fetchReq<ListUsersRequest, ListUsersResponse>(`/apis/ghippo.io/v1alpha1/users?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
88
+ }
89
+ static GetUser(req: GetUserRequest, initReq?: fm.InitReq): Promise<GetUserResponse> {
90
+ return fm.fetchReq<GetUserRequest, GetUserResponse>(`/apis/ghippo.io/v1alpha1/users/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
91
+ }
92
+ static CreateUser(req: CreateUserRequest, initReq?: fm.InitReq): Promise<CreateUserResponse> {
93
+ return fm.fetchReq<CreateUserRequest, CreateUserResponse>(`/apis/ghippo.io/v1alpha1/users`, {...initReq, method: "POST", body: JSON.stringify(req)})
94
+ }
95
+ static DeleteUser(req: DeleteUserRequest, initReq?: fm.InitReq): Promise<DeleteUserResponse> {
96
+ return fm.fetchReq<DeleteUserRequest, DeleteUserResponse>(`/apis/ghippo.io/v1alpha1/users/${req["id"]}`, {...initReq, method: "DELETE"})
97
+ }
98
+ static UpdateUser(req: UpdateUserRequest, initReq?: fm.InitReq): Promise<UpdateUserResponse> {
99
+ return fm.fetchReq<UpdateUserRequest, UpdateUserResponse>(`/apis/ghippo.io/v1alpha1/users/${req["id"]}`, {...initReq, method: "PUT", body: JSON.stringify(req)})
100
+ }
101
+ static SetUserPassword(req: SetUserPasswordRequest, initReq?: fm.InitReq): Promise<SetUserPasswordResponse> {
102
+ return fm.fetchReq<SetUserPasswordRequest, SetUserPasswordResponse>(`/apis/ghippo.io/v1alpha1/users/${req["id"]}/password`, {...initReq, method: "PUT", body: JSON.stringify(req)})
33
103
  }
34
- static GetUser(req: GetUserRequest, initReq?: fm.InitReq): Promise<User> {
35
- return fm.fetchReq<GetUserRequest, User>(`/apis/ghippo.io/v1alpha1/users/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
104
+ static ListUserGroups(req: ListUserGroupsRequest, initReq?: fm.InitReq): Promise<ListUserGroupsResponse> {
105
+ return fm.fetchReq<ListUserGroupsRequest, ListUserGroupsResponse>(`/apis/ghippo.io/v1alpha1/users/${req["id"]}/groups?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
36
106
  }
37
107
  }
@@ -0,0 +1,34 @@
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 CreateGroupRequest = {
9
+ name?: string
10
+ }
11
+
12
+ export type CreateGroupResponse = {
13
+ }
14
+
15
+ export type GetGroupRequest = {
16
+ search?: string
17
+ offset?: number
18
+ size?: number
19
+ }
20
+
21
+ export type GetGroupResponse = {
22
+ }
23
+
24
+ export type Group = {
25
+ }
26
+
27
+ export class UserGroup {
28
+ static CreateGroup(req: CreateGroupRequest, initReq?: fm.InitReq): Promise<CreateGroupResponse> {
29
+ return fm.fetchReq<CreateGroupRequest, CreateGroupResponse>(`/apis/ghippo.io/v1alpha1/groups`, {...initReq, method: "POST"})
30
+ }
31
+ static GetGroups(req: GetGroupRequest, initReq?: fm.InitReq): Promise<GetGroupResponse> {
32
+ return fm.fetchReq<GetGroupRequest, GetGroupResponse>(`/apis/ghippo.io/v1alpha1/groups?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
33
+ }
34
+ }