@daocloud-proto/leopard 0.3.0 → 0.3.1-rc1

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.3.0",
3
+ "version":"0.3.1-rc1",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -22,6 +22,11 @@ export enum UnitType {
22
22
  PICTURE = "PICTURE",
23
23
  }
24
24
 
25
+ export enum ExpenseType {
26
+ Consume = "Consume",
27
+ Refund = "Refund",
28
+ }
29
+
25
30
  export type ListBillsRequest = {
26
31
  start?: string
27
32
  end?: string
@@ -73,8 +78,58 @@ export type Resource = {
73
78
  id?: string
74
79
  }
75
80
 
81
+ export type ListMonthlyBillsRequest = {
82
+ startMonth?: string
83
+ endMonth?: string
84
+ page?: number
85
+ pageSize?: number
86
+ }
87
+
88
+ export type ListMonthlyBillsResponse = {
89
+ items?: MonthBillSummary[]
90
+ pagination?: Pagination
91
+ }
92
+
93
+ export type MonthBillSummary = {
94
+ billingMonth?: string
95
+ orderPrice?: string
96
+ voucherPayment?: string
97
+ amountDue?: string
98
+ }
99
+
100
+ export type GetMonthlyBillsRequest = {
101
+ billingMonth?: string
102
+ }
103
+
104
+ export type GetMonthlyBillsResponse = {
105
+ products?: ProductMonthlyBill[]
106
+ }
107
+
108
+ export type RegionMonthlyBill = {
109
+ billingMonth?: string
110
+ region?: string
111
+ orderPrice?: string
112
+ voucherPayment?: string
113
+ amountDue?: string
114
+ }
115
+
116
+ export type ProductMonthlyBill = {
117
+ billingMonth?: string
118
+ product?: string
119
+ expenseType?: ExpenseType
120
+ orderPrice?: string
121
+ voucherPayment?: string
122
+ amountDue?: string
123
+ }
124
+
76
125
  export class Bill {
77
126
  static ListBills(req: ListBillsRequest, initReq?: fm.InitReq): Promise<ListBillsResponse> {
78
127
  return fm.fetchReq<ListBillsRequest, ListBillsResponse>(`/apis/leopard.io/v1alpha1/bills?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
79
128
  }
129
+ static ListMonthlyBills(req: ListMonthlyBillsRequest, initReq?: fm.InitReq): Promise<ListMonthlyBillsResponse> {
130
+ return fm.fetchReq<ListMonthlyBillsRequest, ListMonthlyBillsResponse>(`/apis/leopard.io/v1alpha1/bills/monthly?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
131
+ }
132
+ static GetMonthlyBills(req: GetMonthlyBillsRequest, initReq?: fm.InitReq): Promise<GetMonthlyBillsResponse> {
133
+ return fm.fetchReq<GetMonthlyBillsRequest, GetMonthlyBillsResponse>(`/apis/leopard.io/v1alpha1/bills/monthly/${req["billingMonth"]}?${fm.renderURLSearchParams(req, ["billingMonth"])}`, {...initReq, method: "GET"})
134
+ }
80
135
  }
@@ -87,6 +87,7 @@ export type Region = {
87
87
  cluster?: string
88
88
  schemes?: string
89
89
  host?: string
90
+ regionType?: string
90
91
  }
91
92
 
92
93
  export type ListRegionsResponse = {
@@ -132,11 +133,35 @@ export type CreateRegionRequest = {
132
133
  cluster?: string
133
134
  schemes?: string
134
135
  host?: string
136
+ regionType?: string
137
+ displayOrder?: number
135
138
  }
136
139
 
137
140
  export type CreateRegionResponse = {
138
141
  }
139
142
 
143
+ export type CreateRegionTypeRequest = {
144
+ regionType?: string
145
+ enUsName?: string
146
+ zhCnName?: string
147
+ }
148
+
149
+ export type CreateRegionTypeResponse = {
150
+ }
151
+
152
+ export type ListRegionTypesRequest = {
153
+ }
154
+
155
+ export type ListRegionTypesResponse = {
156
+ items?: RegionType[]
157
+ }
158
+
159
+ export type RegionType = {
160
+ regionType?: string
161
+ enUsName?: string
162
+ zhCnName?: string
163
+ }
164
+
140
165
  export class Product {
141
166
  static ListProductSKUs(req: ListProductSKUsRequest, initReq?: fm.InitReq): Promise<ListProductSKUsResponse> {
142
167
  return fm.fetchReq<ListProductSKUsRequest, ListProductSKUsResponse>(`/apis/leopard.io/v1alpha1/products/skus`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
@@ -153,6 +178,12 @@ export class Product {
153
178
  static CreateRegion(req: CreateRegionRequest, initReq?: fm.InitReq): Promise<CreateRegionResponse> {
154
179
  return fm.fetchReq<CreateRegionRequest, CreateRegionResponse>(`/apis/leopard.io/v1alpha1/products/regions`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
155
180
  }
181
+ static CreateRegionType(req: CreateRegionTypeRequest, initReq?: fm.InitReq): Promise<CreateRegionTypeResponse> {
182
+ return fm.fetchReq<CreateRegionTypeRequest, CreateRegionTypeResponse>(`/apis/leopard.io/v1alpha1/products/regions/types`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
183
+ }
184
+ static ListRegionTypes(req: ListRegionTypesRequest, initReq?: fm.InitReq): Promise<ListRegionTypesResponse> {
185
+ return fm.fetchReq<ListRegionTypesRequest, ListRegionTypesResponse>(`/apis/leopard.io/v1alpha1/products/regions/types?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
186
+ }
156
187
  static ListProductSpecFieldValues(req: ListProductSpecFieldRequest, initReq?: fm.InitReq): Promise<ListProductSpecFieldResponse> {
157
188
  return fm.fetchReq<ListProductSpecFieldRequest, ListProductSpecFieldResponse>(`/apis/leopard.io/v1alpha1/products/specs?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
158
189
  }
@@ -41,6 +41,14 @@ export type UserStateRequest = {
41
41
 
42
42
  export type UserStateResponse = {
43
43
  amount?: string
44
+ isVerified?: boolean
45
+ }
46
+
47
+ export type GetUserStateRequest = {
48
+ }
49
+
50
+ export type GetUserStateResponse = {
51
+ isVerified?: boolean
44
52
  }
45
53
 
46
54
  export class Wallet {
@@ -50,6 +58,9 @@ export class Wallet {
50
58
  static Recharge(req: RechargeRequest, initReq?: fm.InitReq): Promise<RechargeResponse> {
51
59
  return fm.fetchReq<RechargeRequest, RechargeResponse>(`/apis/leopard.io/v1alpha1/wallet/recharge`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
52
60
  }
61
+ static GetUserState(req: GetUserStateRequest, initReq?: fm.InitReq): Promise<GetUserStateResponse> {
62
+ return fm.fetchReq<GetUserStateRequest, GetUserStateResponse>(`/apis/leopard.io/v1alpha1/wallet/user-state?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
63
+ }
53
64
  static UserState(req: UserStateRequest, initReq?: fm.InitReq): Promise<UserStateResponse> {
54
65
  return fm.fetchReq<UserStateRequest, UserStateResponse>(`/v1alpha1.wallet.Wallet/UserState`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
55
66
  }