@daocloud-proto/leopard 0.12.0-dev1 → 0.12.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 +1 -1
- package/v1alpha1/voucher.pb.ts +2 -0
- package/v1alpha1/wallet.pb.ts +26 -0
package/package.json
CHANGED
package/v1alpha1/voucher.pb.ts
CHANGED
|
@@ -19,6 +19,7 @@ export type BatchCreateVouchersRequest = {
|
|
|
19
19
|
quantity?: number
|
|
20
20
|
regions?: string[]
|
|
21
21
|
expireTimestamp?: string
|
|
22
|
+
products?: string[]
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
export type BatchCreateVouchersResponse = {
|
|
@@ -85,6 +86,7 @@ export type BatchCreateAndActiveVouchersRequest = {
|
|
|
85
86
|
quantity?: number
|
|
86
87
|
regions?: string[]
|
|
87
88
|
expireTimestamp?: string
|
|
89
|
+
products?: string[]
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
export type BatchCreateAndActiveVouchersResponse = {
|
package/v1alpha1/wallet.pb.ts
CHANGED
|
@@ -216,6 +216,26 @@ export type UpdateBalanceAlertRequest = BaseUpdateBalanceAlertRequest
|
|
|
216
216
|
export type UpdateBalanceAlertResponse = {
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
+
export type RefundRequest = {
|
|
220
|
+
transactionSerialNum?: string
|
|
221
|
+
amount?: string
|
|
222
|
+
reason?: string
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export type RefundResponse = {
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export type GetRefundableAmountRequest = {
|
|
229
|
+
userId?: string
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export type GetRefundableAmountResponse = {
|
|
233
|
+
balance?: string
|
|
234
|
+
frozenBalance?: string
|
|
235
|
+
availableBalance?: string
|
|
236
|
+
refundableBalance?: string
|
|
237
|
+
}
|
|
238
|
+
|
|
219
239
|
export class Wallet {
|
|
220
240
|
static Balance(req: BalanceRequest, initReq?: fm.InitReq): Promise<BalanceResponse> {
|
|
221
241
|
return fm.fetchReq<BalanceRequest, BalanceResponse>(`/apis/leopard.io/v1alpha1/wallet/balance?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
@@ -265,4 +285,10 @@ export class Wallet {
|
|
|
265
285
|
static UpdateBalanceAlert(req: UpdateBalanceAlertRequest, initReq?: fm.InitReq): Promise<UpdateBalanceAlertResponse> {
|
|
266
286
|
return fm.fetchReq<UpdateBalanceAlertRequest, UpdateBalanceAlertResponse>(`/apis/leopard.io/v1alpha1/wallet/balance/alert`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
267
287
|
}
|
|
288
|
+
static Refund(req: RefundRequest, initReq?: fm.InitReq): Promise<RefundResponse> {
|
|
289
|
+
return fm.fetchReq<RefundRequest, RefundResponse>(`/apis/leopard.io/v1alpha1/wallet/refund`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
290
|
+
}
|
|
291
|
+
static GetRefundableAmount(req: GetRefundableAmountRequest, initReq?: fm.InitReq): Promise<GetRefundableAmountResponse> {
|
|
292
|
+
return fm.fetchReq<GetRefundableAmountRequest, GetRefundableAmountResponse>(`/apis/leopard.io/v1alpha1/wallet/refundable-amount/${req["userId"]}?${fm.renderURLSearchParams(req, ["userId"])}`, {...initReq, method: "GET"})
|
|
293
|
+
}
|
|
268
294
|
}
|