@daocloud-proto/leopard 0.10.1 → 0.11.0-rc1
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 +1 -1
- package/v1alpha1/wallet.pb.ts +36 -0
package/package.json
CHANGED
package/v1alpha1/wallet.pb.ts
CHANGED
|
@@ -6,6 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
import * as fm from "../fetch.pb"
|
|
8
8
|
|
|
9
|
+
type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
|
|
10
|
+
type OneOf<T> =
|
|
11
|
+
| { [k in keyof T]?: undefined }
|
|
12
|
+
| (
|
|
13
|
+
keyof T extends infer K ?
|
|
14
|
+
(K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
|
|
15
|
+
: never)
|
|
16
|
+
: never);
|
|
17
|
+
|
|
9
18
|
export enum PaymentChannel {
|
|
10
19
|
ALIPAY = "ALIPAY",
|
|
11
20
|
WECHAT = "WECHAT",
|
|
@@ -70,6 +79,8 @@ export type BalanceRequest = {
|
|
|
70
79
|
export type BalanceResponse = {
|
|
71
80
|
balance?: string
|
|
72
81
|
isVirtual?: boolean
|
|
82
|
+
alertsEnabled?: boolean
|
|
83
|
+
mainAccountInArrears?: boolean
|
|
73
84
|
}
|
|
74
85
|
|
|
75
86
|
export type RechargeRequest = {
|
|
@@ -186,6 +197,25 @@ export type DeleteVirtualWalletRequest = {
|
|
|
186
197
|
export type DeleteVirtualWalletResponse = {
|
|
187
198
|
}
|
|
188
199
|
|
|
200
|
+
export type GetBalanceAlertRequest = {
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export type GetBalanceAlertResponse = {
|
|
204
|
+
enabled?: boolean
|
|
205
|
+
threshold?: string
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
type BaseUpdateBalanceAlertRequest = {
|
|
210
|
+
threshold?: string
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export type UpdateBalanceAlertRequest = BaseUpdateBalanceAlertRequest
|
|
214
|
+
& OneOf<{ enabled: boolean }>
|
|
215
|
+
|
|
216
|
+
export type UpdateBalanceAlertResponse = {
|
|
217
|
+
}
|
|
218
|
+
|
|
189
219
|
export class Wallet {
|
|
190
220
|
static Balance(req: BalanceRequest, initReq?: fm.InitReq): Promise<BalanceResponse> {
|
|
191
221
|
return fm.fetchReq<BalanceRequest, BalanceResponse>(`/apis/leopard.io/v1alpha1/wallet/balance?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
@@ -229,4 +259,10 @@ export class Wallet {
|
|
|
229
259
|
static ListDomainReceivingBankInfos(req: ListDomainReceivingBankInfosRequest, initReq?: fm.InitReq): Promise<ListDomainReceivingBankInfosResponse> {
|
|
230
260
|
return fm.fetchReq<ListDomainReceivingBankInfosRequest, ListDomainReceivingBankInfosResponse>(`/apis/leopard.io/v1alpha1/wallet/domain-receiving-bank-infos?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
231
261
|
}
|
|
262
|
+
static GetBalanceAlert(req: GetBalanceAlertRequest, initReq?: fm.InitReq): Promise<GetBalanceAlertResponse> {
|
|
263
|
+
return fm.fetchReq<GetBalanceAlertRequest, GetBalanceAlertResponse>(`/apis/leopard.io/v1alpha1/wallet/balance/alert?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
264
|
+
}
|
|
265
|
+
static UpdateBalanceAlert(req: UpdateBalanceAlertRequest, initReq?: fm.InitReq): Promise<UpdateBalanceAlertResponse> {
|
|
266
|
+
return fm.fetchReq<UpdateBalanceAlertRequest, UpdateBalanceAlertResponse>(`/apis/leopard.io/v1alpha1/wallet/balance/alert`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
267
|
+
}
|
|
232
268
|
}
|