@algolia/client-search 5.7.0 → 5.8.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 (127) hide show
  1. package/README.md +5 -6
  2. package/dist/browser.d.ts +1670 -1650
  3. package/dist/builds/browser.js +93 -155
  4. package/dist/builds/browser.js.map +1 -1
  5. package/dist/builds/browser.min.js +1 -1
  6. package/dist/builds/browser.min.js.map +1 -1
  7. package/dist/builds/browser.umd.js +2 -2
  8. package/dist/builds/fetch.js +93 -155
  9. package/dist/builds/fetch.js.map +1 -1
  10. package/dist/builds/node.cjs +88 -150
  11. package/dist/builds/node.cjs.map +1 -1
  12. package/dist/builds/node.js +94 -156
  13. package/dist/builds/node.js.map +1 -1
  14. package/dist/fetch.d.ts +1423 -1402
  15. package/dist/node.d.cts +1423 -1402
  16. package/dist/node.d.ts +1423 -1402
  17. package/dist/src/searchClient.cjs +86 -148
  18. package/dist/src/searchClient.cjs.map +1 -1
  19. package/dist/src/searchClient.js +89 -151
  20. package/dist/src/searchClient.js.map +1 -1
  21. package/index.js +1 -1
  22. package/model/acl.ts +1 -1
  23. package/model/action.ts +4 -4
  24. package/model/alternativesAsExact.ts +1 -1
  25. package/model/anchoring.ts +2 -2
  26. package/model/apiKey.ts +4 -4
  27. package/model/aroundPrecision.ts +1 -1
  28. package/model/aroundRadius.ts +1 -1
  29. package/model/attributeToUpdate.ts +1 -1
  30. package/model/automaticFacetFilters.ts +1 -1
  31. package/model/banner.ts +13 -0
  32. package/model/bannerImage.ts +12 -0
  33. package/model/bannerImageUrl.ts +8 -0
  34. package/model/bannerLink.ts +8 -0
  35. package/model/banners.ts +10 -0
  36. package/model/baseIndexSettings.ts +15 -15
  37. package/model/baseSearchParams.ts +1 -1
  38. package/model/baseSearchParamsWithoutQuery.ts +8 -8
  39. package/model/baseSearchResponse.ts +2 -2
  40. package/model/batchAssignUserIdsParams.ts +1 -1
  41. package/model/batchDictionaryEntriesParams.ts +1 -1
  42. package/model/batchParams.ts +1 -1
  43. package/model/batchResponse.ts +1 -1
  44. package/model/batchWriteParams.ts +1 -1
  45. package/model/booleanString.ts +1 -1
  46. package/model/browseParams.ts +2 -1
  47. package/model/browseParamsObject.ts +1 -1
  48. package/model/browseResponse.ts +1 -1
  49. package/model/builtInOperationType.ts +4 -4
  50. package/model/builtInOperationValue.ts +1 -1
  51. package/model/clientMethodProps.ts +50 -34
  52. package/model/consequence.ts +2 -2
  53. package/model/consequenceQueryObject.ts +2 -2
  54. package/model/deleteByParams.ts +3 -3
  55. package/model/dictionaryEntry.ts +2 -2
  56. package/model/dictionaryEntryState.ts +1 -1
  57. package/model/dictionaryType.ts +1 -1
  58. package/model/facetFilters.ts +1 -1
  59. package/model/facetOrdering.ts +1 -1
  60. package/model/facets.ts +1 -1
  61. package/model/fetchedIndex.ts +1 -1
  62. package/model/getApiKeyResponse.ts +1 -1
  63. package/model/getLogsResponse.ts +1 -1
  64. package/model/getObjectsParams.ts +1 -1
  65. package/model/getObjectsRequest.ts +1 -1
  66. package/model/getTopUserIdsResponse.ts +1 -1
  67. package/model/hasPendingMappingsResponse.ts +1 -1
  68. package/model/highlightResult.ts +1 -1
  69. package/model/highlightResultOption.ts +1 -1
  70. package/model/hit.ts +2 -2
  71. package/model/ignorePlurals.ts +1 -1
  72. package/model/index.ts +13 -7
  73. package/model/indexSettingsAsSearchParams.ts +15 -15
  74. package/model/listApiKeysResponse.ts +1 -1
  75. package/model/listClustersResponse.ts +1 -1
  76. package/model/listIndicesResponse.ts +1 -1
  77. package/model/listUserIdsResponse.ts +1 -1
  78. package/model/log.ts +1 -1
  79. package/model/logType.ts +1 -1
  80. package/model/matchLevel.ts +1 -1
  81. package/model/mode.ts +1 -1
  82. package/model/multipleBatchResponse.ts +2 -2
  83. package/model/numericFilters.ts +2 -2
  84. package/model/operationIndexParams.ts +1 -1
  85. package/model/operationType.ts +1 -1
  86. package/model/optionalFilters.ts +1 -1
  87. package/model/promote.ts +1 -1
  88. package/model/promoteObjectIDs.ts +1 -1
  89. package/model/queryType.ts +2 -2
  90. package/model/reRankingApplyFilter.ts +1 -1
  91. package/model/redirect.ts +1 -1
  92. package/model/removeStopWords.ts +1 -1
  93. package/model/removeWordsIfNoResults.ts +1 -1
  94. package/model/renderingContent.ts +4 -1
  95. package/model/replaceAllObjectsResponse.ts +1 -1
  96. package/model/rule.ts +2 -2
  97. package/model/scopeType.ts +1 -1
  98. package/model/searchDictionaryEntriesResponse.ts +1 -1
  99. package/model/searchForFacetValuesResponse.ts +1 -1
  100. package/model/searchForFacets.ts +1 -1
  101. package/model/searchForHits.ts +1 -1
  102. package/model/searchHits.ts +1 -1
  103. package/model/searchMethodParams.ts +1 -1
  104. package/model/searchParams.ts +1 -1
  105. package/model/searchQuery.ts +1 -1
  106. package/model/searchResponse.ts +1 -1
  107. package/model/searchResponses.ts +1 -1
  108. package/model/searchResult.ts +1 -1
  109. package/model/searchRulesResponse.ts +1 -1
  110. package/model/searchSynonymsResponse.ts +1 -1
  111. package/model/searchUserIdsParams.ts +1 -1
  112. package/model/searchUserIdsResponse.ts +2 -2
  113. package/model/securedApiKeyRestrictions.ts +1 -1
  114. package/model/semanticSearch.ts +1 -1
  115. package/model/snippetResult.ts +1 -1
  116. package/model/sortRemainingBy.ts +1 -1
  117. package/model/standardEntries.ts +3 -3
  118. package/model/supportedLanguage.ts +1 -1
  119. package/model/synonymHit.ts +3 -3
  120. package/model/synonymType.ts +1 -1
  121. package/model/tagFilters.ts +1 -1
  122. package/model/taskStatus.ts +1 -1
  123. package/model/typoTolerance.ts +2 -2
  124. package/model/userHit.ts +1 -1
  125. package/model/value.ts +2 -2
  126. package/model/widgets.ts +10 -0
  127. package/package.json +6 -6
