@yrarami-teacinema/contracts 1.0.7 → 1.0.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/account.ts CHANGED
@@ -29,21 +29,83 @@ export interface GetAccountResponse {
29
29
  role: Role;
30
30
  }
31
31
 
32
+ export interface InitEmailChangeRequest {
33
+ email: string;
34
+ userId: string;
35
+ }
36
+
37
+ export interface InitEmailChangeResponse {
38
+ ok: boolean;
39
+ }
40
+
41
+ export interface ConfirmEmailRequest {
42
+ email: string;
43
+ code: string;
44
+ userId: string;
45
+ }
46
+
47
+ export interface ConfirmEmailResponse {
48
+ ok: boolean;
49
+ }
50
+
51
+ export interface InitPhoneChangeRequest {
52
+ phone: string;
53
+ userId: string;
54
+ }
55
+
56
+ export interface InitPhoneChangeResponse {
57
+ ok: boolean;
58
+ }
59
+
60
+ export interface ConfirmPhoneRequest {
61
+ phone: string;
62
+ code: string;
63
+ userId: string;
64
+ }
65
+
66
+ export interface ConfirmPhoneResponse {
67
+ ok: boolean;
68
+ }
69
+
32
70
  export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
33
71
 
34
72
  export interface AccountServiceClient {
35
73
  getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
74
+
75
+ initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
76
+
77
+ confirmEmail(request: ConfirmEmailRequest): Observable<ConfirmEmailResponse>;
78
+
79
+ initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponse>;
80
+
81
+ confirmPhone(request: ConfirmPhoneRequest): Observable<ConfirmPhoneResponse>;
36
82
  }
37
83
 
38
84
  export interface AccountServiceController {
39
85
  getAccount(
40
86
  request: GetAccountRequest,
41
87
  ): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
88
+
89
+ initEmailChange(
90
+ request: InitEmailChangeRequest,
91
+ ): Promise<InitEmailChangeResponse> | Observable<InitEmailChangeResponse> | InitEmailChangeResponse;
92
+
93
+ confirmEmail(
94
+ request: ConfirmEmailRequest,
95
+ ): Promise<ConfirmEmailResponse> | Observable<ConfirmEmailResponse> | ConfirmEmailResponse;
96
+
97
+ initPhoneChange(
98
+ request: InitPhoneChangeRequest,
99
+ ): Promise<InitPhoneChangeResponse> | Observable<InitPhoneChangeResponse> | InitPhoneChangeResponse;
100
+
101
+ confirmPhone(
102
+ request: ConfirmPhoneRequest,
103
+ ): Promise<ConfirmPhoneResponse> | Observable<ConfirmPhoneResponse> | ConfirmPhoneResponse;
42
104
  }
43
105
 
44
106
  export function AccountServiceControllerMethods() {
45
107
  return function (constructor: Function) {
46
- const grpcMethods: string[] = ["getAccount"];
108
+ const grpcMethods: string[] = ["getAccount", "initEmailChange", "confirmEmail", "initPhoneChange", "confirmPhone"];
47
109
  for (const method of grpcMethods) {
48
110
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
49
111
  GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yrarami-teacinema/contracts",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Protobufs for the TeaCinema project",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -4,6 +4,12 @@ package account.v1;
4
4
 
5
5
  service AccountService {
6
6
  rpc GetAccount (GetAccountRequest) returns (GetAccountResponse);
7
+
8
+ rpc InitEmailChange (InitEmailChangeRequest) returns (InitEmailChangeResponse);
9
+ rpc ConfirmEmail (ConfirmEmailRequest) returns (ConfirmEmailResponse);
10
+
11
+ rpc InitPhoneChange (InitPhoneChangeRequest) returns (InitPhoneChangeResponse);
12
+ rpc ConfirmPhone (ConfirmPhoneRequest) returns (ConfirmPhoneResponse);
7
13
  }
8
14
 
9
15
  message GetAccountRequest {
@@ -19,6 +25,44 @@ message GetAccountResponse {
19
25
  Role role = 6;
20
26
  }
21
27
 
28
+ message InitEmailChangeRequest {
29
+ string email = 1;
30
+ string user_id = 2;
31
+ }
32
+
33
+ message InitEmailChangeResponse {
34
+ bool ok = 1;
35
+ }
36
+
37
+ message ConfirmEmailRequest {
38
+ string email = 1;
39
+ string code = 2;
40
+ string user_id = 3;
41
+ }
42
+
43
+ message ConfirmEmailResponse {
44
+ bool ok = 1;
45
+ }
46
+
47
+ message InitPhoneChangeRequest {
48
+ string phone = 1;
49
+ string user_id = 2;
50
+ }
51
+
52
+ message InitPhoneChangeResponse {
53
+ bool ok = 1;
54
+ }
55
+
56
+ message ConfirmPhoneRequest {
57
+ string phone = 1;
58
+ string code = 2;
59
+ string user_id = 3;
60
+ }
61
+
62
+ message ConfirmPhoneResponse {
63
+ bool ok = 1;
64
+ }
65
+
22
66
  enum Role {
23
67
  USER = 0;
24
68
  ADMIN = 1;