@dkcinema/contracts 1.0.11 → 1.0.13

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,16 @@ 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
+
13
23
  export interface VerifyEmailOtpRequest {
14
24
  code: string;
15
25
  email: string;
@@ -58,6 +68,8 @@ export interface AuthServiceClient {
58
68
  verifyPhoneOtp(request: VerifyPhoneOtpRequest): Observable<VerifyOtpResponse>;
59
69
 
60
70
  loginByEmail(request: LoginByEmailRequest): Observable<LoginByEmailResponse>;
71
+
72
+ getUser(request: UserRequest): Observable<UserResponse>;
61
73
  }
62
74
 
63
75
  export interface AuthServiceController {
@@ -76,11 +88,20 @@ export interface AuthServiceController {
76
88
  loginByEmail(
77
89
  request: LoginByEmailRequest,
78
90
  ): Promise<LoginByEmailResponse> | Observable<LoginByEmailResponse> | LoginByEmailResponse;
91
+
92
+ getUser(request: UserRequest): Promise<UserResponse> | Observable<UserResponse> | UserResponse;
79
93
  }
80
94
 
81
95
  export function AuthServiceControllerMethods() {
82
96
  return function (constructor: Function) {
83
- const grpcMethods: string[] = ["sendEmailOtp", "sendPhoneOtp", "verifyEmailOtp", "verifyPhoneOtp", "loginByEmail"];
97
+ const grpcMethods: string[] = [
98
+ "sendEmailOtp",
99
+ "sendPhoneOtp",
100
+ "verifyEmailOtp",
101
+ "verifyPhoneOtp",
102
+ "loginByEmail",
103
+ "getUser",
104
+ ];
84
105
  for (const method of grpcMethods) {
85
106
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
86
107
  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.13",
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,17 @@ 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;
13
24
  }
14
25
 
15
26
  message VerifyEmailOtpRequest {