@daocloud-proto/leopard 0.5.1 → 0.6.0-dev10
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 +12 -0
- package/v1alpha1/order.pb.ts +61 -2
- package/v1alpha1/product.pb.ts +11 -0
- package/v1alpha1/resource.pb.ts +33 -0
- package/v1alpha1/transaction.pb.ts +3 -0
- package/v1alpha1/wallet.pb.ts +39 -0
package/package.json
CHANGED
package/v1alpha1/bill.pb.ts
CHANGED
|
@@ -46,6 +46,7 @@ export type ListBillsRequest = {
|
|
|
46
46
|
resourceId?: string
|
|
47
47
|
billingType?: string
|
|
48
48
|
productName?: string
|
|
49
|
+
username?: string
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
export type ListBillsResponse = {
|
|
@@ -76,6 +77,7 @@ export type bill = {
|
|
|
76
77
|
billingItem?: string
|
|
77
78
|
voucherPayment?: string
|
|
78
79
|
type?: BillType
|
|
80
|
+
userId?: string
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
export type BillingCycle = {
|
|
@@ -113,6 +115,7 @@ export type GetMonthlyBillsRequest = {
|
|
|
113
115
|
|
|
114
116
|
export type GetMonthlyBillsResponse = {
|
|
115
117
|
products?: ProductMonthlyBill[]
|
|
118
|
+
users?: UserMonthlyBill[]
|
|
116
119
|
}
|
|
117
120
|
|
|
118
121
|
export type RegionMonthlyBill = {
|
|
@@ -132,6 +135,15 @@ export type ProductMonthlyBill = {
|
|
|
132
135
|
amountDue?: string
|
|
133
136
|
}
|
|
134
137
|
|
|
138
|
+
export type UserMonthlyBill = {
|
|
139
|
+
billingMonth?: string
|
|
140
|
+
userId?: string
|
|
141
|
+
username?: string
|
|
142
|
+
orderPrice?: string
|
|
143
|
+
voucherPayment?: string
|
|
144
|
+
amountDue?: string
|
|
145
|
+
}
|
|
146
|
+
|
|
135
147
|
export class Bill {
|
|
136
148
|
static ListBills(req: ListBillsRequest, initReq?: fm.InitReq): Promise<ListBillsResponse> {
|
|
137
149
|
return fm.fetchReq<ListBillsRequest, ListBillsResponse>(`/apis/leopard.io/v1alpha1/bills?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
package/v1alpha1/order.pb.ts
CHANGED
|
@@ -11,6 +11,7 @@ export enum OrderType {
|
|
|
11
11
|
REFUND = "REFUND",
|
|
12
12
|
UPGRADE = "UPGRADE",
|
|
13
13
|
DOWNGRADE = "DOWNGRADE",
|
|
14
|
+
TRANSFORM = "TRANSFORM",
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export enum BillingType {
|
|
@@ -64,10 +65,11 @@ export type ListOrdersRequest = {
|
|
|
64
65
|
end?: string
|
|
65
66
|
page?: number
|
|
66
67
|
pageSize?: number
|
|
68
|
+
username?: string
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
export type Orders = {
|
|
70
|
-
|
|
72
|
+
username?: string
|
|
71
73
|
orderId?: string
|
|
72
74
|
createdAtTimestamp?: string
|
|
73
75
|
orderType?: OrderType
|
|
@@ -76,6 +78,7 @@ export type Orders = {
|
|
|
76
78
|
orderStatus?: OrderStatus
|
|
77
79
|
orderPrice?: string
|
|
78
80
|
amountDue?: string
|
|
81
|
+
userId?: string
|
|
79
82
|
}
|
|
80
83
|
|
|
81
84
|
export type ListOrdersResponse = {
|
|
@@ -90,6 +93,8 @@ export type OrderInfo = {
|
|
|
90
93
|
orderStatus?: OrderStatus
|
|
91
94
|
orderPrice?: string
|
|
92
95
|
amountDue?: string
|
|
96
|
+
username?: string
|
|
97
|
+
userId?: string
|
|
93
98
|
}
|
|
94
99
|
|
|
95
100
|
export type Resource = {
|
|
@@ -140,11 +145,14 @@ export type CreateNewPurchaseOrderRequest = {
|
|
|
140
145
|
username?: string
|
|
141
146
|
userId?: string
|
|
142
147
|
orderItems?: OrderItem[]
|
|
148
|
+
renewMeteringAmount?: number
|
|
143
149
|
}
|
|
144
150
|
|
|
145
151
|
export type CreateNewPurchaseOrderResponse = {
|
|
146
152
|
orderId?: string
|
|
147
153
|
createOrderStatus?: CreateOrderStatus
|
|
154
|
+
startTimestamp?: string
|
|
155
|
+
endTimestamp?: string
|
|
148
156
|
}
|
|
149
157
|
|
|
150
158
|
export type CreateQuantityChangeOrderRequest = {
|
|
@@ -158,6 +166,8 @@ export type CreateQuantityChangeOrderRequest = {
|
|
|
158
166
|
export type CreateQuantityChangeOrderResponse = {
|
|
159
167
|
orderId?: string
|
|
160
168
|
createOrderStatus?: CreateOrderStatus
|
|
169
|
+
startTimestamp?: string
|
|
170
|
+
endTimestamp?: string
|
|
161
171
|
}
|
|
162
172
|
|
|
163
173
|
export type IsResourceOrderNextBillBalanceSufficientRequest = {
|
|
@@ -168,7 +178,8 @@ export type IsResourceOrderNextBillBalanceSufficientRequest = {
|
|
|
168
178
|
}
|
|
169
179
|
|
|
170
180
|
export type IsResourceOrderNextBillBalanceSufficientResponse = {
|
|
171
|
-
|
|
181
|
+
balanceSufficient?: boolean
|
|
182
|
+
inventorySufficient?: boolean
|
|
172
183
|
}
|
|
173
184
|
|
|
174
185
|
export type RefundOrderRequest = {
|
|
@@ -186,6 +197,45 @@ export type InvalidateOrderRequest = {
|
|
|
186
197
|
export type InvalidateOrderResponse = {
|
|
187
198
|
}
|
|
188
199
|
|
|
200
|
+
export type CreateTransformOrderRequest = {
|
|
201
|
+
username?: string
|
|
202
|
+
userId?: string
|
|
203
|
+
productName?: string
|
|
204
|
+
resourceId?: string
|
|
205
|
+
skuId?: string
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export type CreateTransformOrderResponse = {
|
|
209
|
+
orderId?: string
|
|
210
|
+
createOrderStatus?: CreateOrderStatus
|
|
211
|
+
startTimestamp?: string
|
|
212
|
+
endTimestamp?: string
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export type CreateRenewOrderRequest = {
|
|
216
|
+
username?: string
|
|
217
|
+
userId?: string
|
|
218
|
+
productName?: string
|
|
219
|
+
resourceId?: string
|
|
220
|
+
skuId?: string
|
|
221
|
+
renewMeteringAmount?: number
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export type CreateRenewOrderResponse = {
|
|
225
|
+
orderId?: string
|
|
226
|
+
createOrderStatus?: CreateOrderStatus
|
|
227
|
+
startTimestamp?: string
|
|
228
|
+
endTimestamp?: string
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export type ChangeOrderRenewRequest = {
|
|
232
|
+
resourceId?: string
|
|
233
|
+
renewMeteringAmount?: number
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export type ChangeOrderRenewResponse = {
|
|
237
|
+
}
|
|
238
|
+
|
|
189
239
|
export class Order {
|
|
190
240
|
static ListOrders(req: ListOrdersRequest, initReq?: fm.InitReq): Promise<ListOrdersResponse> {
|
|
191
241
|
return fm.fetchReq<ListOrdersRequest, ListOrdersResponse>(`/apis/leopard.io/v1alpha1/orders?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
@@ -202,6 +252,15 @@ export class Order {
|
|
|
202
252
|
static CreateQuantityChangeOrder(req: CreateQuantityChangeOrderRequest, initReq?: fm.InitReq): Promise<CreateQuantityChangeOrderResponse> {
|
|
203
253
|
return fm.fetchReq<CreateQuantityChangeOrderRequest, CreateQuantityChangeOrderResponse>(`/apis/leopard.io/v1alpha1/orders/quantity-change`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
204
254
|
}
|
|
255
|
+
static CreateRenewOrder(req: CreateRenewOrderRequest, initReq?: fm.InitReq): Promise<CreateRenewOrderResponse> {
|
|
256
|
+
return fm.fetchReq<CreateRenewOrderRequest, CreateRenewOrderResponse>(`/apis/leopard.io/v1alpha1/orders/renew`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
257
|
+
}
|
|
258
|
+
static CreateTransformOrder(req: CreateTransformOrderRequest, initReq?: fm.InitReq): Promise<CreateTransformOrderResponse> {
|
|
259
|
+
return fm.fetchReq<CreateTransformOrderRequest, CreateTransformOrderResponse>(`/v1alpha1.order.Order/CreateTransformOrder`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
260
|
+
}
|
|
261
|
+
static ChangeOrderRenew(req: ChangeOrderRenewRequest, initReq?: fm.InitReq): Promise<ChangeOrderRenewResponse> {
|
|
262
|
+
return fm.fetchReq<ChangeOrderRenewRequest, ChangeOrderRenewResponse>(`/v1alpha1.order.Order/ChangeOrderRenew`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
263
|
+
}
|
|
205
264
|
static IsResourceOrderNextBillBalanceSufficient(req: IsResourceOrderNextBillBalanceSufficientRequest, initReq?: fm.InitReq): Promise<IsResourceOrderNextBillBalanceSufficientResponse> {
|
|
206
265
|
return fm.fetchReq<IsResourceOrderNextBillBalanceSufficientRequest, IsResourceOrderNextBillBalanceSufficientResponse>(`/apis/leopard.io/v1alpha1/orders/is-resource-balance-sufficient`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
207
266
|
}
|
package/v1alpha1/product.pb.ts
CHANGED
|
@@ -8,6 +8,10 @@ import * as fm from "../fetch.pb"
|
|
|
8
8
|
|
|
9
9
|
export enum BillingType {
|
|
10
10
|
PAY_AS_YOU_GO = "PAY_AS_YOU_GO",
|
|
11
|
+
SUBSCRIPTION_DAILY = "SUBSCRIPTION_DAILY",
|
|
12
|
+
SUBSCRIPTION_WEEKLY = "SUBSCRIPTION_WEEKLY",
|
|
13
|
+
SUBSCRIPTION_MONTHLY = "SUBSCRIPTION_MONTHLY",
|
|
14
|
+
SUBSCRIPTION_YEARLY = "SUBSCRIPTION_YEARLY",
|
|
11
15
|
}
|
|
12
16
|
|
|
13
17
|
export enum UnitType {
|
|
@@ -15,6 +19,11 @@ export enum UnitType {
|
|
|
15
19
|
THOUSAND_TOKENS = "THOUSAND_TOKENS",
|
|
16
20
|
GB_DAY = "GB_DAY",
|
|
17
21
|
INSTANCE_NUMBER = "INSTANCE_NUMBER",
|
|
22
|
+
PICTURE = "PICTURE",
|
|
23
|
+
DAY = "DAY",
|
|
24
|
+
WEEK = "WEEK",
|
|
25
|
+
MONTH = "MONTH",
|
|
26
|
+
YEAR = "YEAR",
|
|
18
27
|
}
|
|
19
28
|
|
|
20
29
|
export enum QuantityUnit {
|
|
@@ -45,6 +54,7 @@ export type ListProductSKUsRequest = {
|
|
|
45
54
|
filterByAnd?: boolean
|
|
46
55
|
sortType?: string
|
|
47
56
|
sortOrder?: SortOrder
|
|
57
|
+
billingType?: string
|
|
48
58
|
}
|
|
49
59
|
|
|
50
60
|
export type SkuItem = {
|
|
@@ -120,6 +130,7 @@ export type ListProductSpecFieldRequest = {
|
|
|
120
130
|
regionId?: string
|
|
121
131
|
specKey?: string
|
|
122
132
|
product?: string
|
|
133
|
+
billingType?: string
|
|
123
134
|
}
|
|
124
135
|
|
|
125
136
|
export type ListProductSpecFieldResponse = {
|
|
@@ -0,0 +1,33 @@
|
|
|
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 PeriodStatus {
|
|
10
|
+
Paid = "Paid",
|
|
11
|
+
NotPaid = "NotPaid",
|
|
12
|
+
Failed = "Failed",
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type GetResourceInfoRequest = {
|
|
16
|
+
resourceId?: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type GetResourceInfoResponse = {
|
|
20
|
+
periods?: ResourcePeriod[]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type ResourcePeriod = {
|
|
24
|
+
startTimestamp?: string
|
|
25
|
+
endTimestamp?: string
|
|
26
|
+
status?: PeriodStatus
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export class Resource {
|
|
30
|
+
static GetResourceInfo(req: GetResourceInfoRequest, initReq?: fm.InitReq): Promise<GetResourceInfoResponse> {
|
|
31
|
+
return fm.fetchReq<GetResourceInfoRequest, GetResourceInfoResponse>(`/v1alpha1.resource.Resource/GetResourceInfo`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -15,6 +15,7 @@ export enum TransactionChannel {
|
|
|
15
15
|
Balance = "Balance",
|
|
16
16
|
Alipay = "Alipay",
|
|
17
17
|
Wechat = "Wechat",
|
|
18
|
+
Corporate_Transfer = "Corporate_Transfer",
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export enum PaymentType {
|
|
@@ -32,6 +33,7 @@ export type ListTransactionsRequest = {
|
|
|
32
33
|
paymentType?: string
|
|
33
34
|
transactionType?: string
|
|
34
35
|
transactionChannel?: string
|
|
36
|
+
username?: string
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
export type ListTransactionsRequestResponse = {
|
|
@@ -55,6 +57,7 @@ export type transaction = {
|
|
|
55
57
|
amount?: string
|
|
56
58
|
billingId?: string
|
|
57
59
|
balance?: string
|
|
60
|
+
userId?: string
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
export class Transaction {
|
package/v1alpha1/wallet.pb.ts
CHANGED
|
@@ -9,6 +9,7 @@ import * as fm from "../fetch.pb"
|
|
|
9
9
|
export enum PaymentChannel {
|
|
10
10
|
ALIPAY = "ALIPAY",
|
|
11
11
|
WECHAT = "WECHAT",
|
|
12
|
+
CORPORATE_TRANSFER = "CORPORATE_TRANSFER",
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
export enum PaymentType {
|
|
@@ -49,6 +50,38 @@ export type GetUserStateRequest = {
|
|
|
49
50
|
|
|
50
51
|
export type GetUserStateResponse = {
|
|
51
52
|
isVerified?: boolean
|
|
53
|
+
isMain?: boolean
|
|
54
|
+
permissions?: string[]
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type ReceivingBankInfo = {
|
|
58
|
+
accountName?: string
|
|
59
|
+
bankAccount?: string
|
|
60
|
+
bankName?: string
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export type GetReceivingBankInfoResponse = {
|
|
64
|
+
bankInfos?: ReceivingBankInfo[]
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export type GetReceivingBankInfoRequest = {
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type PaymentSourceInfo = {
|
|
71
|
+
accountName?: string
|
|
72
|
+
bankAccount?: string
|
|
73
|
+
bankName?: string
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export type CorporateTransferRechargeRequest = {
|
|
77
|
+
userId?: string
|
|
78
|
+
amount?: string
|
|
79
|
+
serialNumber?: string
|
|
80
|
+
message?: string
|
|
81
|
+
paymentSourceInfo?: PaymentSourceInfo
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type CorporateTransferRechargeResponse = {
|
|
52
85
|
}
|
|
53
86
|
|
|
54
87
|
export class Wallet {
|
|
@@ -58,6 +91,12 @@ export class Wallet {
|
|
|
58
91
|
static Recharge(req: RechargeRequest, initReq?: fm.InitReq): Promise<RechargeResponse> {
|
|
59
92
|
return fm.fetchReq<RechargeRequest, RechargeResponse>(`/apis/leopard.io/v1alpha1/wallet/recharge`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
60
93
|
}
|
|
94
|
+
static CorporateTransferRecharge(req: CorporateTransferRechargeRequest, initReq?: fm.InitReq): Promise<CorporateTransferRechargeResponse> {
|
|
95
|
+
return fm.fetchReq<CorporateTransferRechargeRequest, CorporateTransferRechargeResponse>(`/apis/leopard.io/v1alpha1/wallet/corporate-transfer/recharge`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
96
|
+
}
|
|
97
|
+
static GetReceivingBankInfos(req: GetReceivingBankInfoRequest, initReq?: fm.InitReq): Promise<GetReceivingBankInfoResponse> {
|
|
98
|
+
return fm.fetchReq<GetReceivingBankInfoRequest, GetReceivingBankInfoResponse>(`/apis/leopard.io/v1alpha1/wallet/corporate-transfer/receiving-bank-infos?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
99
|
+
}
|
|
61
100
|
static GetUserState(req: GetUserStateRequest, initReq?: fm.InitReq): Promise<GetUserStateResponse> {
|
|
62
101
|
return fm.fetchReq<GetUserStateRequest, GetUserStateResponse>(`/apis/leopard.io/v1alpha1/wallet/user-state?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
63
102
|
}
|