@org-flemycinema/contracts 1.0.5 → 1.0.7

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
@@ -16,6 +16,7 @@ export enum Role {
16
16
  UNRECOGNIZED = -1,
17
17
  }
18
18
 
19
+ /** Account */
19
20
  export interface GetAccountRequest {
20
21
  id: string;
21
22
  }
@@ -29,21 +30,103 @@ export interface GetAccountRespose {
29
30
  role: Role;
30
31
  }
31
32
 
33
+ /** Email */
34
+ export interface InitEmailChangeRequest {
35
+ email: string;
36
+ userId: string;
37
+ }
38
+
39
+ export interface InitEmailChangeResponse {
40
+ ok: boolean;
41
+ }
42
+
43
+ export interface ConfirmEmailChangeRequest {
44
+ email: string;
45
+ code: string;
46
+ userId: string;
47
+ }
48
+
49
+ export interface ConfirmEmailChangeResponse {
50
+ ok: boolean;
51
+ }
52
+
53
+ /** Phone */
54
+ export interface InitPhoneChangeRequest {
55
+ phone: string;
56
+ userId: string;
57
+ }
58
+
59
+ export interface InitPhoneChangeResponse {
60
+ ok: boolean;
61
+ }
62
+
63
+ export interface ConfirmPhoneChangeRequest {
64
+ phone: string;
65
+ code: string;
66
+ userId: string;
67
+ }
68
+
69
+ export interface ConfirmPhoneChangeResponse {
70
+ ok: boolean;
71
+ }
72
+
32
73
  export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
33
74
 
34
75
  export interface AccountServiceClient {
76
+ /** Account */
77
+
35
78
  getAccount(request: GetAccountRequest): Observable<GetAccountRespose>;
79
+
80
+ /** Email */
81
+
82
+ initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
83
+
84
+ confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
85
+
86
+ /** Phone */
87
+
88
+ initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponse>;
89
+
90
+ confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponse>;
36
91
  }
37
92
 
38
93
  export interface AccountServiceController {
94
+ /** Account */
95
+
39
96
  getAccount(
40
97
  request: GetAccountRequest,
41
98
  ): Promise<GetAccountRespose> | Observable<GetAccountRespose> | GetAccountRespose;
99
+
100
+ /** Email */
101
+
102
+ initEmailChange(
103
+ request: InitEmailChangeRequest,
104
+ ): Promise<InitEmailChangeResponse> | Observable<InitEmailChangeResponse> | InitEmailChangeResponse;
105
+
106
+ confirmEmailChange(
107
+ request: ConfirmEmailChangeRequest,
108
+ ): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
109
+
110
+ /** Phone */
111
+
112
+ initPhoneChange(
113
+ request: InitPhoneChangeRequest,
114
+ ): Promise<InitPhoneChangeResponse> | Observable<InitPhoneChangeResponse> | InitPhoneChangeResponse;
115
+
116
+ confirmPhoneChange(
117
+ request: ConfirmPhoneChangeRequest,
118
+ ): Promise<ConfirmPhoneChangeResponse> | Observable<ConfirmPhoneChangeResponse> | ConfirmPhoneChangeResponse;
42
119
  }
43
120
 
44
121
  export function AccountServiceControllerMethods() {
45
122
  return function (constructor: Function) {
46
- const grpcMethods: string[] = ["getAccount"];
123
+ const grpcMethods: string[] = [
124
+ "getAccount",
125
+ "initEmailChange",
126
+ "confirmEmailChange",
127
+ "initPhoneChange",
128
+ "confirmPhoneChange",
129
+ ];
47
130
  for (const method of grpcMethods) {
48
131
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
49
132
  GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@org-flemycinema/contracts",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -3,23 +3,73 @@ syntax = "proto3";
3
3
  package account.v1;
4
4
 
5
5
  service AccountService {
6
+ // Account
6
7
  rpc GetAccount (GetAccountRequest) returns (GetAccountRespose);
8
+
9
+ // Email
10
+ rpc InitEmailChange (InitEmailChangeRequest) returns (InitEmailChangeResponse);
11
+ rpc ConfirmEmailChange (ConfirmEmailChangeRequest) returns (ConfirmEmailChangeResponse);
12
+
13
+ // Phone
14
+ rpc InitPhoneChange (InitPhoneChangeRequest) returns (InitPhoneChangeResponse);
15
+ rpc ConfirmPhoneChange (ConfirmPhoneChangeRequest) returns (ConfirmPhoneChangeResponse);
7
16
  }
8
17
 
18
+ // Account
9
19
  message GetAccountRequest {
10
- string id = 1;
20
+ string id = 1;
11
21
  }
12
22
 
13
23
  message GetAccountRespose {
14
- string id = 1;
15
- string phone = 2;
16
- string email = 3;
17
- bool is_phone_verified = 4;
18
- bool is_email_verified = 5;
19
- Role role = 6;
24
+ string id = 1;
25
+ string phone = 2;
26
+ string email = 3;
27
+ bool is_phone_verified = 4;
28
+ bool is_email_verified = 5;
29
+ Role role = 6;
30
+ }
31
+
32
+ // Email
33
+ message InitEmailChangeRequest {
34
+ string email = 1;
35
+ string user_id = 2;
36
+ }
37
+
38
+ message InitEmailChangeResponse {
39
+ bool ok = 1;
40
+ }
41
+
42
+ message ConfirmEmailChangeRequest {
43
+ string email = 1;
44
+ string code = 2;
45
+ string user_id = 3;
46
+ }
47
+
48
+ message ConfirmEmailChangeResponse {
49
+ bool ok = 1;
50
+ }
51
+
52
+ // Phone
53
+ message InitPhoneChangeRequest {
54
+ string phone = 1;
55
+ string user_id = 2;
56
+ }
57
+
58
+ message InitPhoneChangeResponse {
59
+ bool ok = 1;
60
+ }
61
+
62
+ message ConfirmPhoneChangeRequest {
63
+ string phone = 1;
64
+ string code = 2;
65
+ string user_id = 3;
66
+ }
67
+
68
+ message ConfirmPhoneChangeResponse {
69
+ bool ok = 1;
20
70
  }
21
71
 
22
72
  enum Role {
23
- USER = 0;
24
- ADMIN = 1;
73
+ USER = 0;
74
+ ADMIN = 1;
25
75
  }