@daocloud-proto/leopard 0.1.0-dev22 → 0.1.0-dev23

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.1.0-dev22",
3
+ "version":"0.1.0-dev23",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -28,7 +28,7 @@ export type ListBillsRequest = {
28
28
  pageSize?: number
29
29
  billId?: string
30
30
  orderId?: string
31
- instanceId?: string
31
+ resourceId?: string
32
32
  billingType?: string
33
33
  productName?: string
34
34
  }
@@ -50,7 +50,7 @@ export type bill = {
50
50
  billingCycle?: BillingCycle
51
51
  billingMonth?: string
52
52
  productName?: string
53
- instances?: Instance[]
53
+ resources?: Resource[]
54
54
  billingType?: BillingType
55
55
  unitPrice?: number
56
56
  unit?: UnitType
@@ -65,7 +65,7 @@ export type BillingCycle = {
65
65
  endTimestamp?: string
66
66
  }
67
67
 
68
- export type Instance = {
68
+ export type Resource = {
69
69
  name?: string
70
70
  id?: string
71
71
  }
@@ -42,7 +42,7 @@ export type Pagination = {
42
42
 
43
43
  export type ListOrdersRequest = {
44
44
  orderId?: string
45
- instanceId?: string
45
+ resourceId?: string
46
46
  orderType?: OrderType
47
47
  productName?: string
48
48
  orderStatus?: OrderStatus
@@ -58,7 +58,7 @@ export type Orders = {
58
58
  createdAtTimestamp?: string
59
59
  orderType?: OrderType
60
60
  productName?: string
61
- instances?: Instance[]
61
+ resources?: Resource[]
62
62
  orderStatus?: OrderStatus
63
63
  orderPrice?: string
64
64
  amountDue?: string
@@ -78,15 +78,15 @@ export type OrderInfo = {
78
78
  amountDue?: string
79
79
  }
80
80
 
81
- export type Instance = {
82
- instanceName?: string
81
+ export type Resource = {
82
+ resourceName?: string
83
83
  id?: string
84
84
  }
85
85
 
86
86
  export type ProductInfo = {
87
- instances?: Instance[]
87
+ resources?: Resource[]
88
88
  productName?: string
89
- instanceNum?: number
89
+ resourceNum?: number
90
90
  specification?: string
91
91
  billingType?: BillingType
92
92
  start?: string
@@ -118,7 +118,7 @@ export type OrderItem = {
118
118
  productName?: string
119
119
  skuId?: string
120
120
  quantity?: number
121
- instances?: Instance[]
121
+ resources?: Resource[]
122
122
  }
123
123
 
124
124
  export type CreateOrderRequest = {
@@ -132,13 +132,46 @@ export type CreateOrderResponse = {
132
132
  orderId?: string
133
133
  }
134
134
 
135
- export type GetInstanceOrderInfoByInstanceIDRequest = {
136
- instanceId?: string
135
+ export type CreateNewPurchaseOrderRequest = {
136
+ username?: string
137
+ userId?: string
138
+ orderItems?: OrderItem[]
137
139
  }
138
140
 
139
- export type GetInstanceOrderInfoByInstanceIDResponse = {
140
- instanceId?: string
141
- instanceName?: string
141
+ export type CreateNewPurchaseOrderResponse = {
142
+ orderId?: string
143
+ }
144
+
145
+ export type CreateQuantityChangeOrderRequest = {
146
+ username?: string
147
+ userId?: string
148
+ productName?: string
149
+ quantity?: number
150
+ resourceId?: string
151
+ }
152
+
153
+ export type CreateQuantityChangeOrderResponse = {
154
+ orderId?: string
155
+ }
156
+
157
+ export type IsResourceOrderNextBillBalanceSufficientRequest = {
158
+ username?: string
159
+ userId?: string
160
+ productName?: string
161
+ resourceId?: string
162
+ }
163
+
164
+ export type IsResourceOrderNextBillBalanceSufficientResponse = {
165
+ sufficient?: boolean
166
+ }
167
+
168
+ export type GetResourceOrderInfoByResourceIDRequest = {
169
+ resourceId?: string
170
+ }
171
+
172
+ export type GetResourceOrderInfoByResourceIDResponse = {
173
+ resourceId?: string
174
+ resourceName?: string
142
175
  username?: string
143
176
  skuId?: string
144
177
  productName?: string
@@ -155,8 +188,8 @@ export class Order {
155
188
  static GetOrder(req: GetOrderRequest, initReq?: fm.InitReq): Promise<GetOrderResponse> {
156
189
  return fm.fetchReq<GetOrderRequest, GetOrderResponse>(`/apis/leopard.io/v1alpha1/orders/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
157
190
  }
158
- static GetInstanceOrderInfoByInstanceID(req: GetInstanceOrderInfoByInstanceIDRequest, initReq?: fm.InitReq): Promise<GetInstanceOrderInfoByInstanceIDResponse> {
159
- return fm.fetchReq<GetInstanceOrderInfoByInstanceIDRequest, GetInstanceOrderInfoByInstanceIDResponse>(`/apis/leopard.io/v1alpha1/orders/instances-info?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
191
+ static GetResourceOrderInfoByResourceID(req: GetResourceOrderInfoByResourceIDRequest, initReq?: fm.InitReq): Promise<GetResourceOrderInfoByResourceIDResponse> {
192
+ return fm.fetchReq<GetResourceOrderInfoByResourceIDRequest, GetResourceOrderInfoByResourceIDResponse>(`/apis/leopard.io/v1alpha1/orders/resources-info?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
160
193
  }
161
194
  static GetProducts(req: GetProductsRequest, initReq?: fm.InitReq): Promise<GetProductsResponse> {
162
195
  return fm.fetchReq<GetProductsRequest, GetProductsResponse>(`/apis/leopard.io/v1alpha1/orders/products?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
@@ -164,4 +197,13 @@ export class Order {
164
197
  static CreateOrder(req: CreateOrderRequest, initReq?: fm.InitReq): Promise<CreateOrderResponse> {
165
198
  return fm.fetchReq<CreateOrderRequest, CreateOrderResponse>(`/apis/leopard.io/v1alpha1/orders`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
166
199
  }
200
+ static CreateNewPurchaseOrder(req: CreateNewPurchaseOrderRequest, initReq?: fm.InitReq): Promise<CreateNewPurchaseOrderResponse> {
201
+ return fm.fetchReq<CreateNewPurchaseOrderRequest, CreateNewPurchaseOrderResponse>(`/apis/leopard.io/v1alpha1/orders/new-purchase`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
202
+ }
203
+ static CreateQuantityChangeOrder(req: CreateQuantityChangeOrderRequest, initReq?: fm.InitReq): Promise<CreateQuantityChangeOrderResponse> {
204
+ return fm.fetchReq<CreateQuantityChangeOrderRequest, CreateQuantityChangeOrderResponse>(`/apis/leopard.io/v1alpha1/orders/quantity-change`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
205
+ }
206
+ static IsResourceOrderNextBillBalanceSufficient(req: IsResourceOrderNextBillBalanceSufficientRequest, initReq?: fm.InitReq): Promise<IsResourceOrderNextBillBalanceSufficientResponse> {
207
+ return fm.fetchReq<IsResourceOrderNextBillBalanceSufficientRequest, IsResourceOrderNextBillBalanceSufficientResponse>(`/apis/leopard.io/v1alpha1/orders/is-resource-balance-sufficient`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
208
+ }
167
209
  }