@vsniksnet/contracts 1.3.0 → 1.3.1

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 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;
@@ -152,6 +166,8 @@ export interface UsersServiceClient {
152
166
 
153
167
  getUser(request: GetUserRequest): Observable<GetUserResponse>;
154
168
 
169
+ getAuth(request: GetAuthRequest): Observable<GetAuthResponse>;
170
+
155
171
  /** List users */
156
172
 
157
173
  listUsers(request: ListUsersRequest): Observable<ListUsersResponse>;
@@ -194,6 +210,8 @@ export interface UsersServiceController {
194
210
 
195
211
  getUser(request: GetUserRequest): Promise<GetUserResponse> | Observable<GetUserResponse> | GetUserResponse;
196
212
 
213
+ getAuth(request: GetAuthRequest): Promise<GetAuthResponse> | Observable<GetAuthResponse> | GetAuthResponse;
214
+
197
215
  /** List users */
198
216
 
199
217
  listUsers(request: ListUsersRequest): Promise<ListUsersResponse> | Observable<ListUsersResponse> | ListUsersResponse;
@@ -240,6 +258,7 @@ export function UsersServiceControllerMethods() {
240
258
  const grpcMethods: string[] = [
241
259
  "createUser",
242
260
  "getUser",
261
+ "getAuth",
243
262
  "listUsers",
244
263
  "updateEmail",
245
264
  "updateUser",
package/package.json CHANGED
@@ -1,28 +1,28 @@
1
- {
2
- "name": "@vsniksnet/contracts",
3
- "version": "1.3.0",
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.1",
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/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;