@wix/bex-utils 1.37.0 → 1.38.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.
Files changed (70) hide show
  1. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/build/cjs/builders.impl.d.ts +4 -1
  2. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/build/cjs/builders.impl.js +64 -6
  3. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/build/cjs/builders.impl.js.map +1 -1
  4. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/build/cjs/http.impl.js +12 -0
  5. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/build/cjs/http.impl.js.map +1 -1
  6. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/build/cjs/proto/client/proto-generated.d.ts +713 -74
  7. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/build/cjs/proto/proto-generated.d.ts +359 -38
  8. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/build/cjs/proto/proto-generated.js +12499 -2105
  9. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/build/cjs/proto/server/proto-generated.d.ts +711 -73
  10. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/build/cjs/types.impl.d.ts +56 -2
  11. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/build/cjs/types.impl.js +10 -1
  12. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/build/cjs/types.impl.js.map +1 -1
  13. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/build/es/builders.impl.d.ts +4 -1
  14. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/build/es/builders.impl.js +60 -5
  15. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/build/es/builders.impl.js.map +1 -1
  16. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/build/es/http.impl.js +12 -0
  17. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/build/es/http.impl.js.map +1 -1
  18. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/build/es/types.impl.d.ts +56 -2
  19. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/build/es/types.impl.js +9 -0
  20. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/build/es/types.impl.js.map +1 -1
  21. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/package.json +3 -3
  22. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/com/wix/ecommerce/catalog_spi/api/v1/catalog_reference.proto +16 -10
  23. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/com/wix/ecommerce/catalog_spi/api/v1/description_line.proto +23 -6
  24. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/com/wix/ecommerce/catalog_spi/api/v1/item_data.proto +70 -44
  25. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/com/wix/ecommerce/catalog_spi/api/v1/item_media.proto +14 -5
  26. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/com/wix/ecommerce/catalog_spi/api/v1/item_type.proto +3 -1
  27. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/com/wix/ecommerce/catalog_spi/api/v1/payment_option.proto +10 -7
  28. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/com/wix/ecommerce/catalog_spi/api/v1/physical_properties.proto +4 -1
  29. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/com/wix/ecommerce/catalog_spi/api/v1/platform_catalog_spi.proto +109 -33
  30. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/com/wix/ecommerce/catalog_spi/api/v1/price_description.proto +6 -2
  31. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/com/wix/ecommerce/catalog_spi/api/v1/product_name.proto +11 -6
  32. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/com/wix/ecommerce/catalog_spi/api/v1/secured_media.proto +5 -2
  33. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/com/wix/ecommerce/catalog_spi/api/v1/service_properties.proto +5 -2
  34. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/com/wix/ecommerce/catalog_spi/api/v1/subscription_option_info.proto +14 -4
  35. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/com/wix/ecommerce/inventory/api/v1/inventoryEvents.proto +5 -0
  36. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/com/wix/ecommerce/platform_common/api/address_with_contact.proto +0 -1
  37. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/com/wix/ecommerce/platform_common/api/locations.proto +16 -0
  38. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/api/annotations.proto +4 -1
  39. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/api/entity.proto +6 -0
  40. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/api/errors.proto +6 -0
  41. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/catalog/api/v1/catalog.proto +49 -13
  42. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/catalog/api/v1/media.proto +2 -2
  43. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/catalog/api/v1/product.proto +5 -0
  44. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/catalog/api/v2/collectionRead.proto +1 -2
  45. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/common/media.proto +9 -2
  46. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/common/pageurl.proto +4 -4
  47. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/common/paging.proto +21 -12
  48. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/common/query.proto +323 -88
  49. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/common/sorting.proto +13 -2
  50. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/common/tags.proto +2 -2
  51. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/common/wixlink.proto +50 -1
  52. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/coupons/api/v1/coupons-adapter.proto +50 -50
  53. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/coupons/api/v2/mediaitem.proto +3 -3
  54. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/fedinfra/exportservice/v1/export.proto +1 -0
  55. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/infra/asyncjobs/v1/AsyncJob.proto +2 -0
  56. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/infra/asyncjobs/v1/AsyncJobService.proto +36 -2
  57. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/inventory/api/v1/inventoryItem.proto +1 -0
  58. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/inventory/api/v1/locationInventory.proto +27 -0
  59. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/inventory/api/v1/locationInventoryItem.proto +75 -0
  60. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/inventory/api/v1/locationInventoryMessages.proto +33 -0
  61. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/payment/api/pay/v2/accounts.proto +8 -0
  62. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/payment/api/pay/v2/orders.proto +10 -0
  63. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/payment/api/pay/v2/payment-methods.proto +7 -0
  64. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/payment/api/pay/v2/payments.proto +7 -0
  65. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/payment/api/pay/v2/resources/charge.proto +3 -3
  66. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/payment/api/pay/v2/resources/order-description.proto +6 -0
  67. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/payment/api/pay/v2/resources/payment-method.proto +3 -1
  68. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/payment/api/pay/v3/resources/payment-event.proto +2 -1
  69. package/package.json +3 -3
  70. package/@wix/ambassador-fedinfra-exportservice-v1-export-async-job/src/main/proto/wix/payment/api/pay/v2/paypal-recurring-orders.proto +0 -38
