@daocloud-proto/leopard 0.4.1-rc4 → 0.5.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/order.pb.ts +24 -1
package/package.json
CHANGED
package/v1alpha1/order.pb.ts
CHANGED
|
@@ -24,7 +24,7 @@ export enum BillingType {
|
|
|
24
24
|
export enum OrderStatus {
|
|
25
25
|
PAID = "PAID",
|
|
26
26
|
PARTIAL = "PARTIAL",
|
|
27
|
-
|
|
27
|
+
INVALIDATED = "INVALIDATED",
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export enum UnitType {
|
|
@@ -41,6 +41,7 @@ export enum CreateOrderStatus {
|
|
|
41
41
|
RESOURCE_NOT_EXIST = "RESOURCE_NOT_EXIST",
|
|
42
42
|
RESOURCE_EXIST = "RESOURCE_EXIST",
|
|
43
43
|
INSUFFICIENT_BALANCE = "INSUFFICIENT_BALANCE",
|
|
44
|
+
INSUFFICIENT_INVENTORY = "INSUFFICIENT_INVENTORY",
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
export type Pagination = {
|
|
@@ -134,6 +135,7 @@ export type CreateNewPurchaseOrderRequest = {
|
|
|
134
135
|
username?: string
|
|
135
136
|
userId?: string
|
|
136
137
|
orderItems?: OrderItem[]
|
|
138
|
+
meteringCount?: number
|
|
137
139
|
}
|
|
138
140
|
|
|
139
141
|
export type CreateNewPurchaseOrderResponse = {
|
|
@@ -165,6 +167,21 @@ export type IsResourceOrderNextBillBalanceSufficientResponse = {
|
|
|
165
167
|
sufficient?: boolean
|
|
166
168
|
}
|
|
167
169
|
|
|
170
|
+
export type RefundOrderRequest = {
|
|
171
|
+
orderId?: string
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export type RefundOrderResponse = {
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export type InvalidateOrderRequest = {
|
|
178
|
+
orderId?: string
|
|
179
|
+
reason?: string
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export type InvalidateOrderResponse = {
|
|
183
|
+
}
|
|
184
|
+
|
|
168
185
|
export class Order {
|
|
169
186
|
static ListOrders(req: ListOrdersRequest, initReq?: fm.InitReq): Promise<ListOrdersResponse> {
|
|
170
187
|
return fm.fetchReq<ListOrdersRequest, ListOrdersResponse>(`/apis/leopard.io/v1alpha1/orders?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
@@ -184,4 +201,10 @@ export class Order {
|
|
|
184
201
|
static IsResourceOrderNextBillBalanceSufficient(req: IsResourceOrderNextBillBalanceSufficientRequest, initReq?: fm.InitReq): Promise<IsResourceOrderNextBillBalanceSufficientResponse> {
|
|
185
202
|
return fm.fetchReq<IsResourceOrderNextBillBalanceSufficientRequest, IsResourceOrderNextBillBalanceSufficientResponse>(`/apis/leopard.io/v1alpha1/orders/is-resource-balance-sufficient`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
186
203
|
}
|
|
204
|
+
static RefundOrder(req: RefundOrderRequest, initReq?: fm.InitReq): Promise<RefundOrderResponse> {
|
|
205
|
+
return fm.fetchReq<RefundOrderRequest, RefundOrderResponse>(`/v1alpha1.order.Order/RefundOrder`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
206
|
+
}
|
|
207
|
+
static InvalidateOrder(req: InvalidateOrderRequest, initReq?: fm.InitReq): Promise<InvalidateOrderResponse> {
|
|
208
|
+
return fm.fetchReq<InvalidateOrderRequest, InvalidateOrderResponse>(`/v1alpha1.order.Order/InvalidateOrder`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
209
|
+
}
|
|
187
210
|
}
|