@algolia/recommend 5.0.0-alpha.77 → 5.0.0-alpha.78
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/dist/model/baseSearchParamsWithoutQuery.d.ts +12 -14
- package/dist/model/baseSearchParamsWithoutQuery.d.ts.map +1 -1
- package/dist/model/index.d.ts +1 -1
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/indexSettingsAsSearchParams.d.ts +16 -14
- package/dist/model/indexSettingsAsSearchParams.d.ts.map +1 -1
- package/dist/model/{indexSettingsAsSearchParamsSemanticSearch.d.ts → semanticSearch.d.ts} +2 -2
- package/dist/model/semanticSearch.d.ts.map +1 -0
- package/dist/{recommend.cjs.js → recommend.cjs} +1 -1
- package/dist/recommend.esm.browser.js +1 -1
- package/dist/recommend.esm.node.js +1 -1
- package/dist/recommend.umd.js +2 -2
- package/dist/src/recommendClient.d.ts +1 -1
- package/index.js +1 -1
- package/model/baseSearchParamsWithoutQuery.ts +14 -17
- package/model/index.ts +1 -1
- package/model/indexSettingsAsSearchParams.ts +20 -17
- package/model/{indexSettingsAsSearchParamsSemanticSearch.ts → semanticSearch.ts} +1 -1
- package/package.json +8 -8
- package/dist/model/indexSettingsAsSearchParamsSemanticSearch.d.ts.map +0 -1
|
@@ -3,7 +3,6 @@ import type { AroundRadius } from './aroundRadius';
|
|
|
3
3
|
import type { FacetFilters } from './facetFilters';
|
|
4
4
|
import type { NumericFilters } from './numericFilters';
|
|
5
5
|
import type { OptionalFilters } from './optionalFilters';
|
|
6
|
-
import type { ReRankingApplyFilter } from './reRankingApplyFilter';
|
|
7
6
|
import type { TagFilters } from './tagFilters';
|
|
8
7
|
export type BaseSearchParamsWithoutQuery = {
|
|
9
8
|
/**
|
|
@@ -23,21 +22,17 @@ export type BaseSearchParamsWithoutQuery = {
|
|
|
23
22
|
*/
|
|
24
23
|
sumOrFiltersScores?: boolean;
|
|
25
24
|
/**
|
|
26
|
-
*
|
|
25
|
+
* Restricts a query to only look at a subset of your [searchable attributes](https://www.algolia.com/doc/guides/managing-results/must-do/searchable-attributes/).
|
|
27
26
|
*/
|
|
28
|
-
|
|
27
|
+
restrictSearchableAttributes?: string[];
|
|
29
28
|
/**
|
|
30
|
-
*
|
|
29
|
+
* Returns [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts), their facet values, and the number of matching facet values.
|
|
31
30
|
*/
|
|
32
|
-
|
|
31
|
+
facets?: string[];
|
|
33
32
|
/**
|
|
34
33
|
* Forces faceting to be applied after [de-duplication](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/) (with the distinct feature). Alternatively, the `afterDistinct` [modifier](https://www.algolia.com/doc/api-reference/api-parameters/attributesForFaceting/#modifiers) of `attributesForFaceting` allows for more granular control.
|
|
35
34
|
*/
|
|
36
35
|
facetingAfterDistinct?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Controls how facet values are fetched.
|
|
39
|
-
*/
|
|
40
|
-
sortFacetValuesBy?: string;
|
|
41
36
|
/**
|
|
42
37
|
* Page to retrieve (the first page is `0`, not `1`).
|
|
43
38
|
*/
|
|
@@ -92,6 +87,14 @@ export type BaseSearchParamsWithoutQuery = {
|
|
|
92
87
|
* Incidates whether the search response includes [detailed ranking information](https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/understanding-the-api-response/#ranking-information).
|
|
93
88
|
*/
|
|
94
89
|
getRankingInfo?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Enriches the API\'s response with information about how the query was processed.
|
|
92
|
+
*/
|
|
93
|
+
explain?: string[];
|
|
94
|
+
/**
|
|
95
|
+
* Whether to take into account an index\'s synonyms for a particular search.
|
|
96
|
+
*/
|
|
97
|
+
synonyms?: boolean;
|
|
95
98
|
/**
|
|
96
99
|
* Indicates whether a query ID parameter is included in the search response. This is required for [tracking click and conversion events](https://www.algolia.com/doc/guides/sending-events/concepts/event-types/#events-related-to-algolia-requests).
|
|
97
100
|
*/
|
|
@@ -112,10 +115,5 @@ export type BaseSearchParamsWithoutQuery = {
|
|
|
112
115
|
* Incidates whether this search will be considered in A/B testing.
|
|
113
116
|
*/
|
|
114
117
|
enableABTest?: boolean;
|
|
115
|
-
/**
|
|
116
|
-
* Indicates whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/).
|
|
117
|
-
*/
|
|
118
|
-
enableReRanking?: boolean;
|
|
119
|
-
reRankingApplyFilter?: ReRankingApplyFilter | null;
|
|
120
118
|
};
|
|
121
119
|
//# sourceMappingURL=baseSearchParamsWithoutQuery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseSearchParamsWithoutQuery.d.ts","sourceRoot":"","sources":["../../model/baseSearchParamsWithoutQuery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"baseSearchParamsWithoutQuery.d.ts","sourceRoot":"","sources":["../../model/baseSearchParamsWithoutQuery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,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B;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IAEzB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC"}
|
package/dist/model/index.d.ts
CHANGED
|
@@ -37,7 +37,6 @@ export * from './highlightResult';
|
|
|
37
37
|
export * from './highlightResultOption';
|
|
38
38
|
export * from './ignorePlurals';
|
|
39
39
|
export * from './indexSettingsAsSearchParams';
|
|
40
|
-
export * from './indexSettingsAsSearchParamsSemanticSearch';
|
|
41
40
|
export * from './matchLevel';
|
|
42
41
|
export * from './matchedGeoLocation';
|
|
43
42
|
export * from './mixedSearchFilters';
|
|
@@ -70,6 +69,7 @@ export * from './searchParamsObject';
|
|
|
70
69
|
export * from './searchParamsQuery';
|
|
71
70
|
export * from './searchRecommendRulesParams';
|
|
72
71
|
export * from './searchRecommendRulesResponse';
|
|
72
|
+
export * from './semanticSearch';
|
|
73
73
|
export * from './snippetResult';
|
|
74
74
|
export * from './snippetResultOption';
|
|
75
75
|
export * from './sortRemainingBy';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../model/index.ts"],"names":[],"mappings":"AAEA,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iCAAiC,CAAC;AAChD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AA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AAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC"}
|
|
@@ -3,12 +3,13 @@ import type { AlternativesAsExact } from './alternativesAsExact';
|
|
|
3
3
|
import type { Distinct } from './distinct';
|
|
4
4
|
import type { ExactOnSingleWordQuery } from './exactOnSingleWordQuery';
|
|
5
5
|
import type { IgnorePlurals } from './ignorePlurals';
|
|
6
|
-
import type { IndexSettingsAsSearchParamsSemanticSearch } from './indexSettingsAsSearchParamsSemanticSearch';
|
|
7
6
|
import type { Mode } from './mode';
|
|
8
7
|
import type { QueryType } from './queryType';
|
|
8
|
+
import type { ReRankingApplyFilter } from './reRankingApplyFilter';
|
|
9
9
|
import type { RemoveStopWords } from './removeStopWords';
|
|
10
10
|
import type { RemoveWordsIfNoResults } from './removeWordsIfNoResults';
|
|
11
11
|
import type { RenderingContent } from './renderingContent';
|
|
12
|
+
import type { SemanticSearch } from './semanticSearch';
|
|
12
13
|
import type { TypoTolerance } from './typoTolerance';
|
|
13
14
|
export type IndexSettingsAsSearchParams = {
|
|
14
15
|
/**
|
|
@@ -19,10 +20,6 @@ export type IndexSettingsAsSearchParams = {
|
|
|
19
20
|
* Attributes to include in the API response. To reduce the size of your response, you can retrieve only some of the attributes. By default, the response includes all attributes.
|
|
20
21
|
*/
|
|
21
22
|
attributesToRetrieve?: string[];
|
|
22
|
-
/**
|
|
23
|
-
* Restricts a query to only look at a subset of your [searchable attributes](https://www.algolia.com/doc/guides/managing-results/must-do/searchable-attributes/).
|
|
24
|
-
*/
|
|
25
|
-
restrictSearchableAttributes?: string[];
|
|
26
23
|
/**
|
|
27
24
|
* Determines the order in which Algolia [returns your results](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/).
|
|
28
25
|
*/
|
|
@@ -105,7 +102,7 @@ export type IndexSettingsAsSearchParams = {
|
|
|
105
102
|
queryType?: QueryType;
|
|
106
103
|
removeWordsIfNoResults?: RemoveWordsIfNoResults;
|
|
107
104
|
mode?: Mode;
|
|
108
|
-
semanticSearch?:
|
|
105
|
+
semanticSearch?: SemanticSearch;
|
|
109
106
|
/**
|
|
110
107
|
* Enables the [advanced query syntax](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/#advanced-syntax).
|
|
111
108
|
*/
|
|
@@ -127,19 +124,11 @@ export type IndexSettingsAsSearchParams = {
|
|
|
127
124
|
* Allows you to specify which advanced syntax features are active when `advancedSyntax` is enabled.
|
|
128
125
|
*/
|
|
129
126
|
advancedSyntaxFeatures?: AdvancedSyntaxFeatures[];
|
|
130
|
-
/**
|
|
131
|
-
* Enriches the API\'s response with information about how the query was processed.
|
|
132
|
-
*/
|
|
133
|
-
explain?: string[];
|
|
134
127
|
distinct?: Distinct;
|
|
135
128
|
/**
|
|
136
129
|
* Name of the deduplication attribute to be used with Algolia\'s [_distinct_ feature](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/#introducing-algolias-distinct-feature).
|
|
137
130
|
*/
|
|
138
131
|
attributeForDistinct?: string;
|
|
139
|
-
/**
|
|
140
|
-
* Whether to take into account an index\'s synonyms for a particular search.
|
|
141
|
-
*/
|
|
142
|
-
synonyms?: boolean;
|
|
143
132
|
/**
|
|
144
133
|
* Whether to highlight and snippet the original word that matches the synonym or the synonym itself.
|
|
145
134
|
*/
|
|
@@ -156,10 +145,23 @@ export type IndexSettingsAsSearchParams = {
|
|
|
156
145
|
* Maximum number of facet hits to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values).
|
|
157
146
|
*/
|
|
158
147
|
maxFacetHits?: number;
|
|
148
|
+
/**
|
|
149
|
+
* Maximum number of facet values to return for each facet.
|
|
150
|
+
*/
|
|
151
|
+
maxValuesPerFacet?: number;
|
|
152
|
+
/**
|
|
153
|
+
* Controls how facet values are fetched.
|
|
154
|
+
*/
|
|
155
|
+
sortFacetValuesBy?: string;
|
|
159
156
|
/**
|
|
160
157
|
* When the [Attribute criterion is ranked above Proximity](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#attribute-and-proximity-combinations) in your ranking formula, Proximity is used to select which searchable attribute is matched in the Attribute ranking stage.
|
|
161
158
|
*/
|
|
162
159
|
attributeCriteriaComputedByMinProximity?: boolean;
|
|
163
160
|
renderingContent?: RenderingContent;
|
|
161
|
+
/**
|
|
162
|
+
* Indicates whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/).
|
|
163
|
+
*/
|
|
164
|
+
enableReRanking?: boolean;
|
|
165
|
+
reRankingApplyFilter?: ReRankingApplyFilter | null;
|
|
164
166
|
};
|
|
165
167
|
//# sourceMappingURL=indexSettingsAsSearchParams.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexSettingsAsSearchParams.d.ts","sourceRoot":"","sources":["../../model/indexSettingsAsSearchParams.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACvE,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IAAI,CAAC;IAEZ,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IAEzB;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpC,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;IAEhD;;OAEG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAE5C;;OAEG;IACH,sBAAsB,CAAC,EAAE,sBAAsB,EAAE,CAAC;IAElD,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IAErC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,uCAAuC,CAAC,EAAE,OAAO,CAAC;IAElD,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAEpC;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,oBAAoB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACpD,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Settings for the semantic search part of NeuralSearch. Only used when `mode` is _neuralSearch_.
|
|
3
3
|
*/
|
|
4
|
-
export type
|
|
4
|
+
export type SemanticSearch = {
|
|
5
5
|
/**
|
|
6
6
|
* Indices from which to collect click and conversion events. If null, the current index and replica group will be used as the event source.
|
|
7
7
|
*/
|
|
8
8
|
eventSources?: string[] | null;
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=
|
|
10
|
+
//# sourceMappingURL=semanticSearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semanticSearch.d.ts","sourceRoot":"","sources":["../../model/semanticSearch.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CAChC,CAAC"}
|
|
@@ -4,7 +4,7 @@ var clientCommon = require('@algolia/client-common');
|
|
|
4
4
|
var requesterNodeHttp = require('@algolia/requester-node-http');
|
|
5
5
|
|
|
6
6
|
// 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.
|
|
7
|
-
const apiClientVersion = '5.0.0-alpha.
|
|
7
|
+
const apiClientVersion = '5.0.0-alpha.78';
|
|
8
8
|
function getDefaultHosts(appId) {
|
|
9
9
|
return [
|
|
10
10
|
{
|
|
@@ -673,7 +673,7 @@ function createXhrRequester() {
|
|
|
673
673
|
}
|
|
674
674
|
|
|
675
675
|
// 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.
|
|
676
|
-
const apiClientVersion = '5.0.0-alpha.
|
|
676
|
+
const apiClientVersion = '5.0.0-alpha.78';
|
|
677
677
|
function getDefaultHosts(appId) {
|
|
678
678
|
return [
|
|
679
679
|
{
|
|
@@ -2,7 +2,7 @@ import { createAuth, createTransporter, getAlgoliaAgent, shuffle, DEFAULT_CONNEC
|
|
|
2
2
|
import { createHttpRequester } from '@algolia/requester-node-http';
|
|
3
3
|
|
|
4
4
|
// 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.
|
|
5
|
-
const apiClientVersion = '5.0.0-alpha.
|
|
5
|
+
const apiClientVersion = '5.0.0-alpha.78';
|
|
6
6
|
function getDefaultHosts(appId) {
|
|
7
7
|
return [
|
|
8
8
|
{
|
package/dist/recommend.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! recommend.umd.js | 5.0.0-alpha.
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/recommend"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function a(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function o(){return JSON.parse(a().getItem(r)||"{}")}return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),a=o()[r];return Promise.all([a||t(),void 0!==a])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const s=o();return s[JSON.stringify(e)]=t,a().setItem(r,JSON.stringify(s)),t})),delete:e=>Promise.resolve().then((()=>{const t=o();delete t[JSON.stringify(e)],a().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{a().removeItem(r)}))}}function r(e){const t=[...e.caches],a=t.shift();return void 0===a?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,o,s={miss:()=>Promise.resolve()})=>a.get(e,o,s).catch((()=>r({caches:t}).get(e,o,s))),set:(e,o)=>a.set(e,o).catch((()=>r({caches:t}).set(e,o))),delete:e=>a.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>a.clear().catch((()=>r({caches:t}).clear()))}}function a(e={serializable:!0}){let t={};return{get(r,a,o={miss:()=>Promise.resolve()}){const s=JSON.stringify(r);if(s in t)return Promise.resolve(e.serializable?JSON.parse(t[s]):t[s]);const n=a();return n.then((e=>o.miss(e))).then((()=>n))},set:(r,a)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(a):a,Promise.resolve(a)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const o=12e4;function s(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>o},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=o}}}function n(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class i extends Error{constructor(e,t){super(e),n(this,"name","AlgoliaError"),t&&(this.name=t)}}class c extends i{constructor(e,t,r){super(e,r),n(this,"stackTrace",void 0),this.stackTrace=t}}class l extends c{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",e,"RetryError")}}class u extends c{constructor(e,t,r,a="ApiError"){super(e,r,a),n(this,"status",void 0),this.status=t}}class m extends i{constructor(e,t){super(e,"DeserializationError"),n(this,"response",void 0),this.response=t}}class d extends u{constructor(e,t,r,a){super(e,t,a,"DetailedApiError"),n(this,"error",void 0),this.error=r}}function h(e,t,r){const a=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${encodeURIComponent(t(e[r])?JSON.stringify(e[r]):e[r])}`)).join("&")}(r);let o=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return a.length&&(o+=`?${a}`),o}function p(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function g({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:a,algoliaAgent:o,timeouts:n,requester:i,requestsCache:c,responsesCache:g}){async function f(c,g,f=!0){const w=[],y=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(c,g),P=function(e,t,r){const a={Accept:"application/json",...e,...t,...r},o={};return Object.keys(a).forEach((e=>{const t=a[e];o[e.toLowerCase()]=t})),o}(r,c.headers,g.headers),q="GET"===c.method?{...c.data,...g.data}:{},b={...a,...c.queryParameters,...q};if(o.value&&(b["x-algolia-agent"]=o.value),g&&g.queryParameters)for(const e of Object.keys(g.queryParameters))g.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(g.queryParameters[e])?b[e]=g.queryParameters[e].toString():b[e]=g.queryParameters[e];let v=0;const R=async(e,r)=>{const a=e.pop();if(void 0===a)throw new l(function(e){return e.map((e=>p(e)))}(w));let o=g.timeout;void 0===o&&(o=f?n.read:n.write);const q={data:y,headers:P,method:c.method,url:h(a,c.path,b),connectTimeout:r(v,n.connect),responseTimeout:r(v,o)},T=t=>{const r={request:q,response:t,host:a,triesLeft:e.length};return w.push(r),r},E=await i.send(q);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&0==~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(E)){const o=T(E);return E.isTimedOut&&v++,console.log("Retryable failure",p(o)),await t.set(a,s(a,E.isTimedOut?"timed out":"down")),R(e,r)}if(function({status:e}){return 2==~~(e/100)}(E))return function(e){try{return JSON.parse(e.content)}catch(t){throw new m(t.message,e)}}(E);throw T(E),function({content:e,status:t},r){try{const a=JSON.parse(e);return"error"in a?new d(a.message,t,a.error,r):new u(a.message,t,r)}catch(e){}return new u(e,t,r)}(E,w)},T=e.filter((e=>"readWrite"===e.accept||(f?"read"===e.accept:"write"===e.accept))),E=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(s(e))))))),a=r.filter((e=>e.isUp())),o=r.filter((e=>e.isTimedOut())),n=[...a,...o];return{hosts:n.length>0?n:e,getTimeout:(e,t)=>(0===o.length&&0===e?1:o.length+3+e)*t}}(T);return R([...E.hosts].reverse(),E.getTimeout)}return{hostsCache:t,requester:i,timeouts:n,algoliaAgent:o,baseHeaders:r,baseQueryParameters:a,hosts:e,request:function(e,t={}){const o=e.useReadTransporter||"GET"===e.method;if(!o)return f(e,t,o);const s=()=>f(e,t);if(!0!==(t.cacheable||e.cacheable))return s();const n={request:e,requestOptions:t,transporter:{queryParameters:a,headers:r}};return g.get(n,(()=>c.get(n,(()=>c.set(n,s()).then((e=>Promise.all([c.delete(n),e])),(e=>Promise.all([c.delete(n),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>g.set(n,e)})},requestsCache:c,responsesCache:g}}function f({algoliaAgents:e,client:t,version:r}){const a=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>a.add(e))),a}const w="5.0.0-alpha.77";function y(e){return[{url:`${e}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${e}.algolia.net`,accept:"write",protocol:"https"}].concat(function(e){const t=e;for(let r=e.length-1;r>0;r--){const a=Math.floor(Math.random()*(r+1)),o=e[r];t[r]=e[a],t[a]=o}return t}([{url:`${e}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}e.apiClientVersion=w,e.recommendClient=function(e,o,s){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!o||"string"!=typeof o)throw new Error("`apiKey` is missing.");return function({appId:e,apiKey:t,authMode:r,algoliaAgents:a,...o}){const s=function(e,t,r="WithinHeaders"){const a={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?a:{},queryParameters:()=>"WithinQueryParameters"===r?a:{}}}(e,t,r),n=g({hosts:y(e),...o,algoliaAgent:f({algoliaAgents:a,client:"Recommend",version:w}),baseHeaders:{"content-type":"text/plain",...s.headers(),...o.baseHeaders},baseQueryParameters:{...s.queryParameters(),...o.baseQueryParameters}});return{transporter:n,appId:e,clearCache:()=>Promise.all([n.requestsCache.clear(),n.responsesCache.clear()]).then((()=>{})),get _ua(){return n.algoliaAgent.value},addAlgoliaAgent(e,t){n.algoliaAgent.add({segment:e,version:t})},del({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `del`.");const a={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return n.request(a,r)},deleteRecommendRule({indexName:e,model:t,objectID:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteRecommendRule`.");if(!t)throw new Error("Parameter `model` is required when calling `deleteRecommendRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteRecommendRule`.");const o={method:"DELETE",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return n.request(o,a)},get({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `get`.");const a={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return n.request(a,r)},getRecommendRule({indexName:e,model:t,objectID:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `getRecommendRule`.");if(!t)throw new Error("Parameter `model` is required when calling `getRecommendRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getRecommendRule`.");const o={method:"GET",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return n.request(o,a)},getRecommendStatus({indexName:e,model:t,taskID:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `getRecommendStatus`.");if(!t)throw new Error("Parameter `model` is required when calling `getRecommendStatus`.");if(!r)throw new Error("Parameter `taskID` is required when calling `getRecommendStatus`.");const o={method:"GET",path:"/1/indexes/{indexName}/{model}/task/{taskID}".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)).replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return n.request(o,a)},getRecommendations(e,t){if(!e)throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");if(!e.requests)throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");const r={method:"POST",path:"/1/indexes/*/recommendations",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return n.request(r,t)},post({path:e,parameters:t,body:r},a){if(!e)throw new Error("Parameter `path` is required when calling `post`.");const o={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(o,a)},put({path:e,parameters:t,body:r},a){if(!e)throw new Error("Parameter `path` is required when calling `put`.");const o={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(o,a)},searchRecommendRules({indexName:e,model:t,searchRecommendRulesParams:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `searchRecommendRules`.");if(!t)throw new Error("Parameter `model` is required when calling `searchRecommendRules`.");const o={method:"POST",path:"/1/indexes/{indexName}/{model}/recommend/rules/search".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0};return n.request(o,a)}}}({appId:e,apiKey:o,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const a=(e,a)=>setTimeout((()=>{r.abort(),t({status:0,content:a,isTimedOut:!0})}),e),o=a(e.connectTimeout,"Connection timeout");let s;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===s&&(clearTimeout(o),s=a(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(o),clearTimeout(s),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(o),clearTimeout(s),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:a(),requestsCache:a({serializable:!1}),hostsCache:r({caches:[t({key:`${w}-${e}`}),a()]}),...s})}}));
|
|
1
|
+
/*! recommend.umd.js | 5.0.0-alpha.78 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/recommend"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function a(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function o(){return JSON.parse(a().getItem(r)||"{}")}return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),a=o()[r];return Promise.all([a||t(),void 0!==a])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const s=o();return s[JSON.stringify(e)]=t,a().setItem(r,JSON.stringify(s)),t})),delete:e=>Promise.resolve().then((()=>{const t=o();delete t[JSON.stringify(e)],a().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{a().removeItem(r)}))}}function r(e){const t=[...e.caches],a=t.shift();return void 0===a?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,o,s={miss:()=>Promise.resolve()})=>a.get(e,o,s).catch((()=>r({caches:t}).get(e,o,s))),set:(e,o)=>a.set(e,o).catch((()=>r({caches:t}).set(e,o))),delete:e=>a.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>a.clear().catch((()=>r({caches:t}).clear()))}}function a(e={serializable:!0}){let t={};return{get(r,a,o={miss:()=>Promise.resolve()}){const s=JSON.stringify(r);if(s in t)return Promise.resolve(e.serializable?JSON.parse(t[s]):t[s]);const n=a();return n.then((e=>o.miss(e))).then((()=>n))},set:(r,a)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(a):a,Promise.resolve(a)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const o=12e4;function s(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>o},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=o}}}function n(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class i extends Error{constructor(e,t){super(e),n(this,"name","AlgoliaError"),t&&(this.name=t)}}class c extends i{constructor(e,t,r){super(e,r),n(this,"stackTrace",void 0),this.stackTrace=t}}class l extends c{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",e,"RetryError")}}class u extends c{constructor(e,t,r,a="ApiError"){super(e,r,a),n(this,"status",void 0),this.status=t}}class m extends i{constructor(e,t){super(e,"DeserializationError"),n(this,"response",void 0),this.response=t}}class d extends u{constructor(e,t,r,a){super(e,t,a,"DetailedApiError"),n(this,"error",void 0),this.error=r}}function h(e,t,r){const a=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${encodeURIComponent(t(e[r])?JSON.stringify(e[r]):e[r])}`)).join("&")}(r);let o=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return a.length&&(o+=`?${a}`),o}function p(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function g({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:a,algoliaAgent:o,timeouts:n,requester:i,requestsCache:c,responsesCache:g}){async function f(c,g,f=!0){const w=[],y=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(c,g),P=function(e,t,r){const a={Accept:"application/json",...e,...t,...r},o={};return Object.keys(a).forEach((e=>{const t=a[e];o[e.toLowerCase()]=t})),o}(r,c.headers,g.headers),q="GET"===c.method?{...c.data,...g.data}:{},b={...a,...c.queryParameters,...q};if(o.value&&(b["x-algolia-agent"]=o.value),g&&g.queryParameters)for(const e of Object.keys(g.queryParameters))g.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(g.queryParameters[e])?b[e]=g.queryParameters[e].toString():b[e]=g.queryParameters[e];let v=0;const R=async(e,r)=>{const a=e.pop();if(void 0===a)throw new l(function(e){return e.map((e=>p(e)))}(w));let o=g.timeout;void 0===o&&(o=f?n.read:n.write);const q={data:y,headers:P,method:c.method,url:h(a,c.path,b),connectTimeout:r(v,n.connect),responseTimeout:r(v,o)},T=t=>{const r={request:q,response:t,host:a,triesLeft:e.length};return w.push(r),r},E=await i.send(q);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&0==~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(E)){const o=T(E);return E.isTimedOut&&v++,console.log("Retryable failure",p(o)),await t.set(a,s(a,E.isTimedOut?"timed out":"down")),R(e,r)}if(function({status:e}){return 2==~~(e/100)}(E))return function(e){try{return JSON.parse(e.content)}catch(t){throw new m(t.message,e)}}(E);throw T(E),function({content:e,status:t},r){try{const a=JSON.parse(e);return"error"in a?new d(a.message,t,a.error,r):new u(a.message,t,r)}catch(e){}return new u(e,t,r)}(E,w)},T=e.filter((e=>"readWrite"===e.accept||(f?"read"===e.accept:"write"===e.accept))),E=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(s(e))))))),a=r.filter((e=>e.isUp())),o=r.filter((e=>e.isTimedOut())),n=[...a,...o];return{hosts:n.length>0?n:e,getTimeout:(e,t)=>(0===o.length&&0===e?1:o.length+3+e)*t}}(T);return R([...E.hosts].reverse(),E.getTimeout)}return{hostsCache:t,requester:i,timeouts:n,algoliaAgent:o,baseHeaders:r,baseQueryParameters:a,hosts:e,request:function(e,t={}){const o=e.useReadTransporter||"GET"===e.method;if(!o)return f(e,t,o);const s=()=>f(e,t);if(!0!==(t.cacheable||e.cacheable))return s();const n={request:e,requestOptions:t,transporter:{queryParameters:a,headers:r}};return g.get(n,(()=>c.get(n,(()=>c.set(n,s()).then((e=>Promise.all([c.delete(n),e])),(e=>Promise.all([c.delete(n),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>g.set(n,e)})},requestsCache:c,responsesCache:g}}function f({algoliaAgents:e,client:t,version:r}){const a=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>a.add(e))),a}const w="5.0.0-alpha.78";function y(e){return[{url:`${e}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${e}.algolia.net`,accept:"write",protocol:"https"}].concat(function(e){const t=e;for(let r=e.length-1;r>0;r--){const a=Math.floor(Math.random()*(r+1)),o=e[r];t[r]=e[a],t[a]=o}return t}([{url:`${e}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}e.apiClientVersion=w,e.recommendClient=function(e,o,s){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!o||"string"!=typeof o)throw new Error("`apiKey` is missing.");return function({appId:e,apiKey:t,authMode:r,algoliaAgents:a,...o}){const s=function(e,t,r="WithinHeaders"){const a={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?a:{},queryParameters:()=>"WithinQueryParameters"===r?a:{}}}(e,t,r),n=g({hosts:y(e),...o,algoliaAgent:f({algoliaAgents:a,client:"Recommend",version:w}),baseHeaders:{"content-type":"text/plain",...s.headers(),...o.baseHeaders},baseQueryParameters:{...s.queryParameters(),...o.baseQueryParameters}});return{transporter:n,appId:e,clearCache:()=>Promise.all([n.requestsCache.clear(),n.responsesCache.clear()]).then((()=>{})),get _ua(){return n.algoliaAgent.value},addAlgoliaAgent(e,t){n.algoliaAgent.add({segment:e,version:t})},del({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `del`.");const a={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return n.request(a,r)},deleteRecommendRule({indexName:e,model:t,objectID:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteRecommendRule`.");if(!t)throw new Error("Parameter `model` is required when calling `deleteRecommendRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteRecommendRule`.");const o={method:"DELETE",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return n.request(o,a)},get({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `get`.");const a={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return n.request(a,r)},getRecommendRule({indexName:e,model:t,objectID:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `getRecommendRule`.");if(!t)throw new Error("Parameter `model` is required when calling `getRecommendRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getRecommendRule`.");const o={method:"GET",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return n.request(o,a)},getRecommendStatus({indexName:e,model:t,taskID:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `getRecommendStatus`.");if(!t)throw new Error("Parameter `model` is required when calling `getRecommendStatus`.");if(!r)throw new Error("Parameter `taskID` is required when calling `getRecommendStatus`.");const o={method:"GET",path:"/1/indexes/{indexName}/{model}/task/{taskID}".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)).replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return n.request(o,a)},getRecommendations(e,t){if(!e)throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");if(!e.requests)throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");const r={method:"POST",path:"/1/indexes/*/recommendations",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return n.request(r,t)},post({path:e,parameters:t,body:r},a){if(!e)throw new Error("Parameter `path` is required when calling `post`.");const o={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(o,a)},put({path:e,parameters:t,body:r},a){if(!e)throw new Error("Parameter `path` is required when calling `put`.");const o={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return n.request(o,a)},searchRecommendRules({indexName:e,model:t,searchRecommendRulesParams:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `searchRecommendRules`.");if(!t)throw new Error("Parameter `model` is required when calling `searchRecommendRules`.");const o={method:"POST",path:"/1/indexes/{indexName}/{model}/recommend/rules/search".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0};return n.request(o,a)}}}({appId:e,apiKey:o,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const a=(e,a)=>setTimeout((()=>{r.abort(),t({status:0,content:a,isTimedOut:!0})}),e),o=a(e.connectTimeout,"Connection timeout");let s;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===s&&(clearTimeout(o),s=a(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(o),clearTimeout(s),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(o),clearTimeout(s),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:a(),requestsCache:a({serializable:!1}),hostsCache:r({caches:[t({key:`${w}-${e}`}),a()]}),...s})}}));
|
|
@@ -6,7 +6,7 @@ import type { GetRecommendationsParams } from '../model/getRecommendationsParams
|
|
|
6
6
|
import type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';
|
|
7
7
|
import type { RuleResponse } from '../model/ruleResponse';
|
|
8
8
|
import type { SearchRecommendRulesResponse } from '../model/searchRecommendRulesResponse';
|
|
9
|
-
export declare const apiClientVersion = "5.0.0-alpha.
|
|
9
|
+
export declare const apiClientVersion = "5.0.0-alpha.78";
|
|
10
10
|
export declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
|
|
11
11
|
transporter: import("@algolia/client-common").Transporter;
|
|
12
12
|
/**
|
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// eslint-disable-next-line import/no-commonjs,import/extensions
|
|
2
|
-
module.exports = require('./dist/recommend.cjs
|
|
2
|
+
module.exports = require('./dist/recommend.cjs');
|
|
@@ -5,7 +5,6 @@ import type { AroundRadius } from './aroundRadius';
|
|
|
5
5
|
import type { FacetFilters } from './facetFilters';
|
|
6
6
|
import type { NumericFilters } from './numericFilters';
|
|
7
7
|
import type { OptionalFilters } from './optionalFilters';
|
|
8
|
-
import type { ReRankingApplyFilter } from './reRankingApplyFilter';
|
|
9
8
|
import type { TagFilters } from './tagFilters';
|
|
10
9
|
|
|
11
10
|
export type BaseSearchParamsWithoutQuery = {
|
|
@@ -33,25 +32,20 @@ export type BaseSearchParamsWithoutQuery = {
|
|
|
33
32
|
sumOrFiltersScores?: boolean;
|
|
34
33
|
|
|
35
34
|
/**
|
|
36
|
-
*
|
|
35
|
+
* Restricts a query to only look at a subset of your [searchable attributes](https://www.algolia.com/doc/guides/managing-results/must-do/searchable-attributes/).
|
|
37
36
|
*/
|
|
38
|
-
|
|
37
|
+
restrictSearchableAttributes?: string[];
|
|
39
38
|
|
|
40
39
|
/**
|
|
41
|
-
*
|
|
40
|
+
* Returns [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts), their facet values, and the number of matching facet values.
|
|
42
41
|
*/
|
|
43
|
-
|
|
42
|
+
facets?: string[];
|
|
44
43
|
|
|
45
44
|
/**
|
|
46
45
|
* Forces faceting to be applied after [de-duplication](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/) (with the distinct feature). Alternatively, the `afterDistinct` [modifier](https://www.algolia.com/doc/api-reference/api-parameters/attributesForFaceting/#modifiers) of `attributesForFaceting` allows for more granular control.
|
|
47
46
|
*/
|
|
48
47
|
facetingAfterDistinct?: boolean;
|
|
49
48
|
|
|
50
|
-
/**
|
|
51
|
-
* Controls how facet values are fetched.
|
|
52
|
-
*/
|
|
53
|
-
sortFacetValuesBy?: string;
|
|
54
|
-
|
|
55
49
|
/**
|
|
56
50
|
* Page to retrieve (the first page is `0`, not `1`).
|
|
57
51
|
*/
|
|
@@ -121,6 +115,16 @@ export type BaseSearchParamsWithoutQuery = {
|
|
|
121
115
|
*/
|
|
122
116
|
getRankingInfo?: boolean;
|
|
123
117
|
|
|
118
|
+
/**
|
|
119
|
+
* Enriches the API\'s response with information about how the query was processed.
|
|
120
|
+
*/
|
|
121
|
+
explain?: string[];
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Whether to take into account an index\'s synonyms for a particular search.
|
|
125
|
+
*/
|
|
126
|
+
synonyms?: boolean;
|
|
127
|
+
|
|
124
128
|
/**
|
|
125
129
|
* Indicates whether a query ID parameter is included in the search response. This is required for [tracking click and conversion events](https://www.algolia.com/doc/guides/sending-events/concepts/event-types/#events-related-to-algolia-requests).
|
|
126
130
|
*/
|
|
@@ -145,11 +149,4 @@ export type BaseSearchParamsWithoutQuery = {
|
|
|
145
149
|
* Incidates whether this search will be considered in A/B testing.
|
|
146
150
|
*/
|
|
147
151
|
enableABTest?: boolean;
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Indicates whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/).
|
|
151
|
-
*/
|
|
152
|
-
enableReRanking?: boolean;
|
|
153
|
-
|
|
154
|
-
reRankingApplyFilter?: ReRankingApplyFilter | null;
|
|
155
152
|
};
|
package/model/index.ts
CHANGED
|
@@ -39,7 +39,6 @@ export * from './highlightResult';
|
|
|
39
39
|
export * from './highlightResultOption';
|
|
40
40
|
export * from './ignorePlurals';
|
|
41
41
|
export * from './indexSettingsAsSearchParams';
|
|
42
|
-
export * from './indexSettingsAsSearchParamsSemanticSearch';
|
|
43
42
|
export * from './matchLevel';
|
|
44
43
|
export * from './matchedGeoLocation';
|
|
45
44
|
export * from './mixedSearchFilters';
|
|
@@ -72,6 +71,7 @@ export * from './searchParamsObject';
|
|
|
72
71
|
export * from './searchParamsQuery';
|
|
73
72
|
export * from './searchRecommendRulesParams';
|
|
74
73
|
export * from './searchRecommendRulesResponse';
|
|
74
|
+
export * from './semanticSearch';
|
|
75
75
|
export * from './snippetResult';
|
|
76
76
|
export * from './snippetResultOption';
|
|
77
77
|
export * from './sortRemainingBy';
|
|
@@ -5,12 +5,13 @@ import type { AlternativesAsExact } from './alternativesAsExact';
|
|
|
5
5
|
import type { Distinct } from './distinct';
|
|
6
6
|
import type { ExactOnSingleWordQuery } from './exactOnSingleWordQuery';
|
|
7
7
|
import type { IgnorePlurals } from './ignorePlurals';
|
|
8
|
-
import type { IndexSettingsAsSearchParamsSemanticSearch } from './indexSettingsAsSearchParamsSemanticSearch';
|
|
9
8
|
import type { Mode } from './mode';
|
|
10
9
|
import type { QueryType } from './queryType';
|
|
10
|
+
import type { ReRankingApplyFilter } from './reRankingApplyFilter';
|
|
11
11
|
import type { RemoveStopWords } from './removeStopWords';
|
|
12
12
|
import type { RemoveWordsIfNoResults } from './removeWordsIfNoResults';
|
|
13
13
|
import type { RenderingContent } from './renderingContent';
|
|
14
|
+
import type { SemanticSearch } from './semanticSearch';
|
|
14
15
|
import type { TypoTolerance } from './typoTolerance';
|
|
15
16
|
|
|
16
17
|
export type IndexSettingsAsSearchParams = {
|
|
@@ -24,11 +25,6 @@ export type IndexSettingsAsSearchParams = {
|
|
|
24
25
|
*/
|
|
25
26
|
attributesToRetrieve?: string[];
|
|
26
27
|
|
|
27
|
-
/**
|
|
28
|
-
* Restricts a query to only look at a subset of your [searchable attributes](https://www.algolia.com/doc/guides/managing-results/must-do/searchable-attributes/).
|
|
29
|
-
*/
|
|
30
|
-
restrictSearchableAttributes?: string[];
|
|
31
|
-
|
|
32
28
|
/**
|
|
33
29
|
* Determines the order in which Algolia [returns your results](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/).
|
|
34
30
|
*/
|
|
@@ -136,7 +132,7 @@ export type IndexSettingsAsSearchParams = {
|
|
|
136
132
|
|
|
137
133
|
mode?: Mode;
|
|
138
134
|
|
|
139
|
-
semanticSearch?:
|
|
135
|
+
semanticSearch?: SemanticSearch;
|
|
140
136
|
|
|
141
137
|
/**
|
|
142
138
|
* Enables the [advanced query syntax](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/#advanced-syntax).
|
|
@@ -165,11 +161,6 @@ export type IndexSettingsAsSearchParams = {
|
|
|
165
161
|
*/
|
|
166
162
|
advancedSyntaxFeatures?: AdvancedSyntaxFeatures[];
|
|
167
163
|
|
|
168
|
-
/**
|
|
169
|
-
* Enriches the API\'s response with information about how the query was processed.
|
|
170
|
-
*/
|
|
171
|
-
explain?: string[];
|
|
172
|
-
|
|
173
164
|
distinct?: Distinct;
|
|
174
165
|
|
|
175
166
|
/**
|
|
@@ -177,11 +168,6 @@ export type IndexSettingsAsSearchParams = {
|
|
|
177
168
|
*/
|
|
178
169
|
attributeForDistinct?: string;
|
|
179
170
|
|
|
180
|
-
/**
|
|
181
|
-
* Whether to take into account an index\'s synonyms for a particular search.
|
|
182
|
-
*/
|
|
183
|
-
synonyms?: boolean;
|
|
184
|
-
|
|
185
171
|
/**
|
|
186
172
|
* Whether to highlight and snippet the original word that matches the synonym or the synonym itself.
|
|
187
173
|
*/
|
|
@@ -202,10 +188,27 @@ export type IndexSettingsAsSearchParams = {
|
|
|
202
188
|
*/
|
|
203
189
|
maxFacetHits?: number;
|
|
204
190
|
|
|
191
|
+
/**
|
|
192
|
+
* Maximum number of facet values to return for each facet.
|
|
193
|
+
*/
|
|
194
|
+
maxValuesPerFacet?: number;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Controls how facet values are fetched.
|
|
198
|
+
*/
|
|
199
|
+
sortFacetValuesBy?: string;
|
|
200
|
+
|
|
205
201
|
/**
|
|
206
202
|
* When the [Attribute criterion is ranked above Proximity](https://www.algolia.com/doc/guides/managing-results/relevance-overview/in-depth/ranking-criteria/#attribute-and-proximity-combinations) in your ranking formula, Proximity is used to select which searchable attribute is matched in the Attribute ranking stage.
|
|
207
203
|
*/
|
|
208
204
|
attributeCriteriaComputedByMinProximity?: boolean;
|
|
209
205
|
|
|
210
206
|
renderingContent?: RenderingContent;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Indicates whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/).
|
|
210
|
+
*/
|
|
211
|
+
enableReRanking?: boolean;
|
|
212
|
+
|
|
213
|
+
reRankingApplyFilter?: ReRankingApplyFilter | null;
|
|
211
214
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Settings for the semantic search part of NeuralSearch. Only used when `mode` is _neuralSearch_.
|
|
5
5
|
*/
|
|
6
|
-
export type
|
|
6
|
+
export type SemanticSearch = {
|
|
7
7
|
/**
|
|
8
8
|
* Indices from which to collect click and conversion events. If null, the current index and replica group will be used as the event source.
|
|
9
9
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@algolia/recommend",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.78",
|
|
4
4
|
"description": "JavaScript client for recommend",
|
|
5
5
|
"repository": "algolia/algoliasearch-client-javascript",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"node": {
|
|
12
12
|
"import": "./dist/recommend.esm.node.js",
|
|
13
13
|
"module": "./dist/recommend.esm.node.js",
|
|
14
|
-
"require": "./dist/recommend.cjs
|
|
15
|
-
"default": "./dist/recommend.cjs
|
|
14
|
+
"require": "./dist/recommend.cjs",
|
|
15
|
+
"default": "./dist/recommend.cjs"
|
|
16
16
|
},
|
|
17
17
|
"default": {
|
|
18
18
|
"umd": "./dist/recommend.umd.js",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
"clean": "rm -rf ./dist || true"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@algolia/client-common": "5.0.0-alpha.
|
|
43
|
-
"@algolia/requester-browser-xhr": "5.0.0-alpha.
|
|
44
|
-
"@algolia/requester-node-http": "5.0.0-alpha.
|
|
42
|
+
"@algolia/client-common": "5.0.0-alpha.78",
|
|
43
|
+
"@algolia/requester-browser-xhr": "5.0.0-alpha.78",
|
|
44
|
+
"@algolia/requester-node-http": "5.0.0-alpha.78"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@types/node": "18.17.
|
|
48
|
-
"rollup": "3.
|
|
47
|
+
"@types/node": "18.17.5",
|
|
48
|
+
"rollup": "3.28.0",
|
|
49
49
|
"typescript": "5.1.6"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"indexSettingsAsSearchParamsSemanticSearch.d.ts","sourceRoot":"","sources":["../../model/indexSettingsAsSearchParamsSemanticSearch.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,yCAAyC,GAAG;IACtD;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CAChC,CAAC"}
|