@requ1emz/contracts 1.0.0 → 1.0.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/auth.ts CHANGED
@@ -20,21 +20,35 @@ export interface SendRegistationResponse {
20
20
  ok: boolean;
21
21
  }
22
22
 
23
+ export interface SendLoginRequest {
24
+ login: string;
25
+ password: string;
26
+ }
27
+
28
+ export interface SendLoginResponse {
29
+ accesToken: string;
30
+ refreshToken: string;
31
+ }
32
+
23
33
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
24
34
 
25
35
  export interface AuthServiceClient {
26
36
  register(request: SendRegistrationRequest): Observable<SendRegistationResponse>;
37
+
38
+ login(request: SendLoginRequest): Observable<SendLoginResponse>;
27
39
  }
28
40
 
29
41
  export interface AuthServiceController {
30
42
  register(
31
43
  request: SendRegistrationRequest,
32
44
  ): Promise<SendRegistationResponse> | Observable<SendRegistationResponse> | SendRegistationResponse;
45
+
46
+ login(request: SendLoginRequest): Promise<SendLoginResponse> | Observable<SendLoginResponse> | SendLoginResponse;
33
47
  }
34
48
 
35
49
  export function AuthServiceControllerMethods() {
36
50
  return function (constructor: Function) {
37
- const grpcMethods: string[] = ["register"];
51
+ const grpcMethods: string[] = ["register", "login"];
38
52
  for (const method of grpcMethods) {
39
53
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
40
54
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@requ1emz/contracts",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "scripts": {
6
6
  "generate": "protoc -I ./proto/ ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
package/proto/auth.proto CHANGED
@@ -3,16 +3,26 @@ syntax = "proto3";
3
3
  package auth.v1;
4
4
 
5
5
  service AuthService {
6
- rpc Register (SendRegistrationRequest) returns (SendRegistationResponse );
6
+ rpc Register (SendRegistrationRequest) returns (SendRegistationResponse );
7
+ rpc Login (SendLoginRequest) returns (SendLoginResponse);
7
8
  }
8
9
 
9
-
10
10
  message SendRegistrationRequest {
11
- string login = 1;
11
+ string login = 1;
12
12
  string password = 2;
13
13
  string username = 3;
14
14
  }
15
15
 
16
16
  message SendRegistationResponse {
17
17
  bool ok = 1;
18
+ }
19
+
20
+ message SendLoginRequest {
21
+ string login = 1;
22
+ string password = 2;
23
+ }
24
+
25
+ message SendLoginResponse {
26
+ string acces_token = 1;
27
+ string refresh_token = 2;
18
28
  }