@requ1emz/contracts 1.0.11 → 1.0.13

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/user.ts CHANGED
@@ -10,38 +10,47 @@ import { Observable } from "rxjs";
10
10
 
11
11
  export const protobufPackage = "user.v1";
12
12
 
13
+ export interface SendCheckUserExistsRequest {
14
+ email: string;
15
+ }
16
+
17
+ export interface SendCheckUserExistsResponse {
18
+ exists: boolean;
19
+ }
20
+
13
21
  export interface SendCreateUserRequest {
14
22
  email: string;
15
- password: string;
23
+ passwordHash: string;
16
24
  }
17
25
 
18
26
  export interface SendCreateUserResponse {
19
- userId: string;
27
+ id: string;
20
28
  }
21
29
 
22
30
  export interface SendGetUserRequest {
23
- userId?: string | undefined;
31
+ id?: string | undefined;
24
32
  email?: string | undefined;
25
33
  }
26
34
 
27
35
  export interface SendGetUserResponse {
28
- userId: string;
36
+ id: string;
29
37
  email: string;
38
+ passwordHash: string;
30
39
  }
31
40
 
32
41
  export interface SendUpdateUserRequest {
33
- userId: string;
42
+ id: string;
34
43
  email: string;
35
- password: string;
44
+ passwordHash: string;
36
45
  }
37
46
 
38
47
  export interface SendUpdateUserResponse {
39
- userId: string;
48
+ id: string;
40
49
  email: string;
41
50
  }
42
51
 
43
52
  export interface SendDeleteUserRequest {
44
- userId: string;
53
+ id: string;
45
54
  }
46
55
 
47
56
  export interface SendDeleteUserResponse {
@@ -51,6 +60,8 @@ export interface SendDeleteUserResponse {
51
60
  export const USER_V1_PACKAGE_NAME = "user.v1";
52
61
 
53
62
  export interface UserServiceClient {
63
+ checkUserExists(request: SendCheckUserExistsRequest): Observable<SendCheckUserExistsResponse>;
64
+
54
65
  createUser(request: SendCreateUserRequest): Observable<SendCreateUserResponse>;
55
66
 
56
67
  getUser(request: SendGetUserRequest): Observable<SendGetUserResponse>;
@@ -61,6 +72,10 @@ export interface UserServiceClient {
61
72
  }
62
73
 
63
74
  export interface UserServiceController {
75
+ checkUserExists(
76
+ request: SendCheckUserExistsRequest,
77
+ ): Promise<SendCheckUserExistsResponse> | Observable<SendCheckUserExistsResponse> | SendCheckUserExistsResponse;
78
+
64
79
  createUser(
65
80
  request: SendCreateUserRequest,
66
81
  ): Promise<SendCreateUserResponse> | Observable<SendCreateUserResponse> | SendCreateUserResponse;
@@ -80,7 +95,7 @@ export interface UserServiceController {
80
95
 
81
96
  export function UserServiceControllerMethods() {
82
97
  return function (constructor: Function) {
83
- const grpcMethods: string[] = ["createUser", "getUser", "updateUser", "deleteUser"];
98
+ const grpcMethods: string[] = ["checkUserExists", "createUser", "getUser", "updateUser", "deleteUser"];
84
99
  for (const method of grpcMethods) {
85
100
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
86
101
  GrpcMethod("UserService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@requ1emz/contracts",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/user.proto CHANGED
@@ -3,46 +3,56 @@ syntax = "proto3";
3
3
  package user.v1;
4
4
 
5
5
  service UserService {
6
+ rpc CheckUserExists (SendCheckUserExistsRequest) returns (SendCheckUserExistsResponse);
6
7
  rpc CreateUser (SendCreateUserRequest) returns (SendCreateUserResponse);
7
8
  rpc GetUser (SendGetUserRequest) returns (SendGetUserResponse);
8
9
  rpc UpdateUser (SendUpdateUserRequest) returns (SendUpdateUserResponse);
9
10
  rpc DeleteUser (SendDeleteUserRequest) returns (SendDeleteUserResponse);
10
11
  }
11
12
 
13
+ message SendCheckUserExistsRequest {
14
+ string email = 1;
15
+ }
16
+
17
+ message SendCheckUserExistsResponse {
18
+ bool exists = 1;
19
+ }
20
+
12
21
  message SendCreateUserRequest {
13
22
  string email = 1;
14
- string password = 2;
23
+ string password_hash = 2;
15
24
  }
16
25
 
17
26
  message SendCreateUserResponse {
18
- string user_id = 1;
27
+ string id = 1;
19
28
  }
20
29
 
21
30
  message SendGetUserRequest {
22
31
  oneof identifier {
23
- string user_id = 1;
24
- string email = 2;
32
+ string id = 1;
33
+ string email = 2;
25
34
  }
26
35
  }
27
36
 
28
37
  message SendGetUserResponse {
29
- string user_id = 1;
38
+ string id = 1;
30
39
  string email = 2;
40
+ string password_hash = 3;
31
41
  }
32
42
 
33
43
  message SendUpdateUserRequest {
34
- string user_id = 1;
44
+ string id = 1;
35
45
  string email = 2;
36
- string password = 3;
46
+ string password_hash = 3;
37
47
  }
38
48
 
39
49
  message SendUpdateUserResponse {
40
- string user_id = 1;
50
+ string id = 1;
41
51
  string email = 2;
42
52
  }
43
53
 
44
54
  message SendDeleteUserRequest {
45
- string user_id = 1;
55
+ string id = 1;
46
56
  }
47
57
 
48
58
  message SendDeleteUserResponse {