@eyenest/contracts 1.6.12 → 1.6.14

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
@@ -57,8 +57,7 @@ export interface LoginRequest {
57
57
  }
58
58
 
59
59
  export interface LoginResponse {
60
- accessToken: string;
61
- refreshToken: string;
60
+ success: boolean;
62
61
  }
63
62
 
64
63
  export interface RefreshRequest {
@@ -79,6 +78,15 @@ export interface GetUserByIdResponse {
79
78
  email: string;
80
79
  }
81
80
 
81
+ export interface CheckOtpCodeRequest {
82
+ code: string;
83
+ }
84
+
85
+ export interface CheckOtpCodeResponse {
86
+ accessToken: string;
87
+ refreshToken: string;
88
+ }
89
+
82
90
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
83
91
 
84
92
  export interface AuthServiceClient {
@@ -99,6 +107,8 @@ export interface AuthServiceClient {
99
107
  ): Observable<UpdateUserNotificationSettingsResponse>;
100
108
 
101
109
  getUserIdByTelegramChatId(request: GetUserIdByTelegramChatIdRequest): Observable<GetUserIdByTelegramChatIdResponse>;
110
+
111
+ checkOtpCode(request: CheckOtpCodeRequest): Observable<CheckOtpCodeResponse>;
102
112
  }
103
113
 
104
114
  export interface AuthServiceController {
@@ -132,6 +142,10 @@ export interface AuthServiceController {
132
142
  | Promise<GetUserIdByTelegramChatIdResponse>
133
143
  | Observable<GetUserIdByTelegramChatIdResponse>
134
144
  | GetUserIdByTelegramChatIdResponse;
145
+
146
+ checkOtpCode(
147
+ request: CheckOtpCodeRequest,
148
+ ): Promise<CheckOtpCodeResponse> | Observable<CheckOtpCodeResponse> | CheckOtpCodeResponse;
135
149
  }
136
150
 
137
151
  export function AuthServiceControllerMethods() {
@@ -144,6 +158,7 @@ export function AuthServiceControllerMethods() {
144
158
  "getUserNotificationSettings",
145
159
  "updateUserNotificationSettings",
146
160
  "getUserIdByTelegramChatId",
161
+ "checkOtpCode",
147
162
  ];
148
163
  for (const method of grpcMethods) {
149
164
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
@@ -10,6 +10,17 @@ import { Observable } from "rxjs";
10
10
 
11
11
  export const protobufPackage = "notifications.v1";
12
12
 
13
+ export interface SendEmailRequest {
14
+ email: string;
15
+ subject: string;
16
+ text?: string | undefined;
17
+ html?: string | undefined;
18
+ }
19
+
20
+ export interface SendEmailResponse {
21
+ success: boolean;
22
+ }
23
+
13
24
  export interface LinkTokenRequest {
14
25
  userId: string;
15
26
  }
@@ -33,6 +44,8 @@ export interface NotificationsServiceClient {
33
44
  getLinkToken(request: LinkTokenRequest): Observable<LinkTokenResponse>;
34
45
 
35
46
  unlinkTelegramAccount(request: UnlinkTelegramAccountRequest): Observable<UnlinkTelegramAccountResponse>;
47
+
48
+ sendEmail(request: SendEmailRequest): Observable<SendEmailResponse>;
36
49
  }
37
50
 
38
51
  export interface NotificationsServiceController {
@@ -43,11 +56,13 @@ export interface NotificationsServiceController {
43
56
  unlinkTelegramAccount(
44
57
  request: UnlinkTelegramAccountRequest,
45
58
  ): Promise<UnlinkTelegramAccountResponse> | Observable<UnlinkTelegramAccountResponse> | UnlinkTelegramAccountResponse;
59
+
60
+ sendEmail(request: SendEmailRequest): Promise<SendEmailResponse> | Observable<SendEmailResponse> | SendEmailResponse;
46
61
  }
47
62
 
48
63
  export function NotificationsServiceControllerMethods() {
49
64
  return function (constructor: Function) {
50
- const grpcMethods: string[] = ["getLinkToken", "unlinkTelegramAccount"];
65
+ const grpcMethods: string[] = ["getLinkToken", "unlinkTelegramAccount", "sendEmail"];
51
66
  for (const method of grpcMethods) {
52
67
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
53
68
  GrpcMethod("NotificationsService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eyenest/contracts",
3
- "version": "1.6.12",
3
+ "version": "1.6.14",
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
@@ -11,6 +11,7 @@ service AuthService {
11
11
  rpc getUserNotificationSettings (GetUserNotificationSettingsRequest) returns (GetUserNotificationSettingsResponse);
12
12
  rpc updateUserNotificationSettings (UpdateUserNotificationSettingsRequest) returns (UpdateUserNotificationSettingsResponse);
13
13
  rpc getUserIdByTelegramChatId (GetUserIdByTelegramChatIdRequest) returns (GetUserIdByTelegramChatIdResponse);
14
+ rpc checkOtpCode (CheckOtpCodeRequest) returns (CheckOtpCodeResponse);
14
15
  }
15
16
 
16
17
 
@@ -63,8 +64,7 @@ message LoginRequest {
63
64
  }
64
65
 
65
66
  message LoginResponse {
66
- string accessToken = 1;
67
- string refreshToken = 2;
67
+ bool success = 1;
68
68
  }
69
69
 
70
70
  message RefreshRequest {
@@ -86,3 +86,12 @@ message GetUserByIdResponse {
86
86
  }
87
87
 
88
88
 
89
+ message CheckOtpCodeRequest {
90
+ string code = 1;
91
+ }
92
+
93
+ message CheckOtpCodeResponse {
94
+ string accessToken = 1;
95
+ string refreshToken = 2;
96
+ }
97
+
@@ -5,6 +5,18 @@ package notifications.v1;
5
5
  service NotificationsService {
6
6
  rpc GetLinkToken (LinkTokenRequest) returns (LinkTokenResponse);
7
7
  rpc UnlinkTelegramAccount (UnlinkTelegramAccountRequest) returns (UnlinkTelegramAccountResponse);
8
+ rpc SendEmail (SendEmailRequest) returns (SendEmailResponse);
9
+ }
10
+
11
+ message SendEmailRequest {
12
+ string email = 1;
13
+ string subject = 2;
14
+ optional string text = 3;
15
+ optional string html = 4;
16
+ }
17
+
18
+ message SendEmailResponse {
19
+ bool success = 1;
8
20
  }
9
21
 
10
22
  message LinkTokenRequest {