@ticket_for_cinema/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/dist/index.js +17 -0
- package/gen/auth.ts +17 -1
- package/package.json +8 -3
- package/proto/auth.proto +14 -1
- package/proto/redme.md +3 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./proto"), exports);
|
package/gen/auth.ts
CHANGED
|
@@ -20,21 +20,37 @@ export interface SendOtpRequest {
|
|
|
20
20
|
|
|
21
21
|
export interface SendOtpResponse {
|
|
22
22
|
ok: boolean;
|
|
23
|
+
code: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface VerifyOtpRequest {
|
|
27
|
+
identifier: string;
|
|
28
|
+
type: string;
|
|
29
|
+
code: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface VerifyOtpResponse {
|
|
33
|
+
accessToken: string;
|
|
34
|
+
refreshToken: string;
|
|
23
35
|
}
|
|
24
36
|
|
|
25
37
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
26
38
|
|
|
27
39
|
export interface AuthServiceClient {
|
|
28
40
|
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
41
|
+
|
|
42
|
+
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
29
43
|
}
|
|
30
44
|
|
|
31
45
|
export interface AuthServiceController {
|
|
32
46
|
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
47
|
+
|
|
48
|
+
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
33
49
|
}
|
|
34
50
|
|
|
35
51
|
export function AuthServiceControllerMethods() {
|
|
36
52
|
return function (constructor: Function) {
|
|
37
|
-
const grpcMethods: string[] = ["sendOtp"];
|
|
53
|
+
const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
|
|
38
54
|
for (const method of grpcMethods) {
|
|
39
55
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
40
56
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ticket_for_cinema/contracts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Contracts for microservices",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
5
7
|
"scripts": {
|
|
6
|
-
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
|
|
8
|
+
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit",
|
|
9
|
+
"build": "tsc -p tsconfig.build.json"
|
|
7
10
|
},
|
|
8
11
|
"files": [
|
|
9
12
|
"proto",
|
|
@@ -14,7 +17,9 @@
|
|
|
14
17
|
"rxjs": "^7.8.2"
|
|
15
18
|
},
|
|
16
19
|
"devDependencies": {
|
|
17
|
-
"
|
|
20
|
+
"@types/node": "^25.0.3",
|
|
21
|
+
"ts-proto": "^1.176.0",
|
|
22
|
+
"typescript": "^5.9.3"
|
|
18
23
|
},
|
|
19
24
|
"publishConfig": {
|
|
20
25
|
"access": "public"
|
package/proto/auth.proto
CHANGED
|
@@ -4,7 +4,7 @@ package auth.v1; // указываем пакет тут указываем до
|
|
|
4
4
|
|
|
5
5
|
service AuthService {
|
|
6
6
|
rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
|
|
7
|
-
|
|
7
|
+
rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
message SendOtpRequest {
|
|
@@ -14,4 +14,17 @@ message SendOtpRequest {
|
|
|
14
14
|
|
|
15
15
|
message SendOtpResponse {
|
|
16
16
|
bool ok = 1;
|
|
17
|
+
string code = 2;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
message VerifyOtpRequest {
|
|
21
|
+
string identifier = 1;
|
|
22
|
+
string type = 2;
|
|
23
|
+
string code = 3;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
message VerifyOtpResponse {
|
|
27
|
+
string access_token = 1;
|
|
28
|
+
string refresh_token = 2;
|
|
29
|
+
|
|
17
30
|
}
|