@daocloud-proto/leopard 0.5.0-dev1 → 0.5.0-dev3

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-dev1",
3
+ "version":"0.5.0-dev3",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -6,6 +6,11 @@
6
6
 
7
7
  import * as fm from "../fetch.pb"
8
8
 
9
+ export enum BillType {
10
+ CONSUME = "CONSUME",
11
+ REFUND = "REFUND",
12
+ }
13
+
9
14
  export enum BillingType {
10
15
  PAY_AS_YOU_GO = "PAY_AS_YOU_GO",
11
16
  SUBSCRIPTION_DAILY = "SUBSCRIPTION_DAILY",
@@ -20,6 +25,10 @@ export enum UnitType {
20
25
  GB_DAY = "GB_DAY",
21
26
  INSTANCE_NUMBER = "INSTANCE_NUMBER",
22
27
  PICTURE = "PICTURE",
28
+ DAY = "DAY",
29
+ WEEK = "WEEK",
30
+ MONTH = "MONTH",
31
+ YEAR = "YEAR",
23
32
  }
24
33
 
25
34
  export enum ExpenseType {
@@ -66,6 +75,7 @@ export type bill = {
66
75
  amountDue?: string
67
76
  billingItem?: string
68
77
  voucherPayment?: string
78
+ type?: BillType
69
79
  }
70
80
 
71
81
  export type BillingCycle = {
@@ -24,7 +24,7 @@ export enum BillingType {
24
24
  export enum OrderStatus {
25
25
  PAID = "PAID",
26
26
  PARTIAL = "PARTIAL",
27
- REFUNDED = "REFUNDED",
27
+ INVALIDATED = "INVALIDATED",
28
28
  }
29
29
 
30
30
  export enum UnitType {
@@ -33,6 +33,10 @@ export enum UnitType {
33
33
  GB_DAY = "GB_DAY",
34
34
  INSTANCE_NUMBER = "INSTANCE_NUMBER",
35
35
  PICTURE = "PICTURE",
36
+ DAY = "DAY",
37
+ WEEK = "WEEK",
38
+ MONTH = "MONTH",
39
+ YEAR = "YEAR",
36
40
  }
37
41
 
38
42
  export enum CreateOrderStatus {
@@ -41,6 +45,7 @@ export enum CreateOrderStatus {
41
45
  RESOURCE_NOT_EXIST = "RESOURCE_NOT_EXIST",
42
46
  RESOURCE_EXIST = "RESOURCE_EXIST",
43
47
  INSUFFICIENT_BALANCE = "INSUFFICIENT_BALANCE",
48
+ INSUFFICIENT_INVENTORY = "INSUFFICIENT_INVENTORY",
44
49
  }
45
50
 
46
51
  export type Pagination = {
@@ -128,6 +133,7 @@ export type OrderItem = {
128
133
  skuId?: string
129
134
  quantity?: number
130
135
  resources?: Resource[]
136
+ meteringAmount?: number
131
137
  }
132
138
 
133
139
  export type CreateNewPurchaseOrderRequest = {
@@ -165,6 +171,13 @@ export type IsResourceOrderNextBillBalanceSufficientResponse = {
165
171
  sufficient?: boolean
166
172
  }
167
173
 
174
+ export type RefundOrderRequest = {
175
+ orderId?: string
176
+ }
177
+
178
+ export type RefundOrderResponse = {
179
+ }
180
+
168
181
  export type InvalidateOrderRequest = {
169
182
  orderId?: string
170
183
  reason?: string
@@ -192,6 +205,9 @@ export class Order {
192
205
  static IsResourceOrderNextBillBalanceSufficient(req: IsResourceOrderNextBillBalanceSufficientRequest, initReq?: fm.InitReq): Promise<IsResourceOrderNextBillBalanceSufficientResponse> {
193
206
  return fm.fetchReq<IsResourceOrderNextBillBalanceSufficientRequest, IsResourceOrderNextBillBalanceSufficientResponse>(`/apis/leopard.io/v1alpha1/orders/is-resource-balance-sufficient`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
194
207
  }
208
+ static RefundOrder(req: RefundOrderRequest, initReq?: fm.InitReq): Promise<RefundOrderResponse> {
209
+ return fm.fetchReq<RefundOrderRequest, RefundOrderResponse>(`/v1alpha1.order.Order/RefundOrder`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
210
+ }
195
211
  static InvalidateOrder(req: InvalidateOrderRequest, initReq?: fm.InitReq): Promise<InvalidateOrderResponse> {
196
212
  return fm.fetchReq<InvalidateOrderRequest, InvalidateOrderResponse>(`/v1alpha1.order.Order/InvalidateOrder`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
197
213
  }
@@ -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 = {