@eyenest/contracts 1.6.5 → 1.6.8

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
@@ -10,6 +10,29 @@ import { Observable } from "rxjs";
10
10
 
11
11
  export const protobufPackage = "auth.v1";
12
12
 
13
+ export interface GetUserNotificationSettingsRequest {
14
+ userId: string;
15
+ }
16
+
17
+ export interface GetUserNotificationSettingsResponse {
18
+ telegramEnabled: boolean;
19
+ telegramChatId: string;
20
+ emailEnabled: boolean;
21
+ }
22
+
23
+ export interface UpdateUserNotificationSettingsRequest {
24
+ userId: string;
25
+ telegramEnabled: boolean;
26
+ telegramChatId: string;
27
+ emailEnabled: boolean;
28
+ }
29
+
30
+ export interface UpdateUserNotificationSettingsResponse {
31
+ telegramEnabled: boolean;
32
+ telegramChatId: string;
33
+ emailEnabled: boolean;
34
+ }
35
+
13
36
  export interface RegisterRequest {
14
37
  email: string;
15
38
  password: string;
@@ -58,6 +81,14 @@ export interface AuthServiceClient {
58
81
  refresh(request: RefreshRequest): Observable<RefreshResponse>;
59
82
 
60
83
  getUserById(request: GetUserByIdRequest): Observable<GetUserByIdResponse>;
84
+
85
+ getUserNotificationSettings(
86
+ request: GetUserNotificationSettingsRequest,
87
+ ): Observable<GetUserNotificationSettingsResponse>;
88
+
89
+ updateUserNotificationSettings(
90
+ request: UpdateUserNotificationSettingsRequest,
91
+ ): Observable<UpdateUserNotificationSettingsResponse>;
61
92
  }
62
93
 
63
94
  export interface AuthServiceController {
@@ -70,11 +101,32 @@ export interface AuthServiceController {
70
101
  getUserById(
71
102
  request: GetUserByIdRequest,
72
103
  ): Promise<GetUserByIdResponse> | Observable<GetUserByIdResponse> | GetUserByIdResponse;
104
+
105
+ getUserNotificationSettings(
106
+ request: GetUserNotificationSettingsRequest,
107
+ ):
108
+ | Promise<GetUserNotificationSettingsResponse>
109
+ | Observable<GetUserNotificationSettingsResponse>
110
+ | GetUserNotificationSettingsResponse;
111
+
112
+ updateUserNotificationSettings(
113
+ request: UpdateUserNotificationSettingsRequest,
114
+ ):
115
+ | Promise<UpdateUserNotificationSettingsResponse>
116
+ | Observable<UpdateUserNotificationSettingsResponse>
117
+ | UpdateUserNotificationSettingsResponse;
73
118
  }
74
119
 
75
120
  export function AuthServiceControllerMethods() {
76
121
  return function (constructor: Function) {
77
- const grpcMethods: string[] = ["register", "login", "refresh", "getUserById"];
122
+ const grpcMethods: string[] = [
123
+ "register",
124
+ "login",
125
+ "refresh",
126
+ "getUserById",
127
+ "getUserNotificationSettings",
128
+ "updateUserNotificationSettings",
129
+ ];
78
130
  for (const method of grpcMethods) {
79
131
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
80
132
  GrpcMethod("AuthService", 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.5",
3
+ "version": "1.6.8",
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
@@ -8,8 +8,34 @@ service AuthService {
8
8
  rpc login (LoginRequest) returns (LoginResponse);
9
9
  rpc refresh (RefreshRequest) returns (RefreshResponse);
10
10
  rpc getUserById (GetUserByIdRequest) returns (GetUserByIdResponse);
11
+ rpc getUserNotificationSettings (GetUserNotificationSettingsRequest) returns (GetUserNotificationSettingsResponse);
12
+ rpc updateUserNotificationSettings (UpdateUserNotificationSettingsRequest) returns (UpdateUserNotificationSettingsResponse);
11
13
  }
12
14
 
15
+ message GetUserNotificationSettingsRequest {
16
+ string userId = 1;
17
+ }
18
+
19
+ message GetUserNotificationSettingsResponse {
20
+ bool telegramEnabled = 1;
21
+ string telegramChatId = 2;
22
+ bool emailEnabled = 3;
23
+ }
24
+
25
+ message UpdateUserNotificationSettingsRequest {
26
+ string userId = 1;
27
+ bool telegramEnabled = 2;
28
+ string telegramChatId = 3;
29
+ bool emailEnabled = 4;
30
+ }
31
+
32
+ message UpdateUserNotificationSettingsResponse {
33
+ bool telegramEnabled = 1;
34
+ string telegramChatId = 2;
35
+ bool emailEnabled = 3;
36
+ }
37
+
38
+
13
39
  message RegisterRequest {
14
40
  string email = 1;
15
41
  string password = 2;