@candesk/contracts 6.3.0 → 6.4.0

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.
@@ -24,6 +24,14 @@ export interface UpdateUserRequest {
24
24
  export interface UpdateUserResponse {
25
25
  user: User | undefined;
26
26
  }
27
+ export interface SetAvatarRequest {
28
+ id: string;
29
+ avatarKey?: string | undefined;
30
+ }
31
+ export interface SetAvatarResponse {
32
+ user: User | undefined;
33
+ previousAvatarKey?: string | undefined;
34
+ }
27
35
  export interface User {
28
36
  id: string;
29
37
  firstName: string;
@@ -31,7 +39,7 @@ export interface User {
31
39
  birthDate: string;
32
40
  address: Address | undefined;
33
41
  phone: string;
34
- avatar?: string | undefined;
42
+ avatarKey?: string | undefined;
35
43
  }
36
44
  export interface Address {
37
45
  street: string;
@@ -43,4 +51,5 @@ export interface UserService {
43
51
  getUser(request: GetUserRequest): Promise<GetUserResponse>;
44
52
  createUser(request: CreateUserRequest): Promise<CreateUserResponse>;
45
53
  updateUser(request: UpdateUserRequest): Promise<UpdateUserResponse>;
54
+ setAvatar(request: SetAvatarRequest): Promise<SetAvatarResponse>;
46
55
  }
@@ -25,6 +25,14 @@ export interface UpdateUserRequest {
25
25
  export interface UpdateUserResponse {
26
26
  user: User | undefined;
27
27
  }
28
+ export interface SetAvatarRequest {
29
+ id: string;
30
+ avatarKey?: string | undefined;
31
+ }
32
+ export interface SetAvatarResponse {
33
+ user: User | undefined;
34
+ previousAvatarKey?: string | undefined;
35
+ }
28
36
  export interface User {
29
37
  id: string;
30
38
  firstName: string;
@@ -32,7 +40,7 @@ export interface User {
32
40
  birthDate: string;
33
41
  address: Address | undefined;
34
42
  phone: string;
35
- avatar?: string | undefined;
43
+ avatarKey?: string | undefined;
36
44
  }
37
45
  export interface Address {
38
46
  street: string;
@@ -45,11 +53,13 @@ export interface UserServiceClient {
45
53
  getUser(request: GetUserRequest): Observable<GetUserResponse>;
46
54
  createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
47
55
  updateUser(request: UpdateUserRequest): Observable<UpdateUserResponse>;
56
+ setAvatar(request: SetAvatarRequest): Observable<SetAvatarResponse>;
48
57
  }
49
58
  export interface UserServiceController {
50
59
  getUser(request: GetUserRequest): Promise<GetUserResponse> | Observable<GetUserResponse> | GetUserResponse;
51
60
  createUser(request: CreateUserRequest): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
52
61
  updateUser(request: UpdateUserRequest): Promise<UpdateUserResponse> | Observable<UpdateUserResponse> | UpdateUserResponse;
62
+ setAvatar(request: SetAvatarRequest): Promise<SetAvatarResponse> | Observable<SetAvatarResponse> | SetAvatarResponse;
53
63
  }
54
64
  export declare function UserServiceControllerMethods(): (constructor: Function) => void;
55
65
  export declare const USER_SERVICE_NAME = "UserService";
package/dist/nest/user.js CHANGED
@@ -13,7 +13,7 @@ exports.protobufPackage = "user.v1";
13
13
  exports.USER_V1_PACKAGE_NAME = "user.v1";
14
14
  function UserServiceControllerMethods() {
15
15
  return function (constructor) {
16
- const grpcMethods = ["getUser", "createUser", "updateUser"];
16
+ const grpcMethods = ["getUser", "createUser", "updateUser", "setAvatar"];
17
17
  for (const method of grpcMethods) {
18
18
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
19
19
  (0, microservices_1.GrpcMethod)("UserService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candesk/contracts",
3
- "version": "6.3.0",
3
+ "version": "6.4.0",
4
4
  "description": "Protobuf contracts for CanDesk microservices",
5
5
  "author": {
6
6
  "name": "Alexander Schulz",
package/proto/user.proto CHANGED
@@ -6,6 +6,7 @@ service UserService {
6
6
  rpc GetUser (GetUserRequest) returns (GetUserResponse);
7
7
  rpc CreateUser (CreateUserRequest) returns (CreateUserResponse);
8
8
  rpc UpdateUser (UpdateUserRequest) returns (UpdateUserResponse);
9
+ rpc SetAvatar (SetAvatarRequest) returns (SetAvatarResponse);
9
10
  }
10
11
 
11
12
  message GetUserRequest {
@@ -39,6 +40,16 @@ message UpdateUserResponse {
39
40
  User user = 1;
40
41
  }
41
42
 
43
+ message SetAvatarRequest {
44
+ string id = 1;
45
+ optional string avatar_key = 2;
46
+ }
47
+
48
+ message SetAvatarResponse {
49
+ User user = 1;
50
+ optional string previous_avatar_key = 2;
51
+ }
52
+
42
53
  message User {
43
54
  string id = 1;
44
55
  string first_name = 2;
@@ -46,7 +57,7 @@ message User {
46
57
  string birth_date = 4;
47
58
  Address address = 5;
48
59
  string phone = 6;
49
- optional string avatar = 7;
60
+ optional string avatar_key = 7;
50
61
  }
51
62
 
52
63
  message Address {