@yrarami-teacinema/contracts 1.0.8 → 1.1.1

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/account.ts CHANGED
@@ -38,13 +38,13 @@ export interface InitEmailChangeResponse {
38
38
  ok: boolean;
39
39
  }
40
40
 
41
- export interface ConfirmEmailRequest {
41
+ export interface ConfirmEmailChangeRequest {
42
42
  email: string;
43
43
  code: string;
44
44
  userId: string;
45
45
  }
46
46
 
47
- export interface ConfirmEmailResponse {
47
+ export interface ConfirmEmailChangeResponse {
48
48
  ok: boolean;
49
49
  }
50
50
 
@@ -57,13 +57,13 @@ export interface InitPhoneChangeResponse {
57
57
  ok: boolean;
58
58
  }
59
59
 
60
- export interface ConfirmPhoneRequest {
60
+ export interface ConfirmPhoneChangeRequest {
61
61
  phone: string;
62
62
  code: string;
63
63
  userId: string;
64
64
  }
65
65
 
66
- export interface ConfirmPhoneResponse {
66
+ export interface ConfirmPhoneChangeResponse {
67
67
  ok: boolean;
68
68
  }
69
69
 
@@ -74,11 +74,11 @@ export interface AccountServiceClient {
74
74
 
75
75
  initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
76
76
 
77
- confirmEmail(request: ConfirmEmailRequest): Observable<ConfirmEmailResponse>;
77
+ confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
78
78
 
79
79
  initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponse>;
80
80
 
81
- confirmPhone(request: ConfirmPhoneRequest): Observable<ConfirmPhoneResponse>;
81
+ confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponse>;
82
82
  }
83
83
 
84
84
  export interface AccountServiceController {
@@ -90,22 +90,28 @@ export interface AccountServiceController {
90
90
  request: InitEmailChangeRequest,
91
91
  ): Promise<InitEmailChangeResponse> | Observable<InitEmailChangeResponse> | InitEmailChangeResponse;
92
92
 
93
- confirmEmail(
94
- request: ConfirmEmailRequest,
95
- ): Promise<ConfirmEmailResponse> | Observable<ConfirmEmailResponse> | ConfirmEmailResponse;
93
+ confirmEmailChange(
94
+ request: ConfirmEmailChangeRequest,
95
+ ): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
96
96
 
97
97
  initPhoneChange(
98
98
  request: InitPhoneChangeRequest,
99
99
  ): Promise<InitPhoneChangeResponse> | Observable<InitPhoneChangeResponse> | InitPhoneChangeResponse;
100
100
 
101
- confirmPhone(
102
- request: ConfirmPhoneRequest,
103
- ): Promise<ConfirmPhoneResponse> | Observable<ConfirmPhoneResponse> | ConfirmPhoneResponse;
101
+ confirmPhoneChange(
102
+ request: ConfirmPhoneChangeRequest,
103
+ ): Promise<ConfirmPhoneChangeResponse> | Observable<ConfirmPhoneChangeResponse> | ConfirmPhoneChangeResponse;
104
104
  }
105
105
 
106
106
  export function AccountServiceControllerMethods() {
107
107
  return function (constructor: Function) {
108
- const grpcMethods: string[] = ["getAccount", "initEmailChange", "confirmEmail", "initPhoneChange", "confirmPhone"];
108
+ const grpcMethods: string[] = [
109
+ "getAccount",
110
+ "initEmailChange",
111
+ "confirmEmailChange",
112
+ "initPhoneChange",
113
+ "confirmPhoneChange",
114
+ ];
109
115
  for (const method of grpcMethods) {
110
116
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
111
117
  GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
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,25 @@ 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
+
42
62
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
43
63
 
44
64
  export interface AuthServiceClient {
@@ -47,6 +67,10 @@ export interface AuthServiceClient {
47
67
  verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
48
68
 
49
69
  refresh(request: RefreshRequest): Observable<RefreshResponse>;
70
+
71
+ telegramInit(request: Empty): Observable<TelegramInitResponse>;
72
+
73
+ telegramVerify(request: TelegramVerifyRequest): Observable<TelegramVerifyResponse>;
50
74
  }
51
75
 
52
76
  export interface AuthServiceController {
@@ -55,11 +79,17 @@ export interface AuthServiceController {
55
79
  verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
56
80
 
57
81
  refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
82
+
83
+ telegramInit(request: Empty): Promise<TelegramInitResponse> | Observable<TelegramInitResponse> | TelegramInitResponse;
84
+
85
+ telegramVerify(
86
+ request: TelegramVerifyRequest,
87
+ ): Promise<TelegramVerifyResponse> | Observable<TelegramVerifyResponse> | TelegramVerifyResponse;
58
88
  }
59
89
 
60
90
  export function AuthServiceControllerMethods() {
61
91
  return function (constructor: Function) {
62
- const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh"];
92
+ const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh", "telegramInit", "telegramVerify"];
63
93
  for (const method of grpcMethods) {
64
94
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
65
95
  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": "@yrarami-teacinema/contracts",
3
- "version": "1.0.8",
3
+ "version": "1.1.1",
4
4
  "description": "Protobufs for the TeaCinema project",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -6,10 +6,10 @@ service AccountService {
6
6
  rpc GetAccount (GetAccountRequest) returns (GetAccountResponse);
7
7
 
8
8
  rpc InitEmailChange (InitEmailChangeRequest) returns (InitEmailChangeResponse);
9
- rpc ConfirmEmail (ConfirmEmailRequest) returns (ConfirmEmailResponse);
9
+ rpc ConfirmEmailChange (ConfirmEmailChangeRequest) returns (ConfirmEmailChangeResponse);
10
10
 
11
11
  rpc InitPhoneChange (InitPhoneChangeRequest) returns (InitPhoneChangeResponse);
12
- rpc ConfirmPhone (ConfirmPhoneRequest) returns (ConfirmPhoneResponse);
12
+ rpc ConfirmPhoneChange (ConfirmPhoneChangeRequest) returns (ConfirmPhoneChangeResponse);
13
13
  }
14
14
 
15
15
  message GetAccountRequest {
@@ -34,13 +34,13 @@ message InitEmailChangeResponse {
34
34
  bool ok = 1;
35
35
  }
36
36
 
37
- message ConfirmEmailRequest {
37
+ message ConfirmEmailChangeRequest {
38
38
  string email = 1;
39
39
  string code = 2;
40
40
  string user_id = 3;
41
41
  }
42
42
 
43
- message ConfirmEmailResponse {
43
+ message ConfirmEmailChangeResponse {
44
44
  bool ok = 1;
45
45
  }
46
46
 
@@ -53,13 +53,13 @@ message InitPhoneChangeResponse {
53
53
  bool ok = 1;
54
54
  }
55
55
 
56
- message ConfirmPhoneRequest {
56
+ message ConfirmPhoneChangeRequest {
57
57
  string phone = 1;
58
58
  string code = 2;
59
59
  string user_id = 3;
60
60
  }
61
61
 
62
- message ConfirmPhoneResponse {
62
+ message ConfirmPhoneChangeResponse {
63
63
  bool ok = 1;
64
64
  }
65
65
 
package/proto/auth.proto CHANGED
@@ -2,10 +2,15 @@ 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 Refresh (RefreshRequest) returns (RefreshResponse);
11
+
12
+ rpc TelegramInit (google.protobuf.Empty) returns (TelegramInitResponse);
13
+ rpc TelegramVerify (TelegramVerifyRequest) returns (TelegramVerifyResponse);
9
14
  }
10
15
 
11
16
  message SendOtpRequest {
@@ -35,4 +40,20 @@ message RefreshRequest {
35
40
  message RefreshResponse {
36
41
  string access_token = 1;
37
42
  string refresh_token = 2;
43
+ }
44
+
45
+ message TelegramInitResponse {
46
+ string url = 1;
47
+ }
48
+
49
+ message TelegramVerifyRequest {
50
+ map<string, string> query = 1;
51
+ }
52
+
53
+ message TelegramVerifyResponse {
54
+ oneof result {
55
+ string url = 1;
56
+ string access_token = 2;
57
+ string refresh_token = 3;
58
+ };
38
59
  }