@daocloud-proto/ghippo 0.3.0 → 0.4.1

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": "v0.3.0",
3
+ "version":"0.4.1",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -26,14 +26,27 @@ export type UpdateLanguageRequest = {
26
26
  export type UpdateLanguageResponse = {
27
27
  }
28
28
 
29
+ export type GetUserRequest = {
30
+ }
31
+
32
+ export type GetUserResponse = {
33
+ uid?: string
34
+ username?: string
35
+ email?: string
36
+ locale?: string
37
+ }
38
+
29
39
  export class Account {
30
40
  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)})
41
+ return fm.fetchReq<UpdateEmailRequest, UpdateEmailResponse>(`/apis/ghippo.io/v1alpha1/current-user/email`, {...initReq, method: "PUT", body: JSON.stringify(req)})
32
42
  }
33
43
  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)})
44
+ return fm.fetchReq<UpdatePasswordRequest, UpdatePasswordResponse>(`/apis/ghippo.io/v1alpha1/current-user/password`, {...initReq, method: "PUT", body: JSON.stringify(req)})
35
45
  }
36
46
  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)})
47
+ return fm.fetchReq<UpdateLanguageRequest, UpdateLanguageResponse>(`/apis/ghippo.io/v1alpha1/current-user/language`, {...initReq, method: "PUT", body: JSON.stringify(req)})
48
+ }
49
+ static GetUser(req: GetUserRequest, initReq?: fm.InitReq): Promise<GetUserResponse> {
50
+ return fm.fetchReq<GetUserRequest, GetUserResponse>(`/apis/ghippo.io/v1alpha1/current-user?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
38
51
  }
39
52
  }
@@ -0,0 +1,26 @@
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 ListGProductsRequest = {
9
+ }
10
+
11
+ export type ListGProductsResponse = {
12
+ data?: GProduct[]
13
+ }
14
+
15
+ export type GProduct = {
16
+ id?: string
17
+ title?: string
18
+ url?: string
19
+ ui_assets_url?: string
20
+ }
21
+
22
+ export class GProducts {
23
+ static ListGProducts(req: ListGProductsRequest, initReq?: fm.InitReq): Promise<ListGProductsResponse> {
24
+ return fm.fetchReq<ListGProductsRequest, ListGProductsResponse>(`/apis/ghippo.io/v1alpha1/gproducts?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
25
+ }
26
+ }
@@ -1,34 +0,0 @@
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
- }