@sitecore-cloudsdk/search 0.5.0 → 0.5.1

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
@@ -1,15 +1,9 @@
1
1
  // © Sitecore Corporation A/S. All rights reserved. Sitecore® is a registered trademark of Sitecore Corporation A/S.
2
2
  import { isValidLocation } from '@sitecore-cloudsdk/utils';
3
3
  import { ErrorMessages } from '../../consts';
4
- /**
5
- * Create context object.
6
- * @param context - The context object.
7
- * @returns the validated and mapped context object
8
- */
9
4
  export class Context {
10
5
  /**
11
- * @param context - The context object.
12
- * @returns the validated and mapped context object
6
+ * @param context - {@link ContextData} The context object.
13
7
  */
14
8
  constructor(context) {
15
9
  this._validateContext(context);
@@ -23,14 +17,13 @@ export class Context {
23
17
  }
24
18
  /**
25
19
  * Sets the campaign data.
26
- * @param campaign - The new value to set.
27
- *
20
+ * @param campaign - {@link CampaignData} The new value to set.
28
21
  */
29
22
  set campaign(campaign) {
30
23
  this._campaign = campaign;
31
24
  }
32
25
  /**
33
- * @returns The campaign data.
26
+ * @returns The campaign data {@link CampaignData}.
34
27
  */
35
28
  get campaign() {
36
29
  return this._campaign;
@@ -43,7 +36,7 @@ export class Context {
43
36
  }
44
37
  /**
45
38
  * Sets the locale data.
46
- * @param locale - The new value to set.
39
+ * @param locale - The new value to set. {@link LocaleData}
47
40
  *
48
41
  */
49
42
  set locale(locale) {
@@ -51,7 +44,7 @@ export class Context {
51
44
  this._locale = locale;
52
45
  }
53
46
  /**
54
- * @returns The locale data.
47
+ * @returns the locale data. {@link LocaleData}
55
48
  */
56
49
  get locale() {
57
50
  return this._locale;
@@ -64,15 +57,14 @@ export class Context {
64
57
  }
65
58
  /**
66
59
  * Sets the page data.
67
- * @param page - The new value to set.
68
- *
60
+ * @param page - The new value to set {@link PageData}.
69
61
  */
70
62
  set page(page) {
71
63
  this._validatePage(page);
72
64
  this._page = page;
73
65
  }
74
66
  /**
75
- * @returns The page data.
67
+ * @returns The page data {@link PageData}.
76
68
  */
77
69
  get page() {
78
70
  return this._page;
@@ -85,6 +77,9 @@ export class Context {
85
77
  }
86
78
  /**
87
79
  * Validate context locale object.
80
+ *
81
+ * @param locale - the locale object {@link LocaleData}.
82
+ * @throws - {@link ErrorMessages.IV_0010} | {@link ErrorMessages.IV_0011}.
88
83
  */
89
84
  _validateContextLocale(locale) {
90
85
  if (!locale)
@@ -103,7 +98,7 @@ export class Context {
103
98
  this._store = store;
104
99
  }
105
100
  /**
106
- * @returns The store data.
101
+ * @returns The store data {@link StoreData}.
107
102
  */
108
103
  get store() {
109
104
  return this._store;
@@ -116,7 +111,7 @@ export class Context {
116
111
  }
117
112
  /**
118
113
  * Sets the geo data.
119
- * @param geo - The new value to set.
114
+ * @param geo - The new value to set {@link GeoData}.
120
115
  *
121
116
  */
122
117
  set geo(geo) {
@@ -138,6 +133,9 @@ export class Context {
138
133
  }
139
134
  /**
140
135
  * Validate location object.
136
+ *
137
+ * @param location - the location object {@link LocationData}.
138
+ * @throws - {@link ErrorMessages.IV_0012} | {@link ErrorMessages.IV_0013}.
141
139
  */
142
140
  _validateLocation(location) {
143
141
  const result = isValidLocation(location);
@@ -148,14 +146,14 @@ export class Context {
148
146
  }
149
147
  /**
150
148
  * Sets the user data.
151
- * @param user - The new value to set.
149
+ * @param user - The new value to set {@link UserData}.
152
150
  */
153
151
  set user(user) {
154
152
  this._validateUser(user);
155
153
  this._user = user;
156
154
  }
157
155
  /**
158
- * @returns The user data.
156
+ * @returns The user data {@link UserData}.
159
157
  */
160
158
  get user() {
161
159
  return this._user;
@@ -167,7 +165,7 @@ export class Context {
167
165
  /**
168
166
  * Validate user object, which is part of the context object.
169
167
  * We need to ensure that the user object has `userId` or `uuid`, but not neither.
170
- * @param user - The user object to validate.
168
+ * @param user - The user object to validate {@link UserData}.
171
169
  */
172
170
  _validateUser(user) {
173
171
  if (typeof user !== 'undefined' && !user.userId && !user.uuid)
@@ -180,7 +178,7 @@ export class Context {
180
178
  this._browser = browser;
181
179
  }
182
180
  /**
183
- * @returns The browser data.
181
+ * @returns The browser data {@link BrowserData}.
184
182
  */
185
183
  get browser() {
186
184
  return this._browser;
@@ -192,7 +190,8 @@ export class Context {
192
190
  this._browser = undefined;
193
191
  }
194
192
  /**
195
- * Validate context object.
193
+ * Validate context object {@link ContextData}.
194
+ * @throws - {@link ErrorMessages.MV_0009} | {@link ErrorMessages.IV_0012} | {@link ErrorMessages.IV_0013}
196
195
  */
197
196
  _validateContext(context) {
198
197
  this._validateContextLocale(context.locale);
@@ -205,7 +204,8 @@ export class Context {
205
204
  }
206
205
  /**
207
206
  * Validate the `page` object which required a `uri` property.
208
- * @param page - The page object to validate.
207
+ * @param page - The page object to validate {@link PageData}.
208
+ * @throws - {@link ErrorMessages.IV_0025}.
209
209
  */
210
210
  _validatePage(page) {
211
211
  if (!page)
@@ -215,7 +215,7 @@ export class Context {
215
215
  }
216
216
  /**
217
217
  * Map context object to DTO.
218
- * @returns The DTO representation of the filter.
218
+ * @returns The DTO representation of the filter {@link ContextDTO}.
219
219
  */
220
220
  toDTO() {
221
221
  /* eslint-disable @typescript-eslint/naming-convention */
@@ -6,7 +6,7 @@ export declare abstract class BaseFilter {
6
6
  protected operator: Operators;
7
7
  protected value: unknown;
8
8
  /**
9
- * @param operator - The operator to be applied on attribute.
9
+ * @param operator - The {@link Operators} to be applied on attribute.
10
10
  * @param value - The value to check against of.
11
11
  */
12
12
  constructor(operator: Operators, value: unknown);
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export class BaseFilter {
5
5
  /**
6
- * @param operator - The operator to be applied on attribute.
6
+ * @param operator - The {@link Operators} to be applied on attribute.
7
7
  * @param value - The value to check against of.
8
8
  */
9
9
  constructor(operator, value) {
@@ -7,12 +7,12 @@ export declare class ComparisonFilter 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.
10
+ * @param operator - The {@link ComparisonOperators} to be applied on attribute.
11
11
  * @param value - The value to check against of.
12
12
  */
13
13
  constructor(attributeName: string, operator: ComparisonOperators, value: unknown);
14
14
  /**
15
- * @returns The DTO representation of the filter.
15
+ * @returns The DTO representation of the filter {@link ComparisonFilterDTO}.
16
16
  */
17
17
  toDTO(): ComparisonFilterDTO;
18
18
  }
@@ -6,7 +6,7 @@ import { BaseFilter } from './base-filter';
6
6
  export class ComparisonFilter extends BaseFilter {
7
7
  /**
8
8
  * @param attributeName - The name of the attribute to filter.
9
- * @param operator - The operator to be applied on attribute.
9
+ * @param operator - The {@link ComparisonOperators} to be applied on attribute.
10
10
  * @param value - The value to check against of.
11
11
  */
12
12
  constructor(attributeName, operator, value) {
@@ -14,7 +14,7 @@ export class ComparisonFilter extends BaseFilter {
14
14
  this._attributeName = attributeName;
15
15
  }
16
16
  /**
17
- * @returns The DTO representation of the filter.
17
+ * @returns The DTO representation of the filter {@link ComparisonFilterDTO}.
18
18
  */
19
19
  toDTO() {
20
20
  return {
@@ -7,12 +7,12 @@ export declare class ComparisonFacetFilter implements FacetFilterBase {
7
7
  private _operator;
8
8
  private _value;
9
9
  /**
10
- * @param operator - The operator to be applied on attribute.
10
+ * @param operator - The {@link ComparisonOperators} to be applied on attribute.
11
11
  * @param value - The value to check against of.
12
12
  */
13
13
  constructor(operator: ComparisonOperators, value: string);
14
14
  /**
15
- * @returns The DTO representation of the filter.
15
+ * @returns The DTO representation of the filter {@link ComparisonFacetFilterDTO}.
16
16
  */
17
17
  toDTO(): ComparisonFacetFilterDTO;
18
18
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export class ComparisonFacetFilter {
5
5
  /**
6
- * @param operator - The operator to be applied on attribute.
6
+ * @param operator - The {@link ComparisonOperators} to be applied on attribute.
7
7
  * @param value - The value to check against of.
8
8
  */
9
9
  constructor(operator, value) {
@@ -11,7 +11,7 @@ export class ComparisonFacetFilter {
11
11
  this._value = value;
12
12
  }
13
13
  /**
14
- * @returns The DTO representation of the filter.
14
+ * @returns The DTO representation of the filter {@link ComparisonFacetFilterDTO}.
15
15
  */
16
16
  toDTO() {
17
17
  return {
@@ -7,12 +7,12 @@ export declare class ListFacetFilter implements FacetFilterBase {
7
7
  private _operator;
8
8
  private _values;
9
9
  /**
10
- * @param operator - The operator to be applied on attribute.
11
- * @param values - The values to check against of.
10
+ * @param operator - The {@link ListOperators} to be applied on attribute.
11
+ * @param values - The values[] to check against of.
12
12
  */
13
13
  constructor(operator: ListOperators, values: ArrayOfAtLeastOne<string>);
14
14
  /**
15
- * @returns The DTO representation of the filter.
15
+ * @returns The DTO representation of the filter {@link ListFacetFilterDTO}.
16
16
  */
17
17
  toDTO(): ListFacetFilterDTO;
18
18
  }
@@ -3,15 +3,15 @@
3
3
  */
4
4
  export class ListFacetFilter {
5
5
  /**
6
- * @param operator - The operator to be applied on attribute.
7
- * @param values - The values to check against of.
6
+ * @param operator - The {@link ListOperators} to be applied on attribute.
7
+ * @param values - The values[] to check against of.
8
8
  */
9
9
  constructor(operator, values) {
10
10
  this._operator = operator;
11
11
  this._values = values;
12
12
  }
13
13
  /**
14
- * @returns The DTO representation of the filter.
14
+ * @returns The DTO representation of the filter {@link ListFacetFilterDTO}.
15
15
  */
16
16
  toDTO() {
17
17
  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
  }
@@ -3,15 +3,15 @@
3
3
  */
4
4
  export class LogicalFacetFilter {
5
5
  /**
6
- * @param operator - The operator to be applied on attribute.
7
- * @param value - The value to check against of.
6
+ * @param operator - The {@link LogicalOperators} to be applied on attribute excluding `not`.
7
+ * @param value - The {@link FacetFilter}[] to check against of.
8
8
  */
9
9
  constructor(operator, value) {
10
10
  this._operator = operator;
11
11
  this._value = value;
12
12
  }
13
13
  /**
14
- * @returns The DTO representation of the filter.
14
+ * @returns The DTO representation of the filter {@link LogicalFacetFilterDTO}.
15
15
  */
16
16
  toDTO() {
17
17
  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
  }
@@ -1,7 +1,14 @@
1
1
  export class NotFacetFilter {
2
+ /**
3
+ * @param value - the {@link FacetFilter} | string to check against to.
4
+ */
2
5
  constructor(value) {
3
6
  this._value = value;
4
7
  }
8
+ /**
9
+ *
10
+ * @returns the DTO represantation of notFacetFilter {@link NotFacetFilterDTO}.
11
+ */
5
12
  toDTO() {
6
13
  /**
7
14
  * 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
  }
@@ -9,7 +9,7 @@ export const GEO_FILTER_TYPE = 'geoDistance';
9
9
  export class GeoFilter extends BaseFilter {
10
10
  /**
11
11
  * @param attributeName - The name of the attribute to filter.
12
- * @param geoFilterData - The geo filter data like location and distance.
12
+ * @param geoFilterData - The {@link GeoFilterData} like location and distance.
13
13
  */
14
14
  constructor(attributeName, geoFilterData) {
15
15
  super(GEO_FILTER_TYPE, geoFilterData);
@@ -17,6 +17,11 @@ export class GeoFilter extends BaseFilter {
17
17
  this._validateLocation(geoFilterData.location);
18
18
  this._attributeName = attributeName;
19
19
  }
20
+ /**
21
+ * Throws an error if latitude or longitude are not present.
22
+ * @param location - {@link LocationData}
23
+ * @throws - {@link ErrorMessages.IV_0012} | {@link ErrorMessages.IV_0013}
24
+ */
20
25
  _validateLocation(location) {
21
26
  const result = isValidLocation(location);
22
27
  if (!result.latitude)
@@ -25,7 +30,7 @@ export class GeoFilter extends BaseFilter {
25
30
  throw new Error(ErrorMessages.IV_0013);
26
31
  }
27
32
  /**
28
- * @returns The DTO representation of the filter.
33
+ * @returns The DTO representation of the filter {@link GeoFilterDTO}.
29
34
  */
30
35
  toDTO() {
31
36
  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
  }
@@ -9,13 +9,19 @@ export const GEO_FILTER_TYPE = 'geoWithin';
9
9
  export class GeoWithinFilter extends BaseFilter {
10
10
  /**
11
11
  * @param attributeName - The name of the attribute to filter.
12
- * @param geoWithinFilterData - The geo within filter data. Array of location objects.
12
+ * @param geoWithinFilterData - The {@link GeoWithinFilterData}. Array of location objects.
13
13
  */
14
14
  constructor(attributeName, geoWithinFilterData) {
15
15
  super(GEO_FILTER_TYPE, geoWithinFilterData);
16
16
  geoWithinFilterData.forEach((location) => this._validateLocation(location));
17
17
  this._attributeName = attributeName;
18
18
  }
19
+ /**
20
+ * Throws an error if latitude or longitude are not present.
21
+ *
22
+ * @param location - {@link LocationData}
23
+ * @throws - {@link ErrorMessages.IV_0012} | {@link ErrorMessages.IV_0013}
24
+ */
19
25
  _validateLocation(location) {
20
26
  const result = isValidLocation(location);
21
27
  if (!result.latitude)
@@ -24,7 +30,7 @@ export class GeoWithinFilter extends BaseFilter {
24
30
  throw new Error(ErrorMessages.IV_0013);
25
31
  }
26
32
  /**
27
- * @returns The DTO representation of the filter.
33
+ * @returns The DTO representation of the filter {@link GeoWithinFilterDTO}.
28
34
  */
29
35
  toDTO() {
30
36
  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
  }
@@ -6,15 +6,15 @@ import { BaseFilter } from './base-filter';
6
6
  export class ListFilter extends BaseFilter {
7
7
  /**
8
8
  * @param attributeName - The name of the attribute to filter.
9
- * @param operator - The operator to be applied on attribute.
10
- * @param value - The value to check against of.
9
+ * @param operator - The {@link ListOperators} to be applied on attribute.
10
+ * @param value - The value[] to check against of.
11
11
  */
12
12
  constructor(attributeName, operator, value) {
13
13
  super(operator, value);
14
14
  this._attributeName = attributeName;
15
15
  }
16
16
  /**
17
- * @returns The DTO representation of the filter.
17
+ * @returns The DTO representation of the filter {@link ListFilterDTO}.
18
18
  */
19
19
  toDTO() {
20
20
  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
  }
@@ -6,13 +6,14 @@ import { BaseFilter } from './base-filter';
6
6
  export class LogicalFilter 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, value) {
12
13
  super(operator, value);
13
14
  }
14
15
  /**
15
- * @returns The DTO representation of the filter.
16
+ * @returns The DTO representation of the filter {@link PickLogicalDTO}.
16
17
  */
17
18
  toDTO() {
18
19
  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
  }