@daocloud-proto/leopard 0.10.0-rc4 → 0.11.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.10.0-rc4",
3
+ "version":"0.11.0-dev1",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -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,7 @@ export type BalanceRequest = {
70
79
  export type BalanceResponse = {
71
80
  balance?: string
72
81
  isVirtual?: boolean
82
+ alertsEnabled?: boolean
73
83
  }
74
84
 
75
85
  export type RechargeRequest = {
@@ -186,6 +196,25 @@ export type DeleteVirtualWalletRequest = {
186
196
  export type DeleteVirtualWalletResponse = {
187
197
  }
188
198
 
199
+ export type GetBalanceAlertRequest = {
200
+ }
201
+
202
+ export type GetBalanceAlertResponse = {
203
+ enabled?: boolean
204
+ threshold?: string
205
+ }
206
+
207
+
208
+ type BaseUpdateBalanceAlertRequest = {
209
+ threshold?: string
210
+ }
211
+
212
+ export type UpdateBalanceAlertRequest = BaseUpdateBalanceAlertRequest
213
+ & OneOf<{ enabled: boolean }>
214
+
215
+ export type UpdateBalanceAlertResponse = {
216
+ }
217
+
189
218
  export class Wallet {
190
219
  static Balance(req: BalanceRequest, initReq?: fm.InitReq): Promise<BalanceResponse> {
191
220
  return fm.fetchReq<BalanceRequest, BalanceResponse>(`/apis/leopard.io/v1alpha1/wallet/balance?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
@@ -229,4 +258,10 @@ export class Wallet {
229
258
  static ListDomainReceivingBankInfos(req: ListDomainReceivingBankInfosRequest, initReq?: fm.InitReq): Promise<ListDomainReceivingBankInfosResponse> {
230
259
  return fm.fetchReq<ListDomainReceivingBankInfosRequest, ListDomainReceivingBankInfosResponse>(`/apis/leopard.io/v1alpha1/wallet/domain-receiving-bank-infos?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
231
260
  }
261
+ static GetBalanceAlert(req: GetBalanceAlertRequest, initReq?: fm.InitReq): Promise<GetBalanceAlertResponse> {
262
+ return fm.fetchReq<GetBalanceAlertRequest, GetBalanceAlertResponse>(`/apis/leopard.io/v1alpha1/wallet/balance/alert?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
263
+ }
264
+ static UpdateBalanceAlert(req: UpdateBalanceAlertRequest, initReq?: fm.InitReq): Promise<UpdateBalanceAlertResponse> {
265
+ return fm.fetchReq<UpdateBalanceAlertRequest, UpdateBalanceAlertResponse>(`/apis/leopard.io/v1alpha1/wallet/balance/alert`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
266
+ }
232
267
  }