@usteam/contracts 1.0.0 → 1.0.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 +27 -2
- package/package.json +8 -1
- package/proto/auth.proto +16 -0
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
3
|
// protoc-gen-ts_proto v2.10.1
|
|
4
|
-
// protoc v6.33.
|
|
4
|
+
// protoc v6.33.4
|
|
5
5
|
// source: auth.proto
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
@@ -28,6 +28,17 @@ export interface SendOtpResponse {
|
|
|
28
28
|
ok: boolean;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
export interface VerifyOtpRequest {
|
|
32
|
+
identifier: string;
|
|
33
|
+
type: string;
|
|
34
|
+
code: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface VerifyOtpResponse {
|
|
38
|
+
accessToken: string;
|
|
39
|
+
refreshToken: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
31
42
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
32
43
|
|
|
33
44
|
/**
|
|
@@ -42,6 +53,13 @@ export interface AuthServiceClient {
|
|
|
42
53
|
*/
|
|
43
54
|
|
|
44
55
|
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* VerifyOtp веривицирует одноразовый пароль.
|
|
59
|
+
* отправляет токены.
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
45
63
|
}
|
|
46
64
|
|
|
47
65
|
/**
|
|
@@ -56,11 +74,18 @@ export interface AuthServiceController {
|
|
|
56
74
|
*/
|
|
57
75
|
|
|
58
76
|
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* VerifyOtp веривицирует одноразовый пароль.
|
|
80
|
+
* отправляет токены.
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
59
84
|
}
|
|
60
85
|
|
|
61
86
|
export function AuthServiceControllerMethods() {
|
|
62
87
|
return function (constructor: Function) {
|
|
63
|
-
const grpcMethods: string[] = ["sendOtp"];
|
|
88
|
+
const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
|
|
64
89
|
for (const method of grpcMethods) {
|
|
65
90
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
66
91
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usteam/contracts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"main": "./dist/index.js",
|
|
5
|
+
"types": "./dist/index.d.ts",
|
|
4
6
|
"scripts": {
|
|
7
|
+
"build": "tsc -p tsconfig.build.json",
|
|
5
8
|
"generate": "npx protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
|
|
6
9
|
},
|
|
7
10
|
"files": [
|
|
@@ -16,5 +19,9 @@
|
|
|
16
19
|
"@nestjs/microservices": "^11.1.11",
|
|
17
20
|
"rxjs": "^7.8.2",
|
|
18
21
|
"ts-proto": "^2.10.1"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/node": "^25.1.0",
|
|
25
|
+
"typescript": "^5.9.3"
|
|
19
26
|
}
|
|
20
27
|
}
|
package/proto/auth.proto
CHANGED
|
@@ -8,6 +8,9 @@ service AuthService {
|
|
|
8
8
|
// SendOtp отправляет одноразовый пароль (OTP) на указанный идентификатор.
|
|
9
9
|
// Может быть email, телефон или другой тип.
|
|
10
10
|
rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
|
|
11
|
+
// VerifyOtp веривицирует одноразовый пароль.
|
|
12
|
+
// отправляет токены.
|
|
13
|
+
rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
11
14
|
}
|
|
12
15
|
|
|
13
16
|
// Запрос на отправку OTP.
|
|
@@ -23,3 +26,16 @@ message SendOtpRequest {
|
|
|
23
26
|
message SendOtpResponse {
|
|
24
27
|
bool ok = 1;
|
|
25
28
|
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
message VerifyOtpRequest {
|
|
32
|
+
string identifier = 1;
|
|
33
|
+
string type = 2;
|
|
34
|
+
string code = 3;
|
|
35
|
+
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
message VerifyOtpResponse {
|
|
39
|
+
string access_token = 1;
|
|
40
|
+
string refresh_token = 2;
|
|
41
|
+
}
|