@daocloud-proto/leopard 0.1.0-dev3 → 0.1.0-dev32
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/bill.pb.ts +77 -0
- package/v1alpha1/inventory.pb.ts +40 -0
- package/v1alpha1/order.pb.ts +91 -33
- package/v1alpha1/product.pb.ts +138 -0
- package/v1alpha1/transaction.pb.ts +3 -3
- package/v1alpha1/wallet.pb.ts +11 -10
- package/v1alpha1/billing.pb.ts +0 -75
- package/v1alpha1/hello.pb.ts +0 -19
package/package.json
CHANGED
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
SUBSCRIPTION_DAILY = "SUBSCRIPTION_DAILY",
|
|
12
|
+
SUBSCRIPTION_WEEKLY = "SUBSCRIPTION_WEEKLY",
|
|
13
|
+
SUBSCRIPTION_MONTHLY = "SUBSCRIPTION_MONTHLY",
|
|
14
|
+
SUBSCRIPTION_YEARLY = "SUBSCRIPTION_YEARLY",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export enum UnitType {
|
|
18
|
+
HOUR = "HOUR",
|
|
19
|
+
THOUSAND_TOKENS = "THOUSAND_TOKENS",
|
|
20
|
+
GB_DAY = "GB_DAY",
|
|
21
|
+
COMPUTE_UNIT = "COMPUTE_UNIT",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type ListBillsRequest = {
|
|
25
|
+
start?: string
|
|
26
|
+
end?: string
|
|
27
|
+
page?: number
|
|
28
|
+
pageSize?: number
|
|
29
|
+
billId?: string
|
|
30
|
+
orderId?: string
|
|
31
|
+
resourceId?: string
|
|
32
|
+
billingType?: string
|
|
33
|
+
productName?: string
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type ListBillsResponse = {
|
|
37
|
+
items?: bill[]
|
|
38
|
+
pagination?: Pagination
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type Pagination = {
|
|
42
|
+
total?: number
|
|
43
|
+
page?: number
|
|
44
|
+
pageSize?: number
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type bill = {
|
|
48
|
+
username?: string
|
|
49
|
+
billId?: string
|
|
50
|
+
billingCycle?: BillingCycle
|
|
51
|
+
billingMonth?: string
|
|
52
|
+
productName?: string
|
|
53
|
+
resources?: Resource[]
|
|
54
|
+
billingType?: BillingType
|
|
55
|
+
unitPrice?: string
|
|
56
|
+
unit?: UnitType
|
|
57
|
+
orderId?: string
|
|
58
|
+
orderPrice?: string
|
|
59
|
+
couponPayment?: string
|
|
60
|
+
amountDue?: string
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export type BillingCycle = {
|
|
64
|
+
startTimestamp?: string
|
|
65
|
+
endTimestamp?: string
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type Resource = {
|
|
69
|
+
name?: string
|
|
70
|
+
id?: string
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export class Bill {
|
|
74
|
+
static ListBills(req: ListBillsRequest, initReq?: fm.InitReq): Promise<ListBillsResponse> {
|
|
75
|
+
return fm.fetchReq<ListBillsRequest, ListBillsResponse>(`/apis/leopard.io/v1alpha1/bills?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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 Action {
|
|
10
|
+
AddOrUpdate = "AddOrUpdate",
|
|
11
|
+
Delete = "Delete",
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type UpdateInventoryRequest = {
|
|
15
|
+
action?: Action
|
|
16
|
+
inventory?: inventory
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type inventory = {
|
|
20
|
+
region?: string
|
|
21
|
+
node?: string
|
|
22
|
+
resources?: resource[]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type resource = {
|
|
26
|
+
specFieldKey?: string
|
|
27
|
+
specFieldValue?: string
|
|
28
|
+
total?: number
|
|
29
|
+
free?: number
|
|
30
|
+
serial?: string
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type UpdateInventoryResponse = {
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export class Inventory {
|
|
37
|
+
static UpdateInventory(req: UpdateInventoryRequest, initReq?: fm.InitReq): Promise<UpdateInventoryResponse> {
|
|
38
|
+
return fm.fetchReq<UpdateInventoryRequest, UpdateInventoryResponse>(`/v1alpha1.inventory.Inventory/UpdateInventory`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
39
|
+
}
|
|
40
|
+
}
|
package/v1alpha1/order.pb.ts
CHANGED
|
@@ -7,31 +7,39 @@
|
|
|
7
7
|
import * as fm from "../fetch.pb"
|
|
8
8
|
|
|
9
9
|
export enum OrderType {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
PURCHASE = "PURCHASE",
|
|
11
|
+
REFUND = "REFUND",
|
|
12
|
+
UPGRADE = "UPGRADE",
|
|
13
|
+
DOWNGRADE = "DOWNGRADE",
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export enum BillingType {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
PAY_AS_YOU_GO = "PAY_AS_YOU_GO",
|
|
18
|
+
SUBSCRIPTION_DAILY = "SUBSCRIPTION_DAILY",
|
|
19
|
+
SUBSCRIPTION_WEEKLY = "SUBSCRIPTION_WEEKLY",
|
|
20
|
+
SUBSCRIPTION_MONTHLY = "SUBSCRIPTION_MONTHLY",
|
|
21
|
+
SUBSCRIPTION_YEARLY = "SUBSCRIPTION_YEARLY",
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export enum OrderStatus {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
PAID = "PAID",
|
|
26
|
+
PARTIAL = "PARTIAL",
|
|
27
|
+
REFUNDED = "REFUNDED",
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export enum UnitType {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
HOUR = "HOUR",
|
|
32
|
+
THOUSAND_TOKENS = "THOUSAND_TOKENS",
|
|
33
|
+
GB_DAY = "GB_DAY",
|
|
34
|
+
COMPUTE_UNIT = "COMPUTE_UNIT",
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export enum CreateOrderStatus {
|
|
38
|
+
SUCCESS = "SUCCESS",
|
|
39
|
+
SKU_NOT_FIND = "SKU_NOT_FIND",
|
|
40
|
+
RESOURCE_NOT_EXIST = "RESOURCE_NOT_EXIST",
|
|
41
|
+
RESOURCE_EXIST = "RESOURCE_EXIST",
|
|
42
|
+
INSUFFICIENT_BALANCE = "INSUFFICIENT_BALANCE",
|
|
35
43
|
}
|
|
36
44
|
|
|
37
45
|
export type Pagination = {
|
|
@@ -42,34 +50,30 @@ export type Pagination = {
|
|
|
42
50
|
|
|
43
51
|
export type ListOrdersRequest = {
|
|
44
52
|
orderId?: string
|
|
45
|
-
|
|
46
|
-
orderType?:
|
|
53
|
+
resourceId?: string
|
|
54
|
+
orderType?: string
|
|
47
55
|
productName?: string
|
|
48
|
-
|
|
49
|
-
orderStatus?: OrderStatus
|
|
56
|
+
orderStatus?: string
|
|
50
57
|
start?: string
|
|
51
58
|
end?: string
|
|
52
59
|
page?: number
|
|
53
60
|
pageSize?: number
|
|
54
61
|
}
|
|
55
62
|
|
|
56
|
-
export type
|
|
63
|
+
export type Orders = {
|
|
57
64
|
userName?: string
|
|
58
65
|
orderId?: string
|
|
59
66
|
createdAtTimestamp?: string
|
|
60
67
|
orderType?: OrderType
|
|
61
68
|
productName?: string
|
|
62
|
-
|
|
69
|
+
resources?: Resource[]
|
|
63
70
|
orderStatus?: OrderStatus
|
|
64
|
-
billingType?: BillingType
|
|
65
|
-
unitPrice?: number
|
|
66
|
-
unit?: UnitType
|
|
67
71
|
orderPrice?: string
|
|
68
72
|
amountDue?: string
|
|
69
73
|
}
|
|
70
74
|
|
|
71
75
|
export type ListOrdersResponse = {
|
|
72
|
-
items?:
|
|
76
|
+
items?: Orders[]
|
|
73
77
|
pagination?: Pagination
|
|
74
78
|
}
|
|
75
79
|
|
|
@@ -77,22 +81,20 @@ export type OrderInfo = {
|
|
|
77
81
|
orderId?: string
|
|
78
82
|
createdAtTimestamp?: string
|
|
79
83
|
orderType?: OrderType
|
|
80
|
-
billingType?: BillingType
|
|
81
84
|
orderStatus?: OrderStatus
|
|
82
|
-
region?: string
|
|
83
85
|
orderPrice?: string
|
|
84
86
|
amountDue?: string
|
|
85
87
|
}
|
|
86
88
|
|
|
87
|
-
export type
|
|
89
|
+
export type Resource = {
|
|
88
90
|
name?: string
|
|
89
91
|
id?: string
|
|
90
92
|
}
|
|
91
93
|
|
|
92
94
|
export type ProductInfo = {
|
|
93
|
-
|
|
95
|
+
resources?: Resource[]
|
|
94
96
|
productName?: string
|
|
95
|
-
|
|
97
|
+
resourceNum?: number
|
|
96
98
|
specification?: string
|
|
97
99
|
billingType?: BillingType
|
|
98
100
|
start?: string
|
|
@@ -105,14 +107,61 @@ export type GetOrderRequest = {
|
|
|
105
107
|
|
|
106
108
|
export type GetOrderResponse = {
|
|
107
109
|
orderInfo?: OrderInfo
|
|
108
|
-
productInfo?: ProductInfo
|
|
110
|
+
productInfo?: ProductInfo[]
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export type Product = {
|
|
114
|
+
id?: string
|
|
115
|
+
name?: string
|
|
109
116
|
}
|
|
110
117
|
|
|
111
118
|
export type GetProductsRequest = {
|
|
112
119
|
}
|
|
113
120
|
|
|
114
121
|
export type GetProductsResponse = {
|
|
115
|
-
|
|
122
|
+
products?: Product[]
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export type OrderItem = {
|
|
126
|
+
productName?: string
|
|
127
|
+
skuId?: string
|
|
128
|
+
quantity?: number
|
|
129
|
+
resources?: Resource[]
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export type CreateNewPurchaseOrderRequest = {
|
|
133
|
+
username?: string
|
|
134
|
+
userId?: string
|
|
135
|
+
orderItems?: OrderItem[]
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export type CreateNewPurchaseOrderResponse = {
|
|
139
|
+
orderId?: string
|
|
140
|
+
createOrderStatus?: CreateOrderStatus
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export type CreateQuantityChangeOrderRequest = {
|
|
144
|
+
username?: string
|
|
145
|
+
userId?: string
|
|
146
|
+
productName?: string
|
|
147
|
+
quantity?: number
|
|
148
|
+
resourceId?: string
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export type CreateQuantityChangeOrderResponse = {
|
|
152
|
+
orderId?: string
|
|
153
|
+
createOrderStatus?: CreateOrderStatus
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export type IsResourceOrderNextBillBalanceSufficientRequest = {
|
|
157
|
+
username?: string
|
|
158
|
+
userId?: string
|
|
159
|
+
productName?: string
|
|
160
|
+
resourceId?: string
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export type IsResourceOrderNextBillBalanceSufficientResponse = {
|
|
164
|
+
sufficient?: boolean
|
|
116
165
|
}
|
|
117
166
|
|
|
118
167
|
export class Order {
|
|
@@ -125,4 +174,13 @@ export class Order {
|
|
|
125
174
|
static GetProducts(req: GetProductsRequest, initReq?: fm.InitReq): Promise<GetProductsResponse> {
|
|
126
175
|
return fm.fetchReq<GetProductsRequest, GetProductsResponse>(`/apis/leopard.io/v1alpha1/orders/products?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
127
176
|
}
|
|
177
|
+
static CreateNewPurchaseOrder(req: CreateNewPurchaseOrderRequest, initReq?: fm.InitReq): Promise<CreateNewPurchaseOrderResponse> {
|
|
178
|
+
return fm.fetchReq<CreateNewPurchaseOrderRequest, CreateNewPurchaseOrderResponse>(`/apis/leopard.io/v1alpha1/orders/new-purchase`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
179
|
+
}
|
|
180
|
+
static CreateQuantityChangeOrder(req: CreateQuantityChangeOrderRequest, initReq?: fm.InitReq): Promise<CreateQuantityChangeOrderResponse> {
|
|
181
|
+
return fm.fetchReq<CreateQuantityChangeOrderRequest, CreateQuantityChangeOrderResponse>(`/apis/leopard.io/v1alpha1/orders/quantity-change`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
182
|
+
}
|
|
183
|
+
static IsResourceOrderNextBillBalanceSufficient(req: IsResourceOrderNextBillBalanceSufficientRequest, initReq?: fm.InitReq): Promise<IsResourceOrderNextBillBalanceSufficientResponse> {
|
|
184
|
+
return fm.fetchReq<IsResourceOrderNextBillBalanceSufficientRequest, IsResourceOrderNextBillBalanceSufficientResponse>(`/apis/leopard.io/v1alpha1/orders/is-resource-balance-sufficient`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
185
|
+
}
|
|
128
186
|
}
|
|
@@ -0,0 +1,138 @@
|
|
|
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
|
+
filterByAnd?: boolean
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type SkuItem = {
|
|
44
|
+
id?: string
|
|
45
|
+
saleable?: boolean
|
|
46
|
+
billingType?: BillingType
|
|
47
|
+
meteringUnit?: UnitType
|
|
48
|
+
quantityUnit?: QuantityUnit
|
|
49
|
+
price?: string
|
|
50
|
+
region?: string
|
|
51
|
+
specId?: number
|
|
52
|
+
specName?: string
|
|
53
|
+
specFields?: SpecField[]
|
|
54
|
+
inventory?: number
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type ListProductSKUsResponse = {
|
|
58
|
+
items?: SkuItem[]
|
|
59
|
+
pagination?: Pagination
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export type GetSKURequest = {
|
|
63
|
+
id?: string
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type I18nWithValue = {
|
|
67
|
+
value?: string
|
|
68
|
+
zhCnName?: string
|
|
69
|
+
enUsName?: string
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export type SpecField = {
|
|
73
|
+
specId?: number
|
|
74
|
+
key?: I18nWithValue
|
|
75
|
+
value?: I18nWithValue
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export type ListRegionsRequest = {
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type Region = {
|
|
82
|
+
regionId?: string
|
|
83
|
+
regionName?: string
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export type ListRegionsResponse = {
|
|
87
|
+
items?: Region[]
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export type GetSKUResponse = {
|
|
91
|
+
id?: string
|
|
92
|
+
saleable?: boolean
|
|
93
|
+
billingType?: BillingType
|
|
94
|
+
meteringUnit?: UnitType
|
|
95
|
+
quantityUnit?: QuantityUnit
|
|
96
|
+
price?: string
|
|
97
|
+
region?: string
|
|
98
|
+
specId?: number
|
|
99
|
+
specName?: string
|
|
100
|
+
specFields?: SpecField[]
|
|
101
|
+
inventory?: number
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export type GetSKUPriceRequest = {
|
|
105
|
+
id?: string
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export type GetSKUPriceResponse = {
|
|
109
|
+
price?: string
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export type ListProductSpecFieldRequest = {
|
|
113
|
+
regionId?: string
|
|
114
|
+
specKey?: string
|
|
115
|
+
product?: string
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export type ListProductSpecFieldResponse = {
|
|
119
|
+
specFields?: SpecField[]
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export class Product {
|
|
123
|
+
static ListProductSKUs(req: ListProductSKUsRequest, initReq?: fm.InitReq): Promise<ListProductSKUsResponse> {
|
|
124
|
+
return fm.fetchReq<ListProductSKUsRequest, ListProductSKUsResponse>(`/apis/leopard.io/v1alpha1/products/skus`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
125
|
+
}
|
|
126
|
+
static GetSKU(req: GetSKURequest, initReq?: fm.InitReq): Promise<GetSKUResponse> {
|
|
127
|
+
return fm.fetchReq<GetSKURequest, GetSKUResponse>(`/apis/leopard.io/v1alpha1/products/skus/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
|
|
128
|
+
}
|
|
129
|
+
static GetSKUPrice(req: GetSKUPriceRequest, initReq?: fm.InitReq): Promise<GetSKUPriceResponse> {
|
|
130
|
+
return fm.fetchReq<GetSKUPriceRequest, GetSKUPriceResponse>(`/apis/leopard.io/v1alpha1/products/skus/${req["id"]}/price?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
|
|
131
|
+
}
|
|
132
|
+
static ListRegions(req: ListRegionsRequest, initReq?: fm.InitReq): Promise<ListRegionsResponse> {
|
|
133
|
+
return fm.fetchReq<ListRegionsRequest, ListRegionsResponse>(`/apis/leopard.io/v1alpha1/products/regions?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
134
|
+
}
|
|
135
|
+
static ListProductSpecFieldValues(req: ListProductSpecFieldRequest, initReq?: fm.InitReq): Promise<ListProductSpecFieldResponse> {
|
|
136
|
+
return fm.fetchReq<ListProductSpecFieldRequest, ListProductSpecFieldResponse>(`/apis/leopard.io/v1alpha1/products/specs?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -29,9 +29,9 @@ export type ListTransactionsRequest = {
|
|
|
29
29
|
pageSize?: number
|
|
30
30
|
serialNumber?: string
|
|
31
31
|
billingId?: string
|
|
32
|
-
paymentType?:
|
|
33
|
-
transactionType?:
|
|
34
|
-
transactionChannel?:
|
|
32
|
+
paymentType?: string
|
|
33
|
+
transactionType?: string
|
|
34
|
+
transactionChannel?: string
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export type ListTransactionsRequestResponse = {
|
package/v1alpha1/wallet.pb.ts
CHANGED
|
@@ -7,20 +7,20 @@
|
|
|
7
7
|
import * as fm from "../fetch.pb"
|
|
8
8
|
|
|
9
9
|
export enum PaymentChannel {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
ALIPAY = "ALIPAY",
|
|
11
|
+
WECHAT = "WECHAT",
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export enum PaymentType {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
QR_CODE = "QR_CODE",
|
|
16
|
+
REDIRECT = "REDIRECT",
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
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,11 +35,12 @@ export type RechargeResponse = {
|
|
|
35
35
|
redirectUrl?: string
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
export type
|
|
38
|
+
export type UserStateRequest = {
|
|
39
|
+
userId?: string
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
export type
|
|
42
|
-
|
|
42
|
+
export type UserStateResponse = {
|
|
43
|
+
amount?: string
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
export class Wallet {
|
|
@@ -49,7 +50,7 @@ export class Wallet {
|
|
|
49
50
|
static Recharge(req: RechargeRequest, initReq?: fm.InitReq): Promise<RechargeResponse> {
|
|
50
51
|
return fm.fetchReq<RechargeRequest, RechargeResponse>(`/apis/leopard.io/v1alpha1/wallet/recharge`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
51
52
|
}
|
|
52
|
-
static
|
|
53
|
-
return fm.fetchReq<
|
|
53
|
+
static UserState(req: UserStateRequest, initReq?: fm.InitReq): Promise<UserStateResponse> {
|
|
54
|
+
return fm.fetchReq<UserStateRequest, UserStateResponse>(`/v1alpha1.wallet.Wallet/UserState`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
54
55
|
}
|
|
55
56
|
}
|
package/v1alpha1/billing.pb.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
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
|
-
PayAsYouGo = "PayAsYouGo",
|
|
11
|
-
SubscriptionDaily = "SubscriptionDaily",
|
|
12
|
-
SubscriptionWeekly = "SubscriptionWeekly",
|
|
13
|
-
SubscriptionMonthly = "SubscriptionMonthly",
|
|
14
|
-
SubscriptionYearly = "SubscriptionYearly",
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export enum UnitType {
|
|
18
|
-
Hour = "Hour",
|
|
19
|
-
ThousandTokens = "ThousandTokens",
|
|
20
|
-
GBDay = "GBDay",
|
|
21
|
-
ComputeUnit = "ComputeUnit",
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export type ListBillingsRequest = {
|
|
25
|
-
start?: string
|
|
26
|
-
end?: string
|
|
27
|
-
page?: number
|
|
28
|
-
pageSize?: number
|
|
29
|
-
billingId?: string
|
|
30
|
-
orderId?: string
|
|
31
|
-
instanceId?: string
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export type ListBillingsResponse = {
|
|
35
|
-
items?: billing[]
|
|
36
|
-
pagination?: Pagination
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export type Pagination = {
|
|
40
|
-
total?: number
|
|
41
|
-
page?: number
|
|
42
|
-
pageSize?: number
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export type billing = {
|
|
46
|
-
username?: string
|
|
47
|
-
billingId?: string
|
|
48
|
-
billingCycle?: BillingCycle
|
|
49
|
-
billingMonth?: string
|
|
50
|
-
productName?: string
|
|
51
|
-
instances?: Instance[]
|
|
52
|
-
billingType?: BillingType
|
|
53
|
-
unitPrice?: number
|
|
54
|
-
unit?: UnitType
|
|
55
|
-
orderId?: string
|
|
56
|
-
orderPrice?: string
|
|
57
|
-
couponPayment?: string
|
|
58
|
-
amountDue?: string
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export type BillingCycle = {
|
|
62
|
-
startTimestamp?: string
|
|
63
|
-
endTimestamp?: string
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export type Instance = {
|
|
67
|
-
name?: string
|
|
68
|
-
id?: string
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export class Billing {
|
|
72
|
-
static ListBillings(req: ListBillingsRequest, initReq?: fm.InitReq): Promise<ListBillingsResponse> {
|
|
73
|
-
return fm.fetchReq<ListBillingsRequest, ListBillingsResponse>(`/apis/leopard.io/v1alpha1/billings?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
74
|
-
}
|
|
75
|
-
}
|
package/v1alpha1/hello.pb.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
export type HelloRequest = {
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export type HelloResponse = {
|
|
12
|
-
message?: string
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export class Hello {
|
|
16
|
-
static Hello(req: HelloRequest, initReq?: fm.InitReq): Promise<HelloResponse> {
|
|
17
|
-
return fm.fetchReq<HelloRequest, HelloResponse>(`/apis/leopard.io/v1alpha1/hello?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
18
|
-
}
|
|
19
|
-
}
|