@gastroly.io/contracts 1.0.24 → 1.0.25

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