@cinema-mc/contacts 1.0.6 → 1.0.8

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
 
@@ -39,6 +40,43 @@ export interface RefreshResponse {
39
40
  refreshToken: string;
40
41
  }
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 {
76
+ accessToken: string;
77
+ refreshToken: string;
78
+ }
79
+
42
80
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
43
81
 
44
82
  /** Authorization service */
@@ -55,6 +93,22 @@ export interface AuthServiceClient {
55
93
  /** Mechanism of refreshing access token */
56
94
 
57
95
  refresh(request: RefreshRequest): Observable<RefreshResponse>;
96
+
97
+ /** Tg auth */
98
+
99
+ telegramInit(request: Empty): Observable<TelegramInitResponse>;
100
+
101
+ /** Tg verify */
102
+
103
+ telegramVerify(request: TelegramVerifyRequest): Observable<TelegramVerifyResponse>;
104
+
105
+ /** Complete telegram authorization */
106
+
107
+ telegramComplete(request: TelegramCompleteRequest): Observable<TelegramCompleteResponse>;
108
+
109
+ /** Consumes the Telegram authorization by providing the necessary data. */
110
+
111
+ telegramConsume(request: TelegramConsumeRequest): Observable<TelegramConsumeResponse>;
58
112
  }
59
113
 
60
114
  /** Authorization service */
@@ -71,11 +125,41 @@ export interface AuthServiceController {
71
125
  /** Mechanism of refreshing access token */
72
126
 
73
127
  refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
128
+
129
+ /** Tg auth */
130
+
131
+ telegramInit(request: Empty): Promise<TelegramInitResponse> | Observable<TelegramInitResponse> | TelegramInitResponse;
132
+
133
+ /** Tg verify */
134
+
135
+ telegramVerify(
136
+ request: TelegramVerifyRequest,
137
+ ): Promise<TelegramVerifyResponse> | Observable<TelegramVerifyResponse> | TelegramVerifyResponse;
138
+
139
+ /** Complete telegram authorization */
140
+
141
+ telegramComplete(
142
+ request: TelegramCompleteRequest,
143
+ ): Promise<TelegramCompleteResponse> | Observable<TelegramCompleteResponse> | TelegramCompleteResponse;
144
+
145
+ /** Consumes the Telegram authorization by providing the necessary data. */
146
+
147
+ telegramConsume(
148
+ request: TelegramConsumeRequest,
149
+ ): Promise<TelegramConsumeResponse> | Observable<TelegramConsumeResponse> | TelegramConsumeResponse;
74
150
  }
75
151
 
76
152
  export function AuthServiceControllerMethods() {
77
153
  return function (constructor: Function) {
78
- const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh"];
154
+ const grpcMethods: string[] = [
155
+ "sendOtp",
156
+ "verifyOtp",
157
+ "refresh",
158
+ "telegramInit",
159
+ "telegramVerify",
160
+ "telegramComplete",
161
+ "telegramConsume",
162
+ ];
79
163
  for (const method of grpcMethods) {
80
164
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
81
165
  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": "@cinema-mc/contacts",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Protobuf definitions and generated code for contacts service",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/auth.proto CHANGED
@@ -2,6 +2,8 @@ syntax = "proto3";
2
2
 
3
3
  package auth.v1;
4
4
 
5
+ import "google/protobuf/empty.proto";
6
+
5
7
  //Authorization service
6
8
  service AuthService {
7
9
  // Sends an OTP (One-Time Password) to the specified identifier
@@ -10,6 +12,15 @@ service AuthService {
10
12
  rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
11
13
  //Mechanism of refreshing access token
12
14
  rpc Refresh (RefreshRequest) returns (RefreshResponse);
15
+
16
+ //Tg auth
17
+ rpc TelegramInit (google.protobuf.Empty) returns (TelegramInitResponse);
18
+ //Tg verify
19
+ rpc TelegramVerify (TelegramVerifyRequest) returns (TelegramVerifyResponse);
20
+ //Complete telegram authorization
21
+ rpc TelegramComplete (TelegramCompleteRequest) returns (TelegramCompleteResponse);
22
+ // Consumes the Telegram authorization by providing the necessary data.
23
+ rpc TelegramConsume (TelegramConsumeRequest) returns (TelegramConsumeResponse);
13
24
  }
14
25
 
15
26
  message SendOtpRequest {
@@ -38,4 +49,38 @@ message RefreshRequest {
38
49
  message RefreshResponse {
39
50
  string access_token = 1;
40
51
  string refresh_token = 2;
52
+ }
53
+
54
+ message TelegramInitResponse {
55
+ string url = 1;
56
+ }
57
+
58
+ message TelegramVerifyRequest {
59
+ map<string, string> query = 1;
60
+ }
61
+
62
+ message TelegramVerifyResponse {
63
+ oneof result {
64
+ string url = 1;
65
+ string access_token = 2;
66
+ string refresh_token = 3;
67
+ }
68
+ }
69
+
70
+ message TelegramCompleteRequest {
71
+ string session_id = 1;
72
+ string phone = 2;
73
+ }
74
+
75
+ message TelegramCompleteResponse {
76
+ string session_id = 1;
77
+ }
78
+
79
+ message TelegramConsumeRequest {
80
+ string session_id = 1;
81
+ }
82
+
83
+ message TelegramConsumeResponse {
84
+ string access_token = 1;
85
+ string refresh_token = 2;
41
86
  }