@mamindom/contracts 1.0.12 → 1.0.14

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.
@@ -2,4 +2,5 @@ export declare const PROTO_PATHS: {
2
2
  readonly AUTH: string;
3
3
  readonly ACCOUNT: string;
4
4
  readonly USERS: string;
5
+ readonly CATEGORIES: string;
5
6
  };
@@ -5,5 +5,6 @@ const node_path_1 = require("node:path");
5
5
  exports.PROTO_PATHS = {
6
6
  AUTH: (0, node_path_1.join)(__dirname, '../../proto/auth.proto'),
7
7
  ACCOUNT: (0, node_path_1.join)(__dirname, '../../proto/account.proto'),
8
- USERS: (0, node_path_1.join)(__dirname, '../../proto/users.proto')
8
+ USERS: (0, node_path_1.join)(__dirname, '../../proto/users.proto'),
9
+ CATEGORIES: (0, node_path_1.join)(__dirname, '../../proto/categories.proto')
9
10
  };
@@ -0,0 +1,35 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.4
4
+ // protoc v3.21.12
5
+ // source: categorie.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+
10
+ export const protobufPackage = "categories.v1";
11
+
12
+ export const CATEGORIES_V1_PACKAGE_NAME = "categories.v1";
13
+
14
+ export interface CategoriesServiceClient {
15
+ }
16
+
17
+ export interface CategoriesServiceController {
18
+ }
19
+
20
+ export function CategoriesServiceControllerMethods() {
21
+ return function (constructor: Function) {
22
+ const grpcMethods: string[] = [];
23
+ for (const method of grpcMethods) {
24
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
25
+ GrpcMethod("CategoriesService", method)(constructor.prototype[method], method, descriptor);
26
+ }
27
+ const grpcStreamMethods: string[] = [];
28
+ for (const method of grpcStreamMethods) {
29
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
30
+ GrpcStreamMethod("CategoriesService", method)(constructor.prototype[method], method, descriptor);
31
+ }
32
+ };
33
+ }
34
+
35
+ export const CATEGORIES_SERVICE_NAME = "CategoriesService";
package/gen/users.ts CHANGED
@@ -20,12 +20,26 @@ export interface GetMeResponse {
20
20
 
21
21
  export interface CreateUserRequest {
22
22
  id: string;
23
+ firstName?: string | undefined;
24
+ lastName?: string | undefined;
25
+ email?: string | undefined;
26
+ phone?: string | undefined;
23
27
  }
24
28
 
25
29
  export interface CreateUserResponse {
26
30
  ok: boolean;
27
31
  }
28
32
 
33
+ export interface UpdateUserRequest {
34
+ id: string;
35
+ firstName?: string | undefined;
36
+ lastName?: string | undefined;
37
+ }
38
+
39
+ export interface UpdateUserResponse {
40
+ user: User | undefined;
41
+ }
42
+
29
43
  export interface User {
30
44
  id: string;
31
45
  firstName: string;
@@ -37,33 +51,39 @@ export interface User {
37
51
 
38
52
  export const USERS_V1_PACKAGE_NAME = "users.v1";
39
53
 
40
- export interface UsersServicesClient {
54
+ export interface UsersServiceClient {
41
55
  getMe(request: GetMeRequest): Observable<GetMeResponse>;
42
56
 
43
57
  createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
58
+
59
+ updateUser(request: UpdateUserRequest): Observable<UpdateUserResponse>;
44
60
  }
45
61
 
46
- export interface UsersServicesController {
62
+ export interface UsersServiceController {
47
63
  getMe(request: GetMeRequest): Promise<GetMeResponse> | Observable<GetMeResponse> | GetMeResponse;
48
64
 
49
65
  createUser(
50
66
  request: CreateUserRequest,
51
67
  ): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
68
+
69
+ updateUser(
70
+ request: UpdateUserRequest,
71
+ ): Promise<UpdateUserResponse> | Observable<UpdateUserResponse> | UpdateUserResponse;
52
72
  }
53
73
 
54
- export function UsersServicesControllerMethods() {
74
+ export function UsersServiceControllerMethods() {
55
75
  return function (constructor: Function) {
56
- const grpcMethods: string[] = ["getMe", "createUser"];
76
+ const grpcMethods: string[] = ["getMe", "createUser", "updateUser"];
57
77
  for (const method of grpcMethods) {
58
78
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
59
- GrpcMethod("UsersServices", method)(constructor.prototype[method], method, descriptor);
79
+ GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
60
80
  }
61
81
  const grpcStreamMethods: string[] = [];
62
82
  for (const method of grpcStreamMethods) {
63
83
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
64
- GrpcStreamMethod("UsersServices", method)(constructor.prototype[method], method, descriptor);
84
+ GrpcStreamMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
65
85
  }
66
86
  };
67
87
  }
68
88
 
69
- export const USERS_SERVICES_SERVICE_NAME = "UsersServices";
89
+ export const USERS_SERVICE_NAME = "UsersService";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mamindom/contracts",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "proto",
5
5
  "main": "./dist/index.js",
6
6
  "type": "./dist/index.d.ts",
@@ -0,0 +1,7 @@
1
+ syntax = "proto3";
2
+
3
+ package categories.v1;
4
+
5
+ service CategoriesService {
6
+
7
+ }
package/proto/users.proto CHANGED
@@ -2,33 +2,47 @@ syntax = "proto3";
2
2
 
3
3
  package users.v1;
4
4
 
5
- service UsersServices {
6
- rpc GetMe(GetMeRequest) returns (GetMeResponse);
7
-
8
- rpc CreateUser(CreateUserRequest) returns (CreateUserResponse);
5
+ service UsersService {
6
+ rpc GetMe(GetMeRequest) returns (GetMeResponse);
7
+ rpc CreateUser(CreateUserRequest) returns (CreateUserResponse);
8
+ rpc UpdateUser(UpdateUserRequest) returns (UpdateUserResponse);
9
9
  }
10
10
 
11
11
  message GetMeRequest {
12
- string id = 1;
12
+ string id = 1;
13
13
  }
14
14
 
15
15
  message GetMeResponse {
16
- User user = 1;
16
+ User user = 1;
17
17
  }
18
18
 
19
19
  message CreateUserRequest {
20
- string id = 1;
20
+ string id = 1;
21
+ optional string first_name = 2;
22
+ optional string last_name = 3;
23
+ optional string email = 4;
24
+ optional string phone = 5;
21
25
  }
22
26
 
23
27
  message CreateUserResponse {
24
- bool ok = 1;
28
+ bool ok = 1;
29
+ }
30
+
31
+ message UpdateUserRequest {
32
+ string id = 1;
33
+ optional string first_name = 2;
34
+ optional string last_name = 3;
35
+ }
36
+
37
+ message UpdateUserResponse {
38
+ User user = 1;
25
39
  }
26
40
 
27
41
  message User {
28
- string id = 1;
29
- string first_name = 2;
30
- string last_name = 3;
31
- int32 bonuses = 4;
32
- optional string email = 5;
33
- optional string phone = 6;
42
+ string id = 1;
43
+ string first_name = 2;
44
+ string last_name = 3;
45
+ int32 bonuses = 4;
46
+ optional string email = 5;
47
+ optional string phone = 6;
34
48
  }