@daocloud-proto/leopard 0.5.0 → 0.6.0-dev1

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.5.0",
3
+ "version":"0.6.0-dev1",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -76,6 +76,7 @@ export type bill = {
76
76
  billingItem?: string
77
77
  voucherPayment?: string
78
78
  type?: BillType
79
+ userId?: string
79
80
  }
80
81
 
81
82
  export type BillingCycle = {
@@ -11,6 +11,7 @@ export enum OrderType {
11
11
  REFUND = "REFUND",
12
12
  UPGRADE = "UPGRADE",
13
13
  DOWNGRADE = "DOWNGRADE",
14
+ TRANSFORM = "TRANSFORM",
14
15
  }
15
16
 
16
17
  export enum BillingType {
@@ -76,6 +77,7 @@ export type Orders = {
76
77
  orderStatus?: OrderStatus
77
78
  orderPrice?: string
78
79
  amountDue?: string
80
+ userId?: string
79
81
  }
80
82
 
81
83
  export type ListOrdersResponse = {
@@ -90,6 +92,8 @@ export type OrderInfo = {
90
92
  orderStatus?: OrderStatus
91
93
  orderPrice?: string
92
94
  amountDue?: string
95
+ userName?: string
96
+ userId?: string
93
97
  }
94
98
 
95
99
  export type Resource = {
@@ -140,6 +144,8 @@ export type CreateNewPurchaseOrderRequest = {
140
144
  username?: string
141
145
  userId?: string
142
146
  orderItems?: OrderItem[]
147
+ renewMeteringUnit?: UnitType
148
+ renewMeteringAmount?: number
143
149
  }
144
150
 
145
151
  export type CreateNewPurchaseOrderResponse = {
@@ -168,7 +174,8 @@ export type IsResourceOrderNextBillBalanceSufficientRequest = {
168
174
  }
169
175
 
170
176
  export type IsResourceOrderNextBillBalanceSufficientResponse = {
171
- sufficient?: boolean
177
+ balanceSufficient?: boolean
178
+ inventorySufficient?: boolean
172
179
  }
173
180
 
174
181
  export type RefundOrderRequest = {
@@ -186,6 +193,34 @@ export type InvalidateOrderRequest = {
186
193
  export type InvalidateOrderResponse = {
187
194
  }
188
195
 
196
+ export type CreateTransformOrderRequest = {
197
+ username?: string
198
+ userId?: string
199
+ productName?: string
200
+ resourceId?: string
201
+ skuId?: string
202
+ }
203
+
204
+ export type CreateTransformOrderResponse = {
205
+ orderId?: string
206
+ createOrderStatus?: CreateOrderStatus
207
+ }
208
+
209
+ export type CreateRenewOrderRequest = {
210
+ username?: string
211
+ userId?: string
212
+ productName?: string
213
+ resourceId?: string
214
+ skuId?: string
215
+ renewMeteringUnit?: UnitType
216
+ renewMeteringAmount?: number
217
+ }
218
+
219
+ export type CreateRenewOrderResponse = {
220
+ orderId?: string
221
+ createOrderStatus?: CreateOrderStatus
222
+ }
223
+
189
224
  export class Order {
190
225
  static ListOrders(req: ListOrdersRequest, initReq?: fm.InitReq): Promise<ListOrdersResponse> {
191
226
  return fm.fetchReq<ListOrdersRequest, ListOrdersResponse>(`/apis/leopard.io/v1alpha1/orders?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
@@ -202,6 +237,12 @@ export class Order {
202
237
  static CreateQuantityChangeOrder(req: CreateQuantityChangeOrderRequest, initReq?: fm.InitReq): Promise<CreateQuantityChangeOrderResponse> {
203
238
  return fm.fetchReq<CreateQuantityChangeOrderRequest, CreateQuantityChangeOrderResponse>(`/apis/leopard.io/v1alpha1/orders/quantity-change`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
204
239
  }
240
+ static CreateRenewOrder(req: CreateRenewOrderRequest, initReq?: fm.InitReq): Promise<CreateRenewOrderResponse> {
241
+ return fm.fetchReq<CreateRenewOrderRequest, CreateRenewOrderResponse>(`/apis/leopard.io/v1alpha1/orders/renew`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
242
+ }
243
+ static CreateTransformOrder(req: CreateTransformOrderRequest, initReq?: fm.InitReq): Promise<CreateTransformOrderResponse> {
244
+ return fm.fetchReq<CreateTransformOrderRequest, CreateTransformOrderResponse>(`/v1alpha1.order.Order/CreateTransformOrder`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
245
+ }
205
246
  static IsResourceOrderNextBillBalanceSufficient(req: IsResourceOrderNextBillBalanceSufficientRequest, initReq?: fm.InitReq): Promise<IsResourceOrderNextBillBalanceSufficientResponse> {
206
247
  return fm.fetchReq<IsResourceOrderNextBillBalanceSufficientRequest, IsResourceOrderNextBillBalanceSufficientResponse>(`/apis/leopard.io/v1alpha1/orders/is-resource-balance-sufficient`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
207
248
  }
@@ -8,6 +8,10 @@ import * as fm from "../fetch.pb"
8
8
 
9
9
  export enum BillingType {
10
10
  PAY_AS_YOU_GO = "PAY_AS_YOU_GO",
11
+ SUBSCRIPTION_DAILY = "SUBSCRIPTION_DAILY",
12
+ SUBSCRIPTION_WEEKLY = "SUBSCRIPTION_WEEKLY",
13
+ SUBSCRIPTION_MONTHLY = "SUBSCRIPTION_MONTHLY",
14
+ SUBSCRIPTION_YEARLY = "SUBSCRIPTION_YEARLY",
11
15
  }
12
16
 
13
17
  export enum UnitType {
@@ -45,6 +49,7 @@ export type ListProductSKUsRequest = {
45
49
  filterByAnd?: boolean
46
50
  sortType?: string
47
51
  sortOrder?: SortOrder
52
+ billingType?: string
48
53
  }
49
54
 
50
55
  export type SkuItem = {
@@ -120,6 +125,7 @@ export type ListProductSpecFieldRequest = {
120
125
  regionId?: string
121
126
  specKey?: string
122
127
  product?: string
128
+ billingType?: string
123
129
  }
124
130
 
125
131
  export type ListProductSpecFieldResponse = {
@@ -55,6 +55,7 @@ export type transaction = {
55
55
  amount?: string
56
56
  billingId?: string
57
57
  balance?: string
58
+ userId?: string
58
59
  }
59
60
 
60
61
  export class Transaction {
@@ -18,6 +18,7 @@ export type BatchCreateVouchersRequest = {
18
18
  effectiveDays?: number
19
19
  quantity?: number
20
20
  regions?: string[]
21
+ expireTimestamp?: string
21
22
  }
22
23
 
23
24
  export type BatchCreateVouchersResponse = {
@@ -49,6 +49,8 @@ export type GetUserStateRequest = {
49
49
 
50
50
  export type GetUserStateResponse = {
51
51
  isVerified?: boolean
52
+ isMain?: boolean
53
+ permissions?: string[]
52
54
  }
53
55
 
54
56
  export class Wallet {