@daocloud-proto/leopard 0.9.0-rc6 → 0.10.0-dev1
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 +1 -1
- package/v1alpha1/accounts.pb.ts +61 -0
- package/v1alpha1/wallet.pb.ts +60 -0
package/package.json
CHANGED
package/v1alpha1/account.pb.ts
CHANGED
|
@@ -51,7 +51,7 @@ export type GetExportURLResponse = {
|
|
|
51
51
|
method?: RequestMethod
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export class
|
|
54
|
+
export class Accounts {
|
|
55
55
|
static ListCurrentMembers(req: ListCurrentMembersRequest, initReq?: fm.InitReq): Promise<ListCurrentMembersResponse> {
|
|
56
56
|
return fm.fetchReq<ListCurrentMembersRequest, ListCurrentMembersResponse>(`/apis/leopard.io/v1alpha1/accounts/current/members?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
57
57
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
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 ListCurrentMembersRequest = {
|
|
25
|
+
page?: number
|
|
26
|
+
pageSize?: number
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type ListCurrentMembersResponse = {
|
|
30
|
+
items?: AccountInfo[]
|
|
31
|
+
pagination?: Pagination
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type AccountInfo = {
|
|
35
|
+
id?: string
|
|
36
|
+
name?: string
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type Pagination = {
|
|
40
|
+
total?: number
|
|
41
|
+
page?: number
|
|
42
|
+
pageSize?: number
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type GetExportURLRequest = {
|
|
46
|
+
module?: Modules
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type GetExportURLResponse = {
|
|
50
|
+
url?: string
|
|
51
|
+
method?: RequestMethod
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export class Accounts {
|
|
55
|
+
static ListCurrentMembers(req: ListCurrentMembersRequest, initReq?: fm.InitReq): Promise<ListCurrentMembersResponse> {
|
|
56
|
+
return fm.fetchReq<ListCurrentMembersRequest, ListCurrentMembersResponse>(`/apis/leopard.io/v1alpha1/accounts/current/members?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
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
|
+
}
|
|
61
|
+
}
|
package/v1alpha1/wallet.pb.ts
CHANGED
|
@@ -17,11 +17,17 @@ export enum PaymentType {
|
|
|
17
17
|
REDIRECT = "REDIRECT",
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
export enum OperationType {
|
|
21
|
+
INCREASE = "INCREASE",
|
|
22
|
+
DECREASE = "DECREASE",
|
|
23
|
+
}
|
|
24
|
+
|
|
20
25
|
export type BalanceRequest = {
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
export type BalanceResponse = {
|
|
24
29
|
balance?: string
|
|
30
|
+
isVirtual?: boolean
|
|
25
31
|
}
|
|
26
32
|
|
|
27
33
|
export type RechargeRequest = {
|
|
@@ -86,6 +92,48 @@ export type CorporateTransferRechargeRequest = {
|
|
|
86
92
|
export type CorporateTransferRechargeResponse = {
|
|
87
93
|
}
|
|
88
94
|
|
|
95
|
+
export type VirtualWallet = {
|
|
96
|
+
id?: string
|
|
97
|
+
name?: string
|
|
98
|
+
balance?: string
|
|
99
|
+
arrearsStop?: boolean
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export type ListVirtualWalletsResponse = {
|
|
103
|
+
items?: VirtualWallet[]
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export type ListVirtualWalletsRequest = {
|
|
107
|
+
username?: string
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export type CreateVirtualWalletRequest = {
|
|
111
|
+
id?: string
|
|
112
|
+
amount?: string
|
|
113
|
+
arrearsStop?: boolean
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export type CreateVirtualWalletResponse = {
|
|
117
|
+
id?: string
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export type UpdateVirtualWalletRequest = {
|
|
121
|
+
id?: string
|
|
122
|
+
amount?: string
|
|
123
|
+
arrearsStop?: boolean
|
|
124
|
+
type?: OperationType
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export type UpdateVirtualWalletResponse = {
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export type DeleteVirtualWalletRequest = {
|
|
131
|
+
id?: string
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export type DeleteVirtualWalletResponse = {
|
|
135
|
+
}
|
|
136
|
+
|
|
89
137
|
export class Wallet {
|
|
90
138
|
static Balance(req: BalanceRequest, initReq?: fm.InitReq): Promise<BalanceResponse> {
|
|
91
139
|
return fm.fetchReq<BalanceRequest, BalanceResponse>(`/apis/leopard.io/v1alpha1/wallet/balance?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
@@ -102,6 +150,18 @@ export class Wallet {
|
|
|
102
150
|
static GetUserState(req: GetUserStateRequest, initReq?: fm.InitReq): Promise<GetUserStateResponse> {
|
|
103
151
|
return fm.fetchReq<GetUserStateRequest, GetUserStateResponse>(`/apis/leopard.io/v1alpha1/wallet/user-state?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
104
152
|
}
|
|
153
|
+
static ListVirtualWallets(req: ListVirtualWalletsRequest, initReq?: fm.InitReq): Promise<ListVirtualWalletsResponse> {
|
|
154
|
+
return fm.fetchReq<ListVirtualWalletsRequest, ListVirtualWalletsResponse>(`/apis/leopard.io/v1alpha1/wallet/virtual-wallets?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
155
|
+
}
|
|
156
|
+
static CreateVirtualWallet(req: CreateVirtualWalletRequest, initReq?: fm.InitReq): Promise<CreateVirtualWalletResponse> {
|
|
157
|
+
return fm.fetchReq<CreateVirtualWalletRequest, CreateVirtualWalletResponse>(`/apis/leopard.io/v1alpha1/wallet/virtual-wallet`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
158
|
+
}
|
|
159
|
+
static UpdateVirtualWallet(req: UpdateVirtualWalletRequest, initReq?: fm.InitReq): Promise<UpdateVirtualWalletResponse> {
|
|
160
|
+
return fm.fetchReq<UpdateVirtualWalletRequest, UpdateVirtualWalletResponse>(`/apis/leopard.io/v1alpha1/wallet/virtual-wallet/${req["id"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
161
|
+
}
|
|
162
|
+
static DeleteVirtualWallet(req: DeleteVirtualWalletRequest, initReq?: fm.InitReq): Promise<DeleteVirtualWalletResponse> {
|
|
163
|
+
return fm.fetchReq<DeleteVirtualWalletRequest, DeleteVirtualWalletResponse>(`/apis/leopard.io/v1alpha1/wallet/virtual-wallet/${req["id"]}`, {...initReq, method: "DELETE"})
|
|
164
|
+
}
|
|
105
165
|
static UserState(req: UserStateRequest, initReq?: fm.InitReq): Promise<UserStateResponse> {
|
|
106
166
|
return fm.fetchReq<UserStateRequest, UserStateResponse>(`/v1alpha1.wallet.Wallet/UserState`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
107
167
|
}
|