@@ -81,11 +81,11 @@ message CursorQuery {
81
81
  google.protobuf.Struct filter = 1;
82
82
  //Sort object in the following format:
83
83
  //`[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
84
- repeated Sorting sort = 2;
84
+ repeated Sorting sort = 2 [(.wix.api.maxSize) = 5];
85
85
  reserved 3;
86
86
  reserved 4;
87
87
  reserved 5;
88
- oneof pagingMethod {
88
+ oneof pagingMethod {
89
89
  //Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.
90
90
  CursorPaging cursor_paging = 6;
91
91
  }
@@ -102,190 +102,301 @@ message Search {
102
102
  field: "sort"
103
103
  field: "cursor_paging"
104
104
  };
105
- //A filter object. See documentation [here](https://bo.wix.com/wix-docs/rnd/platformization-guidelines/api-query-language#platformization-guidelines_api-query-language_defining-in-protobuf)
105
+ // A filter object. See documentation [here](https://bo.wix.com/wix-docs/rnd/platformization-guidelines/api-query-language#platformization-guidelines_api-query-language_defining-in-protobuf)
106
106
  google.protobuf.Struct filter = 1;
107
- //Sort object in the form [{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}]
108
- repeated Sorting sort = 2;
109
- //Projection on the result object - list of specific field names to return. If fieldsets are also specified, return the union of fieldsets and fields
110
- repeated string fields = 3;
111
- //Projection on the result object - list of named projections. E.g. "basic" will return id and name fields. Specifying multiple fieldsets will return the union of fields from all. Specifying fieldsets and fields will also return the union of fields.
112
- repeated string fieldsets = 4;
113
- //Aggregations | Faceted search: refers to a way to explore large amounts of data by displaying summaries about various partitions of the data and later allowing to narrow the navigation to a specific partition.
114
- repeated Aggregation aggregations = 5;
115
- //free text to match in searchable fields
107
+ // Sort object in the form [{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}]
108
+ repeated Sorting sort = 2 [(.wix.api.maxSize) = 10];
109
+ // Projection on the result object - list of specific field names to return. If fieldsets are also specified, return the union of fieldsets and fields
110
+ repeated string fields = 3 [(.wix.api.maxLength) = 200, (.wix.api.maxSize) = 20];
111
+ // Projection on the result object - list of named projections. E.g. "basic" will return id and name fields. Specifying multiple fieldsets will return the union of fields from all. Specifying fieldsets and fields will also return the union of fields.
112
+ repeated string fieldsets = 4 [(.wix.api.maxLength) = 100, (.wix.api.maxSize) = 20];
113
+ // Aggregations | Faceted search: refers to a way to explore large amounts of data by displaying summaries about various partitions of the data and later allowing to narrow the navigation to a specific partition.
114
+ repeated Aggregation aggregations = 5 [(.wix.api.maxSize) = 10];
115
+ // Free text to match in searchable fields
116
116
  SearchDetails search = 6;
117
117
  oneof paging_method {
118
- //Pointer to page of results using offset. Can not be used together with 'cursor_paging'
118
+ // Pointer to page of results using offset. Can not be used together with 'cursor_paging'
119
119
  Paging paging = 7;
120
- //Cursor pointing to page of results. Can't be used together with 'paging'. 'cursor_paging.cursor' can not be used together with 'filter' or 'sort'
120
+ // Cursor pointing to page of results. Can't be used together with 'paging'. 'cursor_paging.cursor' can not be used together with 'filter' or 'sort'
121
121
  CursorPaging cursor_paging = 8;
122
122
  }
123
+ // UTC offset or IANA time zone. Valid values are
124
+ // ISO 8601 UTC offsets, such as +02:00 or -06:00,
125
+ // and IANA time zone IDs, such as Europe/Rome
126
+ //
127
+ // Affects all filters and aggregations returned values.
128
+ // You may override this behavior in a specific filter by providing
129
+ // timestamps including time zone. e.g. `"2023-12-20T10:52:34.795Z"`
130
+ google.protobuf.StringValue time_zone = 9 [(.wix.api.maxLength) = 50];
123
131
  }
124
132
 
125
133
  message CursorSearch {
126
134
  option (.wix.api.decomposite_of) = "wix.common.Search";
127
- //A filter object. See documentation [here](https://bo.wix.com/wix-docs/rnd/platformization-guidelines/api-query-language#platformization-guidelines_api-query-language_defining-in-protobuf)
135
+ // A filter object. See documentation [here](https://bo.wix.com/wix-docs/rnd/platformization-guidelines/api-query-language#platformization-guidelines_api-query-language_defining-in-protobuf)
128
136
  google.protobuf.Struct filter = 1;
129
- //Sort object in the form [{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}]
130
- repeated Sorting sort = 2;
137
+ // Sort object in the form [{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}]
138
+ repeated Sorting sort = 2 [(.wix.api.maxSize) = 10];
131
139
  reserved 3;
132
140
  reserved 4;
133
141
  reserved 7;
134
- //Aggregations | Faceted search: refers to a way to explore large amounts of data by displaying summaries about various partitions of the data and later allowing to narrow the navigation to a specific partition.
135
- repeated Aggregation aggregations = 5;
136
- //free text to match in searchable fields
142
+ // Aggregations | Faceted search: refers to a way to explore large amounts of data by displaying summaries about various partitions of the data and later allowing to narrow the navigation to a specific partition.
143
+ repeated Aggregation aggregations = 5 [(.wix.api.maxSize) = 10];
144
+ // Free text to match in searchable fields
137
145
  SearchDetails search = 6;
138
146
  oneof paging_method {
139
- //Cursor pointing to page of results. Can't be used together with 'paging'. 'cursor_paging.cursor' can not be used together with 'filter' or 'sort'
147
+ // Cursor pointing to page of results.
148
+ // When requesting 'cursor_paging.cursor', no `filter`, `sort` or `search` can be provided.
140
149
  CursorPaging cursor_paging = 8;
141
150
  }
151
+ // UTC offset or IANA time zone. Valid values are
152
+ // ISO 8601 UTC offsets, such as +02:00 or -06:00,
153
+ // and IANA time zone IDs, such as Europe/Rome
154
+ //
155
+ // Affects all filters and aggregations returned values.
156
+ // You may override this behavior in a specific filter by providing
157
+ // timestamps including time zone. e.g. `"2023-12-20T10:52:34.795Z"`
158
+ google.protobuf.StringValue time_zone = 9 [(.wix.api.maxLength) = 50];
142
159
  }
143
160
 
144
161
  message SearchDetails {
145
162
  enum Mode {
146
- OR = 0; // any
147
- AND = 1; // all
163
+ OR = 0; // Any of the search terms must be present
164
+ AND = 1; // All search terms must be present
148
165
  }
149
- Mode mode = 1; // boolean search mode
150
- google.protobuf.StringValue expression = 2; // search term or expression
151
- repeated string fields = 3; // fields to search in. if empty - server will search in own default fields
152
- bool fuzzy = 4; // flag if should use auto fuzzy search (allowing typos by a managed proximity algorithm)
166
+ Mode mode = 1; // Defines how separate search terms in `expression` are combined
167
+ google.protobuf.StringValue expression = 2 [(.wix.api.maxLength) = 100]; // Search term or expression
168
+ // Fields to search in. If empty - will search in all searchable fields. Use dot notation to specify json path
169
+ repeated string fields = 3 [(.wix.api.maxLength) = 200, (.wix.api.maxSize) = 20];
170
+ bool fuzzy = 4; // Flag if should use auto fuzzy search (allowing typos by a managed proximity algorithm)
153
171
  }
154
172
 
155
173
  enum AggregationType {
156
- UNKNOWN_AGGREGATION_TYPE = 0;
157
- VALUE = 1;
158
- RANGE = 2;
159
- SCALAR = 3;
174
+ UNKNOWN_AGGREGATION_TYPE = 0 [(.wix.api.enum_maturity) = NOT_IMPLEMENTED];
175
+ VALUE = 1; // An aggregation where result buckets are dynamically built - one per unique value
176
+ RANGE = 2; // An aggregation, where user can define set of ranges - each representing a bucket
177
+ SCALAR = 3; // A single-value metric aggregation - e.g. min, max, sum, avg
178
+ DATE_HISTOGRAM = 4; // An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.)
179
+ NESTED = 5; // Multi-level aggregation, where each next aggregation is nested within previous one
160
180
  }
161
181
 
162
182
  enum ScalarType {
163
- UNKNOWN_SCALAR_TYPE = 0;
164
- COUNT_DISTINCT = 1;
165
- MIN = 2;
166
- MAX = 3;
167
- SUM = 4 [(.wix.api.enum_exposure) = PRIVATE];
168
- AVG = 5 [(.wix.api.enum_exposure) = PRIVATE];
183
+ UNKNOWN_SCALAR_TYPE = 0 [(.wix.api.enum_maturity) = NOT_IMPLEMENTED];
184
+ COUNT_DISTINCT = 1; // Count of distinct values
185
+ MIN = 2; // Minimum value
186
+ MAX = 3; // Maximum value
187
+ SUM = 4 [(.wix.api.enum_exposure) = PRIVATE]; // Sum of values
188
+ AVG = 5 [(.wix.api.enum_exposure) = PRIVATE]; // Average of values
169
189
  }
170
190
 
171
191
  message Aggregation {
172
192
  message RangeAggregation {
173
193
  message RangeBucket {
174
- google.protobuf.DoubleValue from = 1; // Inclusive lower bound of the range. Required if to is not given.
175
- google.protobuf.DoubleValue to = 2; // Exclusive upper bound of the range. Required if from is not given.
194
+ google.protobuf.DoubleValue from = 1; // Inclusive lower bound of the range. Required if to is not given
195
+ google.protobuf.DoubleValue to = 2; // Exclusive upper bound of the range. Required if from is not given
176
196
  }
177
- repeated RangeBucket buckets = 1;
197
+ // List of range buckets, where during aggregation each entity will be placed in the first bucket where its value falls into based on provided range bounds
198
+ repeated RangeBucket buckets = 1 [(.wix.api.maxSize) = 50];
178
199
  }
179
200
 
180
201
  message ValueAggregation {
181
202
  enum SortType {
182
- COUNT = 0;
183
- VALUE = 1;
203
+ COUNT = 0; // Should sort by number of matches
204
+ VALUE = 1; // Should sort by value of the field alphabetically
184
205
  }
185
206
  enum SortDirection {
186
- DESC = 0;
187
- ASC = 1;
207
+ DESC = 0; // Should sort in descending order
208
+ ASC = 1; // Should sort in ascending order
188
209
  }
189
210
 
190
211
  enum MissingValues {
191
- EXCLUDE = 0;
192
- INCLUDE = 1;
212
+ EXCLUDE = 0; // Should missing values be excluded from the aggregation results
213
+ INCLUDE = 1; // Should missing values be included in the aggregation results
193
214
  }
194
215
 
195
216
  message IncludeMissingValuesOptions {
196
- string add_to_bucket = 1; // can specify custom bucket name. Defaults are [string -> "N/A"], [int -> "0"], [bool -> "false"] ...
217
+ string add_to_bucket = 1 [(.wix.api.maxLength) = 20]; // Can specify custom bucket name. Defaults are [string -> "N/A"], [int -> "0"], [bool -> "false"] ...
197
218
  }
198
219
 
199
- SortType sort_type = 1;
200
- SortDirection sort_direction = 2;
220
+ SortType sort_type = 1; // Should sort by number of matches or value of the field
221
+ SortDirection sort_direction = 2; // Should sort in ascending or descending order
201
222
  google.protobuf.Int32Value limit = 3; // How many aggregations would you like to return? Can be between 1 and 250. 10 is the default.
202
223
 
203
- MissingValues missing_values = 4; // should missing values be included or excluded from the aggregation results. Default is EXCLUDE
224
+ MissingValues missing_values = 4; // Should missing values be included or excluded from the aggregation results. Default is EXCLUDE
204
225
  oneof options {
205
226
  option (.wix.api.aligned_with_enum).field = "missing_values";
206
- IncludeMissingValuesOptions include_options = 5; // options for including missing values
227
+ IncludeMissingValuesOptions include_options = 5; // Options for including missing values
207
228
  }
208
229
  }
209
230
 
210
231
  message ScalarAggregation {
211
- ScalarType type = 1;
232
+ ScalarType type = 1; // Define the operator for the scalar aggregation
212
233
  }
213
234
 
214
235
  message GroupByAggregation {
215
- google.protobuf.StringValue name = 1;
216
- string field_path = 3;
236
+ google.protobuf.StringValue name = 1 [(.wix.api.maxLength) = 100]; // User-defined name of aggregation, should be unique, will appear in aggregation results
237
+ string field_path = 3 [(.wix.api.maxLength) = 200]; // Field to aggregate by
217
238
  oneof kind {
218
- ValueAggregation value = 4;
239
+ ValueAggregation value = 4; // Value aggregation configuration
219
240
  }
220
241
  }
221
242
 
222
- google.protobuf.StringValue name = 1;
223
- AggregationType type = 2;
224
- string field_path = 3;
243
+ // Nested aggregation expressed through a list of aggregation where each next aggregation is nested within previous one
244
+ message NestedAggregation {
245
+ reserved 1;
246
+
247
+ enum NestedAggregationType {
248
+ UNKNOWN_AGGREGATION_TYPE = 0 [(.wix.api.enum_maturity) = NOT_IMPLEMENTED];
249
+ VALUE = 1; // An aggregation where result buckets are dynamically built - one per unique value
250
+ RANGE = 2; // An aggregation, where user can define set of ranges - each representing a bucket
251
+ SCALAR = 3; // A single-value metric aggregation - e.g. min, max, sum, avg
252
+ DATE_HISTOGRAM = 4; // An aggregation, where result buckets are dynamically built - one per time interval (hour, day, week, etc.)
253
+ }
254
+
255
+ message NestedAggregationItem {
256
+ google.protobuf.StringValue name = 1 [(.wix.api.maxLength) = 100]; // User-defined name of aggregation, should be unique, will appear in aggregation results
257
+ NestedAggregationType type = 2; // Type of aggregation, client must provide matching aggregation field below
258
+ string field_path = 3 [(.wix.api.maxLength) = 200]; // Field to aggregate by, use dont notation to specify json path
259
+ oneof kind {
260
+ ValueAggregation value = 4; // Value aggregation
261
+ RangeAggregation range = 5; // Range aggregation
262
+ ScalarAggregation scalar = 6; // Scalar aggregation
263
+ DateHistogramAggregation date_histogram = 9; // Date histogram aggregation
264
+ }
265
+ }
266
+
267
+ // Flattened list of aggregations, where each next aggregation is nested within previous one
268
+ repeated NestedAggregationItem nested_aggregations = 2 [(.wix.api.minSize) = 2, (.wix.api.maxSize) = 3];
269
+ }
270
+
271
+ message DateHistogramAggregation {
272
+ enum Interval {
273
+ UNKNOWN_INTERVAL = 0 [(.wix.api.enum_maturity) = NOT_IMPLEMENTED];
274
+ YEAR = 1; // Yearly interval
275
+ MONTH = 2; // Monthly interval
276
+ WEEK = 3; // Weekly interval
277
+ DAY = 4; // Daily interval
278
+ HOUR = 5; // Hourly interval
279
+ MINUTE = 6; // Minute interval
280
+ SECOND = 7; // Second interval
281
+ }
282
+
283
+ Interval interval = 1; // Interval for date histogram aggregation
284
+ }
285
+
286
+ google.protobuf.StringValue name = 1 [(.wix.api.maxLength) = 100]; // User-defined name of aggregation, should be unique, will appear in aggregation results
287
+ AggregationType type = 2; // Type of aggregation, client must provide matching aggregation field below
288
+ string field_path = 3 [(.wix.api.maxLength) = 200]; // Field to aggregate by, use dot notation to specify json path
225
289
  oneof kind {
226
- ValueAggregation value = 4;
227
- RangeAggregation range = 5;
228
- ScalarAggregation scalar = 6;
290
+ ValueAggregation value = 4; // Value aggregation
291
+ RangeAggregation range = 5; // Range aggregation
292
+ ScalarAggregation scalar = 6; // Scalar aggregation
293
+ DateHistogramAggregation date_histogram = 9; // Date histogram aggregation
294
+ NestedAggregation nested = 8; // Nested aggregation
229
295
  }
230
- GroupByAggregation group_by = 7;
296
+
297
+ // deprecated, use `nested` instead
298
+ GroupByAggregation group_by = 7 [deprecated = true, (.wix.api.field_deprecated) = {replaced_by: "kind.nested", target_removal_date: "2024-03-30"}];
231
299
  }
232
300
 
233
301
  message AggregationData {
234
302
  message AggregationResults {
235
303
  message ValueResults {
236
304
  message ValueAggregationResult {
237
- string value = 1;
238
- int32 count = 2;
305
+ string value = 1 [(.wix.api.maxLength) = 100]; // Value of the field
306
+ int32 count = 2; // Count of entities with this value
239
307
  }
240
- repeated ValueAggregationResult results = 1;
308
+ repeated ValueAggregationResult results = 1 [(.wix.api.maxSize) = 250]; // List of value aggregations
241
309
  }
242
310
 
243
311
  message RangeResults {
244
312
  message RangeAggregationResult {
245
- google.protobuf.DoubleValue from = 1;
246
- google.protobuf.DoubleValue to = 2;
247
- int32 count = 3;
313
+ google.protobuf.DoubleValue from = 1; // Inclusive lower bound of the range
314
+ google.protobuf.DoubleValue to = 2; // Exclusive upper bound of the range
315
+ int32 count = 3; // Count of entities in this range
248
316
  }
249
- repeated RangeAggregationResult results = 1;
317
+ repeated RangeAggregationResult results = 1 [(.wix.api.maxSize) = 50]; // List of ranges returned in same order as requested
250
318
  }
251
319
 
252
320
  message ScalarResult {
253
- ScalarType type = 1;
254
- double value = 2;
321
+ ScalarType type = 1; // Type of scalar aggregation
322
+ double value = 2; // Value of the scalar aggregation
255
323
  }
256
324
 
257
325
  message GroupByValueResults {
258
326
  message NestedValueAggregationResult {
259
- string value = 1;
260
- NestedAggregationResults nested_results = 2;
327
+ string value = 1 [(.wix.api.maxLength) = 1000]; // Value of the field
328
+ NestedAggregationResults nested_results = 2; // Nested aggregations
261
329
 
262
330
  }
263
- repeated NestedValueAggregationResult results = 1;
331
+ repeated NestedValueAggregationResult results = 1 [(.wix.api.maxSize) = 1000]; // List of value aggregations
264
332
  }
265
333
 
266
334
  message NestedAggregationResults {
267
- string name = 1;
268
- AggregationType type = 2;
269
- string field_path = 6;
335
+ string name = 1 [(.wix.api.maxLength) = 100]; // User-defined name of aggregation, matches the one provided in request
336
+ AggregationType type = 2; // Type of aggregation that matches result
337
+ string field_path = 6 [(.wix.api.maxLength) = 200]; // Field to aggregate by, matches the one provided in request
270
338
  oneof result {
271
- ValueResults values = 3;
272
- RangeResults ranges = 4;
273
- ScalarResult scalar = 5;
339
+ ValueResults values = 3; // Value aggregation results
340
+ RangeResults ranges = 4; // Range aggregation results
341
+ ScalarResult scalar = 5; // Scalar aggregation results
274
342
  }
275
343
  }
276
344
 
277
- string name = 1;
278
- AggregationType type = 2;
279
- string field_path = 6;
345
+ // Results of `NESTED` aggregation type in a flattened form
346
+ // aggregations in resulting array are keyed by requested aggregation `name`.
347
+ message NestedResults {
348
+ message ValueResult {
349
+ string value = 1 [(.wix.api.maxLength) = 1000]; // Value of the field
350
+ google.protobuf.Int32Value count = 2; // Count of entities with this value
351
+ }
352
+ message RangeResult {
353
+ google.protobuf.DoubleValue from = 1; // Inclusive lower bound of the range
354
+ google.protobuf.DoubleValue to = 2; // Exclusive upper bound of the range
355
+ google.protobuf.Int32Value count = 3; // Count of entities in this range
356
+ }
357
+
358
+ message ScalarResult {
359
+ double value = 1; // Value of the scalar aggregation
360
+ }
361
+
362
+ message NestedResultValue {
363
+ oneof result {
364
+ ValueResult value = 1; // Value aggregation result
365
+ RangeResult range = 2; // Range aggregation result
366
+ ScalarResult scalar = 3; // Scalar aggregation result
367
+ ValueResult date_histogram = 4; // Date histogram aggregation result
368
+ }
369
+ }
370
+
371
+ message Results {
372
+ map<string, NestedResultValue> results = 1; // List of nested aggregations
373
+ }
374
+
375
+ repeated Results results = 1 [(.wix.api.maxSize) = 1000]; // List of nested aggregations
376
+ }
377
+
378
+ message DateHistogramResults {
379
+ message DateHistogramResult {
380
+ string value = 1 [(.wix.api.maxLength) = 100]; // Date in ISO 8601 format
381
+ int32 count = 2; // Count of documents in the bucket
382
+ }
383
+ repeated DateHistogramResult results = 1 [(.wix.api.maxSize) = 200]; // List of date histogram aggregations
384
+ }
385
+
386
+ string name = 1 [(.wix.api.maxLength) = 100]; // User-defined name of aggregation as derived from search request
387
+ AggregationType type = 2; // Type of aggregation that must match provided kind as derived from search request
388
+ string field_path = 6 [(.wix.api.maxLength) = 200]; // Field to aggregate by as derived from search request
280
389
  oneof result {
281
- ValueResults values = 3;
282
- RangeResults ranges = 4;
283
- ScalarResult scalar = 5;
284
- GroupByValueResults grouped_by_value = 7;
390
+ ValueResults values = 3; // Value aggregation results
391
+ RangeResults ranges = 4; // Range aggregation results
392
+ ScalarResult scalar = 5; // Scalar aggregation results
393
+ GroupByValueResults grouped_by_value = 7; // Group by value aggregation results
394
+ DateHistogramResults date_histogram = 8; // Date histogram aggregation results
395
+ NestedResults nested = 9; // Nested aggregation results
285
396
  }
286
397
  }
287
398
 
288
- repeated AggregationResults results = 1; // key = aggregation name (as derived from search request)
399
+ repeated AggregationResults results = 1 [(.wix.api.maxSize) = 10000]; // key = aggregation name (as derived from search request)
289
400
  }
290
401
 
291
402
  /*
@@ -530,4 +641,128 @@ message ProductSearchResponse {
530
641
  } ]
531
642
  }
532
643
  }
644
+
645
+ // example of 2-level nested aggregation request:
646
+ {
647
+ "filter" : {
648
+ "region" : "EU"
649
+ },
650
+ "aggregations" : [ {
651
+ "name" : "my nested",
652
+ "type" : "NESTED",
653
+ "nested" : {
654
+ "nestedAggregations" : [ {
655
+ "name" : "daily",
656
+ "type" : "DATE_HISTOGRAM",
657
+ "fieldPath" : "date_updated",
658
+ "dateHistogram" : {
659
+ "interval" : "DAY"
660
+ }
661
+ }, {
662
+ "name" : "inventory status",
663
+ "type" : "VALUE",
664
+ "fieldPath" : "status",
665
+ "value" : { }
666
+ }, {
667
+ "name" : "sum",
668
+ "type" : "SCALAR",
669
+ "fieldPath" : "price",
670
+ "scalar" : {
671
+ "type" : "SUM"
672
+ }
673
+ } ]
674
+ }
675
+ } ]
676
+ }
677
+
678
+ // example of 2-level nested aggregation response:
679
+ {
680
+ "aggregations" : {
681
+ "results" : [ {
682
+ "name" : "my nested",
683
+ "type" : "NESTED",
684
+ "fieldPath" : "DUNNO WHAT TO DO WITH THIS",
685
+ "nested" : {
686
+ "results" : [ {
687
+ "results" : {
688
+ "daily" : {
689
+ "dateHistogram" : {
690
+ "value" : "2023.1.1"
691
+ }
692
+ },
693
+ "inventory status" : {
694
+ "value" : {
695
+ "value" : "SOLD",
696
+ "count" : 12
697
+ }
698
+ },
699
+ "sum" : {
700
+ "scalar" : {
701
+ "value" : 10.0
702
+ }
703
+ }
704
+ }
705
+ }, {
706
+ "results" : {
707
+ "daily" : {
708
+ "dateHistogram" : {
709
+ "value" : "2023.1.1"
710
+ }
711
+ },
712
+ "inventory status" : {
713
+ "value" : {
714
+ "value" : "NOT-SOLD",
715
+ "count" : 13
716
+ }
717
+ },
718
+ "sum" : {
719
+ "scalar" : {
720
+ "value" : 5.0
721
+ }
722
+ }
723
+ }
724
+ }, {
725
+ "results" : {
726
+ "daily" : {
727
+ "dateHistogram" : {
728
+ "value" : "2023.1.2"
729
+ }
730
+ },
731
+ "inventory status" : {
732
+ "value" : {
733
+ "value" : "SOLD",
734
+ "count" : 5
735
+ }
736
+ },
737
+ "sum" : {
738
+ "scalar" : {
739
+ "value" : 10.0
740
+ }
741
+ }
742
+ }
743
+ }, {
744
+ "results" : {
745
+ "daily" : {
746
+ "dateHistogram" : {
747
+ "value" : "2023.1.2"
748
+ }
749
+ },
750
+ "inventory status" : {
751
+ "value" : {
752
+ "value" : "NOT-SOLD",
753
+ "count" : 7
754
+ }
755
+ },
756
+ "sum" : {
757
+ "scalar" : {
758
+ "value" : 10.0
759
+ }
760
+ }
761
+ }
762
+ } ]
763
+ }
764
+ } ]
765
+ }
766
+ }
767
+
533
768
  */
@@ -4,6 +4,7 @@ package wix.common;
4
4
 
5
5
  import "wix/api/annotations.proto";
6
6
  import "wix/api/validations.proto";
7
+ import "google/protobuf/struct.proto";
7
8
 
8
9
  option java_multiple_files = true;
9
10
  option java_package = "com.wix.common";
@@ -14,12 +15,22 @@ message Sorting {
14
15
  field: "order"
15
16
  };
16
17
  // Name of the field to sort by.
17
- string field_name = 1;
18
+ string field_name = 1 [(.wix.api.maxLength) = 512];
18
19
  // Sort order.
19
20
  SortOrder order = 2;
21
+ // When `field_name` is a property of repeated field that is marked as `MATCH_ITEMS` and sort should be done by
22
+ // a specific element from a collection, filter can/should be provided to ensure correct sort value is picked.
23
+ //
24
+ // If multiple filters are provided, they are combined with AND operator.
25
+ //
26
+ // Example:
27
+ // Given we have document like {"id": "1", "nestedField": [{"price": 10, "region": "EU"}, {"price": 20, "region": "US"}]}
28
+ // and `nestedField` is marked as `MATCH_ITEMS`, to ensure that sorting is done by correct region, filter should be
29
+ // { fieldName: "nestedField.price", "select_items_by": [{"nestedField.region": "US"}] }
30
+ repeated google.protobuf.Struct select_items_by = 3 [(.wix.api.maxSize) = 10, (.wix.api.field_exposure) = PRIVATE];
20
31
  }
21
32
 
22
33
  enum SortOrder {
23
34
  ASC = 0;
24
35
  DESC = 1;
25
- }
36
+ }
@@ -36,7 +36,7 @@ message Tags {
36
36
  };
37
37
 
38
38
  message TagList {
39
- repeated string tag_ids = 1 [(.wix.api.maxSize) = 100, (.wix.api.format) = GUID]; // List of tag IDs
39
+ repeated string tag_ids = 1 [(.wix.api.maxSize) = 100, (.wix.api.maxLength) = 5]; // List of tag IDs
40
40
  }
41
41
  TagList private_tags = 1; // Tags that require an additional permission in order to access them, normally not given to site members or visitors.
42
42
  TagList tags = 2; // Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors.
@@ -49,7 +49,7 @@ message PublicTags {
49
49
  };
50
50
 
51
51
  message TagList {
52
- repeated string tag_ids = 1 [(.wix.api.maxSize) = 100, (.wix.api.format) = GUID]; // List of tag IDs
52
+ repeated string tag_ids = 1 [(.wix.api.maxSize) = 100, (.wix.api.maxLength) = 5]; // List of tag IDs
53
53
  }
54
54
  TagList tags = 2; // Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors.
55
55
  }