@vsniksnet/contracts 1.2.5 → 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/users.ts +50 -1
- package/package.json +1 -1
- package/proto/users.proto +43 -0
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
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
|
}
|