@alebooking/contracts 1.0.8 → 1.0.10

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
@@ -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 = "account.v1";
12
13
 
@@ -22,28 +23,72 @@ export interface GetAccountRequest {
22
23
 
23
24
  export interface GetAccountResponse {
24
25
  id: string;
25
- phone: string;
26
- email: string;
26
+ phone?: string | undefined;
27
+ email?: string | undefined;
27
28
  isPhoneVerfiied: boolean;
28
29
  isEmailVerified: boolean;
29
30
  role: Role;
30
31
  }
31
32
 
33
+ export interface InitEmailChangeRequest {
34
+ email: string;
35
+ userId: string;
36
+ }
37
+
38
+ export interface ConfirmEmailChangeRequest {
39
+ email: string;
40
+ code: string;
41
+ userId: string;
42
+ }
43
+
44
+ export interface InitPhoneChangeRequest {
45
+ phone: string;
46
+ userId: string;
47
+ }
48
+
49
+ export interface ConfirmPhoneChangeRequest {
50
+ phone: string;
51
+ code: string;
52
+ userId: string;
53
+ }
54
+
32
55
  export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
33
56
 
34
57
  export interface AccountServiceClient {
35
58
  getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
59
+
60
+ initEmailChange(request: InitEmailChangeRequest): Observable<Empty>;
61
+
62
+ configEmailChange(request: ConfirmEmailChangeRequest): Observable<Empty>;
63
+
64
+ initPhoneChange(request: InitPhoneChangeRequest): Observable<Empty>;
65
+
66
+ configPhoneChange(request: ConfirmPhoneChangeRequest): Observable<Empty>;
36
67
  }
37
68
 
38
69
  export interface AccountServiceController {
39
70
  getAccount(
40
71
  request: GetAccountRequest,
41
72
  ): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
73
+
74
+ initEmailChange(request: InitEmailChangeRequest): void;
75
+
76
+ configEmailChange(request: ConfirmEmailChangeRequest): void;
77
+
78
+ initPhoneChange(request: InitPhoneChangeRequest): void;
79
+
80
+ configPhoneChange(request: ConfirmPhoneChangeRequest): void;
42
81
  }
43
82
 
44
83
  export function AccountServiceControllerMethods() {
45
84
  return function (constructor: Function) {
46
- const grpcMethods: string[] = ["getAccount"];
85
+ const grpcMethods: string[] = [
86
+ "getAccount",
87
+ "initEmailChange",
88
+ "configEmailChange",
89
+ "initPhoneChange",
90
+ "configPhoneChange",
91
+ ];
47
92
  for (const method of grpcMethods) {
48
93
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
49
94
  GrpcMethod("AccountService", 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.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": "@alebooking/contracts",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Protobug definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -2,8 +2,16 @@ syntax = "proto3";
2
2
 
3
3
  package account.v1;
4
4
 
5
+ import "google/protobuf/empty.proto";
6
+
5
7
  service AccountService {
6
8
  rpc GetAccount (GetAccountRequest) returns (GetAccountResponse);
9
+
10
+ rpc InitEmailChange (InitEmailChangeRequest) returns (google.protobuf.Empty);
11
+ rpc ConfigEmailChange (ConfirmEmailChangeRequest) returns (google.protobuf.Empty);
12
+
13
+ rpc InitPhoneChange (InitPhoneChangeRequest) returns (google.protobuf.Empty);
14
+ rpc ConfigPhoneChange (ConfirmPhoneChangeRequest) returns (google.protobuf.Empty);
7
15
  }
8
16
 
9
17
  message GetAccountRequest {
@@ -11,15 +19,37 @@ message GetAccountRequest {
11
19
  }
12
20
 
13
21
  message GetAccountResponse {
14
- string id = 1;
15
- string phone = 2;
16
- string email = 3;
17
- bool is_phone_verfiied = 4;
18
- bool is_email_verified = 5;
19
- Role role = 6;
22
+ string id = 1;
23
+ optional string phone = 2;
24
+ optional string email = 3;
25
+ bool is_phone_verfiied = 4;
26
+ bool is_email_verified = 5;
27
+ Role role = 6;
20
28
  }
21
29
 
22
30
  enum Role {
23
- USER = 0;
24
- ADMIN = 1;
31
+ USER = 0;
32
+ ADMIN = 1;
33
+ }
34
+
35
+ message InitEmailChangeRequest {
36
+ string email = 1;
37
+ string user_id = 2;
38
+ }
39
+
40
+ message ConfirmEmailChangeRequest {
41
+ string email = 1;
42
+ string code = 2;
43
+ string user_id = 3;
44
+ }
45
+
46
+ message InitPhoneChangeRequest {
47
+ string phone = 1;
48
+ string user_id = 2;
49
+ }
50
+
51
+ message ConfirmPhoneChangeRequest {
52
+ string phone = 1;
53
+ string code = 2;
54
+ string user_id = 3;
25
55
  }