@daocloud-proto/ghippo 0.42.0-dev1 → 0.42.0-dev3

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.42.0-dev1",
3
+ "version":"0.42.0-dev3",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -183,6 +183,19 @@ export type SSHKey = {
183
183
  expiredAt?: string
184
184
  }
185
185
 
186
+ export type CheckSubAccountRequest = {
187
+ accountId?: string
188
+ accountName?: string
189
+ }
190
+
191
+ export type CheckSubAccountResponse = {
192
+ isSubAccount?: boolean
193
+ }
194
+
195
+ export type GetSubAccountByUsernameRequest = {
196
+ username?: string
197
+ }
198
+
186
199
  export class Accounts {
187
200
  static TransferToMainAccount(req: TransferToMainAccountRequest, initReq?: fm.InitReq): Promise<TransferToMainAccountResponse> {
188
201
  return fm.fetchReq<TransferToMainAccountRequest, TransferToMainAccountResponse>(`/apis/ghippo.io/v1alpha1/accounts/transfer-main`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
@@ -190,6 +203,12 @@ export class Accounts {
190
203
  static ListSubAccounts(req: ListSubAccountsRequest, initReq?: fm.InitReq): Promise<ListSubAccountsResponse> {
191
204
  return fm.fetchReq<ListSubAccountsRequest, ListSubAccountsResponse>(`/apis/ghippo.io/v1alpha1/sub-accounts?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
192
205
  }
206
+ static CheckSubAccount(req: CheckSubAccountRequest, initReq?: fm.InitReq): Promise<CheckSubAccountResponse> {
207
+ return fm.fetchReq<CheckSubAccountRequest, CheckSubAccountResponse>(`/v1alpha1.account.Accounts/CheckSubAccount`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
208
+ }
209
+ static GetSubAccountByUsername(req: GetSubAccountByUsernameRequest, initReq?: fm.InitReq): Promise<GetSubAccountResponse> {
210
+ return fm.fetchReq<GetSubAccountByUsernameRequest, GetSubAccountResponse>(`/v1alpha1.account.Accounts/GetSubAccountByUsername`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
211
+ }
193
212
  static GetSubAccount(req: GetSubAccountRequest, initReq?: fm.InitReq): Promise<GetSubAccountResponse> {
194
213
  return fm.fetchReq<GetSubAccountRequest, GetSubAccountResponse>(`/apis/ghippo.io/v1alpha1/sub-accounts/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
195
214
  }
@@ -66,6 +66,14 @@ export enum CertifyType {
66
66
  WeChat = "WeChat",
67
67
  }
68
68
 
69
+ export type UpdateUserFirstAndLastNameRequest = {
70
+ firstname?: string
71
+ lastname?: string
72
+ }
73
+
74
+ export type UpdateUserFirstAndLastNameResponse = {
75
+ }
76
+
69
77
  export type UpdateEmailRequest = {
70
78
  email?: string
71
79
  }
@@ -101,6 +109,11 @@ export type GetUserResponse = {
101
109
  hasCertified?: boolean
102
110
  isMainAccount?: boolean
103
111
  isSubAccount?: boolean
112
+ firstname?: string
113
+ lastname?: string
114
+ mainAccountId?: string
115
+ mainAccountName?: string
116
+ mainAccountWorkspace?: string
104
117
  }
105
118
 
106
119
  export type ListAccessTokensRequest = {
@@ -248,6 +261,9 @@ export class Account {
248
261
  static UpdateLanguage(req: UpdateLanguageRequest, initReq?: fm.InitReq): Promise<UpdateLanguageResponse> {
249
262
  return fm.fetchReq<UpdateLanguageRequest, UpdateLanguageResponse>(`/apis/ghippo.io/v1alpha1/current-user/language`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
250
263
  }
264
+ static UpdateUserFirstAndLastName(req: UpdateUserFirstAndLastNameRequest, initReq?: fm.InitReq): Promise<UpdateUserFirstAndLastNameResponse> {
265
+ return fm.fetchReq<UpdateUserFirstAndLastNameRequest, UpdateUserFirstAndLastNameResponse>(`/apis/ghippo.io/v1alpha1/current-user/name`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
266
+ }
251
267
  static GetUser(req: GetUserRequest, initReq?: fm.InitReq): Promise<GetUserResponse> {
252
268
  return fm.fetchReq<GetUserRequest, GetUserResponse>(`/apis/ghippo.io/v1alpha1/current-user?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
253
269
  }