@algolia/recommend 5.6.1 → 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.
- package/README.md +5 -6
- package/dist/browser.d.ts +409 -295
- package/dist/builds/browser.js +40 -19
- package/dist/builds/browser.js.map +1 -1
- package/dist/builds/browser.min.js +1 -1
- package/dist/builds/browser.min.js.map +1 -1
- package/dist/builds/browser.umd.js +2 -2
- package/dist/builds/fetch.js +37 -16
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +37 -16
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +38 -17
- package/dist/builds/node.js.map +1 -1
- package/dist/fetch.d.ts +408 -293
- package/dist/node.d.cts +408 -293
- package/dist/node.d.ts +408 -293
- package/dist/src/recommendClient.cjs +36 -15
- package/dist/src/recommendClient.cjs.map +1 -1
- package/dist/src/recommendClient.js +36 -15
- package/dist/src/recommendClient.js.map +1 -1
- package/index.js +1 -1
- package/model/alternativesAsExact.ts +1 -1
- package/model/aroundPrecision.ts +1 -1
- package/model/aroundRadius.ts +1 -1
- package/model/banner.ts +13 -0
- package/model/bannerImage.ts +12 -0
- package/model/bannerImageUrl.ts +8 -0
- package/model/bannerLink.ts +8 -0
- package/model/banners.ts +10 -0
- package/model/baseIndexSettings.ts +15 -15
- package/model/baseRecommendIndexSettings.ts +14 -14
- package/model/baseRecommendSearchParams.ts +8 -8
- package/model/baseSearchResponse.ts +2 -2
- package/model/booleanString.ts +1 -1
- package/model/clientMethodProps.ts +24 -6
- package/model/consequence.ts +2 -2
- package/model/facetFilters.ts +1 -1
- package/model/facetOrdering.ts +1 -1
- package/model/getRecommendationsParams.ts +1 -1
- package/model/getRecommendationsResponse.ts +1 -1
- package/model/highlightResult.ts +1 -1
- package/model/highlightResultOption.ts +1 -1
- package/model/ignorePlurals.ts +1 -1
- package/model/index.ts +17 -9
- package/model/indexSettingsFacets.ts +1 -1
- package/model/matchLevel.ts +1 -1
- package/model/numericFilters.ts +2 -2
- package/model/optionalFilters.ts +1 -1
- package/model/paramsConsequence.ts +2 -2
- package/model/queryType.ts +2 -2
- package/model/reRankingApplyFilter.ts +1 -1
- package/model/recommendHit.ts +2 -2
- package/model/recommendModels.ts +1 -1
- package/model/recommendRule.ts +6 -0
- package/model/recommendSearchParams.ts +1 -1
- package/model/recommendUpdatedAtResponse.ts +16 -0
- package/model/recommendationsHit.ts +1 -0
- package/model/recommendationsHits.ts +1 -1
- package/model/recommendationsRequest.ts +5 -3
- package/model/recommendationsResults.ts +1 -1
- package/model/redirect.ts +1 -1
- package/model/removeStopWords.ts +1 -1
- package/model/removeWordsIfNoResults.ts +1 -1
- package/model/renderingContent.ts +4 -1
- package/model/searchRecommendRulesParams.ts +1 -1
- package/model/searchRecommendRulesResponse.ts +1 -1
- package/model/snippetResult.ts +1 -1
- package/model/sortRemainingBy.ts +1 -1
- package/model/supportedLanguage.ts +1 -1
- package/model/tagFilters.ts +1 -1
- package/model/taskStatus.ts +1 -1
- package/model/timeRange.ts +13 -0
- package/model/typoTolerance.ts +2 -2
- package/model/value.ts +2 -2
- package/model/widgets.ts +10 -0
- package/package.json +7 -7
package/model/recommendRule.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import type { Condition } from './condition';
|
|
4
4
|
import type { Consequence } from './consequence';
|
|
5
5
|
import type { RuleMetadata } from './ruleMetadata';
|
|
6
|
+
import type { TimeRange } from './timeRange';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Recommend rule.
|
|
@@ -28,4 +29,9 @@ export type RecommendRule = {
|
|
|
28
29
|
* Indicates whether to enable the rule. If it isn\'t enabled, it isn\'t applied at query time.
|
|
29
30
|
*/
|
|
30
31
|
enabled?: boolean;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Time periods when the rule is active.
|
|
35
|
+
*/
|
|
36
|
+
validity?: Array<TimeRange>;
|
|
31
37
|
};
|
|
@@ -7,4 +7,4 @@ import type { SearchParamsQuery } from './searchParamsQuery';
|
|
|
7
7
|
/**
|
|
8
8
|
* Search parameters for filtering the recommendations.
|
|
9
9
|
*/
|
|
10
|
-
export type RecommendSearchParams = BaseRecommendSearchParams &
|
|
10
|
+
export type RecommendSearchParams = BaseRecommendSearchParams & SearchParamsQuery & RecommendIndexSettings;
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
/**
|
|
4
|
+
* Response, taskID, and update timestamp.
|
|
5
|
+
*/
|
|
6
|
+
export type RecommendUpdatedAtResponse = {
|
|
7
|
+
/**
|
|
8
|
+
* Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run immediately. You can check the task\'s progress with the [`task` operation](#tag/Indices/operation/getTask) and this `taskID`.
|
|
9
|
+
*/
|
|
10
|
+
taskID: number;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Date and time when the object was updated, in RFC 3339 format.
|
|
14
|
+
*/
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
};
|
|
@@ -1,6 +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
|
import type { RecommendHit } from './recommendHit';
|
|
4
|
+
|
|
4
5
|
import type { TrendingFacetHit } from './trendingFacetHit';
|
|
5
6
|
|
|
6
7
|
export type RecommendationsHit = RecommendHit | TrendingFacetHit;
|
|
@@ -1,7 +1,9 @@
|
|
|
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
|
import type { BoughtTogetherQuery } from './boughtTogetherQuery';
|
|
4
|
+
|
|
4
5
|
import type { LookingSimilarQuery } from './lookingSimilarQuery';
|
|
6
|
+
|
|
5
7
|
import type { RecommendedForYouQuery } from './recommendedForYouQuery';
|
|
6
8
|
import type { RelatedQuery } from './relatedQuery';
|
|
7
9
|
import type { TrendingFacetsQuery } from './trendingFacetsQuery';
|
|
@@ -9,8 +11,8 @@ import type { TrendingItemsQuery } from './trendingItemsQuery';
|
|
|
9
11
|
|
|
10
12
|
export type RecommendationsRequest =
|
|
11
13
|
| BoughtTogetherQuery
|
|
12
|
-
| LookingSimilarQuery
|
|
13
|
-
| RecommendedForYouQuery
|
|
14
14
|
| RelatedQuery
|
|
15
|
+
| TrendingItemsQuery
|
|
15
16
|
| TrendingFacetsQuery
|
|
16
|
-
|
|
|
17
|
+
| LookingSimilarQuery
|
|
18
|
+
| RecommendedForYouQuery;
|
|
@@ -4,4 +4,4 @@ import type { BaseSearchResponse } from './baseSearchResponse';
|
|
|
4
4
|
import type { RecommendationsHits } from './recommendationsHits';
|
|
5
5
|
import type { SearchPagination } from './searchPagination';
|
|
6
6
|
|
|
7
|
-
export type RecommendationsResults = BaseSearchResponse &
|
|
7
|
+
export type RecommendationsResults = BaseSearchResponse & SearchPagination & RecommendationsHits;
|
package/model/redirect.ts
CHANGED
|
@@ -6,5 +6,5 @@ import type { RedirectRuleIndexMetadata } from './redirectRuleIndexMetadata';
|
|
|
6
6
|
* [Redirect results to a URL](https://www.algolia.com/doc/guides/managing-results/rules/merchandising-and-promoting/how-to/redirects/), this this parameter is for internal use only.
|
|
7
7
|
*/
|
|
8
8
|
export type Redirect = {
|
|
9
|
-
index?: RedirectRuleIndexMetadata
|
|
9
|
+
index?: Array<RedirectRuleIndexMetadata>;
|
|
10
10
|
};
|
package/model/removeStopWords.ts
CHANGED
|
@@ -5,4 +5,4 @@ import type { SupportedLanguage } from './supportedLanguage';
|
|
|
5
5
|
/**
|
|
6
6
|
* Removes stop words from the search query. Stop words are common words like articles, conjunctions, prepositions, or pronouns that have little or no meaning on their own. In English, \"the\", \"a\", or \"and\" are stop words. You should only use this feature for the languages used in your index.
|
|
7
7
|
*/
|
|
8
|
-
export type RemoveStopWords = SupportedLanguage
|
|
8
|
+
export type RemoveStopWords = Array<SupportedLanguage> | boolean;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Strategy for removing words from the query when it doesn\'t return any results. This helps to avoid returning empty search results. - `none`. No words are removed when a query doesn\'t return results. - `lastWords`. Treat the last (then second to last, then third to last) word as optional, until there are results or at most 5 words have been removed. - `firstWords`. Treat the first (then second, then third) word as optional, until there are results or at most 5 words have been removed. - `allOptional`. Treat all words as optional. For more information, see [Remove words to improve results](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/in-depth/why-use-remove-words-if-no-results/).
|
|
5
5
|
*/
|
|
6
|
-
export type RemoveWordsIfNoResults = '
|
|
6
|
+
export type RemoveWordsIfNoResults = 'none' | 'lastWords' | 'firstWords' | 'allOptional';
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import type { FacetOrdering } from './facetOrdering';
|
|
4
4
|
import type { RedirectURL } from './redirectURL';
|
|
5
|
+
import type { Widgets } from './widgets';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
|
-
* Extra data that can be used in the search UI. You can use this to control aspects of your search UI, such as
|
|
8
|
+
* Extra data that can be used in the search UI. You can use this to control aspects of your search UI, such as the order of facet names and values without changing your frontend code.
|
|
8
9
|
*/
|
|
9
10
|
export type RenderingContent = {
|
|
10
11
|
facetOrdering?: FacetOrdering;
|
|
11
12
|
|
|
12
13
|
redirect?: RedirectURL;
|
|
14
|
+
|
|
15
|
+
widgets?: Widgets;
|
|
13
16
|
};
|
|
@@ -37,7 +37,7 @@ export type SearchRecommendRulesParams = {
|
|
|
37
37
|
/**
|
|
38
38
|
* Include facets and facet values in the response. Use `[\'*\']` to include all facets.
|
|
39
39
|
*/
|
|
40
|
-
facets?: string
|
|
40
|
+
facets?: Array<string>;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Maximum number of values to return for each facet.
|
package/model/snippetResult.ts
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
|
|
3
3
|
import type { SnippetResultOption } from './snippetResultOption';
|
|
4
4
|
|
|
5
|
-
export type SnippetResult =
|
|
5
|
+
export type SnippetResult = SnippetResultOption | { [key: string]: SnippetResult } | Array<SnippetResult>;
|
package/model/sortRemainingBy.ts
CHANGED
|
@@ -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 = '
|
|
6
|
+
export type SortRemainingBy = 'count' | 'alpha' | 'hidden';
|
package/model/tagFilters.ts
CHANGED
|
@@ -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
|
|
6
|
+
export type TagFilters = Array<TagFilters> | string;
|
package/model/taskStatus.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
export type TimeRange = {
|
|
4
|
+
/**
|
|
5
|
+
* When the rule should start to be active, in Unix epoch time.
|
|
6
|
+
*/
|
|
7
|
+
from: number;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* When the rule should stop to be active, in Unix epoch time.
|
|
11
|
+
*/
|
|
12
|
+
until: number;
|
|
13
|
+
};
|
package/model/typoTolerance.ts
CHANGED
|
@@ -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
|
|
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 =
|
|
8
|
+
export type TypoTolerance = boolean | TypoToleranceEnum;
|
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
|
};
|
package/model/widgets.ts
ADDED
|
@@ -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.
|
|
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.
|
|
53
|
-
"@algolia/requester-browser-xhr": "5.
|
|
54
|
-
"@algolia/requester-fetch": "5.
|
|
55
|
-
"@algolia/requester-node-http": "5.
|
|
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
|
-
"@types/node": "22.
|
|
59
|
+
"@types/node": "22.7.4",
|
|
60
60
|
"publint": "0.2.11",
|
|
61
|
-
"rollup": "4.
|
|
61
|
+
"rollup": "4.24.0",
|
|
62
62
|
"tsup": "8.3.0",
|
|
63
63
|
"typescript": "5.6.2"
|
|
64
64
|
},
|