@cas-cinema/contracts 1.0.14 → 1.0.15
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 +42 -1
- package/gen/google/protobuf/empty.ts +23 -0
- package/package.json +1 -1
- package/proto/auth.proto +26 -0
package/gen/auth.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
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";
|
|
12
13
|
|
|
@@ -45,6 +46,28 @@ export interface RefreshResponse {
|
|
|
45
46
|
refreshToken: string;
|
|
46
47
|
}
|
|
47
48
|
|
|
49
|
+
/** Ответ на инициализацию авторизации по телеграмму */
|
|
50
|
+
export interface TelegramInitResponse {
|
|
51
|
+
url: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Данные для авторизации в тг */
|
|
55
|
+
export interface TelegramVerifyRequest {
|
|
56
|
+
query: { [key: string]: string };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface TelegramVerifyRequest_QueryEntry {
|
|
60
|
+
key: string;
|
|
61
|
+
value: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Ответ на верификацию в тг */
|
|
65
|
+
export interface TelegramVerifyResponse {
|
|
66
|
+
url?: string | undefined;
|
|
67
|
+
accessToken?: string | undefined;
|
|
68
|
+
refreshToken?: string | undefined;
|
|
69
|
+
}
|
|
70
|
+
|
|
48
71
|
export const AUTH_PACKAGE_NAME = "auth";
|
|
49
72
|
|
|
50
73
|
/** Сервис аутентификации пользователей */
|
|
@@ -61,6 +84,14 @@ export interface AuthServiceClient {
|
|
|
61
84
|
/** Рефреш access-токена */
|
|
62
85
|
|
|
63
86
|
refresh(request: RefreshRequest): Observable<RefreshResponse>;
|
|
87
|
+
|
|
88
|
+
/** Генерация url для авторизации в тг */
|
|
89
|
+
|
|
90
|
+
telegramInit(request: Empty): Observable<TelegramInitResponse>;
|
|
91
|
+
|
|
92
|
+
/** Логика проверки подписи и генерация токенов */
|
|
93
|
+
|
|
94
|
+
telegramVerify(request: TelegramVerifyRequest): Observable<TelegramVerifyResponse>;
|
|
64
95
|
}
|
|
65
96
|
|
|
66
97
|
/** Сервис аутентификации пользователей */
|
|
@@ -77,11 +108,21 @@ export interface AuthServiceController {
|
|
|
77
108
|
/** Рефреш access-токена */
|
|
78
109
|
|
|
79
110
|
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
111
|
+
|
|
112
|
+
/** Генерация url для авторизации в тг */
|
|
113
|
+
|
|
114
|
+
telegramInit(request: Empty): Promise<TelegramInitResponse> | Observable<TelegramInitResponse> | TelegramInitResponse;
|
|
115
|
+
|
|
116
|
+
/** Логика проверки подписи и генерация токенов */
|
|
117
|
+
|
|
118
|
+
telegramVerify(
|
|
119
|
+
request: TelegramVerifyRequest,
|
|
120
|
+
): Promise<TelegramVerifyResponse> | Observable<TelegramVerifyResponse> | TelegramVerifyResponse;
|
|
80
121
|
}
|
|
81
122
|
|
|
82
123
|
export function AuthServiceControllerMethods() {
|
|
83
124
|
return function (constructor: Function) {
|
|
84
|
-
const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh"];
|
|
125
|
+
const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh", "telegramInit", "telegramVerify"];
|
|
85
126
|
for (const method of grpcMethods) {
|
|
86
127
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
87
128
|
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 v6.33.4
|
|
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;
|
|
4
4
|
|
|
5
|
+
import "google/protobuf/empty.proto";
|
|
6
|
+
|
|
5
7
|
// Сервис аутентификации пользователей
|
|
6
8
|
service AuthService {
|
|
7
9
|
// Отправка одноразового пароля на телефон/email
|
|
@@ -10,6 +12,11 @@ service AuthService {
|
|
|
10
12
|
rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
11
13
|
// Рефреш access-токена
|
|
12
14
|
rpc Refresh (RefreshRequest) returns (RefreshResponse);
|
|
15
|
+
|
|
16
|
+
// Генерация url для авторизации в тг
|
|
17
|
+
rpc TelegramInit (google.protobuf.Empty) returns (TelegramInitResponse);
|
|
18
|
+
// Логика проверки подписи и генерация токенов
|
|
19
|
+
rpc TelegramVerify (TelegramVerifyRequest) returns (TelegramVerifyResponse);
|
|
13
20
|
}
|
|
14
21
|
|
|
15
22
|
/// Запрос на отправку одноразового пароля
|
|
@@ -46,3 +53,22 @@ message RefreshResponse {
|
|
|
46
53
|
string access_token = 1;
|
|
47
54
|
string refresh_token = 2;
|
|
48
55
|
}
|
|
56
|
+
|
|
57
|
+
// Ответ на инициализацию авторизации по телеграмму
|
|
58
|
+
message TelegramInitResponse {
|
|
59
|
+
string url = 1;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Данные для авторизации в тг
|
|
63
|
+
message TelegramVerifyRequest {
|
|
64
|
+
map<string, string> query = 1;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Ответ на верификацию в тг
|
|
68
|
+
message TelegramVerifyResponse {
|
|
69
|
+
oneof result {
|
|
70
|
+
string url = 1;
|
|
71
|
+
string access_token = 2;
|
|
72
|
+
string refresh_token = 3;
|
|
73
|
+
}
|
|
74
|
+
}
|