@daocloud-proto/leopard 0.1.0-dev3 → 0.1.0-dev5
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 +14 -0
package/package.json
CHANGED
package/v1alpha1/order.pb.ts
CHANGED
|
@@ -115,6 +115,17 @@ export type GetProductsResponse = {
|
|
|
115
115
|
items?: string[]
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
export type CreateOrderRequest = {
|
|
119
|
+
username?: string
|
|
120
|
+
productId?: string
|
|
121
|
+
skuId?: string
|
|
122
|
+
quantity?: number
|
|
123
|
+
instances?: string[]
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export type CreateOrderResponse = {
|
|
127
|
+
}
|
|
128
|
+
|
|
118
129
|
export class Order {
|
|
119
130
|
static ListOrders(req: ListOrdersRequest, initReq?: fm.InitReq): Promise<ListOrdersResponse> {
|
|
120
131
|
return fm.fetchReq<ListOrdersRequest, ListOrdersResponse>(`/apis/leopard.io/v1alpha1/orders?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
@@ -125,4 +136,7 @@ export class Order {
|
|
|
125
136
|
static GetProducts(req: GetProductsRequest, initReq?: fm.InitReq): Promise<GetProductsResponse> {
|
|
126
137
|
return fm.fetchReq<GetProductsRequest, GetProductsResponse>(`/apis/leopard.io/v1alpha1/orders/products?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
127
138
|
}
|
|
139
|
+
static CreateOrder(req: CreateOrderRequest, initReq?: fm.InitReq): Promise<CreateOrderResponse> {
|
|
140
|
+
return fm.fetchReq<CreateOrderRequest, CreateOrderResponse>(`/apis/leopard.io/v1alpha1/orders`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
141
|
+
}
|
|
128
142
|
}
|