@awscinema/contracts 1.0.4 → 1.0.6

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
@@ -16,6 +16,44 @@ export enum Role {
16
16
  UNRECOGNIZED = -1,
17
17
  }
18
18
 
19
+ export interface ConfirmPhoneChangeRequest {
20
+ phone: string;
21
+ code: string;
22
+ userId: string;
23
+ }
24
+
25
+ export interface ConfirmPhoneChangeResponse {
26
+ ok: boolean;
27
+ }
28
+
29
+ export interface InitPhoneChangeRequest {
30
+ phone: string;
31
+ userId: string;
32
+ }
33
+
34
+ export interface InitPhoneChangeResponse {
35
+ ok: boolean;
36
+ }
37
+
38
+ export interface ConfirmEmailChangeRequest {
39
+ email: string;
40
+ code: string;
41
+ userId: string;
42
+ }
43
+
44
+ export interface ConfirmEmailChangeResponse {
45
+ ok: boolean;
46
+ }
47
+
48
+ export interface InitEmailChangeRequest {
49
+ email: string;
50
+ userId: string;
51
+ }
52
+
53
+ export interface InitEmailChangeResponse {
54
+ ok: boolean;
55
+ }
56
+
19
57
  export interface GetAccountRequest {
20
58
  id: string;
21
59
  }
@@ -33,17 +71,47 @@ export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
33
71
 
34
72
  export interface AccountServiceClient {
35
73
  getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
74
+
75
+ initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
76
+
77
+ confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
78
+
79
+ initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponse>;
80
+
81
+ confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponse>;
36
82
  }
37
83
 
38
84
  export interface AccountServiceController {
39
85
  getAccount(
40
86
  request: GetAccountRequest,
41
87
  ): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
88
+
89
+ initEmailChange(
90
+ request: InitEmailChangeRequest,
91
+ ): Promise<InitEmailChangeResponse> | Observable<InitEmailChangeResponse> | InitEmailChangeResponse;
92
+
93
+ confirmEmailChange(
94
+ request: ConfirmEmailChangeRequest,
95
+ ): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
96
+
97
+ initPhoneChange(
98
+ request: InitPhoneChangeRequest,
99
+ ): Promise<InitPhoneChangeResponse> | Observable<InitPhoneChangeResponse> | InitPhoneChangeResponse;
100
+
101
+ confirmPhoneChange(
102
+ request: ConfirmPhoneChangeRequest,
103
+ ): Promise<ConfirmPhoneChangeResponse> | Observable<ConfirmPhoneChangeResponse> | ConfirmPhoneChangeResponse;
42
104
  }
43
105
 
44
106
  export function AccountServiceControllerMethods() {
45
107
  return function (constructor: Function) {
46
- const grpcMethods: string[] = ["getAccount"];
108
+ const grpcMethods: string[] = [
109
+ "getAccount",
110
+ "initEmailChange",
111
+ "confirmEmailChange",
112
+ "initPhoneChange",
113
+ "confirmPhoneChange",
114
+ ];
47
115
  for (const method of grpcMethods) {
48
116
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
49
117
  GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
package/gen/auth.ts CHANGED
@@ -7,9 +7,29 @@
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
 
14
+ export interface TelegramVerifyRequest {
15
+ query: { [key: string]: string };
16
+ }
17
+
18
+ export interface TelegramVerifyRequest_QueryEntry {
19
+ key: string;
20
+ value: string;
21
+ }
22
+
23
+ export interface TelegramVerifyResponse {
24
+ url?: string | undefined;
25
+ accessToken?: string | undefined;
26
+ refreshToken?: string | undefined;
27
+ }
28
+
29
+ export interface TelegramInitResponse {
30
+ url: string;
31
+ }
32
+
13
33
  export interface RefreshResponse {
14
34
  accessToken: string;
15
35
  refreshToken: string;
@@ -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.11.7
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": "@awscinema/contracts",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Protobuf definitions and generated Typescript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -4,6 +4,53 @@ package account.v1;
4
4
 
5
5
  service AccountService {
6
6
  rpc GetAccount (GetAccountRequest) returns (GetAccountResponse);
7
+
8
+ rpc InitEmailChange (InitEmailChangeRequest) returns (InitEmailChangeResponse);
9
+
10
+ rpc ConfirmEmailChange (ConfirmEmailChangeRequest) returns (ConfirmEmailChangeResponse);
11
+
12
+
13
+ rpc InitPhoneChange (InitPhoneChangeRequest) returns (InitPhoneChangeResponse);
14
+
15
+ rpc ConfirmPhoneChange (ConfirmPhoneChangeRequest) returns (ConfirmPhoneChangeResponse);
16
+ }
17
+
18
+ message ConfirmPhoneChangeRequest {
19
+ string phone = 1;
20
+ string code = 2;
21
+ string user_id = 3;
22
+ }
23
+
24
+ message ConfirmPhoneChangeResponse {
25
+ bool ok = 1;
26
+ }
27
+
28
+ message InitPhoneChangeRequest {
29
+ string phone = 1;
30
+ string user_id = 2;
31
+ }
32
+
33
+ message InitPhoneChangeResponse {
34
+ bool ok = 1;
35
+ }
36
+
37
+ message ConfirmEmailChangeRequest {
38
+ string email = 1;
39
+ string code = 2;
40
+ string user_id = 3;
41
+ }
42
+
43
+ message ConfirmEmailChangeResponse {
44
+ bool ok = 1;
45
+ }
46
+
47
+ message InitEmailChangeRequest {
48
+ string email = 1;
49
+ string user_id = 2;
50
+ }
51
+
52
+ message InitEmailChangeResponse {
53
+ bool ok = 1;
7
54
  }
8
55
 
9
56
  message GetAccountRequest{
package/proto/auth.proto CHANGED
@@ -2,12 +2,35 @@ 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
 
16
+ message TelegramVerifyRequest {
17
+ map<string, string> query = 1;
18
+
19
+ }
20
+
21
+ message TelegramVerifyResponse {
22
+ oneof result {
23
+ string url = 1;
24
+ string access_token = 2;
25
+ string refresh_token = 3;
26
+ }
27
+ }
28
+
29
+
30
+ message TelegramInitResponse {
31
+ string url = 1;
32
+ }
33
+
11
34
  message RefreshResponse {
12
35
  string access_token = 1;
13
36
  string refresh_token = 2;