@mamindom/contracts 1.0.138 → 1.0.140

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.
@@ -116,6 +116,19 @@ export interface ReorderPopularQueryItem {
116
116
  id: string;
117
117
  sortOrder: number;
118
118
  }
119
+ export interface ListZeroResultsRequest {
120
+ /** default 100, max 500 */
121
+ limit?: number | undefined;
122
+ }
123
+ export interface ZeroResultItem {
124
+ query: string;
125
+ count: number;
126
+ }
127
+ export interface ListZeroResultsResponse {
128
+ items: ZeroResultItem[];
129
+ }
130
+ export interface ClearZeroResultsRequest {
131
+ }
119
132
  export declare const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
120
133
  /**
121
134
  * SearchService — окремий сервіс під autocomplete та керування пошуком
@@ -136,6 +149,9 @@ export interface SearchServiceClient {
136
149
  updatePopularQuery(request: UpdatePopularQueryRequest): Observable<PopularQueryResponse>;
137
150
  deletePopularQuery(request: DeletePopularQueryRequest): Observable<DeleteResponse>;
138
151
  reorderPopularQueries(request: ReorderPopularQueriesRequest): Observable<SuccessResponse>;
152
+ /** ─── Admin: zero-result analytics ──────────────────────────────────────── */
153
+ listZeroResults(request: ListZeroResultsRequest): Observable<ListZeroResultsResponse>;
154
+ clearZeroResults(request: ClearZeroResultsRequest): Observable<SuccessResponse>;
139
155
  }
140
156
  /**
141
157
  * SearchService — окремий сервіс під autocomplete та керування пошуком
@@ -156,6 +172,9 @@ export interface SearchServiceController {
156
172
  updatePopularQuery(request: UpdatePopularQueryRequest): Promise<PopularQueryResponse> | Observable<PopularQueryResponse> | PopularQueryResponse;
157
173
  deletePopularQuery(request: DeletePopularQueryRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
158
174
  reorderPopularQueries(request: ReorderPopularQueriesRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
175
+ /** ─── Admin: zero-result analytics ──────────────────────────────────────── */
176
+ listZeroResults(request: ListZeroResultsRequest): Promise<ListZeroResultsResponse> | Observable<ListZeroResultsResponse> | ListZeroResultsResponse;
177
+ clearZeroResults(request: ClearZeroResultsRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
159
178
  }
160
179
  export declare function SearchServiceControllerMethods(): (constructor: Function) => void;
161
180
  export declare const SEARCH_SERVICE_NAME = "SearchService";
@@ -31,6 +31,8 @@ function SearchServiceControllerMethods() {
31
31
  "updatePopularQuery",
32
32
  "deletePopularQuery",
33
33
  "reorderPopularQueries",
34
+ "listZeroResults",
35
+ "clearZeroResults",
34
36
  ];
