@daocloud-proto/leopard 0.1.0-dev34 → 0.1.0-dev35
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/bill.pb.ts +1 -0
- package/v1alpha1/voucher.pb.ts +93 -0
package/package.json
CHANGED
package/v1alpha1/bill.pb.ts
CHANGED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/*
|
|
4
|
+
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as fm from "../fetch.pb"
|
|
8
|
+
|
|
9
|
+
export enum VoucherStatus {
|
|
10
|
+
Active = "Active",
|
|
11
|
+
UsedUp = "UsedUp",
|
|
12
|
+
Expired = "Expired",
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type BatchCreateVouchersRequest = {
|
|
16
|
+
description?: string
|
|
17
|
+
totalAmount?: string
|
|
18
|
+
effectiveDays?: number
|
|
19
|
+
quantity?: number
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type BatchCreateVouchersResponse = {
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type ListActiveVouchersByCurrentUserRequest = {
|
|
26
|
+
voucherId?: string
|
|
27
|
+
page?: number
|
|
28
|
+
pageSize?: number
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type ListExpiredVouchersByCurrentUserRequest = {
|
|
32
|
+
voucherId?: string
|
|
33
|
+
status?: string
|
|
34
|
+
page?: number
|
|
35
|
+
pageSize?: number
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type ListVouchersResponse = {
|
|
39
|
+
items?: VoucherInfo[]
|
|
40
|
+
pagination?: Pagination
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type Pagination = {
|
|
44
|
+
total?: number
|
|
45
|
+
page?: number
|
|
46
|
+
pageSize?: number
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type VoucherInfo = {
|
|
50
|
+
voucherId?: string
|
|
51
|
+
description?: string
|
|
52
|
+
status?: VoucherStatus
|
|
53
|
+
totalAmount?: string
|
|
54
|
+
remainingAmount?: string
|
|
55
|
+
regions?: string[]
|
|
56
|
+
products?: string[]
|
|
57
|
+
orderTypes?: string[]
|
|
58
|
+
effectTimestamp?: string
|
|
59
|
+
expireTimestamp?: string
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export type ActivateVoucherRequest = {
|
|
63
|
+
voucherId?: string
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type ActivateVoucherResponse = {
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type GetVoucherStatByCurrentUserRequest = {
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export type GetVoucherStatByCurrentUserResponse = {
|
|
73
|
+
amount?: string
|
|
74
|
+
count?: number
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export class Voucher {
|
|
78
|
+
static BatchCreateVouchers(req: BatchCreateVouchersRequest, initReq?: fm.InitReq): Promise<BatchCreateVouchersResponse> {
|
|
79
|
+
return fm.fetchReq<BatchCreateVouchersRequest, BatchCreateVouchersResponse>(`/apis/leopard.io/v1alpha1/vouchers/batch-create`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
80
|
+
}
|
|
81
|
+
static ActivateVoucher(req: ActivateVoucherRequest, initReq?: fm.InitReq): Promise<ActivateVoucherResponse> {
|
|
82
|
+
return fm.fetchReq<ActivateVoucherRequest, ActivateVoucherResponse>(`/apis/leopard.io/v1alpha1/vouchers/activate`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
83
|
+
}
|
|
84
|
+
static ListActiveVouchersByCurrentUser(req: ListActiveVouchersByCurrentUserRequest, initReq?: fm.InitReq): Promise<ListVouchersResponse> {
|
|
85
|
+
return fm.fetchReq<ListActiveVouchersByCurrentUserRequest, ListVouchersResponse>(`/apis/leopard.io/v1alpha1/vouchers/active?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
86
|
+
}
|
|
87
|
+
static ListExpiredVouchersByCurrentUser(req: ListExpiredVouchersByCurrentUserRequest, initReq?: fm.InitReq): Promise<ListVouchersResponse> {
|
|
88
|
+
return fm.fetchReq<ListExpiredVouchersByCurrentUserRequest, ListVouchersResponse>(`/apis/leopard.io/v1alpha1/vouchers/expired?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
89
|
+
}
|
|
90
|
+
static GetVoucherStatByCurrentUser(req: GetVoucherStatByCurrentUserRequest, initReq?: fm.InitReq): Promise<GetVoucherStatByCurrentUserResponse> {
|
|
91
|
+
return fm.fetchReq<GetVoucherStatByCurrentUserRequest, GetVoucherStatByCurrentUserResponse>(`/apis/leopard.io/v1alpha1/vouchers/stat?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
92
|
+
}
|
|
93
|
+
}
|