@samelazy/contracts 1.0.8 → 1.0.10

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