@teacinemak/contracts 1.1.3 → 1.1.5

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 CHANGED
@@ -16,7 +16,7 @@ export interface GetMeRequest {
16
16
  id: string;
17
17
  }
18
18
 
19
- export interface GetMeReasponse {
19
+ export interface GetMeResponse {
20
20
  user: User | undefined;
21
21
  }
22
22
 
@@ -28,6 +28,15 @@ export interface CreateUserResponse {
28
28
  ok: boolean;
29
29
  }
30
30
 
31
+ export interface PatchUserRequest {
32
+ userId: string;
33
+ name?: string | undefined;
34
+ }
35
+
36
+ export interface PatchUserResponse {
37
+ ok: boolean;
38
+ }
39
+
31
40
  export interface User {
32
41
  id: string;
33
42
  name?: string | undefined;
@@ -38,35 +47,39 @@ export interface User {
38
47
 
39
48
  export const USERS_V1_PACKAGE_NAME = "users.v1";
40
49
 
41
- export interface UserServiceClient {
42
- getMe(request: GetMeRequest): Observable<GetMeReasponse>;
50
+ export interface UsersServiceClient {
51
+ getMe(request: GetMeRequest): Observable<GetMeResponse>;
43
52
 
44
53
  createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
54
+
55
+ patchUser(request: PatchUserRequest): Observable<PatchUserResponse>;
45
56
  }
46
57
 
47
- export interface UserServiceController {
48
- getMe(request: GetMeRequest): Promise<GetMeReasponse> | Observable<GetMeReasponse> | GetMeReasponse;
58
+ export interface UsersServiceController {
59
+ getMe(request: GetMeRequest): Promise<GetMeResponse> | Observable<GetMeResponse> | GetMeResponse;
49
60
 
50
61
  createUser(
51
62
  request: CreateUserRequest,
52
63
  ): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
64
+
65
+ patchUser(request: PatchUserRequest): Promise<PatchUserResponse> | Observable<PatchUserResponse> | PatchUserResponse;
53
66
  }
54
67
 
55
- export function UserServiceControllerMethods() {
68
+ export function UsersServiceControllerMethods() {
56
69
  return function (constructor: Function) {
57
- const grpcMethods: string[] = ["getMe", "createUser"];
70
+ const grpcMethods: string[] = ["getMe", "createUser", "patchUser"];
58
71
  for (const method of grpcMethods) {
59
72
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
60
- GrpcMethod("UserService", method)(constructor.prototype[method], method, descriptor);
73
+ GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
61
74
  Object.defineProperty(constructor.prototype, method, descriptor);
62
75
  }
63
76
  const grpcStreamMethods: string[] = [];
64
77
  for (const method of grpcStreamMethods) {
65
78
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
66
- GrpcStreamMethod("UserService", method)(constructor.prototype[method], method, descriptor);
79
+ GrpcStreamMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
67
80
  Object.defineProperty(constructor.prototype, method, descriptor);
68
81
  }
69
82
  };
70
83
  }
71
84
 
72
- export const USER_SERVICE_NAME = "UserService";
85
+ export const USERS_SERVICE_NAME = "UsersService";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teacinemak/contracts",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/users.proto CHANGED
@@ -2,17 +2,18 @@ syntax = 'proto3';
2
2
 
3
3
  package users.v1;
4
4
 
5
- service UserService {
6
- rpc GetMe (GetMeRequest) returns (GetMeReasponse);
5
+ service UsersService {
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 {
12
13
  string id = 1;
13
14
  }
14
15
 
15
- message GetMeReasponse {
16
+ message GetMeResponse {
16
17
  User user = 1;
17
18
  }
18
19
 
@@ -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;