@slack-clone-org/contracts 1.0.15 → 1.0.16

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.
@@ -48,6 +48,25 @@ export interface ConfirmEmailChangeResponse {
48
48
  success: boolean;
49
49
  }
50
50
 
51
+ export interface InitPhoneChangeRequest {
52
+ accountId: string;
53
+ newPhoneNumber: string;
54
+ }
55
+
56
+ export interface InitPhoneChangeResponse {
57
+ success: boolean;
58
+ }
59
+
60
+ export interface ConfirmPhoneChangeRequest {
61
+ phoneNumber: string;
62
+ confirmationCode: string;
63
+ accountId: string;
64
+ }
65
+
66
+ export interface ConfirmPhoneChangeResponse {
67
+ success: boolean;
68
+ }
69
+
51
70
  export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
52
71
 
53
72
  /** AccountService provides account-related operations. */
@@ -64,6 +83,14 @@ export interface AccountServiceClient {
64
83
  /** Methods for confirming email changes. */
65
84
 
66
85
  confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
86
+
87
+ /** Methods for initiating phone changes. */
88
+
89
+ initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponse>;
90
+
91
+ /** Methods for confirming phone changes. */
92
+
93
+ confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponse>;
67
94
  }
68
95
 
69
96
  /** AccountService provides account-related operations. */
@@ -86,11 +113,29 @@ export interface AccountServiceController {
86
113
  confirmEmailChange(
87
114
  request: ConfirmEmailChangeRequest,
88
115
  ): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
116
+
117
+ /** Methods for initiating phone changes. */
118
+
119
+ initPhoneChange(
120
+ request: InitPhoneChangeRequest,
121
+ ): Promise<InitPhoneChangeResponse> | Observable<InitPhoneChangeResponse> | InitPhoneChangeResponse;
122
+
123
+ /** Methods for confirming phone changes. */
124
+
125
+ confirmPhoneChange(
126
+ request: ConfirmPhoneChangeRequest,
127
+ ): Promise<ConfirmPhoneChangeResponse> | Observable<ConfirmPhoneChangeResponse> | ConfirmPhoneChangeResponse;
89
128
  }
90
129
 
91
130
  export function AccountServiceControllerMethods() {
92
131
  return function (constructor: Function) {
93
- const grpcMethods: string[] = ["getAccount", "initEmailChange", "confirmEmailChange"];
132
+ const grpcMethods: string[] = [
133
+ "getAccount",
134
+ "initEmailChange",
135
+ "confirmEmailChange",
136
+ "initPhoneChange",
137
+ "confirmPhoneChange",
138
+ ];
94
139
  for (const method of grpcMethods) {
95
140
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
96
141
  GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slack-clone-org/contracts",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "Shared gRPC contracts and TypeScript definitions for Slack Clone microservices",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -11,6 +11,10 @@ service AccountService {
11
11
  rpc InitEmailChange (InitEmailChangeRequest) returns (InitEmailChangeResponse);
12
12
  // Methods for confirming email changes.
13
13
  rpc ConfirmEmailChange (ConfirmEmailChangeRequest) returns (ConfirmEmailChangeResponse);
14
+ // Methods for initiating phone changes.
15
+ rpc InitPhoneChange (InitPhoneChangeRequest) returns (InitPhoneChangeResponse);
16
+ // Methods for confirming phone changes.
17
+ rpc ConfirmPhoneChange (ConfirmPhoneChangeRequest) returns (ConfirmPhoneChangeResponse);
14
18
  }
15
19
 
16
20
  message GetAccountRequest {
@@ -45,6 +49,25 @@ message ConfirmEmailChangeResponse {
45
49
  bool success = 1;
46
50
  }
47
51
 
52
+ message InitPhoneChangeRequest {
53
+ string account_id = 1;
54
+ string new_phone_number = 2;
55
+ }
56
+
57
+ message InitPhoneChangeResponse {
58
+ bool success = 1;
59
+ }
60
+
61
+ message ConfirmPhoneChangeRequest {
62
+ string phone_number = 1;
63
+ string confirmation_code = 2;
64
+ string account_id = 3;
65
+ }
66
+
67
+ message ConfirmPhoneChangeResponse {
68
+ bool success = 1;
69
+ }
70
+
48
71
  enum GlobalRole {
49
72
  USER = 0;
50
73
  ADMIN = 1;