@kottvideo/contracts 1.1.1 → 1.1.3

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/gen/account.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.0
3
+ // protoc-gen-ts_proto v2.11.1
4
4
  // protoc v3.21.12
5
5
  // source: account.proto
6
6
 
package/gen/auth.ts CHANGED
@@ -1,15 +1,17 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.11.0
3
+ // protoc-gen-ts_proto v2.11.1
4
4
  // protoc v3.21.12
5
5
  // source: auth.proto
6
6
 
7
7
  /* eslint-disable */
8
8
  import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
9
  import { Observable } from "rxjs";
10
+ import { Empty } from "./google/protobuf/empty";
10
11
 
11
12
  export const protobufPackage = "auth.v1";
12
13
 
14
+ /** One-time passwords */
13
15
  export interface SendOtpRequest {
14
16
  identifier: string;
15
17
  type: string;
@@ -30,6 +32,7 @@ export interface VerifyOtpResponse {
30
32
  refreshToken: string;
31
33
  }
32
34
 
35
+ /** Authentication tokens */
33
36
  export interface RefreshTokenRequest {
34
37
  refreshToken: string;
35
38
  }
@@ -39,6 +42,44 @@ export interface RefreshTokenResponse {
39
42
  refreshToken: string;
40
43
  }
41
44
 
45
+ /** Telegram authentication */
46
+ export interface TelegramInitResponse {
47
+ url: string;
48
+ }
49
+
50
+ export interface TelegramVerifyRequest {
51
+ query: { [key: string]: string };
52
+ }
53
+
54
+ export interface TelegramVerifyRequest_QueryEntry {
55
+ key: string;
56
+ value: string;
57
+ }
58
+
59
+ export interface TelegramVerifyResponse {
60
+ url?: string | undefined;
61
+ accessToken?: string | undefined;
62
+ refreshToken?: string | undefined;
63
+ }
64
+
65
+ export interface TelegramCompleteRequest {
66
+ sessionId: string;
67
+ phone: string;
68
+ }
69
+
70
+ export interface TelegramCompleteResponse {
71
+ sessionId: string;
72
+ }
73
+
74
+ export interface TelegramConsumeRequest {
75
+ sessionId: string;
76
+ }
77
+
78
+ export interface TelegramConsumeResponse {
79
+ accessToken: string;
80
+ refreshToken: string;
81
+ }
82
+
42
83
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
43
84
 
44
85
  export interface AuthServiceClient {
@@ -51,6 +92,16 @@ export interface AuthServiceClient {
51
92
  /** Authentication tokens */
52
93
 
53
94
  refreshToken(request: RefreshTokenRequest): Observable<RefreshTokenResponse>;
95
+
96
+ /** Telegram authentication */
97
+
98
+ telegramInit(request: Empty): Observable<TelegramInitResponse>;
99
+
100
+ telegramVerify(request: TelegramVerifyRequest): Observable<TelegramVerifyResponse>;
101
+
102
+ telegramComplete(request: TelegramCompleteRequest): Observable<TelegramCompleteResponse>;
103
+
104
+ telegramConsume(request: TelegramConsumeRequest): Observable<TelegramConsumeResponse>;
54
105
  }
55
106
 
56
107
  export interface AuthServiceController {
@@ -65,11 +116,35 @@ export interface AuthServiceController {
65
116
  refreshToken(
66
117
  request: RefreshTokenRequest,
67
118
  ): Promise<RefreshTokenResponse> | Observable<RefreshTokenResponse> | RefreshTokenResponse;
119
+
120
+ /** Telegram authentication */
121
+
122
+ telegramInit(request: Empty): Promise<TelegramInitResponse> | Observable<TelegramInitResponse> | TelegramInitResponse;
123
+
124
+ telegramVerify(
125
+ request: TelegramVerifyRequest,
126
+ ): Promise<TelegramVerifyResponse> | Observable<TelegramVerifyResponse> | TelegramVerifyResponse;
127
+
128
+ telegramComplete(
129
+ request: TelegramCompleteRequest,
130
+ ): Promise<TelegramCompleteResponse> | Observable<TelegramCompleteResponse> | TelegramCompleteResponse;
131
+
132
+ telegramConsume(
133
+ request: TelegramConsumeRequest,
134
+ ): Promise<TelegramConsumeResponse> | Observable<TelegramConsumeResponse> | TelegramConsumeResponse;
68
135
  }
69
136
 
70
137
  export function AuthServiceControllerMethods() {
71
138
  return function (constructor: Function) {
72
- const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refreshToken"];
139
+ const grpcMethods: string[] = [
140
+ "sendOtp",
141
+ "verifyOtp",
142
+ "refreshToken",
143
+ "telegramInit",
144
+ "telegramVerify",
145
+ "telegramComplete",
146
+ "telegramConsume",
147
+ ];
73
148
  for (const method of grpcMethods) {
74
149
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
75
150
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
@@ -0,0 +1,23 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.1
4
+ // protoc v3.21.12
5
+ // source: google/protobuf/empty.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ export const protobufPackage = "google.protobuf";
10
+
11
+ /**
12
+ * A generic empty message that you can re-use to avoid defining duplicated
13
+ * empty messages in your APIs. A typical example is to use it as the request
14
+ * or the response type of an API method. For instance:
15
+ *
16
+ * service Foo {
17
+ * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
18
+ * }
19
+ */
20
+ export interface Empty {
21
+ }
22
+
23
+ export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kottvideo/contracts",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "gRPC contracts for KottVideo microservices",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/auth.proto CHANGED
@@ -2,6 +2,8 @@ syntax = "proto3";
2
2
 
3
3
  package auth.v1;
4
4
 
5
+ import "google/protobuf/empty.proto";
6
+
5
7
  service AuthService {
6
8
  // One-time passwords
7
9
  rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
@@ -9,8 +11,16 @@ service AuthService {
9
11
 
10
12
  // Authentication tokens
11
13
  rpc RefreshToken (RefreshTokenRequest) returns (RefreshTokenResponse);
14
+
15
+ // Telegram authentication
16
+ rpc TelegramInit (google.protobuf.Empty) returns (TelegramInitResponse);
17
+ rpc TelegramVerify (TelegramVerifyRequest) returns (TelegramVerifyResponse);
18
+
19
+ rpc TelegramComplete (TelegramCompleteRequest) returns (TelegramCompleteResponse);
20
+ rpc TelegramConsume (TelegramConsumeRequest) returns (TelegramConsumeResponse);
12
21
  }
13
22
 
23
+ // One-time passwords
14
24
  message SendOtpRequest {
15
25
  string identifier = 1;
16
26
  string type = 2;
@@ -31,6 +41,7 @@ message VerifyOtpResponse {
31
41
  string refresh_token = 2;
32
42
  }
33
43
 
44
+ // Authentication tokens
34
45
  message RefreshTokenRequest {
35
46
  string refresh_token = 1;
36
47
  }
@@ -39,3 +50,38 @@ message RefreshTokenResponse {
39
50
  string access_token = 1;
40
51
  string refresh_token = 2;
41
52
  }
53
+
54
+ // Telegram authentication
55
+ message TelegramInitResponse {
56
+ string url = 1;
57
+ }
58
+
59
+ message TelegramVerifyRequest {
60
+ map<string, string> query = 1;
61
+ }
62
+
63
+ message TelegramVerifyResponse {
64
+ oneof result {
65
+ string url = 1;
66
+ string access_token = 2;
67
+ string refresh_token = 3;
68
+ }
69
+ }
70
+
71
+ message TelegramCompleteRequest {
72
+ string session_id = 1;
73
+ string phone = 2;
74
+ }
75
+
76
+ message TelegramCompleteResponse {
77
+ string session_id = 1;
78
+ }
79
+
80
+ message TelegramConsumeRequest {
81
+ string session_id = 1;
82
+ }
83
+
84
+ message TelegramConsumeResponse {
85
+ string access_token = 1;
86
+ string refresh_token = 2;
87
+ }