@barumetric/contracts 1.4.21 → 1.4.23

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.
@@ -31,7 +31,8 @@ export interface GetCategoryRequest {
31
31
  }
32
32
 
33
33
  export interface GetCategoryAttributesRequest {
34
- id: string;
34
+ categoryId: string;
35
+ visibleInForm?: boolean | undefined;
35
36
  }
36
37
 
37
38
  export interface GetAllCategoriesResponse {
@@ -72,7 +73,7 @@ export interface CategoryAttribute {
72
73
  type: AttributeType;
73
74
  isRequired: boolean;
74
75
  isFilterable: boolean;
75
- inherited: boolean;
76
+ isVisibleInForm: boolean;
76
77
  unit?: string | undefined;
77
78
  minValue?: number | undefined;
78
79
  maxValue?: number | undefined;
@@ -150,8 +151,6 @@ export interface Attribute {
150
151
  name: string;
151
152
  key: string;
152
153
  type: AttributeType;
153
- defaultIsRequired: boolean;
154
- defaultIsFilterable: boolean;
155
154
  unit?: string | undefined;
156
155
  minValue?: number | undefined;
157
156
  maxValue?: number | undefined;
@@ -162,8 +161,6 @@ export interface CreateAttributeRequest {
162
161
  name: string;
163
162
  key: string;
164
163
  type: AttributeType;
165
- defaultIsRequired: boolean;
166
- defaultIsFilterable: boolean;
167
164
  unit?: string | undefined;
168
165
  minValue?: number | undefined;
169
166
  maxValue?: number | undefined;
@@ -180,8 +177,6 @@ export interface UpdateAttributeRequest {
180
177
  name?: string | undefined;
181
178
  key?: string | undefined;
182
179
  type?: AttributeType | undefined;
183
- defaultIsRequired?: boolean | undefined;
184
- defaultIsFilterable?: boolean | undefined;
185
180
  unit?: string | undefined;
186
181
  minValue?: number | undefined;
187
182
  maxValue?: number | undefined;
@@ -206,6 +201,7 @@ export interface AssignAttributeToCategoryRequest {
206
201
  attributeId: string;
207
202
  isRequired?: boolean | undefined;
208
203
  isFilterable?: boolean | undefined;
204
+ isVisibleInForm?: boolean | undefined;
209
205
  sortOrder?: number | undefined;
210
206
  }
211
207
 
@@ -6,9 +6,8 @@
6
6
 
7
7
  /* eslint-disable */
8
8
  import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
- import { wrappers } from "protobufjs";
10
9
  import { Observable } from "rxjs";
11
- import { Struct } from "./google/protobuf/struct";
10
+ import { Timestamp } from "./google/protobuf/timestamp";
12
11
 
13
12
  export const protobufPackage = "listings.v1";
14
13
 
@@ -44,9 +43,10 @@ export interface CreateListingRequest {
44
43
  categoryId: string;
45
44
  latitude?: number | undefined;
46
45
  longitude?: number | undefined;
46
+ address?: string | undefined;
47
47
  videoUrl?: string | undefined;
48
48
  status?: string | undefined;
49
- attributes?: { [key: string]: any } | undefined;
49
+ attributes: AttributeValue[];
50
50
  }
51
51
 
52
52
  export interface CreateListingResponse {
@@ -62,9 +62,10 @@ export interface UpdateListingRequest {
62
62
  categoryId: string;
63
63
  latitude?: number | undefined;
64
64
  longitude?: number | undefined;
65
+ address?: string | undefined;
65
66
  videoUrl?: string | undefined;
66
67
  status?: string | undefined;
67
- attributes?: { [key: string]: any } | undefined;
68
+ attributes: AttributeValue[];
68
69
  }
69
70
 
70
71
  export interface UpdateListingResponse {
@@ -120,22 +121,36 @@ export interface Listing {
120
121
  userId: string;
121
122
  latitude?: number | undefined;
122
123
  longitude?: number | undefined;
124
+ address?: string | undefined;
123
125
  videoUrl?: string | undefined;
124
126
  status: ListingStatus;
125
127
  viewsCount: number;
126
128
  favoritesCount: number;
127
129
  imagesCount: number;
128
130
  /** JSON строка */
129
- attributes: string;
131
+ attributes: AttributeValue[];
130
132
  createdAt: string;
131
133
  updatedAt: string;
132
134
  publishedAt?: string | undefined;
133
135
  deletedAt?: string | undefined;
134
136
  }
135
137
 
136
- export const LISTINGS_V1_PACKAGE_NAME = "listings.v1";
138
+ export interface AttributeValue {
139
+ attributeId: string;
140
+ enumValueId?: string | undefined;
141
+ enumValueIds: string[];
142
+ stringValue?: string | undefined;
143
+ stringValues: string[];
144
+ textValue?: string | undefined;
145
+ integerValue?: number | undefined;
146
+ floatValue?: number | undefined;
147
+ booleanValue?: boolean | undefined;
148
+ dateValue?: Timestamp | undefined;
149
+ rangeMin?: number | undefined;
150
+ rangeMax?: number | undefined;
151
+ }
137
152
 
138
- wrappers[".google.protobuf.Struct"] = { fromObject: Struct.wrap, toObject: Struct.unwrap } as any;
153
+ export const LISTINGS_V1_PACKAGE_NAME = "listings.v1";
139
154
 
140
155
  export interface ListingsServiceClient {
141
156
  getListing(request: GetListingRequest): Observable<GetListingResponse>;
@@ -60,6 +60,19 @@ export interface IsUserOnlineResponse {
60
60
  isOnline: boolean;
61
61
  }
62
62
 
63
+ export interface GetUsersOnlineStatusRequest {
64
+ userIds: string[];
65
+ }
66
+
67
+ export interface GetUsersOnlineStatusResponse {
68
+ statuses: UserOnlineStatus[];
69
+ }
70
+
71
+ export interface UserOnlineStatus {
72
+ userId: string;
73
+ isOnline: boolean;
74
+ }
75
+
63
76
  export const PRESENCE_V1_PACKAGE_NAME = "presence.v1";
64
77
 
65
78
  export interface PresenceServiceClient {
@@ -74,6 +87,8 @@ export interface PresenceServiceClient {
74
87
  getUserBySocket(request: GetUserBySocketRequest): Observable<GetUserBySocketResponse>;
75
88
 
76
89
  isUserOnline(request: IsUserOnlineRequest): Observable<IsUserOnlineResponse>;
90
+
91
+ getUsersOnlineStatus(request: GetUsersOnlineStatusRequest): Observable<GetUsersOnlineStatusResponse>;
77
92
  }
78
93
 
79
94
  export interface PresenceServiceController {
@@ -100,6 +115,10 @@ export interface PresenceServiceController {
100
115
  isUserOnline(
101
116
  request: IsUserOnlineRequest,
102
117
  ): Promise<IsUserOnlineResponse> | Observable<IsUserOnlineResponse> | IsUserOnlineResponse;
118
+
119
+ getUsersOnlineStatus(
120
+ request: GetUsersOnlineStatusRequest,
121
+ ): Promise<GetUsersOnlineStatusResponse> | Observable<GetUsersOnlineStatusResponse> | GetUsersOnlineStatusResponse;
103
122
  }
104
123
 
105
124
  export function PresenceServiceControllerMethods() {
@@ -111,6 +130,7 @@ export function PresenceServiceControllerMethods() {
111
130
  "removeUserSocket",
112
131
  "getUserBySocket",
113
132
  "isUserOnline",
133
+ "getUsersOnlineStatus",
114
134
  ];
115
135
  for (const method of grpcMethods) {
116
136
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/gen/ts/users.ts CHANGED
@@ -120,6 +120,8 @@ export interface UserLite {
120
120
  /** Базовые поля */
121
121
  name?: string | undefined;
122
122
  avatar?: string | undefined;
123
+ reviewsCount: number;
124
+ averageRating: number;
123
125
  }
124
126
 
125
127
  export interface User {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barumetric/contracts",
3
- "version": "1.4.21",
3
+ "version": "1.4.23",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -7,6 +7,7 @@ import "google/protobuf/empty.proto";
7
7
  service CategoriesService {
8
8
  rpc GetAllCategories (google.protobuf.Empty) returns (GetAllCategoriesResponse);
9
9
  rpc GetCategory (GetCategoryRequest) returns (GetCategoryResponse);
10
+ rpc GetCategoryBySlug (GetCategoryBySlugRequest) returns (GetCategoryBySlugResponse);
10
11
  rpc GetCategoryAttributes (GetCategoryAttributesRequest) returns (GetCategoryAttributesResponse);
11
12
 
12
13
  rpc CreateCategory (CreateCategoryRequest) returns (CreateCategoryResponse);
@@ -30,8 +31,14 @@ message GetCategoryRequest {
30
31
  bool include_attributes = 2;
31
32
  }
32
33
 
34
+ message GetCategoryBySlugRequest {
35
+ string slug = 1;
36
+ bool include_attributes = 2;
37
+ }
38
+
33
39
  message GetCategoryAttributesRequest {
34
- string id = 1;
40
+ string category_id = 1;
41
+ optional bool visible_in_form = 2;
35
42
  }
36
43
 
37
44
  message GetAllCategoriesResponse {
@@ -42,6 +49,10 @@ message GetCategoryResponse {
42
49
  Category category = 1;
43
50
  }
44
51
 
52
+ message GetCategoryBySlugResponse {
53
+ Category category = 1;
54
+ }
55
+
45
56
  message GetCategoryAttributesResponse {
46
57
  repeated CategoryAttribute attributes = 1;
47
58
  }
@@ -72,7 +83,7 @@ message CategoryAttribute {
72
83
  AttributeType type = 5;
73
84
  bool is_required = 6;
74
85
  bool is_filterable = 7;
75
- bool inherited = 8;
86
+ bool is_visible_in_form = 8;
76
87
  optional string unit = 9;
77
88
  optional float min_value = 10;
78
89
  optional float max_value = 11;
@@ -163,24 +174,20 @@ message Attribute {
163
174
  string name = 2;
164
175
  string key = 3;
165
176
  AttributeType type = 4;
166
- bool default_is_required = 5;
167
- bool default_is_filterable = 6;
168
- optional string unit = 7;
169
- optional float min_value = 8;
170
- optional float max_value = 9;
171
- repeated EnumValue enum_values = 10;
177
+ optional string unit = 5;
178
+ optional float min_value = 6;
179
+ optional float max_value = 7;
180
+ repeated EnumValue enum_values = 8;
172
181
  }
173
182
 
174
183
  message CreateAttributeRequest {
175
184
  string name = 1;
176
185
  string key = 2;
177
186
  AttributeType type = 3;
178
- bool default_is_required = 4;
179
- bool default_is_filterable = 5;
180
- optional string unit = 6;
181
- optional float min_value = 7;
182
- optional float max_value = 8;
183
- repeated EnumValueInput enum_values = 9;
187
+ optional string unit = 4;
188
+ optional float min_value = 5;
189
+ optional float max_value = 6;
190
+ repeated EnumValueInput enum_values = 7;
184
191
  }
185
192
 
186
193
  message CreateAttributeResponse {
@@ -193,12 +200,10 @@ message UpdateAttributeRequest {
193
200
  optional string name = 2;
194
201
  optional string key = 3;
195
202
  optional AttributeType type = 4;
196
- optional bool default_is_required = 5;
197
- optional bool default_is_filterable = 6;
198
- optional string unit = 7;
199
- optional float min_value = 8;
200
- optional float max_value = 9;
201
- repeated EnumValueInput enum_values = 10;
203
+ optional string unit = 5;
204
+ optional float min_value = 6;
205
+ optional float max_value = 7;
206
+ repeated EnumValueInput enum_values = 8;
202
207
  }
203
208
 
204
209
  message UpdateAttributeResponse {
@@ -219,7 +224,8 @@ message AssignAttributeToCategoryRequest {
219
224
  string attribute_id = 2;
220
225
  optional bool is_required = 3;
221
226
  optional bool is_filterable = 4;
222
- optional int32 sort_order = 5;
227
+ optional bool is_visible_in_form = 5;
228
+ optional int32 sort_order = 6;
223
229
  }
224
230
 
225
231
  message AssignAttributeToCategoryResponse {
@@ -2,8 +2,7 @@ syntax = "proto3";
2
2
 
3
3
  package listings.v1;
4
4
 
5
- import "google/protobuf/empty.proto";
6
- import "google/protobuf/struct.proto";
5
+ import "google/protobuf/timestamp.proto";
7
6
 
8
7
  service ListingsService {
9
8
  rpc GetListing (GetListingRequest) returns (GetListingResponse);
@@ -23,9 +22,10 @@ message CreateListingRequest {
23
22
  string category_id = 5;
24
23
  optional float latitude = 6;
25
24
  optional float longitude = 7;
26
- optional string video_url = 8;
27
- optional string status = 9;
28
- optional google.protobuf.Struct attributes = 10;
25
+ optional string address = 8;
26
+ optional string video_url = 9;
27
+ optional string status = 10;
28
+ repeated AttributeValue attributes = 11;
29
29
  }
30
30
 
31
31
  message CreateListingResponse {
@@ -41,9 +41,10 @@ message UpdateListingRequest {
41
41
  string category_id = 6;
42
42
  optional float latitude = 7;
43
43
  optional float longitude = 8;
44
- optional string video_url = 9;
45
- optional string status = 10;
46
- optional google.protobuf.Struct attributes = 11;
44
+ optional string address = 9;
45
+ optional string video_url = 10;
46
+ optional string status = 11;
47
+ repeated AttributeValue attributes = 12;
47
48
  }
48
49
 
49
50
  message UpdateListingResponse {
@@ -99,16 +100,32 @@ message Listing {
99
100
  string user_id = 6;
100
101
  optional float latitude = 7;
101
102
  optional float longitude = 8;
102
- optional string video_url = 9;
103
- ListingStatus status = 10;
104
- int64 views_count = 11;
105
- int64 favorites_count = 12;
106
- int32 images_count = 13;
107
- string attributes = 14; // JSON строка
108
- string created_at = 15;
109
- string updated_at = 16;
110
- optional string published_at = 17;
111
- optional string deleted_at = 18;
103
+ optional string address = 9;
104
+ optional string video_url = 10;
105
+ ListingStatus status = 11;
106
+ int64 views_count = 12;
107
+ int64 favorites_count = 13;
108
+ int32 images_count = 14;
109
+ repeated AttributeValue attributes = 15;
110
+ string created_at = 16;
111
+ string updated_at = 17;
112
+ optional string published_at = 18;
113
+ optional string deleted_at = 19;
114
+ }
115
+
116
+ message AttributeValue {
117
+ string attribute_id = 1;
118
+ optional string enum_value_id = 2;
119
+ repeated string enum_value_ids = 3;
120
+ optional string string_value = 4;
121
+ repeated string string_values = 5;
122
+ optional string text_value = 6;
123
+ optional int32 integer_value = 7;
124
+ optional float float_value = 8;
125
+ optional bool boolean_value = 9;
126
+ optional google.protobuf.Timestamp date_value = 10;
127
+ optional float range_min = 11;
128
+ optional float range_max = 12;
112
129
  }
113
130
 
114
131
  // Статусы объявлений
@@ -2,8 +2,6 @@ syntax = "proto3";
2
2
 
3
3
  package presence.v1;
4
4
 
5
- import "google/protobuf/timestamp.proto";
6
-
7
5
  service PresenceService {
8
6
  rpc SetUserSocket (SetUserSocketRequest) returns (SetUserSocketResponse);
9
7
  rpc GetUserSocket (GetUserSocketRequest) returns (GetUserSocketResponse);
@@ -11,6 +9,7 @@ service PresenceService {
11
9
  rpc RemoveUserSocket (RemoveUserSocketRequest) returns (RemoveUserSocketResponse);
12
10
  rpc GetUserBySocket (GetUserBySocketRequest) returns (GetUserBySocketResponse);
13
11
  rpc IsUserOnline (IsUserOnlineRequest) returns (IsUserOnlineResponse);
12
+ rpc GetUsersOnlineStatus (GetUsersOnlineStatusRequest) returns (GetUsersOnlineStatusResponse);
14
13
 
15
14
  }
16
15
 
@@ -62,4 +61,17 @@ message IsUserOnlineRequest {
62
61
 
63
62
  message IsUserOnlineResponse {
64
63
  bool is_online = 1;
65
- }
64
+ }
65
+
66
+ message GetUsersOnlineStatusRequest {
67
+ repeated string user_ids = 1;
68
+ }
69
+
70
+ message GetUsersOnlineStatusResponse {
71
+ repeated UserOnlineStatus statuses = 1;
72
+ }
73
+
74
+ message UserOnlineStatus {
75
+ string user_id = 1;
76
+ bool is_online = 2;
77
+ }
package/proto/users.proto CHANGED
@@ -84,6 +84,9 @@ message UserLite {
84
84
  // Базовые поля
85
85
  optional string name = 2;
86
86
  optional string avatar = 3;
87
+
88
+ int32 reviews_count = 4;
89
+ float average_rating = 5;
87
90
  }
88
91
 
89
92
  message User {