@cas-cinema/contracts 1.0.0
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 +57 -0
- package/package.json +23 -0
- package/proto/auth.proto +21 -0
package/gen/auth.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.10.1
|
|
4
|
+
// protoc v6.33.2
|
|
5
|
+
// source: auth.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "auth";
|
|
12
|
+
|
|
13
|
+
/** / Запрос на отправку одноразового пароля */
|
|
14
|
+
export interface SendOtpRequest {
|
|
15
|
+
identifier: string;
|
|
16
|
+
type: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Ответ на отправку OTP */
|
|
20
|
+
export interface SendOtpResponse {
|
|
21
|
+
ok: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const AUTH_PACKAGE_NAME = "auth";
|
|
25
|
+
|
|
26
|
+
/** Сервис аутентификации пользователей */
|
|
27
|
+
|
|
28
|
+
export interface AuthServiceClient {
|
|
29
|
+
/** Отправка одноразового пароля на телефон/email */
|
|
30
|
+
|
|
31
|
+
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Сервис аутентификации пользователей */
|
|
35
|
+
|
|
36
|
+
export interface AuthServiceController {
|
|
37
|
+
/** Отправка одноразового пароля на телефон/email */
|
|
38
|
+
|
|
39
|
+
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function AuthServiceControllerMethods() {
|
|
43
|
+
return function (constructor: Function) {
|
|
44
|
+
const grpcMethods: string[] = ["sendOtp"];
|
|
45
|
+
for (const method of grpcMethods) {
|
|
46
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
47
|
+
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
48
|
+
}
|
|
49
|
+
const grpcStreamMethods: string[] = [];
|
|
50
|
+
for (const method of grpcStreamMethods) {
|
|
51
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
52
|
+
GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const AUTH_SERVICE_NAME = "AuthService";
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cas-cinema/contracts",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Protobuf definition and generated TS types",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"protogen": "npx protoc -I ./proto/ ./proto/*.proto --ts_proto_out=gen --ts_proto_opt=nestJs=true,package=omit"
|
|
7
|
+
},
|
|
8
|
+
"license": "ISC",
|
|
9
|
+
"files": [
|
|
10
|
+
"proto",
|
|
11
|
+
"gen"
|
|
12
|
+
],
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"ts-proto": "^2.10.1"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@nestjs/microservices": "^11.1.11",
|
|
21
|
+
"rxjs": "^7.8.2"
|
|
22
|
+
}
|
|
23
|
+
}
|
package/proto/auth.proto
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package auth;
|
|
4
|
+
|
|
5
|
+
// Сервис аутентификации пользователей
|
|
6
|
+
service AuthService {
|
|
7
|
+
// Отправка одноразового пароля на телефон/email
|
|
8
|
+
rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/// Запрос на отправку одноразового пароля
|
|
13
|
+
message SendOtpRequest {
|
|
14
|
+
string identifier = 1;
|
|
15
|
+
string type = 2;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Ответ на отправку OTP
|
|
19
|
+
message SendOtpResponse {
|
|
20
|
+
bool ok = 1;
|
|
21
|
+
}
|