@daocloud-proto/leopard 0.5.1 → 0.6.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/leopard",
3
- "version":"0.5.1",
3
+ "version":"0.6.0-dev2",
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,11 +144,15 @@ 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 = {
146
152
  orderId?: string
147
153
  createOrderStatus?: CreateOrderStatus
154
+ startTimestamp?: string
155
+ endTimestamp?: string
148
156
  }
149
157
 
150
158
  export type CreateQuantityChangeOrderRequest = {
@@ -158,6 +166,8 @@ export type CreateQuantityChangeOrderRequest = {
158
166
  export type CreateQuantityChangeOrderResponse = {
159
167
  orderId?: string
160
168
  createOrderStatus?: CreateOrderStatus
169
+ startTimestamp?: string
170
+ endTimestamp?: string
161
171
  }
162
172
 
163
173
  export type IsResourceOrderNextBillBalanceSufficientRequest = {
@@ -168,7 +178,8 @@ export type IsResourceOrderNextBillBalanceSufficientRequest = {
168
178
  }
169
179
 
170
180
  export type IsResourceOrderNextBillBalanceSufficientResponse = {
171
- sufficient?: boolean
181
+ balanceSufficient?: boolean
182
+ inventorySufficient?: boolean
172
183
  }
173
184
 
174
185
  export type RefundOrderRequest = {
@@ -186,6 +197,38 @@ export type InvalidateOrderRequest = {
186
197
  export type InvalidateOrderResponse = {
187
198
  }
188
199
 
200
+ export type CreateTransformOrderRequest = {
201
+ username?: string
202
+ userId?: string
203
+ productName?: string
204
+ resourceId?: string
205
+ skuId?: string
206
+ }
207
+
208
+ export type CreateTransformOrderResponse = {
209
+ orderId?: string
210
+ createOrderStatus?: CreateOrderStatus
211
+ startTimestamp?: string
212
+ endTimestamp?: string
213
+ }
214
+
215
+ export type CreateRenewOrderRequest = {
216
+ username?: string
217
+ userId?: string
218
+ productName?: string
219
+ resourceId?: string
220
+ skuId?: string
221
+ renewMeteringUnit?: UnitType
222
+ renewMeteringAmount?: number
223
+ }
224
+
225
+ export type CreateRenewOrderResponse = {
226
+ orderId?: string
227
+ createOrderStatus?: CreateOrderStatus
228
+ startTimestamp?: string
229
+ endTimestamp?: string
230
+ }
231
+
189
232
  export class Order {
190
233
  static ListOrders(req: ListOrdersRequest, initReq?: fm.InitReq): Promise<ListOrdersResponse> {
191
234
  return fm.fetchReq<ListOrdersRequest, ListOrdersResponse>(`/apis/leopard.io/v1alpha1/orders?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
@@ -202,6 +245,12 @@ export class Order {
202
245
  static CreateQuantityChangeOrder(req: CreateQuantityChangeOrderRequest, initReq?: fm.InitReq): Promise<CreateQuantityChangeOrderResponse> {
203
246
  return fm.fetchReq<CreateQuantityChangeOrderRequest, CreateQuantityChangeOrderResponse>(`/apis/leopard.io/v1alpha1/orders/quantity-change`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
204
247
  }
248
+ static CreateRenewOrder(req: CreateRenewOrderRequest, initReq?: fm.InitReq): Promise<CreateRenewOrderResponse> {
249
+ return fm.fetchReq<CreateRenewOrderRequest, CreateRenewOrderResponse>(`/apis/leopard.io/v1alpha1/orders/renew`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
250
+ }
251
+ static CreateTransformOrder(req: CreateTransformOrderRequest, initReq?: fm.InitReq): Promise<CreateTransformOrderResponse> {
252
+ return fm.fetchReq<CreateTransformOrderRequest, CreateTransformOrderResponse>(`/v1alpha1.order.Order/CreateTransformOrder`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
253
+ }
205
254
  static IsResourceOrderNextBillBalanceSufficient(req: IsResourceOrderNextBillBalanceSufficientRequest, initReq?: fm.InitReq): Promise<IsResourceOrderNextBillBalanceSufficientResponse> {
206
255
  return fm.fetchReq<IsResourceOrderNextBillBalanceSufficientRequest, IsResourceOrderNextBillBalanceSufficientResponse>(`/apis/leopard.io/v1alpha1/orders/is-resource-balance-sufficient`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
207
256
  }
@@ -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 {
@@ -15,6 +19,11 @@ export enum UnitType {
15
19
  THOUSAND_TOKENS = "THOUSAND_TOKENS",
16
20
  GB_DAY = "GB_DAY",
17
21
  INSTANCE_NUMBER = "INSTANCE_NUMBER",
22
+ PICTURE = "PICTURE",
23
+ DAY = "DAY",
24
+ WEEK = "WEEK",
25
+ MONTH = "MONTH",
26
+ YEAR = "YEAR",
18
27
  }
19
28
 
20
29
  export enum QuantityUnit {
@@ -45,6 +54,7 @@ export type ListProductSKUsRequest = {
45
54
  filterByAnd?: boolean
46
55
  sortType?: string
47
56
  sortOrder?: SortOrder
57
+ billingType?: string
48
58
  }
49
59
 
50
60
  export type SkuItem = {
@@ -120,6 +130,7 @@ export type ListProductSpecFieldRequest = {
120
130
  regionId?: string
121
131
  specKey?: string
122
132
  product?: string
133
+ billingType?: string
123
134
  }
124
135
 
125
136
  export type ListProductSpecFieldResponse = {
@@ -0,0 +1,32 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ /*
4
+ * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
+ */
6
+
7
+ import * as fm from "../fetch.pb"
8
+
9
+ export enum PeriodStatus {
10
+ Paid = "Paid",
11
+ NotPaid = "NotPaid",
12
+ }
13
+
14
+ export type GetResourceInfoRequest = {
15
+ resourceId?: string
16
+ }
17
+
18
+ export type GetResourceInfoResponse = {
19
+ periods?: ResourcePeriod[]
20
+ }
21
+
22
+ export type ResourcePeriod = {
23
+ startTimestamp?: string
24
+ endTimestamp?: string
25
+ status?: PeriodStatus
26
+ }
27
+
28
+ export class Resource {
29
+ static GetResourceInfo(req: GetResourceInfoRequest, initReq?: fm.InitReq): Promise<GetResourceInfoResponse> {
30
+ return fm.fetchReq<GetResourceInfoRequest, GetResourceInfoResponse>(`/v1alpha1.resource.Resource/GetResourceInfo`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
31
+ }
32
+ }
@@ -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 {
@@ -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 {