@yrarami-teacinema/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/gen/user.ts +16 -3
- package/package.json +1 -1
- package/proto/user.proto +12 -1
package/gen/user.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
9
|
import { Observable } from "rxjs";
|
|
10
10
|
|
|
11
|
-
export const protobufPackage = "
|
|
11
|
+
export const protobufPackage = "user.v1";
|
|
12
12
|
|
|
13
13
|
export interface GetMeRequest {
|
|
14
14
|
id: string;
|
|
@@ -26,6 +26,15 @@ export interface CreateUserResponse {
|
|
|
26
26
|
ok: boolean;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
export interface PatchUserRequest {
|
|
30
|
+
userId: string;
|
|
31
|
+
name?: string | undefined;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface PatchUserResponse {
|
|
35
|
+
ok: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
29
38
|
export interface User {
|
|
30
39
|
id: string;
|
|
31
40
|
name?: string | undefined;
|
|
@@ -34,12 +43,14 @@ export interface User {
|
|
|
34
43
|
avatar?: string | undefined;
|
|
35
44
|
}
|
|
36
45
|
|
|
37
|
-
export const
|
|
46
|
+
export const USER_V1_PACKAGE_NAME = "user.v1";
|
|
38
47
|
|
|
39
48
|
export interface UsersServiceClient {
|
|
40
49
|
getMe(request: GetMeRequest): Observable<GetMeResponse>;
|
|
41
50
|
|
|
42
51
|
createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
|
|
52
|
+
|
|
53
|
+
patchUser(request: PatchUserRequest): Observable<PatchUserResponse>;
|
|
43
54
|
}
|
|
44
55
|
|
|
45
56
|
export interface UsersServiceController {
|
|
@@ -48,11 +59,13 @@ export interface UsersServiceController {
|
|
|
48
59
|
createUser(
|
|
49
60
|
request: CreateUserRequest,
|
|
50
61
|
): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
|
|
62
|
+
|
|
63
|
+
patchUser(request: PatchUserRequest): Promise<PatchUserResponse> | Observable<PatchUserResponse> | PatchUserResponse;
|
|
51
64
|
}
|
|
52
65
|
|
|
53
66
|
export function UsersServiceControllerMethods() {
|
|
54
67
|
return function (constructor: Function) {
|
|
55
|
-
const grpcMethods: string[] = ["getMe", "createUser"];
|
|
68
|
+
const grpcMethods: string[] = ["getMe", "createUser", "patchUser"];
|
|
56
69
|
for (const method of grpcMethods) {
|
|
57
70
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
58
71
|
GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/user.proto
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
syntax = "proto3";
|
|
2
2
|
|
|
3
|
-
package
|
|
3
|
+
package user.v1;
|
|
4
4
|
|
|
5
5
|
service UsersService {
|
|
6
6
|
rpc GetMe (GetMeRequest) returns (GetMeResponse);
|
|
7
7
|
|
|
8
8
|
rpc CreateUser (CreateUserRequest) returns (CreateUserResponse);
|
|
9
|
+
rpc PatchUser (PatchUserRequest) returns (PatchUserResponse);
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
message GetMeRequest {
|
|
@@ -24,6 +25,16 @@ message CreateUserResponse {
|
|
|
24
25
|
bool ok = 1;
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
message PatchUserRequest {
|
|
29
|
+
string user_id = 1;
|
|
30
|
+
|
|
31
|
+
optional string name = 2;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
message PatchUserResponse {
|
|
35
|
+
bool ok = 1;
|
|
36
|
+
}
|
|
37
|
+
|
|
27
38
|
message User {
|
|
28
39
|
string id = 1;
|
|
29
40
|
optional string name = 2;
|