@aaanton/contracts 1.1.1 → 1.1.3

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
@@ -30,6 +30,17 @@ export interface CreateUserResponse {
30
30
  ok: boolean;
31
31
  }
32
32
 
33
+ /** */
34
+ export interface PatchUserRequest {
35
+ userId: string;
36
+ name?: string | undefined;
37
+ }
38
+
39
+ /** */
40
+ export interface PatchUserResponse {
41
+ ok: boolean;
42
+ }
43
+
33
44
  /** */
34
45
  export interface User {
35
46
  id: string;
@@ -43,7 +54,7 @@ export const USERS_V1_PACKAGE_NAME = "users.v1";
43
54
 
44
55
  /** */
45
56
 
46
- export interface UserServiceClient {
57
+ export interface UsersServiceClient {
47
58
  /** */
48
59
 
49
60
  getMe(request: GetMeRequest): Observable<GetMeResponse>;
@@ -51,11 +62,15 @@ export interface UserServiceClient {
51
62
  /** */
52
63
 
53
64
  createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
65
+
66
+ /** */
67
+
68
+ patchUser(request: PatchUserRequest): Observable<PatchUserResponse>;
54
69
  }
55
70
 
56
71
  /** */
57
72
 
58
- export interface UserServiceController {
73
+ export interface UsersServiceController {
59
74
  /** */
60
75
 
61
76
  getMe(request: GetMeRequest): Promise<GetMeResponse> | Observable<GetMeResponse> | GetMeResponse;
@@ -65,21 +80,25 @@ export interface UserServiceController {
65
80
  createUser(
66
81
  request: CreateUserRequest,
67
82
  ): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
83
+
84
+ /** */
85
+
86
+ patchUser(request: PatchUserRequest): Promise<PatchUserResponse> | Observable<PatchUserResponse> | PatchUserResponse;
68
87
  }
69
88
 
70
- export function UserServiceControllerMethods() {
89
+ export function UsersServiceControllerMethods() {
71
90
  return function (constructor: Function) {
72
- const grpcMethods: string[] = ["getMe", "createUser"];
91
+ const grpcMethods: string[] = ["getMe", "createUser", "patchUser"];
73
92
  for (const method of grpcMethods) {
74
93
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
75
- GrpcMethod("UserService", method)(constructor.prototype[method], method, descriptor);
94
+ GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
76
95
  }
77
96
  const grpcStreamMethods: string[] = [];
78
97
  for (const method of grpcStreamMethods) {
79
98
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
80
- GrpcStreamMethod("UserService", method)(constructor.prototype[method], method, descriptor);
99
+ GrpcStreamMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
81
100
  }
82
101
  };
83
102
  }
84
103
 
85
- export const USER_SERVICE_NAME = "UserService";
104
+ export const USERS_SERVICE_NAME = "UsersService";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aaanton/contracts",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/users.proto CHANGED
@@ -3,12 +3,15 @@ syntax = "proto3";
3
3
  package users.v1;
4
4
 
5
5
  //
6
- service UserService {
6
+ service UsersService {
7
7
  //
8
8
  rpc GetMe (GetMeRequest) returns (GetMeResponse);
9
9
 
10
10
  //
11
11
  rpc CreateUser (CreateUserRequest) returns (CreateUserResponse);
12
+
13
+ //
14
+ rpc PatchUser (PatchUserRequest) returns (PatchUserResponse);
12
15
  }
13
16
 
14
17
  //
@@ -31,6 +34,17 @@ message CreateUserResponse {
31
34
  bool ok = 1;
32
35
  }
33
36
 
37
+ //
38
+ message PatchUserRequest {
39
+ string user_id = 1;
40
+ optional string name = 2;
41
+ }
42
+
43
+ //
44
+ message PatchUserResponse {
45
+ bool ok = 1;
46
+ }
47
+
34
48
  //
35
49
  message User {
36
50
  string id = 1;