@daocloud-proto/leopard 0.9.0-dev1 → 0.9.0-dev2
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/product.pb.ts +38 -0
package/package.json
CHANGED
package/v1alpha1/product.pb.ts
CHANGED
|
@@ -35,6 +35,33 @@ export enum SortOrder {
|
|
|
35
35
|
DESC = "DESC",
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
export type CreateDiscountRuleRequest = {
|
|
39
|
+
name?: string
|
|
40
|
+
meteringAmountsDiscounts?: string
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type CreateDiscountRuleResponse = {
|
|
44
|
+
discountRuleId?: string
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type GetDiscountRuleRequest = {
|
|
48
|
+
id?: string
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type GetDiscountRuleResponse = {
|
|
52
|
+
id?: string
|
|
53
|
+
name?: string
|
|
54
|
+
meteringAmountsDiscounts?: MeteringAmountsDiscount[]
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type UpdateSKUDiscountRuleRequest = {
|
|
58
|
+
skuId?: string
|
|
59
|
+
discountRuleId?: string
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export type UpdateSKUDiscountRuleResponse = {
|
|
63
|
+
}
|
|
64
|
+
|
|
38
65
|
export type Pagination = {
|
|
39
66
|
total?: number
|
|
40
67
|
page?: number
|
|
@@ -294,6 +321,7 @@ export type CreateSKUInfoRequest = {
|
|
|
294
321
|
description?: string
|
|
295
322
|
available?: number
|
|
296
323
|
displayOrder?: number
|
|
324
|
+
discountRuleId?: string
|
|
297
325
|
}
|
|
298
326
|
|
|
299
327
|
export type CreateSKUInfoResponse = {
|
|
@@ -311,6 +339,7 @@ export type UpdateSKUInfoRequest = {
|
|
|
311
339
|
description?: string
|
|
312
340
|
available?: number
|
|
313
341
|
displayOrder?: number
|
|
342
|
+
discountRuleId?: string
|
|
314
343
|
}
|
|
315
344
|
|
|
316
345
|
export type UpdateSKUInfoResponse = {
|
|
@@ -378,4 +407,13 @@ export class Product {
|
|
|
378
407
|
static DeleteSKUInfo(req: DeleteSKUInfoRequest, initReq?: fm.InitReq): Promise<DeleteSKUInfoResponse> {
|
|
379
408
|
return fm.fetchReq<DeleteSKUInfoRequest, DeleteSKUInfoResponse>(`/apis/leopard.io/v1alpha1/products/sku-infos/${req["id"]}`, {...initReq, method: "DELETE"})
|
|
380
409
|
}
|
|
410
|
+
static CreateDiscountRule(req: CreateDiscountRuleRequest, initReq?: fm.InitReq): Promise<CreateDiscountRuleResponse> {
|
|
411
|
+
return fm.fetchReq<CreateDiscountRuleRequest, CreateDiscountRuleResponse>(`/apis/leopard.io/v1alpha1/products/discounts`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
412
|
+
}
|
|
413
|
+
static GetDiscountRule(req: GetDiscountRuleRequest, initReq?: fm.InitReq): Promise<GetDiscountRuleResponse> {
|
|
414
|
+
return fm.fetchReq<GetDiscountRuleRequest, GetDiscountRuleResponse>(`/apis/leopard.io/v1alpha1/products/discounts/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
|
|
415
|
+
}
|
|
416
|
+
static UpdateSKUDiscountRule(req: UpdateSKUDiscountRuleRequest, initReq?: fm.InitReq): Promise<UpdateSKUDiscountRuleResponse> {
|
|
417
|
+
return fm.fetchReq<UpdateSKUDiscountRuleRequest, UpdateSKUDiscountRuleResponse>(`/apis/leopard.io/v1alpha1/products/sku-infos/${req["skuId"]}/discount`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
418
|
+
}
|
|
381
419
|
}
|