@wix/bex-utils 2.77.0 → 2.79.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 (77) hide show
  1. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/builders.impl.d.ts +22 -0
  2. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/builders.impl.js +275 -0
  3. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/builders.impl.js.map +1 -0
  4. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/http.impl.d.ts +50 -0
  5. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/http.impl.js +250 -0
  6. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/http.impl.js.map +1 -0
  7. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/meta.impl.d.ts +16 -0
  8. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/meta.impl.js +81 -0
  9. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/meta.impl.js.map +1 -0
  10. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/proto/client/proto-generated.d.ts +7116 -0
  11. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/proto/client/proto-generated.js +2 -0
  12. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/proto/proto-generated.d.ts +3557 -0
  13. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/proto/proto-generated.js +1 -0
  14. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/proto/server/proto-generated.d.ts +7113 -0
  15. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/proto/server/proto-generated.js +2 -0
  16. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/rpc.impl.d.ts +59 -0
  17. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/rpc.impl.js +109 -0
  18. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/rpc.impl.js.map +1 -0
  19. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/types.impl.d.ts +343 -0
  20. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/types.impl.js +42 -0
  21. package/@wix/ambassador-dealer-v1-offer-event/build/cjs/types.impl.js.map +1 -0
  22. package/@wix/ambassador-dealer-v1-offer-event/build/es/builders.impl.d.ts +22 -0
  23. package/@wix/ambassador-dealer-v1-offer-event/build/es/builders.impl.js +239 -0
  24. package/@wix/ambassador-dealer-v1-offer-event/build/es/builders.impl.js.map +1 -0
  25. package/@wix/ambassador-dealer-v1-offer-event/build/es/http.impl.d.ts +50 -0
  26. package/@wix/ambassador-dealer-v1-offer-event/build/es/http.impl.js +244 -0
  27. package/@wix/ambassador-dealer-v1-offer-event/build/es/http.impl.js.map +1 -0
  28. package/@wix/ambassador-dealer-v1-offer-event/build/es/meta.impl.d.ts +16 -0
  29. package/@wix/ambassador-dealer-v1-offer-event/build/es/meta.impl.js +56 -0
  30. package/@wix/ambassador-dealer-v1-offer-event/build/es/meta.impl.js.map +1 -0
  31. package/@wix/ambassador-dealer-v1-offer-event/build/es/rpc.impl.d.ts +59 -0
  32. package/@wix/ambassador-dealer-v1-offer-event/build/es/rpc.impl.js +84 -0
  33. package/@wix/ambassador-dealer-v1-offer-event/build/es/rpc.impl.js.map +1 -0
  34. package/@wix/ambassador-dealer-v1-offer-event/build/es/types.impl.d.ts +343 -0
  35. package/@wix/ambassador-dealer-v1-offer-event/build/es/types.impl.js +39 -0
  36. package/@wix/ambassador-dealer-v1-offer-event/build/es/types.impl.js.map +1 -0
  37. package/@wix/ambassador-dealer-v1-offer-event/builders/package.json +7 -0
  38. package/@wix/ambassador-dealer-v1-offer-event/http/package.json +7 -0
  39. package/@wix/ambassador-dealer-v1-offer-event/meta/package.json +7 -0
  40. package/@wix/ambassador-dealer-v1-offer-event/package.json +52 -0
  41. package/@wix/ambassador-dealer-v1-offer-event/rpc/package.json +6 -0
  42. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/action_payload.proto +33 -0
  43. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/annotations.proto +451 -0
  44. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/api_errors.proto +142 -0
  45. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/callback.proto +163 -0
  46. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/context.proto +19 -0
  47. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/entity.proto +127 -0
  48. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/errors.proto +127 -0
  49. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/idempotency.proto +25 -0
  50. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/permissions.proto +46 -0
  51. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/sla.proto +24 -0
  52. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/subscription.proto +32 -0
  53. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/api/validations.proto +142 -0
  54. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/address.proto +148 -0
  55. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/bulk.proto +53 -0
  56. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/identification.proto +40 -0
  57. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/image.proto +8 -0
  58. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/media.proto +280 -0
  59. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/money.proto +32 -0
  60. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/pageurl.proto +32 -0
  61. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/paging.proto +121 -0
  62. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/query.proto +799 -0
  63. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/sorting.proto +36 -0
  64. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/spi.proto +85 -0
  65. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/tags.proto +55 -0
  66. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/common/wixlink.proto +203 -0
  67. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/dealerOfferEvents/api/v1/dealer-offer-events.proto +211 -0
  68. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/dealerOfferEvents/api/v1/event.proto +131 -0
  69. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/graphql/definitions.proto +13 -0
  70. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/http/field_mask.proto +46 -0
  71. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/sdk/definitions.proto +191 -0
  72. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/spi/definitions.proto +187 -0
  73. package/@wix/ambassador-dealer-v1-offer-event/src/main/proto/wix/spi/http_error_status.proto +24 -0
  74. package/@wix/ambassador-dealer-v1-offer-event/types/package.json +7 -0
  75. package/@wix/bex-bundled-mini-essentials/CHANGELOG.md +4 -0
  76. package/@wix/bex-bundled-mini-essentials/package.json +1 -1
  77. package/package.json +5 -4
