@eyenest/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/ts/auth.ts +7 -102
- package/package.json +1 -1
- package/proto/auth.proto +7 -67
- package/gen/ts/google/protobuf/empty.ts +0 -23
package/gen/ts/auth.ts
CHANGED
|
@@ -7,72 +7,15 @@
|
|
|
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";
|
|
11
10
|
|
|
12
11
|
export const protobufPackage = "auth.v1";
|
|
13
12
|
|
|
14
|
-
export interface
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
export interface RegisterRequest {
|
|
14
|
+
email: string;
|
|
15
|
+
password: string;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
export interface
|
|
20
|
-
ok: boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface VerifyOtpRequest {
|
|
24
|
-
identifier: string;
|
|
25
|
-
type: string;
|
|
26
|
-
code: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface VerifyOtpResponse {
|
|
30
|
-
accessToken: string;
|
|
31
|
-
refreshToken: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface RefreshRequest {
|
|
35
|
-
refreshToken: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface RefreshResponse {
|
|
39
|
-
accessToken: string;
|
|
40
|
-
refreshToken: string;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface TelegramInitResponse {
|
|
44
|
-
url: string;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface TelegramVerifyRequest {
|
|
48
|
-
query: { [key: string]: string };
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface TelegramVerifyRequest_QueryEntry {
|
|
52
|
-
key: string;
|
|
53
|
-
value: string;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export interface TelegramVerifyResponse {
|
|
57
|
-
url?: string | undefined;
|
|
58
|
-
accessToken?: string | undefined;
|
|
59
|
-
refreshToken?: string | undefined;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface TelegramCompleteRequest {
|
|
63
|
-
sessionId: string;
|
|
64
|
-
phone: string;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface TelegramCompleteResponse {
|
|
68
|
-
sessionId: string;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export interface TelegramConsumeRequest {
|
|
72
|
-
sessionId: string;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export interface TelegramConsumeResponse {
|
|
18
|
+
export interface RegisterResponse {
|
|
76
19
|
accessToken: string;
|
|
77
20
|
refreshToken: string;
|
|
78
21
|
}
|
|
@@ -80,54 +23,16 @@ export interface TelegramConsumeResponse {
|
|
|
80
23
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
81
24
|
|
|
82
25
|
export interface AuthServiceClient {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
86
|
-
|
|
87
|
-
refresh(request: RefreshRequest): Observable<RefreshResponse>;
|
|
88
|
-
|
|
89
|
-
telegramInit(request: Empty): Observable<TelegramInitResponse>;
|
|
90
|
-
|
|
91
|
-
telegramVerify(request: TelegramVerifyRequest): Observable<TelegramVerifyResponse>;
|
|
92
|
-
|
|
93
|
-
telegramComplete(request: TelegramCompleteRequest): Observable<TelegramCompleteResponse>;
|
|
94
|
-
|
|
95
|
-
telegramConsume(request: TelegramConsumeRequest): Observable<TelegramConsumeResponse>;
|
|
26
|
+
register(request: RegisterRequest): Observable<RegisterResponse>;
|
|
96
27
|
}
|
|
97
28
|
|
|
98
29
|
export interface AuthServiceController {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
102
|
-
|
|
103
|
-
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
104
|
-
|
|
105
|
-
telegramInit(request: Empty): Promise<TelegramInitResponse> | Observable<TelegramInitResponse> | TelegramInitResponse;
|
|
106
|
-
|
|
107
|
-
telegramVerify(
|
|
108
|
-
request: TelegramVerifyRequest,
|
|
109
|
-
): Promise<TelegramVerifyResponse> | Observable<TelegramVerifyResponse> | TelegramVerifyResponse;
|
|
110
|
-
|
|
111
|
-
telegramComplete(
|
|
112
|
-
request: TelegramCompleteRequest,
|
|
113
|
-
): Promise<TelegramCompleteResponse> | Observable<TelegramCompleteResponse> | TelegramCompleteResponse;
|
|
114
|
-
|
|
115
|
-
telegramConsume(
|
|
116
|
-
request: TelegramConsumeRequest,
|
|
117
|
-
): Promise<TelegramConsumeResponse> | Observable<TelegramConsumeResponse> | TelegramConsumeResponse;
|
|
30
|
+
register(request: RegisterRequest): Promise<RegisterResponse> | Observable<RegisterResponse> | RegisterResponse;
|
|
118
31
|
}
|
|
119
32
|
|
|
120
33
|
export function AuthServiceControllerMethods() {
|
|
121
34
|
return function (constructor: Function) {
|
|
122
|
-
const grpcMethods: string[] = [
|
|
123
|
-
"sendOtp",
|
|
124
|
-
"verifyOtp",
|
|
125
|
-
"refresh",
|
|
126
|
-
"telegramInit",
|
|
127
|
-
"telegramVerify",
|
|
128
|
-
"telegramComplete",
|
|
129
|
-
"telegramConsume",
|
|
130
|
-
];
|
|
35
|
+
const grpcMethods: string[] = ["register"];
|
|
131
36
|
for (const method of grpcMethods) {
|
|
132
37
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
133
38
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
|
@@ -2,78 +2,18 @@ syntax = "proto3";
|
|
|
2
2
|
|
|
3
3
|
package auth.v1;
|
|
4
4
|
|
|
5
|
-
import "google/protobuf/empty.proto";
|
|
6
5
|
|
|
7
6
|
service AuthService {
|
|
8
|
-
rpc
|
|
9
|
-
rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
10
|
-
rpc Refresh (RefreshRequest) returns (RefreshResponse);
|
|
7
|
+
rpc register (RegisterRequest) returns (RegisterResponse);
|
|
11
8
|
|
|
12
|
-
rpc TelegramInit (google.protobuf.Empty) returns (TelegramInitResponse);
|
|
13
|
-
rpc TelegramVerify (TelegramVerifyRequest) returns (TelegramVerifyResponse);
|
|
14
|
-
rpc TelegramComplete (TelegramCompleteRequest) returns (TelegramCompleteResponse);
|
|
15
|
-
rpc TelegramConsume (TelegramConsumeRequest) returns (TelegramConsumeResponse);
|
|
16
9
|
}
|
|
17
10
|
|
|
18
|
-
message
|
|
19
|
-
string
|
|
20
|
-
string
|
|
11
|
+
message RegisterRequest {
|
|
12
|
+
string email = 1;
|
|
13
|
+
string password = 2;
|
|
21
14
|
}
|
|
22
15
|
|
|
23
|
-
message
|
|
24
|
-
|
|
16
|
+
message RegisterResponse {
|
|
17
|
+
string accessToken = 1;
|
|
18
|
+
string refreshToken = 2;
|
|
25
19
|
}
|
|
26
|
-
|
|
27
|
-
message VerifyOtpRequest {
|
|
28
|
-
string identifier = 1;
|
|
29
|
-
string type = 2;
|
|
30
|
-
string code = 3;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
message VerifyOtpResponse {
|
|
34
|
-
string access_token = 1;
|
|
35
|
-
string refresh_token = 2;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
message RefreshRequest {
|
|
39
|
-
string refresh_token = 1;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
message RefreshResponse {
|
|
43
|
-
string access_token = 1;
|
|
44
|
-
string refresh_token = 2;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
message TelegramInitResponse {
|
|
48
|
-
string url = 1;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
message TelegramVerifyRequest {
|
|
52
|
-
map<string, string> query = 1;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
message TelegramVerifyResponse {
|
|
56
|
-
oneof result {
|
|
57
|
-
string url = 1;
|
|
58
|
-
string access_token = 2;
|
|
59
|
-
string refresh_token = 3;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
message TelegramCompleteRequest {
|
|
64
|
-
string session_id = 1;
|
|
65
|
-
string phone = 2;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
message TelegramCompleteResponse {
|
|
69
|
-
string session_id = 1;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
message TelegramConsumeRequest {
|
|
73
|
-
string session_id = 1;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
message TelegramConsumeResponse {
|
|
77
|
-
string access_token = 1;
|
|
78
|
-
string refresh_token = 2;
|
|
79
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
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";
|