@daocloud-proto/leopard 0.1.0-dev34 → 0.1.0-dev36

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-dev34",
3
+ "version":"0.1.0-dev36",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -59,6 +59,7 @@ export type bill = {
59
59
  couponPayment?: string
60
60
  amountDue?: string
61
61
  billingItem?: string
62
+ voucherPayment?: string
62
63
  }
63
64
 
64
65
  export type BillingCycle = {
@@ -5,14 +5,7 @@
5
5
  */
6
6
 
7
7
  import * as fm from "../fetch.pb"
8
-
9
- export enum Action {
10
- AddOrUpdate = "AddOrUpdate",
11
- Delete = "Delete",
12
- }
13
-
14
8
  export type UpdateInventoryRequest = {
15
- action?: Action
16
9
  inventory?: inventory
17
10
  }
18
11
 
@@ -33,8 +26,31 @@ export type resource = {
33
26
  export type UpdateInventoryResponse = {
34
27
  }
35
28
 
29
+ export type ListInventoriesRequest = {
30
+ region?: string
31
+ node?: string
32
+ }
33
+
34
+ export type ListInventoriesResponse = {
35
+ resources?: resource[]
36
+ }
37
+
38
+ export type DeleteInventoryRequest = {
39
+ region?: string
40
+ node?: string
41
+ }
42
+
43
+ export type DeleteInventoryResponse = {
44
+ }
45
+
36
46
  export class Inventory {
37
47
  static UpdateInventory(req: UpdateInventoryRequest, initReq?: fm.InitReq): Promise<UpdateInventoryResponse> {
38
48
  return fm.fetchReq<UpdateInventoryRequest, UpdateInventoryResponse>(`/v1alpha1.inventory.Inventory/UpdateInventory`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
39
49
  }
50
+ static ListInventories(req: ListInventoriesRequest, initReq?: fm.InitReq): Promise<ListInventoriesResponse> {
51
+ return fm.fetchReq<ListInventoriesRequest, ListInventoriesResponse>(`/v1alpha1.inventory.Inventory/ListInventories`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
52
+ }
53
+ static DeleteInventory(req: DeleteInventoryRequest, initReq?: fm.InitReq): Promise<DeleteInventoryResponse> {
54
+ return fm.fetchReq<DeleteInventoryRequest, DeleteInventoryResponse>(`/v1alpha1.inventory.Inventory/DeleteInventory`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
55
+ }
40
56
  }
@@ -0,0 +1,93 @@
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 VoucherStatus {
10
+ Active = "Active",
11
+ UsedUp = "UsedUp",
12
+ Expired = "Expired",
13
+ }
14
+
15
+ export type BatchCreateVouchersRequest = {
16
+ description?: string
17
+ totalAmount?: string
18
+ effectiveDays?: number
19
+ quantity?: number
20
+ }
21
+
22
+ export type BatchCreateVouchersResponse = {
23
+ }
24
+
25
+ export type ListActiveVouchersByCurrentUserRequest = {
26
+ voucherId?: string
27
+ page?: number
28
+ pageSize?: number
29
+ }
30
+
31
+ export type ListExpiredVouchersByCurrentUserRequest = {
32
+ voucherId?: string
33
+ status?: string
34
+ page?: number
35
+ pageSize?: number
36
+ }
37
+
38
+ export type ListVouchersResponse = {
39
+ items?: VoucherInfo[]
40
+ pagination?: Pagination
41
+ }
42
+
43
+ export type Pagination = {
44
+ total?: number
45
+ page?: number
46
+ pageSize?: number
47
+ }
48
+
49
+ export type VoucherInfo = {
50
+ voucherId?: string
51
+ description?: string
52
+ status?: VoucherStatus
53
+ totalAmount?: string
54
+ remainingAmount?: string
55
+ regions?: string[]
56
+ products?: string[]
57
+ orderTypes?: string[]
58
+ effectTimestamp?: string
59
+ expireTimestamp?: string
60
+ }
61
+
62
+ export type ActivateVoucherRequest = {
63
+ voucherId?: string
64
+ }
65
+
66
+ export type ActivateVoucherResponse = {
67
+ }
68
+
69
+ export type GetVoucherStatByCurrentUserRequest = {
70
+ }
71
+
72
+ export type GetVoucherStatByCurrentUserResponse = {
73
+ amount?: string
74
+ count?: number
75
+ }
76
+
77
+ export class Voucher {
78
+ static BatchCreateVouchers(req: BatchCreateVouchersRequest, initReq?: fm.InitReq): Promise<BatchCreateVouchersResponse> {
79
+ return fm.fetchReq<BatchCreateVouchersRequest, BatchCreateVouchersResponse>(`/apis/leopard.io/v1alpha1/vouchers/batch-create`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
80
+ }
81
+ static ActivateVoucher(req: ActivateVoucherRequest, initReq?: fm.InitReq): Promise<ActivateVoucherResponse> {
82
+ return fm.fetchReq<ActivateVoucherRequest, ActivateVoucherResponse>(`/apis/leopard.io/v1alpha1/vouchers/activate`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
83
+ }
84
+ static ListActiveVouchersByCurrentUser(req: ListActiveVouchersByCurrentUserRequest, initReq?: fm.InitReq): Promise<ListVouchersResponse> {
85
+ return fm.fetchReq<ListActiveVouchersByCurrentUserRequest, ListVouchersResponse>(`/apis/leopard.io/v1alpha1/vouchers/active?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
86
+ }
87
+ static ListExpiredVouchersByCurrentUser(req: ListExpiredVouchersByCurrentUserRequest, initReq?: fm.InitReq): Promise<ListVouchersResponse> {
88
+ return fm.fetchReq<ListExpiredVouchersByCurrentUserRequest, ListVouchersResponse>(`/apis/leopard.io/v1alpha1/vouchers/expired?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
89
+ }
90
+ static GetVoucherStatByCurrentUser(req: GetVoucherStatByCurrentUserRequest, initReq?: fm.InitReq): Promise<GetVoucherStatByCurrentUserResponse> {
91
+ return fm.fetchReq<GetVoucherStatByCurrentUserRequest, GetVoucherStatByCurrentUserResponse>(`/apis/leopard.io/v1alpha1/vouchers/stat?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
92
+ }
93
+ }