@@ -0,0 +1,799 @@
1
+ syntax = "proto3";
2
+
3
+ package wix.common;
4
+
5
+ import "google/protobuf/struct.proto";
6
+ import "google/protobuf/wrappers.proto";
7
+ import "wix/common/paging.proto";
8
+ import "wix/common/sorting.proto";
9
+ import "wix/api/annotations.proto";
10
+ import "wix/api/validations.proto";
11
+
12
+ option java_multiple_files = true;
13
+ option java_outer_classname = "QueryProto";
14
+ option java_package = "com.wix.common";
15
+
16
+ message Query {
17
+ option (.wix.api.decomposition_minimum_fields) = {
18
+ field: "filter"
19
+ field: "sort"
20
+ field: "paging"
21
+ };
22
+ //Filter object in the following format:
23
+ //`"filter" : {
24
+ // "fieldName1": "value1",
25
+ // "fieldName2":{"$operator":"value2"}
26
+ // }`
27
+ //Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
28
+ google.protobuf.Value filter = 1;
29
+ //Sort object in the following format:
30
+ //`[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
31
+ repeated Sorting sort = 2;
32
+ //Paging options to limit and skip the number of items.
33
+ Paging paging = 3;
34
+ //Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned.
35
+ repeated string fields = 4;
36
+ //Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned.
37
+ repeated string fieldsets = 5;
38
+ }
39
+
40
+ message QueryV2 {
41
+ option (.wix.api.decomposition_minimum_fields) = {
42
+ field: "filter"
43
+ field: "sort"
44
+ field: "paging"
45
+ };
46
+ option (.wix.api.decomposition_minimum_fields) = {
47
+ field: "filter"
48
+ field: "sort"
49
+ field: "cursor_paging"
50
+ };
51
+ // Filter object.
52
+ //
53
+ // Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).
54
+ google.protobuf.Struct filter = 1;
55
+ // Sort object.
56
+ //
57
+ // Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).
58
+ repeated Sorting sort = 2;
59
+ // Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned.
60
+ repeated string fields = 4;
61
+ //Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned.
62
+ repeated string fieldsets = 5;
63
+ oneof pagingMethod {
64
+ // Paging options to limit and offset the number of items.
65
+ Paging paging = 3;
66
+ // 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`.
67
+ CursorPaging cursor_paging = 6;
68
+ }
69
+ }
70
+
71
+ message CursorQuery {
72
+ option (.wix.api.decomposite_of) = "wix.common.QueryV2";
73
+ // Filter object.
74
+ //
75
+ // Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).
76
+ google.protobuf.Struct filter = 1;
77
+ // Sort object.
78
+ //
79
+ // Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).
80
+ repeated Sorting sort = 2 [(.wix.api.maxSize) = 5];
81
+ reserved 3;
82
+ reserved 4;
83
+ reserved 5;
84
+ oneof pagingMethod {
85
+ // Cursor paging options.
86
+ //
87
+ // Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
88
+ CursorPaging cursor_paging = 6;
89
+ }
90
+ }
91
+
92
+ message Search {
93
+ option (.wix.api.decomposition_minimum_fields) = {
94
+ field: "filter"
95
+ field: "sort"
96
+ field: "paging"
97
+ };
98
+ option (.wix.api.decomposition_minimum_fields) = {
99
+ field: "filter"
100
+ field: "sort"
101
+ field: "cursor_paging"
102
+ };
103
+ // Filter object.
104
+ //
105
+ // Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).
106
+ google.protobuf.Struct filter = 1;
107
+ // Sort object.
108
+ //
109
+ // Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).
110
+ repeated Sorting sort = 2 [(.wix.api.maxSize) = 10];
111
+ // Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned.
112
+ repeated string fields = 3 [(.wix.api.maxLength) = 200, (.wix.api.maxSize) = 20];
113
+ // Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned.
114
+ repeated string fieldsets = 4 [(.wix.api.maxLength) = 100, (.wix.api.maxSize) = 20];
115
+ // Logical groupings of data into facets, with summaries for each facet. For example, use aggregations to allow site visitors to narrow down their search results by selecting specific categories.
116
+ repeated Aggregation aggregations = 5 [(.wix.api.maxSize) = 10];
117
+ // Free text to match in searchable fields.
118
+ SearchDetails search = 6;
119
+ oneof paging_method {
120
+ // Paging options to limit and offset the number of items.
121
+ Paging paging = 7;
122
+ // 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.
123
+ CursorPaging cursor_paging = 8;
124
+ }
125
+ // Time zone to adjust date-time-based filters and aggregations, in ISO 8601 (including offsets) or IANA time zone database (including time zone IDs) format.
126
+ // Applies to all relevant filters and aggregations, unless overridden by providing timestamps including time zone. For example, "2023-12-20T10:52:34.795Z".
127
+ google.protobuf.StringValue time_zone = 9 [(.wix.api.maxLength) = 50];
128
+ }
129
+
130
+ message CursorSearch {
131
+ option (.wix.api.decomposite_of) = "wix.common.Search";
132
+ // Filter object.
133
+ //
134
+ // Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).
135
+ google.protobuf.Struct filter = 1;
136
+ // List of sort objects.
137
+ //
138
+ // Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).
139
+ repeated Sorting sort = 2 [(.wix.api.maxSize) = 10];
140
+ reserved 3;
141
+ reserved 4;
142
+ reserved 7;
143
+ // Logical groupings of data into facets, with summaries for each facet. For example, use aggregations to allow site visitors to narrow down their search results by selecting specific categories.
144
+ repeated Aggregation aggregations = 5 [(.wix.api.maxSize) = 10];
145
+ // Free text to match in searchable fields.
146
+ SearchDetails search = 6;
147
+ oneof paging_method {
148
+ // Cursor paging options.
149
+ //
150
+ // Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
151
+ CursorPaging cursor_paging = 8;
152
+ }
153
+ // Time zone to adjust date-time-based filters and aggregations, in ISO 8601 (including offsets) or IANA time zone database (including time zone IDs) format.
154
+ // Applies to all relevant filters and aggregations, unless overridden by providing timestamps including time zone. For example, "2023-12-20T10:52:34.795Z".
155
+ google.protobuf.StringValue time_zone = 9 [(.wix.api.maxLength) = 50];
156
+ }
157
+
158
+ message SearchRelated {
159
+ // List of entity IDs to search for related entities.
160
+ repeated string related_to_ids = 1 [(.wix.api.minSize) = 1, (.wix.api.maxSize) = 10, (.wix.api.maxLength) = 50];
161
+ // Search details.
162
+ SearchRelatedDetails search = 2;
163
+ // Filter object.
164
+ //
165
+ // Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).
166
+ google.protobuf.Struct filter = 3;
167
+ // List of sort objects.
168
+ // For example, `[{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}]`.
169
+ // Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).
170
+ repeated Sorting sort = 4 [(.wix.api.maxSize) = 10];
171
+ // Limit of related items to return.
172
+ google.protobuf.Int32Value limit = 5 [(.wix.api.max) = 100];
173
+ }
174
+
175
+ message SearchRelatedDetails {
176
+ google.protobuf.StringValue expression = 2 [(.wix.api.maxLength) = 100]; // Search term or expression.
177
+ // Fields to search in. If the array is empty, all searchable fields are searched. Use dot notation to specify a JSON path. For example, `order.address.streetName`.
178
+ repeated string fields = 3 [(.wix.api.maxLength) = 200, (.wix.api.maxSize) = 20];
179
+ }
180
+
181
+
182
+ message SearchDetails {
183
+ enum Mode {
184
+ OR = 0; // At least one of the search terms must be present.
185
+ AND = 1; // All search terms must be present.
186
+ }
187
+ Mode mode = 1; // Search mode. Defines the search logic for combining multiple terms in the `expression`.
188
+ google.protobuf.StringValue expression = 2 [(.wix.api.maxLength) = 100]; // Search term or expression.
189
+ // Fields to search in. If the array is empty, all searchable fields are searched. Use dot notation to specify a JSON path. For example, `order.address.streetName`.
190
+ repeated string fields = 3 [(.wix.api.maxLength) = 200, (.wix.api.maxSize) = 20];
191
+ /*
192
+ Whether to enable the search function to use an algorithm to automatically find results that are close to the search expression, such as typos and declensions.
193
+ */
194
+ bool fuzzy = 4;
195
+ }
196
+
197
+ enum AggregationType {
198
+ UNKNOWN_AGGREGATION_TYPE = 0 [(.wix.api.enum_maturity) = NOT_IMPLEMENTED];
199
+ VALUE = 1; // Calculates the distribution of a specific field's values within a dataset, providing insights into the overall distribution and key statistics of those values.
200
+ RANGE = 2; // Calculates the count of the values from the specified field in the dataset that fall within the range of each bucket you define.
201
+ SCALAR = 3; // Calculates a single numerical value from a dataset, summarizing the dataset into one key metric: `COUNT_DISTINCT`, `SUM`, `AVG`, `MIN`, or `MAX`.
202
+ DATE_HISTOGRAM = 4; // Calculates the count of time values from the specified field in the dataset that fall within each time interval you define (hour, day, week, etc.).
203
+ NESTED = 5; // Flattened list of aggregations, where each aggregation is nested within previous one.
204
+ }
205
+
206
+ enum ScalarType {
207
+ UNKNOWN_SCALAR_TYPE = 0 [(.wix.api.enum_maturity) = NOT_IMPLEMENTED];
208
+ COUNT_DISTINCT = 1; // Total number of distinct values.
209
+ MIN = 2; // Minimum value.
210
+ MAX = 3; // Maximum value.
211
+ SUM = 4 [(.wix.api.enum_exposure) = PRIVATE]; // Sum of values.
212
+ AVG = 5 [(.wix.api.enum_exposure) = PRIVATE]; // Average of values.
213
+ }
214
+
215
+ message Aggregation {
216
+ message RangeAggregation {
217
+ message RangeBucket {
218
+ google.protobuf.DoubleValue from = 1; // Inclusive lower bound of the range. Required if `to` is not provided.
219
+ google.protobuf.DoubleValue to = 2; // Exclusive upper bound of the range. Required if `from` is not provided.
220
+ }
221
+ // List of range buckets. During aggregation each entity is placed in the first bucket its value falls into, based on the provided range bounds.
222
+ repeated RangeBucket buckets = 1 [(.wix.api.maxSize) = 50];
223
+ }
224
+
225
+ message ValueAggregation {
226
+ enum SortType {
227
+ COUNT = 0; // Number of matches in the results.
228
+ VALUE = 1; // Alphabetically by the field value.
229
+ }
230
+ enum SortDirection {
231
+ DESC = 0; // Descending order.
232
+ ASC = 1; // Ascending order.
233
+ }
234
+
235
+ enum MissingValues {
236
+ EXCLUDE = 0; // Exclude missing values from the aggregation results.
237
+ INCLUDE = 1; // Include missing values in the aggregation results.
238
+ }
239
+
240
+ message IncludeMissingValuesOptions {
241
+ string add_to_bucket = 1 [(.wix.api.maxLength) = 20]; // Specify a custom name for the bucket containing the missing values. Defaults are `"N/A"` for strings, `0` for integers, and `false` for booleans.
242
+ }
243
+
244
+ SortType sort_type = 1; // Sort type.
245
+ SortDirection sort_direction = 2; // Sort direction.
246
+ // Number of aggregation results to return.
247
+ // Min: `1`
248
+ // Max: `250`
249
+ // Default: `10`
250
+ google.protobuf.Int32Value limit = 3;
251
+
252
+ /*
253
+ Whether to include or exclude missing values in the aggregation results.
254
+ Default: `EXCLUDE`.
255
+ */
256
+ MissingValues missing_values = 4;
257
+ oneof options {
258
+ option (.wix.api.aligned_with_enum).field = "missing_values";
259
+ IncludeMissingValuesOptions include_options = 5; // Options for including missing values in results.
260
+ }
261
+ }
262
+
263
+ message ScalarAggregation {
264
+ ScalarType type = 1; // Operator type for the scalar aggregation.
265
+ }
266
+
267
+ message GroupByAggregation {
268
+ google.protobuf.StringValue name = 1 [(.wix.api.maxLength) = 100]; // Unique, caller-defined aggregation name, returned in `aggregations.results`.
269
+ string field_path = 3 [(.wix.api.maxLength) = 200]; // Field to aggregate by.
270
+ oneof kind {
271
+ ValueAggregation value = 4; // Value aggregation configuration.
272
+ }
273
+ }
274
+
275
+ // Nested aggregation expressed through a list of aggregation where each next aggregation is nested within previous one.
276
+ message NestedAggregation {
277
+ reserved 1;
278
+
279
+ enum NestedAggregationType {
280
+ UNKNOWN_AGGREGATION_TYPE = 0 [(.wix.api.enum_maturity) = NOT_IMPLEMENTED];
281
+ VALUE = 1; // Calculates the distribution of a specific field's values within a dataset, providing insights into the overall distribution and key statistics of those values.
282
+ RANGE = 2; // Calculates the count of the values from the specified field in the dataset that fall within the range of each bucket you define.
283
+ SCALAR = 3; // Calculates a single numerical value from a dataset, summarizing the dataset into one key metric: `COUNT_DISTINCT`, `SUM`, `AVG`, `MIN`, or `MAX`.
284
+ DATE_HISTOGRAM = 4; // Calculates the count of time values from the specified field in the dataset that fall within each time interval you define (hour, day, week, etc.).
285
+ }
286
+
287
+ message NestedAggregationItem {
288
+ google.protobuf.StringValue name = 1 [(.wix.api.maxLength) = 100]; // Unique, caller-defined aggregation name, returned in `aggregations.results`.
289
+ NestedAggregationType type = 2; // Type of aggregation to perform. The matching aggregation field must be passed.
290
+ string field_path = 3 [(.wix.api.maxLength) = 200]; // Field to aggregate by. Use dot notation to specify a JSON path. For example, `order.address.streetName`.
291
+ oneof kind {
292
+ ValueAggregation value = 4; // A value aggregation calculates the distribution of a specific field's values within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number (count) of orders for each order status.
293
+ RangeAggregation range = 5; // A range aggregation calculates the count of the values from the specified field in the dataset that fall within the range of each bucket you define. For example, use a range aggregation to compare the number of reservations made for parties of 4 or less to the number of reservations made for parties with 5 or more. If ranges overlap, a record that fits more than one range will only be counted in the first range that matches the criteria.
294
+ ScalarAggregation scalar = 6; // A scalar aggregation calculates a single numerical value from a dataset, summarizing the dataset into one key metric: `COUNT_DISTINCT`, `SUM`, `AVG`, `MIN`, or `MAX`.
295
+ DateHistogramAggregation date_histogram = 9; // A date histogram calculates the count of time values from the specified field in the dataset that fall within each time interval you define (hour, day, week, etc.). For example, use a date histogram to determine how many reservations have been made at a restaurant each week. If ranges overlap, a record that fits more than one range will only be counted in the first range that matches the criteria.
296
+ }
297
+ }
298
+
299
+ // Flattened list of aggregations, where each aggregation is nested within previous one.
300
+ repeated NestedAggregationItem nested_aggregations = 2 [(.wix.api.minSize) = 2, (.wix.api.maxSize) = 3];
301
+ }
302
+
303
+ message DateHistogramAggregation {
304
+ enum Interval {
305
+ UNKNOWN_INTERVAL = 0 [(.wix.api.enum_maturity) = NOT_IMPLEMENTED];
306
+ YEAR = 1;
307
+ MONTH = 2;
308
+ WEEK = 3;
309
+ DAY = 4;
310
+ HOUR = 5;
311
+ MINUTE = 6;
312
+ SECOND = 7;
313
+ }
314
+
315
+ Interval interval = 1; // Interval for date histogram aggregation.
316
+ }
317
+
318
+ google.protobuf.StringValue name = 1 [(.wix.api.maxLength) = 100]; // Aggregation name, returned in `aggregations.results.name`.
319
+ AggregationType type = 2; // Type of aggregation to perform. Must align with the corresponding aggregation field.
320
+ string field_path = 3 [(.wix.api.maxLength) = 200]; // Field to aggregate by. Use dot notation to specify a JSON path. For example, `order.address.streetName`.
321
+ oneof kind {
322
+ ValueAggregation value = 4; // A value aggregation calculates metrics such as count for specific fields within a dataset, providing insights into the overall distribution and key statistics of those values. For example, use a value aggregation to get the number (count) of products for each price listed in the store.
323
+ RangeAggregation range = 5; // A range aggregation calculates the count of the values from the specified field in the dataset that fall within the range of each bucket you define. For example, use a range aggregation to compare the number of reservations made for parties of 4 or less to the number of reservations made for parties with 5 or more.
324
+ ScalarAggregation scalar = 6; // A scalar aggregation calculates a single numerical value from a dataset, summarizing the dataset into one key metric: `COUNT_DISTINCT`, `SUM`, `AVG`, `MIN`, or `MAX`.
325
+ DateHistogramAggregation date_histogram = 9; // A date histogram calculates the count of time values from the specified field in the dataset that fall within each time interval you define (hour, day, week, etc.) For example, use a date histogram to find how many reservations have been made at a restaurant each week.
326
+ NestedAggregation nested = 8; // A nested aggregation is applied within the results of another aggregation. Rather than aggregating directly on the primary dataset, first group data using one aggregation and then apply another aggregation within each group. It allows for more complex analyses where you can summarize data at different levels of detail or hierarchy. For example, to get the number of products that are in stock and out of stock for each price listed, first perform a value aggregation on `discountedPriceNumeric`, and a second value aggregation on `inStock`.
327
+ }
328
+
329
+ // Deprecated. Use `nested` instead.
330
+ GroupByAggregation group_by = 7 [deprecated = true, (.wix.api.field_deprecated) = {replaced_by: "kind.nested", target_removal_date: "2024-03-30"}];
331
+ }
332
+
333
+ message AggregationData {
334
+ message AggregationResults {
335
+ message ValueResults {
336
+ message ValueAggregationResult {
337
+ string value = 1 [(.wix.api.maxLength) = 100]; // Value of the field.
338
+ int32 count = 2; // Number of entities with this value.
339
+ }
340
+ repeated ValueAggregationResult results = 1 [(.wix.api.maxSize) = 250]; // List of value aggregations.
341
+ }
342
+
343
+ message RangeResults {
344
+ message RangeAggregationResult {
345
+ google.protobuf.DoubleValue from = 1; // Inclusive lower bound of the range.
346
+ google.protobuf.DoubleValue to = 2; // Exclusive upper bound of the range.
347
+ int32 count = 3; // Total number of entities in this range.
348
+ }
349
+ repeated RangeAggregationResult results = 1 [(.wix.api.maxSize) = 50]; // List of ranges returned in the same order as requested.
350
+ }
351
+
352
+ message ScalarResult {
353
+ ScalarType type = 1; // Type of scalar aggregation.
354
+ double value = 2; // Value of the scalar aggregation.
355
+ }
356
+
357
+ message GroupByValueResults {
358
+ message NestedValueAggregationResult {
359
+ string value = 1 [(.wix.api.maxLength) = 1000]; // Value of the field.
360
+ NestedAggregationResults nested_results = 2; // Nested aggregations.
361
+
362
+ }
363
+ repeated NestedValueAggregationResult results = 1 [(.wix.api.maxSize) = 1000]; // List of value aggregations.
364
+ }
365
+
366
+ message NestedAggregationResults {
367
+ string name = 1 [(.wix.api.maxLength) = 100]; // Unique, caller-defined aggregation name, identifiable by the requested aggregation `name`.
368
+ AggregationType type = 2; // Aggregation type.
369
+ string field_path = 6 [(.wix.api.maxLength) = 200]; // Field which the data was aggregated by.
370
+ oneof result {
371
+ ValueResults values = 3; // Value aggregation results.
372
+ RangeResults ranges = 4; // Range aggregation results.
373
+ ScalarResult scalar = 5; // Scalar aggregation results.
374
+ }
375
+ }
376
+
377
+ // Results of `NESTED` aggregation type in a flattened array, identifiable by the requested aggregation `name`.
378
+ message NestedResults {
379
+ message ValueResult {
380
+ string value = 1 [(.wix.api.maxLength) = 1000]; // Value of the field.
381
+ google.protobuf.Int32Value count = 2; // Number of entities with this value.
382
+ }
383
+ message RangeResult {
384
+ google.protobuf.DoubleValue from = 1; // Inclusive lower bound of the range.
385
+ google.protobuf.DoubleValue to = 2; // Exclusive upper bound of the range.
386
+ google.protobuf.Int32Value count = 3; // Number of entities in this range.
387
+ }
388
+
389
+ message ScalarResult {
390
+ double value = 1; // Value of the scalar aggregation.
391
+ }
392
+
393
+ message NestedResultValue {
394
+ oneof result {
395
+ ValueResult value = 1; // Value aggregation result.
396
+ RangeResult range = 2; // Range aggregation result.
397
+ ScalarResult scalar = 3; // Scalar aggregation result.
398
+ ValueResult date_histogram = 4; // Date histogram aggregation result.
399
+ }
400
+ }
401
+
402
+ message Results {
403
+ map<string, NestedResultValue> results = 1; // List of nested aggregations.
404
+ }
405
+
406
+ repeated Results results = 1 [(.wix.api.maxSize) = 1000]; // List of nested aggregations.
407
+ }
408
+
409
+ message DateHistogramResults {
410
+ message DateHistogramResult {
411
+ string value = 1 [(.wix.api.maxLength) = 100]; // Date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
412
+ int32 count = 2; // Number of entities in the bucket.
413
+ }
414
+ repeated DateHistogramResult results = 1 [(.wix.api.maxSize) = 200]; // List of date histogram aggregations.
415
+ }
416
+
417
+ string name = 1 [(.wix.api.maxLength) = 100]; // Aggregation name, returned in `aggregations.results.name`.
418
+ AggregationType type = 2; // Aggregation type. Must align with the corresponding aggregation field.
419
+ string field_path = 6 [(.wix.api.maxLength) = 200]; // Field to aggregate by. Use dot notation to specify a JSON path. For example, `order.address.streetName`.
420
+ oneof result {
421
+ ValueResults values = 3; // Value aggregation results.
422
+ RangeResults ranges = 4; // Range aggregation results.
423
+ ScalarResult scalar = 5; // Scalar aggregation results.
424
+ GroupByValueResults grouped_by_value = 7; // Group by value aggregation results.
425
+ DateHistogramResults date_histogram = 8; // Date histogram aggregation results.
426
+ NestedResults nested = 9; // Nested aggregation results.
427
+ }
428
+ }
429
+
430
+ repeated AggregationResults results = 1 [(.wix.api.maxSize) = 10000]; // List of the aggregated data results.
431
+ }
432
+
433
+ /*
434
+ // Usage example in response composition:
435
+ message ProductSearchResponse {
436
+ AggregationData aggregations = 1;
437
+ PagingMetadataV2 metadata = 2;
438
+ repeated Product products = 3;
439
+ }
440
+
441
+ // example Value type Request:
442
+ {
443
+ search: {
444
+ expression: "term"
445
+ },
446
+ aggregations: [
447
+ {
448
+ name: "my-value-aggregation",
449
+ type: "VALUE",
450
+ fieldPath: "path.to.field",
451
+ value: {
452
+ sort_type: "VALUE",
453
+ sort_direction: "DESC",
454
+ limit: 15
455
+ }
456
+ }
457
+ ]
458
+ }
459
+
460
+ // example Value type Response:
461
+ {
462
+ aggregations: {
463
+ results: [
464
+ {
465
+ name: "my-value-aggregation",
466
+ type: "VALUE",
467
+ values: {
468
+ results: [
469
+ {
470
+ value: "v1",
471
+ count: 9
472
+ },
473
+ {
474
+ value: "v2",
475
+ count: 6
476
+ }
477
+ ]
478
+ }
479
+ }
480
+ ]
481
+ },
482
+ metadata: {
483
+ items: 25,
484
+ offset: 25,
485
+ total: 420,
486
+ tooManyToCount: false,
487
+ cursors: {
488
+ next: "SOMEHASHFORNEXT",
489
+ prev: "SOMEHASHFORPREV"
490
+ }
491
+ },
492
+ products: [...]
493
+ }
494
+
495
+ // example Range type Request:
496
+ {
497
+ search: {
498
+ expression: "term"
499
+ },
500
+ aggregations: [
501
+ {
502
+ name: "my-range-aggregation",
503
+ type: "RANGE",
504
+ fieldPath: "path.to.field",
505
+ range: {
506
+ buckets: [
507
+ {
508
+ to: 10
509
+ },
510
+ {
511
+ from: 10,
512
+ to: 20
513
+ },
514
+ {
515
+ from: 20
516
+ }
517
+ ]
518
+ }
519
+ }
520
+ ]
521
+ }
522
+
523
+ // example Range type Response:
524
+ {
525
+ aggregations: {
526
+ results: [
527
+ {
528
+ name: "my-range-aggregation",
529
+ type: "RANGE",
530
+ ranges: {
531
+ results: [
532
+ {
533
+ to: 10,
534
+ count: 5
535
+ },
536
+ {
537
+ from: 10,
538
+ to: 20,
539
+ count: 3
540
+ },
541
+ {
542
+ from: 20,
543
+ count: 1
544
+ }
545
+ ]
546
+ }
547
+ }
548
+ ]
549
+ },
550
+ metadata: {
551
+ items: 25,
552
+ offset: 25,
553
+ total: 420,
554
+ tooManyToCount: false,
555
+ cursors: {
556
+ next: "SOMEHASHFORNEXT",
557
+ prev: "SOMEHASHFORPREV"
558
+ }
559
+ },
560
+ products: [...]
561
+ }
562
+
563
+ // example Scalar type Request:
564
+ {
565
+ search: {
566
+ expression: "term"
567
+ },
568
+ aggregations: [
569
+ {
570
+ name: "my-scalar-aggregation",
571
+ type: "SCALAR",
572
+ fieldPath: "path.to.field",
573
+ scalar: {
574
+ type: "AVG"
575
+ }
576
+ }
577
+ ]
578
+ }
579
+
580
+ // example Scalar type Response:
581
+ {
582
+ aggregations: {
583
+ results: [
584
+ {
585
+ name: "my-scalar-agregation",
586
+ type: "SCALAR",
587
+ scalar: {
588
+ type: "AVG",
589
+ value: 5.555
590
+ }
591
+ }
592
+ ]
593
+ },
594
+ metadata: {
595
+ items: 25,
596
+ offset: 25,
597
+ total: 420,
598
+ tooManyToCount: false,
599
+ cursors: {
600
+ next: "SOMEHASHFORNEXT",
601
+ prev: "SOMEHASHFORPREV"
602
+ }
603
+ },
604
+ products: [...]
605
+ }
606
+
607
+ // example Group By Aggregation Request:
608
+ {
609
+ "filter" : {
610
+ "region" : "EU"
611
+ },
612
+ "aggregations" : [ {
613
+ "name" : "production countries",
614
+ "type" : "VALUE",
615
+ "fieldPath" : "production_countries",
616
+ "value" : {
617
+ "limit" : 5
618
+ },
619
+ "groupBy" : {
620
+ "name" : "production companies",
621
+ "fieldPath" : "production_companies",
622
+ "value" : { }
623
+ }
624
+ } ]
625
+ }
626
+
627
+ // example Group By Aggregation Response:
628
+ {
629
+ "aggregations" : {
630
+ "results" : [ {
631
+ "name" : "production companies",
632
+ "type" : "VALUE",
633
+ "fieldPath" : "production_companies",
634
+ "groupedByValue" : {
635
+ "results" : [ {
636
+ "value" : "Warner Bros.",
637
+ "nestedResults" : {
638
+ "name" : "production countries",
639
+ "type" : "VALUE",
640
+ "fieldPath" : "production_countries",
641
+ "values" : {
642
+ "results" : [ {
643
+ "value" : "GB",
644
+ "count" : 221
645
+ }, {
646
+ "value" : "PL",
647
+ "count" : 12
648
+ } ]
649
+ }
650
+ }
651
+ }, {
652
+ "value" : "Metro-Goldwyn-Mayer (MGM)",
653
+ "nestedResults" : {
654
+ "name" : "production countries",
655
+ "type" : "VALUE",
656
+ "fieldPath" : "production_countries",
657
+ "values" : {
658
+ "results" : [ {
659
+ "value" : "SWE",
660
+ "count" : 24
661
+ }, {
662
+ "value" : "FR",
663
+ "count" : 18
664
+ }, {
665
+ "value" : "LT",
666
+ "count" : 2
667
+ } ]
668
+ }
669
+ }
670
+ } ]
671
+ }
672
+ } ]
673
+ }
674
+ }
675
+
676
+ // example of 2-level nested aggregation request:
677
+ {
678
+ "filter" : {
679
+ "region" : "EU"
680
+ },
681
+ "aggregations" : [ {
682
+ "name" : "my nested",
683
+ "type" : "NESTED",
684
+ "nested" : {
685
+ "nestedAggregations" : [ {
686
+ "name" : "daily",
687
+ "type" : "DATE_HISTOGRAM",
688
+ "fieldPath" : "date_updated",
689
+ "dateHistogram" : {
690
+ "interval" : "DAY"
691
+ }
692
+ }, {
693
+ "name" : "inventory status",
694
+ "type" : "VALUE",
695
+ "fieldPath" : "status",
696
+ "value" : { }
697
+ }, {
698
+ "name" : "sum",
699
+ "type" : "SCALAR",
700
+ "fieldPath" : "price",
701
+ "scalar" : {
702
+ "type" : "SUM"
703
+ }
704
+ } ]
705
+ }
706
+ } ]
707
+ }
708
+
709
+ // example of 2-level nested aggregation response:
710
+ {
711
+ "aggregations" : {
712
+ "results" : [ {
713
+ "name" : "my nested",
714
+ "type" : "NESTED",
715
+ "fieldPath" : "DUNNO WHAT TO DO WITH THIS",
716
+ "nested" : {
717
+ "results" : [ {
718
+ "results" : {
719
+ "daily" : {
720
+ "dateHistogram" : {
721
+ "value" : "2023.1.1"
722
+ }
723
+ },
724
+ "inventory status" : {
725
+ "value" : {
726
+ "value" : "SOLD",
727
+ "count" : 12
728
+ }
729
+ },
730
+ "sum" : {
731
+ "scalar" : {
732
+ "value" : 10.0
733
+ }
734
+ }
735
+ }
736
+ }, {
737
+ "results" : {
738
+ "daily" : {
739
+ "dateHistogram" : {
740
+ "value" : "2023.1.1"
741
+ }
742
+ },
743
+ "inventory status" : {
744
+ "value" : {
745
+ "value" : "NOT-SOLD",
746
+ "count" : 13
747
+ }
748
+ },
749
+ "sum" : {
750
+ "scalar" : {
751
+ "value" : 5.0
752
+ }
753
+ }
754
+ }
755
+ }, {
756
+ "results" : {
757
+ "daily" : {
758
+ "dateHistogram" : {
759
+ "value" : "2023.1.2"
760
+ }
761
+ },
762
+ "inventory status" : {
763
+ "value" : {
764
+ "value" : "SOLD",
765
+ "count" : 5
766
+ }
767
+ },
768
+ "sum" : {
769
+ "scalar" : {
770
+ "value" : 10.0
771
+ }
772
+ }
773
+ }
774
+ }, {
775
+ "results" : {
776
+ "daily" : {
777
+ "dateHistogram" : {
778
+ "value" : "2023.1.2"
779
+ }
780
+ },
781
+ "inventory status" : {
782
+ "value" : {
783
+ "value" : "NOT-SOLD",
784
+ "count" : 7
785
+ }
786
+ },
787
+ "sum" : {
788
+ "scalar" : {
789
+ "value" : 10.0
790
+ }
791
+ }
792
+ }
793
+ } ]
794
+ }
795
+ } ]
796
+ }
797
+ }
798
+
799
+ */