@daocloud-proto/leopard 0.18.0-dev7 → 0.18.0-rc2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/leopard",
3
- "version":"0.18.0-dev7",
3
+ "version":"0.18.0-rc2",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -6,15 +6,6 @@
6
6
 
7
7
  import * as fm from "../fetch.pb"
8
8
 
9
- type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
10
- type OneOf<T> =
11
- | { [k in keyof T]?: undefined }
12
- | (
13
- keyof T extends infer K ?
14
- (K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
15
- : never)
16
- : never);
17
-
18
9
  export enum VoucherStatus {
19
10
  Active = "Active",
20
11
  UsedUp = "UsedUp",
@@ -225,13 +216,10 @@ export type ActivateVoucherFromGroupRequest = {
225
216
  userId?: string
226
217
  }
227
218
 
228
-
229
- type BaseRedeemVoucherRequest = {
219
+ export type RedeemVoucherRequest = {
220
+ code?: string
230
221
  }
231
222
 
232
- export type RedeemVoucherRequest = BaseRedeemVoucherRequest
233
- & OneOf<{ redeemCode: string; voucherId: string }>
234
-
235
223
  export type RedeemVoucherResponse = {
236
224
  voucherId?: string
237
225
  }
@@ -1,108 +0,0 @@
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
- }