35
37
  for (const method of grpcMethods) {
36
38
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
@@ -19,6 +19,15 @@ export interface GetShopFiltersRequest {
19
19
  * по товарах, що належать поточній акції.
20
20
  */
21
21
  promotionFilter?: PromotionFilter | undefined;
22
+ /** Динамічні атрибути окрім color/size (матеріал, виробник тощо). */
23
+ attributeValueIds: string[];
24
+ /**
25
+ * Явний прапор "ціновий фільтр активний". Без нього неможливо
26
+ * відрізнити "користувач не вибирав" від "обрав від 0".
27
+ */
28
+ priceActive?: boolean | undefined;
29
+ /** 'uk' | 'ru' — для локалізації labels у відповіді (дефолт uk). */
30
+ locale?: string | undefined;
22
31
  }
23
32
  export interface GetShopFiltersResponse {
24
33
  brands: ShopFilterOption[];
@@ -42,16 +51,13 @@ export interface ShopFilterColorOption {
42
51
  }
43
52
  export interface ShopFilterAttribute {
44
53
  slug: string;
45
- name: {
46
- [key: string]: string;
47
- };
48
- displayType: string;
54
+ /**
55
+ * Локалізована назва атрибута (на стороні gateway вже згорнута у
56
+ * одну рядкову label згідно locale запиту).
57
+ */
58
+ label: string;
49
59
  values: ShopFilterOption[];
50
60
  }
51
- export interface ShopFilterAttribute_NameEntry {
52
- key: string;
53
- value: string;
54
- }
55
61
  export declare const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
56
62
  export interface ShopFilterServiceClient {
57
63
  getShopFilters(request: GetShopFiltersRequest): Observable<GetShopFiltersResponse>;
@@ -23,6 +23,10 @@ service SearchService {
23
23
  rpc UpdatePopularQuery (UpdatePopularQueryRequest) returns (PopularQueryResponse);
24
24
  rpc DeletePopularQuery (DeletePopularQueryRequest) returns (DeleteResponse);
25
25
  rpc ReorderPopularQueries (ReorderPopularQueriesRequest) returns (SuccessResponse);
26
+
27
+ // ─── Admin: zero-result analytics ────────────────────────────────────────
28
+ rpc ListZeroResults (ListZeroResultsRequest) returns (ListZeroResultsResponse);
29
+ rpc ClearZeroResults (ClearZeroResultsRequest) returns (SuccessResponse);
26
30
  }
27
31
 
28
32
  // ─────────────────────────── Suggest (public) ─────────────────────────────
@@ -159,3 +163,21 @@ message ReorderPopularQueryItem {
159
163
  string id = 1;
160
164
  int32 sort_order = 2;
161
165
  }
166
+
167
+ // ─────────────────────── Zero-result analytics (admin) ─────────────────────
168
+
169
+ message ListZeroResultsRequest {
170
+ optional int32 limit = 1; // default 100, max 500
171
+ }
172
+
173
+ message ZeroResultItem {
174
+ string query = 1;
175
+ int32 count = 2;
176
+ }
177
+
178
+ message ListZeroResultsResponse {
179
+ repeated ZeroResultItem items = 1;
180
+ }
181
+
182
+ message ClearZeroResultsRequest {
183
+ }
@@ -28,6 +28,16 @@ message GetShopFiltersRequest {
28
28
  // Обмеження множини товарів акцією — фасети рахуються тільки
29
29
  // по товарах, що належать поточній акції.
30
30
  optional PromotionFilter promotion_filter = 9;
31
+
32
+ // Динамічні атрибути окрім color/size (матеріал, виробник тощо).
33
+ repeated string attribute_value_ids = 10;
34
+
35
+ // Явний прапор "ціновий фільтр активний". Без нього неможливо
36
+ // відрізнити "користувач не вибирав" від "обрав від 0".
37
+ optional bool price_active = 11;
38
+
39
+ // 'uk' | 'ru' — для локалізації labels у відповіді (дефолт uk).
40
+ optional string locale = 12;
31
41
  }
32
42
 
33
43
 
@@ -42,8 +52,8 @@ message GetShopFiltersResponse {
42
52
  }
43
53
 
44
54
  message ShopFilterOption {
45
- string value = 1;
46
- string label = 2;
55
+ string value = 1;
56
+ string label = 2;
47
57
  int32 count = 3;
48
58
  }
49
59
 
@@ -56,7 +66,8 @@ message ShopFilterColorOption {
56
66
 
57
67
  message ShopFilterAttribute {
58
68
  string slug = 1;
59
- map<string, string> name = 2;
60
- string display_type = 3;
61
- repeated ShopFilterOption values = 4;
69
+ // Локалізована назва атрибута (на стороні gateway вже згорнута у
70
+ // одну рядкову label згідно locale запиту).
71
+ string label = 2;
72
+ repeated ShopFilterOption values = 3;
62
73
  }
package/gen/search.ts CHANGED
@@ -146,6 +146,23 @@ export interface ReorderPopularQueryItem {
146
146
  sortOrder: number;
147
147
  }
148
148
 
149
+ export interface ListZeroResultsRequest {
150
+ /** default 100, max 500 */
151
+ limit?: number | undefined;
152
+ }
153
+
154
+ export interface ZeroResultItem {
155
+ query: string;
156
+ count: number;
157
+ }
158
+
159
+ export interface ListZeroResultsResponse {
160
+ items: ZeroResultItem[];
161
+ }
162
+
163
+ export interface ClearZeroResultsRequest {
164
+ }
165
+
149
166
  export const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
150
167
 
151
168
  /**
@@ -181,6 +198,12 @@ export interface SearchServiceClient {
181
198
  deletePopularQuery(request: DeletePopularQueryRequest): Observable<DeleteResponse>;
182
199
 
183
200
  reorderPopularQueries(request: ReorderPopularQueriesRequest): Observable<SuccessResponse>;
201
+
202
+ /** ─── Admin: zero-result analytics ──────────────────────────────────────── */
203
+
204
+ listZeroResults(request: ListZeroResultsRequest): Observable<ListZeroResultsResponse>;
205
+
206
+ clearZeroResults(request: ClearZeroResultsRequest): Observable<SuccessResponse>;
184
207
  }
185
208
 
186
209
  /**
@@ -234,6 +257,16 @@ export interface SearchServiceController {
234
257
  reorderPopularQueries(
235
258
  request: ReorderPopularQueriesRequest,
236
259
  ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
260
+
261
+ /** ─── Admin: zero-result analytics ──────────────────────────────────────── */
262
+
263
+ listZeroResults(
264
+ request: ListZeroResultsRequest,
265
+ ): Promise<ListZeroResultsResponse> | Observable<ListZeroResultsResponse> | ListZeroResultsResponse;
266
+
267
+ clearZeroResults(
268
+ request: ClearZeroResultsRequest,
269
+ ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
237
270
  }
238
271
 
239
272
  export function SearchServiceControllerMethods() {
@@ -250,6 +283,8 @@ export function SearchServiceControllerMethods() {
250
283
  "updatePopularQuery",
251
284
  "deletePopularQuery",
252
285
  "reorderPopularQueries",
286
+ "listZeroResults",
287
+ "clearZeroResults",
253
288
  ];
254
289
  for (const method of grpcMethods) {
255
290
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
@@ -30,7 +30,20 @@ export interface GetShopFiltersRequest {
30
30
  * Обмеження множини товарів акцією — фасети рахуються тільки
31
31
  * по товарах, що належать поточній акції.
32
32
  */
33
- promotionFilter?: PromotionFilter | undefined;
33
+ promotionFilter?:
34
+ | PromotionFilter
35
+ | undefined;
36
+ /** Динамічні атрибути окрім color/size (матеріал, виробник тощо). */
37
+ attributeValueIds: string[];
38
+ /**
39
+ * Явний прапор "ціновий фільтр активний". Без нього неможливо
40
+ * відрізнити "користувач не вибирав" від "обрав від 0".
41
+ */
42
+ priceActive?:
43
+ | boolean
44
+ | undefined;
45
+ /** 'uk' | 'ru' — для локалізації labels у відповіді (дефолт uk). */
46
+ locale?: string | undefined;
34
47
  }
35
48
 
36
49
  export interface GetShopFiltersResponse {
@@ -58,16 +71,14 @@ export interface ShopFilterColorOption {
58
71
 
59
72
  export interface ShopFilterAttribute {
60
73
  slug: string;
61
- name: { [key: string]: string };
62
- displayType: string;
74
+ /**
75
+ * Локалізована назва атрибута (на стороні gateway вже згорнута у
76
+ * одну рядкову label згідно locale запиту).
77
+ */
78
+ label: string;
63
79
  values: ShopFilterOption[];
64
80
  }
65
81
 
66
- export interface ShopFilterAttribute_NameEntry {
67
- key: string;
68
- value: string;
69
- }
70
-
71
82
  export const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
72
83
 
73
84
  export interface ShopFilterServiceClient {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mamindom/contracts",
3
3
  "description": "proto",
4
- "version": "1.0.138",
4
+ "version": "1.0.140",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",
7
7
  "exports": {
@@ -23,6 +23,10 @@ service SearchService {
23
23
  rpc UpdatePopularQuery (UpdatePopularQueryRequest) returns (PopularQueryResponse);
24
24
  rpc DeletePopularQuery (DeletePopularQueryRequest) returns (DeleteResponse);
25
25
  rpc ReorderPopularQueries (ReorderPopularQueriesRequest) returns (SuccessResponse);
26
+
27
+ // ─── Admin: zero-result analytics ────────────────────────────────────────
28
+ rpc ListZeroResults (ListZeroResultsRequest) returns (ListZeroResultsResponse);
29
+ rpc ClearZeroResults (ClearZeroResultsRequest) returns (SuccessResponse);
26
30
  }
27
31
 
28
32
  // ─────────────────────────── Suggest (public) ─────────────────────────────
@@ -159,3 +163,21 @@ message ReorderPopularQueryItem {
159
163
  string id = 1;
160
164
  int32 sort_order = 2;
161
165
  }
166
+
167
+ // ─────────────────────── Zero-result analytics (admin) ─────────────────────
168
+
169
+ message ListZeroResultsRequest {
170
+ optional int32 limit = 1; // default 100, max 500
171
+ }
172
+
173
+ message ZeroResultItem {
174
+ string query = 1;
175
+ int32 count = 2;
176
+ }
177
+
178
+ message ListZeroResultsResponse {
179
+ repeated ZeroResultItem items = 1;
180
+ }
181
+
182
+ message ClearZeroResultsRequest {
183
+ }
@@ -28,6 +28,16 @@ message GetShopFiltersRequest {
28
28
  // Обмеження множини товарів акцією — фасети рахуються тільки
29
29
  // по товарах, що належать поточній акції.
30
30
  optional PromotionFilter promotion_filter = 9;
31
+
32
+ // Динамічні атрибути окрім color/size (матеріал, виробник тощо).
33
+ repeated string attribute_value_ids = 10;
34
+
35
+ // Явний прапор "ціновий фільтр активний". Без нього неможливо
36
+ // відрізнити "користувач не вибирав" від "обрав від 0".
37
+ optional bool price_active = 11;
38
+
39
+ // 'uk' | 'ru' — для локалізації labels у відповіді (дефолт uk).
40
+ optional string locale = 12;
31
41
  }
32
42
 
33
43
 
@@ -42,8 +52,8 @@ message GetShopFiltersResponse {
42
52
  }
43
53
 
44
54
  message ShopFilterOption {
45
- string value = 1;
46
- string label = 2;
55
+ string value = 1;
56
+ string label = 2;
47
57
  int32 count = 3;
48
58
  }
49
59
 
@@ -56,7 +66,8 @@ message ShopFilterColorOption {
56
66
 
57
67
  message ShopFilterAttribute {
58
68
  string slug = 1;
59
- map<string, string> name = 2;
60
- string display_type = 3;
61
- repeated ShopFilterOption values = 4;
69
+ // Локалізована назва атрибута (на стороні gateway вже згорнута у
70
+ // одну рядкову label згідно locale запиту).
71
+ string label = 2;
72
+ repeated ShopFilterOption values = 3;
62
73
  }