@barumetric/contracts 1.2.4 → 1.2.5

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.
@@ -11,7 +11,6 @@ import { Empty } from "./google/protobuf/empty";
11
11
 
12
12
  export const protobufPackage = "categories.v1";
13
13
 
14
- /** Типы атрибутов */
15
14
  export enum AttributeType {
16
15
  ATTRIBUTE_TYPE_UNSPECIFIED = 0,
17
16
  ATTRIBUTE_TYPE_STRING = 1,
@@ -28,16 +27,13 @@ export enum AttributeType {
28
27
 
29
28
  export interface GetCategoryRequest {
30
29
  id: string;
31
- /** Включить атрибуты */
32
30
  includeAttributes: boolean;
33
31
  }
34
32
 
35
33
  export interface GetCategoryAttributesRequest {
36
- /** ID категории */
37
- categoryId: string;
34
+ id: string;
38
35
  }
39
36
 
40
- /** Ответы */
41
37
  export interface GetAllCategoriesResponse {
42
38
  categories: Category[];
43
39
  }
@@ -64,44 +60,23 @@ export interface Category {
64
60
  path: string;
65
61
  depth: number;
66
62
  adsCount: number;
67
- /** Для дерева */
68
63
  children: Category[];
69
- /** Если include_attributes = true */
70
64
  attributes: CategoryAttribute[];
71
65
  }
72
66
 
73
67
  export interface CategoryAttribute {
74
- /** ID CategoryAttribute (связи) */
75
68
  id: string;
76
- /** ID категории */
77
69
  categoryId: string;
78
- /** Название из глобального Attribute */
79
70
  name: string;
80
- /** Ключ из глобального Attribute */
81
71
  key: string;
82
- /** Тип из глобального Attribute */
83
72
  type: AttributeType;
84
- /** Финальное значение (override или default из Attribute) */
85
73
  isRequired: boolean;
86
- /** Финальное значение (override или default из Attribute) */
87
74
  isFilterable: boolean;
88
- /** Наследуется ли дочерним категориям */
89
75
  inherited: boolean;
90
- /** Единица измерения из глобального Attribute */
91
- unit?:
92
- | string
93
- | undefined;
94
- /** Минимальное значение из глобального Attribute */
95
- minValue?:
96
- | number
97
- | undefined;
98
- /** Максимальное значение из глобального Attribute */
99
- maxValue?:
100
- | number
101
- | undefined;
102
- /** Порядок сортировки в категории */
76
+ unit?: string | undefined;
77
+ minValue?: number | undefined;
78
+ maxValue?: number | undefined;
103
79
  sortOrder: number;
104
- /** Значения из глобального Attribute */
105
80
  enumValues: EnumValue[];
106
81
  }
107
82
 
@@ -121,34 +96,22 @@ export interface EnumValueInput {
121
96
  export const CATEGORIES_V1_PACKAGE_NAME = "categories.v1";
122
97
 
123
98
  export interface CategoriesServiceClient {
124
- /** Получить все категории */
125
-
126
99
  getAllCategories(request: Empty): Observable<GetAllCategoriesResponse>;
127
100
 
128
- /** Получить категорию по ID */
129
-
130
101
  getCategory(request: GetCategoryRequest): Observable<GetCategoryResponse>;
131
102
 
132
- /** Получить атрибуты категории (для фильтрации) */
133
-
134
103
  getCategoryAttributes(request: GetCategoryAttributesRequest): Observable<GetCategoryAttributesResponse>;
135
104
  }
136
105
 
137
106
  export interface CategoriesServiceController {
138
- /** Получить все категории */
139
-
140
107
  getAllCategories(
141
108
  request: Empty,
142
109
  ): Promise<GetAllCategoriesResponse> | Observable<GetAllCategoriesResponse> | GetAllCategoriesResponse;
143
110
 
144
- /** Получить категорию по ID */
145
-
146
111
  getCategory(
147
112
  request: GetCategoryRequest,
148
113
  ): Promise<GetCategoryResponse> | Observable<GetCategoryResponse> | GetCategoryResponse;
149
114
 
150
- /** Получить атрибуты категории (для фильтрации) */
151
-
152
115
  getCategoryAttributes(
153
116
  request: GetCategoryAttributesRequest,
154
117
  ): Promise<GetCategoryAttributesResponse> | Observable<GetCategoryAttributesResponse> | GetCategoryAttributesResponse;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barumetric/contracts",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -5,26 +5,20 @@ package categories.v1;
5
5
  import "google/protobuf/empty.proto";
6
6
 
7
7
  service CategoriesService {
8
- // Получить все категории
9
8
  rpc GetAllCategories (google.protobuf.Empty) returns (GetAllCategoriesResponse);
10
-
11
- // Получить категорию по ID
12
9
  rpc GetCategory (GetCategoryRequest) returns (GetCategoryResponse);
13
-
14
- // Получить атрибуты категории (для фильтрации)
15
10
  rpc GetCategoryAttributes (GetCategoryAttributesRequest) returns (GetCategoryAttributesResponse);
16
11
  }
17
12
 
18
13
  message GetCategoryRequest {
19
14
  string id = 1;
20
- bool include_attributes = 2; // Включить атрибуты
15
+ bool include_attributes = 2;
21
16
  }
22
17
 
23
18
  message GetCategoryAttributesRequest {
24
- string category_id = 1; // ID категории
19
+ string id = 1;
25
20
  }
26
21
 
27
- // Ответы
28
22
  message GetAllCategoriesResponse {
29
23
  repeated Category categories = 1;
30
24
  }
@@ -37,8 +31,6 @@ message GetCategoryAttributesResponse {
37
31
  repeated CategoryAttribute attributes = 1;
38
32
  }
39
33
 
40
- // Модели
41
-
42
34
  message Category {
43
35
  string id = 1;
44
36
  string name = 2;
@@ -53,24 +45,24 @@ message Category {
53
45
  string path = 11;
54
46
  int32 depth = 12;
55
47
  int64 ads_count = 13;
56
- repeated Category children = 14; // Для дерева
57
- repeated CategoryAttribute attributes = 15; // Если include_attributes = true
48
+ repeated Category children = 14;
49
+ repeated CategoryAttribute attributes = 15;
58
50
  }
59
51
 
60
52
  message CategoryAttribute {
61
- string id = 1; // ID CategoryAttribute (связи)
62
- string category_id = 2; // ID категории
63
- string name = 3; // Название из глобального Attribute
64
- string key = 4; // Ключ из глобального Attribute
65
- AttributeType type = 5; // Тип из глобального Attribute
66
- bool is_required = 6; // Финальное значение (override или default из Attribute)
67
- bool is_filterable = 7; // Финальное значение (override или default из Attribute)
68
- bool inherited = 8; // Наследуется ли дочерним категориям
69
- optional string unit = 9; // Единица измерения из глобального Attribute
70
- optional float min_value = 10; // Минимальное значение из глобального Attribute
71
- optional float max_value = 11; // Максимальное значение из глобального Attribute
72
- int32 sort_order = 12; // Порядок сортировки в категории
73
- repeated EnumValue enum_values = 13; // Значения из глобального Attribute
53
+ string id = 1;
54
+ string category_id = 2;
55
+ string name = 3;
56
+ string key = 4;
57
+ AttributeType type = 5;
58
+ bool is_required = 6;
59
+ bool is_filterable = 7;
60
+ bool inherited = 8;
61
+ optional string unit = 9;
62
+ optional float min_value = 10;
63
+ optional float max_value = 11;
64
+ int32 sort_order = 12;
65
+ repeated EnumValue enum_values = 13;
74
66
  }
75
67
 
76
68
  message EnumValue {
@@ -86,7 +78,6 @@ message EnumValueInput {
86
78
  int32 sort_order = 3;
87
79
  }
88
80
 
89
- // Типы атрибутов
90
81
  enum AttributeType {
91
82
  ATTRIBUTE_TYPE_UNSPECIFIED = 0;
92
83
  ATTRIBUTE_TYPE_STRING = 1;
@@ -99,6 +90,3 @@ enum AttributeType {
99
90
  ATTRIBUTE_TYPE_RANGE = 8;
100
91
  ATTRIBUTE_TYPE_DATE = 9;
101
92
  }
102
-
103
-
104
-