@daocloud-proto/leopard 0.1.0-dev10 → 0.1.0-dev12
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 +1 -1
- package/v1alpha1/order.pb.ts +33 -11
- package/v1alpha1/product.pb.ts +0 -3
- package/v1alpha1/sku.pb.ts +101 -0
- package/v1alpha1/wallet.pb.ts +1 -11
package/package.json
CHANGED
package/v1alpha1/order.pb.ts
CHANGED
|
@@ -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
|
|
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?:
|
|
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
|
-
|
|
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
|
|
124
|
-
|
|
125
|
-
productId?: string
|
|
119
|
+
export type OrderItem = {
|
|
120
|
+
productName?: string
|
|
126
121
|
skuId?: string
|
|
127
122
|
quantity?: number
|
|
128
|
-
instances?:
|
|
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
|
}
|
package/v1alpha1/product.pb.ts
CHANGED
|
@@ -92,9 +92,6 @@ export type ListProductSpecDetailValuesResponse = {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
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"})
|
|
97
|
-
}
|
|
98
95
|
static GetProductSku(req: GetProductSkuRequest, initReq?: fm.InitReq): Promise<GetProductSkuResponse> {
|
|
99
96
|
return fm.fetchReq<GetProductSkuRequest, GetProductSkuResponse>(`/apis/leopard.io/v1alpha1/product/skus/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
|
|
100
97
|
}
|
|
@@ -0,0 +1,101 @@
|
|
|
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 BillingType {
|
|
10
|
+
PAY_AS_YOU_GO = "PAY_AS_YOU_GO",
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export enum UnitType {
|
|
14
|
+
HOUR = "HOUR",
|
|
15
|
+
THOUSAND_TOKENS = "THOUSAND_TOKENS",
|
|
16
|
+
GB_DAY = "GB_DAY",
|
|
17
|
+
COMPUTE_UNIT = "COMPUTE_UNIT",
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export enum QuantityUnit {
|
|
21
|
+
EMPTY = "EMPTY",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type Pagination = {
|
|
25
|
+
total?: number
|
|
26
|
+
page?: number
|
|
27
|
+
pageSize?: number
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type FilterStringArr = {
|
|
31
|
+
values?: string[]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type ListProductSKUsRequest = {
|
|
35
|
+
product?: string
|
|
36
|
+
regionId?: string
|
|
37
|
+
filter?: {[key: string]: FilterStringArr}
|
|
38
|
+
page?: number
|
|
39
|
+
pageSize?: number
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export type SkuItem = {
|
|
43
|
+
id?: string
|
|
44
|
+
saleable?: boolean
|
|
45
|
+
billingType?: BillingType
|
|
46
|
+
meteringUnit?: UnitType
|
|
47
|
+
quantityUnit?: QuantityUnit
|
|
48
|
+
price?: number
|
|
49
|
+
region?: string
|
|
50
|
+
specId?: number
|
|
51
|
+
specName?: string
|
|
52
|
+
specDetails?: {[key: string]: string}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type ListProductSKUsResponse = {
|
|
56
|
+
items?: SkuItem[]
|
|
57
|
+
pagination?: Pagination
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type GetSKURequest = {
|
|
61
|
+
id?: string
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export type SpecField = {
|
|
65
|
+
specId?: number
|
|
66
|
+
key?: string
|
|
67
|
+
value?: string
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type GetSKUResponse = {
|
|
71
|
+
id?: string
|
|
72
|
+
saleable?: boolean
|
|
73
|
+
billingType?: BillingType
|
|
74
|
+
meteringUnit?: UnitType
|
|
75
|
+
quantityUnit?: QuantityUnit
|
|
76
|
+
price?: number
|
|
77
|
+
region?: string
|
|
78
|
+
specId?: number
|
|
79
|
+
specName?: string
|
|
80
|
+
specFields?: SpecField[]
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type GetSKUPriceRequest = {
|
|
84
|
+
id?: string
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export type GetSKUPriceResponse = {
|
|
88
|
+
price?: string
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export class SKU {
|
|
92
|
+
static ListProductSKUs(req: ListProductSKUsRequest, initReq?: fm.InitReq): Promise<ListProductSKUsResponse> {
|
|
93
|
+
return fm.fetchReq<ListProductSKUsRequest, ListProductSKUsResponse>(`/apis/leopard.io/v1alpha1/skus?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
94
|
+
}
|
|
95
|
+
static GetSKU(req: GetSKURequest, initReq?: fm.InitReq): Promise<GetSKUResponse> {
|
|
96
|
+
return fm.fetchReq<GetSKURequest, GetSKUResponse>(`/apis/leopard.io/v1alpha1/skus/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
|
|
97
|
+
}
|
|
98
|
+
static GetSKUPrice(req: GetSKUPriceRequest, initReq?: fm.InitReq): Promise<GetSKUPriceResponse> {
|
|
99
|
+
return fm.fetchReq<GetSKUPriceRequest, GetSKUPriceResponse>(`/apis/leopard.io/v1alpha1/skus/${req["id"]}/price?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
|
|
100
|
+
}
|
|
101
|
+
}
|
package/v1alpha1/wallet.pb.ts
CHANGED
|
@@ -20,7 +20,7 @@ export type BalanceRequest = {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export type BalanceResponse = {
|
|
23
|
-
balance?:
|
|
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
|
}
|