@cas-cinema/contracts 1.0.8 → 1.0.10
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/dist/proto/paths.d.ts +1 -0
- package/dist/proto/paths.js +1 -0
- package/gen/account.ts +70 -0
- package/gen/auth.ts +22 -3
- package/package.json +1 -1
- package/proto/account.proto +30 -0
- package/proto/auth.proto +18 -5
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
package/gen/account.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
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: account.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "account";
|
|
12
|
+
|
|
13
|
+
/** Роли пользователей */
|
|
14
|
+
export enum Role {
|
|
15
|
+
USER = 0,
|
|
16
|
+
ADMIN = 1,
|
|
17
|
+
UNRECOGNIZED = -1,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Запрос на отправку аккаунта по id пользователя */
|
|
21
|
+
export interface GetAccountRequest {
|
|
22
|
+
id: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Ответ на запрос отправки аккаунта */
|
|
26
|
+
export interface GetAccountResponse {
|
|
27
|
+
id: string;
|
|
28
|
+
phone: string;
|
|
29
|
+
email: string;
|
|
30
|
+
isPhoneVerified: string;
|
|
31
|
+
isEmailVerified: string;
|
|
32
|
+
role: Role;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const ACCOUNT_PACKAGE_NAME = "account";
|
|
36
|
+
|
|
37
|
+
/** Сервис аккаунтов пользователей */
|
|
38
|
+
|
|
39
|
+
export interface AccountServiceClient {
|
|
40
|
+
/** Отправка аккаунта пользователя */
|
|
41
|
+
|
|
42
|
+
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Сервис аккаунтов пользователей */
|
|
46
|
+
|
|
47
|
+
export interface AccountServiceController {
|
|
48
|
+
/** Отправка аккаунта пользователя */
|
|
49
|
+
|
|
50
|
+
getAccount(
|
|
51
|
+
request: GetAccountRequest,
|
|
52
|
+
): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function AccountServiceControllerMethods() {
|
|
56
|
+
return function (constructor: Function) {
|
|
57
|
+
const grpcMethods: string[] = ["getAccount"];
|
|
58
|
+
for (const method of grpcMethods) {
|
|
59
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
60
|
+
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
61
|
+
}
|
|
62
|
+
const grpcStreamMethods: string[] = [];
|
|
63
|
+
for (const method of grpcStreamMethods) {
|
|
64
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
65
|
+
GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const ACCOUNT_SERVICE_NAME = "AccountService";
|
package/gen/auth.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.
|
|
4
|
-
// protoc v6.33.
|
|
3
|
+
// protoc-gen-ts_proto v2.11.0
|
|
4
|
+
// protoc v6.33.4
|
|
5
5
|
// source: auth.proto
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
@@ -34,6 +34,17 @@ export interface VerifyOtpResponse {
|
|
|
34
34
|
refreshToken: string;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
/** Запрос на рефреш access-токена */
|
|
38
|
+
export interface RefreshRequest {
|
|
39
|
+
refreshToken: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Ответ на рефреш запрос */
|
|
43
|
+
export interface RefreshResponse {
|
|
44
|
+
accessToken: string;
|
|
45
|
+
refreshToken: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
37
48
|
export const AUTH_PACKAGE_NAME = "auth";
|
|
38
49
|
|
|
39
50
|
/** Сервис аутентификации пользователей */
|
|
@@ -46,6 +57,10 @@ export interface AuthServiceClient {
|
|
|
46
57
|
/** Верификация otp-пароля */
|
|
47
58
|
|
|
48
59
|
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
60
|
+
|
|
61
|
+
/** Рефреш access-токена */
|
|
62
|
+
|
|
63
|
+
refresh(request: RefreshRequest): Observable<RefreshResponse>;
|
|
49
64
|
}
|
|
50
65
|
|
|
51
66
|
/** Сервис аутентификации пользователей */
|
|
@@ -58,11 +73,15 @@ export interface AuthServiceController {
|
|
|
58
73
|
/** Верификация otp-пароля */
|
|
59
74
|
|
|
60
75
|
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
76
|
+
|
|
77
|
+
/** Рефреш access-токена */
|
|
78
|
+
|
|
79
|
+
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
61
80
|
}
|
|
62
81
|
|
|
63
82
|
export function AuthServiceControllerMethods() {
|
|
64
83
|
return function (constructor: Function) {
|
|
65
|
-
const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
|
|
84
|
+
const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh"];
|
|
66
85
|
for (const method of grpcMethods) {
|
|
67
86
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
68
87
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package account;
|
|
4
|
+
|
|
5
|
+
// Сервис аккаунтов пользователей
|
|
6
|
+
service AccountService {
|
|
7
|
+
// Отправка аккаунта пользователя
|
|
8
|
+
rpc GetAccount (GetAccountRequest) returns (GetAccountResponse);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Запрос на отправку аккаунта по id пользователя
|
|
12
|
+
message GetAccountRequest {
|
|
13
|
+
string id = 1;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Ответ на запрос отправки аккаунта
|
|
17
|
+
message GetAccountResponse {
|
|
18
|
+
string id = 1;
|
|
19
|
+
string phone = 2;
|
|
20
|
+
string email = 3;
|
|
21
|
+
string is_phone_verified = 4;
|
|
22
|
+
string is_email_verified = 5;
|
|
23
|
+
Role role = 6;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Роли пользователей
|
|
27
|
+
enum Role {
|
|
28
|
+
USER = 0;
|
|
29
|
+
ADMIN = 1;
|
|
30
|
+
}
|
package/proto/auth.proto
CHANGED
|
@@ -5,15 +5,17 @@ package auth;
|
|
|
5
5
|
// Сервис аутентификации пользователей
|
|
6
6
|
service AuthService {
|
|
7
7
|
// Отправка одноразового пароля на телефон/email
|
|
8
|
-
rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
|
|
8
|
+
rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
|
|
9
9
|
// Верификация otp-пароля
|
|
10
10
|
rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
11
|
+
// Рефреш access-токена
|
|
12
|
+
rpc Refresh (RefreshRequest) returns (RefreshResponse);
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
/// Запрос на отправку одноразового пароля
|
|
14
16
|
message SendOtpRequest {
|
|
15
17
|
string identifier = 1;
|
|
16
|
-
string type
|
|
18
|
+
string type = 2;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
// Ответ на отправку OTP
|
|
@@ -24,12 +26,23 @@ message SendOtpResponse {
|
|
|
24
26
|
// Запрос на верификацию otp-пароля
|
|
25
27
|
message VerifyOtpRequest {
|
|
26
28
|
string identifier = 1;
|
|
27
|
-
string type
|
|
28
|
-
string code
|
|
29
|
+
string type = 2;
|
|
30
|
+
string code = 3;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
// Ответ верификации otp-пароля
|
|
32
34
|
message VerifyOtpResponse {
|
|
33
|
-
string access_token
|
|
35
|
+
string access_token = 1;
|
|
36
|
+
string refresh_token = 2;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Запрос на рефреш access-токена
|
|
40
|
+
message RefreshRequest {
|
|
41
|
+
string refresh_token = 1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Ответ на рефреш запрос
|
|
45
|
+
message RefreshResponse {
|
|
46
|
+
string access_token = 1;
|
|
34
47
|
string refresh_token = 2;
|
|
35
48
|
}
|