@booking-guvanch/contracts 1.0.13 → 1.0.16
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.d.ts +22 -0
- package/gen/auth.js +1 -1
- package/gen/auth.ts +31 -1
- package/gen/google/protobuf/empty.d.ts +13 -0
- package/gen/google/protobuf/empty.js +11 -0
- package/gen/google/protobuf/empty.ts +23 -0
- package/package.json +4 -2
- package/proto/auth.proto +22 -0
package/gen/auth.d.ts
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
|
+
import { Empty } from "./google/protobuf/empty";
|
|
2
3
|
export declare const protobufPackage = "auth.v1";
|
|
4
|
+
export interface TelegramVerifyRequest {
|
|
5
|
+
query: {
|
|
6
|
+
[key: string]: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export interface TelegramVerifyRequest_QueryEntry {
|
|
10
|
+
key: string;
|
|
11
|
+
value: string;
|
|
12
|
+
}
|
|
13
|
+
export interface TelegramVerifyResponse {
|
|
14
|
+
url?: string | undefined;
|
|
15
|
+
accessToken?: string | undefined;
|
|
16
|
+
refreshToken?: string | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface TelegramInitResponse {
|
|
19
|
+
authUrl: string;
|
|
20
|
+
}
|
|
3
21
|
export interface RefreshTokenRequest {
|
|
4
22
|
refreshToken: string;
|
|
5
23
|
}
|
|
@@ -28,11 +46,15 @@ export interface AuthServiceClient {
|
|
|
28
46
|
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
29
47
|
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
30
48
|
refreshToken(request: RefreshTokenRequest): Observable<RefreshTokenResponse>;
|
|
49
|
+
telegramInit(request: Empty): Observable<TelegramInitResponse>;
|
|
50
|
+
telegramVerify(request: TelegramVerifyRequest): Observable<TelegramVerifyResponse>;
|
|
31
51
|
}
|
|
32
52
|
export interface AuthServiceController {
|
|
33
53
|
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
34
54
|
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
35
55
|
refreshToken(request: RefreshTokenRequest): Promise<RefreshTokenResponse> | Observable<RefreshTokenResponse> | RefreshTokenResponse;
|
|
56
|
+
telegramInit(request: Empty): Promise<TelegramInitResponse> | Observable<TelegramInitResponse> | TelegramInitResponse;
|
|
57
|
+
telegramVerify(request: TelegramVerifyRequest): Promise<TelegramVerifyResponse> | Observable<TelegramVerifyResponse> | TelegramVerifyResponse;
|
|
36
58
|
}
|
|
37
59
|
export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
|
|
38
60
|
export declare const AUTH_SERVICE_NAME = "AuthService";
|
package/gen/auth.js
CHANGED
|
@@ -13,7 +13,7 @@ exports.protobufPackage = "auth.v1";
|
|
|
13
13
|
exports.AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
14
14
|
function AuthServiceControllerMethods() {
|
|
15
15
|
return function (constructor) {
|
|
16
|
-
const grpcMethods = ["sendOtp", "verifyOtp", "refreshToken"];
|
|
16
|
+
const grpcMethods = ["sendOtp", "verifyOtp", "refreshToken", "telegramInit", "telegramVerify"];
|
|
17
17
|
for (const method of grpcMethods) {
|
|
18
18
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
19
|
(0, microservices_1.GrpcMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/gen/auth.ts
CHANGED
|
@@ -7,9 +7,29 @@
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
9
|
import { Observable } from "rxjs";
|
|
10
|
+
import { Empty } from "./google/protobuf/empty";
|
|
10
11
|
|
|
11
12
|
export const protobufPackage = "auth.v1";
|
|
12
13
|
|
|
14
|
+
export interface TelegramVerifyRequest {
|
|
15
|
+
query: { [key: string]: string };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface TelegramVerifyRequest_QueryEntry {
|
|
19
|
+
key: string;
|
|
20
|
+
value: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface TelegramVerifyResponse {
|
|
24
|
+
url?: string | undefined;
|
|
25
|
+
accessToken?: string | undefined;
|
|
26
|
+
refreshToken?: string | undefined;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface TelegramInitResponse {
|
|
30
|
+
authUrl: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
13
33
|
export interface RefreshTokenRequest {
|
|
14
34
|
refreshToken: string;
|
|
15
35
|
}
|
|
@@ -47,6 +67,10 @@ export interface AuthServiceClient {
|
|
|
47
67
|
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
48
68
|
|
|
49
69
|
refreshToken(request: RefreshTokenRequest): Observable<RefreshTokenResponse>;
|
|
70
|
+
|
|
71
|
+
telegramInit(request: Empty): Observable<TelegramInitResponse>;
|
|
72
|
+
|
|
73
|
+
telegramVerify(request: TelegramVerifyRequest): Observable<TelegramVerifyResponse>;
|
|
50
74
|
}
|
|
51
75
|
|
|
52
76
|
export interface AuthServiceController {
|
|
@@ -57,11 +81,17 @@ export interface AuthServiceController {
|
|
|
57
81
|
refreshToken(
|
|
58
82
|
request: RefreshTokenRequest,
|
|
59
83
|
): Promise<RefreshTokenResponse> | Observable<RefreshTokenResponse> | RefreshTokenResponse;
|
|
84
|
+
|
|
85
|
+
telegramInit(request: Empty): Promise<TelegramInitResponse> | Observable<TelegramInitResponse> | TelegramInitResponse;
|
|
86
|
+
|
|
87
|
+
telegramVerify(
|
|
88
|
+
request: TelegramVerifyRequest,
|
|
89
|
+
): Promise<TelegramVerifyResponse> | Observable<TelegramVerifyResponse> | TelegramVerifyResponse;
|
|
60
90
|
}
|
|
61
91
|
|
|
62
92
|
export function AuthServiceControllerMethods() {
|
|
63
93
|
return function (constructor: Function) {
|
|
64
|
-
const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refreshToken"];
|
|
94
|
+
const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refreshToken", "telegramInit", "telegramVerify"];
|
|
65
95
|
for (const method of grpcMethods) {
|
|
66
96
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
67
97
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const protobufPackage = "google.protobuf";
|
|
2
|
+
/**
|
|
3
|
+
* A generic empty message that you can re-use to avoid defining duplicated
|
|
4
|
+
* empty messages in your APIs. A typical example is to use it as the request
|
|
5
|
+
* or the response type of an API method. For instance:
|
|
6
|
+
*
|
|
7
|
+
* service Foo {
|
|
8
|
+
* rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface Empty {
|
|
12
|
+
}
|
|
13
|
+
export declare const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.11.6
|
|
5
|
+
// protoc v4.23.4
|
|
6
|
+
// source: google/protobuf/empty.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.GOOGLE_PROTOBUF_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
exports.protobufPackage = "google.protobuf";
|
|
11
|
+
exports.GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.6
|
|
4
|
+
// protoc v4.23.4
|
|
5
|
+
// source: google/protobuf/empty.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
|
|
9
|
+
export const protobufPackage = "google.protobuf";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A generic empty message that you can re-use to avoid defining duplicated
|
|
13
|
+
* empty messages in your APIs. A typical example is to use it as the request
|
|
14
|
+
* or the response type of an API method. For instance:
|
|
15
|
+
*
|
|
16
|
+
* service Foo {
|
|
17
|
+
* rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
export interface Empty {
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@booking-guvanch/contracts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
"access": "public"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
|
+
"generate": "mkdir -p ./gen && protoc -I ./proto --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit ./proto/*.proto",
|
|
17
|
+
"prebuild": "yarn generate",
|
|
16
18
|
"build": "tsc -p tsconfig.build.json && tsc -p tsconfig.gen.json",
|
|
17
|
-
"
|
|
19
|
+
"prepack": "yarn build"
|
|
18
20
|
},
|
|
19
21
|
"license": "ISC",
|
|
20
22
|
"devDependencies": {
|
package/proto/auth.proto
CHANGED
|
@@ -2,10 +2,32 @@ syntax = "proto3";
|
|
|
2
2
|
|
|
3
3
|
package auth.v1;
|
|
4
4
|
|
|
5
|
+
import "google/protobuf/empty.proto";
|
|
6
|
+
|
|
5
7
|
service AuthService {
|
|
6
8
|
rpc SendOtp(SendOtpRequest) returns (SendOtpResponse);
|
|
7
9
|
rpc VerifyOtp(VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
8
10
|
rpc RefreshToken(RefreshTokenRequest) returns (RefreshTokenResponse);
|
|
11
|
+
|
|
12
|
+
rpc TelegramInit(google.protobuf.Empty) returns (TelegramInitResponse);
|
|
13
|
+
rpc TelegramVerify(TelegramVerifyRequest) returns (TelegramVerifyResponse);
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
message TelegramVerifyRequest {
|
|
18
|
+
map<string, string> query = 1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
message TelegramVerifyResponse {
|
|
22
|
+
oneof result {
|
|
23
|
+
string url = 1;
|
|
24
|
+
string access_token = 2;
|
|
25
|
+
string refresh_token = 3;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
message TelegramInitResponse {
|
|
30
|
+
string auth_url = 1;
|
|
9
31
|
}
|
|
10
32
|
|
|
11
33
|
message RefreshTokenRequest {
|