@barumetric/contracts 1.2.2 → 1.2.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/ts/categories.ts +24 -1
- package/package.json +1 -1
- package/proto/categories.proto +13 -0
package/gen/ts/categories.ts
CHANGED
|
@@ -32,6 +32,15 @@ export interface GetCategoryRequest {
|
|
|
32
32
|
includeAttributes: boolean;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
export interface GetCategoryAttributesRequest {
|
|
36
|
+
/** ID категории */
|
|
37
|
+
categoryId: string;
|
|
38
|
+
/** Только фильтруемые атрибуты (для фильтров на фронте) */
|
|
39
|
+
onlyFilterable: boolean;
|
|
40
|
+
/** Включить наследуемые атрибуты от родительских категорий */
|
|
41
|
+
includeInherited: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
35
44
|
/** Ответы */
|
|
36
45
|
export interface GetAllCategoriesResponse {
|
|
37
46
|
categories: Category[];
|
|
@@ -41,6 +50,10 @@ export interface GetCategoryResponse {
|
|
|
41
50
|
category: Category | undefined;
|
|
42
51
|
}
|
|
43
52
|
|
|
53
|
+
export interface GetCategoryAttributesResponse {
|
|
54
|
+
attributes: CategoryAttribute[];
|
|
55
|
+
}
|
|
56
|
+
|
|
44
57
|
export interface Category {
|
|
45
58
|
id: string;
|
|
46
59
|
name: string;
|
|
@@ -119,6 +132,10 @@ export interface CategoriesServiceClient {
|
|
|
119
132
|
/** Получить категорию по ID */
|
|
120
133
|
|
|
121
134
|
getCategory(request: GetCategoryRequest): Observable<GetCategoryResponse>;
|
|
135
|
+
|
|
136
|
+
/** Получить атрибуты категории (для фильтрации) */
|
|
137
|
+
|
|
138
|
+
getCategoryAttributes(request: GetCategoryAttributesRequest): Observable<GetCategoryAttributesResponse>;
|
|
122
139
|
}
|
|
123
140
|
|
|
124
141
|
export interface CategoriesServiceController {
|
|
@@ -133,11 +150,17 @@ export interface CategoriesServiceController {
|
|
|
133
150
|
getCategory(
|
|
134
151
|
request: GetCategoryRequest,
|
|
135
152
|
): Promise<GetCategoryResponse> | Observable<GetCategoryResponse> | GetCategoryResponse;
|
|
153
|
+
|
|
154
|
+
/** Получить атрибуты категории (для фильтрации) */
|
|
155
|
+
|
|
156
|
+
getCategoryAttributes(
|
|
157
|
+
request: GetCategoryAttributesRequest,
|
|
158
|
+
): Promise<GetCategoryAttributesResponse> | Observable<GetCategoryAttributesResponse> | GetCategoryAttributesResponse;
|
|
136
159
|
}
|
|
137
160
|
|
|
138
161
|
export function CategoriesServiceControllerMethods() {
|
|
139
162
|
return function (constructor: Function) {
|
|
140
|
-
const grpcMethods: string[] = ["getAllCategories", "getCategory"];
|
|
163
|
+
const grpcMethods: string[] = ["getAllCategories", "getCategory", "getCategoryAttributes"];
|
|
141
164
|
for (const method of grpcMethods) {
|
|
142
165
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
143
166
|
GrpcMethod("CategoriesService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/categories.proto
CHANGED
|
@@ -10,6 +10,9 @@ service CategoriesService {
|
|
|
10
10
|
|
|
11
11
|
// Получить категорию по ID
|
|
12
12
|
rpc GetCategory (GetCategoryRequest) returns (GetCategoryResponse);
|
|
13
|
+
|
|
14
|
+
// Получить атрибуты категории (для фильтрации)
|
|
15
|
+
rpc GetCategoryAttributes (GetCategoryAttributesRequest) returns (GetCategoryAttributesResponse);
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
message GetCategoryRequest {
|
|
@@ -17,6 +20,12 @@ message GetCategoryRequest {
|
|
|
17
20
|
bool include_attributes = 2; // Включить атрибуты
|
|
18
21
|
}
|
|
19
22
|
|
|
23
|
+
message GetCategoryAttributesRequest {
|
|
24
|
+
string category_id = 1; // ID категории
|
|
25
|
+
bool only_filterable = 2; // Только фильтруемые атрибуты (для фильтров на фронте)
|
|
26
|
+
bool include_inherited = 3; // Включить наследуемые атрибуты от родительских категорий
|
|
27
|
+
}
|
|
28
|
+
|
|
20
29
|
// Ответы
|
|
21
30
|
message GetAllCategoriesResponse {
|
|
22
31
|
repeated Category categories = 1;
|
|
@@ -26,6 +35,10 @@ message GetCategoryResponse {
|
|
|
26
35
|
Category category = 1;
|
|
27
36
|
}
|
|
28
37
|
|
|
38
|
+
message GetCategoryAttributesResponse {
|
|
39
|
+
repeated CategoryAttribute attributes = 1;
|
|
40
|
+
}
|
|
41
|
+
|
|
29
42
|
// Модели
|
|
30
43
|
|
|
31
44
|
message Category {
|