@daocloud-proto/leopard 0.14.0 → 0.15.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 +1 -1
- package/v1alpha1/bill.pb.ts +19 -0
- package/v1alpha1/operation.pb.ts +93 -0
- package/v1alpha1/product.pb.ts +26 -0
package/package.json
CHANGED
package/v1alpha1/bill.pb.ts
CHANGED
|
@@ -120,6 +120,9 @@ export type bill = {
|
|
|
120
120
|
voucherPayment?: string
|
|
121
121
|
type?: BillType
|
|
122
122
|
userId?: string
|
|
123
|
+
discountPrice?: string
|
|
124
|
+
discountRuleId?: string
|
|
125
|
+
discountRate?: string
|
|
123
126
|
}
|
|
124
127
|
|
|
125
128
|
export type BillingCycle = {
|
|
@@ -187,6 +190,19 @@ export type UserMonthlyBill = {
|
|
|
187
190
|
amountDue?: string
|
|
188
191
|
}
|
|
189
192
|
|
|
193
|
+
export type CalculateCountUsageBillRequest = {
|
|
194
|
+
userId?: string
|
|
195
|
+
sku?: string
|
|
196
|
+
count?: number
|
|
197
|
+
startTime?: string
|
|
198
|
+
endTime?: string
|
|
199
|
+
domain?: string
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export type CalculateCountUsageBillResponse = {
|
|
203
|
+
price?: string
|
|
204
|
+
}
|
|
205
|
+
|
|
190
206
|
export class Bill {
|
|
191
207
|
static ListBills(req: ListBillsRequest, initReq?: fm.InitReq): Promise<ListBillsResponse> {
|
|
192
208
|
return fm.fetchReq<ListBillsRequest, ListBillsResponse>(`/apis/leopard.io/v1alpha1/bills?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
@@ -206,4 +222,7 @@ export class Bill {
|
|
|
206
222
|
static ExportMonthlyBills(req: ExportMonthlyBillsReportRequest, initReq?: fm.InitReq): Promise<GoogleApiHttpbody.HttpBody> {
|
|
207
223
|
return fm.fetchReq<ExportMonthlyBillsReportRequest, GoogleApiHttpbody.HttpBody>(`/apis/leopard.io/v1alpha1/export/bills/monthly?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
208
224
|
}
|
|
225
|
+
static CalculateCountUsageBill(req: CalculateCountUsageBillRequest, initReq?: fm.InitReq): Promise<CalculateCountUsageBillResponse> {
|
|
226
|
+
return fm.fetchReq<CalculateCountUsageBillRequest, CalculateCountUsageBillResponse>(`/v1alpha1.bill.Bill/CalculateCountUsageBill`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
227
|
+
}
|
|
209
228
|
}
|
package/v1alpha1/operation.pb.ts
CHANGED
|
@@ -5,6 +5,84 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as fm from "../fetch.pb"
|
|
8
|
+
|
|
9
|
+
export enum AccountDiscountRuleStatus {
|
|
10
|
+
ACCOUNT_DISCOUNT_RULE_STATUS_UNSPECIFIED = "ACCOUNT_DISCOUNT_RULE_STATUS_UNSPECIFIED",
|
|
11
|
+
ACCOUNT_DISCOUNT_RULE_STATUS_DISABLED = "ACCOUNT_DISCOUNT_RULE_STATUS_DISABLED",
|
|
12
|
+
ACCOUNT_DISCOUNT_RULE_STATUS_ENABLED = "ACCOUNT_DISCOUNT_RULE_STATUS_ENABLED",
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export enum DiscountScheduleType {
|
|
16
|
+
DISCOUNT_SCHEDULE_TYPE_UNSPECIFIED = "DISCOUNT_SCHEDULE_TYPE_UNSPECIFIED",
|
|
17
|
+
DISCOUNT_SCHEDULE_TYPE_ABSOLUTE = "DISCOUNT_SCHEDULE_TYPE_ABSOLUTE",
|
|
18
|
+
DISCOUNT_SCHEDULE_TYPE_DAILY = "DISCOUNT_SCHEDULE_TYPE_DAILY",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type AccountDiscountSchedule = {
|
|
22
|
+
type?: DiscountScheduleType
|
|
23
|
+
effectiveStartAt?: string
|
|
24
|
+
effectiveEndAt?: string
|
|
25
|
+
dailyStartMinute?: number
|
|
26
|
+
dailyEndMinute?: number
|
|
27
|
+
timezone?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type AccountDiscountRule = {
|
|
31
|
+
id?: string
|
|
32
|
+
name?: string
|
|
33
|
+
status?: AccountDiscountRuleStatus
|
|
34
|
+
discountRate?: number
|
|
35
|
+
mainAccountId?: string
|
|
36
|
+
mainAccountName?: string
|
|
37
|
+
skuId?: string
|
|
38
|
+
schedule?: AccountDiscountSchedule
|
|
39
|
+
createdBy?: string
|
|
40
|
+
updatedBy?: string
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type CreateAccountDiscountRuleRequest = {
|
|
44
|
+
name?: string
|
|
45
|
+
discountRate?: number
|
|
46
|
+
mainAccountId?: string
|
|
47
|
+
skuId?: string
|
|
48
|
+
schedule?: AccountDiscountSchedule
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type GetAccountDiscountRuleRequest = {
|
|
52
|
+
id?: string
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type ListAccountDiscountRulesRequest = {
|
|
56
|
+
name?: string
|
|
57
|
+
status?: string
|
|
58
|
+
mainAccountIds?: string[]
|
|
59
|
+
skuIds?: string[]
|
|
60
|
+
page?: number
|
|
61
|
+
pageSize?: number
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export type ListAccountDiscountRulesResponse = {
|
|
65
|
+
items?: AccountDiscountRule[]
|
|
66
|
+
pagination?: Pagination
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type UpdateAccountDiscountRuleRequest = {
|
|
70
|
+
id?: string
|
|
71
|
+
name?: string
|
|
72
|
+
discountRate?: number
|
|
73
|
+
mainAccountId?: string
|
|
74
|
+
skuId?: string
|
|
75
|
+
schedule?: AccountDiscountSchedule
|
|
76
|
+
status?: AccountDiscountRuleStatus
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type DeleteAccountDiscountRuleRequest = {
|
|
80
|
+
id?: string
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type DeleteAccountDiscountRuleResponse = {
|
|
84
|
+
}
|
|
85
|
+
|
|
8
86
|
export type ListAccountsRequest = {
|
|
9
87
|
search?: string
|
|
10
88
|
page?: number
|
|
@@ -41,4 +119,19 @@ export class Operations {
|
|
|
41
119
|
static ListAccounts(req: ListAccountsRequest, initReq?: fm.InitReq): Promise<ListAccountsResponse> {
|
|
42
120
|
return fm.fetchReq<ListAccountsRequest, ListAccountsResponse>(`/apis/leopard.io/v1alpha1/operations/accounts?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
43
121
|
}
|
|
122
|
+
static CreateAccountDiscountRule(req: CreateAccountDiscountRuleRequest, initReq?: fm.InitReq): Promise<AccountDiscountRule> {
|
|
123
|
+
return fm.fetchReq<CreateAccountDiscountRuleRequest, AccountDiscountRule>(`/apis/leopard.io/v1alpha1/operations/discount-rules`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
124
|
+
}
|
|
125
|
+
static GetAccountDiscountRule(req: GetAccountDiscountRuleRequest, initReq?: fm.InitReq): Promise<AccountDiscountRule> {
|
|
126
|
+
return fm.fetchReq<GetAccountDiscountRuleRequest, AccountDiscountRule>(`/apis/leopard.io/v1alpha1/operations/discount-rules/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
|
|
127
|
+
}
|
|
128
|
+
static ListAccountDiscountRules(req: ListAccountDiscountRulesRequest, initReq?: fm.InitReq): Promise<ListAccountDiscountRulesResponse> {
|
|
129
|
+
return fm.fetchReq<ListAccountDiscountRulesRequest, ListAccountDiscountRulesResponse>(`/apis/leopard.io/v1alpha1/operations/discount-rules?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
130
|
+
}
|
|
131
|
+
static UpdateAccountDiscountRule(req: UpdateAccountDiscountRuleRequest, initReq?: fm.InitReq): Promise<AccountDiscountRule> {
|
|
132
|
+
return fm.fetchReq<UpdateAccountDiscountRuleRequest, AccountDiscountRule>(`/apis/leopard.io/v1alpha1/operations/discount-rules/${req["id"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
133
|
+
}
|
|
134
|
+
static DeleteAccountDiscountRule(req: DeleteAccountDiscountRuleRequest, initReq?: fm.InitReq): Promise<DeleteAccountDiscountRuleResponse> {
|
|
135
|
+
return fm.fetchReq<DeleteAccountDiscountRuleRequest, DeleteAccountDiscountRuleResponse>(`/apis/leopard.io/v1alpha1/operations/discount-rules/${req["id"]}`, {...initReq, method: "DELETE"})
|
|
136
|
+
}
|
|
44
137
|
}
|
package/v1alpha1/product.pb.ts
CHANGED
|
@@ -37,6 +37,12 @@ export enum SortOrder {
|
|
|
37
37
|
DESC = "DESC",
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
export enum SkuDiscountScheduleType {
|
|
41
|
+
SKU_DISCOUNT_SCHEDULE_TYPE_UNSPECIFIED = "SKU_DISCOUNT_SCHEDULE_TYPE_UNSPECIFIED",
|
|
42
|
+
SKU_DISCOUNT_SCHEDULE_TYPE_ABSOLUTE = "SKU_DISCOUNT_SCHEDULE_TYPE_ABSOLUTE",
|
|
43
|
+
SKU_DISCOUNT_SCHEDULE_TYPE_DAILY = "SKU_DISCOUNT_SCHEDULE_TYPE_DAILY",
|
|
44
|
+
}
|
|
45
|
+
|
|
40
46
|
export type CreateDiscountRuleRequest = {
|
|
41
47
|
name?: string
|
|
42
48
|
meteringAmountsDiscounts?: string
|
|
@@ -135,6 +141,7 @@ export type SkuItem = {
|
|
|
135
141
|
available?: boolean
|
|
136
142
|
displayOrder?: number
|
|
137
143
|
transferSkuId?: string
|
|
144
|
+
discountInfo?: SkuDiscountInfo
|
|
138
145
|
}
|
|
139
146
|
|
|
140
147
|
export type ListProductSKUsResponse = {
|
|
@@ -185,6 +192,7 @@ export type GetSKUResponse = {
|
|
|
185
192
|
meteringAmountsDiscounts?: MeteringAmountsDiscount[]
|
|
186
193
|
canTransferPayAsYouGo?: boolean
|
|
187
194
|
transferSkuId?: string
|
|
195
|
+
discountInfo?: SkuDiscountInfo
|
|
188
196
|
}
|
|
189
197
|
|
|
190
198
|
export type MeteringAmountsDiscount = {
|
|
@@ -192,12 +200,29 @@ export type MeteringAmountsDiscount = {
|
|
|
192
200
|
discountPercentage?: number
|
|
193
201
|
}
|
|
194
202
|
|
|
203
|
+
export type SkuDiscountInfo = {
|
|
204
|
+
discountRate?: number
|
|
205
|
+
discountName?: string
|
|
206
|
+
schedule?: SkuDiscountSchedule
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export type SkuDiscountSchedule = {
|
|
210
|
+
discountRuleId?: string
|
|
211
|
+
type?: SkuDiscountScheduleType
|
|
212
|
+
effectiveStartAt?: string
|
|
213
|
+
effectiveEndAt?: string
|
|
214
|
+
dailyStartMinute?: number
|
|
215
|
+
dailyEndMinute?: number
|
|
216
|
+
timezone?: string
|
|
217
|
+
}
|
|
218
|
+
|
|
195
219
|
export type GetSKUPriceRequest = {
|
|
196
220
|
id?: string
|
|
197
221
|
}
|
|
198
222
|
|
|
199
223
|
export type GetSKUPriceResponse = {
|
|
200
224
|
price?: string
|
|
225
|
+
discountInfo?: SkuDiscountInfo
|
|
201
226
|
}
|
|
202
227
|
|
|
203
228
|
export type ListProductSpecFieldRequest = {
|
|
@@ -343,6 +368,7 @@ export type GetSKUInfoResponse = {
|
|
|
343
368
|
freeQuantity?: number
|
|
344
369
|
description?: string
|
|
345
370
|
available?: number
|
|
371
|
+
discountInfo?: SkuDiscountInfo
|
|
346
372
|
}
|
|
347
373
|
|
|
348
374
|
export type CreateSKUInfoRequest = {
|