@daocloud-proto/leopard 0.8.1 → 0.9.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 +1 -1
- package/v1alpha1/account.pb.ts +28 -0
- package/v1alpha1/bill.pb.ts +26 -0
- package/v1alpha1/export.pb.ts +37 -0
- package/v1alpha1/order.pb.ts +16 -0
- package/v1alpha1/product.pb.ts +38 -0
- package/v1alpha1/transaction.pb.ts +15 -0
package/package.json
CHANGED
package/v1alpha1/account.pb.ts
CHANGED
|
@@ -5,6 +5,22 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as fm from "../fetch.pb"
|
|
8
|
+
|
|
9
|
+
export enum Modules {
|
|
10
|
+
bills = "bills",
|
|
11
|
+
monthly_bills = "monthly_bills",
|
|
12
|
+
orders = "orders",
|
|
13
|
+
transactions = "transactions",
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export enum RequestMethod {
|
|
17
|
+
GET = "GET",
|
|
18
|
+
POST = "POST",
|
|
19
|
+
PUT = "PUT",
|
|
20
|
+
DELETE = "DELETE",
|
|
21
|
+
PATCH = "PATCH",
|
|
22
|
+
}
|
|
23
|
+
|
|
8
24
|
export type ListCurrentMembersRequest = {
|
|
9
25
|
page?: number
|
|
10
26
|
pageSize?: number
|
|
@@ -26,8 +42,20 @@ export type Pagination = {
|
|
|
26
42
|
pageSize?: number
|
|
27
43
|
}
|
|
28
44
|
|
|
45
|
+
export type GetExportURLRequest = {
|
|
46
|
+
module?: Modules
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type GetExportURLResponse = {
|
|
50
|
+
url?: string
|
|
51
|
+
method?: RequestMethod
|
|
52
|
+
}
|
|
53
|
+
|
|
29
54
|
export class Account {
|
|
30
55
|
static ListCurrentMembers(req: ListCurrentMembersRequest, initReq?: fm.InitReq): Promise<ListCurrentMembersResponse> {
|
|
31
56
|
return fm.fetchReq<ListCurrentMembersRequest, ListCurrentMembersResponse>(`/apis/leopard.io/v1alpha1/accounts/current/members?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
32
57
|
}
|
|
58
|
+
static GetExportURL(req: GetExportURLRequest, initReq?: fm.InitReq): Promise<GetExportURLResponse> {
|
|
59
|
+
return fm.fetchReq<GetExportURLRequest, GetExportURLResponse>(`/apis/leopard.io/v1alpha1/export/url?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
60
|
+
}
|
|
33
61
|
}
|
package/v1alpha1/bill.pb.ts
CHANGED
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as fm from "../fetch.pb"
|
|
8
|
+
import * as GoogleApiHttpbody from "../google/api/httpbody.pb"
|
|
9
|
+
|
|
10
|
+
export enum ExportTypes {
|
|
11
|
+
excel = "excel",
|
|
12
|
+
}
|
|
8
13
|
|
|
9
14
|
export enum BillType {
|
|
10
15
|
CONSUME = "CONSUME",
|
|
@@ -36,6 +41,20 @@ export enum ExpenseType {
|
|
|
36
41
|
Refund = "Refund",
|
|
37
42
|
}
|
|
38
43
|
|
|
44
|
+
export type ExportBillsReportRequest = {
|
|
45
|
+
accountId?: string
|
|
46
|
+
productName?: string
|
|
47
|
+
start?: string
|
|
48
|
+
end?: string
|
|
49
|
+
exportType?: ExportTypes
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type ExportMonthlyBillsReportRequest = {
|
|
53
|
+
startMonth?: string
|
|
54
|
+
endMonth?: string
|
|
55
|
+
exportType?: ExportTypes
|
|
56
|
+
}
|
|
57
|
+
|
|
39
58
|
export type ListBillsRequest = {
|
|
40
59
|
start?: string
|
|
41
60
|
end?: string
|
|
@@ -116,6 +135,7 @@ export type GetMonthlyBillsRequest = {
|
|
|
116
135
|
export type GetMonthlyBillsResponse = {
|
|
117
136
|
products?: ProductMonthlyBill[]
|
|
118
137
|
users?: UserMonthlyBill[]
|
|
138
|
+
regions?: RegionMonthlyBill[]
|
|
119
139
|
}
|
|
120
140
|
|
|
121
141
|
export type RegionMonthlyBill = {
|
|
@@ -154,4 +174,10 @@ export class Bill {
|
|
|
154
174
|
static GetMonthlyBills(req: GetMonthlyBillsRequest, initReq?: fm.InitReq): Promise<GetMonthlyBillsResponse> {
|
|
155
175
|
return fm.fetchReq<GetMonthlyBillsRequest, GetMonthlyBillsResponse>(`/apis/leopard.io/v1alpha1/bills/monthly/${req["billingMonth"]}?${fm.renderURLSearchParams(req, ["billingMonth"])}`, {...initReq, method: "GET"})
|
|
156
176
|
}
|
|
177
|
+
static ExportBills(req: ExportBillsReportRequest, initReq?: fm.InitReq): Promise<GoogleApiHttpbody.HttpBody> {
|
|
178
|
+
return fm.fetchReq<ExportBillsReportRequest, GoogleApiHttpbody.HttpBody>(`/apis/leopard.io/v1alpha1/export/bills?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
179
|
+
}
|
|
180
|
+
static ExportMonthlyBills(req: ExportMonthlyBillsReportRequest, initReq?: fm.InitReq): Promise<GoogleApiHttpbody.HttpBody> {
|
|
181
|
+
return fm.fetchReq<ExportMonthlyBillsReportRequest, GoogleApiHttpbody.HttpBody>(`/apis/leopard.io/v1alpha1/export/bills/monthly?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
182
|
+
}
|
|
157
183
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 Modules {
|
|
10
|
+
bills = "bills",
|
|
11
|
+
monthly_bills = "monthly_bills",
|
|
12
|
+
orders = "orders",
|
|
13
|
+
transactions = "transactions",
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export enum RequestMethod {
|
|
17
|
+
GET = "GET",
|
|
18
|
+
POST = "POST",
|
|
19
|
+
PUT = "PUT",
|
|
20
|
+
DELETE = "DELETE",
|
|
21
|
+
PATCH = "PATCH",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type GetExportURLRequest = {
|
|
25
|
+
module?: Modules
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type GetExportURLResponse = {
|
|
29
|
+
url?: string
|
|
30
|
+
method?: RequestMethod
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export class export {
|
|
34
|
+
static GetExportURL(req: GetExportURLRequest, initReq?: fm.InitReq): Promise<GetExportURLResponse> {
|
|
35
|
+
return fm.fetchReq<GetExportURLRequest, GetExportURLResponse>(`/apis/leopard.io/v1alpha1/export/url?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
36
|
+
}
|
|
37
|
+
}
|
package/v1alpha1/order.pb.ts
CHANGED
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as fm from "../fetch.pb"
|
|
8
|
+
import * as GoogleApiHttpbody from "../google/api/httpbody.pb"
|
|
9
|
+
|
|
10
|
+
export enum ExportTypes {
|
|
11
|
+
excel = "excel",
|
|
12
|
+
}
|
|
8
13
|
|
|
9
14
|
export enum OrderType {
|
|
10
15
|
PURCHASE = "PURCHASE",
|
|
@@ -49,6 +54,14 @@ export enum CreateOrderStatus {
|
|
|
49
54
|
INSUFFICIENT_INVENTORY = "INSUFFICIENT_INVENTORY",
|
|
50
55
|
}
|
|
51
56
|
|
|
57
|
+
export type ExportOrdersRequest = {
|
|
58
|
+
accountId?: string
|
|
59
|
+
productName?: string
|
|
60
|
+
start?: string
|
|
61
|
+
end?: string
|
|
62
|
+
exportType?: ExportTypes
|
|
63
|
+
}
|
|
64
|
+
|
|
52
65
|
export type Pagination = {
|
|
53
66
|
total?: number
|
|
54
67
|
page?: number
|
|
@@ -272,4 +285,7 @@ export class Order {
|
|
|
272
285
|
static InvalidateOrder(req: InvalidateOrderRequest, initReq?: fm.InitReq): Promise<InvalidateOrderResponse> {
|
|
273
286
|
return fm.fetchReq<InvalidateOrderRequest, InvalidateOrderResponse>(`/v1alpha1.order.Order/InvalidateOrder`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
274
287
|
}
|
|
288
|
+
static ExportOrders(req: ExportOrdersRequest, initReq?: fm.InitReq): Promise<GoogleApiHttpbody.HttpBody> {
|
|
289
|
+
return fm.fetchReq<ExportOrdersRequest, GoogleApiHttpbody.HttpBody>(`/apis/leopard.io/v1alpha1/export/orders?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
290
|
+
}
|
|
275
291
|
}
|
package/v1alpha1/product.pb.ts
CHANGED
|
@@ -35,6 +35,33 @@ export enum SortOrder {
|
|
|
35
35
|
DESC = "DESC",
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
export type CreateDiscountRuleRequest = {
|
|
39
|
+
name?: string
|
|
40
|
+
meteringAmountsDiscounts?: string
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type CreateDiscountRuleResponse = {
|
|
44
|
+
discountRuleId?: string
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type GetDiscountRuleRequest = {
|
|
48
|
+
id?: string
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type GetDiscountRuleResponse = {
|
|
52
|
+
id?: string
|
|
53
|
+
name?: string
|
|
54
|
+
meteringAmountsDiscounts?: MeteringAmountsDiscount[]
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type UpdateSKUDiscountRuleRequest = {
|
|
58
|
+
skuId?: string
|
|
59
|
+
discountRuleId?: string
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export type UpdateSKUDiscountRuleResponse = {
|
|
63
|
+
}
|
|
64
|
+
|
|
38
65
|
export type Pagination = {
|
|
39
66
|
total?: number
|
|
40
67
|
page?: number
|
|
@@ -294,6 +321,7 @@ export type CreateSKUInfoRequest = {
|
|
|
294
321
|
description?: string
|
|
295
322
|
available?: number
|
|
296
323
|
displayOrder?: number
|
|
324
|
+
discountRuleId?: string
|
|
297
325
|
}
|
|
298
326
|
|
|
299
327
|
export type CreateSKUInfoResponse = {
|
|
@@ -311,6 +339,7 @@ export type UpdateSKUInfoRequest = {
|
|
|
311
339
|
description?: string
|
|
312
340
|
available?: number
|
|
313
341
|
displayOrder?: number
|
|
342
|
+
discountRuleId?: string
|
|
314
343
|
}
|
|
315
344
|
|
|
316
345
|
export type UpdateSKUInfoResponse = {
|
|
@@ -378,4 +407,13 @@ export class Product {
|
|
|
378
407
|
static DeleteSKUInfo(req: DeleteSKUInfoRequest, initReq?: fm.InitReq): Promise<DeleteSKUInfoResponse> {
|
|
379
408
|
return fm.fetchReq<DeleteSKUInfoRequest, DeleteSKUInfoResponse>(`/apis/leopard.io/v1alpha1/products/sku-infos/${req["id"]}`, {...initReq, method: "DELETE"})
|
|
380
409
|
}
|
|
410
|
+
static CreateDiscountRule(req: CreateDiscountRuleRequest, initReq?: fm.InitReq): Promise<CreateDiscountRuleResponse> {
|
|
411
|
+
return fm.fetchReq<CreateDiscountRuleRequest, CreateDiscountRuleResponse>(`/apis/leopard.io/v1alpha1/products/discounts`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
412
|
+
}
|
|
413
|
+
static GetDiscountRule(req: GetDiscountRuleRequest, initReq?: fm.InitReq): Promise<GetDiscountRuleResponse> {
|
|
414
|
+
return fm.fetchReq<GetDiscountRuleRequest, GetDiscountRuleResponse>(`/apis/leopard.io/v1alpha1/products/discounts/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
|
|
415
|
+
}
|
|
416
|
+
static UpdateSKUDiscountRule(req: UpdateSKUDiscountRuleRequest, initReq?: fm.InitReq): Promise<UpdateSKUDiscountRuleResponse> {
|
|
417
|
+
return fm.fetchReq<UpdateSKUDiscountRuleRequest, UpdateSKUDiscountRuleResponse>(`/apis/leopard.io/v1alpha1/products/sku-infos/${req["skuId"]}/discount`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
418
|
+
}
|
|
381
419
|
}
|
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as fm from "../fetch.pb"
|
|
8
|
+
import * as GoogleApiHttpbody from "../google/api/httpbody.pb"
|
|
9
|
+
|
|
10
|
+
export enum ExportTypes {
|
|
11
|
+
excel = "excel",
|
|
12
|
+
}
|
|
8
13
|
|
|
9
14
|
export enum TransactionType {
|
|
10
15
|
Consume = "Consume",
|
|
@@ -23,6 +28,13 @@ export enum PaymentType {
|
|
|
23
28
|
Expense = "Expense",
|
|
24
29
|
}
|
|
25
30
|
|
|
31
|
+
export type ExportTransactionsRequest = {
|
|
32
|
+
accountId?: string
|
|
33
|
+
start?: string
|
|
34
|
+
end?: string
|
|
35
|
+
exportType?: ExportTypes
|
|
36
|
+
}
|
|
37
|
+
|
|
26
38
|
export type ListTransactionsRequest = {
|
|
27
39
|
start?: string
|
|
28
40
|
end?: string
|
|
@@ -64,4 +76,7 @@ export class Transaction {
|
|
|
64
76
|
static ListTransactions(req: ListTransactionsRequest, initReq?: fm.InitReq): Promise<ListTransactionsRequestResponse> {
|
|
65
77
|
return fm.fetchReq<ListTransactionsRequest, ListTransactionsRequestResponse>(`/apis/leopard.io/v1alpha1/transactions?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
66
78
|
}
|
|
79
|
+
static ExportTransactions(req: ExportTransactionsRequest, initReq?: fm.InitReq): Promise<GoogleApiHttpbody.HttpBody> {
|
|
80
|
+
return fm.fetchReq<ExportTransactionsRequest, GoogleApiHttpbody.HttpBody>(`/apis/leopard.io/v1alpha1/export/transactions?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
81
|
+
}
|
|
67
82
|
}
|