@neo-tickets/contracts 1.7.0 → 1.8.0

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
@@ -24,6 +24,15 @@ export interface CreateUserResponse {
24
24
  ok: boolean;
25
25
  }
26
26
 
27
+ export interface PatchUserRequest {
28
+ userId: string;
29
+ name?: string | undefined;
30
+ }
31
+
32
+ export interface PatchUserResponse {
33
+ ok: boolean;
34
+ }
35
+
27
36
  export interface User {
28
37
  id: string;
29
38
  name?: string | undefined;
@@ -32,35 +41,39 @@ export interface User {
32
41
  avatar?: string | undefined;
33
42
  }
34
43
 
35
- export interface UsersServuceClient {
44
+ export interface UsersServiceClient {
36
45
  getMe(request: GetMeRequest): Observable<GetMeResponse>;
37
46
 
38
47
  createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
48
+
49
+ patchUser(request: PatchUserRequest): Observable<PatchUserResponse>;
39
50
  }
40
51
 
41
- export interface UsersServuceController {
52
+ export interface UsersServiceController {
42
53
  getMe(request: GetMeRequest): Promise<GetMeResponse> | Observable<GetMeResponse> | GetMeResponse;
43
54
 
44
55
  createUser(
45
56
  request: CreateUserRequest,
46
57
  ): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
58
+
59
+ patchUser(request: PatchUserRequest): Promise<PatchUserResponse> | Observable<PatchUserResponse> | PatchUserResponse;
47
60
  }
48
61
 
49
- export function UsersServuceControllerMethods() {
62
+ export function UsersServiceControllerMethods() {
50
63
  return function (constructor: Function) {
51
- const grpcMethods: string[] = ["getMe", "createUser"];
64
+ const grpcMethods: string[] = ["getMe", "createUser", "patchUser"];
52
65
  for (const method of grpcMethods) {
53
66
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
54
- GrpcMethod("UsersServuce", method)(constructor.prototype[method], method, descriptor);
67
+ GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
55
68
  Object.defineProperty(constructor.prototype, method, descriptor);
56
69
  }
57
70
  const grpcStreamMethods: string[] = [];
58
71
  for (const method of grpcStreamMethods) {
59
72
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
60
- GrpcStreamMethod("UsersServuce", method)(constructor.prototype[method], method, descriptor);
73
+ GrpcStreamMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
61
74
  Object.defineProperty(constructor.prototype, method, descriptor);
62
75
  }
63
76
  };
64
77
  }
65
78
 
66
- export const USERS_SERVUCE_SERVICE_NAME = "UsersServuce";
79
+ export const USERS_SERVICE_NAME = "UsersService";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neo-tickets/contracts",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
package/proto/users.proto CHANGED
@@ -2,10 +2,12 @@ syntax = "proto3";
2
2
 
3
3
  package users.v1;
4
4
 
5
- service UsersServuce {
5
+ service UsersService {
6
6
  rpc GetMe(GetMeRequest) returns (GetMeResponse) {}
7
7
 
8
8
  rpc CreateUser(CreateUserRequest) returns (CreateUserResponse);
9
+
10
+ rpc PatchUser(PatchUserRequest) returns (PatchUserResponse);
9
11
  }
10
12
 
11
13
  message GetMeRequest {
@@ -23,6 +25,16 @@ message CreateUserResponse {
23
25
  bool ok = 1;
24
26
  }
25
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
+
26
38
  message User {
27
39
  string id = 1;
28
40
  optional string name = 2;