@daocloud-proto/leopard 0.18.0-dev6 → 0.18.0-dev7
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/discount.pb.ts +108 -0
- package/v1alpha1/voucher.pb.ts +6 -0
package/package.json
CHANGED
|
@@ -0,0 +1,108 @@
|
|
|
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 AccountDiscountStatus {
|
|
10
|
+
ACCOUNT_DISCOUNT_STATUS_UNSPECIFIED = "ACCOUNT_DISCOUNT_STATUS_UNSPECIFIED",
|
|
11
|
+
ACCOUNT_DISCOUNT_STATUS_DISABLED = "ACCOUNT_DISCOUNT_STATUS_DISABLED",
|
|
12
|
+
ACCOUNT_DISCOUNT_STATUS_ENABLED = "ACCOUNT_DISCOUNT_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 AccountDiscount = {
|
|
31
|
+
id?: string
|
|
32
|
+
name?: string
|
|
33
|
+
status?: AccountDiscountStatus
|
|
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 CreateAccountDiscountRequest = {
|
|
44
|
+
name?: string
|
|
45
|
+
discountRate?: number
|
|
46
|
+
mainAccountId?: string
|
|
47
|
+
skuId?: string
|
|
48
|
+
schedule?: AccountDiscountSchedule
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type GetAccountDiscountRequest = {
|
|
52
|
+
id?: string
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type ListAccountDiscountsRequest = {
|
|
56
|
+
name?: string
|
|
57
|
+
status?: string
|
|
58
|
+
mainAccountIds?: string[]
|
|
59
|
+
skuIds?: string[]
|
|
60
|
+
page?: number
|
|
61
|
+
pageSize?: number
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export type ListAccountDiscountsResponse = {
|
|
65
|
+
items?: AccountDiscount[]
|
|
66
|
+
pagination?: Pagination
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type UpdateAccountDiscountRequest = {
|
|
70
|
+
id?: string
|
|
71
|
+
name?: string
|
|
72
|
+
discountRate?: number
|
|
73
|
+
mainAccountId?: string
|
|
74
|
+
skuId?: string
|
|
75
|
+
schedule?: AccountDiscountSchedule
|
|
76
|
+
status?: AccountDiscountStatus
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type DeleteAccountDiscountRequest = {
|
|
80
|
+
id?: string
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type DeleteAccountDiscountResponse = {
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export type Pagination = {
|
|
87
|
+
total?: number
|
|
88
|
+
page?: number
|
|
89
|
+
pageSize?: number
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export class Discount {
|
|
93
|
+
static CreateAccountDiscount(req: CreateAccountDiscountRequest, initReq?: fm.InitReq): Promise<AccountDiscount> {
|
|
94
|
+
return fm.fetchReq<CreateAccountDiscountRequest, AccountDiscount>(`/apis/leopard.io/v1alpha1/discounts`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
95
|
+
}
|
|
96
|
+
static GetAccountDiscount(req: GetAccountDiscountRequest, initReq?: fm.InitReq): Promise<AccountDiscount> {
|
|
97
|
+
return fm.fetchReq<GetAccountDiscountRequest, AccountDiscount>(`/apis/leopard.io/v1alpha1/discounts/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
|
|
98
|
+
}
|
|
99
|
+
static ListAccountDiscounts(req: ListAccountDiscountsRequest, initReq?: fm.InitReq): Promise<ListAccountDiscountsResponse> {
|
|
100
|
+
return fm.fetchReq<ListAccountDiscountsRequest, ListAccountDiscountsResponse>(`/apis/leopard.io/v1alpha1/discounts?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
101
|
+
}
|
|
102
|
+
static UpdateAccountDiscount(req: UpdateAccountDiscountRequest, initReq?: fm.InitReq): Promise<AccountDiscount> {
|
|
103
|
+
return fm.fetchReq<UpdateAccountDiscountRequest, AccountDiscount>(`/apis/leopard.io/v1alpha1/discounts/${req["id"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
104
|
+
}
|
|
105
|
+
static DeleteAccountDiscount(req: DeleteAccountDiscountRequest, initReq?: fm.InitReq): Promise<DeleteAccountDiscountResponse> {
|
|
106
|
+
return fm.fetchReq<DeleteAccountDiscountRequest, DeleteAccountDiscountResponse>(`/apis/leopard.io/v1alpha1/discounts/${req["id"]}`, {...initReq, method: "DELETE"})
|
|
107
|
+
}
|
|
108
|
+
}
|
package/v1alpha1/voucher.pb.ts
CHANGED
|
@@ -111,6 +111,7 @@ export type VoucherListInfo = {
|
|
|
111
111
|
skuIds?: string[]
|
|
112
112
|
voucherGroupId?: number
|
|
113
113
|
suspendedAt?: string
|
|
114
|
+
voucherGroup?: VoucherGroupSummary
|
|
114
115
|
}
|
|
115
116
|
|
|
116
117
|
export type ActivateVoucherRequest = {
|
|
@@ -249,6 +250,11 @@ export type ResumeVoucherRequest = {
|
|
|
249
250
|
export type ResumeVoucherResponse = {
|
|
250
251
|
}
|
|
251
252
|
|
|
253
|
+
export type VoucherGroupSummary = {
|
|
254
|
+
groupId?: number
|
|
255
|
+
name?: string
|
|
256
|
+
}
|
|
257
|
+
|
|
252
258
|
export class Voucher {
|
|
253
259
|
static BatchCreateVouchers(req: BatchCreateVouchersRequest, initReq?: fm.InitReq): Promise<BatchCreateVouchersResponse> {
|
|
254
260
|
return fm.fetchReq<BatchCreateVouchersRequest, BatchCreateVouchersResponse>(`/apis/leopard.io/v1alpha1/vouchers/batch-create`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|