@aleshacinema/contracts 1.0.21 → 1.0.22

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.
@@ -1,4 +1,5 @@
1
1
  import { Observable } from "rxjs";
2
+ import { Empty } from "./google/protobuf/empty.js";
2
3
  export interface SendOtpRequest {
3
4
  identifier: string;
4
5
  type: string;
@@ -22,15 +23,36 @@ export interface RefreshResponse {
22
23
  accessToken: string;
23
24
  refreshToken: string;
24
25
  }
26
+ export interface TelegramInitResponse {
27
+ url: string;
28
+ }
29
+ export interface TelegramVerifyRequest {
30
+ query: {
31
+ [key: string]: string;
32
+ };
33
+ }
34
+ export interface TelegramVerifyRequest_QueryEntry {
35
+ key: string;
36
+ value: string;
37
+ }
38
+ export interface TelegramVerifyResponse {
39
+ url?: string | undefined;
40
+ accessToken?: string | undefined;
41
+ refreshToken?: string | undefined;
42
+ }
25
43
  export interface AuthServiceClient {
26
44
  sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
27
45
  verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
28
46
  refresh(request: RefreshRequest): Observable<RefreshResponse>;
47
+ telegramInit(request: Empty): Observable<TelegramInitResponse>;
48
+ telegramVerify(request: TelegramVerifyRequest): Observable<TelegramVerifyResponse>;
29
49
  }
30
50
  export interface AuthServiceController {
31
51
  sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
32
52
  verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
33
53
  refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
54
+ telegramInit(request: Empty): Promise<TelegramInitResponse> | Observable<TelegramInitResponse> | TelegramInitResponse;
55
+ telegramVerify(request: TelegramVerifyRequest): Promise<TelegramVerifyResponse> | Observable<TelegramVerifyResponse> | TelegramVerifyResponse;
34
56
  }
35
57
  export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
36
58
  export declare const AUTH_SERVICE_NAME = "AuthService";
package/dist/gen/auth.js CHANGED
@@ -7,7 +7,7 @@
7
7
  import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
8
8
  export function AuthServiceControllerMethods() {
9
9
  return function (constructor) {
10
- const grpcMethods = ["sendOtp", "verifyOtp", "refresh"];
10
+ const grpcMethods = ["sendOtp", "verifyOtp", "refresh", "telegramInit", "telegramVerify"];
11
11
  for (const method of grpcMethods) {
12
12
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
13
13
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
@@ -0,0 +1,11 @@
1
+ /**
2
+ * A generic empty message that you can re-use to avoid defining duplicated
3
+ * empty messages in your APIs. A typical example is to use it as the request
4
+ * or the response type of an API method. For instance:
5
+ *
6
+ * service Foo {
7
+ * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
8
+ * }
9
+ */
10
+ export interface Empty {
11
+ }
@@ -0,0 +1,6 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.18.1
4
+ // protoc v4.25.9
5
+ // source: google/protobuf/empty.proto
6
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aleshacinema/contracts",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "description": "Protobuf definitions and generated TypeSript types",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -13,7 +13,7 @@
13
13
  "./proto/*": "./proto/*"
14
14
  },
15
15
  "scripts": {
16
- "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./src/gen --ts_proto_opt=nestJs=true,package=omit,esModuleInterop=true,exportCommonSymbols=false",
16
+ "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./src/gen --ts_proto_opt=nestJs=true,package=omit,esModuleInterop=true,exportCommonSymbols=false,importSuffix=.js",
17
17
  "build": "yarn run generate && tsc -p tsconfig.build.json"
18
18
  },
19
19
  "files": [
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
  }