@vsniksnet/contracts 1.2.15 → 1.2.17
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/users.ts +99 -2
- package/package.json +1 -1
- package/proto/users.proto +57 -1
package/gen/users.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { Observable } from "rxjs";
|
|
|
10
10
|
|
|
11
11
|
export const protobufPackage = "users.v1";
|
|
12
12
|
|
|
13
|
+
/** Create ser */
|
|
13
14
|
export interface CreateUserRequest {
|
|
14
15
|
id: string;
|
|
15
16
|
email: string;
|
|
@@ -20,6 +21,7 @@ export interface CreateUserResponse {
|
|
|
20
21
|
success: boolean;
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
/** Get one user */
|
|
23
25
|
export interface GetUserRequest {
|
|
24
26
|
userId: string;
|
|
25
27
|
}
|
|
@@ -28,13 +30,14 @@ export interface GetUserResponse {
|
|
|
28
30
|
user: Profile | undefined;
|
|
29
31
|
}
|
|
30
32
|
|
|
33
|
+
/** List users */
|
|
31
34
|
export interface ListUsersRequest {
|
|
32
35
|
search?: string | undefined;
|
|
33
36
|
gender?: string | undefined;
|
|
34
37
|
status?: string | undefined;
|
|
35
38
|
page: number;
|
|
36
39
|
limit: number;
|
|
37
|
-
|
|
40
|
+
currentId: string;
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
export interface ListUsersResponse {
|
|
@@ -42,6 +45,7 @@ export interface ListUsersResponse {
|
|
|
42
45
|
total: number;
|
|
43
46
|
}
|
|
44
47
|
|
|
48
|
+
/** Update email */
|
|
45
49
|
export interface UpdateEmailRequest {
|
|
46
50
|
email: string;
|
|
47
51
|
userId: string;
|
|
@@ -52,6 +56,7 @@ export interface UpdateEmailResponse {
|
|
|
52
56
|
email: string;
|
|
53
57
|
}
|
|
54
58
|
|
|
59
|
+
/** Update profile */
|
|
55
60
|
export interface UpdateUserRequest {
|
|
56
61
|
userId: string;
|
|
57
62
|
username?: string | undefined;
|
|
@@ -68,11 +73,52 @@ export interface UpdateUserResponse {
|
|
|
68
73
|
profile: Profile | undefined;
|
|
69
74
|
}
|
|
70
75
|
|
|
76
|
+
/** Toggle Follow / Ubfollow user */
|
|
77
|
+
export interface FollowUserRequest {
|
|
78
|
+
followId: string;
|
|
79
|
+
currentId: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface FollowUserResponse {
|
|
83
|
+
user: Profile | undefined;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Get followers */
|
|
87
|
+
export interface ListFollowersRequest {
|
|
88
|
+
userId: string;
|
|
89
|
+
currentId: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface ListFollowersResponse {
|
|
93
|
+
user: User[];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Get followings */
|
|
97
|
+
export interface ListFollowingsRequest {
|
|
98
|
+
userId: string;
|
|
99
|
+
currentId: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface ListFollowingsResponse {
|
|
103
|
+
user: User[];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Get Suggested */
|
|
107
|
+
export interface ListSuggestedRequest {
|
|
108
|
+
currentId: string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface ListSuggestedResponse {
|
|
112
|
+
user: User[];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Models */
|
|
71
116
|
export interface User {
|
|
72
117
|
id: string;
|
|
73
118
|
email: string;
|
|
74
119
|
username: string;
|
|
75
120
|
avatar: string;
|
|
121
|
+
isFollow?: boolean | undefined;
|
|
76
122
|
}
|
|
77
123
|
|
|
78
124
|
export interface Profile {
|
|
@@ -85,6 +131,7 @@ export interface Profile {
|
|
|
85
131
|
status: string;
|
|
86
132
|
country: string;
|
|
87
133
|
birthDay: string;
|
|
134
|
+
isFollow?: boolean | undefined;
|
|
88
135
|
}
|
|
89
136
|
|
|
90
137
|
export const USERS_V1_PACKAGE_NAME = "users.v1";
|
|
@@ -111,6 +158,22 @@ export interface UsersServiceClient {
|
|
|
111
158
|
/** Update profile */
|
|
112
159
|
|
|
113
160
|
updateUser(request: UpdateUserRequest): Observable<UpdateUserResponse>;
|
|
161
|
+
|
|
162
|
+
/** Toggle Follow / Ubfollow user */
|
|
163
|
+
|
|
164
|
+
followUser(request: FollowUserRequest): Observable<FollowUserResponse>;
|
|
165
|
+
|
|
166
|
+
/** Get followers */
|
|
167
|
+
|
|
168
|
+
listFollowers(request: ListFollowersRequest): Observable<ListFollowersResponse>;
|
|
169
|
+
|
|
170
|
+
/** Get followings */
|
|
171
|
+
|
|
172
|
+
listFollowings(request: ListFollowingsRequest): Observable<ListFollowingsResponse>;
|
|
173
|
+
|
|
174
|
+
/** Get Suggested */
|
|
175
|
+
|
|
176
|
+
listSuggested(request: ListSuggestedRequest): Observable<ListSuggestedResponse>;
|
|
114
177
|
}
|
|
115
178
|
|
|
116
179
|
/** Users service */
|
|
@@ -141,11 +204,45 @@ export interface UsersServiceController {
|
|
|
141
204
|
updateUser(
|
|
142
205
|
request: UpdateUserRequest,
|
|
143
206
|
): Promise<UpdateUserResponse> | Observable<UpdateUserResponse> | UpdateUserResponse;
|
|
207
|
+
|
|
208
|
+
/** Toggle Follow / Ubfollow user */
|
|
209
|
+
|
|
210
|
+
followUser(
|
|
211
|
+
request: FollowUserRequest,
|
|
212
|
+
): Promise<FollowUserResponse> | Observable<FollowUserResponse> | FollowUserResponse;
|
|
213
|
+
|
|
214
|
+
/** Get followers */
|
|
215
|
+
|
|
216
|
+
listFollowers(
|
|
217
|
+
request: ListFollowersRequest,
|
|
218
|
+
): Promise<ListFollowersResponse> | Observable<ListFollowersResponse> | ListFollowersResponse;
|
|
219
|
+
|
|
220
|
+
/** Get followings */
|
|
221
|
+
|
|
222
|
+
listFollowings(
|
|
223
|
+
request: ListFollowingsRequest,
|
|
224
|
+
): Promise<ListFollowingsResponse> | Observable<ListFollowingsResponse> | ListFollowingsResponse;
|
|
225
|
+
|
|
226
|
+
/** Get Suggested */
|
|
227
|
+
|
|
228
|
+
listSuggested(
|
|
229
|
+
request: ListSuggestedRequest,
|
|
230
|
+
): Promise<ListSuggestedResponse> | Observable<ListSuggestedResponse> | ListSuggestedResponse;
|
|
144
231
|
}
|
|
145
232
|
|
|
146
233
|
export function UsersServiceControllerMethods() {
|
|
147
234
|
return function (constructor: Function) {
|
|
148
|
-
const grpcMethods: string[] = [
|
|
235
|
+
const grpcMethods: string[] = [
|
|
236
|
+
"createUser",
|
|
237
|
+
"getUser",
|
|
238
|
+
"listUsers",
|
|
239
|
+
"updateEmail",
|
|
240
|
+
"updateUser",
|
|
241
|
+
"followUser",
|
|
242
|
+
"listFollowers",
|
|
243
|
+
"listFollowings",
|
|
244
|
+
"listSuggested",
|
|
245
|
+
];
|
|
149
246
|
for (const method of grpcMethods) {
|
|
150
247
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
151
248
|
GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/users.proto
CHANGED
|
@@ -14,8 +14,17 @@ service UsersService {
|
|
|
14
14
|
rpc UpdateEmail (UpdateEmailRequest) returns (UpdateEmailResponse);
|
|
15
15
|
/* Update profile */
|
|
16
16
|
rpc UpdateUser (UpdateUserRequest) returns (UpdateUserResponse);
|
|
17
|
+
/* Toggle Follow / Ubfollow user */
|
|
18
|
+
rpc FollowUser (FollowUserRequest) returns (FollowUserResponse);
|
|
19
|
+
/* Get followers */
|
|
20
|
+
rpc ListFollowers (ListFollowersRequest) returns (ListFollowersResponse);
|
|
21
|
+
/* Get followings */
|
|
22
|
+
rpc ListFollowings (ListFollowingsRequest) returns (ListFollowingsResponse);
|
|
23
|
+
/* Get Suggested */
|
|
24
|
+
rpc ListSuggested (ListSuggestedRequest) returns (ListSuggestedResponse);
|
|
17
25
|
}
|
|
18
26
|
|
|
27
|
+
/* Create ser */
|
|
19
28
|
message CreateUserRequest {
|
|
20
29
|
string id = 1;
|
|
21
30
|
string email = 2;
|
|
@@ -26,6 +35,7 @@ message CreateUserResponse {
|
|
|
26
35
|
bool success = 1;
|
|
27
36
|
}
|
|
28
37
|
|
|
38
|
+
/* Get one user */
|
|
29
39
|
message GetUserRequest {
|
|
30
40
|
string user_id = 1;
|
|
31
41
|
}
|
|
@@ -34,13 +44,14 @@ message GetUserResponse {
|
|
|
34
44
|
Profile user = 1;
|
|
35
45
|
}
|
|
36
46
|
|
|
47
|
+
/* List users */
|
|
37
48
|
message ListUsersRequest {
|
|
38
49
|
optional string search = 1;
|
|
39
50
|
optional string gender = 2;
|
|
40
51
|
optional string status = 3;
|
|
41
52
|
int32 page = 4;
|
|
42
53
|
int32 limit = 5;
|
|
43
|
-
string
|
|
54
|
+
string current_id = 6;
|
|
44
55
|
}
|
|
45
56
|
|
|
46
57
|
message ListUsersResponse {
|
|
@@ -48,6 +59,7 @@ message ListUsersResponse {
|
|
|
48
59
|
int32 total = 2;
|
|
49
60
|
}
|
|
50
61
|
|
|
62
|
+
/* Update email */
|
|
51
63
|
message UpdateEmailRequest {
|
|
52
64
|
string email = 1;
|
|
53
65
|
string user_id = 2;
|
|
@@ -58,6 +70,7 @@ message UpdateEmailResponse {
|
|
|
58
70
|
string email = 2;
|
|
59
71
|
}
|
|
60
72
|
|
|
73
|
+
/* Update profile */
|
|
61
74
|
message UpdateUserRequest {
|
|
62
75
|
string user_id = 1;
|
|
63
76
|
optional string username = 2;
|
|
@@ -74,11 +87,53 @@ message UpdateUserResponse {
|
|
|
74
87
|
Profile profile = 1;
|
|
75
88
|
}
|
|
76
89
|
|
|
90
|
+
/* Toggle Follow / Ubfollow user */
|
|
91
|
+
message FollowUserRequest {
|
|
92
|
+
string follow_id = 1;
|
|
93
|
+
string current_id = 2;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
message FollowUserResponse {
|
|
97
|
+
Profile user = 1;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Get followers */
|
|
101
|
+
message ListFollowersRequest {
|
|
102
|
+
string user_id = 1;
|
|
103
|
+
string current_id = 2;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
message ListFollowersResponse {
|
|
107
|
+
repeated User user = 1;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Get followings */
|
|
111
|
+
message ListFollowingsRequest {
|
|
112
|
+
string user_id = 1;
|
|
113
|
+
string current_id = 2;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
message ListFollowingsResponse {
|
|
117
|
+
repeated User user = 1;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* Get Suggested */
|
|
121
|
+
message ListSuggestedRequest {
|
|
122
|
+
string current_id = 1;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
message ListSuggestedResponse {
|
|
126
|
+
repeated User user = 1;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
/* Models */
|
|
77
131
|
message User {
|
|
78
132
|
string id = 1;
|
|
79
133
|
string email = 2;
|
|
80
134
|
string username = 3;
|
|
81
135
|
string avatar = 4;
|
|
136
|
+
optional bool is_follow = 5;
|
|
82
137
|
}
|
|
83
138
|
|
|
84
139
|
message Profile {
|
|
@@ -91,4 +146,5 @@ message Profile {
|
|
|
91
146
|
string status = 7;
|
|
92
147
|
string country = 8;
|
|
93
148
|
string birth_day = 9;
|
|
149
|
+
optional bool is_follow = 10;
|
|
94
150
|
}
|