@vsniksnet/contracts 1.3.0 → 1.3.2
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/friends.ts +1 -0
- package/gen/users.ts +21 -0
- package/package.json +28 -28
- package/proto/friends.proto +1 -0
- package/proto/users.proto +18 -0
package/gen/friends.ts
CHANGED
package/gen/users.ts
CHANGED
|
@@ -31,6 +31,20 @@ export interface GetUserResponse {
|
|
|
31
31
|
user: Profile | undefined;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
export interface GetAuthRequest {
|
|
35
|
+
currentId: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface GetAuthResponse {
|
|
39
|
+
id: string;
|
|
40
|
+
username: string;
|
|
41
|
+
avatar: string;
|
|
42
|
+
followersCount: number;
|
|
43
|
+
followingCount: number;
|
|
44
|
+
requestCount: number;
|
|
45
|
+
friendsCount: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
34
48
|
/** List users */
|
|
35
49
|
export interface ListUsersRequest {
|
|
36
50
|
search?: string | undefined;
|
|
@@ -120,6 +134,7 @@ export interface User {
|
|
|
120
134
|
username: string;
|
|
121
135
|
avatar: string;
|
|
122
136
|
isFollow?: boolean | undefined;
|
|
137
|
+
friendStatus?: boolean | undefined;
|
|
123
138
|
}
|
|
124
139
|
|
|
125
140
|
export interface Profile {
|
|
@@ -137,6 +152,7 @@ export interface Profile {
|
|
|
137
152
|
followersCount?: number | undefined;
|
|
138
153
|
followingCount?: number | undefined;
|
|
139
154
|
isFollow?: boolean | undefined;
|
|
155
|
+
friendStatus?: boolean | undefined;
|
|
140
156
|
}
|
|
141
157
|
|
|
142
158
|
export const USERS_V1_PACKAGE_NAME = "users.v1";
|
|
@@ -152,6 +168,8 @@ export interface UsersServiceClient {
|
|
|
152
168
|
|
|
153
169
|
getUser(request: GetUserRequest): Observable<GetUserResponse>;
|
|
154
170
|
|
|
171
|
+
getAuth(request: GetAuthRequest): Observable<GetAuthResponse>;
|
|
172
|
+
|
|
155
173
|
/** List users */
|
|
156
174
|
|
|
157
175
|
listUsers(request: ListUsersRequest): Observable<ListUsersResponse>;
|
|
@@ -194,6 +212,8 @@ export interface UsersServiceController {
|
|
|
194
212
|
|
|
195
213
|
getUser(request: GetUserRequest): Promise<GetUserResponse> | Observable<GetUserResponse> | GetUserResponse;
|
|
196
214
|
|
|
215
|
+
getAuth(request: GetAuthRequest): Promise<GetAuthResponse> | Observable<GetAuthResponse> | GetAuthResponse;
|
|
216
|
+
|
|
197
217
|
/** List users */
|
|
198
218
|
|
|
199
219
|
listUsers(request: ListUsersRequest): Promise<ListUsersResponse> | Observable<ListUsersResponse> | ListUsersResponse;
|
|
@@ -240,6 +260,7 @@ export function UsersServiceControllerMethods() {
|
|
|
240
260
|
const grpcMethods: string[] = [
|
|
241
261
|
"createUser",
|
|
242
262
|
"getUser",
|
|
263
|
+
"getAuth",
|
|
243
264
|
"listUsers",
|
|
244
265
|
"updateEmail",
|
|
245
266
|
"updateUser",
|
package/package.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@vsniksnet/contracts",
|
|
3
|
-
"version": "1.3.
|
|
4
|
-
"description": "Protobuf definitions and generated typescript types",
|
|
5
|
-
"main": "./dist/index.js",
|
|
6
|
-
"types": "./dist/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "tsc -p tsconfig.build.json",
|
|
9
|
-
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
|
|
10
|
-
},
|
|
11
|
-
"files": [
|
|
12
|
-
"dist",
|
|
13
|
-
"proto",
|
|
14
|
-
"gen"
|
|
15
|
-
],
|
|
16
|
-
"publishConfig": {
|
|
17
|
-
"access": "public"
|
|
18
|
-
},
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"@nestjs/microservices": "^11.1.14",
|
|
21
|
-
"rxjs": "^7.8.2",
|
|
22
|
-
"ts-proto": "^2.11.4"
|
|
23
|
-
},
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"@types/node": "^25.3.3",
|
|
26
|
-
"typescript": "^5.9.3"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@vsniksnet/contracts",
|
|
3
|
+
"version": "1.3.2",
|
|
4
|
+
"description": "Protobuf definitions and generated typescript types",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc -p tsconfig.build.json",
|
|
9
|
+
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"proto",
|
|
14
|
+
"gen"
|
|
15
|
+
],
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@nestjs/microservices": "^11.1.14",
|
|
21
|
+
"rxjs": "^7.8.2",
|
|
22
|
+
"ts-proto": "^2.11.4"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "^25.3.3",
|
|
26
|
+
"typescript": "^5.9.3"
|
|
27
|
+
}
|
|
28
|
+
}
|
package/proto/friends.proto
CHANGED
package/proto/users.proto
CHANGED
|
@@ -8,6 +8,8 @@ service UsersService {
|
|
|
8
8
|
rpc CreateUser (CreateUserRequest) returns (CreateUserResponse);
|
|
9
9
|
/* Get one user by id */
|
|
10
10
|
rpc GetUser (GetUserRequest) returns (GetUserResponse);
|
|
11
|
+
|
|
12
|
+
rpc GetAuth (GetAuthRequest) returns (GetAuthResponse);
|
|
11
13
|
/* List users */
|
|
12
14
|
rpc ListUsers (ListUsersRequest) returns (ListUsersResponse);
|
|
13
15
|
/* Update email */
|
|
@@ -45,6 +47,20 @@ message GetUserResponse {
|
|
|
45
47
|
Profile user = 1;
|
|
46
48
|
}
|
|
47
49
|
|
|
50
|
+
message GetAuthRequest {
|
|
51
|
+
string current_id = 1;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
message GetAuthResponse {
|
|
55
|
+
string id = 1;
|
|
56
|
+
string username = 2;
|
|
57
|
+
string avatar = 3;
|
|
58
|
+
int32 followers_count = 4;
|
|
59
|
+
int32 following_count = 5;
|
|
60
|
+
int32 request_count = 6;
|
|
61
|
+
int32 friends_count = 7;
|
|
62
|
+
}
|
|
63
|
+
|
|
48
64
|
/* List users */
|
|
49
65
|
message ListUsersRequest {
|
|
50
66
|
optional string search = 1;
|
|
@@ -135,6 +151,7 @@ message User {
|
|
|
135
151
|
string username = 3;
|
|
136
152
|
string avatar = 4;
|
|
137
153
|
optional bool is_follow = 5;
|
|
154
|
+
optional bool friend_status = 6;
|
|
138
155
|
}
|
|
139
156
|
|
|
140
157
|
message Profile {
|
|
@@ -152,4 +169,5 @@ message Profile {
|
|
|
152
169
|
optional int32 followers_count = 12;
|
|
153
170
|
optional int32 following_count = 13;
|
|
154
171
|
optional bool is_follow = 14;
|
|
172
|
+
optional bool friend_status = 15;
|
|
155
173
|
}
|