@kottvideo/contracts 1.1.1 → 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.
- package/gen/auth.ts +38 -1
- package/gen/google/protobuf/empty.ts +23 -0
- package/package.json +1 -1
- package/proto/auth.proto +25 -0
package/gen/auth.ts
CHANGED
|
@@ -7,9 +7,11 @@
|
|
|
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,26 @@ 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
|
+
|
|
42
65
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
43
66
|
|
|
44
67
|
export interface AuthServiceClient {
|
|
@@ -51,6 +74,12 @@ export interface AuthServiceClient {
|
|
|
51
74
|
/** Authentication tokens */
|
|
52
75
|
|
|
53
76
|
refreshToken(request: RefreshTokenRequest): Observable<RefreshTokenResponse>;
|
|
77
|
+
|
|
78
|
+
/** Telegram authentication */
|
|
79
|
+
|
|
80
|
+
telegramInit(request: Empty): Observable<TelegramInitResponse>;
|
|
81
|
+
|
|
82
|
+
telegramVerify(request: TelegramVerifyRequest): Observable<TelegramVerifyResponse>;
|
|
54
83
|
}
|
|
55
84
|
|
|
56
85
|
export interface AuthServiceController {
|
|
@@ -65,11 +94,19 @@ export interface AuthServiceController {
|
|
|
65
94
|
refreshToken(
|
|
66
95
|
request: RefreshTokenRequest,
|
|
67
96
|
): Promise<RefreshTokenResponse> | Observable<RefreshTokenResponse> | RefreshTokenResponse;
|
|
97
|
+
|
|
98
|
+
/** Telegram authentication */
|
|
99
|
+
|
|
100
|
+
telegramInit(request: Empty): Promise<TelegramInitResponse> | Observable<TelegramInitResponse> | TelegramInitResponse;
|
|
101
|
+
|
|
102
|
+
telegramVerify(
|
|
103
|
+
request: TelegramVerifyRequest,
|
|
104
|
+
): Promise<TelegramVerifyResponse> | Observable<TelegramVerifyResponse> | TelegramVerifyResponse;
|
|
68
105
|
}
|
|
69
106
|
|
|
70
107
|
export function AuthServiceControllerMethods() {
|
|
71
108
|
return function (constructor: Function) {
|
|
72
|
-
const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refreshToken"];
|
|
109
|
+
const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refreshToken", "telegramInit", "telegramVerify"];
|
|
73
110
|
for (const method of grpcMethods) {
|
|
74
111
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
75
112
|
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.0
|
|
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
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,13 @@ 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);
|
|
12
18
|
}
|
|
13
19
|
|
|
20
|
+
// One-time passwords
|
|
14
21
|
message SendOtpRequest {
|
|
15
22
|
string identifier = 1;
|
|
16
23
|
string type = 2;
|
|
@@ -31,6 +38,7 @@ message VerifyOtpResponse {
|
|
|
31
38
|
string refresh_token = 2;
|
|
32
39
|
}
|
|
33
40
|
|
|
41
|
+
// Authentication tokens
|
|
34
42
|
message RefreshTokenRequest {
|
|
35
43
|
string refresh_token = 1;
|
|
36
44
|
}
|
|
@@ -39,3 +47,20 @@ message RefreshTokenResponse {
|
|
|
39
47
|
string access_token = 1;
|
|
40
48
|
string refresh_token = 2;
|
|
41
49
|
}
|
|
50
|
+
|
|
51
|
+
// Telegram authentication
|
|
52
|
+
message TelegramInitResponse {
|
|
53
|
+
string url = 1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message TelegramVerifyRequest {
|
|
57
|
+
map<string, string> query = 1;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message TelegramVerifyResponse {
|
|
61
|
+
oneof result {
|
|
62
|
+
string url = 1;
|
|
63
|
+
string access_token = 2;
|
|
64
|
+
string refresh_token = 3;
|
|
65
|
+
}
|
|
66
|
+
}
|