@cas-cinema/contracts 1.0.2 → 1.0.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/auth.ts +22 -1
- package/package.json +1 -1
- package/proto/auth.proto +15 -1
package/gen/auth.ts
CHANGED
|
@@ -21,6 +21,19 @@ export interface SendOtpResponse {
|
|
|
21
21
|
ok: boolean;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
/** Запрос на верификацию otp-пароля */
|
|
25
|
+
export interface VerifyOtpRequest {
|
|
26
|
+
identifier: string;
|
|
27
|
+
type: string;
|
|
28
|
+
code: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Ответ верификации otp-пароля */
|
|
32
|
+
export interface VerifyOtpResponse {
|
|
33
|
+
accessToken: string;
|
|
34
|
+
refreshToken: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
24
37
|
export const AUTH_PACKAGE_NAME = "auth";
|
|
25
38
|
|
|
26
39
|
/** Сервис аутентификации пользователей */
|
|
@@ -29,6 +42,10 @@ export interface AuthServiceClient {
|
|
|
29
42
|
/** Отправка одноразового пароля на телефон/email */
|
|
30
43
|
|
|
31
44
|
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
45
|
+
|
|
46
|
+
/** Верификация otp-пароля */
|
|
47
|
+
|
|
48
|
+
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
32
49
|
}
|
|
33
50
|
|
|
34
51
|
/** Сервис аутентификации пользователей */
|
|
@@ -37,11 +54,15 @@ export interface AuthServiceController {
|
|
|
37
54
|
/** Отправка одноразового пароля на телефон/email */
|
|
38
55
|
|
|
39
56
|
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
57
|
+
|
|
58
|
+
/** Верификация otp-пароля */
|
|
59
|
+
|
|
60
|
+
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
40
61
|
}
|
|
41
62
|
|
|
42
63
|
export function AuthServiceControllerMethods() {
|
|
43
64
|
return function (constructor: Function) {
|
|
44
|
-
const grpcMethods: string[] = ["sendOtp"];
|
|
65
|
+
const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
|
|
45
66
|
for (const method of grpcMethods) {
|
|
46
67
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
47
68
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cas-cinema/contracts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Protobuf definition and generated TS types",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"protogen": "npx protoc -I ./proto/ ./proto/*.proto --ts_proto_out=gen --ts_proto_opt=nestJs=true,package=omit"
|
package/proto/auth.proto
CHANGED
|
@@ -6,7 +6,8 @@ package auth;
|
|
|
6
6
|
service AuthService {
|
|
7
7
|
// Отправка одноразового пароля на телефон/email
|
|
8
8
|
rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
|
|
9
|
-
|
|
9
|
+
// Верификация otp-пароля
|
|
10
|
+
rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
/// Запрос на отправку одноразового пароля
|
|
@@ -19,3 +20,16 @@ message SendOtpRequest {
|
|
|
19
20
|
message SendOtpResponse {
|
|
20
21
|
bool ok = 1;
|
|
21
22
|
}
|
|
23
|
+
|
|
24
|
+
// Запрос на верификацию otp-пароля
|
|
25
|
+
message VerifyOtpRequest {
|
|
26
|
+
string identifier = 1;
|
|
27
|
+
string type = 2;
|
|
28
|
+
string code = 3;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Ответ верификации otp-пароля
|
|
32
|
+
message VerifyOtpResponse {
|
|
33
|
+
string access_token = 1;
|
|
34
|
+
string refresh_token = 2;
|
|
35
|
+
}
|