@slack-clone-org/contracts 1.0.12 → 1.0.13

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.
@@ -29,6 +29,25 @@ export interface GetAccountResponse {
29
29
  role: GlobalRole;
30
30
  }
31
31
 
32
+ export interface InitEmailChangeRequest {
33
+ accountId: string;
34
+ newEmail: string;
35
+ }
36
+
37
+ export interface InitEmailChangeResponse {
38
+ success: boolean;
39
+ }
40
+
41
+ export interface ConfirmEmailChangeRequest {
42
+ email: string;
43
+ confirmationCode: string;
44
+ accountId: string;
45
+ }
46
+
47
+ export interface ConfirmEmailChangeResponse {
48
+ success: boolean;
49
+ }
50
+
32
51
  export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
33
52
 
34
53
  /** AccountService provides account-related operations. */
@@ -37,6 +56,14 @@ export interface AccountServiceClient {
37
56
  /** GetAccount retrieves account details by account ID. */
38
57
 
39
58
  getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
59
+
60
+ /** Methods for initiating email changes. */
61
+
62
+ initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
63
+
64
+ /** Methods for confirming email changes. */
65
+
66
+ confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
40
67
  }
41
68
 
42
69
  /** AccountService provides account-related operations. */
@@ -47,11 +74,23 @@ export interface AccountServiceController {
47
74
  getAccount(
48
75
  request: GetAccountRequest,
49
76
  ): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
77
+
78
+ /** Methods for initiating email changes. */
79
+
80
+ initEmailChange(
81
+ request: InitEmailChangeRequest,
82
+ ): Promise<InitEmailChangeResponse> | Observable<InitEmailChangeResponse> | InitEmailChangeResponse;
83
+
84
+ /** Methods for confirming email changes. */
85
+
86
+ confirmEmailChange(
87
+ request: ConfirmEmailChangeRequest,
88
+ ): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
50
89
  }
51
90
 
52
91
  export function AccountServiceControllerMethods() {
53
92
  return function (constructor: Function) {
54
- const grpcMethods: string[] = ["getAccount"];
93
+ const grpcMethods: string[] = ["getAccount", "initEmailChange", "confirmEmailChange"];
55
94
  for (const method of grpcMethods) {
56
95
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
57
96
  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.12",
3
+ "version": "1.0.13",
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",
@@ -6,6 +6,11 @@ package account.v1;
6
6
  service AccountService {
7
7
  // GetAccount retrieves account details by account ID.
8
8
  rpc GetAccount (GetAccountRequest) returns (GetAccountResponse);
9
+
10
+ // Methods for initiating email changes.
11
+ rpc InitEmailChange (InitEmailChangeRequest) returns (InitEmailChangeResponse);
12
+ // Methods for confirming email changes.
13
+ rpc ConfirmEmailChange (ConfirmEmailChangeRequest) returns (ConfirmEmailChangeResponse);
9
14
  }
10
15
 
11
16
  message GetAccountRequest {
@@ -21,6 +26,25 @@ message GetAccountResponse {
21
26
  GlobalRole role = 6;
22
27
  }
23
28
 
29
+ message InitEmailChangeRequest {
30
+ string account_id = 1;
31
+ string new_email = 2;
32
+ }
33
+
34
+ message InitEmailChangeResponse {
35
+ bool success = 1;
36
+ }
37
+
38
+ message ConfirmEmailChangeRequest {
39
+ string email = 1;
40
+ string confirmation_code = 2;
41
+ string account_id = 3;
42
+ }
43
+
44
+ message ConfirmEmailChangeResponse {
45
+ bool success = 1;
46
+ }
47
+
24
48
  enum GlobalRole {
25
49
  USER = 0;
26
50
  ADMIN = 1;