@arbiwallet/contracts 1.0.30 → 1.0.31
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/gen/user.ts +35 -1
- package/package.json +1 -1
- package/proto/user.proto +29 -0
package/gen/user.ts
CHANGED
|
@@ -16,6 +16,19 @@ export enum UserStatus {
|
|
|
16
16
|
UNRECOGNIZED = -1,
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
export enum UserSortBy {
|
|
20
|
+
CREATED_AT = 0,
|
|
21
|
+
STATUS = 1,
|
|
22
|
+
REGISTRATION_TYPE = 2,
|
|
23
|
+
UNRECOGNIZED = -1,
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export enum SortOrder {
|
|
27
|
+
DESC = 0,
|
|
28
|
+
ASC = 1,
|
|
29
|
+
UNRECOGNIZED = -1,
|
|
30
|
+
}
|
|
31
|
+
|
|
19
32
|
export interface GetUserRequest {
|
|
20
33
|
id: number;
|
|
21
34
|
}
|
|
@@ -49,6 +62,23 @@ export interface UpdateUserStatusRequest {
|
|
|
49
62
|
status: UserStatus;
|
|
50
63
|
}
|
|
51
64
|
|
|
65
|
+
export interface ListUsersRequest {
|
|
66
|
+
page?: number | undefined;
|
|
67
|
+
limit?: number | undefined;
|
|
68
|
+
sortBy?: UserSortBy | undefined;
|
|
69
|
+
order?: SortOrder | undefined;
|
|
70
|
+
search?: string | undefined;
|
|
71
|
+
statusValue?: UserStatus | undefined;
|
|
72
|
+
registrationTypeValue?: string | undefined;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface ListUsersResponse {
|
|
76
|
+
items: UserResponse[];
|
|
77
|
+
allCount: number;
|
|
78
|
+
page: number;
|
|
79
|
+
limit: number;
|
|
80
|
+
}
|
|
81
|
+
|
|
52
82
|
export interface ResolveUserForTransferRequest {
|
|
53
83
|
userId?: number | undefined;
|
|
54
84
|
email?: string | undefined;
|
|
@@ -70,6 +100,8 @@ export interface UserServiceClient {
|
|
|
70
100
|
|
|
71
101
|
updateUserStatus(request: UpdateUserStatusRequest): Observable<UserResponse>;
|
|
72
102
|
|
|
103
|
+
listUsers(request: ListUsersRequest): Observable<ListUsersResponse>;
|
|
104
|
+
|
|
73
105
|
/** Ровно одно из полей: user_id, email, phone, telegram_username → id получателя для внутреннего перевода. */
|
|
74
106
|
|
|
75
107
|
resolveUserForTransfer(request: ResolveUserForTransferRequest): Observable<ResolveUserForTransferResponse>;
|
|
@@ -82,6 +114,8 @@ export interface UserServiceController {
|
|
|
82
114
|
|
|
83
115
|
updateUserStatus(request: UpdateUserStatusRequest): Promise<UserResponse> | Observable<UserResponse> | UserResponse;
|
|
84
116
|
|
|
117
|
+
listUsers(request: ListUsersRequest): Promise<ListUsersResponse> | Observable<ListUsersResponse> | ListUsersResponse;
|
|
118
|
+
|
|
85
119
|
/** Ровно одно из полей: user_id, email, phone, telegram_username → id получателя для внутреннего перевода. */
|
|
86
120
|
|
|
87
121
|
resolveUserForTransfer(
|
|
@@ -94,7 +128,7 @@ export interface UserServiceController {
|
|
|
94
128
|
|
|
95
129
|
export function UserServiceControllerMethods() {
|
|
96
130
|
return function (constructor: Function) {
|
|
97
|
-
const grpcMethods: string[] = ["getUser", "updateUser", "updateUserStatus", "resolveUserForTransfer"];
|
|
131
|
+
const grpcMethods: string[] = ["getUser", "updateUser", "updateUserStatus", "listUsers", "resolveUserForTransfer"];
|
|
98
132
|
for (const method of grpcMethods) {
|
|
99
133
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
100
134
|
GrpcMethod("UserService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arbiwallet/contracts",
|
|
3
3
|
"descriptions": "Generate and manage smart contracts for ArbiWallet",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.31",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
|
|
7
7
|
},
|
package/proto/user.proto
CHANGED
|
@@ -5,6 +5,7 @@ service UserService {
|
|
|
5
5
|
rpc GetUser (GetUserRequest) returns (UserResponse);
|
|
6
6
|
rpc UpdateUser (UpdateUserRequest) returns (UserResponse);
|
|
7
7
|
rpc UpdateUserStatus (UpdateUserStatusRequest) returns (UserResponse);
|
|
8
|
+
rpc ListUsers (ListUsersRequest) returns (ListUsersResponse);
|
|
8
9
|
// Ровно одно из полей: user_id, email, phone, telegram_username → id получателя для внутреннего перевода.
|
|
9
10
|
rpc ResolveUserForTransfer (ResolveUserForTransferRequest) returns (ResolveUserForTransferResponse);
|
|
10
11
|
}
|
|
@@ -47,6 +48,34 @@ message UpdateUserStatusRequest {
|
|
|
47
48
|
UserStatus status = 2;
|
|
48
49
|
}
|
|
49
50
|
|
|
51
|
+
enum UserSortBy {
|
|
52
|
+
CREATED_AT = 0;
|
|
53
|
+
STATUS = 1;
|
|
54
|
+
REGISTRATION_TYPE = 2;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
enum SortOrder {
|
|
58
|
+
DESC = 0;
|
|
59
|
+
ASC = 1;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
message ListUsersRequest {
|
|
63
|
+
optional int32 page = 1;
|
|
64
|
+
optional int32 limit = 2;
|
|
65
|
+
optional UserSortBy sort_by = 3;
|
|
66
|
+
optional SortOrder order = 4;
|
|
67
|
+
optional string search = 5;
|
|
68
|
+
optional UserStatus status_value = 6;
|
|
69
|
+
optional string registration_type_value = 7;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
message ListUsersResponse {
|
|
73
|
+
repeated UserResponse items = 1;
|
|
74
|
+
int32 all_count = 2;
|
|
75
|
+
int32 page = 3;
|
|
76
|
+
int32 limit = 4;
|
|
77
|
+
}
|
|
78
|
+
|
|
50
79
|
message ResolveUserForTransferRequest {
|
|
51
80
|
optional int32 user_id = 1;
|
|
52
81
|
optional string email = 2;
|