@sync-chat/contracts 1.1.0 → 1.1.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.
@@ -17,23 +17,32 @@ export interface RegisterRequest {
17
17
  userDesc: string;
18
18
  }
19
19
 
20
- export interface RegisterResponse {
20
+ export interface AuthResponse {
21
21
  message: string;
22
22
  }
23
23
 
24
+ export interface LoginRequest {
25
+ email: string;
26
+ password: string;
27
+ }
28
+
24
29
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
25
30
 
26
31
  export interface AuthServiceClient {
27
- register(request: RegisterRequest): Observable<RegisterResponse>;
32
+ register(request: RegisterRequest): Observable<AuthResponse>;
33
+
34
+ login(request: LoginRequest): Observable<AuthResponse>;
28
35
  }
29
36
 
30
37
  export interface AuthServiceController {
31
- register(request: RegisterRequest): Promise<RegisterResponse> | Observable<RegisterResponse> | RegisterResponse;
38
+ register(request: RegisterRequest): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
39
+
40
+ login(request: LoginRequest): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
32
41
  }
33
42
 
34
43
  export function AuthServiceControllerMethods() {
35
44
  return function (constructor: Function) {
36
- const grpcMethods: string[] = ["register"];
45
+ const grpcMethods: string[] = ["register", "login"];
37
46
  for (const method of grpcMethods) {
38
47
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
39
48
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sync-chat/contracts",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "scripts": {
6
6
  "generate": "protoc -I ./proto ./proto/**/*.proto --ts_proto_out=./generated --ts_proto_opt=nestJs=true,package=omit"
@@ -2,7 +2,9 @@ syntax = "proto3";
2
2
  package auth.v1;
3
3
 
4
4
  service AuthService {
5
- rpc Register(RegisterRequest) returns (RegisterResponse);
5
+ rpc Register(RegisterRequest) returns (AuthResponse);
6
+
7
+ rpc Login(LoginRequest) returns (AuthResponse);
6
8
  }
7
9
 
8
10
  message RegisterRequest {
@@ -12,6 +14,11 @@ message RegisterRequest {
12
14
  string userDesc = 4;
13
15
  }
14
16
 
15
- message RegisterResponse {
17
+ message AuthResponse {
16
18
  string message = 1;
17
- }
19
+ }
20
+
21
+ message LoginRequest {
22
+ string email = 1;
23
+ string password = 2;
24
+ }