@daocloud-proto/leopard 0.15.1-rc1 → 0.16.0-dev1

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/leopard",
3
- "version":"0.15.1-rc1",
3
+ "version":"0.16.0-dev1",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -41,6 +41,27 @@ export type ListCurrentMembersResponse = {
41
41
  pagination?: Pagination
42
42
  }
43
43
 
44
+ export type ListAccountBalancesRequest = {
45
+ search?: string
46
+ sortField?: string
47
+ sortOrder?: string
48
+ page?: number
49
+ pageSize?: number
50
+ }
51
+
52
+ export type ListAccountBalancesResponse = {
53
+ items?: AccountBalance[]
54
+ pagination?: Pagination
55
+ }
56
+
57
+ export type AccountBalance = {
58
+ userId?: string
59
+ username?: string
60
+ cashBalance?: string
61
+ voucherBalance?: string
62
+ totalAmount?: string
63
+ }
64
+
44
65
  export type AccountInfo = {
45
66
  id?: string
46
67
  name?: string
@@ -68,6 +89,9 @@ export class Accounts {
68
89
  static ListSubAccounts(req: ListSubAccountsRequest, initReq?: fm.InitReq): Promise<ListSubAccountsResponse> {
69
90
  return fm.fetchReq<ListSubAccountsRequest, ListSubAccountsResponse>(`/apis/leopard.io/v1alpha1/accounts?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
70
91
  }
92
+ static ListAccountBalances(req: ListAccountBalancesRequest, initReq?: fm.InitReq): Promise<ListAccountBalancesResponse> {
93
+ return fm.fetchReq<ListAccountBalancesRequest, ListAccountBalancesResponse>(`/apis/leopard.io/v1alpha1/accounts/balances?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
94
+ }
71
95
  static GetExportURL(req: GetExportURLRequest, initReq?: fm.InitReq): Promise<GetExportURLResponse> {
72
96
  return fm.fetchReq<GetExportURLRequest, GetExportURLResponse>(`/apis/leopard.io/v1alpha1/export/url?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
73
97
  }
@@ -39,6 +39,13 @@ export type ListExpiredVouchersByCurrentUserRequest = {
39
39
  pageSize?: number
40
40
  }
41
41
 
42
+ export type ListVouchersRequest = {
43
+ voucherId?: string
44
+ status?: string
45
+ page?: number
46
+ pageSize?: number
47
+ }
48
+
42
49
  export type ListVouchersResponse = {
43
50
  items?: VoucherInfo[]
44
51
  pagination?: Pagination
@@ -67,6 +74,11 @@ export type ActivateVoucherRequest = {
67
74
  voucherId?: string
68
75
  }
69
76
 
77
+ export type ActivateVoucherForUserRequest = {
78
+ voucherId?: string
79
+ userId?: string
80
+ }
81
+
70
82
  export type ActivateVoucherResponse = {
71
83
  }
72
84
 
@@ -102,12 +114,18 @@ export class Voucher {
102
114
  static ActivateVoucher(req: ActivateVoucherRequest, initReq?: fm.InitReq): Promise<ActivateVoucherResponse> {
103
115
  return fm.fetchReq<ActivateVoucherRequest, ActivateVoucherResponse>(`/apis/leopard.io/v1alpha1/vouchers/activate`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
104
116
  }
117
+ static ActivateVoucherForUser(req: ActivateVoucherForUserRequest, initReq?: fm.InitReq): Promise<ActivateVoucherResponse> {
118
+ return fm.fetchReq<ActivateVoucherForUserRequest, ActivateVoucherResponse>(`/apis/leopard.io/v1alpha1/vouchers/activate-for-user`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
119
+ }
105
120
  static ListActiveVouchersByCurrentUser(req: ListActiveVouchersByCurrentUserRequest, initReq?: fm.InitReq): Promise<ListVouchersResponse> {
106
121
  return fm.fetchReq<ListActiveVouchersByCurrentUserRequest, ListVouchersResponse>(`/apis/leopard.io/v1alpha1/vouchers/active?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
107
122
  }
108
123
  static ListExpiredVouchersByCurrentUser(req: ListExpiredVouchersByCurrentUserRequest, initReq?: fm.InitReq): Promise<ListVouchersResponse> {
109
124
  return fm.fetchReq<ListExpiredVouchersByCurrentUserRequest, ListVouchersResponse>(`/apis/leopard.io/v1alpha1/vouchers/expired?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
110
125
  }
126
+ static ListVouchers(req: ListVouchersRequest, initReq?: fm.InitReq): Promise<ListVouchersResponse> {
127
+ return fm.fetchReq<ListVouchersRequest, ListVouchersResponse>(`/apis/leopard.io/v1alpha1/vouchers?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
128
+ }
111
129
  static GetVoucherStatByCurrentUser(req: GetVoucherStatByCurrentUserRequest, initReq?: fm.InitReq): Promise<GetVoucherStatByCurrentUserResponse> {
112
130
  return fm.fetchReq<GetVoucherStatByCurrentUserRequest, GetVoucherStatByCurrentUserResponse>(`/apis/leopard.io/v1alpha1/vouchers/stat?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
113
131
  }