@slack-clone-org/contracts 1.1.5 → 1.1.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/generated/user.ts CHANGED
@@ -23,7 +23,16 @@ export interface CreateUserRequest {
23
23
  }
24
24
 
25
25
  export interface CreateUserResponse {
26
- ok: string;
26
+ ok: boolean;
27
+ }
28
+
29
+ export interface PatchUserRequest {
30
+ userId: string;
31
+ name?: string | undefined;
32
+ }
33
+
34
+ export interface PatchUserResponse {
35
+ ok: boolean;
27
36
  }
28
37
 
29
38
  /**
@@ -57,6 +66,13 @@ export interface UserServiceClient {
57
66
  */
58
67
 
59
68
  createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
69
+
70
+ /**
71
+ * PatchUser updates the profile of the currently authenticated user.
72
+ * NOTE: Additional fields will be added in a future iteration.
73
+ */
74
+
75
+ patchUser(request: PatchUserRequest): Observable<PatchUserResponse>;
60
76
  }
61
77
 
62
78
  /**
@@ -78,11 +94,18 @@ export interface UserServiceController {
78
94
  createUser(
79
95
  request: CreateUserRequest,
80
96
  ): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
97
+
98
+ /**
99
+ * PatchUser updates the profile of the currently authenticated user.
100
+ * NOTE: Additional fields will be added in a future iteration.
101
+ */
102
+
103
+ patchUser(request: PatchUserRequest): Promise<PatchUserResponse> | Observable<PatchUserResponse> | PatchUserResponse;
81
104
  }
82
105
 
83
106
  export function UserServiceControllerMethods() {
84
107
  return function (constructor: Function) {
85
- const grpcMethods: string[] = ["getMe", "createUser"];
108
+ const grpcMethods: string[] = ["getMe", "createUser", "patchUser"];
86
109
  for (const method of grpcMethods) {
87
110
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
88
111
  GrpcMethod("UserService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slack-clone-org/contracts",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "Shared gRPC contracts and TypeScript definitions for Slack Clone microservices",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/user.proto CHANGED
@@ -11,6 +11,9 @@ service UserService {
11
11
  // CreateUser creates a new user profile after successful authentication.
12
12
  // Called internally when a new account is registered.
13
13
  rpc CreateUser (CreateUserRequest) returns (CreateUserResponse);
14
+ // PatchUser updates the profile of the currently authenticated user.
15
+ // NOTE: Additional fields will be added in a future iteration.
16
+ rpc PatchUser (PatchUserRequest) returns (PatchUserResponse);
14
17
  }
15
18
 
16
19
  message GetMeRequest {
@@ -26,7 +29,16 @@ message CreateUserRequest {
26
29
  }
27
30
 
28
31
  message CreateUserResponse {
29
- string ok = 1;
32
+ bool ok = 1;
33
+ }
34
+
35
+ message PatchUserRequest {
36
+ string user_id = 1;
37
+ optional string name = 2;
38
+ }
39
+
40
+ message PatchUserResponse {
41
+ bool ok = 1;
30
42
  }
31
43
 
32
44
  // User represents a user profile.