@sitecore-cloudsdk/search 0.5.0-rc.0 → 0.5.1-rc.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 (169) hide show
  1. package/dist/cjs/package.json +4 -4
  2. package/dist/cjs/src/lib/consts.d.ts +1 -0
  3. package/dist/cjs/src/lib/consts.js +2 -1
  4. package/dist/cjs/src/lib/events/base-widget-event.d.ts +38 -0
  5. package/dist/cjs/src/lib/events/base-widget-event.js +48 -0
  6. package/dist/cjs/src/lib/events/entity-view-event.d.ts +8 -8
  7. package/dist/cjs/src/lib/events/entity-view-event.js +10 -20
  8. package/dist/cjs/src/lib/events/interfaces.d.ts +20 -40
  9. package/dist/cjs/src/lib/events/widget-facet-click-event.d.ts +17 -8
  10. package/dist/cjs/src/lib/events/widget-facet-click-event.js +19 -20
  11. package/dist/cjs/src/lib/events/widget-item-click-event.d.ts +7 -8
  12. package/dist/cjs/src/lib/events/widget-item-click-event.js +9 -20
  13. package/dist/cjs/src/lib/events/widget-navigation-click-event.d.ts +7 -8
  14. package/dist/cjs/src/lib/events/widget-navigation-click-event.js +9 -20
  15. package/dist/cjs/src/lib/events/widget-suggestion-click-event.d.ts +15 -8
  16. package/dist/cjs/src/lib/events/widget-suggestion-click-event.js +17 -20
  17. package/dist/cjs/src/lib/events/widget-view-event.d.ts +15 -8
  18. package/dist/cjs/src/lib/events/widget-view-event.js +17 -20
  19. package/dist/cjs/src/lib/initializer/browser/initializer.d.ts +6 -0
  20. package/dist/cjs/src/lib/initializer/browser/initializer.js +7 -0
  21. package/dist/cjs/src/lib/initializer/server/initializer.d.ts +4 -0
  22. package/dist/cjs/src/lib/initializer/server/initializer.js +4 -0
  23. package/dist/cjs/src/lib/request-entities/context/context.d.ts +24 -24
  24. package/dist/cjs/src/lib/request-entities/context/context.js +24 -24
  25. package/dist/cjs/src/lib/request-entities/filters/base-filter.d.ts +1 -1
  26. package/dist/cjs/src/lib/request-entities/filters/base-filter.js +1 -1
  27. package/dist/cjs/src/lib/request-entities/filters/comparison-filter.d.ts +2 -2
  28. package/dist/cjs/src/lib/request-entities/filters/comparison-filter.js +2 -2
  29. package/dist/cjs/src/lib/request-entities/filters/facet/comparison-facet-filter.d.ts +2 -2
  30. package/dist/cjs/src/lib/request-entities/filters/facet/comparison-facet-filter.js +2 -2
  31. package/dist/cjs/src/lib/request-entities/filters/facet/list-facet-filter.d.ts +3 -3
  32. package/dist/cjs/src/lib/request-entities/filters/facet/list-facet-filter.js +3 -3
  33. package/dist/cjs/src/lib/request-entities/filters/facet/logical-facet-filter.d.ts +3 -3
  34. package/dist/cjs/src/lib/request-entities/filters/facet/logical-facet-filter.js +3 -3
  35. package/dist/cjs/src/lib/request-entities/filters/facet/not-facet-filter.d.ts +7 -0
  36. package/dist/cjs/src/lib/request-entities/filters/facet/not-facet-filter.js +7 -0
  37. package/dist/cjs/src/lib/request-entities/filters/geo-filter.d.ts +7 -2
  38. package/dist/cjs/src/lib/request-entities/filters/geo-filter.js +7 -2
  39. package/dist/cjs/src/lib/request-entities/filters/geo-within-filter.d.ts +8 -2
  40. package/dist/cjs/src/lib/request-entities/filters/geo-within-filter.js +8 -2
  41. package/dist/cjs/src/lib/request-entities/filters/list-filter.d.ts +3 -3
  42. package/dist/cjs/src/lib/request-entities/filters/list-filter.js +3 -3
  43. package/dist/cjs/src/lib/request-entities/filters/logical-filter.d.ts +3 -2
  44. package/dist/cjs/src/lib/request-entities/filters/logical-filter.js +3 -2
  45. package/dist/cjs/src/lib/request-entities/widgets/interfaces.d.ts +2 -0
  46. package/dist/cjs/src/lib/request-entities/widgets/questions-answers-widget-item.d.ts +22 -6
  47. package/dist/cjs/src/lib/request-entities/widgets/questions-answers-widget-item.js +22 -6
  48. package/dist/cjs/src/lib/request-entities/widgets/recommendation-widget-item.d.ts +10 -4
  49. package/dist/cjs/src/lib/request-entities/widgets/recommendation-widget-item.js +10 -4
  50. package/dist/cjs/src/lib/request-entities/widgets/results-widget-item.d.ts +11 -5
  51. package/dist/cjs/src/lib/request-entities/widgets/results-widget-item.js +11 -5
  52. package/dist/cjs/src/lib/request-entities/widgets/rule-widget-item.d.ts +35 -0
  53. package/dist/cjs/src/lib/request-entities/widgets/rule-widget-item.js +35 -0
  54. package/dist/cjs/src/lib/request-entities/widgets/search-widget-item.d.ts +70 -28
  55. package/dist/cjs/src/lib/request-entities/widgets/search-widget-item.js +77 -28
  56. package/dist/cjs/src/lib/request-entities/widgets/utils.d.ts +1 -1
  57. package/dist/cjs/src/lib/request-entities/widgets/utils.js +1 -1
  58. package/dist/cjs/src/lib/request-entities/widgets/widget-item.d.ts +20 -5
  59. package/dist/cjs/src/lib/request-entities/widgets/widget-item.js +20 -5
  60. package/dist/cjs/src/lib/request-entities/widgets/widget-request-data.d.ts +6 -1
  61. package/dist/cjs/src/lib/request-entities/widgets/widget-request-data.js +6 -1
  62. package/dist/cjs/src/lib/requests/browser/get-page-widget-data.d.ts +5 -4
  63. package/dist/cjs/src/lib/requests/browser/get-page-widget-data.js +5 -0
  64. package/dist/cjs/src/lib/requests/browser/get-widget-data.d.ts +1 -1
  65. package/dist/cjs/src/lib/requests/browser/get-widget-data.js +1 -1
  66. package/dist/cjs/src/lib/requests/post-request.d.ts +10 -6
  67. package/dist/cjs/src/lib/requests/post-request.js +2 -1
  68. package/dist/cjs/src/lib/requests/server/entity-view-event-server.d.ts +1 -1
  69. package/dist/cjs/src/lib/requests/server/entity-view-event-server.js +1 -1
  70. package/dist/cjs/src/lib/requests/server/get-page-widget-data-server.d.ts +3 -3
  71. package/dist/cjs/src/lib/requests/server/get-page-widget-data-server.js +5 -0
  72. package/dist/cjs/src/lib/requests/server/get-widget-data-server.d.ts +1 -1
  73. package/dist/cjs/src/lib/requests/server/get-widget-data-server.js +1 -1
  74. package/dist/cjs/src/lib/requests/server/widget-facet-click-event-server.d.ts +1 -1
  75. package/dist/cjs/src/lib/requests/server/widget-facet-click-event-server.js +1 -1
  76. package/dist/cjs/src/lib/requests/server/widget-item-click-event-server.d.ts +1 -1
  77. package/dist/cjs/src/lib/requests/server/widget-item-click-event-server.js +1 -1
  78. package/dist/cjs/src/lib/requests/server/widget-navigation-click-event-server.d.ts +1 -1
  79. package/dist/cjs/src/lib/requests/server/widget-navigation-click-event-server.js +1 -1
  80. package/dist/cjs/src/lib/requests/server/widget-suggestion-click-event-server.d.ts +1 -1
  81. package/dist/cjs/src/lib/requests/server/widget-suggestion-click-event-server.js +1 -1
  82. package/dist/cjs/src/lib/requests/server/widget-view-event-server.d.ts +1 -1
  83. package/dist/cjs/src/lib/requests/server/widget-view-event-server.js +1 -1
  84. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  85. package/dist/esm/package.json +4 -4
  86. package/dist/esm/src/lib/consts.d.ts +1 -0
  87. package/dist/esm/src/lib/consts.js +1 -0
  88. package/dist/esm/src/lib/events/base-widget-event.d.ts +38 -0
  89. package/dist/esm/src/lib/events/base-widget-event.js +44 -0
  90. package/dist/esm/src/lib/events/entity-view-event.d.ts +8 -8
  91. package/dist/esm/src/lib/events/entity-view-event.js +10 -20
  92. package/dist/esm/src/lib/events/interfaces.d.ts +20 -40
  93. package/dist/esm/src/lib/events/widget-facet-click-event.d.ts +17 -8
  94. package/dist/esm/src/lib/events/widget-facet-click-event.js +19 -20
  95. package/dist/esm/src/lib/events/widget-item-click-event.d.ts +7 -8
  96. package/dist/esm/src/lib/events/widget-item-click-event.js +9 -20
  97. package/dist/esm/src/lib/events/widget-navigation-click-event.d.ts +7 -8
  98. package/dist/esm/src/lib/events/widget-navigation-click-event.js +9 -20
  99. package/dist/esm/src/lib/events/widget-suggestion-click-event.d.ts +15 -8
  100. package/dist/esm/src/lib/events/widget-suggestion-click-event.js +17 -20
  101. package/dist/esm/src/lib/events/widget-view-event.d.ts +15 -8
  102. package/dist/esm/src/lib/events/widget-view-event.js +17 -20
  103. package/dist/esm/src/lib/initializer/browser/initializer.d.ts +6 -0
  104. package/dist/esm/src/lib/initializer/browser/initializer.js +8 -1
  105. package/dist/esm/src/lib/initializer/server/initializer.d.ts +4 -0
  106. package/dist/esm/src/lib/initializer/server/initializer.js +4 -0
  107. package/dist/esm/src/lib/request-entities/context/context.d.ts +24 -24
  108. package/dist/esm/src/lib/request-entities/context/context.js +24 -24
  109. package/dist/esm/src/lib/request-entities/filters/base-filter.d.ts +1 -1
  110. package/dist/esm/src/lib/request-entities/filters/base-filter.js +1 -1
  111. package/dist/esm/src/lib/request-entities/filters/comparison-filter.d.ts +2 -2
  112. package/dist/esm/src/lib/request-entities/filters/comparison-filter.js +2 -2
  113. package/dist/esm/src/lib/request-entities/filters/facet/comparison-facet-filter.d.ts +2 -2
  114. package/dist/esm/src/lib/request-entities/filters/facet/comparison-facet-filter.js +2 -2
  115. package/dist/esm/src/lib/request-entities/filters/facet/list-facet-filter.d.ts +3 -3
  116. package/dist/esm/src/lib/request-entities/filters/facet/list-facet-filter.js +3 -3
  117. package/dist/esm/src/lib/request-entities/filters/facet/logical-facet-filter.d.ts +3 -3
  118. package/dist/esm/src/lib/request-entities/filters/facet/logical-facet-filter.js +3 -3
  119. package/dist/esm/src/lib/request-entities/filters/facet/not-facet-filter.d.ts +7 -0
  120. package/dist/esm/src/lib/request-entities/filters/facet/not-facet-filter.js +7 -0
  121. package/dist/esm/src/lib/request-entities/filters/geo-filter.d.ts +7 -2
  122. package/dist/esm/src/lib/request-entities/filters/geo-filter.js +7 -2
  123. package/dist/esm/src/lib/request-entities/filters/geo-within-filter.d.ts +8 -2
  124. package/dist/esm/src/lib/request-entities/filters/geo-within-filter.js +8 -2
  125. package/dist/esm/src/lib/request-entities/filters/list-filter.d.ts +3 -3
  126. package/dist/esm/src/lib/request-entities/filters/list-filter.js +3 -3
  127. package/dist/esm/src/lib/request-entities/filters/logical-filter.d.ts +3 -2
  128. package/dist/esm/src/lib/request-entities/filters/logical-filter.js +3 -2
  129. package/dist/esm/src/lib/request-entities/widgets/interfaces.d.ts +2 -0
  130. package/dist/esm/src/lib/request-entities/widgets/questions-answers-widget-item.d.ts +22 -6
  131. package/dist/esm/src/lib/request-entities/widgets/questions-answers-widget-item.js +22 -6
  132. package/dist/esm/src/lib/request-entities/widgets/recommendation-widget-item.d.ts +10 -4
  133. package/dist/esm/src/lib/request-entities/widgets/recommendation-widget-item.js +10 -4
  134. package/dist/esm/src/lib/request-entities/widgets/results-widget-item.d.ts +11 -5
  135. package/dist/esm/src/lib/request-entities/widgets/results-widget-item.js +11 -5
  136. package/dist/esm/src/lib/request-entities/widgets/rule-widget-item.d.ts +35 -0
  137. package/dist/esm/src/lib/request-entities/widgets/rule-widget-item.js +35 -0
  138. package/dist/esm/src/lib/request-entities/widgets/search-widget-item.d.ts +70 -28
  139. package/dist/esm/src/lib/request-entities/widgets/search-widget-item.js +77 -28
  140. package/dist/esm/src/lib/request-entities/widgets/utils.d.ts +1 -1
  141. package/dist/esm/src/lib/request-entities/widgets/utils.js +1 -1
  142. package/dist/esm/src/lib/request-entities/widgets/widget-item.d.ts +20 -5
  143. package/dist/esm/src/lib/request-entities/widgets/widget-item.js +20 -5
  144. package/dist/esm/src/lib/request-entities/widgets/widget-request-data.d.ts +6 -1
  145. package/dist/esm/src/lib/request-entities/widgets/widget-request-data.js +6 -1
  146. package/dist/esm/src/lib/requests/browser/get-page-widget-data.d.ts +5 -4
  147. package/dist/esm/src/lib/requests/browser/get-page-widget-data.js +5 -0
  148. package/dist/esm/src/lib/requests/browser/get-widget-data.d.ts +1 -1
  149. package/dist/esm/src/lib/requests/browser/get-widget-data.js +1 -1
  150. package/dist/esm/src/lib/requests/post-request.d.ts +10 -6
  151. package/dist/esm/src/lib/requests/post-request.js +2 -1
  152. package/dist/esm/src/lib/requests/server/entity-view-event-server.d.ts +1 -1
  153. package/dist/esm/src/lib/requests/server/entity-view-event-server.js +1 -1
  154. package/dist/esm/src/lib/requests/server/get-page-widget-data-server.d.ts +3 -3
  155. package/dist/esm/src/lib/requests/server/get-page-widget-data-server.js +5 -0
  156. package/dist/esm/src/lib/requests/server/get-widget-data-server.d.ts +1 -1
  157. package/dist/esm/src/lib/requests/server/get-widget-data-server.js +1 -1
  158. package/dist/esm/src/lib/requests/server/widget-facet-click-event-server.d.ts +1 -1
  159. package/dist/esm/src/lib/requests/server/widget-facet-click-event-server.js +1 -1
  160. package/dist/esm/src/lib/requests/server/widget-item-click-event-server.d.ts +1 -1
  161. package/dist/esm/src/lib/requests/server/widget-item-click-event-server.js +1 -1
  162. package/dist/esm/src/lib/requests/server/widget-navigation-click-event-server.d.ts +1 -1
  163. package/dist/esm/src/lib/requests/server/widget-navigation-click-event-server.js +1 -1
  164. package/dist/esm/src/lib/requests/server/widget-suggestion-click-event-server.d.ts +1 -1
  165. package/dist/esm/src/lib/requests/server/widget-suggestion-click-event-server.js +1 -1
  166. package/dist/esm/src/lib/requests/server/widget-view-event-server.d.ts +1 -1
  167. package/dist/esm/src/lib/requests/server/widget-view-event-server.js +1 -1
  168. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  169. package/package.json +4 -4
