@aaanton/contracts 1.0.8 → 1.0.11
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 +43 -1
- package/gen/google/protobuf/empty.ts +23 -0
- package/package.json +1 -1
- package/proto/auth.proto +24 -2
package/gen/auth.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
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
|
|
|
@@ -41,6 +42,25 @@ export interface RefreshResponse {
|
|
|
41
42
|
refreshToken: string;
|
|
42
43
|
}
|
|
43
44
|
|
|
45
|
+
export interface TelegramInitResponse {
|
|
46
|
+
url: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface TelegramVerifyRequest {
|
|
50
|
+
query: { [key: string]: string };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface TelegramVerifyRequest_QueryEntry {
|
|
54
|
+
key: string;
|
|
55
|
+
value: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface TelegramVerifyResponse {
|
|
59
|
+
url?: string | undefined;
|
|
60
|
+
accessToken?: string | undefined;
|
|
61
|
+
refreshToken?: string | undefined;
|
|
62
|
+
}
|
|
63
|
+
|
|
44
64
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
45
65
|
|
|
46
66
|
/** Auth service handles authentication */
|
|
@@ -50,9 +70,19 @@ export interface AuthServiceClient {
|
|
|
50
70
|
|
|
51
71
|
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
52
72
|
|
|
73
|
+
/** */
|
|
74
|
+
|
|
53
75
|
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
54
76
|
|
|
77
|
+
/** */
|
|
78
|
+
|
|
55
79
|
refresh(request: RefreshRequest): Observable<RefreshResponse>;
|
|
80
|
+
|
|
81
|
+
/** */
|
|
82
|
+
|
|
83
|
+
telegramInit(request: Empty): Observable<TelegramInitResponse>;
|
|
84
|
+
|
|
85
|
+
telegramVerify(request: TelegramVerifyRequest): Observable<TelegramVerifyResponse>;
|
|
56
86
|
}
|
|
57
87
|
|
|
58
88
|
/** Auth service handles authentication */
|
|
@@ -62,14 +92,26 @@ export interface AuthServiceController {
|
|
|
62
92
|
|
|
63
93
|
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
64
94
|
|
|
95
|
+
/** */
|
|
96
|
+
|
|
65
97
|
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
66
98
|
|
|
99
|
+
/** */
|
|
100
|
+
|
|
67
101
|
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
102
|
+
|
|
103
|
+
/** */
|
|
104
|
+
|
|
105
|
+
telegramInit(request: Empty): Promise<TelegramInitResponse> | Observable<TelegramInitResponse> | TelegramInitResponse;
|
|
106
|
+
|
|
107
|
+
telegramVerify(
|
|
108
|
+
request: TelegramVerifyRequest,
|
|
109
|
+
): Promise<TelegramVerifyResponse> | Observable<TelegramVerifyResponse> | TelegramVerifyResponse;
|
|
68
110
|
}
|
|
69
111
|
|
|
70
112
|
export function AuthServiceControllerMethods() {
|
|
71
113
|
return function (constructor: Function) {
|
|
72
|
-
const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh"];
|
|
114
|
+
const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh", "telegramInit", "telegramVerify"];
|
|
73
115
|
for (const method of grpcMethods) {
|
|
74
116
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
75
117
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.10.1
|
|
4
|
+
// protoc v3.21.12
|
|
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
package/proto/auth.proto
CHANGED
|
@@ -2,14 +2,20 @@ syntax = "proto3";
|
|
|
2
2
|
|
|
3
3
|
package auth.v1;
|
|
4
4
|
|
|
5
|
+
import "google/protobuf/empty.proto";
|
|
6
|
+
|
|
5
7
|
// Auth service handles authentication
|
|
6
8
|
service AuthService {
|
|
7
9
|
// Sends one time password
|
|
8
10
|
rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
|
|
9
|
-
|
|
11
|
+
//
|
|
10
12
|
rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
11
|
-
|
|
13
|
+
//
|
|
12
14
|
rpc Refresh (RefreshRequest) returns (RefreshResponse);
|
|
15
|
+
|
|
16
|
+
//
|
|
17
|
+
rpc TelegramInit (google.protobuf.Empty) returns (TelegramInitResponse);
|
|
18
|
+
rpc TelegramVerify (TelegramVerifyRequest) returns (TelegramVerifyResponse);
|
|
13
19
|
}
|
|
14
20
|
|
|
15
21
|
// Request to SendOtp
|
|
@@ -40,4 +46,20 @@ message RefreshRequest {
|
|
|
40
46
|
message RefreshResponse {
|
|
41
47
|
string access_token = 1;
|
|
42
48
|
string refresh_token = 2;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
message TelegramInitResponse {
|
|
52
|
+
string url = 1;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
message TelegramVerifyRequest {
|
|
56
|
+
map<string, string> query = 2;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
message TelegramVerifyResponse {
|
|
60
|
+
oneof result {
|
|
61
|
+
string url = 1;
|
|
62
|
+
string access_token = 2;
|
|
63
|
+
string refresh_token = 3;
|
|
64
|
+
};
|
|
43
65
|
}
|