@vsniksnet/contracts 1.2.21 → 1.3.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.
@@ -2,5 +2,6 @@ export declare const PROTO_PATHS: {
2
2
  readonly AUTH: string;
3
3
  readonly ACCOUNT: string;
4
4
  readonly USERS: string;
5
+ readonly FRIENDS: string;
5
6
  readonly MEDIA: string;
6
7
  };
@@ -6,5 +6,6 @@ exports.PROTO_PATHS = {
6
6
  AUTH: (0, path_1.join)(__dirname, '../../proto/auth.proto'),
7
7
  ACCOUNT: (0, path_1.join)(__dirname, '../../proto/account.proto'),
8
8
  USERS: (0, path_1.join)(__dirname, '../../proto/users.proto'),
9
+ FRIENDS: (0, path_1.join)(__dirname, '../../proto/friends.proto'),
9
10
  MEDIA: (0, path_1.join)(__dirname, '../../proto/media.proto'),
10
11
  };
package/gen/friends.ts ADDED
@@ -0,0 +1,159 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.4
4
+ // protoc v6.33.1
5
+ // source: friends.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "friends.v1";
12
+
13
+ /** Create request */
14
+ export interface CreateInvitionRequest {
15
+ userId: string;
16
+ currentId: string;
17
+ }
18
+
19
+ export interface CreateInvitionResponse {
20
+ profile: Profile | undefined;
21
+ }
22
+
23
+ /** Accept request */
24
+ export interface AcceptInvitionRequest {
25
+ userId: string;
26
+ currentId: string;
27
+ }
28
+
29
+ export interface AcceptInvitionResponse {
30
+ profile: Profile | undefined;
31
+ }
32
+
33
+ /** Reject request */
34
+ export interface RejectInvitionRequest {
35
+ userId: string;
36
+ currentId: string;
37
+ }
38
+
39
+ export interface RejectInvitionResponse {
40
+ profile: Profile | undefined;
41
+ }
42
+
43
+ /** List requests */
44
+ export interface ListRequestedRequest {
45
+ currentId: string;
46
+ }
47
+
48
+ export interface ListRequestedResponse {
49
+ profile: Profile[];
50
+ }
51
+
52
+ /** List accepted */
53
+ export interface ListAcceptedRequest {
54
+ currentId: string;
55
+ }
56
+
57
+ export interface ListAcceptedResponse {
58
+ profile: Profile[];
59
+ }
60
+
61
+ export interface Profile {
62
+ id: string;
63
+ username: string;
64
+ avatar: string;
65
+ cover: string;
66
+ bio: string;
67
+ gender: string;
68
+ status: string;
69
+ location: string;
70
+ birthDay: string;
71
+ requestsCount?: number | undefined;
72
+ friendsCount?: number | undefined;
73
+ followersCount?: number | undefined;
74
+ followingCount?: number | undefined;
75
+ isFollow?: boolean | undefined;
76
+ }
77
+
78
+ export const FRIENDS_V1_PACKAGE_NAME = "friends.v1";
79
+
80
+ /** Friends requests service */
81
+
82
+ export interface FriendsServiceClient {
83
+ /** Create friend request */
84
+
85
+ createInvition(request: CreateInvitionRequest): Observable<CreateInvitionResponse>;
86
+
87
+ /** Accept friend request */
88
+
89
+ acceptInvition(request: AcceptInvitionRequest): Observable<AcceptInvitionResponse>;
90
+
91
+ /** Reject friend request */
92
+
93
+ rejectInvition(request: RejectInvitionRequest): Observable<RejectInvitionResponse>;
94
+
95
+ /** List requests */
96
+
97
+ listRequested(request: ListRequestedRequest): Observable<ListRequestedResponse>;
98
+
99
+ /** List accepted */
100
+
101
+ listAccepted(request: ListAcceptedRequest): Observable<ListAcceptedResponse>;
102
+ }
103
+
104
+ /** Friends requests service */
105
+
106
+ export interface FriendsServiceController {
107
+ /** Create friend request */
108
+
109
+ createInvition(
110
+ request: CreateInvitionRequest,
111
+ ): Promise<CreateInvitionResponse> | Observable<CreateInvitionResponse> | CreateInvitionResponse;
112
+
113
+ /** Accept friend request */
114
+
115
+ acceptInvition(
116
+ request: AcceptInvitionRequest,
117
+ ): Promise<AcceptInvitionResponse> | Observable<AcceptInvitionResponse> | AcceptInvitionResponse;
118
+
119
+ /** Reject friend request */
120
+
121
+ rejectInvition(
122
+ request: RejectInvitionRequest,
123
+ ): Promise<RejectInvitionResponse> | Observable<RejectInvitionResponse> | RejectInvitionResponse;
124
+
125
+ /** List requests */
126
+
127
+ listRequested(
128
+ request: ListRequestedRequest,
129
+ ): Promise<ListRequestedResponse> | Observable<ListRequestedResponse> | ListRequestedResponse;
130
+
131
+ /** List accepted */
132
+
133
+ listAccepted(
134
+ request: ListAcceptedRequest,
135
+ ): Promise<ListAcceptedResponse> | Observable<ListAcceptedResponse> | ListAcceptedResponse;
136
+ }
137
+
138
+ export function FriendsServiceControllerMethods() {
139
+ return function (constructor: Function) {
140
+ const grpcMethods: string[] = [
141
+ "createInvition",
142
+ "acceptInvition",
143
+ "rejectInvition",
144
+ "listRequested",
145
+ "listAccepted",
146
+ ];
147
+ for (const method of grpcMethods) {
148
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
149
+ GrpcMethod("FriendsService", method)(constructor.prototype[method], method, descriptor);
150
+ }
151
+ const grpcStreamMethods: string[] = [];
152
+ for (const method of grpcStreamMethods) {
153
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
154
+ GrpcStreamMethod("FriendsService", method)(constructor.prototype[method], method, descriptor);
155
+ }
156
+ };
157
+ }
158
+
159
+ export const FRIENDS_SERVICE_NAME = "FriendsService";
package/gen/users.ts CHANGED
@@ -132,8 +132,10 @@ export interface Profile {
132
132
  status: string;
133
133
  location: string;
134
134
  birthDay: string;
135
- followersCount: string;
136
- followingCount: string;
135
+ requestsCount?: number | undefined;
136
+ friendsCount?: number | undefined;
137
+ followersCount?: number | undefined;
138
+ followingCount?: number | undefined;
137
139
  isFollow?: boolean | undefined;
138
140
  }
