@daocloud-proto/leopard 0.1.0-dev11 → 0.1.0-dev13

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-dev11",
3
+ "version":"0.1.0-dev13",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -45,7 +45,6 @@ export type ListOrdersRequest = {
45
45
  instanceId?: string
46
46
  orderType?: OrderType
47
47
  productName?: string
48
- payType?: BillingType
49
48
  orderStatus?: OrderStatus
50
49
  start?: string
51
50
  end?: string
@@ -53,7 +52,7 @@ export type ListOrdersRequest = {
53
52
  pageSize?: number
54
53
  }
55
54
 
56
- export type OrderItem = {
55
+ export type Orders = {
57
56
  userName?: string
58
57
  orderId?: string
59
58
  createdAtTimestamp?: string
@@ -61,15 +60,12 @@ export type OrderItem = {
61
60
  productName?: string
62
61
  instances?: Instance[]
63
62
  orderStatus?: OrderStatus
64
- billingType?: BillingType
65
- unitPrice?: number
66
- unit?: UnitType
67
63
  orderPrice?: string
68
64
  amountDue?: string
69
65
  }
70
66
 
71
67
  export type ListOrdersResponse = {
72
- items?: OrderItem[]
68
+ items?: Orders[]
73
69
  pagination?: Pagination
74
70
  }
75
71
 
@@ -85,7 +81,7 @@ export type OrderInfo = {
85
81
  }
86
82
 
87
83
  export type Instance = {
88
- name?: string
84
+ instanceName?: string
89
85
  id?: string
90
86
  }
91
87
 
@@ -120,15 +116,38 @@ export type GetProductsResponse = {
120
116
  products?: Product[]
121
117
  }
122
118
 
123
- export type CreateOrderRequest = {
124
- username?: string
125
- productId?: string
119
+ export type OrderItem = {
120
+ productName?: string
126
121
  skuId?: string
127
122
  quantity?: number
128
- instances?: string[]
123
+ instances?: Instance[]
124
+ }
125
+
126
+ export type CreateOrderRequest = {
127
+ username?: string
128
+ userId?: string
129
+ orderType?: OrderType
130
+ orderItems?: OrderItem[]
129
131
  }
130
132
 
131
133
  export type CreateOrderResponse = {
134
+ orderId?: string
135
+ }
136
+
137
+ export type GetInstanceOrderInfoByInstanceIDRequest = {
138
+ instanceId?: string
139
+ }
140
+
141
+ export type GetInstanceOrderInfoByInstanceIDResponse = {
142
+ instanceId?: string
143
+ instanceName?: string
144
+ username?: string
145
+ skuId?: string
146
+ productName?: string
147
+ billingType?: BillingType
148
+ meteringUnit?: UnitType
149
+ unitPrice?: number
150
+ quantity?: number
132
151
  }
133
152
 
134
153
  export class Order {
@@ -138,6 +157,9 @@ export class Order {
138
157
  static GetOrder(req: GetOrderRequest, initReq?: fm.InitReq): Promise<GetOrderResponse> {
139
158
  return fm.fetchReq<GetOrderRequest, GetOrderResponse>(`/apis/leopard.io/v1alpha1/orders/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
140
159
  }
160
+ static GetInstanceOrderInfoByInstanceID(req: GetInstanceOrderInfoByInstanceIDRequest, initReq?: fm.InitReq): Promise<GetInstanceOrderInfoByInstanceIDResponse> {
161
+ return fm.fetchReq<GetInstanceOrderInfoByInstanceIDRequest, GetInstanceOrderInfoByInstanceIDResponse>(`/apis/leopard.io/v1alpha1/orders/instances-info?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
162
+ }
141
163
  static GetProducts(req: GetProductsRequest, initReq?: fm.InitReq): Promise<GetProductsResponse> {
142
164
  return fm.fetchReq<GetProductsRequest, GetProductsResponse>(`/apis/leopard.io/v1alpha1/orders/products?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
143
165
  }
@@ -17,8 +17,8 @@ export enum UnitType {
17
17
  COMPUTE_UNIT = "COMPUTE_UNIT",
18
18
  }
19
19
 
20
- export enum Currency {
21
- CNY = "CNY",
20
+ export enum QuantityUnit {
21
+ EMPTY = "EMPTY",
22
22
  }
23
23
 
24
24
  export type Pagination = {
@@ -31,7 +31,7 @@ export type FilterStringArr = {
31
31
  values?: string[]
32
32
  }
33
33
 
34
- export type ListProductSkusRequest = {
34
+ export type ListProductSKUsRequest = {
35
35
  product?: string
36
36
  regionId?: string
37
37
  filter?: {[key: string]: FilterStringArr}
@@ -43,62 +43,59 @@ export type SkuItem = {
43
43
  id?: string
44
44
  saleable?: boolean
45
45
  billingType?: BillingType
46
- unit?: UnitType
46
+ meteringUnit?: UnitType
47
+ quantityUnit?: QuantityUnit
47
48
  price?: number
48
49
  region?: string
49
- specId?: string
50
+ specId?: number
50
51
  specName?: string
51
52
  specDetails?: {[key: string]: string}
52
53
  }
53
54
 
54
- export type ListProductSkusResponse = {
55
+ export type ListProductSKUsResponse = {
55
56
  items?: SkuItem[]
56
57
  pagination?: Pagination
57
58
  }
58
59
 
59
- export type GetProductSkuRequest = {
60
+ export type GetSKURequest = {
60
61
  id?: string
61
62
  }
62
63
 
63
- export type GetProductSkuResponse = {
64
+ export type SpecField = {
65
+ specId?: number
66
+ key?: string
67
+ value?: string
68
+ }
69
+
70
+ export type GetSKUResponse = {
64
71
  id?: string
65
72
  saleable?: boolean
66
73
  billingType?: BillingType
67
- unit?: UnitType
74
+ meteringUnit?: UnitType
75
+ quantityUnit?: QuantityUnit
68
76
  price?: number
69
77
  region?: string
70
- specId?: string
78
+ specId?: number
71
79
  specName?: string
72
- specDetails?: {[key: string]: string}
80
+ specFields?: SpecField[]
73
81
  }
74
82
 
75
- export type ListProductSpecDetailValuesRequest = {
76
- regionId?: string
77
- resourceKey?: string
78
- product?: string
79
- }
80
-
81
- export type ProductSpecDetailValueItem = {
83
+ export type GetSKUPriceRequest = {
82
84
  id?: string
83
- name?: string
84
- }
85
-
86
- export type ProductSpecDetailValuesArr = {
87
- items?: ProductSpecDetailValueItem[]
88
85
  }
89
86
 
90
- export type ListProductSpecDetailValuesResponse = {
91
- valuesMap?: {[key: string]: ProductSpecDetailValuesArr}
87
+ export type GetSKUPriceResponse = {
88
+ price?: string
92
89
  }
93
90
 
94
91
  export class Product {
95
- static ListProductSkus(req: ListProductSkusRequest, initReq?: fm.InitReq): Promise<ListProductSkusResponse> {
96
- return fm.fetchReq<ListProductSkusRequest, ListProductSkusResponse>(`/apis/leopard.io/v1alpha1/product/${req["product"]}/skus?${fm.renderURLSearchParams(req, ["product"])}`, {...initReq, method: "GET"})
92
+ static ListProductSKUs(req: ListProductSKUsRequest, initReq?: fm.InitReq): Promise<ListProductSKUsResponse> {
93
+ return fm.fetchReq<ListProductSKUsRequest, ListProductSKUsResponse>(`/apis/leopard.io/v1alpha1/products/skus`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
97
94
  }
98
- static GetProductSku(req: GetProductSkuRequest, initReq?: fm.InitReq): Promise<GetProductSkuResponse> {
99
- return fm.fetchReq<GetProductSkuRequest, GetProductSkuResponse>(`/apis/leopard.io/v1alpha1/product/skus/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
95
+ static GetSKU(req: GetSKURequest, initReq?: fm.InitReq): Promise<GetSKUResponse> {
96
+ return fm.fetchReq<GetSKURequest, GetSKUResponse>(`/apis/leopard.io/v1alpha1/products/skus/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
100
97
  }
101
- static ListProductSpecDetailValues(req: ListProductSpecDetailValuesRequest, initReq?: fm.InitReq): Promise<ListProductSpecDetailValuesResponse> {
102
- return fm.fetchReq<ListProductSpecDetailValuesRequest, ListProductSpecDetailValuesResponse>(`/apis/leopard.io/v1alpha1/products/${req["product"]}/values?${fm.renderURLSearchParams(req, ["product"])}`, {...initReq, method: "GET"})
98
+ static GetSKUPrice(req: GetSKUPriceRequest, initReq?: fm.InitReq): Promise<GetSKUPriceResponse> {
99
+ return fm.fetchReq<GetSKUPriceRequest, GetSKUPriceResponse>(`/apis/leopard.io/v1alpha1/products/skus/${req["id"]}/price?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
103
100
  }
104
101
  }
@@ -20,7 +20,7 @@ export type BalanceRequest = {
20
20
  }
21
21
 
22
22
  export type BalanceResponse = {
23
- balance?: number
23
+ balance?: string
24
24
  }
25
25
 
26
26
  export type RechargeRequest = {
@@ -35,13 +35,6 @@ export type RechargeResponse = {
35
35
  redirectUrl?: string
36
36
  }
37
37
 
38
- export type AlipayNotifyRequest = {
39
- }
40
-
41
- export type AlipayNotifyResponse = {
42
- message?: string
43
- }
44
-
45
38
  export class Wallet {
46
39
  static Balance(req: BalanceRequest, initReq?: fm.InitReq): Promise<BalanceResponse> {
47
40
  return fm.fetchReq<BalanceRequest, BalanceResponse>(`/apis/leopard.io/v1alpha1/wallet/balance?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
@@ -49,7 +42,4 @@ export class Wallet {
49
42
  static Recharge(req: RechargeRequest, initReq?: fm.InitReq): Promise<RechargeResponse> {
50
43
  return fm.fetchReq<RechargeRequest, RechargeResponse>(`/apis/leopard.io/v1alpha1/wallet/recharge`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
51
44
  }
52
- static AlipayNotify(req: AlipayNotifyRequest, initReq?: fm.InitReq): Promise<AlipayNotifyResponse> {
53
- return fm.fetchReq<AlipayNotifyRequest, AlipayNotifyResponse>(`/apis/leopard.io/v1alpha1/wallet/alipay/notify`, {...initReq, method: "POST"})
54
- }
55
45
  }