@aaanton/contracts 1.0.8 → 1.0.13

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 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,44 @@ export interface RefreshResponse {
41
42
  refreshToken: string;
42
43
  }
43
44
 
45
+ /** Telegram */
46
+ export interface TelegramInitResponse {
47
+ url: string;
48
+ }
49
+
50
+ export interface TelegramVerifyRequest {
51
+ query: { [key: string]: string };
52
+ }
53
+
54
+ export interface TelegramVerifyRequest_QueryEntry {
55
+ key: string;
56
+ value: string;
57
+ }
58
+
59
+ export interface TelegramVerifyResponse {
60
+ url?: string | undefined;
61
+ accessToken?: string | undefined;
62
+ refreshToken?: string | undefined;
63
+ }
64
+
65
+ export interface TelegramCompleteRequest {
66
+ sessionId: string;
67
+ phone: string;
68
+ }
69
+
70
+ export interface TelegramCompleteResponse {
71
+ sessionId: string;
72
+ }
73
+
74
+ export interface TelegramConsumeRequest {
75
+ sessionId: string;
76
+ }
77
+
78
+ export interface TelegramConsumeResponse {
79
+ accessToken: string;
80
+ refreshToken: string;
81
+ }
82
+
44
83
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
45
84
 
46
85
  /** Auth service handles authentication */
@@ -50,9 +89,29 @@ export interface AuthServiceClient {
50
89
 
51
90
  sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
52
91
 
92
+ /** */
93
+
53
94
  verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
54
95
 
96
+ /** */
97
+
55
98
  refresh(request: RefreshRequest): Observable<RefreshResponse>;
99
+
100
+ /** */
101
+
102
+ telegramInit(request: Empty): Observable<TelegramInitResponse>;
103
+
104
+ /** */
105
+
106
+ telegramVerify(request: TelegramVerifyRequest): Observable<TelegramVerifyResponse>;
107
+
108
+ /** */
109
+
110
+ telegramComplete(request: TelegramCompleteRequest): Observable<TelegramCompleteResponse>;
111
+
112
+ /** */
113
+
114
+ telegramConsume(request: TelegramConsumeRequest): Observable<TelegramCompleteResponse>;
56
115
  }
57
116
 
58
117
  /** Auth service handles authentication */
@@ -62,14 +121,48 @@ export interface AuthServiceController {
62
121
 
63
122
  sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
64
123
 
124
+ /** */
125
+
65
126
  verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
66
127
 
128
+ /** */
129
+
67
130
  refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
131
+
132
+ /** */
133
+
134
+ telegramInit(request: Empty): Promise<TelegramInitResponse> | Observable<TelegramInitResponse> | TelegramInitResponse;
135
+
136
+ /** */
137
+
138
+ telegramVerify(
139
+ request: TelegramVerifyRequest,
140
+ ): Promise<TelegramVerifyResponse> | Observable<TelegramVerifyResponse> | TelegramVerifyResponse;
141
+
142
+ /** */
143
+
144
+ telegramComplete(
145
+ request: TelegramCompleteRequest,
146
+ ): Promise<TelegramCompleteResponse> | Observable<TelegramCompleteResponse> | TelegramCompleteResponse;
147
+
148
+ /** */
149
+
150
+ telegramConsume(
151
+ request: TelegramConsumeRequest,
152
+ ): Promise<TelegramCompleteResponse> | Observable<TelegramCompleteResponse> | TelegramCompleteResponse;
68
153
  }
69
154
 
70
155
  export function AuthServiceControllerMethods() {
71
156
  return function (constructor: Function) {
72
- const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh"];
157
+ const grpcMethods: string[] = [
158
+ "sendOtp",
159
+ "verifyOtp",
160
+ "refresh",
161
+ "telegramInit",
162
+ "telegramVerify",
163
+ "telegramComplete",
164
+ "telegramConsume",
165
+ ];
73
166
  for (const method of grpcMethods) {
74
167
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
75
168
  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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aaanton/contracts",
3
- "version": "1.0.8",
3
+ "version": "1.0.13",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/auth.proto CHANGED
@@ -2,14 +2,25 @@ 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
+ //
19
+ rpc TelegramVerify (TelegramVerifyRequest) returns (TelegramVerifyResponse);
20
+ //
21
+ rpc TelegramComplete (TelegramCompleteRequest) returns (TelegramCompleteResponse);
22
+ //
23
+ rpc TelegramConsume (TelegramConsumeRequest) returns (TelegramCompleteResponse);
13
24
  }
14
25
 
15
26
  // Request to SendOtp
@@ -40,4 +51,39 @@ message RefreshRequest {
40
51
  message RefreshResponse {
41
52
  string access_token = 1;
42
53
  string refresh_token = 2;
54
+ }
55
+
56
+ // Telegram
57
+ message TelegramInitResponse {
58
+ string url = 1;
59
+ }
60
+
61
+ message TelegramVerifyRequest {
62
+ map<string, string> query = 2;
63
+ }
64
+
65
+ message TelegramVerifyResponse {
66
+ oneof result {
67
+ string url = 1;
68
+ string access_token = 2;
69
+ string refresh_token = 3;
70
+ };
71
+ }
72
+
73
+ message TelegramCompleteRequest {
74
+ string session_id = 1;
75
+ string phone = 2;
76
+ }
77
+
78
+ message TelegramCompleteResponse {
79
+ string session_id = 1;
80
+ }
81
+
82
+ message TelegramConsumeRequest {
83
+ string session_id = 1;
84
+ }
85
+
86
+ message TelegramConsumeResponse {
87
+ string access_token = 1;
88
+ string refresh_token = 2;
43
89
  }