@vsniksnet/contracts 1.2.14 → 1.2.16
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 -1
- package/package.json +1 -1
- package/proto/users.proto +57 -0
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,12 +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;
|
|
40
|
+
currentId: string;
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
export interface ListUsersResponse {
|
|
@@ -41,6 +45,7 @@ export interface ListUsersResponse {
|
|
|
41
45
|
total: number;
|
|
42
46
|
}
|
|
43
47
|
|
|
48
|
+
/** Update email */
|
|
44
49
|
export interface UpdateEmailRequest {
|
|
45
50
|
email: string;
|
|
46
51
|
userId: string;
|
|
@@ -51,6 +56,7 @@ export interface UpdateEmailResponse {
|
|
|
51
56
|
email: string;
|
|
52
57
|
}
|
|
53
58
|
|
|
59
|
+
/** Update profile */
|
|
54
60
|
export interface UpdateUserRequest {
|
|
55
61
|
userId: string;
|
|
56
62
|
username?: string | undefined;
|
|
@@ -67,11 +73,52 @@ export interface UpdateUserResponse {
|
|
|
67
73
|
profile: Profile | undefined;
|
|
68
74
|
}
|
|
69
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 GetFollowersRequest {
|
|
88
|
+
userId: string;
|
|
89
|
+
currentId: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface GetFollowersResponse {
|
|
93
|
+
user: User[];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Get followings */
|
|
97
|
+
export interface GetFollowingsRequest {
|
|
98
|
+
userId: string;
|
|
99
|
+
currentId: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface GetFollowingsResponse {
|
|
103
|
+
user: User[];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Get Suggested */
|
|
107
|
+
export interface GetSuggestedRequest {
|
|
108
|
+
currentId: string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface GetSuggestedResponse {
|
|
112
|
+
user: User[];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Models */
|
|
70
116
|
export interface User {
|
|
71
117
|
id: string;
|
|
72
118
|
email: string;
|
|
73
119
|
username: string;
|
|
74
120
|
avatar: string;
|
|
121
|
+
isFollow?: boolean | undefined;
|
|
75
122
|
}
|
|
76
123
|
|
|
77
124
|
export interface Profile {
|
|
@@ -84,6 +131,7 @@ export interface Profile {
|
|
|
84
131
|
status: string;
|
|
85
132
|
country: string;
|
|
86
133
|
birthDay: string;
|
|
134
|
+
isFollow?: boolean | undefined;
|
|
87
135
|
}
|
|
88
136
|
|
|
89
137
|
export const USERS_V1_PACKAGE_NAME = "users.v1";
|
|
@@ -110,6 +158,22 @@ export interface UsersServiceClient {
|
|
|
110
158
|
/** Update profile */
|
|
111
159
|
|
|
112
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
|
+
getFollowers(request: GetFollowersRequest): Observable<GetFollowersResponse>;
|
|
169
|
+
|
|
170
|
+
/** Get followings */
|
|
171
|
+
|
|
172
|
+
getFollowings(request: GetFollowingsRequest): Observable<GetFollowingsResponse>;
|
|
173
|
+
|
|
174
|
+
/** Get Suggested */
|
|
175
|
+
|
|
176
|
+
getSuggested(request: GetSuggestedRequest): Observable<GetSuggestedResponse>;
|
|
113
177
|
}
|
|
114
178
|
|
|
115
179
|
/** Users service */
|
|
@@ -140,11 +204,45 @@ export interface UsersServiceController {
|
|
|
140
204
|
updateUser(
|
|
141
205
|
request: UpdateUserRequest,
|
|
142
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
|
+
getFollowers(
|
|
217
|
+
request: GetFollowersRequest,
|
|
218
|
+
): Promise<GetFollowersResponse> | Observable<GetFollowersResponse> | GetFollowersResponse;
|
|
219
|
+
|
|
220
|
+
/** Get followings */
|
|
221
|
+
|
|
222
|
+
getFollowings(
|
|
223
|
+
request: GetFollowingsRequest,
|
|
224
|
+
): Promise<GetFollowingsResponse> | Observable<GetFollowingsResponse> | GetFollowingsResponse;
|
|
225
|
+
|
|
226
|
+
/** Get Suggested */
|
|
227
|
+
|
|
228
|
+
getSuggested(
|
|
229
|
+
request: GetSuggestedRequest,
|
|
230
|
+
): Promise<GetSuggestedResponse> | Observable<GetSuggestedResponse> | GetSuggestedResponse;
|
|
143
231
|
}
|
|
144
232
|
|
|
145
233
|
export function UsersServiceControllerMethods() {
|
|
146
234
|
return function (constructor: Function) {
|
|
147
|
-
const grpcMethods: string[] = [
|
|
235
|
+
const grpcMethods: string[] = [
|
|
236
|
+
"createUser",
|
|
237
|
+
"getUser",
|
|
238
|
+
"listUsers",
|
|
239
|
+
"updateEmail",
|
|
240
|
+
"updateUser",
|
|
241
|
+
"followUser",
|
|
242
|
+
"getFollowers",
|
|
243
|
+
"getFollowings",
|
|
244
|
+
"getSuggested",
|
|
245
|
+
];
|
|
148
246
|
for (const method of grpcMethods) {
|
|
149
247
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
150
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 GetFollowers (GetFollowersRequest) returns (GetFollowersResponse);
|
|
21
|
+
/* Get followings */
|
|
22
|
+
rpc GetFollowings (GetFollowingsRequest) returns (GetFollowingsResponse);
|
|
23
|
+
/* Get Suggested */
|
|
24
|
+
rpc GetSuggested (GetSuggestedRequest) returns (GetSuggestedResponse);
|
|
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,12 +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;
|
|
54
|
+
string current_id = 6;
|
|
43
55
|
}
|
|
44
56
|
|
|
45
57
|
message ListUsersResponse {
|
|
@@ -47,6 +59,7 @@ message ListUsersResponse {
|
|
|
47
59
|
int32 total = 2;
|
|
48
60
|
}
|
|
49
61
|
|
|
62
|
+
/* Update email */
|
|
50
63
|
message UpdateEmailRequest {
|
|
51
64
|
string email = 1;
|
|
52
65
|
string user_id = 2;
|
|
@@ -57,6 +70,7 @@ message UpdateEmailResponse {
|
|
|
57
70
|
string email = 2;
|
|
58
71
|
}
|
|
59
72
|
|
|
73
|
+
/* Update profile */
|
|
60
74
|
message UpdateUserRequest {
|
|
61
75
|
string user_id = 1;
|
|
62
76
|
optional string username = 2;
|
|
@@ -73,11 +87,53 @@ message UpdateUserResponse {
|
|
|
73
87
|
Profile profile = 1;
|
|
74
88
|
}
|
|
75
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 GetFollowersRequest {
|
|
102
|
+
string user_id = 1;
|
|
103
|
+
string current_id = 2;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
message GetFollowersResponse {
|
|
107
|
+
repeated User user = 1;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Get followings */
|
|
111
|
+
message GetFollowingsRequest {
|
|
112
|
+
string user_id = 1;
|
|
113
|
+
string current_id = 2;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
message GetFollowingsResponse {
|
|
117
|
+
repeated User user = 1;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* Get Suggested */
|
|
121
|
+
message GetSuggestedRequest {
|
|
122
|
+
string current_id = 1;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
message GetSuggestedResponse {
|
|
126
|
+
repeated User user = 1;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
/* Models */
|
|
76
131
|
message User {
|
|
77
132
|
string id = 1;
|
|
78
133
|
string email = 2;
|
|
79
134
|
string username = 3;
|
|
80
135
|
string avatar = 4;
|
|
136
|
+
optional bool is_follow = 5;
|
|
81
137
|
}
|
|
82
138
|
|
|
83
139
|
message Profile {
|
|
@@ -90,4 +146,5 @@ message Profile {
|
|
|
90
146
|
string status = 7;
|
|
91
147
|
string country = 8;
|
|
92
148
|
string birth_day = 9;
|
|
149
|
+
optional bool is_follow = 10;
|
|
93
150
|
}
|