139
141
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vsniksnet/contracts",
3
- "version": "1.2.21",
3
+ "version": "1.3.0",
4
4
  "description": "Protobuf definitions and generated typescript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -0,0 +1,82 @@
1
+ syntax = "proto3";
2
+
3
+ package friends.v1;
4
+
5
+ /* Friends requests service */
6
+ service FriendsService {
7
+ /* Create friend request */
8
+ rpc CreateInvition (CreateInvitionRequest) returns (CreateInvitionResponse);
9
+ /* Accept friend request */
10
+ rpc AcceptInvition (AcceptInvitionRequest) returns (AcceptInvitionResponse);
11
+ /* Reject friend request */
12
+ rpc RejectInvition (RejectInvitionRequest) returns (RejectInvitionResponse);
13
+ /* List requests */
14
+ rpc ListRequested (ListRequestedRequest) returns (ListRequestedResponse);
15
+ /* List accepted*/
16
+ rpc ListAccepted (ListAcceptedRequest) returns (ListAcceptedResponse);
17
+ }
18
+
19
+ /* Create request */
20
+ message CreateInvitionRequest {
21
+ string user_id = 1;
22
+ string current_id = 2;
23
+ }
24
+
25
+ message CreateInvitionResponse {
26
+ Profile profile = 1;
27
+ }
28
+
29
+ /* Accept request */
30
+ message AcceptInvitionRequest {
31
+ string user_id = 1;
32
+ string current_id = 2;
33
+ }
34
+
35
+ message AcceptInvitionResponse {
36
+ Profile profile = 1;
37
+ }
38
+
39
+ /* Reject request */
40
+ message RejectInvitionRequest {
41
+ string user_id = 1;
42
+ string current_id = 2;
43
+ }
44
+
45
+ message RejectInvitionResponse {
46
+ Profile profile = 1;
47
+ }
48
+
49
+ /* List requests */
50
+ message ListRequestedRequest {
51
+ string current_id = 1;
52
+ }
53
+
54
+ message ListRequestedResponse {
55
+ repeated Profile profile = 1;
56
+ }
57
+
58
+ /* List accepted*/
59
+ message ListAcceptedRequest {
60
+ string current_id = 1;
61
+ }
62
+
63
+ message ListAcceptedResponse {
64
+ repeated Profile profile = 1;
65
+ }
66
+
67
+ message Profile {
68
+ string id = 1;
69
+ string username = 2;
70
+ string avatar = 3;
71
+ string cover = 4;
72
+ string bio = 5;
73
+ string gender = 6;
74
+ string status = 7;
75
+ string location = 8;
76
+ string birth_day = 9;
77
+ optional int32 requests_count = 10;
78
+ optional int32 friends_count = 11;
79
+ optional int32 followers_count = 12;
80
+ optional int32 following_count = 13;
81
+ optional bool is_follow = 14;
82
+ }
package/proto/users.proto CHANGED
@@ -147,7 +147,9 @@ message Profile {
147
147
  string status = 7;
148
148
  string location = 8;
149
149
  string birth_day = 9;
150
- string followers_count = 10;
151
- string following_count = 11;
152
- optional bool is_follow = 12;
150
+ optional int32 requests_count = 10;
151
+ optional int32 friends_count = 11;
152
+ optional int32 followers_count = 12;
153
+ optional int32 following_count = 13;
154
+ optional bool is_follow = 14;
153
155
  }