@vsniksnet/contracts 1.2.4 → 1.2.6

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/media.ts CHANGED
@@ -10,14 +10,13 @@ import { Observable } from "rxjs";
10
10
 
11
11
  export const protobufPackage = "media.v1";
12
12
 
13
- export interface UploadRequest {
13
+ export interface UploadAvatarRequest {
14
14
  fileName: string;
15
15
  contentType: string;
16
16
  data: Uint8Array;
17
- folder?: string | undefined;
18
17
  }
19
18
 
20
- export interface UploadResponse {
19
+ export interface UploadAvatarResponse {
21
20
  path: string;
22
21
  }
23
22
 
@@ -26,22 +25,24 @@ export const MEDIA_V1_PACKAGE_NAME = "media.v1";
26
25
  /** Media service */
27
26
 
28
27
  export interface MediaServiceClient {
29
- /** Upload media file */
28
+ /** Upload avatar file */
30
29
 
31
- upload(request: UploadRequest): Observable<UploadResponse>;
30
+ uploadAvatar(request: UploadAvatarRequest): Observable<UploadAvatarResponse>;
32
31
  }
33
32
 
34
33
  /** Media service */
35
34
 
36
35
  export interface MediaServiceController {
37
- /** Upload media file */
36
+ /** Upload avatar file */
38
37
 
39
- upload(request: UploadRequest): Promise<UploadResponse> | Observable<UploadResponse> | UploadResponse;
38
+ uploadAvatar(
39
+ request: UploadAvatarRequest,
40
+ ): Promise<UploadAvatarResponse> | Observable<UploadAvatarResponse> | UploadAvatarResponse;
40
41
  }
41
42
 
42
43
  export function MediaServiceControllerMethods() {
43
44
  return function (constructor: Function) {
44
- const grpcMethods: string[] = ["upload"];
45
+ const grpcMethods: string[] = ["uploadAvatar"];
45
46
  for (const method of grpcMethods) {
46
47
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
47
48
  GrpcMethod("MediaService", method)(constructor.prototype[method], method, descriptor);
package/gen/users.ts CHANGED
@@ -10,6 +10,21 @@ import { Observable } from "rxjs";
10
10
 
11
11
  export const protobufPackage = "users.v1";
12
12
 
13
+ export enum Gender {
14
+ GENDER_UNKNOWN = 0,
15
+ MALE = 1,
16
+ FAMALE = 2,
17
+ UNRECOGNIZED = -1,
18
+ }
19
+
20
+ export enum Status {
21
+ STATUS_UNKNOWN = 0,
22
+ SINGLE = 1,
23
+ RELATIONS = 2,
24
+ MARRIED = 3,
25
+ UNRECOGNIZED = -1,
26
+ }
27
+
13
28
  export interface CreateUserRequest {
14
29
  id: string;
15
30
  email: string;
@@ -49,6 +64,22 @@ export interface UpdateEmailResponse {
49
64
  email: string;
50
65
  }
51
66
 
67
+ export interface UpdateUserRequest {
68
+ userId: string;
69
+ username?: string | undefined;
70
+ avatar?: string | undefined;
71
+ cover?: string | undefined;
72
+ bio?: string | undefined;
73
+ gender?: Gender | undefined;
74
+ status?: Status | undefined;
75
+ country?: string | undefined;
76
+ birdhDay?: string | undefined;
77
+ }
78
+
79
+ export interface UpdateUserResponse {
80
+ profile: Profile | undefined;
81
+ }
82
+
52
83
  export interface User {
53
84
  id: string;
54
85
  email: string;
@@ -56,6 +87,18 @@ export interface User {
56
87
  avatar: string;
57
88
  }
58
89
 
90
+ export interface Profile {
91
+ userId: string;
92
+ username: string;
93
+ avatar: string;
94
+ cover: string;
95
+ bio: string;
96
+ gender: string;
97
+ status: string;
98
+ country: string;
99
+ birdhDay: string;
100
+ }
101
+
59
102
  export const USERS_V1_PACKAGE_NAME = "users.v1";
60
103
 
61
104
  /** Users service */
@@ -76,6 +119,8 @@ export interface UsersServiceClient {
76
119
  /** Update email */
77
120
 
78
121
  updateEmail(request: UpdateEmailRequest): Observable<UpdateEmailResponse>;
122
+
123
+ updateUser(request: UpdateUserRequest): Observable<UpdateUserResponse>;
79
124
  }
80
125
 
81
126
  /** Users service */
@@ -100,11 +145,15 @@ export interface UsersServiceController {
100
145
  updateEmail(
101
146
  request: UpdateEmailRequest,
102
147
  ): Promise<UpdateEmailResponse> | Observable<UpdateEmailResponse> | UpdateEmailResponse;
148
+
149
+ updateUser(
150
+ request: UpdateUserRequest,
151
+ ): Promise<UpdateUserResponse> | Observable<UpdateUserResponse> | UpdateUserResponse;
103
152
  }
104
153
 
105
154
  export function UsersServiceControllerMethods() {
106
155
  return function (constructor: Function) {
107
- const grpcMethods: string[] = ["createUser", "getUser", "listUsers", "updateEmail"];
156
+ const grpcMethods: string[] = ["createUser", "getUser", "listUsers", "updateEmail", "updateUser"];
108
157
  for (const method of grpcMethods) {
109
158
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
110
159
  GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vsniksnet/contracts",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "Protobuf definitions and generated typescript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/media.proto CHANGED
@@ -4,17 +4,16 @@ package media.v1;
4
4
 
5
5
  /* Media service */
6
6
  service MediaService {
7
- /* Upload media file */
8
- rpc Upload (UploadRequest) returns (UploadResponse);
7
+ /* Upload avatar file */
8
+ rpc UploadAvatar (UploadAvatarRequest) returns (UploadAvatarResponse);
9
9
  }
10
10
 
11
- message UploadRequest {
11
+ message UploadAvatarRequest {
12
12
  string file_name = 1;
13
13
  string content_type = 2;
14
14
  bytes data = 3;
15
- optional string folder = 4;
16
15
  }
17
16
 
18
- message UploadResponse {
17
+ message UploadAvatarResponse {
19
18
  string path = 1;
20
19
  }
package/proto/users.proto CHANGED
@@ -12,6 +12,8 @@ service UsersService {
12
12
  rpc ListUsers (ListUsersRequest) returns (ListUsersResponse);
13
13
  /* Update email */
14
14
  rpc UpdateEmail (UpdateEmailRequest) returns (UpdateEmailResponse);
15
+
16
+ rpc UpdateUser (UpdateUserRequest) returns (UpdateUserResponse);
15
17
  }
16
18
 
17
19
  message CreateUserRequest {
@@ -53,9 +55,50 @@ message UpdateEmailResponse {
53
55
  string email = 2;
54
56
  }
55
57
 
58
+ message UpdateUserRequest {
59
+ string user_id = 1;
60
+ optional string username = 2;
61
+ optional string avatar = 3;
62
+ optional string cover = 4;
63
+ optional string bio = 5;
64
+ optional Gender gender = 6;
65
+ optional Status status = 7;
66
+ optional string country = 8;
67
+ optional string birdh_day = 9;
68
+ }
69
+
70
+ message UpdateUserResponse {
71
+ Profile profile = 1;
72
+ }
73
+
56
74
  message User {
57
75
  string id = 1;
58
76
  string email = 2;
59
77
  string username = 3;
60
78
  string avatar = 4;
79
+ }
80
+
81
+ message Profile {
82
+ string user_id = 1;
83
+ string username = 2;
84
+ string avatar = 3;
85
+ string cover = 4;
86
+ string bio = 5;
87
+ string gender = 6;
88
+ string status = 7;
89
+ string country = 8;
90
+ string birdh_day = 9;
91
+ }
92
+
93
+ enum Gender {
94
+ GENDER_UNKNOWN = 0;
95
+ MALE = 1;
96
+ FAMALE = 2;
97
+ }
98
+
99
+ enum Status {
100
+ STATUS_UNKNOWN = 0;
101
+ SINGLE = 1;
102
+ RELATIONS = 2;
103
+ MARRIED = 3;
61
104
  }