package/model/rule.ts CHANGED
@@ -16,7 +16,7 @@ export type Rule = {
16
16
  /**
17
17
  * Conditions that trigger a rule. Some consequences require specific conditions or don\'t require any condition. For more information, see [Conditions](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/#conditions).
18
18
  */
19
- conditions?: Condition[];
19
+ conditions?: Array<Condition>;
20
20
 
21
21
  consequence?: Consequence;
22
22
 
@@ -33,5 +33,5 @@ export type Rule = {
33
33
  /**
34
34
  * Time periods when the rule is active.
35
35
  */
36
- validity?: TimeRange[];
36
+ validity?: Array<TimeRange>;
37
37
  };
@@ -1,3 +1,3 @@
1
1
  // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
2
2
 
3
- export type ScopeType = 'rules' | 'settings' | 'synonyms';
3
+ export type ScopeType = 'settings' | 'synonyms' | 'rules';
@@ -6,7 +6,7 @@ export type SearchDictionaryEntriesResponse = {
6
6
  /**
7
7
  * Dictionary entries matching the search criteria.
8
8
  */
9
- hits: DictionaryEntry[];
9
+ hits: Array<DictionaryEntry>;
10
10
 
11
11
  /**
12
12
  * Requested page of the API response.
@@ -6,7 +6,7 @@ export type SearchForFacetValuesResponse = {
6
6
  /**
7
7
  * Matching facet values.
8
8
  */
9
- facetHits: FacetHits[];
9
+ facetHits: Array<FacetHits>;
10
10
 
11
11
  /**
12
12
  * Whether the facet count is exhaustive (true) or approximate (false). For more information, see [Why are my facet and hit counts not accurate](https://support.algolia.com/hc/en-us/articles/4406975248145-Why-are-my-facet-and-hit-counts-not-accurate-).
@@ -3,4 +3,4 @@
3
3
  import type { SearchForFacetsOptions } from './searchForFacetsOptions';
4
4
  import type { SearchParams } from './searchParams';
5
5
 
6
- export type SearchForFacets = SearchForFacetsOptions & SearchParams;
6
+ export type SearchForFacets = SearchParams & SearchForFacetsOptions;
@@ -3,4 +3,4 @@
3
3
  import type { SearchForHitsOptions } from './searchForHitsOptions';
4
4
  import type { SearchParams } from './searchParams';
5
5
 
6
- export type SearchForHits = SearchForHitsOptions & SearchParams;
6
+ export type SearchForHits = SearchParams & SearchForHitsOptions;
@@ -6,7 +6,7 @@ export type SearchHits<T = Record<string, any>> = Record<string, any> & {
6
6
  /**
7
7
  * Search results (hits). Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting.
8
8
  */
9
- hits: Array<Hit<T>>;
9
+ hits: Hit<T>[];
10
10
 
11
11
  /**
12
12
  * Search query.
@@ -4,7 +4,7 @@ import type { SearchQuery } from './searchQuery';
4
4
  import type { SearchStrategy } from './searchStrategy';
5
5
 
6
6
  export type SearchMethodParams = {
7
- requests: SearchQuery[];
7
+ requests: Array<SearchQuery>;
8
8
 
9
9
  strategy?: SearchStrategy;
10
10
  };
@@ -3,4 +3,4 @@
3
3
  import type { SearchParamsObject } from './searchParamsObject';
4
4
  import type { SearchParamsString } from './searchParamsString';
5
5
 
6
- export type SearchParams = SearchParamsObject | SearchParamsString;
6
+ export type SearchParams = SearchParamsString | SearchParamsObject;
@@ -3,4 +3,4 @@
3
3
  import type { SearchForFacets } from './searchForFacets';
4
4
  import type { SearchForHits } from './searchForHits';
5
5
 
6
- export type SearchQuery = SearchForFacets | SearchForHits;
6
+ export type SearchQuery = SearchForHits | SearchForFacets;
@@ -4,4 +4,4 @@ import type { BaseSearchResponse } from './baseSearchResponse';
4
4
  import type { SearchHits } from './searchHits';
5
5
  import type { SearchPagination } from './searchPagination';
6
6
 
7
- export type SearchResponse<T = Record<string, any>> = BaseSearchResponse & SearchHits<T> & SearchPagination;
7
+ export type SearchResponse<T = Record<string, any>> = BaseSearchResponse & SearchPagination & SearchHits<T>;
@@ -3,5 +3,5 @@
3
3
  import type { SearchResult } from './searchResult';
4
4
 
5
5
  export type SearchResponses<T = Record<string, any>> = {
6
- results: Array<SearchResult<T>>;
6
+ results: SearchResult<T>[];
7
7
  };
@@ -3,4 +3,4 @@
3
3
  import type { SearchForFacetValuesResponse } from './searchForFacetValuesResponse';
4
4
  import type { SearchResponse } from './searchResponse';
5
5
 
6
- export type SearchResult<T = Record<string, any>> = SearchForFacetValuesResponse | SearchResponse<T>;
6
+ export type SearchResult<T = Record<string, any>> = SearchResponse<T> | SearchForFacetValuesResponse;
@@ -6,7 +6,7 @@ export type SearchRulesResponse = {
6
6
  /**
7
7
  * Rules that matched the search criteria.
8
8
  */
9
- hits: Rule[];
9
+ hits: Array<Rule>;
10
10
 
11
11
  /**
12
12
  * Number of rules that matched the search criteria.
@@ -6,7 +6,7 @@ export type SearchSynonymsResponse = Record<string, any> & {
6
6
  /**
7
7
  * Matching synonyms.
8
8
  */
9
- hits: SynonymHit[];
9
+ hits: Array<SynonymHit>;
10
10
 
11
11
  /**
12
12
  * Number of results (hits).
@@ -1,7 +1,7 @@
1
1
  // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
2
2
 
3
3
  /**
4
- * OK.
4
+ * OK
5
5
  */
6
6
  export type SearchUserIdsParams = {
7
7
  /**
@@ -3,13 +3,13 @@
3
3
  import type { UserHit } from './userHit';
4
4
 
5
5
  /**
6
- * UserIDs data.
6
+ * userIDs data.
7
7
  */
8
8
  export type SearchUserIdsResponse = {
9
9
  /**
10
10
  * User objects that match the query.
11
11
  */
12
- hits: UserHit[];
12
+ hits: Array<UserHit>;
13
13
 
14
14
  /**
15
15
  * Number of results (hits).
@@ -18,7 +18,7 @@ export type SecuredApiKeyRestrictions = {
18
18
  /**
19
19
  * Index names or patterns that this API key can access. By default, an API key can access all indices in the same application. You can use leading and trailing wildcard characters (`*`): - `dev_*` matches all indices starting with \"dev_\". - `*_dev` matches all indices ending with \"_dev\". - `*_products_*` matches all indices containing \"_products_\".
20
20
  */
21
- restrictIndices?: string[];
21
+ restrictIndices?: Array<string>;
22
22
 
23
23
  /**
24
24
  * IP network that are allowed to use this key. You can only add a single source, but you can provide a range of IP addresses. Use this to protect against API key leaking and reuse.
@@ -7,5 +7,5 @@ export type SemanticSearch = {
7
7
  /**
8
8
  * Indices from which to collect click and conversion events. If null, the current index and all its replicas are used.
9
9
  */
10
- eventSources?: string[] | null;
10
+ eventSources?: Array<string> | null;
11
11
  };
@@ -2,4 +2,4 @@
2
2
 
3
3
  import type { SnippetResultOption } from './snippetResultOption';
4
4
 
5
- export type SnippetResult = SnippetResult[] | SnippetResultOption | { [key: string]: SnippetResult };
5
+ export type SnippetResult = SnippetResultOption | { [key: string]: SnippetResult } | Array<SnippetResult>;
@@ -3,4 +3,4 @@
3
3
  /**
4
4
  * Order of facet values that aren\'t explicitly positioned with the `order` setting. - `count`. Order remaining facet values by decreasing count. The count is the number of matching records containing this facet value. - `alpha`. Sort facet values alphabetically. - `hidden`. Don\'t show facet values that aren\'t explicitly positioned.
5
5
  */
6
- export type SortRemainingBy = 'alpha' | 'count' | 'hidden';
6
+ export type SortRemainingBy = 'count' | 'alpha' | 'hidden';
@@ -7,15 +7,15 @@ export type StandardEntries = {
7
7
  /**
8
8
  * Key-value pair of a language ISO code and a boolean value.
9
9
  */
10
- plurals?: Record<string, boolean> | null;
10
+ plurals?: { [key: string]: boolean } | null;
11
11
 
12
12
  /**
13
13
  * Key-value pair of a language ISO code and a boolean value.
14
14
  */
15
- stopwords?: Record<string, boolean> | null;
15
+ stopwords?: { [key: string]: boolean } | null;
16
16
 
17
17
  /**
18
18
  * Key-value pair of a language ISO code and a boolean value.
19
19
  */
20
- compounds?: Record<string, boolean> | null;
20
+ compounds?: { [key: string]: boolean } | null;
21
21
  };
@@ -52,8 +52,8 @@ export type SupportedLanguage =
52
52
  | 'ns'
53
53
  | 'pl'
54
54
  | 'ps'
55
- | 'pt-br'
56
55
  | 'pt'
56
+ | 'pt-br'
57
57
  | 'qu'
58
58
  | 'ro'
59
59
  | 'ru'
@@ -16,7 +16,7 @@ export type SynonymHit = {
16
16
  /**
17
17
  * Words or phrases considered equivalent.
18
18
  */
19
- synonyms?: string[];
19
+ synonyms?: Array<string>;
20
20
 
21
21
  /**
22
22
  * Word or phrase to appear in query strings (for [`onewaysynonym`s](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/in-depth/one-way-synonyms/)).
@@ -31,7 +31,7 @@ export type SynonymHit = {
31
31
  /**
32
32
  * Words to be matched in records.
33
33
  */
34
- corrections?: string[];
34
+ corrections?: Array<string>;
35
35
 
36
36
  /**
37
37
  * [Placeholder token](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/in-depth/synonyms-placeholders/) to be put inside records.
@@ -41,5 +41,5 @@ export type SynonymHit = {
41
41
  /**
42
42
  * Query words that will match the [placeholder token](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/in-depth/synonyms-placeholders/).
43
43
  */
44
- replacements?: string[];
44
+ replacements?: Array<string>;
45
45
  };
@@ -3,4 +3,4 @@
3
3
  /**
4
4
  * Synonym type.
5
5
  */
6
- export type SynonymType = 'altcorrection1' | 'altcorrection2' | 'onewaysynonym' | 'placeholder' | 'synonym';
6
+ export type SynonymType = 'synonym' | 'onewaysynonym' | 'altcorrection1' | 'altcorrection2' | 'placeholder';
@@ -3,4 +3,4 @@
3
3
  /**
4
4
  * Filter the search by values of the special `_tags` attribute. **Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.** Different from regular facets, `_tags` can only be used for filtering (including or excluding records). You won\'t get a facet count. The same combination and escaping rules apply as for `facetFilters`.
5
5
  */
6
- export type TagFilters = TagFilters[] | string;
6
+ export type TagFilters = Array<TagFilters> | string;
@@ -3,4 +3,4 @@
3
3
  /**
4
4
  * Task status, `published` if the task is completed, `notPublished` otherwise.
5
5
  */
6
- export type TaskStatus = 'notPublished' | 'published';
6
+ export type TaskStatus = 'published' | 'notPublished';
@@ -3,6 +3,6 @@
3
3
  import type { TypoToleranceEnum } from './typoToleranceEnum';
4
4
 
5
5
  /**
6
- * Whether [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/) is enabled and how it is applied. If typo tolerance is true, `min`, or `strict`, [word splitting and concetenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation/) is also active.
6
+ * Whether [typo tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/) is enabled and how it is applied. If typo tolerance is true, `min`, or `strict`, [word splitting and concatenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation/) are also active.
7
7
  */
8
- export type TypoTolerance = TypoToleranceEnum | boolean;
8
+ export type TypoTolerance = boolean | TypoToleranceEnum;
package/model/userHit.ts CHANGED
@@ -24,7 +24,7 @@ export type UserHit = {
24
24
  dataSize: number;
25
25
 
26
26
  /**
27
- * UserID of the requested user. Same as userID.
27
+ * userID of the requested user. Same as userID.
28
28
  */
29
29
  objectID: string;
30
30
 
package/model/value.ts CHANGED
@@ -6,12 +6,12 @@ export type Value = {
6
6
  /**
7
7
  * Explicit order of facets or facet values. This setting lets you always show specific facets or facet values at the top of the list.
8
8
  */
9
- order?: string[];
9
+ order?: Array<string>;
10
10
 
11
11
  sortRemainingBy?: SortRemainingBy;
12
12
 
13
13
  /**
14
14
  * Hide facet values.
15
15
  */
16
- hide?: string[];
16
+ hide?: Array<string>;
17
17
  };
@@ -0,0 +1,10 @@
1
+ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
2
+
3
+ import type { Banners } from './banners';
4
+
5
+ /**
6
+ * widgets returned from any rules that are applied to the current search.
7
+ */
8
+ export type Widgets = {
9
+ banners?: Banners;
10
+ };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.7.0",
2
+ "version": "5.8.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/algolia/algoliasearch-client-javascript.git"
@@ -49,16 +49,16 @@
49
49
  "index.d.ts"
50
50
  ],
51
51
  "dependencies": {
52
- "@algolia/client-common": "5.7.0",
53
- "@algolia/requester-browser-xhr": "5.7.0",
54
- "@algolia/requester-fetch": "5.7.0",
55
- "@algolia/requester-node-http": "5.7.0"
52
+ "@algolia/client-common": "5.8.0",
53
+ "@algolia/requester-browser-xhr": "5.8.0",
54
+ "@algolia/requester-fetch": "5.8.0",
55
+ "@algolia/requester-node-http": "5.8.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@arethetypeswrong/cli": "0.16.4",
59
59
  "@types/node": "22.7.4",
60
60
  "publint": "0.2.11",
61
- "rollup": "4.22.5",
61
+ "rollup": "4.24.0",
62
62
  "tsup": "8.3.0",
63
63
  "typescript": "5.6.2"
64
64
  },