@eyenest/contracts 1.2.0 → 1.2.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/ts/auth.ts CHANGED
@@ -39,6 +39,15 @@ export interface RefreshResponse {
39
39
  refreshToken: string;
40
40
  }
41
41
 
42
+ export interface GetUserByIdRequest {
43
+ userId: string;
44
+ }
45
+
46
+ export interface GetUserByIdResponse {
47
+ id: string;
48
+ name: string;
49
+ }
50
+
42
51
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
43
52
 
44
53
  export interface AuthServiceClient {
@@ -47,6 +56,8 @@ export interface AuthServiceClient {
47
56
  login(request: LoginRequest): Observable<LoginResponse>;
48
57
 
49
58
  refresh(request: RefreshRequest): Observable<RefreshResponse>;
59
+
60
+ getUserById(request: GetUserByIdRequest): Observable<GetUserByIdResponse>;
50
61
  }
51
62
 
52
63
  export interface AuthServiceController {
@@ -55,11 +66,15 @@ export interface AuthServiceController {
55
66
  login(request: LoginRequest): Promise<LoginResponse> | Observable<LoginResponse> | LoginResponse;
56
67
 
57
68
  refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
69
+
70
+ getUserById(
71
+ request: GetUserByIdRequest,
72
+ ): Promise<GetUserByIdResponse> | Observable<GetUserByIdResponse> | GetUserByIdResponse;
58
73
  }
59
74
 
60
75
  export function AuthServiceControllerMethods() {
61
76
  return function (constructor: Function) {
62
- const grpcMethods: string[] = ["register", "login", "refresh"];
77
+ const grpcMethods: string[] = ["register", "login", "refresh", "getUserById"];
63
78
  for (const method of grpcMethods) {
64
79
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
65
80
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eyenest/contracts",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/auth.proto CHANGED
@@ -7,6 +7,7 @@ service AuthService {
7
7
  rpc register (RegisterRequest) returns (RegisterResponse);
8
8
  rpc login (LoginRequest) returns (LoginResponse);
9
9
  rpc refresh (RefreshRequest) returns (RefreshResponse);
10
+ rpc getUserById (GetUserByIdRequest) returns (GetUserByIdResponse);
10
11
  }
11
12
 
12
13
  message RegisterRequest {
@@ -38,4 +39,13 @@ message RefreshResponse {
38
39
  string refreshToken = 2;
39
40
  }
40
41
 
42
+ message GetUserByIdRequest {
43
+ string userId = 1;
44
+ }
45
+
46
+ message GetUserByIdResponse {
47
+ string id = 1;
48
+ string name = 2;
49
+ }
50
+
41
51