@slack-clone-org/contracts 1.0.18 → 1.0.20

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/generated/auth.ts CHANGED
@@ -10,15 +10,9 @@ import { Observable } from "rxjs";
10
10
 
11
11
  export const protobufPackage = "auth.v1";
12
12
 
13
- export enum IdentifierType {
14
- EMAIL = 0,
15
- PHONE = 1,
16
- UNRECOGNIZED = -1,
17
- }
18
-
19
13
  export interface SendOtpRequest {
20
14
  identifier: string;
21
- type: IdentifierType;
15
+ type: string;
22
16
  }
23
17
 
24
18
  export interface SendOtpResponse {
@@ -27,7 +21,7 @@ export interface SendOtpResponse {
27
21
 
28
22
  export interface VerifyOtpRequest {
29
23
  identifier: string;
30
- type: IdentifierType;
24
+ type: string;
31
25
  code: string;
32
26
  }
33
27
 
@@ -30,6 +30,24 @@ export interface TelegramVerifyResponse {
30
30
  refreshToken?: string | undefined;
31
31
  }
32
32
 
33
+ export interface TelegramCompleteRequest {
34
+ sessionId: string;
35
+ phone: string;
36
+ }
37
+
38
+ export interface TelegramCompleteResponse {
39
+ sessionId: string;
40
+ }
41
+
42
+ export interface TelegramConsumeRequest {
43
+ sessionId: string;
44
+ }
45
+
46
+ export interface TelegramConsumeResponse {
47
+ accessToken: string;
48
+ refreshToken: string;
49
+ }
50
+
33
51
  export const TELEGRAM_V1_PACKAGE_NAME = "telegram.v1";
34
52
 
35
53
  /** TelegramService provides operations related to Telegram integration. */
@@ -42,6 +60,14 @@ export interface TelegramServiceClient {
42
60
  /** TelegramVerify verifies the Telegram authentication using the provided code and account ID. */
43
61
 
44
62
  telegramVerify(request: TelegramVerifyRequest): Observable<TelegramVerifyResponse>;
63
+
64
+ /** TelegramComplete finalizes the authentication process. */
65
+
66
+ telegramComplete(request: TelegramCompleteRequest): Observable<TelegramCompleteResponse>;
67
+
68
+ /** TelegramConsume exchanges a valid session ID for authentication tokens. */
69
+
70
+ telegramConsume(request: TelegramConsumeRequest): Observable<TelegramConsumeResponse>;
45
71
  }
46
72
 
47
73
  /** TelegramService provides operations related to Telegram integration. */
@@ -56,11 +82,23 @@ export interface TelegramServiceController {
56
82
  telegramVerify(
57
83
  request: TelegramVerifyRequest,
58
84
  ): Promise<TelegramVerifyResponse> | Observable<TelegramVerifyResponse> | TelegramVerifyResponse;
85
+
86
+ /** TelegramComplete finalizes the authentication process. */
87
+
88
+ telegramComplete(
89
+ request: TelegramCompleteRequest,
90
+ ): Promise<TelegramCompleteResponse> | Observable<TelegramCompleteResponse> | TelegramCompleteResponse;
91
+
92
+ /** TelegramConsume exchanges a valid session ID for authentication tokens. */
93
+
94
+ telegramConsume(
95
+ request: TelegramConsumeRequest,
96
+ ): Promise<TelegramConsumeResponse> | Observable<TelegramConsumeResponse> | TelegramConsumeResponse;
59
97
  }
60
98
 
61
99
  export function TelegramServiceControllerMethods() {
62
100
  return function (constructor: Function) {
63
- const grpcMethods: string[] = ["telegramInit", "telegramVerify"];
101
+ const grpcMethods: string[] = ["telegramInit", "telegramVerify", "telegramComplete", "telegramConsume"];
64
102
  for (const method of grpcMethods) {
65
103
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
66
104
  GrpcMethod("TelegramService", 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.18",
3
+ "version": "1.0.20",
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",
package/proto/auth.proto CHANGED
@@ -14,7 +14,7 @@ service AuthService {
14
14
 
15
15
  message SendOtpRequest {
16
16
  string identifier = 1;
17
- IdentifierType type = 2;
17
+ string type = 2;
18
18
  }
19
19
 
20
20
  message SendOtpResponse {
@@ -23,7 +23,7 @@ message SendOtpResponse {
23
23
 
24
24
  message VerifyOtpRequest {
25
25
  string identifier = 1;
26
- IdentifierType type = 2;
26
+ string type = 2;
27
27
  string code = 3;
28
28
  }
29
29
 
@@ -40,8 +40,3 @@ message RefreshResponse {
40
40
  string access_token = 1;
41
41
  string refresh_token = 2;
42
42
  }
43
-
44
- enum IdentifierType {
45
- EMAIL = 0;
46
- PHONE = 1;
47
- }
@@ -10,7 +10,10 @@ service TelegramService {
10
10
  rpc TelegramInit (google.protobuf.Empty) returns (TelegramInitResponse);
11
11
  // TelegramVerify verifies the Telegram authentication using the provided code and account ID.
12
12
  rpc TelegramVerify (TelegramVerifyRequest) returns (TelegramVerifyResponse);
13
-
13
+ // TelegramComplete finalizes the authentication process.
14
+ rpc TelegramComplete (TelegramCompleteRequest) returns (TelegramCompleteResponse);
15
+ // TelegramConsume exchanges a valid session ID for authentication tokens.
16
+ rpc TelegramConsume (TelegramConsumeRequest) returns (TelegramConsumeResponse);
14
17
  }
15
18
 
16
19
  message TelegramInitResponse {
@@ -27,4 +30,22 @@ message TelegramVerifyResponse {
27
30
  string access_token = 2;
28
31
  string refresh_token = 3;
29
32
  }
33
+ }
34
+
35
+ message TelegramCompleteRequest {
36
+ string session_id = 1;
37
+ string phone = 2;
38
+ }
39
+
40
+ message TelegramCompleteResponse {
41
+ string session_id = 1;
42
+ }
43
+
44
+ message TelegramConsumeRequest {
45
+ string session_id = 1;
46
+ }
47
+
48
+ message TelegramConsumeResponse {
49
+ string access_token = 1;
50
+ string refresh_token = 2;
30
51
  }