@slack-clone-org/contracts 1.1.0 → 1.1.2

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.
@@ -0,0 +1,4 @@
1
+ export interface EmailChangedEvent {
2
+ email: string;
3
+ code: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from "./phone-changed.interface";
2
+ export * from "./email-changed.interface";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./phone-changed.interface"), exports);
18
+ __exportStar(require("./email-changed.interface"), exports);
@@ -0,0 +1,4 @@
1
+ export interface PhoneChangedEvent {
2
+ phone: string;
3
+ code: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,2 @@
1
1
  export * from "./auth";
2
+ export * from "./account";
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./auth"), exports);
18
+ __exportStar(require("./account"), exports);
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.11.4
3
+ // protoc-gen-ts_proto v2.11.6
4
4
  // protoc v3.21.12
5
5
  // source: account.proto
6
6
 
@@ -22,11 +22,51 @@ export interface GetAccountRequest {
22
22
 
23
23
  export interface GetAccountResponse {
24
24
  accountId: string;
25
- phoneNumber: string;
26
- email: string;
25
+ phoneNumber?: string | undefined;
26
+ email?: string | undefined;
27
27
  isPhoneVerified: boolean;
28
28
  isEmailVerified: boolean;
29
29
  role: GlobalRole;
30
+ isBanned: boolean;
31
+ bannedAt?: string | undefined;
32
+ banReason?: string | undefined;
33
+ createdAt: string;
34
+ updatedAt: string;
35
+ }
36
+
37
+ export interface GetAccountsRequest {
38
+ limit?: number | undefined;
39
+ offset?: number | undefined;
40
+ role?: GlobalRole | undefined;
41
+ isBanned?: boolean | undefined;
42
+ }
43
+
44
+ export interface GetAccountsResponse {
45
+ accounts: GetAccountResponse[];
46
+ total: number;
47
+ }
48
+
49
+ export interface DeleteAccountRequest {
50
+ accountId: string;
51
+ }
52
+
53
+ export interface DeleteAccountResponse {
54
+ success: boolean;
55
+ }
56
+
57
+ export interface UpdateAccountRequest {
58
+ accountId: string;
59
+ phoneNumber?: string | undefined;
60
+ email?: string | undefined;
61
+ isPhoneVerified?: boolean | undefined;
62
+ isEmailVerified?: boolean | undefined;
63
+ role?: GlobalRole | undefined;
64
+ isBanned?: boolean | undefined;
65
+ banReason?: string | undefined;
66
+ }
67
+
68
+ export interface UpdateAccountResponse {
69
+ success: boolean;
30
70
  }
31
71
 
32
72
  export interface InitEmailChangeRequest {
@@ -76,19 +116,31 @@ export interface AccountServiceClient {
76
116
 
77
117
  getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
78
118
 
79
- /** Methods for initiating email changes. */
119
+ /** GetAccounts retrieves a paginated list of accounts with optional filters. */
120
+
121
+ getAccounts(request: GetAccountsRequest): Observable<GetAccountsResponse>;
122
+
123
+ /** UpdateAccount updates account fields such as role, ban status, and contact info. */
124
+
125
+ updateAccount(request: UpdateAccountRequest): Observable<UpdateAccountResponse>;
126
+
127
+ /** DeleteAccount permanently removes an account by account ID. */
128
+
129
+ deleteAccount(request: DeleteAccountRequest): Observable<DeleteAccountResponse>;
130
+
131
+ /** InitEmailChange initiates an email change request by sending a verification code. */
80
132
 
81
133
  initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
82
134
 
83
- /** Methods for confirming email changes. */
135
+ /** ConfirmEmailChange confirms the email change using the verification code. */
84
136
 
85
137
  confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
86
138
 
87
- /** Methods for initiating phone changes. */
139
+ /** InitPhoneChange initiates a phone number change request by sending a verification code. */
88
140
 
89
141
  initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponse>;
90
142
 
91
- /** Methods for confirming phone changes. */
143
+ /** ConfirmPhoneChange confirms the phone number change using the verification code. */
92
144
 
93
145
  confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponse>;
94
146
  }
@@ -102,25 +154,43 @@ export interface AccountServiceController {
102
154
  request: GetAccountRequest,
103
155
  ): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
104
156
 
105
- /** Methods for initiating email changes. */
157
+ /** GetAccounts retrieves a paginated list of accounts with optional filters. */
158
+
159
+ getAccounts(
160
+ request: GetAccountsRequest,
161
+ ): Promise<GetAccountsResponse> | Observable<GetAccountsResponse> | GetAccountsResponse;
162
+
163
+ /** UpdateAccount updates account fields such as role, ban status, and contact info. */
164
+
165
+ updateAccount(
166
+ request: UpdateAccountRequest,
167
+ ): Promise<UpdateAccountResponse> | Observable<UpdateAccountResponse> | UpdateAccountResponse;
168
+
169
+ /** DeleteAccount permanently removes an account by account ID. */
170
+
171
+ deleteAccount(
172
+ request: DeleteAccountRequest,
173
+ ): Promise<DeleteAccountResponse> | Observable<DeleteAccountResponse> | DeleteAccountResponse;
174
+
175
+ /** InitEmailChange initiates an email change request by sending a verification code. */
106
176
 
107
177
  initEmailChange(
108
178
  request: InitEmailChangeRequest,
109
179
  ): Promise<InitEmailChangeResponse> | Observable<InitEmailChangeResponse> | InitEmailChangeResponse;
110
180
 
111
- /** Methods for confirming email changes. */
181
+ /** ConfirmEmailChange confirms the email change using the verification code. */
112
182
 
113
183
  confirmEmailChange(
114
184
  request: ConfirmEmailChangeRequest,
115
185
  ): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
116
186
 
117
- /** Methods for initiating phone changes. */
187
+ /** InitPhoneChange initiates a phone number change request by sending a verification code. */
118
188
 
119
189
  initPhoneChange(
120
190
  request: InitPhoneChangeRequest,
121
191
  ): Promise<InitPhoneChangeResponse> | Observable<InitPhoneChangeResponse> | InitPhoneChangeResponse;
122
192
 
123
- /** Methods for confirming phone changes. */
193
+ /** ConfirmPhoneChange confirms the phone number change using the verification code. */
124
194
 
125
195
  confirmPhoneChange(
126
196
  request: ConfirmPhoneChangeRequest,
@@ -131,6 +201,9 @@ export function AccountServiceControllerMethods() {
131
201
  return function (constructor: Function) {
132
202
  const grpcMethods: string[] = [
133
203
  "getAccount",
204
+ "getAccounts",
205
+ "updateAccount",
206
+ "deleteAccount",
134
207
  "initEmailChange",
135
208
  "confirmEmailChange",
136
209
  "initPhoneChange",
package/generated/auth.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.11.4
3
+ // protoc-gen-ts_proto v2.11.6
4
4
  // protoc v3.21.12
5
5
  // source: auth.proto
6
6
 
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.11.4
3
+ // protoc-gen-ts_proto v2.11.6
4
4
  // protoc v3.21.12
5
5
  // source: google/protobuf/empty.proto
6
6
 
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.11.4
3
+ // protoc-gen-ts_proto v2.11.6
4
4
  // protoc v3.21.12
5
5
  // source: telegram.proto
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slack-clone-org/contracts",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
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,14 +6,20 @@ package account.v1;
6
6
  service AccountService {
7
7
  // GetAccount retrieves account details by account ID.
8
8
  rpc GetAccount (GetAccountRequest) returns (GetAccountResponse);
9
+ // GetAccounts retrieves a paginated list of accounts with optional filters.
10
+ rpc GetAccounts (GetAccountsRequest) returns (GetAccountsResponse);
11
+ // UpdateAccount updates account fields such as role, ban status, and contact info.
12
+ rpc UpdateAccount (UpdateAccountRequest) returns (UpdateAccountResponse);
13
+ // DeleteAccount permanently removes an account by account ID.
14
+ rpc DeleteAccount (DeleteAccountRequest) returns (DeleteAccountResponse);
9
15
 
10
- // Methods for initiating email changes.
16
+ // InitEmailChange initiates an email change request by sending a verification code.
11
17
  rpc InitEmailChange (InitEmailChangeRequest) returns (InitEmailChangeResponse);
12
- // Methods for confirming email changes.
18
+ // ConfirmEmailChange confirms the email change using the verification code.
13
19
  rpc ConfirmEmailChange (ConfirmEmailChangeRequest) returns (ConfirmEmailChangeResponse);
14
- // Methods for initiating phone changes.
20
+ // InitPhoneChange initiates a phone number change request by sending a verification code.
15
21
  rpc InitPhoneChange (InitPhoneChangeRequest) returns (InitPhoneChangeResponse);
16
- // Methods for confirming phone changes.
22
+ // ConfirmPhoneChange confirms the phone number change using the verification code.
17
23
  rpc ConfirmPhoneChange (ConfirmPhoneChangeRequest) returns (ConfirmPhoneChangeResponse);
18
24
  }
19
25
 
@@ -23,11 +29,51 @@ message GetAccountRequest {
23
29
 
24
30
  message GetAccountResponse {
25
31
  string account_id = 1;
26
- string phone_number = 2;
27
- string email = 3;
32
+ optional string phone_number = 2;
33
+ optional string email = 3;
28
34
  bool is_phone_verified = 4;
29
35
  bool is_email_verified = 5;
30
36
  GlobalRole role = 6;
37
+ bool is_banned = 7;
38
+ optional string banned_at = 8;
39
+ optional string ban_reason = 9;
40
+ string created_at = 10;
41
+ string updated_at = 11;
42
+ }
43
+
44
+ message GetAccountsRequest {
45
+ optional int32 limit = 1;
46
+ optional int32 offset = 2;
47
+ optional GlobalRole role = 3;
48
+ optional bool is_banned = 4;
49
+ }
50
+
51
+ message GetAccountsResponse {
52
+ repeated GetAccountResponse accounts = 1;
53
+ int32 total = 2;
54
+ }
55
+
56
+ message DeleteAccountRequest {
57
+ string account_id = 1;
58
+ }
59
+
60
+ message DeleteAccountResponse {
61
+ bool success = 1;
62
+ }
63
+
64
+ message UpdateAccountRequest {
65
+ string account_id = 1;
66
+ optional string phone_number = 2;
67
+ optional string email = 3;
68
+ optional bool is_phone_verified = 4;
69
+ optional bool is_email_verified = 5;
70
+ optional GlobalRole role = 6;
71
+ optional bool is_banned = 7;
72
+ optional string ban_reason = 8;
73
+ }
74
+
75
+ message UpdateAccountResponse {
76
+ bool success = 1;
31
77
  }
32
78
 
33
79
  message InitEmailChangeRequest {