@dkcinema/contracts 1.0.11 → 1.0.12

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/output/auth.ts CHANGED
@@ -10,6 +10,28 @@ import { Observable } from "rxjs";
10
10
 
11
11
  export const protobufPackage = "auth.v1";
12
12
 
13
+ export interface UserRequest {
14
+ userId: string;
15
+ }
16
+
17
+ export interface UserResponse {
18
+ id: string;
19
+ name: string;
20
+ email: string;
21
+ }
22
+
23
+ export interface User {
24
+ }
25
+
26
+ export interface GetUserRequest {
27
+ /** или int64, или UUID */
28
+ userId: string;
29
+ }
30
+
31
+ export interface GetUserResponse {
32
+ user: User | undefined;
33
+ }
34
+
13
35
  export interface VerifyEmailOtpRequest {
14
36
  code: string;
15
37
  email: string;
@@ -58,6 +80,8 @@ export interface AuthServiceClient {
58
80
  verifyPhoneOtp(request: VerifyPhoneOtpRequest): Observable<VerifyOtpResponse>;
59
81
 
60
82
  loginByEmail(request: LoginByEmailRequest): Observable<LoginByEmailResponse>;
83
+
84
+ getUser(request: UserRequest): Observable<UserResponse>;
61
85
  }
62
86
 
63
87
  export interface AuthServiceController {
@@ -76,11 +100,20 @@ export interface AuthServiceController {
76
100
  loginByEmail(
77
101
  request: LoginByEmailRequest,
78
102
  ): Promise<LoginByEmailResponse> | Observable<LoginByEmailResponse> | LoginByEmailResponse;
103
+
104
+ getUser(request: UserRequest): Promise<UserResponse> | Observable<UserResponse> | UserResponse;
79
105
  }
80
106
 
81
107
  export function AuthServiceControllerMethods() {
82
108
  return function (constructor: Function) {
83
- const grpcMethods: string[] = ["sendEmailOtp", "sendPhoneOtp", "verifyEmailOtp", "verifyPhoneOtp", "loginByEmail"];
109
+ const grpcMethods: string[] = [
110
+ "sendEmailOtp",
111
+ "sendPhoneOtp",
112
+ "verifyEmailOtp",
113
+ "verifyPhoneOtp",
114
+ "loginByEmail",
115
+ "getUser",
116
+ ];
84
117
  for (const method of grpcMethods) {
85
118
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
86
119
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dkcinema/contracts",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/protos/auth.proto CHANGED
@@ -10,6 +10,29 @@ service AuthService {
10
10
  rpc VerifyPhoneOtp(VerifyPhoneOtpRequest) returns (VerifyOtpResponse);
11
11
 
12
12
  rpc LoginByEmail (LoginByEmailRequest) returns (LoginByEmailResponse);
13
+ rpc GetUser (UserRequest) returns (UserResponse);
14
+ }
15
+
16
+ message UserRequest {
17
+ string user_id = 1;
18
+ }
19
+
20
+ message UserResponse {
21
+ string id = 1;
22
+ string name = 2;
23
+ string email = 3;
24
+ }
25
+
26
+ message User {
27
+
28
+ }
29
+
30
+ message GetUserRequest {
31
+ string user_id = 1; // или int64, или UUID
32
+ }
33
+
34
+ message GetUserResponse {
35
+ User user = 1;
13
36
  }
14
37
 
15
38
  message VerifyEmailOtpRequest {