@voice-chat/contracts 1.0.6 → 1.0.7

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
@@ -27,6 +27,16 @@ export interface GetUserByEmailResponse {
27
27
  user: User | undefined;
28
28
  }
29
29
 
30
+ export interface CreateUserRequest {
31
+ username: string;
32
+ email: string;
33
+ passwordHash: string;
34
+ }
35
+
36
+ export interface CreateUserResponse {
37
+ user: User | undefined;
38
+ }
39
+
30
40
  export interface User {
31
41
  id: string;
32
42
  username: string;
@@ -42,6 +52,8 @@ export interface UserServiceClient {
42
52
  getUserById(request: GetUserByIdRequest): Observable<GetUserByIdResponse>;
43
53
 
44
54
  getUserByEmail(request: GetUserByEmailRequest): Observable<GetUserByEmailResponse>;
55
+
56
+ createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
45
57
  }
46
58
 
47
59
  export interface UserServiceController {
@@ -52,11 +64,15 @@ export interface UserServiceController {
52
64
  getUserByEmail(
53
65
  request: GetUserByEmailRequest,
54
66
  ): Promise<GetUserByEmailResponse> | Observable<GetUserByEmailResponse> | GetUserByEmailResponse;
67
+
68
+ createUser(
69
+ request: CreateUserRequest,
70
+ ): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
55
71
  }
56
72
 
57
73
  export function UserServiceControllerMethods() {
58
74
  return function (constructor: Function) {
59
- const grpcMethods: string[] = ["getUserById", "getUserByEmail"];
75
+ const grpcMethods: string[] = ["getUserById", "getUserByEmail", "createUser"];
60
76
  for (const method of grpcMethods) {
61
77
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
62
78
  GrpcMethod("UserService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voice-chat/contracts",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "api-contracts",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/proto/user.proto CHANGED
@@ -7,6 +7,7 @@ import "google/protobuf/timestamp.proto";
7
7
  service UserService {
8
8
  rpc GetUserById(GetUserByIdRequest) returns (GetUserByIdResponse);
9
9
  rpc GetUserByEmail(GetUserByEmailRequest) returns (GetUserByEmailResponse);
10
+ rpc CreateUser(CreateUserRequest) returns (CreateUserResponse);
10
11
  }
11
12
 
12
13
  message GetUserByIdRequest {
@@ -25,6 +26,16 @@ message GetUserByEmailResponse {
25
26
  User user = 1;
26
27
  }
27
28
 
29
+ message CreateUserRequest {
30
+ string username = 1;
31
+ string email = 2;
32
+ string password_hash = 3;
33
+ }
34
+
35
+ message CreateUserResponse {
36
+ User user = 1;
37
+ }
38
+
28
39
  message User {
29
40
  string id = 1;
30
41
  string username = 2;