@@ -6,15 +6,15 @@ exports.ListFacetFilter = void 0;
6
6
  */
7
7
  class ListFacetFilter {
8
8
  /**
9
- * @param operator - The operator to be applied on attribute.
10
- * @param values - The values to check against of.
9
+ * @param operator - The {@link ListOperators} to be applied on attribute.
10
+ * @param values - The values[] to check against of.
11
11
  */
12
12
  constructor(operator, values) {
13
13
  this._operator = operator;
14
14
  this._values = values;
15
15
  }
16
16
  /**
17
- * @returns The DTO representation of the filter.
17
+ * @returns The DTO representation of the filter {@link ListFacetFilterDTO}.
18
18
  */
19
19
  toDTO() {
20
20
  return {
@@ -8,12 +8,12 @@ export declare class LogicalFacetFilter implements FacetFilterBase {
8
8
  private _operator;
9
9
  private _value;
10
10
  /**
11
- * @param operator - The operator to be applied on attribute.
12
- * @param value - The value to check against of.
11
+ * @param operator - The {@link LogicalOperators} to be applied on attribute excluding `not`.
12
+ * @param value - The {@link FacetFilter}[] to check against of.
13
13
  */
14
14
  constructor(operator: Exclude<LogicalOperators, 'not'>, value: Array<FacetFilter>);
15
15
  /**
16
- * @returns The DTO representation of the filter.
16
+ * @returns The DTO representation of the filter {@link LogicalFacetFilterDTO}.
17
17
  */
18
18
  toDTO(): LogicalFacetFilterDTO;
19
19
  }
@@ -6,15 +6,15 @@ exports.LogicalFacetFilter = void 0;
6
6
  */
7
7
  class LogicalFacetFilter {
8
8
  /**
9
- * @param operator - The operator to be applied on attribute.
10
- * @param value - The value to check against of.
9
+ * @param operator - The {@link LogicalOperators} to be applied on attribute excluding `not`.
10
+ * @param value - The {@link FacetFilter}[] to check against of.
11
11
  */
12
12
  constructor(operator, value) {
13
13
  this._operator = operator;
14
14
  this._value = value;
15
15
  }
16
16
  /**
17
- * @returns The DTO representation of the filter.
17
+ * @returns The DTO representation of the filter {@link LogicalFacetFilterDTO}.
18
18
  */
19
19
  toDTO() {
20
20
  return {
@@ -2,6 +2,13 @@ import type { FacetFilter } from '../../widgets/interfaces';
2
2
  import type { FacetFilterBase, NotFacetFilterDTO } from './interfaces';
3
3
  export declare class NotFacetFilter implements FacetFilterBase {
4
4
  private _value;
5
+ /**
6
+ * @param value - the {@link FacetFilter} | string to check against to.
7
+ */
5
8
  constructor(value: string | FacetFilter);
9
+ /**
10
+ *
11
+ * @returns the DTO represantation of notFacetFilter {@link NotFacetFilterDTO}.
12
+ */
6
13
  toDTO(): NotFacetFilterDTO;
7
14
  }
@@ -2,9 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NotFacetFilter = void 0;
4
4
  class NotFacetFilter {
5
+ /**
6
+ * @param value - the {@link FacetFilter} | string to check against to.
7
+ */
5
8
  constructor(value) {
6
9
  this._value = value;
7
10
  }
11
+ /**
12
+ *
13
+ * @returns the DTO represantation of notFacetFilter {@link NotFacetFilterDTO}.
14
+ */
8
15
  toDTO() {
9
16
  /**
10
17
  * If the value is a string, it probably means that it is a facet filter id.
@@ -8,12 +8,17 @@ export declare class GeoFilter extends BaseFilter {
8
8
  private _attributeName;
9
9
  /**
10
10
  * @param attributeName - The name of the attribute to filter.
11
- * @param geoFilterData - The geo filter data like location and distance.
11
+ * @param geoFilterData - The {@link GeoFilterData} like location and distance.
12
12
  */
13
13
  constructor(attributeName: string, geoFilterData?: GeoFilterData);
14
+ /**
15
+ * Throws an error if latitude or longitude are not present.
16
+ * @param location - {@link LocationData}
17
+ * @throws - {@link ErrorMessages.IV_0012} | {@link ErrorMessages.IV_0013}
18
+ */
14
19
  private _validateLocation;
15
20
  /**
16
- * @returns The DTO representation of the filter.
21
+ * @returns The DTO representation of the filter {@link GeoFilterDTO}.
17
22
  */
18
23
  toDTO(): GeoFilterDTO;
19
24
  }
@@ -12,7 +12,7 @@ exports.GEO_FILTER_TYPE = 'geoDistance';
12
12
  class GeoFilter extends base_filter_1.BaseFilter {
13
13
  /**
14
14
  * @param attributeName - The name of the attribute to filter.
15
- * @param geoFilterData - The geo filter data like location and distance.
15
+ * @param geoFilterData - The {@link GeoFilterData} like location and distance.
16
16
  */
17
17
  constructor(attributeName, geoFilterData) {
18
18
  super(exports.GEO_FILTER_TYPE, geoFilterData);
@@ -20,6 +20,11 @@ class GeoFilter extends base_filter_1.BaseFilter {
20
20
  this._validateLocation(geoFilterData.location);
21
21
  this._attributeName = attributeName;
22
22
  }
23
+ /**
24
+ * Throws an error if latitude or longitude are not present.
25
+ * @param location - {@link LocationData}
26
+ * @throws - {@link ErrorMessages.IV_0012} | {@link ErrorMessages.IV_0013}
27
+ */
23
28
  _validateLocation(location) {
24
29
  const result = (0, utils_1.isValidLocation)(location);
25
30
  if (!result.latitude)
@@ -28,7 +33,7 @@ class GeoFilter extends base_filter_1.BaseFilter {
28
33
  throw new Error(consts_1.ErrorMessages.IV_0013);
29
34
  }
30
35
  /**
31
- * @returns The DTO representation of the filter.
36
+ * @returns The DTO representation of the filter {@link GeoFilterDTO}.
32
37
  */
33
38
  toDTO() {
34
39
  const dto = {
@@ -8,12 +8,18 @@ export declare class GeoWithinFilter extends BaseFilter {
8
8
  private _attributeName;
9
9
  /**
10
10
  * @param attributeName - The name of the attribute to filter.
11
- * @param geoWithinFilterData - The geo within filter data. Array of location objects.
11
+ * @param geoWithinFilterData - The {@link GeoWithinFilterData}. Array of location objects.
12
12
  */
13
13
  constructor(attributeName: string, geoWithinFilterData: GeoWithinFilterData);
14
+ /**
15
+ * Throws an error if latitude or longitude are not present.
16
+ *
17
+ * @param location - {@link LocationData}
18
+ * @throws - {@link ErrorMessages.IV_0012} | {@link ErrorMessages.IV_0013}
19
+ */
14
20
  private _validateLocation;
15
21
  /**
16
- * @returns The DTO representation of the filter.
22
+ * @returns The DTO representation of the filter {@link GeoWithinFilterDTO}.
17
23
  */
18
24
  toDTO(): GeoWithinFilterDTO;
19
25
  }
@@ -12,13 +12,19 @@ exports.GEO_FILTER_TYPE = 'geoWithin';
12
12
  class GeoWithinFilter extends base_filter_1.BaseFilter {
13
13
  /**
14
14
  * @param attributeName - The name of the attribute to filter.
15
- * @param geoWithinFilterData - The geo within filter data. Array of location objects.
15
+ * @param geoWithinFilterData - The {@link GeoWithinFilterData}. Array of location objects.
16
16
  */
17
17
  constructor(attributeName, geoWithinFilterData) {
18
18
  super(exports.GEO_FILTER_TYPE, geoWithinFilterData);
19
19
  geoWithinFilterData.forEach((location) => this._validateLocation(location));
20
20
  this._attributeName = attributeName;
21
21
  }
22
+ /**
23
+ * Throws an error if latitude or longitude are not present.
24
+ *
25
+ * @param location - {@link LocationData}
26
+ * @throws - {@link ErrorMessages.IV_0012} | {@link ErrorMessages.IV_0013}
27
+ */
22
28
  _validateLocation(location) {
23
29
  const result = (0, utils_1.isValidLocation)(location);
24
30
  if (!result.latitude)
@@ -27,7 +33,7 @@ class GeoWithinFilter extends base_filter_1.BaseFilter {
27
33
  throw new Error(consts_1.ErrorMessages.IV_0013);
28
34
  }
29
35
  /**
30
- * @returns The DTO representation of the filter.
36
+ * @returns The DTO representation of the filter {@link GeoWithinFilterDTO}.
31
37
  */
32
38
  toDTO() {
33
39
  const dto = {
@@ -7,12 +7,12 @@ export declare class ListFilter extends BaseFilter {
7
7
  private _attributeName;
8
8
  /**
9
9
  * @param attributeName - The name of the attribute to filter.
10
- * @param operator - The operator to be applied on attribute.
11
- * @param value - The value to check against of.
10
+ * @param operator - The {@link ListOperators} to be applied on attribute.
11
+ * @param value - The value[] to check against of.
12
12
  */
13
13
  constructor(attributeName: string, operator: ListOperators, value: unknown[]);
14
14
  /**
15
- * @returns The DTO representation of the filter.
15
+ * @returns The DTO representation of the filter {@link ListFilterDTO}.
16
16
  */
17
17
  toDTO(): ListFilterDTO;
18
18
  }
@@ -9,15 +9,15 @@ const base_filter_1 = require("./base-filter");
9
9
  class ListFilter extends base_filter_1.BaseFilter {
10
10
  /**
11
11
  * @param attributeName - The name of the attribute to filter.
12
- * @param operator - The operator to be applied on attribute.
13
- * @param value - The value to check against of.
12
+ * @param operator - The {@link ListOperators} to be applied on attribute.
13
+ * @param value - The value[] to check against of.
14
14
  */
15
15
  constructor(attributeName, operator, value) {
16
16
  super(operator, value);
17
17
  this._attributeName = attributeName;
18
18
  }
19
19
  /**
20
- * @returns The DTO representation of the filter.
20
+ * @returns The DTO representation of the filter {@link ListFilterDTO}.
21
21
  */
22
22
  toDTO() {
23
23
  return {
@@ -6,11 +6,12 @@ import type { LogicalFilterValues, PickLogicalDTO } from './interfaces';
6
6
  export declare class LogicalFilter<T extends keyof LogicalFilterValues> extends BaseFilter {
7
7
  /**
8
8
  * @param operator - The operator to be applied on attribute.
9
- * @param value - The value to check against. Using "and" or the "or" filter, you must include minimum 2 filters.
9
+ * @param value - The {@link LogicalFilterValues} to check against.
10
+ * Using "and" or the "or" filter, you must include minimum 2 filters.
10
11
  */
11
12
  constructor(operator: T, value: LogicalFilterValues[T]);
12
13
  /**
13
- * @returns The DTO representation of the filter.
14
+ * @returns The DTO representation of the filter {@link PickLogicalDTO}.
14
15
  */
15
16
  toDTO(): PickLogicalDTO<T>;
16
17
  }
@@ -9,13 +9,14 @@ const base_filter_1 = require("./base-filter");
9
9
  class LogicalFilter extends base_filter_1.BaseFilter {
10
10
  /**
11
11
  * @param operator - The operator to be applied on attribute.
12
- * @param value - The value to check against. Using "and" or the "or" filter, you must include minimum 2 filters.
12
+ * @param value - The {@link LogicalFilterValues} to check against.
13
+ * Using "and" or the "or" filter, you must include minimum 2 filters.
13
14
  */
14
15
  constructor(operator, value) {
15
16
  super(operator, value);
16
17
  }
17
18
  /**
18
- * @returns The DTO representation of the filter.
19
+ * @returns The DTO representation of the filter {@link PickLogicalDTO}.
19
20
  */
20
21
  toDTO() {
21
22
  if (this.operator === 'not')
@@ -144,6 +144,7 @@ export interface SearchOptions extends ResultsOptions {
144
144
  suggestion?: ArrayOfAtLeastOne<SearchSuggestionOptions>;
145
145
  ranking?: ArrayOfAtLeastOne<SearchRankingOptions>;
146
146
  personalization?: SearchPersonalizationOptions;
147
+ disableGrouping?: boolean;
147
148
  }
148
149
  /**
149
150
  * Represents the search object of the search widget item in its DTO format.
@@ -156,6 +157,7 @@ export interface SearchDTO extends ResultsItemDTO {
156
157
  suggestion?: ArrayOfAtLeastOne<SearchSuggestionOptionsDTO>;
157
158
  ranking?: ArrayOfAtLeastOne<SearchRankingOptionsDto>;
158
159
  personalization?: SearchPersonalizationOptionsDto;
160
+ disable_grouping?: boolean;
159
161
  }
160
162
  /**
161
163
  * Represents the search widget item object in its DTO format.
@@ -8,15 +8,22 @@ export declare class QuestionsAnswersWidgetItem extends RuleWidgetItem {
8
8
  * Creates and holds the functionality of a questions answers widget item.
9
9
  * @param entity - The widget's item entity.
10
10
  * @param widgetId - The widget's item id.
11
- * @param questionsAnswersOptions - The widget's questions answers options object.
11
+ * @param questionsAnswersOptions - The widget's {@link QuestionsAnswersOptions} object.
12
+ * @throws - {@link ErrorMessages.IV_0007} | {@link ErrorMessages.IV_0008} | {@link ErrorMessages.IV_0009}
12
13
  */
13
14
  constructor(entity: string, widgetId: string, questionsAnswersOptions: QuestionsAnswersOptions);
15
+ /**
16
+ * Throws an error if limit is outside of range of 1 ~ 100 or offset is not a positive integer
17
+ * @param relatedQuestions - {@link RelatedQuestionsOptions}
18
+ * @throws - {@link ErrorMessages.IV_0007} | {@link ErrorMessages.IV_0008}
19
+ */
14
20
  private _validateRelatedQuestions;
15
21
  /**
16
22
  * Sets the keyphrase for the QuestionsAnswersWidgetItem.
17
23
  * This method updates the `keyphrase` property of the questions answers configuration.
18
24
  *
19
25
  * @param keyphrase - The keyphrase that the visitor enters to search for relevant content.
26
+ * @throws - {@link ErrorMessages.IV_0009}
20
27
  */
21
28
  set keyphrase(keyphrase: string);
22
29
  /**
@@ -27,11 +34,11 @@ export declare class QuestionsAnswersWidgetItem extends RuleWidgetItem {
27
34
  * Sets the exactAnswer for the QuestionsAnswersWidgetItem.
28
35
  * This method updates the `exactAnswer` property of the questions answers configuration.
29
36
  *
30
- * @param exactAnswer - The exactAnswer that the visitor enters to search for relevant content.
37
+ * @param exactAnswer - The {@link ExactAnswerOptions} that the visitor enters to search for relevant content.
31
38
  */
32
39
  set exactAnswer(exactAnswer: ExactAnswerOptions);
33
40
  /**
34
- * @returns The exactAnswer property of the QuestionsAnswersWidgetItem.
41
+ * @returns The {@link ExactAnswerOptions} `exactAnswer` property of the QuestionsAnswersWidgetItem.
35
42
  */
36
43
  get exactAnswer(): ExactAnswerOptions | undefined;
37
44
  /**
@@ -42,21 +49,30 @@ export declare class QuestionsAnswersWidgetItem extends RuleWidgetItem {
42
49
  * Sets the relatedQuestions for the QuestionsAnswersWidgetItem.
43
50
  * This method updates the `relatedQuestions` property of the questions answers configuration.
44
51
  *
45
- * @param relatedQuestions - The relatedQuestions that the visitor enters to search for relevant content.
52
+ * @param relatedQuestions - {@link RelatedQuestionsOptions} that the visitor enters to search for relevant content.
53
+ * @throws - {@link ErrorMessages.IV_0007} | {@link ErrorMessages.IV_0008}
46
54
  */
47
55
  set relatedQuestions(relatedQuestions: RelatedQuestionsOptions);
48
56
  /**
49
- * @returns The relatedQuestions property of the QuestionsAnswersWidgetItem.
57
+ * @returns The {@link RelatedQuestionsOptions} `relatedQuestions` property of the QuestionsAnswersWidgetItem.
50
58
  */
51
59
  get relatedQuestions(): RelatedQuestionsOptions | undefined;
52
60
  /**
53
61
  * Sets the relatedQuestions to undefined
54
62
  */
55
63
  resetRelatedQuestions(): void;
64
+ /**
65
+ *
66
+ * @returns exactAnswer property in its DTO format.
67
+ */
56
68
  private _exactAnswerToDTO;
69
+ /**
70
+ *
71
+ * @returns relatedQuestions property in its DTO format.
72
+ */
57
73
  private _relatedQuestionsToDTO;
58
74
  /**
59
- * Maps the questions answers widget item to its DTO format.
75
+ * Maps the questions answers widget item to its DTO format {@link QuestionsAnswersWidgetItemDTO}.
60
76
  */
61
77
  toDTO(): QuestionsAnswersWidgetItemDTO;
62
78
  }
@@ -9,7 +9,8 @@ class QuestionsAnswersWidgetItem extends rule_widget_item_1.RuleWidgetItem {
9
9
  * Creates and holds the functionality of a questions answers widget item.
10
10
  * @param entity - The widget's item entity.
11
11
  * @param widgetId - The widget's item id.
12
- * @param questionsAnswersOptions - The widget's questions answers options object.
12
+ * @param questionsAnswersOptions - The widget's {@link QuestionsAnswersOptions} object.
13
+ * @throws - {@link ErrorMessages.IV_0007} | {@link ErrorMessages.IV_0008} | {@link ErrorMessages.IV_0009}
13
14
  */
14
15
  constructor(entity, widgetId, questionsAnswersOptions) {
15
16
  super(entity, widgetId, questionsAnswersOptions.rule);
@@ -21,6 +22,11 @@ class QuestionsAnswersWidgetItem extends rule_widget_item_1.RuleWidgetItem {
21
22
  this._relatedQuestions = questionsAnswersOptions.relatedQuestions;
22
23
  }
23
24
  }
25
+ /**
26
+ * Throws an error if limit is outside of range of 1 ~ 100 or offset is not a positive integer
27
+ * @param relatedQuestions - {@link RelatedQuestionsOptions}
28
+ * @throws - {@link ErrorMessages.IV_0007} | {@link ErrorMessages.IV_0008}
29
+ */
24
30
  _validateRelatedQuestions(relatedQuestions) {
25
31
  this._validateNumberInRange1To100(consts_1.ErrorMessages.IV_0007, relatedQuestions.limit);
26
32
  this._validatePositiveInteger(consts_1.ErrorMessages.IV_0008, relatedQuestions.offset);
@@ -30,6 +36,7 @@ class QuestionsAnswersWidgetItem extends rule_widget_item_1.RuleWidgetItem {
30
36
  * This method updates the `keyphrase` property of the questions answers configuration.
31
37
  *
32
38
  * @param keyphrase - The keyphrase that the visitor enters to search for relevant content.
39
+ * @throws - {@link ErrorMessages.IV_0009}
33
40
  */
34
41
  set keyphrase(keyphrase) {
35
42
  this._validateStringLengthInRange1To100(consts_1.ErrorMessages.IV_0009, keyphrase);
@@ -45,13 +52,13 @@ class QuestionsAnswersWidgetItem extends rule_widget_item_1.RuleWidgetItem {
45
52
  * Sets the exactAnswer for the QuestionsAnswersWidgetItem.
46
53
  * This method updates the `exactAnswer` property of the questions answers configuration.
47
54
  *
48
- * @param exactAnswer - The exactAnswer that the visitor enters to search for relevant content.
55
+ * @param exactAnswer - The {@link ExactAnswerOptions} that the visitor enters to search for relevant content.
49
56
  */
50
57
  set exactAnswer(exactAnswer) {
51
58
  this._exactAnswer = exactAnswer;
52
59
  }
53
60
  /**
54
- * @returns The exactAnswer property of the QuestionsAnswersWidgetItem.
61
+ * @returns The {@link ExactAnswerOptions} `exactAnswer` property of the QuestionsAnswersWidgetItem.
55
62
  */
56
63
  get exactAnswer() {
57
64
  return this._exactAnswer;
@@ -66,14 +73,15 @@ class QuestionsAnswersWidgetItem extends rule_widget_item_1.RuleWidgetItem {
66
73
  * Sets the relatedQuestions for the QuestionsAnswersWidgetItem.
67
74
  * This method updates the `relatedQuestions` property of the questions answers configuration.
68
75
  *
69
- * @param relatedQuestions - The relatedQuestions that the visitor enters to search for relevant content.
76
+ * @param relatedQuestions - {@link RelatedQuestionsOptions} that the visitor enters to search for relevant content.
77
+ * @throws - {@link ErrorMessages.IV_0007} | {@link ErrorMessages.IV_0008}
70
78
  */
71
79
  set relatedQuestions(relatedQuestions) {
72
80
  this._validateRelatedQuestions(relatedQuestions);
73
81
  this._relatedQuestions = relatedQuestions;
74
82
  }
75
83
  /**
76
- * @returns The relatedQuestions property of the QuestionsAnswersWidgetItem.
84
+ * @returns The {@link RelatedQuestionsOptions} `relatedQuestions` property of the QuestionsAnswersWidgetItem.
77
85
  */
78
86
  get relatedQuestions() {
79
87
  return this._relatedQuestions;
@@ -84,11 +92,19 @@ class QuestionsAnswersWidgetItem extends rule_widget_item_1.RuleWidgetItem {
84
92
  resetRelatedQuestions() {
85
93
  this._relatedQuestions = undefined;
86
94
  }
95
+ /**
96
+ *
97
+ * @returns exactAnswer property in its DTO format.
98
+ */
87
99
  _exactAnswerToDTO() {
88
100
  if (!this._exactAnswer)
89
101
  return;
90
102
  return { include_sources: this._exactAnswer.includeSources, query_types: this._exactAnswer.queryTypes };
91
103
  }
104
+ /**
105
+ *
106
+ * @returns relatedQuestions property in its DTO format.
107
+ */
92
108
  _relatedQuestionsToDTO() {
93
109
  if (!this._relatedQuestions)
94
110
  return;
@@ -101,7 +117,7 @@ class QuestionsAnswersWidgetItem extends rule_widget_item_1.RuleWidgetItem {
101
117
  };
102
118
  }
103
119
  /**
104
- * Maps the questions answers widget item to its DTO format.
120
+ * Maps the questions answers widget item to its DTO format {@link QuestionsAnswersWidgetItemDTO}.
105
121
  */
106
122
  toDTO() {
107
123
  return {
@@ -6,7 +6,8 @@ export declare class RecommendationWidgetItem extends ResultsWidgetItem {
6
6
  * Creates and holds the functionality of a recommendation widget item.
7
7
  * @param entity - The widget's item entity.
8
8
  * @param widgetId - The widget's item id.
9
- * @param recommendationOptions - The widget's recommendation options object.
9
+ * @param recommendationOptions - The widget's {@link RecommendationOptions} object.
10
+ * @throws - {@link ErrorMessages.IV_0023} | {@link ErrorMessages.IV_0024}
10
11
  */
11
12
  constructor(entity: string, widgetId: string, recommendationOptions?: RecommendationOptions);
12
13
  /**
@@ -20,20 +21,25 @@ export declare class RecommendationWidgetItem extends ResultsWidgetItem {
20
21
  * If not provided, the API uses the recipe specified in CEC.
21
22
  *
22
23
  * @param recipe - {@link Recipe} The recipe configuration with id and version.
23
- * @throws Error If the recipe id is empty or version is less than 1.
24
+ * @throws - {@link ErrorMessages.IV_0023} | {@link ErrorMessages.IV_0024}
24
25
  */
25
26
  set recipe(recipe: Recipe);
26
27
  /**
27
- * @returns The recipe property of the RecommendationWidgetItem.
28
+ * @returns The {@link Recipe} recipe property of the RecommendationWidgetItem.
28
29
  */
29
30
  get recipe(): Recipe | undefined;
30
31
  /**
31
32
  * Sets the recipe to undefined
32
33
  */
33
34
  resetRecipe(): void;
35
+ /**
36
+ * Throws an error if recipe exists but is an empty string or has wrong version.
37
+ * @param recipe - {@link Recipe}
38
+ * @throws - {@link ErrorMessages.IV_0023} | {@link ErrorMessages.IV_0024}
39
+ */
34
40
  private _validateRecipe;
35
41
  /**
36
- * Maps the recommendation widget item to its DTO format.
42
+ * Maps the recommendation widget item to its DTO format {@link WidgetItemRecommendationDTO}.
37
43
  */
38
44
  toDTO(): WidgetItemRecommendationDTO;
39
45
  }
@@ -9,7 +9,8 @@ class RecommendationWidgetItem extends results_widget_item_1.ResultsWidgetItem {
9
9
  * Creates and holds the functionality of a recommendation widget item.
10
10
  * @param entity - The widget's item entity.
11
11
  * @param widgetId - The widget's item id.
12
- * @param recommendationOptions - The widget's recommendation options object.
12
+ * @param recommendationOptions - The widget's {@link RecommendationOptions} object.
13
+ * @throws - {@link ErrorMessages.IV_0023} | {@link ErrorMessages.IV_0024}
13
14
  */
14
15
  constructor(entity, widgetId, recommendationOptions) {
15
16
  const { recipe, ...rest } = recommendationOptions || {};
@@ -36,7 +37,7 @@ class RecommendationWidgetItem extends results_widget_item_1.ResultsWidgetItem {
36
37
  * If not provided, the API uses the recipe specified in CEC.
37
38
  *
38
39
  * @param recipe - {@link Recipe} The recipe configuration with id and version.
39
- * @throws Error If the recipe id is empty or version is less than 1.
40
+ * @throws - {@link ErrorMessages.IV_0023} | {@link ErrorMessages.IV_0024}
40
41
  */
41
42
  set recipe(recipe) {
42
43
  this._validateRecipe(recipe);
@@ -46,7 +47,7 @@ class RecommendationWidgetItem extends results_widget_item_1.ResultsWidgetItem {
46
47
  };
47
48
  }
48
49
  /**
49
- * @returns The recipe property of the RecommendationWidgetItem.
50
+ * @returns The {@link Recipe} recipe property of the RecommendationWidgetItem.
50
51
  */
51
52
  get recipe() {
52
53
  return this._recommendation?.recipe;
@@ -57,6 +58,11 @@ class RecommendationWidgetItem extends results_widget_item_1.ResultsWidgetItem {
57
58
  resetRecipe() {
58
59
  this._recommendation = undefined;
59
60
  }
61
+ /**
62
+ * Throws an error if recipe exists but is an empty string or has wrong version.
63
+ * @param recipe - {@link Recipe}
64
+ * @throws - {@link ErrorMessages.IV_0023} | {@link ErrorMessages.IV_0024}
65
+ */
60
66
  _validateRecipe(recipe) {
61
67
  if (!recipe)
62
68
  return;
@@ -65,7 +71,7 @@ class RecommendationWidgetItem extends results_widget_item_1.ResultsWidgetItem {
65
71
  throw new Error(consts_1.ErrorMessages.IV_0024);
66
72
  }
67
73
  /**
68
- * Maps the recommendation widget item to its DTO format.
74
+ * Maps the recommendation widget item to its DTO format {@link WidgetItemRecommendationDTO}.
69
75
  */
70
76
  toDTO() {
71
77
  const baseDTO = super.toDTO();
@@ -10,7 +10,8 @@ export declare class ResultsWidgetItem extends RuleWidgetItem {
10
10
  * Creates and holds the functionality of a widget item.
11
11
  * @param entity - The widget's item entity.
12
12
  * @param widgetId - The widget's item id.
13
- * @param resultOptions - The widget's results options object.
13
+ * @param resultOptions - The widget's {@link ResultsOptions} object.
14
+ * @throws - {@link ErrorMessages.IV_0007} | {@link ErrorMessages.IV_0022}
14
15
  */
15
16
  constructor(entity: string, widgetId: string, resultOptions?: ResultsOptions);
16
17
  /**
@@ -34,7 +35,7 @@ export declare class ResultsWidgetItem extends RuleWidgetItem {
34
35
  * Sets the search content for the ResultsItem.
35
36
  * This method updates the `content` property within the ResultsItem instance.
36
37
  * The attributes is used to define specific search criteria or filters.
37
- * @param contentOptions - The array attributes that specifies the search criteria.
38
+ * @param contentOptions - The array attributes {@link ContentOptions} that specifies the search criteria.
38
39
  */
39
40
  set content(contentOptions: ContentOptions);
40
41
  /**
@@ -57,20 +58,25 @@ export declare class ResultsWidgetItem extends RuleWidgetItem {
57
58
  get groupBy(): string | undefined;
58
59
  /** Sets the groupBy to undefined */
59
60
  resetGroupBy(): void;
61
+ /**
62
+ *
63
+ * @param groupBy - the groupBy string.
64
+ * @throws - {@link ErrorMessages.IV_0022}
65
+ */
60
66
  private _validateGroupBy;
61
67
  /** Set the search filter */
62
68
  set filter(filter: Filter);
63
- /** @returns The filter property of the WidgetItem */
69
+ /** @returns The {@link Filter} filter property of the WidgetItem */
64
70
  get filter(): Filter | undefined;
65
71
  /** Sets the filter to undefined */
66
72
  resetFilter(): void;
67
73
  /**
68
74
  *
69
- * @returns The content property in its DTO format.
75
+ * @returns The content property in its DTO format {@link ContentOptionsDto}.
70
76
  */
71
77
  private _contentToDTO;
72
78
  /**
73
- * Maps the results item to its DTO format.
79
+ * Maps the results item to its DTO format {@link ResultsItemDTO}.
74
80
  */
75
81
  protected _resultsToDTO(): ResultsItemDTO;
76
82
  }
@@ -9,7 +9,8 @@ class ResultsWidgetItem extends rule_widget_item_1.RuleWidgetItem {
9
9
  * Creates and holds the functionality of a widget item.
10
10
  * @param entity - The widget's item entity.
11
11
  * @param widgetId - The widget's item id.
12
- * @param resultOptions - The widget's results options object.
12
+ * @param resultOptions - The widget's {@link ResultsOptions} object.
13
+ * @throws - {@link ErrorMessages.IV_0007} | {@link ErrorMessages.IV_0022}
13
14
  */
14
15
  constructor(entity, widgetId, resultOptions) {
15
16
  super(entity, widgetId, resultOptions?.rule);
@@ -48,7 +49,7 @@ class ResultsWidgetItem extends rule_widget_item_1.RuleWidgetItem {
48
49
  * Sets the search content for the ResultsItem.
49
50
  * This method updates the `content` property within the ResultsItem instance.
50
51
  * The attributes is used to define specific search criteria or filters.
51
- * @param contentOptions - The array attributes that specifies the search criteria.
52
+ * @param contentOptions - The array attributes {@link ContentOptions} that specifies the search criteria.
52
53
  */
53
54
  set content(contentOptions) {
54
55
  this._content = contentOptions;
@@ -84,6 +85,11 @@ class ResultsWidgetItem extends rule_widget_item_1.RuleWidgetItem {
84
85
  resetGroupBy() {
85
86
  this._groupBy = undefined;
86
87
  }
88
+ /**
89
+ *
90
+ * @param groupBy - the groupBy string.
91
+ * @throws - {@link ErrorMessages.IV_0022}
92
+ */
87
93
  _validateGroupBy(groupBy) {
88
94
  if (typeof groupBy === 'string' && groupBy.trim().length === 0)
89
95
  throw new Error(consts_1.ErrorMessages.IV_0022);
@@ -92,7 +98,7 @@ class ResultsWidgetItem extends rule_widget_item_1.RuleWidgetItem {
92
98
  set filter(filter) {
93
99
  this._filter = filter;
94
100
  }
95
- /** @returns The filter property of the WidgetItem */
101
+ /** @returns The {@link Filter} filter property of the WidgetItem */
96
102
  get filter() {
97
103
  return this._filter;
98
104
  }
@@ -102,7 +108,7 @@ class ResultsWidgetItem extends rule_widget_item_1.RuleWidgetItem {
102
108
  }
103
109
  /**
104
110
  *
105
- * @returns The content property in its DTO format.
111
+ * @returns The content property in its DTO format {@link ContentOptionsDto}.
106
112
  */
107
113
  _contentToDTO() {
108
114
  if (!this._content)
@@ -111,7 +117,7 @@ class ResultsWidgetItem extends rule_widget_item_1.RuleWidgetItem {
111
117
  return { fields: attributes, ...rest };
112
118
  }
113
119
  /**
114
- * Maps the results item to its DTO format.
120
+ * Maps the results item to its DTO format {@link ResultsItemDTO}.
115
121
  */
116
122
  _resultsToDTO() {
117
123
  return {